@veeqo/ui 0.0.1 → 0.0.4
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 +29 -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 +36 -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 +9 -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/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/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/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/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 +34 -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 +23 -0
- package/lib/components/Pagination/Pagination.d.ts +3 -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 +29 -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 +11 -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 +33 -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/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 +5 -520
- 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/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/package.json +68 -14
- package/rollup.config.mjs +6 -19
- 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
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`CardHeader renders correctly 1`] = `
|
|
4
|
+
.c2 {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
font-weight: normal;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
13
|
+
line-height: 16px;
|
|
14
|
+
color: #37424d;
|
|
15
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
color: #37424D;
|
|
21
|
+
-webkit-text-decoration: none;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
-webkit-letter-spacing: -0.011rem;
|
|
24
|
+
-moz-letter-spacing: -0.011rem;
|
|
25
|
+
-ms-letter-spacing: -0.011rem;
|
|
26
|
+
letter-spacing: -0.011rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.c6 {
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
display: inline-block;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
font-style: normal;
|
|
35
|
+
font-weight: normal;
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
38
|
+
line-height: 16px;
|
|
39
|
+
color: #37424d;
|
|
40
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-weight: normal;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
line-height: 16px;
|
|
45
|
+
color: #637381;
|
|
46
|
+
-webkit-text-decoration: none;
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
-webkit-letter-spacing: 0;
|
|
49
|
+
-moz-letter-spacing: 0;
|
|
50
|
+
-ms-letter-spacing: 0;
|
|
51
|
+
letter-spacing: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.c5 {
|
|
55
|
+
display: -webkit-inline-box;
|
|
56
|
+
display: -webkit-inline-flex;
|
|
57
|
+
display: -ms-inline-flexbox;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
-webkit-align-items: center;
|
|
60
|
+
-webkit-box-align: center;
|
|
61
|
+
-ms-flex-align: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.c5 svg {
|
|
67
|
+
width: 1.5rem;
|
|
68
|
+
height: 1.5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.c3 {
|
|
72
|
+
position: relative;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
-webkit-appearance: none;
|
|
75
|
+
-moz-appearance: none;
|
|
76
|
+
appearance: none;
|
|
77
|
+
display: -webkit-box;
|
|
78
|
+
display: -webkit-flex;
|
|
79
|
+
display: -ms-flexbox;
|
|
80
|
+
display: flex;
|
|
81
|
+
-webkit-align-items: center;
|
|
82
|
+
-webkit-box-align: center;
|
|
83
|
+
-ms-flex-align: center;
|
|
84
|
+
align-items: center;
|
|
85
|
+
-webkit-box-pack: center;
|
|
86
|
+
-webkit-justify-content: center;
|
|
87
|
+
-ms-flex-pack: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
-webkit-flex-shrink: 0;
|
|
90
|
+
-ms-flex-negative: 0;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
|
93
|
+
font-weight: 400;
|
|
94
|
+
border: 1px solid;
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
--outline-width: 4px;
|
|
98
|
+
height: 40px;
|
|
99
|
+
padding-left: 8px;
|
|
100
|
+
padding-right: 8px;
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
font-size: 16px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.c3:hover {
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.c3:disabled {
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
cursor: unset !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.c3 > span {
|
|
115
|
+
position: relative;
|
|
116
|
+
top: -1px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.c4 {
|
|
120
|
+
border-color: transparent;
|
|
121
|
+
box-shadow: none;
|
|
122
|
+
color: #37424D;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.c4:hover {
|
|
126
|
+
background-color: rgba(0,0,0,0.1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.c4:active {
|
|
130
|
+
background-color: rgba(0,0,0,0.1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.c4:focus-visible {
|
|
134
|
+
box-shadow: 0 0 0 var(--outline-width) #80BCE8;
|
|
135
|
+
outline: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.c4:disabled {
|
|
139
|
+
background-color: transparent;
|
|
140
|
+
border-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.c0 {
|
|
144
|
+
padding-top: 1.5rem;
|
|
145
|
+
padding-right: 1.5rem;
|
|
146
|
+
padding-left: 1.5rem;
|
|
147
|
+
margin-bottom: 1.5rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.c0 > * + * {
|
|
151
|
+
margin-top: 0.25rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.c1 {
|
|
155
|
+
display: -webkit-box;
|
|
156
|
+
display: -webkit-flex;
|
|
157
|
+
display: -ms-flexbox;
|
|
158
|
+
display: flex;
|
|
159
|
+
-webkit-box-pack: end;
|
|
160
|
+
-webkit-justify-content: flex-end;
|
|
161
|
+
-ms-flex-pack: end;
|
|
162
|
+
justify-content: flex-end;
|
|
163
|
+
-webkit-align-items: center;
|
|
164
|
+
-webkit-box-align: center;
|
|
165
|
+
-ms-flex-align: center;
|
|
166
|
+
align-items: center;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.c1 > *:first-child {
|
|
170
|
+
-webkit-flex: 1;
|
|
171
|
+
-ms-flex: 1;
|
|
172
|
+
flex: 1;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
<div>
|
|
176
|
+
<header
|
|
177
|
+
class="c0"
|
|
178
|
+
>
|
|
179
|
+
<div
|
|
180
|
+
class="c1"
|
|
181
|
+
>
|
|
182
|
+
<h3
|
|
183
|
+
class="c2"
|
|
184
|
+
>
|
|
185
|
+
Title
|
|
186
|
+
</h3>
|
|
187
|
+
<button
|
|
188
|
+
aria-label="Close"
|
|
189
|
+
class="c3 c4"
|
|
190
|
+
>
|
|
191
|
+
<span
|
|
192
|
+
class="c5"
|
|
193
|
+
>
|
|
194
|
+
<svg
|
|
195
|
+
fill="none"
|
|
196
|
+
height="1.5rem"
|
|
197
|
+
role="presentation"
|
|
198
|
+
viewBox="0 0 24 24"
|
|
199
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
200
|
+
>
|
|
201
|
+
<path
|
|
202
|
+
clip-rule="evenodd"
|
|
203
|
+
d="M19 6.51071L17.4893 5L11.5 10.9893L5.51071 5L4 6.51071L9.98929 12.5L4 18.4893L5.51071 20L11.5 14.0107L17.4893 20L19 18.4893L13.0107 12.5L19 6.51071Z"
|
|
204
|
+
fill="currentColor"
|
|
205
|
+
fill-rule="evenodd"
|
|
206
|
+
/>
|
|
207
|
+
</svg>
|
|
208
|
+
</span>
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
<span
|
|
212
|
+
class="c6"
|
|
213
|
+
>
|
|
214
|
+
Subtitle
|
|
215
|
+
</span>
|
|
216
|
+
</header>
|
|
217
|
+
</div>
|
|
218
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardHeader } from './CardHeader';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { sizes } from '../../theme/modules/sizes';
|
|
3
|
+
|
|
4
|
+
export const Header = styled.header`
|
|
5
|
+
padding-top: ${sizes.md};
|
|
6
|
+
padding-right: ${sizes.md};
|
|
7
|
+
padding-left: ${sizes.md};
|
|
8
|
+
margin-bottom: ${sizes.md};
|
|
9
|
+
|
|
10
|
+
& > * + * {
|
|
11
|
+
margin-top: ${sizes.xs};
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const HeaderGrid = styled.div`
|
|
16
|
+
/* display: grid;
|
|
17
|
+
grid-auto-flow: column;
|
|
18
|
+
grid-template-columns: 1fr;
|
|
19
|
+
grid-auto-columns: max-content;
|
|
20
|
+
column-gap: ${sizes.base};
|
|
21
|
+
align-items: center; */
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
align-items: center;
|
|
26
|
+
|
|
27
|
+
& > *:first-child {
|
|
28
|
+
flex: 1;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import { Checkbox, CheckboxProps } from './Checkbox';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Forms/Checkbox',
|
|
7
|
+
component: Checkbox,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
onChange: {
|
|
11
|
+
action: 'onChange',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
} as Meta;
|
|
15
|
+
|
|
16
|
+
const baseArgs = {
|
|
17
|
+
checked: false,
|
|
18
|
+
disabled: false,
|
|
19
|
+
indeterminate: false,
|
|
20
|
+
value: 'test-value',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template: Story<CheckboxProps> = (args: any) => <Checkbox {...args} />;
|
|
24
|
+
|
|
25
|
+
export const Unchecked = Template.bind({});
|
|
26
|
+
Unchecked.args = baseArgs;
|
|
27
|
+
|
|
28
|
+
export const Checked = Template.bind({});
|
|
29
|
+
Checked.args = {
|
|
30
|
+
...baseArgs,
|
|
31
|
+
checked: true,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Indeterminate = Template.bind({});
|
|
35
|
+
Indeterminate.args = {
|
|
36
|
+
...baseArgs,
|
|
37
|
+
checked: true,
|
|
38
|
+
indeterminate: true,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Disabled = Template.bind({});
|
|
42
|
+
Disabled.args = {
|
|
43
|
+
...baseArgs,
|
|
44
|
+
checked: true,
|
|
45
|
+
disabled: true,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const WithLabels = Template.bind({});
|
|
49
|
+
WithLabels.args = {
|
|
50
|
+
...baseArgs,
|
|
51
|
+
checked: true,
|
|
52
|
+
label: 'Label',
|
|
53
|
+
hint: 'This is an example hint',
|
|
54
|
+
tooltip: 'This is an example tooltip',
|
|
55
|
+
error: 'Something went wrong',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const WithBadge = Template.bind({});
|
|
59
|
+
WithBadge.args = {
|
|
60
|
+
...baseArgs,
|
|
61
|
+
checked: true,
|
|
62
|
+
label: 'Checkbox with glyph',
|
|
63
|
+
// Badge: <Glyph name="info" />,
|
|
64
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { act, render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { Checkbox } from '.';
|
|
6
|
+
|
|
7
|
+
describe('Checkbox', () => {
|
|
8
|
+
it('Renders correctly', () => {
|
|
9
|
+
const { container } = render(<Checkbox checked onChange={() => {}} />);
|
|
10
|
+
expect(container).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('can be checked', () => {
|
|
14
|
+
const onChange = jest.fn();
|
|
15
|
+
render(<Checkbox checked={false} value="test-value" onChange={onChange} />);
|
|
16
|
+
const checkbox = screen.getByRole('checkbox');
|
|
17
|
+
expect(checkbox).not.toBeChecked();
|
|
18
|
+
act(() => {
|
|
19
|
+
userEvent.click(checkbox);
|
|
20
|
+
});
|
|
21
|
+
expect(onChange).toHaveBeenCalledWith(true, 'test-value');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('can be unchecked', () => {
|
|
25
|
+
const onChange = jest.fn();
|
|
26
|
+
render(<Checkbox checked value="test-value" onChange={onChange} />);
|
|
27
|
+
const checkbox = screen.getByRole('checkbox');
|
|
28
|
+
expect(checkbox).toBeChecked();
|
|
29
|
+
act(() => {
|
|
30
|
+
userEvent.click(checkbox);
|
|
31
|
+
});
|
|
32
|
+
expect(onChange).toHaveBeenCalledWith(false, 'test-value');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('supports indeterminate state', () => {
|
|
36
|
+
const baseProps = { checked: true, onChange: () => {} };
|
|
37
|
+
let checkbox;
|
|
38
|
+
|
|
39
|
+
const { rerender } = render(<Checkbox {...baseProps} indeterminate />);
|
|
40
|
+
checkbox = screen.getByRole('checkbox') as HTMLInputElement;
|
|
41
|
+
expect(checkbox.indeterminate).toEqual(true);
|
|
42
|
+
|
|
43
|
+
rerender(<Checkbox {...baseProps} indeterminate={false} />);
|
|
44
|
+
checkbox = screen.getByRole('checkbox') as HTMLInputElement;
|
|
45
|
+
expect(checkbox.indeterminate).toEqual(false);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('can be unchecked while in indeterminate state', () => {
|
|
49
|
+
const onChange = jest.fn();
|
|
50
|
+
render(<Checkbox indeterminate value="test-value" checked onChange={onChange} />);
|
|
51
|
+
const checkbox = screen.getByRole('checkbox');
|
|
52
|
+
act(() => {
|
|
53
|
+
userEvent.click(checkbox);
|
|
54
|
+
});
|
|
55
|
+
expect(onChange).toHaveBeenLastCalledWith(false, 'test-value');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
import { Choice, ForwardedChoiceProps } from '../Choice';
|
|
3
|
+
import { Input } from './styled';
|
|
4
|
+
import { generateId } from '../../utils/generateId';
|
|
5
|
+
|
|
6
|
+
export type CheckboxValue = string | number;
|
|
7
|
+
|
|
8
|
+
export interface CheckboxProps extends ForwardedChoiceProps {
|
|
9
|
+
checked: boolean;
|
|
10
|
+
indeterminate?: boolean;
|
|
11
|
+
value?: CheckboxValue;
|
|
12
|
+
name?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
onChange: (checked: boolean, value?: CheckboxValue) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Checkbox = ({
|
|
19
|
+
checked,
|
|
20
|
+
indeterminate,
|
|
21
|
+
value,
|
|
22
|
+
name,
|
|
23
|
+
disabled,
|
|
24
|
+
ariaLabel,
|
|
25
|
+
onChange,
|
|
26
|
+
...otherProps
|
|
27
|
+
}: CheckboxProps) => {
|
|
28
|
+
const id = generateId('checkbox');
|
|
29
|
+
const checkboxRef = useRef<HTMLInputElement>(null);
|
|
30
|
+
|
|
31
|
+
const handleChange = useCallback(
|
|
32
|
+
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
33
|
+
onChange(e.currentTarget.checked, value);
|
|
34
|
+
},
|
|
35
|
+
[onChange, value],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!checkboxRef.current) return;
|
|
40
|
+
if (indeterminate === true) {
|
|
41
|
+
checkboxRef.current.indeterminate = true;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
checkboxRef.current.indeterminate = false;
|
|
45
|
+
}, [indeterminate]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Choice id={id} disabled={disabled} {...otherProps}>
|
|
49
|
+
<Input
|
|
50
|
+
ref={checkboxRef}
|
|
51
|
+
id={id}
|
|
52
|
+
type="checkbox"
|
|
53
|
+
checked={checked}
|
|
54
|
+
value={value}
|
|
55
|
+
name={name}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
aria-label={ariaLabel}
|
|
58
|
+
onChange={handleChange}
|
|
59
|
+
/>
|
|
60
|
+
</Choice>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Checkbox Renders correctly 1`] = `
|
|
4
|
+
.c1 {
|
|
5
|
+
display: -webkit-box;
|
|
6
|
+
display: -webkit-flex;
|
|
7
|
+
display: -ms-flexbox;
|
|
8
|
+
display: flex;
|
|
9
|
+
-webkit-align-items: center;
|
|
10
|
+
-webkit-box-align: center;
|
|
11
|
+
-ms-flex-align: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.c1 > * + * {
|
|
16
|
+
margin-left: 1rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.c2 {
|
|
20
|
+
-webkit-align-self: stretch;
|
|
21
|
+
-ms-flex-item-align: stretch;
|
|
22
|
+
align-self: stretch;
|
|
23
|
+
display: -webkit-box;
|
|
24
|
+
display: -webkit-flex;
|
|
25
|
+
display: -ms-flexbox;
|
|
26
|
+
display: flex;
|
|
27
|
+
-webkit-align-items: flex-start;
|
|
28
|
+
-webkit-box-align: flex-start;
|
|
29
|
+
-ms-flex-align: flex-start;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
width: 24px;
|
|
32
|
+
height: 24px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.c0 {
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.c0:hover {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.c3 {
|
|
44
|
+
-webkit-appearance: none;
|
|
45
|
+
-moz-appearance: none;
|
|
46
|
+
appearance: none;
|
|
47
|
+
width: 18px;
|
|
48
|
+
height: 18px;
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
border: 2px solid #959FA8;
|
|
51
|
+
border-radius: 0.25rem;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
-webkit-flex-shrink: 0;
|
|
54
|
+
-ms-flex-negative: 0;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
-webkit-transition: box-shadow 0.1s, background-color 0.1s;
|
|
57
|
+
transition: box-shadow 0.1s, background-color 0.1s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.c3:checked {
|
|
61
|
+
background-color: #0079D1;
|
|
62
|
+
border-color: #0079D1;
|
|
63
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>");
|
|
64
|
+
background-repeat: no-repeat;
|
|
65
|
+
background-size: 1rem;
|
|
66
|
+
background-position: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.c3:hover {
|
|
70
|
+
border-color: #0079D1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.c3:active {
|
|
74
|
+
border-color: #0079D1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.c3:focus {
|
|
78
|
+
box-shadow: 0 0 0 4px #80BCE8;
|
|
79
|
+
outline: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.c3:indeterminate {
|
|
83
|
+
background-color: #0079D1;
|
|
84
|
+
border-color: #0079D1;
|
|
85
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>");
|
|
86
|
+
background-repeat: no-repeat;
|
|
87
|
+
background-size: 1rem;
|
|
88
|
+
background-position: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.c3:disabled {
|
|
92
|
+
box-shadow: none;
|
|
93
|
+
background-color: #DFE3E8;
|
|
94
|
+
border-color: #DFE3E8;
|
|
95
|
+
color: #637381;
|
|
96
|
+
cursor: default;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.c3:checked:disabled {
|
|
100
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.c3:indeterminate:disabled {
|
|
104
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
<div>
|
|
108
|
+
<label
|
|
109
|
+
class="c0"
|
|
110
|
+
for="test-id"
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
class="c1"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
class="c2"
|
|
117
|
+
>
|
|
118
|
+
<input
|
|
119
|
+
checked=""
|
|
120
|
+
class="c3"
|
|
121
|
+
id="test-id"
|
|
122
|
+
type="checkbox"
|
|
123
|
+
value=""
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</label>
|
|
128
|
+
</div>
|
|
129
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { theme } from '../../theme';
|
|
4
|
+
|
|
5
|
+
const { colors, sizes, radius } = theme;
|
|
6
|
+
|
|
7
|
+
export const Input = styled.input`
|
|
8
|
+
appearance: none;
|
|
9
|
+
width: 18px;
|
|
10
|
+
height: 18px;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
border: 2px solid ${colors.neutral.ink.lightest};
|
|
13
|
+
border-radius: ${radius.base};
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
|
|
17
|
+
transition:
|
|
18
|
+
box-shadow 0.1s,
|
|
19
|
+
background-color 0.1s;
|
|
20
|
+
|
|
21
|
+
&:checked {
|
|
22
|
+
background-color: ${colors.secondary.blue.base};
|
|
23
|
+
border-color: ${colors.secondary.blue.base};
|
|
24
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='white' /></svg>");
|
|
25
|
+
background-repeat: no-repeat;
|
|
26
|
+
background-size: ${sizes[4]};
|
|
27
|
+
background-position: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
border-color: ${colors.secondary.blue.base};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:active {
|
|
35
|
+
border-color: ${colors.secondary.blue.base};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:focus {
|
|
39
|
+
box-shadow: 0 0 0 4px ${colors.secondary.blue.light};
|
|
40
|
+
outline: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:indeterminate {
|
|
44
|
+
background-color: ${colors.secondary.blue.base};
|
|
45
|
+
border-color: ${colors.secondary.blue.base};
|
|
46
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='white'/></svg>");
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
background-size: ${sizes[4]};
|
|
49
|
+
background-position: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:disabled {
|
|
53
|
+
box-shadow: none;
|
|
54
|
+
background-color: ${colors.neutral.grey.base};
|
|
55
|
+
border-color: ${colors.neutral.grey.base};
|
|
56
|
+
color: ${colors.neutral.ink.light};
|
|
57
|
+
cursor: default;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:checked:disabled {
|
|
61
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M8.56846 16.3657L3.86697 11.6642L2.2998 13.2313L8.56846 19.5L22.0013 6.06716L20.4341 4.5L8.56846 16.3657Z' fill='%23637381' /></svg>");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:indeterminate:disabled {
|
|
65
|
+
background-image: url("data:image/svg+xml;utf-8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='5' y='11' width='14' height='3' fill='%23637381'/></svg>");
|
|
66
|
+
}
|
|
67
|
+
`;
|