@youcan/celeste 0.6.29 → 0.6.31

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