@particle-academy/react-fancy 5.29.0 → 5.30.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.
Files changed (40) hide show
  1. package/README.md +54 -0
  2. package/dist/Card-CuRZivBz.d.cts +136 -0
  3. package/dist/Card-CuRZivBz.d.ts +136 -0
  4. package/dist/card.cjs +12 -6
  5. package/dist/card.d.cts +50 -3
  6. package/dist/card.d.ts +50 -3
  7. package/dist/card.js +3 -1
  8. package/dist/chunk-5F6V5HHT.cjs +399 -0
  9. package/dist/chunk-5F6V5HHT.cjs.map +1 -0
  10. package/dist/{chunk-Y3T7WMT6.cjs → chunk-65HKNZFG.cjs} +2 -2
  11. package/dist/{chunk-Y3T7WMT6.cjs.map → chunk-65HKNZFG.cjs.map} +1 -1
  12. package/dist/{chunk-2HGYDDIQ.js → chunk-ASCATIDJ.js} +3 -3
  13. package/dist/{chunk-2HGYDDIQ.js.map → chunk-ASCATIDJ.js.map} +1 -1
  14. package/dist/{chunk-6GWOB2Z4.js → chunk-CESGP5AF.js} +2 -2
  15. package/dist/{chunk-6GWOB2Z4.js.map → chunk-CESGP5AF.js.map} +1 -1
  16. package/dist/chunk-CF2U25LM.js +392 -0
  17. package/dist/chunk-CF2U25LM.js.map +1 -0
  18. package/dist/chunk-CFH6CJQG.js +3 -0
  19. package/dist/chunk-CFH6CJQG.js.map +1 -0
  20. package/dist/chunk-FJKZ5NOA.cjs +4 -0
  21. package/dist/chunk-FJKZ5NOA.cjs.map +1 -0
  22. package/dist/{chunk-FEUAZW3X.cjs → chunk-SCGE6DCE.cjs} +3 -3
  23. package/dist/{chunk-FEUAZW3X.cjs.map → chunk-SCGE6DCE.cjs.map} +1 -1
  24. package/dist/heading.cjs +3 -2
  25. package/dist/heading.js +2 -1
  26. package/dist/index.cjs +26 -25
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +5 -4
  30. package/dist/json-editor.cjs +13 -13
  31. package/dist/json-editor.js +2 -2
  32. package/dist/styles.css.map +1 -1
  33. package/docs/Card.md +170 -20
  34. package/package.json +1 -1
  35. package/dist/Card-BZ5F6-wd.d.cts +0 -50
  36. package/dist/Card-BZ5F6-wd.d.ts +0 -50
  37. package/dist/chunk-5DQ2XUJI.cjs +0 -173
  38. package/dist/chunk-5DQ2XUJI.cjs.map +0 -1
  39. package/dist/chunk-ZIDBI6JX.js +0 -167
  40. package/dist/chunk-ZIDBI6JX.js.map +0 -1
@@ -0,0 +1,399 @@
1
+ 'use strict';
2
+
3
+ var chunkXLFGWNW4_cjs = require('./chunk-XLFGWNW4.cjs');
4
+ var chunk65HKNZFG_cjs = require('./chunk-65HKNZFG.cjs');
5
+ var chunkZU5Q77OT_cjs = require('./chunk-ZU5Q77OT.cjs');
6
+ var react = require('react');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ var CardContext = react.createContext(null);
10
+ function useCardContext() {
11
+ return react.useContext(CardContext);
12
+ }
13
+ var CardSectionContext = react.createContext(null);
14
+ function useCardSectionPadding() {
15
+ return react.useContext(CardSectionContext);
16
+ }
17
+
18
+ // src/components/Card/Card.scales.ts
19
+ var paddingClasses = {
20
+ none: "",
21
+ xs: "[&>*]:px-2 [&>*]:py-1.5",
22
+ sm: "[&>*]:px-3 [&>*]:py-2",
23
+ md: "[&>*]:px-4 [&>*]:py-3",
24
+ lg: "[&>*]:px-6 [&>*]:py-4"
25
+ };
26
+ var sizePadding = {
27
+ xs: "xs",
28
+ sm: "sm",
29
+ md: "md",
30
+ lg: "lg"
31
+ };
32
+ var radiusClasses = {
33
+ xs: "rounded",
34
+ sm: "rounded-md",
35
+ md: "rounded-lg",
36
+ lg: "rounded-xl"
37
+ };
38
+ var radiusTop = {
39
+ xs: "rounded-t",
40
+ sm: "rounded-t-md",
41
+ md: "rounded-t-lg",
42
+ lg: "rounded-t-xl"
43
+ };
44
+ var radiusBottom = {
45
+ xs: "rounded-b",
46
+ sm: "rounded-b-md",
47
+ md: "rounded-b-lg",
48
+ lg: "rounded-b-xl"
49
+ };
50
+ var selfPadding = {
51
+ none: "",
52
+ xs: "px-2 py-1.5",
53
+ sm: "px-3 py-2",
54
+ md: "px-4 py-3",
55
+ lg: "px-6 py-4"
56
+ };
57
+ var dividerInsetAfter = {
58
+ none: "after:inset-x-0",
59
+ xs: "after:inset-x-2",
60
+ sm: "after:inset-x-3",
61
+ md: "after:inset-x-4",
62
+ lg: "after:inset-x-6"
63
+ };
64
+ var dividerInsetBefore = {
65
+ none: "before:inset-x-0",
66
+ xs: "before:inset-x-2",
67
+ sm: "before:inset-x-3",
68
+ md: "before:inset-x-4",
69
+ lg: "before:inset-x-6"
70
+ };
71
+ var bleedX = {
72
+ none: "",
73
+ xs: "-mx-2",
74
+ sm: "-mx-3",
75
+ md: "-mx-4",
76
+ lg: "-mx-6"
77
+ };
78
+ var bleedTop = {
79
+ none: "",
80
+ xs: "-mt-1.5",
81
+ sm: "-mt-2",
82
+ md: "-mt-3",
83
+ lg: "-mt-4"
84
+ };
85
+ var bleedBottom = {
86
+ none: "",
87
+ xs: "-mb-1.5",
88
+ sm: "-mb-2",
89
+ md: "-mb-3",
90
+ lg: "-mb-4"
91
+ };
92
+ var CardSection = react.forwardRef(
93
+ ({
94
+ edge,
95
+ handle,
96
+ heading,
97
+ headingLevel = "h3",
98
+ description,
99
+ actions,
100
+ size: sizeProp,
101
+ className,
102
+ children,
103
+ ...props
104
+ }, ref) => {
105
+ const card = useCardContext();
106
+ const standalone = card === null;
107
+ const size = card?.size ?? sizeProp ?? "md";
108
+ const sections = card?.sections ?? "plain";
109
+ const dividerInset = card?.dividerInset ?? false;
110
+ const padding = card?.padding ?? sizePadding[size];
111
+ const ruled = sections === "divided";
112
+ const banded = sections === "banded";
113
+ const composed = children ?? null;
114
+ const hasComposition = composed === null && (heading != null || description != null || actions != null);
115
+ return /* @__PURE__ */ jsxRuntime.jsx(
116
+ "div",
117
+ {
118
+ ref,
119
+ ...{ [handle]: "" },
120
+ className: chunkZU5Q77OT_cjs.cn(
121
+ standalone && selfPadding[padding],
122
+ banded && "bg-zinc-50 dark:bg-zinc-800/50",
123
+ ruled && !dividerInset && (edge === "bottom" ? "border-b border-zinc-200 dark:border-zinc-700" : "border-t border-zinc-200 dark:border-zinc-700"),
124
+ // An inset rule cannot be a border: a border draws on the element's
125
+ // own edge, and the whole point is to stop short of it. So it is a
126
+ // one-pixel pseudo-element, inset by the same step the padding uses —
127
+ // which is why both come out of one table in Card.scales.
128
+ ruled && dividerInset && chunkZU5Q77OT_cjs.cn(
129
+ "relative",
130
+ edge === "bottom" ? "after:absolute after:bottom-0 after:h-px after:bg-zinc-200 dark:after:bg-zinc-700" : "before:absolute before:top-0 before:h-px before:bg-zinc-200 dark:before:bg-zinc-700",
131
+ edge === "bottom" ? dividerInsetAfter[padding] : dividerInsetBefore[padding]
132
+ ),
133
+ hasComposition && "flex items-center gap-3",
134
+ hasComposition && (heading != null || description != null ? "justify-between" : "justify-end"),
135
+ className
136
+ ),
137
+ ...props,
138
+ children: /* @__PURE__ */ jsxRuntime.jsx(CardSectionContext.Provider, { value: padding, children: composed ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
139
+ (heading != null || description != null) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
140
+ heading != null && /* @__PURE__ */ jsxRuntime.jsx(
141
+ chunk65HKNZFG_cjs.Heading,
142
+ {
143
+ as: headingLevel,
144
+ size: "sm",
145
+ weight: "semibold",
146
+ "data-react-fancy-card-heading": "",
147
+ children: heading
148
+ }
149
+ ),
150
+ description != null && /* @__PURE__ */ jsxRuntime.jsx(
151
+ chunkXLFGWNW4_cjs.Text,
152
+ {
153
+ size: "sm",
154
+ color: "muted",
155
+ "data-react-fancy-card-description": "",
156
+ children: description
157
+ }
158
+ )
159
+ ] }),
160
+ actions != null && /* @__PURE__ */ jsxRuntime.jsx(
161
+ "div",
162
+ {
163
+ "data-react-fancy-card-actions": "",
164
+ className: "flex shrink-0 items-center gap-2",
165
+ children: actions
166
+ }
167
+ )
168
+ ] }) })
169
+ }
170
+ );
171
+ }
172
+ );
173
+ CardSection.displayName = "CardSection";
174
+ var CardHeader = react.forwardRef(
175
+ (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
176
+ CardSection,
177
+ {
178
+ ref,
179
+ edge: "bottom",
180
+ handle: "data-react-fancy-card-header",
181
+ ...props
182
+ }
183
+ )
184
+ );
185
+ CardHeader.displayName = "CardHeader";
186
+ var CardBody = react.forwardRef(
187
+ ({ className, children, ...props }, ref) => {
188
+ const padding = useCardContext()?.padding ?? "none";
189
+ return /* @__PURE__ */ jsxRuntime.jsx(
190
+ "div",
191
+ {
192
+ ref,
193
+ "data-react-fancy-card-body": "",
194
+ className: chunkZU5Q77OT_cjs.cn(className),
195
+ ...props,
196
+ children: /* @__PURE__ */ jsxRuntime.jsx(CardSectionContext.Provider, { value: padding, children })
197
+ }
198
+ );
199
+ }
200
+ );
201
+ CardBody.displayName = "CardBody";
202
+ var CardFooter = react.forwardRef(
203
+ (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
204
+ CardSection,
205
+ {
206
+ ref,
207
+ edge: "top",
208
+ handle: "data-react-fancy-card-footer",
209
+ ...props
210
+ }
211
+ )
212
+ );
213
+ CardFooter.displayName = "CardFooter";
214
+ var CardMedia = react.forwardRef(
215
+ ({
216
+ src,
217
+ alt = "",
218
+ ratio = "16/9",
219
+ height,
220
+ background,
221
+ objectPosition = "center",
222
+ loading = "lazy",
223
+ topLeft,
224
+ topRight,
225
+ bottomLeft,
226
+ bottomRight,
227
+ className,
228
+ style,
229
+ children,
230
+ ...props
231
+ }, ref) => {
232
+ const cardSize = useCardContext()?.size ?? "md";
233
+ return /* @__PURE__ */ jsxRuntime.jsxs(
234
+ "div",
235
+ {
236
+ ref,
237
+ "data-react-fancy-card-media": "",
238
+ className: chunkZU5Q77OT_cjs.cn(
239
+ "relative overflow-hidden",
240
+ // Follows the CARD's radius step rather than hardcoding `rounded-t-lg`.
241
+ // It was fixed, so a `size="lg"` card put a `rounded-xl` frame around
242
+ // a `rounded-t-lg` image and left a visible sliver of card showing
243
+ // through each top corner. Defaults to `md` with no card above, which
244
+ // is the class it used to hardcode.
245
+ radiusTop[cardSize],
246
+ // Card's `padding` prop pads EVERY direct child
247
+ // (`[&>*]:px-4 …`), which would inset the media and break the
248
+ // flush-to-the-edge look every caller wants. `!` wins regardless of
249
+ // stylesheet order, which plain `p-0` would not.
250
+ "!px-0 !py-0",
251
+ className
252
+ ),
253
+ style: {
254
+ ...height === void 0 ? { aspectRatio: ratio } : { height },
255
+ ...background ? { background } : null,
256
+ ...style
257
+ },
258
+ ...props,
259
+ children: [
260
+ src ? /* @__PURE__ */ jsxRuntime.jsx(
261
+ "img",
262
+ {
263
+ src,
264
+ alt,
265
+ loading,
266
+ className: "absolute inset-0 h-full w-full object-cover",
267
+ style: { objectPosition }
268
+ }
269
+ ) : null,
270
+ children,
271
+ topLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 top-2 z-10", children: topLeft }) : null,
272
+ topRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 top-2 z-10", children: topRight }) : null,
273
+ bottomLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 left-2 z-10", children: bottomLeft }) : null,
274
+ bottomRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 right-2 z-10", children: bottomRight }) : null
275
+ ]
276
+ }
277
+ );
278
+ }
279
+ );
280
+ CardMedia.displayName = "CardMedia";
281
+ var CardBleed = react.forwardRef(
282
+ ({ edges = "x", className, children, ...props }, ref) => {
283
+ const card = useCardContext();
284
+ const section = useCardSectionPadding();
285
+ const size = card?.size ?? "md";
286
+ const touchesTop = edges === "top" || edges === "all";
287
+ const touchesBottom = edges === "bottom" || edges === "all";
288
+ return /* @__PURE__ */ jsxRuntime.jsx(
289
+ "div",
290
+ {
291
+ ref,
292
+ "data-react-fancy-card-bleed": "",
293
+ className: chunkZU5Q77OT_cjs.cn(
294
+ // Clip children to whatever corners we round, or an image's square
295
+ // edge sits over the card's curve.
296
+ "overflow-hidden",
297
+ section !== null ? chunkZU5Q77OT_cjs.cn(
298
+ bleedX[section],
299
+ touchesTop && bleedTop[section],
300
+ touchesBottom && bleedBottom[section]
301
+ ) : (
302
+ // Direct child of the card: `!` because the padding it is undoing
303
+ // comes from the card's own `[&>*]` rule, which is equally
304
+ // specific. Same mechanism `Card.Media` uses.
305
+ chunkZU5Q77OT_cjs.cn(
306
+ "!px-0",
307
+ touchesTop && "!pt-0",
308
+ touchesBottom && "!pb-0"
309
+ )
310
+ ),
311
+ touchesTop && radiusTop[size],
312
+ touchesBottom && radiusBottom[size],
313
+ className
314
+ ),
315
+ ...props,
316
+ children
317
+ }
318
+ );
319
+ }
320
+ );
321
+ CardBleed.displayName = "CardBleed";
322
+ var variantClasses = {
323
+ outlined: "border border-zinc-200 dark:border-zinc-700",
324
+ elevated: "shadow-md border border-zinc-100 dark:border-zinc-800",
325
+ flat: "bg-zinc-50 dark:bg-zinc-800/50",
326
+ // Tint steps between "no tint" and `flat`. They work the same way `flat`
327
+ // does: a later `bg-*` in the class string beats the base `bg-white`, because
328
+ // `cn` is tailwind-merge and resolves conflicting utilities last-wins. Class
329
+ // ORDER decides this, not CSS specificity — so these must stay after the base
330
+ // background in the `cn(...)` call below.
331
+ muted: "bg-zinc-100 dark:bg-zinc-800",
332
+ soft: "bg-zinc-50/70 dark:bg-zinc-800/40"
333
+ };
334
+ var CardRoot = react.forwardRef(
335
+ ({
336
+ variant = "outlined",
337
+ size = "md",
338
+ padding,
339
+ sections = "divided",
340
+ dividerInset = false,
341
+ highlight = false,
342
+ interactive = false,
343
+ className,
344
+ children,
345
+ ...props
346
+ }, ref) => {
347
+ const resolvedPadding = padding ?? sizePadding[size];
348
+ const context = react.useMemo(
349
+ () => ({ size, padding: resolvedPadding, sections, dividerInset }),
350
+ [size, resolvedPadding, sections, dividerInset]
351
+ );
352
+ return /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
353
+ "div",
354
+ {
355
+ ref,
356
+ "data-react-fancy-card": "",
357
+ className: chunkZU5Q77OT_cjs.cn(
358
+ "bg-white dark:bg-zinc-900",
359
+ radiusClasses[size],
360
+ variantClasses[variant],
361
+ // A pseudo-element rather than an inset box-shadow: `shadow-*` and
362
+ // `shadow-[inset...]` are the same tailwind-merge group, so an
363
+ // inset shadow here would have SILENTLY DELETED `elevated`'s
364
+ // `shadow-md`. Highlight and elevation have to be able to coexist.
365
+ // `dark:` carries a REAL colour. It was `dark:before:bg-transparent`,
366
+ // which made `highlight` a no-op in the mode that needs it most:
367
+ // a dark surface has no border contrast of its own, and a 10% white
368
+ // top edge is the whole reason Flux turns this on by default.
369
+ highlight && "relative before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-white/70 dark:before:bg-white/10",
370
+ // `overflow-hidden` is part of `interactive` rather than always-on:
371
+ // clipping unconditionally would cut off popovers and dropdowns that
372
+ // legitimately overflow a static card.
373
+ interactive && "overflow-hidden transition hover:-translate-y-0.5 hover:shadow-lg hover:border-zinc-300 dark:hover:border-zinc-600",
374
+ paddingClasses[resolvedPadding],
375
+ className
376
+ ),
377
+ ...props,
378
+ children
379
+ }
380
+ ) });
381
+ }
382
+ );
383
+ CardRoot.displayName = "Card";
384
+ var Card = Object.assign(CardRoot, {
385
+ Media: CardMedia,
386
+ Header: CardHeader,
387
+ Body: CardBody,
388
+ Footer: CardFooter,
389
+ Bleed: CardBleed
390
+ });
391
+
392
+ exports.Card = Card;
393
+ exports.CardBleed = CardBleed;
394
+ exports.CardBody = CardBody;
395
+ exports.CardFooter = CardFooter;
396
+ exports.CardHeader = CardHeader;
397
+ exports.CardMedia = CardMedia;
398
+ //# sourceMappingURL=chunk-5F6V5HHT.cjs.map
399
+ //# sourceMappingURL=chunk-5F6V5HHT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Card/Card.context.ts","../src/components/Card/Card.scales.ts","../src/components/Card/CardSection.tsx","../src/components/Card/CardHeader.tsx","../src/components/Card/CardBody.tsx","../src/components/Card/CardFooter.tsx","../src/components/Card/CardMedia.tsx","../src/components/Card/CardBleed.tsx","../src/components/Card/Card.tsx"],"names":["createContext","useContext","forwardRef","jsx","cn","jsxs","Fragment","Heading","Text","useMemo"],"mappings":";;;;;;;;AAaO,IAAM,WAAA,GAAcA,oBAAuC,IAAI,CAAA;AAE/D,SAAS,cAAA,GAA0C;AACxD,EAAA,OAAOC,iBAAW,WAAW,CAAA;AAC/B;AA0BO,IAAM,kBAAA,GAAqBD,oBAAkC,IAAI,CAAA;AAEjE,SAAS,qBAAA,GAA4C;AAC1D,EAAA,OAAOC,iBAAW,kBAAkB,CAAA;AACtC;;;ACvBO,IAAM,cAAA,GAA8C;AAAA,EACzD,IAAA,EAAM,EAAA;AAAA,EACN,EAAA,EAAI,yBAAA;AAAA,EACJ,EAAA,EAAI,uBAAA;AAAA,EACJ,EAAA,EAAI,uBAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAGO,IAAM,WAAA,GAA6C;AAAA,EACxD,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEO,IAAM,aAAA,GAA0C;AAAA,EACrD,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,YAAA;AAAA,EACJ,EAAA,EAAI,YAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAGO,IAAM,SAAA,GAAsC;AAAA,EACjD,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,cAAA;AAAA,EACJ,EAAA,EAAI,cAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEO,IAAM,YAAA,GAAyC;AAAA,EACpD,EAAA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AAAA;AAAA;AAAA,UAStB,SAAA,IACE,0IAAA;AAAA;AAAA;AAAA;AAAA,UAIF,WAAA,IACE,oHAAA;AAAA,UACF,eAAe,eAAe,CAAA;AAAA,UAC9B;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF,CAAA;AAEA,QAAA,CAAS,WAAA,GAAc,MAAA;AAEhB,IAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,QAAA,EAAU;AAAA,EAC1C,KAAA,EAAO,SAAA;AAAA,EACP,MAAA,EAAQ,UAAA;AAAA,EACR,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,UAAA;AAAA,EACR,KAAA,EAAO;AACT,CAAC","file":"chunk-5F6V5HHT.cjs","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { CardContextValue, CardPadding } from \"./Card.types\";\n\n/**\n * What a Card tells its parts.\n *\n * `null` is a SUPPORTED state, not an error — unlike `useAccordion`, which\n * throws. `Card.Header` and `Card.Footer` are usable on their own, as a section\n * heading above a card, and before this existed they rendered with a\n * `border-bottom` belonging to a card they were not inside. So the absence of a\n * card is information: it means \"style yourself standalone\", and it is why this\n * hook returns the value rather than asserting it.\n */\nexport const CardContext = createContext<CardContextValue | null>(null);\n\nexport function useCardContext(): CardContextValue | null {\n return useContext(CardContext);\n}\n\n/**\n * The padding step of the section a child sits inside, or `null` when there is\n * no padded section above it.\n *\n * `Card.Bleed` needs it because escaping the padding is two different\n * operations depending on depth, and a component cannot see its own depth:\n *\n * - Bleed inside a Header/Body/Footer is a GRANDchild of the card — the\n * padding is on that section, and reaching the card's edge means a negative\n * margin.\n * - Bleed as a direct child of the card IS the padded element — the padding\n * is on Bleed itself, and reaching the edge means zeroing it. A negative\n * margin here would pull the content outside the card entirely.\n *\n * Both look like \"cancel the padding\" and neither works for the other case,\n * which is exactly the kind of thing that ships looking fine in one demo.\n *\n * It carries the STEP rather than a boolean because the step is the only thing\n * the bleed actually needs, and it is NOT always derivable from the card's\n * `size`: `<Card size=\"md\" padding=\"lg\">` pads its children by `lg`, and a\n * standalone `Card.Header` has a card-less step of its own. A boolean sent the\n * bleed back to `size` for the distance, which was wrong in both of those\n * cases — by a whole padding step, silently.\n */\nexport const CardSectionContext = createContext<CardPadding | null>(null);\n\nexport function useCardSectionPadding(): CardPadding | null {\n return useContext(CardSectionContext);\n}\n","import type { CardPadding, CardSize } from \"./Card.types\";\n\n/**\n * One table per thing a `size` or a `padding` step scales.\n *\n * They live together, and apart from the components, because four of them have\n * to agree: the card's own radius, `Card.Media`'s top radius, the inset a\n * `dividerInset` rule stops at, and the negative margin a `Card.Bleed` uses to\n * escape. Those last three are all derived from the PADDING step — get one\n * wrong and the mismatch is a few pixels, which is the kind of defect that\n * survives review and then looks like a browser bug.\n *\n * Radius is keyed by `size`; everything that has to line up with the padding is\n * keyed by the padding step. Those are NOT the same key: `size` only picks the\n * DEFAULT padding, and an explicit `padding` prop overrides it. Keying the\n * inset and the bleed off `size` made `<Card size=\"md\" padding=\"lg\">` draw a\n * rule inset by 1rem over content inset by 1.5rem, and `padding=\"none\"` pull a\n * bleed clean outside the card.\n *\n * **`md` must stay byte-identical to what Card rendered before `size` existed**\n * (`rounded-lg`, `px-4`, `py-3`). `size` defaults to `md`, so that is what\n * makes this whole feature additive rather than a restyle of every consumer.\n */\n\nexport const paddingClasses: Record<CardPadding, string> = {\n none: \"\",\n xs: \"[&>*]:px-2 [&>*]:py-1.5\",\n sm: \"[&>*]:px-3 [&>*]:py-2\",\n md: \"[&>*]:px-4 [&>*]:py-3\",\n lg: \"[&>*]:px-6 [&>*]:py-4\",\n};\n\n/** The padding step a `size` implies when `padding` is not given. */\nexport const sizePadding: Record<CardSize, CardPadding> = {\n xs: \"xs\",\n sm: \"sm\",\n md: \"md\",\n lg: \"lg\",\n};\n\nexport const radiusClasses: Record<CardSize, string> = {\n xs: \"rounded\",\n sm: \"rounded-md\",\n md: \"rounded-lg\",\n lg: \"rounded-xl\",\n};\n\n/** `rounded-t-*` / `rounded-b-*` counterparts, for media and bleed. */\nexport const radiusTop: Record<CardSize, string> = {\n xs: \"rounded-t\",\n sm: \"rounded-t-md\",\n md: \"rounded-t-lg\",\n lg: \"rounded-t-xl\",\n};\n\nexport const radiusBottom: Record<CardSize, string> = {\n xs: \"rounded-b\",\n sm: \"rounded-b-md\",\n md: \"rounded-b-lg\",\n lg: \"rounded-b-xl\",\n};\n\n/** Padding a STANDALONE header/footer applies to itself, having no card. */\nexport const selfPadding: Record<CardPadding, string> = {\n none: \"\",\n xs: \"px-2 py-1.5\",\n sm: \"px-3 py-2\",\n md: \"px-4 py-3\",\n lg: \"px-6 py-4\",\n};\n\n/**\n * Where an inset divider stops — matches the horizontal padding step.\n *\n * Written out per variant rather than composed as `` `after:${insetX[step]}` ``.\n * **Tailwind generates CSS by scanning source for LITERAL class names**, so a\n * template string produces a class that exists in the DOM and in no stylesheet:\n * the divider silently does not render, and nothing in the build complains. The\n * duplication is the price of the scanner being a text search, and\n * `tests/card-tailwind.test.ts` compiles every one of these through Tailwind so\n * a typo cannot pass either.\n */\nexport const dividerInsetAfter: Record<CardPadding, string> = {\n none: \"after:inset-x-0\",\n xs: \"after:inset-x-2\",\n sm: \"after:inset-x-3\",\n md: \"after:inset-x-4\",\n lg: \"after:inset-x-6\",\n};\n\nexport const dividerInsetBefore: Record<CardPadding, string> = {\n none: \"before:inset-x-0\",\n xs: \"before:inset-x-2\",\n sm: \"before:inset-x-3\",\n md: \"before:inset-x-4\",\n lg: \"before:inset-x-6\",\n};\n\n/**\n * Negative margins a nested `Card.Bleed` uses to reach the card's edges.\n *\n * `none` is empty on purpose: with no padding to escape, a negative margin\n * would drag the content OUT of the card rather than to its edge.\n */\nexport const bleedX: Record<CardPadding, string> = {\n none: \"\",\n xs: \"-mx-2\",\n sm: \"-mx-3\",\n md: \"-mx-4\",\n lg: \"-mx-6\",\n};\n\nexport const bleedTop: Record<CardPadding, string> = {\n none: \"\",\n xs: \"-mt-1.5\",\n sm: \"-mt-2\",\n md: \"-mt-3\",\n lg: \"-mt-4\",\n};\n\nexport const bleedBottom: Record<CardPadding, string> = {\n none: \"\",\n xs: \"-mb-1.5\",\n sm: \"-mb-2\",\n md: \"-mb-3\",\n lg: \"-mb-4\",\n};\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Heading } from \"../Heading/Heading\";\nimport { Text } from \"../Text/Text\";\nimport { CardSectionContext, useCardContext } from \"./Card.context\";\nimport { dividerInsetAfter, dividerInsetBefore, selfPadding, sizePadding } from \"./Card.scales\";\nimport type { CardSectionProps } from \"./Card.types\";\n\n/**\n * The shared body of `Card.Header` and `Card.Footer`.\n *\n * They differ in exactly ONE way — which edge the rule sits on — so they are\n * one implementation with an `edge` argument rather than two files that have to\n * be kept in step. Composition, including where a lone `actions` block lands,\n * is identical in both. The previous pair had already drifted from\n * `ModalFooter`, which lays its actions out with `flex items-center\n * justify-end gap-3` while `Card.Footer` laid out nothing.\n */\nexport interface CardSectionInternalProps extends CardSectionProps {\n edge: \"top\" | \"bottom\";\n handle: string;\n}\n\nexport const CardSection = forwardRef<HTMLDivElement, CardSectionInternalProps>(\n (\n {\n edge,\n handle,\n heading,\n headingLevel = \"h3\",\n description,\n actions,\n size: sizeProp,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const card = useCardContext();\n\n // No card above us means this is a standalone section — a heading ABOVE a\n // card, which Flux supports and we rendered wrongly: it kept the rule that\n // belongs to a card it was not inside. Standalone also has to pad itself,\n // because the padding normally comes from the card's `[&>*]` rule.\n const standalone = card === null;\n const size = card?.size ?? sizeProp ?? \"md\";\n const sections = card?.sections ?? \"plain\";\n const dividerInset = card?.dividerInset ?? false;\n\n // The step the content is inset by, whoever applied it — the card's\n // `[&>*]` rule, or this element's own padding when standalone. An inset\n // rule has to stop exactly there, and a nested `Card.Bleed` has to travel\n // exactly that far back out, so both read this one value.\n const padding = card?.padding ?? sizePadding[size];\n\n const ruled = sections === \"divided\";\n const banded = sections === \"banded\";\n\n // Children WIN. Rendering both would give anyone who passed each by mistake\n // two titles, and silently ignoring children would be worse.\n const composed = children ?? null;\n const hasComposition = composed === null && (heading != null || description != null || actions != null);\n\n return (\n <div\n ref={ref}\n {...{ [handle]: \"\" }}\n className={cn(\n standalone && selfPadding[padding],\n banded && \"bg-zinc-50 dark:bg-zinc-800/50\",\n ruled &&\n !dividerInset &&\n (edge === \"bottom\"\n ? \"border-b border-zinc-200 dark:border-zinc-700\"\n : \"border-t border-zinc-200 dark:border-zinc-700\"),\n // An inset rule cannot be a border: a border draws on the element's\n // own edge, and the whole point is to stop short of it. So it is a\n // one-pixel pseudo-element, inset by the same step the padding uses —\n // which is why both come out of one table in Card.scales.\n ruled &&\n dividerInset &&\n cn(\n \"relative\",\n edge === \"bottom\"\n ? \"after:absolute after:bottom-0 after:h-px after:bg-zinc-200 dark:after:bg-zinc-700\"\n : \"before:absolute before:top-0 before:h-px before:bg-zinc-200 dark:before:bg-zinc-700\",\n edge === \"bottom\"\n ? dividerInsetAfter[padding]\n : dividerInsetBefore[padding],\n ),\n hasComposition && \"flex items-center gap-3\",\n hasComposition && (heading != null || description != null ? \"justify-between\" : \"justify-end\"),\n className,\n )}\n {...props}\n >\n {/* Padding is on THIS element either way -- from the card's `[&>*]`\n rule, or from `selfPadding` when standalone. A nested `Card.Bleed`\n escapes it with a negative margin in both cases, so the step goes\n down unconditionally; it used to be suppressed when standalone,\n which left a bleed inside a card-less header doing nothing. */}\n <CardSectionContext.Provider value={padding}>\n {composed ?? (\n <>\n {(heading != null || description != null) && (\n <div className=\"min-w-0\">\n {heading != null && (\n <Heading\n as={headingLevel}\n size=\"sm\"\n weight=\"semibold\"\n data-react-fancy-card-heading=\"\"\n >\n {heading}\n </Heading>\n )}\n {description != null && (\n <Text\n size=\"sm\"\n color=\"muted\"\n data-react-fancy-card-description=\"\"\n >\n {description}\n </Text>\n )}\n </div>\n )}\n {actions != null && (\n <div\n data-react-fancy-card-actions=\"\"\n className=\"flex shrink-0 items-center gap-2\"\n >\n {actions}\n </div>\n )}\n </>\n )}\n </CardSectionContext.Provider>\n </div>\n );\n },\n);\n\nCardSection.displayName = \"CardSection\";\n","import { forwardRef } from \"react\";\nimport { CardSection } from \"./CardSection\";\nimport type { CardHeaderProps } from \"./Card.types\";\n\n/**\n * A card's header. Also usable on its own, as a section heading above a card —\n * see `CardSection`, which decides that from the absence of a `CardContext`.\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => (\n <CardSection\n ref={ref}\n edge=\"bottom\"\n handle=\"data-react-fancy-card-header\"\n {...props}\n />\n ),\n);\n\nCardHeader.displayName = \"CardHeader\";\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { CardSectionContext, useCardContext } from \"./Card.context\";\nimport type { CardBodyProps } from \"./Card.types\";\n\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n ({ className, children, ...props }, ref) => {\n // The step the CARD pads this element by. `\"none\"` with no card above,\n // because then nothing pads it and there is nothing for a nested\n // `Card.Bleed` to escape.\n const padding = useCardContext()?.padding ?? \"none\";\n\n return (\n <div\n ref={ref}\n data-react-fancy-card-body=\"\"\n className={cn(className)}\n {...props}\n >\n {/*\n Body carries no classes of its own -- the card pads it through\n `[&>*]`, and giving it padding here would double that. The context is\n the only thing it adds: it tells a nested `Card.Bleed` that the\n padding to escape is on THIS element, and how much of it there is.\n */}\n <CardSectionContext.Provider value={padding}>{children}</CardSectionContext.Provider>\n </div>\n );\n },\n);\n\nCardBody.displayName = \"CardBody\";\n","import { forwardRef } from \"react\";\nimport { CardSection } from \"./CardSection\";\nimport type { CardFooterProps } from \"./Card.types\";\n\n/**\n * A card's footer. Its rule sits on the TOP edge, and a lone `actions` block\n * aligns to the end — matching `ModalFooter`, which has always done that while\n * this component laid out nothing.\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => (\n <CardSection\n ref={ref}\n edge=\"top\"\n handle=\"data-react-fancy-card-footer\"\n {...props}\n />\n ),\n);\n\nCardFooter.displayName = \"CardFooter\";\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useCardContext } from \"./Card.context\";\nimport { radiusTop } from \"./Card.scales\";\nimport type { CardMediaProps } from \"./Card.types\";\n\n/**\n * The fixed-ratio media region at the top of a card: a thumbnail, gradient or\n * solid swatch, with slots pinned to its corners.\n *\n * This is `Card.Media` rather than a separate `<MediaCard>` because the thing\n * being asked for was never a different card — it was a card with a picture in\n * it. Four surfaces had each rebuilt exactly this (a gallery index, a package\n * grid, a starter-kit grid and a showcase grid) and one of them was already\n * wrapping `Card` and hand-rolling only this region.\n *\n * ## The `background` is not decoration\n *\n * It shows through while the image loads and stays visible if the image never\n * arrives. The gallery relied on that: each style card is keyed to a swatch, so\n * a missing screenshot degrades to the right colour rather than to a hole.\n */\nexport const CardMedia = forwardRef<HTMLDivElement, CardMediaProps>(\n (\n {\n src,\n alt = \"\",\n ratio = \"16/9\",\n height,\n background,\n objectPosition = \"center\",\n loading = \"lazy\",\n topLeft,\n topRight,\n bottomLeft,\n bottomRight,\n className,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const cardSize = useCardContext()?.size ?? \"md\";\n\n return (\n <div\n ref={ref}\n data-react-fancy-card-media=\"\"\n className={cn(\n \"relative overflow-hidden\",\n // Follows the CARD's radius step rather than hardcoding `rounded-t-lg`.\n // It was fixed, so a `size=\"lg\"` card put a `rounded-xl` frame around\n // a `rounded-t-lg` image and left a visible sliver of card showing\n // through each top corner. Defaults to `md` with no card above, which\n // is the class it used to hardcode.\n radiusTop[cardSize],\n // Card's `padding` prop pads EVERY direct child\n // (`[&>*]:px-4 …`), which would inset the media and break the\n // flush-to-the-edge look every caller wants. `!` wins regardless of\n // stylesheet order, which plain `p-0` would not.\n \"!px-0 !py-0\",\n className,\n )}\n style={{\n ...(height === undefined ? { aspectRatio: ratio } : { height }),\n ...(background ? { background } : null),\n ...style,\n }}\n {...props}\n >\n {src ? (\n <img\n src={src}\n alt={alt}\n loading={loading}\n className=\"absolute inset-0 h-full w-full object-cover\"\n style={{ objectPosition }}\n />\n ) : null}\n\n {children}\n\n {topLeft ? <span className=\"absolute left-2 top-2 z-10\">{topLeft}</span> : null}\n {topRight ? <span className=\"absolute right-2 top-2 z-10\">{topRight}</span> : null}\n {bottomLeft ? <span className=\"absolute bottom-2 left-2 z-10\">{bottomLeft}</span> : null}\n {bottomRight ? <span className=\"absolute bottom-2 right-2 z-10\">{bottomRight}</span> : null}\n </div>\n );\n },\n);\n\nCardMedia.displayName = \"CardMedia\";\n","import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useCardContext, useCardSectionPadding } from \"./Card.context\";\nimport { bleedBottom, bleedTop, bleedX, radiusBottom, radiusTop } from \"./Card.scales\";\nimport type { CardBleedProps } from \"./Card.types\";\n\n/**\n * Run content out to the card's edges — an image, a table, a chart strip.\n *\n * ## Why this is arithmetic and not a CSS-variable protocol\n *\n * Flux solves the same problem with a published set of custom properties\n * (`--flux-bleed-x`, `--flux-bleed-top`, …) that any child component may read.\n * It has to: its padding sits on the CARD, so a descendant has no way to know\n * how far it must reach. That is a public CSS API — a cross-package contract to\n * version forever.\n *\n * Ours does not need one, because padding sits on the card's direct CHILDREN.\n * The distance to the edge is therefore always one padding step, which the\n * padded section passes down in context. No variables, nothing for a consumer\n * to depend on, nothing to keep stable across releases.\n *\n * ## Two cases, and they are opposites\n *\n * - **Inside a `Card.Header` / `Card.Body` / `Card.Footer`** (the normal case):\n * the padding is on that section, so reaching the edge is a NEGATIVE MARGIN.\n * - **As a direct child of `Card`**: the padding is on this element, so\n * reaching the edge is ZEROING it. A negative margin here would pull the\n * content clean outside the card.\n *\n * A component cannot see its own depth, so the sections publish their padding\n * step in context and its absence means \"you are the padded element\". Both\n * cases read as \"cancel the padding\", which is exactly why picking either one\n * alone ships looking correct in whichever demo the author happened to write.\n *\n * The distance comes from that context and NOT from the card's `size`, because\n * the two disagree whenever `padding` is passed explicitly — and disagree by a\n * whole step, which looks like a rendering bug rather than a prop conflict.\n *\n * Corners are rounded only where the content actually meets the card's edge, so\n * a mid-body strip stays square while one at the top follows the card's radius.\n */\nexport const CardBleed = forwardRef<HTMLDivElement, CardBleedProps>(\n ({ edges = \"x\", className, children, ...props }, ref) => {\n const card = useCardContext();\n const section = useCardSectionPadding();\n // Radius follows the CARD (that is whose corners are being met); the\n // distance follows the PADDING.\n const size = card?.size ?? \"md\";\n\n const touchesTop = edges === \"top\" || edges === \"all\";\n const touchesBottom = edges === \"bottom\" || edges === \"all\";\n\n return (\n <div\n ref={ref}\n data-react-fancy-card-bleed=\"\"\n className={cn(\n // Clip children to whatever corners we round, or an image's square\n // edge sits over the card's curve.\n \"overflow-hidden\",\n section !== null\n ? cn(\n bleedX[section],\n touchesTop && bleedTop[section],\n touchesBottom && bleedBottom[section],\n )\n : // Direct child of the card: `!` because the padding it is undoing\n // comes from the card's own `[&>*]` rule, which is equally\n // specific. Same mechanism `Card.Media` uses.\n cn(\n \"!px-0\",\n touchesTop && \"!pt-0\",\n touchesBottom && \"!pb-0\",\n ),\n touchesTop && radiusTop[size],\n touchesBottom && radiusBottom[size],\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nCardBleed.displayName = \"CardBleed\";\n","import { forwardRef, useMemo } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { CardHeader } from \"./CardHeader\";\nimport { CardBody } from \"./CardBody\";\nimport { CardFooter } from \"./CardFooter\";\nimport { CardMedia } from \"./CardMedia\";\nimport { CardBleed } from \"./CardBleed\";\nimport { CardContext } from \"./Card.context\";\nimport { paddingClasses, radiusClasses, sizePadding } from \"./Card.scales\";\nimport type { CardContextValue, CardProps } from \"./Card.types\";\n\nconst variantClasses: Record<NonNullable<CardProps[\"variant\"]>, string> = {\n outlined: \"border border-zinc-200 dark:border-zinc-700\",\n elevated: \"shadow-md border border-zinc-100 dark:border-zinc-800\",\n flat: \"bg-zinc-50 dark:bg-zinc-800/50\",\n // Tint steps between \"no tint\" and `flat`. They work the same way `flat`\n // does: a later `bg-*` in the class string beats the base `bg-white`, because\n // `cn` is tailwind-merge and resolves conflicting utilities last-wins. Class\n // ORDER decides this, not CSS specificity — so these must stay after the base\n // background in the `cn(...)` call below.\n muted: \"bg-zinc-100 dark:bg-zinc-800\",\n soft: \"bg-zinc-50/70 dark:bg-zinc-800/40\",\n};\n\n/**\n * Padding is applied to the card's DIRECT CHILDREN rather than the card\n * itself, so a full-bleed child (`Card.Media`) can opt out with `!px-0`\n * without having to undo a padding that is already baked into the frame.\n *\n * The selector is `&>*`, not `&>div`. It was `&>div` until 5.24.0, which meant\n * the tag a caller happened to choose silently decided whether that child was\n * padded: `<Card><div>a</div><p>b</p></Card>` inset the div and left the\n * paragraph hard against the border. Nothing in the caller's code hinted at\n * the rule, and the result read as a bug in the card.\n *\n * It is also why there is no `gap` to scale with `size`, which looks like an\n * omission and is not: each direct child carries its own `py-*`, so two\n * adjacent parts already have twice that between their content. Adding a row\n * gap on the card would double a space that is already there.\n */\n\nconst CardRoot = forwardRef<HTMLDivElement, CardProps>(\n (\n {\n variant = \"outlined\",\n size = \"md\",\n padding,\n sections = \"divided\",\n dividerInset = false,\n highlight = false,\n interactive = false,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n // `padding` stays authoritative over the step `size` implies. That order is\n // what keeps `size` additive: a caller already passing `padding` sees no\n // change, and `padding=\"none\"` still means none.\n const resolvedPadding = padding ?? sizePadding[size];\n\n // The RESOLVED step goes into the context, not `size`. A part that has to\n // meet the content's edge — an inset divider, a `Card.Bleed` — needs the\n // distance the card actually applied, and `size` is only the default.\n const context = useMemo<CardContextValue>(\n () => ({ size, padding: resolvedPadding, sections, dividerInset }),\n [size, resolvedPadding, sections, dividerInset],\n );\n\n return (\n <CardContext.Provider value={context}>\n <div\n ref={ref}\n data-react-fancy-card=\"\"\n className={cn(\n \"bg-white dark:bg-zinc-900\",\n radiusClasses[size],\n variantClasses[variant],\n // A pseudo-element rather than an inset box-shadow: `shadow-*` and\n // `shadow-[inset...]` are the same tailwind-merge group, so an\n // inset shadow here would have SILENTLY DELETED `elevated`'s\n // `shadow-md`. Highlight and elevation have to be able to coexist.\n // `dark:` carries a REAL colour. It was `dark:before:bg-transparent`,\n // which made `highlight` a no-op in the mode that needs it most:\n // a dark surface has no border contrast of its own, and a 10% white\n // top edge is the whole reason Flux turns this on by default.\n highlight &&\n \"relative before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-white/70 dark:before:bg-white/10\",\n // `overflow-hidden` is part of `interactive` rather than always-on:\n // clipping unconditionally would cut off popovers and dropdowns that\n // legitimately overflow a static card.\n interactive &&\n \"overflow-hidden transition hover:-translate-y-0.5 hover:shadow-lg hover:border-zinc-300 dark:hover:border-zinc-600\",\n paddingClasses[resolvedPadding],\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </CardContext.Provider>\n );\n },\n);\n\nCardRoot.displayName = \"Card\";\n\nexport const Card = Object.assign(CardRoot, {\n Media: CardMedia,\n Header: CardHeader,\n Body: CardBody,\n Footer: CardFooter,\n Bleed: CardBleed,\n});\n"]}
@@ -61,5 +61,5 @@ var Heading = react.forwardRef(
61
61
  Heading.displayName = "Heading";
62
62
 
63
63
  exports.Heading = Heading;
64
- //# sourceMappingURL=chunk-Y3T7WMT6.cjs.map
65
- //# sourceMappingURL=chunk-Y3T7WMT6.cjs.map
64
+ //# sourceMappingURL=chunk-65HKNZFG.cjs.map
65
+ //# sourceMappingURL=chunk-65HKNZFG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Heading/Heading.tsx"],"names":["forwardRef","jsx","cn"],"mappings":";;;;;;AAIA,IAAM,WAAA,GAAiE;AAAA,EACrE,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,UAAA;AAAA,EACJ,KAAA,EAAO,UAAA;AAAA;AAAA,EAEP,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO,UAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AASA,IAAM,eAAA,GAA8E;AAAA,EAClF,KAAA,EAAO,gBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AAEA,IAAM,aAAA,GAAqE;AAAA,EACzE,MAAA,EAAQ,aAAA;AAAA,EACR,MAAA,EAAQ,aAAA;AAAA,EACR,QAAA,EAAU,eAAA;AAAA,EACV,IAAA,EAAM;AACR,CAAA;AAEO,IAAM,OAAA,GAAUA,gBAAA;AAAA,EACrB,CACE;AAAA,IACE,IAAI,GAAA,GAAM,IAAA;AAAA,IACV,IAAA,GAAO,IAAA;AAAA,IACP,MAAA,GAAS,MAAA;AAAA,IACT,SAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,KACG;AACH,IAAA,uBACEC,cAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,0BAAA,EAAyB,EAAA;AAAA,QACzB,SAAA,EAAWC,oBAAA;AAAA,UACT,kCAAA;AAAA,UACA,YAAY,IAAI,CAAA;AAAA,UAChB,gBAAgB,IAAI,CAAA;AAAA,UACpB,cAAc,MAAM,CAAA;AAAA,UACpB;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA","file":"chunk-Y3T7WMT6.cjs","sourcesContent":["import { forwardRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport type { HeadingProps } from \"./Heading.types\";\n\nconst sizeClasses: Record<NonNullable<HeadingProps[\"size\"]>, string> = {\n xs: \"text-xs\",\n sm: \"text-sm\",\n md: \"text-base\",\n lg: \"text-lg\",\n xl: \"text-2xl\",\n \"2xl\": \"text-4xl\",\n // Display steps. Each is the next Tailwind size up, continuing the ramp.\n \"3xl\": \"text-5xl\",\n \"4xl\": \"text-6xl\",\n \"5xl\": \"text-7xl\",\n \"6xl\": \"text-8xl\",\n \"7xl\": \"text-9xl\",\n};\n\n/**\n * Tracking for the display steps only.\n *\n * Default letter-spacing is tuned for headings that sit near body text. At\n * display scale the same spacing reads loose — which is exactly why the big-type\n * gallery style hand-rolled its own `<h1>` rather than use this component.\n */\nconst trackingClasses: Partial<Record<NonNullable<HeadingProps[\"size\"]>, string>> = {\n \"3xl\": \"tracking-tight\",\n \"4xl\": \"tracking-tight\",\n \"5xl\": \"tracking-tighter\",\n \"6xl\": \"tracking-tighter\",\n \"7xl\": \"tracking-tighter\",\n};\n\nconst weightClasses: Record<NonNullable<HeadingProps[\"weight\"]>, string> = {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n bold: \"font-bold\",\n};\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(\n (\n {\n as: Tag = \"h2\",\n size = \"lg\",\n weight = \"bold\",\n className,\n children,\n ...props\n },\n ref,\n ) => {\n return (\n <Tag\n ref={ref}\n data-react-fancy-heading=\"\"\n className={cn(\n \"text-zinc-900 dark:text-zinc-100\",\n sizeClasses[size],\n trackingClasses[size],\n weightClasses[weight],\n className,\n )}\n {...props}\n >\n {children}\n </Tag>\n );\n },\n);\n\nHeading.displayName = \"Heading\";\n"]}
1
+ {"version":3,"sources":["../src/components/Heading/Heading.tsx"],"names":["forwardRef","jsx","cn"],"mappings":";;;;;;AAIA,IAAM,WAAA,GAAiE;AAAA,EACrE,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AA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n\";\nimport type { HeadingProps } from \"./Heading.types\";\n\nconst sizeClasses: Record<NonNullable<HeadingProps[\"size\"]>, string> = {\n xs: \"text-xs\",\n sm: \"text-sm\",\n md: \"text-base\",\n lg: \"text-lg\",\n xl: \"text-2xl\",\n \"2xl\": \"text-4xl\",\n // Display steps. Each is the next Tailwind size up, continuing the ramp.\n \"3xl\": \"text-5xl\",\n \"4xl\": \"text-6xl\",\n \"5xl\": \"text-7xl\",\n \"6xl\": \"text-8xl\",\n \"7xl\": \"text-9xl\",\n};\n\n/**\n * Tracking for the display steps only.\n *\n * Default letter-spacing is tuned for headings that sit near body text. At\n * display scale the same spacing reads loose — which is exactly why the big-type\n * gallery style hand-rolled its own `<h1>` rather than use this component.\n */\nconst trackingClasses: Partial<Record<NonNullable<HeadingProps[\"size\"]>, string>> = {\n \"3xl\": \"tracking-tight\",\n \"4xl\": \"tracking-tight\",\n \"5xl\": \"tracking-tighter\",\n \"6xl\": \"tracking-tighter\",\n \"7xl\": \"tracking-tighter\",\n};\n\nconst weightClasses: Record<NonNullable<HeadingProps[\"weight\"]>, string> = {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n bold: \"font-bold\",\n};\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(\n (\n {\n as: Tag = \"h2\",\n size = \"lg\",\n weight = \"bold\",\n className,\n children,\n ...props\n },\n ref,\n ) => {\n return (\n <Tag\n ref={ref}\n data-react-fancy-heading=\"\"\n className={cn(\n \"text-zinc-900 dark:text-zinc-100\",\n sizeClasses[size],\n trackingClasses[size],\n weightClasses[weight],\n className,\n )}\n {...props}\n >\n {children}\n </Tag>\n );\n },\n);\n\nHeading.displayName = \"Heading\";\n"]}
@@ -2,7 +2,6 @@ import { Switch } from './chunk-6ZDXG5VC.js';
2
2
  import { DatePicker } from './chunk-L2FPIFMN.js';
3
3
  import { Input } from './chunk-L5KKMJ2Q.js';
4
4
  import { Select } from './chunk-ZH3SPBVB.js';
5
- import { Text } from './chunk-5RLP77KK.js';
6
5
  import { Textarea } from './chunk-DEFGT75G.js';
7
6
  import { DisplayValue } from './chunk-KKWNKBKR.js';
8
7
  import { resolveOption } from './chunk-GFYSELJF.js';
@@ -10,6 +9,7 @@ import { ColorPicker } from './chunk-6PF5ENWM.js';
10
9
  import { Badge } from './chunk-6FCQD2KQ.js';
11
10
  import { Button } from './chunk-G6VMNSCM.js';
12
11
  import { Callout } from './chunk-ZXZJYVWP.js';
12
+ import { Text } from './chunk-5RLP77KK.js';
13
13
  import { useInlineEdit } from './chunk-OL53XYHF.js';
14
14
  import { cn } from './chunk-MMW2JGKZ.js';
15
15
  import { createContext, forwardRef, useId, useRef, useMemo, useState, useEffect, useCallback, useContext } from 'react';
@@ -1337,5 +1337,5 @@ function buildItems({
1337
1337
  }
1338
1338
 
1339
1339
  export { JSON_FIELD_TYPES, JsonEditor, applyJsonEdit, describeEdit, findJsonConflicts, getAtPath, inferType, parseKeyMap, parsePath, pathToString, resolveKeyRule, typeMatches };
1340
- //# sourceMappingURL=chunk-2HGYDDIQ.js.map
1341
- //# sourceMappingURL=chunk-2HGYDDIQ.js.map
1340
+ //# sourceMappingURL=chunk-ASCATIDJ.js.map
1341
+ //# sourceMappingURL=chunk-ASCATIDJ.js.map