@namroodinc/liquid-editorial 0.10.2 → 0.12.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 (202) hide show
  1. package/README.md +32 -18
  2. package/UPGRADING.md +313 -0
  3. package/dist/chunks/{Board-Cnyqrc-R.js → Board-BCS7sDXg.js} +13 -5
  4. package/dist/chunks/{Board-Cnyqrc-R.js.map → Board-BCS7sDXg.js.map} +1 -1
  5. package/dist/chunks/{Board-DFuJt2Oh.cjs → Board-CNVy8gHI.cjs} +2 -2
  6. package/dist/chunks/Board-CNVy8gHI.cjs.map +1 -0
  7. package/dist/chunks/{CollectionView-Vj84E26b.js → CollectionView-B0ZJxkNK.js} +4 -4
  8. package/dist/chunks/CollectionView-B0ZJxkNK.js.map +1 -0
  9. package/dist/chunks/CollectionView-DrszOUOt.cjs +2 -0
  10. package/dist/chunks/CollectionView-DrszOUOt.cjs.map +1 -0
  11. package/dist/chunks/ColourField-BdobU76j.cjs +2 -0
  12. package/dist/chunks/ColourField-BdobU76j.cjs.map +1 -0
  13. package/dist/chunks/{ColourField-D17gkytm.js → ColourField-C39pcjkG.js} +6 -6
  14. package/dist/chunks/ColourField-C39pcjkG.js.map +1 -0
  15. package/dist/chunks/{DatePicker-0uvnuiye.js → DatePicker-DDc1nDTb.js} +21 -21
  16. package/dist/chunks/DatePicker-DDc1nDTb.js.map +1 -0
  17. package/dist/chunks/DatePicker-Dpvfomrm.cjs +2 -0
  18. package/dist/chunks/DatePicker-Dpvfomrm.cjs.map +1 -0
  19. package/dist/chunks/{Drawer-DTtgAZO2.js → Drawer-C3mWT9Kh.js} +2 -2
  20. package/dist/chunks/Drawer-C3mWT9Kh.js.map +1 -0
  21. package/dist/chunks/Drawer-DTKZptua.cjs +2 -0
  22. package/dist/chunks/Drawer-DTKZptua.cjs.map +1 -0
  23. package/dist/chunks/EntryPicker-CgWbgWnc.cjs +2 -0
  24. package/dist/chunks/EntryPicker-CgWbgWnc.cjs.map +1 -0
  25. package/dist/chunks/{EntryPicker-LWwX_EzL.js → EntryPicker-DlEsVCvA.js} +3 -3
  26. package/dist/chunks/EntryPicker-DlEsVCvA.js.map +1 -0
  27. package/dist/chunks/{FormEditor-IKdPwVPx.js → FormEditor-CLLOHKiO.js} +6 -6
  28. package/dist/chunks/{FormEditor-IKdPwVPx.js.map → FormEditor-CLLOHKiO.js.map} +1 -1
  29. package/dist/chunks/{FormEditor-BZ_4nxIG.cjs → FormEditor-iACd0El-.cjs} +2 -2
  30. package/dist/chunks/{FormEditor-BZ_4nxIG.cjs.map → FormEditor-iACd0El-.cjs.map} +1 -1
  31. package/dist/chunks/{RichTextEditor-CwoHE-AN.js → RichTextEditor-B0P53GFt.js} +373 -284
  32. package/dist/chunks/RichTextEditor-B0P53GFt.js.map +1 -0
  33. package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs +2 -0
  34. package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs.map +1 -0
  35. package/dist/chunks/{use-picker-session-BLH1tXk3.js → use-picker-session-BnMxbGAZ.js} +10 -10
  36. package/dist/chunks/use-picker-session-BnMxbGAZ.js.map +1 -0
  37. package/dist/chunks/use-picker-session-DbfOJstX.cjs +2 -0
  38. package/dist/chunks/use-picker-session-DbfOJstX.cjs.map +1 -0
  39. package/dist/components/AppShell/index.cjs +1 -1
  40. package/dist/components/AppShell/index.js +1 -1
  41. package/dist/components/AssetCard/index.cjs +1 -1
  42. package/dist/components/AssetCard/index.cjs.map +1 -1
  43. package/dist/components/AssetCard/index.d.cts.map +1 -1
  44. package/dist/components/AssetCard/index.d.ts.map +1 -1
  45. package/dist/components/AssetCard/index.js +16 -16
  46. package/dist/components/AssetCard/index.js.map +1 -1
  47. package/dist/components/AssetCard/style.css +47 -46
  48. package/dist/components/AssetGrid/index.cjs +1 -1
  49. package/dist/components/AssetGrid/index.cjs.map +1 -1
  50. package/dist/components/AssetGrid/index.d.cts +0 -2
  51. package/dist/components/AssetGrid/index.d.cts.map +1 -1
  52. package/dist/components/AssetGrid/index.d.ts +0 -2
  53. package/dist/components/AssetGrid/index.d.ts.map +1 -1
  54. package/dist/components/AssetGrid/index.js +15 -15
  55. package/dist/components/AssetGrid/index.js.map +1 -1
  56. package/dist/components/Avatar/style.css +26 -5
  57. package/dist/components/Badge/index.cjs +1 -1
  58. package/dist/components/Badge/index.cjs.map +1 -1
  59. package/dist/components/Badge/index.d.cts +2 -3
  60. package/dist/components/Badge/index.d.cts.map +1 -1
  61. package/dist/components/Badge/index.d.ts +2 -3
  62. package/dist/components/Badge/index.d.ts.map +1 -1
  63. package/dist/components/Badge/index.js +1 -1
  64. package/dist/components/Badge/index.js.map +1 -1
  65. package/dist/components/Badge/style.css +20 -26
  66. package/dist/components/Board/index.cjs +1 -1
  67. package/dist/components/Board/index.js +1 -1
  68. package/dist/components/Board/style.css +36 -15
  69. package/dist/components/Button/style.css +19 -10
  70. package/dist/components/ButtonGroup/index.cjs.map +1 -1
  71. package/dist/components/ButtonGroup/index.d.cts +1 -1
  72. package/dist/components/ButtonGroup/index.d.ts +1 -1
  73. package/dist/components/ButtonGroup/index.js.map +1 -1
  74. package/dist/components/ButtonGroup/style.css +4 -20
  75. package/dist/components/Choice/style.css +10 -9
  76. package/dist/components/CollectionView/index.cjs +1 -1
  77. package/dist/components/CollectionView/index.js +1 -1
  78. package/dist/components/CollectionView/style.css +8 -11
  79. package/dist/components/ColourField/index.cjs +1 -1
  80. package/dist/components/ColourField/index.js +1 -1
  81. package/dist/components/ColourField/style.css +28 -17
  82. package/dist/components/DatePicker/index.cjs +1 -1
  83. package/dist/components/DatePicker/index.js +1 -1
  84. package/dist/components/DatePicker/style.css +10 -3
  85. package/dist/components/Drawer/index.cjs +1 -1
  86. package/dist/components/Drawer/index.js +1 -1
  87. package/dist/components/Drawer/style.css +11 -22
  88. package/dist/components/EditLayout/index.cjs +1 -1
  89. package/dist/components/EditLayout/index.cjs.map +1 -1
  90. package/dist/components/EditLayout/index.js +2 -2
  91. package/dist/components/EditLayout/index.js.map +1 -1
  92. package/dist/components/EditLayout/style.css +10 -5
  93. package/dist/components/EntryPicker/index.cjs +1 -1
  94. package/dist/components/EntryPicker/index.js +1 -1
  95. package/dist/components/EntryPicker/item.d.cts +1 -3
  96. package/dist/components/EntryPicker/item.d.cts.map +1 -1
  97. package/dist/components/EntryPicker/item.d.ts +1 -3
  98. package/dist/components/EntryPicker/item.d.ts.map +1 -1
  99. package/dist/components/EntryPicker/style.css +43 -19
  100. package/dist/components/Field/style.css +6 -5
  101. package/dist/components/FormEditor/README.md +40 -12
  102. package/dist/components/FormEditor/index.cjs +1 -1
  103. package/dist/components/FormEditor/index.js +1 -1
  104. package/dist/components/ImageCropper/style.css +20 -20
  105. package/dist/components/Menu/style.css +2 -3
  106. package/dist/components/Modal/index.cjs +1 -1
  107. package/dist/components/Modal/index.cjs.map +1 -1
  108. package/dist/components/Modal/index.js +1 -1
  109. package/dist/components/Modal/index.js.map +1 -1
  110. package/dist/components/Modal/style.css +7 -5
  111. package/dist/components/Popover/style.css +2 -2
  112. package/dist/components/RichTextEditor/index.cjs +1 -1
  113. package/dist/components/RichTextEditor/index.js +1 -1
  114. package/dist/components/RichTextEditor/storyblock-view.d.cts +1 -1
  115. package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -1
  116. package/dist/components/RichTextEditor/storyblock-view.d.ts +1 -1
  117. package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -1
  118. package/dist/components/RichTextEditor/style.css +127 -55
  119. package/dist/components/SelectionCard/index.cjs +1 -1
  120. package/dist/components/SelectionCard/index.cjs.map +1 -1
  121. package/dist/components/SelectionCard/index.d.cts.map +1 -1
  122. package/dist/components/SelectionCard/index.d.ts.map +1 -1
  123. package/dist/components/SelectionCard/index.js +5 -1
  124. package/dist/components/SelectionCard/index.js.map +1 -1
  125. package/dist/components/SelectionCard/style.css +39 -12
  126. package/dist/components/SideNav/index.cjs +1 -1
  127. package/dist/components/SideNav/index.cjs.map +1 -1
  128. package/dist/components/SideNav/index.d.cts +3 -3
  129. package/dist/components/SideNav/index.d.ts +3 -3
  130. package/dist/components/SideNav/index.js +15 -3
  131. package/dist/components/SideNav/index.js.map +1 -1
  132. package/dist/components/SideNav/style.css +19 -13
  133. package/dist/components/Slider/style.css +12 -14
  134. package/dist/components/SortableList/index.cjs +1 -1
  135. package/dist/components/SortableList/index.cjs.map +1 -1
  136. package/dist/components/SortableList/index.js +6 -2
  137. package/dist/components/SortableList/index.js.map +1 -1
  138. package/dist/components/SortableList/style.css +20 -5
  139. package/dist/components/Stepper/style.css +8 -9
  140. package/dist/components/SubNav/index.cjs.map +1 -1
  141. package/dist/components/SubNav/index.d.cts +2 -2
  142. package/dist/components/SubNav/index.d.ts +2 -2
  143. package/dist/components/SubNav/index.js.map +1 -1
  144. package/dist/components/SubNav/style.css +3 -8
  145. package/dist/components/Switch/index.cjs +1 -1
  146. package/dist/components/Switch/index.cjs.map +1 -1
  147. package/dist/components/Switch/index.d.cts.map +1 -1
  148. package/dist/components/Switch/index.d.ts.map +1 -1
  149. package/dist/components/Switch/index.js +2 -2
  150. package/dist/components/Switch/index.js.map +1 -1
  151. package/dist/components/Switch/style.css +14 -6
  152. package/dist/components/Table/index.cjs +1 -1
  153. package/dist/components/Table/index.cjs.map +1 -1
  154. package/dist/components/Table/index.js +2 -2
  155. package/dist/components/Table/index.js.map +1 -1
  156. package/dist/components/Table/style.css +34 -22
  157. package/dist/components/TagsInput/index.cjs +1 -1
  158. package/dist/components/TagsInput/index.cjs.map +1 -1
  159. package/dist/components/TagsInput/index.js +1 -1
  160. package/dist/components/TagsInput/index.js.map +1 -1
  161. package/dist/components/TagsInput/style.css +31 -6
  162. package/dist/components/Time/style.css +1 -1
  163. package/dist/components/Toast/style.css +1 -1
  164. package/dist/components/TopNav/index.cjs +1 -1
  165. package/dist/components/TopNav/index.cjs.map +1 -1
  166. package/dist/components/TopNav/index.d.cts +4 -4
  167. package/dist/components/TopNav/index.d.ts +4 -4
  168. package/dist/components/TopNav/index.js +5 -1
  169. package/dist/components/TopNav/index.js.map +1 -1
  170. package/dist/components/TopNav/style.css +6 -9
  171. package/dist/elements.css +0 -1
  172. package/dist/index.cjs +1 -1
  173. package/dist/index.d.cts +2 -2
  174. package/dist/index.d.cts.map +1 -1
  175. package/dist/index.d.ts +2 -2
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +44 -44
  178. package/dist/message.css +8 -14
  179. package/dist/tokens.css +101 -43
  180. package/package.json +1 -1
  181. package/dist/chunks/Board-DFuJt2Oh.cjs.map +0 -1
  182. package/dist/chunks/CollectionView-BNYx29b1.cjs +0 -2
  183. package/dist/chunks/CollectionView-BNYx29b1.cjs.map +0 -1
  184. package/dist/chunks/CollectionView-Vj84E26b.js.map +0 -1
  185. package/dist/chunks/ColourField-B03ejnGS.cjs +0 -2
  186. package/dist/chunks/ColourField-B03ejnGS.cjs.map +0 -1
  187. package/dist/chunks/ColourField-D17gkytm.js.map +0 -1
  188. package/dist/chunks/DatePicker-0uvnuiye.js.map +0 -1
  189. package/dist/chunks/DatePicker-CVaefhfS.cjs +0 -2
  190. package/dist/chunks/DatePicker-CVaefhfS.cjs.map +0 -1
  191. package/dist/chunks/Drawer-BDX9_qHA.cjs +0 -2
  192. package/dist/chunks/Drawer-BDX9_qHA.cjs.map +0 -1
  193. package/dist/chunks/Drawer-DTtgAZO2.js.map +0 -1
  194. package/dist/chunks/EntryPicker-CiS8zT64.cjs +0 -2
  195. package/dist/chunks/EntryPicker-CiS8zT64.cjs.map +0 -1
  196. package/dist/chunks/EntryPicker-LWwX_EzL.js.map +0 -1
  197. package/dist/chunks/RichTextEditor-CwoHE-AN.js.map +0 -1
  198. package/dist/chunks/RichTextEditor-DMrxJhA6.cjs +0 -2
  199. package/dist/chunks/RichTextEditor-DMrxJhA6.cjs.map +0 -1
  200. package/dist/chunks/use-picker-session-BLH1tXk3.js.map +0 -1
  201. package/dist/chunks/use-picker-session-tRDYUd_d.cjs +0 -2
  202. package/dist/chunks/use-picker-session-tRDYUd_d.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useDialogPresence","useRef","useId","useModalDialog","useDialogPortal","createPortal","DialogContent","mergeRefs","dialogAttributes","Button","require_components_Button_index","require_mergeRefs","require_overlayLayer","require_dialogLabel","react","react_dom","react_jsx_runtime","Modal","rest","visible","resumed","isOpen","isHidden","overlayLayer","panelRef","scrimRef","titleId","descriptionId","portal","order","node","layer","onScrimMouseDown","ref","description","size","className","hasHeader","title","onClose","footer"],"sources":["../../../src/components/Modal/index.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Button } from \"../Button\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useDialogPortal } from \"../../internal/useDialogPortal\";\nimport { useModalDialog } from \"../../internal/useModalDialog\";\nimport { dialogAttributes } from \"../../internal/dialogLabel\";\nimport { useInheritedPortalScope } from \"../../internal/portalScope\";\nimport { DialogContent, useDialogPresence } from \"../../internal/overlayLayer\";\nexport { OverlayLayer } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nexport type ModalSize = \"dialog\" | \"md\" | \"wide\" | \"full\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n isOpen: boolean;\n /**\n * Visually suspend an open dialog while retaining its mounted children. It\n * stays laid out but invisible and inert, so scroll positions are kept.\n */\n isHidden?: boolean;\n /** Escape, the scrim and the close button all call this. */\n onClose: () => void;\n /** Names the dialog. `aria-label` or `aria-labelledby` replace it as the name. */\n title: string;\n description?: string;\n /** `full` fills the viewport inside the scrim's gutters. */\n size?: ModalSize;\n /**\n * Show the title band and its Close button. Without it the title and\n * description still name and describe the dialog; give people another\n * visible way to close it.\n */\n hasHeader?: boolean;\n /**\n * z-index for this dialog and the dialogs and popovers opened from it.\n * Defaults to an enclosing `OverlayLayer`, then the stylesheet. Keep it below\n * the toast layer (80).\n */\n overlayLayer?: number;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A focused task on top of the page. Heavy frame, hairline rules, a quiet\n * footer band — the collection frame, floated. Focus is trapped while open.\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n size = \"md\",\n hasHeader = true,\n overlayLayer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const {\n layer,\n isVisible: visible,\n isResumed: resumed,\n } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: visible,\n panelRef,\n onClose,\n layer,\n });\n const portal = useDialogPortal(order, isOpen);\n useInheritedPortalScope(scrimRef, isOpen);\n\n if (!isOpen || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={!visible}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n // Suspended dialogs stay laid out (visibility: hidden), so make them inert.\n if (node) {\n node.inert = !visible;\n }\n }}\n className=\"ds-scrim\"\n hidden={!visible}\n data-resumed={resumed || undefined}\n aria-hidden={!visible || undefined}\n style={{ zIndex: layer }}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), visible)}\n tabIndex={-1}\n data-size={size}\n className={[\"ds-modal\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <header\n className=\"ds-modal__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-modal__titles\">\n <h2\n id={titleId}\n className=\"ds-modal__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-modal__description\"\n >\n {description}\n </p>\n )}\n </div>\n {hasHeader && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Close\"\n className=\"ds-modal__close\"\n onClick={onClose}\n />\n )}\n </header>\n <div className=\"ds-modal__body\">{children}</div>\n {footer && <footer className=\"ds-modal__footer\">{footer}</footer>}\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":"A,+UAiDA,IAAakB,GAAA,EAAQlB,EAAAA,WAAAA,CAAuC,SAC1D,CACE,SACA,WAAW,GACX,UACA,QACA,cACA,OAAO,KACP,YAAY,GACZ,eACA,SACA,YACA,WACA,GAAGmB,GAEL,EACA,CACA,GAAM,CACJ,QACA,UAAWC,EACX,UAAWC,GACTpB,EAAAA,EAAkBqB,EAAQC,EAAUC,CAAY,EAC9CC,GAAA,EAAWvB,EAAAA,OAAAA,CAA8B,IAAI,EAC7CwB,GAAA,EAAWxB,EAAAA,OAAAA,CAA8B,IAAI,EAC7CyB,GAAA,EAAUxB,EAAAA,MAAAA,CAAM,EAChByB,GAAA,EAAgBzB,EAAAA,MAAAA,CAAM,EACtB,CAAE,mBAAkB,SAAUC,EAAAA,EAAe,CACjD,SACA,SAAUgB,EACV,WACA,UACA,OACF,CAAC,EACKS,EAASxB,EAAAA,EAAgByB,EAAOR,CAAM,EAO5C,OANAT,EAAA,EAAwBa,EAAUJ,CAAM,EAEpC,CAACA,GAAU,CAACO,EACP,MAGT,EAAOvB,EAAAA,aAAAA,EACL,EAAAW,EAAA,IAAA,CAACV,EAAAA,EAAD,CACS,QACP,YAAa,CAACa,EAEd,UAAA,EAAAH,EAAA,IAAA,CAAC,MAAD,CACE,IAAM,GAAS,CACb,EAAS,QAAUc,EAEfA,IACF,EAAK,MAAQ,CAACX,EAElB,EACA,UAAU,WACV,OAAQ,CAACA,EACT,eAAcC,GAAW,IAAA,GACzB,cAAa,CAACD,GAAW,IAAA,GACzB,MAAO,CAAE,OAAQY,CAAM,EACvB,YAAaC,EAEb,UAAA,EAAAhB,EAAA,KAAA,CAAC,MAAD,CACE,GAAIE,EACJ,IAAKX,EAAAA,EAAUiB,EAAUS,CAAG,EAC5B,GAAIzB,EAAAA,EAAiBU,EAAMQ,EAASC,EAAe,EAAQO,EAAcf,CAAO,EAChF,SAAU,GACV,YAAWgB,EACX,UAAW,CAAC,WAAY,mBAAoBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EANjF,SAAA,EAQE,EAAApB,EAAA,KAAA,CAAC,SAAD,CACE,UAAU,iBACV,OAAQ,CAACqB,EAFX,SAAA,EAIE,EAAArB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,mBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CACE,GAAIU,EACJ,UAAU,kBAET,SAAAY,CACC,CAAA,EACHJ,IACC,EAAAlB,EAAA,IAAA,CAAC,IAAD,CACE,GAAIW,EACJ,UAAU,wBAET,SAAAO,CACA,CAAA,CAEF,CACJ,CAAA,EAAAG,IACC,EAAArB,EAAA,IAAA,CAACP,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,IACV,aAAW,QACX,UAAU,kBACV,QAAS8B,CACV,CAAA,CAEG,C,IACR,EAAAvB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,iBAAkB,UAAc,CAAA,EAC9CwB,IAAU,EAAAxB,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,mBAAoB,SAAAwB,CAAe,CAAA,CAC7D,C,EACF,CAAA,CACQ,CAAA,EACfZ,CACF,CACF,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useDialogPresence","useRef","useId","useModalDialog","useDialogPortal","createPortal","DialogContent","mergeRefs","dialogAttributes","Button","require_components_Button_index","require_mergeRefs","require_overlayLayer","require_dialogLabel","react","react_dom","react_jsx_runtime","Modal","rest","visible","resumed","isOpen","isHidden","overlayLayer","panelRef","scrimRef","titleId","descriptionId","portal","order","node","layer","onScrimMouseDown","ref","description","size","className","hasHeader","title","onClose","footer"],"sources":["../../../src/components/Modal/index.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Button } from \"../Button\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useDialogPortal } from \"../../internal/useDialogPortal\";\nimport { useModalDialog } from \"../../internal/useModalDialog\";\nimport { dialogAttributes } from \"../../internal/dialogLabel\";\nimport { useInheritedPortalScope } from \"../../internal/portalScope\";\nimport { DialogContent, useDialogPresence } from \"../../internal/overlayLayer\";\nexport { OverlayLayer } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nexport type ModalSize = \"dialog\" | \"md\" | \"wide\" | \"full\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n isOpen: boolean;\n /**\n * Visually suspend an open dialog while retaining its mounted children. It\n * stays laid out but invisible and inert, so scroll positions are kept.\n */\n isHidden?: boolean;\n /** Escape, the scrim and the close button all call this. */\n onClose: () => void;\n /** Names the dialog. `aria-label` or `aria-labelledby` replace it as the name. */\n title: string;\n description?: string;\n /** `full` fills the viewport inside the scrim's gutters. */\n size?: ModalSize;\n /**\n * Show the title band and its Close button. Without it the title and\n * description still name and describe the dialog; give people another\n * visible way to close it.\n */\n hasHeader?: boolean;\n /**\n * z-index for this dialog and the dialogs and popovers opened from it.\n * Defaults to an enclosing `OverlayLayer`, then the stylesheet. Keep it below\n * the toast layer (80).\n */\n overlayLayer?: number;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A focused task on top of the page. Heavy frame, hairline rules, a quiet\n * footer band — the collection frame, floated. Focus is trapped while open.\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n size = \"md\",\n hasHeader = true,\n overlayLayer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const {\n layer,\n isVisible: visible,\n isResumed: resumed,\n } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: visible,\n panelRef,\n onClose,\n layer,\n });\n const portal = useDialogPortal(order, isOpen);\n useInheritedPortalScope(scrimRef, isOpen);\n\n if (!isOpen || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={!visible}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n // Suspended dialogs stay laid out (visibility: hidden), so make them inert.\n if (node) {\n node.inert = !visible;\n }\n }}\n className=\"ds-scrim\"\n hidden={!visible}\n data-resumed={resumed || undefined}\n aria-hidden={!visible || undefined}\n style={{ zIndex: layer }}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), visible)}\n tabIndex={-1}\n data-size={size}\n className={[\"ds-modal\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <header\n className=\"ds-modal__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-modal__titles\">\n <h2\n id={titleId}\n className=\"ds-modal__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-modal__description\"\n >\n {description}\n </p>\n )}\n </div>\n {hasHeader && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Close\"\n className=\"ds-modal__close\"\n onClick={onClose}\n />\n )}\n </header>\n <div className=\"ds-modal__body\">{children}</div>\n {footer && <footer className=\"ds-modal__footer ds-field-surface\">{footer}</footer>}\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":"A,+UAiDA,IAAakB,GAAA,EAAQlB,E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AQE,EAAApB,EAAA,KAAA,CAAC,SAAD,CACE,UAAU,iBACV,OAAQ,CAACqB,EAFX,SAAA,EAIE,EAAArB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,mBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CACE,GAAIU,EACJ,UAAU,kBAET,SAAAY,CACC,CAAA,EACHJ,IACC,EAAAlB,EAAA,IAAA,CAAC,IAAD,CACE,GAAIW,EACJ,UAAU,wBAET,SAAAO,CACA,CAAA,CAEF,CACJ,CAAA,EAAAG,IACC,EAAArB,EAAA,IAAA,CAACP,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,IACV,aAAW,QACX,UAAU,kBACV,QAAS8B,CACV,CAAA,CAEG,C,IACR,EAAAvB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,iBAAkB,UAAc,CAAA,EAC9CwB,IAAU,EAAAxB,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,oCAAqC,SAAAwB,CAAe,CAAA,CAC9E,C,EACF,CAAA,CACQ,CAAA,EACfZ,CACF,CACF,CAAC,E"}
@@ -68,7 +68,7 @@ var h = l(function({ isOpen: r, isHidden: l = !1, onClose: h, title: g, descript
68
68
  children: C
69
69
  }),
70
70
  x && /* @__PURE__ */ p("footer", {
71
- className: "ds-modal__footer",
71
+ className: "ds-modal__footer ds-field-surface",
72
72
  children: x
73
73
  })
74
74
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useInheritedPortalScope","OverlayLayer","useDialogPresence","DialogContent","useModalDialog","useDialogPortal","dialogAttributes","Modal","forwardRef","rest","visible","resumed","isOpen","isHidden","overlayLayer","panelRef","useRef","scrimRef","titleId","useId","descriptionId","portal","order","createPortal","node","layer","onScrimMouseDown","mergeRefs","ref","description","size","className","hasHeader","title","Button","onClose","footer"],"sources":["../../../src/components/Modal/index.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Button } from \"../Button\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useDialogPortal } from \"../../internal/useDialogPortal\";\nimport { useModalDialog } from \"../../internal/useModalDialog\";\nimport { dialogAttributes } from \"../../internal/dialogLabel\";\nimport { useInheritedPortalScope } from \"../../internal/portalScope\";\nimport { DialogContent, useDialogPresence } from \"../../internal/overlayLayer\";\nexport { OverlayLayer } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nexport type ModalSize = \"dialog\" | \"md\" | \"wide\" | \"full\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n isOpen: boolean;\n /**\n * Visually suspend an open dialog while retaining its mounted children. It\n * stays laid out but invisible and inert, so scroll positions are kept.\n */\n isHidden?: boolean;\n /** Escape, the scrim and the close button all call this. */\n onClose: () => void;\n /** Names the dialog. `aria-label` or `aria-labelledby` replace it as the name. */\n title: string;\n description?: string;\n /** `full` fills the viewport inside the scrim's gutters. */\n size?: ModalSize;\n /**\n * Show the title band and its Close button. Without it the title and\n * description still name and describe the dialog; give people another\n * visible way to close it.\n */\n hasHeader?: boolean;\n /**\n * z-index for this dialog and the dialogs and popovers opened from it.\n * Defaults to an enclosing `OverlayLayer`, then the stylesheet. Keep it below\n * the toast layer (80).\n */\n overlayLayer?: number;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A focused task on top of the page. Heavy frame, hairline rules, a quiet\n * footer band — the collection frame, floated. Focus is trapped while open.\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n size = \"md\",\n hasHeader = true,\n overlayLayer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const {\n layer,\n isVisible: visible,\n isResumed: resumed,\n } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: visible,\n panelRef,\n onClose,\n layer,\n });\n const portal = useDialogPortal(order, isOpen);\n useInheritedPortalScope(scrimRef, isOpen);\n\n if (!isOpen || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={!visible}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n // Suspended dialogs stay laid out (visibility: hidden), so make them inert.\n if (node) {\n node.inert = !visible;\n }\n }}\n className=\"ds-scrim\"\n hidden={!visible}\n data-resumed={resumed || undefined}\n aria-hidden={!visible || undefined}\n style={{ zIndex: layer }}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), visible)}\n tabIndex={-1}\n data-size={size}\n className={[\"ds-modal\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <header\n className=\"ds-modal__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-modal__titles\">\n <h2\n id={titleId}\n className=\"ds-modal__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-modal__description\"\n >\n {description}\n </p>\n )}\n </div>\n {hasHeader && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Close\"\n className=\"ds-modal__close\"\n onClick={onClose}\n />\n )}\n </header>\n <div className=\"ds-modal__body\">{children}</div>\n {footer && <footer className=\"ds-modal__footer\">{footer}</footer>}\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":";;;;;;;;AAiDA,IAAaO,IAAQC,EAAuC,SAC1D,EACE,WACA,cAAW,IACX,YACA,UACA,gBACA,UAAO,MACP,eAAY,IACZ,iBACA,WACA,cACA,aACA,GAAGC,KAEL,GACA;CACA,IAAM,EACJ,UACA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,SAASC;MACV,CAAA,CAEG;;KACR,kBAAC,OAAD;MAAK,WAAU;MAAkB;KAAc,CAAA;KAC9CC,KAAU,kBAAC,UAAD;MAAQ,WAAU;MAAoB,UAAAA;KAAe,CAAA;IAC7D;;EACF,CAAA;CACQ,CAAA,GACff,CACF;AACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["useInheritedPortalScope","OverlayLayer","useDialogPresence","DialogContent","useModalDialog","useDialogPortal","dialogAttributes","Modal","forwardRef","rest","visible","resumed","isOpen","isHidden","overlayLayer","panelRef","useRef","scrimRef","titleId","useId","descriptionId","portal","order","createPortal","node","layer","onScrimMouseDown","mergeRefs","ref","description","size","className","hasHeader","title","Button","onClose","footer"],"sources":["../../../src/components/Modal/index.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Button } from \"../Button\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useDialogPortal } from \"../../internal/useDialogPortal\";\nimport { useModalDialog } from \"../../internal/useModalDialog\";\nimport { dialogAttributes } from \"../../internal/dialogLabel\";\nimport { useInheritedPortalScope } from \"../../internal/portalScope\";\nimport { DialogContent, useDialogPresence } from \"../../internal/overlayLayer\";\nexport { OverlayLayer } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nexport type ModalSize = \"dialog\" | \"md\" | \"wide\" | \"full\";\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n isOpen: boolean;\n /**\n * Visually suspend an open dialog while retaining its mounted children. It\n * stays laid out but invisible and inert, so scroll positions are kept.\n */\n isHidden?: boolean;\n /** Escape, the scrim and the close button all call this. */\n onClose: () => void;\n /** Names the dialog. `aria-label` or `aria-labelledby` replace it as the name. */\n title: string;\n description?: string;\n /** `full` fills the viewport inside the scrim's gutters. */\n size?: ModalSize;\n /**\n * Show the title band and its Close button. Without it the title and\n * description still name and describe the dialog; give people another\n * visible way to close it.\n */\n hasHeader?: boolean;\n /**\n * z-index for this dialog and the dialogs and popovers opened from it.\n * Defaults to an enclosing `OverlayLayer`, then the stylesheet. Keep it below\n * the toast layer (80).\n */\n overlayLayer?: number;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A focused task on top of the page. Heavy frame, hairline rules, a quiet\n * footer band — the collection frame, floated. Focus is trapped while open.\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n size = \"md\",\n hasHeader = true,\n overlayLayer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const {\n layer,\n isVisible: visible,\n isResumed: resumed,\n } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: visible,\n panelRef,\n onClose,\n layer,\n });\n const portal = useDialogPortal(order, isOpen);\n useInheritedPortalScope(scrimRef, isOpen);\n\n if (!isOpen || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={!visible}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n // Suspended dialogs stay laid out (visibility: hidden), so make them inert.\n if (node) {\n node.inert = !visible;\n }\n }}\n className=\"ds-scrim\"\n hidden={!visible}\n data-resumed={resumed || undefined}\n aria-hidden={!visible || undefined}\n style={{ zIndex: layer }}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), visible)}\n tabIndex={-1}\n data-size={size}\n className={[\"ds-modal\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <header\n className=\"ds-modal__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-modal__titles\">\n <h2\n id={titleId}\n className=\"ds-modal__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-modal__description\"\n >\n {description}\n </p>\n )}\n </div>\n {hasHeader && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Close\"\n className=\"ds-modal__close\"\n onClick={onClose}\n />\n )}\n </header>\n <div className=\"ds-modal__body\">{children}</div>\n {footer && <footer className=\"ds-modal__footer ds-field-surface\">{footer}</footer>}\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":";;;;;;;;AAiDA,IAAaO,IAAQC,EAAuC,SAC1D,EACE,WACA,cAAW,IACX,YACA,UACA,gBACA,UAAO,MACP,eAAY,IACZ,iBACA,WACA,cACA,aACA,GAAGC,KAEL,GACA;CACA,IAAM,EACJ,UACA,WAAWC,GACX,WAAWC,MACTT,EAAkBU,GAAQC,GAAUC,CAAY,GAC9CC,IAAWC,EAA8B,IAAI,GAC7CC,IAAWD,EAA8B,IAAI,GAC7CE,IAAUC,EAAM,GAChBC,IAAgBD,EAAM,GACtB,EAAE,qBAAkB,aAAUf,EAAe;EACjD;EACA,UAAUM;EACV;EACA;EACA;CACF,CAAC,GACKW,IAAShB,EAAgBiB,GAAOV,CAAM;CAO5C,OANAZ,EAAwBiB,GAAUL,CAAM,GAEpC,CAACA,KAAU,CAACS,IACP,OAGFE,EACL,kBAACpB,GAAD;EACS;EACP,aAAa,CAACO;EAEd,UAAA,kBAAC,OAAD;GACE,MAAM,MAAS;IAGb,AAFA,EAAS,UAAUc,GAEfA,MACF,EAAK,QAAQ,CAACd;GAElB;GACA,WAAU;GACV,QAAQ,CAACA;GACT,gBAAcC,KAAW,KAAA;GACzB,eAAa,CAACD,KAAW,KAAA;GACzB,OAAO,EAAE,QAAQe,EAAM;GACvB,aAAaC;GAEb,UAAA,kBAAC,OAAD;IACE,GAAIjB;IACJ,KAAKkB,EAAUZ,GAAUa,CAAG;IAC5B,GAAItB,EAAiBG,GAAMS,GAASE,GAAe,EAAQS,GAAcnB,CAAO;IAChF,UAAU;IACV,aAAWoB;IACX,WAAW;KAAC;KAAY;KAAoBC;IAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;IANjF,UAAA;KAQE,kBAAC,UAAD;MACE,WAAU;MACV,QAAQ,CAACC;MAFX,UAAA,CAIE,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QACE,IAAId;QACJ,WAAU;QAET,UAAAe;OACC,CAAA,GACHJ,KACC,kBAAC,KAAD;QACE,IAAIT;QACJ,WAAU;QAET,UAAAS;OACA,CAAA,CAEF;MACJ,CAAA,GAAAG,KACC,kBAACE,GAAD;OACE,SAAQ;OACR,MAAK;OACL,YAAA;OACA,WAAU;OACV,cAAW;OACX,WAAU;OACV,SAASC;MACV,CAAA,CAEG;;KACR,kBAAC,OAAD;MAAK,WAAU;MAAkB;KAAc,CAAA;KAC9CC,KAAU,kBAAC,UAAD;MAAQ,WAAU;MAAqC,UAAAA;KAAe,CAAA;IAC9E;;EACF,CAAA;CACQ,CAAA,GACff,CACF;AACF,CAAC"}
@@ -18,15 +18,17 @@
18
18
  max-block-size: calc(100dvh - var(--space-12));
19
19
  display: flex;
20
20
  flex-direction: column;
21
- background: var(--color-surface);
21
+ background: var(--field-bg);
22
22
 
23
23
  /* Set here, not inherited, so a panel carrying a scoped theme matches it. */
24
24
  color: var(--color-text);
25
- border: var(--frame-width) solid var(--frame-color);
25
+ border: 0;
26
26
  border-radius: var(--overlay-radius);
27
27
  box-shadow: var(--shadow-lg);
28
28
  animation: ds-modal-in var(--duration-panel) var(--ease-panel);
29
29
  overflow: hidden;
30
+
31
+ --fill-card: var(--fill-row-alt);
30
32
  }
31
33
 
32
34
  .ds-modal[data-size="dialog"] {
@@ -50,7 +52,6 @@
50
52
  display: flex;
51
53
  gap: var(--space-4);
52
54
  padding: var(--space-5) var(--space-6);
53
- border-block-end: var(--rule-width) solid var(--rule-color);
54
55
  }
55
56
 
56
57
  .ds-modal__head[hidden] {
@@ -92,8 +93,9 @@
92
93
  justify-content: end;
93
94
  gap: var(--space-3);
94
95
  padding: var(--space-4) var(--space-6);
95
- background: var(--color-surface-subtle);
96
- border-block-start: var(--rule-width) solid var(--rule-color);
96
+ background: var(--field-bg);
97
+
98
+ --field-bg: var(--fill-band);
97
99
  }
98
100
 
99
101
  @keyframes ds-scrim-in {
@@ -5,8 +5,8 @@
5
5
  .ds-surface-raised {
6
6
  --field-bg: var(--color-surface-raised);
7
7
 
8
- background: var(--color-surface-raised);
9
- border: var(--control-border-width) solid var(--control-border-color);
8
+ background: var(--field-bg);
9
+ border: 0;
10
10
  border-radius: var(--radius-md);
11
11
  box-shadow: var(--shadow-lg);
12
12
  }
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Field/index.cjs");const e=require("../../chunks/RichTextEditor-DMrxJhA6.cjs");exports.RichTextEditor=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Field/index.cjs");const e=require("../../chunks/RichTextEditor-Wu_yjvD7.cjs");exports.RichTextEditor=e.t;
@@ -1,2 +1,2 @@
1
1
  import "../Field/index.js";
2
- export { t as RichTextEditor } from "../../chunks/RichTextEditor-CwoHE-AN.js";
2
+ export { t as RichTextEditor } from "../../chunks/RichTextEditor-B0P53GFt.js";
@@ -1,3 +1,3 @@
1
1
  import { type NodeViewProps } from "@tiptap/react";
2
- export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, deleteNode, }: NodeViewProps): import("react").JSX.Element;
2
+ export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): import("react").JSX.Element;
3
3
  //# sourceMappingURL=storyblock-view.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storyblock-view.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAyKpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,UAAU,GACX,EAAE,aAAa,+BAwEf"}
1
+ {"version":3,"file":"storyblock-view.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAwTpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+BAyFf"}
@@ -1,3 +1,3 @@
1
1
  import { type NodeViewProps } from "@tiptap/react";
2
- export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, deleteNode, }: NodeViewProps): import("react").JSX.Element;
2
+ export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): import("react").JSX.Element;
3
3
  //# sourceMappingURL=storyblock-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storyblock-view.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAyKpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,UAAU,GACX,EAAE,aAAa,+BAwEf"}
1
+ {"version":3,"file":"storyblock-view.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAwTpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+BAyFf"}
@@ -1,29 +1,24 @@
1
1
  @layer components {
2
- /* The editor is a field: field radius, control stroke, derived fill. The
3
- * toolbar is inside the frame, separated by a hairline rule. */
2
+ /* Writing rests on the card fill; the toolbar is a separate filled band. */
4
3
  .ds-rte {
5
4
  display: flex;
6
5
  flex-direction: column;
7
- border: var(--control-border-width) solid var(--control-border-color);
6
+ border: 0;
8
7
  border-radius: var(--field-radius);
9
8
 
10
- /* The writing surface stays on the light page surface — only the toolbar
11
- * band carries the derived field fill. */
12
- background: var(--color-surface);
9
+ /* Surface on the canvas, the alternate row fill inside Modal and Drawer,
10
+ * so the writing area keeps its shape on any ground. */
11
+ background: var(--fill-card);
13
12
  color: var(--color-text);
14
13
  font-family: var(--font-sans);
15
14
  overflow: hidden;
16
15
  }
17
16
 
18
17
  .ds-rte[data-focused] {
19
- outline: var(--control-border-width) solid var(--color-focus);
18
+ outline: var(--focus-width) solid var(--color-focus);
20
19
  outline-offset: 2px;
21
20
  }
22
21
 
23
- .ds-rte[aria-invalid="true"] {
24
- border-color: var(--color-danger);
25
- }
26
-
27
22
  .ds-rte[data-disabled] {
28
23
  opacity: 0.45;
29
24
  cursor: not-allowed;
@@ -35,8 +30,9 @@
35
30
  align-items: center;
36
31
  gap: var(--space-2);
37
32
  padding: var(--space-2);
38
- background: var(--field-rest);
39
- border-block-end: var(--rule-width) solid var(--rule-color);
33
+ background: var(--field-bg);
34
+
35
+ --field-bg: color-mix(in srgb, var(--color-text) var(--tint-rest), var(--fill-card));
40
36
  }
41
37
 
42
38
  .ds-rte__expand {
@@ -65,15 +61,16 @@
65
61
  }
66
62
 
67
63
  .ds-rte__surface[data-invalid] .ds-rte__toolbar {
68
- background: var(--field-invalid);
64
+ background: var(--field-bg);
65
+
66
+ --field-bg: color-mix(in srgb, var(--color-danger) 12%, var(--fill-card));
69
67
  }
70
68
 
71
69
  /* While expanded, the inline frame keeps its height and marks the editor's place. */
72
70
  .ds-rte[data-expanded] {
73
71
  align-items: center;
74
72
  justify-content: center;
75
- border-style: dashed;
76
- border-color: var(--rule-color);
73
+ background: var(--fill-band);
77
74
  }
78
75
 
79
76
  .ds-rte__placeholder {
@@ -147,7 +144,6 @@
147
144
 
148
145
  .ds-rte__content blockquote {
149
146
  padding-inline-start: var(--space-3);
150
- border-inline-start: var(--rail-width) solid var(--color-border-strong);
151
147
  color: var(--color-text-muted);
152
148
  }
153
149
 
@@ -165,6 +161,21 @@
165
161
  overflow-x: auto;
166
162
  }
167
163
 
164
+ /* A rule is content the writer typed, not a decorative separator, so it
165
+ * paints a visible bar. Padding widens the target for node selection. */
166
+ .ds-rte__content hr {
167
+ box-sizing: content-box;
168
+ block-size: 2px;
169
+ padding-block: var(--space-2);
170
+ margin-block: var(--space-2);
171
+ background: var(--fill-control-pressed) content-box;
172
+ }
173
+
174
+ .ds-rte__content hr.ProseMirror-selectednode {
175
+ outline: var(--focus-width) solid var(--color-focus);
176
+ outline-offset: 2px;
177
+ }
178
+
168
179
  .ds-rte__content a {
169
180
  color: var(--color-primary-text);
170
181
  text-decoration: underline;
@@ -183,10 +194,9 @@
183
194
  * motion. The surface fills its body, and only the content scrolls. */
184
195
  .ds-modal.ds-rte__modal {
185
196
  block-size: 100%;
186
- }
187
197
 
188
- .ds-modal.ds-rte__modal[data-invalid] {
189
- border-color: var(--color-danger);
198
+ /* The Modal body is the writing surface here, so blocks step from it. */
199
+ --fill-card: var(--color-surface);
190
200
  }
191
201
 
192
202
  .ds-rte__modal .ds-modal__body {
@@ -201,11 +211,13 @@
201
211
  .ds-rte__modal .ds-rte__toolbar {
202
212
  flex-shrink: 0;
203
213
  padding: var(--space-3) var(--space-6);
204
- background: color-mix(in srgb, var(--color-text) var(--tint-rest), var(--color-surface));
214
+ background: var(--field-bg);
205
215
  }
206
216
 
207
217
  .ds-rte__modal .ds-rte__surface[data-invalid] .ds-rte__toolbar {
208
- background: var(--field-invalid);
218
+ background: var(--field-bg);
219
+
220
+ --field-bg: color-mix(in srgb, var(--color-danger) 12%, var(--fill-card));
209
221
  }
210
222
 
211
223
  .ds-rte__modal .ds-rte__content {
@@ -223,15 +235,21 @@
223
235
  display: flow-root;
224
236
  }
225
237
 
238
+ .ds-rte__content .tiptap:has(.ds-storyblock) > p {
239
+ text-wrap: pretty;
240
+ }
241
+
226
242
  .ds-storyblock {
243
+ --storyblock-bar-bg: var(--color-surface-subtle);
244
+
227
245
  display: flex;
228
- align-items: center;
229
- gap: var(--space-3);
230
- padding: var(--space-3);
246
+ flex-direction: column;
247
+ container: storyblock / inline-size;
248
+ overflow: hidden;
231
249
  margin-block-end: var(--space-3);
232
- border: var(--control-border-width) solid var(--color-text);
250
+ border: 0;
233
251
  border-radius: var(--radius-md);
234
- background: var(--color-surface);
252
+ background: color-mix(in srgb, var(--color-text) 4%, var(--fill-card));
235
253
  font-size: var(--font-size-sm);
236
254
  line-height: 1.3;
237
255
  }
@@ -241,69 +259,123 @@
241
259
  width: 100%;
242
260
  }
243
261
 
244
- /* Half the writing width, or all of it when that width is under 32rem and
245
- * leaves no room for text beside the block. Percentages read the writing
246
- * surface itself, so no container query or containment is needed. */
262
+ /* Leave room for text beside the block, or use the full writing width below 32rem. */
247
263
  .ds-storyblock[data-align="left"],
248
264
  .ds-storyblock[data-align="right"] {
249
- --storyblock-gutter: clamp(0px, (100% - 32rem) * 999, 16px);
265
+ --storyblock-gutter: clamp(0px, (100% - 32rem) * 999, var(--space-4));
250
266
 
251
- width: clamp(50%, (32rem - 100%) * 999, 100%);
267
+ width: clamp(62%, (32rem - 100%) * 999, 100%);
252
268
  }
253
269
 
254
270
  .ds-storyblock[data-align="left"] {
255
271
  float: left;
256
- margin: 4px var(--storyblock-gutter) 12px 0;
272
+ margin: var(--space-1) var(--storyblock-gutter) var(--space-3) 0;
257
273
  }
258
274
 
259
275
  .ds-storyblock[data-align="right"] {
260
276
  float: right;
261
- margin: 4px 0 12px var(--storyblock-gutter);
277
+ margin: var(--space-1) 0 var(--space-3) var(--storyblock-gutter);
278
+ }
279
+
280
+ .ds-storyblock[data-tone="draft"] {
281
+ --storyblock-bar-bg: var(--color-warning-soft);
262
282
  }
263
283
 
264
284
  .ds-storyblock[data-selected] {
265
- border-color: var(--color-primary);
266
- background: var(--color-primary-soft);
267
- outline: var(--control-border-width) solid var(--color-focus);
285
+ --storyblock-bar-bg: var(--color-primary-soft);
286
+
287
+ outline: var(--focus-width) solid var(--color-focus);
268
288
  outline-offset: 2px;
269
289
  }
270
290
 
271
291
  .ds-storyblock[data-missing] {
272
- border-color: var(--color-danger);
273
- border-style: dashed;
274
- background: var(--color-danger-soft);
292
+ --storyblock-bar-bg: var(--color-danger-soft);
293
+
294
+ background: color-mix(in srgb, var(--color-danger) 9%, var(--fill-card));
275
295
  }
276
296
 
277
- .ds-storyblock__grip {
297
+ .ds-storyblock[data-missing] .ds-storyblock__kind-label {
298
+ --badge-ink: var(--color-text-on-solid);
299
+ --badge-soft: var(--color-danger);
300
+ --badge-soft-marker: var(--color-text-on-solid);
301
+ }
302
+
303
+ .ds-storyblock__bar {
304
+ display: grid;
305
+ grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
306
+ align-items: center;
307
+ gap: var(--space-2);
308
+ min-block-size: var(--space-12);
309
+ padding: calc(var(--space-3) / 2) var(--space-2);
310
+ background: var(--field-bg);
311
+
312
+ --field-bg: var(--storyblock-bar-bg);
313
+ }
314
+
315
+ .ds-storyblock__kind,
316
+ .ds-storyblock__actions {
317
+ display: flex;
318
+ align-items: center;
319
+ }
320
+
321
+ /* The drag handle fills its column and the bar's height. It holds no buttons. */
322
+ .ds-storyblock__kind {
323
+ align-self: stretch;
324
+ gap: var(--space-2);
278
325
  color: var(--color-text-muted);
326
+ }
327
+
328
+ .ds-storyblock__kind[data-drag-handle] {
279
329
  cursor: grab;
280
330
  }
281
331
 
282
- .ds-storyblock__missing {
332
+ .ds-storyblock__kind-label {
333
+ width: fit-content;
334
+
335
+ --badge-soft: color-mix(in srgb, var(--color-text) 8%, var(--field-bg));
336
+ }
337
+
338
+ .ds-storyblock__grip {
283
339
  display: flex;
284
- flex-direction: column;
285
- gap: var(--space-1);
286
- min-width: 0;
287
- overflow-wrap: anywhere;
288
340
  }
289
341
 
290
342
  .ds-storyblock__actions {
291
- padding: var(--space-1);
343
+ justify-self: end;
344
+ gap: calc(var(--space-1) / 2);
292
345
  }
293
346
 
294
- .ds-storyblock__actions > div {
295
- display: flex;
296
- gap: var(--space-1);
297
- align-items: center;
347
+ .ds-storyblock__body {
348
+ padding: var(--space-3);
349
+ }
350
+
351
+ .ds-storyblock__body .ds-entry__meta code {
352
+ font-size: var(--font-size-xs);
353
+ }
354
+
355
+ .ds-storyblock__failure {
356
+ padding: 0 var(--space-3) var(--space-3);
357
+ }
358
+
359
+ /* Wrap the right-hand actions in a narrow block, without containing the editor. */
360
+ @container storyblock (width < 22.5rem) {
361
+ .ds-storyblock__bar {
362
+ grid-template-columns: 1fr auto;
363
+ }
364
+
365
+ .ds-storyblock__actions {
366
+ grid-column: 1 / -1;
367
+ }
298
368
  }
299
369
  }
300
370
 
301
371
  @layer components {
302
- .ds-storyblock .ds-entry__title .ds-badge {
303
- margin-inline-end: var(--space-1);
372
+ .ds-storyblock[data-selected] .ds-storyblock__kind-label {
373
+ --badge-soft: var(--color-surface);
374
+ --badge-ink: var(--color-primary-text);
304
375
  }
305
376
 
306
- .ds-storyblock__grip {
307
- flex-shrink: 0;
377
+ .ds-storyblock[data-missing][data-selected] .ds-storyblock__kind-label {
378
+ --badge-soft: var(--color-danger);
379
+ --badge-ink: var(--color-text-on-solid);
308
380
  }
309
381
  }
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-nulIa2_8.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i({kind:e,title:t,description:n,children:i,className:a,inputProps:o,inputRef:s}){return(0,r.jsxs)(`label`,{className:[`ds-selection-card`,a].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:s,type:e,"data-kind":e,className:`ds-selection-card__control`,...o}),(0,r.jsxs)(`span`,{className:`ds-selection-card__text`,children:[(0,r.jsx)(`span`,{className:`ds-selection-card__title`,children:t}),n&&(0,r.jsx)(`span`,{className:`ds-selection-card__description`,children:n}),i&&(0,r.jsx)(`span`,{className:`ds-selection-card__extra`,children:i})]})]})}var a=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`checkbox`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})}),o=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`radio`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})});function s({label:n,columns:i=2,gap:a=`md`,children:o,className:s,...c}){return(0,r.jsx)(e.t,{...c,label:n,className:[`ds-selection-card-group`,s].filter(Boolean).join(` `),children:(0,r.jsx)(t.Grid,{columns:i,gap:a,className:`ds-selection-card-group__grid ds-field-group-grid`,style:{"--field-group-columns":i},children:o})})}exports.CheckboxCard=a,exports.RadioCard=o,exports.SelectionCardGroup=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-nulIa2_8.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i({kind:e,title:t,description:n,children:i,className:a,inputProps:o,inputRef:s}){return(0,r.jsxs)(`label`,{className:[`ds-selection-card`,`ds-field-surface`,a].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:s,type:e,"data-kind":e,className:`ds-selection-card__control`,...o}),(0,r.jsxs)(`span`,{className:`ds-selection-card__text`,children:[(0,r.jsx)(`span`,{className:`ds-selection-card__title`,children:t}),n&&(0,r.jsx)(`span`,{className:`ds-selection-card__description`,children:n}),i&&(0,r.jsx)(`span`,{className:`ds-selection-card__extra`,children:i})]})]})}var a=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`checkbox`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})}),o=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`radio`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})});function s({label:n,columns:i=2,gap:a=`md`,children:o,className:s,...c}){return(0,r.jsx)(e.t,{...c,label:n,className:[`ds-selection-card-group`,s].filter(Boolean).join(` `),children:(0,r.jsx)(t.Grid,{columns:i,gap:a,className:`ds-selection-card-group__grid ds-field-group-grid`,style:{"--field-group-columns":i},children:o})})}exports.CheckboxCard=a,exports.RadioCard=o,exports.SelectionCardGroup=s;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","FieldGroup","Grid","require_group","require_components_Grid_index","react","react_jsx_runtime","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","rest","ref","RadioCard","SelectionCardGroup","fieldProps","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mapp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P,UAAW,CAAC,0BAA2BZ,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAE1E,UAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,KAAD,CACW,UACJ,MACL,UAAU,oDACV,MAAO,CAAE,wBAAyBmB,CAAQ,EAEzC,UACG,CAAA,CACI,CAAA,CAEhB,C"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","FieldGroup","Grid","require_group","require_components_Grid_index","react","react_jsx_runtime","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","rest","ref","RadioCard","SelectionCardGroup","fieldProps","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label\n className={[\"ds-selection-card\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":"A,2MAmBA,SAASO,EAAS,CAChB,OACA,QACA,cACA,WACA,YACA,aACA,YAMC,CACD,OACE,EAAAD,EAAA,KAAA,CAAC,QAAD,CACE,UAAW,CAAC,oBAAqB,mBAAoBE,CAAS,C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GAAG,UAAU,EACd,EAAE,uBAAuB,+BAiBzB"}
@@ -5,7 +5,11 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  //#region src/components/SelectionCard/index.tsx
6
6
  function a({ kind: e, title: t, description: n, children: a, className: o, inputProps: s, inputRef: c }) {
7
7
  return /* @__PURE__ */ i("label", {
8
- className: ["ds-selection-card", o].filter(Boolean).join(" "),
8
+ className: [
9
+ "ds-selection-card",
10
+ "ds-field-surface",
11
+ o
12
+ ].filter(Boolean).join(" "),
9
13
  children: [/* @__PURE__ */ r("input", {
10
14
  ref: c,
11
15
  type: e,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FieldGroup","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","fieldProps","Grid","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;AAmBA,SAASC,EAAS,EAChB,SACA,UACA,gBACA,aACA,cACA,eACA,eAMC;CACD,OACE,kBAAC,SAAD;EAAO,WAAW,CAAC,qBAAqBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAA3E,UAAA,CACE,kBAAC,SAAD;GACE,KAAKC;GACL,MAAMC;GACN,aAAWA;GACX,WAAU;GACV,GAAIC;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACE,kBAAC,QAAD;KAAM,WAAU;KAA4B,UAAAC;IAAY,CAAA;IACvDC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkC,UAAAA;IAAkB,CAAA;IACnFC,KAAY,kBAAC,QAAD;KAAM,WAAU;KAA4B;IAAe,CAAA;GACpE;EACD,CAAA,CAAA;;AAEX;AAQA,IAAaC,IAAeC,EAAgD,SAC1E,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC,GAKYC,IAAYH,EAA6C,SACpE,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC;AAaD,SAAgBE,EAAmB,EACjC,UACA,aAAU,GACV,SAAM,MACN,aACA,cACA,GAAGC,KACuB;CAC1B,OACE,kBAACf,GAAD;EACE,GAAIe;EACG;EACP,WAAW,CAAC,2BAA2Bb,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE1E,UAAA,kBAACc,GAAD;GACW;GACJ;GACL,WAAU;GACV,OAAO,EAAE,yBAAyBC,EAAQ;GAEzC;EACG,CAAA;CACI,CAAA;AAEhB"}
1
+ {"version":3,"file":"index.js","names":["FieldGroup","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","fieldProps","Grid","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label\n className={[\"ds-selection-card\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;AAmBA,SAASC,EAAS,EAChB,SACA,UACA,gBACA,aACA,cACA,eACA,eAMC;CACD,OACE,kBAAC,SAAD;EACE,WAAW;GAAC;GAAqB;GAAoBC;EAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAD1F,UAAA,CAGE,kBAAC,SAAD;GACE,KAAKC;GACL,MAAMC;GACN,aAAWA;GACX,WAAU;GACV,GAAIC;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACE,kBAAC,QAAD;KAAM,WAAU;KAA4B,UAAAC;IAAY,CAAA;IACvDC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkC,UAAAA;IAAkB,CAAA;IACnFC,KAAY,kBAAC,QAAD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