@ixfx/components 0.2.3 → 0.2.5

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 (291) hide show
  1. package/LICENSE +1 -1
  2. package/bundle/chunk-pbuEa-1d.js +13 -0
  3. package/bundle/index.d.ts +4702 -569
  4. package/bundle/index.d.ts.map +1 -1
  5. package/bundle/index.js +34929 -2800
  6. package/bundle/index.js.map +1 -1
  7. package/bundle/style.css +133 -0
  8. package/dist/ac-text.d.ts +97 -0
  9. package/dist/ac-text.d.ts.map +1 -0
  10. package/dist/ac-text.js +484 -0
  11. package/dist/ac-text.js.map +1 -0
  12. package/dist/button-DgKUzE5o.js +121 -0
  13. package/dist/button-DgKUzE5o.js.map +1 -0
  14. package/dist/button.d.ts +21 -0
  15. package/dist/button.d.ts.map +1 -0
  16. package/dist/button.js +3 -0
  17. package/dist/checkbox.d.ts +34 -0
  18. package/dist/checkbox.d.ts.map +1 -0
  19. package/dist/checkbox.js +251 -0
  20. package/dist/checkbox.js.map +1 -0
  21. package/dist/chunk-pbuEa-1d.js +13 -0
  22. package/dist/colour-C3MQIjFJ-BJV-QC-3.js +4138 -0
  23. package/dist/colour-C3MQIjFJ-BJV-QC-3.js.map +1 -0
  24. package/dist/colour-picker-Bw-AZoWx.js +922 -0
  25. package/dist/colour-picker-Bw-AZoWx.js.map +1 -0
  26. package/dist/colour-picker.d.ts +2 -0
  27. package/dist/colour-picker.js +2 -0
  28. package/dist/crumbs.d.ts +92 -0
  29. package/dist/crumbs.d.ts.map +1 -0
  30. package/dist/crumbs.js +789 -0
  31. package/dist/crumbs.js.map +1 -0
  32. package/dist/data-display.d.ts +24 -12
  33. package/dist/data-display.d.ts.map +1 -1
  34. package/dist/data-display.js +96 -105
  35. package/dist/data-display.js.map +1 -1
  36. package/dist/decorate-BZbkqIhA.js +9 -0
  37. package/dist/defaults-FEZaGiYZ.js +38 -0
  38. package/dist/defaults-FEZaGiYZ.js.map +1 -0
  39. package/dist/dist-By5URG0Y.js +1290 -0
  40. package/dist/dist-By5URG0Y.js.map +1 -0
  41. package/dist/dist-D7kJgnSE.js +1039 -0
  42. package/dist/dist-D7kJgnSE.js.map +1 -0
  43. package/dist/editable-label.d.ts +71 -0
  44. package/dist/editable-label.d.ts.map +1 -0
  45. package/dist/editable-label.js +279 -0
  46. package/dist/editable-label.js.map +1 -0
  47. package/dist/hex-editor-Gib1Grg2.d.ts +131 -0
  48. package/dist/hex-editor-Gib1Grg2.d.ts.map +1 -0
  49. package/dist/hex-editor-Wd6ZtZA2.js +1147 -0
  50. package/dist/hex-editor-Wd6ZtZA2.js.map +1 -0
  51. package/dist/hex.d.ts +2 -0
  52. package/dist/hex.js +2 -0
  53. package/dist/highlight-CAjwQ4GE.js +50 -0
  54. package/dist/highlight-CAjwQ4GE.js.map +1 -0
  55. package/dist/icon-BR5aTIiP.js +100 -0
  56. package/dist/icon-BR5aTIiP.js.map +1 -0
  57. package/dist/icon-DQKdfR7U.d.ts +36 -0
  58. package/dist/icon-DQKdfR7U.d.ts.map +1 -0
  59. package/dist/icons.d.ts +3 -0
  60. package/dist/icons.js +9 -0
  61. package/dist/icons.js.map +1 -0
  62. package/dist/incr-search-BjCNClnC.js +311 -0
  63. package/dist/incr-search-BjCNClnC.js.map +1 -0
  64. package/dist/incr-search.d.ts +2 -0
  65. package/dist/incr-search.js +3 -0
  66. package/dist/index-B1hNR7Z9.d.ts +36 -0
  67. package/dist/index-B1hNR7Z9.d.ts.map +1 -0
  68. package/dist/index-C5dK8RZa.d.ts +23 -0
  69. package/dist/index-C5dK8RZa.d.ts.map +1 -0
  70. package/dist/index-C9iBN908.d.ts +160 -0
  71. package/dist/index-C9iBN908.d.ts.map +1 -0
  72. package/dist/index-CPVcTTXo.d.ts +396 -0
  73. package/dist/index-CPVcTTXo.d.ts.map +1 -0
  74. package/dist/index-CQxanqXF.d.ts +183 -0
  75. package/dist/index-CQxanqXF.d.ts.map +1 -0
  76. package/dist/index-CpbBI3n7.d.ts +1239 -0
  77. package/dist/index-CpbBI3n7.d.ts.map +1 -0
  78. package/dist/index.d.ts +422 -13
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +5729 -14
  81. package/dist/index.js.map +1 -1
  82. package/dist/interaction-CQDQJf2Q.js +1 -0
  83. package/dist/keyboard-De_vOHLg.js +20 -0
  84. package/dist/keyboard-De_vOHLg.js.map +1 -0
  85. package/dist/labelled-input-base-DS6-6C0r.js +155 -0
  86. package/dist/labelled-input-base-DS6-6C0r.js.map +1 -0
  87. package/dist/labelled-input-base-DnRh4reU.d.ts +43 -0
  88. package/dist/labelled-input-base-DnRh4reU.d.ts.map +1 -0
  89. package/dist/labelled-radial-input.d.ts +34 -0
  90. package/dist/labelled-radial-input.d.ts.map +1 -0
  91. package/dist/labelled-radial-input.js +188 -0
  92. package/dist/labelled-radial-input.js.map +1 -0
  93. package/dist/labelled-range-input.d.ts +2 -0
  94. package/dist/labelled-range-input.js +132 -0
  95. package/dist/labelled-range-input.js.map +1 -0
  96. package/dist/led.d.ts +25 -0
  97. package/dist/led.d.ts.map +1 -0
  98. package/dist/led.js +92 -0
  99. package/dist/led.js.map +1 -0
  100. package/dist/menu-BV6UFx_z.js +813 -0
  101. package/dist/menu-BV6UFx_z.js.map +1 -0
  102. package/dist/menu-item-Cikacp4F.d.ts +128 -0
  103. package/dist/menu-item-Cikacp4F.d.ts.map +1 -0
  104. package/dist/menu-item-DEzL_Yjk.js +766 -0
  105. package/dist/menu-item-DEzL_Yjk.js.map +1 -0
  106. package/dist/menu.d.ts +3 -0
  107. package/dist/menu.js +3 -0
  108. package/dist/miller.d.ts +324 -0
  109. package/dist/miller.d.ts.map +1 -0
  110. package/dist/miller.js +1343 -0
  111. package/dist/miller.js.map +1 -0
  112. package/dist/narrowed-text.d.ts +72 -0
  113. package/dist/narrowed-text.d.ts.map +1 -0
  114. package/dist/narrowed-text.js +571 -0
  115. package/dist/narrowed-text.js.map +1 -0
  116. package/dist/panel.d.ts +43 -0
  117. package/dist/panel.d.ts.map +1 -0
  118. package/dist/panel.js +408 -0
  119. package/dist/panel.js.map +1 -0
  120. package/dist/plots.d.ts +2 -0
  121. package/dist/plots.js +2 -0
  122. package/dist/polar-pad.d.ts +67 -0
  123. package/dist/polar-pad.d.ts.map +1 -0
  124. package/dist/polar-pad.js +537 -0
  125. package/dist/polar-pad.js.map +1 -0
  126. package/dist/popup-Ddx9LCzY.js +24 -0
  127. package/dist/popup-Ddx9LCzY.js.map +1 -0
  128. package/dist/prominence-CreDBdCs.js +98 -0
  129. package/dist/prominence-CreDBdCs.js.map +1 -0
  130. package/dist/radial-input-CNJ8asY2.js +849 -0
  131. package/dist/radial-input-CNJ8asY2.js.map +1 -0
  132. package/dist/radial-input-xSTd4kEz.d.ts +70 -0
  133. package/dist/radial-input-xSTd4kEz.d.ts.map +1 -0
  134. package/dist/radial-input.d.ts +2 -0
  135. package/dist/radial-input.js +2 -0
  136. package/dist/range-input.d.ts +43 -0
  137. package/dist/range-input.d.ts.map +1 -0
  138. package/dist/range-input.js +459 -0
  139. package/dist/range-input.js.map +1 -0
  140. package/dist/range.d.ts +28 -0
  141. package/dist/range.d.ts.map +1 -0
  142. package/dist/range.js +136 -0
  143. package/dist/range.js.map +1 -0
  144. package/dist/registry-CZEB1YI9.js +21 -0
  145. package/dist/registry-CZEB1YI9.js.map +1 -0
  146. package/dist/selecthorizontal.d.ts +13 -8
  147. package/dist/selecthorizontal.d.ts.map +1 -1
  148. package/dist/selecthorizontal.js +21 -25
  149. package/dist/selecthorizontal.js.map +1 -1
  150. package/dist/snap-container.d.ts +50 -0
  151. package/dist/snap-container.d.ts.map +1 -0
  152. package/dist/snap-container.js +297 -0
  153. package/dist/snap-container.js.map +1 -0
  154. package/dist/split-layout.d.ts +56 -0
  155. package/dist/split-layout.d.ts.map +1 -0
  156. package/dist/split-layout.js +545 -0
  157. package/dist/split-layout.js.map +1 -0
  158. package/dist/style.css +133 -0
  159. package/dist/swipe.d.ts +48 -0
  160. package/dist/swipe.d.ts.map +1 -0
  161. package/dist/swipe.js +204 -0
  162. package/dist/swipe.js.map +1 -0
  163. package/dist/tab-list-CFF7uSYH.d.ts +66 -0
  164. package/dist/tab-list-CFF7uSYH.d.ts.map +1 -0
  165. package/dist/tabs.d.ts +2 -0
  166. package/dist/tabs.js +203 -0
  167. package/dist/tabs.js.map +1 -0
  168. package/dist/tickled-controller-Cq1Va0rR.d.ts +218 -0
  169. package/dist/tickled-controller-Cq1Va0rR.d.ts.map +1 -0
  170. package/dist/tickled-styles-Bg3QbcrD.js +327 -0
  171. package/dist/tickled-styles-Bg3QbcrD.js.map +1 -0
  172. package/dist/timeline-DBWJsSjd.js +1748 -0
  173. package/dist/timeline-DBWJsSjd.js.map +1 -0
  174. package/dist/timeline.d.ts +2 -0
  175. package/dist/timeline.js +2 -0
  176. package/dist/tooltip-DMxmBNky.js +104 -0
  177. package/dist/tooltip-DMxmBNky.js.map +1 -0
  178. package/dist/tooltip-kfUBWYVB.d.ts +26 -0
  179. package/dist/tooltip-kfUBWYVB.d.ts.map +1 -0
  180. package/dist/tree-component-CQpoPo4s.d.ts +326 -0
  181. package/dist/tree-component-CQpoPo4s.d.ts.map +1 -0
  182. package/dist/tree-data-model-DGvRVOFY.js +190 -0
  183. package/dist/tree-data-model-DGvRVOFY.js.map +1 -0
  184. package/dist/tree.d.ts +100 -0
  185. package/dist/tree.d.ts.map +1 -0
  186. package/dist/tree.js +1144 -0
  187. package/dist/tree.js.map +1 -0
  188. package/dist/types-BKaqnpwx.d.ts +8 -0
  189. package/dist/types-BKaqnpwx.d.ts.map +1 -0
  190. package/dist/xy-axis-BANbgrI5.js +6243 -0
  191. package/dist/xy-axis-BANbgrI5.js.map +1 -0
  192. package/dist/xy-axis-CIFok7MF.d.ts +141 -0
  193. package/dist/xy-axis-CIFok7MF.d.ts.map +1 -0
  194. package/dist/xy-pad.d.ts +81 -0
  195. package/dist/xy-pad.d.ts.map +1 -0
  196. package/dist/xy-pad.js +435 -0
  197. package/dist/xy-pad.js.map +1 -0
  198. package/package.json +48 -39
  199. package/README.md +0 -14
  200. package/dist/charts/frequency-histogram-plot.d.ts +0 -33
  201. package/dist/charts/frequency-histogram-plot.d.ts.map +0 -1
  202. package/dist/charts/frequency-histogram-plot.js +0 -54
  203. package/dist/charts/frequency-histogram-plot.js.map +0 -1
  204. package/dist/charts/histogram-vis.d.ts +0 -57
  205. package/dist/charts/histogram-vis.d.ts.map +0 -1
  206. package/dist/charts/histogram-vis.js +0 -222
  207. package/dist/charts/histogram-vis.js.map +0 -1
  208. package/dist/charts/plot.d.ts +0 -199
  209. package/dist/charts/plot.d.ts.map +0 -1
  210. package/dist/charts/plot.js +0 -914
  211. package/dist/charts/plot.js.map +0 -1
  212. package/dist/crumb-nav.d.ts +0 -41
  213. package/dist/crumb-nav.d.ts.map +0 -1
  214. package/dist/crumb-nav.js +0 -198
  215. package/dist/crumb-nav.js.map +0 -1
  216. package/dist/crumb-navigation.d.ts +0 -30
  217. package/dist/crumb-navigation.d.ts.map +0 -1
  218. package/dist/crumb-navigation.js +0 -307
  219. package/dist/crumb-navigation.js.map +0 -1
  220. package/dist/dial.d.ts +0 -89
  221. package/dist/dial.d.ts.map +0 -1
  222. package/dist/dial.js +0 -506
  223. package/dist/dial.js.map +0 -1
  224. package/dist/my-element.d.ts +0 -14
  225. package/dist/my-element.d.ts.map +0 -1
  226. package/dist/my-element.js +0 -44
  227. package/dist/my-element.js.map +0 -1
  228. package/dist/split-layout/split-layout.d.ts +0 -35
  229. package/dist/split-layout/split-layout.d.ts.map +0 -1
  230. package/dist/split-layout/split-layout.js +0 -220
  231. package/dist/split-layout/split-layout.js.map +0 -1
  232. package/dist/svg-edit-label.d.ts +0 -2
  233. package/dist/svg-edit-label.d.ts.map +0 -1
  234. package/dist/svg-edit-label.js +0 -110
  235. package/dist/svg-edit-label.js.map +0 -1
  236. package/dist/tabs/tab-layout-item.d.ts +0 -10
  237. package/dist/tabs/tab-layout-item.d.ts.map +0 -1
  238. package/dist/tabs/tab-layout-item.js +0 -20
  239. package/dist/tabs/tab-layout-item.js.map +0 -1
  240. package/dist/tabs/tab-layout.d.ts +0 -10
  241. package/dist/tabs/tab-layout.d.ts.map +0 -1
  242. package/dist/tabs/tab-layout.js +0 -25
  243. package/dist/tabs/tab-layout.js.map +0 -1
  244. package/dist/tabs/tab-list-item.d.ts +0 -18
  245. package/dist/tabs/tab-list-item.d.ts.map +0 -1
  246. package/dist/tabs/tab-list-item.js +0 -63
  247. package/dist/tabs/tab-list-item.js.map +0 -1
  248. package/dist/tabs/tab-list.d.ts +0 -21
  249. package/dist/tabs/tab-list.d.ts.map +0 -1
  250. package/dist/tabs/tab-list.js +0 -148
  251. package/dist/tabs/tab-list.js.map +0 -1
  252. package/dist/tabs/tab-panel.d.ts +0 -11
  253. package/dist/tabs/tab-panel.d.ts.map +0 -1
  254. package/dist/tabs/tab-panel.js +0 -30
  255. package/dist/tabs/tab-panel.js.map +0 -1
  256. package/dist/tabs/tab-panels.d.ts +0 -30
  257. package/dist/tabs/tab-panels.d.ts.map +0 -1
  258. package/dist/tabs/tab-panels.js +0 -80
  259. package/dist/tabs/tab-panels.js.map +0 -1
  260. package/dist/util/circle-arc.d.ts +0 -34
  261. package/dist/util/circle-arc.d.ts.map +0 -1
  262. package/dist/util/circle-arc.js +0 -77
  263. package/dist/util/circle-arc.js.map +0 -1
  264. package/dist/util/compare.d.ts +0 -53
  265. package/dist/util/compare.d.ts.map +0 -1
  266. package/dist/util/compare.js +0 -91
  267. package/dist/util/compare.js.map +0 -1
  268. package/dist/util/content-editable.d.ts +0 -2
  269. package/dist/util/content-editable.d.ts.map +0 -1
  270. package/dist/util/content-editable.js +0 -13
  271. package/dist/util/content-editable.js.map +0 -1
  272. package/dist/util/drag-controller.d.ts +0 -13
  273. package/dist/util/drag-controller.d.ts.map +0 -1
  274. package/dist/util/drag-controller.js +0 -21
  275. package/dist/util/drag-controller.js.map +0 -1
  276. package/dist/util/key-value.d.ts +0 -5
  277. package/dist/util/key-value.d.ts.map +0 -1
  278. package/dist/util/key-value.js +0 -30
  279. package/dist/util/key-value.js.map +0 -1
  280. package/dist/util/primitive-types.d.ts +0 -6
  281. package/dist/util/primitive-types.d.ts.map +0 -1
  282. package/dist/util/primitive-types.js +0 -2
  283. package/dist/util/primitive-types.js.map +0 -1
  284. package/dist/util/svg-editable-text.d.ts +0 -22
  285. package/dist/util/svg-editable-text.d.ts.map +0 -1
  286. package/dist/util/svg-editable-text.js +0 -121
  287. package/dist/util/svg-editable-text.js.map +0 -1
  288. package/dist/util/time.d.ts +0 -2
  289. package/dist/util/time.d.ts.map +0 -1
  290. package/dist/util/time.js +0 -2
  291. package/dist/util/time.js.map +0 -1
@@ -0,0 +1,922 @@
1
+ import { t as __decorate } from "./decorate-BZbkqIhA.js";
2
+ import { n as ICON_CHECK } from "./defaults-FEZaGiYZ.js";
3
+ import { t as popupSurfaceStyles } from "./popup-Ddx9LCzY.js";
4
+ import { t as colour_exports } from "./colour-C3MQIjFJ-BJV-QC-3.js";
5
+ import "./labelled-range-input.js";
6
+ import { LitElement, css, html, nothing } from "lit";
7
+ import { customElement, property, query, state } from "lit/decorators.js";
8
+ import { unsafeHTML } from "lit/directives/unsafe-html.js";
9
+ const RANGE_LIMITS = {
10
+ l: [0, 1],
11
+ c: [0, .4],
12
+ h: [0, 360],
13
+ a: [0, 1]
14
+ };
15
+ const DEFAULT_RANGES = {
16
+ l: RANGE_LIMITS.l,
17
+ c: RANGE_LIMITS.c,
18
+ h: RANGE_LIMITS.h,
19
+ a: RANGE_LIMITS.a
20
+ };
21
+ /**
22
+ * Convert OKLCH to a CSS string
23
+ */
24
+ function oklchToCss(l, c, h, a = 1) {
25
+ if (a < 1) return `oklch(${l} ${c} ${h} / ${a})`;
26
+ return `oklch(${l} ${c} ${h})`;
27
+ }
28
+ //#endregion
29
+ //#region src/colour-picker/colour-picker.ts
30
+ let ColourPicker = class ColourPicker extends LitElement {
31
+ constructor(..._args) {
32
+ super(..._args);
33
+ this.l = .7;
34
+ this.c = .15;
35
+ this.h = 180;
36
+ this.a = 1;
37
+ this.hidePreview = false;
38
+ this.hideH = false;
39
+ this.hideL = false;
40
+ this.hideC = false;
41
+ this.showA = false;
42
+ this.horizontal = false;
43
+ this.slidersVertical = false;
44
+ this.hideTooltips = false;
45
+ this._valueAttr = null;
46
+ this.rangeLAttr = null;
47
+ this.rangeCAttr = null;
48
+ this.rangeHAttr = null;
49
+ this.rangeAAttr = null;
50
+ this._ranges = {
51
+ l: DEFAULT_RANGES.l,
52
+ c: DEFAULT_RANGES.c,
53
+ h: DEFAULT_RANGES.h,
54
+ a: DEFAULT_RANGES.a
55
+ };
56
+ this._defaultL = this.l;
57
+ this._defaultC = this.c;
58
+ this._defaultH = this.h;
59
+ this._defaultA = this.a;
60
+ this._userInitiated = /* @__PURE__ */ new Set();
61
+ this._onInput = (e, channel) => {
62
+ const detail = e.detail;
63
+ this._userInitiated.add(channel);
64
+ this[channel] = detail.value;
65
+ this._dispatchInput();
66
+ e.stopPropagation();
67
+ };
68
+ this._onChange = (e, channel) => {
69
+ const detail = e.detail;
70
+ this._userInitiated.add(channel);
71
+ const value = typeof detail.value === `string` ? Number.parseFloat(detail.value) : detail.value;
72
+ switch (channel) {
73
+ case `l`:
74
+ this.l = value;
75
+ break;
76
+ case `c`:
77
+ this.c = value;
78
+ break;
79
+ case `h`:
80
+ this.h = value;
81
+ break;
82
+ case `a`:
83
+ this.a = value;
84
+ break;
85
+ }
86
+ e.stopPropagation();
87
+ this.requestUpdate();
88
+ this._dispatchChange();
89
+ };
90
+ }
91
+ get value() {
92
+ return oklchToCss(this.l, this.c, this.h, this.a);
93
+ }
94
+ set value(colourString) {
95
+ const c = colour_exports.convert(colourString, `oklch-absolute`);
96
+ this.l = c.l;
97
+ this.c = c.c;
98
+ this.h = c.h;
99
+ this.a = c.opacity ?? 1;
100
+ this._valueAttr = colourString;
101
+ }
102
+ /**
103
+ * Set the colour from any ixfx-compatible format (CSS string, OkLch object,
104
+ * HSL object, etc.). Also updates the double-click reset defaults for all
105
+ * sliders.
106
+ */
107
+ setColour(colour) {
108
+ const c = colour_exports.convert(colour, `oklch-absolute`);
109
+ this.l = c.l;
110
+ this.c = c.c;
111
+ this.h = c.h;
112
+ this.a = c.opacity ?? 1;
113
+ }
114
+ get rangeL() {
115
+ return [this._ranges.l[0], this._ranges.l[1]];
116
+ }
117
+ set rangeL(range) {
118
+ this._applyRangeInput(`l`, range);
119
+ }
120
+ get rangeC() {
121
+ return [this._ranges.c[0], this._ranges.c[1]];
122
+ }
123
+ set rangeC(range) {
124
+ this._applyRangeInput(`c`, range);
125
+ }
126
+ get rangeH() {
127
+ return [this._ranges.h[0], this._ranges.h[1]];
128
+ }
129
+ set rangeH(range) {
130
+ this._applyRangeInput(`h`, range);
131
+ }
132
+ get rangeA() {
133
+ return [this._ranges.a[0], this._ranges.a[1]];
134
+ }
135
+ set rangeA(range) {
136
+ this._applyRangeInput(`a`, range);
137
+ }
138
+ setRangeL(range) {
139
+ this.rangeL = range;
140
+ }
141
+ setRangeC(range) {
142
+ this.rangeC = range;
143
+ }
144
+ setRangeH(range) {
145
+ this.rangeH = range;
146
+ }
147
+ setRangeA(range) {
148
+ this.rangeA = range;
149
+ }
150
+ willUpdate(changedProperties) {
151
+ if (changedProperties.has(`rangeLAttr`)) this._setRangeFromAttribute(`l`, this.rangeLAttr);
152
+ if (changedProperties.has(`rangeCAttr`)) this._setRangeFromAttribute(`c`, this.rangeCAttr);
153
+ if (changedProperties.has(`rangeHAttr`)) this._setRangeFromAttribute(`h`, this.rangeHAttr);
154
+ if (changedProperties.has(`rangeAAttr`)) this._setRangeFromAttribute(`a`, this.rangeAAttr);
155
+ super.willUpdate(changedProperties);
156
+ }
157
+ _applyRangeInput(channel, input) {
158
+ const normalized = this._coerceRangeInput(channel, input);
159
+ if (!normalized) return;
160
+ this._setRange(channel, normalized);
161
+ }
162
+ _coerceRangeInput(channel, input) {
163
+ if (!Array.isArray(input) || input.length < 2) return null;
164
+ const [start, end] = input;
165
+ if (!Number.isFinite(start) || !Number.isFinite(end)) return null;
166
+ return this._normalizeRange(channel, [start, end]);
167
+ }
168
+ _setRangeFromAttribute(channel, value) {
169
+ if (value === null) {
170
+ this._setRange(channel, DEFAULT_RANGES[channel]);
171
+ return;
172
+ }
173
+ const parsed = this._parseRangeString(channel, value);
174
+ if (parsed) this._setRange(channel, parsed);
175
+ }
176
+ _setRange(channel, range) {
177
+ const normalized = this._normalizeRange(channel, range);
178
+ const currentRange = this._ranges[channel];
179
+ if (currentRange[0] === normalized[0] && currentRange[1] === normalized[1]) return;
180
+ this._ranges = {
181
+ ...this._ranges,
182
+ [channel]: normalized
183
+ };
184
+ switch (channel) {
185
+ case `l`:
186
+ this.l = this._clampToRange(`l`, this.l);
187
+ break;
188
+ case `c`:
189
+ this.c = this._clampToRange(`c`, this.c);
190
+ break;
191
+ case `h`:
192
+ this.h = this._clampToRange(`h`, this.h);
193
+ break;
194
+ case `a`:
195
+ this.a = this._clampToRange(`a`, this.a);
196
+ break;
197
+ }
198
+ this.requestUpdate();
199
+ }
200
+ _getRange(channel) {
201
+ return this._ranges[channel] ?? DEFAULT_RANGES[channel];
202
+ }
203
+ _parseRangeString(channel, value) {
204
+ const parts = value.trim().split(`-`, 2);
205
+ if (parts.length !== 2) return null;
206
+ const start = Number(parts[0].trim());
207
+ const end = Number(parts[1].trim());
208
+ if (!Number.isFinite(start) || !Number.isFinite(end)) return null;
209
+ return this._normalizeRange(channel, [start, end]);
210
+ }
211
+ _normalizeRange(channel, range) {
212
+ const limits = DEFAULT_RANGES[channel];
213
+ const [rawMin, rawMax] = range;
214
+ const minVal = Math.min(Math.min(rawMin, rawMax), limits[1]);
215
+ const maxVal = Math.max(Math.max(rawMin, rawMax), limits[0]);
216
+ return [Math.max(minVal, limits[0]), Math.min(maxVal, limits[1])];
217
+ }
218
+ _clampToRange(channel, value) {
219
+ const [min, max] = this._getRange(channel);
220
+ return Math.min(Math.max(value, min), max);
221
+ }
222
+ render() {
223
+ const makeSlider = (channel, label, min, max, step, isHidden, formatter) => {
224
+ if (isHidden) return nothing;
225
+ return html`
226
+ <ixfx-labelled-range-input
227
+ id="slider-${channel}"
228
+ label="${label}"
229
+ min=${min}
230
+ max=${max}
231
+ mini-width-threshold=200
232
+ .value=${this[channel]}
233
+ step=${step}
234
+ .orientation=${this.slidersVertical ? `vertical` : `horizontal`}
235
+ .formatter=${formatter}
236
+ ?no-tooltip=${this.hideTooltips}
237
+ .displayTextLogic=${this.hideTooltips ? `show` : `transient`}
238
+ @input=${(e) => this._onInput(e, channel)}
239
+ @change=${(e) => this._onChange(e, channel)}
240
+ ></ixfx-labelled-range-input>
241
+ `;
242
+ };
243
+ return html`
244
+ <div class="picker" ?horizontal=${this.horizontal}>
245
+ <div class="preview" ?hidden=${this.hidePreview}></div>
246
+ <div class="sliders">
247
+ ${makeSlider(`h`, `Hue`, ...this._getRange(`h`), 1, this.hideH, (v) => `${Math.round(Number(v))}°`)}
248
+ ${makeSlider(`l`, `Lightness`, ...this._getRange(`l`), .01, this.hideL, (v) => `${Math.round(Number(v) * 100)}%`)}
249
+ ${makeSlider(`c`, `Chroma`, ...this._getRange(`c`), .005, this.hideC, (v) => `${Number.parseFloat(v).toFixed(2)}`)}
250
+ ${this.showA ? makeSlider(`a`, `Opacity`, ...this._getRange(`a`), .01, false, (v) => `${Math.round(Number(v) * 100)}%`) : nothing}
251
+ </div>
252
+ </div>
253
+ `;
254
+ }
255
+ firstUpdated(changedProperties) {
256
+ super.firstUpdated(changedProperties);
257
+ this._updateGradients();
258
+ }
259
+ updated(changedProperties) {
260
+ super.updated(changedProperties);
261
+ if (changedProperties.has(`l`) && !this._userInitiated.has(`l`)) this._defaultL = this.l;
262
+ if (changedProperties.has(`c`) && !this._userInitiated.has(`c`)) this._defaultC = this.c;
263
+ if (changedProperties.has(`h`) && !this._userInitiated.has(`h`)) this._defaultH = this.h;
264
+ if (changedProperties.has(`a`) && !this._userInitiated.has(`a`)) this._defaultA = this.a;
265
+ this._userInitiated.clear();
266
+ if (changedProperties.has(`l`) || changedProperties.has(`c`) || changedProperties.has(`h`) || changedProperties.has(`a`) || changedProperties.has(`showA`) || changedProperties.has(`slidersVertical`)) this._updateGradients();
267
+ }
268
+ _updateGradients() {
269
+ const l = this.l;
270
+ const c = this.c;
271
+ const h = this.h;
272
+ const a = this.a;
273
+ const [lMin, lMax] = this._ranges.l;
274
+ const [cMin, cMax] = this._ranges.c;
275
+ const [hMin, hMax] = this._ranges.h;
276
+ const [aMin, aMax] = this._ranges.a;
277
+ const dir = this.slidersVertical ? `to top` : `to right`;
278
+ const lGrad = `linear-gradient(in oklch ${dir}, oklch(${lMin} ${c} ${h}), oklch(${lMax} ${c} ${h}))`;
279
+ const cGrad = `linear-gradient(in oklch ${dir}, oklch(${l} ${cMin} ${h}), oklch(${l} ${cMax} ${h}))`;
280
+ const hGrad = `linear-gradient(in oklch ${hMax - hMin >= 300 ? `longer` : `shorter`} hue ${dir}, oklch(${l} ${c} ${hMin}), oklch(${l} ${c} ${hMax}))`;
281
+ const aGrad = `
282
+ linear-gradient(${dir}, oklch(${l} ${c} ${h} / ${aMin}), oklch(${l} ${c} ${h} / ${aMax})),
283
+ repeating-conic-gradient(
284
+ var(--surface-2) 0% 25%,
285
+ var(--surface-4) 0% 50%
286
+ ) 50% / 16px 16px
287
+ `;
288
+ const trackBgVars = [`--background-track`, `--background-track-hover`];
289
+ const trackValueVars = [
290
+ `--background-track-value`,
291
+ `--background-track-value-hover`,
292
+ `--background-track-value-active`,
293
+ `--background-track-value-vertical`,
294
+ `--background-track-value-hover-vertical`,
295
+ `--background-track-value-active-vertical`
296
+ ];
297
+ const sliders = [
298
+ [this._sliderL, lGrad],
299
+ [this._sliderC, cGrad],
300
+ [this._sliderH, hGrad]
301
+ ];
302
+ if (this.showA && this._sliderA) sliders.push([this._sliderA, aGrad]);
303
+ for (const [el, grad] of sliders) {
304
+ if (!el) continue;
305
+ for (const v of trackBgVars) el.style.setProperty(v, grad);
306
+ for (const v of trackValueVars) el.style.setProperty(v, `transparent`);
307
+ }
308
+ if (this._previewEl) if (this.a < 1) {
309
+ const previewBg = `
310
+ linear-gradient(oklch(${l} ${c} ${h} / ${a}), oklch(${l} ${c} ${h} / ${a})),
311
+ repeating-conic-gradient(
312
+ var(--surface-2) 0% 25%,
313
+ var(--surface-4) 0% 50%
314
+ ) 50% / 16px 16px
315
+ `;
316
+ this._previewEl.style.background = previewBg;
317
+ } else this._previewEl.style.background = this.value;
318
+ }
319
+ _dispatchInput() {
320
+ const detail = {
321
+ l: this.l,
322
+ c: this.c,
323
+ h: this.h,
324
+ a: this.a
325
+ };
326
+ this.dispatchEvent(new CustomEvent(`input`, {
327
+ detail,
328
+ bubbles: true,
329
+ composed: true
330
+ }));
331
+ }
332
+ _dispatchChange() {
333
+ const detail = {
334
+ l: this.l,
335
+ c: this.c,
336
+ h: this.h,
337
+ a: this.a
338
+ };
339
+ this.dispatchEvent(new CustomEvent(`change`, {
340
+ detail,
341
+ bubbles: true,
342
+ composed: true
343
+ }));
344
+ }
345
+ static {
346
+ this.styles = css`
347
+ /*
348
+ * Default intrinsic size — not determined by label text.
349
+ * Override via CSS: ixfx-colour-picker { width: 100%; height: 200px; }
350
+ * Or via custom properties: --picker-alt-width, --picker-alt-min-slider-height
351
+ */
352
+ :host {
353
+ display: block;
354
+ width: var(--picker-alt-width, 240px);
355
+ height: var(--picker-alt-height, 240px);
356
+ --_radius-m: var(--radius-m, 4px);
357
+ --_radius-s: var(--radius-m, 3px);
358
+ container-type: size;
359
+ }
360
+
361
+ .picker {
362
+ display: flex;
363
+ flex-direction: column;
364
+ gap: var(--space-s, 8px);
365
+ width: 100%;
366
+ height: 100%;
367
+ overflow: hidden;
368
+ }
369
+
370
+ .picker[horizontal] {
371
+ flex-direction: row;
372
+ align-items: stretch;
373
+ }
374
+
375
+ .sliders {
376
+ display: flex;
377
+ flex-direction: column;
378
+ gap: var(--space-s, 8px);
379
+ flex: 1;
380
+ min-height: 0;
381
+ }
382
+
383
+ .picker[horizontal] .sliders {
384
+ flex-direction: column;
385
+ }
386
+
387
+ .preview {
388
+ flex-shrink: 0;
389
+ height: 30%;
390
+ border-radius: var(--_radius-m);
391
+ border: 1px solid rgba(0, 0, 0, 0.2);
392
+ }
393
+
394
+ .preview[hidden] {
395
+ display: none;
396
+ }
397
+
398
+ .picker[horizontal] .preview {
399
+ width: 3em;
400
+ height: auto;
401
+ flex-shrink: 0;
402
+ }
403
+
404
+ ixfx-labelled-range-input {
405
+ flex: 1;
406
+ min-height: var(--picker-alt-min-slider-height, 2.5em);
407
+ width: 100%;
408
+ min-width: 0;
409
+ --track-thickness: 2em;
410
+ --track-radius: var(--_radius-s);
411
+ --label-width: 5em;
412
+ --thumb-thickness: 4px;
413
+ --thumb-color: rgba(255, 255, 255, 0.9);
414
+ --thumb-color-active: white;
415
+ --thumb-radius: 3px;
416
+ --thumb-border: 2px solid rgba(255, 255, 255, 0.85);
417
+ --thumb-shadow: 0 0 0 2px rgba(0, 0, 0, 0.65);
418
+ }
419
+
420
+ /* Vertical sliders mode: sliders are side-by-side vertical bars */
421
+ :host([sliders-vertical]) .sliders {
422
+ flex-direction: row;
423
+ align-items: stretch;
424
+ }
425
+
426
+ :host([sliders-vertical]) ixfx-labelled-range-input {
427
+ width: auto;
428
+ height: 100%;
429
+ min-height: 0;
430
+ --mini: 1; /* force mini mode: no label, tooltip on hover */
431
+ --track-thickness: 100%; /* fill full width of the narrow slider */
432
+ }
433
+
434
+ /* Landscape */
435
+ @container (aspect-ratio > 1) {
436
+ .picker {
437
+ flex-direction: row;
438
+ display:flex;
439
+ align-items: stretch;
440
+
441
+ }
442
+ .preview {
443
+ width: 30%;
444
+ height: unset;
445
+ }
446
+ .sliders {
447
+ height: 100%;
448
+ overflow: hidden;
449
+ }
450
+ }
451
+
452
+ /* Small height. Show as landscape */
453
+ @container (max-height: 150px) {
454
+ .picker {
455
+ flex-direction: row;
456
+ align-items: stretch;
457
+ }
458
+ ixfx-labelled-range-input {
459
+ --track-thickness: 1em;
460
+ min-height: unset;
461
+ }
462
+ .preview {
463
+ min-width: 50%;
464
+ height: auto;
465
+ }
466
+ }
467
+
468
+ /* Medium height — tighter but not extreme */
469
+ @container (max-height: 210px) and (min-height: 150px) {
470
+ ixfx-labelled-range-input {
471
+ --track-thickness: 1.6em;
472
+ min-height: 1.8em;
473
+ }
474
+ }
475
+ `;
476
+ }
477
+ };
478
+ __decorate([property({ type: Number })], ColourPicker.prototype, "l", void 0);
479
+ __decorate([property({ type: Number })], ColourPicker.prototype, "c", void 0);
480
+ __decorate([property({ type: Number })], ColourPicker.prototype, "h", void 0);
481
+ __decorate([property({ type: Number })], ColourPicker.prototype, "a", void 0);
482
+ __decorate([property({
483
+ type: Boolean,
484
+ attribute: `hide-preview`,
485
+ reflect: true
486
+ })], ColourPicker.prototype, "hidePreview", void 0);
487
+ __decorate([property({
488
+ type: Boolean,
489
+ attribute: `hide-h`,
490
+ reflect: true
491
+ })], ColourPicker.prototype, "hideH", void 0);
492
+ __decorate([property({
493
+ type: Boolean,
494
+ attribute: `hide-l`,
495
+ reflect: true
496
+ })], ColourPicker.prototype, "hideL", void 0);
497
+ __decorate([property({
498
+ type: Boolean,
499
+ attribute: `hide-c`,
500
+ reflect: true
501
+ })], ColourPicker.prototype, "hideC", void 0);
502
+ __decorate([property({
503
+ type: Boolean,
504
+ attribute: `show-a`
505
+ })], ColourPicker.prototype, "showA", void 0);
506
+ __decorate([property({
507
+ type: Boolean,
508
+ attribute: `horizontal`,
509
+ reflect: true
510
+ })], ColourPicker.prototype, "horizontal", void 0);
511
+ __decorate([property({
512
+ type: Boolean,
513
+ attribute: `sliders-vertical`,
514
+ reflect: true
515
+ })], ColourPicker.prototype, "slidersVertical", void 0);
516
+ __decorate([property({
517
+ type: Boolean,
518
+ attribute: `hide-tooltips`,
519
+ reflect: true
520
+ })], ColourPicker.prototype, "hideTooltips", void 0);
521
+ __decorate([property({
522
+ type: String,
523
+ attribute: `value`
524
+ })], ColourPicker.prototype, "_valueAttr", void 0);
525
+ __decorate([property({
526
+ type: String,
527
+ attribute: `range-l`
528
+ })], ColourPicker.prototype, "rangeLAttr", void 0);
529
+ __decorate([property({
530
+ type: String,
531
+ attribute: `range-c`
532
+ })], ColourPicker.prototype, "rangeCAttr", void 0);
533
+ __decorate([property({
534
+ type: String,
535
+ attribute: `range-h`
536
+ })], ColourPicker.prototype, "rangeHAttr", void 0);
537
+ __decorate([property({
538
+ type: String,
539
+ attribute: `range-a`
540
+ })], ColourPicker.prototype, "rangeAAttr", void 0);
541
+ __decorate([query(`#slider-l`)], ColourPicker.prototype, "_sliderL", void 0);
542
+ __decorate([query(`#slider-c`)], ColourPicker.prototype, "_sliderC", void 0);
543
+ __decorate([query(`#slider-h`)], ColourPicker.prototype, "_sliderH", void 0);
544
+ __decorate([query(`#slider-a`)], ColourPicker.prototype, "_sliderA", void 0);
545
+ __decorate([query(`.preview`)], ColourPicker.prototype, "_previewEl", void 0);
546
+ ColourPicker = __decorate([customElement(`ixfx-colour-picker`)], ColourPicker);
547
+ //#endregion
548
+ //#region src/colour-picker/colour-picker-popup.ts
549
+ let _instanceCounter = 0;
550
+ const PICKER_SIZES = {
551
+ small: {
552
+ width: 130,
553
+ height: 100
554
+ },
555
+ medium: {
556
+ width: 100,
557
+ height: 155
558
+ },
559
+ large: {
560
+ width: 200,
561
+ height: 180
562
+ },
563
+ huge: {
564
+ width: 290,
565
+ height: 240
566
+ }
567
+ };
568
+ function swatchBackground(l, c, h, a) {
569
+ if (a < 1) return `
570
+ linear-gradient(oklch(${l} ${c} ${h} / ${a}), oklch(${l} ${c} ${h} / ${a})),
571
+ repeating-conic-gradient(
572
+ var(--surface-2) 0% 25%,
573
+ var(--surface-4) 0% 50%
574
+ ) 50% / 8px 8px
575
+ `;
576
+ return oklchToCss(l, c, h);
577
+ }
578
+ let ColourPickerPopup = class ColourPickerPopup extends LitElement {
579
+ constructor() {
580
+ super();
581
+ this.mode = `fluid`;
582
+ this.l = .7;
583
+ this.c = .15;
584
+ this.h = 180;
585
+ this.a = 1;
586
+ this.showPreview = false;
587
+ this.hideH = false;
588
+ this.hideL = false;
589
+ this.hideC = false;
590
+ this.showA = false;
591
+ this.horizontal = false;
592
+ this.size = `medium`;
593
+ this._isOpen = false;
594
+ this._everOpened = false;
595
+ this._pendingL = this.l;
596
+ this._pendingC = this.c;
597
+ this._pendingH = this.h;
598
+ this._pendingA = this.a;
599
+ this._savedL = this.l;
600
+ this._savedC = this.c;
601
+ this._savedH = this.h;
602
+ this._savedA = this.a;
603
+ this._pendingConfirmed = false;
604
+ this._onPopoverToggle = (e) => {
605
+ const te = e;
606
+ this._isOpen = te.newState === `open`;
607
+ if (te.newState === `open`) {
608
+ this._savedL = this.l;
609
+ this._savedC = this.c;
610
+ this._savedH = this.h;
611
+ this._savedA = this.a;
612
+ this._pendingL = this.l;
613
+ this._pendingC = this.c;
614
+ this._pendingH = this.h;
615
+ this._pendingA = this.a;
616
+ this._pendingConfirmed = false;
617
+ } else if (this.mode === `confirm` && !this._pendingConfirmed) this._pickerEl?.setColour(oklchToCss(this._savedL, this._savedC, this._savedH, this._savedA));
618
+ };
619
+ this._onPickerInput = (e) => {
620
+ e.stopPropagation();
621
+ const detail = e.detail;
622
+ if (this.mode === `confirm`) {
623
+ this._pendingL = detail.l;
624
+ this._pendingC = detail.c;
625
+ this._pendingH = detail.h;
626
+ this._pendingA = detail.a ?? 1;
627
+ return;
628
+ }
629
+ this.l = detail.l;
630
+ this.c = detail.c;
631
+ this.h = detail.h;
632
+ this.a = detail.a ?? 1;
633
+ this._dispatchInput();
634
+ };
635
+ this._onPickerChange = (e) => {
636
+ e.stopPropagation();
637
+ const detail = e.detail;
638
+ if (this.mode === `confirm`) {
639
+ this._pendingL = detail.l;
640
+ this._pendingC = detail.c;
641
+ this._pendingH = detail.h;
642
+ this._pendingA = detail.a ?? 1;
643
+ return;
644
+ }
645
+ this.l = detail.l;
646
+ this.c = detail.c;
647
+ this.h = detail.h;
648
+ this.a = detail.a ?? 1;
649
+ this._dispatchChange();
650
+ };
651
+ this._onConfirm = () => {
652
+ this.l = this._pendingL;
653
+ this.c = this._pendingC;
654
+ this.h = this._pendingH;
655
+ this.a = this._pendingA;
656
+ this._pendingConfirmed = true;
657
+ this._dispatchChange();
658
+ try {
659
+ this._popupEl.hidePopover();
660
+ } catch {}
661
+ };
662
+ this._onSwatchClick = async () => {
663
+ if (!this._everOpened) {
664
+ this._everOpened = true;
665
+ await this.updateComplete;
666
+ }
667
+ try {
668
+ this._popupEl.showPopover();
669
+ } catch {}
670
+ };
671
+ const id = ++_instanceCounter;
672
+ this._uid = `cp-popup-${id}`;
673
+ this._anchorName = `--cp-popup-anchor-${id}`;
674
+ this._popupId = `cp-popup-panel-${id}`;
675
+ }
676
+ get value() {
677
+ return oklchToCss(this.l, this.c, this.h, this.a);
678
+ }
679
+ get _innerHidePreview() {
680
+ if (this.mode === `fluid`) return !this.showPreview;
681
+ return false;
682
+ }
683
+ get _pickerDimensions() {
684
+ return PICKER_SIZES[this.size] ?? PICKER_SIZES.medium;
685
+ }
686
+ setColour(colour) {
687
+ const c = colour_exports.convert(colour, `oklch-absolute`);
688
+ this.l = c.l;
689
+ this.c = c.c;
690
+ this.h = c.h;
691
+ this.a = c.opacity ?? 1;
692
+ }
693
+ firstUpdated(changedProperties) {
694
+ super.firstUpdated(changedProperties);
695
+ this._applyAnchorPositioning();
696
+ this._updateSwatchBackground();
697
+ }
698
+ updated(changedProperties) {
699
+ super.updated(changedProperties);
700
+ if (changedProperties.has(`l`) || changedProperties.has(`c`) || changedProperties.has(`h`) || changedProperties.has(`a`)) this._updateSwatchBackground();
701
+ }
702
+ _applyAnchorPositioning() {
703
+ const swatch = this.shadowRoot?.querySelector(`.swatch`);
704
+ if (swatch) swatch.style.setProperty(`anchor-name`, this._anchorName);
705
+ if (this._popupEl) this._popupEl.style.setProperty(`position-anchor`, this._anchorName);
706
+ }
707
+ _updateSwatchBackground() {
708
+ const swatch = this.shadowRoot?.querySelector(`.swatch`);
709
+ if (swatch) swatch.style.background = swatchBackground(this.l, this.c, this.h, this.a);
710
+ }
711
+ _dispatchInput() {
712
+ const detail = {
713
+ l: this.l,
714
+ c: this.c,
715
+ h: this.h,
716
+ a: this.a
717
+ };
718
+ this.dispatchEvent(new CustomEvent(`input`, {
719
+ detail,
720
+ bubbles: true,
721
+ composed: true
722
+ }));
723
+ }
724
+ _dispatchChange() {
725
+ const detail = {
726
+ l: this.l,
727
+ c: this.c,
728
+ h: this.h,
729
+ a: this.a
730
+ };
731
+ this.dispatchEvent(new CustomEvent(`change`, {
732
+ detail,
733
+ bubbles: true,
734
+ composed: true
735
+ }));
736
+ }
737
+ render() {
738
+ return html`
739
+ <button
740
+ class="swatch"
741
+ @click=${this._onSwatchClick}
742
+ aria-label="Pick colour: ${this.value}"
743
+ aria-expanded="${this._isOpen}"
744
+ aria-haspopup="dialog"
745
+ ></button>
746
+ <div
747
+ id="${this._popupId}"
748
+ class="popup popup-surface"
749
+ popover="auto"
750
+ role="dialog"
751
+ aria-label="Colour picker"
752
+ style="--cp-popup-min-width:${this._pickerDimensions.width}px;--cp-popup-min-height:${this._pickerDimensions.height}px"
753
+ @toggle=${this._onPopoverToggle}
754
+ >
755
+ ${this._everOpened ? html`
756
+ <ixfx-colour-picker
757
+ .l=${this.l}
758
+ .c=${this.c}
759
+ .h=${this.h}
760
+ .a=${this.a}
761
+ style="width:${this._pickerDimensions.width}px;height:${this._pickerDimensions.height}px"
762
+ ?hide-preview=${this._innerHidePreview}
763
+ ?hide-h=${this.hideH}
764
+ ?hide-l=${this.hideL}
765
+ ?hide-c=${this.hideC}
766
+ ?show-a=${this.showA}
767
+ ?horizontal=${this.horizontal}
768
+ hide-tooltips
769
+ @input=${this._onPickerInput}
770
+ @change=${this._onPickerChange}
771
+ ></ixfx-colour-picker>
772
+ ${this.mode === `confirm` ? html`
773
+ <button class="confirm-btn" @click=${this._onConfirm} aria-label="Confirm colour" title="Confirm colour">
774
+ ${unsafeHTML(ICON_CHECK)}
775
+ </button>
776
+ ` : nothing}
777
+ ` : nothing}
778
+ </div>
779
+ `;
780
+ }
781
+ static {
782
+ this.styles = [popupSurfaceStyles, css`
783
+ :host {
784
+ display: inline-block;
785
+ }
786
+
787
+ .swatch {
788
+ display: inline-block;
789
+ width: var(--cp-popup-swatch-size, 1.5em);
790
+ height: var(--cp-popup-swatch-size, 1.5em);
791
+ border-radius: var(--radius-m, 4px);
792
+ border: 1px solid rgba(0, 0, 0, 0.2);
793
+ cursor: pointer;
794
+ padding: 0;
795
+ box-sizing: border-box;
796
+ vertical-align: middle;
797
+ transition: transform 0.1s ease, box-shadow 0.1s ease;
798
+ }
799
+
800
+ .swatch:hover {
801
+ transform: scale(1.1);
802
+ }
803
+
804
+ .swatch:focus-visible {
805
+ outline: 2px solid var(--accent, oklch(60% 0.15 140));
806
+ outline-offset: 2px;
807
+ }
808
+
809
+ /* Popover panel */
810
+ .popup {
811
+ display:flex;
812
+ flex-direction: column;
813
+ gap: var(--space-s);
814
+ /* Reset popover UA inset */
815
+ inset: unset;
816
+ margin: 0;
817
+
818
+ min-width: var(--cp-popup-min-width);
819
+ min-height: var(--cp-popup-min-height);
820
+
821
+ /* CSS anchor positioning — position-anchor set via inline style in JS */
822
+ position: fixed;
823
+ position-area: block-end span-inline-start;
824
+ position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
825
+ margin-block-start: 4px;
826
+
827
+ padding: var(--space-l);
828
+ z-index: 100;
829
+
830
+ /* Animate in/out */
831
+ opacity: 0;
832
+ scale: 0.97;
833
+ pointer-events: none;
834
+ transition: opacity 0.12s ease, scale 0.12s ease;
835
+ }
836
+
837
+ .popup:popover-open {
838
+ opacity: 1;
839
+ scale: 1;
840
+ pointer-events: auto;
841
+ }
842
+
843
+ ixfx-colour-picker {
844
+ display: block;
845
+ }
846
+
847
+ .confirm-btn {
848
+ display: flex;
849
+ align-items: center;
850
+ justify-content: center;
851
+ margin-block-start: var(--space-s);
852
+ margin-inline-start: auto;
853
+ width: 1.8em;
854
+ height: 1.8em;
855
+ border-radius: 50%;
856
+ border: none;
857
+ background: var(--accent, oklch(60% 0.15 140));
858
+ color: var(--accent-text, #fff);
859
+ padding: 0;
860
+ cursor: pointer;
861
+ transition: background var(--transition, 0.15s ease-out);
862
+ }
863
+
864
+ .confirm-btn svg {
865
+ width: 1.1em;
866
+ height: 1.1em;
867
+ flex-shrink: 0;
868
+ }
869
+
870
+ .confirm-btn:hover {
871
+ background: var(--accent, oklch(70% 0.15 140));
872
+ }
873
+
874
+ .confirm-btn:focus-visible {
875
+ outline: 2px solid var(--accent, oklch(60% 0.15 140));
876
+ outline-offset: 2px;
877
+ }
878
+ `];
879
+ }
880
+ };
881
+ __decorate([property({ type: String })], ColourPickerPopup.prototype, "mode", void 0);
882
+ __decorate([property({ type: Number })], ColourPickerPopup.prototype, "l", void 0);
883
+ __decorate([property({ type: Number })], ColourPickerPopup.prototype, "c", void 0);
884
+ __decorate([property({ type: Number })], ColourPickerPopup.prototype, "h", void 0);
885
+ __decorate([property({ type: Number })], ColourPickerPopup.prototype, "a", void 0);
886
+ __decorate([property({
887
+ type: Boolean,
888
+ attribute: `show-preview`
889
+ })], ColourPickerPopup.prototype, "showPreview", void 0);
890
+ __decorate([property({
891
+ type: Boolean,
892
+ attribute: `hide-h`,
893
+ reflect: true
894
+ })], ColourPickerPopup.prototype, "hideH", void 0);
895
+ __decorate([property({
896
+ type: Boolean,
897
+ attribute: `hide-l`,
898
+ reflect: true
899
+ })], ColourPickerPopup.prototype, "hideL", void 0);
900
+ __decorate([property({
901
+ type: Boolean,
902
+ attribute: `hide-c`,
903
+ reflect: true
904
+ })], ColourPickerPopup.prototype, "hideC", void 0);
905
+ __decorate([property({
906
+ type: Boolean,
907
+ attribute: `show-a`
908
+ })], ColourPickerPopup.prototype, "showA", void 0);
909
+ __decorate([property({
910
+ type: Boolean,
911
+ attribute: `horizontal`
912
+ })], ColourPickerPopup.prototype, "horizontal", void 0);
913
+ __decorate([property({ type: String })], ColourPickerPopup.prototype, "size", void 0);
914
+ __decorate([state()], ColourPickerPopup.prototype, "_isOpen", void 0);
915
+ __decorate([state()], ColourPickerPopup.prototype, "_everOpened", void 0);
916
+ __decorate([query(`.popup`)], ColourPickerPopup.prototype, "_popupEl", void 0);
917
+ __decorate([query(`ixfx-colour-picker`)], ColourPickerPopup.prototype, "_pickerEl", void 0);
918
+ ColourPickerPopup = __decorate([customElement(`ixfx-colour-picker-popup`)], ColourPickerPopup);
919
+ //#endregion
920
+ export { ColourPicker as n, ColourPickerPopup as t };
921
+
922
+ //# sourceMappingURL=colour-picker-Bw-AZoWx.js.map