@still-forest/canopy 0.24.0 → 0.25.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.
package/dist/Code.js ADDED
@@ -0,0 +1,6 @@
1
+ import { j as e } from "./utils.js";
2
+ import { T as s } from "./Heading.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,250 @@
1
+ import { j as b, c as p } from "./utils.js";
2
+ import h from "react";
3
+ const y = h.forwardRef(
4
+ ({
5
+ className: c,
6
+ as: o,
7
+ size: e,
8
+ weight: d,
9
+ variant: t = "default",
10
+ align: n,
11
+ leading: s,
12
+ // No default: Tailwind applies a default from text size classes
13
+ tracking: r,
14
+ family: f = "display",
15
+ asForeground: x = !1,
16
+ truncate: u = !1,
17
+ numeric: m = !1,
18
+ ...i
19
+ }, a) => {
20
+ const g = o || "p";
21
+ return /* @__PURE__ */ b.jsx(
22
+ g,
23
+ {
24
+ className: p(
25
+ // Font sizes
26
+ {
27
+ "text-xs": e === "xs",
28
+ "text-sm": e === "sm",
29
+ "text-base": e === "base" || e === "md",
30
+ "text-lg": e === "lg",
31
+ "text-xl": e === "xl",
32
+ "text-2xl": e === "2xl",
33
+ "text-3xl": e === "3xl",
34
+ "text-4xl": e === "4xl",
35
+ "text-5xl": e === "5xl",
36
+ "text-6xl": e === "6xl",
37
+ "text-7xl": e === "7xl",
38
+ "text-8xl": e === "8xl",
39
+ "text-9xl": e === "9xl"
40
+ },
41
+ // Font weights
42
+ {
43
+ "font-thin": d === "thin",
44
+ "font-extralight": d === "extralight",
45
+ "font-light": d === "light",
46
+ "font-normal": d === "normal",
47
+ "font-medium": d === "medium",
48
+ "font-semibold": d === "semibold",
49
+ "font-bold": d === "bold",
50
+ "font-extrabold": d === "extrabold",
51
+ "font-black": d === "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": !x && t === "info",
64
+ "text-warning": !x && t === "warning",
65
+ "text-destructive": !x && t === "destructive",
66
+ "text-success": !x && t === "success",
67
+ // Accent colors (foreground variants)
68
+ "text-info-foreground": x && t === "info",
69
+ "text-warning-foreground": x && t === "warning",
70
+ "text-destructive-foreground": x && t === "destructive",
71
+ "text-success-foreground": x && t === "success"
72
+ },
73
+ // Text alignment
74
+ {
75
+ "text-left": n === "left",
76
+ "text-center": n === "center",
77
+ "text-right": n === "right",
78
+ "text-justify": n === "justify",
79
+ "text-start": n === "start",
80
+ "text-end": n === "end"
81
+ },
82
+ // Leading (line height)
83
+ {
84
+ "leading-none": s === "none",
85
+ "leading-tight": s === "tight",
86
+ "leading-snug": s === "snug",
87
+ "leading-normal": s === "normal",
88
+ "leading-relaxed": s === "relaxed",
89
+ "leading-loose": s === "loose"
90
+ },
91
+ // Tracking (letter spacing)
92
+ {
93
+ "tracking-tighter": r === "tighter",
94
+ "tracking-tight": r === "tight",
95
+ "tracking-normal": r === "normal",
96
+ "tracking-wide": r === "wide",
97
+ "tracking-wider": r === "wider",
98
+ "tracking-widest": r === "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
+ m && "tabular-nums",
111
+ c
112
+ ),
113
+ ref: a,
114
+ ...i
115
+ }
116
+ );
117
+ }
118
+ );
119
+ y.displayName = "Text";
120
+ const j = h.forwardRef(
121
+ ({
122
+ className: c,
123
+ variant: o = "default",
124
+ level: e = "2",
125
+ size: d,
126
+ weight: t = "bold",
127
+ // Typical default browser style for headings
128
+ align: n,
129
+ leading: s,
130
+ // No default: Tailwind applies a default from text size classes
131
+ tracking: r,
132
+ family: f = "display",
133
+ asForeground: x = !1,
134
+ truncate: u = !1,
135
+ numeric: m = !1,
136
+ ...i
137
+ }, a) => {
138
+ const g = `h${e}`, l = d || {
139
+ 1: "4xl",
140
+ 2: "3xl",
141
+ 3: "2xl",
142
+ 4: "xl",
143
+ 5: "lg",
144
+ 6: "base"
145
+ }[e];
146
+ return /* @__PURE__ */ b.jsx(
147
+ g,
148
+ {
149
+ className: p(
150
+ // Size scales
151
+ {
152
+ "text-xs": l === "xs",
153
+ "text-sm": l === "sm",
154
+ "text-base": l === "base" || l === "md",
155
+ "text-lg": l === "lg",
156
+ "text-xl": l === "xl",
157
+ "text-2xl": l === "2xl",
158
+ "text-3xl": l === "3xl",
159
+ "text-4xl": l === "4xl",
160
+ "text-5xl": l === "5xl",
161
+ "text-6xl": l === "6xl",
162
+ "text-7xl": l === "7xl",
163
+ "text-8xl": l === "8xl",
164
+ "text-9xl": l === "9xl"
165
+ },
166
+ // Font weights
167
+ {
168
+ "font-thin": t === "thin",
169
+ "font-extralight": t === "extralight",
170
+ "font-light": t === "light",
171
+ "font-normal": t === "normal",
172
+ "font-medium": t === "medium",
173
+ "font-semibold": t === "semibold",
174
+ "font-bold": t === "bold",
175
+ "font-extrabold": t === "extrabold",
176
+ "font-black": t === "black"
177
+ },
178
+ // Text colors (variants)
179
+ {
180
+ "text-foreground": o === "default",
181
+ "text-inherit": o === "inherit",
182
+ "text-muted-foreground": o === "muted",
183
+ "text-accent-foreground": o === "accent",
184
+ // Action colors
185
+ "text-primary-foreground": o === "primary",
186
+ "text-secondary-foreground": o === "secondary",
187
+ // Accent colors (rich color variants)
188
+ "text-info": !x && o === "info",
189
+ "text-warning": !x && o === "warning",
190
+ "text-destructive": !x && o === "destructive",
191
+ "text-success": !x && o === "success",
192
+ // Accent colors (foreground variants)
193
+ "text-info-foreground": x && o === "info",
194
+ "text-warning-foreground": x && o === "warning",
195
+ "text-destructive-foreground": x && o === "destructive",
196
+ "text-success-foreground": x && o === "success"
197
+ },
198
+ // Text alignment
199
+ {
200
+ "text-left": n === "left",
201
+ "text-center": n === "center",
202
+ "text-right": n === "right",
203
+ "text-justify": n === "justify",
204
+ "text-start": n === "start",
205
+ "text-end": n === "end"
206
+ },
207
+ // Leading (line height)
208
+ {
209
+ "leading-none": s === "none",
210
+ "leading-tight": s === "tight",
211
+ "leading-snug": s === "snug",
212
+ "leading-normal": s === "normal",
213
+ "leading-relaxed": s === "relaxed",
214
+ "leading-loose": s === "loose"
215
+ },
216
+ // Tracking (letter spacing)
217
+ {
218
+ "tracking-tighter": r === "tighter",
219
+ "tracking-tight": r === "tight",
220
+ "tracking-normal": r === "normal",
221
+ "tracking-wide": r === "wide",
222
+ "tracking-wider": r === "wider",
223
+ "tracking-widest": r === "widest"
224
+ },
225
+ // Font family
226
+ {
227
+ "font-display": f === "display",
228
+ "font-sans": f === "sans",
229
+ "font-serif": f === "serif",
230
+ "font-mono": f === "mono"
231
+ },
232
+ // Truncation
233
+ u && "truncate",
234
+ // Tabular numerals
235
+ m && "tabular-nums",
236
+ // Add some scroll margin for better anchor navigation
237
+ "scroll-m-20",
238
+ c
239
+ ),
240
+ ref: a,
241
+ ...i
242
+ }
243
+ );
244
+ }
245
+ );
246
+ j.displayName = "Heading";
247
+ export {
248
+ j as H,
249
+ y as T
250
+ };