@agentero/design-system 0.29.0 → 0.30.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.
- package/lib/merge-props.js +1 -1
- package/mcp/manifests/components.html +205 -14
- package/mcp/manifests/components.json +269 -1
- package/package.json +5 -1
- package/src/alert/alert.js +1 -1
- package/src/avatar/avatar.js +1 -1
- package/src/button/button.js +1 -1
- package/src/data-table/data-table.js +22 -19
- package/src/field/field.js +13 -13
- package/src/field/index.js +1 -1
- package/src/field-text/field-text.js +9 -9
- package/src/pagination/pagination.js +1 -1
- package/src/table/table.js +13 -13
- package/src/tabs/tabs.js +8 -5
- package/src/tag/tag.js +5 -5
- package/src/textarea/index.d.ts +2 -0
- package/src/textarea/index.js +2 -0
- package/src/textarea/textarea.d.ts +88 -0
- package/src/textarea/textarea.js +26 -0
package/lib/merge-props.js
CHANGED
|
@@ -10,7 +10,7 @@ var r = (...e) => (...t) => {
|
|
|
10
10
|
for (let [t, c] of Object.entries(n)) {
|
|
11
11
|
if (c === void 0) continue;
|
|
12
12
|
let n = s[t];
|
|
13
|
-
o(t) && typeof n == "function" && typeof c == "function" ?
|
|
13
|
+
s[t] = o(t) && typeof n == "function" && typeof c == "function" ? r(n, c) : t === "aria-describedby" && typeof n == "string" && typeof c == "string" ? a(n, c) : t === "className" && typeof n == "string" ? e(n, c) : t === "ref" && n && c ? i(n, c) : c;
|
|
14
14
|
}
|
|
15
15
|
return s;
|
|
16
16
|
}, c = (e, n) => {
|
|
@@ -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">
|
|
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">32 components ok</span><span class="filter-pill ok" aria-disabled="true">256 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>4.
|
|
597
|
+
Using <code>react-component-meta</code>. Generation took <strong>4.4s</strong>.
|
|
598
598
|
</div>
|
|
599
599
|
<h2 class="section-title">Components</h2>
|
|
600
600
|
<div class="grid" role="list">
|
|
@@ -8559,6 +8559,197 @@ leading + trailing icons, and icon-only.</div>
|
|
|
8559
8559
|
</div>
|
|
8560
8560
|
|
|
8561
8561
|
|
|
8562
|
+
</div>
|
|
8563
|
+
</article>
|
|
8564
|
+
<article
|
|
8565
|
+
class="card
|
|
8566
|
+
no-error
|
|
8567
|
+
no-info
|
|
8568
|
+
no-story-error
|
|
8569
|
+
no-doc-error"
|
|
8570
|
+
role="listitem"
|
|
8571
|
+
aria-label="TextArea">
|
|
8572
|
+
<div class="head">
|
|
8573
|
+
<div class="title">
|
|
8574
|
+
<h2><span class="status-dot dot-ok"></span> TextArea</h2>
|
|
8575
|
+
<div class="badges">
|
|
8576
|
+
<label for="c-28-components-textarea-props" class="badge ok as-toggle">8 prop types</label>
|
|
8577
|
+
|
|
8578
|
+
<label for="c-28-components-textarea-stories" class="badge ok as-toggle">6 stories</label>
|
|
8579
|
+
|
|
8580
|
+
|
|
8581
|
+
</div>
|
|
8582
|
+
</div>
|
|
8583
|
+
<div class="meta" title="./src/textarea/textarea.stories.tsx">components-textarea · ./src/textarea/textarea.stories.tsx</div>
|
|
8584
|
+
<div>Base multi-line text control sharing Input's skin, states and sizes</div>
|
|
8585
|
+
<div class="hint">TextArea is the base multi-line text control, with Input's skin, sizes and
|
|
8586
|
+
states. It wires nothing on its own: `id`, `aria-invalid` and
|
|
8587
|
+
`aria-describedby` are plain props, set by whoever owns the field.</div>
|
|
8588
|
+
<div class="kv"><span class="chip">summary: Base multi-line text control sharing Input's skin, states and sizes</span><span class="chip">example: <Label htmlFor="notes">Notes</Label>
|
|
8589
|
+
<TextArea id="notes" placeholder="Anything the underwriter should know" /></span></div>
|
|
8590
|
+
</div>
|
|
8591
|
+
|
|
8592
|
+
<!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
|
|
8593
|
+
|
|
8594
|
+
|
|
8595
|
+
<input id="c-28-components-textarea-stories" class="tg tg-stories" type="checkbox" hidden />
|
|
8596
|
+
|
|
8597
|
+
|
|
8598
|
+
<input id="c-28-components-textarea-props" class="tg tg-props" type="checkbox" hidden />
|
|
8599
|
+
|
|
8600
|
+
<div class="panels">
|
|
8601
|
+
|
|
8602
|
+
|
|
8603
|
+
|
|
8604
|
+
<div class="panel panel-props">
|
|
8605
|
+
<div class="note ok">
|
|
8606
|
+
<div class="row">
|
|
8607
|
+
<span class="ex-name">Prop types <small>(react-component-meta)</small></span>
|
|
8608
|
+
<span class="badge ok">8 prop types</span>
|
|
8609
|
+
</div>
|
|
8610
|
+
<pre><code>Component: src/textarea/textarea.tsx::TextArea</code></pre>
|
|
8611
|
+
<pre><code>Props:</code></pre>
|
|
8612
|
+
<pre><code>/**
|
|
8613
|
+
* Indicates the entered value does not conform to the format expected by the application.
|
|
8614
|
+
* Drives the destructive border and is what assistive technology announces.
|
|
8615
|
+
*/
|
|
8616
|
+
aria-invalid?: boolean | "true" | "false" | "grammar" | "spelling" | undefined
|
|
8617
|
+
|
|
8618
|
+
/**
|
|
8619
|
+
* Blocks interaction and drops the value from the submission. Use `readOnly`
|
|
8620
|
+
* when the user still needs to read or copy it.
|
|
8621
|
+
*/
|
|
8622
|
+
disabled?: boolean
|
|
8623
|
+
|
|
8624
|
+
/**
|
|
8625
|
+
* Caps the value in UTF-16 code units: typing stops there and a paste is cut.
|
|
8626
|
+
*/
|
|
8627
|
+
maxLength?: number
|
|
8628
|
+
|
|
8629
|
+
/**
|
|
8630
|
+
* Hint shown while empty; never a substitute for a label.
|
|
8631
|
+
*/
|
|
8632
|
+
placeholder?: string
|
|
8633
|
+
|
|
8634
|
+
/**
|
|
8635
|
+
* Focusable, copyable and submitted, but not editable.
|
|
8636
|
+
*/
|
|
8637
|
+
readOnly?: boolean
|
|
8638
|
+
|
|
8639
|
+
/**
|
|
8640
|
+
* Marks the control required for both the browser and assistive technology.
|
|
8641
|
+
*/
|
|
8642
|
+
required?: boolean
|
|
8643
|
+
|
|
8644
|
+
/**
|
|
8645
|
+
* Rows visible at rest when three are not enough.
|
|
8646
|
+
*/
|
|
8647
|
+
rows?: number
|
|
8648
|
+
|
|
8649
|
+
/**
|
|
8650
|
+
* Defaults to `'md'`. The first row measures one Input of the same size and
|
|
8651
|
+
* three rows show at rest: `sm` 76px, `md` 84px, `lg` 96px (`lg` also raises
|
|
8652
|
+
* the text to `base` and the radius to `lg`).
|
|
8653
|
+
*/
|
|
8654
|
+
size?: "sm" | "md" | "lg"</code></pre>
|
|
8655
|
+
</div>
|
|
8656
|
+
</div>
|
|
8657
|
+
|
|
8658
|
+
<div class="panel panel-stories">
|
|
8659
|
+
|
|
8660
|
+
|
|
8661
|
+
|
|
8662
|
+
<div class="note ok">
|
|
8663
|
+
<div class="row">
|
|
8664
|
+
<span class="ex-name">Imports</span>
|
|
8665
|
+
</div>
|
|
8666
|
+
<pre><code>import { TextArea } from "@agentero/design-system";</code></pre>
|
|
8667
|
+
</div>
|
|
8668
|
+
|
|
8669
|
+
|
|
8670
|
+
<div class="note ok">
|
|
8671
|
+
<div class="row">
|
|
8672
|
+
<span class="ex-name">Default</span>
|
|
8673
|
+
<span class="badge ok">story ok</span>
|
|
8674
|
+
</div>
|
|
8675
|
+
<div>Default standalone text area</div>
|
|
8676
|
+
<div class="hint">The default control at `md`: three rows at rest and a vertical resize handle
|
|
8677
|
+
the user can drag to make it taller.</div>
|
|
8678
|
+
<pre><code>const Default = () => <TextArea placeholder="Anything the underwriter should know" aria-label="Notes" />;</code></pre>
|
|
8679
|
+
</div>
|
|
8680
|
+
<div class="note ok">
|
|
8681
|
+
<div class="row">
|
|
8682
|
+
<span class="ex-name">All Sizes</span>
|
|
8683
|
+
<span class="badge ok">story ok</span>
|
|
8684
|
+
</div>
|
|
8685
|
+
<div>The three sizes, three rows tall at rest</div>
|
|
8686
|
+
<div class="hint">The three sizes mirror Input's: the first row measures one Input of the same
|
|
8687
|
+
size and the minimum height shows three rows.</div>
|
|
8688
|
+
<pre><code>const AllSizes = () => <div style={{ display: 'grid', gap: '1rem' }}>
|
|
8689
|
+
<TextArea size="sm" aria-label="Small" placeholder="sm — 76px, three rows" />
|
|
8690
|
+
<TextArea size="md" aria-label="Medium" placeholder="md — 84px, three rows" />
|
|
8691
|
+
<TextArea size="lg" aria-label="Large" placeholder="lg — 96px, three rows" />
|
|
8692
|
+
</div>;</code></pre>
|
|
8693
|
+
</div>
|
|
8694
|
+
<div class="note ok">
|
|
8695
|
+
<div class="row">
|
|
8696
|
+
<span class="ex-name">Rows</span>
|
|
8697
|
+
<span class="badge ok">story ok</span>
|
|
8698
|
+
</div>
|
|
8699
|
+
<div>Taller initial height through the native rows attribute</div>
|
|
8700
|
+
<div class="hint">`rows` sets a taller initial height when three rows are not enough.</div>
|
|
8701
|
+
<pre><code>const Rows = () => <TextArea
|
|
8702
|
+
placeholder="Six rows visible before scrolling"
|
|
8703
|
+
aria-label="Notes"
|
|
8704
|
+
rows={6} />;</code></pre>
|
|
8705
|
+
</div>
|
|
8706
|
+
<div class="note ok">
|
|
8707
|
+
<div class="row">
|
|
8708
|
+
<span class="ex-name">Invalid</span>
|
|
8709
|
+
<span class="badge ok">story ok</span>
|
|
8710
|
+
</div>
|
|
8711
|
+
<div>Invalid state driven by aria-invalid</div>
|
|
8712
|
+
<div class="hint">The invalid treatment comes purely from `aria-invalid`; point
|
|
8713
|
+
`aria-describedby` at the message so it is read with the control.</div>
|
|
8714
|
+
<pre><code>const Invalid = () => <div style={{ display: 'grid', gap: '0.25rem' }}>
|
|
8715
|
+
<TextArea
|
|
8716
|
+
placeholder="Anything the underwriter should know"
|
|
8717
|
+
aria-label="Reason"
|
|
8718
|
+
aria-invalid
|
|
8719
|
+
aria-describedby="reason-error"
|
|
8720
|
+
defaultValue="n/a" />
|
|
8721
|
+
<span id="reason-error">Tell us why you are cancelling.</span>
|
|
8722
|
+
</div>;</code></pre>
|
|
8723
|
+
</div>
|
|
8724
|
+
<div class="note ok">
|
|
8725
|
+
<div class="row">
|
|
8726
|
+
<span class="ex-name">Disabled</span>
|
|
8727
|
+
<span class="badge ok">story ok</span>
|
|
8728
|
+
</div>
|
|
8729
|
+
<div>Disabled state</div>
|
|
8730
|
+
|
|
8731
|
+
<pre><code>const Disabled = () => <TextArea
|
|
8732
|
+
placeholder="Anything the underwriter should know"
|
|
8733
|
+
aria-label="Notes"
|
|
8734
|
+
disabled
|
|
8735
|
+
defaultValue="Cannot be edited" />;</code></pre>
|
|
8736
|
+
</div>
|
|
8737
|
+
<div class="note ok">
|
|
8738
|
+
<div class="row">
|
|
8739
|
+
<span class="ex-name">Read Only</span>
|
|
8740
|
+
<span class="badge ok">story ok</span>
|
|
8741
|
+
</div>
|
|
8742
|
+
<div>Read-only value that stays focusable and copyable</div>
|
|
8743
|
+
|
|
8744
|
+
<pre><code>const ReadOnly = () => <TextArea
|
|
8745
|
+
placeholder="Anything the underwriter should know"
|
|
8746
|
+
aria-label="Notes"
|
|
8747
|
+
readOnly
|
|
8748
|
+
defaultValue="Copy me, but do not change me" />;</code></pre>
|
|
8749
|
+
</div>
|
|
8750
|
+
</div>
|
|
8751
|
+
|
|
8752
|
+
|
|
8562
8753
|
</div>
|
|
8563
8754
|
</article>
|
|
8564
8755
|
<article
|
|
@@ -8573,9 +8764,9 @@ leading + trailing icons, and icon-only.</div>
|
|
|
8573
8764
|
<div class="title">
|
|
8574
8765
|
<h2><span class="status-dot dot-ok"></span> Toast</h2>
|
|
8575
8766
|
<div class="badges">
|
|
8576
|
-
<label for="c-
|
|
8767
|
+
<label for="c-29-components-toast-props" class="badge ok as-toggle">11 prop types</label>
|
|
8577
8768
|
|
|
8578
|
-
<label for="c-
|
|
8769
|
+
<label for="c-29-components-toast-stories" class="badge ok as-toggle">11 stories</label>
|
|
8579
8770
|
|
|
8580
8771
|
|
|
8581
8772
|
</div>
|
|
@@ -8594,10 +8785,10 @@ common feedback patterns.</div>
|
|
|
8594
8785
|
<!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
|
|
8595
8786
|
|
|
8596
8787
|
|
|
8597
|
-
<input id="c-
|
|
8788
|
+
<input id="c-29-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
|
|
8598
8789
|
|
|
8599
8790
|
|
|
8600
|
-
<input id="c-
|
|
8791
|
+
<input id="c-29-components-toast-props" class="tg tg-props" type="checkbox" hidden />
|
|
8601
8792
|
|
|
8602
8793
|
<div class="panels">
|
|
8603
8794
|
|
|
@@ -9026,9 +9217,9 @@ action (e.g., a sync icon for a sync-in-progress toast).</div>
|
|
|
9026
9217
|
<div class="title">
|
|
9027
9218
|
<h2><span class="status-dot dot-ok"></span> Tooltip</h2>
|
|
9028
9219
|
<div class="badges">
|
|
9029
|
-
<label for="c-
|
|
9220
|
+
<label for="c-30-components-tooltip-props" class="badge ok as-toggle">12 prop types</label>
|
|
9030
9221
|
|
|
9031
|
-
<label for="c-
|
|
9222
|
+
<label for="c-30-components-tooltip-stories" class="badge ok as-toggle">5 stories</label>
|
|
9032
9223
|
|
|
9033
9224
|
|
|
9034
9225
|
</div>
|
|
@@ -9047,10 +9238,10 @@ on hover or focus.</div>
|
|
|
9047
9238
|
<!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
|
|
9048
9239
|
|
|
9049
9240
|
|
|
9050
|
-
<input id="c-
|
|
9241
|
+
<input id="c-30-components-tooltip-stories" class="tg tg-stories" type="checkbox" hidden />
|
|
9051
9242
|
|
|
9052
9243
|
|
|
9053
|
-
<input id="c-
|
|
9244
|
+
<input id="c-30-components-tooltip-props" class="tg tg-props" type="checkbox" hidden />
|
|
9054
9245
|
|
|
9055
9246
|
<div class="panels">
|
|
9056
9247
|
|
|
@@ -9222,9 +9413,9 @@ sideOffset?: number = 4</code></pre>
|
|
|
9222
9413
|
<div class="title">
|
|
9223
9414
|
<h2><span class="status-dot dot-ok"></span> ValidationList</h2>
|
|
9224
9415
|
<div class="badges">
|
|
9225
|
-
<label for="c-
|
|
9416
|
+
<label for="c-31-components-validationlist-props" class="badge ok as-toggle">2 prop types</label>
|
|
9226
9417
|
|
|
9227
|
-
<label for="c-
|
|
9418
|
+
<label for="c-31-components-validationlist-stories" class="badge ok as-toggle">4 stories</label>
|
|
9228
9419
|
|
|
9229
9420
|
|
|
9230
9421
|
</div>
|
|
@@ -9245,10 +9436,10 @@ your form validation; it does not own the input or block submission.</div>
|
|
|
9245
9436
|
<!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
|
|
9246
9437
|
|
|
9247
9438
|
|
|
9248
|
-
<input id="c-
|
|
9439
|
+
<input id="c-31-components-validationlist-stories" class="tg tg-stories" type="checkbox" hidden />
|
|
9249
9440
|
|
|
9250
9441
|
|
|
9251
|
-
<input id="c-
|
|
9442
|
+
<input id="c-31-components-validationlist-props" class="tg tg-props" type="checkbox" hidden />
|
|
9252
9443
|
|
|
9253
9444
|
<div class="panels">
|
|
9254
9445
|
|
|
@@ -7821,6 +7821,274 @@
|
|
|
7821
7821
|
],
|
|
7822
7822
|
"import": "import { Tag } from \"@agentero/design-system\";"
|
|
7823
7823
|
},
|
|
7824
|
+
"components-textarea": {
|
|
7825
|
+
"id": "components-textarea",
|
|
7826
|
+
"name": "TextArea",
|
|
7827
|
+
"path": "./src/textarea/textarea.stories.tsx",
|
|
7828
|
+
"jsDocTags": {
|
|
7829
|
+
"summary": [
|
|
7830
|
+
"Base multi-line text control sharing Input's skin, states and sizes"
|
|
7831
|
+
],
|
|
7832
|
+
"example": [
|
|
7833
|
+
"<Label htmlFor=\"notes\">Notes</Label>\n<TextArea id=\"notes\" placeholder=\"Anything the underwriter should know\" />"
|
|
7834
|
+
]
|
|
7835
|
+
},
|
|
7836
|
+
"description": "TextArea is the base multi-line text control, with Input's skin, sizes and\nstates. It wires nothing on its own: `id`, `aria-invalid` and\n`aria-describedby` are plain props, set by whoever owns the field.",
|
|
7837
|
+
"summary": "Base multi-line text control sharing Input's skin, states and sizes",
|
|
7838
|
+
"reactComponentMeta": {
|
|
7839
|
+
"displayName": "TextArea",
|
|
7840
|
+
"exportName": "TextArea",
|
|
7841
|
+
"filePath": "/home/runner/work/design-system/design-system/src/textarea/textarea.tsx",
|
|
7842
|
+
"description": "TextArea is the design system's multi-line text control: Input's skin, states\nand sizes on a single `<textarea>` with nothing around it, so the native\nresize handle and scrollbar keep working. Pair it with\n[Label](?path=/docs/components-label--docs) the way you pair an Input.\n\nIt wires nothing itself — `id`, `aria-describedby` and `aria-invalid` are the\nfield owner's job, and there is no `status` prop. It holds no value either, so\na character counter belongs to whoever owns it.",
|
|
7843
|
+
"jsDocTags": {
|
|
7844
|
+
"summary": [
|
|
7845
|
+
"Base multi-line text control sharing Input's skin, states and sizes"
|
|
7846
|
+
],
|
|
7847
|
+
"example": [
|
|
7848
|
+
"<Label htmlFor=\"notes\">Notes</Label>\n<TextArea id=\"notes\" placeholder=\"Anything the underwriter should know\" />"
|
|
7849
|
+
]
|
|
7850
|
+
},
|
|
7851
|
+
"props": {
|
|
7852
|
+
"disabled": {
|
|
7853
|
+
"name": "disabled",
|
|
7854
|
+
"required": false,
|
|
7855
|
+
"type": {
|
|
7856
|
+
"name": "boolean"
|
|
7857
|
+
},
|
|
7858
|
+
"description": "Blocks interaction and drops the value from the submission. Use `readOnly`\nwhen the user still needs to read or copy it.",
|
|
7859
|
+
"defaultValue": null,
|
|
7860
|
+
"parent": {
|
|
7861
|
+
"name": "TextareaHTMLAttributes",
|
|
7862
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7863
|
+
},
|
|
7864
|
+
"declarations": [
|
|
7865
|
+
{
|
|
7866
|
+
"name": "TextareaHTMLAttributes",
|
|
7867
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7868
|
+
},
|
|
7869
|
+
{
|
|
7870
|
+
"name": "TypeLiteral",
|
|
7871
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7872
|
+
}
|
|
7873
|
+
]
|
|
7874
|
+
},
|
|
7875
|
+
"maxLength": {
|
|
7876
|
+
"name": "maxLength",
|
|
7877
|
+
"required": false,
|
|
7878
|
+
"type": {
|
|
7879
|
+
"name": "number"
|
|
7880
|
+
},
|
|
7881
|
+
"description": "Caps the value in UTF-16 code units: typing stops there and a paste is cut.",
|
|
7882
|
+
"defaultValue": null,
|
|
7883
|
+
"parent": {
|
|
7884
|
+
"name": "TextareaHTMLAttributes",
|
|
7885
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7886
|
+
},
|
|
7887
|
+
"declarations": [
|
|
7888
|
+
{
|
|
7889
|
+
"name": "TextareaHTMLAttributes",
|
|
7890
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7891
|
+
},
|
|
7892
|
+
{
|
|
7893
|
+
"name": "TypeLiteral",
|
|
7894
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7895
|
+
}
|
|
7896
|
+
]
|
|
7897
|
+
},
|
|
7898
|
+
"placeholder": {
|
|
7899
|
+
"name": "placeholder",
|
|
7900
|
+
"required": false,
|
|
7901
|
+
"type": {
|
|
7902
|
+
"name": "string"
|
|
7903
|
+
},
|
|
7904
|
+
"description": "Hint shown while empty; never a substitute for a label.",
|
|
7905
|
+
"defaultValue": null,
|
|
7906
|
+
"parent": {
|
|
7907
|
+
"name": "TextareaHTMLAttributes",
|
|
7908
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7909
|
+
},
|
|
7910
|
+
"declarations": [
|
|
7911
|
+
{
|
|
7912
|
+
"name": "TextareaHTMLAttributes",
|
|
7913
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7914
|
+
},
|
|
7915
|
+
{
|
|
7916
|
+
"name": "TypeLiteral",
|
|
7917
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7918
|
+
}
|
|
7919
|
+
]
|
|
7920
|
+
},
|
|
7921
|
+
"readOnly": {
|
|
7922
|
+
"name": "readOnly",
|
|
7923
|
+
"required": false,
|
|
7924
|
+
"type": {
|
|
7925
|
+
"name": "boolean"
|
|
7926
|
+
},
|
|
7927
|
+
"description": "Focusable, copyable and submitted, but not editable.",
|
|
7928
|
+
"defaultValue": null,
|
|
7929
|
+
"parent": {
|
|
7930
|
+
"name": "TextareaHTMLAttributes",
|
|
7931
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7932
|
+
},
|
|
7933
|
+
"declarations": [
|
|
7934
|
+
{
|
|
7935
|
+
"name": "TextareaHTMLAttributes",
|
|
7936
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7937
|
+
},
|
|
7938
|
+
{
|
|
7939
|
+
"name": "TypeLiteral",
|
|
7940
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7941
|
+
}
|
|
7942
|
+
]
|
|
7943
|
+
},
|
|
7944
|
+
"required": {
|
|
7945
|
+
"name": "required",
|
|
7946
|
+
"required": false,
|
|
7947
|
+
"type": {
|
|
7948
|
+
"name": "boolean"
|
|
7949
|
+
},
|
|
7950
|
+
"description": "Marks the control required for both the browser and assistive technology.",
|
|
7951
|
+
"defaultValue": null,
|
|
7952
|
+
"parent": {
|
|
7953
|
+
"name": "TextareaHTMLAttributes",
|
|
7954
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7955
|
+
},
|
|
7956
|
+
"declarations": [
|
|
7957
|
+
{
|
|
7958
|
+
"name": "TextareaHTMLAttributes",
|
|
7959
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7960
|
+
},
|
|
7961
|
+
{
|
|
7962
|
+
"name": "TypeLiteral",
|
|
7963
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7964
|
+
}
|
|
7965
|
+
]
|
|
7966
|
+
},
|
|
7967
|
+
"rows": {
|
|
7968
|
+
"name": "rows",
|
|
7969
|
+
"required": false,
|
|
7970
|
+
"type": {
|
|
7971
|
+
"name": "number"
|
|
7972
|
+
},
|
|
7973
|
+
"description": "Rows visible at rest when three are not enough.",
|
|
7974
|
+
"defaultValue": null,
|
|
7975
|
+
"parent": {
|
|
7976
|
+
"name": "TextareaHTMLAttributes",
|
|
7977
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7978
|
+
},
|
|
7979
|
+
"declarations": [
|
|
7980
|
+
{
|
|
7981
|
+
"name": "TextareaHTMLAttributes",
|
|
7982
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
7983
|
+
},
|
|
7984
|
+
{
|
|
7985
|
+
"name": "TypeLiteral",
|
|
7986
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
7987
|
+
}
|
|
7988
|
+
]
|
|
7989
|
+
},
|
|
7990
|
+
"aria-invalid": {
|
|
7991
|
+
"name": "aria-invalid",
|
|
7992
|
+
"required": false,
|
|
7993
|
+
"type": {
|
|
7994
|
+
"name": "boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined"
|
|
7995
|
+
},
|
|
7996
|
+
"description": "Indicates the entered value does not conform to the format expected by the application.\nDrives the destructive border and is what assistive technology announces.",
|
|
7997
|
+
"defaultValue": null,
|
|
7998
|
+
"parent": {
|
|
7999
|
+
"name": "AriaAttributes",
|
|
8000
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
8001
|
+
},
|
|
8002
|
+
"declarations": [
|
|
8003
|
+
{
|
|
8004
|
+
"name": "AriaAttributes",
|
|
8005
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
8006
|
+
},
|
|
8007
|
+
{
|
|
8008
|
+
"name": "TypeLiteral",
|
|
8009
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
8010
|
+
}
|
|
8011
|
+
]
|
|
8012
|
+
},
|
|
8013
|
+
"size": {
|
|
8014
|
+
"name": "size",
|
|
8015
|
+
"required": false,
|
|
8016
|
+
"type": {
|
|
8017
|
+
"name": "enum",
|
|
8018
|
+
"raw": "\"sm\" | \"md\" | \"lg\"",
|
|
8019
|
+
"value": [
|
|
8020
|
+
{
|
|
8021
|
+
"value": "\"sm\""
|
|
8022
|
+
},
|
|
8023
|
+
{
|
|
8024
|
+
"value": "\"md\""
|
|
8025
|
+
},
|
|
8026
|
+
{
|
|
8027
|
+
"value": "\"lg\""
|
|
8028
|
+
}
|
|
8029
|
+
]
|
|
8030
|
+
},
|
|
8031
|
+
"description": "Defaults to `'md'`. The first row measures one Input of the same size and\nthree rows show at rest: `sm` 76px, `md` 84px, `lg` 96px (`lg` also raises\nthe text to `base` and the radius to `lg`).",
|
|
8032
|
+
"defaultValue": null,
|
|
8033
|
+
"parent": {
|
|
8034
|
+
"name": "TextAreaProps",
|
|
8035
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
8036
|
+
},
|
|
8037
|
+
"declarations": [
|
|
8038
|
+
{
|
|
8039
|
+
"name": "TypeLiteral",
|
|
8040
|
+
"fileName": "src/textarea/textarea.tsx"
|
|
8041
|
+
}
|
|
8042
|
+
]
|
|
8043
|
+
}
|
|
8044
|
+
}
|
|
8045
|
+
},
|
|
8046
|
+
"stories": [
|
|
8047
|
+
{
|
|
8048
|
+
"id": "components-textarea--default",
|
|
8049
|
+
"name": "Default",
|
|
8050
|
+
"snippet": "const Default = () => <TextArea placeholder=\"Anything the underwriter should know\" aria-label=\"Notes\" />;",
|
|
8051
|
+
"description": "The default control at `md`: three rows at rest and a vertical resize handle\nthe user can drag to make it taller.",
|
|
8052
|
+
"summary": "Default standalone text area"
|
|
8053
|
+
},
|
|
8054
|
+
{
|
|
8055
|
+
"id": "components-textarea--all-sizes",
|
|
8056
|
+
"name": "All Sizes",
|
|
8057
|
+
"snippet": "const AllSizes = () => <div style={{ display: 'grid', gap: '1rem' }}>\n <TextArea size=\"sm\" aria-label=\"Small\" placeholder=\"sm — 76px, three rows\" />\n <TextArea size=\"md\" aria-label=\"Medium\" placeholder=\"md — 84px, three rows\" />\n <TextArea size=\"lg\" aria-label=\"Large\" placeholder=\"lg — 96px, three rows\" />\n</div>;",
|
|
8058
|
+
"description": "The three sizes mirror Input's: the first row measures one Input of the same\nsize and the minimum height shows three rows.",
|
|
8059
|
+
"summary": "The three sizes, three rows tall at rest"
|
|
8060
|
+
},
|
|
8061
|
+
{
|
|
8062
|
+
"id": "components-textarea--rows",
|
|
8063
|
+
"name": "Rows",
|
|
8064
|
+
"snippet": "const Rows = () => <TextArea\n placeholder=\"Six rows visible before scrolling\"\n aria-label=\"Notes\"\n rows={6} />;",
|
|
8065
|
+
"description": "`rows` sets a taller initial height when three rows are not enough.",
|
|
8066
|
+
"summary": "Taller initial height through the native rows attribute"
|
|
8067
|
+
},
|
|
8068
|
+
{
|
|
8069
|
+
"id": "components-textarea--invalid",
|
|
8070
|
+
"name": "Invalid",
|
|
8071
|
+
"snippet": "const Invalid = () => <div style={{ display: 'grid', gap: '0.25rem' }}>\n <TextArea\n placeholder=\"Anything the underwriter should know\"\n aria-label=\"Reason\"\n aria-invalid\n aria-describedby=\"reason-error\"\n defaultValue=\"n/a\" />\n <span id=\"reason-error\">Tell us why you are cancelling.</span>\n</div>;",
|
|
8072
|
+
"description": "The invalid treatment comes purely from `aria-invalid`; point\n`aria-describedby` at the message so it is read with the control.",
|
|
8073
|
+
"summary": "Invalid state driven by aria-invalid"
|
|
8074
|
+
},
|
|
8075
|
+
{
|
|
8076
|
+
"id": "components-textarea--disabled",
|
|
8077
|
+
"name": "Disabled",
|
|
8078
|
+
"snippet": "const Disabled = () => <TextArea\n placeholder=\"Anything the underwriter should know\"\n aria-label=\"Notes\"\n disabled\n defaultValue=\"Cannot be edited\" />;",
|
|
8079
|
+
"description": "",
|
|
8080
|
+
"summary": "Disabled state"
|
|
8081
|
+
},
|
|
8082
|
+
{
|
|
8083
|
+
"id": "components-textarea--read-only",
|
|
8084
|
+
"name": "Read Only",
|
|
8085
|
+
"snippet": "const ReadOnly = () => <TextArea\n placeholder=\"Anything the underwriter should know\"\n aria-label=\"Notes\"\n readOnly\n defaultValue=\"Copy me, but do not change me\" />;",
|
|
8086
|
+
"description": "",
|
|
8087
|
+
"summary": "Read-only value that stays focusable and copyable"
|
|
8088
|
+
}
|
|
8089
|
+
],
|
|
8090
|
+
"import": "import { TextArea } from \"@agentero/design-system\";"
|
|
8091
|
+
},
|
|
7824
8092
|
"components-toast": {
|
|
7825
8093
|
"id": "components-toast",
|
|
7826
8094
|
"name": "Toast",
|
|
@@ -8606,6 +8874,6 @@
|
|
|
8606
8874
|
},
|
|
8607
8875
|
"meta": {
|
|
8608
8876
|
"docgen": "react-component-meta",
|
|
8609
|
-
"durationMs":
|
|
8877
|
+
"durationMs": 4390
|
|
8610
8878
|
}
|
|
8611
8879
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -133,6 +133,10 @@
|
|
|
133
133
|
"types": "./src/tag/index.d.ts",
|
|
134
134
|
"import": "./src/tag/index.js"
|
|
135
135
|
},
|
|
136
|
+
"./textarea": {
|
|
137
|
+
"types": "./src/textarea/index.d.ts",
|
|
138
|
+
"import": "./src/textarea/index.js"
|
|
139
|
+
},
|
|
136
140
|
"./toast": {
|
|
137
141
|
"types": "./src/toast/index.d.ts",
|
|
138
142
|
"import": "./src/toast/index.js"
|
package/src/alert/alert.js
CHANGED
package/src/avatar/avatar.js
CHANGED
package/src/button/button.js
CHANGED
|
@@ -12,24 +12,27 @@ var g = s(null), _ = () => {
|
|
|
12
12
|
let e = c(g);
|
|
13
13
|
if (!e) throw Error("useDataTable must be used within a DataTable.Root");
|
|
14
14
|
return e;
|
|
15
|
-
}, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
}, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) => {
|
|
16
|
+
let o = h({
|
|
17
|
+
...a,
|
|
18
|
+
getCoreRowModel: m()
|
|
19
|
+
}), s = l(null);
|
|
20
|
+
return /* @__PURE__ */ d(g, {
|
|
21
|
+
value: {
|
|
22
|
+
table: o,
|
|
23
|
+
isLoading: t,
|
|
24
|
+
scrollRef: s,
|
|
25
|
+
onRowClick: n,
|
|
26
|
+
rowHref: r,
|
|
27
|
+
linkComponent: i
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ d("div", {
|
|
30
|
+
"data-slot": "data-table-root",
|
|
31
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
32
|
+
children: e
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
33
36
|
v.displayName = "DataTable.Root";
|
|
34
37
|
var y = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
35
38
|
"data-slot": "data-table-toolbar",
|
|
@@ -98,7 +101,7 @@ var b = a({
|
|
|
98
101
|
return /* @__PURE__ */ d(o, { children: /* @__PURE__ */ d(n.Row, {
|
|
99
102
|
className: e("has-aria-expanded:bg-bg-default-base-secondary", i && "cursor-pointer"),
|
|
100
103
|
onClick: i ? (e) => {
|
|
101
|
-
S(e.target)
|
|
104
|
+
!S(e.target) && e.currentTarget.contains(e.target) && (v ? v(t.original) : r && e.currentTarget.querySelector("[data-row-link]")?.click());
|
|
102
105
|
} : void 0,
|
|
103
106
|
children: t.getVisibleCells().map((e, t) => {
|
|
104
107
|
let i = e.column.columnDef.meta;
|
package/src/field/field.js
CHANGED
|
@@ -45,19 +45,19 @@ var m = s({
|
|
|
45
45
|
});
|
|
46
46
|
g.displayName = "Field.Group";
|
|
47
47
|
var _ = ({ className: n, orientation: r = "vertical", invalid: a = !1, disabled: o = !1, readOnly: s = !1, required: u = !1, controlId: p, ...m }) => {
|
|
48
|
-
let g = l(), _ = p ?? `${g}-control`, v = `${g}-description`, y = `${g}-error`, [b, x] = d([]), S = c((e) => (x((t) => t.includes(e) ? t : [...t, e]), () => x((t) => t.filter((t) => t !== e))), [])
|
|
48
|
+
let g = l(), _ = p ?? `${g}-control`, v = `${g}-description`, y = `${g}-error`, [b, x] = d([]), S = c((e) => (x((t) => t.includes(e) ? t : [...t, e]), () => x((t) => t.filter((t) => t !== e))), []), C = {
|
|
49
|
+
controlId: _,
|
|
50
|
+
descriptionId: v,
|
|
51
|
+
errorId: y,
|
|
52
|
+
describedBy: [...[v, y].filter((e) => b.includes(e)), ...b.filter((e) => e !== v && e !== y)].join(" ") || void 0,
|
|
53
|
+
registerMessage: S,
|
|
54
|
+
invalid: a,
|
|
55
|
+
disabled: o,
|
|
56
|
+
readOnly: s,
|
|
57
|
+
required: u
|
|
58
|
+
};
|
|
49
59
|
return /* @__PURE__ */ f(i, {
|
|
50
|
-
value:
|
|
51
|
-
controlId: _,
|
|
52
|
-
descriptionId: v,
|
|
53
|
-
errorId: y,
|
|
54
|
-
describedBy: [...[v, y].filter((e) => b.includes(e)), ...b.filter((e) => e !== v && e !== y)].join(" ") || void 0,
|
|
55
|
-
registerMessage: S,
|
|
56
|
-
invalid: a,
|
|
57
|
-
disabled: o,
|
|
58
|
-
readOnly: s,
|
|
59
|
-
required: u
|
|
60
|
-
},
|
|
60
|
+
value: C,
|
|
61
61
|
children: /* @__PURE__ */ f(t, {
|
|
62
62
|
value: {
|
|
63
63
|
htmlFor: _,
|
|
@@ -129,4 +129,4 @@ var x = (e) => {
|
|
|
129
129
|
};
|
|
130
130
|
S.displayName = "Field.Error";
|
|
131
131
|
//#endregion
|
|
132
|
-
export { v as Content, b as Description, S as
|
|
132
|
+
export { v as Content, b as Description, S as Error, g as Group, y as Label, _ as Root, m as fieldRecipe };
|
package/src/field/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldContext as e, useFieldContext as t } from "./context.js";
|
|
2
|
-
import { Content as n, Description as r,
|
|
2
|
+
import { Content as n, Description as r, Error as i, Group as a, Label as o, Root as s, fieldRecipe as c } from "./field.js";
|
|
3
3
|
//#region src/field/index.ts
|
|
4
4
|
var l = {
|
|
5
5
|
Root: s,
|
|
@@ -5,16 +5,16 @@ import { InputContext as n } from "../input/context.js";
|
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/field-text/field-text.tsx
|
|
7
7
|
var i = ({ children: t }) => {
|
|
8
|
-
let i = e()
|
|
8
|
+
let i = e(), a = i && {
|
|
9
|
+
id: i.controlId,
|
|
10
|
+
"aria-describedby": i.describedBy,
|
|
11
|
+
"aria-invalid": i.invalid || void 0,
|
|
12
|
+
required: i.required || void 0,
|
|
13
|
+
disabled: i.disabled || void 0,
|
|
14
|
+
readOnly: i.readOnly || void 0
|
|
15
|
+
};
|
|
9
16
|
return /* @__PURE__ */ r(n, {
|
|
10
|
-
value:
|
|
11
|
-
id: i.controlId,
|
|
12
|
-
"aria-describedby": i.describedBy,
|
|
13
|
-
"aria-invalid": i.invalid || void 0,
|
|
14
|
-
required: i.required || void 0,
|
|
15
|
-
disabled: i.disabled || void 0,
|
|
16
|
-
readOnly: i.readOnly || void 0
|
|
17
|
-
},
|
|
17
|
+
value: a,
|
|
18
18
|
children: t
|
|
19
19
|
});
|
|
20
20
|
}, a = ({ children: e, ...n }) => /* @__PURE__ */ r(t.Root, {
|
package/src/table/table.js
CHANGED
|
@@ -31,18 +31,18 @@ var s = "ps-[var(--table-cell-padding-inline)] pe-[var(--table-cell-padding-inli
|
|
|
31
31
|
if (!e) throw Error("Table parts must be used within Table.Root");
|
|
32
32
|
return e;
|
|
33
33
|
}, d = i("body"), f = (e) => e === "header" || e === "headerAndFooter", p = (e) => e === "headerAndFooter", m = ({ children: e, ref: t, ...n }) => {
|
|
34
|
-
let { size: r, sticky: i, embed: a } = n, s = c(n)
|
|
34
|
+
let { size: r, sticky: i, embed: a } = n, s = c(n), u = {
|
|
35
|
+
header: y({ sticky: f(i) }),
|
|
36
|
+
cell: x({ size: r }),
|
|
37
|
+
headRow: _({ body: !1 }),
|
|
38
|
+
bodyRow: _({
|
|
39
|
+
body: !0,
|
|
40
|
+
divider: !a,
|
|
41
|
+
stickyFooter: p(i)
|
|
42
|
+
})
|
|
43
|
+
};
|
|
35
44
|
return /* @__PURE__ */ o(l, {
|
|
36
|
-
value:
|
|
37
|
-
header: y({ sticky: f(i) }),
|
|
38
|
-
cell: x({ size: r }),
|
|
39
|
-
headRow: _({ body: !1 }),
|
|
40
|
-
bodyRow: _({
|
|
41
|
-
body: !0,
|
|
42
|
-
divider: !a,
|
|
43
|
-
stickyFooter: p(i)
|
|
44
|
-
})
|
|
45
|
-
},
|
|
45
|
+
value: u,
|
|
46
46
|
children: /* @__PURE__ */ o("div", {
|
|
47
47
|
"data-slot": "table-root",
|
|
48
48
|
className: s.root(),
|
|
@@ -100,10 +100,10 @@ var _ = r({
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}), v = ({ className: t, ...n }) => {
|
|
103
|
-
let { headRow: r, bodyRow: i } = u();
|
|
103
|
+
let { headRow: r, bodyRow: i } = u(), s = a(d) === "body";
|
|
104
104
|
return /* @__PURE__ */ o("tr", {
|
|
105
105
|
"data-slot": "table-row",
|
|
106
|
-
className: e(
|
|
106
|
+
className: e(s ? i : r, t),
|
|
107
107
|
...n
|
|
108
108
|
});
|
|
109
109
|
};
|
package/src/tabs/tabs.js
CHANGED
|
@@ -103,11 +103,14 @@ var f = ({ className: t, ...n }) => {
|
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
105
|
f.displayName = "Tabs.Content";
|
|
106
|
-
var p = ({ className: t, variant: n, ...a }) =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
var p = ({ className: t, variant: n, ...a }) => {
|
|
107
|
+
let c = r(s) ?? o({ variant: n });
|
|
108
|
+
return /* @__PURE__ */ i("span", {
|
|
109
|
+
"data-slot": "tabs-label",
|
|
110
|
+
className: e(c.trigger(), "pointer-events-none", t),
|
|
111
|
+
...a
|
|
112
|
+
});
|
|
113
|
+
};
|
|
111
114
|
p.displayName = "Tabs.Label";
|
|
112
115
|
//#endregion
|
|
113
116
|
export { f as Content, p as Label, u as List, l as Root, d as Trigger, o as tabsRecipe };
|
package/src/tag/tag.js
CHANGED
|
@@ -110,21 +110,21 @@ var s = t({
|
|
|
110
110
|
className: "min-w-0 truncate",
|
|
111
111
|
children: e
|
|
112
112
|
}) : e), l = ({ children: t, asChild: l, color: u, variant: d, size: f, pill: p, truncate: m, className: h, ref: g, ..._ }) => {
|
|
113
|
-
let v = l ? a : "span", y = n.toArray(l && r(t) ? t.props.children : t), b = e(s({
|
|
113
|
+
let v = l ? a : "span", y = n.toArray(l && r(t) ? t.props.children : t), b = y.length > 0 && y.every(r), x = e(s({
|
|
114
114
|
color: u,
|
|
115
115
|
variant: d,
|
|
116
116
|
size: f,
|
|
117
117
|
pill: p,
|
|
118
118
|
truncate: m,
|
|
119
119
|
interactive: l,
|
|
120
|
-
hasOnlyIcon:
|
|
121
|
-
}), h),
|
|
120
|
+
hasOnlyIcon: b
|
|
121
|
+
}), h), S = m && !l ? c(t) : t;
|
|
122
122
|
return /* @__PURE__ */ i(v, {
|
|
123
123
|
"data-slot": "tag",
|
|
124
124
|
..._,
|
|
125
|
-
className:
|
|
125
|
+
className: x,
|
|
126
126
|
ref: g,
|
|
127
|
-
children: l ? /* @__PURE__ */ i(o, { children: t }) :
|
|
127
|
+
children: l ? /* @__PURE__ */ i(o, { children: t }) : S
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
//#endregion
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
/**
|
|
4
|
+
* Extends `inputRecipe`, trading Input's fixed height for a minimum one. The
|
|
5
|
+
* handle drags vertically only, so the control can never break its column.
|
|
6
|
+
*
|
|
7
|
+
* @summary tailwind-variants recipe backing the TextArea component styles
|
|
8
|
+
*/
|
|
9
|
+
export declare const textAreaRecipe: import('tailwind-variants').TVReturnType<{
|
|
10
|
+
size: {
|
|
11
|
+
sm: string;
|
|
12
|
+
md: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
};
|
|
15
|
+
}, undefined, "block resize-y", {
|
|
16
|
+
size: {
|
|
17
|
+
sm: string;
|
|
18
|
+
md: string;
|
|
19
|
+
lg: string;
|
|
20
|
+
};
|
|
21
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
22
|
+
size: {
|
|
23
|
+
sm: string;
|
|
24
|
+
md: string;
|
|
25
|
+
lg: string;
|
|
26
|
+
};
|
|
27
|
+
}, undefined, string[], {
|
|
28
|
+
size: {
|
|
29
|
+
sm: string;
|
|
30
|
+
md: string;
|
|
31
|
+
lg: string;
|
|
32
|
+
};
|
|
33
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
34
|
+
size: {
|
|
35
|
+
sm: string;
|
|
36
|
+
md: string;
|
|
37
|
+
lg: string;
|
|
38
|
+
};
|
|
39
|
+
}, undefined, string[], unknown, unknown, undefined>>>;
|
|
40
|
+
export type TextAreaVariants = VariantProps<typeof textAreaRecipe>;
|
|
41
|
+
/** Control size, the same three as Input. */
|
|
42
|
+
export type TextAreaSize = NonNullable<TextAreaVariants['size']>;
|
|
43
|
+
/** Every `<textarea>` attribute is forwarded; these are redeclared so the docs and the MCP manifest list them. */
|
|
44
|
+
export type TextAreaProps = ComponentPropsWithRef<'textarea'> & {
|
|
45
|
+
/**
|
|
46
|
+
* Defaults to `'md'`. The first row measures one Input of the same size and
|
|
47
|
+
* three rows show at rest: `sm` 76px, `md` 84px, `lg` 96px (`lg` also raises
|
|
48
|
+
* the text to `base` and the radius to `lg`).
|
|
49
|
+
*/
|
|
50
|
+
size?: TextAreaSize;
|
|
51
|
+
/** Rows visible at rest when three are not enough. */
|
|
52
|
+
rows?: number;
|
|
53
|
+
/** Hint shown while empty; never a substitute for a label. */
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/** Caps the value in UTF-16 code units: typing stops there and a paste is cut. */
|
|
56
|
+
maxLength?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Blocks interaction and drops the value from the submission. Use `readOnly`
|
|
59
|
+
* when the user still needs to read or copy it.
|
|
60
|
+
*/
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
/** Focusable, copyable and submitted, but not editable. */
|
|
63
|
+
readOnly?: boolean;
|
|
64
|
+
/** Marks the control required for both the browser and assistive technology. */
|
|
65
|
+
required?: boolean;
|
|
66
|
+
/** Drives the destructive border and is what assistive technology announces. */
|
|
67
|
+
'aria-invalid'?: ComponentPropsWithRef<'textarea'>['aria-invalid'];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* TextArea is the design system's multi-line text control: Input's skin, states
|
|
71
|
+
* and sizes on a single `<textarea>` with nothing around it, so the native
|
|
72
|
+
* resize handle and scrollbar keep working. Pair it with
|
|
73
|
+
* [Label](?path=/docs/components-label--docs) the way you pair an Input.
|
|
74
|
+
*
|
|
75
|
+
* It wires nothing itself — `id`, `aria-describedby` and `aria-invalid` are the
|
|
76
|
+
* field owner's job, and there is no `status` prop. It holds no value either, so
|
|
77
|
+
* a character counter belongs to whoever owns it.
|
|
78
|
+
*
|
|
79
|
+
* @summary Base multi-line text control sharing Input's skin, states and sizes
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* <Label htmlFor="notes">Notes</Label>
|
|
83
|
+
* <TextArea id="notes" placeholder="Anything the underwriter should know" />
|
|
84
|
+
*/
|
|
85
|
+
export declare const TextArea: {
|
|
86
|
+
(props: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { inputRecipe as t } from "../input/input.js";
|
|
3
|
+
import { tv as n } from "tailwind-variants";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/textarea/textarea.tsx
|
|
6
|
+
var i = n({
|
|
7
|
+
extend: t,
|
|
8
|
+
base: "block resize-y",
|
|
9
|
+
variants: { size: {
|
|
10
|
+
sm: "h-auto min-h-19 py-1",
|
|
11
|
+
md: "h-auto min-h-21 py-2",
|
|
12
|
+
lg: "h-auto min-h-24 py-2.75"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { size: "md" }
|
|
15
|
+
}), a = (t) => {
|
|
16
|
+
let { className: n, size: a, ...o } = t;
|
|
17
|
+
return /* @__PURE__ */ r("textarea", {
|
|
18
|
+
"data-slot": "textarea",
|
|
19
|
+
"data-size": a,
|
|
20
|
+
className: e(i({ size: a }), n),
|
|
21
|
+
...o
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
a.displayName = "TextArea";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as TextArea, i as textAreaRecipe };
|