@gobolt/genesis 0.3.26 → 0.3.28
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/README.md +1 -1
- package/dist/bundle.css +1205 -0
- package/dist/components/Avatar/Avatar.d.ts +16 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/{TableWithControls/components/Tooltip → Avatar}/styles.d.ts +1 -1
- package/dist/components/Badge/index.d.ts +2 -2
- package/dist/components/Badge/styles.d.ts +3 -12
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +7 -0
- package/dist/components/Breadcrumb/index.d.ts +4 -0
- package/dist/components/Breadcrumb/styles.d.ts +5 -0
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/IconButton.d.ts +1 -1
- package/dist/components/Button/icon-button-styles.d.ts +1 -12
- package/dist/components/Button/index.d.ts +4 -4
- package/dist/components/Button/styles.d.ts +1 -16
- package/dist/components/Card/Card.d.ts +9 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/styles.d.ts +6 -0
- package/dist/components/Chat/Chat.d.ts +18 -0
- package/dist/components/Chat/Message.d.ts +8 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/styles.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +19 -0
- package/dist/components/ErrorBoundary/index.d.ts +2 -0
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +8 -0
- package/dist/components/ErrorBoundaryFallback/index.d.ts +2 -0
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +1 -0
- package/dist/components/Form/Form.d.ts +25 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/styles.d.ts +2 -0
- package/dist/components/Glyph/custom/UnitNumber.d.ts +5 -0
- package/dist/components/Input/Input.d.ts +4 -4
- package/dist/components/Input/index.d.ts +2 -2
- package/dist/components/Input/styles.d.ts +1 -18
- package/dist/components/Insights/BarChart/BarChart.d.ts +31 -0
- package/dist/components/Insights/BarChart/index.d.ts +2 -0
- package/dist/components/Insights/BarChart/styles.d.ts +2 -0
- package/dist/components/Insights/DonutChart/DonutChart.d.ts +19 -0
- package/dist/components/Insights/DonutChart/index.d.ts +2 -0
- package/dist/components/Insights/DonutChart/styles.d.ts +2 -0
- package/dist/components/Insights/LineChart/LineChart.d.ts +23 -0
- package/dist/components/Insights/LineChart/index.d.ts +2 -0
- package/dist/components/Insights/LineChart/styles.d.ts +2 -0
- package/dist/components/Insights/common-settings.d.ts +75 -0
- package/dist/components/Insights/index.d.ts +6 -0
- package/dist/components/Layout/Content/Content.d.ts +10 -0
- package/dist/components/Layout/Content/index.d.ts +2 -0
- package/dist/components/Layout/Content/styles.d.ts +4 -0
- package/dist/components/Layout/Layout.d.ts +8 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Message/Message.d.ts +14 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/styles.d.ts +3 -0
- package/dist/components/Notification/Notification.d.ts +17 -0
- package/dist/components/Notification/NotificationBadge/NotificationBadge.d.ts +6 -0
- package/dist/components/Notification/NotificationBadge/icons/ASN.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Appointment.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Inventory.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Parcel.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Product.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Route.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/Shipment.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/ShoppingCart.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/icons/System.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/styles.d.ts +3 -0
- package/dist/components/Notification/NotificationRightChevron.d.ts +2 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Notification/styles.d.ts +5 -0
- package/dist/components/Popover/Popover.d.ts +10 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/styles.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +18 -0
- package/dist/components/Progress/Progress.util.d.ts +3 -0
- package/dist/components/Progress/ProgressText.d.ts +10 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/styles.d.ts +4 -0
- package/dist/components/Radio/Radio.d.ts +10 -0
- package/dist/components/Radio/RadioGroup.d.ts +12 -0
- package/dist/components/Radio/index.d.ts +4 -0
- package/dist/components/Radio/states/RadioChecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioUnchecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +2 -0
- package/dist/components/Row/Row.d.ts +13 -0
- package/dist/components/Row/RowActions/RowActions.d.ts +9 -0
- package/dist/components/Row/RowActions/styles.d.ts +1 -0
- package/dist/components/Row/RowLabelValue/RowLabelValue.d.ts +10 -0
- package/dist/components/Row/RowLabelValue/RowSkeleton.d.ts +3 -0
- package/dist/components/Row/RowLabelValue/styles.d.ts +5 -0
- package/dist/components/Row/index.d.ts +2 -0
- package/dist/components/Row/styles.d.ts +6 -0
- package/dist/components/SegmentedControls/SegmentedControls.d.ts +12 -0
- package/dist/components/SegmentedControls/index.d.ts +2 -0
- package/dist/components/SegmentedControls/styles.d.ts +3 -0
- package/dist/components/Select/Select.d.ts +4 -4
- package/dist/components/Select/SelectTrigger.d.ts +3 -3
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Shapes/Shapes.d.ts +6 -0
- package/dist/components/Shapes/index.d.ts +2 -0
- package/dist/components/Shapes/variants/Circle.d.ts +5 -0
- package/dist/components/Shapes/variants/Rectangle.d.ts +5 -0
- package/dist/components/Shapes/variants/Triangle.d.ts +5 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/styles.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +3 -4
- package/dist/components/Table/TableControls/CustomPagination.d.ts +2 -2
- package/dist/components/Table/TableControls/PaginationNumber.d.ts +1 -1
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.d.ts +4 -2
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.d.ts +1 -1
- package/dist/components/Table/TableControls/TableControls.d.ts +3 -3
- package/dist/components/Table/TableControls/index.d.ts +2 -2
- package/dist/components/Table/TablePagination.d.ts +2 -2
- package/dist/components/Table/__mocks__/table-mocks.d.ts +1 -1
- package/dist/components/Table/index.d.ts +6 -6
- package/dist/components/Table/styles.d.ts +3 -17
- package/dist/components/Table/useTable.d.ts +6 -2
- package/dist/components/TableWithControls/TableWithControls.d.ts +2 -2
- package/dist/components/TableWithControls/index.d.ts +3 -3
- package/dist/components/TableWithControls/useTableWithControls.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +50 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/styles.d.ts +3 -0
- package/dist/components/Tile/Tile.d.ts +10 -0
- package/dist/components/Tile/index.d.ts +2 -0
- package/dist/components/Tile/styles.d.ts +4 -0
- package/dist/components/Toast/Toast.d.ts +13 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/styles.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.d.ts +6 -1
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Tooltip/styles.d.ts +1 -14
- package/dist/components/Typography/Typography.d.ts +2 -2
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/components/Typography/styles.d.ts +3 -21
- package/dist/components/UtilityButton/UtilityButton.d.ts +1 -1
- package/dist/components/UtilityButton/index.d.ts +2 -2
- package/dist/components/index.d.ts +74 -7
- package/dist/index.cjs +84795 -0
- package/dist/index.d.ts +6 -10
- package/dist/index.js +84778 -9
- package/dist/providers/BreakpointProvider.d.ts +7 -0
- package/dist/providers/GenesisProvider.d.ts +7 -0
- package/dist/providers/ToastProvider.d.ts +12 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/useGenesis.d.ts +7 -0
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/theme/genesis-theme.d.ts +1 -79
- package/dist/styles/theme/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/user-util.d.ts +2 -0
- package/package.json +25 -31
- package/dist/components/Badge/Badge.js +0 -51
- package/dist/components/Badge/index.js +0 -1
- package/dist/components/Badge/styles.js +0 -21
- package/dist/components/Button/Button.js +0 -36
- package/dist/components/Button/IconButton.js +0 -32
- package/dist/components/Button/__stories__/Button.stories.d.ts +0 -12
- package/dist/components/Button/__stories__/Button.stories.js +0 -154
- package/dist/components/Button/__stories__/IconButton.stories.d.ts +0 -8
- package/dist/components/Button/__stories__/IconButton.stories.js +0 -133
- package/dist/components/Button/__stories__/UtilityButton.stories.d.ts +0 -8
- package/dist/components/Button/__stories__/UtilityButton.stories.js +0 -71
- package/dist/components/Button/__tests__/Button.test.js +0 -19
- package/dist/components/Button/components/Button/Button.d.ts +0 -16
- package/dist/components/Button/components/Button/Button.js +0 -13
- package/dist/components/Button/components/Button/styles.d.ts +0 -1
- package/dist/components/Button/components/Button/styles.js +0 -118
- package/dist/components/Button/constants/index.d.ts +0 -163
- package/dist/components/Button/constants/index.js +0 -89
- package/dist/components/Button/icon-button-styles.js +0 -23
- package/dist/components/Button/index.js +0 -2
- package/dist/components/Button/styles.js +0 -60
- package/dist/components/Button/styles.ts +0 -176
- package/dist/components/Input/Input.js +0 -57
- package/dist/components/Input/index.js +0 -1
- package/dist/components/Input/styles.js +0 -76
- package/dist/components/Select/Select.js +0 -199
- package/dist/components/Select/SelectTrigger.js +0 -89
- package/dist/components/Select/index.js +0 -1
- package/dist/components/Table/Table/Table.d.ts +0 -51
- package/dist/components/Table/Table/Table.js +0 -14
- package/dist/components/Table/Table/TableControls/CustomPagination.d.ts +0 -13
- package/dist/components/Table/Table/TableControls/CustomPagination.js +0 -158
- package/dist/components/Table/Table/TableControls/PaginationNumber.d.ts +0 -7
- package/dist/components/Table/Table/TableControls/PaginationNumber.js +0 -30
- package/dist/components/Table/Table/styles.d.ts +0 -14
- package/dist/components/Table/Table/styles.js +0 -64
- package/dist/components/Table/Table/useTable.d.ts +0 -26
- package/dist/components/Table/Table/useTable.js +0 -141
- package/dist/components/Table/Table.js +0 -33
- package/dist/components/Table/TableControls/CustomPagination.js +0 -174
- package/dist/components/Table/TableControls/PaginationNumber.js +0 -46
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +0 -78
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.js +0 -65
- package/dist/components/Table/TableControls/TableControls.js +0 -14
- package/dist/components/Table/TableControls/TableControls.tsx +0 -51
- package/dist/components/Table/TableControls/__stories__/CustomPaginationStandalone.stories.d.ts +0 -9
- package/dist/components/Table/TableControls/__stories__/CustomPaginationStandalone.stories.js +0 -58
- package/dist/components/Table/TableControls/__stories__/PaginationNumber.stories.d.ts +0 -7
- package/dist/components/Table/TableControls/__stories__/PaginationNumber.stories.js +0 -37
- package/dist/components/Table/TableControls/__stories__/TableControls.stories.d.ts +0 -6
- package/dist/components/Table/TableControls/__stories__/TableControls.stories.js +0 -106
- package/dist/components/Table/TableControls/__tests__/CustomPagination.test.d.ts +0 -1
- package/dist/components/Table/TableControls/__tests__/CustomPagination.test.js +0 -82
- package/dist/components/Table/TableControls/__tests__/TableControls.test.d.ts +0 -1
- package/dist/components/Table/TableControls/__tests__/TableControls.test.js +0 -74
- package/dist/components/Table/TableControls/index.js +0 -1
- package/dist/components/Table/TableControls/styles.d.ts +0 -13
- package/dist/components/Table/TableControls/styles.js +0 -16
- package/dist/components/Table/TablePagination.js +0 -28
- package/dist/components/Table/Typography/Typography.d.ts +0 -17
- package/dist/components/Table/Typography/Typography.js +0 -16
- package/dist/components/Table/Typography/index.d.ts +0 -2
- package/dist/components/Table/Typography/index.js +0 -1
- package/dist/components/Table/Typography/styles.d.ts +0 -3
- package/dist/components/Table/Typography/styles.js +0 -54
- package/dist/components/Table/__mocks__/table-mocks.js +0 -310
- package/dist/components/Table/__stories__/GenesisTable.stories.d.ts +0 -5
- package/dist/components/Table/__stories__/GenesisTable.stories.js +0 -23
- package/dist/components/Table/__stories__/Table.stories.d.ts +0 -8
- package/dist/components/Table/__stories__/Table.stories.js +0 -188
- package/dist/components/Table/__tests__/table.test.d.ts +0 -1
- package/dist/components/Table/__tests__/table.test.js +0 -47
- package/dist/components/Table/index.js +0 -3
- package/dist/components/Table/styles.js +0 -20
- package/dist/components/Table/useTable.js +0 -238
- package/dist/components/TableWithControls/TableWithControls.js +0 -21
- package/dist/components/TableWithControls/__stories__/TableWithControls.stories.d.ts +0 -6
- package/dist/components/TableWithControls/__stories__/TableWithControls.stories.js +0 -178
- package/dist/components/TableWithControls/__stories__/TableWithControlsStory.d.ts +0 -1
- package/dist/components/TableWithControls/__stories__/TableWithControlsStory.js +0 -55
- package/dist/components/TableWithControls/__tests__/TableWithControls.test.d.ts +0 -1
- package/dist/components/TableWithControls/__tests__/TableWithControls.test.js +0 -41
- package/dist/components/TableWithControls/components/Badge/Badge.d.ts +0 -16
- package/dist/components/TableWithControls/components/Badge/Badge.js +0 -28
- package/dist/components/TableWithControls/components/Badge/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Badge/index.js +0 -1
- package/dist/components/TableWithControls/components/Badge/styles.d.ts +0 -4
- package/dist/components/TableWithControls/components/Badge/styles.js +0 -46
- package/dist/components/TableWithControls/components/Button/Button.d.ts +0 -16
- package/dist/components/TableWithControls/components/Button/Button.js +0 -13
- package/dist/components/TableWithControls/components/Button/IconButton.d.ts +0 -8
- package/dist/components/TableWithControls/components/Button/IconButton.js +0 -9
- package/dist/components/TableWithControls/components/Button/icon-button-styles.d.ts +0 -1
- package/dist/components/TableWithControls/components/Button/icon-button-styles.js +0 -76
- package/dist/components/TableWithControls/components/Button/index.d.ts +0 -4
- package/dist/components/TableWithControls/components/Button/index.js +0 -2
- package/dist/components/TableWithControls/components/Button/styles.d.ts +0 -1
- package/dist/components/TableWithControls/components/Button/styles.js +0 -118
- package/dist/components/TableWithControls/components/Input/Input.d.ts +0 -13
- package/dist/components/TableWithControls/components/Input/Input.js +0 -34
- package/dist/components/TableWithControls/components/Input/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Input/index.js +0 -1
- package/dist/components/TableWithControls/components/Input/styles.d.ts +0 -1
- package/dist/components/TableWithControls/components/Input/styles.js +0 -180
- package/dist/components/TableWithControls/components/Select/Select.d.ts +0 -26
- package/dist/components/TableWithControls/components/Select/Select.js +0 -175
- package/dist/components/TableWithControls/components/Select/SelectTrigger.d.ts +0 -23
- package/dist/components/TableWithControls/components/Select/SelectTrigger.js +0 -103
- package/dist/components/TableWithControls/components/Select/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Select/index.js +0 -1
- package/dist/components/TableWithControls/components/Table/Table.d.ts +0 -51
- package/dist/components/TableWithControls/components/Table/Table.js +0 -14
- package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.d.ts +0 -13
- package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.js +0 -158
- package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.d.ts +0 -7
- package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.js +0 -30
- package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.d.ts +0 -18
- package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.js +0 -77
- package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.d.ts +0 -11
- package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.js +0 -43
- package/dist/components/TableWithControls/components/Table/TableControls/TableControls.d.ts +0 -14
- package/dist/components/TableWithControls/components/Table/TableControls/TableControls.js +0 -13
- package/dist/components/TableWithControls/components/Table/TableControls/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Table/TableControls/index.js +0 -1
- package/dist/components/TableWithControls/components/Table/TablePagination.d.ts +0 -13
- package/dist/components/TableWithControls/components/Table/TablePagination.js +0 -11
- package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.d.ts +0 -20
- package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.js +0 -301
- package/dist/components/TableWithControls/components/Table/index.d.ts +0 -6
- package/dist/components/TableWithControls/components/Table/index.js +0 -3
- package/dist/components/TableWithControls/components/Table/styles.d.ts +0 -14
- package/dist/components/TableWithControls/components/Table/styles.js +0 -64
- package/dist/components/TableWithControls/components/Table/useTable.d.ts +0 -26
- package/dist/components/TableWithControls/components/Table/useTable.js +0 -141
- package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.d.ts +0 -12
- package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.js +0 -20
- package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.d.ts +0 -29
- package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.js +0 -136
- package/dist/components/TableWithControls/components/Tooltip/Tooltip.d.ts +0 -7
- package/dist/components/TableWithControls/components/Tooltip/Tooltip.js +0 -8
- package/dist/components/TableWithControls/components/Tooltip/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Tooltip/index.js +0 -1
- package/dist/components/TableWithControls/components/Tooltip/styles.js +0 -26
- package/dist/components/TableWithControls/components/Typography/Typography.d.ts +0 -17
- package/dist/components/TableWithControls/components/Typography/Typography.js +0 -16
- package/dist/components/TableWithControls/components/Typography/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/Typography/index.js +0 -1
- package/dist/components/TableWithControls/components/Typography/styles.d.ts +0 -3
- package/dist/components/TableWithControls/components/Typography/styles.js +0 -54
- package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.d.ts +0 -5
- package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.js +0 -9
- package/dist/components/TableWithControls/components/UtilityButton/index.d.ts +0 -2
- package/dist/components/TableWithControls/components/UtilityButton/index.js +0 -1
- package/dist/components/TableWithControls/components/shared/DropdownChevron.d.ts +0 -2
- package/dist/components/TableWithControls/components/shared/DropdownChevron.js +0 -7
- package/dist/components/TableWithControls/constants/index.d.ts +0 -163
- package/dist/components/TableWithControls/constants/index.js +0 -89
- package/dist/components/TableWithControls/index.js +0 -2
- package/dist/components/TableWithControls/types/events.d.ts +0 -22
- package/dist/components/TableWithControls/types/events.js +0 -1
- package/dist/components/TableWithControls/useTableWithControls.js +0 -117
- package/dist/components/TableWithControls/utils/icon-util.d.ts +0 -3
- package/dist/components/TableWithControls/utils/icon-util.js +0 -116
- package/dist/components/Tooltip/Tooltip.js +0 -9
- package/dist/components/Tooltip/index.js +0 -1
- package/dist/components/Tooltip/styles.js +0 -17
- package/dist/components/Typography/Typography.js +0 -39
- package/dist/components/Typography/index.js +0 -1
- package/dist/components/Typography/styles.js +0 -37
- package/dist/components/UtilityButton/UtilityButton.js +0 -32
- package/dist/components/UtilityButton/components/Button/Button.d.ts +0 -16
- package/dist/components/UtilityButton/components/Button/Button.js +0 -13
- package/dist/components/UtilityButton/components/Button/IconButton.d.ts +0 -8
- package/dist/components/UtilityButton/components/Button/IconButton.js +0 -9
- package/dist/components/UtilityButton/components/Button/icon-button-styles.d.ts +0 -1
- package/dist/components/UtilityButton/components/Button/icon-button-styles.js +0 -76
- package/dist/components/UtilityButton/components/Button/index.d.ts +0 -4
- package/dist/components/UtilityButton/components/Button/index.js +0 -2
- package/dist/components/UtilityButton/components/Button/styles.d.ts +0 -1
- package/dist/components/UtilityButton/components/Button/styles.js +0 -118
- package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.d.ts +0 -5
- package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.js +0 -9
- package/dist/components/UtilityButton/constants/index.d.ts +0 -163
- package/dist/components/UtilityButton/constants/index.js +0 -89
- package/dist/components/UtilityButton/index.js +0 -1
- package/dist/components/index.js +0 -7
- package/dist/components/shared/DropdownChevron.js +0 -18
- package/dist/constants/index.js +0 -89
- package/dist/interface/address.d.ts +0 -10
- package/dist/interface/address.js +0 -1
- package/dist/interface/appointment.d.ts +0 -56
- package/dist/interface/appointment.js +0 -23
- package/dist/styles/design-tokens/variables.d.ts +0 -706
- package/dist/styles/design-tokens/variables.js +0 -707
- package/dist/styles/theme/genesis-theme.js +0 -1512
- package/dist/styles/theme/genesis-theme.types.d.ts +0 -263
- package/dist/styles/theme/genesis-theme.types.js +0 -6
- package/dist/styles/theme/index.js +0 -1
- package/dist/test/setup.d.ts +0 -6
- package/dist/test/setup.js +0 -53
- package/dist/test/setup.types.d.ts +0 -7
- package/dist/test/setup.types.js +0 -1
- package/dist/types/events.d.ts +0 -22
- package/dist/types/events.js +0 -1
- package/dist/utils/icon-util.js +0 -119
- package/dist/utils/styled.d.ts +0 -1
- package/dist/utils/styled.js +0 -44
- /package/dist/{components/Button/__tests__/Button.test.d.ts → styles/theme/genesis-theme.test.d.ts} +0 -0
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { TYPE } from "@gobolt/genesis/constants";
|
|
4
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
5
|
-
import SelectTrigger from "./SelectTrigger";
|
|
6
|
-
import { useGenesis } from "@gobolt/genesis/providers";
|
|
7
|
-
const SelectWrapper = styled.div `
|
|
8
|
-
position: relative;
|
|
9
|
-
background-color: transparent;
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
width: auto;
|
|
12
|
-
|
|
13
|
-
${({ $isFocused, theme, type = "primary" }) => $isFocused &&
|
|
14
|
-
`
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
`}
|
|
17
|
-
|
|
18
|
-
${({ disabled, theme }) => disabled &&
|
|
19
|
-
`
|
|
20
|
-
cursor: not-allowed;
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
border-color: ${theme.colors.inputs.surface.border};
|
|
24
|
-
}
|
|
25
|
-
`}
|
|
26
|
-
`;
|
|
27
|
-
const SelectDropdown = styled.div `
|
|
28
|
-
padding: 0px;
|
|
29
|
-
border-radius: 0px;
|
|
30
|
-
animation-duration: ${({ theme }) => `${theme.motion.veryfast}s`};
|
|
31
|
-
transition: all ${({ theme }) => `${theme.motion.veryfast}s`}
|
|
32
|
-
cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
33
|
-
|
|
34
|
-
&.entering {
|
|
35
|
-
opacity: 0;
|
|
36
|
-
transform: scaleY(0.8);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.entered {
|
|
40
|
-
opacity: 1;
|
|
41
|
-
transform: scaleY(1);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.exiting {
|
|
45
|
-
opacity: 0;
|
|
46
|
-
transform: scaleY(0.8);
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
const MenuItem = styled.div `
|
|
50
|
-
padding: 8px 12px;
|
|
51
|
-
cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")};
|
|
52
|
-
background-color: ${({ $isSelected, theme, type = "primary" }) => $isSelected ? theme.colors[type].hover.backgroundColor : "transparent"};
|
|
53
|
-
color: ${({ $isSelected, disabled, theme, type = "primary" }) => disabled
|
|
54
|
-
? theme.colors.inputs.onsurface.disabled
|
|
55
|
-
: $isSelected
|
|
56
|
-
? theme.colors[type].hover.color
|
|
57
|
-
: theme.colors.onsurface.copy};
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: space-between;
|
|
60
|
-
align-items: center;
|
|
61
|
-
transition: all ${({ theme }) => `${theme.motion.veryfast}s`} ease-in-out;
|
|
62
|
-
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
63
|
-
|
|
64
|
-
${({ disabled }) => !disabled &&
|
|
65
|
-
`
|
|
66
|
-
&:hover {
|
|
67
|
-
background-color: ${({ $isSelected, theme, type = "primary" }) => $isSelected
|
|
68
|
-
? theme.colors[type].hover.backgroundColor
|
|
69
|
-
: "rgba(0, 0, 0, 0.04)"};
|
|
70
|
-
color: ${({ $isSelected, theme, type = "primary" }) => $isSelected
|
|
71
|
-
? theme.colors[type].hover.color
|
|
72
|
-
: theme.colors.onsurface["copy-dark"]};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:active {
|
|
76
|
-
background-color: ${({ theme, type = "primary" }) => theme.colors[type].hover.backgroundColor};
|
|
77
|
-
color: ${({ theme, type = "primary" }) => theme.colors[type].hover.color};
|
|
78
|
-
}
|
|
79
|
-
`}
|
|
80
|
-
`;
|
|
81
|
-
const Select = ({ type = TYPE.primary, state, variant = "none", defaultValue, onChange, size = "normal", width = "100%", value, options = [], placeholder, selectDisplayMode = "count", isSingleSelect = true, disabled = false, ...rest }) => {
|
|
82
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
83
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
84
|
-
const [dropdownAnimation, setDropdownAnimation] = React.useState("entered");
|
|
85
|
-
const selectReference = React.useRef(null);
|
|
86
|
-
const { theme } = useGenesis();
|
|
87
|
-
React.useEffect(() => {
|
|
88
|
-
const handleClickOutside = (event) => {
|
|
89
|
-
if (selectReference.current &&
|
|
90
|
-
!selectReference.current.contains(event.target)) {
|
|
91
|
-
handleClose();
|
|
92
|
-
setIsFocused(false);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
if (isOpen) {
|
|
96
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
97
|
-
}
|
|
98
|
-
return () => {
|
|
99
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
100
|
-
};
|
|
101
|
-
}, [isOpen]);
|
|
102
|
-
const handleClose = () => {
|
|
103
|
-
setDropdownAnimation("exiting");
|
|
104
|
-
setTimeout(() => {
|
|
105
|
-
setIsOpen(false);
|
|
106
|
-
setDropdownAnimation("entered");
|
|
107
|
-
}, 200);
|
|
108
|
-
};
|
|
109
|
-
const handleTriggerClick = () => {
|
|
110
|
-
if (disabled)
|
|
111
|
-
return;
|
|
112
|
-
setIsFocused(true);
|
|
113
|
-
if (isOpen) {
|
|
114
|
-
handleClose();
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
setIsOpen(true);
|
|
118
|
-
setDropdownAnimation("entering");
|
|
119
|
-
setTimeout(() => {
|
|
120
|
-
setDropdownAnimation("entered");
|
|
121
|
-
}, 0);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const handleOptionSelect = (optionValue) => {
|
|
125
|
-
if (disabled)
|
|
126
|
-
return;
|
|
127
|
-
let newValue;
|
|
128
|
-
if (Array.isArray(value)) {
|
|
129
|
-
// Handle multi-select
|
|
130
|
-
const stringValue = value.map(String);
|
|
131
|
-
newValue = stringValue.includes(optionValue)
|
|
132
|
-
? stringValue.filter((v) => v !== optionValue)
|
|
133
|
-
: [...stringValue, optionValue];
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
// Handle single select
|
|
137
|
-
newValue = optionValue;
|
|
138
|
-
}
|
|
139
|
-
// Autoclose if single select or variant is 'simple'
|
|
140
|
-
if (isSingleSelect || variant === "simple") {
|
|
141
|
-
handleClose(); // Close immediately
|
|
142
|
-
onChange?.(newValue);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
onChange?.(newValue);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
const getSelectModeValue = (value) => {
|
|
149
|
-
if (Array.isArray(value)) {
|
|
150
|
-
if (selectDisplayMode === "count") {
|
|
151
|
-
return `${value.length} selected`;
|
|
152
|
-
}
|
|
153
|
-
return value;
|
|
154
|
-
}
|
|
155
|
-
return value;
|
|
156
|
-
};
|
|
157
|
-
const modeValue = getSelectModeValue(value);
|
|
158
|
-
return (_jsx("div", { style: { position: "relative", width }, children: _jsxs(SelectWrapper, { ref: selectReference, "$isFocused": isFocused, type: type, disabled: disabled, onFocus: () => !disabled && setIsFocused(true), onBlur: () => !isOpen && setIsFocused(false), tabIndex: disabled ? -1 : 0, children: [_jsx(SelectTrigger, { theme: theme, type: type, state: state, value: modeValue, placeholder: placeholder, open: isOpen, onClick: handleTriggerClick, options: options, disabled: disabled, variant: variant }), isOpen && !disabled && (_jsx(SelectDropdown, { type: type, state: state, className: dropdownAnimation, style: {
|
|
159
|
-
position: "absolute",
|
|
160
|
-
top: "calc(100% + 4px)",
|
|
161
|
-
left: 0,
|
|
162
|
-
right: 0,
|
|
163
|
-
zIndex: 1000,
|
|
164
|
-
backgroundColor: "white",
|
|
165
|
-
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
|
|
166
|
-
border: "1px solid #d9d9d9",
|
|
167
|
-
transformOrigin: "top",
|
|
168
|
-
}, children: options.map((option) => {
|
|
169
|
-
const isSelected = Array.isArray(value)
|
|
170
|
-
? value.map(String).includes(option.value)
|
|
171
|
-
: String(value) === option.value;
|
|
172
|
-
return (_jsxs(MenuItem, { onClick: () => handleOptionSelect(option.value), "$isSelected": isSelected, type: type, disabled: disabled, children: [option.label, isSelected && _jsx("span", { style: { marginLeft: "8px" }, children: "\u2713" })] }, option.value));
|
|
173
|
-
}) }))] }) }));
|
|
174
|
-
};
|
|
175
|
-
export default Select;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { STATE } from "@gobolt/genesis/constants";
|
|
3
|
-
import { GenesisTheme } from "@/lib/styles/theme/genesis-theme.types";
|
|
4
|
-
type ThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
|
|
5
|
-
type Variant = "none" | "simple";
|
|
6
|
-
interface SelectTriggerProperties {
|
|
7
|
-
type?: ThemeType;
|
|
8
|
-
theme?: GenesisTheme;
|
|
9
|
-
state?: keyof typeof STATE;
|
|
10
|
-
value?: string[] | string | number[] | number;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
open?: boolean;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
renderValue?: (value: any) => React.ReactNode;
|
|
15
|
-
options?: {
|
|
16
|
-
value: string;
|
|
17
|
-
label: React.ReactNode;
|
|
18
|
-
}[];
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
variant?: Variant;
|
|
21
|
-
}
|
|
22
|
-
declare const SelectTrigger: React.FC<SelectTriggerProperties>;
|
|
23
|
-
export default SelectTrigger;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
4
|
-
import DropdownChevron from "../shared/DropdownChevron";
|
|
5
|
-
import { Typography } from "@gobolt/genesis/components";
|
|
6
|
-
const getBackgroundColor = (colors, disabled, $variant) => {
|
|
7
|
-
if ($variant === "simple")
|
|
8
|
-
return "#F4F4F4";
|
|
9
|
-
if (disabled)
|
|
10
|
-
return "#F4F4F4";
|
|
11
|
-
return "#fff";
|
|
12
|
-
};
|
|
13
|
-
const TriggerWrapper = styled.div `
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
cursor: ${({ $disabled }) => ($disabled ? "not-allowed" : "pointer")};
|
|
18
|
-
opacity: ${({ $disabled }) => ($disabled ? 0.4 : 1)};
|
|
19
|
-
position: relative;
|
|
20
|
-
box-shadow: ${({ $variant }) => $variant === "simple" ? "none" : "0px 1px 2px 0px rgba(0, 0, 0, 0.12)"};
|
|
21
|
-
transition: all 0.2s ease-in-out;
|
|
22
|
-
min-height: ${({ $variant }) => ($variant === "simple" ? "32px" : "40px")};
|
|
23
|
-
|
|
24
|
-
&:focus-visible {
|
|
25
|
-
outline: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:focus {
|
|
29
|
-
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.12),
|
|
30
|
-
0 0 0 3px
|
|
31
|
-
${({ theme, $themeType = "primary" }) => theme.colors[$themeType].focussed.ringColor};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
${({ $variant, theme, $disabled }) => $variant === "simple"
|
|
35
|
-
? `
|
|
36
|
-
padding: ${theme.sizing.Size1} ${theme.sizing.Size2};
|
|
37
|
-
background: ${$disabled ? theme.colors.inputs.surface.disabled : "rgba(0, 0, 0, 0.04)"};
|
|
38
|
-
border: none;
|
|
39
|
-
border-radius: ${theme.borderRadius.BorderRadiusSm}px;
|
|
40
|
-
min-height: ${({ $variant }) => ($variant === "simple" ? "32px" : "40px")};
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
border: none;
|
|
44
|
-
}
|
|
45
|
-
`
|
|
46
|
-
: `
|
|
47
|
-
padding: ${theme.sizing.Size1} ${theme.sizing.Size2};
|
|
48
|
-
background: ${$disabled
|
|
49
|
-
? theme.colors.inputs.surface.disabled
|
|
50
|
-
: theme.colors.surface.default?.backgroundColor};
|
|
51
|
-
border: 1px solid #9a9a9a;
|
|
52
|
-
border-radius: ${theme.borderRadius.BorderRadiusSm}px;
|
|
53
|
-
min-height: ${({ $variant }) => ($variant === "simple" ? "32px" : "40px")};
|
|
54
|
-
|
|
55
|
-
&:hover {
|
|
56
|
-
border-color: rgba(0, 0, 0, 0.2);
|
|
57
|
-
}
|
|
58
|
-
`}
|
|
59
|
-
`;
|
|
60
|
-
const ValueContainer = styled.div `
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: ${({ theme }) => theme.sizing.Size2}px;
|
|
64
|
-
flex: 1;
|
|
65
|
-
padding: 4px 8px;
|
|
66
|
-
`;
|
|
67
|
-
const ChevronContainer = styled.div `
|
|
68
|
-
display: flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
margin-right: ${({ $variant }) => ($variant === "simple" ? "4px" : "4px")};
|
|
72
|
-
margin-left: ${({ $variant }) => ($variant === "simple" ? "4px" : "0")};
|
|
73
|
-
`;
|
|
74
|
-
const SelectTrigger = ({ type = "primary", theme, state, value, placeholder = "Select...", open, onClick, renderValue, options = [], disabled = false, variant = "none", }) => {
|
|
75
|
-
const handleClick = React.useCallback(() => {
|
|
76
|
-
if (disabled)
|
|
77
|
-
return;
|
|
78
|
-
onClick?.();
|
|
79
|
-
}, [disabled, onClick]);
|
|
80
|
-
const displayValue = React.useMemo(() => {
|
|
81
|
-
if (!value)
|
|
82
|
-
return null;
|
|
83
|
-
if (renderValue)
|
|
84
|
-
return renderValue(value);
|
|
85
|
-
if (Array.isArray(value)) {
|
|
86
|
-
if (value.length === 0)
|
|
87
|
-
return null;
|
|
88
|
-
const selectedLabels = value
|
|
89
|
-
.map(String)
|
|
90
|
-
.map((v) => options.find((opt) => opt.value === v)?.label)
|
|
91
|
-
.filter(Boolean);
|
|
92
|
-
return selectedLabels.length > 0
|
|
93
|
-
? selectedLabels.join(", ")
|
|
94
|
-
: `${value.length} selected`;
|
|
95
|
-
}
|
|
96
|
-
const selectedOption = options.find((opt) => opt.value === String(value));
|
|
97
|
-
return selectedOption?.label || value.toString();
|
|
98
|
-
}, [value, renderValue, options]);
|
|
99
|
-
return (_jsxs(TriggerWrapper, { "$themeType": type, "$state": state, onClick: handleClick, tabIndex: disabled ? -1 : 0, role: "button", "$disabled": disabled, "$variant": variant, style: {
|
|
100
|
-
backgroundColor: getBackgroundColor(theme, disabled, variant),
|
|
101
|
-
}, children: [_jsx(ValueContainer, { "$variant": variant, children: displayValue ? (_jsx(Typography, { variant: "body2", color: disabled ? "copy-light" : "copy", children: displayValue })) : (_jsx(Typography, { variant: "body2", color: disabled ? "copy-light" : "copy-light", children: placeholder })) }), _jsx(ChevronContainer, { "$variant": variant, children: _jsx(DropdownChevron, {}) })] }));
|
|
102
|
-
};
|
|
103
|
-
export default SelectTrigger;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Select";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ColumnType } from "antd/es/table";
|
|
3
|
-
import type { TablePaginationConfig } from "antd/es/table";
|
|
4
|
-
import { PaginationStyle } from "./TableControls/CustomPagination";
|
|
5
|
-
import type { ActionEvent } from "@/lib/types";
|
|
6
|
-
export type Change = (actionEvent: ActionEvent) => void;
|
|
7
|
-
export type SelectionType = "checkbox" | "radio";
|
|
8
|
-
export interface TableProps<T extends Record<string, any>> {
|
|
9
|
-
dataSource: T[];
|
|
10
|
-
columns: ColumnType<T>[];
|
|
11
|
-
rowKey?: keyof T | ((record: T) => React.Key);
|
|
12
|
-
size?: "small" | "middle" | "large";
|
|
13
|
-
rowSelection?: {
|
|
14
|
-
type?: SelectionType;
|
|
15
|
-
selectedRowKeys?: React.Key[];
|
|
16
|
-
onChange?: (selectedRowKeys: React.Key[], selectedRows: T[]) => void;
|
|
17
|
-
getCheckboxProps?: (record: T) => {
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
name?: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
onChange?: (pagination: TablePaginationType, filters: Record<string, React.Key[]>, sorter: SorterResult<T> | SorterResult<T>[]) => void;
|
|
23
|
-
loading?: boolean;
|
|
24
|
-
pagination?: (TablePaginationConfig & {
|
|
25
|
-
paginationStyle?: PaginationStyle;
|
|
26
|
-
}) | false;
|
|
27
|
-
scroll?: {
|
|
28
|
-
x?: number | string;
|
|
29
|
-
y?: number | string;
|
|
30
|
-
};
|
|
31
|
-
bordered?: boolean;
|
|
32
|
-
locale?: {
|
|
33
|
-
emptyText?: React.ReactNode;
|
|
34
|
-
};
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
isMainContentCell?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export type TablePaginationType = {
|
|
39
|
-
pageSize?: number;
|
|
40
|
-
current?: number;
|
|
41
|
-
total?: number;
|
|
42
|
-
onChange?: (page: number, pageSize: number) => void;
|
|
43
|
-
};
|
|
44
|
-
export type SorterResult<T> = {
|
|
45
|
-
column?: ColumnType<T>;
|
|
46
|
-
order?: "ascend" | "descend" | null;
|
|
47
|
-
field?: keyof T | string | React.Key | readonly React.Key[];
|
|
48
|
-
columnKey?: React.Key;
|
|
49
|
-
};
|
|
50
|
-
declare function Table<T extends Record<string, any>>({ columns, dataSource, rowKey, size, onChange, rowSelection, pagination, isMainContentCell, ...rest }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export default Table;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as S from "./styles";
|
|
3
|
-
import CustomPagination, { PaginationStyle, } from "./TableControls/CustomPagination";
|
|
4
|
-
function Table({ columns, dataSource, rowKey = "id", size = "small", onChange, rowSelection, pagination, isMainContentCell = false, ...rest }) {
|
|
5
|
-
const paginationConfig = pagination === false
|
|
6
|
-
? false
|
|
7
|
-
: {
|
|
8
|
-
...pagination,
|
|
9
|
-
itemRender: undefined, // Clear any existing itemRender to avoid conflicts
|
|
10
|
-
render: (properties) => (_jsx(CustomPagination, { ...properties, paginationStyle: pagination?.paginationStyle || PaginationStyle.SIMPLE })),
|
|
11
|
-
};
|
|
12
|
-
return (_jsx(S.Table, { "data-testid": "Table", dataSource: dataSource, columns: columns, rowKey: rowKey, locale: { emptyText: "No Data" }, size: size, onChange: onChange, rowSelection: rowSelection, pagination: paginationConfig, "$isMainContentCell": isMainContentCell, ...rest }));
|
|
13
|
-
}
|
|
14
|
-
export default Table;
|
package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { PaginationProps } from "antd";
|
|
3
|
-
export declare enum PaginationStyle {
|
|
4
|
-
SIMPLE = "simple",// Shows just 1-5
|
|
5
|
-
TRUNCATED = "truncated",// Shows 1-5...20
|
|
6
|
-
CENTERED = "centered",// Shows 1...4-5-6-7-8...20
|
|
7
|
-
END_FOCUSED = "endFocused"
|
|
8
|
-
}
|
|
9
|
-
interface CustomPaginationProperties extends Omit<PaginationProps, "itemRender"> {
|
|
10
|
-
paginationStyle?: PaginationStyle;
|
|
11
|
-
}
|
|
12
|
-
declare const CustomPagination: React.FC<CustomPaginationProperties>;
|
|
13
|
-
export default CustomPagination;
|
package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { PaginationNumber } from "./PaginationNumber";
|
|
4
|
-
export var PaginationStyle;
|
|
5
|
-
(function (PaginationStyle) {
|
|
6
|
-
PaginationStyle["SIMPLE"] = "simple";
|
|
7
|
-
PaginationStyle["TRUNCATED"] = "truncated";
|
|
8
|
-
PaginationStyle["CENTERED"] = "centered";
|
|
9
|
-
PaginationStyle["END_FOCUSED"] = "endFocused";
|
|
10
|
-
})(PaginationStyle || (PaginationStyle = {}));
|
|
11
|
-
const PaginationContainer = styled.div `
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
margin: 0;
|
|
16
|
-
gap: 0 0;
|
|
17
|
-
`;
|
|
18
|
-
const ChevronButton = styled.button `
|
|
19
|
-
background: transparent;
|
|
20
|
-
border: none;
|
|
21
|
-
color: ${({ theme, disabled }) => disabled ? theme.colors.onsurface["copy-light"] || "#B0B0B0" : "#222"};
|
|
22
|
-
font-size: 32px;
|
|
23
|
-
height: 40px;
|
|
24
|
-
border-radius: 10px;
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")};
|
|
29
|
-
margin-right: ${({ $right }) => ($right ? "0" : "8px")};
|
|
30
|
-
margin-left: ${({ $right }) => ($right ? "8px" : "0")};
|
|
31
|
-
transition: color 0.2s;
|
|
32
|
-
`;
|
|
33
|
-
const ChevronIcon = ({ left = false }) => (_jsx("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: left ? "M17.5 21L11.5 14L17.5 7" : "M10.5 7L16.5 14L10.5 21", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
34
|
-
const getSimplePages = (current, total) => {
|
|
35
|
-
// Always show 1-5, but don't exceed total
|
|
36
|
-
const pages = [];
|
|
37
|
-
for (let index = 1; index <= Math.min(5, total); index++) {
|
|
38
|
-
pages.push(index);
|
|
39
|
-
}
|
|
40
|
-
return pages;
|
|
41
|
-
};
|
|
42
|
-
const CustomPagination = ({ paginationStyle = PaginationStyle.SIMPLE, current = 1, total = 1, pageSize = 10, onChange, ...properties }) => {
|
|
43
|
-
const pageCount = Math.ceil(total / pageSize);
|
|
44
|
-
const handleChange = (page) => {
|
|
45
|
-
if (onChange)
|
|
46
|
-
onChange(page, pageSize);
|
|
47
|
-
};
|
|
48
|
-
if (paginationStyle === PaginationStyle.SIMPLE) {
|
|
49
|
-
const pages = getSimplePages(current, pageCount);
|
|
50
|
-
return (_jsxs(PaginationContainer, { children: [_jsx(ChevronButton, { onClick: () => handleChange(current - 1), disabled: current === 1, "aria-label": "Previous Page", children: _jsx(ChevronIcon, { left: true }) }), pages.map((number_) => (_jsx(PaginationNumber, { active: number_ === current, onClick: () => handleChange(number_), "aria-label": `Page ${number_}`, children: number_ }, number_))), _jsx(ChevronButton, { onClick: () => handleChange(current + 1), disabled: current === pageCount, "aria-label": "Next Page", "$right": true, children: _jsx(ChevronIcon, {}) })] }));
|
|
51
|
-
}
|
|
52
|
-
if (paginationStyle === PaginationStyle.TRUNCATED) {
|
|
53
|
-
// Show 1 2 3 4 5 ... last
|
|
54
|
-
const pages = [];
|
|
55
|
-
for (let index = 1; index <= Math.min(5, pageCount); index++) {
|
|
56
|
-
pages.push(index);
|
|
57
|
-
}
|
|
58
|
-
return (_jsxs(PaginationContainer, { children: [_jsx(ChevronButton, { onClick: () => handleChange(current - 1), disabled: current === 1, "aria-label": "Previous Page", children: _jsx(ChevronIcon, { left: true }) }), pages.map((number_) => (_jsx(PaginationNumber, { active: number_ === current, onClick: () => handleChange(number_), "aria-label": `Page ${number_}`, children: number_ }, number_))), pageCount > 5 && (_jsxs(_Fragment, { children: [_jsx("span", { style: {
|
|
59
|
-
color: "#7F7F7F",
|
|
60
|
-
fontWeight: 600,
|
|
61
|
-
fontSize: 16,
|
|
62
|
-
margin: "0 8px",
|
|
63
|
-
display: "flex",
|
|
64
|
-
alignItems: "center",
|
|
65
|
-
justifyContent: "center",
|
|
66
|
-
paddingBottom: 10,
|
|
67
|
-
}, children: "..." }), _jsx(PaginationNumber, { active: current === pageCount, onClick: () => handleChange(pageCount), "aria-label": `Page ${pageCount}`, children: pageCount }, pageCount)] })), _jsx(ChevronButton, { onClick: () => handleChange(current + 1), disabled: current === pageCount, "aria-label": "Next Page", "$right": true, children: _jsx(ChevronIcon, {}) })] }));
|
|
68
|
-
}
|
|
69
|
-
if (paginationStyle === PaginationStyle.CENTERED) {
|
|
70
|
-
// Show 1 ... left mid mid mid mid ... last
|
|
71
|
-
// Always show 5 numbers, current centered if possible
|
|
72
|
-
const pages = [];
|
|
73
|
-
const visibleCount = 5;
|
|
74
|
-
const sideCount = 2; // numbers to show on each side of current
|
|
75
|
-
let start = Math.max(2, current - 2);
|
|
76
|
-
let end = Math.min(pageCount - 1, current + 2);
|
|
77
|
-
// Adjust if near the start
|
|
78
|
-
if (current <= 3) {
|
|
79
|
-
start = 2;
|
|
80
|
-
end = 6;
|
|
81
|
-
}
|
|
82
|
-
// Adjust if near the end
|
|
83
|
-
if (current >= pageCount - 2) {
|
|
84
|
-
start = pageCount - 4;
|
|
85
|
-
end = pageCount - 1;
|
|
86
|
-
}
|
|
87
|
-
start = Math.max(2, start);
|
|
88
|
-
end = Math.min(pageCount - 1, end);
|
|
89
|
-
// Always show first page
|
|
90
|
-
pages.push(1);
|
|
91
|
-
// Show left ellipsis if needed
|
|
92
|
-
if (start > 2) {
|
|
93
|
-
pages.push("left-ellipsis");
|
|
94
|
-
}
|
|
95
|
-
// Show middle pages
|
|
96
|
-
for (let index = start; index <= end; index++) {
|
|
97
|
-
pages.push(index);
|
|
98
|
-
}
|
|
99
|
-
// Show right ellipsis if needed
|
|
100
|
-
if (end < pageCount - 1) {
|
|
101
|
-
pages.push("right-ellipsis");
|
|
102
|
-
}
|
|
103
|
-
// Always show last page if more than 1
|
|
104
|
-
if (pageCount > 1) {
|
|
105
|
-
pages.push(pageCount);
|
|
106
|
-
}
|
|
107
|
-
return (_jsxs(PaginationContainer, { children: [_jsx(ChevronButton, { onClick: () => handleChange(current - 1), disabled: current === 1, "aria-label": "Previous Page", children: _jsx(ChevronIcon, { left: true }) }), pages.map((number_, index) => {
|
|
108
|
-
if (number_ === "left-ellipsis" || number_ === "right-ellipsis") {
|
|
109
|
-
return (_jsx("span", { style: {
|
|
110
|
-
color: "#7F7F7FB0",
|
|
111
|
-
fontWeight: 600,
|
|
112
|
-
fontSize: 16,
|
|
113
|
-
margin: "0 8px",
|
|
114
|
-
height: "40px",
|
|
115
|
-
display: "flex",
|
|
116
|
-
alignItems: "center",
|
|
117
|
-
justifyContent: "center",
|
|
118
|
-
paddingBottom: 10,
|
|
119
|
-
}, children: "..." }, number_ + index));
|
|
120
|
-
}
|
|
121
|
-
return (_jsx(PaginationNumber, { active: number_ === current, onClick: () => typeof number_ === "number" && handleChange(number_), "aria-label": `Page ${number_}`, children: number_ }, number_));
|
|
122
|
-
}), _jsx(ChevronButton, { onClick: () => handleChange(current + 1), disabled: current === pageCount, "aria-label": "Next Page", "$right": true, children: _jsx(ChevronIcon, {}) })] }));
|
|
123
|
-
}
|
|
124
|
-
if (paginationStyle === PaginationStyle.END_FOCUSED) {
|
|
125
|
-
// Show 1 ... last 5 pages
|
|
126
|
-
const pages = [];
|
|
127
|
-
// Always show first page
|
|
128
|
-
pages.push(1);
|
|
129
|
-
// If more than 6 pages, show ellipsis
|
|
130
|
-
if (pageCount > 6) {
|
|
131
|
-
pages.push("left-ellipsis");
|
|
132
|
-
}
|
|
133
|
-
// Show last 5 pages
|
|
134
|
-
const start = Math.max(2, pageCount - 4);
|
|
135
|
-
for (let index = start; index <= pageCount; index++) {
|
|
136
|
-
pages.push(index);
|
|
137
|
-
}
|
|
138
|
-
return (_jsxs(PaginationContainer, { children: [_jsx(ChevronButton, { onClick: () => handleChange(current - 1), disabled: current === 1, "aria-label": "Previous Page", children: _jsx(ChevronIcon, { left: true }) }), pages.map((number_, index) => {
|
|
139
|
-
if (number_ === "left-ellipsis") {
|
|
140
|
-
return (_jsx("span", { style: {
|
|
141
|
-
color: "#7F7F7F",
|
|
142
|
-
fontWeight: 600,
|
|
143
|
-
fontSize: 18,
|
|
144
|
-
margin: "0 8px",
|
|
145
|
-
display: "flex",
|
|
146
|
-
alignItems: "center",
|
|
147
|
-
justifyContent: "center",
|
|
148
|
-
height: "40px",
|
|
149
|
-
paddingBottom: 10,
|
|
150
|
-
}, children: "..." }, number_ + index));
|
|
151
|
-
}
|
|
152
|
-
return (_jsx(PaginationNumber, { active: number_ === current, onClick: () => typeof number_ === "number" && handleChange(number_), "aria-label": `Page ${number_}`, children: number_ }, number_));
|
|
153
|
-
}), _jsx(ChevronButton, { onClick: () => handleChange(current + 1), disabled: current === pageCount, "aria-label": "Next Page", "$right": true, children: _jsx(ChevronIcon, {}) })] }));
|
|
154
|
-
}
|
|
155
|
-
// Fallback for other styles (not implemented yet)
|
|
156
|
-
return null;
|
|
157
|
-
};
|
|
158
|
-
export default CustomPagination;
|
package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import Typography from "../../Typography";
|
|
4
|
-
const NumberButton = styled.button `
|
|
5
|
-
background: ${({ $active, theme }) => $active ? theme.colors.primary.default.backgroundColor : "transparent"};
|
|
6
|
-
color: ${({ $active, theme }) => $active ? "#fff" : theme.colors.onsurface["copy-light"] || "#6C6C6C"};
|
|
7
|
-
border: none;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
min-width: 24px;
|
|
10
|
-
height: 24px;
|
|
11
|
-
padding: 4px 7px;
|
|
12
|
-
font-size: 16px;
|
|
13
|
-
font-weight: 600;
|
|
14
|
-
margin: 0 4px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
transition: background 0.2s, color 0.2s;
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
font-family: inherit;
|
|
21
|
-
white-space: nowrap;
|
|
22
|
-
|
|
23
|
-
&:hover {
|
|
24
|
-
background: ${({ $active, theme }) => $active
|
|
25
|
-
? theme.colors.primary.default.backgroundColor
|
|
26
|
-
: theme.colors.primary.default.backgroundColor + "22"};
|
|
27
|
-
color: #fff;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
export const PaginationNumber = ({ active, children, ...properties }) => (_jsx(NumberButton, { "$active": active, "aria-current": active ? "page" : undefined, ...properties, children: _jsx(Typography, { variant: "digits3", color: active ? "white" : "#6C6C6C", children: children }) }));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ActionEvent, TableEventPayload } from "../../../types/events";
|
|
3
|
-
type SortOption = {
|
|
4
|
-
value: string;
|
|
5
|
-
label: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
type SortOptions = SortOption[] | null;
|
|
8
|
-
export interface PrimaryTableControlsRowProps {
|
|
9
|
-
sortOptions: SortOptions;
|
|
10
|
-
searchByPlaceholder?: string;
|
|
11
|
-
searchField?: string;
|
|
12
|
-
isSortedAscending?: boolean;
|
|
13
|
-
onChange?: (event: ActionEvent<TableEventPayload>) => void;
|
|
14
|
-
searchValue?: string;
|
|
15
|
-
selectedSortOption?: string;
|
|
16
|
-
}
|
|
17
|
-
declare const PrimaryTableControlsRow: ({ sortOptions, searchByPlaceholder, searchField, isSortedAscending, searchValue, selectedSortOption, onChange, }: PrimaryTableControlsRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export default PrimaryTableControlsRow;
|