@still-forest/canopy 0.42.0 → 0.42.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.
@@ -1,8 +1,8 @@
1
1
  import { j as e } from "./jsx-runtime-B0GD0xBr.js";
2
- import { e as h, f as a, B as C, g as w, h as N, i as j, j as x, k as m, l as v, m as z, n as T, o as _, S as q, p as y, q as F, r as $, s as U } from "./sidebar-Dub2Iudi.js";
3
- import { Fragment as B } from "react";
4
- import { c as p } from "./index-CRiPKpXj.js";
5
- import { F as g } from "./Layout-CvVv48kM.js";
2
+ import { e as l, f as a, B as v, g as C, h as N, i as k, j as m, k as j, l as z, m as T, n as _, o as q, S as F, p as g, q as $, r as U, s as B } from "./sidebar-Dub2Iudi.js";
3
+ import { Fragment as H } from "react";
4
+ import { c as h } from "./index-CRiPKpXj.js";
5
+ import { F as S } from "./Layout-CvVv48kM.js";
6
6
  import { T as b } from "./Heading-DjVutKs1.js";
7
7
  /**
8
8
  * @license lucide-react v0.544.0 - ISC
@@ -10,19 +10,19 @@ import { T as b } from "./Heading-DjVutKs1.js";
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const H = [
13
+ const I = [
14
14
  ["rect", { width: "14", height: "8", x: "5", y: "2", rx: "2", key: "wc9tft" }],
15
15
  ["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", key: "w68u3i" }],
16
16
  ["path", { d: "M6 18h2", key: "rwmk9e" }],
17
17
  ["path", { d: "M12 18h6", key: "aqd8w3" }]
18
- ], I = h("computer", H);
18
+ ], L = l("computer", I);
19
19
  /**
20
20
  * @license lucide-react v0.544.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
24
  */
25
- const L = [
25
+ const R = [
26
26
  ["path", { d: "M12 17v4", key: "1riwvh" }],
27
27
  ["path", { d: "m14.305 7.53.923-.382", key: "1mlnsw" }],
28
28
  ["path", { d: "m15.228 4.852-.923-.383", key: "82mpwg" }],
@@ -35,14 +35,14 @@ const L = [
35
35
  ["path", { d: "M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7", key: "1tnzv8" }],
36
36
  ["path", { d: "M8 21h8", key: "1ev6f3" }],
37
37
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }]
38
- ], R = h("monitor-cog", L);
38
+ ], A = l("monitor-cog", R);
39
39
  /**
40
40
  * @license lucide-react v0.544.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
44
  */
45
- const A = [
45
+ const G = [
46
46
  [
47
47
  "path",
48
48
  {
@@ -50,25 +50,25 @@ const A = [
50
50
  key: "kfwtm"
51
51
  }
52
52
  ]
53
- ], S = h("moon", A);
53
+ ], f = l("moon", G);
54
54
  /**
55
55
  * @license lucide-react v0.544.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- const G = [
60
+ const V = [
61
61
  ["path", { d: "M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6", key: "y09zxi" }],
62
62
  ["path", { d: "m21 3-9 9", key: "mpx6sq" }],
63
63
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }]
64
- ], V = h("square-arrow-out-up-right", G);
64
+ ], D = l("square-arrow-out-up-right", V);
65
65
  /**
66
66
  * @license lucide-react v0.544.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
70
  */
71
- const D = [
71
+ const E = [
72
72
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
73
73
  ["path", { d: "M12 2v2", key: "tus03m" }],
74
74
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -78,105 +78,121 @@ const D = [
78
78
  ["path", { d: "M20 12h2", key: "1q8mjw" }],
79
79
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
80
80
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
81
- ], f = h("sun", D), k = [
81
+ ], M = l("sun", E), u = [
82
82
  {
83
83
  theme: "light",
84
- icon: /* @__PURE__ */ e.jsx(f, {}),
84
+ icon: /* @__PURE__ */ e.jsx(M, {}),
85
85
  label: "Light mode"
86
86
  },
87
87
  {
88
88
  theme: "dark",
89
- icon: /* @__PURE__ */ e.jsx(S, {}),
89
+ icon: /* @__PURE__ */ e.jsx(f, {}),
90
90
  label: "Dark mode"
91
91
  },
92
92
  {
93
93
  theme: "system",
94
- icon: /* @__PURE__ */ e.jsx(I, {}),
94
+ icon: /* @__PURE__ */ e.jsx(L, {}),
95
95
  label: "System theme"
96
96
  }
97
- ], E = ({ theme: t, setTheme: r, className: s, buttonClassName: n, ...c }) => {
97
+ ], P = ({
98
+ theme: r,
99
+ setTheme: t,
100
+ className: s,
101
+ containerClassName: n,
102
+ buttonClassName: c,
103
+ ...i
104
+ }) => {
98
105
  const o = () => {
99
- r(t === "light" ? "dark" : t === "dark" ? "system" : "light");
100
- }, i = k.find((l) => l.theme === t)?.icon, d = k.find((l) => l.theme === t)?.label;
101
- return /* @__PURE__ */ e.jsx("span", { className: p(s), ...c, children: /* @__PURE__ */ e.jsxs(C, { className: p("p-1 w-full", n), onClick: o, variant: "unstyled", children: [
102
- i,
103
- /* @__PURE__ */ e.jsx(b, { size: "base", truncate: !0, children: d })
106
+ t(r === "light" ? "dark" : r === "dark" ? "system" : "light");
107
+ }, d = u.find((x) => x.theme === r)?.icon, p = u.find((x) => x.theme === r)?.label;
108
+ return /* @__PURE__ */ e.jsx("span", { className: h(n), ...i, children: /* @__PURE__ */ e.jsxs(v, { className: h("p-1 w-full", c), onClick: o, variant: "unstyled", children: [
109
+ d,
110
+ /* @__PURE__ */ e.jsx(b, { className: s, size: "base", truncate: !0, children: p })
104
111
  ] }) });
105
- }, P = ({
106
- variant: t = "horizontal",
107
- theme: r,
112
+ }, W = ({
113
+ variant: r = "horizontal",
114
+ theme: t,
108
115
  setTheme: s,
109
116
  className: n,
110
- buttonClassName: c,
117
+ containerClassName: c,
118
+ buttonClassName: i,
111
119
  ...o
112
120
  }) => {
113
- const i = (d) => r === d ? "text-primary/75" : "text-primary/25 hover:text-primary";
114
- return t === "stacked" ? /* @__PURE__ */ e.jsx(
115
- E,
121
+ const d = (p) => t === p ? "text-primary/75" : "text-primary/25 hover:text-primary";
122
+ return r === "stacked" ? /* @__PURE__ */ e.jsx(
123
+ P,
116
124
  {
117
- buttonClassName: c,
125
+ buttonClassName: i,
118
126
  className: n,
127
+ containerClassName: c,
119
128
  setTheme: s,
120
- theme: r,
129
+ theme: t,
121
130
  ...o
122
131
  }
123
- ) : /* @__PURE__ */ e.jsxs(g, { gap: "4", children: [
132
+ ) : /* @__PURE__ */ e.jsxs(S, { className: c, gap: "4", children: [
124
133
  /* @__PURE__ */ e.jsxs(a, { children: [
125
- /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(R, { className: i("system"), onClick: () => s("system"), size: 32 }) }),
134
+ /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(
135
+ A,
136
+ {
137
+ className: h(d("system"), i),
138
+ onClick: () => s("system"),
139
+ size: 32
140
+ }
141
+ ) }),
126
142
  /* @__PURE__ */ e.jsx(a.Content, { children: "Use system theme" })
127
143
  ] }),
128
144
  /* @__PURE__ */ e.jsxs(a, { children: [
129
- /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(f, { className: i("light"), onClick: () => s("light"), size: 32 }) }),
145
+ /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(M, { className: h(d("light"), i), onClick: () => s("light"), size: 32 }) }),
130
146
  /* @__PURE__ */ e.jsx(a.Content, { children: "Use light theme" })
131
147
  ] }),
132
148
  /* @__PURE__ */ e.jsxs(a, { children: [
133
- /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(S, { className: i("dark"), onClick: () => s("dark"), size: 32 }) }),
149
+ /* @__PURE__ */ e.jsx(a.Trigger, { children: /* @__PURE__ */ e.jsx(f, { className: h(d("dark"), i), onClick: () => s("dark"), size: 32 }) }),
134
150
  /* @__PURE__ */ e.jsx(a.Content, { children: "Use dark theme" })
135
151
  ] })
136
152
  ] });
137
- }, M = ({ children: t }) => /* @__PURE__ */ e.jsx(b, { size: "base", truncate: !0, children: t }), W = ({ itemSet: t, activeSlug: r }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: t.links.map((s) => /* @__PURE__ */ e.jsx(x, { className: "hover:cursor-pointer", onClick: s.onClick, children: /* @__PURE__ */ e.jsx(m, { asChild: !0, isActive: r === s.slug, children: /* @__PURE__ */ e.jsxs("span", { children: [
153
+ }, w = ({ children: r }) => /* @__PURE__ */ e.jsx(b, { size: "base", truncate: !0, children: r }), J = ({ itemSet: r, activeSlug: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: r.links.map((s) => /* @__PURE__ */ e.jsx(m, { className: "hover:cursor-pointer", onClick: s.onClick, children: /* @__PURE__ */ e.jsx(j, { asChild: !0, isActive: t === s.slug, children: /* @__PURE__ */ e.jsxs("span", { children: [
138
154
  /* @__PURE__ */ e.jsx(s.icon, {}),
139
- /* @__PURE__ */ e.jsx(M, { children: s.title }),
140
- s.external && /* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsx(V, { size: 12, strokeWidth: 1.5 }) })
141
- ] }) }) }, s.slug)) }), u = ({ itemSets: t, activeSlug: r }) => /* @__PURE__ */ e.jsx(j, { children: t.map((s, n) => /* @__PURE__ */ e.jsxs(B, { children: [
142
- /* @__PURE__ */ e.jsx(W, { activeSlug: r, itemSet: s }),
143
- n < t.length - 1 && /* @__PURE__ */ e.jsx(y, {})
144
- ] }, `item-set-${n}`)) }), J = ({
145
- brandContent: t,
146
- brandOnClick: r,
155
+ /* @__PURE__ */ e.jsx(w, { children: s.title }),
156
+ s.external && /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsx(D, { size: 12, strokeWidth: 1.5 }) })
157
+ ] }) }) }, s.slug)) }), y = ({ itemSets: r, activeSlug: t }) => /* @__PURE__ */ e.jsx(k, { children: r.map((s, n) => /* @__PURE__ */ e.jsxs(H, { children: [
158
+ /* @__PURE__ */ e.jsx(J, { activeSlug: t, itemSet: s }),
159
+ n < r.length - 1 && /* @__PURE__ */ e.jsx(g, {})
160
+ ] }, `item-set-${n}`)) }), K = ({
161
+ brandContent: r,
162
+ brandOnClick: t,
147
163
  activeSlug: s,
148
164
  itemSets: n,
149
165
  bottomItemSets: c = [],
150
- theme: o,
151
- setTheme: i,
166
+ theme: i,
167
+ setTheme: o,
152
168
  ...d
153
- }) => /* @__PURE__ */ e.jsxs(w, { collapsible: "icon", ...d, children: [
154
- /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(j, { children: /* @__PURE__ */ e.jsx(x, { children: /* @__PURE__ */ e.jsx(
155
- m,
169
+ }) => /* @__PURE__ */ e.jsxs(C, { collapsible: "icon", ...d, children: [
170
+ /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsx(k, { children: /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(
171
+ j,
156
172
  {
157
- className: r ? "cursor-pointer" : "cursor-default",
158
- onClick: r,
173
+ className: t ? "cursor-pointer" : "cursor-default",
174
+ onClick: t,
159
175
  size: "lg",
160
- children: t
176
+ children: r
161
177
  }
162
178
  ) }) }) }),
163
- /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsx(z, { children: /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(u, { activeSlug: s, itemSets: n }) }) }) }),
164
- /* @__PURE__ */ e.jsx(_, { className: "mb-4", children: /* @__PURE__ */ e.jsxs(j, { children: [
165
- /* @__PURE__ */ e.jsx(x, { children: /* @__PURE__ */ e.jsx(m, { asChild: !0, children: /* @__PURE__ */ e.jsx(q, { className: "justify-start font-normal", children: /* @__PURE__ */ e.jsx(M, { children: "Collapse menu" }) }) }) }),
166
- /* @__PURE__ */ e.jsx(x, { children: /* @__PURE__ */ e.jsx(m, { asChild: !0, children: /* @__PURE__ */ e.jsx(P, { buttonClassName: "p-0", setTheme: i, theme: o, variant: "stacked" }) }) }),
179
+ /* @__PURE__ */ e.jsx(z, { children: /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(_, { children: /* @__PURE__ */ e.jsx(y, { activeSlug: s, itemSets: n }) }) }) }),
180
+ /* @__PURE__ */ e.jsx(q, { className: "mb-4", children: /* @__PURE__ */ e.jsxs(k, { children: [
181
+ /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(j, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { className: "justify-start font-normal", children: /* @__PURE__ */ e.jsx(w, { children: "Collapse menu" }) }) }) }),
182
+ /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(j, { asChild: !0, children: /* @__PURE__ */ e.jsx(W, { buttonClassName: "p-0", setTheme: o, theme: i, variant: "stacked" }) }) }),
167
183
  c.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
168
- /* @__PURE__ */ e.jsx(y, {}),
169
- /* @__PURE__ */ e.jsx(u, { activeSlug: s, itemSets: c })
184
+ /* @__PURE__ */ e.jsx(g, {}),
185
+ /* @__PURE__ */ e.jsx(y, { activeSlug: s, itemSets: c })
170
186
  ] })
171
187
  ] }) }),
172
- /* @__PURE__ */ e.jsx(F, {})
173
- ] }), ee = ({ children: t, ...r }) => /* @__PURE__ */ e.jsxs($, { children: [
174
- /* @__PURE__ */ e.jsx(J, { ...r }),
175
- /* @__PURE__ */ e.jsx(U, { className: "max-w-screen-xl", children: t })
188
+ /* @__PURE__ */ e.jsx($, {})
189
+ ] }), se = ({ children: r, ...t }) => /* @__PURE__ */ e.jsxs(U, { children: [
190
+ /* @__PURE__ */ e.jsx(K, { ...t }),
191
+ /* @__PURE__ */ e.jsx(B, { className: "max-w-screen-xl", children: r })
176
192
  ] });
177
193
  export {
178
- M,
179
- J as S,
180
- P as T,
181
- ee as a
194
+ w as M,
195
+ K as S,
196
+ W as T,
197
+ se as a
182
198
  };
package/dist/index.d.ts CHANGED
@@ -969,13 +969,14 @@ declare type TextTracking = (typeof TEXT_TRACKINGS)[number];
969
969
 
970
970
  export declare type Theme = "system" | "light" | "dark";
971
971
 
972
- export declare const ThemeSelector: ({ variant, theme, setTheme, className, buttonClassName, ...props }: ThemeSelectorProps) => JSX.Element;
972
+ export declare const ThemeSelector: ({ variant, theme, setTheme, className, containerClassName, buttonClassName, ...props }: ThemeSelectorProps) => JSX.Element;
973
973
 
974
974
  export declare interface ThemeSelectorProps {
975
975
  variant?: "horizontal" | "stacked";
976
976
  theme: Theme;
977
977
  setTheme: (theme: Theme) => void;
978
978
  className?: string;
979
+ containerClassName?: string;
979
980
  buttonClassName?: string;
980
981
  }
981
982
 
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { Fragment as te, useState as re, useEffect as se, useMemo as ne } from "
7
7
  import { L as Qa } from "./chunks/Loader-DDhZhyvW.js";
8
8
  import { g as I, h as oe, I as ie } from "./chunks/Switch-B-zrBW1-.js";
9
9
  import { C as Wa, a as Ya, b as Za, D as et, L as at, P as tt, R as rt, c as st, d as nt, e as ot, S as it, f as lt } from "./chunks/Switch-B-zrBW1-.js";
10
- import { M as dt, S as ut, a as bt, T as gt } from "./chunks/SidebarLayout-BhtFQllz.js";
10
+ import { M as dt, S as ut, a as bt, T as gt } from "./chunks/SidebarLayout-DBGn2rXK.js";
11
11
  import { E as pt, a as xt, I as ft, P as vt, b as ht } from "./chunks/PageNotFound-CPlMTx3M.js";
12
12
  import { B as jt, C as Nt, F as kt, a as wt, G as Tt, H as Ct, L as It } from "./chunks/Layout-CvVv48kM.js";
13
13
  import { C as Mt } from "./chunks/Code-BLilg72p.js";
@@ -1,4 +1,4 @@
1
- import { M as r, S as o, a as t } from "./chunks/SidebarLayout-BhtFQllz.js";
1
+ import { M as r, S as o, a as t } from "./chunks/SidebarLayout-DBGn2rXK.js";
2
2
  import { S as i } from "./chunks/sidebar-Dub2Iudi.js";
3
3
  export {
4
4
  r as MenuItemText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@still-forest/canopy",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "author": "John Szymanowski",
5
5
  "license": "MIT",
6
6
  "description": "React components, built with Tailwind CSS, Shadcn, and VisX",