@agentero/design-system 0.25.0 → 0.25.2

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.
@@ -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">25 components ok</span><span class="filter-pill ok" aria-disabled="true">192 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">25 components ok</span><span class="filter-pill ok" aria-disabled="true">194 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>2.9s</strong>.
597
+ Using <code>react-component-meta</code>. Generation took <strong>3.0s</strong>.
598
598
  </div>
599
599
  <h2 class="section-title">Components</h2>
600
600
  <div class="grid" role="list">
@@ -6371,7 +6371,7 @@ tablist role is announced.</div>
6371
6371
  <div class="badges">
6372
6372
  <label for="c-21-components-tag-props" class="badge ok as-toggle">8 prop types</label>
6373
6373
 
6374
- <label for="c-21-components-tag-stories" class="badge ok as-toggle">10 stories</label>
6374
+ <label for="c-21-components-tag-stories" class="badge ok as-toggle">12 stories</label>
6375
6375
 
6376
6376
 
6377
6377
  </div>
@@ -6650,6 +6650,49 @@ Icons are tinted with each color&#39;s `icon-tag-*` token.</div>
6650
6650
  &lt;/Row&gt;
6651
6651
  ))}
6652
6652
  &lt;/Stack&gt;
6653
+ );</code></pre>
6654
+ </div>
6655
+ <div class="note ok">
6656
+ <div class="row">
6657
+ <span class="ex-name">Truncate</span>
6658
+ <span class="badge ok">story ok</span>
6659
+ </div>
6660
+ <div>Long labels capped at the container width with an ellipsis</div>
6661
+ <div class="hint">`truncate` caps the Tag at its container&#39;s width and ellipsizes the label.
6662
+ The ellipsis sits on a wrapper around each text run, so a Tag that mixes an
6663
+ icon with a long label clips the label and leaves the icon at full size.</div>
6664
+ <pre><code>const Truncate = () =&gt; (
6665
+ &lt;Stack&gt;
6666
+ &lt;div style={{ width: &#39;9rem&#39; }}&gt;
6667
+ &lt;Tag truncate title=&quot;Travel insurance limited lines producer&quot;&gt;
6668
+ Travel insurance limited lines producer
6669
+ &lt;/Tag&gt;
6670
+ &lt;/div&gt;
6671
+ &lt;div style={{ width: &#39;9rem&#39; }}&gt;
6672
+ &lt;Tag truncate color=&quot;informative&quot;&gt;
6673
+ &lt;IconAdd /&gt;
6674
+ Travel insurance limited lines producer
6675
+ &lt;/Tag&gt;
6676
+ &lt;/div&gt;
6677
+ &lt;/Stack&gt;
6678
+ );</code></pre>
6679
+ </div>
6680
+ <div class="note ok">
6681
+ <div class="row">
6682
+ <span class="ex-name">Overflows Without Wrapping</span>
6683
+ <span class="badge ok">story ok</span>
6684
+ </div>
6685
+ <div>A too-narrow container overflows a single-line Tag; the label never wraps</div>
6686
+ <div class="hint">Without `truncate`, a Tag never wraps its label onto multiple lines — a
6687
+ container narrower than the label just gets overflowed by a single-line
6688
+ Tag that keeps its intrinsic width, instead of breaking the label across
6689
+ lines and spilling out of the fixed-height box.</div>
6690
+ <pre><code>const OverflowsWithoutWrapping = () =&gt; (
6691
+ &lt;div style={{ width: &#39;9rem&#39;, border: &#39;1px dashed gray&#39; }}&gt;
6692
+ &lt;Tag title=&quot;Travel insurance limited lines producer&quot;&gt;
6693
+ Travel insurance limited lines producer
6694
+ &lt;/Tag&gt;
6695
+ &lt;/div&gt;
6653
6696
  );</code></pre>
6654
6697
  </div>
6655
6698
  <div class="note ok">
@@ -6185,6 +6185,20 @@
6185
6185
  "description": "Every variant for every color rendered with a leading and trailing icon.\nIcons are tinted with each color's `icon-tag-*` token.",
6186
6186
  "summary": "Variant × color grid with icons"
6187
6187
  },
6188
+ {
6189
+ "id": "components-tag--truncate",
6190
+ "name": "Truncate",
6191
+ "snippet": "const Truncate = () => (\n <Stack>\n <div style={{ width: '9rem' }}>\n <Tag truncate title=\"Travel insurance limited lines producer\">\n Travel insurance limited lines producer\n </Tag>\n </div>\n <div style={{ width: '9rem' }}>\n <Tag truncate color=\"informative\">\n <IconAdd />\n Travel insurance limited lines producer\n </Tag>\n </div>\n </Stack>\n);",
6192
+ "description": "`truncate` caps the Tag at its container's width and ellipsizes the label.\nThe ellipsis sits on a wrapper around each text run, so a Tag that mixes an\nicon with a long label clips the label and leaves the icon at full size.",
6193
+ "summary": "Long labels capped at the container width with an ellipsis"
6194
+ },
6195
+ {
6196
+ "id": "components-tag--overflows-without-wrapping",
6197
+ "name": "Overflows Without Wrapping",
6198
+ "snippet": "const OverflowsWithoutWrapping = () => (\n <div style={{ width: '9rem', border: '1px dashed gray' }}>\n <Tag title=\"Travel insurance limited lines producer\">\n Travel insurance limited lines producer\n </Tag>\n </div>\n);",
6199
+ "description": "Without `truncate`, a Tag never wraps its label onto multiple lines — a\ncontainer narrower than the label just gets overflowed by a single-line\nTag that keeps its intrinsic width, instead of breaking the label across\nlines and spilling out of the fixed-height box.",
6200
+ "summary": "A too-narrow container overflows a single-line Tag; the label never wraps"
6201
+ },
6188
6202
  {
6189
6203
  "id": "components-tag--colors",
6190
6204
  "name": "Colors",
@@ -6980,6 +6994,6 @@
6980
6994
  },
6981
6995
  "meta": {
6982
6996
  "docgen": "react-component-meta",
6983
- "durationMs": 2944
6997
+ "durationMs": 3008
6984
6998
  }
6985
6999
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentero/design-system",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
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",
package/src/tag/tag.js CHANGED
@@ -8,9 +8,9 @@ var s = t({
8
8
  base: [
9
9
  "inline-flex w-fit min-w-fit items-center gap-1",
10
10
  "rounded-md border border-solid border-transparent px-2",
11
- "font-normal leading-normal no-underline",
11
+ "font-normal leading-normal whitespace-nowrap no-underline",
12
12
  "transition-[background-color,opacity] duration-200",
13
- "[&_svg]:size-3.5"
13
+ "[&_svg]:size-3.5 [&_svg]:shrink-0"
14
14
  ],
15
15
  variants: {
16
16
  color: {
@@ -35,7 +35,7 @@ var s = t({
35
35
  md: "h-8 text-sm"
36
36
  },
37
37
  pill: { true: "rounded-full" },
38
- truncate: { true: "max-w-full min-w-0 overflow-hidden text-ellipsis whitespace-nowrap" },
38
+ truncate: { true: "max-w-full min-w-0 overflow-hidden" },
39
39
  interactive: { true: "cursor-pointer" },
40
40
  hasOnlyIcon: { true: "justify-center px-0" }
41
41
  },
@@ -106,23 +106,26 @@ var s = t({
106
106
  variant: "tertiary",
107
107
  size: "sm"
108
108
  }
109
- }), c = ({ children: t, asChild: c, color: l, variant: u, size: d, pill: f, truncate: p, className: m, ref: h, ...g }) => {
110
- let _ = c ? a : "span", v = c && i(t) ? t.props.children : t, y = r.toArray(v), b = e(s({
111
- color: l,
112
- variant: u,
113
- size: d,
114
- pill: f,
115
- truncate: p,
116
- interactive: c,
109
+ }), c = (e) => r.map(e, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ n("span", {
110
+ className: "min-w-0 truncate",
111
+ children: e
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 = r.toArray(l && i(t) ? t.props.children : t), b = e(s({
114
+ color: u,
115
+ variant: d,
116
+ size: f,
117
+ pill: p,
118
+ truncate: m,
119
+ interactive: l,
117
120
  hasOnlyIcon: y.length > 0 && y.every(i)
118
- }), m);
119
- return /* @__PURE__ */ n(_, {
121
+ }), h), x = m && !l ? c(t) : t;
122
+ return /* @__PURE__ */ n(v, {
120
123
  "data-slot": "tag",
121
- ...g,
124
+ ..._,
122
125
  className: b,
123
- ref: h,
124
- children: c ? /* @__PURE__ */ n(o, { children: t }) : t
126
+ ref: g,
127
+ children: l ? /* @__PURE__ */ n(o, { children: t }) : x
125
128
  });
126
129
  };
127
130
  //#endregion
128
- export { c as Tag, s as tagRecipe };
131
+ export { l as Tag, s as tagRecipe };