@ultraviolet/ui 1.51.0 → 1.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionBar/index.d.ts +20 -0
- package/dist/components/ActionBar/index.js +40 -0
- package/dist/components/Alert/index.d.ts +27 -0
- package/dist/components/Alert/index.js +126 -0
- package/dist/components/Avatar/index.d.ts +43 -0
- package/dist/components/Avatar/index.js +54 -0
- package/dist/components/Badge/index.d.ts +31 -0
- package/dist/components/Badge/index.js +115 -0
- package/dist/components/Banner/assets/default-image-small.svg.js +4 -0
- package/dist/components/Banner/assets/default-image.svg.js +4 -0
- package/dist/components/Banner/index.d.ts +24 -0
- package/dist/components/Banner/index.js +191 -0
- package/dist/components/BarChart/Tooltip.d.ts +9 -0
- package/dist/components/BarChart/Tooltip.js +36 -0
- package/dist/components/BarChart/index.d.ts +27 -0
- package/dist/components/BarChart/index.js +82 -0
- package/dist/components/BarStack/index.d.ts +36 -0
- package/dist/components/BarStack/index.js +188 -0
- package/dist/components/Breadcrumbs/index.d.ts +30 -0
- package/dist/components/Breadcrumbs/index.js +76 -0
- package/dist/components/Bullet/index.d.ts +39 -0
- package/dist/components/Bullet/index.js +88 -0
- package/dist/components/Button/index.d.ts +120 -0
- package/dist/components/Button/index.js +291 -0
- package/dist/components/Card/index.d.ts +20 -0
- package/dist/components/Card/index.js +59 -0
- package/dist/components/Carousel/index.d.ts +19 -0
- package/dist/components/Carousel/index.js +147 -0
- package/dist/components/Checkbox/index.d.ts +36 -0
- package/dist/components/Checkbox/index.js +359 -0
- package/dist/components/CheckboxGroup/index.d.ts +24 -0
- package/dist/components/CheckboxGroup/index.js +112 -0
- package/dist/components/CopyButton/index.d.ts +19 -0
- package/dist/components/CopyButton/index.js +37 -0
- package/dist/components/DateInput/datepicker.css.js +4 -0
- package/dist/components/DateInput/index.d.ts +38 -0
- package/dist/components/DateInput/index.js +301 -0
- package/dist/components/Dialog/Context.d.ts +7 -0
- package/dist/components/Dialog/Context.js +15 -0
- package/dist/components/Dialog/constants.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts +87 -0
- package/dist/components/Dialog/index.js +87 -0
- package/dist/components/Dialog/subComponents/Button.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Button.js +24 -0
- package/dist/components/Dialog/subComponents/Buttons.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Buttons.js +12 -0
- package/dist/components/Dialog/subComponents/CancelButton.d.ts +8 -0
- package/dist/components/Dialog/subComponents/CancelButton.js +9 -0
- package/dist/components/Dialog/subComponents/Stack.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Stack.js +6 -0
- package/dist/components/Dialog/subComponents/Text.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Text.js +6 -0
- package/dist/components/EmptyState/index.d.ts +38 -0
- package/dist/components/EmptyState/index.js +82 -0
- package/dist/components/Expandable/index.d.ts +33 -0
- package/dist/components/Expandable/index.js +79 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +3 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.js +39 -0
- package/dist/components/GlobalAlert/index.d.ts +40 -0
- package/dist/components/GlobalAlert/index.js +112 -0
- package/dist/components/LineChart/CustomLegend.d.ts +13 -0
- package/dist/components/LineChart/CustomLegend.js +109 -0
- package/dist/components/LineChart/Tooltip.d.ts +6 -0
- package/dist/components/LineChart/Tooltip.js +46 -0
- package/dist/components/LineChart/helpers.d.ts +8 -0
- package/dist/components/LineChart/helpers.js +50 -0
- package/dist/components/LineChart/index.d.ts +25 -0
- package/dist/components/LineChart/index.js +118 -0
- package/dist/components/Link/index.d.ts +33 -0
- package/dist/components/Link/index.js +167 -0
- package/dist/components/List/Body.d.ts +6 -0
- package/dist/components/List/Body.js +11 -0
- package/dist/components/List/Cell.d.ts +12 -0
- package/dist/components/List/Cell.js +38 -0
- package/dist/components/List/HeaderCell.d.ts +11 -0
- package/dist/components/List/HeaderCell.js +96 -0
- package/dist/components/List/HeaderRow.d.ts +7 -0
- package/dist/components/List/HeaderRow.js +38 -0
- package/dist/components/List/ListContext.d.ts +34 -0
- package/dist/components/List/ListContext.js +155 -0
- package/dist/components/List/Row.d.ts +23 -0
- package/dist/components/List/Row.js +194 -0
- package/dist/components/List/SelectBar.d.ts +15 -0
- package/dist/components/List/SelectBar.js +35 -0
- package/dist/components/List/SkeletonRows.d.ts +7 -0
- package/dist/components/List/SkeletonRows.js +36 -0
- package/dist/components/List/constants.d.ts +2 -0
- package/dist/{src/components → components}/List/constants.js +4 -2
- package/dist/components/List/index.d.ts +68 -0
- package/dist/components/List/index.js +80 -0
- package/dist/components/Loader/index.d.ts +22 -0
- package/dist/components/Loader/index.js +98 -0
- package/dist/components/Menu/Item.d.ts +15 -0
- package/dist/components/Menu/Item.js +101 -0
- package/dist/components/Menu/index.d.ts +49 -0
- package/dist/components/Menu/index.js +182 -0
- package/dist/components/MenuV2/Group.d.ts +7 -0
- package/dist/components/MenuV2/Group.js +23 -0
- package/dist/components/MenuV2/Item.d.ts +16 -0
- package/dist/components/MenuV2/Item.js +120 -0
- package/dist/components/MenuV2/index.d.ts +90 -0
- package/dist/components/MenuV2/index.js +124 -0
- package/dist/components/Meter/index.d.ts +26 -0
- package/dist/components/Meter/index.js +76 -0
- package/dist/components/Modal/Dialog.d.ts +3 -0
- package/dist/components/Modal/Dialog.js +197 -0
- package/dist/components/Modal/Disclosure.d.ts +3 -0
- package/dist/{src/components → components}/Modal/Disclosure.js +12 -12
- package/dist/components/Modal/constants.d.ts +3 -0
- package/dist/{src/components → components}/Modal/constants.js +8 -6
- package/dist/components/Modal/index.d.ts +42 -0
- package/dist/components/Modal/index.js +114 -0
- package/dist/components/Modal/types.d.ts +48 -0
- package/dist/components/Notice/index.d.ts +11 -0
- package/dist/components/Notice/index.js +39 -0
- package/dist/components/Notification/index.d.ts +36 -0
- package/dist/components/Notification/index.js +88 -0
- package/dist/components/Notification/react-toastify.css.js +4 -0
- package/dist/components/NumberInput/helpers.d.ts +4 -0
- package/dist/{src/components → components}/NumberInput/helpers.js +6 -2
- package/dist/components/NumberInput/index.d.ts +41 -0
- package/dist/components/NumberInput/index.js +349 -0
- package/dist/components/NumberInputV2/index.d.ts +27 -0
- package/dist/components/NumberInputV2/index.js +370 -0
- package/dist/components/Pagination/getPageNumbers.d.ts +8 -0
- package/dist/{src/components → components}/Pagination/getPageNumbers.js +4 -12
- package/dist/components/Pagination/index.d.ts +30 -0
- package/dist/components/Pagination/index.js +124 -0
- package/dist/components/PasswordCheck/index.d.ts +20 -0
- package/dist/components/PasswordCheck/index.js +29 -0
- package/dist/components/PasswordStrengthMeter/index.d.ts +39 -0
- package/dist/components/PasswordStrengthMeter/index.js +98 -0
- package/dist/components/PieChart/Legends.d.ts +9 -0
- package/dist/components/PieChart/Legends.js +120 -0
- package/dist/components/PieChart/Tooltip.d.ts +12 -0
- package/dist/components/PieChart/Tooltip.js +29 -0
- package/dist/components/PieChart/index.d.ts +20 -0
- package/dist/components/PieChart/index.js +120 -0
- package/dist/components/PieChart/types.d.ts +7 -0
- package/dist/components/Popover/index.d.ts +55 -0
- package/dist/components/Popover/index.js +149 -0
- package/dist/components/Popup/animations.d.ts +11 -0
- package/dist/{src/components → components}/Popup/animations.js +7 -6
- package/dist/components/Popup/helpers.d.ts +31 -0
- package/dist/components/Popup/helpers.js +204 -0
- package/dist/components/Popup/index.d.ts +72 -0
- package/dist/components/Popup/index.js +385 -0
- package/dist/components/ProgressBar/index.d.ts +14 -0
- package/dist/components/ProgressBar/index.js +71 -0
- package/dist/components/Radio/index.d.ts +21 -0
- package/dist/components/Radio/index.js +202 -0
- package/dist/components/RadioGroup/index.d.ts +25 -0
- package/dist/components/RadioGroup/index.js +104 -0
- package/dist/components/Row/index.d.ts +22 -0
- package/dist/components/Row/index.js +43 -0
- package/dist/components/SelectInput/index.d.ts +75 -0
- package/dist/components/SelectInput/index.js +563 -0
- package/dist/components/SelectInputV2/Dropdown.d.ts +23 -0
- package/dist/components/SelectInputV2/Dropdown.js +669 -0
- package/dist/components/SelectInputV2/DropdownOption.d.ts +8 -0
- package/dist/components/SelectInputV2/DropdownOption.js +133 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.d.ts +9 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.js +123 -0
- package/dist/components/SelectInputV2/SelectBar.d.ts +14 -0
- package/dist/components/SelectInputV2/SelectBar.js +327 -0
- package/dist/components/SelectInputV2/SelectInputProvider.d.ts +41 -0
- package/dist/components/SelectInputV2/SelectInputProvider.js +203 -0
- package/dist/components/SelectInputV2/findOptionInOptions.d.ts +2 -0
- package/dist/components/SelectInputV2/findOptionInOptions.js +12 -0
- package/dist/components/SelectInputV2/index.d.ts +115 -0
- package/dist/components/SelectInputV2/index.js +146 -0
- package/dist/components/SelectInputV2/types.d.ts +38 -0
- package/dist/{src/components → components}/SelectInputV2/types.js +4 -2
- package/dist/components/SelectableCard/index.d.ts +25 -0
- package/dist/components/SelectableCard/index.js +193 -0
- package/dist/components/SelectableCardGroup/index.d.ts +23 -0
- package/dist/components/SelectableCardGroup/index.js +112 -0
- package/dist/components/Separator/index.d.ts +17 -0
- package/dist/components/Separator/index.js +76 -0
- package/dist/components/Skeleton/Block.d.ts +3 -0
- package/dist/components/Skeleton/Block.js +30 -0
- package/dist/components/Skeleton/Blocks.d.ts +4 -0
- package/dist/components/Skeleton/Blocks.js +28 -0
- package/dist/components/Skeleton/BoxWithIcon.d.ts +4 -0
- package/dist/components/Skeleton/BoxWithIcon.js +29 -0
- package/dist/components/Skeleton/Donut.d.ts +1 -0
- package/dist/components/Skeleton/Donut.js +36 -0
- package/dist/components/Skeleton/IconSkeleton.d.ts +5 -0
- package/dist/components/Skeleton/IconSkeleton.js +12 -0
- package/dist/components/Skeleton/Line.d.ts +5 -0
- package/dist/components/Skeleton/Line.js +13 -0
- package/dist/components/Skeleton/List.d.ts +4 -0
- package/dist/components/Skeleton/List.js +29 -0
- package/dist/components/Skeleton/Slider.d.ts +3 -0
- package/dist/components/Skeleton/Slider.js +26 -0
- package/dist/components/Skeleton/Square.d.ts +5 -0
- package/dist/components/Skeleton/Square.js +10 -0
- package/dist/components/Skeleton/index.d.ts +47 -0
- package/dist/components/Skeleton/index.js +86 -0
- package/dist/components/Snippet/index.d.ts +23 -0
- package/dist/components/Snippet/index.js +171 -0
- package/dist/components/Stack/index.d.ts +23 -0
- package/dist/components/Stack/index.js +36 -0
- package/dist/components/Status/index.d.ts +32 -0
- package/dist/components/Status/index.js +57 -0
- package/dist/components/StepList/index.d.ts +33 -0
- package/dist/components/StepList/index.js +69 -0
- package/dist/components/Stepper/index.d.ts +15 -0
- package/dist/components/Stepper/index.js +153 -0
- package/dist/components/SwitchButton/FocusOverlay.d.ts +8 -0
- package/dist/components/SwitchButton/FocusOverlay.js +47 -0
- package/dist/components/SwitchButton/index.d.ts +26 -0
- package/dist/components/SwitchButton/index.js +140 -0
- package/dist/components/Table/Body.d.ts +6 -0
- package/dist/components/Table/Body.js +5 -0
- package/dist/components/Table/Cell.d.ts +9 -0
- package/dist/components/Table/Cell.js +10 -0
- package/dist/components/Table/Header.d.ts +6 -0
- package/dist/components/Table/Header.js +9 -0
- package/dist/components/Table/HeaderCell.d.ts +14 -0
- package/dist/components/Table/HeaderCell.js +123 -0
- package/dist/components/Table/HeaderRow.d.ts +7 -0
- package/dist/components/Table/HeaderRow.js +25 -0
- package/dist/components/Table/Row.d.ts +14 -0
- package/dist/components/Table/Row.js +85 -0
- package/dist/components/Table/SelectBar.d.ts +15 -0
- package/dist/components/Table/SelectBar.js +35 -0
- package/dist/components/Table/SkeletonRows.d.ts +7 -0
- package/dist/components/Table/SkeletonRows.js +22 -0
- package/dist/components/Table/TableContext.d.ts +27 -0
- package/dist/components/Table/TableContext.js +103 -0
- package/dist/components/Table/index.d.ts +60 -0
- package/dist/components/Table/index.js +81 -0
- package/dist/components/Tabs/Tab.d.ts +20 -0
- package/dist/components/Tabs/Tab.js +170 -0
- package/dist/components/Tabs/TabMenu.d.ts +8 -0
- package/dist/components/Tabs/TabMenu.js +63 -0
- package/dist/components/Tabs/TabMenuItem.d.ts +20 -0
- package/dist/components/Tabs/TabMenuItem.js +39 -0
- package/dist/components/Tabs/TabsContext.d.ts +8 -0
- package/dist/components/Tabs/TabsContext.js +9 -0
- package/dist/components/Tabs/index.d.ts +50 -0
- package/dist/components/Tabs/index.js +137 -0
- package/dist/components/Tag/index.d.ts +26 -0
- package/dist/components/Tag/index.js +153 -0
- package/dist/components/TagInput/index.d.ts +55 -0
- package/dist/components/TagInput/index.js +316 -0
- package/dist/components/TagList/index.d.ts +37 -0
- package/dist/components/TagList/index.js +103 -0
- package/dist/components/Text/index.d.ts +40 -0
- package/dist/components/Text/index.js +107 -0
- package/dist/components/TextArea/index.d.ts +50 -0
- package/dist/components/TextArea/index.js +226 -0
- package/dist/components/TextInput/index.d.ts +75 -0
- package/dist/components/TextInput/index.js +472 -0
- package/dist/components/TextInputV2/index.d.ts +30 -0
- package/dist/components/TextInputV2/index.js +314 -0
- package/dist/components/TimeInput/index.d.ts +25 -0
- package/dist/components/TimeInput/index.js +199 -0
- package/dist/components/Toaster/index.d.ts +46 -0
- package/dist/components/Toaster/index.js +131 -0
- package/dist/components/Toaster/react-toastify.css.js +4 -0
- package/dist/components/Toggle/index.d.ts +34 -0
- package/dist/components/Toggle/index.js +196 -0
- package/dist/components/ToggleGroup/index.d.ts +24 -0
- package/dist/components/ToggleGroup/index.js +87 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +47 -0
- package/dist/components/VerificationCode/index.d.ts +36 -0
- package/dist/components/VerificationCode/index.js +222 -0
- package/dist/components/index.d.ts +75 -0
- package/dist/helpers/isJSON.d.ts +2 -0
- package/dist/{src/helpers → helpers}/isJSON.js +4 -3
- package/dist/helpers/jestMockMatchMedia.d.ts +6 -0
- package/dist/helpers/keycode.d.ts +3 -0
- package/dist/helpers/legend.d.ts +2 -0
- package/dist/helpers/legend.js +14 -0
- package/dist/helpers/numbers.d.ts +2 -0
- package/dist/helpers/recursivelyGetChildrenString.d.ts +3 -0
- package/dist/helpers/recursivelyGetChildrenString.js +15 -0
- package/dist/hooks/useIsOverflowing.d.ts +5 -0
- package/dist/hooks/useIsOverflowing.js +23 -0
- package/dist/index.d.ts +4 -3693
- package/dist/index.js +187 -0
- package/dist/mocks/list.d.ts +12 -0
- package/dist/theme/index.d.ts +1573 -0
- package/dist/theme/index.js +30 -0
- package/dist/types.d.ts +6 -0
- package/dist/utils/animations.d.ts +27 -0
- package/dist/{src/utils → utils}/animations.js +30 -4
- package/dist/utils/capitalize.d.ts +2 -0
- package/dist/utils/capitalize.js +4 -0
- package/dist/utils/ids.d.ts +1 -0
- package/dist/utils/ids.js +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/normalize.d.ts +2 -0
- package/dist/{src/utils → utils}/normalize.js +4 -3
- package/dist/utils/orderBy.d.ts +2 -0
- package/dist/utils/responsive/Breakpoint.d.ts +9 -0
- package/dist/utils/responsive/Breakpoint.js +13 -0
- package/dist/utils/responsive/index.d.ts +2 -0
- package/dist/utils/responsive/utilities.d.ts +3 -0
- package/dist/{src/utils → utils}/responsive/utilities.js +9 -6
- package/package.json +23 -13
- package/dist/react-datepicker/dist/react-datepicker.min.css.js +0 -3
- package/dist/react-toastify/dist/ReactToastify.min.css.js +0 -3
- package/dist/src/components/ActionBar/index.js +0 -40
- package/dist/src/components/Alert/index.js +0 -133
- package/dist/src/components/Avatar/index.js +0 -74
- package/dist/src/components/Badge/index.js +0 -116
- package/dist/src/components/Banner/assets/default-image-small.svg.js +0 -5
- package/dist/src/components/Banner/assets/default-image.svg.js +0 -5
- package/dist/src/components/Banner/index.js +0 -159
- package/dist/src/components/BarChart/Tooltip.js +0 -48
- package/dist/src/components/BarChart/index.js +0 -95
- package/dist/src/components/BarStack/index.js +0 -136
- package/dist/src/components/Breadcrumbs/index.js +0 -82
- package/dist/src/components/Bullet/index.js +0 -98
- package/dist/src/components/Button/index.js +0 -311
- package/dist/src/components/Card/index.js +0 -67
- package/dist/src/components/Carousel/index.js +0 -128
- package/dist/src/components/Checkbox/index.js +0 -316
- package/dist/src/components/CheckboxGroup/index.js +0 -143
- package/dist/src/components/CopyButton/index.js +0 -37
- package/dist/src/components/DateInput/index.js +0 -242
- package/dist/src/components/Dialog/Context.js +0 -12
- package/dist/src/components/Dialog/index.js +0 -88
- package/dist/src/components/Dialog/subComponents/Button.js +0 -21
- package/dist/src/components/Dialog/subComponents/Buttons.js +0 -14
- package/dist/src/components/Dialog/subComponents/CancelButton.js +0 -14
- package/dist/src/components/Dialog/subComponents/Stack.js +0 -11
- package/dist/src/components/Dialog/subComponents/Text.js +0 -12
- package/dist/src/components/EmptyState/index.js +0 -112
- package/dist/src/components/Expandable/index.js +0 -96
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +0 -38
- package/dist/src/components/GlobalAlert/index.js +0 -82
- package/dist/src/components/LineChart/CustomLegend.js +0 -138
- package/dist/src/components/LineChart/Tooltip.js +0 -43
- package/dist/src/components/LineChart/helpers.js +0 -40
- package/dist/src/components/LineChart/index.js +0 -131
- package/dist/src/components/Link/index.js +0 -147
- package/dist/src/components/List/Body.js +0 -16
- package/dist/src/components/List/Cell.js +0 -43
- package/dist/src/components/List/HeaderCell.js +0 -90
- package/dist/src/components/List/HeaderRow.js +0 -43
- package/dist/src/components/List/ListContext.js +0 -138
- package/dist/src/components/List/Row.js +0 -185
- package/dist/src/components/List/SelectBar.js +0 -48
- package/dist/src/components/List/SkeletonRows.js +0 -53
- package/dist/src/components/List/index.js +0 -75
- package/dist/src/components/Loader/index.js +0 -100
- package/dist/src/components/Menu/Item.js +0 -112
- package/dist/src/components/Menu/index.js +0 -129
- package/dist/src/components/MenuV2/Group.js +0 -25
- package/dist/src/components/MenuV2/Item.js +0 -139
- package/dist/src/components/MenuV2/index.js +0 -116
- package/dist/src/components/Meter/index.js +0 -76
- package/dist/src/components/Modal/Dialog.js +0 -182
- package/dist/src/components/Modal/index.js +0 -113
- package/dist/src/components/Notice/index.js +0 -34
- package/dist/src/components/Notification/index.js +0 -77
- package/dist/src/components/NumberInput/index.js +0 -299
- package/dist/src/components/NumberInputV2/index.js +0 -284
- package/dist/src/components/Pagination/index.js +0 -117
- package/dist/src/components/PasswordCheck/index.js +0 -41
- package/dist/src/components/PasswordStrengthMeter/index.js +0 -102
- package/dist/src/components/PieChart/Legends.js +0 -138
- package/dist/src/components/PieChart/Tooltip.js +0 -61
- package/dist/src/components/PieChart/index.js +0 -125
- package/dist/src/components/Popover/index.js +0 -144
- package/dist/src/components/Popup/helpers.js +0 -252
- package/dist/src/components/Popup/index.js +0 -363
- package/dist/src/components/ProgressBar/index.js +0 -57
- package/dist/src/components/Radio/index.js +0 -157
- package/dist/src/components/RadioGroup/index.js +0 -131
- package/dist/src/components/Row/index.js +0 -41
- package/dist/src/components/SelectInput/index.js +0 -610
- package/dist/src/components/SelectInputV2/Dropdown.js +0 -594
- package/dist/src/components/SelectInputV2/DropdownOption.js +0 -130
- package/dist/src/components/SelectInputV2/SearchBarDropdown.js +0 -128
- package/dist/src/components/SelectInputV2/SelectBar.js +0 -282
- package/dist/src/components/SelectInputV2/SelectInputProvider.js +0 -169
- package/dist/src/components/SelectInputV2/findOptionInOptions.js +0 -11
- package/dist/src/components/SelectInputV2/index.js +0 -137
- package/dist/src/components/SelectableCard/index.js +0 -175
- package/dist/src/components/SelectableCardGroup/index.js +0 -141
- package/dist/src/components/Separator/index.js +0 -73
- package/dist/src/components/Skeleton/Block.js +0 -35
- package/dist/src/components/Skeleton/Blocks.js +0 -34
- package/dist/src/components/Skeleton/BoxWithIcon.js +0 -32
- package/dist/src/components/Skeleton/Donut.js +0 -55
- package/dist/src/components/Skeleton/IconSkeleton.js +0 -19
- package/dist/src/components/Skeleton/Line.js +0 -13
- package/dist/src/components/Skeleton/List.js +0 -51
- package/dist/src/components/Skeleton/Slider.js +0 -36
- package/dist/src/components/Skeleton/Square.js +0 -9
- package/dist/src/components/Skeleton/index.js +0 -82
- package/dist/src/components/Snippet/index.js +0 -200
- package/dist/src/components/Stack/index.js +0 -29
- package/dist/src/components/Status/index.js +0 -74
- package/dist/src/components/StepList/index.js +0 -69
- package/dist/src/components/Stepper/index.js +0 -150
- package/dist/src/components/SwitchButton/FocusOverlay.js +0 -37
- package/dist/src/components/SwitchButton/index.js +0 -108
- package/dist/src/components/Table/Body.js +0 -9
- package/dist/src/components/Table/Cell.js +0 -21
- package/dist/src/components/Table/Header.js +0 -15
- package/dist/src/components/Table/HeaderCell.js +0 -103
- package/dist/src/components/Table/HeaderRow.js +0 -32
- package/dist/src/components/Table/Row.js +0 -89
- package/dist/src/components/Table/SelectBar.js +0 -48
- package/dist/src/components/Table/SkeletonRows.js +0 -51
- package/dist/src/components/Table/TableContext.js +0 -90
- package/dist/src/components/Table/index.js +0 -82
- package/dist/src/components/Tabs/Tab.js +0 -138
- package/dist/src/components/Tabs/TabMenu.js +0 -59
- package/dist/src/components/Tabs/TabMenuItem.js +0 -36
- package/dist/src/components/Tabs/TabsContext.js +0 -6
- package/dist/src/components/Tabs/index.js +0 -117
- package/dist/src/components/Tag/index.js +0 -169
- package/dist/src/components/TagInput/index.js +0 -309
- package/dist/src/components/TagList/index.js +0 -106
- package/dist/src/components/Text/index.js +0 -107
- package/dist/src/components/TextArea/index.js +0 -210
- package/dist/src/components/TextInput/index.js +0 -451
- package/dist/src/components/TextInputV2/index.js +0 -289
- package/dist/src/components/TimeInput/index.js +0 -37
- package/dist/src/components/Toaster/index.js +0 -131
- package/dist/src/components/Toggle/index.js +0 -160
- package/dist/src/components/ToggleGroup/index.js +0 -122
- package/dist/src/components/Tooltip/index.js +0 -55
- package/dist/src/components/VerificationCode/index.js +0 -222
- package/dist/src/helpers/legend.js +0 -13
- package/dist/src/helpers/recursivelyGetChildrenString.js +0 -11
- package/dist/src/hooks/useIsOverflowing.js +0 -34
- package/dist/src/index.js +0 -77
- package/dist/src/theme/index.js +0 -29
- package/dist/src/utils/capitalize.js +0 -3
- package/dist/src/utils/ids.js +0 -7
- package/dist/src/utils/responsive/Breakpoint.js +0 -12
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Text } from "../Text/index.js";
|
|
4
|
+
const LineTooltipContainer = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundStronger};
|
|
7
|
+
border-radius: ${({ theme }) => theme.radii.small};
|
|
8
|
+
box-shadow: ${({ theme }) => theme.shadows.tooltip};
|
|
9
|
+
padding: 5px 9px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`;
|
|
12
|
+
const LineColorSquare = styled.span`
|
|
13
|
+
display: block;
|
|
14
|
+
width: 12px;
|
|
15
|
+
height: 12px;
|
|
16
|
+
background: ${({ color }) => color};
|
|
17
|
+
margin-right: 12px;
|
|
18
|
+
`;
|
|
19
|
+
const LineChartTooltip = ({ point }) => /* @__PURE__ */ jsxs(LineTooltipContainer, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(LineColorSquare, { color: point.serieColor }) }),
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
Text,
|
|
24
|
+
{
|
|
25
|
+
variant: "bodyStronger",
|
|
26
|
+
sentiment: "neutral",
|
|
27
|
+
prominence: "stronger",
|
|
28
|
+
as: "div",
|
|
29
|
+
children: point.data.yFormatted
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
Text,
|
|
34
|
+
{
|
|
35
|
+
variant: "bodySmall",
|
|
36
|
+
sentiment: "neutral",
|
|
37
|
+
prominence: "stronger",
|
|
38
|
+
as: "div",
|
|
39
|
+
children: point.data.xFormatted
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
export {
|
|
45
|
+
LineChartTooltip
|
|
46
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DatumValue, Serie } from '@nivo/line';
|
|
2
|
+
export declare const getMin: (values?: DatumValue[]) => number;
|
|
3
|
+
export declare const getMax: (values?: DatumValue[]) => number;
|
|
4
|
+
export declare const getAverage: (values?: DatumValue[]) => number;
|
|
5
|
+
export declare const getMaxChartValue: (preppedData?: Serie[]) => number;
|
|
6
|
+
export declare const getMinChartValue: (preppedData?: Serie[]) => number;
|
|
7
|
+
export declare const getCurrent: (values?: number[]) => number;
|
|
8
|
+
export declare const getSelected: (label: string, index: number, selected?: string[]) => string[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const parse = (data) => {
|
|
2
|
+
if (typeof data === "number")
|
|
3
|
+
return data || 0;
|
|
4
|
+
if (typeof data === "string")
|
|
5
|
+
return parseFloat(data) || 0;
|
|
6
|
+
if (data instanceof Date)
|
|
7
|
+
return data.getTime();
|
|
8
|
+
return 0;
|
|
9
|
+
};
|
|
10
|
+
const getMin = (values = []) => values.length ? Math.min(...values.map(parse)) : 0;
|
|
11
|
+
const getMax = (values = []) => values.length ? Math.max(...values.map(parse)) : 0;
|
|
12
|
+
const getAverage = (values = []) => values.length ? Math.round(
|
|
13
|
+
values.reduce((sum, curr) => sum + parse(curr), 0) / values.length * 100
|
|
14
|
+
) / 100 : 0;
|
|
15
|
+
const getMaxChartValue = (preppedData) => {
|
|
16
|
+
if (!preppedData?.length)
|
|
17
|
+
return 0;
|
|
18
|
+
const maximum = Math.max(
|
|
19
|
+
...preppedData.map(({ data }) => getMax(data.map(({ y }) => y || 0)))
|
|
20
|
+
);
|
|
21
|
+
return Math.ceil(maximum + maximum * 0.1);
|
|
22
|
+
};
|
|
23
|
+
const getMinChartValue = (preppedData) => {
|
|
24
|
+
if (!preppedData?.length)
|
|
25
|
+
return 0;
|
|
26
|
+
const minimum = Math.min(
|
|
27
|
+
...preppedData.map(({ data }) => getMin(data.map(({ y }) => y || 0)))
|
|
28
|
+
);
|
|
29
|
+
return Math.floor(minimum - minimum * 0.1);
|
|
30
|
+
};
|
|
31
|
+
const getCurrent = (values = []) => values.length ? values[values.length - 1] : 0;
|
|
32
|
+
const getSelected = (label, index, selected = []) => {
|
|
33
|
+
const labelIndexed = label + index.toString();
|
|
34
|
+
const found = selected.indexOf(labelIndexed);
|
|
35
|
+
if (found > -1) {
|
|
36
|
+
selected.splice(found, 1);
|
|
37
|
+
} else {
|
|
38
|
+
selected.push(labelIndexed);
|
|
39
|
+
}
|
|
40
|
+
return selected;
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
getAverage,
|
|
44
|
+
getCurrent,
|
|
45
|
+
getMax,
|
|
46
|
+
getMaxChartValue,
|
|
47
|
+
getMin,
|
|
48
|
+
getMinChartValue,
|
|
49
|
+
getSelected
|
|
50
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DatumValue, Box as NivoBox, ValueFormat } from '@nivo/core';
|
|
2
|
+
import type { LineSvgProps, Serie } from '@nivo/line';
|
|
3
|
+
import type { ScaleSpec } from '@nivo/scales';
|
|
4
|
+
import type { ComponentProps } from 'react';
|
|
5
|
+
import { CustomLegend } from './CustomLegend';
|
|
6
|
+
type LineChartProps = {
|
|
7
|
+
height?: string | number;
|
|
8
|
+
margin?: NivoBox;
|
|
9
|
+
xScale?: ScaleSpec;
|
|
10
|
+
yScale?: ScaleSpec;
|
|
11
|
+
data?: Serie[];
|
|
12
|
+
withLegend?: boolean;
|
|
13
|
+
axisFormatters?: Partial<Record<'bottom' | 'left' | 'right' | 'top', ComponentProps<typeof CustomLegend>['axisTransformer']>>;
|
|
14
|
+
pointFormatters?: Partial<Record<'x' | 'y', ValueFormat<DatumValue>>>;
|
|
15
|
+
tickValues?: Partial<Record<'bottom' | 'left' | 'right' | 'top', number | string>>;
|
|
16
|
+
chartProps?: Partial<LineSvgProps>;
|
|
17
|
+
'data-testid'?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* LineChart component is a wrapper around Nivo's ResponsiveLine component used to display data in a line chart.
|
|
21
|
+
* See https://nivo.rocks/line/ for more information.
|
|
22
|
+
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LineChart: ({ height, margin, xScale, yScale, data, withLegend, axisFormatters, pointFormatters, tickValues, chartProps, "data-testid": dataTestId, }: LineChartProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@emotion/react";
|
|
3
|
+
import { ResponsiveLine } from "@nivo/line";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { getLegendColor } from "../../helpers/legend.js";
|
|
6
|
+
import { CustomLegend } from "./CustomLegend.js";
|
|
7
|
+
import { LineChartTooltip } from "./Tooltip.js";
|
|
8
|
+
import { getMaxChartValue, getMinChartValue } from "./helpers.js";
|
|
9
|
+
const DEFAULT_MARGIN = { bottom: 50, left: 60, right: 25, top: 50 };
|
|
10
|
+
const DEFAULT_XSCALE = {
|
|
11
|
+
format: "%Y-%m-%dT%H:%M:%S%Z",
|
|
12
|
+
// 2021-08-30T02:56:07Z
|
|
13
|
+
precision: "minute",
|
|
14
|
+
type: "time",
|
|
15
|
+
useUTC: false
|
|
16
|
+
};
|
|
17
|
+
const DEFAULT_YSCALE = { type: "linear" };
|
|
18
|
+
const DEFAULT_CHARTPROPS = {};
|
|
19
|
+
const LineChart = ({
|
|
20
|
+
height = "537px",
|
|
21
|
+
// to maintain aspect ratio based on our standard 1074px width
|
|
22
|
+
margin = DEFAULT_MARGIN,
|
|
23
|
+
xScale = DEFAULT_XSCALE,
|
|
24
|
+
yScale = DEFAULT_YSCALE,
|
|
25
|
+
data,
|
|
26
|
+
withLegend = false,
|
|
27
|
+
axisFormatters,
|
|
28
|
+
pointFormatters,
|
|
29
|
+
tickValues,
|
|
30
|
+
chartProps = DEFAULT_CHARTPROPS,
|
|
31
|
+
"data-testid": dataTestId
|
|
32
|
+
}) => {
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const dataset = {
|
|
35
|
+
datasets: data?.map((d) => ({
|
|
36
|
+
data: d.data,
|
|
37
|
+
id: d.id,
|
|
38
|
+
label: d?.["label"]
|
|
39
|
+
}))
|
|
40
|
+
};
|
|
41
|
+
const chartTheme = {
|
|
42
|
+
axis: {
|
|
43
|
+
ticks: {
|
|
44
|
+
line: {
|
|
45
|
+
stroke: theme.colors.neutral.backgroundStrong,
|
|
46
|
+
strokeWidth: 1
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
fontFamily: theme.typography.body.fontFamily,
|
|
51
|
+
fontSize: 12,
|
|
52
|
+
textColor: theme.colors.neutral.textWeak
|
|
53
|
+
};
|
|
54
|
+
const [selected, setSelected] = useState(
|
|
55
|
+
dataset.datasets?.map(({ id }, index) => `${id}${index}`)
|
|
56
|
+
);
|
|
57
|
+
const finalData = dataset.datasets?.filter(
|
|
58
|
+
({ id }, index) => selected ? selected.includes(`${id}${index}`) : false
|
|
59
|
+
);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (selected !== void 0) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setSelected(dataset.datasets?.map(({ id }, index) => `${id}${index}`));
|
|
65
|
+
}, [dataset.datasets, selected]);
|
|
66
|
+
const localColors = getLegendColor(theme);
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx("div", { style: { height }, children: /* @__PURE__ */ jsx(
|
|
69
|
+
ResponsiveLine,
|
|
70
|
+
{
|
|
71
|
+
colors: localColors,
|
|
72
|
+
data: finalData ?? [],
|
|
73
|
+
margin,
|
|
74
|
+
xScale,
|
|
75
|
+
yScale: {
|
|
76
|
+
max: getMaxChartValue(finalData),
|
|
77
|
+
min: getMinChartValue(finalData),
|
|
78
|
+
...yScale
|
|
79
|
+
},
|
|
80
|
+
xFormat: pointFormatters?.x,
|
|
81
|
+
yFormat: pointFormatters?.y,
|
|
82
|
+
axisBottom: {
|
|
83
|
+
format: axisFormatters?.bottom,
|
|
84
|
+
tickPadding: 5,
|
|
85
|
+
tickRotation: 0,
|
|
86
|
+
tickSize: 5,
|
|
87
|
+
tickValues: tickValues?.bottom
|
|
88
|
+
},
|
|
89
|
+
axisLeft: {
|
|
90
|
+
format: axisFormatters?.left,
|
|
91
|
+
tickPadding: 5,
|
|
92
|
+
tickRotation: 0,
|
|
93
|
+
tickSize: 5,
|
|
94
|
+
tickValues: tickValues?.left
|
|
95
|
+
},
|
|
96
|
+
pointSize: 10,
|
|
97
|
+
useMesh: true,
|
|
98
|
+
theme: chartTheme,
|
|
99
|
+
curve: "monotoneX",
|
|
100
|
+
tooltip: LineChartTooltip,
|
|
101
|
+
"data-testid": dataTestId,
|
|
102
|
+
...chartProps
|
|
103
|
+
}
|
|
104
|
+
) }),
|
|
105
|
+
withLegend && /* @__PURE__ */ jsx(
|
|
106
|
+
CustomLegend,
|
|
107
|
+
{
|
|
108
|
+
data: dataset.datasets,
|
|
109
|
+
selected: selected ?? [],
|
|
110
|
+
setSelected,
|
|
111
|
+
axisTransformer: axisFormatters?.left
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] });
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
LineChart
|
|
118
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, HTMLAttributeAnchorTarget, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import type { Color } from '../../theme';
|
|
3
|
+
export declare const PROMINENCES: {
|
|
4
|
+
default: string;
|
|
5
|
+
weak: string;
|
|
6
|
+
strong: string;
|
|
7
|
+
stronger: string;
|
|
8
|
+
};
|
|
9
|
+
export type ProminenceProps = keyof typeof PROMINENCES;
|
|
10
|
+
type LinkSizes = 'large' | 'small';
|
|
11
|
+
type LinkIconPosition = 'left' | 'right';
|
|
12
|
+
type LinkProps = {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
target?: HTMLAttributeAnchorTarget;
|
|
15
|
+
download?: string | boolean;
|
|
16
|
+
sentiment?: Color;
|
|
17
|
+
prominence?: ProminenceProps;
|
|
18
|
+
size?: LinkSizes;
|
|
19
|
+
iconPosition?: LinkIconPosition;
|
|
20
|
+
rel?: AnchorHTMLAttributes<HTMLAnchorElement>['rel'];
|
|
21
|
+
className?: string;
|
|
22
|
+
href: string;
|
|
23
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
oneLine?: boolean;
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
variant?: 'inline' | 'standalone';
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Link is a component used to navigate between pages or to external websites.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { forwardRef, useState, useRef, useEffect } from "react";
|
|
5
|
+
import recursivelyGetChildrenString from "../../helpers/recursivelyGetChildrenString.js";
|
|
6
|
+
import capitalize from "../../utils/capitalize.js";
|
|
7
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
8
|
+
const StyledIcon = styled(Icon)``;
|
|
9
|
+
const PROMINENCES = {
|
|
10
|
+
default: "",
|
|
11
|
+
weak: "weak",
|
|
12
|
+
strong: "strong",
|
|
13
|
+
stronger: "stronger"
|
|
14
|
+
};
|
|
15
|
+
const ICON_SIZE = 16;
|
|
16
|
+
const BLANK_TARGET_ICON_SIZE = 14;
|
|
17
|
+
const TRANSITION_DURATION = 250;
|
|
18
|
+
const StyledExternalIconContainer = styled.span`
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
padding-bottom: ${({ theme }) => theme.space["0.5"]};
|
|
21
|
+
`;
|
|
22
|
+
const StyledLink = styled("a", {
|
|
23
|
+
shouldForwardProp: (prop) => !["sentiment", "iconPosition", "as", "oneLine"].includes(prop)
|
|
24
|
+
})`
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
border: none;
|
|
27
|
+
padding: 0;
|
|
28
|
+
color: ${({ theme, sentiment, prominence }) => {
|
|
29
|
+
const definedProminence = capitalize(PROMINENCES[prominence ?? "default"]);
|
|
30
|
+
theme.colors[sentiment];
|
|
31
|
+
const text = `text${definedProminence}`;
|
|
32
|
+
return theme.colors[sentiment]?.[text] ?? theme.colors.neutral.text;
|
|
33
|
+
}};
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
text-decoration-thickness: 1px;
|
|
36
|
+
text-underline-offset: 2px;
|
|
37
|
+
text-decoration-color: transparent;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
align-items: center;
|
|
41
|
+
transition: text-decoration-color ${TRANSITION_DURATION}ms ease-out;
|
|
42
|
+
|
|
43
|
+
${StyledIcon} {
|
|
44
|
+
transition: transform ${TRANSITION_DURATION}ms ease-out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
gap: ${({ theme }) => theme.space["1"]};
|
|
48
|
+
position: relative;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
|
|
51
|
+
> * {
|
|
52
|
+
// Safari issue when something is inside an anchor
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${({ oneLine }) => oneLine ? `white-space: nowrap;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
display: block;` : "width: fit-content;"}
|
|
60
|
+
|
|
61
|
+
${({ size, theme }) => {
|
|
62
|
+
const variant = size === "small" ? "bodySmallStrong" : "bodyStrong";
|
|
63
|
+
return `
|
|
64
|
+
font-size: ${theme.typography[variant].fontSize};
|
|
65
|
+
font-family: ${theme.typography[variant].fontFamily};
|
|
66
|
+
font-weight: ${theme.typography[variant].weight};
|
|
67
|
+
letter-spacing: ${theme.typography[variant].letterSpacing};
|
|
68
|
+
line-height: ${theme.typography[variant].lineHeight};
|
|
69
|
+
paragraph-spacing: ${theme.typography[variant].paragraphSpacing};
|
|
70
|
+
text-case: ${theme.typography[variant].textCase};
|
|
71
|
+
`;
|
|
72
|
+
}}
|
|
73
|
+
&:hover,
|
|
74
|
+
&:focus {
|
|
75
|
+
${StyledIcon} {
|
|
76
|
+
transform: ${({ theme, iconPosition }) => iconPosition === "left" ? `translate(${theme.space["0.5"]}, 0)` : `translate(-${theme.space["0.5"]}, 0)`};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
outline: none;
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
text-decoration-thickness: 1px;
|
|
82
|
+
${({ theme, sentiment, prominence }) => {
|
|
83
|
+
const definedProminence = capitalize(PROMINENCES[prominence ?? "default"]);
|
|
84
|
+
theme.colors[sentiment];
|
|
85
|
+
const text = `text${definedProminence}Hover`;
|
|
86
|
+
return `
|
|
87
|
+
color: ${theme.colors[sentiment]?.[text] ?? theme.colors.neutral.textHover};
|
|
88
|
+
text-decoration-color: ${theme.colors[sentiment]?.[text] ?? theme.colors.neutral.textHover};`;
|
|
89
|
+
}}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&[data-variant='inline'] {
|
|
93
|
+
text-decoration: underline;
|
|
94
|
+
text-decoration-thickness: 1px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:hover::after,
|
|
98
|
+
&:focus::after {
|
|
99
|
+
background-color: ${({ theme, sentiment }) => theme.colors[sentiment]?.text ?? theme.colors.neutral.text};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:active {
|
|
103
|
+
text-decoration-thickness: 2px;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const Link = forwardRef(
|
|
107
|
+
({
|
|
108
|
+
children,
|
|
109
|
+
href,
|
|
110
|
+
target,
|
|
111
|
+
download,
|
|
112
|
+
sentiment = "info",
|
|
113
|
+
prominence,
|
|
114
|
+
size = "large",
|
|
115
|
+
iconPosition,
|
|
116
|
+
rel,
|
|
117
|
+
className,
|
|
118
|
+
onClick,
|
|
119
|
+
"aria-label": ariaLabel,
|
|
120
|
+
oneLine = false,
|
|
121
|
+
"data-testid": dataTestId,
|
|
122
|
+
variant = "standalone"
|
|
123
|
+
}, ref) => {
|
|
124
|
+
const isBlank = target === "_blank";
|
|
125
|
+
const computedRel = rel || (isBlank ? "noopener noreferrer" : void 0);
|
|
126
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
127
|
+
const elementRef = useRef(null);
|
|
128
|
+
const usedRef = ref ?? elementRef;
|
|
129
|
+
const finalStringChildren = recursivelyGetChildrenString(children);
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (oneLine && usedRef?.current) {
|
|
132
|
+
const { offsetWidth, scrollWidth } = usedRef.current;
|
|
133
|
+
setIsTruncated(offsetWidth < scrollWidth);
|
|
134
|
+
}
|
|
135
|
+
}, [oneLine, ref, usedRef]);
|
|
136
|
+
return /* @__PURE__ */ jsx(Tooltip, { text: oneLine && isTruncated ? finalStringChildren : "", children: /* @__PURE__ */ jsxs(
|
|
137
|
+
StyledLink,
|
|
138
|
+
{
|
|
139
|
+
href,
|
|
140
|
+
target,
|
|
141
|
+
download,
|
|
142
|
+
ref: usedRef,
|
|
143
|
+
sentiment,
|
|
144
|
+
prominence,
|
|
145
|
+
rel: computedRel,
|
|
146
|
+
className,
|
|
147
|
+
size,
|
|
148
|
+
onClick,
|
|
149
|
+
iconPosition,
|
|
150
|
+
"aria-label": ariaLabel,
|
|
151
|
+
oneLine,
|
|
152
|
+
"data-testid": dataTestId,
|
|
153
|
+
"data-variant": variant,
|
|
154
|
+
children: [
|
|
155
|
+
!isBlank && iconPosition === "left" ? /* @__PURE__ */ jsx(StyledIcon, { name: "arrow-left", size: ICON_SIZE }) : null,
|
|
156
|
+
children,
|
|
157
|
+
isBlank ? /* @__PURE__ */ jsx(StyledExternalIconContainer, { children: /* @__PURE__ */ jsx(StyledIcon, { name: "open-in-new", size: BLANK_TARGET_ICON_SIZE }) }) : null,
|
|
158
|
+
!isBlank && iconPosition === "right" ? /* @__PURE__ */ jsx(StyledIcon, { name: "arrow-right", size: ICON_SIZE }) : null
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
) });
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
export {
|
|
165
|
+
Link,
|
|
166
|
+
PROMINENCES
|
|
167
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
const StyledBody = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: ${({ theme }) => theme.space["2"]};
|
|
7
|
+
`;
|
|
8
|
+
const Body = ({ children }) => /* @__PURE__ */ jsx(StyledBody, { role: "rowgroup", children });
|
|
9
|
+
export {
|
|
10
|
+
Body
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type CellProps = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Use this if you want to prevent onClick to be handled by parents (Like when you have an expandable content)
|
|
7
|
+
* */
|
|
8
|
+
preventClick?: boolean;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const Cell: import("react").ForwardRefExoticComponent<CellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
const StyledCell = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
min-height: 60px;
|
|
9
|
+
`;
|
|
10
|
+
const Cell = forwardRef(
|
|
11
|
+
({ children, className, preventClick, "data-testid": dataTestid }, ref) => {
|
|
12
|
+
const handleClick = (event) => {
|
|
13
|
+
if (preventClick) {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const handleKeyDown = (event) => {
|
|
18
|
+
if (preventClick) {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
StyledCell,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
role: "cell",
|
|
27
|
+
className,
|
|
28
|
+
onClick: handleClick,
|
|
29
|
+
onKeyDown: handleKeyDown,
|
|
30
|
+
"data-testid": dataTestid,
|
|
31
|
+
children
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
Cell
|
|
38
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type HeaderCellProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
isOrdered?: boolean;
|
|
6
|
+
orderDirection?: 'asc' | 'desc' | 'none';
|
|
7
|
+
onOrder?: (newOrder: 'asc' | 'desc') => void;
|
|
8
|
+
info?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const HeaderCell: ({ children, isOrdered, orderDirection, onOrder, className, info, }: HeaderCellProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { Stack } from "../Stack/index.js";
|
|
5
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
6
|
+
const ArrowDownIcon = styled(Icon)``;
|
|
7
|
+
const ArrowUpIcon = styled(Icon)``;
|
|
8
|
+
const StyledIconContainer = styled(Stack)`
|
|
9
|
+
color: ${({ theme }) => theme.colors.neutral.text};
|
|
10
|
+
|
|
11
|
+
&[aria-disabled='true'] {
|
|
12
|
+
cursor: not-allowed;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const SortIcon = () => /* @__PURE__ */ jsxs(StyledIconContainer, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx(ArrowUpIcon, { name: "arrow-up", size: 10 }),
|
|
17
|
+
/* @__PURE__ */ jsx(ArrowDownIcon, { name: "arrow-down", size: 10 })
|
|
18
|
+
] });
|
|
19
|
+
const StyledHeaderCell = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
text-align: left;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
align-items: center;
|
|
24
|
+
font-size: ${({ theme }) => theme.typography.bodySmall.fontSize};
|
|
25
|
+
font-weight: ${({ theme }) => theme.typography.bodySmall.weight};
|
|
26
|
+
font-family: ${({ theme }) => theme.typography.bodySmall.fontFamily};
|
|
27
|
+
color: ${({ theme }) => theme.colors.neutral.text};
|
|
28
|
+
gap: ${({ theme }) => theme.space["1"]};
|
|
29
|
+
|
|
30
|
+
&[role*='button'] {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
user-select: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[aria-sort] {
|
|
36
|
+
color: ${({ theme }) => theme.colors.primary.text};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[aria-sort='ascending'] ${ArrowUpIcon} {
|
|
40
|
+
color: ${({ theme }) => theme.colors.primary.text};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[aria-sort='descending'] ${ArrowDownIcon} {
|
|
44
|
+
color: ${({ theme }) => theme.colors.primary.text};
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const HeaderCell = ({
|
|
48
|
+
children,
|
|
49
|
+
isOrdered,
|
|
50
|
+
orderDirection,
|
|
51
|
+
onOrder,
|
|
52
|
+
className,
|
|
53
|
+
info
|
|
54
|
+
}) => {
|
|
55
|
+
let order;
|
|
56
|
+
if (isOrdered && orderDirection === "asc") {
|
|
57
|
+
order = "ascending";
|
|
58
|
+
} else if (isOrdered && orderDirection === "desc") {
|
|
59
|
+
order = "descending";
|
|
60
|
+
}
|
|
61
|
+
const handleOrder = onOrder ? () => onOrder(order === "ascending" ? "desc" : "asc") : void 0;
|
|
62
|
+
return /* @__PURE__ */ jsxs(
|
|
63
|
+
StyledHeaderCell,
|
|
64
|
+
{
|
|
65
|
+
"aria-sort": order,
|
|
66
|
+
className,
|
|
67
|
+
onClick: handleOrder,
|
|
68
|
+
onKeyDown: handleOrder ? (event) => {
|
|
69
|
+
if (event.key === " " || event.key === "Enter") {
|
|
70
|
+
handleOrder();
|
|
71
|
+
if (event.key === " ") {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} : void 0,
|
|
76
|
+
role: onOrder ? "button columnheader" : void 0,
|
|
77
|
+
tabIndex: handleOrder ? 0 : -1,
|
|
78
|
+
children: [
|
|
79
|
+
children,
|
|
80
|
+
info ? /* @__PURE__ */ jsx(Tooltip, { text: info, children: /* @__PURE__ */ jsx(
|
|
81
|
+
Icon,
|
|
82
|
+
{
|
|
83
|
+
name: "information-outline",
|
|
84
|
+
size: 20,
|
|
85
|
+
prominence: "weak",
|
|
86
|
+
color: "neutral"
|
|
87
|
+
}
|
|
88
|
+
) }) : null,
|
|
89
|
+
orderDirection !== void 0 && isOrdered !== void 0 ? /* @__PURE__ */ jsx(SortIcon, { "data-sorted": order !== void 0 }) : null
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
HeaderCell
|
|
96
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Checkbox } from "../Checkbox/index.js";
|
|
4
|
+
import { HeaderCell } from "./HeaderCell.js";
|
|
5
|
+
import { useListContext } from "./ListContext.js";
|
|
6
|
+
const StyledHeaderRow = styled.div`
|
|
7
|
+
/* List itself also apply style about common templating between HeaderRow and other Rows */
|
|
8
|
+
column-gap: ${({ theme }) => theme.space["2"]};
|
|
9
|
+
padding: 0 ${({ theme }) => theme.space["2"]};
|
|
10
|
+
`;
|
|
11
|
+
const HeaderRow = ({ children, hasSelectAllColumn }) => {
|
|
12
|
+
const {
|
|
13
|
+
allRowSelectValue,
|
|
14
|
+
selectAll,
|
|
15
|
+
unselectAll,
|
|
16
|
+
selectedRowIds,
|
|
17
|
+
expandButton
|
|
18
|
+
} = useListContext();
|
|
19
|
+
const selectableRowCount = Object.keys(selectedRowIds).length;
|
|
20
|
+
return /* @__PURE__ */ jsxs(StyledHeaderRow, { role: "row", children: [
|
|
21
|
+
hasSelectAllColumn ? /* @__PURE__ */ jsx(HeaderCell, { children: /* @__PURE__ */ jsx(
|
|
22
|
+
Checkbox,
|
|
23
|
+
{
|
|
24
|
+
name: "list-select-checkbox",
|
|
25
|
+
value: "all",
|
|
26
|
+
"aria-label": "select all",
|
|
27
|
+
checked: allRowSelectValue,
|
|
28
|
+
onChange: allRowSelectValue === false ? selectAll : unselectAll,
|
|
29
|
+
disabled: selectableRowCount === 0
|
|
30
|
+
}
|
|
31
|
+
) }) : null,
|
|
32
|
+
expandButton ? /* @__PURE__ */ jsx(HeaderCell, { children: null }) : null,
|
|
33
|
+
children
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
HeaderRow
|
|
38
|
+
};
|