@luzmo/lucero 1.0.1-alpha.17 → 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 (277) 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 -221
  204. package/components/tooltip/index.js +131 -155
  205. package/components/tooltip/tooltip.d.ts +12 -1
  206. package/components/unit-input/index.cjs +8 -232
  207. package/components/unit-input/index.js +108 -201
  208. package/components/utils.cjs +1 -25
  209. package/components/utils.js +22 -22
  210. package/components/{random-id-BE6HA503.cjs → when-CDK1Tt5Y.js} +10 -7
  211. package/components/when-CDZyJPvd.cjs +22 -0
  212. package/custom-elements.json +1 -1
  213. package/package.json +1 -1
  214. package/components/action-group-DHp8RHDf.js +0 -392
  215. package/components/action-group-MPf19RPV.cjs +0 -391
  216. package/components/base-COw9n7UR.cjs +0 -119
  217. package/components/base-DmeVy0cq.js +0 -120
  218. package/components/button-base-7Ak55xFd.cjs +0 -206
  219. package/components/button-base-C3kf6BTK.js +0 -207
  220. package/components/checkbox-mixin-8cL-vfDy.js +0 -84
  221. package/components/checkbox-mixin-CE7dJj3J.cjs +0 -83
  222. package/components/clear-button-Co6oKSgl.js +0 -59
  223. package/components/clear-button-X_HDY2eH.cjs +0 -58
  224. package/components/close-button-DPBK6Kpu.cjs +0 -59
  225. package/components/close-button-Miw9ZjoJ.js +0 -60
  226. package/components/color-controller-BjDZaxhX.js +0 -491
  227. package/components/color-controller-C3c_vb2P.cjs +0 -490
  228. package/components/color-loupe-BQqNR8YD.cjs +0 -88
  229. package/components/color-loupe-B_DDFv8l.js +0 -89
  230. package/components/condition-attribute-with-id-DEc2Yjne.cjs +0 -43
  231. package/components/dependency-manger-CcIE1uvQ.cjs +0 -63
  232. package/components/divider.module-Cm5LcDRV.cjs +0 -20
  233. package/components/divider.module-DauH6k2_.js +0 -21
  234. package/components/element-resolution-DCsrhGZO.cjs +0 -112
  235. package/components/element-resolution-nMlmW4Jy.js +0 -113
  236. package/components/field-group-DNmY8W9v.cjs +0 -86
  237. package/components/field-group-DVdAWCQF.js +0 -87
  238. package/components/field-label-CKH9EXpR.cjs +0 -156
  239. package/components/field-label-Dpsecoc6.js +0 -157
  240. package/components/focus-group-BqDAk9Is.js +0 -337
  241. package/components/focus-group-DFzOlalL.cjs +0 -336
  242. package/components/focus-visible-B-B8-P9R.cjs +0 -104
  243. package/components/focus-visible-BUPRWlsh.js +0 -105
  244. package/components/focusable-BPrTcZPd.cjs +0 -262
  245. package/components/focusable-ChCLg1k4.js +0 -263
  246. package/components/language-resolution-iN9EImbb.cjs +0 -57
  247. package/components/like-anchor-D62faRNG.cjs +0 -79
  248. package/components/like-anchor-v3cJ9RWM.js +0 -80
  249. package/components/manage-help-text-BYx84zZR.cjs +0 -125
  250. package/components/manage-help-text-DOuMTGht.js +0 -126
  251. package/components/observe-slot-presence-9AwLGUQ_.cjs +0 -78
  252. package/components/observe-slot-presence-DcMdoumP.js +0 -79
  253. package/components/observe-slot-text-CSofZeeF.cjs +0 -104
  254. package/components/observe-slot-text-CjnkkBPn.js +0 -105
  255. package/components/overlay-CN8ISP1F.js +0 -2485
  256. package/components/overlay-LViy9VWM.cjs +0 -2484
  257. package/components/pending-state-e4RbXe9u.cjs +0 -75
  258. package/components/picker-DNde3awt.cjs +0 -672
  259. package/components/picker-PfUAF05y.js +0 -673
  260. package/components/platform-CxDar3Dn.cjs +0 -68
  261. package/components/platform-Cxn0WbyT.js +0 -69
  262. package/components/popover-BkbYhl3i.js +0 -74
  263. package/components/popover-BkgUf0kL.cjs +0 -74
  264. package/components/progress-circle-Hu_ivPHf.js +0 -133
  265. package/components/progress-circle-_Etqsj9f.cjs +0 -132
  266. package/components/roving-tabindex-AsmAh2In.cjs +0 -95
  267. package/components/roving-tabindex-DPF9NmrH.js +0 -96
  268. package/components/sized-mixin-DmkrNdWB.js +0 -80
  269. package/components/sized-mixin-UaTVa-AE.cjs +0 -79
  270. package/components/strategies-DlMlaSJR.cjs +0 -317
  271. package/components/strategies-DlPQoTFE.js +0 -318
  272. package/components/streaming-listener-D4sHaMub.cjs +0 -145
  273. package/components/streaming-listener-cAz5zJyk.js +0 -146
  274. package/components/text-field-11tcnftU.cjs +0 -338
  275. package/components/text-field-Chi9J2Cz.js +0 -339
  276. package/components/text-field.module-CMBS0jSL.js +0 -21
  277. package/components/text-field.module-DIJdV_sA.cjs +0 -20
@@ -1,262 +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
- const decorators_js = require("lit/decorators.js");
20
- const base = require("./base-COw9n7UR.cjs");
21
- const focusVisible = require("./focus-visible-B-B8-P9R.cjs");
22
- var __defProp = Object.defineProperty;
23
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
24
- var __decorateClass = (decorators, target, key, kind) => {
25
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
26
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
27
- if (decorator = decorators[i])
28
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
- if (kind && result) __defProp(target, key, result);
30
- return result;
31
- };
32
- function nextFrame() {
33
- return new Promise((res) => requestAnimationFrame(() => res()));
34
- }
35
- class Focusable extends focusVisible.FocusVisiblePolyfillMixin(base.LuzmoElement) {
36
- constructor() {
37
- super(...arguments);
38
- this.disabled = false;
39
- this.autofocus = false;
40
- this._tabIndex = 0;
41
- this.manipulatingTabindex = false;
42
- this.autofocusReady = Promise.resolve();
43
- }
44
- get tabIndex() {
45
- if (this.focusElement === this) {
46
- const tabindex = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : Number.NaN;
47
- return Number.isNaN(tabindex) ? -1 : tabindex;
48
- }
49
- const tabIndexAttribute = Number.parseFloat(
50
- this.hasAttribute("tabindex") ? this.getAttribute("tabindex") || "0" : "0"
51
- );
52
- if (this.disabled || tabIndexAttribute < 0) {
53
- return -1;
54
- }
55
- if (!this.focusElement) {
56
- return tabIndexAttribute;
57
- }
58
- return this._tabIndex;
59
- }
60
- set tabIndex(tabIndex) {
61
- var _a;
62
- if (this.manipulatingTabindex) {
63
- this.manipulatingTabindex = false;
64
- return;
65
- }
66
- if (this.focusElement === this) {
67
- if (this.disabled) {
68
- this._tabIndex = tabIndex;
69
- } else if (tabIndex !== this._tabIndex) {
70
- this._tabIndex = tabIndex;
71
- const tabindex = "" + tabIndex;
72
- this.manipulatingTabindex = true;
73
- this.setAttribute("tabindex", tabindex);
74
- }
75
- return;
76
- }
77
- if (tabIndex === -1) {
78
- this.addEventListener(
79
- "pointerdown",
80
- this.onPointerdownManagementOfTabIndex
81
- );
82
- } else {
83
- this.manipulatingTabindex = true;
84
- this.removeEventListener(
85
- "pointerdown",
86
- this.onPointerdownManagementOfTabIndex
87
- );
88
- }
89
- if (tabIndex === -1 || this.disabled) {
90
- this.manipulatingTabindex = true;
91
- this.setAttribute("tabindex", "-1");
92
- this.removeAttribute("focusable");
93
- if (this.selfManageFocusElement) {
94
- return;
95
- }
96
- if (tabIndex === -1) {
97
- (_a = this.focusElement) == null ? void 0 : _a.removeAttribute("tabindex");
98
- } else {
99
- this._tabIndex = tabIndex;
100
- this.manageFocusElementTabindex(tabIndex);
101
- }
102
- return;
103
- }
104
- this.setAttribute("focusable", "");
105
- if (this.hasAttribute("tabindex")) {
106
- this.removeAttribute("tabindex");
107
- } else {
108
- this.manipulatingTabindex = false;
109
- }
110
- this._tabIndex = tabIndex;
111
- this.manageFocusElementTabindex(tabIndex);
112
- }
113
- onPointerdownManagementOfTabIndex() {
114
- if (this.tabIndex === -1) {
115
- setTimeout(() => {
116
- this.tabIndex = 0;
117
- this.focus({ preventScroll: true });
118
- this.tabIndex = -1;
119
- });
120
- }
121
- }
122
- async manageFocusElementTabindex(tabIndex) {
123
- if (!this.focusElement) {
124
- await this.updateComplete;
125
- }
126
- if (tabIndex === null) {
127
- this.focusElement.removeAttribute("tabindex");
128
- } else {
129
- if (this.focusElement !== this) {
130
- this.focusElement.tabIndex = tabIndex;
131
- }
132
- }
133
- }
134
- /**
135
- * @private
136
- */
137
- get focusElement() {
138
- throw new Error("Must implement focusElement getter!");
139
- }
140
- /**
141
- * @public
142
- * @returns whether the component should manage its focusElement tab-index or not
143
- * Needed for action-menu to be supported in action-group in an accessible way
144
- */
145
- get selfManageFocusElement() {
146
- return false;
147
- }
148
- focus(options) {
149
- if (this.disabled || !this.focusElement) {
150
- return;
151
- }
152
- if (this.focusElement === this) {
153
- Reflect.apply(HTMLElement.prototype.focus, this, [options]);
154
- } else {
155
- this.focusElement.focus(options);
156
- }
157
- }
158
- blur() {
159
- const focusElement = this.focusElement || this;
160
- if (focusElement === this) {
161
- HTMLElement.prototype.blur.apply(this);
162
- } else {
163
- focusElement.blur();
164
- }
165
- }
166
- click() {
167
- if (this.disabled) {
168
- return;
169
- }
170
- const focusElement = this.focusElement || this;
171
- if (focusElement === this) {
172
- HTMLElement.prototype.click.apply(this);
173
- } else {
174
- focusElement.click();
175
- }
176
- }
177
- manageAutoFocus() {
178
- if (this.autofocus) {
179
- this.dispatchEvent(
180
- new KeyboardEvent("keydown", {
181
- code: "Tab"
182
- })
183
- );
184
- this.focusElement.focus();
185
- }
186
- }
187
- firstUpdated(changes) {
188
- super.firstUpdated(changes);
189
- if (!this.hasAttribute("tabindex") || this.getAttribute("tabindex") !== "-1") {
190
- this.setAttribute("focusable", "");
191
- }
192
- }
193
- update(changedProperties) {
194
- if (changedProperties.has("disabled")) {
195
- this.handleDisabledChanged(
196
- this.disabled,
197
- changedProperties.get("disabled")
198
- );
199
- }
200
- super.update(changedProperties);
201
- }
202
- updated(changedProperties) {
203
- super.updated(changedProperties);
204
- if (changedProperties.has("disabled") && this.disabled) {
205
- this.blur();
206
- }
207
- }
208
- async handleDisabledChanged(disabled, oldDisabled) {
209
- const canSetDisabled = () => this.focusElement !== this && this.focusElement.disabled !== void 0;
210
- if (disabled) {
211
- this.manipulatingTabindex = true;
212
- this.setAttribute("tabindex", "-1");
213
- await this.updateComplete;
214
- if (canSetDisabled()) {
215
- this.focusElement.disabled = true;
216
- } else {
217
- this.setAttribute("aria-disabled", "true");
218
- }
219
- } else if (oldDisabled) {
220
- this.manipulatingTabindex = true;
221
- if (this.focusElement === this) {
222
- this.setAttribute("tabindex", "" + this._tabIndex);
223
- } else {
224
- this.removeAttribute("tabindex");
225
- }
226
- await this.updateComplete;
227
- if (canSetDisabled()) {
228
- this.focusElement.disabled = false;
229
- } else {
230
- this.removeAttribute("aria-disabled");
231
- }
232
- }
233
- }
234
- async getUpdateComplete() {
235
- const complete = await super.getUpdateComplete();
236
- await this.autofocusReady;
237
- return complete;
238
- }
239
- connectedCallback() {
240
- super.connectedCallback();
241
- if (this.autofocus) {
242
- this.autofocusReady = new Promise(async (res) => {
243
- await nextFrame();
244
- await nextFrame();
245
- res();
246
- });
247
- this.updateComplete.then(() => {
248
- this.manageAutoFocus();
249
- });
250
- }
251
- }
252
- }
253
- __decorateClass([
254
- decorators_js.property({ type: Boolean, reflect: true })
255
- ], Focusable.prototype, "disabled", 2);
256
- __decorateClass([
257
- decorators_js.property({ type: Boolean })
258
- ], Focusable.prototype, "autofocus", 2);
259
- __decorateClass([
260
- decorators_js.property({ type: Number })
261
- ], Focusable.prototype, "tabIndex", 1);
262
- exports.Focusable = Focusable;
@@ -1,263 +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
- import { property } from "lit/decorators.js";
19
- import { a as LuzmoElement } from "./base-DmeVy0cq.js";
20
- import { F as FocusVisiblePolyfillMixin } from "./focus-visible-BUPRWlsh.js";
21
- var __defProp = Object.defineProperty;
22
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
23
- var __decorateClass = (decorators, target, key, kind) => {
24
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
25
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
26
- if (decorator = decorators[i])
27
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
28
- if (kind && result) __defProp(target, key, result);
29
- return result;
30
- };
31
- function nextFrame() {
32
- return new Promise((res) => requestAnimationFrame(() => res()));
33
- }
34
- class Focusable extends FocusVisiblePolyfillMixin(LuzmoElement) {
35
- constructor() {
36
- super(...arguments);
37
- this.disabled = false;
38
- this.autofocus = false;
39
- this._tabIndex = 0;
40
- this.manipulatingTabindex = false;
41
- this.autofocusReady = Promise.resolve();
42
- }
43
- get tabIndex() {
44
- if (this.focusElement === this) {
45
- const tabindex = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : Number.NaN;
46
- return Number.isNaN(tabindex) ? -1 : tabindex;
47
- }
48
- const tabIndexAttribute = Number.parseFloat(
49
- this.hasAttribute("tabindex") ? this.getAttribute("tabindex") || "0" : "0"
50
- );
51
- if (this.disabled || tabIndexAttribute < 0) {
52
- return -1;
53
- }
54
- if (!this.focusElement) {
55
- return tabIndexAttribute;
56
- }
57
- return this._tabIndex;
58
- }
59
- set tabIndex(tabIndex) {
60
- var _a;
61
- if (this.manipulatingTabindex) {
62
- this.manipulatingTabindex = false;
63
- return;
64
- }
65
- if (this.focusElement === this) {
66
- if (this.disabled) {
67
- this._tabIndex = tabIndex;
68
- } else if (tabIndex !== this._tabIndex) {
69
- this._tabIndex = tabIndex;
70
- const tabindex = "" + tabIndex;
71
- this.manipulatingTabindex = true;
72
- this.setAttribute("tabindex", tabindex);
73
- }
74
- return;
75
- }
76
- if (tabIndex === -1) {
77
- this.addEventListener(
78
- "pointerdown",
79
- this.onPointerdownManagementOfTabIndex
80
- );
81
- } else {
82
- this.manipulatingTabindex = true;
83
- this.removeEventListener(
84
- "pointerdown",
85
- this.onPointerdownManagementOfTabIndex
86
- );
87
- }
88
- if (tabIndex === -1 || this.disabled) {
89
- this.manipulatingTabindex = true;
90
- this.setAttribute("tabindex", "-1");
91
- this.removeAttribute("focusable");
92
- if (this.selfManageFocusElement) {
93
- return;
94
- }
95
- if (tabIndex === -1) {
96
- (_a = this.focusElement) == null ? void 0 : _a.removeAttribute("tabindex");
97
- } else {
98
- this._tabIndex = tabIndex;
99
- this.manageFocusElementTabindex(tabIndex);
100
- }
101
- return;
102
- }
103
- this.setAttribute("focusable", "");
104
- if (this.hasAttribute("tabindex")) {
105
- this.removeAttribute("tabindex");
106
- } else {
107
- this.manipulatingTabindex = false;
108
- }
109
- this._tabIndex = tabIndex;
110
- this.manageFocusElementTabindex(tabIndex);
111
- }
112
- onPointerdownManagementOfTabIndex() {
113
- if (this.tabIndex === -1) {
114
- setTimeout(() => {
115
- this.tabIndex = 0;
116
- this.focus({ preventScroll: true });
117
- this.tabIndex = -1;
118
- });
119
- }
120
- }
121
- async manageFocusElementTabindex(tabIndex) {
122
- if (!this.focusElement) {
123
- await this.updateComplete;
124
- }
125
- if (tabIndex === null) {
126
- this.focusElement.removeAttribute("tabindex");
127
- } else {
128
- if (this.focusElement !== this) {
129
- this.focusElement.tabIndex = tabIndex;
130
- }
131
- }
132
- }
133
- /**
134
- * @private
135
- */
136
- get focusElement() {
137
- throw new Error("Must implement focusElement getter!");
138
- }
139
- /**
140
- * @public
141
- * @returns whether the component should manage its focusElement tab-index or not
142
- * Needed for action-menu to be supported in action-group in an accessible way
143
- */
144
- get selfManageFocusElement() {
145
- return false;
146
- }
147
- focus(options) {
148
- if (this.disabled || !this.focusElement) {
149
- return;
150
- }
151
- if (this.focusElement === this) {
152
- Reflect.apply(HTMLElement.prototype.focus, this, [options]);
153
- } else {
154
- this.focusElement.focus(options);
155
- }
156
- }
157
- blur() {
158
- const focusElement = this.focusElement || this;
159
- if (focusElement === this) {
160
- HTMLElement.prototype.blur.apply(this);
161
- } else {
162
- focusElement.blur();
163
- }
164
- }
165
- click() {
166
- if (this.disabled) {
167
- return;
168
- }
169
- const focusElement = this.focusElement || this;
170
- if (focusElement === this) {
171
- HTMLElement.prototype.click.apply(this);
172
- } else {
173
- focusElement.click();
174
- }
175
- }
176
- manageAutoFocus() {
177
- if (this.autofocus) {
178
- this.dispatchEvent(
179
- new KeyboardEvent("keydown", {
180
- code: "Tab"
181
- })
182
- );
183
- this.focusElement.focus();
184
- }
185
- }
186
- firstUpdated(changes) {
187
- super.firstUpdated(changes);
188
- if (!this.hasAttribute("tabindex") || this.getAttribute("tabindex") !== "-1") {
189
- this.setAttribute("focusable", "");
190
- }
191
- }
192
- update(changedProperties) {
193
- if (changedProperties.has("disabled")) {
194
- this.handleDisabledChanged(
195
- this.disabled,
196
- changedProperties.get("disabled")
197
- );
198
- }
199
- super.update(changedProperties);
200
- }
201
- updated(changedProperties) {
202
- super.updated(changedProperties);
203
- if (changedProperties.has("disabled") && this.disabled) {
204
- this.blur();
205
- }
206
- }
207
- async handleDisabledChanged(disabled, oldDisabled) {
208
- const canSetDisabled = () => this.focusElement !== this && this.focusElement.disabled !== void 0;
209
- if (disabled) {
210
- this.manipulatingTabindex = true;
211
- this.setAttribute("tabindex", "-1");
212
- await this.updateComplete;
213
- if (canSetDisabled()) {
214
- this.focusElement.disabled = true;
215
- } else {
216
- this.setAttribute("aria-disabled", "true");
217
- }
218
- } else if (oldDisabled) {
219
- this.manipulatingTabindex = true;
220
- if (this.focusElement === this) {
221
- this.setAttribute("tabindex", "" + this._tabIndex);
222
- } else {
223
- this.removeAttribute("tabindex");
224
- }
225
- await this.updateComplete;
226
- if (canSetDisabled()) {
227
- this.focusElement.disabled = false;
228
- } else {
229
- this.removeAttribute("aria-disabled");
230
- }
231
- }
232
- }
233
- async getUpdateComplete() {
234
- const complete = await super.getUpdateComplete();
235
- await this.autofocusReady;
236
- return complete;
237
- }
238
- connectedCallback() {
239
- super.connectedCallback();
240
- if (this.autofocus) {
241
- this.autofocusReady = new Promise(async (res) => {
242
- await nextFrame();
243
- await nextFrame();
244
- res();
245
- });
246
- this.updateComplete.then(() => {
247
- this.manageAutoFocus();
248
- });
249
- }
250
- }
251
- }
252
- __decorateClass([
253
- property({ type: Boolean, reflect: true })
254
- ], Focusable.prototype, "disabled", 2);
255
- __decorateClass([
256
- property({ type: Boolean })
257
- ], Focusable.prototype, "autofocus", 2);
258
- __decorateClass([
259
- property({ type: Number })
260
- ], Focusable.prototype, "tabIndex", 1);
261
- export {
262
- Focusable as F
263
- };
@@ -1,57 +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
- const languageResolverUpdatedSymbol = Symbol(
20
- "language resolver updated"
21
- );
22
- class LanguageResolutionController {
23
- constructor(host) {
24
- var _a;
25
- this.language = (typeof document === "undefined" ? void 0 : (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang) ?? (typeof navigator === "undefined" ? void 0 : navigator == null ? void 0 : navigator.language) ?? "en";
26
- this.host = host;
27
- this.host.addController(this);
28
- }
29
- hostConnected() {
30
- this.resolveLanguage();
31
- }
32
- hostDisconnected() {
33
- var _a;
34
- (_a = this.unsubscribe) == null ? void 0 : _a.call(this);
35
- }
36
- resolveLanguage() {
37
- const queryThemeEvent = new CustomEvent(
38
- "luzmo-language-context",
39
- {
40
- bubbles: true,
41
- composed: true,
42
- detail: {
43
- callback: (lang, unsubscribe) => {
44
- const previous = this.language;
45
- this.language = lang;
46
- this.unsubscribe = unsubscribe;
47
- this.host.requestUpdate(languageResolverUpdatedSymbol, previous);
48
- }
49
- },
50
- cancelable: true
51
- }
52
- );
53
- this.host.dispatchEvent(queryThemeEvent);
54
- }
55
- }
56
- exports.LanguageResolutionController = LanguageResolutionController;
57
- exports.languageResolverUpdatedSymbol = languageResolverUpdatedSymbol;
@@ -1,79 +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
- const lit = require("lit");
20
- const decorators_js = require("lit/decorators.js");
21
- const ifDefined_js = require("lit/directives/if-defined.js");
22
- var __defProp = Object.defineProperty;
23
- var __decorateClass = (decorators, target, key, kind) => {
24
- var result = void 0;
25
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
26
- if (decorator = decorators[i])
27
- result = decorator(target, key, result) || result;
28
- if (result) __defProp(target, key, result);
29
- return result;
30
- };
31
- function LikeAnchor(constructor) {
32
- class LikeAnchorElement extends constructor {
33
- renderAnchor({
34
- id,
35
- className,
36
- ariaHidden,
37
- labelledby,
38
- tabindex,
39
- // prettier-ignore
40
- anchorContent = lit.html`<slot></slot>`
41
- }) {
42
- return lit.html`
43
- <a
44
- id=${id}
45
- class=${ifDefined_js.ifDefined(className)}
46
- href=${ifDefined_js.ifDefined(this.href)}
47
- download=${ifDefined_js.ifDefined(this.download)}
48
- target=${ifDefined_js.ifDefined(this.target)}
49
- aria-label=${ifDefined_js.ifDefined(this.label)}
50
- aria-labelledby=${ifDefined_js.ifDefined(labelledby)}
51
- aria-hidden=${ifDefined_js.ifDefined(ariaHidden ? "true" : void 0)}
52
- tabindex=${ifDefined_js.ifDefined(tabindex)}
53
- referrerpolicy=${ifDefined_js.ifDefined(this.referrerpolicy)}
54
- rel=${ifDefined_js.ifDefined(this.rel)}
55
- >${anchorContent}</a>
56
- `;
57
- }
58
- }
59
- __decorateClass([
60
- decorators_js.property()
61
- ], LikeAnchorElement.prototype, "download");
62
- __decorateClass([
63
- decorators_js.property()
64
- ], LikeAnchorElement.prototype, "label");
65
- __decorateClass([
66
- decorators_js.property()
67
- ], LikeAnchorElement.prototype, "href");
68
- __decorateClass([
69
- decorators_js.property()
70
- ], LikeAnchorElement.prototype, "target");
71
- __decorateClass([
72
- decorators_js.property()
73
- ], LikeAnchorElement.prototype, "referrerpolicy");
74
- __decorateClass([
75
- decorators_js.property()
76
- ], LikeAnchorElement.prototype, "rel");
77
- return LikeAnchorElement;
78
- }
79
- exports.LikeAnchor = LikeAnchor;