@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
@@ -1,336 +0,0 @@
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
- function ensureMethod(value, type, fallback) {
20
- if (typeof value === type) {
21
- return () => value;
22
- } else if (typeof value === "function") {
23
- return value;
24
- }
25
- return fallback;
26
- }
27
- class FocusGroupController {
28
- constructor(host, {
29
- direction,
30
- elementEnterAction,
31
- elements,
32
- focusInIndex,
33
- isFocusableElement,
34
- listenerScope
35
- } = { elements: () => [] }) {
36
- this._currentIndex = -1;
37
- this.prevIndex = -1;
38
- this._direction = () => "both";
39
- this.directionLength = 5;
40
- this.elementEnterAction = (_el) => {
41
- };
42
- this._focused = false;
43
- this._focusInIndex = (_elements) => 0;
44
- this.isFocusableElement = (_el) => true;
45
- this._listenerScope = () => this.host;
46
- this.offset = 0;
47
- this.recentlyConnected = false;
48
- this.handleFocusin = (event) => {
49
- if (!this.isEventWithinListenerScope(event)) {
50
- return;
51
- }
52
- const path = event.composedPath();
53
- let targetIndex = -1;
54
- path.find((el) => {
55
- targetIndex = this.elements.indexOf(el);
56
- return targetIndex !== -1;
57
- });
58
- this.prevIndex = this.currentIndex;
59
- this.currentIndex = targetIndex > -1 ? targetIndex : this.currentIndex;
60
- if (this.isRelatedTargetOrContainAnElement(event)) {
61
- this.hostContainsFocus();
62
- }
63
- };
64
- this.handleClick = () => {
65
- var _a;
66
- const elements2 = this.elements;
67
- if (elements2.length === 0) {
68
- return;
69
- }
70
- let focusElement = elements2[this.currentIndex];
71
- if (this.currentIndex < 0) {
72
- return;
73
- }
74
- if (!focusElement || !this.isFocusableElement(focusElement)) {
75
- this.setCurrentIndexCircularly(1);
76
- focusElement = elements2[this.currentIndex];
77
- }
78
- if (focusElement && this.isFocusableElement(focusElement)) {
79
- (_a = elements2[this.prevIndex]) == null ? void 0 : _a.setAttribute("tabindex", "-1");
80
- focusElement.setAttribute("tabindex", "0");
81
- }
82
- };
83
- this.handleFocusout = (event) => {
84
- if (this.isRelatedTargetOrContainAnElement(event)) {
85
- this.hostNoLongerContainsFocus();
86
- }
87
- };
88
- this.handleKeydown = (event) => {
89
- if (!this.acceptsEventCode(event.code) || event.defaultPrevented) {
90
- return;
91
- }
92
- let diff = 0;
93
- this.prevIndex = this.currentIndex;
94
- switch (event.code) {
95
- case "ArrowRight": {
96
- diff += 1;
97
- break;
98
- }
99
- case "ArrowDown": {
100
- diff += this.direction === "grid" ? this.directionLength : 1;
101
- break;
102
- }
103
- case "ArrowLeft": {
104
- diff -= 1;
105
- break;
106
- }
107
- case "ArrowUp": {
108
- diff -= this.direction === "grid" ? this.directionLength : 1;
109
- break;
110
- }
111
- case "End": {
112
- this.currentIndex = 0;
113
- diff -= 1;
114
- break;
115
- }
116
- case "Home": {
117
- this.currentIndex = this.elements.length - 1;
118
- diff += 1;
119
- break;
120
- }
121
- }
122
- event.preventDefault();
123
- if (this.direction === "grid" && this.currentIndex + diff < 0) {
124
- this.currentIndex = 0;
125
- } else if (this.direction === "grid" && this.currentIndex + diff > this.elements.length - 1) {
126
- this.currentIndex = this.elements.length - 1;
127
- } else {
128
- this.setCurrentIndexCircularly(diff);
129
- }
130
- this.elementEnterAction(this.elements[this.currentIndex]);
131
- this.focus();
132
- };
133
- this.mutationObserver = new MutationObserver(() => {
134
- this.handleItemMutation();
135
- });
136
- this.host = host;
137
- this.host.addController(this);
138
- this._elements = elements;
139
- this.isFocusableElement = isFocusableElement || this.isFocusableElement;
140
- this._direction = ensureMethod(
141
- direction,
142
- "string",
143
- this._direction
144
- );
145
- this.elementEnterAction = elementEnterAction || this.elementEnterAction;
146
- this._focusInIndex = ensureMethod(
147
- focusInIndex,
148
- "number",
149
- this._focusInIndex
150
- );
151
- this._listenerScope = ensureMethod(
152
- listenerScope,
153
- "object",
154
- this._listenerScope
155
- );
156
- }
157
- get currentIndex() {
158
- if (this._currentIndex === -1) {
159
- this._currentIndex = this.focusInIndex;
160
- }
161
- return this._currentIndex - this.offset;
162
- }
163
- set currentIndex(currentIndex) {
164
- this._currentIndex = currentIndex + this.offset;
165
- }
166
- get direction() {
167
- return this._direction();
168
- }
169
- get elements() {
170
- if (!this.cachedElements) {
171
- this.cachedElements = this._elements();
172
- }
173
- return this.cachedElements;
174
- }
175
- set focused(focused) {
176
- if (focused === this.focused) {
177
- return;
178
- }
179
- this._focused = focused;
180
- }
181
- get focused() {
182
- return this._focused;
183
- }
184
- get focusInElement() {
185
- return this.elements[this.focusInIndex];
186
- }
187
- get focusInIndex() {
188
- return this._focusInIndex(this.elements);
189
- }
190
- isEventWithinListenerScope(event) {
191
- if (this._listenerScope() === this.host) {
192
- return true;
193
- }
194
- return event.composedPath().includes(this._listenerScope());
195
- }
196
- /* 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.
197
- 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;
198
- */
199
- handleItemMutation() {
200
- if (this._currentIndex === -1 || this.elements.length <= this._elements().length) {
201
- return;
202
- }
203
- const focusedElement = this.elements[this.currentIndex];
204
- this.clearElementCache();
205
- if (this.elements.includes(focusedElement)) {
206
- return;
207
- }
208
- const moveToNextElement = this.currentIndex !== this.elements.length;
209
- const diff = moveToNextElement ? 1 : -1;
210
- if (moveToNextElement) {
211
- this.setCurrentIndexCircularly(-1);
212
- }
213
- this.setCurrentIndexCircularly(diff);
214
- this.focus();
215
- }
216
- update({ elements } = { elements: () => [] }) {
217
- this.unmanage();
218
- this._elements = elements;
219
- this.clearElementCache();
220
- this.manage();
221
- }
222
- focus(options) {
223
- var _a;
224
- const elements = this.elements;
225
- if (elements.length === 0) {
226
- return;
227
- }
228
- let focusElement = elements[this.currentIndex];
229
- if (!focusElement || !this.isFocusableElement(focusElement)) {
230
- this.setCurrentIndexCircularly(1);
231
- focusElement = elements[this.currentIndex];
232
- }
233
- if (focusElement && this.isFocusableElement(focusElement)) {
234
- (_a = elements[this.prevIndex]) == null ? void 0 : _a.setAttribute("tabindex", "-1");
235
- focusElement.tabIndex = 0;
236
- focusElement.focus(options);
237
- }
238
- }
239
- clearElementCache(offset = 0) {
240
- this.mutationObserver.disconnect();
241
- delete this.cachedElements;
242
- this.offset = offset;
243
- requestAnimationFrame(() => {
244
- this.elements.forEach((element) => {
245
- this.mutationObserver.observe(element, {
246
- attributes: true
247
- });
248
- });
249
- });
250
- }
251
- setCurrentIndexCircularly(diff) {
252
- const { length } = this.elements;
253
- let steps = length;
254
- this.prevIndex = this.currentIndex;
255
- let nextIndex = (length + this.currentIndex + diff) % length;
256
- while (
257
- // don't cycle the elements more than once
258
- steps && this.elements[nextIndex] && !this.isFocusableElement(this.elements[nextIndex])
259
- ) {
260
- nextIndex = (length + nextIndex + diff) % length;
261
- steps -= 1;
262
- }
263
- this.currentIndex = nextIndex;
264
- }
265
- hostContainsFocus() {
266
- this.host.addEventListener("focusout", this.handleFocusout);
267
- this.host.addEventListener("keydown", this.handleKeydown);
268
- this.focused = true;
269
- }
270
- hostNoLongerContainsFocus() {
271
- this.host.addEventListener("focusin", this.handleFocusin);
272
- this.host.removeEventListener("focusout", this.handleFocusout);
273
- this.host.removeEventListener("keydown", this.handleKeydown);
274
- this.focused = false;
275
- }
276
- isRelatedTargetOrContainAnElement(event) {
277
- const relatedTarget = event.relatedTarget;
278
- const isRelatedTargetAnElement = this.elements.includes(relatedTarget);
279
- const isRelatedTargetContainedWithinElements = this.elements.some(
280
- (el) => el.contains(relatedTarget)
281
- );
282
- return !(isRelatedTargetAnElement || isRelatedTargetContainedWithinElements);
283
- }
284
- acceptsEventCode(code) {
285
- if (code === "End" || code === "Home") {
286
- return true;
287
- }
288
- switch (this.direction) {
289
- case "horizontal": {
290
- return code === "ArrowLeft" || code === "ArrowRight";
291
- }
292
- case "vertical": {
293
- return code === "ArrowUp" || code === "ArrowDown";
294
- }
295
- case "both":
296
- case "grid": {
297
- return code.startsWith("Arrow");
298
- }
299
- }
300
- }
301
- manage() {
302
- this.addEventListeners();
303
- }
304
- unmanage() {
305
- this.removeEventListeners();
306
- }
307
- addEventListeners() {
308
- this.host.addEventListener("focusin", this.handleFocusin);
309
- this.host.addEventListener("click", this.handleClick);
310
- }
311
- removeEventListeners() {
312
- this.host.removeEventListener("focusin", this.handleFocusin);
313
- this.host.removeEventListener("focusout", this.handleFocusout);
314
- this.host.removeEventListener("keydown", this.handleKeydown);
315
- this.host.removeEventListener("click", this.handleClick);
316
- }
317
- hostConnected() {
318
- this.recentlyConnected = true;
319
- this.addEventListeners();
320
- }
321
- hostDisconnected() {
322
- this.mutationObserver.disconnect();
323
- this.removeEventListeners();
324
- }
325
- hostUpdated() {
326
- if (this.recentlyConnected) {
327
- this.recentlyConnected = false;
328
- this.elements.forEach((element) => {
329
- this.mutationObserver.observe(element, {
330
- attributes: true
331
- });
332
- });
333
- }
334
- }
335
- }
336
- exports.FocusGroupController = FocusGroupController;
@@ -1,104 +0,0 @@
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;
@@ -1,105 +0,0 @@
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
- };