crowui-pr 1.1.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/AGENTS.md +173 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/Accordion/AccordionGroup.d.ts +12 -0
- package/dist/Accordion/AccordionGroup.d.ts.map +1 -0
- package/dist/Accordion/AccordionItem.d.ts +22 -0
- package/dist/Accordion/AccordionItem.d.ts.map +1 -0
- package/dist/Accordion/context.d.ts +8 -0
- package/dist/Accordion/context.d.ts.map +1 -0
- package/dist/Accordion/index.cjs +1 -0
- package/dist/Accordion/index.d.ts +3 -0
- package/dist/Accordion/index.d.ts.map +1 -0
- package/dist/Accordion/index.mjs +6 -0
- package/dist/AccordionItem-BIMhzGxk.js +107 -0
- package/dist/AccordionItem-DrV8fI-p.cjs +1 -0
- package/dist/Alert/index.cjs +1 -0
- package/dist/Alert/index.d.ts +28 -0
- package/dist/Alert/index.d.ts.map +1 -0
- package/dist/Alert/index.mjs +166 -0
- package/dist/Alert/variants.d.ts +14 -0
- package/dist/Alert/variants.d.ts.map +1 -0
- package/dist/Avatar/Group.d.ts +6 -0
- package/dist/Avatar/Group.d.ts.map +1 -0
- package/dist/Avatar/index.cjs +1 -0
- package/dist/Avatar/index.d.ts +8 -0
- package/dist/Avatar/index.d.ts.map +1 -0
- package/dist/Avatar/index.mjs +139 -0
- package/dist/Avatar/types.d.ts +32 -0
- package/dist/Avatar/types.d.ts.map +1 -0
- package/dist/Avatar/variants.d.ts +7 -0
- package/dist/Avatar/variants.d.ts.map +1 -0
- package/dist/Badge/index.cjs +1 -0
- package/dist/Badge/index.d.ts +31 -0
- package/dist/Badge/index.d.ts.map +1 -0
- package/dist/Badge/index.mjs +74 -0
- package/dist/Banner/index.cjs +1 -0
- package/dist/Banner/index.d.ts +5 -0
- package/dist/Banner/index.d.ts.map +1 -0
- package/dist/Banner/index.mjs +140 -0
- package/dist/Banner/types.d.ts +26 -0
- package/dist/Banner/types.d.ts.map +1 -0
- package/dist/Banner/variants.d.ts +12 -0
- package/dist/Banner/variants.d.ts.map +1 -0
- package/dist/Breadcrumb/index.cjs +1 -0
- package/dist/Breadcrumb/index.d.ts +5 -0
- package/dist/Breadcrumb/index.d.ts.map +1 -0
- package/dist/Breadcrumb/index.mjs +35 -0
- package/dist/Breadcrumb/types.d.ts +24 -0
- package/dist/Breadcrumb/types.d.ts.map +1 -0
- package/dist/Button/index.cjs +1 -0
- package/dist/Button/index.d.ts +24 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/Button/index.mjs +140 -0
- package/dist/Button/variants.d.ts +5 -0
- package/dist/Button/variants.d.ts.map +1 -0
- package/dist/Card/Header.d.ts +5 -0
- package/dist/Card/Header.d.ts.map +1 -0
- package/dist/Card/constants.d.ts +6 -0
- package/dist/Card/constants.d.ts.map +1 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.d.ts +6 -0
- package/dist/Card/index.d.ts.map +1 -0
- package/dist/Card/index.mjs +78 -0
- package/dist/Card/types.d.ts +38 -0
- package/dist/Card/types.d.ts.map +1 -0
- package/dist/Carousel/constants.d.ts +3 -0
- package/dist/Carousel/constants.d.ts.map +1 -0
- package/dist/Carousel/index.cjs +1 -0
- package/dist/Carousel/index.d.ts +5 -0
- package/dist/Carousel/index.d.ts.map +1 -0
- package/dist/Carousel/index.mjs +126 -0
- package/dist/Carousel/types.d.ts +30 -0
- package/dist/Carousel/types.d.ts.map +1 -0
- package/dist/Chip/index.cjs +1 -0
- package/dist/Chip/index.d.ts +31 -0
- package/dist/Chip/index.d.ts.map +1 -0
- package/dist/Chip/index.mjs +149 -0
- package/dist/Collapse/index.cjs +1 -0
- package/dist/Collapse/index.d.ts +5 -0
- package/dist/Collapse/index.d.ts.map +1 -0
- package/dist/Collapse/index.mjs +74 -0
- package/dist/Collapse/types.d.ts +22 -0
- package/dist/Collapse/types.d.ts.map +1 -0
- package/dist/CommandPalette/constants.d.ts +6 -0
- package/dist/CommandPalette/constants.d.ts.map +1 -0
- package/dist/CommandPalette/index.cjs +1 -0
- package/dist/CommandPalette/index.d.ts +6 -0
- package/dist/CommandPalette/index.d.ts.map +1 -0
- package/dist/CommandPalette/index.mjs +216 -0
- package/dist/CommandPalette/types.d.ts +44 -0
- package/dist/CommandPalette/types.d.ts.map +1 -0
- package/dist/CommandPalette/variants.d.ts +4 -0
- package/dist/CommandPalette/variants.d.ts.map +1 -0
- package/dist/DateAndTimePickerFooter-Cf1P9EiU.js +74 -0
- package/dist/DateAndTimePickerFooter-qv4keBrK.cjs +1 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.d.ts +15 -0
- package/dist/Divider/index.d.ts.map +1 -0
- package/dist/Divider/index.mjs +38 -0
- package/dist/Drawer/index.cjs +1 -0
- package/dist/Drawer/index.d.ts +52 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.mjs +200 -0
- package/dist/EmptyState/index.cjs +1 -0
- package/dist/EmptyState/index.d.ts +6 -0
- package/dist/EmptyState/index.d.ts.map +1 -0
- package/dist/EmptyState/index.mjs +84 -0
- package/dist/EmptyState/types.d.ts +16 -0
- package/dist/EmptyState/types.d.ts.map +1 -0
- package/dist/EmptyState/variants.d.ts +8 -0
- package/dist/EmptyState/variants.d.ts.map +1 -0
- package/dist/FieldBottomInfo-C0Di4WWj.cjs +1 -0
- package/dist/FieldBottomInfo-CA_chf0O.js +76 -0
- package/dist/Form/Checkbox/index.cjs +1 -0
- package/dist/Form/Checkbox/index.d.ts +8 -0
- package/dist/Form/Checkbox/index.d.ts.map +1 -0
- package/dist/Form/Checkbox/index.mjs +57 -0
- package/dist/Form/Common/DateAndTimePickerFooter/DateAndTimePickerFooter.d.ts +10 -0
- package/dist/Form/Common/DateAndTimePickerFooter/DateAndTimePickerFooter.d.ts.map +1 -0
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts +11 -0
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts.map +1 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts +14 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts.map +1 -0
- package/dist/Form/Datepicker/Body.d.ts +4 -0
- package/dist/Form/Datepicker/Body.d.ts.map +1 -0
- package/dist/Form/Datepicker/Days.d.ts +4 -0
- package/dist/Form/Datepicker/Days.d.ts.map +1 -0
- package/dist/Form/Datepicker/Footer.d.ts +4 -0
- package/dist/Form/Datepicker/Footer.d.ts.map +1 -0
- package/dist/Form/Datepicker/Header.d.ts +4 -0
- package/dist/Form/Datepicker/Header.d.ts.map +1 -0
- package/dist/Form/Datepicker/Months.d.ts +4 -0
- package/dist/Form/Datepicker/Months.d.ts.map +1 -0
- package/dist/Form/Datepicker/Years.d.ts +4 -0
- package/dist/Form/Datepicker/Years.d.ts.map +1 -0
- package/dist/Form/Datepicker/context.d.ts +5 -0
- package/dist/Form/Datepicker/context.d.ts.map +1 -0
- package/dist/Form/Datepicker/index.cjs +1 -0
- package/dist/Form/Datepicker/index.d.ts +5 -0
- package/dist/Form/Datepicker/index.d.ts.map +1 -0
- package/dist/Form/Datepicker/index.mjs +1895 -0
- package/dist/Form/Datepicker/types.d.ts +80 -0
- package/dist/Form/Datepicker/types.d.ts.map +1 -0
- package/dist/Form/Datepicker/utils.d.ts +10 -0
- package/dist/Form/Datepicker/utils.d.ts.map +1 -0
- package/dist/Form/FileUploader/Input/FileInput.d.ts +8 -0
- package/dist/Form/FileUploader/Input/FileInput.d.ts.map +1 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts +4 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts +11 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/SingleMode/PreviewTitle.d.ts +14 -0
- package/dist/Form/FileUploader/Preview/SingleMode/PreviewTitle.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/types.d.ts +5 -0
- package/dist/Form/FileUploader/Preview/types.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts +4 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts.map +1 -0
- package/dist/Form/FileUploader/constants.d.ts +14 -0
- package/dist/Form/FileUploader/constants.d.ts.map +1 -0
- package/dist/Form/FileUploader/index.cjs +1 -0
- package/dist/Form/FileUploader/index.d.ts +6 -0
- package/dist/Form/FileUploader/index.d.ts.map +1 -0
- package/dist/Form/FileUploader/index.mjs +687 -0
- package/dist/Form/FileUploader/types.d.ts +61 -0
- package/dist/Form/FileUploader/types.d.ts.map +1 -0
- package/dist/Form/Input/index.cjs +1 -0
- package/dist/Form/Input/index.d.ts +21 -0
- package/dist/Form/Input/index.d.ts.map +1 -0
- package/dist/Form/Input/index.mjs +10 -0
- package/dist/Form/OtpInput/index.cjs +1 -0
- package/dist/Form/OtpInput/index.d.ts +19 -0
- package/dist/Form/OtpInput/index.d.ts.map +1 -0
- package/dist/Form/OtpInput/index.mjs +97 -0
- package/dist/Form/RadioButton/index.cjs +1 -0
- package/dist/Form/RadioButton/index.d.ts +6 -0
- package/dist/Form/RadioButton/index.d.ts.map +1 -0
- package/dist/Form/RadioButton/index.mjs +27 -0
- package/dist/Form/RangeInput/Thumb.d.ts +11 -0
- package/dist/Form/RangeInput/Thumb.d.ts.map +1 -0
- package/dist/Form/RangeInput/constants.d.ts +11 -0
- package/dist/Form/RangeInput/constants.d.ts.map +1 -0
- package/dist/Form/RangeInput/index.cjs +1 -0
- package/dist/Form/RangeInput/index.d.ts +5 -0
- package/dist/Form/RangeInput/index.d.ts.map +1 -0
- package/dist/Form/RangeInput/index.mjs +246 -0
- package/dist/Form/RangeInput/types.d.ts +32 -0
- package/dist/Form/RangeInput/types.d.ts.map +1 -0
- package/dist/Form/Select/OptionItem.d.ts +9 -0
- package/dist/Form/Select/OptionItem.d.ts.map +1 -0
- package/dist/Form/Select/Options.d.ts +4 -0
- package/dist/Form/Select/Options.d.ts.map +1 -0
- package/dist/Form/Select/index.cjs +1 -0
- package/dist/Form/Select/index.d.ts +4 -0
- package/dist/Form/Select/index.d.ts.map +1 -0
- package/dist/Form/Select/index.mjs +234 -0
- package/dist/Form/Select/types.d.ts +46 -0
- package/dist/Form/Select/types.d.ts.map +1 -0
- package/dist/Form/Switch/index.cjs +1 -0
- package/dist/Form/Switch/index.d.ts +24 -0
- package/dist/Form/Switch/index.d.ts.map +1 -0
- package/dist/Form/Switch/index.mjs +85 -0
- package/dist/Form/Textarea/index.cjs +1 -0
- package/dist/Form/Textarea/index.d.ts +8 -0
- package/dist/Form/Textarea/index.d.ts.map +1 -0
- package/dist/Form/Textarea/index.mjs +36 -0
- package/dist/Form/Timepicker/Body.d.ts +4 -0
- package/dist/Form/Timepicker/Body.d.ts.map +1 -0
- package/dist/Form/Timepicker/Footer.d.ts +4 -0
- package/dist/Form/Timepicker/Footer.d.ts.map +1 -0
- package/dist/Form/Timepicker/GradientOverlay.d.ts +7 -0
- package/dist/Form/Timepicker/GradientOverlay.d.ts.map +1 -0
- package/dist/Form/Timepicker/ScrollWheel.d.ts +5 -0
- package/dist/Form/Timepicker/ScrollWheel.d.ts.map +1 -0
- package/dist/Form/Timepicker/TimeInput.d.ts +10 -0
- package/dist/Form/Timepicker/TimeInput.d.ts.map +1 -0
- package/dist/Form/Timepicker/TimeInputs.d.ts +5 -0
- package/dist/Form/Timepicker/TimeInputs.d.ts.map +1 -0
- package/dist/Form/Timepicker/TimeScrollWheels.d.ts +5 -0
- package/dist/Form/Timepicker/TimeScrollWheels.d.ts.map +1 -0
- package/dist/Form/Timepicker/constants.d.ts +2 -0
- package/dist/Form/Timepicker/constants.d.ts.map +1 -0
- package/dist/Form/Timepicker/context.d.ts +12 -0
- package/dist/Form/Timepicker/context.d.ts.map +1 -0
- package/dist/Form/Timepicker/hooks/useCaret.d.ts +5 -0
- package/dist/Form/Timepicker/hooks/useCaret.d.ts.map +1 -0
- package/dist/Form/Timepicker/hooks/useScrollWheel.d.ts +5 -0
- package/dist/Form/Timepicker/hooks/useScrollWheel.d.ts.map +1 -0
- package/dist/Form/Timepicker/index.cjs +1 -0
- package/dist/Form/Timepicker/index.d.ts +5 -0
- package/dist/Form/Timepicker/index.d.ts.map +1 -0
- package/dist/Form/Timepicker/index.mjs +369 -0
- package/dist/Form/Timepicker/types.d.ts +49 -0
- package/dist/Form/Timepicker/types.d.ts.map +1 -0
- package/dist/Form/Timepicker/utils.d.ts +10 -0
- package/dist/Form/Timepicker/utils.d.ts.map +1 -0
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts +5 -0
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts.map +1 -0
- package/dist/Form/Wrappers/PickerWrapper/contexts.d.ts +7 -0
- package/dist/Form/Wrappers/PickerWrapper/contexts.d.ts.map +1 -0
- package/dist/Form/Wrappers/PickerWrapper/type.d.ts +42 -0
- package/dist/Form/Wrappers/PickerWrapper/type.d.ts.map +1 -0
- package/dist/Form/Wrappers/RadioCheckboxWrapper/RadioCheckboxWrapper.d.ts +34 -0
- package/dist/Form/Wrappers/RadioCheckboxWrapper/RadioCheckboxWrapper.d.ts.map +1 -0
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts +29 -0
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -0
- package/dist/Form/types/DateAndTimePicker.d.ts +26 -0
- package/dist/Form/types/DateAndTimePicker.d.ts.map +1 -0
- package/dist/IconArrowDown2-7ddwV5IE.js +22 -0
- package/dist/IconArrowDown2-C1dLVveG.cjs +1 -0
- package/dist/IconArrowLeft2-CNA3H0xY.cjs +1 -0
- package/dist/IconArrowLeft2-cxcPyDqS.js +22 -0
- package/dist/IconArrowRight2-BoXg0Gkw.js +25 -0
- package/dist/IconArrowRight2-CF_bdH81.cjs +1 -0
- package/dist/IconCheckmark-DDfqVvnj.js +22 -0
- package/dist/IconCheckmark-e4F7_KcG.cjs +1 -0
- package/dist/IconCloseRemove-BPEWBqGA.js +22 -0
- package/dist/IconCloseRemove-DwCc4o3b.cjs +1 -0
- package/dist/IconEye-DATABBb3.js +31 -0
- package/dist/IconEye-sBk4Mro2.cjs +1 -0
- package/dist/IconInfoCircleBold-DnAAyuSP.cjs +1 -0
- package/dist/IconInfoCircleBold-GQlvRSek.js +62 -0
- package/dist/IconSearch-BeVs-gUu.cjs +1 -0
- package/dist/IconSearch-aShj2vmu.js +25 -0
- package/dist/List/ListItem.d.ts +5 -0
- package/dist/List/ListItem.d.ts.map +1 -0
- package/dist/List/index.cjs +1 -0
- package/dist/List/index.d.ts +11 -0
- package/dist/List/index.d.ts.map +1 -0
- package/dist/List/index.mjs +81 -0
- package/dist/List/types.d.ts +28 -0
- package/dist/List/types.d.ts.map +1 -0
- package/dist/List/variants.d.ts +8 -0
- package/dist/List/variants.d.ts.map +1 -0
- package/dist/Menu/MenuItem.d.ts +5 -0
- package/dist/Menu/MenuItem.d.ts.map +1 -0
- package/dist/Menu/constants.d.ts +5 -0
- package/dist/Menu/constants.d.ts.map +1 -0
- package/dist/Menu/context.d.ts +4 -0
- package/dist/Menu/context.d.ts.map +1 -0
- package/dist/Menu/index.cjs +1 -0
- package/dist/Menu/index.d.ts +10 -0
- package/dist/Menu/index.d.ts.map +1 -0
- package/dist/Menu/index.mjs +138 -0
- package/dist/Menu/types.d.ts +45 -0
- package/dist/Menu/types.d.ts.map +1 -0
- package/dist/Menu/variants.d.ts +5 -0
- package/dist/Menu/variants.d.ts.map +1 -0
- package/dist/Modal/index.cjs +1 -0
- package/dist/Modal/index.d.ts +25 -0
- package/dist/Modal/index.d.ts.map +1 -0
- package/dist/Modal/index.mjs +63 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.d.ts +21 -0
- package/dist/Pagination/index.d.ts.map +1 -0
- package/dist/Pagination/index.mjs +107 -0
- package/dist/Pagination/utils.d.ts +8 -0
- package/dist/Pagination/utils.d.ts.map +1 -0
- package/dist/PickerWrapper-B14f_Y-E.cjs +1 -0
- package/dist/PickerWrapper-BUpw1NG2.js +133 -0
- package/dist/Popconfirm/constants.d.ts +5 -0
- package/dist/Popconfirm/constants.d.ts.map +1 -0
- package/dist/Popconfirm/index.cjs +1 -0
- package/dist/Popconfirm/index.d.ts +6 -0
- package/dist/Popconfirm/index.d.ts.map +1 -0
- package/dist/Popconfirm/index.mjs +130 -0
- package/dist/Popconfirm/types.d.ts +29 -0
- package/dist/Popconfirm/types.d.ts.map +1 -0
- package/dist/Progress/Bar/index.cjs +1 -0
- package/dist/Progress/Bar/index.d.ts +24 -0
- package/dist/Progress/Bar/index.d.ts.map +1 -0
- package/dist/Progress/Bar/index.mjs +89 -0
- package/dist/Progress/Doughnut/index.cjs +1 -0
- package/dist/Progress/Doughnut/index.d.ts +5 -0
- package/dist/Progress/Doughnut/index.d.ts.map +1 -0
- package/dist/Progress/Doughnut/index.mjs +86 -0
- package/dist/Progress/Doughnut/types.d.ts +21 -0
- package/dist/Progress/Doughnut/types.d.ts.map +1 -0
- package/dist/RadioCheckboxWrapper-BBzu2Ip6.cjs +1 -0
- package/dist/RadioCheckboxWrapper-BvSgv_ra.js +67 -0
- package/dist/Rate/RateStar.d.ts +10 -0
- package/dist/Rate/RateStar.d.ts.map +1 -0
- package/dist/Rate/index.cjs +1 -0
- package/dist/Rate/index.d.ts +6 -0
- package/dist/Rate/index.d.ts.map +1 -0
- package/dist/Rate/index.mjs +159 -0
- package/dist/Rate/types.d.ts +25 -0
- package/dist/Rate/types.d.ts.map +1 -0
- package/dist/SegmentedControl/index.cjs +1 -0
- package/dist/SegmentedControl/index.d.ts +6 -0
- package/dist/SegmentedControl/index.d.ts.map +1 -0
- package/dist/SegmentedControl/index.mjs +132 -0
- package/dist/SegmentedControl/types.d.ts +34 -0
- package/dist/SegmentedControl/types.d.ts.map +1 -0
- package/dist/SegmentedControl/variants.d.ts +7 -0
- package/dist/SegmentedControl/variants.d.ts.map +1 -0
- package/dist/Sidebar/Items.d.ts +4 -0
- package/dist/Sidebar/Items.d.ts.map +1 -0
- package/dist/Sidebar/LogoImage.d.ts +4 -0
- package/dist/Sidebar/LogoImage.d.ts.map +1 -0
- package/dist/Sidebar/Profile.d.ts +3 -0
- package/dist/Sidebar/Profile.d.ts.map +1 -0
- package/dist/Sidebar/SearchInput.d.ts +8 -0
- package/dist/Sidebar/SearchInput.d.ts.map +1 -0
- package/dist/Sidebar/ToggleButton.d.ts +4 -0
- package/dist/Sidebar/ToggleButton.d.ts.map +1 -0
- package/dist/Sidebar/constants.d.ts +6 -0
- package/dist/Sidebar/constants.d.ts.map +1 -0
- package/dist/Sidebar/context.d.ts +4 -0
- package/dist/Sidebar/context.d.ts.map +1 -0
- package/dist/Sidebar/index.cjs +1 -0
- package/dist/Sidebar/index.d.ts +6 -0
- package/dist/Sidebar/index.d.ts.map +1 -0
- package/dist/Sidebar/index.mjs +408 -0
- package/dist/Sidebar/types.d.ts +78 -0
- package/dist/Sidebar/types.d.ts.map +1 -0
- package/dist/Sidebar/utils.d.ts +7 -0
- package/dist/Sidebar/utils.d.ts.map +1 -0
- package/dist/Sidebar/variants.d.ts +7 -0
- package/dist/Sidebar/variants.d.ts.map +1 -0
- package/dist/Skeleton/index.cjs +1 -0
- package/dist/Skeleton/index.d.ts +19 -0
- package/dist/Skeleton/index.d.ts.map +1 -0
- package/dist/Skeleton/index.mjs +107 -0
- package/dist/Skeleton/types.d.ts +13 -0
- package/dist/Skeleton/types.d.ts.map +1 -0
- package/dist/Slide-Df71VSzW.js +341 -0
- package/dist/Slide-idFbYC5G.cjs +1 -0
- package/dist/Slider/Navigation.d.ts +9 -0
- package/dist/Slider/Navigation.d.ts.map +1 -0
- package/dist/Slider/NavigationDot.d.ts +9 -0
- package/dist/Slider/NavigationDot.d.ts.map +1 -0
- package/dist/Slider/Slide.d.ts +4 -0
- package/dist/Slider/Slide.d.ts.map +1 -0
- package/dist/Slider/Slider.d.ts +6 -0
- package/dist/Slider/Slider.d.ts.map +1 -0
- package/dist/Slider/context.d.ts +9 -0
- package/dist/Slider/context.d.ts.map +1 -0
- package/dist/Slider/index.cjs +1 -0
- package/dist/Slider/index.d.ts +4 -0
- package/dist/Slider/index.d.ts.map +1 -0
- package/dist/Slider/index.mjs +6 -0
- package/dist/Slider/types.d.ts +41 -0
- package/dist/Slider/types.d.ts.map +1 -0
- package/dist/Spinner/index.cjs +1 -0
- package/dist/Spinner/index.d.ts +6 -0
- package/dist/Spinner/index.d.ts.map +1 -0
- package/dist/Spinner/index.mjs +34 -0
- package/dist/Spinner/types.d.ts +11 -0
- package/dist/Spinner/types.d.ts.map +1 -0
- package/dist/Spinner/variants.d.ts +4 -0
- package/dist/Spinner/variants.d.ts.map +1 -0
- package/dist/Step-BMPrqeg4.cjs +1 -0
- package/dist/Step-BU0ICl05.js +157 -0
- package/dist/Stepper/Horizontal/Connector.d.ts +7 -0
- package/dist/Stepper/Horizontal/Connector.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/Step.d.ts +24 -0
- package/dist/Stepper/Horizontal/Step.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/StepIcon.d.ts +11 -0
- package/dist/Stepper/Horizontal/StepIcon.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/Stepper.d.ts +15 -0
- package/dist/Stepper/Horizontal/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/context.d.ts +10 -0
- package/dist/Stepper/Horizontal/context.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/index.cjs +1 -0
- package/dist/Stepper/Horizontal/index.d.ts +3 -0
- package/dist/Stepper/Horizontal/index.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/index.mjs +6 -0
- package/dist/Stepper/Horizontal/type.d.ts +4 -0
- package/dist/Stepper/Horizontal/type.d.ts.map +1 -0
- package/dist/Stepper/Horizontal/utils.d.ts +4 -0
- package/dist/Stepper/Horizontal/utils.d.ts.map +1 -0
- package/dist/Table/Cell.d.ts +13 -0
- package/dist/Table/Cell.d.ts.map +1 -0
- package/dist/Table/Header.d.ts +7 -0
- package/dist/Table/Header.d.ts.map +1 -0
- package/dist/Table/TBody.d.ts +7 -0
- package/dist/Table/TBody.d.ts.map +1 -0
- package/dist/Table/TBodyEmpty.d.ts +4 -0
- package/dist/Table/TBodyEmpty.d.ts.map +1 -0
- package/dist/Table/TBodyLoading.d.ts +4 -0
- package/dist/Table/TBodyLoading.d.ts.map +1 -0
- package/dist/Table/THead.d.ts +7 -0
- package/dist/Table/THead.d.ts.map +1 -0
- package/dist/Table/context.d.ts +13 -0
- package/dist/Table/context.d.ts.map +1 -0
- package/dist/Table/index.cjs +1 -0
- package/dist/Table/index.d.ts +6 -0
- package/dist/Table/index.d.ts.map +1 -0
- package/dist/Table/index.mjs +762 -0
- package/dist/Table/types.d.ts +104 -0
- package/dist/Table/types.d.ts.map +1 -0
- package/dist/Table/utils.d.ts +10 -0
- package/dist/Table/utils.d.ts.map +1 -0
- package/dist/Tabs/index.cjs +1 -0
- package/dist/Tabs/index.d.ts +29 -0
- package/dist/Tabs/index.d.ts.map +1 -0
- package/dist/Tabs/index.mjs +232 -0
- package/dist/TextFieldWrapper-BAK1sN1p.cjs +1 -0
- package/dist/TextFieldWrapper-ClTnwpWK.js +112 -0
- package/dist/ThemeProvider/context.d.ts +4 -0
- package/dist/ThemeProvider/context.d.ts.map +1 -0
- package/dist/ThemeProvider/index.cjs +1 -0
- package/dist/ThemeProvider/index.d.ts +18 -0
- package/dist/ThemeProvider/index.d.ts.map +1 -0
- package/dist/ThemeProvider/index.mjs +70 -0
- package/dist/ThemeProvider/types.d.ts +24 -0
- package/dist/ThemeProvider/types.d.ts.map +1 -0
- package/dist/Toast/Toast.d.ts +8 -0
- package/dist/Toast/Toast.d.ts.map +1 -0
- package/dist/Toast/ToastContainer.d.ts +8 -0
- package/dist/Toast/ToastContainer.d.ts.map +1 -0
- package/dist/Toast/context.d.ts +10 -0
- package/dist/Toast/context.d.ts.map +1 -0
- package/dist/Toast/index.cjs +1 -0
- package/dist/Toast/index.d.ts +12 -0
- package/dist/Toast/index.d.ts.map +1 -0
- package/dist/Toast/index.mjs +122 -0
- package/dist/Toast/types.d.ts +16 -0
- package/dist/Toast/types.d.ts.map +1 -0
- package/dist/Tooltip/Content.d.ts +9 -0
- package/dist/Tooltip/Content.d.ts.map +1 -0
- package/dist/Tooltip/index.cjs +1 -0
- package/dist/Tooltip/index.d.ts +31 -0
- package/dist/Tooltip/index.d.ts.map +1 -0
- package/dist/Tooltip/index.mjs +169 -0
- package/dist/Tree/constants.d.ts +5 -0
- package/dist/Tree/constants.d.ts.map +1 -0
- package/dist/Tree/context.d.ts +7 -0
- package/dist/Tree/context.d.ts.map +1 -0
- package/dist/Tree/index.cjs +1 -0
- package/dist/Tree/index.d.ts +6 -0
- package/dist/Tree/index.d.ts.map +1 -0
- package/dist/Tree/index.mjs +108 -0
- package/dist/Tree/types.d.ts +40 -0
- package/dist/Tree/types.d.ts.map +1 -0
- package/dist/assets/styles.css +1 -0
- package/dist/clsx-C11secjj.cjs +1 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/debounce-COFLRSUi.js +14 -0
- package/dist/debounce-tddZRTF5.cjs +1 -0
- package/dist/focusTrap-Br2GlOg-.cjs +1 -0
- package/dist/focusTrap-ikiXakRP.js +18 -0
- package/dist/index-1uytR4Ez.js +174 -0
- package/dist/index-Djgl0aBZ.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +146 -0
- package/dist/isBrowser-Bczqv-hd.cjs +1 -0
- package/dist/isBrowser-Bkqg1t1y.js +6 -0
- package/dist/omitObjects-CtiYo0hv.cjs +1 -0
- package/dist/omitObjects-CxFrrlkX.js +9 -0
- package/dist/useFlipPosition-B1mqg_YA.js +129 -0
- package/dist/useFlipPosition-BfF6YXxl.cjs +1 -0
- package/dist/useOutsideClick-CpfAm3CM.js +18 -0
- package/dist/useOutsideClick-DGu3KM8Q.cjs +1 -0
- package/package.json +363 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# AGENTS.md — crow-ui
|
|
2
|
+
|
|
3
|
+
Reference for AI coding agents integrating `crow-ui` into a consumer project (not for agents working on the crow-ui repo itself — see `CLAUDE.md` for that).
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
`crow-ui` is a React + TypeScript component library styled with Tailwind CSS (scoped under a `crow:` prefix, so it never collides with your app's own Tailwind classes). Each component ships as its own bundle, importable from a per-component subpath.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install crow-ui
|
|
11
|
+
# or
|
|
12
|
+
yarn add crow-ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer dependencies: `react >=18.2.0`, `react-dom >=18.2.0`. Install those yourself if not already present.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
No Tailwind config, no separate CSS import, no extra build step. Each component's bundle pulls in its own scoped CSS as a side effect — just import the component:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import Button from 'crow-ui/Button';
|
|
23
|
+
|
|
24
|
+
<Button variant="primary">Click</Button>;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This works out of the box with Vite, webpack, Next.js, and CRA (any bundler that handles CSS-from-JS imports, which all of these do by default). There is no `crow-ui/dist/index.css` to import manually.
|
|
28
|
+
|
|
29
|
+
**Dark mode**: add a `.dark` class to any ancestor element (e.g. `<html class="dark">`). No JS required — every component reacts to it via CSS.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<ThemeProvider defaultMode="system">
|
|
33
|
+
<App />
|
|
34
|
+
</ThemeProvider>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`ThemeProvider` (`crow-ui/ThemeProvider`) is optional sugar over the same `.dark`-class mechanism: it adds system-preference detection, `localStorage` persistence, and a `useTheme()` hook.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
const { mode, setMode } = useTheme();
|
|
41
|
+
// mode: 'light' | 'dark' | 'system' (or resolved value depending on usage)
|
|
42
|
+
setMode('dark');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`ThemeProvider` props: `mode` (controlled), `defaultMode` (`'light' | 'dark' | 'system'`, default `'system'`), `onModeChange`, `brand` (sets `data-brand` attr for multi-brand token overrides), `storageKey` (default `'crow-theme-mode'`), `attachTo` (ref to target element, defaults to `document.documentElement`).
|
|
46
|
+
|
|
47
|
+
Caveat: to avoid a flash of the wrong theme on first paint, set the `.dark` class yourself (read from your own persisted storage) via an inline `<head>` script before React hydrates — `ThemeProvider` can't run early enough to prevent that flash on its own.
|
|
48
|
+
|
|
49
|
+
## Import patterns
|
|
50
|
+
|
|
51
|
+
Either the whole package, or per-component subpaths (preferred — keeps your bundle smaller):
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Button, Modal } from 'crow-ui';
|
|
55
|
+
// or
|
|
56
|
+
import Button from 'crow-ui/Button';
|
|
57
|
+
import Modal from 'crow-ui/Modal';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Subpath import maps 1:1 to the component's folder, including nested ones:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import Checkbox from 'crow-ui/Form/Checkbox';
|
|
64
|
+
import ProgressBar from 'crow-ui/Progress/Bar';
|
|
65
|
+
import { HorizontalStepper, HorizontalStep } from 'crow-ui/Stepper/Horizontal';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Do not import** `crow-ui/Form/Wrappers/*` or `crow-ui/Form/Common/*` — these are internal-only and blocked in the package's exports map.
|
|
69
|
+
|
|
70
|
+
Only components re-exported from the package root are public/stable. `Carousel`, `Collapse`, `List`, `SegmentedControl`, `Tree` exist in the repo but are not part of the published API — don't use them.
|
|
71
|
+
|
|
72
|
+
## Theming reference
|
|
73
|
+
|
|
74
|
+
Design tokens are CSS custom properties storing RGB triples, overridable in `:root` to rebrand without touching any component code:
|
|
75
|
+
|
|
76
|
+
```css
|
|
77
|
+
:root {
|
|
78
|
+
--crow-color-primary-500: 40 82 228; /* R G B */
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Pattern: `--crow-color-{semantic}-{shade}` where semantic is `primary`, `secondary`, `success`, `warning`, `error`, `gray`, `sky`, `violet`, `flamingo`, and shade runs `50`–`900`. Dark-mode overrides for the same variables live under `.dark` automatically — no consumer action needed unless you want to customize dark values too (override the same vars inside a `.dark { ... }` block in your own CSS).
|
|
83
|
+
|
|
84
|
+
## Hooks (exported from package root)
|
|
85
|
+
|
|
86
|
+
| Hook | Returns | Notes |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `useTheme()` | `{ mode, setMode, brand, setBrand }` | Only works inside a `<ThemeProvider>`. |
|
|
89
|
+
| `useToast()` | `{ toasts, add, remove, clear }` | Only works inside a `<ToastProvider>`. `add({ message, variant?, duration?, position? })` returns a toast id. |
|
|
90
|
+
| `useDebouncedCallback` | debounced function | General utility, no provider needed. |
|
|
91
|
+
| `usePopover` | `{ isOpen, toggle, close, ... }` | General utility, no provider needed. |
|
|
92
|
+
|
|
93
|
+
## Component reference
|
|
94
|
+
|
|
95
|
+
Minimal usage per component. For full prop tables and live examples, see the [Storybook docs site](https://arminshaikhy.github.io/crowui/).
|
|
96
|
+
|
|
97
|
+
### Layout
|
|
98
|
+
|
|
99
|
+
| Component | Import | Key props | Example |
|
|
100
|
+
|---|---|---|---|
|
|
101
|
+
| Card | `crow-ui/Card` | `header` ({title, icon, color, variant}), `color`, `size`, `shadow` | `<Card header={{ title: 'Title' }}>Content</Card>` |
|
|
102
|
+
| Divider | `crow-ui/Divider` | `type` (`'horizontal'\|'vertical'`), `size` (`'thin'\|'thick'`), `color`, `style` (`'solid'\|'dashed'\|'dotted'`) | `<Divider type="horizontal" />` |
|
|
103
|
+
| Sidebar | `crow-ui/Sidebar` | `isOpen`, `setIsOpen`, `items` (`FirstLevelSidebarItem[]`), `variant` (`'filled'\|'bordered'\|'ghost'`), `position` (`'left'\|'right'`) | `<Sidebar isOpen={open} setIsOpen={setOpen} items={items} />` |
|
|
104
|
+
| Breadcrumb | `crow-ui/Breadcrumb` | `pageTitle`, `items` (`BreadcrumbItem[]`: `title`, `link`/`onClick`, `icon`) | `<Breadcrumb pageTitle="Page" items={[{ title: 'Home', link: '/' }]} />` |
|
|
105
|
+
|
|
106
|
+
### Navigation & disclosure
|
|
107
|
+
|
|
108
|
+
| Component | Import | Key props | Example |
|
|
109
|
+
|---|---|---|---|
|
|
110
|
+
| Accordion | `crow-ui/Accordion` (`AccordionGroup`, `AccordionItem`) | `AccordionGroup` takes `disableAccordion`; `AccordionItem` takes `title` | `<AccordionGroup><AccordionItem title="Title">Content</AccordionItem></AccordionGroup>` |
|
|
111
|
+
| Menu | `crow-ui/Menu` | `trigger` (render prop: `(toggle, ref, isOpen) => node`), `position`, `panelVariant` (`'default'\|'minimal'`). Items via static `Menu.Item` | `<Menu trigger={(toggle, ref) => <button ref={ref} onClick={toggle}>Menu</button>}><Menu.Item onClick={fn}>Item</Menu.Item></Menu>` |
|
|
112
|
+
| Tabs | `crow-ui/Tabs` | `items` (`{key, title, icon?, badgeNumber?, disabled?}[]`), `activeKey`, `onChange`, `variant` (`'underline'\|'pills'\|'card'`), `orientation`, `fullWidth` | `<Tabs activeKey={key} onChange={setKey} items={items} />` |
|
|
113
|
+
| Stepper | `crow-ui/Stepper/Horizontal` (`HorizontalStepper`, `HorizontalStep`) | `activeStep`, `size` (`'small'\|'medium'`) | `<HorizontalStepper activeStep={1}><HorizontalStep title="Step 1" /></HorizontalStepper>` |
|
|
114
|
+
| Pagination | `crow-ui/Pagination` | `totalCount`, `pageSize`, `defaultCurrent`, `siblingCount` | `<Pagination totalCount={100} pageSize={8} />` |
|
|
115
|
+
|
|
116
|
+
### Feedback & display
|
|
117
|
+
|
|
118
|
+
| Component | Import | Key props | Example |
|
|
119
|
+
|---|---|---|---|
|
|
120
|
+
| Alert | `crow-ui/Alert` | `title`, `text`, `variant` (`'warning'\|'primary'\|'error'\|'success'\|'gray'`), `closable` | `<Alert title="Title" text="Message" variant="primary" closable />` |
|
|
121
|
+
| Badge | `crow-ui/Badge` | `value`, `valueType` (`'text'\|'number'`), `type` (`'twoTone'\|'solid'`), `color`, `size` | `<Badge value="Text" valueType="text" type="solid" color="primary" />` |
|
|
122
|
+
| Chip | `crow-ui/Chip` | `label`, `size` (`'xsmall'\|'small'\|'medium'\|'large'`), `color`, `clickable` | `<Chip label="Badge" size="small" color="primary" />` |
|
|
123
|
+
| ProgressBar | `crow-ui/Progress/Bar` | `current`, `total`, `title`, `color`, `size` (`'thin'\|'medium'\|'thick'`), `striped`, `animated` | `<ProgressBar current={50} total={100} color="primary" />` |
|
|
124
|
+
| ProgressDoughnut | `crow-ui/Progress/Doughnut` | `current`, `total`, `color`, `showText` | `<ProgressDoughnut current={1} total={5} />` |
|
|
125
|
+
| Rate | `crow-ui/Rate` | `value`, `total`, `size` (`'large'\|'small'`), `onChange` | `<Rate value={3} total={5} onChange={fn} />` |
|
|
126
|
+
| Skeleton | `crow-ui/Skeleton` (`Skeleton`, `SkeletonText`, `SkeletonAvatar`, `SkeletonCard`) | `variant` (`'block'\|'line'`), `width`, `height` | `<Skeleton variant="block" width={240} height={120} />` |
|
|
127
|
+
| Toast | `crow-ui/Toast` (`ToastProvider`, `useToast`) | Provider: `defaultPosition`, `defaultDuration`. Hook: `add({ message, variant? })` | `<ToastProvider><App /></ToastProvider>` then `useToast().add({ message: 'Saved' })` |
|
|
128
|
+
| Tooltip | `crow-ui/Tooltip` | `title`, `content`, `position`, `size`, `theme` (`'dark'\|'light'`), `children` (hover/trigger target) | `<Tooltip content="Help text"><span>Hover</span></Tooltip>` |
|
|
129
|
+
|
|
130
|
+
### Modal & Drawer
|
|
131
|
+
|
|
132
|
+
| Component | Import | Key props | Example |
|
|
133
|
+
|---|---|---|---|
|
|
134
|
+
| Drawer | `crow-ui/Drawer` | `open`, `onClose`, `header` ({title, description, haveCloseIcon, actionElement}), `footer`, `position` (`'bottom'\|'top'\|'right'\|'left'\|'center'`), `width`, `padding`, `persist` | `<Drawer open={open} onClose={fn} header={{ title: 'Title' }}>Content</Drawer>` |
|
|
135
|
+
| Modal | `crow-ui/Modal` | Same base as Drawer (minus `position`/`header`) plus `title`, `description`, `onConfirm`, `onCancel`, `confirmLabel`, `cancelLabel`, `confirmLoading` | `<Modal open={open} onClose={fn} title="Title" onConfirm={fn}>Content</Modal>` |
|
|
136
|
+
|
|
137
|
+
> **Note**: `Modal`'s default `confirmLabel`/`cancelLabel` are Persian (`'تایید'`/`'انصراف'`) — always pass your own `confirmLabel`/`cancelLabel` for non-Persian UIs.
|
|
138
|
+
|
|
139
|
+
### Form controls (`crow-ui/Form/*`)
|
|
140
|
+
|
|
141
|
+
All share a common pattern: `value`, `onChange`, plus error/label props (`isError`, `errorMessage`, `labelContent`, `hintMessage`) where applicable.
|
|
142
|
+
|
|
143
|
+
| Component | Import | Key props | Example |
|
|
144
|
+
|---|---|---|---|
|
|
145
|
+
| Input | `crow-ui/Form/Input` | `value`, `onChange`, `labelContent`, `isError`, `errorMessage`, `maxLength` | `<Input value={v} onChange={fn} labelContent="Name" />` |
|
|
146
|
+
| Textarea | `crow-ui/Form/Textarea` | same shape as Input | `<Textarea value={v} onChange={fn} labelContent="Notes" />` |
|
|
147
|
+
| Checkbox | `crow-ui/Form/Checkbox` | `checked`, `onChange`, `label`, `variant` (`'bordered'\|'default'`) | `<Checkbox checked={v} onChange={fn} label="Option" />` |
|
|
148
|
+
| RadioButton | `crow-ui/Form/RadioButton` | same shape as Checkbox | `<RadioButton checked={v} onChange={fn} label="Option" />` |
|
|
149
|
+
| Switch | `crow-ui/Form/Switch` | `checked`, `onChange`, `size`, `label`, `description` | `<Switch checked={v} onChange={fn} label="Toggle" />` |
|
|
150
|
+
| Select | `crow-ui/Form/Select` | `value`, `onChange`, `options` (`{value, label, disabled?}[]`), `mode` (`'single'\|'multiple'` — value/onChange shape changes accordingly), `searchable` | `<Select value={v} onChange={fn} options={opts} />` |
|
|
151
|
+
| Datepicker | `crow-ui/Form/Datepicker` | `value` (`Date \| null`, or `{start, end}` when `acceptRange`), `onChange`, `mode` (`'input'\|'calendar'`), `acceptRange`, `disableDates`, `holidays` | `<Datepicker value={date} onChange={fn} />` |
|
|
152
|
+
| Timepicker | `crow-ui/Form/Timepicker` | `value`, `onChange`, `acceptRange`, `mode` (`'input'\|'time'`), `minuteStep` | `<Timepicker value={time} onChange={fn} />` |
|
|
153
|
+
| OtpInput | `crow-ui/Form/OtpInput` | `value`, `onChange`, `onEnd`, `inputsNumber` | `<OtpInput value={v} onChange={fn} inputsNumber={4} />` |
|
|
154
|
+
| RangeInput | `crow-ui/Form/RangeInput` | `value`, `onChange`, `min`, `max`, `step`, `color` | `<RangeInput value={50} onChange={fn} min={0} max={100} />` |
|
|
155
|
+
| FileUploader | `crow-ui/Form/FileUploader` | `files`, `onChange`, `mode` (`'single'\|'multiple'`) | `<FileUploader files={file} onChange={fn} mode="single" />` |
|
|
156
|
+
|
|
157
|
+
### Data display
|
|
158
|
+
|
|
159
|
+
| Component | Import | Key props | Example |
|
|
160
|
+
|---|---|---|---|
|
|
161
|
+
| Table | `crow-ui/Table` | `data`, `columns` (`ColumnsType[]`: `key`/`dataIndex`, `title`, `render?`, `sort?`), `rowKey`, `pagination`, `rowSelection`, `loading` | `<Table data={rows} columns={cols} rowKey="id" />` |
|
|
162
|
+
| Slider | `crow-ui/Slider` (`Slider`, `Slide`) | `slidesPerView`, `spaceBetween`, `autoplay`, `showNavigationDots` | `<Slider slidesPerView={1}><Slide>Content</Slide></Slider>` |
|
|
163
|
+
|
|
164
|
+
### Button
|
|
165
|
+
|
|
166
|
+
| Component | Import | Key props | Example |
|
|
167
|
+
|---|---|---|---|
|
|
168
|
+
| Button | `crow-ui/Button` | `variant` (`'primary'\|'secondary'\|'outline'\|'text'\|'ghost'\|'link'`), `color`, `size` (`'small'\|'medium'\|'large'\|'xlarge'`), `leftIcon`, `rightIcon`, `disabled`, `as` (polymorphic) | `<Button variant="primary" size="medium">Click</Button>` |
|
|
169
|
+
|
|
170
|
+
## Links
|
|
171
|
+
|
|
172
|
+
- Storybook docs (full prop tables, live examples): https://arminshaikhy.github.io/crowui/
|
|
173
|
+
- Repo: https://github.com/ArminShaikhy/crowui
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ArminShaikhy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Crow UI
|
|
2
|
+
|
|
3
|
+
A modern, accessible, and customizable React component library built with TypeScript and Tailwind CSS. This UI Kit is designed to help you rapidly build consistent, scalable user interfaces across your web applications.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 📦 **Reusable React Components** – A growing set of fully styled and typed UI components.
|
|
8
|
+
- 🎨 **Customizable Design Tokens** – Easily override colors via CSS variables.
|
|
9
|
+
- 🧩 **Tree-shakable** – Import only what you need.
|
|
10
|
+
- ⚡ **Tailwind CSS Utility Classes** – Built-in styles with scoped, prefixed Tailwind utilities.
|
|
11
|
+
- 📚 **Storybook Documentation** – [Explore live components & usage](https://arminshaikhy.github.io/crowui/).
|
|
12
|
+
|
|
13
|
+
## 📦 Installation
|
|
14
|
+
|
|
15
|
+
Before using this library, make sure you have `react` installed in your project, as it's a peer dependency.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install crow-ui
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add crow-ui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> No need to set up Tailwind or any additional configuration. All styles are already bundled and scoped.
|
|
28
|
+
|
|
29
|
+
## 🚀 Getting Started
|
|
30
|
+
|
|
31
|
+
Visit the [documentation site](https://arminshaikhy.github.io/crowui/) to learn more about:
|
|
32
|
+
|
|
33
|
+
- How to use the components
|
|
34
|
+
- Customizing theme tokens like colors
|
|
35
|
+
- Contributing to the project
|
|
36
|
+
|
|
37
|
+
## 🧱 Project Structure
|
|
38
|
+
|
|
39
|
+
Each component lives in its own folder under the `src/components` directory.
|
|
40
|
+
|
|
41
|
+
- Every component must export from an `index.ts` or `index.tsx` file. Vite uses this to build each component individually.
|
|
42
|
+
- If a component exports multiple members (e.g., `Button`, `ButtonGroup`), use named exports in its `index` file.
|
|
43
|
+
- Each component must have a `ComponentName.stories.tsx` file to generate its documentation.
|
|
44
|
+
|
|
45
|
+
The root `index.ts` file serves as the main entry point for bundling the entire library and contains exports for all components.
|
|
46
|
+
|
|
47
|
+
## 🛠️ Contributing
|
|
48
|
+
|
|
49
|
+
We welcome contributions! See the [Contributing Guide](https://arminshaikhy.github.io/crowui/?path=/docs/getting-started-contributing--documentation) to learn how to get started.
|
|
50
|
+
|
|
51
|
+
## 📄 License
|
|
52
|
+
|
|
53
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
interface AccordionGroupProps {
|
|
3
|
+
/** Key(s) of the item(s) open on initial render. Pass an array only when `disableAccordion` is true. */
|
|
4
|
+
defaultActiveKey?: string | string[];
|
|
5
|
+
/** Extra class names on the accordion list container. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** When true, multiple items can be open simultaneously (accordion behavior disabled). @default false */
|
|
8
|
+
disableAccordion?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const AccordionGroup: FC<PropsWithChildren<AccordionGroupProps>>;
|
|
11
|
+
export default AccordionGroup;
|
|
12
|
+
//# sourceMappingURL=AccordionGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionGroup.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,UAAU,mBAAmB;IAC3B,wGAAwG;IACxG,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACrC,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yGAAyG;IACzG,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAcD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAkB9D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
interface AccordionItemProps {
|
|
3
|
+
/** Header content shown in the collapsed trigger row. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Unique key used to track open/closed state. Defaults to React's `useId` value. */
|
|
6
|
+
accordionKey?: string;
|
|
7
|
+
/** Extra class names on the item root. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Extra class names on the collapsible content area. */
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
/** Hides the separator line between items. @default false */
|
|
12
|
+
hideDivider?: boolean;
|
|
13
|
+
/** Hides the expand/collapse chevron icon. @default false */
|
|
14
|
+
hideArrow?: boolean;
|
|
15
|
+
/** Extra class names on the title row. */
|
|
16
|
+
titleClassName?: string;
|
|
17
|
+
/** Prevents this item from being opened. @default false */
|
|
18
|
+
disable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const AccordionItem: FC<PropsWithChildren<AccordionItemProps>>;
|
|
21
|
+
export default AccordionItem;
|
|
22
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,UAAU,kBAAkB;IAC1B,yDAAyD;IACzD,KAAK,EAAE,SAAS,CAAC;IACjB,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAuF5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface IAccordionContext {
|
|
2
|
+
activeKey: string | string[] | null;
|
|
3
|
+
setActiveKey: (key: IAccordionContext['activeKey']) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const accordionContext: import('react').Context<IAccordionContext>;
|
|
6
|
+
export declare const useAccordionContext: () => IAccordionContext;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/context.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,gBAAgB,4CAG3B,CAAC;AAEH,eAAO,MAAM,mBAAmB,yBAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../assets/styles.css');;/* empty css */const o=require("../AccordionItem-DrV8fI-p.cjs");exports.AccordionGroup=o.AccordionGroup;exports.AccordionItem=o.AccordionItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Accordion/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import { c as n } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
import { createContext as b, useContext as C, useState as D, useId as K } from "react";
|
|
5
|
+
import { I as j } from "./IconArrowDown2-7ddwV5IE.js";
|
|
6
|
+
import k from "./Divider/index.mjs";
|
|
7
|
+
const p = b({
|
|
8
|
+
activeKey: null,
|
|
9
|
+
setActiveKey: () => {
|
|
10
|
+
}
|
|
11
|
+
}), z = () => C(p);
|
|
12
|
+
function S(r, e = !1) {
|
|
13
|
+
if (!r) return e ? [] : null;
|
|
14
|
+
const t = Array.isArray(r);
|
|
15
|
+
return e ? t ? r : [r] : t ? r[0] : r;
|
|
16
|
+
}
|
|
17
|
+
const q = (r) => {
|
|
18
|
+
const { defaultActiveKey: e, className: t, children: l, disableAccordion: w } = r, [d, m] = D(
|
|
19
|
+
S(e, w)
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ o("div", { className: n("crow:flex crow:flex-col", t), children: /* @__PURE__ */ o(
|
|
22
|
+
p.Provider,
|
|
23
|
+
{
|
|
24
|
+
value: {
|
|
25
|
+
activeKey: d,
|
|
26
|
+
setActiveKey: m
|
|
27
|
+
},
|
|
28
|
+
children: l
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
}, B = (r) => {
|
|
32
|
+
const {
|
|
33
|
+
children: e,
|
|
34
|
+
title: t,
|
|
35
|
+
accordionKey: l,
|
|
36
|
+
className: w,
|
|
37
|
+
contentClassName: d,
|
|
38
|
+
hideDivider: m = !1,
|
|
39
|
+
hideArrow: x = !1,
|
|
40
|
+
titleClassName: v,
|
|
41
|
+
disable: u
|
|
42
|
+
} = r, { activeKey: s, setActiveKey: a } = z(), A = K(), c = l ?? A, f = Array.isArray(s);
|
|
43
|
+
function N() {
|
|
44
|
+
return u ? !1 : f ? s.includes(c) : c === s;
|
|
45
|
+
}
|
|
46
|
+
const i = N();
|
|
47
|
+
function g() {
|
|
48
|
+
a(i ? f ? s.filter((I) => I !== c) : null : f ? [...s, c] : c);
|
|
49
|
+
}
|
|
50
|
+
const h = `${c}-content`;
|
|
51
|
+
return /* @__PURE__ */ y("div", { className: n("crow:bg-surface crow:px-4 crow:pt-4", w), children: [
|
|
52
|
+
/* @__PURE__ */ y(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
className: n(
|
|
56
|
+
"crow:flex crow:justify-between crow:items-center crow:w-full",
|
|
57
|
+
i ? "crow:text-primary-500" : "crow:text-gray-600",
|
|
58
|
+
v
|
|
59
|
+
),
|
|
60
|
+
onClick: g,
|
|
61
|
+
disabled: u,
|
|
62
|
+
"aria-expanded": i,
|
|
63
|
+
"aria-controls": h,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ o("div", { className: i ? "crow:font-h5-bold" : "crow:font-p1-medium", children: t }),
|
|
66
|
+
!x && /* @__PURE__ */ o(
|
|
67
|
+
j,
|
|
68
|
+
{
|
|
69
|
+
className: n(
|
|
70
|
+
"crow:transition-transform crow:duration-300 crow:shrink-0 crow:w-auto crow:h-auto",
|
|
71
|
+
i && "crow:rotate-180"
|
|
72
|
+
),
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
width: 20,
|
|
75
|
+
height: 20
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ o(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
id: h,
|
|
85
|
+
role: "region",
|
|
86
|
+
className: n(
|
|
87
|
+
"crow:grid crow:font-p1-regular crow:text-gray-600 crow:overflow-hidden crow:transition-all crow:duration-300 crow:ease-in-out",
|
|
88
|
+
i ? "crow:grid-rows-[1fr] crow:opacity-100 crow:mt-3" : "crow:grid-rows-[0fr] crow:opacity-0",
|
|
89
|
+
d
|
|
90
|
+
),
|
|
91
|
+
children: /* @__PURE__ */ o("div", { className: "crow:overflow-hidden", children: e })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
!m && /* @__PURE__ */ o(
|
|
95
|
+
k,
|
|
96
|
+
{
|
|
97
|
+
type: "horizontal",
|
|
98
|
+
color: "white",
|
|
99
|
+
className: "crow:mt-4"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] });
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
q as A,
|
|
106
|
+
B as a
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const e=require("react/jsx-runtime"),n=require("./clsx-C11secjj.cjs"),l=require("react"),p=require("./IconArrowDown2-C1dLVveG.cjs"),b=require("./Divider/index.cjs"),y=l.createContext({activeKey:null,setActiveKey:()=>{}}),C=()=>l.useContext(y);function D(r,o=!1){if(!r)return o?[]:null;const c=Array.isArray(r);return o?c?r:[r]:c?r[0]:r}const q=r=>{const{defaultActiveKey:o,className:c,children:w,disableAccordion:d}=r,[u,x]=l.useState(D(o,d));return e.jsx("div",{className:n.clsx("crow:flex crow:flex-col",c),children:e.jsx(y.Provider,{value:{activeKey:u,setActiveKey:x},children:w})})},K=r=>{const{children:o,title:c,accordionKey:w,className:d,contentClassName:u,hideDivider:x=!1,hideArrow:v=!1,titleClassName:A,disable:m}=r,{activeKey:i,setActiveKey:a}=C(),I=l.useId(),t=w??I,f=Array.isArray(i);function N(){return m?!1:f?i.includes(t):t===i}const s=N();function g(){a(s?f?i.filter(j=>j!==t):null:f?[...i,t]:t)}const h=`${t}-content`;return e.jsxs("div",{className:n.clsx("crow:bg-surface crow:px-4 crow:pt-4",d),children:[e.jsxs("button",{className:n.clsx("crow:flex crow:justify-between crow:items-center crow:w-full",s?"crow:text-primary-500":"crow:text-gray-600",A),onClick:g,disabled:m,"aria-expanded":s,"aria-controls":h,children:[e.jsx("div",{className:s?"crow:font-h5-bold":"crow:font-p1-medium",children:c}),!v&&e.jsx(p.IconArrowDown2,{className:n.clsx("crow:transition-transform crow:duration-300 crow:shrink-0 crow:w-auto crow:h-auto",s&&"crow:rotate-180"),"aria-hidden":"true",width:20,height:20})]}),e.jsx("div",{id:h,role:"region",className:n.clsx("crow:grid crow:font-p1-regular crow:text-gray-600 crow:overflow-hidden crow:transition-all crow:duration-300 crow:ease-in-out",s?"crow:grid-rows-[1fr] crow:opacity-100 crow:mt-3":"crow:grid-rows-[0fr] crow:opacity-0",u),children:e.jsx("div",{className:"crow:overflow-hidden",children:o})}),!x&&e.jsx(b,{type:"horizontal",color:"white",className:"crow:mt-4"})]})};exports.AccordionGroup=q;exports.AccordionItem=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";require('../assets/styles.css');const o=require("react/jsx-runtime"),t=require("../clsx-C11secjj.cjs"),h=require("react"),i=require("../IconInfoCircleBold-DnAAyuSP.cjs"),b=require("../IconCloseRemove-DwCc4o3b.cjs"),x=require("../Button/index.cjs");;/* empty css */const l={container:{warning:"crow:bg-warning-50 crow:border-warning-200",primary:"crow:bg-primary-50 crow:border-primary-100",error:"crow:bg-error-50 crow:border-error-200",success:"crow:bg-success-50 crow:border-success-200",gray:"crow:bg-gray-50 crow:border-gray-200"},icon:{warning:"crow:text-warning-700",primary:"crow:text-primary-400",error:"crow:text-error-600",success:"crow:text-success-600",gray:"crow:text-gray-600"},title:{warning:"crow:text-warning-800",primary:"crow:text-primary-700",error:"crow:text-error-700",success:"crow:text-success-800",gray:"crow:text-gray-800"},close:{warning:"crow:text-warning-800",primary:"crow:text-primary-600",error:"crow:text-error-600",success:"crow:text-success-800",gray:"crow:text-gray-800"},text:{warning:"crow:text-warning-800",primary:"crow:text-primary-600",error:"crow:text-error-600",success:"crow:text-success-800",gray:"crow:text-gray-700"}},c={container:{large:"crow:p-4",small:"crow:p-3"},icon:{large:24,small:20},title:{large:"crow:font-h5-bold mb-2",small:"crow:font-h6-bold mb-1"},close:{large:20,small:20},text:{large:"crow:font-p2-regular",small:"crow:font-p3-regular"}};function f(s,e){let r=i.IconInfoCircleBold;return s==="error"?r=i.IconDangerBold:s==="success"&&(r=i.IconCheckCircleBold),o.jsx(r,{className:t.clsx("crow:shrink-0 crow:my-[2px]",l.icon[s]),width:c.icon[e],height:c.icon[e]})}const B=s=>{const{variant:e="primary",size:r="small",title:w,text:m,primaryButton:n,outlineButton:a,closable:g,showTitleIcon:u=!0,className:d}=s,[y,p]=h.useState(!0);return y?o.jsxs("div",{className:t.clsx("crow:w-full crow:flex crow:gap-x-3 crow:rounded-xl crow:border crow:border-solid",l.container[e],c.container[r],d),children:[u&&f(e,r),o.jsxs("div",{className:"crow:flex crow:flex-col crow:flex-1",children:[!!w&&o.jsx("div",{className:t.clsx(l.title[e],c.title[r]),children:w}),o.jsx("p",{className:t.clsx(l.text[e],c.text[r]),children:m}),(!!n?.text||!!a?.text)&&o.jsxs("div",{className:t.clsx("crow:flex crow:gap-x-2 crow:items-center",r==="large"?"crow:mt-4":"crow:mt-3"),children:[!!n?.text&&o.jsx(x,{variant:"primary",color:e,size:"small",...n,children:n?.text}),!!a?.text&&o.jsx(x,{variant:"outline",color:e,size:"small",...a,children:a?.text})]})]}),g&&o.jsx("button",{className:"crow:shrink-0 crow:my-[2px] crow:h-fit",onClick:()=>p(!1),children:o.jsx(b.IconCloseRemove,{className:t.clsx(l.close[e]),width:c.close[r],height:c.close[r]})})]}):null};module.exports=B;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
|
+
interface AlertButtonProps extends Omit<ButtonProps, 'variant' | 'color' | 'size' | 'children'> {
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AlertProps {
|
|
7
|
+
/** Visual severity style. @default 'primary' */
|
|
8
|
+
variant?: 'warning' | 'primary' | 'error' | 'success' | 'gray';
|
|
9
|
+
/** Controls padding and font size. @default 'small' */
|
|
10
|
+
size?: 'large' | 'small';
|
|
11
|
+
/** Bold heading rendered above `text`. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Main alert body content (required). */
|
|
14
|
+
text: ReactNode;
|
|
15
|
+
/** Primary (filled) action button. Omit to hide. */
|
|
16
|
+
primaryButton?: AlertButtonProps;
|
|
17
|
+
/** Secondary (outline) action button. Omit to hide. */
|
|
18
|
+
outlineButton?: AlertButtonProps;
|
|
19
|
+
/** Renders a dismiss (✕) button. @default false */
|
|
20
|
+
closable?: boolean;
|
|
21
|
+
/** Shows the leading status icon beside the title. @default true */
|
|
22
|
+
showTitleIcon?: boolean;
|
|
23
|
+
/** Extra class names on the root element. */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const Alert: (props: AlertProps) => import("react").JSX.Element | null;
|
|
27
|
+
export default Alert;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Alert/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjD,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,kBAAkB,CAAC;AAE1B,UAAU,gBAAiB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;IAC7F,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC/D,uDAAuD;IACvD,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,uDAAuD;IACvD,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD,QAAA,MAAM,KAAK,GAAI,OAAO,UAAU,uCAqF/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { c as t } from "../clsx-OuTLNxxd.js";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { I as h, a as b, b as B } from "../IconInfoCircleBold-GQlvRSek.js";
|
|
6
|
+
import { I as N } from "../IconCloseRemove-BPEWBqGA.js";
|
|
7
|
+
import m from "../Button/index.mjs";
|
|
8
|
+
import '../assets/styles.css';/* empty css */
|
|
9
|
+
const s = {
|
|
10
|
+
container: {
|
|
11
|
+
warning: "crow:bg-warning-50 crow:border-warning-200",
|
|
12
|
+
primary: "crow:bg-primary-50 crow:border-primary-100",
|
|
13
|
+
error: "crow:bg-error-50 crow:border-error-200",
|
|
14
|
+
success: "crow:bg-success-50 crow:border-success-200",
|
|
15
|
+
gray: "crow:bg-gray-50 crow:border-gray-200"
|
|
16
|
+
},
|
|
17
|
+
icon: {
|
|
18
|
+
warning: "crow:text-warning-700",
|
|
19
|
+
primary: "crow:text-primary-400",
|
|
20
|
+
error: "crow:text-error-600",
|
|
21
|
+
success: "crow:text-success-600",
|
|
22
|
+
gray: "crow:text-gray-600"
|
|
23
|
+
},
|
|
24
|
+
title: {
|
|
25
|
+
warning: "crow:text-warning-800",
|
|
26
|
+
primary: "crow:text-primary-700",
|
|
27
|
+
error: "crow:text-error-700",
|
|
28
|
+
success: "crow:text-success-800",
|
|
29
|
+
gray: "crow:text-gray-800"
|
|
30
|
+
},
|
|
31
|
+
close: {
|
|
32
|
+
warning: "crow:text-warning-800",
|
|
33
|
+
primary: "crow:text-primary-600",
|
|
34
|
+
error: "crow:text-error-600",
|
|
35
|
+
success: "crow:text-success-800",
|
|
36
|
+
gray: "crow:text-gray-800"
|
|
37
|
+
},
|
|
38
|
+
text: {
|
|
39
|
+
warning: "crow:text-warning-800",
|
|
40
|
+
primary: "crow:text-primary-600",
|
|
41
|
+
error: "crow:text-error-600",
|
|
42
|
+
success: "crow:text-success-800",
|
|
43
|
+
gray: "crow:text-gray-700"
|
|
44
|
+
}
|
|
45
|
+
}, c = {
|
|
46
|
+
container: {
|
|
47
|
+
large: "crow:p-4",
|
|
48
|
+
small: "crow:p-3"
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
large: 24,
|
|
52
|
+
small: 20
|
|
53
|
+
},
|
|
54
|
+
title: {
|
|
55
|
+
large: "crow:font-h5-bold mb-2",
|
|
56
|
+
small: "crow:font-h6-bold mb-1"
|
|
57
|
+
},
|
|
58
|
+
close: {
|
|
59
|
+
large: 20,
|
|
60
|
+
small: 20
|
|
61
|
+
},
|
|
62
|
+
text: {
|
|
63
|
+
large: "crow:font-p2-regular",
|
|
64
|
+
small: "crow:font-p3-regular"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function I(a, o) {
|
|
68
|
+
let r = h;
|
|
69
|
+
return a === "error" ? r = b : a === "success" && (r = B), /* @__PURE__ */ e(
|
|
70
|
+
r,
|
|
71
|
+
{
|
|
72
|
+
className: t("crow:shrink-0 crow:my-[2px]", s.icon[a]),
|
|
73
|
+
width: c.icon[o],
|
|
74
|
+
height: c.icon[o]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const D = (a) => {
|
|
79
|
+
const {
|
|
80
|
+
variant: o = "primary",
|
|
81
|
+
size: r = "small",
|
|
82
|
+
title: w,
|
|
83
|
+
text: x,
|
|
84
|
+
primaryButton: l,
|
|
85
|
+
outlineButton: n,
|
|
86
|
+
closable: g,
|
|
87
|
+
showTitleIcon: p = !0,
|
|
88
|
+
className: u
|
|
89
|
+
} = a, [d, y] = f(!0);
|
|
90
|
+
return d ? /* @__PURE__ */ i(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: t(
|
|
94
|
+
"crow:w-full crow:flex crow:gap-x-3 crow:rounded-xl crow:border crow:border-solid",
|
|
95
|
+
s.container[o],
|
|
96
|
+
c.container[r],
|
|
97
|
+
u
|
|
98
|
+
),
|
|
99
|
+
children: [
|
|
100
|
+
p && I(o, r),
|
|
101
|
+
/* @__PURE__ */ i("div", { className: "crow:flex crow:flex-col crow:flex-1", children: [
|
|
102
|
+
!!w && /* @__PURE__ */ e(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
className: t(
|
|
106
|
+
s.title[o],
|
|
107
|
+
c.title[r]
|
|
108
|
+
),
|
|
109
|
+
children: w
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ e("p", { className: t(s.text[o], c.text[r]), children: x }),
|
|
113
|
+
(!!l?.text || !!n?.text) && /* @__PURE__ */ i(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: t(
|
|
117
|
+
"crow:flex crow:gap-x-2 crow:items-center",
|
|
118
|
+
r === "large" ? "crow:mt-4" : "crow:mt-3"
|
|
119
|
+
),
|
|
120
|
+
children: [
|
|
121
|
+
!!l?.text && /* @__PURE__ */ e(
|
|
122
|
+
m,
|
|
123
|
+
{
|
|
124
|
+
variant: "primary",
|
|
125
|
+
color: o,
|
|
126
|
+
size: "small",
|
|
127
|
+
...l,
|
|
128
|
+
children: l?.text
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
!!n?.text && /* @__PURE__ */ e(
|
|
132
|
+
m,
|
|
133
|
+
{
|
|
134
|
+
variant: "outline",
|
|
135
|
+
color: o,
|
|
136
|
+
size: "small",
|
|
137
|
+
...n,
|
|
138
|
+
children: n?.text
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }),
|
|
145
|
+
g && /* @__PURE__ */ e(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
className: "crow:shrink-0 crow:my-[2px] crow:h-fit",
|
|
149
|
+
onClick: () => y(!1),
|
|
150
|
+
children: /* @__PURE__ */ e(
|
|
151
|
+
N,
|
|
152
|
+
{
|
|
153
|
+
className: t(s.close[o]),
|
|
154
|
+
width: c.close[r],
|
|
155
|
+
height: c.close[r]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
) : null;
|
|
163
|
+
};
|
|
164
|
+
export {
|
|
165
|
+
D as default
|
|
166
|
+
};
|