@aortl/admin-react 0.16.2 → 0.18.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/CHANGELOG.md +37 -1
- package/dist/Alert.d.ts +14 -2
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Avatar.d.ts +26 -0
- package/dist/Avatar.d.ts.map +1 -0
- package/dist/Badge.d.ts +8 -2
- package/dist/Badge.d.ts.map +1 -1
- package/dist/BrandTile.d.ts +16 -3
- package/dist/BrandTile.d.ts.map +1 -1
- package/dist/Card.d.ts +12 -2
- package/dist/Card.d.ts.map +1 -1
- package/dist/Dialog.d.ts +4 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Drawer.d.ts +51 -0
- package/dist/Drawer.d.ts.map +1 -0
- package/dist/Field.d.ts +4 -1
- package/dist/Field.d.ts.map +1 -1
- package/dist/Indicator.d.ts +3 -1
- package/dist/Indicator.d.ts.map +1 -1
- package/dist/Input.d.ts +24 -2
- package/dist/Input.d.ts.map +1 -1
- package/dist/Item.d.ts +55 -0
- package/dist/Item.d.ts.map +1 -0
- package/dist/Menu.d.ts +7 -5
- package/dist/Menu.d.ts.map +1 -1
- package/dist/NumberInput.d.ts +28 -0
- package/dist/NumberInput.d.ts.map +1 -0
- package/dist/Pagination.d.ts +4 -1
- package/dist/Pagination.d.ts.map +1 -1
- package/dist/PropertyList.d.ts +10 -3
- package/dist/PropertyList.d.ts.map +1 -1
- package/dist/Separator.d.ts +11 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Sidebar.d.ts +16 -5
- package/dist/Sidebar.d.ts.map +1 -1
- package/dist/StatCard.d.ts +16 -1
- package/dist/StatCard.d.ts.map +1 -1
- package/dist/Table.d.ts +15 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Timeline.d.ts +29 -0
- package/dist/Timeline.d.ts.map +1 -0
- package/dist/Tooltip.d.ts +4 -1
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/admin.scoped.css +1072 -127
- package/dist/cn.d.ts +7 -0
- package/dist/cn.d.ts.map +1 -1
- package/dist/dialog-internal.d.ts +17 -0
- package/dist/dialog-internal.d.ts.map +1 -0
- package/dist/index.cjs +758 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +750 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { clsx } from "clsx";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Children, Fragment as Fragment$1, createContext, createElement, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
4
5
|
import { Button as Button$1 } from "@base-ui/react/button";
|
|
5
6
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
7
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
6
8
|
import { Field as Field$1 } from "@base-ui/react/field";
|
|
7
9
|
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
8
10
|
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
@@ -113,16 +115,47 @@ function renderIcon(icon, size = "1em") {
|
|
|
113
115
|
}
|
|
114
116
|
//#endregion
|
|
115
117
|
//#region src/Alert.tsx
|
|
116
|
-
function
|
|
118
|
+
function DismissIcon() {
|
|
119
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
120
|
+
width: "1em",
|
|
121
|
+
height: "1em",
|
|
122
|
+
viewBox: "0 0 24 24",
|
|
123
|
+
fill: "none",
|
|
124
|
+
stroke: "currentColor",
|
|
125
|
+
strokeWidth: "2",
|
|
126
|
+
strokeLinecap: "round",
|
|
127
|
+
strokeLinejoin: "round",
|
|
128
|
+
"aria-hidden": "true",
|
|
129
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function AlertRoot({ variant, icon, title, description, action, onDismiss, dismissLabel = "Dismiss", classNames, className, role, children, ...rest }) {
|
|
117
133
|
return /* @__PURE__ */ jsxs("div", {
|
|
118
134
|
role: role ?? (variant === "danger" || variant === "warning" ? "alert" : "status"),
|
|
119
135
|
className: cn(["alert", `alert-${variant}`], className),
|
|
120
136
|
...rest,
|
|
121
137
|
children: [
|
|
122
138
|
renderIcon(icon),
|
|
123
|
-
title !== void 0 ? /* @__PURE__ */ jsx(AlertTitle, {
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
title !== void 0 ? /* @__PURE__ */ jsx(AlertTitle, {
|
|
140
|
+
className: classNames?.title,
|
|
141
|
+
children: title
|
|
142
|
+
}) : null,
|
|
143
|
+
description !== void 0 ? /* @__PURE__ */ jsx(AlertDescription, {
|
|
144
|
+
className: classNames?.description,
|
|
145
|
+
children: description
|
|
146
|
+
}) : null,
|
|
147
|
+
children,
|
|
148
|
+
action !== void 0 ? /* @__PURE__ */ jsx(AlertAction, {
|
|
149
|
+
className: classNames?.action,
|
|
150
|
+
children: action
|
|
151
|
+
}) : null,
|
|
152
|
+
onDismiss ? /* @__PURE__ */ jsx("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
className: cn("alert-dismiss", classNames?.dismiss),
|
|
155
|
+
"aria-label": dismissLabel,
|
|
156
|
+
onClick: onDismiss,
|
|
157
|
+
children: /* @__PURE__ */ jsx(DismissIcon, {})
|
|
158
|
+
}) : null
|
|
126
159
|
]
|
|
127
160
|
});
|
|
128
161
|
}
|
|
@@ -138,9 +171,16 @@ function AlertDescription({ className, ...rest }) {
|
|
|
138
171
|
...rest
|
|
139
172
|
});
|
|
140
173
|
}
|
|
174
|
+
function AlertAction({ className, ...rest }) {
|
|
175
|
+
return /* @__PURE__ */ jsx("div", {
|
|
176
|
+
className: cn("alert-action", className),
|
|
177
|
+
...rest
|
|
178
|
+
});
|
|
179
|
+
}
|
|
141
180
|
var Alert = Object.assign(AlertRoot, {
|
|
142
181
|
Title: AlertTitle,
|
|
143
|
-
Description: AlertDescription
|
|
182
|
+
Description: AlertDescription,
|
|
183
|
+
Action: AlertAction
|
|
144
184
|
});
|
|
145
185
|
//#endregion
|
|
146
186
|
//#region src/AppShell.tsx
|
|
@@ -188,25 +228,109 @@ function AppShellMain({ className, ...rest }) {
|
|
|
188
228
|
var AppShell = Object.assign(AppShellRoot, { Main: AppShellMain });
|
|
189
229
|
//#endregion
|
|
190
230
|
//#region src/Badge.tsx
|
|
191
|
-
function
|
|
231
|
+
function RemoveIcon() {
|
|
232
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
233
|
+
width: "1em",
|
|
234
|
+
height: "1em",
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
fill: "none",
|
|
237
|
+
stroke: "currentColor",
|
|
238
|
+
strokeWidth: "2",
|
|
239
|
+
strokeLinecap: "round",
|
|
240
|
+
strokeLinejoin: "round",
|
|
241
|
+
"aria-hidden": "true",
|
|
242
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function Badge({ variant = "neutral", size = "md", icon, soft = false, onRemove, removeLabel = "Remove", className, children, ...rest }) {
|
|
192
246
|
return /* @__PURE__ */ jsxs("span", {
|
|
193
247
|
className: cn([
|
|
194
248
|
"badge",
|
|
195
249
|
variant !== "neutral" && `badge-${variant}`,
|
|
196
|
-
size !== "md" && `badge-${size}
|
|
250
|
+
size !== "md" && `badge-${size}`,
|
|
251
|
+
soft && "badge-soft"
|
|
197
252
|
], className),
|
|
198
253
|
...rest,
|
|
199
|
-
children: [
|
|
254
|
+
children: [
|
|
255
|
+
renderIcon(icon),
|
|
256
|
+
children,
|
|
257
|
+
onRemove ? /* @__PURE__ */ jsx("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
className: cn("badge-remove", void 0),
|
|
260
|
+
"aria-label": removeLabel,
|
|
261
|
+
onClick: onRemove,
|
|
262
|
+
children: /* @__PURE__ */ jsx(RemoveIcon, {})
|
|
263
|
+
}) : null
|
|
264
|
+
]
|
|
200
265
|
});
|
|
201
266
|
}
|
|
202
267
|
//#endregion
|
|
203
268
|
//#region src/BrandTile.tsx
|
|
204
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Brand/system mark for the navbar — monogram, icon, or shop logo. Precedence
|
|
271
|
+
* is `src` > `icon` > `monogram`. Monogram/icon tiles are `aria-hidden`; image
|
|
272
|
+
* tiles expose `alt` to assistive tech instead.
|
|
273
|
+
*/
|
|
274
|
+
function BrandTile({ variant = "solid", size = "md", monogram, icon, src, alt = "", className, children, ...rest }) {
|
|
275
|
+
const classes = cn([
|
|
276
|
+
"brand-tile",
|
|
277
|
+
variant !== "solid" && `brand-tile-${variant}`,
|
|
278
|
+
size === "lg" && "brand-tile-lg"
|
|
279
|
+
], className);
|
|
280
|
+
if (src) return /* @__PURE__ */ jsx("span", {
|
|
281
|
+
className: classes,
|
|
282
|
+
...rest,
|
|
283
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
284
|
+
src,
|
|
285
|
+
alt
|
|
286
|
+
})
|
|
287
|
+
});
|
|
205
288
|
return /* @__PURE__ */ jsx("span", {
|
|
206
|
-
className:
|
|
289
|
+
className: classes,
|
|
207
290
|
"aria-hidden": true,
|
|
208
291
|
...rest,
|
|
209
|
-
children: icon ? renderIcon(icon
|
|
292
|
+
children: icon ? renderIcon(icon) : children ?? monogram
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/Avatar.tsx
|
|
297
|
+
/**
|
|
298
|
+
* Image avatar with an initials fallback. Initials show until the image loads
|
|
299
|
+
* (and again, React-only, if it errors); the vanilla CSS layers the `<img>`
|
|
300
|
+
* over the initials instead.
|
|
301
|
+
*/
|
|
302
|
+
function Avatar({ src, alt, initials, size = "md", shape = "circle", className, children, ...rest }) {
|
|
303
|
+
const fallback = children ?? initials;
|
|
304
|
+
return /* @__PURE__ */ jsxs(Avatar$1.Root, {
|
|
305
|
+
className: cn([
|
|
306
|
+
"avatar",
|
|
307
|
+
size !== "md" && `avatar-${size}`,
|
|
308
|
+
shape === "square" && "avatar-square"
|
|
309
|
+
], className),
|
|
310
|
+
...rest,
|
|
311
|
+
children: [fallback !== void 0 ? /* @__PURE__ */ jsx(Avatar$1.Fallback, { children: fallback }) : null, src !== void 0 ? /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
312
|
+
src,
|
|
313
|
+
alt
|
|
314
|
+
}) : null]
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** Overlapping stack of avatars; later children paint on top. `max` caps the visible count. */
|
|
318
|
+
function AvatarGroup({ max, size = "md", className, children, ...rest }) {
|
|
319
|
+
const items = Children.toArray(children);
|
|
320
|
+
const overflow = max !== void 0 && items.length > max ? items.length - max : 0;
|
|
321
|
+
const visible = overflow > 0 ? items.slice(0, max) : items;
|
|
322
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
323
|
+
className: cn("avatar-group", className),
|
|
324
|
+
...rest,
|
|
325
|
+
children: [visible, overflow > 0 ? /* @__PURE__ */ jsxs("span", {
|
|
326
|
+
className: cn([
|
|
327
|
+
"avatar",
|
|
328
|
+
size !== "md" && `avatar-${size}`,
|
|
329
|
+
"avatar-more"
|
|
330
|
+
], void 0),
|
|
331
|
+
"aria-label": `+${overflow} more`,
|
|
332
|
+
children: ["+", overflow]
|
|
333
|
+
}) : null]
|
|
210
334
|
});
|
|
211
335
|
}
|
|
212
336
|
//#endregion
|
|
@@ -534,9 +658,52 @@ var Breadcrumbs = Object.assign(BreadcrumbsRoot, {
|
|
|
534
658
|
});
|
|
535
659
|
//#endregion
|
|
536
660
|
//#region src/Input.tsx
|
|
537
|
-
function
|
|
538
|
-
return /* @__PURE__ */
|
|
661
|
+
function ClearIcon() {
|
|
662
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
663
|
+
width: "1em",
|
|
664
|
+
height: "1em",
|
|
665
|
+
viewBox: "0 0 24 24",
|
|
666
|
+
fill: "none",
|
|
667
|
+
stroke: "currentColor",
|
|
668
|
+
strokeWidth: "2",
|
|
669
|
+
strokeLinecap: "round",
|
|
670
|
+
strokeLinejoin: "round",
|
|
671
|
+
"aria-hidden": "true",
|
|
672
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
function Input({ variant = "bordered", inputSize = "md", icon, iconTrailing, clearable = false, clearLabel = "Clear", onClear, action, className, classNames, type = "text", value, defaultValue, onChange, disabled, readOnly, ref: consumerRef, ...rest }) {
|
|
676
|
+
const innerRef = useRef(null);
|
|
677
|
+
const isControlled = value !== void 0;
|
|
678
|
+
const [uncontrolledHasValue, setUncontrolledHasValue] = useState(() => defaultValue != null && String(defaultValue).length > 0);
|
|
679
|
+
const hasValue = isControlled ? value != null && String(value).length > 0 : uncontrolledHasValue;
|
|
680
|
+
const setRef = useCallback((node) => {
|
|
681
|
+
innerRef.current = node;
|
|
682
|
+
if (typeof consumerRef === "function") consumerRef(node);
|
|
683
|
+
else if (consumerRef) consumerRef.current = node;
|
|
684
|
+
}, [consumerRef]);
|
|
685
|
+
function handleChange(event) {
|
|
686
|
+
if (!isControlled) setUncontrolledHasValue(event.target.value.length > 0);
|
|
687
|
+
onChange?.(event);
|
|
688
|
+
}
|
|
689
|
+
function handleClear() {
|
|
690
|
+
const input = innerRef.current;
|
|
691
|
+
if (!input) return;
|
|
692
|
+
(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(input, "");
|
|
693
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
694
|
+
input.focus();
|
|
695
|
+
if (!isControlled) setUncontrolledHasValue(false);
|
|
696
|
+
onClear?.();
|
|
697
|
+
}
|
|
698
|
+
const showClear = clearable && hasValue && !disabled && !readOnly;
|
|
699
|
+
const inputEl = /* @__PURE__ */ jsx(Input$1, {
|
|
700
|
+
ref: setRef,
|
|
539
701
|
type,
|
|
702
|
+
value,
|
|
703
|
+
defaultValue,
|
|
704
|
+
onChange: handleChange,
|
|
705
|
+
disabled,
|
|
706
|
+
readOnly,
|
|
540
707
|
className: cn([
|
|
541
708
|
"input",
|
|
542
709
|
variant !== "bordered" && `input-${variant}`,
|
|
@@ -544,6 +711,71 @@ function Input({ variant = "bordered", inputSize = "md", className, type = "text
|
|
|
544
711
|
], className),
|
|
545
712
|
...rest
|
|
546
713
|
});
|
|
714
|
+
if (!(icon != null || iconTrailing != null || action != null || clearable)) return inputEl;
|
|
715
|
+
const trailing = showClear ? /* @__PURE__ */ jsx("button", {
|
|
716
|
+
type: "button",
|
|
717
|
+
className: cn("input-action", classNames?.action),
|
|
718
|
+
"aria-label": clearLabel,
|
|
719
|
+
onClick: handleClear,
|
|
720
|
+
children: /* @__PURE__ */ jsx(ClearIcon, {})
|
|
721
|
+
}) : action ?? renderIcon(iconTrailing);
|
|
722
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
723
|
+
className: cn("input-icon", classNames?.wrapper),
|
|
724
|
+
children: [
|
|
725
|
+
renderIcon(icon),
|
|
726
|
+
inputEl,
|
|
727
|
+
trailing
|
|
728
|
+
]
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
function EyeIcon() {
|
|
732
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
733
|
+
width: "1em",
|
|
734
|
+
height: "1em",
|
|
735
|
+
viewBox: "0 0 24 24",
|
|
736
|
+
fill: "none",
|
|
737
|
+
stroke: "currentColor",
|
|
738
|
+
strokeWidth: "2",
|
|
739
|
+
strokeLinecap: "round",
|
|
740
|
+
strokeLinejoin: "round",
|
|
741
|
+
"aria-hidden": "true",
|
|
742
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" }), /* @__PURE__ */ jsx("path", { d: "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" })]
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
function EyeOffIcon() {
|
|
746
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
747
|
+
width: "1em",
|
|
748
|
+
height: "1em",
|
|
749
|
+
viewBox: "0 0 24 24",
|
|
750
|
+
fill: "none",
|
|
751
|
+
stroke: "currentColor",
|
|
752
|
+
strokeWidth: "2",
|
|
753
|
+
strokeLinecap: "round",
|
|
754
|
+
strokeLinejoin: "round",
|
|
755
|
+
"aria-hidden": "true",
|
|
756
|
+
children: [
|
|
757
|
+
/* @__PURE__ */ jsx("path", { d: "M10.585 10.587a2 2 0 0 0 2.829 2.828" }),
|
|
758
|
+
/* @__PURE__ */ jsx("path", { d: "M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87" }),
|
|
759
|
+
/* @__PURE__ */ jsx("path", { d: "M3 3l18 18" })
|
|
760
|
+
]
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
/** Password field with a trailing reveal toggle. Emits the same `.input` / `.input-action` classes. */
|
|
764
|
+
function PasswordInput({ revealLabel = "Show password", classNames, ...rest }) {
|
|
765
|
+
const [revealed, setRevealed] = useState(false);
|
|
766
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
767
|
+
type: revealed ? "text" : "password",
|
|
768
|
+
action: /* @__PURE__ */ jsx("button", {
|
|
769
|
+
type: "button",
|
|
770
|
+
className: cn("input-action", classNames?.action),
|
|
771
|
+
"aria-label": revealLabel,
|
|
772
|
+
"aria-pressed": revealed,
|
|
773
|
+
onClick: () => setRevealed((v) => !v),
|
|
774
|
+
children: revealed ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
|
|
775
|
+
}),
|
|
776
|
+
classNames,
|
|
777
|
+
...rest
|
|
778
|
+
});
|
|
547
779
|
}
|
|
548
780
|
//#endregion
|
|
549
781
|
//#region src/FileInput.tsx
|
|
@@ -574,8 +806,69 @@ function InputGroupAddon({ className, ...rest }) {
|
|
|
574
806
|
}
|
|
575
807
|
var InputGroup = Object.assign(InputGroupRoot, { Addon: InputGroupAddon });
|
|
576
808
|
//#endregion
|
|
809
|
+
//#region src/NumberInput.tsx
|
|
810
|
+
function MinusIcon() {
|
|
811
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
812
|
+
width: "1em",
|
|
813
|
+
height: "1em",
|
|
814
|
+
viewBox: "0 0 24 24",
|
|
815
|
+
fill: "none",
|
|
816
|
+
stroke: "currentColor",
|
|
817
|
+
strokeWidth: "2",
|
|
818
|
+
strokeLinecap: "round",
|
|
819
|
+
strokeLinejoin: "round",
|
|
820
|
+
"aria-hidden": "true",
|
|
821
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 12h14" })
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
function PlusIcon() {
|
|
825
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
826
|
+
width: "1em",
|
|
827
|
+
height: "1em",
|
|
828
|
+
viewBox: "0 0 24 24",
|
|
829
|
+
fill: "none",
|
|
830
|
+
stroke: "currentColor",
|
|
831
|
+
strokeWidth: "2",
|
|
832
|
+
strokeLinecap: "round",
|
|
833
|
+
strokeLinejoin: "round",
|
|
834
|
+
"aria-hidden": "true",
|
|
835
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14" })
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Numeric field with stepper buttons over Base UI NumberField (clamp-on-blur,
|
|
840
|
+
* step, `Intl` formatting via `format`). The vanilla bundle styles a native
|
|
841
|
+
* `<input type="number">` and steps with `stepUp()` / `stepDown()`.
|
|
842
|
+
*/
|
|
843
|
+
function NumberInput({ size = "md", classNames, placeholder, inputAriaLabel, decrementLabel = "Decrease", incrementLabel = "Increase", decrementIcon, incrementIcon, className, ...rootProps }) {
|
|
844
|
+
return /* @__PURE__ */ jsx(NumberField.Root, {
|
|
845
|
+
className: cn("number-input-root", className),
|
|
846
|
+
...rootProps,
|
|
847
|
+
children: /* @__PURE__ */ jsxs(NumberField.Group, {
|
|
848
|
+
className: cn(["number-input", size !== "md" && `number-input-${size}`], classNames?.group),
|
|
849
|
+
children: [
|
|
850
|
+
/* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
851
|
+
className: cn("number-input-step", classNames?.decrement),
|
|
852
|
+
"aria-label": decrementLabel,
|
|
853
|
+
children: decrementIcon ?? /* @__PURE__ */ jsx(MinusIcon, {})
|
|
854
|
+
}),
|
|
855
|
+
/* @__PURE__ */ jsx(NumberField.Input, {
|
|
856
|
+
className: cn("number-input-field", classNames?.input),
|
|
857
|
+
placeholder,
|
|
858
|
+
"aria-label": inputAriaLabel
|
|
859
|
+
}),
|
|
860
|
+
/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
861
|
+
className: cn("number-input-step", classNames?.increment),
|
|
862
|
+
"aria-label": incrementLabel,
|
|
863
|
+
children: incrementIcon ?? /* @__PURE__ */ jsx(PlusIcon, {})
|
|
864
|
+
})
|
|
865
|
+
]
|
|
866
|
+
})
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
//#endregion
|
|
577
870
|
//#region src/Indicator.tsx
|
|
578
|
-
function Indicator({ label, variant = "neutral", size = "sm", icon, placement = "top-end", offset, className, "aria-label": ariaLabel, style: styleProp, children, ...rest }) {
|
|
871
|
+
function Indicator({ label, variant = "neutral", size = "sm", icon, placement = "top-end", offset, max, className, "aria-label": ariaLabel, style: styleProp, children, ...rest }) {
|
|
579
872
|
const [vertical, horizontal] = placement.split("-");
|
|
580
873
|
const placementClasses = [
|
|
581
874
|
"indicator-item",
|
|
@@ -583,6 +876,7 @@ function Indicator({ label, variant = "neutral", size = "sm", icon, placement =
|
|
|
583
876
|
horizontal !== "end" && `indicator-${horizontal}`
|
|
584
877
|
];
|
|
585
878
|
const hasContent = label !== void 0 || icon !== void 0;
|
|
879
|
+
const displayLabel = typeof label === "number" && max !== void 0 && label > max ? `${max}+` : label;
|
|
586
880
|
const style = offset !== void 0 ? {
|
|
587
881
|
...styleProp,
|
|
588
882
|
"--indicator-offset": `${offset}px`
|
|
@@ -597,7 +891,7 @@ function Indicator({ label, variant = "neutral", size = "sm", icon, placement =
|
|
|
597
891
|
size,
|
|
598
892
|
icon,
|
|
599
893
|
"aria-label": ariaLabel,
|
|
600
|
-
children:
|
|
894
|
+
children: displayLabel
|
|
601
895
|
}) : /* @__PURE__ */ jsx("span", {
|
|
602
896
|
className: cn([
|
|
603
897
|
...placementClasses,
|
|
@@ -626,6 +920,20 @@ function Link({ external, icon, iconTrailing, className, target, rel, children,
|
|
|
626
920
|
});
|
|
627
921
|
}
|
|
628
922
|
//#endregion
|
|
923
|
+
//#region src/Separator.tsx
|
|
924
|
+
/**
|
|
925
|
+
* A styled `<hr>` (implicit `role="separator"`). Margins are zeroed — spacing
|
|
926
|
+
* comes from the parent's gap or margin utilities.
|
|
927
|
+
*/
|
|
928
|
+
function Separator({ orientation = "horizontal", className, ...rest }) {
|
|
929
|
+
const vertical = orientation === "vertical";
|
|
930
|
+
return /* @__PURE__ */ jsx("hr", {
|
|
931
|
+
className: cn(["separator", vertical && "separator-vertical"], className),
|
|
932
|
+
"aria-orientation": vertical ? "vertical" : void 0,
|
|
933
|
+
...rest
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
//#endregion
|
|
629
937
|
//#region src/Pagination.tsx
|
|
630
938
|
/** Pure (safe during render): previous, numbers/ellipses (`boundaryCount` at each end, `siblingCount` around `page`), next. */
|
|
631
939
|
function getPaginationItems({ page, total, siblingCount = 1, boundaryCount = 1 }) {
|
|
@@ -689,7 +997,7 @@ function range(start, end) {
|
|
|
689
997
|
for (let i = start; i <= end; i++) out.push(i);
|
|
690
998
|
return out;
|
|
691
999
|
}
|
|
692
|
-
function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount = 1, previousIcon, nextIcon, renderItem, className, "aria-label": ariaLabel = "Pagination", ...rest }) {
|
|
1000
|
+
function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount = 1, previousIcon, nextIcon, renderItem, className, classNames, "aria-label": ariaLabel = "Pagination", ...rest }) {
|
|
693
1001
|
const items = getPaginationItems({
|
|
694
1002
|
page,
|
|
695
1003
|
total,
|
|
@@ -703,8 +1011,8 @@ function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount
|
|
|
703
1011
|
className: cn("pagination", className),
|
|
704
1012
|
...rest,
|
|
705
1013
|
children: /* @__PURE__ */ jsx("ul", { children: items.map((item, i) => /* @__PURE__ */ jsx("li", {
|
|
706
|
-
className: cn("page-item",
|
|
707
|
-
children: renderItem ? renderItem(item) : defaultRender(item, onPageChange, prev, next)
|
|
1014
|
+
className: cn("page-item", classNames?.item),
|
|
1015
|
+
children: renderItem ? renderItem(item) : defaultRender(item, onPageChange, prev, next, classNames)
|
|
708
1016
|
}, paginationItemKey(item, i))) })
|
|
709
1017
|
});
|
|
710
1018
|
}
|
|
@@ -745,11 +1053,11 @@ function paginationItemKey(item, index) {
|
|
|
745
1053
|
default: return `${index}`;
|
|
746
1054
|
}
|
|
747
1055
|
}
|
|
748
|
-
function defaultRender(item, onPageChange, prev, next) {
|
|
1056
|
+
function defaultRender(item, onPageChange, prev, next, classNames) {
|
|
749
1057
|
switch (item.type) {
|
|
750
1058
|
case "previous": return /* @__PURE__ */ jsx("button", {
|
|
751
1059
|
type: "button",
|
|
752
|
-
className: cn("page-link",
|
|
1060
|
+
className: cn("page-link", classNames?.link),
|
|
753
1061
|
"aria-label": "Previous page",
|
|
754
1062
|
"aria-disabled": item.disabled || void 0,
|
|
755
1063
|
disabled: item.disabled,
|
|
@@ -758,7 +1066,7 @@ function defaultRender(item, onPageChange, prev, next) {
|
|
|
758
1066
|
});
|
|
759
1067
|
case "next": return /* @__PURE__ */ jsx("button", {
|
|
760
1068
|
type: "button",
|
|
761
|
-
className: cn("page-link",
|
|
1069
|
+
className: cn("page-link", classNames?.link),
|
|
762
1070
|
"aria-label": "Next page",
|
|
763
1071
|
"aria-disabled": item.disabled || void 0,
|
|
764
1072
|
disabled: item.disabled,
|
|
@@ -766,13 +1074,13 @@ function defaultRender(item, onPageChange, prev, next) {
|
|
|
766
1074
|
children: next
|
|
767
1075
|
});
|
|
768
1076
|
case "ellipsis": return /* @__PURE__ */ jsx("span", {
|
|
769
|
-
className: cn("page-ellipsis",
|
|
1077
|
+
className: cn("page-ellipsis", classNames?.ellipsis),
|
|
770
1078
|
"aria-hidden": "true",
|
|
771
1079
|
children: "…"
|
|
772
1080
|
});
|
|
773
1081
|
case "page": return /* @__PURE__ */ jsx("button", {
|
|
774
1082
|
type: "button",
|
|
775
|
-
className: cn(["page-link", item.selected && "active"],
|
|
1083
|
+
className: cn(["page-link", item.selected && "active"], classNames?.link),
|
|
776
1084
|
"aria-current": item.selected ? "page" : void 0,
|
|
777
1085
|
"aria-label": `Page ${item.page}`,
|
|
778
1086
|
onClick: () => onPageChange(item.page),
|
|
@@ -805,7 +1113,7 @@ function CheckboxRoot({ className, children, ...rest }) {
|
|
|
805
1113
|
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
806
1114
|
className: cn("checkbox", className),
|
|
807
1115
|
...rest,
|
|
808
|
-
children: children ?? /* @__PURE__ */ jsx(CheckboxIndicator, { children: /* @__PURE__ */ jsx(CheckIcon$
|
|
1116
|
+
children: children ?? /* @__PURE__ */ jsx(CheckboxIndicator, { children: /* @__PURE__ */ jsx(CheckIcon$2, {}) })
|
|
809
1117
|
});
|
|
810
1118
|
}
|
|
811
1119
|
function CheckboxIndicator({ className, ...rest }) {
|
|
@@ -814,7 +1122,7 @@ function CheckboxIndicator({ className, ...rest }) {
|
|
|
814
1122
|
...rest
|
|
815
1123
|
});
|
|
816
1124
|
}
|
|
817
|
-
function CheckIcon$
|
|
1125
|
+
function CheckIcon$2() {
|
|
818
1126
|
return /* @__PURE__ */ jsx("svg", {
|
|
819
1127
|
viewBox: "0 0 24 24",
|
|
820
1128
|
fill: "none",
|
|
@@ -943,7 +1251,7 @@ function SelectItemIndicator({ className, children, ...rest }) {
|
|
|
943
1251
|
return /* @__PURE__ */ jsx(Select$1.ItemIndicator, {
|
|
944
1252
|
className: cn("select-item-indicator", className),
|
|
945
1253
|
...rest,
|
|
946
|
-
children: children ?? /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1254
|
+
children: children ?? /* @__PURE__ */ jsx(CheckIcon$1, {})
|
|
947
1255
|
});
|
|
948
1256
|
}
|
|
949
1257
|
function SelectGroup(props) {
|
|
@@ -955,7 +1263,7 @@ function SelectGroupLabel({ className, ...rest }) {
|
|
|
955
1263
|
...rest
|
|
956
1264
|
});
|
|
957
1265
|
}
|
|
958
|
-
function CheckIcon() {
|
|
1266
|
+
function CheckIcon$1() {
|
|
959
1267
|
return /* @__PURE__ */ jsx("svg", {
|
|
960
1268
|
viewBox: "0 0 24 24",
|
|
961
1269
|
fill: "none",
|
|
@@ -1017,13 +1325,14 @@ function Container({ size = "md", compact, className, ...rest }) {
|
|
|
1017
1325
|
* The bare `.card` container — no body, no title. Use this when you need to
|
|
1018
1326
|
* compose the internals yourself (e.g. a media block above the body).
|
|
1019
1327
|
*/
|
|
1020
|
-
function CardContainer({ variant = "default", bordered, compact, className, ...rest }) {
|
|
1328
|
+
function CardContainer({ variant = "default", bordered, compact, scroll, className, ...rest }) {
|
|
1021
1329
|
return /* @__PURE__ */ jsx("div", {
|
|
1022
1330
|
className: cn([
|
|
1023
1331
|
"card",
|
|
1024
1332
|
variant !== "default" && `card-${variant}`,
|
|
1025
1333
|
bordered && "card-bordered",
|
|
1026
|
-
compact && "card-compact"
|
|
1334
|
+
compact && "card-compact",
|
|
1335
|
+
scroll && "card-scroll"
|
|
1027
1336
|
], className),
|
|
1028
1337
|
...rest
|
|
1029
1338
|
});
|
|
@@ -1033,23 +1342,48 @@ function CardContainer({ variant = "default", bordered, compact, className, ...r
|
|
|
1033
1342
|
* an optional title (with icon), description, children, and actions. For
|
|
1034
1343
|
* anything outside that shape, use `<Card.Container>` and compose by hand.
|
|
1035
1344
|
*/
|
|
1036
|
-
function CardRoot({ variant, bordered, compact, icon, title, description, toolbar, actions, className, children, ...rest }) {
|
|
1345
|
+
function CardRoot({ variant, bordered, compact, media, icon, title, description, toolbar, actions, className, classNames, children, ...rest }) {
|
|
1037
1346
|
const titleEl = icon !== void 0 || title !== void 0 ? /* @__PURE__ */ jsx(CardTitle, {
|
|
1038
1347
|
icon,
|
|
1348
|
+
className: classNames?.title,
|
|
1039
1349
|
children: title
|
|
1040
1350
|
}) : null;
|
|
1041
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsxs(CardContainer, {
|
|
1042
1352
|
variant,
|
|
1043
1353
|
bordered,
|
|
1044
1354
|
compact,
|
|
1045
1355
|
className,
|
|
1046
1356
|
...rest,
|
|
1047
|
-
children: /* @__PURE__ */
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1357
|
+
children: [media !== void 0 ? /* @__PURE__ */ jsx(CardMedia, {
|
|
1358
|
+
className: classNames?.media,
|
|
1359
|
+
children: media
|
|
1360
|
+
}) : null, /* @__PURE__ */ jsxs(CardBody, {
|
|
1361
|
+
className: classNames?.body,
|
|
1362
|
+
children: [
|
|
1363
|
+
toolbar !== void 0 ? /* @__PURE__ */ jsxs(CardHeader, {
|
|
1364
|
+
className: classNames?.header,
|
|
1365
|
+
children: [titleEl, /* @__PURE__ */ jsx(CardToolbar, {
|
|
1366
|
+
className: classNames?.toolbar,
|
|
1367
|
+
children: toolbar
|
|
1368
|
+
})]
|
|
1369
|
+
}) : titleEl,
|
|
1370
|
+
description !== void 0 ? /* @__PURE__ */ jsx(CardDescription, {
|
|
1371
|
+
className: classNames?.description,
|
|
1372
|
+
children: description
|
|
1373
|
+
}) : null,
|
|
1374
|
+
children,
|
|
1375
|
+
actions !== void 0 ? /* @__PURE__ */ jsx(CardActions, {
|
|
1376
|
+
className: classNames?.actions,
|
|
1377
|
+
children: actions
|
|
1378
|
+
}) : null
|
|
1379
|
+
]
|
|
1380
|
+
})]
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
function CardMedia({ className, ...rest }) {
|
|
1384
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1385
|
+
className: cn("card-media", className),
|
|
1386
|
+
...rest
|
|
1053
1387
|
});
|
|
1054
1388
|
}
|
|
1055
1389
|
function CardBody({ className, ...rest }) {
|
|
@@ -1091,6 +1425,7 @@ function CardActions({ className, ...rest }) {
|
|
|
1091
1425
|
}
|
|
1092
1426
|
var Card = Object.assign(CardRoot, {
|
|
1093
1427
|
Container: CardContainer,
|
|
1428
|
+
Media: CardMedia,
|
|
1094
1429
|
Body: CardBody,
|
|
1095
1430
|
Header: CardHeader,
|
|
1096
1431
|
Toolbar: CardToolbar,
|
|
@@ -1100,12 +1435,17 @@ var Card = Object.assign(CardRoot, {
|
|
|
1100
1435
|
});
|
|
1101
1436
|
//#endregion
|
|
1102
1437
|
//#region src/StatCard.tsx
|
|
1438
|
+
function trendIntent(direction) {
|
|
1439
|
+
if (direction === "down") return "negative";
|
|
1440
|
+
if (direction === "flat") return "neutral";
|
|
1441
|
+
return "positive";
|
|
1442
|
+
}
|
|
1103
1443
|
/**
|
|
1104
1444
|
* Compact KPI tile (label / value / detail) on a `.card` shell, so it shares
|
|
1105
1445
|
* every card modifier — `compact`/`bordered` map to `.card-compact`/`.card-bordered`.
|
|
1106
1446
|
* Free-form tiles: `<Card>`; label/value tables: `<PropertyList>`.
|
|
1107
1447
|
*/
|
|
1108
|
-
function StatCard({ variant = "default", label, value, detail, icon, compact, bordered, className, children, ...rest }) {
|
|
1448
|
+
function StatCard({ variant = "default", label, value, detail, trend, icon, compact, bordered, className, classNames, children, ...rest }) {
|
|
1109
1449
|
const hasLabel = label !== void 0;
|
|
1110
1450
|
return /* @__PURE__ */ jsxs("div", {
|
|
1111
1451
|
className: cn([
|
|
@@ -1118,15 +1458,21 @@ function StatCard({ variant = "default", label, value, detail, icon, compact, bo
|
|
|
1118
1458
|
...rest,
|
|
1119
1459
|
children: [
|
|
1120
1460
|
hasLabel ? /* @__PURE__ */ jsxs("p", {
|
|
1121
|
-
className: cn("stat-card-label",
|
|
1461
|
+
className: cn("stat-card-label", classNames?.label),
|
|
1122
1462
|
children: [renderIcon(icon), label]
|
|
1123
1463
|
}) : null,
|
|
1124
1464
|
value !== void 0 ? /* @__PURE__ */ jsx("p", {
|
|
1125
|
-
className: cn("stat-card-value",
|
|
1465
|
+
className: cn("stat-card-value", classNames?.value),
|
|
1126
1466
|
children: value
|
|
1127
1467
|
}) : null,
|
|
1468
|
+
trend !== void 0 ? /* @__PURE__ */ jsx("p", {
|
|
1469
|
+
className: cn("stat-card-trend", classNames?.trend),
|
|
1470
|
+
"data-trend": trend.direction ?? "up",
|
|
1471
|
+
"data-intent": trend.intent ?? trendIntent(trend.direction ?? "up"),
|
|
1472
|
+
children: trend.value
|
|
1473
|
+
}) : null,
|
|
1128
1474
|
detail !== void 0 ? /* @__PURE__ */ jsx("p", {
|
|
1129
|
-
className: cn("stat-card-detail",
|
|
1475
|
+
className: cn("stat-card-detail", classNames?.detail),
|
|
1130
1476
|
children: detail
|
|
1131
1477
|
}) : null,
|
|
1132
1478
|
children
|
|
@@ -1134,6 +1480,137 @@ function StatCard({ variant = "default", label, value, detail, icon, compact, bo
|
|
|
1134
1480
|
});
|
|
1135
1481
|
}
|
|
1136
1482
|
//#endregion
|
|
1483
|
+
//#region src/Timeline.tsx
|
|
1484
|
+
function TimelineRoot({ numbered, className, ...rest }) {
|
|
1485
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
1486
|
+
className: cn(["timeline", numbered && "timeline-numbered"], className),
|
|
1487
|
+
...rest
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
function TimelineItem({ status = "default", icon, marker, title, time, description, className, classNames, children, ...rest }) {
|
|
1491
|
+
let indicator;
|
|
1492
|
+
if (marker !== void 0) indicator = /* @__PURE__ */ jsx("span", {
|
|
1493
|
+
className: cn("timeline-marker", classNames?.marker),
|
|
1494
|
+
children: marker
|
|
1495
|
+
});
|
|
1496
|
+
else if (icon != null) indicator = renderIcon(icon);
|
|
1497
|
+
else indicator = /* @__PURE__ */ jsx("span", { className: cn("timeline-dot", classNames?.dot) });
|
|
1498
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
1499
|
+
className: cn(["timeline-item", status !== "default" && `timeline-item-${status}`], className),
|
|
1500
|
+
...rest,
|
|
1501
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1502
|
+
className: cn("timeline-indicator", classNames?.indicator),
|
|
1503
|
+
children: indicator
|
|
1504
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1505
|
+
className: cn("timeline-content", classNames?.content),
|
|
1506
|
+
children: [
|
|
1507
|
+
title !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
1508
|
+
className: cn("timeline-title", classNames?.title),
|
|
1509
|
+
children: title
|
|
1510
|
+
}) : null,
|
|
1511
|
+
time !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
1512
|
+
className: cn("timeline-time", classNames?.time),
|
|
1513
|
+
children: time
|
|
1514
|
+
}) : null,
|
|
1515
|
+
description !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
1516
|
+
className: cn("timeline-description", classNames?.description),
|
|
1517
|
+
children: description
|
|
1518
|
+
}) : null,
|
|
1519
|
+
children
|
|
1520
|
+
]
|
|
1521
|
+
})]
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
var Timeline = Object.assign(TimelineRoot, { Item: TimelineItem });
|
|
1525
|
+
//#endregion
|
|
1526
|
+
//#region src/Item.tsx
|
|
1527
|
+
/** The bare row primitive — just the `.item` shell, for layouts the default `<Item>` doesn't fit. */
|
|
1528
|
+
function ItemContainer({ variant = "default", size = "md", asLink, className, ...rest }) {
|
|
1529
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1530
|
+
className: cn([
|
|
1531
|
+
"item",
|
|
1532
|
+
variant !== "default" && `item-${variant}`,
|
|
1533
|
+
size !== "md" && `item-${size}`,
|
|
1534
|
+
asLink && "item-link"
|
|
1535
|
+
], className),
|
|
1536
|
+
...rest
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
function ItemMedia({ className, ...rest }) {
|
|
1540
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1541
|
+
className: cn("item-media", className),
|
|
1542
|
+
...rest
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
function ItemContent({ className, ...rest }) {
|
|
1546
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1547
|
+
className: cn("item-content", className),
|
|
1548
|
+
...rest
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
function ItemTitle({ className, ...rest }) {
|
|
1552
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1553
|
+
className: cn("item-title", className),
|
|
1554
|
+
...rest
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
function ItemDescription({ className, ...rest }) {
|
|
1558
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1559
|
+
className: cn("item-description", className),
|
|
1560
|
+
...rest
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
function ItemActions({ className, ...rest }) {
|
|
1564
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1565
|
+
className: cn("item-actions", className),
|
|
1566
|
+
...rest
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
/** Opinionated row with media / title+description / actions shorthand. For other shapes, compose `<Item.Container>`. */
|
|
1570
|
+
function ItemRoot({ media, icon, title, description, actions, classNames, children, ...rest }) {
|
|
1571
|
+
const leading = media ?? renderIcon(icon);
|
|
1572
|
+
const hasContent = title !== void 0 || description !== void 0;
|
|
1573
|
+
return /* @__PURE__ */ jsxs(ItemContainer, {
|
|
1574
|
+
...rest,
|
|
1575
|
+
children: [
|
|
1576
|
+
leading != null ? /* @__PURE__ */ jsx(ItemMedia, {
|
|
1577
|
+
className: classNames?.media,
|
|
1578
|
+
children: leading
|
|
1579
|
+
}) : null,
|
|
1580
|
+
hasContent ? /* @__PURE__ */ jsxs(ItemContent, {
|
|
1581
|
+
className: classNames?.content,
|
|
1582
|
+
children: [title !== void 0 ? /* @__PURE__ */ jsx(ItemTitle, {
|
|
1583
|
+
className: classNames?.title,
|
|
1584
|
+
children: title
|
|
1585
|
+
}) : null, description !== void 0 ? /* @__PURE__ */ jsx(ItemDescription, {
|
|
1586
|
+
className: classNames?.description,
|
|
1587
|
+
children: description
|
|
1588
|
+
}) : null]
|
|
1589
|
+
}) : null,
|
|
1590
|
+
children,
|
|
1591
|
+
actions !== void 0 ? /* @__PURE__ */ jsx(ItemActions, {
|
|
1592
|
+
className: classNames?.actions,
|
|
1593
|
+
children: actions
|
|
1594
|
+
}) : null
|
|
1595
|
+
]
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
/** Divided vertical stack of items. */
|
|
1599
|
+
function ItemGroup({ bordered, className, ...rest }) {
|
|
1600
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1601
|
+
className: cn(["item-group", bordered && "item-group-bordered"], className),
|
|
1602
|
+
...rest
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
var Item = Object.assign(ItemRoot, {
|
|
1606
|
+
Container: ItemContainer,
|
|
1607
|
+
Media: ItemMedia,
|
|
1608
|
+
Content: ItemContent,
|
|
1609
|
+
Title: ItemTitle,
|
|
1610
|
+
Description: ItemDescription,
|
|
1611
|
+
Actions: ItemActions
|
|
1612
|
+
});
|
|
1613
|
+
//#endregion
|
|
1137
1614
|
//#region src/chart-internal.ts
|
|
1138
1615
|
/**
|
|
1139
1616
|
* Multi-series palette of existing Flexoki tokens, not a new token layer. The
|
|
@@ -1377,24 +1854,15 @@ var StackedBar = Object.assign(StackedBarRoot, {
|
|
|
1377
1854
|
Legend: ChartLegend
|
|
1378
1855
|
});
|
|
1379
1856
|
//#endregion
|
|
1380
|
-
//#region src/
|
|
1857
|
+
//#region src/dialog-internal.ts
|
|
1381
1858
|
var DialogContext = createContext(null);
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
strokeWidth: "2",
|
|
1390
|
-
strokeLinecap: "round",
|
|
1391
|
-
strokeLinejoin: "round",
|
|
1392
|
-
"aria-hidden": "true",
|
|
1393
|
-
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
/** The bare `<dialog>` primitive — for layouts the default `<Dialog>` doesn't fit. */
|
|
1397
|
-
function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
1859
|
+
/**
|
|
1860
|
+
* Drives a native `<dialog>` from a controlled `open` prop, shared by `<Dialog>`
|
|
1861
|
+
* and `<Drawer>`: merges the consumer ref, calls `showModal()` / `close()` on
|
|
1862
|
+
* change, and reports closes (Esc, backdrop, form submit) via `onOpenChange`.
|
|
1863
|
+
* Returns `ref` for the portal container context.
|
|
1864
|
+
*/
|
|
1865
|
+
function useDialogElement(open, onOpenChange, consumerRef) {
|
|
1398
1866
|
const ref = useRef(null);
|
|
1399
1867
|
const onOpenChangeRef = useRef(onOpenChange);
|
|
1400
1868
|
onOpenChangeRef.current = onOpenChange;
|
|
@@ -1416,8 +1884,33 @@ function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", cl
|
|
|
1416
1884
|
el.addEventListener("close", handleClose);
|
|
1417
1885
|
return () => el.removeEventListener("close", handleClose);
|
|
1418
1886
|
}, []);
|
|
1887
|
+
return {
|
|
1888
|
+
setRef,
|
|
1889
|
+
ctx: { close: () => ref.current?.close() },
|
|
1890
|
+
ref
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
//#endregion
|
|
1894
|
+
//#region src/Dialog.tsx
|
|
1895
|
+
function DefaultCloseIcon() {
|
|
1896
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1897
|
+
width: "16",
|
|
1898
|
+
height: "16",
|
|
1899
|
+
viewBox: "0 0 24 24",
|
|
1900
|
+
fill: "none",
|
|
1901
|
+
stroke: "currentColor",
|
|
1902
|
+
strokeWidth: "2",
|
|
1903
|
+
strokeLinecap: "round",
|
|
1904
|
+
strokeLinejoin: "round",
|
|
1905
|
+
"aria-hidden": "true",
|
|
1906
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })]
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
/** The bare `<dialog>` primitive — for layouts the default `<Dialog>` doesn't fit. */
|
|
1910
|
+
function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
1911
|
+
const { setRef, ctx, ref } = useDialogElement(open, onOpenChange, consumerRef);
|
|
1419
1912
|
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
1420
|
-
value:
|
|
1913
|
+
value: ctx,
|
|
1421
1914
|
children: /* @__PURE__ */ jsx(PortalContainerContext.Provider, {
|
|
1422
1915
|
value: ref,
|
|
1423
1916
|
children: /* @__PURE__ */ jsx("dialog", {
|
|
@@ -1476,19 +1969,35 @@ function DialogCloseButton({ icon, className, children, onClick, type = "button"
|
|
|
1476
1969
|
});
|
|
1477
1970
|
}
|
|
1478
1971
|
/** Standard modal with shorthand-driven header/body/footer. For other shapes, compose `<Dialog.Container>` by hand. */
|
|
1479
|
-
function DialogRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", children, ...containerProps }) {
|
|
1972
|
+
function DialogRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", classNames, children, ...containerProps }) {
|
|
1480
1973
|
const hasTitle = title !== void 0 || icon !== void 0;
|
|
1481
1974
|
const showHeader = hasTitle || dismissible;
|
|
1482
1975
|
return /* @__PURE__ */ jsxs(DialogContainer, {
|
|
1483
1976
|
...containerProps,
|
|
1484
1977
|
children: [
|
|
1485
|
-
showHeader ? /* @__PURE__ */ jsxs(DialogHeader, {
|
|
1486
|
-
|
|
1487
|
-
children:
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1978
|
+
showHeader ? /* @__PURE__ */ jsxs(DialogHeader, {
|
|
1979
|
+
className: classNames?.header,
|
|
1980
|
+
children: [hasTitle ? /* @__PURE__ */ jsx(DialogTitle, {
|
|
1981
|
+
icon,
|
|
1982
|
+
className: classNames?.title,
|
|
1983
|
+
children: title
|
|
1984
|
+
}) : /* @__PURE__ */ jsx("span", { className: cn("flex-1", void 0) }), dismissible ? /* @__PURE__ */ jsx(DialogCloseButton, {
|
|
1985
|
+
"aria-label": closeLabel,
|
|
1986
|
+
className: classNames?.close
|
|
1987
|
+
}) : null]
|
|
1988
|
+
}) : null,
|
|
1989
|
+
description !== void 0 ? /* @__PURE__ */ jsx(DialogDescription, {
|
|
1990
|
+
className: classNames?.description,
|
|
1991
|
+
children: description
|
|
1992
|
+
}) : null,
|
|
1993
|
+
children !== void 0 ? /* @__PURE__ */ jsx(DialogBody, {
|
|
1994
|
+
className: classNames?.body,
|
|
1995
|
+
children
|
|
1996
|
+
}) : null,
|
|
1997
|
+
actions !== void 0 ? /* @__PURE__ */ jsx(DialogFooter, {
|
|
1998
|
+
className: classNames?.footer,
|
|
1999
|
+
children: actions
|
|
2000
|
+
}) : null
|
|
1492
2001
|
]
|
|
1493
2002
|
});
|
|
1494
2003
|
}
|
|
@@ -1502,6 +2011,73 @@ var Dialog = Object.assign(DialogRoot, {
|
|
|
1502
2011
|
CloseButton: DialogCloseButton
|
|
1503
2012
|
});
|
|
1504
2013
|
//#endregion
|
|
2014
|
+
//#region src/Drawer.tsx
|
|
2015
|
+
/** The bare edge-anchored `<dialog>` primitive — for layouts the default `<Drawer>` doesn't fit. */
|
|
2016
|
+
function DrawerContainer({ open, onOpenChange, side = "end", size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
2017
|
+
const { setRef, ctx, ref } = useDialogElement(open, onOpenChange, consumerRef);
|
|
2018
|
+
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
2019
|
+
value: ctx,
|
|
2020
|
+
children: /* @__PURE__ */ jsx(PortalContainerContext.Provider, {
|
|
2021
|
+
value: ref,
|
|
2022
|
+
children: /* @__PURE__ */ jsx("dialog", {
|
|
2023
|
+
ref: setRef,
|
|
2024
|
+
className: cn([
|
|
2025
|
+
"dialog",
|
|
2026
|
+
"drawer",
|
|
2027
|
+
side !== "end" && `drawer-${side}`,
|
|
2028
|
+
size !== "md" && `drawer-${size}`
|
|
2029
|
+
], className),
|
|
2030
|
+
closedby,
|
|
2031
|
+
...rest,
|
|
2032
|
+
children
|
|
2033
|
+
})
|
|
2034
|
+
})
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
/** Edge-anchored panel with shorthand-driven header/body/footer. For other shapes, compose `<Drawer.Container>`. */
|
|
2038
|
+
function DrawerRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", classNames, children, ...containerProps }) {
|
|
2039
|
+
const hasTitle = title !== void 0 || icon !== void 0;
|
|
2040
|
+
const showHeader = hasTitle || dismissible;
|
|
2041
|
+
return /* @__PURE__ */ jsxs(DrawerContainer, {
|
|
2042
|
+
...containerProps,
|
|
2043
|
+
children: [
|
|
2044
|
+
showHeader ? /* @__PURE__ */ jsxs(Dialog.Header, {
|
|
2045
|
+
className: classNames?.header,
|
|
2046
|
+
children: [hasTitle ? /* @__PURE__ */ jsx(Dialog.Title, {
|
|
2047
|
+
icon,
|
|
2048
|
+
className: classNames?.title,
|
|
2049
|
+
children: title
|
|
2050
|
+
}) : /* @__PURE__ */ jsx("span", { className: cn("flex-1", void 0) }), dismissible ? /* @__PURE__ */ jsx(Dialog.CloseButton, {
|
|
2051
|
+
"aria-label": closeLabel,
|
|
2052
|
+
className: classNames?.close
|
|
2053
|
+
}) : null]
|
|
2054
|
+
}) : null,
|
|
2055
|
+
description !== void 0 ? /* @__PURE__ */ jsx(Dialog.Description, {
|
|
2056
|
+
className: classNames?.description,
|
|
2057
|
+
children: description
|
|
2058
|
+
}) : null,
|
|
2059
|
+
children !== void 0 ? /* @__PURE__ */ jsx(Dialog.Body, {
|
|
2060
|
+
className: classNames?.body,
|
|
2061
|
+
children
|
|
2062
|
+
}) : null,
|
|
2063
|
+
actions !== void 0 ? /* @__PURE__ */ jsx(Dialog.Footer, {
|
|
2064
|
+
className: classNames?.footer,
|
|
2065
|
+
children: actions
|
|
2066
|
+
}) : null
|
|
2067
|
+
]
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
/** Shares the Dialog header/body/footer subparts; only the container differs. */
|
|
2071
|
+
var Drawer = Object.assign(DrawerRoot, {
|
|
2072
|
+
Container: DrawerContainer,
|
|
2073
|
+
Header: Dialog.Header,
|
|
2074
|
+
Title: Dialog.Title,
|
|
2075
|
+
Description: Dialog.Description,
|
|
2076
|
+
Body: Dialog.Body,
|
|
2077
|
+
Footer: Dialog.Footer,
|
|
2078
|
+
CloseButton: Dialog.CloseButton
|
|
2079
|
+
});
|
|
2080
|
+
//#endregion
|
|
1505
2081
|
//#region src/Field.tsx
|
|
1506
2082
|
/** The bare `.field` container — for layouts the default `<Field>` doesn't fit. */
|
|
1507
2083
|
function FieldContainer({ className, ...rest }) {
|
|
@@ -1511,14 +2087,19 @@ function FieldContainer({ className, ...rest }) {
|
|
|
1511
2087
|
});
|
|
1512
2088
|
}
|
|
1513
2089
|
/** Standard field — label, control (`children`), description, error. For other shapes, compose `<Field.Container>` by hand. */
|
|
1514
|
-
function FieldRoot({ label, description, error, required, inline, className, children, ...rest }) {
|
|
2090
|
+
function FieldRoot({ label, description, error, required, inline, className, classNames, children, ...rest }) {
|
|
1515
2091
|
const labelEl = label !== void 0 ? /* @__PURE__ */ jsx(FieldLabel, {
|
|
1516
2092
|
required,
|
|
2093
|
+
className: classNames?.label,
|
|
1517
2094
|
children: label
|
|
1518
2095
|
}) : null;
|
|
1519
|
-
const descriptionEl = description !== void 0 ? /* @__PURE__ */ jsx(FieldDescription, {
|
|
2096
|
+
const descriptionEl = description !== void 0 ? /* @__PURE__ */ jsx(FieldDescription, {
|
|
2097
|
+
className: classNames?.description,
|
|
2098
|
+
children: description
|
|
2099
|
+
}) : null;
|
|
1520
2100
|
const errorEl = error !== void 0 ? /* @__PURE__ */ jsx(FieldError, {
|
|
1521
2101
|
match: true,
|
|
2102
|
+
className: classNames?.error,
|
|
1522
2103
|
children: error
|
|
1523
2104
|
}) : null;
|
|
1524
2105
|
return /* @__PURE__ */ jsxs(FieldContainer, {
|
|
@@ -1609,17 +2190,41 @@ function MenuPopup({ className, role = "menu", ...rest }) {
|
|
|
1609
2190
|
...rest
|
|
1610
2191
|
});
|
|
1611
2192
|
}
|
|
2193
|
+
function CheckIcon() {
|
|
2194
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
2195
|
+
width: "1em",
|
|
2196
|
+
height: "1em",
|
|
2197
|
+
viewBox: "0 0 24 24",
|
|
2198
|
+
fill: "none",
|
|
2199
|
+
stroke: "currentColor",
|
|
2200
|
+
strokeWidth: "2",
|
|
2201
|
+
strokeLinecap: "round",
|
|
2202
|
+
strokeLinejoin: "round",
|
|
2203
|
+
"aria-hidden": "true",
|
|
2204
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 12l5 5l10 -10" })
|
|
2205
|
+
});
|
|
2206
|
+
}
|
|
2207
|
+
function MenuItemIndicator() {
|
|
2208
|
+
return /* @__PURE__ */ jsx("span", {
|
|
2209
|
+
className: cn("menu-item-indicator", void 0),
|
|
2210
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
2211
|
+
});
|
|
2212
|
+
}
|
|
1612
2213
|
function MenuItem(props) {
|
|
1613
2214
|
const ref = useRef(null);
|
|
1614
2215
|
const hotkey = props.hotkey;
|
|
2216
|
+
const checked = props.checked;
|
|
1615
2217
|
const ariaDisabled = props["aria-disabled"];
|
|
1616
2218
|
const isDisabled = "disabled" in props && props.disabled === true || ariaDisabled === true || ariaDisabled === "true";
|
|
1617
2219
|
const { ariaKeyShortcuts, primaryChord } = useHotkey(hotkey, () => ref.current?.click(), { enabled: !isDisabled });
|
|
2220
|
+
const leading = checked !== void 0 ? /* @__PURE__ */ jsx(MenuItemIndicator, {}) : renderIcon(props.icon);
|
|
2221
|
+
const defaultRole = checked !== void 0 ? "menuitemcheckbox" : "menuitem";
|
|
1618
2222
|
if (props.href !== void 0) {
|
|
1619
|
-
const { className, role
|
|
2223
|
+
const { className, role, icon: _icon, checked: _checked, children, hotkey: _hk, onClick, ...rest } = props;
|
|
1620
2224
|
return /* @__PURE__ */ jsxs("a", {
|
|
1621
2225
|
ref,
|
|
1622
|
-
role,
|
|
2226
|
+
role: role ?? defaultRole,
|
|
2227
|
+
"aria-checked": checked,
|
|
1623
2228
|
"aria-keyshortcuts": ariaKeyShortcuts,
|
|
1624
2229
|
className: cn("menu-item", className),
|
|
1625
2230
|
onClick: (event) => {
|
|
@@ -1631,22 +2236,23 @@ function MenuItem(props) {
|
|
|
1631
2236
|
},
|
|
1632
2237
|
...rest,
|
|
1633
2238
|
children: [
|
|
1634
|
-
|
|
2239
|
+
leading,
|
|
1635
2240
|
children,
|
|
1636
2241
|
primaryChord !== void 0 ? /* @__PURE__ */ jsx(Kbd, { keys: primaryChord }) : null
|
|
1637
2242
|
]
|
|
1638
2243
|
});
|
|
1639
2244
|
}
|
|
1640
|
-
const { className, type = "button", role
|
|
2245
|
+
const { className, type = "button", role, icon: _icon, checked: _checked, children, hotkey: _hk, ...rest } = props;
|
|
1641
2246
|
return /* @__PURE__ */ jsxs("button", {
|
|
1642
2247
|
ref,
|
|
1643
2248
|
type,
|
|
1644
|
-
role,
|
|
2249
|
+
role: role ?? defaultRole,
|
|
2250
|
+
"aria-checked": checked,
|
|
1645
2251
|
"aria-keyshortcuts": ariaKeyShortcuts,
|
|
1646
2252
|
className: cn("menu-item", className),
|
|
1647
2253
|
...rest,
|
|
1648
2254
|
children: [
|
|
1649
|
-
|
|
2255
|
+
leading,
|
|
1650
2256
|
children,
|
|
1651
2257
|
primaryChord !== void 0 ? /* @__PURE__ */ jsx(Kbd, { keys: primaryChord }) : null
|
|
1652
2258
|
]
|
|
@@ -1833,7 +2439,7 @@ function TooltipPopup({ size = "md", side = "top", align = "center", sideOffset
|
|
|
1833
2439
|
})
|
|
1834
2440
|
});
|
|
1835
2441
|
}
|
|
1836
|
-
function TooltipShorthand({ content, side, align, sideOffset, size, children, ...rootProps }) {
|
|
2442
|
+
function TooltipShorthand({ content, side, align, sideOffset, size, classNames, children, ...rootProps }) {
|
|
1837
2443
|
return /* @__PURE__ */ jsxs(TooltipRoot, {
|
|
1838
2444
|
...rootProps,
|
|
1839
2445
|
children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, { render: children }), /* @__PURE__ */ jsx(TooltipPopup, {
|
|
@@ -1841,6 +2447,7 @@ function TooltipShorthand({ content, side, align, sideOffset, size, children, ..
|
|
|
1841
2447
|
align,
|
|
1842
2448
|
sideOffset,
|
|
1843
2449
|
size,
|
|
2450
|
+
className: classNames?.popup,
|
|
1844
2451
|
children: content
|
|
1845
2452
|
})]
|
|
1846
2453
|
});
|
|
@@ -1885,7 +2492,7 @@ function CheckGlyph({ className }) {
|
|
|
1885
2492
|
children: /* @__PURE__ */ jsx("path", { d: "M5 12l5 5l10 -10" })
|
|
1886
2493
|
});
|
|
1887
2494
|
}
|
|
1888
|
-
function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className, children, ...rest }) {
|
|
2495
|
+
function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className, classNames, children, ...rest }) {
|
|
1889
2496
|
return /* @__PURE__ */ jsxs("section", {
|
|
1890
2497
|
className: cn([
|
|
1891
2498
|
"property-list",
|
|
@@ -1895,10 +2502,10 @@ function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className,
|
|
|
1895
2502
|
], className),
|
|
1896
2503
|
...rest,
|
|
1897
2504
|
children: [title !== void 0 ? /* @__PURE__ */ jsx("h3", {
|
|
1898
|
-
className: cn("property-list-title",
|
|
2505
|
+
className: cn("property-list-title", classNames?.title),
|
|
1899
2506
|
children: title
|
|
1900
2507
|
}) : null, /* @__PURE__ */ jsx("dl", {
|
|
1901
|
-
className: cn("property-list-items",
|
|
2508
|
+
className: cn("property-list-items", classNames?.items),
|
|
1902
2509
|
children
|
|
1903
2510
|
})]
|
|
1904
2511
|
});
|
|
@@ -1908,14 +2515,18 @@ function isEmptyValue(value) {
|
|
|
1908
2515
|
if (typeof value === "string") return value.trim() === "";
|
|
1909
2516
|
return false;
|
|
1910
2517
|
}
|
|
1911
|
-
function PropertyListItem({ label, value, numeric, copyable, copyValue, children, ...rest }) {
|
|
2518
|
+
function PropertyListItem({ label, value, numeric, copyable, copyValue, classNames, children, ...rest }) {
|
|
1912
2519
|
if (children !== void 0) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1913
2520
|
const empty = isEmptyValue(value);
|
|
1914
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PropertyListLabel, {
|
|
2521
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PropertyListLabel, {
|
|
2522
|
+
className: classNames?.label,
|
|
2523
|
+
children: label
|
|
2524
|
+
}), /* @__PURE__ */ jsx(PropertyListValue, {
|
|
1915
2525
|
numeric,
|
|
1916
2526
|
copyable,
|
|
1917
2527
|
empty,
|
|
1918
2528
|
copyValue: copyValue ?? (typeof value === "string" ? value : void 0),
|
|
2529
|
+
classNames: classNames?.copy ? { copy: classNames.copy } : void 0,
|
|
1919
2530
|
...rest,
|
|
1920
2531
|
children: empty ? "—" : value
|
|
1921
2532
|
})] });
|
|
@@ -1926,7 +2537,7 @@ function PropertyListLabel({ className, ...rest }) {
|
|
|
1926
2537
|
...rest
|
|
1927
2538
|
});
|
|
1928
2539
|
}
|
|
1929
|
-
function PropertyListValue({ numeric, copyable, empty, copyValue, className, children, ...rest }) {
|
|
2540
|
+
function PropertyListValue({ numeric, copyable, empty, copyValue, className, classNames, children, ...rest }) {
|
|
1930
2541
|
const ddRef = useRef(null);
|
|
1931
2542
|
const [copied, setCopied] = useState(false);
|
|
1932
2543
|
async function handleCopy() {
|
|
@@ -1950,7 +2561,7 @@ function PropertyListValue({ numeric, copyable, empty, copyValue, className, chi
|
|
|
1950
2561
|
children: [children, /* @__PURE__ */ jsxs("button", {
|
|
1951
2562
|
type: "button",
|
|
1952
2563
|
"aria-label": "Copy",
|
|
1953
|
-
className: cn("property-list-copy",
|
|
2564
|
+
className: cn("property-list-copy", classNames?.copy),
|
|
1954
2565
|
onClick: handleCopy,
|
|
1955
2566
|
"data-copied": copied ? "true" : void 0,
|
|
1956
2567
|
children: [/* @__PURE__ */ jsx(CopyGlyph, { className: cn("property-list-copy-icon", void 0) }), /* @__PURE__ */ jsx(CheckGlyph, { className: cn("property-list-copy-icon-copied", void 0) })]
|
|
@@ -1964,14 +2575,17 @@ var PropertyList = Object.assign(PropertyListRoot, {
|
|
|
1964
2575
|
});
|
|
1965
2576
|
//#endregion
|
|
1966
2577
|
//#region src/Table.tsx
|
|
1967
|
-
function TableRoot({ striped, bordered, relaxed, sticky, className, ...rest }) {
|
|
2578
|
+
function TableRoot({ striped, bordered, density, relaxed, sticky, pinCol, className, ...rest }) {
|
|
2579
|
+
const resolvedDensity = density ?? (relaxed ? "relaxed" : "default");
|
|
1968
2580
|
return /* @__PURE__ */ jsx("table", {
|
|
1969
2581
|
className: cn([
|
|
1970
2582
|
"table",
|
|
1971
2583
|
striped && "table-striped",
|
|
1972
2584
|
bordered && "table-bordered",
|
|
1973
|
-
|
|
1974
|
-
|
|
2585
|
+
resolvedDensity === "compact" && "table-compact",
|
|
2586
|
+
resolvedDensity === "relaxed" && "table-relaxed",
|
|
2587
|
+
sticky && "table-sticky",
|
|
2588
|
+
pinCol && "table-pin-col"
|
|
1975
2589
|
], className),
|
|
1976
2590
|
...rest
|
|
1977
2591
|
});
|
|
@@ -1988,6 +2602,7 @@ function TableBody({ className, ...rest }) {
|
|
|
1988
2602
|
...rest
|
|
1989
2603
|
});
|
|
1990
2604
|
}
|
|
2605
|
+
/** Footer rows are semibold by default; the first row gets a strong top divider against the body. */
|
|
1991
2606
|
function TableFoot({ className, ...rest }) {
|
|
1992
2607
|
return /* @__PURE__ */ jsx("tfoot", {
|
|
1993
2608
|
className,
|
|
@@ -2020,18 +2635,28 @@ function TableCell({ align, gutter, numeric, className, ...rest }) {
|
|
|
2020
2635
|
...rest
|
|
2021
2636
|
});
|
|
2022
2637
|
}
|
|
2638
|
+
/** A centered "no results" row; renders its own `<tr>`, so drop it inside `<Table.Body>`. */
|
|
2639
|
+
function TableEmpty({ colSpan, className, children, ...rest }) {
|
|
2640
|
+
return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
2641
|
+
className: cn("table-empty", className),
|
|
2642
|
+
colSpan,
|
|
2643
|
+
...rest,
|
|
2644
|
+
children
|
|
2645
|
+
}) });
|
|
2646
|
+
}
|
|
2023
2647
|
var Table = Object.assign(TableRoot, {
|
|
2024
2648
|
Head: TableHead,
|
|
2025
2649
|
Body: TableBody,
|
|
2026
2650
|
Foot: TableFoot,
|
|
2027
2651
|
Row: TableRow,
|
|
2028
2652
|
HeaderCell: TableHeaderCell,
|
|
2029
|
-
Cell: TableCell
|
|
2653
|
+
Cell: TableCell,
|
|
2654
|
+
Empty: TableEmpty
|
|
2030
2655
|
});
|
|
2031
2656
|
//#endregion
|
|
2032
2657
|
//#region src/Sidebar.tsx
|
|
2033
2658
|
var SidebarContext = createContext(null);
|
|
2034
|
-
function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, children, ...rest }) {
|
|
2659
|
+
function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, classNames, children, ...rest }) {
|
|
2035
2660
|
const shell = useAppShell();
|
|
2036
2661
|
const drawerOpen = shell?.mobileDrawerOpen ?? false;
|
|
2037
2662
|
return /* @__PURE__ */ jsxs(SidebarContext.Provider, {
|
|
@@ -2047,8 +2672,8 @@ function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLab
|
|
|
2047
2672
|
}), shell ? /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
2048
2673
|
open: drawerOpen,
|
|
2049
2674
|
onOpenChange: (open) => shell.setMobileDrawerOpen(open),
|
|
2050
|
-
children: /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, { className: cn("sidebar-drawer-backdrop",
|
|
2051
|
-
className: cn("sidebar-drawer",
|
|
2675
|
+
children: /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, { className: cn("sidebar-drawer-backdrop", classNames?.drawerBackdrop) }), /* @__PURE__ */ jsx(Dialog$1.Popup, {
|
|
2676
|
+
className: cn("sidebar-drawer", classNames?.drawer),
|
|
2052
2677
|
"aria-label": drawerLabel,
|
|
2053
2678
|
onClick: (event) => {
|
|
2054
2679
|
if (event.target.closest("a, [data-drawer-close]")) shell.setMobileDrawerOpen(false);
|
|
@@ -2082,15 +2707,24 @@ function SidebarGroupLabel({ className, ...rest }) {
|
|
|
2082
2707
|
...rest
|
|
2083
2708
|
});
|
|
2084
2709
|
}
|
|
2085
|
-
function SidebarItem({ active, icon, badge, className, children, ...rest }) {
|
|
2710
|
+
function SidebarItem({ active, icon, badge, className, classNames, children, ...rest }) {
|
|
2086
2711
|
return /* @__PURE__ */ jsxs("a", {
|
|
2087
2712
|
className: cn("sidebar-item", className),
|
|
2088
2713
|
"aria-current": active ? "page" : void 0,
|
|
2089
2714
|
...rest,
|
|
2090
2715
|
children: [
|
|
2091
|
-
icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2092
|
-
|
|
2093
|
-
|
|
2716
|
+
icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2717
|
+
className: classNames?.icon,
|
|
2718
|
+
children: renderIcon(icon)
|
|
2719
|
+
}) : null,
|
|
2720
|
+
children !== void 0 ? /* @__PURE__ */ jsx(SidebarLabel, {
|
|
2721
|
+
className: classNames?.label,
|
|
2722
|
+
children
|
|
2723
|
+
}) : null,
|
|
2724
|
+
badge !== void 0 ? /* @__PURE__ */ jsx(SidebarBadge, {
|
|
2725
|
+
className: classNames?.badge,
|
|
2726
|
+
children: badge
|
|
2727
|
+
}) : null
|
|
2094
2728
|
]
|
|
2095
2729
|
});
|
|
2096
2730
|
}
|
|
@@ -2113,11 +2747,17 @@ function SidebarBadge({ className, ...rest }) {
|
|
|
2113
2747
|
...rest
|
|
2114
2748
|
});
|
|
2115
2749
|
}
|
|
2116
|
-
function SidebarCollapsible({ icon, label, trigger, children, className, open, defaultOpen, onOpenChange, ...rest }) {
|
|
2750
|
+
function SidebarCollapsible({ icon, label, trigger, children, className, classNames, open, defaultOpen, onOpenChange, ...rest }) {
|
|
2117
2751
|
const isControlled = open !== void 0;
|
|
2118
2752
|
const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);
|
|
2119
2753
|
const isOpen = isControlled ? open : internalOpen;
|
|
2120
|
-
const triggerContent = trigger ?? /* @__PURE__ */ jsxs(Fragment, { children: [icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2754
|
+
const triggerContent = trigger ?? /* @__PURE__ */ jsxs(Fragment, { children: [icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2755
|
+
className: classNames?.icon,
|
|
2756
|
+
children: renderIcon(icon)
|
|
2757
|
+
}) : null, label !== void 0 ? /* @__PURE__ */ jsx(SidebarLabel, {
|
|
2758
|
+
className: classNames?.label,
|
|
2759
|
+
children: label
|
|
2760
|
+
}) : null] });
|
|
2121
2761
|
return /* @__PURE__ */ jsxs("details", {
|
|
2122
2762
|
className: cn("sidebar-collapsible", className),
|
|
2123
2763
|
open: isOpen,
|
|
@@ -2128,23 +2768,29 @@ function SidebarCollapsible({ icon, label, trigger, children, className, open, d
|
|
|
2128
2768
|
},
|
|
2129
2769
|
...rest,
|
|
2130
2770
|
children: [/* @__PURE__ */ jsx("summary", {
|
|
2131
|
-
className: cn("sidebar-collapsible-trigger",
|
|
2771
|
+
className: cn("sidebar-collapsible-trigger", classNames?.trigger),
|
|
2132
2772
|
children: triggerContent
|
|
2133
2773
|
}), /* @__PURE__ */ jsx("div", {
|
|
2134
|
-
className: cn("sidebar-collapsible-panel",
|
|
2774
|
+
className: cn("sidebar-collapsible-panel", classNames?.panel),
|
|
2135
2775
|
children
|
|
2136
2776
|
})]
|
|
2137
2777
|
});
|
|
2138
2778
|
}
|
|
2139
|
-
function SidebarSubItem({ active, icon, badge, className, children, ...rest }) {
|
|
2779
|
+
function SidebarSubItem({ active, icon, badge, className, classNames, children, ...rest }) {
|
|
2140
2780
|
return /* @__PURE__ */ jsxs("a", {
|
|
2141
2781
|
className: cn("sidebar-subitem", className),
|
|
2142
2782
|
"aria-current": active ? "page" : void 0,
|
|
2143
2783
|
...rest,
|
|
2144
2784
|
children: [
|
|
2145
|
-
icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2785
|
+
icon != null ? /* @__PURE__ */ jsx(SidebarIcon, {
|
|
2786
|
+
className: classNames?.icon,
|
|
2787
|
+
children: renderIcon(icon)
|
|
2788
|
+
}) : null,
|
|
2146
2789
|
children,
|
|
2147
|
-
badge !== void 0 ? /* @__PURE__ */ jsx(SidebarBadge, {
|
|
2790
|
+
badge !== void 0 ? /* @__PURE__ */ jsx(SidebarBadge, {
|
|
2791
|
+
className: classNames?.badge,
|
|
2792
|
+
children: badge
|
|
2793
|
+
}) : null
|
|
2148
2794
|
]
|
|
2149
2795
|
});
|
|
2150
2796
|
}
|
|
@@ -2154,7 +2800,7 @@ function SidebarFooter({ className, ...rest }) {
|
|
|
2154
2800
|
...rest
|
|
2155
2801
|
});
|
|
2156
2802
|
}
|
|
2157
|
-
function SidebarCollapseToggle({ label = "Toggle sidebar", className, children, ...rest }) {
|
|
2803
|
+
function SidebarCollapseToggle({ label = "Toggle sidebar", className, classNames, children, ...rest }) {
|
|
2158
2804
|
const ctx = useContext(SidebarContext);
|
|
2159
2805
|
const controlledChecked = ctx?.collapsed;
|
|
2160
2806
|
const isControlled = controlledChecked !== void 0;
|
|
@@ -2164,7 +2810,7 @@ function SidebarCollapseToggle({ label = "Toggle sidebar", className, children,
|
|
|
2164
2810
|
children: [
|
|
2165
2811
|
/* @__PURE__ */ jsx("input", {
|
|
2166
2812
|
type: "checkbox",
|
|
2167
|
-
className: cn("sidebar-toggle",
|
|
2813
|
+
className: cn("sidebar-toggle", classNames?.input),
|
|
2168
2814
|
"aria-label": label,
|
|
2169
2815
|
...isControlled ? { checked: controlledChecked } : { defaultChecked: ctx?.defaultCollapsed },
|
|
2170
2816
|
onChange: (event) => ctx?.onCollapsedChange?.(event.currentTarget.checked)
|
|
@@ -2192,6 +2838,6 @@ var Sidebar = Object.assign(SidebarRoot, {
|
|
|
2192
2838
|
CollapseToggle: SidebarCollapseToggle
|
|
2193
2839
|
});
|
|
2194
2840
|
//#endregion
|
|
2195
|
-
export { Accordion, AdminRoot, Alert, AppShell, Badge, BarChart, BrandTile, Breadcrumbs, Button, ButtonGroup, Card, ChartLegend, Checkbox, CodeBlock, Container, Dialog, Donut, Field, FileInput, Footer, Indicator, Input, InputGroup, Kbd, Link, Menu, Navbar, Pagination, Progress, PropertyList, Prose, Radio, RadioGroup, SERIES, Select, Sidebar, Spinner, StackedBar, StatCard, Switch, Table, Tabs, Textarea, Tooltip, getPaginationItems, useAppShell, useHotkey };
|
|
2841
|
+
export { Accordion, AdminRoot, Alert, AppShell, Avatar, AvatarGroup, Badge, BarChart, BrandTile, Breadcrumbs, Button, ButtonGroup, Card, ChartLegend, Checkbox, CodeBlock, Container, Dialog, Donut, Drawer, Field, FileInput, Footer, Indicator, Input, InputGroup, Item, ItemGroup, Kbd, Link, Menu, Navbar, NumberInput, Pagination, PasswordInput, Progress, PropertyList, Prose, Radio, RadioGroup, SERIES, Select, Separator, Sidebar, Spinner, StackedBar, StatCard, Switch, Table, Tabs, Textarea, Timeline, Tooltip, getPaginationItems, useAppShell, useHotkey };
|
|
2196
2842
|
|
|
2197
2843
|
//# sourceMappingURL=index.mjs.map
|