@almanaclabs/blaze-ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app-shell/app-shell.d.ts +81 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +144 -0
- package/dist/components/app-shell/index.d.ts +2 -0
- package/dist/components/app-shell/index.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/chat-bar/chat-bar.d.ts +26 -0
- package/dist/components/chat-bar/chat-bar.d.ts.map +1 -0
- package/dist/components/chat-bar/chat-bar.js +58 -0
- package/dist/components/chat-bar/index.d.ts +2 -0
- package/dist/components/chat-bar/index.d.ts.map +1 -0
- package/dist/components/dense-table/dense-table.d.ts +36 -0
- package/dist/components/dense-table/dense-table.d.ts.map +1 -0
- package/dist/components/dense-table/dense-table.js +41 -0
- package/dist/components/dense-table/index.d.ts +2 -0
- package/dist/components/dense-table/index.d.ts.map +1 -0
- package/dist/components/editable-text/editable-text.d.ts +26 -0
- package/dist/components/editable-text/editable-text.d.ts.map +1 -0
- package/dist/components/editable-text/editable-text.js +82 -0
- package/dist/components/editable-text/index.d.ts +2 -0
- package/dist/components/editable-text/index.d.ts.map +1 -0
- package/dist/components/face-stack-button/face-stack-button.d.ts +31 -0
- package/dist/components/face-stack-button/face-stack-button.d.ts.map +1 -0
- package/dist/components/face-stack-button/face-stack-button.js +47 -0
- package/dist/components/face-stack-button/index.d.ts +2 -0
- package/dist/components/face-stack-button/index.d.ts.map +1 -0
- package/dist/components/goal-card/goal-card.d.ts +51 -0
- package/dist/components/goal-card/goal-card.d.ts.map +1 -0
- package/dist/components/goal-card/goal-card.js +109 -0
- package/dist/components/goal-card/index.d.ts +2 -0
- package/dist/components/goal-card/index.d.ts.map +1 -0
- package/dist/components/input-group/input-group.d.ts +1 -1
- package/dist/components/media-thumbnail/index.d.ts +2 -0
- package/dist/components/media-thumbnail/index.d.ts.map +1 -0
- package/dist/components/media-thumbnail/media-thumbnail.d.ts +21 -0
- package/dist/components/media-thumbnail/media-thumbnail.d.ts.map +1 -0
- package/dist/components/media-thumbnail/media-thumbnail.js +50 -0
- package/dist/components/metric-tile/index.d.ts +2 -0
- package/dist/components/metric-tile/index.d.ts.map +1 -0
- package/dist/components/metric-tile/metric-tile.d.ts +34 -0
- package/dist/components/metric-tile/metric-tile.d.ts.map +1 -0
- package/dist/components/metric-tile/metric-tile.js +75 -0
- package/dist/components/page-header/index.d.ts +2 -0
- package/dist/components/page-header/index.d.ts.map +1 -0
- package/dist/components/page-header/page-header.d.ts +16 -0
- package/dist/components/page-header/page-header.d.ts.map +1 -0
- package/dist/components/page-header/page-header.js +38 -0
- package/dist/components/platform-avatar/index.d.ts +2 -0
- package/dist/components/platform-avatar/index.d.ts.map +1 -0
- package/dist/components/platform-avatar/platform-avatar.d.ts +23 -0
- package/dist/components/platform-avatar/platform-avatar.d.ts.map +1 -0
- package/dist/components/platform-avatar/platform-avatar.js +54 -0
- package/dist/components/platform-icon/index.d.ts +2 -0
- package/dist/components/platform-icon/index.d.ts.map +1 -0
- package/dist/components/platform-icon/platform-icon.d.ts +33 -0
- package/dist/components/platform-icon/platform-icon.d.ts.map +1 -0
- package/dist/components/platform-icon/platform-icon.js +169 -0
- package/dist/components/sidebar/sidebar.js +19 -19
- package/dist/components/signal-strip/index.d.ts +2 -0
- package/dist/components/signal-strip/index.d.ts.map +1 -0
- package/dist/components/signal-strip/signal-strip.d.ts +34 -0
- package/dist/components/signal-strip/signal-strip.d.ts.map +1 -0
- package/dist/components/signal-strip/signal-strip.js +84 -0
- package/dist/components/source-avatar/index.d.ts +2 -0
- package/dist/components/source-avatar/index.d.ts.map +1 -0
- package/dist/components/source-avatar/source-avatar.d.ts +16 -0
- package/dist/components/source-avatar/source-avatar.d.ts.map +1 -0
- package/dist/components/source-avatar/source-avatar.js +15 -0
- package/dist/components/stacked-bar-chart/index.d.ts +2 -0
- package/dist/components/stacked-bar-chart/index.d.ts.map +1 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts +80 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.d.ts.map +1 -0
- package/dist/components/stacked-bar-chart/stacked-bar-chart.js +240 -0
- package/dist/components/state-banner/index.d.ts +2 -0
- package/dist/components/state-banner/index.d.ts.map +1 -0
- package/dist/components/state-banner/state-banner.d.ts +32 -0
- package/dist/components/state-banner/state-banner.d.ts.map +1 -0
- package/dist/components/state-banner/state-banner.js +70 -0
- package/dist/components/suggest-chips/index.d.ts +2 -0
- package/dist/components/suggest-chips/index.d.ts.map +1 -0
- package/dist/components/suggest-chips/suggest-chips.d.ts +13 -0
- package/dist/components/suggest-chips/suggest-chips.d.ts.map +1 -0
- package/dist/components/suggest-chips/suggest-chips.js +24 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -49
- package/package.json +1 -1
- package/src/styles/globals.css +69 -5
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { ChartContainer as t, ChartTooltip as n } from "../chart/chart.js";
|
|
4
|
+
import { Tabs as r, TabsList as i, TabsTrigger as a } from "../tabs/tabs.js";
|
|
5
|
+
import { Toggle as o } from "../toggle/toggle.js";
|
|
6
|
+
import * as s from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { Bar as u, BarChart as d, CartesianGrid as f, Cell as p, ReferenceLine as ee, XAxis as m, YAxis as h } from "recharts";
|
|
9
|
+
//#region src/components/stacked-bar-chart/stacked-bar-chart.tsx
|
|
10
|
+
var g = new Intl.NumberFormat("en-US", {
|
|
11
|
+
notation: "compact",
|
|
12
|
+
maximumFractionDigits: 1
|
|
13
|
+
}), _ = (e) => g.format(e), v = (e) => e.toLocaleString("en-US");
|
|
14
|
+
function y(e, t, n = 4) {
|
|
15
|
+
let r = (t - e) / n || 1, i = 10 ** Math.floor(Math.log10(r)), a = ([
|
|
16
|
+
1,
|
|
17
|
+
2,
|
|
18
|
+
2.5,
|
|
19
|
+
5,
|
|
20
|
+
10
|
|
21
|
+
].find((e) => e * i >= r) ?? 10) * i, o = [];
|
|
22
|
+
for (let n = Math.floor(e / a) * a; n <= Math.ceil(t / a) * a + a / 2; n += a) o.push(+n.toFixed(6));
|
|
23
|
+
return o;
|
|
24
|
+
}
|
|
25
|
+
var b = "__index", x = {
|
|
26
|
+
section: 52,
|
|
27
|
+
card: 44
|
|
28
|
+
};
|
|
29
|
+
function S(e, t, n) {
|
|
30
|
+
let [r, i] = s.useState(t);
|
|
31
|
+
return [e === void 0 ? r : e, (t) => {
|
|
32
|
+
e === void 0 && i(t), n?.(t);
|
|
33
|
+
}];
|
|
34
|
+
}
|
|
35
|
+
function C({ series: s, metrics: g, title: C, metric: w, defaultMetric: T, onMetricChange: E, hiddenSeries: te, defaultHiddenSeries: ne = [], onHiddenSeriesChange: re, variant: D = "section", height: ie, labelEvery: O, className: k, ...A }) {
|
|
36
|
+
let [j, M] = S(w, T ?? g[0]?.value ?? "", E), [N, P] = S(te, ne, re), F = g.find((e) => e.value === j) ?? g[0], I = F?.data ?? [], L = F?.formatValue ?? v, R = F?.formatTick ?? _, z = F?.title ?? C, B = F?.ariaLabel ?? (typeof z == "string" ? z : "Stacked bar chart"), V = s.filter((e) => I.some((t) => t.values[e.key] != null)), H = V.filter((e) => !N.includes(e.key)), U = (e) => P(N.includes(e) ? N.filter((t) => t !== e) : [...N, e]), W = I.map((e, t) => {
|
|
37
|
+
let n = { [b]: t };
|
|
38
|
+
for (let t of H) n[t.key] = e.values[t.key] ?? null;
|
|
39
|
+
return n;
|
|
40
|
+
}), G = 0, K = 0;
|
|
41
|
+
for (let e of I) {
|
|
42
|
+
let t = 0, n = 0;
|
|
43
|
+
for (let r of H) {
|
|
44
|
+
let i = e.values[r.key] ?? 0;
|
|
45
|
+
i > 0 ? t += i : n += i;
|
|
46
|
+
}
|
|
47
|
+
G = Math.max(G, t), K = Math.min(K, n);
|
|
48
|
+
}
|
|
49
|
+
let q = y(K, Math.max(G, 1)), J = [q[0] ?? 0, q[q.length - 1] ?? 1], ae = O ?? (I.length <= 10 ? 1 : 7), Y = ie ?? (D === "card" ? 220 : 300), X = D === "card", Z = g.length > 1 ? /* @__PURE__ */ c(r, {
|
|
50
|
+
value: F?.value,
|
|
51
|
+
onValueChange: (e) => M(e),
|
|
52
|
+
children: /* @__PURE__ */ c(i, {
|
|
53
|
+
"aria-label": "Metric",
|
|
54
|
+
children: g.map((e) => /* @__PURE__ */ c(a, {
|
|
55
|
+
value: e.value,
|
|
56
|
+
children: e.label
|
|
57
|
+
}, e.value))
|
|
58
|
+
})
|
|
59
|
+
}) : null, Q = V.map((e) => {
|
|
60
|
+
let t = !N.includes(e.key);
|
|
61
|
+
return /* @__PURE__ */ l(o, {
|
|
62
|
+
"data-slot": "stacked-bar-chart-series-toggle",
|
|
63
|
+
variant: "outline",
|
|
64
|
+
size: X ? "sm" : "default",
|
|
65
|
+
pressed: t,
|
|
66
|
+
onPressedChange: () => U(e.key),
|
|
67
|
+
className: "type-meta rounded-full px-3 font-medium aria-pressed:bg-transparent",
|
|
68
|
+
style: !X && t ? {
|
|
69
|
+
background: e.tint ?? `color-mix(in srgb, ${e.color} 12%, transparent)`,
|
|
70
|
+
borderColor: e.color,
|
|
71
|
+
color: e.foreground ?? e.color
|
|
72
|
+
} : void 0,
|
|
73
|
+
children: [
|
|
74
|
+
X ? /* @__PURE__ */ c("span", {
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
className: "size-2.5 rounded-full",
|
|
77
|
+
style: { background: t ? e.color : "var(--border)" }
|
|
78
|
+
}) : null,
|
|
79
|
+
e.icon,
|
|
80
|
+
e.label
|
|
81
|
+
]
|
|
82
|
+
}, e.key);
|
|
83
|
+
}), oe = Object.fromEntries(s.map((e) => [e.key, {
|
|
84
|
+
label: e.label,
|
|
85
|
+
color: e.color
|
|
86
|
+
}])), $ = /* @__PURE__ */ c("div", {
|
|
87
|
+
"data-slot": "stacked-bar-chart-plot",
|
|
88
|
+
role: "img",
|
|
89
|
+
"aria-label": B,
|
|
90
|
+
className: X ? "mt-3" : "mt-4",
|
|
91
|
+
children: /* @__PURE__ */ c(t, {
|
|
92
|
+
config: oe,
|
|
93
|
+
className: "type-meta aspect-auto w-full [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-surface-subtle",
|
|
94
|
+
style: { height: Y },
|
|
95
|
+
initialDimension: {
|
|
96
|
+
width: 640,
|
|
97
|
+
height: Y
|
|
98
|
+
},
|
|
99
|
+
children: /* @__PURE__ */ l(d, {
|
|
100
|
+
data: W,
|
|
101
|
+
stackOffset: "sign",
|
|
102
|
+
barCategoryGap: X ? 1.5 : "18%",
|
|
103
|
+
margin: {
|
|
104
|
+
top: X ? 10 : 8,
|
|
105
|
+
right: X ? 8 : 0,
|
|
106
|
+
bottom: 0,
|
|
107
|
+
left: 0
|
|
108
|
+
},
|
|
109
|
+
accessibilityLayer: !1,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ c(f, {
|
|
112
|
+
vertical: !1,
|
|
113
|
+
stroke: "var(--border-subtle)"
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ c(m, {
|
|
116
|
+
dataKey: b,
|
|
117
|
+
interval: 0,
|
|
118
|
+
tickLine: !1,
|
|
119
|
+
axisLine: !1,
|
|
120
|
+
tickMargin: X ? 4 : 8,
|
|
121
|
+
height: X ? 22 : 28,
|
|
122
|
+
tickFormatter: (e) => (I.length - 1 - e) % ae == 0 ? I[e]?.label ?? "" : ""
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ c(h, {
|
|
125
|
+
domain: J,
|
|
126
|
+
ticks: q,
|
|
127
|
+
interval: 0,
|
|
128
|
+
tickLine: !1,
|
|
129
|
+
axisLine: !1,
|
|
130
|
+
width: x[D],
|
|
131
|
+
tickMargin: X ? 6 : 8,
|
|
132
|
+
tickFormatter: R
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ c(ee, {
|
|
135
|
+
y: 0,
|
|
136
|
+
stroke: "var(--border)"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ c(n, {
|
|
139
|
+
cursor: { fill: "var(--surface-subtle)" },
|
|
140
|
+
isAnimationActive: !1,
|
|
141
|
+
position: { y: 0 },
|
|
142
|
+
content: ({ active: e, label: t }) => {
|
|
143
|
+
let n = typeof t == "number" ? t : Number(t), r = I[n];
|
|
144
|
+
if (!e || !r || H.length === 0) return null;
|
|
145
|
+
let i = H.reduce((e, t) => e + (r.values[t.key] ?? 0), 0);
|
|
146
|
+
return /* @__PURE__ */ l("div", {
|
|
147
|
+
"data-slot": "stacked-bar-chart-tooltip",
|
|
148
|
+
className: "min-w-[180px] rounded-lg border border-border bg-card p-3 shadow-sm",
|
|
149
|
+
children: [/* @__PURE__ */ c("p", {
|
|
150
|
+
className: "type-meta text-muted-foreground",
|
|
151
|
+
children: r.tooltipLabel ?? r.label
|
|
152
|
+
}), /* @__PURE__ */ l("ul", {
|
|
153
|
+
className: "mt-1.5 flex flex-col gap-1",
|
|
154
|
+
children: [H.map((e) => {
|
|
155
|
+
let t = r.values[e.key];
|
|
156
|
+
return /* @__PURE__ */ l("li", {
|
|
157
|
+
className: "type-body flex items-center gap-2 text-foreground",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ c("span", {
|
|
160
|
+
className: "size-2.5 rounded-full",
|
|
161
|
+
style: { background: e.color }
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ c("span", {
|
|
164
|
+
className: "flex-1",
|
|
165
|
+
children: e.label
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ c("span", {
|
|
168
|
+
className: "font-medium tabular-nums",
|
|
169
|
+
children: t == null ? "–" : L(t)
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
}, e.key);
|
|
173
|
+
}), H.length > 1 ? /* @__PURE__ */ l("li", {
|
|
174
|
+
className: "type-body mt-1 flex items-center gap-2 border-t border-border-subtle pt-1.5 font-medium text-foreground",
|
|
175
|
+
children: [/* @__PURE__ */ c("span", {
|
|
176
|
+
className: "flex-1",
|
|
177
|
+
children: "Total"
|
|
178
|
+
}), /* @__PURE__ */ c("span", {
|
|
179
|
+
className: "tabular-nums",
|
|
180
|
+
children: L(i)
|
|
181
|
+
})]
|
|
182
|
+
}) : null]
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}),
|
|
187
|
+
H.map((e) => /* @__PURE__ */ c(u, {
|
|
188
|
+
dataKey: e.key,
|
|
189
|
+
stackId: "stack",
|
|
190
|
+
fill: e.color,
|
|
191
|
+
maxBarSize: 56,
|
|
192
|
+
isAnimationActive: !1,
|
|
193
|
+
children: I.map((e, t) => /* @__PURE__ */ c(p, { fillOpacity: e.partial ? .45 : 1 }, t))
|
|
194
|
+
}, e.key))
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
return X ? /* @__PURE__ */ l("div", {
|
|
200
|
+
"data-slot": "stacked-bar-chart",
|
|
201
|
+
"data-variant": D,
|
|
202
|
+
className: e("rounded-xl border border-border bg-card p-5", k),
|
|
203
|
+
...A,
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ l("div", {
|
|
206
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
207
|
+
children: [z ? /* @__PURE__ */ c("p", {
|
|
208
|
+
className: "type-meta font-medium text-muted-foreground",
|
|
209
|
+
children: z
|
|
210
|
+
}) : null, Z]
|
|
211
|
+
}),
|
|
212
|
+
$,
|
|
213
|
+
Q.length ? /* @__PURE__ */ c("div", {
|
|
214
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
215
|
+
children: Q
|
|
216
|
+
}) : null
|
|
217
|
+
]
|
|
218
|
+
}) : /* @__PURE__ */ l("div", {
|
|
219
|
+
"data-slot": "stacked-bar-chart",
|
|
220
|
+
"data-variant": D,
|
|
221
|
+
className: k,
|
|
222
|
+
...A,
|
|
223
|
+
children: [
|
|
224
|
+
z ? /* @__PURE__ */ c("h2", {
|
|
225
|
+
className: "type-section-title font-medium",
|
|
226
|
+
children: z
|
|
227
|
+
}) : null,
|
|
228
|
+
/* @__PURE__ */ l("div", {
|
|
229
|
+
className: "mt-4 flex flex-wrap items-center gap-3",
|
|
230
|
+
children: [Z, Q.length ? /* @__PURE__ */ c("div", {
|
|
231
|
+
className: "flex flex-wrap items-center gap-2",
|
|
232
|
+
children: Q
|
|
233
|
+
}) : null]
|
|
234
|
+
}),
|
|
235
|
+
$
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
//#endregion
|
|
240
|
+
export { C as StackedBarChart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/state-banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* - `stale`: the page's data changed while it was open.
|
|
4
|
+
* - `connect`: a source to connect.
|
|
5
|
+
* - `waiting`: something is on its way.
|
|
6
|
+
* - `warning`: something failed or needs the owner.
|
|
7
|
+
*/
|
|
8
|
+
type StateBannerTone = 'stale' | 'connect' | 'waiting' | 'warning';
|
|
9
|
+
declare const stateBannerVariants: (props?: ({
|
|
10
|
+
tone?: "waiting" | "warning" | "stale" | "connect" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
type StateBannerProps = React.ComponentProps<'div'> & {
|
|
13
|
+
tone: StateBannerTone;
|
|
14
|
+
/** The action's label. The action shows only when this is set. */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
onAction?: () => void;
|
|
17
|
+
};
|
|
18
|
+
/** A page-state banner: a notice, an icon for its tone, and at most one action. */
|
|
19
|
+
declare function StateBanner({ tone, action, onAction, className, children, ...props }: StateBannerProps): React.JSX.Element;
|
|
20
|
+
type StaleBannerProps = Omit<StateBannerProps, 'tone' | 'action' | 'onAction' | 'children'> & {
|
|
21
|
+
/** Whether the page's data changed while it was open. */
|
|
22
|
+
stale: boolean;
|
|
23
|
+
/** What changed, e.g. "Your plan". The banner reads "<what> changed while you were here." */
|
|
24
|
+
what: React.ReactNode;
|
|
25
|
+
/** Reloads the page's data. The banner hides itself after it runs. */
|
|
26
|
+
onRefresh?: () => void;
|
|
27
|
+
refreshLabel?: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
/** The realtime notice: the page's data changed while it was open. Refresh reloads it. */
|
|
30
|
+
declare function StaleBanner({ stale, what, onRefresh, refreshLabel, ...props }: StaleBannerProps): React.JSX.Element | null;
|
|
31
|
+
export { StaleBanner, StateBanner, stateBannerVariants, type StaleBannerProps, type StateBannerProps, type StateBannerTone, };
|
|
32
|
+
//# sourceMappingURL=state-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-banner.d.ts","sourceRoot":"","sources":["../../../src/components/state-banner/state-banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B;;;;;GAKG;AACH,KAAK,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAElE,QAAA,MAAM,mBAAmB;;8EAaxB,CAAA;AA+BD,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACpD,IAAI,EAAE,eAAe,CAAA;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,mFAAmF;AACnF,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAwBlB;AAED,KAAK,gBAAgB,GAAG,IAAI,CAC1B,gBAAgB,EAChB,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAC5C,GAAG;IACF,yDAAyD;IACzD,KAAK,EAAE,OAAO,CAAA;IACd,6FAA6F;IAC7F,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC/B,CAAA;AAED,0FAA0F;AAC1F,iBAAS,WAAW,CAAC,EACnB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,YAAwB,EACxB,GAAG,KAAK,EACT,EAAE,gBAAgB,4BAyBlB;AAED,OAAO,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,CAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { IconAlertTriangle as o, IconClock as s, IconPlus as c, IconRefresh as l } from "@tabler/icons-react";
|
|
7
|
+
//#region src/components/state-banner/state-banner.tsx
|
|
8
|
+
var u = r("flex items-center gap-3 rounded-lg px-4 py-3", {
|
|
9
|
+
variants: { tone: {
|
|
10
|
+
stale: "bg-surface-subtle",
|
|
11
|
+
connect: "bg-surface-subtle",
|
|
12
|
+
waiting: "bg-surface-subtle",
|
|
13
|
+
warning: "bg-warning-soft"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { tone: "stale" }
|
|
16
|
+
}), d = "icon-optical-16 flex-none", f = {
|
|
17
|
+
stale: /* @__PURE__ */ i(l, {
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
className: e(d, "text-info")
|
|
20
|
+
}),
|
|
21
|
+
connect: /* @__PURE__ */ i(c, {
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
className: e(d, "text-muted-foreground")
|
|
24
|
+
}),
|
|
25
|
+
waiting: /* @__PURE__ */ i(s, {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
className: e(d, "text-muted-foreground")
|
|
28
|
+
}),
|
|
29
|
+
warning: /* @__PURE__ */ i(o, {
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
className: e(d, "text-warning")
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
function p({ tone: n, action: r, onAction: o, className: s, children: c, ...l }) {
|
|
35
|
+
return /* @__PURE__ */ a("div", {
|
|
36
|
+
"data-slot": "state-banner",
|
|
37
|
+
"data-tone": n,
|
|
38
|
+
role: n === "warning" ? "alert" : "status",
|
|
39
|
+
className: e(u({ tone: n }), s),
|
|
40
|
+
...l,
|
|
41
|
+
children: [
|
|
42
|
+
f[n],
|
|
43
|
+
/* @__PURE__ */ i("p", {
|
|
44
|
+
"data-slot": "state-banner-message",
|
|
45
|
+
className: "type-body flex-1",
|
|
46
|
+
children: c
|
|
47
|
+
}),
|
|
48
|
+
r ? /* @__PURE__ */ i(t, {
|
|
49
|
+
size: "sm",
|
|
50
|
+
variant: n === "stale" ? "secondary" : "primary",
|
|
51
|
+
onClick: o,
|
|
52
|
+
children: r
|
|
53
|
+
}) : null
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function m({ stale: e, what: t, onRefresh: r, refreshLabel: i = "Refresh", ...o }) {
|
|
58
|
+
let [s, c] = n.useState(!1), [l, u] = n.useState(e);
|
|
59
|
+
return e !== l && (u(e), e && c(!1)), !e || s ? null : /* @__PURE__ */ a(p, {
|
|
60
|
+
tone: "stale",
|
|
61
|
+
action: i,
|
|
62
|
+
onAction: () => {
|
|
63
|
+
c(!0), r?.();
|
|
64
|
+
},
|
|
65
|
+
...o,
|
|
66
|
+
children: [t, " changed while you were here."]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { m as StaleBanner, p as StateBanner, u as stateBannerVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/suggest-chips/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type SuggestChipsProps = Omit<React.ComponentProps<'div'>, 'onClick'> & {
|
|
3
|
+
/** Each chip's label, which is also what it sends. */
|
|
4
|
+
chips: readonly string[];
|
|
5
|
+
/** Called with the chip's label when the owner picks it. */
|
|
6
|
+
onPick: (chip: string) => void;
|
|
7
|
+
/** Indent the row to line up with message text that sits beside an avatar. */
|
|
8
|
+
inset?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** A row of suggested replies. Picking a chip hands its label to `onPick`. */
|
|
11
|
+
declare function SuggestChips({ chips, onPick, inset, className, 'aria-label': ariaLabel, ...props }: SuggestChipsProps): React.JSX.Element | null;
|
|
12
|
+
export { SuggestChips, type SuggestChipsProps };
|
|
13
|
+
//# sourceMappingURL=suggest-chips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest-chips.d.ts","sourceRoot":"","sources":["../../../src/components/suggest-chips/suggest-chips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,GAAG;IACtE,sDAAsD;IACtD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,4DAA4D;IAC5D,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,8EAA8E;AAC9E,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,MAAM,EACN,KAAa,EACb,SAAS,EACT,YAAY,EAAE,SAA+B,EAC7C,GAAG,KAAK,EACT,EAAE,iBAAiB,4BAyBnB;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/suggest-chips/suggest-chips.tsx
|
|
6
|
+
function r({ chips: r, onPick: i, inset: a = !1, className: o, "aria-label": s = "Suggested replies", ...c }) {
|
|
7
|
+
return r.length ? /* @__PURE__ */ n("div", {
|
|
8
|
+
"data-slot": "suggest-chips",
|
|
9
|
+
role: "group",
|
|
10
|
+
"aria-label": s,
|
|
11
|
+
className: e("flex flex-wrap gap-1.5", a && "pl-10", o),
|
|
12
|
+
...c,
|
|
13
|
+
children: r.map((e) => /* @__PURE__ */ n(t, {
|
|
14
|
+
"data-slot": "suggest-chip",
|
|
15
|
+
size: "sm",
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
className: "font-normal",
|
|
18
|
+
onClick: () => i(e),
|
|
19
|
+
children: e
|
|
20
|
+
}, e))
|
|
21
|
+
}) : null;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as SuggestChips };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { Separator, type SeparatorProps } from './components/separator';
|
|
|
7
7
|
export * from './components/accordion';
|
|
8
8
|
export * from './components/alert';
|
|
9
9
|
export * from './components/alert-dialog';
|
|
10
|
+
export * from './components/app-shell';
|
|
10
11
|
export * from './components/aspect-ratio';
|
|
11
12
|
export * from './components/attachment';
|
|
12
13
|
export * from './components/avatar';
|
|
@@ -17,25 +18,35 @@ export * from './components/button-group';
|
|
|
17
18
|
export * from './components/calendar';
|
|
18
19
|
export * from './components/carousel';
|
|
19
20
|
export * from './components/chart';
|
|
21
|
+
export * from './components/chat-bar';
|
|
20
22
|
export * from './components/checkbox';
|
|
21
23
|
export * from './components/collapsible';
|
|
22
24
|
export * from './components/combobox';
|
|
23
25
|
export * from './components/data-table';
|
|
24
26
|
export * from './components/date-picker';
|
|
27
|
+
export * from './components/dense-table';
|
|
25
28
|
export * from './components/dialog';
|
|
26
29
|
export * from './components/drawer';
|
|
27
30
|
export * from './components/dropdown-menu';
|
|
31
|
+
export * from './components/editable-text';
|
|
28
32
|
export * from './components/empty';
|
|
33
|
+
export * from './components/face-stack-button';
|
|
34
|
+
export * from './components/goal-card';
|
|
29
35
|
export * from './components/hover-card';
|
|
30
|
-
export * from './components/input-group';
|
|
31
36
|
export * from './components/identity-mark';
|
|
37
|
+
export * from './components/input-group';
|
|
32
38
|
export * from './components/item';
|
|
33
39
|
export * from './components/marker';
|
|
40
|
+
export * from './components/media-thumbnail';
|
|
34
41
|
export * from './components/message';
|
|
35
42
|
export * from './components/metric-overview';
|
|
43
|
+
export * from './components/metric-tile';
|
|
36
44
|
export * from './components/native-select';
|
|
37
45
|
export * from './components/navigation-action';
|
|
46
|
+
export * from './components/page-header';
|
|
38
47
|
export * from './components/pagination';
|
|
48
|
+
export * from './components/platform-avatar';
|
|
49
|
+
export * from './components/platform-icon';
|
|
39
50
|
export * from './components/popover';
|
|
40
51
|
export * from './components/progress';
|
|
41
52
|
export * from './components/questionnaire';
|
|
@@ -44,9 +55,14 @@ export * from './components/scroll-area';
|
|
|
44
55
|
export * from './components/select';
|
|
45
56
|
export * from './components/sheet';
|
|
46
57
|
export * from './components/sidebar';
|
|
58
|
+
export * from './components/signal-strip';
|
|
47
59
|
export * from './components/skeleton';
|
|
48
60
|
export * from './components/slider';
|
|
61
|
+
export * from './components/source-avatar';
|
|
49
62
|
export * from './components/spinner';
|
|
63
|
+
export * from './components/state-banner';
|
|
64
|
+
export * from './components/suggest-chips';
|
|
65
|
+
export * from './components/stacked-bar-chart';
|
|
50
66
|
export * from './components/switch';
|
|
51
67
|
export * from './components/table';
|
|
52
68
|
export * from './components/tabs';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvE,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,c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