@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,1478 +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
|
-
useIcon2
|
|
19
|
-
} from "./components-jqpefjsn.js";
|
|
20
|
-
import {
|
|
21
|
-
MorphSurface2
|
|
22
|
-
} from "./components-c7rwx0ap.js";
|
|
23
|
-
import {
|
|
24
|
-
shapeMap2,
|
|
25
|
-
useShape2
|
|
26
|
-
} from "./components-71nbt03m.js";
|
|
27
|
-
import {
|
|
28
|
-
useSize2
|
|
29
|
-
} from "./components-h83az0bz.js";
|
|
30
|
-
import {
|
|
31
|
-
SURFACE_BG2,
|
|
32
|
-
SURFACE_SHADOW2,
|
|
33
|
-
surfaceClasses2
|
|
34
|
-
} from "./components-vf45j12c.js";
|
|
35
|
-
import {
|
|
36
|
-
useSurface2,
|
|
37
|
-
SurfaceProvider2
|
|
38
|
-
} from "./components-dhgk6mbt.js";
|
|
39
|
-
import {
|
|
40
|
-
useFluidHover2,
|
|
41
|
-
useRegisterFluidHoverItem2
|
|
42
|
-
} from "./components-yhgq0qxx.js";
|
|
43
|
-
import {
|
|
44
|
-
SizeProvider2
|
|
45
|
-
} from "./components-dcc02hs2.js";
|
|
46
|
-
import {
|
|
47
|
-
Tooltip2
|
|
48
|
-
} from "./components-2krsc300.js";
|
|
49
|
-
import {
|
|
50
|
-
Slider2
|
|
51
|
-
} from "./components-t5pk5nmc.js";
|
|
52
|
-
import {
|
|
53
|
-
clamp012,
|
|
54
|
-
hsvToRgb2,
|
|
55
|
-
rgbToHsv2,
|
|
56
|
-
rgbToHsl2,
|
|
57
|
-
hslToRgb2,
|
|
58
|
-
rgbToOklch2,
|
|
59
|
-
oklchToRgb2,
|
|
60
|
-
rgbToHexStr2,
|
|
61
|
-
parseColor2,
|
|
62
|
-
resolveCssColor2,
|
|
63
|
-
buildParsed2,
|
|
64
|
-
formatValueByFormat2
|
|
65
|
-
} from "./components-26snnbs9.js";
|
|
66
|
-
|
|
67
|
-
// components/inputs/color-picker/index.tsx
|
|
68
|
-
import { Menu } from "@base-ui/react/menu";
|
|
69
|
-
import { NumberField } from "@base-ui/react/number-field";
|
|
70
|
-
import { Popover } from "@base-ui/react/popover";
|
|
71
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
72
|
-
import {
|
|
73
|
-
createContext,
|
|
74
|
-
forwardRef,
|
|
75
|
-
useCallback,
|
|
76
|
-
useContext,
|
|
77
|
-
useEffect,
|
|
78
|
-
useMemo,
|
|
79
|
-
useRef,
|
|
80
|
-
useState
|
|
81
|
-
} from "react";
|
|
82
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
83
|
-
var ColorPickerPortalContainerContext = createContext(null);
|
|
84
|
-
function ColorPickerPortalContainer2({ value, children }) {
|
|
85
|
-
return /* @__PURE__ */ jsx(ColorPickerPortalContainerContext.Provider, {
|
|
86
|
-
value,
|
|
87
|
-
children
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
var PanelSurfaceContext = createContext(true);
|
|
91
|
-
var PANEL_WIDTH = 280;
|
|
92
|
-
var SQUARE_HEIGHT = 156;
|
|
93
|
-
var CHECKER_BG = {
|
|
94
|
-
backgroundImage: "conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%, var(--checker-a) 0 75%, var(--checker-b) 0)",
|
|
95
|
-
backgroundSize: "8px 8px"
|
|
96
|
-
};
|
|
97
|
-
function SaturationSquare({ h, s, v, onChange }) {
|
|
98
|
-
const ref = useRef(null);
|
|
99
|
-
const [dragging, setDragging] = useState(false);
|
|
100
|
-
const hasMoved = useRef(false);
|
|
101
|
-
const [focused, setFocused] = useState(false);
|
|
102
|
-
const [hovered, setHovered] = useState(false);
|
|
103
|
-
const [cursorPos, setCursorPos] = useState(null);
|
|
104
|
-
const shape = useShape2();
|
|
105
|
-
const updateFromPointer = useCallback((clientX, clientY) => {
|
|
106
|
-
const rect = ref.current?.getBoundingClientRect();
|
|
107
|
-
if (!rect)
|
|
108
|
-
return;
|
|
109
|
-
const x = clamp012((clientX - rect.left) / rect.width);
|
|
110
|
-
const y = clamp012((clientY - rect.top) / rect.height);
|
|
111
|
-
onChange(x, 1 - y);
|
|
112
|
-
}, [onChange]);
|
|
113
|
-
const updateCursorPos = useCallback((clientX, clientY) => {
|
|
114
|
-
const rect = ref.current?.getBoundingClientRect();
|
|
115
|
-
if (!rect)
|
|
116
|
-
return;
|
|
117
|
-
setCursorPos({
|
|
118
|
-
x: clamp012((clientX - rect.left) / rect.width) * 100,
|
|
119
|
-
y: clamp012((clientY - rect.top) / rect.height) * 100
|
|
120
|
-
});
|
|
121
|
-
}, []);
|
|
122
|
-
const onPointerDown = useCallback((e) => {
|
|
123
|
-
if (e.pointerType === "mouse" && e.button !== 0)
|
|
124
|
-
return;
|
|
125
|
-
e.preventDefault();
|
|
126
|
-
setDragging(true);
|
|
127
|
-
hasMoved.current = false;
|
|
128
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
129
|
-
updateFromPointer(e.clientX, e.clientY);
|
|
130
|
-
}, [updateFromPointer]);
|
|
131
|
-
const onPointerMove = useCallback((e) => {
|
|
132
|
-
updateCursorPos(e.clientX, e.clientY);
|
|
133
|
-
if (!dragging)
|
|
134
|
-
return;
|
|
135
|
-
hasMoved.current = true;
|
|
136
|
-
updateFromPointer(e.clientX, e.clientY);
|
|
137
|
-
}, [dragging, updateFromPointer, updateCursorPos]);
|
|
138
|
-
const onPointerUp = useCallback(() => {
|
|
139
|
-
setDragging(false);
|
|
140
|
-
hasMoved.current = false;
|
|
141
|
-
}, []);
|
|
142
|
-
const onKeyDown = useCallback((e) => {
|
|
143
|
-
const step = e.shiftKey ? 0.1 : 0.01;
|
|
144
|
-
let nextS = s, nextV = v, handled = true;
|
|
145
|
-
if (e.key === "ArrowLeft")
|
|
146
|
-
nextS = clamp012(s - step);
|
|
147
|
-
else if (e.key === "ArrowRight")
|
|
148
|
-
nextS = clamp012(s + step);
|
|
149
|
-
else if (e.key === "ArrowUp")
|
|
150
|
-
nextV = clamp012(v + step);
|
|
151
|
-
else if (e.key === "ArrowDown")
|
|
152
|
-
nextV = clamp012(v - step);
|
|
153
|
-
else
|
|
154
|
-
handled = false;
|
|
155
|
-
if (handled) {
|
|
156
|
-
e.preventDefault();
|
|
157
|
-
onChange(nextS, nextV);
|
|
158
|
-
}
|
|
159
|
-
}, [onChange, s, v]);
|
|
160
|
-
const { r, g, b } = hsvToRgb2(h, s, v);
|
|
161
|
-
const thumbColor = `rgb(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)})`;
|
|
162
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
163
|
-
ref,
|
|
164
|
-
role: "application",
|
|
165
|
-
"aria-label": "Saturation and brightness",
|
|
166
|
-
tabIndex: 0,
|
|
167
|
-
onFocus: (e) => {
|
|
168
|
-
if (e.currentTarget.matches(":focus-visible"))
|
|
169
|
-
setFocused(true);
|
|
170
|
-
},
|
|
171
|
-
onBlur: () => setFocused(false),
|
|
172
|
-
onPointerEnter: () => setHovered(true),
|
|
173
|
-
onPointerLeave: () => {
|
|
174
|
-
setHovered(false);
|
|
175
|
-
setCursorPos(null);
|
|
176
|
-
},
|
|
177
|
-
onPointerDown,
|
|
178
|
-
onPointerMove,
|
|
179
|
-
onPointerUp,
|
|
180
|
-
onKeyDown,
|
|
181
|
-
className: cn2("relative w-full select-none touch-none cursor-none outline-none", focused && "ring-2 ring-focus-ring", shape.bg),
|
|
182
|
-
style: {
|
|
183
|
-
height: SQUARE_HEIGHT
|
|
184
|
-
},
|
|
185
|
-
children: [
|
|
186
|
-
/* @__PURE__ */ jsx("div", {
|
|
187
|
-
className: cn2("absolute inset-0 overflow-hidden", shape.bg === "rounded-[20px]" ? "rounded-2xl" : shape.bg),
|
|
188
|
-
style: {
|
|
189
|
-
background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${h}, 100%, 50%))`
|
|
190
|
-
}
|
|
191
|
-
}),
|
|
192
|
-
/* @__PURE__ */ jsx(motion.div, {
|
|
193
|
-
className: "absolute pointer-events-none rounded-full border border-thumb shadow-picker-thumb",
|
|
194
|
-
initial: false,
|
|
195
|
-
animate: {
|
|
196
|
-
left: `${s * 100}%`,
|
|
197
|
-
top: `${(1 - v) * 100}%`,
|
|
198
|
-
width: 18,
|
|
199
|
-
height: 18
|
|
200
|
-
},
|
|
201
|
-
transition: { duration: 0 },
|
|
202
|
-
style: {
|
|
203
|
-
transform: "translate(-50%, -50%)",
|
|
204
|
-
backgroundColor: thumbColor
|
|
205
|
-
}
|
|
206
|
-
}),
|
|
207
|
-
hovered && !dragging && cursorPos && /* @__PURE__ */ jsx("div", {
|
|
208
|
-
className: "absolute pointer-events-none rounded-full border-2 border-picker-ring shadow-picker-cursor",
|
|
209
|
-
style: {
|
|
210
|
-
left: `${cursorPos.x}%`,
|
|
211
|
-
top: `${cursorPos.y}%`,
|
|
212
|
-
width: 18,
|
|
213
|
-
height: 18,
|
|
214
|
-
transform: "translate(-50%, -50%)"
|
|
215
|
-
}
|
|
216
|
-
})
|
|
217
|
-
]
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
function HueSlider({ h, onChange }) {
|
|
221
|
-
const hueColor = `hsl(${h}, 100%, 50%)`;
|
|
222
|
-
return /* @__PURE__ */ jsx(Slider2, {
|
|
223
|
-
value: h,
|
|
224
|
-
onChange: (v) => onChange(typeof v === "number" ? v : v[0] ?? 0),
|
|
225
|
-
min: 0,
|
|
226
|
-
max: 360,
|
|
227
|
-
step: 1,
|
|
228
|
-
showValue: false,
|
|
229
|
-
hideFill: true,
|
|
230
|
-
thumbColor: hueColor,
|
|
231
|
-
thumbBorderColor: "var(--picker-thumb-border)",
|
|
232
|
-
trackStyle: {
|
|
233
|
-
background: "linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))",
|
|
234
|
-
borderColor: "transparent"
|
|
235
|
-
},
|
|
236
|
-
"aria-label": "Hue"
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
function AlphaSlider({
|
|
240
|
-
a,
|
|
241
|
-
solidColor,
|
|
242
|
-
solidR,
|
|
243
|
-
solidG,
|
|
244
|
-
solidB,
|
|
245
|
-
onChange
|
|
246
|
-
}) {
|
|
247
|
-
const transparentColor = `rgba(${solidR}, ${solidG}, ${solidB}, 0)`;
|
|
248
|
-
return /* @__PURE__ */ jsx(Slider2, {
|
|
249
|
-
value: Math.round(a * 100),
|
|
250
|
-
onChange: (v) => onChange((typeof v === "number" ? v : v[0] ?? 0) / 100),
|
|
251
|
-
min: 0,
|
|
252
|
-
max: 100,
|
|
253
|
-
step: 1,
|
|
254
|
-
showValue: false,
|
|
255
|
-
hideFill: true,
|
|
256
|
-
thumbColor: solidColor,
|
|
257
|
-
thumbBorderColor: "var(--picker-thumb-border)",
|
|
258
|
-
trackStyle: {
|
|
259
|
-
backgroundImage: `linear-gradient(to right, ${transparentColor} 0%, ${solidColor} 98%), conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%, var(--checker-a) 0 75%, var(--checker-b) 0)`,
|
|
260
|
-
backgroundSize: "100% 100%, 8px 8px",
|
|
261
|
-
borderWidth: 0
|
|
262
|
-
},
|
|
263
|
-
"aria-label": "Alpha"
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
var FORMAT_LABELS = {
|
|
267
|
-
hex: "HEX",
|
|
268
|
-
rgb: "RGB",
|
|
269
|
-
hsl: "HSL",
|
|
270
|
-
oklch: "OKLCH"
|
|
271
|
-
};
|
|
272
|
-
var FORMATS = ["hex", "rgb", "hsl", "oklch"];
|
|
273
|
-
var menuShape = shapeMap2.rounded;
|
|
274
|
-
var FormatMenuContext = createContext(null);
|
|
275
|
-
function FormatItem({
|
|
276
|
-
index,
|
|
277
|
-
value,
|
|
278
|
-
label,
|
|
279
|
-
checked
|
|
280
|
-
}) {
|
|
281
|
-
const ref = useRef(null);
|
|
282
|
-
const menuCtx = useContext(FormatMenuContext);
|
|
283
|
-
const shape = useShape2();
|
|
284
|
-
const sizeClasses = useSize2();
|
|
285
|
-
const compact = sizeClasses.variant === "compact";
|
|
286
|
-
useRegisterFluidHoverItem2(menuCtx?.registerItem, index, ref);
|
|
287
|
-
const isActive = menuCtx?.activeIndex === index;
|
|
288
|
-
return /* @__PURE__ */ jsx(Menu.RadioItem, {
|
|
289
|
-
value,
|
|
290
|
-
label,
|
|
291
|
-
closeOnClick: true,
|
|
292
|
-
render: /* @__PURE__ */ jsx("div", {
|
|
293
|
-
ref,
|
|
294
|
-
"data-fluid-hover-index": index,
|
|
295
|
-
className: cn2("relative z-10 flex items-center cursor-pointer outline-none", compact ? "px-2.5 py-1.5" : "px-3 py-2", sizeClasses.text, shape.item)
|
|
296
|
-
}),
|
|
297
|
-
children: /* @__PURE__ */ jsxs("span", {
|
|
298
|
-
className: "inline-grid",
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ jsx("span", {
|
|
301
|
-
className: "col-start-1 row-start-1 invisible weight-semibold",
|
|
302
|
-
"aria-hidden": "true",
|
|
303
|
-
children: label
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ jsx("span", {
|
|
306
|
-
className: cn2("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-fast", isActive || checked ? "text-foreground" : "text-muted-foreground", checked ? "weight-semibold" : "weight-normal"),
|
|
307
|
-
children: label
|
|
308
|
-
})
|
|
309
|
-
]
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
function FormatDropdown({
|
|
314
|
-
value,
|
|
315
|
-
onChange,
|
|
316
|
-
open: openProp,
|
|
317
|
-
defaultOpen = false
|
|
318
|
-
}) {
|
|
319
|
-
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
320
|
-
const isControlled = openProp !== undefined;
|
|
321
|
-
const open = isControlled ? openProp : internalOpen;
|
|
322
|
-
const { origin, capture } = useMorphOrigin2();
|
|
323
|
-
const morph = useMorph2(open, origin, { tier: "moderate" });
|
|
324
|
-
const level = Math.min(useSurface2() + 2, 8);
|
|
325
|
-
const shape = useShape2();
|
|
326
|
-
const sizeClasses = useSize2();
|
|
327
|
-
const portalContainer = useContext(ColorPickerPortalContainerContext);
|
|
328
|
-
const containerRef = useRef(null);
|
|
329
|
-
const ChevronDownIcon = useIcon2("chevron-down");
|
|
330
|
-
const hover = useFluidHover2(containerRef);
|
|
331
|
-
const { activeIndex, setActiveIndex, itemRects, handlers, registerItem, remeasure } = hover;
|
|
332
|
-
const [focusedIndex, setFocusedIndex] = useState(null);
|
|
333
|
-
useEffect(() => {
|
|
334
|
-
if (!open)
|
|
335
|
-
return;
|
|
336
|
-
remeasure();
|
|
337
|
-
}, [open, remeasure]);
|
|
338
|
-
const checkedIndex = FORMATS.indexOf(value);
|
|
339
|
-
const checkedRect = checkedIndex !== -1 ? itemRects[checkedIndex] ?? null : null;
|
|
340
|
-
const focusRect = focusedIndex !== null ? itemRects[focusedIndex] ?? null : null;
|
|
341
|
-
const menuCtx = useMemo(() => ({ registerItem, activeIndex, checkedIndex }), [registerItem, activeIndex, checkedIndex]);
|
|
342
|
-
return /* @__PURE__ */ jsxs(Menu.Root, {
|
|
343
|
-
open,
|
|
344
|
-
onOpenChange: (next, details) => {
|
|
345
|
-
if (next)
|
|
346
|
-
capture(details);
|
|
347
|
-
if (!isControlled)
|
|
348
|
-
setInternalOpen(next);
|
|
349
|
-
},
|
|
350
|
-
modal: false,
|
|
351
|
-
children: [
|
|
352
|
-
/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
353
|
-
className: cn2("flex items-center justify-between bg-transparent hover:bg-hover hover:text-foreground transition-colors duration-fast outline-none focus-visible:ring-1 focus-visible:ring-focus-ring cursor-pointer", sizeClasses.gap, sizeClasses.control, sizeClasses.px, sizeClasses.text, open ? "bg-active text-foreground" : "text-muted-foreground active:bg-active", shape.input, "weight-medium"),
|
|
354
|
-
children: [
|
|
355
|
-
/* @__PURE__ */ jsx("span", {
|
|
356
|
-
children: FORMAT_LABELS[value]
|
|
357
|
-
}),
|
|
358
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
359
|
-
size: 14,
|
|
360
|
-
strokeWidth: 1.5,
|
|
361
|
-
className: cn2("text-muted-foreground transition-transform duration-150", open && "rotate-180")
|
|
362
|
-
})
|
|
363
|
-
]
|
|
364
|
-
}),
|
|
365
|
-
/* @__PURE__ */ jsx(Menu.Portal, {
|
|
366
|
-
container: portalContainer ?? undefined,
|
|
367
|
-
children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
368
|
-
side: "bottom",
|
|
369
|
-
align: "start",
|
|
370
|
-
sideOffset: 6,
|
|
371
|
-
className: "z-[60] outline-none",
|
|
372
|
-
children: /* @__PURE__ */ jsx(FormatMenuContext.Provider, {
|
|
373
|
-
value: menuCtx,
|
|
374
|
-
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
375
|
-
ref: morph.popupRef,
|
|
376
|
-
onMouseEnter: () => {
|
|
377
|
-
handlers.onMouseEnter();
|
|
378
|
-
setFocusedIndex(null);
|
|
379
|
-
},
|
|
380
|
-
onMouseMove: handlers.onMouseMove,
|
|
381
|
-
onMouseLeave: handlers.onMouseLeave,
|
|
382
|
-
onClick: handlers.onClick,
|
|
383
|
-
onFocus: (e) => {
|
|
384
|
-
const indexAttr = e.target.closest("[data-fluid-hover-index]")?.getAttribute("data-fluid-hover-index");
|
|
385
|
-
if (indexAttr != null) {
|
|
386
|
-
const idx = Number(indexAttr);
|
|
387
|
-
setActiveIndex(idx);
|
|
388
|
-
setFocusedIndex(e.target.matches(":focus-visible") ? idx : null);
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
onBlur: (e) => {
|
|
392
|
-
if (e.currentTarget.contains(e.relatedTarget))
|
|
393
|
-
return;
|
|
394
|
-
setFocusedIndex(null);
|
|
395
|
-
setActiveIndex(null);
|
|
396
|
-
},
|
|
397
|
-
className: "relative select-none outline-none",
|
|
398
|
-
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
399
|
-
value: level,
|
|
400
|
-
children: /* @__PURE__ */ jsx(MorphSurface2, {
|
|
401
|
-
morph,
|
|
402
|
-
bg: SURFACE_BG2[level],
|
|
403
|
-
shadow: SURFACE_SHADOW2[3],
|
|
404
|
-
radius: menuShape.container,
|
|
405
|
-
className: "min-w-[var(--anchor-width)]",
|
|
406
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
407
|
-
ref: containerRef,
|
|
408
|
-
className: "relative flex flex-col p-1",
|
|
409
|
-
children: [
|
|
410
|
-
/* @__PURE__ */ jsx(AnimatePresence, {
|
|
411
|
-
children: checkedRect && /* @__PURE__ */ jsx(motion.div, {
|
|
412
|
-
className: `absolute ${menuShape.bg} bg-active pointer-events-none`,
|
|
413
|
-
initial: false,
|
|
414
|
-
animate: {
|
|
415
|
-
top: checkedRect.top,
|
|
416
|
-
left: checkedRect.left,
|
|
417
|
-
width: checkedRect.width,
|
|
418
|
-
height: checkedRect.height,
|
|
419
|
-
opacity: 1
|
|
420
|
-
},
|
|
421
|
-
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
422
|
-
transition: {
|
|
423
|
-
...spring2.moderate,
|
|
424
|
-
opacity: { duration: spring2.fast.duration }
|
|
425
|
-
}
|
|
426
|
-
})
|
|
427
|
-
}),
|
|
428
|
-
/* @__PURE__ */ jsx(FluidHoverHighlight2, {
|
|
429
|
-
hover,
|
|
430
|
-
from: checkedRect,
|
|
431
|
-
className: menuShape.bg
|
|
432
|
-
}),
|
|
433
|
-
/* @__PURE__ */ jsx(AnimatePresence, {
|
|
434
|
-
children: focusRect && /* @__PURE__ */ jsx(motion.div, {
|
|
435
|
-
className: `absolute ${menuShape.focusRing} pointer-events-none z-20 border border-focus-ring`,
|
|
436
|
-
initial: false,
|
|
437
|
-
animate: {
|
|
438
|
-
left: focusRect.left - 2,
|
|
439
|
-
top: focusRect.top - 2,
|
|
440
|
-
width: focusRect.width + 4,
|
|
441
|
-
height: focusRect.height + 4
|
|
442
|
-
},
|
|
443
|
-
exit: { opacity: 0, transition: spring2.fast.exit },
|
|
444
|
-
transition: {
|
|
445
|
-
...spring2.fast,
|
|
446
|
-
opacity: { duration: spring2.fast.duration }
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
}),
|
|
450
|
-
/* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
451
|
-
value,
|
|
452
|
-
onValueChange: (next) => onChange(next),
|
|
453
|
-
className: "contents",
|
|
454
|
-
children: FORMATS.map((fmt, i) => /* @__PURE__ */ jsx(FormatItem, {
|
|
455
|
-
index: i,
|
|
456
|
-
value: fmt,
|
|
457
|
-
label: FORMAT_LABELS[fmt],
|
|
458
|
-
checked: value === fmt
|
|
459
|
-
}, fmt))
|
|
460
|
-
})
|
|
461
|
-
]
|
|
462
|
-
})
|
|
463
|
-
})
|
|
464
|
-
})
|
|
465
|
-
})
|
|
466
|
-
})
|
|
467
|
-
})
|
|
468
|
-
})
|
|
469
|
-
]
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
var TextColorInput = forwardRef(({
|
|
473
|
-
value,
|
|
474
|
-
onCommit,
|
|
475
|
-
ariaLabel,
|
|
476
|
-
width,
|
|
477
|
-
className,
|
|
478
|
-
inputClassName,
|
|
479
|
-
align = "left",
|
|
480
|
-
prefix,
|
|
481
|
-
inputMode = "text",
|
|
482
|
-
nudgeStep,
|
|
483
|
-
nudgeShiftStep,
|
|
484
|
-
hasPercent = false,
|
|
485
|
-
decimals,
|
|
486
|
-
min,
|
|
487
|
-
max,
|
|
488
|
-
wrap = false
|
|
489
|
-
}, ref) => {
|
|
490
|
-
const [draft, setDraft] = useState(value);
|
|
491
|
-
const interactingRef = useRef(false);
|
|
492
|
-
const shape = useShape2();
|
|
493
|
-
const sizeClasses = useSize2();
|
|
494
|
-
const compact = sizeClasses.variant === "compact";
|
|
495
|
-
useEffect(() => {
|
|
496
|
-
if (!interactingRef.current)
|
|
497
|
-
setDraft(value);
|
|
498
|
-
}, [value]);
|
|
499
|
-
const formatNumber = (n) => decimals != null ? n.toFixed(decimals) : String(Math.round(n));
|
|
500
|
-
const commitNumber = (n) => {
|
|
501
|
-
let bounded = n;
|
|
502
|
-
if (wrap && min != null && max != null) {
|
|
503
|
-
const range = max - min;
|
|
504
|
-
bounded = ((bounded - min) % range + range) % range + min;
|
|
505
|
-
} else {
|
|
506
|
-
if (min != null)
|
|
507
|
-
bounded = Math.max(min, bounded);
|
|
508
|
-
if (max != null)
|
|
509
|
-
bounded = Math.min(max, bounded);
|
|
510
|
-
}
|
|
511
|
-
const formatted = formatNumber(bounded);
|
|
512
|
-
const withSuffix = hasPercent ? `${formatted}%` : formatted;
|
|
513
|
-
setDraft(withSuffix);
|
|
514
|
-
onCommit(withSuffix);
|
|
515
|
-
};
|
|
516
|
-
const nudge = (direction, shift) => {
|
|
517
|
-
const baseStep = shift ? nudgeShiftStep ?? 10 : nudgeStep ?? 1;
|
|
518
|
-
const cur = parseFloat(draft.replace("%", ""));
|
|
519
|
-
if (Number.isNaN(cur))
|
|
520
|
-
return;
|
|
521
|
-
commitNumber(cur + direction * baseStep);
|
|
522
|
-
};
|
|
523
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
524
|
-
className: cn2("flex items-center px-2 bg-transparent hover:bg-hover active:bg-active transition-colors duration-fast focus-within:ring-1 focus-within:ring-focus-ring select-none", sizeClasses.control, shape.input, className),
|
|
525
|
-
style: { width },
|
|
526
|
-
children: [
|
|
527
|
-
prefix && /* @__PURE__ */ jsx("span", {
|
|
528
|
-
className: cn2("text-muted-foreground mr-1 select-none", compact ? "text-caption-compact" : "text-caption"),
|
|
529
|
-
children: prefix
|
|
530
|
-
}),
|
|
531
|
-
/* @__PURE__ */ jsx("input", {
|
|
532
|
-
ref,
|
|
533
|
-
value: draft,
|
|
534
|
-
onChange: (e) => setDraft(e.target.value),
|
|
535
|
-
onFocus: (e) => {
|
|
536
|
-
interactingRef.current = true;
|
|
537
|
-
e.currentTarget.select();
|
|
538
|
-
},
|
|
539
|
-
onBlur: () => {
|
|
540
|
-
interactingRef.current = false;
|
|
541
|
-
if (draft !== value) {
|
|
542
|
-
const numeric = parseFloat(draft.replace("%", ""));
|
|
543
|
-
if (!Number.isNaN(numeric) && (min != null || max != null)) {
|
|
544
|
-
commitNumber(numeric);
|
|
545
|
-
} else {
|
|
546
|
-
onCommit(draft);
|
|
547
|
-
}
|
|
548
|
-
} else
|
|
549
|
-
setDraft(value);
|
|
550
|
-
},
|
|
551
|
-
onKeyDown: (e) => {
|
|
552
|
-
if (e.key === "Enter") {
|
|
553
|
-
e.currentTarget.blur();
|
|
554
|
-
} else if (e.key === "Escape") {
|
|
555
|
-
setDraft(value);
|
|
556
|
-
e.currentTarget.blur();
|
|
557
|
-
} else if ((nudgeStep != null || nudgeShiftStep != null) && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
558
|
-
e.preventDefault();
|
|
559
|
-
nudge(e.key === "ArrowUp" ? 1 : -1, e.shiftKey);
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
inputMode,
|
|
563
|
-
"aria-label": ariaLabel,
|
|
564
|
-
className: cn2("flex-1 min-w-0 bg-transparent text-foreground outline-none tabular-nums", sizeClasses.text, align === "center" && "text-center", align === "right" && "text-right", "weight-medium", inputClassName)
|
|
565
|
-
})
|
|
566
|
-
]
|
|
567
|
-
});
|
|
568
|
-
});
|
|
569
|
-
TextColorInput.displayName = "TextColorInput";
|
|
570
|
-
var ScrubColorInput = forwardRef(({
|
|
571
|
-
value,
|
|
572
|
-
onCommit,
|
|
573
|
-
ariaLabel,
|
|
574
|
-
width,
|
|
575
|
-
className,
|
|
576
|
-
inputClassName,
|
|
577
|
-
align = "left",
|
|
578
|
-
prefix,
|
|
579
|
-
inputMode = "numeric",
|
|
580
|
-
nudgeStep,
|
|
581
|
-
nudgeShiftStep,
|
|
582
|
-
hasPercent = false,
|
|
583
|
-
decimals,
|
|
584
|
-
min,
|
|
585
|
-
max,
|
|
586
|
-
wrap = false
|
|
587
|
-
}, ref) => {
|
|
588
|
-
const shape = useShape2();
|
|
589
|
-
const sizeClasses = useSize2();
|
|
590
|
-
const compact = sizeClasses.variant === "compact";
|
|
591
|
-
const inputRef = useRef(null);
|
|
592
|
-
const [editing, setEditing] = useState(false);
|
|
593
|
-
const pointerDownRef = useRef(false);
|
|
594
|
-
const numeric = parseFloat(String(value).replace("%", ""));
|
|
595
|
-
const fieldValue = Number.isNaN(numeric) ? null : numeric;
|
|
596
|
-
const format = useMemo(() => {
|
|
597
|
-
const f = { useGrouping: false };
|
|
598
|
-
if (decimals != null) {
|
|
599
|
-
f.minimumFractionDigits = decimals;
|
|
600
|
-
f.maximumFractionDigits = decimals;
|
|
601
|
-
} else {
|
|
602
|
-
f.maximumFractionDigits = 0;
|
|
603
|
-
}
|
|
604
|
-
if (hasPercent) {
|
|
605
|
-
f.style = "unit";
|
|
606
|
-
f.unit = "percent";
|
|
607
|
-
}
|
|
608
|
-
return f;
|
|
609
|
-
}, [decimals, hasPercent]);
|
|
610
|
-
const setInputRef = useCallback((node) => {
|
|
611
|
-
inputRef.current = node;
|
|
612
|
-
if (typeof ref === "function")
|
|
613
|
-
ref(node);
|
|
614
|
-
else if (ref)
|
|
615
|
-
ref.current = node;
|
|
616
|
-
}, [ref]);
|
|
617
|
-
const commit = useCallback((n) => {
|
|
618
|
-
let bounded = n;
|
|
619
|
-
if (wrap && min != null && max != null) {
|
|
620
|
-
if (bounded < min || bounded > max) {
|
|
621
|
-
const range = max - min;
|
|
622
|
-
bounded = ((bounded - min) % range + range) % range + min;
|
|
623
|
-
}
|
|
624
|
-
} else {
|
|
625
|
-
if (min != null)
|
|
626
|
-
bounded = Math.max(min, bounded);
|
|
627
|
-
if (max != null)
|
|
628
|
-
bounded = Math.min(max, bounded);
|
|
629
|
-
}
|
|
630
|
-
const formatted = decimals != null ? bounded.toFixed(decimals) : String(Math.round(bounded));
|
|
631
|
-
onCommit(hasPercent ? `${formatted}%` : formatted);
|
|
632
|
-
}, [wrap, min, max, decimals, hasPercent, onCommit]);
|
|
633
|
-
return /* @__PURE__ */ jsx(NumberField.Root, {
|
|
634
|
-
value: fieldValue,
|
|
635
|
-
onValueChange: (next, eventDetails) => {
|
|
636
|
-
if (next == null)
|
|
637
|
-
return;
|
|
638
|
-
const reason = eventDetails.reason;
|
|
639
|
-
if (reason === "input-change" || reason === "input-paste" || reason === "input-clear") {
|
|
640
|
-
return;
|
|
641
|
-
}
|
|
642
|
-
commit(next);
|
|
643
|
-
},
|
|
644
|
-
onValueCommitted: (_, eventDetails) => {
|
|
645
|
-
if (eventDetails.reason === "scrub") {
|
|
646
|
-
pointerDownRef.current = false;
|
|
647
|
-
inputRef.current?.blur();
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
|
-
min: wrap ? undefined : min,
|
|
651
|
-
max: wrap ? undefined : max,
|
|
652
|
-
step: nudgeStep ?? 1,
|
|
653
|
-
largeStep: nudgeShiftStep ?? 10,
|
|
654
|
-
format,
|
|
655
|
-
className: cn2("flex items-center bg-transparent hover:bg-hover active:bg-active transition-colors duration-fast focus-within:ring-1 focus-within:ring-focus-ring select-none", sizeClasses.control, shape.input, className),
|
|
656
|
-
style: { width },
|
|
657
|
-
children: /* @__PURE__ */ jsxs(NumberField.ScrubArea, {
|
|
658
|
-
direction: "horizontal",
|
|
659
|
-
pixelSensitivity: 1,
|
|
660
|
-
onPointerDownCapture: () => {
|
|
661
|
-
pointerDownRef.current = true;
|
|
662
|
-
},
|
|
663
|
-
onClick: () => {
|
|
664
|
-
pointerDownRef.current = false;
|
|
665
|
-
setEditing(true);
|
|
666
|
-
inputRef.current?.focus();
|
|
667
|
-
inputRef.current?.select();
|
|
668
|
-
},
|
|
669
|
-
className: cn2("flex flex-1 min-w-0 items-center self-stretch px-2", !editing && "cursor-ew-resize"),
|
|
670
|
-
children: [
|
|
671
|
-
/* @__PURE__ */ jsx(NumberField.ScrubAreaCursor, {
|
|
672
|
-
className: "drop-shadow-picker-cursor",
|
|
673
|
-
children: /* @__PURE__ */ jsx("svg", {
|
|
674
|
-
width: 24,
|
|
675
|
-
height: 14,
|
|
676
|
-
viewBox: "0 0 24 14",
|
|
677
|
-
className: "fill-picker-edge stroke-thumb",
|
|
678
|
-
strokeWidth: 1,
|
|
679
|
-
"aria-hidden": "true",
|
|
680
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
681
|
-
d: "M0.5 7l5-5v3.5h13V2l5 5-5 5V8.5h-13V12l-5-5z"
|
|
682
|
-
})
|
|
683
|
-
})
|
|
684
|
-
}),
|
|
685
|
-
prefix && /* @__PURE__ */ jsx("span", {
|
|
686
|
-
className: cn2("text-muted-foreground mr-1 select-none", compact ? "text-caption-compact" : "text-caption"),
|
|
687
|
-
children: prefix
|
|
688
|
-
}),
|
|
689
|
-
/* @__PURE__ */ jsx(NumberField.Input, {
|
|
690
|
-
ref: setInputRef,
|
|
691
|
-
"aria-label": ariaLabel,
|
|
692
|
-
inputMode,
|
|
693
|
-
onPointerDown: (e) => {
|
|
694
|
-
if (editing)
|
|
695
|
-
e.stopPropagation();
|
|
696
|
-
},
|
|
697
|
-
onFocus: (e) => {
|
|
698
|
-
if (pointerDownRef.current)
|
|
699
|
-
return;
|
|
700
|
-
setEditing(true);
|
|
701
|
-
e.currentTarget.select();
|
|
702
|
-
},
|
|
703
|
-
onBlur: () => {
|
|
704
|
-
setEditing(false);
|
|
705
|
-
},
|
|
706
|
-
onKeyDown: (e) => {
|
|
707
|
-
if (e.key === "Enter") {
|
|
708
|
-
e.currentTarget.blur();
|
|
709
|
-
} else if (e.key === "Escape") {
|
|
710
|
-
const input = e.currentTarget;
|
|
711
|
-
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
712
|
-
if (setter && fieldValue != null) {
|
|
713
|
-
const restored = decimals != null ? fieldValue.toFixed(decimals) : String(Math.round(fieldValue));
|
|
714
|
-
setter.call(input, hasPercent ? `${restored}%` : restored);
|
|
715
|
-
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
716
|
-
}
|
|
717
|
-
input.blur();
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
className: cn2("flex-1 min-w-0 bg-transparent text-foreground outline-none tabular-nums", sizeClasses.text, align === "center" && "text-center", align === "right" && "text-right", !editing && "pointer-events-none", "weight-medium", inputClassName)
|
|
721
|
-
})
|
|
722
|
-
]
|
|
723
|
-
})
|
|
724
|
-
});
|
|
725
|
-
});
|
|
726
|
-
ScrubColorInput.displayName = "ScrubColorInput";
|
|
727
|
-
var ColorInput = forwardRef(({ scrubbable = false, ...props }, ref) => scrubbable ? /* @__PURE__ */ jsx(ScrubColorInput, {
|
|
728
|
-
ref,
|
|
729
|
-
...props
|
|
730
|
-
}) : /* @__PURE__ */ jsx(TextColorInput, {
|
|
731
|
-
ref,
|
|
732
|
-
...props
|
|
733
|
-
}));
|
|
734
|
-
ColorInput.displayName = "ColorInput";
|
|
735
|
-
function EyeDropperButton({ onPick }) {
|
|
736
|
-
const [supported, setSupported] = useState(false);
|
|
737
|
-
const shape = useShape2();
|
|
738
|
-
const sizeClasses = useSize2();
|
|
739
|
-
const PipetteIcon = useIcon2("pipette");
|
|
740
|
-
useEffect(() => {
|
|
741
|
-
setSupported(typeof window !== "undefined" && "EyeDropper" in window);
|
|
742
|
-
}, []);
|
|
743
|
-
if (!supported)
|
|
744
|
-
return null;
|
|
745
|
-
const handleClick = async () => {
|
|
746
|
-
try {
|
|
747
|
-
const Ctor = window.EyeDropper;
|
|
748
|
-
const eye = new Ctor;
|
|
749
|
-
const result = await eye.open();
|
|
750
|
-
onPick(result.sRGBHex);
|
|
751
|
-
} catch {}
|
|
752
|
-
};
|
|
753
|
-
return /* @__PURE__ */ jsx("button", {
|
|
754
|
-
type: "button",
|
|
755
|
-
onClick: handleClick,
|
|
756
|
-
"aria-label": "Pick color from screen",
|
|
757
|
-
className: cn2("flex items-center justify-center text-muted-foreground bg-transparent hover:bg-hover hover:text-foreground active:bg-active transition-colors duration-fast outline-none focus-visible:ring-1 focus-visible:ring-focus-ring cursor-pointer", sizeClasses.control, sizeClasses.px, shape.input),
|
|
758
|
-
children: /* @__PURE__ */ jsx(PipetteIcon, {
|
|
759
|
-
size: sizeClasses.icon,
|
|
760
|
-
strokeWidth: 1.5
|
|
761
|
-
})
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
function ColorTile2({ color, size = 24, className, style }) {
|
|
765
|
-
const shape = useShape2();
|
|
766
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
767
|
-
className: cn2("inline-block relative shrink-0 overflow-hidden shadow-swatch", shape.bg, className),
|
|
768
|
-
style: {
|
|
769
|
-
width: size,
|
|
770
|
-
height: size,
|
|
771
|
-
...CHECKER_BG,
|
|
772
|
-
...style
|
|
773
|
-
},
|
|
774
|
-
children: [
|
|
775
|
-
/* @__PURE__ */ jsx("span", {
|
|
776
|
-
className: "absolute inset-0",
|
|
777
|
-
style: { backgroundColor: color }
|
|
778
|
-
}),
|
|
779
|
-
/* @__PURE__ */ jsx("span", {
|
|
780
|
-
"aria-hidden": true,
|
|
781
|
-
className: cn2("absolute inset-0 pointer-events-none shadow-swatch", shape.bg)
|
|
782
|
-
})
|
|
783
|
-
]
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
var ColorSwatch2 = forwardRef(({ color, size = 28, selected, className, onMouseEnter, onMouseLeave, ...props }, ref) => {
|
|
787
|
-
const shape = useShape2();
|
|
788
|
-
const [hovered, setHovered] = useState(false);
|
|
789
|
-
const ring = selected ? "shadow-swatch-selected" : hovered ? "shadow-swatch-hover" : "shadow-swatch";
|
|
790
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
791
|
-
ref,
|
|
792
|
-
type: "button",
|
|
793
|
-
"aria-label": `Select color ${color}`,
|
|
794
|
-
className: cn2("relative shrink-0 overflow-hidden cursor-pointer outline-none transition-shadow duration-100", shape.bg, ring, className),
|
|
795
|
-
style: {
|
|
796
|
-
width: size,
|
|
797
|
-
height: size,
|
|
798
|
-
...CHECKER_BG
|
|
799
|
-
},
|
|
800
|
-
onMouseEnter: (e) => {
|
|
801
|
-
setHovered(true);
|
|
802
|
-
onMouseEnter?.(e);
|
|
803
|
-
},
|
|
804
|
-
onMouseLeave: (e) => {
|
|
805
|
-
setHovered(false);
|
|
806
|
-
onMouseLeave?.(e);
|
|
807
|
-
},
|
|
808
|
-
...props,
|
|
809
|
-
children: [
|
|
810
|
-
/* @__PURE__ */ jsx("span", {
|
|
811
|
-
className: "absolute inset-0",
|
|
812
|
-
style: { backgroundColor: color }
|
|
813
|
-
}),
|
|
814
|
-
/* @__PURE__ */ jsx("span", {
|
|
815
|
-
"aria-hidden": true,
|
|
816
|
-
className: cn2("absolute inset-0 pointer-events-none shadow-swatch", shape.bg)
|
|
817
|
-
})
|
|
818
|
-
]
|
|
819
|
-
});
|
|
820
|
-
});
|
|
821
|
-
ColorSwatch2.displayName = "ColorSwatch";
|
|
822
|
-
function SwatchStrip({
|
|
823
|
-
swatches,
|
|
824
|
-
current,
|
|
825
|
-
onPick
|
|
826
|
-
}) {
|
|
827
|
-
const normalizedCurrent = useMemo(() => {
|
|
828
|
-
const p = parseColor2(current);
|
|
829
|
-
return p ? rgbToHexStr2(p.r, p.g, p.b, p.a).toLowerCase() : "";
|
|
830
|
-
}, [current]);
|
|
831
|
-
const [resolvedSwatches, setResolvedSwatches] = useState({});
|
|
832
|
-
useEffect(() => {
|
|
833
|
-
const next = {};
|
|
834
|
-
for (const sw of swatches) {
|
|
835
|
-
if (!parseColor2(sw)) {
|
|
836
|
-
const p = resolveCssColor2(sw);
|
|
837
|
-
if (p)
|
|
838
|
-
next[sw] = rgbToHexStr2(p.r, p.g, p.b, p.a).toLowerCase();
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
setResolvedSwatches(next);
|
|
842
|
-
}, [swatches]);
|
|
843
|
-
return /* @__PURE__ */ jsx("div", {
|
|
844
|
-
className: "flex flex-wrap gap-2",
|
|
845
|
-
children: swatches.map((sw, i) => {
|
|
846
|
-
const parsed = parseColor2(sw);
|
|
847
|
-
const normalized = parsed ? rgbToHexStr2(parsed.r, parsed.g, parsed.b, parsed.a).toLowerCase() : resolvedSwatches[sw] ?? sw.toLowerCase();
|
|
848
|
-
const isSelected = normalized === normalizedCurrent;
|
|
849
|
-
return /* @__PURE__ */ jsx(ColorSwatch2, {
|
|
850
|
-
color: sw,
|
|
851
|
-
size: 28,
|
|
852
|
-
selected: isSelected,
|
|
853
|
-
onClick: () => onPick(sw)
|
|
854
|
-
}, `${sw}-${i}`);
|
|
855
|
-
})
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
var ColorPicker2 = forwardRef(({
|
|
859
|
-
value,
|
|
860
|
-
defaultValue = "#6B97FF",
|
|
861
|
-
onValueChange,
|
|
862
|
-
format,
|
|
863
|
-
defaultFormat = "hex",
|
|
864
|
-
onFormatChange,
|
|
865
|
-
swatches,
|
|
866
|
-
hideEyedropper,
|
|
867
|
-
formatOpen,
|
|
868
|
-
defaultFormatOpen,
|
|
869
|
-
size,
|
|
870
|
-
className,
|
|
871
|
-
...props
|
|
872
|
-
}, ref) => {
|
|
873
|
-
const isControlled = value !== undefined;
|
|
874
|
-
const [internalValue, setInternalValue] = useState(value ?? defaultValue);
|
|
875
|
-
const currentRawValue = isControlled ? value : internalValue;
|
|
876
|
-
const isFormatControlled = format !== undefined;
|
|
877
|
-
const [internalFormat, setInternalFormat] = useState(defaultFormat);
|
|
878
|
-
const currentFormat = isFormatControlled ? format : internalFormat;
|
|
879
|
-
const initialParsed = useMemo(() => {
|
|
880
|
-
const p = parseColor2(currentRawValue);
|
|
881
|
-
if (!p)
|
|
882
|
-
return { h: 0, s: 1, v: 1, a: 1 };
|
|
883
|
-
const hsv = rgbToHsv2(p.r, p.g, p.b);
|
|
884
|
-
return { h: hsv.s === 0 ? 0 : hsv.h, s: hsv.s, v: hsv.v, a: p.a };
|
|
885
|
-
}, []);
|
|
886
|
-
const [hsv, setHsv] = useState(initialParsed);
|
|
887
|
-
const oklchHueRef = useRef(null);
|
|
888
|
-
const lastEmittedRef = useRef("");
|
|
889
|
-
useEffect(() => {
|
|
890
|
-
if (!isControlled)
|
|
891
|
-
return;
|
|
892
|
-
const emitted = lastEmittedRef.current;
|
|
893
|
-
const cur = value;
|
|
894
|
-
if (cur === emitted)
|
|
895
|
-
return;
|
|
896
|
-
const p = parseColor2(cur);
|
|
897
|
-
if (!p)
|
|
898
|
-
return;
|
|
899
|
-
oklchHueRef.current = null;
|
|
900
|
-
const newHsv = rgbToHsv2(p.r, p.g, p.b);
|
|
901
|
-
setHsv((prev) => ({
|
|
902
|
-
h: newHsv.s === 0 ? prev.h : newHsv.h,
|
|
903
|
-
s: newHsv.s,
|
|
904
|
-
v: newHsv.v,
|
|
905
|
-
a: p.a
|
|
906
|
-
}));
|
|
907
|
-
}, [value, isControlled]);
|
|
908
|
-
const parsed = useMemo(() => buildParsed2(hsv.h, hsv.s, hsv.v, hsv.a), [hsv]);
|
|
909
|
-
const updateHsv = useCallback((next) => {
|
|
910
|
-
const merged = { ...hsv, ...next };
|
|
911
|
-
setHsv(merged);
|
|
912
|
-
const p = buildParsed2(merged.h, merged.s, merged.v, merged.a);
|
|
913
|
-
const formatted = formatValueByFormat2(p, currentFormat);
|
|
914
|
-
lastEmittedRef.current = formatted;
|
|
915
|
-
if (!isControlled)
|
|
916
|
-
setInternalValue(formatted);
|
|
917
|
-
onValueChange?.(formatted, p);
|
|
918
|
-
}, [hsv, currentFormat, isControlled, onValueChange]);
|
|
919
|
-
const handleFormatChange = useCallback((f) => {
|
|
920
|
-
if (!isFormatControlled)
|
|
921
|
-
setInternalFormat(f);
|
|
922
|
-
onFormatChange?.(f);
|
|
923
|
-
const formatted = formatValueByFormat2(parsed, f);
|
|
924
|
-
lastEmittedRef.current = formatted;
|
|
925
|
-
if (!isControlled)
|
|
926
|
-
setInternalValue(formatted);
|
|
927
|
-
onValueChange?.(formatted, parsed);
|
|
928
|
-
}, [isFormatControlled, isControlled, onFormatChange, onValueChange, parsed]);
|
|
929
|
-
const handleHexCommit = useCallback((input) => {
|
|
930
|
-
const p = resolveCssColor2(input);
|
|
931
|
-
if (!p)
|
|
932
|
-
return;
|
|
933
|
-
oklchHueRef.current = null;
|
|
934
|
-
const newHsv = rgbToHsv2(p.r, p.g, p.b);
|
|
935
|
-
const merged = {
|
|
936
|
-
h: newHsv.s === 0 ? hsv.h : newHsv.h,
|
|
937
|
-
s: newHsv.s,
|
|
938
|
-
v: newHsv.v,
|
|
939
|
-
a: p.a
|
|
940
|
-
};
|
|
941
|
-
setHsv(merged);
|
|
942
|
-
const next = buildParsed2(merged.h, merged.s, merged.v, merged.a);
|
|
943
|
-
const formatted = formatValueByFormat2(next, currentFormat);
|
|
944
|
-
lastEmittedRef.current = formatted;
|
|
945
|
-
if (!isControlled)
|
|
946
|
-
setInternalValue(formatted);
|
|
947
|
-
onValueChange?.(formatted, next);
|
|
948
|
-
}, [hsv.h, currentFormat, isControlled, onValueChange]);
|
|
949
|
-
const handleSwatchPick = useCallback((sw) => {
|
|
950
|
-
handleHexCommit(sw);
|
|
951
|
-
}, [handleHexCommit]);
|
|
952
|
-
const handleEyedrop = useCallback((hex) => {
|
|
953
|
-
handleHexCommit(hex);
|
|
954
|
-
}, [handleHexCommit]);
|
|
955
|
-
const solidHueRgb = useMemo(() => hsvToRgb2(hsv.h, hsv.s, hsv.v), [hsv.h, hsv.s, hsv.v]);
|
|
956
|
-
const solidR = Math.round(solidHueRgb.r);
|
|
957
|
-
const solidG = Math.round(solidHueRgb.g);
|
|
958
|
-
const solidB = Math.round(solidHueRgb.b);
|
|
959
|
-
const solidColorString = `rgb(${solidR}, ${solidG}, ${solidB})`;
|
|
960
|
-
const shape = useShape2();
|
|
961
|
-
const substrate = useSurface2();
|
|
962
|
-
const pickerLevel = Math.max(substrate, 3);
|
|
963
|
-
const paintsSurface = useContext(PanelSurfaceContext);
|
|
964
|
-
const root = /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
965
|
-
value: pickerLevel,
|
|
966
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
967
|
-
ref,
|
|
968
|
-
className: cn2("flex flex-col gap-2 p-3", paintsSurface && surfaceClasses2(pickerLevel, 1), shape.container, className),
|
|
969
|
-
style: { width: PANEL_WIDTH },
|
|
970
|
-
...props,
|
|
971
|
-
children: [
|
|
972
|
-
/* @__PURE__ */ jsx(SaturationSquare, {
|
|
973
|
-
h: hsv.h,
|
|
974
|
-
s: hsv.s,
|
|
975
|
-
v: hsv.v,
|
|
976
|
-
onChange: (s, v) => updateHsv({ s, v })
|
|
977
|
-
}),
|
|
978
|
-
/* @__PURE__ */ jsxs("div", {
|
|
979
|
-
className: "flex flex-col [&>*]:mb-0 [&>*+*]:-mt-px",
|
|
980
|
-
children: [
|
|
981
|
-
/* @__PURE__ */ jsx(HueSlider, {
|
|
982
|
-
h: hsv.h,
|
|
983
|
-
onChange: (h) => {
|
|
984
|
-
oklchHueRef.current = null;
|
|
985
|
-
updateHsv({ h });
|
|
986
|
-
}
|
|
987
|
-
}),
|
|
988
|
-
/* @__PURE__ */ jsx(AlphaSlider, {
|
|
989
|
-
a: hsv.a,
|
|
990
|
-
solidColor: solidColorString,
|
|
991
|
-
solidR,
|
|
992
|
-
solidG,
|
|
993
|
-
solidB,
|
|
994
|
-
onChange: (a) => updateHsv({ a })
|
|
995
|
-
})
|
|
996
|
-
]
|
|
997
|
-
}),
|
|
998
|
-
/* @__PURE__ */ jsxs("div", {
|
|
999
|
-
className: "grid grid-cols-2 gap-2",
|
|
1000
|
-
children: [
|
|
1001
|
-
/* @__PURE__ */ jsx(FormatDropdown, {
|
|
1002
|
-
value: currentFormat,
|
|
1003
|
-
onChange: handleFormatChange,
|
|
1004
|
-
open: formatOpen,
|
|
1005
|
-
defaultOpen: defaultFormatOpen
|
|
1006
|
-
}),
|
|
1007
|
-
!hideEyedropper && /* @__PURE__ */ jsx(EyeDropperButton, {
|
|
1008
|
-
onPick: handleEyedrop
|
|
1009
|
-
})
|
|
1010
|
-
]
|
|
1011
|
-
}),
|
|
1012
|
-
/* @__PURE__ */ jsx(ColorInputsRow, {
|
|
1013
|
-
parsed,
|
|
1014
|
-
format: currentFormat,
|
|
1015
|
-
oklchHue: oklchHueRef.current,
|
|
1016
|
-
onChannelChange: (channel, value) => {
|
|
1017
|
-
const p = { ...parsed };
|
|
1018
|
-
switch (channel) {
|
|
1019
|
-
case "hex":
|
|
1020
|
-
handleHexCommit(value);
|
|
1021
|
-
return;
|
|
1022
|
-
case "r":
|
|
1023
|
-
case "g":
|
|
1024
|
-
case "b": {
|
|
1025
|
-
oklchHueRef.current = null;
|
|
1026
|
-
const r = channel === "r" ? Number(value) : p.r;
|
|
1027
|
-
const g = channel === "g" ? Number(value) : p.g;
|
|
1028
|
-
const b = channel === "b" ? Number(value) : p.b;
|
|
1029
|
-
const hsvVal = rgbToHsv2(r, g, b);
|
|
1030
|
-
updateHsv({
|
|
1031
|
-
h: hsvVal.s === 0 ? hsv.h : hsvVal.h,
|
|
1032
|
-
s: hsvVal.s,
|
|
1033
|
-
v: hsvVal.v
|
|
1034
|
-
});
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
case "hSL":
|
|
1038
|
-
case "sSL":
|
|
1039
|
-
case "lSL": {
|
|
1040
|
-
if (channel === "hSL")
|
|
1041
|
-
oklchHueRef.current = null;
|
|
1042
|
-
const hsl = rgbToHsl2(p.r, p.g, p.b);
|
|
1043
|
-
const h2 = channel === "hSL" ? Number(value) : hsl.h;
|
|
1044
|
-
const s2 = channel === "sSL" ? Number(value) / 100 : hsl.s;
|
|
1045
|
-
const l2 = channel === "lSL" ? Number(value) / 100 : hsl.l;
|
|
1046
|
-
const rgb = hslToRgb2(h2, clamp012(s2), clamp012(l2));
|
|
1047
|
-
const hsvVal = rgbToHsv2(rgb.r, rgb.g, rgb.b);
|
|
1048
|
-
updateHsv({
|
|
1049
|
-
h: hsvVal.s === 0 ? h2 : hsvVal.h,
|
|
1050
|
-
s: hsvVal.s,
|
|
1051
|
-
v: hsvVal.v
|
|
1052
|
-
});
|
|
1053
|
-
return;
|
|
1054
|
-
}
|
|
1055
|
-
case "L":
|
|
1056
|
-
case "C":
|
|
1057
|
-
case "H": {
|
|
1058
|
-
const cur = rgbToOklch2(p.r, p.g, p.b);
|
|
1059
|
-
const baseH = oklchHueRef.current ?? cur.H;
|
|
1060
|
-
const L = channel === "L" ? Number(value) / 100 : cur.L;
|
|
1061
|
-
const C = channel === "C" ? Number(value) : cur.C;
|
|
1062
|
-
const H = channel === "H" ? Number(value) : baseH;
|
|
1063
|
-
oklchHueRef.current = H;
|
|
1064
|
-
const rgb = oklchToRgb2(clamp012(L), Math.max(0, C), H);
|
|
1065
|
-
const hsvVal = rgbToHsv2(rgb.r, rgb.g, rgb.b);
|
|
1066
|
-
updateHsv({
|
|
1067
|
-
h: hsvVal.s === 0 ? hsv.h : hsvVal.h,
|
|
1068
|
-
s: hsvVal.s,
|
|
1069
|
-
v: hsvVal.v
|
|
1070
|
-
});
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
case "alphaPercent": {
|
|
1074
|
-
const a = clamp012(Number(value) / 100);
|
|
1075
|
-
updateHsv({ a });
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
}),
|
|
1081
|
-
swatches && swatches.length > 0 && /* @__PURE__ */ jsx(SwatchStrip, {
|
|
1082
|
-
swatches,
|
|
1083
|
-
current: parsed.hex,
|
|
1084
|
-
onPick: handleSwatchPick
|
|
1085
|
-
})
|
|
1086
|
-
]
|
|
1087
|
-
})
|
|
1088
|
-
});
|
|
1089
|
-
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
1090
|
-
size,
|
|
1091
|
-
children: root
|
|
1092
|
-
}) : root;
|
|
1093
|
-
});
|
|
1094
|
-
ColorPicker2.displayName = "ColorPicker";
|
|
1095
|
-
function ColorInputsRow({
|
|
1096
|
-
parsed,
|
|
1097
|
-
format,
|
|
1098
|
-
oklchHue,
|
|
1099
|
-
onChannelChange
|
|
1100
|
-
}) {
|
|
1101
|
-
const alphaPct = Math.round(parsed.a * 100);
|
|
1102
|
-
if (format === "hex") {
|
|
1103
|
-
const hexNoHash = parsed.hex.replace(/^#/, "").toUpperCase();
|
|
1104
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1105
|
-
className: "grid grid-cols-2 gap-2",
|
|
1106
|
-
children: [
|
|
1107
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1108
|
-
label: "Hex",
|
|
1109
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1110
|
-
value: hexNoHash,
|
|
1111
|
-
onCommit: (next) => onChannelChange("hex", next.startsWith("#") ? next : `#${next}`),
|
|
1112
|
-
ariaLabel: "Hex value",
|
|
1113
|
-
prefix: "#"
|
|
1114
|
-
})
|
|
1115
|
-
}),
|
|
1116
|
-
/* @__PURE__ */ jsx(AlphaInput, {
|
|
1117
|
-
value: alphaPct,
|
|
1118
|
-
onCommit: (n) => onChannelChange("alphaPercent", String(n))
|
|
1119
|
-
})
|
|
1120
|
-
]
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
if (format === "rgb") {
|
|
1124
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1125
|
-
className: "grid grid-cols-4 gap-1",
|
|
1126
|
-
children: [
|
|
1127
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1128
|
-
label: "Red",
|
|
1129
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1130
|
-
value: String(parsed.r),
|
|
1131
|
-
onCommit: (n) => onChannelChange("r", n),
|
|
1132
|
-
ariaLabel: "Red",
|
|
1133
|
-
align: "center",
|
|
1134
|
-
inputMode: "numeric",
|
|
1135
|
-
nudgeStep: 1,
|
|
1136
|
-
nudgeShiftStep: 10,
|
|
1137
|
-
scrubbable: true,
|
|
1138
|
-
min: 0,
|
|
1139
|
-
max: 255
|
|
1140
|
-
})
|
|
1141
|
-
}),
|
|
1142
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1143
|
-
label: "Green",
|
|
1144
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1145
|
-
value: String(parsed.g),
|
|
1146
|
-
onCommit: (n) => onChannelChange("g", n),
|
|
1147
|
-
ariaLabel: "Green",
|
|
1148
|
-
align: "center",
|
|
1149
|
-
inputMode: "numeric",
|
|
1150
|
-
nudgeStep: 1,
|
|
1151
|
-
nudgeShiftStep: 10,
|
|
1152
|
-
scrubbable: true,
|
|
1153
|
-
min: 0,
|
|
1154
|
-
max: 255
|
|
1155
|
-
})
|
|
1156
|
-
}),
|
|
1157
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1158
|
-
label: "Blue",
|
|
1159
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1160
|
-
value: String(parsed.b),
|
|
1161
|
-
onCommit: (n) => onChannelChange("b", n),
|
|
1162
|
-
ariaLabel: "Blue",
|
|
1163
|
-
align: "center",
|
|
1164
|
-
inputMode: "numeric",
|
|
1165
|
-
nudgeStep: 1,
|
|
1166
|
-
nudgeShiftStep: 10,
|
|
1167
|
-
scrubbable: true,
|
|
1168
|
-
min: 0,
|
|
1169
|
-
max: 255
|
|
1170
|
-
})
|
|
1171
|
-
}),
|
|
1172
|
-
/* @__PURE__ */ jsx(AlphaInput, {
|
|
1173
|
-
value: alphaPct,
|
|
1174
|
-
onCommit: (n) => onChannelChange("alphaPercent", String(n))
|
|
1175
|
-
})
|
|
1176
|
-
]
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
if (format === "hsl") {
|
|
1180
|
-
const hsl = rgbToHsl2(parsed.r, parsed.g, parsed.b);
|
|
1181
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1182
|
-
className: "grid grid-cols-4 gap-1",
|
|
1183
|
-
children: [
|
|
1184
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1185
|
-
label: "Hue",
|
|
1186
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1187
|
-
value: String(Math.round(hsl.h)),
|
|
1188
|
-
onCommit: (n) => onChannelChange("hSL", n),
|
|
1189
|
-
ariaLabel: "Hue",
|
|
1190
|
-
align: "center",
|
|
1191
|
-
inputMode: "numeric",
|
|
1192
|
-
nudgeStep: 1,
|
|
1193
|
-
nudgeShiftStep: 10,
|
|
1194
|
-
scrubbable: true,
|
|
1195
|
-
min: 0,
|
|
1196
|
-
max: 360,
|
|
1197
|
-
wrap: true
|
|
1198
|
-
})
|
|
1199
|
-
}),
|
|
1200
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1201
|
-
label: "Saturation",
|
|
1202
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1203
|
-
value: String(Math.round(hsl.s * 100)),
|
|
1204
|
-
onCommit: (n) => onChannelChange("sSL", n),
|
|
1205
|
-
ariaLabel: "Saturation",
|
|
1206
|
-
align: "center",
|
|
1207
|
-
inputMode: "numeric",
|
|
1208
|
-
nudgeStep: 1,
|
|
1209
|
-
nudgeShiftStep: 10,
|
|
1210
|
-
scrubbable: true,
|
|
1211
|
-
min: 0,
|
|
1212
|
-
max: 100
|
|
1213
|
-
})
|
|
1214
|
-
}),
|
|
1215
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1216
|
-
label: "Lightness",
|
|
1217
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1218
|
-
value: String(Math.round(hsl.l * 100)),
|
|
1219
|
-
onCommit: (n) => onChannelChange("lSL", n),
|
|
1220
|
-
ariaLabel: "Lightness",
|
|
1221
|
-
align: "center",
|
|
1222
|
-
inputMode: "numeric",
|
|
1223
|
-
nudgeStep: 1,
|
|
1224
|
-
nudgeShiftStep: 10,
|
|
1225
|
-
scrubbable: true,
|
|
1226
|
-
min: 0,
|
|
1227
|
-
max: 100
|
|
1228
|
-
})
|
|
1229
|
-
}),
|
|
1230
|
-
/* @__PURE__ */ jsx(AlphaInput, {
|
|
1231
|
-
value: alphaPct,
|
|
1232
|
-
onCommit: (n) => onChannelChange("alphaPercent", String(n))
|
|
1233
|
-
})
|
|
1234
|
-
]
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
const oklch = rgbToOklch2(parsed.r, parsed.g, parsed.b);
|
|
1238
|
-
const displayH = oklchHue ?? oklch.H;
|
|
1239
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1240
|
-
className: "grid grid-cols-4 gap-1",
|
|
1241
|
-
children: [
|
|
1242
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1243
|
-
label: "Lightness",
|
|
1244
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1245
|
-
value: (oklch.L * 100).toFixed(0),
|
|
1246
|
-
onCommit: (n) => onChannelChange("L", n),
|
|
1247
|
-
ariaLabel: "Lightness",
|
|
1248
|
-
align: "center",
|
|
1249
|
-
inputMode: "decimal",
|
|
1250
|
-
nudgeStep: 1,
|
|
1251
|
-
nudgeShiftStep: 10,
|
|
1252
|
-
scrubbable: true,
|
|
1253
|
-
min: 0,
|
|
1254
|
-
max: 100
|
|
1255
|
-
})
|
|
1256
|
-
}),
|
|
1257
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1258
|
-
label: "Chroma",
|
|
1259
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1260
|
-
value: oklch.C.toFixed(2),
|
|
1261
|
-
onCommit: (n) => onChannelChange("C", n),
|
|
1262
|
-
ariaLabel: "Chroma",
|
|
1263
|
-
align: "center",
|
|
1264
|
-
inputMode: "decimal",
|
|
1265
|
-
nudgeStep: 0.01,
|
|
1266
|
-
nudgeShiftStep: 0.1,
|
|
1267
|
-
decimals: 2,
|
|
1268
|
-
scrubbable: true,
|
|
1269
|
-
min: 0,
|
|
1270
|
-
max: 0.4
|
|
1271
|
-
})
|
|
1272
|
-
}),
|
|
1273
|
-
/* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1274
|
-
label: "Hue",
|
|
1275
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1276
|
-
value: displayH.toFixed(0),
|
|
1277
|
-
onCommit: (n) => onChannelChange("H", n),
|
|
1278
|
-
ariaLabel: "Hue",
|
|
1279
|
-
align: "center",
|
|
1280
|
-
inputMode: "numeric",
|
|
1281
|
-
nudgeStep: 1,
|
|
1282
|
-
nudgeShiftStep: 10,
|
|
1283
|
-
scrubbable: true,
|
|
1284
|
-
min: 0,
|
|
1285
|
-
max: 360,
|
|
1286
|
-
wrap: true
|
|
1287
|
-
})
|
|
1288
|
-
}),
|
|
1289
|
-
/* @__PURE__ */ jsx(AlphaInput, {
|
|
1290
|
-
value: alphaPct,
|
|
1291
|
-
onCommit: (n) => onChannelChange("alphaPercent", String(n))
|
|
1292
|
-
})
|
|
1293
|
-
]
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
|
-
function ChannelTooltip({ label, children }) {
|
|
1297
|
-
return /* @__PURE__ */ jsx(Tooltip2, {
|
|
1298
|
-
content: label,
|
|
1299
|
-
delayDuration: 300,
|
|
1300
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
1301
|
-
children
|
|
1302
|
-
})
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
function AlphaInput({ value, onCommit }) {
|
|
1306
|
-
return /* @__PURE__ */ jsx(ChannelTooltip, {
|
|
1307
|
-
label: "Alpha",
|
|
1308
|
-
children: /* @__PURE__ */ jsx(ColorInput, {
|
|
1309
|
-
value: `${value}%`,
|
|
1310
|
-
onCommit: (input) => {
|
|
1311
|
-
const n = parseFloat(input.replace("%", ""));
|
|
1312
|
-
if (Number.isNaN(n))
|
|
1313
|
-
return;
|
|
1314
|
-
onCommit(Math.max(0, Math.min(100, Math.round(n))));
|
|
1315
|
-
},
|
|
1316
|
-
ariaLabel: "Alpha",
|
|
1317
|
-
align: "center",
|
|
1318
|
-
inputMode: "numeric",
|
|
1319
|
-
nudgeStep: 1,
|
|
1320
|
-
nudgeShiftStep: 10,
|
|
1321
|
-
hasPercent: true,
|
|
1322
|
-
scrubbable: true,
|
|
1323
|
-
min: 0,
|
|
1324
|
-
max: 100
|
|
1325
|
-
})
|
|
1326
|
-
});
|
|
1327
|
-
}
|
|
1328
|
-
var ColorPickerPopover2 = forwardRef(({
|
|
1329
|
-
triggerLabel,
|
|
1330
|
-
triggerLabelPosition = "left",
|
|
1331
|
-
triggerShowValue = true,
|
|
1332
|
-
triggerShowRemove = false,
|
|
1333
|
-
onTriggerRemove,
|
|
1334
|
-
triggerClassName,
|
|
1335
|
-
removeLabel = "Remove color",
|
|
1336
|
-
disabled = false,
|
|
1337
|
-
readOnly = false,
|
|
1338
|
-
rootClassName,
|
|
1339
|
-
open: openProp,
|
|
1340
|
-
defaultOpen = false,
|
|
1341
|
-
onOpenChange,
|
|
1342
|
-
size,
|
|
1343
|
-
from,
|
|
1344
|
-
effect,
|
|
1345
|
-
hideSource,
|
|
1346
|
-
tier,
|
|
1347
|
-
...pickerProps
|
|
1348
|
-
}, ref) => {
|
|
1349
|
-
const isOpenControlled = openProp !== undefined;
|
|
1350
|
-
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
1351
|
-
const locked = disabled || readOnly;
|
|
1352
|
-
const open = !locked && (isOpenControlled ? openProp : internalOpen);
|
|
1353
|
-
const { origin, capture } = useMorphOrigin2();
|
|
1354
|
-
const morph = useMorph2(open, origin, { from, effect, hideSource, tier });
|
|
1355
|
-
const shape = useShape2();
|
|
1356
|
-
const sizeClasses = useSize2(size);
|
|
1357
|
-
const compact = sizeClasses.variant === "compact";
|
|
1358
|
-
const substrate = useSurface2();
|
|
1359
|
-
const level = Math.min(substrate + 2, 8);
|
|
1360
|
-
const handleOpenChange = useCallback((next, details) => {
|
|
1361
|
-
if (locked)
|
|
1362
|
-
return;
|
|
1363
|
-
if (next)
|
|
1364
|
-
capture(details);
|
|
1365
|
-
if (!isOpenControlled)
|
|
1366
|
-
setInternalOpen(next);
|
|
1367
|
-
onOpenChange?.(next);
|
|
1368
|
-
}, [isOpenControlled, locked, onOpenChange, capture]);
|
|
1369
|
-
const isControlled = pickerProps.value !== undefined;
|
|
1370
|
-
const [internalValue, setInternalValue] = useState(pickerProps.value ?? pickerProps.defaultValue ?? "#6B97FF");
|
|
1371
|
-
const currentValue = isControlled ? pickerProps.value : internalValue;
|
|
1372
|
-
const handleValueChange = useCallback((v, parsed) => {
|
|
1373
|
-
if (!isControlled)
|
|
1374
|
-
setInternalValue(v);
|
|
1375
|
-
pickerProps.onValueChange?.(v, parsed);
|
|
1376
|
-
}, [isControlled, pickerProps]);
|
|
1377
|
-
const XIcon = useIcon2("x");
|
|
1378
|
-
const parsed = useMemo(() => parseColor2(currentValue), [currentValue]);
|
|
1379
|
-
const swatchColor = parsed ? rgbToHexStr2(parsed.r, parsed.g, parsed.b, parsed.a) : currentValue;
|
|
1380
|
-
const valueLabel = parsed ? rgbToHexStr2(parsed.r, parsed.g, parsed.b, 1).replace(/^#/, "").toUpperCase() : currentValue;
|
|
1381
|
-
const root = /* @__PURE__ */ jsx(Popover.Root, {
|
|
1382
|
-
open,
|
|
1383
|
-
onOpenChange: handleOpenChange,
|
|
1384
|
-
modal: false,
|
|
1385
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
1386
|
-
ref,
|
|
1387
|
-
className: cn2("inline-flex", rootClassName),
|
|
1388
|
-
children: [
|
|
1389
|
-
/* @__PURE__ */ jsxs(Popover.Trigger, {
|
|
1390
|
-
disabled,
|
|
1391
|
-
tabIndex: readOnly ? -1 : undefined,
|
|
1392
|
-
"data-readonly": readOnly || undefined,
|
|
1393
|
-
className: cn2("flex items-center border border-border bg-transparent hover:bg-hover transition-colors duration-fast outline-none focus-visible:ring-1 focus-visible:ring-focus-ring cursor-pointer", "disabled:opacity-50 disabled:pointer-events-none data-[readonly]:cursor-default data-[readonly]:hover:!bg-transparent", sizeClasses.gap, sizeClasses.control, compact ? "px-1.5" : "px-2", shape.input, "weight-medium", triggerClassName),
|
|
1394
|
-
children: [
|
|
1395
|
-
triggerLabel && triggerLabelPosition === "left" && /* @__PURE__ */ jsx("span", {
|
|
1396
|
-
className: cn2("text-muted-foreground px-1 select-none", sizeClasses.text),
|
|
1397
|
-
children: triggerLabel
|
|
1398
|
-
}),
|
|
1399
|
-
/* @__PURE__ */ jsx(ColorTile2, {
|
|
1400
|
-
color: swatchColor,
|
|
1401
|
-
size: compact ? 16 : 20
|
|
1402
|
-
}),
|
|
1403
|
-
triggerShowValue && /* @__PURE__ */ jsx("span", {
|
|
1404
|
-
className: cn2("text-foreground tabular-nums", sizeClasses.text),
|
|
1405
|
-
children: valueLabel
|
|
1406
|
-
}),
|
|
1407
|
-
triggerLabel && triggerLabelPosition === "right" && /* @__PURE__ */ jsx("span", {
|
|
1408
|
-
className: cn2("text-muted-foreground px-1 select-none", sizeClasses.text),
|
|
1409
|
-
children: triggerLabel
|
|
1410
|
-
}),
|
|
1411
|
-
triggerShowRemove && !locked && /* @__PURE__ */ jsx("span", {
|
|
1412
|
-
role: "button",
|
|
1413
|
-
"aria-label": removeLabel,
|
|
1414
|
-
tabIndex: 0,
|
|
1415
|
-
onClick: (e) => {
|
|
1416
|
-
e.stopPropagation();
|
|
1417
|
-
onTriggerRemove?.();
|
|
1418
|
-
},
|
|
1419
|
-
onKeyDown: (e) => {
|
|
1420
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1421
|
-
e.stopPropagation();
|
|
1422
|
-
e.preventDefault();
|
|
1423
|
-
onTriggerRemove?.();
|
|
1424
|
-
}
|
|
1425
|
-
},
|
|
1426
|
-
className: "ml-1 text-muted-foreground hover:text-foreground cursor-pointer flex items-center",
|
|
1427
|
-
children: /* @__PURE__ */ jsx(XIcon, {
|
|
1428
|
-
size: 14,
|
|
1429
|
-
strokeWidth: 1.5
|
|
1430
|
-
})
|
|
1431
|
-
})
|
|
1432
|
-
]
|
|
1433
|
-
}),
|
|
1434
|
-
/* @__PURE__ */ jsx(Popover.Portal, {
|
|
1435
|
-
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
1436
|
-
side: "bottom",
|
|
1437
|
-
align: "start",
|
|
1438
|
-
sideOffset: opensInPlace2({ effect, hideSource }) ? inPlaceOffset2 : 6,
|
|
1439
|
-
className: "z-50 outline-none",
|
|
1440
|
-
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
1441
|
-
ref: morph.popupRef,
|
|
1442
|
-
className: "relative outline-none",
|
|
1443
|
-
children: /* @__PURE__ */ jsx(ColorPickerPortalContainer2, {
|
|
1444
|
-
value: morph.popup,
|
|
1445
|
-
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
1446
|
-
value: level,
|
|
1447
|
-
children: /* @__PURE__ */ jsx(MorphSurface2, {
|
|
1448
|
-
morph,
|
|
1449
|
-
bg: SURFACE_BG2[level],
|
|
1450
|
-
shadow: SURFACE_SHADOW2[3],
|
|
1451
|
-
radius: shape.container,
|
|
1452
|
-
children: /* @__PURE__ */ jsx(PanelSurfaceContext.Provider, {
|
|
1453
|
-
value: false,
|
|
1454
|
-
children: /* @__PURE__ */ jsx(ColorPicker2, {
|
|
1455
|
-
...pickerProps,
|
|
1456
|
-
value: currentValue,
|
|
1457
|
-
onValueChange: handleValueChange
|
|
1458
|
-
})
|
|
1459
|
-
})
|
|
1460
|
-
})
|
|
1461
|
-
})
|
|
1462
|
-
})
|
|
1463
|
-
})
|
|
1464
|
-
})
|
|
1465
|
-
})
|
|
1466
|
-
]
|
|
1467
|
-
})
|
|
1468
|
-
});
|
|
1469
|
-
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
1470
|
-
size,
|
|
1471
|
-
children: root
|
|
1472
|
-
}) : root;
|
|
1473
|
-
});
|
|
1474
|
-
ColorPickerPopover2.displayName = "ColorPickerPopover";
|
|
1475
|
-
Object.assign(ColorPicker2, { Popover: ColorPickerPopover2 });
|
|
1476
|
-
var color_picker_default = ColorPicker2;
|
|
1477
|
-
|
|
1478
|
-
export { ColorPickerPortalContainer2, ColorTile2, ColorSwatch2, ColorPicker2, ColorPickerPopover2, color_picker_default };
|