@youcan/celeste 0.6.3
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/LICENSE +9 -0
- package/dist/celeste.css +3564 -0
- package/dist/cjs/alert.js +111 -0
- package/dist/cjs/alpha-slider.js +3 -0
- package/dist/cjs/badge.js +55 -0
- package/dist/cjs/button.js +39 -0
- package/dist/cjs/checkbox.js +3 -0
- package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -0
- package/dist/cjs/chunks/alpha-slider.js +127 -0
- package/dist/cjs/chunks/checkbox.vue_vue_type_style_index_0_lang.js +38 -0
- package/dist/cjs/chunks/clsx.js +15 -0
- package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +52 -0
- package/dist/cjs/chunks/dropdown-menu-content.vue_vue_type_style_index_0_lang.js +51 -0
- package/dist/cjs/chunks/dropdown-menu-sub-content.vue_vue_type_style_index_0_lang.js +49 -0
- package/dist/cjs/chunks/dropdown-menu-sub-trigger.vue_vue_type_style_index_0_lang.js +32 -0
- package/dist/cjs/chunks/dropdown-menu-sub.js +25 -0
- package/dist/cjs/chunks/index.js +9056 -0
- package/dist/cjs/chunks/modal-close.js +22 -0
- package/dist/cjs/chunks/modal-trigger.js +22 -0
- package/dist/cjs/chunks/modal.js +26 -0
- package/dist/cjs/chunks/popover.js +26 -0
- package/dist/cjs/chunks/scroll-area.js +41 -0
- package/dist/cjs/chunks/select-group.js +22 -0
- package/dist/cjs/chunks/select.js +38 -0
- package/dist/cjs/chunks/slider.vue_vue_type_style_index_0_lang.js +52 -0
- package/dist/cjs/chunks/switch.vue_vue_type_style_index_0_lang.js +38 -0
- package/dist/cjs/chunks/use-color-model.js +992 -0
- package/dist/cjs/color-area.js +175 -0
- package/dist/cjs/color-picker.js +515 -0
- package/dist/cjs/color-swatch.js +59 -0
- package/dist/cjs/color.js +102 -0
- package/dist/cjs/command-group.js +41 -0
- package/dist/cjs/command-input.js +45 -0
- package/dist/cjs/command-item.js +34 -0
- package/dist/cjs/command-list.js +52 -0
- package/dist/cjs/command-root.js +45 -0
- package/dist/cjs/command-separator.js +32 -0
- package/dist/cjs/compact-button.js +42 -0
- package/dist/cjs/content-divider.js +3 -0
- package/dist/cjs/context-menu-item.js +134 -0
- package/dist/cjs/crypto.js +8 -0
- package/dist/cjs/dropdown-item.js +99 -0
- package/dist/cjs/dropdown-menu-content.js +3 -0
- package/dist/cjs/dropdown-menu-group.js +24 -0
- package/dist/cjs/dropdown-menu-item.js +68 -0
- package/dist/cjs/dropdown-menu-label.js +31 -0
- package/dist/cjs/dropdown-menu-separator.js +25 -0
- package/dist/cjs/dropdown-menu-sub-content.js +3 -0
- package/dist/cjs/dropdown-menu-sub-trigger.js +3 -0
- package/dist/cjs/dropdown-menu-sub.js +3 -0
- package/dist/cjs/dropdown-menu-trigger.js +26 -0
- package/dist/cjs/dropdown-menu.js +32 -0
- package/dist/cjs/dropdown.js +284 -0
- package/dist/cjs/fancy-button.js +38 -0
- package/dist/cjs/hint-text.js +36 -0
- package/dist/cjs/hue-slider.js +133 -0
- package/dist/cjs/index.js +190 -0
- package/dist/cjs/label.js +55 -0
- package/dist/cjs/link-button.js +44 -0
- package/dist/cjs/modal-body.js +22 -0
- package/dist/cjs/modal-close.js +3 -0
- package/dist/cjs/modal-content.js +48 -0
- package/dist/cjs/modal-footer.js +22 -0
- package/dist/cjs/modal-header.js +81 -0
- package/dist/cjs/modal-trigger.js +3 -0
- package/dist/cjs/modal.js +3 -0
- package/dist/cjs/popover-content.js +104 -0
- package/dist/cjs/popover-trigger.js +24 -0
- package/dist/cjs/popover.js +3 -0
- package/dist/cjs/scroll-area.js +3 -0
- package/dist/cjs/scroll-bar.js +39 -0
- package/dist/cjs/segmented-control-item.js +41 -0
- package/dist/cjs/segmented-control.js +40 -0
- package/dist/cjs/select-content.js +61 -0
- package/dist/cjs/select-group.js +3 -0
- package/dist/cjs/select-icon.js +25 -0
- package/dist/cjs/select-item.js +44 -0
- package/dist/cjs/select-label.js +32 -0
- package/dist/cjs/select-separator.js +26 -0
- package/dist/cjs/select-trigger.js +40 -0
- package/dist/cjs/select-value.js +31 -0
- package/dist/cjs/select.js +3 -0
- package/dist/cjs/shims.js +1 -0
- package/dist/cjs/slider.js +3 -0
- package/dist/cjs/social-button.js +45 -0
- package/dist/cjs/status-badge.js +49 -0
- package/dist/cjs/switch.js +3 -0
- package/dist/cjs/tab-menu-content.js +32 -0
- package/dist/cjs/tab-menu-item.js +44 -0
- package/dist/cjs/tab-menu-list.js +34 -0
- package/dist/cjs/tab-menu.js +32 -0
- package/dist/cjs/text-input-affix.js +28 -0
- package/dist/cjs/text-input-button.js +32 -0
- package/dist/cjs/text-input-icon.js +29 -0
- package/dist/cjs/text-input.js +41 -0
- package/dist/cjs/textarea.js +56 -0
- package/dist/cjs/tooltip.js +115 -0
- package/dist/cjs/use-color-model.js +6 -0
- package/dist/cjs/use-delegated-props.js +14 -0
- package/dist/cjs/use-user-select.js +39 -0
- package/dist/components/alert/alert.d.ts +30 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/badge/badge.d.ts +17 -0
- package/dist/components/badge/index.d.ts +4 -0
- package/dist/components/badge/status-badge.d.ts +13 -0
- package/dist/components/button/button.d.ts +22 -0
- package/dist/components/button/compact-button.d.ts +15 -0
- package/dist/components/button/fancy-button.d.ts +20 -0
- package/dist/components/button/index.d.ts +10 -0
- package/dist/components/button/link-button.d.ts +22 -0
- package/dist/components/button/social-button.d.ts +10 -0
- package/dist/components/checkbox/checkbox.d.ts +11 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/color-picker/alpha-slider.d.ts +15 -0
- package/dist/components/color-picker/color-area.d.ts +9 -0
- package/dist/components/color-picker/color-picker.d.ts +47 -0
- package/dist/components/color-picker/color-swatch.d.ts +19 -0
- package/dist/components/color-picker/composable/use-color-model.d.ts +7 -0
- package/dist/components/color-picker/composable/use-user-select.d.ts +8 -0
- package/dist/components/color-picker/hue-slider.d.ts +14 -0
- package/dist/components/color-picker/index.d.ts +10 -0
- package/dist/components/content-divider/content-divider.d.ts +10 -0
- package/dist/components/content-divider/index.d.ts +2 -0
- package/dist/components/dropdown/context-menu-item.d.ts +39 -0
- package/dist/components/dropdown/dropdown-item.d.ts +30 -0
- package/dist/components/dropdown/dropdown.d.ts +51 -0
- package/dist/components/dropdown/index.d.ts +6 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +36 -0
- package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +18 -0
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +26 -0
- package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +22 -0
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +7 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +38 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +22 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +22 -0
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +18 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +18 -0
- package/dist/components/dropdown-menu/index.d.ts +20 -0
- package/dist/components/hint-text/hint-text.d.ts +11 -0
- package/dist/components/hint-text/index.d.ts +2 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/label.d.ts +29 -0
- package/dist/components/modal/index.d.ts +14 -0
- package/dist/components/modal/modal-body.d.ts +21 -0
- package/dist/components/modal/modal-close.d.ts +18 -0
- package/dist/components/modal/modal-content.d.ts +37 -0
- package/dist/components/modal/modal-footer.d.ts +21 -0
- package/dist/components/modal/modal-header.d.ts +16 -0
- package/dist/components/modal/modal-trigger.d.ts +18 -0
- package/dist/components/modal/modal.d.ts +22 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/popover/popover-content.d.ts +41 -0
- package/dist/components/popover/popover-trigger.d.ts +18 -0
- package/dist/components/popover/popover.d.ts +22 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.d.ts +22 -0
- package/dist/components/scroll-area/scroll-bar.d.ts +9 -0
- package/dist/components/segmented-control/index.d.ts +4 -0
- package/dist/components/segmented-control/segmented-control-item.d.ts +22 -0
- package/dist/components/segmented-control/segmented-control.d.ts +26 -0
- package/dist/components/select/index.d.ts +18 -0
- package/dist/components/select/select-content.d.ts +33 -0
- package/dist/components/select/select-group.d.ts +18 -0
- package/dist/components/select/select-icon.d.ts +21 -0
- package/dist/components/select/select-item.d.ts +22 -0
- package/dist/components/select/select-label.d.ts +22 -0
- package/dist/components/select/select-separator.d.ts +7 -0
- package/dist/components/select/select-trigger.d.ts +28 -0
- package/dist/components/select/select-value.d.ts +22 -0
- package/dist/components/select/select.d.ts +28 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/slider.d.ts +13 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +11 -0
- package/dist/components/tab-menu/index.d.ts +8 -0
- package/dist/components/tab-menu/tab-menu-content.d.ts +22 -0
- package/dist/components/tab-menu/tab-menu-item.d.ts +24 -0
- package/dist/components/tab-menu/tab-menu-list.d.ts +22 -0
- package/dist/components/tab-menu/tab-menu.d.ts +23 -0
- package/dist/components/text-input/index.d.ts +8 -0
- package/dist/components/text-input/text-input-affix.d.ts +26 -0
- package/dist/components/text-input/text-input-button.d.ts +23 -0
- package/dist/components/text-input/text-input-icon.d.ts +10 -0
- package/dist/components/text-input/text-input.d.ts +27 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +22 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +29 -0
- package/dist/composables/use-delegated-props.d.ts +2 -0
- package/dist/es/alert.js +112 -0
- package/dist/es/alpha-slider.js +4 -0
- package/dist/es/badge.js +56 -0
- package/dist/es/button.js +40 -0
- package/dist/es/checkbox.js +4 -0
- package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
- package/dist/es/chunks/alpha-slider.js +128 -0
- package/dist/es/chunks/checkbox.vue_vue_type_style_index_0_lang.js +39 -0
- package/dist/es/chunks/clsx.js +16 -0
- package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +53 -0
- package/dist/es/chunks/dropdown-menu-content.vue_vue_type_style_index_0_lang.js +52 -0
- package/dist/es/chunks/dropdown-menu-sub-content.vue_vue_type_style_index_0_lang.js +50 -0
- package/dist/es/chunks/dropdown-menu-sub-trigger.vue_vue_type_style_index_0_lang.js +33 -0
- package/dist/es/chunks/dropdown-menu-sub.js +26 -0
- package/dist/es/chunks/index.js +9041 -0
- package/dist/es/chunks/modal-close.js +23 -0
- package/dist/es/chunks/modal-trigger.js +23 -0
- package/dist/es/chunks/modal.js +27 -0
- package/dist/es/chunks/popover.js +27 -0
- package/dist/es/chunks/scroll-area.js +42 -0
- package/dist/es/chunks/select-group.js +23 -0
- package/dist/es/chunks/select.js +39 -0
- package/dist/es/chunks/slider.vue_vue_type_style_index_0_lang.js +53 -0
- package/dist/es/chunks/switch.vue_vue_type_style_index_0_lang.js +39 -0
- package/dist/es/chunks/use-color-model.js +993 -0
- package/dist/es/color-area.js +176 -0
- package/dist/es/color-picker.js +516 -0
- package/dist/es/color-swatch.js +60 -0
- package/dist/es/color.js +102 -0
- package/dist/es/command-group.js +42 -0
- package/dist/es/command-input.js +46 -0
- package/dist/es/command-item.js +35 -0
- package/dist/es/command-list.js +53 -0
- package/dist/es/command-root.js +46 -0
- package/dist/es/command-separator.js +33 -0
- package/dist/es/compact-button.js +43 -0
- package/dist/es/content-divider.js +4 -0
- package/dist/es/context-menu-item.js +135 -0
- package/dist/es/crypto.js +8 -0
- package/dist/es/dropdown-item.js +100 -0
- package/dist/es/dropdown-menu-content.js +4 -0
- package/dist/es/dropdown-menu-group.js +25 -0
- package/dist/es/dropdown-menu-item.js +69 -0
- package/dist/es/dropdown-menu-label.js +32 -0
- package/dist/es/dropdown-menu-separator.js +26 -0
- package/dist/es/dropdown-menu-sub-content.js +4 -0
- package/dist/es/dropdown-menu-sub-trigger.js +4 -0
- package/dist/es/dropdown-menu-sub.js +4 -0
- package/dist/es/dropdown-menu-trigger.js +27 -0
- package/dist/es/dropdown-menu.js +33 -0
- package/dist/es/dropdown.js +285 -0
- package/dist/es/fancy-button.js +39 -0
- package/dist/es/hint-text.js +37 -0
- package/dist/es/hue-slider.js +134 -0
- package/dist/es/index.js +190 -0
- package/dist/es/label.js +56 -0
- package/dist/es/link-button.js +45 -0
- package/dist/es/modal-body.js +23 -0
- package/dist/es/modal-close.js +4 -0
- package/dist/es/modal-content.js +49 -0
- package/dist/es/modal-footer.js +23 -0
- package/dist/es/modal-header.js +82 -0
- package/dist/es/modal-trigger.js +4 -0
- package/dist/es/modal.js +4 -0
- package/dist/es/popover-content.js +105 -0
- package/dist/es/popover-trigger.js +25 -0
- package/dist/es/popover.js +4 -0
- package/dist/es/scroll-area.js +4 -0
- package/dist/es/scroll-bar.js +40 -0
- package/dist/es/segmented-control-item.js +42 -0
- package/dist/es/segmented-control.js +41 -0
- package/dist/es/select-content.js +62 -0
- package/dist/es/select-group.js +4 -0
- package/dist/es/select-icon.js +26 -0
- package/dist/es/select-item.js +45 -0
- package/dist/es/select-label.js +33 -0
- package/dist/es/select-separator.js +27 -0
- package/dist/es/select-trigger.js +41 -0
- package/dist/es/select-value.js +32 -0
- package/dist/es/select.js +4 -0
- package/dist/es/shims.js +1 -0
- package/dist/es/slider.js +4 -0
- package/dist/es/social-button.js +46 -0
- package/dist/es/status-badge.js +50 -0
- package/dist/es/switch.js +4 -0
- package/dist/es/tab-menu-content.js +33 -0
- package/dist/es/tab-menu-item.js +45 -0
- package/dist/es/tab-menu-list.js +35 -0
- package/dist/es/tab-menu.js +33 -0
- package/dist/es/text-input-affix.js +29 -0
- package/dist/es/text-input-button.js +33 -0
- package/dist/es/text-input-icon.js +30 -0
- package/dist/es/text-input.js +42 -0
- package/dist/es/textarea.js +57 -0
- package/dist/es/tooltip.js +116 -0
- package/dist/es/use-color-model.js +6 -0
- package/dist/es/use-delegated-props.js +14 -0
- package/dist/es/use-user-select.js +39 -0
- package/dist/index.d.ts +5 -0
- package/dist/utils/color.d.ts +26 -0
- package/dist/utils/crypto.d.ts +1 -0
- package/package.json +77 -0
- package/src/components/alert/alert.vue +312 -0
- package/src/components/alert/index.ts +2 -0
- package/src/components/alert/stories/alert.stories.ts +91 -0
- package/src/components/badge/badge.vue +131 -0
- package/src/components/badge/index.ts +5 -0
- package/src/components/badge/status-badge.vue +110 -0
- package/src/components/badge/stories/badge.stories.ts +33 -0
- package/src/components/badge/stories/status-badge.stories.ts +31 -0
- package/src/components/button/button.vue +281 -0
- package/src/components/button/compact-button.vue +126 -0
- package/src/components/button/fancy-button.vue +171 -0
- package/src/components/button/index.ts +14 -0
- package/src/components/button/link-button.vue +128 -0
- package/src/components/button/social-button.vue +130 -0
- package/src/components/button/stories/button.stories.ts +31 -0
- package/src/components/button/stories/compact-button.stories.ts +31 -0
- package/src/components/button/stories/fancy-button.stories.ts +31 -0
- package/src/components/button/stories/link-button.stories.ts +26 -0
- package/src/components/button/stories/social-button.stories.ts +29 -0
- package/src/components/checkbox/checkbox.vue +131 -0
- package/src/components/checkbox/index.ts +2 -0
- package/src/components/checkbox/stories/checkbox.stories.ts +102 -0
- package/src/components/color-picker/alpha-slider.vue +149 -0
- package/src/components/color-picker/color-area.vue +213 -0
- package/src/components/color-picker/color-picker.vue +642 -0
- package/src/components/color-picker/color-swatch.vue +98 -0
- package/src/components/color-picker/composable/use-color-model.ts +40 -0
- package/src/components/color-picker/composable/use-user-select.ts +51 -0
- package/src/components/color-picker/hue-slider.vue +156 -0
- package/src/components/color-picker/index.ts +14 -0
- package/src/components/color-picker/stories/color-picker.stories.ts +116 -0
- package/src/components/command/command-group.vue +42 -0
- package/src/components/command/command-input.vue +77 -0
- package/src/components/command/command-item.vue +45 -0
- package/src/components/command/command-list.vue +37 -0
- package/src/components/command/command-root.vue +45 -0
- package/src/components/command/command-separator.vue +31 -0
- package/src/components/content-divider/content-divider.vue +110 -0
- package/src/components/content-divider/index.ts +2 -0
- package/src/components/content-divider/stories/content-divider.stories.ts +37 -0
- package/src/components/dropdown/context-menu-item.vue +317 -0
- package/src/components/dropdown/dropdown-item.vue +184 -0
- package/src/components/dropdown/dropdown.vue +620 -0
- package/src/components/dropdown/index.ts +8 -0
- package/src/components/dropdown/stories/context-menu-item.stories.ts +51 -0
- package/src/components/dropdown/stories/dropdown-item.stories.ts +33 -0
- package/src/components/dropdown/stories/dropdown.stories.ts +53 -0
- package/src/components/dropdown-menu/dropdown-menu-content.vue +79 -0
- package/src/components/dropdown-menu/dropdown-menu-group.vue +19 -0
- package/src/components/dropdown-menu/dropdown-menu-item.vue +147 -0
- package/src/components/dropdown-menu/dropdown-menu-label.vue +33 -0
- package/src/components/dropdown-menu/dropdown-menu-separator.vue +27 -0
- package/src/components/dropdown-menu/dropdown-menu-sub-content.vue +72 -0
- package/src/components/dropdown-menu/dropdown-menu-sub-trigger.vue +70 -0
- package/src/components/dropdown-menu/dropdown-menu-sub.vue +19 -0
- package/src/components/dropdown-menu/dropdown-menu-trigger.vue +52 -0
- package/src/components/dropdown-menu/dropdown-menu.vue +23 -0
- package/src/components/dropdown-menu/index.ts +29 -0
- package/src/components/dropdown-menu/stories/dropdown-menu.stories.ts +107 -0
- package/src/components/hint-text/hint-text.vue +63 -0
- package/src/components/hint-text/index.ts +2 -0
- package/src/components/hint-text/stories/hint-text.stories.ts +28 -0
- package/src/components/index.ts +20 -0
- package/src/components/label/index.ts +2 -0
- package/src/components/label/label.vue +103 -0
- package/src/components/label/stories/label.stories.ts +127 -0
- package/src/components/modal/index.ts +20 -0
- package/src/components/modal/modal-body.vue +26 -0
- package/src/components/modal/modal-close.vue +11 -0
- package/src/components/modal/modal-content.vue +64 -0
- package/src/components/modal/modal-footer.vue +22 -0
- package/src/components/modal/modal-header.vue +165 -0
- package/src/components/modal/modal-trigger.vue +12 -0
- package/src/components/modal/modal.vue +15 -0
- package/src/components/modal/stories/modal.stories.ts +287 -0
- package/src/components/popover/index.ts +8 -0
- package/src/components/popover/popover-content.vue +254 -0
- package/src/components/popover/popover-trigger.vue +22 -0
- package/src/components/popover/popover.vue +17 -0
- package/src/components/popover/stories/popover.stories.ts +341 -0
- package/src/components/scroll-area/index.ts +2 -0
- package/src/components/scroll-area/scroll-area.vue +29 -0
- package/src/components/scroll-area/scroll-bar.vue +36 -0
- package/src/components/segmented-control/index.ts +5 -0
- package/src/components/segmented-control/segmented-control-item.vue +62 -0
- package/src/components/segmented-control/segmented-control.vue +38 -0
- package/src/components/segmented-control/stories/segmented-control.stories.ts +120 -0
- package/src/components/select/index.ts +26 -0
- package/src/components/select/select-content.vue +77 -0
- package/src/components/select/select-group.vue +11 -0
- package/src/components/select/select-icon.vue +29 -0
- package/src/components/select/select-item.vue +65 -0
- package/src/components/select/select-label.vue +27 -0
- package/src/components/select/select-separator.vue +25 -0
- package/src/components/select/select-trigger.vue +161 -0
- package/src/components/select/select-value.vue +37 -0
- package/src/components/select/select.vue +21 -0
- package/src/components/select/stories/select.stories.ts +428 -0
- package/src/components/slider/index.ts +2 -0
- package/src/components/slider/slider.vue +81 -0
- package/src/components/slider/stories/slider.stories.ts +30 -0
- package/src/components/switch/index.ts +2 -0
- package/src/components/switch/stories/switch.stories.ts +74 -0
- package/src/components/switch/switch.vue +92 -0
- package/src/components/tab-menu/index.ts +11 -0
- package/src/components/tab-menu/stories/tab-menu.stories.ts +239 -0
- package/src/components/tab-menu/tab-menu-content.vue +27 -0
- package/src/components/tab-menu/tab-menu-item.vue +108 -0
- package/src/components/tab-menu/tab-menu-list.vue +43 -0
- package/src/components/tab-menu/tab-menu.vue +29 -0
- package/src/components/text-input/index.ts +11 -0
- package/src/components/text-input/stories/text-input.stories.ts +244 -0
- package/src/components/text-input/text-input-affix.vue +58 -0
- package/src/components/text-input/text-input-button.vue +56 -0
- package/src/components/text-input/text-input-icon.vue +37 -0
- package/src/components/text-input/text-input.vue +187 -0
- package/src/components/textarea/index.ts +2 -0
- package/src/components/textarea/stories/textarea.stories.ts +27 -0
- package/src/components/textarea/textarea.vue +155 -0
- package/src/components/tooltip/index.ts +2 -0
- package/src/components/tooltip/stories/tooltip.stories.ts +138 -0
- package/src/components/tooltip/tooltip.vue +256 -0
- package/src/composables/use-delegated-props.ts +20 -0
- package/src/index.ts +13 -0
- package/src/shims.d.ts +6 -0
- package/src/utils/color.ts +131 -0
- package/src/utils/crypto.ts +6 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const useDelegatedProps = require("./use-delegated-props.js");
|
|
4
|
+
const color = require("./color.js");
|
|
5
|
+
const index = require("./chunks/index.js");
|
|
6
|
+
const useColorModel = require("./chunks/use-color-model.js");
|
|
7
|
+
const button = require("./button.js");
|
|
8
|
+
require("./compact-button.js");
|
|
9
|
+
;/* empty css */
|
|
10
|
+
;/* empty css */
|
|
11
|
+
;/* empty css */
|
|
12
|
+
const popoverContent = require("./popover-content.js");
|
|
13
|
+
const popoverTrigger = require("./popover-trigger.js");
|
|
14
|
+
const popover_vue_vue_type_script_setup_true_lang = require("./chunks/popover.js");
|
|
15
|
+
const selectContent = require("./select-content.js");
|
|
16
|
+
;/* empty css */
|
|
17
|
+
const selectItem = require("./select-item.js");
|
|
18
|
+
;/* empty css */
|
|
19
|
+
;/* empty css */
|
|
20
|
+
const selectTrigger = require("./select-trigger.js");
|
|
21
|
+
const selectValue = require("./select-value.js");
|
|
22
|
+
const select_vue_vue_type_script_setup_true_lang = require("./chunks/select.js");
|
|
23
|
+
;/* empty css */
|
|
24
|
+
;/* empty css */
|
|
25
|
+
;/* empty css */
|
|
26
|
+
const textInput = require("./text-input.js");
|
|
27
|
+
const alphaSlider_vue_vue_type_script_setup_true_lang = require("./chunks/alpha-slider.js");
|
|
28
|
+
const colorArea = require("./color-area.js");
|
|
29
|
+
const colorSwatch = require("./color-swatch.js");
|
|
30
|
+
const hueSlider = require("./hue-slider.js");
|
|
31
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
32
|
+
const _hoisted_1 = { class: "celeste-color-picker" };
|
|
33
|
+
const _hoisted_2 = { class: "celeste-color-control-panel" };
|
|
34
|
+
const _hoisted_3 = { class: "celeste-color-format" };
|
|
35
|
+
const _hoisted_4 = { class: "celeste-color-controls" };
|
|
36
|
+
const _hoisted_5 = { class: "celeste-color-format-inputs" };
|
|
37
|
+
const _hoisted_6 = { class: "celeste-color-swatches" };
|
|
38
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
39
|
+
__name: "color-picker",
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: { default: "hsl(240, 100%, 50%)" },
|
|
42
|
+
label: { default: "Pick Color" },
|
|
43
|
+
class: {},
|
|
44
|
+
formats: { default: () => ["hex", "rgb", "hsl", "hsb"] },
|
|
45
|
+
defaultFormat: {}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:modelValue"],
|
|
48
|
+
setup(__props, { emit: __emit }) {
|
|
49
|
+
Mo.useCssVars((_ctx) => ({
|
|
50
|
+
"207f2bae": _ctx.modelValue
|
|
51
|
+
}));
|
|
52
|
+
const props = __props;
|
|
53
|
+
const emit = __emit;
|
|
54
|
+
const delegatedProps = useDelegatedProps.useDelegatedProps(props, "class");
|
|
55
|
+
const forwarded = index.xe(delegatedProps, emit);
|
|
56
|
+
const tinyColorRef = useColorModel.defineColorModel(props, emit);
|
|
57
|
+
const hueRef = Mo.ref(tinyColorRef.value.toHsl().h);
|
|
58
|
+
const currentColorFormat = Mo.ref(props.defaultFormat || "hex");
|
|
59
|
+
const eyeDropper = Mo.ref(null);
|
|
60
|
+
const hex = Mo.computed({
|
|
61
|
+
get: () => tinyColorRef.value.toHexString().toUpperCase(),
|
|
62
|
+
set: () => {
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const rgb = Mo.computed(() => {
|
|
66
|
+
return tinyColorRef.value.toRgb();
|
|
67
|
+
});
|
|
68
|
+
const hsl = Mo.computed(() => {
|
|
69
|
+
const { h, s, l } = tinyColorRef.value.toHsl();
|
|
70
|
+
return {
|
|
71
|
+
h: `${h.toFixed()}°`,
|
|
72
|
+
s: `${(s * 100).toFixed()}%`,
|
|
73
|
+
l: `${(l * 100).toFixed()}%`,
|
|
74
|
+
a: tinyColorRef.value.getAlpha()
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
const hsv = Mo.computed(() => {
|
|
78
|
+
const { h, s, v } = tinyColorRef.value.toHsv();
|
|
79
|
+
return {
|
|
80
|
+
h: `${h.toFixed()}°`,
|
|
81
|
+
s: `${(s * 100).toFixed()}%`,
|
|
82
|
+
v: `${(v * 100).toFixed()}%`
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
Mo.watch(tinyColorRef, (tinyColorInstance) => {
|
|
86
|
+
const newHue = tinyColorInstance.toHsl().h;
|
|
87
|
+
const saturation = tinyColorInstance.toHsl().s;
|
|
88
|
+
if (saturation === 0 && hueRef.value !== 0) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
hueRef.value = newHue;
|
|
92
|
+
}, { immediate: true });
|
|
93
|
+
if (window.EyeDropper) {
|
|
94
|
+
eyeDropper.value = new window.EyeDropper();
|
|
95
|
+
}
|
|
96
|
+
function sipColor() {
|
|
97
|
+
if (!eyeDropper.value) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
eyeDropper.value.open().then((result) => {
|
|
101
|
+
const newColor = useColorModel.tinycolor(result.sRGBHex);
|
|
102
|
+
tinyColorRef.value = newColor;
|
|
103
|
+
}).catch((e) => {
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function getCurrentColorValue(key) {
|
|
107
|
+
let currentValue = 0;
|
|
108
|
+
if (key === "r" || key === "g" || key === "b") {
|
|
109
|
+
currentValue = rgb.value[key];
|
|
110
|
+
} else if (key === "h") {
|
|
111
|
+
currentValue = tinyColorRef.value.toHsl().h;
|
|
112
|
+
} else if (key === "s" || key === "l" || key === "v") {
|
|
113
|
+
if (currentColorFormat.value === "hsl") {
|
|
114
|
+
const currentHsl = tinyColorRef.value.toHsl();
|
|
115
|
+
currentValue = key === "s" ? currentHsl.s * 100 : currentHsl.l * 100;
|
|
116
|
+
} else {
|
|
117
|
+
const currentHsv = tinyColorRef.value.toHsv();
|
|
118
|
+
currentValue = key === "s" ? currentHsv.s * 100 : currentHsv.v * 100;
|
|
119
|
+
}
|
|
120
|
+
} else if (key === "a") {
|
|
121
|
+
currentValue = tinyColorRef.value.getAlpha() * 100;
|
|
122
|
+
}
|
|
123
|
+
return currentValue;
|
|
124
|
+
}
|
|
125
|
+
function validateInput(event) {
|
|
126
|
+
const input = event.target;
|
|
127
|
+
const inputEvent = event;
|
|
128
|
+
const newValue = color.truncColorValue(input.value) + (inputEvent.data ?? "");
|
|
129
|
+
if (!color.COLOR_NUMBER_VALIDATION_PATTERN.test(newValue)) {
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function validateHexInput(event) {
|
|
134
|
+
const input = event.target;
|
|
135
|
+
const inputEvent = event;
|
|
136
|
+
const newValue = input.value + (inputEvent.data ?? "");
|
|
137
|
+
if (!color.HEX_VALIDATION_PATTERN.test(newValue)) {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function inputChangeHex(event) {
|
|
142
|
+
var _a;
|
|
143
|
+
const colorInput = (_a = event.target) == null ? void 0 : _a.value;
|
|
144
|
+
if (!colorInput) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
tinyColorRef.value = useColorModel.tinycolor(colorInput);
|
|
148
|
+
}
|
|
149
|
+
function inputChangeRGB(event, key) {
|
|
150
|
+
var _a;
|
|
151
|
+
const value = Number((_a = event.target) == null ? void 0 : _a.value);
|
|
152
|
+
const currentRgb = rgb.value;
|
|
153
|
+
const newRgb = { ...currentRgb, [key]: value };
|
|
154
|
+
tinyColorRef.value = useColorModel.tinycolor(newRgb);
|
|
155
|
+
}
|
|
156
|
+
function inputChangeHSL(event, key) {
|
|
157
|
+
var _a;
|
|
158
|
+
const HSLInput = (_a = event.target) == null ? void 0 : _a.value;
|
|
159
|
+
let newHSLValue = color.truncColorValue(HSLInput);
|
|
160
|
+
if (key === "s" || key === "l") {
|
|
161
|
+
newHSLValue /= 100;
|
|
162
|
+
}
|
|
163
|
+
if (Number.isNaN(newHSLValue)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const newHSL = { [key]: newHSLValue };
|
|
167
|
+
tinyColorRef.value = {
|
|
168
|
+
...tinyColorRef.value.toHsl(),
|
|
169
|
+
...newHSL
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function inputChangeHSB(event, key) {
|
|
173
|
+
var _a;
|
|
174
|
+
const HSBInput = (_a = event.target) == null ? void 0 : _a.value;
|
|
175
|
+
const HSBValue = color.truncColorValue(HSBInput);
|
|
176
|
+
if (Number.isNaN(HSBValue)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const newHSB = { [key]: HSBValue };
|
|
180
|
+
tinyColorRef.value = {
|
|
181
|
+
...tinyColorRef.value.toHsv(),
|
|
182
|
+
...newHSB
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function inputChangeAlpha(event) {
|
|
186
|
+
var _a;
|
|
187
|
+
const alphaInput = (_a = event.target) == null ? void 0 : _a.value;
|
|
188
|
+
const alphaValue = color.truncColorValue(alphaInput) / 100;
|
|
189
|
+
if (Number.isNaN(alphaValue)) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
tinyColorRef.value = tinyColorRef.value.setAlpha(Math.max(0, Math.min(1, alphaValue)));
|
|
193
|
+
}
|
|
194
|
+
function handleColorValueKeyDown(event, key) {
|
|
195
|
+
const direction = color.resolveArrowDirection(event);
|
|
196
|
+
const currentValue = getCurrentColorValue(key);
|
|
197
|
+
const { min, max } = color.getColorConstraints(key);
|
|
198
|
+
const newValue = color.clamp(color.bumpColorValue(currentValue, direction), min, max);
|
|
199
|
+
if (key === "r" || key === "g" || key === "b") {
|
|
200
|
+
const newColor = useColorModel.tinycolor({ ...rgb.value, [key]: newValue });
|
|
201
|
+
emit("update:modelValue", newColor.toString());
|
|
202
|
+
} else if (key === "h") {
|
|
203
|
+
if (currentColorFormat.value === "hsl") {
|
|
204
|
+
const newColor = useColorModel.tinycolor({ ...tinyColorRef.value.toHsl(), h: newValue });
|
|
205
|
+
emit("update:modelValue", newColor.toString());
|
|
206
|
+
} else {
|
|
207
|
+
const newColor = useColorModel.tinycolor({ ...tinyColorRef.value.toHsv(), h: newValue });
|
|
208
|
+
emit("update:modelValue", newColor.toString());
|
|
209
|
+
}
|
|
210
|
+
} else if (key === "s" || key === "l" || key === "v") {
|
|
211
|
+
if (currentColorFormat.value === "hsl") {
|
|
212
|
+
const newColor = useColorModel.tinycolor({ ...tinyColorRef.value.toHsl(), [key]: newValue / 100 });
|
|
213
|
+
emit("update:modelValue", newColor.toString());
|
|
214
|
+
} else {
|
|
215
|
+
const currentHsv = tinyColorRef.value.toHsv();
|
|
216
|
+
const newColor = useColorModel.tinycolor({ ...currentHsv, [key]: newValue / 100 });
|
|
217
|
+
emit("update:modelValue", newColor.toString());
|
|
218
|
+
}
|
|
219
|
+
} else if (key === "a") {
|
|
220
|
+
const newColor = tinyColorRef.value.setAlpha(newValue / 100);
|
|
221
|
+
emit("update:modelValue", newColor.toString());
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return (_ctx, _cache) => {
|
|
225
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(popover_vue_vue_type_script_setup_true_lang._sfc_main), null, {
|
|
226
|
+
default: Mo.withCtx(() => [
|
|
227
|
+
Mo.createVNode(Mo.unref(popoverTrigger), null, {
|
|
228
|
+
default: Mo.withCtx(() => [
|
|
229
|
+
Mo.createVNode(Mo.unref(button), {
|
|
230
|
+
class: "celeste-picker-trigger",
|
|
231
|
+
intent: "neutral",
|
|
232
|
+
variant: "stroke"
|
|
233
|
+
}, {
|
|
234
|
+
default: Mo.withCtx(() => [
|
|
235
|
+
_cache[53] || (_cache[53] = Mo.createElementVNode("span", { class: "celeste-selected-color" }, null, -1)),
|
|
236
|
+
Mo.createTextVNode(" " + Mo.toDisplayString(_ctx.label), 1)
|
|
237
|
+
]),
|
|
238
|
+
_: 1
|
|
239
|
+
})
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
}),
|
|
243
|
+
Mo.createVNode(Mo.unref(popoverContent), { dismissible: false }, {
|
|
244
|
+
default: Mo.withCtx(() => [
|
|
245
|
+
Mo.createElementVNode("div", Mo.mergeProps({ class: "celeste-color-picker-wrapper" }, Mo.unref(forwarded)), [
|
|
246
|
+
Mo.createElementVNode("div", _hoisted_1, [
|
|
247
|
+
Mo.createVNode(Mo.unref(colorArea), {
|
|
248
|
+
modelValue: Mo.unref(tinyColorRef),
|
|
249
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Mo.isRef(tinyColorRef) ? tinyColorRef.value = $event : null),
|
|
250
|
+
hue: hueRef.value
|
|
251
|
+
}, null, 8, ["modelValue", "hue"]),
|
|
252
|
+
Mo.createVNode(Mo.unref(hueSlider), {
|
|
253
|
+
modelValue: hueRef.value,
|
|
254
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => hueRef.value = $event)
|
|
255
|
+
}, null, 8, ["modelValue"]),
|
|
256
|
+
Mo.createVNode(alphaSlider_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
257
|
+
modelValue: Mo.unref(tinyColorRef),
|
|
258
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => Mo.isRef(tinyColorRef) ? tinyColorRef.value = $event : null)
|
|
259
|
+
}, null, 8, ["modelValue"]),
|
|
260
|
+
Mo.createElementVNode("div", _hoisted_2, [
|
|
261
|
+
Mo.createVNode(Mo.unref(select_vue_vue_type_script_setup_true_lang._sfc_main), {
|
|
262
|
+
modelValue: currentColorFormat.value,
|
|
263
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => currentColorFormat.value = $event),
|
|
264
|
+
name: "color-format"
|
|
265
|
+
}, {
|
|
266
|
+
default: Mo.withCtx(() => [
|
|
267
|
+
Mo.createVNode(Mo.unref(selectTrigger), { variant: "inline" }, {
|
|
268
|
+
default: Mo.withCtx(() => [
|
|
269
|
+
Mo.createVNode(Mo.unref(selectValue), {
|
|
270
|
+
placeholder: "HEX",
|
|
271
|
+
class: "celeste-selected-color-format"
|
|
272
|
+
}, {
|
|
273
|
+
default: Mo.withCtx(() => [
|
|
274
|
+
Mo.createTextVNode(Mo.toDisplayString(currentColorFormat.value), 1)
|
|
275
|
+
]),
|
|
276
|
+
_: 1
|
|
277
|
+
})
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
}),
|
|
281
|
+
Mo.createVNode(Mo.unref(selectContent), { width: "fit" }, {
|
|
282
|
+
default: Mo.withCtx(() => [
|
|
283
|
+
(Mo.openBlock(true), Mo.createElementBlock(Mo.Fragment, null, Mo.renderList(props.formats, (format) => {
|
|
284
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(selectItem), {
|
|
285
|
+
key: format,
|
|
286
|
+
value: format
|
|
287
|
+
}, {
|
|
288
|
+
default: Mo.withCtx(() => [
|
|
289
|
+
Mo.createElementVNode("span", _hoisted_3, Mo.toDisplayString(format), 1)
|
|
290
|
+
]),
|
|
291
|
+
_: 2
|
|
292
|
+
}, 1032, ["value"]);
|
|
293
|
+
}), 128))
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
})
|
|
297
|
+
]),
|
|
298
|
+
_: 1
|
|
299
|
+
}, 8, ["modelValue"]),
|
|
300
|
+
Mo.createElementVNode("div", _hoisted_4, [
|
|
301
|
+
eyeDropper.value ? (Mo.openBlock(), Mo.createBlock(Mo.unref(button), {
|
|
302
|
+
key: 0,
|
|
303
|
+
class: "celeste-color-sip",
|
|
304
|
+
variant: "stroke",
|
|
305
|
+
size: "xxs",
|
|
306
|
+
intent: "neutral",
|
|
307
|
+
onClick: sipColor
|
|
308
|
+
}, {
|
|
309
|
+
default: Mo.withCtx(() => _cache[54] || (_cache[54] = [
|
|
310
|
+
Mo.createElementVNode("i", { "i-celeste-sip-line": "" }, null, -1)
|
|
311
|
+
])),
|
|
312
|
+
_: 1
|
|
313
|
+
})) : Mo.createCommentVNode("", true),
|
|
314
|
+
Mo.createElementVNode("div", _hoisted_5, [
|
|
315
|
+
currentColorFormat.value === "hex" ? (Mo.openBlock(), Mo.createBlock(Mo.unref(textInput), {
|
|
316
|
+
key: 0,
|
|
317
|
+
modelValue: hex.value,
|
|
318
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => hex.value = $event),
|
|
319
|
+
autocomplete: "off",
|
|
320
|
+
name: "hex",
|
|
321
|
+
placeholder: "#FFFFFF",
|
|
322
|
+
type: "text",
|
|
323
|
+
class: "color-input",
|
|
324
|
+
size: "xs",
|
|
325
|
+
onBeforeinput: validateHexInput,
|
|
326
|
+
onFocusout: inputChangeHex,
|
|
327
|
+
onKeydown: Mo.withKeys(Mo.withModifiers(inputChangeHex, ["prevent"]), ["enter"])
|
|
328
|
+
}, null, 8, ["modelValue", "onKeydown"])) : currentColorFormat.value === "rgb" ? (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 1 }, [
|
|
329
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
330
|
+
modelValue: rgb.value.r,
|
|
331
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => rgb.value.r = $event),
|
|
332
|
+
autocomplete: "off",
|
|
333
|
+
name: "red",
|
|
334
|
+
type: "text",
|
|
335
|
+
class: "color-input",
|
|
336
|
+
size: "xs",
|
|
337
|
+
onBeforeinput: validateInput,
|
|
338
|
+
onFocusout: _cache[6] || (_cache[6] = (e) => inputChangeRGB(e, "r")),
|
|
339
|
+
onKeydown: [
|
|
340
|
+
_cache[7] || (_cache[7] = Mo.withKeys(Mo.withModifiers((e) => inputChangeRGB(e, "r"), ["prevent"]), ["enter"])),
|
|
341
|
+
_cache[8] || (_cache[8] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "r"), ["prevent", "stop"]), ["up"])),
|
|
342
|
+
_cache[9] || (_cache[9] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "r"), ["prevent", "stop"]), ["down"]))
|
|
343
|
+
]
|
|
344
|
+
}, null, 8, ["modelValue"]),
|
|
345
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
346
|
+
modelValue: rgb.value.g,
|
|
347
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => rgb.value.g = $event),
|
|
348
|
+
autocomplete: "off",
|
|
349
|
+
name: "green",
|
|
350
|
+
type: "text",
|
|
351
|
+
class: "color-input",
|
|
352
|
+
size: "xs",
|
|
353
|
+
onBeforeinput: validateInput,
|
|
354
|
+
onFocusout: _cache[11] || (_cache[11] = (e) => inputChangeRGB(e, "g")),
|
|
355
|
+
onKeydown: [
|
|
356
|
+
_cache[12] || (_cache[12] = Mo.withKeys(Mo.withModifiers((e) => inputChangeRGB(e, "g"), ["prevent"]), ["enter"])),
|
|
357
|
+
_cache[13] || (_cache[13] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "g"), ["prevent", "stop"]), ["up"])),
|
|
358
|
+
_cache[14] || (_cache[14] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "g"), ["prevent", "stop"]), ["down"]))
|
|
359
|
+
]
|
|
360
|
+
}, null, 8, ["modelValue"]),
|
|
361
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
362
|
+
modelValue: rgb.value.b,
|
|
363
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => rgb.value.b = $event),
|
|
364
|
+
autocomplete: "off",
|
|
365
|
+
name: "blue",
|
|
366
|
+
type: "text",
|
|
367
|
+
class: "color-input",
|
|
368
|
+
size: "xs",
|
|
369
|
+
onBeforeinput: validateInput,
|
|
370
|
+
onFocusout: _cache[16] || (_cache[16] = (e) => inputChangeRGB(e, "b")),
|
|
371
|
+
onKeydown: [
|
|
372
|
+
_cache[17] || (_cache[17] = Mo.withKeys(Mo.withModifiers((e) => inputChangeRGB(e, "b"), ["prevent"]), ["enter"])),
|
|
373
|
+
_cache[18] || (_cache[18] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "b"), ["prevent", "stop"]), ["up"])),
|
|
374
|
+
_cache[19] || (_cache[19] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "b"), ["prevent", "stop"]), ["down"]))
|
|
375
|
+
]
|
|
376
|
+
}, null, 8, ["modelValue"])
|
|
377
|
+
], 64)) : currentColorFormat.value === "hsl" ? (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 2 }, [
|
|
378
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
379
|
+
modelValue: hsl.value.h,
|
|
380
|
+
"onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => hsl.value.h = $event),
|
|
381
|
+
autocomplete: "off",
|
|
382
|
+
name: "hue",
|
|
383
|
+
type: "text",
|
|
384
|
+
class: "color-input",
|
|
385
|
+
size: "xs",
|
|
386
|
+
onBeforeinput: validateInput,
|
|
387
|
+
onFocusout: _cache[21] || (_cache[21] = (e) => inputChangeHSL(e, "h")),
|
|
388
|
+
onKeydown: [
|
|
389
|
+
_cache[22] || (_cache[22] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSL(e, "h"), ["prevent"]), ["enter"])),
|
|
390
|
+
_cache[23] || (_cache[23] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "h"), ["prevent", "stop"]), ["up"])),
|
|
391
|
+
_cache[24] || (_cache[24] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "h"), ["prevent", "stop"]), ["down"]))
|
|
392
|
+
]
|
|
393
|
+
}, null, 8, ["modelValue"]),
|
|
394
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
395
|
+
modelValue: hsl.value.s,
|
|
396
|
+
"onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => hsl.value.s = $event),
|
|
397
|
+
autocomplete: "off",
|
|
398
|
+
name: "saturation",
|
|
399
|
+
type: "text",
|
|
400
|
+
class: "color-input",
|
|
401
|
+
size: "xs",
|
|
402
|
+
onBeforeinput: validateInput,
|
|
403
|
+
onFocusout: _cache[26] || (_cache[26] = (e) => inputChangeHSL(e, "s")),
|
|
404
|
+
onKeydown: [
|
|
405
|
+
_cache[27] || (_cache[27] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSL(e, "s"), ["prevent"]), ["enter"])),
|
|
406
|
+
_cache[28] || (_cache[28] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "s"), ["prevent", "stop"]), ["up"])),
|
|
407
|
+
_cache[29] || (_cache[29] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "s"), ["prevent", "stop"]), ["down"]))
|
|
408
|
+
]
|
|
409
|
+
}, null, 8, ["modelValue"]),
|
|
410
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
411
|
+
modelValue: hsl.value.l,
|
|
412
|
+
"onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => hsl.value.l = $event),
|
|
413
|
+
autocomplete: "off",
|
|
414
|
+
name: "lightness",
|
|
415
|
+
type: "text",
|
|
416
|
+
class: "color-input",
|
|
417
|
+
size: "xs",
|
|
418
|
+
onBeforeinput: validateInput,
|
|
419
|
+
onFocusout: _cache[31] || (_cache[31] = (e) => inputChangeHSL(e, "l")),
|
|
420
|
+
onKeydown: [
|
|
421
|
+
_cache[32] || (_cache[32] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSL(e, "l"), ["prevent"]), ["enter"])),
|
|
422
|
+
_cache[33] || (_cache[33] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "l"), ["prevent", "stop"]), ["up"])),
|
|
423
|
+
_cache[34] || (_cache[34] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "l"), ["prevent", "stop"]), ["down"]))
|
|
424
|
+
]
|
|
425
|
+
}, null, 8, ["modelValue"])
|
|
426
|
+
], 64)) : currentColorFormat.value === "hsb" ? (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 3 }, [
|
|
427
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
428
|
+
modelValue: hsv.value.h,
|
|
429
|
+
"onUpdate:modelValue": _cache[35] || (_cache[35] = ($event) => hsv.value.h = $event),
|
|
430
|
+
autocomplete: "off",
|
|
431
|
+
name: "hue",
|
|
432
|
+
type: "text",
|
|
433
|
+
class: "color-input",
|
|
434
|
+
size: "xs",
|
|
435
|
+
onBeforeinput: validateInput,
|
|
436
|
+
onFocusout: _cache[36] || (_cache[36] = (e) => inputChangeHSB(e, "h")),
|
|
437
|
+
onKeydown: [
|
|
438
|
+
_cache[37] || (_cache[37] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSB(e, "h"), ["prevent"]), ["enter"])),
|
|
439
|
+
_cache[38] || (_cache[38] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "h"), ["prevent", "stop"]), ["up"])),
|
|
440
|
+
_cache[39] || (_cache[39] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "h"), ["prevent", "stop"]), ["down"]))
|
|
441
|
+
]
|
|
442
|
+
}, null, 8, ["modelValue"]),
|
|
443
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
444
|
+
modelValue: hsv.value.s,
|
|
445
|
+
"onUpdate:modelValue": _cache[40] || (_cache[40] = ($event) => hsv.value.s = $event),
|
|
446
|
+
autocomplete: "off",
|
|
447
|
+
name: "saturation",
|
|
448
|
+
type: "text",
|
|
449
|
+
class: "color-input",
|
|
450
|
+
size: "xs",
|
|
451
|
+
onBeforeinput: validateInput,
|
|
452
|
+
onFocusout: _cache[41] || (_cache[41] = (e) => inputChangeHSB(e, "s")),
|
|
453
|
+
onKeydown: [
|
|
454
|
+
_cache[42] || (_cache[42] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSB(e, "s"), ["prevent"]), ["enter"])),
|
|
455
|
+
_cache[43] || (_cache[43] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "s"), ["prevent", "stop"]), ["up"])),
|
|
456
|
+
_cache[44] || (_cache[44] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "s"), ["prevent", "stop"]), ["down"]))
|
|
457
|
+
]
|
|
458
|
+
}, null, 8, ["modelValue"]),
|
|
459
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
460
|
+
modelValue: hsv.value.v,
|
|
461
|
+
"onUpdate:modelValue": _cache[45] || (_cache[45] = ($event) => hsv.value.v = $event),
|
|
462
|
+
autocomplete: "off",
|
|
463
|
+
name: "brightness",
|
|
464
|
+
type: "text",
|
|
465
|
+
class: "color-input",
|
|
466
|
+
size: "xs",
|
|
467
|
+
onBeforeinput: validateInput,
|
|
468
|
+
onFocusout: _cache[46] || (_cache[46] = (e) => inputChangeHSB(e, "v")),
|
|
469
|
+
onKeydown: [
|
|
470
|
+
_cache[47] || (_cache[47] = Mo.withKeys(Mo.withModifiers((e) => inputChangeHSB(e, "v"), ["prevent"]), ["enter"])),
|
|
471
|
+
_cache[48] || (_cache[48] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "v"), ["prevent", "stop"]), ["up"])),
|
|
472
|
+
_cache[49] || (_cache[49] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "v"), ["prevent", "stop"]), ["down"]))
|
|
473
|
+
]
|
|
474
|
+
}, null, 8, ["modelValue"])
|
|
475
|
+
], 64)) : Mo.createCommentVNode("", true),
|
|
476
|
+
Mo.createVNode(Mo.unref(textInput), {
|
|
477
|
+
autocomplete: "off",
|
|
478
|
+
name: "alpha",
|
|
479
|
+
placeholder: "100",
|
|
480
|
+
type: "text",
|
|
481
|
+
class: "color-input",
|
|
482
|
+
size: "xs",
|
|
483
|
+
value: `${(Mo.unref(tinyColorRef).getAlpha() * 100).toFixed()}%`,
|
|
484
|
+
onBeforeinput: validateInput,
|
|
485
|
+
onFocusout: inputChangeAlpha,
|
|
486
|
+
onKeydown: [
|
|
487
|
+
Mo.withKeys(Mo.withModifiers(inputChangeAlpha, ["prevent", "stop"]), ["enter"]),
|
|
488
|
+
_cache[50] || (_cache[50] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "a"), ["prevent", "stop"]), ["up"])),
|
|
489
|
+
_cache[51] || (_cache[51] = Mo.withKeys(Mo.withModifiers((e) => handleColorValueKeyDown(e, "a"), ["prevent", "stop"]), ["down"]))
|
|
490
|
+
]
|
|
491
|
+
}, null, 8, ["value", "onKeydown"])
|
|
492
|
+
])
|
|
493
|
+
])
|
|
494
|
+
])
|
|
495
|
+
]),
|
|
496
|
+
Mo.createElementVNode("div", _hoisted_6, [
|
|
497
|
+
_ctx.$slots.swatches ? Mo.renderSlot(_ctx.$slots, "swatches", { key: 0 }, void 0, true) : (Mo.openBlock(), Mo.createBlock(colorSwatch, {
|
|
498
|
+
key: 1,
|
|
499
|
+
modelValue: Mo.unref(tinyColorRef),
|
|
500
|
+
"onUpdate:modelValue": _cache[52] || (_cache[52] = ($event) => Mo.isRef(tinyColorRef) ? tinyColorRef.value = $event : null),
|
|
501
|
+
hue: hueRef.value
|
|
502
|
+
}, null, 8, ["modelValue", "hue"]))
|
|
503
|
+
])
|
|
504
|
+
], 16)
|
|
505
|
+
]),
|
|
506
|
+
_: 3
|
|
507
|
+
})
|
|
508
|
+
]),
|
|
509
|
+
_: 3
|
|
510
|
+
});
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
const colorPicker = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-bc3d76fe"]]);
|
|
515
|
+
module.exports = colorPicker;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const color = require("./color.js");
|
|
4
|
+
const useColorModel = require("./chunks/use-color-model.js");
|
|
5
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
6
|
+
const _hoisted_1 = { class: "celeste-color-swatch" };
|
|
7
|
+
const _hoisted_2 = { class: "swatch-label" };
|
|
8
|
+
const _hoisted_3 = { class: "color-palette" };
|
|
9
|
+
const _hoisted_4 = ["aria-selected", "title", "aria-label", "onClick", "onKeydown"];
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
11
|
+
__name: "color-swatch",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
14
|
+
label: { default: "Recommended Colors" },
|
|
15
|
+
swatch: { default: () => color.DEFAULT_SWATCH },
|
|
16
|
+
defaultColor: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
setup(__props, { emit: __emit }) {
|
|
20
|
+
Mo.useCssVars((_ctx) => ({
|
|
21
|
+
"0829b6e2": activeSwatchColorBg.value
|
|
22
|
+
}));
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const tinyColorRef = useColorModel.defineColorModel(props, emit);
|
|
26
|
+
const activeSwatchColorBg = Mo.computed(() => {
|
|
27
|
+
return `0 0 0 2px var(--color-bg-white-0), 0 0 0 4px ${tinyColorRef.value.toRgbString()}`;
|
|
28
|
+
});
|
|
29
|
+
function handleSwatchColorClick(newColor) {
|
|
30
|
+
tinyColorRef.value = useColorModel.tinycolor(newColor);
|
|
31
|
+
}
|
|
32
|
+
function isSwatchColorSelected(color2) {
|
|
33
|
+
return tinyColorRef.value.toHex8String().toLocaleLowerCase() === useColorModel.tinycolor(color2).toHex8String().toLocaleLowerCase();
|
|
34
|
+
}
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return Mo.openBlock(), Mo.createElementBlock("div", _hoisted_1, [
|
|
37
|
+
Mo.createElementVNode("span", _hoisted_2, Mo.toDisplayString(_ctx.label), 1),
|
|
38
|
+
Mo.createElementVNode("div", _hoisted_3, [
|
|
39
|
+
(Mo.openBlock(true), Mo.createElementBlock(Mo.Fragment, null, Mo.renderList(_ctx.swatch, (swatchColor) => {
|
|
40
|
+
return Mo.openBlock(), Mo.createElementBlock("div", {
|
|
41
|
+
key: swatchColor,
|
|
42
|
+
class: "palette-color",
|
|
43
|
+
style: Mo.normalizeStyle({ background: swatchColor }),
|
|
44
|
+
"aria-selected": isSwatchColorSelected(swatchColor.toLowerCase()),
|
|
45
|
+
title: swatchColor,
|
|
46
|
+
"aria-label": `Color:${swatchColor}`,
|
|
47
|
+
role: "option",
|
|
48
|
+
tabindex: "0",
|
|
49
|
+
onClick: ($event) => handleSwatchColorClick(swatchColor),
|
|
50
|
+
onKeydown: Mo.withKeys(($event) => handleSwatchColorClick(swatchColor), ["space"])
|
|
51
|
+
}, null, 44, _hoisted_4);
|
|
52
|
+
}), 128))
|
|
53
|
+
])
|
|
54
|
+
]);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const ColorSwatch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-095c22f0"]]);
|
|
59
|
+
module.exports = ColorSwatch;
|