@stackone/malachite 2.123.1 → 2.124.0
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/COMPONENTS.md +4 -3
- package/dist/components/ActionMenu.js +4 -3
- package/dist/components/ActionMenu.js.map +1 -1
- package/dist/components/Card.js +88 -78
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Flex.js +10 -8
- package/dist/components/Flex.js.map +1 -1
- package/dist/components/FrameHeader.js +26 -19
- package/dist/components/FrameHeader.js.map +1 -1
- package/dist/components/PageLayout/index.js +8 -7
- package/dist/components/PageLayout/index.js.map +1 -1
- package/dist/components/PageLayout/pageColumns.js +23 -0
- package/dist/components/PageLayout/pageColumns.js.map +1 -0
- package/dist/components/Table/Table.js +491 -472
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/ToastProvider.js +32 -42
- package/dist/components/ToastProvider.js.map +1 -1
- package/dist/components/Typography/PathText.js +48 -55
- package/dist/components/Typography/PathText.js.map +1 -1
- package/dist/components/VisuallyHidden.js +8 -0
- package/dist/components/VisuallyHidden.js.map +1 -0
- package/dist/components/actionMenuStyles.js +33 -42
- package/dist/components/actionMenuStyles.js.map +1 -1
- package/dist/components/flexTypes.js +1 -1
- package/dist/components/flexTypes.js.map +1 -1
- package/dist/components/visuallyHiddenStyle.js +16 -0
- package/dist/components/visuallyHiddenStyle.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +394 -392
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { ToastContext as
|
|
5
|
-
import { TOAST_ANNOUNCEMENT_LIFETIME_MS as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
margin: -1,
|
|
11
|
-
padding: 0,
|
|
12
|
-
border: 0,
|
|
13
|
-
overflow: "hidden",
|
|
14
|
-
clip: "rect(0 0 0 0)",
|
|
15
|
-
clipPath: "inset(50%)",
|
|
16
|
-
whiteSpace: "nowrap"
|
|
17
|
-
}, C = ({
|
|
18
|
-
children: p,
|
|
19
|
-
duration: f = M
|
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useRef as _, useCallback as d, useEffect as D, useMemo as v } from "react";
|
|
3
|
+
import x from "./ToastHost.js";
|
|
4
|
+
import { ToastContext as I } from "./toastContext.js";
|
|
5
|
+
import { TOAST_ANNOUNCEMENT_LIFETIME_MS as M, TOAST_DEFAULT_DURATION_MS as N } from "./toastTypes.js";
|
|
6
|
+
import { VISUALLY_HIDDEN_STYLE as w } from "./visuallyHiddenStyle.js";
|
|
7
|
+
const j = ({
|
|
8
|
+
children: f,
|
|
9
|
+
duration: T = N
|
|
20
10
|
}) => {
|
|
21
|
-
const [
|
|
11
|
+
const [p, i] = a([]), [r, c] = a(
|
|
22
12
|
[]
|
|
23
|
-
), [
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
}, []),
|
|
28
|
-
|
|
13
|
+
), [h, A] = a(!1), m = _(0), l = d(({ message: s, variant: e = "success" }) => {
|
|
14
|
+
m.current += 1;
|
|
15
|
+
const t = { id: m.current, message: s, variant: e };
|
|
16
|
+
i((o) => [...o, t].slice(-3)), c((o) => [...o, { ...t, announcedAt: Date.now() }]), A(!0);
|
|
17
|
+
}, []), S = d((s) => {
|
|
18
|
+
i((e) => e.filter((t) => t.id !== s));
|
|
29
19
|
}, []);
|
|
30
20
|
D(() => {
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
21
|
+
const s = r[0];
|
|
22
|
+
if (!s)
|
|
33
23
|
return;
|
|
34
|
-
const
|
|
35
|
-
() => c((
|
|
36
|
-
Math.max(0,
|
|
24
|
+
const e = setTimeout(
|
|
25
|
+
() => c((t) => t.filter((o) => o.id !== s.id)),
|
|
26
|
+
Math.max(0, s.announcedAt + M - Date.now())
|
|
37
27
|
);
|
|
38
|
-
return () => clearTimeout(
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */ n("span", { role: "status", "aria-atomic": "false", children:
|
|
45
|
-
/* @__PURE__ */ n("span", { role: "alert", "aria-atomic": "false", children:
|
|
28
|
+
return () => clearTimeout(e);
|
|
29
|
+
}, [r]);
|
|
30
|
+
const E = v(() => ({ show: l }), [l]);
|
|
31
|
+
return /* @__PURE__ */ u(I.Provider, { value: E, children: [
|
|
32
|
+
f,
|
|
33
|
+
/* @__PURE__ */ u("div", { style: w, children: [
|
|
34
|
+
/* @__PURE__ */ n("span", { role: "status", "aria-atomic": "false", children: r.filter((s) => s.variant === "success").map((s) => /* @__PURE__ */ n("span", { children: s.message }, s.id)) }),
|
|
35
|
+
/* @__PURE__ */ n("span", { role: "alert", "aria-atomic": "false", children: r.filter((s) => s.variant === "error").map((s) => /* @__PURE__ */ n("span", { children: s.message }, s.id)) })
|
|
46
36
|
] }),
|
|
47
|
-
|
|
37
|
+
h && /* @__PURE__ */ n(x, { toasts: p, duration: T, onDismiss: S })
|
|
48
38
|
] });
|
|
49
39
|
};
|
|
50
40
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
j as ToastProvider,
|
|
42
|
+
j as default
|
|
53
43
|
};
|
|
54
44
|
//# sourceMappingURL=ToastProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.js","sources":["../../src/components/ToastProvider.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport ToastHost from './ToastHost';\nimport { ToastContext } from './toastContext';\nimport {\n type QueuedToast,\n TOAST_ANNOUNCEMENT_LIFETIME_MS,\n TOAST_DEFAULT_DURATION_MS,\n TOAST_MAX_VISIBLE,\n type ToastOptions,\n} from './toastTypes';\
|
|
1
|
+
{"version":3,"file":"ToastProvider.js","sources":["../../src/components/ToastProvider.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport ToastHost from './ToastHost';\nimport { ToastContext } from './toastContext';\nimport {\n type QueuedToast,\n TOAST_ANNOUNCEMENT_LIFETIME_MS,\n TOAST_DEFAULT_DURATION_MS,\n TOAST_MAX_VISIBLE,\n type ToastOptions,\n} from './toastTypes';\nimport { VISUALLY_HIDDEN_STYLE } from './visuallyHiddenStyle';\n\nexport interface ToastProviderProps {\n children?: React.ReactNode;\n /** How long each toast stays, in ms. Defaults to 3000. */\n duration?: number;\n}\n\nconst ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n duration = TOAST_DEFAULT_DURATION_MS,\n}) => {\n const [toasts, setToasts] = useState<QueuedToast[]>([]);\n const [announcements, setAnnouncements] = useState<(QueuedToast & { announcedAt: number })[]>(\n [],\n );\n const [hasShown, setHasShown] = useState(false);\n const nextId = useRef(0);\n\n const show = useCallback(({ message, variant = 'success' }: ToastOptions) => {\n nextId.current += 1;\n const toast: QueuedToast = { id: nextId.current, message, variant };\n setToasts((previous) => [...previous, toast].slice(-TOAST_MAX_VISIBLE));\n setAnnouncements((previous) => [...previous, { ...toast, announcedAt: Date.now() }]);\n setHasShown(true);\n }, []);\n\n const dismiss = useCallback((id: number) => {\n setToasts((previous) => previous.filter((toast) => toast.id !== id));\n }, []);\n\n useEffect(() => {\n const oldest = announcements[0];\n if (!oldest) {\n return;\n }\n const timeout = setTimeout(\n () =>\n setAnnouncements((previous) => previous.filter((entry) => entry.id !== oldest.id)),\n Math.max(0, oldest.announcedAt + TOAST_ANNOUNCEMENT_LIFETIME_MS - Date.now()),\n );\n return () => clearTimeout(timeout);\n }, [announcements]);\n\n const api = useMemo(() => ({ show }), [show]);\n\n return (\n <ToastContext.Provider value={api}>\n {children}\n {/* A region added with its text is not announced; status and alert default to atomic. */}\n <div style={VISUALLY_HIDDEN_STYLE}>\n <span role=\"status\" aria-atomic=\"false\">\n {announcements\n .filter((entry) => entry.variant === 'success')\n .map((entry) => (\n <span key={entry.id}>{entry.message}</span>\n ))}\n </span>\n <span role=\"alert\" aria-atomic=\"false\">\n {announcements\n .filter((entry) => entry.variant === 'error')\n .map((entry) => (\n <span key={entry.id}>{entry.message}</span>\n ))}\n </span>\n </div>\n {hasShown && <ToastHost toasts={toasts} duration={duration} onDismiss={dismiss} />}\n </ToastContext.Provider>\n );\n};\n\nexport { ToastProvider };\nexport default ToastProvider;\n"],"names":["ToastProvider","children","duration","TOAST_DEFAULT_DURATION_MS","toasts","setToasts","useState","announcements","setAnnouncements","hasShown","setHasShown","nextId","useRef","show","useCallback","message","variant","toast","previous","dismiss","id","useEffect","oldest","timeout","entry","TOAST_ANNOUNCEMENT_LIFETIME_MS","api","useMemo","jsxs","ToastContext","VISUALLY_HIDDEN_STYLE","jsx","ToastHost"],"mappings":";;;;;;AAkBA,MAAMA,IAA8C,CAAC;AAAA,EACjD,UAAAC;AAAA,EACA,UAAAC,IAAWC;AACf,MAAM;AACF,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAwB,CAAA,CAAE,GAChD,CAACC,GAAeC,CAAgB,IAAIF;AAAA,IACtC,CAAA;AAAA,EAAC,GAEC,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxCK,IAASC,EAAO,CAAC,GAEjBC,IAAOC,EAAY,CAAC,EAAE,SAAAC,GAAS,SAAAC,IAAU,gBAA8B;AACzE,IAAAL,EAAO,WAAW;AAClB,UAAMM,IAAqB,EAAE,IAAIN,EAAO,SAAS,SAAAI,GAAS,SAAAC,EAAA;AAC1D,IAAAX,EAAU,CAACa,MAAa,CAAC,GAAGA,GAAUD,CAAK,EAAE,MAAM,EAAkB,CAAC,GACtET,EAAiB,CAACU,MAAa,CAAC,GAAGA,GAAU,EAAE,GAAGD,GAAO,aAAa,KAAK,IAAA,EAAI,CAAG,CAAC,GACnFP,EAAY,EAAI;AAAA,E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UAAAF,GAAoB,WAAWiB,EAAA,CAAS;AAAA,EAAA,GACpF;AAER;"}
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import { jsx as f, jsxs as
|
|
2
|
-
import D, { useRef as
|
|
1
|
+
import { jsx as f, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import D, { useRef as S, useState as H, useEffect as R } from "react";
|
|
3
3
|
import U from "../Tooltip.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { VISUALLY_HIDDEN_STYLE as Y } from "../visuallyHiddenStyle.js";
|
|
5
|
+
import { DEFAULT_MIN_CHARS as M, fitPath as q } from "./pathTextFit.js";
|
|
6
|
+
import { observePath as K, scheduleRemeasure as b, measurerFor as j, fontOf as V } from "./pathTextMeasure.js";
|
|
7
|
+
import { getFontSize as Z, getFontWeight as $ } from "./textStyles.js";
|
|
7
8
|
const k = {
|
|
8
9
|
display: "grid",
|
|
9
10
|
gridTemplateColumns: "minmax(0, 1fr)",
|
|
10
11
|
minWidth: 0,
|
|
11
12
|
maxWidth: "100%"
|
|
12
|
-
},
|
|
13
|
+
}, z = {
|
|
13
14
|
gridArea: "1 / 1",
|
|
14
15
|
height: 0,
|
|
15
16
|
overflow: "hidden",
|
|
16
17
|
visibility: "hidden",
|
|
17
18
|
whiteSpace: "pre"
|
|
18
|
-
},
|
|
19
|
+
}, B = {
|
|
19
20
|
gridArea: "1 / 1",
|
|
20
21
|
display: "flex",
|
|
21
22
|
minWidth: 0,
|
|
22
23
|
overflow: "hidden",
|
|
23
24
|
whiteSpace: "nowrap"
|
|
24
|
-
},
|
|
25
|
-
position: "absolute",
|
|
26
|
-
width: 1,
|
|
27
|
-
height: 1,
|
|
28
|
-
margin: -1,
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
clipPath: "inset(50%)",
|
|
31
|
-
whiteSpace: "nowrap"
|
|
32
|
-
}, v = {
|
|
25
|
+
}, T = {
|
|
33
26
|
default: {},
|
|
34
27
|
secondary: {
|
|
35
28
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
|
|
36
|
-
fontWeight:
|
|
29
|
+
fontWeight: $("normal")
|
|
37
30
|
}
|
|
38
|
-
}, G = { ...
|
|
31
|
+
}, G = { ...T.secondary, flexShrink: 0, whiteSpace: "pre" }, p = (t) => t.tone ?? "default", J = (t, r) => t !== null && t.width === r.width && t.fonts.default === r.fonts.default && t.fonts.secondary === r.fonts.secondary, Q = (t, r, d) => {
|
|
39
32
|
if (!t || t.width <= 0)
|
|
40
33
|
return null;
|
|
41
34
|
const m = [];
|
|
@@ -45,7 +38,7 @@ const k = {
|
|
|
45
38
|
return null;
|
|
46
39
|
m.push({
|
|
47
40
|
text: h.text,
|
|
48
|
-
minChars: h.minChars ??
|
|
41
|
+
minChars: h.minChars ?? M,
|
|
49
42
|
measure: y
|
|
50
43
|
});
|
|
51
44
|
}
|
|
@@ -55,7 +48,7 @@ const k = {
|
|
|
55
48
|
segments: m,
|
|
56
49
|
separatorWidth: (c == null ? void 0 : c(d)) ?? 0
|
|
57
50
|
});
|
|
58
|
-
},
|
|
51
|
+
}, lt = ({
|
|
59
52
|
segments: t,
|
|
60
53
|
separator: r = " / ",
|
|
61
54
|
size: d,
|
|
@@ -64,88 +57,88 @@ const k = {
|
|
|
64
57
|
tooltipSuppressed: h = !1,
|
|
65
58
|
className: y
|
|
66
59
|
}) => {
|
|
67
|
-
const u =
|
|
60
|
+
const u = S(null), v = S(null), A = S(null), [a, N] = H(null), x = S(null), W = t.length === 0;
|
|
68
61
|
R(() => {
|
|
69
62
|
const e = u.current;
|
|
70
63
|
if (e)
|
|
71
64
|
return K(e, (n, o) => {
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
65
|
+
const s = v.current;
|
|
66
|
+
if (!s)
|
|
74
67
|
return;
|
|
75
|
-
if (o || !
|
|
68
|
+
if (o || !x.current) {
|
|
76
69
|
const l = {};
|
|
77
|
-
for (const I of
|
|
70
|
+
for (const I of s.querySelectorAll("[data-tone]")) {
|
|
78
71
|
const g = I.dataset.tone;
|
|
79
72
|
l[g] ?? (l[g] = V(I));
|
|
80
73
|
}
|
|
81
|
-
|
|
74
|
+
x.current = l;
|
|
82
75
|
}
|
|
83
|
-
const F = { width: n, fonts:
|
|
84
|
-
|
|
76
|
+
const F = { width: n, fonts: x.current };
|
|
77
|
+
N((l) => J(l, F) ? l : F);
|
|
85
78
|
});
|
|
86
79
|
}, [W]);
|
|
87
80
|
const C = new Set(t.map(p));
|
|
88
81
|
t.length > 1 && C.add("secondary");
|
|
89
|
-
const
|
|
82
|
+
const E = [...C].sort().join(" ");
|
|
90
83
|
if (R(() => {
|
|
91
|
-
const e = u.current, n =
|
|
92
|
-
e && a && n &&
|
|
93
|
-
}, [
|
|
94
|
-
u.current &&
|
|
84
|
+
const e = u.current, n = E.split(" ").some((o) => !(a != null && a.fonts[o]));
|
|
85
|
+
e && a && n && b(e);
|
|
86
|
+
}, [E, a]), R(() => {
|
|
87
|
+
u.current && b(u.current);
|
|
95
88
|
}, [d]), W)
|
|
96
89
|
return null;
|
|
97
|
-
const
|
|
98
|
-
const o = e.minChars ??
|
|
90
|
+
const i = Q(a, t, r), w = t.length - 1, O = t.map((e) => e.text).join(r), P = (e, n) => {
|
|
91
|
+
const o = e.minChars ?? M, s = !i && n < w && e.text.length > o + 1;
|
|
99
92
|
return {
|
|
100
|
-
...
|
|
101
|
-
minWidth:
|
|
93
|
+
...T[p(e)],
|
|
94
|
+
minWidth: s ? `${o + 1}ch` : 0,
|
|
102
95
|
overflow: "hidden",
|
|
103
96
|
// Fitted text already carries its ellipsis; a sub-pixel overflow must not add one.
|
|
104
|
-
textOverflow:
|
|
105
|
-
flexShrink: n <
|
|
97
|
+
textOverflow: i ? "clip" : "ellipsis",
|
|
98
|
+
flexShrink: n < w ? 1e3 * (w - n) : 1
|
|
106
99
|
};
|
|
107
|
-
},
|
|
100
|
+
}, _ = (e, n) => t.map((o, s) => (
|
|
108
101
|
// Positional: an index is a level of the path, and texts repeat ("Acme / Acme").
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
102
|
+
/* @__PURE__ */ L(D.Fragment, { children: [
|
|
103
|
+
s > 0 && /* @__PURE__ */ f("span", { "data-tone": n ? "secondary" : void 0, style: G, children: r }),
|
|
111
104
|
/* @__PURE__ */ f(
|
|
112
105
|
"span",
|
|
113
106
|
{
|
|
114
107
|
"data-tone": n ? p(o) : void 0,
|
|
115
|
-
style: n ?
|
|
116
|
-
children: e[
|
|
108
|
+
style: n ? T[p(o)] : P(o, s),
|
|
109
|
+
children: e[s]
|
|
117
110
|
}
|
|
118
111
|
)
|
|
119
|
-
] },
|
|
112
|
+
] }, s)
|
|
120
113
|
));
|
|
121
114
|
return /* @__PURE__ */ f(
|
|
122
115
|
U,
|
|
123
116
|
{
|
|
124
|
-
text: m ??
|
|
117
|
+
text: m ?? O,
|
|
125
118
|
placement: c,
|
|
126
119
|
triggerAs: "span",
|
|
127
120
|
describesTrigger: !1,
|
|
128
121
|
suppressed: h,
|
|
129
122
|
isShrinkable: !0,
|
|
130
123
|
shouldShow: () => {
|
|
131
|
-
if (
|
|
132
|
-
return
|
|
133
|
-
const e =
|
|
124
|
+
if (i)
|
|
125
|
+
return i.truncated;
|
|
126
|
+
const e = A.current;
|
|
134
127
|
return !!e && [...e.children].some((n) => n.scrollWidth > n.clientWidth);
|
|
135
128
|
},
|
|
136
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ L(
|
|
137
130
|
"span",
|
|
138
131
|
{
|
|
139
132
|
ref: u,
|
|
140
133
|
className: y,
|
|
141
|
-
style: d ? { ...k, fontSize:
|
|
134
|
+
style: d ? { ...k, fontSize: Z(d) } : k,
|
|
142
135
|
children: [
|
|
143
|
-
/* @__PURE__ */ f("span", { ref:
|
|
136
|
+
/* @__PURE__ */ f("span", { ref: v, "aria-hidden": "true", style: z, children: _(
|
|
144
137
|
t.map((e) => e.text),
|
|
145
138
|
!0
|
|
146
139
|
) }),
|
|
147
|
-
/* @__PURE__ */ f("span", { ref:
|
|
148
|
-
/* @__PURE__ */ f("span", { style:
|
|
140
|
+
/* @__PURE__ */ f("span", { ref: A, "aria-hidden": "true", style: B, children: _((i == null ? void 0 : i.texts) ?? t.map((e) => e.text), !1) }),
|
|
141
|
+
/* @__PURE__ */ f("span", { style: Y, children: O })
|
|
149
142
|
]
|
|
150
143
|
}
|
|
151
144
|
)
|
|
@@ -153,6 +146,6 @@ const k = {
|
|
|
153
146
|
);
|
|
154
147
|
};
|
|
155
148
|
export {
|
|
156
|
-
|
|
149
|
+
lt as default
|
|
157
150
|
};
|
|
158
151
|
//# sourceMappingURL=PathText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathText.js","sources":["../../../src/components/Typography/PathText.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport Tooltip from '../Tooltip';\nimport { DEFAULT_MIN_CHARS, type FitSegment, type PathFit, fitPath } from './pathTextFit';\nimport { fontOf, measurerFor, observePath, scheduleRemeasure } from './pathTextMeasure';\nimport { type FontSize, getFontSize, getFontWeight } from './textStyles';\n\n/** `default` takes the surrounding colour and weight; `secondary` recedes, as an ancestor should. */\nexport type PathTextTone = 'default' | 'secondary';\n\nexport interface PathTextSegment {\n text: string;\n tone?: PathTextTone;\n /** Kept when cut, before the next segment gives way. Defaults to 2; ignored on the last. */\n minChars?: number;\n}\n\nexport interface PathTextProps {\n /** Root first, leaf last; segments give way in that order, so the leaf stays whole longest. */\n segments: PathTextSegment[];\n /** Drawn between segments, never cut. Defaults to `' / '`. */\n separator?: string;\n /** Inherits the surrounding size when unset. */\n size?: FontSize;\n /** Shown when anything is cut. Defaults to the whole path; pass a node to wrap it. */\n tooltip?: React.ReactNode;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n /** Holds the tooltip back, e.g. while the menu this path labels is open. */\n tooltipSuppressed?: boolean;\n className?: string;\n}\n\ninterface Measured {\n width: number;\n fonts: Partial<Record<PathTextTone, string>>;\n}\n\n// Inline styles, not classes: a path can sit in a menu portaled out of the shadow root.\n// SIZER keeps the uncut width, or a cut path would shrink its own box and be cut again.\nconst ROOT: React.CSSProperties = {\n display: 'grid',\n gridTemplateColumns: 'minmax(0, 1fr)',\n minWidth: 0,\n maxWidth: '100%',\n};\nconst SIZER: React.CSSProperties = {\n gridArea: '1 / 1',\n height: 0,\n overflow: 'hidden',\n visibility: 'hidden',\n whiteSpace: 'pre',\n};\nconst LINE: React.CSSProperties = {\n gridArea: '1 / 1',\n display: 'flex',\n minWidth: 0,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n};\nconst VISUALLY_HIDDEN: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\nconst TONE: Record<PathTextTone, React.CSSProperties> = {\n default: {},\n secondary: {\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n fontWeight: getFontWeight('normal'),\n },\n};\nconst SEPARATOR: React.CSSProperties = { ...TONE.secondary, flexShrink: 0, whiteSpace: 'pre' };\n\nconst toneOf = (segment: PathTextSegment): PathTextTone => segment.tone ?? 'default';\n\nconst sameMeasured = (a: Measured | null, b: Measured): boolean =>\n a !== null &&\n a.width === b.width &&\n a.fonts.default === b.fonts.default &&\n a.fonts.secondary === b.fonts.secondary;\n\nconst fitOf = (\n measured: Measured | null,\n segments: PathTextSegment[],\n separator: string,\n): PathFit | null => {\n if (!measured || measured.width <= 0) {\n return null;\n }\n const fitSegments: FitSegment[] = [];\n for (const segment of segments) {\n const measure = measurerFor(measured.fonts[toneOf(segment)] ?? '');\n if (!measure) {\n return null;\n }\n fitSegments.push({\n text: segment.text,\n minChars: segment.minChars ?? DEFAULT_MIN_CHARS,\n measure,\n });\n }\n const measureSeparator = measurerFor(measured.fonts.secondary ?? '');\n if (segments.length > 1 && !measureSeparator) {\n return null;\n }\n return fitPath({\n available: measured.width,\n segments: fitSegments,\n separatorWidth: measureSeparator?.(separator) ?? 0,\n });\n};\n\n/**\n * Canvas-measured, not `text-overflow`, which leaves a space before the ellipsis and cannot hold\n * a minimum length. Unmeasured (no canvas yet), `flex-shrink` gives the same priority.\n */\nconst PathText: React.FC<PathTextProps> = ({\n segments,\n separator = ' / ',\n size,\n tooltip,\n tooltipPlacement = 'top',\n tooltipSuppressed = false,\n className,\n}) => {\n const rootRef = useRef<HTMLSpanElement>(null);\n const sizerRef = useRef<HTMLSpanElement>(null);\n const lineRef = useRef<HTMLSpanElement>(null);\n const [measured, setMeasured] = useState<Measured | null>(null);\n // Fonts are read on first measure and on refresh only: a resize must not force a style read.\n const fontsRef = useRef<Measured['fonts'] | null>(null);\n const empty = segments.length === 0;\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: the root only exists once there are segments\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n return observePath(root, (width, refreshFonts) => {\n const sizer = sizerRef.current;\n if (!sizer) {\n return;\n }\n if (refreshFonts || !fontsRef.current) {\n const read: Measured['fonts'] = {};\n for (const node of sizer.querySelectorAll<HTMLElement>('[data-tone]')) {\n const tone = node.dataset.tone as PathTextTone;\n read[tone] ??= fontOf(node);\n }\n fontsRef.current = read;\n }\n const next = { width, fonts: fontsRef.current };\n setMeasured((previous) => (sameMeasured(previous, next) ? previous : next));\n });\n }, [empty]);\n\n const tones = new Set<PathTextTone>(segments.map(toneOf));\n if (segments.length > 1) {\n tones.add('secondary');\n }\n const toneKey = [...tones].sort().join(' ');\n useEffect(() => {\n const root = rootRef.current;\n const missing = toneKey.split(' ').some((tone) => !measured?.fonts[tone as PathTextTone]);\n if (root && measured && missing) {\n scheduleRemeasure(root);\n }\n }, [toneKey, measured]);\n\n // A new size keeps a cut path's box the same width, so the observer would not refire.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-reads the fonts when `size` changes\n useEffect(() => {\n if (rootRef.current) {\n scheduleRemeasure(rootRef.current);\n }\n }, [size]);\n\n if (empty) {\n return null;\n }\n\n const fit = fitOf(measured, segments, separator);\n const last = segments.length - 1;\n const fullText = segments.map((segment) => segment.text).join(separator);\n\n const segmentStyle = (segment: PathTextSegment, index: number): React.CSSProperties => {\n const minChars = segment.minChars ?? DEFAULT_MIN_CHARS;\n const keepsMinimum = !fit && index < last && segment.text.length > minChars + 1;\n return {\n ...TONE[toneOf(segment)],\n minWidth: keepsMinimum ? `${minChars + 1}ch` : 0,\n overflow: 'hidden',\n // Fitted text already carries its ellipsis; a sub-pixel overflow must not add one.\n textOverflow: fit ? 'clip' : 'ellipsis',\n flexShrink: index < last ? 1000 * (last - index) : 1,\n };\n };\n\n const renderSegments = (texts: string[], forSizer: boolean) =>\n segments.map((segment, index) => (\n // Positional: an index is a level of the path, and texts repeat (\"Acme / Acme\").\n <React.Fragment key={index}>\n {index > 0 && (\n <span data-tone={forSizer ? 'secondary' : undefined} style={SEPARATOR}>\n {separator}\n </span>\n )}\n <span\n data-tone={forSizer ? toneOf(segment) : undefined}\n style={forSizer ? TONE[toneOf(segment)] : segmentStyle(segment, index)}\n >\n {texts[index]}\n </span>\n </React.Fragment>\n ));\n\n const isCut = (): boolean => {\n if (fit) {\n return fit.truncated;\n }\n const line = lineRef.current;\n return !!line && [...line.children].some((child) => child.scrollWidth > child.clientWidth);\n };\n\n return (\n <Tooltip\n text={tooltip ?? fullText}\n placement={tooltipPlacement}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={tooltipSuppressed}\n isShrinkable\n shouldShow={isCut}\n >\n <span\n ref={rootRef}\n className={className}\n style={size ? { ...ROOT, fontSize: getFontSize(size) } : ROOT}\n >\n <span ref={sizerRef} aria-hidden=\"true\" style={SIZER}>\n {renderSegments(\n segments.map((segment) => segment.text),\n true,\n )}\n </span>\n <span ref={lineRef} aria-hidden=\"true\" style={LINE}>\n {renderSegments(fit?.texts ?? segments.map((segment) => segment.text), false)}\n </span>\n <span style={VISUALLY_HIDDEN}>{fullText}</span>\n </span>\n </Tooltip>\n );\n};\n\nexport default PathText;\n"],"names":["ROOT","SIZER","LINE","VISUALLY_HIDDEN","TONE","getFontWeight","SEPARATOR","toneOf","segment","sameMeasured","a","b","fitOf","measured","segments","separator","fitSegments","measure","measurerFor","DEFAULT_MIN_CHARS","measureSeparator","fitPath","PathText","size","tooltip","tooltipPlacement","tooltipSuppressed","className","rootRef","useRef","sizerRef","lineRef","setMeasured","useState","fontsRef","empty","useEffect","root","observePath","width","refreshFonts","sizer","read","node","tone","fontOf","next","previous","tones","toneKey","missing","scheduleRemeasure","fit","last","fullText","segmentStyle","index","minChars","keepsMinimum","renderSegments","texts","forSizer","jsxs","React","jsx","Tooltip","line","child","getFontSize"],"mappings":";;;;;;AAsCA,MAAMA,IAA4B;AAAA,EAC9B,SAAS;AAAA,EACT,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,UAAU;AACd,GACMC,IAA6B;AAAA,EAC/B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAChB,GACMC,IAA4B;AAAA,EAC9B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GACMC,IAAuC;AAAA,EACzC,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GACMC,IAAkD;AAAA,EACpD,SAAS,CAAA;AAAA,EACT,WAAW;AAAA,IACP,OAAO;AAAA,IACP,YAAYC,EAAc,QAAQ;AAAA,EAAA;AAE1C,GACMC,IAAiC,EAAE,GAAGF,EAAK,WAAW,YAAY,GAAG,YAAY,MAAA,GAEjFG,IAAS,CAACC,MAA2CA,EAAQ,QAAQ,WAErEC,IAAe,CAACC,GAAoBC,MACtCD,MAAM,QACNA,EAAE,UAAUC,EAAE,SACdD,EAAE,MAAM,YAAYC,EAAE,MAA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AD;AAAA,UACA,OAAOJ,IAAO,EAAE,GAAGvB,GAAM,UAAUoE,EAAY7C,CAAI,EAAA,IAAMvB;AAAA,UAEzD,UAAA;AAAA,YAAA,gBAAAgE,EAAC,UAAK,KAAKlC,GAAU,eAAY,QAAO,OAAO7B,GAC1C,UAAA0D;AAAA,cACG7C,EAAS,IAAI,CAACN,MAAYA,EAAQ,IAAI;AAAA,cACtC;AAAA,YAAA,GAER;AAAA,8BACC,QAAA,EAAK,KAAKuB,GAAS,eAAY,QAAO,OAAO7B,GACzC,UAAAyD,GAAeP,KAAA,gBAAAA,EAAK,UAAStC,EAAS,IAAI,CAACN,MAAYA,EAAQ,IAAI,GAAG,EAAK,GAChF;AAAA,YACA,gBAAAwD,EAAC,QAAA,EAAK,OAAO7D,GAAkB,UAAAmD,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5C;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"PathText.js","sources":["../../../src/components/Typography/PathText.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport Tooltip from '../Tooltip';\nimport { VISUALLY_HIDDEN_STYLE } from '../visuallyHiddenStyle';\nimport { DEFAULT_MIN_CHARS, type FitSegment, type PathFit, fitPath } from './pathTextFit';\nimport { fontOf, measurerFor, observePath, scheduleRemeasure } from './pathTextMeasure';\nimport { type FontSize, getFontSize, getFontWeight } from './textStyles';\n\n/** `default` takes the surrounding colour and weight; `secondary` recedes, as an ancestor should. */\nexport type PathTextTone = 'default' | 'secondary';\n\nexport interface PathTextSegment {\n text: string;\n tone?: PathTextTone;\n /** Kept when cut, before the next segment gives way. Defaults to 2; ignored on the last. */\n minChars?: number;\n}\n\nexport interface PathTextProps {\n /** Root first, leaf last; segments give way in that order, so the leaf stays whole longest. */\n segments: PathTextSegment[];\n /** Drawn between segments, never cut. Defaults to `' / '`. */\n separator?: string;\n /** Inherits the surrounding size when unset. */\n size?: FontSize;\n /** Shown when anything is cut. Defaults to the whole path; pass a node to wrap it. */\n tooltip?: React.ReactNode;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n /** Holds the tooltip back, e.g. while the menu this path labels is open. */\n tooltipSuppressed?: boolean;\n className?: string;\n}\n\ninterface Measured {\n width: number;\n fonts: Partial<Record<PathTextTone, string>>;\n}\n\n// Inline styles, not classes: a path can sit in a menu portaled out of the shadow root.\n// SIZER keeps the uncut width, or a cut path would shrink its own box and be cut again.\nconst ROOT: React.CSSProperties = {\n display: 'grid',\n gridTemplateColumns: 'minmax(0, 1fr)',\n minWidth: 0,\n maxWidth: '100%',\n};\nconst SIZER: React.CSSProperties = {\n gridArea: '1 / 1',\n height: 0,\n overflow: 'hidden',\n visibility: 'hidden',\n whiteSpace: 'pre',\n};\nconst LINE: React.CSSProperties = {\n gridArea: '1 / 1',\n display: 'flex',\n minWidth: 0,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n};\nconst TONE: Record<PathTextTone, React.CSSProperties> = {\n default: {},\n secondary: {\n color: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n fontWeight: getFontWeight('normal'),\n },\n};\nconst SEPARATOR: React.CSSProperties = { ...TONE.secondary, flexShrink: 0, whiteSpace: 'pre' };\n\nconst toneOf = (segment: PathTextSegment): PathTextTone => segment.tone ?? 'default';\n\nconst sameMeasured = (a: Measured | null, b: Measured): boolean =>\n a !== null &&\n a.width === b.width &&\n a.fonts.default === b.fonts.default &&\n a.fonts.secondary === b.fonts.secondary;\n\nconst fitOf = (\n measured: Measured | null,\n segments: PathTextSegment[],\n separator: string,\n): PathFit | null => {\n if (!measured || measured.width <= 0) {\n return null;\n }\n const fitSegments: FitSegment[] = [];\n for (const segment of segments) {\n const measure = measurerFor(measured.fonts[toneOf(segment)] ?? '');\n if (!measure) {\n return null;\n }\n fitSegments.push({\n text: segment.text,\n minChars: segment.minChars ?? DEFAULT_MIN_CHARS,\n measure,\n });\n }\n const measureSeparator = measurerFor(measured.fonts.secondary ?? '');\n if (segments.length > 1 && !measureSeparator) {\n return null;\n }\n return fitPath({\n available: measured.width,\n segments: fitSegments,\n separatorWidth: measureSeparator?.(separator) ?? 0,\n });\n};\n\n/**\n * Canvas-measured, not `text-overflow`, which leaves a space before the ellipsis and cannot hold\n * a minimum length. Unmeasured (no canvas yet), `flex-shrink` gives the same priority.\n */\nconst PathText: React.FC<PathTextProps> = ({\n segments,\n separator = ' / ',\n size,\n tooltip,\n tooltipPlacement = 'top',\n tooltipSuppressed = false,\n className,\n}) => {\n const rootRef = useRef<HTMLSpanElement>(null);\n const sizerRef = useRef<HTMLSpanElement>(null);\n const lineRef = useRef<HTMLSpanElement>(null);\n const [measured, setMeasured] = useState<Measured | null>(null);\n // Fonts are read on first measure and on refresh only: a resize must not force a style read.\n const fontsRef = useRef<Measured['fonts'] | null>(null);\n const empty = segments.length === 0;\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: the root only exists once there are segments\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n return observePath(root, (width, refreshFonts) => {\n const sizer = sizerRef.current;\n if (!sizer) {\n return;\n }\n if (refreshFonts || !fontsRef.current) {\n const read: Measured['fonts'] = {};\n for (const node of sizer.querySelectorAll<HTMLElement>('[data-tone]')) {\n const tone = node.dataset.tone as PathTextTone;\n read[tone] ??= fontOf(node);\n }\n fontsRef.current = read;\n }\n const next = { width, fonts: fontsRef.current };\n setMeasured((previous) => (sameMeasured(previous, next) ? previous : next));\n });\n }, [empty]);\n\n const tones = new Set<PathTextTone>(segments.map(toneOf));\n if (segments.length > 1) {\n tones.add('secondary');\n }\n const toneKey = [...tones].sort().join(' ');\n useEffect(() => {\n const root = rootRef.current;\n const missing = toneKey.split(' ').some((tone) => !measured?.fonts[tone as PathTextTone]);\n if (root && measured && missing) {\n scheduleRemeasure(root);\n }\n }, [toneKey, measured]);\n\n // A new size keeps a cut path's box the same width, so the observer would not refire.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-reads the fonts when `size` changes\n useEffect(() => {\n if (rootRef.current) {\n scheduleRemeasure(rootRef.current);\n }\n }, [size]);\n\n if (empty) {\n return null;\n }\n\n const fit = fitOf(measured, segments, separator);\n const last = segments.length - 1;\n const fullText = segments.map((segment) => segment.text).join(separator);\n\n const segmentStyle = (segment: PathTextSegment, index: number): React.CSSProperties => {\n const minChars = segment.minChars ?? DEFAULT_MIN_CHARS;\n const keepsMinimum = !fit && index < last && segment.text.length > minChars + 1;\n return {\n ...TONE[toneOf(segment)],\n minWidth: keepsMinimum ? `${minChars + 1}ch` : 0,\n overflow: 'hidden',\n // Fitted text already carries its ellipsis; a sub-pixel overflow must not add one.\n textOverflow: fit ? 'clip' : 'ellipsis',\n flexShrink: index < last ? 1000 * (last - index) : 1,\n };\n };\n\n const renderSegments = (texts: string[], forSizer: boolean) =>\n segments.map((segment, index) => (\n // Positional: an index is a level of the path, and texts repeat (\"Acme / Acme\").\n <React.Fragment key={index}>\n {index > 0 && (\n <span data-tone={forSizer ? 'secondary' : undefined} style={SEPARATOR}>\n {separator}\n </span>\n )}\n <span\n data-tone={forSizer ? toneOf(segment) : undefined}\n style={forSizer ? TONE[toneOf(segment)] : segmentStyle(segment, index)}\n >\n {texts[index]}\n </span>\n </React.Fragment>\n ));\n\n const isCut = (): boolean => {\n if (fit) {\n return fit.truncated;\n }\n const line = lineRef.current;\n return !!line && [...line.children].some((child) => child.scrollWidth > child.clientWidth);\n };\n\n return (\n <Tooltip\n text={tooltip ?? fullText}\n placement={tooltipPlacement}\n triggerAs=\"span\"\n describesTrigger={false}\n suppressed={tooltipSuppressed}\n isShrinkable\n shouldShow={isCut}\n >\n <span\n ref={rootRef}\n className={className}\n style={size ? { ...ROOT, fontSize: getFontSize(size) } : ROOT}\n >\n <span ref={sizerRef} aria-hidden=\"true\" style={SIZER}>\n {renderSegments(\n segments.map((segment) => segment.text),\n true,\n )}\n </span>\n <span ref={lineRef} aria-hidden=\"true\" style={LINE}>\n {renderSegments(fit?.texts ?? segments.map((segment) => segment.text), false)}\n </span>\n <span style={VISUALLY_HIDDEN_STYLE}>{fullText}</span>\n </span>\n </Tooltip>\n );\n};\n\nexport default PathText;\n"],"names":["ROOT","SIZER","LINE","TONE","getFontWeight","SEPARATOR","toneOf","segment","sameMeasured","a","b","fitOf","measured","segments","separator","fitSegments","measure","measurerFor","DEFAULT_MIN_CHARS","measureSeparator","fitPath","PathText","size","tooltip","tooltipPlacement","tooltipSuppressed","className","rootRef","useRef","sizerRef","lineRef","setMeasured","useState","fontsRef","empty","useEffect","root","observePath","width","refreshFonts","sizer","read","node","tone","fontOf","next","previous","tones","toneKey","missing","scheduleRemeasure","fit","last","fullText","segmentStyle","index","minChars","keepsMinimum","renderSegments","texts","forSizer","jsxs","React","jsx","Tooltip","line","child","getFontSize","VISUALLY_HIDDEN_STYLE"],"mappings":";;;;;;;AAuCA,MAAMA,IAA4B;AAAA,EAC9B,SAAS;AAAA,EACT,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,UAAU;AACd,GACMC,IAA6B;AAAA,EAC/B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAChB,GACMC,IAA4B;AAAA,EAC9B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAChB,GACMC,IAAkD;AAAA,EACpD,SAAS,CAAA;AAAA,EACT,WAAW;AAAA,IACP,OAAO;AAAA,IACP,YAAYC,EAAc,QAAQ;AAAA,EAAA;AAE1C,GACMC,IAAiC,EAAE,GAAGF,EAAK,WAAW,YAAY,GAAG,YAAY,MAAA,GAEjFG,IAAS,CAACC,MAA2CA,EAAQ,QAAQ,WAErEC,IAAe,CAACC,GAAoBC,MACtCD,MAAM,QACNA,EAAE,UAAUC,EAAE,SACdD,EAAE,MAAM,YAAYC,EAAE,MAAM,WAC5BD,EAAE,MAAM,cAAcC,EAAE,MAAM,WAE5BC,IAAQ,CACVC,GACAC,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I,EAAA,IAAMtB;AAAA,UAEzD,UAAA;AAAA,YAAA,gBAAA+D,EAAC,UAAK,KAAKlC,GAAU,eAAY,QAAO,OAAO5B,GAC1C,UAAAyD;AAAA,cACG7C,EAAS,IAAI,CAACN,MAAYA,EAAQ,IAAI;AAAA,cACtC;AAAA,YAAA,GAER;AAAA,8BACC,QAAA,EAAK,KAAKuB,GAAS,eAAY,QAAO,OAAO5B,GACzC,UAAAwD,GAAeP,KAAA,gBAAAA,EAAK,UAAStC,EAAS,IAAI,CAACN,MAAYA,EAAQ,IAAI,GAAG,EAAK,GAChF;AAAA,YACA,gBAAAwD,EAAC,QAAA,EAAK,OAAOK,GAAwB,UAAAf,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAClD;AAAA,EAAA;AAGZ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { VISUALLY_HIDDEN_STYLE as t } from "./visuallyHiddenStyle.js";
|
|
3
|
+
const e = ({ children: o }) => /* @__PURE__ */ s("span", { style: t, children: o });
|
|
4
|
+
export {
|
|
5
|
+
e as VisuallyHidden,
|
|
6
|
+
e as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=VisuallyHidden.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.js","sources":["../../src/components/VisuallyHidden.tsx"],"sourcesContent":["import type React from 'react';\nimport { VISUALLY_HIDDEN_STYLE } from './visuallyHiddenStyle';\n\nexport interface VisuallyHiddenProps {\n children: React.ReactNode;\n}\n\n/**\n * Text for assistive technology only: painted nowhere, in the light DOM or a shadow root, and\n * still read as ordinary content. Prefer it to `aria-label` on a plain span, whose generic role\n * prohibits an accessible name.\n */\nconst VisuallyHidden: React.FC<VisuallyHiddenProps> = ({ children }) => (\n <span style={VISUALLY_HIDDEN_STYLE}>{children}</span>\n);\n\nexport default VisuallyHidden;\nexport { VisuallyHidden };\n"],"names":["VisuallyHidden","children","jsx","VISUALLY_HIDDEN_STYLE"],"mappings":";;AAYA,MAAMA,IAAgD,CAAC,EAAE,UAAAC,QACrD,gBAAAC,EAAC,QAAA,EAAK,OAAOC,GAAwB,UAAAF,EAAA,CAAS;"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { MENU_SPECS as o } from "./floatingMenuGeometry.js";
|
|
2
|
-
import { injectStyleSheet as
|
|
2
|
+
import { injectStyleSheet as E } from "./injectStyleSheet.js";
|
|
3
3
|
import { SELECTED_OPTION_BACKGROUND as b } from "./optionRowStyles.js";
|
|
4
4
|
import { ensureOverlayStyles as p } from "./portalOverlay.js";
|
|
5
|
-
import { SELECTED_ROW_FOREGROUND as
|
|
6
|
-
const
|
|
5
|
+
import { SELECTED_ROW_FOREGROUND as S, SELECTED_ROW_BACKGROUND as g } from "./selectedRow.js";
|
|
6
|
+
const U = {
|
|
7
7
|
small: { icon: 16, iconBox: "text-[16px] [&_svg]:size-[16px]!" },
|
|
8
8
|
xsmall: { icon: 11, iconBox: "text-[11px] [&_svg]:size-[11px]!" }
|
|
9
9
|
}, u = {
|
|
10
10
|
minWidth: 0,
|
|
11
11
|
overflow: "hidden",
|
|
12
12
|
textOverflow: "ellipsis"
|
|
13
|
-
}, X = {
|
|
14
|
-
position: "absolute",
|
|
15
|
-
width: 1,
|
|
16
|
-
height: 1,
|
|
17
|
-
margin: -1,
|
|
18
|
-
overflow: "hidden",
|
|
19
|
-
clipPath: "inset(50%)",
|
|
20
|
-
whiteSpace: "nowrap"
|
|
21
13
|
}, O = {
|
|
22
14
|
flexShrink: 0,
|
|
23
15
|
padding: "6px 10px",
|
|
@@ -30,10 +22,10 @@ const B = {
|
|
|
30
22
|
overflow: "hidden",
|
|
31
23
|
textOverflow: "ellipsis",
|
|
32
24
|
whiteSpace: "nowrap"
|
|
33
|
-
},
|
|
25
|
+
}, X = {
|
|
34
26
|
...m,
|
|
35
27
|
fontSize: "calc(var(--malachite-font-size-small, 13px) - 1px)"
|
|
36
|
-
}, W = { color: "inherit", fontSize: "inherit" },
|
|
28
|
+
}, W = { color: "inherit", fontSize: "inherit" }, V = {
|
|
37
29
|
...u,
|
|
38
30
|
display: "flex",
|
|
39
31
|
flexDirection: "column",
|
|
@@ -45,21 +37,21 @@ const B = {
|
|
|
45
37
|
}, I = {
|
|
46
38
|
...c,
|
|
47
39
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
48
|
-
}, L = { ...c, color: "inherit" }, l = "malachite-actionmenu-item-description",
|
|
40
|
+
}, L = { ...c, color: "inherit" }, l = "malachite-actionmenu-item-description", K = (e) => e.danger === "hover" ? c : e.danger || e.current ? L : I, T = {
|
|
49
41
|
display: "inline-flex",
|
|
50
42
|
flexShrink: 0,
|
|
51
43
|
width: 14,
|
|
52
44
|
marginLeft: "auto"
|
|
53
|
-
},
|
|
45
|
+
}, x = "var(--malachite-accent-foreground, rgb(2, 122, 66))", y = {
|
|
54
46
|
...T,
|
|
55
|
-
color:
|
|
56
|
-
},
|
|
47
|
+
color: x
|
|
48
|
+
}, N = {
|
|
57
49
|
warning: "var(--malachite-warning-foreground, rgb(150, 88, 10))",
|
|
58
|
-
accent:
|
|
59
|
-
},
|
|
50
|
+
accent: x
|
|
51
|
+
}, _ = (e) => !!e.danger || !!e.disabled || !!e.current, f = (e) => _(e) ? void 0 : e.intent, R = (e, t) => t && e.checked === !0 && !!e.group && !_(e) && !e.intent, F = (e, t) => R(e, t) ? y : T, v = { display: "inline-flex", flexShrink: 0 }, C = {
|
|
60
52
|
...v,
|
|
61
53
|
color: "var(--malachite-text-dimmed, rgb(161, 161, 161))"
|
|
62
|
-
},
|
|
54
|
+
}, j = (e) => e.danger === "hover" || f(e) ? v : C, d = "malachite-actionmenu-item-icon", r = "malachite-actionmenu-item", $ = "data-malachite-actionmenu-tag", Z = { display: "inline-flex", flexShrink: 0 }, q = { [$]: "" }, s = "data-chosen", w = [
|
|
63
55
|
`.${r} { background: transparent; }`,
|
|
64
56
|
`.${r}:not(:disabled):hover { background: var(--malachite-card-dimmed-background, rgb(247, 247, 247)); }`,
|
|
65
57
|
// As a Dropdown's selected option, keeping its ground on hover.
|
|
@@ -69,12 +61,12 @@ const B = {
|
|
|
69
61
|
`${a} { color: var(--malachite-text-primary, rgb(10, 10, 10)); }`,
|
|
70
62
|
`${a}[data-tone="muted"] { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
|
|
71
63
|
`${a} > .${d} { color: var(--malachite-text-dimmed, rgb(161, 161, 161)); }`,
|
|
72
|
-
`${a}[aria-current] { color: ${
|
|
64
|
+
`${a}[aria-current] { color: ${S}; background: ${g}; }`,
|
|
73
65
|
`${n} { color: var(--malachite-text-destructive, rgb(237, 53, 54)); background: var(--malachite-error-background-glass, rgba(197, 63, 63, 0.08)); }`,
|
|
74
66
|
`${n} > .${d} { color: inherit; }`,
|
|
75
67
|
`${a}:not([aria-current]) .${l} { color: var(--malachite-text-secondary, rgb(123, 123, 123)); }`,
|
|
76
68
|
`${n} .${l} { color: inherit; }`
|
|
77
|
-
],
|
|
69
|
+
], k = () => E("malachite-actionmenu-danger-hover-styles", A), J = () => (p(), k(), E("malachite-actionmenu-item-styles-v2", w)), D = {
|
|
78
70
|
default: "var(--malachite-text-primary, rgb(10, 10, 10))",
|
|
79
71
|
muted: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
80
72
|
}, Y = (e, t) => {
|
|
@@ -83,10 +75,10 @@ const B = {
|
|
|
83
75
|
if (e.danger === "hover")
|
|
84
76
|
return;
|
|
85
77
|
if (e.current)
|
|
86
|
-
return
|
|
78
|
+
return S;
|
|
87
79
|
const i = f(e);
|
|
88
|
-
return i ?
|
|
89
|
-
},
|
|
80
|
+
return i ? N[i] : D[t];
|
|
81
|
+
}, Q = (e, t = "default") => e.type === "text" ? m : e.type === "divider" ? {
|
|
90
82
|
height: 1,
|
|
91
83
|
flexShrink: 0,
|
|
92
84
|
background: "var(--malachite-card-border, rgb(232, 232, 232))",
|
|
@@ -119,7 +111,7 @@ const B = {
|
|
|
119
111
|
marginLeft: h,
|
|
120
112
|
width: `calc(100% - ${h}px)`
|
|
121
113
|
} : {}
|
|
122
|
-
}, h = 18,
|
|
114
|
+
}, h = 18, ee = {
|
|
123
115
|
position: "absolute",
|
|
124
116
|
left: -10,
|
|
125
117
|
top: -1,
|
|
@@ -131,7 +123,7 @@ const B = {
|
|
|
131
123
|
flexDirection: "column",
|
|
132
124
|
flexShrink: 0,
|
|
133
125
|
gap: 2
|
|
134
|
-
},
|
|
126
|
+
}, te = (e) => ({
|
|
135
127
|
position: "fixed",
|
|
136
128
|
top: (e == null ? void 0 : e.top) ?? 0,
|
|
137
129
|
left: (e == null ? void 0 : e.left) ?? 0,
|
|
@@ -151,27 +143,26 @@ export {
|
|
|
151
143
|
s as CHOSEN_ATTR,
|
|
152
144
|
l as DESCRIPTION_CLASS,
|
|
153
145
|
O as EMPTY_ITEM_STYLE,
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
X as HEADING_ITEM_STYLE,
|
|
147
|
+
ee as INDENT_RULE_STYLE,
|
|
156
148
|
r as ITEM_CLASS,
|
|
157
149
|
d as ITEM_ICON_CLASS,
|
|
158
|
-
|
|
150
|
+
V as ITEM_TEXT_STYLE,
|
|
159
151
|
u as LABEL_STYLE,
|
|
160
152
|
M as MENU_COLUMN_STYLE,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
$ as TAG_HOST_ATTR,
|
|
154
|
+
q as TAG_HOST_PROPS,
|
|
155
|
+
Z as TAG_HOST_STYLE,
|
|
164
156
|
W as TEXT_ITEM_LABEL_STYLE,
|
|
165
157
|
m as TEXT_ITEM_STYLE,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
D as ensureDangerOnHoverStyles,
|
|
158
|
+
U as TRIGGER_SIZES,
|
|
159
|
+
F as checkSlotStyle,
|
|
160
|
+
K as descriptionStyle,
|
|
161
|
+
J as ensureActionMenuStyles,
|
|
162
|
+
k as ensureDangerOnHoverStyles,
|
|
172
163
|
R as isChosen,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
j as itemIconStyle,
|
|
165
|
+
Q as itemStyle,
|
|
166
|
+
te as menuStyle
|
|
176
167
|
};
|
|
177
168
|
//# sourceMappingURL=actionMenuStyles.js.map
|