@jonmilner/ui 0.2.1 → 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.
- 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/Menu/Menu.css +1 -1
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.mjs +26 -23
- package/dist/Menu/index.mjs +18 -18
- 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/Field.md +6 -3
- package/dist/docs/Heading.md +2 -1
- package/dist/docs/Menu.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
|
});
|
package/dist/Menu/Menu.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.menu{._393eil0{border:var(--space-1) solid var(--color-border);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter)}.
|
|
2
|
+
@layer components.menu{:where(._393eil0[data-closed])>[data-base-ui-focus-guard]{visibility:hidden}._393eil1{border:var(--space-1) solid var(--color-border);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter)}._393eil1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._393eil1[data-starting-style],._393eil1[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._393eil2{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._393eil2:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._393eil2[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._393eil2[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._393eil3{border-block-start:var(--space-1) solid var(--color-border)}@media (forced-colors:active){._393eil2[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._393eil2[aria-disabled=true]{color:graytext}}}
|
package/dist/Menu/Menu.css.mjs
CHANGED
|
@@ -3,6 +3,6 @@ import "./Menu.css";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region src/Menu/Menu.css.ts
|
|
6
|
-
var e = "_393eil0", t = "_393eil1", n = "_393eil2";
|
|
6
|
+
var e = "_393eil0", t = "_393eil1", n = "_393eil2", r = "_393eil3";
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { n as item, t as popup, e as positioner, r as separator };
|
package/dist/Menu/client.mjs
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { join as e } from "../styles/join.mjs";
|
|
3
|
+
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
4
|
+
import { Box as n } from "../Box/index.mjs";
|
|
5
|
+
import { triggerElement as r, usePopupScope as i } from "../popup/client.mjs";
|
|
6
|
+
import { positioner as a } from "./Menu.css.mjs";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
import { Menu as s } from "@base-ui/react/menu";
|
|
7
9
|
//#region src/Menu/client.tsx
|
|
8
|
-
function
|
|
9
|
-
let { ref: d } =
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
function c({ disabled: e = !1, openOnHover: t, delay: n, closeDelay: a, handle: c, payload: l, ...u }) {
|
|
11
|
+
let { ref: d } = i();
|
|
12
|
+
return /* @__PURE__ */ o(s.Trigger, {
|
|
11
13
|
disabled: e,
|
|
12
14
|
openOnHover: t,
|
|
13
|
-
delay:
|
|
14
|
-
closeDelay:
|
|
15
|
+
delay: n,
|
|
16
|
+
closeDelay: a,
|
|
15
17
|
handle: c,
|
|
16
18
|
payload: l,
|
|
17
19
|
ref: d,
|
|
18
|
-
render:
|
|
20
|
+
render: r(u)
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
let { container: t } =
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
function l({ children: e }) {
|
|
24
|
+
let { container: t } = i();
|
|
25
|
+
return /* @__PURE__ */ o(s.Portal, {
|
|
24
26
|
container: t,
|
|
25
27
|
children: e
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
...
|
|
30
|
+
function u(r) {
|
|
31
|
+
return /* @__PURE__ */ o(s.Positioner, {
|
|
32
|
+
...r,
|
|
31
33
|
collisionPadding: 8,
|
|
32
|
-
render: (
|
|
33
|
-
let [,
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
...
|
|
36
|
-
"aria-hidden": !
|
|
34
|
+
render: (r, { open: i }) => {
|
|
35
|
+
let [, s] = t(r);
|
|
36
|
+
return /* @__PURE__ */ o(n, {
|
|
37
|
+
...s,
|
|
38
|
+
"aria-hidden": !i || void 0,
|
|
39
|
+
className: e(a, s.className),
|
|
37
40
|
zIndex: "popover"
|
|
38
41
|
});
|
|
39
42
|
},
|
|
@@ -41,4 +44,4 @@ function c(n) {
|
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
//#endregion
|
|
44
|
-
export {
|
|
47
|
+
export { l as MenuPortal, u as MenuPositioner, c as MenuTrigger };
|
package/dist/Menu/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
|
3
3
|
import { Box as n } from "../Box/index.mjs";
|
|
4
4
|
import { Text as r } from "../Text/index.mjs";
|
|
5
5
|
import { PopupScope as i } from "../popup/client.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { item as a, popup as o, separator as s } from "./Menu.css.mjs";
|
|
7
|
+
import { MenuPortal as c, MenuPositioner as l, MenuTrigger as u } from "./client.mjs";
|
|
8
8
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
import { Children as p } from "react";
|
|
10
10
|
import { Menu as m } from "@base-ui/react/menu";
|
|
@@ -15,39 +15,39 @@ function h({ children: e, ...t }) {
|
|
|
15
15
|
children: e
|
|
16
16
|
}) });
|
|
17
17
|
}
|
|
18
|
-
function g({ side: r = "bottom", align: i = "start", backgroundColor:
|
|
18
|
+
function g({ side: r = "bottom", align: i = "start", backgroundColor: a = "bgRaised", borderRadius: s = "med", boxShadow: u = "med", padding: f = "4", className: p, style: h, ...g }) {
|
|
19
19
|
let [_, v] = t(g);
|
|
20
|
-
return /* @__PURE__ */ d(
|
|
20
|
+
return /* @__PURE__ */ d(c, { children: /* @__PURE__ */ d(l, {
|
|
21
21
|
align: i,
|
|
22
22
|
side: r,
|
|
23
23
|
children: /* @__PURE__ */ d(m.Popup, {
|
|
24
24
|
...v,
|
|
25
25
|
render: /* @__PURE__ */ d(n, {
|
|
26
|
-
backgroundColor:
|
|
27
|
-
borderRadius:
|
|
26
|
+
backgroundColor: a,
|
|
27
|
+
borderRadius: s,
|
|
28
28
|
boxShadow: u,
|
|
29
29
|
padding: f,
|
|
30
30
|
..._,
|
|
31
|
-
className: e(
|
|
31
|
+
className: e(o, p),
|
|
32
32
|
style: h
|
|
33
33
|
})
|
|
34
34
|
})
|
|
35
35
|
}) });
|
|
36
36
|
}
|
|
37
|
-
function _({ variant: i = "neutral", display:
|
|
37
|
+
function _({ variant: i = "neutral", display: o = "flex", alignItems: s = "center", gap: c = "8", minBlockSize: l = "sm", paddingInline: u = "12", borderRadius: f = "sm", color: h = i === "danger" ? "danger" : "fg", className: g, style: _, children: v, ...y }) {
|
|
38
38
|
let [b, x] = t(y);
|
|
39
39
|
return /* @__PURE__ */ d(m.Item, {
|
|
40
40
|
...x,
|
|
41
41
|
render: /* @__PURE__ */ d(n, {
|
|
42
|
-
display:
|
|
43
|
-
alignItems:
|
|
44
|
-
gap:
|
|
42
|
+
display: o,
|
|
43
|
+
alignItems: s,
|
|
44
|
+
gap: c,
|
|
45
45
|
minBlockSize: l,
|
|
46
46
|
paddingInline: u,
|
|
47
47
|
borderRadius: f,
|
|
48
48
|
color: h,
|
|
49
49
|
...b,
|
|
50
|
-
className: e(
|
|
50
|
+
className: e(a, g),
|
|
51
51
|
style: _
|
|
52
52
|
}),
|
|
53
53
|
children: p.map(v, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ d(r, {
|
|
@@ -58,15 +58,15 @@ function _({ variant: i = "neutral", display: a = "flex", alignItems: o = "cente
|
|
|
58
58
|
}) : e)
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
function v({ marginBlock: r = "4", marginInline: i = "8", className: a, style: o, ...
|
|
62
|
-
let [
|
|
61
|
+
function v({ marginBlock: r = "4", marginInline: i = "8", className: a, style: o, ...c }) {
|
|
62
|
+
let [l, u] = t(c);
|
|
63
63
|
return /* @__PURE__ */ d(m.Separator, {
|
|
64
|
-
...
|
|
64
|
+
...u,
|
|
65
65
|
render: /* @__PURE__ */ d(n, {
|
|
66
66
|
marginBlock: r,
|
|
67
67
|
marginInline: i,
|
|
68
|
-
...
|
|
69
|
-
className: e(
|
|
68
|
+
...l,
|
|
69
|
+
className: e(s, a),
|
|
70
70
|
style: o
|
|
71
71
|
})
|
|
72
72
|
});
|
|
@@ -94,7 +94,7 @@ function y({ label: e, className: i, style: a, children: o, ...s }) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
var b = Object.assign(h, {
|
|
97
|
-
Trigger:
|
|
97
|
+
Trigger: u,
|
|
98
98
|
Popup: g,
|
|
99
99
|
Item: _,
|
|
100
100
|
Separator: v,
|
|
@@ -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/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/Menu.md
CHANGED
|
@@ -92,7 +92,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
|
|
|
92
92
|
|
|
93
93
|
- The trigger has `aria-haspopup="menu"` and `aria-expanded`; the popup is `role="menu"` labelled by the trigger, items are `role="menuitem"`, groups are `role="group"` named by their label.
|
|
94
94
|
- Opening from the keyboard focuses the first item; from the pointer, the popup. Focus stays in the menu until it closes, then returns to the trigger.
|
|
95
|
-
- A closed menu stays on the page while it fades out, but is `aria-hidden` from the moment it closes, so a menu opened during the fade (the next row's) is the only one a screen reader or a role query finds. Focus stays in it until the fade ends, then returns to the trigger.
|
|
95
|
+
- A closed menu stays on the page while it fades out, but is `aria-hidden` from the moment it closes, so a menu opened during the fade (the next row's) is the only one a screen reader or a role query finds. Nothing in it is in the tab order. Focus stays in it until the fade ends, then returns to the trigger.
|
|
96
96
|
- The highlighted item gets a fill (`bgMuted` in light mode; in dark mode `bgRaised` with 10% `fg` mixed in, since `bgMuted` sits too close to the popup there), and the shared focus ring when reached from the keyboard. Under forced colors it is `Highlight` with `HighlightText`, disabled items are `GrayText`, and the popup keeps its border.
|
|
97
97
|
- The danger item's `danger` color passes 4.5:1 on the popup and on the highlight fill in every preset (`Menu.test.tsx` checks it, with `fg` and `fgMuted`); the word ("Delete") carries the meaning, not the color.
|
|
98
98
|
|
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.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",
|
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.
|