@leonardaustin/ui 0.27.0 → 0.28.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/dist/components/charts/AreaChart.js +113 -114
- package/dist/components/charts/Heatmap.d.ts +20 -0
- package/dist/components/charts/Heatmap.js +46 -0
- package/dist/components/charts/chartUtils.d.ts +2 -0
- package/dist/components/charts/chartUtils.js +14 -9
- package/dist/components/charts/useChartSize.d.ts +5 -0
- package/dist/components/charts/useChartSize.js +18 -0
- package/dist/components/tables/Pagination.d.ts +3 -1
- package/dist/components/tables/Pagination.js +12 -12
- package/dist/components/tables/ResourceTable.d.ts +5 -0
- package/dist/components/tables/ResourceTable.js +11 -9
- package/dist/components/tables/Table.d.ts +22 -3
- package/dist/components/tables/Table.js +41 -35
- package/dist/components/ui/ActionLink.d.ts +14 -0
- package/dist/components/ui/ActionLink.js +12 -0
- package/dist/components/ui/DateRangePicker.js +107 -76
- package/dist/components/ui/EmptyState.d.ts +8 -6
- package/dist/components/ui/EmptyState.js +11 -10
- package/dist/components/ui/ErrorBoundary.d.ts +6 -0
- package/dist/components/ui/ErrorBoundary.js +11 -5
- package/dist/components/ui/Grid.d.ts +1 -1
- package/dist/components/ui/Icon.d.ts +91 -0
- package/dist/components/ui/Icon.js +98 -0
- package/dist/components/ui/Inline.d.ts +1 -1
- package/dist/components/ui/LoadingSpinner.d.ts +7 -3
- package/dist/components/ui/LoadingSpinner.js +19 -11
- package/dist/components/ui/Meter.d.ts +11 -0
- package/dist/components/ui/Meter.js +7 -0
- package/dist/components/ui/MetricCard.d.ts +11 -8
- package/dist/components/ui/MetricCard.js +18 -15
- package/dist/components/ui/PaginationBar.d.ts +3 -3
- package/dist/components/ui/PaginationBar.js +35 -33
- package/dist/components/ui/SideSheet.d.ts +4 -2
- package/dist/components/ui/SideSheet.js +64 -52
- package/dist/components/ui/Stack.d.ts +1 -1
- package/dist/components/ui/Tabs.d.ts +5 -1
- package/dist/components/ui/Tabs.js +23 -21
- package/dist/components/ui/Text.d.ts +19 -0
- package/dist/components/ui/Text.js +20 -0
- package/dist/components/ui/Toolbar.js +13 -13
- package/dist/core.css +105 -0
- package/dist/hooks/useFocusTrap.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +134 -129
- package/dist/styles.css +106 -0
- package/package.json +1 -1
|
@@ -11,34 +11,34 @@ import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
|
11
11
|
import { X as y } from "lucide-react";
|
|
12
12
|
import { createPortal as b } from "react-dom";
|
|
13
13
|
//#region src/components/ui/SideSheet.tsx
|
|
14
|
-
function x({ open: u, onClose: d, title: f, children: g, footer: x, side: S = "right", widthClassName: C = "w-[360px]", resizable: w = !1,
|
|
15
|
-
let
|
|
16
|
-
n(
|
|
17
|
-
let
|
|
14
|
+
function x({ open: u, onClose: d, title: f, children: g, footer: x, side: S = "right", widthClassName: C = "w-[360px]", resizable: w = !1, fullWidthOnNarrow: T = !1, "aria-label": D, className: O, contentClassName: k, ref: A, style: j, id: M, ...N }) {
|
|
15
|
+
let P = p(), F = c(), I = h(null), [L, R] = s(I), z = m(() => t(A, R), [A, R]);
|
|
16
|
+
n(I, u);
|
|
17
|
+
let B = a(u, () => d());
|
|
18
18
|
return i(u), u ? b(/* @__PURE__ */ _(r.Provider, {
|
|
19
|
-
value:
|
|
19
|
+
value: B,
|
|
20
20
|
children: /* @__PURE__ */ _(o.Provider, {
|
|
21
|
-
value:
|
|
21
|
+
value: L,
|
|
22
22
|
children: /* @__PURE__ */ v("div", {
|
|
23
23
|
className: "fixed inset-0 z-50",
|
|
24
24
|
children: [/* @__PURE__ */ _("div", {
|
|
25
25
|
className: "bg-bg-overlay animate-fade-in absolute inset-0",
|
|
26
26
|
onClick: d
|
|
27
27
|
}), /* @__PURE__ */ v("div", {
|
|
28
|
-
...
|
|
29
|
-
ref:
|
|
30
|
-
id:
|
|
31
|
-
className: e("ui-glass bg-bg-secondary border-border absolute inset-y-0 flex flex-col shadow-lg", C, S === "right" ? "animate-slide-in-right right-0 border-l" : "animate-slide-in-left left-0 border-r",
|
|
28
|
+
...N,
|
|
29
|
+
ref: z,
|
|
30
|
+
id: M ?? (w ? P : void 0),
|
|
31
|
+
className: e("ui-glass bg-bg-secondary border-border absolute inset-y-0 flex flex-col shadow-lg", C, T && "ui-sheet-full-narrow", S === "right" ? "animate-slide-in-right right-0 border-l" : "animate-slide-in-left left-0 border-r", O),
|
|
32
32
|
style: {
|
|
33
33
|
maxWidth: "calc(100vw - 2rem)",
|
|
34
|
-
...
|
|
34
|
+
...j
|
|
35
35
|
},
|
|
36
36
|
role: "dialog",
|
|
37
37
|
"aria-modal": "true",
|
|
38
|
-
"aria-label": typeof f == "string" ? f : "Panel",
|
|
38
|
+
"aria-label": D ?? (typeof f == "string" ? f : "Panel"),
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ v("div", {
|
|
41
|
-
"data-control-size":
|
|
41
|
+
"data-control-size": F,
|
|
42
42
|
className: "ui-bar border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2.5",
|
|
43
43
|
children: [f && /* @__PURE__ */ _("h3", {
|
|
44
44
|
className: "text-text-primary truncate text-sm font-medium",
|
|
@@ -54,17 +54,18 @@ function x({ open: u, onClose: d, title: f, children: g, footer: x, side: S = "r
|
|
|
54
54
|
})]
|
|
55
55
|
}),
|
|
56
56
|
/* @__PURE__ */ _("div", {
|
|
57
|
-
className: e("ui-surface-body flex-1 overflow-y-auto p-3",
|
|
57
|
+
className: e("ui-surface-body flex-1 overflow-y-auto p-3", k),
|
|
58
58
|
children: g
|
|
59
59
|
}),
|
|
60
60
|
x && /* @__PURE__ */ _("div", {
|
|
61
|
-
"data-control-size":
|
|
61
|
+
"data-control-size": F,
|
|
62
62
|
className: "ui-bar border-border bg-bg-primary/50 flex shrink-0 items-center gap-2 border-t px-3 py-2.5",
|
|
63
63
|
children: x
|
|
64
64
|
}),
|
|
65
|
-
w &&
|
|
66
|
-
sheet:
|
|
67
|
-
side: S
|
|
65
|
+
w && L && /* @__PURE__ */ _(E, {
|
|
66
|
+
sheet: L,
|
|
67
|
+
side: S,
|
|
68
|
+
fullWidthOnNarrow: T
|
|
68
69
|
})
|
|
69
70
|
]
|
|
70
71
|
})]
|
|
@@ -91,72 +92,83 @@ function T(e) {
|
|
|
91
92
|
let t = e.ownerDocument.defaultView, n = parseFloat(t.getComputedStyle(e.ownerDocument.documentElement).fontSize);
|
|
92
93
|
return Math.max(0, t.innerWidth - 2 * n);
|
|
93
94
|
}
|
|
94
|
-
function E({ sheet: t, side: n }) {
|
|
95
|
-
let
|
|
95
|
+
function E({ sheet: t, side: n, fullWidthOnNarrow: r }) {
|
|
96
|
+
let i = t.ownerDocument.defaultView, [a, o] = g(() => ({
|
|
96
97
|
width: t.getBoundingClientRect().width,
|
|
97
98
|
min: t.getBoundingClientRect().width,
|
|
98
99
|
max: T(t),
|
|
99
|
-
desktop:
|
|
100
|
-
})),
|
|
101
|
-
function
|
|
102
|
-
|
|
100
|
+
desktop: i.innerWidth >= 640
|
|
101
|
+
})), s = h(null), c = h(null), l = h(null);
|
|
102
|
+
function p() {
|
|
103
|
+
c.current = null, l.current?.(), l.current = null;
|
|
103
104
|
}
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
let m = d((e) => {
|
|
106
|
+
if (r && i.innerWidth < 640) {
|
|
107
|
+
o((e) => e.desktop ? {
|
|
108
|
+
...e,
|
|
109
|
+
desktop: !1
|
|
110
|
+
} : e);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
let n = T(t), a = Math.min(w(t), n), c = i.innerWidth >= 640;
|
|
114
|
+
s.current = c && e !== null ? Math.min(n, Math.max(a, e)) : null, s.current !== null && s.current <= a && (s.current = null), S(t, s.current), o({
|
|
107
115
|
width: t.getBoundingClientRect().width,
|
|
108
|
-
min:
|
|
116
|
+
min: a,
|
|
109
117
|
max: n,
|
|
110
|
-
desktop:
|
|
118
|
+
desktop: c
|
|
111
119
|
});
|
|
112
|
-
}, [
|
|
120
|
+
}, [
|
|
121
|
+
r,
|
|
122
|
+
t,
|
|
123
|
+
i
|
|
124
|
+
]);
|
|
113
125
|
return f(() => {
|
|
114
126
|
let e = () => {
|
|
115
|
-
|
|
116
|
-
}, n = new ResizeObserver(() =>
|
|
117
|
-
return n.observe(t),
|
|
118
|
-
n.disconnect(),
|
|
127
|
+
p(), m(s.current);
|
|
128
|
+
}, n = new ResizeObserver(() => m(s.current));
|
|
129
|
+
return n.observe(t), i.addEventListener("resize", e), () => {
|
|
130
|
+
n.disconnect(), i.removeEventListener("resize", e), p(), S(t, null);
|
|
119
131
|
};
|
|
120
132
|
}, [
|
|
121
|
-
|
|
133
|
+
m,
|
|
122
134
|
t,
|
|
123
|
-
|
|
124
|
-
]),
|
|
135
|
+
i
|
|
136
|
+
]), a.desktop ? /* @__PURE__ */ _("div", {
|
|
125
137
|
role: "separator",
|
|
126
138
|
tabIndex: 0,
|
|
127
139
|
"aria-orientation": "vertical",
|
|
128
140
|
"aria-label": "Resize panel",
|
|
129
141
|
"aria-controls": t.id,
|
|
130
|
-
"aria-valuenow": Math.round(
|
|
131
|
-
"aria-valuemin": Math.round(
|
|
132
|
-
"aria-valuemax": Math.round(
|
|
142
|
+
"aria-valuenow": Math.round(a.width),
|
|
143
|
+
"aria-valuemin": Math.round(a.min),
|
|
144
|
+
"aria-valuemax": Math.round(a.max),
|
|
133
145
|
className: e("hover:bg-accent/30 active:bg-accent/50 focus-visible:outline-accent absolute inset-y-0 z-10 w-1 cursor-col-resize select-none focus-visible:outline-2 focus-visible:outline-offset-0", n === "right" ? "left-0" : "right-0"),
|
|
134
146
|
style: { touchAction: "none" },
|
|
135
147
|
onPointerDown: (e) => {
|
|
136
|
-
if (!e.isPrimary || e.button !== 0 ||
|
|
148
|
+
if (!e.isPrimary || e.button !== 0 || c.current) return;
|
|
137
149
|
e.preventDefault(), e.currentTarget.focus(), e.currentTarget.setPointerCapture(e.pointerId);
|
|
138
150
|
let n = w(t);
|
|
139
|
-
|
|
151
|
+
c.current = {
|
|
140
152
|
pointerId: e.pointerId,
|
|
141
153
|
x: e.clientX,
|
|
142
|
-
width:
|
|
143
|
-
},
|
|
154
|
+
width: s.current ?? n
|
|
155
|
+
}, l.current = C(t);
|
|
144
156
|
},
|
|
145
157
|
onPointerMove: (e) => {
|
|
146
|
-
let t =
|
|
147
|
-
!t || t.pointerId !== e.pointerId ||
|
|
158
|
+
let t = c.current;
|
|
159
|
+
!t || t.pointerId !== e.pointerId || m(t.width + (e.clientX - t.x) * (n === "right" ? -1 : 1));
|
|
148
160
|
},
|
|
149
161
|
onPointerUp: (e) => {
|
|
150
|
-
|
|
162
|
+
c.current?.pointerId === e.pointerId && (p(), e.currentTarget.releasePointerCapture(e.pointerId));
|
|
151
163
|
},
|
|
152
164
|
onPointerCancel: (e) => {
|
|
153
|
-
|
|
165
|
+
c.current?.pointerId === e.pointerId && p();
|
|
154
166
|
},
|
|
155
|
-
onLostPointerCapture:
|
|
156
|
-
onDoubleClick: () =>
|
|
167
|
+
onLostPointerCapture: p,
|
|
168
|
+
onDoubleClick: () => m(null),
|
|
157
169
|
onKeyDown: (e) => {
|
|
158
|
-
let r = u(e.key,
|
|
159
|
-
r !== void 0 && (e.preventDefault(),
|
|
170
|
+
let r = u(e.key, s.current ?? w(t), 16, n);
|
|
171
|
+
r !== void 0 && (e.preventDefault(), m(r));
|
|
160
172
|
}
|
|
161
173
|
}) : null;
|
|
162
174
|
}
|
|
@@ -8,7 +8,7 @@ export interface StackOptions {
|
|
|
8
8
|
justify?: LayoutJustify;
|
|
9
9
|
}
|
|
10
10
|
export type StackProps<E extends LayoutElement = "div"> = LayoutProps<E, StackOptions>;
|
|
11
|
-
export declare function Stack<E extends LayoutElement = "div">({ as, gap, align, justify, className, style, ...props }: StackProps<E>): import("react").DetailedReactHTMLElement<Omit<StackProps<E>, "style" | "className" | "gap" | "
|
|
11
|
+
export declare function Stack<E extends LayoutElement = "div">({ as, gap, align, justify, className, style, ...props }: StackProps<E>): import("react").DetailedReactHTMLElement<Omit<StackProps<E>, "style" | "className" | "gap" | "align" | "justify" | "as"> & {
|
|
12
12
|
className: string;
|
|
13
13
|
style: LayoutStyle;
|
|
14
14
|
}, HTMLElement>;
|
|
@@ -23,5 +23,9 @@ export interface TabsProps extends Omit<ComponentPropsWithRef<"div">, "defaultVa
|
|
|
23
23
|
className?: string;
|
|
24
24
|
/** Extra classes for the active panel. */
|
|
25
25
|
panelClassName?: string;
|
|
26
|
+
/** Accessible name for the tablist. */
|
|
27
|
+
tabListAriaLabel?: string;
|
|
28
|
+
/** Space-separated IDs of elements that label the tablist. */
|
|
29
|
+
tabListAriaLabelledBy?: string;
|
|
26
30
|
}
|
|
27
|
-
export declare function Tabs({ tabs, defaultValue, value, onValueChange, className, panelClassName, ref, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function Tabs({ tabs, defaultValue, value, onValueChange, className, panelClassName, tabListAriaLabel, tabListAriaLabelledBy, ref, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,34 +3,36 @@ import { useControllableState as t } from "../../hooks/useControllableState.js";
|
|
|
3
3
|
import { useId as n, useRef as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/ui/Tabs.tsx
|
|
6
|
-
function o({ tabs: o, defaultValue: s, value: c, onValueChange: l, className: u, panelClassName: d,
|
|
7
|
-
let [
|
|
6
|
+
function o({ tabs: o, defaultValue: s, value: c, onValueChange: l, className: u, panelClassName: d, tabListAriaLabel: f, tabListAriaLabelledBy: p, ref: m, ...h }) {
|
|
7
|
+
let [g, _] = t({
|
|
8
8
|
value: c,
|
|
9
9
|
defaultValue: s || o[0]?.key || "",
|
|
10
10
|
onChange: l
|
|
11
|
-
}),
|
|
12
|
-
function
|
|
13
|
-
let t = o.map((e) => e.key), n = t.indexOf(
|
|
14
|
-
e.key === "ArrowRight" ? r = (n + 1) % o.length : e.key === "ArrowLeft" ? r = (n - 1 + o.length) % o.length : e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || (e.key === "Home" && (r = 0), e.key === "End" && (r = o.length - 1)), r !== null && (e.preventDefault(),
|
|
11
|
+
}), v = o.some((e) => e.key === g) ? g : o[0]?.key ?? "", y = o.find((e) => e.key === v), b = n(), x = r(null);
|
|
12
|
+
function S(e) {
|
|
13
|
+
let t = o.map((e) => e.key), n = t.indexOf(v), r = null;
|
|
14
|
+
e.key === "ArrowRight" ? r = (n + 1) % o.length : e.key === "ArrowLeft" ? r = (n - 1 + o.length) % o.length : e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || (e.key === "Home" && (r = 0), e.key === "End" && (r = o.length - 1)), r !== null && (e.preventDefault(), _(t[r]), (x.current?.querySelectorAll("[role=\"tab\"]"))?.[r]?.focus());
|
|
15
15
|
}
|
|
16
16
|
return /* @__PURE__ */ a("div", {
|
|
17
|
-
ref:
|
|
18
|
-
...
|
|
17
|
+
ref: m,
|
|
18
|
+
...h,
|
|
19
19
|
className: u,
|
|
20
20
|
children: [/* @__PURE__ */ i("div", {
|
|
21
21
|
className: "border-border flex shrink-0 overflow-x-auto border-b",
|
|
22
22
|
role: "tablist",
|
|
23
|
-
|
|
23
|
+
"aria-label": f,
|
|
24
|
+
"aria-labelledby": p,
|
|
25
|
+
ref: x,
|
|
24
26
|
children: o.map((t) => /* @__PURE__ */ a("button", {
|
|
25
27
|
type: "button",
|
|
26
|
-
id: `${
|
|
28
|
+
id: `${b}-tab-${t.key}`,
|
|
27
29
|
role: "tab",
|
|
28
|
-
tabIndex: t.key ===
|
|
29
|
-
"aria-selected": t.key ===
|
|
30
|
-
"aria-controls": `${
|
|
31
|
-
onClick: () =>
|
|
32
|
-
onKeyDown:
|
|
33
|
-
className: e("font-control relative flex shrink-0 cursor-pointer items-center gap-1.5 px-3 py-2 text-xs font-medium transition-colors duration-[100ms] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent", "hover:text-text-primary", t.key ===
|
|
30
|
+
tabIndex: t.key === v ? 0 : -1,
|
|
31
|
+
"aria-selected": t.key === v,
|
|
32
|
+
"aria-controls": `${b}-panel`,
|
|
33
|
+
onClick: () => _(t.key),
|
|
34
|
+
onKeyDown: S,
|
|
35
|
+
className: e("font-control relative flex shrink-0 cursor-pointer items-center gap-1.5 px-3 py-2 text-xs font-medium transition-colors duration-[100ms] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent", "hover:text-text-primary", t.key === v ? "text-accent-fg" : "text-text-tertiary"),
|
|
34
36
|
children: [
|
|
35
37
|
t.icon && /* @__PURE__ */ i("span", {
|
|
36
38
|
"aria-hidden": "true",
|
|
@@ -38,7 +40,7 @@ function o({ tabs: o, defaultValue: s, value: c, onValueChange: l, className: u,
|
|
|
38
40
|
}),
|
|
39
41
|
/* @__PURE__ */ i("span", { children: t.label }),
|
|
40
42
|
t.count != null && /* @__PURE__ */ a("span", {
|
|
41
|
-
className: e("min-w-[18px] rounded-md px-1.5 py-0.5 text-center text-2xs leading-none font-medium", t.key ===
|
|
43
|
+
className: e("min-w-[18px] rounded-md px-1.5 py-0.5 text-center text-2xs leading-none font-medium", t.key === v ? "bg-accent/15 text-accent-fg" : "bg-bg-hover text-text-tertiary"),
|
|
42
44
|
children: [/* @__PURE__ */ i("span", {
|
|
43
45
|
"aria-hidden": "true",
|
|
44
46
|
children: t.count
|
|
@@ -47,15 +49,15 @@ function o({ tabs: o, defaultValue: s, value: c, onValueChange: l, className: u,
|
|
|
47
49
|
children: t.countLabel ?? `${t.count} ${t.count === 1 ? "item" : "items"}`
|
|
48
50
|
})]
|
|
49
51
|
}),
|
|
50
|
-
t.key ===
|
|
52
|
+
t.key === v && /* @__PURE__ */ i("div", { className: "bg-accent absolute right-0 bottom-0 left-0 h-0.5 rounded-md" })
|
|
51
53
|
]
|
|
52
54
|
}, t.key))
|
|
53
55
|
}), /* @__PURE__ */ i("div", {
|
|
54
|
-
id: `${
|
|
56
|
+
id: `${b}-panel`,
|
|
55
57
|
role: "tabpanel",
|
|
56
|
-
"aria-labelledby": `${
|
|
58
|
+
"aria-labelledby": `${b}-tab-${v}`,
|
|
57
59
|
className: e("pt-4", d),
|
|
58
|
-
children:
|
|
60
|
+
children: y?.content
|
|
59
61
|
})]
|
|
60
62
|
});
|
|
61
63
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
declare const tones: {
|
|
3
|
+
primary: string;
|
|
4
|
+
secondary: string;
|
|
5
|
+
muted: string;
|
|
6
|
+
};
|
|
7
|
+
declare const sizes: {
|
|
8
|
+
"2xs": string;
|
|
9
|
+
xs: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
};
|
|
12
|
+
export interface TextProps extends ComponentPropsWithRef<"span"> {
|
|
13
|
+
/** Semantic text colour. */
|
|
14
|
+
tone?: keyof typeof tones;
|
|
15
|
+
/** Theme type size for metadata, body copy or titles. */
|
|
16
|
+
size?: keyof typeof sizes;
|
|
17
|
+
}
|
|
18
|
+
export declare function Text({ tone, size, className, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/Text.tsx
|
|
4
|
+
var n = {
|
|
5
|
+
primary: "text-text-primary",
|
|
6
|
+
secondary: "text-text-secondary",
|
|
7
|
+
muted: "text-text-tertiary"
|
|
8
|
+
}, r = {
|
|
9
|
+
"2xs": "text-2xs",
|
|
10
|
+
xs: "text-xs",
|
|
11
|
+
sm: "text-sm"
|
|
12
|
+
};
|
|
13
|
+
function i({ tone: i = "primary", size: a = "xs", className: o, ...s }) {
|
|
14
|
+
return /* @__PURE__ */ t("span", {
|
|
15
|
+
...s,
|
|
16
|
+
className: e(n[i], r[a], o)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as Text };
|
|
@@ -13,17 +13,18 @@ function d({ start: d, end: f, children: p, className: m, startClassName: h, end
|
|
|
13
13
|
y === void 0 && j(e), x?.(e);
|
|
14
14
|
}, I = n(!!_ && P && D, (e) => {
|
|
15
15
|
e.defaultPrevented || !E.current?.contains(E.current.ownerDocument.activeElement) || (F(!1), T.current?.focus());
|
|
16
|
-
}, E), L =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
}, E), L = {
|
|
17
|
+
...C,
|
|
18
|
+
ref: S,
|
|
19
|
+
role: C.role ?? (C["aria-label"] || C["aria-labelledby"] ? "group" : void 0)
|
|
20
|
+
}, R = /* @__PURE__ */ l("div", {
|
|
21
|
+
...!_ && L,
|
|
22
|
+
className: e("flex min-w-0 flex-wrap items-center justify-between gap-3", !_ && m),
|
|
22
23
|
children: [/* @__PURE__ */ c("div", {
|
|
23
|
-
className: e("
|
|
24
|
+
className: e("ui-toolbar-start min-w-0 flex-wrap items-center gap-3", h),
|
|
24
25
|
children: d ?? p
|
|
25
26
|
}), (f || _) && /* @__PURE__ */ l("div", {
|
|
26
|
-
className: e("flex items-center gap-1.5", g),
|
|
27
|
+
className: e("ui-toolbar-end flex min-w-0 flex-wrap items-center justify-end gap-1.5", g),
|
|
27
28
|
children: [f, _ && /* @__PURE__ */ l("span", {
|
|
28
29
|
className: "relative inline-flex",
|
|
29
30
|
children: [/* @__PURE__ */ c(r, {
|
|
@@ -47,10 +48,9 @@ function d({ start: d, end: f, children: p, className: m, startClassName: h, end
|
|
|
47
48
|
})]
|
|
48
49
|
});
|
|
49
50
|
return _ ? /* @__PURE__ */ l("div", {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children: [L, /* @__PURE__ */ c(t.Provider, {
|
|
51
|
+
...L,
|
|
52
|
+
className: e("min-w-0 space-y-3", m),
|
|
53
|
+
children: [R, /* @__PURE__ */ c(t.Provider, {
|
|
54
54
|
value: I,
|
|
55
55
|
children: /* @__PURE__ */ c("div", {
|
|
56
56
|
ref: E,
|
|
@@ -64,7 +64,7 @@ function d({ start: d, end: f, children: p, className: m, startClassName: h, end
|
|
|
64
64
|
children: _
|
|
65
65
|
})
|
|
66
66
|
})]
|
|
67
|
-
}) :
|
|
67
|
+
}) : R;
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
70
|
export { d as Toolbar };
|
package/dist/core.css
CHANGED
|
@@ -2181,6 +2181,31 @@ select:disabled + .ui-select-placeholder {
|
|
|
2181
2181
|
|
|
2182
2182
|
/* Component defaults stay below consumer utilities in the cascade. */
|
|
2183
2183
|
@layer components {
|
|
2184
|
+
.ui-toolbar-start {
|
|
2185
|
+
display: flex;
|
|
2186
|
+
flex: auto;
|
|
2187
|
+
}
|
|
2188
|
+
.ui-toolbar-start:empty {
|
|
2189
|
+
display: none;
|
|
2190
|
+
}
|
|
2191
|
+
.ui-toolbar-end {
|
|
2192
|
+
margin-inline-start: auto;
|
|
2193
|
+
}
|
|
2194
|
+
:where(.ui-toolbar-start, .ui-toolbar-end),
|
|
2195
|
+
:where(.ui-toolbar-start, .ui-toolbar-end) > * {
|
|
2196
|
+
max-width: 100%;
|
|
2197
|
+
}
|
|
2198
|
+
:where(.ui-toolbar-start, .ui-toolbar-end) > * {
|
|
2199
|
+
min-width: 0;
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
@media (width < 640px) {
|
|
2203
|
+
/* The narrow layout takes precedence over the inline drag width and cap. */
|
|
2204
|
+
.ui-sheet-full-narrow {
|
|
2205
|
+
width: 100% !important;
|
|
2206
|
+
max-width: 100% !important;
|
|
2207
|
+
}}
|
|
2208
|
+
|
|
2184
2209
|
@media (width < 40rem) {
|
|
2185
2210
|
.ui-pagination-count:where(:not(:focus-within)) {
|
|
2186
2211
|
clip-path: inset(50%);
|
|
@@ -2375,6 +2400,17 @@ select:disabled + .ui-select-placeholder {
|
|
|
2375
2400
|
border: var(--ui-border-width, 1px) solid var(--border);
|
|
2376
2401
|
border-radius: var(--ui-radius-md);
|
|
2377
2402
|
background-color: var(--bg-table, transparent);
|
|
2403
|
+
inline-size: 100%;
|
|
2404
|
+
container: ui-table / inline-size;
|
|
2405
|
+
}
|
|
2406
|
+
@container ui-table (max-width: 32rem) {
|
|
2407
|
+
.ui-table-wrap
|
|
2408
|
+
> .ui-table
|
|
2409
|
+
> :is(thead, tbody, tfoot)
|
|
2410
|
+
> tr
|
|
2411
|
+
> .ui-table-low-priority {
|
|
2412
|
+
display: none !important;
|
|
2413
|
+
}
|
|
2378
2414
|
}
|
|
2379
2415
|
.ui-table {
|
|
2380
2416
|
width: 100%;
|
|
@@ -2393,6 +2429,46 @@ select:disabled + .ui-select-placeholder {
|
|
|
2393
2429
|
letter-spacing: var(--ui-tracking);
|
|
2394
2430
|
text-transform: uppercase;
|
|
2395
2431
|
}
|
|
2432
|
+
.ui-table-wrap-embedded {
|
|
2433
|
+
border: 0;
|
|
2434
|
+
border-radius: 0;
|
|
2435
|
+
background-color: transparent;
|
|
2436
|
+
}
|
|
2437
|
+
.ui-table-wrap-embedded > .ui-table:not(.ui-table-sticky) > .ui-table-head {
|
|
2438
|
+
background-color: transparent;
|
|
2439
|
+
}
|
|
2440
|
+
.ui-table-wrap-embedded > .ui-table > .ui-table-body > tr + tr {
|
|
2441
|
+
border-top: 0;
|
|
2442
|
+
}
|
|
2443
|
+
.ui-table-compact {
|
|
2444
|
+
font-size: var(--ui-control-font-size, var(--text-xs));
|
|
2445
|
+
}
|
|
2446
|
+
.ui-table-compact
|
|
2447
|
+
> :is(thead, tbody, tfoot)
|
|
2448
|
+
> tr
|
|
2449
|
+
> :is(th, td):not(.ui-table-empty-cell) {
|
|
2450
|
+
padding-inline: var(--ui-table-cell-padding-x, calc(var(--spacing) * 2));
|
|
2451
|
+
padding-block: var(--ui-table-cell-padding-y, calc(var(--spacing) * 1.5));
|
|
2452
|
+
}
|
|
2453
|
+
.ui-table-header-band > thead > tr > th {
|
|
2454
|
+
color: var(--text-primary);
|
|
2455
|
+
background-color: var(--bg-hover);
|
|
2456
|
+
font-size: inherit;
|
|
2457
|
+
letter-spacing: normal;
|
|
2458
|
+
text-transform: none;
|
|
2459
|
+
}
|
|
2460
|
+
:where(.theme-glass) .ui-table-header-band > thead > tr > th {
|
|
2461
|
+
background-color: var(--glass-solid-hover);
|
|
2462
|
+
}
|
|
2463
|
+
:where(
|
|
2464
|
+
.ui-table-striped > tbody > tr:nth-child(odd):not(.ui-table-empty-row)
|
|
2465
|
+
) {
|
|
2466
|
+
background-color: var(--bg-active);
|
|
2467
|
+
}
|
|
2468
|
+
.ui-table-foot {
|
|
2469
|
+
border-top: var(--ui-border-width, 1px) solid var(--border);
|
|
2470
|
+
font-weight: 600;
|
|
2471
|
+
}
|
|
2396
2472
|
.ui-table-sort-button {
|
|
2397
2473
|
display: inline-flex;
|
|
2398
2474
|
align-items: center;
|
|
@@ -2946,3 +3022,32 @@ button[data-pressed="true"][data-variant="link"] {
|
|
|
2946
3022
|
button[data-variant="link"]:disabled:hover {
|
|
2947
3023
|
text-decoration: none;
|
|
2948
3024
|
}
|
|
3025
|
+
|
|
3026
|
+
.ui-heatmap {
|
|
3027
|
+
font-variant-numeric: tabular-nums;
|
|
3028
|
+
white-space: nowrap;
|
|
3029
|
+
}
|
|
3030
|
+
.ui-heatmap td[data-intensity] {
|
|
3031
|
+
text-align: center;
|
|
3032
|
+
background-color: color-mix(
|
|
3033
|
+
in srgb,
|
|
3034
|
+
var(--accent) var(--heatmap-tint, 0%),
|
|
3035
|
+
var(--bg-primary)
|
|
3036
|
+
);
|
|
3037
|
+
}
|
|
3038
|
+
.ui-heatmap td[data-intensity="1"] {
|
|
3039
|
+
--heatmap-tint: 10%;
|
|
3040
|
+
}
|
|
3041
|
+
.ui-heatmap td[data-intensity="2"] {
|
|
3042
|
+
--heatmap-tint: 20%;
|
|
3043
|
+
}
|
|
3044
|
+
.ui-heatmap td[data-intensity="3"] {
|
|
3045
|
+
--heatmap-tint: 30%;
|
|
3046
|
+
}
|
|
3047
|
+
.ui-heatmap td[data-intensity="4"] {
|
|
3048
|
+
--heatmap-tint: 40%;
|
|
3049
|
+
}
|
|
3050
|
+
.ui-heatmap td[data-intensity="missing"] {
|
|
3051
|
+
color: var(--text-secondary);
|
|
3052
|
+
background-color: var(--bg-secondary);
|
|
3053
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect as e } from "react";
|
|
2
2
|
//#region src/hooks/useFocusTrap.ts
|
|
3
|
-
var t = "a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
3
|
+
var t = "a[href], details > summary:first-of-type, button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
4
4
|
function n(n, r, { initialFocusRef: i, returnFocusRef: a } = {}) {
|
|
5
5
|
e(() => {
|
|
6
6
|
let e = n.current;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./components/charts/AreaChart";
|
|
2
2
|
export * from "./components/charts/BarChart";
|
|
3
3
|
export * from "./components/charts/DonutChart";
|
|
4
|
+
export * from "./components/charts/Heatmap";
|
|
4
5
|
export * from "./components/charts/RadarChart";
|
|
5
6
|
export * from "./components/charts/RadialBarChart";
|
|
6
7
|
export * from "./components/charts/SparkLine";
|
|
@@ -133,3 +134,7 @@ export * from "./components/ui/Inline";
|
|
|
133
134
|
export * from "./components/ui/Grid";
|
|
134
135
|
export * from "./components/ui/GridItem";
|
|
135
136
|
export * from "./components/tables/Table";
|
|
137
|
+
export * from "./components/ui/ActionLink";
|
|
138
|
+
export * from "./components/ui/Icon";
|
|
139
|
+
export * from "./components/ui/Text";
|
|
140
|
+
export * from "./components/ui/Meter";
|