@mindlogic-ai/logician-ui 2.0.0-alpha.0
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/LICENSE +21 -0
- package/README.md +234 -0
- package/USAGE.md +299 -0
- package/dist/Markdown-2D5K42BY.js +16 -0
- package/dist/Markdown-2D5K42BY.js.map +1 -0
- package/dist/Markdown-AZBXO5ZP.css +29 -0
- package/dist/Markdown-AZBXO5ZP.css.map +1 -0
- package/dist/Markdown-RJJEQN4R.mjs +3 -0
- package/dist/Markdown-RJJEQN4R.mjs.map +1 -0
- package/dist/analytics-GNSHP7X3.svg +1 -0
- package/dist/bulb-24SQINQB.svg +1 -0
- package/dist/chat-TLRFEUAS.svg +1 -0
- package/dist/chunk-5FHXD7KR.js +1735 -0
- package/dist/chunk-5FHXD7KR.js.map +1 -0
- package/dist/chunk-WSOHBA2C.mjs +1693 -0
- package/dist/chunk-WSOHBA2C.mjs.map +1 -0
- package/dist/edit-RWL72JNM.svg +1 -0
- package/dist/face-55KPDCH4.svg +1 -0
- package/dist/filled-analytics-RBC7KWND.svg +1 -0
- package/dist/filled-bulb-RC7E2WSM.svg +1 -0
- package/dist/filled-chat-A6J44Q7A.svg +1 -0
- package/dist/filled-edit-NKKWFSTW.svg +1 -0
- package/dist/filled-face-UML5C3LB.svg +1 -0
- package/dist/filled-layout-HBVCSDFO.svg +1 -0
- package/dist/index.css +51 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +964 -0
- package/dist/index.d.ts +964 -0
- package/dist/index.js +5600 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5401 -0
- package/dist/index.mjs.map +1 -0
- package/dist/language-VBJ24OPV.svg +1 -0
- package/dist/layout-NDDSWNNV.svg +1 -0
- package/dist/pending-NF7NSBYO.svg +1 -0
- package/dist/receipt-MNLQIFCO.svg +1 -0
- package/dist/sparkles-EOEGVL6G.svg +1 -0
- package/dist/store-3RQPBJWG.svg +1 -0
- package/dist/store_active-SAOAGVKC.svg +1 -0
- package/dist/studio-LYPUIEFA.svg +1 -0
- package/dist/studio_active-BC6O66OI.svg +1 -0
- package/dist/vertical-ellipsis-3G4WEOCW.svg +1 -0
- package/package.json +138 -0
- package/src/components/Accordion/Accordion.stories.tsx +41 -0
- package/src/components/Accordion/Accordion.tsx +14 -0
- package/src/components/Accordion/AccordionButton.tsx +40 -0
- package/src/components/Accordion/AccordionItem.tsx +17 -0
- package/src/components/Accordion/index.ts +4 -0
- package/src/components/Alert/Alert.stories.tsx +38 -0
- package/src/components/Alert/Alert.styles.ts +19 -0
- package/src/components/Alert/Alert.tsx +41 -0
- package/src/components/Alert/Alert.types.ts +5 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/AutowidthInput/AutowidthInput.stories.tsx +23 -0
- package/src/components/AutowidthInput/AutowidthInput.tsx +47 -0
- package/src/components/AutowidthInput/index.ts +1 -0
- package/src/components/Avatar/Avatar.stories.tsx +23 -0
- package/src/components/Avatar/Avatar.tsx +19 -0
- package/src/components/Avatar/index.tsx +1 -0
- package/src/components/Badge/Badge.stories.tsx +23 -0
- package/src/components/Badge/Badge.styles.ts +11 -0
- package/src/components/Badge/Badge.tsx +26 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Banner/Banner.stories.tsx +37 -0
- package/src/components/Banner/Banner.styles.ts +79 -0
- package/src/components/Banner/Banner.tsx +68 -0
- package/src/components/Banner/Banner.types.ts +6 -0
- package/src/components/Banner/index.ts +2 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +14 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +19 -0
- package/src/components/Breadcrumb/Breadcrumb.types.ts +3 -0
- package/src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.tsx +12 -0
- package/src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.types.ts +3 -0
- package/src/components/Breadcrumb/BreadcrumbItem/index.ts +2 -0
- package/src/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.tsx +30 -0
- package/src/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.types.ts +3 -0
- package/src/components/Breadcrumb/BreadcrumbLink/index.ts +2 -0
- package/src/components/Breadcrumb/index.ts +3 -0
- package/src/components/Button/Button.stories.tsx +52 -0
- package/src/components/Button/Button.styles.ts +59 -0
- package/src/components/Button/Button.tsx +43 -0
- package/src/components/Button/Button.types.ts +13 -0
- package/src/components/Button/index.tsx +3 -0
- package/src/components/Card/Card.stories.tsx +24 -0
- package/src/components/Card/Card.styles.ts +30 -0
- package/src/components/Card/Card.tsx +29 -0
- package/src/components/Card/Card.types.ts +8 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Carousel/Carousel.stories.tsx +159 -0
- package/src/components/Carousel/Carousel.tsx +160 -0
- package/src/components/Carousel/Carousel.types.ts +22 -0
- package/src/components/Carousel/index.ts +1 -0
- package/src/components/CarouselModal/CarouselModal.stories.tsx +53 -0
- package/src/components/CarouselModal/CarouselModal.tsx +106 -0
- package/src/components/CarouselModal/CarouselModal.types.ts +16 -0
- package/src/components/CarouselModal/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +16 -0
- package/src/components/Checkbox/Checkbox.tsx +29 -0
- package/src/components/Checkbox/Checkbox.types.ts +3 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Chip/Chip.stories.tsx +44 -0
- package/src/components/Chip/Chip.styles.ts +114 -0
- package/src/components/Chip/Chip.tsx +23 -0
- package/src/components/Chip/Chip.types.ts +14 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/ChipButton/Chip.types.ts +4 -0
- package/src/components/ChipButton/ChipButton.tsx +25 -0
- package/src/components/ChipButton/index.ts +1 -0
- package/src/components/Code/Code.stories.tsx +28 -0
- package/src/components/Code/Code.tsx +160 -0
- package/src/components/Code/Code.types.ts +40 -0
- package/src/components/Code/_components/CopyButton.tsx +48 -0
- package/src/components/Code/index.ts +1 -0
- package/src/components/CodeTabs/CodeTabs.stories.tsx +51 -0
- package/src/components/CodeTabs/CodeTabs.tsx +98 -0
- package/src/components/CodeTabs/CodeTabs.types.ts +17 -0
- package/src/components/CodeTabs/index.ts +1 -0
- package/src/components/Container/Container.stories.tsx +28 -0
- package/src/components/Container/Container.tsx +21 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/Container/useContainerSize.ts +47 -0
- package/src/components/CopyableCode/CopyableCode.stories.tsx +26 -0
- package/src/components/CopyableCode/CopyableCode.tsx +58 -0
- package/src/components/CopyableCode/CopyableCode.types.ts +7 -0
- package/src/components/CopyableCode/index.ts +2 -0
- package/src/components/CrossPageToasts/CrossPageToasts.tsx +33 -0
- package/src/components/CrossPageToasts/index.ts +1 -0
- package/src/components/DataField/DataField.stories.tsx +61 -0
- package/src/components/DataField/DataField.styles.ts +33 -0
- package/src/components/DataField/DataField.tsx +141 -0
- package/src/components/DataField/DataField.types.ts +18 -0
- package/src/components/DataField/index.ts +1 -0
- package/src/components/DatePicker/RangeDatePicker.stories.tsx +45 -0
- package/src/components/DatePicker/RangeDatePicker.tsx +74 -0
- package/src/components/DatePicker/SingleDatePicker.stories.tsx +31 -0
- package/src/components/DatePicker/SingleDatePicker.tsx +72 -0
- package/src/components/DatePicker/index.ts +2 -0
- package/src/components/FileInput/FileInput.stories.tsx +28 -0
- package/src/components/FileInput/FileInput.tsx +117 -0
- package/src/components/FileInput/FileInput.types.ts +14 -0
- package/src/components/FileInput/index.ts +2 -0
- package/src/components/FileItem/FileItem.stories.tsx +27 -0
- package/src/components/FileItem/FileItem.tsx +134 -0
- package/src/components/FileItem/FileItem.types.ts +11 -0
- package/src/components/FileItem/index.ts +1 -0
- package/src/components/FileList/FileList.stories.tsx +65 -0
- package/src/components/FileList/FileList.tsx +97 -0
- package/src/components/FileList/FileList.types.ts +18 -0
- package/src/components/FileList/index.tsx +1 -0
- package/src/components/FormControl/FormControl.stories.tsx +16 -0
- package/src/components/FormControl/FormControl.tsx +12 -0
- package/src/components/FormControl/FormControl.types.ts +3 -0
- package/src/components/FormControl/index.ts +2 -0
- package/src/components/FormLabel/FormLabel.tsx +5 -0
- package/src/components/FormLabel/index.ts +1 -0
- package/src/components/GuideCue/GuideCue.stories.tsx +57 -0
- package/src/components/GuideCue/GuideCue.tsx +231 -0
- package/src/components/GuideCue/GuideCueContext.tsx +70 -0
- package/src/components/GuideCue/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +77 -0
- package/src/components/Icon/Icon.styles.ts +6 -0
- package/src/components/Icon/Icon.tsx +73 -0
- package/src/components/Icon/Icon.types.ts +10 -0
- package/src/components/Icon/IconMap.ts +290 -0
- package/src/components/Icon/icons/analytics.svg +1 -0
- package/src/components/Icon/icons/bulb.svg +1 -0
- package/src/components/Icon/icons/chat.svg +1 -0
- package/src/components/Icon/icons/edit.svg +1 -0
- package/src/components/Icon/icons/face.svg +1 -0
- package/src/components/Icon/icons/filled-analytics.svg +1 -0
- package/src/components/Icon/icons/filled-bulb.svg +1 -0
- package/src/components/Icon/icons/filled-chat.svg +1 -0
- package/src/components/Icon/icons/filled-edit.svg +1 -0
- package/src/components/Icon/icons/filled-face.svg +1 -0
- package/src/components/Icon/icons/filled-layout.svg +1 -0
- package/src/components/Icon/icons/language.svg +1 -0
- package/src/components/Icon/icons/layout.svg +1 -0
- package/src/components/Icon/icons/pending.svg +1 -0
- package/src/components/Icon/icons/receipt.svg +1 -0
- package/src/components/Icon/icons/sparkles.svg +1 -0
- package/src/components/Icon/icons/store.svg +1 -0
- package/src/components/Icon/icons/store_active.svg +1 -0
- package/src/components/Icon/icons/studio.svg +1 -0
- package/src/components/Icon/icons/studio_active.svg +1 -0
- package/src/components/Icon/icons/vertical-ellipsis.svg +1 -0
- package/src/components/Icon/index.tsx +3 -0
- package/src/components/IconButton/IconButton.stories.tsx +51 -0
- package/src/components/IconButton/IconButton.styles.ts +52 -0
- package/src/components/IconButton/IconButton.tsx +36 -0
- package/src/components/IconButton/IconButton.types.ts +12 -0
- package/src/components/IconButton/index.tsx +1 -0
- package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +25 -0
- package/src/components/InfoSprinkle/InfoSprinkle.tsx +48 -0
- package/src/components/InfoSprinkle/index.ts +1 -0
- package/src/components/InlineCode/InlineCode.tsx +18 -0
- package/src/components/InlineCode/index.ts +1 -0
- package/src/components/Input/Input.stories.tsx +55 -0
- package/src/components/Input/Input.tsx +358 -0
- package/src/components/Input/Input.types.ts +19 -0
- package/src/components/Input/index.tsx +2 -0
- package/src/components/LineGraph/LineGraph.stories.tsx +98 -0
- package/src/components/LineGraph/LineGraph.tsx +88 -0
- package/src/components/LineGraph/LineGraph.types.ts +41 -0
- package/src/components/LineGraph/index.ts +1 -0
- package/src/components/Link/Link.styles.ts +13 -0
- package/src/components/Link/Link.tsx +93 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loaders/PageLoader.stories.tsx +29 -0
- package/src/components/Loaders/PageLoader.tsx +30 -0
- package/src/components/Loaders/SectionLoader.stories.tsx +26 -0
- package/src/components/Loaders/SectionLoader.tsx +30 -0
- package/src/components/Loaders/index.ts +1 -0
- package/src/components/MDXEditor/MDXEditor.css +21 -0
- package/src/components/MDXEditor/MDXEditor.stories.tsx +45 -0
- package/src/components/MDXEditor/MDXEditor.tsx +189 -0
- package/src/components/MDXEditor/MDXEditor.types.ts +6 -0
- package/src/components/MDXEditor/index.ts +1 -0
- package/src/components/Markdown/Markdown.module.css +30 -0
- package/src/components/Markdown/Markdown.tsx +133 -0
- package/src/components/Markdown/Markdown.types.ts +5 -0
- package/src/components/Markdown/index.ts +2 -0
- package/src/components/Masonry/Masonry.stories.tsx +288 -0
- package/src/components/Masonry/Masonry.tsx +187 -0
- package/src/components/Masonry/Masonry.types.ts +18 -0
- package/src/components/Masonry/index.ts +2 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +26 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.tsx +25 -0
- package/src/components/MaxLengthIndicator/index.tsx +1 -0
- package/src/components/Menu/Menu.stories.tsx +186 -0
- package/src/components/Menu/MenuButton.tsx +8 -0
- package/src/components/Menu/MenuButton.types.ts +23 -0
- package/src/components/Menu/MenuItem.tsx +35 -0
- package/src/components/Menu/MenuItem.types.ts +13 -0
- package/src/components/Menu/MenuList.tsx +19 -0
- package/src/components/Menu/index.ts +7 -0
- package/src/components/Modal/Modal.stories.tsx +83 -0
- package/src/components/Modal/Modal.styles.ts +14 -0
- package/src/components/Modal/Modal.tsx +14 -0
- package/src/components/Modal/Modal.types.ts +3 -0
- package/src/components/Modal/ModalBody.tsx +9 -0
- package/src/components/Modal/ModalCloseButton.tsx +18 -0
- package/src/components/Modal/ModalContent/ModalContent.tsx +8 -0
- package/src/components/Modal/ModalContent/ModalContent.types.ts +3 -0
- package/src/components/Modal/ModalContent/index.ts +1 -0
- package/src/components/Modal/ModalFooter/ModalFooter.module.css +3 -0
- package/src/components/Modal/ModalFooter/ModalFooter.tsx +20 -0
- package/src/components/Modal/ModalFooter/index.ts +1 -0
- package/src/components/Modal/ModalHeader.tsx +9 -0
- package/src/components/Modal/ModalOverlay.tsx +9 -0
- package/src/components/Modal/index.tsx +8 -0
- package/src/components/MonthRangePicker/MonthButton/MonthButton.tsx +105 -0
- package/src/components/MonthRangePicker/MonthButton/MonthButton.types.ts +42 -0
- package/src/components/MonthRangePicker/MonthButton/index.ts +2 -0
- package/src/components/MonthRangePicker/MonthRangePicker.stories.tsx +164 -0
- package/src/components/MonthRangePicker/MonthRangePicker.tsx +274 -0
- package/src/components/MonthRangePicker/MonthRangePicker.types.ts +38 -0
- package/src/components/MonthRangePicker/_utils/hasEnabledMonthsInYear.ts +15 -0
- package/src/components/MonthRangePicker/_utils/index.ts +6 -0
- package/src/components/MonthRangePicker/_utils/isMonthDisabled.ts +20 -0
- package/src/components/MonthRangePicker/_utils/isMonthInPreviewRange.ts +32 -0
- package/src/components/MonthRangePicker/_utils/isMonthInRange.ts +17 -0
- package/src/components/MonthRangePicker/_utils/isMonthSelected.ts +19 -0
- package/src/components/MonthRangePicker/_utils/isSelectionStart.ts +12 -0
- package/src/components/MonthRangePicker/constants.ts +63 -0
- package/src/components/MonthRangePicker/index.ts +2 -0
- package/src/components/Pagination/Pagination.stories.tsx +51 -0
- package/src/components/Pagination/Pagination.tsx +150 -0
- package/src/components/Pagination/Pagination.types.ts +12 -0
- package/src/components/Pagination/index.tsx +1 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +16 -0
- package/src/components/PasswordInput/PasswordInput.tsx +42 -0
- package/src/components/PasswordInput/PasswordInput.types.ts +11 -0
- package/src/components/PasswordInput/index.ts +1 -0
- package/src/components/PinInput/PinInput.stories.tsx +26 -0
- package/src/components/PinInput/PinInput.tsx +53 -0
- package/src/components/PinInput/PinInput.types.ts +27 -0
- package/src/components/PinInput/index.tsx +2 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +18 -0
- package/src/components/ProgressBar/ProgressBar.styles.ts +4 -0
- package/src/components/ProgressBar/ProgressBar.tsx +27 -0
- package/src/components/ProgressBar/ProgressBar.types.ts +4 -0
- package/src/components/ProgressBar/index.ts +1 -0
- package/src/components/RadialProgress/RadialProgress.stories.tsx +272 -0
- package/src/components/RadialProgress/RadialProgress.tsx +232 -0
- package/src/components/RadialProgress/RadialProgress.types.ts +27 -0
- package/src/components/RadialProgress/index.ts +2 -0
- package/src/components/Radio/Radio.stories.tsx +226 -0
- package/src/components/Radio/Radio.tsx +35 -0
- package/src/components/Radio/Radio.types.ts +21 -0
- package/src/components/Radio/RadioGroup.tsx +26 -0
- package/src/components/Radio/index.ts +3 -0
- package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +48 -0
- package/src/components/SeeMoreButton/SeeMoreButton.styles.ts +11 -0
- package/src/components/SeeMoreButton/SeeMoreButton.tsx +34 -0
- package/src/components/SeeMoreButton/SeeMoreButton.types.ts +6 -0
- package/src/components/SeeMoreButton/index.tsx +1 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +96 -0
- package/src/components/SegmentedControl/SegmentedControl.styles.ts +28 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +89 -0
- package/src/components/SegmentedControl/SegmentedControl.types.ts +15 -0
- package/src/components/SegmentedControl/index.ts +2 -0
- package/src/components/SegmentedProgressBar/ProgressSegment.tsx +18 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +228 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.tsx +25 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +11 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBarContext.tsx +24 -0
- package/src/components/SegmentedProgressBar/index.ts +3 -0
- package/src/components/Select/MenuList/MenuList.tsx +87 -0
- package/src/components/Select/MenuList/MenuList.types.ts +21 -0
- package/src/components/Select/MenuList/VirtualizedMenuList.tsx +140 -0
- package/src/components/Select/MenuList/VirtualizedMenuListContext.tsx +35 -0
- package/src/components/Select/MenuList/index.ts +3 -0
- package/src/components/Select/Select.stories.tsx +70 -0
- package/src/components/Select/Select.styles.ts +102 -0
- package/src/components/Select/Select.tsx +204 -0
- package/src/components/Select/Select.types.ts +18 -0
- package/src/components/Select/_utils/resolveStyle.ts +21 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Slider/Slider.stories.tsx +75 -0
- package/src/components/Slider/Slider.tsx +12 -0
- package/src/components/Slider/Slider.types.ts +3 -0
- package/src/components/Slider/SliderFilledTrack/SliderFilledTrack.tsx +14 -0
- package/src/components/Slider/SliderFilledTrack/SliderFilledTrack.types.ts +3 -0
- package/src/components/Slider/SliderFilledTrack/index.ts +2 -0
- package/src/components/Slider/SliderMark/SliderMark.tsx +12 -0
- package/src/components/Slider/SliderMark/SliderMark.types.ts +3 -0
- package/src/components/Slider/SliderMark/index.ts +2 -0
- package/src/components/Slider/SliderThumb/SliderThumb.tsx +22 -0
- package/src/components/Slider/SliderThumb/SliderThumb.types.ts +3 -0
- package/src/components/Slider/SliderThumb/index.ts +2 -0
- package/src/components/Slider/SliderTrack/SliderTrack.tsx +12 -0
- package/src/components/Slider/SliderTrack/SliderTrack.types.ts +3 -0
- package/src/components/Slider/SliderTrack/index.ts +2 -0
- package/src/components/Slider/index.ts +5 -0
- package/src/components/Spinner/Spinner.stories.tsx +16 -0
- package/src/components/Spinner/Spinner.tsx +20 -0
- package/src/components/Spinner/Spinner.types.ts +3 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Switch/Switch.stories.tsx +63 -0
- package/src/components/Switch/Switch.tsx +8 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Table/ExpandingTr/ExpandingTr.tsx +31 -0
- package/src/components/Table/ExpandingTr/ExpandingTr.types.ts +9 -0
- package/src/components/Table/ExpandingTr/index.ts +2 -0
- package/src/components/Table/Table.stories.tsx +326 -0
- package/src/components/Table/Table.styles.ts +48 -0
- package/src/components/Table/Table.tsx +9 -0
- package/src/components/Table/Table.types.ts +16 -0
- package/src/components/Table/TableContainer.tsx +55 -0
- package/src/components/Table/TableContext.tsx +187 -0
- package/src/components/Table/Tbody.tsx +12 -0
- package/src/components/Table/Td.tsx +138 -0
- package/src/components/Table/Th.tsx +154 -0
- package/src/components/Table/Thead.tsx +5 -0
- package/src/components/Table/Tr.tsx +5 -0
- package/src/components/Table/index.tsx +8 -0
- package/src/components/Tabs/Tab/Tab.styles.ts +35 -0
- package/src/components/Tabs/Tab/Tab.tsx +67 -0
- package/src/components/Tabs/Tab/index.ts +1 -0
- package/src/components/Tabs/TabList/TabList.styles.ts +11 -0
- package/src/components/Tabs/TabList/TabList.tsx +19 -0
- package/src/components/Tabs/TabList/index.ts +1 -0
- package/src/components/Tabs/TabPanel.tsx +5 -0
- package/src/components/Tabs/TabPanels.tsx +5 -0
- package/src/components/Tabs/Tabs.stories.tsx +45 -0
- package/src/components/Tabs/Tabs.tsx +65 -0
- package/src/components/Tabs/Tabs.types.ts +19 -0
- package/src/components/Tabs/TabsContext.tsx +162 -0
- package/src/components/Tabs/index.tsx +5 -0
- package/src/components/Tag/Tag.stories.tsx +28 -0
- package/src/components/Tag/Tag.styles.ts +12 -0
- package/src/components/Tag/Tag.tsx +23 -0
- package/src/components/Tag/Tag.types.ts +5 -0
- package/src/components/Tag/TagCloseButton/TagCloseButton.tsx +12 -0
- package/src/components/Tag/TagCloseButton/TagCloseButton.types.ts +3 -0
- package/src/components/Tag/TagCloseButton/index.ts +2 -0
- package/src/components/Tag/TagLabel/TagLabel.tsx +12 -0
- package/src/components/Tag/TagLabel/TagLabel.types.ts +3 -0
- package/src/components/Tag/TagLabel/index.ts +2 -0
- package/src/components/Tag/TagLeftIcon/TagLeftIcon.tsx +12 -0
- package/src/components/Tag/TagLeftIcon/TagLeftIcon.types.ts +3 -0
- package/src/components/Tag/TagLeftIcon/index.ts +2 -0
- package/src/components/Tag/TagRightIcon/TagRightIcon.tsx +12 -0
- package/src/components/Tag/TagRightIcon/TagRightIcon.types.ts +3 -0
- package/src/components/Tag/TagRightIcon/index.ts +2 -0
- package/src/components/Tag/index.ts +5 -0
- package/src/components/Textarea/Textarea.tsx +56 -0
- package/src/components/Textarea/adjustHeight.tsx +9 -0
- package/src/components/Textarea/index.ts +1 -0
- package/src/components/Toast/Toast.stories.tsx +49 -0
- package/src/components/Toast/Toast.styles.ts +19 -0
- package/src/components/Toast/Toast.tsx +38 -0
- package/src/components/Toast/Toast.types.ts +22 -0
- package/src/components/Toast/ToastIcon/ToastIcon.tsx +26 -0
- package/src/components/Toast/ToastIcon/index.ts +0 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Toast/useToast.tsx +65 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +97 -0
- package/src/components/Tooltip/Tooltip.tsx +22 -0
- package/src/components/Tooltip/Tooltip.types.ts +3 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Typography/H1.tsx +17 -0
- package/src/components/Typography/H2.tsx +17 -0
- package/src/components/Typography/H3.tsx +17 -0
- package/src/components/Typography/H4.tsx +17 -0
- package/src/components/Typography/H5.tsx +17 -0
- package/src/components/Typography/Link.tsx +49 -0
- package/src/components/Typography/Subtext.tsx +17 -0
- package/src/components/Typography/Subtitle.tsx +18 -0
- package/src/components/Typography/Text.tsx +22 -0
- package/src/components/Typography/Typography.stories.tsx +54 -0
- package/src/components/Typography/Typography.types.ts +3 -0
- package/src/components/Typography/index.ts +26 -0
- package/src/components/UrlInput/UrlInput.stories.tsx +66 -0
- package/src/components/UrlInput/UrlInput.tsx +47 -0
- package/src/components/UrlInput/index.tsx +1 -0
- package/src/hooks/useLocale.ts +11 -0
- package/src/hooks/useTranslate.ts +57 -0
- package/src/index.ts +96 -0
- package/src/theme/Palette.stories.tsx +171 -0
- package/src/theme/colors.ts +64 -0
- package/src/theme/font.ts +23 -0
- package/src/theme/global.ts +30 -0
- package/src/theme/index.ts +49 -0
- package/src/translations/Defaults.translations.json +100 -0
- package/src/types/css-modules.d.ts +0 -0
- package/src/types/svg.d.ts +15 -0
- package/src/utils/findKeyByValue.ts +17 -0
- package/src/utils/formatDateByLocale.ts +36 -0
- package/src/utils/formatFileSize.ts +14 -0
- package/src/utils/formatNumber.ts +29 -0
- package/src/utils/formatTextForMarkdown.ts +3 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { RefObject, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Flex,
|
|
5
|
+
Popover,
|
|
6
|
+
PopoverArrow,
|
|
7
|
+
PopoverCloseButton,
|
|
8
|
+
PopoverContent,
|
|
9
|
+
PopoverProps,
|
|
10
|
+
PopoverTrigger,
|
|
11
|
+
Portal,
|
|
12
|
+
} from '@chakra-ui/react';
|
|
13
|
+
import { keyframes } from '@emotion/react';
|
|
14
|
+
|
|
15
|
+
import { Button } from '../Button';
|
|
16
|
+
import { Icon } from '../Icon';
|
|
17
|
+
import { Subtext, Subtitle } from '../Typography';
|
|
18
|
+
import { useGuideCue } from './GuideCueContext';
|
|
19
|
+
|
|
20
|
+
const PULSE_TIME = 950;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The GuideCue component is designed to highlight a specific element on the page.
|
|
24
|
+
*
|
|
25
|
+
* It takes in a containerRef, and renders a Popover over it.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const pulseRing = keyframes`
|
|
29
|
+
0% {
|
|
30
|
+
transform: scale(0.33);
|
|
31
|
+
}
|
|
32
|
+
80%, 100% {
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const pulseDot = keyframes`
|
|
38
|
+
0% {
|
|
39
|
+
transform: scale(0.8);
|
|
40
|
+
}
|
|
41
|
+
50% {
|
|
42
|
+
transform: scale(1);
|
|
43
|
+
}
|
|
44
|
+
100% {
|
|
45
|
+
transform: scale(0.8);
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const GuideCue = ({
|
|
50
|
+
index,
|
|
51
|
+
page: pageProp,
|
|
52
|
+
containerRef,
|
|
53
|
+
title,
|
|
54
|
+
description,
|
|
55
|
+
placement = 'bottom',
|
|
56
|
+
top,
|
|
57
|
+
left,
|
|
58
|
+
}: {
|
|
59
|
+
index: number;
|
|
60
|
+
page: string;
|
|
61
|
+
containerRef: RefObject<HTMLElement>;
|
|
62
|
+
title: string;
|
|
63
|
+
description: string;
|
|
64
|
+
placement?: PopoverProps['placement'];
|
|
65
|
+
top?: number | string;
|
|
66
|
+
left?: number | string;
|
|
67
|
+
}) => {
|
|
68
|
+
const {
|
|
69
|
+
cueRefs,
|
|
70
|
+
page,
|
|
71
|
+
currentIndex,
|
|
72
|
+
setCurrentIndex,
|
|
73
|
+
isDisabled,
|
|
74
|
+
onComplete,
|
|
75
|
+
} = useGuideCue();
|
|
76
|
+
const [isRendered, setIsRendered] = useState(false);
|
|
77
|
+
// Determines if the popover is rendering
|
|
78
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
79
|
+
// Once the popover is closed, it will not open again
|
|
80
|
+
const [isClosed, setIsClosed] = useState(false);
|
|
81
|
+
const ctaRef = useRef<HTMLButtonElement>(null);
|
|
82
|
+
|
|
83
|
+
const handleClose = () => {
|
|
84
|
+
setIsOpen(false);
|
|
85
|
+
setIsClosed(true);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleNext = () => {
|
|
89
|
+
setCurrentIndex(currentIndex + 1);
|
|
90
|
+
handleClose();
|
|
91
|
+
if (currentIndex === cueRefs.length - 1) {
|
|
92
|
+
onComplete?.();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (
|
|
98
|
+
!isDisabled &&
|
|
99
|
+
page === pageProp &&
|
|
100
|
+
index === currentIndex &&
|
|
101
|
+
cueRefs[index] &&
|
|
102
|
+
containerRef.current
|
|
103
|
+
) {
|
|
104
|
+
cueRefs[index]?.current?.focus();
|
|
105
|
+
// Set a timeout if it's the first step, but otherwise render immediately
|
|
106
|
+
if (currentIndex === 0) {
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
setIsRendered(true);
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
setIsOpen(true);
|
|
111
|
+
}, PULSE_TIME * 2);
|
|
112
|
+
}, 300);
|
|
113
|
+
} else {
|
|
114
|
+
setIsRendered(true);
|
|
115
|
+
setIsOpen(true);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, [cueRefs, index, pageProp, currentIndex, containerRef]);
|
|
119
|
+
|
|
120
|
+
if (isClosed || isDisabled) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const pulseRingAnimation = `${pulseRing} ${PULSE_TIME}ms cubic-bezier(0.215, 0.61, 0.355, 1) infinite`;
|
|
125
|
+
const pulseDotAnimation = `${pulseDot} ${PULSE_TIME}ms cubic-bezier(0.455, 0.03, 0.515, 0.955) -0.4s infinite`;
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Portal containerRef={containerRef}>
|
|
129
|
+
<Popover
|
|
130
|
+
isOpen={isOpen}
|
|
131
|
+
onClose={handleClose}
|
|
132
|
+
initialFocusRef={ctaRef}
|
|
133
|
+
placement={placement}
|
|
134
|
+
returnFocusOnClose={false}
|
|
135
|
+
>
|
|
136
|
+
{isRendered && (
|
|
137
|
+
<PopoverTrigger>
|
|
138
|
+
<Box
|
|
139
|
+
position="absolute"
|
|
140
|
+
top={top ?? '50%'}
|
|
141
|
+
left={left ?? '50%'}
|
|
142
|
+
transform="translate(-50%, -50%)"
|
|
143
|
+
width={4}
|
|
144
|
+
height={4}
|
|
145
|
+
opacity={0.7}
|
|
146
|
+
tabIndex={0}
|
|
147
|
+
_focus={{
|
|
148
|
+
outline: 'none',
|
|
149
|
+
}}
|
|
150
|
+
ref={(el: HTMLDivElement | null) => {
|
|
151
|
+
if (cueRefs[index] && el) {
|
|
152
|
+
(
|
|
153
|
+
cueRefs[index] as React.MutableRefObject<HTMLDivElement>
|
|
154
|
+
).current = el;
|
|
155
|
+
}
|
|
156
|
+
}}
|
|
157
|
+
_before={{
|
|
158
|
+
content: '""',
|
|
159
|
+
position: 'absolute',
|
|
160
|
+
display: 'block',
|
|
161
|
+
width: '300%',
|
|
162
|
+
height: '300%',
|
|
163
|
+
boxSizing: 'border-box',
|
|
164
|
+
marginLeft: '-100%',
|
|
165
|
+
marginTop: '-100%',
|
|
166
|
+
borderRadius: 'full',
|
|
167
|
+
bgColor: 'primary.main',
|
|
168
|
+
animation: pulseRingAnimation,
|
|
169
|
+
}}
|
|
170
|
+
_after={{
|
|
171
|
+
content: '""',
|
|
172
|
+
position: 'absolute',
|
|
173
|
+
left: 0,
|
|
174
|
+
top: 0,
|
|
175
|
+
display: 'block',
|
|
176
|
+
width: '100%',
|
|
177
|
+
height: '100%',
|
|
178
|
+
bgColor: 'primary.main',
|
|
179
|
+
borderRadius: 'full',
|
|
180
|
+
boxShadow: '0 0 8px rgba(0,0,0,.3)',
|
|
181
|
+
animation: pulseDotAnimation,
|
|
182
|
+
}}
|
|
183
|
+
zIndex={2}
|
|
184
|
+
/>
|
|
185
|
+
</PopoverTrigger>
|
|
186
|
+
)}
|
|
187
|
+
<PopoverContent w="fit-content" minW="200px" maxW="400px">
|
|
188
|
+
<PopoverArrow />
|
|
189
|
+
<Box textAlign="left" p={0}>
|
|
190
|
+
<PopoverCloseButton color="gray.600" />
|
|
191
|
+
<Box py={4} px={2} color="black">
|
|
192
|
+
{cueRefs.length > 1 && (
|
|
193
|
+
<Subtext
|
|
194
|
+
color="primary.dark"
|
|
195
|
+
opacity={0.5}
|
|
196
|
+
mb={2}
|
|
197
|
+
fontSize="xs"
|
|
198
|
+
>{`${index + 1} / ${cueRefs.length}`}</Subtext>
|
|
199
|
+
)}
|
|
200
|
+
<Subtitle color="primary.dark" fontWeight="bold" mb={1}>
|
|
201
|
+
{title}
|
|
202
|
+
</Subtitle>
|
|
203
|
+
<Subtext color="gray.800" fontWeight="normal">
|
|
204
|
+
{description}
|
|
205
|
+
</Subtext>
|
|
206
|
+
</Box>
|
|
207
|
+
<Flex justifyContent="flex-end" gap={2} w="100%" p={3} pt={0}>
|
|
208
|
+
<Button
|
|
209
|
+
size="xs"
|
|
210
|
+
data-testid="guideCue-nextButton"
|
|
211
|
+
onClick={handleNext}
|
|
212
|
+
w="fit-content"
|
|
213
|
+
variant="secondary"
|
|
214
|
+
ref={ctaRef}
|
|
215
|
+
rightIcon={
|
|
216
|
+
currentIndex < cueRefs.length - 1 ? (
|
|
217
|
+
<Icon icon="IoChevronForward" boxSize="xs" />
|
|
218
|
+
) : (
|
|
219
|
+
<Icon icon="FaCheck" boxSize="xs" />
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
>
|
|
223
|
+
{currentIndex < cueRefs.length - 1 ? 'Next' : `Got it!`}
|
|
224
|
+
</Button>
|
|
225
|
+
</Flex>
|
|
226
|
+
</Box>
|
|
227
|
+
</PopoverContent>
|
|
228
|
+
</Popover>
|
|
229
|
+
</Portal>
|
|
230
|
+
);
|
|
231
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
createRef,
|
|
4
|
+
Dispatch,
|
|
5
|
+
SetStateAction,
|
|
6
|
+
useContext,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
|
|
10
|
+
type GuideCueContextType = {
|
|
11
|
+
cueRefs: React.RefObject<HTMLElement>[];
|
|
12
|
+
setCueRefs: Dispatch<SetStateAction<React.RefObject<HTMLElement>[]>>;
|
|
13
|
+
page: string;
|
|
14
|
+
numSteps: number;
|
|
15
|
+
currentIndex: number;
|
|
16
|
+
setCurrentIndex: Dispatch<SetStateAction<number>>;
|
|
17
|
+
isDisabled: boolean;
|
|
18
|
+
onComplete?: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const GuideCueContext = createContext<GuideCueContextType>({
|
|
22
|
+
cueRefs: [],
|
|
23
|
+
setCueRefs: () => {},
|
|
24
|
+
page: '',
|
|
25
|
+
numSteps: 0,
|
|
26
|
+
currentIndex: 0,
|
|
27
|
+
setCurrentIndex: () => {},
|
|
28
|
+
isDisabled: false,
|
|
29
|
+
onComplete: () => {},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const useGuideCue = () => {
|
|
33
|
+
return useContext(GuideCueContext);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const GuideCueProvider = ({
|
|
37
|
+
children,
|
|
38
|
+
page,
|
|
39
|
+
numSteps,
|
|
40
|
+
isDisabled = false,
|
|
41
|
+
onComplete,
|
|
42
|
+
}: {
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
page: string;
|
|
45
|
+
numSteps: number;
|
|
46
|
+
isDisabled?: boolean;
|
|
47
|
+
onComplete?: () => void;
|
|
48
|
+
}) => {
|
|
49
|
+
const [cueRefs, setCueRefs] = useState<React.RefObject<HTMLElement>[]>(
|
|
50
|
+
Array.from({ length: numSteps }, () => createRef<HTMLElement>())
|
|
51
|
+
);
|
|
52
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<GuideCueContext.Provider
|
|
56
|
+
value={{
|
|
57
|
+
cueRefs,
|
|
58
|
+
setCueRefs,
|
|
59
|
+
page,
|
|
60
|
+
numSteps,
|
|
61
|
+
currentIndex,
|
|
62
|
+
setCurrentIndex,
|
|
63
|
+
isDisabled,
|
|
64
|
+
onComplete,
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</GuideCueContext.Provider>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { getChakraArgTypes } from '@/../.storybook/getChakraArgTypes';
|
|
5
|
+
import { IconTypes } from '@/components/Icon/IconMap';
|
|
6
|
+
|
|
7
|
+
import { Icon } from './Icon';
|
|
8
|
+
import { IconProps } from './Icon.types';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Icon> = {
|
|
11
|
+
title: 'Components/Icon',
|
|
12
|
+
component: Icon,
|
|
13
|
+
argTypes: {
|
|
14
|
+
icon: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: Object.keys(IconTypes),
|
|
17
|
+
defaultValue: Object.keys(IconTypes)[0],
|
|
18
|
+
},
|
|
19
|
+
...getChakraArgTypes({ exclude: ['width', 'height'] }),
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
color: 'black',
|
|
23
|
+
icon: IconTypes.Addition,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryFn<typeof Icon>;
|
|
29
|
+
|
|
30
|
+
export const Single: Story = ({ icon, ...rest }: IconProps) => {
|
|
31
|
+
return <Icon icon={IconTypes[icon]} {...rest} />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const AllIcons: StoryFn<IconProps> = (
|
|
35
|
+
args: Omit<IconProps, 'glyph'>
|
|
36
|
+
) => (
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
width: '100%',
|
|
40
|
+
display: 'grid',
|
|
41
|
+
gridTemplateColumns: 'repeat(5, 1fr)',
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
{Object.keys(IconTypes).map((iconName) => {
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
key={iconName}
|
|
48
|
+
style={{
|
|
49
|
+
padding: '8px',
|
|
50
|
+
textAlign: 'center',
|
|
51
|
+
border: '1px solid gray',
|
|
52
|
+
borderRadius: '8px',
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
margin: '0.5rem',
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
<Icon {...args} icon={IconTypes[iconName]} />
|
|
61
|
+
<div
|
|
62
|
+
style={{
|
|
63
|
+
fontSize: '12px',
|
|
64
|
+
color: 'gray',
|
|
65
|
+
marginTop: '0.5rem',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{iconName}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
})}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
AllIcons.argTypes = {
|
|
76
|
+
icon: { control: false },
|
|
77
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { IconType as ReactIconType } from 'react-icons/lib';
|
|
3
|
+
import { chakra, useToken } from '@chakra-ui/react';
|
|
4
|
+
|
|
5
|
+
import { iconStyles } from '@/components/Icon/Icon.styles';
|
|
6
|
+
|
|
7
|
+
import { IconProps } from './Icon.types';
|
|
8
|
+
import { CUSTOM_ICON_MAP, REACT_ICONS_MAP } from './IconMap';
|
|
9
|
+
|
|
10
|
+
export const Icon = forwardRef<SVGSVGElement, IconProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
icon,
|
|
14
|
+
color,
|
|
15
|
+
boxSize = 'md', // Default to 'md' size
|
|
16
|
+
...rest
|
|
17
|
+
}: IconProps,
|
|
18
|
+
ref
|
|
19
|
+
) => {
|
|
20
|
+
// Map `boxSize` to Chakra size tokens using `useToken`
|
|
21
|
+
const sizeMapping = {
|
|
22
|
+
xs: '4',
|
|
23
|
+
sm: '5',
|
|
24
|
+
md: '6',
|
|
25
|
+
lg: '8',
|
|
26
|
+
xl: '10',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const mappedBoxSize =
|
|
30
|
+
sizeMapping[boxSize as keyof typeof sizeMapping] || boxSize;
|
|
31
|
+
const [resolvedBoxSize] = useToken('sizes', [
|
|
32
|
+
mappedBoxSize as string | number,
|
|
33
|
+
]);
|
|
34
|
+
const [resolvedColor] = useToken('colors', [color || '']);
|
|
35
|
+
|
|
36
|
+
// Handle react-icons
|
|
37
|
+
if (icon in REACT_ICONS_MAP) {
|
|
38
|
+
const IconComponent = chakra(REACT_ICONS_MAP[icon] as ReactIconType);
|
|
39
|
+
return (
|
|
40
|
+
<IconComponent
|
|
41
|
+
size={resolvedBoxSize}
|
|
42
|
+
color={resolvedColor || color}
|
|
43
|
+
ref={ref}
|
|
44
|
+
{...rest}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Handle custom SVG icons
|
|
50
|
+
let IconComponent = CUSTOM_ICON_MAP[icon];
|
|
51
|
+
if (!IconComponent) {
|
|
52
|
+
console.warn(
|
|
53
|
+
`No icon component found for ${icon}. Rendering fallback icon.`
|
|
54
|
+
);
|
|
55
|
+
IconComponent = CUSTOM_ICON_MAP['VerticalEllipsis'];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Wrap the custom icon in Chakra's `chakra` for compatibility
|
|
59
|
+
const ChakraIcon = chakra(IconComponent);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ChakraIcon
|
|
63
|
+
{...iconStyles}
|
|
64
|
+
color={resolvedColor}
|
|
65
|
+
boxSize={resolvedBoxSize}
|
|
66
|
+
ref={ref}
|
|
67
|
+
{...rest}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
Icon.displayName = 'Icon';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { IconType } from './IconMap';
|
|
5
|
+
|
|
6
|
+
export type IconProps = Partial<SVGProps<SVGElement>> &
|
|
7
|
+
// Omit the size prop to avoid confusion. Only the boxSize prop should be used
|
|
8
|
+
Omit<BoxProps, 'size' | 'icon'> & {
|
|
9
|
+
icon: IconType;
|
|
10
|
+
};
|