@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,89 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
import React from "react";
|
|
7
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
8
|
-
import DropdownChevron from "../shared/DropdownChevron";
|
|
9
|
-
import { Typography } from "@gobolt/genesis/components";
|
|
10
|
-
var getBackgroundColor = function (colors, disabled, $variant) {
|
|
11
|
-
if ($variant === "simple")
|
|
12
|
-
return "#F4F4F4";
|
|
13
|
-
if (disabled)
|
|
14
|
-
return "#F4F4F4";
|
|
15
|
-
return "#fff";
|
|
16
|
-
};
|
|
17
|
-
var TriggerWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: ", ";\n opacity: ", ";\n position: relative;\n box-shadow: ", ";\n transition: all 0.2s ease-in-out;\n min-height: ", ";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus {\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.12),\n 0 0 0 3px\n ", ";\n }\n\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: ", ";\n opacity: ", ";\n position: relative;\n box-shadow: ", ";\n transition: all 0.2s ease-in-out;\n min-height: ", ";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus {\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.12),\n 0 0 0 3px\n ", ";\n }\n\n ", "\n"])), function (_a) {
|
|
18
|
-
var $disabled = _a.$disabled;
|
|
19
|
-
return ($disabled ? "not-allowed" : "pointer");
|
|
20
|
-
}, function (_a) {
|
|
21
|
-
var $disabled = _a.$disabled;
|
|
22
|
-
return ($disabled ? 0.4 : 1);
|
|
23
|
-
}, function (_a) {
|
|
24
|
-
var $variant = _a.$variant;
|
|
25
|
-
return $variant === "simple" ? "none" : "0px 1px 2px 0px rgba(0, 0, 0, 0.12)";
|
|
26
|
-
}, function (_a) {
|
|
27
|
-
var $variant = _a.$variant;
|
|
28
|
-
return ($variant === "simple" ? "32px" : "40px");
|
|
29
|
-
}, function (_a) {
|
|
30
|
-
var theme = _a.theme, _b = _a.$themeType, $themeType = _b === void 0 ? "primary" : _b;
|
|
31
|
-
return theme.colors[$themeType].focussed.ringColor;
|
|
32
|
-
}, function (_a) {
|
|
33
|
-
var _b;
|
|
34
|
-
var $variant = _a.$variant, theme = _a.theme, $disabled = _a.$disabled;
|
|
35
|
-
return $variant === "simple"
|
|
36
|
-
? "\n padding: ".concat(theme.sizing.Size1, " ").concat(theme.sizing.Size2, ";\n background: ").concat($disabled ? theme.colors.inputs.surface.disabled : "rgba(0, 0, 0, 0.04)", ";\n border: none;\n border-radius: ").concat(theme.borderRadius.BorderRadiusSm, "px;\n min-height: ").concat(function (_a) {
|
|
37
|
-
var $variant = _a.$variant;
|
|
38
|
-
return ($variant === "simple" ? "32px" : "40px");
|
|
39
|
-
}, ";\n\n &:hover {\n border: none;\n }\n ")
|
|
40
|
-
: "\n padding: ".concat(theme.sizing.Size1, " ").concat(theme.sizing.Size2, ";\n background: ").concat($disabled
|
|
41
|
-
? theme.colors.inputs.surface.disabled
|
|
42
|
-
: (_b = theme.colors.surface.default) === null || _b === void 0 ? void 0 : _b.backgroundColor, ";\n border: 1px solid #9a9a9a;\n border-radius: ").concat(theme.borderRadius.BorderRadiusSm, "px;\n min-height: ").concat(function (_a) {
|
|
43
|
-
var $variant = _a.$variant;
|
|
44
|
-
return ($variant === "simple" ? "32px" : "40px");
|
|
45
|
-
}, ";\n\n &:hover {\n border-color: rgba(0, 0, 0, 0.2);\n }\n ");
|
|
46
|
-
});
|
|
47
|
-
var ValueContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n flex: 1;\n padding: 4px 8px;\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n flex: 1;\n padding: 4px 8px;\n"])), function (_a) {
|
|
48
|
-
var theme = _a.theme;
|
|
49
|
-
return theme.sizing.Size2;
|
|
50
|
-
});
|
|
51
|
-
var ChevronContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: ", ";\n margin-left: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (_a) {
|
|
52
|
-
var $variant = _a.$variant;
|
|
53
|
-
return ($variant === "simple" ? "4px" : "4px");
|
|
54
|
-
}, function (_a) {
|
|
55
|
-
var $variant = _a.$variant;
|
|
56
|
-
return ($variant === "simple" ? "4px" : "0");
|
|
57
|
-
});
|
|
58
|
-
var SelectTrigger = function (_a) {
|
|
59
|
-
var _b = _a.type, type = _b === void 0 ? "primary" : _b, theme = _a.theme, state = _a.state, value = _a.value, _c = _a.placeholder, placeholder = _c === void 0 ? "Select..." : _c, open = _a.open, onClick = _a.onClick, renderValue = _a.renderValue, _d = _a.options, options = _d === void 0 ? [] : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.variant, variant = _f === void 0 ? "none" : _f;
|
|
60
|
-
var handleClick = React.useCallback(function () {
|
|
61
|
-
if (disabled)
|
|
62
|
-
return;
|
|
63
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
64
|
-
}, [disabled, onClick]);
|
|
65
|
-
var displayValue = React.useMemo(function () {
|
|
66
|
-
if (!value)
|
|
67
|
-
return null;
|
|
68
|
-
if (renderValue)
|
|
69
|
-
return renderValue(value);
|
|
70
|
-
if (Array.isArray(value)) {
|
|
71
|
-
if (value.length === 0)
|
|
72
|
-
return null;
|
|
73
|
-
var selectedLabels = value
|
|
74
|
-
.map(String)
|
|
75
|
-
.map(function (v) { var _a; return (_a = options.find(function (opt) { return opt.value === v; })) === null || _a === void 0 ? void 0 : _a.label; })
|
|
76
|
-
.filter(Boolean);
|
|
77
|
-
return selectedLabels.length > 0
|
|
78
|
-
? selectedLabels.join(", ")
|
|
79
|
-
: "".concat(value.length, " selected");
|
|
80
|
-
}
|
|
81
|
-
var selectedOption = options.find(function (opt) { return opt.value === String(value); });
|
|
82
|
-
return (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || value.toString();
|
|
83
|
-
}, [value, renderValue, options]);
|
|
84
|
-
return (_jsxs(TriggerWrapper, { "$themeType": type, "$state": state, onClick: handleClick, tabIndex: disabled ? -1 : 0, role: "button", "$disabled": disabled, "$variant": variant, style: {
|
|
85
|
-
backgroundColor: getBackgroundColor(theme, disabled, variant),
|
|
86
|
-
}, 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, {}) })] }));
|
|
87
|
-
};
|
|
88
|
-
export default SelectTrigger;
|
|
89
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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,14 +0,0 @@
|
|
|
1
|
-
import { TableProps } from "antd";
|
|
2
|
-
import { type GenesisTheme } from "@gobolt/genesis/styles/theme/genesis-theme.types";
|
|
3
|
-
export interface StyledTableProps<T = any> extends TableProps<T> {
|
|
4
|
-
theme?: GenesisTheme;
|
|
5
|
-
$isMainContentCell?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const getGenesisClass: ({ colors, borderRadius, sizing, typography, components }: {
|
|
8
|
-
colors: any;
|
|
9
|
-
borderRadius: any;
|
|
10
|
-
sizing: any;
|
|
11
|
-
typography: any;
|
|
12
|
-
components: any;
|
|
13
|
-
}, $isMainContentCell: any) => string;
|
|
14
|
-
export declare const Table: any;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
2
|
-
import { Table as AntTable } from "antd";
|
|
3
|
-
export const getGenesisClass = ({ colors, borderRadius, sizing, typography, components }, $isMainContentCell) => {
|
|
4
|
-
// Log the hovered color and the entire tableCell object
|
|
5
|
-
return `
|
|
6
|
-
&.ant-table-wrapper {
|
|
7
|
-
// Add your custom styles here
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ant-table {
|
|
11
|
-
// Add your custom table styles here
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ant-table-cell {
|
|
15
|
-
font-size: ${$isMainContentCell ? "16px" : "14px"} !important;
|
|
16
|
-
color: ${$isMainContentCell
|
|
17
|
-
? colors.onsurface.copy
|
|
18
|
-
: colors.onsurface["copy-light"]} !important;
|
|
19
|
-
background-color: ${components.tableCell.surface} !important;
|
|
20
|
-
transition: background-color 0.2s ease;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.ant-table-tbody > tr:hover > td,
|
|
24
|
-
.ant-table-tbody > tr:hover > .ant-table-cell {
|
|
25
|
-
background-color: ${components.tableCell.hover} !important;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ant-table-cell-selected {
|
|
29
|
-
background-color: ${components.tableCell.selected} !important;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.ant-table-thead > tr > th {
|
|
33
|
-
// Add your custom header styles here
|
|
34
|
-
font-family: 'Inter', sans-serif;
|
|
35
|
-
font-size: ${$isMainContentCell ? "16px" : "14px"} !important;
|
|
36
|
-
font-weight: 400;
|
|
37
|
-
color: ${$isMainContentCell
|
|
38
|
-
? colors.onsurface.copy
|
|
39
|
-
: colors.onsurface["copy-light"]} !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.ant-table-tbody > tr {
|
|
43
|
-
// Add your custom row styles here
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ant-table-tbody > tr > td {
|
|
47
|
-
// Add your custom cell styles here
|
|
48
|
-
font-family: 'Inter', sans-serif;
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
color: ${colors.onsurface["copy-light"]};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ant-table-tbody > tr.ant-table-row-selected > td,
|
|
54
|
-
.ant-table-tbody > tr.ant-table-row-selected > .ant-table-cell {
|
|
55
|
-
background-color: ${components.tableCell.selected} !important;
|
|
56
|
-
color: #fff !important;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
};
|
|
60
|
-
export const Table = styled(AntTable) `
|
|
61
|
-
${({ theme, $isMainContentCell }) => {
|
|
62
|
-
return getGenesisClass(theme, $isMainContentCell);
|
|
63
|
-
}}
|
|
64
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ColumnsType } from "antd/es/table";
|
|
2
|
-
import type { SelectionType } from "./Table";
|
|
3
|
-
export type UseTableConfig = {
|
|
4
|
-
columns: ColumnsType<any>;
|
|
5
|
-
filters?: Record<string, any>;
|
|
6
|
-
fetchUrl?: string;
|
|
7
|
-
fetchOptions?: RequestInit;
|
|
8
|
-
selectionType?: SelectionType;
|
|
9
|
-
simulateDelay?: number;
|
|
10
|
-
disableRowSelection?: (record: any) => unknown;
|
|
11
|
-
disableAutoFetch?: boolean;
|
|
12
|
-
dataSource?: any[];
|
|
13
|
-
};
|
|
14
|
-
export declare const useTable: <T extends Record<string, any>>(useTableConfig: any) => {
|
|
15
|
-
isLoading: boolean;
|
|
16
|
-
rowSelection: {
|
|
17
|
-
type: SelectionType;
|
|
18
|
-
onChange: (selectedRowKeys: React.Key[], selectedRows: T[]) => void;
|
|
19
|
-
getCheckboxProps: (record: any) => unknown;
|
|
20
|
-
};
|
|
21
|
-
selectedRows: T[];
|
|
22
|
-
updateDataSource: (newDataSource: T[]) => void;
|
|
23
|
-
dataSource: T[];
|
|
24
|
-
columns: ColumnsType<T>;
|
|
25
|
-
error: Error | null;
|
|
26
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback } from "react";
|
|
2
|
-
// Function to sort data by field and order
|
|
3
|
-
const sortData = (data, sorter) => {
|
|
4
|
-
// Handle case when no sorting is applied
|
|
5
|
-
if (!sorter || (Array.isArray(sorter) && sorter.length === 0)) {
|
|
6
|
-
return [...data];
|
|
7
|
-
}
|
|
8
|
-
// Handle multiple sorters
|
|
9
|
-
if (Array.isArray(sorter)) {
|
|
10
|
-
return [...data].sort((a, b) => {
|
|
11
|
-
for (const sort of sorter) {
|
|
12
|
-
if (!sort.field)
|
|
13
|
-
continue;
|
|
14
|
-
const field = sort.field;
|
|
15
|
-
const aValue = a[field];
|
|
16
|
-
const bValue = b[field];
|
|
17
|
-
if (aValue < bValue)
|
|
18
|
-
return sort.order === "ascend" ? -1 : 1;
|
|
19
|
-
if (aValue > bValue)
|
|
20
|
-
return sort.order === "ascend" ? 1 : -1;
|
|
21
|
-
}
|
|
22
|
-
return 0;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
// Handle single sorter
|
|
26
|
-
if (sorter.field) {
|
|
27
|
-
const field = sorter.field;
|
|
28
|
-
return [...data].sort((a, b) => {
|
|
29
|
-
const aValue = a[field];
|
|
30
|
-
const bValue = b[field];
|
|
31
|
-
if (sorter.order === "ascend") {
|
|
32
|
-
if (aValue < bValue)
|
|
33
|
-
return -1;
|
|
34
|
-
if (aValue > bValue)
|
|
35
|
-
return 1;
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
38
|
-
if (sorter.order === "descend") {
|
|
39
|
-
if (aValue < bValue)
|
|
40
|
-
return 1;
|
|
41
|
-
if (aValue > bValue)
|
|
42
|
-
return -1;
|
|
43
|
-
return 0;
|
|
44
|
-
}
|
|
45
|
-
return 0;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return [...data];
|
|
49
|
-
};
|
|
50
|
-
/*
|
|
51
|
-
Example of disableRowSelection function which can be passed to the useTable hook
|
|
52
|
-
const disableRowSelection = (record: any) => ({
|
|
53
|
-
disabled: record.status === "completed", // Column configuration not to be checked
|
|
54
|
-
name: record.status.toString(),
|
|
55
|
-
});
|
|
56
|
-
*/
|
|
57
|
-
const defaultRowSelection = (record) => ({
|
|
58
|
-
disabled: false, // Add your disable logic here
|
|
59
|
-
name: record.id,
|
|
60
|
-
});
|
|
61
|
-
export const useTable = (useTableConfig) => {
|
|
62
|
-
const [isLoading, setLoading] = useState(true);
|
|
63
|
-
const { columns, filters = null, fetchUrl = "/table/data", fetchOptions = {
|
|
64
|
-
method: "POST",
|
|
65
|
-
headers: {
|
|
66
|
-
"Content-Type": "application/json",
|
|
67
|
-
},
|
|
68
|
-
body: JSON.stringify(filters),
|
|
69
|
-
}, selectionType = "checkbox", simulateDelay = 0, disableRowSelection = defaultRowSelection, disableAutoFetch = false, dataSource: initialDataSource = [], } = useTableConfig;
|
|
70
|
-
// State to hold the original data and the current data
|
|
71
|
-
const [originalData, setOriginalData] = useState(initialDataSource);
|
|
72
|
-
const [data, setData] = useState({
|
|
73
|
-
dataSource: initialDataSource,
|
|
74
|
-
columns,
|
|
75
|
-
error: null,
|
|
76
|
-
});
|
|
77
|
-
const [selectedRows, setSelectedRows] = useState([]);
|
|
78
|
-
// Load initial data
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
// If auto-fetch is disabled and we have initial data, skip fetching
|
|
81
|
-
if (disableAutoFetch && initialDataSource.length > 0) {
|
|
82
|
-
setLoading(false);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const fetchData = async () => {
|
|
86
|
-
try {
|
|
87
|
-
const response = await fetch(fetchUrl, fetchOptions);
|
|
88
|
-
const result = await response.json();
|
|
89
|
-
const sourceData = result.data || [];
|
|
90
|
-
setOriginalData(sourceData);
|
|
91
|
-
setData({
|
|
92
|
-
dataSource: sourceData,
|
|
93
|
-
columns,
|
|
94
|
-
error: null,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
console.error("Error fetching table data:", error);
|
|
99
|
-
// Fallback to static data
|
|
100
|
-
setData({
|
|
101
|
-
dataSource: [],
|
|
102
|
-
columns,
|
|
103
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
setLoading(false);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
if (simulateDelay > 0) {
|
|
111
|
-
setTimeout(fetchData, simulateDelay);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
fetchData();
|
|
115
|
-
}
|
|
116
|
-
}, [fetchOptions, disableAutoFetch, initialDataSource]);
|
|
117
|
-
const handleRowSelection = useCallback((selectedRowKeys, selectedRows) => {
|
|
118
|
-
console.log("Row Selected:", selectedRowKeys, selectedRows);
|
|
119
|
-
setSelectedRows(selectedRows);
|
|
120
|
-
}, []);
|
|
121
|
-
// Function to manually update data source (for external data fetching)
|
|
122
|
-
const updateDataSource = useCallback((newDataSource) => {
|
|
123
|
-
setOriginalData(newDataSource);
|
|
124
|
-
setData((prev) => ({
|
|
125
|
-
...prev,
|
|
126
|
-
dataSource: newDataSource,
|
|
127
|
-
}));
|
|
128
|
-
}, []);
|
|
129
|
-
const rowSelection = {
|
|
130
|
-
type: selectionType,
|
|
131
|
-
onChange: handleRowSelection,
|
|
132
|
-
getCheckboxProps: disableRowSelection,
|
|
133
|
-
};
|
|
134
|
-
return {
|
|
135
|
-
...data,
|
|
136
|
-
isLoading,
|
|
137
|
-
rowSelection,
|
|
138
|
-
selectedRows,
|
|
139
|
-
updateDataSource,
|
|
140
|
-
};
|
|
141
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import * as S from "./styles";
|
|
25
|
-
import CustomPagination, { PaginationStyle, } from "./TableControls/CustomPagination";
|
|
26
|
-
function Table(_a) {
|
|
27
|
-
var columns = _a.columns, dataSource = _a.dataSource, _b = _a.rowKey, rowKey = _b === void 0 ? "id" : _b, _c = _a.size, size = _c === void 0 ? "small" : _c, onChange = _a.onChange, rowSelection = _a.rowSelection, pagination = _a.pagination, _d = _a.isMainContentCell, isMainContentCell = _d === void 0 ? false : _d, rest = __rest(_a, ["columns", "dataSource", "rowKey", "size", "onChange", "rowSelection", "pagination", "isMainContentCell"]);
|
|
28
|
-
var paginationConfig = pagination === false
|
|
29
|
-
? false
|
|
30
|
-
: __assign(__assign({}, pagination), { itemRender: undefined, render: function (properties) { return (_jsx(CustomPagination, __assign({}, properties, { paginationStyle: (pagination === null || pagination === void 0 ? void 0 : pagination.paginationStyle) || PaginationStyle.SIMPLE }))); } });
|
|
31
|
-
return (_jsx(S.Table, __assign({ "data-testid": "Table", dataSource: dataSource, columns: columns, rowKey: rowKey, locale: { emptyText: "No Data" }, size: size, onChange: onChange, rowSelection: rowSelection, pagination: paginationConfig, "$isMainContentCell": isMainContentCell }, rest)));
|
|
32
|
-
}
|
|
33
|
-
export default Table;
|