@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,338 +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
- const live_js = require("lit/directives/live.js");
23
- const icons = require("@luzmo/icons");
24
- const focusable = require("./focusable-BPrTcZPd.cjs");
25
- const sizedMixin = require("./sized-mixin-UaTVa-AE.cjs");
26
- const manageHelpText = require("./manage-help-text-BYx84zZR.cjs");
27
- const textField_module = require("./text-field.module-DIJdV_sA.cjs");
28
- var __defProp = Object.defineProperty;
29
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
30
- var __decorateClass = (decorators, target, key, kind) => {
31
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
32
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
33
- if (decorator = decorators[i])
34
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
35
- if (kind && result) __defProp(target, key, result);
36
- return result;
37
- };
38
- const textFieldTypes = ["text", "url", "tel", "email", "password"];
39
- class LuzmoTextFieldBase extends manageHelpText.ManageHelpText(
40
- sizedMixin.SizedMixin(focusable.Focusable, {
41
- noDefaultSize: true
42
- })
43
- ) {
44
- constructor() {
45
- super(...arguments);
46
- this.allowedKeys = "";
47
- this.focused = false;
48
- this.invalid = false;
49
- this.label = "";
50
- this.placeholder = "";
51
- this._type = "text";
52
- this.grows = false;
53
- this.maxlength = -1;
54
- this.minlength = -1;
55
- this.multiline = false;
56
- this.readonly = false;
57
- this.rows = -1;
58
- this.valid = false;
59
- this._value = "";
60
- this.quiet = false;
61
- this.required = false;
62
- }
63
- static get styles() {
64
- return [lit.unsafeCSS(textField_module.textFieldStyles)];
65
- }
66
- set type(val) {
67
- const prev = this._type;
68
- this._type = val;
69
- this.requestUpdate("type", prev);
70
- }
71
- get type() {
72
- return textFieldTypes.find((t) => t === this._type) ?? "text";
73
- }
74
- set value(value) {
75
- if (value === this.value) {
76
- return;
77
- }
78
- const oldValue = this._value;
79
- this._value = value;
80
- this.requestUpdate("value", oldValue);
81
- }
82
- get value() {
83
- return this._value;
84
- }
85
- get focusElement() {
86
- return this.inputElement;
87
- }
88
- /**
89
- * Sets the start and end positions of the current selection.
90
- *
91
- * @param selectionStart The 0-based index of the first selected character. An index greater than the length of the
92
- * element's value is treated as pointing to the end of the value.
93
- * @param selectionEnd The 0-based index of the character after the last selected character. An index greater than
94
- * the length of the element's value is treated as pointing to the end of the value.
95
- * @param [selectionDirection="none"] A string indicating the direction in which the selection is considered to
96
- * have been performed.
97
- */
98
- setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") {
99
- this.inputElement.setSelectionRange(
100
- selectionStart,
101
- selectionEnd,
102
- selectionDirection
103
- );
104
- }
105
- /**
106
- * Selects all the text.
107
- */
108
- select() {
109
- this.inputElement.select();
110
- }
111
- handleInput(_event) {
112
- if (this.allowedKeys && this.inputElement.value) {
113
- const regExp = new RegExp(`^[${this.allowedKeys}]*$`, "u");
114
- if (!regExp.test(this.inputElement.value)) {
115
- const selectionStart = this.inputElement.selectionStart;
116
- const nextSelectStart = selectionStart - 1;
117
- this.inputElement.value = this.value.toString();
118
- this.inputElement.setSelectionRange(nextSelectStart, nextSelectStart);
119
- return;
120
- }
121
- }
122
- this.value = this.inputElement.value;
123
- }
124
- handleChange() {
125
- this.dispatchEvent(
126
- new Event("change", {
127
- bubbles: true,
128
- composed: true
129
- })
130
- );
131
- }
132
- onFocus() {
133
- this.focused = !this.readonly && true;
134
- }
135
- onBlur(_event) {
136
- this.focused = !this.readonly && false;
137
- }
138
- handleInputElementPointerdown() {
139
- }
140
- renderStateIcons() {
141
- if (this.invalid) {
142
- return lit.html`
143
- <div id="invalid" class="icon">${icons.luzmoIcon(icons.luzmoAlert)}</div>
144
- `;
145
- } else if (this.valid) {
146
- return lit.html`
147
- <div id="valid" class="icon">${icons.luzmoIcon(icons.luzmoCheck)}</div>
148
- `;
149
- }
150
- return lit.nothing;
151
- }
152
- get displayValue() {
153
- return this.value.toString();
154
- }
155
- // prettier-ignore
156
- get renderMultiline() {
157
- return lit.html`
158
- ${this.multiline && this.grows && this.rows === -1 ? lit.html`
159
- <div id="sizer" class="input" aria-hidden="true">${this.value}&#8203;
160
- </div>
161
- ` : lit.nothing}
162
- <!-- @ts-ignore -->
163
- <textarea
164
- name=${ifDefined_js.ifDefined(this.name || void 0)}
165
- aria-describedby=${this.helpTextId}
166
- aria-label=${this.label || this.appliedLabel || this.placeholder}
167
- aria-invalid=${ifDefined_js.ifDefined(this.invalid || void 0)}
168
- class="input"
169
- maxlength=${ifDefined_js.ifDefined(this.maxlength > -1 ? this.maxlength : void 0)}
170
- minlength=${ifDefined_js.ifDefined(this.minlength > -1 ? this.minlength : void 0)}
171
- title=${this.invalid ? "" : lit.nothing}
172
- pattern=${ifDefined_js.ifDefined(this.pattern)}
173
- placeholder=${this.placeholder}
174
- .value=${this.displayValue}
175
- @change=${this.handleChange}
176
- @input=${this.handleInput}
177
- @focus=${this.onFocus}
178
- @blur=${this.onBlur}
179
- ?disabled=${this.disabled}
180
- ?required=${this.required}
181
- ?readonly=${this.readonly}
182
- rows=${ifDefined_js.ifDefined(this.rows > -1 ? this.rows : void 0)}
183
- autocomplete=${ifDefined_js.ifDefined(this.autocomplete)}
184
- ></textarea>
185
- `;
186
- }
187
- get renderInput() {
188
- return lit.html`
189
- <!-- @ts-ignore -->
190
- <input
191
- name=${ifDefined_js.ifDefined(this.name || void 0)}
192
- type=${this.type}
193
- aria-describedby=${this.helpTextId}
194
- aria-label=${this.label || this.appliedLabel || this.placeholder}
195
- aria-invalid=${ifDefined_js.ifDefined(this.invalid || void 0)}
196
- class="input"
197
- title=${this.invalid ? "" : lit.nothing}
198
- maxlength=${ifDefined_js.ifDefined(this.maxlength > -1 ? this.maxlength : void 0)}
199
- minlength=${ifDefined_js.ifDefined(this.minlength > -1 ? this.minlength : void 0)}
200
- pattern=${ifDefined_js.ifDefined(this.pattern)}
201
- placeholder=${this.placeholder}
202
- .value=${live_js.live(this.displayValue)}
203
- @change=${this.handleChange}
204
- @input=${this.handleInput}
205
- @pointerdown=${this.handleInputElementPointerdown}
206
- @focus=${this.onFocus}
207
- @blur=${this.onBlur}
208
- ?disabled=${this.disabled}
209
- ?required=${this.required}
210
- ?readonly=${this.readonly}
211
- autocomplete=${ifDefined_js.ifDefined(this.autocomplete)}
212
- />
213
- `;
214
- }
215
- renderField() {
216
- return lit.html`
217
- ${this.renderStateIcons()}
218
- ${this.multiline ? this.renderMultiline : this.renderInput}
219
- `;
220
- }
221
- render() {
222
- return lit.html`
223
- <div id="text-field">${this.renderField()}</div>
224
- ${this.renderHelpText(this.invalid)}
225
- `;
226
- }
227
- update(changedProperties) {
228
- if (changedProperties.has("value") || changedProperties.has("required") && this.required) {
229
- this.updateComplete.then(() => {
230
- this.checkValidity();
231
- });
232
- }
233
- super.update(changedProperties);
234
- }
235
- checkValidity() {
236
- let validity = this.inputElement.checkValidity();
237
- if (this.required || this.value && this.pattern) {
238
- if ((this.disabled || this.multiline) && this.pattern) {
239
- const regex = new RegExp(`^${this.pattern}$`, "u");
240
- validity = regex.test(this.value.toString());
241
- }
242
- if (this.minlength !== void 0) {
243
- validity = validity && this.value.toString().length >= this.minlength;
244
- }
245
- this.valid = validity;
246
- this.invalid = !validity;
247
- }
248
- return validity;
249
- }
250
- }
251
- __decorateClass([
252
- decorators_js.state()
253
- ], LuzmoTextFieldBase.prototype, "appliedLabel", 2);
254
- __decorateClass([
255
- decorators_js.property({ attribute: "allowed-keys" })
256
- ], LuzmoTextFieldBase.prototype, "allowedKeys", 2);
257
- __decorateClass([
258
- decorators_js.property({ type: Boolean, reflect: true })
259
- ], LuzmoTextFieldBase.prototype, "focused", 2);
260
- __decorateClass([
261
- decorators_js.query(".input:not(#sizer)")
262
- ], LuzmoTextFieldBase.prototype, "inputElement", 2);
263
- __decorateClass([
264
- decorators_js.property({ type: Boolean, reflect: true })
265
- ], LuzmoTextFieldBase.prototype, "invalid", 2);
266
- __decorateClass([
267
- decorators_js.property()
268
- ], LuzmoTextFieldBase.prototype, "label", 2);
269
- __decorateClass([
270
- decorators_js.property({ type: String, reflect: true })
271
- ], LuzmoTextFieldBase.prototype, "name", 2);
272
- __decorateClass([
273
- decorators_js.property()
274
- ], LuzmoTextFieldBase.prototype, "placeholder", 2);
275
- __decorateClass([
276
- decorators_js.state()
277
- ], LuzmoTextFieldBase.prototype, "type", 1);
278
- __decorateClass([
279
- decorators_js.property({ attribute: "type", reflect: true })
280
- ], LuzmoTextFieldBase.prototype, "_type", 2);
281
- __decorateClass([
282
- decorators_js.property()
283
- ], LuzmoTextFieldBase.prototype, "pattern", 2);
284
- __decorateClass([
285
- decorators_js.property({ type: Boolean, reflect: true })
286
- ], LuzmoTextFieldBase.prototype, "grows", 2);
287
- __decorateClass([
288
- decorators_js.property({ type: Number })
289
- ], LuzmoTextFieldBase.prototype, "maxlength", 2);
290
- __decorateClass([
291
- decorators_js.property({ type: Number })
292
- ], LuzmoTextFieldBase.prototype, "minlength", 2);
293
- __decorateClass([
294
- decorators_js.property({ type: Boolean, reflect: true })
295
- ], LuzmoTextFieldBase.prototype, "multiline", 2);
296
- __decorateClass([
297
- decorators_js.property({ type: Boolean, reflect: true })
298
- ], LuzmoTextFieldBase.prototype, "readonly", 2);
299
- __decorateClass([
300
- decorators_js.property({ type: Number })
301
- ], LuzmoTextFieldBase.prototype, "rows", 2);
302
- __decorateClass([
303
- decorators_js.property({ type: Boolean, reflect: true })
304
- ], LuzmoTextFieldBase.prototype, "valid", 2);
305
- __decorateClass([
306
- decorators_js.property({ type: String })
307
- ], LuzmoTextFieldBase.prototype, "value", 1);
308
- __decorateClass([
309
- decorators_js.property({ type: Boolean, reflect: true })
310
- ], LuzmoTextFieldBase.prototype, "quiet", 2);
311
- __decorateClass([
312
- decorators_js.property({ type: Boolean, reflect: true })
313
- ], LuzmoTextFieldBase.prototype, "required", 2);
314
- __decorateClass([
315
- decorators_js.property({ type: String, reflect: true })
316
- ], LuzmoTextFieldBase.prototype, "autocomplete", 2);
317
- class LuzmoTextField extends LuzmoTextFieldBase {
318
- constructor() {
319
- super(...arguments);
320
- this._value = "";
321
- }
322
- set value(value) {
323
- if (value === this.value) {
324
- return;
325
- }
326
- const oldValue = this._value;
327
- this._value = value;
328
- this.requestUpdate("value", oldValue);
329
- }
330
- get value() {
331
- return this._value;
332
- }
333
- }
334
- __decorateClass([
335
- decorators_js.property({ type: String })
336
- ], LuzmoTextField.prototype, "value", 1);
337
- exports.LuzmoTextField = LuzmoTextField;
338
- exports.LuzmoTextFieldBase = LuzmoTextFieldBase;
@@ -1,339 +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 { unsafeCSS, html, nothing } from "lit";
19
- import { state, property, query } from "lit/decorators.js";
20
- import { ifDefined } from "lit/directives/if-defined.js";
21
- import { live } from "lit/directives/live.js";
22
- import { luzmoIcon, luzmoAlert, luzmoCheck } from "@luzmo/icons";
23
- import { F as Focusable } from "./focusable-ChCLg1k4.js";
24
- import { S as SizedMixin } from "./sized-mixin-DmkrNdWB.js";
25
- import { M as ManageHelpText } from "./manage-help-text-DOuMTGht.js";
26
- import { t as textFieldStyles } from "./text-field.module-CMBS0jSL.js";
27
- var __defProp = Object.defineProperty;
28
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
29
- var __decorateClass = (decorators, target, key, kind) => {
30
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
31
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
32
- if (decorator = decorators[i])
33
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
34
- if (kind && result) __defProp(target, key, result);
35
- return result;
36
- };
37
- const textFieldTypes = ["text", "url", "tel", "email", "password"];
38
- class LuzmoTextFieldBase extends ManageHelpText(
39
- SizedMixin(Focusable, {
40
- noDefaultSize: true
41
- })
42
- ) {
43
- constructor() {
44
- super(...arguments);
45
- this.allowedKeys = "";
46
- this.focused = false;
47
- this.invalid = false;
48
- this.label = "";
49
- this.placeholder = "";
50
- this._type = "text";
51
- this.grows = false;
52
- this.maxlength = -1;
53
- this.minlength = -1;
54
- this.multiline = false;
55
- this.readonly = false;
56
- this.rows = -1;
57
- this.valid = false;
58
- this._value = "";
59
- this.quiet = false;
60
- this.required = false;
61
- }
62
- static get styles() {
63
- return [unsafeCSS(textFieldStyles)];
64
- }
65
- set type(val) {
66
- const prev = this._type;
67
- this._type = val;
68
- this.requestUpdate("type", prev);
69
- }
70
- get type() {
71
- return textFieldTypes.find((t) => t === this._type) ?? "text";
72
- }
73
- set value(value) {
74
- if (value === this.value) {
75
- return;
76
- }
77
- const oldValue = this._value;
78
- this._value = value;
79
- this.requestUpdate("value", oldValue);
80
- }
81
- get value() {
82
- return this._value;
83
- }
84
- get focusElement() {
85
- return this.inputElement;
86
- }
87
- /**
88
- * Sets the start and end positions of the current selection.
89
- *
90
- * @param selectionStart The 0-based index of the first selected character. An index greater than the length of the
91
- * element's value is treated as pointing to the end of the value.
92
- * @param selectionEnd The 0-based index of the character after the last selected character. An index greater than
93
- * the length of the element's value is treated as pointing to the end of the value.
94
- * @param [selectionDirection="none"] A string indicating the direction in which the selection is considered to
95
- * have been performed.
96
- */
97
- setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") {
98
- this.inputElement.setSelectionRange(
99
- selectionStart,
100
- selectionEnd,
101
- selectionDirection
102
- );
103
- }
104
- /**
105
- * Selects all the text.
106
- */
107
- select() {
108
- this.inputElement.select();
109
- }
110
- handleInput(_event) {
111
- if (this.allowedKeys && this.inputElement.value) {
112
- const regExp = new RegExp(`^[${this.allowedKeys}]*$`, "u");
113
- if (!regExp.test(this.inputElement.value)) {
114
- const selectionStart = this.inputElement.selectionStart;
115
- const nextSelectStart = selectionStart - 1;
116
- this.inputElement.value = this.value.toString();
117
- this.inputElement.setSelectionRange(nextSelectStart, nextSelectStart);
118
- return;
119
- }
120
- }
121
- this.value = this.inputElement.value;
122
- }
123
- handleChange() {
124
- this.dispatchEvent(
125
- new Event("change", {
126
- bubbles: true,
127
- composed: true
128
- })
129
- );
130
- }
131
- onFocus() {
132
- this.focused = !this.readonly && true;
133
- }
134
- onBlur(_event) {
135
- this.focused = !this.readonly && false;
136
- }
137
- handleInputElementPointerdown() {
138
- }
139
- renderStateIcons() {
140
- if (this.invalid) {
141
- return html`
142
- <div id="invalid" class="icon">${luzmoIcon(luzmoAlert)}</div>
143
- `;
144
- } else if (this.valid) {
145
- return html`
146
- <div id="valid" class="icon">${luzmoIcon(luzmoCheck)}</div>
147
- `;
148
- }
149
- return nothing;
150
- }
151
- get displayValue() {
152
- return this.value.toString();
153
- }
154
- // prettier-ignore
155
- get renderMultiline() {
156
- return html`
157
- ${this.multiline && this.grows && this.rows === -1 ? html`
158
- <div id="sizer" class="input" aria-hidden="true">${this.value}&#8203;
159
- </div>
160
- ` : nothing}
161
- <!-- @ts-ignore -->
162
- <textarea
163
- name=${ifDefined(this.name || void 0)}
164
- aria-describedby=${this.helpTextId}
165
- aria-label=${this.label || this.appliedLabel || this.placeholder}
166
- aria-invalid=${ifDefined(this.invalid || void 0)}
167
- class="input"
168
- maxlength=${ifDefined(this.maxlength > -1 ? this.maxlength : void 0)}
169
- minlength=${ifDefined(this.minlength > -1 ? this.minlength : void 0)}
170
- title=${this.invalid ? "" : nothing}
171
- pattern=${ifDefined(this.pattern)}
172
- placeholder=${this.placeholder}
173
- .value=${this.displayValue}
174
- @change=${this.handleChange}
175
- @input=${this.handleInput}
176
- @focus=${this.onFocus}
177
- @blur=${this.onBlur}
178
- ?disabled=${this.disabled}
179
- ?required=${this.required}
180
- ?readonly=${this.readonly}
181
- rows=${ifDefined(this.rows > -1 ? this.rows : void 0)}
182
- autocomplete=${ifDefined(this.autocomplete)}
183
- ></textarea>
184
- `;
185
- }
186
- get renderInput() {
187
- return html`
188
- <!-- @ts-ignore -->
189
- <input
190
- name=${ifDefined(this.name || void 0)}
191
- type=${this.type}
192
- aria-describedby=${this.helpTextId}
193
- aria-label=${this.label || this.appliedLabel || this.placeholder}
194
- aria-invalid=${ifDefined(this.invalid || void 0)}
195
- class="input"
196
- title=${this.invalid ? "" : nothing}
197
- maxlength=${ifDefined(this.maxlength > -1 ? this.maxlength : void 0)}
198
- minlength=${ifDefined(this.minlength > -1 ? this.minlength : void 0)}
199
- pattern=${ifDefined(this.pattern)}
200
- placeholder=${this.placeholder}
201
- .value=${live(this.displayValue)}
202
- @change=${this.handleChange}
203
- @input=${this.handleInput}
204
- @pointerdown=${this.handleInputElementPointerdown}
205
- @focus=${this.onFocus}
206
- @blur=${this.onBlur}
207
- ?disabled=${this.disabled}
208
- ?required=${this.required}
209
- ?readonly=${this.readonly}
210
- autocomplete=${ifDefined(this.autocomplete)}
211
- />
212
- `;
213
- }
214
- renderField() {
215
- return html`
216
- ${this.renderStateIcons()}
217
- ${this.multiline ? this.renderMultiline : this.renderInput}
218
- `;
219
- }
220
- render() {
221
- return html`
222
- <div id="text-field">${this.renderField()}</div>
223
- ${this.renderHelpText(this.invalid)}
224
- `;
225
- }
226
- update(changedProperties) {
227
- if (changedProperties.has("value") || changedProperties.has("required") && this.required) {
228
- this.updateComplete.then(() => {
229
- this.checkValidity();
230
- });
231
- }
232
- super.update(changedProperties);
233
- }
234
- checkValidity() {
235
- let validity = this.inputElement.checkValidity();
236
- if (this.required || this.value && this.pattern) {
237
- if ((this.disabled || this.multiline) && this.pattern) {
238
- const regex = new RegExp(`^${this.pattern}$`, "u");
239
- validity = regex.test(this.value.toString());
240
- }
241
- if (this.minlength !== void 0) {
242
- validity = validity && this.value.toString().length >= this.minlength;
243
- }
244
- this.valid = validity;
245
- this.invalid = !validity;
246
- }
247
- return validity;
248
- }
249
- }
250
- __decorateClass([
251
- state()
252
- ], LuzmoTextFieldBase.prototype, "appliedLabel", 2);
253
- __decorateClass([
254
- property({ attribute: "allowed-keys" })
255
- ], LuzmoTextFieldBase.prototype, "allowedKeys", 2);
256
- __decorateClass([
257
- property({ type: Boolean, reflect: true })
258
- ], LuzmoTextFieldBase.prototype, "focused", 2);
259
- __decorateClass([
260
- query(".input:not(#sizer)")
261
- ], LuzmoTextFieldBase.prototype, "inputElement", 2);
262
- __decorateClass([
263
- property({ type: Boolean, reflect: true })
264
- ], LuzmoTextFieldBase.prototype, "invalid", 2);
265
- __decorateClass([
266
- property()
267
- ], LuzmoTextFieldBase.prototype, "label", 2);
268
- __decorateClass([
269
- property({ type: String, reflect: true })
270
- ], LuzmoTextFieldBase.prototype, "name", 2);
271
- __decorateClass([
272
- property()
273
- ], LuzmoTextFieldBase.prototype, "placeholder", 2);
274
- __decorateClass([
275
- state()
276
- ], LuzmoTextFieldBase.prototype, "type", 1);
277
- __decorateClass([
278
- property({ attribute: "type", reflect: true })
279
- ], LuzmoTextFieldBase.prototype, "_type", 2);
280
- __decorateClass([
281
- property()
282
- ], LuzmoTextFieldBase.prototype, "pattern", 2);
283
- __decorateClass([
284
- property({ type: Boolean, reflect: true })
285
- ], LuzmoTextFieldBase.prototype, "grows", 2);
286
- __decorateClass([
287
- property({ type: Number })
288
- ], LuzmoTextFieldBase.prototype, "maxlength", 2);
289
- __decorateClass([
290
- property({ type: Number })
291
- ], LuzmoTextFieldBase.prototype, "minlength", 2);
292
- __decorateClass([
293
- property({ type: Boolean, reflect: true })
294
- ], LuzmoTextFieldBase.prototype, "multiline", 2);
295
- __decorateClass([
296
- property({ type: Boolean, reflect: true })
297
- ], LuzmoTextFieldBase.prototype, "readonly", 2);
298
- __decorateClass([
299
- property({ type: Number })
300
- ], LuzmoTextFieldBase.prototype, "rows", 2);
301
- __decorateClass([
302
- property({ type: Boolean, reflect: true })
303
- ], LuzmoTextFieldBase.prototype, "valid", 2);
304
- __decorateClass([
305
- property({ type: String })
306
- ], LuzmoTextFieldBase.prototype, "value", 1);
307
- __decorateClass([
308
- property({ type: Boolean, reflect: true })
309
- ], LuzmoTextFieldBase.prototype, "quiet", 2);
310
- __decorateClass([
311
- property({ type: Boolean, reflect: true })
312
- ], LuzmoTextFieldBase.prototype, "required", 2);
313
- __decorateClass([
314
- property({ type: String, reflect: true })
315
- ], LuzmoTextFieldBase.prototype, "autocomplete", 2);
316
- class LuzmoTextField extends LuzmoTextFieldBase {
317
- constructor() {
318
- super(...arguments);
319
- this._value = "";
320
- }
321
- set value(value) {
322
- if (value === this.value) {
323
- return;
324
- }
325
- const oldValue = this._value;
326
- this._value = value;
327
- this.requestUpdate("value", oldValue);
328
- }
329
- get value() {
330
- return this._value;
331
- }
332
- }
333
- __decorateClass([
334
- property({ type: String })
335
- ], LuzmoTextField.prototype, "value", 1);
336
- export {
337
- LuzmoTextField as L,
338
- LuzmoTextFieldBase as a
339
- };