@minidev.fun/ui 1.0.4 → 1.0.5
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/dist/components/minidev.fun/color-mode/color-mode-initializer.js.map +1 -0
- package/dist/{src/components → components}/minidev.fun/color-mode/color-mode-toggle.js +6 -6
- package/dist/components/minidev.fun/color-mode/color-mode-toggle.js.map +1 -0
- package/dist/components/minidev.fun/color-mode/index.d.ts +4 -0
- package/dist/components/minidev.fun/color-mode/index.js +9 -0
- package/dist/components/minidev.fun/color-mode/use-color-mode.js.map +1 -0
- package/dist/components/minidev.fun/first-light/first-light-filters.js +114 -0
- package/dist/components/minidev.fun/first-light/first-light-filters.js.map +1 -0
- package/dist/components/minidev.fun/first-light/index.d.ts +2 -0
- package/dist/components/minidev.fun/first-light/index.js +5 -0
- package/dist/components/minidev.fun/first-light/index.js.map +1 -0
- package/dist/components/minidev.fun/typography/blockquote.js +23 -0
- package/dist/components/minidev.fun/typography/blockquote.js.map +1 -0
- package/dist/components/minidev.fun/typography/code.js +23 -0
- package/dist/components/minidev.fun/typography/code.js.map +1 -0
- package/dist/components/minidev.fun/typography/index.d.ts +6 -0
- package/dist/components/minidev.fun/typography/index.js +15 -0
- package/dist/components/minidev.fun/typography/index.js.map +1 -0
- package/dist/components/minidev.fun/typography/list-item.js +19 -0
- package/dist/components/minidev.fun/typography/list-item.js.map +1 -0
- package/dist/components/minidev.fun/typography/text.js +59 -0
- package/dist/components/minidev.fun/typography/text.js.map +1 -0
- package/dist/components/minidev.fun/typography/title.js +47 -0
- package/dist/components/minidev.fun/typography/title.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +27 -0
- package/dist/components/ui/{src/components/ui/accordion.js → accordion.js} +8 -8
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +47 -0
- package/dist/components/ui/{src/components/ui/alert-dialog.js → alert-dialog.js} +9 -9
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +30 -0
- package/dist/components/ui/{src/components/ui/alert.js → alert.js} +2 -2
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +11 -0
- package/dist/components/ui/{src/components/ui/aspect-ratio.js → aspect-ratio.js} +1 -1
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +42 -0
- package/dist/components/ui/{src/components/ui/avatar.js → avatar.js} +4 -4
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +16 -0
- package/dist/components/ui/{src/components/ui/badge.js → badge.js} +4 -4
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +39 -0
- package/dist/components/ui/{src/components/ui/breadcrumb.js → breadcrumb.js} +5 -5
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +26 -0
- package/dist/components/ui/{src/components/ui/button-group.js → button-group.js} +4 -4
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +41 -0
- package/dist/components/ui/{src/components/ui/button.js → button.js} +3 -3
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +20 -0
- package/dist/components/ui/{src/components/ui/calendar.js → calendar.js} +4 -4
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +30 -0
- package/dist/components/ui/{src/components/ui/card.js → card.js} +1 -1
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +56 -0
- package/dist/components/ui/{src/components/ui/carousel.js → carousel.js} +3 -3
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +73 -0
- package/dist/components/ui/{src/components/ui/chart.js → chart.js} +1 -1
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +11 -0
- package/dist/components/ui/{src/components/ui/checkbox.js → checkbox.js} +4 -4
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +21 -0
- package/dist/components/ui/{src/components/ui/collapsible.js → collapsible.js} +3 -3
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +80 -0
- package/dist/components/ui/{src/components/ui/combobox.js → combobox.js} +23 -23
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +63 -0
- package/dist/components/ui/{src/components/ui/command.js → command.js} +4 -4
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +64 -0
- package/dist/components/ui/{src/components/ui/context-menu.js → context-menu.js} +20 -20
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +69 -0
- package/dist/components/ui/{src/components/ui/dialog.js → dialog.js} +10 -10
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +40 -0
- package/dist/components/ui/{src/components/ui/drawer.js → drawer.js} +2 -2
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +88 -0
- package/dist/components/ui/{src/components/ui/dropdown-menu.js → dropdown-menu.js} +20 -20
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +41 -0
- package/dist/components/ui/{src/components/ui/empty.js → empty.js} +2 -2
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +78 -0
- package/dist/components/ui/{src/components/ui/field.js → field.js} +2 -2
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +21 -0
- package/dist/components/ui/{src/components/ui/hover-card.js → hover-card.js} +6 -6
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +50 -0
- package/dist/components/ui/{src/components/ui/input-group.js → input-group.js} +2 -2
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +34 -0
- package/dist/components/ui/{src/components/ui/input-otp.js → input-otp.js} +2 -2
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +11 -0
- package/dist/components/ui/{src/components/ui/input.js → input.js} +2 -2
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +69 -0
- package/dist/components/ui/{src/components/ui/item.js → item.js} +4 -4
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +14 -0
- package/dist/components/ui/{src/components/ui/kbd.js → kbd.js} +1 -1
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +9 -0
- package/dist/components/ui/{src/components/ui/label.js → label.js} +1 -1
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +87 -0
- package/dist/components/ui/{src/components/ui/menubar.js → menubar.js} +9 -9
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/modal.d.ts +41 -0
- package/dist/components/ui/{src/components/ui/modal.js → modal.js} +9 -9
- package/dist/components/ui/modal.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +52 -0
- package/dist/components/ui/{src/components/ui/navigation-menu.js → navigation-menu.js} +14 -14
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +42 -0
- package/dist/components/ui/{src/components/ui/pagination.js → pagination.js} +4 -4
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +42 -0
- package/dist/components/ui/{src/components/ui/popover.js → popover.js} +8 -8
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +30 -0
- package/dist/components/ui/{src/components/ui/progress.js → progress.js} +6 -6
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +16 -0
- package/dist/components/ui/{src/components/ui/radio-group.js → radio-group.js} +5 -5
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +38 -0
- package/dist/components/ui/{src/components/ui/resizable.js → resizable.js} +2 -2
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +64 -0
- package/dist/components/ui/{src/components/ui/scroll-area.js → scroll-area.js} +6 -6
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +58 -0
- package/dist/components/ui/{src/components/ui/select.js → select.js} +20 -20
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +9 -0
- package/dist/components/ui/{src/components/ui/separator.js → separator.js} +2 -2
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +51 -0
- package/dist/components/ui/{src/components/ui/sheet.js → sheet.js} +10 -10
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +172 -0
- package/dist/components/ui/{src/components/ui/sidebar.js → sidebar.js} +6 -6
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +8 -0
- package/dist/components/ui/{src/components/ui/skeleton.js → skeleton.js} +1 -1
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +21 -0
- package/dist/components/ui/{src/components/ui/slider.js → slider.js} +6 -6
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +21 -0
- package/dist/components/ui/{src/components/ui/sonner.js → sonner.js} +7 -7
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +8 -0
- package/dist/components/ui/{src/components/ui/spinner.js → spinner.js} +2 -2
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +12 -0
- package/dist/components/ui/{src/components/ui/switch.js → switch.js} +3 -3
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +51 -0
- package/dist/components/ui/{src/components/ui/table.js → table.js} +1 -1
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +31 -0
- package/dist/components/ui/{src/components/ui/tabs.js → tabs.js} +6 -6
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +18 -0
- package/dist/components/ui/{src/components/ui/textarea.js → textarea.js} +1 -1
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +11 -0
- package/dist/components/ui/{src/components/ui/toast.js → toast.js} +6 -6
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +26 -0
- package/dist/components/ui/{src/components/ui/toggle-group.js → toggle-group.js} +3 -3
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +14 -0
- package/dist/components/ui/{src/components/ui/toggle.js → toggle.js} +3 -3
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +27 -0
- package/dist/components/ui/{src/components/ui/tooltip.js → tooltip.js} +8 -8
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +18 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/utils.d.ts +23 -2
- package/dist/lib/variants.js +129 -0
- package/dist/lib/variants.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/minidev.fun/undefined/index.d.ts +0 -2
- package/dist/components/minidev.fun/undefined/index.js +0 -9
- package/dist/components/ui/src/components/ui/accordion.d.ts +0 -2
- package/dist/components/ui/src/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/src/components/ui/alert-dialog.d.ts +0 -2
- package/dist/components/ui/src/components/ui/alert-dialog.js.map +0 -1
- package/dist/components/ui/src/components/ui/alert.d.ts +0 -2
- package/dist/components/ui/src/components/ui/alert.js.map +0 -1
- package/dist/components/ui/src/components/ui/aspect-ratio.d.ts +0 -2
- package/dist/components/ui/src/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/src/components/ui/avatar.d.ts +0 -2
- package/dist/components/ui/src/components/ui/avatar.js.map +0 -1
- package/dist/components/ui/src/components/ui/badge.d.ts +0 -2
- package/dist/components/ui/src/components/ui/badge.js.map +0 -1
- package/dist/components/ui/src/components/ui/breadcrumb.d.ts +0 -2
- package/dist/components/ui/src/components/ui/breadcrumb.js.map +0 -1
- package/dist/components/ui/src/components/ui/button-group.d.ts +0 -2
- package/dist/components/ui/src/components/ui/button-group.js.map +0 -1
- package/dist/components/ui/src/components/ui/button.d.ts +0 -2
- package/dist/components/ui/src/components/ui/button.js.map +0 -1
- package/dist/components/ui/src/components/ui/calendar.d.ts +0 -2
- package/dist/components/ui/src/components/ui/calendar.js.map +0 -1
- package/dist/components/ui/src/components/ui/card.d.ts +0 -2
- package/dist/components/ui/src/components/ui/card.js.map +0 -1
- package/dist/components/ui/src/components/ui/carousel.d.ts +0 -2
- package/dist/components/ui/src/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/src/components/ui/chart.d.ts +0 -2
- package/dist/components/ui/src/components/ui/chart.js.map +0 -1
- package/dist/components/ui/src/components/ui/checkbox.d.ts +0 -2
- package/dist/components/ui/src/components/ui/checkbox.js.map +0 -1
- package/dist/components/ui/src/components/ui/collapsible.d.ts +0 -2
- package/dist/components/ui/src/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/src/components/ui/combobox.d.ts +0 -2
- package/dist/components/ui/src/components/ui/combobox.js.map +0 -1
- package/dist/components/ui/src/components/ui/command.d.ts +0 -2
- package/dist/components/ui/src/components/ui/command.js.map +0 -1
- package/dist/components/ui/src/components/ui/context-menu.d.ts +0 -2
- package/dist/components/ui/src/components/ui/context-menu.js.map +0 -1
- package/dist/components/ui/src/components/ui/dialog.d.ts +0 -2
- package/dist/components/ui/src/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/src/components/ui/drawer.d.ts +0 -2
- package/dist/components/ui/src/components/ui/drawer.js.map +0 -1
- package/dist/components/ui/src/components/ui/dropdown-menu.d.ts +0 -2
- package/dist/components/ui/src/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/src/components/ui/empty.d.ts +0 -2
- package/dist/components/ui/src/components/ui/empty.js.map +0 -1
- package/dist/components/ui/src/components/ui/field.d.ts +0 -2
- package/dist/components/ui/src/components/ui/field.js.map +0 -1
- package/dist/components/ui/src/components/ui/hover-card.d.ts +0 -2
- package/dist/components/ui/src/components/ui/hover-card.js.map +0 -1
- package/dist/components/ui/src/components/ui/input-group.d.ts +0 -2
- package/dist/components/ui/src/components/ui/input-group.js.map +0 -1
- package/dist/components/ui/src/components/ui/input-otp.d.ts +0 -2
- package/dist/components/ui/src/components/ui/input-otp.js.map +0 -1
- package/dist/components/ui/src/components/ui/input.d.ts +0 -2
- package/dist/components/ui/src/components/ui/input.js.map +0 -1
- package/dist/components/ui/src/components/ui/item.d.ts +0 -2
- package/dist/components/ui/src/components/ui/item.js.map +0 -1
- package/dist/components/ui/src/components/ui/kbd.d.ts +0 -2
- package/dist/components/ui/src/components/ui/kbd.js.map +0 -1
- package/dist/components/ui/src/components/ui/label.d.ts +0 -2
- package/dist/components/ui/src/components/ui/label.js.map +0 -1
- package/dist/components/ui/src/components/ui/menubar.d.ts +0 -2
- package/dist/components/ui/src/components/ui/menubar.js.map +0 -1
- package/dist/components/ui/src/components/ui/modal.d.ts +0 -2
- package/dist/components/ui/src/components/ui/modal.js.map +0 -1
- package/dist/components/ui/src/components/ui/navigation-menu.d.ts +0 -2
- package/dist/components/ui/src/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/src/components/ui/pagination.d.ts +0 -2
- package/dist/components/ui/src/components/ui/pagination.js.map +0 -1
- package/dist/components/ui/src/components/ui/popover.d.ts +0 -2
- package/dist/components/ui/src/components/ui/popover.js.map +0 -1
- package/dist/components/ui/src/components/ui/progress.d.ts +0 -2
- package/dist/components/ui/src/components/ui/progress.js.map +0 -1
- package/dist/components/ui/src/components/ui/radio-group.d.ts +0 -2
- package/dist/components/ui/src/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/src/components/ui/resizable.d.ts +0 -2
- package/dist/components/ui/src/components/ui/resizable.js.map +0 -1
- package/dist/components/ui/src/components/ui/scroll-area.d.ts +0 -2
- package/dist/components/ui/src/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/src/components/ui/select.d.ts +0 -2
- package/dist/components/ui/src/components/ui/select.js.map +0 -1
- package/dist/components/ui/src/components/ui/separator.d.ts +0 -2
- package/dist/components/ui/src/components/ui/separator.js.map +0 -1
- package/dist/components/ui/src/components/ui/sheet.d.ts +0 -2
- package/dist/components/ui/src/components/ui/sheet.js.map +0 -1
- package/dist/components/ui/src/components/ui/sidebar.d.ts +0 -2
- package/dist/components/ui/src/components/ui/sidebar.js.map +0 -1
- package/dist/components/ui/src/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/src/components/ui/skeleton.js.map +0 -1
- package/dist/components/ui/src/components/ui/slider.d.ts +0 -2
- package/dist/components/ui/src/components/ui/slider.js.map +0 -1
- package/dist/components/ui/src/components/ui/sonner.d.ts +0 -2
- package/dist/components/ui/src/components/ui/sonner.js.map +0 -1
- package/dist/components/ui/src/components/ui/spinner.d.ts +0 -2
- package/dist/components/ui/src/components/ui/spinner.js.map +0 -1
- package/dist/components/ui/src/components/ui/switch.d.ts +0 -2
- package/dist/components/ui/src/components/ui/switch.js.map +0 -1
- package/dist/components/ui/src/components/ui/table.d.ts +0 -2
- package/dist/components/ui/src/components/ui/table.js.map +0 -1
- package/dist/components/ui/src/components/ui/tabs.d.ts +0 -2
- package/dist/components/ui/src/components/ui/tabs.js.map +0 -1
- package/dist/components/ui/src/components/ui/textarea.d.ts +0 -2
- package/dist/components/ui/src/components/ui/textarea.js.map +0 -1
- package/dist/components/ui/src/components/ui/toast.d.ts +0 -2
- package/dist/components/ui/src/components/ui/toast.js.map +0 -1
- package/dist/components/ui/src/components/ui/toggle-group.d.ts +0 -2
- package/dist/components/ui/src/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/src/components/ui/toggle.d.ts +0 -2
- package/dist/components/ui/src/components/ui/toggle.js.map +0 -1
- package/dist/components/ui/src/components/ui/tooltip.d.ts +0 -2
- package/dist/components/ui/src/components/ui/tooltip.js.map +0 -1
- package/dist/hooks/src/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/src/hooks/use-mobile.js.map +0 -1
- package/dist/src/components/minidev.fun/color-mode/color-mode-initializer.js.map +0 -1
- package/dist/src/components/minidev.fun/color-mode/color-mode-toggle.js.map +0 -1
- package/dist/src/components/minidev.fun/color-mode/use-color-mode.js.map +0 -1
- package/dist/src/lib/variants.js +0 -27
- package/dist/src/lib/variants.js.map +0 -1
- /package/dist/{src/components → components}/minidev.fun/color-mode/color-mode-initializer.js +0 -0
- /package/dist/components/minidev.fun/{undefined → color-mode}/index.js.map +0 -0
- /package/dist/{src/components → components}/minidev.fun/color-mode/use-color-mode.js +0 -0
- /package/dist/hooks/{src/hooks/use-mobile.js → use-mobile.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-mode-initializer.js","sources":["../../../../src/components/minidev.fun/color-mode/color-mode-initializer.tsx"],"sourcesContent":["\"use client\";\n\nimport { useColorMode } from \"./use-color-mode\";\n\n/**\n * Color mode initialization script (internal).\n *\n * For Vite/static HTML apps, copy this script into your index.html <head>.\n * See docs/integrations/vite.md for the full script to copy.\n */\nconst colorModeScript = `(function() {\n try {\n var cookie = document.cookie.match(/color-mode=([^;]*)/) || document.cookie.match(/theme=([^;]*)/);\n var stored = cookie ? JSON.parse(decodeURIComponent(cookie[1])) : null;\n var preference = stored ? stored.preference : 'system';\n var mode = preference === 'system'\n ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n : preference;\n if (mode === 'dark') {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n document.documentElement.style.colorScheme = mode;\n } catch (e) {\n document.documentElement.classList.remove('dark');\n document.documentElement.style.colorScheme = 'light';\n }\n})();`;\n\n/**\n * ColorModeInitializer - Prevents flash of unstyled content (FOUC) during color mode initialization\n *\n * A React component that injects the color mode initialization script into the page.\n * Use this in SSR frameworks like Next.js where React controls the document.\n *\n * **For Vite/static HTML apps:** This component won't prevent FOUC because React\n * renders after first paint. Instead, copy the initialization script directly into\n * your `index.html` `<head>`. See the Vite integration guide for the full script.\n *\n * @component\n * @example Next.js App Router\n * ```tsx\n * // app/layout.tsx\n * import { ColorModeInitializer } from \"@minidev.fun/ui/color-mode\";\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html lang=\"en\" suppressHydrationWarning>\n * <head>\n * <ColorModeInitializer />\n * </head>\n * <body>{children}</body>\n * </html>\n * );\n * }\n * ```\n *\n * @example Vite - copy script to index.html instead\n * ```html\n * <!-- See docs/integrations/vite.md for the full script to copy -->\n * <head>\n * <script>\n * (function() {\n * // ... color mode initialization script\n * })();\n * </script>\n * </head>\n * ```\n *\n * @see {@link useColorMode} - Hook for runtime color mode management\n * @see {@link ColorModeToggle} - UI component for user color mode switching\n * @since 1.0.0\n */\nexport function ColorModeInitializer() {\n useColorMode();\n return <script dangerouslySetInnerHTML={{ __html: colorModeScript }} />;\n}\n"],"names":[],"mappings":";;;AAUA;AAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgEjB;AACL;AACA;AACF;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
-
import { Button } from "
|
|
5
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from "
|
|
4
|
+
import { Button } from "../../ui/button.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from "../../ui/dropdown-menu.js";
|
|
6
6
|
import { useColorMode } from "./use-color-mode.js";
|
|
7
|
-
import { cn } from "
|
|
8
|
-
import Monitor from "
|
|
9
|
-
import Sun from "
|
|
10
|
-
import Moon from "
|
|
7
|
+
import { cn } from "../../../lib/utils.js";
|
|
8
|
+
import Monitor from "../../../node_modules/lucide-react/dist/esm/icons/monitor.js";
|
|
9
|
+
import Sun from "../../../node_modules/lucide-react/dist/esm/icons/sun.js";
|
|
10
|
+
import Moon from "../../../node_modules/lucide-react/dist/esm/icons/moon.js";
|
|
11
11
|
const iconSizeMap = {
|
|
12
12
|
xs: "icon-xs",
|
|
13
13
|
sm: "icon-sm",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-mode-toggle.js","sources":["../../../../src/components/minidev.fun/color-mode/color-mode-toggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Monitor, Moon, Sun } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { useColorMode } from \"./use-color-mode\";\nimport { cn } from \"@/lib/utils\";\n\n// Map regular sizes to icon sizes for when showLabel is false\nconst iconSizeMap = {\n xs: \"icon-xs\",\n sm: \"icon-sm\",\n default: \"icon\",\n lg: \"icon-lg\",\n} as const;\n\n// Icon sizes that scale with button size\nconst iconClassMap = {\n xs: \"size-3\",\n sm: \"size-3.5\",\n default: \"size-4\",\n lg: \"size-5\",\n} as const;\n\n// Text sizes that scale with button size\nconst textClassMap = {\n xs: \"text-xs\",\n sm: \"text-sm\",\n default: \"text-base\",\n lg: \"text-lg\",\n} as const;\n\ntype ColorModeToggleSize = \"xs\" | \"sm\" | \"default\" | \"lg\";\n\ntype ColorModeToggleProps = {\n /**\n * Button size - when showLabel is false, renders as a square icon button\n * @default \"default\"\n */\n size?: ColorModeToggleSize;\n /**\n * Whether to show the current color mode name as text next to the icon\n * @default false\n */\n showLabel?: boolean;\n /**\n * Alignment of the dropdown menu relative to the trigger button\n * @default \"end\"\n */\n align?: \"start\" | \"center\" | \"end\";\n} & Omit<React.ComponentProps<typeof Button>, \"size\">;\n\n/**\n * ColorModeToggle - A zero-configuration color mode switcher with system, light, and dark modes\n *\n * A completely self-contained color mode toggle component that provides an intuitive dropdown\n * interface for switching between system preference, light mode, and dark mode. Works\n * immediately without any provider setup, context configuration, or additional dependencies.\n *\n * Built on top of Base UI components (Button + DropdownMenu) with the Minidev useColorMode\n * hook for state management. Handles color mode persistence via cookies, system preference\n * detection, real-time system changes, and synchronization across multiple instances.\n *\n * **Zero Configuration Design:**\n * Just import and use - no providers, no setup, no configuration required. The component\n * handles all color mode management internally and provides a complete solution out of the box.\n *\n * @example Basic usage (most common - icon button)\n * ```tsx\n * import { ColorModeToggle } from \"@minidev.fun/ui/color-mode\";\n *\n * // Just drop it in! Works immediately with zero setup\n * function Header() {\n * return (\n * <header className=\"flex items-center justify-between p-4\">\n * <Logo />\n * <ColorModeToggle />\n * </header>\n * );\n * }\n * ```\n *\n * @example With text labels for better UX\n * ```tsx\n * // Show current color mode name next to icon\n * <ColorModeToggle size=\"default\" showLabel />\n *\n * // In a settings panel\n * <div className=\"space-y-4\">\n * <h3>Appearance</h3>\n * <div className=\"flex items-center justify-between\">\n * <span>Color Mode</span>\n * <ColorModeToggle size=\"sm\" showLabel />\n * </div>\n * </div>\n * ```\n *\n * @example Different visual variants\n * ```tsx\n * // Ghost button for minimalist toolbars\n * <ColorModeToggle variant=\"ghost\" />\n *\n * // Secondary style for subtle integration\n * <ColorModeToggle variant=\"secondary\" size=\"sm\" />\n *\n * // Outline style (default) for clear boundaries\n * <ColorModeToggle variant=\"outline\" size=\"lg\" />\n * ```\n *\n * @param variant - Visual style variant inherited from Button component (default: \"outline\")\n * @param size - Button size: xs, sm, default, lg. Renders as icon button when showLabel is false (default: \"default\")\n * @param className - Additional CSS classes for custom styling\n * @param showLabel - Whether to show color mode name text. When false, renders as square icon button (default: false)\n * @param align - Dropdown menu alignment relative to trigger button (default: \"end\")\n *\n * @features\n * - **Zero Configuration**: Import and use immediately - no setup required\n * - **System Detection**: Automatically follows OS dark/light preference changes\n * - **Perfect Persistence**: Color mode choice saved via cookies for SSR compatibility\n * - **Multi-Instance Sync**: Multiple toggles stay perfectly synchronized\n * - **Real-Time Updates**: Responds to system color mode changes while app is running\n * - **Smooth Transitions**: CSS-based mode switching with no flash of wrong content\n * - **Accessibility First**: Full keyboard navigation and screen reader support\n * - **Touch Optimized**: Works perfectly on mobile and tablet devices\n * - **Framework Agnostic**: Works with Next.js, Vite, Create React App, etc.\n *\n * @accessibility\n * - **Keyboard Navigation**: Full support for Enter, Space, and Arrow keys\n * - **Screen Reader Support**: Proper ARIA labels and role announcements\n * - **Focus Management**: Visible focus indicators meeting WCAG 2.1 AA standards\n * - **State Communication**: Current selection clearly indicated with checkmarks\n *\n * @see {@link useColorMode} - The underlying color mode management hook with event-driven architecture\n * @see {@link ColorModeScript} - Component for FOUC prevention (required in root layout)\n * @since 1.0.0\n */\nfunction ColorModeToggle({\n variant = \"outline\",\n size = \"default\",\n className,\n showLabel = false,\n align = \"end\",\n ...props\n}: ColorModeToggleProps) {\n // Use icon size when no label, regular size when label is shown\n const buttonSize = showLabel ? size : iconSizeMap[size];\n const iconClass = iconClassMap[size];\n const textClass = textClassMap[size];\n\n const { preference, setPreference } = useColorMode();\n\n // Track hydration to prevent mismatch between server/client rendering.\n // This runs once after hydration to signal we can show client-specific values.\n const [mounted, setMounted] = useState(false);\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Intentional: standard hydration detection pattern\n useEffect(() => setMounted(true), []);\n\n // Simple icons and labels - no configuration needed\n const items = [\n { mode: \"system\" as const, Icon: Monitor, label: \"System\" },\n { mode: \"light\" as const, Icon: Sun, label: \"Light\" },\n { mode: \"dark\" as const, Icon: Moon, label: \"Dark\" },\n ];\n\n // Get current item based on preference, not resolved mode\n // Before hydration, always show \"system\" to match server render\n const currentItem = mounted\n ? items.find((item) => item.mode === preference) || items[0]\n : items[0]; // Always \"system\" on server\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant={variant}\n size={buttonSize}\n className={cn(className)}\n suppressHydrationWarning\n {...props}\n >\n {currentItem && <currentItem.Icon className={iconClass} />}\n {showLabel && (\n <span className={textClass}>{currentItem?.label}</span>\n )}\n <span className=\"sr-only\">Toggle color mode</span>\n </Button>\n }\n />\n <DropdownMenuContent align={align}>\n {items.map((item) => (\n <DropdownMenuItem\n key={item.mode}\n onClick={() => setPreference(item.mode)}\n className=\"flex items-center gap-2\"\n >\n <item.Icon className=\"size-4\" />\n <span>{item.label}</span>\n {preference === item.mode && (\n <span className=\"ml-auto text-xs opacity-60\">✓</span>\n )}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport { ColorModeToggle, type ColorModeToggleProps, type ColorModeToggleSize };\n"],"names":[],"mappings":";;;;;;;;;;AAeA;AAAoB;AACd;AACA;AACK;AAEX;AAGA;AAAqB;AACf;AACA;AACK;AAEX;AAGA;AAAqB;AACf;AACA;AACK;AAEX;AA0GA;AAAyB;AACb;AACH;AACP;AACY;AACJ;AAEV;AAEE;AACA;AACA;AAEA;AAIA;AAEA;AAGA;AAAc;AACqC;AACL;AACA;AAK9C;AAIA;AAEI;AAAA;AAAC;AAAA;AAEG;AAAC;AAAA;AACC;AACM;AACiB;AACC;AACpB;AAEH;AAAuD;AAEN;AAEP;AAAA;AAAA;AAAA;AAC7C;AAAA;AAKA;AAAC;AAAA;AAEuC;AAC5B;AAEV;AAA8B;AACZ;AAE8B;AAAA;AAAA;AAPtC;AAWhB;AAGN;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColorModeInitializer } from "./color-mode-initializer.js";
|
|
2
|
+
import { ColorModeToggle } from "./color-mode-toggle.js";
|
|
3
|
+
import { useColorMode } from "./use-color-mode.js";
|
|
4
|
+
export {
|
|
5
|
+
ColorModeInitializer,
|
|
6
|
+
ColorModeToggle,
|
|
7
|
+
useColorMode
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-color-mode.js","sources":["../../../../src/components/minidev.fun/color-mode/use-color-mode.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\n/**\n * Module-level flag to ensure the system color mode listener is set up only once.\n *\n * This is a pragmatic tradeoff: module-level mutable state is generally a code smell\n * in React (SSR issues, test leakage, not idiomatic), but the alternative would be\n * requiring users to wrap their app in a <ColorModeProvider>. Since we want zero-config\n * \"just works\" behavior, we accept this pattern here.\n *\n * It's safe because:\n * - Only runs client-side (window check in setupSystemListener)\n * - The listener is truly global (system color scheme is one per browser)\n * - It's idempotent and stateless (reads from cookie each time)\n */\nlet systemListenerInitialized = false;\n\n/**\n * Color mode preference options for the color mode system\n *\n * Controls how the application determines the active color mode:\n * - `\"system\"` - Automatically follows the user's OS preference\n * - `\"light\"` - Forces light mode regardless of system preference\n * - `\"dark\"` - Forces dark mode regardless of system preference\n *\n * @example\n * ```tsx\n * const { preference, setPreference } = useColorMode();\n *\n * // Switch to dark mode\n * setPreference(\"dark\");\n *\n * // Follow system preference\n * setPreference(\"system\");\n * ```\n *\n * @since 1.0.0\n */\nexport type ColorModePreference = \"system\" | \"light\" | \"dark\";\n\n/**\n * Internal color mode state structure stored in cookies\n *\n * Maintains both the user's preference and the actual mode value\n * to handle system color mode changes efficiently.\n *\n * @internal\n */\ntype ColorModeState = {\n /** User's selected color mode preference */\n preference: ColorModePreference;\n /** Actual mode applied to the DOM */\n mode: \"light\" | \"dark\";\n};\n\n/**\n * Cookie configuration for color mode persistence\n *\n * Uses secure defaults for cross-site compatibility and long-term storage.\n *\n * @internal\n */\nconst COOKIE_NAME = \"color-mode\";\nconst COOKIE_OPTIONS = {\n path: \"/\",\n maxAge: 60 * 60 * 24 * 365, // 1 year\n sameSite: \"lax\" as const,\n};\n\n/**\n * Retrieves the stored color mode preference from browser cookies\n *\n * Safely parses the cookie value and handles malformed data gracefully.\n * Returns null if no valid color mode data is found or if running server-side.\n *\n * @returns The stored color mode state or null if unavailable\n * @internal\n */\nfunction getColorModeFromCookie(): ColorModeState | null {\n if (typeof document === \"undefined\") return null;\n\n // Try new cookie name first, then fall back to legacy \"theme\" cookie\n let match = document.cookie.match(\n new RegExp(`(?:^|; )${COOKIE_NAME}=([^;]*)`),\n );\n if (!match) {\n match = document.cookie.match(/(?:^|; )theme=([^;]*)/);\n }\n if (!match) return null;\n\n try {\n const decoded = decodeURIComponent(match[1] || \"\");\n return JSON.parse(decoded);\n } catch {\n return null;\n }\n}\n\n/**\n * Persists the current color mode state to browser cookies\n *\n * Stores the complete color mode state as a JSON string with appropriate\n * cookie settings for security and longevity. Safe for server-side rendering.\n *\n * @param state - The color mode state to persist\n * @internal\n */\nfunction setColorModeCookie(state: ColorModeState) {\n if (typeof document === \"undefined\") return;\n\n const value = JSON.stringify(state);\n let cookieString = `${COOKIE_NAME}=${encodeURIComponent(value)}`;\n\n cookieString += `; path=${COOKIE_OPTIONS.path}`;\n cookieString += `; max-age=${COOKIE_OPTIONS.maxAge}`;\n cookieString += `; samesite=${COOKIE_OPTIONS.sameSite}`;\n\n document.cookie = cookieString;\n}\n\n/**\n * Detects the user's system color mode preference\n *\n * Uses the CSS media query `prefers-color-scheme` to determine if the user\n * has configured their OS to prefer dark or light modes. Falls back to\n * light mode for server-side rendering or unsupported browsers.\n *\n * @returns The system's preferred color mode\n * @internal\n */\nfunction getSystemColorMode(): \"light\" | \"dark\" {\n if (typeof window === \"undefined\") return \"light\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\";\n}\n\n/**\n * Applies the specified color mode to the document\n *\n * Updates the document's class list and color-scheme CSS property to reflect\n * the chosen mode. This triggers CSS-based mode switching throughout the\n * application and ensures native elements respect the mode choice.\n *\n * @param mode - The color mode to apply (\"light\" or \"dark\")\n * @internal\n */\nfunction applyColorMode(mode: \"light\" | \"dark\") {\n if (typeof document === \"undefined\") return;\n\n // For light mode, remove dark class (light is default)\n // For dark mode, add dark class\n if (mode === \"dark\") {\n document.documentElement.classList.add(\"dark\");\n } else {\n document.documentElement.classList.remove(\"dark\");\n }\n\n // Set color-scheme for native elements\n document.documentElement.style.colorScheme = mode;\n}\n\n/**\n * Sets up a global listener for system color mode changes.\n * Only runs once per module load, regardless of how many hook instances exist.\n *\n * @internal\n */\nfunction setupSystemListener() {\n if (systemListenerInitialized || typeof window === \"undefined\") return;\n systemListenerInitialized = true;\n\n const mediaQuery = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mediaQuery.addEventListener(\"change\", () => {\n // Only respond if current preference is \"system\"\n const stored = getColorModeFromCookie();\n if (stored?.preference !== \"system\") return;\n\n const mode: \"light\" | \"dark\" = mediaQuery.matches ? \"dark\" : \"light\";\n const newState: ColorModeState = { preference: \"system\", mode };\n\n setColorModeCookie(newState);\n applyColorMode(mode);\n window.dispatchEvent(\n new CustomEvent(\"color-mode-change\", { detail: newState }),\n );\n });\n}\n\n/**\n * Hook for managing application color mode with automatic system preference detection\n *\n * A complete color mode management solution that handles persistence, system preference\n * detection, and DOM manipulation without requiring any context providers. Designed\n * for applications that need simple light/dark mode switching with optional system\n * preference following.\n *\n * This hook works in conjunction with the {@link ColorModeScript} component to provide\n * a complete color mode solution with FOUC prevention and perfect synchronization\n * across multiple instances.\n *\n * Features:\n * - **Perfect synchronization**: Multiple hook instances stay in sync via custom events\n * - **Automatic persistence**: Color mode preference saved to cookies across sessions\n * - **System preference detection**: Automatically follows OS dark/light mode when set to \"system\"\n * - **Live system updates**: Responds to system color mode changes in real-time\n * - **SSR compatible**: Works safely during server-side rendering\n * - **Type safe**: Full TypeScript support with proper type definitions\n * - **No provider required**: Self-contained hook that works out of the box\n *\n * @example Basic color mode switching\n * ```tsx\n * function ColorModeToggle() {\n * const { preference, mode, setPreference } = useColorMode();\n *\n * const toggleMode = () => {\n * setPreference(mode === \"dark\" ? \"light\" : \"dark\");\n * };\n *\n * return (\n * <button onClick={toggleMode}>\n * Switch to {mode === \"dark\" ? \"light\" : \"dark\"} mode\n * </button>\n * );\n * }\n * ```\n *\n * @example Color mode selector dropdown\n * ```tsx\n * function ColorModeSelector() {\n * const { preference, setPreference } = useColorMode();\n *\n * return (\n * <select value={preference} onChange={(e) => setPreference(e.target.value as ColorModePreference)}>\n * <option value=\"system\">Follow system</option>\n * <option value=\"light\">Light mode</option>\n * <option value=\"dark\">Dark mode</option>\n * </select>\n * );\n * }\n * ```\n *\n * @returns Object containing current color mode state and setter function\n * @returns returns.preference - The user's selected color mode preference\n * @returns returns.mode - The actual color mode currently applied (always \"light\" or \"dark\")\n * @returns returns.setPreference - Function to change the color mode preference\n *\n * @see {@link ColorModePreference} - Available color mode preference options\n * @see {@link ColorModeScript} - Component for FOUC prevention\n * @see {@link ColorModeToggle} - UI component for color mode switching\n * @since 1.0.0\n */\nexport function useColorMode() {\n // Initialize state from cookie or default to system\n const [state, setState] = useState<ColorModeState>(() => {\n const saved = getColorModeFromCookie();\n if (saved) return saved;\n\n const mode = getSystemColorMode();\n return { preference: \"system\", mode };\n });\n\n // Set color mode preference - dispatch event, let event handler update state\n function setPreference(newPreference: ColorModePreference) {\n const mode =\n newPreference === \"system\" ? getSystemColorMode() : newPreference;\n const newState = { preference: newPreference, mode };\n\n // Update cookie and DOM immediately\n setColorModeCookie(newState);\n applyColorMode(mode);\n\n // Broadcast change - ALL instances (including this one) will update state from this event\n window.dispatchEvent(\n new CustomEvent(\"color-mode-change\", {\n detail: newState,\n }),\n );\n }\n\n // Set up global system listener once (idempotent) and listen for color mode changes\n useEffect(() => {\n setupSystemListener();\n\n const handleColorModeChange = (event: CustomEvent) => {\n setState(event.detail);\n };\n\n window.addEventListener(\n \"color-mode-change\",\n handleColorModeChange as EventListener,\n );\n return () =>\n window.removeEventListener(\n \"color-mode-change\",\n handleColorModeChange as EventListener,\n );\n }, []);\n\n return {\n preference: state.preference,\n mode: state.mode,\n setPreference,\n };\n}\n"],"names":[],"mappings":";;AAiBA;AA+CA;AACA;AAAuB;AACf;AACiB;AAAA;AAEzB;AAWA;AACE;AAGA;AAA4B;AACiB;AAE7C;AACE;AAAqD;AAEvD;AAEA;AACE;AACA;AAAyB;AAEzB;AAAO;AAEX;AAWA;AACE;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACF;AAYA;AACE;AACA;AAGF;AAYA;AACE;AAIA;AACE;AAA6C;AAE7C;AAAgD;AAIlD;AACF;AAQA;AACE;AACA;AAEA;AACA;AAEE;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAO;AACoD;AAAA;AAG/D;AAiEO;AAEL;AACE;AACA;AAEA;AACA;AAA+B;AAIjC;AACE;AAEA;AAGA;AACA;AAGA;AAAO;AACgC;AAC3B;AACT;AAAA;AAKL;AACE;AAEA;AACE;AAAqB;AAGvB;AAAO;AACL;AACA;AAEF;AACS;AACL;AACA;AAAA;AAIN;AAAO;AACa;AACN;AACZ;AAEJ;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function FirstLightFilters() {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
className: "absolute h-0 w-0",
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
style: { position: "absolute", width: 0, height: 0 },
|
|
10
|
+
children: /* @__PURE__ */ jsxs("defs", { children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(
|
|
12
|
+
"filter",
|
|
13
|
+
{
|
|
14
|
+
id: "first-light-filter",
|
|
15
|
+
x: "-3%",
|
|
16
|
+
y: "-3%",
|
|
17
|
+
width: "106%",
|
|
18
|
+
height: "106%",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
"feTurbulence",
|
|
22
|
+
{
|
|
23
|
+
type: "fractalNoise",
|
|
24
|
+
baseFrequency: "0.015",
|
|
25
|
+
numOctaves: "2",
|
|
26
|
+
seed: "1",
|
|
27
|
+
result: "noise"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
"feDisplacementMap",
|
|
32
|
+
{
|
|
33
|
+
in: "SourceGraphic",
|
|
34
|
+
in2: "noise",
|
|
35
|
+
scale: "1.5",
|
|
36
|
+
xChannelSelector: "R",
|
|
37
|
+
yChannelSelector: "G"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxs(
|
|
44
|
+
"filter",
|
|
45
|
+
{
|
|
46
|
+
id: "first-light-filter-light",
|
|
47
|
+
x: "-2%",
|
|
48
|
+
y: "-2%",
|
|
49
|
+
width: "104%",
|
|
50
|
+
height: "104%",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
"feTurbulence",
|
|
54
|
+
{
|
|
55
|
+
type: "fractalNoise",
|
|
56
|
+
baseFrequency: "0.006",
|
|
57
|
+
numOctaves: "1",
|
|
58
|
+
seed: "2",
|
|
59
|
+
result: "noise"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"feDisplacementMap",
|
|
64
|
+
{
|
|
65
|
+
in: "SourceGraphic",
|
|
66
|
+
in2: "noise",
|
|
67
|
+
scale: "0.4",
|
|
68
|
+
xChannelSelector: "R",
|
|
69
|
+
yChannelSelector: "G"
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsxs(
|
|
76
|
+
"filter",
|
|
77
|
+
{
|
|
78
|
+
id: "first-light-filter-heavy",
|
|
79
|
+
x: "-3%",
|
|
80
|
+
y: "-3%",
|
|
81
|
+
width: "106%",
|
|
82
|
+
height: "106%",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"feTurbulence",
|
|
86
|
+
{
|
|
87
|
+
type: "fractalNoise",
|
|
88
|
+
baseFrequency: "0.012",
|
|
89
|
+
numOctaves: "3",
|
|
90
|
+
seed: "3",
|
|
91
|
+
result: "noise"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"feDisplacementMap",
|
|
96
|
+
{
|
|
97
|
+
in: "SourceGraphic",
|
|
98
|
+
in2: "noise",
|
|
99
|
+
scale: "1.5",
|
|
100
|
+
xChannelSelector: "R",
|
|
101
|
+
yChannelSelector: "G"
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
FirstLightFilters
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=first-light-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-light-filters.js","sources":["../../../../src/components/minidev.fun/first-light/first-light-filters.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * FirstLightFilters - SVG filter definitions for hand-drawn/sketch effects\n *\n * This component must be rendered once in your app (typically in your root layout)\n * when using the First Light theme. It provides the SVG filters that create the\n * hand-drawn wobble effect on components.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * import \"@minidev.fun/ui/themes/first-light\";\n * import { FirstLightFilters } from \"@minidev.fun/ui/first-light\";\n *\n * export default function Layout({ children }) {\n * return (\n * <html>\n * <body>\n * <FirstLightFilters />\n * {children}\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function FirstLightFilters() {\n return (\n <svg\n className=\"absolute h-0 w-0\"\n aria-hidden=\"true\"\n style={{ position: \"absolute\", width: 0, height: 0 }}\n >\n <defs>\n {/* Standard first-light filter - hand-drawn wobble */}\n <filter\n id=\"first-light-filter\"\n x=\"-3%\"\n y=\"-3%\"\n width=\"106%\"\n height=\"106%\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.015\"\n numOctaves=\"2\"\n seed=\"1\"\n result=\"noise\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"noise\"\n scale=\"1.5\"\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n\n {/* Light first-light filter - barely noticeable */}\n <filter\n id=\"first-light-filter-light\"\n x=\"-2%\"\n y=\"-2%\"\n width=\"104%\"\n height=\"104%\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.006\"\n numOctaves=\"1\"\n seed=\"2\"\n result=\"noise\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"noise\"\n scale=\"0.4\"\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n\n {/* Heavy first-light filter - more pronounced wobble */}\n <filter\n id=\"first-light-filter-heavy\"\n x=\"-3%\"\n y=\"-3%\"\n width=\"106%\"\n height=\"106%\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.012\"\n numOctaves=\"3\"\n seed=\"3\"\n result=\"noise\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"noise\"\n scale=\"1.5\"\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n </defs>\n </svg>\n );\n}\n"],"names":[],"mappings":";;AA2BO;AACL;AACE;AAAC;AAAA;AACW;AACE;AACqC;AAI/C;AAAA;AAAC;AAAA;AACI;AACD;AACA;AACI;AACC;AAEP;AAAA;AAAC;AAAA;AACM;AACS;AACH;AACN;AACE;AAAA;AAAA;AAET;AAAC;AAAA;AACI;AACC;AACE;AACW;AACA;AAAA;AAAA;AACnB;AAAA;AAAA;AAIF;AAAC;AAAA;AACI;AACD;AACA;AACI;AACC;AAEP;AAAA;AAAC;AAAA;AACM;AACS;AACH;AACN;AACE;AAAA;AAAA;AAET;AAAC;AAAA;AACI;AACC;AACE;AACW;AACA;AAAA;AAAA;AACnB;AAAA;AAAA;AAIF;AAAC;AAAA;AACI;AACD;AACA;AACI;AACC;AAEP;AAAA;AAAC;AAAA;AACM;AACS;AACH;AACN;AACE;AAAA;AAAA;AAET;AAAC;AAAA;AACI;AACC;AACE;AACW;AACA;AAAA;AAAA;AACnB;AAAA;AAAA;AAEJ;AAAA;AAGN;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { typographyColorVariants } from "../../../lib/variants.js";
|
|
5
|
+
function Blockquote({ color, className, children, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"blockquote",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "blockquote",
|
|
10
|
+
className: cn(
|
|
11
|
+
"border-l-4 border-border pl-4 italic",
|
|
12
|
+
typographyColorVariants({ color }),
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
...props,
|
|
16
|
+
children
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
Blockquote
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=blockquote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockquote.js","sources":["../../../../src/components/minidev.fun/typography/blockquote.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { typographyColorVariants, type TypographyColor } from \"@/lib/variants\";\n\ntype BlockquoteColor = Extract<TypographyColor, \"default\" | \"muted\" | \"subtle\">;\n\ninterface BlockquoteProps extends React.HTMLAttributes<HTMLQuoteElement> {\n /** Text color (limited to neutral colors for semantic appropriateness) */\n color?: BlockquoteColor;\n}\n\n/**\n * Blockquote component for quoted content with a left border accent.\n */\nfunction Blockquote({ color, className, children, ...props }: BlockquoteProps) {\n return (\n <blockquote\n data-slot=\"blockquote\"\n className={cn(\n \"border-l-4 border-border pl-4 italic\",\n typographyColorVariants({ color }),\n className,\n )}\n {...props}\n >\n {children}\n </blockquote>\n );\n}\n\nexport { Blockquote, type BlockquoteProps, type BlockquoteColor };\n"],"names":[],"mappings":";;;;AAeA,SAAS,WAAW,EAAE,OAAO,WAAW,UAAU,GAAG,SAA0B;AAC7E,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA,wBAAwB,EAAE,OAAO;AAAA,QACjC;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { typographyColorVariants } from "../../../lib/variants.js";
|
|
5
|
+
function Code({ color, className, children, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"code",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "code",
|
|
10
|
+
className: cn(
|
|
11
|
+
"font-mono text-sm bg-muted px-1.5 py-0.5 rounded",
|
|
12
|
+
typographyColorVariants({ color }),
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
...props,
|
|
16
|
+
children
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
Code
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sources":["../../../../src/components/minidev.fun/typography/code.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { typographyColorVariants, type TypographyColor } from \"@/lib/variants\";\n\ninterface CodeProps extends React.HTMLAttributes<HTMLElement> {\n /** Text color */\n color?: TypographyColor;\n}\n\n/**\n * Inline code component with monospace font and subtle background.\n * For code blocks, use a dedicated syntax highlighting solution.\n */\nfunction Code({ color, className, children, ...props }: CodeProps) {\n return (\n <code\n data-slot=\"code\"\n className={cn(\n \"font-mono text-sm bg-muted px-1.5 py-0.5 rounded\",\n typographyColorVariants({ color }),\n className,\n )}\n {...props}\n >\n {children}\n </code>\n );\n}\n\nexport { Code, type CodeProps };\n"],"names":[],"mappings":";;;;AAcA,SAAS,KAAK,EAAE,OAAO,WAAW,UAAU,GAAG,SAAoB;AACjE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA,wBAAwB,EAAE,OAAO;AAAA,QACjC;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Title, type TitleProps } from './title';
|
|
2
|
+
export { Text, Caption, Overline, type TextProps, type TextSize, type TextWeight, type TextAlign, type TextTransform, type TextWrap, type LineClamp, } from './text';
|
|
3
|
+
export { Code, type CodeProps } from './code';
|
|
4
|
+
export { Blockquote, type BlockquoteProps, type BlockquoteColor, } from './blockquote';
|
|
5
|
+
export { ListItem, type ListItemProps, type ListItemColor, } from './list-item';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Title } from "./title.js";
|
|
2
|
+
import { Caption, Overline, Text } from "./text.js";
|
|
3
|
+
import { Code } from "./code.js";
|
|
4
|
+
import { Blockquote } from "./blockquote.js";
|
|
5
|
+
import { ListItem } from "./list-item.js";
|
|
6
|
+
export {
|
|
7
|
+
Blockquote,
|
|
8
|
+
Caption,
|
|
9
|
+
Code,
|
|
10
|
+
ListItem,
|
|
11
|
+
Overline,
|
|
12
|
+
Text,
|
|
13
|
+
Title
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { typographyColorVariants } from "../../../lib/variants.js";
|
|
5
|
+
function ListItem({ color, className, children, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"li",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "list-item",
|
|
10
|
+
className: cn(typographyColorVariants({ color }), className),
|
|
11
|
+
...props,
|
|
12
|
+
children
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
ListItem
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=list-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-item.js","sources":["../../../../src/components/minidev.fun/typography/list-item.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\nimport { typographyColorVariants, type TypographyColor } from \"@/lib/variants\";\r\n\r\ntype ListVariant = \"unordered\" | \"ordered\";\r\n\r\ntype UnorderedMarker = \"disc\" | \"circle\" | \"square\" | \"none\";\r\ntype OrderedMarker =\r\n | \"decimal\"\r\n | \"lower-alpha\"\r\n | \"upper-alpha\"\r\n | \"lower-roman\"\r\n | \"upper-roman\";\r\n\r\ntype ListMarker = UnorderedMarker | OrderedMarker;\r\n\r\ninterface ListProps extends React.HTMLAttributes<\r\n HTMLUListElement | HTMLOListElement\r\n> {\r\n /** Ordered or unordered list */\r\n variant?: ListVariant;\r\n /** Marker style (bullets / numbering) */\r\n marker?: ListMarker;\r\n}\r\n\r\n/**\r\n * List component supporting ordered and unordered lists with marker variants.\r\n */\r\nfunction List({\r\n variant = \"unordered\",\r\n marker,\r\n className,\r\n ...props\r\n}: ListProps) {\r\n const Comp = variant === \"ordered\" ? \"ol\" : \"ul\";\r\n\r\n return (\r\n <Comp\r\n data-slot=\"list\"\r\n className={cn(\r\n \"space-y-2 pl-6\",\r\n\r\n // unordered markers\r\n variant === \"unordered\" && (marker ?? \"disc\") === \"disc\" && \"list-disc\",\r\n variant === \"unordered\" && marker === \"circle\" && \"list-[circle]\",\r\n variant === \"unordered\" && marker === \"square\" && \"list-[square]\",\r\n variant === \"unordered\" && marker === \"none\" && \"list-none\",\r\n\r\n // ordered markers\r\n variant === \"ordered\" &&\r\n (marker ?? \"decimal\") === \"decimal\" &&\r\n \"list-decimal\",\r\n variant === \"ordered\" &&\r\n marker === \"lower-alpha\" &&\r\n \"list-[lower-alpha]\",\r\n variant === \"ordered\" &&\r\n marker === \"upper-alpha\" &&\r\n \"list-[upper-alpha]\",\r\n variant === \"ordered\" &&\r\n marker === \"lower-roman\" &&\r\n \"list-[lower-roman]\",\r\n variant === \"ordered\" &&\r\n marker === \"upper-roman\" &&\r\n \"list-[upper-roman]\",\r\n\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype ListItemColor = Extract<TypographyColor, \"default\" | \"muted\" | \"subtle\">;\r\n\r\ninterface ListItemProps extends React.LiHTMLAttributes<HTMLLIElement> {\r\n /** Text color (limited to neutral colors for semantic appropriateness) */\r\n color?: ListItemColor;\r\n}\r\n\r\n/**\r\n * ListItem component for styled list content.\r\n */\r\nfunction ListItem({ color, className, children, ...props }: ListItemProps) {\r\n return (\r\n <li\r\n data-slot=\"list-item\"\r\n className={cn(typographyColorVariants({ color }), className)}\r\n {...props}\r\n >\r\n {children}\r\n </li>\r\n );\r\n}\r\n\r\nexport {\r\n List,\r\n ListItem,\r\n type ListProps,\r\n type ListVariant,\r\n type ListMarker,\r\n type ListItemProps,\r\n type ListItemColor,\r\n};\r\n"],"names":[],"mappings":";;;;AAmFA,SAAS,SAAS,EAAE,OAAO,WAAW,UAAU,GAAG,SAAwB;AACzE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,wBAAwB,EAAE,MAAA,CAAO,GAAG,SAAS;AAAA,MAC1D,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { typographyColorVariants, textVariants } from "../../../lib/variants.js";
|
|
5
|
+
const lineClampClasses = {
|
|
6
|
+
1: "line-clamp-1",
|
|
7
|
+
2: "line-clamp-2",
|
|
8
|
+
3: "line-clamp-3",
|
|
9
|
+
4: "line-clamp-4",
|
|
10
|
+
5: "line-clamp-5",
|
|
11
|
+
6: "line-clamp-6"
|
|
12
|
+
};
|
|
13
|
+
const wrapClasses = {
|
|
14
|
+
pretty: "text-pretty",
|
|
15
|
+
balance: "text-balance"
|
|
16
|
+
};
|
|
17
|
+
function Text({
|
|
18
|
+
size,
|
|
19
|
+
weight,
|
|
20
|
+
color,
|
|
21
|
+
align,
|
|
22
|
+
transform,
|
|
23
|
+
wrap,
|
|
24
|
+
lineClamp,
|
|
25
|
+
as,
|
|
26
|
+
render,
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
const classes = cn(
|
|
32
|
+
textVariants({ size, weight, align, transform }),
|
|
33
|
+
typographyColorVariants({ color }),
|
|
34
|
+
wrap && wrapClasses[wrap],
|
|
35
|
+
lineClamp && lineClampClasses[lineClamp],
|
|
36
|
+
className
|
|
37
|
+
);
|
|
38
|
+
if (render) {
|
|
39
|
+
return React.cloneElement(render, {
|
|
40
|
+
className: cn(classes, render.props.className),
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const Component = as ?? "p";
|
|
46
|
+
return /* @__PURE__ */ jsx(Component, { "data-slot": "text", className: classes, ...props, children });
|
|
47
|
+
}
|
|
48
|
+
function Caption(props) {
|
|
49
|
+
return /* @__PURE__ */ jsx(Text, { size: "xs", color: "muted", ...props });
|
|
50
|
+
}
|
|
51
|
+
function Overline(props) {
|
|
52
|
+
return /* @__PURE__ */ jsx(Text, { size: "xs", transform: "uppercase", ...props });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
Caption,
|
|
56
|
+
Overline,
|
|
57
|
+
Text
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../../src/components/minidev.fun/typography/text.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n textVariants,\n typographyColorVariants,\n type TypographyColor,\n} from \"@/lib/variants\";\n\ntype TextSize = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\";\ntype TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\ntype TextAlign = \"left\" | \"center\" | \"right\";\ntype TextTransform = \"uppercase\" | \"lowercase\" | \"capitalize\";\ntype TextWrap = \"pretty\" | \"balance\";\ntype LineClamp = 1 | 2 | 3 | 4 | 5 | 6;\n\ntype TextProps = React.HTMLAttributes<HTMLParagraphElement> & {\n /** Text size - uses Tailwind scale. Default: \"base\" */\n size?: TextSize;\n /** Font weight */\n weight?: TextWeight;\n /** Text color */\n color?: TypographyColor;\n /** Text alignment */\n align?: TextAlign;\n /** Text transform */\n transform?: TextTransform;\n /** Text wrapping: \"pretty\" avoids orphans, \"balance\" equalizes line lengths */\n wrap?: TextWrap;\n /** Truncate text after N lines with ellipsis (uses Tailwind line-clamp-*) */\n lineClamp?: LineClamp;\n /** Change rendered element (simple polymorphism) */\n as?: React.ElementType;\n /** Change rendered element (advanced - takes precedence over `as`) */\n render?: React.ReactElement<{\n className?: string;\n children?: React.ReactNode;\n }>;\n};\n\nconst lineClampClasses: Record<LineClamp, string> = {\n 1: \"line-clamp-1\",\n 2: \"line-clamp-2\",\n 3: \"line-clamp-3\",\n 4: \"line-clamp-4\",\n 5: \"line-clamp-5\",\n 6: \"line-clamp-6\",\n};\n\nconst wrapClasses: Record<TextWrap, string> = {\n pretty: \"text-pretty\",\n balance: \"text-balance\",\n};\n\nfunction Text({\n size,\n weight,\n color,\n align,\n transform,\n wrap,\n lineClamp,\n as,\n render,\n className,\n children,\n ...props\n}: TextProps) {\n const classes = cn(\n textVariants({ size, weight, align, transform }),\n typographyColorVariants({ color }),\n wrap && wrapClasses[wrap],\n lineClamp && lineClampClasses[lineClamp],\n className,\n );\n\n // render prop takes precedence\n if (render) {\n return React.cloneElement(render, {\n className: cn(classes, render.props.className),\n children,\n ...props,\n });\n }\n\n // as prop for simple element swap\n const Component = as ?? \"p\";\n\n return (\n <Component data-slot=\"text\" className={classes} {...props}>\n {children}\n </Component>\n );\n}\n\n/**\n * Caption - convenience alias for small, muted text.\n * Ideal for metadata, timestamps, and secondary information.\n */\nfunction Caption(props: TextProps) {\n return <Text size=\"xs\" color=\"muted\" {...props} />;\n}\n\n/**\n * Overline - convenience alias for uppercase label text.\n * Ideal for category labels and section headers.\n */\nfunction Overline(props: TextProps) {\n return <Text size=\"xs\" transform=\"uppercase\" {...props} />;\n}\n\nexport {\n Text,\n Caption,\n Overline,\n type TextProps,\n type TextSize,\n type TextWeight,\n type TextAlign,\n type TextTransform,\n type TextWrap,\n type LineClamp,\n};\n"],"names":[],"mappings":";;;;AAwCA,MAAM,mBAA8C;AAAA,EAClD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,cAAwC;AAAA,EAC5C,QAAQ;AAAA,EACR,SAAS;AACX;AAEA,SAAS,KAAK;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAc;AACZ,QAAM,UAAU;AAAA,IACd,aAAa,EAAE,MAAM,QAAQ,OAAO,WAAW;AAAA,IAC/C,wBAAwB,EAAE,OAAO;AAAA,IACjC,QAAQ,YAAY,IAAI;AAAA,IACxB,aAAa,iBAAiB,SAAS;AAAA,IACvC;AAAA,EAAA;AAIF,MAAI,QAAQ;AACV,WAAO,MAAM,aAAa,QAAQ;AAAA,MAChC,WAAW,GAAG,SAAS,OAAO,MAAM,SAAS;AAAA,MAC7C;AAAA,MACA,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AAGA,QAAM,YAAY,MAAM;AAExB,SACE,oBAAC,aAAU,aAAU,QAAO,WAAW,SAAU,GAAG,OACjD,UACH;AAEJ;AAMA,SAAS,QAAQ,OAAkB;AACjC,6BAAQ,MAAA,EAAK,MAAK,MAAK,OAAM,SAAS,GAAG,OAAO;AAClD;AAMA,SAAS,SAAS,OAAkB;AAClC,6BAAQ,MAAA,EAAK,MAAK,MAAK,WAAU,aAAa,GAAG,OAAO;AAC1D;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { typographyColorVariants, titleVariants, titleOrderSizeVariants, titleOrderStyleVariants } from "../../../lib/variants.js";
|
|
5
|
+
const orderToElement = {
|
|
6
|
+
1: "h1",
|
|
7
|
+
2: "h2",
|
|
8
|
+
3: "h3",
|
|
9
|
+
4: "h4",
|
|
10
|
+
5: "h5",
|
|
11
|
+
6: "h6"
|
|
12
|
+
};
|
|
13
|
+
function Title({
|
|
14
|
+
order = 2,
|
|
15
|
+
size,
|
|
16
|
+
weight,
|
|
17
|
+
color,
|
|
18
|
+
as,
|
|
19
|
+
render,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
const classes = cn(
|
|
25
|
+
// Order-based style defaults (weight, tracking, leading) - always applied
|
|
26
|
+
titleOrderStyleVariants({ order }),
|
|
27
|
+
// Size: use explicit size if provided, otherwise use order-based default
|
|
28
|
+
size ? titleVariants({ size }) : titleOrderSizeVariants({ order }),
|
|
29
|
+
// Weight override if provided (overrides order-based weight)
|
|
30
|
+
weight && titleVariants({ weight }),
|
|
31
|
+
typographyColorVariants({ color }),
|
|
32
|
+
className
|
|
33
|
+
);
|
|
34
|
+
if (render) {
|
|
35
|
+
return React.cloneElement(render, {
|
|
36
|
+
className: cn(classes, render.props.className),
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const Component = as ?? orderToElement[order];
|
|
42
|
+
return /* @__PURE__ */ jsx(Component, { "data-slot": "title", className: classes, ...props, children });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
Title
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.js","sources":["../../../../src/components/minidev.fun/typography/title.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n titleVariants,\n titleOrderSizeVariants,\n titleOrderStyleVariants,\n typographyColorVariants,\n type TitleOrder,\n type TitleSize,\n type TitleWeight,\n type TypographyColor,\n} from \"@/lib/variants\";\n\ntype TitleProps = React.HTMLAttributes<HTMLHeadingElement> & {\n /** Semantic heading level - renders h1-h6. Default: 2 */\n order?: TitleOrder;\n /** Visual size override - independent of order. If not set, uses order's default sizing. */\n size?: TitleSize;\n /** Font weight override */\n weight?: TitleWeight;\n /** Text color */\n color?: TypographyColor;\n /** Change rendered element (simple polymorphism) */\n as?: React.ElementType;\n /** Change rendered element (advanced - takes precedence over `as`) */\n render?: React.ReactElement<{\n className?: string;\n children?: React.ReactNode;\n }>;\n};\n\nconst orderToElement: Record<\n TitleOrder,\n \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"\n> = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\",\n};\n\nfunction Title({\n order = 2,\n size,\n weight,\n color,\n as,\n render,\n className,\n children,\n ...props\n}: TitleProps) {\n const classes = cn(\n // Order-based style defaults (weight, tracking, leading) - always applied\n titleOrderStyleVariants({ order }),\n // Size: use explicit size if provided, otherwise use order-based default\n size ? titleVariants({ size }) : titleOrderSizeVariants({ order }),\n // Weight override if provided (overrides order-based weight)\n weight && titleVariants({ weight }),\n typographyColorVariants({ color }),\n className,\n );\n\n // render prop takes precedence\n if (render) {\n return React.cloneElement(render, {\n className: cn(classes, render.props.className),\n children,\n ...props,\n });\n }\n\n // as prop for simple element swap\n const Component = as ?? orderToElement[order];\n\n return (\n <Component data-slot=\"title\" className={classes} {...props}>\n {children}\n </Component>\n );\n}\n\nexport { Title, type TitleProps };\n"],"names":[],"mappings":";;;;AAgCA,MAAM,iBAGF;AAAA,EACF,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,SAAS,MAAM;AAAA,EACb,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAe;AACb,QAAM,UAAU;AAAA;AAAA,IAEd,wBAAwB,EAAE,OAAO;AAAA;AAAA,IAEjC,OAAO,cAAc,EAAE,KAAA,CAAM,IAAI,uBAAuB,EAAE,OAAO;AAAA;AAAA,IAEjE,UAAU,cAAc,EAAE,QAAQ;AAAA,IAClC,wBAAwB,EAAE,OAAO;AAAA,IACjC;AAAA,EAAA;AAIF,MAAI,QAAQ;AACV,WAAO,MAAM,aAAa,QAAQ;AAAA,MAChC,WAAW,GAAG,SAAS,OAAO,MAAM,SAAS;AAAA,MAC7C;AAAA,MACA,GAAG;AAAA,IAAA,CACJ;AAAA,EACH;AAGA,QAAM,YAAY,MAAM,eAAe,KAAK;AAE5C,SACE,oBAAC,aAAU,aAAU,SAAQ,WAAW,SAAU,GAAG,OAClD,UACH;AAEJ;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion';
|
|
2
|
+
/**
|
|
3
|
+
* Root container for accordion items. Manages expand/collapse state and keyboard navigation.
|
|
4
|
+
* Supports single or multiple open items simultaneously.
|
|
5
|
+
*/
|
|
6
|
+
declare function Accordion({ className, ...props }: AccordionPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Container for a single accordion item. Groups trigger and content panel.
|
|
9
|
+
* Each item must have a unique `value` prop.
|
|
10
|
+
*/
|
|
11
|
+
declare function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Button that toggles the accordion item open/closed.
|
|
14
|
+
* Automatically includes chevron icons that flip based on open state.
|
|
15
|
+
*/
|
|
16
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Collapsible panel containing the accordion item's content.
|
|
19
|
+
* Automatically animates height on open/close with slide animation.
|
|
20
|
+
*/
|
|
21
|
+
declare function AccordionContent({ className, children, ...props }: AccordionPrimitive.Panel.Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
type AccordionProps = AccordionPrimitive.Root.Props;
|
|
23
|
+
type AccordionItemProps = AccordionPrimitive.Item.Props;
|
|
24
|
+
type AccordionTriggerProps = AccordionPrimitive.Trigger.Props;
|
|
25
|
+
type AccordionContentProps = AccordionPrimitive.Panel.Props;
|
|
26
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, type AccordionProps, type AccordionItemProps, type AccordionTriggerProps, type AccordionContentProps, };
|
|
27
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
3
|
-
import ChevronDown from "
|
|
4
|
-
import ChevronUp from "
|
|
5
|
-
import { AccordionRoot } from "
|
|
6
|
-
import { AccordionPanel } from "
|
|
7
|
-
import { AccordionItem as AccordionItem$1 } from "
|
|
8
|
-
import { AccordionHeader } from "
|
|
9
|
-
import { AccordionTrigger as AccordionTrigger$1 } from "
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import ChevronDown from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
4
|
+
import ChevronUp from "../../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
|
|
5
|
+
import { AccordionRoot } from "../../node_modules/@base-ui/react/esm/accordion/root/AccordionRoot.js";
|
|
6
|
+
import { AccordionPanel } from "../../node_modules/@base-ui/react/esm/accordion/panel/AccordionPanel.js";
|
|
7
|
+
import { AccordionItem as AccordionItem$1 } from "../../node_modules/@base-ui/react/esm/accordion/item/AccordionItem.js";
|
|
8
|
+
import { AccordionHeader } from "../../node_modules/@base-ui/react/esm/accordion/header/AccordionHeader.js";
|
|
9
|
+
import { AccordionTrigger as AccordionTrigger$1 } from "../../node_modules/@base-ui/react/esm/accordion/trigger/AccordionTrigger.js";
|
|
10
10
|
function Accordion({ className, ...props }) {
|
|
11
11
|
return /* @__PURE__ */ jsx(
|
|
12
12
|
AccordionRoot,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/ui/accordion.tsx"],"sourcesContent":["import { Accordion as AccordionPrimitive } from \"@base-ui/react/accordion\";\n\nimport { cn } from \"@/lib/utils\";\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\n/**\n * Root container for accordion items. Manages expand/collapse state and keyboard navigation.\n * Supports single or multiple open items simultaneously.\n */\nfunction Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={cn(\"flex w-full flex-col\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Container for a single accordion item. Groups trigger and content panel.\n * Each item must have a unique `value` prop.\n */\nfunction AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn(\"not-last:border-b\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Button that toggles the accordion item open/closed.\n * Automatically includes chevron icons that flip based on open state.\n */\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: AccordionPrimitive.Trigger.Props) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n \"focus-visible:ring-ring/50 focus-visible:border-ring focus-visible:after:border-ring **:data-[slot=accordion-trigger-icon]:text-muted-foreground rounded-md py-4 text-left text-sm font-medium hover:underline focus-visible:ring-[3px] **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden\"\n />\n <ChevronUpIcon\n data-slot=\"accordion-trigger-icon\"\n className=\"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline\"\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\n/**\n * Collapsible panel containing the accordion item's content.\n * Automatically animates height on open/close with slide animation.\n */\nfunction AccordionContent({\n className,\n children,\n ...props\n}: AccordionPrimitive.Panel.Props) {\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-content\"\n className=\"data-open:animate-accordion-down data-closed:animate-accordion-up text-sm overflow-hidden\"\n {...props}\n >\n <div\n className={cn(\n \"pt-0 pb-4 [&_a]:hover:text-foreground h-(--accordion-panel-height) data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4\",\n className,\n )}\n >\n {children}\n </div>\n </AccordionPrimitive.Panel>\n );\n}\n\ntype AccordionProps = AccordionPrimitive.Root.Props;\ntype AccordionItemProps = AccordionPrimitive.Item.Props;\ntype AccordionTriggerProps = AccordionPrimitive.Trigger.Props;\ntype AccordionContentProps = AccordionPrimitive.Panel.Props;\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n};\n"],"names":["AccordionPrimitive.Root","AccordionPrimitive.Item","AccordionPrimitive.Header","AccordionPrimitive.Trigger","ChevronDownIcon","ChevronUpIcon","AccordionPrimitive.Panel"],"mappings":";;;;;;;;;AASA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAwC;AACzE,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,wBAAwB,SAAS;AAAA,MAC9C,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAMA,SAAS,cAAc,EAAE,WAAW,GAAG,SAAwC;AAC7E,SACE;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,qBAAqB,SAAS;AAAA,MAC3C,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAMA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqC;AACnC,SACE,oBAACC,iBAAA,EAA0B,WAAU,QACnC,UAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA;AAAA,QACD;AAAA,UAACC;AAAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAEZ;AAAA,UAACC;AAAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAMA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmC;AACjC,SACE;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UAAA;AAAA,UAGD;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
type AlertDialogProps = AlertDialogPrimitive.Root.Props;
|
|
5
|
+
/** Root container for alert dialog. Manages open state and accessibility. */
|
|
6
|
+
declare function AlertDialog({ ...props }: AlertDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
type AlertDialogTriggerProps = AlertDialogPrimitive.Trigger.Props;
|
|
8
|
+
/** Button that opens the alert dialog. Use `render` prop to customize. */
|
|
9
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type AlertDialogPortalProps = AlertDialogPrimitive.Portal.Props;
|
|
11
|
+
/** Portal container for alert dialog content and overlay. */
|
|
12
|
+
declare function AlertDialogPortal({ ...props }: AlertDialogPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
type AlertDialogOverlayProps = AlertDialogPrimitive.Backdrop.Props;
|
|
14
|
+
/** Semi-transparent backdrop overlay with frosted glass effect. */
|
|
15
|
+
declare function AlertDialogOverlay({ className, ...props }: AlertDialogOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type AlertDialogContentProps = AlertDialogPrimitive.Popup.Props & {
|
|
17
|
+
/** Dialog size variant. @default "default" */
|
|
18
|
+
size?: "default" | "sm";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Alert dialog content with automatic portal and backdrop.
|
|
22
|
+
* Centered, animated popup with two size variants.
|
|
23
|
+
*/
|
|
24
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
type AlertDialogHeaderProps = React.ComponentProps<"div">;
|
|
26
|
+
/** Header section for title, description, and optional media icon. */
|
|
27
|
+
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
type AlertDialogFooterProps = React.ComponentProps<"div">;
|
|
29
|
+
/** Footer section for action and cancel buttons. */
|
|
30
|
+
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
type AlertDialogMediaProps = React.ComponentProps<"div">;
|
|
32
|
+
/** Optional visual indicator icon container. Commonly used for warnings or errors. */
|
|
33
|
+
declare function AlertDialogMedia({ className, ...props }: AlertDialogMediaProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
35
|
+
/** Alert dialog title. Automatically announced by screen readers. */
|
|
36
|
+
declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialogPrimitive.Description>;
|
|
38
|
+
/** Alert dialog description text. Supports links with automatic styling. */
|
|
39
|
+
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
type AlertDialogActionProps = React.ComponentProps<typeof Button>;
|
|
41
|
+
/** Primary action button. Inherits all Button variants. */
|
|
42
|
+
declare function AlertDialogAction({ className, ...props }: AlertDialogActionProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
type AlertDialogCancelProps = AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">;
|
|
44
|
+
/** Cancel button that closes the alert dialog. Defaults to outline variant. */
|
|
45
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogCancelProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertDialogProps, type AlertDialogTriggerProps, type AlertDialogPortalProps, type AlertDialogOverlayProps, type AlertDialogContentProps, type AlertDialogHeaderProps, type AlertDialogFooterProps, type AlertDialogMediaProps, type AlertDialogTitleProps, type AlertDialogDescriptionProps, type AlertDialogActionProps, type AlertDialogCancelProps, };
|
|
47
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|