@editora/ui-core 0.1.9 → 0.1.10
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 +35 -0
- package/dist/ElementBase-1b301e7f.js +1 -0
- package/dist/ElementBase-909688f3.mjs +79 -0
- package/dist/accordion.cjs.js +360 -0
- package/dist/accordion.esm.js +647 -0
- package/dist/alert-dialog.cjs.js +567 -0
- package/dist/alert-dialog.esm.js +1043 -0
- package/dist/alert.cjs.js +351 -0
- package/dist/alert.esm.js +450 -0
- package/dist/anchor.cjs.js +30 -0
- package/dist/anchor.esm.js +62 -0
- package/dist/animated-beam.cjs.js +720 -0
- package/dist/animated-beam.esm.js +1540 -0
- package/dist/animated-list.cjs.js +672 -0
- package/dist/animated-list.esm.js +1137 -0
- package/dist/animated-text.cjs.js +683 -0
- package/dist/animated-text.esm.js +1020 -0
- package/dist/app-header.cjs.js +345 -0
- package/dist/app-header.esm.js +398 -0
- package/dist/aspect-ratio.cjs.js +294 -0
- package/dist/aspect-ratio.esm.js +416 -0
- package/dist/avatar.cjs.js +365 -0
- package/dist/avatar.esm.js +513 -0
- package/dist/badge.cjs.js +432 -0
- package/dist/badge.esm.js +554 -0
- package/dist/block-controls.cjs.js +347 -0
- package/dist/block-controls.esm.js +556 -0
- package/dist/box.cjs.js +226 -0
- package/dist/box.esm.js +556 -0
- package/dist/breadcrumb.cjs.js +288 -0
- package/dist/breadcrumb.esm.js +523 -0
- package/dist/button.cjs.js +521 -0
- package/dist/button.esm.js +671 -0
- package/dist/calendar-2c11b824.mjs +1685 -0
- package/dist/calendar-a8735e40.js +741 -0
- package/dist/calendar.cjs.js +1 -0
- package/dist/calendar.esm.js +11 -0
- package/dist/card.cjs.js +306 -0
- package/dist/card.esm.js +378 -0
- package/dist/chart.cjs.js +783 -0
- package/dist/chart.esm.js +1369 -0
- package/dist/checkbox.cjs.js +338 -0
- package/dist/checkbox.esm.js +455 -0
- package/dist/collapsible.cjs.js +381 -0
- package/dist/collapsible.esm.js +548 -0
- package/dist/collection-a1aac0c6.mjs +56 -0
- package/dist/collection-a2969ad2.js +1 -0
- package/dist/collection.cjs.js +1 -0
- package/dist/collection.esm.js +136 -0
- package/dist/color-picker.cjs.js +803 -0
- package/dist/color-picker.esm.js +1809 -0
- package/dist/combobox.cjs.js +525 -0
- package/dist/combobox.esm.js +1023 -0
- package/dist/command-palette.cjs.js +67 -0
- package/dist/command-palette.esm.js +181 -0
- package/dist/command.cjs.js +130 -0
- package/dist/command.esm.js +307 -0
- package/dist/container.cjs.js +115 -0
- package/dist/container.esm.js +156 -0
- package/dist/context-menu.cjs.js +357 -0
- package/dist/context-menu.esm.js +1204 -0
- package/dist/control-group.cjs.js +80 -0
- package/dist/control-group.esm.js +110 -0
- package/dist/data-table.cjs.js +682 -0
- package/dist/data-table.esm.js +1660 -0
- package/dist/date-field.cjs.js +142 -0
- package/dist/date-field.esm.js +384 -0
- package/dist/date-picker.cjs.js +570 -0
- package/dist/date-picker.esm.js +1067 -0
- package/dist/date-range-picker.cjs.js +455 -0
- package/dist/date-range-picker.esm.js +973 -0
- package/dist/date-range-time-picker.cjs.js +573 -0
- package/dist/date-range-time-picker.esm.js +1137 -0
- package/dist/date-time-picker.cjs.js +495 -0
- package/dist/date-time-picker.esm.js +1062 -0
- package/dist/date-time-utils-5cf58cd0.js +1 -0
- package/dist/date-time-utils-bdceb7af.mjs +273 -0
- package/dist/description.cjs.js +85 -0
- package/dist/description.esm.js +136 -0
- package/dist/dialog.cjs.js +406 -0
- package/dist/dialog.esm.js +822 -0
- package/dist/direction-provider.cjs.js +30 -0
- package/dist/direction-provider.esm.js +74 -0
- package/dist/dismissable-layer-193e3bed.js +1 -0
- package/dist/dismissable-layer-9c7e6b58.mjs +112 -0
- package/dist/dismissable-layer.cjs.js +6 -0
- package/dist/dismissable-layer.esm.js +115 -0
- package/dist/dock.cjs.js +347 -0
- package/dist/dock.esm.js +826 -0
- package/dist/drawer.cjs.js +538 -0
- package/dist/drawer.esm.js +872 -0
- package/dist/dropdown.cjs.js +511 -0
- package/dist/dropdown.esm.js +1084 -0
- package/dist/dropzone.cjs.js +1 -0
- package/dist/dropzone.esm.js +11 -0
- package/dist/empty-state.cjs.js +169 -0
- package/dist/empty-state.esm.js +199 -0
- package/dist/field-error.cjs.js +74 -0
- package/dist/field-error.esm.js +125 -0
- package/dist/field.cjs.js +398 -0
- package/dist/field.esm.js +542 -0
- package/dist/fieldset.cjs.js +214 -0
- package/dist/fieldset.esm.js +298 -0
- package/dist/file-upload.cjs.js +353 -0
- package/dist/file-upload.esm.js +740 -0
- package/dist/flex.cjs.js +54 -0
- package/dist/flex.esm.js +168 -0
- package/dist/floating-toolbar.cjs.js +223 -0
- package/dist/floating-toolbar.esm.js +513 -0
- package/dist/focus-scope-103833ee.mjs +147 -0
- package/dist/focus-scope-2b12b4e7.js +1 -0
- package/dist/focus-scope.cjs.js +6 -0
- package/dist/focus-scope.esm.js +97 -0
- package/dist/form.cjs.js +377 -0
- package/dist/form.esm.js +862 -0
- package/dist/gantt.cjs.js +157 -0
- package/dist/gantt.esm.js +214 -0
- package/dist/grid.cjs.js +67 -0
- package/dist/grid.esm.js +211 -0
- package/dist/hover-card.cjs.js +284 -0
- package/dist/hover-card.esm.js +470 -0
- package/dist/icon-9ed13093.mjs +364 -0
- package/dist/icon-cloud.cjs.js +495 -0
- package/dist/icon-cloud.esm.js +828 -0
- package/dist/icon-eaa486b3.js +207 -0
- package/dist/icon.cjs.js +1 -0
- package/dist/icon.esm.js +6 -0
- package/dist/index.cjs.js +1 -36010
- package/dist/index.esm.js +440 -66615
- package/dist/inline-edit.cjs.js +118 -0
- package/dist/inline-edit.esm.js +206 -0
- package/dist/input.cjs.js +535 -0
- package/dist/input.esm.js +790 -0
- package/dist/label.cjs.js +195 -0
- package/dist/label.esm.js +301 -0
- package/dist/layout.cjs.js +266 -0
- package/dist/layout.esm.js +408 -0
- package/dist/listbox-308789a0.mjs +210 -0
- package/dist/listbox-ef2f708e.js +46 -0
- package/dist/listbox.cjs.js +1 -0
- package/dist/listbox.esm.js +6 -0
- package/dist/marquee.cjs.js +513 -0
- package/dist/marquee.esm.js +767 -0
- package/dist/masonry-grid.cjs.js +65 -0
- package/dist/masonry-grid.esm.js +180 -0
- package/dist/menu-item-styles-27fdbac4.mjs +181 -0
- package/dist/menu-item-styles-83ad1e22.js +152 -0
- package/dist/menu.cjs.js +275 -0
- package/dist/menu.esm.js +743 -0
- package/dist/menubar.cjs.js +455 -0
- package/dist/menubar.esm.js +1195 -0
- package/dist/meter.cjs.js +241 -0
- package/dist/meter.esm.js +334 -0
- package/dist/multi-select.cjs.js +549 -0
- package/dist/multi-select.esm.js +914 -0
- package/dist/navigation-menu.cjs.js +382 -0
- package/dist/navigation-menu.esm.js +614 -0
- package/dist/number-field.cjs.js +351 -0
- package/dist/number-field.esm.js +771 -0
- package/dist/number-ticker.cjs.js +209 -0
- package/dist/number-ticker.esm.js +749 -0
- package/dist/odometer.cjs.js +313 -0
- package/dist/odometer.esm.js +565 -0
- package/dist/orbiter.cjs.js +495 -0
- package/dist/orbiter.esm.js +831 -0
- package/dist/overlayManager-86454af7.mjs +58 -0
- package/dist/overlayManager-ece06517.js +1 -0
- package/dist/pagination.cjs.js +201 -0
- package/dist/pagination.esm.js +297 -0
- package/dist/panel-group-40254cdd.js +36 -0
- package/dist/panel-group-a376cc5e.mjs +326 -0
- package/dist/panel-group.cjs.js +1 -0
- package/dist/panel-group.esm.js +7 -0
- package/dist/panel.cjs.js +22 -0
- package/dist/panel.esm.js +46 -0
- package/dist/password-field.cjs.js +626 -0
- package/dist/password-field.esm.js +925 -0
- package/dist/pin-input.cjs.js +185 -0
- package/dist/pin-input.esm.js +412 -0
- package/dist/placement-grid.cjs.js +99 -0
- package/dist/placement-grid.esm.js +486 -0
- package/dist/plugin-panel.cjs.js +131 -0
- package/dist/plugin-panel.esm.js +173 -0
- package/dist/popover.cjs.js +286 -0
- package/dist/popover.esm.js +483 -0
- package/dist/portal-1cf392ca.mjs +114 -0
- package/dist/portal-d8d7fbca.js +1 -0
- package/dist/portal.cjs.js +39 -0
- package/dist/portal.esm.js +187 -0
- package/dist/positioner-accc6e5f.js +1 -0
- package/dist/positioner-fbd61bf1.mjs +132 -0
- package/dist/positioner.cjs.js +6 -0
- package/dist/positioner.esm.js +137 -0
- package/dist/presence.cjs.js +164 -0
- package/dist/presence.esm.js +301 -0
- package/dist/progress.cjs.js +329 -0
- package/dist/progress.esm.js +453 -0
- package/dist/quick-actions.cjs.js +202 -0
- package/dist/quick-actions.esm.js +357 -0
- package/dist/radio-group.cjs.js +257 -0
- package/dist/radio-group.esm.js +477 -0
- package/dist/rating.cjs.js +355 -0
- package/dist/rating.esm.js +637 -0
- package/dist/roving-focus-group-4350c9a7.mjs +50 -0
- package/dist/roving-focus-group-5c059bf9.js +1 -0
- package/dist/roving-focus-group.cjs.js +1 -0
- package/dist/roving-focus-group.esm.js +72 -0
- package/dist/{runtime-3cc1c386.mjs → runtime-4ac0107b.mjs} +348 -459
- package/dist/runtime-5f282bc8.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +24 -23
- package/dist/scroll-area.cjs.js +294 -0
- package/dist/scroll-area.esm.js +478 -0
- package/dist/scroll-lock-48793569.js +1 -0
- package/dist/scroll-lock-9de6d328.mjs +53 -0
- package/dist/section.cjs.js +167 -0
- package/dist/section.esm.js +202 -0
- package/dist/select.cjs.js +799 -0
- package/dist/select.esm.js +1266 -0
- package/dist/selection-popup.cjs.js +203 -0
- package/dist/selection-popup.esm.js +392 -0
- package/dist/separator.cjs.js +221 -0
- package/dist/separator.esm.js +241 -0
- package/dist/sidebar.cjs.js +769 -0
- package/dist/sidebar.esm.js +1219 -0
- package/dist/skeleton.cjs.js +205 -0
- package/dist/skeleton.esm.js +249 -0
- package/dist/slider.cjs.js +493 -0
- package/dist/slider.esm.js +694 -0
- package/dist/slot.cjs.js +159 -0
- package/dist/slot.esm.js +227 -0
- package/dist/sortable.cjs.js +855 -1
- package/dist/sortable.esm.js +2176 -2
- package/dist/spinning-text.cjs.js +395 -0
- package/dist/spinning-text.esm.js +635 -0
- package/dist/split-button.cjs.js +410 -0
- package/dist/split-button.esm.js +619 -0
- package/dist/splitter.cjs.js +70 -0
- package/dist/splitter.esm.js +105 -0
- package/dist/standalone/accordion.d.ts +2 -0
- package/dist/standalone/accordion.d.ts.map +1 -0
- package/dist/standalone/alert-dialog.d.ts +2 -0
- package/dist/standalone/alert-dialog.d.ts.map +1 -0
- package/dist/standalone/alert.d.ts +2 -0
- package/dist/standalone/alert.d.ts.map +1 -0
- package/dist/standalone/anchor.d.ts +2 -0
- package/dist/standalone/anchor.d.ts.map +1 -0
- package/dist/standalone/animated-beam.d.ts +2 -0
- package/dist/standalone/animated-beam.d.ts.map +1 -0
- package/dist/standalone/animated-list.d.ts +2 -0
- package/dist/standalone/animated-list.d.ts.map +1 -0
- package/dist/standalone/animated-text.d.ts +2 -0
- package/dist/standalone/animated-text.d.ts.map +1 -0
- package/dist/standalone/app-header.d.ts +2 -0
- package/dist/standalone/app-header.d.ts.map +1 -0
- package/dist/standalone/aspect-ratio.d.ts +2 -0
- package/dist/standalone/aspect-ratio.d.ts.map +1 -0
- package/dist/standalone/avatar.d.ts +2 -0
- package/dist/standalone/avatar.d.ts.map +1 -0
- package/dist/standalone/badge.d.ts +2 -0
- package/dist/standalone/badge.d.ts.map +1 -0
- package/dist/standalone/block-controls.d.ts +2 -0
- package/dist/standalone/block-controls.d.ts.map +1 -0
- package/dist/standalone/box.d.ts +2 -0
- package/dist/standalone/box.d.ts.map +1 -0
- package/dist/standalone/breadcrumb.d.ts +2 -0
- package/dist/standalone/breadcrumb.d.ts.map +1 -0
- package/dist/standalone/button.d.ts +2 -0
- package/dist/standalone/button.d.ts.map +1 -0
- package/dist/standalone/calendar.d.ts +2 -0
- package/dist/standalone/calendar.d.ts.map +1 -0
- package/dist/standalone/card.d.ts +2 -0
- package/dist/standalone/card.d.ts.map +1 -0
- package/dist/standalone/chart.d.ts +2 -0
- package/dist/standalone/chart.d.ts.map +1 -0
- package/dist/standalone/checkbox.d.ts +2 -0
- package/dist/standalone/checkbox.d.ts.map +1 -0
- package/dist/standalone/collapsible.d.ts +2 -0
- package/dist/standalone/collapsible.d.ts.map +1 -0
- package/dist/standalone/collection.d.ts +2 -0
- package/dist/standalone/collection.d.ts.map +1 -0
- package/dist/standalone/color-picker.d.ts +2 -0
- package/dist/standalone/color-picker.d.ts.map +1 -0
- package/dist/standalone/combobox.d.ts +2 -0
- package/dist/standalone/combobox.d.ts.map +1 -0
- package/dist/standalone/command-palette.d.ts +2 -0
- package/dist/standalone/command-palette.d.ts.map +1 -0
- package/dist/standalone/command.d.ts +2 -0
- package/dist/standalone/command.d.ts.map +1 -0
- package/dist/standalone/container.d.ts +2 -0
- package/dist/standalone/container.d.ts.map +1 -0
- package/dist/standalone/context-menu.d.ts +2 -0
- package/dist/standalone/context-menu.d.ts.map +1 -0
- package/dist/standalone/control-group.d.ts +2 -0
- package/dist/standalone/control-group.d.ts.map +1 -0
- package/dist/standalone/data-table.d.ts +2 -0
- package/dist/standalone/data-table.d.ts.map +1 -0
- package/dist/standalone/date-field.d.ts +2 -0
- package/dist/standalone/date-field.d.ts.map +1 -0
- package/dist/standalone/date-picker.d.ts +2 -0
- package/dist/standalone/date-picker.d.ts.map +1 -0
- package/dist/standalone/date-range-picker.d.ts +2 -0
- package/dist/standalone/date-range-picker.d.ts.map +1 -0
- package/dist/standalone/date-range-time-picker.d.ts +2 -0
- package/dist/standalone/date-range-time-picker.d.ts.map +1 -0
- package/dist/standalone/date-time-picker.d.ts +2 -0
- package/dist/standalone/date-time-picker.d.ts.map +1 -0
- package/dist/standalone/description.d.ts +2 -0
- package/dist/standalone/description.d.ts.map +1 -0
- package/dist/standalone/dialog.d.ts +2 -0
- package/dist/standalone/dialog.d.ts.map +1 -0
- package/dist/standalone/direction-provider.d.ts +2 -0
- package/dist/standalone/direction-provider.d.ts.map +1 -0
- package/dist/standalone/dismissable-layer.d.ts +2 -0
- package/dist/standalone/dismissable-layer.d.ts.map +1 -0
- package/dist/standalone/dock.d.ts +2 -0
- package/dist/standalone/dock.d.ts.map +1 -0
- package/dist/standalone/drawer.d.ts +2 -0
- package/dist/standalone/drawer.d.ts.map +1 -0
- package/dist/standalone/dropdown.d.ts +2 -0
- package/dist/standalone/dropdown.d.ts.map +1 -0
- package/dist/standalone/dropzone.d.ts +2 -0
- package/dist/standalone/dropzone.d.ts.map +1 -0
- package/dist/standalone/empty-state.d.ts +2 -0
- package/dist/standalone/empty-state.d.ts.map +1 -0
- package/dist/standalone/field-error.d.ts +2 -0
- package/dist/standalone/field-error.d.ts.map +1 -0
- package/dist/standalone/field.d.ts +2 -0
- package/dist/standalone/field.d.ts.map +1 -0
- package/dist/standalone/fieldset.d.ts +2 -0
- package/dist/standalone/fieldset.d.ts.map +1 -0
- package/dist/standalone/file-upload.d.ts +2 -0
- package/dist/standalone/file-upload.d.ts.map +1 -0
- package/dist/standalone/flex.d.ts +2 -0
- package/dist/standalone/flex.d.ts.map +1 -0
- package/dist/standalone/floating-toolbar.d.ts +2 -0
- package/dist/standalone/floating-toolbar.d.ts.map +1 -0
- package/dist/standalone/focus-scope.d.ts +2 -0
- package/dist/standalone/focus-scope.d.ts.map +1 -0
- package/dist/standalone/form.d.ts +2 -0
- package/dist/standalone/form.d.ts.map +1 -0
- package/dist/standalone/gantt.d.ts +2 -0
- package/dist/standalone/gantt.d.ts.map +1 -0
- package/dist/standalone/grid.d.ts +2 -0
- package/dist/standalone/grid.d.ts.map +1 -0
- package/dist/standalone/hover-card.d.ts +2 -0
- package/dist/standalone/hover-card.d.ts.map +1 -0
- package/dist/standalone/icon-cloud.d.ts +2 -0
- package/dist/standalone/icon-cloud.d.ts.map +1 -0
- package/dist/standalone/icon.d.ts +2 -0
- package/dist/standalone/icon.d.ts.map +1 -0
- package/dist/standalone/inline-edit.d.ts +2 -0
- package/dist/standalone/inline-edit.d.ts.map +1 -0
- package/dist/standalone/input.d.ts +2 -0
- package/dist/standalone/input.d.ts.map +1 -0
- package/dist/standalone/label.d.ts +2 -0
- package/dist/standalone/label.d.ts.map +1 -0
- package/dist/standalone/layout.d.ts +2 -0
- package/dist/standalone/layout.d.ts.map +1 -0
- package/dist/standalone/listbox.d.ts +2 -0
- package/dist/standalone/listbox.d.ts.map +1 -0
- package/dist/standalone/marquee.d.ts +2 -0
- package/dist/standalone/marquee.d.ts.map +1 -0
- package/dist/standalone/masonry-grid.d.ts +2 -0
- package/dist/standalone/masonry-grid.d.ts.map +1 -0
- package/dist/standalone/menu.d.ts +2 -0
- package/dist/standalone/menu.d.ts.map +1 -0
- package/dist/standalone/menubar.d.ts +2 -0
- package/dist/standalone/menubar.d.ts.map +1 -0
- package/dist/standalone/meter.d.ts +2 -0
- package/dist/standalone/meter.d.ts.map +1 -0
- package/dist/standalone/multi-select.d.ts +2 -0
- package/dist/standalone/multi-select.d.ts.map +1 -0
- package/dist/standalone/navigation-menu.d.ts +2 -0
- package/dist/standalone/navigation-menu.d.ts.map +1 -0
- package/dist/standalone/number-field.d.ts +2 -0
- package/dist/standalone/number-field.d.ts.map +1 -0
- package/dist/standalone/number-ticker.d.ts +2 -0
- package/dist/standalone/number-ticker.d.ts.map +1 -0
- package/dist/standalone/odometer.d.ts +2 -0
- package/dist/standalone/odometer.d.ts.map +1 -0
- package/dist/standalone/orbiter.d.ts +2 -0
- package/dist/standalone/orbiter.d.ts.map +1 -0
- package/dist/standalone/pagination.d.ts +2 -0
- package/dist/standalone/pagination.d.ts.map +1 -0
- package/dist/standalone/panel-group.d.ts +2 -0
- package/dist/standalone/panel-group.d.ts.map +1 -0
- package/dist/standalone/panel.d.ts +2 -0
- package/dist/standalone/panel.d.ts.map +1 -0
- package/dist/standalone/password-field.d.ts +2 -0
- package/dist/standalone/password-field.d.ts.map +1 -0
- package/dist/standalone/pin-input.d.ts +2 -0
- package/dist/standalone/pin-input.d.ts.map +1 -0
- package/dist/standalone/placement-grid.d.ts +2 -0
- package/dist/standalone/placement-grid.d.ts.map +1 -0
- package/dist/standalone/plugin-panel.d.ts +2 -0
- package/dist/standalone/plugin-panel.d.ts.map +1 -0
- package/dist/standalone/popover.d.ts +2 -0
- package/dist/standalone/popover.d.ts.map +1 -0
- package/dist/standalone/portal.d.ts +2 -0
- package/dist/standalone/portal.d.ts.map +1 -0
- package/dist/standalone/positioner.d.ts +2 -0
- package/dist/standalone/positioner.d.ts.map +1 -0
- package/dist/standalone/presence.d.ts +2 -0
- package/dist/standalone/presence.d.ts.map +1 -0
- package/dist/standalone/progress.d.ts +2 -0
- package/dist/standalone/progress.d.ts.map +1 -0
- package/dist/standalone/quick-actions.d.ts +2 -0
- package/dist/standalone/quick-actions.d.ts.map +1 -0
- package/dist/standalone/radio-group.d.ts +2 -0
- package/dist/standalone/radio-group.d.ts.map +1 -0
- package/dist/standalone/rating.d.ts +2 -0
- package/dist/standalone/rating.d.ts.map +1 -0
- package/dist/standalone/roving-focus-group.d.ts +2 -0
- package/dist/standalone/roving-focus-group.d.ts.map +1 -0
- package/dist/standalone/scroll-area.d.ts +2 -0
- package/dist/standalone/scroll-area.d.ts.map +1 -0
- package/dist/standalone/section.d.ts +2 -0
- package/dist/standalone/section.d.ts.map +1 -0
- package/dist/standalone/select.d.ts +2 -0
- package/dist/standalone/select.d.ts.map +1 -0
- package/dist/standalone/selection-popup.d.ts +2 -0
- package/dist/standalone/selection-popup.d.ts.map +1 -0
- package/dist/standalone/separator.d.ts +2 -0
- package/dist/standalone/separator.d.ts.map +1 -0
- package/dist/standalone/sidebar.d.ts +2 -0
- package/dist/standalone/sidebar.d.ts.map +1 -0
- package/dist/standalone/skeleton.d.ts +2 -0
- package/dist/standalone/skeleton.d.ts.map +1 -0
- package/dist/standalone/slider.d.ts +2 -0
- package/dist/standalone/slider.d.ts.map +1 -0
- package/dist/standalone/slot.d.ts +2 -0
- package/dist/standalone/slot.d.ts.map +1 -0
- package/dist/standalone/spinning-text.d.ts +2 -0
- package/dist/standalone/spinning-text.d.ts.map +1 -0
- package/dist/standalone/split-button.d.ts +2 -0
- package/dist/standalone/split-button.d.ts.map +1 -0
- package/dist/standalone/splitter.d.ts +2 -0
- package/dist/standalone/splitter.d.ts.map +1 -0
- package/dist/standalone/stepper.d.ts +2 -0
- package/dist/standalone/stepper.d.ts.map +1 -0
- package/dist/standalone/switch.d.ts +2 -0
- package/dist/standalone/switch.d.ts.map +1 -0
- package/dist/standalone/table.d.ts +2 -0
- package/dist/standalone/table.d.ts.map +1 -0
- package/dist/standalone/tabs.d.ts +2 -0
- package/dist/standalone/tabs.d.ts.map +1 -0
- package/dist/standalone/tags-input.d.ts +2 -0
- package/dist/standalone/tags-input.d.ts.map +1 -0
- package/dist/standalone/textarea.d.ts +2 -0
- package/dist/standalone/textarea.d.ts.map +1 -0
- package/dist/standalone/time-field.d.ts +2 -0
- package/dist/standalone/time-field.d.ts.map +1 -0
- package/dist/standalone/time-picker.d.ts +2 -0
- package/dist/standalone/time-picker.d.ts.map +1 -0
- package/dist/standalone/timeline.d.ts +2 -0
- package/dist/standalone/timeline.d.ts.map +1 -0
- package/dist/standalone/toast.d.ts +2 -0
- package/dist/standalone/toast.d.ts.map +1 -0
- package/dist/standalone/toggle-group.d.ts +2 -0
- package/dist/standalone/toggle-group.d.ts.map +1 -0
- package/dist/standalone/toggle.d.ts +2 -0
- package/dist/standalone/toggle.d.ts.map +1 -0
- package/dist/standalone/toolbar.d.ts +2 -0
- package/dist/standalone/toolbar.d.ts.map +1 -0
- package/dist/standalone/tooltip.d.ts +2 -0
- package/dist/standalone/tooltip.d.ts.map +1 -0
- package/dist/standalone/transfer-list.d.ts +2 -0
- package/dist/standalone/transfer-list.d.ts.map +1 -0
- package/dist/standalone/tree-item.d.ts +2 -0
- package/dist/standalone/tree-item.d.ts.map +1 -0
- package/dist/standalone/tree.d.ts +2 -0
- package/dist/standalone/tree.d.ts.map +1 -0
- package/dist/standalone/visually-hidden.d.ts +2 -0
- package/dist/standalone/visually-hidden.d.ts.map +1 -0
- package/dist/standalone/wizard.d.ts +2 -0
- package/dist/standalone/wizard.d.ts.map +1 -0
- package/dist/stepper.cjs.js +337 -0
- package/dist/stepper.esm.js +578 -0
- package/dist/switch.cjs.js +397 -0
- package/dist/switch.esm.js +543 -0
- package/dist/table.cjs.js +212 -0
- package/dist/table.esm.js +432 -0
- package/dist/tabs.cjs.js +515 -0
- package/dist/tabs.esm.js +808 -0
- package/dist/tags-input.cjs.js +202 -0
- package/dist/tags-input.esm.js +436 -0
- package/dist/textarea.cjs.js +329 -0
- package/dist/textarea.esm.js +520 -0
- package/dist/time-field.cjs.js +142 -0
- package/dist/time-field.esm.js +387 -0
- package/dist/time-picker.cjs.js +284 -0
- package/dist/time-picker.esm.js +686 -0
- package/dist/timeline.cjs.js +198 -0
- package/dist/timeline.esm.js +248 -0
- package/dist/toast.cjs.js +234 -0
- package/dist/toast.esm.js +399 -0
- package/dist/toggle-group.cjs.js +131 -0
- package/dist/toggle-group.esm.js +382 -0
- package/dist/toggle.cjs.js +237 -0
- package/dist/toggle.esm.js +346 -0
- package/dist/toolbar.cjs.js +126 -0
- package/dist/toolbar.esm.js +240 -0
- package/dist/tooltip.cjs.js +159 -0
- package/dist/tooltip.esm.js +376 -0
- package/dist/transfer-list.cjs.js +734 -0
- package/dist/transfer-list.esm.js +969 -0
- package/dist/tree-0a7a8d05.js +39 -0
- package/dist/tree-dcd74a4a.mjs +294 -0
- package/dist/tree-item.cjs.js +103 -0
- package/dist/tree-item.esm.js +143 -0
- package/dist/tree.cjs.js +1 -0
- package/dist/tree.esm.js +7 -0
- package/dist/visually-hidden.cjs.js +42 -0
- package/dist/visually-hidden.esm.js +68 -0
- package/dist/wizard.cjs.js +677 -0
- package/dist/wizard.esm.js +1068 -0
- package/package.json +7 -1
- package/dist/runtime-41717c1e.js +0 -1
- package/dist/sortable-06a3bd6c.js +0 -855
- package/dist/sortable-23bf110b.mjs +0 -2254
|
@@ -0,0 +1,1809 @@
|
|
|
1
|
+
import { E as V } from "./ElementBase-909688f3.mjs";
|
|
2
|
+
import { r as W, l as K, i as I, s as G, c as X } from "./date-time-utils-bdceb7af.mjs";
|
|
3
|
+
import "./calendar-2c11b824.mjs";
|
|
4
|
+
import "./scroll-lock-9de6d328.mjs";
|
|
5
|
+
function g(s, t, e) {
|
|
6
|
+
return Math.max(t, Math.min(e, s));
|
|
7
|
+
}
|
|
8
|
+
function m(s, t = 3) {
|
|
9
|
+
const e = 10 ** t;
|
|
10
|
+
return Math.round(s * e) / e;
|
|
11
|
+
}
|
|
12
|
+
function P(s) {
|
|
13
|
+
return g(Math.round(s), 0, 255);
|
|
14
|
+
}
|
|
15
|
+
function O(s) {
|
|
16
|
+
const t = s.trim();
|
|
17
|
+
if (!t)
|
|
18
|
+
return null;
|
|
19
|
+
if (t.endsWith("%")) {
|
|
20
|
+
const r = Number(t.slice(0, -1));
|
|
21
|
+
return Number.isFinite(r) ? g(r / 100, 0, 1) : null;
|
|
22
|
+
}
|
|
23
|
+
const e = Number(t);
|
|
24
|
+
return Number.isFinite(e) ? g(e, 0, 1) : null;
|
|
25
|
+
}
|
|
26
|
+
function B(s) {
|
|
27
|
+
const t = s.trim();
|
|
28
|
+
if (!t)
|
|
29
|
+
return null;
|
|
30
|
+
if (t.endsWith("%")) {
|
|
31
|
+
const r = Number(t.slice(0, -1));
|
|
32
|
+
return Number.isFinite(r) ? P(g(r, 0, 100) / 100 * 255) : null;
|
|
33
|
+
}
|
|
34
|
+
const e = Number(t);
|
|
35
|
+
return Number.isFinite(e) ? P(e) : null;
|
|
36
|
+
}
|
|
37
|
+
function H(s) {
|
|
38
|
+
const t = s.trim();
|
|
39
|
+
if (!t.endsWith("%"))
|
|
40
|
+
return null;
|
|
41
|
+
const e = Number(t.slice(0, -1));
|
|
42
|
+
return Number.isFinite(e) ? g(e, 0, 100) : null;
|
|
43
|
+
}
|
|
44
|
+
function Y(s) {
|
|
45
|
+
const t = s.trim().toLowerCase();
|
|
46
|
+
if (!t)
|
|
47
|
+
return null;
|
|
48
|
+
if (t.endsWith("deg")) {
|
|
49
|
+
const r = Number(t.slice(0, -3));
|
|
50
|
+
return Number.isFinite(r) ? w(r) : null;
|
|
51
|
+
}
|
|
52
|
+
if (t.endsWith("turn")) {
|
|
53
|
+
const r = Number(t.slice(0, -4));
|
|
54
|
+
return Number.isFinite(r) ? w(r * 360) : null;
|
|
55
|
+
}
|
|
56
|
+
if (t.endsWith("rad")) {
|
|
57
|
+
const r = Number(t.slice(0, -3));
|
|
58
|
+
return Number.isFinite(r) ? w(r * 180 / Math.PI) : null;
|
|
59
|
+
}
|
|
60
|
+
const e = Number(t);
|
|
61
|
+
return Number.isFinite(e) ? w(e) : null;
|
|
62
|
+
}
|
|
63
|
+
function w(s) {
|
|
64
|
+
const t = s % 360;
|
|
65
|
+
return t < 0 ? t + 360 : t;
|
|
66
|
+
}
|
|
67
|
+
function F(s) {
|
|
68
|
+
const t = s.trim();
|
|
69
|
+
if (!t)
|
|
70
|
+
return null;
|
|
71
|
+
if (t.includes("/")) {
|
|
72
|
+
const [r, i] = t.split("/");
|
|
73
|
+
if (i == null)
|
|
74
|
+
return null;
|
|
75
|
+
const a = r.includes(",") ? r.split(",") : r.trim().split(/\s+/);
|
|
76
|
+
return a.length < 3 ? null : {
|
|
77
|
+
channels: a.map((n) => n.trim()).filter(Boolean),
|
|
78
|
+
alpha: i.trim()
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (t.includes(",")) {
|
|
82
|
+
const r = t.split(",").map((i) => i.trim()).filter(Boolean);
|
|
83
|
+
return r.length < 3 ? null : {
|
|
84
|
+
channels: r.slice(0, 3),
|
|
85
|
+
alpha: r[3] ?? null
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const e = t.split(/\s+/).map((r) => r.trim()).filter(Boolean);
|
|
89
|
+
return e.length < 3 ? null : {
|
|
90
|
+
channels: e.slice(0, 3),
|
|
91
|
+
alpha: e[3] ?? null
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function j(s) {
|
|
95
|
+
const t = s.trim().replace(/^#/, "");
|
|
96
|
+
if (![3, 4, 6, 8].includes(t.length) || !/^[0-9a-f]+$/i.test(t))
|
|
97
|
+
return null;
|
|
98
|
+
if (t.length === 3 || t.length === 4) {
|
|
99
|
+
const n = parseInt(t[0] + t[0], 16), o = parseInt(t[1] + t[1], 16), l = parseInt(t[2] + t[2], 16), c = t.length === 4 ? parseInt(t[3] + t[3], 16) / 255 : 1;
|
|
100
|
+
return h({ r: n, g: o, b: l, a: c });
|
|
101
|
+
}
|
|
102
|
+
const e = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
|
|
103
|
+
return h({ r: e, g: r, b: i, a });
|
|
104
|
+
}
|
|
105
|
+
function J(s) {
|
|
106
|
+
const t = /^rgba?\((.+)\)$/i.exec(s.trim());
|
|
107
|
+
if (!t)
|
|
108
|
+
return null;
|
|
109
|
+
const e = F(t[1]);
|
|
110
|
+
if (!e || e.channels.length < 3)
|
|
111
|
+
return null;
|
|
112
|
+
const r = B(e.channels[0]), i = B(e.channels[1]), a = B(e.channels[2]);
|
|
113
|
+
if (r == null || i == null || a == null)
|
|
114
|
+
return null;
|
|
115
|
+
const n = e.alpha != null ? O(e.alpha) : 1;
|
|
116
|
+
return n == null ? null : h({ r, g: i, b: a, a: n });
|
|
117
|
+
}
|
|
118
|
+
function Q(s) {
|
|
119
|
+
const t = /^hsla?\((.+)\)$/i.exec(s.trim());
|
|
120
|
+
if (!t)
|
|
121
|
+
return null;
|
|
122
|
+
const e = F(t[1]);
|
|
123
|
+
if (!e || e.channels.length < 3)
|
|
124
|
+
return null;
|
|
125
|
+
const r = Y(e.channels[0]), i = H(e.channels[1]), a = H(e.channels[2]);
|
|
126
|
+
if (r == null || i == null || a == null)
|
|
127
|
+
return null;
|
|
128
|
+
const n = e.alpha != null ? O(e.alpha) : 1;
|
|
129
|
+
return n == null ? null : U({ h: r, s: i, l: a, a: n });
|
|
130
|
+
}
|
|
131
|
+
function h(s) {
|
|
132
|
+
return {
|
|
133
|
+
r: P(s.r),
|
|
134
|
+
g: P(s.g),
|
|
135
|
+
b: P(s.b),
|
|
136
|
+
a: m(g(s.a, 0, 1), 4)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function f(s) {
|
|
140
|
+
const t = (s || "").trim();
|
|
141
|
+
return t ? t.startsWith("#") ? j(t) : /^rgba?\(/i.test(t) ? J(t) : /^hsla?\(/i.test(t) ? Q(t) : null : null;
|
|
142
|
+
}
|
|
143
|
+
function Z(s, t = !1) {
|
|
144
|
+
const e = h(s), r = (a) => a.toString(16).padStart(2, "0"), i = `#${r(e.r)}${r(e.g)}${r(e.b)}`;
|
|
145
|
+
return t ? `${i}${r(Math.round(e.a * 255))}` : i;
|
|
146
|
+
}
|
|
147
|
+
function tt(s, t = !0) {
|
|
148
|
+
const e = h(s);
|
|
149
|
+
return !t || e.a >= 1 ? `rgb(${e.r} ${e.g} ${e.b})` : `rgb(${e.r} ${e.g} ${e.b} / ${m(e.a, 3)})`;
|
|
150
|
+
}
|
|
151
|
+
function et(s, t = !0) {
|
|
152
|
+
const e = Math.round(w(s.h)), r = Math.round(g(s.s, 0, 100)), i = Math.round(g(s.l, 0, 100)), a = m(g(s.a, 0, 1), 3);
|
|
153
|
+
return !t || a >= 1 ? `hsl(${e} ${r}% ${i}%)` : `hsl(${e} ${r}% ${i}% / ${a})`;
|
|
154
|
+
}
|
|
155
|
+
function T(s) {
|
|
156
|
+
const t = h(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n;
|
|
157
|
+
let l = 0;
|
|
158
|
+
o !== 0 && (a === e ? l = (r - i) / o % 6 : a === r ? l = (i - e) / o + 2 : l = (e - r) / o + 4, l *= 60, l < 0 && (l += 360));
|
|
159
|
+
const c = a === 0 ? 0 : o / a * 100, b = a * 100;
|
|
160
|
+
return {
|
|
161
|
+
h: m(l, 3),
|
|
162
|
+
s: m(c, 3),
|
|
163
|
+
v: m(b, 3),
|
|
164
|
+
a: t.a
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function rt(s) {
|
|
168
|
+
const t = w(s.h), e = g(s.s, 0, 100) / 100, r = g(s.v, 0, 100) / 100, i = r * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i;
|
|
169
|
+
let o = 0, l = 0, c = 0;
|
|
170
|
+
return t < 60 ? (o = i, l = a) : t < 120 ? (o = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (o = a, c = i) : (o = i, c = a), h({
|
|
171
|
+
r: (o + n) * 255,
|
|
172
|
+
g: (l + n) * 255,
|
|
173
|
+
b: (c + n) * 255,
|
|
174
|
+
a: s.a
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function L(s) {
|
|
178
|
+
const t = h(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n, l = (a + n) / 2;
|
|
179
|
+
let c = 0, b = 0;
|
|
180
|
+
return o !== 0 && (b = o / (1 - Math.abs(2 * l - 1)), a === e ? c = (r - i) / o % 6 : a === r ? c = (i - e) / o + 2 : c = (e - r) / o + 4, c *= 60, c < 0 && (c += 360)), {
|
|
181
|
+
h: m(c, 3),
|
|
182
|
+
s: m(b * 100, 3),
|
|
183
|
+
l: m(l * 100, 3),
|
|
184
|
+
a: t.a
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function U(s) {
|
|
188
|
+
const t = w(s.h), e = g(s.s, 0, 100) / 100, r = g(s.l, 0, 100) / 100, i = (1 - Math.abs(2 * r - 1)) * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i / 2;
|
|
189
|
+
let o = 0, l = 0, c = 0;
|
|
190
|
+
return t < 60 ? (o = i, l = a) : t < 120 ? (o = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (o = a, c = i) : (o = i, c = a), h({
|
|
191
|
+
r: (o + n) * 255,
|
|
192
|
+
g: (l + n) * 255,
|
|
193
|
+
b: (c + n) * 255,
|
|
194
|
+
a: s.a
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function x(s, t) {
|
|
198
|
+
return Z(s, t).toUpperCase();
|
|
199
|
+
}
|
|
200
|
+
function S(s, t) {
|
|
201
|
+
return tt(s, t);
|
|
202
|
+
}
|
|
203
|
+
function it(s, t) {
|
|
204
|
+
return et(L(s), t);
|
|
205
|
+
}
|
|
206
|
+
const z = "#2563eb", $ = "editora:ui-color-picker:recent", at = `
|
|
207
|
+
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
208
|
+
<path d="m5.6 7.6 4.4 4.6 4.4-4.6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
209
|
+
</svg>
|
|
210
|
+
`, q = `
|
|
211
|
+
:host {
|
|
212
|
+
--ui-cp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
213
|
+
--ui-cp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent);
|
|
214
|
+
--ui-cp-text: var(--ui-color-text, #0f172a);
|
|
215
|
+
--ui-cp-muted: var(--ui-color-muted, #64748b);
|
|
216
|
+
--ui-cp-accent: var(--ui-color-primary, #2563eb);
|
|
217
|
+
--ui-cp-success: var(--ui-color-success, #16a34a);
|
|
218
|
+
--ui-cp-warning: var(--ui-color-warning, #d97706);
|
|
219
|
+
--ui-cp-danger: var(--ui-color-danger, #dc2626);
|
|
220
|
+
--ui-cp-radius: 14px;
|
|
221
|
+
--ui-cp-shadow: none;
|
|
222
|
+
--ui-cp-padding: 10px;
|
|
223
|
+
--ui-cp-duration: 160ms;
|
|
224
|
+
--ui-cp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
225
|
+
--ui-cp-z: 1600;
|
|
226
|
+
--ui-cp-thumb: #ffffff;
|
|
227
|
+
--ui-cp-thumb-ring: color-mix(in srgb, var(--ui-cp-accent) 44%, transparent);
|
|
228
|
+
--ui-cp-checker-a: #e2e8f0;
|
|
229
|
+
--ui-cp-checker-b: #f8fafc;
|
|
230
|
+
--ui-cp-swatch-size: 22px;
|
|
231
|
+
--ui-cp-gap: 8px;
|
|
232
|
+
color-scheme: light dark;
|
|
233
|
+
display: inline-block;
|
|
234
|
+
min-inline-size: min(260px, 100%);
|
|
235
|
+
inline-size: min(100%, var(--ui-width, 312px));
|
|
236
|
+
font-family: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
237
|
+
color: var(--ui-cp-text);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host([size="sm"]) {
|
|
241
|
+
--ui-cp-padding: 8px;
|
|
242
|
+
--ui-cp-gap: 7px;
|
|
243
|
+
--ui-cp-swatch-size: 20px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
:host([size="lg"]) {
|
|
247
|
+
--ui-cp-padding: 12px;
|
|
248
|
+
--ui-cp-gap: 10px;
|
|
249
|
+
--ui-cp-swatch-size: 24px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:host([variant="contrast"]) {
|
|
253
|
+
--ui-cp-bg: #0f172a;
|
|
254
|
+
--ui-cp-border: #334155;
|
|
255
|
+
--ui-cp-text: #e2e8f0;
|
|
256
|
+
--ui-cp-muted: #93a4bd;
|
|
257
|
+
--ui-cp-accent: #93c5fd;
|
|
258
|
+
--ui-cp-checker-a: #475569;
|
|
259
|
+
--ui-cp-checker-b: #334155;
|
|
260
|
+
--ui-cp-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
:host([tone="neutral"]) {
|
|
264
|
+
--ui-cp-accent: color-mix(in srgb, var(--ui-cp-text) 38%, var(--ui-cp-muted) 62%);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
:host([tone="success"]) {
|
|
268
|
+
--ui-cp-accent: var(--ui-cp-success);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:host([tone="warning"]) {
|
|
272
|
+
--ui-cp-accent: var(--ui-cp-warning);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
:host([tone="danger"]) {
|
|
276
|
+
--ui-cp-accent: var(--ui-cp-danger);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
:host([state="error"]) {
|
|
280
|
+
--ui-cp-accent: var(--ui-cp-danger);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:host([state="success"]) {
|
|
284
|
+
--ui-cp-accent: var(--ui-cp-success);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.root {
|
|
288
|
+
display: grid;
|
|
289
|
+
gap: 8px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.trigger-wrap[hidden] {
|
|
293
|
+
display: none;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.trigger {
|
|
297
|
+
inline-size: 100%;
|
|
298
|
+
min-block-size: 38px;
|
|
299
|
+
border-radius: calc(var(--ui-cp-radius) - 2px);
|
|
300
|
+
border: 1px solid var(--ui-cp-border);
|
|
301
|
+
background: var(--ui-cp-bg);
|
|
302
|
+
color: var(--ui-cp-text);
|
|
303
|
+
box-shadow: 0 1px 2px rgba(2, 6, 23, 0.08);
|
|
304
|
+
padding: 0 10px;
|
|
305
|
+
display: grid;
|
|
306
|
+
grid-template-columns: auto 1fr auto;
|
|
307
|
+
align-items: center;
|
|
308
|
+
gap: 8px;
|
|
309
|
+
text-align: left;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
transition:
|
|
312
|
+
border-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
313
|
+
background-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
314
|
+
box-shadow var(--ui-cp-duration) var(--ui-cp-ease),
|
|
315
|
+
color var(--ui-cp-duration) var(--ui-cp-ease);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.trigger:hover {
|
|
319
|
+
border-color: color-mix(in srgb, var(--ui-cp-accent) 32%, var(--ui-cp-border));
|
|
320
|
+
box-shadow: 0 2px 8px rgba(2, 6, 23, 0.12);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.trigger:active {
|
|
324
|
+
transform: translateY(1px);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.trigger:focus-visible {
|
|
328
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
329
|
+
outline-offset: 1px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.trigger[disabled] {
|
|
333
|
+
cursor: not-allowed;
|
|
334
|
+
opacity: 0.62;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.trigger-preview {
|
|
338
|
+
inline-size: 16px;
|
|
339
|
+
block-size: 16px;
|
|
340
|
+
border-radius: 6px;
|
|
341
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 88%, transparent);
|
|
342
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
|
|
343
|
+
background: #2563eb;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.trigger-value {
|
|
347
|
+
min-inline-size: 0;
|
|
348
|
+
overflow: hidden;
|
|
349
|
+
text-overflow: ellipsis;
|
|
350
|
+
white-space: nowrap;
|
|
351
|
+
font: 600 12px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.trigger-chevron {
|
|
355
|
+
inline-size: 14px;
|
|
356
|
+
block-size: 14px;
|
|
357
|
+
display: inline-grid;
|
|
358
|
+
place-items: center;
|
|
359
|
+
color: color-mix(in srgb, var(--ui-cp-text) 70%, transparent);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.trigger-chevron svg {
|
|
363
|
+
inline-size: 14px;
|
|
364
|
+
block-size: 14px;
|
|
365
|
+
pointer-events: none;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.panel-inline[hidden] {
|
|
369
|
+
display: none !important;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.panel {
|
|
373
|
+
border: 1px solid var(--ui-cp-border);
|
|
374
|
+
border-radius: var(--ui-cp-radius);
|
|
375
|
+
background: var(--ui-cp-bg);
|
|
376
|
+
box-shadow: var(--ui-cp-shadow);
|
|
377
|
+
padding: var(--ui-cp-padding);
|
|
378
|
+
display: grid;
|
|
379
|
+
gap: var(--ui-cp-gap);
|
|
380
|
+
min-inline-size: 0;
|
|
381
|
+
transition:
|
|
382
|
+
border-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
383
|
+
box-shadow var(--ui-cp-duration) var(--ui-cp-ease),
|
|
384
|
+
background-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
385
|
+
opacity var(--ui-cp-duration) var(--ui-cp-ease);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.panel[data-state="error"] {
|
|
389
|
+
border-color: color-mix(in srgb, var(--ui-cp-danger) 46%, var(--ui-cp-border));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.panel[data-state="success"] {
|
|
393
|
+
border-color: color-mix(in srgb, var(--ui-cp-success) 42%, var(--ui-cp-border));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.panel[data-state="loading"] {
|
|
397
|
+
opacity: 0.92;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.panel,
|
|
401
|
+
.panel * {
|
|
402
|
+
box-sizing: border-box;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.header {
|
|
406
|
+
display: grid;
|
|
407
|
+
grid-template-columns: 1fr auto;
|
|
408
|
+
gap: 8px;
|
|
409
|
+
align-items: center;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.heading {
|
|
413
|
+
min-inline-size: 0;
|
|
414
|
+
display: grid;
|
|
415
|
+
gap: 4px;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.label {
|
|
419
|
+
font: 700 13px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
420
|
+
color: var(--ui-cp-text);
|
|
421
|
+
white-space: nowrap;
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
text-overflow: ellipsis;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.value {
|
|
427
|
+
font: 500 11px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
428
|
+
color: var(--ui-cp-muted);
|
|
429
|
+
white-space: nowrap;
|
|
430
|
+
overflow: hidden;
|
|
431
|
+
text-overflow: ellipsis;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.header-actions {
|
|
435
|
+
display: inline-flex;
|
|
436
|
+
align-items: center;
|
|
437
|
+
gap: 6px;
|
|
438
|
+
flex-wrap: wrap;
|
|
439
|
+
justify-content: flex-end;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.preview {
|
|
443
|
+
inline-size: 20px;
|
|
444
|
+
block-size: 20px;
|
|
445
|
+
border-radius: 6px;
|
|
446
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 86%, transparent);
|
|
447
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
|
|
448
|
+
background: #2563eb;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.status-pill {
|
|
452
|
+
display: inline-flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
min-block-size: 20px;
|
|
455
|
+
border-radius: 999px;
|
|
456
|
+
padding: 0 8px;
|
|
457
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-accent) 36%, var(--ui-cp-border));
|
|
458
|
+
background: color-mix(in srgb, var(--ui-cp-accent) 12%, transparent);
|
|
459
|
+
color: color-mix(in srgb, var(--ui-cp-accent) 82%, var(--ui-cp-text));
|
|
460
|
+
font: 650 10px/1 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
461
|
+
letter-spacing: 0.04em;
|
|
462
|
+
text-transform: uppercase;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.status-pill[hidden] {
|
|
466
|
+
display: none !important;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.icon-btn {
|
|
470
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
|
|
471
|
+
background: color-mix(in srgb, var(--ui-cp-bg) 94%, transparent);
|
|
472
|
+
color: var(--ui-cp-text);
|
|
473
|
+
min-inline-size: 32px;
|
|
474
|
+
block-size: 30px;
|
|
475
|
+
border-radius: 9px;
|
|
476
|
+
padding: 0 8px;
|
|
477
|
+
display: inline-grid;
|
|
478
|
+
place-items: center;
|
|
479
|
+
cursor: pointer;
|
|
480
|
+
font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
481
|
+
transition:
|
|
482
|
+
border-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
483
|
+
background-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
484
|
+
color var(--ui-cp-duration) var(--ui-cp-ease);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.icon-btn:hover {
|
|
488
|
+
background: color-mix(in srgb, var(--ui-cp-accent) 12%, transparent);
|
|
489
|
+
border-color: color-mix(in srgb, var(--ui-cp-accent) 34%, var(--ui-cp-border));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.icon-btn:focus-visible {
|
|
493
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 62%, transparent);
|
|
494
|
+
outline-offset: 1px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.icon-btn[hidden] {
|
|
498
|
+
display: none !important;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.icon-btn[disabled] {
|
|
502
|
+
opacity: 0.52;
|
|
503
|
+
cursor: not-allowed;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.body {
|
|
507
|
+
display: grid;
|
|
508
|
+
gap: 8px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.sv {
|
|
512
|
+
position: relative;
|
|
513
|
+
inline-size: 100%;
|
|
514
|
+
block-size: clamp(128px, 16vw, 156px);
|
|
515
|
+
border-radius: 10px;
|
|
516
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 82%, transparent);
|
|
517
|
+
overflow: visible;
|
|
518
|
+
cursor: crosshair;
|
|
519
|
+
touch-action: none;
|
|
520
|
+
background:
|
|
521
|
+
linear-gradient(to top, #000, transparent),
|
|
522
|
+
linear-gradient(to right, #fff, #f00);
|
|
523
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-cp-border) 42%, transparent);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.sv:focus-visible,
|
|
527
|
+
.slider:focus-visible {
|
|
528
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
529
|
+
outline-offset: 1px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.thumb {
|
|
533
|
+
position: absolute;
|
|
534
|
+
inline-size: 12px;
|
|
535
|
+
block-size: 12px;
|
|
536
|
+
margin-inline-start: -6px;
|
|
537
|
+
margin-block-start: -6px;
|
|
538
|
+
border-radius: 999px;
|
|
539
|
+
background: var(--ui-cp-thumb);
|
|
540
|
+
border: 2px solid rgba(255, 255, 255, 0.95);
|
|
541
|
+
box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.35), 0 0 0 4px color-mix(in srgb, var(--ui-cp-thumb-ring) 28%, transparent);
|
|
542
|
+
pointer-events: none;
|
|
543
|
+
transform: translate3d(0, 0, 0);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.slider {
|
|
547
|
+
position: relative;
|
|
548
|
+
block-size: 12px;
|
|
549
|
+
border-radius: 999px;
|
|
550
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 82%, transparent);
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
touch-action: none;
|
|
553
|
+
overflow: visible;
|
|
554
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-cp-border) 40%, transparent);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.slider.hue {
|
|
558
|
+
background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.slider.alpha {
|
|
562
|
+
background-image:
|
|
563
|
+
linear-gradient(45deg, var(--ui-cp-checker-a) 25%, transparent 25%),
|
|
564
|
+
linear-gradient(-45deg, var(--ui-cp-checker-a) 25%, transparent 25%),
|
|
565
|
+
linear-gradient(45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
|
|
566
|
+
linear-gradient(-45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
|
|
567
|
+
linear-gradient(to right, transparent, rgba(0, 0, 0, 1));
|
|
568
|
+
background-size: 10px 10px, 10px 10px, 10px 10px, 10px 10px, 100% 100%;
|
|
569
|
+
background-position: 0 0, 0 5px, 5px -5px, -5px 0, 0 0;
|
|
570
|
+
background-color: var(--ui-cp-checker-b);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.slider-thumb {
|
|
574
|
+
position: absolute;
|
|
575
|
+
inset-block-start: 50%;
|
|
576
|
+
inline-size: 12px;
|
|
577
|
+
block-size: 12px;
|
|
578
|
+
margin-inline-start: -6px;
|
|
579
|
+
margin-block-start: -6px;
|
|
580
|
+
border-radius: 999px;
|
|
581
|
+
background: var(--ui-cp-thumb);
|
|
582
|
+
border: 2px solid rgba(255, 255, 255, 0.95);
|
|
583
|
+
box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.3);
|
|
584
|
+
pointer-events: none;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.alpha-row[hidden] {
|
|
588
|
+
display: none !important;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.footer {
|
|
592
|
+
display: grid;
|
|
593
|
+
gap: 8px;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.tabs {
|
|
597
|
+
display: inline-grid;
|
|
598
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
599
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
|
|
600
|
+
border-radius: 10px;
|
|
601
|
+
overflow: hidden;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.tab {
|
|
605
|
+
border: 0;
|
|
606
|
+
background: transparent;
|
|
607
|
+
color: var(--ui-cp-muted);
|
|
608
|
+
min-block-size: 30px;
|
|
609
|
+
font: 650 11px/1 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
610
|
+
cursor: pointer;
|
|
611
|
+
transition:
|
|
612
|
+
background-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
613
|
+
color var(--ui-cp-duration) var(--ui-cp-ease);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.tab[data-active="true"] {
|
|
617
|
+
background: color-mix(in srgb, var(--ui-cp-accent) 15%, transparent);
|
|
618
|
+
color: var(--ui-cp-text);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.tab:focus-visible {
|
|
622
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
623
|
+
outline-offset: -2px;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.group {
|
|
627
|
+
display: grid;
|
|
628
|
+
gap: 8px;
|
|
629
|
+
min-inline-size: 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.group[hidden] {
|
|
633
|
+
display: none !important;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.input-row {
|
|
637
|
+
display: grid;
|
|
638
|
+
grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
|
|
639
|
+
gap: 6px;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.input-row[data-fields="3"] {
|
|
643
|
+
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.field {
|
|
647
|
+
display: grid;
|
|
648
|
+
gap: 4px;
|
|
649
|
+
min-inline-size: 0;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.field > span {
|
|
653
|
+
font: 600 10px/1 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
654
|
+
color: var(--ui-cp-muted);
|
|
655
|
+
letter-spacing: 0.02em;
|
|
656
|
+
text-transform: uppercase;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.input {
|
|
660
|
+
min-inline-size: 0;
|
|
661
|
+
inline-size: 100%;
|
|
662
|
+
min-block-size: 28px;
|
|
663
|
+
border-radius: 8px;
|
|
664
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 86%, transparent);
|
|
665
|
+
background: color-mix(in srgb, var(--ui-cp-bg) 95%, transparent);
|
|
666
|
+
color: var(--ui-cp-text);
|
|
667
|
+
font: 600 11px/1.1 "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
|
|
668
|
+
padding: 0 7px;
|
|
669
|
+
max-inline-size: 100%;
|
|
670
|
+
overflow: hidden;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.input:focus-visible {
|
|
674
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
675
|
+
outline-offset: 1px;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.swatches-wrap {
|
|
679
|
+
display: grid;
|
|
680
|
+
gap: 6px;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.swatches-title {
|
|
684
|
+
font: 600 10px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
685
|
+
color: var(--ui-cp-muted);
|
|
686
|
+
text-transform: uppercase;
|
|
687
|
+
letter-spacing: 0.06em;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.swatches {
|
|
691
|
+
display: flex;
|
|
692
|
+
flex-wrap: wrap;
|
|
693
|
+
gap: 5px;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.swatch {
|
|
697
|
+
inline-size: var(--ui-cp-swatch-size);
|
|
698
|
+
block-size: var(--ui-cp-swatch-size);
|
|
699
|
+
border-radius: 8px;
|
|
700
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
|
|
701
|
+
background: #2563eb;
|
|
702
|
+
cursor: pointer;
|
|
703
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
|
|
704
|
+
padding: 0;
|
|
705
|
+
transition:
|
|
706
|
+
transform var(--ui-cp-duration) var(--ui-cp-ease),
|
|
707
|
+
box-shadow var(--ui-cp-duration) var(--ui-cp-ease),
|
|
708
|
+
border-color var(--ui-cp-duration) var(--ui-cp-ease);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.swatch:hover {
|
|
712
|
+
transform: translateY(-1px);
|
|
713
|
+
border-color: color-mix(in srgb, var(--ui-cp-accent) 40%, var(--ui-cp-border));
|
|
714
|
+
box-shadow: 0 2px 8px rgba(2, 6, 23, 0.18);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.swatch[data-selected="true"] {
|
|
718
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 72%, transparent);
|
|
719
|
+
outline-offset: 1px;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.swatch:focus-visible {
|
|
723
|
+
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
724
|
+
outline-offset: 1px;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.error {
|
|
728
|
+
min-block-size: 16px;
|
|
729
|
+
color: var(--ui-color-danger, #dc2626);
|
|
730
|
+
font: 500 11px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.error[hidden] {
|
|
734
|
+
display: none !important;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.actions {
|
|
738
|
+
display: flex;
|
|
739
|
+
justify-content: flex-end;
|
|
740
|
+
gap: 6px;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.actions .btn {
|
|
744
|
+
min-block-size: 28px;
|
|
745
|
+
border-radius: 9px;
|
|
746
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
|
|
747
|
+
background: color-mix(in srgb, var(--ui-cp-bg) 95%, transparent);
|
|
748
|
+
color: var(--ui-cp-text);
|
|
749
|
+
font: 650 12px/1 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
750
|
+
padding: 0 10px;
|
|
751
|
+
cursor: pointer;
|
|
752
|
+
transition:
|
|
753
|
+
border-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
754
|
+
background-color var(--ui-cp-duration) var(--ui-cp-ease),
|
|
755
|
+
color var(--ui-cp-duration) var(--ui-cp-ease);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.actions .btn[data-tone="primary"] {
|
|
759
|
+
border-color: color-mix(in srgb, var(--ui-cp-accent) 62%, transparent);
|
|
760
|
+
background: color-mix(in srgb, var(--ui-cp-accent) 18%, transparent);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.actions .btn[hidden] {
|
|
764
|
+
display: none !important;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.live {
|
|
768
|
+
position: absolute;
|
|
769
|
+
inline-size: 1px;
|
|
770
|
+
block-size: 1px;
|
|
771
|
+
margin: -1px;
|
|
772
|
+
border: 0;
|
|
773
|
+
padding: 0;
|
|
774
|
+
overflow: hidden;
|
|
775
|
+
clip: rect(0 0 0 0);
|
|
776
|
+
clip-path: inset(50%);
|
|
777
|
+
white-space: nowrap;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
:host([disabled]) .panel,
|
|
781
|
+
:host([disabled]) .trigger,
|
|
782
|
+
:host([state="loading"]) .panel,
|
|
783
|
+
:host([state="loading"]) .trigger {
|
|
784
|
+
opacity: 0.66;
|
|
785
|
+
pointer-events: none;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
@media (max-width: 440px) {
|
|
789
|
+
.sv {
|
|
790
|
+
block-size: 132px;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.input-row,
|
|
794
|
+
.input-row[data-fields="3"] {
|
|
795
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
@media (prefers-reduced-motion: reduce) {
|
|
800
|
+
.icon-btn,
|
|
801
|
+
.tab,
|
|
802
|
+
.panel,
|
|
803
|
+
.trigger {
|
|
804
|
+
transition: none !important;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
@media (prefers-contrast: more) {
|
|
809
|
+
.panel,
|
|
810
|
+
.trigger,
|
|
811
|
+
.icon-btn,
|
|
812
|
+
.tab,
|
|
813
|
+
.input,
|
|
814
|
+
.swatch,
|
|
815
|
+
.actions .btn {
|
|
816
|
+
border-width: 2px;
|
|
817
|
+
box-shadow: none;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
@media (forced-colors: active) {
|
|
822
|
+
:host {
|
|
823
|
+
--ui-cp-bg: Canvas;
|
|
824
|
+
--ui-cp-border: CanvasText;
|
|
825
|
+
--ui-cp-text: CanvasText;
|
|
826
|
+
--ui-cp-muted: CanvasText;
|
|
827
|
+
--ui-cp-accent: Highlight;
|
|
828
|
+
--ui-cp-shadow: none;
|
|
829
|
+
--ui-cp-thumb: Canvas;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.panel,
|
|
833
|
+
.trigger,
|
|
834
|
+
.icon-btn,
|
|
835
|
+
.tab,
|
|
836
|
+
.input,
|
|
837
|
+
.swatch,
|
|
838
|
+
.actions .btn,
|
|
839
|
+
.preview,
|
|
840
|
+
.trigger-preview,
|
|
841
|
+
.sv,
|
|
842
|
+
.slider {
|
|
843
|
+
forced-color-adjust: none;
|
|
844
|
+
background: Canvas;
|
|
845
|
+
border-color: CanvasText;
|
|
846
|
+
color: CanvasText;
|
|
847
|
+
box-shadow: none;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.tab[data-active="true"],
|
|
851
|
+
.actions .btn[data-tone="primary"] {
|
|
852
|
+
background: Highlight;
|
|
853
|
+
color: HighlightText;
|
|
854
|
+
border-color: Highlight;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
`, nt = `
|
|
858
|
+
.overlay {
|
|
859
|
+
position: fixed;
|
|
860
|
+
inset: 0;
|
|
861
|
+
z-index: var(--ui-cp-z, 1600);
|
|
862
|
+
pointer-events: none;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.popover-shell {
|
|
866
|
+
position: absolute;
|
|
867
|
+
pointer-events: auto;
|
|
868
|
+
inline-size: min(320px, calc(100vw - 16px));
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.sheet-backdrop {
|
|
872
|
+
position: absolute;
|
|
873
|
+
inset: 0;
|
|
874
|
+
background: rgba(15, 23, 42, 0.52);
|
|
875
|
+
pointer-events: auto;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.sheet-shell {
|
|
879
|
+
position: absolute;
|
|
880
|
+
inset-inline: 0;
|
|
881
|
+
inset-block-end: 0;
|
|
882
|
+
pointer-events: auto;
|
|
883
|
+
padding: 8px;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.sheet-shell .panel {
|
|
887
|
+
border-bottom-left-radius: 10px;
|
|
888
|
+
border-bottom-right-radius: 10px;
|
|
889
|
+
inline-size: min(100%, 520px);
|
|
890
|
+
margin: 0 auto;
|
|
891
|
+
max-block-size: min(84vh, 680px);
|
|
892
|
+
overflow: auto;
|
|
893
|
+
}
|
|
894
|
+
`;
|
|
895
|
+
function u(s, t, e) {
|
|
896
|
+
return Math.max(t, Math.min(e, s));
|
|
897
|
+
}
|
|
898
|
+
function M(s, t) {
|
|
899
|
+
return Math.abs(s - t) <= 5e-4;
|
|
900
|
+
}
|
|
901
|
+
function A(s) {
|
|
902
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
903
|
+
}
|
|
904
|
+
class st extends V {
|
|
905
|
+
constructor() {
|
|
906
|
+
super(), this._syncing = !1, this._initialized = !1, this._rgba = h(f(z) || { r: 37, g: 99, b: 235, a: 1 }), this._hsva = T(this._rgba), this._format = "hex", this._open = !1, this._error = "", this._presets = [], this._recentColors = [], this._panelCache = /* @__PURE__ */ new WeakMap(), this._overlay = null, this._overlayRoot = null, this._releaseScrollLock = null, this._restoreFocusEl = null, this._isSheetOpen = !1, this._dragTarget = null, this._dragPointerId = -1, this._dragRect = null, this._dragX = 0, this._dragY = 0, this._dragRaf = 0, this._dragChanged = !1, this._dragSource = "drag", this._renderingSwatches = !1, this._scheduleOverlayPosition = W(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onPanelClick(t, "root"), this._onRootInputBound = (t) => this._onPanelInput(t, "root"), this._onRootChangeBound = (t) => this._onPanelChange(t, "root"), this._onRootKeyDownBound = (t) => this._onPanelKeyDown(t, "root"), this._onRootPointerDownBound = (t) => this._onPanelPointerDown(t, "root"), this._onRootPointerMoveBound = (t) => this._onPanelPointerMove(t), this._onRootPointerUpBound = (t) => this._onPanelPointerUp(t), this._onRootPointerCancelBound = (t) => this._onPanelPointerCancel(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._scheduleOverlayPosition.run(), this._onWindowScrollBound = () => this._scheduleOverlayPosition.run(), this._applyValueAttribute(!1), this._applyFormatAttribute(), this._open = this.hasAttribute("open"), this._parsePresetsAttribute();
|
|
907
|
+
}
|
|
908
|
+
static get observedAttributes() {
|
|
909
|
+
return [
|
|
910
|
+
"value",
|
|
911
|
+
"format",
|
|
912
|
+
"alpha",
|
|
913
|
+
"disabled",
|
|
914
|
+
"readonly",
|
|
915
|
+
"size",
|
|
916
|
+
"variant",
|
|
917
|
+
"state",
|
|
918
|
+
"tone",
|
|
919
|
+
"mode",
|
|
920
|
+
"open",
|
|
921
|
+
"close-on-escape",
|
|
922
|
+
"placeholder",
|
|
923
|
+
"presets",
|
|
924
|
+
"recent",
|
|
925
|
+
"max-recent",
|
|
926
|
+
"persist",
|
|
927
|
+
"aria-label",
|
|
928
|
+
"aria-labelledby",
|
|
929
|
+
"aria-describedby"
|
|
930
|
+
];
|
|
931
|
+
}
|
|
932
|
+
connectedCallback() {
|
|
933
|
+
super.connectedCallback(), this._bindRootEvents(), this._loadRecent(), !this._isPopoverMode() && this._open && (this._open = !1, this._syncOpenAttribute(!1));
|
|
934
|
+
}
|
|
935
|
+
disconnectedCallback() {
|
|
936
|
+
this._cancelDragFrame(), this._stopDrag(!1), this._destroyOverlay(), this.root.removeEventListener("click", this._onRootClickBound), this.root.removeEventListener("input", this._onRootInputBound), this.root.removeEventListener("change", this._onRootChangeBound), this.root.removeEventListener("keydown", this._onRootKeyDownBound), this.root.removeEventListener("pointerdown", this._onRootPointerDownBound), this.root.removeEventListener("pointermove", this._onRootPointerMoveBound), this.root.removeEventListener("pointerup", this._onRootPointerUpBound), this.root.removeEventListener("pointercancel", this._onRootPointerCancelBound), super.disconnectedCallback();
|
|
937
|
+
}
|
|
938
|
+
attributeChangedCallback(t, e, r) {
|
|
939
|
+
if (e !== r) {
|
|
940
|
+
switch (t) {
|
|
941
|
+
case "value":
|
|
942
|
+
this._syncing || this._applyValueAttribute(!0);
|
|
943
|
+
break;
|
|
944
|
+
case "format":
|
|
945
|
+
this._applyFormatAttribute();
|
|
946
|
+
break;
|
|
947
|
+
case "presets":
|
|
948
|
+
this._parsePresetsAttribute();
|
|
949
|
+
break;
|
|
950
|
+
case "open":
|
|
951
|
+
this._syncing || (this._open = this.hasAttribute("open"));
|
|
952
|
+
break;
|
|
953
|
+
case "disabled":
|
|
954
|
+
case "state":
|
|
955
|
+
(this.hasAttribute("disabled") || this._isLoading()) && this._open && this._setOpen(!1, "attribute");
|
|
956
|
+
break;
|
|
957
|
+
case "alpha": {
|
|
958
|
+
this._alphaEnabled() || (this._rgba = h({ ...this._rgba, a: 1 }), this._hsva = { ...this._hsva, a: 1 }, this._syncValueAttribute());
|
|
959
|
+
break;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
this.isConnected && this.requestRender();
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
get value() {
|
|
966
|
+
return this.getAttribute("value") || this._serializeValue();
|
|
967
|
+
}
|
|
968
|
+
set value(t) {
|
|
969
|
+
this.setColor(t);
|
|
970
|
+
}
|
|
971
|
+
get format() {
|
|
972
|
+
return this._format;
|
|
973
|
+
}
|
|
974
|
+
set format(t) {
|
|
975
|
+
this.setAttribute("format", t);
|
|
976
|
+
}
|
|
977
|
+
get alpha() {
|
|
978
|
+
return this._alphaEnabled();
|
|
979
|
+
}
|
|
980
|
+
set alpha(t) {
|
|
981
|
+
t ? this.setAttribute("alpha", "") : this.removeAttribute("alpha");
|
|
982
|
+
}
|
|
983
|
+
get open() {
|
|
984
|
+
return this._open;
|
|
985
|
+
}
|
|
986
|
+
set open(t) {
|
|
987
|
+
this._setOpen(t, "api");
|
|
988
|
+
}
|
|
989
|
+
setColor(t) {
|
|
990
|
+
const e = f(t || "");
|
|
991
|
+
if (!e) {
|
|
992
|
+
this._setInvalid(t, "Invalid color format");
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
this._error = "", this._applyRgba(e, !1), this._syncValueAttribute(), this._updateUI(!1);
|
|
996
|
+
}
|
|
997
|
+
getColor() {
|
|
998
|
+
const t = h(this._rgba);
|
|
999
|
+
return {
|
|
1000
|
+
hex: x(t, this._alphaEnabled()),
|
|
1001
|
+
rgba: t,
|
|
1002
|
+
hsva: { ...this._hsva }
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
openPopover() {
|
|
1006
|
+
this._setOpen(!0, "api");
|
|
1007
|
+
}
|
|
1008
|
+
closePopover() {
|
|
1009
|
+
this._setOpen(!1, "api");
|
|
1010
|
+
}
|
|
1011
|
+
focus() {
|
|
1012
|
+
const t = this.root.querySelector(".trigger"), e = this.root.querySelector('[data-cp="sv"]');
|
|
1013
|
+
(t || e || this).focus();
|
|
1014
|
+
}
|
|
1015
|
+
render() {
|
|
1016
|
+
this._initialized || (this._initialized = !0, this.setContent(this._buildTemplate(), { force: !0 })), !this._isPopoverMode() && this._open && (this._open = !1, this._syncOpenAttribute(!1)), this._isPopoverMode() && this._open ? (this._ensureOverlay(), this._renderOverlayTemplate(), this._scheduleOverlayPosition.run()) : this._destroyOverlay(), this._updateUI(!1);
|
|
1017
|
+
}
|
|
1018
|
+
_bindRootEvents() {
|
|
1019
|
+
this.root.removeEventListener("click", this._onRootClickBound), this.root.removeEventListener("input", this._onRootInputBound), this.root.removeEventListener("change", this._onRootChangeBound), this.root.removeEventListener("keydown", this._onRootKeyDownBound), this.root.removeEventListener("pointerdown", this._onRootPointerDownBound), this.root.removeEventListener("pointermove", this._onRootPointerMoveBound), this.root.removeEventListener("pointerup", this._onRootPointerUpBound), this.root.removeEventListener("pointercancel", this._onRootPointerCancelBound), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("input", this._onRootInputBound), this.root.addEventListener("change", this._onRootChangeBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), this.root.addEventListener("pointerdown", this._onRootPointerDownBound), this.root.addEventListener("pointermove", this._onRootPointerMoveBound), this.root.addEventListener("pointerup", this._onRootPointerUpBound), this.root.addEventListener("pointercancel", this._onRootPointerCancelBound);
|
|
1020
|
+
}
|
|
1021
|
+
_eventHTMLElement(t) {
|
|
1022
|
+
const e = typeof t.composedPath == "function" ? t.composedPath() : [];
|
|
1023
|
+
for (const i of e)
|
|
1024
|
+
if (i instanceof HTMLElement)
|
|
1025
|
+
return i;
|
|
1026
|
+
const r = t.target;
|
|
1027
|
+
return r instanceof HTMLElement ? r : null;
|
|
1028
|
+
}
|
|
1029
|
+
_buildTemplate() {
|
|
1030
|
+
return `
|
|
1031
|
+
<style>${q}</style>
|
|
1032
|
+
<section class="root">
|
|
1033
|
+
<div class="trigger-wrap" data-role="trigger-wrap">
|
|
1034
|
+
<button
|
|
1035
|
+
type="button"
|
|
1036
|
+
class="trigger"
|
|
1037
|
+
data-action="toggle-popover"
|
|
1038
|
+
part="frame preview"
|
|
1039
|
+
aria-haspopup="dialog"
|
|
1040
|
+
aria-expanded="false"
|
|
1041
|
+
>
|
|
1042
|
+
<span class="trigger-preview" data-role="trigger-preview"></span>
|
|
1043
|
+
<span class="trigger-value" data-role="trigger-value"></span>
|
|
1044
|
+
<span class="trigger-chevron" aria-hidden="true">${at}</span>
|
|
1045
|
+
</button>
|
|
1046
|
+
</div>
|
|
1047
|
+
<div class="panel-inline" data-role="inline-panel" part="popover">
|
|
1048
|
+
${this._panelMarkup("inline")}
|
|
1049
|
+
</div>
|
|
1050
|
+
</section>
|
|
1051
|
+
`;
|
|
1052
|
+
}
|
|
1053
|
+
_panelMarkup(t) {
|
|
1054
|
+
return `
|
|
1055
|
+
<section class="panel" data-cp-panel="${t}" part="frame popover">
|
|
1056
|
+
<header class="header" part="header">
|
|
1057
|
+
<div class="heading">
|
|
1058
|
+
<span class="label" part="title" data-role="label">Color picker</span>
|
|
1059
|
+
<span class="value" part="description" data-role="value"></span>
|
|
1060
|
+
</div>
|
|
1061
|
+
<div class="header-actions">
|
|
1062
|
+
<span class="preview" data-role="preview" part="preview"></span>
|
|
1063
|
+
<span class="status-pill" data-role="status" part="status" hidden></span>
|
|
1064
|
+
<button type="button" class="icon-btn" data-action="copy-hex" part="copy" title="Copy HEX">HEX</button>
|
|
1065
|
+
<button type="button" class="icon-btn" data-action="copy-rgb" part="copy" title="Copy RGB">RGB</button>
|
|
1066
|
+
<button type="button" class="icon-btn" data-action="eyedropper" part="copy" title="Eyedropper">Pick</button>
|
|
1067
|
+
</div>
|
|
1068
|
+
</header>
|
|
1069
|
+
|
|
1070
|
+
<div class="body" part="body">
|
|
1071
|
+
<div class="sv" part="sv" data-cp="sv" role="slider" tabindex="0" aria-label="Saturation and value">
|
|
1072
|
+
<span class="thumb" data-role="sv-thumb"></span>
|
|
1073
|
+
</div>
|
|
1074
|
+
<div class="slider hue" part="hue" data-cp="hue" role="slider" tabindex="0" aria-label="Hue">
|
|
1075
|
+
<span class="slider-thumb" data-role="hue-thumb"></span>
|
|
1076
|
+
</div>
|
|
1077
|
+
<div class="alpha-row" data-role="alpha-row">
|
|
1078
|
+
<div class="slider alpha" part="alpha" data-cp="alpha" role="slider" tabindex="0" aria-label="Alpha">
|
|
1079
|
+
<span class="slider-thumb" data-role="alpha-thumb"></span>
|
|
1080
|
+
</div>
|
|
1081
|
+
</div>
|
|
1082
|
+
</div>
|
|
1083
|
+
|
|
1084
|
+
<footer class="footer" part="footer">
|
|
1085
|
+
<div class="tabs" part="tabs">
|
|
1086
|
+
<button type="button" class="tab" data-action="format" data-format="hex">HEX</button>
|
|
1087
|
+
<button type="button" class="tab" data-action="format" data-format="rgb">RGB</button>
|
|
1088
|
+
<button type="button" class="tab" data-action="format" data-format="hsl">HSL</button>
|
|
1089
|
+
</div>
|
|
1090
|
+
|
|
1091
|
+
<div class="group" data-format-group="hex">
|
|
1092
|
+
<div class="field">
|
|
1093
|
+
<span>Value</span>
|
|
1094
|
+
<input class="input" data-input="hex" part="input" spellcheck="false" autocomplete="off" />
|
|
1095
|
+
</div>
|
|
1096
|
+
</div>
|
|
1097
|
+
|
|
1098
|
+
<div class="group" data-format-group="rgb" hidden>
|
|
1099
|
+
<div class="input-row" data-fields="4">
|
|
1100
|
+
<label class="field"><span>R</span><input class="input" data-input="r" type="number" part="input" min="0" max="255" /></label>
|
|
1101
|
+
<label class="field"><span>G</span><input class="input" data-input="g" type="number" part="input" min="0" max="255" /></label>
|
|
1102
|
+
<label class="field"><span>B</span><input class="input" data-input="b" type="number" part="input" min="0" max="255" /></label>
|
|
1103
|
+
<label class="field"><span>A</span><input class="input" data-input="a1" type="number" part="input" min="0" max="1" step="0.01" /></label>
|
|
1104
|
+
</div>
|
|
1105
|
+
</div>
|
|
1106
|
+
|
|
1107
|
+
<div class="group" data-format-group="hsl" hidden>
|
|
1108
|
+
<div class="input-row" data-fields="4">
|
|
1109
|
+
<label class="field"><span>H</span><input class="input" data-input="h" type="number" part="input" min="0" max="360" /></label>
|
|
1110
|
+
<label class="field"><span>S</span><input class="input" data-input="s" type="number" part="input" min="0" max="100" /></label>
|
|
1111
|
+
<label class="field"><span>L</span><input class="input" data-input="l" type="number" part="input" min="0" max="100" /></label>
|
|
1112
|
+
<label class="field"><span>A</span><input class="input" data-input="a2" type="number" part="input" min="0" max="1" step="0.01" /></label>
|
|
1113
|
+
</div>
|
|
1114
|
+
</div>
|
|
1115
|
+
|
|
1116
|
+
<div class="swatches-wrap">
|
|
1117
|
+
<div class="swatches-title">Presets</div>
|
|
1118
|
+
<div class="swatches" data-role="presets" part="swatches"></div>
|
|
1119
|
+
<div class="swatches-title" data-role="recent-title" part="recent">Recent</div>
|
|
1120
|
+
<div class="swatches" data-role="recent" part="recent"></div>
|
|
1121
|
+
</div>
|
|
1122
|
+
|
|
1123
|
+
<div class="error" data-role="error" part="error" hidden></div>
|
|
1124
|
+
|
|
1125
|
+
<div class="actions">
|
|
1126
|
+
<button type="button" class="btn" data-action="clear" part="clear">Clear</button>
|
|
1127
|
+
<button type="button" class="btn" data-tone="primary" data-action="apply" part="apply">Done</button>
|
|
1128
|
+
</div>
|
|
1129
|
+
</footer>
|
|
1130
|
+
|
|
1131
|
+
<div class="live" data-role="live" aria-live="polite"></div>
|
|
1132
|
+
</section>
|
|
1133
|
+
`;
|
|
1134
|
+
}
|
|
1135
|
+
_renderOverlayTemplate() {
|
|
1136
|
+
if (!this._overlay || !this._overlayRoot)
|
|
1137
|
+
return;
|
|
1138
|
+
this._syncOverlayHostAttributes();
|
|
1139
|
+
const t = this._isMobileSheet(), e = t ? "sheet" : "popover";
|
|
1140
|
+
this._overlay.dataset.mode !== e && (this._overlay.dataset.mode = e, this._overlayRoot.innerHTML = `
|
|
1141
|
+
<style>${q}${nt}</style>
|
|
1142
|
+
<section class="overlay">
|
|
1143
|
+
${t ? '<div class="sheet-backdrop" data-action="close-popover"></div>' : ""}
|
|
1144
|
+
<div class="${t ? "sheet-shell" : "popover-shell"}">
|
|
1145
|
+
${this._panelMarkup("overlay")}
|
|
1146
|
+
</div>
|
|
1147
|
+
</section>
|
|
1148
|
+
`, t && !this._isSheetOpen && (this._isSheetOpen = !0, this._releaseScrollLock = K()), !t && this._isSheetOpen && (this._isSheetOpen = !1, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null)));
|
|
1149
|
+
}
|
|
1150
|
+
_isPopoverMode() {
|
|
1151
|
+
return (this.getAttribute("mode") || "inline") === "popover";
|
|
1152
|
+
}
|
|
1153
|
+
_state() {
|
|
1154
|
+
const t = (this.getAttribute("state") || "idle").trim().toLowerCase();
|
|
1155
|
+
return t === "loading" || t === "error" || t === "success" ? t : "idle";
|
|
1156
|
+
}
|
|
1157
|
+
_tone() {
|
|
1158
|
+
const t = (this.getAttribute("tone") || "brand").trim().toLowerCase();
|
|
1159
|
+
return t === "neutral" || t === "success" || t === "warning" || t === "danger" ? t : "brand";
|
|
1160
|
+
}
|
|
1161
|
+
_closeOnEscape() {
|
|
1162
|
+
return I(this.getAttribute("close-on-escape"), !0);
|
|
1163
|
+
}
|
|
1164
|
+
_syncOverlayHostAttributes() {
|
|
1165
|
+
if (!this._overlay)
|
|
1166
|
+
return;
|
|
1167
|
+
const t = (r) => {
|
|
1168
|
+
const i = this.getAttribute(r);
|
|
1169
|
+
i == null ? this._overlay.removeAttribute(r) : this._overlay.setAttribute(r, i);
|
|
1170
|
+
}, e = (r) => {
|
|
1171
|
+
this.hasAttribute(r) ? this._overlay.setAttribute(r, "") : this._overlay.removeAttribute(r);
|
|
1172
|
+
};
|
|
1173
|
+
t("size"), t("variant"), t("state"), t("tone"), t("close-on-escape"), t("aria-label"), t("aria-labelledby"), t("aria-describedby"), e("disabled"), e("readonly");
|
|
1174
|
+
}
|
|
1175
|
+
_isMobileSheet() {
|
|
1176
|
+
return G(this.getAttribute("mode") || "inline");
|
|
1177
|
+
}
|
|
1178
|
+
_alphaEnabled() {
|
|
1179
|
+
return I(this.getAttribute("alpha"), !1);
|
|
1180
|
+
}
|
|
1181
|
+
_recentEnabled() {
|
|
1182
|
+
return I(this.getAttribute("recent"), !0);
|
|
1183
|
+
}
|
|
1184
|
+
_persistRecent() {
|
|
1185
|
+
return I(this.getAttribute("persist"), !1);
|
|
1186
|
+
}
|
|
1187
|
+
_isDisabled() {
|
|
1188
|
+
return this.hasAttribute("disabled");
|
|
1189
|
+
}
|
|
1190
|
+
_isReadonly() {
|
|
1191
|
+
return this.hasAttribute("readonly");
|
|
1192
|
+
}
|
|
1193
|
+
_isLoading() {
|
|
1194
|
+
return this._state() === "loading";
|
|
1195
|
+
}
|
|
1196
|
+
_maxRecent() {
|
|
1197
|
+
const t = Number(this.getAttribute("max-recent") || 8);
|
|
1198
|
+
return !Number.isFinite(t) || t < 1 ? 8 : Math.max(1, Math.min(24, Math.trunc(t)));
|
|
1199
|
+
}
|
|
1200
|
+
_labelText() {
|
|
1201
|
+
return this.getAttribute("aria-label") || "Color picker";
|
|
1202
|
+
}
|
|
1203
|
+
_placeholder() {
|
|
1204
|
+
return this.getAttribute("placeholder") || "Select color";
|
|
1205
|
+
}
|
|
1206
|
+
_applyFormatAttribute() {
|
|
1207
|
+
const t = (this.getAttribute("format") || "hex").trim().toLowerCase();
|
|
1208
|
+
if (t === "rgb" || t === "hsl" || t === "hex") {
|
|
1209
|
+
this._format = t;
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
this._format = "hex";
|
|
1213
|
+
}
|
|
1214
|
+
_applyValueAttribute(t) {
|
|
1215
|
+
const e = this.getAttribute("value");
|
|
1216
|
+
if (!e) {
|
|
1217
|
+
this._applyRgba(f(z) || this._rgba, !1);
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
const r = f(e);
|
|
1221
|
+
if (!r) {
|
|
1222
|
+
t && this._setInvalid(e, "Unable to parse color value");
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
this._error = "", this._applyRgba(r, !1);
|
|
1226
|
+
}
|
|
1227
|
+
_parsePresetsAttribute() {
|
|
1228
|
+
const t = this.getAttribute("presets");
|
|
1229
|
+
if (!t) {
|
|
1230
|
+
this._presets = ["#2563eb", "#16a34a", "#f59e0b", "#dc2626", "#7c3aed", "#0ea5e9"];
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
try {
|
|
1234
|
+
const e = JSON.parse(t);
|
|
1235
|
+
if (!Array.isArray(e)) {
|
|
1236
|
+
this._presets = [];
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
const r = [];
|
|
1240
|
+
for (const i of e) {
|
|
1241
|
+
if (typeof i != "string")
|
|
1242
|
+
continue;
|
|
1243
|
+
const a = f(i);
|
|
1244
|
+
if (!a)
|
|
1245
|
+
continue;
|
|
1246
|
+
const n = x(this._normalizeByAlpha(a), this._alphaEnabled());
|
|
1247
|
+
r.includes(n) || r.push(n);
|
|
1248
|
+
}
|
|
1249
|
+
this._presets = r;
|
|
1250
|
+
} catch {
|
|
1251
|
+
this._presets = [];
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
_loadRecent() {
|
|
1255
|
+
if (!this._recentEnabled()) {
|
|
1256
|
+
this._recentColors = [];
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
if (!(!this._persistRecent() || typeof localStorage > "u"))
|
|
1260
|
+
try {
|
|
1261
|
+
const t = localStorage.getItem($);
|
|
1262
|
+
if (!t)
|
|
1263
|
+
return;
|
|
1264
|
+
const e = JSON.parse(t);
|
|
1265
|
+
if (!Array.isArray(e))
|
|
1266
|
+
return;
|
|
1267
|
+
this._recentColors = e.filter((r) => typeof r == "string").map((r) => f(r)).filter((r) => !!r).map((r) => x(this._normalizeByAlpha(r), this._alphaEnabled())).slice(0, this._maxRecent());
|
|
1268
|
+
} catch {
|
|
1269
|
+
this._recentColors = [];
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
_persistRecentColors() {
|
|
1273
|
+
if (!(!this._persistRecent() || typeof localStorage > "u"))
|
|
1274
|
+
try {
|
|
1275
|
+
localStorage.setItem($, JSON.stringify(this._recentColors));
|
|
1276
|
+
} catch {
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
_normalizeByAlpha(t) {
|
|
1280
|
+
return this._alphaEnabled() ? h(t) : h({ ...t, a: 1 });
|
|
1281
|
+
}
|
|
1282
|
+
_applyRgba(t, e) {
|
|
1283
|
+
const r = this._normalizeByAlpha(t), i = T(r);
|
|
1284
|
+
e && i.s === 0 && (i.h = this._hsva.h), this._rgba = r, this._hsva = {
|
|
1285
|
+
h: u(i.h, 0, 360),
|
|
1286
|
+
s: u(i.s, 0, 100),
|
|
1287
|
+
v: u(i.v, 0, 100),
|
|
1288
|
+
a: u(i.a, 0, 1)
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
_serializeValue(t = this._format) {
|
|
1292
|
+
return t === "rgb" ? S(this._rgba, this._alphaEnabled()) : t === "hsl" ? it(this._rgba, this._alphaEnabled()) : x(this._rgba, this._alphaEnabled());
|
|
1293
|
+
}
|
|
1294
|
+
_currentHex() {
|
|
1295
|
+
return x(this._rgba, this._alphaEnabled());
|
|
1296
|
+
}
|
|
1297
|
+
_eventDetail(t) {
|
|
1298
|
+
return {
|
|
1299
|
+
value: this._serializeValue(),
|
|
1300
|
+
hex: this._currentHex(),
|
|
1301
|
+
rgba: { ...this._rgba },
|
|
1302
|
+
hsla: L(this._rgba),
|
|
1303
|
+
source: t
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
_emitInput(t) {
|
|
1307
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this._eventDetail(t), bubbles: !0, composed: !0 }));
|
|
1308
|
+
}
|
|
1309
|
+
_emitChange(t) {
|
|
1310
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this._eventDetail(t), bubbles: !0, composed: !0 })), this._announce(this._serializeValue());
|
|
1311
|
+
}
|
|
1312
|
+
_setInvalid(t, e) {
|
|
1313
|
+
this._error = e, this.dispatchEvent(
|
|
1314
|
+
new CustomEvent("invalid", {
|
|
1315
|
+
detail: { raw: t, reason: e },
|
|
1316
|
+
bubbles: !0,
|
|
1317
|
+
composed: !0
|
|
1318
|
+
})
|
|
1319
|
+
), this._updateUI(!1);
|
|
1320
|
+
}
|
|
1321
|
+
_announce(t) {
|
|
1322
|
+
this._forEachPanel((e) => {
|
|
1323
|
+
e.live && (e.live.textContent = `Color changed to ${t}`);
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
_setOpen(t, e = "api") {
|
|
1327
|
+
if (!this._isPopoverMode() || t && (this._isDisabled() || this._isLoading()) || this._open === t)
|
|
1328
|
+
return;
|
|
1329
|
+
const r = this._open;
|
|
1330
|
+
this._open = t, this._syncOpenAttribute(t);
|
|
1331
|
+
const i = { open: t, previousOpen: r, source: e };
|
|
1332
|
+
if (t ? (this._restoreFocusEl = typeof document < "u" ? document.activeElement : null, this.dispatchEvent(new CustomEvent("open", { detail: i, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("ui-open", { detail: i, bubbles: !0, composed: !0 }))) : (this.dispatchEvent(new CustomEvent("close", { detail: i, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("ui-close", { detail: i, bubbles: !0, composed: !0 }))), this.requestRender(), !t && this._restoreFocusEl && this._restoreFocusEl.isConnected) {
|
|
1333
|
+
try {
|
|
1334
|
+
this._restoreFocusEl.focus();
|
|
1335
|
+
} catch {
|
|
1336
|
+
}
|
|
1337
|
+
this._restoreFocusEl = null;
|
|
1338
|
+
}
|
|
1339
|
+
t && queueMicrotask(() => this._focusFirstOpenControl());
|
|
1340
|
+
}
|
|
1341
|
+
_focusFirstOpenControl() {
|
|
1342
|
+
if (!this._open)
|
|
1343
|
+
return;
|
|
1344
|
+
const t = this._getCurrentPanel(), e = t == null ? void 0 : t.querySelector('[data-cp="sv"]');
|
|
1345
|
+
if (e)
|
|
1346
|
+
try {
|
|
1347
|
+
e.focus();
|
|
1348
|
+
} catch {
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
_syncValueAttribute() {
|
|
1352
|
+
const t = this._serializeValue();
|
|
1353
|
+
this._syncing = !0;
|
|
1354
|
+
try {
|
|
1355
|
+
this.getAttribute("value") !== t && this.setAttribute("value", t);
|
|
1356
|
+
} finally {
|
|
1357
|
+
this._syncing = !1;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
_syncOpenAttribute(t) {
|
|
1361
|
+
this._syncing = !0;
|
|
1362
|
+
try {
|
|
1363
|
+
t ? this.hasAttribute("open") || this.setAttribute("open", "") : this.hasAttribute("open") && this.removeAttribute("open");
|
|
1364
|
+
} finally {
|
|
1365
|
+
this._syncing = !1;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
_ensureOverlay() {
|
|
1369
|
+
if (this._overlay || typeof document > "u")
|
|
1370
|
+
return;
|
|
1371
|
+
const t = document.createElement("div");
|
|
1372
|
+
t.style.position = "fixed", t.style.inset = "0", t.style.zIndex = "var(--ui-cp-z, 1600)", t.style.pointerEvents = "auto";
|
|
1373
|
+
const e = t.attachShadow({ mode: "open" });
|
|
1374
|
+
t.addEventListener("click", (r) => this._onPanelClick(r, "overlay")), t.addEventListener("input", (r) => this._onPanelInput(r, "overlay")), t.addEventListener("change", (r) => this._onPanelChange(r, "overlay")), t.addEventListener("keydown", (r) => this._onPanelKeyDown(r, "overlay")), t.addEventListener("pointerdown", (r) => this._onPanelPointerDown(r, "overlay")), t.addEventListener("pointermove", (r) => this._onPanelPointerMove(r)), t.addEventListener("pointerup", (r) => this._onPanelPointerUp(r)), t.addEventListener("pointercancel", (r) => this._onPanelPointerCancel(r)), document.body.appendChild(t), this._overlay = t, this._overlayRoot = e, this._syncOverlayHostAttributes(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, !0);
|
|
1375
|
+
}
|
|
1376
|
+
_destroyOverlay() {
|
|
1377
|
+
this._scheduleOverlayPosition.cancel(), typeof document < "u" && (document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound)), typeof window < "u" && (window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0)), this._overlay && this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayRoot = null, this._panelCache = /* @__PURE__ */ new WeakMap(), this._isSheetOpen && (this._isSheetOpen = !1, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
|
|
1378
|
+
}
|
|
1379
|
+
_positionOverlay() {
|
|
1380
|
+
if (!this._overlayRoot || !this._open || this._isMobileSheet())
|
|
1381
|
+
return;
|
|
1382
|
+
const t = this.root.querySelector(".trigger"), e = this._overlayRoot.querySelector(".popover-shell");
|
|
1383
|
+
if (!t || !e)
|
|
1384
|
+
return;
|
|
1385
|
+
const r = e.querySelector(".panel");
|
|
1386
|
+
if (!r)
|
|
1387
|
+
return;
|
|
1388
|
+
const i = X(t.getBoundingClientRect(), r.getBoundingClientRect(), 8, 8);
|
|
1389
|
+
e.style.top = `${Math.round(i.top)}px`, e.style.left = `${Math.round(i.left)}px`;
|
|
1390
|
+
}
|
|
1391
|
+
_onDocumentPointerDown(t) {
|
|
1392
|
+
var i;
|
|
1393
|
+
if (!this._overlay || !this._open)
|
|
1394
|
+
return;
|
|
1395
|
+
const e = typeof t.composedPath == "function" ? t.composedPath() : [];
|
|
1396
|
+
if (e.includes(this))
|
|
1397
|
+
return;
|
|
1398
|
+
const r = (i = this._overlayRoot) == null ? void 0 : i.querySelector('[data-cp-panel="overlay"]');
|
|
1399
|
+
r && e.includes(r) || this._setOpen(!1, "outside");
|
|
1400
|
+
}
|
|
1401
|
+
_onDocumentKeyDown(t) {
|
|
1402
|
+
if (!(!this._open || !this._isPopoverMode())) {
|
|
1403
|
+
if (t.key === "Tab") {
|
|
1404
|
+
this._trapOverlayFocus(t);
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
t.key !== "Escape" || !this._closeOnEscape() || (t.preventDefault(), this._setOpen(!1, "escape"));
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
_focusableInPanel(t) {
|
|
1411
|
+
const e = t.querySelectorAll(
|
|
1412
|
+
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"]),[contenteditable="true"]'
|
|
1413
|
+
);
|
|
1414
|
+
return Array.from(e).filter((r) => r.hasAttribute("disabled") || r.getAttribute("aria-hidden") === "true" || r.tabIndex < 0 ? !1 : r.getClientRects().length > 0);
|
|
1415
|
+
}
|
|
1416
|
+
_trapOverlayFocus(t) {
|
|
1417
|
+
var o;
|
|
1418
|
+
const e = (o = this._overlayRoot) == null ? void 0 : o.querySelector('[data-cp-panel="overlay"]');
|
|
1419
|
+
if (!e)
|
|
1420
|
+
return;
|
|
1421
|
+
const r = this._focusableInPanel(e);
|
|
1422
|
+
if (!r.length) {
|
|
1423
|
+
t.preventDefault(), e.focus();
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1426
|
+
const i = e.getRootNode(), a = i instanceof ShadowRoot ? i.activeElement : e.ownerDocument.activeElement, n = a ? r.indexOf(a) : -1;
|
|
1427
|
+
if (t.shiftKey) {
|
|
1428
|
+
n <= 0 && (t.preventDefault(), r[r.length - 1].focus());
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
(n === -1 || n === r.length - 1) && (t.preventDefault(), r[0].focus());
|
|
1432
|
+
}
|
|
1433
|
+
_forEachPanel(t) {
|
|
1434
|
+
var i;
|
|
1435
|
+
const e = this.root.querySelector('[data-cp-panel="inline"]');
|
|
1436
|
+
e && t(this._panelRefs(e));
|
|
1437
|
+
const r = (i = this._overlayRoot) == null ? void 0 : i.querySelector('[data-cp-panel="overlay"]');
|
|
1438
|
+
r && t(this._panelRefs(r));
|
|
1439
|
+
}
|
|
1440
|
+
_panelRefs(t) {
|
|
1441
|
+
const e = this._panelCache.get(t);
|
|
1442
|
+
if (e)
|
|
1443
|
+
return e;
|
|
1444
|
+
const r = {
|
|
1445
|
+
panel: t,
|
|
1446
|
+
label: t.querySelector('[data-role="label"]'),
|
|
1447
|
+
valueText: t.querySelector('[data-role="value"]'),
|
|
1448
|
+
preview: t.querySelector('[data-role="preview"]'),
|
|
1449
|
+
status: t.querySelector('[data-role="status"]'),
|
|
1450
|
+
sv: t.querySelector('[data-cp="sv"]'),
|
|
1451
|
+
svThumb: t.querySelector('[data-role="sv-thumb"]'),
|
|
1452
|
+
hue: t.querySelector('[data-cp="hue"]'),
|
|
1453
|
+
hueThumb: t.querySelector('[data-role="hue-thumb"]'),
|
|
1454
|
+
alphaRow: t.querySelector('[data-role="alpha-row"]'),
|
|
1455
|
+
alpha: t.querySelector('[data-cp="alpha"]'),
|
|
1456
|
+
alphaThumb: t.querySelector('[data-role="alpha-thumb"]'),
|
|
1457
|
+
tabHex: t.querySelector('[data-format="hex"]'),
|
|
1458
|
+
tabRgb: t.querySelector('[data-format="rgb"]'),
|
|
1459
|
+
tabHsl: t.querySelector('[data-format="hsl"]'),
|
|
1460
|
+
groupHex: t.querySelector('[data-format-group="hex"]'),
|
|
1461
|
+
groupRgb: t.querySelector('[data-format-group="rgb"]'),
|
|
1462
|
+
groupHsl: t.querySelector('[data-format-group="hsl"]'),
|
|
1463
|
+
inputHex: t.querySelector('[data-input="hex"]'),
|
|
1464
|
+
inputR: t.querySelector('[data-input="r"]'),
|
|
1465
|
+
inputG: t.querySelector('[data-input="g"]'),
|
|
1466
|
+
inputB: t.querySelector('[data-input="b"]'),
|
|
1467
|
+
inputA1: t.querySelector('[data-input="a1"]'),
|
|
1468
|
+
inputH: t.querySelector('[data-input="h"]'),
|
|
1469
|
+
inputS: t.querySelector('[data-input="s"]'),
|
|
1470
|
+
inputL: t.querySelector('[data-input="l"]'),
|
|
1471
|
+
inputA2: t.querySelector('[data-input="a2"]'),
|
|
1472
|
+
copyHex: t.querySelector('[data-action="copy-hex"]'),
|
|
1473
|
+
copyRgb: t.querySelector('[data-action="copy-rgb"]'),
|
|
1474
|
+
eyedropper: t.querySelector('[data-action="eyedropper"]'),
|
|
1475
|
+
clear: t.querySelector('[data-action="clear"]'),
|
|
1476
|
+
apply: t.querySelector('[data-action="apply"]'),
|
|
1477
|
+
presets: t.querySelector('[data-role="presets"]'),
|
|
1478
|
+
recent: t.querySelector('[data-role="recent"]'),
|
|
1479
|
+
recentTitle: t.querySelector('[data-role="recent-title"]'),
|
|
1480
|
+
error: t.querySelector('[data-role="error"]'),
|
|
1481
|
+
live: t.querySelector('[data-role="live"]')
|
|
1482
|
+
};
|
|
1483
|
+
return this._panelCache.set(t, r), r;
|
|
1484
|
+
}
|
|
1485
|
+
_getCurrentPanel() {
|
|
1486
|
+
return this._isPopoverMode() && this._open && this._overlayRoot ? this._overlayRoot.querySelector('[data-cp-panel="overlay"]') : this.root.querySelector('[data-cp-panel="inline"]');
|
|
1487
|
+
}
|
|
1488
|
+
_updateUI(t, e = !1) {
|
|
1489
|
+
const r = this.root.querySelector('[data-role="trigger-wrap"]'), i = this.root.querySelector(".trigger"), a = this.root.querySelector('[data-role="trigger-value"]'), n = this.root.querySelector('[data-role="trigger-preview"]'), o = this.root.querySelector('[data-role="inline-panel"]'), l = this._isPopoverMode(), c = this._state(), b = this._tone(), v = c === "loading", d = this._isDisabled(), _ = this._isReadonly(), E = this._serializeValue() || this._placeholder();
|
|
1490
|
+
r && (r.hidden = !l), i && (i.disabled = d || v, i.dataset.state = c, i.dataset.tone = b, i.setAttribute("aria-expanded", l && this._open ? "true" : "false"), this._applyAria(i)), a && (a.textContent = E), n && (n.style.background = S(this._rgba, !0)), o && (o.hidden = l), this._forEachPanel((p) => this._updatePanel(p, { skipSwatches: t, disabled: d, readonly: _, loading: v, state: c, tone: b, modePopover: l, liveOnly: e }));
|
|
1491
|
+
}
|
|
1492
|
+
_updatePanel(t, e) {
|
|
1493
|
+
const r = this._rgba, i = L(r), a = this._hsva, n = `hsl(${Math.round(a.h)} 100% 50%)`, o = t.panel.getAttribute("data-cp-panel") === "overlay", l = !!this._error || e.state === "error", c = e.disabled || e.readonly || e.loading;
|
|
1494
|
+
if (this._applyAria(t.panel), t.panel.dataset.state = l ? "error" : e.state, t.panel.dataset.tone = e.tone, t.panel.setAttribute("aria-busy", e.loading ? "true" : "false"), o && e.modePopover ? (t.panel.setAttribute("role", "dialog"), t.panel.setAttribute("aria-modal", "true"), t.panel.tabIndex = -1) : (t.panel.removeAttribute("role"), t.panel.removeAttribute("aria-modal"), t.panel.removeAttribute("tabindex")), t.label && (t.label.textContent = this._labelText()), t.valueText && (t.valueText.textContent = this._serializeValue()), t.preview && (t.preview.style.background = S(r, !0)), t.status) {
|
|
1495
|
+
let p = "";
|
|
1496
|
+
l ? p = "Error" : e.state === "loading" ? p = "Syncing" : e.state === "success" && (p = "Saved"), t.status.hidden = !p, t.status.textContent = p, t.status.dataset.tone = e.tone;
|
|
1497
|
+
}
|
|
1498
|
+
if (t.sv && (t.sv.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${n})`, t.sv.setAttribute("aria-valuetext", `Saturation ${Math.round(a.s)}%, Value ${Math.round(a.v)}%`), t.sv.setAttribute("aria-disabled", c ? "true" : "false"), t.sv.tabIndex = c ? -1 : 0), t.svThumb) {
|
|
1499
|
+
const p = u(a.s, 1, 99), k = u(100 - a.v, 1, 99);
|
|
1500
|
+
t.svThumb.style.left = `${p}%`, t.svThumb.style.top = `${k}%`;
|
|
1501
|
+
}
|
|
1502
|
+
t.hue && (t.hue.setAttribute("aria-valuemin", "0"), t.hue.setAttribute("aria-valuemax", "360"), t.hue.setAttribute("aria-valuenow", String(Math.round(a.h))), t.hue.setAttribute("aria-disabled", c ? "true" : "false"), t.hue.tabIndex = c ? -1 : 0), t.hueThumb && (t.hueThumb.style.left = `${u(a.h / 360 * 100, 1, 99)}%`), t.alphaRow && (t.alphaRow.hidden = !this._alphaEnabled()), t.alpha && (t.alpha.setAttribute("aria-valuemin", "0"), t.alpha.setAttribute("aria-valuemax", "100"), t.alpha.setAttribute("aria-valuenow", String(Math.round(a.a * 100))), t.alpha.setAttribute("aria-disabled", c || !this._alphaEnabled() ? "true" : "false"), t.alpha.tabIndex = c ? -1 : 0, t.alpha.style.backgroundImage = `
|
|
1503
|
+
linear-gradient(45deg, var(--ui-cp-checker-a) 25%, transparent 25%),
|
|
1504
|
+
linear-gradient(-45deg, var(--ui-cp-checker-a) 25%, transparent 25%),
|
|
1505
|
+
linear-gradient(45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
|
|
1506
|
+
linear-gradient(-45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
|
|
1507
|
+
linear-gradient(to right, rgba(${r.r}, ${r.g}, ${r.b}, 0), rgba(${r.r}, ${r.g}, ${r.b}, 1))
|
|
1508
|
+
`), t.alphaThumb && (t.alphaThumb.style.left = `${u(a.a * 100, 1, 99)}%`);
|
|
1509
|
+
const b = t.panel.getRootNode(), v = b instanceof ShadowRoot ? b.activeElement : t.panel.ownerDocument.activeElement, d = v && t.panel.contains(v) ? v.getAttribute("data-input") : null;
|
|
1510
|
+
if (t.inputHex && d !== "hex" && (t.inputHex.value = x(r, this._alphaEnabled())), t.inputR && d !== "r" && (t.inputR.value = String(r.r)), t.inputG && d !== "g" && (t.inputG.value = String(r.g)), t.inputB && d !== "b" && (t.inputB.value = String(r.b)), t.inputA1 && d !== "a1" && (t.inputA1.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), t.inputH && d !== "h" && (t.inputH.value = String(Math.round(i.h))), t.inputS && d !== "s" && (t.inputS.value = String(Math.round(i.s))), t.inputL && d !== "l" && (t.inputL.value = String(Math.round(i.l))), t.inputA2 && d !== "a2" && (t.inputA2.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), e.liveOnly)
|
|
1511
|
+
return;
|
|
1512
|
+
if (t.tabHex && (t.tabHex.dataset.active = String(this._format === "hex")), t.tabRgb && (t.tabRgb.dataset.active = String(this._format === "rgb")), t.tabHsl && (t.tabHsl.dataset.active = String(this._format === "hsl")), t.groupHex && (t.groupHex.hidden = this._format !== "hex"), t.groupRgb && (t.groupRgb.hidden = this._format !== "rgb"), t.groupHsl && (t.groupHsl.hidden = this._format !== "hsl"), t.inputA1 && (t.inputA1.disabled = !this._alphaEnabled() || c), t.inputA2 && (t.inputA2.disabled = !this._alphaEnabled() || c), t.error) {
|
|
1513
|
+
const p = this._error || (e.state === "error" ? "Unable to validate current color value." : "");
|
|
1514
|
+
t.error.hidden = !p, t.error.textContent = p;
|
|
1515
|
+
}
|
|
1516
|
+
const _ = c;
|
|
1517
|
+
if (t.copyHex && (t.copyHex.disabled = e.disabled || e.loading), t.copyRgb && (t.copyRgb.disabled = e.disabled || e.loading), t.eyedropper) {
|
|
1518
|
+
const p = typeof window < "u" && typeof window.EyeDropper == "function";
|
|
1519
|
+
t.eyedropper.hidden = !p, t.eyedropper.disabled = _ || !p;
|
|
1520
|
+
}
|
|
1521
|
+
if (t.clear && (t.clear.disabled = _), t.apply && (t.apply.hidden = !e.modePopover, t.apply.disabled = _), t.panel.querySelectorAll(".input").forEach((p) => {
|
|
1522
|
+
const k = p;
|
|
1523
|
+
k.disabled = _;
|
|
1524
|
+
}), !e.skipSwatches && !this._renderingSwatches) {
|
|
1525
|
+
this._renderingSwatches = !0;
|
|
1526
|
+
try {
|
|
1527
|
+
this._renderSwatches(t);
|
|
1528
|
+
} finally {
|
|
1529
|
+
this._renderingSwatches = !1;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
_renderSwatches(t) {
|
|
1534
|
+
const e = this._currentHex().toLowerCase();
|
|
1535
|
+
t.presets && (t.presets.innerHTML = this._presets.map((r) => {
|
|
1536
|
+
const i = f(r);
|
|
1537
|
+
if (!i)
|
|
1538
|
+
return "";
|
|
1539
|
+
const a = x(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
|
|
1540
|
+
return `<button type="button" class="swatch" part="swatch" data-action="preset" data-color="${A(a)}"${n} title="${A(a)}" style="background:${A(S(i, !0))}"></button>`;
|
|
1541
|
+
}).join("")), t.recentTitle && (t.recentTitle.hidden = !this._recentEnabled() || this._recentColors.length === 0), t.recent && (t.recent.hidden = !this._recentEnabled() || this._recentColors.length === 0, t.recent.innerHTML = this._recentColors.map((r) => {
|
|
1542
|
+
const i = f(r);
|
|
1543
|
+
if (!i)
|
|
1544
|
+
return "";
|
|
1545
|
+
const a = x(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
|
|
1546
|
+
return `<button type="button" class="swatch" part="swatch recent" data-action="recent" data-color="${A(a)}"${n} title="${A(a)}" style="background:${A(S(i, !0))}"></button>`;
|
|
1547
|
+
}).join(""));
|
|
1548
|
+
}
|
|
1549
|
+
_onPanelClick(t, e) {
|
|
1550
|
+
const r = this._eventHTMLElement(t);
|
|
1551
|
+
if (!r)
|
|
1552
|
+
return;
|
|
1553
|
+
const i = r.closest("[data-action]");
|
|
1554
|
+
if (!i || this._isDisabled())
|
|
1555
|
+
return;
|
|
1556
|
+
const a = i.getAttribute("data-action");
|
|
1557
|
+
if (a === "close-popover") {
|
|
1558
|
+
this._setOpen(!1, "outside");
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
if (a === "toggle-popover") {
|
|
1562
|
+
if (!this._isPopoverMode())
|
|
1563
|
+
return;
|
|
1564
|
+
this._setOpen(!this._open, "toggle");
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
if (!this._isLoading()) {
|
|
1568
|
+
if (a === "format") {
|
|
1569
|
+
const n = i.getAttribute("data-format");
|
|
1570
|
+
if (!n)
|
|
1571
|
+
return;
|
|
1572
|
+
this.setAttribute("format", n), this._error = "", this._updateUI(!1);
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
if (a === "copy-hex") {
|
|
1576
|
+
this._copyToClipboard(this._currentHex());
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
if (a === "copy-rgb") {
|
|
1580
|
+
this._copyToClipboard(S(this._rgba, this._alphaEnabled()));
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
if (a === "eyedropper") {
|
|
1584
|
+
this._openEyeDropper();
|
|
1585
|
+
return;
|
|
1586
|
+
}
|
|
1587
|
+
if (a === "clear") {
|
|
1588
|
+
if (this._isReadonly())
|
|
1589
|
+
return;
|
|
1590
|
+
const n = f(z);
|
|
1591
|
+
n && (this._applyRgba(n, !1), this._error = "", this._syncValueAttribute(), this._emitInput("text"), this._emitChange("text"), this._pushRecent(this._currentHex()), this._updateUI(!1));
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
if (a === "apply") {
|
|
1595
|
+
this._setOpen(!1, "apply");
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
if (a === "preset" || a === "recent") {
|
|
1599
|
+
if (this._isReadonly())
|
|
1600
|
+
return;
|
|
1601
|
+
const n = i.getAttribute("data-color") || "", o = f(n);
|
|
1602
|
+
if (!o)
|
|
1603
|
+
return;
|
|
1604
|
+
const l = a === "preset" ? "preset" : "recent";
|
|
1605
|
+
this._applyRgba(o, !0), this._error = "", this._syncValueAttribute(), this._emitInput(l), this._emitChange(l), this._pushRecent(this._currentHex()), this._updateUI(!1);
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
_onPanelInput(t, e) {
|
|
1611
|
+
const r = this._eventHTMLElement(t);
|
|
1612
|
+
if (!(r instanceof HTMLInputElement) || !r.hasAttribute("data-input") || (t.stopPropagation(), this._isDisabled() || this._isReadonly() || this._isLoading()))
|
|
1613
|
+
return;
|
|
1614
|
+
const i = this._parseInputsFromPanel(r.closest("[data-cp-panel]"));
|
|
1615
|
+
if (!i) {
|
|
1616
|
+
this._error = "";
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
this._error = "", this._applyRgba(i, !0), this._emitInput("text"), this._updateUI(!0, !0);
|
|
1620
|
+
}
|
|
1621
|
+
_onPanelChange(t, e) {
|
|
1622
|
+
const r = this._eventHTMLElement(t);
|
|
1623
|
+
if (!(r instanceof HTMLInputElement) || !r.hasAttribute("data-input") || (t.stopPropagation(), this._isDisabled() || this._isReadonly() || this._isLoading()))
|
|
1624
|
+
return;
|
|
1625
|
+
const i = r.closest("[data-cp-panel]"), a = this._parseInputsFromPanel(i);
|
|
1626
|
+
if (!a) {
|
|
1627
|
+
const n = r.value || "";
|
|
1628
|
+
this._setInvalid(n, "Invalid input values");
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
this._error = "", this._applyRgba(a, !0), this._syncValueAttribute(), this._emitInput("text"), this._emitChange("text"), this._pushRecent(this._currentHex()), this._updateUI(!1);
|
|
1632
|
+
}
|
|
1633
|
+
_onPanelKeyDown(t, e) {
|
|
1634
|
+
const r = this._eventHTMLElement(t);
|
|
1635
|
+
if (!r || this._isDisabled() || this._isLoading())
|
|
1636
|
+
return;
|
|
1637
|
+
if (r instanceof HTMLInputElement && r.hasAttribute("data-input") && t.key === "Enter") {
|
|
1638
|
+
t.preventDefault();
|
|
1639
|
+
const l = this._parseInputsFromPanel(r.closest("[data-cp-panel]"));
|
|
1640
|
+
if (!l) {
|
|
1641
|
+
this._setInvalid(r.value || "", "Invalid input values");
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
this._error = "", this._applyRgba(l, !0), this._syncValueAttribute(), this._emitInput("text"), this._emitChange("text"), this._pushRecent(this._currentHex()), this._updateUI(!1);
|
|
1645
|
+
return;
|
|
1646
|
+
}
|
|
1647
|
+
const i = r.getAttribute("data-cp");
|
|
1648
|
+
if (!i || this._isReadonly() || this._isLoading())
|
|
1649
|
+
return;
|
|
1650
|
+
const a = t.shiftKey ? 5 : 1;
|
|
1651
|
+
let n = !1;
|
|
1652
|
+
const o = { ...this._hsva };
|
|
1653
|
+
if (i === "sv") {
|
|
1654
|
+
t.key === "ArrowLeft" ? (o.s = u(o.s - a, 0, 100), n = !0) : t.key === "ArrowRight" ? (o.s = u(o.s + a, 0, 100), n = !0) : t.key === "ArrowUp" ? (o.v = u(o.v + a, 0, 100), n = !0) : t.key === "ArrowDown" ? (o.v = u(o.v - a, 0, 100), n = !0) : t.key === "Home" ? (o.s = 0, o.v = 100, n = !0) : t.key === "End" && (o.s = 100, o.v = 0, n = !0), n && (t.preventDefault(), this._commitHsva(o, "drag"));
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1657
|
+
if (i === "hue") {
|
|
1658
|
+
t.key === "ArrowLeft" || t.key === "ArrowDown" ? (o.h = u(o.h - a, 0, 360), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (o.h = u(o.h + a, 0, 360), n = !0) : t.key === "Home" ? (o.h = 0, n = !0) : t.key === "End" && (o.h = 360, n = !0), n && (t.preventDefault(), this._commitHsva(o, "slider"));
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
if (i === "alpha" && this._alphaEnabled()) {
|
|
1662
|
+
const l = t.shiftKey ? 0.1 : 0.01;
|
|
1663
|
+
t.key === "ArrowLeft" || t.key === "ArrowDown" ? (o.a = u(o.a - l, 0, 1), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (o.a = u(o.a + l, 0, 1), n = !0) : t.key === "Home" ? (o.a = 0, n = !0) : t.key === "End" && (o.a = 1, n = !0), n && (t.preventDefault(), this._commitHsva(o, "slider"));
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
_commitHsva(t, e) {
|
|
1667
|
+
this._setHsva(t), this._syncValueAttribute(), this._emitInput(e), this._emitChange(e), this._pushRecent(this._currentHex()), this._updateUI(!1);
|
|
1668
|
+
}
|
|
1669
|
+
_parseInputsFromPanel(t) {
|
|
1670
|
+
var l, c, b, v, d, _, E, p, k;
|
|
1671
|
+
if (!t)
|
|
1672
|
+
return null;
|
|
1673
|
+
const e = this._panelRefs(t);
|
|
1674
|
+
if (this._format === "hex") {
|
|
1675
|
+
const y = ((l = e.inputHex) == null ? void 0 : l.value) || "", C = y.trim().startsWith("#") ? y.trim() : `#${y.trim()}`, R = f(C);
|
|
1676
|
+
return R ? this._normalizeByAlpha(R) : null;
|
|
1677
|
+
}
|
|
1678
|
+
if (this._format === "rgb") {
|
|
1679
|
+
const y = Number(((c = e.inputR) == null ? void 0 : c.value) ?? ""), C = Number(((b = e.inputG) == null ? void 0 : b.value) ?? ""), R = Number(((v = e.inputB) == null ? void 0 : v.value) ?? ""), D = this._alphaEnabled() ? Number(((d = e.inputA1) == null ? void 0 : d.value) ?? "") : 1;
|
|
1680
|
+
return [y, C, R, D].every((N) => Number.isFinite(N)) ? this._normalizeByAlpha({ r: y, g: C, b: R, a: D }) : null;
|
|
1681
|
+
}
|
|
1682
|
+
const r = Number(((_ = e.inputH) == null ? void 0 : _.value) ?? ""), i = Number(((E = e.inputS) == null ? void 0 : E.value) ?? ""), a = Number(((p = e.inputL) == null ? void 0 : p.value) ?? ""), n = this._alphaEnabled() ? Number(((k = e.inputA2) == null ? void 0 : k.value) ?? "") : 1;
|
|
1683
|
+
if (![r, i, a, n].every((y) => Number.isFinite(y)))
|
|
1684
|
+
return null;
|
|
1685
|
+
const o = {
|
|
1686
|
+
h: u(r, 0, 360),
|
|
1687
|
+
s: u(i, 0, 100),
|
|
1688
|
+
l: u(a, 0, 100),
|
|
1689
|
+
a: u(n, 0, 1)
|
|
1690
|
+
};
|
|
1691
|
+
return this._normalizeByAlpha(U(o));
|
|
1692
|
+
}
|
|
1693
|
+
_onPanelPointerDown(t, e) {
|
|
1694
|
+
var n;
|
|
1695
|
+
if (this._isDisabled() || this._isReadonly() || this._isLoading())
|
|
1696
|
+
return;
|
|
1697
|
+
const r = this._eventHTMLElement(t);
|
|
1698
|
+
if (!r)
|
|
1699
|
+
return;
|
|
1700
|
+
const i = (n = r.closest("[data-cp]")) == null ? void 0 : n.getAttribute("data-cp");
|
|
1701
|
+
if (!i || i === "alpha" && !this._alphaEnabled())
|
|
1702
|
+
return;
|
|
1703
|
+
const a = r.closest(`[data-cp="${i}"]`);
|
|
1704
|
+
if (a) {
|
|
1705
|
+
t.preventDefault(), this._dragTarget = i, this._dragPointerId = t.pointerId, this._dragRect = a.getBoundingClientRect(), this._dragX = t.clientX, this._dragY = t.clientY, this._dragChanged = !1, this._dragSource = i === "sv" ? "drag" : "slider";
|
|
1706
|
+
try {
|
|
1707
|
+
a.setPointerCapture(t.pointerId);
|
|
1708
|
+
} catch {
|
|
1709
|
+
}
|
|
1710
|
+
this._applyDragPointer(!0);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
_onPanelPointerMove(t) {
|
|
1714
|
+
!this._dragTarget || t.pointerId !== this._dragPointerId || (this._dragX = t.clientX, this._dragY = t.clientY, !this._dragRaf && (this._dragRaf = requestAnimationFrame(() => {
|
|
1715
|
+
this._dragRaf = 0, this._applyDragPointer(!0);
|
|
1716
|
+
})));
|
|
1717
|
+
}
|
|
1718
|
+
_onPanelPointerUp(t) {
|
|
1719
|
+
!this._dragTarget || t.pointerId !== this._dragPointerId || (this._dragX = t.clientX, this._dragY = t.clientY, this._applyDragPointer(!0), this._stopDrag(!0));
|
|
1720
|
+
}
|
|
1721
|
+
_onPanelPointerCancel(t) {
|
|
1722
|
+
!this._dragTarget || t.pointerId !== this._dragPointerId || this._stopDrag(!1);
|
|
1723
|
+
}
|
|
1724
|
+
_cancelDragFrame() {
|
|
1725
|
+
this._dragRaf && (cancelAnimationFrame(this._dragRaf), this._dragRaf = 0);
|
|
1726
|
+
}
|
|
1727
|
+
_applyDragPointer(t) {
|
|
1728
|
+
if (!this._dragTarget || !this._dragRect)
|
|
1729
|
+
return;
|
|
1730
|
+
const e = this._dragRect, r = u(this._dragX - e.left, 0, e.width || 1), i = u(this._dragY - e.top, 0, e.height || 1), a = { ...this._hsva };
|
|
1731
|
+
this._dragTarget === "sv" ? (a.s = u(r / Math.max(e.width, 1) * 100, 0, 100), a.v = u(100 - i / Math.max(e.height, 1) * 100, 0, 100)) : this._dragTarget === "hue" ? a.h = u(r / Math.max(e.width, 1) * 360, 0, 360) : this._dragTarget === "alpha" && (a.a = u(r / Math.max(e.width, 1), 0, 1)), this._setHsva(a) && (this._dragChanged = !0, t && this._emitInput(this._dragSource), this._updateUI(!0, !0));
|
|
1732
|
+
}
|
|
1733
|
+
_setHsva(t) {
|
|
1734
|
+
const e = {
|
|
1735
|
+
h: u(t.h, 0, 360),
|
|
1736
|
+
s: u(t.s, 0, 100),
|
|
1737
|
+
v: u(t.v, 0, 100),
|
|
1738
|
+
a: this._alphaEnabled() ? u(t.a, 0, 1) : 1
|
|
1739
|
+
}, r = this._hsva;
|
|
1740
|
+
return M(r.h, e.h) && M(r.s, e.s) && M(r.v, e.v) && M(r.a, e.a) ? !1 : (this._hsva = e, this._rgba = this._normalizeByAlpha(rt(this._hsva)), this._error = "", !0);
|
|
1741
|
+
}
|
|
1742
|
+
_stopDrag(t) {
|
|
1743
|
+
this._cancelDragFrame();
|
|
1744
|
+
const e = t && this._dragChanged;
|
|
1745
|
+
this._dragTarget = null, this._dragPointerId = -1, this._dragRect = null, this._dragChanged = !1, e && (this._syncValueAttribute(), this._emitChange(this._dragSource), this._pushRecent(this._currentHex()), this._updateUI(!1));
|
|
1746
|
+
}
|
|
1747
|
+
_pushRecent(t) {
|
|
1748
|
+
if (!this._recentEnabled())
|
|
1749
|
+
return;
|
|
1750
|
+
const e = (t || "").trim().toUpperCase();
|
|
1751
|
+
e && (this._recentColors = [e, ...this._recentColors.filter((r) => r.toUpperCase() !== e)].slice(
|
|
1752
|
+
0,
|
|
1753
|
+
this._maxRecent()
|
|
1754
|
+
), this._persistRecentColors());
|
|
1755
|
+
}
|
|
1756
|
+
async _openEyeDropper() {
|
|
1757
|
+
if (this._isDisabled() || this._isReadonly() || this._isLoading() || typeof window > "u")
|
|
1758
|
+
return;
|
|
1759
|
+
const t = window.EyeDropper;
|
|
1760
|
+
if (typeof t == "function")
|
|
1761
|
+
try {
|
|
1762
|
+
const r = await new t().open(), i = f((r == null ? void 0 : r.sRGBHex) || "");
|
|
1763
|
+
if (!i)
|
|
1764
|
+
return;
|
|
1765
|
+
this._applyRgba(i, !0), this._error = "", this._syncValueAttribute(), this._emitInput("eyedropper"), this._emitChange("eyedropper"), this._pushRecent(this._currentHex()), this._updateUI(!1);
|
|
1766
|
+
} catch {
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
async _copyToClipboard(t) {
|
|
1770
|
+
var a;
|
|
1771
|
+
if (!t || this._isDisabled())
|
|
1772
|
+
return;
|
|
1773
|
+
let e = !1;
|
|
1774
|
+
if (typeof navigator < "u" && ((a = navigator.clipboard) != null && a.writeText))
|
|
1775
|
+
try {
|
|
1776
|
+
await navigator.clipboard.writeText(t), e = !0;
|
|
1777
|
+
} catch {
|
|
1778
|
+
e = !1;
|
|
1779
|
+
}
|
|
1780
|
+
if (!e && typeof document < "u") {
|
|
1781
|
+
const n = document.createElement("textarea");
|
|
1782
|
+
n.value = t, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.opacity = "0", document.body.appendChild(n), n.select();
|
|
1783
|
+
try {
|
|
1784
|
+
e = document.execCommand("copy");
|
|
1785
|
+
} catch {
|
|
1786
|
+
e = !1;
|
|
1787
|
+
} finally {
|
|
1788
|
+
n.parentElement && n.parentElement.removeChild(n);
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
const r = e ? `Copied ${t}` : `Unable to copy ${t}`, i = typeof window < "u" ? window.showToast : null;
|
|
1792
|
+
if (typeof i == "function")
|
|
1793
|
+
try {
|
|
1794
|
+
i(r);
|
|
1795
|
+
} catch {
|
|
1796
|
+
this.dispatchEvent(new CustomEvent("toast", { detail: { message: r }, bubbles: !0, composed: !0 }));
|
|
1797
|
+
}
|
|
1798
|
+
else
|
|
1799
|
+
this.dispatchEvent(new CustomEvent("toast", { detail: { message: r }, bubbles: !0, composed: !0 }));
|
|
1800
|
+
}
|
|
1801
|
+
_applyAria(t) {
|
|
1802
|
+
const e = this.getAttribute("aria-labelledby"), r = this.getAttribute("aria-describedby"), i = this.getAttribute("aria-label");
|
|
1803
|
+
e ? t.setAttribute("aria-labelledby", e) : t.removeAttribute("aria-labelledby"), r ? t.setAttribute("aria-describedby", r) : t.removeAttribute("aria-describedby"), i ? t.setAttribute("aria-label", i) : e || t.setAttribute("aria-label", "Color picker");
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
customElements.get("ui-color-picker") || customElements.define("ui-color-picker", st);
|
|
1807
|
+
export {
|
|
1808
|
+
st as UIColorPicker
|
|
1809
|
+
};
|