@payfit/unity-components 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/action-bar/ActionBar.d.ts +153 -0
- package/dist/esm/components/action-bar/ActionBar.js +173 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.js +45 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.js +46 -0
- package/dist/esm/components/actionable/Actionable.js +20 -21
- package/dist/esm/components/alert/Alert.d.ts +1 -1
- package/dist/esm/components/alert/Alert.js +1 -1
- package/dist/esm/components/alert/parts/AlertActions.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertActions.js +1 -1
- package/dist/esm/components/alert/parts/AlertContent.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertTitle.d.ts +1 -1
- package/dist/esm/components/anchor/Anchor.js +1 -1
- package/dist/esm/components/app-layout/AppLayout.js +6 -6
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +30 -30
- package/dist/esm/components/app-menu/parts/AppMenuNavContent.js +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.js +14 -14
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +4 -4
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.js +12 -12
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.js +7 -7
- package/dist/esm/components/avatar/Avatar.d.ts +1 -1
- package/dist/esm/components/avatar/Avatar.js +15 -16
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +9 -10
- package/dist/esm/components/avatar/parts/AvatarImage.js +12 -12
- package/dist/esm/components/avatar/parts/AvatarPair.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarPair.js +4 -4
- package/dist/esm/components/badge/Badge.d.ts +1 -1
- package/dist/esm/components/badge/Badge.js +31 -35
- package/dist/esm/components/bottom-sheet/BottomSheet.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/BottomSheet.js +14 -14
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +11 -11
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.d.ts +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.js +6 -6
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +3 -3
- package/dist/esm/components/button/Button.js +33 -41
- package/dist/esm/components/button/Button.variants.d.ts +1 -1
- package/dist/esm/components/button/Button.variants.js +1 -1
- package/dist/esm/components/checkbox/Checkbox.js +53 -49
- package/dist/esm/components/checkbox/Checkbox.variants.js +1 -1
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +1 -1
- package/dist/esm/components/checkbox-field/CheckboxField.js +39 -34
- package/dist/esm/components/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/dist/esm/components/checkbox-group/CheckboxGroup.js +12 -12
- package/dist/esm/components/collapsible/Collapsible.js +22 -16
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +16 -7
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +23 -23
- package/dist/esm/components/data-table/DataTable.d.ts +48 -17
- package/dist/esm/components/data-table/DataTable.js +104 -60
- package/dist/esm/components/data-table/mocks/employee-columns.d.ts +4 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.d.ts +55 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +65 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.d.ts +37 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.js +13 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +8 -8
- package/dist/esm/components/date-picker/DatePicker.js +9 -9
- package/dist/esm/components/date-picker/parts/DateInput.js +7 -7
- package/dist/esm/components/date-picker-field/DatePickerField.js +12 -12
- package/dist/esm/components/definition-tooltip/DefinitionTooltip.js +4 -4
- package/dist/esm/components/dialog/Dialog.d.ts +1 -1
- package/dist/esm/components/dialog/Dialog.js +9 -9
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.js +4 -4
- package/dist/esm/components/flex/Flex.d.ts +1 -1
- package/dist/esm/components/flex/Flex.variants.js +189 -207
- package/dist/esm/components/flex/FlexItem.d.ts +1 -1
- package/dist/esm/components/form/Form.context.d.ts +1 -4
- package/dist/esm/components/form/Form.context.js +11 -13
- package/dist/esm/components/form/Form.d.ts +13 -11
- package/dist/esm/components/form/Form.js +45 -48
- package/dist/esm/components/form-field/FormField.context.d.ts +1 -6
- package/dist/esm/components/form-field/FormField.context.js +39 -47
- package/dist/esm/components/form-field/FormField.d.ts +0 -2
- package/dist/esm/components/form-field/FormField.js +37 -42
- package/dist/esm/components/form-field/parts/FormContextualLink.js +17 -17
- package/dist/esm/components/form-field/parts/FormControl.js +39 -35
- package/dist/esm/components/form-field/parts/FormFeedbackText.js +15 -17
- package/dist/esm/components/full-page-loader/FullPageLoader.js +7 -7
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +2 -2
- package/dist/esm/components/funnel-layout/FunnelLayout.js +26 -26
- package/dist/esm/components/funnel-layout/parts/FunnelBody.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelBody.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelPage.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +10 -10
- package/dist/esm/components/funnel-layout/parts/FunnelPageAction.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +13 -13
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.js +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +9 -9
- package/dist/esm/components/grid/Grid.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.js +3 -3
- package/dist/esm/components/grid/GridItem.d.ts +1 -1
- package/dist/esm/components/icon/Icon.d.ts +1 -1
- package/dist/esm/components/icon/Icon.js +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.js +21 -20
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -1
- package/dist/esm/components/icon-button/IconButton.variants.js +2 -2
- package/dist/esm/components/input/Input.js +6 -6
- package/dist/esm/components/label/Label.js +13 -13
- package/dist/esm/components/link/Link.d.ts +11 -1
- package/dist/esm/components/link/Link.js +32 -30
- package/dist/esm/components/link/Link.variants.d.ts +141 -30
- package/dist/esm/components/link/Link.variants.js +44 -16
- package/dist/esm/components/menu/parts/MenuItem.js +8 -8
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +14 -14
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +5 -5
- package/dist/esm/components/multi-select/parts/MultiSelectOption.js +3 -3
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +1 -1
- package/dist/esm/components/multi-select-field/MultiSelectField.js +6 -6
- package/dist/esm/components/nav/parts/NavGroup.js +28 -29
- package/dist/esm/components/nav/parts/NavItem.d.ts +1 -1
- package/dist/esm/components/nav/parts/NavItem.js +13 -14
- package/dist/esm/components/number-field/NumberField.js +14 -14
- package/dist/esm/components/number-input/NumberInput.d.ts +2 -2
- package/dist/esm/components/number-input/NumberInput.js +37 -37
- package/dist/esm/components/page/Page.d.ts +1 -1
- package/dist/esm/components/page/Page.js +5 -5
- package/dist/esm/components/page/parts/PageHeader.d.ts +1 -1
- package/dist/esm/components/page/parts/PageHeader.js +4 -4
- package/dist/esm/components/pagination/Pagination.d.ts +1 -1
- package/dist/esm/components/pagination/Pagination.js +16 -16
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +8 -8
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +9 -9
- package/dist/esm/components/pagination/parts/PaginationLink.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationLink.js +6 -6
- package/dist/esm/components/payfit-brand/PayFitBrand.js +4 -4
- package/dist/esm/components/pill/Pill.d.ts +1 -1
- package/dist/esm/components/pill/Pill.js +1 -1
- package/dist/esm/components/popover/Popover.js +5 -5
- package/dist/esm/components/popover/parts/PopoverHeader.js +7 -7
- package/dist/esm/components/progress-bar/ProgressBar.js +11 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +1 -1
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +5 -5
- package/dist/esm/components/search/Search.d.ts +1 -1
- package/dist/esm/components/search/Search.js +14 -14
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +10 -10
- package/dist/esm/components/select/Select.js +12 -12
- package/dist/esm/components/select/parts/SearchInput.js +7 -7
- package/dist/esm/components/select/parts/SelectButton.js +17 -14
- package/dist/esm/components/select/parts/SelectOption.js +4 -4
- package/dist/esm/components/select/parts/SelectOptionGroup.js +8 -8
- package/dist/esm/components/select/parts/SelectOptionHelper.js +1 -1
- package/dist/esm/components/select-field/SelectField.d.ts +1 -1
- package/dist/esm/components/select-field/SelectField.js +16 -16
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +1 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +8 -8
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +10 -10
- package/dist/esm/components/selectable-card/internals/Content.js +5 -5
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/internals/Illustration.js +3 -3
- package/dist/esm/components/selectable-card/internals/SelectedIndicator.js +4 -4
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +3 -3
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectableCard.variant.js +1 -1
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.js +22 -22
- package/dist/esm/components/side-panel/SidePanel.d.ts +1 -1
- package/dist/esm/components/side-panel/SidePanel.js +6 -6
- package/dist/esm/components/side-panel/parts/SidePanelContent.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelContent.js +9 -9
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +11 -11
- package/dist/esm/components/side-panel/parts/SidePanelFooter.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelFooter.js +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.d.ts +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.js +6 -6
- package/dist/esm/components/skip-links/SkipLinks.d.ts +79 -0
- package/dist/esm/components/skip-links/SkipLinks.js +80 -0
- package/dist/esm/components/spinner/Spinner.js +5 -5
- package/dist/esm/components/table/Table.js +101 -100
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.d.ts +1 -19
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +147 -95
- package/dist/esm/components/table/parts/TableBody.js +1 -1
- package/dist/esm/components/table/parts/TableCell.d.ts +17 -1
- package/dist/esm/components/table/parts/TableCell.js +45 -41
- package/dist/esm/components/table/parts/TableColumnHeader.d.ts +2 -1
- package/dist/esm/components/table/parts/TableColumnHeader.js +63 -57
- package/dist/esm/components/table/parts/TableEmptyState.d.ts +1 -1
- package/dist/esm/components/table/parts/TableEmptyState.js +1 -1
- package/dist/esm/components/table/parts/TableHeader.d.ts +3 -3
- package/dist/esm/components/table/parts/TableHeader.js +28 -26
- package/dist/esm/components/table/parts/TablePagination.d.ts +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +9 -9
- package/dist/esm/components/table/parts/TableRow.d.ts +1 -1
- package/dist/esm/components/table/parts/TableRow.js +36 -34
- package/dist/esm/components/tabs/Tabs.context.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.variant.js +1 -1
- package/dist/esm/components/tabs/parts/NavigationButton.js +12 -12
- package/dist/esm/components/tabs/parts/Tab.d.ts +3 -2
- package/dist/esm/components/tabs/parts/Tab.js +12 -12
- package/dist/esm/components/tabs/parts/TabPanel.d.ts +4 -2
- package/dist/esm/components/tabs/parts/TabPanel.js +7 -7
- package/dist/esm/components/task-menu/TaskMenu.d.ts +1 -1
- package/dist/esm/components/task-menu/TaskMenu.js +7 -7
- package/dist/esm/components/task-menu/parts/Content.js +6 -6
- package/dist/esm/components/task-menu/parts/Header.js +7 -7
- package/dist/esm/components/task-menu/parts/SubTask.js +6 -6
- package/dist/esm/components/task-menu/parts/Task.d.ts +1 -1
- package/dist/esm/components/task-menu/parts/Task.js +12 -12
- package/dist/esm/components/task-menu/parts/TaskGroup.js +7 -7
- package/dist/esm/components/task-menu/parts/task.variants.js +1 -1
- package/dist/esm/components/text/Text.d.ts +1 -1
- package/dist/esm/components/text/Text.variants.js +1 -1
- package/dist/esm/components/text-area/TextArea.js +6 -6
- package/dist/esm/components/text-field/TextField.js +5 -5
- package/dist/esm/components/toast/UnityToast.d.ts +1 -1
- package/dist/esm/components/toast/UnityToast.js +11 -11
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +1 -1
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +4 -4
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +35 -31
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.d.ts +1 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +5 -5
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +43 -38
- package/dist/esm/components/tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/components/tooltip/Tooltip.js +27 -19
- package/dist/esm/hooks/use-form.js +7 -7
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.js +366 -352
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +28 -0
- package/dist/esm/integrations/react-router/v5/index.d.ts +1 -0
- package/dist/esm/integrations/react-router/v5.js +4 -0
- package/i18n/en-GB.json +6 -0
- package/i18n/es-ES.json +6 -0
- package/i18n/fr-FR.json +6 -0
- package/package.json +38 -35
- package/dist/esm/providers/router/integrations/UnityReactRouterV5Provider.js +0 -28
- /package/dist/esm/{providers/router/integrations → integrations/react-router/v5}/UnityReactRouterV5Provider.d.ts +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Table as TableType } from '@tanstack/react-table';
|
|
2
|
+
import { ActionBarProps } from '../../action-bar/ActionBar.js';
|
|
3
|
+
export interface DataTableBulkActionsProps<TData> {
|
|
4
|
+
/** The table instance from @tanstack/react-table */
|
|
5
|
+
table: TableType<TData>;
|
|
6
|
+
/** Bulk actions to perform over the table, rendered in the action bar */
|
|
7
|
+
actions: ActionBarProps['actions'];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The DataTableBulkActions component provides contextual bulk actions when table rows are selected.
|
|
11
|
+
* It automatically shows/hides based on row selection and provides keyboard accessibility via Alt+A (Option+A on Mac).
|
|
12
|
+
* @param {DataTableBulkActionsProps} props - The props for the DataTableBulkActions component
|
|
13
|
+
* @param props.table - The table instance from `@tanstack/react-table`
|
|
14
|
+
* @param props.actions - Bulk actions to perform over the table, rendered in the action bar
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { DataTableRoot, DataTable, DataTableBulkActions } from '@payfit/unity-components'
|
|
18
|
+
*
|
|
19
|
+
* function Example() {
|
|
20
|
+
* const actions = [
|
|
21
|
+
* { id: 'delete', label: 'Delete', onPress: handleDelete },
|
|
22
|
+
* { id: 'archive', label: 'Archive', onPress: handleArchive },
|
|
23
|
+
* ]
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <DataTableRoot>
|
|
27
|
+
* <DataTable table={table}>
|
|
28
|
+
* {row => (
|
|
29
|
+
* <TableRow key={row.id} isSelected={row.getIsSelected()}>
|
|
30
|
+
* {row.getVisibleCells().map(cell => (
|
|
31
|
+
* <TableCell key={cell.id}>
|
|
32
|
+
* {flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
33
|
+
* </TableCell>
|
|
34
|
+
* ))}
|
|
35
|
+
* </TableRow>
|
|
36
|
+
* )}
|
|
37
|
+
* </DataTable>
|
|
38
|
+
* <DataTableBulkActions table={table} actions={actions} />
|
|
39
|
+
* </DataTableRoot>
|
|
40
|
+
* )
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
* @remarks
|
|
44
|
+
* - Use F6 keyboard shortcut to focus the action bar when it's visible and has actions
|
|
45
|
+
* - The keyboard shortcut provides quick access to bulk actions for users with disabilities
|
|
46
|
+
* - When triggered, focus moves to the first focusable element in the action bar (typically the first action button)
|
|
47
|
+
* - The shortcut only works when rows are selected and the action bar is visible
|
|
48
|
+
* @see {@link DataTableBulkActionsProps} for all available props
|
|
49
|
+
* @see Source code in [Github](https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/data-table)
|
|
50
|
+
*/
|
|
51
|
+
declare function DataTableBulkActions<TData extends object>({ table, actions, }: DataTableBulkActionsProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
52
|
+
declare namespace DataTableBulkActions {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
export { DataTableBulkActions };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i, useState as A, useCallback as R } from "react";
|
|
3
|
+
import { useHotkeys as u } from "react-hotkeys-hook";
|
|
4
|
+
import { ActionBar as p } from "../../action-bar/ActionBar.js";
|
|
5
|
+
import { ActionBarAction as w } from "../../action-bar/parts/ActionBarAction.js";
|
|
6
|
+
import { ActionBarRoot as B } from "../../action-bar/parts/ActionBarRoot.js";
|
|
7
|
+
function k({
|
|
8
|
+
table: e,
|
|
9
|
+
actions: n
|
|
10
|
+
}) {
|
|
11
|
+
const s = i(null), r = i(null), [a, t] = A(!1), f = e.getState().rowSelection;
|
|
12
|
+
Object.keys(f).sort().join(","), u(
|
|
13
|
+
"f6",
|
|
14
|
+
() => {
|
|
15
|
+
if ((e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected()) && n && s.current) {
|
|
16
|
+
const l = s.current.querySelectorAll(
|
|
17
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
18
|
+
);
|
|
19
|
+
r.current = document.activeElement, l.length > 0 && (l[0].focus(), t(!0));
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
enableOnFormTags: !0
|
|
24
|
+
}
|
|
25
|
+
), u(
|
|
26
|
+
"esc",
|
|
27
|
+
() => {
|
|
28
|
+
a && r.current && (r.current.focus(), t(!1));
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
enableOnFormTags: !0
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
const m = e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected(), d = e.getSelectedRowModel().rows.length, g = e.getPageCount() > 1, S = R(() => {
|
|
35
|
+
e.resetRowSelection();
|
|
36
|
+
}, [e]);
|
|
37
|
+
return n ? /* @__PURE__ */ c(
|
|
38
|
+
B,
|
|
39
|
+
{
|
|
40
|
+
isVisible: m,
|
|
41
|
+
offsetBottom: g ? "$600" : 0,
|
|
42
|
+
children: /* @__PURE__ */ c(
|
|
43
|
+
p,
|
|
44
|
+
{
|
|
45
|
+
ref: s,
|
|
46
|
+
actions: n,
|
|
47
|
+
selectionCount: d,
|
|
48
|
+
onClearSelection: S,
|
|
49
|
+
onFocus: () => {
|
|
50
|
+
t(!0);
|
|
51
|
+
},
|
|
52
|
+
onBlur: () => {
|
|
53
|
+
t(!1);
|
|
54
|
+
},
|
|
55
|
+
"aria-keyshortcuts": "f6",
|
|
56
|
+
children: (o) => /* @__PURE__ */ c(w, { ...o, children: o.label }, o.id)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
) : null;
|
|
61
|
+
}
|
|
62
|
+
k.displayName = "DataTableBulkActions";
|
|
63
|
+
export {
|
|
64
|
+
k as DataTableBulkActions
|
|
65
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare const dataTableRoot: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
3
|
+
export type DataTableRootProps = PropsWithChildren;
|
|
4
|
+
/**
|
|
5
|
+
* The DataTableRoot component provides positioning and layout context for DataTable components.
|
|
6
|
+
* It serves as the container for DataTable, DataTableBulkActions, and other related components.
|
|
7
|
+
* @param {DataTableRootProps} props - The props for the DataTableRoot component
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { DataTableRoot, DataTable, DataTableBulkActions } from '@payfit/unity-components'
|
|
11
|
+
*
|
|
12
|
+
* function Example() {
|
|
13
|
+
* return (
|
|
14
|
+
* <DataTableRoot>
|
|
15
|
+
* <DataTable table={table}>
|
|
16
|
+
* {row => (
|
|
17
|
+
* <TableRow key={row.id} isSelected={row.getIsSelected()}>
|
|
18
|
+
* {row.getVisibleCells().map(cell => (
|
|
19
|
+
* <TableCell key={cell.id}>
|
|
20
|
+
* {flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
21
|
+
* </TableCell>
|
|
22
|
+
* ))}
|
|
23
|
+
* </TableRow>
|
|
24
|
+
* )}
|
|
25
|
+
* </DataTable>
|
|
26
|
+
* <DataTableBulkActions table={table} actions={actions} />
|
|
27
|
+
* </DataTableRoot>
|
|
28
|
+
* )
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
* @see {@link DataTableRootProps} for all available props
|
|
32
|
+
* @see Source code in [Github](https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/data-table)
|
|
33
|
+
*/
|
|
34
|
+
declare const DataTableRoot: import('react').ForwardRefExoticComponent<{
|
|
35
|
+
children?: import('react').ReactNode | undefined;
|
|
36
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export { DataTableRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
+
const i = m({
|
|
5
|
+
base: ["uy:relative uy:overflow-hidden"]
|
|
6
|
+
}), l = r(
|
|
7
|
+
({ children: o, ...a }, t) => /* @__PURE__ */ e("div", { ref: t, className: i(), ...a, children: o })
|
|
8
|
+
);
|
|
9
|
+
l.displayName = "DataTableRoot";
|
|
10
|
+
export {
|
|
11
|
+
l as DataTableRoot,
|
|
12
|
+
i as dataTableRoot
|
|
13
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m } from "react";
|
|
3
|
-
import { today as I, getLocalTimeZone as p, isToday as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { today as I, getLocalTimeZone as p, isToday as T } from "@internationalized/date";
|
|
4
|
+
import { uyTv as k } from "@payfit/unity-themes";
|
|
5
|
+
import { Calendar as B, Heading as M, CalendarGrid as O, CalendarGridHeader as W, CalendarHeaderCell as P, CalendarGridBody as R, CalendarCell as Z } from "react-aria-components";
|
|
6
6
|
import { IconButton as h } from "../icon-button/IconButton.js";
|
|
7
7
|
import { useMonthsList as $ } from "./hooks/useMonthsList.js";
|
|
8
8
|
import { useYearsList as q } from "./hooks/useYearsList.js";
|
|
9
9
|
import { DateSegmentSelect as v } from "./parts/DateSegmentSelect.js";
|
|
10
|
-
const z =
|
|
10
|
+
const z = k({
|
|
11
11
|
slots: {
|
|
12
12
|
base: "",
|
|
13
13
|
calendarWrapper: "uy:flex uy:flex-col uy:gap-100",
|
|
@@ -154,12 +154,12 @@ function A({
|
|
|
154
154
|
)
|
|
155
155
|
] }),
|
|
156
156
|
/* @__PURE__ */ r(O, { className: S(), weekdayStyle: "short", children: [
|
|
157
|
-
/* @__PURE__ */ a(
|
|
158
|
-
/* @__PURE__ */ a(
|
|
159
|
-
|
|
157
|
+
/* @__PURE__ */ a(W, { children: (e) => /* @__PURE__ */ a(P, { className: Y(), children: e }) }),
|
|
158
|
+
/* @__PURE__ */ a(R, { children: (e) => /* @__PURE__ */ a(
|
|
159
|
+
Z,
|
|
160
160
|
{
|
|
161
161
|
date: e,
|
|
162
|
-
"data-today":
|
|
162
|
+
"data-today": T(e, p()) ? !0 : void 0,
|
|
163
163
|
className: j()
|
|
164
164
|
}
|
|
165
165
|
) })
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as W } from "react";
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
3
4
|
import { DatePicker as I, Group as P, Button as U, Popover as j, Dialog as E } from "react-aria-components";
|
|
4
5
|
import { useIntl as M } from "react-intl";
|
|
5
|
-
import { tv as m } from "tailwind-variants";
|
|
6
6
|
import { DateCalendar as O } from "../date-calendar/DateCalendar.js";
|
|
7
7
|
import { Icon as R } from "../icon/Icon.js";
|
|
8
8
|
import { DateInput as G } from "./parts/DateInput.js";
|
|
9
|
-
const
|
|
9
|
+
const T = m({
|
|
10
10
|
slots: {
|
|
11
11
|
base: [
|
|
12
12
|
"uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-100",
|
|
@@ -58,7 +58,7 @@ const $ = m({
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
]
|
|
61
|
-
}),
|
|
61
|
+
}), $ = m({
|
|
62
62
|
base: "uy:overflow-auto uy:shadow-floating uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:rounded-75",
|
|
63
63
|
variants: {
|
|
64
64
|
isEntering: {
|
|
@@ -68,7 +68,7 @@ const $ = m({
|
|
|
68
68
|
true: "uy:animate-out uy:fade-out uy:data-[placement-bottom]:slide-out-to-top-1 uy:data-[placement-top]:slide-out-to-bottom-1 uy:duration-150 uy:ease-in"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
71
|
+
}), q = W(
|
|
72
72
|
({
|
|
73
73
|
value: f,
|
|
74
74
|
defaultValue: n,
|
|
@@ -83,8 +83,8 @@ const $ = m({
|
|
|
83
83
|
onOpenChange: l,
|
|
84
84
|
id: v,
|
|
85
85
|
...e
|
|
86
|
-
},
|
|
87
|
-
const g = M(), { base: x, inputWrapper: h, suffix: D } =
|
|
86
|
+
}, z) => {
|
|
87
|
+
const g = M(), { base: x, inputWrapper: h, suffix: D } = T({
|
|
88
88
|
isInvalid: !!b,
|
|
89
89
|
isReadOnly: !!u,
|
|
90
90
|
isDisabled: !!t
|
|
@@ -139,7 +139,7 @@ const $ = m({
|
|
|
139
139
|
/* @__PURE__ */ a(
|
|
140
140
|
j,
|
|
141
141
|
{
|
|
142
|
-
className: ({ isEntering: r, isExiting: N }) =>
|
|
142
|
+
className: ({ isEntering: r, isExiting: N }) => $({ isEntering: r, isExiting: N }),
|
|
143
143
|
children: /* @__PURE__ */ a(E, { className: "uy:p-150", "data-dd-privacy": "mask", children: /* @__PURE__ */ a(
|
|
144
144
|
O,
|
|
145
145
|
{
|
|
@@ -158,7 +158,7 @@ const $ = m({
|
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
|
-
|
|
161
|
+
q.displayName = "DatePicker";
|
|
162
162
|
export {
|
|
163
|
-
|
|
163
|
+
q as DatePicker
|
|
164
164
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as b } from "react";
|
|
3
|
+
import { uyTv as d } from "@payfit/unity-themes";
|
|
3
4
|
import { DatePickerStateContext as g, DateInput as x, DateSegment as v } from "react-aria-components";
|
|
4
5
|
import { useIntl as I } from "react-intl";
|
|
5
|
-
import { tv as d } from "tailwind-variants";
|
|
6
6
|
import { CircularIconButton as h } from "../../icon-button/CircularIconButton.js";
|
|
7
7
|
import { Icon as D } from "../../icon/Icon.js";
|
|
8
8
|
import { Spinner as M } from "../../spinner/Spinner.js";
|
|
@@ -56,16 +56,16 @@ const N = d({
|
|
|
56
56
|
});
|
|
57
57
|
function O({
|
|
58
58
|
isLoading: n,
|
|
59
|
-
isInvalid:
|
|
60
|
-
isReadOnly:
|
|
59
|
+
isInvalid: u,
|
|
60
|
+
isReadOnly: s,
|
|
61
61
|
isDisabled: l,
|
|
62
62
|
onClearButtonPress: a
|
|
63
63
|
}) {
|
|
64
64
|
const o = I(), t = b(g), { dateValue: c } = t, { base: m, input: y, state: f } = w({
|
|
65
|
-
isInvalid: !!
|
|
66
|
-
isReadOnly: !!
|
|
65
|
+
isInvalid: !!u,
|
|
66
|
+
isReadOnly: !!s,
|
|
67
67
|
isDisabled: !!l
|
|
68
|
-
}), p = c && !n && !
|
|
68
|
+
}), p = c && !n && !s && !l;
|
|
69
69
|
return /* @__PURE__ */ i("div", { className: m(), children: [
|
|
70
70
|
/* @__PURE__ */ e(x, { className: y(), children: (r) => /* @__PURE__ */ e(
|
|
71
71
|
v,
|
|
@@ -89,7 +89,7 @@ function O({
|
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
|
|
92
|
+
u && /* @__PURE__ */ e(
|
|
93
93
|
D,
|
|
94
94
|
{
|
|
95
95
|
src: "WarningCircleOutlined",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as D, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as C } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { FormField as
|
|
7
|
-
import { FormControl as
|
|
8
|
-
import { FormFeedbackText as
|
|
3
|
+
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
|
+
import { useFormContext as B } from "react-hook-form";
|
|
5
|
+
import { DatePicker as T } from "../date-picker/DatePicker.js";
|
|
6
|
+
import { FormField as j } from "../form-field/FormField.js";
|
|
7
|
+
import { FormControl as I } from "../form-field/parts/FormControl.js";
|
|
8
|
+
import { FormFeedbackText as N } from "../form-field/parts/FormFeedbackText.js";
|
|
9
9
|
import { FormHelperText as V } from "../form-field/parts/FormHelperText.js";
|
|
10
10
|
import { FormLabel as g } from "../form-field/parts/FormLabel.js";
|
|
11
|
-
const v =
|
|
11
|
+
const v = b({
|
|
12
12
|
base: "uy:flex uy:flex-col uy:gap-100"
|
|
13
13
|
});
|
|
14
14
|
function w({
|
|
@@ -26,7 +26,7 @@ function w({
|
|
|
26
26
|
requiredVariant: p,
|
|
27
27
|
...l
|
|
28
28
|
}, u) {
|
|
29
|
-
const { control: F, resetField: k, setValue: P } =
|
|
29
|
+
const { control: F, resetField: k, setValue: P } = B(), h = {
|
|
30
30
|
isRequired: s,
|
|
31
31
|
isInvalid: a,
|
|
32
32
|
isLoading: c,
|
|
@@ -40,7 +40,7 @@ function w({
|
|
|
40
40
|
}), P(r, null, { shouldValidate: !1 });
|
|
41
41
|
}, y = l.onClearButtonPress ?? x;
|
|
42
42
|
return /* @__PURE__ */ D(
|
|
43
|
-
|
|
43
|
+
j,
|
|
44
44
|
{
|
|
45
45
|
control: F,
|
|
46
46
|
name: r,
|
|
@@ -49,8 +49,8 @@ function w({
|
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ e(g, { requiredVariant: p, children: o }),
|
|
51
51
|
i && /* @__PURE__ */ e(V, { children: i }),
|
|
52
|
-
/* @__PURE__ */ e(
|
|
53
|
-
|
|
52
|
+
/* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(
|
|
53
|
+
T,
|
|
54
54
|
{
|
|
55
55
|
ref: u,
|
|
56
56
|
defaultValue: t,
|
|
@@ -58,7 +58,7 @@ function w({
|
|
|
58
58
|
...l
|
|
59
59
|
}
|
|
60
60
|
) }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
61
|
+
/* @__PURE__ */ e(N, { children: m }),
|
|
62
62
|
n
|
|
63
63
|
]
|
|
64
64
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as r } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { uyTv as u } from "@payfit/unity-themes";
|
|
4
|
+
import { Focusable as l } from "react-aria-components";
|
|
5
5
|
import { Text as f } from "../text/Text.js";
|
|
6
6
|
import { Tooltip as s } from "../tooltip/Tooltip.js";
|
|
7
|
-
const a =
|
|
7
|
+
const a = u({
|
|
8
8
|
base: [
|
|
9
9
|
"uy:text-content-neutral-enabled uy:rounded-50 uy:py-75",
|
|
10
10
|
"uy:hover:text-content-neutral-hover",
|
|
@@ -12,7 +12,7 @@ const a = l({
|
|
|
12
12
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-2 uy:focus-visible:outline-utility-focus-ring"
|
|
13
13
|
]
|
|
14
14
|
}), c = r(
|
|
15
|
-
({ children: t, title: i, asElement: e = "span", ...n }, m) => /* @__PURE__ */ o(s, { title: i, ...n, children: /* @__PURE__ */ o(
|
|
15
|
+
({ children: t, title: i, asElement: e = "span", ...n }, m) => /* @__PURE__ */ o(s, { title: i, ...n, children: /* @__PURE__ */ o(l, { children: /* @__PURE__ */ o(
|
|
16
16
|
f,
|
|
17
17
|
{
|
|
18
18
|
variant: "actionInfo",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
1
2
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import { DialogTrigger } from 'react-aria-components';
|
|
4
4
|
export declare const dialog: import('tailwind-variants').TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Children as i, isValidElement as t } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { uyTv as s } from "@payfit/unity-themes";
|
|
4
|
+
import { useId as g } from "react-aria";
|
|
5
|
+
import { ModalOverlay as p, Modal as f, DialogContext as c, Dialog as b, DialogTrigger as x } from "react-aria-components";
|
|
5
6
|
import { DialogTrigger as E } from "react-aria-components";
|
|
6
|
-
import { tv as x } from "tailwind-variants";
|
|
7
7
|
import { DialogActions as D } from "./parts/DialogActions.js";
|
|
8
8
|
import { DialogButton as v } from "./parts/DialogActions/DialogButton.js";
|
|
9
|
-
const w =
|
|
9
|
+
const w = s({
|
|
10
10
|
slots: {
|
|
11
11
|
overlay: [
|
|
12
12
|
"uy:fixed uy:inset-0 uy:z-30 uy:overflow-y-auto",
|
|
@@ -41,16 +41,16 @@ function N({
|
|
|
41
41
|
isDismissable: u = !0,
|
|
42
42
|
...y
|
|
43
43
|
}) {
|
|
44
|
-
const l =
|
|
44
|
+
const l = g(), { overlay: n, wrapper: d, content: m } = w();
|
|
45
45
|
return /* @__PURE__ */ o(
|
|
46
|
-
|
|
46
|
+
p,
|
|
47
47
|
{
|
|
48
48
|
isDismissable: u,
|
|
49
49
|
isOpen: a,
|
|
50
50
|
onOpenChange: r,
|
|
51
51
|
className: n(),
|
|
52
|
-
children: /* @__PURE__ */ o(
|
|
53
|
-
|
|
52
|
+
children: /* @__PURE__ */ o(f, { className: d(), "data-unity-dialog": !0, "data-dd-privacy": "allow", children: /* @__PURE__ */ o(c.Provider, { value: { "aria-describedby": l }, children: /* @__PURE__ */ o(
|
|
53
|
+
b,
|
|
54
54
|
{
|
|
55
55
|
role: h(e) ? "alertdialog" : "dialog",
|
|
56
56
|
"aria-modal": "true",
|
|
@@ -64,7 +64,7 @@ function N({
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
N.displayName = "Dialog";
|
|
67
|
-
|
|
67
|
+
x.displayName = "DialogTrigger";
|
|
68
68
|
export {
|
|
69
69
|
N as Dialog,
|
|
70
70
|
E as DialogTrigger,
|
|
@@ -16,7 +16,7 @@ export type DialogButtonProps<T extends ButtonVariant> = Omit<ButtonProps, 'vari
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
declare const DialogButton: {
|
|
19
|
-
<T extends ButtonVariant>({ children, variant, onPress, isLoading, icon, ...props }: PropsWithChildren<DialogButtonProps<T>>): import("react/jsx-runtime").JSX.Element
|
|
19
|
+
<T extends ButtonVariant>({ children, variant, onPress, isLoading, icon, ...props }: PropsWithChildren<DialogButtonProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
22
|
export { DialogButton };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const x =
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { useId as b } from "react-aria";
|
|
5
|
+
const x = g({
|
|
6
6
|
slots: {
|
|
7
7
|
base: "uy:p-0 uy:m-0 uy:[&+&]:mt-500 uy:[&:last-of-type]:mb-500",
|
|
8
8
|
legend: "uy:typography-h3 uy:text-content-neutral",
|
|
@@ -28,7 +28,7 @@ const x = b({
|
|
|
28
28
|
}
|
|
29
29
|
}), h = m(
|
|
30
30
|
({ children: i, ...d }, n) => {
|
|
31
|
-
const s =
|
|
31
|
+
const s = b(), { legend: l, description: e, isLegendHidden: o, ...r } = d, {
|
|
32
32
|
base: a,
|
|
33
33
|
legend: y,
|
|
34
34
|
description: c,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VariantProps } from '
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
2
|
import { flex } from './Flex.variants.js';
|
|
3
3
|
export type FlexContainerVariantProps = VariantProps<typeof flex>;
|
|
4
4
|
type ElementType = 'div' | 'span' | 'section' | 'nav' | 'aside' | 'header' | 'footer' | 'main' | 'article';
|