@still-forest/canopy 0.28.1 → 0.29.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 +51 -0
- package/dist/chunks/Heading-Dwx3mHff.js +251 -0
- package/dist/{Layout2.js → chunks/Layout-fBiCo4lc.js} +53 -57
- package/dist/chunks/PageNotFound-DOYQfbRs.js +51 -0
- package/dist/chunks/SidebarLayout-BtEWD4ew.js +52 -0
- package/dist/chunks/TextInput-NfG9yrGJ.js +330 -0
- package/dist/chunks/cn-B6yFEsav.js +8 -0
- package/dist/forms.js +14 -16
- package/dist/index.d.ts +45 -6
- package/dist/index.js +589 -233
- package/dist/interstitials.js +5 -6
- package/dist/layout.js +1 -1
- package/dist/navigation.js +6 -5
- package/dist/typography.js +5 -7
- package/dist/utilities.js +1 -1
- package/package.json +27 -29
- package/dist/Code.js +0 -6
- package/dist/ErrorFallback.js +0 -29
- package/dist/Heading.js +0 -251
- package/dist/PageNotFound.js +0 -86
- package/dist/Paragraph.js +0 -7
- package/dist/SelectInput.js +0 -1971
- package/dist/SidebarLayout.js +0 -986
- package/dist/Table.js +0 -122
- package/dist/Textarea.js +0 -491
- package/dist/calendar.js +0 -3135
- package/dist/index2.js +0 -2743
- package/dist/jsx-runtime.js +0 -40
- package/dist/next.d.ts +0 -579
- package/dist/next.js +0 -68
- package/dist/popover.js +0 -3079
- package/dist/skeleton.js +0 -1141
package/README.md
CHANGED
|
@@ -41,3 +41,54 @@ Example `index.css`:
|
|
|
41
41
|
/* your usual CSS definitions */
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
|
+
|
|
45
|
+
## Testing locally
|
|
46
|
+
|
|
47
|
+
### Using pnpm link
|
|
48
|
+
|
|
49
|
+
1. In this package, run build in watch mode:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm build --watch
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then expose it locally for linking:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm link
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. In the consuming package, link package.json to the locally built version:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm link @still-forest/canopy
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
3. When done, cleanup:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm unlink @still-forest/canopy
|
|
71
|
+
pnpm store prune # clear pnpm's global store
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Using pnpm add
|
|
75
|
+
|
|
76
|
+
1. In this package, run build in watch mode:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm build --watch
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
2. In the consuming package, point package.json to the locally built version:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm add ~/Development/canopy
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Direct file copy
|
|
89
|
+
|
|
90
|
+
**Alternatively**, directly copy the built version periodically:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
rm -rf ./node_modules/@still-forest/canopy/dist && cp -r ~/Development/canopy/dist ./node_modules/@still-forest/canopy/dist
|
|
94
|
+
```
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Text as k } from "@/typography";
|
|
3
|
+
import { cn as b } from "@/utils";
|
|
4
|
+
import h from "react";
|
|
5
|
+
const R = ({ children: c, className: e, as: x = "p", ...l }) => /* @__PURE__ */ m(k, { as: x, className: b("mb-4", e), ...l, children: c }), y = h.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className: c,
|
|
8
|
+
as: e,
|
|
9
|
+
size: x,
|
|
10
|
+
weight: l,
|
|
11
|
+
variant: t = "default",
|
|
12
|
+
align: s,
|
|
13
|
+
leading: r,
|
|
14
|
+
// No default: Tailwind applies a default from text size classes
|
|
15
|
+
tracking: d,
|
|
16
|
+
family: f = "display",
|
|
17
|
+
asForeground: o = !1,
|
|
18
|
+
truncate: u = !1,
|
|
19
|
+
numeric: i = !1,
|
|
20
|
+
...a
|
|
21
|
+
}, g) => /* @__PURE__ */ m(
|
|
22
|
+
e || "p",
|
|
23
|
+
{
|
|
24
|
+
className: b(
|
|
25
|
+
// Font sizes
|
|
26
|
+
{
|
|
27
|
+
"text-xs": x === "xs",
|
|
28
|
+
"text-sm": x === "sm",
|
|
29
|
+
"text-base": x === "base" || x === "md",
|
|
30
|
+
"text-lg": x === "lg",
|
|
31
|
+
"text-xl": x === "xl",
|
|
32
|
+
"text-2xl": x === "2xl",
|
|
33
|
+
"text-3xl": x === "3xl",
|
|
34
|
+
"text-4xl": x === "4xl",
|
|
35
|
+
"text-5xl": x === "5xl",
|
|
36
|
+
"text-6xl": x === "6xl",
|
|
37
|
+
"text-7xl": x === "7xl",
|
|
38
|
+
"text-8xl": x === "8xl",
|
|
39
|
+
"text-9xl": x === "9xl"
|
|
40
|
+
},
|
|
41
|
+
// Font weights
|
|
42
|
+
{
|
|
43
|
+
"font-thin": l === "thin",
|
|
44
|
+
"font-extralight": l === "extralight",
|
|
45
|
+
"font-light": l === "light",
|
|
46
|
+
"font-normal": l === "normal",
|
|
47
|
+
"font-medium": l === "medium",
|
|
48
|
+
"font-semibold": l === "semibold",
|
|
49
|
+
"font-bold": l === "bold",
|
|
50
|
+
"font-extrabold": l === "extrabold",
|
|
51
|
+
"font-black": l === "black"
|
|
52
|
+
},
|
|
53
|
+
// Text colors (variants)
|
|
54
|
+
{
|
|
55
|
+
"text-foreground": t === "default",
|
|
56
|
+
"text-inherit": t === "inherit",
|
|
57
|
+
"text-muted-foreground": t === "muted",
|
|
58
|
+
"text-accent-foreground": t === "accent",
|
|
59
|
+
// Action colors
|
|
60
|
+
"text-primary-foreground": t === "primary",
|
|
61
|
+
"text-secondary-foreground": t === "secondary",
|
|
62
|
+
// Accent colors (rich color variants)
|
|
63
|
+
"text-info": !o && t === "info",
|
|
64
|
+
"text-warning": !o && t === "warning",
|
|
65
|
+
"text-destructive": !o && t === "destructive",
|
|
66
|
+
"text-success": !o && t === "success",
|
|
67
|
+
// Accent colors (foreground variants)
|
|
68
|
+
"text-info-foreground": o && t === "info",
|
|
69
|
+
"text-warning-foreground": o && t === "warning",
|
|
70
|
+
"text-destructive-foreground": o && t === "destructive",
|
|
71
|
+
"text-success-foreground": o && t === "success"
|
|
72
|
+
},
|
|
73
|
+
// Text alignment
|
|
74
|
+
{
|
|
75
|
+
"text-left": s === "left",
|
|
76
|
+
"text-center": s === "center",
|
|
77
|
+
"text-right": s === "right",
|
|
78
|
+
"text-justify": s === "justify",
|
|
79
|
+
"text-start": s === "start",
|
|
80
|
+
"text-end": s === "end"
|
|
81
|
+
},
|
|
82
|
+
// Leading (line height)
|
|
83
|
+
{
|
|
84
|
+
"leading-none": r === "none",
|
|
85
|
+
"leading-tight": r === "tight",
|
|
86
|
+
"leading-snug": r === "snug",
|
|
87
|
+
"leading-normal": r === "normal",
|
|
88
|
+
"leading-relaxed": r === "relaxed",
|
|
89
|
+
"leading-loose": r === "loose"
|
|
90
|
+
},
|
|
91
|
+
// Tracking (letter spacing)
|
|
92
|
+
{
|
|
93
|
+
"tracking-tighter": d === "tighter",
|
|
94
|
+
"tracking-tight": d === "tight",
|
|
95
|
+
"tracking-normal": d === "normal",
|
|
96
|
+
"tracking-wide": d === "wide",
|
|
97
|
+
"tracking-wider": d === "wider",
|
|
98
|
+
"tracking-widest": d === "widest"
|
|
99
|
+
},
|
|
100
|
+
// Font family
|
|
101
|
+
{
|
|
102
|
+
"font-display": f === "display",
|
|
103
|
+
"font-sans": f === "sans",
|
|
104
|
+
"font-serif": f === "serif",
|
|
105
|
+
"font-mono": f === "mono"
|
|
106
|
+
},
|
|
107
|
+
// Truncation
|
|
108
|
+
u && "truncate",
|
|
109
|
+
// Tabular numerals
|
|
110
|
+
i && "tabular-nums",
|
|
111
|
+
c
|
|
112
|
+
),
|
|
113
|
+
ref: g,
|
|
114
|
+
...a
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
y.displayName = "Text";
|
|
119
|
+
const S = ({ children: c, ...e }) => /* @__PURE__ */ m(y, { className: "inline-block w-fit rounded bg-accent px-2", family: "mono", size: "sm", variant: "accent", ...e, children: c }), w = h.forwardRef(
|
|
120
|
+
({
|
|
121
|
+
className: c,
|
|
122
|
+
variant: e = "default",
|
|
123
|
+
level: x = "2",
|
|
124
|
+
size: l,
|
|
125
|
+
weight: t = "bold",
|
|
126
|
+
// Typical default browser style for headings
|
|
127
|
+
align: s,
|
|
128
|
+
leading: r,
|
|
129
|
+
// No default: Tailwind applies a default from text size classes
|
|
130
|
+
tracking: d,
|
|
131
|
+
family: f = "display",
|
|
132
|
+
asForeground: o = !1,
|
|
133
|
+
truncate: u = !1,
|
|
134
|
+
numeric: i = !1,
|
|
135
|
+
...a
|
|
136
|
+
}, g) => {
|
|
137
|
+
const p = `h${x}`, n = l || {
|
|
138
|
+
1: "4xl",
|
|
139
|
+
2: "3xl",
|
|
140
|
+
3: "2xl",
|
|
141
|
+
4: "xl",
|
|
142
|
+
5: "lg",
|
|
143
|
+
6: "base"
|
|
144
|
+
}[x];
|
|
145
|
+
return /* @__PURE__ */ m(
|
|
146
|
+
p,
|
|
147
|
+
{
|
|
148
|
+
className: b(
|
|
149
|
+
// Size scales
|
|
150
|
+
{
|
|
151
|
+
"text-xs": n === "xs",
|
|
152
|
+
"text-sm": n === "sm",
|
|
153
|
+
"text-base": n === "base" || n === "md",
|
|
154
|
+
"text-lg": n === "lg",
|
|
155
|
+
"text-xl": n === "xl",
|
|
156
|
+
"text-2xl": n === "2xl",
|
|
157
|
+
"text-3xl": n === "3xl",
|
|
158
|
+
"text-4xl": n === "4xl",
|
|
159
|
+
"text-5xl": n === "5xl",
|
|
160
|
+
"text-6xl": n === "6xl",
|
|
161
|
+
"text-7xl": n === "7xl",
|
|
162
|
+
"text-8xl": n === "8xl",
|
|
163
|
+
"text-9xl": n === "9xl"
|
|
164
|
+
},
|
|
165
|
+
// Font weights
|
|
166
|
+
{
|
|
167
|
+
"font-thin": t === "thin",
|
|
168
|
+
"font-extralight": t === "extralight",
|
|
169
|
+
"font-light": t === "light",
|
|
170
|
+
"font-normal": t === "normal",
|
|
171
|
+
"font-medium": t === "medium",
|
|
172
|
+
"font-semibold": t === "semibold",
|
|
173
|
+
"font-bold": t === "bold",
|
|
174
|
+
"font-extrabold": t === "extrabold",
|
|
175
|
+
"font-black": t === "black"
|
|
176
|
+
},
|
|
177
|
+
// Text colors (variants)
|
|
178
|
+
{
|
|
179
|
+
"text-foreground": e === "default",
|
|
180
|
+
"text-inherit": e === "inherit",
|
|
181
|
+
"text-muted-foreground": e === "muted",
|
|
182
|
+
"text-accent-foreground": e === "accent",
|
|
183
|
+
// Action colors
|
|
184
|
+
"text-primary-foreground": e === "primary",
|
|
185
|
+
"text-secondary-foreground": e === "secondary",
|
|
186
|
+
// Accent colors (rich color variants)
|
|
187
|
+
"text-info": !o && e === "info",
|
|
188
|
+
"text-warning": !o && e === "warning",
|
|
189
|
+
"text-destructive": !o && e === "destructive",
|
|
190
|
+
"text-success": !o && e === "success",
|
|
191
|
+
// Accent colors (foreground variants)
|
|
192
|
+
"text-info-foreground": o && e === "info",
|
|
193
|
+
"text-warning-foreground": o && e === "warning",
|
|
194
|
+
"text-destructive-foreground": o && e === "destructive",
|
|
195
|
+
"text-success-foreground": o && e === "success"
|
|
196
|
+
},
|
|
197
|
+
// Text alignment
|
|
198
|
+
{
|
|
199
|
+
"text-left": s === "left",
|
|
200
|
+
"text-center": s === "center",
|
|
201
|
+
"text-right": s === "right",
|
|
202
|
+
"text-justify": s === "justify",
|
|
203
|
+
"text-start": s === "start",
|
|
204
|
+
"text-end": s === "end"
|
|
205
|
+
},
|
|
206
|
+
// Leading (line height)
|
|
207
|
+
{
|
|
208
|
+
"leading-none": r === "none",
|
|
209
|
+
"leading-tight": r === "tight",
|
|
210
|
+
"leading-snug": r === "snug",
|
|
211
|
+
"leading-normal": r === "normal",
|
|
212
|
+
"leading-relaxed": r === "relaxed",
|
|
213
|
+
"leading-loose": r === "loose"
|
|
214
|
+
},
|
|
215
|
+
// Tracking (letter spacing)
|
|
216
|
+
{
|
|
217
|
+
"tracking-tighter": d === "tighter",
|
|
218
|
+
"tracking-tight": d === "tight",
|
|
219
|
+
"tracking-normal": d === "normal",
|
|
220
|
+
"tracking-wide": d === "wide",
|
|
221
|
+
"tracking-wider": d === "wider",
|
|
222
|
+
"tracking-widest": d === "widest"
|
|
223
|
+
},
|
|
224
|
+
// Font family
|
|
225
|
+
{
|
|
226
|
+
"font-display": f === "display",
|
|
227
|
+
"font-sans": f === "sans",
|
|
228
|
+
"font-serif": f === "serif",
|
|
229
|
+
"font-mono": f === "mono"
|
|
230
|
+
},
|
|
231
|
+
// Truncation
|
|
232
|
+
u && "truncate",
|
|
233
|
+
// Tabular numerals
|
|
234
|
+
i && "tabular-nums",
|
|
235
|
+
// Add some scroll margin for better anchor navigation
|
|
236
|
+
"scroll-m-20",
|
|
237
|
+
c
|
|
238
|
+
),
|
|
239
|
+
ref: g,
|
|
240
|
+
...a
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
w.displayName = "Heading";
|
|
246
|
+
export {
|
|
247
|
+
S as C,
|
|
248
|
+
w as H,
|
|
249
|
+
R as P,
|
|
250
|
+
y as T
|
|
251
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import g from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { cn as m } from "@/utils";
|
|
4
|
+
import { Box as v, Flex as y, Container as i, Footer as N, Header as F } from "@/layout";
|
|
5
|
+
import { Body as k } from "@/layout/Layout/Body";
|
|
6
|
+
const C = g.forwardRef(
|
|
5
7
|
({
|
|
6
8
|
className: c,
|
|
7
9
|
as: t = "div",
|
|
@@ -15,9 +17,9 @@ const w = g.forwardRef(
|
|
|
15
17
|
overflow: a,
|
|
16
18
|
overflowX: b,
|
|
17
19
|
overflowY: d,
|
|
18
|
-
rounded:
|
|
19
|
-
...
|
|
20
|
-
},
|
|
20
|
+
rounded: u,
|
|
21
|
+
...w
|
|
22
|
+
}, p) => /* @__PURE__ */ f(
|
|
21
23
|
t,
|
|
22
24
|
{
|
|
23
25
|
className: m(
|
|
@@ -226,48 +228,45 @@ const w = g.forwardRef(
|
|
|
226
228
|
},
|
|
227
229
|
// Rounded
|
|
228
230
|
{
|
|
229
|
-
rounded:
|
|
230
|
-
"rounded-none":
|
|
231
|
-
"rounded-xs":
|
|
232
|
-
"rounded-sm":
|
|
233
|
-
"rounded-md":
|
|
234
|
-
"rounded-lg":
|
|
235
|
-
"rounded-xl":
|
|
236
|
-
"rounded-2xl":
|
|
237
|
-
"rounded-3xl":
|
|
238
|
-
"rounded-full":
|
|
231
|
+
rounded: u === !0,
|
|
232
|
+
"rounded-none": u === "none",
|
|
233
|
+
"rounded-xs": u === "xs",
|
|
234
|
+
"rounded-sm": u === "sm",
|
|
235
|
+
"rounded-md": u === "md",
|
|
236
|
+
"rounded-lg": u === "lg",
|
|
237
|
+
"rounded-xl": u === "xl",
|
|
238
|
+
"rounded-2xl": u === "2xl",
|
|
239
|
+
"rounded-3xl": u === "3xl",
|
|
240
|
+
"rounded-full": u === "full"
|
|
239
241
|
},
|
|
240
242
|
c
|
|
241
243
|
),
|
|
242
|
-
ref:
|
|
243
|
-
...
|
|
244
|
+
ref: p,
|
|
245
|
+
...w
|
|
244
246
|
}
|
|
245
247
|
)
|
|
246
248
|
);
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
+
C.displayName = "Box";
|
|
250
|
+
const z = ({ children: c, className: t, direction: n = "col", ...r }) => {
|
|
249
251
|
const { display: e = "flex", ...o } = r, l = m("w-full px-4 py-2 md:px-8 md:py-4 lg:px-12 lg:py-6", t);
|
|
250
|
-
return e === "block" ? /* @__PURE__ */
|
|
251
|
-
}, j = ({ flex: c, className: t, as: n, children: r, ...e }) =>
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
);
|
|
269
|
-
}, N = g.forwardRef(
|
|
270
|
-
({ className: c, as: t = "div", direction: n, align: r, justify: e, grow: o, wrap: l, gap: s, gapX: x, gapY: a, ...b }, d) => /* @__PURE__ */ u.jsx(
|
|
252
|
+
return e === "block" ? /* @__PURE__ */ f(v, { className: l, ...o, children: c }) : /* @__PURE__ */ f(y, { className: l, direction: n, ...o, children: c });
|
|
253
|
+
}, j = ({ flex: c, className: t, as: n, children: r, ...e }) => /* @__PURE__ */ f(
|
|
254
|
+
n || "div",
|
|
255
|
+
{
|
|
256
|
+
className: m(
|
|
257
|
+
{
|
|
258
|
+
"flex-1": c === "1",
|
|
259
|
+
"flex-auto": c === "auto",
|
|
260
|
+
"flex-initial": c === "initial",
|
|
261
|
+
"flex-none": c === "none"
|
|
262
|
+
},
|
|
263
|
+
t
|
|
264
|
+
),
|
|
265
|
+
...e,
|
|
266
|
+
children: r
|
|
267
|
+
}
|
|
268
|
+
), B = g.forwardRef(
|
|
269
|
+
({ className: c, as: t = "div", direction: n, align: r, justify: e, grow: o, wrap: l, gap: s, gapX: x, gapY: a, ...b }, d) => /* @__PURE__ */ f(
|
|
271
270
|
t,
|
|
272
271
|
{
|
|
273
272
|
className: m(
|
|
@@ -385,8 +384,8 @@ const y = ({ children: c, className: t, direction: n = "col", ...r }) => {
|
|
|
385
384
|
...b
|
|
386
385
|
}
|
|
387
386
|
)
|
|
388
|
-
),
|
|
389
|
-
({ className: c, as: t = "div", cols: n, rows: r, gap: e, gapX: o, gapY: l, flow: s, ...x }, a) => /* @__PURE__ */
|
|
387
|
+
), q = Object.assign(B, { Item: j }), A = ({ children: c, className: t, ...n }) => /* @__PURE__ */ f(i, { as: "footer", className: m("bottom-0 mt-auto pb-2", t), justify: "between", ...n, children: c }), H = g.forwardRef(
|
|
388
|
+
({ className: c, as: t = "div", cols: n, rows: r, gap: e, gapX: o, gapY: l, flow: s, ...x }, a) => /* @__PURE__ */ f(
|
|
390
389
|
t,
|
|
391
390
|
{
|
|
392
391
|
className: m(
|
|
@@ -505,12 +504,9 @@ const y = ({ children: c, className: t, direction: n = "col", ...r }) => {
|
|
|
505
504
|
}
|
|
506
505
|
)
|
|
507
506
|
);
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
return n ? /* @__PURE__ */ u.jsx(y, { as: "main", className: e, display: "block", ...r, children: c }) : /* @__PURE__ */ u.jsx(i.Item, { as: "main", className: e, ...r, children: c });
|
|
512
|
-
}, B = g.forwardRef(({ children: c, className: t, ...n }, r) => /* @__PURE__ */ u.jsx(
|
|
513
|
-
i,
|
|
507
|
+
H.displayName = "Grid";
|
|
508
|
+
const D = ({ children: c, sticky: t = !1, className: n, ...r }) => /* @__PURE__ */ f(i, { as: "header", className: m("top-0 ", t && "z-50 sticky", n), justify: "between", ...r, children: c }), R = g.forwardRef(({ children: c, className: t, ...n }, r) => /* @__PURE__ */ f(
|
|
509
|
+
y,
|
|
514
510
|
{
|
|
515
511
|
className: m("mx-auto w-full max-w-screen-xl h-screen flex-1", t),
|
|
516
512
|
direction: "col",
|
|
@@ -518,13 +514,13 @@ const C = ({ children: c, sticky: t = !1, className: n, ...r }) => /* @__PURE__
|
|
|
518
514
|
...n,
|
|
519
515
|
children: c
|
|
520
516
|
}
|
|
521
|
-
)),
|
|
517
|
+
)), E = Object.assign(R, { Header: F, Body: k, Footer: N });
|
|
522
518
|
export {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
519
|
+
C as B,
|
|
520
|
+
z as C,
|
|
521
|
+
q as F,
|
|
522
|
+
H as G,
|
|
523
|
+
D as H,
|
|
524
|
+
E as L,
|
|
525
|
+
A as a
|
|
530
526
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { CircleX as s, RotateCcw as d, Loader2 as m, FileQuestion as u, Home as f } from "lucide-react";
|
|
3
|
+
import { Button as h } from "@/forms";
|
|
4
|
+
import { Flex as o, Box as p } from "@/layout";
|
|
5
|
+
import { Heading as g, Code as w } from "@/typography";
|
|
6
|
+
import { Button as x } from "@/forms/Button";
|
|
7
|
+
import { Flex as y } from "@/layout/Flex";
|
|
8
|
+
import { cn as N } from "@/utils";
|
|
9
|
+
const c = ({ variant: e, iconComponent: r, message: t, children: a }) => {
|
|
10
|
+
if (!r && !t && !a)
|
|
11
|
+
return /* @__PURE__ */ n(o, { align: "center", className: "h-full w-full", justify: "center", children: "Content missing" });
|
|
12
|
+
const l = r || null;
|
|
13
|
+
return /* @__PURE__ */ n(o, { align: "center", className: "h-full w-full", justify: "center", children: /* @__PURE__ */ i(o, { direction: "col", justify: "center", children: [
|
|
14
|
+
l && /* @__PURE__ */ n(o, { align: "center", className: "my-6", gapX: "4", justify: "center", children: /* @__PURE__ */ n(
|
|
15
|
+
l,
|
|
16
|
+
{
|
|
17
|
+
"aria-hidden": !!t,
|
|
18
|
+
"aria-label": t ? void 0 : `${e || "info"} icon`,
|
|
19
|
+
className: N(
|
|
20
|
+
e === "error" && "text-destructive",
|
|
21
|
+
e === "success" && "text-success",
|
|
22
|
+
e === "warning" && "text-warning",
|
|
23
|
+
e === "info" && "text-info"
|
|
24
|
+
),
|
|
25
|
+
"data-testid": "icon",
|
|
26
|
+
role: t ? void 0 : "img",
|
|
27
|
+
size: 128
|
|
28
|
+
}
|
|
29
|
+
) }),
|
|
30
|
+
/* @__PURE__ */ i(o, { className: "max-w-[500px]", direction: "col", justify: "center", children: [
|
|
31
|
+
t ? /* @__PURE__ */ n(g, { align: "center", level: "4", weight: "normal", children: t }) : null,
|
|
32
|
+
a
|
|
33
|
+
] })
|
|
34
|
+
] }) });
|
|
35
|
+
}, C = ({ message: e = "Something went wrong.", children: r }) => /* @__PURE__ */ n(c, { iconComponent: s, message: e, variant: "error", children: r }), v = () => {
|
|
36
|
+
try {
|
|
37
|
+
window.location.reload();
|
|
38
|
+
} catch {
|
|
39
|
+
console.warn("Page reload prevented in test environment");
|
|
40
|
+
}
|
|
41
|
+
}, R = ({ error: e, onRetry: r = v }) => /* @__PURE__ */ n(C, { children: /* @__PURE__ */ i(o, { align: "center", className: "mt-8", direction: "col", children: [
|
|
42
|
+
/* @__PURE__ */ n(p, { className: "mb-8 p-4", variant: "muted", width: "full", children: /* @__PURE__ */ n(w, { align: "center", size: "xs", variant: "inherit", children: e.message || "Unknown error occurred" }) }),
|
|
43
|
+
/* @__PURE__ */ n(h, { icon: /* @__PURE__ */ n(d, {}), onClick: r, variant: "primary", children: "Reload" })
|
|
44
|
+
] }) }), j = () => /* @__PURE__ */ n(m, { className: "animate-spin text-info", "data-testid": "icon", size: 64 }), $ = ({ iconComponent: e, message: r }) => /* @__PURE__ */ n(c, { iconComponent: e || j, message: r }), H = ({ goHome: e, message: r = "404: Not found" }) => /* @__PURE__ */ n(c, { iconComponent: u, message: r, variant: "warning", children: /* @__PURE__ */ n(y, { align: "center", className: "mt-8", direction: "col", children: e && /* @__PURE__ */ n(x, { icon: /* @__PURE__ */ n(f, {}), onClick: e, variant: "primary", children: "Home" }) }) });
|
|
45
|
+
export {
|
|
46
|
+
R as E,
|
|
47
|
+
c as I,
|
|
48
|
+
$ as P,
|
|
49
|
+
C as a,
|
|
50
|
+
H as b
|
|
51
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { Sidebar as f, SidebarHeader as g, SidebarMenu as d, SidebarMenuItem as l, SidebarMenuButton as c, SidebarContent as x, SidebarGroup as C, SidebarGroupContent as M, SidebarFooter as N, SidebarTrigger as k, SidebarSeparator as u, SidebarRail as F, SidebarProvider as T, SidebarInset as j } from "@/components/ui/sidebar";
|
|
3
|
+
import { SquareArrowOutUpRight as v } from "lucide-react";
|
|
4
|
+
import { Fragment as z } from "react";
|
|
5
|
+
import { ThemeSelector as $ } from "@/components/ThemeSelector/ThemeSelector";
|
|
6
|
+
import { Flex as w } from "@/layout";
|
|
7
|
+
import { Text as y } from "@/typography";
|
|
8
|
+
const m = ({ children: i }) => /* @__PURE__ */ e(y, { size: "base", truncate: !0, children: i }), A = ({ itemSet: i, activeSlug: n }) => /* @__PURE__ */ e(h, { children: i.links.map((r) => /* @__PURE__ */ e(l, { className: "hover:cursor-pointer", onClick: r.onClick, children: /* @__PURE__ */ e(c, { asChild: !0, isActive: n === r.slug, children: /* @__PURE__ */ a("span", { children: [
|
|
9
|
+
/* @__PURE__ */ e(r.icon, {}),
|
|
10
|
+
/* @__PURE__ */ e(m, { children: r.title }),
|
|
11
|
+
r.external && /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(v, { size: 12, strokeWidth: 1.5 }) })
|
|
12
|
+
] }) }) }, r.slug)) }), s = ({ itemSets: i, activeSlug: n }) => /* @__PURE__ */ e(d, { children: i.map((r, t) => /* @__PURE__ */ a(z, { children: [
|
|
13
|
+
/* @__PURE__ */ e(A, { activeSlug: n, itemSet: r }),
|
|
14
|
+
t < i.length - 1 && /* @__PURE__ */ e(u, {})
|
|
15
|
+
] }, `item-set-${t}`)) }), G = ({
|
|
16
|
+
brandContent: i,
|
|
17
|
+
brandOnClick: n,
|
|
18
|
+
activeSlug: r,
|
|
19
|
+
itemSets: t,
|
|
20
|
+
bottomItemSets: o = [],
|
|
21
|
+
theme: S,
|
|
22
|
+
setTheme: b,
|
|
23
|
+
...p
|
|
24
|
+
}) => /* @__PURE__ */ a(f, { collapsible: "icon", ...p, children: [
|
|
25
|
+
/* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(
|
|
26
|
+
c,
|
|
27
|
+
{
|
|
28
|
+
className: n ? "cursor-pointer" : "cursor-default",
|
|
29
|
+
onClick: n,
|
|
30
|
+
size: "lg",
|
|
31
|
+
children: i
|
|
32
|
+
}
|
|
33
|
+
) }) }) }),
|
|
34
|
+
/* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(s, { activeSlug: r, itemSets: t }) }) }) }),
|
|
35
|
+
/* @__PURE__ */ e(N, { className: "mb-4", children: /* @__PURE__ */ a(d, { children: [
|
|
36
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(c, { asChild: !0, children: /* @__PURE__ */ e(k, { className: "justify-start font-normal", children: /* @__PURE__ */ e(m, { children: "Collapse menu" }) }) }) }),
|
|
37
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(c, { asChild: !0, children: /* @__PURE__ */ e($, { buttonClassName: "p-0", setTheme: b, theme: S, variant: "stacked" }) }) }),
|
|
38
|
+
o.length > 0 && /* @__PURE__ */ a(h, { children: [
|
|
39
|
+
/* @__PURE__ */ e(u, {}),
|
|
40
|
+
/* @__PURE__ */ e(s, { activeSlug: r, itemSets: o })
|
|
41
|
+
] })
|
|
42
|
+
] }) }),
|
|
43
|
+
/* @__PURE__ */ e(F, {})
|
|
44
|
+
] }), U = ({ children: i, ...n }) => /* @__PURE__ */ a(T, { children: [
|
|
45
|
+
/* @__PURE__ */ e(G, { ...n }),
|
|
46
|
+
/* @__PURE__ */ e(j, { className: "max-w-screen-xl", children: i })
|
|
47
|
+
] });
|
|
48
|
+
export {
|
|
49
|
+
m as M,
|
|
50
|
+
G as S,
|
|
51
|
+
U as a
|
|
52
|
+
};
|