@pantograph/vue 0.10.0 → 0.10.2

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 (229) hide show
  1. package/dist/ActionButton/ActionButton.d.ts +79 -3
  2. package/dist/ActionButton/index.js.js +1 -1
  3. package/dist/ActionButton/index.umd.cjs.js +1 -1
  4. package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-ClxZJxTh.js → ActionButton.vue_vue_type_script_setup_true_lang-B8F78aq-.js} +2 -3
  5. package/dist/ActionButton.vue_vue_type_script_setup_true_lang-DYj83ijm.js +1 -0
  6. package/dist/Avatar/Avatar.d.ts +14 -7
  7. package/dist/Avatar/index.js.js +1 -1
  8. package/dist/Avatar/index.umd.cjs.js +1 -1
  9. package/dist/Avatar.vue_vue_type_style_index_0_lang-BwkELI0y.js +1 -0
  10. package/dist/Avatar.vue_vue_type_style_index_0_lang-DheqjJPa.js +182 -0
  11. package/dist/AvatarGroup/AvatarGroup.d.ts +2 -5
  12. package/dist/AvatarGroup/index.js.js +1 -1
  13. package/dist/AvatarGroup/index.umd.cjs.js +1 -1
  14. package/dist/Badge/Badge.d.ts +9 -2
  15. package/dist/Badge/index.js.js +1 -1
  16. package/dist/Badge/index.umd.cjs.js +1 -1
  17. package/dist/{Badge.vue_vue_type_script_setup_true_lang-CfA3dSJr.js → Badge.vue_vue_type_script_setup_true_lang-CCIamdNB.js} +2 -3
  18. package/dist/Badge.vue_vue_type_script_setup_true_lang-ooDlpl8j.js +1 -0
  19. package/dist/Base/BaseBadge/BaseBadge.d.ts +12 -7
  20. package/dist/Base/BaseButton/BaseButton.d.ts +14 -7
  21. package/dist/BaseBadge.vue_vue_type_style_index_0_lang-BNs69VP4.js +1 -0
  22. package/dist/{BaseBadge.vue_vue_type_style_index_0_lang-MM6bsdzR.js → BaseBadge.vue_vue_type_style_index_0_lang-Bh1152XC.js} +46 -52
  23. package/dist/BaseButton.vue_vue_type_style_index_0_lang-CgEN8K4D.js +1 -0
  24. package/dist/BaseButton.vue_vue_type_style_index_0_lang-D7irHU-6.js +153 -0
  25. package/dist/Button/Button.d.ts +79 -3
  26. package/dist/Button/index.js.js +1 -1
  27. package/dist/Button/index.umd.cjs.js +1 -1
  28. package/dist/Button.vue_vue_type_script_setup_true_lang-BA3bxjLD.js +1 -0
  29. package/dist/{Button.vue_vue_type_script_setup_true_lang-B8DWC8Du.js → Button.vue_vue_type_script_setup_true_lang-NKY7YYCC.js} +6 -7
  30. package/dist/ButtonGroup/ButtonGroup.d.ts +3 -5
  31. package/dist/ButtonGroup/index.js.js +1 -1
  32. package/dist/ButtonGroup/index.umd.cjs.js +1 -1
  33. package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-CT_Kgpjf.js +47 -0
  34. package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-D486_o-Z.js +1 -0
  35. package/dist/Checkbox/Checkbox.d.ts +12 -4
  36. package/dist/Checkbox/index.js.js +1 -1
  37. package/dist/Checkbox/index.umd.cjs.js +1 -1
  38. package/dist/Checkbox.vue_vue_type_style_index_0_lang-CSmeTeZh.js +209 -0
  39. package/dist/Checkbox.vue_vue_type_style_index_0_lang-D0sF0-hW.js +1 -0
  40. package/dist/CheckboxGroup/CheckboxGroup.d.ts +2 -5
  41. package/dist/CheckboxGroup/index.js.js +1 -1
  42. package/dist/CheckboxGroup/index.umd.cjs.js +1 -1
  43. package/dist/ColorPicker/index.js.js +1 -1
  44. package/dist/ColorPicker/index.umd.cjs.js +1 -1
  45. package/dist/ColorPicker.vue_vue_type_style_index_0_lang-B1Rst4Q9.js +1 -0
  46. package/dist/ColorPicker.vue_vue_type_style_index_0_lang-CEz3bIJG.js +541 -0
  47. package/dist/ColorSwatch/ColorSwatch.d.ts +11 -4
  48. package/dist/ColorSwatch/index.js.js +1 -1
  49. package/dist/ColorSwatch/index.umd.cjs.js +1 -1
  50. package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-BH-NSALx.js +1 -0
  51. package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-CL9dd69H.js +100 -0
  52. package/dist/ColorSwatchGroup/ColorSwatchGroup.d.ts +17 -11
  53. package/dist/ColorSwatchGroup/index.js.js +3 -163
  54. package/dist/ColorSwatchGroup/index.umd.cjs.js +1 -1
  55. package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-CpgTgIuE.js +1 -0
  56. package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-Cwh2REmh.js +159 -0
  57. package/dist/ColorTrigger/ColorTrigger.d.ts +13 -5
  58. package/dist/ColorTrigger/index.js.js +4 -90
  59. package/dist/ColorTrigger/index.umd.cjs.js +1 -1
  60. package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-BNFu93Ns.js +86 -0
  61. package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-C8kPa338.js +1 -0
  62. package/dist/ConfigProvider/index.d.ts +6 -6
  63. package/dist/ConfigProvider/utils.d.ts +2 -2
  64. package/dist/Divider/Divider.d.ts +13 -8
  65. package/dist/Divider/index.js.js +1 -1
  66. package/dist/Divider/index.umd.cjs.js +1 -1
  67. package/dist/Divider.vue_vue_type_style_index_0_lang-BELWThBf.js +1 -0
  68. package/dist/Divider.vue_vue_type_style_index_0_lang-CRs1KEcj.js +34 -0
  69. package/dist/FloatButton/FloatButton.d.ts +79 -3
  70. package/dist/FloatButton/index.js.js +1 -1
  71. package/dist/FloatButton/index.umd.cjs.js +1 -1
  72. package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-iElZdgSE.js → FloatButton.vue_vue_type_script_setup_true_lang-BAxKXFb0.js} +2 -3
  73. package/dist/FloatButton.vue_vue_type_script_setup_true_lang-C5hAAZZQ.js +1 -0
  74. package/dist/GraphicalObject/GraphicalObject.d.ts +9 -2
  75. package/dist/GraphicalObject/index.js.js +1 -1
  76. package/dist/GraphicalObject/index.umd.cjs.js +1 -1
  77. package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-Cc4PxUnd.js → GraphicalObject.vue_vue_type_script_setup_true_lang-BEZ6FkRf.js} +2 -3
  78. package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-CdO2zArd.js +1 -0
  79. package/dist/Icon/Icon.d.ts +11 -4
  80. package/dist/IconButton/IconButton.d.ts +79 -3
  81. package/dist/IconButton/index.js.js +1 -1
  82. package/dist/IconButton/index.umd.cjs.js +1 -1
  83. package/dist/{IconButton.vue_vue_type_script_setup_true_lang-D1nK8pEU.js → IconButton.vue_vue_type_script_setup_true_lang-CchpvdkX.js} +2 -3
  84. package/dist/IconButton.vue_vue_type_script_setup_true_lang-c16Xu6mm.js +1 -0
  85. package/dist/Image/Image.d.ts +16 -8
  86. package/dist/Image/index.js.js +1 -1
  87. package/dist/Image/index.umd.cjs.js +1 -1
  88. package/dist/{Image.vue_vue_type_style_index_0_lang-DbqKKOAs.js → Image.vue_vue_type_style_index_0_lang-Hg1jFz-L.js} +1 -1
  89. package/dist/{Image.vue_vue_type_style_index_0_lang-Cku5hiNE.js → Image.vue_vue_type_style_index_0_lang-pkzjPQyu.js} +2 -2
  90. package/dist/IndentLevel/IndentLevel.d.ts +14 -8
  91. package/dist/IndentLevel/index.js.js +1 -1
  92. package/dist/IndentLevel/index.umd.cjs.js +1 -1
  93. package/dist/IndentLevel.vue_vue_type_style_index_0_lang-DqqJTrDF.js +1 -0
  94. package/dist/IndentLevel.vue_vue_type_style_index_0_lang-ZZ1uEhji.js +94 -0
  95. package/dist/Indicator/Indicator.d.ts +9 -2
  96. package/dist/Indicator/index.js.js +1 -1
  97. package/dist/Indicator/index.umd.cjs.js +1 -1
  98. package/dist/{Indicator.vue_vue_type_script_setup_true_lang-DURlzRTQ.js → Indicator.vue_vue_type_script_setup_true_lang-B16OmZLF.js} +2 -3
  99. package/dist/Indicator.vue_vue_type_script_setup_true_lang-BibzfVax.js +1 -0
  100. package/dist/Input/Input.d.ts +15 -7
  101. package/dist/Input/index.d.ts +2 -0
  102. package/dist/Input/index.js.js +7 -0
  103. package/dist/Input/index.umd.cjs.js +1 -0
  104. package/dist/Input.vue_vue_type_style_index_0_lang-CcR6oCIR.js +407 -0
  105. package/dist/Input.vue_vue_type_style_index_0_lang-DVN491cI.js +1 -0
  106. package/dist/Kbd/Kbd.d.ts +13 -9
  107. package/dist/Kbd/index.js.js +1 -1
  108. package/dist/Kbd/index.umd.cjs.js +1 -1
  109. package/dist/Kbd.vue_vue_type_style_index_0_lang-CpDjSQqg.js +1 -0
  110. package/dist/Kbd.vue_vue_type_style_index_0_lang-D1y-0kBN.js +47 -0
  111. package/dist/Menu/Menu.d.ts +9 -10
  112. package/dist/Menu/index.js.js +1 -1
  113. package/dist/Menu/index.umd.cjs.js +1 -1
  114. package/dist/Menu.vue_vue_type_style_index_0_lang-B64mJSxF.js +481 -0
  115. package/dist/Menu.vue_vue_type_style_index_0_lang-Sq_kFrSI.js +1 -0
  116. package/dist/MenuItem/MenuItem.d.ts +2 -2
  117. package/dist/MenuItem/index.js.js +1 -1
  118. package/dist/MenuItem/index.umd.cjs.js +1 -1
  119. package/dist/Popover/Popover.d.ts +82 -5
  120. package/dist/Popover/index.js.js +1 -1
  121. package/dist/Popover/index.umd.cjs.js +1 -1
  122. package/dist/{Popover.vue_vue_type_style_index_0_lang-DkM_Ynrg.js → Popover.vue_vue_type_style_index_0_lang-C0IwnsU5.js} +2 -2
  123. package/dist/{Popover.vue_vue_type_style_index_0_lang-pSXmj4z1.js → Popover.vue_vue_type_style_index_0_lang-CM8qMFEi.js} +1 -1
  124. package/dist/RadioGroup/RadioGroup.d.ts +12 -5
  125. package/dist/RadioGroup/RadioGroupItem.d.ts +11 -3
  126. package/dist/RadioGroup/index.d.ts +1 -1
  127. package/dist/RadioGroup/index.js.js +3 -2
  128. package/dist/RadioGroup/index.umd.cjs.js +1 -1
  129. package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-C8nd4TEI.js +100 -0
  130. package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-DjEHmvMo.js +1 -0
  131. package/dist/Shortcut/Shortcut.d.ts +1 -2
  132. package/dist/Shortcut/index.js.js +1 -1
  133. package/dist/Shortcut/index.umd.cjs.js +1 -1
  134. package/dist/Shortcut.vue_vue_type_style_index_0_lang-D4xo_UgO.js +32 -0
  135. package/dist/Shortcut.vue_vue_type_style_index_0_lang-D8_aLpYM.js +1 -0
  136. package/dist/Skeleton/Skeleton.d.ts +3 -7
  137. package/dist/Skeleton/index.js.js +1 -1
  138. package/dist/Skeleton/index.umd.cjs.js +1 -1
  139. package/dist/Skeleton.vue_vue_type_style_index_0_lang-C1I-p4Yn.js +1 -0
  140. package/dist/Skeleton.vue_vue_type_style_index_0_lang-IQEtEnZx.js +58 -0
  141. package/dist/Spinner/Spinner.d.ts +11 -6
  142. package/dist/Spinner/index.js.js +1 -1
  143. package/dist/Spinner/index.umd.cjs.js +1 -1
  144. package/dist/Spinner.vue_vue_type_style_index_0_lang-BP7P5xu8.js +1 -0
  145. package/dist/Spinner.vue_vue_type_style_index_0_lang-BYqqSQAx.js +73 -0
  146. package/dist/Switch/Switch.d.ts +14 -3
  147. package/dist/Switch/index.js.js +1 -1
  148. package/dist/Switch/index.umd.cjs.js +1 -1
  149. package/dist/Switch.vue_vue_type_style_index_0_lang-CoXu3YJ-.js +1 -0
  150. package/dist/Switch.vue_vue_type_style_index_0_lang-CvWay8Wa.js +106 -0
  151. package/dist/Tree/Tree.d.ts +12 -3
  152. package/dist/Tree/TreeNode.d.ts +11 -2
  153. package/dist/Tree/index.js.js +1 -1
  154. package/dist/Tree/index.umd.cjs.js +1 -1
  155. package/dist/Tree.vue_vue_type_style_index_0_lang-BCYjSwUH.js +545 -0
  156. package/dist/Tree.vue_vue_type_style_index_0_lang-CvskECfv.js +1 -0
  157. package/dist/_flatRest-CHX8vV1P.js +556 -0
  158. package/dist/_flatRest-R59G2N4m.js +1 -0
  159. package/dist/{cloneDeep-7ho7cOLj.js → cloneDeep-BMA7VTX1.js} +1 -1
  160. package/dist/cloneDeep-BcKVMzWC.js +1 -0
  161. package/dist/get-B4UJlXpC.js +1 -0
  162. package/dist/{get-CdoyK4GU.js → get-Q8GXlj-L.js} +1 -1
  163. package/dist/index.d.ts +5 -0
  164. package/dist/index.js.js +123 -102
  165. package/dist/index.umd.cjs.js +1 -1
  166. package/dist/omit-BEkBWXra.js +212 -0
  167. package/dist/omit-BKPbELUG.js +1 -0
  168. package/dist/pick-C-ap2Lj0.js +1 -0
  169. package/dist/{pick-BHVX8oMF.js → pick-DLskPTKb.js} +1 -1
  170. package/dist/style/index.css +1 -1
  171. package/dist/useId-DvOSMFGX.js +9 -0
  172. package/dist/useId-Ku3O_8TK.js +1 -0
  173. package/dist/useInputDataStates-CZbdWpyp.js +26 -0
  174. package/dist/useInputDataStates-CbRgNQqU.js +1 -0
  175. package/dist/utils/index.d.ts +2 -0
  176. package/dist/utils/index.js.js +10 -6
  177. package/dist/utils/index.umd.cjs.js +1 -1
  178. package/dist/utils/useId.d.ts +1 -0
  179. package/dist/utils/useInputDataStates.d.ts +19 -0
  180. package/package.json +10 -3
  181. package/dist/ActionButton.vue_vue_type_script_setup_true_lang-Db3ryil1.js +0 -1
  182. package/dist/Avatar.vue_vue_type_style_index_0_lang-B538jct0.js +0 -188
  183. package/dist/Avatar.vue_vue_type_style_index_0_lang-BSi0qbuq.js +0 -1
  184. package/dist/Badge.vue_vue_type_script_setup_true_lang-CKxCSXXL.js +0 -1
  185. package/dist/Base/Primitive.d.ts +0 -39
  186. package/dist/Base/Slot.d.ts +0 -6
  187. package/dist/BaseBadge.vue_vue_type_style_index_0_lang-OEeJw0Sy.js +0 -1
  188. package/dist/BaseButton.vue_vue_type_style_index_0_lang-gzePKYHN.js +0 -1
  189. package/dist/BaseButton.vue_vue_type_style_index_0_lang-s4G57j5o.js +0 -159
  190. package/dist/Button.vue_vue_type_script_setup_true_lang-BVCP3jP3.js +0 -1
  191. package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-BSj1Y1j2.js +0 -1
  192. package/dist/ButtonGroup.vue_vue_type_script_setup_true_lang-CdSgBboA.js +0 -52
  193. package/dist/Checkbox.vue_vue_type_style_index_0_lang-Bm6sm_wm.js +0 -1
  194. package/dist/Checkbox.vue_vue_type_style_index_0_lang-maH6mbC5.js +0 -216
  195. package/dist/ColorPicker.vue_vue_type_style_index_0_lang-CROQzfNe.js +0 -944
  196. package/dist/ColorPicker.vue_vue_type_style_index_0_lang-IZSWne-0.js +0 -1
  197. package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-Bf0glWPU.js +0 -102
  198. package/dist/ColorSwatch.vue_vue_type_style_index_0_lang-Dki5150Z.js +0 -1
  199. package/dist/Divider.vue_vue_type_style_index_0_lang-B_4XMyuu.js +0 -40
  200. package/dist/Divider.vue_vue_type_style_index_0_lang-C6Suy0tD.js +0 -1
  201. package/dist/FloatButton.vue_vue_type_script_setup_true_lang-DARsq4US.js +0 -1
  202. package/dist/GraphicalObject.vue_vue_type_script_setup_true_lang-Bouixpu2.js +0 -1
  203. package/dist/IconButton.vue_vue_type_script_setup_true_lang-CufKPHFD.js +0 -1
  204. package/dist/IndentLevel.vue_vue_type_style_index_0_lang-C9mNx1Zx.js +0 -1
  205. package/dist/IndentLevel.vue_vue_type_style_index_0_lang-CKJpRLV6.js +0 -104
  206. package/dist/Indicator.vue_vue_type_script_setup_true_lang-DpPAMjWw.js +0 -1
  207. package/dist/Kbd.vue_vue_type_style_index_0_lang-BqEaW_kJ.js +0 -1
  208. package/dist/Kbd.vue_vue_type_style_index_0_lang-DbtLbpq-.js +0 -60
  209. package/dist/Menu.vue_vue_type_style_index_0_lang-Danl_w4K.js +0 -480
  210. package/dist/Menu.vue_vue_type_style_index_0_lang-eKNVzfnz.js +0 -1
  211. package/dist/Primitive-BT1RjuGS.js +0 -1
  212. package/dist/Primitive-nOVjbfuc.js +0 -47
  213. package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-8BgnVYlc.js +0 -1
  214. package/dist/RadioGroup.vue_vue_type_script_setup_true_lang-NNLg5ogX.js +0 -100
  215. package/dist/Shortcut.vue_vue_type_style_index_0_lang-BQb7DjFe.js +0 -41
  216. package/dist/Shortcut.vue_vue_type_style_index_0_lang-C49ZdQFd.js +0 -1
  217. package/dist/Skeleton.vue_vue_type_style_index_0_lang-B6bCkLlD.js +0 -66
  218. package/dist/Skeleton.vue_vue_type_style_index_0_lang-PNNUgKOq.js +0 -1
  219. package/dist/Spinner.vue_vue_type_style_index_0_lang-CxNO28J7.js +0 -1
  220. package/dist/Spinner.vue_vue_type_style_index_0_lang-D6nB06Z8.js +0 -85
  221. package/dist/Switch.vue_vue_type_style_index_0_lang-B9_IPFyg.js +0 -1
  222. package/dist/Switch.vue_vue_type_style_index_0_lang-_FIrRkI7.js +0 -103
  223. package/dist/Tree.vue_vue_type_style_index_0_lang-B3ZzwkLN.js +0 -1
  224. package/dist/Tree.vue_vue_type_style_index_0_lang-D9GBs86I.js +0 -547
  225. package/dist/cloneDeep-C6tiVz1k.js +0 -1
  226. package/dist/get-BULsy4gy.js +0 -1
  227. package/dist/omit-BHZMfUBv.js +0 -757
  228. package/dist/omit-DlH5U9Jc.js +0 -1
  229. package/dist/pick-DpwC5mlg.js +0 -1
@@ -0,0 +1,541 @@
1
+ import { onUnmounted as we, defineComponent as ue, onMounted as ae, onBeforeUnmount as ye, createElementBlock as D, openBlock as C, normalizeClass as T, unref as v, createElementVNode as E, ref as j, computed as R, watch as xe, reactive as Ce, createVNode as Q, createCommentVNode as Z, createBlock as Y, Fragment as Te, renderList as Ve } from "vue";
2
+ import { _ as ke } from "./ActionButton.vue_vue_type_script_setup_true_lang-B8F78aq-.js";
3
+ import { _ as ee } from "./Input.vue_vue_type_style_index_0_lang-CcR6oCIR.js";
4
+ import { _ as Ee } from "./Icon.vue_vue_type_style_index_0_lang-BfPcw6PU.js";
5
+ import { useVModel as te } from "@vueuse/core";
6
+ import { b as P, g as Me, c as ne } from "./class-DziTeW9B.js";
7
+ import { createContext as _e } from "radix-vue";
8
+ function S(e, t, o) {
9
+ return Math.max(t, Math.min(e, o));
10
+ }
11
+ function Ae(e, t) {
12
+ if (typeof e == "string" || typeof t == "string")
13
+ return e === t;
14
+ if (e) {
15
+ if (!t) return !1;
16
+ for (const o in e)
17
+ if (e[o] !== t[o])
18
+ return !1;
19
+ }
20
+ return !0;
21
+ }
22
+ function F(e) {
23
+ const t = [], o = e.length > 5 ? 2 : 1;
24
+ for (let n = 1; n < e.length; n += o) {
25
+ const u = e.substring(n, n + o).repeat(o % 2 + 1), a = parseInt(u, 16);
26
+ t.push(n === 3 * o + 1 ? a / 255 : a);
27
+ }
28
+ return t.length === 3 && t.push(1), {
29
+ r: t[0],
30
+ g: t[1],
31
+ b: t[2],
32
+ a: t[3]
33
+ };
34
+ }
35
+ function ie(e) {
36
+ const t = e.l / 100, o = t + e.s / 100 * Math.min(t, 1 - t), n = o === 0 ? 0 : 200 * (1 - t / o);
37
+ return {
38
+ h: e.h,
39
+ s: n,
40
+ v: o * 100,
41
+ a: e.a
42
+ };
43
+ }
44
+ function O(e) {
45
+ let t = e.h % 360;
46
+ t < 0 && (t += 360);
47
+ const o = e.s / 100, n = e.l / 100;
48
+ return {
49
+ r: K(0, t, o, n) * 255,
50
+ g: K(8, t, o, n) * 255,
51
+ b: K(4, t, o, n) * 255,
52
+ a: e.a
53
+ };
54
+ }
55
+ function K(e, t, o, n) {
56
+ const u = (e + t / 30) % 12, a = o * Math.min(n, 1 - n);
57
+ return n - a * Math.max(-1, Math.min(u - 3, 9 - u, 1));
58
+ }
59
+ function ce(e) {
60
+ const t = e.s / 100, o = e.v / 100, n = o * (1 - t / 2);
61
+ return {
62
+ h: e.h,
63
+ s: n === 0 || n === 1 ? 0 : (o - n) / Math.min(n, 1 - n) * 100,
64
+ l: n * 100,
65
+ a: e.a
66
+ };
67
+ }
68
+ function fe(e) {
69
+ return {
70
+ h: e.h,
71
+ w: e.v * (100 - e.s) / 100,
72
+ b: 100 - e.v,
73
+ a: e.a
74
+ };
75
+ }
76
+ function N(e) {
77
+ return O(ce(e));
78
+ }
79
+ function k(e) {
80
+ const t = e.w / 100, o = e.b / 100;
81
+ let n, u;
82
+ const a = t + o;
83
+ return a >= 1 ? (n = 0, u = t / a) : (u = 1 - o, n = (1 - t / u) * 100), {
84
+ h: e.h,
85
+ s: n,
86
+ v: u * 100,
87
+ a: e.a
88
+ };
89
+ }
90
+ function W(e) {
91
+ const { r: t, g: o, b: n, a: u } = e, a = Math.min(t, o, n), m = Math.max(t, o, n), f = m - a, h = (m + a) / 2;
92
+ let p = 0;
93
+ f !== 0 && (m === t ? p = (o - n) / f + (o < n ? 6 : 0) : m === o ? p = (n - t) / f + 2 : m === n && (p = (t - o) / f + 4), p *= 60);
94
+ let b = 0;
95
+ return h !== 0 && h !== 255 && (b = (m - h) / Math.min(h, 255 - h)), {
96
+ h: p,
97
+ s: b * 100,
98
+ l: h / 255 * 100,
99
+ a: u
100
+ };
101
+ }
102
+ function $(e) {
103
+ return "#" + Object.values(e).map(
104
+ (t, o) => Math.round(o === 3 ? t * 255 : t).toString(16).padStart(2, "0")
105
+ ).join("");
106
+ }
107
+ function H(e) {
108
+ return fe(ie(W(e)));
109
+ }
110
+ const Ne = {
111
+ hex: {
112
+ hex: (e) => e,
113
+ hsl: (e) => W(F(e)),
114
+ hsv: (e) => k(H(F(e))),
115
+ hwb: (e) => H(F(e)),
116
+ rgb: F
117
+ },
118
+ hsl: {
119
+ hex: (e) => $(O(e)),
120
+ hsl: (e) => e,
121
+ hsv: ie,
122
+ hwb: (e) => H(O(e)),
123
+ rgb: O
124
+ },
125
+ hsv: {
126
+ hex: (e) => $(N(e)),
127
+ hsl: ce,
128
+ hsv: (e) => e,
129
+ hwb: fe,
130
+ rgb: N
131
+ },
132
+ hwb: {
133
+ hex: (e) => $(N(k(e))),
134
+ hsl: (e) => W(N(k(e))),
135
+ hsv: k,
136
+ hwb: (e) => e,
137
+ rgb: (e) => N(k(e))
138
+ },
139
+ rgb: {
140
+ hex: $,
141
+ hsl: W,
142
+ hsv: (e) => k(H(e)),
143
+ hwb: H,
144
+ rgb: (e) => e
145
+ }
146
+ };
147
+ function oe(e, t, o) {
148
+ return Ne[e][t](o);
149
+ }
150
+ function He(e, t) {
151
+ const o = e.toFixed(t);
152
+ return o.includes(".") ? o.replace(/\.?0+$/, "") : o;
153
+ }
154
+ const Pe = {
155
+ deg: 1,
156
+ grad: 0.9,
157
+ rad: 180 / Math.PI,
158
+ turn: 360
159
+ }, B = {
160
+ from(e) {
161
+ return e.endsWith("%") ? M.from(e, { referenceValue: 1 }) : y.from(e, { min: 0, max: 1 });
162
+ },
163
+ to(e) {
164
+ return y.to(e);
165
+ }
166
+ }, re = {
167
+ from(e) {
168
+ const t = e.match(/deg|g?rad|turn$/);
169
+ if (t === null)
170
+ return y.from(e);
171
+ const o = t[0];
172
+ return y.from(e.slice(0, -o.length)) * Pe[o];
173
+ },
174
+ to(e) {
175
+ return y.to(e);
176
+ }
177
+ }, y = {
178
+ from(e, { min: t = Number.NEGATIVE_INFINITY, max: o = Number.POSITIVE_INFINITY } = {}) {
179
+ return e.endsWith(".") ? NaN : S(Number(e), t, o);
180
+ },
181
+ to(e) {
182
+ return He(e, 2);
183
+ }
184
+ }, M = {
185
+ from(e, { referenceValue: t = 100, min: o = 0, max: n = 100 } = {}) {
186
+ return e.endsWith("%") ? y.from(e.slice(0, -1), { min: o, max: n }) * t / 100 : NaN;
187
+ },
188
+ to(e) {
189
+ return y.to(e) + "%";
190
+ }
191
+ }, q = {
192
+ from(e) {
193
+ return e.endsWith("%") ? M.from(e, { referenceValue: 255 }) : y.from(e, { min: 0, max: 255 });
194
+ },
195
+ to(e) {
196
+ return y.to(e);
197
+ }
198
+ }, Se = {
199
+ hsl: {
200
+ h: re,
201
+ s: M,
202
+ l: M
203
+ },
204
+ hwb: {
205
+ h: re,
206
+ w: M,
207
+ b: M
208
+ },
209
+ rgb: {
210
+ r: q,
211
+ g: q,
212
+ b: q
213
+ }
214
+ };
215
+ function U(e, t) {
216
+ return Se[e][t];
217
+ }
218
+ function G({ format: e, color: t }, o) {
219
+ if (e === "hex")
220
+ return o && [5, 9].includes(t.length) ? t.substring(0, t.length - (t.length - 1) / 4) : t;
221
+ const n = Object.entries(t).slice(0, o ? 3 : 4).map(([u, a]) => {
222
+ const m = u === "a" ? B : U(e, u);
223
+ return (u === "a" ? "/ " : "") + m.to(a);
224
+ });
225
+ return `${e}(${n.join(" ")})`;
226
+ }
227
+ function me(e) {
228
+ return /^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(e);
229
+ }
230
+ function Le(e) {
231
+ return "r" in e ? "rgb" : "w" in e ? "hwb" : "v" in e ? "hsv" : "s" in e ? "hsl" : null;
232
+ }
233
+ const se = {
234
+ hsl: ["h", "s", "l", "a"],
235
+ hwb: ["h", "w", "b", "a"],
236
+ rgb: ["r", "g", "b", "a"]
237
+ };
238
+ function le(e) {
239
+ if (!e) return null;
240
+ if (typeof e != "string") {
241
+ const f = Le(e);
242
+ return f === null ? null : { format: f, color: e };
243
+ }
244
+ if (e.startsWith("#"))
245
+ return me(e) ? { format: "hex", color: e } : null;
246
+ if (!e.includes("(")) {
247
+ const f = document.createElement("canvas").getContext("2d");
248
+ f.fillStyle = e;
249
+ const h = f.fillStyle;
250
+ return h === "#000000" && e !== "black" ? null : { format: "hex", color: h };
251
+ }
252
+ const [t, o] = e.split("("), n = t.substring(0, 3);
253
+ if (!(n in se))
254
+ return null;
255
+ const u = o.replace(/[,/)]/g, " ").replace(/\s+/g, " ").trim().split(" ");
256
+ u.length === 3 && u.push("1");
257
+ const a = se[n], m = Object.fromEntries(
258
+ a.map((f, h) => {
259
+ const p = f === "a" ? B : U(n, f);
260
+ return [f, p.from(u[h])];
261
+ })
262
+ );
263
+ return { format: n, color: m };
264
+ }
265
+ const Ie = typeof window < "u", he = Ie && "EyeDropper" in window, Re = (e) => {
266
+ const t = new AbortController();
267
+ we(() => t.abort());
268
+ async function o() {
269
+ if (!he) return;
270
+ const n = new window.EyeDropper();
271
+ try {
272
+ let a = (await n.open({ signal: t.signal })).sRGBHex;
273
+ if (a.startsWith("rgba")) {
274
+ const m = a.match(/rgba?\((?<r>\d+), (?<g>\d+), (?<b>\d+), (?<a>[\d.]+)\)/);
275
+ if (m) {
276
+ const [f, h, p, b, i] = m;
277
+ a = `rgba(${h}, ${p}, ${b}, ${parseFloat(i) === 0 ? "1" : i})`;
278
+ }
279
+ }
280
+ e(a);
281
+ } catch (u) {
282
+ console.log("e ===>", u);
283
+ }
284
+ }
285
+ return {
286
+ openEyeDropper: o,
287
+ abortController: t
288
+ };
289
+ };
290
+ function Fe(e, t, o) {
291
+ const n = e.getBoundingClientRect(), u = t - n.left, a = o - n.top;
292
+ return {
293
+ x: n.width === 0 ? 0 : S(u / n.width * 100, 0, 100),
294
+ y: n.height === 0 ? 0 : S((1 - a / n.height) * 100, 0, 100)
295
+ };
296
+ }
297
+ const $e = /* @__PURE__ */ ue({
298
+ __name: "ColorPickerSpace",
299
+ setup(e) {
300
+ const t = We();
301
+ let o = !1, n;
302
+ function u(i) {
303
+ n = document.body.style.userSelect, document.body.style.userSelect = "none", o = !0, f(i);
304
+ }
305
+ function a(i) {
306
+ o = !0, h(i);
307
+ }
308
+ function m() {
309
+ document.body.style.userSelect = n, o = !1;
310
+ }
311
+ function f(i) {
312
+ i.buttons !== 1 || !o || !(t.colorSpace.value instanceof HTMLElement) || p(t.colorSpace.value, i.clientX, i.clientY);
313
+ }
314
+ function h(i) {
315
+ if (!o || !(t.colorSpace.value instanceof HTMLElement))
316
+ return;
317
+ i.preventDefault();
318
+ const g = i.touches[0];
319
+ p(t.colorSpace.value, g.clientX, g.clientY);
320
+ }
321
+ function p(i, g, V) {
322
+ const x = Fe(i, g, V), c = { ...t.colors.hsv };
323
+ c.s = x.x, c.v = x.y, t.setColor("hsv", c);
324
+ }
325
+ function b(i) {
326
+ if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(i.key))
327
+ return;
328
+ i.preventDefault();
329
+ const g = ["ArrowLeft", "ArrowDown"].includes(i.key) ? -1 : 1, V = ["ArrowLeft", "ArrowRight"].includes(i.key) ? "s" : "v", x = i.shiftKey ? 10 : 1, c = t.colors.hsv[V] + g * x, w = { ...t.colors.hsv };
330
+ w[V] = S(c, 0, 100), t.setColor("hsv", w);
331
+ }
332
+ return ae(() => {
333
+ document.addEventListener("mousemove", f, { passive: !1 }), document.addEventListener("touchmove", h, { passive: !1 }), document.addEventListener("mouseup", m), document.addEventListener("touchend", m);
334
+ }), ye(() => {
335
+ document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", h), document.removeEventListener("mouseup", m), document.removeEventListener("touchend", m);
336
+ }), (i, g) => (C(), D("div", {
337
+ ref: v(t).colorSpace,
338
+ class: T([v(P)(v(_), "space")]),
339
+ onMousedown: u,
340
+ onTouchstart: a
341
+ }, [
342
+ E("button", {
343
+ ref: v(t).thumb,
344
+ class: T([v(P)(v(_), "thumb")]),
345
+ tabindex: "0",
346
+ "aria-label": "Color space thumb",
347
+ onKeydown: b
348
+ }, null, 34)
349
+ ], 34));
350
+ }
351
+ }), De = ["value"], Oe = ["value"], [We, Be] = _e("ColorPicker"), _ = Me("color_picker"), Xe = /* @__PURE__ */ ue({
352
+ __name: "ColorPicker",
353
+ props: {
354
+ class: {},
355
+ color: {},
356
+ defaultColor: { default: "#ffffffff" },
357
+ format: {},
358
+ defaultFormat: { default: "hex" },
359
+ hideAlpha: { type: Boolean }
360
+ },
361
+ emits: ["update:color", "update:format", "change"],
362
+ setup(e, { emit: t }) {
363
+ const o = ["hex", "hsl", "hsv", "hwb", "rgb"], n = e, u = t, a = j(null), m = j(null), f = j(null), h = te(n, "format", u, {
364
+ defaultValue: n.defaultFormat,
365
+ passive: n.format === void 0
366
+ }), p = R(
367
+ () => h.value && o.includes(h.value) ? h.value : "hex"
368
+ ), b = te(n, "color", u, {
369
+ defaultValue: n.defaultColor,
370
+ passive: n.color === void 0
371
+ }), i = "#ffffffff", g = R(() => b.value ?? n.defaultColor ?? i);
372
+ xe(g, z);
373
+ const V = R(() => {
374
+ const l = p.value, r = c[l];
375
+ return l.split("").map((s) => {
376
+ const d = r[s];
377
+ return {
378
+ value: U(l, s).to(d),
379
+ channel: s,
380
+ label: s.toUpperCase()
381
+ };
382
+ }).concat(
383
+ n.hideAlpha ? [] : [
384
+ {
385
+ value: B.to(r.a),
386
+ channel: "a",
387
+ label: "Alpha"
388
+ }
389
+ ]
390
+ );
391
+ }), x = R({
392
+ get() {
393
+ return n.hideAlpha && [5, 9].includes(c.hex.length) ? c.hex.substring(0, c.hex.length - (c.hex.length - 1) / 4) : c.hex;
394
+ },
395
+ set(l) {
396
+ me(l) && w("hex", l);
397
+ }
398
+ }), c = Ce({
399
+ hex: i,
400
+ hsl: { h: 0, s: 0, l: 100, a: 1 },
401
+ hsv: { h: 0, s: 0, v: 100, a: 1 },
402
+ hwb: { h: 0, w: 100, b: 0, a: 1 },
403
+ rgb: { r: 255, g: 255, b: 255, a: 1 }
404
+ });
405
+ function w(l, r) {
406
+ let s = r;
407
+ if (n.hideAlpha)
408
+ if (typeof r != "string")
409
+ r.a = 1, s = r;
410
+ else if ([5, 9].includes(r.length)) {
411
+ const d = (r.length - 1) / 4;
412
+ s = r.substring(0, r.length - d) + "f".repeat(d);
413
+ } else [4, 7].includes(r.length) && (s = r + "f".repeat((r.length - 1) / 3));
414
+ if (!Ae(c[l], s)) {
415
+ c[l] = s;
416
+ for (const d of o)
417
+ d !== l && (c[d] = oe(l, d, s));
418
+ b.value = G(
419
+ { color: oe(l, p.value, s), format: p.value },
420
+ n.hideAlpha
421
+ ), u("change", ge());
422
+ }
423
+ a.value instanceof HTMLElement && m.value instanceof HTMLElement && f.value instanceof HTMLElement && ve(a.value, m.value, f.value);
424
+ }
425
+ function z(l) {
426
+ const r = le(l);
427
+ if (r !== null)
428
+ w(r.format, r.color);
429
+ else {
430
+ const s = le(i);
431
+ s !== null && w(s.format, s.color);
432
+ }
433
+ }
434
+ function de(l) {
435
+ h.value = l;
436
+ }
437
+ function X(l, r) {
438
+ const s = l.currentTarget, d = { ...c.hsv };
439
+ d[r] = Number(s.value), w("hsv", d);
440
+ }
441
+ function pe(l, r) {
442
+ const s = p.value, d = { ...c[s] }, I = (r === "a" ? B : U(s, r)).from(l);
443
+ Number.isNaN(l) || l === void 0 || (d[r] = I, w(s, d));
444
+ }
445
+ function ve(l, r, s) {
446
+ const d = G({ format: "hsl", color: c.hsl }, !0);
447
+ l.style.setProperty("--vacp-color", d), r.style.position = "relative", r.style.backgroundColor = `hsl(${c.hsl.h} 100% 50%)`, r.style.backgroundImage = "linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)", s.style.boxSizing = "border-box", s.style.position = "absolute", s.style.left = `${c.hsv.s}%`, s.style.bottom = `${c.hsv.v}%`;
448
+ }
449
+ function ge() {
450
+ const l = G(
451
+ { color: c[p.value], format: p.value },
452
+ n.hideAlpha
453
+ );
454
+ return {
455
+ colors: c,
456
+ cssColor: l
457
+ };
458
+ }
459
+ function J(l) {
460
+ if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(l.key) || !l.shiftKey)
461
+ return;
462
+ const r = l.currentTarget, s = Number(r.step), d = ["ArrowLeft", "ArrowDown"].includes(l.key) ? -1 : 1, A = Number(r.value) + d * s * 10, I = S(A, Number(r.min), Number(r.max));
463
+ r.value = String(I - d * s);
464
+ }
465
+ const { openEyeDropper: be } = Re(z);
466
+ ae(() => z(g.value)), Be({ colorSpace: m, thumb: f, colors: c, setColor: w });
467
+ const L = P(_, "slider");
468
+ return (l, r) => (C(), D("div", {
469
+ ref_key: "colorPicker",
470
+ ref: a,
471
+ class: T([v(_), n.class])
472
+ }, [
473
+ Q($e),
474
+ E("div", {
475
+ class: T(v(P)(v(_), "sliders"))
476
+ }, [
477
+ E("input", {
478
+ class: T([v(L), v(ne)(v(L), "hue")]),
479
+ value: c.hsv.h,
480
+ type: "range",
481
+ min: "0",
482
+ max: "360",
483
+ step: "1",
484
+ onKeydownPassive: J,
485
+ onInput: r[0] || (r[0] = (s) => X(s, "h"))
486
+ }, null, 42, De),
487
+ l.hideAlpha ? Z("", !0) : (C(), D("input", {
488
+ key: 0,
489
+ class: T([v(L), v(ne)(v(L), "alpha")]),
490
+ value: c.hsv.a,
491
+ type: "range",
492
+ min: "0",
493
+ max: "1",
494
+ step: "0.01",
495
+ onKeydownPassive: J,
496
+ onInput: r[1] || (r[1] = (s) => X(s, "a"))
497
+ }, null, 42, Oe))
498
+ ], 2),
499
+ E("div", {
500
+ class: T(v(P)(v(_), "inputs"))
501
+ }, [
502
+ E("button", {
503
+ disabled: !0,
504
+ class: "fake-select",
505
+ onClick: r[2] || (r[2] = (s) => de("rgb"))
506
+ }, [
507
+ r[4] || (r[4] = E("div", null, "Hex", -1)),
508
+ Q(Ee, {
509
+ icon: "tabler:chevron-down",
510
+ size: "2xsm",
511
+ class: "fake-select-icon"
512
+ })
513
+ ]),
514
+ p.value === "hex" ? (C(), Y(ee, {
515
+ key: 0,
516
+ class: "flex-1",
517
+ size: "sm",
518
+ modelValue: x.value,
519
+ "onUpdate:modelValue": r[3] || (r[3] = (s) => x.value = s)
520
+ }, null, 8, ["modelValue"])) : (C(!0), D(Te, { key: 1 }, Ve(V.value, ({ value: s, channel: d }) => (C(), Y(ee, {
521
+ modelValue: s,
522
+ "onUpdate:modelValue": (A) => pe(A, d),
523
+ size: "sm"
524
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]))), 256)),
525
+ v(he) ? (C(), Y(ke, {
526
+ key: 2,
527
+ onClick: v(be),
528
+ icon: "tabler:color-picker",
529
+ size: "sm",
530
+ type: "outline",
531
+ variant: "icon"
532
+ }, null, 8, ["onClick"])) : Z("", !0)
533
+ ], 2)
534
+ ], 2));
535
+ }
536
+ });
537
+ export {
538
+ Xe as _,
539
+ We as i,
540
+ Be as p
541
+ };
@@ -1,6 +1,6 @@
1
1
  import { GraphicalObjectProps } from '../GraphicalObject/GraphicalObject';
2
2
  import { ColorSwatchType, ColorSwatchSize } from './ColorSwatch.model';
3
- export type ColorSwatchProps = Omit<GraphicalObjectProps, 'as'> & {
3
+ export type ColorSwatchProps = GraphicalObjectProps & {
4
4
  selected?: boolean;
5
5
  size?: ColorSwatchSize;
6
6
  type?: ColorSwatchType;
@@ -14,11 +14,18 @@ export interface ColorSwatchSlots {
14
14
  value?: string;
15
15
  }) => never;
16
16
  }
17
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {
17
+ declare function __VLS_template(): {
18
+ slots: Readonly<ColorSwatchSlots> & ColorSwatchSlots;
19
+ refs: {};
20
+ attrs: Partial<{}>;
21
+ };
22
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
+ declare const __VLS_component: import('vue').DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {
18
24
  size: "sm" | "md";
19
- type: "color" | "remover" | "custom-picker";
25
+ type: ColorSwatchType;
20
26
  customPickerIcon: string;
21
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<ColorSwatchSlots> & ColorSwatchSlots>;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
29
  export default _default;
23
30
  type __VLS_WithTemplateSlots<T, S> = T & {
24
31
  new (): {
@@ -1,4 +1,4 @@
1
- import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-Bf0glWPU.js";
1
+ import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-CL9dd69H.js";
2
2
  export {
3
3
  s as ColorSwatch,
4
4
  r as ColorSwatchSizes,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-Dki5150Z.js");exports.ColorSwatch=e._sfc_main;exports.ColorSwatchSizes=e.ColorSwatchSizes;exports.ColorSwatchTypes=e.ColorSwatchTypes;exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-BH-NSALx.js");exports.ColorSwatch=e._sfc_main;exports.ColorSwatchSizes=e.ColorSwatchSizes;exports.ColorSwatchTypes=e.ColorSwatchTypes;exports.default=e._sfc_main;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),v=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-CdO2zArd.js"),k=require("./options-B4iSAKol.js"),_=require("./omit-BKPbELUG.js"),r=require("./class-CjZYGZDW.js"),C=require("class-variance-authority"),h=require("./IconButton.vue_vue_type_script_setup_true_lang-c16Xu6mm.js"),c=["sm","md"],l=["color","remover","custom-picker"],z={key:1,height:"100%",width:"100%",viewBox:"0 0 19 18",fill:"none"},f=e.defineComponent({...k.getComponentOptions("ColorTrigger"),__name:"ColorSwatch",props:{class:{},icon:{},fg:{},bg:{},br:{},size:{default:"md"},selected:{type:Boolean},type:{default:"color"},customPickerIcon:{default:"tabler:palette"}},setup(p){const o=p,s=r.getBemBlock("color_swatch"),u=C.cva(s,{variants:{selected:r.generateVariantClassList("selected",s),size:r.generateVariantClassList(c,s),type:r.generateVariantClassList(l,s)}}),n=e.computed(()=>o.size&&c.includes(o.size)?o.size:"md"),m=e.computed(()=>({size:n.value,..._.omit(o,"size","class","type","selected")})),d=e.useSlots(),y=e.computed(()=>{switch(o.type){case"color":return"div";case"custom-picker":return h._sfc_main;case"remover":return"div"}}),g=e.computed(()=>{const t={};return o.type==="custom-picker"&&(t.size=n.value,t.icon=o.customPickerIcon,t.color="gray",t.type="outline"),t});return(t,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y.value),e.mergeProps({class:[e.unref(u)({selected:t.type!=="custom-picker"&&o.selected,size:t.size,type:t.type}),o.class]},g.value),{icon:e.withCtx(()=>[e.renderSlot(t.$slots,"icon",e.normalizeProps(e.guardReactiveProps(o)))]),default:e.withCtx(()=>[t.type==="color"?(e.openBlock(),e.createBlock(v._sfc_main,e.normalizeProps(e.mergeProps({key:0},m.value)),e.createSlots({_:2},[e.renderList(Object.keys(d),a=>({name:a,fn:e.withCtx(()=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(o)))])}))]),1040)):t.type==="remover"?(e.openBlock(),e.createElementBlock("svg",z,i[0]||(i[0]=[e.createElementVNode("path",{id:"Empty Indicator",d:"M17.5 1L1.5 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]))):e.createCommentVNode("",!0),t.type==="custom-picker"?e.renderSlot(t.$slots,"default",e.normalizeProps(e.mergeProps({key:2},o))):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});exports.ColorSwatchSizes=c;exports.ColorSwatchTypes=l;exports._sfc_main=f;
@@ -0,0 +1,100 @@
1
+ import { defineComponent as B, computed as s, useSlots as S, createBlock as d, openBlock as c, resolveDynamicComponent as _, mergeProps as n, unref as P, withCtx as i, createElementBlock as b, createCommentVNode as f, renderSlot as a, normalizeProps as r, createSlots as $, renderList as E, guardReactiveProps as y, createElementVNode as I } from "vue";
2
+ import { _ as L } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-BEZ6FkRf.js";
3
+ import { g as V } from "./options-JBqnVZUl.js";
4
+ import { o as N } from "./omit-BEkBWXra.js";
5
+ import { g as O, a as l } from "./class-DziTeW9B.js";
6
+ import { cva as T } from "class-variance-authority";
7
+ import { _ as j } from "./IconButton.vue_vue_type_script_setup_true_lang-CchpvdkX.js";
8
+ const g = ["sm", "md"], D = ["color", "remover", "custom-picker"], M = {
9
+ key: 1,
10
+ height: "100%",
11
+ width: "100%",
12
+ viewBox: "0 0 19 18",
13
+ fill: "none"
14
+ }, K = /* @__PURE__ */ B({
15
+ ...V("ColorTrigger"),
16
+ __name: "ColorSwatch",
17
+ props: {
18
+ class: {},
19
+ icon: {},
20
+ fg: {},
21
+ bg: {},
22
+ br: {},
23
+ size: { default: "md" },
24
+ selected: { type: Boolean },
25
+ type: { default: "color" },
26
+ customPickerIcon: { default: "tabler:palette" }
27
+ },
28
+ setup(k) {
29
+ const o = k, t = O("color_swatch"), v = T(t, {
30
+ variants: {
31
+ selected: l("selected", t),
32
+ size: l(g, t),
33
+ type: l(D, t)
34
+ }
35
+ }), m = s(
36
+ () => o.size && g.includes(o.size) ? o.size : "md"
37
+ ), z = s(() => ({
38
+ size: m.value,
39
+ ...N(
40
+ o,
41
+ "size",
42
+ "class",
43
+ "type",
44
+ "selected"
45
+ /*'fg', 'bg', 'br'*/
46
+ )
47
+ })), C = S(), h = s(() => {
48
+ switch (o.type) {
49
+ case "color":
50
+ return "div";
51
+ case "custom-picker":
52
+ return j;
53
+ case "remover":
54
+ return "div";
55
+ }
56
+ }), w = s(() => {
57
+ const e = {};
58
+ return o.type === "custom-picker" && (e.size = m.value, e.icon = o.customPickerIcon, e.color = "gray", e.type = "outline"), e;
59
+ });
60
+ return (e, p) => (c(), d(_(h.value), n({
61
+ class: [
62
+ P(v)({
63
+ selected: e.type !== "custom-picker" && o.selected,
64
+ size: e.size,
65
+ type: e.type
66
+ }),
67
+ o.class
68
+ ]
69
+ }, w.value), {
70
+ icon: i(() => [
71
+ a(e.$slots, "icon", r(y(o)))
72
+ ]),
73
+ default: i(() => [
74
+ e.type === "color" ? (c(), d(L, r(n({ key: 0 }, z.value)), $({ _: 2 }, [
75
+ E(Object.keys(C), (u) => ({
76
+ name: u,
77
+ fn: i(() => [
78
+ a(e.$slots, u, r(y(o)))
79
+ ])
80
+ }))
81
+ ]), 1040)) : e.type === "remover" ? (c(), b("svg", M, p[0] || (p[0] = [
82
+ I("path", {
83
+ id: "Empty Indicator",
84
+ d: "M17.5 1L1.5 17",
85
+ stroke: "currentColor",
86
+ "stroke-width": "2",
87
+ "stroke-linecap": "round"
88
+ }, null, -1)
89
+ ]))) : f("", !0),
90
+ e.type === "custom-picker" ? a(e.$slots, "default", r(n({ key: 2 }, o))) : f("", !0)
91
+ ]),
92
+ _: 3
93
+ }, 16, ["class"]));
94
+ }
95
+ });
96
+ export {
97
+ g as C,
98
+ K as _,
99
+ D as a
100
+ };