achery-ui 0.1.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 +161 -0
- package/dist/accents-DrqL1lLe.d.cts +48 -0
- package/dist/accents-DrqL1lLe.d.ts +48 -0
- package/dist/chunk-IARZATZY.js +91 -0
- package/dist/chunk-IARZATZY.js.map +1 -0
- package/dist/chunk-SSWJ4EPA.cjs +95 -0
- package/dist/chunk-SSWJ4EPA.cjs.map +1 -0
- package/dist/index.cjs +1026 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1281 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +1293 -0
- package/dist/index.d.ts +1293 -0
- package/dist/index.js +975 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens/index.cjs +183 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +188 -0
- package/dist/tokens/index.d.ts +188 -0
- package/dist/tokens/index.js +155 -0
- package/dist/tokens/index.js.map +1 -0
- package/package.json +68 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,975 @@
|
|
|
1
|
+
import { accentColorNames, accentColors } from './chunk-IARZATZY.js';
|
|
2
|
+
import { createContext, useState, useEffect, useContext, useMemo, useCallback } from 'react';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
5
|
+
import * as RadixToggle from '@radix-ui/react-toggle';
|
|
6
|
+
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
7
|
+
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
8
|
+
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
9
|
+
import { createPortal } from 'react-dom';
|
|
10
|
+
|
|
11
|
+
var ThemeContext = createContext(null);
|
|
12
|
+
function AcheryProvider({
|
|
13
|
+
children,
|
|
14
|
+
defaultTheme = "light",
|
|
15
|
+
defaultAccent = "terracotta",
|
|
16
|
+
className,
|
|
17
|
+
style
|
|
18
|
+
}) {
|
|
19
|
+
const [theme, setThemeState] = useState(defaultTheme);
|
|
20
|
+
const [accent, setAccentState] = useState(defaultAccent);
|
|
21
|
+
const setTheme = (next) => setThemeState(next);
|
|
22
|
+
const toggleTheme = () => setThemeState((t) => t === "light" ? "dark" : "light");
|
|
23
|
+
const setAccent = (next) => setAccentState(next);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const html = document.documentElement;
|
|
26
|
+
html.dataset["theme"] = theme;
|
|
27
|
+
html.dataset["accent"] = accent;
|
|
28
|
+
html.dataset["acheryRoot"] = "";
|
|
29
|
+
return () => {
|
|
30
|
+
delete html.dataset["theme"];
|
|
31
|
+
delete html.dataset["accent"];
|
|
32
|
+
delete html.dataset["acheryRoot"];
|
|
33
|
+
};
|
|
34
|
+
}, [theme, accent]);
|
|
35
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme, accent, setAccent }, children: /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"data-achery-root": "",
|
|
39
|
+
"data-theme": theme,
|
|
40
|
+
"data-accent": accent,
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
children
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
function useTheme() {
|
|
48
|
+
const ctx = useContext(ThemeContext);
|
|
49
|
+
if (!ctx) throw new Error("useTheme must be used within <AcheryProvider>");
|
|
50
|
+
return ctx;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/theme/vars.css.ts
|
|
54
|
+
var vars = { color: { bg: "var(--color-bg__1acibxb0)", bg2: "var(--color-bg2__1acibxb1)", bgSunken: "var(--color-bgSunken__1acibxb2)", surface: "var(--color-surface__1acibxb3)", surface2: "var(--color-surface2__1acibxb4)", fg: "var(--color-fg__1acibxb5)", fg2: "var(--color-fg2__1acibxb6)", fg3: "var(--color-fg3__1acibxb7)", fgMute: "var(--color-fgMute__1acibxb8)", border: "var(--color-border__1acibxb9)", border2: "var(--color-border2__1acibxba)", borderMute: "var(--color-borderMute__1acibxbb)", rule: "var(--color-rule__1acibxbc)", accent: "var(--color-accent__1acibxbd)", accentFg: "var(--color-accentFg__1acibxbe)", accent2: "var(--color-accent2__1acibxbf)", accent3: "var(--color-accent3__1acibxbg)", success: "var(--color-success__1acibxbh)", warn: "var(--color-warn__1acibxbi)", danger: "var(--color-danger__1acibxbj)", info: "var(--color-info__1acibxbk)", selectionBg: "var(--color-selectionBg__1acibxbl)", selectionFg: "var(--color-selectionFg__1acibxbm)" }, font: { display: "var(--font-display__1acibxbn)", body: "var(--font-body__1acibxbo)", mono: "var(--font-mono__1acibxbp)" }, space: { sp1: "var(--space-sp1__1acibxbq)", sp2: "var(--space-sp2__1acibxbr)", sp3: "var(--space-sp3__1acibxbs)", sp4: "var(--space-sp4__1acibxbt)", sp5: "var(--space-sp5__1acibxbu)", sp6: "var(--space-sp6__1acibxbv)", sp7: "var(--space-sp7__1acibxbw)", sp8: "var(--space-sp8__1acibxbx)", sp9: "var(--space-sp9__1acibxby)", sp10: "var(--space-sp10__1acibxbz)", sp11: "var(--space-sp11__1acibxb10)", sp12: "var(--space-sp12__1acibxb11)" }, radius: { none: "var(--radius-none__1acibxb12)", hairline: "var(--radius-hairline__1acibxb13)", sm: "var(--radius-sm__1acibxb14)", pill: "var(--radius-pill__1acibxb15)" }, shadow: { stamp: "var(--shadow-stamp__1acibxb16)", stampLg: "var(--shadow-stampLg__1acibxb17)", press: "var(--shadow-press__1acibxb18)", soft: "var(--shadow-soft__1acibxb19)" }, duration: { fast: "var(--duration-fast__1acibxb1a)", base: "var(--duration-base__1acibxb1b)", slow: "var(--duration-slow__1acibxb1c)" }, ease: { out: "var(--ease-out__1acibxb1d)", snap: "var(--ease-snap__1acibxb1e)" } };
|
|
55
|
+
|
|
56
|
+
// src/glyphs/Glyph.css.ts
|
|
57
|
+
var glyph = "Glyph_glyph__kbvv420";
|
|
58
|
+
function ArrowRight(props) {
|
|
59
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
60
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12h18" }),
|
|
61
|
+
/* @__PURE__ */ jsx("polyline", { points: "15,6 21,12 15,18" })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
function ArrowUp(props) {
|
|
65
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3v18" }),
|
|
67
|
+
/* @__PURE__ */ jsx("polyline", { points: "6,9 12,3 18,9" })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
function Asterism(props) {
|
|
71
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 60 24", fill: "currentColor", ...props, children: [
|
|
72
|
+
/* @__PURE__ */ jsx("circle", { cx: "14", cy: "16", r: "2" }),
|
|
73
|
+
/* @__PURE__ */ jsx("circle", { cx: "30", cy: "8", r: "2" }),
|
|
74
|
+
/* @__PURE__ */ jsx("circle", { cx: "46", cy: "16", r: "2" })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
function Book(props) {
|
|
78
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
79
|
+
/* @__PURE__ */ jsx("path", { d: "M4 5v14" }),
|
|
80
|
+
/* @__PURE__ */ jsx("path", { d: "M20 5v14" }),
|
|
81
|
+
/* @__PURE__ */ jsx("path", { d: "M4 5c4-1 8-1 8 1v14c0-2-4-2-8-1" }),
|
|
82
|
+
/* @__PURE__ */ jsx("path", { d: "M20 5c-4-1-8-1-8 1v14c0-2 4-2 8-1" })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
function Circle(props) {
|
|
86
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", ...props, children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "8" }) });
|
|
87
|
+
}
|
|
88
|
+
function Compass(props) {
|
|
89
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", ...props, children: [
|
|
90
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
91
|
+
/* @__PURE__ */ jsx("polygon", { points: "12,5 14,12 12,19 10,12", fill: "currentColor" })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
function Cross(props) {
|
|
95
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", ...props, children: [
|
|
96
|
+
/* @__PURE__ */ jsx("line", { x1: "5", y1: "5", x2: "19", y2: "19" }),
|
|
97
|
+
/* @__PURE__ */ jsx("line", { x1: "19", y1: "5", x2: "5", y2: "19" })
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
function Eye(props) {
|
|
101
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
102
|
+
/* @__PURE__ */ jsx("path", { d: "M2 12c3-5 7-7 10-7s7 2 10 7c-3 5-7 7-10 7s-7-2-10-7z" }),
|
|
103
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
104
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" })
|
|
105
|
+
] });
|
|
106
|
+
}
|
|
107
|
+
function Feather(props) {
|
|
108
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
109
|
+
/* @__PURE__ */ jsx("path", { d: "M20 4c-8 0-14 6-14 14v2h2c8 0 14-6 14-14V4z" }),
|
|
110
|
+
/* @__PURE__ */ jsx("path", { d: "M6 20L20 6" })
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
function Fern(props) {
|
|
114
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", ...props, children: [
|
|
115
|
+
/* @__PURE__ */ jsx("path", { d: "M12 21V4" }),
|
|
116
|
+
/* @__PURE__ */ jsx("path", { d: "M12 4c-2 1-3 3-3 5" }),
|
|
117
|
+
/* @__PURE__ */ jsx("path", { d: "M12 9c-2 1-3 3-3 5" }),
|
|
118
|
+
/* @__PURE__ */ jsx("path", { d: "M12 14c-2 1-3 3-3 5" }),
|
|
119
|
+
/* @__PURE__ */ jsx("path", { d: "M12 6c2 1 3 3 3 5" }),
|
|
120
|
+
/* @__PURE__ */ jsx("path", { d: "M12 11c2 1 3 3 3 5" })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
function Flask(props) {
|
|
124
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
125
|
+
/* @__PURE__ */ jsx("path", { d: "M9 3h6" }),
|
|
126
|
+
/* @__PURE__ */ jsx("path", { d: "M10 3v6L5 19a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-10V3" }),
|
|
127
|
+
/* @__PURE__ */ jsx("path", { d: "M7 15h10" })
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
function Flourish(props) {
|
|
131
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 120 24", fill: "none", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", ...props, children: [
|
|
132
|
+
/* @__PURE__ */ jsx("path", { d: "M2 12 H42" }),
|
|
133
|
+
/* @__PURE__ */ jsx("path", { d: "M42 12 c4 -6 10 -6 14 0 c4 6 10 6 14 0" }),
|
|
134
|
+
/* @__PURE__ */ jsx("circle", { cx: "60", cy: "12", r: "1.4", fill: "currentColor" }),
|
|
135
|
+
/* @__PURE__ */ jsx("path", { d: "M78 12 H118" })
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
function Hand(props) {
|
|
139
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
140
|
+
/* @__PURE__ */ jsx("path", { d: "M8 21v-6l-3-3v-3a1 1 0 0 1 2 0v3" }),
|
|
141
|
+
/* @__PURE__ */ jsx("path", { d: "M8 12V5a1 1 0 0 1 2 0v6" }),
|
|
142
|
+
/* @__PURE__ */ jsx("path", { d: "M10 11V4a1 1 0 0 1 2 0v8" }),
|
|
143
|
+
/* @__PURE__ */ jsx("path", { d: "M12 12V6a1 1 0 0 1 2 0v8" }),
|
|
144
|
+
/* @__PURE__ */ jsx("path", { d: "M14 12v-3a1 1 0 0 1 2 0v9c0 2-2 4-4 4" })
|
|
145
|
+
] });
|
|
146
|
+
}
|
|
147
|
+
function Hex(props) {
|
|
148
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("polygon", { points: "12,3 21,8 21,16 12,21 3,16 3,8" }) });
|
|
149
|
+
}
|
|
150
|
+
function Key(props) {
|
|
151
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
152
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "12", r: "4" }),
|
|
153
|
+
/* @__PURE__ */ jsx("path", { d: "M11 12h11" }),
|
|
154
|
+
/* @__PURE__ */ jsx("path", { d: "M18 12v4" }),
|
|
155
|
+
/* @__PURE__ */ jsx("path", { d: "M22 12v3" })
|
|
156
|
+
] });
|
|
157
|
+
}
|
|
158
|
+
function Leaf(props) {
|
|
159
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
160
|
+
/* @__PURE__ */ jsx("path", { d: "M4 20c0-9 7-16 16-16 0 9-7 16-16 16z" }),
|
|
161
|
+
/* @__PURE__ */ jsx("path", { d: "M4 20l8-8" })
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
function Mark(props) {
|
|
165
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 80 80", fill: "currentColor", stroke: "currentColor", strokeLinejoin: "miter", strokeLinecap: "square", ...props, children: [
|
|
166
|
+
/* @__PURE__ */ jsx("polygon", { points: "40,4 72,22 72,58 40,76 8,58 8,22", fill: "none", strokeWidth: "6" }),
|
|
167
|
+
/* @__PURE__ */ jsx("polygon", { points: "40,12 56,32 24,32", stroke: "none" }),
|
|
168
|
+
/* @__PURE__ */ jsx("rect", { x: "33", y: "28", width: "14", height: "30", stroke: "none" }),
|
|
169
|
+
/* @__PURE__ */ jsx("polygon", { points: "24,50 33,58 33,52", stroke: "none" }),
|
|
170
|
+
/* @__PURE__ */ jsx("polygon", { points: "56,50 47,58 47,52", stroke: "none" })
|
|
171
|
+
] });
|
|
172
|
+
}
|
|
173
|
+
function Mercury(props) {
|
|
174
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
175
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "9", r: "5" }),
|
|
176
|
+
/* @__PURE__ */ jsx("path", { d: "M12 14v7" }),
|
|
177
|
+
/* @__PURE__ */ jsx("path", { d: "M8 18h8" }),
|
|
178
|
+
/* @__PURE__ */ jsx("path", { d: "M9 21h6" })
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
function Minus(props) {
|
|
182
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", ...props, children: /* @__PURE__ */ jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" }) });
|
|
183
|
+
}
|
|
184
|
+
function Moon(props) {
|
|
185
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("path", { d: "M16 4a8 8 0 1 0 0 16 6 6 0 0 1 0-16z" }) });
|
|
186
|
+
}
|
|
187
|
+
function Plus(props) {
|
|
188
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", ...props, children: [
|
|
189
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "4", x2: "12", y2: "20" }),
|
|
190
|
+
/* @__PURE__ */ jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" })
|
|
191
|
+
] });
|
|
192
|
+
}
|
|
193
|
+
function Salt(props) {
|
|
194
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
195
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "8" }),
|
|
196
|
+
/* @__PURE__ */ jsx("path", { d: "M4 12h16" })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
function Scroll(props) {
|
|
200
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", strokeLinecap: "round", ...props, children: [
|
|
201
|
+
/* @__PURE__ */ jsx("path", { d: "M5 6a2 2 0 0 1 4 0v12a2 2 0 0 0 4 0V8h6v10a3 3 0 0 1-3 3H7" }),
|
|
202
|
+
/* @__PURE__ */ jsx("path", { d: "M5 6v0a2 2 0 0 0 2 2h6" })
|
|
203
|
+
] });
|
|
204
|
+
}
|
|
205
|
+
function Sigil(props) {
|
|
206
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 48 48", fill: "none", stroke: "currentColor", strokeWidth: "1.2", ...props, children: [
|
|
207
|
+
/* @__PURE__ */ jsx("circle", { cx: "24", cy: "24", r: "20" }),
|
|
208
|
+
/* @__PURE__ */ jsx("circle", { cx: "24", cy: "24", r: "14" }),
|
|
209
|
+
/* @__PURE__ */ jsx("polygon", { points: "24,8 38,32 10,32" }),
|
|
210
|
+
/* @__PURE__ */ jsx("polygon", { points: "24,40 10,16 38,16" }),
|
|
211
|
+
/* @__PURE__ */ jsx("circle", { cx: "24", cy: "24", r: "3" })
|
|
212
|
+
] });
|
|
213
|
+
}
|
|
214
|
+
function Sprig(props) {
|
|
215
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", ...props, children: [
|
|
216
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3v18" }),
|
|
217
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7c-2-1-3-1-5-1 0 2 1 3 5 4" }),
|
|
218
|
+
/* @__PURE__ */ jsx("path", { d: "M12 11c2-1 3-1 5-1 0 2-1 3-5 4" }),
|
|
219
|
+
/* @__PURE__ */ jsx("path", { d: "M12 15c-2-1-3-1-5-1 0 2 1 3 5 4" })
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
function Square(props) {
|
|
223
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", ...props, children: /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16" }) });
|
|
224
|
+
}
|
|
225
|
+
function Star(props) {
|
|
226
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("polygon", { points: "12,3 14,10 21,10 15.5,14 17.5,21 12,17 6.5,21 8.5,14 3,10 10,10" }) });
|
|
227
|
+
}
|
|
228
|
+
function Sulfur(props) {
|
|
229
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
|
|
230
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3l4 6h-8z" }),
|
|
231
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "4" }),
|
|
232
|
+
/* @__PURE__ */ jsx("path", { d: "M12 18v3" }),
|
|
233
|
+
/* @__PURE__ */ jsx("path", { d: "M9 21h6" })
|
|
234
|
+
] });
|
|
235
|
+
}
|
|
236
|
+
function Sun(props) {
|
|
237
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", ...props, children: [
|
|
238
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "7" }),
|
|
239
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1.5", fill: "currentColor" })
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
function Tick(props) {
|
|
243
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("polyline", { points: "4,13 10,19 20,5" }) });
|
|
244
|
+
}
|
|
245
|
+
function TriangleDown(props) {
|
|
246
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("polygon", { points: "12,20 21,4 3,4" }) });
|
|
247
|
+
}
|
|
248
|
+
function Triangle(props) {
|
|
249
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("polygon", { points: "12,4 21,20 3,20" }) });
|
|
250
|
+
}
|
|
251
|
+
function Wordmark(props) {
|
|
252
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 320 80", fill: "currentColor", stroke: "currentColor", strokeLinejoin: "miter", strokeLinecap: "square", ...props, children: [
|
|
253
|
+
/* @__PURE__ */ jsxs("g", { transform: "translate(40,40) scale(0.72) translate(-40,-40)", children: [
|
|
254
|
+
/* @__PURE__ */ jsx("polygon", { points: "40,4 72,22 72,58 40,76 8,58 8,22", fill: "none", strokeWidth: "6" }),
|
|
255
|
+
/* @__PURE__ */ jsx("polygon", { points: "40,12 56,32 24,32", stroke: "none" }),
|
|
256
|
+
/* @__PURE__ */ jsx("rect", { x: "33", y: "28", width: "14", height: "30", stroke: "none" }),
|
|
257
|
+
/* @__PURE__ */ jsx("polygon", { points: "24,50 33,58 33,52", stroke: "none" }),
|
|
258
|
+
/* @__PURE__ */ jsx("polygon", { points: "56,50 47,58 47,52", stroke: "none" })
|
|
259
|
+
] }),
|
|
260
|
+
/* @__PURE__ */ jsx("g", { transform: "translate(82,52)", fontFamily: "'Roboto Slab', serif", fontWeight: "900", fontSize: "34", letterSpacing: "2", stroke: "none", children: /* @__PURE__ */ jsx("text", { x: "0", y: "0", children: "ACHERY" }) }),
|
|
261
|
+
/* @__PURE__ */ jsx("g", { transform: "translate(82,72)", fontFamily: "'Space Grotesk', sansSerif", fontWeight: "600", fontSize: "10", letterSpacing: "6", stroke: "none", children: /* @__PURE__ */ jsx("text", { x: "2", y: "0", children: "\u2014 W O R K S H O P \u2014" }) })
|
|
262
|
+
] });
|
|
263
|
+
}
|
|
264
|
+
var glyphMap = {
|
|
265
|
+
"arrow-right": ArrowRight,
|
|
266
|
+
"arrow-up": ArrowUp,
|
|
267
|
+
"asterism": Asterism,
|
|
268
|
+
"book": Book,
|
|
269
|
+
"circle": Circle,
|
|
270
|
+
"compass": Compass,
|
|
271
|
+
"cross": Cross,
|
|
272
|
+
"eye": Eye,
|
|
273
|
+
"feather": Feather,
|
|
274
|
+
"fern": Fern,
|
|
275
|
+
"flask": Flask,
|
|
276
|
+
"flourish": Flourish,
|
|
277
|
+
"hand": Hand,
|
|
278
|
+
"hex": Hex,
|
|
279
|
+
"key": Key,
|
|
280
|
+
"leaf": Leaf,
|
|
281
|
+
"mark": Mark,
|
|
282
|
+
"mercury": Mercury,
|
|
283
|
+
"minus": Minus,
|
|
284
|
+
"moon": Moon,
|
|
285
|
+
"plus": Plus,
|
|
286
|
+
"salt": Salt,
|
|
287
|
+
"scroll": Scroll,
|
|
288
|
+
"sigil": Sigil,
|
|
289
|
+
"sprig": Sprig,
|
|
290
|
+
"square": Square,
|
|
291
|
+
"star": Star,
|
|
292
|
+
"sulfur": Sulfur,
|
|
293
|
+
"sun": Sun,
|
|
294
|
+
"tick": Tick,
|
|
295
|
+
"triangle": Triangle,
|
|
296
|
+
"triangle-down": TriangleDown,
|
|
297
|
+
"wordmark": Wordmark
|
|
298
|
+
};
|
|
299
|
+
function Glyph({ name, size = 16, title: title2, className, style, ...props }) {
|
|
300
|
+
const SvgComponent = glyphMap[name];
|
|
301
|
+
if (!SvgComponent) {
|
|
302
|
+
return /* @__PURE__ */ jsx(
|
|
303
|
+
"span",
|
|
304
|
+
{
|
|
305
|
+
className: [glyph, className].filter(Boolean).join(" "),
|
|
306
|
+
style: { width: size, height: size, display: "inline-block", ...style },
|
|
307
|
+
"aria-hidden": "true"
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
return /* @__PURE__ */ jsx(
|
|
312
|
+
SvgComponent,
|
|
313
|
+
{
|
|
314
|
+
width: size,
|
|
315
|
+
height: size,
|
|
316
|
+
"aria-hidden": title2 ? void 0 : true,
|
|
317
|
+
"aria-label": title2,
|
|
318
|
+
className: [glyph, className].filter(Boolean).join(" "),
|
|
319
|
+
style,
|
|
320
|
+
...props
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// src/components/Typography/Typography.css.ts
|
|
326
|
+
var body = "Typography_body__1v4lwgr6";
|
|
327
|
+
var bodyLead = "Typography_bodyLead__1v4lwgr7";
|
|
328
|
+
var bodySmall = "Typography_bodySmall__1v4lwgr8";
|
|
329
|
+
var display = "Typography_display__1v4lwgr0";
|
|
330
|
+
var h1 = "Typography_h1__1v4lwgr1";
|
|
331
|
+
var h2 = "Typography_h2__1v4lwgr2";
|
|
332
|
+
var h3 = "Typography_h3__1v4lwgr3";
|
|
333
|
+
var h4 = "Typography_h4__1v4lwgr4";
|
|
334
|
+
var h5 = "Typography_h5__1v4lwgr5";
|
|
335
|
+
var mono = "Typography_mono__1v4lwgr9";
|
|
336
|
+
var monoSmall = "Typography_monoSmall__1v4lwgra";
|
|
337
|
+
function Display({ as: Tag = "p", className, children, ...props }) {
|
|
338
|
+
return /* @__PURE__ */ jsx(Tag, { className: [display, className].filter(Boolean).join(" "), ...props, children });
|
|
339
|
+
}
|
|
340
|
+
var headingStyles = {
|
|
341
|
+
1: h1,
|
|
342
|
+
2: h2,
|
|
343
|
+
3: h3,
|
|
344
|
+
4: h4,
|
|
345
|
+
5: h5
|
|
346
|
+
};
|
|
347
|
+
function Heading({ level = 1, className, children, ...props }) {
|
|
348
|
+
const Tag = `h${level}`;
|
|
349
|
+
const style = headingStyles[level];
|
|
350
|
+
return /* @__PURE__ */ jsx(Tag, { className: [style, className].filter(Boolean).join(" "), ...props, children });
|
|
351
|
+
}
|
|
352
|
+
var bodyStyles = {
|
|
353
|
+
base: body,
|
|
354
|
+
lead: bodyLead,
|
|
355
|
+
small: bodySmall
|
|
356
|
+
};
|
|
357
|
+
function Body({ variant = "base", className, children, ...props }) {
|
|
358
|
+
return /* @__PURE__ */ jsx("p", { className: [bodyStyles[variant], className].filter(Boolean).join(" "), ...props, children });
|
|
359
|
+
}
|
|
360
|
+
function Mono({ variant = "base", as: Tag = "span", className, children, ...props }) {
|
|
361
|
+
const s = variant === "small" ? monoSmall : mono;
|
|
362
|
+
return /* @__PURE__ */ jsx(Tag, { className: [s, className].filter(Boolean).join(" "), ...props, children });
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/components/Eyebrow/Eyebrow.css.ts
|
|
366
|
+
var count = "Eyebrow_count__b8rlr31";
|
|
367
|
+
var eyebrow = "Eyebrow_eyebrow__b8rlr30";
|
|
368
|
+
function Eyebrow({ children, count: count2, after, className, ...props }) {
|
|
369
|
+
return /* @__PURE__ */ jsxs("span", { className: [eyebrow, className].filter(Boolean).join(" "), ...props, children: [
|
|
370
|
+
children,
|
|
371
|
+
count2 !== void 0 && /* @__PURE__ */ jsx("span", { className: count, children: count2 }),
|
|
372
|
+
after
|
|
373
|
+
] });
|
|
374
|
+
}
|
|
375
|
+
var badge = createRuntimeFn({ defaultClassName: "Badge_badge__1ir6yu20", variantClassNames: { tone: { saved: "Badge_badge_tone_saved__1ir6yu21", drafting: "Badge_badge_tone_drafting__1ir6yu22", stopped: "Badge_badge_tone_stopped__1ir6yu23", archived: "Badge_badge_tone_archived__1ir6yu24", neutral: "Badge_badge_tone_neutral__1ir6yu25", success: "Badge_badge_tone_success__1ir6yu26", warn: "Badge_badge_tone_warn__1ir6yu27", danger: "Badge_badge_tone_danger__1ir6yu28", info: "Badge_badge_tone_info__1ir6yu29" }, variant: { outline: "Badge_badge_variant_outline__1ir6yu2a", solid: "Badge_badge_variant_solid__1ir6yu2b", pill: "Badge_badge_variant_pill__1ir6yu2c" } }, defaultVariants: { tone: "neutral", variant: "outline" }, compoundVariants: [[{ tone: "saved", variant: "outline" }, "Badge_badge_compound_0__1ir6yu2d"], [{ tone: "saved", variant: "solid" }, "Badge_badge_compound_1__1ir6yu2e"], [{ tone: "saved", variant: "pill" }, "Badge_badge_compound_2__1ir6yu2f"], [{ tone: "drafting", variant: "outline" }, "Badge_badge_compound_3__1ir6yu2g"], [{ tone: "drafting", variant: "solid" }, "Badge_badge_compound_4__1ir6yu2h"], [{ tone: "drafting", variant: "pill" }, "Badge_badge_compound_5__1ir6yu2i"], [{ tone: "stopped", variant: "outline" }, "Badge_badge_compound_6__1ir6yu2j"], [{ tone: "stopped", variant: "solid" }, "Badge_badge_compound_7__1ir6yu2k"], [{ tone: "stopped", variant: "pill" }, "Badge_badge_compound_8__1ir6yu2l"], [{ tone: "archived", variant: "outline" }, "Badge_badge_compound_9__1ir6yu2m"], [{ tone: "archived", variant: "solid" }, "Badge_badge_compound_10__1ir6yu2n"], [{ tone: "archived", variant: "pill" }, "Badge_badge_compound_11__1ir6yu2o"], [{ tone: "neutral", variant: "outline" }, "Badge_badge_compound_12__1ir6yu2p"], [{ tone: "neutral", variant: "solid" }, "Badge_badge_compound_13__1ir6yu2q"], [{ tone: "neutral", variant: "pill" }, "Badge_badge_compound_14__1ir6yu2r"], [{ tone: "success", variant: "outline" }, "Badge_badge_compound_15__1ir6yu2s"], [{ tone: "success", variant: "solid" }, "Badge_badge_compound_16__1ir6yu2t"], [{ tone: "success", variant: "pill" }, "Badge_badge_compound_17__1ir6yu2u"], [{ tone: "warn", variant: "outline" }, "Badge_badge_compound_18__1ir6yu2v"], [{ tone: "warn", variant: "solid" }, "Badge_badge_compound_19__1ir6yu2w"], [{ tone: "warn", variant: "pill" }, "Badge_badge_compound_20__1ir6yu2x"], [{ tone: "danger", variant: "outline" }, "Badge_badge_compound_21__1ir6yu2y"], [{ tone: "danger", variant: "solid" }, "Badge_badge_compound_22__1ir6yu2z"], [{ tone: "danger", variant: "pill" }, "Badge_badge_compound_23__1ir6yu210"], [{ tone: "info", variant: "outline" }, "Badge_badge_compound_24__1ir6yu211"], [{ tone: "info", variant: "solid" }, "Badge_badge_compound_25__1ir6yu212"], [{ tone: "info", variant: "pill" }, "Badge_badge_compound_26__1ir6yu213"]] });
|
|
376
|
+
var dot = "Badge_dot__1ir6yu214";
|
|
377
|
+
function Badge({
|
|
378
|
+
tone = "neutral",
|
|
379
|
+
variant = "outline",
|
|
380
|
+
dot: dot2 = false,
|
|
381
|
+
children,
|
|
382
|
+
className,
|
|
383
|
+
...props
|
|
384
|
+
}) {
|
|
385
|
+
return /* @__PURE__ */ jsxs(
|
|
386
|
+
"span",
|
|
387
|
+
{
|
|
388
|
+
className: [badge({ tone, variant }), className].filter(Boolean).join(" "),
|
|
389
|
+
...props,
|
|
390
|
+
children: [
|
|
391
|
+
dot2 && /* @__PURE__ */ jsx("span", { className: dot, "aria-hidden": "true" }),
|
|
392
|
+
children
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
var button = createRuntimeFn({ defaultClassName: "Button_button__1torrqc0", variantClassNames: { variant: { primary: "Button_button_variant_primary__1torrqc1", secondary: "Button_button_variant_secondary__1torrqc2", accent: "Button_button_variant_accent__1torrqc3", ghost: "Button_button_variant_ghost__1torrqc4", danger: "Button_button_variant_danger__1torrqc5" }, size: { sm: "Button_button_size_sm__1torrqc6", md: "Button_button_size_md__1torrqc7" } }, defaultVariants: { variant: "secondary", size: "md" }, compoundVariants: [] });
|
|
398
|
+
var kbdHint = "Button_kbdHint__1torrqc8";
|
|
399
|
+
function Button({
|
|
400
|
+
variant = "secondary",
|
|
401
|
+
size = "md",
|
|
402
|
+
glyph: glyph2,
|
|
403
|
+
glyphPosition = "start",
|
|
404
|
+
kbd,
|
|
405
|
+
children,
|
|
406
|
+
className,
|
|
407
|
+
...props
|
|
408
|
+
}) {
|
|
409
|
+
const glyphSize = size === "sm" ? 12 : 14;
|
|
410
|
+
return /* @__PURE__ */ jsxs(
|
|
411
|
+
"button",
|
|
412
|
+
{
|
|
413
|
+
className: [button({ variant, size }), className].filter(Boolean).join(" "),
|
|
414
|
+
...props,
|
|
415
|
+
children: [
|
|
416
|
+
glyph2 && glyphPosition === "start" && /* @__PURE__ */ jsx(Glyph, { name: glyph2, size: glyphSize, "aria-hidden": "true" }),
|
|
417
|
+
children,
|
|
418
|
+
glyph2 && glyphPosition === "end" && /* @__PURE__ */ jsx(Glyph, { name: glyph2, size: glyphSize, "aria-hidden": "true" }),
|
|
419
|
+
kbd && /* @__PURE__ */ jsx("span", { className: kbdHint, children: kbd })
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// src/components/Toggle/Toggle.css.ts
|
|
426
|
+
var label = "Toggle_label__trpmwc3";
|
|
427
|
+
var thumb = "Toggle_thumb__trpmwc1";
|
|
428
|
+
var track = "Toggle_track__trpmwc0";
|
|
429
|
+
var wrapper = "Toggle_wrapper__trpmwc2";
|
|
430
|
+
function Toggle({
|
|
431
|
+
pressed,
|
|
432
|
+
defaultPressed,
|
|
433
|
+
onPressedChange,
|
|
434
|
+
disabled,
|
|
435
|
+
label: label3,
|
|
436
|
+
className,
|
|
437
|
+
"aria-label": ariaLabel
|
|
438
|
+
}) {
|
|
439
|
+
return /* @__PURE__ */ jsxs("span", { className: [wrapper, className].filter(Boolean).join(" "), children: [
|
|
440
|
+
/* @__PURE__ */ jsx(
|
|
441
|
+
RadixToggle.Root,
|
|
442
|
+
{
|
|
443
|
+
...pressed !== void 0 ? { pressed } : {},
|
|
444
|
+
...defaultPressed !== void 0 ? { defaultPressed } : {},
|
|
445
|
+
...onPressedChange !== void 0 ? { onPressedChange } : {},
|
|
446
|
+
...disabled !== void 0 ? { disabled } : {},
|
|
447
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : {},
|
|
448
|
+
className: track,
|
|
449
|
+
children: /* @__PURE__ */ jsx("span", { className: thumb })
|
|
450
|
+
}
|
|
451
|
+
),
|
|
452
|
+
label3 && /* @__PURE__ */ jsx("span", { className: label, children: label3 })
|
|
453
|
+
] });
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// src/components/Marginalia/Marginalia.css.ts
|
|
457
|
+
var marginalia = "Marginalia_marginalia__elc29z0";
|
|
458
|
+
function Marginalia({
|
|
459
|
+
glyph: glyph2 = "fern",
|
|
460
|
+
size = 120,
|
|
461
|
+
opacity = 0.4,
|
|
462
|
+
className,
|
|
463
|
+
style
|
|
464
|
+
}) {
|
|
465
|
+
return /* @__PURE__ */ jsx(
|
|
466
|
+
Glyph,
|
|
467
|
+
{
|
|
468
|
+
name: glyph2,
|
|
469
|
+
size,
|
|
470
|
+
className: [marginalia, className].filter(Boolean).join(" "),
|
|
471
|
+
style: { opacity, ...style },
|
|
472
|
+
"aria-hidden": "true"
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// src/components/Input/Input.css.ts
|
|
478
|
+
var errorText = "Input_errorText__6w3tie3";
|
|
479
|
+
var fieldRoot = "Input_fieldRoot__6w3tie0";
|
|
480
|
+
var hint = "Input_hint__6w3tie2";
|
|
481
|
+
var inputBase = "Input_inputBase__6w3tie4";
|
|
482
|
+
var inputError = "Input_inputError__6w3tie5";
|
|
483
|
+
var label2 = "Input_label__6w3tie1";
|
|
484
|
+
var searchIcon = "Input_searchIcon__6w3tie9";
|
|
485
|
+
var searchInput = "Input_searchInput__6w3tiea Input_inputBase__6w3tie4";
|
|
486
|
+
var searchWrapper = "Input_searchWrapper__6w3tie8";
|
|
487
|
+
var selectInput = "Input_selectInput__6w3tie7 Input_inputBase__6w3tie4";
|
|
488
|
+
var textarea = "Input_textarea__6w3tie6 Input_inputBase__6w3tie4";
|
|
489
|
+
function Field({ label: label3, hint: hint2, error, children, className }) {
|
|
490
|
+
return /* @__PURE__ */ jsxs("div", { className: [fieldRoot, className].filter(Boolean).join(" "), children: [
|
|
491
|
+
label3 && /* @__PURE__ */ jsx("label", { className: label2, children: label3 }),
|
|
492
|
+
children,
|
|
493
|
+
error && /* @__PURE__ */ jsx("span", { className: errorText, children: error }),
|
|
494
|
+
!error && hint2 && /* @__PURE__ */ jsx("span", { className: hint, children: hint2 })
|
|
495
|
+
] });
|
|
496
|
+
}
|
|
497
|
+
function Input({ error, className, ...props }) {
|
|
498
|
+
return /* @__PURE__ */ jsx(
|
|
499
|
+
"input",
|
|
500
|
+
{
|
|
501
|
+
className: [inputBase, error && inputError, className].filter(Boolean).join(" "),
|
|
502
|
+
...props
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
function Textarea({ error, className, ...props }) {
|
|
507
|
+
return /* @__PURE__ */ jsx(
|
|
508
|
+
"textarea",
|
|
509
|
+
{
|
|
510
|
+
className: [textarea, error && inputError, className].filter(Boolean).join(" "),
|
|
511
|
+
...props
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
function Select({ error, children, className, ...props }) {
|
|
516
|
+
return /* @__PURE__ */ jsx(
|
|
517
|
+
"select",
|
|
518
|
+
{
|
|
519
|
+
className: [selectInput, error && inputError, className].filter(Boolean).join(" "),
|
|
520
|
+
...props,
|
|
521
|
+
children
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
function SearchInput({ className, ...props }) {
|
|
526
|
+
return /* @__PURE__ */ jsxs("div", { className: [searchWrapper, className].filter(Boolean).join(" "), children: [
|
|
527
|
+
/* @__PURE__ */ jsx(Glyph, { name: "compass", size: 12, className: searchIcon, "aria-hidden": "true" }),
|
|
528
|
+
/* @__PURE__ */ jsx(
|
|
529
|
+
"input",
|
|
530
|
+
{
|
|
531
|
+
type: "search",
|
|
532
|
+
className: searchInput,
|
|
533
|
+
...props
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
] });
|
|
537
|
+
}
|
|
538
|
+
var card = createRuntimeFn({ defaultClassName: "Card_card__1uprgrr0", variantClassNames: { variant: { flat: "Card_card_variant_flat__1uprgrr1", stamp: "Card_card_variant_stamp__1uprgrr2", stampLg: "Card_card_variant_stampLg__1uprgrr3" }, padding: { none: "Card_card_padding_none__1uprgrr4", sm: "Card_card_padding_sm__1uprgrr5", md: "Card_card_padding_md__1uprgrr6", lg: "Card_card_padding_lg__1uprgrr7" } }, defaultVariants: { variant: "flat", padding: "md" }, compoundVariants: [] });
|
|
539
|
+
var cardHeader = "Card_cardHeader__1uprgrr8";
|
|
540
|
+
function Card({
|
|
541
|
+
variant = "flat",
|
|
542
|
+
padding = "md",
|
|
543
|
+
header: header2,
|
|
544
|
+
marginalia: marginalia2,
|
|
545
|
+
marginaliaSize = 80,
|
|
546
|
+
children,
|
|
547
|
+
className,
|
|
548
|
+
...props
|
|
549
|
+
}) {
|
|
550
|
+
return /* @__PURE__ */ jsxs(
|
|
551
|
+
"div",
|
|
552
|
+
{
|
|
553
|
+
className: [card({ variant, padding }), className].filter(Boolean).join(" "),
|
|
554
|
+
...props,
|
|
555
|
+
children: [
|
|
556
|
+
header2 && /* @__PURE__ */ jsx("div", { className: cardHeader, children: header2 }),
|
|
557
|
+
children,
|
|
558
|
+
marginalia2 && /* @__PURE__ */ jsx(Marginalia, { glyph: marginalia2, size: marginaliaSize })
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// src/components/Tabs/Tabs.css.ts
|
|
565
|
+
var tab = "Tabs_tab__1b0xj9v1";
|
|
566
|
+
var tabList = "Tabs_tabList__1b0xj9v0";
|
|
567
|
+
var tabPanel = "Tabs_tabPanel__1b0xj9v2";
|
|
568
|
+
function Tabs({ items, value, defaultValue, onValueChange, className }) {
|
|
569
|
+
const resolvedDefault = defaultValue ?? items[0]?.value;
|
|
570
|
+
return /* @__PURE__ */ jsxs(
|
|
571
|
+
RadixTabs.Root,
|
|
572
|
+
{
|
|
573
|
+
...value !== void 0 ? { value } : {},
|
|
574
|
+
...resolvedDefault != null ? { defaultValue: resolvedDefault } : {},
|
|
575
|
+
...onValueChange !== void 0 ? { onValueChange } : {},
|
|
576
|
+
...className !== void 0 ? { className } : {},
|
|
577
|
+
children: [
|
|
578
|
+
/* @__PURE__ */ jsx(RadixTabs.List, { className: tabList, children: items.map((item) => /* @__PURE__ */ jsx(
|
|
579
|
+
RadixTabs.Trigger,
|
|
580
|
+
{
|
|
581
|
+
value: item.value,
|
|
582
|
+
disabled: item.disabled,
|
|
583
|
+
className: tab,
|
|
584
|
+
children: item.label
|
|
585
|
+
},
|
|
586
|
+
item.value
|
|
587
|
+
)) }),
|
|
588
|
+
items.map((item) => /* @__PURE__ */ jsx(
|
|
589
|
+
RadixTabs.Content,
|
|
590
|
+
{
|
|
591
|
+
value: item.value,
|
|
592
|
+
className: tabPanel,
|
|
593
|
+
children: item.content
|
|
594
|
+
},
|
|
595
|
+
item.value
|
|
596
|
+
))
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// src/components/Tooltip/Tooltip.css.ts
|
|
603
|
+
var content = "Tooltip_content__o34woq1";
|
|
604
|
+
function Tooltip({
|
|
605
|
+
content: tooltipContent,
|
|
606
|
+
children,
|
|
607
|
+
side = "top",
|
|
608
|
+
delayDuration = 400,
|
|
609
|
+
open,
|
|
610
|
+
defaultOpen,
|
|
611
|
+
onOpenChange
|
|
612
|
+
}) {
|
|
613
|
+
return /* @__PURE__ */ jsx(RadixTooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(
|
|
614
|
+
RadixTooltip.Root,
|
|
615
|
+
{
|
|
616
|
+
...open !== void 0 ? { open } : {},
|
|
617
|
+
...defaultOpen !== void 0 ? { defaultOpen } : {},
|
|
618
|
+
...onOpenChange !== void 0 ? { onOpenChange } : {},
|
|
619
|
+
children: [
|
|
620
|
+
/* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, children }),
|
|
621
|
+
/* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx(
|
|
622
|
+
RadixTooltip.Content,
|
|
623
|
+
{
|
|
624
|
+
side,
|
|
625
|
+
sideOffset: 6,
|
|
626
|
+
className: content,
|
|
627
|
+
children: tooltipContent
|
|
628
|
+
}
|
|
629
|
+
) })
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
) });
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// src/components/Sidebar/Sidebar.css.ts
|
|
636
|
+
var footer = "Sidebar_footer__1n0xxfc5";
|
|
637
|
+
var group = "Sidebar_group__1n0xxfc1";
|
|
638
|
+
var groupLabel = "Sidebar_groupLabel__1n0xxfc2";
|
|
639
|
+
var navItem = "Sidebar_navItem__1n0xxfc3";
|
|
640
|
+
var navItemCount = "Sidebar_navItemCount__1n0xxfc4";
|
|
641
|
+
var sidebar = "Sidebar_sidebar__1n0xxfc0";
|
|
642
|
+
function Sidebar({ groups, activeId, onItemClick, footer: footer3, className }) {
|
|
643
|
+
return /* @__PURE__ */ jsxs("nav", { className: [sidebar, className].filter(Boolean).join(" "), children: [
|
|
644
|
+
groups.map((group2, i) => /* @__PURE__ */ jsx(
|
|
645
|
+
NavGroup,
|
|
646
|
+
{
|
|
647
|
+
label: group2.label,
|
|
648
|
+
items: group2.items,
|
|
649
|
+
activeId,
|
|
650
|
+
onItemClick
|
|
651
|
+
},
|
|
652
|
+
i
|
|
653
|
+
)),
|
|
654
|
+
footer3 && /* @__PURE__ */ jsx("div", { className: footer, children: footer3 })
|
|
655
|
+
] });
|
|
656
|
+
}
|
|
657
|
+
function NavGroup({ label: label3, items, activeId, onItemClick }) {
|
|
658
|
+
return /* @__PURE__ */ jsxs("div", { className: group, children: [
|
|
659
|
+
label3 && /* @__PURE__ */ jsx("span", { className: groupLabel, children: label3 }),
|
|
660
|
+
items.map((item) => /* @__PURE__ */ jsx(
|
|
661
|
+
NavItem,
|
|
662
|
+
{
|
|
663
|
+
item,
|
|
664
|
+
active: item.id === activeId,
|
|
665
|
+
onClick: () => onItemClick?.(item.id)
|
|
666
|
+
},
|
|
667
|
+
item.id
|
|
668
|
+
))
|
|
669
|
+
] });
|
|
670
|
+
}
|
|
671
|
+
function NavItem({ item, active, onClick }) {
|
|
672
|
+
const glyphStyle = active ? { filter: "invert(1)" } : void 0;
|
|
673
|
+
if (item.href) {
|
|
674
|
+
return /* @__PURE__ */ jsxs(
|
|
675
|
+
"a",
|
|
676
|
+
{
|
|
677
|
+
href: item.href,
|
|
678
|
+
className: navItem,
|
|
679
|
+
"data-active": active,
|
|
680
|
+
"aria-current": active ? "page" : void 0,
|
|
681
|
+
children: [
|
|
682
|
+
item.glyph ? /* @__PURE__ */ jsx(Glyph, { name: item.glyph, size: 14, style: glyphStyle, "aria-hidden": "true" }) : /* @__PURE__ */ jsx("span", {}),
|
|
683
|
+
/* @__PURE__ */ jsx("span", { children: item.label }),
|
|
684
|
+
item.count !== void 0 && /* @__PURE__ */ jsx("span", { className: navItemCount, children: item.count })
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
return /* @__PURE__ */ jsxs(
|
|
690
|
+
"button",
|
|
691
|
+
{
|
|
692
|
+
className: navItem,
|
|
693
|
+
"data-active": active,
|
|
694
|
+
onClick,
|
|
695
|
+
"aria-current": active ? "page" : void 0,
|
|
696
|
+
children: [
|
|
697
|
+
item.glyph ? /* @__PURE__ */ jsx(Glyph, { name: item.glyph, size: 14, style: glyphStyle, "aria-hidden": "true" }) : /* @__PURE__ */ jsx("span", {}),
|
|
698
|
+
/* @__PURE__ */ jsx("span", { children: item.label }),
|
|
699
|
+
item.count !== void 0 && /* @__PURE__ */ jsx("span", { className: navItemCount, children: item.count })
|
|
700
|
+
]
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// src/components/AppBar/AppBar.css.ts
|
|
706
|
+
var accentPicker = "AppBar_accentPicker__uqki999";
|
|
707
|
+
var accentSwatch = "AppBar_accentSwatch__uqki99a";
|
|
708
|
+
var actions = "AppBar_actions__uqki998";
|
|
709
|
+
var appBar = "AppBar_appBar__uqki990";
|
|
710
|
+
var avatar = "AppBar_avatar__uqki99b";
|
|
711
|
+
var brand = "AppBar_brand__uqki991";
|
|
712
|
+
var brandDivider = "AppBar_brandDivider__uqki993";
|
|
713
|
+
var brandName = "AppBar_brandName__uqki992";
|
|
714
|
+
var brandSub = "AppBar_brandSub__uqki994";
|
|
715
|
+
var searchArea = "AppBar_searchArea__uqki995";
|
|
716
|
+
var searchInput2 = "AppBar_searchInput__uqki996";
|
|
717
|
+
var searchKbd = "AppBar_searchKbd__uqki997";
|
|
718
|
+
function AppBar({
|
|
719
|
+
brandName: brandName2 = "Achery",
|
|
720
|
+
brandSub: brandSub2,
|
|
721
|
+
showSearch = true,
|
|
722
|
+
searchPlaceholder = "Search\u2026",
|
|
723
|
+
searchKbd: searchKbd2,
|
|
724
|
+
actions: actions2,
|
|
725
|
+
accent = "terracotta",
|
|
726
|
+
onAccentChange,
|
|
727
|
+
onToggleTheme,
|
|
728
|
+
isDark,
|
|
729
|
+
avatarInitials,
|
|
730
|
+
onNewClick,
|
|
731
|
+
className
|
|
732
|
+
}) {
|
|
733
|
+
return /* @__PURE__ */ jsxs("header", { className: [appBar, className].filter(Boolean).join(" "), children: [
|
|
734
|
+
/* @__PURE__ */ jsxs("div", { className: brand, children: [
|
|
735
|
+
/* @__PURE__ */ jsx(Glyph, { name: "hex", size: 20, "aria-hidden": "true" }),
|
|
736
|
+
/* @__PURE__ */ jsx("span", { className: brandName, children: brandName2 }),
|
|
737
|
+
brandSub2 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
738
|
+
/* @__PURE__ */ jsx("span", { className: brandDivider }),
|
|
739
|
+
/* @__PURE__ */ jsx("span", { className: brandSub, children: brandSub2 })
|
|
740
|
+
] })
|
|
741
|
+
] }),
|
|
742
|
+
showSearch && /* @__PURE__ */ jsxs("div", { className: searchArea, children: [
|
|
743
|
+
/* @__PURE__ */ jsx(Glyph, { name: "compass", size: 12, "aria-hidden": "true" }),
|
|
744
|
+
/* @__PURE__ */ jsx(
|
|
745
|
+
"input",
|
|
746
|
+
{
|
|
747
|
+
type: "search",
|
|
748
|
+
placeholder: searchPlaceholder,
|
|
749
|
+
className: searchInput2,
|
|
750
|
+
"aria-label": "Search"
|
|
751
|
+
}
|
|
752
|
+
),
|
|
753
|
+
searchKbd2 && /* @__PURE__ */ jsx("span", { className: searchKbd, children: searchKbd2 })
|
|
754
|
+
] }),
|
|
755
|
+
/* @__PURE__ */ jsxs("div", { className: actions, children: [
|
|
756
|
+
onAccentChange && /* @__PURE__ */ jsx("div", { className: accentPicker, role: "group", "aria-label": "Brand colour", children: accentColorNames.map((name) => /* @__PURE__ */ jsx(
|
|
757
|
+
"button",
|
|
758
|
+
{
|
|
759
|
+
className: accentSwatch,
|
|
760
|
+
"data-active": name === accent,
|
|
761
|
+
onClick: () => onAccentChange(name),
|
|
762
|
+
"aria-label": name,
|
|
763
|
+
"aria-pressed": name === accent,
|
|
764
|
+
style: { background: accentColors[name].main }
|
|
765
|
+
},
|
|
766
|
+
name
|
|
767
|
+
)) }),
|
|
768
|
+
onToggleTheme && /* @__PURE__ */ jsx(
|
|
769
|
+
Button,
|
|
770
|
+
{
|
|
771
|
+
variant: "ghost",
|
|
772
|
+
size: "sm",
|
|
773
|
+
glyph: isDark ? "sun" : "moon",
|
|
774
|
+
onClick: onToggleTheme,
|
|
775
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode"
|
|
776
|
+
}
|
|
777
|
+
),
|
|
778
|
+
onNewClick && /* @__PURE__ */ jsx(Button, { variant: "accent", size: "sm", glyph: "plus", onClick: onNewClick, children: "New" }),
|
|
779
|
+
actions2,
|
|
780
|
+
avatarInitials && /* @__PURE__ */ jsx("div", { className: avatar, "aria-label": `User: ${avatarInitials}`, children: avatarInitials.slice(0, 2).toUpperCase() })
|
|
781
|
+
] })
|
|
782
|
+
] });
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/components/Table/Table.css.ts
|
|
786
|
+
var sortIndicator = "Table_sortIndicator__1a2tbys5";
|
|
787
|
+
var table = "Table_table__1a2tbys1";
|
|
788
|
+
var tableWrapper = "Table_tableWrapper__1a2tbys0";
|
|
789
|
+
var td = "Table_td__1a2tbys7";
|
|
790
|
+
var tdMono = "Table_tdMono__1a2tbys8 Table_td__1a2tbys7";
|
|
791
|
+
var th = "Table_th__1a2tbys3";
|
|
792
|
+
var thSortable = "Table_thSortable__1a2tbys4 Table_th__1a2tbys3";
|
|
793
|
+
var thead = "Table_thead__1a2tbys2";
|
|
794
|
+
var tr = "Table_tr__1a2tbys6";
|
|
795
|
+
function Table({
|
|
796
|
+
columns,
|
|
797
|
+
data,
|
|
798
|
+
rowKey,
|
|
799
|
+
selectedKeys,
|
|
800
|
+
onRowClick,
|
|
801
|
+
sortKey: controlledSortKey,
|
|
802
|
+
sortDir: controlledSortDir,
|
|
803
|
+
defaultSortKey,
|
|
804
|
+
defaultSortDir = null,
|
|
805
|
+
onSortChange,
|
|
806
|
+
className
|
|
807
|
+
}) {
|
|
808
|
+
const [internalSortKey, setInternalSortKey] = useState(defaultSortKey ?? null);
|
|
809
|
+
const [internalSortDir, setInternalSortDir] = useState(defaultSortDir);
|
|
810
|
+
const isControlled = controlledSortKey !== void 0;
|
|
811
|
+
const activeSortKey = isControlled ? controlledSortKey ?? null : internalSortKey;
|
|
812
|
+
const activeSortDir = isControlled ? controlledSortDir ?? null : internalSortDir;
|
|
813
|
+
const handleSort = (key) => {
|
|
814
|
+
let nextDir;
|
|
815
|
+
if (activeSortKey === key) {
|
|
816
|
+
nextDir = activeSortDir === "asc" ? "desc" : activeSortDir === "desc" ? null : "asc";
|
|
817
|
+
} else {
|
|
818
|
+
nextDir = "asc";
|
|
819
|
+
}
|
|
820
|
+
const nextKey = nextDir === null ? null : key;
|
|
821
|
+
if (!isControlled) {
|
|
822
|
+
setInternalSortKey(nextKey);
|
|
823
|
+
setInternalSortDir(nextDir);
|
|
824
|
+
}
|
|
825
|
+
onSortChange?.(key, nextDir);
|
|
826
|
+
};
|
|
827
|
+
const sortedData = useMemo(() => {
|
|
828
|
+
if (!activeSortKey || !activeSortDir) return data;
|
|
829
|
+
return [...data].sort((a, b) => {
|
|
830
|
+
const av = a[activeSortKey];
|
|
831
|
+
const bv = b[activeSortKey];
|
|
832
|
+
const cmp = String(av ?? "").localeCompare(String(bv ?? ""), void 0, { numeric: true });
|
|
833
|
+
return activeSortDir === "asc" ? cmp : -cmp;
|
|
834
|
+
});
|
|
835
|
+
}, [data, activeSortKey, activeSortDir]);
|
|
836
|
+
return /* @__PURE__ */ jsx("div", { className: [tableWrapper, className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("table", { className: table, children: [
|
|
837
|
+
/* @__PURE__ */ jsx("thead", { className: thead, children: /* @__PURE__ */ jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxs(
|
|
838
|
+
"th",
|
|
839
|
+
{
|
|
840
|
+
className: col.sortable ? thSortable : th,
|
|
841
|
+
style: col.width ? { width: col.width } : void 0,
|
|
842
|
+
onClick: col.sortable ? () => handleSort(col.key) : void 0,
|
|
843
|
+
"aria-sort": activeSortKey === col.key ? activeSortDir === "asc" ? "ascending" : "descending" : void 0,
|
|
844
|
+
children: [
|
|
845
|
+
col.label,
|
|
846
|
+
col.sortable && activeSortKey === col.key && activeSortDir && /* @__PURE__ */ jsx("span", { className: sortIndicator, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Glyph, { name: activeSortDir === "asc" ? "arrow-up" : "arrow-right", size: 10 }) })
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
col.key
|
|
850
|
+
)) }) }),
|
|
851
|
+
/* @__PURE__ */ jsx("tbody", { children: sortedData.map((row) => {
|
|
852
|
+
const key = rowKey(row);
|
|
853
|
+
const isSelected = selectedKeys?.includes(key) ?? false;
|
|
854
|
+
return /* @__PURE__ */ jsx(
|
|
855
|
+
"tr",
|
|
856
|
+
{
|
|
857
|
+
className: tr,
|
|
858
|
+
"data-selected": isSelected,
|
|
859
|
+
onClick: onRowClick ? () => onRowClick(key, row) : void 0,
|
|
860
|
+
style: onRowClick ? { cursor: "pointer" } : void 0,
|
|
861
|
+
children: columns.map((col) => /* @__PURE__ */ jsx("td", { className: col.mono ? tdMono : td, children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key))
|
|
862
|
+
},
|
|
863
|
+
key
|
|
864
|
+
);
|
|
865
|
+
}) })
|
|
866
|
+
] }) });
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// src/components/Modal/Modal.css.ts
|
|
870
|
+
var body2 = "Modal_body__1kcb5si8";
|
|
871
|
+
var closeButton = "Modal_closeButton__1kcb5si7";
|
|
872
|
+
var content2 = "Modal_content__1kcb5si3";
|
|
873
|
+
var description = "Modal_description__1kcb5si6";
|
|
874
|
+
var footer2 = "Modal_footer__1kcb5si9";
|
|
875
|
+
var header = "Modal_header__1kcb5si4";
|
|
876
|
+
var overlay = "Modal_overlay__1kcb5si2";
|
|
877
|
+
var title = "Modal_title__1kcb5si5";
|
|
878
|
+
function Modal({
|
|
879
|
+
open,
|
|
880
|
+
defaultOpen,
|
|
881
|
+
onOpenChange,
|
|
882
|
+
title: title2,
|
|
883
|
+
description: description2,
|
|
884
|
+
children,
|
|
885
|
+
footer: footer3,
|
|
886
|
+
trigger,
|
|
887
|
+
className
|
|
888
|
+
}) {
|
|
889
|
+
return /* @__PURE__ */ jsxs(
|
|
890
|
+
RadixDialog.Root,
|
|
891
|
+
{
|
|
892
|
+
...open !== void 0 ? { open } : {},
|
|
893
|
+
...defaultOpen !== void 0 ? { defaultOpen } : {},
|
|
894
|
+
...onOpenChange !== void 0 ? { onOpenChange } : {},
|
|
895
|
+
children: [
|
|
896
|
+
trigger && /* @__PURE__ */ jsx(RadixDialog.Trigger, { asChild: true, children: trigger }),
|
|
897
|
+
/* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
|
|
898
|
+
/* @__PURE__ */ jsx(RadixDialog.Overlay, { className: overlay }),
|
|
899
|
+
/* @__PURE__ */ jsxs(
|
|
900
|
+
RadixDialog.Content,
|
|
901
|
+
{
|
|
902
|
+
className: [content2, className].filter(Boolean).join(" "),
|
|
903
|
+
"aria-describedby": description2 ? "modal-description" : void 0,
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ jsxs("div", { className: header, children: [
|
|
906
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
907
|
+
title2 && /* @__PURE__ */ jsx(RadixDialog.Title, { className: title, children: title2 }),
|
|
908
|
+
description2 && /* @__PURE__ */ jsx(RadixDialog.Description, { id: "modal-description", className: description, children: description2 })
|
|
909
|
+
] }),
|
|
910
|
+
/* @__PURE__ */ jsx(RadixDialog.Close, { className: closeButton, "aria-label": "Close", children: /* @__PURE__ */ jsx(Glyph, { name: "cross", size: 14, "aria-hidden": "true" }) })
|
|
911
|
+
] }),
|
|
912
|
+
/* @__PURE__ */ jsx("div", { className: body2, children }),
|
|
913
|
+
footer3 && /* @__PURE__ */ jsx("div", { className: footer2, children: footer3 })
|
|
914
|
+
]
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] })
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// src/components/Toast/Toast.css.ts
|
|
924
|
+
var toast = "Toast_toast__1btt01v3";
|
|
925
|
+
var toastAction = "Toast_toastAction__1btt01v7";
|
|
926
|
+
var toastClose = "Toast_toastClose__1btt01v6";
|
|
927
|
+
var toastDescription = "Toast_toastDescription__1btt01v5";
|
|
928
|
+
var toastTitle = "Toast_toastTitle__1btt01v4";
|
|
929
|
+
var viewport = "Toast_viewport__1btt01v2";
|
|
930
|
+
var ToastContext = createContext(null);
|
|
931
|
+
function useToast() {
|
|
932
|
+
const ctx = useContext(ToastContext);
|
|
933
|
+
if (!ctx) throw new Error("useToast must be used within <ToastProvider>");
|
|
934
|
+
return ctx;
|
|
935
|
+
}
|
|
936
|
+
function ToastProvider({ children }) {
|
|
937
|
+
const [toasts, setToasts] = useState([]);
|
|
938
|
+
const toast2 = useCallback((data) => {
|
|
939
|
+
const id = String(Date.now());
|
|
940
|
+
setToasts((prev) => [...prev, { ...data, id }]);
|
|
941
|
+
const duration = data.duration ?? 4e3;
|
|
942
|
+
if (duration > 0) {
|
|
943
|
+
setTimeout(() => {
|
|
944
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
945
|
+
}, duration);
|
|
946
|
+
}
|
|
947
|
+
}, []);
|
|
948
|
+
const dismiss = (id) => setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
949
|
+
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { toast: toast2 }, children: [
|
|
950
|
+
children,
|
|
951
|
+
typeof document !== "undefined" && createPortal(
|
|
952
|
+
/* @__PURE__ */ jsx("ol", { className: viewport, "aria-live": "polite", "aria-label": "Notifications", children: toasts.map((t) => /* @__PURE__ */ jsxs("li", { className: toast, role: "status", children: [
|
|
953
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
954
|
+
/* @__PURE__ */ jsx("div", { className: toastTitle, children: t.title }),
|
|
955
|
+
t.description && /* @__PURE__ */ jsx("div", { className: toastDescription, children: t.description }),
|
|
956
|
+
t.action && /* @__PURE__ */ jsx("div", { className: toastAction, children: t.action })
|
|
957
|
+
] }),
|
|
958
|
+
/* @__PURE__ */ jsx(
|
|
959
|
+
"button",
|
|
960
|
+
{
|
|
961
|
+
className: toastClose,
|
|
962
|
+
onClick: () => dismiss(t.id),
|
|
963
|
+
"aria-label": "Dismiss",
|
|
964
|
+
children: /* @__PURE__ */ jsx(Glyph, { name: "cross", size: 12, "aria-hidden": "true" })
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
] }, t.id)) }),
|
|
968
|
+
document.body
|
|
969
|
+
)
|
|
970
|
+
] });
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
export { AcheryProvider, AppBar, Badge, Body, Button, Card, Display, Eyebrow, Field, Glyph, Heading, Input, Marginalia, Modal, Mono, SearchInput, Select, Sidebar, Table, Tabs, Textarea, ToastProvider, Toggle, Tooltip, useTheme, useToast, vars };
|
|
974
|
+
//# sourceMappingURL=index.js.map
|
|
975
|
+
//# sourceMappingURL=index.js.map
|