@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,106 +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 __read = (this && this.__read) || function (o, n) {
|
|
13
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
-
if (!m) return o;
|
|
15
|
-
var i = m.call(o), r, ar = [], e;
|
|
16
|
-
try {
|
|
17
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
-
}
|
|
19
|
-
catch (error) { e = { error: error }; }
|
|
20
|
-
finally {
|
|
21
|
-
try {
|
|
22
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
-
}
|
|
24
|
-
finally { if (e) throw e.error; }
|
|
25
|
-
}
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
-
import { useState } from "react";
|
|
30
|
-
import description from "./TableControlsDescription.md?raw";
|
|
31
|
-
import TableControls from "../TableControls";
|
|
32
|
-
import { mockDataSource } from "@/lib/components/Table//__mocks__/table-mocks";
|
|
33
|
-
var meta = {
|
|
34
|
-
component: TableControls,
|
|
35
|
-
title: "Components/Table/TableControls",
|
|
36
|
-
tags: ["autodocs"],
|
|
37
|
-
parameters: {
|
|
38
|
-
layout: "centered",
|
|
39
|
-
docs: {
|
|
40
|
-
description: {
|
|
41
|
-
component: description,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
export default meta;
|
|
47
|
-
export var TableControlsStory = {
|
|
48
|
-
parameters: {
|
|
49
|
-
msw: {
|
|
50
|
-
enabled: true,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
render: function () {
|
|
54
|
-
var _a = __read(useState({
|
|
55
|
-
orders: ["Cancelled", "Paused"],
|
|
56
|
-
warehouse: ["D2C"],
|
|
57
|
-
availability: ["Out of Stock"],
|
|
58
|
-
}), 2), groups = _a[0], setGroups = _a[1];
|
|
59
|
-
var _b = __read(useState({
|
|
60
|
-
sortOptions: [
|
|
61
|
-
{ value: "2", label: _jsx("span", { children: "Created Date" }) },
|
|
62
|
-
{ value: "3", label: _jsx("span", { children: "Order Status" }) },
|
|
63
|
-
],
|
|
64
|
-
selectedSortOption: "2",
|
|
65
|
-
searchByPlaceholder: "Search by Address",
|
|
66
|
-
searchField: "address",
|
|
67
|
-
isSortedAscending: true,
|
|
68
|
-
searchValue: "",
|
|
69
|
-
}), 2), primaryTableRowData = _b[0], setPrimaryTableRowData = _b[1];
|
|
70
|
-
var onGroupItemClick = function (title, item) {
|
|
71
|
-
var newGroups = __assign({}, groups);
|
|
72
|
-
newGroups[title] = newGroups[title].filter(function (group) { return group !== item; });
|
|
73
|
-
setGroups(newGroups);
|
|
74
|
-
};
|
|
75
|
-
var secondaryTableRowData = {
|
|
76
|
-
groups: groups,
|
|
77
|
-
totalRecords: mockDataSource.appointments.length,
|
|
78
|
-
};
|
|
79
|
-
var onChange = function (actionEvent) {
|
|
80
|
-
if (actionEvent.event === "groupItemClick") {
|
|
81
|
-
var _a = actionEvent.payload, title = _a.title, item = _a.item;
|
|
82
|
-
if (typeof title === "string" && typeof item === "string") {
|
|
83
|
-
onGroupItemClick(title, item);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (actionEvent.event === "orderClick") {
|
|
87
|
-
setPrimaryTableRowData(function (previous) { return (__assign(__assign({}, previous), { isSortedAscending: !previous.isSortedAscending })); });
|
|
88
|
-
}
|
|
89
|
-
if (actionEvent.event === "primarySortChange") {
|
|
90
|
-
var value_1 = actionEvent.payload.value;
|
|
91
|
-
if (typeof value_1 === "string") {
|
|
92
|
-
setPrimaryTableRowData(function (previous) { return (__assign(__assign({}, previous), { selectedSortOption: value_1 })); });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (actionEvent.event === "inputChange") {
|
|
96
|
-
var value_2 = actionEvent.payload.value;
|
|
97
|
-
if (typeof value_2 === "string") {
|
|
98
|
-
setPrimaryTableRowData(function (previous) { return (__assign(__assign({}, previous), { searchValue: value_2 })); });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var newSecondaryTableRowData = __assign(__assign({}, secondaryTableRowData), { totalRecords: mockDataSource.appointments.length, groups: groups });
|
|
103
|
-
// add your code here
|
|
104
|
-
return (_jsx(TableControls, { primaryTableRowData: primaryTableRowData, secondaryTableRowData: newSecondaryTableRowData, onChange: onChange }));
|
|
105
|
-
},
|
|
106
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { screen, fireEvent } from "@testing-library/react";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import CustomPagination, { PaginationStyle } from "../CustomPagination";
|
|
5
|
-
import { lightTheme } from "../../../../styles/theme";
|
|
6
|
-
import { customRender as render } from "../../../../test/setup";
|
|
7
|
-
var renderWithTheme = function (component) {
|
|
8
|
-
return render(_jsx(ThemeProvider, { theme: lightTheme, children: component }));
|
|
9
|
-
};
|
|
10
|
-
describe("CustomPagination", function () {
|
|
11
|
-
var mockOnChange = vi.fn();
|
|
12
|
-
beforeEach(function () {
|
|
13
|
-
mockOnChange.mockClear();
|
|
14
|
-
});
|
|
15
|
-
describe("Simple Pagination Style", function () {
|
|
16
|
-
it("renders first 5 pages when total pages > 5", function () {
|
|
17
|
-
renderWithTheme(_jsx(CustomPagination, { current: 1, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.SIMPLE }));
|
|
18
|
-
expect(screen.getByText("1")).toBeInTheDocument();
|
|
19
|
-
expect(screen.getByText("2")).toBeInTheDocument();
|
|
20
|
-
expect(screen.getByText("3")).toBeInTheDocument();
|
|
21
|
-
expect(screen.getByText("4")).toBeInTheDocument();
|
|
22
|
-
expect(screen.getByText("5")).toBeInTheDocument();
|
|
23
|
-
});
|
|
24
|
-
it("disables previous button on first page", function () {
|
|
25
|
-
renderWithTheme(_jsx(CustomPagination, { current: 1, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.SIMPLE }));
|
|
26
|
-
var previousButton = screen.getByLabelText("Previous Page");
|
|
27
|
-
expect(previousButton).toHaveAttribute("disabled");
|
|
28
|
-
});
|
|
29
|
-
it("calls onChange when clicking page number", function () {
|
|
30
|
-
renderWithTheme(_jsx(CustomPagination, { current: 1, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.SIMPLE }));
|
|
31
|
-
fireEvent.click(screen.getByText("3"));
|
|
32
|
-
expect(mockOnChange).toHaveBeenCalledWith(3, 10);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("Truncated Pagination Style", function () {
|
|
36
|
-
it("shows ellipsis and last page when total pages > 5", function () {
|
|
37
|
-
renderWithTheme(_jsx(CustomPagination, { current: 1, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.TRUNCATED }));
|
|
38
|
-
expect(screen.getByText("...")).toBeInTheDocument();
|
|
39
|
-
expect(screen.getByText("10")).toBeInTheDocument();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe("Centered Pagination Style", function () {
|
|
43
|
-
it("shows correct range of pages around current page", function () {
|
|
44
|
-
renderWithTheme(_jsx(CustomPagination, { current: 5, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.CENTERED }));
|
|
45
|
-
expect(screen.getByText("1")).toBeInTheDocument();
|
|
46
|
-
expect(screen.getByText("3")).toBeInTheDocument();
|
|
47
|
-
expect(screen.getByText("4")).toBeInTheDocument();
|
|
48
|
-
expect(screen.getByText("5")).toBeInTheDocument();
|
|
49
|
-
expect(screen.getByText("6")).toBeInTheDocument();
|
|
50
|
-
expect(screen.getByText("7")).toBeInTheDocument();
|
|
51
|
-
expect(screen.getByText("10")).toBeInTheDocument();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
describe("End Focused Pagination Style", function () {
|
|
55
|
-
it("shows first page, ellipsis and last 5 pages", function () {
|
|
56
|
-
renderWithTheme(_jsx(CustomPagination, { current: 8, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.END_FOCUSED }));
|
|
57
|
-
expect(screen.getByText("1")).toBeInTheDocument();
|
|
58
|
-
expect(screen.getByText("...")).toBeInTheDocument();
|
|
59
|
-
expect(screen.getByText("6")).toBeInTheDocument();
|
|
60
|
-
expect(screen.getByText("7")).toBeInTheDocument();
|
|
61
|
-
expect(screen.getByText("8")).toBeInTheDocument();
|
|
62
|
-
expect(screen.getByText("9")).toBeInTheDocument();
|
|
63
|
-
expect(screen.getByText("10")).toBeInTheDocument();
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
describe("Navigation buttons", function () {
|
|
67
|
-
it("enables both buttons when on middle page", function () {
|
|
68
|
-
renderWithTheme(_jsx(CustomPagination, { current: 5, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.SIMPLE }));
|
|
69
|
-
var previousButton = screen.getByLabelText("Previous Page");
|
|
70
|
-
var nextButton = screen.getByLabelText("Next Page");
|
|
71
|
-
expect(previousButton).not.toHaveAttribute("disabled");
|
|
72
|
-
expect(nextButton).not.toHaveAttribute("disabled");
|
|
73
|
-
});
|
|
74
|
-
it("calls onChange with correct page numbers when clicking navigation buttons", function () {
|
|
75
|
-
renderWithTheme(_jsx(CustomPagination, { current: 5, total: 100, pageSize: 10, onChange: mockOnChange, paginationStyle: PaginationStyle.SIMPLE }));
|
|
76
|
-
fireEvent.click(screen.getByLabelText("Previous Page"));
|
|
77
|
-
expect(mockOnChange).toHaveBeenCalledWith(4, 10);
|
|
78
|
-
fireEvent.click(screen.getByLabelText("Next Page"));
|
|
79
|
-
expect(mockOnChange).toHaveBeenCalledWith(6, 10);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,74 +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
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { customRender } from "../../../../test/setup";
|
|
14
|
-
import { useTheme } from "../../../../utils/styled";
|
|
15
|
-
import TableControls from "../";
|
|
16
|
-
// this tests proves that useTheme is working and that the ThemeProvider is included within the GenesisProvider!
|
|
17
|
-
var DebugTheme = function (_a) {
|
|
18
|
-
var children = _a.children;
|
|
19
|
-
var theme = useTheme();
|
|
20
|
-
var wideBreakpoint = theme.breakpoints.wide;
|
|
21
|
-
return (_jsx("div", { children: _jsxs("p", { children: ["wide ", wideBreakpoint] }) }));
|
|
22
|
-
};
|
|
23
|
-
describe("<TableControls />", function () {
|
|
24
|
-
var properties;
|
|
25
|
-
beforeEach(function () {
|
|
26
|
-
properties = {
|
|
27
|
-
onChange: vi.fn(),
|
|
28
|
-
primaryTableRowData: {
|
|
29
|
-
sortOptions: [
|
|
30
|
-
{ value: "1", label: "First Option" },
|
|
31
|
-
{ value: "2", label: "Second Option" },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
secondaryTableRowData: {
|
|
35
|
-
groups: { orders: ["Cancelled", "Paused"] },
|
|
36
|
-
totalRecords: 100,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
var renderComponent = function () { return customRender(_jsx(TableControls, __assign({}, properties))); };
|
|
41
|
-
var renderDebugTheme = function () { return customRender(_jsx(DebugTheme, {})); };
|
|
42
|
-
it("should render the debug theme component proving that the ThemeProvider is includes the GenesisProvider!", function () {
|
|
43
|
-
var getByText = renderDebugTheme().getByText;
|
|
44
|
-
expect(getByText("wide 1280")).toBeInTheDocument();
|
|
45
|
-
});
|
|
46
|
-
// TODO: add tests for the TableControls component
|
|
47
|
-
// once I learn why it's complaining about the useTheme hook!
|
|
48
|
-
/*
|
|
49
|
-
it("should render both primary and secondary controls when all props provided", () => {
|
|
50
|
-
const { debug } = customRender(<TableControls {...props} />);
|
|
51
|
-
debug();
|
|
52
|
-
const tableControls = screen.getByTestId("TableControls");
|
|
53
|
-
expect(tableControls).toBeInTheDocument();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
it("should call onPrimaryChange when sort option changes", () => {
|
|
58
|
-
renderComponent();
|
|
59
|
-
// Trigger sort change
|
|
60
|
-
props.primaryTableRowData.onPrimaryChange("2");
|
|
61
|
-
expect(props.primaryTableRowData.onPrimaryChange).toHaveBeenCalledWith("2");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("should not render secondary controls when secondaryTableRowData is null", () => {
|
|
65
|
-
props.secondaryTableRowData = null;
|
|
66
|
-
const { queryByText } = renderComponent();
|
|
67
|
-
expect(queryByText("100")).not.toBeInTheDocument();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("should display correct total records in secondary controls", () => {
|
|
71
|
-
const { getByText } = renderComponent();
|
|
72
|
-
expect(getByText("100")).toBeInTheDocument();
|
|
73
|
-
});*/
|
|
74
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./TableControls";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type GenesisTheme } from "@gobolt/genesis/styles/theme/genesis-theme.types";
|
|
2
|
-
interface StyledTableControlsProperties {
|
|
3
|
-
theme?: GenesisTheme;
|
|
4
|
-
type?: "primary" | "secondary";
|
|
5
|
-
state?: "active" | "disabled";
|
|
6
|
-
}
|
|
7
|
-
export declare const getGenesisClass: ({ colors, borderRadius, sizing }: {
|
|
8
|
-
colors: any;
|
|
9
|
-
borderRadius: any;
|
|
10
|
-
sizing: any;
|
|
11
|
-
}, type?: string, state?: string) => string;
|
|
12
|
-
export declare const StyledTableControls: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledTableControlsProperties>> & string;
|
|
13
|
-
export {};
|
|
@@ -1,16 +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 styled from "@gobolt/genesis/utils/styled";
|
|
6
|
-
export var getGenesisClass = function (_a, type, state) {
|
|
7
|
-
var colors = _a.colors, borderRadius = _a.borderRadius, sizing = _a.sizing;
|
|
8
|
-
if (type === void 0) { type = "primary"; }
|
|
9
|
-
if (state === void 0) { state = "active"; }
|
|
10
|
-
return "\n .class-name-here {\n } \n ";
|
|
11
|
-
};
|
|
12
|
-
export var StyledTableControls = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
13
|
-
var theme = _a.theme, type = _a.type, state = _a.state;
|
|
14
|
-
return getGenesisClass(theme, type, state);
|
|
15
|
-
});
|
|
16
|
-
var templateObject_1;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
-
if (!m) return o;
|
|
4
|
-
var i = m.call(o), r, ar = [], e;
|
|
5
|
-
try {
|
|
6
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
-
}
|
|
8
|
-
catch (error) { e = { error: error }; }
|
|
9
|
-
finally {
|
|
10
|
-
try {
|
|
11
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
-
}
|
|
13
|
-
finally { if (e) throw e.error; }
|
|
14
|
-
}
|
|
15
|
-
return ar;
|
|
16
|
-
};
|
|
17
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { useState } from "react";
|
|
19
|
-
import Table from "./Table";
|
|
20
|
-
import CustomPagination, { PaginationStyle, } from "./TableControls/CustomPagination";
|
|
21
|
-
var TablePagination = function (_a) {
|
|
22
|
-
var columns = _a.columns, dataSource = _a.dataSource, rowSelection = _a.rowSelection, onChange = _a.onChange, _b = _a.paginationStyle, paginationStyle = _b === void 0 ? PaginationStyle.SIMPLE : _b, _c = _a.pageSize, pageSize = _c === void 0 ? 10 : _c, isMainContentCell = _a.isMainContentCell;
|
|
23
|
-
var _d = __read(useState(1), 2), current = _d[0], setCurrent = _d[1];
|
|
24
|
-
var total = dataSource.length;
|
|
25
|
-
var paginatedData = dataSource.slice((current - 1) * pageSize, current * pageSize);
|
|
26
|
-
return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0px" }, children: [_jsx(Table, { columns: columns, dataSource: paginatedData, rowSelection: rowSelection, onChange: onChange, pagination: false, isMainContentCell: isMainContentCell }), _jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 16 }, children: _jsx(CustomPagination, { paginationStyle: paginationStyle, current: current, total: total, pageSize: pageSize, onChange: setCurrent }) })] }));
|
|
27
|
-
};
|
|
28
|
-
export default TablePagination;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from "react";
|
|
2
|
-
import { TYPE, TYPOGRAPHY_VARIANT, STATE } from "@gobolt/genesis/constants";
|
|
3
|
-
type HeadingLevel = 1 | 2 | 3 | 4 | 5;
|
|
4
|
-
export interface TypographyProps {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
variant?: keyof typeof TYPOGRAPHY_VARIANT;
|
|
7
|
-
themeType?: keyof typeof TYPE;
|
|
8
|
-
state?: keyof typeof STATE;
|
|
9
|
-
color?: string;
|
|
10
|
-
level?: HeadingLevel;
|
|
11
|
-
isText?: boolean;
|
|
12
|
-
isFullWidth?: boolean;
|
|
13
|
-
style?: CSSProperties;
|
|
14
|
-
isDisabled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const Typography: ({ children, themeType, variant, state, color, isText, isFullWidth, style, isDisabled, ...rest }: TypographyProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default Typography;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as S from "./styles";
|
|
3
|
-
import { useGenesis } from "@gobolt/genesis/providers";
|
|
4
|
-
import { TYPE, TYPOGRAPHY_VARIANT, STATE, } from "@gobolt/genesis/constants";
|
|
5
|
-
const Typography = ({ children, themeType = TYPE.secondary, variant = TYPOGRAPHY_VARIANT.body1, state = STATE.active, color, isText = false, isFullWidth, style, isDisabled, ...rest }) => {
|
|
6
|
-
const { breakpoint } = useGenesis();
|
|
7
|
-
if (variant.startsWith("display") || variant.startsWith("heading")) {
|
|
8
|
-
const level = variant.split("heading")[1] || variant.split("display")[1];
|
|
9
|
-
return (_jsx(S.Headline, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, level: Number.parseInt(level), "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
|
|
10
|
-
}
|
|
11
|
-
if (isText) {
|
|
12
|
-
return (_jsx(S.Text, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
|
|
13
|
-
}
|
|
14
|
-
return (_jsx(S.Paragraph, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
|
|
15
|
-
};
|
|
16
|
-
export default Typography;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Typography";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import styled from "@gobolt/genesis/utils/styled";
|
|
2
|
-
import { Typography as AntTypography } from "antd";
|
|
3
|
-
const getVariant = (typography, variant, breakpoint) => {
|
|
4
|
-
return `
|
|
5
|
-
font-size: ${typography[breakpoint][variant].fontSize}px !important;
|
|
6
|
-
line-height: ${typography[breakpoint][variant].lineHeight};
|
|
7
|
-
letter-spacing: ${typography[breakpoint][variant].letterSpacing}px;
|
|
8
|
-
font-weight: ${typography[breakpoint][variant].fontWeight};
|
|
9
|
-
`;
|
|
10
|
-
};
|
|
11
|
-
const getColor = (color, colors, $themeType) => {
|
|
12
|
-
if (color) {
|
|
13
|
-
return color;
|
|
14
|
-
}
|
|
15
|
-
return colors[$themeType].active.color;
|
|
16
|
-
};
|
|
17
|
-
const getFontFamily = (variant) => {
|
|
18
|
-
return `
|
|
19
|
-
${variant.includes("digits")
|
|
20
|
-
? "'Roboto Mono', sans-serif"
|
|
21
|
-
: "'Inter', sans-serif"} !important;
|
|
22
|
-
`;
|
|
23
|
-
};
|
|
24
|
-
const getGenesisTypographyClass = ({ colors, typography }, $themeType, variant, state, breakpoint, color, $isFullWidth) => `
|
|
25
|
-
&.ant-typography {
|
|
26
|
-
font-family: ${getFontFamily(variant)};
|
|
27
|
-
color: ${getColor(color, colors, $themeType)} !important;
|
|
28
|
-
${getVariant(typography, variant, breakpoint)}
|
|
29
|
-
margin-bottom: 0 !important;
|
|
30
|
-
width: ${$isFullWidth ? "100%" : "auto"};
|
|
31
|
-
line-height: 1;
|
|
32
|
-
|
|
33
|
-
&:disabled {
|
|
34
|
-
color: ${colors.status.disabled.default} !important;
|
|
35
|
-
userSelect: none;
|
|
36
|
-
cursor: not-allowed;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
export const Headline = styled(AntTypography.Title) `
|
|
41
|
-
${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
|
|
42
|
-
return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
|
|
43
|
-
}}
|
|
44
|
-
`;
|
|
45
|
-
export const Paragraph = styled(AntTypography.Paragraph) `
|
|
46
|
-
${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
|
|
47
|
-
return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
|
|
48
|
-
}}
|
|
49
|
-
`;
|
|
50
|
-
export const Text = styled(AntTypography.Text) `
|
|
51
|
-
${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
|
|
52
|
-
return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
|
|
53
|
-
}}
|
|
54
|
-
`;
|