@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
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { Icon } from '@ultraviolet/icons';
|
|
3
|
-
import useClipboard from 'react-use-clipboard';
|
|
4
|
-
import { Button } from '../Button/index.js';
|
|
5
|
-
import { Loader } from '../Loader/index.js';
|
|
6
|
-
import { Text } from '../Text/index.js';
|
|
7
|
-
import { Tooltip } from '../Tooltip/index.js';
|
|
8
|
-
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
|
-
const COPY_DURATION = 2500;
|
|
12
|
-
const StyledContainer = /*#__PURE__*/_styled('span', {
|
|
13
|
-
shouldForwardProp: prop => !['sentiment', 'copiable'].includes(prop),
|
|
14
|
-
target: "el6733p2"
|
|
15
|
-
})("display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:", ({
|
|
16
|
-
theme
|
|
17
|
-
}) => theme.radii.default, ";padding:0 ", ({
|
|
18
|
-
theme
|
|
19
|
-
}) => theme.space['1'], ";gap:", ({
|
|
20
|
-
theme
|
|
21
|
-
}) => theme.space['1'], ";width:fit-content;height:24px;", ({
|
|
22
|
-
copiable,
|
|
23
|
-
theme
|
|
24
|
-
}) => copiable && `
|
|
25
|
-
&:hover, &:active {
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
background: ${theme.colors.neutral.backgroundWeakHover};
|
|
28
|
-
border-color: ${theme.colors.neutral.borderStrongHover};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:active {
|
|
32
|
-
box-shadow: ${theme.shadows.focusNeutral};
|
|
33
|
-
}
|
|
34
|
-
`, " ", ({
|
|
35
|
-
sentiment,
|
|
36
|
-
theme
|
|
37
|
-
}) => {
|
|
38
|
-
if (sentiment === 'disabled') {
|
|
39
|
-
return `
|
|
40
|
-
color: ${theme.colors.neutral.textDisabled};
|
|
41
|
-
background: ${theme.colors.neutral.backgroundDisabled};
|
|
42
|
-
border: solid 1px ${theme.colors.neutral.borderDisabled};
|
|
43
|
-
cursor: not-allowed
|
|
44
|
-
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
if (sentiment === 'neutral') {
|
|
48
|
-
return `
|
|
49
|
-
color: ${theme.colors.neutral.text};
|
|
50
|
-
background: ${theme.colors.neutral.background};
|
|
51
|
-
border: solid 1px ${theme.colors.neutral.border};
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
return `
|
|
55
|
-
color: ${theme.colors[sentiment].text};
|
|
56
|
-
background: ${theme.colors[sentiment].background};
|
|
57
|
-
border: solid 1px ${theme.colors[sentiment].background};
|
|
58
|
-
`;
|
|
59
|
-
}, ";");
|
|
60
|
-
const StyledText = /*#__PURE__*/_styled(Text, {
|
|
61
|
-
target: "el6733p1"
|
|
62
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
63
|
-
name: "12vzl34",
|
|
64
|
-
styles: "max-width:232px"
|
|
65
|
-
} : {
|
|
66
|
-
name: "12vzl34",
|
|
67
|
-
styles: "max-width:232px",
|
|
68
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
69
|
-
});
|
|
70
|
-
const StyledCloseButton = /*#__PURE__*/_styled(Button, {
|
|
71
|
-
target: "el6733p0"
|
|
72
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
73
|
-
name: "1z1k76",
|
|
74
|
-
styles: "width:fit-content;height:fit-content;padding:2px"
|
|
75
|
-
} : {
|
|
76
|
-
name: "1z1k76",
|
|
77
|
-
styles: "width:fit-content;height:fit-content;padding:2px",
|
|
78
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
79
|
-
});
|
|
80
|
-
const TagInner = ({
|
|
81
|
-
children,
|
|
82
|
-
isLoading = false,
|
|
83
|
-
onClose,
|
|
84
|
-
icon,
|
|
85
|
-
disabled = false
|
|
86
|
-
}) => jsxs(Fragment, {
|
|
87
|
-
children: [icon ? jsx(Icon, {
|
|
88
|
-
name: icon,
|
|
89
|
-
size: 16
|
|
90
|
-
}) : null, jsx(StyledText, {
|
|
91
|
-
as: "span",
|
|
92
|
-
variant: "caption",
|
|
93
|
-
oneLine: true,
|
|
94
|
-
"aria-disabled": disabled,
|
|
95
|
-
children: children
|
|
96
|
-
}), onClose && !isLoading ? jsx(StyledCloseButton, {
|
|
97
|
-
onClick: onClose,
|
|
98
|
-
disabled: disabled,
|
|
99
|
-
"aria-label": "Close tag",
|
|
100
|
-
"data-testid": "close-tag",
|
|
101
|
-
variant: "ghost",
|
|
102
|
-
sentiment: "neutral",
|
|
103
|
-
icon: "close",
|
|
104
|
-
size: "small"
|
|
105
|
-
}) : null, isLoading ? jsx(Loader, {
|
|
106
|
-
active: true,
|
|
107
|
-
size: 16
|
|
108
|
-
}) : null]
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Tag component is used to display a short text description of an item. It can be used to display a category
|
|
113
|
-
* or any other metadata.
|
|
114
|
-
*/
|
|
115
|
-
const Tag = ({
|
|
116
|
-
children,
|
|
117
|
-
isLoading,
|
|
118
|
-
onClose,
|
|
119
|
-
icon,
|
|
120
|
-
copiable = false,
|
|
121
|
-
copyText = 'Copy',
|
|
122
|
-
copiedText = 'Copied!',
|
|
123
|
-
disabled,
|
|
124
|
-
sentiment = 'neutral',
|
|
125
|
-
className,
|
|
126
|
-
'data-testid': dataTestId
|
|
127
|
-
}) => {
|
|
128
|
-
const [isCopied, setCopied] = useClipboard(typeof children === 'string' ? children : '', {
|
|
129
|
-
successDuration: COPY_DURATION
|
|
130
|
-
});
|
|
131
|
-
if (copiable && !disabled) {
|
|
132
|
-
const Container = StyledContainer.withComponent('button', {
|
|
133
|
-
target: "el6733p3"
|
|
134
|
-
});
|
|
135
|
-
return jsx(Tooltip, {
|
|
136
|
-
text: isCopied ? copiedText : copyText,
|
|
137
|
-
children: jsx(Container
|
|
138
|
-
// @note: sending disabled as a special sentiment is a bit weird
|
|
139
|
-
, {
|
|
140
|
-
sentiment: disabled ? 'disabled' : sentiment,
|
|
141
|
-
copiable: true,
|
|
142
|
-
onClick: setCopied,
|
|
143
|
-
className: className,
|
|
144
|
-
"data-testid": dataTestId,
|
|
145
|
-
children: jsx(TagInner, {
|
|
146
|
-
isLoading: isLoading,
|
|
147
|
-
onClose: onClose,
|
|
148
|
-
icon: icon,
|
|
149
|
-
disabled: disabled,
|
|
150
|
-
children: children
|
|
151
|
-
})
|
|
152
|
-
})
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
return jsx(StyledContainer, {
|
|
156
|
-
sentiment: disabled ? 'disabled' : sentiment,
|
|
157
|
-
className: className,
|
|
158
|
-
"data-testid": dataTestId,
|
|
159
|
-
children: jsx(TagInner, {
|
|
160
|
-
isLoading: isLoading,
|
|
161
|
-
onClose: onClose,
|
|
162
|
-
icon: icon,
|
|
163
|
-
disabled: disabled,
|
|
164
|
-
children: children
|
|
165
|
-
})
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export { Tag };
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { Icon } from '@ultraviolet/icons';
|
|
3
|
-
import { useState, useId, useEffect, useRef, useMemo } from 'react';
|
|
4
|
-
import { Button } from '../Button/index.js';
|
|
5
|
-
import { Stack } from '../Stack/index.js';
|
|
6
|
-
import { Tag } from '../Tag/index.js';
|
|
7
|
-
import { Text } from '../Text/index.js';
|
|
8
|
-
import { Tooltip } from '../Tooltip/index.js';
|
|
9
|
-
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
10
|
-
import { getUUID } from '../../utils/ids.js';
|
|
11
|
-
|
|
12
|
-
const TAGINPUT_SIZE_PADDING = {
|
|
13
|
-
large: '1.5',
|
|
14
|
-
medium: '1',
|
|
15
|
-
small: '0.5'
|
|
16
|
-
};
|
|
17
|
-
const STATUS = {
|
|
18
|
-
IDLE: 'idle',
|
|
19
|
-
LOADING: 'loading'
|
|
20
|
-
};
|
|
21
|
-
const TagInputContainer = /*#__PURE__*/_styled('div', {
|
|
22
|
-
shouldForwardProp: prop => !['size'].includes(prop),
|
|
23
|
-
target: "ea7vc6o3"
|
|
24
|
-
})("display:flex;gap:", ({
|
|
25
|
-
theme
|
|
26
|
-
}) => theme.space['1'], ";background-color:", ({
|
|
27
|
-
theme: {
|
|
28
|
-
colors
|
|
29
|
-
}
|
|
30
|
-
}) => colors.neutral.background, ";padding:", ({
|
|
31
|
-
theme,
|
|
32
|
-
size
|
|
33
|
-
}) => `calc(${theme.space[TAGINPUT_SIZE_PADDING[size]]} - 1px) ${theme.space['2']}`, ";cursor:text;background:", ({
|
|
34
|
-
theme
|
|
35
|
-
}) => theme.colors.neutral.background, ";border:1px solid ", ({
|
|
36
|
-
theme
|
|
37
|
-
}) => theme.colors.neutral.border, ";border-radius:", ({
|
|
38
|
-
theme
|
|
39
|
-
}) => theme.radii.default, ";&:focus-within{border-color:", ({
|
|
40
|
-
theme
|
|
41
|
-
}) => theme.colors.primary.borderHover, ";box-shadow:", ({
|
|
42
|
-
theme
|
|
43
|
-
}) => theme.shadows.focusPrimary, ";}&[data-success='true']{border-color:", ({
|
|
44
|
-
theme
|
|
45
|
-
}) => theme.colors.success.border, ";}&[data-error='true']{border-color:", ({
|
|
46
|
-
theme
|
|
47
|
-
}) => theme.colors.danger.border, ";}&:hover{border-color:", ({
|
|
48
|
-
theme
|
|
49
|
-
}) => theme.colors.primary.borderHover, ";}&[data-readonly='true']{border-color:", ({
|
|
50
|
-
theme
|
|
51
|
-
}) => theme.colors.neutral.border, ";background:", ({
|
|
52
|
-
theme
|
|
53
|
-
}) => theme.colors.neutral.backgroundWeak, ";}&[data-disabled='true']{border-color:", ({
|
|
54
|
-
theme
|
|
55
|
-
}) => theme.colors.neutral.borderDisabled, ";background:", ({
|
|
56
|
-
theme
|
|
57
|
-
}) => theme.colors.neutral.backgroundDisabled, ";cursor:not-allowed;}");
|
|
58
|
-
const DataContainer = /*#__PURE__*/_styled('div', {
|
|
59
|
-
target: "ea7vc6o2"
|
|
60
|
-
})("height:100%;display:flex;flex-wrap:wrap;align-items:center;gap:", ({
|
|
61
|
-
theme
|
|
62
|
-
}) => theme.space['1'], ";flex:1;");
|
|
63
|
-
const StateContainer = /*#__PURE__*/_styled('div', {
|
|
64
|
-
target: "ea7vc6o1"
|
|
65
|
-
})("display:flex;align-items:center;gap:", ({
|
|
66
|
-
theme
|
|
67
|
-
}) => theme.space['1'], ";");
|
|
68
|
-
const StyledInput = /*#__PURE__*/_styled("input", {
|
|
69
|
-
target: "ea7vc6o0"
|
|
70
|
-
})("display:flex;flex:1;font-size:", ({
|
|
71
|
-
theme
|
|
72
|
-
}) => theme.typography.body.fontSize, ";background:inherit;color:", ({
|
|
73
|
-
theme: {
|
|
74
|
-
colors
|
|
75
|
-
}
|
|
76
|
-
}) => colors.neutral.text, ";border:none;outline:none;&::placeholder{color:", ({
|
|
77
|
-
theme: {
|
|
78
|
-
colors
|
|
79
|
-
}
|
|
80
|
-
}) => colors.neutral.textWeak, ";}height:100%;");
|
|
81
|
-
const convertTagArrayToTagStateArray = tags => (tags || [])?.map((tag, index) => typeof tag === 'object' ? {
|
|
82
|
-
...tag,
|
|
83
|
-
index: getUUID(`tag-${index}`)
|
|
84
|
-
} : {
|
|
85
|
-
index: getUUID(`tag-${index}`),
|
|
86
|
-
label: tag
|
|
87
|
-
});
|
|
88
|
-
/**
|
|
89
|
-
* TagInput is a component that allows users to input tags.
|
|
90
|
-
*/
|
|
91
|
-
const TagInput = ({
|
|
92
|
-
disabled = false,
|
|
93
|
-
id,
|
|
94
|
-
name,
|
|
95
|
-
onChange,
|
|
96
|
-
placeholder,
|
|
97
|
-
tags,
|
|
98
|
-
value,
|
|
99
|
-
className,
|
|
100
|
-
'data-testid': dataTestId,
|
|
101
|
-
label,
|
|
102
|
-
labelDescription,
|
|
103
|
-
required = false,
|
|
104
|
-
size = 'large',
|
|
105
|
-
error,
|
|
106
|
-
success,
|
|
107
|
-
helper,
|
|
108
|
-
readOnly = false,
|
|
109
|
-
tooltip,
|
|
110
|
-
clearable = false
|
|
111
|
-
}) => {
|
|
112
|
-
const tagsProp = value ?? tags;
|
|
113
|
-
const [tagInputState, setTagInput] = useState(convertTagArrayToTagStateArray(tagsProp ?? []));
|
|
114
|
-
const [input, setInput] = useState('');
|
|
115
|
-
const [status, setStatus] = useState({});
|
|
116
|
-
const uniqueId = useId();
|
|
117
|
-
const localId = id ?? uniqueId;
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
setTagInput(convertTagArrayToTagStateArray(tagsProp));
|
|
120
|
-
}, [tagsProp, setTagInput]);
|
|
121
|
-
const inputRef = useRef(null);
|
|
122
|
-
const dispatchOnChange = newState => {
|
|
123
|
-
const changes = newState.map(tag => typeof tag === 'object' ? tag?.label : tag);
|
|
124
|
-
onChange?.(changes);
|
|
125
|
-
};
|
|
126
|
-
const handleContainerClick = () => {
|
|
127
|
-
if (inputRef.current) {
|
|
128
|
-
inputRef?.current?.focus();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const onInputChange = e => setInput(e.target.value);
|
|
132
|
-
const addTag = () => {
|
|
133
|
-
const newTagInput = input ? [...tagInputState, {
|
|
134
|
-
index: getUUID('tag'),
|
|
135
|
-
label: input
|
|
136
|
-
}] : tagInputState;
|
|
137
|
-
setInput('');
|
|
138
|
-
setTagInput(newTagInput);
|
|
139
|
-
if (newTagInput.length !== tagInputState.length) {
|
|
140
|
-
setStatus({
|
|
141
|
-
[newTagInput[newTagInput.length - 1].index]: STATUS.LOADING
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
try {
|
|
145
|
-
dispatchOnChange(newTagInput);
|
|
146
|
-
setStatus({
|
|
147
|
-
[newTagInput[newTagInput.length - 1].index]: STATUS.IDLE
|
|
148
|
-
});
|
|
149
|
-
} catch (e) {
|
|
150
|
-
setTagInput(tagInputState);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const deleteTag = tagIndex => {
|
|
154
|
-
setStatus({
|
|
155
|
-
[tagIndex]: STATUS.LOADING
|
|
156
|
-
});
|
|
157
|
-
const findIndex = tagInputState.findIndex(({
|
|
158
|
-
index
|
|
159
|
-
}) => index === tagIndex);
|
|
160
|
-
const newTagInput = [...tagInputState];
|
|
161
|
-
newTagInput.splice(findIndex, 1);
|
|
162
|
-
try {
|
|
163
|
-
dispatchOnChange(newTagInput);
|
|
164
|
-
setTagInput(newTagInput);
|
|
165
|
-
setStatus({
|
|
166
|
-
[tagIndex]: STATUS.IDLE
|
|
167
|
-
});
|
|
168
|
-
} catch (e) {
|
|
169
|
-
setTagInput(tagInputState);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
const handleInputKeydown = event => {
|
|
173
|
-
if (event.key === ' ' || event.key === 'Enter') {
|
|
174
|
-
addTag();
|
|
175
|
-
event.preventDefault();
|
|
176
|
-
}
|
|
177
|
-
if (event.key === 'Backspace' && inputRef?.current?.selectionStart === 0 && tagInputState.length) {
|
|
178
|
-
event.preventDefault();
|
|
179
|
-
deleteTag(tagInputState[tagInputState.length - 1].index);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
const handlePaste = e => {
|
|
183
|
-
e.preventDefault();
|
|
184
|
-
const newTagInput = [...tagInputState, {
|
|
185
|
-
index: getUUID('tag'),
|
|
186
|
-
label: e?.clipboardData?.getData('Text')
|
|
187
|
-
}];
|
|
188
|
-
setTagInput(newTagInput);
|
|
189
|
-
setStatus({
|
|
190
|
-
[newTagInput.length - 1]: STATUS.LOADING
|
|
191
|
-
});
|
|
192
|
-
try {
|
|
193
|
-
dispatchOnChange(newTagInput);
|
|
194
|
-
setStatus({
|
|
195
|
-
[newTagInput.length - 1]: STATUS.IDLE
|
|
196
|
-
});
|
|
197
|
-
} catch (err) {
|
|
198
|
-
setTagInput(tagInputState);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
const clearAll = () => {
|
|
202
|
-
setInput('');
|
|
203
|
-
setTagInput([]);
|
|
204
|
-
dispatchOnChange([]);
|
|
205
|
-
};
|
|
206
|
-
const helperSentiment = useMemo(() => {
|
|
207
|
-
if (error) {
|
|
208
|
-
return 'danger';
|
|
209
|
-
}
|
|
210
|
-
if (success) {
|
|
211
|
-
return 'success';
|
|
212
|
-
}
|
|
213
|
-
return 'neutral';
|
|
214
|
-
}, [error, success]);
|
|
215
|
-
const computedClearable = clearable && !!tagInputState.length;
|
|
216
|
-
return jsxs(Stack, {
|
|
217
|
-
gap: "0.5",
|
|
218
|
-
className: className,
|
|
219
|
-
children: [label || labelDescription ? jsxs(Stack, {
|
|
220
|
-
direction: "row",
|
|
221
|
-
gap: "1",
|
|
222
|
-
alignItems: "center",
|
|
223
|
-
children: [label ? jsxs(Stack, {
|
|
224
|
-
direction: "row",
|
|
225
|
-
gap: "0.5",
|
|
226
|
-
alignItems: "start",
|
|
227
|
-
children: [jsx(Text, {
|
|
228
|
-
as: "label",
|
|
229
|
-
variant: "bodyStrong",
|
|
230
|
-
sentiment: "neutral",
|
|
231
|
-
htmlFor: id ?? localId,
|
|
232
|
-
children: label
|
|
233
|
-
}), required ? jsx(Icon, {
|
|
234
|
-
name: "asterisk",
|
|
235
|
-
color: "danger",
|
|
236
|
-
size: 8
|
|
237
|
-
}) : null]
|
|
238
|
-
}) : null, labelDescription ?? null]
|
|
239
|
-
}) : null, jsx("div", {
|
|
240
|
-
children: jsx(Tooltip, {
|
|
241
|
-
text: tooltip,
|
|
242
|
-
children: jsxs(TagInputContainer, {
|
|
243
|
-
onClick: handleContainerClick,
|
|
244
|
-
className: className,
|
|
245
|
-
"data-testid": dataTestId,
|
|
246
|
-
size: size,
|
|
247
|
-
"data-disabled": disabled,
|
|
248
|
-
"data-readonly": readOnly,
|
|
249
|
-
"data-error": !!error,
|
|
250
|
-
"data-success": !!success,
|
|
251
|
-
children: [jsxs(DataContainer, {
|
|
252
|
-
children: [tagInputState.map(tag => jsx(Tag, {
|
|
253
|
-
sentiment: "neutral",
|
|
254
|
-
disabled: disabled,
|
|
255
|
-
isLoading: status[tag.index] === STATUS.LOADING,
|
|
256
|
-
onClose: !readOnly ? e => {
|
|
257
|
-
e.stopPropagation();
|
|
258
|
-
deleteTag(tag.index);
|
|
259
|
-
} : undefined,
|
|
260
|
-
children: tag.label
|
|
261
|
-
}, tag.index)), !disabled ? jsx(StyledInput, {
|
|
262
|
-
id: localId,
|
|
263
|
-
name: name,
|
|
264
|
-
"aria-label": name,
|
|
265
|
-
type: "text",
|
|
266
|
-
placeholder: !tagInputState.length ? placeholder : '',
|
|
267
|
-
value: input,
|
|
268
|
-
onBlur: addTag,
|
|
269
|
-
onChange: onInputChange,
|
|
270
|
-
onKeyDown: handleInputKeydown,
|
|
271
|
-
onPaste: handlePaste,
|
|
272
|
-
ref: inputRef,
|
|
273
|
-
readOnly: readOnly
|
|
274
|
-
}) : null]
|
|
275
|
-
}), computedClearable || success || error ? jsxs(StateContainer, {
|
|
276
|
-
children: [computedClearable ? jsx(Button, {
|
|
277
|
-
"aria-label": "clear value",
|
|
278
|
-
disabled: disabled,
|
|
279
|
-
variant: "ghost",
|
|
280
|
-
size: "xsmall",
|
|
281
|
-
icon: "close",
|
|
282
|
-
onClick: clearAll,
|
|
283
|
-
sentiment: "neutral"
|
|
284
|
-
}) : null, success ? jsx(Icon, {
|
|
285
|
-
name: "checkbox-circle-outline",
|
|
286
|
-
color: "success",
|
|
287
|
-
size: 16,
|
|
288
|
-
disabled: disabled
|
|
289
|
-
}) : null, error ? jsx(Icon, {
|
|
290
|
-
name: "alert",
|
|
291
|
-
color: "danger",
|
|
292
|
-
size: 16,
|
|
293
|
-
disabled: disabled
|
|
294
|
-
}) : null]
|
|
295
|
-
}) : null]
|
|
296
|
-
})
|
|
297
|
-
})
|
|
298
|
-
}), error || typeof success === 'string' || helper ? jsx(Text, {
|
|
299
|
-
variant: "caption",
|
|
300
|
-
as: "span",
|
|
301
|
-
prominence: !error && !success ? 'weak' : undefined,
|
|
302
|
-
sentiment: helperSentiment,
|
|
303
|
-
disabled: disabled || readOnly,
|
|
304
|
-
children: error || success || helper
|
|
305
|
-
}) : null]
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
export { TAGINPUT_SIZE_PADDING, TagInput };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Popover } from '../Popover/index.js';
|
|
4
|
-
import { Tag } from '../Tag/index.js';
|
|
5
|
-
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
8
|
-
const StyledContainer = /*#__PURE__*/_styled("div", {
|
|
9
|
-
target: "eb6op482"
|
|
10
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
11
|
-
name: "zjik7",
|
|
12
|
-
styles: "display:flex"
|
|
13
|
-
} : {
|
|
14
|
-
name: "zjik7",
|
|
15
|
-
styles: "display:flex",
|
|
16
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
17
|
-
});
|
|
18
|
-
const TagsWrapper = /*#__PURE__*/_styled("span", {
|
|
19
|
-
target: "eb6op481"
|
|
20
|
-
})("cursor:pointer;color:", ({
|
|
21
|
-
theme
|
|
22
|
-
}) => theme.colors.primary.text, ";border:none;font-size:14px;align-self:center;max-width:350px;overflow:hidden;white-space:pre;text-overflow:ellipsis;background-color:transparent;padding-left:8px;padding-right:8px;");
|
|
23
|
-
const StyledTagContainer = /*#__PURE__*/_styled("div", {
|
|
24
|
-
target: "eb6op480"
|
|
25
|
-
})("display:flex;align-items:center;color:", ({
|
|
26
|
-
theme
|
|
27
|
-
}) => theme.colors.neutral.text, ";gap:", ({
|
|
28
|
-
theme
|
|
29
|
-
}) => theme.space['1'], ";", ({
|
|
30
|
-
multiline
|
|
31
|
-
}) => multiline && `flex-wrap: wrap;`, ";");
|
|
32
|
-
const DEFAULT_TAGS = [];
|
|
33
|
-
const getTagLabel = tag => typeof tag === 'object' ? tag.label : tag;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* This component is used to display a list of tags with a threshold and a popover when there are too many tags.
|
|
37
|
-
*/
|
|
38
|
-
const TagList = ({
|
|
39
|
-
maxLength = 600,
|
|
40
|
-
tags = DEFAULT_TAGS,
|
|
41
|
-
threshold = 1,
|
|
42
|
-
multiline = false,
|
|
43
|
-
popoverTitle,
|
|
44
|
-
popoverPlacement,
|
|
45
|
-
copiable,
|
|
46
|
-
copyText,
|
|
47
|
-
copiedText,
|
|
48
|
-
className,
|
|
49
|
-
'data-testid': dataTestId
|
|
50
|
-
}) => {
|
|
51
|
-
let tmpThreshold = threshold;
|
|
52
|
-
if (tags.length > 0 && tags.slice(0, tmpThreshold).reduce((acc, tag) => acc + getTagLabel(tag), '').length > maxLength) {
|
|
53
|
-
// If total tags length in characters is above maxLength,
|
|
54
|
-
// threshold is decremented in order to prevent too many long tags displayed.
|
|
55
|
-
tmpThreshold -= 1;
|
|
56
|
-
}
|
|
57
|
-
const hasManyTags = tags.length > tmpThreshold || false;
|
|
58
|
-
const visibleTagsCount = hasManyTags ? tmpThreshold : tags.length;
|
|
59
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
60
|
-
if (!tags.length) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return jsxs(StyledContainer, {
|
|
64
|
-
className: className,
|
|
65
|
-
"data-testid": dataTestId,
|
|
66
|
-
children: [jsx(StyledTagContainer, {
|
|
67
|
-
multiline: multiline,
|
|
68
|
-
children: tags.slice(0, visibleTagsCount).map((tag, index) => jsx(Tag
|
|
69
|
-
// useful when two tags are identical `${tag}-${index}`
|
|
70
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
71
|
-
, {
|
|
72
|
-
copiable: copiable,
|
|
73
|
-
copyText: copyText,
|
|
74
|
-
copiedText: copiedText,
|
|
75
|
-
icon: typeof tag === 'object' ? tag.icon : undefined,
|
|
76
|
-
children: getTagLabel(tag)
|
|
77
|
-
}, `${getTagLabel(tag)}-${index}`))
|
|
78
|
-
}), hasManyTags ? jsx(Popover, {
|
|
79
|
-
title: popoverTitle,
|
|
80
|
-
visible: isVisible,
|
|
81
|
-
size: "small",
|
|
82
|
-
onClose: () => setIsVisible(false),
|
|
83
|
-
placement: popoverPlacement,
|
|
84
|
-
content: jsx(StyledTagContainer, {
|
|
85
|
-
multiline: true,
|
|
86
|
-
children: tags.slice(visibleTagsCount).map((tag, index) => jsx(Tag
|
|
87
|
-
// useful when two tags are identical `${tag}-${index}`
|
|
88
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
89
|
-
, {
|
|
90
|
-
copiable: copiable,
|
|
91
|
-
copyText: copyText,
|
|
92
|
-
copiedText: copiedText,
|
|
93
|
-
icon: typeof tag === 'object' ? tag.icon : undefined,
|
|
94
|
-
children: getTagLabel(tag)
|
|
95
|
-
}, `${getTagLabel(tag)}-${index}`))
|
|
96
|
-
}),
|
|
97
|
-
children: jsxs(TagsWrapper, {
|
|
98
|
-
"data-testid": `${dataTestId ?? 'taglist'}-open`,
|
|
99
|
-
onClick: () => setIsVisible(true),
|
|
100
|
-
children: ["+", tags.length - tmpThreshold]
|
|
101
|
-
})
|
|
102
|
-
}) : null]
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export { TagList };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import recursivelyGetChildrenString from '../../helpers/recursivelyGetChildrenString.js';
|
|
4
|
-
import { useIsOverflowing } from '../../hooks/useIsOverflowing.js';
|
|
5
|
-
import capitalize from '../../utils/capitalize.js';
|
|
6
|
-
import { Tooltip } from '../Tooltip/index.js';
|
|
7
|
-
import { jsx } from '@emotion/react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
const PROMINENCES = {
|
|
10
|
-
default: '',
|
|
11
|
-
strong: 'strong',
|
|
12
|
-
stronger: 'stronger',
|
|
13
|
-
weak: 'weak'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Generate all styles available for text based on prominence and variants
|
|
18
|
-
*/
|
|
19
|
-
const generateStyles = ({
|
|
20
|
-
placement,
|
|
21
|
-
prominence,
|
|
22
|
-
sentiment,
|
|
23
|
-
variant,
|
|
24
|
-
theme,
|
|
25
|
-
oneLine,
|
|
26
|
-
disabled,
|
|
27
|
-
italic,
|
|
28
|
-
underline
|
|
29
|
-
}) => {
|
|
30
|
-
// stronger is available only for neutral sentiment
|
|
31
|
-
const definedProminence = sentiment !== 'neutral' && prominence === 'stronger' ? capitalize(PROMINENCES.default) : capitalize(PROMINENCES[prominence]);
|
|
32
|
-
sentiment ? theme.colors[sentiment] : undefined;
|
|
33
|
-
const text = `text${definedProminence}${disabled ? 'Disabled' : ''}`;
|
|
34
|
-
const textColor = sentiment ? theme.colors[sentiment][text] : undefined;
|
|
35
|
-
return `
|
|
36
|
-
${sentiment ? `color: ${textColor};` : ''}
|
|
37
|
-
|
|
38
|
-
font-size: ${theme.typography[variant].fontSize};
|
|
39
|
-
font-family: ${theme.typography[variant].fontFamily};
|
|
40
|
-
font-weight: ${theme.typography[variant].weight};
|
|
41
|
-
letter-spacing: ${theme.typography[variant].letterSpacing};
|
|
42
|
-
line-height: ${theme.typography[variant].lineHeight};
|
|
43
|
-
text-transform: ${theme.typography[variant].textCase};
|
|
44
|
-
text-decoration: ${theme.typography[variant].textDecoration};
|
|
45
|
-
${placement ? ` text-align: ${placement};` : ''}
|
|
46
|
-
|
|
47
|
-
${oneLine ? `white-space: nowrap;
|
|
48
|
-
text-overflow: ellipsis;
|
|
49
|
-
overflow: hidden;` : ''}
|
|
50
|
-
${italic ? `font-style: italic;` : ''}
|
|
51
|
-
${underline ? `text-decoration: underline;` : ''}
|
|
52
|
-
`;
|
|
53
|
-
};
|
|
54
|
-
const StyledText = /*#__PURE__*/_styled('div', {
|
|
55
|
-
shouldForwardProp: prop => !['as', 'placement', 'variant', 'sentiment', 'prominence', 'oneLine', 'disabled', 'italic', 'underline'].includes(prop),
|
|
56
|
-
target: "e13y3mga0"
|
|
57
|
-
})(generateStyles);
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Text component is used to display text with different variants and sentiments.
|
|
61
|
-
*/
|
|
62
|
-
const Text = ({
|
|
63
|
-
variant,
|
|
64
|
-
children,
|
|
65
|
-
as,
|
|
66
|
-
color,
|
|
67
|
-
sentiment,
|
|
68
|
-
oneLine = false,
|
|
69
|
-
placement,
|
|
70
|
-
prominence = 'default',
|
|
71
|
-
className,
|
|
72
|
-
disabled = false,
|
|
73
|
-
italic = false,
|
|
74
|
-
underline = false,
|
|
75
|
-
id,
|
|
76
|
-
dir,
|
|
77
|
-
htmlFor,
|
|
78
|
-
'data-testid': dataTestId
|
|
79
|
-
}) => {
|
|
80
|
-
const computedSentiment = sentiment ?? color;
|
|
81
|
-
const elementRef = useRef(null);
|
|
82
|
-
const isOverflowing = useIsOverflowing(elementRef);
|
|
83
|
-
const finalStringChildren = recursivelyGetChildrenString(children);
|
|
84
|
-
return jsx(Tooltip, {
|
|
85
|
-
text: oneLine && isOverflowing ? finalStringChildren : '',
|
|
86
|
-
children: jsx(StyledText, {
|
|
87
|
-
ref: elementRef,
|
|
88
|
-
as: as,
|
|
89
|
-
placement: placement,
|
|
90
|
-
prominence: prominence,
|
|
91
|
-
sentiment: computedSentiment,
|
|
92
|
-
variant: variant,
|
|
93
|
-
oneLine: oneLine,
|
|
94
|
-
className: className,
|
|
95
|
-
disabled: disabled,
|
|
96
|
-
italic: italic,
|
|
97
|
-
underline: underline,
|
|
98
|
-
id: id,
|
|
99
|
-
dir: dir,
|
|
100
|
-
htmlFor: htmlFor,
|
|
101
|
-
"data-testid": dataTestId,
|
|
102
|
-
children: children
|
|
103
|
-
})
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export { Text };
|