@jonmilner/ui 0.2.2 → 0.2.3

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.
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.badge, components.button, components.chip, components.field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.toast;
2
- @layer components.badge{._1ixfil10{white-space:nowrap;border-width:var(--space-1);border-style:solid;border-color:#0000}@media (forced-colors:active){._1ixfil10{color:canvastext;background-color:canvas;border-color:canvastext}}}
2
+ @layer components.badge{._1ixfil10{border-width:var(--space-1);border-style:solid;border-color:#0000}@media (forced-colors:active){._1ixfil10{color:canvastext;background-color:canvas;border-color:canvastext}}}
@@ -46,6 +46,7 @@ function c({ variant: c = "neutral", size: l = "med", display: u = "inline-block
46
46
  font: "label",
47
47
  size: l,
48
48
  weight: "medium",
49
+ wrap: "nowrap",
49
50
  children: _
50
51
  })
51
52
  });
@@ -3,11 +3,12 @@ import { Box as t } from "../Box/index.mjs";
3
3
  import { Clickable as n } from "../Clickable/index.mjs";
4
4
  import { Icon as r } from "../Icon/index.mjs";
5
5
  import { fills as i } from "../styles/button-fills.mjs";
6
- import { Text as a } from "../Text/index.mjs";
7
- import { button as o, content as s, root as c, stack as l } from "./Button.css.mjs";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ import { content as a, stack as o } from "../styles/button-parts.css.mjs";
7
+ import { Text as s } from "../Text/index.mjs";
8
+ import { button as c, content as l, root as u, stack as d } from "./Button.css.mjs";
9
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
10
  //#region src/Button/index.tsx
10
- var f = {
11
+ var m = {
11
12
  sm: {
12
13
  minBlockSize: "sm",
13
14
  paddingBlock: "6",
@@ -27,62 +28,63 @@ var f = {
27
28
  gap: "8"
28
29
  }
29
30
  };
30
- function p({ variant: p = "secondary", size: m = "med", loading: h = !1, iconStart: g, iconEnd: _, minBlockSize: v = f[m].minBlockSize, paddingBlock: y = f[m].paddingBlock, paddingInline: b = f[m].paddingInline, gap: x = f[m].gap, borderRadius: S = "med", backgroundColor: C = i[p].backgroundColor, color: w = i[p].color, className: T, children: E, "aria-busy": D, ...O }) {
31
- let k = h || String(D) === "true";
32
- return /* @__PURE__ */ u(n, {
33
- ...O,
34
- backgroundColor: C,
35
- borderRadius: S,
36
- busy: k,
37
- className: e(c, o({
38
- variant: p,
39
- size: m
40
- }), T),
41
- color: w,
42
- minBlockSize: v,
43
- paddingBlock: y,
44
- paddingInline: b,
45
- children: /* @__PURE__ */ d(t, {
31
+ function h({ variant: h = "secondary", size: g = "med", loading: _ = !1, iconStart: v, iconEnd: y, minBlockSize: b = m[g].minBlockSize, paddingBlock: x = m[g].paddingBlock, paddingInline: S = m[g].paddingInline, gap: C = m[g].gap, borderRadius: w = "med", backgroundColor: T = i[h].backgroundColor, color: E = i[h].color, className: D, children: O, "aria-busy": k, ...A }) {
32
+ let j = _ || String(k) === "true";
33
+ return /* @__PURE__ */ f(n, {
34
+ ...A,
35
+ backgroundColor: T,
36
+ borderRadius: w,
37
+ busy: j,
38
+ className: e(u, c({
39
+ variant: h,
40
+ size: g
41
+ }), D),
42
+ color: E,
43
+ minBlockSize: b,
44
+ paddingBlock: x,
45
+ paddingInline: S,
46
+ children: /* @__PURE__ */ p(t, {
46
47
  alignItems: "center",
47
48
  as: "span",
48
- className: l,
49
+ className: e(d, o),
49
50
  display: "grid",
50
- children: [/* @__PURE__ */ d(t, {
51
+ children: [/* @__PURE__ */ p(t, {
51
52
  alignItems: "center",
52
53
  as: "span",
53
- className: s,
54
+ className: e(l, a),
54
55
  display: "flex",
55
- gap: x,
56
+ gap: C,
56
57
  children: [
57
- g && /* @__PURE__ */ u(g, { size: m }),
58
- E != null && E !== !1 && E !== "" && /* @__PURE__ */ u(a, {
58
+ v && /* @__PURE__ */ f(v, { size: g }),
59
+ O != null && O !== !1 && O !== "" && /* @__PURE__ */ f(s, {
59
60
  as: "span",
61
+ className: "_1gwwloa2",
60
62
  font: "label",
61
- size: m,
63
+ size: g,
62
64
  weight: "medium",
63
- children: E
65
+ children: O
64
66
  }),
65
- _ && /* @__PURE__ */ u(_, { size: m })
67
+ y && /* @__PURE__ */ f(y, { size: g })
66
68
  ]
67
- }), k && /* @__PURE__ */ d(r, {
69
+ }), j && /* @__PURE__ */ p(r, {
68
70
  className: "hkhd8b",
69
71
  fill: "currentColor",
70
- size: m,
72
+ size: g,
71
73
  stroke: "none",
72
74
  children: [
73
- /* @__PURE__ */ u("circle", {
75
+ /* @__PURE__ */ f("circle", {
74
76
  className: "hkhd8c",
75
77
  cx: "5",
76
78
  cy: "12",
77
79
  r: "2"
78
80
  }),
79
- /* @__PURE__ */ u("circle", {
81
+ /* @__PURE__ */ f("circle", {
80
82
  className: "hkhd8c",
81
83
  cx: "12",
82
84
  cy: "12",
83
85
  r: "2"
84
86
  }),
85
- /* @__PURE__ */ u("circle", {
87
+ /* @__PURE__ */ f("circle", {
86
88
  className: "hkhd8c",
87
89
  cx: "19",
88
90
  cy: "12",
@@ -94,4 +96,4 @@ function p({ variant: p = "secondary", size: m = "med", loading: h = !1, iconSta
94
96
  });
95
97
  }
96
98
  //#endregion
97
- export { p as Button };
99
+ export { h as Button };
@@ -8,9 +8,9 @@ export type FieldLabelProps = TextPartProps<Field$1.Label.Props>;
8
8
  export type FieldDescriptionProps = TextPartProps<Field$1.Description.Props>;
9
9
  export type FieldErrorProps = TextPartProps<Field$1.Error.Props>;
10
10
  declare function FieldRoot({ display, flexDirection, gap, className, style, ...props }: FieldProps): import("react").JSX.Element;
11
- declare function FieldLabel({ nativeLabel, size, font, weight, leading, truncate, className, style, ...props }: FieldLabelProps): import("react").JSX.Element;
12
- declare function FieldDescription({ size, font, weight, leading, truncate, color, className, style, ...props }: FieldDescriptionProps): import("react").JSX.Element;
13
- declare function FieldError({ children, match, size, font, weight, leading, truncate, color, className, style, ...props }: FieldErrorProps): import("react").JSX.Element;
11
+ declare function FieldLabel({ nativeLabel, size, font, weight, leading, truncate, wrap, className, style, ...props }: FieldLabelProps): import("react").JSX.Element;
12
+ declare function FieldDescription({ size, font, weight, leading, truncate, wrap, color, className, style, ...props }: FieldDescriptionProps): import("react").JSX.Element;
13
+ declare function FieldError({ children, match, size, font, weight, leading, truncate, wrap, color, className, style, ...props }: FieldErrorProps): import("react").JSX.Element;
14
14
  export declare const Field: typeof FieldRoot & {
15
15
  Label: typeof FieldLabel;
16
16
  Description: typeof FieldDescription;
@@ -22,10 +22,10 @@ function d({ display: e = "flex", flexDirection: r = "column", gap: i = "8", cla
22
22
  })
23
23
  });
24
24
  }
25
- function f({ nativeLabel: n = !0, size: i = "sm", font: o = "label", weight: c = "medium", leading: l, truncate: d, className: f, style: p, ...m }) {
26
- let [h, g] = t(m);
25
+ function f({ nativeLabel: n = !0, size: i = "sm", font: o = "label", weight: c = "medium", leading: l, truncate: d, wrap: f, className: p, style: m, ...h }) {
26
+ let [g, _] = t(h);
27
27
  return /* @__PURE__ */ s(u.Label, {
28
- ...g,
28
+ ..._,
29
29
  nativeLabel: n,
30
30
  render: /* @__PURE__ */ s(r, {
31
31
  as: n ? "label" : "span",
@@ -34,31 +34,33 @@ function f({ nativeLabel: n = !0, size: i = "sm", font: o = "label", weight: c =
34
34
  weight: c,
35
35
  leading: l,
36
36
  truncate: d,
37
- ...h,
38
- className: e(a, f),
39
- style: p
37
+ wrap: f,
38
+ ...g,
39
+ className: e(a, p),
40
+ style: m
40
41
  })
41
42
  });
42
43
  }
43
- function p({ size: e = "sm", font: n, weight: i, leading: a, truncate: o, color: c = "fgMuted", className: l, style: d, ...f }) {
44
- let [p, m] = t(f);
44
+ function p({ size: e = "sm", font: n, weight: i, leading: a, truncate: o, wrap: c, color: l = "fgMuted", className: d, style: f, ...p }) {
45
+ let [m, h] = t(p);
45
46
  return /* @__PURE__ */ s(u.Description, {
46
- ...m,
47
+ ...h,
47
48
  render: /* @__PURE__ */ s(r, {
48
49
  size: e,
49
50
  font: n,
50
51
  weight: i,
51
52
  leading: a,
52
53
  truncate: o,
53
- color: c,
54
- ...p,
55
- className: l,
56
- style: d
54
+ wrap: c,
55
+ color: l,
56
+ ...m,
57
+ className: d,
58
+ style: f
57
59
  })
58
60
  });
59
61
  }
60
- function m({ children: n, match: a, size: u = "sm", font: d, weight: f, leading: p, truncate: m, color: h = "danger", className: g, style: _, ...v }) {
61
- let [y, b] = t(v), x = l.toArray(n).some((e) => e !== "");
62
+ function m({ children: n, match: a, size: u = "sm", font: d, weight: f, leading: p, truncate: m, wrap: h, color: g = "danger", className: _, style: v, ...y }) {
63
+ let [b, x] = t(y), S = l.toArray(n).some((e) => e !== "");
62
64
  return /* @__PURE__ */ c(r, {
63
65
  "aria-atomic": !0,
64
66
  "aria-live": "assertive",
@@ -68,14 +70,15 @@ function m({ children: n, match: a, size: u = "sm", font: d, weight: f, leading:
68
70
  weight: f,
69
71
  leading: p,
70
72
  truncate: m,
71
- color: h,
72
- ...y,
73
- className: e(i, g),
74
- style: _,
73
+ wrap: h,
74
+ color: g,
75
+ ...b,
76
+ className: e(i, _),
77
+ style: v,
75
78
  children: [/* @__PURE__ */ s(o, {
76
- ...b,
77
- ...x && { children: n },
78
- match: a ?? (x || void 0),
79
+ ...x,
80
+ ...S && { children: n },
81
+ match: a ?? (S || void 0),
79
82
  size: u
80
83
  }), "​"]
81
84
  });
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.badge, components.button, components.chip, components.field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.toast;
2
- @layer components.multiselect{._1seauxl0{text-align:start;justify-content:stretch}._1seauxl0>span{flex:auto;justify-items:stretch;min-inline-size:0}._1seauxl0>span>span{min-inline-size:0}._1seauxl0>span>span>span:first-child{flex:auto;min-inline-size:0}._1seauxl1{min-inline-size:0;display:block}._1seauxl1[data-placeholder]{color:var(--color-fg-muted)}._1seauxl2{min-inline-size:0;display:grid}._1seauxl3{text-overflow:ellipsis;white-space:nowrap;grid-area:1/1;overflow:hidden}._1seauxl3[aria-hidden=true]{visibility:hidden}._1seauxl4{text-overflow:ellipsis;white-space:nowrap;grid-area:1/1;overflow:hidden}._1seauxl5{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl5[data-starting-style],._1seauxl5[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl6{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl6[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl6[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl7{visibility:hidden;flex-shrink:0}._1seauxl6[aria-selected=true] ._1seauxl7{visibility:visible}@media (forced-colors:active){._1seauxl6[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl6[aria-disabled=true]{color:graytext}}}
2
+ @layer components.multiselect{._1seauxl0{text-align:start;justify-content:stretch}:where(._1seauxl0) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl0) ._1gwwloa1{min-inline-size:0}:where(._1seauxl0) ._1gwwloa2{flex:auto;min-inline-size:0}._1seauxl1{min-inline-size:0;display:block}._1seauxl1[data-placeholder]{color:var(--color-fg-muted)}._1seauxl2{min-inline-size:0;display:grid}._1seauxl3{grid-area:1/1}._1seauxl3[aria-hidden=true]{visibility:hidden}._1seauxl4{grid-area:1/1}._1seauxl5{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl5[data-starting-style],._1seauxl5[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl6{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl6[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl6[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl7{visibility:hidden;flex-shrink:0}._1seauxl6[aria-selected=true] ._1seauxl7{visibility:visible}@media (forced-colors:active){._1seauxl6[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl6[aria-disabled=true]{color:graytext}}}
@@ -1,93 +1,96 @@
1
1
  "use client";
2
2
  import { Box as e } from "../Box/index.mjs";
3
- import { PopupScope as t, triggerElement as n, usePopupScope as r } from "../popup/client.mjs";
4
- import { Field as i } from "../Field/index.mjs";
5
- import { ChevronDownIcon as a } from "../icons/ChevronDownIcon.mjs";
6
- import { labels as o, popup as s, summary as c, trigger as l, value as u } from "./MultiSelect.css.mjs";
7
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
- import { createContext as p, use as m, useId as h, useLayoutEffect as g, useMemo as _, useRef as v, useState as y } from "react";
9
- import { Select as b } from "@base-ui/react/select";
3
+ import { Text as t } from "../Text/index.mjs";
4
+ import { PopupScope as n, triggerElement as r, usePopupScope as i } from "../popup/client.mjs";
5
+ import { Field as a } from "../Field/index.mjs";
6
+ import { ChevronDownIcon as o } from "../icons/ChevronDownIcon.mjs";
7
+ import { labels as s, popup as c, summary as l, trigger as u, value as d } from "./MultiSelect.css.mjs";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { createContext as m, use as h, useId as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
10
+ import { Select as x } from "@base-ui/react/select";
10
11
  //#region src/MultiSelect/client.tsx
11
- function x({ options: e, placeholder: t, countLabel: i, disabled: o }) {
12
- let { ref: s } = r(), c = _(() => new Map(e.map((e) => [e.value, e.label])), [e]);
13
- return /* @__PURE__ */ d(b.Trigger, {
14
- disabled: o,
12
+ function S({ options: e, placeholder: t, countLabel: n, disabled: a }) {
13
+ let { ref: s } = i(), c = v(() => new Map(e.map((e) => [e.value, e.label])), [e]);
14
+ return /* @__PURE__ */ f(x.Trigger, {
15
+ disabled: a,
15
16
  ref: s,
16
- render: n({
17
+ render: r({
17
18
  variant: "secondary",
18
- iconEnd: a,
19
- className: l,
20
- children: /* @__PURE__ */ d(b.Value, {
21
- className: u,
19
+ iconEnd: o,
20
+ className: u,
21
+ children: /* @__PURE__ */ f(x.Value, {
22
+ className: d,
22
23
  placeholder: t,
23
- children: (e) => e.length > 0 ? /* @__PURE__ */ d(S, {
24
- count: i.replaceAll("{count}", String(e.length)),
24
+ children: (e) => e.length > 0 ? /* @__PURE__ */ f(C, {
25
+ count: n.replaceAll("{count}", String(e.length)),
25
26
  labels: e.map((e) => c.get(e) ?? e)
26
27
  }) : t
27
28
  })
28
29
  })
29
30
  });
30
31
  }
31
- function S({ labels: t, count: n }) {
32
- let r = v(null), [i, a] = y(!0), s = t.join(", ");
33
- g(() => {
34
- let e = r.current;
32
+ function C({ labels: n, count: r }) {
33
+ let i = y(null), [a, o] = b(!0), c = n.join(", ");
34
+ _(() => {
35
+ let e = i.current;
35
36
  if (!e) return;
36
- let t = () => a(e.scrollWidth <= e.clientWidth);
37
+ let t = () => o(e.scrollWidth <= e.clientWidth);
37
38
  t(), document.fonts?.ready.then(t);
38
39
  let n = new ResizeObserver(t);
39
40
  return n.observe(e), () => n.disconnect();
40
- }, [s]);
41
- let l = !i && t.length > 1;
42
- return /* @__PURE__ */ f(e, {
41
+ }, [c]);
42
+ let u = !a && n.length > 1;
43
+ return /* @__PURE__ */ p(e, {
43
44
  as: "span",
44
- className: c,
45
- children: [/* @__PURE__ */ d(e, {
46
- "aria-hidden": l || void 0,
45
+ className: l,
46
+ children: [/* @__PURE__ */ f(t, {
47
+ "aria-hidden": u || void 0,
47
48
  as: "span",
48
- className: o,
49
- ref: r,
50
- children: s
51
- }), l && /* @__PURE__ */ d(e, {
49
+ className: s,
50
+ ref: i,
51
+ truncate: "box",
52
+ children: c
53
+ }), u && /* @__PURE__ */ f(t, {
52
54
  as: "span",
53
55
  className: "_1seauxl4",
54
- children: n
56
+ truncate: "box",
57
+ children: r
55
58
  })]
56
59
  });
57
60
  }
58
- var C = p(void 0);
59
- function w({ children: e }) {
60
- return /* @__PURE__ */ d(t, { children: /* @__PURE__ */ d(C, {
61
- value: h(),
61
+ var w = m(void 0);
62
+ function T({ children: e }) {
63
+ return /* @__PURE__ */ f(n, { children: /* @__PURE__ */ f(w, {
64
+ value: g(),
62
65
  children: e
63
66
  }) });
64
67
  }
65
- function T({ children: e }) {
66
- return /* @__PURE__ */ d(i.Label, {
67
- id: m(C),
68
+ function E({ children: e }) {
69
+ return /* @__PURE__ */ f(a.Label, {
70
+ id: h(w),
68
71
  nativeLabel: !1,
69
72
  children: e
70
73
  });
71
74
  }
72
- function E({ children: t }) {
73
- return /* @__PURE__ */ d(b.Popup, {
74
- "aria-labelledby": m(C),
75
- render: /* @__PURE__ */ d(e, {
75
+ function D({ children: t }) {
76
+ return /* @__PURE__ */ f(x.Popup, {
77
+ "aria-labelledby": h(w),
78
+ render: /* @__PURE__ */ f(e, {
76
79
  backgroundColor: "bgRaised",
77
80
  borderRadius: "med",
78
81
  boxShadow: "med",
79
- className: s,
82
+ className: c,
80
83
  padding: "4"
81
84
  }),
82
85
  children: t
83
86
  });
84
87
  }
85
- function D({ children: e }) {
86
- let { container: t } = r();
87
- return /* @__PURE__ */ d(b.Portal, {
88
+ function O({ children: e }) {
89
+ let { container: t } = i();
90
+ return /* @__PURE__ */ f(x.Portal, {
88
91
  container: t,
89
92
  children: e
90
93
  });
91
94
  }
92
95
  //#endregion
93
- export { T as MultiSelectLabel, E as MultiSelectPopup, D as MultiSelectPortal, w as MultiSelectScope, x as MultiSelectTrigger };
96
+ export { E as MultiSelectLabel, D as MultiSelectPopup, O as MultiSelectPortal, T as MultiSelectScope, S as MultiSelectTrigger };
@@ -9,7 +9,7 @@ export type TabsTabProps = PartProps<Omit<Tabs$1.Tab.Props, keyof TextOwnProps>>
9
9
  export type TabsPanelProps = PartProps<Tabs$1.Panel.Props>;
10
10
  declare function TabsRoot({ orientation, display, flexDirection, flexWrap, gap, className, style, ...props }: TabsProps): import("react").JSX.Element;
11
11
  declare function TabsList({ display, flexWrap, gap, position, className, style, ...props }: TabsListProps): import("react").JSX.Element;
12
- declare function TabsTab({ children, size, font, weight, leading, paddingInline, justifyContent, minBlockSize, position, color, className, style, ...props }: TabsTabProps): import("react").JSX.Element;
12
+ declare function TabsTab({ children, size, font, weight, leading, wrap, paddingInline, justifyContent, minBlockSize, position, color, className, style, ...props }: TabsTabProps): import("react").JSX.Element;
13
13
  declare function TabsPanel({ flexGrow, className, style, ...props }: TabsPanelProps): import("react").JSX.Element;
14
14
  export declare const Tabs: typeof TabsRoot & {
15
15
  List: typeof TabsList;
@@ -38,19 +38,19 @@ function p({ display: r = "flex", flexWrap: i = "wrap", gap: a = "4", position:
38
38
  })
39
39
  });
40
40
  }
41
- function m({ children: o, size: s = "sm", font: f = "label", weight: p = "medium", leading: m, paddingInline: h = "12", justifyContent: g = "start", minBlockSize: _ = "med", position: v = "relative", color: y = "fgMuted", className: b, style: x, ...S }) {
42
- let [C, w] = t(S);
41
+ function m({ children: o, size: s = "sm", font: f = "label", weight: p = "medium", leading: m, wrap: h, paddingInline: g = "12", justifyContent: _ = "start", minBlockSize: v = "med", position: y = "relative", color: b = "fgMuted", className: x, style: S, ...C }) {
42
+ let [w, T] = t(C);
43
43
  return /* @__PURE__ */ u(d.Tab, {
44
- ...w,
44
+ ...T,
45
45
  render: /* @__PURE__ */ l(r, {
46
- color: y,
47
- justifyContent: g,
48
- minBlockSize: _,
49
- paddingInline: h,
50
- position: v,
51
- ...C,
52
- className: e(c, b),
53
- style: x
46
+ color: b,
47
+ justifyContent: _,
48
+ minBlockSize: v,
49
+ paddingInline: g,
50
+ position: y,
51
+ ...w,
52
+ className: e(c, x),
53
+ style: S
54
54
  }),
55
55
  children: [/* @__PURE__ */ l(i, {
56
56
  as: "span",
@@ -58,6 +58,7 @@ function m({ children: o, size: s = "sm", font: f = "label", weight: p = "medium
58
58
  font: f,
59
59
  weight: p,
60
60
  leading: m,
61
+ wrap: h,
61
62
  children: o
62
63
  }), /* @__PURE__ */ l(n, {
63
64
  "aria-hidden": !0,
package/dist/Tag/Tag.css CHANGED
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.badge, components.button, components.chip, components.field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.toast;
2
- @layer components.tag{._1jsyd8s0{border-width:var(--space-1);border-style:solid;border-color:#0000}._1jsyd8s1{overflow-wrap:anywhere}._1jsyd8s0:hover ._1jsyd8s1,._1jsyd8s0:focus-within ._1jsyd8s1{white-space:normal;text-overflow:clip;padding-block:var(--space-4);margin-block:0}._1jsyd8s2{text-decoration:underline}._1jsyd8s3:hover{background-color:var(--color-bg)}@media (forced-colors:active){._1jsyd8s0{color:canvastext;background-color:canvas;border-color:canvastext}}}
2
+ @layer components.tag{._1jsyd8s0{border-width:var(--space-1);border-style:solid;border-color:#0000}._1jsyd8s1{overflow-wrap:anywhere}._1jsyd8s0:hover ._1jsyd8s1,._1jsyd8s0:focus-within ._1jsyd8s1{padding-block:var(--space-4);margin-block:0}._1jsyd8s2{text-decoration:underline}._1jsyd8s3:hover{background-color:var(--color-bg)}@media (forced-colors:active){._1jsyd8s0{color:canvastext;background-color:canvas;border-color:canvastext}}}
@@ -54,6 +54,7 @@ function _({ size: a = "med", href: p, onRemove: m, removeLabel: _, display: v =
54
54
  borderRadius: w,
55
55
  className: e(c, l({ size: a }), O),
56
56
  color: E,
57
+ "data-text-reveal": "",
57
58
  display: v,
58
59
  gap: b,
59
60
  maxInlineSize: D,
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.badge, components.button, components.chip, components.field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.toast;
2
- @layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq4{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq5{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisq9{font-size:var(--font-size-xs)}._1mgdisqa{font-size:var(--font-size-sm)}._1mgdisqb{font-size:var(--font-size-med)}._1mgdisqc{font-size:var(--font-size-lg)}._1mgdisqd{font-size:var(--font-size-xl)}._1mgdisqe{font-size:var(--font-size-2xl)}._1mgdisqf{font-size:var(--font-size-3xl)}._1mgdisqg{font-size:var(--font-size-4xl)}._1mgdisqh{font-weight:var(--font-weight-regular)}._1mgdisqi{font-weight:var(--font-weight-medium)}._1mgdisqj{font-weight:var(--font-weight-semibold)}._1mgdisqk{font-weight:var(--font-weight-bold)}._1mgdisql{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqm{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqn{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqo{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}}
2
+ @layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq4{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq4:before,._1mgdisq4:after{content:none}._1mgdisq5{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqa{font-size:var(--font-size-xs)}._1mgdisqb{font-size:var(--font-size-sm)}._1mgdisqc{font-size:var(--font-size-med)}._1mgdisqd{font-size:var(--font-size-lg)}._1mgdisqe{font-size:var(--font-size-xl)}._1mgdisqf{font-size:var(--font-size-2xl)}._1mgdisqg{font-size:var(--font-size-3xl)}._1mgdisqh{font-size:var(--font-size-4xl)}._1mgdisqi{font-weight:var(--font-weight-regular)}._1mgdisqj{font-weight:var(--font-weight-medium)}._1mgdisqk{font-weight:var(--font-weight-semibold)}._1mgdisql{font-weight:var(--font-weight-bold)}._1mgdisqm{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqn{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqp{white-space:nowrap}._1mgdisqq{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisqq{white-space:normal;text-overflow:clip}}
@@ -3,30 +3,30 @@ import "./Text.css";
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  //#region src/Text/Text.css.ts
6
- var e = "_1mgdisq3", t = {
7
- body: "_1mgdisq4",
8
- heading: "_1mgdisq5",
9
- display: "_1mgdisq6",
10
- label: "_1mgdisq7",
11
- mono: "_1mgdisq8"
12
- }, n = {
13
- xs: "_1mgdisq9",
14
- sm: "_1mgdisqa",
15
- med: "_1mgdisqb",
16
- lg: "_1mgdisqc",
17
- xl: "_1mgdisqd",
18
- "2xl": "_1mgdisqe",
19
- "3xl": "_1mgdisqf",
20
- "4xl": "_1mgdisqg"
6
+ var e = "_1mgdisq3", t = "_1mgdisq4", n = {
7
+ body: "_1mgdisq5",
8
+ heading: "_1mgdisq6",
9
+ display: "_1mgdisq7",
10
+ label: "_1mgdisq8",
11
+ mono: "_1mgdisq9"
21
12
  }, r = {
22
- regular: "_1mgdisqh",
23
- medium: "_1mgdisqi",
24
- semibold: "_1mgdisqj",
25
- bold: "_1mgdisqk"
13
+ xs: "_1mgdisqa",
14
+ sm: "_1mgdisqb",
15
+ med: "_1mgdisqc",
16
+ lg: "_1mgdisqd",
17
+ xl: "_1mgdisqe",
18
+ "2xl": "_1mgdisqf",
19
+ "3xl": "_1mgdisqg",
20
+ "4xl": "_1mgdisqh"
26
21
  }, i = {
27
- sm: "_1mgdisql",
28
- med: "_1mgdisqm",
29
- lg: "_1mgdisqn"
30
- }, a = "_1mgdisqo";
22
+ regular: "_1mgdisqi",
23
+ medium: "_1mgdisqj",
24
+ semibold: "_1mgdisqk",
25
+ bold: "_1mgdisql"
26
+ }, a = {
27
+ sm: "_1mgdisqm",
28
+ med: "_1mgdisqn",
29
+ lg: "_1mgdisqo"
30
+ }, o = { nowrap: "_1mgdisqp" }, s = "_1mgdisqq";
31
31
  //#endregion
32
- export { t as font, i as leading, e as root, n as size, a as truncate, r as weight };
32
+ export { n as font, a as leading, e as root, r as size, s as truncate, t as truncateBox, i as weight, o as wrap };
@@ -8,9 +8,10 @@ export type TextOwnProps = {
8
8
  font?: FontRole;
9
9
  leading?: keyof typeof tokens.lineHeight;
10
10
  size?: keyof typeof tokens.fontSize;
11
- truncate?: boolean;
11
+ truncate?: boolean | "box";
12
12
  weight?: keyof typeof tokens.fontWeight;
13
+ wrap?: "nowrap";
13
14
  };
14
15
  export type TextProps<T extends ElementType = "p"> = PolymorphicProps<T, StyleProps & TextOwnProps>;
15
- export declare function Text<T extends ElementType = "p">({ as, size, font, weight, leading, truncate, display, overflow, className, ...props }: TextProps<T>): import("react").JSX.Element;
16
+ export declare function Text<T extends ElementType = "p">({ as, size, font, weight, leading, truncate, wrap, display, overflow, className, ...props }: TextProps<T>): import("react").JSX.Element;
16
17
  //#endregion
@@ -1,25 +1,27 @@
1
1
  import { join as e } from "../styles/join.mjs";
2
2
  import { Box as t } from "../Box/index.mjs";
3
- import { font as n, leading as r, root as i, size as a, weight as o } from "./Text.css.mjs";
4
- import { jsx as s } from "react/jsx-runtime";
3
+ import { font as n, leading as r, root as i, size as a, weight as o, wrap as s } from "./Text.css.mjs";
4
+ import { jsx as c } from "react/jsx-runtime";
5
5
  //#region src/Text/index.tsx
6
- function c({ as: c, size: l, font: u, weight: d, leading: f, truncate: p, display: m = "block", overflow: h = p ? "hidden" : void 0, className: g, ..._ }) {
7
- let v = [
6
+ function l({ as: l, size: u, font: d, weight: f, leading: p, truncate: m, wrap: h, display: g = "block", overflow: _ = m ? "hidden" : void 0, className: v, ...y }) {
7
+ let b = [
8
8
  i,
9
- u && n[u],
10
- l && a[l],
11
- d && o[d],
12
- f && r[f],
13
- p && "_1mgdisqo",
14
- g
9
+ m === "box" && "_1mgdisq4",
10
+ d && n[d],
11
+ u && a[u],
12
+ f && o[f],
13
+ p && r[p],
14
+ h && s[h],
15
+ m === !0 && "_1mgdisqq",
16
+ v
15
17
  ];
16
- return /* @__PURE__ */ s(t, {
17
- as: c ?? "p",
18
- display: m,
19
- overflow: h,
20
- ..._,
21
- className: e(...v)
18
+ return /* @__PURE__ */ c(t, {
19
+ as: l ?? "p",
20
+ display: g,
21
+ overflow: _,
22
+ ...y,
23
+ className: e(...b)
22
24
  });
23
25
  }
24
26
  //#endregion
25
- export { c as Text };
27
+ export { l as Text };
@@ -111,8 +111,9 @@ Also accepts the style props (see `manifest.json` `styleProps`).
111
111
  | `font` | `"body" \| "display" \| "heading" \| "label" \| "mono"` | no | |
112
112
  | `leading` | `"lg" \| "med" \| "sm"` | no | |
113
113
  | `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
114
- | `truncate` | `boolean` | no | |
114
+ | `truncate` | `"box" \| boolean` | no | |
115
115
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
116
+ | `wrap` | `"nowrap"` | no | |
116
117
 
117
118
  Also accepts the style props (see `manifest.json` `styleProps`).
118
119
 
@@ -124,8 +125,9 @@ Also accepts the style props (see `manifest.json` `styleProps`).
124
125
  | `leading` | `"lg" \| "med" \| "sm"` | no | |
125
126
  | `match` | `boolean \| keyof ValidityState` | no | Determines whether to show the error message according to the field's [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState). Specifying `true` will always show the error message, and lets external libraries control the visibility. |
126
127
  | `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
127
- | `truncate` | `boolean` | no | |
128
+ | `truncate` | `"box" \| boolean` | no | |
128
129
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
130
+ | `wrap` | `"nowrap"` | no | |
129
131
 
130
132
  Also accepts the style props (see `manifest.json` `styleProps`).
131
133
 
@@ -137,7 +139,8 @@ Also accepts the style props (see `manifest.json` `styleProps`).
137
139
  | `leading` | `"lg" \| "med" \| "sm"` | no | |
138
140
  | `nativeLabel` | `boolean` | no | Whether the component renders a native `<label>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a label (for example, `<div>`). This is useful to avoid inheriting label behaviors on `<button>` controls (such as `<Select.Trigger>` and `<Combobox.Trigger>`), including avoiding `:hover` on the button when hovering the label, and preventing clicks on the label from firing on the button. |
139
141
  | `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
140
- | `truncate` | `boolean` | no | |
142
+ | `truncate` | `"box" \| boolean` | no | |
141
143
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
144
+ | `wrap` | `"nowrap"` | no | |
142
145
 
143
146
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -63,7 +63,8 @@ Generated from the TypeScript types.
63
63
  | `font` | `"body" \| "display" \| "heading" \| "label" \| "mono"` | no | |
64
64
  | `leading` | `"lg" \| "med" \| "sm"` | no | |
65
65
  | `size` | `"2xl" \| "lg" \| "med" \| "sm" \| "xl"` | no | |
66
- | `truncate` | `boolean` | no | |
66
+ | `truncate` | `"box" \| boolean` | no | |
67
67
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
68
+ | `wrap` | `"nowrap"` | no | |
68
69
 
69
70
  Also accepts every `<h2>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
package/dist/docs/Tabs.md CHANGED
@@ -126,5 +126,6 @@ Also accepts the style props (see `manifest.json` `styleProps`).
126
126
  | `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
127
127
  | `value` | `any` | yes | The value of the Tab. |
128
128
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
129
+ | `wrap` | `"nowrap"` | no | |
129
130
 
130
131
  Also accepts the style props (see `manifest.json` `styleProps`).
package/dist/docs/Text.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading` and `truncate`.
5
+ The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
6
6
 
7
7
  ## When to use
8
8
 
@@ -27,6 +27,8 @@ The base of all visible text, and the primitive every text component builds on.
27
27
  - `leading` takes a unitless line height: `sm`, `med` (default) or `lg`. The trim follows it.
28
28
  - `color` takes a color role (`fg`, `fgMuted`, `accent`, …), never a raw color. Unset, it inherits.
29
29
  - `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It sets the block margins, so do not combine it with margin props.
30
+ - `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run.
31
+ - `wrap="nowrap"` keeps the text on one line, uncut: a short label that must never break. A long string overflows its box, so cap it with `truncate` instead.
30
32
  - The trim is two pseudo-elements; do not style `::before` or `::after` on a Text.
31
33
  - No native `text-box`; capsize only (ADR 0016).
32
34
 
@@ -47,6 +49,12 @@ The base of all visible text, and the primitive every text component builds on.
47
49
  </Text>
48
50
  ```
49
51
 
52
+ ```tsx
53
+ <Text as="span" font="label" size="sm" weight="medium" wrap="nowrap">
54
+ Beta
55
+ </Text>
56
+ ```
57
+
50
58
  ## Don't
51
59
 
52
60
  ```tsx
@@ -84,7 +92,8 @@ Generated from the TypeScript types.
84
92
  | `font` | `"body" \| "display" \| "heading" \| "label" \| "mono"` | no | |
85
93
  | `leading` | `"lg" \| "med" \| "sm"` | no | |
86
94
  | `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
87
- | `truncate` | `boolean` | no | |
95
+ | `truncate` | `"box" \| boolean` | no | |
88
96
  | `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
97
+ | `wrap` | `"nowrap"` | no | |
89
98
 
90
99
  Also accepts every `<p>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
@@ -23,7 +23,7 @@
23
23
  - [Stack](Stack.md): A vertical column of children with even space between them. `Stack` is a `Box` with `display="flex"` and `flexDirection="column"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
24
24
  - [Tabs](Tabs.md): Switches between views that share one place on the page. The parts are `Tabs` (the root, a flex column; a row when vertical), `Tabs.List` (the `tablist`), `Tabs.Tab` (a `tab` button on `Clickable`) and `Tabs.Panel` (the `tabpanel`). Built on Base UI `Tabs` (ADR 0003, 0046): it owns the selection, one tab stop with arrow-key roving, `aria-selected`, and the ids that tie each tab to its panel. The selected tab shows an accent bar that fades and grows in (ADR 0049).
25
25
  - [Tag](Tag.md): A label that puts content in a category: a topic, a label, a user-made category. A `span` with a `bgMuted` fill and an `lg` radius (half a one-line tag's height, so one line reads as a pill and wrapped lines stay inside the fill) around a `Text` in the `label` font. It can be read-only, a link, or removable.
26
- - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading` and `truncate`.
26
+ - [Text](Text.md): The base of all visible text, and the primitive every text component builds on. Capsize trims the box to the cap height and the baseline, so the gap around text is the visible space. It takes every Box style prop (`color`, `textAlign`, margins), plus `size`, `font`, `weight`, `leading`, `truncate` and `wrap`.
27
27
  - [Toast](Toast.md): Tells the user briefly about the result of an action without interrupting them: "Changes saved", "Message sent", "Couldn't upload the file". Material calls it a snackbar and Atlassian a flag. Built on Base UI's Toast, which owns the queue, the timers and swipe-to-dismiss. The parts add the look: a raised card in a stack at the bottom end corner, an icon per variant, a close button, and a slide-up-and-fade that is a plain fade under reduced motion. A toast never takes focus and moves nothing on the page.
28
28
 
29
29
  ## Reference
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -674,7 +674,7 @@
674
674
  },
675
675
  {
676
676
  "name": "truncate",
677
- "type": "boolean",
677
+ "type": "\"box\" | boolean",
678
678
  "required": false
679
679
  },
680
680
  {
@@ -687,6 +687,14 @@
687
687
  "regular",
688
688
  "semibold"
689
689
  ]
690
+ },
691
+ {
692
+ "name": "wrap",
693
+ "type": "\"nowrap\"",
694
+ "required": false,
695
+ "values": [
696
+ "nowrap"
697
+ ]
690
698
  }
691
699
  ]
692
700
  },
@@ -739,7 +747,7 @@
739
747
  },
740
748
  {
741
749
  "name": "truncate",
742
- "type": "boolean",
750
+ "type": "\"box\" | boolean",
743
751
  "required": false
744
752
  },
745
753
  {
@@ -752,6 +760,14 @@
752
760
  "regular",
753
761
  "semibold"
754
762
  ]
763
+ },
764
+ {
765
+ "name": "wrap",
766
+ "type": "\"nowrap\"",
767
+ "required": false,
768
+ "values": [
769
+ "nowrap"
770
+ ]
755
771
  }
756
772
  ]
757
773
  },
@@ -804,7 +820,7 @@
804
820
  },
805
821
  {
806
822
  "name": "truncate",
807
- "type": "boolean",
823
+ "type": "\"box\" | boolean",
808
824
  "required": false
809
825
  },
810
826
  {
@@ -817,6 +833,14 @@
817
833
  "regular",
818
834
  "semibold"
819
835
  ]
836
+ },
837
+ {
838
+ "name": "wrap",
839
+ "type": "\"nowrap\"",
840
+ "required": false,
841
+ "values": [
842
+ "nowrap"
843
+ ]
820
844
  }
821
845
  ]
822
846
  }
@@ -876,7 +900,7 @@
876
900
  },
877
901
  {
878
902
  "name": "truncate",
879
- "type": "boolean",
903
+ "type": "\"box\" | boolean",
880
904
  "required": false
881
905
  },
882
906
  {
@@ -889,6 +913,14 @@
889
913
  "regular",
890
914
  "semibold"
891
915
  ]
916
+ },
917
+ {
918
+ "name": "wrap",
919
+ "type": "\"nowrap\"",
920
+ "required": false,
921
+ "values": [
922
+ "nowrap"
923
+ ]
892
924
  }
893
925
  ],
894
926
  "element": "h2",
@@ -1677,6 +1709,14 @@
1677
1709
  "regular",
1678
1710
  "semibold"
1679
1711
  ]
1712
+ },
1713
+ {
1714
+ "name": "wrap",
1715
+ "type": "\"nowrap\"",
1716
+ "required": false,
1717
+ "values": [
1718
+ "nowrap"
1719
+ ]
1680
1720
  }
1681
1721
  ]
1682
1722
  }
@@ -1763,7 +1803,7 @@
1763
1803
  },
1764
1804
  {
1765
1805
  "name": "truncate",
1766
- "type": "boolean",
1806
+ "type": "\"box\" | boolean",
1767
1807
  "required": false
1768
1808
  },
1769
1809
  {
@@ -1776,6 +1816,14 @@
1776
1816
  "regular",
1777
1817
  "semibold"
1778
1818
  ]
1819
+ },
1820
+ {
1821
+ "name": "wrap",
1822
+ "type": "\"nowrap\"",
1823
+ "required": false,
1824
+ "values": [
1825
+ "nowrap"
1826
+ ]
1779
1827
  }
1780
1828
  ],
1781
1829
  "element": "p",
@@ -57,3 +57,5 @@ A provider's `color-scheme` stops at its `div`, so the page canvas and scrollbar
57
57
  ## Fonts
58
58
 
59
59
  A brand declares its fonts; the app loads them (fontsource or self-hosted `@font-face`) and owns preloading. The `default` brand uses Inter and JetBrains Mono. In development, `ThemeProvider` warns in the console when a brand font has no `@font-face` or fails to load; in production it renders no check and the check's body is dead code.
60
+
61
+ Until a web font loads, text renders in a fallback face sized to the web font's cap height, so the trim holds where the fallback font (Arial, Courier New) is installed; elsewhere the generic family renders unadjusted. Widths still differ: in the `default` brand, `mono` text is about 28% wider than JetBrains Mono, so expect code to overflow or wrap until the font loads. Where width matters, preload the mono font and load it with `font-display: block` (or `optional`, which may keep the fallback for that page view); a custom brand's gap depends on its own fallback.
@@ -0,0 +1,4 @@
1
+ //#region src/styles/button-parts.css.ts
2
+ var e = "_1gwwloa0", t = "_1gwwloa1", n = "_1gwwloa2";
3
+ //#endregion
4
+ export { t as content, n as label, e as stack };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonmilner/ui",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "files": [
5
5
  "dist",
6
6
  "THIRD_PARTY_NOTICES.md"