@agentero/design-system 0.27.0 → 0.28.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 (46) hide show
  1. package/lib/index.d.ts +1 -0
  2. package/lib/index.js +2 -1
  3. package/lib/merge-props.d.ts +42 -0
  4. package/lib/merge-props.js +24 -0
  5. package/mcp/manifests/components.html +841 -72
  6. package/mcp/manifests/components.json +508 -10
  7. package/package.json +10 -1
  8. package/src/alert/alert.js +28 -28
  9. package/src/avatar/avatar.js +22 -22
  10. package/src/avatar-group/avatar-group.js +6 -6
  11. package/src/button/button.js +7 -7
  12. package/src/data-table/data-table.js +36 -36
  13. package/src/dropdown-menu/dropdown-menu.js +2 -2
  14. package/src/field/context.d.ts +62 -0
  15. package/src/field/context.js +6 -0
  16. package/src/field/field.d.ts +214 -0
  17. package/src/field/field.js +129 -0
  18. package/src/field/icons.d.ts +9 -0
  19. package/src/field/icons.js +14 -0
  20. package/src/field/index.d.ts +30 -0
  21. package/src/field/index.js +13 -0
  22. package/src/field-text/field-text.d.ts +28 -0
  23. package/src/field-text/field-text.js +26 -0
  24. package/src/field-text/index.d.ts +2 -0
  25. package/src/field-text/index.js +2 -0
  26. package/src/hover-card/hover-card.js +1 -1
  27. package/src/input/context.d.ts +17 -0
  28. package/src/input/context.js +10 -0
  29. package/src/input/index.d.ts +1 -0
  30. package/src/input/index.js +3 -2
  31. package/src/input/input.d.ts +7 -7
  32. package/src/input/input.js +16 -11
  33. package/src/label/context.d.ts +13 -0
  34. package/src/label/context.js +7 -0
  35. package/src/label/index.d.ts +1 -0
  36. package/src/label/index.js +3 -2
  37. package/src/label/label.d.ts +6 -1
  38. package/src/label/label.js +19 -17
  39. package/src/modal/modal.js +25 -25
  40. package/src/popover/popover.js +1 -1
  41. package/src/progress/progress.js +9 -9
  42. package/src/switch/switch.js +7 -7
  43. package/src/table/table.js +28 -28
  44. package/src/tabs/tabs.js +26 -26
  45. package/src/tag/tag.js +7 -7
  46. package/theme/base.css +19 -6
@@ -588,13 +588,13 @@
588
588
  <header>
589
589
  <div class="wrap">
590
590
  <h1>Manifest Debugger</h1>
591
- <div class="summary"><a class="filter-pill all" data-k="all" href="#filter-all">All</a><span class="filter-pill ok" aria-disabled="true">27 components ok</span><span class="filter-pill ok" aria-disabled="true">214 stories ok</span></div>
591
+ <div class="summary"><a class="filter-pill all" data-k="all" href="#filter-all">All</a><span class="filter-pill ok" aria-disabled="true">29 components ok</span><span class="filter-pill ok" aria-disabled="true">238 stories ok</span></div>
592
592
  </div>
593
593
  </header>
594
594
  <main>
595
595
  <div class="wrap">
596
596
  <div class="note ok" style="margin-bottom: 16px;">
597
- Using <code>react-component-meta</code>. Generation took <strong>3.0s</strong>.
597
+ Using <code>react-component-meta</code>. Generation took <strong>4.1s</strong>.
598
598
  </div>
599
599
  <h2 class="section-title">Components</h2>
600
600
  <div class="grid" role="list">
@@ -4487,6 +4487,708 @@ actions outright unless the user needs to see them and understand why.</div>
4487
4487
  </div>
4488
4488
 
4489
4489
 
4490
+ </div>
4491
+ </article>
4492
+ <article
4493
+ class="card
4494
+ no-error
4495
+ no-info
4496
+ no-story-error
4497
+ no-doc-error"
4498
+ role="listitem"
4499
+ aria-label="Field.Root">
4500
+ <div class="head">
4501
+ <div class="title">
4502
+ <h2><span class="status-dot dot-ok"></span> Field.Root</h2>
4503
+ <div class="badges">
4504
+ <label for="c-11-components-field-props" class="badge ok as-toggle">6 prop types</label>
4505
+
4506
+ <label for="c-11-components-field-stories" class="badge ok as-toggle">15 stories</label>
4507
+
4508
+
4509
+ </div>
4510
+ </div>
4511
+ <div class="meta" title="./src/field/field.stories.tsx">components-field · ./src/field/field.stories.tsx</div>
4512
+ <div>Wraps a label, control, description and error into one field</div>
4513
+ <div class="hint">Field lays out a single form field — label, control, helper text and error —
4514
+ and wires the accessibility relationships between them. `Field.Root`
4515
+ generates the ids and shares them through context: `Label` reads
4516
+ `LabelContext`, `Field.Description` and `Field.Error` read `FieldContext`,
4517
+ and a `Field&lt;X&gt;` such as `FieldText` provides the control&#39;s context. Nobody
4518
+ passes an `id` by hand.
4519
+
4520
+ Presentational and form-library agnostic: pass `invalid` and the error
4521
+ messages from whatever validates the form. Spacing between fields belongs to
4522
+ `Field.Group`, never to a margin on the field itself.
4523
+
4524
+ `Field.Description` and `Field.Error` register themselves with the root, so
4525
+ the control&#39;s `aria-describedby` lists exactly the messages on screen and is
4526
+ absent when there is none.</div>
4527
+ <div class="kv"><span class="chip">summary: Wraps a label, control, description and error into one field</span><span class="chip">example: &lt;Field.Root invalid={!!error} required&gt;
4528
+ &lt;Field.Label&gt;Email&lt;/Field.Label&gt;
4529
+ &lt;Input type=&quot;email&quot; /&gt;
4530
+ &lt;Field.Description&gt;We only use this for policy documents.&lt;/Field.Description&gt;
4531
+ &lt;Field.Error errors={[error]} /&gt;
4532
+ &lt;/Field.Root&gt;</span></div>
4533
+ </div>
4534
+
4535
+ <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
4536
+
4537
+
4538
+ <input id="c-11-components-field-stories" class="tg tg-stories" type="checkbox" hidden />
4539
+
4540
+
4541
+ <input id="c-11-components-field-props" class="tg tg-props" type="checkbox" hidden />
4542
+
4543
+ <div class="panels">
4544
+
4545
+
4546
+
4547
+ <div class="panel panel-props">
4548
+ <div class="note ok">
4549
+ <div class="row">
4550
+ <span class="ex-name">Prop types <small>(react-component-meta)</small></span>
4551
+ <span class="badge ok">6 prop types</span>
4552
+ </div>
4553
+ <pre><code>Component: src/field/index.ts::Field</code></pre>
4554
+ <pre><code>Props:</code></pre>
4555
+ <pre><code>/**
4556
+ * `id` for the control. Generated when omitted. Set it here, not on the
4557
+ * control, so the label and the messages keep pointing at the right element.
4558
+ */
4559
+ controlId?: string
4560
+
4561
+ /**
4562
+ * Disables the control through its context and sets `data-disabled` on the root.
4563
+ */
4564
+ disabled?: boolean = false
4565
+
4566
+ /**
4567
+ * Marks the field as failing validation: sets `data-invalid` on the root and
4568
+ * `aria-invalid` on the control through its context, which drives the
4569
+ * control&#39;s destructive border. The label keeps its color by design.
4570
+ */
4571
+ invalid?: boolean = false
4572
+
4573
+ /**
4574
+ * Layout of the field. `vertical` (default) stacks label, control and
4575
+ * messages. `horizontal` is one row at every width: the first child fills it
4576
+ * and the rest keep their natural width, aligned to the right, so the
4577
+ * controls of stacked fields line up. `responsive` stacks below `28rem` and
4578
+ * behaves like `horizontal` from there, measured on the field itself, so it
4579
+ * needs no particular wrapper. In both, `Field.Content` groups a control with
4580
+ * its messages, or a label with its description.
4581
+ */
4582
+ orientation?: &quot;horizontal&quot; | &quot;vertical&quot; | &quot;responsive&quot; = &#39;vertical&#39;
4583
+
4584
+ /**
4585
+ * Makes the control read-only through its context (focusable and copyable,
4586
+ * not editable, still submitted) and sets `data-readonly` on the root.
4587
+ */
4588
+ readOnly?: boolean = false
4589
+
4590
+ /**
4591
+ * Single source of truth for a required field: the `Label` shows its
4592
+ * asterisk and the control receives `required`, both through context.
4593
+ */
4594
+ required?: boolean = false</code></pre>
4595
+ </div>
4596
+ </div>
4597
+
4598
+ <div class="panel panel-stories">
4599
+
4600
+
4601
+
4602
+ <div class="note ok">
4603
+ <div class="row">
4604
+ <span class="ex-name">Imports</span>
4605
+ </div>
4606
+ <pre><code>import { Field, FieldContext, Label } from "@agentero/design-system";</code></pre>
4607
+ </div>
4608
+
4609
+
4610
+ <div class="note ok">
4611
+ <div class="row">
4612
+ <span class="ex-name">Default</span>
4613
+ <span class="badge ok">story ok</span>
4614
+ </div>
4615
+ <div>Default vertical field with label, control and description</div>
4616
+ <div class="hint">A vertical field with a label, a control and helper text. The label points
4617
+ at the control and the description is referenced by it — neither needed an
4618
+ explicit `id`.</div>
4619
+ <pre><code>const Default = () =&gt; &lt;Field.Root
4620
+ orientation=&quot;vertical&quot;
4621
+ invalid={false}
4622
+ disabled={false}
4623
+ readOnly={false}
4624
+ required={false}&gt;
4625
+ &lt;Label&gt;Email&lt;/Label&gt;
4626
+ &lt;DemoInput placeholder=&quot;you@example.com&quot; /&gt;
4627
+ &lt;Field.Description&gt;We only use this to send policy documents.&lt;/Field.Description&gt;
4628
+ &lt;/Field.Root&gt;;</code></pre>
4629
+ </div>
4630
+ <div class="note ok">
4631
+ <div class="row">
4632
+ <span class="ex-name">Required</span>
4633
+ <span class="badge ok">story ok</span>
4634
+ </div>
4635
+ <div>Required field driven from the root alone</div>
4636
+ <div class="hint">`required` on the root is the single source of truth: the label shows its
4637
+ asterisk and the control receives `required`, both through context.</div>
4638
+ <pre><code>const Required = () =&gt; &lt;Field.Root
4639
+ orientation=&quot;vertical&quot;
4640
+ invalid={false}
4641
+ disabled={false}
4642
+ readOnly={false}
4643
+ required&gt;
4644
+ &lt;Label&gt;Full name&lt;/Label&gt;
4645
+ &lt;DemoInput placeholder=&quot;Jane Doe&quot; /&gt;
4646
+ &lt;/Field.Root&gt;;</code></pre>
4647
+ </div>
4648
+ <div class="note ok">
4649
+ <div class="row">
4650
+ <span class="ex-name">Optional</span>
4651
+ <span class="badge ok">story ok</span>
4652
+ </div>
4653
+ <div>Optional field with the muted label suffix</div>
4654
+ <div class="hint">`optional` on the label appends the muted suffix; the control stays
4655
+ non-required.</div>
4656
+ <pre><code>const Optional = () =&gt; &lt;Field.Root
4657
+ orientation=&quot;vertical&quot;
4658
+ invalid={false}
4659
+ disabled={false}
4660
+ readOnly={false}
4661
+ required={false}&gt;
4662
+ &lt;Label optional&gt;Phone number&lt;/Label&gt;
4663
+ &lt;DemoInput type=&quot;tel&quot; placeholder=&quot;+1 (555) 000-0000&quot; /&gt;
4664
+ &lt;/Field.Root&gt;;</code></pre>
4665
+ </div>
4666
+ <div class="note ok">
4667
+ <div class="row">
4668
+ <span class="ex-name">With Tooltip</span>
4669
+ <span class="badge ok">story ok</span>
4670
+ </div>
4671
+ <div>Label with a tooltip trigger beside it</div>
4672
+ <div class="hint">`Field.Label` puts an info button beside the caption. It is a sibling of the
4673
+ `&lt;label&gt;`, so it keeps its own accessible name, clicking it does not focus
4674
+ the control, and the control&#39;s name stays clean. It opens on focus too.</div>
4675
+ <pre><code>const WithTooltip = () =&gt; &lt;Field.Root
4676
+ orientation=&quot;vertical&quot;
4677
+ invalid={false}
4678
+ disabled={false}
4679
+ readOnly={false}
4680
+ required&gt;
4681
+ &lt;Field.Label tooltip=&quot;Issued by the IRS to identify your business.&quot;&gt;Tax ID&lt;/Field.Label&gt;
4682
+ &lt;DemoInput placeholder=&quot;XX-XXXXXXX&quot; /&gt;
4683
+ &lt;/Field.Root&gt;;</code></pre>
4684
+ </div>
4685
+ <div class="note ok">
4686
+ <div class="row">
4687
+ <span class="ex-name">Invalid</span>
4688
+ <span class="badge ok">story ok</span>
4689
+ </div>
4690
+ <div>Invalid field with a single error message</div>
4691
+ <div class="hint">`invalid` on the root sets `data-invalid` for styling and `aria-invalid` on
4692
+ the control, which drives its destructive border; the label keeps its color
4693
+ by design. `Field.Error` takes the error objects as they come from a form
4694
+ library.</div>
4695
+ <pre><code>const Invalid = () =&gt; &lt;Field.Root
4696
+ orientation=&quot;vertical&quot;
4697
+ invalid
4698
+ disabled={false}
4699
+ readOnly={false}
4700
+ required={false}&gt;
4701
+ &lt;Label&gt;Email&lt;/Label&gt;
4702
+ &lt;DemoInput type=&quot;email&quot; defaultValue=&quot;not-an-email&quot; /&gt;
4703
+ &lt;Field.Error errors={[{ message: &#39;Enter a valid email address.&#39; }]} /&gt;
4704
+ &lt;/Field.Root&gt;;</code></pre>
4705
+ </div>
4706
+ <div class="note ok">
4707
+ <div class="row">
4708
+ <span class="ex-name">Multiple Errors</span>
4709
+ <span class="badge ok">story ok</span>
4710
+ </div>
4711
+ <div>Several errors rendered as a de-duplicated list</div>
4712
+ <div class="hint">Several errors render as a list, de-duplicated by message.</div>
4713
+ <pre><code>const MultipleErrors = () =&gt; &lt;Field.Root
4714
+ orientation=&quot;vertical&quot;
4715
+ invalid
4716
+ disabled={false}
4717
+ readOnly={false}
4718
+ required={false}&gt;
4719
+ &lt;Label&gt;Password&lt;/Label&gt;
4720
+ &lt;DemoInput type=&quot;password&quot; defaultValue=&quot;abc&quot; /&gt;
4721
+ &lt;Field.Error
4722
+ errors={[
4723
+ { message: &#39;Use at least 8 characters.&#39; },
4724
+ { message: &#39;Include a number.&#39; },
4725
+ { message: &#39;Use at least 8 characters.&#39; }
4726
+ ]} /&gt;
4727
+ &lt;/Field.Root&gt;;</code></pre>
4728
+ </div>
4729
+ <div class="note ok">
4730
+ <div class="row">
4731
+ <span class="ex-name">No Error</span>
4732
+ <span class="badge ok">story ok</span>
4733
+ </div>
4734
+ <div>Error stays mounted and renders nothing while valid</div>
4735
+ <div class="hint">`Field.Error` renders nothing without a message, so it can stay mounted and
4736
+ receive `undefined` entries while the field is valid. With no description
4737
+ either, the control carries no `aria-describedby` at all.</div>
4738
+ <pre><code>const NoError = () =&gt; &lt;Field.Root
4739
+ orientation=&quot;vertical&quot;
4740
+ invalid={false}
4741
+ disabled={false}
4742
+ readOnly={false}
4743
+ required={false}&gt;
4744
+ &lt;Label&gt;Email&lt;/Label&gt;
4745
+ &lt;DemoInput type=&quot;email&quot; /&gt;
4746
+ &lt;Field.Error errors={[undefined]} /&gt;
4747
+ &lt;/Field.Root&gt;;</code></pre>
4748
+ </div>
4749
+ <div class="note ok">
4750
+ <div class="row">
4751
+ <span class="ex-name">Disabled</span>
4752
+ <span class="badge ok">story ok</span>
4753
+ </div>
4754
+ <div>Disabled field driven from the root</div>
4755
+ <div class="hint">`disabled` on the root disables the control through context and sets
4756
+ `data-disabled` for styling.</div>
4757
+ <pre><code>const Disabled = () =&gt; &lt;Field.Root
4758
+ orientation=&quot;vertical&quot;
4759
+ invalid={false}
4760
+ disabled
4761
+ readOnly={false}
4762
+ required={false}&gt;
4763
+ &lt;Label&gt;Agency&lt;/Label&gt;
4764
+ &lt;DemoInput defaultValue=&quot;Acme Insurance&quot; /&gt;
4765
+ &lt;Field.Description&gt;Managed by your administrator.&lt;/Field.Description&gt;
4766
+ &lt;/Field.Root&gt;;</code></pre>
4767
+ </div>
4768
+ <div class="note ok">
4769
+ <div class="row">
4770
+ <span class="ex-name">Read Only</span>
4771
+ <span class="badge ok">story ok</span>
4772
+ </div>
4773
+ <div>Read-only field driven from the root</div>
4774
+ <div class="hint">`readOnly` on the root makes the control read-only through context and sets
4775
+ `data-readonly` for styling. Unlike `disabled`, the value stays focusable,
4776
+ copyable and submitted.</div>
4777
+ <pre><code>const ReadOnly = () =&gt; &lt;Field.Root
4778
+ orientation=&quot;vertical&quot;
4779
+ invalid={false}
4780
+ disabled={false}
4781
+ readOnly
4782
+ required={false}&gt;
4783
+ &lt;Label&gt;Policy number&lt;/Label&gt;
4784
+ &lt;DemoInput defaultValue=&quot;POL-2049-118&quot; /&gt;
4785
+ &lt;Field.Description&gt;Assigned by the carrier; contact support to change it.&lt;/Field.Description&gt;
4786
+ &lt;/Field.Root&gt;;</code></pre>
4787
+ </div>
4788
+ <div class="note ok">
4789
+ <div class="row">
4790
+ <span class="ex-name">Horizontal</span>
4791
+ <span class="badge ok">story ok</span>
4792
+ </div>
4793
+ <div>Horizontal field, one row at every width, controls right-aligned</div>
4794
+ <div class="hint">`horizontal` is one row at every width. The first child fills the row and
4795
+ everything after it keeps its natural width, aligned to the right edge, so
4796
+ the controls of stacked fields line up whatever their labels measure. Wrap a
4797
+ label with its description, or a control with its messages, in
4798
+ `Field.Content`. A control sets its own width: `Input` is `w-full`, so it
4799
+ gets one here.</div>
4800
+ <pre><code>const Horizontal = () =&gt; (
4801
+ &lt;Field.Group className=&quot;w-[40rem]&quot;&gt;
4802
+ &lt;Field.Root orientation=&quot;horizontal&quot; data-testid=&quot;short&quot;&gt;
4803
+ &lt;Label&gt;Full name&lt;/Label&gt;
4804
+ &lt;DemoInput defaultValue=&quot;Rafa Moro&quot; className=&quot;w-72&quot; /&gt;
4805
+ &lt;/Field.Root&gt;
4806
+
4807
+ &lt;Field.Root orientation=&quot;horizontal&quot; data-testid=&quot;long&quot;&gt;
4808
+ &lt;Label&gt;Title&lt;/Label&gt;
4809
+ &lt;Field.Content className=&quot;w-72&quot;&gt;
4810
+ &lt;DemoInput placeholder=&quot;Software engineer&quot; /&gt;
4811
+ &lt;Field.Description&gt;Shown on your public profile.&lt;/Field.Description&gt;
4812
+ &lt;/Field.Content&gt;
4813
+ &lt;/Field.Root&gt;
4814
+
4815
+ &lt;Field.Root orientation=&quot;horizontal&quot; data-testid=&quot;switch&quot;&gt;
4816
+ &lt;Field.Content&gt;
4817
+ &lt;Label&gt;Auto-renew&lt;/Label&gt;
4818
+ &lt;Field.Description&gt;Renews the policy automatically before it expires.&lt;/Field.Description&gt;
4819
+ &lt;/Field.Content&gt;
4820
+ &lt;DemoInput type=&quot;checkbox&quot; className=&quot;size-5&quot; /&gt;
4821
+ &lt;/Field.Root&gt;
4822
+
4823
+ &lt;div className=&quot;w-[20rem]&quot; data-testid=&quot;narrow&quot;&gt;
4824
+ &lt;Field.Root orientation=&quot;horizontal&quot;&gt;
4825
+ &lt;Label&gt;Email&lt;/Label&gt;
4826
+ &lt;DemoInput type=&quot;email&quot; placeholder=&quot;you@example.com&quot; className=&quot;w-40&quot; /&gt;
4827
+ &lt;/Field.Root&gt;
4828
+ &lt;/div&gt;
4829
+ &lt;/Field.Group&gt;
4830
+ );</code></pre>
4831
+ </div>
4832
+ <div class="note ok">
4833
+ <div class="row">
4834
+ <span class="ex-name">Responsive</span>
4835
+ <span class="badge ok">story ok</span>
4836
+ </div>
4837
+ <div>Responsive field that stacks when narrow</div>
4838
+ <div class="hint">`responsive` stacks the parts below `28rem` and behaves like `horizontal`
4839
+ from there: first child fills, the rest keep their width on the right. It
4840
+ measures the field itself, so it needs no particular wrapper. A width that
4841
+ should only apply once horizontal goes behind `@md/field:`.</div>
4842
+ <pre><code>const Responsive = () =&gt; (
4843
+ &lt;div className=&quot;flex flex-col gap-8&quot;&gt;
4844
+ &lt;div className=&quot;w-full max-w-[40rem]&quot; data-testid=&quot;wide&quot;&gt;
4845
+ &lt;Field.Root orientation=&quot;responsive&quot;&gt;
4846
+ &lt;Label&gt;Email&lt;/Label&gt;
4847
+ &lt;Field.Content className=&quot;@md/field:w-72&quot;&gt;
4848
+ &lt;DemoInput type=&quot;email&quot; placeholder=&quot;you@example.com&quot; /&gt;
4849
+ &lt;Field.Description&gt;
4850
+ We only use this to send policy documents, and never to contact you about anything
4851
+ else.
4852
+ &lt;/Field.Description&gt;
4853
+ &lt;/Field.Content&gt;
4854
+ &lt;/Field.Root&gt;
4855
+ &lt;/div&gt;
4856
+
4857
+ &lt;div className=&quot;w-full max-w-[20rem]&quot; data-testid=&quot;narrow&quot;&gt;
4858
+ &lt;Field.Root orientation=&quot;responsive&quot;&gt;
4859
+ &lt;Label&gt;Email&lt;/Label&gt;
4860
+ &lt;Field.Content&gt;
4861
+ &lt;DemoInput type=&quot;email&quot; placeholder=&quot;you@example.com&quot; /&gt;
4862
+ &lt;Field.Description&gt;We only use this to send policy documents.&lt;/Field.Description&gt;
4863
+ &lt;/Field.Content&gt;
4864
+ &lt;/Field.Root&gt;
4865
+ &lt;/div&gt;
4866
+ &lt;/div&gt;
4867
+ );</code></pre>
4868
+ </div>
4869
+ <div class="note ok">
4870
+ <div class="row">
4871
+ <span class="ex-name">Group</span>
4872
+ <span class="badge ok">story ok</span>
4873
+ </div>
4874
+ <div>Several fields stacked in a group</div>
4875
+ <div class="hint">`Field.Group` stacks fields and owns the space between them. Each field gets
4876
+ its own ids, so several on one page never collide.</div>
4877
+ <pre><code>const Group = () =&gt; (
4878
+ &lt;Field.Group&gt;
4879
+ &lt;Field.Root required&gt;
4880
+ &lt;Label&gt;Full name&lt;/Label&gt;
4881
+ &lt;DemoInput placeholder=&quot;Jane Doe&quot; /&gt;
4882
+ &lt;/Field.Root&gt;
4883
+
4884
+ &lt;Field.Root required invalid&gt;
4885
+ &lt;Label&gt;Email&lt;/Label&gt;
4886
+ &lt;DemoInput type=&quot;email&quot; defaultValue=&quot;not-an-email&quot; /&gt;
4887
+ &lt;Field.Error&gt;Enter a valid email address.&lt;/Field.Error&gt;
4888
+ &lt;/Field.Root&gt;
4889
+
4890
+ &lt;Field.Root&gt;
4891
+ &lt;Label optional&gt;Phone number&lt;/Label&gt;
4892
+ &lt;DemoInput type=&quot;tel&quot; placeholder=&quot;+1 (555) 000-0000&quot; /&gt;
4893
+ &lt;/Field.Root&gt;
4894
+ &lt;/Field.Group&gt;
4895
+ );</code></pre>
4896
+ </div>
4897
+ <div class="note ok">
4898
+ <div class="row">
4899
+ <span class="ex-name">Standalone Outside Field</span>
4900
+ <span class="badge ok">story ok</span>
4901
+ </div>
4902
+ <div>Label and Field.Error used without a Field.Root</div>
4903
+ <div class="hint">Outside a `Field.Root` every part reads a `null` context and works on its own
4904
+ props alone: `Label` needs its `htmlFor`, `Field.Error` its own `id`.</div>
4905
+ <pre><code>const StandaloneOutsideField = () =&gt; (
4906
+ &lt;div className=&quot;flex flex-col gap-2&quot;&gt;
4907
+ &lt;Label htmlFor=&quot;standalone-email&quot;&gt;Email&lt;/Label&gt;
4908
+ &lt;DemoInput id=&quot;standalone-email&quot; type=&quot;email&quot; aria-describedby=&quot;standalone-error&quot; /&gt;
4909
+ &lt;Field.Error id=&quot;standalone-error&quot;&gt;Something went wrong.&lt;/Field.Error&gt;
4910
+ &lt;/div&gt;
4911
+ );</code></pre>
4912
+ </div>
4913
+ <div class="note ok">
4914
+ <div class="row">
4915
+ <span class="ex-name">Own Props Win</span>
4916
+ <span class="badge ok">story ok</span>
4917
+ </div>
4918
+ <div>Explicit props on a part win over the field&#39;s context</div>
4919
+ <div class="hint">A context is a default, never an override: an explicit `htmlFor` or `id` on a
4920
+ part wins over what `Field.Root` provides.</div>
4921
+ <pre><code>const OwnPropsWin = () =&gt; (
4922
+ &lt;Field.Root&gt;
4923
+ &lt;Label htmlFor=&quot;own-input&quot;&gt;Email&lt;/Label&gt;
4924
+ &lt;input id=&quot;own-input&quot; type=&quot;email&quot; className={inputRecipe()} /&gt;
4925
+ &lt;Field.Description id=&quot;own-description&quot;&gt;Points wherever you say.&lt;/Field.Description&gt;
4926
+ &lt;/Field.Root&gt;
4927
+ );</code></pre>
4928
+ </div>
4929
+ <div class="note ok">
4930
+ <div class="row">
4931
+ <span class="ex-name">Errors From Context</span>
4932
+ <span class="badge ok">story ok</span>
4933
+ </div>
4934
+ <div>Errors supplied to a bare Field.Error through context</div>
4935
+ <div class="hint">`FieldContext` is an extension point: re-provided under the root with the
4936
+ errors, a bare `&lt;Field.Error /&gt;` renders them — here with `useState` and no
4937
+ form library. `InputContext` extends the same way with `value`, `onChange`,
4938
+ `onBlur` and `name`; see `FieldText`.</div>
4939
+ <pre><code>const ErrorsFromContext = () =&gt; &lt;FieldWithSuppliedErrors /&gt;;</code></pre>
4940
+ </div>
4941
+ </div>
4942
+
4943
+
4944
+ </div>
4945
+ </article>
4946
+ <article
4947
+ class="card
4948
+ no-error
4949
+ no-info
4950
+ no-story-error
4951
+ no-doc-error"
4952
+ role="listitem"
4953
+ aria-label="FieldText">
4954
+ <div class="head">
4955
+ <div class="title">
4956
+ <h2><span class="status-dot dot-ok"></span> FieldText</h2>
4957
+ <div class="badges">
4958
+ <label for="c-12-components-fieldtext-props" class="badge ok as-toggle">6 prop types</label>
4959
+
4960
+ <label for="c-12-components-fieldtext-stories" class="badge ok as-toggle">7 stories</label>
4961
+
4962
+
4963
+ </div>
4964
+ </div>
4965
+ <div class="meta" title="./src/field-text/field-text.stories.tsx">components-fieldtext · ./src/field-text/field-text.stories.tsx</div>
4966
+ <div>Field for a single-line text control, wiring the Input inside it</div>
4967
+ <div class="hint">FieldText is a `Field.Root` for a single-line text control. It provides
4968
+ `InputContext`, so the `Input` inside associates itself with the label and
4969
+ the messages and takes `invalid`, `required`, `disabled` and `readOnly` from
4970
+ the field — no `id`, `htmlFor`, `aria-describedby` or `aria-invalid` written
4971
+ by hand.
4972
+
4973
+ It knows nothing about form libraries, and its contexts compose: a provider
4974
+ nested inside it can extend `InputContext` with `value`, `onChange`, `onBlur`
4975
+ and `name`, and `FieldContext` with the errors, as the last story shows.</div>
4976
+ <div class="kv"><span class="chip">summary: Field for a single-line text control, wiring the Input inside it</span><span class="chip">example: &lt;FieldText invalid={!!error} required&gt;
4977
+ &lt;Label&gt;Email&lt;/Label&gt;
4978
+ &lt;Input type=&quot;email&quot; /&gt;
4979
+ &lt;Field.Description&gt;We only use this for policy documents.&lt;/Field.Description&gt;
4980
+ &lt;Field.Error errors={[error]} /&gt;
4981
+ &lt;/FieldText&gt;</span></div>
4982
+ </div>
4983
+
4984
+ <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
4985
+
4986
+
4987
+ <input id="c-12-components-fieldtext-stories" class="tg tg-stories" type="checkbox" hidden />
4988
+
4989
+
4990
+ <input id="c-12-components-fieldtext-props" class="tg tg-props" type="checkbox" hidden />
4991
+
4992
+ <div class="panels">
4993
+
4994
+
4995
+
4996
+ <div class="panel panel-props">
4997
+ <div class="note ok">
4998
+ <div class="row">
4999
+ <span class="ex-name">Prop types <small>(react-component-meta)</small></span>
5000
+ <span class="badge ok">6 prop types</span>
5001
+ </div>
5002
+ <pre><code>Component: src/field-text/index.ts::FieldText</code></pre>
5003
+ <pre><code>Props:</code></pre>
5004
+ <pre><code>/**
5005
+ * `id` for the control. Generated when omitted. Set it here, not on the
5006
+ * control, so the label and the messages keep pointing at the right element.
5007
+ */
5008
+ controlId?: string
5009
+
5010
+ /**
5011
+ * Disables the control through its context and sets `data-disabled` on the root.
5012
+ */
5013
+ disabled?: boolean
5014
+
5015
+ /**
5016
+ * Marks the field as failing validation: sets `data-invalid` on the root and
5017
+ * `aria-invalid` on the control through its context, which drives the
5018
+ * control&#39;s destructive border. The label keeps its color by design.
5019
+ */
5020
+ invalid?: boolean
5021
+
5022
+ /**
5023
+ * Layout of the field. `vertical` (default) stacks label, control and
5024
+ * messages. `horizontal` is one row at every width: the first child fills it
5025
+ * and the rest keep their natural width, aligned to the right, so the
5026
+ * controls of stacked fields line up. `responsive` stacks below `28rem` and
5027
+ * behaves like `horizontal` from there, measured on the field itself, so it
5028
+ * needs no particular wrapper. In both, `Field.Content` groups a control with
5029
+ * its messages, or a label with its description.
5030
+ */
5031
+ orientation?: &quot;horizontal&quot; | &quot;vertical&quot; | &quot;responsive&quot;
5032
+
5033
+ /**
5034
+ * Makes the control read-only through its context (focusable and copyable,
5035
+ * not editable, still submitted) and sets `data-readonly` on the root.
5036
+ */
5037
+ readOnly?: boolean
5038
+
5039
+ /**
5040
+ * Single source of truth for a required field: the `Label` shows its
5041
+ * asterisk and the control receives `required`, both through context.
5042
+ */
5043
+ required?: boolean</code></pre>
5044
+ </div>
5045
+ </div>
5046
+
5047
+ <div class="panel panel-stories">
5048
+
5049
+
5050
+
5051
+ <div class="note ok">
5052
+ <div class="row">
5053
+ <span class="ex-name">Imports</span>
5054
+ </div>
5055
+ <pre><code>import { Field, FieldContext, FieldText, Input, InputContext, Label } from "@agentero/design-system";</code></pre>
5056
+ </div>
5057
+
5058
+
5059
+ <div class="note ok">
5060
+ <div class="row">
5061
+ <span class="ex-name">Default</span>
5062
+ <span class="badge ok">story ok</span>
5063
+ </div>
5064
+ <div>Label, Input and description wired with no ids</div>
5065
+ <div class="hint">The composition consumers write: a label, the design system&#39;s `Input` and
5066
+ helper text. The label points at the input and the input is described by the
5067
+ text, all through context.</div>
5068
+ <pre><code>const Default = () =&gt; &lt;FieldText
5069
+ orientation=&quot;vertical&quot;
5070
+ invalid={false}
5071
+ disabled={false}
5072
+ readOnly={false}
5073
+ required={false}&gt;
5074
+ &lt;Label&gt;Email&lt;/Label&gt;
5075
+ &lt;Input type=&quot;email&quot; placeholder=&quot;you@example.com&quot; /&gt;
5076
+ &lt;Field.Description&gt;We only use this to send policy documents.&lt;/Field.Description&gt;
5077
+ &lt;/FieldText&gt;;</code></pre>
5078
+ </div>
5079
+ <div class="note ok">
5080
+ <div class="row">
5081
+ <span class="ex-name">Required</span>
5082
+ <span class="badge ok">story ok</span>
5083
+ </div>
5084
+ <div>Required field driven from the root alone</div>
5085
+ <div class="hint">`required` on the field reaches both the label&#39;s asterisk and the input&#39;s
5086
+ `required` attribute.</div>
5087
+ <pre><code>const Required = () =&gt; &lt;FieldText
5088
+ orientation=&quot;vertical&quot;
5089
+ invalid={false}
5090
+ disabled={false}
5091
+ readOnly={false}
5092
+ required&gt;
5093
+ &lt;Label&gt;Full name&lt;/Label&gt;
5094
+ &lt;Input placeholder=&quot;Jane Doe&quot; /&gt;
5095
+ &lt;/FieldText&gt;;</code></pre>
5096
+ </div>
5097
+ <div class="note ok">
5098
+ <div class="row">
5099
+ <span class="ex-name">Invalid</span>
5100
+ <span class="badge ok">story ok</span>
5101
+ </div>
5102
+ <div>Invalid field with the Input styled by aria-invalid</div>
5103
+ <div class="hint">`invalid` on the field sets `aria-invalid` on the input, which drives its
5104
+ destructive border, and the error is announced with the input.</div>
5105
+ <pre><code>const Invalid = () =&gt; &lt;FieldText
5106
+ orientation=&quot;vertical&quot;
5107
+ invalid
5108
+ disabled={false}
5109
+ readOnly={false}
5110
+ required={false}&gt;
5111
+ &lt;Label&gt;Email&lt;/Label&gt;
5112
+ &lt;Input type=&quot;email&quot; defaultValue=&quot;not-an-email&quot; /&gt;
5113
+ &lt;Field.Error errors={[{ message: &#39;Enter a valid email address.&#39; }]} /&gt;
5114
+ &lt;/FieldText&gt;;</code></pre>
5115
+ </div>
5116
+ <div class="note ok">
5117
+ <div class="row">
5118
+ <span class="ex-name">Disabled</span>
5119
+ <span class="badge ok">story ok</span>
5120
+ </div>
5121
+ <div>Disabled field driven from the root</div>
5122
+ <div class="hint">`disabled` on the field disables the input through context.</div>
5123
+ <pre><code>const Disabled = () =&gt; &lt;FieldText
5124
+ orientation=&quot;vertical&quot;
5125
+ invalid={false}
5126
+ disabled
5127
+ readOnly={false}
5128
+ required={false}&gt;
5129
+ &lt;Label&gt;Agency&lt;/Label&gt;
5130
+ &lt;Input defaultValue=&quot;Acme Insurance&quot; /&gt;
5131
+ &lt;/FieldText&gt;;</code></pre>
5132
+ </div>
5133
+ <div class="note ok">
5134
+ <div class="row">
5135
+ <span class="ex-name">Read Only</span>
5136
+ <span class="badge ok">story ok</span>
5137
+ </div>
5138
+ <div>Read-only field driven from the root</div>
5139
+ <div class="hint">`readOnly` on the field reaches the input through context. The value stays
5140
+ focusable, copyable and submitted, and the input looks like any other.</div>
5141
+ <pre><code>const ReadOnly = () =&gt; &lt;FieldText
5142
+ orientation=&quot;vertical&quot;
5143
+ invalid={false}
5144
+ disabled={false}
5145
+ readOnly
5146
+ required={false}&gt;
5147
+ &lt;Label&gt;Policy number&lt;/Label&gt;
5148
+ &lt;Input defaultValue=&quot;POL-2049-118&quot; /&gt;
5149
+ &lt;Field.Description&gt;Assigned by the carrier; contact support to change it.&lt;/Field.Description&gt;
5150
+ &lt;/FieldText&gt;;</code></pre>
5151
+ </div>
5152
+ <div class="note ok">
5153
+ <div class="row">
5154
+ <span class="ex-name">Own Props Win</span>
5155
+ <span class="badge ok">story ok</span>
5156
+ </div>
5157
+ <div>Input&#39;s own props merge with, and win over, the field&#39;s context</div>
5158
+ <div class="hint">The context is a default, never an override: an extra `aria-describedby` is
5159
+ concatenated with the field&#39;s ids, `className` is merged and `size` passes
5160
+ through untouched.</div>
5161
+ <pre><code>const OwnPropsWin = () =&gt; &lt;div className=&quot;flex flex-col gap-2&quot;&gt;
5162
+ &lt;FieldText
5163
+ orientation=&quot;vertical&quot;
5164
+ invalid={false}
5165
+ disabled={false}
5166
+ readOnly={false}
5167
+ required={false}&gt;
5168
+ &lt;Label&gt;Website&lt;/Label&gt;
5169
+ &lt;Input type=&quot;url&quot; size=&quot;lg&quot; className=&quot;max-w-xs&quot; aria-describedby=&quot;website-hint&quot; /&gt;
5170
+ &lt;Field.Description&gt;Include the protocol.&lt;/Field.Description&gt;
5171
+ &lt;/FieldText&gt;
5172
+ &lt;p id=&quot;website-hint&quot; className=&quot;text-sm&quot;&gt;Shown on your public profile.
5173
+ &lt;/p&gt;
5174
+ &lt;/div&gt;;</code></pre>
5175
+ </div>
5176
+ <div class="note ok">
5177
+ <div class="row">
5178
+ <span class="ex-name">Controlled From Context</span>
5179
+ <span class="badge ok">story ok</span>
5180
+ </div>
5181
+ <div>Input controlled and errors supplied from outside the field</div>
5182
+ <div class="hint">The contexts are an extension point: a provider nested in the field adds
5183
+ `name`, `value`, `onChange` and `onBlur` to `InputContext`, so a bare
5184
+ `&lt;Input /&gt;` becomes controlled, and the errors to `FieldContext`, so a bare
5185
+ `&lt;Field.Error /&gt;` renders them — here with `useState` and no form library.
5186
+ The input&#39;s own `onChange` still runs, chained after the provider&#39;s.</div>
5187
+ <pre><code>const ControlledFromContext = () =&gt; &lt;ControlledField /&gt;;</code></pre>
5188
+ </div>
5189
+ </div>
5190
+
5191
+
4490
5192
  </div>
4491
5193
  </article>
4492
5194
  <article
@@ -4501,9 +5203,9 @@ actions outright unless the user needs to see them and understand why.</div>
4501
5203
  <div class="title">
4502
5204
  <h2><span class="status-dot dot-ok"></span> HoverCard.Root</h2>
4503
5205
  <div class="badges">
4504
- <label for="c-11-components-hovercard-props" class="badge ok as-toggle">6 prop types</label>
5206
+ <label for="c-13-components-hovercard-props" class="badge ok as-toggle">6 prop types</label>
4505
5207
 
4506
- <label for="c-11-components-hovercard-stories" class="badge ok as-toggle">7 stories</label>
5208
+ <label for="c-13-components-hovercard-stories" class="badge ok as-toggle">7 stories</label>
4507
5209
 
4508
5210
 
4509
5211
  </div>
@@ -4535,10 +5237,10 @@ import { HoverCard } from &#39;@agentero/design-system/hover-card&#39;;
4535
5237
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
4536
5238
 
4537
5239
 
4538
- <input id="c-11-components-hovercard-stories" class="tg tg-stories" type="checkbox" hidden />
5240
+ <input id="c-13-components-hovercard-stories" class="tg tg-stories" type="checkbox" hidden />
4539
5241
 
4540
5242
 
4541
- <input id="c-11-components-hovercard-props" class="tg tg-props" type="checkbox" hidden />
5243
+ <input id="c-13-components-hovercard-props" class="tg tg-props" type="checkbox" hidden />
4542
5244
 
4543
5245
  <div class="panels">
4544
5246
 
@@ -4785,23 +5487,24 @@ trigger-dense UIs where an instant preview reads as more responsive.</div>
4785
5487
  <div class="title">
4786
5488
  <h2><span class="status-dot dot-ok"></span> Input</h2>
4787
5489
  <div class="badges">
4788
- <label for="c-12-components-input-props" class="badge ok as-toggle">7 prop types</label>
5490
+ <label for="c-14-components-input-props" class="badge ok as-toggle">7 prop types</label>
4789
5491
 
4790
- <label for="c-12-components-input-stories" class="badge ok as-toggle">9 stories</label>
5492
+ <label for="c-14-components-input-stories" class="badge ok as-toggle">9 stories</label>
4791
5493
 
4792
5494
 
4793
5495
  </div>
4794
5496
  </div>
4795
5497
  <div class="meta" title="./src/input/input.stories.tsx">components-input · ./src/input/input.stories.tsx</div>
4796
- <div>Base single-line text control, unaware of fields and form libraries</div>
4797
- <div class="hint">Input is the base single-line text control. It is intentionally unaware of
4798
- form fields and form libraries: `id`, `aria-invalid` and `aria-describedby`
4799
- are plain props, set by a field wrapper or by hand.
5498
+ <div>Base single-line text control that takes its wiring from InputContext</div>
5499
+ <div class="hint">Input is the base single-line text control. When a container such as
5500
+ `FieldText` provides `InputContext`, it picks up `id`, `aria-invalid` and
5501
+ `aria-describedby` on its own; standalone, as here, they are plain props set
5502
+ by hand.
4800
5503
 
4801
5504
  There is no `status` prop. Mark the control `aria-invalid` and the
4802
5505
  destructive border follows, so the styling can never disagree with what
4803
5506
  assistive technology announces.</div>
4804
- <div class="kv"><span class="chip">summary: Base single-line text control, unaware of fields and form libraries</span><span class="chip">example: &lt;Label htmlFor=&quot;email&quot;&gt;Email&lt;/Label&gt;
5507
+ <div class="kv"><span class="chip">summary: Base single-line text control that takes its wiring from InputContext</span><span class="chip">example: &lt;Label htmlFor=&quot;email&quot;&gt;Email&lt;/Label&gt;
4805
5508
  &lt;Input id=&quot;email&quot; type=&quot;email&quot; placeholder=&quot;you@example.com&quot; /&gt;</span><span class="chip">example: &lt;Input id=&quot;email&quot; aria-invalid aria-describedby=&quot;email-error&quot; /&gt;
4806
5509
  &lt;span id=&quot;email-error&quot;&gt;Enter a valid email address.&lt;/span&gt;</span></div>
4807
5510
  </div>
@@ -4809,10 +5512,10 @@ assistive technology announces.</div>
4809
5512
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
4810
5513
 
4811
5514
 
4812
- <input id="c-12-components-input-stories" class="tg tg-stories" type="checkbox" hidden />
5515
+ <input id="c-14-components-input-stories" class="tg tg-stories" type="checkbox" hidden />
4813
5516
 
4814
5517
 
4815
- <input id="c-12-components-input-props" class="tg tg-props" type="checkbox" hidden />
5518
+ <input id="c-14-components-input-props" class="tg tg-props" type="checkbox" hidden />
4816
5519
 
4817
5520
  <div class="panels">
4818
5521
 
@@ -5024,9 +5727,9 @@ they cannot change.</div>
5024
5727
  <div class="title">
5025
5728
  <h2><span class="status-dot dot-ok"></span> Label</h2>
5026
5729
  <div class="badges">
5027
- <label for="c-13-components-label-props" class="badge ok as-toggle">3 prop types</label>
5730
+ <label for="c-15-components-label-props" class="badge ok as-toggle">3 prop types</label>
5028
5731
 
5029
- <label for="c-13-components-label-stories" class="badge ok as-toggle">4 stories</label>
5732
+ <label for="c-15-components-label-stories" class="badge ok as-toggle">5 stories</label>
5030
5733
 
5031
5734
 
5032
5735
  </div>
@@ -5046,10 +5749,10 @@ still has to carry `required` / `aria-required`.</div>
5046
5749
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5047
5750
 
5048
5751
 
5049
- <input id="c-13-components-label-stories" class="tg tg-stories" type="checkbox" hidden />
5752
+ <input id="c-15-components-label-stories" class="tg tg-stories" type="checkbox" hidden />
5050
5753
 
5051
5754
 
5052
- <input id="c-13-components-label-props" class="tg tg-props" type="checkbox" hidden />
5755
+ <input id="c-15-components-label-props" class="tg tg-props" type="checkbox" hidden />
5053
5756
 
5054
5757
  <div class="panels">
5055
5758
 
@@ -5085,7 +5788,7 @@ required?: boolean = false</code></pre>
5085
5788
  <div class="row">
5086
5789
  <span class="ex-name">Imports</span>
5087
5790
  </div>
5088
- <pre><code>import { Label } from "@agentero/design-system";</code></pre>
5791
+ <pre><code>import { Field, Label } from "@agentero/design-system";</code></pre>
5089
5792
  </div>
5090
5793
 
5091
5794
 
@@ -5098,7 +5801,7 @@ required?: boolean = false</code></pre>
5098
5801
  <div class="hint">A plain caption, associated with its control through `htmlFor`.</div>
5099
5802
  <pre><code>const Default = () =&gt; &lt;&gt;
5100
5803
  &lt;Label htmlFor=&quot;email&quot;&gt;Email&lt;/Label&gt;
5101
- &lt;input id=&quot;email&quot; placeholder=&quot;you@example.com&quot; /&gt;
5804
+ &lt;input id=&quot;email&quot; placeholder=&quot;you@example.com&quot; className={inputRecipe()} /&gt;
5102
5805
  &lt;/&gt;;</code></pre>
5103
5806
  </div>
5104
5807
  <div class="note ok">
@@ -5130,6 +5833,28 @@ required?: boolean = false</code></pre>
5130
5833
  dropped, so a mistake never takes the page down.</div>
5131
5834
  <pre><code>const RequiredWinsOverOptional = () =&gt; &lt;Label optional required&gt;Agency name&lt;/Label&gt;;</code></pre>
5132
5835
  </div>
5836
+ <div class="note ok">
5837
+ <div class="row">
5838
+ <span class="ex-name">Inside Field</span>
5839
+ <span class="badge ok">story ok</span>
5840
+ </div>
5841
+ <div>Inside a Field the label associates itself; explicit htmlFor wins</div>
5842
+ <div class="hint">Inside a `Field.Root` the label reads `LabelContext` and points at the
5843
+ field&#39;s control with no `htmlFor`. An explicit `htmlFor` still wins.</div>
5844
+ <pre><code>const InsideField = () =&gt; (
5845
+ &lt;div className=&quot;flex flex-col gap-6&quot;&gt;
5846
+ &lt;Field.Root&gt;
5847
+ &lt;Label&gt;Email&lt;/Label&gt;
5848
+ &lt;FieldInput /&gt;
5849
+ &lt;/Field.Root&gt;
5850
+
5851
+ &lt;Field.Root&gt;
5852
+ &lt;Label htmlFor=&quot;explicit-control&quot;&gt;Phone&lt;/Label&gt;
5853
+ &lt;input id=&quot;explicit-control&quot; className={inputRecipe()} /&gt;
5854
+ &lt;/Field.Root&gt;
5855
+ &lt;/div&gt;
5856
+ );</code></pre>
5857
+ </div>
5133
5858
  </div>
5134
5859
 
5135
5860
 
@@ -5147,9 +5872,9 @@ dropped, so a mistake never takes the page down.</div>
5147
5872
  <div class="title">
5148
5873
  <h2><span class="status-dot dot-ok"></span> Loading</h2>
5149
5874
  <div class="badges">
5150
- <label for="c-14-components-loading-props" class="badge ok as-toggle">1 prop type</label>
5875
+ <label for="c-16-components-loading-props" class="badge ok as-toggle">1 prop type</label>
5151
5876
 
5152
- <label for="c-14-components-loading-stories" class="badge ok as-toggle">7 stories</label>
5877
+ <label for="c-16-components-loading-stories" class="badge ok as-toggle">7 stories</label>
5153
5878
 
5154
5879
 
5155
5880
  </div>
@@ -5166,10 +5891,10 @@ parent font size via `em`-based size variants (`sm`, `md`, `lg`).</div>
5166
5891
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5167
5892
 
5168
5893
 
5169
- <input id="c-14-components-loading-stories" class="tg tg-stories" type="checkbox" hidden />
5894
+ <input id="c-16-components-loading-stories" class="tg tg-stories" type="checkbox" hidden />
5170
5895
 
5171
5896
 
5172
- <input id="c-14-components-loading-props" class="tg tg-props" type="checkbox" hidden />
5897
+ <input id="c-16-components-loading-props" class="tg tg-props" type="checkbox" hidden />
5173
5898
 
5174
5899
  <div class="panels">
5175
5900
 
@@ -5320,9 +6045,9 @@ against the dark background.</div>
5320
6045
  <div class="title">
5321
6046
  <h2><span class="status-dot dot-ok"></span> Modal.Root</h2>
5322
6047
  <div class="badges">
5323
- <label for="c-15-components-modal-props" class="badge ok as-toggle">5 prop types</label>
6048
+ <label for="c-17-components-modal-props" class="badge ok as-toggle">5 prop types</label>
5324
6049
 
5325
- <label for="c-15-components-modal-stories" class="badge ok as-toggle">6 stories</label>
6050
+ <label for="c-17-components-modal-stories" class="badge ok as-toggle">6 stories</label>
5326
6051
 
5327
6052
 
5328
6053
  </div>
@@ -5368,10 +6093,10 @@ import { Modal } from &#39;@agentero/design-system/modal&#39;;
5368
6093
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5369
6094
 
5370
6095
 
5371
- <input id="c-15-components-modal-stories" class="tg tg-stories" type="checkbox" hidden />
6096
+ <input id="c-17-components-modal-stories" class="tg tg-stories" type="checkbox" hidden />
5372
6097
 
5373
6098
 
5374
- <input id="c-15-components-modal-props" class="tg tg-props" type="checkbox" hidden />
6099
+ <input id="c-17-components-modal-props" class="tg tg-props" type="checkbox" hidden />
5375
6100
 
5376
6101
  <div class="panels">
5377
6102
 
@@ -5568,9 +6293,9 @@ announced as an `alertdialog`. Only the footer actions close it.</div>
5568
6293
  <div class="title">
5569
6294
  <h2><span class="status-dot dot-ok"></span> Pagination</h2>
5570
6295
  <div class="badges">
5571
- <label for="c-16-components-pagination-props" class="badge ok as-toggle">5 prop types</label>
6296
+ <label for="c-18-components-pagination-props" class="badge ok as-toggle">5 prop types</label>
5572
6297
 
5573
- <label for="c-16-components-pagination-stories" class="badge ok as-toggle">7 stories</label>
6298
+ <label for="c-18-components-pagination-stories" class="badge ok as-toggle">7 stories</label>
5574
6299
 
5575
6300
 
5576
6301
  </div>
@@ -5600,10 +6325,10 @@ const [page, setPage] = useState(1);
5600
6325
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5601
6326
 
5602
6327
 
5603
- <input id="c-16-components-pagination-stories" class="tg tg-stories" type="checkbox" hidden />
6328
+ <input id="c-18-components-pagination-stories" class="tg tg-stories" type="checkbox" hidden />
5604
6329
 
5605
6330
 
5606
- <input id="c-16-components-pagination-props" class="tg tg-props" type="checkbox" hidden />
6331
+ <input id="c-18-components-pagination-props" class="tg tg-props" type="checkbox" hidden />
5607
6332
 
5608
6333
  <div class="panels">
5609
6334
 
@@ -5758,9 +6483,9 @@ entries summary follow along.</div>
5758
6483
  <div class="title">
5759
6484
  <h2><span class="status-dot dot-ok"></span> Popover.Root</h2>
5760
6485
  <div class="badges">
5761
- <label for="c-17-components-popover-props" class="badge ok as-toggle">5 prop types</label>
6486
+ <label for="c-19-components-popover-props" class="badge ok as-toggle">5 prop types</label>
5762
6487
 
5763
- <label for="c-17-components-popover-stories" class="badge ok as-toggle">4 stories</label>
6488
+ <label for="c-19-components-popover-stories" class="badge ok as-toggle">5 stories</label>
5764
6489
 
5765
6490
 
5766
6491
  </div>
@@ -5789,10 +6514,10 @@ import { Popover } from &#39;@agentero/design-system/popover&#39;;
5789
6514
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5790
6515
 
5791
6516
 
5792
- <input id="c-17-components-popover-stories" class="tg tg-stories" type="checkbox" hidden />
6517
+ <input id="c-19-components-popover-stories" class="tg tg-stories" type="checkbox" hidden />
5793
6518
 
5794
6519
 
5795
- <input id="c-17-components-popover-props" class="tg tg-props" type="checkbox" hidden />
6520
+ <input id="c-19-components-popover-props" class="tg tg-props" type="checkbox" hidden />
5796
6521
 
5797
6522
  <div class="panels">
5798
6523
 
@@ -5826,7 +6551,7 @@ open?: boolean</code></pre>
5826
6551
  <div class="row">
5827
6552
  <span class="ex-name">Imports</span>
5828
6553
  </div>
5829
- <pre><code>import { Button, Popover } from "@agentero/design-system";</code></pre>
6554
+ <pre><code>import { Button, Modal, Popover } from "@agentero/design-system";</code></pre>
5830
6555
  </div>
5831
6556
 
5832
6557
 
@@ -5928,6 +6653,50 @@ useful when the visual anchor differs from the toggle button.</div>
5928
6653
  &lt;p className=&quot;text-sm text-text-default-base-primary&quot;&gt;Positioned against the anchor&lt;/p&gt;
5929
6654
  &lt;/Popover.Content&gt;
5930
6655
  &lt;/Popover.Root&gt;
6656
+ );</code></pre>
6657
+ </div>
6658
+ <div class="note ok">
6659
+ <div class="row">
6660
+ <span class="ex-name">Modal From Inside Popover</span>
6661
+ <span class="badge ok">story ok</span>
6662
+ </div>
6663
+ <div>Modal opened from inside a Popover paints above it</div>
6664
+ <div class="hint">A Modal opened from a button inside the Popover. Both share
6665
+ `--z-index-top-layer`, so the modal opens last and paints over the popover
6666
+ while the overlay dims it. The popover stays mounted underneath, which keeps
6667
+ focus returning to its trigger once the modal closes.</div>
6668
+ <pre><code>const ModalFromInsidePopover = () =&gt; (
6669
+ &lt;Popover.Root&gt;
6670
+ &lt;Popover.Trigger asChild&gt;
6671
+ &lt;Button variant=&quot;secondary&quot;&gt;Renewal 2026&lt;/Button&gt;
6672
+ &lt;/Popover.Trigger&gt;
6673
+ &lt;Popover.Content align=&quot;start&quot;&gt;
6674
+ &lt;div className=&quot;flex flex-col gap-3&quot;&gt;
6675
+ &lt;p className=&quot;text-sm text-text-default-base-primary&quot;&gt;
6676
+ Applied to 12 contracts across 3 carriers.
6677
+ &lt;/p&gt;
6678
+ &lt;Modal.Root&gt;
6679
+ &lt;Modal.Trigger asChild&gt;
6680
+ &lt;Button variant=&quot;secondary&quot; size=&quot;sm&quot;&gt;
6681
+ Delete tag
6682
+ &lt;/Button&gt;
6683
+ &lt;/Modal.Trigger&gt;
6684
+ &lt;Modal.Content&gt;
6685
+ &lt;Modal.Title&gt;Delete this tag?&lt;/Modal.Title&gt;
6686
+ &lt;Modal.Description&gt;
6687
+ It will be removed from the 12 contracts that carry it.
6688
+ &lt;/Modal.Description&gt;
6689
+ &lt;Modal.Footer&gt;
6690
+ &lt;Modal.Close asChild&gt;
6691
+ &lt;Button variant=&quot;ghost&quot;&gt;Cancel&lt;/Button&gt;
6692
+ &lt;/Modal.Close&gt;
6693
+ &lt;Button variant=&quot;primary&quot;&gt;Delete&lt;/Button&gt;
6694
+ &lt;/Modal.Footer&gt;
6695
+ &lt;/Modal.Content&gt;
6696
+ &lt;/Modal.Root&gt;
6697
+ &lt;/div&gt;
6698
+ &lt;/Popover.Content&gt;
6699
+ &lt;/Popover.Root&gt;
5931
6700
  );</code></pre>
5932
6701
  </div>
5933
6702
  </div>
@@ -5947,9 +6716,9 @@ useful when the visual anchor differs from the toggle button.</div>
5947
6716
  <div class="title">
5948
6717
  <h2><span class="status-dot dot-ok"></span> Progress</h2>
5949
6718
  <div class="badges">
5950
- <label for="c-18-components-progress-props" class="badge ok as-toggle">4 prop types</label>
6719
+ <label for="c-20-components-progress-props" class="badge ok as-toggle">4 prop types</label>
5951
6720
 
5952
- <label for="c-18-components-progress-stories" class="badge ok as-toggle">4 stories</label>
6721
+ <label for="c-20-components-progress-stories" class="badge ok as-toggle">4 stories</label>
5953
6722
 
5954
6723
 
5955
6724
  </div>
@@ -5968,10 +6737,10 @@ with `currentColor`, so recolor it with a plain text class — e.g.
5968
6737
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
5969
6738
 
5970
6739
 
5971
- <input id="c-18-components-progress-stories" class="tg tg-stories" type="checkbox" hidden />
6740
+ <input id="c-20-components-progress-stories" class="tg tg-stories" type="checkbox" hidden />
5972
6741
 
5973
6742
 
5974
- <input id="c-18-components-progress-props" class="tg tg-props" type="checkbox" hidden />
6743
+ <input id="c-20-components-progress-props" class="tg tg-props" type="checkbox" hidden />
5975
6744
 
5976
6745
  <div class="panels">
5977
6746
 
@@ -6090,7 +6859,7 @@ percentage: number</code></pre>
6090
6859
  <div class="badges">
6091
6860
 
6092
6861
 
6093
- <label for="c-19-components-skeleton-stories" class="badge ok as-toggle">4 stories</label>
6862
+ <label for="c-21-components-skeleton-stories" class="badge ok as-toggle">4 stories</label>
6094
6863
 
6095
6864
 
6096
6865
  </div>
@@ -6107,7 +6876,7 @@ shape it with Tailwind classes to mirror the content it stands in for.</div>
6107
6876
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
6108
6877
 
6109
6878
 
6110
- <input id="c-19-components-skeleton-stories" class="tg tg-stories" type="checkbox" hidden />
6879
+ <input id="c-21-components-skeleton-stories" class="tg tg-stories" type="checkbox" hidden />
6111
6880
 
6112
6881
 
6113
6882
 
@@ -6203,9 +6972,9 @@ shape it with Tailwind classes to mirror the content it stands in for.</div>
6203
6972
  <div class="title">
6204
6973
  <h2><span class="status-dot dot-ok"></span> Switch</h2>
6205
6974
  <div class="badges">
6206
- <label for="c-20-components-switch-props" class="badge ok as-toggle">8 prop types</label>
6975
+ <label for="c-22-components-switch-props" class="badge ok as-toggle">8 prop types</label>
6207
6976
 
6208
- <label for="c-20-components-switch-stories" class="badge ok as-toggle">7 stories</label>
6977
+ <label for="c-22-components-switch-stories" class="badge ok as-toggle">7 stories</label>
6209
6978
 
6210
6979
 
6211
6980
  </div>
@@ -6221,10 +6990,10 @@ a Checkbox for a single boolean that applies instantly, and pair it with a
6221
6990
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
6222
6991
 
6223
6992
 
6224
- <input id="c-20-components-switch-stories" class="tg tg-stories" type="checkbox" hidden />
6993
+ <input id="c-22-components-switch-stories" class="tg tg-stories" type="checkbox" hidden />
6225
6994
 
6226
6995
 
6227
- <input id="c-20-components-switch-props" class="tg tg-props" type="checkbox" hidden />
6996
+ <input id="c-22-components-switch-props" class="tg tg-props" type="checkbox" hidden />
6228
6997
 
6229
6998
  <div class="panels">
6230
6999
 
@@ -6405,9 +7174,9 @@ size?: &quot;sm&quot; | &quot;md&quot;</code></pre>
6405
7174
  <div class="title">
6406
7175
  <h2><span class="status-dot dot-ok"></span> Table.Root</h2>
6407
7176
  <div class="badges">
6408
- <label for="c-21-components-table-props" class="badge ok as-toggle">6 prop types</label>
7177
+ <label for="c-23-components-table-props" class="badge ok as-toggle">6 prop types</label>
6409
7178
 
6410
- <label for="c-21-components-table-stories" class="badge ok as-toggle">9 stories</label>
7179
+ <label for="c-23-components-table-stories" class="badge ok as-toggle">9 stories</label>
6411
7180
 
6412
7181
 
6413
7182
  </div>
@@ -6438,10 +7207,10 @@ import { Table } from &#39;@agentero/design-system/table&#39;;
6438
7207
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
6439
7208
 
6440
7209
 
6441
- <input id="c-21-components-table-stories" class="tg tg-stories" type="checkbox" hidden />
7210
+ <input id="c-23-components-table-stories" class="tg tg-stories" type="checkbox" hidden />
6442
7211
 
6443
7212
 
6444
- <input id="c-21-components-table-props" class="tg tg-props" type="checkbox" hidden />
7213
+ <input id="c-23-components-table-props" class="tg tg-props" type="checkbox" hidden />
6445
7214
 
6446
7215
  <div class="panels">
6447
7216
 
@@ -6636,9 +7405,9 @@ import { Fragment } from "react";</code></pre>
6636
7405
  <div class="title">
6637
7406
  <h2><span class="status-dot dot-ok"></span> Tabs.Root</h2>
6638
7407
  <div class="badges">
6639
- <label for="c-22-components-tabs-props" class="badge ok as-toggle">9 prop types</label>
7408
+ <label for="c-24-components-tabs-props" class="badge ok as-toggle">9 prop types</label>
6640
7409
 
6641
- <label for="c-22-components-tabs-stories" class="badge ok as-toggle">8 stories</label>
7410
+ <label for="c-24-components-tabs-stories" class="badge ok as-toggle">8 stories</label>
6642
7411
 
6643
7412
 
6644
7413
  </div>
@@ -6669,10 +7438,10 @@ import { Tabs } from &#39;@agentero/design-system/tabs&#39;;
6669
7438
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
6670
7439
 
6671
7440
 
6672
- <input id="c-22-components-tabs-stories" class="tg tg-stories" type="checkbox" hidden />
7441
+ <input id="c-24-components-tabs-stories" class="tg tg-stories" type="checkbox" hidden />
6673
7442
 
6674
7443
 
6675
- <input id="c-22-components-tabs-props" class="tg tg-props" type="checkbox" hidden />
7444
+ <input id="c-24-components-tabs-props" class="tg tg-props" type="checkbox" hidden />
6676
7445
 
6677
7446
  <div class="panels">
6678
7447
 
@@ -6893,9 +7662,9 @@ tablist role is announced.</div>
6893
7662
  <div class="title">
6894
7663
  <h2><span class="status-dot dot-ok"></span> Tag</h2>
6895
7664
  <div class="badges">
6896
- <label for="c-23-components-tag-props" class="badge ok as-toggle">8 prop types</label>
7665
+ <label for="c-25-components-tag-props" class="badge ok as-toggle">8 prop types</label>
6897
7666
 
6898
- <label for="c-23-components-tag-stories" class="badge ok as-toggle">12 stories</label>
7667
+ <label for="c-25-components-tag-stories" class="badge ok as-toggle">12 stories</label>
6899
7668
 
6900
7669
 
6901
7670
  </div>
@@ -6914,10 +7683,10 @@ it an interactive link or button, which adds the pointer cursor and hover fill.<
6914
7683
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
6915
7684
 
6916
7685
 
6917
- <input id="c-23-components-tag-stories" class="tg tg-stories" type="checkbox" hidden />
7686
+ <input id="c-25-components-tag-stories" class="tg tg-stories" type="checkbox" hidden />
6918
7687
 
6919
7688
 
6920
- <input id="c-23-components-tag-props" class="tg tg-props" type="checkbox" hidden />
7689
+ <input id="c-25-components-tag-props" class="tg tg-props" type="checkbox" hidden />
6921
7690
 
6922
7691
  <div class="panels">
6923
7692
 
@@ -7342,9 +8111,9 @@ leading + trailing icons, and icon-only.</div>
7342
8111
  <div class="title">
7343
8112
  <h2><span class="status-dot dot-ok"></span> Toast</h2>
7344
8113
  <div class="badges">
7345
- <label for="c-24-components-toast-props" class="badge ok as-toggle">11 prop types</label>
8114
+ <label for="c-26-components-toast-props" class="badge ok as-toggle">11 prop types</label>
7346
8115
 
7347
- <label for="c-24-components-toast-stories" class="badge ok as-toggle">11 stories</label>
8116
+ <label for="c-26-components-toast-stories" class="badge ok as-toggle">11 stories</label>
7348
8117
 
7349
8118
 
7350
8119
  </div>
@@ -7363,10 +8132,10 @@ common feedback patterns.</div>
7363
8132
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
7364
8133
 
7365
8134
 
7366
- <input id="c-24-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
8135
+ <input id="c-26-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
7367
8136
 
7368
8137
 
7369
- <input id="c-24-components-toast-props" class="tg tg-props" type="checkbox" hidden />
8138
+ <input id="c-26-components-toast-props" class="tg tg-props" type="checkbox" hidden />
7370
8139
 
7371
8140
  <div class="panels">
7372
8141
 
@@ -7795,9 +8564,9 @@ action (e.g., a sync icon for a sync-in-progress toast).</div>
7795
8564
  <div class="title">
7796
8565
  <h2><span class="status-dot dot-ok"></span> Tooltip</h2>
7797
8566
  <div class="badges">
7798
- <label for="c-25-components-tooltip-props" class="badge ok as-toggle">12 prop types</label>
8567
+ <label for="c-27-components-tooltip-props" class="badge ok as-toggle">12 prop types</label>
7799
8568
 
7800
- <label for="c-25-components-tooltip-stories" class="badge ok as-toggle">5 stories</label>
8569
+ <label for="c-27-components-tooltip-stories" class="badge ok as-toggle">5 stories</label>
7801
8570
 
7802
8571
 
7803
8572
  </div>
@@ -7816,10 +8585,10 @@ on hover or focus.</div>
7816
8585
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
7817
8586
 
7818
8587
 
7819
- <input id="c-25-components-tooltip-stories" class="tg tg-stories" type="checkbox" hidden />
8588
+ <input id="c-27-components-tooltip-stories" class="tg tg-stories" type="checkbox" hidden />
7820
8589
 
7821
8590
 
7822
- <input id="c-25-components-tooltip-props" class="tg tg-props" type="checkbox" hidden />
8591
+ <input id="c-27-components-tooltip-props" class="tg tg-props" type="checkbox" hidden />
7823
8592
 
7824
8593
  <div class="panels">
7825
8594
 
@@ -7991,9 +8760,9 @@ sideOffset?: number = 4</code></pre>
7991
8760
  <div class="title">
7992
8761
  <h2><span class="status-dot dot-ok"></span> ValidationList</h2>
7993
8762
  <div class="badges">
7994
- <label for="c-26-components-validationlist-props" class="badge ok as-toggle">2 prop types</label>
8763
+ <label for="c-28-components-validationlist-props" class="badge ok as-toggle">2 prop types</label>
7995
8764
 
7996
- <label for="c-26-components-validationlist-stories" class="badge ok as-toggle">4 stories</label>
8765
+ <label for="c-28-components-validationlist-stories" class="badge ok as-toggle">4 stories</label>
7997
8766
 
7998
8767
 
7999
8768
  </div>
@@ -8014,10 +8783,10 @@ your form validation; it does not own the input or block submission.</div>
8014
8783
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
8015
8784
 
8016
8785
 
8017
- <input id="c-26-components-validationlist-stories" class="tg tg-stories" type="checkbox" hidden />
8786
+ <input id="c-28-components-validationlist-stories" class="tg tg-stories" type="checkbox" hidden />
8018
8787
 
8019
8788
 
8020
- <input id="c-26-components-validationlist-props" class="tg tg-props" type="checkbox" hidden />
8789
+ <input id="c-28-components-validationlist-props" class="tg tg-props" type="checkbox" hidden />
8021
8790
 
8022
8791
  <div class="panels">
8023
8792