@mks2508/mks-ui 0.1.3 → 0.2.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/README.md +123 -60
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/types.d.ts +79 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -56
- package/dist/react/components/MorphingPopover/MorphingPopover.types.d.ts +44 -0
- package/dist/react/components/MorphingPopover/MorphingPopover.types.d.ts.map +1 -0
- package/dist/react/components/MorphingPopover/index.d.ts +46 -0
- package/dist/react/components/MorphingPopover/index.d.ts.map +1 -0
- package/dist/{components/ui/morphing-popover/morphing-popover.js → react/components/MorphingPopover/index.js} +47 -7
- package/dist/react/components/MorphingPopover/morphing-popover.module.js +5 -0
- package/dist/react/components/index.d.ts +9 -0
- package/dist/react/components/index.d.ts.map +1 -0
- package/dist/react/components/index.js +1 -0
- package/dist/react/hooks/Animation/UseAutoHeight.d.ts +30 -0
- package/dist/react/hooks/Animation/UseAutoHeight.d.ts.map +1 -0
- package/dist/{hooks/use-auto-height.js → react/hooks/Animation/UseAutoHeight.js} +16 -2
- package/dist/react/hooks/DOM/UseIsInView.d.ts +32 -0
- package/dist/react/hooks/DOM/UseIsInView.d.ts.map +1 -0
- package/dist/react/hooks/DOM/UseIsInView.js +33 -0
- package/dist/react/hooks/State/UseControlledState.d.ts +31 -0
- package/dist/react/hooks/State/UseControlledState.d.ts.map +1 -0
- package/dist/react/hooks/State/UseControlledState.js +34 -0
- package/dist/react/hooks/State/UseDataState.d.ts +21 -0
- package/dist/react/hooks/State/UseDataState.d.ts.map +1 -0
- package/dist/react/hooks/State/UseDataState.js +63 -0
- package/dist/react/hooks/index.d.ts +14 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/index.js +4 -0
- package/dist/react/icons/index.d.ts +8 -0
- package/dist/react/icons/index.d.ts.map +1 -0
- package/dist/react/icons/lucide-animated/activity.d.ts +11 -0
- package/dist/react/icons/lucide-animated/activity.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/activity.js +2 -2
- package/dist/{icons → react/icons}/lucide-animated/arrow-down-to-line.d.ts +1 -1
- package/dist/react/icons/lucide-animated/arrow-down-to-line.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/arrow-down-to-line.js +1 -1
- package/dist/{icons → react/icons}/lucide-animated/arrow-up.d.ts +1 -1
- package/dist/react/icons/lucide-animated/arrow-up.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/arrow-up.js +1 -1
- package/dist/react/icons/lucide-animated/bell-electric.d.ts +11 -0
- package/dist/react/icons/lucide-animated/bell-electric.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/bell-electric.js +2 -2
- package/dist/react/icons/lucide-animated/bell.d.ts +11 -0
- package/dist/react/icons/lucide-animated/bell.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/bell.js +2 -2
- package/dist/react/icons/lucide-animated/bot.d.ts +11 -0
- package/dist/react/icons/lucide-animated/bot.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/bot.js +2 -2
- package/dist/react/icons/lucide-animated/box.d.ts +11 -0
- package/dist/react/icons/lucide-animated/box.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/box.js +2 -2
- package/dist/react/icons/lucide-animated/check.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/check.js +1 -1
- package/dist/react/icons/lucide-animated/circle-check.d.ts +11 -0
- package/dist/react/icons/lucide-animated/circle-check.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/circle-check.js +2 -2
- package/dist/react/icons/lucide-animated/delete.d.ts +11 -0
- package/dist/react/icons/lucide-animated/delete.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/delete.js +2 -2
- package/dist/react/icons/lucide-animated/download.d.ts +11 -0
- package/dist/react/icons/lucide-animated/download.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/download.js +2 -2
- package/dist/react/icons/lucide-animated/edit-2.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/edit-2.js +1 -1
- package/dist/react/icons/lucide-animated/globe.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/globe.js +1 -1
- package/dist/react/icons/lucide-animated/home.d.ts +11 -0
- package/dist/react/icons/lucide-animated/home.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/home.js +2 -2
- package/dist/react/icons/lucide-animated/index.d.ts +38 -0
- package/dist/react/icons/lucide-animated/index.d.ts.map +1 -0
- package/dist/react/icons/lucide-animated/layers.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/layers.js +1 -1
- package/dist/react/icons/lucide-animated/layout-panel-top.d.ts +11 -0
- package/dist/react/icons/lucide-animated/layout-panel-top.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/layout-panel-top.js +2 -2
- package/dist/{icons → react/icons}/lucide-animated/list.d.ts +1 -1
- package/dist/react/icons/lucide-animated/list.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/list.js +1 -1
- package/dist/react/icons/lucide-animated/package.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/package.js +1 -1
- package/dist/react/icons/lucide-animated/palette.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/palette.js +1 -1
- package/dist/react/icons/lucide-animated/plus.d.ts +11 -0
- package/dist/react/icons/lucide-animated/plus.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/plus.js +2 -2
- package/dist/react/icons/lucide-animated/refresh-cw.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/refresh-cw.js +1 -1
- package/dist/react/icons/lucide-animated/rocket.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/rocket.js +1 -1
- package/dist/react/icons/lucide-animated/save.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/save.js +1 -1
- package/dist/react/icons/lucide-animated/search.d.ts +11 -0
- package/dist/react/icons/lucide-animated/search.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/search.js +2 -2
- package/dist/react/icons/lucide-animated/settings.d.ts +11 -0
- package/dist/react/icons/lucide-animated/settings.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/settings.js +2 -2
- package/dist/{icons → react/icons}/lucide-animated/terminal.d.ts +1 -1
- package/dist/react/icons/lucide-animated/terminal.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/terminal.js +1 -1
- package/dist/react/icons/lucide-animated/trash-2.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/trash-2.js +1 -1
- package/dist/react/icons/lucide-animated/trending-down.d.ts +11 -0
- package/dist/react/icons/lucide-animated/trending-down.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/trending-down.js +2 -2
- package/dist/react/icons/lucide-animated/trending-up.d.ts +11 -0
- package/dist/react/icons/lucide-animated/trending-up.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/trending-up.js +2 -2
- package/dist/react/icons/lucide-animated/type.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/type.js +1 -1
- package/dist/react/icons/lucide-animated/upload.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/upload.js +1 -1
- package/dist/react/icons/lucide-animated/x.d.ts +11 -0
- package/dist/react/icons/lucide-animated/x.d.ts.map +1 -0
- package/dist/{icons → react/icons}/lucide-animated/x.js +2 -2
- package/dist/react/index.d.ts +19 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/lib/get-strict-context.d.ts +30 -0
- package/dist/react/lib/get-strict-context.d.ts.map +1 -0
- package/dist/react/lib/get-strict-context.js +40 -0
- package/dist/react/lib/index.d.ts +8 -0
- package/dist/react/lib/index.d.ts.map +1 -0
- package/dist/react/lib/index.js +2 -0
- package/dist/{lib → react/lib}/utils.d.ts +2 -2
- package/dist/react/lib/utils.d.ts.map +1 -0
- package/dist/{lib → react/lib}/utils.js +3 -3
- package/dist/react/primitives/AutoHeight/index.d.ts +31 -0
- package/dist/react/primitives/AutoHeight/index.d.ts.map +1 -0
- package/dist/react/primitives/AutoHeight/index.js +52 -0
- package/dist/react/primitives/CountingNumber/index.d.ts +44 -0
- package/dist/react/primitives/CountingNumber/index.d.ts.map +1 -0
- package/dist/react/primitives/CountingNumber/index.js +97 -0
- package/dist/react/primitives/Highlight/Highlight.types.d.ts +113 -0
- package/dist/react/primitives/Highlight/Highlight.types.d.ts.map +1 -0
- package/dist/react/primitives/Highlight/index.d.ts +48 -0
- package/dist/react/primitives/Highlight/index.d.ts.map +1 -0
- package/dist/{components/animate-ui/primitives/effects/highlight.js → react/primitives/Highlight/index.js} +45 -5
- package/dist/react/primitives/Slot/index.d.ts +53 -0
- package/dist/react/primitives/Slot/index.d.ts.map +1 -0
- package/dist/{components/animate-ui/primitives/animate/slot.js → react/primitives/Slot/index.js} +27 -4
- package/dist/react/primitives/index.d.ts +12 -0
- package/dist/react/primitives/index.d.ts.map +1 -0
- package/dist/react/primitives/index.js +4 -0
- package/dist/react/ui/Accordion/Accordion.styles.d.ts +47 -0
- package/dist/react/ui/Accordion/Accordion.styles.d.ts.map +1 -0
- package/dist/react/ui/Accordion/Accordion.styles.js +54 -0
- package/dist/react/ui/Accordion/Accordion.types.d.ts +160 -0
- package/dist/react/ui/Accordion/Accordion.types.d.ts.map +1 -0
- package/dist/react/ui/Accordion/index.d.ts +105 -0
- package/dist/react/ui/Accordion/index.d.ts.map +1 -0
- package/dist/react/ui/Accordion/index.js +266 -0
- package/dist/react/ui/AlertDialog/AlertDialog.styles.d.ts +28 -0
- package/dist/react/ui/AlertDialog/AlertDialog.styles.d.ts.map +1 -0
- package/dist/react/ui/AlertDialog/AlertDialog.styles.js +29 -0
- package/dist/react/ui/AlertDialog/AlertDialog.types.d.ts +235 -0
- package/dist/react/ui/AlertDialog/AlertDialog.types.d.ts.map +1 -0
- package/dist/react/ui/AlertDialog/index.d.ts +194 -0
- package/dist/react/ui/AlertDialog/index.d.ts.map +1 -0
- package/dist/react/ui/AlertDialog/index.js +319 -0
- package/dist/react/ui/Badge/Badge.styles.d.ts +16 -0
- package/dist/react/ui/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/{components/ui/badge/badge.styles.js → react/ui/Badge/Badge.styles.js} +2 -6
- package/dist/react/ui/Badge/Badge.types.d.ts +21 -0
- package/dist/react/ui/Badge/Badge.types.d.ts.map +1 -0
- package/dist/react/ui/Badge/index.d.ts +20 -0
- package/dist/react/ui/Badge/index.d.ts.map +1 -0
- package/dist/react/ui/Badge/index.js +34 -0
- package/dist/react/ui/Button/Button.styles.d.ts +21 -0
- package/dist/react/ui/Button/Button.styles.d.ts.map +1 -0
- package/dist/{components/ui/button/button.styles.js → react/ui/Button/Button.styles.js} +3 -9
- package/dist/react/ui/Button/Button.types.d.ts +45 -0
- package/dist/react/ui/Button/Button.types.d.ts.map +1 -0
- package/dist/react/ui/Button/index.d.ts +22 -0
- package/dist/react/ui/Button/index.d.ts.map +1 -0
- package/dist/react/ui/Button/index.js +103 -0
- package/dist/react/ui/Card/Card.styles.d.ts +11 -0
- package/dist/react/ui/Card/Card.styles.d.ts.map +1 -0
- package/dist/react/ui/Card/Card.styles.js +24 -0
- package/dist/react/ui/Card/Card.types.d.ts +22 -0
- package/dist/react/ui/Card/Card.types.d.ts.map +1 -0
- package/dist/react/ui/Card/index.d.ts +36 -0
- package/dist/react/ui/Card/index.d.ts.map +1 -0
- package/dist/react/ui/Card/index.js +82 -0
- package/dist/react/ui/Checkbox/Checkbox.styles.d.ts +25 -0
- package/dist/react/ui/Checkbox/Checkbox.styles.d.ts.map +1 -0
- package/dist/react/ui/Checkbox/Checkbox.styles.js +34 -0
- package/dist/react/ui/Checkbox/Checkbox.types.d.ts +88 -0
- package/dist/react/ui/Checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/react/ui/Checkbox/index.d.ts +59 -0
- package/dist/react/ui/Checkbox/index.d.ts.map +1 -0
- package/dist/react/ui/Checkbox/index.js +158 -0
- package/dist/react/ui/Combobox/Combobox.styles.d.ts +7 -0
- package/dist/react/ui/Combobox/Combobox.styles.d.ts.map +1 -0
- package/dist/react/ui/Combobox/Combobox.styles.js +17 -0
- package/dist/react/ui/Combobox/Combobox.types.d.ts +49 -0
- package/dist/react/ui/Combobox/Combobox.types.d.ts.map +1 -0
- package/dist/react/ui/Combobox/index.d.ts +60 -0
- package/dist/react/ui/Combobox/index.d.ts.map +1 -0
- package/dist/{components/ui/combobox.js → react/ui/Combobox/index.js} +54 -16
- package/dist/react/ui/CornerBracket/CornerBracket.styles.d.ts +18 -0
- package/dist/react/ui/CornerBracket/CornerBracket.styles.d.ts.map +1 -0
- package/dist/react/ui/CornerBracket/CornerBracket.styles.js +30 -0
- package/dist/react/ui/CornerBracket/CornerBracket.types.d.ts +12 -0
- package/dist/react/ui/CornerBracket/CornerBracket.types.d.ts.map +1 -0
- package/dist/react/ui/CornerBracket/index.d.ts +23 -0
- package/dist/react/ui/CornerBracket/index.d.ts.map +1 -0
- package/dist/react/ui/CornerBracket/index.js +42 -0
- package/dist/react/ui/Dialog/Dialog.styles.d.ts +24 -0
- package/dist/react/ui/Dialog/Dialog.styles.d.ts.map +1 -0
- package/dist/react/ui/Dialog/Dialog.styles.js +29 -0
- package/dist/react/ui/Dialog/Dialog.types.d.ts +221 -0
- package/dist/react/ui/Dialog/Dialog.types.d.ts.map +1 -0
- package/dist/react/ui/Dialog/index.d.ts +138 -0
- package/dist/react/ui/Dialog/index.d.ts.map +1 -0
- package/dist/react/ui/Dialog/index.js +265 -0
- package/dist/react/ui/DropdownMenu/DropdownMenu.styles.d.ts +7 -0
- package/dist/react/ui/DropdownMenu/DropdownMenu.styles.d.ts.map +1 -0
- package/dist/react/ui/DropdownMenu/DropdownMenu.styles.js +16 -0
- package/dist/react/ui/DropdownMenu/DropdownMenu.types.d.ts +50 -0
- package/dist/react/ui/DropdownMenu/DropdownMenu.types.d.ts.map +1 -0
- package/dist/react/ui/DropdownMenu/index.d.ts +50 -0
- package/dist/react/ui/DropdownMenu/index.d.ts.map +1 -0
- package/dist/{components/ui/dropdown-menu.js → react/ui/DropdownMenu/index.js} +44 -14
- package/dist/react/ui/Field/Field.styles.d.ts +11 -0
- package/dist/react/ui/Field/Field.styles.d.ts.map +1 -0
- package/dist/react/ui/Field/Field.styles.js +27 -0
- package/dist/react/ui/Field/Field.types.d.ts +39 -0
- package/dist/react/ui/Field/Field.types.d.ts.map +1 -0
- package/dist/react/ui/Field/index.d.ts +56 -0
- package/dist/react/ui/Field/index.d.ts.map +1 -0
- package/dist/{components/ui/field.js → react/ui/Field/index.js} +55 -23
- package/dist/react/ui/Input/Input.styles.d.ts +7 -0
- package/dist/react/ui/Input/Input.styles.d.ts.map +1 -0
- package/dist/react/ui/Input/Input.styles.js +5 -0
- package/dist/react/ui/Input/Input.types.d.ts +9 -0
- package/dist/react/ui/Input/Input.types.d.ts.map +1 -0
- package/dist/react/ui/Input/index.d.ts +17 -0
- package/dist/react/ui/Input/index.d.ts.map +1 -0
- package/dist/react/ui/Input/index.js +29 -0
- package/dist/react/ui/InputGroup/InputGroup.styles.d.ts +15 -0
- package/dist/react/ui/InputGroup/InputGroup.styles.d.ts.map +1 -0
- package/dist/react/ui/InputGroup/InputGroup.styles.js +34 -0
- package/dist/react/ui/InputGroup/InputGroup.types.d.ts +28 -0
- package/dist/react/ui/InputGroup/InputGroup.types.d.ts.map +1 -0
- package/dist/react/ui/InputGroup/index.d.ts +28 -0
- package/dist/react/ui/InputGroup/index.d.ts.map +1 -0
- package/dist/react/ui/InputGroup/index.js +81 -0
- package/dist/react/ui/Label/Label.styles.d.ts +6 -0
- package/dist/react/ui/Label/Label.styles.d.ts.map +1 -0
- package/dist/react/ui/Label/Label.styles.js +5 -0
- package/dist/react/ui/Label/Label.types.d.ts +8 -0
- package/dist/react/ui/Label/Label.types.d.ts.map +1 -0
- package/dist/react/ui/Label/index.d.ts +14 -0
- package/dist/react/ui/Label/index.d.ts.map +1 -0
- package/dist/react/ui/Label/index.js +24 -0
- package/dist/react/ui/Menu/Menu.styles.d.ts +42 -0
- package/dist/react/ui/Menu/Menu.styles.d.ts.map +1 -0
- package/dist/react/ui/Menu/Menu.styles.js +32 -0
- package/dist/react/ui/Menu/Menu.types.d.ts +328 -0
- package/dist/react/ui/Menu/Menu.types.d.ts.map +1 -0
- package/dist/react/ui/Menu/index.d.ts +354 -0
- package/dist/react/ui/Menu/index.d.ts.map +1 -0
- package/dist/react/ui/Menu/index.js +636 -0
- package/dist/react/ui/Popover/Popover.styles.d.ts +23 -0
- package/dist/react/ui/Popover/Popover.styles.d.ts.map +1 -0
- package/dist/react/ui/Popover/Popover.styles.js +26 -0
- package/dist/react/ui/Popover/Popover.types.d.ts +204 -0
- package/dist/react/ui/Popover/Popover.types.d.ts.map +1 -0
- package/dist/react/ui/Popover/index.d.ts +133 -0
- package/dist/react/ui/Popover/index.d.ts.map +1 -0
- package/dist/react/ui/Popover/index.js +237 -0
- package/dist/react/ui/Progress/Progress.styles.d.ts +28 -0
- package/dist/react/ui/Progress/Progress.styles.d.ts.map +1 -0
- package/dist/react/ui/Progress/Progress.styles.js +30 -0
- package/dist/react/ui/Progress/Progress.types.d.ts +148 -0
- package/dist/react/ui/Progress/Progress.types.d.ts.map +1 -0
- package/dist/react/ui/Progress/index.d.ts +111 -0
- package/dist/react/ui/Progress/index.d.ts.map +1 -0
- package/dist/react/ui/Progress/index.js +170 -0
- package/dist/react/ui/Select/Select.styles.d.ts +7 -0
- package/dist/react/ui/Select/Select.styles.d.ts.map +1 -0
- package/dist/react/ui/Select/Select.styles.js +15 -0
- package/dist/react/ui/Select/Select.types.d.ts +28 -0
- package/dist/react/ui/Select/Select.types.d.ts.map +1 -0
- package/dist/react/ui/Select/index.d.ts +38 -0
- package/dist/react/ui/Select/index.d.ts.map +1 -0
- package/dist/{components/ui/select.js → react/ui/Select/index.js} +35 -13
- package/dist/react/ui/Separator/Separator.styles.d.ts +6 -0
- package/dist/react/ui/Separator/Separator.styles.d.ts.map +1 -0
- package/dist/react/ui/Separator/Separator.styles.js +5 -0
- package/dist/react/ui/Separator/Separator.types.d.ts +9 -0
- package/dist/react/ui/Separator/Separator.types.d.ts.map +1 -0
- package/dist/react/ui/Separator/index.d.ts +16 -0
- package/dist/react/ui/Separator/index.d.ts.map +1 -0
- package/dist/react/ui/Separator/index.js +29 -0
- package/dist/react/ui/Switch/Switch.styles.d.ts +26 -0
- package/dist/react/ui/Switch/Switch.styles.d.ts.map +1 -0
- package/dist/react/ui/Switch/Switch.styles.js +41 -0
- package/dist/react/ui/Switch/Switch.types.d.ts +130 -0
- package/dist/react/ui/Switch/Switch.types.d.ts.map +1 -0
- package/dist/react/ui/Switch/index.d.ts +79 -0
- package/dist/react/ui/Switch/index.d.ts.map +1 -0
- package/dist/react/ui/Switch/index.js +199 -0
- package/dist/react/ui/Tabs/Tabs.styles.d.ts +43 -0
- package/dist/react/ui/Tabs/Tabs.styles.d.ts.map +1 -0
- package/dist/react/ui/Tabs/Tabs.styles.js +26 -0
- package/dist/react/ui/Tabs/Tabs.types.d.ts +201 -0
- package/dist/react/ui/Tabs/Tabs.types.d.ts.map +1 -0
- package/dist/react/ui/Tabs/index.d.ts +141 -0
- package/dist/react/ui/Tabs/index.d.ts.map +1 -0
- package/dist/react/ui/Tabs/index.js +308 -0
- package/dist/react/ui/Textarea/Textarea.styles.d.ts +6 -0
- package/dist/react/ui/Textarea/Textarea.styles.d.ts.map +1 -0
- package/dist/react/ui/Textarea/Textarea.styles.js +5 -0
- package/dist/react/ui/Textarea/Textarea.types.d.ts +8 -0
- package/dist/react/ui/Textarea/Textarea.types.d.ts.map +1 -0
- package/dist/react/ui/Textarea/index.d.ts +14 -0
- package/dist/react/ui/Textarea/index.d.ts.map +1 -0
- package/dist/react/ui/Textarea/index.js +24 -0
- package/dist/react/ui/Tooltip/Tooltip.styles.d.ts +23 -0
- package/dist/react/ui/Tooltip/Tooltip.styles.d.ts.map +1 -0
- package/dist/react/ui/Tooltip/Tooltip.styles.js +26 -0
- package/dist/react/ui/Tooltip/Tooltip.types.d.ts +203 -0
- package/dist/react/ui/Tooltip/Tooltip.types.d.ts.map +1 -0
- package/dist/react/ui/Tooltip/index.d.ts +110 -0
- package/dist/react/ui/Tooltip/index.d.ts.map +1 -0
- package/dist/react/ui/Tooltip/index.js +219 -0
- package/dist/react/ui/index.d.ts +31 -0
- package/dist/react/ui/index.d.ts.map +1 -0
- package/dist/react/ui/index.js +37 -0
- package/dist/react.js +88 -0
- package/package.json +12 -13
- package/src/core/index.ts +7 -0
- package/src/core/types.ts +82 -0
- package/src/index.ts +20 -11
- package/src/react/components/MorphingPopover/MorphingPopover.types.ts +49 -0
- package/src/react/components/MorphingPopover/index.tsx +186 -0
- package/src/react/components/index.ts +9 -0
- package/src/{hooks/use-auto-height.tsx → react/hooks/Animation/UseAutoHeight.tsx} +24 -3
- package/src/react/hooks/DOM/UseIsInView.tsx +44 -0
- package/src/{hooks/use-controlled-state.tsx → react/hooks/State/UseControlledState.tsx} +26 -2
- package/src/{hooks/use-data-state.tsx → react/hooks/State/UseDataState.tsx} +22 -0
- package/src/react/hooks/index.ts +17 -0
- package/src/react/icons/index.ts +12 -0
- package/src/{icons → react/icons}/lucide-animated/activity.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/bell-electric.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/bell.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/bot.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/box.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/circle-check.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/delete.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/download.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/home.tsx +1 -1
- package/src/react/icons/lucide-animated/index.ts +38 -0
- package/src/{icons → react/icons}/lucide-animated/layout-panel-top.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/plus.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/search.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/settings.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/trending-down.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/trending-up.tsx +1 -1
- package/src/{icons → react/icons}/lucide-animated/x.tsx +1 -1
- package/src/react/index.ts +30 -0
- package/src/{lib → react/lib}/get-strict-context.tsx +20 -0
- package/src/react/lib/index.ts +8 -0
- package/src/{lib → react/lib}/utils.ts +2 -2
- package/src/{components/animate-ui/primitives/effects/auto-height.tsx → react/primitives/AutoHeight/index.tsx} +24 -5
- package/src/{components/animate-ui/primitives/texts/counting-number.tsx → react/primitives/CountingNumber/index.tsx} +35 -7
- package/src/react/primitives/Highlight/Highlight.types.ts +136 -0
- package/src/{components/animate-ui/primitives/effects/highlight.tsx → react/primitives/Highlight/index.tsx} +60 -123
- package/src/{components/animate-ui/primitives/animate/slot.tsx → react/primitives/Slot/index.tsx} +43 -11
- package/src/react/primitives/index.ts +13 -0
- package/src/react/ui/Accordion/Accordion.styles.ts +72 -0
- package/src/react/ui/Accordion/Accordion.types.ts +199 -0
- package/src/react/ui/Accordion/index.tsx +362 -0
- package/src/react/ui/AlertDialog/AlertDialog.styles.ts +38 -0
- package/src/react/ui/AlertDialog/AlertDialog.types.ts +296 -0
- package/src/react/ui/AlertDialog/index.tsx +540 -0
- package/src/react/ui/Badge/Badge.styles.ts +43 -0
- package/src/react/ui/Badge/Badge.types.ts +26 -0
- package/src/react/ui/Badge/index.tsx +34 -0
- package/src/react/ui/Button/Button.styles.ts +57 -0
- package/src/react/ui/Button/Button.types.ts +63 -0
- package/src/react/ui/Button/index.tsx +155 -0
- package/src/react/ui/Card/Card.styles.ts +32 -0
- package/src/react/ui/Card/Card.types.ts +39 -0
- package/src/react/ui/Card/index.tsx +130 -0
- package/src/react/ui/Checkbox/Checkbox.styles.ts +40 -0
- package/src/react/ui/Checkbox/Checkbox.types.ts +98 -0
- package/src/react/ui/Checkbox/index.tsx +233 -0
- package/src/react/ui/Combobox/Combobox.styles.ts +34 -0
- package/src/react/ui/Combobox/Combobox.types.ts +89 -0
- package/src/react/ui/Combobox/index.tsx +331 -0
- package/src/react/ui/CornerBracket/CornerBracket.styles.ts +38 -0
- package/src/react/ui/CornerBracket/CornerBracket.types.ts +15 -0
- package/src/react/ui/CornerBracket/index.tsx +49 -0
- package/src/react/ui/Dialog/Dialog.styles.ts +59 -0
- package/src/react/ui/Dialog/Dialog.types.ts +284 -0
- package/src/react/ui/Dialog/index.tsx +452 -0
- package/src/react/ui/DropdownMenu/DropdownMenu.styles.ts +35 -0
- package/src/react/ui/DropdownMenu/DropdownMenu.types.ts +81 -0
- package/src/react/ui/DropdownMenu/index.tsx +300 -0
- package/src/react/ui/Field/Field.styles.ts +47 -0
- package/src/react/ui/Field/Field.types.ts +60 -0
- package/src/react/ui/Field/index.tsx +254 -0
- package/src/{components/ui/input.tsx → react/ui/Input/Input.styles.ts} +8 -17
- package/src/react/ui/Input/Input.types.ts +10 -0
- package/src/react/ui/Input/index.tsx +32 -0
- package/src/react/ui/InputGroup/InputGroup.styles.ts +53 -0
- package/src/react/ui/InputGroup/InputGroup.types.ts +44 -0
- package/src/react/ui/InputGroup/index.tsx +147 -0
- package/src/react/ui/Label/Label.styles.ts +10 -0
- package/src/react/ui/Label/Label.types.ts +9 -0
- package/src/react/ui/Label/index.tsx +27 -0
- package/src/react/ui/Menu/Menu.styles.ts +71 -0
- package/src/react/ui/Menu/Menu.types.ts +425 -0
- package/src/react/ui/Menu/index.tsx +900 -0
- package/src/react/ui/Popover/Popover.styles.ts +55 -0
- package/src/react/ui/Popover/Popover.types.ts +261 -0
- package/src/react/ui/Popover/index.tsx +422 -0
- package/src/react/ui/Progress/Progress.styles.ts +36 -0
- package/src/react/ui/Progress/Progress.types.ts +162 -0
- package/src/react/ui/Progress/index.tsx +254 -0
- package/src/react/ui/Select/Select.styles.ts +30 -0
- package/src/react/ui/Select/Select.types.ts +51 -0
- package/src/react/ui/Select/index.tsx +225 -0
- package/src/react/ui/Separator/Separator.styles.ts +10 -0
- package/src/react/ui/Separator/Separator.types.ts +10 -0
- package/src/react/ui/Separator/index.tsx +37 -0
- package/src/react/ui/Switch/Switch.styles.ts +50 -0
- package/src/react/ui/Switch/Switch.types.ts +155 -0
- package/src/react/ui/Switch/index.tsx +253 -0
- package/src/react/ui/Tabs/Tabs.styles.ts +60 -0
- package/src/react/ui/Tabs/Tabs.types.ts +250 -0
- package/src/react/ui/Tabs/index.tsx +421 -0
- package/src/{components/ui/textarea.tsx → react/ui/Textarea/Textarea.styles.ts} +7 -15
- package/src/react/ui/Textarea/Textarea.types.ts +9 -0
- package/src/react/ui/Textarea/index.tsx +27 -0
- package/src/react/ui/Tooltip/Tooltip.styles.ts +43 -0
- package/src/react/ui/Tooltip/Tooltip.types.ts +253 -0
- package/src/react/ui/Tooltip/index.tsx +394 -0
- package/src/react/ui/index.ts +34 -0
- package/dist/components/animate-ui/primitives/animate/slot.d.ts +0 -18
- package/dist/components/animate-ui/primitives/animate/slot.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/accordion.d.ts +0 -22
- package/dist/components/animate-ui/primitives/base/accordion.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/alert-dialog.d.ts +0 -33
- package/dist/components/animate-ui/primitives/base/alert-dialog.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/checkbox.d.ts +0 -15
- package/dist/components/animate-ui/primitives/base/checkbox.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/dialog.d.ts +0 -33
- package/dist/components/animate-ui/primitives/base/dialog.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/menu.d.ts +0 -60
- package/dist/components/animate-ui/primitives/base/menu.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/popover.d.ts +0 -30
- package/dist/components/animate-ui/primitives/base/popover.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/progress.d.ts +0 -297
- package/dist/components/animate-ui/primitives/base/progress.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/switch.d.ts +0 -23
- package/dist/components/animate-ui/primitives/base/switch.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/switch.js +0 -90
- package/dist/components/animate-ui/primitives/base/tabs.d.ts +0 -33
- package/dist/components/animate-ui/primitives/base/tabs.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/base/tabs.js +0 -132
- package/dist/components/animate-ui/primitives/base/tooltip.d.ts +0 -31
- package/dist/components/animate-ui/primitives/base/tooltip.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/effects/auto-height.d.ts +0 -12
- package/dist/components/animate-ui/primitives/effects/auto-height.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/effects/auto-height.js +0 -37
- package/dist/components/animate-ui/primitives/effects/highlight.d.ts +0 -92
- package/dist/components/animate-ui/primitives/effects/highlight.d.ts.map +0 -1
- package/dist/components/animate-ui/primitives/texts/counting-number.d.ts +0 -16
- package/dist/components/animate-ui/primitives/texts/counting-number.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog.d.ts +0 -21
- package/dist/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog.js +0 -99
- package/dist/components/ui/badge/badge.d.ts +0 -37
- package/dist/components/ui/badge/badge.d.ts.map +0 -1
- package/dist/components/ui/badge/badge.js +0 -52
- package/dist/components/ui/badge/badge.styles.d.ts +0 -23
- package/dist/components/ui/badge/badge.styles.d.ts.map +0 -1
- package/dist/components/ui/badge/badge.types.d.ts +0 -38
- package/dist/components/ui/badge/badge.types.d.ts.map +0 -1
- package/dist/components/ui/badge/index.d.ts +0 -8
- package/dist/components/ui/badge/index.d.ts.map +0 -1
- package/dist/components/ui/badge/index.js +0 -2
- package/dist/components/ui/button/button.d.ts +0 -79
- package/dist/components/ui/button/button.d.ts.map +0 -1
- package/dist/components/ui/button/button.js +0 -161
- package/dist/components/ui/button/button.styles.d.ts +0 -33
- package/dist/components/ui/button/button.styles.d.ts.map +0 -1
- package/dist/components/ui/button/button.types.d.ts +0 -103
- package/dist/components/ui/button/button.types.d.ts.map +0 -1
- package/dist/components/ui/button/index.d.ts +0 -7
- package/dist/components/ui/button/index.d.ts.map +0 -1
- package/dist/components/ui/button/index.js +0 -2
- package/dist/components/ui/card.d.ts +0 -14
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -67
- package/dist/components/ui/combobox.d.ts +0 -25
- package/dist/components/ui/combobox.d.ts.map +0 -1
- package/dist/components/ui/devenv-bracket.d.ts +0 -30
- package/dist/components/ui/devenv-bracket.d.ts.map +0 -1
- package/dist/components/ui/devenv-bracket.js +0 -66
- package/dist/components/ui/dropdown-menu.d.ts +0 -30
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/field.d.ts +0 -25
- package/dist/components/ui/field.d.ts.map +0 -1
- package/dist/components/ui/index.d.ts +0 -25
- package/dist/components/ui/index.d.ts.map +0 -1
- package/dist/components/ui/index.js +0 -24
- package/dist/components/ui/input-group.d.ts +0 -19
- package/dist/components/ui/input-group.d.ts.map +0 -1
- package/dist/components/ui/input-group.js +0 -84
- package/dist/components/ui/input.d.ts +0 -4
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -17
- package/dist/components/ui/label.d.ts +0 -4
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -15
- package/dist/components/ui/morphing-popover/index.d.ts +0 -10
- package/dist/components/ui/morphing-popover/index.d.ts.map +0 -1
- package/dist/components/ui/morphing-popover/index.js +0 -1
- package/dist/components/ui/morphing-popover/morphing-popover.d.ts +0 -54
- package/dist/components/ui/morphing-popover/morphing-popover.d.ts.map +0 -1
- package/dist/components/ui/morphing-popover/morphing-popover.module.js +0 -5
- package/dist/components/ui/select.d.ts +0 -16
- package/dist/components/ui/select.d.ts.map +0 -1
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/components/ui/separator.d.ts.map +0 -1
- package/dist/components/ui/separator.js +0 -18
- package/dist/components/ui/switch.d.ts +0 -9
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -1
- package/dist/components/ui/tabs.d.ts +0 -9
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -1
- package/dist/components/ui/textarea.d.ts +0 -4
- package/dist/components/ui/textarea.d.ts.map +0 -1
- package/dist/components/ui/textarea.js +0 -15
- package/dist/hooks/use-auto-height.d.ts +0 -11
- package/dist/hooks/use-auto-height.d.ts.map +0 -1
- package/dist/hooks/use-controlled-state.d.ts +0 -9
- package/dist/hooks/use-controlled-state.d.ts.map +0 -1
- package/dist/hooks/use-controlled-state.js +0 -17
- package/dist/hooks/use-data-state.d.ts +0 -5
- package/dist/hooks/use-data-state.d.ts.map +0 -1
- package/dist/hooks/use-is-in-view.d.ts +0 -13
- package/dist/hooks/use-is-in-view.d.ts.map +0 -1
- package/dist/icons/index.d.ts +0 -8
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/lucide-animated/activity.d.ts +0 -11
- package/dist/icons/lucide-animated/activity.d.ts.map +0 -1
- package/dist/icons/lucide-animated/arrow-down-to-line.d.ts.map +0 -1
- package/dist/icons/lucide-animated/arrow-up.d.ts.map +0 -1
- package/dist/icons/lucide-animated/bell-electric.d.ts +0 -11
- package/dist/icons/lucide-animated/bell-electric.d.ts.map +0 -1
- package/dist/icons/lucide-animated/bell.d.ts +0 -11
- package/dist/icons/lucide-animated/bell.d.ts.map +0 -1
- package/dist/icons/lucide-animated/bot.d.ts +0 -11
- package/dist/icons/lucide-animated/bot.d.ts.map +0 -1
- package/dist/icons/lucide-animated/box.d.ts +0 -11
- package/dist/icons/lucide-animated/box.d.ts.map +0 -1
- package/dist/icons/lucide-animated/check.d.ts.map +0 -1
- package/dist/icons/lucide-animated/circle-check.d.ts +0 -11
- package/dist/icons/lucide-animated/circle-check.d.ts.map +0 -1
- package/dist/icons/lucide-animated/delete.d.ts +0 -11
- package/dist/icons/lucide-animated/delete.d.ts.map +0 -1
- package/dist/icons/lucide-animated/download.d.ts +0 -11
- package/dist/icons/lucide-animated/download.d.ts.map +0 -1
- package/dist/icons/lucide-animated/edit-2.d.ts.map +0 -1
- package/dist/icons/lucide-animated/globe.d.ts.map +0 -1
- package/dist/icons/lucide-animated/home.d.ts +0 -11
- package/dist/icons/lucide-animated/home.d.ts.map +0 -1
- package/dist/icons/lucide-animated/index.d.ts +0 -38
- package/dist/icons/lucide-animated/index.d.ts.map +0 -1
- package/dist/icons/lucide-animated/layers.d.ts.map +0 -1
- package/dist/icons/lucide-animated/layout-panel-top.d.ts +0 -11
- package/dist/icons/lucide-animated/layout-panel-top.d.ts.map +0 -1
- package/dist/icons/lucide-animated/list.d.ts.map +0 -1
- package/dist/icons/lucide-animated/package.d.ts.map +0 -1
- package/dist/icons/lucide-animated/palette.d.ts.map +0 -1
- package/dist/icons/lucide-animated/plus.d.ts +0 -11
- package/dist/icons/lucide-animated/plus.d.ts.map +0 -1
- package/dist/icons/lucide-animated/refresh-cw.d.ts.map +0 -1
- package/dist/icons/lucide-animated/rocket.d.ts.map +0 -1
- package/dist/icons/lucide-animated/save.d.ts.map +0 -1
- package/dist/icons/lucide-animated/search.d.ts +0 -11
- package/dist/icons/lucide-animated/search.d.ts.map +0 -1
- package/dist/icons/lucide-animated/settings.d.ts +0 -11
- package/dist/icons/lucide-animated/settings.d.ts.map +0 -1
- package/dist/icons/lucide-animated/terminal.d.ts.map +0 -1
- package/dist/icons/lucide-animated/trash-2.d.ts.map +0 -1
- package/dist/icons/lucide-animated/trending-down.d.ts +0 -11
- package/dist/icons/lucide-animated/trending-down.d.ts.map +0 -1
- package/dist/icons/lucide-animated/trending-up.d.ts +0 -11
- package/dist/icons/lucide-animated/trending-up.d.ts.map +0 -1
- package/dist/icons/lucide-animated/type.d.ts.map +0 -1
- package/dist/icons/lucide-animated/upload.d.ts.map +0 -1
- package/dist/icons/lucide-animated/x.d.ts +0 -11
- package/dist/icons/lucide-animated/x.d.ts.map +0 -1
- package/dist/lib/get-strict-context.d.ts +0 -10
- package/dist/lib/get-strict-context.d.ts.map +0 -1
- package/dist/lib/get-strict-context.js +0 -20
- package/dist/lib/utils.d.ts.map +0 -1
- package/src/components/animate-ui/primitives/base/accordion.tsx +0 -179
- package/src/components/animate-ui/primitives/base/alert-dialog.tsx +0 -218
- package/src/components/animate-ui/primitives/base/checkbox.tsx +0 -153
- package/src/components/animate-ui/primitives/base/dialog.tsx +0 -203
- package/src/components/animate-ui/primitives/base/menu.tsx +0 -463
- package/src/components/animate-ui/primitives/base/popover.tsx +0 -167
- package/src/components/animate-ui/primitives/base/progress.tsx +0 -103
- package/src/components/animate-ui/primitives/base/switch.tsx +0 -158
- package/src/components/animate-ui/primitives/base/tabs.tsx +0 -202
- package/src/components/animate-ui/primitives/base/tooltip.tsx +0 -209
- package/src/components/ui/alert-dialog.tsx +0 -177
- package/src/components/ui/badge/badge.styles.ts +0 -46
- package/src/components/ui/badge/badge.tsx +0 -52
- package/src/components/ui/badge/badge.types.ts +0 -41
- package/src/components/ui/badge/index.ts +0 -8
- package/src/components/ui/button/button.styles.ts +0 -66
- package/src/components/ui/button/button.tsx +0 -209
- package/src/components/ui/button/button.types.ts +0 -125
- package/src/components/ui/button/index.ts +0 -7
- package/src/components/ui/card.tsx +0 -108
- package/src/components/ui/combobox.tsx +0 -293
- package/src/components/ui/devenv-bracket.tsx +0 -81
- package/src/components/ui/dropdown-menu.tsx +0 -261
- package/src/components/ui/field.tsx +0 -227
- package/src/components/ui/index.ts +0 -28
- package/src/components/ui/input-group.tsx +0 -149
- package/src/components/ui/label.tsx +0 -18
- package/src/components/ui/morphing-popover/index.ts +0 -10
- package/src/components/ui/morphing-popover/morphing-popover.tsx +0 -183
- package/src/components/ui/select.tsx +0 -190
- package/src/components/ui/separator.tsx +0 -25
- package/src/components/ui/switch.tsx +0 -9
- package/src/components/ui/tabs.tsx +0 -9
- package/src/hooks/use-is-in-view.tsx +0 -25
- package/src/icons/index.ts +0 -12
- package/src/icons/lucide-animated/index.ts +0 -38
- /package/dist/{components/ui/morphing-popover/morphing-popover.module-yxDDcJHZ.css → react/components/MorphingPopover/morphing-popover.module-BkcZcmVy.css} +0 -0
- /package/dist/{icons → react/icons}/index.js +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/check.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/edit-2.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/globe.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/index.js +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/layers.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/package.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/palette.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/refresh-cw.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/rocket.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/save.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/trash-2.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/type.d.ts +0 -0
- /package/dist/{icons → react/icons}/lucide-animated/upload.d.ts +0 -0
- /package/src/{components/ui/morphing-popover → react/components/MorphingPopover}/morphing-popover.module.css +0 -0
- /package/src/{icons → react/icons}/lucide-animated/arrow-down-to-line.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/arrow-up.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/check.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/edit-2.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/globe.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/layers.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/list.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/package.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/palette.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/refresh-cw.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/rocket.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/save.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/terminal.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/trash-2.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/type.tsx +0 -0
- /package/src/{icons → react/icons}/lucide-animated/upload.tsx +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
5
|
+
|
|
6
|
+
import { cn } from '@/react/lib/utils';
|
|
7
|
+
import { HugeiconsIcon } from '@hugeicons/react';
|
|
8
|
+
import { ArrowRight01Icon, Tick02Icon } from '@hugeicons/core-free-icons';
|
|
9
|
+
import { dropdownMenuStyles } from './DropdownMenu.styles';
|
|
10
|
+
import type {
|
|
11
|
+
IDropdownMenuProps,
|
|
12
|
+
IDropdownMenuPortalProps,
|
|
13
|
+
IDropdownMenuTriggerProps,
|
|
14
|
+
IDropdownMenuContentProps,
|
|
15
|
+
IDropdownMenuGroupProps,
|
|
16
|
+
IDropdownMenuLabelProps,
|
|
17
|
+
IDropdownMenuItemProps,
|
|
18
|
+
IDropdownMenuSubProps,
|
|
19
|
+
IDropdownMenuSubTriggerProps,
|
|
20
|
+
IDropdownMenuCheckboxItemProps,
|
|
21
|
+
IDropdownMenuRadioGroupProps,
|
|
22
|
+
IDropdownMenuRadioItemProps,
|
|
23
|
+
IDropdownMenuSeparatorProps,
|
|
24
|
+
IDropdownMenuShortcutProps,
|
|
25
|
+
} from './DropdownMenu.types';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* DropdownMenu — context menu built on Base UI Menu primitive.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <DropdownMenu>
|
|
33
|
+
* <DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
34
|
+
* <DropdownMenuContent>
|
|
35
|
+
* <DropdownMenuItem>Item 1</DropdownMenuItem>
|
|
36
|
+
* <DropdownMenuSeparator />
|
|
37
|
+
* <DropdownMenuItem variant="destructive">Delete</DropdownMenuItem>
|
|
38
|
+
* </DropdownMenuContent>
|
|
39
|
+
* </DropdownMenu>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
function DropdownMenu({ ...props }: IDropdownMenuProps) {
|
|
43
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** DropdownMenuPortal — renders dropdown content in a portal. */
|
|
47
|
+
function DropdownMenuPortal({ ...props }: IDropdownMenuPortalProps) {
|
|
48
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** DropdownMenuTrigger — element that opens the dropdown. */
|
|
52
|
+
function DropdownMenuTrigger({ ...props }: IDropdownMenuTriggerProps) {
|
|
53
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** DropdownMenuContent — popup content area for the dropdown. */
|
|
57
|
+
function DropdownMenuContent({
|
|
58
|
+
align = 'start',
|
|
59
|
+
alignOffset = 0,
|
|
60
|
+
side = 'bottom',
|
|
61
|
+
sideOffset = 4,
|
|
62
|
+
className,
|
|
63
|
+
slots,
|
|
64
|
+
...props
|
|
65
|
+
}: IDropdownMenuContentProps) {
|
|
66
|
+
return (
|
|
67
|
+
<MenuPrimitive.Portal>
|
|
68
|
+
<MenuPrimitive.Positioner
|
|
69
|
+
className="isolate z-50 outline-none"
|
|
70
|
+
align={align}
|
|
71
|
+
alignOffset={alignOffset}
|
|
72
|
+
side={side}
|
|
73
|
+
sideOffset={sideOffset}
|
|
74
|
+
>
|
|
75
|
+
<MenuPrimitive.Popup
|
|
76
|
+
data-slot="dropdown-menu-content"
|
|
77
|
+
className={cn(dropdownMenuStyles.content, slots?.content, className)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
</MenuPrimitive.Positioner>
|
|
81
|
+
</MenuPrimitive.Portal>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** DropdownMenuGroup — groups related menu items. */
|
|
86
|
+
function DropdownMenuGroup({ ...props }: IDropdownMenuGroupProps) {
|
|
87
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** DropdownMenuLabel — label for a group of menu items. */
|
|
91
|
+
function DropdownMenuLabel({
|
|
92
|
+
className,
|
|
93
|
+
inset,
|
|
94
|
+
...props
|
|
95
|
+
}: IDropdownMenuLabelProps) {
|
|
96
|
+
return (
|
|
97
|
+
<MenuPrimitive.GroupLabel
|
|
98
|
+
data-slot="dropdown-menu-label"
|
|
99
|
+
data-inset={inset}
|
|
100
|
+
className={cn(dropdownMenuStyles.label, className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** DropdownMenuItem — a single selectable menu item. */
|
|
107
|
+
function DropdownMenuItem({
|
|
108
|
+
className,
|
|
109
|
+
inset,
|
|
110
|
+
variant = 'default',
|
|
111
|
+
...props
|
|
112
|
+
}: IDropdownMenuItemProps) {
|
|
113
|
+
return (
|
|
114
|
+
<MenuPrimitive.Item
|
|
115
|
+
data-slot="dropdown-menu-item"
|
|
116
|
+
data-inset={inset}
|
|
117
|
+
data-variant={variant}
|
|
118
|
+
className={cn(dropdownMenuStyles.item, className)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** DropdownMenuSub — submenu root. */
|
|
125
|
+
function DropdownMenuSub({ ...props }: IDropdownMenuSubProps) {
|
|
126
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** DropdownMenuSubTrigger — trigger for opening a submenu. */
|
|
130
|
+
function DropdownMenuSubTrigger({
|
|
131
|
+
className,
|
|
132
|
+
inset,
|
|
133
|
+
children,
|
|
134
|
+
...props
|
|
135
|
+
}: IDropdownMenuSubTriggerProps) {
|
|
136
|
+
return (
|
|
137
|
+
<MenuPrimitive.SubmenuTrigger
|
|
138
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
139
|
+
data-inset={inset}
|
|
140
|
+
className={cn(dropdownMenuStyles.subTrigger, className)}
|
|
141
|
+
{...props}
|
|
142
|
+
>
|
|
143
|
+
{children}
|
|
144
|
+
<HugeiconsIcon icon={ArrowRight01Icon} strokeWidth={2} className="ml-auto" />
|
|
145
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** DropdownMenuSubContent — content area for a submenu. */
|
|
150
|
+
function DropdownMenuSubContent({
|
|
151
|
+
align = 'start',
|
|
152
|
+
alignOffset = -3,
|
|
153
|
+
side = 'right',
|
|
154
|
+
sideOffset = 0,
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
158
|
+
return (
|
|
159
|
+
<DropdownMenuContent
|
|
160
|
+
data-slot="dropdown-menu-sub-content"
|
|
161
|
+
className={cn(dropdownMenuStyles.subContent, className)}
|
|
162
|
+
align={align}
|
|
163
|
+
alignOffset={alignOffset}
|
|
164
|
+
side={side}
|
|
165
|
+
sideOffset={sideOffset}
|
|
166
|
+
{...props}
|
|
167
|
+
/>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** DropdownMenuCheckboxItem — menu item with checkbox behavior. */
|
|
172
|
+
function DropdownMenuCheckboxItem({
|
|
173
|
+
className,
|
|
174
|
+
children,
|
|
175
|
+
checked,
|
|
176
|
+
inset,
|
|
177
|
+
...props
|
|
178
|
+
}: IDropdownMenuCheckboxItemProps) {
|
|
179
|
+
return (
|
|
180
|
+
<MenuPrimitive.CheckboxItem
|
|
181
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
182
|
+
data-inset={inset}
|
|
183
|
+
className={cn(dropdownMenuStyles.checkboxItem, className)}
|
|
184
|
+
checked={checked}
|
|
185
|
+
{...props}
|
|
186
|
+
>
|
|
187
|
+
<span
|
|
188
|
+
className="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
189
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
190
|
+
>
|
|
191
|
+
<MenuPrimitive.CheckboxItemIndicator>
|
|
192
|
+
<HugeiconsIcon icon={Tick02Icon} strokeWidth={2} />
|
|
193
|
+
</MenuPrimitive.CheckboxItemIndicator>
|
|
194
|
+
</span>
|
|
195
|
+
{children}
|
|
196
|
+
</MenuPrimitive.CheckboxItem>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** DropdownMenuRadioGroup — groups radio items. */
|
|
201
|
+
function DropdownMenuRadioGroup({ ...props }: IDropdownMenuRadioGroupProps) {
|
|
202
|
+
return (
|
|
203
|
+
<MenuPrimitive.RadioGroup
|
|
204
|
+
data-slot="dropdown-menu-radio-group"
|
|
205
|
+
{...props}
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** DropdownMenuRadioItem — menu item with radio behavior. */
|
|
211
|
+
function DropdownMenuRadioItem({
|
|
212
|
+
className,
|
|
213
|
+
children,
|
|
214
|
+
inset,
|
|
215
|
+
...props
|
|
216
|
+
}: IDropdownMenuRadioItemProps) {
|
|
217
|
+
return (
|
|
218
|
+
<MenuPrimitive.RadioItem
|
|
219
|
+
data-slot="dropdown-menu-radio-item"
|
|
220
|
+
data-inset={inset}
|
|
221
|
+
className={cn(dropdownMenuStyles.radioItem, className)}
|
|
222
|
+
{...props}
|
|
223
|
+
>
|
|
224
|
+
<span
|
|
225
|
+
className="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
226
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
227
|
+
>
|
|
228
|
+
<MenuPrimitive.RadioItemIndicator>
|
|
229
|
+
<HugeiconsIcon icon={Tick02Icon} strokeWidth={2} />
|
|
230
|
+
</MenuPrimitive.RadioItemIndicator>
|
|
231
|
+
</span>
|
|
232
|
+
{children}
|
|
233
|
+
</MenuPrimitive.RadioItem>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** DropdownMenuSeparator — visual divider between menu items. */
|
|
238
|
+
function DropdownMenuSeparator({
|
|
239
|
+
className,
|
|
240
|
+
...props
|
|
241
|
+
}: IDropdownMenuSeparatorProps) {
|
|
242
|
+
return (
|
|
243
|
+
<MenuPrimitive.Separator
|
|
244
|
+
data-slot="dropdown-menu-separator"
|
|
245
|
+
className={cn(dropdownMenuStyles.separator, className)}
|
|
246
|
+
{...props}
|
|
247
|
+
/>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** DropdownMenuShortcut — keyboard shortcut hint text. */
|
|
252
|
+
function DropdownMenuShortcut({
|
|
253
|
+
className,
|
|
254
|
+
...props
|
|
255
|
+
}: IDropdownMenuShortcutProps) {
|
|
256
|
+
return (
|
|
257
|
+
<span
|
|
258
|
+
data-slot="dropdown-menu-shortcut"
|
|
259
|
+
className={cn(dropdownMenuStyles.shortcut, className)}
|
|
260
|
+
{...props}
|
|
261
|
+
/>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
DropdownMenu,
|
|
267
|
+
DropdownMenuPortal,
|
|
268
|
+
DropdownMenuTrigger,
|
|
269
|
+
DropdownMenuContent,
|
|
270
|
+
DropdownMenuGroup,
|
|
271
|
+
DropdownMenuLabel,
|
|
272
|
+
DropdownMenuItem,
|
|
273
|
+
DropdownMenuCheckboxItem,
|
|
274
|
+
DropdownMenuRadioGroup,
|
|
275
|
+
DropdownMenuRadioItem,
|
|
276
|
+
DropdownMenuSeparator,
|
|
277
|
+
DropdownMenuShortcut,
|
|
278
|
+
DropdownMenuSub,
|
|
279
|
+
DropdownMenuSubTrigger,
|
|
280
|
+
DropdownMenuSubContent,
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export type {
|
|
284
|
+
IDropdownMenuProps,
|
|
285
|
+
IDropdownMenuPortalProps,
|
|
286
|
+
IDropdownMenuTriggerProps,
|
|
287
|
+
IDropdownMenuContentProps,
|
|
288
|
+
IDropdownMenuGroupProps,
|
|
289
|
+
IDropdownMenuLabelProps,
|
|
290
|
+
IDropdownMenuItemProps,
|
|
291
|
+
IDropdownMenuSubProps,
|
|
292
|
+
IDropdownMenuSubTriggerProps,
|
|
293
|
+
IDropdownMenuCheckboxItemProps,
|
|
294
|
+
IDropdownMenuRadioGroupProps,
|
|
295
|
+
IDropdownMenuRadioItemProps,
|
|
296
|
+
IDropdownMenuSeparatorProps,
|
|
297
|
+
IDropdownMenuShortcutProps,
|
|
298
|
+
} from './DropdownMenu.types';
|
|
299
|
+
|
|
300
|
+
export type { DropdownMenuSlot } from './DropdownMenu.styles';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import type { StyleSlots } from '@/core/types';
|
|
3
|
+
|
|
4
|
+
/** Visual regions for the Field component family. */
|
|
5
|
+
type FieldSlot =
|
|
6
|
+
| 'root'
|
|
7
|
+
| 'set'
|
|
8
|
+
| 'legend'
|
|
9
|
+
| 'group'
|
|
10
|
+
| 'content'
|
|
11
|
+
| 'label'
|
|
12
|
+
| 'title'
|
|
13
|
+
| 'description'
|
|
14
|
+
| 'separator'
|
|
15
|
+
| 'error';
|
|
16
|
+
|
|
17
|
+
const fieldStyles: StyleSlots<FieldSlot> = {
|
|
18
|
+
root: 'data-[invalid=true]:text-destructive gap-2 group/field flex w-full',
|
|
19
|
+
set: 'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col',
|
|
20
|
+
legend: 'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base',
|
|
21
|
+
group: 'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',
|
|
22
|
+
content: 'gap-0.5 group/field-content flex flex-1 flex-col leading-snug',
|
|
23
|
+
label: 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 group/field-label peer/field-label flex w-fit leading-snug has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
24
|
+
title: 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',
|
|
25
|
+
description: 'text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
|
26
|
+
separator: '-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative',
|
|
27
|
+
error: 'text-destructive text-sm font-normal',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** CVA variants for the Field root orientation. */
|
|
31
|
+
const fieldVariants = cva(fieldStyles.root, {
|
|
32
|
+
variants: {
|
|
33
|
+
orientation: {
|
|
34
|
+
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
35
|
+
horizontal:
|
|
36
|
+
'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
37
|
+
responsive:
|
|
38
|
+
'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
orientation: 'vertical',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { fieldStyles, fieldVariants };
|
|
47
|
+
export type { FieldSlot };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { SlotOverrides } from '@/core/types';
|
|
3
|
+
import type { fieldVariants, FieldSlot } from './Field.styles';
|
|
4
|
+
|
|
5
|
+
/** Props for the FieldSet component. */
|
|
6
|
+
interface IFieldSetProps extends React.ComponentProps<'fieldset'> {
|
|
7
|
+
slots?: SlotOverrides<FieldSlot>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Props for the FieldLegend component. */
|
|
11
|
+
interface IFieldLegendProps extends React.ComponentProps<'legend'> {
|
|
12
|
+
/** Legend display variant. */
|
|
13
|
+
variant?: 'legend' | 'label';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Props for the FieldGroup component. */
|
|
17
|
+
type IFieldGroupProps = React.ComponentProps<'div'>;
|
|
18
|
+
|
|
19
|
+
/** Props for the Field component. */
|
|
20
|
+
interface IFieldProps
|
|
21
|
+
extends React.ComponentProps<'div'>,
|
|
22
|
+
VariantProps<typeof fieldVariants> {
|
|
23
|
+
slots?: SlotOverrides<FieldSlot>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Props for the FieldContent component. */
|
|
27
|
+
type IFieldContentProps = React.ComponentProps<'div'>;
|
|
28
|
+
|
|
29
|
+
/** Props for the FieldLabel component. */
|
|
30
|
+
type IFieldLabelProps = React.ComponentProps<'label'>;
|
|
31
|
+
|
|
32
|
+
/** Props for the FieldTitle component. */
|
|
33
|
+
type IFieldTitleProps = React.ComponentProps<'div'>;
|
|
34
|
+
|
|
35
|
+
/** Props for the FieldDescription component. */
|
|
36
|
+
type IFieldDescriptionProps = React.ComponentProps<'p'>;
|
|
37
|
+
|
|
38
|
+
/** Props for the FieldSeparator component. */
|
|
39
|
+
interface IFieldSeparatorProps extends React.ComponentProps<'div'> {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Props for the FieldError component. */
|
|
44
|
+
interface IFieldErrorProps extends React.ComponentProps<'div'> {
|
|
45
|
+
/** Array of error objects to display. */
|
|
46
|
+
errors?: Array<{ message?: string } | undefined>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type {
|
|
50
|
+
IFieldSetProps,
|
|
51
|
+
IFieldLegendProps,
|
|
52
|
+
IFieldGroupProps,
|
|
53
|
+
IFieldProps,
|
|
54
|
+
IFieldContentProps,
|
|
55
|
+
IFieldLabelProps,
|
|
56
|
+
IFieldTitleProps,
|
|
57
|
+
IFieldDescriptionProps,
|
|
58
|
+
IFieldSeparatorProps,
|
|
59
|
+
IFieldErrorProps,
|
|
60
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/react/lib/utils';
|
|
6
|
+
import { Label } from '@/react/ui/Label';
|
|
7
|
+
import { Separator } from '@/react/ui/Separator';
|
|
8
|
+
import { fieldStyles, fieldVariants } from './Field.styles';
|
|
9
|
+
import type {
|
|
10
|
+
IFieldSetProps,
|
|
11
|
+
IFieldLegendProps,
|
|
12
|
+
IFieldGroupProps,
|
|
13
|
+
IFieldProps,
|
|
14
|
+
IFieldContentProps,
|
|
15
|
+
IFieldLabelProps,
|
|
16
|
+
IFieldTitleProps,
|
|
17
|
+
IFieldDescriptionProps,
|
|
18
|
+
IFieldSeparatorProps,
|
|
19
|
+
IFieldErrorProps,
|
|
20
|
+
} from './Field.types';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* FieldSet — groups related form fields.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <FieldSet>
|
|
28
|
+
* <Field><FieldLabel>Name</FieldLabel></Field>
|
|
29
|
+
* </FieldSet>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function FieldSet({ className, ...props }: IFieldSetProps) {
|
|
33
|
+
return (
|
|
34
|
+
<fieldset
|
|
35
|
+
data-slot="field-set"
|
|
36
|
+
className={cn(fieldStyles.set, className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** FieldLegend — legend element for a FieldSet. */
|
|
43
|
+
function FieldLegend({
|
|
44
|
+
className,
|
|
45
|
+
variant = 'legend',
|
|
46
|
+
...props
|
|
47
|
+
}: IFieldLegendProps) {
|
|
48
|
+
return (
|
|
49
|
+
<legend
|
|
50
|
+
data-slot="field-legend"
|
|
51
|
+
data-variant={variant}
|
|
52
|
+
className={cn(fieldStyles.legend, className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** FieldGroup — vertical grouping container for fields. */
|
|
59
|
+
function FieldGroup({ className, ...props }: IFieldGroupProps) {
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
data-slot="field-group"
|
|
63
|
+
className={cn(fieldStyles.group, className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Field — form field container with orientation variants.
|
|
71
|
+
*
|
|
72
|
+
* @param orientation - Layout direction: 'vertical', 'horizontal', 'responsive'
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Field orientation="horizontal">
|
|
77
|
+
* <FieldLabel>Email</FieldLabel>
|
|
78
|
+
* <Input type="email" />
|
|
79
|
+
* </Field>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
function Field({
|
|
83
|
+
className,
|
|
84
|
+
orientation = 'vertical',
|
|
85
|
+
...props
|
|
86
|
+
}: IFieldProps) {
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
role="group"
|
|
90
|
+
data-slot="field"
|
|
91
|
+
data-orientation={orientation}
|
|
92
|
+
className={cn(fieldVariants({ orientation }), className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** FieldContent — content wrapper inside a field. */
|
|
99
|
+
function FieldContent({ className, ...props }: IFieldContentProps) {
|
|
100
|
+
return (
|
|
101
|
+
<div
|
|
102
|
+
data-slot="field-content"
|
|
103
|
+
className={cn(fieldStyles.content, className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** FieldLabel — styled label using the Label component. */
|
|
110
|
+
function FieldLabel({ className, ...props }: IFieldLabelProps) {
|
|
111
|
+
return (
|
|
112
|
+
<Label
|
|
113
|
+
data-slot="field-label"
|
|
114
|
+
className={cn(fieldStyles.label, className)}
|
|
115
|
+
{...props}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** FieldTitle — alternative title display for a field. */
|
|
121
|
+
function FieldTitle({ className, ...props }: IFieldTitleProps) {
|
|
122
|
+
return (
|
|
123
|
+
<div
|
|
124
|
+
data-slot="field-label"
|
|
125
|
+
className={cn(fieldStyles.title, className)}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** FieldDescription — helper text for a field. */
|
|
132
|
+
function FieldDescription({ className, ...props }: IFieldDescriptionProps) {
|
|
133
|
+
return (
|
|
134
|
+
<p
|
|
135
|
+
data-slot="field-description"
|
|
136
|
+
className={cn(fieldStyles.description, className)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** FieldSeparator — divider between fields with optional text content. */
|
|
143
|
+
function FieldSeparator({
|
|
144
|
+
children,
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}: IFieldSeparatorProps) {
|
|
148
|
+
return (
|
|
149
|
+
<div
|
|
150
|
+
data-slot="field-separator"
|
|
151
|
+
data-content={!!children}
|
|
152
|
+
className={cn(fieldStyles.separator, className)}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<Separator className="absolute inset-0 top-1/2" />
|
|
156
|
+
{children && (
|
|
157
|
+
<span
|
|
158
|
+
className="text-muted-foreground px-2 bg-background relative mx-auto block w-fit"
|
|
159
|
+
data-slot="field-separator-content"
|
|
160
|
+
>
|
|
161
|
+
{children}
|
|
162
|
+
</span>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* FieldError — displays validation errors for a field.
|
|
170
|
+
*
|
|
171
|
+
* @param errors - Array of error objects with message property
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```tsx
|
|
175
|
+
* <FieldError errors={[{ message: 'Required field' }]} />
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
function FieldError({
|
|
179
|
+
className,
|
|
180
|
+
children,
|
|
181
|
+
errors,
|
|
182
|
+
...props
|
|
183
|
+
}: IFieldErrorProps) {
|
|
184
|
+
const content = useMemo(() => {
|
|
185
|
+
if (children) {
|
|
186
|
+
return children;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (!errors?.length) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const uniqueErrors = [
|
|
194
|
+
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
if (uniqueErrors?.length == 1) {
|
|
198
|
+
return uniqueErrors[0]?.message;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
203
|
+
{uniqueErrors.map(
|
|
204
|
+
(error, index) =>
|
|
205
|
+
error?.message && <li key={index}>{error.message}</li>,
|
|
206
|
+
)}
|
|
207
|
+
</ul>
|
|
208
|
+
);
|
|
209
|
+
}, [children, errors]);
|
|
210
|
+
|
|
211
|
+
if (!content) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<div
|
|
217
|
+
role="alert"
|
|
218
|
+
data-slot="field-error"
|
|
219
|
+
className={cn(fieldStyles.error, className)}
|
|
220
|
+
{...props}
|
|
221
|
+
>
|
|
222
|
+
{content}
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export {
|
|
228
|
+
Field,
|
|
229
|
+
FieldLabel,
|
|
230
|
+
FieldDescription,
|
|
231
|
+
FieldError,
|
|
232
|
+
FieldGroup,
|
|
233
|
+
FieldLegend,
|
|
234
|
+
FieldSeparator,
|
|
235
|
+
FieldSet,
|
|
236
|
+
FieldContent,
|
|
237
|
+
FieldTitle,
|
|
238
|
+
fieldVariants,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export type {
|
|
242
|
+
IFieldSetProps,
|
|
243
|
+
IFieldLegendProps,
|
|
244
|
+
IFieldGroupProps,
|
|
245
|
+
IFieldProps,
|
|
246
|
+
IFieldContentProps,
|
|
247
|
+
IFieldLabelProps,
|
|
248
|
+
IFieldTitleProps,
|
|
249
|
+
IFieldDescriptionProps,
|
|
250
|
+
IFieldSeparatorProps,
|
|
251
|
+
IFieldErrorProps,
|
|
252
|
+
} from './Field.types';
|
|
253
|
+
|
|
254
|
+
export type { FieldSlot } from './Field.styles';
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Input as InputPrimitive } from "@base-ui/react/input"
|
|
1
|
+
import type { StyleSlots } from '@/core/types';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
/** Visual regions for the Input component. */
|
|
4
|
+
type InputSlot = 'root';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type={type}
|
|
10
|
-
data-slot="input"
|
|
11
|
-
className={cn(
|
|
12
|
-
"dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
6
|
+
const inputStyles: StyleSlots<InputSlot> = {
|
|
7
|
+
root: 'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
8
|
+
};
|
|
19
9
|
|
|
20
|
-
export {
|
|
10
|
+
export { inputStyles };
|
|
11
|
+
export type { InputSlot };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SlotOverrides } from '@/core/types';
|
|
2
|
+
import type { InputSlot } from './Input.styles';
|
|
3
|
+
|
|
4
|
+
/** Props for the Input component. */
|
|
5
|
+
interface IInputProps extends React.ComponentProps<'input'> {
|
|
6
|
+
/** Override classes for input visual regions. */
|
|
7
|
+
slots?: SlotOverrides<InputSlot>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { IInputProps };
|