@openelement/ui 1.0.0-alpha.14 → 1.0.0-alpha.15

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/src/open-input.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { nextInstanceId, syncDisabledState } from "./component-recipes.js";
2
2
  import { OpenElement, computed } from "@openelement/element";
3
- import controlRecipe from "./control-recipe.css";
4
3
  import openInputStyles from "./open-input.css";
5
4
  //#region src/open-input.tsx
6
5
  const __partProgram = {
7
- "version": 1,
6
+ "version": 2,
8
7
  "tag": "open-input",
9
8
  "root": {
10
9
  "id": "root",
@@ -15,13 +14,13 @@ const __partProgram = {
15
14
  "k": "el",
16
15
  "id": "e0",
17
16
  "tag": "div",
18
- "attrs": [["class", "input-wrapper"], ["part", "wrapper"]],
17
+ "attrs": [["class", "flex flex-col gap-2"], ["part", "wrapper"]],
19
18
  "children": [
20
19
  {
21
20
  "k": "el",
22
21
  "id": "e1",
23
22
  "tag": "label",
24
- "attrs": [["part", "label"]],
23
+ "attrs": [["class", "text-sm font-medium text-muted-foreground tracking-normal"], ["part", "label"]],
25
24
  "children": [{
26
25
  "k": "part",
27
26
  "id": "p2",
@@ -30,7 +29,7 @@ const __partProgram = {
30
29
  "k": "el",
31
30
  "id": "e2",
32
31
  "tag": "span",
33
- "attrs": [["class", "req"]],
32
+ "attrs": [],
34
33
  "children": [{
35
34
  "k": "part",
36
35
  "id": "p3",
@@ -42,7 +41,7 @@ const __partProgram = {
42
41
  "k": "el",
43
42
  "id": "e3",
44
43
  "tag": "input",
45
- "attrs": [["part", "control"]],
44
+ "attrs": [["class", "control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground"], ["part", "control"]],
46
45
  "children": []
47
46
  },
48
47
  {
@@ -51,13 +50,13 @@ const __partProgram = {
51
50
  "tag": "small",
52
51
  "attrs": [
53
52
  ["role", "alert"],
54
- ["class", "error-message"],
53
+ ["class", "text-xs text-destructive"],
55
54
  ["part", "error"]
56
55
  ],
57
56
  "children": [{
58
57
  "k": "part",
59
- "id": "p21",
60
- "index": 21
58
+ "id": "p20",
59
+ "index": 20
61
60
  }]
62
61
  }
63
62
  ]
@@ -131,26 +130,14 @@ const __partProgram = {
131
130
  "node": "e3"
132
131
  }
133
132
  },
134
- {
135
- "k": "class",
136
- "signal": "inputClass",
137
- "path": [0, 1],
138
- "index": 5,
139
- "location": {
140
- "id": "p5",
141
- "kind": "sink",
142
- "path": [0, 1],
143
- "node": "e3"
144
- }
145
- },
146
133
  {
147
134
  "k": "attr",
148
135
  "signal": "type",
149
136
  "name": "type",
150
137
  "path": [0, 1],
151
- "index": 6,
138
+ "index": 5,
152
139
  "location": {
153
- "id": "p6",
140
+ "id": "p5",
154
141
  "kind": "sink",
155
142
  "path": [0, 1],
156
143
  "node": "e3"
@@ -161,9 +148,9 @@ const __partProgram = {
161
148
  "signal": "placeholder",
162
149
  "name": "placeholder",
163
150
  "path": [0, 1],
164
- "index": 7,
151
+ "index": 6,
165
152
  "location": {
166
- "id": "p7",
153
+ "id": "p6",
167
154
  "kind": "sink",
168
155
  "path": [0, 1],
169
156
  "node": "e3"
@@ -174,9 +161,9 @@ const __partProgram = {
174
161
  "signal": "value",
175
162
  "name": "value",
176
163
  "path": [0, 1],
177
- "index": 8,
164
+ "index": 7,
178
165
  "location": {
179
- "id": "p8",
166
+ "id": "p7",
180
167
  "kind": "sink",
181
168
  "path": [0, 1],
182
169
  "node": "e3"
@@ -187,9 +174,9 @@ const __partProgram = {
187
174
  "signal": "name",
188
175
  "name": "name",
189
176
  "path": [0, 1],
190
- "index": 9,
177
+ "index": 8,
191
178
  "location": {
192
- "id": "p9",
179
+ "id": "p8",
193
180
  "kind": "sink",
194
181
  "path": [0, 1],
195
182
  "node": "e3"
@@ -200,9 +187,9 @@ const __partProgram = {
200
187
  "signal": "disabled",
201
188
  "name": "disabled",
202
189
  "path": [0, 1],
203
- "index": 10,
190
+ "index": 9,
204
191
  "location": {
205
- "id": "p10",
192
+ "id": "p9",
206
193
  "kind": "sink",
207
194
  "path": [0, 1],
208
195
  "node": "e3"
@@ -213,9 +200,9 @@ const __partProgram = {
213
200
  "signal": "required",
214
201
  "name": "required",
215
202
  "path": [0, 1],
216
- "index": 11,
203
+ "index": 10,
217
204
  "location": {
218
- "id": "p11",
205
+ "id": "p10",
219
206
  "kind": "sink",
220
207
  "path": [0, 1],
221
208
  "node": "e3"
@@ -226,9 +213,9 @@ const __partProgram = {
226
213
  "signal": "ariaInvalidAttr",
227
214
  "name": "aria-invalid",
228
215
  "path": [0, 1],
229
- "index": 12,
216
+ "index": 11,
230
217
  "location": {
231
- "id": "p12",
218
+ "id": "p11",
232
219
  "kind": "sink",
233
220
  "path": [0, 1],
234
221
  "node": "e3"
@@ -239,9 +226,9 @@ const __partProgram = {
239
226
  "signal": "describedByAttr",
240
227
  "name": "aria-describedby",
241
228
  "path": [0, 1],
242
- "index": 13,
229
+ "index": 12,
243
230
  "location": {
244
- "id": "p13",
231
+ "id": "p12",
245
232
  "kind": "sink",
246
233
  "path": [0, 1],
247
234
  "node": "e3"
@@ -252,9 +239,9 @@ const __partProgram = {
252
239
  "signal": "describedByAttr",
253
240
  "name": "aria-errormessage",
254
241
  "path": [0, 1],
255
- "index": 14,
242
+ "index": 13,
256
243
  "location": {
257
- "id": "p14",
244
+ "id": "p13",
258
245
  "kind": "sink",
259
246
  "path": [0, 1],
260
247
  "node": "e3"
@@ -269,9 +256,9 @@ const __partProgram = {
269
256
  "name": "handleInput"
270
257
  },
271
258
  "path": [0, 1],
272
- "index": 15,
259
+ "index": 14,
273
260
  "location": {
274
- "id": "p15",
261
+ "id": "p14",
275
262
  "kind": "sink",
276
263
  "path": [0, 1],
277
264
  "node": "e3"
@@ -286,9 +273,9 @@ const __partProgram = {
286
273
  "name": "handleChange"
287
274
  },
288
275
  "path": [0, 1],
289
- "index": 16,
276
+ "index": 15,
290
277
  "location": {
291
- "id": "p16",
278
+ "id": "p15",
292
279
  "kind": "sink",
293
280
  "path": [0, 1],
294
281
  "node": "e3"
@@ -303,9 +290,9 @@ const __partProgram = {
303
290
  "name": "handleFocus"
304
291
  },
305
292
  "path": [0, 1],
306
- "index": 17,
293
+ "index": 16,
307
294
  "location": {
308
- "id": "p17",
295
+ "id": "p16",
309
296
  "kind": "sink",
310
297
  "path": [0, 1],
311
298
  "node": "e3"
@@ -320,9 +307,9 @@ const __partProgram = {
320
307
  "name": "handleBlur"
321
308
  },
322
309
  "path": [0, 1],
323
- "index": 18,
310
+ "index": 17,
324
311
  "location": {
325
- "id": "p18",
312
+ "id": "p17",
326
313
  "kind": "sink",
327
314
  "path": [0, 1],
328
315
  "node": "e3"
@@ -333,9 +320,9 @@ const __partProgram = {
333
320
  "signal": "errorIdAttr",
334
321
  "name": "id",
335
322
  "path": [0, 2],
336
- "index": 19,
323
+ "index": 18,
337
324
  "location": {
338
- "id": "p19",
325
+ "id": "p18",
339
326
  "kind": "sink",
340
327
  "path": [0, 2],
341
328
  "node": "e4"
@@ -346,9 +333,9 @@ const __partProgram = {
346
333
  "signal": "noError",
347
334
  "name": "hidden",
348
335
  "path": [0, 2],
349
- "index": 20,
336
+ "index": 19,
350
337
  "location": {
351
- "id": "p20",
338
+ "id": "p19",
352
339
  "kind": "sink",
353
340
  "path": [0, 2],
354
341
  "node": "e4"
@@ -357,9 +344,9 @@ const __partProgram = {
357
344
  {
358
345
  "k": "text",
359
346
  "signal": "error",
360
- "index": 21,
347
+ "index": 20,
361
348
  "location": {
362
- "id": "p21",
349
+ "id": "p20",
363
350
  "kind": "anchor",
364
351
  "path": [
365
352
  0,
@@ -369,7 +356,7 @@ const __partProgram = {
369
356
  }
370
357
  }
371
358
  ],
372
- "regions": [],
359
+ "blocks": [],
373
360
  "dependencies": [
374
361
  {
375
362
  "signal": "idAttr",
@@ -412,7 +399,7 @@ const __partProgram = {
412
399
  "location": "p4"
413
400
  },
414
401
  {
415
- "signal": "inputClass",
402
+ "signal": "type",
416
403
  "owner": {
417
404
  "kind": "part",
418
405
  "index": 5
@@ -420,7 +407,7 @@ const __partProgram = {
420
407
  "location": "p5"
421
408
  },
422
409
  {
423
- "signal": "type",
410
+ "signal": "placeholder",
424
411
  "owner": {
425
412
  "kind": "part",
426
413
  "index": 6
@@ -428,7 +415,7 @@ const __partProgram = {
428
415
  "location": "p6"
429
416
  },
430
417
  {
431
- "signal": "placeholder",
418
+ "signal": "value",
432
419
  "owner": {
433
420
  "kind": "part",
434
421
  "index": 7
@@ -436,7 +423,7 @@ const __partProgram = {
436
423
  "location": "p7"
437
424
  },
438
425
  {
439
- "signal": "value",
426
+ "signal": "name",
440
427
  "owner": {
441
428
  "kind": "part",
442
429
  "index": 8
@@ -444,7 +431,7 @@ const __partProgram = {
444
431
  "location": "p8"
445
432
  },
446
433
  {
447
- "signal": "name",
434
+ "signal": "disabled",
448
435
  "owner": {
449
436
  "kind": "part",
450
437
  "index": 9
@@ -452,7 +439,7 @@ const __partProgram = {
452
439
  "location": "p9"
453
440
  },
454
441
  {
455
- "signal": "disabled",
442
+ "signal": "required",
456
443
  "owner": {
457
444
  "kind": "part",
458
445
  "index": 10
@@ -460,7 +447,7 @@ const __partProgram = {
460
447
  "location": "p10"
461
448
  },
462
449
  {
463
- "signal": "required",
450
+ "signal": "ariaInvalidAttr",
464
451
  "owner": {
465
452
  "kind": "part",
466
453
  "index": 11
@@ -468,7 +455,7 @@ const __partProgram = {
468
455
  "location": "p11"
469
456
  },
470
457
  {
471
- "signal": "ariaInvalidAttr",
458
+ "signal": "describedByAttr",
472
459
  "owner": {
473
460
  "kind": "part",
474
461
  "index": 12
@@ -484,15 +471,15 @@ const __partProgram = {
484
471
  "location": "p13"
485
472
  },
486
473
  {
487
- "signal": "describedByAttr",
474
+ "signal": "errorIdAttr",
488
475
  "owner": {
489
476
  "kind": "part",
490
- "index": 14
477
+ "index": 18
491
478
  },
492
- "location": "p14"
479
+ "location": "p18"
493
480
  },
494
481
  {
495
- "signal": "errorIdAttr",
482
+ "signal": "noError",
496
483
  "owner": {
497
484
  "kind": "part",
498
485
  "index": 19
@@ -500,20 +487,12 @@ const __partProgram = {
500
487
  "location": "p19"
501
488
  },
502
489
  {
503
- "signal": "noError",
490
+ "signal": "error",
504
491
  "owner": {
505
492
  "kind": "part",
506
493
  "index": 20
507
494
  },
508
495
  "location": "p20"
509
- },
510
- {
511
- "signal": "error",
512
- "owner": {
513
- "kind": "part",
514
- "index": 21
515
- },
516
- "location": "p21"
517
496
  }
518
497
  ],
519
498
  "locations": [
@@ -678,13 +657,6 @@ const __partProgram = {
678
657
  "node": "e3",
679
658
  "path": [0, 1]
680
659
  },
681
- {
682
- "id": "p18",
683
- "kind": "sink",
684
- "part": 18,
685
- "node": "e3",
686
- "path": [0, 1]
687
- },
688
660
  {
689
661
  "id": "e4",
690
662
  "kind": "element",
@@ -692,23 +664,23 @@ const __partProgram = {
692
664
  "path": [0, 2]
693
665
  },
694
666
  {
695
- "id": "p19",
667
+ "id": "p18",
696
668
  "kind": "sink",
697
- "part": 19,
669
+ "part": 18,
698
670
  "node": "e4",
699
671
  "path": [0, 2]
700
672
  },
701
673
  {
702
- "id": "p20",
674
+ "id": "p19",
703
675
  "kind": "sink",
704
- "part": 20,
676
+ "part": 19,
705
677
  "node": "e4",
706
678
  "path": [0, 2]
707
679
  },
708
680
  {
709
- "id": "p21",
681
+ "id": "p20",
710
682
  "kind": "anchor",
711
- "part": 21,
683
+ "part": 20,
712
684
  "path": [
713
685
  0,
714
686
  2,
@@ -813,16 +785,6 @@ const __partProgram = {
813
785
  "computed": true,
814
786
  "deps": ["error"]
815
787
  },
816
- {
817
- "name": "inputClass",
818
- "attribute": null,
819
- "type": "string",
820
- "converter": "string",
821
- "reflect": false,
822
- "default": null,
823
- "computed": true,
824
- "deps": ["error"]
825
- },
826
788
  {
827
789
  "name": "idAttr",
828
790
  "attribute": null,
@@ -1019,13 +981,6 @@ const __partProgram = {
1019
981
  "attribute": null,
1020
982
  "reflect": false
1021
983
  },
1022
- {
1023
- "name": "inputClass",
1024
- "fieldName": "inputClass",
1025
- "type": "string",
1026
- "attribute": null,
1027
- "reflect": false
1028
- },
1029
984
  {
1030
985
  "name": "idAttr",
1031
986
  "fieldName": "idAttr",
@@ -1158,16 +1113,6 @@ const __compiledProperties = [
1158
1113
  "computed": true,
1159
1114
  "deps": ["error"]
1160
1115
  },
1161
- {
1162
- "name": "inputClass",
1163
- "attribute": null,
1164
- "type": "string",
1165
- "converter": "string",
1166
- "reflect": false,
1167
- "default": null,
1168
- "computed": true,
1169
- "deps": ["error"]
1170
- },
1171
1116
  {
1172
1117
  "name": "idAttr",
1173
1118
  "attribute": null,
@@ -1316,16 +1261,6 @@ const __elementMetadata = {
1316
1261
  "computed": true,
1317
1262
  "deps": ["error"]
1318
1263
  },
1319
- {
1320
- "name": "inputClass",
1321
- "attribute": null,
1322
- "type": "string",
1323
- "converter": "string",
1324
- "reflect": false,
1325
- "default": null,
1326
- "computed": true,
1327
- "deps": ["error"]
1328
- },
1329
1264
  {
1330
1265
  "name": "idAttr",
1331
1266
  "attribute": null,
@@ -1522,13 +1457,6 @@ const __elementMetadata = {
1522
1457
  "attribute": null,
1523
1458
  "reflect": false
1524
1459
  },
1525
- {
1526
- "name": "inputClass",
1527
- "fieldName": "inputClass",
1528
- "type": "string",
1529
- "attribute": null,
1530
- "reflect": false
1531
- },
1532
1460
  {
1533
1461
  "name": "idAttr",
1534
1462
  "fieldName": "idAttr",
@@ -1644,12 +1572,6 @@ const __compiledProps = {
1644
1572
  reflect: false,
1645
1573
  attribute: false
1646
1574
  },
1647
- inputClass: {
1648
- type: Object,
1649
- default: void 0,
1650
- reflect: false,
1651
- attribute: false
1652
- },
1653
1575
  idAttr: {
1654
1576
  type: Object,
1655
1577
  default: void 0,
@@ -1689,17 +1611,41 @@ var OpenInput = class extends OpenElement {
1689
1611
  static observedAttributes = __observedAttributes;
1690
1612
  static delegatesFocus = true;
1691
1613
  static formAssociated = true;
1614
+ static __oeUtilityClasses = true;
1615
+ static __oeClassCandidates = [
1616
+ "flex",
1617
+ "flex-col",
1618
+ "gap-2",
1619
+ "text-sm",
1620
+ "font-medium",
1621
+ "text-muted-foreground",
1622
+ "tracking-normal",
1623
+ "control",
1624
+ "w-full",
1625
+ "px-3",
1626
+ "py-2",
1627
+ "font-sans",
1628
+ "text-base",
1629
+ "text-foreground",
1630
+ "rounded-md",
1631
+ "outline-none",
1632
+ "transition-[border-color,box-shadow]",
1633
+ "duration-200",
1634
+ "ease-out",
1635
+ "placeholder:text-muted-foreground",
1636
+ "text-xs",
1637
+ "text-destructive"
1638
+ ];
1692
1639
  static __computedFields = {
1693
1640
  noLabel: (__s) => computed(() => __s.label.value === ""),
1694
1641
  noError: (__s) => computed(() => __s.error.value === ""),
1695
- inputClass: (__s) => computed(() => __s.error.value === "" ? "control input" : "control input input--error"),
1696
1642
  idAttr: (__s) => computed(() => __s.inputId.value === "" ? null : __s.inputId.value),
1697
1643
  errorIdAttr: (__s) => computed(() => __s.inputId.value === "" ? null : `${__s.inputId.value}-error`),
1698
1644
  ariaInvalidAttr: (__s) => computed(() => __s.error.value === "" ? null : "true"),
1699
1645
  requiredMark: (__s) => computed(() => __s.required.value ? " *" : ""),
1700
1646
  describedByAttr: (__s) => computed(() => __s.error.value === "" || __s.inputId.value === "" ? null : `${__s.inputId.value}-error`)
1701
1647
  };
1702
- static styles = [controlRecipe, openInputStyles];
1648
+ static styles = [openInputStyles];
1703
1649
  type = "text";
1704
1650
  placeholder = "";
1705
1651
  label = "";
@@ -1,53 +1,43 @@
1
- /* open-theme-toggle — authored component styles, ported verbatim from the pre-#1558
2
- * recipe() sheet (the alpha.9 design system). The #1558 migration had
3
- * replaced this with a placeholder shell under the false note that the
4
- * component "carried no authored styles"; it did — this is that sheet. */
5
- :host {
6
- display: inline-block;
7
- }
1
+ /* open-theme-toggle — the irreducible authored rules (alpha15 S lane).
2
+ *
3
+ * The button's element-level presentation (flex box, size, radius, cursor,
4
+ * ink, hover ink, focus ring, transition) is authored as Tailwind utilities on
5
+ * the button in open-theme-toggle.tsx. What stays here, and why
6
+ * (CUSTOMIZATION.md -> "Why the residue is CSS"):
7
+ * - the two-colour derived border/background/inset-shadow (the house
8
+ * surface recipe): one owned formula over role pairs,
9
+ * - the icon display swap, whose `display` is driven by the BUTTON's
10
+ * `[data-theme]` attribute — one descendant-scoped pair of rules that owns
11
+ * `display` for both icons exclusively,
12
+ * - the host box.
13
+ * One owner per property: nothing here is also authored as a utility. */
14
+ :host {
15
+ display: inline-block;
16
+ }
8
17
 
9
- .theme-toggle {
10
- display: inline-flex;
11
- align-items: center;
12
- justify-content: center;
13
- width: 38px; height: 38px; padding: 0;
14
- border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
15
- border-radius: calc(infinity * 1px);
16
- background: color-mix(in srgb, var(--color-popover) 76%, transparent);
17
- color: var(--color-muted-foreground);
18
- box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-background) 70%, transparent);
19
- cursor: pointer;
20
- transition: all var(--ease-in-out) var(--default-transition-duration);
21
- }
22
- .theme-toggle:hover {
23
- color: var(--color-foreground);
24
- border-color: var(--color-violet-400);
25
- background: color-mix(in srgb, color-mix(in srgb, var(--color-primary) 16%, transparent) 42%, var(--color-popover));
26
- }
18
+ .theme-toggle {
19
+ border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
20
+ background: color-mix(in srgb, var(--color-popover) 76%, transparent);
21
+ box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-background) 70%, transparent);
22
+ }
27
23
 
28
- .theme-toggle:focus-visible {
29
- outline: calc(var(--spacing) * 0.5) solid var(--color-ring);
30
- outline-offset: calc(var(--spacing) * 0.75);
31
- }
24
+ .theme-toggle:hover {
25
+ border-color: var(--color-violet-400);
26
+ background: color-mix(in srgb, color-mix(in srgb, var(--color-primary) 16%, transparent) 42%, var(--color-popover));
27
+ }
32
28
 
33
- .theme-toggle svg {
34
- width: 16px;
35
- height: 16px;
36
- }
29
+ .theme-toggle .icon-sun {
30
+ display: block;
31
+ }
37
32
 
38
- .theme-toggle .icon-sun {
39
- display: block;
40
- }
33
+ .theme-toggle .icon-moon {
34
+ display: none;
35
+ }
41
36
 
42
- .theme-toggle .icon-moon {
43
- display: none;
44
- }
37
+ .theme-toggle[data-theme='light'] .icon-sun {
38
+ display: none;
39
+ }
45
40
 
46
- .theme-toggle[data-theme='light'] .icon-sun {
47
- display: none;
48
- }
49
-
50
- .theme-toggle[data-theme='light'] .icon-moon {
51
- display: block;
52
- }
53
-
41
+ .theme-toggle[data-theme='light'] .icon-moon {
42
+ display: block;
43
+ }
@@ -61,7 +61,7 @@ declare const __partProgram: {
61
61
  signal?: undefined;
62
62
  name?: undefined;
63
63
  })[];
64
- regions: never[];
64
+ blocks: never[];
65
65
  dependencies: {
66
66
  signal: string;
67
67
  owner: {
@@ -180,6 +180,8 @@ export declare class OpenThemeToggle extends OpenElement {
180
180
  static props: typeof __compiledProps;
181
181
  static observedAttributes: typeof __observedAttributes;
182
182
  static delegatesFocus: boolean;
183
+ static __oeUtilityClasses: boolean;
184
+ static __oeClassCandidates: readonly string[];
183
185
  static styles: StyleSheetLike[];
184
186
  theme: 'dark' | 'light';
185
187
  connectedCallback(): void;