@still-forest/canopy 0.29.0 → 0.29.1

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.
@@ -0,0 +1,6 @@
1
+ import { j as e } from "./jsx-runtime-B0GD0xBr.js";
2
+ import { T as s } from "./Heading-Bpvbpnw2.js";
3
+ const r = ({ children: o, ...t }) => /* @__PURE__ */ e.jsx(s, { className: "inline-block w-fit rounded bg-accent px-2", family: "mono", size: "sm", variant: "accent", ...t, children: o });
4
+ export {
5
+ r as C
6
+ };
@@ -0,0 +1,251 @@
1
+ import { j as b } from "./jsx-runtime-B0GD0xBr.js";
2
+ import p from "react";
3
+ import { c as h } from "./index-CRiPKpXj.js";
4
+ const y = p.forwardRef(
5
+ ({
6
+ className: c,
7
+ as: o,
8
+ size: e,
9
+ weight: d,
10
+ variant: t = "default",
11
+ align: n,
12
+ leading: s,
13
+ // No default: Tailwind applies a default from text size classes
14
+ tracking: r,
15
+ family: f = "display",
16
+ asForeground: x = !1,
17
+ truncate: m = !1,
18
+ numeric: u = !1,
19
+ ...i
20
+ }, a) => {
21
+ const g = o || "p";
22
+ return /* @__PURE__ */ b.jsx(
23
+ g,
24
+ {
25
+ className: h(
26
+ // Font sizes
27
+ {
28
+ "text-xs": e === "xs",
29
+ "text-sm": e === "sm",
30
+ "text-base": e === "base" || e === "md",
31
+ "text-lg": e === "lg",
32
+ "text-xl": e === "xl",
33
+ "text-2xl": e === "2xl",
34
+ "text-3xl": e === "3xl",
35
+ "text-4xl": e === "4xl",
36
+ "text-5xl": e === "5xl",
37
+ "text-6xl": e === "6xl",
38
+ "text-7xl": e === "7xl",
39
+ "text-8xl": e === "8xl",
40
+ "text-9xl": e === "9xl"
41
+ },
42
+ // Font weights
43
+ {
44
+ "font-thin": d === "thin",
45
+ "font-extralight": d === "extralight",
46
+ "font-light": d === "light",
47
+ "font-normal": d === "normal",
48
+ "font-medium": d === "medium",
49
+ "font-semibold": d === "semibold",
50
+ "font-bold": d === "bold",
51
+ "font-extrabold": d === "extrabold",
52
+ "font-black": d === "black"
53
+ },
54
+ // Text colors (variants)
55
+ {
56
+ "text-foreground": t === "default",
57
+ "text-inherit": t === "inherit",
58
+ "text-muted-foreground": t === "muted",
59
+ "text-accent-foreground": t === "accent",
60
+ // Action colors
61
+ "text-primary-foreground": t === "primary",
62
+ "text-secondary-foreground": t === "secondary",
63
+ // Accent colors (rich color variants)
64
+ "text-info": !x && t === "info",
65
+ "text-warning": !x && t === "warning",
66
+ "text-destructive": !x && t === "destructive",
67
+ "text-success": !x && t === "success",
68
+ // Accent colors (foreground variants)
69
+ "text-info-foreground": x && t === "info",
70
+ "text-warning-foreground": x && t === "warning",
71
+ "text-destructive-foreground": x && t === "destructive",
72
+ "text-success-foreground": x && t === "success"
73
+ },
74
+ // Text alignment
75
+ {
76
+ "text-left": n === "left",
77
+ "text-center": n === "center",
78
+ "text-right": n === "right",
79
+ "text-justify": n === "justify",
80
+ "text-start": n === "start",
81
+ "text-end": n === "end"
82
+ },
83
+ // Leading (line height)
84
+ {
85
+ "leading-none": s === "none",
86
+ "leading-tight": s === "tight",
87
+ "leading-snug": s === "snug",
88
+ "leading-normal": s === "normal",
89
+ "leading-relaxed": s === "relaxed",
90
+ "leading-loose": s === "loose"
91
+ },
92
+ // Tracking (letter spacing)
93
+ {
94
+ "tracking-tighter": r === "tighter",
95
+ "tracking-tight": r === "tight",
96
+ "tracking-normal": r === "normal",
97
+ "tracking-wide": r === "wide",
98
+ "tracking-wider": r === "wider",
99
+ "tracking-widest": r === "widest"
100
+ },
101
+ // Font family
102
+ {
103
+ "font-display": f === "display",
104
+ "font-sans": f === "sans",
105
+ "font-serif": f === "serif",
106
+ "font-mono": f === "mono"
107
+ },
108
+ // Truncation
109
+ m && "truncate",
110
+ // Tabular numerals
111
+ u && "tabular-nums",
112
+ c
113
+ ),
114
+ ref: a,
115
+ ...i
116
+ }
117
+ );
118
+ }
119
+ );
120
+ y.displayName = "Text";
121
+ const j = p.forwardRef(
122
+ ({
123
+ className: c,
124
+ variant: o = "default",
125
+ level: e = "2",
126
+ size: d,
127
+ weight: t = "bold",
128
+ // Typical default browser style for headings
129
+ align: n,
130
+ leading: s,
131
+ // No default: Tailwind applies a default from text size classes
132
+ tracking: r,
133
+ family: f = "display",
134
+ asForeground: x = !1,
135
+ truncate: m = !1,
136
+ numeric: u = !1,
137
+ ...i
138
+ }, a) => {
139
+ const g = `h${e}`, l = d || {
140
+ 1: "4xl",
141
+ 2: "3xl",
142
+ 3: "2xl",
143
+ 4: "xl",
144
+ 5: "lg",
145
+ 6: "base"
146
+ }[e];
147
+ return /* @__PURE__ */ b.jsx(
148
+ g,
149
+ {
150
+ className: h(
151
+ // Size scales
152
+ {
153
+ "text-xs": l === "xs",
154
+ "text-sm": l === "sm",
155
+ "text-base": l === "base" || l === "md",
156
+ "text-lg": l === "lg",
157
+ "text-xl": l === "xl",
158
+ "text-2xl": l === "2xl",
159
+ "text-3xl": l === "3xl",
160
+ "text-4xl": l === "4xl",
161
+ "text-5xl": l === "5xl",
162
+ "text-6xl": l === "6xl",
163
+ "text-7xl": l === "7xl",
164
+ "text-8xl": l === "8xl",
165
+ "text-9xl": l === "9xl"
166
+ },
167
+ // Font weights
168
+ {
169
+ "font-thin": t === "thin",
170
+ "font-extralight": t === "extralight",
171
+ "font-light": t === "light",
172
+ "font-normal": t === "normal",
173
+ "font-medium": t === "medium",
174
+ "font-semibold": t === "semibold",
175
+ "font-bold": t === "bold",
176
+ "font-extrabold": t === "extrabold",
177
+ "font-black": t === "black"
178
+ },
179
+ // Text colors (variants)
180
+ {
181
+ "text-foreground": o === "default",
182
+ "text-inherit": o === "inherit",
183
+ "text-muted-foreground": o === "muted",
184
+ "text-accent-foreground": o === "accent",
185
+ // Action colors
186
+ "text-primary-foreground": o === "primary",
187
+ "text-secondary-foreground": o === "secondary",
188
+ // Accent colors (rich color variants)
189
+ "text-info": !x && o === "info",
190
+ "text-warning": !x && o === "warning",
191
+ "text-destructive": !x && o === "destructive",
192
+ "text-success": !x && o === "success",
193
+ // Accent colors (foreground variants)
194
+ "text-info-foreground": x && o === "info",
195
+ "text-warning-foreground": x && o === "warning",
196
+ "text-destructive-foreground": x && o === "destructive",
197
+ "text-success-foreground": x && o === "success"
198
+ },
199
+ // Text alignment
200
+ {
201
+ "text-left": n === "left",
202
+ "text-center": n === "center",
203
+ "text-right": n === "right",
204
+ "text-justify": n === "justify",
205
+ "text-start": n === "start",
206
+ "text-end": n === "end"
207
+ },
208
+ // Leading (line height)
209
+ {
210
+ "leading-none": s === "none",
211
+ "leading-tight": s === "tight",
212
+ "leading-snug": s === "snug",
213
+ "leading-normal": s === "normal",
214
+ "leading-relaxed": s === "relaxed",
215
+ "leading-loose": s === "loose"
216
+ },
217
+ // Tracking (letter spacing)
218
+ {
219
+ "tracking-tighter": r === "tighter",
220
+ "tracking-tight": r === "tight",
221
+ "tracking-normal": r === "normal",
222
+ "tracking-wide": r === "wide",
223
+ "tracking-wider": r === "wider",
224
+ "tracking-widest": r === "widest"
225
+ },
226
+ // Font family
227
+ {
228
+ "font-display": f === "display",
229
+ "font-sans": f === "sans",
230
+ "font-serif": f === "serif",
231
+ "font-mono": f === "mono"
232
+ },
233
+ // Truncation
234
+ m && "truncate",
235
+ // Tabular numerals
236
+ u && "tabular-nums",
237
+ // Add some scroll margin for better anchor navigation
238
+ "scroll-m-20",
239
+ c
240
+ ),
241
+ ref: a,
242
+ ...i
243
+ }
244
+ );
245
+ }
246
+ );
247
+ j.displayName = "Heading";
248
+ export {
249
+ j as H,
250
+ y as T
251
+ };
@@ -1,9 +1,7 @@
1
- import { jsx as f } from "react/jsx-runtime";
1
+ import { j as u } from "./jsx-runtime-B0GD0xBr.js";
2
2
  import g from "react";
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(
3
+ import { c as m } from "./index-CRiPKpXj.js";
4
+ const w = g.forwardRef(
7
5
  ({
8
6
  className: c,
9
7
  as: t = "div",
@@ -17,9 +15,9 @@ const C = g.forwardRef(
17
15
  overflow: a,
18
16
  overflowX: b,
19
17
  overflowY: d,
20
- rounded: u,
21
- ...w
22
- }, p) => /* @__PURE__ */ f(
18
+ rounded: f,
19
+ ...p
20
+ }, v) => /* @__PURE__ */ u.jsx(
23
21
  t,
24
22
  {
25
23
  className: m(
@@ -228,45 +226,48 @@ const C = g.forwardRef(
228
226
  },
229
227
  // Rounded
230
228
  {
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"
229
+ rounded: f === !0,
230
+ "rounded-none": f === "none",
231
+ "rounded-xs": f === "xs",
232
+ "rounded-sm": f === "sm",
233
+ "rounded-md": f === "md",
234
+ "rounded-lg": f === "lg",
235
+ "rounded-xl": f === "xl",
236
+ "rounded-2xl": f === "2xl",
237
+ "rounded-3xl": f === "3xl",
238
+ "rounded-full": f === "full"
241
239
  },
242
240
  c
243
241
  ),
244
- ref: p,
245
- ...w
242
+ ref: v,
243
+ ...p
246
244
  }
247
245
  )
248
246
  );
249
- C.displayName = "Box";
250
- const z = ({ children: c, className: t, direction: n = "col", ...r }) => {
247
+ w.displayName = "Box";
248
+ const y = ({ children: c, className: t, direction: n = "col", ...r }) => {
251
249
  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);
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(
250
+ return e === "block" ? /* @__PURE__ */ u.jsx(w, { className: l, ...o, children: c }) : /* @__PURE__ */ u.jsx(i, { className: l, direction: n, ...o, children: c });
251
+ }, j = ({ flex: c, className: t, as: n, children: r, ...e }) => {
252
+ const o = n || "div";
253
+ return /* @__PURE__ */ u.jsx(
254
+ o,
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
+ );
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(
270
271
  t,
271
272
  {
272
273
  className: m(
@@ -384,8 +385,8 @@ const z = ({ children: c, className: t, direction: n = "col", ...r }) => {
384
385
  ...b
385
386
  }
386
387
  )
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(
388
+ ), i = Object.assign(N, { Item: j }), k = ({ children: c, className: t, ...n }) => /* @__PURE__ */ u.jsx(y, { as: "footer", className: m("bottom-0 mt-auto pb-2", t), justify: "between", ...n, children: c }), R = g.forwardRef(
389
+ ({ className: c, as: t = "div", cols: n, rows: r, gap: e, gapX: o, gapY: l, flow: s, ...x }, a) => /* @__PURE__ */ u.jsx(
389
390
  t,
390
391
  {
391
392
  className: m(
@@ -504,9 +505,12 @@ const z = ({ children: c, className: t, direction: n = "col", ...r }) => {
504
505
  }
505
506
  )
506
507
  );
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,
508
+ R.displayName = "Grid";
509
+ const C = ({ children: c, sticky: t = !1, className: n, ...r }) => /* @__PURE__ */ u.jsx(y, { as: "header", className: m("top-0 ", t && "z-50 sticky", n), justify: "between", ...r, children: c }), F = ({ children: c, className: t, withContainer: n = !1, ...r }) => {
510
+ const e = m("flex-1 grow", t);
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,
510
514
  {
511
515
  className: m("mx-auto w-full max-w-screen-xl h-screen flex-1", t),
512
516
  direction: "col",
@@ -514,13 +518,13 @@ const D = ({ children: c, sticky: t = !1, className: n, ...r }) => /* @__PURE__
514
518
  ...n,
515
519
  children: c
516
520
  }
517
- )), E = Object.assign(R, { Header: F, Body: k, Footer: N });
521
+ )), H = Object.assign(B, { Header: C, Body: F, Footer: k });
518
522
  export {
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
523
+ w as B,
524
+ y as C,
525
+ i as F,
526
+ R as G,
527
+ C as H,
528
+ H as L,
529
+ k as a
526
530
  };
@@ -0,0 +1,107 @@
1
+ import { j as e } from "./jsx-runtime-B0GD0xBr.js";
2
+ import { c, B as l } from "./calendar-D21xByT8.js";
3
+ import "react";
4
+ import { F as o, B as d } from "./Layout-DAdzkAxW.js";
5
+ import { C as m } from "./Code-DSfz_jrJ.js";
6
+ import { H as h } from "./Heading-Bpvbpnw2.js";
7
+ import { c as x } from "./index-CRiPKpXj.js";
8
+ /**
9
+ * @license lucide-react v0.543.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const u = [
15
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
16
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
17
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
18
+ ], p = c("circle-x", u);
19
+ /**
20
+ * @license lucide-react v0.543.0 - ISC
21
+ *
22
+ * This source code is licensed under the ISC license.
23
+ * See the LICENSE file in the root directory of this source tree.
24
+ */
25
+ const f = [
26
+ ["path", { d: "M12 17h.01", key: "p32p05" }],
27
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }],
28
+ ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
29
+ ], j = c("file-question-mark", f);
30
+ /**
31
+ * @license lucide-react v0.543.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ const y = [
37
+ ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
38
+ [
39
+ "path",
40
+ {
41
+ d: "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
42
+ key: "r6nss1"
43
+ }
44
+ ]
45
+ ], w = c("house", y);
46
+ /**
47
+ * @license lucide-react v0.543.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */
52
+ const k = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], g = c("loader-circle", k);
53
+ /**
54
+ * @license lucide-react v0.543.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */
59
+ const N = [
60
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
61
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
62
+ ], v = c("rotate-ccw", N), a = ({ variant: n, iconComponent: t, message: r, children: i }) => {
63
+ if (!t && !r && !i)
64
+ return /* @__PURE__ */ e.jsx(o, { align: "center", className: "h-full w-full", justify: "center", children: "Content missing" });
65
+ const s = t || null;
66
+ return /* @__PURE__ */ e.jsx(o, { align: "center", className: "h-full w-full", justify: "center", children: /* @__PURE__ */ e.jsxs(o, { direction: "col", justify: "center", children: [
67
+ s && /* @__PURE__ */ e.jsx(o, { align: "center", className: "my-6", gapX: "4", justify: "center", children: /* @__PURE__ */ e.jsx(
68
+ s,
69
+ {
70
+ "aria-hidden": !!r,
71
+ "aria-label": r ? void 0 : `${n || "info"} icon`,
72
+ className: x(
73
+ n === "error" && "text-destructive",
74
+ n === "success" && "text-success",
75
+ n === "warning" && "text-warning",
76
+ n === "info" && "text-info"
77
+ ),
78
+ "data-testid": "icon",
79
+ role: r ? void 0 : "img",
80
+ size: 128
81
+ }
82
+ ) }),
83
+ /* @__PURE__ */ e.jsxs(o, { className: "max-w-[500px]", direction: "col", justify: "center", children: [
84
+ r ? /* @__PURE__ */ e.jsx(h, { align: "center", level: "4", weight: "normal", children: r }) : null,
85
+ i
86
+ ] })
87
+ ] }) });
88
+ }, C = ({ message: n = "Something went wrong.", children: t }) => /* @__PURE__ */ e.jsx(a, { iconComponent: p, message: n, variant: "error", children: t }), _ = () => {
89
+ try {
90
+ window.location.reload();
91
+ } catch {
92
+ console.warn("Page reload prevented in test environment");
93
+ }
94
+ }, E = ({ error: n, onRetry: t = _ }) => /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsxs(o, { align: "center", className: "mt-8", direction: "col", children: [
95
+ /* @__PURE__ */ e.jsx(d, { className: "mb-8 p-4", variant: "muted", width: "full", children: /* @__PURE__ */ e.jsx(m, { align: "center", size: "xs", variant: "inherit", children: n.message || "Unknown error occurred" }) }),
96
+ /* @__PURE__ */ e.jsx(l, { icon: /* @__PURE__ */ e.jsx(v, {}), onClick: t, variant: "primary", children: "Reload" })
97
+ ] }) }), M = () => /* @__PURE__ */ e.jsx(g, { className: "animate-spin text-info", "data-testid": "icon", size: 64 }), L = ({ iconComponent: n, message: t }) => {
98
+ const r = n || M;
99
+ return /* @__PURE__ */ e.jsx(a, { iconComponent: r, message: t });
100
+ }, P = ({ goHome: n, message: t = "404: Not found" }) => /* @__PURE__ */ e.jsx(a, { iconComponent: j, message: t, variant: "warning", children: /* @__PURE__ */ e.jsx(o, { align: "center", className: "mt-8", direction: "col", children: n && /* @__PURE__ */ e.jsx(l, { icon: /* @__PURE__ */ e.jsx(w, {}), onClick: n, variant: "primary", children: "Home" }) }) });
101
+ export {
102
+ E,
103
+ a as I,
104
+ L as P,
105
+ C as a,
106
+ P as b
107
+ };
@@ -0,0 +1,7 @@
1
+ import { j as o } from "./jsx-runtime-B0GD0xBr.js";
2
+ import { c as t } from "./index-CRiPKpXj.js";
3
+ import { T as p } from "./Heading-Bpvbpnw2.js";
4
+ const i = ({ children: r, className: s, as: a = "p", ...m }) => /* @__PURE__ */ o.jsx(p, { as: a, className: t("mb-4", s), ...m, children: r });
5
+ export {
6
+ i as P
7
+ };