@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 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-width="1.2" d="M10 17a7 7 0 1 0 0-14m0 14a7 7 0 1 1 0-14m0 14c-1.691 0-3.062-3.134-3.062-7S8.308 3 10 3m0 14c1.691 0 3.063-3.134 3.063-7S11.69 3 10 3M4.313 13.402c1.282-.734 3.413-1.214 5.824-1.214 2.517 0 4.728.523 5.988 1.312M4.313 6.598c1.282.734 3.413 1.215 5.824 1.215 2.517 0 4.728-.524 5.988-1.313"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="M8.36 8.125a.703.703 0 1 0-1.407 0zM6.952 17.5a.703.703 0 0 0 1.406 0zM5.313 3.203h9.375V1.797H5.313zm11.484 2.11v9.375h1.406V5.313zm-2.11 11.484H5.313v1.406h9.375zm-11.484-2.11V5.313H1.797v9.375zm2.11 2.11a2.11 2.11 0 0 1-2.11-2.11H1.797a3.516 3.516 0 0 0 3.516 3.516zm11.484-2.11a2.11 2.11 0 0 1-2.11 2.11v1.406a3.516 3.516 0 0 0 3.516-3.515zm-2.11-11.484a2.11 2.11 0 0 1 2.11 2.11h1.406a3.516 3.516 0 0 0-3.515-3.516zM5.313 1.797a3.516 3.516 0 0 0-3.516 3.516h1.406a2.11 2.11 0 0 1 2.11-2.11zm1.64 6.328V17.5H8.36V8.125zm-3.984.234H17.03V6.953H2.97z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g fill="#aeb2bc" clip-path="url(#a)"><path d="M12.202 4.944a.744.744 0 1 0 0-1.487.744.744 0 0 0 0 1.487M18.207 7.08a.946.946 0 1 0-1.337-1.338.946.946 0 0 0 1.337 1.337M19.749 12.794a1.047 1.047 0 1 0 0-2.093 1.047 1.047 0 0 0 0 2.093M17.538 15.936a1.148 1.148 0 1 0 0 2.295 1.148 1.148 0 0 0 0-2.295m-5.336 2.11a1.249 1.249 0 1 0 0 2.497 1.249 1.249 0 0 0 0-2.498m-6.29-1.917a1.35 1.35 0 1 0 1.909 1.91 1.35 1.35 0 0 0-1.91-1.91m.194-4.382a1.451 1.451 0 1 0-2.902 0 1.451 1.451 0 0 0 2.902 0m1.857-6.433a1.227 1.227 0 1 0-1.097 2.194 1.227 1.227 0 0 0 1.097-2.194"/></g><defs><clipPath id="a"><path fill="#fff" d="M3 3h18v18H3z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" fill="none" viewBox="0 0 14 16"><path stroke="#9499a5" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" d="M3.85 4.85h6.3m-6.3 3.6h6.3m-7.83-7.2h9.36c.646 0 1.17.604 1.17 1.35v12.15L10.9 13.4l-1.95 1.35L7 13.4l-1.95 1.35L3.1 13.4l-1.95 1.35V2.6c0-.746.524-1.35 1.17-1.35"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M15 4.5a.75.75 0 0 0-.721.544l-.813 2.846a3.75 3.75 0 0 1-2.576 2.576l-2.846.813a.75.75 0 0 0 0 1.442l2.846.813a3.75 3.75 0 0 1 2.576 2.576l.813 2.846a.75.75 0 0 0 1.442 0l.813-2.846a3.75 3.75 0 0 1 2.576-2.576l2.846-.813a.75.75 0 0 0 0-1.442l-2.846-.813a3.75 3.75 0 0 1-2.576-2.576l-.813-2.846A.75.75 0 0 0 15 4.5m-9-3a.75.75 0 0 0-.728.568l-.258 1.036a2.63 2.63 0 0 1-1.91 1.91l-1.036.258a.75.75 0 0 0 0 1.456l1.036.258a2.63 2.63 0 0 1 1.91 1.91l.258 1.036a.75.75 0 0 0 1.456 0l.258-1.036a2.63 2.63 0 0 1 1.91-1.91l1.036-.258a.75.75 0 0 0 0-1.456l-1.036-.258a2.63 2.63 0 0 1-1.91-1.91l-.258-1.036A.75.75 0 0 0 6 1.5M7.5 15a.75.75 0 0 0-.712.513l-.394 1.183a1.5 1.5 0 0 1-.948.948l-1.183.395a.75.75 0 0 0 0 1.422l1.183.395a1.5 1.5 0 0 1 .948.948l.395 1.183a.75.75 0 0 0 1.422 0l.395-1.183a1.5 1.5 0 0 1 .948-.948l1.183-.395a.75.75 0 0 0 0-1.422l-1.183-.395a1.5 1.5 0 0 1-.948-.948l-.395-1.183A.75.75 0 0 0 7.5 15" clip-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linejoin="round" stroke-width="1.4" d="M2.92 8.008C3.17 6.286 4.78 5 6.68 5h6.638c1.902 0 3.51 1.286 3.762 3.008l.885 6.067C18.27 16.153 16.5 18 14.204 18H5.796C3.5 18 1.73 16.153 2.034 14.075z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4" d="M6.667 4.833V5a3.333 3.333 0 0 1 6.666 0v-.167M7.5 9.166V10a2.5 2.5 0 1 0 5 0v-.834"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="currentColor" stroke="currentColor" stroke-linejoin="round" stroke-width="1.67" d="M2.92 8.008C3.17 6.286 4.78 5 6.68 5h6.638c1.902 0 3.51 1.286 3.762 3.008l.885 6.067C18.27 16.153 16.5 18 14.204 18H5.796C3.5 18 1.73 16.153 2.034 14.075z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.67" d="M6.667 4.834V5a3.333 3.333 0 0 1 6.666 0v-.166"/><path fill="#ebf0fb" fill-rule="evenodd" d="M7.5 8.332c.461 0 .835.374.835.835V10a1.665 1.665 0 1 0 3.33 0v-.833a.835.835 0 0 1 1.67 0V10a3.335 3.335 0 1 1-6.67 0v-.833c0-.461.374-.835.835-.835" clip-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="M14.483 6.896a1.38 1.38 0 1 0 0-2.758 1.38 1.38 0 0 0 0 2.758"/><path fill="currentColor" d="M14.483 9.655H5.517A4.14 4.14 0 0 1 1.38 5.517a4.14 4.14 0 0 1 4.138-4.138h8.966a4.14 4.14 0 0 1 4.138 4.138 4.14 4.14 0 0 1-4.138 4.138M5.517 2.758A2.76 2.76 0 0 0 2.76 5.517a2.76 2.76 0 0 0 2.758 2.758h8.966a2.76 2.76 0 0 0 2.758-2.758 2.76 2.76 0 0 0-2.758-2.759zM5.517 15.862a1.38 1.38 0 1 0 0-2.758 1.38 1.38 0 0 0 0 2.758"/><path fill="currentColor" d="M14.483 18.62H5.517a4.14 4.14 0 0 1-4.138-4.137 4.14 4.14 0 0 1 4.138-4.138h8.966a4.14 4.14 0 0 1 4.138 4.138 4.14 4.14 0 0 1-4.138 4.138m-8.966-6.896a2.76 2.76 0 0 0-2.758 2.759 2.76 2.76 0 0 0 2.758 2.758h8.966a2.76 2.76 0 0 0 2.758-2.758 2.76 2.76 0 0 0-2.758-2.759z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M5.517 9.62h8.966a4.14 4.14 0 0 0 4.138-4.137 4.14 4.14 0 0 0-4.138-4.138H5.517A4.14 4.14 0 0 0 1.38 5.483 4.14 4.14 0 0 0 5.517 9.62m10.345-4.103a1.38 1.38 0 1 1-2.758 0 1.38 1.38 0 0 1 2.758 0M5.517 18.62h8.966a4.14 4.14 0 0 0 4.138-4.137 4.14 4.14 0 0 0-4.138-4.138H5.517a4.14 4.14 0 0 0-4.138 4.138 4.14 4.14 0 0 0 4.138 4.138m1.38-4.137a1.38 1.38 0 1 1-2.759 0 1.38 1.38 0 0 1 2.759 0" clip-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="auto" fill="none" viewBox="0 0 49 49"><circle cx="24.5" cy="10.5" r="3.5" fill="currentColor"/><circle cx="24.5" cy="39.5" r="3.5" fill="currentColor"/><circle cx="24.5" cy="24.5" r="3.5" fill="currentColor"/></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mindlogic-ai/logician-ui",
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
|
+
"description": "A comprehensive React design system built on Chakra UI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"require": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"src",
|
|
16
|
+
"README.md",
|
|
17
|
+
"USAGE.md"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup || true",
|
|
22
|
+
"build:watch": "tsup --watch",
|
|
23
|
+
"prepublishOnly": "yarn build",
|
|
24
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
25
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"test": "echo 'No tests specified'",
|
|
28
|
+
"storybook": "storybook dev -p 6006",
|
|
29
|
+
"build-storybook": "storybook build",
|
|
30
|
+
"changeset": "changeset",
|
|
31
|
+
"changeset:version": "changeset version",
|
|
32
|
+
"changeset:publish": "changeset publish",
|
|
33
|
+
"changeset:status": "changeset status",
|
|
34
|
+
"optimize-icons": "node scripts/optimize-icons.js",
|
|
35
|
+
"update-intl": "./scripts/get-lang-pack.sh"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@chakra-ui/react": "^2.8.0",
|
|
39
|
+
"@emotion/react": "^11.11.0",
|
|
40
|
+
"@emotion/styled": "^11.11.0",
|
|
41
|
+
"framer-motion": "^10.0.0",
|
|
42
|
+
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
43
|
+
"react": "^18.0.0",
|
|
44
|
+
"react-dom": "^18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"next": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@mdxeditor/editor": "^1.0.0",
|
|
53
|
+
"@tanstack/react-virtual": "^3.0.0",
|
|
54
|
+
"@types/lodash": "^4.17.20",
|
|
55
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
56
|
+
"chakra-dayzed-datepicker": "^0.3.1",
|
|
57
|
+
"date-fns": "^2.30.0",
|
|
58
|
+
"katex": "^0.16.22",
|
|
59
|
+
"libphonenumber-js": "^1.10.0",
|
|
60
|
+
"lodash": "^4.17.21",
|
|
61
|
+
"polished": "^4.3.0",
|
|
62
|
+
"react-icons": "^5.0.0",
|
|
63
|
+
"react-markdown": "^10.1.0",
|
|
64
|
+
"react-pin-input": "^1.3.0",
|
|
65
|
+
"react-select": "^5.8.0",
|
|
66
|
+
"react-spinners": "^0.17.0",
|
|
67
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
68
|
+
"recharts": "^3.1.2",
|
|
69
|
+
"rehype-katex": "^7.0.1",
|
|
70
|
+
"rehype-raw": "^7.0.0",
|
|
71
|
+
"remark-breaks": "^4.0.0",
|
|
72
|
+
"remark-flexible-markers": "^1.3.0",
|
|
73
|
+
"remark-gfm": "^4.0.1",
|
|
74
|
+
"remark-math": "^6.0.0"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@chakra-ui/react": "^2.8.0",
|
|
78
|
+
"@changesets/cli": "^2.27.0",
|
|
79
|
+
"@emotion/react": "^11.11.0",
|
|
80
|
+
"@emotion/styled": "^11.11.0",
|
|
81
|
+
"@next/eslint-plugin-next": "^15.5.0",
|
|
82
|
+
"@storybook/addon-docs": "^8.5.0",
|
|
83
|
+
"@storybook/addon-essentials": "^8.5.0",
|
|
84
|
+
"@storybook/react": "^8.5.0",
|
|
85
|
+
"@storybook/react-vite": "^8.5.0",
|
|
86
|
+
"@types/react": "^18.2.0",
|
|
87
|
+
"@types/react-dom": "^18.2.0",
|
|
88
|
+
"@types/svgo": "^3.0.0",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
90
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
91
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
92
|
+
"eslint": "^8.45.0",
|
|
93
|
+
"eslint-config-prettier": "^10.1.8",
|
|
94
|
+
"eslint-plugin-import": "^2.32.0",
|
|
95
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
96
|
+
"eslint-plugin-react": "^7.33.0",
|
|
97
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
98
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
99
|
+
"eslint-plugin-storybook": "^9.1.2",
|
|
100
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
101
|
+
"framer-motion": "^10.0.0",
|
|
102
|
+
"prettier": "^3.6.2",
|
|
103
|
+
"react": "^18.0.0",
|
|
104
|
+
"react-dom": "^18.0.0",
|
|
105
|
+
"storybook": "^8.5.0",
|
|
106
|
+
"svgo": "^4.0.0",
|
|
107
|
+
"tsc-alias": "^1.8.0",
|
|
108
|
+
"tsup": "^8.5.0",
|
|
109
|
+
"typescript": "^5.2.0",
|
|
110
|
+
"vite": "^5.0.0",
|
|
111
|
+
"vite-plugin-svgr": "^4.3.0"
|
|
112
|
+
},
|
|
113
|
+
"keywords": [
|
|
114
|
+
"react",
|
|
115
|
+
"components",
|
|
116
|
+
"design-system",
|
|
117
|
+
"chakra-ui",
|
|
118
|
+
"ui-library",
|
|
119
|
+
"typescript"
|
|
120
|
+
],
|
|
121
|
+
"author": "Mindlogic AI",
|
|
122
|
+
"license": "MIT",
|
|
123
|
+
"repository": {
|
|
124
|
+
"type": "git",
|
|
125
|
+
"url": "git+https://github.com/mindlogic-ai/logician-ui.git"
|
|
126
|
+
},
|
|
127
|
+
"bugs": {
|
|
128
|
+
"url": "https://github.com/mindlogic-ai/logician-ui/issues"
|
|
129
|
+
},
|
|
130
|
+
"homepage": "https://github.com/mindlogic-ai/logician-ui#readme",
|
|
131
|
+
"engines": {
|
|
132
|
+
"node": ">=16.0.0",
|
|
133
|
+
"yarn": ">=1.22.0"
|
|
134
|
+
},
|
|
135
|
+
"publishConfig": {
|
|
136
|
+
"access": "public"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Accordion, AccordionButton, AccordionItem, AccordionPanel } from '.';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Accordion> = {
|
|
7
|
+
title: 'Components/Accordion',
|
|
8
|
+
component: Accordion,
|
|
9
|
+
args: {
|
|
10
|
+
children: 'Default Accordion',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryFn<typeof Accordion>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = (args) => {
|
|
18
|
+
return (
|
|
19
|
+
<Accordion {...args}>
|
|
20
|
+
<AccordionItem>
|
|
21
|
+
<AccordionButton>Test button</AccordionButton>
|
|
22
|
+
<AccordionPanel>Test panel</AccordionPanel>
|
|
23
|
+
</AccordionItem>
|
|
24
|
+
</Accordion>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const TwoItems: Story = (args) => {
|
|
29
|
+
return (
|
|
30
|
+
<Accordion {...args}>
|
|
31
|
+
<AccordionItem>
|
|
32
|
+
<AccordionButton>Test button</AccordionButton>
|
|
33
|
+
<AccordionPanel>Test panel</AccordionPanel>
|
|
34
|
+
</AccordionItem>
|
|
35
|
+
<AccordionItem>
|
|
36
|
+
<AccordionButton>Test button 2</AccordionButton>
|
|
37
|
+
<AccordionPanel>Test panel 2</AccordionPanel>
|
|
38
|
+
</AccordionItem>
|
|
39
|
+
</Accordion>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Accordion as ChakraAccordion, AccordionProps } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export const Accordion = (props: AccordionProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<ChakraAccordion
|
|
6
|
+
allowMultiple
|
|
7
|
+
borderRadius={4}
|
|
8
|
+
overflow="hidden"
|
|
9
|
+
border="1px solid"
|
|
10
|
+
borderColor="gray.300"
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
AccordionButton as ChakraAccordionButton,
|
|
4
|
+
AccordionIcon,
|
|
5
|
+
ChakraProps,
|
|
6
|
+
Flex,
|
|
7
|
+
} from '@chakra-ui/react';
|
|
8
|
+
|
|
9
|
+
import theme from '@/theme/index';
|
|
10
|
+
|
|
11
|
+
export const AccordionButton = ({
|
|
12
|
+
_hover = {},
|
|
13
|
+
_expanded = {},
|
|
14
|
+
customIcon = undefined,
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
}: PropsWithChildren<ChakraProps> & {
|
|
18
|
+
customIcon?: ReactNode;
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<ChakraAccordionButton
|
|
22
|
+
_hover={{
|
|
23
|
+
bg: `${theme.colors.main}08`,
|
|
24
|
+
..._hover,
|
|
25
|
+
}}
|
|
26
|
+
_expanded={{
|
|
27
|
+
bg: `${theme.colors.main}12`,
|
|
28
|
+
borderBottomWidth: '1px',
|
|
29
|
+
..._expanded,
|
|
30
|
+
}}
|
|
31
|
+
fontWeight="bold"
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
<Flex w="100%" justify="space-between" align="center">
|
|
35
|
+
{children}
|
|
36
|
+
{customIcon ? customIcon : <AccordionIcon />}
|
|
37
|
+
</Flex>
|
|
38
|
+
</ChakraAccordionButton>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AccordionItem as ChakraAccordionItem } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export const AccordionItem = ({ _first = {}, _last = {}, ...rest }) => {
|
|
4
|
+
return (
|
|
5
|
+
<ChakraAccordionItem
|
|
6
|
+
_first={{
|
|
7
|
+
borderTopWidth: 0,
|
|
8
|
+
..._first,
|
|
9
|
+
}}
|
|
10
|
+
_last={{
|
|
11
|
+
borderBottomWidth: 0,
|
|
12
|
+
..._last,
|
|
13
|
+
}}
|
|
14
|
+
{...rest}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { action } from '@storybook/addon-actions';
|
|
3
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
import { Alert } from './Alert';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Alert> = {
|
|
8
|
+
title: 'Components/Alert',
|
|
9
|
+
component: Alert,
|
|
10
|
+
args: {
|
|
11
|
+
status: 'error',
|
|
12
|
+
children: 'Pro 플랜 무료 체험이 Jan 01 에 종료됩니다.',
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
status: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['error', 'success', 'warning', 'info'],
|
|
18
|
+
description: 'Status of the Alert component',
|
|
19
|
+
},
|
|
20
|
+
onClose: {
|
|
21
|
+
control: false,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryFn<typeof Alert>;
|
|
28
|
+
|
|
29
|
+
// Default story without a close button
|
|
30
|
+
export const Default: Story = (args) => <Alert {...args} />;
|
|
31
|
+
|
|
32
|
+
// Story with a close button
|
|
33
|
+
export const WithButton: Story = (args) => <Alert {...args} />;
|
|
34
|
+
WithButton.args = {
|
|
35
|
+
status: 'success',
|
|
36
|
+
children: '성공적으로 완료되었습니다!',
|
|
37
|
+
onClose: action('onClose'),
|
|
38
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const AlertStyles = {
|
|
2
|
+
error: {
|
|
3
|
+
bg: 'danger.lighter',
|
|
4
|
+
color: 'danger.dark',
|
|
5
|
+
},
|
|
6
|
+
success: {
|
|
7
|
+
bg: 'success.lighter',
|
|
8
|
+
color: 'success.dark',
|
|
9
|
+
},
|
|
10
|
+
warning: {
|
|
11
|
+
bg: 'warning.lighter',
|
|
12
|
+
color: 'warning.dark',
|
|
13
|
+
},
|
|
14
|
+
info: {
|
|
15
|
+
bg: 'primary.light',
|
|
16
|
+
color: 'primary.dark',
|
|
17
|
+
},
|
|
18
|
+
loading: {},
|
|
19
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Alert as ChakraAlert, AlertIcon, CloseButton } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
import { AlertStyles } from './Alert.styles';
|
|
5
|
+
import { AlertProps } from './Alert.types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A reusable Alert component that displays status messages.
|
|
9
|
+
*
|
|
10
|
+
* @param children - The content to display inside the alert.
|
|
11
|
+
* @param status - The status of the alert. Determines the visual style of the alert.
|
|
12
|
+
* Options: `'error' | 'success' | 'warning' | 'info'`.
|
|
13
|
+
* Default: `'error'`.
|
|
14
|
+
* @param onClose - Callback function triggered when the close button is clicked.
|
|
15
|
+
* If provided, a close button will be rendered in the alert.
|
|
16
|
+
* The function receives no arguments.
|
|
17
|
+
* @param rest - Additional props inherited from Chakra UI's `AlertProps`.
|
|
18
|
+
*/
|
|
19
|
+
export const Alert = ({
|
|
20
|
+
children,
|
|
21
|
+
status = 'error',
|
|
22
|
+
onClose,
|
|
23
|
+
...rest
|
|
24
|
+
}: AlertProps) => {
|
|
25
|
+
const styles = AlertStyles[status] || {};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ChakraAlert
|
|
29
|
+
minH={16}
|
|
30
|
+
display="flex"
|
|
31
|
+
justifyContent="center"
|
|
32
|
+
status={status}
|
|
33
|
+
{...styles}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
36
|
+
<AlertIcon />
|
|
37
|
+
{children}
|
|
38
|
+
{onClose && <CloseButton onClick={onClose} />}
|
|
39
|
+
</ChakraAlert>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './Alert';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { AutowidthInput } from './AutowidthInput';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof AutowidthInput> = {
|
|
6
|
+
title: 'Components/AutowidthInput',
|
|
7
|
+
component: AutowidthInput,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryFn<typeof AutowidthInput>;
|
|
12
|
+
|
|
13
|
+
export const Basic: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
value: 'test',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const AsHeading: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
value: 'test',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Box, Input, InputProps } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
export const AutowidthInput = ({
|
|
5
|
+
value,
|
|
6
|
+
placeholder,
|
|
7
|
+
style = {},
|
|
8
|
+
widthMeasureProps,
|
|
9
|
+
...rest
|
|
10
|
+
}: InputProps & { widthMeasureProps?: any }) => {
|
|
11
|
+
const valueWidthMeasureRef = useRef<HTMLDivElement>(null);
|
|
12
|
+
const [inputWidth, setInputWidth] = useState<number>();
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (valueWidthMeasureRef.current)
|
|
16
|
+
setInputWidth(valueWidthMeasureRef.current.offsetWidth);
|
|
17
|
+
}, [value, style]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Box>
|
|
21
|
+
<span
|
|
22
|
+
ref={valueWidthMeasureRef}
|
|
23
|
+
{...widthMeasureProps}
|
|
24
|
+
style={{
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
opacity: 0,
|
|
27
|
+
pointerEvents: 'none',
|
|
28
|
+
width: 'fit-content',
|
|
29
|
+
display: 'inline-flex',
|
|
30
|
+
...widthMeasureProps?.style,
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{value || placeholder}
|
|
34
|
+
</span>
|
|
35
|
+
<Input
|
|
36
|
+
value={value}
|
|
37
|
+
placeholder={placeholder}
|
|
38
|
+
{...rest}
|
|
39
|
+
style={{
|
|
40
|
+
width: inputWidth,
|
|
41
|
+
boxSizing: 'content-box',
|
|
42
|
+
...style,
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
</Box>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AutowidthInput } from './AutowidthInput';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Avatar } from '.';
|
|
5
|
+
const meta: Meta<typeof Avatar> = {
|
|
6
|
+
title: 'Components/Avatar',
|
|
7
|
+
component: Avatar,
|
|
8
|
+
args: {
|
|
9
|
+
size: 'md',
|
|
10
|
+
name: '',
|
|
11
|
+
src: '',
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
size: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: ['2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', 'full'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryFn<typeof Avatar>;
|
|
23
|
+
export const Basic: Story = (args) => <Avatar {...args} />;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Avatar as ChakraAvatar,
|
|
4
|
+
AvatarProps as ChakraAvatarProps,
|
|
5
|
+
} from '@chakra-ui/react';
|
|
6
|
+
|
|
7
|
+
export const Avatar = forwardRef(({ ...rest }: ChakraAvatarProps, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<ChakraAvatar
|
|
10
|
+
ref={ref}
|
|
11
|
+
borderWidth="1px"
|
|
12
|
+
borderColor="gray.200"
|
|
13
|
+
overflow="hidden"
|
|
14
|
+
{...rest}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar } from './Avatar';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Badge } from '.';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Badge> = {
|
|
7
|
+
title: 'Components/Badge',
|
|
8
|
+
component: Badge,
|
|
9
|
+
args: {
|
|
10
|
+
children: 'Pro Plan',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
textTransform: {
|
|
14
|
+
control: 'radio',
|
|
15
|
+
options: ['none', 'uppercase'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryFn<typeof Badge>;
|
|
22
|
+
|
|
23
|
+
export const Basic: Story = (args) => <Badge {...args} />;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Badge as ChakraBadge,
|
|
4
|
+
BadgeProps as ChakraBadgeProps,
|
|
5
|
+
} from '@chakra-ui/react';
|
|
6
|
+
|
|
7
|
+
import { baseStyles } from './Badge.styles';
|
|
8
|
+
|
|
9
|
+
export const Badge = forwardRef(
|
|
10
|
+
(
|
|
11
|
+
{ textTransform = 'none', ...rest }: ChakraBadgeProps,
|
|
12
|
+
ref?: ForwardedRef<HTMLButtonElement>
|
|
13
|
+
) => {
|
|
14
|
+
return (
|
|
15
|
+
<ChakraBadge
|
|
16
|
+
{...baseStyles}
|
|
17
|
+
w="fit-content"
|
|
18
|
+
textTransform={textTransform}
|
|
19
|
+
{...rest}
|
|
20
|
+
ref={ref}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
Badge.displayName = 'Badge';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Banner } from './Banner';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Banner',
|
|
8
|
+
component: Banner,
|
|
9
|
+
args: {
|
|
10
|
+
children: 'This is a banner message',
|
|
11
|
+
},
|
|
12
|
+
} as ComponentMeta<typeof Banner>;
|
|
13
|
+
|
|
14
|
+
const Template: ComponentStory<typeof Banner> = (args) => <Banner {...args} />;
|
|
15
|
+
|
|
16
|
+
export const Info = Template.bind({});
|
|
17
|
+
Info.args = {
|
|
18
|
+
variant: 'info',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Success = Template.bind({});
|
|
22
|
+
Success.args = {
|
|
23
|
+
variant: 'success',
|
|
24
|
+
children: 'Operation completed successfully!',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Warning = Template.bind({});
|
|
28
|
+
Warning.args = {
|
|
29
|
+
variant: 'warning',
|
|
30
|
+
children: 'Please review your changes before continuing.',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Danger = Template.bind({});
|
|
34
|
+
Danger.args = {
|
|
35
|
+
variant: 'danger',
|
|
36
|
+
children: 'An error occurred. Please try again.',
|
|
37
|
+
};
|