@nocoo/basalt 2.2.0 → 3.0.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/README.md +2 -0
- package/ai/COMPATIBILITY.md +11 -1
- package/ai/DESIGN.md +342 -0
- package/ai/INTEGRATION.md +179 -128
- package/ai/RECIPES.md +51 -26
- package/ai/USAGE.md +4 -4
- package/ai/registry.json +2836 -270
- package/dist/charts/config.d.ts +11 -11
- package/dist/charts/config.js +4 -4
- package/dist/charts/config.js.map +1 -1
- package/dist/charts/date-navigation.js +10 -10
- package/dist/charts/date-navigation.js.map +1 -1
- package/dist/charts/donut.js +1 -1
- package/dist/charts/donut.js.map +1 -1
- package/dist/charts/frame.d.ts +1 -1
- package/dist/charts/frame.js +4 -4
- package/dist/charts/frame.js.map +1 -1
- package/dist/charts/gauge.js +5 -5
- package/dist/charts/gauge.js.map +1 -1
- package/dist/charts/heatmap-calendar.js +11 -11
- package/dist/charts/heatmap-calendar.js.map +1 -1
- package/dist/charts/heatmap-matrix.js +8 -8
- package/dist/charts/heatmap-matrix.js.map +1 -1
- package/dist/charts/item-list.js +1 -1
- package/dist/charts/item-list.js.map +1 -1
- package/dist/charts/legend.js +19 -19
- package/dist/charts/legend.js.map +1 -1
- package/dist/charts/palette.js +2 -2
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts/slot-bar.js +2 -2
- package/dist/charts/slot-bar.js.map +1 -1
- package/dist/charts/sparkline.js +38 -23
- package/dist/charts/sparkline.js.map +1 -1
- package/dist/charts/stat-card.d.ts +2 -2
- package/dist/charts/stat-card.js +61 -58
- package/dist/charts/stat-card.js.map +1 -1
- package/dist/charts/timeline.js +18 -9
- package/dist/charts/timeline.js.map +1 -1
- package/dist/charts/tooltip.js +16 -16
- package/dist/charts/tooltip.js.map +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/app-header.js +8 -8
- package/dist/components/app-header.js.map +1 -1
- package/dist/components/app-shell.js +1 -1
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/approval-card.d.ts +13 -0
- package/dist/components/approval-card.js +161 -0
- package/dist/components/approval-card.js.map +1 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +39 -18
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +8 -8
- package/dist/components/badge.js.map +1 -1
- package/dist/components/banner.d.ts +2 -2
- package/dist/components/banner.js +9 -8
- package/dist/components/banner.js.map +1 -1
- package/dist/components/basalt-mark.js +1 -1
- package/dist/components/basalt-mark.js.map +1 -1
- package/dist/components/battery-meter.js +5 -5
- package/dist/components/battery-meter.js.map +1 -1
- package/dist/components/breadcrumbs.js +6 -6
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/button.js +10 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/chat-bubble.js +4 -3
- package/dist/components/chat-bubble.js.map +1 -1
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/chat-composer.js +126 -60
- package/dist/components/chat-composer.js.map +1 -1
- package/dist/components/chat-header.js +6 -6
- package/dist/components/chat-header.js.map +1 -1
- package/dist/components/chat-inbox.js +34 -30
- package/dist/components/chat-inbox.js.map +1 -1
- package/dist/components/chat-markdown.d.ts +8 -0
- package/dist/components/chat-markdown.js +122 -0
- package/dist/components/chat-markdown.js.map +1 -0
- package/dist/components/chat-message.d.ts +26 -0
- package/dist/components/chat-message.js +145 -0
- package/dist/components/chat-message.js.map +1 -0
- package/dist/components/checkbox.js +11 -11
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/clipboard-text.js +3 -3
- package/dist/components/clipboard-text.js.map +1 -1
- package/dist/components/code.d.ts +22 -20
- package/dist/components/code.js +94 -32
- package/dist/components/code.js.map +1 -1
- package/dist/components/collapsible.js +8 -4
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/command-palette.js +73 -47
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/context-cards.d.ts +15 -0
- package/dist/components/context-cards.js +148 -0
- package/dist/components/context-cards.js.map +1 -0
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +18 -14
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table.d.ts +8 -2
- package/dist/components/data-table.js +161 -106
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +13 -13
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/delete-resource.js +1 -1
- package/dist/components/delete-resource.js.map +1 -1
- package/dist/components/description-list.js +3 -3
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +8 -8
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/diff-table.d.ts +15 -0
- package/dist/components/diff-table.js +146 -0
- package/dist/components/diff-table.js.map +1 -0
- package/dist/components/dock.js +2 -2
- package/dist/components/dock.js.map +1 -1
- package/dist/components/dropdown-menu.js +23 -18
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editable-nav-item.js +63 -58
- package/dist/components/editable-nav-item.js.map +1 -1
- package/dist/components/empty.js +6 -6
- package/dist/components/empty.js.map +1 -1
- package/dist/components/fab.js +1 -1
- package/dist/components/fab.js.map +1 -1
- package/dist/components/field.js +3 -3
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-dropzone.js +7 -7
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/filter-bar.js +6 -6
- package/dist/components/filter-bar.js.map +1 -1
- package/dist/components/flow.js +4 -3
- package/dist/components/flow.js.map +1 -1
- package/dist/components/grid.d.ts +3 -1
- package/dist/components/grid.js +15 -8
- package/dist/components/grid.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/icon-picker.d.ts +8 -2
- package/dist/components/icon-picker.js +75 -47
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/inline-editable.js +6 -6
- package/dist/components/inline-editable.js.map +1 -1
- package/dist/components/input-area.js +3 -3
- package/dist/components/input-area.js.map +1 -1
- package/dist/components/input-group.js +5 -5
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.js +4 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/layer-card.d.ts +9 -4
- package/dist/components/layer-card.js +72 -67
- package/dist/components/layer-card.js.map +1 -1
- package/dist/components/loader.d.ts +16 -10
- package/dist/components/loader.js +46 -53
- package/dist/components/loader.js.map +1 -1
- package/dist/components/loading-screen.js +3 -3
- package/dist/components/loading-screen.js.map +1 -1
- package/dist/components/menu-bar.js +32 -27
- package/dist/components/menu-bar.js.map +1 -1
- package/dist/components/meter.d.ts +5 -5
- package/dist/components/meter.js +25 -12
- package/dist/components/meter.js.map +1 -1
- package/dist/components/multi-select.js +66 -62
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +22 -8
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/overlay.js +2 -2
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/page-header.d.ts +3 -1
- package/dist/components/page-header.js +12 -12
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.js +3 -3
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +18 -23
- package/dist/components/popover.js.map +1 -1
- package/dist/components/prompt-bar.d.ts +16 -0
- package/dist/components/prompt-bar.js +49 -0
- package/dist/components/prompt-bar.js.map +1 -0
- package/dist/components/radio.js +9 -9
- package/dist/components/radio.js.map +1 -1
- package/dist/components/recommendation-card.d.ts +13 -0
- package/dist/components/recommendation-card.js +123 -0
- package/dist/components/recommendation-card.js.map +1 -0
- package/dist/components/resource-list.js +1 -1
- package/dist/components/resource-list.js.map +1 -1
- package/dist/components/responsive-master-detail.js +4 -4
- package/dist/components/responsive-master-detail.js.map +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/section-rule.d.ts +5 -3
- package/dist/components/section-rule.js +12 -12
- package/dist/components/section-rule.js.map +1 -1
- package/dist/components/segment-control.js +3 -3
- package/dist/components/segment-control.js.map +1 -1
- package/dist/components/select.js +47 -32
- package/dist/components/select.js.map +1 -1
- package/dist/components/sensitive-input.js +17 -19
- package/dist/components/sensitive-input.js.map +1 -1
- package/dist/components/sheet.d.ts +4 -4
- package/dist/components/sheet.js +11 -10
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +146 -137
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton-line.d.ts +1 -1
- package/dist/components/skeleton-line.js +2 -2
- package/dist/components/skeleton-line.js.map +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stat-strip.js +5 -4
- package/dist/components/stat-strip.js.map +1 -1
- package/dist/components/switch.js +6 -6
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table-of-contents.js +5 -5
- package/dist/components/table-of-contents.js.map +1 -1
- package/dist/components/table-pager.js +2 -2
- package/dist/components/table-pager.js.map +1 -1
- package/dist/components/table.js +4 -4
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +7 -6
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag-badge.d.ts +10 -10
- package/dist/components/tag-badge.js +11 -11
- package/dist/components/tag-badge.js.map +1 -1
- package/dist/components/tag-color-picker.d.ts +8 -1
- package/dist/components/tag-color-picker.js +33 -25
- package/dist/components/tag-color-picker.js.map +1 -1
- package/dist/components/text.js +5 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/thinking.d.ts +16 -0
- package/dist/components/thinking.js +85 -0
- package/dist/components/thinking.js.map +1 -0
- package/dist/components/toast.js +25 -20
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +6 -5
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +6 -6
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tool-chips.d.ts +12 -0
- package/dist/components/tool-chips.js +138 -0
- package/dist/components/tool-chips.js.map +1 -0
- package/dist/components/toolbar.js +3 -3
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/typeahead-field.js +59 -56
- package/dist/components/typeahead-field.js.map +1 -1
- package/dist/components/upload-queue.js +15 -14
- package/dist/components/upload-queue.js.map +1 -1
- package/dist/models/agent-feedback.d.ts +44 -0
- package/dist/models/agent-feedback.js +28 -0
- package/dist/models/agent-feedback.js.map +1 -0
- package/dist/models/avatar.d.ts +2 -0
- package/dist/models/avatar.js +15 -0
- package/dist/models/avatar.js.map +1 -0
- package/dist/models/code.d.ts +6 -0
- package/dist/models/code.js +24 -0
- package/dist/models/code.js.map +1 -0
- package/dist/models/context-cards.d.ts +13 -0
- package/dist/models/context-cards.js +17 -0
- package/dist/models/context-cards.js.map +1 -0
- package/dist/models/diff-table.d.ts +12 -0
- package/dist/models/diff-table.js +9 -0
- package/dist/models/diff-table.js.map +1 -0
- package/dist/models/recommendation.d.ts +26 -0
- package/dist/models/recommendation.js +23 -0
- package/dist/models/recommendation.js.map +1 -0
- package/dist/styles/base.css +14 -2
- package/dist/styles/standalone.css +1865 -929
- package/dist/styles/tailwind.css +179 -13
- package/dist/styles/tokens.css +679 -20
- package/dist/utils/cn.js +25 -4
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/control-surface.d.ts +1 -1
- package/dist/utils/control-surface.js +1 -1
- package/dist/utils/control-surface.js.map +1 -1
- package/dist/utils/navigation.d.ts +3 -0
- package/dist/utils/navigation.js +8 -0
- package/dist/utils/navigation.js.map +1 -0
- package/dist/utils/selection-indicator.d.ts +1 -1
- package/dist/utils/selection-indicator.js +49 -72
- package/dist/utils/selection-indicator.js.map +1 -1
- package/dist/utils/use-hover-highlight.d.ts +4 -0
- package/dist/utils/use-hover-highlight.js +80 -0
- package/dist/utils/use-hover-highlight.js.map +1 -0
- package/dist/viewmodels/use-approval-card.d.ts +20 -0
- package/dist/viewmodels/use-approval-card.js +83 -0
- package/dist/viewmodels/use-approval-card.js.map +1 -0
- package/dist/viewmodels/use-chat-composer.d.ts +16 -0
- package/dist/viewmodels/use-chat-composer.js +34 -0
- package/dist/viewmodels/use-chat-composer.js.map +1 -0
- package/dist/viewmodels/use-chat-message.d.ts +16 -0
- package/dist/viewmodels/use-chat-message.js +26 -0
- package/dist/viewmodels/use-chat-message.js.map +1 -0
- package/dist/viewmodels/use-code-block.d.ts +8 -0
- package/dist/viewmodels/use-code-block.js +38 -0
- package/dist/viewmodels/use-code-block.js.map +1 -0
- package/dist/viewmodels/use-context-cards.d.ts +17 -0
- package/dist/viewmodels/use-context-cards.js +18 -0
- package/dist/viewmodels/use-context-cards.js.map +1 -0
- package/dist/viewmodels/use-diff-table.d.ts +16 -0
- package/dist/viewmodels/use-diff-table.js +42 -0
- package/dist/viewmodels/use-diff-table.js.map +1 -0
- package/dist/viewmodels/use-loader.d.ts +4 -0
- package/dist/viewmodels/use-loader.js +22 -0
- package/dist/viewmodels/use-loader.js.map +1 -0
- package/dist/viewmodels/use-recommendation-card.d.ts +17 -0
- package/dist/viewmodels/use-recommendation-card.js +41 -0
- package/dist/viewmodels/use-recommendation-card.js.map +1 -0
- package/dist/viewmodels/use-thinking.d.ts +13 -0
- package/dist/viewmodels/use-thinking.js +18 -0
- package/dist/viewmodels/use-thinking.js.map +1 -0
- package/dist/viewmodels/use-tool-chips.d.ts +10 -0
- package/dist/viewmodels/use-tool-chips.js +20 -0
- package/dist/viewmodels/use-tool-chips.js.map +1 -0
- package/package.json +3 -1
|
@@ -4,130 +4,135 @@ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
|
|
|
4
4
|
import { Empty as n } from "./empty.js";
|
|
5
5
|
import { SkeletonLine as r } from "./skeleton-line.js";
|
|
6
6
|
import { Children as i, Fragment as a, cloneElement as o, forwardRef as s, isValidElement as c } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { Slot as l } from "@radix-ui/react-slot";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/layer-card.tsx
|
|
9
|
-
var
|
|
10
|
+
var f = `${t} overflow-hidden rounded-basalt-lg text-basalt-foreground`, p = {
|
|
10
11
|
none: "",
|
|
11
|
-
sm: "p-
|
|
12
|
-
md: "p-
|
|
13
|
-
lg: "p-
|
|
12
|
+
sm: "p-basalt-card-sm",
|
|
13
|
+
md: "p-basalt-card",
|
|
14
|
+
lg: "p-basalt-card-lg",
|
|
15
|
+
xl: "p-basalt-card-xl"
|
|
14
16
|
};
|
|
15
|
-
function
|
|
17
|
+
function m(e) {
|
|
16
18
|
return c(e);
|
|
17
19
|
}
|
|
18
|
-
function
|
|
19
|
-
return i.toArray(e).some((e) =>
|
|
20
|
+
function h(e, t) {
|
|
21
|
+
return i.toArray(e).some((e) => m(e) ? t(e.type) ? !0 : e.type === a && h(e.props.children, t) : !1);
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function g(t, n) {
|
|
22
24
|
return n ? i.map(t, (t) => {
|
|
23
|
-
if (!
|
|
24
|
-
if (t.type === a) return o(t, { children:
|
|
25
|
-
if (t.type ===
|
|
25
|
+
if (!m(t)) return t;
|
|
26
|
+
if (t.type === a) return o(t, { children: g(t.props.children, n) });
|
|
27
|
+
if (t.type === v || t.type === S) {
|
|
26
28
|
let n = t;
|
|
27
29
|
return o(n, { className: e(n.props.className, "border-b border-basalt-border") });
|
|
28
30
|
}
|
|
29
31
|
return t;
|
|
30
32
|
}) : t;
|
|
31
33
|
}
|
|
32
|
-
var
|
|
33
|
-
let s =
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
var _ = s(({ className: t, children: n, outlined: r = !1, padding: i = "md", ...a }, o) => {
|
|
35
|
+
let s = h(n, (e) => E.has(e)), c = h(n, (e) => e === b || e === x), l = h(n, (e) => e === y) && !c;
|
|
36
|
+
return /* @__PURE__ */ u("div", {
|
|
35
37
|
ref: o,
|
|
36
38
|
"data-basalt-surface": "",
|
|
37
|
-
|
|
39
|
+
"data-card-structured": s || void 0,
|
|
40
|
+
className: e(f, s ? "flex w-full flex-col" : p[i], r && "ring-1 ring-basalt-border/40", t),
|
|
38
41
|
...a,
|
|
39
|
-
children:
|
|
42
|
+
children: g(n, l)
|
|
40
43
|
});
|
|
41
44
|
});
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
return /* @__PURE__ */ l
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
_.displayName = "LayerCard";
|
|
46
|
+
function v({ className: t, asChild: n = !1, ...r }) {
|
|
47
|
+
return /* @__PURE__ */ u(n ? l : "div", {
|
|
48
|
+
"data-slot": "card-header",
|
|
49
|
+
className: e("flex min-w-0 justify-between gap-basalt-card px-basalt-card py-basalt-card-sm text-basalt-muted-foreground", n ? "w-full items-center" : "items-start", t),
|
|
50
|
+
...r
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
+
v.displayName = "LayerCard.Header";
|
|
54
|
+
function y({ className: t, ...n }) {
|
|
55
|
+
return /* @__PURE__ */ u("div", {
|
|
56
|
+
"data-slot": "card-body",
|
|
57
|
+
className: e("min-w-0 p-basalt-card", t),
|
|
53
58
|
...n
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */
|
|
61
|
+
y.displayName = "LayerCard.Body";
|
|
62
|
+
function b({ className: t, outlined: n = !1, ...r }) {
|
|
63
|
+
return /* @__PURE__ */ u("div", {
|
|
59
64
|
"data-basalt-surface": "",
|
|
60
|
-
className: e("min-w-0 p-
|
|
65
|
+
className: e("min-w-0 p-basalt-card", n && "ring-1 ring-basalt-border/40", t),
|
|
61
66
|
...r
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
|
-
|
|
65
|
-
function b(e) {
|
|
66
|
-
return /* @__PURE__ */ l(y, { ...e });
|
|
67
|
-
}
|
|
68
|
-
b.displayName = "LayerCard.Primary";
|
|
69
|
+
b.displayName = "LayerCard.Well";
|
|
69
70
|
function x(e) {
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ u(b, { ...e });
|
|
71
72
|
}
|
|
72
|
-
x.displayName = "LayerCard.
|
|
73
|
-
function S(
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
|
|
73
|
+
x.displayName = "LayerCard.Primary";
|
|
74
|
+
function S(e) {
|
|
75
|
+
return /* @__PURE__ */ u(v, { ...e });
|
|
76
|
+
}
|
|
77
|
+
S.displayName = "LayerCard.Secondary";
|
|
78
|
+
function C({ className: t, ...n }) {
|
|
79
|
+
return /* @__PURE__ */ u("div", {
|
|
80
|
+
className: e("flex flex-wrap items-center justify-end gap-basalt-space-lg border-t border-basalt-border px-basalt-card py-basalt-card-sm", t),
|
|
76
81
|
...n
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
|
-
|
|
80
|
-
function
|
|
81
|
-
return /* @__PURE__ */
|
|
84
|
+
C.displayName = "LayerCard.Footer";
|
|
85
|
+
function w({ label: t = "Loading", className: n, ...i }) {
|
|
86
|
+
return /* @__PURE__ */ d("div", {
|
|
82
87
|
role: "status",
|
|
83
88
|
"aria-label": t,
|
|
84
|
-
className: e("space-y-
|
|
89
|
+
className: e("space-y-basalt-space-lg p-basalt-card", n),
|
|
85
90
|
...i,
|
|
86
91
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ u(r, {
|
|
88
93
|
minWidth: 100,
|
|
89
94
|
maxWidth: 100
|
|
90
95
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ u(r, {
|
|
92
97
|
minWidth: 72,
|
|
93
98
|
maxWidth: 72
|
|
94
99
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ u(r, {
|
|
96
101
|
minWidth: 88,
|
|
97
102
|
maxWidth: 88
|
|
98
103
|
})
|
|
99
104
|
]
|
|
100
105
|
});
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
function
|
|
104
|
-
return /* @__PURE__ */
|
|
107
|
+
w.displayName = "LayerCard.Loading";
|
|
108
|
+
function T({ title: t = "No content", className: r, ...i }) {
|
|
109
|
+
return /* @__PURE__ */ u(n, {
|
|
105
110
|
title: t,
|
|
106
|
-
className: e("p-
|
|
111
|
+
className: e("p-basalt-card", r),
|
|
107
112
|
...i
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
_,
|
|
115
|
+
T.displayName = "LayerCard.Empty";
|
|
116
|
+
var E = /* @__PURE__ */ new Set([
|
|
113
117
|
v,
|
|
114
118
|
y,
|
|
115
|
-
|
|
119
|
+
b,
|
|
116
120
|
C,
|
|
117
121
|
w,
|
|
118
|
-
|
|
119
|
-
x
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
T,
|
|
123
|
+
x,
|
|
124
|
+
S
|
|
125
|
+
]), D = Object.assign(_, {
|
|
126
|
+
Primary: x,
|
|
127
|
+
Secondary: S,
|
|
128
|
+
Header: v,
|
|
129
|
+
Body: y,
|
|
130
|
+
Well: b,
|
|
131
|
+
Footer: C,
|
|
132
|
+
Loading: w,
|
|
133
|
+
Empty: T
|
|
129
134
|
});
|
|
130
135
|
//#endregion
|
|
131
|
-
export {
|
|
136
|
+
export { D as LayerCard };
|
|
132
137
|
|
|
133
138
|
//# sourceMappingURL=layer-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer-card.js","names":["ROOT_CLASSES","BASALT_UI_CLASS","PADDING_CLASSES","isElement","isValidElement","child","hasSlot","Children","children","match","Fragment","decorateHeaders","divided","cloneElement","LayerCardHeader","LayerCardSecondary","typed","cn","LayerCardRoot","forwardRef","props","structured","STRUCTURED_TYPES","type","hasWell","LayerCardWell","LayerCardPrimary","headerDivided","LayerCardBody","padding","outlined","className","LayerCardFooter","LayerCardLoading","label","SkeletonLine","LayerCardEmpty","Empty","LayerCard"],"sources":["../../src/components/layer-card.tsx"],"sourcesContent":["import {\n\tChildren,\n\tcloneElement,\n\tFragment,\n\tforwardRef,\n\ttype HTMLAttributes,\n\tisValidElement,\n\ttype ReactElement,\n\ttype ReactNode,\n} from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { Empty } from \"./empty\";\nimport { SkeletonLine } from \"./skeleton-line\";\n\nconst ROOT_CLASSES = `${BASALT_UI_CLASS} overflow-hidden rounded-basalt-lg text-basalt-foreground`;\nconst PADDING_CLASSES = {\n\tnone: \"\",\n\tsm: \"p-3\",\n\tmd: \"p-4\",\n\tlg: \"p-6\",\n} as const;\n\nexport type LayerCardPadding = keyof typeof PADDING_CLASSES;\n\nexport type LayerCardProps = Omit<HTMLAttributes<HTMLDivElement>, \"className\"> & {\n\t/**\n\t * Additional classes for the card root.\n\t */\n\tclassName?: string;\n\t/**\n\t * Draw a hairline ring. Default grouping is luminance only.\n\t * @default false\n\t */\n\toutlined?: boolean;\n\t/**\n\t * Inner spacing for unstructured card content.\n\t * @default \"md\"\n\t */\n\tpadding?: LayerCardPadding;\n};\nexport type LayerCardSectionProps = HTMLAttributes<HTMLDivElement>;\nexport type LayerCardWellProps = LayerCardSectionProps & {\n\t/**\n\t * Draw a hairline ring on a nested well.\n\t * @default false\n\t */\n\toutlined?: boolean;\n};\nexport type LayerCardLoadingProps = Omit<HTMLAttributes<HTMLDivElement>, \"aria-label\"> & {\n\t/**\n\t * Accessible label announced for the loading state.\n\t * @default \"Loading\"\n\t */\n\tlabel?: string;\n};\nexport type LayerCardEmptyProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\" | \"children\"> & {\n\t/**\n\t * Empty-state heading.\n\t * @default \"No content\"\n\t */\n\ttitle?: string;\n\t/**\n\t * Supporting empty-state text.\n\t */\n\tdescription?: string;\n\t/**\n\t * Optional empty-state icon.\n\t */\n\ticon?: ReactNode;\n\t/**\n\t * Optional interactive action element rendered below empty content.\n\t */\n\taction?: ReactNode;\n\t/**\n\t * Custom supporting content or custom layout rendered between description and action.\n\t */\n\tchildren?: ReactNode;\n};\n\nfunction isElement(child: ReactNode): child is ReactElement<{ children?: ReactNode }> {\n\treturn isValidElement(child);\n}\n\nfunction hasSlot(children: ReactNode, match: (type: unknown) => boolean): boolean {\n\treturn Children.toArray(children).some((child) => {\n\t\tif (!isElement(child)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (match(child.type)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (child.type === Fragment) {\n\t\t\treturn hasSlot(child.props.children, match);\n\t\t}\n\t\treturn false;\n\t});\n}\n\nfunction decorateHeaders(children: ReactNode, divided: boolean): ReactNode {\n\tif (!divided) {\n\t\treturn children;\n\t}\n\treturn Children.map(children, (child) => {\n\t\tif (!isElement(child)) {\n\t\t\treturn child;\n\t\t}\n\t\tif (child.type === Fragment) {\n\t\t\treturn cloneElement(child, {\n\t\t\t\tchildren: decorateHeaders(child.props.children, divided),\n\t\t\t});\n\t\t}\n\t\tif (child.type === LayerCardHeader || child.type === LayerCardSecondary) {\n\t\t\tconst typed = child as ReactElement<{ className?: string }>;\n\t\t\treturn cloneElement(typed, {\n\t\t\t\tclassName: cn(typed.props.className, \"border-b border-basalt-border\"),\n\t\t\t});\n\t\t}\n\t\treturn child;\n\t});\n}\n\nconst LayerCardRoot = forwardRef<HTMLDivElement, LayerCardProps>(\n\t({ className, children, outlined = false, padding = \"md\", ...props }, ref) => {\n\t\tconst structured = hasSlot(children, (type) => STRUCTURED_TYPES.has(type));\n\t\tconst hasWell = hasSlot(\n\t\t\tchildren,\n\t\t\t(type) => type === LayerCardWell || type === LayerCardPrimary,\n\t\t);\n\t\tconst hasBody = hasSlot(children, (type) => type === LayerCardBody);\n\t\tconst headerDivided = hasBody && !hasWell;\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-basalt-surface=\"\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\tROOT_CLASSES,\n\t\t\t\t\tstructured ? \"flex w-full flex-col\" : PADDING_CLASSES[padding],\n\t\t\t\t\toutlined && \"ring-1 ring-basalt-border/40\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{decorateHeaders(children, headerDivided)}\n\t\t\t</div>\n\t\t);\n\t},\n);\nLayerCardRoot.displayName = \"LayerCard\";\n\nfunction LayerCardHeader({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-w-0 items-start justify-between gap-4 px-4 py-3 text-basalt-muted-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardHeader.displayName = \"LayerCard.Header\";\n\nfunction LayerCardBody({ className, ...props }: LayerCardSectionProps) {\n\treturn <div className={cn(\"min-w-0 p-4\", className)} {...props} />;\n}\nLayerCardBody.displayName = \"LayerCard.Body\";\n\nfunction LayerCardWell({ className, outlined = false, ...props }: LayerCardWellProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-basalt-surface=\"\"\n\t\t\tclassName={cn(\"min-w-0 p-4\", outlined && \"ring-1 ring-basalt-border/40\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardWell.displayName = \"LayerCard.Well\";\n\nfunction LayerCardPrimary(props: LayerCardWellProps) {\n\treturn <LayerCardWell {...props} />;\n}\nLayerCardPrimary.displayName = \"LayerCard.Primary\";\n\nfunction LayerCardSecondary(props: LayerCardSectionProps) {\n\treturn <LayerCardHeader {...props} />;\n}\nLayerCardSecondary.displayName = \"LayerCard.Secondary\";\n\nfunction LayerCardFooter({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-wrap items-center justify-end gap-2 border-t border-basalt-border px-4 py-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardFooter.displayName = \"LayerCard.Footer\";\n\nfunction LayerCardLoading({ label = \"Loading\", className, ...props }: LayerCardLoadingProps) {\n\treturn (\n\t\t<div role=\"status\" aria-label={label} className={cn(\"space-y-3 p-4\", className)} {...props}>\n\t\t\t<SkeletonLine minWidth={100} maxWidth={100} />\n\t\t\t<SkeletonLine minWidth={72} maxWidth={72} />\n\t\t\t<SkeletonLine minWidth={88} maxWidth={88} />\n\t\t</div>\n\t);\n}\nLayerCardLoading.displayName = \"LayerCard.Loading\";\n\nfunction LayerCardEmpty({ title = \"No content\", className, ...props }: LayerCardEmptyProps) {\n\treturn <Empty title={title} className={cn(\"p-8\", className)} {...props} />;\n}\nLayerCardEmpty.displayName = \"LayerCard.Empty\";\n\nconst STRUCTURED_TYPES = new Set<unknown>([\n\tLayerCardHeader,\n\tLayerCardBody,\n\tLayerCardWell,\n\tLayerCardFooter,\n\tLayerCardLoading,\n\tLayerCardEmpty,\n\tLayerCardPrimary,\n\tLayerCardSecondary,\n]);\n\nexport const LayerCard = Object.assign(LayerCardRoot, {\n\tPrimary: LayerCardPrimary,\n\tSecondary: LayerCardSecondary,\n\tHeader: LayerCardHeader,\n\tBody: LayerCardBody,\n\tWell: LayerCardWell,\n\tFooter: LayerCardFooter,\n\tLoading: LayerCardLoading,\n\tEmpty: LayerCardEmpty,\n});\n"],"mappings":";;;;;;;;AAeA,IAAMA,IAAe,GAAGC,EAAgB,4DAClCC,IAAkB;CACvB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;AACL;AA2DA,SAASC,EAAU,GAAmE;CACrF,OAAOC,EAAeC,CAAK;AAC5B;AAEA,SAASC,EAAQ,GAAqB,GAA4C;CACjF,OAAOC,EAAS,QAAQC,CAAQ,CAAC,CAAC,MAAM,MAClCL,EAAUE,CAAK,IAGhBI,EAAMJ,EAAM,IAAI,IACZ,KAEJA,EAAM,SAASK,KACXJ,EAAQD,EAAM,MAAM,UAAUI,CAAK,IANnC,EASR;AACF;AAEA,SAASE,EAAgB,GAAqB,GAA6B;CAI1E,OAHKC,IAGEL,EAAS,IAAIC,IAAW,MAAU;EACxC,IAAI,CAACL,EAAUE,CAAK,GACnB,OAAOA;EAER,IAAIA,EAAM,SAASK,GAClB,OAAOG,EAAaR,GAAO,EAC1B,UAAUM,EAAgBN,EAAM,MAAM,UAAUO,CAAO,EACxD,CAAC;EAEF,IAAIP,EAAM,SAASS,KAAmBT,EAAM,SAASU,GAAoB;GACxE,IAAMC,IAAQX;GACd,OAAOQ,EAAaG,GAAO,EAC1B,WAAWC,EAAGD,EAAM,MAAM,WAAW,+BAA+B,EACrE,CAAC;EACF;EACA,OAAOX;CACR,CAAC,IAlBOG;AAmBT;AAEA,IAAMU,IAAgBC,GACpB,EAAE,cAAW,aAAU,cAAW,IAAO,aAAU,MAAM,GAAGC,KAAS,MAAQ;CAC7E,IAAMC,IAAaf,EAAQE,IAAW,MAASc,EAAiB,IAAIC,CAAI,CAAC,GACnEC,IAAUlB,EACfE,IACC,MAASe,MAASE,KAAiBF,MAASG,CAC9C,GAEMC,IADUrB,EAAQE,IAAW,MAASe,MAASK,CAC/B,KAAW,CAACJ;CAClC,OACC,kBAAC,OAAD;EACM;EACL,uBAAoB;EACpB,WAAWP,EACVjB,GACAqB,IAAa,yBAAyBnB,EAAgB2B,IACtDC,KAAY,gCACZC,CACD;EACA,GAAIX;EAEH,UAAAT,EAAgBH,GAAUmB,CAAa;CACpC,CAAA;AAEP,CACD;AACA,EAAc,cAAc;AAE5B,SAASb,EAAgB,EAAE,cAAW,GAAGM,KAAgC;CACxE,OACC,kBAAC,OAAD;EACC,WAAWH,EACV,yFACAc,CACD;EACA,GAAIX;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAASQ,EAAc,EAAE,cAAW,GAAGR,KAAgC;CACtE,OAAO,kBAAC,OAAD;EAAK,WAAWH,EAAG,eAAec,CAAS;EAAG,GAAIX;CAAQ,CAAA;AAClE;AACA,EAAc,cAAc;AAE5B,SAASK,EAAc,EAAE,cAAW,cAAW,IAAO,GAAGL,KAA6B;CACrF,OACC,kBAAC,OAAD;EACC,uBAAoB;EACpB,WAAWH,EAAG,eAAea,KAAY,gCAAgCC,CAAS;EAClF,GAAIX;CACJ,CAAA;AAEH;AACA,EAAc,cAAc;AAE5B,SAASM,EAAiB,GAA2B;CACpD,OAAO,kBAACD,GAAD,EAAe,GAAIL,EAAQ,CAAA;AACnC;AACA,EAAiB,cAAc;AAE/B,SAASL,EAAmB,GAA8B;CACzD,OAAO,kBAACD,GAAD,EAAiB,GAAIM,EAAQ,CAAA;AACrC;AACA,EAAmB,cAAc;AAEjC,SAASY,EAAgB,EAAE,cAAW,GAAGZ,KAAgC;CACxE,OACC,kBAAC,OAAD;EACC,WAAWH,EACV,yFACAc,CACD;EACA,GAAIX;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAASa,EAAiB,EAAE,WAAQ,WAAW,cAAW,GAAGb,KAAgC;CAC5F,OACC,kBAAC,OAAD;EAAK,MAAK;EAAS,cAAYc;EAAO,WAAWjB,EAAG,iBAAiBc,CAAS;EAAG,GAAIX;EAArF,UAAA;GACC,kBAACe,GAAD;IAAc,UAAU;IAAK,UAAU;GAAM,CAAA;GAC7C,kBAACA,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;GAC3C,kBAACA,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;EACvC;;AAEP;AACA,EAAiB,cAAc;AAE/B,SAASC,EAAe,EAAE,WAAQ,cAAc,cAAW,GAAGhB,KAA8B;CAC3F,OAAO,kBAACiB,GAAD;EAAc;EAAO,WAAWpB,EAAG,OAAOc,CAAS;EAAG,GAAIX;CAAQ,CAAA;AAC1E;AACA,EAAe,cAAc;AAE7B,IAAME,oBAAmB,IAAI,IAAa;CACzCR;CACAc;CACAH;CACAO;CACAC;CACAG;CACAV;CACAX;AACD,CAAC,GAEYuB,IAAY,OAAO,OAAOpB,GAAe;CACrD,SAASQ;CACT,WAAWX;CACX,QAAQD;CACR,MAAMc;CACN,MAAMH;CACN,QAAQO;CACR,SAASC;CACT,OAAOG;AACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"layer-card.js","names":["ROOT_CLASSES","BASALT_UI_CLASS","PADDING_CLASSES","isElement","isValidElement","child","hasSlot","Children","children","match","Fragment","decorateHeaders","divided","cloneElement","LayerCardHeader","LayerCardSecondary","typed","cn","LayerCardRoot","forwardRef","props","structured","STRUCTURED_TYPES","type","hasWell","LayerCardWell","LayerCardPrimary","headerDivided","LayerCardBody","padding","outlined","className","asChild","Slot","LayerCardFooter","LayerCardLoading","label","SkeletonLine","LayerCardEmpty","Empty","LayerCard"],"sources":["../../src/components/layer-card.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport {\n\tChildren,\n\tcloneElement,\n\tFragment,\n\tforwardRef,\n\ttype HTMLAttributes,\n\tisValidElement,\n\ttype ReactElement,\n\ttype ReactNode,\n} from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { Empty } from \"./empty\";\nimport { SkeletonLine } from \"./skeleton-line\";\n\nconst ROOT_CLASSES = `${BASALT_UI_CLASS} overflow-hidden rounded-basalt-lg text-basalt-foreground`;\nconst PADDING_CLASSES = {\n\tnone: \"\",\n\tsm: \"p-basalt-card-sm\",\n\tmd: \"p-basalt-card\",\n\tlg: \"p-basalt-card-lg\",\n\txl: \"p-basalt-card-xl\",\n} as const;\n\nexport type LayerCardPadding = keyof typeof PADDING_CLASSES;\n\nexport type LayerCardProps = Omit<HTMLAttributes<HTMLDivElement>, \"className\"> & {\n\t/**\n\t * Additional classes for the card root.\n\t */\n\tclassName?: string;\n\t/**\n\t * Draw a hairline ring. Default grouping is luminance only.\n\t * @default false\n\t */\n\toutlined?: boolean;\n\t/**\n\t * Inner spacing for unstructured card content.\n\t * @default \"md\"\n\t */\n\tpadding?: LayerCardPadding;\n};\nexport type LayerCardSectionProps = HTMLAttributes<HTMLDivElement>;\nexport type LayerCardHeaderProps = LayerCardSectionProps & {\n\t/** Apply header insets to one child, such as a CollapsibleTrigger, without another wrapper. @default false */\n\tasChild?: boolean;\n};\nexport type LayerCardWellProps = LayerCardSectionProps & {\n\t/**\n\t * Draw a hairline ring on a nested well.\n\t * @default false\n\t */\n\toutlined?: boolean;\n};\nexport type LayerCardLoadingProps = Omit<HTMLAttributes<HTMLDivElement>, \"aria-label\"> & {\n\t/**\n\t * Accessible label announced for the loading state.\n\t * @default \"Loading\"\n\t */\n\tlabel?: string;\n};\nexport type LayerCardEmptyProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\" | \"children\"> & {\n\t/**\n\t * Empty-state heading.\n\t * @default \"No content\"\n\t */\n\ttitle?: string;\n\t/**\n\t * Supporting empty-state text.\n\t */\n\tdescription?: string;\n\t/**\n\t * Optional empty-state icon.\n\t */\n\ticon?: ReactNode;\n\t/**\n\t * Optional interactive action element rendered below empty content.\n\t */\n\taction?: ReactNode;\n\t/**\n\t * Custom supporting content or custom layout rendered between description and action.\n\t */\n\tchildren?: ReactNode;\n};\n\nfunction isElement(child: ReactNode): child is ReactElement<{ children?: ReactNode }> {\n\treturn isValidElement(child);\n}\n\nfunction hasSlot(children: ReactNode, match: (type: unknown) => boolean): boolean {\n\treturn Children.toArray(children).some((child) => {\n\t\tif (!isElement(child)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (match(child.type)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (child.type === Fragment) {\n\t\t\treturn hasSlot(child.props.children, match);\n\t\t}\n\t\treturn false;\n\t});\n}\n\nfunction decorateHeaders(children: ReactNode, divided: boolean): ReactNode {\n\tif (!divided) {\n\t\treturn children;\n\t}\n\treturn Children.map(children, (child) => {\n\t\tif (!isElement(child)) {\n\t\t\treturn child;\n\t\t}\n\t\tif (child.type === Fragment) {\n\t\t\treturn cloneElement(child, {\n\t\t\t\tchildren: decorateHeaders(child.props.children, divided),\n\t\t\t});\n\t\t}\n\t\tif (child.type === LayerCardHeader || child.type === LayerCardSecondary) {\n\t\t\tconst typed = child as ReactElement<{ className?: string }>;\n\t\t\treturn cloneElement(typed, {\n\t\t\t\tclassName: cn(typed.props.className, \"border-b border-basalt-border\"),\n\t\t\t});\n\t\t}\n\t\treturn child;\n\t});\n}\n\nconst LayerCardRoot = forwardRef<HTMLDivElement, LayerCardProps>(\n\t({ className, children, outlined = false, padding = \"md\", ...props }, ref) => {\n\t\tconst structured = hasSlot(children, (type) => STRUCTURED_TYPES.has(type));\n\t\tconst hasWell = hasSlot(\n\t\t\tchildren,\n\t\t\t(type) => type === LayerCardWell || type === LayerCardPrimary,\n\t\t);\n\t\tconst hasBody = hasSlot(children, (type) => type === LayerCardBody);\n\t\tconst headerDivided = hasBody && !hasWell;\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-basalt-surface=\"\"\n\t\t\t\tdata-card-structured={structured || undefined}\n\t\t\t\tclassName={cn(\n\t\t\t\t\tROOT_CLASSES,\n\t\t\t\t\tstructured ? \"flex w-full flex-col\" : PADDING_CLASSES[padding],\n\t\t\t\t\toutlined && \"ring-1 ring-basalt-border/40\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{decorateHeaders(children, headerDivided)}\n\t\t\t</div>\n\t\t);\n\t},\n);\nLayerCardRoot.displayName = \"LayerCard\";\n\nfunction LayerCardHeader({ className, asChild = false, ...props }: LayerCardHeaderProps) {\n\tconst Component = asChild ? Slot : \"div\";\n\treturn (\n\t\t<Component\n\t\t\tdata-slot=\"card-header\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-w-0 justify-between gap-basalt-card px-basalt-card py-basalt-card-sm text-basalt-muted-foreground\",\n\t\t\t\tasChild ? \"w-full items-center\" : \"items-start\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardHeader.displayName = \"LayerCard.Header\";\n\nfunction LayerCardBody({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div data-slot=\"card-body\" className={cn(\"min-w-0 p-basalt-card\", className)} {...props} />\n\t);\n}\nLayerCardBody.displayName = \"LayerCard.Body\";\n\nfunction LayerCardWell({ className, outlined = false, ...props }: LayerCardWellProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-basalt-surface=\"\"\n\t\t\tclassName={cn(\"min-w-0 p-basalt-card\", outlined && \"ring-1 ring-basalt-border/40\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardWell.displayName = \"LayerCard.Well\";\n\nfunction LayerCardPrimary(props: LayerCardWellProps) {\n\treturn <LayerCardWell {...props} />;\n}\nLayerCardPrimary.displayName = \"LayerCard.Primary\";\n\nfunction LayerCardSecondary(props: LayerCardSectionProps) {\n\treturn <LayerCardHeader {...props} />;\n}\nLayerCardSecondary.displayName = \"LayerCard.Secondary\";\n\nfunction LayerCardFooter({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-wrap items-center justify-end gap-basalt-space-lg border-t border-basalt-border px-basalt-card py-basalt-card-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardFooter.displayName = \"LayerCard.Footer\";\n\nfunction LayerCardLoading({ label = \"Loading\", className, ...props }: LayerCardLoadingProps) {\n\treturn (\n\t\t<div\n\t\t\trole=\"status\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\"space-y-basalt-space-lg p-basalt-card\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SkeletonLine minWidth={100} maxWidth={100} />\n\t\t\t<SkeletonLine minWidth={72} maxWidth={72} />\n\t\t\t<SkeletonLine minWidth={88} maxWidth={88} />\n\t\t</div>\n\t);\n}\nLayerCardLoading.displayName = \"LayerCard.Loading\";\n\nfunction LayerCardEmpty({ title = \"No content\", className, ...props }: LayerCardEmptyProps) {\n\treturn <Empty title={title} className={cn(\"p-basalt-card\", className)} {...props} />;\n}\nLayerCardEmpty.displayName = \"LayerCard.Empty\";\n\nconst STRUCTURED_TYPES = new Set<unknown>([\n\tLayerCardHeader,\n\tLayerCardBody,\n\tLayerCardWell,\n\tLayerCardFooter,\n\tLayerCardLoading,\n\tLayerCardEmpty,\n\tLayerCardPrimary,\n\tLayerCardSecondary,\n]);\n\nexport const LayerCard = Object.assign(LayerCardRoot, {\n\tPrimary: LayerCardPrimary,\n\tSecondary: LayerCardSecondary,\n\tHeader: LayerCardHeader,\n\tBody: LayerCardBody,\n\tWell: LayerCardWell,\n\tFooter: LayerCardFooter,\n\tLoading: LayerCardLoading,\n\tEmpty: LayerCardEmpty,\n});\n"],"mappings":";;;;;;;;;AAgBA,IAAMA,IAAe,GAAGC,EAAgB,4DAClCC,IAAkB;CACvB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACL;AA+DA,SAASC,EAAU,GAAmE;CACrF,OAAOC,EAAeC,CAAK;AAC5B;AAEA,SAASC,EAAQ,GAAqB,GAA4C;CACjF,OAAOC,EAAS,QAAQC,CAAQ,CAAC,CAAC,MAAM,MAClCL,EAAUE,CAAK,IAGhBI,EAAMJ,EAAM,IAAI,IACZ,KAEJA,EAAM,SAASK,KACXJ,EAAQD,EAAM,MAAM,UAAUI,CAAK,IANnC,EASR;AACF;AAEA,SAASE,EAAgB,GAAqB,GAA6B;CAI1E,OAHKC,IAGEL,EAAS,IAAIC,IAAW,MAAU;EACxC,IAAI,CAACL,EAAUE,CAAK,GACnB,OAAOA;EAER,IAAIA,EAAM,SAASK,GAClB,OAAOG,EAAaR,GAAO,EAC1B,UAAUM,EAAgBN,EAAM,MAAM,UAAUO,CAAO,EACxD,CAAC;EAEF,IAAIP,EAAM,SAASS,KAAmBT,EAAM,SAASU,GAAoB;GACxE,IAAMC,IAAQX;GACd,OAAOQ,EAAaG,GAAO,EAC1B,WAAWC,EAAGD,EAAM,MAAM,WAAW,+BAA+B,EACrE,CAAC;EACF;EACA,OAAOX;CACR,CAAC,IAlBOG;AAmBT;AAEA,IAAMU,IAAgBC,GACpB,EAAE,cAAW,aAAU,cAAW,IAAO,aAAU,MAAM,GAAGC,KAAS,MAAQ;CAC7E,IAAMC,IAAaf,EAAQE,IAAW,MAASc,EAAiB,IAAIC,CAAI,CAAC,GACnEC,IAAUlB,EACfE,IACC,MAASe,MAASE,KAAiBF,MAASG,CAC9C,GAEMC,IADUrB,EAAQE,IAAW,MAASe,MAASK,CAC/B,KAAW,CAACJ;CAClC,OACC,kBAAC,OAAD;EACM;EACL,uBAAoB;EACpB,wBAAsBH,KAAc,KAAA;EACpC,WAAWJ,EACVjB,GACAqB,IAAa,yBAAyBnB,EAAgB2B,IACtDC,KAAY,gCACZC,CACD;EACA,GAAIX;EAEH,UAAAT,EAAgBH,GAAUmB,CAAa;CACpC,CAAA;AAEP,CACD;AACA,EAAc,cAAc;AAE5B,SAASb,EAAgB,EAAE,cAAW,aAAU,IAAO,GAAGM,KAA+B;CAExF,OACC,kBAFiBY,IAAUC,IAAO,OAElC;EACC,aAAU;EACV,WAAWhB,EACV,8GACAe,IAAU,wBAAwB,eAClCD,CACD;EACA,GAAIX;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAASQ,EAAc,EAAE,cAAW,GAAGR,KAAgC;CACtE,OACC,kBAAC,OAAD;EAAK,aAAU;EAAY,WAAWH,EAAG,yBAAyBc,CAAS;EAAG,GAAIX;CAAQ,CAAA;AAE5F;AACA,EAAc,cAAc;AAE5B,SAASK,EAAc,EAAE,cAAW,cAAW,IAAO,GAAGL,KAA6B;CACrF,OACC,kBAAC,OAAD;EACC,uBAAoB;EACpB,WAAWH,EAAG,yBAAyBa,KAAY,gCAAgCC,CAAS;EAC5F,GAAIX;CACJ,CAAA;AAEH;AACA,EAAc,cAAc;AAE5B,SAASM,EAAiB,GAA2B;CACpD,OAAO,kBAACD,GAAD,EAAe,GAAIL,EAAQ,CAAA;AACnC;AACA,EAAiB,cAAc;AAE/B,SAASL,EAAmB,GAA8B;CACzD,OAAO,kBAACD,GAAD,EAAiB,GAAIM,EAAQ,CAAA;AACrC;AACA,EAAmB,cAAc;AAEjC,SAASc,EAAgB,EAAE,cAAW,GAAGd,KAAgC;CACxE,OACC,kBAAC,OAAD;EACC,WAAWH,EACV,8HACAc,CACD;EACA,GAAIX;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAASe,EAAiB,EAAE,WAAQ,WAAW,cAAW,GAAGf,KAAgC;CAC5F,OACC,kBAAC,OAAD;EACC,MAAK;EACL,cAAYgB;EACZ,WAAWnB,EAAG,yCAAyCc,CAAS;EAChE,GAAIX;EAJL,UAAA;GAMC,kBAACiB,GAAD;IAAc,UAAU;IAAK,UAAU;GAAM,CAAA;GAC7C,kBAACA,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;GAC3C,kBAACA,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;EACvC;;AAEP;AACA,EAAiB,cAAc;AAE/B,SAASC,EAAe,EAAE,WAAQ,cAAc,cAAW,GAAGlB,KAA8B;CAC3F,OAAO,kBAACmB,GAAD;EAAc;EAAO,WAAWtB,EAAG,iBAAiBc,CAAS;EAAG,GAAIX;CAAQ,CAAA;AACpF;AACA,EAAe,cAAc;AAE7B,IAAME,oBAAmB,IAAI,IAAa;CACzCR;CACAc;CACAH;CACAS;CACAC;CACAG;CACAZ;CACAX;AACD,CAAC,GAEYyB,IAAY,OAAO,OAAOtB,GAAe;CACrD,SAASQ;CACT,WAAWX;CACX,QAAQD;CACR,MAAMc;CACN,MAAMH;CACN,QAAQS;CACR,SAASC;CACT,OAAOG;AACR,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface LoaderProps extends
|
|
3
|
-
/**
|
|
4
|
-
* Width and height of the loader spinner in pixels.
|
|
5
|
-
*
|
|
6
|
-
* Note: Controls both the SVG width and height dimensions.
|
|
7
|
-
*
|
|
8
|
-
* @default 24
|
|
9
|
-
*/
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
3
|
+
/** Width and height of the pixel grid in CSS pixels. @default 16 */
|
|
10
4
|
size?: number;
|
|
5
|
+
/** Visible loading text and default accessible name. @default "Loading" */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Display the text next to the grid. @default true */
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
/** Display elapsed time after the delay. Time starts on mount. @default true */
|
|
10
|
+
showElapsed?: boolean;
|
|
11
|
+
/** Milliseconds before elapsed time is shown. @default 5000 */
|
|
12
|
+
elapsedDelayMs?: number;
|
|
13
|
+
/** Animate the clockwise trail around the eight perimeter cells. @default true */
|
|
14
|
+
animate?: boolean;
|
|
15
|
+
/** Apply a sweeping highlight to the label. @default true */
|
|
16
|
+
shimmer?: boolean;
|
|
11
17
|
}
|
|
12
|
-
export declare function Loader({ className, size, ...props }: LoaderProps): import("react").JSX.Element;
|
|
18
|
+
export declare function Loader({ className, size, label, showLabel, showElapsed, elapsedDelayMs, animate, shimmer, ...props }: LoaderProps): import("react").JSX.Element;
|
|
@@ -1,66 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
|
|
4
|
+
import { useLoaderViewModel as n } from "../viewmodels/use-loader.js";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/loader.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var a = [
|
|
8
|
+
0,
|
|
9
|
+
1,
|
|
10
|
+
2,
|
|
11
|
+
5,
|
|
12
|
+
8,
|
|
13
|
+
7,
|
|
14
|
+
6,
|
|
15
|
+
3
|
|
16
|
+
];
|
|
17
|
+
function o({ className: o, size: s = 16, label: c = "Loading", showLabel: l = !0, showElapsed: u = !0, elapsedDelayMs: d = 5e3, animate: f = !0, shimmer: p = !0, ...m }) {
|
|
18
|
+
let h = n(u, d);
|
|
19
|
+
return /* @__PURE__ */ i("span", {
|
|
10
20
|
role: "status",
|
|
11
|
-
"aria-label":
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
height: a,
|
|
15
|
-
className: e("origin-center animate-basalt-loader text-basalt-primary motion-reduce:animate-none", i),
|
|
21
|
+
"aria-label": c,
|
|
22
|
+
className: e(t, "inline-flex items-center gap-basalt-space-lg text-basalt-base text-basalt-muted-foreground", o),
|
|
23
|
+
...m,
|
|
16
24
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ n("stop", {
|
|
35
|
-
offset: "100%",
|
|
36
|
-
stopColor: "currentColor",
|
|
37
|
-
stopOpacity: "1"
|
|
38
|
-
})
|
|
39
|
-
]
|
|
40
|
-
}) }),
|
|
41
|
-
/* @__PURE__ */ n("circle", {
|
|
42
|
-
cx: "12",
|
|
43
|
-
cy: "12",
|
|
44
|
-
r: "9.5",
|
|
45
|
-
fill: "none",
|
|
46
|
-
opacity: "0.12",
|
|
47
|
-
stroke: "currentColor",
|
|
48
|
-
strokeWidth: "2.25"
|
|
25
|
+
/* @__PURE__ */ r("span", {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
"data-basalt-loader": "",
|
|
28
|
+
"data-animated": f,
|
|
29
|
+
className: "grid shrink-0 grid-cols-3 gap-basalt-space-xs",
|
|
30
|
+
style: {
|
|
31
|
+
width: s,
|
|
32
|
+
height: s
|
|
33
|
+
},
|
|
34
|
+
children: a.map((e, t) => /* @__PURE__ */ r("span", {
|
|
35
|
+
"data-step": t,
|
|
36
|
+
className: "rounded-basalt-sm bg-current",
|
|
37
|
+
style: {
|
|
38
|
+
"--basalt-pixel-delay": `${t * 100 - 800}ms`,
|
|
39
|
+
gridArea: `${Math.floor(e / 3) + 1} / ${e % 3 + 1}`
|
|
40
|
+
}
|
|
41
|
+
}, `pixel-${e}`))
|
|
49
42
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
l && /* @__PURE__ */ r("span", {
|
|
44
|
+
className: e("text-basalt-code font-medium", p && f && "basalt-shimmer-label"),
|
|
45
|
+
children: c
|
|
46
|
+
}),
|
|
47
|
+
h.visible && /* @__PURE__ */ r("span", {
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
"data-basalt-elapsed": "",
|
|
50
|
+
className: "font-mono text-basalt-sm tabular-nums",
|
|
51
|
+
children: h.text
|
|
59
52
|
})
|
|
60
53
|
]
|
|
61
54
|
});
|
|
62
55
|
}
|
|
63
56
|
//#endregion
|
|
64
|
-
export {
|
|
57
|
+
export { o as Loader };
|
|
65
58
|
|
|
66
59
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","names":["Loader","props","
|
|
1
|
+
{"version":3,"file":"loader.js","names":["ORBIT_ORDER","Loader","props","vm","useLoaderViewModel","showElapsed","elapsedDelayMs","label","cn","BASALT_UI_CLASS","className","animate","size","step","cell","showLabel","shimmer"],"sources":["../../src/components/loader.tsx"],"sourcesContent":["import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { useLoaderViewModel } from \"../viewmodels/use-loader\";\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> {\n\t/** Width and height of the pixel grid in CSS pixels. @default 16 */\n\tsize?: number;\n\t/** Visible loading text and default accessible name. @default \"Loading\" */\n\tlabel?: string;\n\t/** Display the text next to the grid. @default true */\n\tshowLabel?: boolean;\n\t/** Display elapsed time after the delay. Time starts on mount. @default true */\n\tshowElapsed?: boolean;\n\t/** Milliseconds before elapsed time is shown. @default 5000 */\n\telapsedDelayMs?: number;\n\t/** Animate the clockwise trail around the eight perimeter cells. @default true */\n\tanimate?: boolean;\n\t/** Apply a sweeping highlight to the label. @default true */\n\tshimmer?: boolean;\n}\n\nconst ORBIT_ORDER = [0, 1, 2, 5, 8, 7, 6, 3];\n\nexport function Loader({\n\tclassName,\n\tsize = 16,\n\tlabel = \"Loading\",\n\tshowLabel = true,\n\tshowElapsed = true,\n\telapsedDelayMs = 5000,\n\tanimate = true,\n\tshimmer = true,\n\t...props\n}: LoaderProps) {\n\tconst vm = useLoaderViewModel(showElapsed, elapsedDelayMs);\n\treturn (\n\t\t<span\n\t\t\trole=\"status\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"inline-flex items-center gap-basalt-space-lg text-basalt-base text-basalt-muted-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata-basalt-loader=\"\"\n\t\t\t\tdata-animated={animate}\n\t\t\t\tclassName=\"grid shrink-0 grid-cols-3 gap-basalt-space-xs\"\n\t\t\t\tstyle={{ width: size, height: size }}\n\t\t\t>\n\t\t\t\t{ORBIT_ORDER.map((cell, step) => (\n\t\t\t\t\t<span\n\t\t\t\t\t\tkey={`pixel-${cell}`}\n\t\t\t\t\t\tdata-step={step}\n\t\t\t\t\t\tclassName=\"rounded-basalt-sm bg-current\"\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"--basalt-pixel-delay\": `${step * 100 - 800}ms`,\n\t\t\t\t\t\t\t\tgridArea: `${Math.floor(cell / 3) + 1} / ${(cell % 3) + 1}`,\n\t\t\t\t\t\t\t} as CSSProperties\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</span>\n\t\t\t{showLabel && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"text-basalt-code font-medium\",\n\t\t\t\t\t\tshimmer && animate && \"basalt-shimmer-label\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\t{vm.visible && (\n\t\t\t\t<span\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-basalt-elapsed=\"\"\n\t\t\t\t\tclassName=\"font-mono text-basalt-sm tabular-nums\"\n\t\t\t\t>\n\t\t\t\t\t{vm.text}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n"],"mappings":";;;;;;AAsBA,IAAMA,IAAc;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;AAAC;AAE3C,SAAgBC,EAAO,EACtB,cACA,UAAO,IACP,WAAQ,WACR,eAAY,IACZ,iBAAc,IACd,oBAAiB,KACjB,aAAU,IACV,aAAU,IACV,GAAGC,KACY;CACf,IAAMC,IAAKC,EAAmBC,GAAaC,CAAc;CACzD,OACC,kBAAC,QAAD;EACC,MAAK;EACL,cAAYC;EACZ,WAAWC,EACVC,GACA,8FACAC,CACD;EACA,GAAIR;EARL,UAAA;GAUC,kBAAC,QAAD;IACC,eAAY;IACZ,sBAAmB;IACnB,iBAAeS;IACf,WAAU;IACV,OAAO;KAAE,OAAOC;KAAM,QAAQA;IAAK;IAElC,UAAAZ,EAAY,KAAK,GAAM,MACvB,kBAAC,QAAD;KAEC,aAAWa;KACX,WAAU;KACV,OACC;MACC,wBAAwB,GAAGA,IAAO,MAAM,IAAI;MAC5C,UAAU,GAAG,KAAK,MAAMC,IAAO,CAAC,IAAI,EAAE,KAAMA,IAAO,IAAK;KACzD;IAED,GATK,SAASA,GASd,CACD;GACI,CAAA;GACLC,KACA,kBAAC,QAAD;IACC,WAAWP,EACV,gCACAQ,KAAWL,KAAW,sBACvB;IAEC,UAAAJ;GACI,CAAA;GAENJ,EAAG,WACH,kBAAC,QAAD;IACC,eAAY;IACZ,uBAAoB;IACpB,WAAU;IAET,UAAAA,EAAG;GACC,CAAA;EAEF;;AAER"}
|
|
@@ -10,9 +10,9 @@ function i({ label: i = "Loading", mark: a, className: o, ...s }) {
|
|
|
10
10
|
className: e("fixed inset-0 z-50 flex items-center justify-center bg-basalt-background", o),
|
|
11
11
|
...s,
|
|
12
12
|
children: /* @__PURE__ */ r("div", {
|
|
13
|
-
className: "flex flex-col items-center gap-
|
|
14
|
-
children: [a ?? /* @__PURE__ */ n(t, { className: "h-8 w-8 text-basalt-foreground" }), /* @__PURE__ */ n("div", {
|
|
15
|
-
className: "relative h-px overflow-hidden rounded-full bg-basalt-border",
|
|
13
|
+
className: "flex flex-col items-center gap-basalt-space-lg",
|
|
14
|
+
children: [a ?? /* @__PURE__ */ n(t, { className: "h-basalt-8 w-basalt-8 text-basalt-foreground" }), /* @__PURE__ */ n("div", {
|
|
15
|
+
className: "relative h-px overflow-hidden rounded-basalt-full bg-basalt-border",
|
|
16
16
|
style: { width: "6rem" },
|
|
17
17
|
children: /* @__PURE__ */ n("span", {
|
|
18
18
|
className: "absolute inset-0 animate-basalt-shimmer motion-reduce:animate-none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-screen.js","names":["LoadingScreen","props","label","cn","className","mark","BasaltMark"],"sources":["../../src/components/loading-screen.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BasaltMark } from \"./basalt-mark\";\n\nexport function LoadingScreen({\n\tlabel = \"Loading\",\n\tmark,\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement> & {\n\tlabel?: string;\n\tmark?: ReactNode;\n}) {\n\treturn (\n\t\t<div\n\t\t\trole=\"status\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 flex items-center justify-center bg-basalt-background\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className=\"flex flex-col items-center gap-
|
|
1
|
+
{"version":3,"file":"loading-screen.js","names":["LoadingScreen","props","label","cn","className","mark","BasaltMark"],"sources":["../../src/components/loading-screen.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BasaltMark } from \"./basalt-mark\";\n\nexport function LoadingScreen({\n\tlabel = \"Loading\",\n\tmark,\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement> & {\n\tlabel?: string;\n\tmark?: ReactNode;\n}) {\n\treturn (\n\t\t<div\n\t\t\trole=\"status\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 flex items-center justify-center bg-basalt-background\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className=\"flex flex-col items-center gap-basalt-space-lg\">\n\t\t\t\t{mark ?? <BasaltMark className=\"h-basalt-8 w-basalt-8 text-basalt-foreground\" />}\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"relative h-px overflow-hidden rounded-basalt-full bg-basalt-border\"\n\t\t\t\t\tstyle={{ width: \"6rem\" }}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"absolute inset-0 animate-basalt-shimmer motion-reduce:animate-none\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\"linear-gradient(to right, transparent, hsl(var(--basalt-foreground) / 0.5), transparent)\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAIA,SAAgBA,EAAc,EAC7B,WAAQ,WACR,SACA,cACA,GAAGC,KAID;CACF,OACC,kBAAC,OAAD;EACC,MAAK;EACL,cAAYC;EACZ,WAAWC,EACV,4EACAC,CACD;EACA,GAAIH;EAEJ,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACEI,KAAQ,kBAACC,GAAD,EAAY,WAAU,+CAAgD,CAAA,GAC/E,kBAAC,OAAD;IACC,WAAU;IACV,OAAO,EAAE,OAAO,OAAO;IAEvB,UAAA,kBAAC,QAAD;KACC,WAAU;KACV,OAAO,EACN,YACC,2FACF;IACA,CAAA;GACG,CAAA,CACD;;CACD,CAAA;AAEP"}
|
|
@@ -2,45 +2,50 @@
|
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
3
|
import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
|
|
4
4
|
import { overlayItemClass as n, overlayPanelClass as r } from "./overlay.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { useHoverHighlight as i } from "../utils/use-hover-highlight.js";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
import * as s from "@radix-ui/react-menubar";
|
|
8
9
|
//#region src/components/menu-bar.tsx
|
|
9
|
-
function s(e) {
|
|
10
|
-
return /* @__PURE__ */ a(f, { ...e });
|
|
11
|
-
}
|
|
12
10
|
function c(e) {
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ o(p, { ...e });
|
|
12
|
+
}
|
|
13
|
+
function l(e) {
|
|
14
|
+
return /* @__PURE__ */ o(s.Menu, { ...e });
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
+
var u = a.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ o(s.Trigger, {
|
|
16
17
|
ref: i,
|
|
17
|
-
className: e(t, "inline-flex h-
|
|
18
|
+
className: e(t, "inline-flex min-h-basalt-control items-center rounded-basalt-sm px-basalt-space-lg text-basalt-base font-medium outline-hidden hover:bg-basalt-hover data-[state=open]:bg-basalt-selected", n),
|
|
18
19
|
...r
|
|
19
20
|
}));
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
u.displayName = s.Trigger.displayName;
|
|
22
|
+
var d = a.forwardRef(({ className: t, sideOffset: n = 8, ...a }, c) => {
|
|
23
|
+
let l = i(c);
|
|
24
|
+
return /* @__PURE__ */ o(s.Portal, {
|
|
25
|
+
forceMount: a.forceMount,
|
|
26
|
+
children: /* @__PURE__ */ o(s.Content, {
|
|
27
|
+
ref: l,
|
|
28
|
+
sideOffset: n,
|
|
29
|
+
className: r(e("basalt-hover-list min-w-basalt-40", t)),
|
|
30
|
+
...a
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
d.displayName = s.Content.displayName;
|
|
35
|
+
var f = a.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ o(s.Item, {
|
|
36
|
+
"data-basalt-hover-item": "",
|
|
32
37
|
ref: i,
|
|
33
|
-
className: n(e("relative outline-hidden
|
|
38
|
+
className: n(e("relative outline-hidden", t)),
|
|
34
39
|
...r
|
|
35
40
|
}));
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
className: e(t, "flex h-
|
|
41
|
+
f.displayName = s.Item.displayName;
|
|
42
|
+
function p({ className: n, ...r }) {
|
|
43
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
44
|
+
className: e(t, "flex min-h-basalt-control items-center gap-basalt-space-xs rounded-basalt-md border border-basalt-border bg-basalt-popover px-basalt-space-sm py-basalt-space-xs", n),
|
|
40
45
|
...r
|
|
41
46
|
});
|
|
42
47
|
}
|
|
43
48
|
//#endregion
|
|
44
|
-
export {
|
|
49
|
+
export { c as MenuBar, d as MenuBarContent, f as MenuBarItem, l as MenuBarMenu, p as MenuBarRoot, u as MenuBarTrigger };
|
|
45
50
|
|
|
46
51
|
//# sourceMappingURL=menu-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-bar.js","names":["React","MenubarPrimitive","MenuBar","MenuBarRoot","props","MenuBarMenu","MenuBarTrigger","cn","BASALT_UI_CLASS","className","MenuBarContent","overlayPanelClass","MenuBarItem","overlayItemClass"],"sources":["../../src/components/menu-bar.tsx"],"sourcesContent":["import * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { MENU_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixMenubarProps = React.ComponentProps<typeof MenubarPrimitive.Root>;\ntype RadixMenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;\ntype RadixMenubarTriggerProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>;\ntype RadixMenubarContentProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>;\ntype RadixMenubarItemProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item>;\n\nexport interface MenuBarProps\n\textends Omit<\n\t\tRadixMenubarProps,\n\t\t\"value\" | \"defaultValue\" | \"onValueChange\" | \"loop\" | \"dir\" | \"asChild\"\n\t> {\n\t/**\n\t * Controlled value of the currently open menu.\n\t */\n\tvalue?: RadixMenubarProps[\"value\"];\n\t/**\n\t * Uncontrolled initial value of the open menu.\n\t * @default \"\"\n\t */\n\tdefaultValue?: RadixMenubarProps[\"defaultValue\"];\n\t/**\n\t * Callback invoked when the open menu value changes.\n\t */\n\tonValueChange?: RadixMenubarProps[\"onValueChange\"];\n\t/**\n\t * Whether keyboard navigation loops around when reaching ends.\n\t * @default true\n\t */\n\tloop?: RadixMenubarProps[\"loop\"];\n\t/**\n\t * Reading direction of the menubar.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixMenubarProps[\"dir\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * MenuBar forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarProps[\"asChild\"];\n}\n\nexport function MenuBar(props: MenuBarProps) {\n\treturn <MenuBarRoot {...props} />;\n}\n\nexport interface MenuBarMenuProps extends Omit<RadixMenubarMenuProps, \"value\"> {\n\t/**\n\t * Unique identifier value for this menu within the menubar.\n\t */\n\tvalue?: RadixMenubarMenuProps[\"value\"];\n}\n\nexport function MenuBarMenu(props: MenuBarMenuProps) {\n\treturn <MenubarPrimitive.Menu {...props} />;\n}\n\nexport interface MenuBarTriggerProps\n\textends Omit<RadixMenubarTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the menubar trigger button.\n\t * @default false\n\t */\n\tdisabled?: RadixMenubarTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarTriggerProps[\"asChild\"];\n}\n\nexport const MenuBarTrigger = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Trigger>,\n\tMenuBarTriggerProps\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\tBASALT_UI_CLASS,\n\t\t\t\"inline-flex h-8 items-center rounded-basalt-sm px-3 text-sm font-medium outline-hidden hover:bg-basalt-accent data-[state=open]:bg-basalt-accent\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nMenuBarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nexport interface MenuBarContentProps\n\textends Omit<\n\t\tRadixMenubarContentProps,\n\t\t| \"loop\"\n\t\t| \"side\"\n\t\t| \"sideOffset\"\n\t\t| \"align\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation loops around when reaching the start or end item.\n\t * @default false\n\t */\n\tloop?: RadixMenubarContentProps[\"loop\"];\n\t/**\n\t * Preferred placement side relative to the menu trigger.\n\t * @default \"bottom\"\n\t */\n\tside?: RadixMenubarContentProps[\"side\"];\n\t/**\n\t * Distance in pixels between trigger and floating content panel.\n\t * @default 4\n\t */\n\tsideOffset?: RadixMenubarContentProps[\"sideOffset\"];\n\t/**\n\t * Preferred alignment along the side axis.\n\t * @default \"start\"\n\t */\n\talign?: RadixMenubarContentProps[\"align\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixMenubarContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixMenubarContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixMenubarContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixMenubarContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixMenubarContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixMenubarContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixMenubarContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixMenubarContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixMenubarContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixMenubarContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixMenubarContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixMenubarContentProps[\"onInteractOutside\"];\n}\n\nexport const MenuBarContent = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Content>,\n\tMenuBarContentProps\n>(({ className, sideOffset = MENU_GAP, ...props }, ref) => (\n\t<MenubarPrimitive.Portal forceMount={props.forceMount}>\n\t\t<MenubarPrimitive.Content\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={overlayPanelClass(cn(\"min-w-40\", className))}\n\t\t\t{...props}\n\t\t/>\n\t</MenubarPrimitive.Portal>\n));\nMenuBarContent.displayName = MenubarPrimitive.Content.displayName;\n\nexport interface MenuBarItemProps\n\textends Omit<RadixMenubarItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the menubar item.\n\t * @default false\n\t */\n\tdisabled?: RadixMenubarItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the menubar item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixMenubarItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixMenubarItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarItemProps[\"asChild\"];\n}\n\nexport const MenuBarItem = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Item>,\n\tMenuBarItemProps\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(cn(\"relative outline-hidden focus:bg-basalt-accent\", className))}\n\t\t{...props}\n\t/>\n));\nMenuBarItem.displayName = MenubarPrimitive.Item.displayName;\n\nexport interface MenuBarRootProps extends MenuBarProps {}\n\nexport function MenuBarRoot({ className, ...props }: MenuBarRootProps) {\n\treturn (\n\t\t<MenubarPrimitive.Root\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"flex h-9 items-center gap-0.5 rounded-basalt-md border border-basalt-border bg-basalt-popover px-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAgDA,SAAgBE,EAAQ,GAAqB;CAC5C,OAAO,kBAACC,GAAD,EAAa,GAAIC,EAAQ,CAAA;AACjC;AASA,SAAgBC,EAAY,GAAyB;CACpD,OAAO,kBAACJ,EAAiB,MAAlB,EAAuB,GAAIG,EAAQ,CAAA;AAC3C;AAiBA,IAAaE,IAAiBN,EAAM,YAGjC,EAAE,cAAW,GAAGI,KAAS,MAC3B,kBAACH,EAAiB,SAAlB;CACM;CACL,WAAWM,EACVC,GACA,oJACAC,CACD;CACA,GAAIL;AACJ,CAAA,CACD;AACD,EAAe,cAAcH,EAAiB,QAAQ;AAiHtD,IAAaS,IAAiBV,EAAM,YAGjC,EAAE,cAAW,gBAAA,GAAuB,GAAGI,KAAS,MAClD,kBAACH,EAAiB,QAAlB;CAAyB,YAAYG,EAAM;CAC1C,UAAA,kBAACH,EAAiB,SAAlB;EACM;EACO;EACZ,WAAWU,EAAkBJ,EAAG,YAAYE,CAAS,CAAC;EACtD,GAAIL;CACJ,CAAA;AACuB,CAAA,CACzB;AACD,EAAe,cAAcH,EAAiB,QAAQ;AAyBtD,IAAaW,IAAcZ,EAAM,YAG9B,EAAE,cAAW,GAAGI,KAAS,MAC3B,kBAACH,EAAiB,MAAlB;CACM;CACL,WAAWY,EAAiBN,EAAG,kDAAkDE,CAAS,CAAC;CAC3F,GAAIL;AACJ,CAAA,CACD;AACD,EAAY,cAAcH,EAAiB,KAAK;AAIhD,SAAgBE,EAAY,EAAE,cAAW,GAAGC,KAA2B;CACtE,OACC,kBAACH,EAAiB,MAAlB;EACC,WAAWM,EACVC,GACA,sGACAC,CACD;EACA,GAAIL;CACJ,CAAA;AAEH"}
|
|
1
|
+
{"version":3,"file":"menu-bar.js","names":["React","MenubarPrimitive","MenuBar","MenuBarRoot","props","MenuBarMenu","MenuBarTrigger","cn","BASALT_UI_CLASS","className","MenuBarContent","highlightRef","useHoverHighlight","ref","overlayPanelClass","MenuBarItem","overlayItemClass"],"sources":["../../src/components/menu-bar.tsx"],"sourcesContent":["import * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { useHoverHighlight } from \"../utils/use-hover-highlight\";\nimport { MENU_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixMenubarProps = React.ComponentProps<typeof MenubarPrimitive.Root>;\ntype RadixMenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;\ntype RadixMenubarTriggerProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>;\ntype RadixMenubarContentProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>;\ntype RadixMenubarItemProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item>;\n\nexport interface MenuBarProps\n\textends Omit<\n\t\tRadixMenubarProps,\n\t\t\"value\" | \"defaultValue\" | \"onValueChange\" | \"loop\" | \"dir\" | \"asChild\"\n\t> {\n\t/**\n\t * Controlled value of the currently open menu.\n\t */\n\tvalue?: RadixMenubarProps[\"value\"];\n\t/**\n\t * Uncontrolled initial value of the open menu.\n\t * @default \"\"\n\t */\n\tdefaultValue?: RadixMenubarProps[\"defaultValue\"];\n\t/**\n\t * Callback invoked when the open menu value changes.\n\t */\n\tonValueChange?: RadixMenubarProps[\"onValueChange\"];\n\t/**\n\t * Whether keyboard navigation loops around when reaching ends.\n\t * @default true\n\t */\n\tloop?: RadixMenubarProps[\"loop\"];\n\t/**\n\t * Reading direction of the menubar.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixMenubarProps[\"dir\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * MenuBar forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarProps[\"asChild\"];\n}\n\nexport function MenuBar(props: MenuBarProps) {\n\treturn <MenuBarRoot {...props} />;\n}\n\nexport interface MenuBarMenuProps extends Omit<RadixMenubarMenuProps, \"value\"> {\n\t/**\n\t * Unique identifier value for this menu within the menubar.\n\t */\n\tvalue?: RadixMenubarMenuProps[\"value\"];\n}\n\nexport function MenuBarMenu(props: MenuBarMenuProps) {\n\treturn <MenubarPrimitive.Menu {...props} />;\n}\n\nexport interface MenuBarTriggerProps\n\textends Omit<RadixMenubarTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the menubar trigger button.\n\t * @default false\n\t */\n\tdisabled?: RadixMenubarTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarTriggerProps[\"asChild\"];\n}\n\nexport const MenuBarTrigger = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Trigger>,\n\tMenuBarTriggerProps\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\tBASALT_UI_CLASS,\n\t\t\t\"inline-flex min-h-basalt-control items-center rounded-basalt-sm px-basalt-space-lg text-basalt-base font-medium outline-hidden hover:bg-basalt-hover data-[state=open]:bg-basalt-selected\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nMenuBarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nexport interface MenuBarContentProps\n\textends Omit<\n\t\tRadixMenubarContentProps,\n\t\t| \"loop\"\n\t\t| \"side\"\n\t\t| \"sideOffset\"\n\t\t| \"align\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation loops around when reaching the start or end item.\n\t * @default false\n\t */\n\tloop?: RadixMenubarContentProps[\"loop\"];\n\t/**\n\t * Preferred placement side relative to the menu trigger.\n\t * @default \"bottom\"\n\t */\n\tside?: RadixMenubarContentProps[\"side\"];\n\t/**\n\t * Distance in pixels between trigger and floating content panel.\n\t * @default 4\n\t */\n\tsideOffset?: RadixMenubarContentProps[\"sideOffset\"];\n\t/**\n\t * Preferred alignment along the side axis.\n\t * @default \"start\"\n\t */\n\talign?: RadixMenubarContentProps[\"align\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixMenubarContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixMenubarContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixMenubarContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixMenubarContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixMenubarContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixMenubarContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixMenubarContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixMenubarContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixMenubarContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixMenubarContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixMenubarContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixMenubarContentProps[\"onInteractOutside\"];\n}\n\nexport const MenuBarContent = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Content>,\n\tMenuBarContentProps\n>(({ className, sideOffset = MENU_GAP, ...props }, ref) => {\n\tconst highlightRef = useHoverHighlight(ref);\n\treturn (\n\t\t<MenubarPrimitive.Portal forceMount={props.forceMount}>\n\t\t\t<MenubarPrimitive.Content\n\t\t\t\tref={highlightRef}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={overlayPanelClass(cn(\"basalt-hover-list min-w-basalt-40\", className))}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</MenubarPrimitive.Portal>\n\t);\n});\nMenuBarContent.displayName = MenubarPrimitive.Content.displayName;\n\nexport interface MenuBarItemProps\n\textends Omit<RadixMenubarItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the menubar item.\n\t * @default false\n\t */\n\tdisabled?: RadixMenubarItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the menubar item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixMenubarItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixMenubarItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixMenubarItemProps[\"asChild\"];\n}\n\nexport const MenuBarItem = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Item>,\n\tMenuBarItemProps\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Item\n\t\tdata-basalt-hover-item=\"\"\n\t\tref={ref}\n\t\tclassName={overlayItemClass(cn(\"relative outline-hidden\", className))}\n\t\t{...props}\n\t/>\n));\nMenuBarItem.displayName = MenubarPrimitive.Item.displayName;\n\nexport interface MenuBarRootProps extends MenuBarProps {}\n\nexport function MenuBarRoot({ className, ...props }: MenuBarRootProps) {\n\treturn (\n\t\t<MenubarPrimitive.Root\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"flex min-h-basalt-control items-center gap-basalt-space-xs rounded-basalt-md border border-basalt-border bg-basalt-popover px-basalt-space-sm py-basalt-space-xs\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;AAiDA,SAAgBE,EAAQ,GAAqB;CAC5C,OAAO,kBAACC,GAAD,EAAa,GAAIC,EAAQ,CAAA;AACjC;AASA,SAAgBC,EAAY,GAAyB;CACpD,OAAO,kBAACJ,EAAiB,MAAlB,EAAuB,GAAIG,EAAQ,CAAA;AAC3C;AAiBA,IAAaE,IAAiBN,EAAM,YAGjC,EAAE,cAAW,GAAGI,KAAS,MAC3B,kBAACH,EAAiB,SAAlB;CACM;CACL,WAAWM,EACVC,GACA,6LACAC,CACD;CACA,GAAIL;AACJ,CAAA,CACD;AACD,EAAe,cAAcH,EAAiB,QAAQ;AAiHtD,IAAaS,IAAiBV,EAAM,YAGjC,EAAE,cAAW,gBAAA,GAAuB,GAAGI,KAAS,MAAQ;CAC1D,IAAMO,IAAeC,EAAkBC,CAAG;CAC1C,OACC,kBAACZ,EAAiB,QAAlB;EAAyB,YAAYG,EAAM;EAC1C,UAAA,kBAACH,EAAiB,SAAlB;GACC,KAAKU;GACO;GACZ,WAAWG,EAAkBP,EAAG,qCAAqCE,CAAS,CAAC;GAC/E,GAAIL;EACJ,CAAA;CACuB,CAAA;AAE3B,CAAC;AACD,EAAe,cAAcH,EAAiB,QAAQ;AAyBtD,IAAac,IAAcf,EAAM,YAG9B,EAAE,cAAW,GAAGI,KAAS,MAC3B,kBAACH,EAAiB,MAAlB;CACC,0BAAuB;CAClB;CACL,WAAWe,EAAiBT,EAAG,2BAA2BE,CAAS,CAAC;CACpE,GAAIL;AACJ,CAAA,CACD;AACD,EAAY,cAAcH,EAAiB,KAAK;AAIhD,SAAgBE,EAAY,EAAE,cAAW,GAAGC,KAA2B;CACtE,OACC,kBAACH,EAAiB,MAAlB;EACC,WAAWM,EACVC,GACA,oKACAC,CACD;EACA,GAAIL;CACJ,CAAA;AAEH"}
|
|
@@ -2,22 +2,22 @@ export interface MeterProps {
|
|
|
2
2
|
/**
|
|
3
3
|
* Percentage value representing current meter progress (0..100).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Values are clamped to [0, 100] for both segments and accessibility.
|
|
6
|
+
* Non-finite readings are displayed as unavailable.
|
|
7
7
|
* Does not support arbitrary native HTML props, ref forwarding, min/max, or change callbacks.
|
|
8
8
|
* @default 0
|
|
9
9
|
*/
|
|
10
10
|
value?: number;
|
|
11
11
|
/**
|
|
12
|
-
* Text label displayed above the meter
|
|
12
|
+
* Text label displayed above the segmented meter and used as accessible name fallback.
|
|
13
13
|
*/
|
|
14
14
|
label?: string;
|
|
15
15
|
/**
|
|
16
|
-
* Custom text overriding the
|
|
16
|
+
* Custom text overriding the value displayed beside the segments.
|
|
17
17
|
*/
|
|
18
18
|
customValue?: string;
|
|
19
19
|
/**
|
|
20
|
-
* Whether to hide the
|
|
20
|
+
* Whether to hide the value displayed beside the segments.
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
hideValue?: boolean;
|