@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16

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 (275) hide show
  1. package/components/accordion/index.cjs +183 -6
  2. package/components/accordion/index.js +136 -88
  3. package/components/action-bar/index.cjs +85 -4
  4. package/components/action-bar/index.js +72 -50
  5. package/components/action-button/index.cjs +205 -3
  6. package/components/action-button/index.js +167 -93
  7. package/components/action-group/index.cjs +7 -1
  8. package/components/action-group/index.js +12 -8
  9. package/components/action-group-DHp8RHDf.js +392 -0
  10. package/components/action-group-MPf19RPV.cjs +391 -0
  11. package/components/action-menu/index.cjs +91 -11
  12. package/components/action-menu/index.js +66 -47
  13. package/components/avatar/index.cjs +63 -3
  14. package/components/avatar/index.js +54 -42
  15. package/components/base-COw9n7UR.cjs +119 -0
  16. package/components/base-DmeVy0cq.js +120 -0
  17. package/components/button/index.cjs +134 -2
  18. package/components/button/index.js +106 -72
  19. package/components/button-base-7Ak55xFd.cjs +206 -0
  20. package/components/button-base-C3kf6BTK.js +207 -0
  21. package/components/button-group/index.cjs +45 -1
  22. package/components/button-group/index.js +37 -25
  23. package/components/calendar/index.cjs +632 -1
  24. package/components/calendar/index.js +637 -7
  25. package/components/checkbox/index.cjs +111 -4
  26. package/components/checkbox/index.js +98 -53
  27. package/components/checkbox-mixin-8cL-vfDy.js +84 -0
  28. package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
  29. package/components/clear-button-Co6oKSgl.js +59 -0
  30. package/components/clear-button-X_HDY2eH.cjs +58 -0
  31. package/components/close-button-DPBK6Kpu.cjs +59 -0
  32. package/components/close-button-Miw9ZjoJ.js +60 -0
  33. package/components/color-area/index.cjs +440 -13
  34. package/components/color-area/index.js +322 -187
  35. package/components/color-controller-BjDZaxhX.js +491 -0
  36. package/components/color-controller-C3c_vb2P.cjs +490 -0
  37. package/components/color-field/index.cjs +95 -2
  38. package/components/color-field/index.js +77 -41
  39. package/components/color-handle/index.cjs +64 -3
  40. package/components/color-handle/index.js +58 -37
  41. package/components/color-loupe/index.cjs +7 -1
  42. package/components/color-loupe/index.js +12 -8
  43. package/components/color-loupe-BQqNR8YD.cjs +88 -0
  44. package/components/color-loupe-B_DDFv8l.js +89 -0
  45. package/components/color-menu/index.cjs +217 -12
  46. package/components/color-menu/index.js +187 -93
  47. package/components/color-palette/index.cjs +89 -1
  48. package/components/color-palette/index.js +78 -51
  49. package/components/color-palette-group/index.cjs +259 -3
  50. package/components/color-palette-group/index.js +193 -105
  51. package/components/color-picker/index.cjs +114 -6
  52. package/components/color-picker/index.js +92 -72
  53. package/components/color-slider/index.cjs +585 -1
  54. package/components/color-slider/index.js +590 -7
  55. package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
  56. package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
  57. package/components/date-time-picker/index.cjs +1357 -31
  58. package/components/date-time-picker/index.js +951 -637
  59. package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
  60. package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
  61. package/components/divider/index.cjs +54 -1
  62. package/components/divider/index.js +49 -30
  63. package/components/divider.module-Cm5LcDRV.cjs +20 -0
  64. package/components/divider.module-DauH6k2_.js +21 -0
  65. package/components/element-resolution-DCsrhGZO.cjs +112 -0
  66. package/components/element-resolution-nMlmW4Jy.js +113 -0
  67. package/components/field-group/index.cjs +7 -1
  68. package/components/field-group/index.js +12 -8
  69. package/components/field-group-DNmY8W9v.cjs +86 -0
  70. package/components/field-group-DVdAWCQF.js +87 -0
  71. package/components/field-label/index.cjs +7 -1
  72. package/components/field-label/index.js +12 -8
  73. package/components/field-label-CKH9EXpR.cjs +156 -0
  74. package/components/field-label-Dpsecoc6.js +157 -0
  75. package/components/focus-group-BqDAk9Is.js +337 -0
  76. package/components/focus-group-DFzOlalL.cjs +336 -0
  77. package/components/focus-visible-B-B8-P9R.cjs +104 -0
  78. package/components/focus-visible-BUPRWlsh.js +105 -0
  79. package/components/focusable-BPrTcZPd.cjs +262 -0
  80. package/components/focusable-ChCLg1k4.js +263 -0
  81. package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
  82. package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
  83. package/components/icon/index.cjs +90 -1
  84. package/components/icon/index.js +74 -46
  85. package/components/index.cjs +174 -1
  86. package/components/index.js +174 -172
  87. package/components/infield-button/index.cjs +46 -2
  88. package/components/infield-button/index.js +41 -30
  89. package/components/label/index.cjs +37 -1
  90. package/components/label/index.js +36 -24
  91. package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
  92. package/components/language-resolution-iN9EImbb.cjs +57 -0
  93. package/components/like-anchor-D62faRNG.cjs +79 -0
  94. package/components/like-anchor-v3cJ9RWM.js +80 -0
  95. package/components/manage-help-text-BYx84zZR.cjs +125 -0
  96. package/components/manage-help-text-DOuMTGht.js +126 -0
  97. package/components/menu/index.cjs +1297 -29
  98. package/components/menu/index.js +954 -499
  99. package/components/multi-language-field/index.cjs +132 -2
  100. package/components/multi-language-field/index.js +118 -88
  101. package/components/number-field/index.cjs +613 -10
  102. package/components/number-field/index.js +442 -243
  103. package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
  104. package/components/observe-slot-presence-DcMdoumP.js +79 -0
  105. package/components/observe-slot-text-CSofZeeF.cjs +104 -0
  106. package/components/observe-slot-text-CjnkkBPn.js +105 -0
  107. package/components/options/index.cjs +693 -60
  108. package/components/options/index.js +519 -953
  109. package/components/overlay/index.cjs +367 -21
  110. package/components/overlay/index.js +273 -189
  111. package/components/overlay-CN8ISP1F.js +2485 -0
  112. package/components/overlay-LViy9VWM.cjs +2484 -0
  113. package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
  114. package/components/pending-state-e4RbXe9u.cjs +75 -0
  115. package/components/picker/index.cjs +9 -1
  116. package/components/picker/index.js +15 -11
  117. package/components/picker-DNde3awt.cjs +672 -0
  118. package/components/picker-PfUAF05y.js +673 -0
  119. package/components/picker-button/index.cjs +56 -4
  120. package/components/picker-button/index.js +45 -34
  121. package/components/platform-CxDar3Dn.cjs +68 -0
  122. package/components/platform-Cxn0WbyT.js +69 -0
  123. package/components/popover/index.cjs +7 -1
  124. package/components/popover/index.js +12 -8
  125. package/components/popover-BkbYhl3i.js +74 -0
  126. package/components/popover-BkgUf0kL.cjs +74 -0
  127. package/components/progress-circle/index.cjs +7 -1
  128. package/components/progress-circle/index.js +12 -8
  129. package/components/progress-circle-Hu_ivPHf.js +133 -0
  130. package/components/progress-circle-_Etqsj9f.cjs +132 -0
  131. package/components/radio/index.cjs +244 -2
  132. package/components/radio/index.js +192 -110
  133. package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
  134. package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
  135. package/components/roving-tabindex-AsmAh2In.cjs +95 -0
  136. package/components/roving-tabindex-DPF9NmrH.js +96 -0
  137. package/components/search/index.cjs +115 -8
  138. package/components/search/index.js +96 -66
  139. package/components/select/index.cjs +720 -51
  140. package/components/select/index.js +563 -347
  141. package/components/sized-mixin-DmkrNdWB.js +80 -0
  142. package/components/sized-mixin-UaTVa-AE.cjs +79 -0
  143. package/components/slider/index.cjs +119 -1
  144. package/components/slider/index.js +100 -1113
  145. package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
  146. package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
  147. package/components/strategies-DlMlaSJR.cjs +317 -0
  148. package/components/strategies-DlPQoTFE.js +318 -0
  149. package/components/streaming-listener-D4sHaMub.cjs +145 -0
  150. package/components/streaming-listener-cAz5zJyk.js +146 -0
  151. package/components/swatch/index.cjs +436 -7
  152. package/components/swatch/index.js +350 -205
  153. package/components/switch/index.cjs +61 -2
  154. package/components/switch/index.js +51 -34
  155. package/components/tabs/index.cjs +693 -26
  156. package/components/tabs/index.js +521 -388
  157. package/components/tags/index.cjs +201 -4
  158. package/components/tags/index.js +152 -87
  159. package/components/text-field/index.cjs +49 -3
  160. package/components/text-field/index.js +44 -30
  161. package/components/text-field-11tcnftU.cjs +338 -0
  162. package/components/text-field-Chi9J2Cz.js +339 -0
  163. package/components/text-field.module-CMBS0jSL.js +21 -0
  164. package/components/text-field.module-DIJdV_sA.cjs +20 -0
  165. package/components/toast/index.cjs +177 -12
  166. package/components/toast/index.js +145 -73
  167. package/components/tooltip/index.cjs +221 -6
  168. package/components/tooltip/index.js +156 -109
  169. package/components/unit-input/index.cjs +232 -8
  170. package/components/unit-input/index.js +201 -108
  171. package/components/utils.cjs +25 -1
  172. package/components/utils.js +22 -22
  173. package/package.json +1 -1
  174. package/components/NumberFormatter-DewVDY5w.cjs +0 -18
  175. package/components/NumberFormatter-DgOUVrge.js +0 -136
  176. package/components/NumberParser-Dik4a0h-.cjs +0 -18
  177. package/components/NumberParser-ci9J5EKv.js +0 -173
  178. package/components/action-group-DBImibFn.js +0 -258
  179. package/components/action-group-DJGMcRHb.cjs +0 -20
  180. package/components/async-directive-BX1T1e1_.cjs +0 -22
  181. package/components/async-directive-BfcqVjDp.js +0 -82
  182. package/components/base-BjTwmyRF.cjs +0 -22
  183. package/components/base-CBCg3yyw.cjs +0 -40
  184. package/components/base-D76d76ww.js +0 -26
  185. package/components/base-WsynuqaS.js +0 -677
  186. package/components/button-base-DbkDzb71.js +0 -144
  187. package/components/button-base-XgPLmwP-.cjs +0 -25
  188. package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
  189. package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
  190. package/components/class-map-Di1D_rCm.cjs +0 -22
  191. package/components/class-map-NbVXqBU0.js +0 -51
  192. package/components/clear-button-DQcRdcUa.js +0 -53
  193. package/components/clear-button-OFUFFe7G.cjs +0 -18
  194. package/components/close-button-Cbnb7XXj.cjs +0 -18
  195. package/components/close-button-CqHYZhum.js +0 -51
  196. package/components/color-controller-B0uX6Zso.js +0 -3230
  197. package/components/color-controller-CoUL5f9K.cjs +0 -18
  198. package/components/color-loupe-CaA_Lfkk.cjs +0 -56
  199. package/components/color-loupe-CmMsXbjT.js +0 -81
  200. package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
  201. package/components/dependency-manger-C5HCkMMB.cjs +0 -18
  202. package/components/directive-helpers-Cm6gitnu.js +0 -62
  203. package/components/directive-helpers-DyIRTWwA.cjs +0 -22
  204. package/components/divider.module-DDvBo9zo.cjs +0 -18
  205. package/components/divider.module-DoQWQEIJ.js +0 -21
  206. package/components/element-resolution-BvRLGqIU.cjs +0 -18
  207. package/components/element-resolution-FCUT-wql.js +0 -91
  208. package/components/field-group-DXfBWrkO.js +0 -66
  209. package/components/field-group-DkGst3r5.cjs +0 -23
  210. package/components/field-label-CZ2zzChK.js +0 -106
  211. package/components/field-label-mO1AkUgR.cjs +0 -25
  212. package/components/flow-D-0MTYCm.js +0 -527
  213. package/components/flow-DM3dNAKs.cjs +0 -30
  214. package/components/focus-group-DHeTq18L.js +0 -218
  215. package/components/focus-group-DnxZUBhQ.cjs +0 -18
  216. package/components/focus-visible-B0P9aY_G.cjs +0 -18
  217. package/components/focus-visible-DBlJGoEW.js +0 -74
  218. package/components/focusable-BxtpnzWp.js +0 -153
  219. package/components/focusable-EbipgXRh.cjs +0 -18
  220. package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
  221. package/components/if-defined-C9YGdo33.cjs +0 -22
  222. package/components/if-defined-DOaE2coe.js +0 -27
  223. package/components/index-BwxgAdzi.cjs +0 -57
  224. package/components/index-Cl54m8Yh.js +0 -1490
  225. package/components/index-HjQa8tew.js +0 -1174
  226. package/components/index-Wq3qZJGh.cjs +0 -113
  227. package/components/language-resolution-DJzmyzZq.cjs +0 -18
  228. package/components/like-anchor-Bvn_vLQ8.js +0 -69
  229. package/components/like-anchor-sod1C1fR.cjs +0 -32
  230. package/components/luzmo-icons-4nDFv1Lq.js +0 -229
  231. package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
  232. package/components/manage-help-text-DhgARkZX.cjs +0 -30
  233. package/components/manage-help-text-syYnjKGL.js +0 -92
  234. package/components/mutation-controller-DH7YOCyj.js +0 -52
  235. package/components/mutation-controller-DkOMCW-c.cjs +0 -22
  236. package/components/observe-slot-presence-CmVi0zTc.js +0 -68
  237. package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
  238. package/components/observe-slot-text-BPfIQQtz.js +0 -87
  239. package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
  240. package/components/overlay-Cig9r6uU.js +0 -2747
  241. package/components/overlay-KSKMzzkh.cjs +0 -47
  242. package/components/pending-state-CaH1si5b.cjs +0 -26
  243. package/components/picker-BfBP7XJN.js +0 -461
  244. package/components/picker-xIphqE6d.cjs +0 -123
  245. package/components/platform-BM-uMWpX.js +0 -69
  246. package/components/platform-BiXhwqk3.cjs +0 -18
  247. package/components/popover-DjX0aAnY.js +0 -67
  248. package/components/popover-KFfO0IYL.cjs +0 -30
  249. package/components/progress-circle-BvRJNuNo.cjs +0 -33
  250. package/components/progress-circle-DXH9z8-6.js +0 -97
  251. package/components/query-BL-TJj7K.cjs +0 -22
  252. package/components/query-D_KR_GUc.js +0 -51
  253. package/components/query-assigned-elements-DjfhL1cl.js +0 -36
  254. package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
  255. package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
  256. package/components/query-assigned-nodes-C76XVPWY.js +0 -36
  257. package/components/random-id-CqvckpWe.cjs +0 -18
  258. package/components/roving-tabindex-By_fCy_e.cjs +0 -18
  259. package/components/roving-tabindex-DOg4z6ZU.js +0 -66
  260. package/components/sized-mixin-CPxE5C96.cjs +0 -18
  261. package/components/sized-mixin-D4ACoVUr.js +0 -63
  262. package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
  263. package/components/state-D8JEtYqe.cjs +0 -22
  264. package/components/state-Deh-vKYE.js +0 -29
  265. package/components/strategies-9indNIEb.js +0 -195
  266. package/components/strategies-BACP6MhR.cjs +0 -18
  267. package/components/streaming-listener-B00MvALi.cjs +0 -18
  268. package/components/streaming-listener-CP-JE6Fa.js +0 -91
  269. package/components/style-map-CeilmSgs.cjs +0 -22
  270. package/components/style-map-IgqIKvlE.js +0 -53
  271. package/components/text-field-CeG75PPO.cjs +0 -85
  272. package/components/text-field-DCl-AFM-.js +0 -314
  273. package/components/text-field.module-C2KVUJcX.js +0 -21
  274. package/components/text-field.module-DXhFA9G-.cjs +0 -18
  275. package/components/when-CDZyJPvd.cjs +0 -22
@@ -0,0 +1,104 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ "use strict";
19
+ let hasFocusVisible = true;
20
+ try {
21
+ if (typeof document !== "undefined") {
22
+ document.body.querySelector(":focus-visible");
23
+ }
24
+ } catch {
25
+ hasFocusVisible = false;
26
+ Promise.resolve().then(() => focusVisible);
27
+ }
28
+ const FocusVisiblePolyfillMixin = (SuperClass) => {
29
+ var _a, _b;
30
+ const coordinateWithPolyfill = (instance) => {
31
+ if (instance.shadowRoot == null || Object.hasOwn(instance.dataset, "jsFocusVisible")) {
32
+ return () => {
33
+ };
34
+ }
35
+ if (self.applyFocusVisiblePolyfill) {
36
+ self.applyFocusVisiblePolyfill(instance.shadowRoot);
37
+ if (instance.manageAutoFocus) {
38
+ instance.manageAutoFocus();
39
+ }
40
+ } else {
41
+ const coordinationHandler = () => {
42
+ if (self.applyFocusVisiblePolyfill && instance.shadowRoot) {
43
+ self.applyFocusVisiblePolyfill(instance.shadowRoot);
44
+ }
45
+ if (instance.manageAutoFocus) {
46
+ instance.manageAutoFocus();
47
+ }
48
+ };
49
+ self.addEventListener(
50
+ "focus-visible-polyfill-ready",
51
+ coordinationHandler,
52
+ { once: true }
53
+ );
54
+ return () => {
55
+ self.removeEventListener(
56
+ "focus-visible-polyfill-ready",
57
+ coordinationHandler
58
+ );
59
+ };
60
+ }
61
+ return () => {
62
+ };
63
+ };
64
+ const $endPolyfillCoordination = Symbol("endPolyfillCoordination");
65
+ class FocusVisibleCoordinator extends (_b = SuperClass, _a = $endPolyfillCoordination, _b) {
66
+ constructor() {
67
+ super(...arguments);
68
+ this[_a] = null;
69
+ }
70
+ // Attempt to coordinate with the polyfill when connected to the
71
+ // document:
72
+ connectedCallback() {
73
+ if (super.connectedCallback) {
74
+ super.connectedCallback();
75
+ }
76
+ if (!hasFocusVisible) {
77
+ requestAnimationFrame(() => {
78
+ if (this[$endPolyfillCoordination] == null) {
79
+ this[$endPolyfillCoordination] = coordinateWithPolyfill(this);
80
+ }
81
+ });
82
+ }
83
+ }
84
+ disconnectedCallback() {
85
+ if (super.disconnectedCallback) {
86
+ super.disconnectedCallback();
87
+ }
88
+ if (!hasFocusVisible) {
89
+ requestAnimationFrame(() => {
90
+ if (this[$endPolyfillCoordination] != null) {
91
+ this[$endPolyfillCoordination]();
92
+ this[$endPolyfillCoordination] = null;
93
+ }
94
+ });
95
+ }
96
+ }
97
+ }
98
+ return FocusVisibleCoordinator;
99
+ };
100
+ const focusVisible = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
+ __proto__: null,
102
+ FocusVisiblePolyfillMixin
103
+ }, Symbol.toStringTag, { value: "Module" }));
104
+ exports.FocusVisiblePolyfillMixin = FocusVisiblePolyfillMixin;
@@ -0,0 +1,105 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ let hasFocusVisible = true;
19
+ try {
20
+ if (typeof document !== "undefined") {
21
+ document.body.querySelector(":focus-visible");
22
+ }
23
+ } catch {
24
+ hasFocusVisible = false;
25
+ Promise.resolve().then(() => focusVisible);
26
+ }
27
+ const FocusVisiblePolyfillMixin = (SuperClass) => {
28
+ var _a, _b;
29
+ const coordinateWithPolyfill = (instance) => {
30
+ if (instance.shadowRoot == null || Object.hasOwn(instance.dataset, "jsFocusVisible")) {
31
+ return () => {
32
+ };
33
+ }
34
+ if (self.applyFocusVisiblePolyfill) {
35
+ self.applyFocusVisiblePolyfill(instance.shadowRoot);
36
+ if (instance.manageAutoFocus) {
37
+ instance.manageAutoFocus();
38
+ }
39
+ } else {
40
+ const coordinationHandler = () => {
41
+ if (self.applyFocusVisiblePolyfill && instance.shadowRoot) {
42
+ self.applyFocusVisiblePolyfill(instance.shadowRoot);
43
+ }
44
+ if (instance.manageAutoFocus) {
45
+ instance.manageAutoFocus();
46
+ }
47
+ };
48
+ self.addEventListener(
49
+ "focus-visible-polyfill-ready",
50
+ coordinationHandler,
51
+ { once: true }
52
+ );
53
+ return () => {
54
+ self.removeEventListener(
55
+ "focus-visible-polyfill-ready",
56
+ coordinationHandler
57
+ );
58
+ };
59
+ }
60
+ return () => {
61
+ };
62
+ };
63
+ const $endPolyfillCoordination = Symbol("endPolyfillCoordination");
64
+ class FocusVisibleCoordinator extends (_b = SuperClass, _a = $endPolyfillCoordination, _b) {
65
+ constructor() {
66
+ super(...arguments);
67
+ this[_a] = null;
68
+ }
69
+ // Attempt to coordinate with the polyfill when connected to the
70
+ // document:
71
+ connectedCallback() {
72
+ if (super.connectedCallback) {
73
+ super.connectedCallback();
74
+ }
75
+ if (!hasFocusVisible) {
76
+ requestAnimationFrame(() => {
77
+ if (this[$endPolyfillCoordination] == null) {
78
+ this[$endPolyfillCoordination] = coordinateWithPolyfill(this);
79
+ }
80
+ });
81
+ }
82
+ }
83
+ disconnectedCallback() {
84
+ if (super.disconnectedCallback) {
85
+ super.disconnectedCallback();
86
+ }
87
+ if (!hasFocusVisible) {
88
+ requestAnimationFrame(() => {
89
+ if (this[$endPolyfillCoordination] != null) {
90
+ this[$endPolyfillCoordination]();
91
+ this[$endPolyfillCoordination] = null;
92
+ }
93
+ });
94
+ }
95
+ }
96
+ }
97
+ return FocusVisibleCoordinator;
98
+ };
99
+ const focusVisible = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
100
+ __proto__: null,
101
+ FocusVisiblePolyfillMixin
102
+ }, Symbol.toStringTag, { value: "Module" }));
103
+ export {
104
+ FocusVisiblePolyfillMixin as F
105
+ };
@@ -0,0 +1,262 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ "use strict";
19
+ const decorators_js = require("lit/decorators.js");
20
+ const base = require("./base-COw9n7UR.cjs");
21
+ const focusVisible = require("./focus-visible-B-B8-P9R.cjs");
22
+ var __defProp = Object.defineProperty;
23
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
24
+ var __decorateClass = (decorators, target, key, kind) => {
25
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
26
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
27
+ if (decorator = decorators[i])
28
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
+ if (kind && result) __defProp(target, key, result);
30
+ return result;
31
+ };
32
+ function nextFrame() {
33
+ return new Promise((res) => requestAnimationFrame(() => res()));
34
+ }
35
+ class Focusable extends focusVisible.FocusVisiblePolyfillMixin(base.LuzmoElement) {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.disabled = false;
39
+ this.autofocus = false;
40
+ this._tabIndex = 0;
41
+ this.manipulatingTabindex = false;
42
+ this.autofocusReady = Promise.resolve();
43
+ }
44
+ get tabIndex() {
45
+ if (this.focusElement === this) {
46
+ const tabindex = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : Number.NaN;
47
+ return Number.isNaN(tabindex) ? -1 : tabindex;
48
+ }
49
+ const tabIndexAttribute = Number.parseFloat(
50
+ this.hasAttribute("tabindex") ? this.getAttribute("tabindex") || "0" : "0"
51
+ );
52
+ if (this.disabled || tabIndexAttribute < 0) {
53
+ return -1;
54
+ }
55
+ if (!this.focusElement) {
56
+ return tabIndexAttribute;
57
+ }
58
+ return this._tabIndex;
59
+ }
60
+ set tabIndex(tabIndex) {
61
+ var _a;
62
+ if (this.manipulatingTabindex) {
63
+ this.manipulatingTabindex = false;
64
+ return;
65
+ }
66
+ if (this.focusElement === this) {
67
+ if (this.disabled) {
68
+ this._tabIndex = tabIndex;
69
+ } else if (tabIndex !== this._tabIndex) {
70
+ this._tabIndex = tabIndex;
71
+ const tabindex = "" + tabIndex;
72
+ this.manipulatingTabindex = true;
73
+ this.setAttribute("tabindex", tabindex);
74
+ }
75
+ return;
76
+ }
77
+ if (tabIndex === -1) {
78
+ this.addEventListener(
79
+ "pointerdown",
80
+ this.onPointerdownManagementOfTabIndex
81
+ );
82
+ } else {
83
+ this.manipulatingTabindex = true;
84
+ this.removeEventListener(
85
+ "pointerdown",
86
+ this.onPointerdownManagementOfTabIndex
87
+ );
88
+ }
89
+ if (tabIndex === -1 || this.disabled) {
90
+ this.manipulatingTabindex = true;
91
+ this.setAttribute("tabindex", "-1");
92
+ this.removeAttribute("focusable");
93
+ if (this.selfManageFocusElement) {
94
+ return;
95
+ }
96
+ if (tabIndex === -1) {
97
+ (_a = this.focusElement) == null ? void 0 : _a.removeAttribute("tabindex");
98
+ } else {
99
+ this._tabIndex = tabIndex;
100
+ this.manageFocusElementTabindex(tabIndex);
101
+ }
102
+ return;
103
+ }
104
+ this.setAttribute("focusable", "");
105
+ if (this.hasAttribute("tabindex")) {
106
+ this.removeAttribute("tabindex");
107
+ } else {
108
+ this.manipulatingTabindex = false;
109
+ }
110
+ this._tabIndex = tabIndex;
111
+ this.manageFocusElementTabindex(tabIndex);
112
+ }
113
+ onPointerdownManagementOfTabIndex() {
114
+ if (this.tabIndex === -1) {
115
+ setTimeout(() => {
116
+ this.tabIndex = 0;
117
+ this.focus({ preventScroll: true });
118
+ this.tabIndex = -1;
119
+ });
120
+ }
121
+ }
122
+ async manageFocusElementTabindex(tabIndex) {
123
+ if (!this.focusElement) {
124
+ await this.updateComplete;
125
+ }
126
+ if (tabIndex === null) {
127
+ this.focusElement.removeAttribute("tabindex");
128
+ } else {
129
+ if (this.focusElement !== this) {
130
+ this.focusElement.tabIndex = tabIndex;
131
+ }
132
+ }
133
+ }
134
+ /**
135
+ * @private
136
+ */
137
+ get focusElement() {
138
+ throw new Error("Must implement focusElement getter!");
139
+ }
140
+ /**
141
+ * @public
142
+ * @returns whether the component should manage its focusElement tab-index or not
143
+ * Needed for action-menu to be supported in action-group in an accessible way
144
+ */
145
+ get selfManageFocusElement() {
146
+ return false;
147
+ }
148
+ focus(options) {
149
+ if (this.disabled || !this.focusElement) {
150
+ return;
151
+ }
152
+ if (this.focusElement === this) {
153
+ Reflect.apply(HTMLElement.prototype.focus, this, [options]);
154
+ } else {
155
+ this.focusElement.focus(options);
156
+ }
157
+ }
158
+ blur() {
159
+ const focusElement = this.focusElement || this;
160
+ if (focusElement === this) {
161
+ HTMLElement.prototype.blur.apply(this);
162
+ } else {
163
+ focusElement.blur();
164
+ }
165
+ }
166
+ click() {
167
+ if (this.disabled) {
168
+ return;
169
+ }
170
+ const focusElement = this.focusElement || this;
171
+ if (focusElement === this) {
172
+ HTMLElement.prototype.click.apply(this);
173
+ } else {
174
+ focusElement.click();
175
+ }
176
+ }
177
+ manageAutoFocus() {
178
+ if (this.autofocus) {
179
+ this.dispatchEvent(
180
+ new KeyboardEvent("keydown", {
181
+ code: "Tab"
182
+ })
183
+ );
184
+ this.focusElement.focus();
185
+ }
186
+ }
187
+ firstUpdated(changes) {
188
+ super.firstUpdated(changes);
189
+ if (!this.hasAttribute("tabindex") || this.getAttribute("tabindex") !== "-1") {
190
+ this.setAttribute("focusable", "");
191
+ }
192
+ }
193
+ update(changedProperties) {
194
+ if (changedProperties.has("disabled")) {
195
+ this.handleDisabledChanged(
196
+ this.disabled,
197
+ changedProperties.get("disabled")
198
+ );
199
+ }
200
+ super.update(changedProperties);
201
+ }
202
+ updated(changedProperties) {
203
+ super.updated(changedProperties);
204
+ if (changedProperties.has("disabled") && this.disabled) {
205
+ this.blur();
206
+ }
207
+ }
208
+ async handleDisabledChanged(disabled, oldDisabled) {
209
+ const canSetDisabled = () => this.focusElement !== this && this.focusElement.disabled !== void 0;
210
+ if (disabled) {
211
+ this.manipulatingTabindex = true;
212
+ this.setAttribute("tabindex", "-1");
213
+ await this.updateComplete;
214
+ if (canSetDisabled()) {
215
+ this.focusElement.disabled = true;
216
+ } else {
217
+ this.setAttribute("aria-disabled", "true");
218
+ }
219
+ } else if (oldDisabled) {
220
+ this.manipulatingTabindex = true;
221
+ if (this.focusElement === this) {
222
+ this.setAttribute("tabindex", "" + this._tabIndex);
223
+ } else {
224
+ this.removeAttribute("tabindex");
225
+ }
226
+ await this.updateComplete;
227
+ if (canSetDisabled()) {
228
+ this.focusElement.disabled = false;
229
+ } else {
230
+ this.removeAttribute("aria-disabled");
231
+ }
232
+ }
233
+ }
234
+ async getUpdateComplete() {
235
+ const complete = await super.getUpdateComplete();
236
+ await this.autofocusReady;
237
+ return complete;
238
+ }
239
+ connectedCallback() {
240
+ super.connectedCallback();
241
+ if (this.autofocus) {
242
+ this.autofocusReady = new Promise(async (res) => {
243
+ await nextFrame();
244
+ await nextFrame();
245
+ res();
246
+ });
247
+ this.updateComplete.then(() => {
248
+ this.manageAutoFocus();
249
+ });
250
+ }
251
+ }
252
+ }
253
+ __decorateClass([
254
+ decorators_js.property({ type: Boolean, reflect: true })
255
+ ], Focusable.prototype, "disabled", 2);
256
+ __decorateClass([
257
+ decorators_js.property({ type: Boolean })
258
+ ], Focusable.prototype, "autofocus", 2);
259
+ __decorateClass([
260
+ decorators_js.property({ type: Number })
261
+ ], Focusable.prototype, "tabIndex", 1);
262
+ exports.Focusable = Focusable;