Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: sizes customizing - set of new components #2396

Merged
merged 42 commits into from
Sep 13, 2024

Conversation

siarhei-epam
Copy link
Collaborator

@siarhei-epam siarhei-epam commented Jun 28, 2024

Description:

Added a set of new components with support for size customization.

LabledInput - changed right padding for labelPosition prop from 5px to 6px (agreed with the design team)
Paginator - changed width for 3 dots (agreed with the design team)
PickerInputBody - changed left/right padding for search container according design
DatePickerBody - changed top padding for container (agreed with the design team)
TextArea - fixed line-height in 24 size, changed internal paddings according design

@siarhei-epam siarhei-epam added the feature New feature or request label Jun 28, 2024
@siarhei-epam siarhei-epam self-assigned this Jun 28, 2024
Copy link

github-actions bot commented Jun 28, 2024

Generated by: track-bundle-size
Generated at: Wed, 11 Sep 2024 19:40:55 GMT
Bundle size diff (in kBytes). Not gzipped. Both CSS & JS included.
Baseline: v5.8.4 (2024-07-30)
CI Status: ok

Module Baseline Size
(v5.8.4)
Size Diff Within
Threshold
Threshold
(min - max)
templateApp 755.39 763 +7.61
js:+0.56
css:+7.06
🆗 679.85 - 830.92
@epam/app 6552.38 6629.78 +77.39
js:+17.75
css:+59.64
🆗 5897.14 - 7207.62
@epam/draft-rte 53.77 53.78 +0.02
js:+0
css:+0.01
🆗 48.39 - 59.15
@epam/electric 4.57 4.57 0
js:0
css:0
🆗 4.12 - 5.03
@epam/promo 55.66 57.17 +1.5
js:-0.04
css:+1.54
🆗 50.1 - 61.23
@epam/uui-extra 0.21 0.21 0
js:0
css:0
🆗 0.19 - 0.23
@epam/loveship 92.08 93.73 +1.65
js:-0.01
css:+1.66
🆗 82.88 - 101.3
@epam/uui-components 260.74 262.96 +2.22
js:+2.05
css:+0.17
🆗 234.66 - 286.81
@epam/uui-core 333.83 335.51 +1.68
js:+1.68
css:0
🆗 300.45 - 367.21
@epam/uui-db 44.7 44.7 0
js:0
css:0
🆗 40.23 - 49.17
@epam/uui-docs 206.75 207.12 +0.37
js:+0.37
css:0
🆗 186.07 - 227.43
@epam/uui-editor 181.56 183.43 +1.87
js:+1.87
css:0
🆗 163.41 - 199.72
@epam/uui-timeline 77.95 79.51 +1.55
js:+1.55
css:0
🆗 70.16 - 85.75
@epam/uui 601.25 604.53 +3.29
js:+0.22
css:+3.06
🆗 541.12 - 661.37
new sizes (raw)

To set the sizes as a new baseline, you can copy/paste next content to the uui-build/config/bundleSizeBaseLine.json and commit the file.

{
  "version": "5.9.1",
  "timestamp": "2024-09-11",
  "sizes": {
    "templateApp": {
      "css": 299321,
      "js": 481988
    },
    "@epam/app": {
      "css": 1660826,
      "js": 5128064
    },
    "@epam/draft-rte": {
      "css": 9784,
      "js": 45294
    },
    "@epam/electric": {
      "css": 2275,
      "js": 2408
    },
    "@epam/promo": {
      "css": 47645,
      "js": 10892
    },
    "@epam/uui-extra": {
      "css": 0,
      "js": 213
    },
    "@epam/loveship": {
      "css": 53447,
      "js": 42540
    },
    "@epam/uui-components": {
      "css": 22496,
      "js": 246769
    },
    "@epam/uui-core": {
      "css": 0,
      "js": 343565
    },
    "@epam/uui-db": {
      "css": 0,
      "js": 45769
    },
    "@epam/uui-docs": {
      "css": 2448,
      "js": 209641
    },
    "@epam/uui-editor": {
      "css": 12499,
      "js": 175334
    },
    "@epam/uui-timeline": {
      "css": 2252,
      "js": 79163
    },
    "@epam/uui": {
      "css": 277113,
      "js": 341924
    }
  }
}

Generated by: generate-components-api
CI Status: ok

Total amount of exported types/props without JSDoc comments

Amount
Types 301 (+6) ⚠️🆗
Props 233 (+0) 🆗
New missing comments
NOTE: It's either a new exported types/props without JSDoc, or it's an existing code from which you deleted the JSDoc comments.
Types:
- @epam/uui:DataPickerFooterProps
- @epam/uui:DataTableHeaderCellModsOverride
- @epam/uui:DataTableModsOverride
- @epam/uui:PaginatorModsOverride
- @epam/uui:PaginatorProps
- @epam/uui:Settings
Props:
- <empty>

@siarhei-epam siarhei-epam marked this pull request as ready for review July 9, 2024 11:00
AlekseyManetov and others added 19 commits July 9, 2024 13:32
# Conflicts:
#	app/package.json
#	changelog.md
#	draft-rte/package.json
#	epam-assets/package.json
#	epam-electric/package.json
#	epam-promo/package.json
#	extra/package.json
#	lerna.json
#	loveship/package.json
#	templates/uui-cra-template/package.json
#	test-utils/package.json
#	uui-build/package.json
#	uui-components/package.json
#	uui-core/package.json
#	uui-db/package.json
#	uui-docs/package.json
#	uui-e2e-tests/package.json
#	uui-editor/package.json
#	uui-timeline/package.json
#	uui/package.json
# Conflicts:
#	app/src/common/AppHeader.module.scss
#	app/src/common/AppHeader.tsx
# Conflicts:
#	uui-e2e-tests/tests/previewTests/__screenshots__/linux/chromium/RangeDatePicker-Opened-Electric-NotSkin.png
#	uui-e2e-tests/tests/previewTests/__screenshots__/linux/chromium/RangeDatePicker-Opened-Loveship-NotSkin.png
#	uui-e2e-tests/tests/previewTests/__screenshots__/linux/chromium/RangeDatePicker-Opened-LoveshipDark-NotSkin.png
#	uui-e2e-tests/tests/previewTests/__screenshots__/linux/chromium/RangeDatePicker-Opened-Promo-NotSkin.png
#	uui/components/datePickers/CalendarPresets.module.scss
#	uui/components/datePickers/DatePickerBody.module.scss
#	uui/components/datePickers/RangeDatePicker.tsx
#	uui/components/datePickers/__tests__/__snapshots__/RangeDatePicker.test.tsx.snap
#	uui/components/tables/__tests__/__snapshots__/DataTableCell.test.tsx.snap
#	uui/components/tables/__tests__/__snapshots__/DataTableRow.test.tsx.snap
#	uui/components/widgets/Badge.module.scss
#	uui/components/widgets/CountIndicator.module.scss
#	uui/index.tsx
# Conflicts:
#	uui/components/pickers/DataPickerCell.tsx
…ach, fixed support 'rtl' for some components & site, updated 'dayjs' package
* Defines text size
* @default '36'
*/
size?: TextSize;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be able to override the size type in the uui package, accordingly, this must be written in the skins

export class DataTableHeaderCell<TItem, TId> extends React.Component<DataTableHeaderCellProps<TItem, TId> & DataTableRenderProps, DataTableHeaderCellState> {
observer: MutationObserver;

constructor(props: DataTableHeaderCellProps<TItem, TId> & DataTableRenderProps) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove observer logic, just use window?.document.dir value due to potential performance issues

:global(.uui-pickerInput-body) {
--uui-dt-cell-border-width: 0;
--uui-pickerInput-selected_mark: var(--uui-info-50);
:global(.uui-picker_input-body) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't use camel case, I brought to the unity of using classes on the project

@@ -2,25 +2,40 @@ import * as React from 'react';
import { IconContainer, DataTableSelectionProvider, DataTableFocusManager, DataTableFocusProvider } from '@epam/uui-components';
import { useColumnsWithFilters } from '../../helpers';
import {
ColumnsConfig, DataRowProps, useUuiContext, uuiScrollShadows, useColumnsConfig, IEditable, DataTableState, DataTableColumnsConfigOptions,
DataSourceListProps, DataColumnProps, cx, TableFiltersConfig, DataTableRowProps, DataTableSelectedCellData,
ColumnsConfig,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

place in a multiline

* Defines table header size
* @default '36'
* */
headerSize?: '36' | '48' | '60';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to DataTableMods to be able to override the type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding: {
                modal: '24',
                default: '12', -> to dropdown
            },

uui/settings.ts Outdated
utmost: '24',
},
},
dataTableRow: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataTableRow: {
        defaults: {
            columnsGap: '24',
        },

    },

uui/settings.ts Outdated
default: '12',
},
leftPadding: {
default: '12',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably replace with gap?

uui/settings.ts Outdated
60: '48',
},
leftPadding: {
editable: '0',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcode editable value

uui/settings.ts Outdated
},
leftPadding: {
default: '12',
utmost: '24',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably firstColumnPadding and lastColumnPading

@AlekseyManetov AlekseyManetov modified the milestone: 4.1.0 Sep 11, 2024
@@ -42,10 +42,10 @@ function DataPickerFooterImpl<TItem, TId>(props: PropsWithChildren<DataPickerFoo
const shouldShowFooter = isSinglePicker ? (!isSearching && !props.disableClear) : !isSearching;

return shouldShowFooter && (
<FlexRow size={ props.size } padding={ settings.sizes.dataPickerFooter.flexRowPadding as FlexRowProps['padding'] }>
<FlexRow padding={ settings.sizes.pickerInput.body.dropdown.padding as FlexRowProps['padding'] }>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can move this from settings to css variable?

@@ -88,5 +88,6 @@ export function PickerItem<TItem, TId>(props: PickerItemProps<TItem, TId>) {
}

function getAvatarSize(size: PickerItemProps<any, any>['size'], isMultiline: boolean): string | number {
return settings.sizes.pickerItem.avatar[isMultiline ? 'multiline' : 'rest'][size];
console.log('ava', settings.sizes.pickerInput.body.dropdown.row.cell.item.avatar[isMultiline ? 'multiline' : 'rest'][size]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove console.log

cx={ isMultiline && [css.multiline, css[`vertical-padding-${itemSize}`]] }
columnGap="12"
cx={ [isMultiline && css.multiline, css.columnGap] }
rawProps={ { style: { '--uui-picker_item-vertical-padding': `${settings.sizes.pickerInput.body.dropdown.row.cell.item.verticalPadding[itemSize]}px` } as React.CSSProperties } }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably move to the css-variable based on size class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need to dive a little deeper into this, collect the components and see how we can generalize

{this.props.column.caption}
<Text
key="text"
lineHeight={ settings.sizes.dataTable.header.row.cell.columnCaption.lineHeight as TextProps['lineHeight'] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can move settings.sizes.dataTable.header.row.cell.columnCaption.lineHeight from settings to css variable?

@AlekseyManetov AlekseyManetov merged commit b284ec9 into develop Sep 13, 2024
4 checks passed
@NatalliaAlieva
Copy link
Collaborator

NatalliaAlieva commented Sep 25, 2024

Column header no longer wraps to 2 lines in the "Condensed view" example.
Screenshot 2024-09-25 at 13 28 27

@NatalliaAlieva
Copy link
Collaborator

NatalliaAlieva commented Sep 25, 2024

Navigation-chevron_right icon larger on Dev than on Prod in the "Table with expandable rows".
Screenshot 2024-09-25 at 15 02 18

@NatalliaAlieva NatalliaAlieva added this to the 5.10.0 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants