@n3rd-ai/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/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/Toast-qHlZE8FW.d.ts +16 -0
- package/dist/ascii-border-DpKIQMLP.d.ts +106 -0
- package/dist/chunk-CBVIEAN7.js +61 -0
- package/dist/chunk-MZO6ECNX.js +78 -0
- package/dist/hooks/index.d.ts +27 -0
- package/dist/hooks/index.js +52 -0
- package/dist/index.css +281 -0
- package/dist/index.d.ts +290 -0
- package/dist/index.js +881 -0
- package/dist/theme/theme/fonts.ts +21 -0
- package/dist/theme/theme/presets/classic.css +23 -0
- package/dist/theme/theme/presets/paper.css +21 -0
- package/dist/theme/theme/presets/retro.css +23 -0
- package/dist/theme/theme/presets/unicorn.css +5 -0
- package/dist/theme/theme/reset.css +86 -0
- package/dist/theme/theme/tokens.css +61 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +59 -0
- package/package.json +109 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,881 @@
|
|
|
1
|
+
import { ToastProvider } from './chunk-MZO6ECNX.js';
|
|
2
|
+
export { ToastProvider, useToast } from './chunk-MZO6ECNX.js';
|
|
3
|
+
import { getBorderChars } from './chunk-CBVIEAN7.js';
|
|
4
|
+
export { BORDER_CHARS, getBorderChars } from './chunk-CBVIEAN7.js';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import { useState, useRef, useEffect } from 'react';
|
|
7
|
+
import localFont from 'next/font/local';
|
|
8
|
+
|
|
9
|
+
// src/components/layout/Box.module.css
|
|
10
|
+
var Box_default = {};
|
|
11
|
+
var PADDING_MAP = {
|
|
12
|
+
none: "0",
|
|
13
|
+
sm: "var(--n3rd-space-2)",
|
|
14
|
+
md: "var(--n3rd-space-4)",
|
|
15
|
+
lg: "var(--n3rd-space-6)"
|
|
16
|
+
};
|
|
17
|
+
function Box({
|
|
18
|
+
children,
|
|
19
|
+
border = "single",
|
|
20
|
+
title,
|
|
21
|
+
accent,
|
|
22
|
+
padding = "md",
|
|
23
|
+
className,
|
|
24
|
+
style
|
|
25
|
+
}) {
|
|
26
|
+
const chars = getBorderChars(border);
|
|
27
|
+
const accentColor = accent ? `var(--n3rd-accent-${accent})` : "var(--n3rd-border-default)";
|
|
28
|
+
if (!chars) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", { className, style: { padding: PADDING_MAP[padding], ...style }, children });
|
|
30
|
+
}
|
|
31
|
+
const boxStyle = {
|
|
32
|
+
...style,
|
|
33
|
+
"--box-border-color": accentColor,
|
|
34
|
+
"--box-padding": PADDING_MAP[padding]
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: `${Box_default.box} ${className ?? ""}`, style: boxStyle, children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: Box_default.borderTop, "aria-hidden": "true", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderChar, children: chars.topLeft }),
|
|
39
|
+
title && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderChar, children: chars.horizontal }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.title, children: ` ${title} ` })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderLine, children: chars.horizontal }),
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderChar, children: chars.topRight })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs("div", { className: Box_default.content, children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderSide, "aria-hidden": "true", children: chars.vertical }),
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: Box_default.inner, children }),
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderSide, "aria-hidden": "true", children: chars.vertical })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: Box_default.borderBottom, "aria-hidden": "true", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderChar, children: chars.bottomLeft }),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderLine, children: chars.horizontal }),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: Box_default.borderChar, children: chars.bottomRight })
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
var GAP_MAP = {
|
|
59
|
+
none: "0",
|
|
60
|
+
sm: "var(--n3rd-space-2)",
|
|
61
|
+
md: "var(--n3rd-space-4)",
|
|
62
|
+
lg: "var(--n3rd-space-6)",
|
|
63
|
+
xl: "var(--n3rd-space-8)"
|
|
64
|
+
};
|
|
65
|
+
function Stack({ children, gap = "md", align = "stretch", className, style }) {
|
|
66
|
+
const stackStyle = {
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
gap: GAP_MAP[gap],
|
|
70
|
+
alignItems: align,
|
|
71
|
+
...style
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { className, style: stackStyle, children });
|
|
74
|
+
}
|
|
75
|
+
var GAP_MAP2 = {
|
|
76
|
+
none: "0",
|
|
77
|
+
sm: "var(--n3rd-space-2)",
|
|
78
|
+
md: "var(--n3rd-space-4)",
|
|
79
|
+
lg: "var(--n3rd-space-6)",
|
|
80
|
+
xl: "var(--n3rd-space-8)"
|
|
81
|
+
};
|
|
82
|
+
var JUSTIFY_MAP = {
|
|
83
|
+
start: "flex-start",
|
|
84
|
+
center: "center",
|
|
85
|
+
end: "flex-end",
|
|
86
|
+
between: "space-between",
|
|
87
|
+
around: "space-around"
|
|
88
|
+
};
|
|
89
|
+
function Row({
|
|
90
|
+
children,
|
|
91
|
+
gap = "md",
|
|
92
|
+
align = "center",
|
|
93
|
+
justify = "start",
|
|
94
|
+
wrap = false,
|
|
95
|
+
className,
|
|
96
|
+
style
|
|
97
|
+
}) {
|
|
98
|
+
const rowStyle = {
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexDirection: "row",
|
|
101
|
+
gap: GAP_MAP2[gap],
|
|
102
|
+
alignItems: align,
|
|
103
|
+
justifyContent: JUSTIFY_MAP[justify],
|
|
104
|
+
flexWrap: wrap ? "wrap" : "nowrap",
|
|
105
|
+
...style
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ jsx("div", { className, style: rowStyle, children });
|
|
108
|
+
}
|
|
109
|
+
var GAP_MAP3 = {
|
|
110
|
+
none: "0",
|
|
111
|
+
sm: "var(--n3rd-space-2)",
|
|
112
|
+
md: "var(--n3rd-space-4)",
|
|
113
|
+
lg: "var(--n3rd-space-6)",
|
|
114
|
+
xl: "var(--n3rd-space-8)"
|
|
115
|
+
};
|
|
116
|
+
function Grid({ children, columns = 3, gap = "md", className, style }) {
|
|
117
|
+
const gridStyle = {
|
|
118
|
+
display: "grid",
|
|
119
|
+
gridTemplateColumns: typeof columns === "number" ? `repeat(${columns}, 1fr)` : columns,
|
|
120
|
+
gap: GAP_MAP3[gap],
|
|
121
|
+
...style
|
|
122
|
+
};
|
|
123
|
+
return /* @__PURE__ */ jsx("div", { className, style: gridStyle, children });
|
|
124
|
+
}
|
|
125
|
+
var CHARS = {
|
|
126
|
+
single: "\u2500",
|
|
127
|
+
double: "\u2550",
|
|
128
|
+
dashed: "\u254C"
|
|
129
|
+
};
|
|
130
|
+
function Divider({ variant = "single", label, className, style }) {
|
|
131
|
+
const char = CHARS[variant];
|
|
132
|
+
const dividerStyle = {
|
|
133
|
+
display: "flex",
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
color: "var(--n3rd-border-default)",
|
|
136
|
+
fontFamily: "var(--n3rd-font)",
|
|
137
|
+
fontSize: "var(--n3rd-text-base)",
|
|
138
|
+
margin: "var(--n3rd-space-4) 0",
|
|
139
|
+
whiteSpace: "nowrap",
|
|
140
|
+
overflow: "hidden",
|
|
141
|
+
...style
|
|
142
|
+
};
|
|
143
|
+
const lineStyle = {
|
|
144
|
+
flex: 1,
|
|
145
|
+
overflow: "hidden"
|
|
146
|
+
};
|
|
147
|
+
if (label) {
|
|
148
|
+
return /* @__PURE__ */ jsxs("div", { className, style: dividerStyle, role: "separator", children: [
|
|
149
|
+
/* @__PURE__ */ jsx("span", { style: lineStyle, children: char.repeat(200) }),
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
"span",
|
|
152
|
+
{
|
|
153
|
+
style: {
|
|
154
|
+
padding: "0 var(--n3rd-space-2)",
|
|
155
|
+
color: "var(--n3rd-text-secondary)",
|
|
156
|
+
flexShrink: 0
|
|
157
|
+
},
|
|
158
|
+
children: label
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ jsx("span", { style: lineStyle, children: char.repeat(200) })
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
return /* @__PURE__ */ jsx("div", { className, style: dividerStyle, role: "separator", children: /* @__PURE__ */ jsx("span", { style: lineStyle, children: char.repeat(200) }) });
|
|
165
|
+
}
|
|
166
|
+
function Page({ children, maxWidth = "1200px", className, style }) {
|
|
167
|
+
const pageStyle = {
|
|
168
|
+
maxWidth,
|
|
169
|
+
margin: "0 auto",
|
|
170
|
+
padding: "var(--n3rd-space-6) var(--n3rd-space-4)",
|
|
171
|
+
minHeight: "100vh",
|
|
172
|
+
...style
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ jsx("main", { className, style: pageStyle, children });
|
|
175
|
+
}
|
|
176
|
+
var SIZE_MAP = {
|
|
177
|
+
xs: "var(--n3rd-text-xs)",
|
|
178
|
+
sm: "var(--n3rd-text-sm)",
|
|
179
|
+
base: "var(--n3rd-text-base)",
|
|
180
|
+
lg: "var(--n3rd-text-lg)",
|
|
181
|
+
xl: "var(--n3rd-text-xl)",
|
|
182
|
+
"2xl": "var(--n3rd-text-2xl)"
|
|
183
|
+
};
|
|
184
|
+
var COLOR_MAP = {
|
|
185
|
+
primary: "var(--n3rd-text-primary)",
|
|
186
|
+
secondary: "var(--n3rd-text-secondary)",
|
|
187
|
+
tertiary: "var(--n3rd-text-tertiary)",
|
|
188
|
+
accent: "var(--n3rd-accent-primary)",
|
|
189
|
+
success: "var(--n3rd-accent-success)",
|
|
190
|
+
warning: "var(--n3rd-accent-warning)",
|
|
191
|
+
danger: "var(--n3rd-accent-danger)",
|
|
192
|
+
info: "var(--n3rd-accent-info)"
|
|
193
|
+
};
|
|
194
|
+
function Text({
|
|
195
|
+
children,
|
|
196
|
+
size = "base",
|
|
197
|
+
color = "primary",
|
|
198
|
+
bold = false,
|
|
199
|
+
prefix,
|
|
200
|
+
gradient = false,
|
|
201
|
+
as: Tag = "span",
|
|
202
|
+
className,
|
|
203
|
+
style
|
|
204
|
+
}) {
|
|
205
|
+
const textStyle = {
|
|
206
|
+
fontFamily: "var(--n3rd-font)",
|
|
207
|
+
fontSize: SIZE_MAP[size],
|
|
208
|
+
fontWeight: bold ? 700 : 400,
|
|
209
|
+
lineHeight: "var(--n3rd-line-height)",
|
|
210
|
+
color: gradient ? "transparent" : COLOR_MAP[color],
|
|
211
|
+
...gradient && {
|
|
212
|
+
background: "var(--n3rd-gradient)",
|
|
213
|
+
backgroundClip: "text",
|
|
214
|
+
WebkitBackgroundClip: "text",
|
|
215
|
+
WebkitTextFillColor: "transparent"
|
|
216
|
+
},
|
|
217
|
+
...style
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ jsxs(Tag, { className, style: textStyle, children: [
|
|
220
|
+
prefix && /* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-text-secondary)", marginRight: "var(--n3rd-space-1)" }, children: prefix }),
|
|
221
|
+
children
|
|
222
|
+
] });
|
|
223
|
+
}
|
|
224
|
+
var SIZE_MAP2 = {
|
|
225
|
+
1: "var(--n3rd-text-2xl)",
|
|
226
|
+
2: "var(--n3rd-text-xl)",
|
|
227
|
+
3: "var(--n3rd-text-lg)",
|
|
228
|
+
4: "var(--n3rd-text-base)",
|
|
229
|
+
5: "var(--n3rd-text-sm)",
|
|
230
|
+
6: "var(--n3rd-text-xs)"
|
|
231
|
+
};
|
|
232
|
+
var PREFIX_MAP = {
|
|
233
|
+
1: "#",
|
|
234
|
+
2: "##",
|
|
235
|
+
3: "###",
|
|
236
|
+
4: "####",
|
|
237
|
+
5: "#####",
|
|
238
|
+
6: "######"
|
|
239
|
+
};
|
|
240
|
+
function Heading({
|
|
241
|
+
children,
|
|
242
|
+
level = 2,
|
|
243
|
+
prefix = true,
|
|
244
|
+
gradient = false,
|
|
245
|
+
className,
|
|
246
|
+
style
|
|
247
|
+
}) {
|
|
248
|
+
const Tag = `h${level}`;
|
|
249
|
+
const headingStyle = {
|
|
250
|
+
fontFamily: "var(--n3rd-font)",
|
|
251
|
+
fontSize: SIZE_MAP2[level],
|
|
252
|
+
fontWeight: 700,
|
|
253
|
+
lineHeight: "var(--n3rd-line-height)",
|
|
254
|
+
color: gradient ? "transparent" : "var(--n3rd-text-primary)",
|
|
255
|
+
...gradient && {
|
|
256
|
+
background: "var(--n3rd-gradient)",
|
|
257
|
+
backgroundClip: "text",
|
|
258
|
+
WebkitBackgroundClip: "text",
|
|
259
|
+
WebkitTextFillColor: "transparent"
|
|
260
|
+
},
|
|
261
|
+
margin: 0,
|
|
262
|
+
...style
|
|
263
|
+
};
|
|
264
|
+
return /* @__PURE__ */ jsxs(Tag, { className, style: headingStyle, children: [
|
|
265
|
+
prefix && /* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-text-tertiary)", marginRight: "var(--n3rd-space-2)" }, children: PREFIX_MAP[level] }),
|
|
266
|
+
children
|
|
267
|
+
] });
|
|
268
|
+
}
|
|
269
|
+
var VARIANT_MAP = {
|
|
270
|
+
default: "var(--n3rd-accent-primary)",
|
|
271
|
+
success: "var(--n3rd-accent-success)",
|
|
272
|
+
warning: "var(--n3rd-accent-warning)",
|
|
273
|
+
danger: "var(--n3rd-accent-danger)",
|
|
274
|
+
info: "var(--n3rd-accent-info)"
|
|
275
|
+
};
|
|
276
|
+
function Badge({ children, variant = "default", className, style }) {
|
|
277
|
+
const badgeStyle = {
|
|
278
|
+
display: "inline-block",
|
|
279
|
+
fontFamily: "var(--n3rd-font)",
|
|
280
|
+
fontSize: "var(--n3rd-text-xs)",
|
|
281
|
+
fontWeight: 700,
|
|
282
|
+
color: VARIANT_MAP[variant],
|
|
283
|
+
textTransform: "uppercase",
|
|
284
|
+
letterSpacing: "0.05em",
|
|
285
|
+
...style
|
|
286
|
+
};
|
|
287
|
+
return /* @__PURE__ */ jsxs("span", { className, style: badgeStyle, children: [
|
|
288
|
+
"[",
|
|
289
|
+
children,
|
|
290
|
+
"]"
|
|
291
|
+
] });
|
|
292
|
+
}
|
|
293
|
+
function Metric({ value, label, suffix, prefix, accent, className, style }) {
|
|
294
|
+
const containerStyle = {
|
|
295
|
+
fontFamily: "var(--n3rd-font)",
|
|
296
|
+
textAlign: "center",
|
|
297
|
+
...style
|
|
298
|
+
};
|
|
299
|
+
const valueStyle = {
|
|
300
|
+
fontSize: "var(--n3rd-text-2xl)",
|
|
301
|
+
fontWeight: 700,
|
|
302
|
+
color: accent ? `var(--n3rd-accent-${accent})` : "var(--n3rd-text-primary)",
|
|
303
|
+
lineHeight: 1.2
|
|
304
|
+
};
|
|
305
|
+
const labelStyle = {
|
|
306
|
+
fontSize: "var(--n3rd-text-sm)",
|
|
307
|
+
color: "var(--n3rd-text-secondary)",
|
|
308
|
+
marginTop: "var(--n3rd-space-1)"
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ jsxs("div", { className, style: containerStyle, children: [
|
|
311
|
+
/* @__PURE__ */ jsxs("div", { style: valueStyle, children: [
|
|
312
|
+
prefix,
|
|
313
|
+
value,
|
|
314
|
+
suffix
|
|
315
|
+
] }),
|
|
316
|
+
/* @__PURE__ */ jsx("div", { style: labelStyle, children: label })
|
|
317
|
+
] });
|
|
318
|
+
}
|
|
319
|
+
function getCellText(cell) {
|
|
320
|
+
return typeof cell === "string" ? cell : cell.text;
|
|
321
|
+
}
|
|
322
|
+
function getCellAccent(cell) {
|
|
323
|
+
return typeof cell === "string" ? void 0 : cell.accent;
|
|
324
|
+
}
|
|
325
|
+
function Table({ columns, rows, border = "single", className, style }) {
|
|
326
|
+
const chars = getBorderChars(border);
|
|
327
|
+
const tableStyle = {
|
|
328
|
+
fontFamily: "var(--n3rd-font)",
|
|
329
|
+
fontSize: "var(--n3rd-text-sm)",
|
|
330
|
+
color: "var(--n3rd-border-default)",
|
|
331
|
+
width: "100%",
|
|
332
|
+
whiteSpace: "pre",
|
|
333
|
+
...style
|
|
334
|
+
};
|
|
335
|
+
if (!chars) {
|
|
336
|
+
return /* @__PURE__ */ jsxs("table", { className, style: { ...tableStyle, color: "var(--n3rd-text-primary)" }, children: [
|
|
337
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsx(
|
|
338
|
+
"th",
|
|
339
|
+
{
|
|
340
|
+
style: {
|
|
341
|
+
textAlign: "left",
|
|
342
|
+
padding: "var(--n3rd-space-2)",
|
|
343
|
+
color: "var(--n3rd-text-secondary)"
|
|
344
|
+
},
|
|
345
|
+
children: col
|
|
346
|
+
},
|
|
347
|
+
col
|
|
348
|
+
)) }) }),
|
|
349
|
+
/* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => /* @__PURE__ */ jsx("tr", { children: row.map((cell, j) => /* @__PURE__ */ jsx(
|
|
350
|
+
"td",
|
|
351
|
+
{
|
|
352
|
+
style: {
|
|
353
|
+
padding: "var(--n3rd-space-2)",
|
|
354
|
+
color: getCellAccent(cell) ? `var(--n3rd-accent-${getCellAccent(cell)})` : "var(--n3rd-text-primary)"
|
|
355
|
+
},
|
|
356
|
+
children: getCellText(cell)
|
|
357
|
+
},
|
|
358
|
+
j
|
|
359
|
+
)) }, i)) })
|
|
360
|
+
] });
|
|
361
|
+
}
|
|
362
|
+
const colWidths = columns.map((col, i) => {
|
|
363
|
+
let max = col.length;
|
|
364
|
+
for (const row of rows) {
|
|
365
|
+
if (row[i]) {
|
|
366
|
+
max = Math.max(max, getCellText(row[i]).length);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return max + 2;
|
|
370
|
+
});
|
|
371
|
+
const pad = (text, width) => ` ${text}${" ".repeat(Math.max(0, width - text.length - 1))}`;
|
|
372
|
+
const line = (left, mid, right, fill) => left + colWidths.map((w) => fill.repeat(w)).join(mid) + right;
|
|
373
|
+
const headerRow = chars.vertical + columns.map((col, i) => pad(col, colWidths[i])).join(chars.vertical) + chars.vertical;
|
|
374
|
+
return /* @__PURE__ */ jsxs("div", { className, style: tableStyle, children: [
|
|
375
|
+
/* @__PURE__ */ jsx("div", { children: line(chars.topLeft, chars.teeTop, chars.topRight, chars.horizontal) }),
|
|
376
|
+
/* @__PURE__ */ jsx("div", { style: { color: "var(--n3rd-text-secondary)" }, children: headerRow }),
|
|
377
|
+
/* @__PURE__ */ jsx("div", { children: line(chars.teeLeft, chars.cross, chars.teeRight, chars.horizontal) }),
|
|
378
|
+
rows.map((row, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
379
|
+
chars.vertical,
|
|
380
|
+
row.map((cell, j) => {
|
|
381
|
+
const text = getCellText(cell);
|
|
382
|
+
const accent = getCellAccent(cell);
|
|
383
|
+
const content = pad(text, colWidths[j]);
|
|
384
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
385
|
+
accent ? /* @__PURE__ */ jsx("span", { style: { color: `var(--n3rd-accent-${accent})` }, children: content }) : /* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-text-primary)" }, children: content }),
|
|
386
|
+
j < row.length - 1 ? chars.vertical : ""
|
|
387
|
+
] }, j);
|
|
388
|
+
}),
|
|
389
|
+
chars.vertical
|
|
390
|
+
] }, i)),
|
|
391
|
+
/* @__PURE__ */ jsx("div", { children: line(chars.bottomLeft, chars.teeBottom, chars.bottomRight, chars.horizontal) })
|
|
392
|
+
] });
|
|
393
|
+
}
|
|
394
|
+
function Code({
|
|
395
|
+
children,
|
|
396
|
+
title,
|
|
397
|
+
prompt,
|
|
398
|
+
showLineNumbers = false,
|
|
399
|
+
border = "single",
|
|
400
|
+
className,
|
|
401
|
+
style
|
|
402
|
+
}) {
|
|
403
|
+
const lines = children.split("\n");
|
|
404
|
+
const codeStyle = {
|
|
405
|
+
fontFamily: "var(--n3rd-font)",
|
|
406
|
+
fontSize: "var(--n3rd-text-sm)",
|
|
407
|
+
lineHeight: "var(--n3rd-line-height)",
|
|
408
|
+
...style
|
|
409
|
+
};
|
|
410
|
+
return /* @__PURE__ */ jsx(Box, { border, title, padding: "sm", className, children: /* @__PURE__ */ jsx("pre", { style: codeStyle, children: lines.map((line, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
411
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
412
|
+
"span",
|
|
413
|
+
{
|
|
414
|
+
style: {
|
|
415
|
+
color: "var(--n3rd-text-tertiary)",
|
|
416
|
+
marginRight: "var(--n3rd-space-3)",
|
|
417
|
+
userSelect: "none"
|
|
418
|
+
},
|
|
419
|
+
children: String(i + 1).padStart(3)
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
prompt && i === 0 && /* @__PURE__ */ jsxs("span", { style: { color: "var(--n3rd-accent-primary)" }, children: [
|
|
423
|
+
prompt,
|
|
424
|
+
" "
|
|
425
|
+
] }),
|
|
426
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-text-primary)" }, children: line })
|
|
427
|
+
] }, i)) }) });
|
|
428
|
+
}
|
|
429
|
+
function List({ items, bullet = ">", className, style }) {
|
|
430
|
+
const listStyle = {
|
|
431
|
+
fontFamily: "var(--n3rd-font)",
|
|
432
|
+
fontSize: "var(--n3rd-text-base)",
|
|
433
|
+
listStyle: "none",
|
|
434
|
+
padding: 0,
|
|
435
|
+
margin: 0,
|
|
436
|
+
...style
|
|
437
|
+
};
|
|
438
|
+
return /* @__PURE__ */ jsx("ul", { className, style: listStyle, children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
439
|
+
"li",
|
|
440
|
+
{
|
|
441
|
+
style: {
|
|
442
|
+
display: "flex",
|
|
443
|
+
gap: "var(--n3rd-space-2)",
|
|
444
|
+
marginBottom: "var(--n3rd-space-1)"
|
|
445
|
+
},
|
|
446
|
+
children: [
|
|
447
|
+
bullet !== "none" && /* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-accent-primary)", flexShrink: 0 }, children: bullet === "numbered" ? `${i + 1}.` : bullet }),
|
|
448
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--n3rd-text-primary)" }, children: item })
|
|
449
|
+
]
|
|
450
|
+
},
|
|
451
|
+
i
|
|
452
|
+
)) });
|
|
453
|
+
}
|
|
454
|
+
function Logo({ text, gradient = false, accent, className, style }) {
|
|
455
|
+
const gradientValue = typeof gradient === "string" ? gradient : "var(--n3rd-gradient)";
|
|
456
|
+
const logoStyle = {
|
|
457
|
+
fontFamily: "var(--n3rd-font)",
|
|
458
|
+
fontSize: "var(--n3rd-text-2xl)",
|
|
459
|
+
fontWeight: 700,
|
|
460
|
+
whiteSpace: "pre",
|
|
461
|
+
lineHeight: 1.1,
|
|
462
|
+
color: gradient ? "transparent" : accent ? `var(--n3rd-accent-${accent})` : "var(--n3rd-text-primary)",
|
|
463
|
+
...gradient && {
|
|
464
|
+
background: gradientValue,
|
|
465
|
+
backgroundClip: "text",
|
|
466
|
+
WebkitBackgroundClip: "text",
|
|
467
|
+
WebkitTextFillColor: "transparent"
|
|
468
|
+
},
|
|
469
|
+
...style
|
|
470
|
+
};
|
|
471
|
+
return /* @__PURE__ */ jsx("div", { className, style: logoStyle, "aria-label": text, role: "img", children: text });
|
|
472
|
+
}
|
|
473
|
+
function StatusLine({ left, center, right, className, style }) {
|
|
474
|
+
const lineStyle = {
|
|
475
|
+
display: "flex",
|
|
476
|
+
alignItems: "center",
|
|
477
|
+
justifyContent: "space-between",
|
|
478
|
+
padding: "var(--n3rd-space-1) var(--n3rd-space-3)",
|
|
479
|
+
backgroundColor: "var(--n3rd-bg-secondary)",
|
|
480
|
+
borderTop: "1px solid var(--n3rd-border-muted)",
|
|
481
|
+
fontFamily: "var(--n3rd-font)",
|
|
482
|
+
fontSize: "var(--n3rd-text-xs)",
|
|
483
|
+
color: "var(--n3rd-text-secondary)",
|
|
484
|
+
...style
|
|
485
|
+
};
|
|
486
|
+
return /* @__PURE__ */ jsxs("div", { className, style: lineStyle, role: "status", children: [
|
|
487
|
+
/* @__PURE__ */ jsx("div", { children: left }),
|
|
488
|
+
/* @__PURE__ */ jsx("div", { children: center }),
|
|
489
|
+
/* @__PURE__ */ jsx("div", { children: right })
|
|
490
|
+
] });
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// src/components/display/Footer.module.css
|
|
494
|
+
var Footer_default = {};
|
|
495
|
+
function Footer({
|
|
496
|
+
tagline = "where we're going, we don't need images",
|
|
497
|
+
links = [],
|
|
498
|
+
branding = "built with n3rd.ai",
|
|
499
|
+
className,
|
|
500
|
+
style
|
|
501
|
+
}) {
|
|
502
|
+
return /* @__PURE__ */ jsxs("footer", { className: `${Footer_default.footer} ${className ?? ""}`, style, children: [
|
|
503
|
+
branding && /* @__PURE__ */ jsxs("div", { className: Footer_default.branding, children: [
|
|
504
|
+
"\u2500\u2500 ",
|
|
505
|
+
branding,
|
|
506
|
+
" \u2500\u2500"
|
|
507
|
+
] }),
|
|
508
|
+
/* @__PURE__ */ jsxs("div", { className: Footer_default.starfield, "aria-hidden": "true", children: [
|
|
509
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.starRow, children: "\xB7 \u2726 \xB7 \xB7 \xB7 \u2726 \xB7" }),
|
|
510
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.starRow, children: " \xB7 \u2726 \xB7 \xB7 \xB7 \xB7" }),
|
|
511
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.starRow, children: "\u2726 \xB7 \xB7 \u2726 \xB7 \xB7" }),
|
|
512
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.starRow, children: " \xB7 \xB7 \u2726 \xB7 \u2726" })
|
|
513
|
+
] }),
|
|
514
|
+
/* @__PURE__ */ jsxs("div", { className: Footer_default.sunset, "aria-hidden": "true", children: [
|
|
515
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "30%", background: "#7c3aed" } }),
|
|
516
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "45%", background: "#a855f7" } }),
|
|
517
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunGap }),
|
|
518
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "55%", background: "#c084fc" } }),
|
|
519
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "62%", background: "#ec4899" } }),
|
|
520
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunGap }),
|
|
521
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "70%", background: "#f472b6" } }),
|
|
522
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "78%", background: "#fb7185" } }),
|
|
523
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunGap, style: { height: "3px" } }),
|
|
524
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "85%", background: "#fda4af" } }),
|
|
525
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.sunLine, style: { width: "92%", background: "#fecdd3" } })
|
|
526
|
+
] }),
|
|
527
|
+
/* @__PURE__ */ jsxs("div", { className: Footer_default.horizon, "aria-hidden": "true", children: [
|
|
528
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.horizonBright }),
|
|
529
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.reflection }),
|
|
530
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.reflectionDashed }),
|
|
531
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.reflection, style: { opacity: 0.4 } }),
|
|
532
|
+
/* @__PURE__ */ jsx("div", { className: Footer_default.reflectionDashed, style: { opacity: 0.2 } })
|
|
533
|
+
] }),
|
|
534
|
+
tagline && /* @__PURE__ */ jsx("div", { className: Footer_default.tagline, children: tagline.toUpperCase() }),
|
|
535
|
+
links.length > 0 && /* @__PURE__ */ jsx("nav", { className: Footer_default.links, children: links.map((link, i) => /* @__PURE__ */ jsxs("span", { children: [
|
|
536
|
+
i > 0 && /* @__PURE__ */ jsx("span", { className: Footer_default.sep, children: " \u2502 " }),
|
|
537
|
+
/* @__PURE__ */ jsxs(
|
|
538
|
+
"a",
|
|
539
|
+
{
|
|
540
|
+
href: link.href,
|
|
541
|
+
...link.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
542
|
+
className: Footer_default.link,
|
|
543
|
+
children: [
|
|
544
|
+
link.label,
|
|
545
|
+
link.external ? " \u2197" : ""
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
] }, link.label)) })
|
|
550
|
+
] });
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// src/components/input/Button.module.css
|
|
554
|
+
var Button_default = {};
|
|
555
|
+
var SPINNER_FRAMES = "\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F";
|
|
556
|
+
function Button({
|
|
557
|
+
children,
|
|
558
|
+
variant = "primary",
|
|
559
|
+
href,
|
|
560
|
+
external,
|
|
561
|
+
loading = false,
|
|
562
|
+
disabled = false,
|
|
563
|
+
onClick,
|
|
564
|
+
className,
|
|
565
|
+
style,
|
|
566
|
+
type = "button"
|
|
567
|
+
}) {
|
|
568
|
+
const classes = [
|
|
569
|
+
Button_default.button,
|
|
570
|
+
Button_default[variant],
|
|
571
|
+
loading ? Button_default.loading : "",
|
|
572
|
+
disabled ? Button_default.disabled : "",
|
|
573
|
+
className ?? ""
|
|
574
|
+
].filter(Boolean).join(" ");
|
|
575
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
576
|
+
variant !== "ghost" && "[ ",
|
|
577
|
+
loading && /* @__PURE__ */ jsx("span", { className: Button_default.spinner, "aria-hidden": "true", children: SPINNER_FRAMES[0] }),
|
|
578
|
+
loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
579
|
+
children,
|
|
580
|
+
"..."
|
|
581
|
+
] }) : children,
|
|
582
|
+
external && " \u2197",
|
|
583
|
+
variant !== "ghost" && " ]"
|
|
584
|
+
] });
|
|
585
|
+
if (href) {
|
|
586
|
+
return /* @__PURE__ */ jsx(
|
|
587
|
+
"a",
|
|
588
|
+
{
|
|
589
|
+
href,
|
|
590
|
+
className: classes,
|
|
591
|
+
style,
|
|
592
|
+
onClick,
|
|
593
|
+
...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
594
|
+
children: content
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
return /* @__PURE__ */ jsx(
|
|
599
|
+
"button",
|
|
600
|
+
{
|
|
601
|
+
type,
|
|
602
|
+
className: classes,
|
|
603
|
+
style,
|
|
604
|
+
onClick,
|
|
605
|
+
disabled: disabled || loading,
|
|
606
|
+
children: content
|
|
607
|
+
}
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
var CURSOR_CHARS = {
|
|
611
|
+
block: "\u2588",
|
|
612
|
+
line: "\u258E",
|
|
613
|
+
underscore: "\u2581"
|
|
614
|
+
};
|
|
615
|
+
function Cursor({ style = "block", className }) {
|
|
616
|
+
const cursorStyle = {
|
|
617
|
+
display: "inline-block",
|
|
618
|
+
animation: "n3rd-cursor-blink var(--n3rd-cursor-blink) step-end infinite",
|
|
619
|
+
color: "var(--n3rd-text-primary)"
|
|
620
|
+
};
|
|
621
|
+
return /* @__PURE__ */ jsx("span", { className, style: cursorStyle, "aria-hidden": "true", children: CURSOR_CHARS[style] });
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// src/components/input/Input.module.css
|
|
625
|
+
var Input_default = {};
|
|
626
|
+
function Input({
|
|
627
|
+
label,
|
|
628
|
+
placeholder,
|
|
629
|
+
value: controlledValue,
|
|
630
|
+
defaultValue = "",
|
|
631
|
+
onChange,
|
|
632
|
+
onSubmit,
|
|
633
|
+
prefix = ">",
|
|
634
|
+
cursor = "block",
|
|
635
|
+
type = "text",
|
|
636
|
+
disabled = false,
|
|
637
|
+
className,
|
|
638
|
+
style,
|
|
639
|
+
name,
|
|
640
|
+
id
|
|
641
|
+
}) {
|
|
642
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
643
|
+
const [focused, setFocused] = useState(false);
|
|
644
|
+
const inputRef = useRef(null);
|
|
645
|
+
const value = controlledValue ?? internalValue;
|
|
646
|
+
const handleChange = (e) => {
|
|
647
|
+
const val = e.target.value;
|
|
648
|
+
if (controlledValue === void 0) setInternalValue(val);
|
|
649
|
+
onChange?.(val);
|
|
650
|
+
};
|
|
651
|
+
const handleKeyDown = (e) => {
|
|
652
|
+
if (e.key === "Enter" && onSubmit) {
|
|
653
|
+
onSubmit(value);
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
return /* @__PURE__ */ jsxs("div", { className: `${Input_default.wrapper} ${className ?? ""}`, style, children: [
|
|
657
|
+
label && /* @__PURE__ */ jsxs("label", { className: Input_default.label, htmlFor: id, children: [
|
|
658
|
+
label,
|
|
659
|
+
":"
|
|
660
|
+
] }),
|
|
661
|
+
/* @__PURE__ */ jsxs(
|
|
662
|
+
"div",
|
|
663
|
+
{
|
|
664
|
+
className: `${Input_default.field} ${focused ? Input_default.focused : ""} ${disabled ? Input_default.disabled : ""}`,
|
|
665
|
+
onClick: () => inputRef.current?.focus(),
|
|
666
|
+
children: [
|
|
667
|
+
prefix && /* @__PURE__ */ jsx("span", { className: Input_default.prefix, children: prefix }),
|
|
668
|
+
/* @__PURE__ */ jsxs("div", { className: Input_default.inputWrap, children: [
|
|
669
|
+
/* @__PURE__ */ jsx(
|
|
670
|
+
"input",
|
|
671
|
+
{
|
|
672
|
+
ref: inputRef,
|
|
673
|
+
id,
|
|
674
|
+
name,
|
|
675
|
+
type,
|
|
676
|
+
value,
|
|
677
|
+
placeholder,
|
|
678
|
+
onChange: handleChange,
|
|
679
|
+
onKeyDown: handleKeyDown,
|
|
680
|
+
onFocus: () => setFocused(true),
|
|
681
|
+
onBlur: () => setFocused(false),
|
|
682
|
+
disabled,
|
|
683
|
+
className: Input_default.input
|
|
684
|
+
}
|
|
685
|
+
),
|
|
686
|
+
focused && !disabled && /* @__PURE__ */ jsx(Cursor, { style: cursor })
|
|
687
|
+
] })
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
)
|
|
691
|
+
] });
|
|
692
|
+
}
|
|
693
|
+
var ICONS = {
|
|
694
|
+
success: "[\u2713]",
|
|
695
|
+
warning: "[!]",
|
|
696
|
+
error: "[\u2717]",
|
|
697
|
+
info: "[i]"
|
|
698
|
+
};
|
|
699
|
+
var COLORS = {
|
|
700
|
+
success: "var(--n3rd-accent-success)",
|
|
701
|
+
warning: "var(--n3rd-accent-warning)",
|
|
702
|
+
error: "var(--n3rd-accent-danger)",
|
|
703
|
+
info: "var(--n3rd-accent-info)"
|
|
704
|
+
};
|
|
705
|
+
function Alert({ children, variant = "info", className, style }) {
|
|
706
|
+
const alertStyle = {
|
|
707
|
+
display: "flex",
|
|
708
|
+
alignItems: "flex-start",
|
|
709
|
+
gap: "var(--n3rd-space-2)",
|
|
710
|
+
padding: "var(--n3rd-space-3)",
|
|
711
|
+
fontFamily: "var(--n3rd-font)",
|
|
712
|
+
fontSize: "var(--n3rd-text-sm)",
|
|
713
|
+
backgroundColor: "var(--n3rd-bg-secondary)",
|
|
714
|
+
borderLeft: `2px solid ${COLORS[variant]}`,
|
|
715
|
+
color: "var(--n3rd-text-primary)",
|
|
716
|
+
...style
|
|
717
|
+
};
|
|
718
|
+
return /* @__PURE__ */ jsxs("div", { className, style: alertStyle, role: "alert", children: [
|
|
719
|
+
/* @__PURE__ */ jsx("span", { style: { color: COLORS[variant], flexShrink: 0 }, children: ICONS[variant] }),
|
|
720
|
+
/* @__PURE__ */ jsx("div", { children })
|
|
721
|
+
] });
|
|
722
|
+
}
|
|
723
|
+
function Progress({
|
|
724
|
+
value,
|
|
725
|
+
max = 100,
|
|
726
|
+
width = 20,
|
|
727
|
+
showLabel = true,
|
|
728
|
+
accent,
|
|
729
|
+
className,
|
|
730
|
+
style
|
|
731
|
+
}) {
|
|
732
|
+
const percent = Math.min(100, Math.max(0, value / max * 100));
|
|
733
|
+
const filled = Math.round(percent / 100 * width);
|
|
734
|
+
const empty = width - filled;
|
|
735
|
+
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
736
|
+
const progressStyle = {
|
|
737
|
+
fontFamily: "var(--n3rd-font)",
|
|
738
|
+
fontSize: "var(--n3rd-text-sm)",
|
|
739
|
+
display: "inline-flex",
|
|
740
|
+
alignItems: "center",
|
|
741
|
+
gap: "var(--n3rd-space-2)",
|
|
742
|
+
color: accent ? `var(--n3rd-accent-${accent})` : "var(--n3rd-accent-primary)",
|
|
743
|
+
...style
|
|
744
|
+
};
|
|
745
|
+
return /* @__PURE__ */ jsxs(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
className,
|
|
749
|
+
style: progressStyle,
|
|
750
|
+
role: "progressbar",
|
|
751
|
+
"aria-valuenow": value,
|
|
752
|
+
"aria-valuemax": max,
|
|
753
|
+
children: [
|
|
754
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
755
|
+
"[",
|
|
756
|
+
bar,
|
|
757
|
+
"]"
|
|
758
|
+
] }),
|
|
759
|
+
showLabel && /* @__PURE__ */ jsxs("span", { style: { color: "var(--n3rd-text-secondary)" }, children: [
|
|
760
|
+
Math.round(percent),
|
|
761
|
+
"%"
|
|
762
|
+
] })
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
function Skeleton({ width = 30, lines = 1, className, style }) {
|
|
768
|
+
const skeletonStyle = {
|
|
769
|
+
fontFamily: "var(--n3rd-font)",
|
|
770
|
+
fontSize: "var(--n3rd-text-base)",
|
|
771
|
+
color: "var(--n3rd-text-tertiary)",
|
|
772
|
+
lineHeight: "var(--n3rd-line-height)",
|
|
773
|
+
...style
|
|
774
|
+
};
|
|
775
|
+
return /* @__PURE__ */ jsx("div", { className, style: skeletonStyle, "aria-busy": "true", "aria-label": "Loading", children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx("div", { children: "\u2591".repeat(i === lines - 1 ? Math.ceil(width * 0.6) : width) }, i)) });
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// src/components/nav/Nav.module.css
|
|
779
|
+
var Nav_default = {};
|
|
780
|
+
function Nav({ items, className, style }) {
|
|
781
|
+
return /* @__PURE__ */ jsx("nav", { className: `${Nav_default.nav} ${className ?? ""}`, style, children: /* @__PURE__ */ jsx("div", { className: Nav_default.items, children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
782
|
+
"a",
|
|
783
|
+
{
|
|
784
|
+
href: item.href,
|
|
785
|
+
className: `${Nav_default.item} ${item.active ? Nav_default.active : ""}`,
|
|
786
|
+
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
787
|
+
children: [
|
|
788
|
+
item.active && /* @__PURE__ */ jsx("span", { className: Nav_default.indicator, children: "> " }),
|
|
789
|
+
"[ ",
|
|
790
|
+
item.label,
|
|
791
|
+
item.external ? " \u2197" : "",
|
|
792
|
+
" ]"
|
|
793
|
+
]
|
|
794
|
+
},
|
|
795
|
+
item.label
|
|
796
|
+
)) }) });
|
|
797
|
+
}
|
|
798
|
+
function Typewriter({
|
|
799
|
+
text,
|
|
800
|
+
speed = 50,
|
|
801
|
+
delay = 0,
|
|
802
|
+
cursor = "block",
|
|
803
|
+
onComplete,
|
|
804
|
+
className
|
|
805
|
+
}) {
|
|
806
|
+
const [displayed, setDisplayed] = useState("");
|
|
807
|
+
const [done, setDone] = useState(false);
|
|
808
|
+
const hasRun = useRef(false);
|
|
809
|
+
useEffect(() => {
|
|
810
|
+
if (hasRun.current) return;
|
|
811
|
+
hasRun.current = true;
|
|
812
|
+
let index = 0;
|
|
813
|
+
const timeout = setTimeout(() => {
|
|
814
|
+
const interval = setInterval(() => {
|
|
815
|
+
if (index < text.length) {
|
|
816
|
+
setDisplayed(text.slice(0, index + 1));
|
|
817
|
+
index++;
|
|
818
|
+
} else {
|
|
819
|
+
clearInterval(interval);
|
|
820
|
+
setDone(true);
|
|
821
|
+
onComplete?.();
|
|
822
|
+
}
|
|
823
|
+
}, speed);
|
|
824
|
+
return () => clearInterval(interval);
|
|
825
|
+
}, delay);
|
|
826
|
+
return () => clearTimeout(timeout);
|
|
827
|
+
}, [text, speed, delay, onComplete]);
|
|
828
|
+
return /* @__PURE__ */ jsxs("span", { className, children: [
|
|
829
|
+
displayed,
|
|
830
|
+
!done && cursor !== false && /* @__PURE__ */ jsx(Cursor, { style: cursor })
|
|
831
|
+
] });
|
|
832
|
+
}
|
|
833
|
+
function Scanline({ opacity = 0.03 }) {
|
|
834
|
+
const style = {
|
|
835
|
+
position: "fixed",
|
|
836
|
+
top: 0,
|
|
837
|
+
left: 0,
|
|
838
|
+
width: "100%",
|
|
839
|
+
height: "100%",
|
|
840
|
+
pointerEvents: "none",
|
|
841
|
+
zIndex: 9999,
|
|
842
|
+
background: `repeating-linear-gradient(
|
|
843
|
+
0deg,
|
|
844
|
+
transparent,
|
|
845
|
+
transparent 1px,
|
|
846
|
+
rgba(0, 0, 0, ${opacity}) 1px,
|
|
847
|
+
rgba(0, 0, 0, ${opacity}) 2px
|
|
848
|
+
)`
|
|
849
|
+
};
|
|
850
|
+
return /* @__PURE__ */ jsx("div", { style, "aria-hidden": "true" });
|
|
851
|
+
}
|
|
852
|
+
function N3rdProvider({
|
|
853
|
+
children,
|
|
854
|
+
scanlines = false,
|
|
855
|
+
toastDuration = 4e3
|
|
856
|
+
}) {
|
|
857
|
+
return /* @__PURE__ */ jsxs(ToastProvider, { duration: toastDuration, children: [
|
|
858
|
+
children,
|
|
859
|
+
scanlines && /* @__PURE__ */ jsx(Scanline, {})
|
|
860
|
+
] });
|
|
861
|
+
}
|
|
862
|
+
var jetbrainsMono = localFont({
|
|
863
|
+
src: [
|
|
864
|
+
{
|
|
865
|
+
path: "../fonts/JetBrainsMono-Regular.woff2",
|
|
866
|
+
weight: "400",
|
|
867
|
+
style: "normal"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
path: "../fonts/JetBrainsMono-Bold.woff2",
|
|
871
|
+
weight: "700",
|
|
872
|
+
style: "normal"
|
|
873
|
+
}
|
|
874
|
+
],
|
|
875
|
+
variable: "--n3rd-font",
|
|
876
|
+
display: "swap",
|
|
877
|
+
fallback: ["Fira Code", "Cascadia Code", "SF Mono", "Consolas", "Courier New", "monospace"]
|
|
878
|
+
});
|
|
879
|
+
var N3rdFonts = jetbrainsMono;
|
|
880
|
+
|
|
881
|
+
export { Alert, Badge, Box, Button, Code, Cursor, Divider, Footer, Grid, Heading, Input, List, Logo, Metric, N3rdFonts, N3rdProvider, Nav, Page, Progress, Row, Scanline, Skeleton, Stack, StatusLine, Table, Text, Typewriter, jetbrainsMono };
|