@mks2508/mks-ui 0.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/README.md +73 -0
- package/dist/components/animate-ui/primitives/animate/slot.d.ts +18 -0
- package/dist/components/animate-ui/primitives/animate/slot.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/animate/slot.js +47 -0
- package/dist/components/animate-ui/primitives/animate/slot.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/accordion.d.ts +22 -0
- package/dist/components/animate-ui/primitives/base/accordion.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/accordion.js +52 -0
- package/dist/components/animate-ui/primitives/base/accordion.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/alert-dialog.d.ts +33 -0
- package/dist/components/animate-ui/primitives/base/alert-dialog.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/alert-dialog.js +60 -0
- package/dist/components/animate-ui/primitives/base/alert-dialog.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/checkbox.d.ts +15 -0
- package/dist/components/animate-ui/primitives/base/checkbox.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/checkbox.js +41 -0
- package/dist/components/animate-ui/primitives/base/checkbox.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/dialog.d.ts +33 -0
- package/dist/components/animate-ui/primitives/base/dialog.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/dialog.js +60 -0
- package/dist/components/animate-ui/primitives/base/dialog.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/menu.d.ts +60 -0
- package/dist/components/animate-ui/primitives/base/menu.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/menu.js +122 -0
- package/dist/components/animate-ui/primitives/base/menu.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/popover.d.ts +30 -0
- package/dist/components/animate-ui/primitives/base/popover.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/popover.js +45 -0
- package/dist/components/animate-ui/primitives/base/popover.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/progress.d.ts +297 -0
- package/dist/components/animate-ui/primitives/base/progress.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/progress.js +27 -0
- package/dist/components/animate-ui/primitives/base/progress.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/switch.d.ts +23 -0
- package/dist/components/animate-ui/primitives/base/switch.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/switch.js +36 -0
- package/dist/components/animate-ui/primitives/base/switch.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/tabs.d.ts +33 -0
- package/dist/components/animate-ui/primitives/base/tabs.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/tabs.js +53 -0
- package/dist/components/animate-ui/primitives/base/tabs.js.map +1 -0
- package/dist/components/animate-ui/primitives/base/tooltip.d.ts +31 -0
- package/dist/components/animate-ui/primitives/base/tooltip.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/base/tooltip.js +71 -0
- package/dist/components/animate-ui/primitives/base/tooltip.js.map +1 -0
- package/dist/components/animate-ui/primitives/effects/auto-height.d.ts +12 -0
- package/dist/components/animate-ui/primitives/effects/auto-height.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/effects/auto-height.js +18 -0
- package/dist/components/animate-ui/primitives/effects/auto-height.js.map +1 -0
- package/dist/components/animate-ui/primitives/effects/highlight.d.ts +92 -0
- package/dist/components/animate-ui/primitives/effects/highlight.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/effects/highlight.js +315 -0
- package/dist/components/animate-ui/primitives/effects/highlight.js.map +1 -0
- package/dist/components/animate-ui/primitives/texts/counting-number.d.ts +16 -0
- package/dist/components/animate-ui/primitives/texts/counting-number.d.ts.map +1 -0
- package/dist/components/animate-ui/primitives/texts/counting-number.js +69 -0
- package/dist/components/animate-ui/primitives/texts/counting-number.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +43 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/badge/badge.d.ts +37 -0
- package/dist/components/ui/badge/badge.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.js +40 -0
- package/dist/components/ui/badge/badge.js.map +1 -0
- package/dist/components/ui/badge/badge.styles.d.ts +23 -0
- package/dist/components/ui/badge/badge.styles.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.styles.js +39 -0
- package/dist/components/ui/badge/badge.styles.js.map +1 -0
- package/dist/components/ui/badge/badge.types.d.ts +38 -0
- package/dist/components/ui/badge/badge.types.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.types.js +2 -0
- package/dist/components/ui/badge/badge.types.js.map +1 -0
- package/dist/components/ui/badge/index.d.ts +8 -0
- package/dist/components/ui/badge/index.d.ts.map +1 -0
- package/dist/components/ui/badge/index.js +7 -0
- package/dist/components/ui/badge/index.js.map +1 -0
- package/dist/components/ui/button/button.d.ts +79 -0
- package/dist/components/ui/button/button.d.ts.map +1 -0
- package/dist/components/ui/button/button.js +121 -0
- package/dist/components/ui/button/button.js.map +1 -0
- package/dist/components/ui/button/button.styles.d.ts +33 -0
- package/dist/components/ui/button/button.styles.d.ts.map +1 -0
- package/dist/components/ui/button/button.styles.js +54 -0
- package/dist/components/ui/button/button.styles.js.map +1 -0
- package/dist/components/ui/button/button.types.d.ts +103 -0
- package/dist/components/ui/button/button.types.d.ts.map +1 -0
- package/dist/components/ui/button/button.types.js +2 -0
- package/dist/components/ui/button/button.types.js.map +1 -0
- package/dist/components/ui/button/index.d.ts +7 -0
- package/dist/components/ui/button/index.d.ts.map +1 -0
- package/dist/components/ui/button/index.js +7 -0
- package/dist/components/ui/button/index.js.map +1 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +38 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +62 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/devenv-bracket.d.ts +30 -0
- package/dist/components/ui/devenv-bracket.d.ts.map +1 -0
- package/dist/components/ui/devenv-bracket.js +49 -0
- package/dist/components/ui/devenv-bracket.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +53 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +69 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/index.d.ts +23 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +25 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +58 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +8 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +7 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/morphing-popover/index.d.ts +10 -0
- package/dist/components/ui/morphing-popover/index.d.ts.map +1 -0
- package/dist/components/ui/morphing-popover/index.js +9 -0
- package/dist/components/ui/morphing-popover/index.js.map +1 -0
- package/dist/components/ui/morphing-popover/morphing-popover.d.ts +54 -0
- package/dist/components/ui/morphing-popover/morphing-popover.d.ts.map +1 -0
- package/dist/components/ui/morphing-popover/morphing-popover.js +50 -0
- package/dist/components/ui/morphing-popover/morphing-popover.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +35 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +9 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +7 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/hooks/use-auto-height.d.ts +11 -0
- package/dist/hooks/use-auto-height.d.ts.map +1 -0
- package/dist/hooks/use-auto-height.js +75 -0
- package/dist/hooks/use-auto-height.js.map +1 -0
- package/dist/hooks/use-controlled-state.d.ts +9 -0
- package/dist/hooks/use-controlled-state.d.ts.map +1 -0
- package/dist/hooks/use-controlled-state.js +16 -0
- package/dist/hooks/use-controlled-state.js.map +1 -0
- package/dist/hooks/use-data-state.d.ts +5 -0
- package/dist/hooks/use-data-state.d.ts.map +1 -0
- package/dist/hooks/use-data-state.js +45 -0
- package/dist/hooks/use-data-state.js.map +1 -0
- package/dist/hooks/use-is-in-view.d.ts +13 -0
- package/dist/hooks/use-is-in-view.d.ts.map +1 -0
- package/dist/hooks/use-is-in-view.js +15 -0
- package/dist/hooks/use-is-in-view.js.map +1 -0
- package/dist/icons/index.d.ts +8 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/lucide-animated/activity.d.ts +11 -0
- package/dist/icons/lucide-animated/activity.d.ts.map +1 -0
- package/dist/icons/lucide-animated/activity.js +57 -0
- package/dist/icons/lucide-animated/activity.js.map +1 -0
- package/dist/icons/lucide-animated/arrow-down-to-line.d.ts +23 -0
- package/dist/icons/lucide-animated/arrow-down-to-line.d.ts.map +1 -0
- package/dist/icons/lucide-animated/arrow-down-to-line.js +23 -0
- package/dist/icons/lucide-animated/arrow-down-to-line.js.map +1 -0
- package/dist/icons/lucide-animated/arrow-up.d.ts +23 -0
- package/dist/icons/lucide-animated/arrow-up.d.ts.map +1 -0
- package/dist/icons/lucide-animated/arrow-up.js +23 -0
- package/dist/icons/lucide-animated/arrow-up.js.map +1 -0
- package/dist/icons/lucide-animated/bell-electric.d.ts +11 -0
- package/dist/icons/lucide-animated/bell-electric.d.ts.map +1 -0
- package/dist/icons/lucide-animated/bell-electric.js +58 -0
- package/dist/icons/lucide-animated/bell-electric.js.map +1 -0
- package/dist/icons/lucide-animated/bell.d.ts +11 -0
- package/dist/icons/lucide-animated/bell.d.ts.map +1 -0
- package/dist/icons/lucide-animated/bell.js +43 -0
- package/dist/icons/lucide-animated/bell.js.map +1 -0
- package/dist/icons/lucide-animated/bot.d.ts +11 -0
- package/dist/icons/lucide-animated/bot.d.ts.map +1 -0
- package/dist/icons/lucide-animated/bot.js +58 -0
- package/dist/icons/lucide-animated/bot.js.map +1 -0
- package/dist/icons/lucide-animated/box.d.ts +11 -0
- package/dist/icons/lucide-animated/box.d.ts.map +1 -0
- package/dist/icons/lucide-animated/box.js +54 -0
- package/dist/icons/lucide-animated/box.js.map +1 -0
- package/dist/icons/lucide-animated/check.d.ts +7 -0
- package/dist/icons/lucide-animated/check.d.ts.map +1 -0
- package/dist/icons/lucide-animated/check.js +10 -0
- package/dist/icons/lucide-animated/check.js.map +1 -0
- package/dist/icons/lucide-animated/circle-check.d.ts +11 -0
- package/dist/icons/lucide-animated/circle-check.d.ts.map +1 -0
- package/dist/icons/lucide-animated/circle-check.js +54 -0
- package/dist/icons/lucide-animated/circle-check.js.map +1 -0
- package/dist/icons/lucide-animated/delete.d.ts +11 -0
- package/dist/icons/lucide-animated/delete.d.ts.map +1 -0
- package/dist/icons/lucide-animated/delete.js +54 -0
- package/dist/icons/lucide-animated/delete.js.map +1 -0
- package/dist/icons/lucide-animated/download.d.ts +11 -0
- package/dist/icons/lucide-animated/download.d.ts.map +1 -0
- package/dist/icons/lucide-animated/download.js +48 -0
- package/dist/icons/lucide-animated/download.js.map +1 -0
- package/dist/icons/lucide-animated/edit-2.d.ts +7 -0
- package/dist/icons/lucide-animated/edit-2.d.ts.map +1 -0
- package/dist/icons/lucide-animated/edit-2.js +10 -0
- package/dist/icons/lucide-animated/edit-2.js.map +1 -0
- package/dist/icons/lucide-animated/globe.d.ts +7 -0
- package/dist/icons/lucide-animated/globe.d.ts.map +1 -0
- package/dist/icons/lucide-animated/globe.js +10 -0
- package/dist/icons/lucide-animated/globe.js.map +1 -0
- package/dist/icons/lucide-animated/home.d.ts +11 -0
- package/dist/icons/lucide-animated/home.d.ts.map +1 -0
- package/dist/icons/lucide-animated/home.js +50 -0
- package/dist/icons/lucide-animated/home.js.map +1 -0
- package/dist/icons/lucide-animated/index.d.ts +38 -0
- package/dist/icons/lucide-animated/index.d.ts.map +1 -0
- package/dist/icons/lucide-animated/index.js +38 -0
- package/dist/icons/lucide-animated/index.js.map +1 -0
- package/dist/icons/lucide-animated/layers.d.ts +7 -0
- package/dist/icons/lucide-animated/layers.d.ts.map +1 -0
- package/dist/icons/lucide-animated/layers.js +10 -0
- package/dist/icons/lucide-animated/layers.js.map +1 -0
- package/dist/icons/lucide-animated/layout-panel-top.d.ts +11 -0
- package/dist/icons/lucide-animated/layout-panel-top.d.ts.map +1 -0
- package/dist/icons/lucide-animated/layout-panel-top.js +68 -0
- package/dist/icons/lucide-animated/layout-panel-top.js.map +1 -0
- package/dist/icons/lucide-animated/list.d.ts +23 -0
- package/dist/icons/lucide-animated/list.d.ts.map +1 -0
- package/dist/icons/lucide-animated/list.js +23 -0
- package/dist/icons/lucide-animated/list.js.map +1 -0
- package/dist/icons/lucide-animated/package.d.ts +7 -0
- package/dist/icons/lucide-animated/package.d.ts.map +1 -0
- package/dist/icons/lucide-animated/package.js +10 -0
- package/dist/icons/lucide-animated/package.js.map +1 -0
- package/dist/icons/lucide-animated/palette.d.ts +7 -0
- package/dist/icons/lucide-animated/palette.d.ts.map +1 -0
- package/dist/icons/lucide-animated/palette.js +10 -0
- package/dist/icons/lucide-animated/palette.js.map +1 -0
- package/dist/icons/lucide-animated/plus.d.ts +11 -0
- package/dist/icons/lucide-animated/plus.d.ts.map +1 -0
- package/dist/icons/lucide-animated/plus.js +43 -0
- package/dist/icons/lucide-animated/plus.js.map +1 -0
- package/dist/icons/lucide-animated/refresh-cw.d.ts +7 -0
- package/dist/icons/lucide-animated/refresh-cw.d.ts.map +1 -0
- package/dist/icons/lucide-animated/refresh-cw.js +10 -0
- package/dist/icons/lucide-animated/refresh-cw.js.map +1 -0
- package/dist/icons/lucide-animated/rocket.d.ts +7 -0
- package/dist/icons/lucide-animated/rocket.d.ts.map +1 -0
- package/dist/icons/lucide-animated/rocket.js +10 -0
- package/dist/icons/lucide-animated/rocket.js.map +1 -0
- package/dist/icons/lucide-animated/save.d.ts +7 -0
- package/dist/icons/lucide-animated/save.d.ts.map +1 -0
- package/dist/icons/lucide-animated/save.js +10 -0
- package/dist/icons/lucide-animated/save.js.map +1 -0
- package/dist/icons/lucide-animated/search.d.ts +11 -0
- package/dist/icons/lucide-animated/search.d.ts.map +1 -0
- package/dist/icons/lucide-animated/search.js +45 -0
- package/dist/icons/lucide-animated/search.js.map +1 -0
- package/dist/icons/lucide-animated/settings.d.ts +11 -0
- package/dist/icons/lucide-animated/settings.d.ts.map +1 -0
- package/dist/icons/lucide-animated/settings.js +43 -0
- package/dist/icons/lucide-animated/settings.js.map +1 -0
- package/dist/icons/lucide-animated/terminal.d.ts +24 -0
- package/dist/icons/lucide-animated/terminal.d.ts.map +1 -0
- package/dist/icons/lucide-animated/terminal.js +5 -0
- package/dist/icons/lucide-animated/terminal.js.map +1 -0
- package/dist/icons/lucide-animated/trash-2.d.ts +7 -0
- package/dist/icons/lucide-animated/trash-2.d.ts.map +1 -0
- package/dist/icons/lucide-animated/trash-2.js +10 -0
- package/dist/icons/lucide-animated/trash-2.js.map +1 -0
- package/dist/icons/lucide-animated/trending-down.d.ts +11 -0
- package/dist/icons/lucide-animated/trending-down.d.ts.map +1 -0
- package/dist/icons/lucide-animated/trending-down.js +87 -0
- package/dist/icons/lucide-animated/trending-down.js.map +1 -0
- package/dist/icons/lucide-animated/trending-up.d.ts +11 -0
- package/dist/icons/lucide-animated/trending-up.d.ts.map +1 -0
- package/dist/icons/lucide-animated/trending-up.js +87 -0
- package/dist/icons/lucide-animated/trending-up.js.map +1 -0
- package/dist/icons/lucide-animated/type.d.ts +7 -0
- package/dist/icons/lucide-animated/type.d.ts.map +1 -0
- package/dist/icons/lucide-animated/type.js +10 -0
- package/dist/icons/lucide-animated/type.js.map +1 -0
- package/dist/icons/lucide-animated/upload.d.ts +7 -0
- package/dist/icons/lucide-animated/upload.d.ts.map +1 -0
- package/dist/icons/lucide-animated/upload.js +10 -0
- package/dist/icons/lucide-animated/upload.js.map +1 -0
- package/dist/icons/lucide-animated/x.d.ts +11 -0
- package/dist/icons/lucide-animated/x.d.ts.map +1 -0
- package/dist/icons/lucide-animated/x.js +46 -0
- package/dist/icons/lucide-animated/x.js.map +1 -0
- package/dist/index.css +129 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/get-strict-context.d.ts +10 -0
- package/dist/lib/get-strict-context.d.ts.map +1 -0
- package/dist/lib/get-strict-context.js +16 -0
- package/dist/lib/get-strict-context.js.map +1 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +23 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +84 -0
- package/src/assets/react.svg +1 -0
- package/src/components/animate-ui/primitives/animate/slot.tsx +96 -0
- package/src/components/animate-ui/primitives/base/accordion.tsx +179 -0
- package/src/components/animate-ui/primitives/base/alert-dialog.tsx +218 -0
- package/src/components/animate-ui/primitives/base/checkbox.tsx +153 -0
- package/src/components/animate-ui/primitives/base/dialog.tsx +203 -0
- package/src/components/animate-ui/primitives/base/menu.tsx +463 -0
- package/src/components/animate-ui/primitives/base/popover.tsx +167 -0
- package/src/components/animate-ui/primitives/base/progress.tsx +103 -0
- package/src/components/animate-ui/primitives/base/switch.tsx +158 -0
- package/src/components/animate-ui/primitives/base/tabs.tsx +202 -0
- package/src/components/animate-ui/primitives/base/tooltip.tsx +209 -0
- package/src/components/animate-ui/primitives/effects/auto-height.tsx +55 -0
- package/src/components/animate-ui/primitives/effects/highlight.tsx +640 -0
- package/src/components/animate-ui/primitives/texts/counting-number.tsx +119 -0
- package/src/components/ui/alert-dialog.tsx +177 -0
- package/src/components/ui/badge/badge.styles.ts +46 -0
- package/src/components/ui/badge/badge.tsx +52 -0
- package/src/components/ui/badge/badge.types.ts +41 -0
- package/src/components/ui/badge/index.ts +8 -0
- package/src/components/ui/button/button.styles.ts +66 -0
- package/src/components/ui/button/button.tsx +209 -0
- package/src/components/ui/button/button.types.ts +125 -0
- package/src/components/ui/button/index.ts +7 -0
- package/src/components/ui/card.tsx +108 -0
- package/src/components/ui/combobox.tsx +293 -0
- package/src/components/ui/devenv-bracket.tsx +81 -0
- package/src/components/ui/dropdown-menu.tsx +261 -0
- package/src/components/ui/field.tsx +227 -0
- package/src/components/ui/index.ts +26 -0
- package/src/components/ui/input-group.tsx +149 -0
- package/src/components/ui/input.tsx +20 -0
- package/src/components/ui/label.tsx +18 -0
- package/src/components/ui/morphing-popover/index.ts +10 -0
- package/src/components/ui/morphing-popover/morphing-popover.module.css +153 -0
- package/src/components/ui/morphing-popover/morphing-popover.tsx +183 -0
- package/src/components/ui/select.tsx +190 -0
- package/src/components/ui/separator.tsx +25 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/hooks/use-auto-height.tsx +102 -0
- package/src/hooks/use-controlled-state.tsx +33 -0
- package/src/hooks/use-data-state.tsx +54 -0
- package/src/hooks/use-is-in-view.tsx +25 -0
- package/src/icons/index.ts +12 -0
- package/src/icons/lucide-animated/activity.tsx +109 -0
- package/src/icons/lucide-animated/arrow-down-to-line.tsx +51 -0
- package/src/icons/lucide-animated/arrow-up.tsx +50 -0
- package/src/icons/lucide-animated/bell-electric.tsx +124 -0
- package/src/icons/lucide-animated/bell.tsx +93 -0
- package/src/icons/lucide-animated/bot.tsx +122 -0
- package/src/icons/lucide-animated/box.tsx +117 -0
- package/src/icons/lucide-animated/check.tsx +21 -0
- package/src/icons/lucide-animated/circle-check.tsx +107 -0
- package/src/icons/lucide-animated/delete.tsx +133 -0
- package/src/icons/lucide-animated/download.tsx +99 -0
- package/src/icons/lucide-animated/edit-2.tsx +21 -0
- package/src/icons/lucide-animated/globe.tsx +23 -0
- package/src/icons/lucide-animated/home.tsx +103 -0
- package/src/icons/lucide-animated/index.ts +38 -0
- package/src/icons/lucide-animated/layers.tsx +23 -0
- package/src/icons/lucide-animated/layout-panel-top.tsx +143 -0
- package/src/icons/lucide-animated/list.tsx +54 -0
- package/src/icons/lucide-animated/package.tsx +24 -0
- package/src/icons/lucide-animated/palette.tsx +25 -0
- package/src/icons/lucide-animated/plus.tsx +92 -0
- package/src/icons/lucide-animated/refresh-cw.tsx +24 -0
- package/src/icons/lucide-animated/rocket.tsx +24 -0
- package/src/icons/lucide-animated/save.tsx +23 -0
- package/src/icons/lucide-animated/search.tsx +94 -0
- package/src/icons/lucide-animated/settings.tsx +92 -0
- package/src/icons/lucide-animated/terminal.tsx +46 -0
- package/src/icons/lucide-animated/trash-2.tsx +25 -0
- package/src/icons/lucide-animated/trending-down.tsx +151 -0
- package/src/icons/lucide-animated/trending-up.tsx +150 -0
- package/src/icons/lucide-animated/type.tsx +23 -0
- package/src/icons/lucide-animated/upload.tsx +23 -0
- package/src/icons/lucide-animated/x.tsx +102 -0
- package/src/index.css +129 -0
- package/src/index.ts +20 -0
- package/src/lib/get-strict-context.tsx +36 -0
- package/src/lib/utils.ts +24 -0
- package/src/types/css-modules.d.ts +18 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Dialog as DialogPrimitive } from '@base-ui-components/react/dialog';
|
|
5
|
+
import { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';
|
|
6
|
+
|
|
7
|
+
import { useControlledState } from '@/hooks/use-controlled-state';
|
|
8
|
+
import { getStrictContext } from '@/lib/get-strict-context';
|
|
9
|
+
|
|
10
|
+
type DialogContextType = {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
setIsOpen: DialogProps['onOpenChange'];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const [DialogProvider, useDialog] =
|
|
16
|
+
getStrictContext<DialogContextType>('DialogContext');
|
|
17
|
+
|
|
18
|
+
type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;
|
|
19
|
+
|
|
20
|
+
function Dialog(props: DialogProps) {
|
|
21
|
+
const [isOpen, setIsOpen] = useControlledState({
|
|
22
|
+
value: props?.open,
|
|
23
|
+
defaultValue: props?.defaultOpen,
|
|
24
|
+
onChange: props?.onOpenChange,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<DialogProvider value={{ isOpen, setIsOpen }}>
|
|
29
|
+
<DialogPrimitive.Root
|
|
30
|
+
data-slot="dialog"
|
|
31
|
+
{...props}
|
|
32
|
+
onOpenChange={setIsOpen}
|
|
33
|
+
/>
|
|
34
|
+
</DialogProvider>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
39
|
+
|
|
40
|
+
function DialogTrigger(props: DialogTriggerProps) {
|
|
41
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type DialogPortalProps = Omit<
|
|
45
|
+
React.ComponentProps<typeof DialogPrimitive.Portal>,
|
|
46
|
+
'keepMounted'
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
function DialogPortal(props: DialogPortalProps) {
|
|
50
|
+
const { isOpen } = useDialog();
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<AnimatePresence>
|
|
54
|
+
{isOpen && (
|
|
55
|
+
<DialogPrimitive.Portal
|
|
56
|
+
data-slot="dialog-portal"
|
|
57
|
+
keepMounted
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
</AnimatePresence>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type DialogBackdropProps = Omit<
|
|
66
|
+
React.ComponentProps<typeof DialogPrimitive.Backdrop>,
|
|
67
|
+
'render'
|
|
68
|
+
> &
|
|
69
|
+
HTMLMotionProps<'div'>;
|
|
70
|
+
|
|
71
|
+
function DialogBackdrop({
|
|
72
|
+
transition = { duration: 0.2, ease: 'easeInOut' },
|
|
73
|
+
...props
|
|
74
|
+
}: DialogBackdropProps) {
|
|
75
|
+
return (
|
|
76
|
+
<DialogPrimitive.Backdrop
|
|
77
|
+
data-slot="dialog-backdrop"
|
|
78
|
+
render={
|
|
79
|
+
<motion.div
|
|
80
|
+
key="dialog-backdrop"
|
|
81
|
+
initial={{ opacity: 0, filter: 'blur(4px)' }}
|
|
82
|
+
animate={{ opacity: 1, filter: 'blur(0px)' }}
|
|
83
|
+
exit={{ opacity: 0, filter: 'blur(4px)' }}
|
|
84
|
+
transition={transition}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
type DialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
93
|
+
|
|
94
|
+
type DialogPopupProps = Omit<
|
|
95
|
+
React.ComponentProps<typeof DialogPrimitive.Popup>,
|
|
96
|
+
'render'
|
|
97
|
+
> &
|
|
98
|
+
HTMLMotionProps<'div'> & {
|
|
99
|
+
from?: DialogFlipDirection;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
function DialogPopup({
|
|
103
|
+
from = 'top',
|
|
104
|
+
initialFocus,
|
|
105
|
+
finalFocus,
|
|
106
|
+
transition = { type: 'spring', stiffness: 150, damping: 25 },
|
|
107
|
+
...props
|
|
108
|
+
}: DialogPopupProps) {
|
|
109
|
+
const initialRotation =
|
|
110
|
+
from === 'bottom' || from === 'left' ? '20deg' : '-20deg';
|
|
111
|
+
const isVertical = from === 'top' || from === 'bottom';
|
|
112
|
+
const rotateAxis = isVertical ? 'rotateX' : 'rotateY';
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<DialogPrimitive.Popup
|
|
116
|
+
initialFocus={initialFocus}
|
|
117
|
+
finalFocus={finalFocus}
|
|
118
|
+
render={
|
|
119
|
+
<motion.div
|
|
120
|
+
key="dialog-popup"
|
|
121
|
+
data-slot="dialog-popup"
|
|
122
|
+
initial={{
|
|
123
|
+
opacity: 0,
|
|
124
|
+
filter: 'blur(4px)',
|
|
125
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,
|
|
126
|
+
}}
|
|
127
|
+
animate={{
|
|
128
|
+
opacity: 1,
|
|
129
|
+
filter: 'blur(0px)',
|
|
130
|
+
transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`,
|
|
131
|
+
}}
|
|
132
|
+
exit={{
|
|
133
|
+
opacity: 0,
|
|
134
|
+
filter: 'blur(4px)',
|
|
135
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,
|
|
136
|
+
}}
|
|
137
|
+
transition={transition}
|
|
138
|
+
{...props}
|
|
139
|
+
/>
|
|
140
|
+
}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;
|
|
146
|
+
|
|
147
|
+
function DialogClose(props: DialogCloseProps) {
|
|
148
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type DialogHeaderProps = React.ComponentProps<'div'>;
|
|
152
|
+
|
|
153
|
+
function DialogHeader(props: DialogHeaderProps) {
|
|
154
|
+
return <div data-slot="dialog-header" {...props} />;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type DialogFooterProps = React.ComponentProps<'div'>;
|
|
158
|
+
|
|
159
|
+
function DialogFooter(props: DialogFooterProps) {
|
|
160
|
+
return <div data-slot="dialog-footer" {...props} />;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>;
|
|
164
|
+
|
|
165
|
+
function DialogTitle(props: DialogTitleProps) {
|
|
166
|
+
return <DialogPrimitive.Title data-slot="dialog-title" {...props} />;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
type DialogDescriptionProps = React.ComponentProps<
|
|
170
|
+
typeof DialogPrimitive.Description
|
|
171
|
+
>;
|
|
172
|
+
|
|
173
|
+
function DialogDescription(props: DialogDescriptionProps) {
|
|
174
|
+
return (
|
|
175
|
+
<DialogPrimitive.Description data-slot="dialog-description" {...props} />
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
Dialog,
|
|
181
|
+
DialogPortal,
|
|
182
|
+
DialogBackdrop,
|
|
183
|
+
DialogClose,
|
|
184
|
+
DialogTrigger,
|
|
185
|
+
DialogPopup,
|
|
186
|
+
DialogHeader,
|
|
187
|
+
DialogFooter,
|
|
188
|
+
DialogTitle,
|
|
189
|
+
DialogDescription,
|
|
190
|
+
useDialog,
|
|
191
|
+
type DialogProps,
|
|
192
|
+
type DialogTriggerProps,
|
|
193
|
+
type DialogPortalProps,
|
|
194
|
+
type DialogCloseProps,
|
|
195
|
+
type DialogBackdropProps,
|
|
196
|
+
type DialogPopupProps,
|
|
197
|
+
type DialogHeaderProps,
|
|
198
|
+
type DialogFooterProps,
|
|
199
|
+
type DialogTitleProps,
|
|
200
|
+
type DialogDescriptionProps,
|
|
201
|
+
type DialogContextType,
|
|
202
|
+
type DialogFlipDirection,
|
|
203
|
+
};
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Menu as MenuPrimitive } from '@base-ui-components/react/menu';
|
|
5
|
+
import { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Highlight,
|
|
9
|
+
HighlightItem,
|
|
10
|
+
type HighlightItemProps,
|
|
11
|
+
type HighlightProps,
|
|
12
|
+
} from '@/components/animate-ui/primitives/effects/highlight';
|
|
13
|
+
import { getStrictContext } from '@/lib/get-strict-context';
|
|
14
|
+
import { useControlledState } from '@/hooks/use-controlled-state';
|
|
15
|
+
import { useDataState } from '@/hooks/use-data-state';
|
|
16
|
+
|
|
17
|
+
type MenuActiveValueContextType = {
|
|
18
|
+
highlightedValue: string | null;
|
|
19
|
+
setHighlightedValue: (value: string | null) => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type MenuContextType = {
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
setIsOpen: MenuProps['onOpenChange'];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const [MenuActiveValueProvider, useMenuActiveValue] =
|
|
28
|
+
getStrictContext<MenuActiveValueContextType>('MenuActiveValueContext');
|
|
29
|
+
const [MenuProvider, useMenu] =
|
|
30
|
+
getStrictContext<MenuContextType>('MenuContext');
|
|
31
|
+
|
|
32
|
+
type MenuProps = React.ComponentProps<typeof MenuPrimitive.Root>;
|
|
33
|
+
|
|
34
|
+
function Menu(props: MenuProps) {
|
|
35
|
+
const [isOpen, setIsOpen] = useControlledState({
|
|
36
|
+
value: props?.open,
|
|
37
|
+
defaultValue: props?.defaultOpen,
|
|
38
|
+
onChange: props?.onOpenChange,
|
|
39
|
+
});
|
|
40
|
+
const [highlightedValue, setHighlightedValue] = React.useState<string | null>(
|
|
41
|
+
null,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<MenuActiveValueProvider value={{ highlightedValue, setHighlightedValue }}>
|
|
46
|
+
<MenuProvider value={{ isOpen, setIsOpen }}>
|
|
47
|
+
<MenuPrimitive.Root
|
|
48
|
+
data-slot="menu"
|
|
49
|
+
{...props}
|
|
50
|
+
onOpenChange={setIsOpen}
|
|
51
|
+
/>
|
|
52
|
+
</MenuProvider>
|
|
53
|
+
</MenuActiveValueProvider>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type MenuTriggerProps = React.ComponentProps<typeof MenuPrimitive.Trigger>;
|
|
58
|
+
|
|
59
|
+
function MenuTrigger(props: MenuTriggerProps) {
|
|
60
|
+
return <MenuPrimitive.Trigger data-slot="menu-trigger" {...props} />;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type MenuPortalProps = Omit<
|
|
64
|
+
React.ComponentProps<typeof MenuPrimitive.Portal>,
|
|
65
|
+
'keepMounted'
|
|
66
|
+
>;
|
|
67
|
+
|
|
68
|
+
function MenuPortal(props: MenuPortalProps) {
|
|
69
|
+
const { isOpen } = useMenu();
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<AnimatePresence>
|
|
73
|
+
{isOpen && (
|
|
74
|
+
<MenuPrimitive.Portal keepMounted data-slot="menu-portal" {...props} />
|
|
75
|
+
)}
|
|
76
|
+
</AnimatePresence>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type MenuGroupProps = React.ComponentProps<typeof MenuPrimitive.Group>;
|
|
81
|
+
|
|
82
|
+
function MenuGroup(props: MenuGroupProps) {
|
|
83
|
+
return <MenuPrimitive.Group data-slot="menu-group" {...props} />;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type MenuGroupLabelProps = React.ComponentProps<
|
|
87
|
+
typeof MenuPrimitive.GroupLabel
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
function MenuGroupLabel(props: MenuGroupLabelProps) {
|
|
91
|
+
return <MenuPrimitive.GroupLabel data-slot="menu-group-label" {...props} />;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type MenuSubmenuProps = React.ComponentProps<typeof MenuPrimitive.SubmenuRoot>;
|
|
95
|
+
|
|
96
|
+
function MenuSubmenu(props: MenuSubmenuProps) {
|
|
97
|
+
const [isOpen, setIsOpen] = useControlledState({
|
|
98
|
+
value: props?.open,
|
|
99
|
+
defaultValue: props?.defaultOpen,
|
|
100
|
+
onChange: props?.onOpenChange,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<MenuProvider value={{ isOpen, setIsOpen }}>
|
|
105
|
+
<MenuPrimitive.SubmenuRoot
|
|
106
|
+
data-slot="menu-submenu"
|
|
107
|
+
{...props}
|
|
108
|
+
onOpenChange={setIsOpen}
|
|
109
|
+
/>
|
|
110
|
+
</MenuProvider>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type MenuSubmenuTriggerProps = Omit<
|
|
115
|
+
React.ComponentProps<typeof MenuPrimitive.SubmenuTrigger>,
|
|
116
|
+
'render'
|
|
117
|
+
> &
|
|
118
|
+
HTMLMotionProps<'div'> & {
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
function MenuSubmenuTrigger({
|
|
123
|
+
label,
|
|
124
|
+
id,
|
|
125
|
+
nativeButton,
|
|
126
|
+
...props
|
|
127
|
+
}: MenuSubmenuTriggerProps) {
|
|
128
|
+
const { setHighlightedValue } = useMenuActiveValue();
|
|
129
|
+
const [, highlightedRef] = useDataState<HTMLDivElement>(
|
|
130
|
+
'highlighted',
|
|
131
|
+
undefined,
|
|
132
|
+
(value) => {
|
|
133
|
+
if (value === true) {
|
|
134
|
+
const el = highlightedRef.current;
|
|
135
|
+
const v = el?.dataset.value || el?.id || null;
|
|
136
|
+
if (v) setHighlightedValue(v);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<MenuPrimitive.SubmenuTrigger
|
|
143
|
+
ref={highlightedRef}
|
|
144
|
+
label={label}
|
|
145
|
+
id={id}
|
|
146
|
+
nativeButton={nativeButton}
|
|
147
|
+
data-slot="menu-submenu-trigger"
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
type MenuHighlightProps = Omit<
|
|
154
|
+
HighlightProps,
|
|
155
|
+
'controlledItems' | 'enabled' | 'hover'
|
|
156
|
+
> & {
|
|
157
|
+
animateOnHover?: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
function MenuHighlight({
|
|
161
|
+
transition = { type: 'spring', stiffness: 350, damping: 35 },
|
|
162
|
+
...props
|
|
163
|
+
}: MenuHighlightProps) {
|
|
164
|
+
const { highlightedValue } = useMenuActiveValue();
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<Highlight
|
|
168
|
+
data-slot="menu-highlight"
|
|
169
|
+
click={false}
|
|
170
|
+
controlledItems
|
|
171
|
+
transition={transition}
|
|
172
|
+
value={highlightedValue}
|
|
173
|
+
{...props}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
type MenuHighlightItemProps = HighlightItemProps;
|
|
179
|
+
|
|
180
|
+
function MenuHighlightItem(props: MenuHighlightItemProps) {
|
|
181
|
+
return <HighlightItem data-slot="menu-highlight-item" {...props} />;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
type MenuPositionerProps = React.ComponentProps<
|
|
185
|
+
typeof MenuPrimitive.Positioner
|
|
186
|
+
>;
|
|
187
|
+
|
|
188
|
+
function MenuPositioner(props: MenuPositionerProps) {
|
|
189
|
+
return <MenuPrimitive.Positioner data-slot="menu-positioner" {...props} />;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
type MenuPopupProps = Omit<
|
|
193
|
+
React.ComponentProps<typeof MenuPrimitive.Popup>,
|
|
194
|
+
'render'
|
|
195
|
+
> &
|
|
196
|
+
HTMLMotionProps<'div'>;
|
|
197
|
+
|
|
198
|
+
function MenuPopup({
|
|
199
|
+
finalFocus,
|
|
200
|
+
id,
|
|
201
|
+
transition = { duration: 0.2 },
|
|
202
|
+
style,
|
|
203
|
+
...props
|
|
204
|
+
}: MenuPopupProps) {
|
|
205
|
+
return (
|
|
206
|
+
<MenuPrimitive.Popup
|
|
207
|
+
finalFocus={finalFocus}
|
|
208
|
+
id={id}
|
|
209
|
+
render={
|
|
210
|
+
<motion.div
|
|
211
|
+
key="menu-popup"
|
|
212
|
+
data-slot="menu-popup"
|
|
213
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
214
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
215
|
+
exit={{ opacity: 0, scale: 0.95 }}
|
|
216
|
+
transition={transition}
|
|
217
|
+
style={{ willChange: 'opacity, transform', ...style }}
|
|
218
|
+
{...props}
|
|
219
|
+
/>
|
|
220
|
+
}
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
type MenuItemProps = Omit<
|
|
226
|
+
React.ComponentProps<typeof MenuPrimitive.Item>,
|
|
227
|
+
'render'
|
|
228
|
+
> &
|
|
229
|
+
HTMLMotionProps<'div'>;
|
|
230
|
+
|
|
231
|
+
function MenuItem({
|
|
232
|
+
disabled,
|
|
233
|
+
label,
|
|
234
|
+
closeOnClick,
|
|
235
|
+
nativeButton,
|
|
236
|
+
id,
|
|
237
|
+
...props
|
|
238
|
+
}: MenuItemProps) {
|
|
239
|
+
const { setHighlightedValue } = useMenuActiveValue();
|
|
240
|
+
const [, highlightedRef] = useDataState<HTMLDivElement>(
|
|
241
|
+
'highlighted',
|
|
242
|
+
undefined,
|
|
243
|
+
(value) => {
|
|
244
|
+
if (value === true) {
|
|
245
|
+
const el = highlightedRef.current;
|
|
246
|
+
const v = el?.dataset.value || el?.id || null;
|
|
247
|
+
if (v) setHighlightedValue(v);
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<MenuPrimitive.Item
|
|
254
|
+
ref={highlightedRef}
|
|
255
|
+
label={label}
|
|
256
|
+
closeOnClick={closeOnClick}
|
|
257
|
+
nativeButton={nativeButton}
|
|
258
|
+
disabled={disabled}
|
|
259
|
+
id={id}
|
|
260
|
+
data-slot="menu-item"
|
|
261
|
+
{...props}
|
|
262
|
+
/>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
type MenuCheckboxItemProps = Omit<
|
|
267
|
+
React.ComponentProps<typeof MenuPrimitive.CheckboxItem>,
|
|
268
|
+
'render'
|
|
269
|
+
>;
|
|
270
|
+
|
|
271
|
+
function MenuCheckboxItem({
|
|
272
|
+
label,
|
|
273
|
+
defaultChecked,
|
|
274
|
+
checked,
|
|
275
|
+
onCheckedChange,
|
|
276
|
+
disabled,
|
|
277
|
+
closeOnClick,
|
|
278
|
+
nativeButton,
|
|
279
|
+
id,
|
|
280
|
+
...props
|
|
281
|
+
}: MenuCheckboxItemProps) {
|
|
282
|
+
const { setHighlightedValue } = useMenuActiveValue();
|
|
283
|
+
const [, highlightedRef] = useDataState<HTMLDivElement>(
|
|
284
|
+
'highlighted',
|
|
285
|
+
undefined,
|
|
286
|
+
(value) => {
|
|
287
|
+
if (value === true) {
|
|
288
|
+
const el = highlightedRef.current;
|
|
289
|
+
const v = el?.dataset.value || el?.id || null;
|
|
290
|
+
if (v) setHighlightedValue(v);
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
);
|
|
294
|
+
return (
|
|
295
|
+
<MenuPrimitive.CheckboxItem
|
|
296
|
+
ref={highlightedRef}
|
|
297
|
+
label={label}
|
|
298
|
+
checked={checked}
|
|
299
|
+
defaultChecked={defaultChecked}
|
|
300
|
+
onCheckedChange={onCheckedChange}
|
|
301
|
+
disabled={disabled}
|
|
302
|
+
closeOnClick={closeOnClick}
|
|
303
|
+
nativeButton={nativeButton}
|
|
304
|
+
id={id}
|
|
305
|
+
data-slot="menu-checkbox-item"
|
|
306
|
+
{...props}
|
|
307
|
+
/>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
type MenuCheckboxItemIndicatorProps = Omit<
|
|
312
|
+
React.ComponentProps<typeof MenuPrimitive.CheckboxItemIndicator>,
|
|
313
|
+
'render'
|
|
314
|
+
> &
|
|
315
|
+
HTMLMotionProps<'div'>;
|
|
316
|
+
|
|
317
|
+
function MenuCheckboxItemIndicator({
|
|
318
|
+
keepMounted,
|
|
319
|
+
...props
|
|
320
|
+
}: MenuCheckboxItemIndicatorProps) {
|
|
321
|
+
return (
|
|
322
|
+
<MenuPrimitive.CheckboxItemIndicator
|
|
323
|
+
data-slot="menu-checkbox-item-indicator"
|
|
324
|
+
keepMounted={keepMounted}
|
|
325
|
+
render={
|
|
326
|
+
<motion.div data-slot="menu-checkbox-item-indicator" {...props} />
|
|
327
|
+
}
|
|
328
|
+
/>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
type MenuRadioGroupProps = React.ComponentProps<
|
|
333
|
+
typeof MenuPrimitive.RadioGroup
|
|
334
|
+
>;
|
|
335
|
+
|
|
336
|
+
function MenuRadioGroup(props: MenuRadioGroupProps) {
|
|
337
|
+
return <MenuPrimitive.RadioGroup data-slot="menu-radio-group" {...props} />;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
type MenuRadioItemProps = Omit<
|
|
341
|
+
React.ComponentProps<typeof MenuPrimitive.RadioItem>,
|
|
342
|
+
'render'
|
|
343
|
+
>;
|
|
344
|
+
|
|
345
|
+
function MenuRadioItem({
|
|
346
|
+
value,
|
|
347
|
+
disabled,
|
|
348
|
+
label,
|
|
349
|
+
closeOnClick,
|
|
350
|
+
nativeButton,
|
|
351
|
+
id,
|
|
352
|
+
...props
|
|
353
|
+
}: MenuRadioItemProps) {
|
|
354
|
+
const { setHighlightedValue } = useMenuActiveValue();
|
|
355
|
+
const [, highlightedRef] = useDataState<HTMLDivElement>(
|
|
356
|
+
'highlighted',
|
|
357
|
+
undefined,
|
|
358
|
+
(value) => {
|
|
359
|
+
if (value === true) {
|
|
360
|
+
const el = highlightedRef.current;
|
|
361
|
+
const v = el?.dataset.value || el?.id || null;
|
|
362
|
+
if (v) setHighlightedValue(v);
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
);
|
|
366
|
+
return (
|
|
367
|
+
<MenuPrimitive.RadioItem
|
|
368
|
+
ref={highlightedRef}
|
|
369
|
+
value={value}
|
|
370
|
+
disabled={disabled}
|
|
371
|
+
label={label}
|
|
372
|
+
closeOnClick={closeOnClick}
|
|
373
|
+
nativeButton={nativeButton}
|
|
374
|
+
id={id}
|
|
375
|
+
data-slot="menu-radio-item"
|
|
376
|
+
{...props}
|
|
377
|
+
/>
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
type MenuRadioItemIndicatorProps = Omit<
|
|
382
|
+
React.ComponentProps<typeof MenuPrimitive.RadioItemIndicator>,
|
|
383
|
+
'render'
|
|
384
|
+
> &
|
|
385
|
+
HTMLMotionProps<'div'>;
|
|
386
|
+
|
|
387
|
+
function MenuRadioItemIndicator({
|
|
388
|
+
keepMounted,
|
|
389
|
+
...props
|
|
390
|
+
}: MenuRadioItemIndicatorProps) {
|
|
391
|
+
return (
|
|
392
|
+
<MenuPrimitive.RadioItemIndicator
|
|
393
|
+
data-slot="menu-radio-item-indicator"
|
|
394
|
+
keepMounted={keepMounted}
|
|
395
|
+
render={<motion.div data-slot="menu-radio-item-indicator" {...props} />}
|
|
396
|
+
/>
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
type MenuShortcutProps = React.ComponentProps<'span'>;
|
|
401
|
+
|
|
402
|
+
function MenuShortcut(props: MenuShortcutProps) {
|
|
403
|
+
return <span data-slot="menu-shortcut" {...props} />;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
type MenuArrowProps = React.ComponentProps<typeof MenuPrimitive.Arrow>;
|
|
407
|
+
|
|
408
|
+
function MenuArrow(props: MenuArrowProps) {
|
|
409
|
+
return <MenuPrimitive.Arrow data-slot="menu-arrow" {...props} />;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
type MenuSeparatorProps = React.ComponentProps<typeof MenuPrimitive.Separator>;
|
|
413
|
+
|
|
414
|
+
function MenuSeparator(props: MenuSeparatorProps) {
|
|
415
|
+
return <MenuPrimitive.Separator data-slot="menu-separator" {...props} />;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export {
|
|
419
|
+
Menu,
|
|
420
|
+
MenuTrigger,
|
|
421
|
+
MenuPortal,
|
|
422
|
+
MenuPositioner,
|
|
423
|
+
MenuPopup,
|
|
424
|
+
MenuArrow,
|
|
425
|
+
MenuItem,
|
|
426
|
+
MenuCheckboxItem,
|
|
427
|
+
MenuCheckboxItemIndicator,
|
|
428
|
+
MenuRadioGroup,
|
|
429
|
+
MenuRadioItem,
|
|
430
|
+
MenuRadioItemIndicator,
|
|
431
|
+
MenuGroup,
|
|
432
|
+
MenuGroupLabel,
|
|
433
|
+
MenuSeparator,
|
|
434
|
+
MenuShortcut,
|
|
435
|
+
MenuHighlight,
|
|
436
|
+
MenuHighlightItem,
|
|
437
|
+
MenuSubmenu,
|
|
438
|
+
MenuSubmenuTrigger,
|
|
439
|
+
useMenuActiveValue,
|
|
440
|
+
useMenu,
|
|
441
|
+
type MenuProps,
|
|
442
|
+
type MenuTriggerProps,
|
|
443
|
+
type MenuPortalProps,
|
|
444
|
+
type MenuPositionerProps,
|
|
445
|
+
type MenuPopupProps,
|
|
446
|
+
type MenuArrowProps,
|
|
447
|
+
type MenuItemProps,
|
|
448
|
+
type MenuCheckboxItemProps,
|
|
449
|
+
type MenuCheckboxItemIndicatorProps,
|
|
450
|
+
type MenuRadioItemProps,
|
|
451
|
+
type MenuRadioItemIndicatorProps,
|
|
452
|
+
type MenuRadioGroupProps,
|
|
453
|
+
type MenuGroupProps,
|
|
454
|
+
type MenuGroupLabelProps,
|
|
455
|
+
type MenuSeparatorProps,
|
|
456
|
+
type MenuShortcutProps,
|
|
457
|
+
type MenuHighlightProps,
|
|
458
|
+
type MenuHighlightItemProps,
|
|
459
|
+
type MenuSubmenuProps,
|
|
460
|
+
type MenuSubmenuTriggerProps,
|
|
461
|
+
type MenuActiveValueContextType,
|
|
462
|
+
type MenuContextType,
|
|
463
|
+
};
|