@luzmo/lucero 1.0.1-alpha.18 → 1.0.1-alpha.19

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/NumberFormatter-DewVDY5w.cjs +18 -0
  2. package/components/NumberFormatter-DgOUVrge.js +136 -0
  3. package/components/NumberParser-Dik4a0h-.cjs +18 -0
  4. package/components/NumberParser-ci9J5EKv.js +173 -0
  5. package/components/accordion/index.cjs +6 -183
  6. package/components/accordion/index.js +88 -136
  7. package/components/action-bar/index.cjs +4 -85
  8. package/components/action-bar/index.js +50 -72
  9. package/components/action-button/index.cjs +3 -205
  10. package/components/action-button/index.js +93 -167
  11. package/components/action-group/index.cjs +1 -7
  12. package/components/action-group/index.js +8 -12
  13. package/components/action-group-C54IxNZk.cjs +20 -0
  14. package/components/action-group-C9dsPJg-.js +258 -0
  15. package/components/action-menu/index.cjs +11 -91
  16. package/components/action-menu/index.js +47 -66
  17. package/components/async-directive-BwIAw5tB.js +82 -0
  18. package/components/async-directive-DLz6JB0v.cjs +22 -0
  19. package/components/avatar/index.cjs +3 -63
  20. package/components/avatar/index.js +42 -54
  21. package/components/{focusable-selectors-D0t_5P7C.cjs → base-BjTwmyRF.cjs} +5 -16
  22. package/components/base-CFWO09N1.js +684 -0
  23. package/components/base-Cy0MQrPT.cjs +40 -0
  24. package/components/base-D76d76ww.js +26 -0
  25. package/components/button/index.cjs +2 -134
  26. package/components/button/index.js +72 -106
  27. package/components/button-base-B8bWcklV.js +144 -0
  28. package/components/button-base-tf95Lyl4.cjs +25 -0
  29. package/components/button-group/index.cjs +1 -45
  30. package/components/button-group/index.js +25 -37
  31. package/components/calendar/index.cjs +1 -632
  32. package/components/calendar/index.js +7 -637
  33. package/components/checkbox/index.cjs +4 -111
  34. package/components/checkbox/index.js +53 -98
  35. package/components/checkbox-mixin-BOTvuPEu.js +70 -0
  36. package/components/checkbox-mixin-BVPpXtsq.cjs +27 -0
  37. package/components/class-map-CGfNk3Ee.js +51 -0
  38. package/components/class-map-D-Y-hsN5.cjs +22 -0
  39. package/components/clear-button-CuPbWwZY.cjs +18 -0
  40. package/components/clear-button-DzZ5ulBW.js +53 -0
  41. package/components/close-button-BTo4yrFR.cjs +18 -0
  42. package/components/close-button-CuQdsez5.js +51 -0
  43. package/components/color-area/index.cjs +13 -440
  44. package/components/color-area/index.js +187 -322
  45. package/components/color-controller-B0uX6Zso.js +3230 -0
  46. package/components/color-controller-CoUL5f9K.cjs +18 -0
  47. package/components/color-field/index.cjs +2 -95
  48. package/components/color-field/index.js +41 -77
  49. package/components/color-handle/index.cjs +3 -64
  50. package/components/color-handle/index.js +37 -58
  51. package/components/color-loupe/index.cjs +1 -7
  52. package/components/color-loupe/index.js +8 -12
  53. package/components/color-loupe-CrM2DVY3.cjs +56 -0
  54. package/components/color-loupe-DmQe3SpP.js +81 -0
  55. package/components/color-menu/index.cjs +12 -217
  56. package/components/color-menu/index.js +93 -187
  57. package/components/color-palette/index.cjs +1 -89
  58. package/components/color-palette/index.js +51 -78
  59. package/components/color-palette-group/index.cjs +3 -259
  60. package/components/color-palette-group/index.js +105 -193
  61. package/components/color-picker/index.cjs +6 -114
  62. package/components/color-picker/index.js +72 -92
  63. package/components/color-slider/index.cjs +1 -585
  64. package/components/color-slider/index.js +7 -590
  65. package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  66. package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  67. package/components/date-time-picker/index.cjs +31 -1357
  68. package/components/date-time-picker/index.js +637 -951
  69. package/components/{dependency-manger-XHpQjFgK.js → dependency-manger-CO-VPlqq.js} +14 -24
  70. package/components/dependency-manger-uthev62E.cjs +18 -0
  71. package/components/directive-C7oCP5Bh.cjs +22 -0
  72. package/components/directive-helpers-D4KMv2dC.js +62 -0
  73. package/components/directive-helpers-t-TVum7J.cjs +22 -0
  74. package/components/{slottable-request-event-CANixJnR.cjs → directive-oAbCiebi.js} +25 -14
  75. package/components/divider/index.cjs +1 -54
  76. package/components/divider/index.js +30 -49
  77. package/components/divider.module-DDvBo9zo.cjs +18 -0
  78. package/components/divider.module-DoQWQEIJ.js +21 -0
  79. package/components/element-resolution-BvRLGqIU.cjs +18 -0
  80. package/components/element-resolution-FCUT-wql.js +91 -0
  81. package/components/field-group/index.cjs +1 -7
  82. package/components/field-group/index.js +8 -12
  83. package/components/field-group-5WQMBOk4.cjs +23 -0
  84. package/components/field-group-D4B0IOdA.js +66 -0
  85. package/components/field-label/index.cjs +1 -7
  86. package/components/field-label/index.js +8 -12
  87. package/components/field-label-DxmPiC5p.js +106 -0
  88. package/components/field-label-Dz9kisdW.cjs +25 -0
  89. package/components/flow-D-0MTYCm.js +527 -0
  90. package/components/flow-DM3dNAKs.cjs +30 -0
  91. package/components/focus-group-DHeTq18L.js +218 -0
  92. package/components/focus-group-DnxZUBhQ.cjs +18 -0
  93. package/components/focus-visible-BvScGDCE.js +74 -0
  94. package/components/focus-visible-D4BXb5RB.cjs +18 -0
  95. package/components/focusable-B_KwfEec.cjs +18 -0
  96. package/components/focusable-C5JjRZmT.js +153 -0
  97. package/components/{focusable-selectors-IltOAOd9.js → focusable-selectors-B4YgbghQ.js} +4 -7
  98. package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
  99. package/components/icon/index.cjs +1 -90
  100. package/components/icon/index.js +46 -74
  101. package/components/if-defined-DULpqYwi.js +27 -0
  102. package/components/if-defined-DaXWqfzc.cjs +22 -0
  103. package/components/index-CNK8wHXu.cjs +57 -0
  104. package/components/index-Cf6G4q52.js +1490 -0
  105. package/components/index-D3ICqC7S.js +1174 -0
  106. package/components/index-hqVbNKYy.cjs +113 -0
  107. package/components/index.cjs +1 -174
  108. package/components/index.js +172 -174
  109. package/components/infield-button/index.cjs +2 -46
  110. package/components/infield-button/index.js +30 -41
  111. package/components/label/index.cjs +1 -37
  112. package/components/label/index.js +24 -36
  113. package/components/{language-resolution-BSGJAWiQ.js → language-resolution-B-wjV5bb.js} +17 -21
  114. package/components/language-resolution-EUER43cg.cjs +18 -0
  115. package/components/like-anchor-Bu3pXbjT.cjs +32 -0
  116. package/components/like-anchor-DCFJN0LV.js +69 -0
  117. package/components/luzmo-icons-CiSek5iM.js +229 -0
  118. package/components/luzmo-icons-CtA-TJPd.cjs +29 -0
  119. package/components/manage-help-text-CHfMLzSa.js +92 -0
  120. package/components/manage-help-text-DNqdEkTA.cjs +30 -0
  121. package/components/menu/index.cjs +29 -1297
  122. package/components/menu/index.js +499 -954
  123. package/components/multi-language-field/index.cjs +2 -132
  124. package/components/multi-language-field/index.js +88 -118
  125. package/components/mutation-controller-DH7YOCyj.js +52 -0
  126. package/components/mutation-controller-DkOMCW-c.cjs +22 -0
  127. package/components/number-field/index.cjs +10 -613
  128. package/components/number-field/index.js +243 -442
  129. package/components/observe-slot-presence-CmVi0zTc.js +68 -0
  130. package/components/observe-slot-presence-bc9chhsi.cjs +18 -0
  131. package/components/observe-slot-text-C3moTjwy.js +87 -0
  132. package/components/observe-slot-text-D2VAEFSd.cjs +18 -0
  133. package/components/options/index.cjs +60 -693
  134. package/components/options/index.js +953 -519
  135. package/components/overlay/index.cjs +21 -367
  136. package/components/overlay/index.js +189 -273
  137. package/components/overlay-B3ajDLLq.cjs +47 -0
  138. package/components/overlay-CUKs69yr.js +2745 -0
  139. package/components/{pending-state-CXbe-Xul.js → pending-state-B2wWssTo.js} +13 -28
  140. package/components/pending-state-bJr-nEJl.cjs +26 -0
  141. package/components/picker/index.cjs +1 -9
  142. package/components/picker/index.js +11 -15
  143. package/components/picker-C0LvseZe.cjs +123 -0
  144. package/components/picker-W1qNmtsh.js +461 -0
  145. package/components/picker-button/index.cjs +4 -56
  146. package/components/picker-button/index.js +34 -45
  147. package/components/{condition-attribute-with-id-Cn815e9W.js → platform-BM-uMWpX.js} +49 -24
  148. package/components/platform-BiXhwqk3.cjs +18 -0
  149. package/components/popover/index.cjs +1 -7
  150. package/components/popover/index.js +8 -12
  151. package/components/popover-fwJeZHMQ.cjs +30 -0
  152. package/components/popover-iD8f5Jkp.js +67 -0
  153. package/components/progress-circle/index.cjs +1 -7
  154. package/components/progress-circle/index.js +8 -12
  155. package/components/progress-circle-DZxaMe8L.cjs +33 -0
  156. package/components/progress-circle-USIIU1up.js +97 -0
  157. package/components/query-BL-TJj7K.cjs +22 -0
  158. package/components/query-D_KR_GUc.js +51 -0
  159. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  160. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  161. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  162. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  163. package/components/radio/index.cjs +2 -244
  164. package/components/radio/index.js +110 -192
  165. package/components/{random-id-BEc6QIUL.js → random-id-ByCz1xaq.js} +3 -3
  166. package/components/random-id-CqvckpWe.cjs +18 -0
  167. package/components/roving-tabindex-By_fCy_e.cjs +18 -0
  168. package/components/roving-tabindex-DOg4z6ZU.js +66 -0
  169. package/components/search/index.cjs +8 -115
  170. package/components/search/index.js +66 -96
  171. package/components/select/index.cjs +51 -720
  172. package/components/select/index.js +347 -563
  173. package/components/sized-mixin-CJbBHWRQ.js +63 -0
  174. package/components/sized-mixin-WPHH0a_D.cjs +18 -0
  175. package/components/slider/index.cjs +1 -119
  176. package/components/slider/index.js +1113 -100
  177. package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
  178. package/components/{slottable-request-event-D9WzrdWv.js → slottable-request-event-DggLA4Rx.js} +9 -12
  179. package/components/state-DwIwYPvt.js +29 -0
  180. package/components/state-vf0PJN3_.cjs +22 -0
  181. package/components/strategies-C6HsQpU2.cjs +18 -0
  182. package/components/strategies-CUMLHtQI.js +195 -0
  183. package/components/streaming-listener-BQ68fKMa.js +91 -0
  184. package/components/streaming-listener-DeGQYM-9.cjs +18 -0
  185. package/components/style-map-Bnhf_mVZ.js +53 -0
  186. package/components/style-map-DuMd5xlY.cjs +22 -0
  187. package/components/swatch/index.cjs +7 -436
  188. package/components/swatch/index.js +205 -350
  189. package/components/switch/index.cjs +2 -61
  190. package/components/switch/index.js +34 -51
  191. package/components/tabs/index.cjs +26 -693
  192. package/components/tabs/index.js +388 -521
  193. package/components/tags/index.cjs +4 -201
  194. package/components/tags/index.js +87 -152
  195. package/components/text-field/index.cjs +3 -49
  196. package/components/text-field/index.js +30 -44
  197. package/components/text-field-BkFPYo7S.cjs +85 -0
  198. package/components/text-field-C2n3rzCK.js +314 -0
  199. package/components/text-field.module-C2KVUJcX.js +21 -0
  200. package/components/text-field.module-DXhFA9G-.cjs +18 -0
  201. package/components/toast/index.cjs +12 -177
  202. package/components/toast/index.js +73 -145
  203. package/components/tooltip/index.cjs +6 -250
  204. package/components/tooltip/index.js +124 -177
  205. package/components/unit-input/index.cjs +8 -232
  206. package/components/unit-input/index.js +108 -201
  207. package/components/utils.cjs +1 -25
  208. package/components/utils.js +22 -22
  209. package/components/{random-id-BE6HA503.cjs → when-CDK1Tt5Y.js} +10 -7
  210. package/components/when-CDZyJPvd.cjs +22 -0
  211. package/package.json +1 -1
  212. package/components/action-group-DHp8RHDf.js +0 -392
  213. package/components/action-group-MPf19RPV.cjs +0 -391
  214. package/components/base-COw9n7UR.cjs +0 -119
  215. package/components/base-DmeVy0cq.js +0 -120
  216. package/components/button-base-7Ak55xFd.cjs +0 -206
  217. package/components/button-base-C3kf6BTK.js +0 -207
  218. package/components/checkbox-mixin-8cL-vfDy.js +0 -84
  219. package/components/checkbox-mixin-CE7dJj3J.cjs +0 -83
  220. package/components/clear-button-Co6oKSgl.js +0 -59
  221. package/components/clear-button-X_HDY2eH.cjs +0 -58
  222. package/components/close-button-DPBK6Kpu.cjs +0 -59
  223. package/components/close-button-Miw9ZjoJ.js +0 -60
  224. package/components/color-controller-BjDZaxhX.js +0 -491
  225. package/components/color-controller-C3c_vb2P.cjs +0 -490
  226. package/components/color-loupe-BQqNR8YD.cjs +0 -88
  227. package/components/color-loupe-B_DDFv8l.js +0 -89
  228. package/components/condition-attribute-with-id-DEc2Yjne.cjs +0 -43
  229. package/components/dependency-manger-CcIE1uvQ.cjs +0 -63
  230. package/components/divider.module-Cm5LcDRV.cjs +0 -20
  231. package/components/divider.module-DauH6k2_.js +0 -21
  232. package/components/element-resolution-DCsrhGZO.cjs +0 -112
  233. package/components/element-resolution-nMlmW4Jy.js +0 -113
  234. package/components/field-group-DNmY8W9v.cjs +0 -86
  235. package/components/field-group-DVdAWCQF.js +0 -87
  236. package/components/field-label-CKH9EXpR.cjs +0 -156
  237. package/components/field-label-Dpsecoc6.js +0 -157
  238. package/components/focus-group-BqDAk9Is.js +0 -337
  239. package/components/focus-group-DFzOlalL.cjs +0 -336
  240. package/components/focus-visible-B-B8-P9R.cjs +0 -104
  241. package/components/focus-visible-BUPRWlsh.js +0 -105
  242. package/components/focusable-BPrTcZPd.cjs +0 -262
  243. package/components/focusable-ChCLg1k4.js +0 -263
  244. package/components/language-resolution-iN9EImbb.cjs +0 -57
  245. package/components/like-anchor-D62faRNG.cjs +0 -79
  246. package/components/like-anchor-v3cJ9RWM.js +0 -80
  247. package/components/manage-help-text-BYx84zZR.cjs +0 -125
  248. package/components/manage-help-text-DOuMTGht.js +0 -126
  249. package/components/observe-slot-presence-9AwLGUQ_.cjs +0 -78
  250. package/components/observe-slot-presence-DcMdoumP.js +0 -79
  251. package/components/observe-slot-text-CSofZeeF.cjs +0 -104
  252. package/components/observe-slot-text-CjnkkBPn.js +0 -105
  253. package/components/overlay-CN8ISP1F.js +0 -2485
  254. package/components/overlay-LViy9VWM.cjs +0 -2484
  255. package/components/pending-state-e4RbXe9u.cjs +0 -75
  256. package/components/picker-DNde3awt.cjs +0 -672
  257. package/components/picker-PfUAF05y.js +0 -673
  258. package/components/platform-CxDar3Dn.cjs +0 -68
  259. package/components/platform-Cxn0WbyT.js +0 -69
  260. package/components/popover-BkbYhl3i.js +0 -74
  261. package/components/popover-BkgUf0kL.cjs +0 -74
  262. package/components/progress-circle-Hu_ivPHf.js +0 -133
  263. package/components/progress-circle-_Etqsj9f.cjs +0 -132
  264. package/components/roving-tabindex-AsmAh2In.cjs +0 -95
  265. package/components/roving-tabindex-DPF9NmrH.js +0 -96
  266. package/components/sized-mixin-DmkrNdWB.js +0 -80
  267. package/components/sized-mixin-UaTVa-AE.cjs +0 -79
  268. package/components/strategies-DlMlaSJR.cjs +0 -317
  269. package/components/strategies-DlPQoTFE.js +0 -318
  270. package/components/streaming-listener-D4sHaMub.cjs +0 -145
  271. package/components/streaming-listener-cAz5zJyk.js +0 -146
  272. package/components/text-field-11tcnftU.cjs +0 -338
  273. package/components/text-field-Chi9J2Cz.js +0 -339
  274. package/components/text-field.module-CMBS0jSL.js +0 -21
  275. package/components/text-field.module-DIJdV_sA.cjs +0 -20
@@ -0,0 +1,218 @@
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
+ function d(o, e, t) {
19
+ return typeof o === e ? () => o : typeof o == "function" ? o : t;
20
+ }
21
+ class m {
22
+ constructor(e, {
23
+ direction: t,
24
+ elementEnterAction: i,
25
+ elements: r,
26
+ focusInIndex: c,
27
+ isFocusableElement: l,
28
+ listenerScope: u
29
+ } = { elements: () => [] }) {
30
+ this._currentIndex = -1, this.prevIndex = -1, this._direction = () => "both", this.directionLength = 5, this.elementEnterAction = (s) => {
31
+ }, this._focused = !1, this._focusInIndex = (s) => 0, this.isFocusableElement = (s) => !0, this._listenerScope = () => this.host, this.offset = 0, this.recentlyConnected = !1, this.handleFocusin = (s) => {
32
+ if (!this.isEventWithinListenerScope(s))
33
+ return;
34
+ const n = s.composedPath();
35
+ let h = -1;
36
+ n.find((a) => (h = this.elements.indexOf(a), h !== -1)), this.prevIndex = this.currentIndex, this.currentIndex = h > -1 ? h : this.currentIndex, this.isRelatedTargetOrContainAnElement(s) && this.hostContainsFocus();
37
+ }, this.handleClick = () => {
38
+ var h;
39
+ const s = this.elements;
40
+ if (s.length === 0)
41
+ return;
42
+ let n = s[this.currentIndex];
43
+ this.currentIndex < 0 || ((!n || !this.isFocusableElement(n)) && (this.setCurrentIndexCircularly(1), n = s[this.currentIndex]), n && this.isFocusableElement(n) && ((h = s[this.prevIndex]) == null || h.setAttribute("tabindex", "-1"), n.setAttribute("tabindex", "0")));
44
+ }, this.handleFocusout = (s) => {
45
+ this.isRelatedTargetOrContainAnElement(s) && this.hostNoLongerContainsFocus();
46
+ }, this.handleKeydown = (s) => {
47
+ if (!this.acceptsEventCode(s.code) || s.defaultPrevented)
48
+ return;
49
+ let n = 0;
50
+ switch (this.prevIndex = this.currentIndex, s.code) {
51
+ case "ArrowRight": {
52
+ n += 1;
53
+ break;
54
+ }
55
+ case "ArrowDown": {
56
+ n += this.direction === "grid" ? this.directionLength : 1;
57
+ break;
58
+ }
59
+ case "ArrowLeft": {
60
+ n -= 1;
61
+ break;
62
+ }
63
+ case "ArrowUp": {
64
+ n -= this.direction === "grid" ? this.directionLength : 1;
65
+ break;
66
+ }
67
+ case "End": {
68
+ this.currentIndex = 0, n -= 1;
69
+ break;
70
+ }
71
+ case "Home": {
72
+ this.currentIndex = this.elements.length - 1, n += 1;
73
+ break;
74
+ }
75
+ }
76
+ s.preventDefault(), this.direction === "grid" && this.currentIndex + n < 0 ? this.currentIndex = 0 : this.direction === "grid" && this.currentIndex + n > this.elements.length - 1 ? this.currentIndex = this.elements.length - 1 : this.setCurrentIndexCircularly(n), this.elementEnterAction(this.elements[this.currentIndex]), this.focus();
77
+ }, this.mutationObserver = new MutationObserver(() => {
78
+ this.handleItemMutation();
79
+ }), this.host = e, this.host.addController(this), this._elements = r, this.isFocusableElement = l || this.isFocusableElement, this._direction = d(
80
+ t,
81
+ "string",
82
+ this._direction
83
+ ), this.elementEnterAction = i || this.elementEnterAction, this._focusInIndex = d(
84
+ c,
85
+ "number",
86
+ this._focusInIndex
87
+ ), this._listenerScope = d(
88
+ u,
89
+ "object",
90
+ this._listenerScope
91
+ );
92
+ }
93
+ get currentIndex() {
94
+ return this._currentIndex === -1 && (this._currentIndex = this.focusInIndex), this._currentIndex - this.offset;
95
+ }
96
+ set currentIndex(e) {
97
+ this._currentIndex = e + this.offset;
98
+ }
99
+ get direction() {
100
+ return this._direction();
101
+ }
102
+ get elements() {
103
+ return this.cachedElements || (this.cachedElements = this._elements()), this.cachedElements;
104
+ }
105
+ set focused(e) {
106
+ e !== this.focused && (this._focused = e);
107
+ }
108
+ get focused() {
109
+ return this._focused;
110
+ }
111
+ get focusInElement() {
112
+ return this.elements[this.focusInIndex];
113
+ }
114
+ get focusInIndex() {
115
+ return this._focusInIndex(this.elements);
116
+ }
117
+ isEventWithinListenerScope(e) {
118
+ return this._listenerScope() === this.host ? !0 : e.composedPath().includes(this._listenerScope());
119
+ }
120
+ /* In handleItemMutation() method the first if condition is checking if the element is not focused or if the element's children's length is not decreasing then it means no element has been deleted and we must return.
121
+ Then we are checking if the deleted element was the focused one before the deletion if so then we need to proceed else we casn return;
122
+ */
123
+ handleItemMutation() {
124
+ if (this._currentIndex === -1 || this.elements.length <= this._elements().length)
125
+ return;
126
+ const e = this.elements[this.currentIndex];
127
+ if (this.clearElementCache(), this.elements.includes(e))
128
+ return;
129
+ const t = this.currentIndex !== this.elements.length, i = t ? 1 : -1;
130
+ t && this.setCurrentIndexCircularly(-1), this.setCurrentIndexCircularly(i), this.focus();
131
+ }
132
+ update({ elements: e } = { elements: () => [] }) {
133
+ this.unmanage(), this._elements = e, this.clearElementCache(), this.manage();
134
+ }
135
+ focus(e) {
136
+ var r;
137
+ const t = this.elements;
138
+ if (t.length === 0)
139
+ return;
140
+ let i = t[this.currentIndex];
141
+ (!i || !this.isFocusableElement(i)) && (this.setCurrentIndexCircularly(1), i = t[this.currentIndex]), i && this.isFocusableElement(i) && ((r = t[this.prevIndex]) == null || r.setAttribute("tabindex", "-1"), i.tabIndex = 0, i.focus(e));
142
+ }
143
+ clearElementCache(e = 0) {
144
+ this.mutationObserver.disconnect(), delete this.cachedElements, this.offset = e, requestAnimationFrame(() => {
145
+ this.elements.forEach((t) => {
146
+ this.mutationObserver.observe(t, {
147
+ attributes: !0
148
+ });
149
+ });
150
+ });
151
+ }
152
+ setCurrentIndexCircularly(e) {
153
+ const { length: t } = this.elements;
154
+ let i = t;
155
+ this.prevIndex = this.currentIndex;
156
+ let r = (t + this.currentIndex + e) % t;
157
+ for (
158
+ ;
159
+ // don't cycle the elements more than once
160
+ i && this.elements[r] && !this.isFocusableElement(this.elements[r]);
161
+ )
162
+ r = (t + r + e) % t, i -= 1;
163
+ this.currentIndex = r;
164
+ }
165
+ hostContainsFocus() {
166
+ this.host.addEventListener("focusout", this.handleFocusout), this.host.addEventListener("keydown", this.handleKeydown), this.focused = !0;
167
+ }
168
+ hostNoLongerContainsFocus() {
169
+ this.host.addEventListener("focusin", this.handleFocusin), this.host.removeEventListener("focusout", this.handleFocusout), this.host.removeEventListener("keydown", this.handleKeydown), this.focused = !1;
170
+ }
171
+ isRelatedTargetOrContainAnElement(e) {
172
+ const t = e.relatedTarget, i = this.elements.includes(t), r = this.elements.some(
173
+ (c) => c.contains(t)
174
+ );
175
+ return !(i || r);
176
+ }
177
+ acceptsEventCode(e) {
178
+ if (e === "End" || e === "Home")
179
+ return !0;
180
+ switch (this.direction) {
181
+ case "horizontal":
182
+ return e === "ArrowLeft" || e === "ArrowRight";
183
+ case "vertical":
184
+ return e === "ArrowUp" || e === "ArrowDown";
185
+ case "both":
186
+ case "grid":
187
+ return e.startsWith("Arrow");
188
+ }
189
+ }
190
+ manage() {
191
+ this.addEventListeners();
192
+ }
193
+ unmanage() {
194
+ this.removeEventListeners();
195
+ }
196
+ addEventListeners() {
197
+ this.host.addEventListener("focusin", this.handleFocusin), this.host.addEventListener("click", this.handleClick);
198
+ }
199
+ removeEventListeners() {
200
+ this.host.removeEventListener("focusin", this.handleFocusin), this.host.removeEventListener("focusout", this.handleFocusout), this.host.removeEventListener("keydown", this.handleKeydown), this.host.removeEventListener("click", this.handleClick);
201
+ }
202
+ hostConnected() {
203
+ this.recentlyConnected = !0, this.addEventListeners();
204
+ }
205
+ hostDisconnected() {
206
+ this.mutationObserver.disconnect(), this.removeEventListeners();
207
+ }
208
+ hostUpdated() {
209
+ this.recentlyConnected && (this.recentlyConnected = !1, this.elements.forEach((e) => {
210
+ this.mutationObserver.observe(e, {
211
+ attributes: !0
212
+ });
213
+ }));
214
+ }
215
+ }
216
+ export {
217
+ m as F
218
+ };
@@ -0,0 +1,18 @@
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";function d(o,e,t){return typeof o===e?()=>o:typeof o=="function"?o:t}class m{constructor(e,{direction:t,elementEnterAction:i,elements:r,focusInIndex:c,isFocusableElement:l,listenerScope:u}={elements:()=>[]}){this._currentIndex=-1,this.prevIndex=-1,this._direction=()=>"both",this.directionLength=5,this.elementEnterAction=s=>{},this._focused=!1,this._focusInIndex=s=>0,this.isFocusableElement=s=>!0,this._listenerScope=()=>this.host,this.offset=0,this.recentlyConnected=!1,this.handleFocusin=s=>{if(!this.isEventWithinListenerScope(s))return;const n=s.composedPath();let h=-1;n.find(a=>(h=this.elements.indexOf(a),h!==-1)),this.prevIndex=this.currentIndex,this.currentIndex=h>-1?h:this.currentIndex,this.isRelatedTargetOrContainAnElement(s)&&this.hostContainsFocus()},this.handleClick=()=>{var h;const s=this.elements;if(s.length===0)return;let n=s[this.currentIndex];this.currentIndex<0||((!n||!this.isFocusableElement(n))&&(this.setCurrentIndexCircularly(1),n=s[this.currentIndex]),n&&this.isFocusableElement(n)&&((h=s[this.prevIndex])==null||h.setAttribute("tabindex","-1"),n.setAttribute("tabindex","0")))},this.handleFocusout=s=>{this.isRelatedTargetOrContainAnElement(s)&&this.hostNoLongerContainsFocus()},this.handleKeydown=s=>{if(!this.acceptsEventCode(s.code)||s.defaultPrevented)return;let n=0;switch(this.prevIndex=this.currentIndex,s.code){case"ArrowRight":{n+=1;break}case"ArrowDown":{n+=this.direction==="grid"?this.directionLength:1;break}case"ArrowLeft":{n-=1;break}case"ArrowUp":{n-=this.direction==="grid"?this.directionLength:1;break}case"End":{this.currentIndex=0,n-=1;break}case"Home":{this.currentIndex=this.elements.length-1,n+=1;break}}s.preventDefault(),this.direction==="grid"&&this.currentIndex+n<0?this.currentIndex=0:this.direction==="grid"&&this.currentIndex+n>this.elements.length-1?this.currentIndex=this.elements.length-1:this.setCurrentIndexCircularly(n),this.elementEnterAction(this.elements[this.currentIndex]),this.focus()},this.mutationObserver=new MutationObserver(()=>{this.handleItemMutation()}),this.host=e,this.host.addController(this),this._elements=r,this.isFocusableElement=l||this.isFocusableElement,this._direction=d(t,"string",this._direction),this.elementEnterAction=i||this.elementEnterAction,this._focusInIndex=d(c,"number",this._focusInIndex),this._listenerScope=d(u,"object",this._listenerScope)}get currentIndex(){return this._currentIndex===-1&&(this._currentIndex=this.focusInIndex),this._currentIndex-this.offset}set currentIndex(e){this._currentIndex=e+this.offset}get direction(){return this._direction()}get elements(){return this.cachedElements||(this.cachedElements=this._elements()),this.cachedElements}set focused(e){e!==this.focused&&(this._focused=e)}get focused(){return this._focused}get focusInElement(){return this.elements[this.focusInIndex]}get focusInIndex(){return this._focusInIndex(this.elements)}isEventWithinListenerScope(e){return this._listenerScope()===this.host?!0:e.composedPath().includes(this._listenerScope())}handleItemMutation(){if(this._currentIndex===-1||this.elements.length<=this._elements().length)return;const e=this.elements[this.currentIndex];if(this.clearElementCache(),this.elements.includes(e))return;const t=this.currentIndex!==this.elements.length,i=t?1:-1;t&&this.setCurrentIndexCircularly(-1),this.setCurrentIndexCircularly(i),this.focus()}update({elements:e}={elements:()=>[]}){this.unmanage(),this._elements=e,this.clearElementCache(),this.manage()}focus(e){var r;const t=this.elements;if(t.length===0)return;let i=t[this.currentIndex];(!i||!this.isFocusableElement(i))&&(this.setCurrentIndexCircularly(1),i=t[this.currentIndex]),i&&this.isFocusableElement(i)&&((r=t[this.prevIndex])==null||r.setAttribute("tabindex","-1"),i.tabIndex=0,i.focus(e))}clearElementCache(e=0){this.mutationObserver.disconnect(),delete this.cachedElements,this.offset=e,requestAnimationFrame(()=>{this.elements.forEach(t=>{this.mutationObserver.observe(t,{attributes:!0})})})}setCurrentIndexCircularly(e){const{length:t}=this.elements;let i=t;this.prevIndex=this.currentIndex;let r=(t+this.currentIndex+e)%t;for(;i&&this.elements[r]&&!this.isFocusableElement(this.elements[r]);)r=(t+r+e)%t,i-=1;this.currentIndex=r}hostContainsFocus(){this.host.addEventListener("focusout",this.handleFocusout),this.host.addEventListener("keydown",this.handleKeydown),this.focused=!0}hostNoLongerContainsFocus(){this.host.addEventListener("focusin",this.handleFocusin),this.host.removeEventListener("focusout",this.handleFocusout),this.host.removeEventListener("keydown",this.handleKeydown),this.focused=!1}isRelatedTargetOrContainAnElement(e){const t=e.relatedTarget,i=this.elements.includes(t),r=this.elements.some(c=>c.contains(t));return!(i||r)}acceptsEventCode(e){if(e==="End"||e==="Home")return!0;switch(this.direction){case"horizontal":return e==="ArrowLeft"||e==="ArrowRight";case"vertical":return e==="ArrowUp"||e==="ArrowDown";case"both":case"grid":return e.startsWith("Arrow")}}manage(){this.addEventListeners()}unmanage(){this.removeEventListeners()}addEventListeners(){this.host.addEventListener("focusin",this.handleFocusin),this.host.addEventListener("click",this.handleClick)}removeEventListeners(){this.host.removeEventListener("focusin",this.handleFocusin),this.host.removeEventListener("focusout",this.handleFocusout),this.host.removeEventListener("keydown",this.handleKeydown),this.host.removeEventListener("click",this.handleClick)}hostConnected(){this.recentlyConnected=!0,this.addEventListeners()}hostDisconnected(){this.mutationObserver.disconnect(),this.removeEventListeners()}hostUpdated(){this.recentlyConnected&&(this.recentlyConnected=!1,this.elements.forEach(e=>{this.mutationObserver.observe(e,{attributes:!0})}))}}exports.FocusGroupController=m;
@@ -0,0 +1,74 @@
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 l = !0;
19
+ try {
20
+ typeof document < "u" && document.body.querySelector(":focus-visible");
21
+ } catch {
22
+ l = !1, Promise.resolve().then(() => c);
23
+ }
24
+ const r = (n) => {
25
+ var i, s;
26
+ const u = (e) => {
27
+ if (e.shadowRoot == null || Object.hasOwn(e.dataset, "jsFocusVisible"))
28
+ return () => {
29
+ };
30
+ if (self.applyFocusVisiblePolyfill)
31
+ self.applyFocusVisiblePolyfill(e.shadowRoot), e.manageAutoFocus && e.manageAutoFocus();
32
+ else {
33
+ const t = () => {
34
+ self.applyFocusVisiblePolyfill && e.shadowRoot && self.applyFocusVisiblePolyfill(e.shadowRoot), e.manageAutoFocus && e.manageAutoFocus();
35
+ };
36
+ return self.addEventListener(
37
+ "focus-visible-polyfill-ready",
38
+ t,
39
+ { once: !0 }
40
+ ), () => {
41
+ self.removeEventListener(
42
+ "focus-visible-polyfill-ready",
43
+ t
44
+ );
45
+ };
46
+ }
47
+ return () => {
48
+ };
49
+ }, o = Symbol("endPolyfillCoordination");
50
+ class a extends (s = n, i = o, s) {
51
+ constructor() {
52
+ super(...arguments), this[i] = null;
53
+ }
54
+ // Attempt to coordinate with the polyfill when connected to the
55
+ // document:
56
+ connectedCallback() {
57
+ super.connectedCallback && super.connectedCallback(), l || requestAnimationFrame(() => {
58
+ this[o] == null && (this[o] = u(this));
59
+ });
60
+ }
61
+ disconnectedCallback() {
62
+ super.disconnectedCallback && super.disconnectedCallback(), l || requestAnimationFrame(() => {
63
+ this[o] != null && (this[o](), this[o] = null);
64
+ });
65
+ }
66
+ }
67
+ return a;
68
+ }, c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
+ __proto__: null,
70
+ FocusVisiblePolyfillMixin: r
71
+ }, Symbol.toStringTag, { value: "Module" }));
72
+ export {
73
+ r as F
74
+ };
@@ -0,0 +1,18 @@
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";let o=!0;try{typeof document<"u"&&document.body.querySelector(":focus-visible")}catch{o=!1,Promise.resolve().then(()=>a)}const u=n=>{var i,s;const c=e=>{if(e.shadowRoot==null||Object.hasOwn(e.dataset,"jsFocusVisible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(e.shadowRoot),e.manageAutoFocus&&e.manageAutoFocus();else{const t=()=>{self.applyFocusVisiblePolyfill&&e.shadowRoot&&self.applyFocusVisiblePolyfill(e.shadowRoot),e.manageAutoFocus&&e.manageAutoFocus()};return self.addEventListener("focus-visible-polyfill-ready",t,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",t)}}return()=>{}},l=Symbol("endPolyfillCoordination");class r extends(s=n,i=l,s){constructor(){super(...arguments),this[i]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),o||requestAnimationFrame(()=>{this[l]==null&&(this[l]=c(this))})}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),o||requestAnimationFrame(()=>{this[l]!=null&&(this[l](),this[l]=null)})}}return r},a=Object.freeze(Object.defineProperty({__proto__:null,FocusVisiblePolyfillMixin:u},Symbol.toStringTag,{value:"Module"}));exports.FocusVisiblePolyfillMixin=u;
@@ -0,0 +1,18 @@
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";const n=require("./base-Cy0MQrPT.cjs"),d=require("./focus-visible-D4BXb5RB.cjs");var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(a,t,e,i)=>{for(var s=i>1?void 0:i?f(t,e):t,l=a.length-1,o;l>=0;l--)(o=a[l])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&b(t,e,s),s};function h(){return new Promise(a=>requestAnimationFrame(()=>a()))}class u extends d.FocusVisiblePolyfillMixin(n.LuzmoElement){constructor(){super(...arguments),this.disabled=!1,this.autofocus=!1,this._tabIndex=0,this.manipulatingTabindex=!1,this.autofocusReady=Promise.resolve()}get tabIndex(){if(this.focusElement===this){const e=this.hasAttribute("tabindex")?Number(this.getAttribute("tabindex")):Number.NaN;return Number.isNaN(e)?-1:e}const t=Number.parseFloat(this.hasAttribute("tabindex")&&this.getAttribute("tabindex")||"0");return this.disabled||t<0?-1:this.focusElement?this._tabIndex:t}set tabIndex(t){var e;if(this.manipulatingTabindex){this.manipulatingTabindex=!1;return}if(this.focusElement===this){if(this.disabled)this._tabIndex=t;else if(t!==this._tabIndex){this._tabIndex=t;const i=""+t;this.manipulatingTabindex=!0,this.setAttribute("tabindex",i)}return}if(t===-1?this.addEventListener("pointerdown",this.onPointerdownManagementOfTabIndex):(this.manipulatingTabindex=!0,this.removeEventListener("pointerdown",this.onPointerdownManagementOfTabIndex)),t===-1||this.disabled){if(this.manipulatingTabindex=!0,this.setAttribute("tabindex","-1"),this.removeAttribute("focusable"),this.selfManageFocusElement)return;t===-1?(e=this.focusElement)==null||e.removeAttribute("tabindex"):(this._tabIndex=t,this.manageFocusElementTabindex(t));return}this.setAttribute("focusable",""),this.hasAttribute("tabindex")?this.removeAttribute("tabindex"):this.manipulatingTabindex=!1,this._tabIndex=t,this.manageFocusElementTabindex(t)}onPointerdownManagementOfTabIndex(){this.tabIndex===-1&&setTimeout(()=>{this.tabIndex=0,this.focus({preventScroll:!0}),this.tabIndex=-1})}async manageFocusElementTabindex(t){this.focusElement||await this.updateComplete,t===null?this.focusElement.removeAttribute("tabindex"):this.focusElement!==this&&(this.focusElement.tabIndex=t)}get focusElement(){throw new Error("Must implement focusElement getter!")}get selfManageFocusElement(){return!1}focus(t){this.disabled||!this.focusElement||(this.focusElement===this?Reflect.apply(HTMLElement.prototype.focus,this,[t]):this.focusElement.focus(t))}blur(){const t=this.focusElement||this;t===this?HTMLElement.prototype.blur.apply(this):t.blur()}click(){if(this.disabled)return;const t=this.focusElement||this;t===this?HTMLElement.prototype.click.apply(this):t.click()}manageAutoFocus(){this.autofocus&&(this.dispatchEvent(new KeyboardEvent("keydown",{code:"Tab"})),this.focusElement.focus())}firstUpdated(t){super.firstUpdated(t),(!this.hasAttribute("tabindex")||this.getAttribute("tabindex")!=="-1")&&this.setAttribute("focusable","")}update(t){t.has("disabled")&&this.handleDisabledChanged(this.disabled,t.get("disabled")),super.update(t)}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.blur()}async handleDisabledChanged(t,e){const i=()=>this.focusElement!==this&&this.focusElement.disabled!==void 0;t?(this.manipulatingTabindex=!0,this.setAttribute("tabindex","-1"),await this.updateComplete,i()?this.focusElement.disabled=!0:this.setAttribute("aria-disabled","true")):e&&(this.manipulatingTabindex=!0,this.focusElement===this?this.setAttribute("tabindex",""+this._tabIndex):this.removeAttribute("tabindex"),await this.updateComplete,i()?this.focusElement.disabled=!1:this.removeAttribute("aria-disabled"))}async getUpdateComplete(){const t=await super.getUpdateComplete();return await this.autofocusReady,t}connectedCallback(){super.connectedCallback(),this.autofocus&&(this.autofocusReady=new Promise(async t=>{await h(),await h(),t()}),this.updateComplete.then(()=>{this.manageAutoFocus()}))}}r([n.n({type:Boolean,reflect:!0})],u.prototype,"disabled",2);r([n.n({type:Boolean})],u.prototype,"autofocus",2);r([n.n({type:Number})],u.prototype,"tabIndex",1);exports.Focusable=u;
@@ -0,0 +1,153 @@
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
+ import { a as d, n as o } from "./base-CFWO09N1.js";
19
+ import { F as b } from "./focus-visible-BvScGDCE.js";
20
+ var f = Object.defineProperty, m = Object.getOwnPropertyDescriptor, l = (a, t, e, i) => {
21
+ for (var s = i > 1 ? void 0 : i ? m(t, e) : t, n = a.length - 1, u; n >= 0; n--)
22
+ (u = a[n]) && (s = (i ? u(t, e, s) : u(s)) || s);
23
+ return i && s && f(t, e, s), s;
24
+ };
25
+ function h() {
26
+ return new Promise((a) => requestAnimationFrame(() => a()));
27
+ }
28
+ class r extends b(d) {
29
+ constructor() {
30
+ super(...arguments), this.disabled = !1, this.autofocus = !1, this._tabIndex = 0, this.manipulatingTabindex = !1, this.autofocusReady = Promise.resolve();
31
+ }
32
+ get tabIndex() {
33
+ if (this.focusElement === this) {
34
+ const e = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : Number.NaN;
35
+ return Number.isNaN(e) ? -1 : e;
36
+ }
37
+ const t = Number.parseFloat(
38
+ this.hasAttribute("tabindex") && this.getAttribute("tabindex") || "0"
39
+ );
40
+ return this.disabled || t < 0 ? -1 : this.focusElement ? this._tabIndex : t;
41
+ }
42
+ set tabIndex(t) {
43
+ var e;
44
+ if (this.manipulatingTabindex) {
45
+ this.manipulatingTabindex = !1;
46
+ return;
47
+ }
48
+ if (this.focusElement === this) {
49
+ if (this.disabled)
50
+ this._tabIndex = t;
51
+ else if (t !== this._tabIndex) {
52
+ this._tabIndex = t;
53
+ const i = "" + t;
54
+ this.manipulatingTabindex = !0, this.setAttribute("tabindex", i);
55
+ }
56
+ return;
57
+ }
58
+ if (t === -1 ? this.addEventListener(
59
+ "pointerdown",
60
+ this.onPointerdownManagementOfTabIndex
61
+ ) : (this.manipulatingTabindex = !0, this.removeEventListener(
62
+ "pointerdown",
63
+ this.onPointerdownManagementOfTabIndex
64
+ )), t === -1 || this.disabled) {
65
+ if (this.manipulatingTabindex = !0, this.setAttribute("tabindex", "-1"), this.removeAttribute("focusable"), this.selfManageFocusElement)
66
+ return;
67
+ t === -1 ? (e = this.focusElement) == null || e.removeAttribute("tabindex") : (this._tabIndex = t, this.manageFocusElementTabindex(t));
68
+ return;
69
+ }
70
+ this.setAttribute("focusable", ""), this.hasAttribute("tabindex") ? this.removeAttribute("tabindex") : this.manipulatingTabindex = !1, this._tabIndex = t, this.manageFocusElementTabindex(t);
71
+ }
72
+ onPointerdownManagementOfTabIndex() {
73
+ this.tabIndex === -1 && setTimeout(() => {
74
+ this.tabIndex = 0, this.focus({ preventScroll: !0 }), this.tabIndex = -1;
75
+ });
76
+ }
77
+ async manageFocusElementTabindex(t) {
78
+ this.focusElement || await this.updateComplete, t === null ? this.focusElement.removeAttribute("tabindex") : this.focusElement !== this && (this.focusElement.tabIndex = t);
79
+ }
80
+ /**
81
+ * @private
82
+ */
83
+ get focusElement() {
84
+ throw new Error("Must implement focusElement getter!");
85
+ }
86
+ /**
87
+ * @public
88
+ * @returns whether the component should manage its focusElement tab-index or not
89
+ * Needed for action-menu to be supported in action-group in an accessible way
90
+ */
91
+ get selfManageFocusElement() {
92
+ return !1;
93
+ }
94
+ focus(t) {
95
+ this.disabled || !this.focusElement || (this.focusElement === this ? Reflect.apply(HTMLElement.prototype.focus, this, [t]) : this.focusElement.focus(t));
96
+ }
97
+ blur() {
98
+ const t = this.focusElement || this;
99
+ t === this ? HTMLElement.prototype.blur.apply(this) : t.blur();
100
+ }
101
+ click() {
102
+ if (this.disabled)
103
+ return;
104
+ const t = this.focusElement || this;
105
+ t === this ? HTMLElement.prototype.click.apply(this) : t.click();
106
+ }
107
+ manageAutoFocus() {
108
+ this.autofocus && (this.dispatchEvent(
109
+ new KeyboardEvent("keydown", {
110
+ code: "Tab"
111
+ })
112
+ ), this.focusElement.focus());
113
+ }
114
+ firstUpdated(t) {
115
+ super.firstUpdated(t), (!this.hasAttribute("tabindex") || this.getAttribute("tabindex") !== "-1") && this.setAttribute("focusable", "");
116
+ }
117
+ update(t) {
118
+ t.has("disabled") && this.handleDisabledChanged(
119
+ this.disabled,
120
+ t.get("disabled")
121
+ ), super.update(t);
122
+ }
123
+ updated(t) {
124
+ super.updated(t), t.has("disabled") && this.disabled && this.blur();
125
+ }
126
+ async handleDisabledChanged(t, e) {
127
+ const i = () => this.focusElement !== this && this.focusElement.disabled !== void 0;
128
+ t ? (this.manipulatingTabindex = !0, this.setAttribute("tabindex", "-1"), await this.updateComplete, i() ? this.focusElement.disabled = !0 : this.setAttribute("aria-disabled", "true")) : e && (this.manipulatingTabindex = !0, this.focusElement === this ? this.setAttribute("tabindex", "" + this._tabIndex) : this.removeAttribute("tabindex"), await this.updateComplete, i() ? this.focusElement.disabled = !1 : this.removeAttribute("aria-disabled"));
129
+ }
130
+ async getUpdateComplete() {
131
+ const t = await super.getUpdateComplete();
132
+ return await this.autofocusReady, t;
133
+ }
134
+ connectedCallback() {
135
+ super.connectedCallback(), this.autofocus && (this.autofocusReady = new Promise(async (t) => {
136
+ await h(), await h(), t();
137
+ }), this.updateComplete.then(() => {
138
+ this.manageAutoFocus();
139
+ }));
140
+ }
141
+ }
142
+ l([
143
+ o({ type: Boolean, reflect: !0 })
144
+ ], r.prototype, "disabled", 2);
145
+ l([
146
+ o({ type: Boolean })
147
+ ], r.prototype, "autofocus", 2);
148
+ l([
149
+ o({ type: Number })
150
+ ], r.prototype, "tabIndex", 1);
151
+ export {
152
+ r as F
153
+ };
@@ -15,7 +15,7 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- const focusables = [
18
+ const o = [
19
19
  "button",
20
20
  "[focusable]",
21
21
  "[href]",
@@ -24,11 +24,8 @@ const focusables = [
24
24
  "select",
25
25
  "textarea",
26
26
  "[tabindex]"
27
- ];
28
- const userFocuable = ':not([tabindex="-1"])';
29
- const userFocusableSelector = focusables.join(`${userFocuable}, `) + userFocuable;
30
- const focusableSelector = focusables.join(", ");
27
+ ], e = ':not([tabindex="-1"])', t = o.join(`${e}, `) + e, s = o.join(", ");
31
28
  export {
32
- focusableSelector as f,
33
- userFocusableSelector as u
29
+ s as f,
30
+ t as u
34
31
  };
@@ -0,0 +1,18 @@
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";const o=["button","[focusable]","[href]","input","label","select","textarea","[tabindex]"],e=':not([tabindex="-1"])',t=o.join(`${e}, `)+e,c=o.join(", ");exports.focusableSelector=c;exports.userFocusableSelector=t;
@@ -15,93 +15,4 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- "use strict";
19
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
20
- const icons = require("@luzmo/icons");
21
- const lit = require("lit");
22
- const decorators_js = require("lit/decorators.js");
23
- const ifDefined_js = require("lit/directives/if-defined.js");
24
- const base = require("../base-COw9n7UR.cjs");
25
- const styles = ":host{pointer-events:none;transform:none;transform:var(--luzmo-icon-transform, none);block-size:var(--luzmo-icon-block-size, var(--luzmo-icon-size, var(--icon-size)));font-size:var(--luzmo-icon-block-size, var(--luzmo-icon-size, var(--icon-size)));color:inherit;color:var(--luzmo-icon-color, inherit);fill:currentColor;text-align:center;display:inline-block}::slotted(svg),:host(:not([block])) svg,:host(:not([block])) img{vertical-align:var(--luzmo-icon-vertical-align, -.125em)!important}:host([block]){display:block;--icon-vertical-align: 0;vertical-align:0}:host([block]) ::slotted(svg),:host([block]) svg,:host([block]) img{--icon-vertical-align: 0;vertical-align:var(--luzmo-icon-vertical-align, 0)}:host([size=xxs]){--icon-size: var(--luzmo-icon-size-xxs)}:host([size=xs]){--icon-size: var(--luzmo-icon-size-xs)}:host([size=s]){--icon-size: var(--luzmo-icon-size-s)}:host,:host([size=m]){--icon-size: var(--luzmo-icon-size-m)}:host([size=l]){--icon-size: var(--luzmo-icon-size-l)}:host([size=xl]){--icon-size: var(--luzmo-icon-size-xl)}:host([size=xxl]){--icon-size: var(--luzmo-icon-size-xxl)}:host(:not(:root)){overflow:visible}@media (forced-colors: active){:host{forced-color-adjust:auto}}img,svg,::slotted(*){height:100%;vertical-align:top;color:inherit}@media (forced-colors: active){img,svg,::slotted(*){forced-color-adjust:auto}}";
26
- var __defProp$1 = Object.defineProperty;
27
- var __decorateClass$1 = (decorators, target, key, kind) => {
28
- var result = void 0;
29
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
30
- if (decorator = decorators[i])
31
- result = decorator(target, key, result) || result;
32
- if (result) __defProp$1(target, key, result);
33
- return result;
34
- };
35
- class IconBase extends base.LuzmoElement {
36
- constructor() {
37
- super(...arguments);
38
- this.label = "";
39
- }
40
- static get styles() {
41
- return [lit.unsafeCSS(styles)];
42
- }
43
- connectedCallback() {
44
- super.connectedCallback();
45
- }
46
- disconnectedCallback() {
47
- super.disconnectedCallback();
48
- }
49
- update(changes) {
50
- if (changes.has("label")) {
51
- if (this.label) {
52
- this.removeAttribute("aria-hidden");
53
- } else {
54
- this.setAttribute("aria-hidden", "true");
55
- }
56
- }
57
- super.update(changes);
58
- }
59
- render() {
60
- return lit.html` <slot></slot> `;
61
- }
62
- }
63
- __decorateClass$1([
64
- decorators_js.property({ reflect: true })
65
- ], IconBase.prototype, "label");
66
- __decorateClass$1([
67
- decorators_js.property({ reflect: true })
68
- ], IconBase.prototype, "size");
69
- var __defProp = Object.defineProperty;
70
- var __decorateClass = (decorators, target, key, kind) => {
71
- var result = void 0;
72
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
73
- if (decorator = decorators[i])
74
- result = decorator(target, key, result) || result;
75
- if (result) __defProp(target, key, result);
76
- return result;
77
- };
78
- class LuzmoIcon extends IconBase {
79
- constructor() {
80
- super(...arguments);
81
- this.block = false;
82
- }
83
- render() {
84
- if (this.icon) {
85
- return icons.luzmoIcon(this.icon, this.options);
86
- } else if (this.src) {
87
- return lit.html` <img src=${this.src} alt=${ifDefined_js.ifDefined(this.label)} /> `;
88
- }
89
- return super.render();
90
- }
91
- }
92
- __decorateClass([
93
- decorators_js.property()
94
- ], LuzmoIcon.prototype, "src");
95
- __decorateClass([
96
- decorators_js.property()
97
- ], LuzmoIcon.prototype, "options");
98
- __decorateClass([
99
- decorators_js.property()
100
- ], LuzmoIcon.prototype, "icon");
101
- __decorateClass([
102
- decorators_js.property({ type: Boolean })
103
- ], LuzmoIcon.prototype, "block");
104
- if (typeof customElements !== "undefined" && !customElements.get("luzmo-icon")) {
105
- customElements.define("luzmo-icon", LuzmoIcon);
106
- }
107
- exports.LuzmoIcon = LuzmoIcon;
18
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../luzmo-icons-CtA-TJPd.cjs"),o=require("../base-Cy0MQrPT.cjs"),m=require("../if-defined-DaXWqfzc.cjs"),d=":host{pointer-events:none;transform:none;transform:var(--luzmo-icon-transform, none);block-size:var(--luzmo-icon-block-size, var(--luzmo-icon-size, var(--icon-size)));font-size:var(--luzmo-icon-block-size, var(--luzmo-icon-size, var(--icon-size)));color:inherit;color:var(--luzmo-icon-color, inherit);fill:currentColor;text-align:center;display:inline-block}::slotted(svg),:host(:not([block])) svg,:host(:not([block])) img{vertical-align:var(--luzmo-icon-vertical-align, -.125em)!important}:host([block]){display:block;--icon-vertical-align: 0;vertical-align:0}:host([block]) ::slotted(svg),:host([block]) svg,:host([block]) img{--icon-vertical-align: 0;vertical-align:var(--luzmo-icon-vertical-align, 0)}:host([size=xxs]){--icon-size: var(--luzmo-icon-size-xxs)}:host([size=xs]){--icon-size: var(--luzmo-icon-size-xs)}:host([size=s]){--icon-size: var(--luzmo-icon-size-s)}:host,:host([size=m]){--icon-size: var(--luzmo-icon-size-m)}:host([size=l]){--icon-size: var(--luzmo-icon-size-l)}:host([size=xl]){--icon-size: var(--luzmo-icon-size-xl)}:host([size=xxl]){--icon-size: var(--luzmo-icon-size-xxl)}:host(:not(:root)){overflow:visible}@media (forced-colors: active){:host{forced-color-adjust:auto}}img,svg,::slotted(*){height:100%;vertical-align:top;color:inherit}@media (forced-colors: active){img,svg,::slotted(*){forced-color-adjust:auto}}";var h=Object.defineProperty,u=(i,t,n,z)=>{for(var e=void 0,s=i.length-1,l;s>=0;s--)(l=i[s])&&(e=l(t,n,e)||e);return e&&h(t,n,e),e};class a extends o.LuzmoElement{constructor(){super(...arguments),this.label=""}static get styles(){return[o.r(d)]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}update(t){t.has("label")&&(this.label?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")),super.update(t)}render(){return o.x` <slot></slot> `}}u([o.n({reflect:!0})],a.prototype,"label");u([o.n({reflect:!0})],a.prototype,"size");var f=Object.defineProperty,c=(i,t,n,z)=>{for(var e=void 0,s=i.length-1,l;s>=0;s--)(l=i[s])&&(e=l(t,n,e)||e);return e&&f(t,n,e),e};class r extends a{constructor(){super(...arguments),this.block=!1}render(){return this.icon?v.T3(this.icon,this.options):this.src?o.x` <img src=${this.src} alt=${m.o(this.label)} /> `:super.render()}}c([o.n()],r.prototype,"src");c([o.n()],r.prototype,"options");c([o.n()],r.prototype,"icon");c([o.n({type:Boolean})],r.prototype,"block");typeof customElements<"u"&&!customElements.get("luzmo-icon")&&customElements.define("luzmo-icon",r);exports.LuzmoIcon=r;