@justanarthur/modo-ui 0.6.0-canary.9 → 1.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 +197 -643
- package/blocks/sidebar-app/examples.mdx +2 -2
- package/blocks/sidebar-app/index.tsx +20 -7
- package/blocks/sidebar-app/inset-topbar.tsx +3 -8
- package/blocks/sidebar-app/menu-grid.ts +8 -18
- package/blocks/sidebar-app/nav-data.ts +1 -1
- package/blocks/sidebar-app/search-field.tsx +8 -15
- package/blocks/sidebar-app/thread-page.tsx +58 -0
- package/blocks/sidebar-app/user-footer.tsx +8 -15
- package/blocks/sidebar-app/workspace-header.tsx +9 -28
- package/components/AI/input-message/examples.mdx +37 -33
- package/components/AI/input-message/file-preview-tile.tsx +59 -0
- package/components/AI/input-message/file-thumbnail.tsx +26 -53
- package/components/AI/input-message/index.tsx +362 -1122
- package/components/AI/input-message/input-message.css +25 -0
- package/components/AI/input-message/queued-row.tsx +102 -0
- package/components/AI/input-message/shared.ts +38 -0
- package/components/AI/input-message/suggestion-row.tsx +64 -0
- package/components/AI/input-message/use-composer-files.ts +142 -0
- package/components/AI/input-message/use-history-nav.ts +60 -0
- package/components/AI/input-message/use-message-queue.ts +108 -0
- package/components/AI/input-message/use-region-height.ts +34 -0
- package/components/AI/thinking-indicator/index.tsx +9 -31
- package/components/accordion/accordion-content.tsx +217 -0
- package/components/accordion/accordion-context.tsx +118 -0
- package/components/accordion/accordion-group.tsx +215 -0
- package/components/accordion/examples.mdx +64 -132
- package/components/accordion/index.tsx +127 -891
- package/components/avatar/examples.mdx +2 -2
- package/components/avatar/index.tsx +40 -34
- package/components/badge/change-demo.tsx +2 -0
- package/components/badge/examples.mdx +16 -34
- package/components/badge/index.tsx +31 -69
- package/components/badge/variants.ts +5 -30
- package/components/button/examples.mdx +79 -94
- package/components/button/index.tsx +97 -188
- package/components/button/loading-demo.tsx +2 -0
- package/components/button/variants.ts +12 -117
- package/components/card/card-group.tsx +184 -0
- package/components/card/card-media.tsx +207 -0
- package/components/card/card-parts.tsx +179 -0
- package/components/card/examples.mdx +91 -143
- package/components/card/index.tsx +190 -881
- package/components/copy/examples.mdx +29 -67
- package/components/copy/index.tsx +58 -285
- package/components/inputs/checkbox/examples.mdx +22 -39
- package/components/inputs/checkbox/index.tsx +103 -255
- package/components/inputs/checkbox/select-all-demo.tsx +8 -6
- package/components/inputs/color-picker/channel-sliders.tsx +70 -0
- package/components/inputs/color-picker/color-input.tsx +387 -0
- package/components/inputs/color-picker/{variants.ts → color-math.ts} +22 -57
- package/components/inputs/color-picker/context.ts +11 -0
- package/components/inputs/color-picker/examples.mdx +20 -59
- package/components/inputs/color-picker/format-menu.tsx +212 -0
- package/components/inputs/color-picker/index.tsx +190 -1776
- package/components/inputs/color-picker/inputs-row.tsx +196 -0
- package/components/inputs/color-picker/popover.tsx +161 -0
- package/components/inputs/color-picker/saturation-square.tsx +167 -0
- package/components/inputs/color-picker/swatches.tsx +178 -0
- package/components/inputs/combobox/context.ts +90 -0
- package/components/inputs/combobox/examples.mdx +103 -206
- package/components/inputs/combobox/fields.tsx +328 -0
- package/components/inputs/combobox/index.tsx +155 -1310
- package/components/inputs/combobox/list.tsx +415 -0
- package/components/inputs/combobox/remote-demo.tsx +70 -74
- package/components/inputs/date-time/calendar/examples.mdx +0 -11
- package/components/inputs/date-time/calendar/index.tsx +32 -59
- package/components/inputs/date-time/calendar/use-month-window.ts +35 -32
- package/components/inputs/date-time/date-picker/examples.mdx +59 -155
- package/components/inputs/date-time/date-picker/index.tsx +186 -370
- package/components/inputs/date-time/date-picker/masked-date-input.tsx +105 -247
- package/components/inputs/date-time/date-range-picker/examples.mdx +6 -62
- package/components/inputs/date-time/date-range-picker/index.tsx +105 -404
- package/components/inputs/date-time/date-value.ts +37 -0
- package/components/inputs/date-time/day-rules.ts +22 -0
- package/components/inputs/date-time/duration-picker/examples.mdx +0 -24
- package/components/inputs/date-time/duration-picker/index.tsx +50 -140
- package/components/inputs/date-time/month-picker/examples.mdx +0 -29
- package/components/inputs/date-time/month-picker/index.tsx +48 -132
- package/components/inputs/date-time/picker-shell.tsx +226 -347
- package/components/inputs/date-time/time-columns.tsx +11 -15
- package/components/inputs/date-time/time-picker/examples.mdx +0 -31
- package/components/inputs/date-time/time-picker/index.tsx +37 -118
- package/components/inputs/field/examples.mdx +81 -39
- package/components/inputs/field/index.tsx +113 -103
- package/components/inputs/file-dropzone/examples.mdx +23 -24
- package/components/inputs/file-dropzone/file-row.tsx +20 -21
- package/components/inputs/file-dropzone/index.tsx +130 -129
- package/components/inputs/file-dropzone/upload-demo.tsx +22 -18
- package/components/inputs/file-dropzone/variants.ts +3 -1
- package/components/inputs/input/examples.mdx +19 -74
- package/components/inputs/input/index.tsx +86 -149
- package/components/inputs/input/password-demo.tsx +5 -5
- package/components/inputs/label/examples.mdx +19 -26
- package/components/inputs/label/index.tsx +21 -34
- package/components/inputs/number-input/examples.mdx +63 -36
- package/components/inputs/number-input/index.tsx +62 -57
- package/components/inputs/radio/examples.mdx +24 -39
- package/components/inputs/radio/index.tsx +125 -328
- package/components/inputs/search/examples.mdx +3 -3
- package/components/inputs/search/index.tsx +46 -39
- package/components/inputs/select/examples.mdx +76 -167
- package/components/inputs/select/index.tsx +252 -776
- package/components/inputs/slider/comfortable.tsx +524 -0
- package/components/inputs/slider/compact.tsx +690 -0
- package/components/inputs/slider/examples.mdx +9 -35
- package/components/inputs/slider/geometry.ts +88 -0
- package/components/inputs/slider/index.tsx +65 -1796
- package/components/inputs/slider/value-display.tsx +184 -0
- package/components/inputs/switch/examples.mdx +31 -33
- package/components/inputs/switch/index.tsx +55 -107
- package/components/inputs/textarea/examples.mdx +23 -61
- package/components/inputs/textarea/index.tsx +21 -99
- package/components/navigation/navigation-menu/content.tsx +76 -0
- package/components/navigation/navigation-menu/context.ts +34 -0
- package/components/navigation/navigation-menu/examples.mdx +21 -84
- package/components/navigation/navigation-menu/index.tsx +139 -639
- package/components/navigation/navigation-menu/item.tsx +47 -0
- package/components/navigation/navigation-menu/link.tsx +104 -0
- package/components/navigation/navigation-menu/list.tsx +86 -0
- package/components/navigation/navigation-menu/trigger.tsx +78 -0
- package/components/navigation/navigation-menu/use-dom-rows.ts +56 -0
- package/components/navigation/pagination/examples.mdx +25 -34
- package/components/navigation/pagination/index.tsx +75 -153
- package/components/navigation/sidebar/examples.mdx +17 -23
- package/components/navigation/sidebar/index.tsx +59 -119
- package/components/navigation/sidebar/menu-scope.tsx +439 -0
- package/components/navigation/sidebar/row-label.tsx +61 -0
- package/components/navigation/sidebar/sidebar-context.tsx +71 -0
- package/components/navigation/sidebar/sidebar-group.tsx +299 -0
- package/components/navigation/sidebar/sidebar-menu-actions.tsx +209 -0
- package/components/navigation/sidebar/sidebar-menu-button.tsx +214 -0
- package/components/navigation/sidebar/sidebar-menu-item.tsx +207 -0
- package/components/navigation/sidebar/sidebar-menu-sub.tsx +180 -0
- package/components/navigation/sidebar/sidebar-parts.tsx +94 -0
- package/components/navigation/sidebar/sidebar-provider.tsx +248 -0
- package/components/navigation/sidebar/sidebar-rail.tsx +206 -0
- package/components/navigation/sidebar/sidebar-shell.tsx +180 -0
- package/components/navigation/sidebar/sidebar-shortcut.tsx +101 -0
- package/components/navigation/sidebar/sidebar.css +7 -11
- package/components/navigation/sidebar/use-measured-collapse.ts +62 -0
- package/components/navigation/tabs/context.ts +45 -0
- package/components/navigation/tabs/examples.mdx +63 -17
- package/components/navigation/tabs/index.tsx +82 -434
- package/components/navigation/tabs/item.tsx +161 -0
- package/components/navigation/tabs/list.tsx +143 -0
- package/components/overlays/alert-dialog/examples.mdx +2 -36
- package/components/overlays/alert-dialog/index.tsx +76 -90
- package/components/overlays/alert-dialog/pending-demo.tsx +3 -1
- package/components/overlays/command/index.tsx +28 -59
- package/components/overlays/context-menu/examples.mdx +58 -4
- package/components/overlays/context-menu/index.tsx +77 -221
- package/components/overlays/dialog/examples.mdx +8 -31
- package/components/overlays/dialog/index.tsx +81 -261
- package/components/overlays/dropdown/dropdown-search.tsx +33 -98
- package/components/overlays/dropdown/examples.mdx +77 -363
- package/components/overlays/dropdown/index.tsx +114 -1010
- package/components/overlays/dropdown/menu-item.tsx +98 -382
- package/components/overlays/dropdown/menu-popup.tsx +294 -0
- package/components/overlays/dropdown/panel-state.ts +176 -0
- package/components/overlays/dropdown/submenu.tsx +170 -0
- package/components/overlays/popover/anchored-demo.tsx +22 -13
- package/components/overlays/popover/examples.mdx +16 -65
- package/components/overlays/popover/index.tsx +93 -137
- package/components/overlays/preview-card/examples.mdx +4 -4
- package/components/overlays/preview-card/index.tsx +48 -103
- package/components/overlays/sheet/examples.mdx +0 -12
- package/components/overlays/sheet/index.tsx +44 -129
- package/components/overlays/toast/examples.mdx +33 -25
- package/components/overlays/toast/index.tsx +56 -203
- package/components/overlays/toast/manager.ts +63 -119
- package/components/overlays/tooltip/examples.mdx +6 -12
- package/components/overlays/tooltip/index.tsx +124 -264
- package/components/progress/index.tsx +24 -30
- package/components/progress/progress.css +6 -28
- package/components/progress/step-demo.tsx +2 -0
- package/components/table/context.ts +49 -0
- package/components/table/examples.mdx +40 -72
- package/components/table/head.tsx +105 -0
- package/components/table/index.tsx +73 -458
- package/components/table/parts.tsx +188 -0
- package/components/table/sort-demo.tsx +21 -30
- package/dist/base.css +141 -122
- package/dist/blocks/sidebar-app/index.d.ts +10 -2
- package/dist/blocks/sidebar-app/index.js +49 -40
- package/dist/components/AI/input-message/index.d.ts +22 -19
- package/dist/components/AI/input-message/index.js +30 -23
- package/dist/components/AI/thinking-indicator/index.d.ts +2 -0
- package/dist/components/AI/thinking-indicator/index.js +10 -9
- package/dist/components/accordion/index.d.ts +52 -85
- package/dist/components/accordion/index.js +25 -19
- package/dist/components/avatar/index.d.ts +10 -10
- package/dist/components/avatar/index.js +9 -8
- package/dist/components/badge/index.d.ts +11 -18
- package/dist/components/badge/index.js +9 -9
- package/dist/components/badge/variants.d.ts +2 -9
- package/dist/components/badge/variants.js +3 -5
- package/dist/components/button/index.d.ts +36 -60
- package/dist/components/button/index.js +12 -9
- package/dist/components/button/variants.d.ts +3 -34
- package/dist/components/button/variants.js +2 -4
- package/dist/components/card/index.d.ts +163 -108
- package/dist/components/card/index.js +30 -21
- package/dist/components/copy/index.d.ts +10 -41
- package/dist/components/copy/index.js +18 -15
- package/dist/components/inputs/checkbox/index.d.ts +25 -25
- package/dist/components/inputs/checkbox/index.js +22 -18
- package/dist/components/inputs/color-picker/index.d.ts +65 -53
- package/dist/components/inputs/color-picker/index.js +35 -29
- package/dist/components/inputs/combobox/index.d.ts +147 -152
- package/dist/components/inputs/combobox/index.js +31 -29
- package/dist/components/inputs/date-time/calendar/index.d.ts +18 -24
- package/dist/components/inputs/date-time/calendar/index.js +17 -15
- package/dist/components/inputs/date-time/date-picker/index.d.ts +52 -96
- package/dist/components/inputs/date-time/date-picker/index.js +42 -35
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +48 -108
- package/dist/components/inputs/date-time/date-range-picker/index.js +40 -35
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +21 -67
- package/dist/components/inputs/date-time/duration-picker/index.js +39 -33
- package/dist/components/inputs/date-time/month-picker/index.d.ts +18 -61
- package/dist/components/inputs/date-time/month-picker/index.js +38 -32
- package/dist/components/inputs/date-time/time-picker/index.d.ts +18 -59
- package/dist/components/inputs/date-time/time-picker/index.js +39 -33
- package/dist/components/inputs/field/index.d.ts +37 -41
- package/dist/components/inputs/field/index.js +13 -14
- package/dist/components/inputs/file-dropzone/index.d.ts +32 -25
- package/dist/components/inputs/file-dropzone/index.js +18 -15
- package/dist/components/inputs/file-dropzone/variants.js +1 -1
- package/dist/components/inputs/input/index.d.ts +48 -50
- package/dist/components/inputs/input/index.js +14 -12
- package/dist/components/inputs/label/index.d.ts +12 -10
- package/dist/components/inputs/label/index.js +5 -4
- package/dist/components/inputs/number-input/index.d.ts +31 -23
- package/dist/components/inputs/number-input/index.js +16 -14
- package/dist/components/inputs/radio/index.d.ts +20 -16
- package/dist/components/inputs/radio/index.js +20 -16
- package/dist/components/inputs/search/index.d.ts +12 -5
- package/dist/components/inputs/search/index.js +33 -26
- package/dist/components/inputs/select/index.d.ts +88 -99
- package/dist/components/inputs/select/index.js +32 -29
- package/dist/components/inputs/slider/index.d.ts +26 -48
- package/dist/components/inputs/slider/index.js +9 -10
- package/dist/components/inputs/switch/index.d.ts +12 -6
- package/dist/components/inputs/switch/index.js +17 -15
- package/dist/components/inputs/textarea/index.d.ts +12 -22
- package/dist/components/inputs/textarea/index.js +12 -9
- package/dist/components/navigation/navigation-menu/index.d.ts +112 -83
- package/dist/components/navigation/navigation-menu/index.js +31 -27
- package/dist/components/navigation/pagination/index.d.ts +25 -38
- package/dist/components/navigation/pagination/index.js +27 -34
- package/dist/components/navigation/sidebar/index.d.ts +236 -230
- package/dist/components/navigation/sidebar/index.js +59 -55
- package/dist/components/navigation/tabs/index.d.ts +62 -45
- package/dist/components/navigation/tabs/index.js +23 -17
- package/dist/components/overlays/alert-dialog/index.d.ts +71 -106
- package/dist/components/overlays/alert-dialog/index.js +24 -19
- package/dist/components/overlays/command/index.d.ts +40 -31
- package/dist/components/overlays/command/index.js +31 -25
- package/dist/components/overlays/context-menu/index.d.ts +70 -84
- package/dist/components/overlays/context-menu/index.js +35 -31
- package/dist/components/overlays/dialog/index.d.ts +82 -98
- package/dist/components/overlays/dialog/index.js +23 -20
- package/dist/components/overlays/dropdown/index.d.ts +191 -357
- package/dist/components/overlays/dropdown/index.js +35 -41
- package/dist/components/overlays/popover/index.d.ts +81 -52
- package/dist/components/overlays/popover/index.js +17 -13
- package/dist/components/overlays/preview-card/index.d.ts +52 -26
- package/dist/components/overlays/preview-card/index.js +16 -12
- package/dist/components/overlays/sheet/index.d.ts +41 -45
- package/dist/components/overlays/sheet/index.js +24 -19
- package/dist/components/overlays/toast/index.d.ts +73 -183
- package/dist/components/overlays/toast/index.js +20 -21
- package/dist/components/overlays/tooltip/index.d.ts +80 -118
- package/dist/components/overlays/tooltip/index.js +14 -12
- package/dist/components/progress/index.d.ts +10 -11
- package/dist/components/progress/index.js +7 -6
- package/dist/components/table/index.d.ts +72 -71
- package/dist/components/table/index.js +18 -16
- package/dist/index.d.ts +2575 -3149
- package/dist/index.js +186 -202
- package/dist/lib/date-locale.d.ts +6 -13
- package/dist/lib/date-locale.js +5 -11
- package/dist/lib/date-mask.d.ts +41 -0
- package/dist/lib/date-mask.js +20 -0
- package/dist/lib/field-box.d.ts +114 -0
- package/dist/lib/field-box.js +18 -0
- package/dist/lib/field-classes.d.ts +15 -119
- package/dist/lib/field-classes.js +4 -21
- package/dist/lib/fluid-hover-highlight.d.ts +3 -25
- package/dist/lib/fluid-hover-highlight.js +8 -13
- package/dist/lib/focus-ring.d.ts +16 -10
- package/dist/lib/focus-ring.js +6 -6
- package/dist/lib/goo-indicator.js +6 -5
- package/dist/lib/icon-context.d.ts +2 -8
- package/dist/lib/icon-context.js +2 -6
- package/dist/lib/merge-refs.d.ts +10 -0
- package/dist/lib/merge-refs.js +8 -0
- package/dist/lib/morph-layers.d.ts +12 -6
- package/dist/lib/morph-layers.js +7 -6
- package/dist/lib/morph-part.js +3 -3
- package/dist/lib/overlay.d.ts +113 -0
- package/dist/lib/overlay.js +21 -0
- package/dist/lib/popup-rows.d.ts +101 -0
- package/dist/lib/popup-rows.js +25 -0
- package/dist/lib/popup-surface.d.ts +92 -0
- package/dist/lib/popup-surface.js +17 -0
- package/dist/lib/popup.d.ts +17 -1
- package/dist/lib/popup.js +4 -1
- package/dist/lib/rect.d.ts +16 -0
- package/dist/lib/rect.js +12 -0
- package/dist/lib/reduced-motion.js +1 -1
- package/dist/lib/row-group.d.ts +100 -0
- package/dist/lib/row-group.js +12 -0
- package/dist/lib/row-index.d.ts +12 -7
- package/dist/lib/row-index.js +4 -2
- package/dist/lib/scroll-column.d.ts +1 -5
- package/dist/lib/scroll-column.js +13 -12
- package/dist/lib/shape-classes.d.ts +16 -0
- package/dist/lib/shape-classes.js +6 -0
- package/dist/lib/shape-context.d.ts +2 -9
- package/dist/lib/shape-context.js +3 -7
- package/dist/lib/size-context.d.ts +1 -2
- package/dist/lib/size-context.js +2 -7
- package/dist/lib/size-scale.js +1 -1
- package/dist/lib/slot.d.ts +31 -26
- package/dist/lib/slot.js +9 -9
- package/dist/lib/spinner-glyph.d.ts +7 -0
- package/dist/lib/spinner-glyph.js +7 -0
- package/dist/lib/springs.d.ts +5 -1
- package/dist/lib/springs.js +4 -2
- package/dist/lib/surface-classes.js +1 -1
- package/dist/lib/surface-context.d.ts +3 -1
- package/dist/lib/surface-context.js +3 -1
- package/dist/lib/use-autosize-textarea.d.ts +16 -0
- package/dist/lib/use-autosize-textarea.js +7 -0
- package/dist/lib/use-controllable-state.d.ts +15 -1
- package/dist/lib/use-controllable-state.js +1 -1
- package/dist/lib/use-fluid-hover.d.ts +1 -49
- package/dist/lib/use-fluid-hover.js +1 -7
- package/dist/lib/use-is-mobile.js +1 -1
- package/dist/lib/use-iso-layout-effect.d.ts +7 -0
- package/dist/lib/use-iso-layout-effect.js +6 -0
- package/dist/lib/use-keyboard-nav-gate.js +3 -2
- package/dist/lib/use-merge-split.js +7 -6
- package/dist/lib/use-morph.d.ts +13 -7
- package/dist/lib/use-morph.js +4 -3
- package/dist/lib/use-touch-primary.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/weight-label.d.ts +26 -0
- package/dist/lib/weight-label.js +7 -0
- package/dist/preset.d.ts +4 -8
- package/dist/preset.js +8 -8
- package/dist/primitives/code/index.js +8 -8
- package/dist/primitives/craft/index.d.ts +1 -1
- package/dist/primitives/craft/index.js +13 -12
- package/dist/primitives/fluid-hover/index.d.ts +13 -14
- package/dist/primitives/fluid-hover/index.js +13 -10
- package/dist/primitives/morph/index.d.ts +1 -1
- package/dist/primitives/morph/index.js +20 -16
- package/dist/primitives/motion/index.d.ts +2 -0
- package/dist/primitives/motion/index.js +14 -11
- package/dist/primitives/scroll-area/index.d.ts +5 -4
- package/dist/primitives/scroll-area/index.js +5 -5
- package/dist/primitives/separator/index.d.ts +12 -11
- package/dist/primitives/separator/index.js +2 -2
- package/dist/primitives/sizes/index.d.ts +17 -4
- package/dist/primitives/sizes/index.js +7 -4
- package/dist/primitives/skeleton/index.d.ts +8 -8
- package/dist/primitives/skeleton/index.js +7 -6
- package/dist/primitives/surface/index.d.ts +12 -25
- package/dist/primitives/surface/index.js +8 -6
- package/dist/shared/{components-yxmxn2jp.js → components-07g2gbjy.js} +30 -75
- package/dist/shared/components-099sdasz.js +552 -0
- package/dist/shared/{components-bsqynhaj.js → components-0h3f5jae.js} +49 -51
- package/dist/shared/{components-wbbckbw8.js → components-0mrhj88d.js} +13 -12
- package/dist/shared/{components-0h78g3b5.js → components-0p2na0cp.js} +19 -47
- package/dist/shared/components-1a7cr7vh.js +40 -0
- package/dist/shared/components-1axxc3tk.js +334 -0
- package/dist/shared/components-1hc3xv0y.js +381 -0
- package/dist/shared/{components-gyt7my41.js → components-1jxw899c.js} +94 -84
- package/dist/shared/{components-jqpefjsn.js → components-1nv9q3s8.js} +24 -44
- package/dist/shared/components-1p3k62x2.js +137 -0
- package/dist/shared/{components-kz5q11pp.js → components-2xmke84n.js} +12 -4
- package/dist/shared/{components-c7rwx0ap.js → components-346ged8v.js} +24 -3
- package/dist/shared/{components-4j3t39dd.js → components-34brwmgp.js} +12 -11
- package/dist/shared/components-38wa9nx5.js +19 -0
- package/dist/shared/components-3hgk57s0.js +27 -0
- package/dist/shared/{components-px2zm7dc.js → components-3js2vgds.js} +13 -6
- package/dist/shared/{components-ctqmge8t.js → components-3m4rqrqm.js} +10 -3
- package/dist/shared/{components-3ey0hzpb.js → components-45r18egt.js} +11 -1
- package/dist/shared/components-50rh4ggz.js +54 -0
- package/dist/shared/components-5atrr490.js +99 -0
- package/dist/shared/components-5f3tq4qb.js +70 -0
- package/dist/shared/{components-dc5q749x.js → components-5vyaexsj.js} +16 -17
- package/dist/shared/{components-pwayrkw9.js → components-5ynncdpn.js} +5 -4
- package/dist/shared/{components-1e64t8aj.js → components-62mg6pab.js} +232 -93
- package/dist/shared/{components-drxrtnp2.js → components-6f5pyzb2.js} +8 -0
- package/dist/shared/{components-868v7scv.js → components-6xfhc5qm.js} +104 -169
- package/dist/shared/{components-yhgq0qxx.js → components-7c4a0egq.js} +20 -12
- package/dist/shared/components-7fqnqbh0.js +79 -0
- package/dist/shared/components-7fsy0jxg.js +443 -0
- package/dist/shared/{components-p0fm0bab.js → components-7t3pz7v7.js} +496 -526
- package/dist/shared/components-85epgxwf.js +620 -0
- package/dist/shared/{components-wknae3m4.js → components-86vvx0c8.js} +75 -121
- package/dist/shared/{components-wgtjt2af.js → components-88ktjdg0.js} +30 -27
- package/dist/shared/{components-ft3zdc79.js → components-88r046aa.js} +6 -6
- package/dist/shared/{components-xd3emmy4.js → components-8hfrd2fk.js} +1462 -1464
- package/dist/shared/components-8sazy704.js +146 -0
- package/dist/shared/{components-rrbpmfx4.js → components-8wp8d8q1.js} +8 -0
- package/dist/shared/{components-rtadhd9j.js → components-9ybenn5v.js} +16 -16
- package/dist/shared/components-amsc86fb.js +293 -0
- package/dist/shared/{components-9as3rf68.js → components-az04rmng.js} +12 -6
- package/dist/shared/components-bdkm2jzy.js +34 -0
- package/dist/shared/{components-xjkdvnbg.js → components-be3wggg1.js} +54 -48
- package/dist/shared/components-bkwjvvkh.js +18 -0
- package/dist/shared/{components-vf45j12c.js → components-ceyn28cf.js} +7 -0
- package/dist/shared/{components-3h92d94m.js → components-cy5z8zxy.js} +1 -2
- package/dist/shared/components-dm86y7b3.js +105 -0
- package/dist/shared/{components-c9yr4ed1.js → components-ejn6tvbw.js} +8 -6
- package/dist/shared/{components-34txk9rj.js → components-ew4wq7mj.js} +7 -0
- package/dist/shared/{components-svkt577j.js → components-f75y4gn8.js} +53 -70
- package/dist/shared/components-f9adtfq8.js +34 -0
- package/dist/shared/{components-2a7hcand.js → components-gbsdhmrv.js} +48 -83
- package/dist/shared/{components-9sttq78t.js → components-gc5zky2w.js} +54 -59
- package/dist/shared/{components-bae8sbjx.js → components-gkdx1787.js} +12 -6
- package/dist/shared/{components-124epb7f.js → components-grxgqa75.js} +3 -7
- package/dist/shared/components-gw0wd7gd.js +986 -0
- package/dist/shared/components-j4z3rtw2.js +179 -0
- package/dist/shared/{components-t5pk5nmc.js → components-j8tcbm8y.js} +927 -953
- package/dist/shared/components-jm91mjm1.js +297 -0
- package/dist/shared/{components-b94t6qtj.js → components-jtfptckj.js} +44 -39
- package/dist/shared/components-jx9qb4z8.js +63 -0
- package/dist/shared/components-k785rge6.js +336 -0
- package/dist/shared/{components-r8eqs7gz.js → components-k81x1aea.js} +10 -6
- package/dist/shared/{components-qx27excf.js → components-kn5c7652.js} +11 -13
- package/dist/shared/components-mse06t0x.js +31 -0
- package/dist/shared/{components-cet3jpa0.js → components-n7e31ct4.js} +71 -49
- package/dist/shared/components-nskr4hwg.js +1008 -0
- package/dist/shared/components-nv5m3gcv.js +37 -0
- package/dist/shared/components-nwa2a9tq.js +27 -0
- package/dist/shared/{components-f7h57m6t.js → components-p0x8ren6.js} +3 -1
- package/dist/shared/{components-2krsc300.js → components-p0z99d5b.js} +67 -92
- package/dist/shared/{components-b1e239g3.js → components-pa43g2r2.js} +15 -4
- package/dist/shared/{components-m06yq8wk.js → components-pedbt2dc.js} +35 -49
- package/dist/shared/components-pva1wj1r.js +27 -0
- package/dist/shared/components-q4wyd06h.js +382 -0
- package/dist/shared/{components-71nbt03m.js → components-qrpdtvxa.js} +12 -45
- package/dist/shared/components-r33dxr5j.js +91 -0
- package/dist/shared/{components-005jt2nz.js → components-re8p99fj.js} +53 -179
- package/dist/shared/components-s217vq1n.js +35 -0
- package/dist/shared/{components-vc864c51.js → components-sesrjvcc.js} +7 -6
- package/dist/shared/{components-qh1cvj6p.js → components-skn189mp.js} +29 -36
- package/dist/shared/{components-tz4gaf1v.js → components-tcyz2tdn.js} +9 -1
- package/dist/shared/components-tjxy84s9.js +53 -0
- package/dist/shared/components-tnj6mkhg.js +89 -0
- package/dist/shared/{components-de99ykt7.js → components-tz0axc0f.js} +1 -0
- package/dist/shared/components-v2j3jx89.js +7 -0
- package/dist/shared/components-vcte8p75.js +71 -0
- package/dist/shared/{components-c74gf16d.js → components-vgzerqt0.js} +34 -47
- package/dist/shared/components-vp6vzsee.js +30 -0
- package/dist/shared/components-vpkh6j83.js +42 -0
- package/dist/shared/{components-4nck8acq.js → components-wgd1nebp.js} +21 -14
- package/dist/shared/{components-pt5ftm4p.js → components-wrbw67f6.js} +10 -3
- package/dist/shared/{components-tz1fv35x.js → components-wwd093xg.js} +1 -0
- package/dist/shared/components-wyfmhtw9.js +61 -0
- package/dist/shared/{components-d3shbwqq.js → components-xpw8dzb0.js} +16 -23
- package/dist/shared/{components-mattt5jp.js → components-xzcgr3gy.js} +62 -60
- package/dist/shared/{components-jcnjay5g.js → components-ycx2kxeq.js} +9 -1
- package/dist/shared/components-zbzx62pg.js +1771 -0
- package/dist/shared/{components-dtca4s6b.js → components-zf0nnvvg.js} +67 -147
- package/dist/shared/{components-h83az0bz.js → components-znspksk0.js} +9 -1
- package/dist/shared/components-zpatc9x3.js +78 -0
- package/dist/styles.css +218 -235
- package/dist/tailwind.css +20 -8
- package/dist/tokens.css +53 -68
- package/index.ts +16 -2
- package/lib/date-locale.ts +12 -149
- package/lib/date-mask.ts +146 -0
- package/lib/field-box.ts +117 -0
- package/lib/field-classes.ts +85 -100
- package/lib/fluid-hover-highlight.tsx +12 -57
- package/lib/focus-ring.tsx +25 -22
- package/lib/goo-indicator.tsx +2 -0
- package/lib/icon-context.tsx +23 -75
- package/lib/merge-refs.ts +29 -0
- package/lib/morph-layers.tsx +3 -1
- package/lib/morph-part.tsx +5 -3
- package/lib/overlay.tsx +118 -0
- package/lib/popup-rows.tsx +149 -0
- package/lib/popup-surface.tsx +52 -0
- package/lib/popup.ts +10 -9
- package/lib/rect.ts +48 -0
- package/lib/reduced-motion.ts +2 -0
- package/lib/row-group.tsx +113 -0
- package/lib/row-index.tsx +27 -10
- package/lib/scroll-column.tsx +26 -53
- package/lib/shape-classes.ts +56 -0
- package/lib/shape-context.tsx +10 -79
- package/lib/size-context.tsx +8 -21
- package/lib/size-scale.ts +3 -9
- package/lib/slot.tsx +124 -0
- package/lib/spinner-glyph.tsx +27 -0
- package/lib/springs.ts +8 -9
- package/lib/surface-classes.ts +3 -8
- package/lib/surface-context.tsx +10 -5
- package/lib/use-autosize-textarea.ts +64 -0
- package/lib/use-controllable-state.ts +30 -15
- package/lib/use-fluid-hover.ts +9 -11
- package/lib/use-is-mobile.ts +5 -5
- package/lib/use-iso-layout-effect.ts +14 -0
- package/lib/use-keyboard-nav-gate.ts +5 -6
- package/lib/use-merge-split.tsx +5 -15
- package/lib/use-morph.ts +34 -76
- package/lib/use-touch-primary.tsx +5 -5
- package/lib/utils.ts +4 -11
- package/lib/weight-label.tsx +69 -0
- package/package.json +57 -194
- package/primitives/code/index.tsx +4 -2
- package/primitives/craft/demos.tsx +4 -2
- package/primitives/craft/examples.mdx +32 -34
- package/primitives/craft/index.tsx +3 -0
- package/primitives/fluid-hover/examples.mdx +1 -1
- package/primitives/fluid-hover/index.tsx +33 -68
- package/primitives/morph/examples.mdx +16 -19
- package/primitives/morph/index.tsx +5 -3
- package/primitives/motion/examples.mdx +3 -3
- package/primitives/motion/index.tsx +6 -22
- package/primitives/scroll-area/examples.mdx +4 -4
- package/primitives/scroll-area/index.tsx +16 -41
- package/primitives/separator/examples.mdx +2 -2
- package/primitives/separator/index.tsx +15 -14
- package/primitives/sizes/examples.mdx +1 -1
- package/primitives/sizes/index.tsx +28 -42
- package/primitives/skeleton/examples.mdx +6 -6
- package/primitives/skeleton/index.tsx +24 -10
- package/primitives/skeleton/skeleton.css +8 -3
- package/primitives/surface/examples.mdx +11 -11
- package/primitives/surface/index.tsx +15 -40
- package/primitives/surface/surface.css +1 -1
- package/DESIGN.md +0 -623
- package/components/inputs/select/variants.ts +0 -32
- package/components/navigation/sidebar/sidebar-core.tsx +0 -1408
- package/components/navigation/sidebar/sidebar-menu.tsx +0 -1495
- package/components/navigation/sidebar/variants.ts +0 -55
- package/components/navigation/tabs-subtle/examples.mdx +0 -49
- package/components/navigation/tabs-subtle/index.tsx +0 -512
- package/components/overlays/dropdown/menu-parts.tsx +0 -725
- package/components/overlays/toast/global-demo.tsx +0 -72
- package/dist/components/inputs/color-picker/variants.d.ts +0 -61
- package/dist/components/inputs/color-picker/variants.js +0 -28
- package/dist/components/inputs/select/variants.d.ts +0 -5
- package/dist/components/inputs/select/variants.js +0 -6
- package/dist/components/navigation/sidebar/variants.d.ts +0 -25
- package/dist/components/navigation/sidebar/variants.js +0 -28
- package/dist/components/navigation/tabs-subtle/index.d.ts +0 -73
- package/dist/components/navigation/tabs-subtle/index.js +0 -24
- package/dist/docs/index.d.ts +0 -83
- package/dist/docs/index.js +0 -288
- package/dist/docs/vite.d.ts +0 -31
- package/dist/docs/vite.js +0 -45
- package/dist/lib/field-variants.d.ts +0 -47
- package/dist/lib/field-variants.js +0 -26
- package/dist/lib/inert.d.ts +0 -9
- package/dist/lib/inert.js +0 -8
- package/dist/lib/row-order.d.ts +0 -28
- package/dist/lib/row-order.js +0 -10
- package/dist/lib/shape-radius.d.ts +0 -19
- package/dist/lib/shape-radius.js +0 -6
- package/dist/shared/components-01w9qcfa.js +0 -277
- package/dist/shared/components-26snnbs9.js +0 -322
- package/dist/shared/components-2qbqqpgq.js +0 -1545
- package/dist/shared/components-303jf96s.js +0 -1478
- package/dist/shared/components-4vfm04wq.js +0 -82
- package/dist/shared/components-54nq988h.js +0 -123
- package/dist/shared/components-7qx17na9.js +0 -300
- package/dist/shared/components-7s7pykk5.js +0 -281
- package/dist/shared/components-8jrk5eye.js +0 -448
- package/dist/shared/components-91zw3d9f.js +0 -136
- package/dist/shared/components-9jmjnkqd.js +0 -503
- package/dist/shared/components-adkarj8n.js +0 -35
- package/dist/shared/components-c5w5zk0s.js +0 -218
- package/dist/shared/components-cnead5qm.js +0 -185
- package/dist/shared/components-czdvj1a8.js +0 -266
- package/dist/shared/components-dcc02hs2.js +0 -31
- package/dist/shared/components-dhgk6mbt.js +0 -16
- package/dist/shared/components-g3eafs70.js +0 -337
- package/dist/shared/components-gx4h5rbb.js +0 -40
- package/dist/shared/components-h6p86be3.js +0 -19
- package/dist/shared/components-hdzrqqpx.js +0 -55
- package/dist/shared/components-hgv6tygd.js +0 -986
- package/dist/shared/components-krtx3m5b.js +0 -84
- package/dist/shared/components-kswxnm3h.js +0 -24
- package/dist/shared/components-mhza2wdn.js +0 -482
- package/dist/shared/components-mrbaxt8q.js +0 -62
- package/dist/shared/components-pv1dyrtn.js +0 -678
- package/dist/shared/components-s8yqk2dc.js +0 -124
- package/dist/shared/components-syynwm1r.js +0 -114
- package/dist/shared/components-tv7b8tet.js +0 -271
- package/dist/shared/components-w2jqa6hx.js +0 -404
- package/dist/shared/components-xdqmt6ed.js +0 -20
- package/dist/shared/components-y0kfy2g4.js +0 -578
- package/dist/shared/components-z3v0n0de.js +0 -11
- package/dist/shared/components-z8fedth5.js +0 -305
- package/dist/shared/components-zkk3fmw8.js +0 -150
- package/dist/tokens/colors.css +0 -230
- package/dist/tokens/motion.css +0 -40
- package/dist/tokens/radius.css +0 -10
- package/dist/tokens/spacing.css +0 -9
- package/dist/tokens/typography.css +0 -119
- package/docs/chrome.css +0 -120
- package/docs/chrome.tsx +0 -283
- package/docs/index.ts +0 -9
- package/docs/vite.ts +0 -85
- package/lib/field-variants.ts +0 -117
- package/lib/inert.ts +0 -22
- package/lib/row-order.tsx +0 -126
- package/lib/shape-radius.ts +0 -67
- package/lib/slot.ts +0 -115
- package/preset.ts +0 -199
|
@@ -1,1545 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
spring2
|
|
4
|
-
} from "./components-3ey0hzpb.js";
|
|
5
|
-
import {
|
|
6
|
-
opensInPlace2,
|
|
7
|
-
inPlaceOffset2,
|
|
8
|
-
useMorphOrigin2,
|
|
9
|
-
useMorph2
|
|
10
|
-
} from "./components-m06yq8wk.js";
|
|
11
|
-
import {
|
|
12
|
-
cn2
|
|
13
|
-
} from "./components-jcnjay5g.js";
|
|
14
|
-
import {
|
|
15
|
-
FluidHoverHighlight2
|
|
16
|
-
} from "./components-dc5q749x.js";
|
|
17
|
-
import {
|
|
18
|
-
shapeMap2
|
|
19
|
-
} from "./components-71nbt03m.js";
|
|
20
|
-
import {
|
|
21
|
-
FocusRing2
|
|
22
|
-
} from "./components-wbbckbw8.js";
|
|
23
|
-
import {
|
|
24
|
-
MorphSurface2
|
|
25
|
-
} from "./components-c7rwx0ap.js";
|
|
26
|
-
import {
|
|
27
|
-
popupScrollAreaClass2,
|
|
28
|
-
popupViewportClass2,
|
|
29
|
-
isDisabledRow2
|
|
30
|
-
} from "./components-h6p86be3.js";
|
|
31
|
-
import {
|
|
32
|
-
RowOrderContext2,
|
|
33
|
-
useRowOrder2,
|
|
34
|
-
useRowSlot2
|
|
35
|
-
} from "./components-krtx3m5b.js";
|
|
36
|
-
import {
|
|
37
|
-
useSize2
|
|
38
|
-
} from "./components-h83az0bz.js";
|
|
39
|
-
import {
|
|
40
|
-
slotRender2,
|
|
41
|
-
slotId2
|
|
42
|
-
} from "./components-mrbaxt8q.js";
|
|
43
|
-
import {
|
|
44
|
-
SURFACE_BG2,
|
|
45
|
-
SURFACE_SHADOW2
|
|
46
|
-
} from "./components-vf45j12c.js";
|
|
47
|
-
import {
|
|
48
|
-
useSurface2,
|
|
49
|
-
SurfaceProvider2
|
|
50
|
-
} from "./components-dhgk6mbt.js";
|
|
51
|
-
import {
|
|
52
|
-
useControllableState2
|
|
53
|
-
} from "./components-tz1fv35x.js";
|
|
54
|
-
import {
|
|
55
|
-
useFluidHover2,
|
|
56
|
-
useRegisterFluidHoverItem2
|
|
57
|
-
} from "./components-yhgq0qxx.js";
|
|
58
|
-
import {
|
|
59
|
-
useSelectionRuns2,
|
|
60
|
-
useMergeSplitBlocks2,
|
|
61
|
-
SelectionBackgrounds2
|
|
62
|
-
} from "./components-kz5q11pp.js";
|
|
63
|
-
import {
|
|
64
|
-
ScrollArea2
|
|
65
|
-
} from "./components-ctqmge8t.js";
|
|
66
|
-
import {
|
|
67
|
-
SizeProvider2
|
|
68
|
-
} from "./components-dcc02hs2.js";
|
|
69
|
-
import {
|
|
70
|
-
Elevated2
|
|
71
|
-
} from "./components-9as3rf68.js";
|
|
72
|
-
import {
|
|
73
|
-
useIcon2
|
|
74
|
-
} from "./components-jqpefjsn.js";
|
|
75
|
-
import {
|
|
76
|
-
useKeyboardNavGate2
|
|
77
|
-
} from "./components-tz4gaf1v.js";
|
|
78
|
-
|
|
79
|
-
// components/overlays/dropdown/index.tsx
|
|
80
|
-
import { Menu as BaseMenu } from "@base-ui/react/menu";
|
|
81
|
-
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
82
|
-
import {
|
|
83
|
-
Children,
|
|
84
|
-
cloneElement,
|
|
85
|
-
createContext as createContext4,
|
|
86
|
-
forwardRef as forwardRef4,
|
|
87
|
-
isValidElement,
|
|
88
|
-
useCallback as useCallback3,
|
|
89
|
-
useContext as useContext4,
|
|
90
|
-
useEffect as useEffect4,
|
|
91
|
-
useImperativeHandle as useImperativeHandle2,
|
|
92
|
-
useMemo as useMemo3,
|
|
93
|
-
useRef as useRef4,
|
|
94
|
-
useState as useState3
|
|
95
|
-
} from "react";
|
|
96
|
-
|
|
97
|
-
// components/overlays/dropdown/dropdown-search.tsx
|
|
98
|
-
import {
|
|
99
|
-
createContext,
|
|
100
|
-
forwardRef,
|
|
101
|
-
useCallback,
|
|
102
|
-
useContext,
|
|
103
|
-
useEffect,
|
|
104
|
-
useMemo,
|
|
105
|
-
useRef,
|
|
106
|
-
useState
|
|
107
|
-
} from "react";
|
|
108
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
109
|
-
var DropdownSearchHostContext = createContext(null);
|
|
110
|
-
var DropdownFilterContext = createContext(null);
|
|
111
|
-
var ROW_SELECTOR = [
|
|
112
|
-
'[role="menuitem"]:not([aria-disabled="true"])',
|
|
113
|
-
'[role="menuitemradio"]:not([aria-disabled="true"])',
|
|
114
|
-
'[role="menuitemcheckbox"]:not([aria-disabled="true"])'
|
|
115
|
-
].join(", ");
|
|
116
|
-
function menuRows(from) {
|
|
117
|
-
const menu = from?.closest('[role="menu"]');
|
|
118
|
-
return menu ? Array.from(menu.querySelectorAll(ROW_SELECTOR)) : [];
|
|
119
|
-
}
|
|
120
|
-
function useDropdownSearchHost(open, { containerRef, setActiveIndex }) {
|
|
121
|
-
const handleRef = useRef(null);
|
|
122
|
-
const [searchMounted, setSearchMounted] = useState(false);
|
|
123
|
-
const register = useCallback((handle) => {
|
|
124
|
-
handleRef.current = handle;
|
|
125
|
-
setSearchMounted(true);
|
|
126
|
-
return () => {
|
|
127
|
-
if (handleRef.current === handle) {
|
|
128
|
-
handleRef.current = null;
|
|
129
|
-
setSearchMounted(false);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}, []);
|
|
133
|
-
const highlightFirst = useCallback(() => {
|
|
134
|
-
const first = containerRef.current?.querySelector(ROW_SELECTOR);
|
|
135
|
-
const index = first?.getAttribute("data-fluid-hover-index");
|
|
136
|
-
setActiveIndex(index != null ? Number(index) : null);
|
|
137
|
-
}, [containerRef, setActiveIndex]);
|
|
138
|
-
const isSearchField = useCallback((target) => target !== null && target === handleRef.current?.input, []);
|
|
139
|
-
const host = useMemo(() => ({ register, open, highlightFirst }), [register, open, highlightFirst]);
|
|
140
|
-
const onKeyDownCapture = useCallback((e) => {
|
|
141
|
-
const handle = handleRef.current;
|
|
142
|
-
if (!handle?.input)
|
|
143
|
-
return;
|
|
144
|
-
if (e.target === handle.input)
|
|
145
|
-
return;
|
|
146
|
-
if (e.metaKey || e.ctrlKey || e.altKey)
|
|
147
|
-
return;
|
|
148
|
-
if (e.key.length === 1 && e.key !== " ") {
|
|
149
|
-
e.preventDefault();
|
|
150
|
-
e.stopPropagation();
|
|
151
|
-
handle.input.focus();
|
|
152
|
-
handle.append(e.key);
|
|
153
|
-
} else if (e.key === "Backspace") {
|
|
154
|
-
e.preventDefault();
|
|
155
|
-
e.stopPropagation();
|
|
156
|
-
handle.input.focus();
|
|
157
|
-
handle.deleteBackward();
|
|
158
|
-
}
|
|
159
|
-
}, []);
|
|
160
|
-
const hasSearch = useCallback(() => handleRef.current !== null, []);
|
|
161
|
-
return {
|
|
162
|
-
host,
|
|
163
|
-
hasSearch,
|
|
164
|
-
searchMounted,
|
|
165
|
-
onKeyDownCapture,
|
|
166
|
-
isSearchField,
|
|
167
|
-
highlightFirst
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
var DropdownSearch2 = forwardRef(({
|
|
171
|
-
value,
|
|
172
|
-
onValueChange,
|
|
173
|
-
filter = false,
|
|
174
|
-
placeholder = "Search…",
|
|
175
|
-
clearOnClose = true,
|
|
176
|
-
autoFocus = true,
|
|
177
|
-
className,
|
|
178
|
-
onKeyDown,
|
|
179
|
-
...props
|
|
180
|
-
}, ref) => {
|
|
181
|
-
const SearchIcon = useIcon2("search");
|
|
182
|
-
const sizeClasses = useSize2();
|
|
183
|
-
const compact = sizeClasses.variant === "compact";
|
|
184
|
-
const host = useContext(DropdownSearchHostContext);
|
|
185
|
-
const open = host?.open ?? true;
|
|
186
|
-
const panel = useContext(DropdownFilterContext);
|
|
187
|
-
const managed = filter ? panel : null;
|
|
188
|
-
const query = managed ? managed.query : value ?? "";
|
|
189
|
-
const setQuery = useCallback((next) => {
|
|
190
|
-
managed?.setQuery(next);
|
|
191
|
-
onValueChange?.(next);
|
|
192
|
-
}, [managed, onValueChange]);
|
|
193
|
-
const surface = useSurface2();
|
|
194
|
-
const inputRef = useRef(null);
|
|
195
|
-
const valueRef = useRef(query);
|
|
196
|
-
valueRef.current = query;
|
|
197
|
-
const onValueChangeRef = useRef(setQuery);
|
|
198
|
-
onValueChangeRef.current = setQuery;
|
|
199
|
-
const clearOnCloseRef = useRef(clearOnClose);
|
|
200
|
-
clearOnCloseRef.current = clearOnClose;
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
if (!host)
|
|
203
|
-
return;
|
|
204
|
-
return host.register({
|
|
205
|
-
get input() {
|
|
206
|
-
return inputRef.current;
|
|
207
|
-
},
|
|
208
|
-
append: (text) => onValueChangeRef.current(valueRef.current + text),
|
|
209
|
-
deleteBackward: () => onValueChangeRef.current(valueRef.current.slice(0, -1))
|
|
210
|
-
});
|
|
211
|
-
}, [host]);
|
|
212
|
-
useEffect(() => {
|
|
213
|
-
if (!open)
|
|
214
|
-
return;
|
|
215
|
-
if (clearOnCloseRef.current && valueRef.current !== "") {
|
|
216
|
-
onValueChangeRef.current("");
|
|
217
|
-
}
|
|
218
|
-
if (!autoFocus)
|
|
219
|
-
return;
|
|
220
|
-
let inner;
|
|
221
|
-
const outer = requestAnimationFrame(() => {
|
|
222
|
-
inner = requestAnimationFrame(() => inputRef.current?.focus());
|
|
223
|
-
});
|
|
224
|
-
return () => {
|
|
225
|
-
cancelAnimationFrame(outer);
|
|
226
|
-
if (inner !== undefined)
|
|
227
|
-
cancelAnimationFrame(inner);
|
|
228
|
-
};
|
|
229
|
-
}, [open, autoFocus]);
|
|
230
|
-
useEffect(() => {
|
|
231
|
-
if (!host || document.activeElement !== inputRef.current)
|
|
232
|
-
return;
|
|
233
|
-
host.highlightFirst();
|
|
234
|
-
}, [host, query]);
|
|
235
|
-
useEffect(() => () => {
|
|
236
|
-
if (clearOnCloseRef.current && valueRef.current !== "") {
|
|
237
|
-
onValueChangeRef.current("");
|
|
238
|
-
}
|
|
239
|
-
}, []);
|
|
240
|
-
const handleKeyDown = (e) => {
|
|
241
|
-
onKeyDown?.(e);
|
|
242
|
-
if (e.defaultPrevented)
|
|
243
|
-
return;
|
|
244
|
-
if (e.key === "Escape" || e.key === "Tab")
|
|
245
|
-
return;
|
|
246
|
-
e.stopPropagation();
|
|
247
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
248
|
-
const rows = menuRows(e.currentTarget);
|
|
249
|
-
if (rows.length === 0)
|
|
250
|
-
return;
|
|
251
|
-
e.preventDefault();
|
|
252
|
-
(e.key === "ArrowDown" ? rows[0] : rows[rows.length - 1])?.focus();
|
|
253
|
-
} else if (e.key === "Enter") {
|
|
254
|
-
e.preventDefault();
|
|
255
|
-
menuRows(e.currentTarget)[0]?.click();
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
259
|
-
className: cn2("group/search sticky top-0 z-20 -mx-1 -mt-1 mb-0.5 flex shrink-0 items-center border-b border-border/60", SURFACE_BG2[surface], sizeClasses.control, sizeClasses.gap, compact ? "px-2.5" : "px-3", className),
|
|
260
|
-
children: [
|
|
261
|
-
/* @__PURE__ */ jsx(SearchIcon, {
|
|
262
|
-
size: sizeClasses.icon,
|
|
263
|
-
strokeWidth: 1.5,
|
|
264
|
-
className: "shrink-0 text-muted-foreground transition-[color,stroke-width] duration-fast group-focus-within/search:text-foreground group-focus-within/search:stroke-[2]"
|
|
265
|
-
}),
|
|
266
|
-
/* @__PURE__ */ jsx("input", {
|
|
267
|
-
ref: (node) => {
|
|
268
|
-
inputRef.current = node;
|
|
269
|
-
if (typeof ref === "function")
|
|
270
|
-
ref(node);
|
|
271
|
-
else if (ref)
|
|
272
|
-
ref.current = node;
|
|
273
|
-
},
|
|
274
|
-
type: "text",
|
|
275
|
-
role: "searchbox",
|
|
276
|
-
autoComplete: "off",
|
|
277
|
-
autoCorrect: "off",
|
|
278
|
-
spellCheck: false,
|
|
279
|
-
value: query,
|
|
280
|
-
onChange: (e) => setQuery(e.target.value),
|
|
281
|
-
onKeyDown: handleKeyDown,
|
|
282
|
-
placeholder,
|
|
283
|
-
className: cn2("min-w-0 flex-1 rounded-none bg-transparent text-foreground placeholder:text-muted-foreground outline-none font-[inherit]", sizeClasses.text, compact ? "leading-5" : "leading-6"),
|
|
284
|
-
...props
|
|
285
|
-
})
|
|
286
|
-
]
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
DropdownSearch2.displayName = "DropdownSearch";
|
|
290
|
-
var DropdownEmpty2 = forwardRef(({ className, ...props }, ref) => {
|
|
291
|
-
const sizeClasses = useSize2();
|
|
292
|
-
return /* @__PURE__ */ jsx("div", {
|
|
293
|
-
ref,
|
|
294
|
-
role: "status",
|
|
295
|
-
"aria-live": "polite",
|
|
296
|
-
className: cn2("px-2 py-6 text-center text-muted-foreground", sizeClasses.text, className),
|
|
297
|
-
...props
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
DropdownEmpty2.displayName = "DropdownEmpty";
|
|
301
|
-
|
|
302
|
-
// components/overlays/dropdown/menu-item.tsx
|
|
303
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
304
|
-
import {
|
|
305
|
-
createContext as createContext2,
|
|
306
|
-
createElement,
|
|
307
|
-
forwardRef as forwardRef2,
|
|
308
|
-
useContext as useContext2,
|
|
309
|
-
useEffect as useEffect2,
|
|
310
|
-
useRef as useRef2,
|
|
311
|
-
version
|
|
312
|
-
} from "react";
|
|
313
|
-
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
314
|
-
var shape = shapeMap2.rounded;
|
|
315
|
-
var REACT_19 = parseInt(version, 10) >= 19;
|
|
316
|
-
function elementRef(element) {
|
|
317
|
-
if (REACT_19)
|
|
318
|
-
return element.props.ref;
|
|
319
|
-
return element.ref;
|
|
320
|
-
}
|
|
321
|
-
var DropdownContext = createContext2(null);
|
|
322
|
-
function useDropdown2() {
|
|
323
|
-
const ctx = useContext2(DropdownContext);
|
|
324
|
-
if (!ctx)
|
|
325
|
-
throw new Error("useDropdown must be used within a Dropdown");
|
|
326
|
-
return ctx;
|
|
327
|
-
}
|
|
328
|
-
function useDropdownMaybe2() {
|
|
329
|
-
return useContext2(DropdownContext);
|
|
330
|
-
}
|
|
331
|
-
var INSET_PX = { default: "pl-8 pr-2", compact: "pl-6 pr-1.5" };
|
|
332
|
-
var FREEFORM_SVG = {
|
|
333
|
-
default: "[&>svg]:size-4 [&>svg]:shrink-0",
|
|
334
|
-
compact: "[&>svg]:size-3.5 [&>svg]:shrink-0"
|
|
335
|
-
};
|
|
336
|
-
var DropdownShortcut2 = forwardRef2(({ className, ...props }, ref) => {
|
|
337
|
-
const compact = useSize2().variant === "compact";
|
|
338
|
-
return /* @__PURE__ */ jsx2("kbd", {
|
|
339
|
-
ref,
|
|
340
|
-
className: cn2("ml-auto shrink-0 pl-4 font-sans text-muted-foreground", compact ? "text-caption-compact" : "text-caption", className),
|
|
341
|
-
...props
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
DropdownShortcut2.displayName = "DropdownShortcut";
|
|
345
|
-
var MenuItem2 = forwardRef2(({
|
|
346
|
-
icon: Icon,
|
|
347
|
-
label,
|
|
348
|
-
textValue,
|
|
349
|
-
render,
|
|
350
|
-
asChild,
|
|
351
|
-
index: indexProp,
|
|
352
|
-
children: childrenProp,
|
|
353
|
-
checked,
|
|
354
|
-
onSelect,
|
|
355
|
-
disabled,
|
|
356
|
-
closeOnClick,
|
|
357
|
-
inset,
|
|
358
|
-
shortcut,
|
|
359
|
-
sourceIndex,
|
|
360
|
-
kind,
|
|
361
|
-
value,
|
|
362
|
-
pinned,
|
|
363
|
-
className,
|
|
364
|
-
onClick,
|
|
365
|
-
...props
|
|
366
|
-
}, ref) => {
|
|
367
|
-
const internalRef = useRef2(null);
|
|
368
|
-
const slot = slotRender2(render, asChild, childrenProp);
|
|
369
|
-
const children = slot ? slot.props.children : childrenProp;
|
|
370
|
-
const hasMounted = useRef2(false);
|
|
371
|
-
const {
|
|
372
|
-
registerItem,
|
|
373
|
-
activeIndex,
|
|
374
|
-
checkedIndex,
|
|
375
|
-
multiple,
|
|
376
|
-
checkedIndices,
|
|
377
|
-
renderMenuItem,
|
|
378
|
-
selfManaged,
|
|
379
|
-
toggleIndex,
|
|
380
|
-
reportChecked,
|
|
381
|
-
pin
|
|
382
|
-
} = useDropdown2();
|
|
383
|
-
const { index, firstRow } = useRowSlot2(internalRef, indexProp);
|
|
384
|
-
const authored = indexProp !== undefined;
|
|
385
|
-
const panelChecked = multiple ? checkedIndices?.includes(indexProp ?? -1) ?? false : checkedIndex === indexProp;
|
|
386
|
-
const isChecked = checked ?? (selfManaged && authored ? panelChecked : undefined);
|
|
387
|
-
const isCheckbox = kind ? kind === "checkbox" : !!multiple && typeof isChecked === "boolean";
|
|
388
|
-
const isRadio = kind ? kind === "radio" : !isCheckbox && typeof isChecked === "boolean";
|
|
389
|
-
useRegisterFluidHoverItem2(registerItem, index, internalRef);
|
|
390
|
-
useEffect2(() => {
|
|
391
|
-
if (!kind || !isChecked || index === undefined || !reportChecked)
|
|
392
|
-
return;
|
|
393
|
-
reportChecked(index, true);
|
|
394
|
-
return () => reportChecked(index, false);
|
|
395
|
-
}, [kind, isChecked, index, reportChecked]);
|
|
396
|
-
useEffect2(() => {
|
|
397
|
-
if (!pinned || index === undefined || !pin)
|
|
398
|
-
return;
|
|
399
|
-
pin(index, true);
|
|
400
|
-
return () => pin(index, false);
|
|
401
|
-
}, [pinned, index, pin]);
|
|
402
|
-
useEffect2(() => {
|
|
403
|
-
hasMounted.current = true;
|
|
404
|
-
}, []);
|
|
405
|
-
const isActive = index !== undefined && activeIndex === index;
|
|
406
|
-
const skipAnimation = !hasMounted.current;
|
|
407
|
-
const sizeClasses = useSize2();
|
|
408
|
-
const text = label ?? (typeof children === "string" ? children : undefined);
|
|
409
|
-
const freeform = label === undefined && text === undefined;
|
|
410
|
-
const lit = isActive || isChecked;
|
|
411
|
-
const slotRef = slot ? elementRef(slot) : undefined;
|
|
412
|
-
const mergeRef = (node) => {
|
|
413
|
-
internalRef.current = node;
|
|
414
|
-
for (const target of [ref, slotRef]) {
|
|
415
|
-
if (typeof target === "function")
|
|
416
|
-
target(node);
|
|
417
|
-
else if (target)
|
|
418
|
-
target.current = node;
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
const rowElement = (extra) => {
|
|
422
|
-
const rowProps = {
|
|
423
|
-
ref: mergeRef,
|
|
424
|
-
"data-fluid-hover-index": index,
|
|
425
|
-
...label !== undefined && { "aria-label": label },
|
|
426
|
-
...extra,
|
|
427
|
-
...props
|
|
428
|
-
};
|
|
429
|
-
if (!slot)
|
|
430
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
431
|
-
...rowProps,
|
|
432
|
-
className: itemClassName
|
|
433
|
-
});
|
|
434
|
-
const { children: _content, ...slotProps } = slot.props;
|
|
435
|
-
return createElement(slot.type, { ...slotProps, ...rowProps, className: cn2(slotProps.className, itemClassName) });
|
|
436
|
-
};
|
|
437
|
-
const activate = () => {
|
|
438
|
-
const event = new Event("select", { cancelable: true });
|
|
439
|
-
onSelect?.(event);
|
|
440
|
-
if (selfManaged && authored && !kind)
|
|
441
|
-
toggleIndex?.(sourceIndex ?? indexProp);
|
|
442
|
-
return event.defaultPrevented;
|
|
443
|
-
};
|
|
444
|
-
const handleActivate = disabled ? undefined : (e) => {
|
|
445
|
-
onClick?.(e);
|
|
446
|
-
if (activate())
|
|
447
|
-
e.preventBaseUIHandler?.();
|
|
448
|
-
};
|
|
449
|
-
const itemClassName = cn2(`relative z-10 flex ${sizeClasses.control} shrink-0 items-center ${sizeClasses.gap} ${shape.item} ${inset ? INSET_PX[sizeClasses.variant] : sizeClasses.itemPx} cursor-pointer outline-none`, freeform && [
|
|
450
|
-
sizeClasses.text,
|
|
451
|
-
FREEFORM_SVG[sizeClasses.variant],
|
|
452
|
-
"min-w-0 transition-[color,font-variation-settings] duration-fast",
|
|
453
|
-
lit ? "text-foreground" : "text-muted-foreground",
|
|
454
|
-
isChecked ? "weight-semibold" : "weight-normal"
|
|
455
|
-
], disabled && "opacity-50 pointer-events-none", className);
|
|
456
|
-
const content = /* @__PURE__ */ jsxs2(Fragment, {
|
|
457
|
-
children: [
|
|
458
|
-
Icon && /* @__PURE__ */ jsxs2("span", {
|
|
459
|
-
className: "inline-grid",
|
|
460
|
-
children: [
|
|
461
|
-
/* @__PURE__ */ jsx2("span", {
|
|
462
|
-
className: "col-start-1 row-start-1 invisible",
|
|
463
|
-
children: /* @__PURE__ */ jsx2(Icon, {
|
|
464
|
-
size: sizeClasses.icon,
|
|
465
|
-
strokeWidth: 2
|
|
466
|
-
})
|
|
467
|
-
}),
|
|
468
|
-
/* @__PURE__ */ jsx2(Icon, {
|
|
469
|
-
size: sizeClasses.icon,
|
|
470
|
-
strokeWidth: lit ? 2 : 1.5,
|
|
471
|
-
className: cn2("col-start-1 row-start-1 transition-[color,stroke-width] duration-fast", lit ? "text-foreground" : "text-muted-foreground")
|
|
472
|
-
})
|
|
473
|
-
]
|
|
474
|
-
}),
|
|
475
|
-
text !== undefined && /* @__PURE__ */ jsxs2("span", {
|
|
476
|
-
className: cn2("inline-grid min-w-0 flex-1", sizeClasses.text),
|
|
477
|
-
children: [
|
|
478
|
-
/* @__PURE__ */ jsx2("span", {
|
|
479
|
-
className: "col-start-1 row-start-1 invisible truncate [text-box:trim-both_cap_alphabetic] weight-semibold",
|
|
480
|
-
"aria-hidden": "true",
|
|
481
|
-
children: text
|
|
482
|
-
}),
|
|
483
|
-
/* @__PURE__ */ jsx2("span", {
|
|
484
|
-
className: cn2("col-start-1 row-start-1 truncate transition-[color,font-variation-settings] duration-fast [text-box:trim-both_cap_alphabetic]", lit ? "text-foreground" : "text-muted-foreground", isChecked ? "weight-semibold" : "weight-normal"),
|
|
485
|
-
children: text
|
|
486
|
-
})
|
|
487
|
-
]
|
|
488
|
-
}),
|
|
489
|
-
label !== undefined || freeform ? children : null,
|
|
490
|
-
shortcut != null && /* @__PURE__ */ jsx2(DropdownShortcut2, {
|
|
491
|
-
children: shortcut
|
|
492
|
-
}),
|
|
493
|
-
/* @__PURE__ */ jsx2(AnimatePresence, {
|
|
494
|
-
children: isChecked && /* @__PURE__ */ jsx2(motion.svg, {
|
|
495
|
-
width: sizeClasses.icon,
|
|
496
|
-
height: sizeClasses.icon,
|
|
497
|
-
viewBox: "0 0 24 24",
|
|
498
|
-
fill: "none",
|
|
499
|
-
stroke: "currentColor",
|
|
500
|
-
strokeWidth: 2,
|
|
501
|
-
strokeLinecap: "round",
|
|
502
|
-
strokeLinejoin: "round",
|
|
503
|
-
className: cn2("text-foreground shrink-0", freeform && shortcut == null && "ml-auto"),
|
|
504
|
-
initial: { opacity: 1 },
|
|
505
|
-
animate: { opacity: 1 },
|
|
506
|
-
exit: { opacity: 1 },
|
|
507
|
-
children: /* @__PURE__ */ jsx2(motion.path, {
|
|
508
|
-
d: "M4 12L9 17L20 6",
|
|
509
|
-
initial: { pathLength: skipAnimation ? 1 : 0 },
|
|
510
|
-
animate: {
|
|
511
|
-
pathLength: 1,
|
|
512
|
-
transition: { duration: spring2.fast.duration, ease: "easeOut" }
|
|
513
|
-
},
|
|
514
|
-
exit: {
|
|
515
|
-
pathLength: 0,
|
|
516
|
-
transition: { duration: 0.04, ease: "easeIn" }
|
|
517
|
-
}
|
|
518
|
-
})
|
|
519
|
-
}, "check")
|
|
520
|
-
})
|
|
521
|
-
]
|
|
522
|
-
});
|
|
523
|
-
if (renderMenuItem) {
|
|
524
|
-
return renderMenuItem({
|
|
525
|
-
radio: isRadio,
|
|
526
|
-
checkbox: isCheckbox,
|
|
527
|
-
checked: isChecked,
|
|
528
|
-
value: kind === "radio" ? value : index,
|
|
529
|
-
disabled,
|
|
530
|
-
label: textValue ?? text,
|
|
531
|
-
closeOnClick: closeOnClick ?? (kind ? kind === "radio" : !multiple),
|
|
532
|
-
onClick: handleActivate,
|
|
533
|
-
element: rowElement(),
|
|
534
|
-
children: content
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
const tabStop = authored ? checkedIndex ?? checkedIndices?.[0] ?? 0 : firstRow;
|
|
538
|
-
const slotOnClick = slot?.props?.onClick;
|
|
539
|
-
return rowElement({
|
|
540
|
-
tabIndex: !disabled && index === tabStop ? 0 : -1,
|
|
541
|
-
role: isCheckbox ? "menuitemcheckbox" : isRadio ? "menuitemradio" : "menuitem",
|
|
542
|
-
"aria-checked": typeof isChecked === "boolean" ? isChecked : undefined,
|
|
543
|
-
"aria-disabled": disabled || undefined,
|
|
544
|
-
onClick: (e) => {
|
|
545
|
-
slotOnClick?.(e);
|
|
546
|
-
handleActivate?.(e);
|
|
547
|
-
},
|
|
548
|
-
onKeyDown: (e) => {
|
|
549
|
-
if (disabled)
|
|
550
|
-
return;
|
|
551
|
-
if (e.key === " " || e.key === "Enter") {
|
|
552
|
-
e.preventDefault();
|
|
553
|
-
if (slot)
|
|
554
|
-
e.currentTarget.click();
|
|
555
|
-
else
|
|
556
|
-
activate();
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
children: content
|
|
560
|
-
});
|
|
561
|
-
});
|
|
562
|
-
MenuItem2.displayName = "MenuItem";
|
|
563
|
-
|
|
564
|
-
// components/overlays/dropdown/menu-parts.tsx
|
|
565
|
-
import { Menu } from "@base-ui/react/menu";
|
|
566
|
-
import {
|
|
567
|
-
createContext as createContext3,
|
|
568
|
-
forwardRef as forwardRef3,
|
|
569
|
-
useCallback as useCallback2,
|
|
570
|
-
useContext as useContext3,
|
|
571
|
-
useEffect as useEffect3,
|
|
572
|
-
useImperativeHandle,
|
|
573
|
-
useMemo as useMemo2,
|
|
574
|
-
useRef as useRef3,
|
|
575
|
-
useState as useState2
|
|
576
|
-
} from "react";
|
|
577
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
578
|
-
var shape2 = shapeMap2.rounded;
|
|
579
|
-
var NO_INDICES = [];
|
|
580
|
-
function mergeRefs(...refs) {
|
|
581
|
-
return (node) => {
|
|
582
|
-
for (const ref of refs) {
|
|
583
|
-
if (typeof ref === "function")
|
|
584
|
-
ref(node);
|
|
585
|
-
else if (ref)
|
|
586
|
-
ref.current = node;
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
var ownEvent = (e) => e.currentTarget.contains(e.target);
|
|
591
|
-
function chain(theirs, own) {
|
|
592
|
-
return (e) => {
|
|
593
|
-
theirs?.(e);
|
|
594
|
-
own(e);
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
function renderPopupItem({
|
|
598
|
-
radio,
|
|
599
|
-
checkbox,
|
|
600
|
-
checked,
|
|
601
|
-
value,
|
|
602
|
-
disabled,
|
|
603
|
-
label,
|
|
604
|
-
closeOnClick,
|
|
605
|
-
onClick,
|
|
606
|
-
element,
|
|
607
|
-
children
|
|
608
|
-
}) {
|
|
609
|
-
if (checkbox)
|
|
610
|
-
return /* @__PURE__ */ jsx3(Menu.CheckboxItem, {
|
|
611
|
-
checked: !!checked,
|
|
612
|
-
disabled,
|
|
613
|
-
label,
|
|
614
|
-
closeOnClick,
|
|
615
|
-
onClick,
|
|
616
|
-
render: element,
|
|
617
|
-
children
|
|
618
|
-
});
|
|
619
|
-
if (radio)
|
|
620
|
-
return /* @__PURE__ */ jsx3(Menu.RadioItem, {
|
|
621
|
-
value,
|
|
622
|
-
disabled,
|
|
623
|
-
label,
|
|
624
|
-
closeOnClick,
|
|
625
|
-
onClick,
|
|
626
|
-
render: element,
|
|
627
|
-
children
|
|
628
|
-
});
|
|
629
|
-
return /* @__PURE__ */ jsx3(Menu.Item, {
|
|
630
|
-
disabled,
|
|
631
|
-
label,
|
|
632
|
-
closeOnClick,
|
|
633
|
-
onClick,
|
|
634
|
-
render: element,
|
|
635
|
-
children
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
function useValueChecked() {
|
|
639
|
-
const [valueChecked, setValueChecked] = useState2(NO_INDICES);
|
|
640
|
-
const reportChecked = useCallback2((index, on) => setValueChecked((prev) => on === prev.includes(index) ? prev : on ? [...prev, index] : prev.filter((i) => i !== index)), []);
|
|
641
|
-
return { valueChecked, reportChecked };
|
|
642
|
-
}
|
|
643
|
-
function useMenuPanel(containerRef, open) {
|
|
644
|
-
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow2 });
|
|
645
|
-
const { activeIndex, setActiveIndex, itemRects, isMeasured } = hover;
|
|
646
|
-
const rowOrder = useRowOrder2();
|
|
647
|
-
const [focusedIndex, setFocusedIndex] = useState2(null);
|
|
648
|
-
const { keyboardNavRef, trackKeyboardNav } = useKeyboardNavGate2(open);
|
|
649
|
-
const [pinned, setPinned] = useState2(null);
|
|
650
|
-
const pin = useCallback2((index, on) => setPinned((p) => on ? index : p === index ? null : p), []);
|
|
651
|
-
const { valueChecked, reportChecked } = useValueChecked();
|
|
652
|
-
useEffect3(() => {
|
|
653
|
-
if (open)
|
|
654
|
-
return;
|
|
655
|
-
setFocusedIndex(null);
|
|
656
|
-
setActiveIndex(null);
|
|
657
|
-
}, [open, setActiveIndex]);
|
|
658
|
-
const lit = activeIndex ?? pinned;
|
|
659
|
-
const shownHover = useMemo2(() => ({ ...hover, activeIndex: lit }), [hover, lit]);
|
|
660
|
-
const focusRect = isMeasured && focusedIndex !== null ? itemRects[focusedIndex] ?? null : null;
|
|
661
|
-
const focusRow = useCallback2((e) => {
|
|
662
|
-
const row = e.target.closest("[data-fluid-hover-index]");
|
|
663
|
-
if (!row)
|
|
664
|
-
return false;
|
|
665
|
-
const index = Number(row.getAttribute("data-fluid-hover-index"));
|
|
666
|
-
setActiveIndex(isDisabledRow2(row) ? null : index);
|
|
667
|
-
setFocusedIndex(keyboardNavRef.current && e.target.matches(":focus-visible") ? index : null);
|
|
668
|
-
return true;
|
|
669
|
-
}, [keyboardNavRef, setActiveIndex]);
|
|
670
|
-
return {
|
|
671
|
-
hover,
|
|
672
|
-
shownHover,
|
|
673
|
-
lit,
|
|
674
|
-
rowOrder,
|
|
675
|
-
focusRect,
|
|
676
|
-
setFocusedIndex,
|
|
677
|
-
focusRow,
|
|
678
|
-
trackKeyboardNav,
|
|
679
|
-
pin,
|
|
680
|
-
valueChecked,
|
|
681
|
-
reportChecked
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
var DropdownGroupContext = createContext3(false);
|
|
685
|
-
var DropdownGroup2 = forwardRef3(({ className, ...props }, ref) => {
|
|
686
|
-
const own = useRef3(null);
|
|
687
|
-
useRowSlot2(own, undefined, true);
|
|
688
|
-
return /* @__PURE__ */ jsx3(DropdownGroupContext.Provider, {
|
|
689
|
-
value: true,
|
|
690
|
-
children: /* @__PURE__ */ jsx3(Menu.Group, {
|
|
691
|
-
ref: mergeRefs(own, ref),
|
|
692
|
-
className: cn2("flex flex-col", className),
|
|
693
|
-
...props
|
|
694
|
-
})
|
|
695
|
-
});
|
|
696
|
-
});
|
|
697
|
-
DropdownGroup2.displayName = "DropdownGroup";
|
|
698
|
-
var DropdownCheckboxItem2 = forwardRef3(({ checked, defaultChecked = false, onCheckedChange, onSelect, closeOnClick = false, ...props }, ref) => {
|
|
699
|
-
const [on, setOn] = useControllableState2(checked, defaultChecked, onCheckedChange);
|
|
700
|
-
return /* @__PURE__ */ jsx3(MenuItem2, {
|
|
701
|
-
ref,
|
|
702
|
-
kind: "checkbox",
|
|
703
|
-
checked: on,
|
|
704
|
-
closeOnClick,
|
|
705
|
-
onSelect: (event) => {
|
|
706
|
-
onSelect?.(event);
|
|
707
|
-
setOn((prev) => !prev);
|
|
708
|
-
},
|
|
709
|
-
...props
|
|
710
|
-
});
|
|
711
|
-
});
|
|
712
|
-
DropdownCheckboxItem2.displayName = "DropdownCheckboxItem";
|
|
713
|
-
var RadioValueContext = createContext3(null);
|
|
714
|
-
var DropdownRadioGroup2 = forwardRef3(({ value, defaultValue, onValueChange, className, ...props }, ref) => {
|
|
715
|
-
const [current, setCurrent] = useControllableState2(value, defaultValue, (next) => {
|
|
716
|
-
if (next !== undefined)
|
|
717
|
-
onValueChange?.(next);
|
|
718
|
-
});
|
|
719
|
-
const own = useRef3(null);
|
|
720
|
-
useRowSlot2(own, undefined, true);
|
|
721
|
-
const ctx = useMemo2(() => ({ value: current, select: (next) => setCurrent(next) }), [current, setCurrent]);
|
|
722
|
-
return /* @__PURE__ */ jsx3(RadioValueContext.Provider, {
|
|
723
|
-
value: ctx,
|
|
724
|
-
children: /* @__PURE__ */ jsx3(DropdownGroupContext.Provider, {
|
|
725
|
-
value: false,
|
|
726
|
-
children: /* @__PURE__ */ jsx3(Menu.RadioGroup, {
|
|
727
|
-
ref: mergeRefs(own, ref),
|
|
728
|
-
value: current ?? null,
|
|
729
|
-
className: cn2("flex flex-col", className),
|
|
730
|
-
...props
|
|
731
|
-
})
|
|
732
|
-
})
|
|
733
|
-
});
|
|
734
|
-
});
|
|
735
|
-
DropdownRadioGroup2.displayName = "DropdownRadioGroup";
|
|
736
|
-
var DropdownRadioItem2 = forwardRef3(({ value, onSelect, ...props }, ref) => {
|
|
737
|
-
const group = useContext3(RadioValueContext);
|
|
738
|
-
return /* @__PURE__ */ jsx3(MenuItem2, {
|
|
739
|
-
ref,
|
|
740
|
-
kind: "radio",
|
|
741
|
-
value,
|
|
742
|
-
checked: group?.value === value,
|
|
743
|
-
onSelect: (event) => {
|
|
744
|
-
onSelect?.(event);
|
|
745
|
-
group?.select(value);
|
|
746
|
-
},
|
|
747
|
-
...props
|
|
748
|
-
});
|
|
749
|
-
});
|
|
750
|
-
DropdownRadioItem2.displayName = "DropdownRadioItem";
|
|
751
|
-
var SubContext = createContext3(null);
|
|
752
|
-
function useSubContext() {
|
|
753
|
-
const ctx = useContext3(SubContext);
|
|
754
|
-
if (!ctx)
|
|
755
|
-
throw new Error("Dropdown.SubTrigger and Dropdown.SubContent must be inside <Dropdown.Sub>");
|
|
756
|
-
return ctx;
|
|
757
|
-
}
|
|
758
|
-
function DropdownSub2({ children, open, defaultOpen = false, onOpenChange, disabled = false }) {
|
|
759
|
-
const [current, setCurrent] = useControllableState2(open, defaultOpen);
|
|
760
|
-
const { origin, capture } = useMorphOrigin2();
|
|
761
|
-
const ctx = useMemo2(() => ({ open: current, origin }), [current, origin]);
|
|
762
|
-
return /* @__PURE__ */ jsx3(SubContext.Provider, {
|
|
763
|
-
value: ctx,
|
|
764
|
-
children: /* @__PURE__ */ jsx3(Menu.SubmenuRoot, {
|
|
765
|
-
open: current,
|
|
766
|
-
disabled,
|
|
767
|
-
onOpenChange: (next, details) => {
|
|
768
|
-
if (next === current)
|
|
769
|
-
return;
|
|
770
|
-
onOpenChange?.(next, details);
|
|
771
|
-
if (details.isCanceled)
|
|
772
|
-
return;
|
|
773
|
-
if (next)
|
|
774
|
-
capture(details);
|
|
775
|
-
setCurrent(next);
|
|
776
|
-
},
|
|
777
|
-
children
|
|
778
|
-
})
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
DropdownSub2.displayName = "DropdownSub";
|
|
782
|
-
var DropdownSubTrigger2 = forwardRef3(({ openOnHover, delay, closeDelay, ...props }, ref) => {
|
|
783
|
-
const { open, origin } = useSubContext();
|
|
784
|
-
const parent = useDropdown2();
|
|
785
|
-
const Chevron = useIcon2("chevron-right");
|
|
786
|
-
const size = useSize2();
|
|
787
|
-
const ctx = useMemo2(() => ({
|
|
788
|
-
...parent,
|
|
789
|
-
renderMenuItem: ({ disabled, label, onClick, element, children }) => /* @__PURE__ */ jsxs3(Menu.SubmenuTrigger, {
|
|
790
|
-
disabled,
|
|
791
|
-
label,
|
|
792
|
-
onClick,
|
|
793
|
-
openOnHover,
|
|
794
|
-
delay,
|
|
795
|
-
closeDelay,
|
|
796
|
-
render: element,
|
|
797
|
-
children: [
|
|
798
|
-
children,
|
|
799
|
-
/* @__PURE__ */ jsx3(Chevron, {
|
|
800
|
-
size: size.icon,
|
|
801
|
-
strokeWidth: open ? 2 : 1.5,
|
|
802
|
-
className: cn2("ml-auto shrink-0 transition-[color,stroke-width] duration-fast", open ? "text-foreground" : "text-muted-foreground")
|
|
803
|
-
})
|
|
804
|
-
]
|
|
805
|
-
})
|
|
806
|
-
}), [parent, openOnHover, delay, closeDelay, Chevron, size.icon, open]);
|
|
807
|
-
const setTrigger = useCallback2((node) => {
|
|
808
|
-
if (node)
|
|
809
|
-
origin.current = { ...origin.current, trigger: node };
|
|
810
|
-
}, [origin]);
|
|
811
|
-
return /* @__PURE__ */ jsx3(DropdownContext.Provider, {
|
|
812
|
-
value: ctx,
|
|
813
|
-
children: /* @__PURE__ */ jsx3(MenuItem2, {
|
|
814
|
-
ref: mergeRefs(setTrigger, ref),
|
|
815
|
-
pinned: open,
|
|
816
|
-
...props
|
|
817
|
-
})
|
|
818
|
-
});
|
|
819
|
-
});
|
|
820
|
-
DropdownSubTrigger2.displayName = "DropdownSubTrigger";
|
|
821
|
-
var DropdownSubContent2 = forwardRef3(({
|
|
822
|
-
children,
|
|
823
|
-
className,
|
|
824
|
-
positionerClassName,
|
|
825
|
-
side = "inline-end",
|
|
826
|
-
align = "start",
|
|
827
|
-
sideOffset = 8,
|
|
828
|
-
alignOffset = -4,
|
|
829
|
-
collisionPadding,
|
|
830
|
-
container,
|
|
831
|
-
finalFocus,
|
|
832
|
-
initialFocus,
|
|
833
|
-
from,
|
|
834
|
-
effect,
|
|
835
|
-
tier = "moderate",
|
|
836
|
-
keepMounted = false,
|
|
837
|
-
onKeyDownCapture,
|
|
838
|
-
onMouseEnter,
|
|
839
|
-
onMouseMove,
|
|
840
|
-
onMouseLeave,
|
|
841
|
-
onClick,
|
|
842
|
-
onFocus,
|
|
843
|
-
onBlur,
|
|
844
|
-
...popupProps
|
|
845
|
-
}, ref) => {
|
|
846
|
-
const { open, origin } = useSubContext();
|
|
847
|
-
const morph = useMorph2(open, origin, { from, effect, tier });
|
|
848
|
-
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
849
|
-
const level = Math.min(useSurface2() + 2, 8);
|
|
850
|
-
const containerRef = useRef3(null);
|
|
851
|
-
const panel = useMenuPanel(containerRef, open);
|
|
852
|
-
const { hover, focusRow, setFocusedIndex } = panel;
|
|
853
|
-
const { handlers, setActiveIndex, registerItem, itemRects, remeasure } = hover;
|
|
854
|
-
useEffect3(() => {
|
|
855
|
-
if (open)
|
|
856
|
-
remeasure();
|
|
857
|
-
}, [open, remeasure]);
|
|
858
|
-
const initialFocusRef = useRef3(initialFocus);
|
|
859
|
-
initialFocusRef.current = initialFocus;
|
|
860
|
-
const hasInitialFocus = Boolean(initialFocus);
|
|
861
|
-
useEffect3(() => {
|
|
862
|
-
if (!open || !hasInitialFocus)
|
|
863
|
-
return;
|
|
864
|
-
const frame = requestAnimationFrame(() => initialFocusRef.current?.current?.focus());
|
|
865
|
-
return () => cancelAnimationFrame(frame);
|
|
866
|
-
}, [open, hasInitialFocus]);
|
|
867
|
-
const runs = useSelectionRuns2(panel.valueChecked);
|
|
868
|
-
const blocks = useMergeSplitBlocks2(runs, itemRects, shape2.bgRadius);
|
|
869
|
-
const ctx = useMemo2(() => ({
|
|
870
|
-
registerItem,
|
|
871
|
-
activeIndex: panel.lit,
|
|
872
|
-
inMenu: true,
|
|
873
|
-
renderMenuItem: renderPopupItem,
|
|
874
|
-
pin: panel.pin,
|
|
875
|
-
reportChecked: panel.reportChecked
|
|
876
|
-
}), [registerItem, panel.lit, panel.pin, panel.reportChecked]);
|
|
877
|
-
return /* @__PURE__ */ jsx3(Menu.Portal, {
|
|
878
|
-
keepMounted,
|
|
879
|
-
container,
|
|
880
|
-
children: /* @__PURE__ */ jsx3(Menu.Positioner, {
|
|
881
|
-
side,
|
|
882
|
-
align,
|
|
883
|
-
sideOffset,
|
|
884
|
-
alignOffset,
|
|
885
|
-
collisionPadding,
|
|
886
|
-
className: cn2("z-50 outline-none", positionerClassName),
|
|
887
|
-
children: /* @__PURE__ */ jsx3(Menu.Popup, {
|
|
888
|
-
...popupProps,
|
|
889
|
-
ref: morph.popupRef,
|
|
890
|
-
finalFocus,
|
|
891
|
-
onKeyDownCapture: chain(onKeyDownCapture, (e) => ownEvent(e) && panel.trackKeyboardNav(e)),
|
|
892
|
-
onMouseEnter: chain(onMouseEnter, () => {
|
|
893
|
-
handlers.onMouseEnter();
|
|
894
|
-
setFocusedIndex(null);
|
|
895
|
-
}),
|
|
896
|
-
onMouseMove: chain(onMouseMove, (e) => ownEvent(e) && handlers.onMouseMove(e)),
|
|
897
|
-
onMouseLeave: chain(onMouseLeave, handlers.onMouseLeave),
|
|
898
|
-
onClick: chain(onClick, (e) => ownEvent(e) && handlers.onClick(e)),
|
|
899
|
-
onFocus: chain(onFocus, (e) => {
|
|
900
|
-
if (!ownEvent(e) || focusRow(e))
|
|
901
|
-
return;
|
|
902
|
-
if (e.target !== e.currentTarget)
|
|
903
|
-
setActiveIndex(null);
|
|
904
|
-
}),
|
|
905
|
-
onBlur: chain(onBlur, (e) => {
|
|
906
|
-
if (!ownEvent(e) || e.currentTarget.contains(e.relatedTarget))
|
|
907
|
-
return;
|
|
908
|
-
setFocusedIndex(null);
|
|
909
|
-
setActiveIndex(null);
|
|
910
|
-
}),
|
|
911
|
-
className: "relative select-none outline-none",
|
|
912
|
-
children: /* @__PURE__ */ jsx3(SurfaceProvider2, {
|
|
913
|
-
value: level,
|
|
914
|
-
children: /* @__PURE__ */ jsx3(MorphSurface2, {
|
|
915
|
-
morph,
|
|
916
|
-
bg: SURFACE_BG2[level],
|
|
917
|
-
shadow: SURFACE_SHADOW2[3],
|
|
918
|
-
radius: shape2.container,
|
|
919
|
-
className: cn2("flex w-56 max-w-[var(--available-width)] max-h-[min(480px,var(--available-height))] flex-col overflow-hidden", shape2.container, className),
|
|
920
|
-
children: /* @__PURE__ */ jsx3(ScrollArea2, {
|
|
921
|
-
className: popupScrollAreaClass2,
|
|
922
|
-
viewportClassName: cn2(popupViewportClass2, "scroll-fade"),
|
|
923
|
-
children: /* @__PURE__ */ jsxs3("div", {
|
|
924
|
-
ref: containerRef,
|
|
925
|
-
className: "relative flex flex-col p-1",
|
|
926
|
-
children: [
|
|
927
|
-
/* @__PURE__ */ jsx3(SelectionBackgrounds2, {
|
|
928
|
-
blocks
|
|
929
|
-
}),
|
|
930
|
-
/* @__PURE__ */ jsx3(FluidHoverHighlight2, {
|
|
931
|
-
hover: panel.shownHover,
|
|
932
|
-
hidden: !open,
|
|
933
|
-
className: shape2.bg
|
|
934
|
-
}),
|
|
935
|
-
/* @__PURE__ */ jsx3(FocusRing2, {
|
|
936
|
-
rect: open ? panel.focusRect : null,
|
|
937
|
-
shape: "rounded"
|
|
938
|
-
}),
|
|
939
|
-
/* @__PURE__ */ jsx3(RowOrderContext2.Provider, {
|
|
940
|
-
value: panel.rowOrder,
|
|
941
|
-
children: /* @__PURE__ */ jsx3(DropdownContext.Provider, {
|
|
942
|
-
value: ctx,
|
|
943
|
-
children
|
|
944
|
-
})
|
|
945
|
-
})
|
|
946
|
-
]
|
|
947
|
-
})
|
|
948
|
-
})
|
|
949
|
-
})
|
|
950
|
-
})
|
|
951
|
-
})
|
|
952
|
-
})
|
|
953
|
-
});
|
|
954
|
-
});
|
|
955
|
-
DropdownSubContent2.displayName = "DropdownSubContent";
|
|
956
|
-
|
|
957
|
-
// components/overlays/dropdown/index.tsx
|
|
958
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
959
|
-
var shape3 = shapeMap2.rounded;
|
|
960
|
-
var NONE = -1;
|
|
961
|
-
var NO_INDICES2 = [];
|
|
962
|
-
var NO_RECTS = [];
|
|
963
|
-
function usePanelSelection({
|
|
964
|
-
checkedIndex,
|
|
965
|
-
defaultCheckedIndex,
|
|
966
|
-
onCheckedIndexChange,
|
|
967
|
-
checkedIndices,
|
|
968
|
-
defaultCheckedIndices,
|
|
969
|
-
onCheckedIndicesChange
|
|
970
|
-
}, sourceOf, filtering) {
|
|
971
|
-
const [single, setSingle] = useControllableState2(defaultCheckedIndex === undefined ? checkedIndex ?? NONE : undefined, defaultCheckedIndex ?? NONE, (index) => onCheckedIndexChange?.(index === NONE ? undefined : index));
|
|
972
|
-
const [many, setMany] = useControllableState2(defaultCheckedIndices === undefined ? checkedIndices ?? NO_INDICES2 : undefined, defaultCheckedIndices ?? NO_INDICES2, (indices) => onCheckedIndicesChange?.(indices));
|
|
973
|
-
const multiple = checkedIndices != null || defaultCheckedIndices != null;
|
|
974
|
-
const selfManaged = defaultCheckedIndex !== undefined || defaultCheckedIndices !== undefined;
|
|
975
|
-
const toggleIndex = useCallback3((source) => {
|
|
976
|
-
if (multiple) {
|
|
977
|
-
setMany((prev) => prev.includes(source) ? prev.filter((i) => i !== source) : [...prev, source].sort((a, b) => a - b));
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
980
|
-
setSingle(source);
|
|
981
|
-
}, [multiple, setMany, setSingle]);
|
|
982
|
-
const renderedIndex = useMemo3(() => {
|
|
983
|
-
if (single === NONE)
|
|
984
|
-
return;
|
|
985
|
-
const i = filtering ? sourceOf.indexOf(single) : single;
|
|
986
|
-
return i === -1 ? undefined : i;
|
|
987
|
-
}, [single, filtering, sourceOf]);
|
|
988
|
-
const renderedIndices = useMemo3(() => {
|
|
989
|
-
if (!multiple)
|
|
990
|
-
return;
|
|
991
|
-
if (!filtering)
|
|
992
|
-
return many;
|
|
993
|
-
return many.map((s) => sourceOf.indexOf(s)).filter((i) => i !== -1);
|
|
994
|
-
}, [multiple, many, filtering, sourceOf]);
|
|
995
|
-
return {
|
|
996
|
-
checkedIndex: renderedIndex,
|
|
997
|
-
checkedIndices: renderedIndices,
|
|
998
|
-
multiple,
|
|
999
|
-
selfManaged,
|
|
1000
|
-
toggleIndex
|
|
1001
|
-
};
|
|
1002
|
-
}
|
|
1003
|
-
function usePanelRows(children) {
|
|
1004
|
-
const [query, setQuery] = useState3("");
|
|
1005
|
-
const filtering = useMemo3(() => Children.toArray(children).some((child) => isValidElement(child) && child.type === DropdownSearch2 && child.props.filter), [children]);
|
|
1006
|
-
const filterCtx = useMemo3(() => ({ query, setQuery }), [query]);
|
|
1007
|
-
const { content, sourceOf } = useMemo3(() => {
|
|
1008
|
-
if (!filtering)
|
|
1009
|
-
return { content: children, sourceOf: NO_INDICES2 };
|
|
1010
|
-
const needle = query.trim().toLowerCase();
|
|
1011
|
-
const rendered = [];
|
|
1012
|
-
const empties = [];
|
|
1013
|
-
const sources = [];
|
|
1014
|
-
for (const child of Children.toArray(children)) {
|
|
1015
|
-
if (!isValidElement(child)) {
|
|
1016
|
-
rendered.push(child);
|
|
1017
|
-
continue;
|
|
1018
|
-
}
|
|
1019
|
-
if (child.type === DropdownEmpty2) {
|
|
1020
|
-
empties.push(child);
|
|
1021
|
-
continue;
|
|
1022
|
-
}
|
|
1023
|
-
const rowProps = child.props;
|
|
1024
|
-
if (typeof rowProps.label !== "string" || typeof rowProps.index !== "number") {
|
|
1025
|
-
rendered.push(child);
|
|
1026
|
-
continue;
|
|
1027
|
-
}
|
|
1028
|
-
if (needle && !rowProps.label.toLowerCase().includes(needle))
|
|
1029
|
-
continue;
|
|
1030
|
-
rendered.push(cloneElement(child, {
|
|
1031
|
-
index: sources.length,
|
|
1032
|
-
sourceIndex: rowProps.index
|
|
1033
|
-
}));
|
|
1034
|
-
sources.push(rowProps.index);
|
|
1035
|
-
}
|
|
1036
|
-
if (sources.length === 0)
|
|
1037
|
-
rendered.push(...empties);
|
|
1038
|
-
return { content: rendered, sourceOf: sources };
|
|
1039
|
-
}, [children, filtering, query]);
|
|
1040
|
-
return { content, sourceOf, filtering, filterCtx: filtering ? filterCtx : null };
|
|
1041
|
-
}
|
|
1042
|
-
var Dropdown2 = forwardRef4(({
|
|
1043
|
-
children,
|
|
1044
|
-
checkedIndex,
|
|
1045
|
-
defaultCheckedIndex,
|
|
1046
|
-
onCheckedIndexChange,
|
|
1047
|
-
checkedIndices,
|
|
1048
|
-
defaultCheckedIndices,
|
|
1049
|
-
onCheckedIndicesChange,
|
|
1050
|
-
size,
|
|
1051
|
-
className,
|
|
1052
|
-
...props
|
|
1053
|
-
}, ref) => {
|
|
1054
|
-
const containerRef = useRef4(null);
|
|
1055
|
-
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow2 });
|
|
1056
|
-
const { activeIndex, setActiveIndex, itemRects, handlers, registerItem } = hover;
|
|
1057
|
-
const [focusedIndex, setFocusedIndex] = useState3(null);
|
|
1058
|
-
const rowOrder = useRowOrder2();
|
|
1059
|
-
const { valueChecked, reportChecked } = useValueChecked();
|
|
1060
|
-
const rows = usePanelRows(children);
|
|
1061
|
-
const selection = usePanelSelection({
|
|
1062
|
-
checkedIndex,
|
|
1063
|
-
defaultCheckedIndex,
|
|
1064
|
-
onCheckedIndexChange,
|
|
1065
|
-
checkedIndices,
|
|
1066
|
-
defaultCheckedIndices,
|
|
1067
|
-
onCheckedIndicesChange
|
|
1068
|
-
}, rows.sourceOf, rows.filtering);
|
|
1069
|
-
const multiple = selection.multiple;
|
|
1070
|
-
const checkedRect = !multiple && selection.checkedIndex != null ? itemRects[selection.checkedIndex] : null;
|
|
1071
|
-
const focusRect = focusedIndex !== null ? itemRects[focusedIndex] : null;
|
|
1072
|
-
const runs = useSelectionRuns2(useMemo3(() => [...selection.checkedIndices ?? NO_INDICES2, ...valueChecked], [selection.checkedIndices, valueChecked]));
|
|
1073
|
-
const blocks = useMergeSplitBlocks2(runs, itemRects, shape3.bgRadius);
|
|
1074
|
-
const panelCtx = useMemo3(() => ({
|
|
1075
|
-
registerItem,
|
|
1076
|
-
activeIndex,
|
|
1077
|
-
checkedIndex: selection.checkedIndex,
|
|
1078
|
-
multiple,
|
|
1079
|
-
checkedIndices: selection.checkedIndices,
|
|
1080
|
-
selfManaged: selection.selfManaged,
|
|
1081
|
-
toggleIndex: selection.toggleIndex,
|
|
1082
|
-
reportChecked
|
|
1083
|
-
}), [
|
|
1084
|
-
registerItem,
|
|
1085
|
-
activeIndex,
|
|
1086
|
-
selection.checkedIndex,
|
|
1087
|
-
multiple,
|
|
1088
|
-
selection.checkedIndices,
|
|
1089
|
-
selection.selfManaged,
|
|
1090
|
-
selection.toggleIndex,
|
|
1091
|
-
reportChecked
|
|
1092
|
-
]);
|
|
1093
|
-
const panel = /* @__PURE__ */ jsx4(RowOrderContext2.Provider, {
|
|
1094
|
-
value: rowOrder,
|
|
1095
|
-
children: /* @__PURE__ */ jsx4(DropdownContext.Provider, {
|
|
1096
|
-
value: panelCtx,
|
|
1097
|
-
children: /* @__PURE__ */ jsx4(DropdownFilterContext.Provider, {
|
|
1098
|
-
value: rows.filterCtx,
|
|
1099
|
-
children: /* @__PURE__ */ jsxs4(Elevated2, {
|
|
1100
|
-
offset: 2,
|
|
1101
|
-
shadowLevel: 3,
|
|
1102
|
-
ref: (node) => {
|
|
1103
|
-
containerRef.current = node;
|
|
1104
|
-
if (typeof ref === "function")
|
|
1105
|
-
ref(node);
|
|
1106
|
-
else if (ref)
|
|
1107
|
-
ref.current = node;
|
|
1108
|
-
},
|
|
1109
|
-
onMouseEnter: handlers.onMouseEnter,
|
|
1110
|
-
onMouseMove: handlers.onMouseMove,
|
|
1111
|
-
onMouseLeave: handlers.onMouseLeave,
|
|
1112
|
-
onClick: handlers.onClick,
|
|
1113
|
-
onFocus: (e) => {
|
|
1114
|
-
const indexAttr = e.target.closest("[data-fluid-hover-index]")?.getAttribute("data-fluid-hover-index");
|
|
1115
|
-
if (indexAttr != null) {
|
|
1116
|
-
const idx = Number(indexAttr);
|
|
1117
|
-
setActiveIndex(idx);
|
|
1118
|
-
setFocusedIndex(e.target.matches(":focus-visible") ? idx : null);
|
|
1119
|
-
}
|
|
1120
|
-
},
|
|
1121
|
-
onBlur: (e) => {
|
|
1122
|
-
if (containerRef.current?.contains(e.relatedTarget))
|
|
1123
|
-
return;
|
|
1124
|
-
setFocusedIndex(null);
|
|
1125
|
-
setActiveIndex(null);
|
|
1126
|
-
},
|
|
1127
|
-
onKeyDown: (e) => {
|
|
1128
|
-
const items = Array.from(containerRef.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]') ?? []);
|
|
1129
|
-
const currentIdx = items.indexOf(e.target);
|
|
1130
|
-
if (currentIdx === -1)
|
|
1131
|
-
return;
|
|
1132
|
-
if (["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft"].includes(e.key)) {
|
|
1133
|
-
e.preventDefault();
|
|
1134
|
-
const next = ["ArrowDown", "ArrowRight"].includes(e.key) ? (currentIdx + 1) % items.length : (currentIdx - 1 + items.length) % items.length;
|
|
1135
|
-
items[next]?.focus();
|
|
1136
|
-
} else if (e.key === "Home") {
|
|
1137
|
-
e.preventDefault();
|
|
1138
|
-
items[0]?.focus();
|
|
1139
|
-
} else if (e.key === "End") {
|
|
1140
|
-
e.preventDefault();
|
|
1141
|
-
items[items.length - 1]?.focus();
|
|
1142
|
-
}
|
|
1143
|
-
},
|
|
1144
|
-
role: "group",
|
|
1145
|
-
className: cn2(`relative flex flex-col w-72 max-w-full p-1 select-none`, className),
|
|
1146
|
-
...props,
|
|
1147
|
-
children: [
|
|
1148
|
-
/* @__PURE__ */ jsx4(SelectionBackgrounds2, {
|
|
1149
|
-
blocks
|
|
1150
|
-
}),
|
|
1151
|
-
/* @__PURE__ */ jsx4(AnimatePresence2, {
|
|
1152
|
-
children: checkedRect && /* @__PURE__ */ jsx4(motion2.div, {
|
|
1153
|
-
className: `absolute ${shape3.bg} bg-active pointer-events-none`,
|
|
1154
|
-
initial: false,
|
|
1155
|
-
animate: {
|
|
1156
|
-
top: checkedRect.top,
|
|
1157
|
-
left: checkedRect.left,
|
|
1158
|
-
width: checkedRect.width,
|
|
1159
|
-
height: checkedRect.height,
|
|
1160
|
-
opacity: 1
|
|
1161
|
-
},
|
|
1162
|
-
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
1163
|
-
transition: {
|
|
1164
|
-
...spring2.moderate,
|
|
1165
|
-
opacity: { duration: spring2.fast.duration }
|
|
1166
|
-
}
|
|
1167
|
-
})
|
|
1168
|
-
}),
|
|
1169
|
-
/* @__PURE__ */ jsx4(FluidHoverHighlight2, {
|
|
1170
|
-
hover,
|
|
1171
|
-
from: checkedRect,
|
|
1172
|
-
className: shape3.bg
|
|
1173
|
-
}),
|
|
1174
|
-
/* @__PURE__ */ jsx4(AnimatePresence2, {
|
|
1175
|
-
children: focusRect && /* @__PURE__ */ jsx4(motion2.div, {
|
|
1176
|
-
className: `absolute ${shape3.focusRing} pointer-events-none z-20 border border-focus-ring`,
|
|
1177
|
-
initial: false,
|
|
1178
|
-
animate: {
|
|
1179
|
-
left: focusRect.left - 2,
|
|
1180
|
-
top: focusRect.top - 2,
|
|
1181
|
-
width: focusRect.width + 4,
|
|
1182
|
-
height: focusRect.height + 4
|
|
1183
|
-
},
|
|
1184
|
-
exit: { opacity: 0, transition: spring2.fast.exit },
|
|
1185
|
-
transition: {
|
|
1186
|
-
...spring2.fast,
|
|
1187
|
-
opacity: { duration: spring2.fast.duration }
|
|
1188
|
-
}
|
|
1189
|
-
})
|
|
1190
|
-
}),
|
|
1191
|
-
rows.content
|
|
1192
|
-
]
|
|
1193
|
-
})
|
|
1194
|
-
})
|
|
1195
|
-
})
|
|
1196
|
-
});
|
|
1197
|
-
return size ? /* @__PURE__ */ jsx4(SizeProvider2, {
|
|
1198
|
-
size,
|
|
1199
|
-
children: panel
|
|
1200
|
-
}) : panel;
|
|
1201
|
-
});
|
|
1202
|
-
Dropdown2.displayName = "Dropdown";
|
|
1203
|
-
var DropdownMenuContext = createContext4(null);
|
|
1204
|
-
function useDropdownMenuContext() {
|
|
1205
|
-
const ctx = useContext4(DropdownMenuContext);
|
|
1206
|
-
if (!ctx)
|
|
1207
|
-
throw new Error("DropdownMenu compound components must be inside <DropdownMenu>");
|
|
1208
|
-
return ctx;
|
|
1209
|
-
}
|
|
1210
|
-
function DropdownMenu2({
|
|
1211
|
-
children,
|
|
1212
|
-
open: openProp,
|
|
1213
|
-
defaultOpen = false,
|
|
1214
|
-
onOpenChange,
|
|
1215
|
-
disabled = false,
|
|
1216
|
-
modal = false,
|
|
1217
|
-
size
|
|
1218
|
-
}) {
|
|
1219
|
-
const [internalOpen, setInternalOpen] = useState3(defaultOpen);
|
|
1220
|
-
const open = openProp !== undefined ? openProp : internalOpen;
|
|
1221
|
-
const { origin, capture } = useMorphOrigin2();
|
|
1222
|
-
const handleOpenChange = useCallback3((next, details) => {
|
|
1223
|
-
onOpenChange?.(next, details);
|
|
1224
|
-
if (details.isCanceled)
|
|
1225
|
-
return;
|
|
1226
|
-
if (next)
|
|
1227
|
-
capture(details);
|
|
1228
|
-
if (openProp === undefined)
|
|
1229
|
-
setInternalOpen(next);
|
|
1230
|
-
}, [openProp, onOpenChange, capture]);
|
|
1231
|
-
const ctx = useMemo3(() => ({ open, origin }), [open, origin]);
|
|
1232
|
-
const root = /* @__PURE__ */ jsx4(DropdownMenuContext.Provider, {
|
|
1233
|
-
value: ctx,
|
|
1234
|
-
children: /* @__PURE__ */ jsx4(BaseMenu.Root, {
|
|
1235
|
-
open,
|
|
1236
|
-
onOpenChange: handleOpenChange,
|
|
1237
|
-
disabled,
|
|
1238
|
-
modal,
|
|
1239
|
-
children
|
|
1240
|
-
})
|
|
1241
|
-
});
|
|
1242
|
-
return size ? /* @__PURE__ */ jsx4(SizeProvider2, {
|
|
1243
|
-
size,
|
|
1244
|
-
children: root
|
|
1245
|
-
}) : root;
|
|
1246
|
-
}
|
|
1247
|
-
DropdownMenu2.displayName = "DropdownMenu";
|
|
1248
|
-
var DropdownTrigger2 = forwardRef4(({ asChild, render, children, ...props }, ref) => asChild && isValidElement(children) ? /* @__PURE__ */ jsx4(BaseMenu.Trigger, {
|
|
1249
|
-
ref,
|
|
1250
|
-
render: children,
|
|
1251
|
-
...props,
|
|
1252
|
-
id: slotId2(children, props.id)
|
|
1253
|
-
}) : /* @__PURE__ */ jsx4(BaseMenu.Trigger, {
|
|
1254
|
-
ref,
|
|
1255
|
-
render,
|
|
1256
|
-
...props,
|
|
1257
|
-
id: slotId2(render, props.id),
|
|
1258
|
-
children
|
|
1259
|
-
}));
|
|
1260
|
-
DropdownTrigger2.displayName = "DropdownTrigger";
|
|
1261
|
-
var DropdownContent2 = forwardRef4(({
|
|
1262
|
-
className,
|
|
1263
|
-
children,
|
|
1264
|
-
checkedIndex,
|
|
1265
|
-
defaultCheckedIndex,
|
|
1266
|
-
onCheckedIndexChange,
|
|
1267
|
-
checkedIndices,
|
|
1268
|
-
defaultCheckedIndices,
|
|
1269
|
-
onCheckedIndicesChange,
|
|
1270
|
-
side = "bottom",
|
|
1271
|
-
align = "start",
|
|
1272
|
-
sideOffset = 6,
|
|
1273
|
-
alignOffset,
|
|
1274
|
-
collisionPadding,
|
|
1275
|
-
collisionBoundary,
|
|
1276
|
-
container,
|
|
1277
|
-
finalFocus,
|
|
1278
|
-
initialFocus,
|
|
1279
|
-
positionerClassName,
|
|
1280
|
-
from,
|
|
1281
|
-
effect,
|
|
1282
|
-
hideSource,
|
|
1283
|
-
tier = "moderate",
|
|
1284
|
-
keepMounted = false,
|
|
1285
|
-
onKeyDownCapture,
|
|
1286
|
-
onMouseEnter,
|
|
1287
|
-
onMouseMove,
|
|
1288
|
-
onMouseLeave,
|
|
1289
|
-
onClick,
|
|
1290
|
-
onFocus,
|
|
1291
|
-
onBlur,
|
|
1292
|
-
...popupProps
|
|
1293
|
-
}, ref) => {
|
|
1294
|
-
const { open, origin } = useDropdownMenuContext();
|
|
1295
|
-
const morph = useMorph2(open, origin, { from, effect, hideSource, tier });
|
|
1296
|
-
useImperativeHandle2(ref, () => morph.popup, [morph.popup]);
|
|
1297
|
-
const level = Math.min(useSurface2() + 2, 8);
|
|
1298
|
-
const containerRef = useRef4(null);
|
|
1299
|
-
const panel = useMenuPanel(containerRef, open);
|
|
1300
|
-
const { hover, focusRow, setFocusedIndex } = panel;
|
|
1301
|
-
const { setActiveIndex, itemRects, handlers, registerItem, remeasure } = hover;
|
|
1302
|
-
const rows = usePanelRows(children);
|
|
1303
|
-
const selection = usePanelSelection({
|
|
1304
|
-
checkedIndex,
|
|
1305
|
-
defaultCheckedIndex,
|
|
1306
|
-
onCheckedIndexChange,
|
|
1307
|
-
checkedIndices,
|
|
1308
|
-
defaultCheckedIndices,
|
|
1309
|
-
onCheckedIndicesChange
|
|
1310
|
-
}, rows.sourceOf, rows.filtering);
|
|
1311
|
-
const {
|
|
1312
|
-
host: searchHost,
|
|
1313
|
-
hasSearch,
|
|
1314
|
-
searchMounted,
|
|
1315
|
-
onKeyDownCapture: redirectTypingToSearch,
|
|
1316
|
-
isSearchField,
|
|
1317
|
-
highlightFirst
|
|
1318
|
-
} = useDropdownSearchHost(open, { containerRef, setActiveIndex });
|
|
1319
|
-
const initialFocusRef = useRef4(initialFocus);
|
|
1320
|
-
initialFocusRef.current = initialFocus;
|
|
1321
|
-
const keepsFocus = initialFocus === false;
|
|
1322
|
-
useEffect4(() => {
|
|
1323
|
-
if (!open || keepsFocus)
|
|
1324
|
-
return;
|
|
1325
|
-
let inner;
|
|
1326
|
-
const outer = requestAnimationFrame(() => {
|
|
1327
|
-
inner = requestAnimationFrame(() => {
|
|
1328
|
-
const target = initialFocusRef.current;
|
|
1329
|
-
if (typeof target === "object")
|
|
1330
|
-
return target.current?.focus();
|
|
1331
|
-
if (hasSearch())
|
|
1332
|
-
return;
|
|
1333
|
-
const rows = containerRef.current;
|
|
1334
|
-
if (!rows || rows.contains(document.activeElement) && document.activeElement !== rows)
|
|
1335
|
-
return;
|
|
1336
|
-
const first = rows.querySelector('[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"])');
|
|
1337
|
-
first?.focus();
|
|
1338
|
-
});
|
|
1339
|
-
});
|
|
1340
|
-
return () => {
|
|
1341
|
-
cancelAnimationFrame(outer);
|
|
1342
|
-
if (inner !== undefined)
|
|
1343
|
-
cancelAnimationFrame(inner);
|
|
1344
|
-
};
|
|
1345
|
-
}, [open, hasSearch, keepsFocus]);
|
|
1346
|
-
useEffect4(() => {
|
|
1347
|
-
if (!open)
|
|
1348
|
-
return;
|
|
1349
|
-
remeasure();
|
|
1350
|
-
}, [open, remeasure]);
|
|
1351
|
-
const multiple = selection.multiple;
|
|
1352
|
-
const checkedRect = !multiple && selection.checkedIndex != null ? itemRects[selection.checkedIndex] : null;
|
|
1353
|
-
const runs = useSelectionRuns2(useMemo3(() => [...selection.checkedIndices ?? NO_INDICES2, ...panel.valueChecked], [selection.checkedIndices, panel.valueChecked]));
|
|
1354
|
-
const blocks = useMergeSplitBlocks2(runs, open ? itemRects : NO_RECTS, shape3.bgRadius);
|
|
1355
|
-
const contentCtx = useMemo3(() => ({
|
|
1356
|
-
registerItem,
|
|
1357
|
-
activeIndex: panel.lit,
|
|
1358
|
-
checkedIndex: selection.checkedIndex,
|
|
1359
|
-
multiple,
|
|
1360
|
-
checkedIndices: selection.checkedIndices,
|
|
1361
|
-
inMenu: true,
|
|
1362
|
-
renderMenuItem: renderPopupItem,
|
|
1363
|
-
selfManaged: selection.selfManaged,
|
|
1364
|
-
toggleIndex: selection.toggleIndex,
|
|
1365
|
-
pin: panel.pin,
|
|
1366
|
-
reportChecked: panel.reportChecked
|
|
1367
|
-
}), [
|
|
1368
|
-
registerItem,
|
|
1369
|
-
panel.lit,
|
|
1370
|
-
selection.checkedIndex,
|
|
1371
|
-
multiple,
|
|
1372
|
-
selection.checkedIndices,
|
|
1373
|
-
selection.selfManaged,
|
|
1374
|
-
selection.toggleIndex,
|
|
1375
|
-
panel.pin,
|
|
1376
|
-
panel.reportChecked
|
|
1377
|
-
]);
|
|
1378
|
-
return /* @__PURE__ */ jsx4(BaseMenu.Portal, {
|
|
1379
|
-
keepMounted,
|
|
1380
|
-
container,
|
|
1381
|
-
children: /* @__PURE__ */ jsx4(BaseMenu.Positioner, {
|
|
1382
|
-
side,
|
|
1383
|
-
align,
|
|
1384
|
-
sideOffset: opensInPlace2({ effect, hideSource }) ? inPlaceOffset2 : sideOffset,
|
|
1385
|
-
alignOffset,
|
|
1386
|
-
collisionPadding,
|
|
1387
|
-
collisionBoundary,
|
|
1388
|
-
className: cn2("z-50 outline-none", positionerClassName),
|
|
1389
|
-
children: /* @__PURE__ */ jsx4(DropdownContext.Provider, {
|
|
1390
|
-
value: contentCtx,
|
|
1391
|
-
children: /* @__PURE__ */ jsx4(DropdownFilterContext.Provider, {
|
|
1392
|
-
value: rows.filterCtx,
|
|
1393
|
-
children: /* @__PURE__ */ jsx4(DropdownSearchHostContext.Provider, {
|
|
1394
|
-
value: searchHost,
|
|
1395
|
-
children: /* @__PURE__ */ jsx4(BaseMenu.Popup, {
|
|
1396
|
-
...popupProps,
|
|
1397
|
-
ref: morph.popupRef,
|
|
1398
|
-
finalFocus,
|
|
1399
|
-
onKeyDownCapture: chain(onKeyDownCapture, (e) => {
|
|
1400
|
-
if (!ownEvent(e))
|
|
1401
|
-
return;
|
|
1402
|
-
panel.trackKeyboardNav(e);
|
|
1403
|
-
redirectTypingToSearch(e);
|
|
1404
|
-
}),
|
|
1405
|
-
onMouseEnter: chain(onMouseEnter, () => {
|
|
1406
|
-
handlers.onMouseEnter();
|
|
1407
|
-
setFocusedIndex(null);
|
|
1408
|
-
}),
|
|
1409
|
-
onMouseMove: chain(onMouseMove, (e) => ownEvent(e) && handlers.onMouseMove(e)),
|
|
1410
|
-
onClick: chain(onClick, (e) => ownEvent(e) && handlers.onClick(e)),
|
|
1411
|
-
onMouseLeave: chain(onMouseLeave, () => {
|
|
1412
|
-
handlers.onMouseLeave();
|
|
1413
|
-
if (isSearchField(document.activeElement))
|
|
1414
|
-
highlightFirst();
|
|
1415
|
-
}),
|
|
1416
|
-
onFocus: chain(onFocus, (e) => {
|
|
1417
|
-
if (!ownEvent(e) || focusRow(e))
|
|
1418
|
-
return;
|
|
1419
|
-
if (isSearchField(e.target)) {
|
|
1420
|
-
highlightFirst();
|
|
1421
|
-
} else if (e.target !== e.currentTarget) {
|
|
1422
|
-
setActiveIndex(null);
|
|
1423
|
-
}
|
|
1424
|
-
}),
|
|
1425
|
-
onBlur: chain(onBlur, (e) => {
|
|
1426
|
-
if (!ownEvent(e) || e.currentTarget.contains(e.relatedTarget))
|
|
1427
|
-
return;
|
|
1428
|
-
setFocusedIndex(null);
|
|
1429
|
-
setActiveIndex(null);
|
|
1430
|
-
}),
|
|
1431
|
-
className: "relative select-none outline-none",
|
|
1432
|
-
children: /* @__PURE__ */ jsx4(SurfaceProvider2, {
|
|
1433
|
-
value: level,
|
|
1434
|
-
children: /* @__PURE__ */ jsx4(MorphSurface2, {
|
|
1435
|
-
morph,
|
|
1436
|
-
bg: SURFACE_BG2[level],
|
|
1437
|
-
shadow: SURFACE_SHADOW2[3],
|
|
1438
|
-
radius: shape3.container,
|
|
1439
|
-
className: cn2(`flex flex-col w-72 max-w-full min-w-[var(--anchor-width)] max-h-[min(480px,var(--available-height))] overflow-hidden ${shape3.container}`, className),
|
|
1440
|
-
children: /* @__PURE__ */ jsx4(ScrollArea2, {
|
|
1441
|
-
className: popupScrollAreaClass2,
|
|
1442
|
-
viewportClassName: cn2(popupViewportClass2, !searchMounted && "scroll-fade"),
|
|
1443
|
-
children: /* @__PURE__ */ jsxs4("div", {
|
|
1444
|
-
ref: containerRef,
|
|
1445
|
-
className: "relative flex flex-col p-1",
|
|
1446
|
-
children: [
|
|
1447
|
-
/* @__PURE__ */ jsx4(SelectionBackgrounds2, {
|
|
1448
|
-
blocks
|
|
1449
|
-
}),
|
|
1450
|
-
/* @__PURE__ */ jsx4(AnimatePresence2, {
|
|
1451
|
-
children: checkedRect && /* @__PURE__ */ jsx4(motion2.div, {
|
|
1452
|
-
className: `absolute ${shape3.bg} bg-active pointer-events-none`,
|
|
1453
|
-
initial: false,
|
|
1454
|
-
animate: {
|
|
1455
|
-
top: checkedRect.top,
|
|
1456
|
-
left: checkedRect.left,
|
|
1457
|
-
width: checkedRect.width,
|
|
1458
|
-
height: checkedRect.height,
|
|
1459
|
-
opacity: 1
|
|
1460
|
-
},
|
|
1461
|
-
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
1462
|
-
transition: {
|
|
1463
|
-
...spring2.moderate,
|
|
1464
|
-
opacity: { duration: spring2.fast.duration }
|
|
1465
|
-
}
|
|
1466
|
-
})
|
|
1467
|
-
}),
|
|
1468
|
-
/* @__PURE__ */ jsx4(FluidHoverHighlight2, {
|
|
1469
|
-
hover: panel.shownHover,
|
|
1470
|
-
from: checkedRect,
|
|
1471
|
-
className: shape3.bg
|
|
1472
|
-
}),
|
|
1473
|
-
/* @__PURE__ */ jsx4(FocusRing2, {
|
|
1474
|
-
rect: open ? panel.focusRect : null,
|
|
1475
|
-
shape: "rounded"
|
|
1476
|
-
}),
|
|
1477
|
-
/* @__PURE__ */ jsx4(RowOrderContext2.Provider, {
|
|
1478
|
-
value: panel.rowOrder,
|
|
1479
|
-
children: /* @__PURE__ */ jsx4(BaseMenu.RadioGroup, {
|
|
1480
|
-
value: selection.checkedIndex ?? null,
|
|
1481
|
-
className: "contents",
|
|
1482
|
-
children: rows.content
|
|
1483
|
-
})
|
|
1484
|
-
})
|
|
1485
|
-
]
|
|
1486
|
-
})
|
|
1487
|
-
})
|
|
1488
|
-
})
|
|
1489
|
-
})
|
|
1490
|
-
})
|
|
1491
|
-
})
|
|
1492
|
-
})
|
|
1493
|
-
})
|
|
1494
|
-
})
|
|
1495
|
-
});
|
|
1496
|
-
});
|
|
1497
|
-
DropdownContent2.displayName = "DropdownContent";
|
|
1498
|
-
var DropdownLabel2 = forwardRef4(({ className, inset, ...props }, ref) => {
|
|
1499
|
-
const size = useSize2();
|
|
1500
|
-
const own = useRef4(null);
|
|
1501
|
-
useRowSlot2(own, undefined, true);
|
|
1502
|
-
const classes = cn2("py-1.5 shrink-0 text-muted-foreground", inset ? INSET_PX[size.variant] : "px-2", size.variant === "compact" ? "text-caption-compact" : "text-caption", className);
|
|
1503
|
-
return useContext4(DropdownGroupContext) ? /* @__PURE__ */ jsx4(BaseMenu.GroupLabel, {
|
|
1504
|
-
ref: mergeRefs(own, ref),
|
|
1505
|
-
className: classes,
|
|
1506
|
-
...props
|
|
1507
|
-
}) : /* @__PURE__ */ jsx4("div", {
|
|
1508
|
-
ref: mergeRefs(own, ref),
|
|
1509
|
-
className: classes,
|
|
1510
|
-
...props
|
|
1511
|
-
});
|
|
1512
|
-
});
|
|
1513
|
-
DropdownLabel2.displayName = "DropdownLabel";
|
|
1514
|
-
var DropdownSeparator2 = forwardRef4(({ className, ...props }, ref) => {
|
|
1515
|
-
const own = useRef4(null);
|
|
1516
|
-
useRowSlot2(own, undefined, true);
|
|
1517
|
-
return /* @__PURE__ */ jsx4("div", {
|
|
1518
|
-
ref: mergeRefs(own, ref),
|
|
1519
|
-
role: "separator",
|
|
1520
|
-
className: cn2("my-1 -mx-1 h-px shrink-0 bg-border/60", className),
|
|
1521
|
-
...props
|
|
1522
|
-
});
|
|
1523
|
-
});
|
|
1524
|
-
DropdownSeparator2.displayName = "DropdownSeparator";
|
|
1525
|
-
Object.assign(Dropdown2, {
|
|
1526
|
-
Menu: DropdownMenu2,
|
|
1527
|
-
Trigger: DropdownTrigger2,
|
|
1528
|
-
Content: DropdownContent2,
|
|
1529
|
-
Item: MenuItem2,
|
|
1530
|
-
Label: DropdownLabel2,
|
|
1531
|
-
Separator: DropdownSeparator2,
|
|
1532
|
-
Search: DropdownSearch2,
|
|
1533
|
-
Empty: DropdownEmpty2,
|
|
1534
|
-
Group: DropdownGroup2,
|
|
1535
|
-
Shortcut: DropdownShortcut2,
|
|
1536
|
-
CheckboxItem: DropdownCheckboxItem2,
|
|
1537
|
-
RadioGroup: DropdownRadioGroup2,
|
|
1538
|
-
RadioItem: DropdownRadioItem2,
|
|
1539
|
-
Sub: DropdownSub2,
|
|
1540
|
-
SubTrigger: DropdownSubTrigger2,
|
|
1541
|
-
SubContent: DropdownSubContent2
|
|
1542
|
-
});
|
|
1543
|
-
var dropdown_default = Dropdown2;
|
|
1544
|
-
|
|
1545
|
-
export { DropdownSearch2, DropdownEmpty2, DropdownContext, useDropdown2, useDropdownMaybe2, DropdownShortcut2, MenuItem2, DropdownGroup2, DropdownCheckboxItem2, DropdownRadioGroup2, DropdownRadioItem2, DropdownSub2, DropdownSubTrigger2, DropdownSubContent2, Dropdown2, DropdownMenu2, DropdownTrigger2, DropdownContent2, DropdownLabel2, DropdownSeparator2, dropdown_default };
|