@justanarthur/modo-ui 0.5.0 → 0.6.0-canary.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/DESIGN.md +608 -0
- package/README.md +61 -39
- package/blocks/sidebar-app/examples.mdx +33 -0
- package/blocks/sidebar-app/index.tsx +218 -0
- package/blocks/sidebar-app/inset-topbar.tsx +25 -0
- package/blocks/sidebar-app/menu-grid.ts +26 -0
- package/blocks/sidebar-app/nav-data.ts +36 -0
- package/blocks/sidebar-app/search-field.tsx +48 -0
- package/blocks/sidebar-app/user-footer.tsx +67 -0
- package/blocks/sidebar-app/workspace-header.tsx +129 -0
- package/components/AI/input-message/examples.mdx +124 -0
- package/components/AI/input-message/file-thumbnail.tsx +173 -0
- package/components/AI/input-message/index.tsx +1383 -0
- package/components/AI/thinking-indicator/examples.mdx +27 -0
- package/components/AI/thinking-indicator/index.tsx +210 -0
- package/components/accordion/examples.mdx +148 -0
- package/components/accordion/index.tsx +1034 -0
- package/components/avatar/examples.mdx +95 -0
- package/components/avatar/index.tsx +129 -0
- package/components/badge/change-demo.tsx +29 -0
- package/components/badge/examples.mdx +120 -0
- package/components/badge/index.tsx +225 -0
- package/components/badge/variants.ts +73 -0
- package/components/button/examples.mdx +164 -0
- package/components/button/index.tsx +416 -0
- package/components/button/loading-demo.tsx +25 -0
- package/components/button/variants.ts +166 -0
- package/components/card/examples.mdx +212 -0
- package/components/card/index.tsx +1037 -0
- package/components/copy/examples.mdx +87 -0
- package/components/copy/index.tsx +482 -0
- package/components/inputs/checkbox/examples.mdx +83 -0
- package/components/inputs/checkbox/index.tsx +611 -0
- package/components/inputs/checkbox/select-all-demo.tsx +48 -0
- package/components/inputs/color-picker/examples.mdx +72 -0
- package/components/inputs/color-picker/index.tsx +1955 -0
- package/components/inputs/color-picker/variants.ts +401 -0
- package/components/inputs/combobox/examples.mdx +273 -0
- package/components/inputs/combobox/index.tsx +1436 -0
- package/components/inputs/combobox/remote-demo.tsx +101 -0
- package/components/inputs/date-time/calendar/examples.mdx +34 -0
- package/components/inputs/date-time/calendar/index.tsx +351 -0
- package/components/inputs/date-time/calendar/use-month-window.ts +163 -0
- package/components/inputs/date-time/date-picker/examples.mdx +166 -0
- package/components/inputs/date-time/date-picker/index.tsx +385 -0
- package/components/inputs/date-time/date-picker/masked-date-input.tsx +336 -0
- package/components/inputs/date-time/date-range-picker/examples.mdx +29 -0
- package/components/inputs/date-time/date-range-picker/index.tsx +217 -0
- package/components/inputs/date-time/duration-picker/examples.mdx +16 -0
- package/components/inputs/date-time/duration-picker/index.tsx +189 -0
- package/components/inputs/date-time/month-picker/examples.mdx +16 -0
- package/components/inputs/date-time/month-picker/index.tsx +190 -0
- package/components/inputs/date-time/picker-shell.tsx +395 -0
- package/components/inputs/date-time/time-columns.tsx +91 -0
- package/components/inputs/date-time/time-picker/examples.mdx +26 -0
- package/components/inputs/date-time/time-picker/index.tsx +166 -0
- package/components/inputs/field/examples.mdx +113 -0
- package/components/inputs/field/index.tsx +267 -0
- package/components/inputs/file-dropzone/examples.mdx +73 -0
- package/components/inputs/file-dropzone/file-row.tsx +201 -0
- package/components/inputs/file-dropzone/index.tsx +296 -0
- package/components/inputs/file-dropzone/upload-demo.tsx +67 -0
- package/components/inputs/file-dropzone/variants.ts +94 -0
- package/components/inputs/input/examples.mdx +135 -0
- package/components/inputs/input/index.tsx +494 -0
- package/components/inputs/input/password-demo.tsx +30 -0
- package/components/inputs/label/examples.mdx +67 -0
- package/components/inputs/label/index.tsx +85 -0
- package/components/inputs/number-input/examples.mdx +56 -0
- package/components/inputs/number-input/index.tsx +214 -0
- package/components/inputs/radio/examples.mdx +77 -0
- package/components/inputs/radio/index.tsx +636 -0
- package/components/inputs/search/examples.mdx +74 -0
- package/components/inputs/search/index.tsx +333 -0
- package/components/inputs/select/examples.mdx +218 -0
- package/components/inputs/select/index.tsx +862 -0
- package/components/inputs/select/variants.ts +32 -0
- package/components/inputs/slider/examples.mdx +127 -0
- package/components/inputs/slider/index.tsx +1725 -0
- package/components/inputs/switch/examples.mdx +94 -0
- package/components/inputs/switch/index.tsx +504 -0
- package/components/inputs/textarea/examples.mdx +88 -0
- package/components/inputs/textarea/index.tsx +161 -0
- package/components/navigation/navigation-menu/examples.mdx +109 -0
- package/components/navigation/navigation-menu/index.tsx +613 -0
- package/components/navigation/pagination/examples.mdx +64 -0
- package/components/navigation/pagination/index.tsx +395 -0
- package/components/navigation/sidebar/examples.mdx +319 -0
- package/components/navigation/sidebar/index.tsx +453 -0
- package/components/navigation/sidebar/sidebar-core.tsx +1408 -0
- package/components/navigation/sidebar/sidebar-menu.tsx +1495 -0
- package/components/navigation/sidebar/sidebar.css +74 -0
- package/components/navigation/sidebar/variants.ts +55 -0
- package/components/navigation/tabs/examples.mdx +89 -0
- package/components/navigation/tabs/index.tsx +494 -0
- package/components/navigation/tabs-subtle/examples.mdx +49 -0
- package/components/navigation/tabs-subtle/index.tsx +512 -0
- package/components/overlays/alert-dialog/examples.mdx +123 -0
- package/components/overlays/alert-dialog/index.tsx +258 -0
- package/components/overlays/alert-dialog/pending-demo.tsx +36 -0
- package/components/overlays/command/examples.mdx +113 -0
- package/components/overlays/command/index.tsx +416 -0
- package/components/overlays/context-menu/examples.mdx +56 -0
- package/components/overlays/context-menu/index.tsx +279 -0
- package/components/overlays/dialog/examples.mdx +144 -0
- package/components/overlays/dialog/index.tsx +366 -0
- package/components/overlays/dropdown/dropdown-search.tsx +395 -0
- package/components/overlays/dropdown/examples.mdx +294 -0
- package/components/overlays/dropdown/index.tsx +1168 -0
- package/components/overlays/dropdown/menu-item.tsx +464 -0
- package/components/overlays/dropdown/menu-parts.tsx +660 -0
- package/components/overlays/popover/anchored-demo.tsx +59 -0
- package/components/overlays/popover/examples.mdx +180 -0
- package/components/overlays/popover/index.tsx +315 -0
- package/components/overlays/preview-card/examples.mdx +61 -0
- package/components/overlays/preview-card/index.tsx +204 -0
- package/components/overlays/sheet/examples.mdx +89 -0
- package/components/overlays/sheet/index.tsx +247 -0
- package/components/overlays/toast/examples.mdx +68 -0
- package/components/overlays/toast/global-demo.tsx +72 -0
- package/components/overlays/toast/index.tsx +474 -0
- package/components/overlays/toast/manager.ts +193 -0
- package/components/overlays/tooltip/examples.mdx +106 -0
- package/components/overlays/tooltip/index.tsx +519 -0
- package/components/progress/examples.mdx +59 -0
- package/components/progress/index.tsx +174 -0
- package/components/progress/progress.css +49 -0
- package/components/progress/step-demo.tsx +27 -0
- package/components/table/examples.mdx +184 -0
- package/components/table/index.tsx +510 -0
- package/components/table/sort-demo.tsx +61 -0
- package/dist/base.css +100 -0
- package/dist/blocks/sidebar-app/index.js +39 -26
- package/dist/components/AI/input-message/index.js +22 -16
- package/dist/components/AI/thinking-indicator/index.js +9 -6
- package/dist/components/accordion/index.js +16 -13
- package/dist/components/avatar/index.d.ts +46 -0
- package/dist/components/avatar/index.js +18 -0
- package/dist/components/badge/index.d.ts +18 -11
- package/dist/components/badge/index.js +11 -7
- package/dist/components/badge/variants.d.ts +33 -0
- package/dist/components/badge/variants.js +10 -0
- package/dist/components/button/index.d.ts +53 -17
- package/dist/components/button/index.js +10 -6
- package/dist/components/button/variants.d.ts +39 -0
- package/dist/components/button/variants.js +8 -0
- package/dist/components/card/index.d.ts +16 -3
- package/dist/components/card/index.js +16 -11
- package/dist/components/copy/index.js +13 -9
- package/dist/components/inputs/checkbox/index.d.ts +28 -9
- package/dist/components/inputs/checkbox/index.js +17 -13
- package/dist/components/inputs/color-picker/index.d.ts +13 -13
- package/dist/components/inputs/color-picker/index.js +25 -18
- package/dist/components/inputs/color-picker/variants.d.ts +61 -0
- package/dist/components/inputs/color-picker/variants.js +28 -0
- package/dist/components/inputs/combobox/index.d.ts +60 -17
- package/dist/components/inputs/combobox/index.js +26 -18
- package/dist/components/inputs/date-time/calendar/index.js +14 -11
- package/dist/components/inputs/date-time/date-picker/index.d.ts +53 -11
- package/dist/components/inputs/date-time/date-picker/index.js +33 -25
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +3 -3
- package/dist/components/inputs/date-time/date-range-picker/index.js +32 -24
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +3 -3
- package/dist/components/inputs/date-time/duration-picker/index.js +32 -24
- package/dist/components/inputs/date-time/month-picker/index.d.ts +3 -3
- package/dist/components/inputs/date-time/month-picker/index.js +31 -23
- package/dist/components/inputs/date-time/time-picker/index.d.ts +3 -3
- package/dist/components/inputs/date-time/time-picker/index.js +32 -24
- package/dist/components/inputs/field/index.d.ts +116 -0
- package/dist/components/inputs/field/index.js +28 -0
- package/dist/components/inputs/file-dropzone/index.d.ts +165 -0
- package/dist/components/inputs/file-dropzone/index.js +32 -0
- package/dist/components/inputs/file-dropzone/variants.d.ts +35 -0
- package/dist/components/inputs/file-dropzone/variants.js +12 -0
- package/dist/components/inputs/input/index.d.ts +95 -13
- package/dist/components/inputs/input/index.js +17 -9
- package/dist/components/inputs/label/index.d.ts +32 -0
- package/dist/components/inputs/label/index.js +11 -0
- package/dist/components/inputs/number-input/index.d.ts +84 -0
- package/dist/components/inputs/number-input/index.js +20 -0
- package/dist/components/inputs/radio/index.d.ts +20 -5
- package/dist/components/inputs/radio/index.js +15 -12
- package/dist/components/inputs/search/index.js +25 -18
- package/dist/components/inputs/select/index.d.ts +41 -11
- package/dist/components/inputs/select/index.js +27 -14
- package/dist/components/inputs/select/variants.d.ts +5 -0
- package/dist/components/inputs/select/variants.js +6 -0
- package/dist/components/inputs/slider/index.js +7 -5
- package/dist/components/inputs/switch/index.d.ts +8 -2
- package/dist/components/inputs/switch/index.js +14 -12
- package/dist/components/inputs/textarea/index.d.ts +4 -0
- package/dist/components/inputs/textarea/index.js +8 -6
- package/dist/components/navigation/navigation-menu/index.d.ts +114 -0
- package/dist/components/navigation/navigation-menu/index.js +40 -0
- package/dist/components/navigation/pagination/index.d.ts +73 -0
- package/dist/components/navigation/pagination/index.js +39 -0
- package/dist/components/navigation/sidebar/index.d.ts +44 -21
- package/dist/components/navigation/sidebar/index.js +41 -31
- package/dist/components/navigation/sidebar/variants.d.ts +25 -0
- package/dist/components/navigation/sidebar/variants.js +28 -0
- package/dist/components/navigation/tabs/index.d.ts +8 -2
- package/dist/components/navigation/tabs/index.js +14 -10
- package/dist/components/navigation/tabs-subtle/index.js +12 -10
- package/dist/components/overlays/alert-dialog/index.d.ts +121 -15
- package/dist/components/overlays/alert-dialog/index.js +22 -13
- package/dist/components/overlays/command/index.js +24 -17
- package/dist/components/overlays/context-menu/index.d.ts +33 -17
- package/dist/components/overlays/context-menu/index.js +27 -18
- package/dist/components/overlays/dialog/index.js +17 -12
- package/dist/components/overlays/dropdown/index.d.ts +257 -31
- package/dist/components/overlays/dropdown/index.js +42 -17
- package/dist/components/overlays/popover/index.d.ts +31 -9
- package/dist/components/overlays/popover/index.js +12 -9
- package/dist/components/overlays/preview-card/index.js +11 -8
- package/dist/components/overlays/sheet/index.js +18 -13
- package/dist/components/overlays/toast/index.d.ts +123 -47
- package/dist/components/overlays/toast/index.js +18 -10
- package/dist/components/overlays/tooltip/index.d.ts +113 -21
- package/dist/components/overlays/tooltip/index.js +15 -6
- package/dist/components/progress/index.d.ts +56 -0
- package/dist/components/progress/index.js +15 -0
- package/dist/components/table/index.d.ts +63 -8
- package/dist/components/table/index.js +19 -9
- package/dist/index.d.ts +2201 -736
- package/dist/index.js +223 -82
- package/dist/lib/date-locale.d.ts +14 -0
- package/dist/lib/date-locale.js +16 -0
- package/dist/lib/field-classes.d.ts +144 -0
- package/dist/lib/field-classes.js +40 -0
- package/dist/lib/field-variants.d.ts +47 -0
- package/dist/lib/field-variants.js +26 -0
- package/dist/lib/fluid-hover-highlight.d.ts +112 -0
- package/dist/lib/fluid-hover-highlight.js +17 -0
- package/dist/lib/focus-ring.d.ts +18 -0
- package/dist/lib/focus-ring.js +10 -0
- package/dist/lib/goo-indicator.d.ts +46 -0
- package/dist/lib/goo-indicator.js +14 -0
- package/dist/lib/icon-context.d.ts +30 -0
- package/dist/lib/icon-context.js +12 -0
- package/dist/lib/inert.d.ts +9 -0
- package/dist/lib/inert.js +8 -0
- package/dist/lib/morph-layers.d.ts +93 -0
- package/dist/lib/morph-layers.js +13 -0
- package/dist/lib/morph-part.d.ts +21 -0
- package/dist/lib/morph-part.js +12 -0
- package/dist/lib/popup.d.ts +20 -0
- package/dist/lib/popup.js +12 -0
- package/dist/lib/reduced-motion.d.ts +9 -0
- package/dist/lib/reduced-motion.js +6 -0
- package/dist/lib/row-index.d.ts +10 -0
- package/dist/lib/row-index.js +8 -0
- package/dist/lib/row-order.d.ts +28 -0
- package/dist/lib/row-order.js +10 -0
- package/dist/lib/scroll-column.d.ts +27 -0
- package/dist/lib/scroll-column.js +18 -0
- package/dist/lib/shape-context.d.ts +30 -0
- package/dist/lib/shape-context.js +12 -0
- package/dist/lib/size-context.d.ts +94 -0
- package/dist/lib/size-context.js +20 -0
- package/dist/lib/size-scale.d.ts +79 -0
- package/dist/lib/size-scale.js +8 -0
- package/dist/lib/slot.d.ts +12 -0
- package/dist/lib/slot.js +6 -0
- package/dist/lib/springs.d.ts +44 -0
- package/dist/lib/springs.js +8 -0
- package/dist/lib/surface-classes.d.ts +19 -0
- package/dist/lib/surface-classes.js +10 -0
- package/dist/lib/surface-context.d.ts +9 -0
- package/dist/lib/surface-context.js +8 -0
- package/dist/lib/use-controllable-state.d.ts +2 -0
- package/dist/lib/use-controllable-state.js +6 -0
- package/dist/lib/use-fluid-hover.d.ts +138 -0
- package/dist/lib/use-fluid-hover.js +14 -0
- package/dist/lib/use-is-mobile.d.ts +2 -0
- package/dist/lib/use-is-mobile.js +6 -0
- package/dist/lib/use-keyboard-nav-gate.d.ts +20 -0
- package/dist/lib/use-keyboard-nav-gate.js +7 -0
- package/dist/lib/use-merge-split.d.ts +47 -0
- package/dist/lib/use-merge-split.js +15 -0
- package/dist/lib/use-morph.d.ts +101 -0
- package/dist/lib/use-morph.js +20 -0
- package/dist/lib/use-touch-primary.d.ts +2 -0
- package/dist/lib/use-touch-primary.js +6 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +6 -0
- package/dist/preset.d.ts +17 -0
- package/dist/preset.js +22 -2
- package/dist/primitives/code/index.js +7 -5
- package/dist/primitives/craft/index.js +9 -6
- package/dist/primitives/fluid-hover/index.js +9 -8
- package/dist/primitives/morph/index.js +15 -10
- package/dist/primitives/motion/index.js +10 -8
- package/dist/primitives/scroll-area/index.js +4 -3
- package/dist/primitives/separator/index.d.ts +25 -0
- package/dist/primitives/separator/index.js +9 -0
- package/dist/primitives/sizes/index.js +6 -4
- package/dist/primitives/skeleton/index.d.ts +35 -0
- package/dist/primitives/skeleton/index.js +12 -0
- package/dist/primitives/surface/index.js +6 -4
- package/dist/shared/{components-3mkepka5.js → components-0jmqhx2k.js} +28 -25
- package/dist/shared/components-124epb7f.js +53 -0
- package/dist/shared/{components-gz8zf3ec.js → components-1k0wv53d.js} +15 -43
- package/dist/shared/components-26snnbs9.js +322 -0
- package/dist/shared/{components-2dxkv6zm.js → components-2c0qcfx4.js} +8 -7
- package/dist/shared/{components-473g814w.js → components-2mt9te6d.js} +243 -137
- package/dist/shared/{components-hawvy2qz.js → components-2z48g4fp.js} +9 -30
- package/dist/shared/components-34txk9rj.js +35 -0
- package/dist/shared/components-3h92d94m.js +23 -0
- package/dist/shared/{components-zfnmn5d4.js → components-3sp623ae.js} +36 -31
- package/dist/shared/{components-jwst3vtj.js → components-3wxkjgqn.js} +186 -76
- package/dist/shared/{components-s2bz1xpk.js → components-49bsynbw.js} +8 -5
- package/dist/shared/components-4bwsd46w.js +71 -0
- package/dist/shared/components-4n4f5m3e.js +297 -0
- package/dist/shared/{components-0q0sqfh4.js → components-4y816hwp.js} +27 -49
- package/dist/shared/components-52ngsgca.js +399 -0
- package/dist/shared/{components-y9y0g8er.js → components-52r5763g.js} +22 -19
- package/dist/shared/components-559tf7yb.js +28 -0
- package/dist/shared/components-5mkga9hj.js +440 -0
- package/dist/shared/{components-kwa6mrf9.js → components-5s0nfqvw.js} +14 -9
- package/dist/shared/{components-dk0gjr5a.js → components-60atskhp.js} +19 -18
- package/dist/shared/{components-rr7a6ja9.js → components-658b26nb.js} +21 -18
- package/dist/shared/{components-xxvdw7k1.js → components-65vwfjs6.js} +37 -34
- package/dist/shared/{components-frw34b65.js → components-6j2fh74k.js} +114 -123
- package/dist/shared/components-6zg1yft7.js +167 -0
- package/dist/shared/components-6zng858q.js +53 -0
- package/dist/shared/components-72w4ge68.js +64 -0
- package/dist/shared/{components-cv16mryv.js → components-78x40gee.js} +13 -7
- package/dist/shared/{components-b2wyq2cq.js → components-7d4r7hh1.js} +39 -57
- package/dist/shared/components-7ntvvegr.js +316 -0
- package/dist/shared/components-8nwsqjn8.js +34 -0
- package/dist/shared/{components-5xc2j8jz.js → components-8tt3xbb5.js} +19 -18
- package/dist/shared/{components-vc7vq5nz.js → components-9as3rf68.js} +6 -3
- package/dist/shared/components-9mys9jna.js +255 -0
- package/dist/shared/components-adkarj8n.js +35 -0
- package/dist/shared/{components-b3c5et5b.js → components-ae9fncz4.js} +32 -31
- package/dist/shared/{components-hqeq3w9q.js → components-awra5sff.js} +24 -16
- package/dist/shared/components-b1e239g3.js +28 -0
- package/dist/shared/{components-q5xj5c16.js → components-b1f2bjf1.js} +9 -8
- package/dist/shared/{components-qmmjx1qw.js → components-bn42vq6d.js} +71 -72
- package/dist/shared/components-c96g82th.js +1444 -0
- package/dist/shared/components-c9yr4ed1.js +44 -0
- package/dist/shared/components-d3shbwqq.js +95 -0
- package/dist/shared/{components-jjw69c4c.js → components-dcc02hs2.js} +7 -4
- package/dist/shared/{components-men63rwj.js → components-de99ykt7.js} +3 -2
- package/dist/shared/components-dhgk6mbt.js +16 -0
- package/dist/shared/components-drxrtnp2.js +25 -0
- package/dist/shared/{components-6p8tfcd6.js → components-ds9fqat9.js} +21 -18
- package/dist/shared/{components-mjthm1kf.js → components-egy4tyjt.js} +11 -8
- package/dist/shared/components-f0xfpkhh.js +82 -0
- package/dist/shared/components-f7h57m6t.js +59 -0
- package/dist/shared/{components-d6xtjht3.js → components-fjkpbg6n.js} +33 -30
- package/dist/shared/{components-gc5vtq2f.js → components-gh0qeey3.js} +63 -29
- package/dist/shared/{components-39jq9va1.js → components-gvbapfen.js} +29 -24
- package/dist/shared/{components-5vgpnxgy.js → components-gzesg7hy.js} +19 -16
- package/dist/shared/components-h6p86be3.js +19 -0
- package/dist/shared/components-h83az0bz.js +33 -0
- package/dist/shared/components-jjrj6ymn.js +104 -0
- package/dist/shared/{components-wvp1m52g.js → components-jp5v0m0f.js} +15 -14
- package/dist/shared/{components-zrkzcayz.js → components-jqpefjsn.js} +54 -6
- package/dist/shared/{components-1z6tdadk.js → components-k74j4hwh.js} +20 -17
- package/dist/shared/components-kswxnm3h.js +24 -0
- package/dist/shared/{components-jbbmdr74.js → components-mkkbbgb7.js} +36 -17
- package/dist/shared/{components-pbmqctfa.js → components-mpw667rb.js} +169 -65
- package/dist/shared/{components-s5ngg32c.js → components-paa08427.js} +121 -47
- package/dist/shared/{components-vfbhxf5r.js → components-pd42emw3.js} +6 -5
- package/dist/shared/{components-hw9yk32z.js → components-pmfszv7a.js} +35 -23
- package/dist/shared/{components-chacnk61.js → components-pw06rbxq.js} +19 -19
- package/dist/shared/components-q03cktx8.js +246 -0
- package/dist/shared/{components-kvr7f9hy.js → components-qdm3yh26.js} +19 -10
- package/dist/shared/{components-27nnvrwe.js → components-qs4rkqsj.js} +15 -14
- package/dist/shared/{components-s083f38z.js → components-r6gbmkew.js} +22 -21
- package/dist/shared/{components-ta7shw28.js → components-r8eqs7gz.js} +4 -4
- package/dist/shared/{components-sn1rxx1d.js → components-rm02h9nt.js} +12 -11
- package/dist/shared/{components-c6s6b43g.js → components-rrbpmfx4.js} +3 -2
- package/dist/shared/{components-n7mjr357.js → components-tz1fv35x.js} +3 -2
- package/dist/shared/components-tz4gaf1v.js +23 -0
- package/dist/shared/{components-zx6b6yby.js → components-vf45j12c.js} +4 -18
- package/dist/shared/{components-3ky44908.js → components-vfjc9jzz.js} +2 -3
- package/dist/shared/{components-39vmfq9s.js → components-vsa625vk.js} +21 -20
- package/dist/shared/components-wawnmkph.js +500 -0
- package/dist/shared/components-wktrrb4m.js +38 -0
- package/dist/shared/{components-8snj490h.js → components-wwd363me.js} +78 -32
- package/dist/shared/{components-5pnw8183.js → components-xcwvgcrd.js} +23 -22
- package/dist/shared/components-xdqmt6ed.js +20 -0
- package/dist/shared/{components-h2ajmhwn.js → components-y1w3a6wx.js} +107 -35
- package/dist/shared/{components-ar66gnt0.js → components-y6578b8h.js} +37 -34
- package/dist/shared/{components-59efxjd9.js → components-yhgq0qxx.js} +13 -12
- package/dist/shared/{components-jthe1pwb.js → components-yz84gpkq.js} +101 -404
- package/dist/shared/components-z3v0n0de.js +11 -0
- package/dist/shared/{components-7r3etddy.js → components-z9n19fyk.js} +19 -54
- package/dist/shared/components-zbvjzh1p.js +141 -0
- package/dist/styles.css +241 -16
- package/dist/tailwind.css +13 -0
- package/dist/tokens.css +34 -0
- package/index.ts +60 -0
- package/lib/date-locale.ts +50 -0
- package/lib/field-classes.ts +115 -0
- package/lib/field-variants.ts +117 -0
- package/lib/fluid-hover-highlight.tsx +139 -0
- package/lib/focus-ring.tsx +46 -0
- package/lib/goo-indicator.tsx +261 -0
- package/lib/icon-context.tsx +310 -0
- package/lib/inert.ts +22 -0
- package/lib/morph-layers.tsx +102 -0
- package/lib/morph-part.tsx +49 -0
- package/lib/popup.ts +52 -0
- package/lib/reduced-motion.ts +19 -0
- package/lib/row-index.tsx +29 -0
- package/lib/row-order.tsx +115 -0
- package/lib/scroll-column.tsx +244 -0
- package/lib/shape-context.tsx +124 -0
- package/lib/size-context.tsx +66 -0
- package/lib/size-scale.ts +115 -0
- package/lib/slot.ts +25 -0
- package/lib/springs.ts +62 -0
- package/lib/surface-classes.ts +58 -0
- package/lib/surface-context.tsx +21 -0
- package/lib/use-controllable-state.ts +44 -0
- package/lib/use-fluid-hover.ts +541 -0
- package/lib/use-is-mobile.ts +25 -0
- package/lib/use-keyboard-nav-gate.ts +45 -0
- package/lib/use-merge-split.tsx +209 -0
- package/lib/use-morph.ts +557 -0
- package/lib/use-touch-primary.tsx +43 -0
- package/lib/utils.ts +37 -0
- package/package.json +177 -4
- package/preset.ts +196 -0
- package/primitives/code/examples.mdx +27 -0
- package/primitives/code/index.tsx +80 -0
- package/primitives/craft/demos.tsx +173 -0
- package/primitives/craft/examples.mdx +138 -0
- package/primitives/craft/index.tsx +76 -0
- package/primitives/fluid-hover/examples.mdx +84 -0
- package/primitives/fluid-hover/index.tsx +316 -0
- package/primitives/morph/examples.mdx +135 -0
- package/primitives/morph/index.tsx +192 -0
- package/primitives/motion/examples.mdx +100 -0
- package/primitives/motion/index.tsx +160 -0
- package/primitives/scroll-area/examples.mdx +58 -0
- package/primitives/scroll-area/index.tsx +200 -0
- package/primitives/separator/examples.mdx +30 -0
- package/primitives/separator/index.tsx +53 -0
- package/primitives/sizes/examples.mdx +167 -0
- package/primitives/sizes/index.tsx +89 -0
- package/primitives/skeleton/examples.mdx +51 -0
- package/primitives/skeleton/index.tsx +72 -0
- package/primitives/skeleton/skeleton.css +15 -0
- package/primitives/surface/examples.mdx +173 -0
- package/primitives/surface/index.tsx +109 -0
- package/primitives/surface/surface.css +176 -0
- package/dist/shared/components-0sn7ypjw.js +0 -61
- package/dist/shared/components-1434p1mh.js +0 -123
- package/dist/shared/components-a86dytt0.js +0 -986
- package/dist/shared/components-gf5s6ap9.js +0 -42
- package/dist/shared/components-hyq23phv.js +0 -310
- package/dist/shared/components-ng72k97e.js +0 -128
- package/dist/shared/components-raknhppb.js +0 -64
- package/dist/shared/components-vynjtrk6.js +0 -19
- package/dist/shared/components-wy9jpqny.js +0 -146
- /package/dist/shared/{components-1v7rxytx.js → components-3ey0hzpb.js} +0 -0
- /package/dist/shared/{components-ezxhrmer.js → components-jcnjay5g.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// lib/size-scale.ts
|
|
2
|
+
var sizeMap2 = {
|
|
3
|
+
default: {
|
|
4
|
+
variant: "default",
|
|
5
|
+
control: "h-9",
|
|
6
|
+
controlHeight: 36,
|
|
7
|
+
segmentItem: "h-7",
|
|
8
|
+
segmentPad: "p-1",
|
|
9
|
+
text: "text-body",
|
|
10
|
+
px: "px-3",
|
|
11
|
+
itemPx: "px-2",
|
|
12
|
+
gap: "gap-2",
|
|
13
|
+
icon: 16
|
|
14
|
+
},
|
|
15
|
+
compact: {
|
|
16
|
+
variant: "compact",
|
|
17
|
+
control: "h-7",
|
|
18
|
+
controlHeight: 28,
|
|
19
|
+
segmentItem: "h-6",
|
|
20
|
+
segmentPad: "p-0.5",
|
|
21
|
+
text: "text-body-compact",
|
|
22
|
+
px: "px-2.5",
|
|
23
|
+
itemPx: "px-1.5",
|
|
24
|
+
gap: "gap-1",
|
|
25
|
+
icon: 14
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var typeScale2 = {
|
|
29
|
+
display: { default: 28, compact: 24 },
|
|
30
|
+
title: { default: 16, compact: 15 },
|
|
31
|
+
subtitle: { default: 14, compact: 13 },
|
|
32
|
+
body: { default: 13, compact: 12 },
|
|
33
|
+
caption: { default: 12, compact: 11 }
|
|
34
|
+
};
|
|
35
|
+
export { sizeMap2, typeScale2 };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn2
|
|
4
|
+
} from "./components-jcnjay5g.js";
|
|
5
|
+
|
|
6
|
+
// primitives/separator/index.tsx
|
|
7
|
+
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var ORIENTATION = {
|
|
11
|
+
horizontal: "h-px w-full",
|
|
12
|
+
vertical: "w-px self-stretch"
|
|
13
|
+
};
|
|
14
|
+
var Separator2 = forwardRef(({ orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */ jsx(SeparatorPrimitive, {
|
|
15
|
+
ref,
|
|
16
|
+
...props,
|
|
17
|
+
orientation,
|
|
18
|
+
className: cn2("shrink-0 bg-border", ORIENTATION[orientation], className)
|
|
19
|
+
}));
|
|
20
|
+
Separator2.displayName = "Separator";
|
|
21
|
+
var separator_default = Separator2;
|
|
22
|
+
|
|
23
|
+
export { Separator2, separator_default };
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
3
|
+
useIcon2
|
|
4
|
+
} from "./components-jqpefjsn.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./components-0q0sqfh4.js";
|
|
6
|
+
MorphPartScope2
|
|
7
|
+
} from "./components-b1e239g3.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "./components-
|
|
9
|
+
useMorphOrigin2,
|
|
10
|
+
useMorph2
|
|
11
|
+
} from "./components-awra5sff.js";
|
|
12
12
|
import {
|
|
13
13
|
cn2
|
|
14
|
-
} from "./components-
|
|
14
|
+
} from "./components-jcnjay5g.js";
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
} from "./components-
|
|
16
|
+
MorphSurface2
|
|
17
|
+
} from "./components-4y816hwp.js";
|
|
18
|
+
import {
|
|
19
|
+
useShape2
|
|
20
|
+
} from "./components-78x40gee.js";
|
|
18
21
|
import {
|
|
19
22
|
useSizeVariant2,
|
|
20
23
|
useSize2
|
|
21
|
-
} from "./components-
|
|
24
|
+
} from "./components-h83az0bz.js";
|
|
25
|
+
import {
|
|
26
|
+
slotRender2
|
|
27
|
+
} from "./components-vfjc9jzz.js";
|
|
22
28
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
SURFACE_BG2,
|
|
30
|
+
SURFACE_SHADOW2
|
|
31
|
+
} from "./components-vf45j12c.js";
|
|
25
32
|
import {
|
|
26
|
-
SURFACE_BG,
|
|
27
|
-
SURFACE_SHADOW,
|
|
28
33
|
useSurface2,
|
|
29
34
|
SurfaceProvider2
|
|
30
|
-
} from "./components-
|
|
35
|
+
} from "./components-dhgk6mbt.js";
|
|
31
36
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./components-
|
|
37
|
+
useControllableState2
|
|
38
|
+
} from "./components-tz1fv35x.js";
|
|
34
39
|
import {
|
|
35
40
|
Button2
|
|
36
|
-
} from "./components-
|
|
41
|
+
} from "./components-7d4r7hh1.js";
|
|
37
42
|
|
|
38
43
|
// components/overlays/dialog/index.tsx
|
|
39
44
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
@@ -54,7 +59,7 @@ var DialogContext = createContext({
|
|
|
54
59
|
});
|
|
55
60
|
var useDialogState2 = () => useContext(DialogContext);
|
|
56
61
|
var DialogTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
|
|
57
|
-
const el =
|
|
62
|
+
const el = slotRender2(render, asChild, children);
|
|
58
63
|
return el ? /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
|
|
59
64
|
ref,
|
|
60
65
|
render: el,
|
|
@@ -67,7 +72,7 @@ var DialogTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref) =
|
|
|
67
72
|
});
|
|
68
73
|
DialogTrigger2.displayName = "DialogTrigger";
|
|
69
74
|
var DialogClose2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
|
|
70
|
-
const el =
|
|
75
|
+
const el = slotRender2(render, asChild, children);
|
|
71
76
|
return el ? /* @__PURE__ */ jsx(DialogPrimitive.Close, {
|
|
72
77
|
ref,
|
|
73
78
|
render: el,
|
|
@@ -92,13 +97,13 @@ var DialogContent2 = forwardRef(({
|
|
|
92
97
|
tier,
|
|
93
98
|
...props
|
|
94
99
|
}, ref) => {
|
|
95
|
-
const XIcon =
|
|
96
|
-
const shape =
|
|
100
|
+
const XIcon = useIcon2("x");
|
|
101
|
+
const shape = useShape2();
|
|
97
102
|
const substrate = useSurface2();
|
|
98
103
|
const dialogLevel = Math.min(substrate + DIALOG_OFFSET, 8);
|
|
99
104
|
const compact = useSize2().variant === "compact";
|
|
100
105
|
const { open, origin } = useDialogState2();
|
|
101
|
-
const morph =
|
|
106
|
+
const morph = useMorph2(open, origin, { from, effect, hideSource, tier });
|
|
102
107
|
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
103
108
|
return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, {
|
|
104
109
|
container: container ?? undefined,
|
|
@@ -115,10 +120,10 @@ var DialogContent2 = forwardRef(({
|
|
|
115
120
|
className: cn2(container ? "absolute" : "fixed", "left-1/2 z-50 w-[calc(100%-2rem)] -translate-x-1/2 focus:outline-none", position === "top" ? "top-[12dvh]" : "top-1/2 -translate-y-1/2", size === "sm" && (compact ? "max-w-[360px]" : "max-w-[400px]"), size === "lg" && (compact ? "max-w-[480px]" : "max-w-[540px]"), size === "xl" && (compact ? "max-w-[800px]" : "max-w-[880px]")),
|
|
116
121
|
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
117
122
|
value: dialogLevel,
|
|
118
|
-
children: /* @__PURE__ */ jsxs(
|
|
123
|
+
children: /* @__PURE__ */ jsxs(MorphSurface2, {
|
|
119
124
|
morph,
|
|
120
|
-
bg:
|
|
121
|
-
shadow:
|
|
125
|
+
bg: SURFACE_BG2[dialogLevel],
|
|
126
|
+
shadow: SURFACE_SHADOW2[dialogLevel],
|
|
122
127
|
radius: shape.container,
|
|
123
128
|
className: cn2("p-6", className),
|
|
124
129
|
children: [
|
|
@@ -176,14 +181,14 @@ var DialogDescription2 = forwardRef(({ className, ...props }, ref) => {
|
|
|
176
181
|
});
|
|
177
182
|
DialogDescription2.displayName = "DialogDescription";
|
|
178
183
|
function DialogState2({ open, defaultOpen = false, onOpenChange, children }) {
|
|
179
|
-
const [current, setCurrent] =
|
|
180
|
-
const { origin, capture } =
|
|
184
|
+
const [current, setCurrent] = useControllableState2(open, defaultOpen, onOpenChange);
|
|
185
|
+
const { origin, capture } = useMorphOrigin2();
|
|
181
186
|
const id = useId();
|
|
182
187
|
const ctx = useMemo(() => ({ open: current, origin }), [current, origin]);
|
|
183
188
|
const parts = useMemo(() => ({ id, open: current }), [id, current]);
|
|
184
189
|
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
185
190
|
value: ctx,
|
|
186
|
-
children: /* @__PURE__ */ jsx(
|
|
191
|
+
children: /* @__PURE__ */ jsx(MorphPartScope2.Provider, {
|
|
187
192
|
value: parts,
|
|
188
193
|
children: children({
|
|
189
194
|
open: current,
|
|
@@ -1,46 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
3
|
+
useIcons2
|
|
4
|
+
} from "./components-jqpefjsn.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./components-
|
|
6
|
+
useReduceMotion2
|
|
7
|
+
} from "./components-de99ykt7.js";
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
spring2
|
|
10
|
+
} from "./components-3ey0hzpb.js";
|
|
11
|
+
import {
|
|
12
|
+
GOO_BLUR_RATIO2,
|
|
13
|
+
holdExit2
|
|
14
|
+
} from "./components-awra5sff.js";
|
|
11
15
|
import {
|
|
12
16
|
cn2
|
|
13
|
-
} from "./components-
|
|
17
|
+
} from "./components-jcnjay5g.js";
|
|
14
18
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./components-
|
|
19
|
+
GooFilter2
|
|
20
|
+
} from "./components-4y816hwp.js";
|
|
21
|
+
import {
|
|
22
|
+
useShape2
|
|
23
|
+
} from "./components-78x40gee.js";
|
|
17
24
|
import {
|
|
18
25
|
sizeMap2
|
|
19
|
-
} from "./components-
|
|
26
|
+
} from "./components-34txk9rj.js";
|
|
27
|
+
import {
|
|
28
|
+
slotRender2
|
|
29
|
+
} from "./components-vfjc9jzz.js";
|
|
20
30
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
SURFACE_BG2,
|
|
32
|
+
SURFACE_SHADOW2
|
|
33
|
+
} from "./components-vf45j12c.js";
|
|
23
34
|
import {
|
|
24
|
-
SURFACE_BG,
|
|
25
|
-
SURFACE_SHADOW,
|
|
26
35
|
useSurface2,
|
|
27
36
|
SurfaceProvider2
|
|
28
|
-
} from "./components-
|
|
37
|
+
} from "./components-dhgk6mbt.js";
|
|
29
38
|
import {
|
|
30
39
|
button_default
|
|
31
|
-
} from "./components-
|
|
32
|
-
import {
|
|
33
|
-
spring2
|
|
34
|
-
} from "./components-1v7rxytx.js";
|
|
40
|
+
} from "./components-7d4r7hh1.js";
|
|
35
41
|
|
|
36
42
|
// components/overlays/toast/index.tsx
|
|
37
|
-
import { Toast as
|
|
38
|
-
import { ArrowRight, Check, CircleAlert, Info, LoaderCircle, X } from "lucide-react";
|
|
43
|
+
import { Toast as ToastPrimitive2 } from "@base-ui/react/toast";
|
|
39
44
|
import { AnimatePresence, motion } from "motion/react";
|
|
40
45
|
import {
|
|
41
46
|
cloneElement,
|
|
42
47
|
createContext,
|
|
43
48
|
forwardRef,
|
|
49
|
+
isValidElement as isValidElement2,
|
|
44
50
|
useContext,
|
|
45
51
|
useEffect,
|
|
46
52
|
useId,
|
|
@@ -49,14 +55,102 @@ import {
|
|
|
49
55
|
useRef,
|
|
50
56
|
useState
|
|
51
57
|
} from "react";
|
|
52
|
-
|
|
58
|
+
|
|
59
|
+
// components/overlays/toast/manager.ts
|
|
60
|
+
import { Toast as ToastPrimitive } from "@base-ui/react/toast";
|
|
61
|
+
import { isValidElement } from "react";
|
|
62
|
+
var isActionButton = (action) => typeof action === "object" && action !== null && !isValidElement(action) && ("label" in action);
|
|
63
|
+
function defined(value) {
|
|
64
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined));
|
|
65
|
+
}
|
|
66
|
+
function toManagerOptions(input) {
|
|
67
|
+
const { action, icon, duration, timeout, ...rest } = typeof input === "string" ? { title: input } : input;
|
|
68
|
+
const button = isActionButton(action);
|
|
69
|
+
return defined({
|
|
70
|
+
...rest,
|
|
71
|
+
timeout: timeout ?? duration,
|
|
72
|
+
actionProps: button ? { children: action.label, onClick: action.onClick } : undefined,
|
|
73
|
+
data: icon !== undefined || action !== undefined && !button ? { icon, action: button ? undefined : action } : undefined
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
var withType = (input, type) => typeof input === "string" ? { title: input, type } : { ...input, type };
|
|
77
|
+
var resultOptions = (result) => typeof result === "function" ? (value) => toManagerOptions(result(value)) : toManagerOptions(result);
|
|
78
|
+
function createQueuedManager() {
|
|
79
|
+
const manager = ToastPrimitive.createToastManager();
|
|
80
|
+
let listeners = 0;
|
|
81
|
+
let queue = [];
|
|
82
|
+
let count = 0;
|
|
83
|
+
const browser = () => typeof window !== "undefined";
|
|
84
|
+
const whenHeard = (run) => {
|
|
85
|
+
if (listeners)
|
|
86
|
+
run();
|
|
87
|
+
else if (browser())
|
|
88
|
+
queue.push(run);
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
" subscribe": (listener) => {
|
|
92
|
+
const unsubscribe = manager[" subscribe"](listener);
|
|
93
|
+
listeners++;
|
|
94
|
+
const queued = queue;
|
|
95
|
+
queue = [];
|
|
96
|
+
for (const run of queued)
|
|
97
|
+
run();
|
|
98
|
+
return () => {
|
|
99
|
+
listeners--;
|
|
100
|
+
unsubscribe();
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
add: (options) => {
|
|
104
|
+
const id = options.id ?? `toast-global-${++count}`;
|
|
105
|
+
whenHeard(() => manager.add({ ...options, id }));
|
|
106
|
+
return id;
|
|
107
|
+
},
|
|
108
|
+
close: (id) => whenHeard(() => manager.close(id)),
|
|
109
|
+
update: (id, updates) => whenHeard(() => manager.update(id, updates)),
|
|
110
|
+
promise: (promise, options) => {
|
|
111
|
+
if (listeners)
|
|
112
|
+
return manager.promise(promise, options);
|
|
113
|
+
if (browser())
|
|
114
|
+
queue.push(() => manager.promise(promise, options).catch(() => {}));
|
|
115
|
+
return promise;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
var manager = createQueuedManager();
|
|
120
|
+
function show(input, type) {
|
|
121
|
+
const options = toManagerOptions(input);
|
|
122
|
+
const id = manager.add({ type: "info", ...options, ...type && { type } });
|
|
123
|
+
return {
|
|
124
|
+
id,
|
|
125
|
+
update: (next) => manager.update(id, toManagerOptions(next)),
|
|
126
|
+
dismiss: () => manager.close(id)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
var toast2 = Object.assign((input) => show(input), {
|
|
130
|
+
success: (input) => show(input, "success"),
|
|
131
|
+
error: (input) => show(input, "error"),
|
|
132
|
+
warning: (input) => show(input, "warning"),
|
|
133
|
+
info: (input) => show(input, "info"),
|
|
134
|
+
loading: (input) => show(withType(input, "loading")),
|
|
135
|
+
promise: (promise, options) => manager.promise(promise, {
|
|
136
|
+
loading: toManagerOptions(options.loading),
|
|
137
|
+
success: resultOptions(options.success),
|
|
138
|
+
error: resultOptions(options.error)
|
|
139
|
+
}),
|
|
140
|
+
update: (id, input) => manager.update(id, toManagerOptions(input)),
|
|
141
|
+
dismiss: (id) => manager.close(id),
|
|
142
|
+
" subscribe": manager[" subscribe"]
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// components/overlays/toast/index.tsx
|
|
146
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
53
147
|
var ICONS = {
|
|
54
|
-
success:
|
|
55
|
-
loading:
|
|
56
|
-
error:
|
|
57
|
-
warning:
|
|
58
|
-
info:
|
|
59
|
-
action:
|
|
148
|
+
success: "check",
|
|
149
|
+
loading: "loader-circle",
|
|
150
|
+
error: "x",
|
|
151
|
+
warning: "circle-alert",
|
|
152
|
+
info: "info",
|
|
153
|
+
action: "arrow-right"
|
|
60
154
|
};
|
|
61
155
|
var TONES = {
|
|
62
156
|
success: "text-status-success bg-status-success/16",
|
|
@@ -75,7 +169,7 @@ var VIEWPORT = {
|
|
|
75
169
|
"bottom-right": "bottom-4 right-4 flex-col-reverse items-end"
|
|
76
170
|
};
|
|
77
171
|
var PILL = sizeMap2.default.controlHeight;
|
|
78
|
-
var BLUR = PILL / 2 *
|
|
172
|
+
var BLUR = PILL / 2 * GOO_BLUR_RATIO2;
|
|
79
173
|
var SNAP = { duration: 0 };
|
|
80
174
|
var AUTO_EXPAND_MS = 150;
|
|
81
175
|
var AUTO_COLLAPSE_BEFORE_MS = 2000;
|
|
@@ -84,31 +178,31 @@ var ToastSettings = createContext({
|
|
|
84
178
|
timeout: 6000
|
|
85
179
|
});
|
|
86
180
|
function useToast2() {
|
|
87
|
-
const manager =
|
|
181
|
+
const manager = ToastPrimitive2.useToastManager();
|
|
88
182
|
return useMemo(() => {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
actionProps: action && { children: action.label, onClick: action.onClick }
|
|
93
|
-
});
|
|
94
|
-
const show = (o) => manager.add(options(o, o.type ?? "info"));
|
|
183
|
+
const show = (o) => manager.add({ type: "info", ...toManagerOptions(o) });
|
|
184
|
+
const typed = (type) => (o) => show(typeof o === "string" ? { title: o, type } : { ...o, type });
|
|
185
|
+
const result = (r) => typeof r === "function" ? (value) => toManagerOptions(r(value)) : toManagerOptions(r);
|
|
95
186
|
return {
|
|
187
|
+
toasts: manager.toasts,
|
|
96
188
|
show,
|
|
97
|
-
success: (
|
|
98
|
-
error: (
|
|
99
|
-
warning: (
|
|
100
|
-
info: (
|
|
189
|
+
success: typed("success"),
|
|
190
|
+
error: typed("error"),
|
|
191
|
+
warning: typed("warning"),
|
|
192
|
+
info: typed("info"),
|
|
101
193
|
promise: (promise, o) => manager.promise(promise, {
|
|
102
|
-
loading:
|
|
103
|
-
success:
|
|
104
|
-
error:
|
|
194
|
+
loading: toManagerOptions(o.loading),
|
|
195
|
+
success: result(o.success),
|
|
196
|
+
error: result(o.error)
|
|
105
197
|
}),
|
|
106
|
-
|
|
198
|
+
update: (id, o) => manager.update(id, toManagerOptions(o)),
|
|
199
|
+
close: manager.close,
|
|
200
|
+
dismiss: manager.close
|
|
107
201
|
};
|
|
108
202
|
}, [manager]);
|
|
109
203
|
}
|
|
110
204
|
function Shape({ box, className, shapeRef }) {
|
|
111
|
-
const reduced =
|
|
205
|
+
const reduced = useReduceMotion2();
|
|
112
206
|
return /* @__PURE__ */ jsx(motion.div, {
|
|
113
207
|
ref: shapeRef,
|
|
114
208
|
"aria-hidden": true,
|
|
@@ -118,16 +212,30 @@ function Shape({ box, className, shapeRef }) {
|
|
|
118
212
|
transition: reduced ? SNAP : spring2.slow
|
|
119
213
|
});
|
|
120
214
|
}
|
|
215
|
+
function StatusIcon({ type, icon }) {
|
|
216
|
+
const icons = useIcons2();
|
|
217
|
+
const component = typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon && !isValidElement2(icon);
|
|
218
|
+
if (icon != null && icon !== false && !component)
|
|
219
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
220
|
+
children: icon
|
|
221
|
+
});
|
|
222
|
+
const Icon = component ? icon : icons[ICONS[type]];
|
|
223
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
224
|
+
size: 14,
|
|
225
|
+
strokeWidth: 2.5,
|
|
226
|
+
className: type === "loading" && !component ? "animate-spin" : undefined
|
|
227
|
+
});
|
|
228
|
+
}
|
|
121
229
|
function ToastItem({ toast }) {
|
|
122
230
|
const { position, timeout } = useContext(ToastSettings);
|
|
123
|
-
const shape =
|
|
231
|
+
const shape = useShape2();
|
|
124
232
|
const level = Math.min(useSurface2() + 2, 8);
|
|
125
233
|
const gooId = `toast-goo-${useId().replace(/:/g, "")}`;
|
|
126
234
|
const type = toast.type ?? "info";
|
|
127
|
-
const
|
|
235
|
+
const customAction = toast.data?.action;
|
|
128
236
|
const top = position.startsWith("top");
|
|
129
237
|
const ending = toast.transitionStatus === "ending";
|
|
130
|
-
const hasBody = Boolean(toast.description || toast.actionProps);
|
|
238
|
+
const hasBody = Boolean(toast.description || toast.actionProps || customAction);
|
|
131
239
|
const [hovered, setHovered] = useState(false);
|
|
132
240
|
const [auto, setAuto] = useState(false);
|
|
133
241
|
const expanded = hasBody && type !== "loading" && !ending && (hovered || auto);
|
|
@@ -164,7 +272,7 @@ function ToastItem({ toast }) {
|
|
|
164
272
|
useLayoutEffect(() => {
|
|
165
273
|
if (!ending || !root.current)
|
|
166
274
|
return;
|
|
167
|
-
const hold =
|
|
275
|
+
const hold = holdExit2(root.current, "moderate");
|
|
168
276
|
return () => hold.cancel();
|
|
169
277
|
}, [ending]);
|
|
170
278
|
const bodyHeight = expanded ? size.body : 0;
|
|
@@ -173,10 +281,10 @@ function ToastItem({ toast }) {
|
|
|
173
281
|
const pillHeight = PILL + Math.min(bodyHeight, size.radius);
|
|
174
282
|
const pill = { x: pillX, y: top ? 0 : height - pillHeight, width: size.pill, height: pillHeight };
|
|
175
283
|
const bodyBox = { x: 0, y: top ? PILL : 0, width: size.width, height: bodyHeight };
|
|
176
|
-
const reduced =
|
|
284
|
+
const reduced = useReduceMotion2();
|
|
177
285
|
const away = reduced ? { opacity: 0 } : { opacity: 0, y: top ? -6 : 6, scale: 0.95 };
|
|
178
286
|
const move = reduced ? SNAP : spring2.slow;
|
|
179
|
-
return /* @__PURE__ */ jsxs(
|
|
287
|
+
return /* @__PURE__ */ jsxs(ToastPrimitive2.Root, {
|
|
180
288
|
ref: root,
|
|
181
289
|
toast,
|
|
182
290
|
swipeDirection: [top ? "up" : "down", position.endsWith("left") ? "left" : "right"],
|
|
@@ -189,17 +297,17 @@ function ToastItem({ toast }) {
|
|
|
189
297
|
}),
|
|
190
298
|
className: "relative w-[min(22rem,calc(100vw-2rem))] select-none outline-none [translate:var(--toast-swipe-movement-x)_var(--toast-swipe-movement-y)]",
|
|
191
299
|
children: [
|
|
192
|
-
/* @__PURE__ */ jsx(
|
|
300
|
+
/* @__PURE__ */ jsx(GooFilter2, {
|
|
193
301
|
id: gooId,
|
|
194
302
|
blur: BLUR
|
|
195
303
|
}),
|
|
196
304
|
/* @__PURE__ */ jsx(Shape, {
|
|
197
305
|
box: pill,
|
|
198
|
-
className: cn2("rounded-full",
|
|
306
|
+
className: cn2("rounded-full", SURFACE_SHADOW2[3])
|
|
199
307
|
}),
|
|
200
308
|
hasBody && /* @__PURE__ */ jsx(Shape, {
|
|
201
309
|
box: bodyBox,
|
|
202
|
-
className: cn2(shape.container,
|
|
310
|
+
className: cn2(shape.container, SURFACE_SHADOW2[3])
|
|
203
311
|
}),
|
|
204
312
|
/* @__PURE__ */ jsxs("div", {
|
|
205
313
|
"aria-hidden": true,
|
|
@@ -208,12 +316,12 @@ function ToastItem({ toast }) {
|
|
|
208
316
|
children: [
|
|
209
317
|
/* @__PURE__ */ jsx(Shape, {
|
|
210
318
|
box: pill,
|
|
211
|
-
className: cn2("rounded-full",
|
|
319
|
+
className: cn2("rounded-full", SURFACE_BG2[level])
|
|
212
320
|
}),
|
|
213
321
|
hasBody && /* @__PURE__ */ jsx(Shape, {
|
|
214
322
|
box: bodyBox,
|
|
215
323
|
shapeRef: bodyShape,
|
|
216
|
-
className: cn2(shape.container,
|
|
324
|
+
className: cn2(shape.container, SURFACE_BG2[level])
|
|
217
325
|
})
|
|
218
326
|
]
|
|
219
327
|
}),
|
|
@@ -226,7 +334,7 @@ function ToastItem({ toast }) {
|
|
|
226
334
|
initial: false,
|
|
227
335
|
animate: { x: pillX, y: top ? 0 : height - PILL },
|
|
228
336
|
transition: move,
|
|
229
|
-
children: /* @__PURE__ */ jsx(
|
|
337
|
+
children: /* @__PURE__ */ jsx(ToastPrimitive2.Title, {
|
|
230
338
|
className: "relative inline-flex items-center whitespace-nowrap",
|
|
231
339
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
232
340
|
mode: "popLayout",
|
|
@@ -240,10 +348,9 @@ function ToastItem({ toast }) {
|
|
|
240
348
|
children: [
|
|
241
349
|
/* @__PURE__ */ jsx("span", {
|
|
242
350
|
className: cn2("flex size-6 items-center justify-center rounded-full", TONES[type]),
|
|
243
|
-
children: /* @__PURE__ */ jsx(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
className: type === "loading" ? "animate-spin" : undefined
|
|
351
|
+
children: /* @__PURE__ */ jsx(StatusIcon, {
|
|
352
|
+
type,
|
|
353
|
+
icon: toast.data?.icon
|
|
247
354
|
})
|
|
248
355
|
}),
|
|
249
356
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -251,7 +358,7 @@ function ToastItem({ toast }) {
|
|
|
251
358
|
children: toast.title
|
|
252
359
|
})
|
|
253
360
|
]
|
|
254
|
-
}, `${type}-${toast.title}`)
|
|
361
|
+
}, `${type}-${typeof toast.title === "string" ? toast.title : toast.updateKey}`)
|
|
255
362
|
})
|
|
256
363
|
})
|
|
257
364
|
}),
|
|
@@ -264,15 +371,16 @@ function ToastItem({ toast }) {
|
|
|
264
371
|
ref: body,
|
|
265
372
|
className: cn2("flex flex-col items-start gap-3 p-4", top ? "pt-6" : "pb-6"),
|
|
266
373
|
children: [
|
|
267
|
-
/* @__PURE__ */ jsx(
|
|
374
|
+
/* @__PURE__ */ jsx(ToastPrimitive2.Description, {
|
|
268
375
|
className: "text-caption text-muted-foreground"
|
|
269
376
|
}),
|
|
270
|
-
toast.actionProps && /* @__PURE__ */ jsx(
|
|
377
|
+
toast.actionProps && /* @__PURE__ */ jsx(ToastPrimitive2.Action, {
|
|
271
378
|
render: /* @__PURE__ */ jsx(button_default, {
|
|
272
379
|
size: "compact",
|
|
273
380
|
variant: "secondary"
|
|
274
381
|
})
|
|
275
|
-
})
|
|
382
|
+
}),
|
|
383
|
+
customAction
|
|
276
384
|
]
|
|
277
385
|
})
|
|
278
386
|
})
|
|
@@ -282,7 +390,7 @@ function ToastItem({ toast }) {
|
|
|
282
390
|
});
|
|
283
391
|
}
|
|
284
392
|
function ToastList() {
|
|
285
|
-
const { toasts } =
|
|
393
|
+
const { toasts } = ToastPrimitive2.useToastManager();
|
|
286
394
|
return toasts.map((toast) => /* @__PURE__ */ jsx(ToastItem, {
|
|
287
395
|
toast
|
|
288
396
|
}, toast.id));
|
|
@@ -292,6 +400,7 @@ var ToastTrigger2 = forwardRef(({
|
|
|
292
400
|
description,
|
|
293
401
|
type,
|
|
294
402
|
timeout,
|
|
403
|
+
icon,
|
|
295
404
|
action,
|
|
296
405
|
promise,
|
|
297
406
|
success,
|
|
@@ -302,15 +411,15 @@ var ToastTrigger2 = forwardRef(({
|
|
|
302
411
|
onClick,
|
|
303
412
|
...props
|
|
304
413
|
}, ref) => {
|
|
305
|
-
const
|
|
306
|
-
const el =
|
|
414
|
+
const toasts = useToast2();
|
|
415
|
+
const el = slotRender2(render, asChild, children);
|
|
307
416
|
const press = (event) => {
|
|
308
417
|
onClick?.(event);
|
|
309
418
|
if (promise) {
|
|
310
|
-
|
|
419
|
+
toasts.promise(promise(), { loading: { title, description, icon }, success: success ?? {}, error: error ?? {} }).catch(() => {});
|
|
311
420
|
return;
|
|
312
421
|
}
|
|
313
|
-
|
|
422
|
+
toasts.show({ title, description, type, timeout, icon, action });
|
|
314
423
|
};
|
|
315
424
|
return el ? cloneElement(el, { ...props, ref, onClick: press }) : /* @__PURE__ */ jsx("button", {
|
|
316
425
|
ref,
|
|
@@ -321,17 +430,18 @@ var ToastTrigger2 = forwardRef(({
|
|
|
321
430
|
});
|
|
322
431
|
});
|
|
323
432
|
ToastTrigger2.displayName = "ToastTrigger";
|
|
324
|
-
function Toast2({ position = "top-right", limit = 3, timeout = 6000, children }) {
|
|
433
|
+
function Toast2({ position = "top-right", limit = 3, timeout = 6000, manager, children }) {
|
|
325
434
|
const settings = useMemo(() => ({ position, timeout }), [position, timeout]);
|
|
326
|
-
return /* @__PURE__ */ jsx(
|
|
435
|
+
return /* @__PURE__ */ jsx(ToastPrimitive2.Provider, {
|
|
327
436
|
limit,
|
|
328
437
|
timeout,
|
|
438
|
+
toastManager: manager,
|
|
329
439
|
children: /* @__PURE__ */ jsxs(ToastSettings.Provider, {
|
|
330
440
|
value: settings,
|
|
331
441
|
children: [
|
|
332
442
|
children,
|
|
333
|
-
/* @__PURE__ */ jsx(
|
|
334
|
-
children: /* @__PURE__ */ jsx(
|
|
443
|
+
/* @__PURE__ */ jsx(ToastPrimitive2.Portal, {
|
|
444
|
+
children: /* @__PURE__ */ jsx(ToastPrimitive2.Viewport, {
|
|
335
445
|
className: cn2("fixed z-[60] flex flex-col gap-2 outline-none", VIEWPORT[position]),
|
|
336
446
|
children: /* @__PURE__ */ jsx(ToastList, {})
|
|
337
447
|
})
|
|
@@ -343,4 +453,4 @@ function Toast2({ position = "top-right", limit = 3, timeout = 6000, children })
|
|
|
343
453
|
Toast2.Trigger = ToastTrigger2;
|
|
344
454
|
var toast_default = Toast2;
|
|
345
455
|
|
|
346
|
-
export { useToast2, ToastTrigger2, Toast2, toast_default };
|
|
456
|
+
export { toast2, useToast2, ToastTrigger2, Toast2, toast_default };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
SURFACE_BG2
|
|
4
|
+
} from "./components-vf45j12c.js";
|
|
1
5
|
import {
|
|
2
|
-
SURFACE_BG,
|
|
3
6
|
useSurface2
|
|
4
|
-
} from "./components-
|
|
7
|
+
} from "./components-dhgk6mbt.js";
|
|
5
8
|
import {
|
|
6
9
|
cn2
|
|
7
|
-
} from "./components-
|
|
10
|
+
} from "./components-jcnjay5g.js";
|
|
8
11
|
import {
|
|
9
12
|
scroll_area_default
|
|
10
|
-
} from "./components-
|
|
13
|
+
} from "./components-2z48g4fp.js";
|
|
11
14
|
|
|
12
15
|
// primitives/code/index.tsx
|
|
13
16
|
import { Fragment } from "react";
|
|
@@ -51,7 +54,7 @@ function Code2({
|
|
|
51
54
|
return /* @__PURE__ */ jsx(scroll_area_default, {
|
|
52
55
|
orientation: "horizontal",
|
|
53
56
|
viewportClassName: "scroll-fade-x",
|
|
54
|
-
className: cn2("rounded-xl",
|
|
57
|
+
className: cn2("rounded-xl", SURFACE_BG2[level], className),
|
|
55
58
|
children: /* @__PURE__ */ jsx("pre", {
|
|
56
59
|
className: "m-0 w-max min-w-full p-4 font-mono text-caption leading-relaxed text-foreground",
|
|
57
60
|
children: /* @__PURE__ */ jsx("code", {
|