@veeqo/ui 0.0.1 → 0.0.3
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/.eslintrc.json +105 -0
- package/.storybook/Intro.mdx +22 -0
- package/.storybook/main.ts +1 -1
- package/.storybook/preview.ts +7 -0
- package/CHANGELOG.md +21 -0
- package/README.md +77 -0
- package/jest.config.js +16 -0
- package/lib/components/Accordion/Accordion.d.ts +12 -0
- package/lib/components/Accordion/index.d.ts +1 -0
- package/lib/components/Accordion/styled.d.ts +12 -0
- package/lib/components/ActionList/ActionList.d.ts +3 -0
- package/lib/components/ActionList/index.d.ts +1 -0
- package/lib/components/ActionList/styled.d.ts +15 -0
- package/lib/components/ActionList/types.d.ts +19 -0
- package/lib/components/Anchor/Anchor.d.ts +9 -0
- package/lib/components/Anchor/index.d.ts +1 -0
- package/lib/components/Anchor/styled.d.ts +1 -0
- package/lib/components/AnimatedDropdown/AnimatedDropdown.d.ts +3 -0
- package/lib/components/AnimatedDropdown/components/BasicDropdown.d.ts +5 -0
- package/lib/components/AnimatedDropdown/components/styled.d.ts +1 -0
- package/lib/components/AnimatedDropdown/index.d.ts +1 -0
- package/lib/components/AnimatedDropdown/styled.d.ts +10 -0
- package/lib/components/AnimatedDropdown/types.d.ts +14 -0
- package/lib/components/Avatar/Avatar.d.ts +3 -0
- package/lib/components/Avatar/index.d.ts +1 -0
- package/lib/components/Avatar/styled.d.ts +2 -0
- package/lib/components/Avatar/types.d.ts +11 -0
- package/lib/components/Badge/Badge.d.ts +3 -0
- package/lib/components/Badge/index.d.ts +1 -0
- package/lib/components/Badge/styled.d.ts +7 -0
- package/lib/components/Badge/types.d.ts +35 -0
- package/lib/components/Banner/Banner.d.ts +6 -0
- package/lib/components/Banner/index.d.ts +1 -0
- package/lib/components/Banner/styled.d.ts +7 -0
- package/lib/components/Banner/types.d.ts +20 -0
- package/lib/components/BaseContainer/BaseContainer.d.ts +1 -0
- package/lib/components/BaseContainer/index.d.ts +1 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/lib/components/Breadcrumbs/components/Breadcrumb.d.ts +3 -0
- package/lib/components/Breadcrumbs/components/styled.d.ts +2 -0
- package/lib/components/Breadcrumbs/index.d.ts +1 -0
- package/lib/components/Breadcrumbs/types.d.ts +22 -0
- package/lib/components/Button/Button.d.ts +3 -0
- package/lib/components/Button/components/DropdownIcon.d.ts +2 -0
- package/lib/components/Button/components/styled.d.ts +20 -0
- package/lib/components/Button/index.d.ts +1 -0
- package/lib/components/Button/types.d.ts +18 -0
- package/lib/components/Card/Card.d.ts +28 -0
- package/lib/components/Card/index.d.ts +1 -0
- package/lib/components/Card/styled.d.ts +16 -0
- package/lib/components/CardHeader/CardHeader.d.ts +19 -0
- package/lib/components/CardHeader/icons/Cross.d.ts +2 -0
- package/lib/components/CardHeader/icons/DownArrow.d.ts +2 -0
- package/lib/components/CardHeader/icons/UpArrow.d.ts +2 -0
- package/lib/components/CardHeader/index.d.ts +1 -0
- package/lib/components/CardHeader/styled.d.ts +2 -0
- package/lib/components/Checkbox/Checkbox.d.ts +13 -0
- package/lib/components/Checkbox/index.d.ts +1 -0
- package/lib/components/Checkbox/styled.d.ts +1 -0
- package/lib/components/Choice/Choice.d.ts +17 -0
- package/lib/components/Choice/components/HelpIcon.d.ts +2 -0
- package/lib/components/Choice/components/styled.d.ts +17 -0
- package/lib/components/Choice/index.d.ts +1 -0
- package/lib/components/ChoiceList/ChoiceList.d.ts +29 -0
- package/lib/components/ChoiceList/index.d.ts +1 -0
- package/lib/components/ChoiceList/styled.d.ts +2 -0
- package/lib/components/CopyToClipboard/CopyToClipboard.d.ts +10 -0
- package/lib/components/CopyToClipboard/index.d.ts +1 -0
- package/lib/components/DataTable/DataTable.d.ts +21 -0
- package/lib/components/DataTable/SkeletonContent/SkeletonContent.d.ts +7 -0
- package/lib/components/DataTable/SkeletonContent/index.d.ts +1 -0
- package/lib/components/DataTable/SpecificState/SpecificState.d.ts +7 -0
- package/lib/components/DataTable/SpecificState/index.d.ts +1 -0
- package/lib/components/DataTable/SpecificState/styled.d.ts +8 -0
- package/lib/components/DataTable/StickyHeader.d.ts +10 -0
- package/lib/components/DataTable/cells/ClickableCell.d.ts +7 -0
- package/lib/components/DataTable/cells/EditableCell.d.ts +7 -0
- package/lib/components/DataTable/cells/SkeletonCell.d.ts +11 -0
- package/lib/components/DataTable/cells/SkeletonHeaderCell.d.ts +8 -0
- package/lib/components/DataTable/cells/index.d.ts +3 -0
- package/lib/components/DataTable/cells/styled.d.ts +1 -0
- package/lib/components/DataTable/icons/DoubleArrowAsc.d.ts +2 -0
- package/lib/components/DataTable/icons/DoubleArrowDesc.d.ts +2 -0
- package/lib/components/DataTable/icons/DoubleArrowIcon.d.ts +2 -0
- package/lib/components/DataTable/index.d.ts +1 -0
- package/lib/components/DataTable/styled.d.ts +46 -0
- package/lib/components/DataTable/utils/constants.d.ts +9 -0
- package/lib/components/DataTable/utils/hooks.d.ts +4 -0
- package/lib/components/DataTable/utils/index.d.ts +2 -0
- package/lib/components/DataTable/utils/types.d.ts +106 -0
- package/lib/components/DataTableExp/DataTable.d.ts +22 -0
- package/lib/components/DataTableExp/components/ActionBar.d.ts +9 -0
- package/lib/components/DataTableExp/components/Cell.d.ts +7 -0
- package/lib/components/DataTableExp/components/ColumnHeader.d.ts +6 -0
- package/lib/components/DataTableExp/components/ColumnMenu.d.ts +8 -0
- package/lib/components/DataTableExp/components/EmptyBodyContent.d.ts +5 -0
- package/lib/components/DataTableExp/components/Header.d.ts +2 -0
- package/lib/components/DataTableExp/components/LoadingCellContent.d.ts +1 -0
- package/lib/components/DataTableExp/components/NoWrap.d.ts +1 -0
- package/lib/components/DataTableExp/components/Row.d.ts +7 -0
- package/lib/components/DataTableExp/components/ScrollContainer.d.ts +1 -0
- package/lib/components/DataTableExp/components/SelectionCell.d.ts +11 -0
- package/lib/components/DataTableExp/components/SelectionHeader.d.ts +3 -0
- package/lib/components/DataTableExp/components/StickyHead.d.ts +9 -0
- package/lib/components/DataTableExp/components/TableGrid.d.ts +4 -0
- package/lib/components/DataTableExp/components/Truncate.d.ts +1 -0
- package/lib/components/DataTableExp/components/Wrapper.d.ts +5 -0
- package/lib/components/DataTableExp/components/icons/ArrowDown.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/ArrowUp.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/DoubleArrow.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/InfoIcon.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/Reorder.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/Visibility.d.ts +2 -0
- package/lib/components/DataTableExp/components/icons/VisibilityOff.d.ts +2 -0
- package/lib/components/DataTableExp/constants.d.ts +3 -0
- package/lib/components/DataTableExp/hooks/index.d.ts +6 -0
- package/lib/components/DataTableExp/hooks/useCellWidths.d.ts +2 -0
- package/lib/components/DataTableExp/hooks/useColumns.d.ts +6 -0
- package/lib/components/DataTableExp/hooks/useDragToScroll.d.ts +2 -0
- package/lib/components/DataTableExp/hooks/useNested.d.ts +7 -0
- package/lib/components/DataTableExp/hooks/useScrollPosition.d.ts +6 -0
- package/lib/components/DataTableExp/hooks/useSelection.d.ts +12 -0
- package/lib/components/DataTableExp/index.d.ts +1 -0
- package/lib/components/DataTableExp/renderers/index.d.ts +5 -0
- package/lib/components/DataTableExp/renderers/renderCell.d.ts +10 -0
- package/lib/components/DataTableExp/renderers/renderFooter.d.ts +13 -0
- package/lib/components/DataTableExp/renderers/renderHeader.d.ts +15 -0
- package/lib/components/DataTableExp/renderers/renderLoadingCell.d.ts +9 -0
- package/lib/components/DataTableExp/renderers/renderNestedCell.d.ts +10 -0
- package/lib/components/DataTableExp/types.d.ts +116 -0
- package/lib/components/DataTableExp/utils/GetSortIcon.d.ts +9 -0
- package/lib/components/DataTableExp/utils/alignmentToFlex.d.ts +2 -0
- package/lib/components/DataTableExp/utils/generateTableCss.d.ts +10 -0
- package/lib/components/DataTableExp/utils/getNextSortState.d.ts +7 -0
- package/lib/components/DataTableExp/utils/getRowState.d.ts +10 -0
- package/lib/components/DataTableExp/utils/index.d.ts +6 -0
- package/lib/components/DataTableExp/utils/parseWidth.d.ts +1 -0
- package/lib/components/DataTableExp/utils/sumAll.d.ts +2 -0
- package/lib/components/DescriptionList/DescriptionList.d.ts +11 -0
- package/lib/components/DescriptionList/index.d.ts +1 -0
- package/lib/components/DetailPage/DetailPage.d.ts +6 -0
- package/lib/components/DetailPage/index.d.ts +1 -0
- package/lib/components/DetailPage/styled.d.ts +2 -0
- package/lib/components/DimensionsInput/DimensionsInput.d.ts +3 -0
- package/lib/components/DimensionsInput/index.d.ts +1 -0
- package/lib/components/DimensionsInput/styled.d.ts +27 -0
- package/lib/components/DimensionsInput/types.d.ts +15 -0
- package/lib/components/FilterTag/FilterTag.d.ts +8 -0
- package/lib/components/FilterTag/index.d.ts +1 -0
- package/lib/components/FilterTag/styled.d.ts +12 -0
- package/lib/components/FilterTag/types.d.ts +14 -0
- package/lib/components/Grid/index.d.ts +2 -0
- package/lib/components/Grid/types.d.ts +8 -0
- package/lib/components/Image/Image.d.ts +20 -0
- package/lib/components/Image/components/PlaceholderImage.d.ts +2 -0
- package/lib/components/Image/components/styled.d.ts +6 -0
- package/lib/components/Image/index.d.ts +1 -0
- package/lib/components/Image/types.d.ts +6 -0
- package/lib/components/Image/utils.d.ts +2 -0
- package/lib/components/InputGroup/index.d.ts +1 -0
- package/lib/components/Loader/Grid.d.ts +1 -2
- package/lib/components/Loader/TailSpin.d.ts +1 -2
- package/lib/components/Loader/ThreeDots.d.ts +1 -2
- package/lib/components/LoginWithAmazonButton/LoginWithAmazonButton.d.ts +7 -0
- package/lib/components/LoginWithAmazonButton/index.d.ts +1 -0
- package/lib/components/LoginWithAmazonButton/styled.d.ts +1 -0
- package/lib/components/Modal/Modal.d.ts +3 -0
- package/lib/components/Modal/components/Dialog/Dialog.d.ts +8 -0
- package/lib/components/Modal/components/Dialog/constants.d.ts +44 -0
- package/lib/components/Modal/components/Dialog/styled.d.ts +24 -0
- package/lib/components/Modal/components/styled.d.ts +5 -0
- package/lib/components/Modal/index.d.ts +1 -0
- package/lib/components/Modal/types.d.ts +40 -0
- package/lib/components/PageHeader/PageHeader.d.ts +29 -0
- package/lib/components/PageHeader/index.d.ts +1 -0
- package/lib/components/PageHeader/styled.d.ts +16 -0
- package/lib/components/Pagination/Pagination.d.ts +3 -0
- package/lib/components/Pagination/components/EndArrow.d.ts +2 -0
- package/lib/components/Pagination/components/LeftArrow.d.ts +2 -0
- package/lib/components/Pagination/components/RightArrow.d.ts +2 -0
- package/lib/components/Pagination/components/StartArrow.d.ts +2 -0
- package/lib/components/Pagination/components.d.ts +4 -0
- package/lib/components/Pagination/hooks/usePagination.d.ts +13 -0
- package/lib/components/Pagination/index.d.ts +1 -0
- package/lib/components/Pagination/styled.d.ts +22 -0
- package/lib/components/Pagination/types.d.ts +8 -0
- package/lib/components/PaginationRange/Items/Item/Item.d.ts +3 -0
- package/lib/components/PaginationRange/Items/Item/index.d.ts +1 -0
- package/lib/components/PaginationRange/Items/Item/styled.d.ts +3 -0
- package/lib/components/PaginationRange/Items/Item/types.d.ts +5 -0
- package/lib/components/PaginationRange/Items/Items.d.ts +7 -0
- package/lib/components/PaginationRange/Items/index.d.ts +1 -0
- package/lib/components/PaginationRange/PaginationRange.d.ts +9 -0
- package/lib/components/PaginationRange/index.d.ts +1 -0
- package/lib/components/PaginationRange/styled.d.ts +6 -0
- package/lib/components/PaginationRange/types.d.ts +15 -0
- package/lib/components/Popover/Popover.d.ts +15 -0
- package/lib/components/Popover/PopoverDemo.d.ts +3 -0
- package/lib/components/Popover/index.d.ts +1 -0
- package/lib/components/Portal/Portal.d.ts +20 -0
- package/lib/components/Portal/index.d.ts +1 -0
- package/lib/components/PriceInput/PriceInput.d.ts +3 -0
- package/lib/components/PriceInput/index.d.ts +1 -0
- package/lib/components/PriceInput/styled.d.ts +29 -0
- package/lib/components/PriceInput/types.d.ts +12 -0
- package/lib/components/Radio/Radio.d.ts +12 -0
- package/lib/components/Radio/index.d.ts +1 -0
- package/lib/components/Radio/styled.d.ts +1 -0
- package/lib/components/Search/Search.d.ts +3 -0
- package/lib/components/Search/index.d.ts +1 -0
- package/lib/components/Search/styled.d.ts +26 -0
- package/lib/components/Search/types.d.ts +9 -0
- package/lib/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/lib/components/SegmentedControl/index.d.ts +1 -0
- package/lib/components/SegmentedControl/styled.d.ts +1 -0
- package/lib/components/SegmentedControl/types.d.ts +13 -0
- package/lib/components/Select/Select.d.ts +17 -0
- package/lib/components/Select/index.d.ts +1 -0
- package/lib/components/Select/styled.d.ts +1 -0
- package/lib/components/SimpleTable/SimpleTable.d.ts +15 -0
- package/lib/components/SimpleTable/index.d.ts +1 -0
- package/lib/components/SimpleTable/styled.d.ts +15 -0
- package/lib/components/SimpleTable/types.d.ts +6 -0
- package/lib/components/Slider/Slider.d.ts +3 -0
- package/lib/components/Slider/index.d.ts +1 -0
- package/lib/components/Slider/styled.d.ts +8 -0
- package/lib/components/Slider/types.d.ts +26 -0
- package/lib/components/Stack/Alignments.d.ts +1 -2
- package/lib/components/Stack/Stack.d.ts +1 -2
- package/lib/components/Stack/types.d.ts +1 -1
- package/lib/components/Stepper/Stepper.d.ts +9 -0
- package/lib/components/Stepper/index.d.ts +1 -0
- package/lib/components/Stepper/styled.d.ts +5 -0
- package/lib/components/Tag/Tag.d.ts +5 -0
- package/lib/components/Tag/index.d.ts +1 -0
- package/lib/components/Text/Text.d.ts +2 -0
- package/lib/components/Text/index.d.ts +1 -0
- package/lib/components/Text/textVariants.d.ts +4 -0
- package/lib/components/Text/types.d.ts +14 -0
- package/lib/components/Text/utils.d.ts +2 -0
- package/lib/components/TextField/TextField.d.ts +3 -0
- package/lib/components/TextField/index.d.ts +20 -0
- package/lib/components/TextField/styled.d.ts +2 -0
- package/lib/components/TextField/types.d.ts +26 -0
- package/lib/components/ToastsLayout/ToastsLayout.d.ts +3 -0
- package/lib/components/ToastsLayout/components/Toast.d.ts +3 -0
- package/lib/components/ToastsLayout/components/styled.d.ts +10 -0
- package/lib/components/ToastsLayout/index.d.ts +1 -0
- package/lib/components/ToastsLayout/types.d.ts +38 -0
- package/lib/components/Toggle/Toggle.d.ts +6 -0
- package/lib/components/Toggle/index.d.ts +1 -0
- package/lib/components/Toggle/styled.d.ts +11 -0
- package/lib/components/Toggle/types.d.ts +9 -0
- package/lib/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/lib/components/ToggleButton/index.d.ts +1 -0
- package/lib/components/ToggleButton/styled.d.ts +1 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -0
- package/lib/components/Tooltip/index.d.ts +1 -0
- package/lib/components/Tooltip/styled.d.ts +8 -0
- package/lib/components/Tooltip/types.d.ts +36 -0
- package/lib/components/VideoModal/VideoModal.d.ts +3 -0
- package/lib/components/VideoModal/VideoModalDemo.d.ts +2 -0
- package/lib/components/VideoModal/components/Popup.d.ts +8 -0
- package/lib/components/VideoModal/components/styled.d.ts +7 -0
- package/lib/components/VideoModal/index.d.ts +1 -0
- package/lib/components/VideoModal/styled.d.ts +4 -0
- package/lib/components/VideoModal/types.d.ts +9 -0
- package/lib/components/View/View.d.ts +11 -0
- package/lib/components/View/index.d.ts +1 -0
- package/lib/components/View/styled.d.ts +13 -0
- package/lib/components/View/types.d.ts +30 -0
- package/lib/components/WeightInput/WeightInput.d.ts +3 -0
- package/lib/components/WeightInput/index.d.ts +1 -0
- package/lib/components/WeightInput/styled.d.ts +26 -0
- package/lib/components/WeightInput/types.d.ts +21 -0
- package/lib/components/index.d.ts +50 -0
- package/lib/components/types.d.ts +20 -0
- package/lib/hoc/index.d.ts +2 -0
- package/lib/hoc/withDeprecated.d.ts +2 -0
- package/lib/hoc/withLabels/HelpIcon.d.ts +2 -0
- package/lib/hoc/withLabels/index.d.ts +1 -0
- package/lib/hoc/withLabels/styled.d.ts +5 -0
- package/lib/hoc/withLabels/withLabels.d.ts +8 -0
- package/lib/hooks/index.d.ts +7 -0
- package/lib/hooks/useClickOutside.d.ts +5 -0
- package/lib/hooks/useDebounce.d.ts +1 -0
- package/lib/hooks/useDropdown.d.ts +6 -0
- package/lib/hooks/useFocusVisible.d.ts +11 -0
- package/lib/hooks/useHover.d.ts +1 -0
- package/lib/hooks/useIsOverflowing.d.ts +9 -0
- package/lib/hooks/useTabs.d.ts +6 -0
- package/lib/index.d.ts +1200 -18
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tempIcons/ArrowDownIcon.d.ts +2 -0
- package/lib/tempIcons/ArrowUpIcon.d.ts +2 -0
- package/lib/tempIcons/AttentionIcon.d.ts +2 -0
- package/lib/tempIcons/CalendarIcon.d.ts +2 -0
- package/lib/tempIcons/ClipboardIcon.d.ts +2 -0
- package/lib/tempIcons/CrossIcon.d.ts +2 -0
- package/lib/tempIcons/DoubleArrowAscIcon.d.ts +2 -0
- package/lib/tempIcons/DoubleArrowDescIcon.d.ts +2 -0
- package/lib/tempIcons/DoubleArrowIcon.d.ts +2 -0
- package/lib/tempIcons/DoubleArrowIconIcon.d.ts +2 -0
- package/lib/tempIcons/DownArrowIcon.d.ts +2 -0
- package/lib/tempIcons/DropdownIcon.d.ts +2 -0
- package/lib/tempIcons/EditIcon.d.ts +2 -0
- package/lib/tempIcons/EndArrowIcon.d.ts +2 -0
- package/lib/tempIcons/FailIcon.d.ts +2 -0
- package/lib/tempIcons/HelpIcon.d.ts +2 -0
- package/lib/tempIcons/InfoIcon.d.ts +2 -0
- package/lib/tempIcons/LeftArrowIcon.d.ts +2 -0
- package/lib/tempIcons/MergeIcon.d.ts +2 -0
- package/lib/tempIcons/MoreHorizIcon.d.ts +2 -0
- package/lib/tempIcons/ReorderIcon.d.ts +2 -0
- package/lib/tempIcons/RightArrowIcon.d.ts +2 -0
- package/lib/tempIcons/SearchIcon.d.ts +2 -0
- package/lib/tempIcons/StartArrowIcon.d.ts +2 -0
- package/lib/tempIcons/SuccessIcon.d.ts +2 -0
- package/lib/tempIcons/UpArrowIcon.d.ts +2 -0
- package/lib/tempIcons/VisibilityIcon.d.ts +2 -0
- package/lib/tempIcons/VisibilityOffIcon.d.ts +2 -0
- package/lib/theme/index.d.ts +2 -2
- package/lib/theme/modules/shadows.d.ts +1 -1
- package/lib/theme/utils/buildClassnames.d.ts +1 -0
- package/lib/theme/utils/color.d.ts +13 -0
- package/lib/theme/utils/generateId.d.ts +1 -0
- package/lib/theme/utils/index.d.ts +3 -0
- package/lib/theme/utils/paginationList.d.ts +4 -0
- package/lib/theme/utils/setupIntersectionObserverMock.d.ts +18 -0
- package/lib/utils/buildClassnames.d.ts +1 -0
- package/lib/utils/color.d.ts +13 -0
- package/lib/utils/generateId.d.ts +1 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/paginationList.d.ts +4 -0
- package/lib/utils/setupIntersectionObserverMock.d.ts +18 -0
- package/lib/utils/toMap.d.ts +5 -0
- package/package.json +68 -14
- package/setupJestMock.js +5 -0
- package/setupTests.js +6 -0
- package/src/components/Accordion/Accordion.stories.mdx +41 -0
- package/src/components/Accordion/Accordion.stories.tsx +29 -0
- package/src/components/Accordion/Accordion.test.tsx +34 -0
- package/src/components/Accordion/Accordion.tsx +62 -0
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +152 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Accordion/styled.ts +102 -0
- package/src/components/ActionList/ActionList.stories.tsx +23 -0
- package/src/components/ActionList/ActionList.test.tsx +39 -0
- package/src/components/ActionList/ActionList.tsx +72 -0
- package/src/components/ActionList/__snapshots__/ActionList.test.tsx.snap +247 -0
- package/src/components/ActionList/index.ts +1 -0
- package/src/components/ActionList/styled.ts +62 -0
- package/src/components/ActionList/types.ts +22 -0
- package/src/components/Anchor/Anchor.stories.tsx +35 -0
- package/src/components/Anchor/Anchor.test.tsx +10 -0
- package/src/components/Anchor/Anchor.tsx +17 -0
- package/src/components/Anchor/__snapshots__/Anchor.test.tsx.snap +34 -0
- package/src/components/Anchor/index.ts +1 -0
- package/src/components/Anchor/styled.ts +22 -0
- package/src/components/AnimatedDropdown/AnimatedDropdown.stories.tsx +44 -0
- package/src/components/AnimatedDropdown/AnimatedDropdown.test.tsx +14 -0
- package/src/components/AnimatedDropdown/AnimatedDropdown.tsx +54 -0
- package/src/components/AnimatedDropdown/__snapshots__/AnimatedDropdown.test.tsx.snap +117 -0
- package/src/components/AnimatedDropdown/components/BasicDropdown.test.tsx +14 -0
- package/src/components/AnimatedDropdown/components/BasicDropdown.tsx +17 -0
- package/src/components/AnimatedDropdown/components/__snapshots__/BasicDropdown.test.tsx.snap +31 -0
- package/src/components/AnimatedDropdown/components/styled.ts +11 -0
- package/src/components/AnimatedDropdown/index.ts +1 -0
- package/src/components/AnimatedDropdown/styled.ts +51 -0
- package/src/components/AnimatedDropdown/types.ts +16 -0
- package/src/components/Avatar/Avatar.stories.tsx +30 -0
- package/src/components/Avatar/Avatar.test.tsx +10 -0
- package/src/components/Avatar/Avatar.tsx +23 -0
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +47 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Avatar/styled.ts +24 -0
- package/src/components/Avatar/types.ts +12 -0
- package/src/components/Badge/Badge.stories.tsx +29 -0
- package/src/components/Badge/Badge.test.tsx +15 -0
- package/src/components/Badge/Badge.tsx +33 -0
- package/src/components/Badge/__snapshots__/Badge.test.tsx.snap +78 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Badge/styled.ts +50 -0
- package/src/components/Badge/types.ts +43 -0
- package/src/components/Banner/Banner.stories.tsx +30 -0
- package/src/components/Banner/Banner.test.tsx +10 -0
- package/src/components/Banner/Banner.tsx +45 -0
- package/src/components/Banner/__snapshots__/Banner.test.tsx.snap +124 -0
- package/src/components/Banner/index.ts +1 -0
- package/src/components/Banner/styled.ts +49 -0
- package/src/components/Banner/types.ts +23 -0
- package/src/components/BaseContainer/BaseContainer.test.tsx +10 -0
- package/src/components/BaseContainer/BaseContainer.ts +8 -0
- package/src/components/BaseContainer/__snapshots__/BaseContainer.test.tsx.snap +18 -0
- package/src/components/BaseContainer/index.ts +1 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +43 -0
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +21 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +31 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +91 -0
- package/src/components/Breadcrumbs/components/Breadcrumb.tsx +20 -0
- package/src/components/Breadcrumbs/components/styled.ts +31 -0
- package/src/components/Breadcrumbs/index.ts +1 -0
- package/src/components/Breadcrumbs/types.ts +23 -0
- package/src/components/Button/Button.stories.tsx +111 -0
- package/src/components/Button/Button.test.tsx +101 -0
- package/src/components/Button/Button.tsx +82 -0
- package/src/components/Button/Docs.mdx +19 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +1570 -0
- package/src/components/Button/components/styled.ts +271 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/types.ts +27 -0
- package/src/components/Card/Card.stories.tsx +85 -0
- package/src/components/Card/Card.test.tsx +26 -0
- package/src/components/Card/Card.tsx +88 -0
- package/src/components/Card/Docs.mdx +134 -0
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +390 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Card/styled.ts +93 -0
- package/src/components/CardHeader/CardHeader.stories.tsx +38 -0
- package/src/components/CardHeader/CardHeader.test.tsx +12 -0
- package/src/components/CardHeader/CardHeader.tsx +63 -0
- package/src/components/CardHeader/__snapshots__/CardHeader.test.tsx.snap +218 -0
- package/src/components/CardHeader/index.ts +1 -0
- package/src/components/CardHeader/styled.ts +30 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +64 -0
- package/src/components/Checkbox/Checkbox.test.tsx +57 -0
- package/src/components/Checkbox/Checkbox.tsx +62 -0
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +129 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Checkbox/styled.ts +67 -0
- package/src/components/Choice/Choice.tsx +89 -0
- package/src/components/Choice/components/styled.ts +98 -0
- package/src/components/Choice/index.ts +1 -0
- package/src/components/ChoiceList/ChoiceList.stories.tsx +23 -0
- package/src/components/ChoiceList/ChoiceList.test.tsx +39 -0
- package/src/components/ChoiceList/ChoiceList.tsx +86 -0
- package/src/components/ChoiceList/__snapshots__/ChoiceList.test.tsx.snap +352 -0
- package/src/components/ChoiceList/index.ts +1 -0
- package/src/components/ChoiceList/styled.ts +23 -0
- package/src/components/CopyToClipboard/CopyToClipboard.stories.tsx +18 -0
- package/src/components/CopyToClipboard/CopyToClipboard.test.tsx +10 -0
- package/src/components/CopyToClipboard/CopyToClipboard.tsx +53 -0
- package/src/components/CopyToClipboard/__snapshots__/CopyToClipboard.test.tsx.snap +129 -0
- package/src/components/CopyToClipboard/index.ts +1 -0
- package/src/components/DataTable/DataTable.stories.tsx +99 -0
- package/src/components/DataTable/DataTable.test.tsx +104 -0
- package/src/components/DataTable/DataTable.tsx +634 -0
- package/src/components/DataTable/DataTableDocs.mdx +625 -0
- package/src/components/DataTable/SkeletonContent/SkeletonContent.tsx +46 -0
- package/src/components/DataTable/SkeletonContent/index.ts +1 -0
- package/src/components/DataTable/SpecificState/SpecificState.tsx +17 -0
- package/src/components/DataTable/SpecificState/index.ts +1 -0
- package/src/components/DataTable/SpecificState/styled.ts +42 -0
- package/src/components/DataTable/StickyHeader.tsx +64 -0
- package/src/components/DataTable/__snapshots__/DataTable.test.tsx.snap +439 -0
- package/src/components/DataTable/cells/ClickableCell.tsx +21 -0
- package/src/components/DataTable/cells/EditableCell.tsx +22 -0
- package/src/components/DataTable/cells/SkeletonCell.tsx +17 -0
- package/src/components/DataTable/cells/SkeletonHeaderCell.tsx +20 -0
- package/src/components/DataTable/cells/index.ts +3 -0
- package/src/components/DataTable/cells/styled.ts +25 -0
- package/src/components/DataTable/index.ts +1 -0
- package/src/components/DataTable/styled.ts +291 -0
- package/src/components/DataTable/utils/constants.tsx +25 -0
- package/src/components/DataTable/utils/hooks.ts +38 -0
- package/src/components/DataTable/utils/index.ts +23 -0
- package/src/components/DataTable/utils/types.ts +117 -0
- package/src/components/DataTableExp/DataTable.test.tsx +214 -0
- package/src/components/DataTableExp/DataTable.tsx +291 -0
- package/src/components/DataTableExp/DataTableExp.stories.tsx +329 -0
- package/src/components/DataTableExp/Docs.mdx +74 -0
- package/src/components/DataTableExp/components/ActionBar.tsx +87 -0
- package/src/components/DataTableExp/components/Cell.ts +41 -0
- package/src/components/DataTableExp/components/ColumnHeader.tsx +52 -0
- package/src/components/DataTableExp/components/ColumnMenu.tsx +96 -0
- package/src/components/DataTableExp/components/EmptyBodyContent.ts +23 -0
- package/src/components/DataTableExp/components/Header.ts +20 -0
- package/src/components/DataTableExp/components/LoadingCellContent.ts +39 -0
- package/src/components/DataTableExp/components/NoWrap.ts +5 -0
- package/src/components/DataTableExp/components/Row.ts +39 -0
- package/src/components/DataTableExp/components/ScrollContainer.ts +8 -0
- package/src/components/DataTableExp/components/SelectionCell.tsx +36 -0
- package/src/components/DataTableExp/components/SelectionHeader.tsx +20 -0
- package/src/components/DataTableExp/components/StickyHead.tsx +134 -0
- package/src/components/DataTableExp/components/TableGrid.ts +28 -0
- package/src/components/DataTableExp/components/Truncate.ts +7 -0
- package/src/components/DataTableExp/components/Wrapper.ts +26 -0
- package/src/components/DataTableExp/constants.ts +4 -0
- package/src/components/DataTableExp/hooks/index.tsx +6 -0
- package/src/components/DataTableExp/hooks/useCellWidths.ts +34 -0
- package/src/components/DataTableExp/hooks/useColumns.ts +14 -0
- package/src/components/DataTableExp/hooks/useDragToScroll.ts +48 -0
- package/src/components/DataTableExp/hooks/useNested.ts +31 -0
- package/src/components/DataTableExp/hooks/useScrollPosition.ts +45 -0
- package/src/components/DataTableExp/hooks/useSelection.tsx +92 -0
- package/src/components/DataTableExp/index.tsx +1 -0
- package/src/components/DataTableExp/renderers/index.tsx +5 -0
- package/src/components/DataTableExp/renderers/renderCell.ts +31 -0
- package/src/components/DataTableExp/renderers/renderFooter.tsx +33 -0
- package/src/components/DataTableExp/renderers/renderHeader.tsx +83 -0
- package/src/components/DataTableExp/renderers/renderLoadingCell.tsx +29 -0
- package/src/components/DataTableExp/renderers/renderNestedCell.tsx +33 -0
- package/src/components/DataTableExp/types.ts +168 -0
- package/src/components/DataTableExp/utils/GetSortIcon.tsx +24 -0
- package/src/components/DataTableExp/utils/alignmentToFlex.ts +14 -0
- package/src/components/DataTableExp/utils/generateTableCss.ts +114 -0
- package/src/components/DataTableExp/utils/getNextSortState.ts +18 -0
- package/src/components/DataTableExp/utils/getRowState.test.ts +33 -0
- package/src/components/DataTableExp/utils/getRowState.ts +17 -0
- package/src/components/DataTableExp/utils/index.ts +6 -0
- package/src/components/DataTableExp/utils/parseWidth.ts +12 -0
- package/src/components/DataTableExp/utils/sumAll.ts +7 -0
- package/src/components/DescriptionList/DescriptionList.stories.tsx +24 -0
- package/src/components/DescriptionList/DescriptionList.test.tsx +16 -0
- package/src/components/DescriptionList/DescriptionList.tsx +90 -0
- package/src/components/DescriptionList/__snapshots__/DescriptionList.test.tsx.snap +86 -0
- package/src/components/DescriptionList/index.ts +1 -0
- package/src/components/DetailPage/DetailPage.stories.tsx +45 -0
- package/src/components/DetailPage/DetailPage.test.tsx +15 -0
- package/src/components/DetailPage/DetailPage.tsx +23 -0
- package/src/components/DetailPage/__snapshots__/DetailPage.test.tsx.snap +52 -0
- package/src/components/DetailPage/index.ts +1 -0
- package/src/components/DetailPage/styled.ts +27 -0
- package/src/components/DimensionsInput/DimensionsInput.stories.tsx +33 -0
- package/src/components/DimensionsInput/DimensionsInput.test.tsx +98 -0
- package/src/components/DimensionsInput/DimensionsInput.tsx +63 -0
- package/src/components/DimensionsInput/__snapshots__/DimensionsInput.test.tsx.snap +303 -0
- package/src/components/DimensionsInput/index.ts +1 -0
- package/src/components/DimensionsInput/styled.ts +66 -0
- package/src/components/DimensionsInput/types.ts +16 -0
- package/src/components/FilterTag/FilterTag.stories.tsx +32 -0
- package/src/components/FilterTag/FilterTag.test.tsx +10 -0
- package/src/components/FilterTag/FilterTag.tsx +111 -0
- package/src/components/FilterTag/__snapshots__/FilterTag.test.tsx.snap +117 -0
- package/src/components/FilterTag/index.ts +1 -0
- package/src/components/FilterTag/styled.ts +77 -0
- package/src/components/FilterTag/types.ts +15 -0
- package/src/components/Grid/Grid.stories.mdx +34 -0
- package/src/components/Grid/Grid.test.tsx +14 -0
- package/src/components/Grid/__snapshots__/Grid.test.tsx.snap +32 -0
- package/src/components/Grid/index.ts +12 -0
- package/src/components/Grid/types.ts +10 -0
- package/src/components/Image/Image.stories.tsx +20 -0
- package/src/components/Image/Image.test.tsx +10 -0
- package/src/components/Image/Image.tsx +122 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +34 -0
- package/src/components/Image/components/PlaceholderImage.tsx +19 -0
- package/src/components/Image/components/styled.ts +17 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Image/types.ts +6 -0
- package/src/components/Image/utils.ts +8 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +33 -0
- package/src/components/InputGroup/InputGroup.test.tsx +15 -0
- package/src/components/InputGroup/__snapshots__/InputGroup.test.tsx.snap +182 -0
- package/src/components/InputGroup/index.ts +46 -0
- package/src/components/Loader/Docs.mdx +1 -1
- package/src/components/Loader/Grid.tsx +1 -3
- package/src/components/Loader/Loader.stories.tsx +1 -1
- package/src/components/Loader/Loader.test.tsx +14 -0
- package/src/components/Loader/Loader.tsx +5 -5
- package/src/components/Loader/TailSpin.tsx +1 -3
- package/src/components/Loader/ThreeDots.tsx +1 -3
- package/src/components/Loader/__snapshots__/Loader.test.tsx.snap +315 -13
- package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.stories.tsx +14 -0
- package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.test.tsx +19 -0
- package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx +38 -0
- package/src/components/LoginWithAmazonButton/index.tsx +1 -0
- package/src/components/LoginWithAmazonButton/styled.ts +14 -0
- package/src/components/Modal/Modal.stories.tsx +455 -0
- package/src/components/Modal/Modal.test.tsx +211 -0
- package/src/components/Modal/Modal.tsx +110 -0
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +1940 -0
- package/src/components/Modal/components/Dialog/Dialog.tsx +11 -0
- package/src/components/Modal/components/Dialog/constants.ts +48 -0
- package/src/components/Modal/components/Dialog/styled.ts +104 -0
- package/src/components/Modal/components/styled.ts +24 -0
- package/src/components/Modal/index.tsx +1 -0
- package/src/components/Modal/types.ts +61 -0
- package/src/components/PageHeader/PageHeader.test.tsx +40 -0
- package/src/components/PageHeader/PageHeader.tsx +119 -0
- package/src/components/PageHeader/PageHeaderDocs.mdx +69 -0
- package/src/components/PageHeader/__snapshots__/PageHeader.test.tsx.snap +906 -0
- package/src/components/PageHeader/index.ts +1 -0
- package/src/components/PageHeader/styled.ts +81 -0
- package/src/components/Pagination/Docs.mdx +61 -0
- package/src/components/Pagination/Pagination.stories.tsx +27 -0
- package/src/components/Pagination/Pagination.test.tsx +102 -0
- package/src/components/Pagination/Pagination.tsx +105 -0
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +395 -0
- package/src/components/Pagination/components.tsx +16 -0
- package/src/components/Pagination/hooks/usePagination.ts +88 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Pagination/styled.ts +31 -0
- package/src/components/Pagination/types.ts +9 -0
- package/src/components/PaginationRange/Items/Item/Item.tsx +14 -0
- package/src/components/PaginationRange/Items/Item/index.ts +1 -0
- package/src/components/PaginationRange/Items/Item/styled.ts +26 -0
- package/src/components/PaginationRange/Items/Item/types.ts +6 -0
- package/src/components/PaginationRange/Items/Items.tsx +27 -0
- package/src/components/PaginationRange/Items/index.ts +1 -0
- package/src/components/PaginationRange/PaginationRange.stories.tsx +14 -0
- package/src/components/PaginationRange/PaginationRange.test.tsx +10 -0
- package/src/components/PaginationRange/PaginationRange.tsx +69 -0
- package/src/components/PaginationRange/__snapshots__/PaginationRange.test.tsx.snap +155 -0
- package/src/components/PaginationRange/index.ts +1 -0
- package/src/components/PaginationRange/styled.ts +39 -0
- package/src/components/PaginationRange/types.ts +17 -0
- package/src/components/Popover/Popover.test.tsx +87 -0
- package/src/components/Popover/Popover.tsx +82 -0
- package/src/components/Popover/PopoverDemo.tsx +53 -0
- package/src/components/Popover/PopoverDocs.mdx +64 -0
- package/src/components/Popover/__snapshots__/Popover.test.tsx.snap +35 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Portal/Portal.stories.tsx +18 -0
- package/src/components/Portal/Portal.tsx +62 -0
- package/src/components/Portal/index.ts +1 -0
- package/src/components/PriceInput/PriceInput.stories.tsx +36 -0
- package/src/components/PriceInput/PriceInput.test.tsx +22 -0
- package/src/components/PriceInput/PriceInput.tsx +101 -0
- package/src/components/PriceInput/index.tsx +1 -0
- package/src/components/PriceInput/styled.ts +116 -0
- package/src/components/PriceInput/types.ts +13 -0
- package/src/components/Radio/Radio.stories.tsx +57 -0
- package/src/components/Radio/Radio.test.tsx +8 -0
- package/src/components/Radio/Radio.tsx +39 -0
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +128 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Radio/styled.ts +58 -0
- package/src/components/Search/Search.stories.mdx +23 -0
- package/src/components/Search/Search.stories.tsx +31 -0
- package/src/components/Search/Search.test.tsx +12 -0
- package/src/components/Search/Search.tsx +87 -0
- package/src/components/Search/__snapshots__/Search.test.tsx.snap +162 -0
- package/src/components/Search/index.ts +1 -0
- package/src/components/Search/styled.ts +46 -0
- package/src/components/Search/types.ts +10 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +43 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +67 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +27 -0
- package/src/components/SegmentedControl/__snapshots__/SegmentedControl.test.tsx.snap +825 -0
- package/src/components/SegmentedControl/index.ts +1 -0
- package/src/components/SegmentedControl/styled.ts +50 -0
- package/src/components/SegmentedControl/types.ts +13 -0
- package/src/components/Select/Select.stories.tsx +37 -0
- package/src/components/Select/Select.test.tsx +37 -0
- package/src/components/Select/Select.tsx +58 -0
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +199 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Select/styled.ts +53 -0
- package/src/components/SimpleTable/SimpleTable.stories.tsx +60 -0
- package/src/components/SimpleTable/SimpleTable.test.tsx +28 -0
- package/src/components/SimpleTable/SimpleTable.tsx +18 -0
- package/src/components/SimpleTable/__snapshots__/SimpleTable.test.tsx.snap +87 -0
- package/src/components/SimpleTable/index.ts +1 -0
- package/src/components/SimpleTable/styled.ts +68 -0
- package/src/components/SimpleTable/types.ts +7 -0
- package/src/components/Slider/Select.stories.tsx +43 -0
- package/src/components/Slider/Slider.test.tsx +19 -0
- package/src/components/Slider/Slider.tsx +197 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +109 -0
- package/src/components/Slider/index.ts +1 -0
- package/src/components/Slider/styled.ts +53 -0
- package/src/components/Slider/types.ts +30 -0
- package/src/components/Stack/Alignments.ts +1 -3
- package/src/components/Stack/Stack.test.tsx +46 -0
- package/src/components/Stack/Stack.tsx +1 -2
- package/src/components/Stack/__snapshots__/Stack.test.tsx.snap +240 -10
- package/src/components/Stack/types.ts +1 -1
- package/src/components/Stepper/Stepper.stories.tsx +14 -0
- package/src/components/Stepper/Stepper.test.tsx +8 -0
- package/src/components/Stepper/Stepper.tsx +33 -0
- package/src/components/Stepper/__snapshots__/Stepper.test.tsx.snap +142 -0
- package/src/components/Stepper/index.ts +1 -0
- package/src/components/Stepper/styled.ts +83 -0
- package/src/components/Tag/Tag.stories.tsx +43 -0
- package/src/components/Tag/Tag.test.tsx +18 -0
- package/src/components/Tag/Tag.ts +23 -0
- package/src/components/Tag/__snapshots__/Tag.test.tsx.snap +78 -0
- package/src/components/Tag/index.ts +1 -0
- package/src/components/Text/Docs.mdx +112 -0
- package/src/components/Text/Text.stories.tsx +27 -0
- package/src/components/Text/Text.test.tsx +38 -0
- package/src/components/Text/Text.ts +44 -0
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +1158 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/Text/textVariants.ts +41 -0
- package/src/components/Text/types.ts +33 -0
- package/src/components/Text/utils.ts +23 -0
- package/src/components/TextField/Docs.mdx +14 -0
- package/src/components/TextField/TextField.stories.tsx +38 -0
- package/src/components/TextField/TextField.test.tsx +27 -0
- package/src/components/TextField/TextField.tsx +92 -0
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +205 -0
- package/src/components/TextField/index.ts +4 -0
- package/src/components/TextField/styled.ts +95 -0
- package/src/components/TextField/types.ts +41 -0
- package/src/components/ToastsLayout/ToastsLayout.stories.tsx +88 -0
- package/src/components/ToastsLayout/ToastsLayout.tsx +39 -0
- package/src/components/ToastsLayout/components/Toast.tsx +78 -0
- package/src/components/ToastsLayout/components/styled.ts +76 -0
- package/src/components/ToastsLayout/index.ts +1 -0
- package/src/components/ToastsLayout/types.ts +41 -0
- package/src/components/Toggle/Toggle.stories.tsx +41 -0
- package/src/components/Toggle/Toggle.test.tsx +57 -0
- package/src/components/Toggle/Toggle.tsx +31 -0
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +219 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/Toggle/styled.ts +84 -0
- package/src/components/Toggle/types.ts +10 -0
- package/src/components/ToggleButton/ToggleButton.stories.tsx +19 -0
- package/src/components/ToggleButton/ToggleButton.test.tsx +12 -0
- package/src/components/ToggleButton/ToggleButton.tsx +31 -0
- package/src/components/ToggleButton/__snapshots__/ToggleButton.test.tsx.snap +83 -0
- package/src/components/ToggleButton/index.ts +1 -0
- package/src/components/ToggleButton/styled.ts +92 -0
- package/src/components/Tooltip/Docs.mdx +14 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +26 -0
- package/src/components/Tooltip/Tooltip.test.tsx +25 -0
- package/src/components/Tooltip/Tooltip.tsx +95 -0
- package/src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap +17 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Tooltip/styled.ts +74 -0
- package/src/components/Tooltip/types.ts +44 -0
- package/src/components/VideoModal/VideoModal.stories.tsx +36 -0
- package/src/components/VideoModal/VideoModal.test.tsx +36 -0
- package/src/components/VideoModal/VideoModal.tsx +40 -0
- package/src/components/VideoModal/VideoModalDemo.tsx +19 -0
- package/src/components/VideoModal/__snapshots__/VideoModal.test.tsx.snap +165 -0
- package/src/components/VideoModal/components/Popup.tsx +44 -0
- package/src/components/VideoModal/components/styled.ts +34 -0
- package/src/components/VideoModal/index.ts +1 -0
- package/src/components/VideoModal/styled.ts +24 -0
- package/src/components/VideoModal/types.ts +9 -0
- package/src/components/View/View.stories.tsx +26 -0
- package/src/components/View/View.test.tsx +10 -0
- package/src/components/View/View.tsx +120 -0
- package/src/components/View/__snapshots__/View.test.tsx.snap +80 -0
- package/src/components/View/index.ts +1 -0
- package/src/components/View/styled.ts +82 -0
- package/src/components/View/types.ts +42 -0
- package/src/components/WeightInput/WeightInput.stories.tsx +26 -0
- package/src/components/WeightInput/WeightInput.test.tsx +11 -0
- package/src/components/WeightInput/WeightInput.tsx +66 -0
- package/src/components/WeightInput/__snapshots__/WeightInput.test.tsx.snap +272 -0
- package/src/components/WeightInput/index.ts +1 -0
- package/src/components/WeightInput/styled.ts +39 -0
- package/src/components/WeightInput/types.ts +31 -0
- package/src/components/index.ts +50 -0
- package/src/components/types.ts +23 -0
- package/src/hoc/index.ts +2 -0
- package/src/hoc/withDeprecated.tsx +11 -0
- package/src/hoc/withLabels/index.ts +1 -0
- package/src/hoc/withLabels/styled.ts +54 -0
- package/src/hoc/withLabels/withLabels.tsx +46 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useClickOutside.ts +40 -0
- package/src/hooks/useDebounce.ts +15 -0
- package/src/hooks/useDropdown.ts +22 -0
- package/src/hooks/useFocusVisible.tsx +157 -0
- package/src/hooks/useHover.ts +9 -0
- package/src/hooks/useIsOverflowing.ts +32 -0
- package/src/hooks/useTabs.ts +24 -0
- package/src/index.ts +3 -0
- package/src/tempIcons/ArrowDownIcon.tsx +12 -0
- package/src/tempIcons/ArrowUpIcon.tsx +12 -0
- package/src/tempIcons/AttentionIcon.tsx +12 -0
- package/src/tempIcons/CalendarIcon.tsx +12 -0
- package/src/tempIcons/ClipboardIcon.tsx +10 -0
- package/src/tempIcons/CrossIcon.tsx +20 -0
- package/src/tempIcons/DoubleArrowAscIcon.tsx +8 -0
- package/src/tempIcons/DoubleArrowDescIcon.tsx +8 -0
- package/src/tempIcons/DoubleArrowIcon.tsx +8 -0
- package/src/tempIcons/DoubleArrowIconIcon.tsx +8 -0
- package/src/tempIcons/DownArrowIcon.tsx +20 -0
- package/src/tempIcons/DropdownIcon.tsx +14 -0
- package/src/tempIcons/EditIcon.tsx +12 -0
- package/src/tempIcons/EndArrowIcon.tsx +18 -0
- package/src/tempIcons/FailIcon.tsx +12 -0
- package/src/tempIcons/HelpIcon.tsx +12 -0
- package/src/tempIcons/InfoIcon.tsx +14 -0
- package/src/tempIcons/LeftArrowIcon.tsx +12 -0
- package/src/tempIcons/MergeIcon.tsx +12 -0
- package/src/tempIcons/MoreHorizIcon.tsx +10 -0
- package/src/tempIcons/ReorderIcon.tsx +10 -0
- package/src/tempIcons/RightArrowIcon.tsx +12 -0
- package/src/tempIcons/SearchIcon.tsx +12 -0
- package/src/tempIcons/StartArrowIcon.tsx +16 -0
- package/src/tempIcons/SuccessIcon.tsx +12 -0
- package/src/tempIcons/UpArrowIcon.tsx +20 -0
- package/src/tempIcons/VisibilityIcon.tsx +10 -0
- package/src/tempIcons/VisibilityOffIcon.tsx +10 -0
- package/src/theme/index.ts +2 -2
- package/src/theme/modules/shadows.ts +1 -1
- package/src/utils/buildClassnames.ts +2 -0
- package/src/utils/color.ts +27 -0
- package/src/utils/generateId.ts +4 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/paginationList.ts +6 -0
- package/src/utils/setupIntersectionObserverMock.ts +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text } from './Text';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const headerVariants = [
|
|
2
|
+
'headingXXL',
|
|
3
|
+
'headingXL',
|
|
4
|
+
'headingLarge',
|
|
5
|
+
'headingMedium',
|
|
6
|
+
'headingSmall',
|
|
7
|
+
] as const;
|
|
8
|
+
|
|
9
|
+
export const textVariants = [
|
|
10
|
+
...headerVariants,
|
|
11
|
+
'headingTable',
|
|
12
|
+
'subheadingLarge',
|
|
13
|
+
'subheadingMedium',
|
|
14
|
+
'subheadingSmall',
|
|
15
|
+
'subheadingSmallBold',
|
|
16
|
+
'body',
|
|
17
|
+
'bodySmall',
|
|
18
|
+
'bodyBold',
|
|
19
|
+
'bodyBoldDark',
|
|
20
|
+
'bodySmallBold',
|
|
21
|
+
'inputLabel',
|
|
22
|
+
'inputLabelSmall',
|
|
23
|
+
'hintText',
|
|
24
|
+
'placeholder',
|
|
25
|
+
'placeholderSmall',
|
|
26
|
+
'placeholderCode',
|
|
27
|
+
'placeholderCodeSmall',
|
|
28
|
+
'error',
|
|
29
|
+
'errorSmall',
|
|
30
|
+
'successSmall',
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
/** @deprecated do not use me */
|
|
34
|
+
export const deprecatedTextVariants = [
|
|
35
|
+
'button',
|
|
36
|
+
'buttonSmall',
|
|
37
|
+
'linkLarge',
|
|
38
|
+
'linkMedium',
|
|
39
|
+
'link',
|
|
40
|
+
'linkSmall',
|
|
41
|
+
] as const;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { textVariants, deprecatedTextVariants, headerVariants } from './textVariants';
|
|
2
|
+
|
|
3
|
+
export type HeaderVariant = (typeof headerVariants)[number];
|
|
4
|
+
export type TextVariant = (typeof textVariants)[number];
|
|
5
|
+
export type DeprecatedTextVariants = (typeof deprecatedTextVariants)[number];
|
|
6
|
+
|
|
7
|
+
// Likely not exhaustive, extend if proper.
|
|
8
|
+
export type ValidTextTag =
|
|
9
|
+
| 'h1'
|
|
10
|
+
| 'h2'
|
|
11
|
+
| 'h3'
|
|
12
|
+
| 'h4'
|
|
13
|
+
| 'h5'
|
|
14
|
+
| 'h6'
|
|
15
|
+
| 'p'
|
|
16
|
+
| 'span'
|
|
17
|
+
| 'label'
|
|
18
|
+
| 'li'
|
|
19
|
+
| 'ol'
|
|
20
|
+
| 'ul'
|
|
21
|
+
| 'blockquote'
|
|
22
|
+
| 'code';
|
|
23
|
+
|
|
24
|
+
export type TextProps = {
|
|
25
|
+
as?: ValidTextTag;
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
} & (
|
|
28
|
+
| { variant: TextVariant }
|
|
29
|
+
| {
|
|
30
|
+
/** @deprecated to be removed, bad for accessibility. Use `Button` or `Anchor` */
|
|
31
|
+
variant?: DeprecatedTextVariants;
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TextVariant, DeprecatedTextVariants, ValidTextTag } from './types';
|
|
2
|
+
|
|
3
|
+
const componentMap: { [key in TextVariant | DeprecatedTextVariants]?: string } = {
|
|
4
|
+
inputLabel: 'label',
|
|
5
|
+
inputLabelSmall: 'label',
|
|
6
|
+
headingSmall: 'h3',
|
|
7
|
+
headingMedium: 'h3',
|
|
8
|
+
headingLarge: 'h2',
|
|
9
|
+
headingXL: 'h1',
|
|
10
|
+
headingXXL: 'h1',
|
|
11
|
+
// Deprecated, but quickfix for A11y.
|
|
12
|
+
button: 'button',
|
|
13
|
+
buttonSmall: 'button',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getComponentOverride = (
|
|
17
|
+
as: ValidTextTag | undefined,
|
|
18
|
+
variant: TextVariant | DeprecatedTextVariants | undefined,
|
|
19
|
+
) => {
|
|
20
|
+
if (as) return as;
|
|
21
|
+
if (variant) return componentMap[variant];
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Primary, Controls, Story } from '@storybook/blocks';
|
|
2
|
+
import * as TextFieldStories from './TextField.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={TextFieldStories} />
|
|
5
|
+
|
|
6
|
+
# TextField
|
|
7
|
+
|
|
8
|
+
Our main text input component.
|
|
9
|
+
|
|
10
|
+
<Primary />
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
<Controls />
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextField } from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Forms/TextField',
|
|
6
|
+
component: TextField,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const baseArgs = {
|
|
10
|
+
disabled: false,
|
|
11
|
+
hasError: false,
|
|
12
|
+
placeholder: 'Placeholder',
|
|
13
|
+
size: 'base',
|
|
14
|
+
value: '',
|
|
15
|
+
label: '',
|
|
16
|
+
hint: '',
|
|
17
|
+
error: '',
|
|
18
|
+
tooltip: '',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const InputOnly = (args: any) => <TextField {...args} />;
|
|
22
|
+
|
|
23
|
+
InputOnly.args = baseArgs;
|
|
24
|
+
|
|
25
|
+
export const WithLabels = (args: any) => <TextField {...args} />;
|
|
26
|
+
|
|
27
|
+
WithLabels.args = {
|
|
28
|
+
...baseArgs,
|
|
29
|
+
label: 'HS Code',
|
|
30
|
+
hint: (
|
|
31
|
+
<span>
|
|
32
|
+
<span>May be populated by the order channel or ship from location. </span>
|
|
33
|
+
<a href="https://veeqo.com">Learn more</a>
|
|
34
|
+
</span>
|
|
35
|
+
),
|
|
36
|
+
error: 'Value entered is not a valid HS code',
|
|
37
|
+
tooltip: 'This is an example tooltip',
|
|
38
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
import { TextField } from '.';
|
|
5
|
+
|
|
6
|
+
describe('TextField', () => {
|
|
7
|
+
test('Renders correctly', () => {
|
|
8
|
+
const { asFragment } = render(
|
|
9
|
+
<TextField
|
|
10
|
+
label="Test label"
|
|
11
|
+
hint="Test hint"
|
|
12
|
+
error="Test error"
|
|
13
|
+
name="test-input"
|
|
14
|
+
value="one"
|
|
15
|
+
onChange={() => {}}
|
|
16
|
+
/>,
|
|
17
|
+
);
|
|
18
|
+
const tree = asFragment();
|
|
19
|
+
expect(tree).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('has an accessible name', () => {
|
|
23
|
+
render(<TextField label="My Test Input" value="" onChange={() => {}} />);
|
|
24
|
+
const input = screen.getByRole('textbox', { name: 'My Test Input' });
|
|
25
|
+
expect(input).toBeVisible();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useCallback, ChangeEvent } from 'react';
|
|
2
|
+
import { TextFieldProps } from './types';
|
|
3
|
+
import { generateId } from '../../utils/generateId';
|
|
4
|
+
|
|
5
|
+
import { Input, Textarea } from './styled';
|
|
6
|
+
import { ComponentSize } from '../types';
|
|
7
|
+
|
|
8
|
+
const NUMBER_REGEX = /^-?[0-9]*\.?[0-9]+$/;
|
|
9
|
+
|
|
10
|
+
export const TextField = ({
|
|
11
|
+
className,
|
|
12
|
+
disabled = false,
|
|
13
|
+
hasError,
|
|
14
|
+
max,
|
|
15
|
+
min,
|
|
16
|
+
multiline = false,
|
|
17
|
+
name,
|
|
18
|
+
onChange,
|
|
19
|
+
pattern,
|
|
20
|
+
placeholder,
|
|
21
|
+
rows = '3',
|
|
22
|
+
size = ComponentSize.base,
|
|
23
|
+
step,
|
|
24
|
+
type = 'text',
|
|
25
|
+
value,
|
|
26
|
+
spellCheck = false,
|
|
27
|
+
...otherProps
|
|
28
|
+
}: TextFieldProps) => {
|
|
29
|
+
const handleChange = useCallback(
|
|
30
|
+
(event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
31
|
+
const newValue = event.currentTarget.value;
|
|
32
|
+
|
|
33
|
+
if (newValue === '') {
|
|
34
|
+
onChange(newValue);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (type !== 'number') {
|
|
39
|
+
onChange(newValue);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const reg = new RegExp(NUMBER_REGEX);
|
|
44
|
+
if (!reg.test(newValue)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onChange(newValue);
|
|
49
|
+
},
|
|
50
|
+
[onChange, type],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const id = generateId('textfield');
|
|
54
|
+
|
|
55
|
+
if (type === 'text' && multiline) {
|
|
56
|
+
return (
|
|
57
|
+
<Textarea
|
|
58
|
+
className={className}
|
|
59
|
+
disabled={disabled}
|
|
60
|
+
hasError={hasError}
|
|
61
|
+
id={id}
|
|
62
|
+
name={name}
|
|
63
|
+
onChange={handleChange}
|
|
64
|
+
placeholder={placeholder}
|
|
65
|
+
rows={rows}
|
|
66
|
+
value={value}
|
|
67
|
+
spellCheck={spellCheck}
|
|
68
|
+
{...otherProps}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<Input
|
|
75
|
+
className={className}
|
|
76
|
+
disabled={disabled}
|
|
77
|
+
hasError={hasError}
|
|
78
|
+
id={id}
|
|
79
|
+
inputSize={size}
|
|
80
|
+
max={max}
|
|
81
|
+
min={min}
|
|
82
|
+
name={name}
|
|
83
|
+
onChange={handleChange}
|
|
84
|
+
placeholder={placeholder}
|
|
85
|
+
step={step}
|
|
86
|
+
type={type}
|
|
87
|
+
value={value}
|
|
88
|
+
spellCheck={spellCheck}
|
|
89
|
+
{...otherProps}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`TextField Renders correctly 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
.c0 {
|
|
6
|
+
display: -webkit-box;
|
|
7
|
+
display: -webkit-flex;
|
|
8
|
+
display: -ms-flexbox;
|
|
9
|
+
display: flex;
|
|
10
|
+
-webkit-align-items: stretch;
|
|
11
|
+
-webkit-box-align: stretch;
|
|
12
|
+
-ms-flex-align: stretch;
|
|
13
|
+
align-items: stretch;
|
|
14
|
+
-webkit-box-pack: start;
|
|
15
|
+
-webkit-justify-content: flex-start;
|
|
16
|
+
-ms-flex-pack: start;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
-webkit-flex-direction: column;
|
|
19
|
+
-ms-flex-direction: column;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.c0 > * {
|
|
24
|
+
-webkit-flex: undefined;
|
|
25
|
+
-ms-flex: undefined;
|
|
26
|
+
flex: undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.c0 > * + * {
|
|
30
|
+
margin-top: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.c2 {
|
|
34
|
+
display: -webkit-box;
|
|
35
|
+
display: -webkit-flex;
|
|
36
|
+
display: -ms-flexbox;
|
|
37
|
+
display: flex;
|
|
38
|
+
-webkit-align-items: center;
|
|
39
|
+
-webkit-box-align: center;
|
|
40
|
+
-ms-flex-align: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
-webkit-box-pack: start;
|
|
43
|
+
-webkit-justify-content: flex-start;
|
|
44
|
+
-ms-flex-pack: start;
|
|
45
|
+
justify-content: flex-start;
|
|
46
|
+
-webkit-flex-direction: row;
|
|
47
|
+
-ms-flex-direction: row;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.c2 > * {
|
|
52
|
+
-webkit-flex: undefined;
|
|
53
|
+
-ms-flex: undefined;
|
|
54
|
+
flex: undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.c2 > * + * {
|
|
58
|
+
margin-left: 0.5rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.c3 {
|
|
62
|
+
display: block;
|
|
63
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
line-height: 20px;
|
|
67
|
+
color: #37424D;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.c4 {
|
|
71
|
+
display: block;
|
|
72
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
73
|
+
font-size: 0.75rem;
|
|
74
|
+
line-height: 1rem;
|
|
75
|
+
color: #637381;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.c6 {
|
|
79
|
+
display: block;
|
|
80
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
color: #EB5757;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.c6::before {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
bottom: 0;
|
|
92
|
+
left: calc(0.5rem * -1);
|
|
93
|
+
width: 2px;
|
|
94
|
+
background-color: #EB5757;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.c1 {
|
|
98
|
+
position: relative;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.c5 {
|
|
102
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
display: -webkit-box;
|
|
105
|
+
display: -webkit-flex;
|
|
106
|
+
display: -ms-flexbox;
|
|
107
|
+
display: flex;
|
|
108
|
+
-webkit-align-items: center;
|
|
109
|
+
-webkit-box-align: center;
|
|
110
|
+
-ms-flex-align: center;
|
|
111
|
+
align-items: center;
|
|
112
|
+
-webkit-box-pack: center;
|
|
113
|
+
-webkit-justify-content: center;
|
|
114
|
+
-ms-flex-pack: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
padding: 0 12px;
|
|
117
|
+
border-radius: 4px;
|
|
118
|
+
border: 1px solid #959fa8;
|
|
119
|
+
color: #1b2126;
|
|
120
|
+
height: 40px;
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.c5 {
|
|
125
|
+
--outline-size: 4px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.c5:focus {
|
|
129
|
+
border-color: #0079d1;
|
|
130
|
+
box-shadow: 0 0 0 var(--outline-size) #80bce8;
|
|
131
|
+
outline: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.c5:invalid {
|
|
135
|
+
border-color: #eb5757;
|
|
136
|
+
box-shadow: 0 0 0 var(--outline-size) #f7bcbc;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.c5:disabled {
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
background-color: #f2f3f5;
|
|
142
|
+
border-color: #959fa8;
|
|
143
|
+
color: #637381;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.c5,
|
|
147
|
+
.c5:focus {
|
|
148
|
+
border-color: #EB5757;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.c5:focus {
|
|
152
|
+
box-shadow: 0 0 0 var(--outline-size) #F7BCBC;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.c5::-webkit-outer-spin-button,
|
|
156
|
+
.c5::-webkit-inner-spin-button {
|
|
157
|
+
-webkit-appearance: none;
|
|
158
|
+
margin: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.c5[type='number'] {
|
|
162
|
+
-moz-appearance: textfield;
|
|
163
|
+
width: 8ch;
|
|
164
|
+
text-align: right;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
<div
|
|
168
|
+
class="c0 c1"
|
|
169
|
+
spacing="sm"
|
|
170
|
+
>
|
|
171
|
+
<div>
|
|
172
|
+
<div
|
|
173
|
+
class="c2"
|
|
174
|
+
direction="horizontal"
|
|
175
|
+
spacing="sm"
|
|
176
|
+
>
|
|
177
|
+
<label
|
|
178
|
+
class="c3"
|
|
179
|
+
for="test-id"
|
|
180
|
+
>
|
|
181
|
+
Test label
|
|
182
|
+
</label>
|
|
183
|
+
</div>
|
|
184
|
+
<span
|
|
185
|
+
class="c4"
|
|
186
|
+
>
|
|
187
|
+
Test hint
|
|
188
|
+
</span>
|
|
189
|
+
</div>
|
|
190
|
+
<input
|
|
191
|
+
class="c5"
|
|
192
|
+
id="test-id"
|
|
193
|
+
name="test-input"
|
|
194
|
+
spellcheck="false"
|
|
195
|
+
type="text"
|
|
196
|
+
value="one"
|
|
197
|
+
/>
|
|
198
|
+
<span
|
|
199
|
+
class="c6"
|
|
200
|
+
>
|
|
201
|
+
Test error
|
|
202
|
+
</span>
|
|
203
|
+
</div>
|
|
204
|
+
</DocumentFragment>
|
|
205
|
+
`;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { theme } from '../../theme';
|
|
3
|
+
|
|
4
|
+
interface InputProps {
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
inputSize: 'sm' | 'base';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const pseudoStates = ({ hasError, inputSize }: InputProps) => css`
|
|
10
|
+
& {
|
|
11
|
+
--outline-size: ${inputSize === 'sm' ? '2px' : '4px'};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:focus {
|
|
15
|
+
border-color: #0079d1;
|
|
16
|
+
box-shadow: 0 0 0 var(--outline-size) #80bce8;
|
|
17
|
+
outline: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:invalid {
|
|
21
|
+
border-color: #eb5757;
|
|
22
|
+
box-shadow: 0 0 0 var(--outline-size) #f7bcbc;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:disabled {
|
|
26
|
+
box-shadow: none;
|
|
27
|
+
background-color: #f2f3f5;
|
|
28
|
+
border-color: #959fa8;
|
|
29
|
+
color: #637381;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${hasError &&
|
|
33
|
+
`
|
|
34
|
+
&,
|
|
35
|
+
&:focus {
|
|
36
|
+
border-color: #EB5757;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus {
|
|
40
|
+
box-shadow: 0 0 0 var(--outline-size) #F7BCBC;
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const Input = styled.input<any>`
|
|
46
|
+
font-family: ${theme.fontFamily};
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
padding: 0 12px;
|
|
52
|
+
border-radius: 4px;
|
|
53
|
+
border: 1px solid #959fa8;
|
|
54
|
+
color: #1b2126;
|
|
55
|
+
|
|
56
|
+
${({ inputSize }) => {
|
|
57
|
+
let height = '40px';
|
|
58
|
+
let fontSize = '14px';
|
|
59
|
+
|
|
60
|
+
if (inputSize === 'sm') {
|
|
61
|
+
height = '32px';
|
|
62
|
+
fontSize = '12px';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return `
|
|
66
|
+
height: ${height};
|
|
67
|
+
font-size: ${fontSize};
|
|
68
|
+
`;
|
|
69
|
+
}}
|
|
70
|
+
|
|
71
|
+
${pseudoStates}
|
|
72
|
+
|
|
73
|
+
/* Hide number arrows/spinners */
|
|
74
|
+
&::-webkit-outer-spin-button,
|
|
75
|
+
&::-webkit-inner-spin-button {
|
|
76
|
+
-webkit-appearance: none;
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
&[type='number'] {
|
|
80
|
+
-moz-appearance: textfield;
|
|
81
|
+
width: 8ch;
|
|
82
|
+
text-align: right;
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
export const Textarea = styled.textarea<any>`
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
width: 100%;
|
|
89
|
+
padding: 8px;
|
|
90
|
+
border-radius: 4px;
|
|
91
|
+
border: 1px solid #959fa8;
|
|
92
|
+
color: #1b2126;
|
|
93
|
+
|
|
94
|
+
${pseudoStates}
|
|
95
|
+
`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComponentSize, EventHandlerProps } from '../types';
|
|
2
|
+
|
|
3
|
+
export type TextFieldType =
|
|
4
|
+
| 'text'
|
|
5
|
+
| 'email'
|
|
6
|
+
| 'number'
|
|
7
|
+
| 'password'
|
|
8
|
+
| 'search'
|
|
9
|
+
| 'tel'
|
|
10
|
+
| 'url'
|
|
11
|
+
| 'date'
|
|
12
|
+
| 'datetime-local'
|
|
13
|
+
| 'month'
|
|
14
|
+
| 'time'
|
|
15
|
+
| 'week'
|
|
16
|
+
| 'currency';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* TextField properties.
|
|
20
|
+
*/
|
|
21
|
+
export type TextFieldProps = Omit<EventHandlerProps, 'onChange' | 'onKeyDown'> &
|
|
22
|
+
Pick<React.InputHTMLAttributes<HTMLInputElement>, 'autoComplete' | 'onKeyDown'> & {
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Input element type */
|
|
25
|
+
type?: TextFieldType;
|
|
26
|
+
value: string;
|
|
27
|
+
onChange: (value: string) => void;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
step?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
min?: string;
|
|
32
|
+
max?: string;
|
|
33
|
+
pattern?: string;
|
|
34
|
+
hasError?: boolean;
|
|
35
|
+
size?: ComponentSize;
|
|
36
|
+
multiline?: boolean;
|
|
37
|
+
rows?: string;
|
|
38
|
+
invalid?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
spellCheck?: boolean;
|
|
41
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToastsLayout } from '.';
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { Stack } from '../Stack';
|
|
6
|
+
import { Notification } from './types';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/UI/ToastsLayout',
|
|
10
|
+
component: ToastsLayout,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
} satisfies Meta<typeof ToastsLayout>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
render: () => {
|
|
20
|
+
const [toasts, setToasts] = React.useState<Notification[]>([]);
|
|
21
|
+
const [key, setKey] = React.useState(1);
|
|
22
|
+
const onClick = () => {
|
|
23
|
+
setKey(key + 1);
|
|
24
|
+
setToasts([
|
|
25
|
+
...toasts,
|
|
26
|
+
{
|
|
27
|
+
key: key.toString(),
|
|
28
|
+
type: 'success',
|
|
29
|
+
text: `Some success message №${key}`,
|
|
30
|
+
} as Notification,
|
|
31
|
+
]);
|
|
32
|
+
};
|
|
33
|
+
const onClose = (key: any) => {
|
|
34
|
+
setToasts(toasts.filter((item) => item.key !== key));
|
|
35
|
+
};
|
|
36
|
+
return (
|
|
37
|
+
<div style={{ margin: 24 }}>
|
|
38
|
+
<Button onClick={onClick}>Show toast</Button>
|
|
39
|
+
<ToastsLayout toasts={toasts} onClose={onClose} />
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
toasts: [],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const WithCTA: Story = {
|
|
49
|
+
render: () => {
|
|
50
|
+
const [toasts, setToasts] = React.useState<Notification[]>([]);
|
|
51
|
+
const [key, setKey] = React.useState(1);
|
|
52
|
+
const cta = (
|
|
53
|
+
<Stack direction="horizontal">
|
|
54
|
+
<Button size="sm" variant="primary" onClick={() => alert('success')}>
|
|
55
|
+
Action
|
|
56
|
+
</Button>
|
|
57
|
+
<Button size="sm" variant="primaryDestructive" onClick={() => alert('error')}>
|
|
58
|
+
Action
|
|
59
|
+
</Button>
|
|
60
|
+
</Stack>
|
|
61
|
+
);
|
|
62
|
+
const onClick = () => {
|
|
63
|
+
setKey(key + 1);
|
|
64
|
+
setToasts([
|
|
65
|
+
...toasts,
|
|
66
|
+
{
|
|
67
|
+
key: key.toString(),
|
|
68
|
+
type: 'info',
|
|
69
|
+
text: `Some success message №${key}`,
|
|
70
|
+
cta,
|
|
71
|
+
} as Notification,
|
|
72
|
+
]);
|
|
73
|
+
};
|
|
74
|
+
const onClose = (key: string) => {
|
|
75
|
+
setToasts(toasts.filter((item) => item.key !== key));
|
|
76
|
+
};
|
|
77
|
+
console.log(toasts);
|
|
78
|
+
return (
|
|
79
|
+
<div style={{ margin: 24 }}>
|
|
80
|
+
<Button onClick={onClick}>Show toast</Button>
|
|
81
|
+
<ToastsLayout toasts={toasts} onClose={onClose} />
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
args: {
|
|
86
|
+
toasts: [],
|
|
87
|
+
},
|
|
88
|
+
};
|