@spaced-out/ui-design-system 0.4.13-beta.0 → 0.4.13-beta.1
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/.cspell/custom-words.txt +2 -0
- package/CHANGELOG.md +7 -0
- package/cspell.json +3 -1
- package/gulpfile.js +2 -1
- package/lib/styles/index.js +535 -275
- package/package.json +2 -2
- package/lib/components/AIPromptFlow/AIPromptFlow.stories.tsx +0 -465
- package/lib/components/Accordion/Accordion.stories.tsx +0 -165
- package/lib/components/Accordion/Accordion.tsx +0 -112
- package/lib/components/Accordion/AccordionGroup.stories.tsx +0 -215
- package/lib/components/Accordion/AccordionGroup.tsx +0 -77
- package/lib/components/Accordion/index.ts +0 -2
- package/lib/components/Avatar/Avatar.stories.tsx +0 -152
- package/lib/components/Avatar/Avatar.tsx +0 -272
- package/lib/components/Avatar/index.ts +0 -1
- package/lib/components/AvatarGroup/AvatarGroup.stories.tsx +0 -138
- package/lib/components/AvatarGroup/AvatarGroup.tsx +0 -164
- package/lib/components/AvatarGroup/index.ts +0 -1
- package/lib/components/Badge/Badge.stories.tsx +0 -131
- package/lib/components/Badge/Badge.tsx +0 -149
- package/lib/components/Badge/index.ts +0 -1
- package/lib/components/BadgedIcon/BadgedIcon.stories.tsx +0 -80
- package/lib/components/BadgedIcon/BadgedIcon.tsx +0 -76
- package/lib/components/BadgedIcon/index.ts +0 -1
- package/lib/components/Banner/Banner.stories.tsx +0 -187
- package/lib/components/Banner/Banner.tsx +0 -55
- package/lib/components/Banner/index.ts +0 -1
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.stories.tsx +0 -114
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.tsx +0 -52
- package/lib/components/Breadcrumbs/BreadcrumbLink/index.ts +0 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -189
- package/lib/components/Breadcrumbs/Breadcrumbs.tsx +0 -59
- package/lib/components/Breadcrumbs/index.ts +0 -2
- package/lib/components/Button/Button.stories.tsx +0 -220
- package/lib/components/Button/Button.tsx +0 -285
- package/lib/components/Button/index.ts +0 -8
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.tsx +0 -677
- package/lib/components/ButtonDropdown/ButtonDropdown.tsx +0 -221
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.stories.tsx +0 -624
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.tsx +0 -167
- package/lib/components/ButtonDropdown/index.ts +0 -2
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.stories.tsx +0 -125
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.tsx +0 -76
- package/lib/components/ButtonTabs/ButtonTab/index.ts +0 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.tsx +0 -147
- package/lib/components/ButtonTabs/ButtonTabs.stories.tsx +0 -393
- package/lib/components/ButtonTabs/ButtonTabs.tsx +0 -119
- package/lib/components/ButtonTabs/index.ts +0 -2
- package/lib/components/Card/Card.stories.tsx +0 -245
- package/lib/components/Card/Card.tsx +0 -172
- package/lib/components/Card/index.ts +0 -1
- package/lib/components/Charts/ChartTooltip/index.ts +0 -13
- package/lib/components/Charts/ChartWrapper/ChartWrapper.tsx +0 -179
- package/lib/components/Charts/ChartWrapper/index.ts +0 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.stories.tsx +0 -574
- package/lib/components/Charts/ColumnChart/ColumnChart.tsx +0 -125
- package/lib/components/Charts/ColumnChart/index.ts +0 -1
- package/lib/components/Charts/DonutChart/DonutChart.stories.tsx +0 -415
- package/lib/components/Charts/DonutChart/DonutChart.tsx +0 -155
- package/lib/components/Charts/DonutChart/index.ts +0 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.stories.tsx +0 -510
- package/lib/components/Charts/FunnelChart/FunnelChart.tsx +0 -110
- package/lib/components/Charts/FunnelChart/index.ts +0 -1
- package/lib/components/Charts/LineChart/LineChart.stories.tsx +0 -590
- package/lib/components/Charts/LineChart/LineChart.tsx +0 -109
- package/lib/components/Charts/LineChart/index.ts +0 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.stories.tsx +0 -467
- package/lib/components/Charts/SpiderChart/SpiderChart.tsx +0 -104
- package/lib/components/Charts/SpiderChart/index.ts +0 -1
- package/lib/components/Charts/index.ts +0 -11
- package/lib/components/ChatBubble/ChatAnchor.stories.tsx +0 -95
- package/lib/components/ChatBubble/ChatBubble.stories.tsx +0 -277
- package/lib/components/ChatBubble/ChatBubble.tsx +0 -232
- package/lib/components/ChatBubble/index.ts +0 -1
- package/lib/components/Checkbox/Checkbox.stories.tsx +0 -180
- package/lib/components/Checkbox/Checkbox.tsx +0 -168
- package/lib/components/Checkbox/CheckboxGroup.stories.tsx +0 -381
- package/lib/components/Checkbox/CheckboxGroup.tsx +0 -119
- package/lib/components/Checkbox/index.ts +0 -2
- package/lib/components/Chip/Chip.stories.tsx +0 -335
- package/lib/components/Chip/Chip.tsx +0 -204
- package/lib/components/Chip/index.ts +0 -2
- package/lib/components/CircularLoader/CircularLoader.stories.tsx +0 -75
- package/lib/components/CircularLoader/CircularLoader.tsx +0 -51
- package/lib/components/CircularLoader/index.ts +0 -1
- package/lib/components/CollapsibleCard/CollapsibleCard.stories.tsx +0 -311
- package/lib/components/CollapsibleCard/CollapsibleCard.tsx +0 -135
- package/lib/components/CollapsibleCard/index.ts +0 -1
- package/lib/components/Combobox/Combobox.stories.tsx +0 -306
- package/lib/components/Combobox/Combobox.tsx +0 -297
- package/lib/components/Combobox/helper.ts +0 -201
- package/lib/components/Combobox/index.ts +0 -1
- package/lib/components/ConditionalWrapper/ConditionalWrapper.stories.tsx +0 -51
- package/lib/components/ConditionalWrapper/ConditionalWrapper.ts +0 -16
- package/lib/components/ConditionalWrapper/index.ts +0 -1
- package/lib/components/DateRangePicker/Calendar.tsx +0 -110
- package/lib/components/DateRangePicker/DateRangePicker.stories.tsx +0 -397
- package/lib/components/DateRangePicker/DateRangePicker.tsx +0 -210
- package/lib/components/DateRangePicker/DateRangeWrapper.tsx +0 -386
- package/lib/components/DateRangePicker/Day.tsx +0 -74
- package/lib/components/DateRangePicker/index.ts +0 -1
- package/lib/components/Dialog/Dialog.stories.tsx +0 -254
- package/lib/components/Dialog/Dialog.tsx +0 -222
- package/lib/components/Dialog/index.ts +0 -1
- package/lib/components/Disclaimer/Disclaimer.stories.tsx +0 -148
- package/lib/components/Disclaimer/Disclaimer.tsx +0 -35
- package/lib/components/Disclaimer/index.ts +0 -1
- package/lib/components/Dropdown/Dropdown.stories.tsx +0 -785
- package/lib/components/Dropdown/Dropdown.tsx +0 -174
- package/lib/components/Dropdown/SimpleDropdown.stories.tsx +0 -534
- package/lib/components/Dropdown/SimpleDropdown.tsx +0 -167
- package/lib/components/Dropdown/index.ts +0 -2
- package/lib/components/EmptyState/EmptyImages/CalendarEmptyImage.tsx +0 -108
- package/lib/components/EmptyState/EmptyImages/ChartEmptyImage.tsx +0 -194
- package/lib/components/EmptyState/EmptyImages/DataEmptyImage.tsx +0 -116
- package/lib/components/EmptyState/EmptyImages/FileEmptyImage.tsx +0 -133
- package/lib/components/EmptyState/EmptyImages/MessageEmptyImage.tsx +0 -64
- package/lib/components/EmptyState/EmptyImages/UploadEmptyImage.tsx +0 -67
- package/lib/components/EmptyState/EmptyImages/index.ts +0 -6
- package/lib/components/EmptyState/EmptyState.stories.tsx +0 -104
- package/lib/components/EmptyState/EmptyState.tsx +0 -83
- package/lib/components/EmptyState/index.ts +0 -1
- package/lib/components/ErrorMessage/ErrorImages/ForbiddenImage.tsx +0 -85
- package/lib/components/ErrorMessage/ErrorImages/NotFoundImage.tsx +0 -117
- package/lib/components/ErrorMessage/ErrorImages/ServerErrorImage.tsx +0 -237
- package/lib/components/ErrorMessage/ErrorImages/UnauthorizedImage.tsx +0 -73
- package/lib/components/ErrorMessage/ErrorImages/index.ts +0 -4
- package/lib/components/ErrorMessage/ErrorMessage.stories.tsx +0 -112
- package/lib/components/ErrorMessage/ErrorMessage.tsx +0 -87
- package/lib/components/ErrorMessage/index.ts +0 -1
- package/lib/components/FileUpload/FileBlock/FileBlock.stories.tsx +0 -85
- package/lib/components/FileUpload/FileBlock/FileBlock.tsx +0 -136
- package/lib/components/FileUpload/FileBlock/index.ts +0 -1
- package/lib/components/FileUpload/FileUpload.stories.tsx +0 -958
- package/lib/components/FileUpload/FileUpload.tsx +0 -206
- package/lib/components/FileUpload/index.ts +0 -2
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.stories.tsx +0 -345
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.tsx +0 -163
- package/lib/components/FilterButtonOverlay/index.ts +0 -1
- package/lib/components/FocusManager/FocusManager.stories.tsx +0 -117
- package/lib/components/FocusManager/FocusManager.tsx +0 -59
- package/lib/components/FocusManager/index.ts +0 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.stories.tsx +0 -557
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.tsx +0 -156
- package/lib/components/FocusManagerWithArrowKeyNavigation/index.ts +0 -1
- package/lib/components/FormTitleWrapper/FormTitleWrapper.stories.tsx +0 -173
- package/lib/components/FormTitleWrapper/FormTitleWrapper.tsx +0 -63
- package/lib/components/FormTitleWrapper/index.ts +0 -1
- package/lib/components/Grid/Col.stories.tsx +0 -114
- package/lib/components/Grid/Grid.tsx +0 -119
- package/lib/components/Grid/GridPatterns.stories.tsx +0 -420
- package/lib/components/Grid/Row.stories.tsx +0 -135
- package/lib/components/Grid/Tablist.layout.stories.tsx +0 -281
- package/lib/components/Grid/index.ts +0 -1
- package/lib/components/Icon/ClickableIcon.tsx +0 -104
- package/lib/components/Icon/Icon.docs.ts +0 -118
- package/lib/components/Icon/Icon.stories.tsx +0 -79
- package/lib/components/Icon/Icon.tsx +0 -78
- package/lib/components/Icon/SemanticIcon.stories.tsx +0 -74
- package/lib/components/Icon/SemanticIcon.tsx +0 -49
- package/lib/components/Icon/index.ts +0 -3
- package/lib/components/InContextAlert/InContextAlert.stories.tsx +0 -164
- package/lib/components/InContextAlert/InContextAlert.tsx +0 -204
- package/lib/components/InContextAlert/index.ts +0 -1
- package/lib/components/InfinitePagination/InfinitePagination.stories.tsx +0 -323
- package/lib/components/InfinitePagination/InfinitePagination.tsx +0 -121
- package/lib/components/InfinitePagination/index.ts +0 -1
- package/lib/components/InlineDropdown/InlineDropdown.stories.tsx +0 -415
- package/lib/components/InlineDropdown/InlineDropdown.tsx +0 -175
- package/lib/components/InlineDropdown/SimpleInlineDropdown.stories.tsx +0 -513
- package/lib/components/InlineDropdown/SimpleInlineDropdown.tsx +0 -165
- package/lib/components/InlineDropdown/index.ts +0 -2
- package/lib/components/Input/Input.stories.tsx +0 -590
- package/lib/components/Input/Input.tsx +0 -336
- package/lib/components/Input/NativeColorpicker.stories.tsx +0 -337
- package/lib/components/Input/NativeDatepicker.stories.tsx +0 -424
- package/lib/components/Input/index.ts +0 -1
- package/lib/components/KPIBox/KPIBox.stories.tsx +0 -321
- package/lib/components/KPIBox/KPIBox.tsx +0 -94
- package/lib/components/KPIBox/index.ts +0 -1
- package/lib/components/LinearLoader/LinearLoader.stories.tsx +0 -132
- package/lib/components/LinearLoader/LinearLoader.tsx +0 -48
- package/lib/components/LinearLoader/index.ts +0 -1
- package/lib/components/Link/Link.stories.tsx +0 -302
- package/lib/components/Link/Link.tsx +0 -231
- package/lib/components/Link/index.ts +0 -1
- package/lib/components/Menu/Menu.stories.tsx +0 -1046
- package/lib/components/Menu/Menu.tsx +0 -391
- package/lib/components/Menu/MenuOptionButton.tsx +0 -206
- package/lib/components/Menu/index.ts +0 -2
- package/lib/components/Modal/Modal.stories.tsx +0 -430
- package/lib/components/Modal/Modal.tsx +0 -379
- package/lib/components/Modal/index.ts +0 -8
- package/lib/components/Notification/Notification.stories.tsx +0 -132
- package/lib/components/Notification/Notification.tsx +0 -140
- package/lib/components/Notification/index.ts +0 -1
- package/lib/components/OptionButton/OptionButton.stories.tsx +0 -397
- package/lib/components/OptionButton/OptionButton.tsx +0 -149
- package/lib/components/OptionButton/SimpleOptionButton.stories.tsx +0 -525
- package/lib/components/OptionButton/SimpleOptionButton.tsx +0 -160
- package/lib/components/OptionButton/index.ts +0 -2
- package/lib/components/PageTitle/PageTitle.stories.tsx +0 -257
- package/lib/components/PageTitle/PageTitle.tsx +0 -276
- package/lib/components/PageTitle/index.ts +0 -1
- package/lib/components/Pagination/Pagination.stories.tsx +0 -259
- package/lib/components/Pagination/Pagination.tsx +0 -147
- package/lib/components/Pagination/PaginationItem.tsx +0 -118
- package/lib/components/Pagination/index.ts +0 -1
- package/lib/components/Panel/Panel.stories.tsx +0 -452
- package/lib/components/Panel/Panel.tsx +0 -181
- package/lib/components/Panel/index.ts +0 -2
- package/lib/components/ProgressDonut/ProgressDonut.stories.tsx +0 -97
- package/lib/components/ProgressDonut/ProgressDonut.tsx +0 -111
- package/lib/components/ProgressDonut/index.ts +0 -1
- package/lib/components/PromptChip/PromptChip.stories.tsx +0 -202
- package/lib/components/PromptChip/PromptChip.tsx +0 -166
- package/lib/components/PromptChip/index.ts +0 -1
- package/lib/components/PromptInput/PromptInput.stories.tsx +0 -349
- package/lib/components/PromptInput/PromptInput.tsx +0 -190
- package/lib/components/PromptInput/index.ts +0 -1
- package/lib/components/RadioButton/RadioButton.stories.tsx +0 -157
- package/lib/components/RadioButton/RadioButton.tsx +0 -135
- package/lib/components/RadioButton/RadioGroup.stories.tsx +0 -283
- package/lib/components/RadioButton/RadioGroup.tsx +0 -90
- package/lib/components/RadioButton/index.ts +0 -2
- package/lib/components/RadioTile/RadioTile.stories.tsx +0 -276
- package/lib/components/RadioTile/RadioTile.tsx +0 -107
- package/lib/components/RadioTile/index.ts +0 -1
- package/lib/components/RangeSlider/RangeSlider.stories.tsx +0 -342
- package/lib/components/RangeSlider/RangeSlider.tsx +0 -201
- package/lib/components/RangeSlider/index.ts +0 -1
- package/lib/components/Rating/Rating.stories.tsx +0 -257
- package/lib/components/Rating/Rating.tsx +0 -141
- package/lib/components/Rating/index.ts +0 -1
- package/lib/components/ScoreBar/ScoreBar.stories.tsx +0 -182
- package/lib/components/ScoreBar/ScoreBar.tsx +0 -133
- package/lib/components/ScoreBar/index.ts +0 -1
- package/lib/components/SearchInput/SearchInput.stories.tsx +0 -260
- package/lib/components/SearchInput/SearchInput.tsx +0 -81
- package/lib/components/SearchInput/index.ts +0 -2
- package/lib/components/Separator/Separator.stories.tsx +0 -95
- package/lib/components/Separator/Separator.tsx +0 -57
- package/lib/components/Separator/index.ts +0 -1
- package/lib/components/Shimmer/Shimmer.stories.tsx +0 -317
- package/lib/components/Shimmer/Shimmer.tsx +0 -143
- package/lib/components/Shimmer/index.ts +0 -1
- package/lib/components/SideMenuLink/SideMenuLink.stories.tsx +0 -153
- package/lib/components/SideMenuLink/SideMenuLink.tsx +0 -344
- package/lib/components/SideMenuLink/index.ts +0 -1
- package/lib/components/StatusIndicator/StatusIndicator.stories.tsx +0 -130
- package/lib/components/StatusIndicator/StatusIndicator.tsx +0 -62
- package/lib/components/StatusIndicator/index.ts +0 -1
- package/lib/components/Stepper/Step/Step.stories.tsx +0 -117
- package/lib/components/Stepper/Step/Step.tsx +0 -125
- package/lib/components/Stepper/Step/StepContent.tsx +0 -40
- package/lib/components/Stepper/Step/StepLabel.tsx +0 -40
- package/lib/components/Stepper/Step/index.ts +0 -3
- package/lib/components/Stepper/Stepper.stories.tsx +0 -422
- package/lib/components/Stepper/Stepper.tsx +0 -68
- package/lib/components/Stepper/index.ts +0 -2
- package/lib/components/StickyBar/StickyBar.stories.tsx +0 -152
- package/lib/components/StickyBar/StickyBar.tsx +0 -65
- package/lib/components/StickyBar/index.ts +0 -1
- package/lib/components/SubMenu/SubMenu.stories.tsx +0 -413
- package/lib/components/SubMenu/SubMenu.tsx +0 -96
- package/lib/components/SubMenu/SubMenuGroup.tsx +0 -161
- package/lib/components/SubMenu/SubMenuItem.tsx +0 -170
- package/lib/components/SubMenu/SubMenuLink.tsx +0 -87
- package/lib/components/SubMenu/index.ts +0 -4
- package/lib/components/Table/BasicTable.stories.tsx +0 -647
- package/lib/components/Table/BulkActions.stories.tsx +0 -267
- package/lib/components/Table/Cell.tsx +0 -125
- package/lib/components/Table/DefaultRow.tsx +0 -159
- package/lib/components/Table/DefaultTableHeader.tsx +0 -244
- package/lib/components/Table/InlineEdit.stories.tsx +0 -390
- package/lib/components/Table/StaticTable.tsx +0 -230
- package/lib/components/Table/Table.docs.ts +0 -495
- package/lib/components/Table/Table.tsx +0 -135
- package/lib/components/Table/TableActionBar.tsx +0 -55
- package/lib/components/Table/TableBottomBar.tsx +0 -25
- package/lib/components/Table/TableTopBar.tsx +0 -25
- package/lib/components/Table/dummyTableData.ts +0 -2189
- package/lib/components/Table/hooks.ts +0 -102
- package/lib/components/Table/index.ts +0 -8
- package/lib/components/Tabs/Tab/Tab.stories.tsx +0 -151
- package/lib/components/Tabs/Tab/Tab.tsx +0 -152
- package/lib/components/Tabs/Tab/index.ts +0 -1
- package/lib/components/Tabs/TabList/TabDropdown.tsx +0 -125
- package/lib/components/Tabs/TabList/TabList.stories.tsx +0 -172
- package/lib/components/Tabs/TabList/TabList.tsx +0 -178
- package/lib/components/Tabs/TabList/index.ts +0 -1
- package/lib/components/Tabs/index.ts +0 -2
- package/lib/components/Text/HighlightedText.stories.tsx +0 -122
- package/lib/components/Text/Text.stories.tsx +0 -302
- package/lib/components/Text/Text.tsx +0 -882
- package/lib/components/Text/index.ts +0 -30
- package/lib/components/TextTile/TextTile.stories.tsx +0 -89
- package/lib/components/TextTile/TextTile.tsx +0 -51
- package/lib/components/TextTile/index.ts +0 -1
- package/lib/components/Textarea/Textarea.stories.tsx +0 -324
- package/lib/components/Textarea/Textarea.tsx +0 -148
- package/lib/components/Textarea/index.ts +0 -2
- package/lib/components/Timeline/Timeline.stories.tsx +0 -272
- package/lib/components/Timeline/Timeline.tsx +0 -57
- package/lib/components/Timeline/TimelineItem/TimelineItem.stories.tsx +0 -216
- package/lib/components/Timeline/TimelineItem/TimelineItem.tsx +0 -128
- package/lib/components/Timeline/TimelineItem/index.ts +0 -1
- package/lib/components/Timeline/index.ts +0 -2
- package/lib/components/Toast/Toast.stories.tsx +0 -274
- package/lib/components/Toast/Toast.tsx +0 -264
- package/lib/components/Toast/ToastContainer.tsx +0 -123
- package/lib/components/Toast/ToastManager.ts +0 -60
- package/lib/components/Toast/index.ts +0 -10
- package/lib/components/Toggle/Toggle.stories.tsx +0 -175
- package/lib/components/Toggle/Toggle.tsx +0 -121
- package/lib/components/Toggle/index.ts +0 -1
- package/lib/components/TokenListInput/TokenListInput.stories.tsx +0 -678
- package/lib/components/TokenListInput/TokenListInput.tsx +0 -393
- package/lib/components/TokenListInput/TokenValueChips.tsx +0 -69
- package/lib/components/TokenListInput/index.ts +0 -1
- package/lib/components/Tooltip/Tooltip.stories.tsx +0 -316
- package/lib/components/Tooltip/Tooltip.tsx +0 -188
- package/lib/components/Tooltip/index.ts +0 -1
- package/lib/components/Truncate/Truncate.stories.tsx +0 -106
- package/lib/components/Truncate/Truncate.tsx +0 -80
- package/lib/components/Truncate/index.ts +0 -2
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.stories.tsx +0 -147
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.tsx +0 -109
- package/lib/components/TruncatedTextWithTooltip/index.ts +0 -1
- package/lib/components/Typeahead/SimpleTypeahead.stories.tsx +0 -567
- package/lib/components/Typeahead/SimpleTypeahead.tsx +0 -159
- package/lib/components/Typeahead/Typeahead.stories.tsx +0 -552
- package/lib/components/Typeahead/Typeahead.tsx +0 -243
- package/lib/components/Typeahead/index.ts +0 -2
- package/lib/components/WeekdayPicker/WeekdayPicker.stories.tsx +0 -263
- package/lib/components/WeekdayPicker/WeekdayPicker.tsx +0 -224
- package/lib/components/WeekdayPicker/index.ts +0 -1
- package/lib/components/index.ts +0 -77
- package/lib/hooks/index.ts +0 -16
- package/lib/hooks/useArbitraryOptionAddition/index.ts +0 -1
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.stories.tsx +0 -158
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.ts +0 -127
- package/lib/hooks/useCopyToClipboard/index.ts +0 -1
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.stories.tsx +0 -112
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.ts +0 -29
- package/lib/hooks/useDebounce/index.ts +0 -1
- package/lib/hooks/useDebounce/useDebounce.stories.tsx +0 -82
- package/lib/hooks/useDebounce/useDebounce.ts +0 -15
- package/lib/hooks/useFileUpload/index.ts +0 -1
- package/lib/hooks/useFileUpload/useFileUpload.stories.tsx +0 -468
- package/lib/hooks/useFileUpload/useFileUpload.ts +0 -326
- package/lib/hooks/useFilteredOptions/index.ts +0 -1
- package/lib/hooks/useFilteredOptions/useFilteredOptions.stories.tsx +0 -142
- package/lib/hooks/useFilteredOptions/useFilteredOptions.ts +0 -92
- package/lib/hooks/useInfiniteScroll/index.ts +0 -1
- package/lib/hooks/useInfiniteScroll/useInfiniteScroll.ts +0 -85
- package/lib/hooks/useInputState/index.ts +0 -1
- package/lib/hooks/useInputState/useInputState.stories.tsx +0 -62
- package/lib/hooks/useInputState/useInputState.ts +0 -24
- package/lib/hooks/useLockedBody/index.ts +0 -1
- package/lib/hooks/useLockedBody/useLockedBody.stories.tsx +0 -71
- package/lib/hooks/useLockedBody/useLockedBody.ts +0 -53
- package/lib/hooks/useModal/index.ts +0 -1
- package/lib/hooks/useModal/useModal.stories.tsx +0 -134
- package/lib/hooks/useModal/useModal.ts +0 -36
- package/lib/hooks/useMountTransition/index.ts +0 -25
- package/lib/hooks/useMountTransition/useMountTransition.stories.tsx +0 -64
- package/lib/hooks/usePagination/index.ts +0 -1
- package/lib/hooks/usePagination/usePagination.stories.tsx +0 -72
- package/lib/hooks/usePagination/usePagination.ts +0 -151
- package/lib/hooks/useReferenceElementWidth/index.ts +0 -1
- package/lib/hooks/useReferenceElementWidth/useReferenceElementWidth.ts +0 -19
- package/lib/hooks/useResizeObserver/index.ts +0 -1
- package/lib/hooks/useResizeObserver/useResizeObserver.ts +0 -29
- package/lib/hooks/useToastPortal/index.ts +0 -1
- package/lib/hooks/useToastPortal/useToastPortal.ts +0 -34
- package/lib/hooks/useToggle/index.ts +0 -1
- package/lib/hooks/useToggle/useToggle.stories.tsx +0 -70
- package/lib/hooks/useToggle/useToggle.ts +0 -13
- package/lib/hooks/useWindowSize/index.ts +0 -1
- package/lib/hooks/useWindowSize/useWindowSize.stories.tsx +0 -62
- package/lib/hooks/useWindowSize/useWindowSize.ts +0 -39
- package/lib/index.ts +0 -6
- package/lib/styles/index.ts +0 -533
- package/lib/styles/variables/_border.ts +0 -23
- package/lib/styles/variables/_color.ts +0 -207
- package/lib/styles/variables/_elevation.ts +0 -13
- package/lib/styles/variables/_font.ts +0 -59
- package/lib/styles/variables/_motion.ts +0 -11
- package/lib/styles/variables/_opacity.ts +0 -29
- package/lib/styles/variables/_shadow.ts +0 -47
- package/lib/styles/variables/_size.ts +0 -113
- package/lib/styles/variables/_space.ts +0 -23
- package/lib/types/charts.ts +0 -247
- package/lib/types/common.ts +0 -11
- package/lib/types/cssvariables.d.ts +0 -8
- package/lib/types/date-range-picker.ts +0 -20
- package/lib/types/flow-to-typescript-codemod.d.ts +0 -48
- package/lib/types/global.d.ts +0 -84
- package/lib/types/index.ts +0 -6
- package/lib/types/menu.ts +0 -13
- package/lib/types/toast.ts +0 -34
- package/lib/types/typography.ts +0 -17
- package/lib/utils/array/are-arrays-equal.ts +0 -12
- package/lib/utils/array/index.ts +0 -1
- package/lib/utils/charts/charts.ts +0 -110
- package/lib/utils/charts/columnChart.ts +0 -62
- package/lib/utils/charts/donutChart.ts +0 -123
- package/lib/utils/charts/funnelChart.ts +0 -97
- package/lib/utils/charts/helpers.ts +0 -65
- package/lib/utils/charts/index.ts +0 -7
- package/lib/utils/charts/lineChart.ts +0 -51
- package/lib/utils/charts/spiderChart.ts +0 -57
- package/lib/utils/charts/typography.ts +0 -52
- package/lib/utils/classify/classify.stories.tsx +0 -65
- package/lib/utils/classify/index.ts +0 -27
- package/lib/utils/click-away/ClickAway.stories.tsx +0 -248
- package/lib/utils/click-away/click-away.ts +0 -230
- package/lib/utils/click-away/index.ts +0 -1
- package/lib/utils/date-range-picker/date-range-picker.ts +0 -430
- package/lib/utils/date-range-picker/index.ts +0 -2
- package/lib/utils/date-range-picker/timezones.ts +0 -263
- package/lib/utils/dom/dom.stories.tsx +0 -59
- package/lib/utils/dom/dom.ts +0 -247
- package/lib/utils/dom/index.ts +0 -1
- package/lib/utils/helpers/helpers.stories.tsx +0 -124
- package/lib/utils/helpers/helpers.ts +0 -51
- package/lib/utils/helpers/index.ts +0 -1
- package/lib/utils/index.ts +0 -14
- package/lib/utils/makeClassNameComponent/index.ts +0 -1
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.stories.tsx +0 -46
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.tsx +0 -60
- package/lib/utils/menu/index.ts +0 -1
- package/lib/utils/menu/menu.ts +0 -174
- package/lib/utils/merge-refs/index.ts +0 -1
- package/lib/utils/merge-refs/merge-refs.stories.tsx +0 -92
- package/lib/utils/merge-refs/merge-refs.ts +0 -16
- package/lib/utils/rating/index.ts +0 -1
- package/lib/utils/rating/rating.ts +0 -30
- package/lib/utils/score-bar/index.ts +0 -1
- package/lib/utils/score-bar/score-bar.ts +0 -45
- package/lib/utils/string/index.ts +0 -1
- package/lib/utils/string/string.stories.tsx +0 -71
- package/lib/utils/string/string.ts +0 -26
- package/lib/utils/token-list-input/token-list-input.ts +0 -32
- package/lib/utils/tokens/index.ts +0 -1
- package/lib/utils/tokens/tokens.ts +0 -237
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import {spaceMedium} from '../../styles/variables/_space';
|
|
4
|
-
import {Button} from '../Button';
|
|
5
|
-
import {Icon} from '../Icon';
|
|
6
|
-
import {BodyLarge, BodySmall} from '../Text';
|
|
7
|
-
import {Tooltip} from '../Tooltip';
|
|
8
|
-
import {Truncate} from '../Truncate';
|
|
9
|
-
|
|
10
|
-
import type {CardProps} from './Card';
|
|
11
|
-
import {
|
|
12
|
-
Card,
|
|
13
|
-
CardActions,
|
|
14
|
-
CardContent,
|
|
15
|
-
CardFooter,
|
|
16
|
-
CardHeader,
|
|
17
|
-
CardTitle,
|
|
18
|
-
ClickableCard,
|
|
19
|
-
PADDING_SIZES,
|
|
20
|
-
} from './Card';
|
|
21
|
-
|
|
22
|
-
import css from './Card.stories.module.css';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const paddingSizes: Array<unknown> = [...Object.keys(PADDING_SIZES)];
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
tags: ['autodocs'],
|
|
29
|
-
title: 'Components/Card',
|
|
30
|
-
component: Card,
|
|
31
|
-
argTypes: {
|
|
32
|
-
onClick: {
|
|
33
|
-
description:
|
|
34
|
-
'**onClick** handler that is applied to the root `<div>` element. Use this in `ClickableCard`',
|
|
35
|
-
action: 'clicked',
|
|
36
|
-
table: {
|
|
37
|
-
type: {summary: '(SyntheticEvent<HTMLElement>) => mixed'},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
disabled: {
|
|
41
|
-
name: 'disabled',
|
|
42
|
-
description: `Disabled Card. Use this in ClickableCard. When true, User can not interact with the the clickableCard.`,
|
|
43
|
-
options: [false, true],
|
|
44
|
-
control: 'boolean',
|
|
45
|
-
table: {
|
|
46
|
-
type: {summary: 'boolean'},
|
|
47
|
-
defaultValue: {summary: false},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
paddingTop: {
|
|
51
|
-
description: 'Padding size for top of card',
|
|
52
|
-
options: paddingSizes,
|
|
53
|
-
control: {
|
|
54
|
-
type: 'select',
|
|
55
|
-
},
|
|
56
|
-
table: {
|
|
57
|
-
type: {summary: 'string'},
|
|
58
|
-
defaultValue: {summary: 'medium'},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
paddingRight: {
|
|
62
|
-
description: 'Padding size for right of card',
|
|
63
|
-
options: paddingSizes,
|
|
64
|
-
control: {
|
|
65
|
-
type: 'select',
|
|
66
|
-
},
|
|
67
|
-
table: {
|
|
68
|
-
type: {summary: 'string'},
|
|
69
|
-
defaultValue: {summary: 'medium'},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
paddingBottom: {
|
|
73
|
-
description: 'Padding size for bottom of card',
|
|
74
|
-
options: paddingSizes,
|
|
75
|
-
control: {
|
|
76
|
-
type: 'select',
|
|
77
|
-
},
|
|
78
|
-
table: {
|
|
79
|
-
type: {summary: 'string'},
|
|
80
|
-
defaultValue: {summary: 'medium'},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
paddingLeft: {
|
|
84
|
-
description: 'Padding size for left of card',
|
|
85
|
-
options: paddingSizes,
|
|
86
|
-
control: {
|
|
87
|
-
type: 'select',
|
|
88
|
-
},
|
|
89
|
-
table: {
|
|
90
|
-
type: {summary: 'string'},
|
|
91
|
-
defaultValue: {summary: 'medium'},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
classNames: {
|
|
95
|
-
description: 'External classNames to be applied',
|
|
96
|
-
control: {
|
|
97
|
-
type: 'object',
|
|
98
|
-
},
|
|
99
|
-
table: {
|
|
100
|
-
type: {summary: '{wrapper?: string}'},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
children: {
|
|
104
|
-
type: {required: true},
|
|
105
|
-
description: 'The content of the Card',
|
|
106
|
-
table: {
|
|
107
|
-
type: {summary: 'React.Component'},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
parameters: {
|
|
112
|
-
docs: {
|
|
113
|
-
subtitle: 'Generates a Card component.',
|
|
114
|
-
description: {
|
|
115
|
-
component: `
|
|
116
|
-
\`\`\`js
|
|
117
|
-
import {
|
|
118
|
-
Card,
|
|
119
|
-
ClickableCard,
|
|
120
|
-
CardHeader,
|
|
121
|
-
CardTitle,
|
|
122
|
-
CardActions,
|
|
123
|
-
CardContent,
|
|
124
|
-
CardFooter
|
|
125
|
-
} from "@spaced-out/ui-design-system/lib/components/Card";
|
|
126
|
-
\`\`\`
|
|
127
|
-
Simple Card component that supports padding as prop. Border and background are prefixed with default values.
|
|
128
|
-
ClickableCard variant supports hover and focus states. You also have an option to add header and footer to the card.
|
|
129
|
-
|
|
130
|
-
**Note:** If you pass \`'none'\` as the \`padding\` value to the Card, make sure to apply the same \`border-radius\`
|
|
131
|
-
to the top and bottom child elements to maintain visual consistency with the Card's corners.
|
|
132
|
-
`,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
storySource: {
|
|
136
|
-
componentPath: '/src/components/Card/Card.jsx',
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const _Default = (args: CardProps) => (<div className={css.container}>
|
|
142
|
-
<Card {...args} classNames={{wrapper: css.cardContainer}}>
|
|
143
|
-
<BodyLarge>This is a card</BodyLarge>
|
|
144
|
-
<BodySmall>Set width and height through a className</BodySmall>
|
|
145
|
-
<BodySmall>Default Padding is set to {spaceMedium}</BodySmall>
|
|
146
|
-
</Card>
|
|
147
|
-
</div>);
|
|
148
|
-
|
|
149
|
-
export const _WithHeader = (args: CardProps) => (<div className={css.container}>
|
|
150
|
-
<Card {...args}>
|
|
151
|
-
<CardHeader>
|
|
152
|
-
<CardTitle>
|
|
153
|
-
<Truncate>Card With Header</Truncate>
|
|
154
|
-
</CardTitle>
|
|
155
|
-
<CardActions>
|
|
156
|
-
<Button type="ghost" iconLeftName="cloud-arrow-down"></Button>
|
|
157
|
-
<Button type="ghost" iconLeftName="add"></Button>
|
|
158
|
-
</CardActions>
|
|
159
|
-
</CardHeader>
|
|
160
|
-
<CardContent className={css.cardContainer}>
|
|
161
|
-
<BodyLarge>This is a card</BodyLarge>
|
|
162
|
-
<BodySmall>Set width and height through a className</BodySmall>
|
|
163
|
-
<BodySmall>Default Padding is set to {spaceMedium}</BodySmall>
|
|
164
|
-
</CardContent>
|
|
165
|
-
</Card>
|
|
166
|
-
</div>);
|
|
167
|
-
|
|
168
|
-
_WithHeader.args = {
|
|
169
|
-
classNames: {wrapper: css.cardContainerWithHeader},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const _WithFooter = (args: CardProps) => (<div className={css.container}>
|
|
173
|
-
<Card {...args}>
|
|
174
|
-
<CardContent className={css.cardContainer}>
|
|
175
|
-
<BodyLarge>This is a card</BodyLarge>
|
|
176
|
-
<BodySmall>Set width and height through a className</BodySmall>
|
|
177
|
-
<BodySmall>Default Padding is set to {spaceMedium}</BodySmall>
|
|
178
|
-
</CardContent>
|
|
179
|
-
<CardFooter>
|
|
180
|
-
<CardTitle>
|
|
181
|
-
<Truncate>Save it?</Truncate>
|
|
182
|
-
</CardTitle>
|
|
183
|
-
<CardActions>
|
|
184
|
-
<Button type="tertiary" iconLeftName="trash">
|
|
185
|
-
Delete
|
|
186
|
-
</Button>
|
|
187
|
-
<Button type="secondary" iconLeftName="cloud-arrow-down">
|
|
188
|
-
Save
|
|
189
|
-
</Button>
|
|
190
|
-
</CardActions>
|
|
191
|
-
</CardFooter>
|
|
192
|
-
</Card>
|
|
193
|
-
</div>);
|
|
194
|
-
|
|
195
|
-
_WithFooter.args = {
|
|
196
|
-
classNames: {wrapper: css.cardContainerWithHeader},
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export const _WithHeaderAndFooter = (args: CardProps) => (<div className={css.container}>
|
|
200
|
-
<Card {...args}>
|
|
201
|
-
<CardHeader>
|
|
202
|
-
<CardTitle>
|
|
203
|
-
<Truncate>Card With Header</Truncate>
|
|
204
|
-
</CardTitle>
|
|
205
|
-
<CardActions>
|
|
206
|
-
<Button type="ghost" iconLeftName="cloud-arrow-down"></Button>
|
|
207
|
-
<Button type="ghost" iconLeftName="add"></Button>
|
|
208
|
-
</CardActions>
|
|
209
|
-
</CardHeader>
|
|
210
|
-
<CardContent className={css.cardContainer}>
|
|
211
|
-
<BodyLarge>This is a card</BodyLarge>
|
|
212
|
-
<BodySmall>Set width and height through a className</BodySmall>
|
|
213
|
-
<BodySmall>Default Padding is set to {spaceMedium}</BodySmall>
|
|
214
|
-
</CardContent>
|
|
215
|
-
<CardFooter>
|
|
216
|
-
<CardTitle>
|
|
217
|
-
<Truncate>Save it?</Truncate>
|
|
218
|
-
</CardTitle>
|
|
219
|
-
<CardActions>
|
|
220
|
-
<Button type="tertiary" iconLeftName="trash">
|
|
221
|
-
Delete
|
|
222
|
-
</Button>
|
|
223
|
-
<Button type="secondary" iconLeftName="cloud-arrow-down">
|
|
224
|
-
Save
|
|
225
|
-
</Button>
|
|
226
|
-
</CardActions>
|
|
227
|
-
</CardFooter>
|
|
228
|
-
</Card>
|
|
229
|
-
</div>);
|
|
230
|
-
|
|
231
|
-
_WithFooter.args = {
|
|
232
|
-
classNames: {wrapper: css.cardContainerWithHeader},
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
export const _Clickable = (args: CardProps) => (<div className={css.container}>
|
|
236
|
-
<ClickableCard {...args} classNames={{wrapper: css.cardContainer}}>
|
|
237
|
-
<BodyLarge>This is a clickable card</BodyLarge>
|
|
238
|
-
<BodySmall>Set width and height through a className</BodySmall>
|
|
239
|
-
<BodySmall>Default Padding is set to {spaceMedium}</BodySmall>
|
|
240
|
-
<Tooltip title="Hello there!">
|
|
241
|
-
<Icon name="face-smile" />
|
|
242
|
-
</Tooltip>
|
|
243
|
-
<BodySmall>This has focus and hover states</BodySmall>
|
|
244
|
-
</ClickableCard>
|
|
245
|
-
</div>);
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import {Flow} from 'flow-to-typescript-codemod';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
import * as SPACES from '../../styles/variables/_space';
|
|
6
|
-
import classify from '../../utils/classify';
|
|
7
|
-
import {capitalize} from '../../utils/string';
|
|
8
|
-
|
|
9
|
-
import css from './Card.module.css';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type ClassNames = Readonly<{
|
|
13
|
-
wrapper?: string;
|
|
14
|
-
}>;
|
|
15
|
-
|
|
16
|
-
export const PADDING_SIZES = Object.freeze({
|
|
17
|
-
small: 'small',
|
|
18
|
-
medium: 'medium',
|
|
19
|
-
large: 'large',
|
|
20
|
-
none: 'none',
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export type PaddingSizeType = typeof PADDING_SIZES[keyof typeof PADDING_SIZES];
|
|
24
|
-
|
|
25
|
-
export type CardProps = {
|
|
26
|
-
classNames?: ClassNames;
|
|
27
|
-
children: React.ReactNode;
|
|
28
|
-
paddingTop?: PaddingSizeType;
|
|
29
|
-
paddingRight?: PaddingSizeType;
|
|
30
|
-
paddingBottom?: PaddingSizeType;
|
|
31
|
-
paddingLeft?: PaddingSizeType;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type CardChildProps = {
|
|
35
|
-
className?: string;
|
|
36
|
-
children: React.ReactNode;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ClickableCardProps = ((CardProps) & {
|
|
40
|
-
onClick?: ((arg1: React.SyntheticEvent<HTMLElement>) => unknown) | null | undefined;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const getPaddingValue = (size: PaddingSizeType): string => {
|
|
45
|
-
const spaceKey = 'space' + capitalize(size);
|
|
46
|
-
// @ts-ignore - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof import("/Users/diwaker/SpacedOut/ui-design-system/src/styles/variables/_space")'.
|
|
47
|
-
return SPACES[spaceKey] || SPACES['spaceNone'];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const CardHeader = (
|
|
51
|
-
{
|
|
52
|
-
className,
|
|
53
|
-
children,
|
|
54
|
-
...props
|
|
55
|
-
}: CardChildProps,
|
|
56
|
-
) => (<div {...props} className={classify(css.cardHeader, className)}>
|
|
57
|
-
{children}
|
|
58
|
-
</div>);
|
|
59
|
-
|
|
60
|
-
export const CardTitle = (
|
|
61
|
-
{
|
|
62
|
-
className,
|
|
63
|
-
children,
|
|
64
|
-
...props
|
|
65
|
-
}: CardChildProps,
|
|
66
|
-
) => (<div {...props} className={classify(css.cardTitle, className)}>
|
|
67
|
-
{children}
|
|
68
|
-
</div>);
|
|
69
|
-
|
|
70
|
-
export const CardActions = (
|
|
71
|
-
{
|
|
72
|
-
className,
|
|
73
|
-
children,
|
|
74
|
-
...props
|
|
75
|
-
}: CardChildProps,
|
|
76
|
-
) => (<div {...props} className={classify(css.cardActions, className)}>
|
|
77
|
-
{children}
|
|
78
|
-
</div>);
|
|
79
|
-
|
|
80
|
-
export const CardFooter = (
|
|
81
|
-
{
|
|
82
|
-
className,
|
|
83
|
-
children,
|
|
84
|
-
...props
|
|
85
|
-
}: CardChildProps,
|
|
86
|
-
) => (<div {...props} className={classify(css.cardFooter, className)}>
|
|
87
|
-
{children}
|
|
88
|
-
</div>);
|
|
89
|
-
|
|
90
|
-
export const CardContent = (
|
|
91
|
-
{
|
|
92
|
-
className,
|
|
93
|
-
children,
|
|
94
|
-
...props
|
|
95
|
-
}: CardChildProps,
|
|
96
|
-
) => (<div {...props} className={classify(css.cardContent, className)}>
|
|
97
|
-
{children}
|
|
98
|
-
</div>);
|
|
99
|
-
|
|
100
|
-
export const Card: Flow.AbstractComponent<CardProps, HTMLDivElement> =
|
|
101
|
-
React.forwardRef<HTMLDivElement, CardProps>((
|
|
102
|
-
{
|
|
103
|
-
children,
|
|
104
|
-
classNames,
|
|
105
|
-
paddingTop = 'medium',
|
|
106
|
-
paddingRight = 'medium',
|
|
107
|
-
paddingBottom = 'medium',
|
|
108
|
-
paddingLeft = 'medium',
|
|
109
|
-
...props
|
|
110
|
-
}: CardProps,
|
|
111
|
-
ref,
|
|
112
|
-
) => (<div
|
|
113
|
-
{...props}
|
|
114
|
-
style={{
|
|
115
|
-
'--card-padding-top': getPaddingValue(paddingTop),
|
|
116
|
-
'--card-padding-right': getPaddingValue(paddingRight),
|
|
117
|
-
'--card-padding-bottom': getPaddingValue(paddingBottom),
|
|
118
|
-
'--card-padding-left': getPaddingValue(paddingLeft),
|
|
119
|
-
}}
|
|
120
|
-
data-testid="Card"
|
|
121
|
-
className={classify(css.cardWrapper, classNames?.wrapper)}
|
|
122
|
-
ref={ref}
|
|
123
|
-
>
|
|
124
|
-
{children}
|
|
125
|
-
</div>));
|
|
126
|
-
|
|
127
|
-
export const ClickableCard: Flow.AbstractComponent<ClickableCardProps, HTMLDivElement> = React.forwardRef<HTMLDivElement, ClickableCardProps>((
|
|
128
|
-
{
|
|
129
|
-
classNames,
|
|
130
|
-
onClick,
|
|
131
|
-
disabled = false,
|
|
132
|
-
...props
|
|
133
|
-
}: ClickableCardProps,
|
|
134
|
-
ref,
|
|
135
|
-
) => {
|
|
136
|
-
const componentRef = React.useRef(null);
|
|
137
|
-
// @ts-ignore - TS2322 - Type 'null' is not assignable to type 'HTMLDivElement'.
|
|
138
|
-
React.useImperativeHandle(ref, () => componentRef.current);
|
|
139
|
-
React.useEffect(() => {
|
|
140
|
-
if (disabled) {
|
|
141
|
-
// @ts-ignore - TS2339 - Property 'blur' does not exist on type 'never'.
|
|
142
|
-
componentRef.current?.blur();
|
|
143
|
-
}
|
|
144
|
-
}, [disabled]);
|
|
145
|
-
const onClickHandler = (e: any) => {
|
|
146
|
-
if (!disabled) {
|
|
147
|
-
onClick && onClick(e);
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
const onKeyDownHandler = (e: any) => {
|
|
151
|
-
if (e.key === 'Enter') {
|
|
152
|
-
onClickHandler(e);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
return (
|
|
156
|
-
<Card
|
|
157
|
-
{...props}
|
|
158
|
-
classNames={{
|
|
159
|
-
wrapper: classify(
|
|
160
|
-
css.clickableCard,
|
|
161
|
-
{[css.disabled]: disabled},
|
|
162
|
-
classNames?.wrapper,
|
|
163
|
-
),
|
|
164
|
-
}}
|
|
165
|
-
// @ts-ignore - TS2322 - Type '{ classNames: { wrapper: string; }; tabIndex: number; onClick: (e: any) => void; onKeyDown: (e: any) => void; ref: ForwardedRef<HTMLDivElement>; children: React.ReactNode; paddingTop?: string | undefined; paddingRight?: string | undefined; paddingBottom?: string | undefined; paddingLeft?: string | undefined; }' is not assignable to type 'IntrinsicAttributes & CardProps & RefAttributes<HTMLDivElement>'.
|
|
166
|
-
tabIndex={disabled ? -1 : 0}
|
|
167
|
-
onClick={onClickHandler}
|
|
168
|
-
onKeyDown={onKeyDownHandler}
|
|
169
|
-
ref={ref}
|
|
170
|
-
/>
|
|
171
|
-
);
|
|
172
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Card';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type {Tooltip} from '../../../types/charts';
|
|
2
|
-
|
|
3
|
-
import typographyCss from '../../../styles/typography.module.css';
|
|
4
|
-
import css from './ChartTooltip.module.css';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const tooltipTheme: Tooltip = {
|
|
8
|
-
headerFormat: `<span class="${typographyCss.bodySmall} ${css.tooltipHeader}">{point.key}</span>`,
|
|
9
|
-
pointFormat: `<span class=${css.tooltipPoint}>
|
|
10
|
-
<span style="background-color:{point.color};" class=${css.indicatorCircle}></span>
|
|
11
|
-
<span class="${css.tooltipContent} ${typographyCss.bodyMedium}"> {series.name}: {point.y}</span>
|
|
12
|
-
</span>`,
|
|
13
|
-
};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {Flow} from 'flow-to-typescript-codemod';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import Highcharts from 'highcharts';
|
|
5
|
-
import accessibility from 'highcharts/modules/accessibility';
|
|
6
|
-
import drilldown from 'highcharts/modules/drilldown';
|
|
7
|
-
import exporting from 'highcharts/modules/exporting';
|
|
8
|
-
|
|
9
|
-
import {size180} from '../../../styles/variables/_size';
|
|
10
|
-
import classify from '../../../utils/classify';
|
|
11
|
-
import {ANCHOR_POSITION_TYPE, ButtonDropdown} from '../../ButtonDropdown';
|
|
12
|
-
import {
|
|
13
|
-
Card,
|
|
14
|
-
CardActions,
|
|
15
|
-
CardContent,
|
|
16
|
-
CardHeader,
|
|
17
|
-
CardTitle,
|
|
18
|
-
} from '../../Card';
|
|
19
|
-
import {CircularLoader} from '../../CircularLoader';
|
|
20
|
-
import type {MenuOption} from '../../Menu';
|
|
21
|
-
|
|
22
|
-
import css from './ChartWrapper.module.css';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export type ExportOptionType = {
|
|
26
|
-
key: string;
|
|
27
|
-
label: string;
|
|
28
|
-
format: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const EXPORT_OPTIONS = Object.freeze({
|
|
32
|
-
download_as_png: {
|
|
33
|
-
key: 'download_as_png',
|
|
34
|
-
label: 'Download as PNG',
|
|
35
|
-
format: 'image/png',
|
|
36
|
-
},
|
|
37
|
-
download_as_jpeg: {
|
|
38
|
-
key: 'download_as_jpeg',
|
|
39
|
-
label: 'Download as JPEG',
|
|
40
|
-
format: 'image/jpeg',
|
|
41
|
-
},
|
|
42
|
-
download_as_pdf: {
|
|
43
|
-
key: 'download_as_pdf',
|
|
44
|
-
label: 'Download as PDF',
|
|
45
|
-
format: 'application/pdf',
|
|
46
|
-
},
|
|
47
|
-
download_as_svg: {
|
|
48
|
-
key: 'download_as_svg',
|
|
49
|
-
label: 'Download as SVG',
|
|
50
|
-
format: 'image/svg+xml',
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// on assumption that all export options will be shown by default
|
|
55
|
-
const DEFAULT_EXPORT_OPTIONS = Object.keys(EXPORT_OPTIONS).map(
|
|
56
|
-
// @ts-ignore - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ download_as_png: { key: string; label: string; format: string; }; download_as_jpeg: { key: string; label: string; format: string; }; download_as_pdf: { key: string; label: string; format: string; }; download_as_svg: { ...; }; }>'.
|
|
57
|
-
(exportKey) => EXPORT_OPTIONS[exportKey],
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
type CustomExportButtonProps = {
|
|
61
|
-
ref?: HTMLDivElement;
|
|
62
|
-
customExportOptions?: Array<ExportOptionType> | null;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const CustomExportButton = React.forwardRef<HTMLDivElement, CustomExportButtonProps>(({
|
|
66
|
-
customExportOptions = null,
|
|
67
|
-
}: CustomExportButtonProps, ref) => {
|
|
68
|
-
exporting(Highcharts);
|
|
69
|
-
drilldown(Highcharts);
|
|
70
|
-
accessibility(Highcharts);
|
|
71
|
-
|
|
72
|
-
const exportOptions = customExportOptions
|
|
73
|
-
? customExportOptions
|
|
74
|
-
: DEFAULT_EXPORT_OPTIONS;
|
|
75
|
-
|
|
76
|
-
const menuOptions: Array<MenuOption> = exportOptions.map((exportOption) => {
|
|
77
|
-
const {key, label} = exportOption;
|
|
78
|
-
return {key, label};
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const handleDownload = (exportKey: string): void => {
|
|
82
|
-
const exportOptionObject = exportOptions.find(
|
|
83
|
-
(exportOption) => exportOption.key === exportKey,
|
|
84
|
-
);
|
|
85
|
-
const exportFormat = exportOptionObject?.format || '';
|
|
86
|
-
// @ts-ignore - TS2531 - Object is possibly 'null'. | TS2339 - Property 'current' does not exist on type '((instance: HTMLDivElement | null) => void) | MutableRefObject<HTMLDivElement | null>'.
|
|
87
|
-
if (ref.current) {
|
|
88
|
-
// @ts-ignore - TS2531 - Object is possibly 'null'. | TS2339 - Property 'current' does not exist on type '((instance: HTMLDivElement | null) => void) | MutableRefObject<HTMLDivElement | null>'.
|
|
89
|
-
ref.current.chart?.exportChart({type: exportFormat});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<ButtonDropdown
|
|
95
|
-
ariaLabel="Export Chart Menu"
|
|
96
|
-
menu={{
|
|
97
|
-
isFluid: true,
|
|
98
|
-
menuDisabled: false,
|
|
99
|
-
options: menuOptions,
|
|
100
|
-
size: 'medium',
|
|
101
|
-
width: size180,
|
|
102
|
-
}}
|
|
103
|
-
iconLeftName="ellipsis"
|
|
104
|
-
onOptionSelect={(option) => handleDownload(option.key)}
|
|
105
|
-
size="small"
|
|
106
|
-
type="ghost"
|
|
107
|
-
anchorPosition={ANCHOR_POSITION_TYPE.bottomEnd}
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
export type ChartWrapperClassNames = Readonly<{
|
|
113
|
-
wrapper?: string;
|
|
114
|
-
header?: string;
|
|
115
|
-
title?: string;
|
|
116
|
-
actions?: string;
|
|
117
|
-
content?: string;
|
|
118
|
-
loader?: string;
|
|
119
|
-
}>;
|
|
120
|
-
|
|
121
|
-
type ChartWrapperProps = {
|
|
122
|
-
isLoading?: boolean;
|
|
123
|
-
title: React.ReactNode;
|
|
124
|
-
children?: React.ReactNode;
|
|
125
|
-
classNames?: ChartWrapperClassNames;
|
|
126
|
-
customExportOptions?: Array<ExportOptionType> | null;
|
|
127
|
-
headerActions?: React.ReactNode;
|
|
128
|
-
hasEmptyData?: boolean;
|
|
129
|
-
emptyText?: React.ReactNode;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const ChartWrapper: Flow.AbstractComponent<ChartWrapperProps, HTMLDivElement> = React.forwardRef<HTMLDivElement, ChartWrapperProps>((
|
|
133
|
-
{
|
|
134
|
-
isLoading,
|
|
135
|
-
title,
|
|
136
|
-
children,
|
|
137
|
-
classNames,
|
|
138
|
-
customExportOptions,
|
|
139
|
-
headerActions,
|
|
140
|
-
hasEmptyData = false,
|
|
141
|
-
emptyText,
|
|
142
|
-
}: ChartWrapperProps,
|
|
143
|
-
ref,
|
|
144
|
-
) => (<Card
|
|
145
|
-
classNames={{
|
|
146
|
-
wrapper: classify(
|
|
147
|
-
css.wrapper,
|
|
148
|
-
{[css.justifyCenter]: isLoading},
|
|
149
|
-
classNames?.wrapper,
|
|
150
|
-
),
|
|
151
|
-
}}
|
|
152
|
-
>
|
|
153
|
-
{isLoading ? (
|
|
154
|
-
<CircularLoader
|
|
155
|
-
size="large"
|
|
156
|
-
className={classify(css.loader, classNames?.loader)}
|
|
157
|
-
/>
|
|
158
|
-
) : (
|
|
159
|
-
<>
|
|
160
|
-
<CardHeader className={classNames?.header}>
|
|
161
|
-
<CardTitle className={classNames?.title}>{title}</CardTitle>
|
|
162
|
-
<CardActions
|
|
163
|
-
className={classify(css.chartCardActions, classNames?.actions)}
|
|
164
|
-
>
|
|
165
|
-
<CustomExportButton
|
|
166
|
-
ref={ref}
|
|
167
|
-
customExportOptions={customExportOptions}
|
|
168
|
-
/>
|
|
169
|
-
{headerActions ? headerActions : null}
|
|
170
|
-
</CardActions>
|
|
171
|
-
</CardHeader>
|
|
172
|
-
<CardContent
|
|
173
|
-
className={classify(css.chartContent, classNames?.content)}
|
|
174
|
-
>
|
|
175
|
-
{hasEmptyData && emptyText ? emptyText : children}
|
|
176
|
-
</CardContent>
|
|
177
|
-
</>
|
|
178
|
-
)}
|
|
179
|
-
</Card>));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ChartWrapper';
|