@gobolt/genesis 0.3.25 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +30 -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/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 +1 -1
- 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 +2 -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 +4 -4
- 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/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 +84476 -0
- package/dist/index.d.ts +6 -10
- package/dist/index.js +84459 -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 -1
- package/dist/styles/theme/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +17 -18
- 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.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,238 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
49
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
50
|
-
if (!m) return o;
|
|
51
|
-
var i = m.call(o), r, ar = [], e;
|
|
52
|
-
try {
|
|
53
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
54
|
-
}
|
|
55
|
-
catch (error) { e = { error: error }; }
|
|
56
|
-
finally {
|
|
57
|
-
try {
|
|
58
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
59
|
-
}
|
|
60
|
-
finally { if (e) throw e.error; }
|
|
61
|
-
}
|
|
62
|
-
return ar;
|
|
63
|
-
};
|
|
64
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
65
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
66
|
-
if (ar || !(i in from)) {
|
|
67
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
68
|
-
ar[i] = from[i];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
72
|
-
};
|
|
73
|
-
var __values = (this && this.__values) || function(o) {
|
|
74
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
75
|
-
if (m) return m.call(o);
|
|
76
|
-
if (o && typeof o.length === "number") return {
|
|
77
|
-
next: function () {
|
|
78
|
-
if (o && i >= o.length) o = void 0;
|
|
79
|
-
return { value: o && o[i++], done: !o };
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
83
|
-
};
|
|
84
|
-
import { useState, useEffect, useCallback } from "react";
|
|
85
|
-
// Function to sort data by field and order
|
|
86
|
-
var sortData = function (data, sorter) {
|
|
87
|
-
// Handle case when no sorting is applied
|
|
88
|
-
if (!sorter || (Array.isArray(sorter) && sorter.length === 0)) {
|
|
89
|
-
return __spreadArray([], __read(data), false);
|
|
90
|
-
}
|
|
91
|
-
// Handle multiple sorters
|
|
92
|
-
if (Array.isArray(sorter)) {
|
|
93
|
-
return __spreadArray([], __read(data), false).sort(function (a, b) {
|
|
94
|
-
var e_1, _a;
|
|
95
|
-
try {
|
|
96
|
-
for (var sorter_1 = __values(sorter), sorter_1_1 = sorter_1.next(); !sorter_1_1.done; sorter_1_1 = sorter_1.next()) {
|
|
97
|
-
var sort = sorter_1_1.value;
|
|
98
|
-
if (!sort.field)
|
|
99
|
-
continue;
|
|
100
|
-
var field = sort.field;
|
|
101
|
-
var aValue = a[field];
|
|
102
|
-
var bValue = b[field];
|
|
103
|
-
if (aValue < bValue)
|
|
104
|
-
return sort.order === "ascend" ? -1 : 1;
|
|
105
|
-
if (aValue > bValue)
|
|
106
|
-
return sort.order === "ascend" ? 1 : -1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
110
|
-
finally {
|
|
111
|
-
try {
|
|
112
|
-
if (sorter_1_1 && !sorter_1_1.done && (_a = sorter_1.return)) _a.call(sorter_1);
|
|
113
|
-
}
|
|
114
|
-
finally { if (e_1) throw e_1.error; }
|
|
115
|
-
}
|
|
116
|
-
return 0;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
// Handle single sorter
|
|
120
|
-
if (sorter.field) {
|
|
121
|
-
var field_1 = sorter.field;
|
|
122
|
-
return __spreadArray([], __read(data), false).sort(function (a, b) {
|
|
123
|
-
var aValue = a[field_1];
|
|
124
|
-
var bValue = b[field_1];
|
|
125
|
-
if (sorter.order === "ascend") {
|
|
126
|
-
if (aValue < bValue)
|
|
127
|
-
return -1;
|
|
128
|
-
if (aValue > bValue)
|
|
129
|
-
return 1;
|
|
130
|
-
return 0;
|
|
131
|
-
}
|
|
132
|
-
if (sorter.order === "descend") {
|
|
133
|
-
if (aValue < bValue)
|
|
134
|
-
return 1;
|
|
135
|
-
if (aValue > bValue)
|
|
136
|
-
return -1;
|
|
137
|
-
return 0;
|
|
138
|
-
}
|
|
139
|
-
return 0;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
return __spreadArray([], __read(data), false);
|
|
143
|
-
};
|
|
144
|
-
/*
|
|
145
|
-
Example of disableRowSelection function which can be passed to the useTable hook
|
|
146
|
-
const disableRowSelection = (record: any) => ({
|
|
147
|
-
disabled: record.status === "completed", // Column configuration not to be checked
|
|
148
|
-
name: record.status.toString(),
|
|
149
|
-
});
|
|
150
|
-
*/
|
|
151
|
-
var defaultRowSelection = function (record) { return ({
|
|
152
|
-
disabled: false, // Add your disable logic here
|
|
153
|
-
name: record.id,
|
|
154
|
-
}); };
|
|
155
|
-
export var useTable = function (useTableConfig) {
|
|
156
|
-
var _a = __read(useState(true), 2), isLoading = _a[0], setLoading = _a[1];
|
|
157
|
-
var _b = useTableConfig, columns = _b.columns, _c = _b.filters, filters = _c === void 0 ? null : _c, _d = _b.fetchUrl, fetchUrl = _d === void 0 ? "/table/data" : _d, _e = _b.fetchOptions, fetchOptions = _e === void 0 ? {
|
|
158
|
-
method: "POST",
|
|
159
|
-
headers: {
|
|
160
|
-
"Content-Type": "application/json",
|
|
161
|
-
},
|
|
162
|
-
body: JSON.stringify(filters),
|
|
163
|
-
} : _e, _f = _b.selectionType, selectionType = _f === void 0 ? "checkbox" : _f, _g = _b.simulateDelay, simulateDelay = _g === void 0 ? 0 : _g, _h = _b.disableRowSelection, disableRowSelection = _h === void 0 ? defaultRowSelection : _h, _j = _b.disableAutoFetch, disableAutoFetch = _j === void 0 ? false : _j, _k = _b.dataSource, initialDataSource = _k === void 0 ? [] : _k;
|
|
164
|
-
// State to hold the original data and the current data
|
|
165
|
-
var _l = __read(useState(initialDataSource), 2), originalData = _l[0], setOriginalData = _l[1];
|
|
166
|
-
var _m = __read(useState({
|
|
167
|
-
dataSource: initialDataSource,
|
|
168
|
-
columns: columns,
|
|
169
|
-
error: null,
|
|
170
|
-
}), 2), data = _m[0], setData = _m[1];
|
|
171
|
-
var _o = __read(useState([]), 2), selectedRows = _o[0], setSelectedRows = _o[1];
|
|
172
|
-
// Load initial data
|
|
173
|
-
useEffect(function () {
|
|
174
|
-
// If auto-fetch is disabled and we have initial data, skip fetching
|
|
175
|
-
if (disableAutoFetch && initialDataSource.length > 0) {
|
|
176
|
-
setLoading(false);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
|
-
var response, result, sourceData, error_1;
|
|
181
|
-
return __generator(this, function (_a) {
|
|
182
|
-
switch (_a.label) {
|
|
183
|
-
case 0:
|
|
184
|
-
_a.trys.push([0, 3, 4, 5]);
|
|
185
|
-
return [4 /*yield*/, fetch(fetchUrl, fetchOptions)];
|
|
186
|
-
case 1:
|
|
187
|
-
response = _a.sent();
|
|
188
|
-
return [4 /*yield*/, response.json()];
|
|
189
|
-
case 2:
|
|
190
|
-
result = _a.sent();
|
|
191
|
-
sourceData = result.data || [];
|
|
192
|
-
setOriginalData(sourceData);
|
|
193
|
-
setData({
|
|
194
|
-
dataSource: sourceData,
|
|
195
|
-
columns: columns,
|
|
196
|
-
error: null,
|
|
197
|
-
});
|
|
198
|
-
return [3 /*break*/, 5];
|
|
199
|
-
case 3:
|
|
200
|
-
error_1 = _a.sent();
|
|
201
|
-
console.error("Error fetching table data:", error_1);
|
|
202
|
-
// Fallback to static data
|
|
203
|
-
setData({
|
|
204
|
-
dataSource: [],
|
|
205
|
-
columns: columns,
|
|
206
|
-
error: error_1 instanceof Error ? error_1 : new Error(String(error_1)),
|
|
207
|
-
});
|
|
208
|
-
return [3 /*break*/, 5];
|
|
209
|
-
case 4:
|
|
210
|
-
setLoading(false);
|
|
211
|
-
return [7 /*endfinally*/];
|
|
212
|
-
case 5: return [2 /*return*/];
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}); };
|
|
216
|
-
if (simulateDelay > 0) {
|
|
217
|
-
setTimeout(fetchData, simulateDelay);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
fetchData();
|
|
221
|
-
}
|
|
222
|
-
}, [fetchOptions, disableAutoFetch, initialDataSource]);
|
|
223
|
-
var handleRowSelection = useCallback(function (selectedRowKeys, selectedRows) {
|
|
224
|
-
console.log("Row Selected:", selectedRowKeys, selectedRows);
|
|
225
|
-
setSelectedRows(selectedRows);
|
|
226
|
-
}, []);
|
|
227
|
-
// Function to manually update data source (for external data fetching)
|
|
228
|
-
var updateDataSource = useCallback(function (newDataSource) {
|
|
229
|
-
setOriginalData(newDataSource);
|
|
230
|
-
setData(function (prev) { return (__assign(__assign({}, prev), { dataSource: newDataSource })); });
|
|
231
|
-
}, []);
|
|
232
|
-
var rowSelection = {
|
|
233
|
-
type: selectionType,
|
|
234
|
-
onChange: handleRowSelection,
|
|
235
|
-
getCheckboxProps: disableRowSelection,
|
|
236
|
-
};
|
|
237
|
-
return __assign(__assign({}, data), { isLoading: isLoading, rowSelection: rowSelection, selectedRows: selectedRows, updateDataSource: updateDataSource });
|
|
238
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import TableControls from "../Table/TableControls";
|
|
3
|
-
import Table from "../Table";
|
|
4
|
-
var TableWithControls = function (_a) {
|
|
5
|
-
var tableData = _a.tableData, tableControlsData = _a.tableControlsData, onChange = _a.onChange;
|
|
6
|
-
var primaryTableRowData = tableControlsData.primaryTableRowData, secondaryTableRowData = tableControlsData.secondaryTableRowData;
|
|
7
|
-
var dataSource = tableData.dataSource, columns = tableData.columns, rowSelection = tableData.rowSelection;
|
|
8
|
-
// handle changes from the table controls
|
|
9
|
-
var onTableControlsChange = function (event) {
|
|
10
|
-
onChange(event);
|
|
11
|
-
};
|
|
12
|
-
// handle changes from the table
|
|
13
|
-
var onTableChange = function (pagination, filters, sorter) {
|
|
14
|
-
onChange({
|
|
15
|
-
event: "tableChange",
|
|
16
|
-
payload: { pagination: pagination, filters: filters, sorter: sorter },
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableControls, { primaryTableRowData: primaryTableRowData, secondaryTableRowData: secondaryTableRowData, onChange: onTableControlsChange }), _jsx(Table, { dataSource: dataSource, columns: columns, rowSelection: rowSelection, onChange: onTableChange })] }));
|
|
20
|
-
};
|
|
21
|
-
export default TableWithControls;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import TableWithControls from "../TableWithControls";
|
|
3
|
-
declare const meta: Meta<typeof TableWithControls>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof TableWithControls>;
|
|
6
|
-
export declare const Default: Story;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
38
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
39
|
-
if (!m) return o;
|
|
40
|
-
var i = m.call(o), r, ar = [], e;
|
|
41
|
-
try {
|
|
42
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
43
|
-
}
|
|
44
|
-
catch (error) { e = { error: error }; }
|
|
45
|
-
finally {
|
|
46
|
-
try {
|
|
47
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
48
|
-
}
|
|
49
|
-
finally { if (e) throw e.error; }
|
|
50
|
-
}
|
|
51
|
-
return ar;
|
|
52
|
-
};
|
|
53
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
54
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
55
|
-
if (ar || !(i in from)) {
|
|
56
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
57
|
-
ar[i] = from[i];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
61
|
-
};
|
|
62
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
63
|
-
import description from "./TableWithControlsDescription.md?raw";
|
|
64
|
-
import TableWithControls from "../TableWithControls";
|
|
65
|
-
import { http } from "msw";
|
|
66
|
-
import { mockDataSource } from "@/lib/components/Table/__mocks__/table-mocks";
|
|
67
|
-
import { TableWithControlsStory } from "./TableWithControlsStory";
|
|
68
|
-
var meta = {
|
|
69
|
-
component: TableWithControls,
|
|
70
|
-
title: "Components/Table/TableWithControls",
|
|
71
|
-
tags: ["autodocs"],
|
|
72
|
-
parameters: {
|
|
73
|
-
layout: "centered",
|
|
74
|
-
docs: {
|
|
75
|
-
description: {
|
|
76
|
-
component: description,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
msw: {
|
|
80
|
-
handlers: [
|
|
81
|
-
http.post("/table/data", function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
82
|
-
var reader, json, page, count, pages, per_page, sort, search, order, sortedData, filteredData;
|
|
83
|
-
var _c, _d, _e, _f, _g, _h, _j;
|
|
84
|
-
var request = _b.request;
|
|
85
|
-
return __generator(this, function (_k) {
|
|
86
|
-
switch (_k.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
reader = (_c = request.body) === null || _c === void 0 ? void 0 : _c.getReader();
|
|
89
|
-
return [4 /*yield*/, (reader === null || reader === void 0 ? void 0 : reader.read().then(function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
90
|
-
var decoder, text, json;
|
|
91
|
-
var value = _b.value;
|
|
92
|
-
return __generator(this, function (_c) {
|
|
93
|
-
decoder = new TextDecoder();
|
|
94
|
-
text = decoder.decode(value);
|
|
95
|
-
json = JSON.parse(text);
|
|
96
|
-
return [2 /*return*/, json];
|
|
97
|
-
});
|
|
98
|
-
}); }))];
|
|
99
|
-
case 1:
|
|
100
|
-
json = _k.sent();
|
|
101
|
-
page = ((_d = json === null || json === void 0 ? void 0 : json.filters) === null || _d === void 0 ? void 0 : _d.page) || 1;
|
|
102
|
-
count = ((_e = json === null || json === void 0 ? void 0 : json.filters) === null || _e === void 0 ? void 0 : _e.count) || 10;
|
|
103
|
-
pages = Math.ceil(mockDataSource.appointments.length / count);
|
|
104
|
-
per_page = ((_f = json === null || json === void 0 ? void 0 : json.filters) === null || _f === void 0 ? void 0 : _f.per_page) || 10;
|
|
105
|
-
sort = ((_g = json === null || json === void 0 ? void 0 : json.filters) === null || _g === void 0 ? void 0 : _g.sort) || null;
|
|
106
|
-
search = ((_h = json === null || json === void 0 ? void 0 : json.filters) === null || _h === void 0 ? void 0 : _h.search) || {
|
|
107
|
-
value: "",
|
|
108
|
-
field: "address",
|
|
109
|
-
};
|
|
110
|
-
order = ((_j = json === null || json === void 0 ? void 0 : json.filters) === null || _j === void 0 ? void 0 : _j.order) || "asc";
|
|
111
|
-
sortedData = __spreadArray([], __read(mockDataSource.appointments), false).sort(function (a, b) {
|
|
112
|
-
return order === "asc" ? a.id - b.id : b.id - a.id;
|
|
113
|
-
});
|
|
114
|
-
// secondary sort by string
|
|
115
|
-
if (sort) {
|
|
116
|
-
sortedData.sort(function (a, b) {
|
|
117
|
-
if (a[sort] < b[sort])
|
|
118
|
-
return -1;
|
|
119
|
-
if (a[sort] > b[sort])
|
|
120
|
-
return 1;
|
|
121
|
-
return 0;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
filteredData = sortedData.filter(function (item) {
|
|
125
|
-
// Check all direct properties except address
|
|
126
|
-
var directMatch = Object.entries(item)
|
|
127
|
-
.filter(function (_a) {
|
|
128
|
-
var _b = __read(_a, 1), key = _b[0];
|
|
129
|
-
return key !== (search === null || search === void 0 ? void 0 : search.field);
|
|
130
|
-
})
|
|
131
|
-
.some(function (_a) {
|
|
132
|
-
var _b = __read(_a, 2), _ = _b[0], value = _b[1];
|
|
133
|
-
return value
|
|
134
|
-
.toString()
|
|
135
|
-
.toLowerCase()
|
|
136
|
-
.includes(search === null || search === void 0 ? void 0 : search.value.toLowerCase());
|
|
137
|
-
});
|
|
138
|
-
// Check address properties if address exists
|
|
139
|
-
var fieldMatch = item[search === null || search === void 0 ? void 0 : search.field]
|
|
140
|
-
? Object.values(item[search === null || search === void 0 ? void 0 : search.field]).some(function (value) {
|
|
141
|
-
return value === null || value === void 0 ? void 0 : value.toString().toLowerCase().includes(search === null || search === void 0 ? void 0 : search.value.toLowerCase());
|
|
142
|
-
})
|
|
143
|
-
: false;
|
|
144
|
-
return directMatch || fieldMatch;
|
|
145
|
-
});
|
|
146
|
-
return [2 /*return*/, new Response(JSON.stringify({
|
|
147
|
-
data: filteredData,
|
|
148
|
-
pagination: {
|
|
149
|
-
count: count,
|
|
150
|
-
page: page,
|
|
151
|
-
pages: pages,
|
|
152
|
-
per_page: "ALL",
|
|
153
|
-
},
|
|
154
|
-
meta: {
|
|
155
|
-
total_count: mockDataSource.appointments.length,
|
|
156
|
-
page: page,
|
|
157
|
-
per_page: per_page,
|
|
158
|
-
},
|
|
159
|
-
}), {
|
|
160
|
-
status: 200,
|
|
161
|
-
headers: { "Content-Type": "application/json" },
|
|
162
|
-
})];
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}); }),
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
export default meta;
|
|
171
|
-
export var Default = {
|
|
172
|
-
parameters: {
|
|
173
|
-
msw: {
|
|
174
|
-
enabled: true,
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
render: function () { return _jsx(TableWithControlsStory, {}); },
|
|
178
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TableWithControlsStory: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import TableWithControls from "../TableWithControls";
|
|
3
|
-
import { mockColumns, mockDataSource } from "../../Table/__mocks__/table-mocks";
|
|
4
|
-
import { useTableWithControls } from "../useTableWithControls";
|
|
5
|
-
var tableControlsData = {
|
|
6
|
-
primaryTableRowData: {
|
|
7
|
-
sortOptions: [
|
|
8
|
-
{ value: "status", label: _jsx("span", { children: "Status" }) },
|
|
9
|
-
{ value: "address", label: _jsx("span", { children: "Address" }) },
|
|
10
|
-
{ value: "job_subtype", label: _jsx("span", { children: "Type" }) },
|
|
11
|
-
],
|
|
12
|
-
searchByPlaceholder: "Search by Address",
|
|
13
|
-
isSortedAscending: true,
|
|
14
|
-
},
|
|
15
|
-
secondaryTableRowData: {
|
|
16
|
-
groups: {
|
|
17
|
-
orders: ["Cancelled", "Paused"],
|
|
18
|
-
warehouse: ["D2C"],
|
|
19
|
-
availability: ["Out of Stock"],
|
|
20
|
-
},
|
|
21
|
-
totalRecords: mockDataSource.appointments.length,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
var startingUseTableConfig = {
|
|
25
|
-
columns: mockColumns,
|
|
26
|
-
filters: {
|
|
27
|
-
order: "asc",
|
|
28
|
-
},
|
|
29
|
-
fetchUrl: "/table/data",
|
|
30
|
-
fetchOptions: {
|
|
31
|
-
method: "POST",
|
|
32
|
-
headers: {
|
|
33
|
-
"Content-Type": "application/json",
|
|
34
|
-
},
|
|
35
|
-
body: JSON.stringify({
|
|
36
|
-
filters: {
|
|
37
|
-
order: "asc",
|
|
38
|
-
search: "",
|
|
39
|
-
page: 1,
|
|
40
|
-
per_page: 10,
|
|
41
|
-
sort: null,
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
export var TableWithControlsStory = function () {
|
|
47
|
-
var _a = useTableWithControls(startingUseTableConfig), dataSource = _a.dataSource, columns = _a.columns, primaryTableRowData = _a.primaryTableRowData, secondaryTableRowData = _a.secondaryTableRowData, onChange = _a.onChange;
|
|
48
|
-
return (_jsx(TableWithControls, { onChange: onChange, tableControlsData: {
|
|
49
|
-
primaryTableRowData: primaryTableRowData,
|
|
50
|
-
secondaryTableRowData: secondaryTableRowData,
|
|
51
|
-
}, tableData: {
|
|
52
|
-
dataSource: dataSource,
|
|
53
|
-
columns: columns,
|
|
54
|
-
} }));
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
describe("<TableWithControls />", function () {
|
|
2
|
-
// TODO: update this test once we have a way to mock the ThemeProvider
|
|
3
|
-
// Error: ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`
|
|
4
|
-
it("should add 2 + 2", function () {
|
|
5
|
-
expect(2 + 2).toBe(4);
|
|
6
|
-
});
|
|
7
|
-
/*
|
|
8
|
-
it("should render successfully", () => {
|
|
9
|
-
const props = {
|
|
10
|
-
tableControlsData: {
|
|
11
|
-
primaryTableRowData: {
|
|
12
|
-
sortOptions: [
|
|
13
|
-
{ value: "2", label: "Status" },
|
|
14
|
-
{ value: "3", label: "Type Status" },
|
|
15
|
-
],
|
|
16
|
-
onPrimaryChange: () => {},
|
|
17
|
-
searchByPlaceholder: "Search by Address",
|
|
18
|
-
},
|
|
19
|
-
secondaryTableRowData: {
|
|
20
|
-
groups: {
|
|
21
|
-
orders: ["Cancelled", "Paused"],
|
|
22
|
-
warehouse: ["D2C"],
|
|
23
|
-
availability: ["Out of Stock"],
|
|
24
|
-
},
|
|
25
|
-
totalRecords: 0,
|
|
26
|
-
onGroupItemClick: () => {},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
tableData: {
|
|
30
|
-
dataSource: [],
|
|
31
|
-
columns: [],
|
|
32
|
-
},
|
|
33
|
-
onChange: () => {},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const { getByTestId } = customRender(<TableWithControls {...props} />);
|
|
37
|
-
const component = getByTestId("TableControls");
|
|
38
|
-
expect(component).toBeInTheDocument();
|
|
39
|
-
});*/
|
|
40
|
-
});
|
|
41
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type State = "success" | "warning" | "error" | "info" | "generic" | "hollow";
|
|
2
|
-
export interface BadgeProps {
|
|
3
|
-
label?: string;
|
|
4
|
-
isDisabled?: boolean;
|
|
5
|
-
state?: State;
|
|
6
|
-
hasClose?: boolean;
|
|
7
|
-
hasIcon?: boolean;
|
|
8
|
-
customIcon?: React.ReactNode | null;
|
|
9
|
-
size?: "small" | "normal" | "large";
|
|
10
|
-
backgroundColor?: string;
|
|
11
|
-
textColor?: string;
|
|
12
|
-
onClick?: () => void | null;
|
|
13
|
-
hasHover?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const Badge: ({ label, state, isDisabled, hasClose, onClick, size, hasIcon, customIcon, backgroundColor, textColor, hasHover, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default Badge;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as S from "./styles";
|
|
3
|
-
import { Typography } from "@gobolt/genesis/components";
|
|
4
|
-
import { useGenesis } from "@gobolt/genesis/providers";
|
|
5
|
-
import { getBadgeStateIcon } from "@gobolt/genesis/utils/icon-util";
|
|
6
|
-
import { HiOutlineX } from "react-icons/hi";
|
|
7
|
-
const isBadgeIconFilled = false;
|
|
8
|
-
const Badge = ({ label, state = "info", isDisabled, hasClose = false, onClick = () => { }, size = "normal", hasIcon = true, customIcon = null, backgroundColor = null, textColor = null, hasHover = false, ...rest }) => {
|
|
9
|
-
const { theme } = useGenesis();
|
|
10
|
-
const role = hasClose ? "button" : "badge";
|
|
11
|
-
if (!label) {
|
|
12
|
-
return (_jsx(S.Badge, { label: label, role: "badge", state: state, disabled: isDisabled, style: {
|
|
13
|
-
padding: "4px 4px",
|
|
14
|
-
}, "$hasHover": hasHover, ...rest, children: _jsx("div", { style: {
|
|
15
|
-
display: "flex",
|
|
16
|
-
justifyContent: "center",
|
|
17
|
-
alignItems: "center",
|
|
18
|
-
}, children: getBadgeStateIcon(state, backgroundColor || theme.colors.status[state].onsurface, isBadgeIconFilled, hasIcon, customIcon) }) }));
|
|
19
|
-
}
|
|
20
|
-
return (_jsxs(S.Badge, { label: label, role: role, onClick: onClick, state: state, disabled: isDisabled, style: { cursor: role === "button" ? "pointer" : "default" }, "$backgroundColor": backgroundColor, "$hasHover": hasHover, ...rest, children: [getBadgeStateIcon(state, isDisabled
|
|
21
|
-
? theme.colors.status.disabled.default
|
|
22
|
-
: textColor || theme.colors.status[state].onsurface, isBadgeIconFilled, hasIcon, customIcon), _jsx(Typography, { variant: size === "small" ? "label3" : "label2", color: isDisabled
|
|
23
|
-
? theme.colors.status.disabled.default
|
|
24
|
-
: textColor || theme.colors.status[state].onsurface,
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
isDisabled: isDisabled, children: label }), hasClose ? (_jsx(HiOutlineX, { color: theme.colors.status[state].onsurface })) : null] }));
|
|
27
|
-
};
|
|
28
|
-
export default Badge;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Badge";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type GenesisTheme } from "@gobolt/genesis/styles/theme/genesis-theme.types";
|
|
2
|
-
import { type State } from "./Badge";
|
|
3
|
-
export declare const getGenesisClass: (theme: GenesisTheme, state: State, label?: string, disabled?: boolean, $backgroundColor?: string, $hasHover?: boolean) => string;
|
|
4
|
-
export declare const Badge: any;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
2
|
-
const getBorderColor = (theme, state) => {
|
|
3
|
-
if (state === "hollow") {
|
|
4
|
-
return theme.colors.inputs.surface.border;
|
|
5
|
-
}
|
|
6
|
-
return theme.colors.status[state].surface;
|
|
7
|
-
};
|
|
8
|
-
export const getGenesisClass = (theme, state, label, disabled, $backgroundColor, $hasHover) => `
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-self: inherit;
|
|
11
|
-
gap: 4px;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
align-items: center;
|
|
14
|
-
position: relative;
|
|
15
|
-
padding-top: ${theme.components.badge["ver-padding"]}px;
|
|
16
|
-
padding-bottom: ${theme.components.badge["ver-padding"]}px;
|
|
17
|
-
padding-left: ${theme.components.badge["left-padding"]}px;
|
|
18
|
-
padding-right: ${theme.components.badge["right-padding"]}px;
|
|
19
|
-
border-radius: ${theme.components.badge.radius}px;
|
|
20
|
-
border: 1px solid ${getBorderColor(theme, state)};
|
|
21
|
-
background-color: ${$backgroundColor || theme.colors.status[state].surface};
|
|
22
|
-
|
|
23
|
-
&:not(:disabled):hover {
|
|
24
|
-
${$hasHover
|
|
25
|
-
? `background-color: ${theme.colors.status[state]["surface-hover"]};`
|
|
26
|
-
: ""}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
${disabled
|
|
30
|
-
? `
|
|
31
|
-
background-color: ${theme.colors.status.disabled.surface} !important;
|
|
32
|
-
border-color: ${theme.colors.status.disabled} !important;
|
|
33
|
-
border: none;
|
|
34
|
-
cursor: not-allowed;
|
|
35
|
-
|
|
36
|
-
&:hover {
|
|
37
|
-
cursor: not-allowed;
|
|
38
|
-
}
|
|
39
|
-
`
|
|
40
|
-
: ""}
|
|
41
|
-
`;
|
|
42
|
-
export const Badge = styled.div `
|
|
43
|
-
${({ theme, state, label, disabled, $backgroundColor, $hasHover, }) => {
|
|
44
|
-
return getGenesisClass(theme, state, label, disabled, $backgroundColor, $hasHover);
|
|
45
|
-
}}
|
|
46
|
-
`;
|