@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,98 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DEFAULT_SWATCH } from '@/utils/color';
|
|
3
|
+
import tinycolor from 'tinycolor2';
|
|
4
|
+
import { computed } from 'vue';
|
|
5
|
+
import { defineColorModel } from './composable/use-color-model';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<ColorSwatchProps>(), {
|
|
8
|
+
label: 'Recommended Colors',
|
|
9
|
+
swatch: () => DEFAULT_SWATCH,
|
|
10
|
+
});
|
|
11
|
+
const emit = defineEmits<ColorSwatchEmits>();
|
|
12
|
+
|
|
13
|
+
const tinyColorRef = defineColorModel(props, emit);
|
|
14
|
+
|
|
15
|
+
const activeSwatchColorBg = computed(() => {
|
|
16
|
+
return `0 0 0 2px var(--color-bg-white-0), 0 0 0 4px ${tinyColorRef.value.toRgbString()}`;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function handleSwatchColorClick(newColor: string) {
|
|
20
|
+
tinyColorRef.value = tinycolor(newColor);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isSwatchColorSelected(color: string) {
|
|
24
|
+
return tinyColorRef.value.toHex8String().toLocaleLowerCase() === tinycolor(color).toHex8String().toLocaleLowerCase();
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
export interface ColorSwatchProps {
|
|
30
|
+
modelValue: tinycolor.Instance;
|
|
31
|
+
label?: string;
|
|
32
|
+
swatch?: string[];
|
|
33
|
+
defaultColor?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ColorSwatchEmits {
|
|
37
|
+
'update:modelValue': [value: string];
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="celeste-color-swatch">
|
|
43
|
+
<span class="swatch-label">
|
|
44
|
+
{{ label }}
|
|
45
|
+
</span>
|
|
46
|
+
<div class="color-palette">
|
|
47
|
+
<div
|
|
48
|
+
v-for="swatchColor in swatch"
|
|
49
|
+
:key="swatchColor"
|
|
50
|
+
class="palette-color"
|
|
51
|
+
:style="{ background: swatchColor }"
|
|
52
|
+
:aria-selected="isSwatchColorSelected(swatchColor.toLowerCase())"
|
|
53
|
+
:title="swatchColor"
|
|
54
|
+
:aria-label="`Color:${swatchColor}`"
|
|
55
|
+
role="option"
|
|
56
|
+
tabindex="0"
|
|
57
|
+
@click="handleSwatchColorClick(swatchColor)"
|
|
58
|
+
@keydown.space="handleSwatchColorClick(swatchColor)"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style scoped lang="scss">
|
|
65
|
+
.celeste-color-swatch {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: var(--spacing-8);
|
|
69
|
+
|
|
70
|
+
.swatch-label {
|
|
71
|
+
color: var(--color-text-sub-600);
|
|
72
|
+
font: var(--paragraph-xs);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.color-palette {
|
|
76
|
+
display: flex;
|
|
77
|
+
gap: var(--spacing-4);
|
|
78
|
+
align-items: center;
|
|
79
|
+
|
|
80
|
+
.palette-color {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: 16px;
|
|
83
|
+
height: 16px;
|
|
84
|
+
margin: var(--spacing-4);
|
|
85
|
+
padding: var(--spacing-4);
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
|
|
88
|
+
&[aria-selected='true'] {
|
|
89
|
+
box-shadow: v-bind('activeSwatchColorBg');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:hover {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2';
|
|
2
|
+
import { computed, type WritableComputedRef } from 'vue';
|
|
3
|
+
|
|
4
|
+
type TinyColorFormat = 'hex8' | 'hex' | 'rgb' | 'hsv' | 'hsl';
|
|
5
|
+
|
|
6
|
+
export interface useTinyColorModelProps {
|
|
7
|
+
modelValue?: tinycolor.ColorInput;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ColorPickerEmits = ['update:modelValue'];
|
|
11
|
+
|
|
12
|
+
export function defineColorModel(props: useTinyColorModelProps, emit: any): WritableComputedRef<tinycolor.Instance, tinycolor.ColorInput> {
|
|
13
|
+
let originalFormat: TinyColorFormat;
|
|
14
|
+
|
|
15
|
+
const tinyColorRef = computed({
|
|
16
|
+
get: () => {
|
|
17
|
+
const colorInput = props.modelValue;
|
|
18
|
+
const value = tinycolor(colorInput);
|
|
19
|
+
|
|
20
|
+
originalFormat = value.getFormat() as TinyColorFormat;
|
|
21
|
+
|
|
22
|
+
return value;
|
|
23
|
+
},
|
|
24
|
+
set: (newValue: tinycolor.ColorInput) => {
|
|
25
|
+
const newTinyColor = tinycolor(newValue);
|
|
26
|
+
const transformedValue = transformToOriginalInputFormat(
|
|
27
|
+
newTinyColor,
|
|
28
|
+
originalFormat,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
emit('update:modelValue', transformedValue);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return tinyColorRef;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function transformToOriginalInputFormat(color: tinycolor.Instance, originalFormat?: TinyColorFormat): any {
|
|
39
|
+
return color.toString(originalFormat);
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { onUnmounted, readonly, ref, type Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface UseUserPageSelectReturn {
|
|
4
|
+
isDisabled: Readonly<Ref<boolean, boolean>>;
|
|
5
|
+
togglePageUserSelect: () => void;
|
|
6
|
+
preventPageUserSelect: () => void;
|
|
7
|
+
allowPageUserSelect: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function useUserPageSelection(): UseUserPageSelectReturn {
|
|
11
|
+
const isDisabled = ref(false);
|
|
12
|
+
let styleElement: HTMLStyleElement | null = null;
|
|
13
|
+
|
|
14
|
+
const preventPageUserSelect = (): void => {
|
|
15
|
+
if (!styleElement) {
|
|
16
|
+
styleElement = document.createElement('style');
|
|
17
|
+
styleElement.textContent = 'body > * { user-select: none; }';
|
|
18
|
+
document.head.appendChild(styleElement);
|
|
19
|
+
isDisabled.value = true;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const allowPageUserSelect = (): void => {
|
|
24
|
+
if (styleElement) {
|
|
25
|
+
styleElement.remove();
|
|
26
|
+
styleElement = null;
|
|
27
|
+
isDisabled.value = false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const togglePageUserSelect = (): void => {
|
|
32
|
+
if (styleElement) {
|
|
33
|
+
allowPageUserSelect();
|
|
34
|
+
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
preventPageUserSelect();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
allowPageUserSelect();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
isDisabled: readonly(isDisabled),
|
|
47
|
+
togglePageUserSelect,
|
|
48
|
+
preventPageUserSelect,
|
|
49
|
+
allowPageUserSelect,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { getAbsolutePosition, getPageXYFromEvent, resolveArrowDirection } from '@/utils/color.ts';
|
|
3
|
+
import { computed, onUnmounted, ref, useTemplateRef, watch } from 'vue';
|
|
4
|
+
import { useUserPageSelection } from './composable/use-user-select.ts';
|
|
5
|
+
|
|
6
|
+
const hue = defineModel({
|
|
7
|
+
default: 0,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const pullDirection = ref<'right' | 'left'>();
|
|
11
|
+
|
|
12
|
+
const containerRef = useTemplateRef('slider-track');
|
|
13
|
+
|
|
14
|
+
const { preventPageUserSelect, allowPageUserSelect } = useUserPageSelection();
|
|
15
|
+
|
|
16
|
+
watch(hue, (newHue: number, oldHue: number) => {
|
|
17
|
+
if (newHue !== 0 && newHue - oldHue > 0)
|
|
18
|
+
pullDirection.value = 'right';
|
|
19
|
+
if (newHue !== 0 && newHue - oldHue < 0)
|
|
20
|
+
pullDirection.value = 'left';
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const pointerLeft = computed(() => {
|
|
24
|
+
if (hue.value === 0 && pullDirection.value === 'right')
|
|
25
|
+
return '100%';
|
|
26
|
+
|
|
27
|
+
return `${(hue.value * 100) / 360}%`;
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const trackThumbBg = computed(() => {
|
|
32
|
+
return `hsl(${hue.value}, 100%, 50%)`;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function handleChange(e: MouseEvent | TouchEvent, skip?: boolean) {
|
|
36
|
+
if (!skip) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const container = containerRef.value;
|
|
41
|
+
|
|
42
|
+
if (!container) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const containerWidth = container.clientWidth;
|
|
47
|
+
|
|
48
|
+
const { x: xOffset } = getAbsolutePosition(container);
|
|
49
|
+
const { x: pageX } = getPageXYFromEvent(e);
|
|
50
|
+
|
|
51
|
+
const left = pageX - xOffset;
|
|
52
|
+
|
|
53
|
+
let h;
|
|
54
|
+
let percent;
|
|
55
|
+
|
|
56
|
+
if (left < 0) {
|
|
57
|
+
h = 0;
|
|
58
|
+
}
|
|
59
|
+
else if (left > containerWidth) {
|
|
60
|
+
h = 360;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
percent = left * 100 / containerWidth;
|
|
64
|
+
h = Math.round(360 * percent / 100);
|
|
65
|
+
}
|
|
66
|
+
if (hue.value !== h) {
|
|
67
|
+
emitChange(h);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function emitChange(h: number) {
|
|
72
|
+
hue.value = h;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function handleMouseDown(e: MouseEvent) {
|
|
76
|
+
handleChange(e, true);
|
|
77
|
+
preventPageUserSelect();
|
|
78
|
+
|
|
79
|
+
window.addEventListener('mousemove', handleChange);
|
|
80
|
+
window.addEventListener('mouseup', handleMouseUp);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handleMouseUp() {
|
|
84
|
+
allowPageUserSelect();
|
|
85
|
+
unbindEventListeners();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function unbindEventListeners() {
|
|
89
|
+
window.removeEventListener('mousemove', handleChange);
|
|
90
|
+
window.removeEventListener('mouseup', handleMouseUp);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function handleKeyDown(e: KeyboardEvent) {
|
|
94
|
+
const direction = resolveArrowDirection(e);
|
|
95
|
+
|
|
96
|
+
if (!direction) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
|
|
102
|
+
const currentValue = hue.value;
|
|
103
|
+
let newValue;
|
|
104
|
+
|
|
105
|
+
switch (direction) {
|
|
106
|
+
case 'left': {
|
|
107
|
+
newValue = currentValue - 1 < 0 ? 0 : Math.floor(currentValue - 1);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
case 'right': {
|
|
111
|
+
newValue = currentValue + 1 > 360 ? 360 : Math.ceil(currentValue + 1);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (typeof newValue !== 'undefined') {
|
|
116
|
+
emitChange(newValue);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
onUnmounted(() => {
|
|
121
|
+
unbindEventListeners();
|
|
122
|
+
});
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<template>
|
|
126
|
+
<div class="celeste-color-slider">
|
|
127
|
+
<div
|
|
128
|
+
ref="slider-track"
|
|
129
|
+
class="slider-track"
|
|
130
|
+
role="slider"
|
|
131
|
+
:aria-valuenow="hue"
|
|
132
|
+
aria-valuemin="0"
|
|
133
|
+
aria-valuemax="360"
|
|
134
|
+
aria-label="Hue"
|
|
135
|
+
tabindex="0"
|
|
136
|
+
@mousedown="handleMouseDown"
|
|
137
|
+
@touchmove.passive="handleChange"
|
|
138
|
+
@touchstart.passive="handleChange"
|
|
139
|
+
@keydown="handleKeyDown"
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
class="celeste-color-thumb"
|
|
143
|
+
:style="{ left: pointerLeft, background: trackThumbBg }"
|
|
144
|
+
role="presentation"
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<style scoped lang="scss">
|
|
151
|
+
.celeste-color-slider {
|
|
152
|
+
.slider-track {
|
|
153
|
+
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './alpha-slider.vue';
|
|
2
|
+
export { default as AlphaSlider } from './alpha-slider.vue';
|
|
3
|
+
|
|
4
|
+
export * from './color-area.vue';
|
|
5
|
+
export { default as ColorArea } from './color-area.vue';
|
|
6
|
+
|
|
7
|
+
export * from './color-picker.vue';
|
|
8
|
+
export { default as ColorPicker } from './color-picker.vue';
|
|
9
|
+
|
|
10
|
+
export * from './color-swatch.vue';
|
|
11
|
+
export { default as ColorSwatch } from './color-swatch.vue';
|
|
12
|
+
|
|
13
|
+
export * from './hue-slider.vue';
|
|
14
|
+
export { default as HueSlider } from './hue-slider.vue';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import ColorPicker from '../color-picker.vue';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ColorPicker> = {
|
|
6
|
+
title: 'Components/Color Picker',
|
|
7
|
+
component: ColorPicker,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof ColorPicker>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
},
|
|
22
|
+
render: (args: Story['args']) => ({
|
|
23
|
+
components: { ColorPicker },
|
|
24
|
+
setup() {
|
|
25
|
+
const color = ref('hsl(228, 100%, 60%)');
|
|
26
|
+
return { args, color };
|
|
27
|
+
},
|
|
28
|
+
template: `
|
|
29
|
+
<ColorPicker v-bind="args" v-model="color"/>
|
|
30
|
+
`,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const WithRGBDefault: Story = {
|
|
35
|
+
args: {},
|
|
36
|
+
render: (args: Story['args']) => ({
|
|
37
|
+
components: { ColorPicker },
|
|
38
|
+
setup() {
|
|
39
|
+
const color = ref('rgb(255, 100, 50)');
|
|
40
|
+
return { args, color };
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
44
|
+
`,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const WithHSLDefault: Story = {
|
|
49
|
+
args: {},
|
|
50
|
+
render: (args: Story['args']) => ({
|
|
51
|
+
components: { ColorPicker },
|
|
52
|
+
setup() {
|
|
53
|
+
const color = ref('hsl(320, 70%, 60%)');
|
|
54
|
+
return { args, color };
|
|
55
|
+
},
|
|
56
|
+
template: `
|
|
57
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
58
|
+
`,
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const HexOnly: Story = {
|
|
63
|
+
args: {},
|
|
64
|
+
render: (args: Story['args']) => ({
|
|
65
|
+
components: { ColorPicker },
|
|
66
|
+
setup() {
|
|
67
|
+
const color = ref('#FF6B35');
|
|
68
|
+
return { args, color };
|
|
69
|
+
},
|
|
70
|
+
template: `
|
|
71
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
72
|
+
`,
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const RGBAndHSL: Story = {
|
|
77
|
+
args: {},
|
|
78
|
+
render: (args: Story['args']) => ({
|
|
79
|
+
components: { ColorPicker },
|
|
80
|
+
setup() {
|
|
81
|
+
const color = ref('rgb(100, 200, 150)');
|
|
82
|
+
return { args, color };
|
|
83
|
+
},
|
|
84
|
+
template: `
|
|
85
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const WithTransparentColor: Story = {
|
|
91
|
+
args: {},
|
|
92
|
+
render: (args: Story['args']) => ({
|
|
93
|
+
components: { ColorPicker },
|
|
94
|
+
setup() {
|
|
95
|
+
const color = ref('rgba(255, 100, 50, 0.5)');
|
|
96
|
+
return { args, color };
|
|
97
|
+
},
|
|
98
|
+
template: `
|
|
99
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
100
|
+
`,
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const CustomLabel: Story = {
|
|
105
|
+
args: {},
|
|
106
|
+
render: (args: Story['args']) => ({
|
|
107
|
+
components: { ColorPicker },
|
|
108
|
+
setup() {
|
|
109
|
+
const color = ref('#007bff');
|
|
110
|
+
return { args, color };
|
|
111
|
+
},
|
|
112
|
+
template: `
|
|
113
|
+
<ColorPicker v-model="color" v-bind="args" />
|
|
114
|
+
`,
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ComboboxGroupProps } from 'radix-vue';
|
|
3
|
+
import { ComboboxGroup, ComboboxLabel } from 'radix-vue';
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<ComboboxGroupProps & {
|
|
7
|
+
class?: HTMLAttributes['class'];
|
|
8
|
+
heading?: string;
|
|
9
|
+
}>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = computed(() => {
|
|
12
|
+
const { class: _, ...delegated } = props;
|
|
13
|
+
|
|
14
|
+
return delegated;
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<ComboboxGroup
|
|
20
|
+
v-bind="delegatedProps"
|
|
21
|
+
class="celeste-command-group"
|
|
22
|
+
:class="props.class"
|
|
23
|
+
>
|
|
24
|
+
<ComboboxLabel v-if="heading" class="celeste-command-label">
|
|
25
|
+
{{ heading }}
|
|
26
|
+
</ComboboxLabel>
|
|
27
|
+
<slot />
|
|
28
|
+
</ComboboxGroup>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.celeste-command-group {
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.celeste-command-label {
|
|
37
|
+
padding: var(--spacing-4) var(--spacing-8);
|
|
38
|
+
color: var(--color-text-soft-400);
|
|
39
|
+
font: var(--subheading-xs);
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { ComboboxInput, type ComboboxInputProps, useForwardProps } from 'radix-vue';
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue';
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const props = defineProps<ComboboxInputProps & {
|
|
11
|
+
class?: HTMLAttributes['class'];
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props;
|
|
16
|
+
|
|
17
|
+
return delegated;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="celeste-command-input" cmdk-input-wrapper>
|
|
25
|
+
<i i-celeste-search-line class="celeste-command-input-icon" />
|
|
26
|
+
<ComboboxInput
|
|
27
|
+
v-bind="{ ...forwardedProps, ...$attrs }"
|
|
28
|
+
auto-focus
|
|
29
|
+
:class="clsx('celeste-command-input-primitive', props.class)"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
.celeste-command-input {
|
|
36
|
+
--icon-color: var(--color-icon-soft-400);
|
|
37
|
+
--placeholder-color: var(--color-text-soft-400);
|
|
38
|
+
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
padding: var(--spacing-8);
|
|
42
|
+
transition:
|
|
43
|
+
color,
|
|
44
|
+
background-color var(--animation-normal) ease;
|
|
45
|
+
font: var(--paragraph-sm);
|
|
46
|
+
gap: var(--spacing-8);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.celeste-command-input:hover {
|
|
50
|
+
--icon-color: var(--color-icon-sub-600);
|
|
51
|
+
--placeholder-color: var(--color-text-sub-600);
|
|
52
|
+
|
|
53
|
+
background: var(--color-bg-weak-50);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.celeste-command-input-primitive {
|
|
57
|
+
width: 100%;
|
|
58
|
+
transition: color var(--animation-normal) ease;
|
|
59
|
+
border: none;
|
|
60
|
+
outline: none;
|
|
61
|
+
background: transparent;
|
|
62
|
+
font: inherit;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.celeste-command-input-icon {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
width: 18px;
|
|
68
|
+
height: 18px;
|
|
69
|
+
transition: color var(--animation-normal) ease;
|
|
70
|
+
color: var(--icon-color);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.celeste-command-input-primitive::placeholder {
|
|
74
|
+
transition: color var(--animation-normal) ease;
|
|
75
|
+
color: var(--placeholder-color);
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue';
|
|
3
|
+
import { ComboboxItem, useForwardPropsEmits } from 'radix-vue';
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<ComboboxItemProps & { class?: HTMLAttributes['class'] }>();
|
|
7
|
+
const emits = defineEmits<ComboboxItemEmits>();
|
|
8
|
+
|
|
9
|
+
const delegatedProps = computed(() => {
|
|
10
|
+
const { class: _, ...delegated } = props;
|
|
11
|
+
|
|
12
|
+
return delegated;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<ComboboxItem
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
class="celeste-command-item"
|
|
22
|
+
:class="props.class"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</ComboboxItem>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.celeste-command-item {
|
|
30
|
+
padding: var(--spacing-8);
|
|
31
|
+
border-radius: var(--radius-8);
|
|
32
|
+
background: var(--color-bg-white-0);
|
|
33
|
+
color: var(--color-text-strong-950);
|
|
34
|
+
font: var(--paragraph-sm);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.celeste-command-item[data-highlighted] {
|
|
38
|
+
background: var(--color-bg-weak-50);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.celeste-command-item[data-disabled] {
|
|
42
|
+
color: var(--color-icon-disabled-300);
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue';
|
|
3
|
+
import { ComboboxContent, useForwardPropsEmits } from 'radix-vue';
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<ComboboxContentProps & { class?: HTMLAttributes['class'] }>(), {
|
|
7
|
+
dismissable: false,
|
|
8
|
+
});
|
|
9
|
+
const emits = defineEmits<ComboboxContentEmits>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = computed(() => {
|
|
12
|
+
const { class: _, ...delegated } = props;
|
|
13
|
+
|
|
14
|
+
return delegated;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<ComboboxContent
|
|
22
|
+
v-bind="forwarded"
|
|
23
|
+
class="celeste-command-list"
|
|
24
|
+
:class="props.class"
|
|
25
|
+
>
|
|
26
|
+
<div role="presentation">
|
|
27
|
+
<slot />
|
|
28
|
+
</div>
|
|
29
|
+
</ComboboxContent>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
.celeste-command-list {
|
|
34
|
+
max-height: 300px;
|
|
35
|
+
overflow: hidden auto;
|
|
36
|
+
}
|
|
37
|
+
</style>
|