@jonmilner/ui 0.13.0 → 0.13.1

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.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
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}}}
2
+ @layer components.badge{._1ixfil10{border-width:var(--space-1);border-style:solid;border-color:#0000}._1ixfil1d{vertical-align:calc((1cap - var(--font-size-xs)) / 2);margin-inline-end:var(--space-4);display:inline-block}._1ixfil1e{vertical-align:calc((1cap - var(--font-size-sm)) / 2);margin-inline-end:var(--space-4);display:inline-block}._1ixfil1f{vertical-align:calc((1cap - var(--font-size-med)) / 2);margin-inline-end:var(--space-8);display:inline-block}._1ixfil1g{vertical-align:calc((1cap - var(--font-size-xs)) / 2);margin-inline-start:var(--space-4);display:inline-block}._1ixfil1h{vertical-align:calc((1cap - var(--font-size-sm)) / 2);margin-inline-start:var(--space-4);display:inline-block}._1ixfil1i{vertical-align:calc((1cap - var(--font-size-med)) / 2);margin-inline-start:var(--space-8);display:inline-block}._1ixfil1j{vertical-align:top;max-inline-size:calc(100% - var(--font-size-xs) - var(--space-4));display:inline-block}._1ixfil1k{vertical-align:top;max-inline-size:calc(100% - var(--font-size-sm) - var(--space-4));display:inline-block}._1ixfil1l{vertical-align:top;max-inline-size:calc(100% - var(--font-size-med) - var(--space-8));display:inline-block}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1ixfil1m{max-inline-size:none;display:inline}@media (forced-colors:active){._1ixfil10{color:canvastext;background-color:canvas;border-color:canvastext}}}
@@ -27,5 +27,22 @@ var t = "_1ixfil10", n = e({
27
27
  },
28
28
  defaultVariants: {},
29
29
  compoundVariants: []
30
- });
31
- export { n as badge, t as root };
30
+ }), r = {
31
+ start: {
32
+ xs: "_1ixfil1d",
33
+ sm: "_1ixfil1e",
34
+ med: "_1ixfil1f"
35
+ },
36
+ end: {
37
+ xs: "_1ixfil1g",
38
+ sm: "_1ixfil1h",
39
+ med: "_1ixfil1i"
40
+ },
41
+ clip: {
42
+ xs: "_1ixfil1j",
43
+ sm: "_1ixfil1k",
44
+ med: "_1ixfil1l"
45
+ },
46
+ reveal: "_1ixfil1m"
47
+ };
48
+ export { n as badge, t as root, r as slot };
@@ -1,11 +1,12 @@
1
1
  import { OmitEach } from "../types.mjs";
2
2
  import { StyleProps } from "../Box/base.mjs";
3
+ import { IconSlotProps } from "../icon-slot/slot.mjs";
3
4
  import { Tone } from "../styles/subtle-fills.mjs";
4
5
  import { ComponentPropsWithRef } from "react";
5
- export type BadgeOwnProps = {
6
+ export type BadgeOwnProps = IconSlotProps & {
6
7
  size?: "xs" | "sm" | "med";
7
8
  subtle?: boolean;
8
9
  variant?: Tone;
9
10
  };
10
11
  export type BadgeProps = StyleProps & BadgeOwnProps & OmitEach<ComponentPropsWithRef<"span">, keyof StyleProps | keyof BadgeOwnProps>;
11
- export declare function Badge({ variant, subtle, size, display, paddingInline, paddingBlock, borderRadius, backgroundColor, color, className, children, ...props }: BadgeProps): import("react").JSX.Element | null;
12
+ export declare function Badge({ variant, subtle, size, iconStart, iconEnd, display, paddingInline, paddingBlock, borderRadius, backgroundColor, color, maxInlineSize, className, style, children, ...props }: BadgeProps): import("react").JSX.Element | null;
@@ -1,11 +1,13 @@
1
1
  import { join as e } from "../styles/join.mjs";
2
2
  import { Box as t } from "../Box/base.mjs";
3
3
  import { Text as n } from "../Text/index.mjs";
4
- import { subtleFills as r } from "../styles/subtle-fills.mjs";
5
- import { badge as i, root as a } from "./Badge.css.mjs";
6
- import { jsx as o } from "react/jsx-runtime";
4
+ import { slotIcons as r } from "../icon-slot/slot.mjs";
5
+ import { capped as i } from "../styles/capped.mjs";
6
+ import { subtleFills as a } from "../styles/subtle-fills.mjs";
7
+ import { badge as o, root as s, slot as c } from "./Badge.css.mjs";
8
+ import { jsx as l } from "react/jsx-runtime";
7
9
  // src/Badge/index.tsx
8
- var s = {
10
+ var u = {
9
11
  neutral: {
10
12
  backgroundColor: "bgMuted",
11
13
  color: "fgMuted"
@@ -30,7 +32,7 @@ var s = {
30
32
  backgroundColor: "done",
31
33
  color: "doneFg"
32
34
  }
33
- }, c = {
35
+ }, d = {
34
36
  xs: {
35
37
  paddingInline: "4",
36
38
  paddingBlock: "2"
@@ -44,29 +46,41 @@ var s = {
44
46
  paddingBlock: "6"
45
47
  }
46
48
  };
47
- function l({ variant: l = "neutral", subtle: u = !1, size: d = "med", display: f = "inline-block", paddingInline: p = c[d].paddingInline, paddingBlock: m = c[d].paddingBlock, borderRadius: h = "sm", backgroundColor: g = (u ? r : s)[l].backgroundColor, color: _ = (u ? r : s)[l].color, className: v, children: y, ...b }) {
48
- return y == null || typeof y == "boolean" || y === "" ? null : /* @__PURE__ */ o(t, {
49
- ...b,
49
+ function f({ variant: f = "neutral", subtle: p = !1, size: m = "med", iconStart: h, iconEnd: g, display: _ = "inline-block", paddingInline: v = d[m].paddingInline, paddingBlock: y = d[m].paddingBlock, borderRadius: b = "sm", backgroundColor: x = (p ? a : u)[f].backgroundColor, color: S = (p ? a : u)[f].color, maxInlineSize: C, className: w, style: T, children: E, ...D }) {
50
+ if (E == null || typeof E == "boolean" || E === "") return null;
51
+ let O = i(C, T);
52
+ return /* @__PURE__ */ l(t, {
53
+ ...D,
50
54
  as: "span",
51
- backgroundColor: g,
52
- borderRadius: h,
53
- className: e(a, i({
54
- variant: l,
55
- subtle: u,
56
- size: d
57
- }), v),
58
- color: _,
59
- display: f,
60
- paddingBlock: m,
61
- paddingInline: p,
62
- children: /* @__PURE__ */ o(n, {
55
+ backgroundColor: x,
56
+ borderRadius: b,
57
+ className: e(s, o({
58
+ variant: f,
59
+ subtle: p,
60
+ size: m
61
+ }), w),
62
+ color: S,
63
+ display: _,
64
+ maxInlineSize: C,
65
+ paddingBlock: y,
66
+ paddingInline: v,
67
+ style: T,
68
+ children: /* @__PURE__ */ l(n, {
63
69
  as: "span",
64
70
  font: "label",
65
- size: d,
71
+ size: m,
72
+ truncate: O,
66
73
  weight: "medium",
67
74
  wrap: "nowrap",
68
- children: y
75
+ children: r({
76
+ iconStart: h,
77
+ iconEnd: g,
78
+ size: m,
79
+ styles: c,
80
+ truncate: O,
81
+ children: E
82
+ })
69
83
  })
70
84
  });
71
85
  }
72
- export { l as Badge };
86
+ export { f as Badge };
@@ -1,11 +1,9 @@
1
1
  import { PolymorphicProps } from "../types.mjs";
2
2
  import { StyleProps } from "../Box/base.mjs";
3
3
  import { ClickableOwnProps } from "../Clickable/index.mjs";
4
- import { IconProps } from "../Icon/index.mjs";
5
- import { ComponentType, ElementType } from "react";
6
- export type ButtonOwnProps = {
7
- iconEnd?: ComponentType<IconProps>;
8
- iconStart?: ComponentType<IconProps>;
4
+ import { IconSlotProps } from "../icon-slot/slot.mjs";
5
+ import { ElementType } from "react";
6
+ export type ButtonOwnProps = IconSlotProps & {
9
7
  loading?: boolean;
10
8
  size?: "sm" | "med" | "lg";
11
9
  variant?: "primary" | "secondary" | "ghost" | "danger";
@@ -2,90 +2,88 @@ import { join as e } from "../styles/join.mjs";
2
2
  import { Box as t } from "../Box/base.mjs";
3
3
  import { Clickable as n } from "../Clickable/index.mjs";
4
4
  import { Icon as r } from "../Icon/index.mjs";
5
- import { fills as i } from "../styles/button-fills.mjs";
6
- import { content as a, stack as o } from "../styles/button-parts.css.mjs";
7
- import { controlHeight as s, controlText as c } from "../styles/control-size.mjs";
8
- import { Text as l } from "../Text/index.mjs";
9
- import { button as u, content as d, root as f, stack as p } from "./Button.css.mjs";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
5
+ import { iconGap as i } from "../icon-slot/gap.mjs";
6
+ import { fills as a } from "../styles/button-fills.mjs";
7
+ import { content as o, stack as s } from "../styles/button-parts.css.mjs";
8
+ import { controlHeight as c, controlText as l } from "../styles/control-size.mjs";
9
+ import { Text as u } from "../Text/index.mjs";
10
+ import { button as d, content as f, root as p, stack as m } from "./Button.css.mjs";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
12
  // src/Button/index.tsx
12
- var g = {
13
+ var _ = {
13
14
  sm: {
14
- minBlockSize: s.sm,
15
+ minBlockSize: c.sm,
15
16
  paddingBlock: "4",
16
- paddingInline: "8",
17
- gap: "4"
17
+ paddingInline: "8"
18
18
  },
19
19
  med: {
20
- minBlockSize: s.med,
20
+ minBlockSize: c.med,
21
21
  paddingBlock: "6",
22
- paddingInline: "12",
23
- gap: "4"
22
+ paddingInline: "12"
24
23
  },
25
24
  lg: {
26
- minBlockSize: s.lg,
25
+ minBlockSize: c.lg,
27
26
  paddingBlock: "8",
28
- paddingInline: "16",
29
- gap: "8"
27
+ paddingInline: "16"
30
28
  }
31
29
  };
32
- function _({ variant: s = "secondary", size: _ = "med", loading: v = !1, iconStart: y, iconEnd: b, minBlockSize: x = g[_].minBlockSize, paddingBlock: S = g[_].paddingBlock, paddingInline: C = g[_].paddingInline, gap: w = g[_].gap, borderRadius: T = "full", backgroundColor: E = i[s].backgroundColor, color: D = i[s].color, className: O, children: k, "aria-busy": A, ...j }) {
33
- let M = v || String(A) === "true", N = j, P = c[_];
34
- return /* @__PURE__ */ m(n, {
35
- ...N,
36
- backgroundColor: E,
37
- borderRadius: T,
38
- busy: M,
39
- className: e(f, u({
40
- variant: s,
41
- size: _
42
- }), O),
43
- color: D,
44
- minBlockSize: x,
45
- paddingBlock: S,
46
- paddingInline: C,
47
- children: /* @__PURE__ */ h(t, {
30
+ function v({ variant: c = "secondary", size: v = "med", loading: y = !1, iconStart: b, iconEnd: x, minBlockSize: S = _[v].minBlockSize, paddingBlock: C = _[v].paddingBlock, paddingInline: w = _[v].paddingInline, gap: T = i[l[v]], borderRadius: E = "full", backgroundColor: D = a[c].backgroundColor, color: O = a[c].color, className: k, children: A, "aria-busy": j, ...M }) {
31
+ let N = y || String(j) === "true", P = M, F = l[v];
32
+ return /* @__PURE__ */ h(n, {
33
+ ...P,
34
+ backgroundColor: D,
35
+ borderRadius: E,
36
+ busy: N,
37
+ className: e(p, d({
38
+ variant: c,
39
+ size: v
40
+ }), k),
41
+ color: O,
42
+ minBlockSize: S,
43
+ paddingBlock: C,
44
+ paddingInline: w,
45
+ children: /* @__PURE__ */ g(t, {
48
46
  alignItems: "center",
49
47
  as: "span",
50
- className: e(p, o),
48
+ className: e(m, s),
51
49
  display: "grid",
52
- children: [/* @__PURE__ */ h(t, {
50
+ children: [/* @__PURE__ */ g(t, {
53
51
  alignItems: "center",
54
52
  as: "span",
55
- className: e(d, a),
53
+ className: e(f, o),
56
54
  display: "flex",
57
- gap: w,
55
+ gap: T,
58
56
  children: [
59
- y && /* @__PURE__ */ m(y, { size: P }),
60
- k != null && k !== !1 && k !== "" && /* @__PURE__ */ m(l, {
57
+ b && /* @__PURE__ */ h(b, { size: F }),
58
+ A != null && A !== !1 && A !== "" && /* @__PURE__ */ h(u, {
61
59
  as: "span",
62
60
  className: e("hkhd89", "_1gwwloa2"),
63
61
  font: "label",
64
- size: P,
62
+ size: F,
65
63
  weight: "bold",
66
- children: k
64
+ children: A
67
65
  }),
68
- b && /* @__PURE__ */ m(b, { size: P })
66
+ x && /* @__PURE__ */ h(x, { size: F })
69
67
  ]
70
- }), M && /* @__PURE__ */ h(r, {
68
+ }), N && /* @__PURE__ */ g(r, {
71
69
  className: "hkhd8d",
72
70
  fill: "currentColor",
73
- size: P,
71
+ size: F,
74
72
  stroke: "none",
75
73
  children: [
76
- /* @__PURE__ */ m("circle", {
74
+ /* @__PURE__ */ h("circle", {
77
75
  className: "hkhd8e",
78
76
  cx: "5",
79
77
  cy: "12",
80
78
  r: "2"
81
79
  }),
82
- /* @__PURE__ */ m("circle", {
80
+ /* @__PURE__ */ h("circle", {
83
81
  className: "hkhd8e",
84
82
  cx: "12",
85
83
  cy: "12",
86
84
  r: "2"
87
85
  }),
88
- /* @__PURE__ */ m("circle", {
86
+ /* @__PURE__ */ h("circle", {
89
87
  className: "hkhd8e",
90
88
  cx: "19",
91
89
  cy: "12",
@@ -96,4 +94,4 @@ function _({ variant: s = "secondary", size: _ = "med", loading: v = !1, iconSta
96
94
  })
97
95
  });
98
96
  }
99
- export { _ as Button };
97
+ export { v as Button };
package/dist/Tag/Tag.css CHANGED
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
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}}}
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)}._1jsyd8sd{vertical-align:calc((1cap - var(--font-size-sm)) / 2);margin-inline-end:var(--space-4);display:inline-block}._1jsyd8se{vertical-align:calc((1cap - var(--font-size-med)) / 2);margin-inline-end:var(--space-8);display:inline-block}._1jsyd8sf{vertical-align:calc((1cap - var(--font-size-sm)) / 2);margin-inline-start:var(--space-4);display:inline-block}._1jsyd8sg{vertical-align:calc((1cap - var(--font-size-med)) / 2);margin-inline-start:var(--space-8);display:inline-block}._1jsyd8sh{vertical-align:top;max-inline-size:calc(100% - var(--font-size-sm) - var(--space-4));display:inline-block}._1jsyd8si{vertical-align:top;max-inline-size:calc(100% - var(--font-size-med) - var(--space-8));display:inline-block}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1jsyd8sj{max-inline-size:none;display:inline}@media (forced-colors:active){._1jsyd8s0{color:canvastext;background-color:canvas;border-color:canvastext}}}
@@ -22,5 +22,19 @@ var t = "_1jsyd8s0", n = "_1jsyd8s1", r = "_1jsyd8s2", i = "_1jsyd8s3", a = e({
22
22
  },
23
23
  defaultVariants: {},
24
24
  compoundVariants: []
25
- });
26
- export { n as label, r as link, i as remove, t as root, a as tag };
25
+ }), o = {
26
+ start: {
27
+ sm: "_1jsyd8sd",
28
+ med: "_1jsyd8se"
29
+ },
30
+ end: {
31
+ sm: "_1jsyd8sf",
32
+ med: "_1jsyd8sg"
33
+ },
34
+ clip: {
35
+ sm: "_1jsyd8sh",
36
+ med: "_1jsyd8si"
37
+ },
38
+ reveal: "_1jsyd8sj"
39
+ };
40
+ export { n as label, r as link, i as remove, t as root, o as slot, a as tag };
@@ -1,8 +1,9 @@
1
1
  import { OmitEach } from "../types.mjs";
2
2
  import { StyleProps } from "../Box/base.mjs";
3
+ import { IconSlotProps } from "../icon-slot/slot.mjs";
3
4
  import { Tone } from "../styles/subtle-fills.mjs";
4
5
  import { ComponentPropsWithRef } from "react";
5
- export type TagOwnProps = {
6
+ export type TagOwnProps = IconSlotProps & {
6
7
  href?: string;
7
8
  onRemove?: () => void;
8
9
  removeLabel?: string;
@@ -10,4 +11,4 @@ export type TagOwnProps = {
10
11
  variant?: Tone;
11
12
  };
12
13
  export type TagProps = StyleProps & TagOwnProps & OmitEach<ComponentPropsWithRef<"span">, keyof StyleProps | keyof TagOwnProps>;
13
- export declare function Tag({ variant, size, href, onRemove, removeLabel, display, alignItems, gap, minBlockSize, paddingInlineStart, paddingInlineEnd, borderRadius, backgroundColor, color, maxInlineSize, className, style, children, ...props }: TagProps): import("react").JSX.Element | null;
14
+ export declare function Tag({ variant, size, href, iconStart, iconEnd, onRemove, removeLabel, display, alignItems, gap, minBlockSize, paddingInlineStart, paddingInlineEnd, borderRadius, backgroundColor, color, maxInlineSize, className, style, children, ...props }: TagProps): import("react").JSX.Element | null;
@@ -2,30 +2,20 @@ import { join as e } from "../styles/join.mjs";
2
2
  import { Box as t } from "../Box/base.mjs";
3
3
  import { Clickable as n } from "../Clickable/index.mjs";
4
4
  import { Text as r } from "../Text/index.mjs";
5
- import { subtleFills as i } from "../styles/subtle-fills.mjs";
6
- import { XIcon as a } from "../icons/XIcon.mjs";
7
- import { size as o } from "../tokens/scales.mjs";
8
- import { label as s, link as c, root as l, tag as u } from "./Tag.css.mjs";
9
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { slotIcons as i } from "../icon-slot/slot.mjs";
6
+ import { capped as a } from "../styles/capped.mjs";
7
+ import { subtleFills as o } from "../styles/subtle-fills.mjs";
8
+ import { XIcon as s } from "../icons/XIcon.mjs";
9
+ import { label as c, link as l, root as u, slot as d, tag as f } from "./Tag.css.mjs";
10
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
11
  // src/Tag/index.tsx
11
- function p(e) {
12
+ function h(e) {
12
13
  if (typeof e == "string" || typeof e == "number") return String(e);
13
14
  if (!Array.isArray(e)) return;
14
- let t = e.map(p);
15
+ let t = e.map(h);
15
16
  return t.every((e) => e !== void 0) ? t.join("") : void 0;
16
17
  }
17
- var m = /* @__PURE__ */ new Set([...Object.keys(o), "full"]), h = /* @__PURE__ */ new Set([
18
- "",
19
- "none",
20
- "auto",
21
- "initial",
22
- "unset"
23
- ]);
24
- function g(e, t) {
25
- let n = t?.maxInlineSize ?? t?.maxWidth;
26
- return n == null ? typeof e != "object" || !e ? m.has(e) : e.base != null && Object.values(e).every((e) => e == null || m.has(e)) : !h.has(String(n).trim()) && !/-content\b/.test(String(n));
27
- }
28
- var _ = {
18
+ var g = {
29
19
  sm: {
30
20
  paddingInlineStart: "6",
31
21
  paddingInlineEnd: "6"
@@ -35,52 +25,59 @@ var _ = {
35
25
  paddingInlineEnd: "8"
36
26
  }
37
27
  };
38
- function v({ variant: o = "neutral", size: m = "med", href: h, onRemove: v, removeLabel: y, display: b = "inline-flex", alignItems: x = "center", gap: S = "2", minBlockSize: C = "xs", paddingInlineStart: w = _[m].paddingInlineStart, paddingInlineEnd: T = v ? "2" : _[m].paddingInlineEnd, borderRadius: E = "lg", backgroundColor: D = i[o].backgroundColor, color: O = i[o].color, maxInlineSize: k, className: A, style: j, children: M, ...N }) {
39
- if (M == null || typeof M == "boolean" || M === "" || p(M) === "") return null;
40
- let P = g(k, j), F = /* @__PURE__ */ d(r, {
28
+ function _({ variant: _ = "neutral", size: v = "med", href: y, iconStart: b, iconEnd: x, onRemove: S, removeLabel: C, display: w = "inline-flex", alignItems: T = "center", gap: E = "2", minBlockSize: D = "xs", paddingInlineStart: O = g[v].paddingInlineStart, paddingInlineEnd: k = S ? "2" : g[v].paddingInlineEnd, borderRadius: A = "lg", backgroundColor: j = o[_].backgroundColor, color: M = o[_].color, maxInlineSize: N, className: P, style: F, children: I, ...L }) {
29
+ if (I == null || typeof I == "boolean" || I === "" || h(I) === "") return null;
30
+ let R = a(N, F), z = /* @__PURE__ */ p(r, {
41
31
  as: "span",
42
- className: s,
32
+ className: c,
43
33
  font: "label",
44
- paddingBlock: P ? void 0 : "4",
45
- size: m,
46
- truncate: P,
34
+ paddingBlock: R ? void 0 : "4",
35
+ size: v,
36
+ truncate: R,
47
37
  weight: "medium",
48
- children: M
49
- }), I = p(M), L = y ?? (I === void 0 ? void 0 : `Remove ${I}`);
50
- return /* @__PURE__ */ f(t, {
51
- ...N,
52
- alignItems: x,
38
+ children: i({
39
+ iconStart: b,
40
+ iconEnd: x,
41
+ size: v,
42
+ styles: d,
43
+ truncate: R,
44
+ children: I
45
+ })
46
+ }), B = h(I), V = C ?? (B === void 0 ? void 0 : `Remove ${B}`);
47
+ return /* @__PURE__ */ m(t, {
48
+ ...L,
49
+ alignItems: T,
53
50
  as: "span",
54
- backgroundColor: D,
55
- borderRadius: E,
56
- className: e(l, u({
57
- variant: o,
58
- size: m
59
- }), A),
60
- color: O,
51
+ backgroundColor: j,
52
+ borderRadius: A,
53
+ className: e(u, f({
54
+ variant: _,
55
+ size: v
56
+ }), P),
57
+ color: M,
61
58
  "data-text-reveal": "",
62
- display: b,
63
- gap: S,
64
- maxInlineSize: k,
65
- minBlockSize: C,
66
- paddingInlineEnd: T,
67
- paddingInlineStart: w,
68
- style: j,
69
- children: [h ? /* @__PURE__ */ d(n, {
59
+ display: w,
60
+ gap: E,
61
+ maxInlineSize: N,
62
+ minBlockSize: D,
63
+ paddingInlineEnd: k,
64
+ paddingInlineStart: O,
65
+ style: F,
66
+ children: [y ? /* @__PURE__ */ p(n, {
70
67
  as: "a",
71
- className: c,
72
- href: h,
68
+ className: l,
69
+ href: y,
73
70
  overflow: "hidden",
74
- children: F
75
- }) : F, v && /* @__PURE__ */ d(n, {
71
+ children: z
72
+ }) : z, S && /* @__PURE__ */ p(n, {
76
73
  alignSelf: "start",
77
- "aria-label": L ?? "Remove",
74
+ "aria-label": V ?? "Remove",
78
75
  borderRadius: "full",
79
76
  className: "_1jsyd8s3",
80
77
  flexShrink: 0,
81
- onClick: v,
82
- children: /* @__PURE__ */ d(a, { size: m })
78
+ onClick: S,
79
+ children: /* @__PURE__ */ p(s, { size: v })
83
80
  })]
84
81
  });
85
82
  }
86
- export { v as Tag };
83
+ export { _ as Tag };
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
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(li)>._1mgdisq4{display:flow-root}:where(li)>._1mgdisq4:before,:where(li)>._1mgdisq4:after{display:block}:where(li:has(>._1mgdisq4))::marker{font-family:var(--font-body);line-height:0}: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}._1mgdisq5{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq5:before,._1mgdisq5:after{content:none}._1mgdisq6{--_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)}._1mgdisq7{--_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)}._1mgdisq8{--_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)}._1mgdisq9{--_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)}._1mgdisqa{--_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)}._1mgdisqb{font-size:var(--font-size-xs)}._1mgdisqc{font-size:var(--font-size-sm)}._1mgdisqd{font-size:var(--font-size-med)}._1mgdisqe{font-size:var(--font-size-lg)}._1mgdisqf{font-size:var(--font-size-xl)}._1mgdisqg{font-size:var(--font-size-2xl)}._1mgdisqh{font-size:var(--font-size-3xl)}._1mgdisqi{font-size:var(--font-size-4xl)}._1mgdisqj{font-weight:var(--font-weight-regular)}._1mgdisqk{font-weight:var(--font-weight-medium)}._1mgdisql{font-weight:var(--font-weight-semibold)}._1mgdisqm{font-weight:var(--font-weight-bold)}._1mgdisqn{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqp{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqq{font-variant-numeric:tabular-nums}._1mgdisqr{white-space:nowrap}._1mgdisqs{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqt{white-space:pre}._1mgdisqu{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) ._1mgdisqu{white-space:normal;text-overflow:clip}}
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(li)>._1mgdisq4{display:flow-root}:where(li)>._1mgdisq4:before,:where(li)>._1mgdisq4:after{display:block}:where(li:has(>._1mgdisq4))::marker{font-family:var(--font-body);line-height:0}: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}._1mgdisq5{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq5:before,._1mgdisq5:after{content:none}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisq5{white-space:normal;text-overflow:clip}._1mgdisq6{--_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)}._1mgdisq7{--_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)}._1mgdisq8{--_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)}._1mgdisq9{--_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)}._1mgdisqa{--_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)}._1mgdisqb{font-size:var(--font-size-xs)}._1mgdisqc{font-size:var(--font-size-sm)}._1mgdisqd{font-size:var(--font-size-med)}._1mgdisqe{font-size:var(--font-size-lg)}._1mgdisqf{font-size:var(--font-size-xl)}._1mgdisqg{font-size:var(--font-size-2xl)}._1mgdisqh{font-size:var(--font-size-3xl)}._1mgdisqi{font-size:var(--font-size-4xl)}._1mgdisqj{font-weight:var(--font-weight-regular)}._1mgdisqk{font-weight:var(--font-weight-medium)}._1mgdisql{font-weight:var(--font-weight-semibold)}._1mgdisqm{font-weight:var(--font-weight-bold)}._1mgdisqn{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqp{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqq{font-variant-numeric:tabular-nums}._1mgdisqr{white-space:nowrap}._1mgdisqs{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqt{white-space:pre}._1mgdisqu{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) ._1mgdisqu{white-space:normal;text-overflow:clip}}
@@ -23,9 +23,10 @@ A static label that states the status of, or a short fact about, the thing besid
23
23
 
24
24
  - `variant`: `neutral` (default, `fgMuted` on `bgMuted`) for most statuses and facts; `accent` (`accentFg` on `accent`) to draw the eye; `success` (`successFg` on `success`) for a passing or healthy state; `warning` (`warningFg` on `warning`) for one that needs attention soon; `danger` (`dangerFg` on `danger`) for a failure or a blocked state; `done` (`doneFg` on `done`, violet) for finished work, such as a merged PR or a closed issue.
25
25
  - `subtle`: `false` (default) is the solid fill above; `true` swaps it for the variant's tint, `<variant>SubtleFg` on `<variant>Subtle` (`neutralSubtleFg` on `neutralSubtle` and so on). Use subtle where many badges sit together, such as a list or a board, so each one stays calm and the color still means one thing; keep solid for the one status that should stand out.
26
- - `size`: `xs`, `sm` or `med` (default), the label's `fontSize` step. Use `xs` (a 12px label, 4px by 2px padding) in dense rows and narrow table cells, such as a board column of status pills; keep `sm` or `med` elsewhere, since `xs` is the smallest readable label. An icon in a badge takes the badge's step as its icon `size` (ADR 0044): `xs` in an `xs` badge.
26
+ - `size`: `xs`, `sm` or `med` (default), the label's `fontSize` step. Use `xs` (a 12px label, 4px by 2px padding) in dense rows and narrow table cells, such as a board column of status pills; keep `sm` or `med` elsewhere, since `xs` is the smallest readable label.
27
27
  - The label states the state. Color is never the only cue (WCAG 1.4.1): under forced colors every variant, `success` and `warning` included, is the same outlined box, and some readers cannot tell the fills apart (green from red above all). Write "Failed" or "Passed", not a red or green badge reading "3".
28
- - Keep it to one or two words; it never wraps. With no children it renders nothing.
28
+ - `iconStart` and `iconEnd` take an icon component (a generated `GitMergeIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. Badge renders it inline in the label at the badge's text step, spaced from the words and centred on their cap height, so the badge keeps the height it has without one (ADR 0044, 0152). The icons are decorative (`aria-hidden`); the label states the state. Do not put an `Icon` in the children: it renders as a block and breaks the line.
29
+ - Keep it to one or two words; it never wraps. A cap, `maxInlineSize` as the style prop or in `style` (Tag's rule: a step, `full`, or a `style` length), cuts the label to one line with an ellipsis; the end icon stays in view after it. A badge has no hover or focus, so a cut label never shows its whole text: cap one only where the full text is also elsewhere. With no children it renders nothing.
29
30
  - Fill, text color, padding, radius and `display` (`inline-block`) are default style props on the outer `span`; a consumer's win. `className`, `style` and `ref` go to it, `className` last. The box holds inside a `Text` or `Heading` too.
30
31
  - The module has no hooks, so a server component can render it.
31
32
  - Migrating from the inbox's `Pill`: `Pill tone=…` is `Badge variant=…`, with `good` as `success`, `warn` as `warning` and `bad` as `danger`; `pillLink` has no Badge equivalent (compose `Clickable`).
@@ -52,6 +53,13 @@ A static label that states the status of, or a short fact about, the thing besid
52
53
  </Badge>
53
54
  ```
54
55
 
56
+ ```tsx
57
+ // An icon component, not an element: the badge sizes and centres it.
58
+ <Badge iconStart={GitMergeIcon} variant="done">
59
+ Merged
60
+ </Badge>
61
+ ```
62
+
55
63
  ```tsx
56
64
  // A narrow board column or table cell: xs is the narrowest pill that still reads.
57
65
  <Badge size="xs" subtle variant="warning">
@@ -71,6 +79,13 @@ A static label that states the status of, or a short fact about, the thing besid
71
79
  <Badge onClick={retry}>Retry</Badge>
72
80
  ```
73
81
 
82
+ ```tsx
83
+ // An Icon in the children is a block box: the badge grows and the text moves off-centre.
84
+ <Badge>
85
+ <GitMergeIcon size="med" /> Merged
86
+ </Badge>
87
+ ```
88
+
74
89
  ## Accessibility
75
90
 
76
91
  - It is plain text in a `span`: screen readers read the label in line with what is around it, so the label must make sense there ("Quarterly report Draft").
@@ -86,6 +101,8 @@ Generated from the TypeScript types.
86
101
 
87
102
  | Prop | Type | Required | Description |
88
103
  | --- | --- | --- | --- |
104
+ | `iconEnd` | `ComponentType` | no | |
105
+ | `iconStart` | `ComponentType` | no | |
89
106
  | `size` | `"med" \| "sm" \| "xs"` | no | |
90
107
  | `subtle` | `boolean` | no | |
91
108
  | `variant` | `"accent" \| "danger" \| "done" \| "neutral" \| "success" \| "warning"` | no | |
package/dist/docs/Tag.md CHANGED
@@ -21,6 +21,7 @@ A label that puts content in a category: a topic, a label, a user-made category.
21
21
  ## Rules
22
22
 
23
23
  - `size`: `sm` or `med` (default), the label's `fontSize` step.
24
+ - `iconStart` and `iconEnd` take an icon component (a generated `InboxIcon` from `@jonmilner/ui/icons`, or a component that renders `Icon`), not an element. Tag renders it inline in the label (inside the link, with `href`) at the label's text step, spaced from the words and centred on their cap height, so the tag keeps the height it has without one (ADR 0044, 0152). The icons are decorative (`aria-hidden`): they are not in the link's or the remove button's name. A truncated label keeps its end icon in view after the ellipsis.
24
25
  - `variant`: the tone's subtle fill, `<variant>SubtleFg` on `<variant>Subtle`. `neutral` (default) for most categories; `accent`, `success`, `warning`, `danger` and `done` only where the category has a meaning those colors already carry in the app, as Badge's variants do. Tag has no solid fills: a category label stays calm (ADR 0121). The tone is never the only cue: the label names the category.
25
26
  - Read-only is the default. `href` makes the label a link (a `Clickable` `<a>` around the text, underlined). The tag itself stays a `span`, so a remove button never nests in the link.
26
27
  - `onRemove` adds a native `<button>` after the label with an `x` icon. Its name is "Remove <label>" from a string or number label; set `removeLabel` for any other label. Enter and Space activate it; the click calls `onRemove`. Tag handles no keys, so Backspace and Delete do nothing (ADR 0003, 0055).
@@ -57,6 +58,12 @@ Tell screen reader users the tag is gone, with the owner's live region or by nam
57
58
  <Tag style={{ maxInlineSize: "min(10rem, 100%)" }}>{longCategoryName}</Tag>
58
59
  ```
59
60
 
61
+ ```tsx
62
+ <Tag href="/inbox" iconStart={InboxIcon}>
63
+ Inbox
64
+ </Tag>
65
+ ```
66
+
60
67
  ```tsx
61
68
  <Tag variant="done" href="/labels/shipped">
62
69
  Shipped
@@ -99,6 +106,8 @@ Generated from the TypeScript types.
99
106
  | Prop | Type | Required | Description |
100
107
  | --- | --- | --- | --- |
101
108
  | `href` | `string` | no | |
109
+ | `iconEnd` | `ComponentType` | no | |
110
+ | `iconStart` | `ComponentType` | no | |
102
111
  | `onRemove` | `(() => void)` | no | |
103
112
  | `removeLabel` | `string` | no | |
104
113
  | `size` | `"med" \| "sm"` | no | |
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.13.0",
4
+ "version": "0.13.1",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -166,6 +166,16 @@
166
166
  "name": "Badge",
167
167
  "styleProps": true,
168
168
  "props": [
169
+ {
170
+ "name": "iconEnd",
171
+ "type": "ComponentType",
172
+ "required": false
173
+ },
174
+ {
175
+ "name": "iconStart",
176
+ "type": "ComponentType",
177
+ "required": false
178
+ },
169
179
  {
170
180
  "name": "size",
171
181
  "type": "\"med\" | \"sm\" | \"xs\"",
@@ -2792,6 +2802,16 @@
2792
2802
  "type": "string",
2793
2803
  "required": false
2794
2804
  },
2805
+ {
2806
+ "name": "iconEnd",
2807
+ "type": "ComponentType",
2808
+ "required": false
2809
+ },
2810
+ {
2811
+ "name": "iconStart",
2812
+ "type": "ComponentType",
2813
+ "required": false
2814
+ },
2795
2815
  {
2796
2816
  "name": "onRemove",
2797
2817
  "type": "(() => void)",
@@ -0,0 +1,12 @@
1
+ // src/icon-slot/gap.ts
2
+ var e = {
3
+ xs: "4",
4
+ sm: "4",
5
+ med: "8",
6
+ lg: "8",
7
+ xl: "8",
8
+ "2xl": "12",
9
+ "3xl": "12",
10
+ "4xl": "16"
11
+ };
12
+ export { e as iconGap };
@@ -0,0 +1,6 @@
1
+ import { IconProps } from "../Icon/index.mjs";
2
+ import { ComponentType, ReactNode } from "react";
3
+ export type IconSlotProps = {
4
+ iconEnd?: ComponentType<IconProps>;
5
+ iconStart?: ComponentType<IconProps>;
6
+ };
@@ -0,0 +1,39 @@
1
+ import { join as e } from "../styles/join.mjs";
2
+ import { Text as t } from "../Text/index.mjs";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ // src/icon-slot/slot.tsx
5
+ var a = "⁠";
6
+ function o({ iconStart: o, iconEnd: s, size: c, styles: l, truncate: u, children: d }) {
7
+ if (!o && !s) return d;
8
+ let f = o && /* @__PURE__ */ i(t, {
9
+ "aria-hidden": !0,
10
+ as: "span",
11
+ display: "inline",
12
+ wrap: "nowrap",
13
+ children: [/* @__PURE__ */ r(o, {
14
+ className: l.start[c],
15
+ size: c
16
+ }), a]
17
+ }), p = s && /* @__PURE__ */ i(t, {
18
+ "aria-hidden": !0,
19
+ as: "span",
20
+ display: "inline",
21
+ wrap: "nowrap",
22
+ children: [a, /* @__PURE__ */ r(s, {
23
+ className: l.end[c],
24
+ size: c
25
+ })]
26
+ });
27
+ return u && p ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ i(t, {
28
+ as: "span",
29
+ className: e(l.clip[c], l.reveal),
30
+ display: "inline-block",
31
+ truncate: "box",
32
+ children: [f, d]
33
+ }), p] }) : /* @__PURE__ */ i(n, { children: [
34
+ f,
35
+ d,
36
+ p
37
+ ] });
38
+ }
39
+ export { o as slotIcons };
@@ -0,0 +1,23 @@
1
+ // src/styles/capped.ts
2
+ var e = new Set(Object.keys({
3
+ xs: !0,
4
+ sm: !0,
5
+ med: !0,
6
+ lg: !0,
7
+ xl: !0,
8
+ full: !0
9
+ })), t = /* @__PURE__ */ new Set([
10
+ "",
11
+ "none",
12
+ "auto",
13
+ "initial",
14
+ "unset",
15
+ "inherit",
16
+ "revert",
17
+ "revert-layer"
18
+ ]);
19
+ function n(n, r) {
20
+ let i = r?.maxInlineSize ?? r?.maxWidth;
21
+ return i == null ? typeof n != "object" || !n ? e.has(n) : n.base != null && Object.values(n).every((t) => t == null || e.has(t)) : !t.has(String(i).trim()) && !/-content\b/.test(String(i));
22
+ }
23
+ export { n as capped };
@@ -1,14 +1,14 @@
1
- import { tokens as e } from "./scales.mjs";
2
- import { colorRoles as t, fontRoles as n } from "./roles.mjs";
1
+ import { colorRoles as e, fontRoles as t } from "./roles.mjs";
2
+ import { tokens as n } from "./scales.mjs";
3
3
  // src/tokens/contract.ts
4
4
  function r(e, t) {
5
5
  return typeof e == "string" ? `var(--${t.join("-").replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`)})` : Object.fromEntries(Object.entries(e).map(([e, n]) => [e, r(n, [...t, e])]));
6
6
  }
7
7
  var i = (e, t) => Object.fromEntries(e.map((e) => [e, t])), a = {
8
- ...e,
9
- color: i(t, ""),
10
- font: i(n, ""),
11
- fontTrim: i(n, {
8
+ ...n,
9
+ color: i(e, ""),
10
+ font: i(t, ""),
11
+ fontTrim: i(t, {
12
12
  cap: "",
13
13
  baseline: ""
14
14
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonmilner/ui",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "bin": {
5
5
  "ui-doctor": "./dist/cli/ui-doctor.mjs"
6
6
  },