@latty-ds/web 0.2.0

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/custom-elements.json +8785 -0
  4. package/dist/base/index.d.ts +1 -0
  5. package/dist/base/index.js +35 -0
  6. package/dist/base/themeable-element.d.ts +20 -0
  7. package/dist/components/accordion/accordion.d.ts +82 -0
  8. package/dist/components/accordion/accordion.styles.d.ts +1 -0
  9. package/dist/components/accordion/accordion.types.d.ts +10 -0
  10. package/dist/components/accordion/index.d.ts +8 -0
  11. package/dist/components/accordion/index.js +468 -0
  12. package/dist/components/alert/alert.d.ts +51 -0
  13. package/dist/components/alert/alert.styles.d.ts +1 -0
  14. package/dist/components/alert/alert.types.d.ts +2 -0
  15. package/dist/components/alert/index.d.ts +2 -0
  16. package/dist/components/alert/index.js +746 -0
  17. package/dist/components/avatar/avatar.d.ts +27 -0
  18. package/dist/components/avatar/avatar.styles.d.ts +1 -0
  19. package/dist/components/avatar/avatar.types.d.ts +3 -0
  20. package/dist/components/avatar/index.d.ts +2 -0
  21. package/dist/components/avatar/index.js +222 -0
  22. package/dist/components/badge/badge.d.ts +29 -0
  23. package/dist/components/badge/badge.styles.d.ts +1 -0
  24. package/dist/components/badge/badge.types.d.ts +3 -0
  25. package/dist/components/badge/index.d.ts +2 -0
  26. package/dist/components/badge/index.js +277 -0
  27. package/dist/components/breadcrumb/breadcrumb.d.ts +53 -0
  28. package/dist/components/breadcrumb/breadcrumb.styles.d.ts +2 -0
  29. package/dist/components/breadcrumb/breadcrumb.types.d.ts +1 -0
  30. package/dist/components/breadcrumb/index.d.ts +2 -0
  31. package/dist/components/breadcrumb/index.js +166 -0
  32. package/dist/components/button/button.d.ts +111 -0
  33. package/dist/components/button/button.styles.d.ts +1 -0
  34. package/dist/components/button/button.types.d.ts +38 -0
  35. package/dist/components/button/index.d.ts +8 -0
  36. package/dist/components/button/index.js +466 -0
  37. package/dist/components/calendar/calendar.d.ts +84 -0
  38. package/dist/components/calendar/calendar.styles.d.ts +1 -0
  39. package/dist/components/calendar/calendar.types.d.ts +15 -0
  40. package/dist/components/calendar/index.d.ts +1 -0
  41. package/dist/components/calendar/index.js +958 -0
  42. package/dist/components/checkbox/checkbox.d.ts +113 -0
  43. package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
  44. package/dist/components/checkbox/checkbox.types.d.ts +21 -0
  45. package/dist/components/checkbox/index.d.ts +8 -0
  46. package/dist/components/checkbox/index.js +320 -0
  47. package/dist/components/chip/chip.d.ts +35 -0
  48. package/dist/components/chip/chip.styles.d.ts +1 -0
  49. package/dist/components/chip/chip.types.d.ts +3 -0
  50. package/dist/components/chip/index.d.ts +2 -0
  51. package/dist/components/chip/index.js +282 -0
  52. package/dist/components/color-input/color-input.d.ts +55 -0
  53. package/dist/components/color-input/color-input.styles.d.ts +1 -0
  54. package/dist/components/color-input/color-input.types.d.ts +2 -0
  55. package/dist/components/color-input/index.d.ts +1 -0
  56. package/dist/components/color-input/index.js +489 -0
  57. package/dist/components/combobox/combobox.d.ts +59 -0
  58. package/dist/components/combobox/combobox.styles.d.ts +1 -0
  59. package/dist/components/combobox/combobox.types.d.ts +7 -0
  60. package/dist/components/combobox/index.d.ts +2 -0
  61. package/dist/components/combobox/index.js +1988 -0
  62. package/dist/components/date-input/date-input.d.ts +66 -0
  63. package/dist/components/date-input/date-input.styles.d.ts +1 -0
  64. package/dist/components/date-input/date-input.types.d.ts +3 -0
  65. package/dist/components/date-input/index.d.ts +2 -0
  66. package/dist/components/date-input/index.js +2863 -0
  67. package/dist/components/datepicker/datepicker.d.ts +52 -0
  68. package/dist/components/datepicker/datepicker.styles.d.ts +1 -0
  69. package/dist/components/datepicker/datepicker.types.d.ts +3 -0
  70. package/dist/components/datepicker/index.d.ts +2 -0
  71. package/dist/components/datepicker/index.js +416 -0
  72. package/dist/components/dialog/dialog.d.ts +114 -0
  73. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  74. package/dist/components/dialog/dialog.types.d.ts +11 -0
  75. package/dist/components/dialog/index.d.ts +2 -0
  76. package/dist/components/dialog/index.js +920 -0
  77. package/dist/components/divider/divider.d.ts +35 -0
  78. package/dist/components/divider/divider.styles.d.ts +1 -0
  79. package/dist/components/divider/divider.types.d.ts +2 -0
  80. package/dist/components/divider/index.d.ts +2 -0
  81. package/dist/components/divider/index.js +149 -0
  82. package/dist/components/dropdown/dropdown-item.d.ts +24 -0
  83. package/dist/components/dropdown/dropdown-item.styles.d.ts +1 -0
  84. package/dist/components/dropdown/dropdown.d.ts +30 -0
  85. package/dist/components/dropdown/dropdown.styles.d.ts +1 -0
  86. package/dist/components/dropdown/dropdown.types.d.ts +1 -0
  87. package/dist/components/dropdown/index.d.ts +3 -0
  88. package/dist/components/dropdown/index.js +1791 -0
  89. package/dist/components/header/header.d.ts +19 -0
  90. package/dist/components/header/header.styles.d.ts +1 -0
  91. package/dist/components/header/header.types.d.ts +1 -0
  92. package/dist/components/header/index.d.ts +2 -0
  93. package/dist/components/header/index.js +104 -0
  94. package/dist/components/icon-button/icon-button.d.ts +52 -0
  95. package/dist/components/icon-button/icon-button.styles.d.ts +1 -0
  96. package/dist/components/icon-button/icon-button.types.d.ts +8 -0
  97. package/dist/components/icon-button/index.d.ts +1 -0
  98. package/dist/components/icon-button/index.js +342 -0
  99. package/dist/components/image/image.d.ts +26 -0
  100. package/dist/components/image/image.styles.d.ts +1 -0
  101. package/dist/components/image/image.types.d.ts +0 -0
  102. package/dist/components/image/index.d.ts +1 -0
  103. package/dist/components/image/index.js +105 -0
  104. package/dist/components/link/index.d.ts +1 -0
  105. package/dist/components/link/index.js +108 -0
  106. package/dist/components/link/link.d.ts +22 -0
  107. package/dist/components/link/link.styles.d.ts +1 -0
  108. package/dist/components/link/link.types.d.ts +1 -0
  109. package/dist/components/list/index.d.ts +9 -0
  110. package/dist/components/list/index.js +254 -0
  111. package/dist/components/list/list-item.d.ts +41 -0
  112. package/dist/components/list/list-item.styles.d.ts +1 -0
  113. package/dist/components/list/list.d.ts +85 -0
  114. package/dist/components/list/list.styles.d.ts +1 -0
  115. package/dist/components/list/list.types.d.ts +16 -0
  116. package/dist/components/nav/index.d.ts +3 -0
  117. package/dist/components/nav/index.js +345 -0
  118. package/dist/components/nav/nav-item.d.ts +73 -0
  119. package/dist/components/nav/nav.d.ts +49 -0
  120. package/dist/components/nav/nav.styles.d.ts +2 -0
  121. package/dist/components/nav/nav.types.d.ts +1 -0
  122. package/dist/components/pagination/index.d.ts +2 -0
  123. package/dist/components/pagination/index.js +210 -0
  124. package/dist/components/pagination/pagination.d.ts +34 -0
  125. package/dist/components/pagination/pagination.styles.d.ts +1 -0
  126. package/dist/components/pagination/pagination.types.d.ts +1 -0
  127. package/dist/components/progress/index.d.ts +2 -0
  128. package/dist/components/progress/index.js +167 -0
  129. package/dist/components/progress/progress.d.ts +44 -0
  130. package/dist/components/progress/progress.styles.d.ts +1 -0
  131. package/dist/components/progress/progress.types.d.ts +2 -0
  132. package/dist/components/radio/index.d.ts +8 -0
  133. package/dist/components/radio/index.js +294 -0
  134. package/dist/components/radio/radio.d.ts +96 -0
  135. package/dist/components/radio/radio.styles.d.ts +1 -0
  136. package/dist/components/radio/radio.types.d.ts +21 -0
  137. package/dist/components/radio-group/index.d.ts +8 -0
  138. package/dist/components/radio-group/index.js +384 -0
  139. package/dist/components/radio-group/radio-group.d.ts +100 -0
  140. package/dist/components/radio-group/radio-group.styles.d.ts +1 -0
  141. package/dist/components/radio-group/radio-group.types.d.ts +8 -0
  142. package/dist/components/select/index.d.ts +8 -0
  143. package/dist/components/select/index.js +2123 -0
  144. package/dist/components/select/select.d.ts +129 -0
  145. package/dist/components/select/select.styles.d.ts +1 -0
  146. package/dist/components/select/select.types.d.ts +37 -0
  147. package/dist/components/shared/backdrop.styles.d.ts +1 -0
  148. package/dist/components/shared/floating.d.ts +10 -0
  149. package/dist/components/sidepanel/index.d.ts +1 -0
  150. package/dist/components/sidepanel/index.js +768 -0
  151. package/dist/components/sidepanel/sidepanel.d.ts +48 -0
  152. package/dist/components/sidepanel/sidepanel.styles.d.ts +1 -0
  153. package/dist/components/sidepanel/sidepanel.types.d.ts +1 -0
  154. package/dist/components/skeleton/index.d.ts +2 -0
  155. package/dist/components/skeleton/index.js +129 -0
  156. package/dist/components/skeleton/skeleton.d.ts +39 -0
  157. package/dist/components/skeleton/skeleton.styles.d.ts +1 -0
  158. package/dist/components/skeleton/skeleton.types.d.ts +1 -0
  159. package/dist/components/slider/index.d.ts +2 -0
  160. package/dist/components/slider/index.js +635 -0
  161. package/dist/components/slider/slider.d.ts +33 -0
  162. package/dist/components/slider/slider.styles.d.ts +1 -0
  163. package/dist/components/slider/slider.types.d.ts +1 -0
  164. package/dist/components/snackbar/index.d.ts +2 -0
  165. package/dist/components/snackbar/index.js +358 -0
  166. package/dist/components/snackbar/snackbar.d.ts +63 -0
  167. package/dist/components/snackbar/snackbar.styles.d.ts +1 -0
  168. package/dist/components/snackbar/snackbar.types.d.ts +1 -0
  169. package/dist/components/spinner/index.d.ts +8 -0
  170. package/dist/components/spinner/index.js +131 -0
  171. package/dist/components/spinner/spineer.styles.d.ts +1 -0
  172. package/dist/components/spinner/spinner.d.ts +52 -0
  173. package/dist/components/spinner/spinner.types.d.ts +18 -0
  174. package/dist/components/surface/index.d.ts +8 -0
  175. package/dist/components/surface/index.js +128 -0
  176. package/dist/components/surface/surface.d.ts +48 -0
  177. package/dist/components/surface/surface.styles.d.ts +1 -0
  178. package/dist/components/surface/surface.types.d.ts +20 -0
  179. package/dist/components/switch/index.d.ts +8 -0
  180. package/dist/components/switch/index.js +293 -0
  181. package/dist/components/switch/switch.d.ts +90 -0
  182. package/dist/components/switch/switch.styles.d.ts +1 -0
  183. package/dist/components/switch/switch.types.d.ts +21 -0
  184. package/dist/components/tab/index.d.ts +9 -0
  185. package/dist/components/tab/index.js +252 -0
  186. package/dist/components/tab/tab-panel.d.ts +28 -0
  187. package/dist/components/tab/tab-panel.styles.d.ts +1 -0
  188. package/dist/components/tab/tab.d.ts +59 -0
  189. package/dist/components/tab/tab.styles.d.ts +1 -0
  190. package/dist/components/tab/tab.types.d.ts +7 -0
  191. package/dist/components/tab-group/index.d.ts +8 -0
  192. package/dist/components/tab-group/index.js +441 -0
  193. package/dist/components/tab-group/tab-group.d.ts +99 -0
  194. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  195. package/dist/components/tab-group/tab-group.types.d.ts +11 -0
  196. package/dist/components/table/index.d.ts +2 -0
  197. package/dist/components/table/index.js +582 -0
  198. package/dist/components/table/table.d.ts +160 -0
  199. package/dist/components/table/table.styles.d.ts +1 -0
  200. package/dist/components/table/table.types.d.ts +106 -0
  201. package/dist/components/text/index.d.ts +1 -0
  202. package/dist/components/text/index.js +207 -0
  203. package/dist/components/text/text.d.ts +32 -0
  204. package/dist/components/text/text.styles.d.ts +1 -0
  205. package/dist/components/text/text.types.d.ts +2 -0
  206. package/dist/components/textfield/index.d.ts +8 -0
  207. package/dist/components/textfield/index.js +718 -0
  208. package/dist/components/textfield/textfield.d.ts +168 -0
  209. package/dist/components/textfield/textfield.styles.d.ts +1 -0
  210. package/dist/components/textfield/textfield.types.d.ts +40 -0
  211. package/dist/components/tooltip/index.d.ts +2 -0
  212. package/dist/components/tooltip/index.js +379 -0
  213. package/dist/components/tooltip/tooltip.d.ts +42 -0
  214. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  215. package/dist/components/tooltip/tooltip.types.d.ts +1 -0
  216. package/dist/css/font-face.css +22 -0
  217. package/dist/css/latty.css +57 -0
  218. package/dist/fonts/HankenGrotesk-Variable.woff2 +0 -0
  219. package/dist/fonts/HankenGrotesk-VariableItalic.woff2 +0 -0
  220. package/dist/index.cjs +12739 -0
  221. package/dist/index.d.ts +101 -0
  222. package/dist/index.js +11406 -0
  223. package/dist/manifest.json +2396 -0
  224. package/dist/utils/click-outside.d.ts +22 -0
  225. package/dist/utils/color.d.ts +14 -0
  226. package/dist/utils/dispatch.d.ts +18 -0
  227. package/dist/utils/index.d.ts +3 -0
  228. package/package.json +231 -0
@@ -0,0 +1,384 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+
12
+ // src/components/radio-group/radio-group.ts
13
+ import { html as html2, nothing } from "lit";
14
+
15
+ // src/base/themeable-element.ts
16
+ import { LitElement } from "lit";
17
+ import { property } from "lit/decorators.js";
18
+ var ThemeableElement = class extends LitElement {
19
+ willUpdate(changed) {
20
+ super.willUpdate(changed);
21
+ if (changed.has("theme")) {
22
+ this._syncThemeAttribute();
23
+ }
24
+ }
25
+ _syncThemeAttribute() {
26
+ if (this.theme === "dark" || this.theme === "light") {
27
+ this.setAttribute("data-theme", this.theme);
28
+ } else {
29
+ this.removeAttribute("data-theme");
30
+ }
31
+ }
32
+ };
33
+ __decorateClass([
34
+ property({ reflect: true })
35
+ ], ThemeableElement.prototype, "theme", 2);
36
+
37
+ // src/components/radio-group/radio-group.ts
38
+ import { customElement as customElement2, property as property3, queryAssignedElements } from "lit/decorators.js";
39
+
40
+ // src/components/radio-group/radio-group.styles.ts
41
+ import { css } from "lit";
42
+ var radioGroupStyles = css`
43
+ :host {
44
+ display: block;
45
+ font-family: 'Hanken Grotesk', sans-serif;
46
+ }
47
+
48
+ .radio-group {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: var(--lt-spacing-2);
52
+ }
53
+
54
+ .label {
55
+ color: var(--lt-text-default);
56
+ margin-bottom: var(--lt-spacing-1);
57
+ }
58
+
59
+ .required-indicator {
60
+ color: var(--lt-color-error-500);
61
+ margin-left: var(--lt-spacing-1);
62
+ }
63
+
64
+ .radios-container {
65
+ display: flex;
66
+ gap: var(--lt-spacing-3);
67
+ }
68
+
69
+ :host([orientation='vertical']) .radios-container {
70
+ flex-direction: column;
71
+ }
72
+
73
+ :host([orientation='horizontal']) .radios-container {
74
+ flex-direction: row;
75
+ flex-wrap: wrap;
76
+ }
77
+
78
+ .helper-text {
79
+ color: var(--lt-text-subtle);
80
+ margin-top: var(--lt-spacing-1);
81
+ }
82
+
83
+ .helper-text::part(base) {
84
+ font-weight: 200;
85
+ }
86
+
87
+ :host([error]) .helper-text {
88
+ color: var(--lt-text-error);
89
+ }
90
+ `;
91
+
92
+ // src/components/text/text.ts
93
+ import { customElement, property as property2 } from "lit/decorators.js";
94
+ import { html, unsafeStatic } from "lit/static-html.js";
95
+
96
+ // src/components/text/text.styles.ts
97
+ import { css as css2 } from "lit";
98
+ var textStyles = css2`
99
+ :host {
100
+ display: block;
101
+ color: inherit;
102
+ }
103
+
104
+ /* Inline variants sit in text flow */
105
+ :host([variant='caption']),
106
+ :host([variant='overline']),
107
+ :host([variant='label']) {
108
+ display: inline;
109
+ }
110
+
111
+ [part='base'] {
112
+ margin: 0;
113
+ color: inherit;
114
+ font-family: var(--lt-typography-fontfamily);
115
+ }
116
+
117
+ /* ── Display ─────────────────────────────────────────────────────────── */
118
+
119
+ :host([variant='display-2xl']) [part='base'] {
120
+ font-size: clamp(2.5rem, 6vw, 4.5rem);
121
+ font-weight: var(--lt-text-weight, 200);
122
+ line-height: 1.1;
123
+ letter-spacing: -0.02em;
124
+ }
125
+
126
+ :host([variant='display-xl']) [part='base'] {
127
+ font-size: clamp(2rem, 5vw, 3.75rem);
128
+ font-weight: var(--lt-text-weight, 200);
129
+ line-height: 1.1;
130
+ letter-spacing: -0.02em;
131
+ }
132
+
133
+ :host([variant='display-lg']) [part='base'] {
134
+ font-size: clamp(2rem, 4vw, 3rem);
135
+ font-weight: var(--lt-text-weight, 200);
136
+ line-height: 1.15;
137
+ letter-spacing: -0.01em;
138
+ }
139
+
140
+ /* ── Headings ─────────────────────────────────────────────────────────── */
141
+
142
+ :host([variant='h1']) [part='base'] {
143
+ font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.5rem);
144
+ font-weight: var(--lt-text-weight, 600);
145
+ line-height: 1.2;
146
+ letter-spacing: -0.02em;
147
+ }
148
+
149
+ :host([variant='h2']) [part='base'] {
150
+ font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
151
+ font-weight: var(--lt-text-weight, 600);
152
+ line-height: 1.25;
153
+ letter-spacing: -0.01em;
154
+ }
155
+
156
+ :host([variant='h3']) [part='base'] {
157
+ font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
158
+ font-weight: var(--lt-text-weight, 600);
159
+ line-height: 1.3;
160
+ }
161
+
162
+ :host([variant='h4']) [part='base'] {
163
+ font-size: 1.25rem;
164
+ font-weight: var(--lt-text-weight, 600);
165
+ line-height: 1.35;
166
+ }
167
+
168
+ :host([variant='h5']) [part='base'] {
169
+ font-size: 1.125rem;
170
+ font-weight: var(--lt-text-weight, 600);
171
+ line-height: 1.4;
172
+ }
173
+
174
+ :host([variant='h6']) [part='base'] {
175
+ font-size: 1rem;
176
+ font-weight: var(--lt-text-weight, 600);
177
+ line-height: 1.4;
178
+ }
179
+
180
+ /* ── Body ─────────────────────────────────────────────────────────────── */
181
+
182
+ :host([variant='lead']) [part='base'] {
183
+ font-size: 1.25rem;
184
+ font-weight: var(--lt-text-weight, 400);
185
+ line-height: 1.6;
186
+ }
187
+
188
+ :host([variant='body']) [part='base'],
189
+ :host(:not([variant])) [part='base'] {
190
+ font-size: 1rem;
191
+ font-weight: var(--lt-text-weight, 400);
192
+ line-height: 1.6;
193
+ }
194
+
195
+ :host([variant='body-sm']) [part='base'] {
196
+ font-size: 0.875rem;
197
+ font-weight: var(--lt-text-weight, 400);
198
+ line-height: 1.6;
199
+ }
200
+
201
+ /* ── Inline ───────────────────────────────────────────────────────────── */
202
+
203
+ :host([variant='caption']) [part='base'] {
204
+ font-size: 0.75rem;
205
+ font-weight: var(--lt-text-weight, 400);
206
+ line-height: 1.5;
207
+ }
208
+
209
+ :host([variant='overline']) [part='base'] {
210
+ font-size: 0.6875rem;
211
+ font-weight: var(--lt-text-weight, 600);
212
+ line-height: 1.2;
213
+ letter-spacing: 0.08em;
214
+ text-transform: uppercase;
215
+ }
216
+
217
+ :host([variant='label']) [part='base'] {
218
+ font-size: 0.875rem;
219
+ font-weight: var(--lt-text-weight, 600);
220
+ line-height: 1.4;
221
+ }
222
+ `;
223
+
224
+ // src/components/text/text.ts
225
+ var VARIANT_TAG = {
226
+ "display-2xl": "p",
227
+ "display-xl": "p",
228
+ "display-lg": "p",
229
+ h1: "h1",
230
+ h2: "h2",
231
+ h3: "h3",
232
+ h4: "h4",
233
+ h5: "h5",
234
+ h6: "h6",
235
+ lead: "p",
236
+ body: "p",
237
+ "body-sm": "p",
238
+ caption: "span",
239
+ overline: "span",
240
+ label: "span"
241
+ };
242
+ var Text = class extends ThemeableElement {
243
+ constructor() {
244
+ super(...arguments);
245
+ this.variant = "body";
246
+ this.as = "";
247
+ }
248
+ render() {
249
+ const tag = unsafeStatic(this.as || VARIANT_TAG[this.variant] || "p");
250
+ return html`<${tag} part="base"><slot></slot></${tag}>`;
251
+ }
252
+ };
253
+ Text.styles = textStyles;
254
+ __decorateClass([
255
+ property2({ reflect: true })
256
+ ], Text.prototype, "variant", 2);
257
+ __decorateClass([
258
+ property2({ reflect: true })
259
+ ], Text.prototype, "as", 2);
260
+ Text = __decorateClass([
261
+ customElement("lt-text")
262
+ ], Text);
263
+
264
+ // src/components/radio-group/radio-group.ts
265
+ var RadioGroup = class extends ThemeableElement {
266
+ constructor() {
267
+ super(...arguments);
268
+ this.label = "";
269
+ this.name = "";
270
+ this.value = "";
271
+ this.orientation = "vertical";
272
+ this.helperText = "";
273
+ this.error = false;
274
+ this.required = false;
275
+ this._attached = /* @__PURE__ */ new WeakSet();
276
+ /**
277
+ * Handles change events from individual radio buttons.
278
+ * Updates the group value and ensures only one radio is checked.
279
+ *
280
+ * @param e - The change event from a radio button
281
+ * @private
282
+ */
283
+ this.handleRadioChange = (e) => {
284
+ const radio = e.target;
285
+ if (radio.checked) {
286
+ this.value = radio.value;
287
+ this.radios.forEach((r) => {
288
+ if (r !== radio) {
289
+ r.checked = false;
290
+ }
291
+ });
292
+ this.dispatchEvent(
293
+ new CustomEvent("change", {
294
+ detail: { value: this.value },
295
+ bubbles: true,
296
+ composed: true
297
+ })
298
+ );
299
+ }
300
+ };
301
+ }
302
+ firstUpdated() {
303
+ this._syncRadios();
304
+ const checkedRadio = this.radios?.find((r) => r.checked);
305
+ if (checkedRadio && !this.value) {
306
+ this.value = checkedRadio.value;
307
+ }
308
+ }
309
+ _syncRadios() {
310
+ if (!this.radios) return;
311
+ this.radios.forEach((radio) => {
312
+ if (this.name) radio.name = this.name;
313
+ if (!this._attached.has(radio)) {
314
+ radio.addEventListener("change", this.handleRadioChange);
315
+ this._attached.add(radio);
316
+ }
317
+ });
318
+ }
319
+ /**
320
+ * Handles slot changes to update radios when content changes.
321
+ * @private
322
+ */
323
+ handleSlotChange() {
324
+ this._syncRadios();
325
+ }
326
+ /**
327
+ * Cleanup event listeners when component is removed.
328
+ */
329
+ disconnectedCallback() {
330
+ super.disconnectedCallback();
331
+ if (this.radios) {
332
+ this.radios.forEach((radio) => {
333
+ radio.removeEventListener("change", this.handleRadioChange);
334
+ });
335
+ }
336
+ }
337
+ render() {
338
+ return html2`
339
+ <div class="radio-group" role="radiogroup" aria-label=${this.label || nothing}>
340
+ ${this.label ? html2`
341
+ <div class="label">
342
+ <lt-text variant="label" as="span">${this.label}</lt-text>
343
+ ${this.required ? html2`<span class="required-indicator">*</span>` : ""}
344
+ </div>
345
+ ` : ""}
346
+ <div class="radios-container">
347
+ <slot @slotchange=${this.handleSlotChange}></slot>
348
+ </div>
349
+ ${this.helperText ? html2`<lt-text variant="caption" as="span" class="helper-text">${this.helperText}</lt-text>` : ""}
350
+ </div>
351
+ `;
352
+ }
353
+ };
354
+ RadioGroup.styles = radioGroupStyles;
355
+ __decorateClass([
356
+ property3()
357
+ ], RadioGroup.prototype, "label", 2);
358
+ __decorateClass([
359
+ property3()
360
+ ], RadioGroup.prototype, "name", 2);
361
+ __decorateClass([
362
+ property3()
363
+ ], RadioGroup.prototype, "value", 2);
364
+ __decorateClass([
365
+ property3({ reflect: true })
366
+ ], RadioGroup.prototype, "orientation", 2);
367
+ __decorateClass([
368
+ property3({ attribute: "helper-text" })
369
+ ], RadioGroup.prototype, "helperText", 2);
370
+ __decorateClass([
371
+ property3({ type: Boolean, reflect: true })
372
+ ], RadioGroup.prototype, "error", 2);
373
+ __decorateClass([
374
+ property3({ type: Boolean, reflect: true })
375
+ ], RadioGroup.prototype, "required", 2);
376
+ __decorateClass([
377
+ queryAssignedElements({ selector: "lt-radio" })
378
+ ], RadioGroup.prototype, "radios", 2);
379
+ RadioGroup = __decorateClass([
380
+ customElement2("lt-radio-group")
381
+ ], RadioGroup);
382
+ export {
383
+ RadioGroup
384
+ };
@@ -0,0 +1,100 @@
1
+ import { ThemeableElement } from '../../base';
2
+ import { RadioGroupOrientation } from './radio-group.types';
3
+ import '../text/text';
4
+ /**
5
+ * A container component that manages a group of radio buttons.
6
+ *
7
+ * @element lt-radio-group
8
+ *
9
+ * @fires {CustomEvent<{value: string}>} change - Dispatched when a radio in the group is selected
10
+ *
11
+ * @slot - Radio buttons to be managed by this group
12
+ *
13
+ * @example
14
+ * ```html
15
+ * <lt-radio-group label="Choose a plan" name="plan">
16
+ * <lt-radio value="free" label="Free"></lt-radio>
17
+ * <lt-radio value="pro" label="Pro" checked></lt-radio>
18
+ * <lt-radio value="enterprise" label="Enterprise"></lt-radio>
19
+ * </lt-radio-group>
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```html
24
+ * <lt-radio-group
25
+ * label="Shipping method"
26
+ * name="shipping"
27
+ * orientation="horizontal"
28
+ * helper-text="Choose your preferred shipping method"
29
+ * >
30
+ * <lt-radio value="standard" label="Standard"></lt-radio>
31
+ * <lt-radio value="express" label="Express"></lt-radio>
32
+ * <lt-radio value="overnight" label="Overnight"></lt-radio>
33
+ * </lt-radio-group>
34
+ * ```
35
+ */
36
+ export declare class RadioGroup extends ThemeableElement {
37
+ static styles: import("lit").CSSResult;
38
+ /**
39
+ * Label for the radio group.
40
+ * @default ''
41
+ */
42
+ label: string;
43
+ /**
44
+ * Name attribute applied to all radio buttons in the group.
45
+ * Ensures only one radio can be selected at a time.
46
+ * @default ''
47
+ */
48
+ name: string;
49
+ /**
50
+ * Currently selected value in the group.
51
+ * @default ''
52
+ */
53
+ value: string;
54
+ /**
55
+ * Layout orientation of the radio buttons.
56
+ * @default 'vertical'
57
+ */
58
+ orientation: RadioGroupOrientation;
59
+ /**
60
+ * Helper text displayed below the radio group.
61
+ * @default ''
62
+ */
63
+ helperText: string;
64
+ /**
65
+ * Whether the radio group is in an error state.
66
+ * @default false
67
+ */
68
+ error: boolean;
69
+ /**
70
+ * Whether selection is required.
71
+ * @default false
72
+ */
73
+ required: boolean;
74
+ /**
75
+ * Reference to all slotted radio elements.
76
+ * @private
77
+ */
78
+ private radios;
79
+ private _attached;
80
+ firstUpdated(): void;
81
+ private _syncRadios;
82
+ /**
83
+ * Handles change events from individual radio buttons.
84
+ * Updates the group value and ensures only one radio is checked.
85
+ *
86
+ * @param e - The change event from a radio button
87
+ * @private
88
+ */
89
+ private handleRadioChange;
90
+ /**
91
+ * Handles slot changes to update radios when content changes.
92
+ * @private
93
+ */
94
+ private handleSlotChange;
95
+ /**
96
+ * Cleanup event listeners when component is removed.
97
+ */
98
+ disconnectedCallback(): void;
99
+ render(): import("lit").TemplateResult<1>;
100
+ }
@@ -0,0 +1 @@
1
+ export declare const radioGroupStyles: import("lit").CSSResult;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Orientation of the radio group.
3
+ * Determines the layout direction of the radio buttons.
4
+ *
5
+ * - `vertical`: Stack radios vertically (default)
6
+ * - `horizontal`: Arrange radios horizontally
7
+ */
8
+ export type RadioGroupOrientation = 'vertical' | 'horizontal';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Select component module.
3
+ * Exports the Select web component and related type definitions.
4
+ *
5
+ * @module components/select
6
+ */
7
+ export { Select } from './select';
8
+ export type { SelectOption, SelectSize, SelectVariant } from './select.types';