@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,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Pagination } from './Pagination';
|
|
5
|
+
import { PaginationProps } from './Pagination.types';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Pagination',
|
|
9
|
+
component: Pagination,
|
|
10
|
+
args: {
|
|
11
|
+
currentPage: 1,
|
|
12
|
+
numTotalItems: 100,
|
|
13
|
+
itemsPerPageOptions: [30, 40, 50],
|
|
14
|
+
itemsPerPage: 30,
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
currentPage: { control: 'number' },
|
|
18
|
+
maxPage: { control: 'number' },
|
|
19
|
+
},
|
|
20
|
+
} as Meta<typeof Pagination>;
|
|
21
|
+
|
|
22
|
+
export const Default: StoryFn<PaginationProps> = (args) => {
|
|
23
|
+
const [currentPage, setCurrentPage] = React.useState(args.currentPage ?? 0);
|
|
24
|
+
const [itemsPerPage, setItemsPerPage] = React.useState(args.itemsPerPage);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Pagination
|
|
28
|
+
{...args}
|
|
29
|
+
currentPage={currentPage}
|
|
30
|
+
onCurrentPageChange={setCurrentPage}
|
|
31
|
+
onBack={() => setCurrentPage((prev) => Math.max(prev - 1, 1))}
|
|
32
|
+
onNext={() =>
|
|
33
|
+
setCurrentPage((prev) =>
|
|
34
|
+
Math.min(prev + 1, Math.ceil(args.numTotalItems / itemsPerPage))
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
numTotalItems={args.numTotalItems}
|
|
38
|
+
itemsPerPageOptions={args.itemsPerPageOptions}
|
|
39
|
+
itemsPerPage={itemsPerPage}
|
|
40
|
+
onItemsPerPageOptionChange={setItemsPerPage}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const NoItemsPerPageOptions: StoryFn<PaginationProps> = (args) => {
|
|
46
|
+
return <Pagination {...args} />;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
NoItemsPerPageOptions.args = {
|
|
50
|
+
itemsPerPageOptions: undefined,
|
|
51
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react';
|
|
2
|
+
import { SingleValue } from 'react-select';
|
|
3
|
+
import { Flex, useTheme } from '@chakra-ui/react';
|
|
4
|
+
|
|
5
|
+
import { Icon } from '@/components/Icon';
|
|
6
|
+
import { IconButton } from '@/components/IconButton';
|
|
7
|
+
import { Subtext, Subtitle } from '@/components/Typography';
|
|
8
|
+
import { useTranslate } from '@/hooks/useTranslate';
|
|
9
|
+
|
|
10
|
+
import { Select } from '../Select';
|
|
11
|
+
import { SelectOption } from '../Select/Select.types';
|
|
12
|
+
import { PaginationProps } from './Pagination.types';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A pagination component that allows users to navigate through pages.
|
|
16
|
+
* Displays the current page number and the maximum page count.
|
|
17
|
+
* Supports both controlled and uncontrolled modes.
|
|
18
|
+
*
|
|
19
|
+
* - **Controlled Mode**: Pass `currentPage` and `onBack`/`onNext` props to fully control the pagination behavior.
|
|
20
|
+
* - **Uncontrolled Mode**: If `currentPage` is not provided, the component manages its own internal state for the current page.
|
|
21
|
+
*
|
|
22
|
+
* @param {PaginationProps} props - Props for the Pagination component.
|
|
23
|
+
* @param {number} [props.currentPage] - The current page number (controlled mode).
|
|
24
|
+
* @param {number} props.maxPage - The maximum number of pages available.
|
|
25
|
+
* @param {() => void} [props.onBack] - Callback triggered when the "Back" button is clicked.
|
|
26
|
+
* @param {() => void} [props.onNext] - Callback triggered when the "Next" button is clicked.
|
|
27
|
+
*/
|
|
28
|
+
export const Pagination = ({
|
|
29
|
+
currentPage: controlledCurrentPage,
|
|
30
|
+
onCurrentPageChange,
|
|
31
|
+
numTotalItems,
|
|
32
|
+
onBack,
|
|
33
|
+
onNext,
|
|
34
|
+
itemsPerPageOptions,
|
|
35
|
+
itemsPerPage,
|
|
36
|
+
onItemsPerPageOptionChange,
|
|
37
|
+
...rest
|
|
38
|
+
}: PaginationProps) => {
|
|
39
|
+
const theme = useTheme();
|
|
40
|
+
const translate = useTranslate();
|
|
41
|
+
const [uncontrolledCurrentPage, setUncontrolledCurrentPage] =
|
|
42
|
+
useState<number>(1);
|
|
43
|
+
const maxPage = useMemo(
|
|
44
|
+
() => Math.ceil(numTotalItems / itemsPerPage),
|
|
45
|
+
[numTotalItems, itemsPerPage]
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const currentPage = controlledCurrentPage ?? uncontrolledCurrentPage; // Use controlled or internal number state
|
|
49
|
+
const handleBack = () => {
|
|
50
|
+
setUncontrolledCurrentPage((prev) => Math.max(prev - 1, 1));
|
|
51
|
+
if (onBack && currentPage > 1) {
|
|
52
|
+
// Controlled mode: call the provided onBack
|
|
53
|
+
onBack();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleNext = () => {
|
|
58
|
+
setUncontrolledCurrentPage((prev) => Math.min(prev + 1, maxPage));
|
|
59
|
+
if (onNext && currentPage < maxPage) {
|
|
60
|
+
// Controlled mode: call the provided onNext
|
|
61
|
+
onNext();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleItemsPerPageOptionChange = (
|
|
66
|
+
newValue: SingleValue<SelectOption<number>>
|
|
67
|
+
) => {
|
|
68
|
+
if (newValue) {
|
|
69
|
+
const newItemsPerPage = newValue.value;
|
|
70
|
+
onItemsPerPageOptionChange?.(newItemsPerPage);
|
|
71
|
+
|
|
72
|
+
const newMaxPage = Math.ceil(numTotalItems / newItemsPerPage);
|
|
73
|
+
|
|
74
|
+
// If this makes the current page out of range, set the current page to the last page
|
|
75
|
+
if (currentPage > newMaxPage) {
|
|
76
|
+
setUncontrolledCurrentPage(newMaxPage);
|
|
77
|
+
onCurrentPageChange?.(newMaxPage);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Flex align="center" justify="space-between" w="100%" {...rest}>
|
|
84
|
+
<Flex align="center" gap={2}>
|
|
85
|
+
{itemsPerPageOptions && (
|
|
86
|
+
<Flex align="center" gap={2}>
|
|
87
|
+
<Select
|
|
88
|
+
styles={{
|
|
89
|
+
control: (base, state) => ({
|
|
90
|
+
...base,
|
|
91
|
+
fontSize: theme.fontSizes.sm,
|
|
92
|
+
padding: 0,
|
|
93
|
+
minHeight: '28px',
|
|
94
|
+
}),
|
|
95
|
+
dropdownIndicator: (base, props) => ({
|
|
96
|
+
...base,
|
|
97
|
+
padding: `0 ${theme.space[1]}`,
|
|
98
|
+
}),
|
|
99
|
+
}}
|
|
100
|
+
options={itemsPerPageOptions.map((option) => ({
|
|
101
|
+
label: option.toString(),
|
|
102
|
+
value: option,
|
|
103
|
+
}))}
|
|
104
|
+
value={{
|
|
105
|
+
label: itemsPerPage.toString(),
|
|
106
|
+
value: itemsPerPage,
|
|
107
|
+
}}
|
|
108
|
+
onChange={handleItemsPerPageOptionChange}
|
|
109
|
+
/>
|
|
110
|
+
<Subtext>{translate('pagination_items_per_page')}</Subtext>
|
|
111
|
+
</Flex>
|
|
112
|
+
)}
|
|
113
|
+
</Flex>
|
|
114
|
+
<Flex>
|
|
115
|
+
<Subtitle>
|
|
116
|
+
{translate('pagination_range_text', {
|
|
117
|
+
range_start: (currentPage - 1) * itemsPerPage + 1,
|
|
118
|
+
range_end: Math.min(numTotalItems, currentPage * itemsPerPage),
|
|
119
|
+
num_total_items: numTotalItems,
|
|
120
|
+
})}
|
|
121
|
+
</Subtitle>
|
|
122
|
+
</Flex>
|
|
123
|
+
<Flex align="center" gap={2}>
|
|
124
|
+
{maxPage > 1 && (
|
|
125
|
+
<>
|
|
126
|
+
<Subtitle>
|
|
127
|
+
{currentPage} / {maxPage}
|
|
128
|
+
</Subtitle>
|
|
129
|
+
<Flex align="center">
|
|
130
|
+
<IconButton
|
|
131
|
+
icon={<Icon icon="IoIosArrowBack" boxSize="sm" />}
|
|
132
|
+
aria-label={translate('previous') as string}
|
|
133
|
+
onClick={handleBack}
|
|
134
|
+
isDisabled={currentPage <= 1}
|
|
135
|
+
color={currentPage === 1 ? 'gray.400' : 'gray.1500'}
|
|
136
|
+
/>
|
|
137
|
+
<IconButton
|
|
138
|
+
icon={<Icon icon="IoChevronForward" boxSize="sm" />}
|
|
139
|
+
aria-label={translate('go_next_page_button') as string}
|
|
140
|
+
onClick={handleNext}
|
|
141
|
+
isDisabled={currentPage >= maxPage}
|
|
142
|
+
color={currentPage === maxPage ? 'gray.400' : 'gray.1500'}
|
|
143
|
+
/>
|
|
144
|
+
</Flex>
|
|
145
|
+
</>
|
|
146
|
+
)}
|
|
147
|
+
</Flex>
|
|
148
|
+
</Flex>
|
|
149
|
+
);
|
|
150
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FlexProps } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export interface PaginationProps extends FlexProps {
|
|
4
|
+
currentPage?: number;
|
|
5
|
+
onCurrentPageChange?: (page: number) => void;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
onNext?: () => void;
|
|
8
|
+
numTotalItems: number;
|
|
9
|
+
itemsPerPageOptions?: Array<number>;
|
|
10
|
+
itemsPerPage: number;
|
|
11
|
+
onItemsPerPageOptionChange?: (option: number) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { PasswordInput } from './PasswordInput';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/PasswordInput',
|
|
8
|
+
component: PasswordInput,
|
|
9
|
+
} as Meta<typeof PasswordInput>;
|
|
10
|
+
|
|
11
|
+
const Template: StoryFn<typeof PasswordInput> = (args) => (
|
|
12
|
+
<PasswordInput {...args} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Default = Template.bind({});
|
|
16
|
+
Default.args = {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ForwardedRef, forwardRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Icon } from '../Icon';
|
|
4
|
+
import { IconButton } from '../IconButton';
|
|
5
|
+
import { Input } from '../Input';
|
|
6
|
+
import { PasswordInputProps } from './PasswordInput.types';
|
|
7
|
+
|
|
8
|
+
export const PasswordInput = forwardRef(
|
|
9
|
+
(
|
|
10
|
+
{ wrapperProps, rightElementProps, ...rest }: PasswordInputProps,
|
|
11
|
+
ref?: ForwardedRef<HTMLInputElement>
|
|
12
|
+
) => {
|
|
13
|
+
const [show, setShow] = useState<boolean>(false);
|
|
14
|
+
const handleClick = () => setShow(!show);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Input
|
|
18
|
+
ref={ref}
|
|
19
|
+
wrapperProps={{ ...wrapperProps }}
|
|
20
|
+
trimWhiteSpace
|
|
21
|
+
{...rest}
|
|
22
|
+
type={show ? 'text' : 'password'}
|
|
23
|
+
rightIcon={
|
|
24
|
+
<IconButton
|
|
25
|
+
icon={
|
|
26
|
+
<Icon
|
|
27
|
+
icon={show ? 'FaRegEye' : 'FaRegEyeSlash'}
|
|
28
|
+
fill="gray.900"
|
|
29
|
+
boxSize="sm"
|
|
30
|
+
/>
|
|
31
|
+
}
|
|
32
|
+
onClick={handleClick}
|
|
33
|
+
aria-label="Toggle password visibility"
|
|
34
|
+
/>
|
|
35
|
+
}
|
|
36
|
+
rightElementProps={{ ...rightElementProps }}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
PasswordInput.displayName = 'PasswordInput';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputGroupProps,
|
|
3
|
+
InputProps as ChakraInputProps,
|
|
4
|
+
InputRightElementProps,
|
|
5
|
+
} from '@chakra-ui/react';
|
|
6
|
+
|
|
7
|
+
export interface PasswordInputProps
|
|
8
|
+
extends Omit<ChakraInputProps, 'rightIcon'> {
|
|
9
|
+
wrapperProps?: InputGroupProps;
|
|
10
|
+
rightElementProps?: InputRightElementProps;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PasswordInput';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { PinInput, PinInputProps } from '.';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof PinInput> = {
|
|
7
|
+
title: 'Components/PinInput',
|
|
8
|
+
component: PinInput,
|
|
9
|
+
args: {
|
|
10
|
+
length: 5,
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
length: { control: 'number' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
const Template: StoryFn<PinInputProps> = (args: PinInputProps) => {
|
|
20
|
+
const [value, setValue] = useState('');
|
|
21
|
+
|
|
22
|
+
return <PinInput {...args} value={value} onChange={setValue} />;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Basic: StoryFn<PinInputProps> = Template.bind({});
|
|
26
|
+
Basic.args = {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import ReactPinInput from 'react-pin-input';
|
|
3
|
+
import { useTheme, useToken } from '@chakra-ui/react';
|
|
4
|
+
|
|
5
|
+
import { PinInputProps } from './PinInput.types';
|
|
6
|
+
|
|
7
|
+
// TODO: forwardRef
|
|
8
|
+
export const PinInput = ({
|
|
9
|
+
value,
|
|
10
|
+
onChange,
|
|
11
|
+
inputStyle,
|
|
12
|
+
autoFocus = true,
|
|
13
|
+
isNumberOnly = true,
|
|
14
|
+
...rest
|
|
15
|
+
}: PinInputProps) => {
|
|
16
|
+
const pinInputRef = useRef<ReactPinInput>(null);
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// Automatically focus the PinInput component on mount
|
|
21
|
+
if (autoFocus) pinInputRef.current?.focus();
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<ReactPinInput
|
|
26
|
+
ref={pinInputRef} // Attach the ref to the PinInput component
|
|
27
|
+
initialValue={value}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
type={isNumberOnly ? 'numeric' : 'custom'}
|
|
30
|
+
inputMode={isNumberOnly ? 'number' : 'text'}
|
|
31
|
+
inputStyle={{
|
|
32
|
+
borderColor: theme.colors.gray[200],
|
|
33
|
+
borderRadius: theme.radii.md,
|
|
34
|
+
width: theme.sizes[12],
|
|
35
|
+
height: theme.sizes[12],
|
|
36
|
+
...inputStyle,
|
|
37
|
+
}}
|
|
38
|
+
inputFocusStyle={{
|
|
39
|
+
borderColor: useToken(
|
|
40
|
+
'colors',
|
|
41
|
+
theme.semanticTokens.colors.primary.main
|
|
42
|
+
),
|
|
43
|
+
boxShadow: `0 0 0 1px ${useToken('colors', theme.semanticTokens.colors.primary.main)}`,
|
|
44
|
+
}}
|
|
45
|
+
onComplete={onChange}
|
|
46
|
+
autoSelect
|
|
47
|
+
regexCriteria={isNumberOnly ? /^[0-9]*$/ : undefined}
|
|
48
|
+
{...rest}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
PinInput.displayName = 'PinInput';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// TODO: This interface is copied from the react-pin-input package. Find a more scalable way to import this interface if it gets updated
|
|
2
|
+
interface ReactPinInputProps {
|
|
3
|
+
length: number;
|
|
4
|
+
initialValue?: number | string;
|
|
5
|
+
type?: 'numeric' | 'custom';
|
|
6
|
+
inputMode?: string;
|
|
7
|
+
secret?: boolean;
|
|
8
|
+
secretDelay?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
focus?: boolean;
|
|
11
|
+
onChange?: (value: string, index: number) => void;
|
|
12
|
+
onComplete?: (value: string, index: number) => void;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
inputStyle?: React.CSSProperties;
|
|
15
|
+
inputFocusStyle?: React.CSSProperties;
|
|
16
|
+
validate?: (value: string) => string;
|
|
17
|
+
autoSelect?: boolean;
|
|
18
|
+
regexCriteria?: any;
|
|
19
|
+
ariaLabel?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type PinInputProps = ReactPinInputProps & {
|
|
24
|
+
value?: string;
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
isNumberOnly?: boolean;
|
|
27
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { ProgressBar } from '.';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ProgressBar> = {
|
|
7
|
+
title: 'Components/ProgressBar',
|
|
8
|
+
component: ProgressBar,
|
|
9
|
+
args: {},
|
|
10
|
+
argTypes: {
|
|
11
|
+
value: { control: 'number' },
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryFn<typeof ProgressBar>;
|
|
17
|
+
|
|
18
|
+
export const Basic: Story = (args) => <ProgressBar {...args} />;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Progress as ChakraProgress } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
import { baseStyles } from './ProgressBar.styles';
|
|
4
|
+
import { ProgressBarProps } from './ProgressBar.types';
|
|
5
|
+
|
|
6
|
+
export const ProgressBar = ({
|
|
7
|
+
filledTrackColor,
|
|
8
|
+
value,
|
|
9
|
+
...rest
|
|
10
|
+
}: ProgressBarProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<ChakraProgress
|
|
13
|
+
sx={{
|
|
14
|
+
'& > div': {
|
|
15
|
+
backgroundColor: filledTrackColor ?? 'primary.main', // filledTrack
|
|
16
|
+
transition: 'width 0.3s ease-in-out',
|
|
17
|
+
},
|
|
18
|
+
bg: 'gray.200',
|
|
19
|
+
}}
|
|
20
|
+
value={value}
|
|
21
|
+
{...baseStyles}
|
|
22
|
+
{...rest}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
ProgressBar.displayName = 'ProgressBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressBar } from './ProgressBar';
|