@jonmilner/ui 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge/Badge.css +1 -1
- package/dist/Badge/index.mjs +1 -0
- package/dist/Button/index.mjs +37 -35
- package/dist/Field/index.d.mts +3 -3
- package/dist/Field/index.mjs +25 -22
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/client.mjs +53 -50
- package/dist/Tabs/index.d.mts +1 -1
- package/dist/Tabs/index.mjs +12 -11
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/index.mjs +1 -0
- package/dist/Text/Text.css +1 -1
- package/dist/Text/Text.css.mjs +24 -24
- package/dist/Text/index.d.mts +3 -2
- package/dist/Text/index.mjs +19 -17
- package/dist/docs/Button.md +1 -1
- package/dist/docs/Clickable.md +16 -1
- package/dist/docs/Field.md +6 -3
- package/dist/docs/Heading.md +2 -1
- package/dist/docs/IconButton.md +1 -1
- package/dist/docs/Tabs.md +1 -0
- package/dist/docs/Text.md +11 -2
- package/dist/docs/llms.txt +1 -1
- package/dist/docs/manifest.json +54 -6
- package/dist/docs/theming.md +2 -0
- package/dist/styles/button-parts.css.mjs +4 -0
- package/package.json +1 -1
package/dist/Badge/Badge.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.badge{._1ixfil10{
|
|
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}}}
|
package/dist/Badge/index.mjs
CHANGED
package/dist/Button/index.mjs
CHANGED
|
@@ -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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
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
|
|
31
|
-
let
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
...
|
|
34
|
-
backgroundColor:
|
|
35
|
-
borderRadius:
|
|
36
|
-
busy:
|
|
37
|
-
className: e(
|
|
38
|
-
variant:
|
|
39
|
-
size:
|
|
40
|
-
}),
|
|
41
|
-
color:
|
|
42
|
-
minBlockSize:
|
|
43
|
-
paddingBlock:
|
|
44
|
-
paddingInline:
|
|
45
|
-
children: /* @__PURE__ */
|
|
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:
|
|
49
|
+
className: e(d, o),
|
|
49
50
|
display: "grid",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ p(t, {
|
|
51
52
|
alignItems: "center",
|
|
52
53
|
as: "span",
|
|
53
|
-
className:
|
|
54
|
+
className: e(l, a),
|
|
54
55
|
display: "flex",
|
|
55
|
-
gap:
|
|
56
|
+
gap: C,
|
|
56
57
|
children: [
|
|
57
|
-
|
|
58
|
-
|
|
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:
|
|
63
|
+
size: g,
|
|
62
64
|
weight: "medium",
|
|
63
|
-
children:
|
|
65
|
+
children: O
|
|
64
66
|
}),
|
|
65
|
-
|
|
67
|
+
y && /* @__PURE__ */ f(y, { size: g })
|
|
66
68
|
]
|
|
67
|
-
}),
|
|
69
|
+
}), j && /* @__PURE__ */ p(r, {
|
|
68
70
|
className: "hkhd8b",
|
|
69
71
|
fill: "currentColor",
|
|
70
|
-
size:
|
|
72
|
+
size: g,
|
|
71
73
|
stroke: "none",
|
|
72
74
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ f("circle", {
|
|
74
76
|
className: "hkhd8c",
|
|
75
77
|
cx: "5",
|
|
76
78
|
cy: "12",
|
|
77
79
|
r: "2"
|
|
78
80
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ f("circle", {
|
|
80
82
|
className: "hkhd8c",
|
|
81
83
|
cx: "12",
|
|
82
84
|
cy: "12",
|
|
83
85
|
r: "2"
|
|
84
86
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
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 {
|
|
99
|
+
export { h as Button };
|
package/dist/Field/index.d.mts
CHANGED
|
@@ -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;
|
package/dist/Field/index.mjs
CHANGED
|
@@ -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,
|
|
26
|
-
let [
|
|
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
|
-
...
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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,
|
|
44
|
-
let [
|
|
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
|
-
...
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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,
|
|
61
|
-
let [
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
wrap: h,
|
|
74
|
+
color: g,
|
|
75
|
+
...b,
|
|
76
|
+
className: e(i, _),
|
|
77
|
+
style: v,
|
|
75
78
|
children: [/* @__PURE__ */ s(o, {
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
-
match: a ?? (
|
|
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
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
|
12
|
-
let { ref: s } =
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
disabled:
|
|
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:
|
|
17
|
+
render: r({
|
|
17
18
|
variant: "secondary",
|
|
18
|
-
iconEnd:
|
|
19
|
-
className:
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
className:
|
|
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__ */
|
|
24
|
-
count:
|
|
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
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
let e =
|
|
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 = () =>
|
|
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
|
-
}, [
|
|
41
|
-
let
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
}, [c]);
|
|
42
|
+
let u = !a && n.length > 1;
|
|
43
|
+
return /* @__PURE__ */ p(e, {
|
|
43
44
|
as: "span",
|
|
44
|
-
className:
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
-
"aria-hidden":
|
|
45
|
+
className: l,
|
|
46
|
+
children: [/* @__PURE__ */ f(t, {
|
|
47
|
+
"aria-hidden": u || void 0,
|
|
47
48
|
as: "span",
|
|
48
|
-
className:
|
|
49
|
-
ref:
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
56
|
+
truncate: "box",
|
|
57
|
+
children: r
|
|
55
58
|
})]
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
value:
|
|
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
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
id:
|
|
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
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
"aria-labelledby":
|
|
75
|
-
render: /* @__PURE__ */
|
|
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:
|
|
82
|
+
className: c,
|
|
80
83
|
padding: "4"
|
|
81
84
|
}),
|
|
82
85
|
children: t
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
|
-
function
|
|
86
|
-
let { container: t } =
|
|
87
|
-
return /* @__PURE__ */
|
|
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 {
|
|
96
|
+
export { E as MultiSelectLabel, D as MultiSelectPopup, O as MultiSelectPortal, T as MultiSelectScope, S as MultiSelectTrigger };
|
package/dist/Tabs/index.d.mts
CHANGED
|
@@ -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;
|
package/dist/Tabs/index.mjs
CHANGED
|
@@ -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,
|
|
42
|
-
let [
|
|
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
|
-
...
|
|
44
|
+
...T,
|
|
45
45
|
render: /* @__PURE__ */ l(r, {
|
|
46
|
-
color:
|
|
47
|
-
justifyContent:
|
|
48
|
-
minBlockSize:
|
|
49
|
-
paddingInline:
|
|
50
|
-
position:
|
|
51
|
-
...
|
|
52
|
-
className: e(c,
|
|
53
|
-
style:
|
|
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{
|
|
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}}}
|
package/dist/Tag/index.mjs
CHANGED
package/dist/Text/Text.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.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)}.
|
|
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}}
|
package/dist/Text/Text.css.mjs
CHANGED
|
@@ -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: "
|
|
8
|
-
heading: "
|
|
9
|
-
display: "
|
|
10
|
-
label: "
|
|
11
|
-
mono: "
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 {
|
|
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 };
|
package/dist/Text/index.d.mts
CHANGED
|
@@ -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
|
package/dist/Text/index.mjs
CHANGED
|
@@ -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
|
|
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
|
|
7
|
-
let
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
f &&
|
|
13
|
-
p &&
|
|
14
|
-
|
|
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__ */
|
|
17
|
-
as:
|
|
18
|
-
display:
|
|
19
|
-
overflow:
|
|
20
|
-
...
|
|
21
|
-
className: e(...
|
|
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 {
|
|
27
|
+
export { l as Text };
|
package/dist/docs/Button.md
CHANGED
|
@@ -73,7 +73,7 @@ The labelled action: a `<button type="button">` with the house look, or a link s
|
|
|
73
73
|
## Accessibility
|
|
74
74
|
|
|
75
75
|
- A button that goes somewhere is a link (`as="a"` with `href`); one that does something is a button.
|
|
76
|
-
- Disabled and loading buttons stay in the tab order, so keyboard and screen reader users find them; Enter and Space do nothing while either is set.
|
|
76
|
+
- Disabled and loading buttons stay in the tab order, so keyboard and screen reader users find them; Enter and Space do nothing while either is set. The blocked click still bubbles to an ancestor's `onClick` (see Clickable's Rules).
|
|
77
77
|
- State is never color alone: disabled adds a dashed border, loading shows the dots. Under forced colors the button keeps its system colors (`LinkText` fill for `primary` and `danger`, a `CanvasText` border for `secondary`) and a disabled one is `GrayText`. Hover draws no tint there, so the system pairs keep their contrast.
|
|
78
78
|
- Under reduced motion the dots hold still.
|
|
79
79
|
- Text on every variant passes 4.5:1 at rest and on hover in light and dark modes.
|
package/dist/docs/Clickable.md
CHANGED
|
@@ -21,11 +21,26 @@ The low-level base for everything a user presses: a `<button type="button">` by
|
|
|
21
21
|
- `busy` renders `aria-busy="true"` and blocks activation the same way. Pair it with a visible change (a spinner or new label).
|
|
22
22
|
- Set state with `disabled` and `busy`, not `aria-disabled` and `aria-busy`. A raw attribute still blocks the click, since JSX cannot reject hyphenated attributes, but the props are the API.
|
|
23
23
|
- `as="button"` gets `type="button"`; pass `type="submit"` for a form's submit button. A component passed as `as` gets no `type`; it sets its own.
|
|
24
|
-
- Only `onClick`
|
|
24
|
+
- Only `onClick` and `onAuxClick` are blocked. Do not put actions in `onPointerDown`, `onMouseDown` or `onKeyDown`.
|
|
25
25
|
- Layout and the target size are default style props (`display="inline-flex"`, centered, `minInlineSize` and `minBlockSize` `"xs"`, 24px). Raise them freely; never set them below `"xs"`.
|
|
26
26
|
- Style props win over the stripped chrome, so `padding`, `color` and `backgroundColor` apply as given.
|
|
27
27
|
- The focus ring is the library's one ring (`outline` in the `focus` color, `Highlight` under forced colors). Do not restyle `:focus-visible` or `outline`.
|
|
28
28
|
- A client component (`'use client'`): it wraps `onClick`. Server components can render it with serializable props.
|
|
29
|
+
- A blocked click still bubbles: Clickable never calls `stopPropagation`, so an ancestor's `onClick` and `onAuxClick` run, unlike a native disabled button, which fires no click. A row handler or analytics listener sees it. An ancestor that must not act on a disabled or busy child checks with `closest`, since the target can be a span inside the control:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// Clicking the disabled Delete still reaches the row; the check keeps `select` from running.
|
|
33
|
+
<li
|
|
34
|
+
onClick={(event) => {
|
|
35
|
+
if ((event.target as Element).closest('[aria-disabled="true"], [aria-busy="true"]')) return;
|
|
36
|
+
select();
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Clickable disabled onClick={remove}>
|
|
40
|
+
Delete
|
|
41
|
+
</Clickable>
|
|
42
|
+
</li>
|
|
43
|
+
```
|
|
29
44
|
|
|
30
45
|
## Do
|
|
31
46
|
|
package/dist/docs/Field.md
CHANGED
|
@@ -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`).
|
package/dist/docs/Heading.md
CHANGED
|
@@ -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/IconButton.md
CHANGED
|
@@ -62,7 +62,7 @@ A compact button whose only visible content is an icon, for an action the icon m
|
|
|
62
62
|
|
|
63
63
|
- The `label` is announced as the button's name; the icon is hidden from assistive technology.
|
|
64
64
|
- The label is not shown on hover or focus. Sighted users who don't recognise the icon get no text, so keep IconButton to widely understood icons.
|
|
65
|
-
- A disabled IconButton stays in the tab order, and Enter and Space do nothing. State is never color alone: disabled adds a dashed border.
|
|
65
|
+
- A disabled IconButton stays in the tab order, and Enter and Space do nothing; the blocked click still bubbles to an ancestor's `onClick` (see Clickable's Rules). State is never color alone: disabled adds a dashed border.
|
|
66
66
|
- Every size is at least 24 by 24 CSS px (WCAG 2.2 target size); the icon on each variant passes 4.5:1 at rest and on hover in light and dark modes. Under forced colors it keeps Button's system colors.
|
|
67
67
|
|
|
68
68
|
## Props
|
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 `
|
|
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`).
|
package/dist/docs/llms.txt
CHANGED
|
@@ -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 `
|
|
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
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"package": "@jonmilner/ui",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
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",
|
package/dist/docs/theming.md
CHANGED
|
@@ -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.
|