@latty-ds/web 0.3.0 → 0.5.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 (36) hide show
  1. package/custom-elements.json +2932 -2558
  2. package/dist/components/accordion/index.js +1 -1
  3. package/dist/components/avatar/index.js +1 -1
  4. package/dist/components/checkbox/checkbox.d.ts +7 -5
  5. package/dist/components/checkbox/index.js +22 -9
  6. package/dist/components/color-input/color-input.d.ts +17 -0
  7. package/dist/components/color-input/index.js +32 -4
  8. package/dist/components/combobox/combobox.d.ts +8 -1
  9. package/dist/components/combobox/index.js +26 -7
  10. package/dist/components/date-input/date-input.d.ts +7 -0
  11. package/dist/components/date-input/index.js +24 -5
  12. package/dist/components/datepicker/datepicker.d.ts +8 -0
  13. package/dist/components/datepicker/index.js +27 -7
  14. package/dist/components/dialog/dialog.d.ts +4 -2
  15. package/dist/components/dialog/index.js +5 -12
  16. package/dist/components/divider/index.js +1 -1
  17. package/dist/components/nav/index.js +2 -2
  18. package/dist/components/progress/index.js +2 -2
  19. package/dist/components/radio/index.js +24 -4
  20. package/dist/components/radio/radio.d.ts +7 -0
  21. package/dist/components/radio-group/index.js +3 -3
  22. package/dist/components/select/index.js +28 -9
  23. package/dist/components/select/select.d.ts +11 -3
  24. package/dist/components/sidepanel/index.js +1 -1
  25. package/dist/components/slider/index.js +17 -4
  26. package/dist/components/slider/slider.d.ts +6 -0
  27. package/dist/components/switch/index.js +24 -4
  28. package/dist/components/switch/switch.d.ts +7 -0
  29. package/dist/components/tab/index.js +2 -2
  30. package/dist/components/tab-group/index.js +3 -3
  31. package/dist/components/textfield/index.js +26 -4
  32. package/dist/components/textfield/textfield.d.ts +11 -0
  33. package/dist/index.cjs +269 -83
  34. package/dist/index.js +269 -83
  35. package/dist/manifest.json +24 -0
  36. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -432,7 +432,7 @@ var Accordion = class extends ThemeableElement {
432
432
  };
433
433
  Accordion.styles = accordionStyles;
434
434
  __decorateClass([
435
- property3()
435
+ property3({ reflect: true })
436
436
  ], Accordion.prototype, "label", 2);
437
437
  __decorateClass([
438
438
  property3({ attribute: "icon-start" })
@@ -1315,7 +1315,7 @@ var checkboxStyles = css6`
1315
1315
  import "@latty-ds/icons";
1316
1316
  var Checkbox = class extends ThemeableElement {
1317
1317
  constructor() {
1318
- super(...arguments);
1318
+ super();
1319
1319
  this.variant = "primary";
1320
1320
  this.size = "md";
1321
1321
  this.checked = false;
@@ -1326,15 +1326,27 @@ var Checkbox = class extends ThemeableElement {
1326
1326
  this.labelPosition = "right";
1327
1327
  this.name = "";
1328
1328
  this.value = "on";
1329
+ this._internals = this.attachInternals();
1329
1330
  }
1330
- /**
1331
- * Handles changes to the indeterminate property.
1332
- * Updates the native input's indeterminate state.
1333
- */
1334
1331
  updated(changedProperties) {
1335
1332
  if (changedProperties.has("indeterminate") && this.input) {
1336
1333
  this.input.indeterminate = this.indeterminate;
1337
1334
  }
1335
+ this._internals.setFormValue(this.checked ? this.value : null);
1336
+ if (this.required && !this.checked && this.input) {
1337
+ this._internals.setValidity({ valueMissing: true }, "Please check this box", this.input);
1338
+ } else {
1339
+ this._internals.setValidity({});
1340
+ }
1341
+ }
1342
+ formResetCallback() {
1343
+ this.checked = false;
1344
+ }
1345
+ checkValidity() {
1346
+ return this._internals.checkValidity();
1347
+ }
1348
+ reportValidity() {
1349
+ return this._internals.reportValidity();
1338
1350
  }
1339
1351
  /**
1340
1352
  * Handles checkbox change events.
@@ -1349,7 +1361,7 @@ var Checkbox = class extends ThemeableElement {
1349
1361
  this.indeterminate = false;
1350
1362
  this.dispatchEvent(
1351
1363
  new CustomEvent("change", {
1352
- detail: { checked: this.checked, indeterminate: this.indeterminate },
1364
+ detail: { checked: this.checked },
1353
1365
  bubbles: true,
1354
1366
  composed: true
1355
1367
  })
@@ -1393,6 +1405,7 @@ var Checkbox = class extends ThemeableElement {
1393
1405
  }
1394
1406
  };
1395
1407
  Checkbox.styles = checkboxStyles;
1408
+ Checkbox.formAssociated = true;
1396
1409
  __decorateClass([
1397
1410
  property7({ reflect: true })
1398
1411
  ], Checkbox.prototype, "variant", 2);
@@ -1412,16 +1425,16 @@ __decorateClass([
1412
1425
  property7({ type: Boolean, reflect: true })
1413
1426
  ], Checkbox.prototype, "required", 2);
1414
1427
  __decorateClass([
1415
- property7()
1428
+ property7({ reflect: true })
1416
1429
  ], Checkbox.prototype, "label", 2);
1417
1430
  __decorateClass([
1418
1431
  property7({ attribute: "label-position", reflect: true })
1419
1432
  ], Checkbox.prototype, "labelPosition", 2);
1420
1433
  __decorateClass([
1421
- property7()
1434
+ property7({ reflect: true })
1422
1435
  ], Checkbox.prototype, "name", 2);
1423
1436
  __decorateClass([
1424
- property7()
1437
+ property7({ reflect: true })
1425
1438
  ], Checkbox.prototype, "value", 2);
1426
1439
  __decorateClass([
1427
1440
  query2('input[type="checkbox"]')
@@ -2029,22 +2042,15 @@ var Dialog = class extends ThemeableElement {
2029
2042
  this.updateComplete.then(() => {
2030
2043
  this.dialogElement?.focus();
2031
2044
  });
2032
- this.dispatchEvent(
2033
- new CustomEvent("dialog-open", {
2034
- bubbles: true,
2035
- composed: true
2036
- })
2037
- );
2045
+ const openEvent = new CustomEvent("open", { bubbles: true, composed: true });
2046
+ this.dispatchEvent(openEvent);
2047
+ this.dispatchEvent(new CustomEvent("dialog-open", { bubbles: true, composed: true }));
2038
2048
  }
2039
2049
  handleClose() {
2040
2050
  document.body.style.overflow = "";
2041
2051
  this.restoreFocus();
2042
- this.dispatchEvent(
2043
- new CustomEvent("dialog-close", {
2044
- bubbles: true,
2045
- composed: true
2046
- })
2047
- );
2052
+ this.dispatchEvent(new CustomEvent("close", { bubbles: true, composed: true }));
2053
+ this.dispatchEvent(new CustomEvent("dialog-close", { bubbles: true, composed: true }));
2048
2054
  }
2049
2055
  restoreFocus() {
2050
2056
  if (this.previouslyFocusedElement) {
@@ -2529,7 +2535,7 @@ var radioStyles = css13`
2529
2535
  // src/components/radio/radio.ts
2530
2536
  var Radio = class extends ThemeableElement {
2531
2537
  constructor() {
2532
- super(...arguments);
2538
+ super();
2533
2539
  this.variant = "primary";
2534
2540
  this.size = "md";
2535
2541
  this.checked = false;
@@ -2539,6 +2545,25 @@ var Radio = class extends ThemeableElement {
2539
2545
  this.labelPosition = "right";
2540
2546
  this.name = "";
2541
2547
  this.value = "";
2548
+ this._internals = this.attachInternals();
2549
+ }
2550
+ updated() {
2551
+ this._internals.setFormValue(this.checked ? this.value : null);
2552
+ const input = this.shadowRoot?.querySelector("input");
2553
+ if (this.required && !this.checked && input) {
2554
+ this._internals.setValidity({ valueMissing: true }, "Please select this option", input);
2555
+ } else {
2556
+ this._internals.setValidity({});
2557
+ }
2558
+ }
2559
+ formResetCallback() {
2560
+ this.checked = false;
2561
+ }
2562
+ checkValidity() {
2563
+ return this._internals.checkValidity();
2564
+ }
2565
+ reportValidity() {
2566
+ return this._internals.reportValidity();
2542
2567
  }
2543
2568
  /**
2544
2569
  * Handles radio change events.
@@ -2580,6 +2605,7 @@ var Radio = class extends ThemeableElement {
2580
2605
  }
2581
2606
  };
2582
2607
  Radio.styles = radioStyles;
2608
+ Radio.formAssociated = true;
2583
2609
  __decorateClass([
2584
2610
  property13({ reflect: true })
2585
2611
  ], Radio.prototype, "variant", 2);
@@ -2596,16 +2622,16 @@ __decorateClass([
2596
2622
  property13({ type: Boolean, reflect: true })
2597
2623
  ], Radio.prototype, "required", 2);
2598
2624
  __decorateClass([
2599
- property13()
2625
+ property13({ reflect: true })
2600
2626
  ], Radio.prototype, "label", 2);
2601
2627
  __decorateClass([
2602
2628
  property13({ attribute: "label-position", reflect: true })
2603
2629
  ], Radio.prototype, "labelPosition", 2);
2604
2630
  __decorateClass([
2605
- property13()
2631
+ property13({ reflect: true })
2606
2632
  ], Radio.prototype, "name", 2);
2607
2633
  __decorateClass([
2608
- property13()
2634
+ property13({ reflect: true })
2609
2635
  ], Radio.prototype, "value", 2);
2610
2636
  Radio = __decorateClass([
2611
2637
  customElement12("lt-radio")
@@ -2759,13 +2785,13 @@ var RadioGroup = class extends ThemeableElement {
2759
2785
  };
2760
2786
  RadioGroup.styles = radioGroupStyles;
2761
2787
  __decorateClass([
2762
- property14()
2788
+ property14({ reflect: true })
2763
2789
  ], RadioGroup.prototype, "label", 2);
2764
2790
  __decorateClass([
2765
- property14()
2791
+ property14({ reflect: true })
2766
2792
  ], RadioGroup.prototype, "name", 2);
2767
2793
  __decorateClass([
2768
- property14()
2794
+ property14({ reflect: true })
2769
2795
  ], RadioGroup.prototype, "value", 2);
2770
2796
  __decorateClass([
2771
2797
  property14({ reflect: true })
@@ -4384,12 +4410,13 @@ var selectStyles = [
4384
4410
  import "@latty-ds/icons";
4385
4411
  var Select = class extends ThemeableElement {
4386
4412
  constructor() {
4387
- super(...arguments);
4413
+ super();
4388
4414
  this.variant = "default";
4389
4415
  this.size = "md";
4390
4416
  this.value = "";
4391
4417
  this.placeholder = "Select an option";
4392
4418
  this.label = "";
4419
+ this.name = "";
4393
4420
  this.helperText = "";
4394
4421
  this.disabled = false;
4395
4422
  this.required = false;
@@ -4397,6 +4424,7 @@ var Select = class extends ThemeableElement {
4397
4424
  this.isOpen = false;
4398
4425
  this._cleanupClickOutside = null;
4399
4426
  this._floatingCleanup = null;
4427
+ this._internals = this.attachInternals();
4400
4428
  }
4401
4429
  /**
4402
4430
  * Toggles the dropdown open/closed state.
@@ -4482,16 +4510,20 @@ var Select = class extends ThemeableElement {
4482
4510
  const selected = this.options.find((opt) => opt.value === this.value);
4483
4511
  return selected ? selected.label : "";
4484
4512
  }
4485
- /**
4486
- * Reflects the open state as an attribute for CSS styling.
4487
- */
4488
4513
  updated(changedProperties) {
4514
+ this._internals.setFormValue(this.value || null);
4515
+ const trigger = this.shadowRoot?.querySelector(".select-trigger");
4516
+ if (this.required && !this.value && trigger) {
4517
+ this._internals.setValidity({ valueMissing: true }, "Please select an option", trigger);
4518
+ } else {
4519
+ this._internals.setValidity({});
4520
+ }
4489
4521
  if (!changedProperties.has("isOpen")) return;
4490
4522
  if (this.isOpen) {
4491
4523
  this.setAttribute("open", "");
4492
- const trigger = this.shadowRoot.querySelector(".select-trigger");
4524
+ const selectTrigger = this.shadowRoot.querySelector(".select-trigger");
4493
4525
  const listbox = this.shadowRoot.querySelector("lt-surface.dropdown");
4494
- openFloating(trigger, listbox, { matchWidth: true }).then((cleanup) => {
4526
+ openFloating(selectTrigger, listbox, { matchWidth: true }).then((cleanup) => {
4495
4527
  this._floatingCleanup = cleanup;
4496
4528
  });
4497
4529
  } else {
@@ -4501,6 +4533,15 @@ var Select = class extends ThemeableElement {
4501
4533
  this._floatingCleanup = null;
4502
4534
  }
4503
4535
  }
4536
+ formResetCallback() {
4537
+ this.value = "";
4538
+ }
4539
+ checkValidity() {
4540
+ return this._internals.checkValidity();
4541
+ }
4542
+ reportValidity() {
4543
+ return this._internals.reportValidity();
4544
+ }
4504
4545
  render() {
4505
4546
  const selectedLabel = this.getSelectedLabel();
4506
4547
  const hasValue = Boolean(this.value && selectedLabel);
@@ -4559,6 +4600,7 @@ var Select = class extends ThemeableElement {
4559
4600
  }
4560
4601
  };
4561
4602
  Select.styles = selectStyles;
4603
+ Select.formAssociated = true;
4562
4604
  __decorateClass([
4563
4605
  property15({ reflect: true })
4564
4606
  ], Select.prototype, "variant", 2);
@@ -4566,14 +4608,17 @@ __decorateClass([
4566
4608
  property15({ reflect: true })
4567
4609
  ], Select.prototype, "size", 2);
4568
4610
  __decorateClass([
4569
- property15()
4611
+ property15({ reflect: true })
4570
4612
  ], Select.prototype, "value", 2);
4571
4613
  __decorateClass([
4572
- property15()
4614
+ property15({ reflect: true })
4573
4615
  ], Select.prototype, "placeholder", 2);
4574
4616
  __decorateClass([
4575
- property15()
4617
+ property15({ reflect: true })
4576
4618
  ], Select.prototype, "label", 2);
4619
+ __decorateClass([
4620
+ property15({ reflect: true })
4621
+ ], Select.prototype, "name", 2);
4577
4622
  __decorateClass([
4578
4623
  property15({ attribute: "helper-text" })
4579
4624
  ], Select.prototype, "helperText", 2);
@@ -4765,7 +4810,7 @@ var switchStyles = css17`
4765
4810
  // src/components/switch/switch.ts
4766
4811
  var Switch = class extends ThemeableElement {
4767
4812
  constructor() {
4768
- super(...arguments);
4813
+ super();
4769
4814
  this.variant = "primary";
4770
4815
  this.size = "md";
4771
4816
  this.checked = false;
@@ -4775,6 +4820,7 @@ var Switch = class extends ThemeableElement {
4775
4820
  this.labelPosition = "right";
4776
4821
  this.name = "";
4777
4822
  this.value = "on";
4823
+ this._internals = this.attachInternals();
4778
4824
  }
4779
4825
  /**
4780
4826
  * Handles switch change events.
@@ -4783,6 +4829,24 @@ var Switch = class extends ThemeableElement {
4783
4829
  * @param e - The native change event
4784
4830
  * @private
4785
4831
  */
4832
+ updated() {
4833
+ this._internals.setFormValue(this.checked ? this.value : null);
4834
+ const input = this.shadowRoot?.querySelector("input");
4835
+ if (this.required && !this.checked && input) {
4836
+ this._internals.setValidity({ valueMissing: true }, "Please check this switch", input);
4837
+ } else {
4838
+ this._internals.setValidity({});
4839
+ }
4840
+ }
4841
+ formResetCallback() {
4842
+ this.checked = false;
4843
+ }
4844
+ checkValidity() {
4845
+ return this._internals.checkValidity();
4846
+ }
4847
+ reportValidity() {
4848
+ return this._internals.reportValidity();
4849
+ }
4786
4850
  handleChange(e) {
4787
4851
  const target = e.target;
4788
4852
  this.checked = target.checked;
@@ -4818,6 +4882,7 @@ var Switch = class extends ThemeableElement {
4818
4882
  }
4819
4883
  };
4820
4884
  Switch.styles = switchStyles;
4885
+ Switch.formAssociated = true;
4821
4886
  __decorateClass([
4822
4887
  property16({ reflect: true })
4823
4888
  ], Switch.prototype, "variant", 2);
@@ -4834,16 +4899,16 @@ __decorateClass([
4834
4899
  property16({ type: Boolean, reflect: true })
4835
4900
  ], Switch.prototype, "required", 2);
4836
4901
  __decorateClass([
4837
- property16()
4902
+ property16({ reflect: true })
4838
4903
  ], Switch.prototype, "label", 2);
4839
4904
  __decorateClass([
4840
4905
  property16({ attribute: "label-position", reflect: true })
4841
4906
  ], Switch.prototype, "labelPosition", 2);
4842
4907
  __decorateClass([
4843
- property16()
4908
+ property16({ reflect: true })
4844
4909
  ], Switch.prototype, "name", 2);
4845
4910
  __decorateClass([
4846
- property16()
4911
+ property16({ reflect: true })
4847
4912
  ], Switch.prototype, "value", 2);
4848
4913
  Switch = __decorateClass([
4849
4914
  customElement15("lt-switch")
@@ -5004,10 +5069,10 @@ var Tab = class extends ThemeableElement {
5004
5069
  };
5005
5070
  Tab.styles = tabStyles;
5006
5071
  __decorateClass([
5007
- property17()
5072
+ property17({ reflect: true })
5008
5073
  ], Tab.prototype, "label", 2);
5009
5074
  __decorateClass([
5010
- property17()
5075
+ property17({ reflect: true })
5011
5076
  ], Tab.prototype, "value", 2);
5012
5077
  __decorateClass([
5013
5078
  property17({ attribute: "icon-start" })
@@ -5235,7 +5300,7 @@ var TabGroup = class extends ThemeableElement {
5235
5300
  };
5236
5301
  TabGroup.styles = tabGroupStyles;
5237
5302
  __decorateClass([
5238
- property19()
5303
+ property19({ reflect: true })
5239
5304
  ], TabGroup.prototype, "value", 2);
5240
5305
  __decorateClass([
5241
5306
  property19({ reflect: true })
@@ -6051,13 +6116,14 @@ var textfieldStyles = css22`
6051
6116
  import "@latty-ds/icons";
6052
6117
  var Textfield = class extends ThemeableElement {
6053
6118
  constructor() {
6054
- super(...arguments);
6119
+ super();
6055
6120
  this.variant = "default";
6056
6121
  this.size = "md";
6057
6122
  this.type = "text";
6058
6123
  this.value = "";
6059
6124
  this.placeholder = "";
6060
6125
  this.label = "";
6126
+ this.name = "";
6061
6127
  this.helperText = "";
6062
6128
  this.disabled = false;
6063
6129
  this.required = false;
@@ -6076,6 +6142,7 @@ var Textfield = class extends ThemeableElement {
6076
6142
  this._touched = true;
6077
6143
  this._autoError = !this._validate();
6078
6144
  };
6145
+ this._internals = this.attachInternals();
6079
6146
  }
6080
6147
  /**
6081
6148
  * Handles input events from the native input or textarea element.
@@ -6173,6 +6240,22 @@ var Textfield = class extends ThemeableElement {
6173
6240
  updated(changed) {
6174
6241
  super.updated(changed);
6175
6242
  this.toggleAttribute("data-invalid", this._autoError);
6243
+ this._internals.setFormValue(this.value || null);
6244
+ const anchor = this.shadowRoot.querySelector("input") ?? this.shadowRoot.querySelector("textarea");
6245
+ if (this.required && !this.value && anchor) {
6246
+ this._internals.setValidity({ valueMissing: true }, "Please fill in this field", anchor);
6247
+ } else {
6248
+ this._internals.setValidity({});
6249
+ }
6250
+ }
6251
+ formResetCallback() {
6252
+ this.value = "";
6253
+ }
6254
+ checkValidity() {
6255
+ return this._internals.checkValidity();
6256
+ }
6257
+ reportValidity() {
6258
+ return this._internals.reportValidity();
6176
6259
  }
6177
6260
  render() {
6178
6261
  const hasStartIcon = Boolean(this.iconStart);
@@ -6247,6 +6330,7 @@ var Textfield = class extends ThemeableElement {
6247
6330
  }
6248
6331
  };
6249
6332
  Textfield.styles = textfieldStyles;
6333
+ Textfield.formAssociated = true;
6250
6334
  __decorateClass([
6251
6335
  property21({ reflect: true })
6252
6336
  ], Textfield.prototype, "variant", 2);
@@ -6257,14 +6341,17 @@ __decorateClass([
6257
6341
  property21({ reflect: true })
6258
6342
  ], Textfield.prototype, "type", 2);
6259
6343
  __decorateClass([
6260
- property21()
6344
+ property21({ reflect: true })
6261
6345
  ], Textfield.prototype, "value", 2);
6262
6346
  __decorateClass([
6263
- property21()
6347
+ property21({ reflect: true })
6264
6348
  ], Textfield.prototype, "placeholder", 2);
6265
6349
  __decorateClass([
6266
- property21()
6350
+ property21({ reflect: true })
6267
6351
  ], Textfield.prototype, "label", 2);
6352
+ __decorateClass([
6353
+ property21({ reflect: true })
6354
+ ], Textfield.prototype, "name", 2);
6268
6355
  __decorateClass([
6269
6356
  property21({ attribute: "helper-text" })
6270
6357
  ], Textfield.prototype, "helperText", 2);
@@ -6469,7 +6556,7 @@ __decorateClass([
6469
6556
  property22()
6470
6557
  ], Avatar.prototype, "src", 2);
6471
6558
  __decorateClass([
6472
- property22()
6559
+ property22({ reflect: true })
6473
6560
  ], Avatar.prototype, "name", 2);
6474
6561
  __decorateClass([
6475
6562
  property22()
@@ -7489,7 +7576,7 @@ var sliderStyles = css28`
7489
7576
  // src/components/slider/slider.ts
7490
7577
  var Slider = class extends ThemeableElement {
7491
7578
  constructor() {
7492
- super(...arguments);
7579
+ super();
7493
7580
  this.size = "md";
7494
7581
  this.disabled = false;
7495
7582
  this.tooltip = false;
@@ -7499,6 +7586,7 @@ var Slider = class extends ThemeableElement {
7499
7586
  this.value = 0;
7500
7587
  this.label = "";
7501
7588
  this.name = "";
7589
+ this._internals = this.attachInternals();
7502
7590
  }
7503
7591
  get _fillPercent() {
7504
7592
  return (this.value - this.min) / (this.max - this.min) * 100;
@@ -7515,6 +7603,17 @@ var Slider = class extends ThemeableElement {
7515
7603
  const centerPx = fill / 100 * (trackW - thumbPx) + thumbPx / 2;
7516
7604
  this.style.setProperty("--_thumb-left", `${centerPx / trackW * 100}%`);
7517
7605
  }
7606
+ this._internals.setFormValue(String(this.value));
7607
+ this._internals.setValidity({});
7608
+ }
7609
+ formResetCallback() {
7610
+ this.value = this.min;
7611
+ }
7612
+ checkValidity() {
7613
+ return this._internals.checkValidity();
7614
+ }
7615
+ reportValidity() {
7616
+ return this._internals.reportValidity();
7518
7617
  }
7519
7618
  _onInput(e) {
7520
7619
  e.stopPropagation();
@@ -7568,6 +7667,7 @@ var Slider = class extends ThemeableElement {
7568
7667
  }
7569
7668
  };
7570
7669
  Slider.styles = sliderStyles;
7670
+ Slider.formAssociated = true;
7571
7671
  __decorateClass([
7572
7672
  property27({ reflect: true })
7573
7673
  ], Slider.prototype, "size", 2);
@@ -7587,13 +7687,13 @@ __decorateClass([
7587
7687
  property27({ type: Number })
7588
7688
  ], Slider.prototype, "step", 2);
7589
7689
  __decorateClass([
7590
- property27({ type: Number })
7690
+ property27({ type: Number, reflect: true })
7591
7691
  ], Slider.prototype, "value", 2);
7592
7692
  __decorateClass([
7593
- property27()
7693
+ property27({ reflect: true })
7594
7694
  ], Slider.prototype, "label", 2);
7595
7695
  __decorateClass([
7596
- property27()
7696
+ property27({ reflect: true })
7597
7697
  ], Slider.prototype, "name", 2);
7598
7698
  __decorateClass([
7599
7699
  query5("input")
@@ -8175,7 +8275,7 @@ __decorateClass([
8175
8275
  property31()
8176
8276
  ], NavItem.prototype, "href", 2);
8177
8277
  __decorateClass([
8178
- property31()
8278
+ property31({ reflect: true })
8179
8279
  ], NavItem.prototype, "label", 2);
8180
8280
  __decorateClass([
8181
8281
  property31({ attribute: "icon-start" })
@@ -8227,7 +8327,7 @@ var Nav = class extends ThemeableElement {
8227
8327
  };
8228
8328
  Nav.styles = navStyles;
8229
8329
  __decorateClass([
8230
- property32()
8330
+ property32({ reflect: true })
8231
8331
  ], Nav.prototype, "label", 2);
8232
8332
  __decorateClass([
8233
8333
  property32({ reflect: true })
@@ -8541,7 +8641,7 @@ __decorateClass([
8541
8641
  property35({ reflect: true })
8542
8642
  ], Divider.prototype, "appearance", 2);
8543
8643
  __decorateClass([
8544
- property35()
8644
+ property35({ reflect: true })
8545
8645
  ], Divider.prototype, "label", 2);
8546
8646
  Divider = __decorateClass([
8547
8647
  customElement34("lt-divider")
@@ -8659,7 +8759,7 @@ var Progress = class extends ThemeableElement {
8659
8759
  };
8660
8760
  Progress.styles = progressStyles;
8661
8761
  __decorateClass([
8662
- property36({ type: Number })
8762
+ property36({ type: Number, reflect: true })
8663
8763
  ], Progress.prototype, "value", 2);
8664
8764
  __decorateClass([
8665
8765
  property36({ reflect: true })
@@ -8668,7 +8768,7 @@ __decorateClass([
8668
8768
  property36({ reflect: true })
8669
8769
  ], Progress.prototype, "size", 2);
8670
8770
  __decorateClass([
8671
- property36()
8771
+ property36({ reflect: true })
8672
8772
  ], Progress.prototype, "label", 2);
8673
8773
  __decorateClass([
8674
8774
  property36({ type: Boolean, reflect: true })
@@ -8993,7 +9093,7 @@ __decorateClass([
8993
9093
  property38()
8994
9094
  ], SidePanel.prototype, "size", 2);
8995
9095
  __decorateClass([
8996
- property38()
9096
+ property38({ reflect: true })
8997
9097
  ], SidePanel.prototype, "label", 2);
8998
9098
  __decorateClass([
8999
9099
  property38({ type: Boolean, attribute: "no-close-button" })
@@ -9358,7 +9458,7 @@ var datepickerStyles = css41`
9358
9458
  // src/components/datepicker/datepicker.ts
9359
9459
  var Datepicker = class extends ThemeableElement {
9360
9460
  constructor() {
9361
- super(...arguments);
9461
+ super();
9362
9462
  this.type = "date";
9363
9463
  this.value = "";
9364
9464
  this.min = "";
@@ -9371,6 +9471,26 @@ var Datepicker = class extends ThemeableElement {
9371
9471
  this.required = false;
9372
9472
  this.readonly = false;
9373
9473
  this.name = "";
9474
+ this._internals = this.attachInternals();
9475
+ }
9476
+ updated(changed) {
9477
+ if (changed.has("value") || changed.has("required")) {
9478
+ this._internals.setFormValue(this.value || null);
9479
+ if (this.required && !this.value) {
9480
+ this._internals.setValidity({ valueMissing: true }, "Please select a date", this.input);
9481
+ } else {
9482
+ this._internals.setValidity({});
9483
+ }
9484
+ }
9485
+ }
9486
+ formResetCallback() {
9487
+ this.value = "";
9488
+ }
9489
+ checkValidity() {
9490
+ return this._internals.checkValidity();
9491
+ }
9492
+ reportValidity() {
9493
+ return this._internals.reportValidity();
9374
9494
  }
9375
9495
  handleChange() {
9376
9496
  this.value = this.input.value;
@@ -9387,7 +9507,6 @@ var Datepicker = class extends ThemeableElement {
9387
9507
  .value=${this.value}
9388
9508
  min=${this.min || nothing11}
9389
9509
  max=${this.max || nothing11}
9390
- name=${this.name || nothing11}
9391
9510
  ?disabled=${this.disabled}
9392
9511
  ?required=${this.required}
9393
9512
  ?readonly=${this.readonly}
@@ -9407,20 +9526,21 @@ var Datepicker = class extends ThemeableElement {
9407
9526
  }
9408
9527
  };
9409
9528
  Datepicker.styles = datepickerStyles;
9529
+ Datepicker.formAssociated = true;
9410
9530
  __decorateClass([
9411
9531
  property41({ reflect: true })
9412
9532
  ], Datepicker.prototype, "type", 2);
9413
9533
  __decorateClass([
9414
- property41()
9534
+ property41({ reflect: true })
9415
9535
  ], Datepicker.prototype, "value", 2);
9416
9536
  __decorateClass([
9417
- property41()
9537
+ property41({ reflect: true })
9418
9538
  ], Datepicker.prototype, "min", 2);
9419
9539
  __decorateClass([
9420
- property41()
9540
+ property41({ reflect: true })
9421
9541
  ], Datepicker.prototype, "max", 2);
9422
9542
  __decorateClass([
9423
- property41()
9543
+ property41({ reflect: true })
9424
9544
  ], Datepicker.prototype, "label", 2);
9425
9545
  __decorateClass([
9426
9546
  property41({ attribute: "helper-text" })
@@ -9441,7 +9561,7 @@ __decorateClass([
9441
9561
  property41({ type: Boolean, reflect: true })
9442
9562
  ], Datepicker.prototype, "readonly", 2);
9443
9563
  __decorateClass([
9444
- property41()
9564
+ property41({ reflect: true })
9445
9565
  ], Datepicker.prototype, "name", 2);
9446
9566
  __decorateClass([
9447
9567
  query7("input")
@@ -10531,7 +10651,7 @@ var dateInputStyles = [
10531
10651
  // src/components/date-input/date-input.ts
10532
10652
  var DateInput = class extends ThemeableElement {
10533
10653
  constructor() {
10534
- super(...arguments);
10654
+ super();
10535
10655
  this.value = "";
10536
10656
  this.min = "";
10537
10657
  this.max = "";
@@ -10551,6 +10671,7 @@ var DateInput = class extends ThemeableElement {
10551
10671
  this._open = false;
10552
10672
  this._cleanupClickOutside = null;
10553
10673
  this._floatingCleanup = null;
10674
+ this._internals = this.attachInternals();
10554
10675
  }
10555
10676
  get _displayValue() {
10556
10677
  if (!this.value) return "";
@@ -10598,6 +10719,24 @@ var DateInput = class extends ThemeableElement {
10598
10719
  this.shadowRoot?.querySelector(".field-btn")?.focus();
10599
10720
  }
10600
10721
  }
10722
+ updated() {
10723
+ this._internals.setFormValue(this.value || null);
10724
+ const btn = this.shadowRoot?.querySelector("#field-btn");
10725
+ if (this.required && !this.value && btn) {
10726
+ this._internals.setValidity({ valueMissing: true }, "Please select a date", btn);
10727
+ } else {
10728
+ this._internals.setValidity({});
10729
+ }
10730
+ }
10731
+ formResetCallback() {
10732
+ this.value = "";
10733
+ }
10734
+ checkValidity() {
10735
+ return this._internals.checkValidity();
10736
+ }
10737
+ reportValidity() {
10738
+ return this._internals.reportValidity();
10739
+ }
10601
10740
  render() {
10602
10741
  const displayText = this._displayValue || this.placeholder;
10603
10742
  const isPlaceholder = !this._displayValue;
@@ -10646,13 +10785,13 @@ var DateInput = class extends ThemeableElement {
10646
10785
  </div>
10647
10786
  </div>
10648
10787
 
10649
- ${this.name ? html42`<input type="hidden" name=${this.name} .value=${this.value} />` : nothing12}
10650
10788
  ${this.helperText ? html42`<span class="helper-text">${this.helperText}</span>` : nothing12}
10651
10789
  </div>
10652
10790
  `;
10653
10791
  }
10654
10792
  };
10655
10793
  DateInput.styles = dateInputStyles;
10794
+ DateInput.formAssociated = true;
10656
10795
  __decorateClass([
10657
10796
  property43({ reflect: true })
10658
10797
  ], DateInput.prototype, "value", 2);
@@ -10672,10 +10811,10 @@ __decorateClass([
10672
10811
  property43({ attribute: "week-start", reflect: true })
10673
10812
  ], DateInput.prototype, "weekStart", 2);
10674
10813
  __decorateClass([
10675
- property43()
10814
+ property43({ reflect: true })
10676
10815
  ], DateInput.prototype, "label", 2);
10677
10816
  __decorateClass([
10678
- property43()
10817
+ property43({ reflect: true })
10679
10818
  ], DateInput.prototype, "placeholder", 2);
10680
10819
  __decorateClass([
10681
10820
  property43({ attribute: "helper-text" })
@@ -10693,7 +10832,7 @@ __decorateClass([
10693
10832
  property43({ type: Boolean, reflect: true })
10694
10833
  ], DateInput.prototype, "required", 2);
10695
10834
  __decorateClass([
10696
- property43()
10835
+ property43({ reflect: true })
10697
10836
  ], DateInput.prototype, "name", 2);
10698
10837
  __decorateClass([
10699
10838
  state6()
@@ -10894,7 +11033,7 @@ var comboboxStyles = [
10894
11033
  import "@latty-ds/icons";
10895
11034
  var Combobox = class extends ThemeableElement {
10896
11035
  constructor() {
10897
- super(...arguments);
11036
+ super();
10898
11037
  this.options = [];
10899
11038
  this.value = "";
10900
11039
  this.label = "";
@@ -10910,6 +11049,7 @@ var Combobox = class extends ThemeableElement {
10910
11049
  this.activeIndex = -1;
10911
11050
  this._cleanupClickOutside = null;
10912
11051
  this._floatingCleanup = null;
11052
+ this._internals = this.attachInternals();
10913
11053
  }
10914
11054
  get selectedLabel() {
10915
11055
  return this.options.find((o) => o.value === this.value)?.label ?? "";
@@ -10942,7 +11082,7 @@ var Combobox = class extends ThemeableElement {
10942
11082
  if (opt.disabled) return;
10943
11083
  this.value = opt.value;
10944
11084
  this.closeDropdown();
10945
- dispatch(this, "change", { value: opt.value, label: opt.label });
11085
+ dispatch(this, "change", { value: opt.value });
10946
11086
  }
10947
11087
  handleInput(e) {
10948
11088
  this.query = e.target.value;
@@ -10980,6 +11120,24 @@ var Combobox = class extends ThemeableElement {
10980
11120
  this._floatingCleanup?.();
10981
11121
  this._floatingCleanup = null;
10982
11122
  }
11123
+ updated() {
11124
+ this._internals.setFormValue(this.value || null);
11125
+ const input = this.shadowRoot?.querySelector("input");
11126
+ if (this.required && !this.value && input) {
11127
+ this._internals.setValidity({ valueMissing: true }, "Please select an option", input);
11128
+ } else {
11129
+ this._internals.setValidity({});
11130
+ }
11131
+ }
11132
+ formResetCallback() {
11133
+ this.value = "";
11134
+ }
11135
+ checkValidity() {
11136
+ return this._internals.checkValidity();
11137
+ }
11138
+ reportValidity() {
11139
+ return this._internals.reportValidity();
11140
+ }
10983
11141
  render() {
10984
11142
  const opts = this.filtered;
10985
11143
  const displayValue = this.open ? this.query : this.selectedLabel;
@@ -10992,7 +11150,6 @@ var Combobox = class extends ThemeableElement {
10992
11150
  aria-autocomplete="list"
10993
11151
  aria-required=${this.required}
10994
11152
  autocomplete="off"
10995
- name=${this.name || nothing13}
10996
11153
  placeholder=${this.open ? this.placeholder : this.selectedLabel || this.placeholder}
10997
11154
  .value=${displayValue}
10998
11155
  ?disabled=${this.disabled}
@@ -11034,17 +11191,18 @@ var Combobox = class extends ThemeableElement {
11034
11191
  }
11035
11192
  };
11036
11193
  Combobox.styles = comboboxStyles;
11194
+ Combobox.formAssociated = true;
11037
11195
  __decorateClass([
11038
11196
  property44({ type: Array })
11039
11197
  ], Combobox.prototype, "options", 2);
11040
11198
  __decorateClass([
11041
- property44()
11199
+ property44({ reflect: true })
11042
11200
  ], Combobox.prototype, "value", 2);
11043
11201
  __decorateClass([
11044
- property44()
11202
+ property44({ reflect: true })
11045
11203
  ], Combobox.prototype, "label", 2);
11046
11204
  __decorateClass([
11047
- property44()
11205
+ property44({ reflect: true })
11048
11206
  ], Combobox.prototype, "placeholder", 2);
11049
11207
  __decorateClass([
11050
11208
  property44({ attribute: "helper-text" })
@@ -11062,7 +11220,7 @@ __decorateClass([
11062
11220
  property44({ type: Boolean, reflect: true })
11063
11221
  ], Combobox.prototype, "required", 2);
11064
11222
  __decorateClass([
11065
- property44()
11223
+ property44({ reflect: true })
11066
11224
  ], Combobox.prototype, "name", 2);
11067
11225
  __decorateClass([
11068
11226
  state7()
@@ -11293,13 +11451,34 @@ function formatColor(hex, format) {
11293
11451
  }
11294
11452
  var ColorInput = class extends ThemeableElement {
11295
11453
  constructor() {
11296
- super(...arguments);
11454
+ super();
11297
11455
  this.value = "";
11298
11456
  this.format = "hex";
11299
11457
  this.label = "";
11300
11458
  this.placeholder = "Pick a color";
11301
11459
  this.disabled = false;
11460
+ this.required = false;
11461
+ this.name = "";
11302
11462
  this.size = "md";
11463
+ this._internals = this.attachInternals();
11464
+ }
11465
+ updated() {
11466
+ this._internals.setFormValue(this.value || null);
11467
+ const input = this.shadowRoot?.querySelector('input[type="color"]');
11468
+ if (this.required && !this.value && input) {
11469
+ this._internals.setValidity({ valueMissing: true }, "Please select a color", input);
11470
+ } else {
11471
+ this._internals.setValidity({});
11472
+ }
11473
+ }
11474
+ formResetCallback() {
11475
+ this.value = "";
11476
+ }
11477
+ checkValidity() {
11478
+ return this._internals.checkValidity();
11479
+ }
11480
+ reportValidity() {
11481
+ return this._internals.reportValidity();
11303
11482
  }
11304
11483
  _handleChange(e) {
11305
11484
  const pickerHex = e.target.value;
@@ -11335,21 +11514,28 @@ var ColorInput = class extends ThemeableElement {
11335
11514
  }
11336
11515
  };
11337
11516
  ColorInput.styles = colorInputStyles;
11517
+ ColorInput.formAssociated = true;
11338
11518
  __decorateClass([
11339
- property45()
11519
+ property45({ reflect: true })
11340
11520
  ], ColorInput.prototype, "value", 2);
11341
11521
  __decorateClass([
11342
11522
  property45({ reflect: true })
11343
11523
  ], ColorInput.prototype, "format", 2);
11344
11524
  __decorateClass([
11345
- property45()
11525
+ property45({ reflect: true })
11346
11526
  ], ColorInput.prototype, "label", 2);
11347
11527
  __decorateClass([
11348
- property45()
11528
+ property45({ reflect: true })
11349
11529
  ], ColorInput.prototype, "placeholder", 2);
11350
11530
  __decorateClass([
11351
11531
  property45({ type: Boolean, reflect: true })
11352
11532
  ], ColorInput.prototype, "disabled", 2);
11533
+ __decorateClass([
11534
+ property45({ type: Boolean, reflect: true })
11535
+ ], ColorInput.prototype, "required", 2);
11536
+ __decorateClass([
11537
+ property45({ reflect: true })
11538
+ ], ColorInput.prototype, "name", 2);
11353
11539
  __decorateClass([
11354
11540
  property45({ reflect: true })
11355
11541
  ], ColorInput.prototype, "size", 2);