@particle-academy/react-fancy 6.3.0 → 6.4.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 (104) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -0
  3. package/dist/autocomplete.cjs +5 -5
  4. package/dist/autocomplete.js +4 -4
  5. package/dist/card.cjs +8 -8
  6. package/dist/card.js +2 -2
  7. package/dist/chat-thread.cjs +5 -4
  8. package/dist/chat-thread.js +3 -2
  9. package/dist/{chunk-K7JOZQRK.cjs → chunk-2G6TIX5Q.cjs} +4 -4
  10. package/dist/{chunk-K7JOZQRK.cjs.map → chunk-2G6TIX5Q.cjs.map} +1 -1
  11. package/dist/{chunk-TH4JZAMK.js → chunk-5TP642UT.js} +4 -4
  12. package/dist/{chunk-TH4JZAMK.js.map → chunk-5TP642UT.js.map} +1 -1
  13. package/dist/chunk-6BB32POL.js +29 -0
  14. package/dist/chunk-6BB32POL.js.map +1 -0
  15. package/dist/{chunk-XIA2UAVO.js → chunk-6GVOW3UL.js} +4 -4
  16. package/dist/{chunk-XIA2UAVO.js.map → chunk-6GVOW3UL.js.map} +1 -1
  17. package/dist/{chunk-4JT2QANA.cjs → chunk-6H7ZN23X.cjs} +3 -3
  18. package/dist/{chunk-4JT2QANA.cjs.map → chunk-6H7ZN23X.cjs.map} +1 -1
  19. package/dist/chunk-7ZCNZUZK.cjs +183 -0
  20. package/dist/chunk-7ZCNZUZK.cjs.map +1 -0
  21. package/dist/chunk-AHZIT3CM.js +204 -0
  22. package/dist/chunk-AHZIT3CM.js.map +1 -0
  23. package/dist/{chunk-MP55W37V.cjs → chunk-BYO5RUDE.cjs} +4 -4
  24. package/dist/{chunk-MP55W37V.cjs.map → chunk-BYO5RUDE.cjs.map} +1 -1
  25. package/dist/{chunk-2XO6EYZ7.js → chunk-EENHSMV2.js} +3 -3
  26. package/dist/{chunk-2XO6EYZ7.js.map → chunk-EENHSMV2.js.map} +1 -1
  27. package/dist/{chunk-7JLKOVHX.cjs → chunk-HLI6RB5V.cjs} +4 -4
  28. package/dist/{chunk-7JLKOVHX.cjs.map → chunk-HLI6RB5V.cjs.map} +1 -1
  29. package/dist/chunk-HZUKPYR3.cjs +31 -0
  30. package/dist/chunk-HZUKPYR3.cjs.map +1 -0
  31. package/dist/chunk-J2BWXCES.js +177 -0
  32. package/dist/chunk-J2BWXCES.js.map +1 -0
  33. package/dist/{chunk-CKO2KCUN.cjs → chunk-MPCZUZ4O.cjs} +7 -175
  34. package/dist/chunk-MPCZUZ4O.cjs.map +1 -0
  35. package/dist/{chunk-G7227RTY.cjs → chunk-NIAG6OF6.cjs} +4 -22
  36. package/dist/chunk-NIAG6OF6.cjs.map +1 -0
  37. package/dist/{chunk-FBWUXSKH.js → chunk-P24A2BIR.js} +4 -22
  38. package/dist/chunk-P24A2BIR.js.map +1 -0
  39. package/dist/{chunk-3AA2KGZG.js → chunk-QF2FODTG.js} +5 -173
  40. package/dist/chunk-QF2FODTG.js.map +1 -0
  41. package/dist/{chunk-A6NYZ3F5.js → chunk-RWU2MFUL.js} +4 -4
  42. package/dist/{chunk-A6NYZ3F5.js.map → chunk-RWU2MFUL.js.map} +1 -1
  43. package/dist/{chunk-WF6AYHOS.js → chunk-UMDOSJUH.js} +4 -4
  44. package/dist/{chunk-WF6AYHOS.js.map → chunk-UMDOSJUH.js.map} +1 -1
  45. package/dist/{chunk-23KQF47X.js → chunk-UUEAFG6V.js} +3 -3
  46. package/dist/{chunk-23KQF47X.js.map → chunk-UUEAFG6V.js.map} +1 -1
  47. package/dist/chunk-VAVS6WRZ.cjs +206 -0
  48. package/dist/chunk-VAVS6WRZ.cjs.map +1 -0
  49. package/dist/{chunk-SRICSNL4.cjs → chunk-VQLPAYQF.cjs} +12 -12
  50. package/dist/{chunk-SRICSNL4.cjs.map → chunk-VQLPAYQF.cjs.map} +1 -1
  51. package/dist/{chunk-KSSTFLV2.cjs → chunk-Z44A7NPD.cjs} +6 -6
  52. package/dist/{chunk-KSSTFLV2.cjs.map → chunk-Z44A7NPD.cjs.map} +1 -1
  53. package/dist/code-block.cjs +19 -0
  54. package/dist/code-block.cjs.map +1 -0
  55. package/dist/code-block.d.cts +55 -0
  56. package/dist/code-block.d.ts +55 -0
  57. package/dist/code-block.js +10 -0
  58. package/dist/code-block.js.map +1 -0
  59. package/dist/code-view.cjs +3 -2
  60. package/dist/code-view.js +2 -1
  61. package/dist/composer.cjs +1 -1
  62. package/dist/composer.js +1 -1
  63. package/dist/content-renderer.cjs +5 -4
  64. package/dist/content-renderer.js +2 -1
  65. package/dist/dropdown.cjs +1 -1
  66. package/dist/dropdown.js +1 -1
  67. package/dist/editor.cjs +10 -8
  68. package/dist/editor.js +8 -6
  69. package/dist/index.cjs +114 -107
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.d.cts +1 -0
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.js +28 -25
  74. package/dist/index.js.map +1 -1
  75. package/dist/input.cjs +3 -3
  76. package/dist/input.js +3 -3
  77. package/dist/inputs.cjs +10 -10
  78. package/dist/inputs.js +5 -5
  79. package/dist/json-editor.cjs +16 -16
  80. package/dist/json-editor.js +5 -5
  81. package/dist/magic-wand.cjs +2 -2
  82. package/dist/magic-wand.js +2 -2
  83. package/dist/mobile-menu.cjs +1 -1
  84. package/dist/mobile-menu.js +1 -1
  85. package/dist/paste-pills.cjs +1 -1
  86. package/dist/paste-pills.js +1 -1
  87. package/dist/popover.cjs +1 -1
  88. package/dist/popover.js +1 -1
  89. package/dist/prompt-input.cjs +1 -1
  90. package/dist/prompt-input.js +1 -1
  91. package/dist/reason-tag.cjs +1 -1
  92. package/dist/reason-tag.js +1 -1
  93. package/dist/select.cjs +5 -5
  94. package/dist/select.js +4 -4
  95. package/dist/sidebar.cjs +1 -1
  96. package/dist/sidebar.js +1 -1
  97. package/dist/tooltip.cjs +1 -1
  98. package/dist/tooltip.js +1 -1
  99. package/docs/CodeBlock.md +84 -0
  100. package/package.json +11 -1
  101. package/dist/chunk-3AA2KGZG.js.map +0 -1
  102. package/dist/chunk-CKO2KCUN.cjs.map +0 -1
  103. package/dist/chunk-FBWUXSKH.js.map +0 -1
  104. package/dist/chunk-G7227RTY.cjs.map +0 -1
@@ -0,0 +1,29 @@
1
+ import { useSyncExternalStore } from 'react';
2
+
3
+ // src/components/CodeView/use-is-dark.ts
4
+ function darkQuery() {
5
+ return typeof window.matchMedia === "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null;
6
+ }
7
+ function subscribeDark(callback) {
8
+ const mq = darkQuery();
9
+ mq?.addEventListener?.("change", callback);
10
+ const observer = new MutationObserver(callback);
11
+ observer.observe(document.documentElement, {
12
+ attributes: true,
13
+ attributeFilter: ["class"]
14
+ });
15
+ return () => {
16
+ mq?.removeEventListener?.("change", callback);
17
+ observer.disconnect();
18
+ };
19
+ }
20
+ function darkSnapshot() {
21
+ return document.documentElement.classList.contains("dark") || (darkQuery()?.matches ?? false);
22
+ }
23
+ function useIsDark() {
24
+ return useSyncExternalStore(subscribeDark, darkSnapshot, () => false);
25
+ }
26
+
27
+ export { useIsDark };
28
+ //# sourceMappingURL=chunk-6BB32POL.js.map
29
+ //# sourceMappingURL=chunk-6BB32POL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/CodeView/use-is-dark.ts"],"names":[],"mappings":";;;AAWA,SAAS,SAAA,GAAmC;AAC1C,EAAA,OAAO,OAAO,MAAA,CAAO,UAAA,KAAe,aAChC,MAAA,CAAO,UAAA,CAAW,8BAA8B,CAAA,GAChD,IAAA;AACN;AAEA,SAAS,cAAc,QAAA,EAAkC;AACvD,EAAA,MAAM,KAAK,SAAA,EAAU;AACrB,EAAA,EAAA,EAAI,gBAAA,GAAmB,UAAU,QAAQ,CAAA;AACzC,EAAA,MAAM,QAAA,GAAW,IAAI,gBAAA,CAAiB,QAAQ,CAAA;AAC9C,EAAA,QAAA,CAAS,OAAA,CAAQ,SAAS,eAAA,EAAiB;AAAA,IACzC,UAAA,EAAY,IAAA;AAAA,IACZ,eAAA,EAAiB,CAAC,OAAO;AAAA,GAC1B,CAAA;AACD,EAAA,OAAO,MAAM;AACX,IAAA,EAAA,EAAI,mBAAA,GAAsB,UAAU,QAAQ,CAAA;AAC5C,IAAA,QAAA,CAAS,UAAA,EAAW;AAAA,EACtB,CAAA;AACF;AAEA,SAAS,YAAA,GAAwB;AAC/B,EAAA,OAAO,QAAA,CAAS,gBAAgB,SAAA,CAAU,QAAA,CAAS,MAAM,CAAA,KAAM,SAAA,IAAa,OAAA,IAAW,KAAA,CAAA;AACzF;AAGO,SAAS,SAAA,GAAqB;AACnC,EAAA,OAAO,oBAAA,CAAqB,aAAA,EAAe,YAAA,EAAc,MAAM,KAAK,CAAA;AACtE","file":"chunk-6BB32POL.js","sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n// ── Dark-mode detection ────────────────────────────────────────────────────\n// The highlight palette is baked in as inline colors, so we resolve light/dark\n// ourselves. Follow BOTH signals so we match whatever drives the surrounding\n// `dark:` Tailwind variants: the `.dark` class (class strategy) OR the\n// prefers-color-scheme media query (media strategy). Shared by CodeView and\n// CodeBlock so the two always agree on the palette.\n\n// `matchMedia` is optional: jsdom (and so a consumer's component tests) has\n// none, and a missing media API must cost the media signal, not the render.\nfunction darkQuery(): MediaQueryList | null {\n return typeof window.matchMedia === \"function\"\n ? window.matchMedia(\"(prefers-color-scheme: dark)\")\n : null;\n}\n\nfunction subscribeDark(callback: () => void): () => void {\n const mq = darkQuery();\n mq?.addEventListener?.(\"change\", callback);\n const observer = new MutationObserver(callback);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n return () => {\n mq?.removeEventListener?.(\"change\", callback);\n observer.disconnect();\n };\n}\n\nfunction darkSnapshot(): boolean {\n return document.documentElement.classList.contains(\"dark\") || (darkQuery()?.matches ?? false);\n}\n\n/** Light on the server (and during hydration), then the real theme. */\nexport function useIsDark(): boolean {\n return useSyncExternalStore(subscribeDark, darkSnapshot, () => false);\n}\n"]}
@@ -2,11 +2,11 @@ import { InputWrapper } from './chunk-KXYMMNNV.js';
2
2
  import { DisplayValue } from './chunk-WX5XYDVN.js';
3
3
  import { Field } from './chunk-5WQ6FPSP.js';
4
4
  import { resolveOption, inputBaseClasses, inputSizeClasses, dirtyClasses, errorClasses } from './chunk-USWQAMI3.js';
5
+ import { isImeComposing } from './chunk-S42OGG43.js';
5
6
  import { useFloatingPosition } from './chunk-MQ6VGG62.js';
7
+ import { Portal } from './chunk-RBCMKPBX.js';
6
8
  import { useInlineEdit } from './chunk-OL53XYHF.js';
7
9
  import { useFieldMode } from './chunk-NRXK42LO.js';
8
- import { isImeComposing } from './chunk-S42OGG43.js';
9
- import { Portal } from './chunk-RBCMKPBX.js';
10
10
  import { useOutsideClick } from './chunk-RGANGU7X.js';
11
11
  import { useEscapeKey } from './chunk-YX6FTJ6N.js';
12
12
  import { cn } from './chunk-MMW2JGKZ.js';
@@ -526,5 +526,5 @@ var Select = forwardRef(
526
526
  Select.displayName = "Select";
527
527
 
528
528
  export { Select };
529
- //# sourceMappingURL=chunk-XIA2UAVO.js.map
530
- //# sourceMappingURL=chunk-XIA2UAVO.js.map
529
+ //# sourceMappingURL=chunk-6GVOW3UL.js.map
530
+ //# sourceMappingURL=chunk-6GVOW3UL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/inputs/Select/Select.tsx"],"names":["label","opt"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAS,cACP,IAAA,EAC0B;AAC1B,EAAA,OAAO,OAAO,IAAA,KAAS,QAAA,IAAY,SAAA,IAAa,IAAA;AAClD;AAEA,SAAS,eAAe,IAAA,EAAyD;AAC/E,EAAA,MAAM,OAAsB,EAAC;AAC7B,EAAA,KAAA,MAAW,QAAQ,IAAA,EAAM;AACvB,IAAA,IAAI,aAAA,CAAc,IAAI,CAAA,EAAG;AACvB,MAAA,IAAA,CAAK,IAAA,CAAK,GAAG,IAAA,CAAK,OAAO,CAAA;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A;AAAA,EACpB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,KAAY,KAAA,CAAM,WAAW,SAAA,GAAY,QAAA,CAAA;AAE/D,IAAA,IAAI,YAAY,SAAA,EAAW;AACzB,MAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,GAAA,EAAU,CAAA;AAAA,IAC7C;AACA,IAAA,uBAAO,GAAA,CAAC,YAAA,EAAA,EAAc,GAAG,KAAA,EAAO,GAAA,EAAU,CAAA;AAAA,EAC5C;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"chunk-XIA2UAVO.js","sourcesContent":["import { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { isImeComposing } from \"../../../utils/ime\";\nimport { Field } from \"../Field\";\nimport { InputWrapper } from \"../InputWrapper\";\nimport { Portal } from \"../../Portal\";\nimport { useFloatingPosition } from \"../../../hooks/use-floating-position\";\nimport { useOutsideClick } from \"../../../hooks/use-outside-click\";\nimport { useEscapeKey } from \"../../../hooks/use-escape-key\";\nimport {\n dirtyClasses,\n errorClasses,\n inputBaseClasses,\n inputSizeClasses,\n resolveOption,\n} from \"../inputs.utils\";\nimport { useFieldMode } from \"../mode/FieldMode.context\";\nimport { DisplayValue } from \"../mode/DisplayValue\";\nimport { useInlineEdit } from \"../mode/useInlineEdit\";\nimport type { InputOption, InputOptionGroup } from \"../inputs.types\";\nimport type { SelectProps } from \"./Select.types\";\n\nfunction isOptionGroup(\n item: InputOption | InputOptionGroup,\n): item is InputOptionGroup {\n return typeof item === \"object\" && \"options\" in item;\n}\n\nfunction flattenOptions(list: (InputOption | InputOptionGroup)[]): InputOption[] {\n const flat: InputOption[] = [];\n for (const item of list) {\n if (isOptionGroup(item)) {\n flat.push(...item.options);\n } else {\n flat.push(item);\n }\n }\n return flat;\n}\n\nfunction renderNativeOption(option: InputOption, index: number) {\n const resolved = resolveOption(option);\n return (\n <option\n key={`${resolved.value}-${index}`}\n value={resolved.value as string}\n disabled={resolved.disabled}\n >\n {resolved.label}\n </option>\n );\n}\n\n// ── Native variant ──────────────────────────────────────────────────────\n\nconst NativeSelect = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n size = \"md\",\n dirty,\n error,\n label,\n labelHidden,\n description,\n required,\n disabled,\n className,\n id,\n list,\n placeholder,\n prefix,\n suffix,\n prefixPosition,\n suffixPosition,\n mode,\n onValueChange,\n onChange,\n value,\n defaultValue,\n ...props\n },\n ref,\n ) => {\n const autoId = useId();\n const selectId = id ?? autoId;\n const resolvedMode = useFieldMode(mode);\n const { showControl, interactive, enterEdit, exitEdit } = useInlineEdit(resolvedMode, disabled);\n\n if (!showControl) {\n const current = (value ?? defaultValue) as string | undefined;\n const opt = flattenOptions(list)\n .map((o) => resolveOption(o))\n .find((o) => o.value === current);\n const display = (\n <DisplayValue\n size={size}\n leading={prefix}\n trailing={suffix}\n interactive={interactive}\n onActivate={enterEdit}\n >\n {opt?.label ?? current}\n </DisplayValue>\n );\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {display}\n </Field>\n );\n }\n return display;\n }\n\n // When a placeholder is provided but no value/defaultValue, default to \"\"\n // so the disabled placeholder <option> is the initial selection instead of\n // the browser auto-picking the first real option.\n const isControlled = value !== undefined;\n const resolvedDefault =\n !isControlled && defaultValue === undefined && placeholder ? \"\" : defaultValue;\n\n const select = (\n <InputWrapper\n prefix={prefix}\n suffix={suffix}\n prefixPosition={prefixPosition}\n suffixPosition={suffixPosition}\n size={size}\n >\n <select\n data-react-fancy-select=\"\"\n ref={ref}\n id={selectId}\n disabled={disabled}\n required={required}\n className={cn(\n inputBaseClasses,\n inputSizeClasses[size],\n dirtyClasses(dirty),\n errorClasses(error),\n \"w-full appearance-none bg-no-repeat bg-[length:16px] bg-[right_8px_center]\",\n \"bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22%236b7280%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M5.23%207.21a.75.75%200%20011.06.02L10%2011.168l3.71-3.938a.75.75%200%20111.08%201.04l-4.25%204.5a.75.75%200%2001-1.08%200l-4.25-4.5a.75.75%200%2001.02-1.06z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E')]\",\n \"pr-8\",\n className,\n )}\n onChange={(e) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n }}\n {...props}\n {...(isControlled ? { value } : { defaultValue: resolvedDefault })}\n autoFocus={interactive || props.autoFocus}\n onBlur={(e) => {\n props.onBlur?.(e);\n if (interactive) exitEdit();\n }}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {list.map((item, index) =>\n isOptionGroup(item) ? (\n <optgroup key={`group-${index}`} label={item.label}>\n {item.options.map((opt, optIndex) =>\n renderNativeOption(opt, optIndex),\n )}\n </optgroup>\n ) : (\n renderNativeOption(item, index)\n ),\n )}\n </select>\n </InputWrapper>\n );\n\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {select}\n </Field>\n );\n }\n\n return select;\n },\n);\n\nNativeSelect.displayName = \"NativeSelect\";\n\n// ── Listbox variant ─────────────────────────────────────────────────────\n\nconst ListboxSelect = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n size = \"md\",\n dirty,\n error,\n label,\n labelHidden,\n description,\n required,\n disabled,\n className,\n id,\n list,\n placeholder = \"Select...\",\n multiple = false,\n values: controlledValues,\n defaultValues,\n onValueChange,\n onValuesChange,\n searchable = false,\n creatable = false,\n onCreate,\n createLabel = \"Create\",\n selectedSuffix = \"selected\",\n indicator = \"check\",\n mode,\n value: controlledSingleValue,\n defaultValue: defaultSingleValue,\n },\n _ref,\n ) => {\n const autoId = useId();\n const selectId = id ?? autoId;\n const resolvedMode = useFieldMode(mode);\n const { showControl, interactive, enterEdit, exitEdit } = useInlineEdit(resolvedMode, disabled);\n\n // Creatable implies a text input, which is also the search input.\n const textInputEnabled = searchable || creatable;\n\n // ── State ──────────────────────────────────────────────\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [activeIndex, setActiveIndex] = useState(-1);\n const [createdOptions, setCreatedOptions] = useState<InputOption[]>([]);\n\n // Single-select state\n const [singleValue, setSingleValue] = useState<string>(\n (controlledSingleValue as string) ?? (defaultSingleValue as string) ?? \"\",\n );\n const currentSingle = (controlledSingleValue as string) ?? singleValue;\n\n // Multi-select state\n const [multiValues, setMultiValues] = useState<string[]>(\n controlledValues ?? defaultValues ?? [],\n );\n const currentMulti = controlledValues ?? multiValues;\n\n // Sync controlled values\n useEffect(() => {\n if (controlledValues) setMultiValues(controlledValues);\n }, [controlledValues]);\n useEffect(() => {\n if (controlledSingleValue !== undefined) setSingleValue(controlledSingleValue as string);\n }, [controlledSingleValue]);\n\n // ── Refs ───────────────────────────────────────────────\n const anchorRef = useRef<HTMLButtonElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n\n const position = useFloatingPosition(anchorRef, listRef, {\n placement: \"bottom-start\",\n offset: 4,\n enabled: open,\n });\n\n const close = useCallback(() => {\n setOpen(false);\n setSearch(\"\");\n setActiveIndex(-1);\n }, []);\n\n // Outside-click guards the dropdown (in a Portal) against its own clicks,\n // with the trigger button ignored since it toggles open/closed itself.\n useOutsideClick(listRef, close, open, anchorRef);\n useEscapeKey(close, open);\n\n // Focus text input on open\n useEffect(() => {\n if (open && textInputEnabled) {\n requestAnimationFrame(() => searchRef.current?.focus());\n }\n }, [open, textInputEnabled]);\n\n // ── Options ────────────────────────────────────────────\n const resolvedOptions = useMemo(() => {\n const base = flattenOptions(list).map(resolveOption);\n const created = createdOptions.map(resolveOption);\n return [...base, ...created];\n }, [list, createdOptions]);\n\n const filtered = search\n ? resolvedOptions.filter((o) =>\n o.label.toLowerCase().includes(search.toLowerCase()),\n )\n : resolvedOptions;\n\n // Exact-match check to decide whether to show the \"Create X\" row\n const canCreate =\n creatable &&\n search.trim().length > 0 &&\n !resolvedOptions.some(\n (o) =>\n o.label.toLowerCase() === search.trim().toLowerCase() ||\n o.value === search.trim(),\n );\n\n // ── Selection ──────────────────────────────────────────\n const isSelected = (value: string): boolean => {\n if (multiple) return currentMulti.includes(value);\n return currentSingle === value;\n };\n\n const toggleOption = useCallback(\n (value: string) => {\n if (multiple) {\n const next = currentMulti.includes(value)\n ? currentMulti.filter((v) => v !== value)\n : [...currentMulti, value];\n setMultiValues(next);\n onValuesChange?.(next);\n } else {\n setSingleValue(value);\n onValueChange?.(value);\n close();\n }\n },\n [multiple, currentMulti, onValuesChange, onValueChange, close],\n );\n\n const handleCreate = useCallback(() => {\n const label = search.trim();\n if (!label) return;\n const value = label;\n const newOption: InputOption = { value, label };\n setCreatedOptions((prev) => [...prev, newOption]);\n onCreate?.(label);\n setSearch(\"\");\n if (multiple) {\n const next = [...currentMulti, value];\n setMultiValues(next);\n onValuesChange?.(next);\n // Keep dropdown open for multi-select; refocus input\n requestAnimationFrame(() => searchRef.current?.focus());\n } else {\n setSingleValue(value);\n onValueChange?.(value);\n close();\n }\n }, [search, multiple, currentMulti, onCreate, onValuesChange, onValueChange, close]);\n\n // ── Display text ───────────────────────────────────────\n const getDisplayText = (): string => {\n if (multiple) {\n if (currentMulti.length === 0) return placeholder;\n if (currentMulti.length === 1) {\n const opt = resolvedOptions.find((o) => o.value === currentMulti[0]);\n return opt?.label ?? currentMulti[0];\n }\n return `${currentMulti.length} ${selectedSuffix}`;\n }\n if (!currentSingle) return placeholder;\n const opt = resolvedOptions.find((o) => o.value === currentSingle);\n return opt?.label ?? currentSingle;\n };\n\n const hasValue = multiple ? currentMulti.length > 0 : !!currentSingle;\n\n // ── Keyboard ───────────────────────────────────────────\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (!open) {\n if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setOpen(true);\n }\n return;\n }\n\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, filtered.length - 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, 0));\n } else if (e.key === \"Enter\") {\n // Confirming an IME composition in the search box is not a pick.\n if (isImeComposing(e)) return;\n if (activeIndex >= 0) {\n e.preventDefault();\n const item = filtered[activeIndex];\n if (item && !item.disabled) toggleOption(item.value as string);\n } else if (canCreate) {\n e.preventDefault();\n handleCreate();\n }\n }\n };\n\n // ── View mode ──────────────────────────────────────────\n if (!showControl) {\n const labels = multiple\n ? currentMulti.map(\n (v) => resolvedOptions.find((o) => o.value === v)?.label ?? v,\n )\n : currentSingle\n ? [resolvedOptions.find((o) => o.value === currentSingle)?.label ?? currentSingle]\n : [];\n const display = (\n <DisplayValue size={size} interactive={interactive} onActivate={enterEdit}>\n {labels.join(\", \")}\n </DisplayValue>\n );\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {display}\n </Field>\n );\n }\n return display;\n }\n\n // ── Render ─────────────────────────────────────────────\n const trigger = (\n <button\n ref={anchorRef}\n type=\"button\"\n id={selectId}\n disabled={disabled}\n autoFocus={interactive}\n onClick={() => setOpen((o) => !o)}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n data-react-fancy-select=\"\"\n data-variant=\"listbox\"\n className={cn(\n inputBaseClasses,\n inputSizeClasses[size],\n dirtyClasses(dirty),\n errorClasses(error),\n \"flex w-full cursor-pointer items-center justify-between gap-2 text-left\",\n !hasValue && \"text-[color:var(--fancy-text-faint,var(--color-zinc-400))] dark:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\",\n className,\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <svg\n className={cn(\"h-4 w-4 shrink-0 text-zinc-400 transition-transform\", open && \"rotate-180\")}\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n );\n\n const dropdown = open && (\n <Portal>\n <div\n ref={listRef}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n className=\"fixed z-50 max-h-60 min-w-[8rem] overflow-y-auto rounded-xl border border-[color:var(--fancy-border,var(--color-zinc-200))] bg-[color:var(--fancy-surface,var(--color-white))] p-1 shadow-lg dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))] dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))] dark:shadow-zinc-950/50 fancy-scale-in\"\n style={{\n left: position.x,\n top: position.y,\n width: anchorRef.current?.offsetWidth,\n }}\n >\n {textInputEnabled && (\n <div className=\"px-2 pb-1 pt-1\">\n <input\n ref={searchRef}\n type=\"text\"\n value={search}\n onChange={(e) => {\n setSearch(e.target.value);\n setActiveIndex(-1);\n }}\n onKeyDown={handleKeyDown}\n placeholder={creatable && !searchable ? \"Type to add…\" : \"Search…\"}\n className=\"w-full rounded-md border-0 bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] px-2.5 py-1.5 text-sm text-[color:var(--fancy-text,var(--color-zinc-900))] placeholder:text-[color:var(--fancy-text-faint,var(--color-zinc-400))] outline-none dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))] dark:text-[color:var(--fancy-text-dark,var(--color-zinc-100))] dark:placeholder:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\"\n />\n </div>\n )}\n\n {canCreate && (\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-500/10\"\n >\n <svg className=\"h-4 w-4 shrink-0\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M10 3a.75.75 0 01.75.75v5.5h5.5a.75.75 0 010 1.5h-5.5v5.5a.75.75 0 01-1.5 0v-5.5h-5.5a.75.75 0 010-1.5h5.5v-5.5A.75.75 0 0110 3z\" clipRule=\"evenodd\" />\n </svg>\n <span className=\"truncate\">{createLabel} &quot;{search.trim()}&quot;</span>\n </button>\n )}\n\n {filtered.length === 0 && !canCreate ? (\n <div className=\"px-3 py-2 text-sm text-zinc-400\">No results found</div>\n ) : filtered.length === 0 ? null : (\n filtered.map((option, i) => {\n const selected = isSelected(option.value as string);\n return (\n <button\n key={option.value as string}\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n disabled={option.disabled}\n onClick={() => toggleOption(option.value as string)}\n className={cn(\n \"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors\",\n i === activeIndex\n ? \"bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))]\"\n : \"hover:bg-[color:var(--fancy-surface-hover,var(--color-zinc-50))] dark:hover:bg-[color:var(--fancy-surface-hover-dark,color-mix(in_oklab,var(--color-zinc-800)_50%,transparent))]\",\n selected\n ? \"text-[color:var(--fancy-text,var(--color-zinc-900))] dark:text-[color:var(--fancy-text-dark,var(--color-zinc-100))]\"\n : \"text-[color:var(--fancy-text-soft,var(--color-zinc-700))] dark:text-[color:var(--fancy-text-soft-dark,var(--color-zinc-300))]\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {/* Indicator */}\n {indicator === \"checkbox\" ? (\n <span\n className={cn(\n \"flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors\",\n selected\n ? \"border-blue-500 bg-blue-500 text-white dark:border-blue-400 dark:bg-blue-400\"\n : \"border-zinc-300 dark:border-zinc-600\",\n )}\n >\n {selected && (\n <svg className=\"h-3 w-3\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"2.5 6 5 8.5 9.5 3.5\" />\n </svg>\n )}\n </span>\n ) : (\n <span className=\"flex h-4 w-4 shrink-0 items-center justify-center\">\n {selected && (\n <svg className=\"h-4 w-4 text-blue-500 dark:text-blue-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z\" clipRule=\"evenodd\" />\n </svg>\n )}\n </span>\n )}\n\n {/* Label + description */}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate\">{option.label}</span>\n {option.description && (\n <span className=\"block truncate text-xs text-[color:var(--fancy-text-faint,var(--color-zinc-400))] dark:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\">{option.description}</span>\n )}\n </span>\n </button>\n );\n })\n )}\n </div>\n </Portal>\n );\n\n const content = (\n <div\n className=\"relative\"\n onBlur={(e) => {\n // The popover is portaled (focus moves out of this wrapper), so only\n // exit edit when the dropdown is closed and focus has truly left.\n if (interactive && !open && !e.currentTarget.contains(e.relatedTarget as Node)) {\n exitEdit();\n }\n }}\n >\n {trigger}\n {dropdown}\n </div>\n );\n\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {content}\n </Field>\n );\n }\n\n return content;\n },\n);\n\nListboxSelect.displayName = \"ListboxSelect\";\n\n// ── Public component ────────────────────────────────────────────────────\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (props, ref) => {\n const variant = props.variant ?? (props.multiple ? \"listbox\" : \"native\");\n\n if (variant === \"listbox\") {\n return <ListboxSelect {...props} ref={ref} />;\n }\n return <NativeSelect {...props} ref={ref} />;\n },\n);\n\nSelect.displayName = \"Select\";\n"]}
1
+ {"version":3,"sources":["../src/components/inputs/Select/Select.tsx"],"names":["label","opt"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAS,cACP,IAAA,EAC0B;AAC1B,EAAA,OAAO,OAAO,IAAA,KAAS,QAAA,IAAY,SAAA,IAAa,IAAA;AAClD;AAEA,SAAS,eAAe,IAAA,EAAyD;AAC/E,EAAA,MAAM,OAAsB,EAAC;AAC7B,EAAA,KAAA,MAAW,QAAQ,IAAA,EAAM;AACvB,IAAA,IAAI,aAAA,CAAc,IAAI,CAAA,EAAG;AACvB,MAAA,IAAA,CAAK,IAAA,CAAK,GAAG,IAAA,CAAK,OAAO,CAAA;AAAA,IAC3B,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,KAAK,IAAI,CAAA;AAAA,IAChB;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAEA,SAAS,kBAAA,CAAmB,QAAqB,KAAA,EAAe;AAC9D,EAAA,MAAM,QAAA,GAAW,cAAc,MAAM,CAAA;AACrC,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MAEC,OAAO,QAAA,CAAS,KAAA;AAAA,MAChB,UAAU,QAAA,CAAS,QAAA;AAAA,MAElB,QAAA,EAAA,QAAA,CAAS;AAAA,KAAA;AAAA,IAJL,CAAA,EAAG,QAAA,CAAS,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,GAKjC;AAEJ;AAIA,IAAM,YAAA,GAAe,UAAA;AAAA,EACnB,CACE;AAAA,IACE,IAAA,GAAO,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AAA,QACV,MAAA,EAAQ,CAAC,CAAA,KAAM;AAGb,UAAA,IAAI,WAAA,IAAe,CAAC,IAAA,IAAQ,CAAC,EAAE,aAAA,CAAc,QAAA,CAAS,CAAA,CAAE,aAAqB,CAAA,EAAG;AAC9E,YAAA,QAAA,EAAS;AAAA,UACX;AAAA,QACF,CAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,OAAA;AAAA,UACA;AAAA;AAAA;AAAA,KACH;AAGF,IAAA,IAAI,KAAA,IAAS,SAAS,WAAA,EAAa;AACjC,MAAA,uBACE,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,KAAA;AAAA,UACA,WAAA;AAAA,UACA,WAAA;AAAA,UACA,KAAA;AAAA,UACA,QAAA;AAAA,UACA,OAAA,EAAS,QAAA;AAAA,UACT,IAAA;AAAA,UAEC,QAAA,EAAA;AAAA;AAAA,OACH;AAAA,IAEJ;AAEA,IAAA,OAAO,OAAA;AAAA,EACT;AACF,CAAA;AAEA,aAAA,CAAc,WAAA,GAAc,eAAA;AAIrB,IAAM,MAAA,GAAS,UAAA;AAAA,EACpB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,KAAY,KAAA,CAAM,WAAW,SAAA,GAAY,QAAA,CAAA;AAE/D,IAAA,IAAI,YAAY,SAAA,EAAW;AACzB,MAAA,uBAAO,GAAA,CAAC,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,GAAA,EAAU,CAAA;AAAA,IAC7C;AACA,IAAA,uBAAO,GAAA,CAAC,YAAA,EAAA,EAAc,GAAG,KAAA,EAAO,GAAA,EAAU,CAAA;AAAA,EAC5C;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"chunk-6GVOW3UL.js","sourcesContent":["import { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { isImeComposing } from \"../../../utils/ime\";\nimport { Field } from \"../Field\";\nimport { InputWrapper } from \"../InputWrapper\";\nimport { Portal } from \"../../Portal\";\nimport { useFloatingPosition } from \"../../../hooks/use-floating-position\";\nimport { useOutsideClick } from \"../../../hooks/use-outside-click\";\nimport { useEscapeKey } from \"../../../hooks/use-escape-key\";\nimport {\n dirtyClasses,\n errorClasses,\n inputBaseClasses,\n inputSizeClasses,\n resolveOption,\n} from \"../inputs.utils\";\nimport { useFieldMode } from \"../mode/FieldMode.context\";\nimport { DisplayValue } from \"../mode/DisplayValue\";\nimport { useInlineEdit } from \"../mode/useInlineEdit\";\nimport type { InputOption, InputOptionGroup } from \"../inputs.types\";\nimport type { SelectProps } from \"./Select.types\";\n\nfunction isOptionGroup(\n item: InputOption | InputOptionGroup,\n): item is InputOptionGroup {\n return typeof item === \"object\" && \"options\" in item;\n}\n\nfunction flattenOptions(list: (InputOption | InputOptionGroup)[]): InputOption[] {\n const flat: InputOption[] = [];\n for (const item of list) {\n if (isOptionGroup(item)) {\n flat.push(...item.options);\n } else {\n flat.push(item);\n }\n }\n return flat;\n}\n\nfunction renderNativeOption(option: InputOption, index: number) {\n const resolved = resolveOption(option);\n return (\n <option\n key={`${resolved.value}-${index}`}\n value={resolved.value as string}\n disabled={resolved.disabled}\n >\n {resolved.label}\n </option>\n );\n}\n\n// ── Native variant ──────────────────────────────────────────────────────\n\nconst NativeSelect = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n size = \"md\",\n dirty,\n error,\n label,\n labelHidden,\n description,\n required,\n disabled,\n className,\n id,\n list,\n placeholder,\n prefix,\n suffix,\n prefixPosition,\n suffixPosition,\n mode,\n onValueChange,\n onChange,\n value,\n defaultValue,\n ...props\n },\n ref,\n ) => {\n const autoId = useId();\n const selectId = id ?? autoId;\n const resolvedMode = useFieldMode(mode);\n const { showControl, interactive, enterEdit, exitEdit } = useInlineEdit(resolvedMode, disabled);\n\n if (!showControl) {\n const current = (value ?? defaultValue) as string | undefined;\n const opt = flattenOptions(list)\n .map((o) => resolveOption(o))\n .find((o) => o.value === current);\n const display = (\n <DisplayValue\n size={size}\n leading={prefix}\n trailing={suffix}\n interactive={interactive}\n onActivate={enterEdit}\n >\n {opt?.label ?? current}\n </DisplayValue>\n );\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {display}\n </Field>\n );\n }\n return display;\n }\n\n // When a placeholder is provided but no value/defaultValue, default to \"\"\n // so the disabled placeholder <option> is the initial selection instead of\n // the browser auto-picking the first real option.\n const isControlled = value !== undefined;\n const resolvedDefault =\n !isControlled && defaultValue === undefined && placeholder ? \"\" : defaultValue;\n\n const select = (\n <InputWrapper\n prefix={prefix}\n suffix={suffix}\n prefixPosition={prefixPosition}\n suffixPosition={suffixPosition}\n size={size}\n >\n <select\n data-react-fancy-select=\"\"\n ref={ref}\n id={selectId}\n disabled={disabled}\n required={required}\n className={cn(\n inputBaseClasses,\n inputSizeClasses[size],\n dirtyClasses(dirty),\n errorClasses(error),\n \"w-full appearance-none bg-no-repeat bg-[length:16px] bg-[right_8px_center]\",\n \"bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22%236b7280%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M5.23%207.21a.75.75%200%20011.06.02L10%2011.168l3.71-3.938a.75.75%200%20111.08%201.04l-4.25%204.5a.75.75%200%2001-1.08%200l-4.25-4.5a.75.75%200%2001.02-1.06z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E')]\",\n \"pr-8\",\n className,\n )}\n onChange={(e) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n }}\n {...props}\n {...(isControlled ? { value } : { defaultValue: resolvedDefault })}\n autoFocus={interactive || props.autoFocus}\n onBlur={(e) => {\n props.onBlur?.(e);\n if (interactive) exitEdit();\n }}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {list.map((item, index) =>\n isOptionGroup(item) ? (\n <optgroup key={`group-${index}`} label={item.label}>\n {item.options.map((opt, optIndex) =>\n renderNativeOption(opt, optIndex),\n )}\n </optgroup>\n ) : (\n renderNativeOption(item, index)\n ),\n )}\n </select>\n </InputWrapper>\n );\n\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {select}\n </Field>\n );\n }\n\n return select;\n },\n);\n\nNativeSelect.displayName = \"NativeSelect\";\n\n// ── Listbox variant ─────────────────────────────────────────────────────\n\nconst ListboxSelect = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n size = \"md\",\n dirty,\n error,\n label,\n labelHidden,\n description,\n required,\n disabled,\n className,\n id,\n list,\n placeholder = \"Select...\",\n multiple = false,\n values: controlledValues,\n defaultValues,\n onValueChange,\n onValuesChange,\n searchable = false,\n creatable = false,\n onCreate,\n createLabel = \"Create\",\n selectedSuffix = \"selected\",\n indicator = \"check\",\n mode,\n value: controlledSingleValue,\n defaultValue: defaultSingleValue,\n },\n _ref,\n ) => {\n const autoId = useId();\n const selectId = id ?? autoId;\n const resolvedMode = useFieldMode(mode);\n const { showControl, interactive, enterEdit, exitEdit } = useInlineEdit(resolvedMode, disabled);\n\n // Creatable implies a text input, which is also the search input.\n const textInputEnabled = searchable || creatable;\n\n // ── State ──────────────────────────────────────────────\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [activeIndex, setActiveIndex] = useState(-1);\n const [createdOptions, setCreatedOptions] = useState<InputOption[]>([]);\n\n // Single-select state\n const [singleValue, setSingleValue] = useState<string>(\n (controlledSingleValue as string) ?? (defaultSingleValue as string) ?? \"\",\n );\n const currentSingle = (controlledSingleValue as string) ?? singleValue;\n\n // Multi-select state\n const [multiValues, setMultiValues] = useState<string[]>(\n controlledValues ?? defaultValues ?? [],\n );\n const currentMulti = controlledValues ?? multiValues;\n\n // Sync controlled values\n useEffect(() => {\n if (controlledValues) setMultiValues(controlledValues);\n }, [controlledValues]);\n useEffect(() => {\n if (controlledSingleValue !== undefined) setSingleValue(controlledSingleValue as string);\n }, [controlledSingleValue]);\n\n // ── Refs ───────────────────────────────────────────────\n const anchorRef = useRef<HTMLButtonElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n\n const position = useFloatingPosition(anchorRef, listRef, {\n placement: \"bottom-start\",\n offset: 4,\n enabled: open,\n });\n\n const close = useCallback(() => {\n setOpen(false);\n setSearch(\"\");\n setActiveIndex(-1);\n }, []);\n\n // Outside-click guards the dropdown (in a Portal) against its own clicks,\n // with the trigger button ignored since it toggles open/closed itself.\n useOutsideClick(listRef, close, open, anchorRef);\n useEscapeKey(close, open);\n\n // Focus text input on open\n useEffect(() => {\n if (open && textInputEnabled) {\n requestAnimationFrame(() => searchRef.current?.focus());\n }\n }, [open, textInputEnabled]);\n\n // ── Options ────────────────────────────────────────────\n const resolvedOptions = useMemo(() => {\n const base = flattenOptions(list).map(resolveOption);\n const created = createdOptions.map(resolveOption);\n return [...base, ...created];\n }, [list, createdOptions]);\n\n const filtered = search\n ? resolvedOptions.filter((o) =>\n o.label.toLowerCase().includes(search.toLowerCase()),\n )\n : resolvedOptions;\n\n // Exact-match check to decide whether to show the \"Create X\" row\n const canCreate =\n creatable &&\n search.trim().length > 0 &&\n !resolvedOptions.some(\n (o) =>\n o.label.toLowerCase() === search.trim().toLowerCase() ||\n o.value === search.trim(),\n );\n\n // ── Selection ──────────────────────────────────────────\n const isSelected = (value: string): boolean => {\n if (multiple) return currentMulti.includes(value);\n return currentSingle === value;\n };\n\n const toggleOption = useCallback(\n (value: string) => {\n if (multiple) {\n const next = currentMulti.includes(value)\n ? currentMulti.filter((v) => v !== value)\n : [...currentMulti, value];\n setMultiValues(next);\n onValuesChange?.(next);\n } else {\n setSingleValue(value);\n onValueChange?.(value);\n close();\n }\n },\n [multiple, currentMulti, onValuesChange, onValueChange, close],\n );\n\n const handleCreate = useCallback(() => {\n const label = search.trim();\n if (!label) return;\n const value = label;\n const newOption: InputOption = { value, label };\n setCreatedOptions((prev) => [...prev, newOption]);\n onCreate?.(label);\n setSearch(\"\");\n if (multiple) {\n const next = [...currentMulti, value];\n setMultiValues(next);\n onValuesChange?.(next);\n // Keep dropdown open for multi-select; refocus input\n requestAnimationFrame(() => searchRef.current?.focus());\n } else {\n setSingleValue(value);\n onValueChange?.(value);\n close();\n }\n }, [search, multiple, currentMulti, onCreate, onValuesChange, onValueChange, close]);\n\n // ── Display text ───────────────────────────────────────\n const getDisplayText = (): string => {\n if (multiple) {\n if (currentMulti.length === 0) return placeholder;\n if (currentMulti.length === 1) {\n const opt = resolvedOptions.find((o) => o.value === currentMulti[0]);\n return opt?.label ?? currentMulti[0];\n }\n return `${currentMulti.length} ${selectedSuffix}`;\n }\n if (!currentSingle) return placeholder;\n const opt = resolvedOptions.find((o) => o.value === currentSingle);\n return opt?.label ?? currentSingle;\n };\n\n const hasValue = multiple ? currentMulti.length > 0 : !!currentSingle;\n\n // ── Keyboard ───────────────────────────────────────────\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (!open) {\n if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setOpen(true);\n }\n return;\n }\n\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActiveIndex((i) => Math.min(i + 1, filtered.length - 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActiveIndex((i) => Math.max(i - 1, 0));\n } else if (e.key === \"Enter\") {\n // Confirming an IME composition in the search box is not a pick.\n if (isImeComposing(e)) return;\n if (activeIndex >= 0) {\n e.preventDefault();\n const item = filtered[activeIndex];\n if (item && !item.disabled) toggleOption(item.value as string);\n } else if (canCreate) {\n e.preventDefault();\n handleCreate();\n }\n }\n };\n\n // ── View mode ──────────────────────────────────────────\n if (!showControl) {\n const labels = multiple\n ? currentMulti.map(\n (v) => resolvedOptions.find((o) => o.value === v)?.label ?? v,\n )\n : currentSingle\n ? [resolvedOptions.find((o) => o.value === currentSingle)?.label ?? currentSingle]\n : [];\n const display = (\n <DisplayValue size={size} interactive={interactive} onActivate={enterEdit}>\n {labels.join(\", \")}\n </DisplayValue>\n );\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {display}\n </Field>\n );\n }\n return display;\n }\n\n // ── Render ─────────────────────────────────────────────\n const trigger = (\n <button\n ref={anchorRef}\n type=\"button\"\n id={selectId}\n disabled={disabled}\n autoFocus={interactive}\n onClick={() => setOpen((o) => !o)}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n data-react-fancy-select=\"\"\n data-variant=\"listbox\"\n className={cn(\n inputBaseClasses,\n inputSizeClasses[size],\n dirtyClasses(dirty),\n errorClasses(error),\n \"flex w-full cursor-pointer items-center justify-between gap-2 text-left\",\n !hasValue && \"text-[color:var(--fancy-text-faint,var(--color-zinc-400))] dark:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\",\n className,\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <svg\n className={cn(\"h-4 w-4 shrink-0 text-zinc-400 transition-transform\", open && \"rotate-180\")}\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n );\n\n const dropdown = open && (\n <Portal>\n <div\n ref={listRef}\n role=\"listbox\"\n aria-multiselectable={multiple || undefined}\n className=\"fixed z-50 max-h-60 min-w-[8rem] overflow-y-auto rounded-xl border border-[color:var(--fancy-border,var(--color-zinc-200))] bg-[color:var(--fancy-surface,var(--color-white))] p-1 shadow-lg dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))] dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))] dark:shadow-zinc-950/50 fancy-scale-in\"\n style={{\n left: position.x,\n top: position.y,\n width: anchorRef.current?.offsetWidth,\n }}\n >\n {textInputEnabled && (\n <div className=\"px-2 pb-1 pt-1\">\n <input\n ref={searchRef}\n type=\"text\"\n value={search}\n onChange={(e) => {\n setSearch(e.target.value);\n setActiveIndex(-1);\n }}\n onKeyDown={handleKeyDown}\n placeholder={creatable && !searchable ? \"Type to add…\" : \"Search…\"}\n className=\"w-full rounded-md border-0 bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] px-2.5 py-1.5 text-sm text-[color:var(--fancy-text,var(--color-zinc-900))] placeholder:text-[color:var(--fancy-text-faint,var(--color-zinc-400))] outline-none dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))] dark:text-[color:var(--fancy-text-dark,var(--color-zinc-100))] dark:placeholder:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\"\n />\n </div>\n )}\n\n {canCreate && (\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-500/10\"\n >\n <svg className=\"h-4 w-4 shrink-0\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M10 3a.75.75 0 01.75.75v5.5h5.5a.75.75 0 010 1.5h-5.5v5.5a.75.75 0 01-1.5 0v-5.5h-5.5a.75.75 0 010-1.5h5.5v-5.5A.75.75 0 0110 3z\" clipRule=\"evenodd\" />\n </svg>\n <span className=\"truncate\">{createLabel} &quot;{search.trim()}&quot;</span>\n </button>\n )}\n\n {filtered.length === 0 && !canCreate ? (\n <div className=\"px-3 py-2 text-sm text-zinc-400\">No results found</div>\n ) : filtered.length === 0 ? null : (\n filtered.map((option, i) => {\n const selected = isSelected(option.value as string);\n return (\n <button\n key={option.value as string}\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n disabled={option.disabled}\n onClick={() => toggleOption(option.value as string)}\n className={cn(\n \"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors\",\n i === activeIndex\n ? \"bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))]\"\n : \"hover:bg-[color:var(--fancy-surface-hover,var(--color-zinc-50))] dark:hover:bg-[color:var(--fancy-surface-hover-dark,color-mix(in_oklab,var(--color-zinc-800)_50%,transparent))]\",\n selected\n ? \"text-[color:var(--fancy-text,var(--color-zinc-900))] dark:text-[color:var(--fancy-text-dark,var(--color-zinc-100))]\"\n : \"text-[color:var(--fancy-text-soft,var(--color-zinc-700))] dark:text-[color:var(--fancy-text-soft-dark,var(--color-zinc-300))]\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {/* Indicator */}\n {indicator === \"checkbox\" ? (\n <span\n className={cn(\n \"flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors\",\n selected\n ? \"border-blue-500 bg-blue-500 text-white dark:border-blue-400 dark:bg-blue-400\"\n : \"border-zinc-300 dark:border-zinc-600\",\n )}\n >\n {selected && (\n <svg className=\"h-3 w-3\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"2.5 6 5 8.5 9.5 3.5\" />\n </svg>\n )}\n </span>\n ) : (\n <span className=\"flex h-4 w-4 shrink-0 items-center justify-center\">\n {selected && (\n <svg className=\"h-4 w-4 text-blue-500 dark:text-blue-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z\" clipRule=\"evenodd\" />\n </svg>\n )}\n </span>\n )}\n\n {/* Label + description */}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate\">{option.label}</span>\n {option.description && (\n <span className=\"block truncate text-xs text-[color:var(--fancy-text-faint,var(--color-zinc-400))] dark:text-[color:var(--fancy-text-faint-dark,var(--color-zinc-500))]\">{option.description}</span>\n )}\n </span>\n </button>\n );\n })\n )}\n </div>\n </Portal>\n );\n\n const content = (\n <div\n className=\"relative\"\n onBlur={(e) => {\n // The popover is portaled (focus moves out of this wrapper), so only\n // exit edit when the dropdown is closed and focus has truly left.\n if (interactive && !open && !e.currentTarget.contains(e.relatedTarget as Node)) {\n exitEdit();\n }\n }}\n >\n {trigger}\n {dropdown}\n </div>\n );\n\n if (label || error || description) {\n return (\n <Field\n label={label}\n labelHidden={labelHidden}\n description={description}\n error={error}\n required={required}\n htmlFor={selectId}\n size={size}\n >\n {content}\n </Field>\n );\n }\n\n return content;\n },\n);\n\nListboxSelect.displayName = \"ListboxSelect\";\n\n// ── Public component ────────────────────────────────────────────────────\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (props, ref) => {\n const variant = props.variant ?? (props.multiple ? \"listbox\" : \"native\");\n\n if (variant === \"listbox\") {\n return <ListboxSelect {...props} ref={ref} />;\n }\n return <NativeSelect {...props} ref={ref} />;\n },\n);\n\nSelect.displayName = \"Select\";\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk4XMBXG4K_cjs = require('./chunk-4XMBXG4K.cjs');
4
3
  var chunkTTZJ2KXK_cjs = require('./chunk-TTZJ2KXK.cjs');
4
+ var chunk4XMBXG4K_cjs = require('./chunk-4XMBXG4K.cjs');
5
5
  var chunkZU5Q77OT_cjs = require('./chunk-ZU5Q77OT.cjs');
6
6
  var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -395,5 +395,5 @@ exports.CardBody = CardBody;
395
395
  exports.CardFooter = CardFooter;
396
396
  exports.CardHeader = CardHeader;
397
397
  exports.CardMedia = CardMedia;
398
- //# sourceMappingURL=chunk-4JT2QANA.cjs.map
399
- //# sourceMappingURL=chunk-4JT2QANA.cjs.map
398
+ //# sourceMappingURL=chunk-6H7ZN23X.cjs.map
399
+ //# sourceMappingURL=chunk-6H7ZN23X.cjs.map
@@ -1 +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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AZ,EAAqB,KAAA,EAAO,SAC3B,QAAA,kBAAAA,cAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,uBAAA,EAAsB,EAAA;AAAA,QACtB,SAAA,EAAWC,oBAAA;AAAA,UACT,oHAAA;AAAA,UACA,cAAc,IAAI,CAAA;AAAA,UAClB,eAAe,OAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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-4JT2QANA.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-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))]\"\n : \"border-t border-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-border,var(--color-zinc-200))] dark:after:bg-[color:var(--fancy-border-dark,var(--color-zinc-700))]\"\n : \"before:absolute before:top-0 before:h-px before:bg-[color:var(--fancy-border,var(--color-zinc-200))] dark:before:bg-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-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-[color:var(--fancy-surface,var(--color-white))] dark:bg-[color:var(--fancy-surface-dark,var(--color-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"]}
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,cA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AA,UACT,oHAAA;AAAA,UACA,cAAc,IAAI,CAAA;AAAA,UAClB,eAAe,OAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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-6H7ZN23X.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-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-zinc-700))]\"\n : \"border-t border-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-border,var(--color-zinc-200))] dark:after:bg-[color:var(--fancy-border-dark,var(--color-zinc-700))]\"\n : \"before:absolute before:top-0 before:h-px before:bg-[color:var(--fancy-border,var(--color-zinc-200))] dark:before:bg-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-border,var(--color-zinc-200))] dark:border-[color:var(--fancy-border-dark,var(--color-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-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:bg-[color:var(--fancy-surface-muted-dark,var(--color-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-[color:var(--fancy-surface,var(--color-white))] dark:bg-[color:var(--fancy-surface-dark,var(--color-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"]}