@ds-gn/ui 0.10.0 → 0.11.1
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.
- package/README.md +4 -4
- package/custom-elements.json +5511 -2144
- package/dist/common/controllers/OverlayDismissController.d.ts +52 -0
- package/dist/common/controllers/OverlayPositionController.d.ts +168 -0
- package/dist/common/controllers/RovingFocusController.d.ts +99 -0
- package/dist/common/helpers/field-control.d.ts +35 -0
- package/dist/common/helpers/listbox-navigation.d.ts +50 -0
- package/dist/common/props/size/size.props.d.ts +11 -0
- package/dist/common/styles/overlay-panel.styles.d.ts +55 -0
- package/dist/components/Button/src/Button.d.ts +20 -0
- package/dist/components/Button/src/Button.js +28 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.d.ts +150 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.js +1550 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.playground.d.ts +2 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.props.d.ts +47 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.props.js +54 -0
- package/dist/components/DropdownMenu/src/DropdownMenu.styles.d.ts +20 -0
- package/dist/components/Field/src/Field.d.ts +39 -0
- package/dist/components/Field/src/Field.js +203 -0
- package/dist/components/Field/src/Field.playground.d.ts +2 -0
- package/dist/components/Field/src/Field.styles.d.ts +6 -0
- package/dist/components/Icon/src/Icon.d.ts +5 -0
- package/dist/components/Icon/src/Icon.js +3 -0
- package/dist/components/Icon/src/icons/arrow-down.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-down.js +6 -0
- package/dist/components/Icon/src/icons/arrow-up.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-up.js +6 -0
- package/dist/components/Icon/src/icons/chevrons-up-down.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevrons-up-down.js +6 -0
- package/dist/components/Icon/src/icons/cookie.d.ts +1 -0
- package/dist/components/Icon/src/icons/cookie.js +6 -0
- package/dist/components/Icon/src/icons/icon-names.d.ts +1 -1
- package/dist/components/Icon/src/icons/icon-names.js +4 -0
- package/dist/components/Icon/src/icons/index.d.ts +4 -0
- package/dist/components/Icon/src/icons/index.js +4 -0
- package/dist/components/Input/src/Input.d.ts +37 -0
- package/dist/components/Input/src/Input.js +300 -143
- package/dist/components/Input/src/Input.props.d.ts +2 -1
- package/dist/components/Input/src/Input.props.js +12 -6
- package/dist/components/Input/src/Input.styles.d.ts +12 -4
- package/dist/components/Modal/src/Modal.d.ts +1 -0
- package/dist/components/Modal/src/Modal.js +1 -0
- package/dist/components/Nav/src/Nav.js +2 -1
- package/dist/components/NavLink/src/NavLink.d.ts +14 -30
- package/dist/components/NavLink/src/NavLink.js +201 -65
- package/dist/components/Select/src/Select.d.ts +157 -0
- package/dist/components/Select/src/Select.js +1766 -0
- package/dist/components/Select/src/Select.playground.d.ts +2 -0
- package/dist/components/Select/src/Select.props.d.ts +19 -0
- package/dist/components/Select/src/Select.props.js +40 -0
- package/dist/components/Select/src/Select.styles.d.ts +30 -0
- package/dist/components/Table/src/Table.d.ts +93 -0
- package/dist/components/Table/src/Table.js +1105 -0
- package/dist/components/Table/src/Table.playground.d.ts +2 -0
- package/dist/components/Table/src/Table.props.d.ts +53 -0
- package/dist/components/Table/src/Table.props.js +18 -0
- package/dist/components/Table/src/Table.styles.d.ts +33 -0
- package/dist/components/Toaster/src/Toaster.d.ts +174 -0
- package/dist/components/Toaster/src/Toaster.js +1489 -0
- package/dist/components/Toaster/src/Toaster.playground.d.ts +2 -0
- package/dist/components/Toaster/src/Toaster.props.d.ts +14 -0
- package/dist/components/Toaster/src/Toaster.props.js +81 -0
- package/dist/components/Toaster/src/Toaster.styles.d.ts +52 -0
- package/dist/components/Toaster/src/toast.d.ts +115 -0
- package/dist/components/Toaster/src/toast.js +74 -0
- package/dist/playground/types.d.ts +27 -0
- package/dist/playground-manifest.d.ts +3 -2
- package/dist/playground-manifest.js +507 -7
- package/dist/react/DropdownMenu.d.ts +8 -0
- package/dist/react/DropdownMenu.js +13 -0
- package/dist/react/Field.d.ts +6 -0
- package/dist/react/Field.js +13 -0
- package/dist/react/Select.d.ts +8 -0
- package/dist/react/Select.js +13 -0
- package/dist/react/Table.d.ts +8 -0
- package/dist/react/Table.js +13 -0
- package/dist/react/Toaster.d.ts +8 -0
- package/dist/react/Toaster.js +13 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +6 -0
- package/package.json +54 -4
|
@@ -91,6 +91,16 @@ class Base extends LitElement {
|
|
|
91
91
|
}
|
|
92
92
|
defineElement("dsgn-base", Base);
|
|
93
93
|
|
|
94
|
+
// common/helpers/field-control.ts
|
|
95
|
+
var FIELD_CONTROL = Symbol.for("dsgn.field-control");
|
|
96
|
+
var markFieldControl = (ctor) => {
|
|
97
|
+
Object.defineProperty(ctor, FIELD_CONTROL, { value: true });
|
|
98
|
+
};
|
|
99
|
+
var describedBy = (...ids) => {
|
|
100
|
+
const value = ids.filter(Boolean).join(" ");
|
|
101
|
+
return value || undefined;
|
|
102
|
+
};
|
|
103
|
+
|
|
94
104
|
// common/helpers/enum-validator.ts
|
|
95
105
|
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
96
106
|
if (!enumSet.has(candidateValue)) {
|
|
@@ -120,7 +130,9 @@ var surfaceValues = {
|
|
|
120
130
|
DARK: "dark"
|
|
121
131
|
};
|
|
122
132
|
var surfaceProps = enumCreator(Object.values(surfaceValues), "surface", String, { reflect: true });
|
|
123
|
-
|
|
133
|
+
// components/Icon/src/icons/circle-alert.ts
|
|
134
|
+
import { svg } from "lit";
|
|
135
|
+
var circleAlert = svg`<circle cx="12" cy="12" r="10" /><line x1="12" x2="12" y1="8" y2="12" /><line x1="12" x2="12.01" y1="16" y2="16" />`;
|
|
124
136
|
// components/Input/src/Input.css
|
|
125
137
|
import { css as css2 } from "lit";
|
|
126
138
|
var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
@@ -130,32 +142,47 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
130
142
|
--font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
131
143
|
'Noto Color Emoji';
|
|
132
144
|
--spacing: 0.25rem;
|
|
145
|
+
--text-xs: 0.75rem;
|
|
146
|
+
--text-xs--line-height: calc(1 / 0.75);
|
|
133
147
|
--text-sm: 0.875rem;
|
|
134
148
|
--text-sm--line-height: calc(1.25 / 0.875);
|
|
135
149
|
--text-base: 1rem;
|
|
136
150
|
--text-base--line-height: calc(1.5 / 1);
|
|
137
|
-
--text-lg: 1.125rem;
|
|
138
|
-
--text-lg--line-height: calc(1.75 / 1.125);
|
|
139
151
|
--font-weight-medium: 500;
|
|
140
152
|
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
141
153
|
--default-transition-duration: 150ms;
|
|
142
154
|
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
155
|
+
--radius-control: var(--dsgn-src-radius-control, 0.375rem);
|
|
156
|
+
--radius-input: var(--dsgn-src-radius-input, var(--radius-control));
|
|
143
157
|
--color-error: inherit;
|
|
158
|
+
--color-error-strong: inherit;
|
|
144
159
|
--color-input-bg: inherit;
|
|
160
|
+
--color-input-bg-disabled: inherit;
|
|
161
|
+
--color-input-bg-readonly: inherit;
|
|
145
162
|
--color-input-border: inherit;
|
|
163
|
+
--color-input-border-disabled: inherit;
|
|
164
|
+
--color-input-border-hover: inherit;
|
|
165
|
+
--color-input-border-readonly: inherit;
|
|
166
|
+
--color-input-error-ring: inherit;
|
|
146
167
|
--color-input-error-text: inherit;
|
|
147
168
|
--color-input-focus: inherit;
|
|
169
|
+
--color-input-focus-ring: inherit;
|
|
148
170
|
--color-input-placeholder: inherit;
|
|
149
171
|
--color-input-text: inherit;
|
|
172
|
+
--color-input-text-disabled: inherit;
|
|
150
173
|
--color-text-primary: inherit;
|
|
174
|
+
--color-text-secondary: inherit;
|
|
151
175
|
}
|
|
152
176
|
}
|
|
153
177
|
@layer utilities {
|
|
178
|
+
.visible {
|
|
179
|
+
visibility: visible;
|
|
180
|
+
}
|
|
154
181
|
.static {
|
|
155
182
|
position: static;
|
|
156
183
|
}
|
|
157
|
-
.
|
|
158
|
-
|
|
184
|
+
.box-border {
|
|
185
|
+
box-sizing: border-box;
|
|
159
186
|
}
|
|
160
187
|
.block {
|
|
161
188
|
display: block;
|
|
@@ -163,25 +190,24 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
163
190
|
.flex {
|
|
164
191
|
display: flex;
|
|
165
192
|
}
|
|
193
|
+
.size-3\\.5 {
|
|
194
|
+
width: calc(var(--spacing) * 3.5);
|
|
195
|
+
height: calc(var(--spacing) * 3.5);
|
|
196
|
+
}
|
|
197
|
+
.h-8 {
|
|
198
|
+
height: calc(var(--spacing) * 8);
|
|
199
|
+
}
|
|
166
200
|
.h-10 {
|
|
167
201
|
height: calc(var(--spacing) * 10);
|
|
168
202
|
}
|
|
169
|
-
.
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
.max-h-12 {
|
|
173
|
-
max-height: calc(var(--spacing) * 12);
|
|
203
|
+
.h-12 {
|
|
204
|
+
height: calc(var(--spacing) * 12);
|
|
174
205
|
}
|
|
175
206
|
.w-full {
|
|
176
207
|
width: 100%;
|
|
177
208
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
181
|
-
}
|
|
182
|
-
.translate-y-0 {
|
|
183
|
-
--tw-translate-y: calc(var(--spacing) * 0);
|
|
184
|
-
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
209
|
+
.shrink-0 {
|
|
210
|
+
flex-shrink: 0;
|
|
185
211
|
}
|
|
186
212
|
.cursor-not-allowed {
|
|
187
213
|
cursor: not-allowed;
|
|
@@ -189,11 +215,14 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
189
215
|
.flex-col {
|
|
190
216
|
flex-direction: column;
|
|
191
217
|
}
|
|
192
|
-
.
|
|
193
|
-
|
|
218
|
+
.items-center {
|
|
219
|
+
align-items: center;
|
|
194
220
|
}
|
|
195
|
-
.
|
|
196
|
-
|
|
221
|
+
.gap-1\\.5 {
|
|
222
|
+
gap: calc(var(--spacing) * 1.5);
|
|
223
|
+
}
|
|
224
|
+
.rounded-\\[var\\(--radius-input\\,0\\.375rem\\)\\] {
|
|
225
|
+
border-radius: var(--radius-input,0.375rem);
|
|
197
226
|
}
|
|
198
227
|
.border {
|
|
199
228
|
border-style: var(--tw-border-style);
|
|
@@ -205,23 +234,38 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
205
234
|
.border-input-border {
|
|
206
235
|
border-color: var(--color-input-border);
|
|
207
236
|
}
|
|
237
|
+
.border-input-border-disabled {
|
|
238
|
+
border-color: var(--color-input-border-disabled);
|
|
239
|
+
}
|
|
240
|
+
.border-input-border-readonly {
|
|
241
|
+
border-color: var(--color-input-border-readonly);
|
|
242
|
+
}
|
|
208
243
|
.bg-input-bg {
|
|
209
244
|
background-color: var(--color-input-bg);
|
|
210
245
|
}
|
|
211
|
-
.
|
|
212
|
-
|
|
246
|
+
.bg-input-bg-disabled {
|
|
247
|
+
background-color: var(--color-input-bg-disabled);
|
|
248
|
+
}
|
|
249
|
+
.bg-input-bg-readonly {
|
|
250
|
+
background-color: var(--color-input-bg-readonly);
|
|
213
251
|
}
|
|
214
|
-
.
|
|
215
|
-
|
|
252
|
+
.fill-none {
|
|
253
|
+
fill: none;
|
|
216
254
|
}
|
|
217
|
-
.
|
|
218
|
-
|
|
255
|
+
.stroke-current {
|
|
256
|
+
stroke: currentcolor;
|
|
219
257
|
}
|
|
220
|
-
.
|
|
221
|
-
|
|
258
|
+
.stroke-\\[1\\.75\\] {
|
|
259
|
+
stroke-width: 1.75;
|
|
260
|
+
}
|
|
261
|
+
.px-2\\.5 {
|
|
262
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
263
|
+
}
|
|
264
|
+
.px-3 {
|
|
265
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
222
266
|
}
|
|
223
|
-
.
|
|
224
|
-
padding-
|
|
267
|
+
.px-3\\.5 {
|
|
268
|
+
padding-inline: calc(var(--spacing) * 3.5);
|
|
225
269
|
}
|
|
226
270
|
.text-left {
|
|
227
271
|
text-align: left;
|
|
@@ -233,92 +277,111 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
233
277
|
font-size: var(--text-base);
|
|
234
278
|
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
235
279
|
}
|
|
236
|
-
.text-lg {
|
|
237
|
-
font-size: var(--text-lg);
|
|
238
|
-
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
239
|
-
}
|
|
240
280
|
.text-sm {
|
|
241
281
|
font-size: var(--text-sm);
|
|
242
282
|
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
243
283
|
}
|
|
284
|
+
.text-xs {
|
|
285
|
+
font-size: var(--text-xs);
|
|
286
|
+
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
287
|
+
}
|
|
288
|
+
.text-\\[13px\\] {
|
|
289
|
+
font-size: 13px;
|
|
290
|
+
}
|
|
291
|
+
.text-\\[15px\\] {
|
|
292
|
+
font-size: 15px;
|
|
293
|
+
}
|
|
294
|
+
.leading-4 {
|
|
295
|
+
--tw-leading: calc(var(--spacing) * 4);
|
|
296
|
+
line-height: calc(var(--spacing) * 4);
|
|
297
|
+
}
|
|
298
|
+
.leading-5 {
|
|
299
|
+
--tw-leading: calc(var(--spacing) * 5);
|
|
300
|
+
line-height: calc(var(--spacing) * 5);
|
|
301
|
+
}
|
|
302
|
+
.leading-\\[18px\\] {
|
|
303
|
+
--tw-leading: 18px;
|
|
304
|
+
line-height: 18px;
|
|
305
|
+
}
|
|
306
|
+
.leading-\\[22px\\] {
|
|
307
|
+
--tw-leading: 22px;
|
|
308
|
+
line-height: 22px;
|
|
309
|
+
}
|
|
244
310
|
.font-medium {
|
|
245
311
|
--tw-font-weight: var(--font-weight-medium);
|
|
246
312
|
font-weight: var(--font-weight-medium);
|
|
247
313
|
}
|
|
314
|
+
.text-error-strong {
|
|
315
|
+
color: var(--color-error-strong);
|
|
316
|
+
}
|
|
248
317
|
.text-input-error-text {
|
|
249
318
|
color: var(--color-input-error-text);
|
|
250
319
|
}
|
|
251
320
|
.text-input-text {
|
|
252
321
|
color: var(--color-input-text);
|
|
253
322
|
}
|
|
323
|
+
.text-input-text-disabled {
|
|
324
|
+
color: var(--color-input-text-disabled);
|
|
325
|
+
}
|
|
254
326
|
.text-text-primary {
|
|
255
327
|
color: var(--color-text-primary);
|
|
256
328
|
}
|
|
257
|
-
.
|
|
258
|
-
|
|
259
|
-
color: var(--color-input-placeholder);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
.opacity-50 {
|
|
263
|
-
opacity: 50%;
|
|
329
|
+
.text-text-secondary {
|
|
330
|
+
color: var(--color-text-secondary);
|
|
264
331
|
}
|
|
265
|
-
.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
332
|
+
.shadow {
|
|
333
|
+
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
334
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
269
335
|
}
|
|
270
|
-
.transition-
|
|
271
|
-
transition-property:
|
|
336
|
+
.transition-\\[border-color\\,box-shadow\\] {
|
|
337
|
+
transition-property: border-color,box-shadow;
|
|
272
338
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
273
339
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
274
340
|
}
|
|
275
|
-
.
|
|
276
|
-
|
|
277
|
-
transition-
|
|
278
|
-
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
279
|
-
}
|
|
280
|
-
.duration-200 {
|
|
281
|
-
--tw-duration: 200ms;
|
|
282
|
-
transition-duration: 200ms;
|
|
283
|
-
}
|
|
284
|
-
.duration-\\[250ms\\] {
|
|
285
|
-
--tw-duration: 250ms;
|
|
286
|
-
transition-duration: 250ms;
|
|
341
|
+
.duration-150 {
|
|
342
|
+
--tw-duration: 150ms;
|
|
343
|
+
transition-duration: 150ms;
|
|
287
344
|
}
|
|
288
345
|
.ease-out {
|
|
289
346
|
--tw-ease: var(--ease-out);
|
|
290
347
|
transition-timing-function: var(--ease-out);
|
|
291
348
|
}
|
|
292
|
-
.
|
|
293
|
-
|
|
294
|
-
|
|
349
|
+
.outline-none {
|
|
350
|
+
--tw-outline-style: none;
|
|
351
|
+
outline-style: none;
|
|
352
|
+
}
|
|
353
|
+
.placeholder\\:text-input-placeholder {
|
|
354
|
+
&::placeholder {
|
|
355
|
+
color: var(--color-input-placeholder);
|
|
295
356
|
}
|
|
296
357
|
}
|
|
297
|
-
.
|
|
298
|
-
&:
|
|
299
|
-
|
|
358
|
+
.hover\\:border-input-border-hover {
|
|
359
|
+
&:hover {
|
|
360
|
+
@media (hover: hover) {
|
|
361
|
+
border-color: var(--color-input-border-hover);
|
|
362
|
+
}
|
|
300
363
|
}
|
|
301
364
|
}
|
|
302
|
-
.focus\\:
|
|
303
|
-
&:focus {
|
|
304
|
-
|
|
305
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
365
|
+
.focus-visible\\:border-input-focus {
|
|
366
|
+
&:focus-visible {
|
|
367
|
+
border-color: var(--color-input-focus);
|
|
306
368
|
}
|
|
307
369
|
}
|
|
308
|
-
.focus\\:
|
|
309
|
-
&:focus {
|
|
310
|
-
--tw-
|
|
370
|
+
.focus-visible\\:shadow-\\[0_0_0_3px_var\\(--color-input-error-ring\\)\\] {
|
|
371
|
+
&:focus-visible {
|
|
372
|
+
--tw-shadow: 0 0 0 3px var(--tw-shadow-color, var(--color-input-error-ring));
|
|
373
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
311
374
|
}
|
|
312
375
|
}
|
|
313
|
-
.focus\\:
|
|
314
|
-
&:focus {
|
|
315
|
-
--tw-
|
|
376
|
+
.focus-visible\\:shadow-\\[0_0_0_3px_var\\(--color-input-focus-ring\\)\\] {
|
|
377
|
+
&:focus-visible {
|
|
378
|
+
--tw-shadow: 0 0 0 3px var(--tw-shadow-color, var(--color-input-focus-ring));
|
|
379
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
316
380
|
}
|
|
317
381
|
}
|
|
318
|
-
.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
outline-style: none;
|
|
382
|
+
.motion-reduce\\:transition-none {
|
|
383
|
+
@media (prefers-reduced-motion: reduce) {
|
|
384
|
+
transition-property: none;
|
|
322
385
|
}
|
|
323
386
|
}
|
|
324
387
|
}
|
|
@@ -327,35 +390,16 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
327
390
|
inherits: false;
|
|
328
391
|
initial-value: 0deg;
|
|
329
392
|
}
|
|
330
|
-
@property --tw-translate-x {
|
|
331
|
-
syntax: "*";
|
|
332
|
-
inherits: false;
|
|
333
|
-
initial-value: 0;
|
|
334
|
-
}
|
|
335
|
-
@property --tw-translate-y {
|
|
336
|
-
syntax: "*";
|
|
337
|
-
inherits: false;
|
|
338
|
-
initial-value: 0;
|
|
339
|
-
}
|
|
340
|
-
@property --tw-translate-z {
|
|
341
|
-
syntax: "*";
|
|
342
|
-
inherits: false;
|
|
343
|
-
initial-value: 0;
|
|
344
|
-
}
|
|
345
393
|
@property --tw-border-style {
|
|
346
394
|
syntax: "*";
|
|
347
395
|
inherits: false;
|
|
348
396
|
initial-value: solid;
|
|
349
397
|
}
|
|
350
|
-
@property --tw-
|
|
351
|
-
syntax: "*";
|
|
352
|
-
inherits: false;
|
|
353
|
-
}
|
|
354
|
-
@property --tw-duration {
|
|
398
|
+
@property --tw-leading {
|
|
355
399
|
syntax: "*";
|
|
356
400
|
inherits: false;
|
|
357
401
|
}
|
|
358
|
-
@property --tw-
|
|
402
|
+
@property --tw-font-weight {
|
|
359
403
|
syntax: "*";
|
|
360
404
|
inherits: false;
|
|
361
405
|
}
|
|
@@ -424,16 +468,20 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
424
468
|
inherits: false;
|
|
425
469
|
initial-value: 0 0 #0000;
|
|
426
470
|
}
|
|
471
|
+
@property --tw-duration {
|
|
472
|
+
syntax: "*";
|
|
473
|
+
inherits: false;
|
|
474
|
+
}
|
|
475
|
+
@property --tw-ease {
|
|
476
|
+
syntax: "*";
|
|
477
|
+
inherits: false;
|
|
478
|
+
}
|
|
427
479
|
@layer properties {
|
|
428
480
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
429
481
|
*, ::before, ::after, ::backdrop {
|
|
430
|
-
--tw-translate-x: 0;
|
|
431
|
-
--tw-translate-y: 0;
|
|
432
|
-
--tw-translate-z: 0;
|
|
433
482
|
--tw-border-style: solid;
|
|
483
|
+
--tw-leading: initial;
|
|
434
484
|
--tw-font-weight: initial;
|
|
435
|
-
--tw-duration: initial;
|
|
436
|
-
--tw-ease: initial;
|
|
437
485
|
--tw-shadow: 0 0 #0000;
|
|
438
486
|
--tw-shadow-color: initial;
|
|
439
487
|
--tw-shadow-alpha: 100%;
|
|
@@ -448,6 +496,8 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
448
496
|
--tw-ring-offset-width: 0px;
|
|
449
497
|
--tw-ring-offset-color: #fff;
|
|
450
498
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
499
|
+
--tw-duration: initial;
|
|
500
|
+
--tw-ease: initial;
|
|
451
501
|
--dsgn-border-sweep-angle: 0deg;
|
|
452
502
|
}
|
|
453
503
|
}
|
|
@@ -455,18 +505,24 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
455
505
|
`;
|
|
456
506
|
var Input_default = styles2;
|
|
457
507
|
|
|
508
|
+
// common/props/size/size.props.ts
|
|
509
|
+
var sizeValues = {
|
|
510
|
+
SM: "sm",
|
|
511
|
+
MD: "md",
|
|
512
|
+
LG: "lg"
|
|
513
|
+
};
|
|
514
|
+
var sizeProps = enumCreator(Object.values(sizeValues), "size", String, {
|
|
515
|
+
reflect: true
|
|
516
|
+
});
|
|
517
|
+
|
|
458
518
|
// components/Input/src/Input.props.ts
|
|
459
519
|
var inputTypeValues = {
|
|
460
520
|
TEXT: "text",
|
|
461
521
|
EMAIL: "email"
|
|
462
522
|
};
|
|
463
523
|
var inputTypeProps = enumCreator(Object.values(inputTypeValues), "type", String, { reflect: true });
|
|
464
|
-
var inputSizeValues =
|
|
465
|
-
|
|
466
|
-
MD: "md",
|
|
467
|
-
LG: "lg"
|
|
468
|
-
};
|
|
469
|
-
var inputSizeProps = enumCreator(Object.values(inputSizeValues), "size", String, { reflect: true });
|
|
524
|
+
var inputSizeValues = sizeValues;
|
|
525
|
+
var inputSizeProps = sizeProps;
|
|
470
526
|
|
|
471
527
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
472
528
|
function r(e) {
|
|
@@ -493,37 +549,85 @@ var clsx_default = clsx;
|
|
|
493
549
|
// components/Input/src/Input.styles.ts
|
|
494
550
|
var baseClasses = [
|
|
495
551
|
"w-full",
|
|
496
|
-
"
|
|
552
|
+
"box-border",
|
|
497
553
|
"border",
|
|
498
|
-
"border-input-border",
|
|
499
554
|
"text-input-text",
|
|
500
|
-
"placeholder-input-placeholder",
|
|
501
|
-
"rounded-
|
|
555
|
+
"placeholder:text-input-placeholder",
|
|
556
|
+
"rounded-[var(--radius-input,0.375rem)]",
|
|
502
557
|
"font-sans",
|
|
503
|
-
"
|
|
504
|
-
"
|
|
505
|
-
"
|
|
506
|
-
"
|
|
507
|
-
"
|
|
508
|
-
"focus:border-input-focus"
|
|
558
|
+
"outline-none",
|
|
559
|
+
"transition-[border-color,box-shadow]",
|
|
560
|
+
"duration-150",
|
|
561
|
+
"ease-out",
|
|
562
|
+
"motion-reduce:transition-none"
|
|
509
563
|
];
|
|
510
|
-
var
|
|
511
|
-
|
|
564
|
+
var stateClasses = {
|
|
565
|
+
default: [
|
|
566
|
+
"bg-input-bg",
|
|
567
|
+
"border-input-border",
|
|
568
|
+
"hover:border-input-border-hover",
|
|
569
|
+
"focus-visible:border-input-focus",
|
|
570
|
+
"focus-visible:shadow-[0_0_0_3px_var(--color-input-focus-ring)]"
|
|
571
|
+
],
|
|
572
|
+
invalid: [
|
|
573
|
+
"bg-input-bg",
|
|
574
|
+
"border-error",
|
|
575
|
+
"focus-visible:shadow-[0_0_0_3px_var(--color-input-error-ring)]"
|
|
576
|
+
],
|
|
577
|
+
readonly: [
|
|
578
|
+
"bg-input-bg-readonly",
|
|
579
|
+
"border-input-border-readonly",
|
|
580
|
+
"focus-visible:border-input-focus",
|
|
581
|
+
"focus-visible:shadow-[0_0_0_3px_var(--color-input-focus-ring)]"
|
|
582
|
+
],
|
|
583
|
+
disabled: [
|
|
584
|
+
"bg-input-bg-disabled",
|
|
585
|
+
"border-input-border-disabled",
|
|
586
|
+
"text-input-text-disabled",
|
|
587
|
+
"cursor-not-allowed"
|
|
588
|
+
]
|
|
589
|
+
};
|
|
512
590
|
var sizeClasses = {
|
|
513
|
-
[inputSizeValues.SM]: ["
|
|
514
|
-
[inputSizeValues.MD]: ["
|
|
515
|
-
[inputSizeValues.LG]: ["
|
|
591
|
+
[inputSizeValues.SM]: ["h-8", "px-2.5", "text-[13px]"],
|
|
592
|
+
[inputSizeValues.MD]: ["h-10", "px-3", "text-sm"],
|
|
593
|
+
[inputSizeValues.LG]: ["h-12", "px-3.5", "text-base"]
|
|
516
594
|
};
|
|
517
|
-
var classNames = (size,
|
|
518
|
-
var wrapperClasses = () => clsx_default("flex", "flex-col");
|
|
519
|
-
var
|
|
520
|
-
|
|
521
|
-
|
|
595
|
+
var classNames = (size, state) => clsx_default(baseClasses, sizeClasses[size], stateClasses[state]);
|
|
596
|
+
var wrapperClasses = () => clsx_default("flex", "flex-col", "gap-1.5");
|
|
597
|
+
var labelSizeClasses = {
|
|
598
|
+
[inputSizeValues.SM]: ["text-[13px]", "leading-[18px]"],
|
|
599
|
+
[inputSizeValues.MD]: ["text-sm", "leading-5"],
|
|
600
|
+
[inputSizeValues.LG]: ["text-[15px]", "leading-[22px]"]
|
|
601
|
+
};
|
|
602
|
+
var labelClasses = (size, disabled) => clsx_default("block", "font-sans", "font-medium", labelSizeClasses[size], disabled ? "text-input-text-disabled" : "text-text-primary");
|
|
603
|
+
var requiredClasses = () => clsx_default("text-error-strong");
|
|
604
|
+
var messageSizeClasses = {
|
|
605
|
+
[inputSizeValues.SM]: ["text-xs", "leading-4"],
|
|
606
|
+
[inputSizeValues.MD]: ["text-[13px]", "leading-[18px]"],
|
|
607
|
+
[inputSizeValues.LG]: ["text-sm", "leading-5"]
|
|
608
|
+
};
|
|
609
|
+
var hintClasses = (size) => clsx_default("font-sans", messageSizeClasses[size], "text-text-secondary");
|
|
610
|
+
var errorClasses = (size) => clsx_default("flex", "items-center", "gap-1.5", "font-sans", "text-left", "text-input-error-text", messageSizeClasses[size]);
|
|
611
|
+
var errorIconClasses = () => clsx_default("size-3.5", "shrink-0", "fill-none", "stroke-current", "stroke-[1.75]");
|
|
522
612
|
|
|
523
613
|
// components/Input/src/Input.ts
|
|
614
|
+
var errorIcon = () => html2`<svg
|
|
615
|
+
class="${errorIconClasses()}"
|
|
616
|
+
viewBox="0 0 24 24"
|
|
617
|
+
stroke-linecap="round"
|
|
618
|
+
stroke-linejoin="round"
|
|
619
|
+
aria-hidden="true"
|
|
620
|
+
>
|
|
621
|
+
${circleAlert}
|
|
622
|
+
</svg>`;
|
|
623
|
+
|
|
524
624
|
class Input extends Base {
|
|
525
625
|
static styles = [Base.styles, Input_default];
|
|
526
626
|
static formAssociated = true;
|
|
627
|
+
static shadowRootOptions = {
|
|
628
|
+
...Base.shadowRootOptions,
|
|
629
|
+
delegatesFocus: true
|
|
630
|
+
};
|
|
527
631
|
#internals;
|
|
528
632
|
constructor() {
|
|
529
633
|
super();
|
|
@@ -532,18 +636,33 @@ class Input extends Base {
|
|
|
532
636
|
this.placeholder = "";
|
|
533
637
|
this.label = "";
|
|
534
638
|
this.ariaLabel = "";
|
|
639
|
+
this.hint = "";
|
|
535
640
|
this.error = "";
|
|
641
|
+
this.invalid = false;
|
|
536
642
|
this.size = inputSizeValues.MD;
|
|
537
643
|
this.value = "";
|
|
538
644
|
this.name = "";
|
|
539
645
|
this.disabled = false;
|
|
540
646
|
this.required = false;
|
|
647
|
+
this.readOnly = false;
|
|
541
648
|
this._formDisabled = false;
|
|
542
649
|
this.#internals = this.attachInternals();
|
|
543
650
|
}
|
|
544
651
|
get isDisabled() {
|
|
545
652
|
return this.disabled || this._formDisabled;
|
|
546
653
|
}
|
|
654
|
+
get isInvalid() {
|
|
655
|
+
return this.invalid || !!this.error;
|
|
656
|
+
}
|
|
657
|
+
get state() {
|
|
658
|
+
if (this.isDisabled)
|
|
659
|
+
return "disabled";
|
|
660
|
+
if (this.readOnly)
|
|
661
|
+
return "readonly";
|
|
662
|
+
if (this.isInvalid)
|
|
663
|
+
return "invalid";
|
|
664
|
+
return "default";
|
|
665
|
+
}
|
|
547
666
|
_syncValidity() {
|
|
548
667
|
const input = this.shadowRoot?.querySelector("input");
|
|
549
668
|
if (!input)
|
|
@@ -576,32 +695,60 @@ class Input extends Base {
|
|
|
576
695
|
if (changedProperties.has("value")) {
|
|
577
696
|
this.#internals.setFormValue(this.value);
|
|
578
697
|
}
|
|
579
|
-
if (changedProperties.has("value") || changedProperties.has("disabled") || changedProperties.has("_formDisabled")) {
|
|
698
|
+
if (changedProperties.has("value") || changedProperties.has("disabled") || changedProperties.has("_formDisabled") || changedProperties.has("required") || changedProperties.has("readOnly")) {
|
|
580
699
|
this._syncValidity();
|
|
581
700
|
}
|
|
582
701
|
}
|
|
702
|
+
_renderLabel() {
|
|
703
|
+
if (!this.label)
|
|
704
|
+
return nothing;
|
|
705
|
+
return html2`<label
|
|
706
|
+
part="label"
|
|
707
|
+
class="${labelClasses(this.size, this.isDisabled)}"
|
|
708
|
+
for="input"
|
|
709
|
+
>${this.label}${this.required ? html2` <span
|
|
710
|
+
part="required-indicator"
|
|
711
|
+
class="${requiredClasses()}"
|
|
712
|
+
aria-hidden="true"
|
|
713
|
+
>*</span
|
|
714
|
+
>` : nothing}</label
|
|
715
|
+
>`;
|
|
716
|
+
}
|
|
717
|
+
_renderHint() {
|
|
718
|
+
if (!this.hint)
|
|
719
|
+
return nothing;
|
|
720
|
+
return html2`<div id="hint" part="hint" class="${hintClasses(this.size)}">
|
|
721
|
+
${this.hint}
|
|
722
|
+
</div>`;
|
|
723
|
+
}
|
|
724
|
+
_renderError() {
|
|
725
|
+
if (!this.error)
|
|
726
|
+
return nothing;
|
|
727
|
+
return html2`<div id="error" part="error" class="${errorClasses(this.size)}">
|
|
728
|
+
${errorIcon()}
|
|
729
|
+
<span>${this.error}</span>
|
|
730
|
+
</div>`;
|
|
731
|
+
}
|
|
583
732
|
render() {
|
|
584
733
|
return html2`
|
|
585
734
|
<div class="${wrapperClasses()}">
|
|
586
|
-
${this.
|
|
587
|
-
>${this.label}</label
|
|
588
|
-
>` : nothing}
|
|
735
|
+
${this._renderLabel()}
|
|
589
736
|
<input
|
|
590
737
|
id="input"
|
|
738
|
+
part="input"
|
|
591
739
|
type="${this.type}"
|
|
592
|
-
class="${classNames(this.size,
|
|
740
|
+
class="${classNames(this.size, this.state)}"
|
|
593
741
|
placeholder="${this.placeholder || nothing}"
|
|
594
|
-
aria-label="${this.ariaLabel || nothing}"
|
|
742
|
+
aria-label="${!this.label && this.ariaLabel || nothing}"
|
|
743
|
+
aria-invalid="${this.isInvalid ? "true" : nothing}"
|
|
744
|
+
aria-describedby="${describedBy(!!this.error && "error", !!this.hint && "hint") ?? nothing}"
|
|
595
745
|
.value="${this.value}"
|
|
596
746
|
?disabled="${this.isDisabled}"
|
|
747
|
+
?readonly="${this.readOnly}"
|
|
597
748
|
?required="${this.required}"
|
|
598
749
|
@input="${this._handleInput}"
|
|
599
750
|
/>
|
|
600
|
-
|
|
601
|
-
<span class="${errorMessageClasses(!!this.error)}">
|
|
602
|
-
${this.error}
|
|
603
|
-
</span>
|
|
604
|
-
</div>
|
|
751
|
+
${this._renderHint()} ${this._renderError()}
|
|
605
752
|
</div>
|
|
606
753
|
`;
|
|
607
754
|
}
|
|
@@ -621,9 +768,15 @@ __legacyDecorateClassTS([
|
|
|
621
768
|
__legacyDecorateClassTS([
|
|
622
769
|
property({ type: String, attribute: "aria-label" })
|
|
623
770
|
], Input.prototype, "ariaLabel", undefined);
|
|
771
|
+
__legacyDecorateClassTS([
|
|
772
|
+
property({ type: String })
|
|
773
|
+
], Input.prototype, "hint", undefined);
|
|
624
774
|
__legacyDecorateClassTS([
|
|
625
775
|
property({ type: String })
|
|
626
776
|
], Input.prototype, "error", undefined);
|
|
777
|
+
__legacyDecorateClassTS([
|
|
778
|
+
property({ type: Boolean, reflect: true })
|
|
779
|
+
], Input.prototype, "invalid", undefined);
|
|
627
780
|
__legacyDecorateClassTS([
|
|
628
781
|
property({ ...inputSizeProps })
|
|
629
782
|
], Input.prototype, "size", undefined);
|
|
@@ -639,9 +792,13 @@ __legacyDecorateClassTS([
|
|
|
639
792
|
__legacyDecorateClassTS([
|
|
640
793
|
property({ type: Boolean, reflect: true })
|
|
641
794
|
], Input.prototype, "required", undefined);
|
|
795
|
+
__legacyDecorateClassTS([
|
|
796
|
+
property({ type: Boolean, reflect: true, attribute: "readonly" })
|
|
797
|
+
], Input.prototype, "readOnly", undefined);
|
|
642
798
|
__legacyDecorateClassTS([
|
|
643
799
|
state()
|
|
644
800
|
], Input.prototype, "_formDisabled", undefined);
|
|
801
|
+
markFieldControl(Input);
|
|
645
802
|
defineElement("dsgn-input", Input);
|
|
646
803
|
export {
|
|
647
804
|
Input
|