@justanarthur/modo-ui 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -20
- package/blocks/desktop-shell/examples.mdx +153 -0
- package/blocks/desktop-shell/index.tsx +352 -0
- package/blocks/shell-card/examples.mdx +72 -0
- package/blocks/shell-card/index.tsx +127 -0
- package/blocks/sidebar-app/index.tsx +3 -2
- package/blocks/sidebar-app/thread-page.tsx +2 -2
- package/components/{button → actions/button}/index.tsx +14 -22
- package/components/actions/button/variants.ts +138 -0
- package/components/{copy → actions/copy}/examples.mdx +40 -2
- package/components/{copy → actions/copy}/index.tsx +206 -36
- package/components/{accordion → containers/accordion}/accordion-content.tsx +14 -11
- package/components/{accordion → containers/accordion}/accordion-context.tsx +21 -12
- package/components/{accordion → containers/accordion}/accordion-group.tsx +11 -11
- package/components/{accordion → containers/accordion}/index.tsx +95 -47
- package/components/{card → containers/card}/card-group.tsx +7 -7
- package/components/{card → containers/card}/card-media.tsx +5 -5
- package/components/{card → containers/card}/card-parts.tsx +27 -17
- package/components/{card → containers/card}/examples.mdx +3 -2
- package/components/{card → containers/card}/index.tsx +12 -11
- package/components/{avatar → data-display/avatar}/examples.mdx +1 -1
- package/components/{avatar → data-display/avatar}/index.tsx +5 -5
- package/components/{badge → data-display/badge}/change-demo.tsx +1 -1
- package/components/{badge → data-display/badge}/index.tsx +8 -10
- package/components/{badge → data-display/badge}/variants.ts +7 -0
- package/components/data-display/diff/examples.mdx +72 -0
- package/components/data-display/diff/index.tsx +147 -0
- package/components/data-display/kbd/examples.mdx +55 -0
- package/components/data-display/kbd/index.tsx +65 -0
- package/components/data-display/list/examples.mdx +157 -0
- package/components/data-display/list/index.tsx +130 -0
- package/components/data-display/log-view/examples.mdx +69 -0
- package/components/data-display/log-view/index.tsx +290 -0
- package/components/data-display/log-view/stream-demo.tsx +46 -0
- package/components/data-display/markdown/examples.mdx +92 -0
- package/components/data-display/markdown/index.tsx +291 -0
- package/components/{table → data-display/table}/context.ts +12 -2
- package/components/{table → data-display/table}/head.tsx +5 -5
- package/components/{table → data-display/table}/index.tsx +40 -14
- package/components/{table → data-display/table}/parts.tsx +66 -52
- package/components/feedback/empty-state/examples.mdx +38 -0
- package/components/feedback/empty-state/index.tsx +96 -0
- package/components/feedback/meter/examples.mdx +61 -0
- package/components/feedback/meter/index.tsx +182 -0
- package/components/{progress → feedback/progress}/examples.mdx +2 -2
- package/components/{progress → feedback/progress}/index.tsx +5 -5
- package/components/{progress → feedback/progress}/step-demo.tsx +1 -1
- package/components/feedback/status-dot/examples.mdx +75 -0
- package/components/feedback/status-dot/index.tsx +105 -0
- package/components/inputs/checkbox/index.tsx +15 -9
- package/components/inputs/choice-list/examples.mdx +101 -0
- package/components/inputs/choice-list/index.tsx +186 -0
- package/components/inputs/color-picker/examples.mdx +10 -0
- package/components/inputs/color-picker/format-menu.tsx +1 -1
- package/components/inputs/color-picker/index.tsx +26 -10
- package/components/inputs/color-picker/inputs-row.tsx +1 -1
- package/components/inputs/color-picker/popover.tsx +40 -8
- package/components/inputs/color-picker/saturation-square.tsx +1 -1
- package/components/inputs/color-picker/swatches.tsx +1 -1
- package/components/inputs/combobox/context.ts +25 -1
- package/components/inputs/combobox/examples.mdx +1 -1
- package/components/inputs/combobox/fields.tsx +100 -51
- package/components/inputs/combobox/index.tsx +218 -200
- package/components/inputs/combobox/list.tsx +1 -1
- package/components/inputs/combobox/remote-demo.tsx +1 -1
- package/components/inputs/date-time/calendar/index.tsx +6 -3
- package/components/inputs/date-time/date-picker/examples.mdx +36 -0
- package/components/inputs/date-time/date-picker/index.tsx +106 -20
- package/components/inputs/date-time/date-range-picker/examples.mdx +36 -0
- package/components/inputs/date-time/date-range-picker/index.tsx +331 -54
- package/components/inputs/date-time/day-rules.ts +6 -3
- package/components/inputs/date-time/duration-picker/examples.mdx +16 -0
- package/components/inputs/date-time/duration-picker/index.tsx +74 -22
- package/components/inputs/date-time/month-picker/examples.mdx +12 -0
- package/components/inputs/date-time/month-picker/index.tsx +76 -21
- package/components/inputs/date-time/picker-shell.tsx +142 -11
- package/components/inputs/date-time/time-columns.tsx +5 -2
- package/components/inputs/date-time/time-picker/examples.mdx +13 -0
- package/components/inputs/date-time/time-picker/index.tsx +63 -12
- package/components/inputs/editable-text/examples.mdx +33 -0
- package/components/inputs/editable-text/index.tsx +175 -0
- package/components/inputs/field/index.tsx +1 -1
- package/components/inputs/file-dropzone/file-row.tsx +2 -2
- package/components/inputs/file-dropzone/index.tsx +5 -0
- package/components/inputs/input/index.tsx +1 -1
- package/components/inputs/key-value/examples.mdx +58 -0
- package/components/inputs/key-value/index.tsx +232 -0
- package/components/inputs/label/examples.mdx +1 -1
- package/components/inputs/number-input/index.tsx +4 -4
- package/components/inputs/radio/examples.mdx +10 -0
- package/components/inputs/radio/index.tsx +15 -6
- package/components/inputs/search/examples.mdx +1 -1
- package/components/inputs/search/index.tsx +1 -1
- package/components/inputs/select/examples.mdx +28 -1
- package/components/inputs/select/index.tsx +248 -167
- package/components/inputs/switch/index.tsx +1 -1
- package/components/navigation/breadcrumb/examples.mdx +45 -0
- package/components/navigation/breadcrumb/index.tsx +284 -0
- package/components/navigation/navigation-menu/context.ts +5 -1
- package/components/navigation/navigation-menu/examples.mdx +23 -0
- package/components/navigation/navigation-menu/index.tsx +8 -1
- package/components/navigation/navigation-menu/indicator.tsx +38 -0
- package/components/navigation/navigation-menu/list.tsx +33 -22
- package/components/navigation/pagination/index.tsx +2 -2
- package/components/navigation/sidebar/index.tsx +1 -1
- package/components/navigation/sidebar/sidebar-menu-item.tsx +1 -1
- package/components/navigation/sidebar/sidebar-rail.tsx +1 -1
- package/components/navigation/tabs/examples.mdx +11 -0
- package/components/navigation/tabs/index.tsx +1 -1
- package/components/navigation/tabs/item.tsx +3 -3
- package/components/navigation/tree/examples.mdx +76 -0
- package/components/navigation/tree/index.tsx +431 -0
- package/components/overlays/alert-dialog/examples.mdx +1 -1
- package/components/overlays/alert-dialog/index.tsx +37 -26
- package/components/overlays/alert-dialog/pending-demo.tsx +1 -1
- package/components/overlays/command/examples.mdx +2 -2
- package/components/overlays/command/index.tsx +20 -17
- package/components/overlays/context-menu/index.tsx +38 -29
- package/components/overlays/dialog/examples.mdx +22 -2
- package/components/overlays/dialog/index.tsx +87 -32
- package/components/overlays/dropdown/examples.mdx +86 -2
- package/components/overlays/dropdown/index.tsx +136 -48
- package/components/overlays/dropdown/menu-item.tsx +165 -65
- package/components/overlays/dropdown/menu-parts.tsx +153 -0
- package/components/overlays/dropdown/menu-popup.tsx +52 -10
- package/components/overlays/dropdown/panel-state.ts +49 -16
- package/components/overlays/dropdown/submenu.tsx +26 -27
- package/components/overlays/lightbox/examples.mdx +29 -0
- package/components/overlays/lightbox/index.tsx +395 -0
- package/components/overlays/popover/anchored-demo.tsx +1 -1
- package/components/overlays/popover/examples.mdx +1 -1
- package/components/overlays/popover/index.tsx +27 -24
- package/components/overlays/preview-card/index.tsx +16 -13
- package/components/overlays/sheet/examples.mdx +14 -1
- package/components/overlays/sheet/index.tsx +122 -54
- package/components/overlays/toast/examples.mdx +17 -1
- package/components/overlays/toast/index.tsx +117 -45
- package/components/overlays/toast/manager.ts +45 -12
- package/components/overlays/tooltip/examples.mdx +7 -7
- package/components/overlays/tooltip/index.tsx +59 -50
- package/dist/base.css +62 -82
- package/dist/blocks/desktop-shell/index.d.ts +84 -0
- package/dist/blocks/desktop-shell/index.js +45 -0
- package/dist/blocks/shell-card/index.d.ts +57 -0
- package/dist/blocks/shell-card/index.js +13 -0
- package/dist/blocks/sidebar-app/index.d.ts +24 -4
- package/dist/blocks/sidebar-app/index.js +43 -37
- package/dist/components/{button → actions/button}/index.d.ts +28 -12
- package/dist/components/actions/button/index.js +22 -0
- package/dist/components/actions/button/variants.d.ts +29 -0
- package/dist/components/{button → actions/button}/variants.js +1 -1
- package/dist/components/actions/copy/index.d.ts +79 -0
- package/dist/components/actions/copy/index.js +26 -0
- package/dist/components/{accordion → containers/accordion}/index.d.ts +51 -19
- package/dist/components/containers/accordion/index.js +40 -0
- package/dist/components/{card → containers/card}/index.d.ts +27 -23
- package/dist/components/containers/card/index.js +58 -0
- package/dist/components/data-display/avatar/index.js +20 -0
- package/dist/components/{badge → data-display/badge}/index.d.ts +6 -3
- package/dist/components/data-display/badge/index.js +21 -0
- package/dist/components/{badge → data-display/badge}/variants.d.ts +6 -1
- package/dist/components/{badge → data-display/badge}/variants.js +1 -1
- package/dist/components/data-display/diff/index.d.ts +42 -0
- package/dist/components/data-display/diff/index.js +17 -0
- package/dist/components/data-display/kbd/index.d.ts +28 -0
- package/dist/components/data-display/kbd/index.js +11 -0
- package/dist/components/data-display/list/index.d.ts +60 -0
- package/dist/components/data-display/list/index.js +21 -0
- package/dist/components/data-display/log-view/index.d.ts +47 -0
- package/dist/components/data-display/log-view/index.js +26 -0
- package/dist/components/data-display/markdown/index.d.ts +43 -0
- package/dist/components/data-display/markdown/index.js +34 -0
- package/dist/components/{table → data-display/table}/index.d.ts +24 -7
- package/dist/components/data-display/table/index.js +40 -0
- package/dist/components/feedback/empty-state/index.d.ts +38 -0
- package/dist/components/feedback/empty-state/index.js +15 -0
- package/dist/components/feedback/meter/index.d.ts +48 -0
- package/dist/components/feedback/meter/index.js +13 -0
- package/dist/components/feedback/progress/index.js +16 -0
- package/dist/components/feedback/status-dot/index.d.ts +37 -0
- package/dist/components/feedback/status-dot/index.js +15 -0
- package/dist/components/inputs/checkbox/index.d.ts +8 -5
- package/dist/components/inputs/checkbox/index.js +13 -13
- package/dist/components/inputs/choice-list/index.d.ts +52 -0
- package/dist/components/inputs/choice-list/index.js +25 -0
- package/dist/components/inputs/color-picker/index.d.ts +39 -23
- package/dist/components/inputs/color-picker/index.js +27 -25
- 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 +40 -9
- package/dist/components/inputs/combobox/index.js +21 -21
- package/dist/components/inputs/date-time/calendar/index.d.ts +6 -1
- package/dist/components/inputs/date-time/calendar/index.js +10 -10
- package/dist/components/inputs/date-time/date-picker/index.d.ts +48 -8
- package/dist/components/inputs/date-time/date-picker/index.js +31 -31
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +99 -18
- package/dist/components/inputs/date-time/date-range-picker/index.js +32 -30
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +52 -9
- package/dist/components/inputs/date-time/duration-picker/index.js +29 -29
- package/dist/components/inputs/date-time/month-picker/index.d.ts +49 -8
- package/dist/components/inputs/date-time/month-picker/index.js +28 -28
- package/dist/components/inputs/date-time/time-picker/index.d.ts +47 -8
- package/dist/components/inputs/date-time/time-picker/index.js +29 -29
- package/dist/components/inputs/editable-text/index.d.ts +38 -0
- package/dist/components/inputs/editable-text/index.js +17 -0
- package/dist/components/inputs/field/index.js +8 -8
- package/dist/components/inputs/file-dropzone/index.d.ts +3 -1
- package/dist/components/inputs/file-dropzone/index.js +10 -10
- package/dist/components/inputs/input/index.js +9 -9
- package/dist/components/inputs/key-value/index.d.ts +57 -0
- package/dist/components/inputs/key-value/index.js +29 -0
- package/dist/components/inputs/label/index.js +2 -2
- package/dist/components/inputs/number-input/index.d.ts +3 -2
- package/dist/components/inputs/number-input/index.js +11 -11
- package/dist/components/inputs/radio/index.d.ts +2 -2
- package/dist/components/inputs/radio/index.js +11 -11
- package/dist/components/inputs/search/index.js +23 -23
- package/dist/components/inputs/select/index.d.ts +71 -47
- package/dist/components/inputs/select/index.js +23 -22
- package/dist/components/inputs/slider/index.js +4 -4
- package/dist/components/inputs/switch/index.js +9 -9
- package/dist/components/inputs/textarea/index.js +5 -5
- package/dist/components/navigation/breadcrumb/index.d.ts +44 -0
- package/dist/components/navigation/breadcrumb/index.js +45 -0
- package/dist/components/navigation/navigation-menu/index.d.ts +13 -2
- package/dist/components/navigation/navigation-menu/index.js +20 -18
- package/dist/components/navigation/pagination/index.js +19 -19
- package/dist/components/navigation/sidebar/index.d.ts +1 -9
- package/dist/components/navigation/sidebar/index.js +26 -26
- package/dist/components/navigation/tabs/index.d.ts +5 -5
- package/dist/components/navigation/tabs/index.js +12 -12
- package/dist/components/navigation/tree/index.d.ts +65 -0
- package/dist/components/navigation/tree/index.js +25 -0
- package/dist/components/overlays/alert-dialog/index.d.ts +35 -15
- package/dist/components/overlays/alert-dialog/index.js +15 -15
- package/dist/components/overlays/command/index.d.ts +6 -1
- package/dist/components/overlays/command/index.js +21 -21
- package/dist/components/overlays/context-menu/index.d.ts +138 -14
- package/dist/components/overlays/context-menu/index.js +29 -26
- package/dist/components/overlays/dialog/index.d.ts +43 -15
- package/dist/components/overlays/dialog/index.js +14 -14
- package/dist/components/overlays/dropdown/index.d.ts +163 -59
- package/dist/components/overlays/dropdown/index.js +37 -26
- package/dist/components/overlays/lightbox/index.d.ts +59 -0
- package/dist/components/overlays/lightbox/index.js +30 -0
- package/dist/components/overlays/popover/index.d.ts +7 -1
- package/dist/components/overlays/popover/index.js +11 -11
- package/dist/components/overlays/preview-card/index.d.ts +4 -1
- package/dist/components/overlays/preview-card/index.js +10 -10
- package/dist/components/overlays/sheet/index.d.ts +49 -8
- package/dist/components/overlays/sheet/index.js +15 -15
- package/dist/components/overlays/toast/index.d.ts +92 -39
- package/dist/components/overlays/toast/index.js +13 -11
- package/dist/components/overlays/tooltip/index.d.ts +16 -6
- package/dist/components/overlays/tooltip/index.js +8 -8
- package/dist/docs/index.d.ts +54 -0
- package/dist/docs/index.js +327 -0
- package/dist/docs/vite.d.ts +50 -0
- package/dist/docs/vite.js +63 -0
- package/dist/index.d.ts +3722 -2274
- package/dist/index.js +240 -115
- package/dist/lib/date-locale.d.ts +13 -1
- package/dist/lib/date-locale.js +11 -3
- package/dist/lib/field-box.js +3 -3
- package/dist/lib/fluid-hover-highlight.js +4 -4
- package/dist/lib/focus-ring.js +3 -3
- package/dist/lib/goo-indicator.js +3 -3
- package/dist/lib/icon-context.d.ts +7 -2
- package/dist/lib/icon-context.js +4 -2
- package/dist/lib/morph-layers.js +3 -3
- package/dist/lib/overlay.js +3 -3
- package/dist/lib/popup-rows.js +2 -2
- package/dist/lib/popup-surface.js +7 -7
- package/dist/lib/row-index.d.ts +6 -9
- package/dist/lib/row-index.js +1 -1
- package/dist/lib/row-order.d.ts +28 -0
- package/dist/lib/row-order.js +11 -0
- package/dist/lib/scroll-column.js +6 -6
- package/dist/lib/shape-context.d.ts +8 -1
- package/dist/lib/shape-context.js +4 -2
- package/dist/lib/slot.d.ts +9 -2
- package/dist/lib/slot.js +5 -3
- package/dist/lib/use-merge-split.js +4 -4
- package/dist/lib/use-morph.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/weight-label.js +2 -2
- package/dist/preset.d.ts +9 -0
- package/dist/preset.js +11 -2
- package/dist/primitives/content/code/index.js +14 -0
- package/dist/primitives/content/skeleton/index.js +14 -0
- package/dist/primitives/layout/resizable/index.d.ts +67 -0
- package/dist/primitives/layout/resizable/index.js +16 -0
- package/dist/primitives/layout/scroll-area/index.js +14 -0
- package/dist/primitives/{separator → layout/separator}/index.js +2 -2
- package/dist/primitives/layout/sortable/index.d.ts +79 -0
- package/dist/primitives/layout/sortable/index.js +23 -0
- package/dist/primitives/layout/virtual-list/index.d.ts +50 -0
- package/dist/primitives/layout/virtual-list/index.js +9 -0
- package/dist/primitives/systems/craft/index.js +16 -0
- package/dist/primitives/systems/fluid-hover/index.js +30 -0
- package/dist/primitives/{morph → systems/morph}/index.d.ts +3 -1
- package/dist/primitives/systems/morph/index.js +30 -0
- package/dist/primitives/systems/motion/index.js +25 -0
- package/dist/primitives/{sizes → systems/sizes}/index.d.ts +2 -2
- package/dist/primitives/{sizes → systems/sizes}/index.js +4 -4
- package/dist/primitives/{surface → systems/surface}/index.js +6 -6
- package/dist/shared/{components-7t3pz7v7.js → components-0cpte6s1.js} +76 -40
- package/dist/shared/{components-gc5zky2w.js → components-0h2mng6m.js} +7 -7
- package/dist/shared/{components-62mg6pab.js → components-14wzcym0.js} +16 -16
- package/dist/shared/components-1asw2ph0.js +237 -0
- package/dist/shared/{components-p0z99d5b.js → components-1bnf96sr.js} +17 -15
- package/dist/shared/components-1f3a7gmg.js +168 -0
- package/dist/shared/components-1hb27y2e.js +77 -0
- package/dist/shared/{components-1axxc3tk.js → components-1hga6pkn.js} +8 -8
- package/dist/shared/{components-wyfmhtw9.js → components-1ztgy933.js} +2 -2
- package/dist/shared/{components-0h3f5jae.js → components-22h8dvt1.js} +19 -16
- package/dist/shared/{components-07g2gbjy.js → components-280grw6q.js} +19 -12
- package/dist/shared/components-29ebea21.js +129 -0
- package/dist/shared/{components-zbzx62pg.js → components-2m2hg11x.js} +93 -378
- package/dist/shared/components-3rvrdsa9.js +208 -0
- package/dist/shared/components-464zs8v6.js +152 -0
- package/dist/shared/components-4t2cjav8.js +73 -0
- package/dist/shared/{components-9ybenn5v.js → components-5xs8pkkj.js} +5 -5
- package/dist/shared/{components-gbsdhmrv.js → components-62510420.js} +62 -27
- package/dist/shared/components-6h5qg9rs.js +188 -0
- package/dist/shared/{components-7fsy0jxg.js → components-6rtawx8y.js} +108 -75
- package/dist/shared/{components-n7e31ct4.js → components-77gxngmc.js} +8 -8
- package/dist/shared/components-7mj5wsv3.js +200 -0
- package/dist/shared/{components-amsc86fb.js → components-7xc2dne4.js} +68 -37
- package/dist/shared/{components-pedbt2dc.js → components-8pnvkrbw.js} +1 -1
- package/dist/shared/{components-be3wggg1.js → components-91mmbrw3.js} +5 -5
- package/dist/shared/components-92mvpt9h.js +243 -0
- package/dist/shared/{components-jtfptckj.js → components-9ca0c92a.js} +6 -6
- package/dist/shared/{components-ejn6tvbw.js → components-9h3g4mnq.js} +1 -1
- package/dist/shared/components-9rebr89j.js +249 -0
- package/dist/shared/{components-re8p99fj.js → components-9z7bq8gn.js} +147 -21
- package/dist/shared/{components-3js2vgds.js → components-a1ms36qq.js} +3 -3
- package/dist/shared/{components-q4wyd06h.js → components-a1mwqxsv.js} +88 -22
- package/dist/shared/{components-cy5z8zxy.js → components-azrjnfxn.js} +2 -2
- package/dist/shared/{components-85epgxwf.js → components-b2kjsn1s.js} +60 -37
- package/dist/shared/{components-vgzerqt0.js → components-b7p1pjcm.js} +8 -7
- package/dist/shared/{components-j4z3rtw2.js → components-b9bj65j3.js} +46 -21
- package/dist/shared/{components-0mrhj88d.js → components-c515d6xr.js} +2 -2
- package/dist/shared/{components-5f3tq4qb.js → components-chda6b23.js} +2 -2
- package/dist/shared/{components-az04rmng.js → components-cp5ym3g2.js} +2 -2
- package/dist/shared/components-czvraaw9.js +135 -0
- package/dist/shared/{components-kn5c7652.js → components-e7zxwja1.js} +7 -6
- package/dist/shared/components-ee09xmkh.js +359 -0
- package/dist/shared/{components-3m4rqrqm.js → components-esy5nsvc.js} +3 -3
- package/dist/shared/{components-34brwmgp.js → components-ev0ytbqb.js} +12 -10
- package/dist/shared/{components-zpatc9x3.js → components-fmyvz4r2.js} +9 -8
- package/dist/shared/{components-f9adtfq8.js → components-fpsfr52a.js} +1 -1
- package/dist/shared/{components-zf0nnvvg.js → components-fqsgd07c.js} +68 -24
- package/dist/shared/{components-5vyaexsj.js → components-g35n8tzm.js} +2 -2
- package/dist/shared/components-g8qgr7p8.js +28 -0
- package/dist/shared/{components-88r046aa.js → components-gd8gmr6w.js} +4 -4
- package/dist/shared/{components-f75y4gn8.js → components-gsstwhtv.js} +6 -6
- package/dist/shared/{components-1hc3xv0y.js → components-h0x2pj2y.js} +170 -118
- package/dist/shared/components-h8v9nh5r.js +142 -0
- package/dist/shared/{components-6xfhc5qm.js → components-hcftn5r8.js} +14 -12
- package/dist/shared/components-hh1g7r3t.js +57 -0
- package/dist/shared/{components-jm91mjm1.js → components-hz6armxa.js} +13 -9
- package/dist/shared/{components-k81x1aea.js → components-j3q9kaps.js} +2 -2
- package/dist/shared/{components-88ktjdg0.js → components-j79a6jqa.js} +13 -12
- package/dist/shared/{components-k785rge6.js → components-jeecysvd.js} +24 -168
- package/dist/shared/{components-1nv9q3s8.js → components-jnhpgpfk.js} +29 -2
- package/dist/shared/{components-wgd1nebp.js → components-jw45ck66.js} +4 -4
- package/dist/shared/{components-7fqnqbh0.js → components-kwxye0an.js} +10 -4
- package/dist/shared/{components-qrpdtvxa.js → components-kxpcj2ry.js} +7 -1
- package/dist/shared/components-m3vxpz2z.js +123 -0
- package/dist/shared/{components-86vvx0c8.js → components-me742146.js} +9 -9
- package/dist/shared/{components-jx9qb4z8.js → components-n0gbyp5a.js} +18 -16
- package/dist/shared/{components-8hfrd2fk.js → components-nhmgr5xc.js} +14 -14
- package/dist/shared/{components-nv5m3gcv.js → components-nxqrw789.js} +2 -2
- package/dist/shared/{components-1a7cr7vh.js → components-nz14rwtd.js} +1 -1
- package/dist/shared/{components-j8tcbm8y.js → components-p32aqk3q.js} +2 -2
- package/dist/shared/components-pa2t12j2.js +327 -0
- package/dist/shared/{components-r33dxr5j.js → components-q0hs5rqn.js} +1 -1
- package/dist/shared/{components-xzcgr3gy.js → components-q7zk70tx.js} +6 -6
- package/dist/shared/{components-8sazy704.js → components-r5q9gdh4.js} +13 -12
- package/dist/shared/{components-tjxy84s9.js → components-rgng034x.js} +1 -1
- package/dist/shared/{components-skn189mp.js → components-rzy6h7s4.js} +5 -5
- package/dist/shared/{components-wrbw67f6.js → components-s4x951hj.js} +3 -3
- package/dist/shared/{components-gw0wd7gd.js → components-s90v3jpr.js} +371 -187
- package/dist/shared/components-t0c1rw40.js +75 -0
- package/dist/shared/components-t84071ay.js +76 -0
- package/dist/shared/{components-0p2na0cp.js → components-ta4e10mx.js} +3 -3
- package/dist/shared/components-twyj2y8c.js +336 -0
- package/dist/shared/components-vfreweq3.js +210 -0
- package/dist/shared/{components-2xmke84n.js → components-w1ysefg1.js} +2 -2
- package/dist/shared/{components-5atrr490.js → components-w2at9ntm.js} +27 -13
- package/dist/shared/{components-346ged8v.js → components-wq9hrera.js} +2 -2
- package/dist/shared/{components-tnj6mkhg.js → components-wx1dcp2n.js} +17 -10
- package/dist/shared/components-xa9fvd5b.js +302 -0
- package/dist/shared/{components-1jxw899c.js → components-xnkc892z.js} +8 -6
- package/dist/shared/{components-ycx2kxeq.js → components-xnp09586.js} +1 -1
- package/dist/shared/{components-vp6vzsee.js → components-y09nr7fe.js} +1 -1
- package/dist/shared/{components-sesrjvcc.js → components-y4gsk1jt.js} +3 -3
- package/dist/shared/{components-099sdasz.js → components-y8m64zdw.js} +31 -22
- package/dist/shared/components-yf2gtq68.js +302 -0
- package/dist/shared/{components-xpw8dzb0.js → components-ymq8tbq9.js} +2 -2
- package/dist/shared/components-ywgqahmg.js +80 -0
- package/dist/shared/{components-5ynncdpn.js → components-z0kz9rxj.js} +2 -2
- package/dist/styles.css +212 -137
- package/dist/tailwind.css +14 -0
- package/dist/tokens.css +37 -4
- package/docs/chrome.css +175 -0
- package/docs/chrome.tsx +314 -0
- package/docs/index.ts +8 -0
- package/docs/vite.ts +123 -0
- package/index.ts +40 -21
- package/lib/date-locale.ts +152 -6
- package/lib/icon-context.tsx +45 -1
- package/lib/row-index.tsx +6 -16
- package/lib/row-order.tsx +111 -0
- package/lib/shape-context.tsx +9 -1
- package/lib/slot.tsx +17 -4
- package/lib/use-autosize-textarea.ts +1 -1
- package/lib/use-morph.ts +1 -1
- package/lib/utils.ts +1 -1
- package/package.json +200 -38
- package/primitives/{code → content/code}/index.tsx +4 -4
- package/primitives/{skeleton → content/skeleton}/examples.mdx +1 -1
- package/primitives/{skeleton → content/skeleton}/index.tsx +4 -4
- package/primitives/layout/resizable/examples.mdx +93 -0
- package/primitives/layout/resizable/index.tsx +332 -0
- package/primitives/{scroll-area → layout/scroll-area}/index.tsx +3 -3
- package/primitives/{separator → layout/separator}/examples.mdx +1 -1
- package/primitives/{separator → layout/separator}/index.tsx +1 -1
- package/primitives/layout/sortable/examples.mdx +53 -0
- package/primitives/layout/sortable/index.tsx +351 -0
- package/primitives/layout/virtual-list/examples.mdx +45 -0
- package/primitives/layout/virtual-list/index.tsx +269 -0
- package/primitives/layout/virtual-list/jump-demo.tsx +53 -0
- package/primitives/{craft → systems/craft}/demos.tsx +8 -8
- package/primitives/{craft → systems/craft}/examples.mdx +5 -5
- package/primitives/{craft → systems/craft}/index.tsx +3 -3
- package/primitives/{fluid-hover → systems/fluid-hover}/examples.mdx +1 -1
- package/primitives/{fluid-hover → systems/fluid-hover}/index.tsx +10 -10
- package/primitives/{morph → systems/morph}/examples.mdx +4 -4
- package/primitives/{morph → systems/morph}/index.tsx +71 -66
- package/primitives/{motion → systems/motion}/index.tsx +5 -5
- package/primitives/{sizes → systems/sizes}/examples.mdx +4 -4
- package/primitives/{sizes → systems/sizes}/index.tsx +8 -8
- package/primitives/{surface → systems/surface}/examples.mdx +2 -2
- package/primitives/{surface → systems/surface}/index.tsx +3 -3
- package/tokens/colors.css +234 -0
- package/tokens/motion.css +40 -0
- package/tokens/radius.css +24 -0
- package/tokens/spacing.css +9 -0
- package/tokens/typography.css +119 -0
- package/components/AI/input-message/examples.mdx +0 -134
- package/components/AI/input-message/file-preview-tile.tsx +0 -59
- package/components/AI/input-message/file-thumbnail.tsx +0 -146
- package/components/AI/input-message/index.tsx +0 -625
- package/components/AI/input-message/input-message.css +0 -25
- package/components/AI/input-message/queued-row.tsx +0 -102
- package/components/AI/input-message/shared.ts +0 -38
- package/components/AI/input-message/suggestion-row.tsx +0 -64
- package/components/AI/input-message/use-composer-files.ts +0 -142
- package/components/AI/input-message/use-history-nav.ts +0 -60
- package/components/AI/input-message/use-message-queue.ts +0 -108
- package/components/AI/input-message/use-region-height.ts +0 -34
- package/components/AI/thinking-indicator/examples.mdx +0 -27
- package/components/AI/thinking-indicator/index.tsx +0 -188
- package/components/button/variants.ts +0 -63
- package/dist/components/AI/input-message/index.d.ts +0 -128
- package/dist/components/AI/input-message/index.js +0 -39
- package/dist/components/AI/thinking-indicator/index.d.ts +0 -34
- package/dist/components/AI/thinking-indicator/index.js +0 -17
- package/dist/components/accordion/index.js +0 -39
- package/dist/components/avatar/index.js +0 -20
- package/dist/components/badge/index.js +0 -21
- package/dist/components/button/index.js +0 -22
- package/dist/components/button/variants.d.ts +0 -8
- package/dist/components/card/index.js +0 -57
- package/dist/components/copy/index.d.ts +0 -46
- package/dist/components/copy/index.js +0 -25
- package/dist/components/progress/index.js +0 -16
- package/dist/components/table/index.js +0 -39
- package/dist/primitives/code/index.js +0 -14
- package/dist/primitives/craft/index.js +0 -16
- package/dist/primitives/fluid-hover/index.js +0 -30
- package/dist/primitives/morph/index.js +0 -29
- package/dist/primitives/motion/index.js +0 -25
- package/dist/primitives/scroll-area/index.js +0 -14
- package/dist/primitives/skeleton/index.js +0 -14
- package/dist/shared/components-1p3k62x2.js +0 -137
- package/dist/shared/components-38wa9nx5.js +0 -19
- package/dist/shared/components-50rh4ggz.js +0 -54
- package/dist/shared/components-bdkm2jzy.js +0 -34
- package/dist/shared/components-gkdx1787.js +0 -159
- package/dist/shared/components-nskr4hwg.js +0 -1008
- /package/components/{button → actions/button}/examples.mdx +0 -0
- /package/components/{button → actions/button}/loading-demo.tsx +0 -0
- /package/components/{accordion → containers/accordion}/examples.mdx +0 -0
- /package/components/{badge → data-display/badge}/examples.mdx +0 -0
- /package/components/{table → data-display/table}/examples.mdx +0 -0
- /package/components/{table → data-display/table}/sort-demo.tsx +0 -0
- /package/components/{progress → feedback/progress}/progress.css +0 -0
- /package/components/inputs/color-picker/{color-math.ts → variants.ts} +0 -0
- /package/dist/components/{avatar → data-display/avatar}/index.d.ts +0 -0
- /package/dist/components/{progress → feedback/progress}/index.d.ts +0 -0
- /package/dist/primitives/{code → content/code}/index.d.ts +0 -0
- /package/dist/primitives/{skeleton → content/skeleton}/index.d.ts +0 -0
- /package/dist/primitives/{scroll-area → layout/scroll-area}/index.d.ts +0 -0
- /package/dist/primitives/{separator → layout/separator}/index.d.ts +0 -0
- /package/dist/primitives/{craft → systems/craft}/index.d.ts +0 -0
- /package/dist/primitives/{fluid-hover → systems/fluid-hover}/index.d.ts +0 -0
- /package/dist/primitives/{motion → systems/motion}/index.d.ts +0 -0
- /package/dist/primitives/{surface → systems/surface}/index.d.ts +0 -0
- /package/primitives/{code → content/code}/examples.mdx +0 -0
- /package/primitives/{skeleton → content/skeleton}/skeleton.css +0 -0
- /package/primitives/{scroll-area → layout/scroll-area}/examples.mdx +0 -0
- /package/primitives/{motion → systems/motion}/examples.mdx +0 -0
- /package/primitives/{surface → systems/surface}/surface.css +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
cn2
|
|
5
|
+
} from "./components-xnp09586.js";
|
|
6
|
+
|
|
7
|
+
// primitives/layout/virtual-list/index.tsx
|
|
8
|
+
import { forwardRef, useCallback, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function rowAt(offsets, count, y) {
|
|
11
|
+
let lo = 0;
|
|
12
|
+
let hi = count;
|
|
13
|
+
while (lo < hi) {
|
|
14
|
+
const mid = lo + hi >> 1;
|
|
15
|
+
if ((offsets[mid + 1] ?? 0) <= y)
|
|
16
|
+
lo = mid + 1;
|
|
17
|
+
else
|
|
18
|
+
hi = mid;
|
|
19
|
+
}
|
|
20
|
+
return lo;
|
|
21
|
+
}
|
|
22
|
+
function Row({ index, count, top, height, observer, children }) {
|
|
23
|
+
const ref = useRef(null);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
const node = ref.current;
|
|
26
|
+
if (height || !node)
|
|
27
|
+
return;
|
|
28
|
+
const rows = observer();
|
|
29
|
+
rows.observe(node);
|
|
30
|
+
return () => rows.unobserve(node);
|
|
31
|
+
}, [height, observer]);
|
|
32
|
+
return /* @__PURE__ */ jsx("li", {
|
|
33
|
+
ref,
|
|
34
|
+
"aria-setsize": count,
|
|
35
|
+
"aria-posinset": index + 1,
|
|
36
|
+
"data-index": index,
|
|
37
|
+
className: "absolute inset-x-0",
|
|
38
|
+
style: { top, height },
|
|
39
|
+
children
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var VirtualList2 = forwardRef(({
|
|
43
|
+
count,
|
|
44
|
+
renderItem,
|
|
45
|
+
itemHeight,
|
|
46
|
+
estimateHeight = 36,
|
|
47
|
+
overscan = 6,
|
|
48
|
+
follow = false,
|
|
49
|
+
onFollowChange,
|
|
50
|
+
contentWidth,
|
|
51
|
+
label,
|
|
52
|
+
className
|
|
53
|
+
}, ref) => {
|
|
54
|
+
const rootRef = useRef(null);
|
|
55
|
+
const innerRef = useRef(null);
|
|
56
|
+
const [scroller, setScroller] = useState(null);
|
|
57
|
+
const [view, setView] = useState({ top: 0, height: 0 });
|
|
58
|
+
const heights = useRef(new Map);
|
|
59
|
+
const [, setMeasured] = useState(0);
|
|
60
|
+
const own = scroller !== null && scroller === rootRef.current;
|
|
61
|
+
const offsets = [0];
|
|
62
|
+
for (let i = 0;i < count; i++)
|
|
63
|
+
offsets.push((offsets[i] ?? 0) + (itemHeight ?? heights.current.get(i) ?? estimateHeight));
|
|
64
|
+
const latest = useRef(offsets);
|
|
65
|
+
latest.current = offsets;
|
|
66
|
+
const total = offsets[count] ?? 0;
|
|
67
|
+
const following = useRef(true);
|
|
68
|
+
const followChange = useRef(onFollowChange);
|
|
69
|
+
followChange.current = onFollowChange;
|
|
70
|
+
useLayoutEffect(() => {
|
|
71
|
+
const root = rootRef.current;
|
|
72
|
+
if (root)
|
|
73
|
+
setScroller(root.closest('[data-slot="scroll-area-viewport"]') ?? root);
|
|
74
|
+
}, []);
|
|
75
|
+
const listTop = useCallback(() => {
|
|
76
|
+
const inner = innerRef.current;
|
|
77
|
+
if (!scroller || !inner)
|
|
78
|
+
return 0;
|
|
79
|
+
const zoom = inner.currentCSSZoom ?? 1;
|
|
80
|
+
return (inner.getBoundingClientRect().top - scroller.getBoundingClientRect().top) / zoom + scroller.scrollTop;
|
|
81
|
+
}, [scroller]);
|
|
82
|
+
useLayoutEffect(() => {
|
|
83
|
+
if (!scroller)
|
|
84
|
+
return;
|
|
85
|
+
const update = () => {
|
|
86
|
+
setView({ top: scroller.scrollTop - listTop(), height: scroller.clientHeight });
|
|
87
|
+
if (!follow)
|
|
88
|
+
return;
|
|
89
|
+
const atEnd = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight <= 2;
|
|
90
|
+
if (atEnd === following.current)
|
|
91
|
+
return;
|
|
92
|
+
following.current = atEnd;
|
|
93
|
+
followChange.current?.(atEnd);
|
|
94
|
+
};
|
|
95
|
+
update();
|
|
96
|
+
scroller.addEventListener("scroll", update, { passive: true });
|
|
97
|
+
const resize = new ResizeObserver(update);
|
|
98
|
+
resize.observe(scroller);
|
|
99
|
+
return () => {
|
|
100
|
+
scroller.removeEventListener("scroll", update);
|
|
101
|
+
resize.disconnect();
|
|
102
|
+
};
|
|
103
|
+
}, [scroller, listTop, follow]);
|
|
104
|
+
useLayoutEffect(() => {
|
|
105
|
+
if (follow && following.current && scroller)
|
|
106
|
+
scroller.scrollTop = scroller.scrollHeight;
|
|
107
|
+
}, [follow, scroller, count, total]);
|
|
108
|
+
const rows = useRef(null);
|
|
109
|
+
const observer = useCallback(() => {
|
|
110
|
+
rows.current ??= new ResizeObserver((entries) => {
|
|
111
|
+
let changed = false;
|
|
112
|
+
for (const entry of entries) {
|
|
113
|
+
const index = Number(entry.target.dataset.index);
|
|
114
|
+
const height = entry.borderBoxSize[0]?.blockSize ?? entry.contentRect.height;
|
|
115
|
+
if (heights.current.get(index) === height)
|
|
116
|
+
continue;
|
|
117
|
+
heights.current.set(index, height);
|
|
118
|
+
changed = true;
|
|
119
|
+
}
|
|
120
|
+
if (changed)
|
|
121
|
+
setMeasured((n) => n + 1);
|
|
122
|
+
});
|
|
123
|
+
return rows.current;
|
|
124
|
+
}, []);
|
|
125
|
+
useLayoutEffect(() => () => rows.current?.disconnect(), []);
|
|
126
|
+
useImperativeHandle(ref, () => ({
|
|
127
|
+
scrollToIndex(index, align = "auto") {
|
|
128
|
+
const jump = () => {
|
|
129
|
+
if (!scroller)
|
|
130
|
+
return;
|
|
131
|
+
const at = Math.max(0, Math.min(index, count - 1));
|
|
132
|
+
const start = latest.current[at] ?? 0;
|
|
133
|
+
const top = listTop() + start;
|
|
134
|
+
const height = (latest.current[at + 1] ?? start) - start;
|
|
135
|
+
const { scrollTop, clientHeight } = scroller;
|
|
136
|
+
if (align === "start")
|
|
137
|
+
scroller.scrollTop = top;
|
|
138
|
+
else if (align === "end")
|
|
139
|
+
scroller.scrollTop = top + height - clientHeight;
|
|
140
|
+
else if (align === "center")
|
|
141
|
+
scroller.scrollTop = top + height / 2 - clientHeight / 2;
|
|
142
|
+
else if (top < scrollTop)
|
|
143
|
+
scroller.scrollTop = top;
|
|
144
|
+
else if (top + height > scrollTop + clientHeight)
|
|
145
|
+
scroller.scrollTop = top + height - clientHeight;
|
|
146
|
+
};
|
|
147
|
+
jump();
|
|
148
|
+
if (!itemHeight)
|
|
149
|
+
requestAnimationFrame(() => requestAnimationFrame(jump));
|
|
150
|
+
},
|
|
151
|
+
scrollToEnd() {
|
|
152
|
+
if (!scroller)
|
|
153
|
+
return;
|
|
154
|
+
if (follow && !following.current)
|
|
155
|
+
followChange.current?.(true);
|
|
156
|
+
following.current = true;
|
|
157
|
+
scroller.scrollTop = scroller.scrollHeight;
|
|
158
|
+
}
|
|
159
|
+
}), [scroller, listTop, count, itemHeight, follow]);
|
|
160
|
+
const first = Math.max(0, rowAt(offsets, count, view.top) - overscan);
|
|
161
|
+
const last = Math.min(count, rowAt(offsets, count, view.top + view.height) + 1 + overscan);
|
|
162
|
+
const visible = [];
|
|
163
|
+
for (let i = first;i < last; i++)
|
|
164
|
+
visible.push(i);
|
|
165
|
+
return /* @__PURE__ */ jsx("div", {
|
|
166
|
+
ref: rootRef,
|
|
167
|
+
tabIndex: own ? 0 : undefined,
|
|
168
|
+
className: cn2(own && "overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-focus-ring", className),
|
|
169
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
170
|
+
ref: innerRef,
|
|
171
|
+
"aria-label": label,
|
|
172
|
+
className: cn2("relative", contentWidth && "min-w-full"),
|
|
173
|
+
style: { height: total, width: contentWidth },
|
|
174
|
+
children: visible.map((i) => /* @__PURE__ */ jsx(Row, {
|
|
175
|
+
index: i,
|
|
176
|
+
count,
|
|
177
|
+
top: offsets[i] ?? 0,
|
|
178
|
+
height: itemHeight,
|
|
179
|
+
observer,
|
|
180
|
+
children: renderItem(i)
|
|
181
|
+
}, i))
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
VirtualList2.displayName = "VirtualList";
|
|
186
|
+
var virtual_list_default = VirtualList2;
|
|
187
|
+
|
|
188
|
+
export { VirtualList2, virtual_list_default };
|
|
@@ -12,38 +12,38 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
useMorphOrigin2,
|
|
14
14
|
useMorph2
|
|
15
|
-
} from "./components-
|
|
15
|
+
} from "./components-8pnvkrbw.js";
|
|
16
16
|
import {
|
|
17
17
|
positionerProps2,
|
|
18
18
|
usePortalContainer2
|
|
19
|
-
} from "./components-
|
|
19
|
+
} from "./components-rgng034x.js";
|
|
20
20
|
import {
|
|
21
21
|
POPUP_SHAPE2
|
|
22
22
|
} from "./components-mse06t0x.js";
|
|
23
23
|
import {
|
|
24
24
|
cn2
|
|
25
|
-
} from "./components-
|
|
25
|
+
} from "./components-xnp09586.js";
|
|
26
26
|
import {
|
|
27
27
|
useShape2
|
|
28
|
-
} from "./components-
|
|
28
|
+
} from "./components-kxpcj2ry.js";
|
|
29
29
|
import {
|
|
30
30
|
PopupSurface2
|
|
31
|
-
} from "./components-
|
|
31
|
+
} from "./components-nxqrw789.js";
|
|
32
32
|
import {
|
|
33
33
|
useSize2
|
|
34
34
|
} from "./components-znspksk0.js";
|
|
35
35
|
import {
|
|
36
36
|
SizeScope2
|
|
37
|
-
} from "./components-
|
|
37
|
+
} from "./components-nz14rwtd.js";
|
|
38
38
|
import {
|
|
39
39
|
GooIndicator2
|
|
40
|
-
} from "./components-
|
|
40
|
+
} from "./components-z0kz9rxj.js";
|
|
41
41
|
import {
|
|
42
42
|
FluidHoverHighlight2
|
|
43
|
-
} from "./components-
|
|
43
|
+
} from "./components-g35n8tzm.js";
|
|
44
44
|
import {
|
|
45
45
|
FocusRing2
|
|
46
|
-
} from "./components-
|
|
46
|
+
} from "./components-c515d6xr.js";
|
|
47
47
|
import {
|
|
48
48
|
mergeRefs2,
|
|
49
49
|
useMergeRefs2
|
|
@@ -59,16 +59,16 @@ import {
|
|
|
59
59
|
} from "./components-tcyz2tdn.js";
|
|
60
60
|
import {
|
|
61
61
|
WeightLabel2
|
|
62
|
-
} from "./components-
|
|
62
|
+
} from "./components-y09nr7fe.js";
|
|
63
63
|
import {
|
|
64
64
|
useIcon2
|
|
65
|
-
} from "./components-
|
|
65
|
+
} from "./components-jnhpgpfk.js";
|
|
66
66
|
|
|
67
67
|
// components/navigation/navigation-menu/index.tsx
|
|
68
68
|
import { NavigationMenu as NavigationMenuPrimitive6 } from "@base-ui/react/navigation-menu";
|
|
69
69
|
import {
|
|
70
70
|
forwardRef as forwardRef6,
|
|
71
|
-
useMemo,
|
|
71
|
+
useMemo as useMemo2,
|
|
72
72
|
useRef as useRef4,
|
|
73
73
|
useState as useState3
|
|
74
74
|
} from "react";
|
|
@@ -81,6 +81,7 @@ import { forwardRef, useContext as useContext2, useRef as useRef2, useState } fr
|
|
|
81
81
|
import { createContext, useContext } from "react";
|
|
82
82
|
var NavigationMenuContext = createContext(null);
|
|
83
83
|
var ItemContext = createContext("");
|
|
84
|
+
var ListMarkerContext = createContext(null);
|
|
84
85
|
var InContentContext = createContext(false);
|
|
85
86
|
function useNavigationMenu(part) {
|
|
86
87
|
const ctx = useContext(NavigationMenuContext);
|
|
@@ -167,16 +168,36 @@ var NavigationMenuContent2 = forwardRef(({ className, children, onKeyDownCapture
|
|
|
167
168
|
});
|
|
168
169
|
NavigationMenuContent2.displayName = "NavigationMenuContent";
|
|
169
170
|
|
|
171
|
+
// components/navigation/navigation-menu/indicator.tsx
|
|
172
|
+
import { useContext as useContext3, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
173
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
174
|
+
function NavigationMenuIndicator2({ className }) {
|
|
175
|
+
const marker = useContext3(ListMarkerContext);
|
|
176
|
+
if (!marker)
|
|
177
|
+
throw new Error("NavigationMenu.Indicator must be inside NavigationMenu.List");
|
|
178
|
+
const { rect, claim } = marker;
|
|
179
|
+
const shape = useShape2();
|
|
180
|
+
useLayoutEffect2(claim, [claim]);
|
|
181
|
+
return /* @__PURE__ */ jsx2("li", {
|
|
182
|
+
"aria-hidden": true,
|
|
183
|
+
className: "contents",
|
|
184
|
+
children: rect && /* @__PURE__ */ jsx2(GooIndicator2, {
|
|
185
|
+
rect,
|
|
186
|
+
className: cn2("bg-active", shape.bg, className)
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
170
191
|
// components/navigation/navigation-menu/item.tsx
|
|
171
192
|
import { NavigationMenu as NavigationMenuPrimitive2 } from "@base-ui/react/navigation-menu";
|
|
172
193
|
import { forwardRef as forwardRef2, useId } from "react";
|
|
173
|
-
import { jsx as
|
|
194
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
174
195
|
var NavigationMenuItem2 = forwardRef2(({ value, ...props }, ref) => {
|
|
175
196
|
const generated = useId();
|
|
176
197
|
const itemValue = value ?? generated;
|
|
177
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ jsx3(ItemContext.Provider, {
|
|
178
199
|
value: itemValue,
|
|
179
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ jsx3(NavigationMenuPrimitive2.Item, {
|
|
180
201
|
ref,
|
|
181
202
|
value: itemValue,
|
|
182
203
|
...props
|
|
@@ -190,20 +211,20 @@ function stripItemClasses(size, shape, lit) {
|
|
|
190
211
|
|
|
191
212
|
// components/navigation/navigation-menu/link.tsx
|
|
192
213
|
import { NavigationMenu as NavigationMenuPrimitive3 } from "@base-ui/react/navigation-menu";
|
|
193
|
-
import { forwardRef as forwardRef3, useContext as
|
|
194
|
-
import { jsx as
|
|
214
|
+
import { forwardRef as forwardRef3, useContext as useContext4 } from "react";
|
|
215
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
195
216
|
var NavigationMenuLink2 = forwardRef3(({ active = false, icon: Icon, description, className, children, ...props }, ref) => {
|
|
196
|
-
const inContent =
|
|
217
|
+
const inContent = useContext4(InContentContext);
|
|
197
218
|
const size = useSize2();
|
|
198
219
|
const shape = useShape2();
|
|
199
220
|
if (!inContent) {
|
|
200
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ jsx4(NavigationMenuPrimitive3.Link, {
|
|
201
222
|
ref,
|
|
202
223
|
active,
|
|
203
224
|
...{ [ROW_ATTR]: "strip" },
|
|
204
225
|
className: cn2(stripItemClasses(size, shape, active), className),
|
|
205
226
|
...props,
|
|
206
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ jsx4(WeightLabel2, {
|
|
207
228
|
emphasized: active,
|
|
208
229
|
trim: true,
|
|
209
230
|
className: "whitespace-nowrap",
|
|
@@ -218,7 +239,7 @@ var NavigationMenuLink2 = forwardRef3(({ active = false, icon: Icon, description
|
|
|
218
239
|
className: cn2("group/row relative z-10 flex min-w-0 cursor-pointer select-none no-underline outline-none", "text-muted-foreground transition-[color] duration-fast data-[fluid-hover-active]:text-foreground data-[active]:text-foreground", description ? "items-start py-2" : ["items-center", size.control], size.itemPx, size.gap, POPUP_SHAPE2.item, className),
|
|
219
240
|
...props,
|
|
220
241
|
children: [
|
|
221
|
-
Icon && /* @__PURE__ */
|
|
242
|
+
Icon && /* @__PURE__ */ jsx4(Icon, {
|
|
222
243
|
size: size.icon,
|
|
223
244
|
strokeWidth: 1.5,
|
|
224
245
|
className: cn2("shrink-0 transition-[stroke-width] duration-fast group-data-[fluid-hover-active]/row:stroke-[2]", description && "mt-0.5")
|
|
@@ -226,13 +247,13 @@ var NavigationMenuLink2 = forwardRef3(({ active = false, icon: Icon, description
|
|
|
226
247
|
/* @__PURE__ */ jsxs2("span", {
|
|
227
248
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
228
249
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx4(WeightLabel2, {
|
|
230
251
|
emphasized: active,
|
|
231
252
|
truncate: "line",
|
|
232
253
|
className: cn2("text-foreground", size.text),
|
|
233
254
|
children
|
|
234
255
|
}),
|
|
235
|
-
description && /* @__PURE__ */
|
|
256
|
+
description && /* @__PURE__ */ jsx4("span", {
|
|
236
257
|
className: cn2("text-muted-foreground", size.variant === "compact" ? "text-caption-compact" : "text-caption"),
|
|
237
258
|
children: description
|
|
238
259
|
})
|
|
@@ -247,11 +268,13 @@ NavigationMenuLink2.displayName = "NavigationMenuLink";
|
|
|
247
268
|
import { NavigationMenu as NavigationMenuPrimitive4 } from "@base-ui/react/navigation-menu";
|
|
248
269
|
import {
|
|
249
270
|
forwardRef as forwardRef4,
|
|
250
|
-
|
|
271
|
+
useCallback,
|
|
272
|
+
useLayoutEffect as useLayoutEffect3,
|
|
273
|
+
useMemo,
|
|
251
274
|
useRef as useRef3,
|
|
252
275
|
useState as useState2
|
|
253
276
|
} from "react";
|
|
254
|
-
import { jsx as
|
|
277
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
255
278
|
var NavigationMenuList2 = forwardRef4(({ className, children, ...props }, ref) => {
|
|
256
279
|
const { value, setList } = useNavigationMenu("NavigationMenu.List");
|
|
257
280
|
const own = useRef3(null);
|
|
@@ -262,44 +285,53 @@ var NavigationMenuList2 = forwardRef4(({ className, children, ...props }, ref) =
|
|
|
262
285
|
const focus = useRowFocus2(hover);
|
|
263
286
|
const rows = useDomRows(element, hover.registerItem, "strip");
|
|
264
287
|
const [marked, setMarked] = useState2(-1);
|
|
265
|
-
|
|
288
|
+
useLayoutEffect3(() => {
|
|
266
289
|
const items = rows.current;
|
|
267
290
|
const open = value === null ? -1 : items.findIndex((el) => el.dataset.navigationMenuValue === value);
|
|
268
291
|
setMarked(open >= 0 ? open : items.findIndex((el) => el.hasAttribute("data-active")));
|
|
269
292
|
});
|
|
270
293
|
const markedRect = hover.isMeasured && marked >= 0 ? hover.itemRects[marked] : undefined;
|
|
294
|
+
const [claimed, setClaimed] = useState2(false);
|
|
295
|
+
const claim = useCallback(() => {
|
|
296
|
+
setClaimed(true);
|
|
297
|
+
return () => setClaimed(false);
|
|
298
|
+
}, []);
|
|
299
|
+
const marker = useMemo(() => ({ rect: markedRect, claim }), [markedRect, claim]);
|
|
271
300
|
const inStrip = (e) => e.currentTarget.contains(e.target);
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
return /* @__PURE__ */ jsx5(ListMarkerContext.Provider, {
|
|
302
|
+
value: marker,
|
|
303
|
+
children: /* @__PURE__ */ jsxs3(NavigationMenuPrimitive4.List, {
|
|
304
|
+
ref: mergedRef,
|
|
305
|
+
onMouseEnter: hover.handlers.onMouseEnter,
|
|
306
|
+
onMouseLeave: hover.handlers.onMouseLeave,
|
|
307
|
+
onMouseMove: (e) => inStrip(e) ? hover.handlers.onMouseMove(e) : hover.handlers.onMouseLeave(),
|
|
308
|
+
onClick: (e) => inStrip(e) && hover.handlers.onClick(e),
|
|
309
|
+
onFocus: (e) => inStrip(e) && focus.handlers.onFocus(e),
|
|
310
|
+
onBlur: (e) => inStrip(e) && focus.handlers.onBlur(e),
|
|
311
|
+
className: cn2("relative m-0 flex list-none items-center p-0", className),
|
|
312
|
+
...props,
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ jsxs3("li", {
|
|
315
|
+
"aria-hidden": true,
|
|
316
|
+
className: "contents",
|
|
317
|
+
children: [
|
|
318
|
+
markedRect && !claimed && /* @__PURE__ */ jsx5(GooIndicator2, {
|
|
319
|
+
rect: markedRect,
|
|
320
|
+
className: cn2("bg-active", shape.bg)
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ jsx5(FluidHoverHighlight2, {
|
|
323
|
+
hover,
|
|
324
|
+
className: shape.bg
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ jsx5(FocusRing2, {
|
|
327
|
+
rect: focus.focusRect,
|
|
328
|
+
className: shape.focusRing
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
}),
|
|
332
|
+
children
|
|
333
|
+
]
|
|
334
|
+
})
|
|
303
335
|
});
|
|
304
336
|
});
|
|
305
337
|
NavigationMenuList2.displayName = "NavigationMenuList";
|
|
@@ -307,17 +339,17 @@ NavigationMenuList2.displayName = "NavigationMenuList";
|
|
|
307
339
|
// components/navigation/navigation-menu/trigger.tsx
|
|
308
340
|
import { NavigationMenu as NavigationMenuPrimitive5 } from "@base-ui/react/navigation-menu";
|
|
309
341
|
import { motion } from "motion/react";
|
|
310
|
-
import { forwardRef as forwardRef5, useCallback, useContext as
|
|
311
|
-
import { jsx as
|
|
342
|
+
import { forwardRef as forwardRef5, useCallback as useCallback2, useContext as useContext5 } from "react";
|
|
343
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
312
344
|
var NavigationMenuTrigger2 = forwardRef5(({ className, children, ...props }, ref) => {
|
|
313
345
|
const { value, triggers } = useNavigationMenu("NavigationMenu.Trigger");
|
|
314
|
-
const itemValue =
|
|
346
|
+
const itemValue = useContext5(ItemContext);
|
|
315
347
|
const size = useSize2();
|
|
316
348
|
const shape = useShape2();
|
|
317
349
|
const reduceMotion = useReduceMotion2();
|
|
318
350
|
const Chevron = useIcon2("chevron-down");
|
|
319
351
|
const open = value === itemValue;
|
|
320
|
-
const register =
|
|
352
|
+
const register = useCallback2((node) => {
|
|
321
353
|
if (node)
|
|
322
354
|
triggers.current.set(itemValue, node);
|
|
323
355
|
else
|
|
@@ -330,19 +362,19 @@ var NavigationMenuTrigger2 = forwardRef5(({ className, children, ...props }, ref
|
|
|
330
362
|
className: cn2(stripItemClasses(size, shape, open), className),
|
|
331
363
|
...props,
|
|
332
364
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ jsx6(WeightLabel2, {
|
|
334
366
|
emphasized: open,
|
|
335
367
|
trim: true,
|
|
336
368
|
className: "whitespace-nowrap",
|
|
337
369
|
children
|
|
338
370
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ jsx6(motion.span, {
|
|
340
372
|
"aria-hidden": true,
|
|
341
373
|
className: "flex",
|
|
342
374
|
initial: false,
|
|
343
375
|
animate: { rotate: open ? 180 : 0 },
|
|
344
376
|
transition: reduceMotion ? { duration: 0 } : spring2.moderate,
|
|
345
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ jsx6(Chevron, {
|
|
346
378
|
size: size.icon,
|
|
347
379
|
strokeWidth: open ? 2 : 1.5,
|
|
348
380
|
className: "transition-[stroke-width] duration-fast group-data-[fluid-hover-active]/strip:stroke-[2]"
|
|
@@ -354,7 +386,7 @@ var NavigationMenuTrigger2 = forwardRef5(({ className, children, ...props }, ref
|
|
|
354
386
|
NavigationMenuTrigger2.displayName = "NavigationMenuTrigger";
|
|
355
387
|
|
|
356
388
|
// components/navigation/navigation-menu/index.tsx
|
|
357
|
-
import { jsx as
|
|
389
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
358
390
|
/*!
|
|
359
391
|
* Local addition (not part of Fluid Functionalism): a site header's
|
|
360
392
|
* navigation menu on Base UI's NavigationMenu, its panel growing out of its
|
|
@@ -384,11 +416,11 @@ var NavigationMenu2 = forwardRef6(({
|
|
|
384
416
|
const triggers = useRef4(new Map);
|
|
385
417
|
const [list, setList] = useState3(null);
|
|
386
418
|
const morph = useMorph2(value !== null, origin, { from, effect, hideSource, tier });
|
|
387
|
-
const ctx =
|
|
419
|
+
const ctx = useMemo2(() => ({ value, triggers, setList }), [value]);
|
|
388
420
|
const reduceMotion = useReduceMotion2();
|
|
389
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ jsx7(SizeScope2, {
|
|
390
422
|
size,
|
|
391
|
-
children: /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ jsx7(NavigationMenuContext.Provider, {
|
|
392
424
|
value: ctx,
|
|
393
425
|
children: /* @__PURE__ */ jsxs5(NavigationMenuPrimitive6.Root, {
|
|
394
426
|
ref,
|
|
@@ -404,21 +436,21 @@ var NavigationMenu2 = forwardRef6(({
|
|
|
404
436
|
...props,
|
|
405
437
|
children: [
|
|
406
438
|
children,
|
|
407
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ jsx7(NavigationMenuPrimitive6.Portal, {
|
|
408
440
|
container: usePortalContainer2(container),
|
|
409
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ jsx7(NavigationMenuPrimitive6.Positioner, {
|
|
410
442
|
...positionerProps2({ side, align, sideOffset, effect, hideSource }, { side: "bottom", align: "start", sideOffset: 6 }),
|
|
411
443
|
anchor: list,
|
|
412
444
|
collisionPadding: 8,
|
|
413
445
|
className: "h-[var(--positioner-height)] w-[var(--positioner-width)]",
|
|
414
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ jsx7(NavigationMenuPrimitive6.Popup, {
|
|
415
447
|
ref: morph.popupRef,
|
|
416
448
|
className: cn2("relative h-[var(--popup-height)] w-[var(--popup-width)] outline-none", !reduceMotion && "transition-[width,height] duration-moderate"),
|
|
417
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ jsx7(PopupSurface2, {
|
|
418
450
|
morph,
|
|
419
451
|
radius: POPUP_SHAPE2.container,
|
|
420
452
|
className: cn2("size-full overflow-hidden", POPUP_SHAPE2.container),
|
|
421
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ jsx7(NavigationMenuPrimitive6.Viewport, {
|
|
422
454
|
className: "relative size-full"
|
|
423
455
|
})
|
|
424
456
|
})
|
|
@@ -436,8 +468,9 @@ Object.assign(NavigationMenu2, {
|
|
|
436
468
|
Item: NavigationMenuItem2,
|
|
437
469
|
Trigger: NavigationMenuTrigger2,
|
|
438
470
|
Content: NavigationMenuContent2,
|
|
439
|
-
Link: NavigationMenuLink2
|
|
471
|
+
Link: NavigationMenuLink2,
|
|
472
|
+
Indicator: NavigationMenuIndicator2
|
|
440
473
|
});
|
|
441
474
|
var navigation_menu_default = NavigationMenu2;
|
|
442
475
|
|
|
443
|
-
export { NavigationMenuContent2, NavigationMenuItem2, NavigationMenuLink2, NavigationMenuList2, NavigationMenuTrigger2, NavigationMenu2, navigation_menu_default };
|
|
476
|
+
export { NavigationMenuContent2, NavigationMenuIndicator2, NavigationMenuItem2, NavigationMenuLink2, NavigationMenuList2, NavigationMenuTrigger2, NavigationMenu2, navigation_menu_default };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useIcon2
|
|
5
|
-
} from "./components-
|
|
5
|
+
} from "./components-jnhpgpfk.js";
|
|
6
6
|
import {
|
|
7
7
|
useControllableState2
|
|
8
8
|
} from "./components-wwd093xg.js";
|
|
@@ -14,20 +14,20 @@ import {
|
|
|
14
14
|
} from "./components-45r18egt.js";
|
|
15
15
|
import {
|
|
16
16
|
useMorph2
|
|
17
|
-
} from "./components-
|
|
17
|
+
} from "./components-8pnvkrbw.js";
|
|
18
18
|
import {
|
|
19
19
|
positionerProps2,
|
|
20
20
|
usePortalContainer2
|
|
21
|
-
} from "./components-
|
|
21
|
+
} from "./components-rgng034x.js";
|
|
22
22
|
import {
|
|
23
23
|
POPUP_SHAPE2
|
|
24
24
|
} from "./components-mse06t0x.js";
|
|
25
25
|
import {
|
|
26
26
|
cn2
|
|
27
|
-
} from "./components-
|
|
27
|
+
} from "./components-xnp09586.js";
|
|
28
28
|
import {
|
|
29
29
|
useShape2
|
|
30
|
-
} from "./components-
|
|
30
|
+
} from "./components-kxpcj2ry.js";
|
|
31
31
|
import {
|
|
32
32
|
SURFACE_BG2,
|
|
33
33
|
SURFACE_SHADOW2
|
|
@@ -37,18 +37,18 @@ import {
|
|
|
37
37
|
} from "./components-nwa2a9tq.js";
|
|
38
38
|
import {
|
|
39
39
|
PopupSurface2
|
|
40
|
-
} from "./components-
|
|
40
|
+
} from "./components-nxqrw789.js";
|
|
41
41
|
import {
|
|
42
42
|
useSize2
|
|
43
43
|
} from "./components-znspksk0.js";
|
|
44
44
|
import {
|
|
45
45
|
SizeScope2
|
|
46
|
-
} from "./components-
|
|
46
|
+
} from "./components-nz14rwtd.js";
|
|
47
47
|
import {
|
|
48
48
|
CommandListRoot2,
|
|
49
49
|
CommandShortcut2,
|
|
50
50
|
CommandList2
|
|
51
|
-
} from "./components-
|
|
51
|
+
} from "./components-j79a6jqa.js";
|
|
52
52
|
|
|
53
53
|
// components/inputs/search/index.tsx
|
|
54
54
|
import { Autocomplete } from "@base-ui/react/autocomplete";
|