@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
|
@@ -1,30 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
useMorphOrigin,
|
|
8
|
-
useMorph
|
|
9
|
-
} from "./components-hqeq3w9q.js";
|
|
3
|
+
opensInPlace2,
|
|
4
|
+
inPlaceOffset2,
|
|
5
|
+
useMorphOrigin2,
|
|
6
|
+
useMorph2
|
|
7
|
+
} from "./components-awra5sff.js";
|
|
10
8
|
import {
|
|
11
9
|
cn2
|
|
12
|
-
} from "./components-
|
|
10
|
+
} from "./components-jcnjay5g.js";
|
|
11
|
+
import {
|
|
12
|
+
MorphSurface2
|
|
13
|
+
} from "./components-4y816hwp.js";
|
|
14
|
+
import {
|
|
15
|
+
useShape2
|
|
16
|
+
} from "./components-78x40gee.js";
|
|
13
17
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./components-
|
|
18
|
+
slotRender2
|
|
19
|
+
} from "./components-vfjc9jzz.js";
|
|
16
20
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
SURFACE_BG2,
|
|
22
|
+
SURFACE_SHADOW2
|
|
23
|
+
} from "./components-vf45j12c.js";
|
|
19
24
|
import {
|
|
20
|
-
SURFACE_BG,
|
|
21
|
-
SURFACE_SHADOW,
|
|
22
25
|
useSurface2,
|
|
23
26
|
SurfaceProvider2
|
|
24
|
-
} from "./components-
|
|
27
|
+
} from "./components-dhgk6mbt.js";
|
|
25
28
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./components-
|
|
29
|
+
useControllableState2
|
|
30
|
+
} from "./components-tz1fv35x.js";
|
|
28
31
|
|
|
29
32
|
// components/overlays/popover/index.tsx
|
|
30
33
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
@@ -38,7 +41,7 @@ import {
|
|
|
38
41
|
import { jsx } from "react/jsx-runtime";
|
|
39
42
|
var PopoverContext = createContext({ open: false, origin: { current: {} } });
|
|
40
43
|
var PopoverTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
|
|
41
|
-
const el =
|
|
44
|
+
const el = slotRender2(render, asChild, children);
|
|
42
45
|
return el ? /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
43
46
|
ref,
|
|
44
47
|
render: el,
|
|
@@ -51,7 +54,7 @@ var PopoverTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref)
|
|
|
51
54
|
});
|
|
52
55
|
PopoverTrigger2.displayName = "PopoverTrigger";
|
|
53
56
|
var PopoverClose2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
|
|
54
|
-
const el =
|
|
57
|
+
const el = slotRender2(render, asChild, children);
|
|
55
58
|
return el ? /* @__PURE__ */ jsx(PopoverPrimitive.Close, {
|
|
56
59
|
ref,
|
|
57
60
|
render: el,
|
|
@@ -63,10 +66,21 @@ var PopoverClose2 = forwardRef(({ render, asChild, children, ...props }, ref) =>
|
|
|
63
66
|
});
|
|
64
67
|
});
|
|
65
68
|
PopoverClose2.displayName = "PopoverClose";
|
|
69
|
+
function anchorElement(anchor) {
|
|
70
|
+
const resolved = typeof anchor === "function" ? anchor() : anchor;
|
|
71
|
+
const el = resolved && "current" in resolved ? resolved.current : resolved;
|
|
72
|
+
return el instanceof HTMLElement ? el : null;
|
|
73
|
+
}
|
|
66
74
|
var PopoverContent2 = forwardRef(({
|
|
67
75
|
side = "bottom",
|
|
68
76
|
align,
|
|
69
77
|
sideOffset = 12,
|
|
78
|
+
alignOffset,
|
|
79
|
+
anchor,
|
|
80
|
+
collisionPadding,
|
|
81
|
+
collisionBoundary,
|
|
82
|
+
initialFocus,
|
|
83
|
+
finalFocus,
|
|
70
84
|
from,
|
|
71
85
|
effect,
|
|
72
86
|
hideSource,
|
|
@@ -77,28 +91,45 @@ var PopoverContent2 = forwardRef(({
|
|
|
77
91
|
...props
|
|
78
92
|
}, ref) => {
|
|
79
93
|
const { open, origin } = useContext(PopoverContext);
|
|
80
|
-
const
|
|
81
|
-
|
|
94
|
+
const anchorSource = useMemo(() => anchor ? {
|
|
95
|
+
get current() {
|
|
96
|
+
return anchorElement(anchor) ?? origin.current?.trigger ?? null;
|
|
97
|
+
}
|
|
98
|
+
} : undefined, [anchor, origin]);
|
|
99
|
+
const morph = useMorph2(open, origin, {
|
|
100
|
+
from: from ?? anchorSource,
|
|
101
|
+
effect,
|
|
102
|
+
hideSource,
|
|
103
|
+
tier,
|
|
104
|
+
returnFocus: typeof finalFocus === "boolean" ? finalFocus : finalFocus === undefined
|
|
105
|
+
});
|
|
106
|
+
const inPlace = opensInPlace2({ effect, hideSource });
|
|
82
107
|
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
83
|
-
const shape =
|
|
108
|
+
const shape = useShape2();
|
|
84
109
|
const level = Math.min(useSurface2() + 2, 8);
|
|
85
110
|
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, {
|
|
86
111
|
container: container ?? undefined,
|
|
87
112
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Positioner, {
|
|
88
113
|
side,
|
|
89
114
|
align: align ?? (inPlace ? "start" : "center"),
|
|
90
|
-
sideOffset: inPlace ?
|
|
115
|
+
sideOffset: inPlace ? inPlaceOffset2 : sideOffset,
|
|
116
|
+
alignOffset,
|
|
117
|
+
anchor,
|
|
118
|
+
collisionPadding,
|
|
119
|
+
collisionBoundary,
|
|
91
120
|
className: "z-50 outline-none",
|
|
92
121
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Popup, {
|
|
93
122
|
ref: morph.popupRef,
|
|
123
|
+
initialFocus,
|
|
124
|
+
finalFocus,
|
|
94
125
|
className: "relative outline-none",
|
|
95
126
|
...props,
|
|
96
127
|
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
97
128
|
value: level,
|
|
98
|
-
children: /* @__PURE__ */ jsx(
|
|
129
|
+
children: /* @__PURE__ */ jsx(MorphSurface2, {
|
|
99
130
|
morph,
|
|
100
|
-
bg:
|
|
101
|
-
shadow:
|
|
131
|
+
bg: SURFACE_BG2[level],
|
|
132
|
+
shadow: SURFACE_SHADOW2[3],
|
|
102
133
|
radius: shape.container,
|
|
103
134
|
className: cn2("flex w-max max-w-[min(92vw,20rem)] flex-col gap-1 p-4", className),
|
|
104
135
|
children
|
|
@@ -122,8 +153,8 @@ var PopoverDescription2 = forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
122
153
|
}));
|
|
123
154
|
PopoverDescription2.displayName = "PopoverDescription";
|
|
124
155
|
function Popover2({ open, defaultOpen = false, onOpenChange, modal = false, children }) {
|
|
125
|
-
const [current, setCurrent] =
|
|
126
|
-
const { origin, capture } =
|
|
156
|
+
const [current, setCurrent] = useControllableState2(open, defaultOpen);
|
|
157
|
+
const { origin, capture } = useMorphOrigin2();
|
|
127
158
|
const ctx = useMemo(() => ({ open: current, origin }), [current, origin]);
|
|
128
159
|
return /* @__PURE__ */ jsx(PopoverContext.Provider, {
|
|
129
160
|
value: ctx,
|
|
@@ -131,6 +162,9 @@ function Popover2({ open, defaultOpen = false, onOpenChange, modal = false, chil
|
|
|
131
162
|
open: current,
|
|
132
163
|
modal,
|
|
133
164
|
onOpenChange: (next, details) => {
|
|
165
|
+
onOpenChange?.(next, details);
|
|
166
|
+
if (details.isCanceled)
|
|
167
|
+
return;
|
|
134
168
|
if (next)
|
|
135
169
|
capture(details);
|
|
136
170
|
setCurrent(next);
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
3
|
+
useShape2
|
|
4
|
+
} from "./components-78x40gee.js";
|
|
4
5
|
import {
|
|
5
6
|
cn2
|
|
6
|
-
} from "./components-
|
|
7
|
+
} from "./components-jcnjay5g.js";
|
|
7
8
|
import {
|
|
8
9
|
button_default
|
|
9
|
-
} from "./components-
|
|
10
|
+
} from "./components-7d4r7hh1.js";
|
|
10
11
|
import {
|
|
11
|
-
MorphPart2
|
|
12
|
-
|
|
13
|
-
} from "./components-0q0sqfh4.js";
|
|
12
|
+
MorphPart2
|
|
13
|
+
} from "./components-b1e239g3.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "./components-
|
|
15
|
+
opensInPlace2,
|
|
16
|
+
useMorphOrigin2,
|
|
17
|
+
useMorph2
|
|
18
|
+
} from "./components-awra5sff.js";
|
|
19
|
+
import {
|
|
20
|
+
MorphSurface2
|
|
21
|
+
} from "./components-4y816hwp.js";
|
|
22
|
+
import {
|
|
23
|
+
SURFACE_BG2,
|
|
24
|
+
SURFACE_SHADOW2
|
|
25
|
+
} from "./components-vf45j12c.js";
|
|
19
26
|
import {
|
|
20
|
-
SURFACE_BG,
|
|
21
|
-
SURFACE_SHADOW,
|
|
22
27
|
useSurface2,
|
|
23
28
|
SurfaceProvider2
|
|
24
|
-
} from "./components-
|
|
29
|
+
} from "./components-dhgk6mbt.js";
|
|
25
30
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./components-
|
|
31
|
+
useControllableState2
|
|
32
|
+
} from "./components-tz1fv35x.js";
|
|
28
33
|
|
|
29
34
|
// primitives/morph/index.tsx
|
|
30
35
|
import { useState } from "react";
|
|
@@ -41,15 +46,15 @@ function Morph2({
|
|
|
41
46
|
className,
|
|
42
47
|
children
|
|
43
48
|
}) {
|
|
44
|
-
const [shown, setShown] =
|
|
49
|
+
const [shown, setShown] = useControllableState2(open, defaultOpen, onOpenChange);
|
|
45
50
|
const [mounted, setMounted] = useState(shown);
|
|
46
51
|
if (shown && !mounted)
|
|
47
52
|
setMounted(true);
|
|
48
|
-
const { origin, capture } =
|
|
49
|
-
const morph =
|
|
50
|
-
const shape =
|
|
53
|
+
const { origin, capture } = useMorphOrigin2();
|
|
54
|
+
const morph = useMorph2(shown, origin, { from, effect, tier, hideSource }, () => setMounted(false));
|
|
55
|
+
const shape = useShape2();
|
|
51
56
|
const level = Math.min(useSurface2() + 2, 8);
|
|
52
|
-
const inPlace =
|
|
57
|
+
const inPlace = opensInPlace2({ effect, hideSource });
|
|
53
58
|
return /* @__PURE__ */ jsxs("div", {
|
|
54
59
|
className: cn2("relative inline-flex flex-col items-center", className),
|
|
55
60
|
children: [
|
|
@@ -69,10 +74,10 @@ function Morph2({
|
|
|
69
74
|
onClick: inPlace ? () => setShown(false) : undefined,
|
|
70
75
|
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
71
76
|
value: level,
|
|
72
|
-
children: /* @__PURE__ */ jsx(
|
|
77
|
+
children: /* @__PURE__ */ jsx(MorphSurface2, {
|
|
73
78
|
morph,
|
|
74
|
-
bg:
|
|
75
|
-
shadow:
|
|
79
|
+
bg: SURFACE_BG2[level],
|
|
80
|
+
shadow: SURFACE_SHADOW2[level],
|
|
76
81
|
radius: shape.container,
|
|
77
82
|
className: "w-56 p-4",
|
|
78
83
|
children
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./components-gz8zf3ec.js";
|
|
3
|
+
defaultLocale2,
|
|
4
|
+
hourCycleOf2,
|
|
5
|
+
parseTimeText2
|
|
6
|
+
} from "./components-559tf7yb.js";
|
|
7
7
|
import {
|
|
8
8
|
cn2
|
|
9
|
-
} from "./components-
|
|
9
|
+
} from "./components-jcnjay5g.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./components-
|
|
11
|
+
dividedColumns2
|
|
12
|
+
} from "./components-1k0wv53d.js";
|
|
13
|
+
import {
|
|
14
|
+
useControllableState2
|
|
15
|
+
} from "./components-tz1fv35x.js";
|
|
13
16
|
import {
|
|
14
17
|
PickerShell,
|
|
15
18
|
PickerInput
|
|
16
|
-
} from "./components-
|
|
19
|
+
} from "./components-paa08427.js";
|
|
17
20
|
import {
|
|
18
21
|
pad,
|
|
19
22
|
TimeColumns
|
|
20
|
-
} from "./components-
|
|
23
|
+
} from "./components-egy4tyjt.js";
|
|
21
24
|
|
|
22
25
|
// components/inputs/date-time/time-picker/index.tsx
|
|
23
26
|
import { format, set } from "date-fns";
|
|
@@ -34,7 +37,7 @@ function TimePicker2({
|
|
|
34
37
|
onValueChange,
|
|
35
38
|
hourCycle,
|
|
36
39
|
minuteStep = 1,
|
|
37
|
-
locale =
|
|
40
|
+
locale = defaultLocale2,
|
|
38
41
|
placeholder,
|
|
39
42
|
disabled,
|
|
40
43
|
variant,
|
|
@@ -50,8 +53,8 @@ function TimePicker2({
|
|
|
50
53
|
tier,
|
|
51
54
|
className
|
|
52
55
|
}) {
|
|
53
|
-
const [value, setValue] =
|
|
54
|
-
const [open, setOpen] =
|
|
56
|
+
const [value, setValue] = useControllableState2(valueProp, defaultValue, onValueChange);
|
|
57
|
+
const [open, setOpen] = useControllableState2(openProp, defaultOpen, onOpenChange);
|
|
55
58
|
const input = useRef(null);
|
|
56
59
|
const time = toTime(value);
|
|
57
60
|
const formatted = time ? format(set(new Date, time), "p", { locale }) : "";
|
|
@@ -60,7 +63,7 @@ function TimePicker2({
|
|
|
60
63
|
setValue(null);
|
|
61
64
|
return true;
|
|
62
65
|
}
|
|
63
|
-
const read =
|
|
66
|
+
const read = parseTimeText2(text, locale);
|
|
64
67
|
if (!read)
|
|
65
68
|
return false;
|
|
66
69
|
setValue(toValue({ hours: read.getHours(), minutes: read.getMinutes() }));
|
|
@@ -94,11 +97,11 @@ function TimePicker2({
|
|
|
94
97
|
tier,
|
|
95
98
|
className,
|
|
96
99
|
children: /* @__PURE__ */ jsx("div", {
|
|
97
|
-
className: cn2(
|
|
100
|
+
className: cn2(dividedColumns2, "h-56"),
|
|
98
101
|
children: /* @__PURE__ */ jsx(TimeColumns, {
|
|
99
102
|
value: time,
|
|
100
103
|
onValueChange: (next) => setValue(toValue(next)),
|
|
101
|
-
hourCycle: hourCycle ??
|
|
104
|
+
hourCycle: hourCycle ?? hourCycleOf2(locale),
|
|
102
105
|
minuteStep,
|
|
103
106
|
locale,
|
|
104
107
|
orientation: "vertical",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// lib/popup.ts
|
|
2
|
+
var popupScrollAreaClass2 = "min-h-0 flex-1 max-h-[inherit]";
|
|
3
|
+
var popupViewportClass2 = "!h-auto max-h-[inherit] [&>div[style]]:!block [&>div[style]]:!min-w-0 [--scroll-fade-size:32px]";
|
|
4
|
+
var POPUP_NAV_KEYS2 = [
|
|
5
|
+
"ArrowDown",
|
|
6
|
+
"ArrowUp",
|
|
7
|
+
"ArrowLeft",
|
|
8
|
+
"ArrowRight",
|
|
9
|
+
"Home",
|
|
10
|
+
"End",
|
|
11
|
+
"PageUp",
|
|
12
|
+
"PageDown",
|
|
13
|
+
"Tab"
|
|
14
|
+
];
|
|
15
|
+
function isDisabledRow2(el) {
|
|
16
|
+
return el.getAttribute("aria-disabled") === "true" || el.hasAttribute("data-disabled");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { popupScrollAreaClass2, popupViewportClass2, POPUP_NAV_KEYS2, isDisabledRow2 };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
sizeMap2,
|
|
4
|
+
typeScale2
|
|
5
|
+
} from "./components-34txk9rj.js";
|
|
6
|
+
|
|
7
|
+
// lib/size-context.tsx
|
|
8
|
+
import { createContext, useContext } from "react";
|
|
9
|
+
function useTypeScale2(override) {
|
|
10
|
+
const variant = useSizeVariant2(override);
|
|
11
|
+
return {
|
|
12
|
+
display: typeScale2.display[variant],
|
|
13
|
+
title: typeScale2.title[variant],
|
|
14
|
+
subtitle: typeScale2.subtitle[variant],
|
|
15
|
+
body: typeScale2.body[variant],
|
|
16
|
+
caption: typeScale2.caption[variant]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var SizeContext2 = createContext(null);
|
|
20
|
+
function useSizeVariant2(override) {
|
|
21
|
+
const ctx = useContext(SizeContext2);
|
|
22
|
+
return override ?? ctx?.size ?? "default";
|
|
23
|
+
}
|
|
24
|
+
function useSize2(override) {
|
|
25
|
+
return sizeMap2[useSizeVariant2(override)];
|
|
26
|
+
}
|
|
27
|
+
function useSizeContext2() {
|
|
28
|
+
const ctx = useContext(SizeContext2);
|
|
29
|
+
if (!ctx)
|
|
30
|
+
throw new Error("useSizeContext must be used within a SizeProvider");
|
|
31
|
+
return ctx;
|
|
32
|
+
}
|
|
33
|
+
export { useTypeScale2, SizeContext2, useSizeVariant2, useSize2, useSizeContext2 };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
FIELD_TEXT_INSET2
|
|
4
|
+
} from "./components-124epb7f.js";
|
|
5
|
+
import {
|
|
6
|
+
useSize2
|
|
7
|
+
} from "./components-h83az0bz.js";
|
|
8
|
+
import {
|
|
9
|
+
cn2
|
|
10
|
+
} from "./components-jcnjay5g.js";
|
|
11
|
+
import {
|
|
12
|
+
FieldStateContext2,
|
|
13
|
+
useFieldState2
|
|
14
|
+
} from "./components-6zng858q.js";
|
|
15
|
+
import {
|
|
16
|
+
slotRender2
|
|
17
|
+
} from "./components-vfjc9jzz.js";
|
|
18
|
+
import {
|
|
19
|
+
SizeProvider2
|
|
20
|
+
} from "./components-dcc02hs2.js";
|
|
21
|
+
import {
|
|
22
|
+
Label2
|
|
23
|
+
} from "./components-adkarj8n.js";
|
|
24
|
+
|
|
25
|
+
// components/inputs/field/index.tsx
|
|
26
|
+
import { Field as BaseField } from "@base-ui/react/field";
|
|
27
|
+
import {
|
|
28
|
+
forwardRef,
|
|
29
|
+
useMemo
|
|
30
|
+
} from "react";
|
|
31
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
+
function FieldLabel2({ children, visuallyHidden, className }) {
|
|
33
|
+
const field = useFieldState2();
|
|
34
|
+
return /* @__PURE__ */ jsx(BaseField.Label, {
|
|
35
|
+
render: /* @__PURE__ */ jsxs(Label2, {
|
|
36
|
+
invalid: field?.invalid,
|
|
37
|
+
className: cn2(visuallyHidden && "sr-only", className),
|
|
38
|
+
children: [
|
|
39
|
+
children,
|
|
40
|
+
field?.required && /* @__PURE__ */ jsx("span", {
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
children: " *"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function FieldDescription2({ children, className }) {
|
|
49
|
+
const size = useSize2();
|
|
50
|
+
return /* @__PURE__ */ jsx(BaseField.Description, {
|
|
51
|
+
className: cn2("text-muted-foreground weight-normal data-[disabled]:opacity-50", size.variant === "compact" ? "text-caption-compact" : "text-caption", FIELD_TEXT_INSET2[size.variant], className),
|
|
52
|
+
children
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function FieldError2({ children, match, className }) {
|
|
56
|
+
const size = useSize2();
|
|
57
|
+
const hasMessage = children != null && children !== false && children !== "";
|
|
58
|
+
return /* @__PURE__ */ jsx(BaseField.Error, {
|
|
59
|
+
match: match ?? (hasMessage || undefined),
|
|
60
|
+
className: cn2("text-destructive weight-medium", size.variant === "compact" ? "text-caption-compact" : "text-caption", FIELD_TEXT_INSET2[size.variant], "transition-opacity duration-fast data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 data-[ending-style]:duration-fast-exit", className),
|
|
61
|
+
...hasMessage ? { children } : {}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function FieldControl2({ render, asChild, children }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(BaseField.Control, {
|
|
66
|
+
render: slotRender2(render, asChild, children)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function ProvideFieldState({ invalid, disabled, readOnly, required, children }) {
|
|
70
|
+
const state = useMemo(() => ({ active: false, invalid, disabled, readOnly, required }), [invalid, disabled, readOnly, required]);
|
|
71
|
+
return /* @__PURE__ */ jsx(FieldStateContext2.Provider, {
|
|
72
|
+
value: state,
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
var Field2 = forwardRef(({ invalid = false, disabled = false, readOnly = false, required = false, size, className, children, ...props }, ref) => {
|
|
77
|
+
const field = /* @__PURE__ */ jsx(BaseField.Root, {
|
|
78
|
+
ref,
|
|
79
|
+
invalid,
|
|
80
|
+
disabled,
|
|
81
|
+
className: cn2("flex min-w-0 flex-col gap-1", className),
|
|
82
|
+
render: (rootProps, rootState) => /* @__PURE__ */ jsx("div", {
|
|
83
|
+
...rootProps,
|
|
84
|
+
children: /* @__PURE__ */ jsx(ProvideFieldState, {
|
|
85
|
+
invalid: invalid || rootState.valid === false,
|
|
86
|
+
disabled,
|
|
87
|
+
readOnly,
|
|
88
|
+
required,
|
|
89
|
+
children: rootProps.children
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
...props,
|
|
93
|
+
children
|
|
94
|
+
});
|
|
95
|
+
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
96
|
+
size,
|
|
97
|
+
children: field
|
|
98
|
+
}) : field;
|
|
99
|
+
});
|
|
100
|
+
Field2.displayName = "Field";
|
|
101
|
+
Object.assign(Field2, { Label: FieldLabel2, Description: FieldDescription2, Error: FieldError2, Control: FieldControl2 });
|
|
102
|
+
var field_default = Field2;
|
|
103
|
+
|
|
104
|
+
export { FieldLabel2, FieldDescription2, FieldError2, FieldControl2, Field2, field_default };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
3
|
+
useShape2
|
|
4
|
+
} from "./components-78x40gee.js";
|
|
4
5
|
import {
|
|
5
6
|
useSizeVariant2
|
|
6
|
-
} from "./components-
|
|
7
|
+
} from "./components-h83az0bz.js";
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./components-
|
|
9
|
+
spring2
|
|
10
|
+
} from "./components-3ey0hzpb.js";
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./components-
|
|
12
|
+
useControllableState2
|
|
13
|
+
} from "./components-tz1fv35x.js";
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./components-
|
|
15
|
+
cn2
|
|
16
|
+
} from "./components-jcnjay5g.js";
|
|
16
17
|
|
|
17
18
|
// components/inputs/slider/index.tsx
|
|
18
19
|
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
@@ -75,7 +76,7 @@ function ValueDisplay({
|
|
|
75
76
|
isRange,
|
|
76
77
|
isInteracting
|
|
77
78
|
}) {
|
|
78
|
-
const shape =
|
|
79
|
+
const shape = useShape2();
|
|
79
80
|
const [inputValue, setInputValue] = useState("");
|
|
80
81
|
const inputRef = useRef(null);
|
|
81
82
|
useEffect(() => {
|
|
@@ -181,7 +182,7 @@ function ValueDisplay({
|
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
184
|
function TooltipValue({ value, formatValue, motionX }) {
|
|
184
|
-
const shape =
|
|
185
|
+
const shape = useShape2();
|
|
185
186
|
const tooltipX = useTransform(motionX, (x) => x + THUMB_SIZE / 2);
|
|
186
187
|
return /* @__PURE__ */ jsx(motion.div, {
|
|
187
188
|
className: "absolute -translate-x-1/2 pointer-events-none z-20",
|
|
@@ -224,7 +225,7 @@ var CompactSlider = forwardRef(({
|
|
|
224
225
|
}, ref) => {
|
|
225
226
|
const isRange = Array.isArray(value);
|
|
226
227
|
const values = toRadixValue(value);
|
|
227
|
-
const shape =
|
|
228
|
+
const shape = useShape2();
|
|
228
229
|
const stepsKey = steps ? steps.join(",") : "";
|
|
229
230
|
const stepValues = useMemo(() => {
|
|
230
231
|
if (!stepsKey)
|
|
@@ -756,7 +757,7 @@ var ComfortableSlider = forwardRef(({
|
|
|
756
757
|
const [hoverPreview, setHoverPreview] = useState(null);
|
|
757
758
|
const [showHoverTooltip, setShowHoverTooltip] = useState(false);
|
|
758
759
|
const hoverDelayRef = useRef(null);
|
|
759
|
-
const shape =
|
|
760
|
+
const shape = useShape2();
|
|
760
761
|
useEffect(() => {
|
|
761
762
|
if (isHovered) {
|
|
762
763
|
hoverDelayRef.current = setTimeout(() => setShowHoverTooltip(true), 100);
|
|
@@ -1147,7 +1148,7 @@ var ComfortableSlider = forwardRef(({
|
|
|
1147
1148
|
});
|
|
1148
1149
|
ComfortableSlider.displayName = "SliderComfortable";
|
|
1149
1150
|
var Slider2 = forwardRef(({ size, variant = "pips", value: valueProp, defaultValue, onChange: onChangeProp, ...rest }, ref) => {
|
|
1150
|
-
const [value, onChange] =
|
|
1151
|
+
const [value, onChange] = useControllableState2(valueProp, defaultValue ?? (rest.steps && rest.steps.length > 0 ? Math.min(...rest.steps) : rest.min ?? 0), onChangeProp);
|
|
1151
1152
|
const props = { ...rest, value, onChange };
|
|
1152
1153
|
const resolved = useSizeVariant2(size);
|
|
1153
1154
|
const needsCompactEngine = Array.isArray(props.value) || props.steps !== undefined || props.showSteps !== undefined || props.showValue !== undefined || props.valuePosition !== undefined || props.trackClassName !== undefined || props.trackStyle !== undefined || props.fillClassName !== undefined || props.fillStyle !== undefined || props.hideFill !== undefined || props.thumbColor !== undefined || props.thumbBorderColor !== undefined;
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
// lib/icon-context.tsx
|
|
2
3
|
import {
|
|
3
4
|
ArrowDown,
|
|
4
5
|
ArrowLeft,
|
|
5
6
|
ArrowRight,
|
|
7
|
+
ArrowRightFromLine,
|
|
8
|
+
ArrowRightToLine,
|
|
6
9
|
ArrowUp,
|
|
10
|
+
ArrowUpDown,
|
|
7
11
|
Bell,
|
|
8
12
|
Brain,
|
|
9
13
|
Calendar,
|
|
10
14
|
Check,
|
|
11
15
|
ChevronDown,
|
|
16
|
+
ChevronLeft,
|
|
12
17
|
ChevronRight,
|
|
18
|
+
ChevronsLeft,
|
|
19
|
+
ChevronsRight,
|
|
13
20
|
ChevronsUpDown,
|
|
21
|
+
ChevronUp,
|
|
14
22
|
Circle,
|
|
23
|
+
CircleAlert,
|
|
24
|
+
CircleCheck,
|
|
25
|
+
CircleQuestionMark,
|
|
15
26
|
Clock,
|
|
16
27
|
Copy,
|
|
17
28
|
CornerDownLeft,
|
|
@@ -19,19 +30,27 @@ import {
|
|
|
19
30
|
Dot,
|
|
20
31
|
Ellipsis,
|
|
21
32
|
EllipsisVertical,
|
|
33
|
+
Eye,
|
|
34
|
+
EyeOff,
|
|
35
|
+
File,
|
|
36
|
+
Flag,
|
|
22
37
|
Folder,
|
|
38
|
+
FunnelX,
|
|
23
39
|
Globe,
|
|
24
40
|
Heart,
|
|
25
41
|
Home,
|
|
26
42
|
ImageIcon,
|
|
27
43
|
Inbox,
|
|
44
|
+
Info,
|
|
28
45
|
Lightbulb,
|
|
29
46
|
Link,
|
|
30
47
|
Loader,
|
|
48
|
+
LoaderCircle,
|
|
31
49
|
Lock,
|
|
32
50
|
Mail,
|
|
33
51
|
Menu,
|
|
34
52
|
MessageCircle,
|
|
53
|
+
Minus,
|
|
35
54
|
Monitor,
|
|
36
55
|
Moon,
|
|
37
56
|
Paintbrush,
|
|
@@ -57,13 +76,39 @@ import {
|
|
|
57
76
|
SquareLibrary,
|
|
58
77
|
Star,
|
|
59
78
|
Sun,
|
|
79
|
+
Timer,
|
|
80
|
+
Trash2,
|
|
81
|
+
TriangleAlert,
|
|
82
|
+
Upload,
|
|
60
83
|
User,
|
|
61
84
|
Users,
|
|
62
85
|
X
|
|
63
86
|
} from "lucide-react";
|
|
64
87
|
import { createContext, useContext, useMemo } from "react";
|
|
65
88
|
import { jsx } from "react/jsx-runtime";
|
|
66
|
-
var
|
|
89
|
+
var defaultIcons2 = {
|
|
90
|
+
"chevron-left": ChevronLeft,
|
|
91
|
+
"chevron-up": ChevronUp,
|
|
92
|
+
"chevrons-left": ChevronsLeft,
|
|
93
|
+
"chevrons-right": ChevronsRight,
|
|
94
|
+
"arrow-up-down": ArrowUpDown,
|
|
95
|
+
"circle-alert": CircleAlert,
|
|
96
|
+
"triangle-alert": TriangleAlert,
|
|
97
|
+
"circle-check": CircleCheck,
|
|
98
|
+
info: Info,
|
|
99
|
+
"circle-question-mark": CircleQuestionMark,
|
|
100
|
+
trash: Trash2,
|
|
101
|
+
eye: Eye,
|
|
102
|
+
"eye-off": EyeOff,
|
|
103
|
+
timer: Timer,
|
|
104
|
+
"arrow-right-from-line": ArrowRightFromLine,
|
|
105
|
+
"arrow-right-to-line": ArrowRightToLine,
|
|
106
|
+
"funnel-x": FunnelX,
|
|
107
|
+
flag: Flag,
|
|
108
|
+
"loader-circle": LoaderCircle,
|
|
109
|
+
minus: Minus,
|
|
110
|
+
upload: Upload,
|
|
111
|
+
file: File,
|
|
67
112
|
"chevron-right": ChevronRight,
|
|
68
113
|
"chevron-down": ChevronDown,
|
|
69
114
|
pipette: Pipette,
|
|
@@ -126,16 +171,19 @@ var defaultIcons = {
|
|
|
126
171
|
"sliders-horizontal": SlidersHorizontal
|
|
127
172
|
};
|
|
128
173
|
var IconContext = createContext(null);
|
|
129
|
-
function
|
|
174
|
+
function useIcon2(name) {
|
|
130
175
|
const icons = useContext(IconContext);
|
|
131
|
-
return (icons ??
|
|
176
|
+
return (icons ?? defaultIcons2)[name];
|
|
177
|
+
}
|
|
178
|
+
function useIcons2() {
|
|
179
|
+
const icons = useContext(IconContext);
|
|
180
|
+
return icons ?? defaultIcons2;
|
|
132
181
|
}
|
|
133
182
|
function IconProvider2({ children, icons }) {
|
|
134
|
-
const value = useMemo(() => ({ ...
|
|
183
|
+
const value = useMemo(() => ({ ...defaultIcons2, ...icons }), [icons]);
|
|
135
184
|
return /* @__PURE__ */ jsx(IconContext.Provider, {
|
|
136
185
|
value,
|
|
137
186
|
children
|
|
138
187
|
});
|
|
139
188
|
}
|
|
140
|
-
|
|
141
|
-
export { useIcon, IconProvider2 };
|
|
189
|
+
export { defaultIcons2, useIcon2, useIcons2, IconProvider2 };
|