@agent-factory-platform/ui-kit 0.7.1 → 0.9.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 +22 -0
- package/dist/charts/adapter.js +111 -0
- package/dist/charts/basic.d.ts +2 -0
- package/dist/charts/basic.js +115 -0
- package/dist/charts/chart-tooltip.js +21 -0
- package/dist/charts/event-markers-primitive.d.ts +10 -1
- package/dist/charts/event-markers-primitive.js +116 -0
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/ohlc-annotations.d.ts +56 -0
- package/dist/charts/ohlc-annotations.js +84 -0
- package/dist/charts/ohlc.d.ts +5 -1
- package/dist/charts/ohlc.js +240 -0
- package/dist/charts/series.js +584 -0
- package/dist/charts/theme.js +35 -0
- package/dist/charts/time-combo.js +17 -0
- package/dist/component-api.js +3 -5
- package/dist/component-api.json.js +9 -0
- package/dist/component-manifest.json.js +9 -0
- package/dist/components/alert.js +35 -0
- package/dist/components/avatar.js +101 -0
- package/dist/components/badge.js +111 -0
- package/dist/components/button-group.js +22 -0
- package/dist/components/button.js +64 -0
- package/dist/components/calendar-period-navigator.js +34 -0
- package/dist/components/card.js +35 -0
- package/dist/components/chart-frame.js +53 -0
- package/dist/components/color-picker.js +155 -0
- package/dist/components/combobox.js +129 -0
- package/dist/components/command-dialog.js +89 -0
- package/dist/components/confirm-dialog.js +57 -0
- package/dist/components/data-table.js +135 -0
- package/dist/components/date-time.js +203 -0
- package/dist/components/disclosure.js +29 -0
- package/dist/components/drawer.js +150 -0
- package/dist/components/dropdown-select.js +191 -0
- package/dist/components/field.js +21 -0
- package/dist/components/floating-window.js +159 -0
- package/dist/components/heading.js +21 -0
- package/dist/components/hover-tip.js +90 -0
- package/dist/components/icon-tip.js +12 -0
- package/dist/components/input-group.js +16 -0
- package/dist/components/input-otp.js +56 -0
- package/dist/components/input.js +44 -0
- package/dist/components/item.js +47 -0
- package/dist/components/kbd.js +18 -0
- package/dist/components/line-chart.js +79 -0
- package/dist/components/listbox.js +33 -0
- package/dist/components/live-value.js +26 -0
- package/dist/components/modal.js +140 -0
- package/dist/components/multi-select.js +54 -0
- package/dist/components/native-select.js +17 -0
- package/dist/components/navigation.js +42 -0
- package/dist/components/page.js +24 -0
- package/dist/components/popover-menu.js +164 -0
- package/dist/components/progress.js +23 -0
- package/dist/components/resizable-pane.js +73 -0
- package/dist/components/scroll-load-more.js +61 -0
- package/dist/components/seg-slider.js +42 -0
- package/dist/components/segmented-control.js +46 -0
- package/dist/components/selection-controls.js +119 -0
- package/dist/components/sidebar.js +23 -0
- package/dist/components/skeleton.js +9 -0
- package/dist/components/slider.js +162 -0
- package/dist/components/sliding-tabs.js +118 -0
- package/dist/components/spinner.js +9 -0
- package/dist/components/spotlight-tour.js +122 -0
- package/dist/components/stat-card.js +23 -0
- package/dist/components/state-view.js +75 -0
- package/dist/components/stats-table.js +17 -0
- package/dist/components/table.js +24 -0
- package/dist/components/tag-pill.d.ts +4 -1
- package/dist/components/tag-pill.js +69 -0
- package/dist/components/theme-editor.js +159 -0
- package/dist/components/toast.js +66 -0
- package/dist/components/toolbar.js +46 -0
- package/dist/components/utility.js +19 -0
- package/dist/components/widget-frame.js +41 -0
- package/dist/components/widget-picker.js +87 -0
- package/dist/components/workspace-grid.js +468 -0
- package/dist/focus-modality.js +3 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +228 -5564
- package/dist/lib/cn.js +6 -0
- package/dist/lib/focus-modality.js +16 -0
- package/dist/lib/motion.js +27 -0
- package/dist/lib/viewport.js +13 -0
- package/dist/manifest.js +5 -7
- package/dist/styles.js +1 -1
- package/dist/theme.js +158 -0
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Sun as w, Moon as b, Monitor as k, Check as C } from "lucide-react";
|
|
3
|
+
import { UI_THEME_BRANDS as S, UI_THEME_ACCENTS as L, UI_THEME_NEUTRALS as y, UI_THEME_SEMANTICS as f, normalizeUiThemeSettings as z } from "../theme.js";
|
|
4
|
+
import { Button as N } from "./button.js";
|
|
5
|
+
import { ColorPicker as T } from "./color-picker.js";
|
|
6
|
+
import { SegmentedControl as l } from "./segmented-control.js";
|
|
7
|
+
import { Switch as E } from "./selection-controls.js";
|
|
8
|
+
import { Slider as x } from "./slider.js";
|
|
9
|
+
function s({ title: i, children: e }) {
|
|
10
|
+
return /* @__PURE__ */ o("section", { className: "min-w-0 overflow-hidden rounded-panel border border-border bg-surface-raised", children: [
|
|
11
|
+
/* @__PURE__ */ r("h3", { className: "border-b border-divider px-3 py-2.5 font-product text-body-sm font-[600] text-ink", children: i }),
|
|
12
|
+
/* @__PURE__ */ r("div", { className: "grid min-w-0 divide-y divide-divider", children: e })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
function t({ label: i, children: e }) {
|
|
16
|
+
return /* @__PURE__ */ o("div", { className: "af-theme-field grid min-w-0 gap-2.5 px-3 py-3", children: [
|
|
17
|
+
/* @__PURE__ */ r("span", { className: "af-theme-field-label min-w-0 font-product text-caption font-[500] text-ink", children: i }),
|
|
18
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: e })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
function u({ icon: i, children: e }) {
|
|
22
|
+
return /* @__PURE__ */ o("span", { className: "flex min-w-0 items-center justify-center gap-1.5", children: [
|
|
23
|
+
i,
|
|
24
|
+
e
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function m({
|
|
28
|
+
label: i,
|
|
29
|
+
customLabel: e,
|
|
30
|
+
colors: h,
|
|
31
|
+
value: p,
|
|
32
|
+
onChange: v,
|
|
33
|
+
pickerLabels: g
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ r(t, { label: i, children: /* @__PURE__ */ o("div", { className: "grid min-w-0 gap-2.5", children: [
|
|
36
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-2", role: "group", "aria-label": i, children: h.map((n) => /* @__PURE__ */ r(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-label": `${i} ${n}`,
|
|
41
|
+
"aria-pressed": p === n,
|
|
42
|
+
onClick: () => v(n),
|
|
43
|
+
className: "grid size-8 place-items-center rounded-full border-2 border-surface-raised outline-none ring-1 ring-border transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-rust aria-pressed:ring-2 aria-pressed:ring-ink",
|
|
44
|
+
style: { backgroundColor: n },
|
|
45
|
+
children: p === n ? /* @__PURE__ */ r(C, { size: 13, className: "text-pure-white drop-shadow-sm", strokeWidth: 3, "aria-hidden": !0 }) : null
|
|
46
|
+
},
|
|
47
|
+
n
|
|
48
|
+
)) }),
|
|
49
|
+
/* @__PURE__ */ r(T, { value: p, onChange: v, presets: h, labels: { ...g, trigger: e } })
|
|
50
|
+
] }) });
|
|
51
|
+
}
|
|
52
|
+
function B({
|
|
53
|
+
settings: i,
|
|
54
|
+
labels: e,
|
|
55
|
+
onChange: h,
|
|
56
|
+
brands: p = S,
|
|
57
|
+
accents: v = L,
|
|
58
|
+
neutrals: g = y
|
|
59
|
+
}) {
|
|
60
|
+
const n = (a) => h(z({ ...i, ...a })), c = "flex w-full", d = (a) => ({
|
|
61
|
+
trigger: a,
|
|
62
|
+
dialog: e.colorPickerTitle(a),
|
|
63
|
+
hex: e.colorPickerHex,
|
|
64
|
+
hue: e.colorPickerHue,
|
|
65
|
+
saturation: e.colorPickerSaturation,
|
|
66
|
+
presets: e.colorPickerPresets,
|
|
67
|
+
close: e.colorPickerClose
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ o("div", { "data-ui-theme-editor": "true", className: "af-theme-editor grid min-w-0 gap-4 overflow-x-hidden", children: [
|
|
70
|
+
/* @__PURE__ */ r(s, { title: e.preview, children: /* @__PURE__ */ r("div", { "data-theme-preview": !0, className: "min-w-0 p-3", children: /* @__PURE__ */ o("div", { className: "min-w-0 rounded-panel border border-border bg-surface-canvas p-3 shadow-subtle", children: [
|
|
71
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [
|
|
72
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
73
|
+
/* @__PURE__ */ r("p", { className: "font-product text-micro uppercase text-graphite", children: e.previewEyebrow }),
|
|
74
|
+
/* @__PURE__ */ r("p", { className: "mt-0.5 break-words font-product text-body font-[600] text-ink", children: e.previewTitle }),
|
|
75
|
+
/* @__PURE__ */ r("p", { className: "mt-1 break-words font-product text-caption leading-normal text-graphite", children: e.previewDescription })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ r("span", { className: "shrink-0 rounded-control bg-rust/12 px-2 py-1 font-product text-micro font-[600] text-rust", children: e.previewMetric })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex items-center gap-4 border-b border-divider font-product text-caption", children: [
|
|
80
|
+
/* @__PURE__ */ r("span", { className: "border-b-2 border-rust pb-1.5 font-[600] text-ink", children: e.previewPrimaryTab }),
|
|
81
|
+
/* @__PURE__ */ r("span", { className: "pb-1.5 text-graphite", children: e.previewSecondaryTab })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ r("div", { className: "mt-3 h-2 overflow-hidden rounded-full bg-surface-muted", "aria-hidden": !0, children: /* @__PURE__ */ r("div", { className: "h-full w-3/5 rounded-full bg-rust" }) }),
|
|
84
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
85
|
+
/* @__PURE__ */ r(N, { variant: "accent", size: "compact", children: e.previewAction }),
|
|
86
|
+
/* @__PURE__ */ r(N, { variant: "ghost", size: "compact", children: e.previewSecondaryAction }),
|
|
87
|
+
/* @__PURE__ */ r(E, { label: e.previewSwitch, checked: !0, onCheckedChange: () => {
|
|
88
|
+
} })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex items-center gap-2", "aria-hidden": !0, children: [
|
|
91
|
+
/* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-rust" }),
|
|
92
|
+
/* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-up" }),
|
|
93
|
+
/* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-down" })
|
|
94
|
+
] })
|
|
95
|
+
] }) }) }),
|
|
96
|
+
/* @__PURE__ */ o(s, { title: e.page, children: [
|
|
97
|
+
/* @__PURE__ */ r(t, { label: e.mode, children: /* @__PURE__ */ r(
|
|
98
|
+
l,
|
|
99
|
+
{
|
|
100
|
+
className: c,
|
|
101
|
+
value: i.mode,
|
|
102
|
+
onChange: (a) => n({ mode: a }),
|
|
103
|
+
ariaLabel: e.mode,
|
|
104
|
+
options: [
|
|
105
|
+
{ value: "light", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r(w, { size: 14, "aria-hidden": !0 }), children: e.light }) },
|
|
106
|
+
{ value: "dark", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r(b, { size: 14, "aria-hidden": !0 }), children: e.dark }) },
|
|
107
|
+
{ value: "system", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r(k, { size: 14, "aria-hidden": !0 }), children: e.system }) }
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
) }),
|
|
111
|
+
/* @__PURE__ */ r(t, { label: e.shape, children: /* @__PURE__ */ r(
|
|
112
|
+
l,
|
|
113
|
+
{
|
|
114
|
+
className: c,
|
|
115
|
+
value: i.shape,
|
|
116
|
+
onChange: (a) => n({ shape: a, radiusScale: { sharp: 0, compact: 0.65, soft: 1, round: 2 }[a] }),
|
|
117
|
+
ariaLabel: e.shape,
|
|
118
|
+
options: [
|
|
119
|
+
{ value: "sharp", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r("span", { className: "size-3 border border-current", "aria-hidden": !0 }), children: e.sharp }) },
|
|
120
|
+
{ value: "compact", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-[2px] border border-current", "aria-hidden": !0 }), children: e.compact }) },
|
|
121
|
+
{ value: "soft", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-[4px] border border-current", "aria-hidden": !0 }), children: e.soft }) },
|
|
122
|
+
{ value: "round", label: /* @__PURE__ */ r(u, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-full border border-current", "aria-hidden": !0 }), children: e.round }) }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
) })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ o(s, { title: e.colors, children: [
|
|
128
|
+
/* @__PURE__ */ r(m, { label: e.brand, customLabel: e.customBrand, colors: p, value: i.brand, onChange: (a) => n({ brand: a }), pickerLabels: d(e.customBrand) }),
|
|
129
|
+
/* @__PURE__ */ r(m, { label: e.accent, customLabel: e.customAccent, colors: v, value: i.accent, onChange: (a) => n({ accent: a }), pickerLabels: d(e.customAccent) }),
|
|
130
|
+
/* @__PURE__ */ r(m, { label: e.neutral, customLabel: e.customNeutral, colors: g, value: i.neutral, onChange: (a) => n({ neutral: a }), pickerLabels: d(e.customNeutral) })
|
|
131
|
+
] }),
|
|
132
|
+
/* @__PURE__ */ o(s, { title: e.semanticColors, children: [
|
|
133
|
+
/* @__PURE__ */ r(m, { label: e.positive, customLabel: e.customPositive, colors: f, value: i.positive, onChange: (a) => n({ positive: a }), pickerLabels: d(e.customPositive) }),
|
|
134
|
+
/* @__PURE__ */ r(m, { label: e.negative, customLabel: e.customNegative, colors: f, value: i.negative, onChange: (a) => n({ negative: a }), pickerLabels: d(e.customNegative) }),
|
|
135
|
+
/* @__PURE__ */ r(m, { label: e.warning, customLabel: e.customWarning, colors: f, value: i.warning, onChange: (a) => n({ warning: a }), pickerLabels: d(e.customWarning) }),
|
|
136
|
+
/* @__PURE__ */ r(m, { label: e.info, customLabel: e.customInfo, colors: f, value: i.info, onChange: (a) => n({ info: a }), pickerLabels: d(e.customInfo) })
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ o(s, { title: e.controls, children: [
|
|
139
|
+
/* @__PURE__ */ r(t, { label: e.solidStyle, children: /* @__PURE__ */ r(l, { className: c, value: i.solidStyle, onChange: (a) => n({ solidStyle: a }), ariaLabel: e.solidStyle, options: [{ value: "color", label: e.color }, { value: "inverse", label: e.inverse }] }) }),
|
|
140
|
+
/* @__PURE__ */ r(t, { label: e.effect, children: /* @__PURE__ */ r(l, { className: c, value: i.effect, onChange: (a) => n({ effect: a }), ariaLabel: e.effect, options: [{ value: "flat", label: e.flat }, { value: "plastic", label: e.plastic }] }) })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ o(s, { title: e.advanced, children: [
|
|
143
|
+
/* @__PURE__ */ r(t, { label: e.surface, children: /* @__PURE__ */ r(l, { className: c, value: i.surface, onChange: (a) => n({ surface: a }), ariaLabel: e.surface, options: [{ value: "filled", label: e.filled }, { value: "translucent", label: e.translucent }] }) }),
|
|
144
|
+
/* @__PURE__ */ r(t, { label: e.dataStyle, children: /* @__PURE__ */ r(l, { className: c, value: i.dataStyle, onChange: (a) => n({ dataStyle: a }), ariaLabel: e.dataStyle, options: [{ value: "categorical", label: e.categorical }, { value: "divergent", label: e.divergent }, { value: "sequential", label: e.sequential }] }) }),
|
|
145
|
+
/* @__PURE__ */ r(t, { label: e.motion, children: /* @__PURE__ */ r(l, { className: c, value: i.motion, onChange: (a) => n({ motion: a }), ariaLabel: e.motion, options: [{ value: "all", label: e.all }, { value: "micro", label: e.micro }, { value: "macro", label: e.macro }, { value: "none", label: e.none }] }) }),
|
|
146
|
+
/* @__PURE__ */ r(t, { label: e.fontScale, children: /* @__PURE__ */ o("div", { className: "grid grid-cols-[minmax(0,1fr)_4.75rem] items-center gap-3", children: [
|
|
147
|
+
/* @__PURE__ */ r(x, { value: i.fontScale, min: 0.875, max: 1.25, step: 0.125, onChange: (a) => n({ fontScale: a }), ariaLabel: e.fontScale, formatValue: e.value }),
|
|
148
|
+
/* @__PURE__ */ r("output", { className: "rounded-control border border-border bg-surface-raised px-2 py-1.5 text-center font-data text-data tabular-nums text-ink", children: e.value(i.fontScale) })
|
|
149
|
+
] }) }),
|
|
150
|
+
/* @__PURE__ */ r(t, { label: e.radiusScale, children: /* @__PURE__ */ o("div", { className: "grid grid-cols-[minmax(0,1fr)_4.75rem] items-center gap-3", children: [
|
|
151
|
+
/* @__PURE__ */ r(x, { value: i.radiusScale, min: 0, max: 2, step: 0.25, onChange: (a) => n({ radiusScale: a }), ariaLabel: e.radiusScale, formatValue: e.value }),
|
|
152
|
+
/* @__PURE__ */ r("output", { className: "rounded-control border border-border bg-surface-raised px-2 py-1.5 text-center font-data text-data tabular-nums text-ink", children: e.value(i.radiusScale) })
|
|
153
|
+
] }) })
|
|
154
|
+
] })
|
|
155
|
+
] });
|
|
156
|
+
}
|
|
157
|
+
export {
|
|
158
|
+
B as ThemeEditor
|
|
159
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Info as C, CheckCircle2 as k, AlertCircle as N, X as z } from "lucide-react";
|
|
3
|
+
import { useState as E, useRef as x, useCallback as l, useEffect as I, useMemo as O, useContext as P, createContext as j } from "react";
|
|
4
|
+
import { cn as y } from "../lib/cn.js";
|
|
5
|
+
const A = { error: N, success: k, info: C }, M = { error: "bg-danger", success: "bg-success", info: "bg-info" }, g = j(null);
|
|
6
|
+
function R() {
|
|
7
|
+
const o = P(g);
|
|
8
|
+
if (!o) throw new Error("useToast must be used within ToastProvider");
|
|
9
|
+
return o;
|
|
10
|
+
}
|
|
11
|
+
function S({ children: o, closeLabel: b, duration: u = 6e3 }) {
|
|
12
|
+
const [v, d] = E([]), w = x(1), r = x(/* @__PURE__ */ new Map()), c = l((e) => {
|
|
13
|
+
d((n) => n.filter((i) => i.id !== e));
|
|
14
|
+
const t = r.current.get(e);
|
|
15
|
+
t && clearTimeout(t), r.current.delete(e);
|
|
16
|
+
}, []), a = l((e) => {
|
|
17
|
+
const t = r.current.get(e);
|
|
18
|
+
t && clearTimeout(t), r.current.set(e, setTimeout(() => c(e), u));
|
|
19
|
+
}, [c, u]), m = l((e, t = "error") => {
|
|
20
|
+
d((n) => {
|
|
21
|
+
const i = n.find((p) => p.message === e && p.tone === t);
|
|
22
|
+
if (i)
|
|
23
|
+
return a(i.id), n;
|
|
24
|
+
const f = w.current++;
|
|
25
|
+
return a(f), [...n, { id: f, message: e, tone: t }];
|
|
26
|
+
});
|
|
27
|
+
}, [a]);
|
|
28
|
+
I(() => () => {
|
|
29
|
+
for (const e of r.current.values()) clearTimeout(e);
|
|
30
|
+
r.current.clear();
|
|
31
|
+
}, []);
|
|
32
|
+
const T = O(() => ({ show: m }), [m]);
|
|
33
|
+
return /* @__PURE__ */ h(g.Provider, { value: T, children: [
|
|
34
|
+
o,
|
|
35
|
+
/* @__PURE__ */ s("div", { className: "pointer-events-none fixed right-4 top-[calc(60px+1rem)] z-[9999] flex w-[calc(100vw-2rem)] flex-col items-end gap-2.5 sm:right-6 sm:w-auto sm:max-w-sm", "data-slot": "toast-viewport", children: v.map((e) => {
|
|
36
|
+
const t = A[e.tone];
|
|
37
|
+
return /* @__PURE__ */ h(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
role: e.tone === "error" ? "alert" : "status",
|
|
41
|
+
"data-tone": e.tone,
|
|
42
|
+
className: "t-item pointer-events-auto flex w-full items-center gap-3 rounded-panel border border-border bg-surface-raised py-3 pl-3.5 pr-3 shadow-pop",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ s("span", { className: y("grid size-8 shrink-0 place-items-center rounded-full text-on-status", M[e.tone]), children: /* @__PURE__ */ s(t, { size: 17, "aria-hidden": !0 }) }),
|
|
45
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 break-words font-product text-caption font-[480] text-ink", children: e.message }),
|
|
46
|
+
/* @__PURE__ */ s(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: () => c(e.id),
|
|
51
|
+
"aria-label": b,
|
|
52
|
+
className: "grid size-7 shrink-0 place-items-center rounded-control text-graphite outline-none transition hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust/35",
|
|
53
|
+
children: /* @__PURE__ */ s(z, { size: 14, "aria-hidden": !0 })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
e.id
|
|
59
|
+
);
|
|
60
|
+
}) })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
S as ToastProvider,
|
|
65
|
+
R as useToast
|
|
66
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Toolbar as t } from "radix-ui";
|
|
3
|
+
function c({ label: e, children: n, className: i = "", variant: r = "framed", density: a = "default" }) {
|
|
4
|
+
return /* @__PURE__ */ o(
|
|
5
|
+
t.Root,
|
|
6
|
+
{
|
|
7
|
+
"aria-label": e,
|
|
8
|
+
"data-variant": r,
|
|
9
|
+
"data-density": a,
|
|
10
|
+
className: `inline-flex items-center gap-1 ${a === "compact" ? "h-control-compact" : "h-control-default"} ${r === "framed" ? "rounded-panel border border-border bg-surface-fog p-1" : "bg-transparent"} ${i}`,
|
|
11
|
+
loop: !0,
|
|
12
|
+
children: n
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function u(e) {
|
|
17
|
+
return /* @__PURE__ */ o(
|
|
18
|
+
t.Button,
|
|
19
|
+
{
|
|
20
|
+
...e,
|
|
21
|
+
className: `inline-flex size-control-compact items-center justify-center rounded-control text-graphite outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust disabled:opacity-50 ${e.className ?? ""}`
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function f({ children: e }) {
|
|
26
|
+
return /* @__PURE__ */ o(t.ToggleGroup, { type: "multiple", children: e });
|
|
27
|
+
}
|
|
28
|
+
function m(e) {
|
|
29
|
+
return /* @__PURE__ */ o(
|
|
30
|
+
t.ToggleItem,
|
|
31
|
+
{
|
|
32
|
+
...e,
|
|
33
|
+
className: `inline-flex size-control-compact items-center justify-center rounded-control text-graphite outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust data-[state=on]:bg-surface-raised data-[state=on]:text-ink ${e.className ?? ""}`
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function b(e) {
|
|
38
|
+
return /* @__PURE__ */ o(t.Separator, { ...e, className: `mx-1 h-4 w-px bg-divider ${e.className ?? ""}` });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
c as Toolbar,
|
|
42
|
+
u as ToolbarButton,
|
|
43
|
+
b as ToolbarSeparator,
|
|
44
|
+
f as ToolbarToggleGroup,
|
|
45
|
+
m as ToolbarToggleItem
|
|
46
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { AspectRatio as n, ScrollArea as o, Separator as s } from "radix-ui";
|
|
3
|
+
function m(e) {
|
|
4
|
+
return /* @__PURE__ */ a(s.Root, { ...e, className: `shrink-0 bg-divider data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px ${e.className ?? ""}` });
|
|
5
|
+
}
|
|
6
|
+
function p(e) {
|
|
7
|
+
const { children: r, className: t, ...l } = e;
|
|
8
|
+
return /* @__PURE__ */ i(o.Root, { ...l, className: `overflow-hidden ${t ?? ""}`, children: [
|
|
9
|
+
/* @__PURE__ */ a(o.Viewport, { className: "size-full", children: r }),
|
|
10
|
+
/* @__PURE__ */ a(o.Scrollbar, { orientation: "vertical", className: "flex w-2 touch-none select-none p-0.5", children: /* @__PURE__ */ a(o.Thumb, { className: "flex-1 rounded-full bg-dove" }) }),
|
|
11
|
+
/* @__PURE__ */ a(o.Corner, {})
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
const f = n.Root;
|
|
15
|
+
export {
|
|
16
|
+
f as AspectRatio,
|
|
17
|
+
p as ScrollArea,
|
|
18
|
+
m as Separator
|
|
19
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { useId as b } from "react";
|
|
3
|
+
import { cn as a } from "../lib/cn.js";
|
|
4
|
+
function w({
|
|
5
|
+
title: d,
|
|
6
|
+
status: c,
|
|
7
|
+
toolbar: n,
|
|
8
|
+
headerContent: i,
|
|
9
|
+
headerClassName: s,
|
|
10
|
+
hideHeader: m = !1,
|
|
11
|
+
density: o = "default",
|
|
12
|
+
children: h,
|
|
13
|
+
className: f,
|
|
14
|
+
contentClassName: p,
|
|
15
|
+
...x
|
|
16
|
+
}) {
|
|
17
|
+
const r = b();
|
|
18
|
+
return /* @__PURE__ */ t(
|
|
19
|
+
"section",
|
|
20
|
+
{
|
|
21
|
+
role: "region",
|
|
22
|
+
"aria-labelledby": r,
|
|
23
|
+
className: a("min-w-0 overflow-hidden rounded-panel border border-border bg-surface-fog", f),
|
|
24
|
+
...x,
|
|
25
|
+
children: [
|
|
26
|
+
m ? /* @__PURE__ */ e("h3", { id: r, className: "sr-only", children: d }) : /* @__PURE__ */ e("header", { className: a("flex items-center gap-2 border-b border-divider px-3", !i && (o === "compact" ? "h-row-compact" : "h-row-default"), s), children: i ? /* @__PURE__ */ t(l, { children: [
|
|
27
|
+
/* @__PURE__ */ e("h3", { id: r, className: "sr-only", children: d }),
|
|
28
|
+
i
|
|
29
|
+
] }) : /* @__PURE__ */ t(l, { children: [
|
|
30
|
+
/* @__PURE__ */ e("h3", { id: r, className: a("min-w-0 flex-1 truncate font-product font-[500] text-ink", o === "compact" ? "text-caption" : "text-body-sm"), children: d }),
|
|
31
|
+
c && /* @__PURE__ */ e("div", { className: "shrink-0 font-data text-data tabular-nums text-graphite", children: c }),
|
|
32
|
+
n && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: n })
|
|
33
|
+
] }) }),
|
|
34
|
+
/* @__PURE__ */ e("div", { "data-slot": "widget-content", className: a("min-w-0", p), children: h })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
w as WidgetFrame
|
|
41
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Search as C, Check as z } from "lucide-react";
|
|
3
|
+
import { Input as L } from "./input.js";
|
|
4
|
+
import { InputGroup as $ } from "./input-group.js";
|
|
5
|
+
import { Pressable as O } from "./button.js";
|
|
6
|
+
import { SlidingTabs as S } from "./sliding-tabs.js";
|
|
7
|
+
import { cn as f } from "../lib/cn.js";
|
|
8
|
+
function D({
|
|
9
|
+
label: d,
|
|
10
|
+
searchLabel: o,
|
|
11
|
+
searchPlaceholder: g,
|
|
12
|
+
categories: c,
|
|
13
|
+
category: t,
|
|
14
|
+
onCategoryChange: u,
|
|
15
|
+
query: p,
|
|
16
|
+
onQueryChange: v,
|
|
17
|
+
items: x,
|
|
18
|
+
selected: w,
|
|
19
|
+
onToggle: N,
|
|
20
|
+
addedLabel: k,
|
|
21
|
+
emptyLabel: y,
|
|
22
|
+
testIdPrefix: m,
|
|
23
|
+
className: j
|
|
24
|
+
}) {
|
|
25
|
+
const b = p.trim().toLocaleLowerCase(), h = x.filter(
|
|
26
|
+
(e) => (t === "all" || e.category === t) && (!b || e.title.toLocaleLowerCase().includes(b))
|
|
27
|
+
).reduce((e, s) => {
|
|
28
|
+
var l;
|
|
29
|
+
return (e[l = s.category] ?? (e[l] = [])).push(s), e;
|
|
30
|
+
}, {});
|
|
31
|
+
return /* @__PURE__ */ i("div", { "aria-label": d, className: f("min-w-0 space-y-4", j), children: [
|
|
32
|
+
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-col gap-2 border-b border-divider pb-2 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
33
|
+
/* @__PURE__ */ a(
|
|
34
|
+
S,
|
|
35
|
+
{
|
|
36
|
+
size: "sm",
|
|
37
|
+
ariaLabel: d,
|
|
38
|
+
value: t,
|
|
39
|
+
onChange: u,
|
|
40
|
+
tabs: c.map((e) => ({ key: e.value, label: e.label })),
|
|
41
|
+
className: "min-w-0"
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ a($, { label: o, start: /* @__PURE__ */ a(C, { size: 13, "aria-hidden": !0 }), className: "w-full shrink-0 sm:w-48", children: /* @__PURE__ */ a(L, { density: "compact", value: p, onChange: (e) => v(e.target.value), "aria-label": o, placeholder: g }) })
|
|
45
|
+
] }),
|
|
46
|
+
Object.keys(h).length === 0 && /* @__PURE__ */ a("p", { className: "py-12 text-center font-sohne text-body-sm text-graphite", children: y }),
|
|
47
|
+
Object.entries(h).map(([e, s]) => {
|
|
48
|
+
var l;
|
|
49
|
+
return /* @__PURE__ */ i("section", { "aria-labelledby": `widget-picker-${e}`, className: "space-y-2.5", children: [
|
|
50
|
+
/* @__PURE__ */ a("h3", { id: `widget-picker-${e}`, className: "font-sohne text-body-sm font-[500] text-ink", children: ((l = c.find((r) => r.value === e)) == null ? void 0 : l.label) ?? e }),
|
|
51
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: s.map((r) => {
|
|
52
|
+
const n = w.includes(r.id);
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
|
+
O,
|
|
55
|
+
{
|
|
56
|
+
"data-testid": m ? `${m}-${r.id}` : void 0,
|
|
57
|
+
"aria-pressed": n,
|
|
58
|
+
"aria-label": r.title,
|
|
59
|
+
active: n,
|
|
60
|
+
onClick: () => N(r.id),
|
|
61
|
+
"aria-disabled": r.disabled || void 0,
|
|
62
|
+
className: f(
|
|
63
|
+
"group relative min-h-36 overflow-hidden rounded-panel border border-border bg-surface-card p-3 text-left hover:border-graphite hover:bg-surface-hover",
|
|
64
|
+
n && "border-graphite bg-surface-muted",
|
|
65
|
+
r.disabled && "pointer-events-none opacity-45"
|
|
66
|
+
),
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ i("span", { className: "flex min-w-0 items-center justify-between gap-2 font-sohne text-caption font-[500] text-ink", children: [
|
|
69
|
+
/* @__PURE__ */ a("span", { className: "truncate", children: r.title }),
|
|
70
|
+
n && /* @__PURE__ */ i("span", { className: "inline-flex shrink-0 items-center gap-1 text-micro font-[450] text-graphite", children: [
|
|
71
|
+
/* @__PURE__ */ a(z, { size: 11, "aria-hidden": !0 }),
|
|
72
|
+
k
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ a("div", { className: "mt-3 h-24 overflow-hidden rounded-control border border-divider bg-surface-canvas p-2", children: r.preview })
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
r.id
|
|
79
|
+
);
|
|
80
|
+
}) })
|
|
81
|
+
] }, e);
|
|
82
|
+
})
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
D as WidgetPicker
|
|
87
|
+
};
|