@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,102 @@
|
|
|
1
|
+
import { useToken } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
import theme from '@/theme/index';
|
|
4
|
+
|
|
5
|
+
import { SelectVariant } from './Select.types';
|
|
6
|
+
|
|
7
|
+
export const placeholderStyles = {
|
|
8
|
+
color: theme.colors.gray[800],
|
|
9
|
+
fontSize: theme.fontSizes.p,
|
|
10
|
+
fontWeight: theme.fontWeights.semibold,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const menuStyles = {
|
|
14
|
+
width: 'max-content',
|
|
15
|
+
minWidth: '100%',
|
|
16
|
+
backgroundColor: theme.colors.white,
|
|
17
|
+
borderRadius: theme.radii.md,
|
|
18
|
+
border: `1px solid ${theme.colors.gray[400]}`,
|
|
19
|
+
marginTop: 3,
|
|
20
|
+
boxShadow: '0px 5px 20px 0px rgba(0, 0, 0, 0.10)',
|
|
21
|
+
zIndex: 9,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const optionStyles = ({
|
|
25
|
+
isDisabled,
|
|
26
|
+
isFocused,
|
|
27
|
+
isSelected,
|
|
28
|
+
}: {
|
|
29
|
+
isDisabled: boolean;
|
|
30
|
+
isFocused: boolean;
|
|
31
|
+
isSelected: boolean;
|
|
32
|
+
}) => ({
|
|
33
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
34
|
+
height: theme.sizes[10],
|
|
35
|
+
margin: '16px 0', // Use direct spacing value instead of theme.spacing[4]
|
|
36
|
+
borderRadius: theme.radii.sm,
|
|
37
|
+
fontSize: theme.fontSizes.p,
|
|
38
|
+
backgroundColor:
|
|
39
|
+
isSelected || isFocused || isDisabled
|
|
40
|
+
? theme.colors.gray[50]
|
|
41
|
+
: theme.colors.white,
|
|
42
|
+
color: isSelected
|
|
43
|
+
? theme.colors.gray[1500]
|
|
44
|
+
: isDisabled
|
|
45
|
+
? theme.colors.gray[800]
|
|
46
|
+
: theme.colors.gray[1200],
|
|
47
|
+
fontWeight: isSelected
|
|
48
|
+
? theme.fontWeights.semibold
|
|
49
|
+
: theme.fontWeights.normal,
|
|
50
|
+
'&:hover': {
|
|
51
|
+
backgroundColor: theme.colors.gray[50],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const controlStyles = {
|
|
56
|
+
borderRadius: theme.radii.md,
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
maxWidth: '100%',
|
|
59
|
+
height: '100%',
|
|
60
|
+
color: theme.colors.gray[1200],
|
|
61
|
+
fontSize: theme.fontSizes.p,
|
|
62
|
+
fontWeight: theme.fontWeights.semibold,
|
|
63
|
+
paddingLeft: 4,
|
|
64
|
+
paddingRight: 3,
|
|
65
|
+
border: `1px solid ${theme.colors.gray[400]}`,
|
|
66
|
+
boxShadow: 'none',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const getControlVariantStyles = (state: any, variant: SelectVariant) => {
|
|
70
|
+
const primaryColor = useToken(
|
|
71
|
+
'colors',
|
|
72
|
+
theme.semanticTokens.colors.primary.main
|
|
73
|
+
);
|
|
74
|
+
const dangerColor = useToken(
|
|
75
|
+
'colors',
|
|
76
|
+
theme.semanticTokens.colors.danger.main
|
|
77
|
+
);
|
|
78
|
+
switch (variant) {
|
|
79
|
+
case 'danger':
|
|
80
|
+
return {
|
|
81
|
+
border: `1px solid ${dangerColor}`,
|
|
82
|
+
boxShadow: `0 0 0 1px ${dangerColor}`,
|
|
83
|
+
};
|
|
84
|
+
default:
|
|
85
|
+
return {
|
|
86
|
+
fontWeight: theme.fontWeights.semibold,
|
|
87
|
+
border: `1px solid ${
|
|
88
|
+
state.isFocused ? primaryColor : theme.colors.gray[400]
|
|
89
|
+
}`,
|
|
90
|
+
boxShadow: state.isFocused
|
|
91
|
+
? `0 0 0 1px ${primaryColor} !important`
|
|
92
|
+
: 'none',
|
|
93
|
+
'&:hover': state.isFocused
|
|
94
|
+
? {
|
|
95
|
+
borderColor: primaryColor,
|
|
96
|
+
}
|
|
97
|
+
: {
|
|
98
|
+
borderColor: useToken('colors', 'gray.600'),
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactSelect, {
|
|
3
|
+
components,
|
|
4
|
+
ControlProps,
|
|
5
|
+
GroupBase,
|
|
6
|
+
MenuListProps,
|
|
7
|
+
OptionProps,
|
|
8
|
+
} from 'react-select';
|
|
9
|
+
import { Box, useTheme } from '@chakra-ui/react';
|
|
10
|
+
|
|
11
|
+
import { resolveStyle } from './_utils/resolveStyle';
|
|
12
|
+
import { VirtualizedMenuList } from './MenuList';
|
|
13
|
+
import { VirtualizedMenuListProvider } from './MenuList/VirtualizedMenuListContext';
|
|
14
|
+
import {
|
|
15
|
+
controlStyles,
|
|
16
|
+
getControlVariantStyles,
|
|
17
|
+
menuStyles,
|
|
18
|
+
optionStyles,
|
|
19
|
+
placeholderStyles,
|
|
20
|
+
} from './Select.styles';
|
|
21
|
+
import { SelectProps } from './Select.types';
|
|
22
|
+
|
|
23
|
+
export const Select = <
|
|
24
|
+
Option,
|
|
25
|
+
IsMulti extends boolean = false,
|
|
26
|
+
Group extends GroupBase<Option> = GroupBase<Option>,
|
|
27
|
+
>({
|
|
28
|
+
styles,
|
|
29
|
+
variant = 'default',
|
|
30
|
+
optionHeight = 35,
|
|
31
|
+
onMenuScrollToBottom,
|
|
32
|
+
'data-testid': dataTestId,
|
|
33
|
+
...rest
|
|
34
|
+
}: SelectProps<Option, IsMulti, Group> & { 'data-testid'?: string }) => {
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
const CustomOption = (props: OptionProps<Option, IsMulti, Group>) => {
|
|
37
|
+
const optionValue = (props.data as any)?.value || props.label || 'option';
|
|
38
|
+
return (
|
|
39
|
+
<Box
|
|
40
|
+
data-testid={
|
|
41
|
+
dataTestId ? `${dataTestId}-option-${optionValue}` : undefined
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
<components.Option {...props} />
|
|
45
|
+
</Box>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// 커스텀 Control 컴포넌트
|
|
50
|
+
const CustomControl = (props: ControlProps<Option, IsMulti, Group>) => {
|
|
51
|
+
return (
|
|
52
|
+
<Box data-testid={dataTestId ? `${dataTestId}-control` : undefined}>
|
|
53
|
+
<components.Control {...props} />
|
|
54
|
+
</Box>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
return (
|
|
58
|
+
<VirtualizedMenuListProvider>
|
|
59
|
+
<Box data-testid={dataTestId}>
|
|
60
|
+
<ReactSelect<Option, IsMulti, Group>
|
|
61
|
+
closeMenuOnSelect
|
|
62
|
+
closeMenuOnScroll
|
|
63
|
+
isSearchable={false}
|
|
64
|
+
tabIndex={0}
|
|
65
|
+
classNamePrefix="react-select"
|
|
66
|
+
components={{
|
|
67
|
+
MenuList: (props: MenuListProps<Option, IsMulti, Group>) => (
|
|
68
|
+
<VirtualizedMenuList<Option, IsMulti, Group>
|
|
69
|
+
{...props}
|
|
70
|
+
onMenuScrollToBottom={onMenuScrollToBottom}
|
|
71
|
+
optionHeight={optionHeight}
|
|
72
|
+
/>
|
|
73
|
+
),
|
|
74
|
+
Option: CustomOption,
|
|
75
|
+
Control: CustomControl,
|
|
76
|
+
...rest.components,
|
|
77
|
+
}}
|
|
78
|
+
styles={{
|
|
79
|
+
container: (base, state) => ({
|
|
80
|
+
...resolveStyle(
|
|
81
|
+
{
|
|
82
|
+
...base,
|
|
83
|
+
height: '100%',
|
|
84
|
+
},
|
|
85
|
+
styles?.container,
|
|
86
|
+
state
|
|
87
|
+
),
|
|
88
|
+
}),
|
|
89
|
+
placeholder: (base, state) => ({
|
|
90
|
+
...resolveStyle(
|
|
91
|
+
{
|
|
92
|
+
...base,
|
|
93
|
+
...placeholderStyles,
|
|
94
|
+
},
|
|
95
|
+
styles?.placeholder,
|
|
96
|
+
state
|
|
97
|
+
),
|
|
98
|
+
}),
|
|
99
|
+
valueContainer: (base, state) => ({
|
|
100
|
+
...resolveStyle(
|
|
101
|
+
{
|
|
102
|
+
...base,
|
|
103
|
+
textAlign: 'left',
|
|
104
|
+
},
|
|
105
|
+
styles?.valueContainer,
|
|
106
|
+
state
|
|
107
|
+
),
|
|
108
|
+
}),
|
|
109
|
+
singleValue: (base, state) => ({
|
|
110
|
+
...resolveStyle(
|
|
111
|
+
{
|
|
112
|
+
...base,
|
|
113
|
+
margin: 0,
|
|
114
|
+
color: theme.colors.gray[1000],
|
|
115
|
+
},
|
|
116
|
+
styles?.singleValue,
|
|
117
|
+
state
|
|
118
|
+
),
|
|
119
|
+
}),
|
|
120
|
+
menu: (base, state) => ({
|
|
121
|
+
...resolveStyle(
|
|
122
|
+
{
|
|
123
|
+
...base,
|
|
124
|
+
...menuStyles,
|
|
125
|
+
},
|
|
126
|
+
styles?.menu,
|
|
127
|
+
state
|
|
128
|
+
),
|
|
129
|
+
}),
|
|
130
|
+
menuList: (base, state) => ({
|
|
131
|
+
...resolveStyle(
|
|
132
|
+
{
|
|
133
|
+
...base,
|
|
134
|
+
padding: `0px ${theme.spacing[4]}`,
|
|
135
|
+
// Important for the virtualized list - DON'T override overflow
|
|
136
|
+
// as we need the default 'auto' from react-select for scrolling to work
|
|
137
|
+
},
|
|
138
|
+
styles?.menuList,
|
|
139
|
+
state
|
|
140
|
+
),
|
|
141
|
+
}),
|
|
142
|
+
option: (base, state) => ({
|
|
143
|
+
...resolveStyle(
|
|
144
|
+
{
|
|
145
|
+
...base,
|
|
146
|
+
textAlign: 'left',
|
|
147
|
+
padding: `${theme.spacing[2]} ${theme.spacing[4]}`,
|
|
148
|
+
...optionStyles(state),
|
|
149
|
+
},
|
|
150
|
+
styles?.option,
|
|
151
|
+
state
|
|
152
|
+
),
|
|
153
|
+
}),
|
|
154
|
+
menuPortal: (base, state) => ({
|
|
155
|
+
...resolveStyle(
|
|
156
|
+
{
|
|
157
|
+
...base,
|
|
158
|
+
zIndex: 9999,
|
|
159
|
+
},
|
|
160
|
+
styles?.menuPortal,
|
|
161
|
+
state
|
|
162
|
+
),
|
|
163
|
+
}),
|
|
164
|
+
control: (base, state) => ({
|
|
165
|
+
...resolveStyle(
|
|
166
|
+
{
|
|
167
|
+
...base,
|
|
168
|
+
...controlStyles,
|
|
169
|
+
...getControlVariantStyles(state, variant),
|
|
170
|
+
...(state.isDisabled && {
|
|
171
|
+
bg: theme.colors.gray[50],
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
styles?.control,
|
|
175
|
+
state
|
|
176
|
+
),
|
|
177
|
+
}),
|
|
178
|
+
indicatorSeparator: (base, state) => ({
|
|
179
|
+
...resolveStyle(
|
|
180
|
+
{
|
|
181
|
+
...base,
|
|
182
|
+
display: 'none',
|
|
183
|
+
},
|
|
184
|
+
styles?.indicatorSeparator,
|
|
185
|
+
state
|
|
186
|
+
),
|
|
187
|
+
}),
|
|
188
|
+
dropdownIndicator: (base, state) => ({
|
|
189
|
+
...resolveStyle(
|
|
190
|
+
{
|
|
191
|
+
...base,
|
|
192
|
+
color: theme.colors.gray[800],
|
|
193
|
+
},
|
|
194
|
+
styles?.dropdownIndicator,
|
|
195
|
+
state
|
|
196
|
+
),
|
|
197
|
+
}),
|
|
198
|
+
}}
|
|
199
|
+
{...rest}
|
|
200
|
+
/>
|
|
201
|
+
</Box>
|
|
202
|
+
</VirtualizedMenuListProvider>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GroupBase, Props } from 'react-select';
|
|
2
|
+
|
|
3
|
+
export type SelectVariant = 'default' | 'danger';
|
|
4
|
+
|
|
5
|
+
export type SelectProps<
|
|
6
|
+
Option,
|
|
7
|
+
IsMulti extends boolean,
|
|
8
|
+
Group extends GroupBase<Option>,
|
|
9
|
+
> = Props<Option, IsMulti, Group> & {
|
|
10
|
+
variant?: SelectVariant;
|
|
11
|
+
optionHeight?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type SelectOption<T> = {
|
|
16
|
+
label: string;
|
|
17
|
+
value: T;
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type StyleObject = Record<string, any>;
|
|
2
|
+
type StyleFunction = (base: StyleObject, state: any) => StyleObject;
|
|
3
|
+
|
|
4
|
+
export const resolveStyle = (
|
|
5
|
+
base: StyleObject,
|
|
6
|
+
style?: StyleObject | StyleFunction,
|
|
7
|
+
state: any = {}
|
|
8
|
+
): StyleObject => {
|
|
9
|
+
if (!style) {
|
|
10
|
+
return base;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (typeof style === 'function') {
|
|
14
|
+
return style(base, state);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
...base,
|
|
19
|
+
...style,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from './Select';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Slider,
|
|
6
|
+
SliderFilledTrack,
|
|
7
|
+
SliderThumb,
|
|
8
|
+
SliderTrack,
|
|
9
|
+
} from '@/components/Slider';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Slider',
|
|
13
|
+
component: Slider,
|
|
14
|
+
subcomponents: { SliderTrack, SliderFilledTrack, SliderThumb },
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => {
|
|
17
|
+
const [value, setValue] = useState(50);
|
|
18
|
+
return (
|
|
19
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
|
|
20
|
+
<span>Value: {value}</span>
|
|
21
|
+
<Story
|
|
22
|
+
args={{
|
|
23
|
+
onChange: (val: number) => setValue(val),
|
|
24
|
+
value,
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
} as ComponentMeta<typeof Slider>;
|
|
32
|
+
|
|
33
|
+
const Template: ComponentStory<typeof Slider> = (args) => (
|
|
34
|
+
<Slider {...args}>
|
|
35
|
+
<SliderTrack>
|
|
36
|
+
<SliderFilledTrack />
|
|
37
|
+
</SliderTrack>
|
|
38
|
+
<SliderThumb />
|
|
39
|
+
</Slider>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const Default = Template.bind({});
|
|
43
|
+
Default.args = {
|
|
44
|
+
min: 0,
|
|
45
|
+
max: 100,
|
|
46
|
+
step: 1,
|
|
47
|
+
defaultValue: 50,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Customized = Template.bind({});
|
|
51
|
+
Customized.args = {
|
|
52
|
+
min: 0,
|
|
53
|
+
max: 10,
|
|
54
|
+
step: 0.5,
|
|
55
|
+
defaultValue: 5,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const WithCustomThumb = Template.bind({});
|
|
59
|
+
WithCustomThumb.args = {
|
|
60
|
+
min: 0,
|
|
61
|
+
max: 1,
|
|
62
|
+
step: 0.01,
|
|
63
|
+
defaultValue: 0.5,
|
|
64
|
+
children: (
|
|
65
|
+
<>
|
|
66
|
+
<SliderTrack>
|
|
67
|
+
<SliderFilledTrack />
|
|
68
|
+
</SliderTrack>
|
|
69
|
+
<SliderThumb boxSize={6} bg="blue.500">
|
|
70
|
+
{/* Example custom content inside thumb */}
|
|
71
|
+
<span style={{ color: 'white', fontWeight: 'bold' }}>•</span>
|
|
72
|
+
</SliderThumb>
|
|
73
|
+
</>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { Slider as ChakraSlider } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SliderProps } from './Slider.types';
|
|
5
|
+
|
|
6
|
+
export const Slider = forwardRef(
|
|
7
|
+
({ ...rest }: SliderProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return <ChakraSlider {...rest} ref={ref} />;
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
Slider.displayName = 'Slider';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { SliderFilledTrack as ChakraSliderFilledTrack } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SliderFilledTrackProps } from './SliderFilledTrack.types';
|
|
5
|
+
|
|
6
|
+
export const SliderFilledTrack = forwardRef(
|
|
7
|
+
({ ...rest }: SliderFilledTrackProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return (
|
|
9
|
+
<ChakraSliderFilledTrack bgColor="primary.main" {...rest} ref={ref} />
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
SliderFilledTrack.displayName = 'SliderFilledTrack';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { SliderMark as ChakraSliderMark } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SliderMarkProps } from './SliderMark.types';
|
|
5
|
+
|
|
6
|
+
export const SliderMark = forwardRef(
|
|
7
|
+
({ ...rest }: SliderMarkProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return <ChakraSliderMark {...rest} ref={ref} />;
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
SliderMark.displayName = 'SliderMark';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { SliderThumb as ChakraSliderThumb } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SliderThumbProps } from './SliderThumb.types';
|
|
5
|
+
|
|
6
|
+
export const SliderThumb = forwardRef(
|
|
7
|
+
({ ...rest }: SliderThumbProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return (
|
|
9
|
+
<ChakraSliderThumb
|
|
10
|
+
border="3px solid"
|
|
11
|
+
w={4}
|
|
12
|
+
h={4}
|
|
13
|
+
borderColor="primary.main"
|
|
14
|
+
boxShadow="none"
|
|
15
|
+
{...rest}
|
|
16
|
+
ref={ref}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
SliderThumb.displayName = 'SliderThumb';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { SliderTrack as ChakraSliderTrack } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SliderTrackProps } from './SliderTrack.types';
|
|
5
|
+
|
|
6
|
+
export const SliderTrack = forwardRef(
|
|
7
|
+
({ ...rest }: SliderTrackProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return <ChakraSliderTrack {...rest} ref={ref} />;
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
SliderTrack.displayName = 'SliderTrack';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Spinner } from './Spinner';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Spinner',
|
|
8
|
+
component: Spinner,
|
|
9
|
+
} as ComponentMeta<typeof Spinner>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof Spinner> = (args) => (
|
|
12
|
+
<Spinner {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Default = Template.bind({});
|
|
16
|
+
Default.args = {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import { Spinner as ChakraSpinner } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { SpinnerProps } from './Spinner.types';
|
|
5
|
+
|
|
6
|
+
export const Spinner = forwardRef(
|
|
7
|
+
({ ...rest }: SpinnerProps, ref?: ForwardedRef<HTMLDivElement>) => {
|
|
8
|
+
return (
|
|
9
|
+
<ChakraSpinner
|
|
10
|
+
emptyColor="gray.200"
|
|
11
|
+
color="primary.main"
|
|
12
|
+
speed="0.65s"
|
|
13
|
+
{...rest}
|
|
14
|
+
ref={ref}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
Spinner.displayName = 'Spinner';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Stack, Switch, Text } from '@chakra-ui/react';
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Switch> = {
|
|
6
|
+
title: 'Components/Switch',
|
|
7
|
+
component: Switch,
|
|
8
|
+
argTypes: {
|
|
9
|
+
isChecked: { control: 'boolean' },
|
|
10
|
+
isDisabled: { control: 'boolean' },
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['sm', 'md', 'lg'], // Available sizes in Chakra's Switch
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof Switch>;
|
|
21
|
+
|
|
22
|
+
// Uncontrolled Story: Allows toggling without external state management
|
|
23
|
+
export const Uncontrolled: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
size: 'md',
|
|
26
|
+
isDisabled: false,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Controlled Story: Manage state externally
|
|
31
|
+
export const Controlled: Story = {
|
|
32
|
+
render: (args) => {
|
|
33
|
+
const [isChecked, setIsChecked] = useState(false);
|
|
34
|
+
|
|
35
|
+
const handleToggle = () => {
|
|
36
|
+
setIsChecked(!isChecked);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Stack direction="row" align="center" spacing={4}>
|
|
41
|
+
<Switch
|
|
42
|
+
{...args}
|
|
43
|
+
isChecked={isChecked} // Controlled isChecked state
|
|
44
|
+
onChange={handleToggle} // Toggling state
|
|
45
|
+
/>
|
|
46
|
+
<Text>{isChecked ? 'On' : 'Off'}</Text>
|
|
47
|
+
</Stack>
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
args: {
|
|
51
|
+
size: 'md',
|
|
52
|
+
isDisabled: false,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Disabled Story: Switch in a disabled state
|
|
57
|
+
export const Disabled: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
size: 'md',
|
|
60
|
+
isDisabled: true,
|
|
61
|
+
isChecked: true,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch';
|