@namroodinc/liquid-editorial 0.14.0 → 0.15.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 (198) hide show
  1. package/README.md +1 -1
  2. package/UPGRADING.md +47 -0
  3. package/dist/chunks/{Avatar-Dw7EWd_-.cjs → Avatar-BZGFSE6C.cjs} +2 -2
  4. package/dist/chunks/{Avatar-Dw7EWd_-.cjs.map → Avatar-BZGFSE6C.cjs.map} +1 -1
  5. package/dist/chunks/{Avatar-BToMaTdL.js → Avatar-C4W-g8nU.js} +2 -2
  6. package/dist/chunks/{Avatar-BToMaTdL.js.map → Avatar-C4W-g8nU.js.map} +1 -1
  7. package/dist/chunks/{Board-XeDG9nWP.js → Board-Cbi5FMW-.js} +2 -2
  8. package/dist/chunks/{Board-XeDG9nWP.js.map → Board-Cbi5FMW-.js.map} +1 -1
  9. package/dist/chunks/{Board-DeXtaWNO.cjs → Board-_agEjTy8.cjs} +2 -2
  10. package/dist/chunks/{Board-DeXtaWNO.cjs.map → Board-_agEjTy8.cjs.map} +1 -1
  11. package/dist/chunks/{CollectionView-Dbg4d_tA.cjs → CollectionView-BfX2Lxre.cjs} +2 -2
  12. package/dist/chunks/{CollectionView-Dbg4d_tA.cjs.map → CollectionView-BfX2Lxre.cjs.map} +1 -1
  13. package/dist/chunks/{CollectionView-C0_bTO2v.js → CollectionView-DPJGtSP5.js} +2 -2
  14. package/dist/chunks/{CollectionView-C0_bTO2v.js.map → CollectionView-DPJGtSP5.js.map} +1 -1
  15. package/dist/chunks/{ColourField-DAFzOIOq.cjs → ColourField-BVGnW8Wh.cjs} +2 -2
  16. package/dist/chunks/{ColourField-DAFzOIOq.cjs.map → ColourField-BVGnW8Wh.cjs.map} +1 -1
  17. package/dist/chunks/{ColourField-Bb8H87fg.js → ColourField-BcuARZY4.js} +6 -6
  18. package/dist/chunks/{ColourField-Bb8H87fg.js.map → ColourField-BcuARZY4.js.map} +1 -1
  19. package/dist/chunks/{DatePicker-COm1giw8.js → DatePicker-VQUsbYdo.js} +3 -3
  20. package/dist/chunks/{DatePicker-COm1giw8.js.map → DatePicker-VQUsbYdo.js.map} +1 -1
  21. package/dist/chunks/{DatePicker-DOg3iQYy.cjs → DatePicker-zA0bWVBp.cjs} +2 -2
  22. package/dist/chunks/{DatePicker-DOg3iQYy.cjs.map → DatePicker-zA0bWVBp.cjs.map} +1 -1
  23. package/dist/chunks/{Drawer-nUTJtwX_.js → Drawer-2cf0SaG4.js} +3 -3
  24. package/dist/chunks/{Drawer-nUTJtwX_.js.map → Drawer-2cf0SaG4.js.map} +1 -1
  25. package/dist/chunks/{Drawer-B2dcTh5l.cjs → Drawer-BzvSfkCL.cjs} +2 -2
  26. package/dist/chunks/{Drawer-B2dcTh5l.cjs.map → Drawer-BzvSfkCL.cjs.map} +1 -1
  27. package/dist/chunks/{EntryPicker-Ie9T47hA.js → EntryPicker-BGWxiLJ_.js} +7 -7
  28. package/dist/chunks/{EntryPicker-Ie9T47hA.js.map → EntryPicker-BGWxiLJ_.js.map} +1 -1
  29. package/dist/chunks/{EntryPicker-BwEYRtQl.cjs → EntryPicker-wVjzdlAO.cjs} +2 -2
  30. package/dist/chunks/{EntryPicker-BwEYRtQl.cjs.map → EntryPicker-wVjzdlAO.cjs.map} +1 -1
  31. package/dist/chunks/{FormEditor-DgDV5aeR.js → FormEditor-BHVJG23r.js} +2 -2
  32. package/dist/chunks/{FormEditor-DgDV5aeR.js.map → FormEditor-BHVJG23r.js.map} +1 -1
  33. package/dist/chunks/{FormEditor-D1HUnjMI.cjs → FormEditor-DjUz7qQo.cjs} +2 -2
  34. package/dist/chunks/{FormEditor-D1HUnjMI.cjs.map → FormEditor-DjUz7qQo.cjs.map} +1 -1
  35. package/dist/chunks/Icon-QLZH31JA.cjs +2 -0
  36. package/dist/chunks/Icon-QLZH31JA.cjs.map +1 -0
  37. package/dist/chunks/Icon-kLLQC54Z.js +107 -0
  38. package/dist/chunks/Icon-kLLQC54Z.js.map +1 -0
  39. package/dist/chunks/{Message-VJTPhId7.js → Message-DM6pTq7N.js} +2 -2
  40. package/dist/chunks/{Message-VJTPhId7.js.map → Message-DM6pTq7N.js.map} +1 -1
  41. package/dist/chunks/{Message-B0A5bz8V.cjs → Message-yZJDVzb8.cjs} +2 -2
  42. package/dist/chunks/{Message-B0A5bz8V.cjs.map → Message-yZJDVzb8.cjs.map} +1 -1
  43. package/dist/chunks/RichTextEditor-BgfeOrEe.cjs +2 -0
  44. package/dist/chunks/RichTextEditor-BgfeOrEe.cjs.map +1 -0
  45. package/dist/chunks/RichTextEditor-CS2ED0HP.js +2702 -0
  46. package/dist/chunks/RichTextEditor-CS2ED0HP.js.map +1 -0
  47. package/dist/chunks/dialogLabel-Dx-WEEzI.cjs +2 -0
  48. package/dist/chunks/dialogLabel-Dx-WEEzI.cjs.map +1 -0
  49. package/dist/chunks/dialogLabel-nB1gwKz0.js +157 -0
  50. package/dist/chunks/dialogLabel-nB1gwKz0.js.map +1 -0
  51. package/dist/chunks/overlayLayer-CPd3zj_u.cjs +2 -0
  52. package/dist/chunks/overlayLayer-CPd3zj_u.cjs.map +1 -0
  53. package/dist/chunks/overlayLayer-Dv1vmfaI.js +199 -0
  54. package/dist/chunks/overlayLayer-Dv1vmfaI.js.map +1 -0
  55. package/dist/chunks/{useTooltip-Du8PutGX.js → useTooltip-COyAcujL.js} +2 -2
  56. package/dist/chunks/{useTooltip-Du8PutGX.js.map → useTooltip-COyAcujL.js.map} +1 -1
  57. package/dist/chunks/{useTooltip-ekdwMJFz.cjs → useTooltip-nEDN0ObI.cjs} +2 -2
  58. package/dist/chunks/{useTooltip-ekdwMJFz.cjs.map → useTooltip-nEDN0ObI.cjs.map} +1 -1
  59. package/dist/components/AppShell/index.cjs +1 -1
  60. package/dist/components/AppShell/index.js +1 -1
  61. package/dist/components/AssetCard/index.cjs +1 -1
  62. package/dist/components/AssetCard/index.js +1 -1
  63. package/dist/components/AssetGrid/index.cjs +1 -1
  64. package/dist/components/AssetGrid/index.js +1 -1
  65. package/dist/components/Avatar/index.cjs +1 -1
  66. package/dist/components/Avatar/index.js +1 -1
  67. package/dist/components/Banner/index.cjs +1 -1
  68. package/dist/components/Banner/index.js +1 -1
  69. package/dist/components/Board/index.cjs +1 -1
  70. package/dist/components/Board/index.js +1 -1
  71. package/dist/components/Button/index.cjs +1 -1
  72. package/dist/components/Button/index.js +1 -1
  73. package/dist/components/CollectionView/index.cjs +1 -1
  74. package/dist/components/CollectionView/index.js +1 -1
  75. package/dist/components/ColourField/index.cjs +1 -1
  76. package/dist/components/ColourField/index.js +1 -1
  77. package/dist/components/DatePicker/index.cjs +1 -1
  78. package/dist/components/DatePicker/index.js +1 -1
  79. package/dist/components/Drawer/index.cjs +1 -1
  80. package/dist/components/Drawer/index.js +1 -1
  81. package/dist/components/EditLayout/index.cjs +1 -1
  82. package/dist/components/EditLayout/index.cjs.map +1 -1
  83. package/dist/components/EditLayout/index.js +6 -7
  84. package/dist/components/EditLayout/index.js.map +1 -1
  85. package/dist/components/EntryPicker/index.cjs +1 -1
  86. package/dist/components/EntryPicker/index.js +1 -1
  87. package/dist/components/EntryPicker/style.css +1 -1
  88. package/dist/components/FormEditor/README.md +72 -34
  89. package/dist/components/FormEditor/index.cjs +1 -1
  90. package/dist/components/FormEditor/index.js +2 -2
  91. package/dist/components/Icon/icons.d.cts +5 -0
  92. package/dist/components/Icon/icons.d.cts.map +1 -1
  93. package/dist/components/Icon/icons.d.ts +5 -0
  94. package/dist/components/Icon/icons.d.ts.map +1 -1
  95. package/dist/components/Icon/index.cjs +1 -1
  96. package/dist/components/Icon/index.js +1 -1
  97. package/dist/components/Menu/index.cjs +1 -1
  98. package/dist/components/Menu/index.js +9 -9
  99. package/dist/components/Menu/index.js.map +1 -1
  100. package/dist/components/Modal/index.cjs +1 -1
  101. package/dist/components/Modal/index.js +2 -2
  102. package/dist/components/Popover/index.cjs +1 -1
  103. package/dist/components/Popover/index.cjs.map +1 -1
  104. package/dist/components/Popover/index.d.cts.map +1 -1
  105. package/dist/components/Popover/index.d.ts.map +1 -1
  106. package/dist/components/Popover/index.js +67 -64
  107. package/dist/components/Popover/index.js.map +1 -1
  108. package/dist/components/RichTextEditor/content-block-frame.d.cts +32 -0
  109. package/dist/components/RichTextEditor/content-block-frame.d.cts.map +1 -0
  110. package/dist/components/RichTextEditor/content-block-frame.d.ts +32 -0
  111. package/dist/components/RichTextEditor/content-block-frame.d.ts.map +1 -0
  112. package/dist/components/RichTextEditor/content-block-view.d.cts +3 -0
  113. package/dist/components/RichTextEditor/content-block-view.d.cts.map +1 -0
  114. package/dist/components/RichTextEditor/content-block-view.d.ts +3 -0
  115. package/dist/components/RichTextEditor/content-block-view.d.ts.map +1 -0
  116. package/dist/components/RichTextEditor/content-block.d.cts +24 -0
  117. package/dist/components/RichTextEditor/content-block.d.cts.map +1 -0
  118. package/dist/components/RichTextEditor/content-block.d.ts +24 -0
  119. package/dist/components/RichTextEditor/content-block.d.ts.map +1 -0
  120. package/dist/components/RichTextEditor/document.d.cts +10 -7
  121. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  122. package/dist/components/RichTextEditor/document.d.ts +10 -7
  123. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  124. package/dist/components/RichTextEditor/index.cjs +1 -1
  125. package/dist/components/RichTextEditor/index.d.cts +1 -1
  126. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  127. package/dist/components/RichTextEditor/index.d.ts +1 -1
  128. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  129. package/dist/components/RichTextEditor/index.js +1 -1
  130. package/dist/components/RichTextEditor/style.css +126 -49
  131. package/dist/components/RichTextEditor/table-actions.d.cts +11 -0
  132. package/dist/components/RichTextEditor/table-actions.d.cts.map +1 -0
  133. package/dist/components/RichTextEditor/table-actions.d.ts +11 -0
  134. package/dist/components/RichTextEditor/table-actions.d.ts.map +1 -0
  135. package/dist/components/RichTextEditor/table-bands.d.cts +19 -0
  136. package/dist/components/RichTextEditor/table-bands.d.cts.map +1 -0
  137. package/dist/components/RichTextEditor/table-bands.d.ts +19 -0
  138. package/dist/components/RichTextEditor/table-bands.d.ts.map +1 -0
  139. package/dist/components/RichTextEditor/table-view.d.cts +4 -0
  140. package/dist/components/RichTextEditor/table-view.d.cts.map +1 -0
  141. package/dist/components/RichTextEditor/table-view.d.ts +4 -0
  142. package/dist/components/RichTextEditor/table-view.d.ts.map +1 -0
  143. package/dist/components/RichTextEditor/tables.d.cts.map +1 -1
  144. package/dist/components/RichTextEditor/tables.d.ts.map +1 -1
  145. package/dist/components/RichTextEditor/use-embeds.d.cts.map +1 -1
  146. package/dist/components/RichTextEditor/use-embeds.d.ts.map +1 -1
  147. package/dist/components/SearchField/index.cjs +1 -1
  148. package/dist/components/SearchField/index.js +1 -1
  149. package/dist/components/Select/index.cjs +1 -1
  150. package/dist/components/Select/index.js +2 -2
  151. package/dist/components/SideNav/index.cjs +1 -1
  152. package/dist/components/SideNav/index.js +1 -1
  153. package/dist/components/SortableList/index.cjs +1 -1
  154. package/dist/components/SortableList/index.js +1 -1
  155. package/dist/components/Stepper/index.cjs +1 -1
  156. package/dist/components/Stepper/index.js +1 -1
  157. package/dist/components/SubNav/index.cjs +1 -1
  158. package/dist/components/SubNav/index.js +1 -1
  159. package/dist/components/Switch/style.css +2 -6
  160. package/dist/components/Table/index.cjs +1 -1
  161. package/dist/components/Table/index.js +1 -1
  162. package/dist/components/Time/index.cjs +1 -1
  163. package/dist/components/Time/index.js +1 -1
  164. package/dist/components/Toast/index.cjs +1 -1
  165. package/dist/components/Toast/index.js +1 -1
  166. package/dist/components/TopNav/index.cjs +1 -1
  167. package/dist/components/TopNav/index.js +1 -1
  168. package/dist/index.cjs +1 -1
  169. package/dist/index.d.cts +1 -1
  170. package/dist/index.d.cts.map +1 -1
  171. package/dist/index.d.ts +1 -1
  172. package/dist/index.d.ts.map +1 -1
  173. package/dist/index.js +17 -17
  174. package/package.json +1 -1
  175. package/dist/chunks/Icon-Bxvp1-td.js +0 -102
  176. package/dist/chunks/Icon-Bxvp1-td.js.map +0 -1
  177. package/dist/chunks/Icon-CnnTrtNb.cjs +0 -2
  178. package/dist/chunks/Icon-CnnTrtNb.cjs.map +0 -1
  179. package/dist/chunks/RichTextEditor-DPhEkDxi.js +0 -2108
  180. package/dist/chunks/RichTextEditor-DPhEkDxi.js.map +0 -1
  181. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs +0 -2
  182. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs.map +0 -1
  183. package/dist/chunks/dialogLabel-C153NosD.js +0 -176
  184. package/dist/chunks/dialogLabel-C153NosD.js.map +0 -1
  185. package/dist/chunks/dialogLabel-CNNQbtob.cjs +0 -2
  186. package/dist/chunks/dialogLabel-CNNQbtob.cjs.map +0 -1
  187. package/dist/chunks/overlayLayer-CtOTt1xB.cjs +0 -2
  188. package/dist/chunks/overlayLayer-CtOTt1xB.cjs.map +0 -1
  189. package/dist/chunks/overlayLayer-Og07sIyl.js +0 -180
  190. package/dist/chunks/overlayLayer-Og07sIyl.js.map +0 -1
  191. package/dist/components/RichTextEditor/storyblock-view.d.cts +0 -3
  192. package/dist/components/RichTextEditor/storyblock-view.d.cts.map +0 -1
  193. package/dist/components/RichTextEditor/storyblock-view.d.ts +0 -3
  194. package/dist/components/RichTextEditor/storyblock-view.d.ts.map +0 -1
  195. package/dist/components/RichTextEditor/storyblock.d.cts +0 -19
  196. package/dist/components/RichTextEditor/storyblock.d.cts.map +0 -1
  197. package/dist/components/RichTextEditor/storyblock.d.ts +0 -19
  198. package/dist/components/RichTextEditor/storyblock.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer-nUTJtwX_.js","names":["_Fragment","mergeRefs","useInheritedPortalScope","useDialogPresence","DialogContent","useModalDialog","useDialogPortal","dialogAttributes","Fragment$1","DrawerHead","hasHeader","titleId","title","description","descriptionId","Button","closeRef","variant","closeLabel","onClose","drawerInteraction","active","isActive","isVisible","isInert","isOpen","canPress","onInactivePress","ariaHidden","DrawerContent","head","node","footer","inactivePressLabel","event","useDrawerExit","previousOpen","setPreviousOpen","useState","exiting","setExiting","useEffect","duration","transitionDurationMs","scrimRef","timeout","Drawer","forwardRef","rest","isHidden","overlayLayer","panelRef","useRef","useId","onTransitionEnd","portalContainer","portal","order","createPortal","frameInert","hasScrim","isResumed","layer","side","onScrimMouseDown","ref","panelAttributes","size","className"],"sources":["../../src/components/Drawer/head.tsx","../../src/components/Drawer/content.tsx","../../src/components/Drawer/index.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { Button } from \"../Button\";\nimport type { DrawerProps } from \".\";\ntype HeadProps = Pick<\n DrawerProps,\n \"title\" | \"description\" | \"onClose\" | \"hasHeader\" | \"variant\" | \"closeLabel\"\n> & { titleId: string; descriptionId: string; closeRef: RefObject<HTMLButtonElement | null> };\nexport function DrawerHead({\n title,\n description,\n onClose,\n hasHeader,\n variant,\n closeLabel,\n titleId,\n descriptionId,\n closeRef,\n}: HeadProps) {\n return (\n <header\n className=\"ds-drawer__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-drawer__titles\">\n <h2\n id={titleId}\n className=\"ds-drawer__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-drawer__description\"\n >\n {description}\n </p>\n )}\n </div>\n <Button\n ref={closeRef}\n variant=\"simple\"\n size={variant === \"navigation\" ? \"lg\" : \"sm\"}\n isIconOnly\n iconStart=\"x\"\n className={variant === \"navigation\" ? \"ds-drawer__close\" : undefined}\n aria-label={closeLabel}\n onClick={onClose}\n />\n </header>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { Button } from \"../Button\";\nimport { DrawerHead } from \"./head\";\nimport type { DrawerProps } from \".\";\n\ntype ContentProps = ComponentProps<typeof DrawerHead> &\n Pick<DrawerProps, \"children\" | \"footer\" | \"onInactivePress\" | \"inactivePressLabel\"> & {\n isInert: boolean;\n };\n\n/** Distinguish modal participation from an application's inactive-panel action. */\nexport function drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden,\n}: {\n isOpen: boolean;\n isVisible: boolean;\n isActive: boolean;\n onInactivePress?: () => void;\n ariaHidden?: DrawerProps[\"aria-hidden\"];\n}) {\n const active = isActive && isVisible;\n const isInert = !isOpen || !active;\n const canPress = isOpen && isVisible && !isActive && Boolean(onInactivePress);\n return {\n active,\n isInert,\n canPress,\n frameInert: isInert && !canPress,\n panelAttributes: {\n \"aria-hidden\": canPress ? ariaHidden : isInert || ariaHidden,\n tabIndex: canPress ? undefined : -1,\n },\n };\n}\n\n/** Keep editors mounted inside an inert boundary, with activation outside it. */\nexport function DrawerContent({\n isInert,\n children,\n footer,\n onInactivePress,\n inactivePressLabel,\n ...head\n}: ContentProps) {\n return (\n <>\n <div\n className=\"ds-drawer__content\"\n ref={(node) => {\n if (node) {\n node.inert = isInert;\n node.toggleAttribute(\"inert\", isInert);\n }\n }}\n aria-hidden={isInert || undefined}\n >\n <DrawerHead {...head} />\n <div className=\"ds-drawer__body\">{children}</div>\n {footer && <footer className=\"ds-drawer__footer ds-field-surface\">{footer}</footer>}\n </div>\n {onInactivePress && (\n <Button\n variant=\"simple\"\n className=\"ds-drawer__inactive-press\"\n aria-label={\n inactivePressLabel ??\n (typeof head.title === \"string\" ? `Return to ${head.title}` : \"Activate drawer\")\n }\n tabIndex={-1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={(event) => {\n event.stopPropagation();\n onInactivePress();\n }}\n />\n )}\n </>\n );\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n type TransitionEvent,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { DrawerContent, drawerInteraction } from \"./content\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\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\";\nimport \"./style.css\";\n\nexport type DrawerSide = \"end\" | \"start\" | \"bottom\";\nexport type DrawerSize = \"md\" | \"wide\";\n\nexport interface DrawerProps 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 title: ReactNode;\n description?: string;\n /** Which edge the panel is anchored to. */\n side?: DrawerSide;\n size?: DrawerSize;\n /** Without it the title still names the dialog; give people another way to close it. */\n hasHeader?: boolean;\n /**\n * Only the active panel traps focus and handles Escape. An inactive open\n * panel stays visible and mounted as an inert background panel.\n */\n isActive?: boolean;\n /** Activate an exposed inactive panel. Its editor stays inert; the app decides whether to activate it. */\n onInactivePress?: () => void;\n /** Accessible name for the inactive-panel action; defaults to Return to {title} for string titles. */\n inactivePressLabel?: string;\n /** Without a scrim, presses outside the panel reach the page beneath. */\n hasScrim?: boolean;\n /**\n * z-index for this panel 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 /** Navigation uses a compact panel, header and footer. Both variants slide in and out. */\n variant?: \"default\" | \"navigation\";\n /** Accessible name of the dismiss button. */\n closeLabel?: string;\n /**\n * Defaults to document.body, covering the viewport. A navigation drawer\n * portaled into a positioned element, such as an app shell, stays inside it.\n */\n portalContainer?: HTMLElement | null;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\nfunction useDrawerExit(isOpen: boolean, scrimRef: RefObject<HTMLDivElement | null>) {\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n\n useEffect(() => {\n if (!exiting || isOpen) {\n return;\n }\n // Read the actual transition, including token overrides and reduced motion.\n const duration = transitionDurationMs(scrimRef.current!);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }, [exiting, isOpen, scrimRef]);\n\n const onTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n };\n return [exiting, onTransitionEnd] as const;\n}\n\n/**\n * A side panel for work that belongs beside the page rather than on top of it\n * — editing one record, a filter set, a revision history. Same frame, rules\n * and footer band as `Modal`, with square corners and a full slide through\n * its anchored edge. Focus is trapped while open.\n */\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n side = \"end\",\n size = \"md\",\n hasHeader = true,\n isActive = true,\n onInactivePress,\n inactivePressLabel,\n hasScrim = true,\n overlayLayer,\n variant = \"default\",\n closeLabel = \"Close\",\n portalContainer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const { layer, isVisible, isResumed } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const { active, isInert, canPress, frameInert, panelAttributes } = drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden: rest[\"aria-hidden\"],\n });\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef<HTMLButtonElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const [exiting, onTransitionEnd] = useDrawerExit(isOpen, scrimRef);\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: active,\n layer,\n panelRef,\n onClose,\n // A hidden header's close button can't take focus.\n initialFocus: variant === \"navigation\" && hasHeader ? () => closeRef.current : undefined,\n // Panels start off-screen; focusing them must not scroll the page with them.\n preventScroll: true,\n container: portalContainer,\n });\n const portal = useDialogPortal(order, isOpen || exiting, portalContainer);\n useInheritedPortalScope(scrimRef, isOpen, { keepDir: rest.dir !== undefined });\n\n if ((!isOpen && !exiting) || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={isInert}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n if (node) {\n node.inert = frameInert;\n }\n }}\n className=\"ds-drawer-scrim\"\n hidden={!isVisible}\n data-scrim={hasScrim ? undefined : \"none\"}\n data-inactive-press={canPress || undefined}\n data-resumed={isResumed || undefined}\n style={{ zIndex: layer }}\n dir={rest.dir}\n data-side={side}\n data-variant={variant}\n data-contained={portalContainer ? \"\" : undefined}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={frameInert || undefined}\n onTransitionEnd={onTransitionEnd}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), active)}\n {...panelAttributes}\n data-side={side}\n data-size={size}\n data-header={hasHeader ? undefined : \"none\"}\n data-variant={variant}\n className={[\"ds-drawer\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <DrawerContent\n isInert={isInert}\n title={title}\n description={description}\n onClose={onClose}\n hasHeader={hasHeader}\n variant={variant}\n closeLabel={closeLabel}\n titleId={titleId}\n descriptionId={descriptionId}\n closeRef={closeRef}\n footer={footer}\n onInactivePress={canPress ? onInactivePress : undefined}\n inactivePressLabel={inactivePressLabel}\n >\n {children}\n </DrawerContent>\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":";;;;;;;;;AAOA,SAAgBS,EAAW,EACzB,UACA,gBACA,YACA,cACA,YACA,eACA,YACA,kBACA,eACY;CACZ,OACE,kBAAC,UAAD;EACE,WAAU;EACV,QAAQ,CAACC;EAFX,UAAA,CAIE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,k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CAAA;GACZ,CAAA;EACF,CAAA;CACQ,CAAA,GACf6B,CACF;AACF,CAAC"}
1
+ {"version":3,"file":"Drawer-2cf0SaG4.js","names":["_Fragment","mergeRefs","useInheritedPortalScope","useDialogPresence","DialogContent","useModalDialog","useDialogPortal","dialogAttributes","Fragment$1","DrawerHead","hasHeader","titleId","title","description","descriptionId","Button","closeRef","variant","closeLabel","onClose","drawerInteraction","active","isActive","isVisible","isInert","isOpen","canPress","onInactivePress","ariaHidden","DrawerContent","head","node","footer","inactivePressLabel","event","useDrawerExit","previousOpen","setPreviousOpen","useState","exiting","setExiting","useEffect","duration","transitionDurationMs","scrimRef","timeout","Drawer","forwardRef","rest","isHidden","overlayLayer","panelRef","useRef","useId","onTransitionEnd","portalContainer","portal","order","createPortal","frameInert","hasScrim","isResumed","layer","side","onScrimMouseDown","ref","panelAttributes","size","className"],"sources":["../../src/components/Drawer/head.tsx","../../src/components/Drawer/content.tsx","../../src/components/Drawer/index.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { Button } from \"../Button\";\nimport type { DrawerProps } from \".\";\ntype HeadProps = Pick<\n DrawerProps,\n \"title\" | \"description\" | \"onClose\" | \"hasHeader\" | \"variant\" | \"closeLabel\"\n> & { titleId: string; descriptionId: string; closeRef: RefObject<HTMLButtonElement | null> };\nexport function DrawerHead({\n title,\n description,\n onClose,\n hasHeader,\n variant,\n closeLabel,\n titleId,\n descriptionId,\n closeRef,\n}: HeadProps) {\n return (\n <header\n className=\"ds-drawer__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-drawer__titles\">\n <h2\n id={titleId}\n className=\"ds-drawer__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-drawer__description\"\n >\n {description}\n </p>\n )}\n </div>\n <Button\n ref={closeRef}\n variant=\"simple\"\n size={variant === \"navigation\" ? \"lg\" : \"sm\"}\n isIconOnly\n iconStart=\"x\"\n className={variant === \"navigation\" ? \"ds-drawer__close\" : undefined}\n aria-label={closeLabel}\n onClick={onClose}\n />\n </header>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { Button } from \"../Button\";\nimport { DrawerHead } from \"./head\";\nimport type { DrawerProps } from \".\";\n\ntype ContentProps = ComponentProps<typeof DrawerHead> &\n Pick<DrawerProps, \"children\" | \"footer\" | \"onInactivePress\" | \"inactivePressLabel\"> & {\n isInert: boolean;\n };\n\n/** Distinguish modal participation from an application's inactive-panel action. */\nexport function drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden,\n}: {\n isOpen: boolean;\n isVisible: boolean;\n isActive: boolean;\n onInactivePress?: () => void;\n ariaHidden?: DrawerProps[\"aria-hidden\"];\n}) {\n const active = isActive && isVisible;\n const isInert = !isOpen || !active;\n const canPress = isOpen && isVisible && !isActive && Boolean(onInactivePress);\n return {\n active,\n isInert,\n canPress,\n frameInert: isInert && !canPress,\n panelAttributes: {\n \"aria-hidden\": canPress ? ariaHidden : isInert || ariaHidden,\n tabIndex: canPress ? undefined : -1,\n },\n };\n}\n\n/** Keep editors mounted inside an inert boundary, with activation outside it. */\nexport function DrawerContent({\n isInert,\n children,\n footer,\n onInactivePress,\n inactivePressLabel,\n ...head\n}: ContentProps) {\n return (\n <>\n <div\n className=\"ds-drawer__content\"\n ref={(node) => {\n if (node) {\n node.inert = isInert;\n node.toggleAttribute(\"inert\", isInert);\n }\n }}\n aria-hidden={isInert || undefined}\n >\n <DrawerHead {...head} />\n <div className=\"ds-drawer__body\">{children}</div>\n {footer && <footer className=\"ds-drawer__footer ds-field-surface\">{footer}</footer>}\n </div>\n {onInactivePress && (\n <Button\n variant=\"simple\"\n className=\"ds-drawer__inactive-press\"\n aria-label={\n inactivePressLabel ??\n (typeof head.title === \"string\" ? `Return to ${head.title}` : \"Activate drawer\")\n }\n tabIndex={-1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={(event) => {\n event.stopPropagation();\n onInactivePress();\n }}\n />\n )}\n </>\n );\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n type TransitionEvent,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { DrawerContent, drawerInteraction } from \"./content\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\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\";\nimport \"./style.css\";\n\nexport type DrawerSide = \"end\" | \"start\" | \"bottom\";\nexport type DrawerSize = \"md\" | \"wide\";\n\nexport interface DrawerProps 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 title: ReactNode;\n description?: string;\n /** Which edge the panel is anchored to. */\n side?: DrawerSide;\n size?: DrawerSize;\n /** Without it the title still names the dialog; give people another way to close it. */\n hasHeader?: boolean;\n /**\n * Only the active panel traps focus and handles Escape. An inactive open\n * panel stays visible and mounted as an inert background panel.\n */\n isActive?: boolean;\n /** Activate an exposed inactive panel. Its editor stays inert; the app decides whether to activate it. */\n onInactivePress?: () => void;\n /** Accessible name for the inactive-panel action; defaults to Return to {title} for string titles. */\n inactivePressLabel?: string;\n /** Without a scrim, presses outside the panel reach the page beneath. */\n hasScrim?: boolean;\n /**\n * z-index for this panel 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 /** Navigation uses a compact panel, header and footer. Both variants slide in and out. */\n variant?: \"default\" | \"navigation\";\n /** Accessible name of the dismiss button. */\n closeLabel?: string;\n /**\n * Defaults to document.body, covering the viewport. A navigation drawer\n * portaled into a positioned element, such as an app shell, stays inside it.\n */\n portalContainer?: HTMLElement | null;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\nfunction useDrawerExit(isOpen: boolean, scrimRef: RefObject<HTMLDivElement | null>) {\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n\n useEffect(() => {\n if (!exiting || isOpen) {\n return;\n }\n // Read the actual transition, including token overrides and reduced motion.\n const duration = transitionDurationMs(scrimRef.current!);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }, [exiting, isOpen, scrimRef]);\n\n const onTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n };\n return [exiting, onTransitionEnd] as const;\n}\n\n/**\n * A side panel for work that belongs beside the page rather than on top of it\n * — editing one record, a filter set, a revision history. Same frame, rules\n * and footer band as `Modal`, with square corners and a full slide through\n * its anchored edge. Focus is trapped while open.\n */\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n side = \"end\",\n size = \"md\",\n hasHeader = true,\n isActive = true,\n onInactivePress,\n inactivePressLabel,\n hasScrim = true,\n overlayLayer,\n variant = \"default\",\n closeLabel = \"Close\",\n portalContainer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const { layer, isVisible, isResumed } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const { active, isInert, canPress, frameInert, panelAttributes } = drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden: rest[\"aria-hidden\"],\n });\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef<HTMLButtonElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const [exiting, onTransitionEnd] = useDrawerExit(isOpen, scrimRef);\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: active,\n layer,\n panelRef,\n onClose,\n // A hidden header's close button can't take focus.\n initialFocus: variant === \"navigation\" && hasHeader ? () => closeRef.current : undefined,\n // Panels start off-screen; focusing them must not scroll the page with them.\n preventScroll: true,\n container: portalContainer,\n });\n const portal = useDialogPortal(order, isOpen || exiting, portalContainer);\n useInheritedPortalScope(scrimRef, isOpen, { keepDir: rest.dir !== undefined });\n\n if ((!isOpen && !exiting) || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={isInert}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n if (node) {\n node.inert = frameInert;\n }\n }}\n className=\"ds-drawer-scrim\"\n hidden={!isVisible}\n data-scrim={hasScrim ? undefined : \"none\"}\n data-inactive-press={canPress || undefined}\n data-resumed={isResumed || undefined}\n style={{ zIndex: layer }}\n dir={rest.dir}\n data-side={side}\n data-variant={variant}\n data-contained={portalContainer ? \"\" : undefined}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={frameInert || undefined}\n onTransitionEnd={onTransitionEnd}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), active)}\n {...panelAttributes}\n data-side={side}\n data-size={size}\n data-header={hasHeader ? undefined : \"none\"}\n data-variant={variant}\n className={[\"ds-drawer\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <DrawerContent\n isInert={isInert}\n title={title}\n description={description}\n onClose={onClose}\n hasHeader={hasHeader}\n variant={variant}\n closeLabel={closeLabel}\n titleId={titleId}\n descriptionId={descriptionId}\n closeRef={closeRef}\n footer={footer}\n onInactivePress={canPress ? onInactivePress : undefined}\n inactivePressLabel={inactivePressLabel}\n >\n {children}\n </DrawerContent>\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":";;;;;;;;;AAOA,SAAgBS,EAAW,EACzB,UACA,gBACA,YACA,cACA,YACA,eACA,YACA,kBACA,eACY;CACZ,OACE,kBAAC,UAAD;EACE,WAAU;EACV,QAAQ,CAACC;EAFX,UAAA,CAIE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,MAAD;IACE,IAAIC;IACJ,WAAU;IAET,UAAAC;GACC,CAAA,GACHC,KACC,kBAAC,KAAD;IACE,IAAIC;IACJ,WAAU;IAET,UAAAD;GACA,CAAA,CAEF;EACL,CAAA,GAAA,kBAACE,GAAD;GACE,KAAKC;GACL,SAAQ;GACR,MAAMC,MAAY,eAAe,OAAO;GACxC,YAAA;GACA,WAAU;GACV,WAAWA,MAAY,eAAe,qBAAqB,KAAA;GAC3D,cAAYC;GACZ,SAASC;EACV,CAAA,CACK;;AAEZ;;;ACxCA,SAAgBC,EAAkB,EAChC,WACA,cACA,aACA,oBACA,iBAOC;CACD,IAAMC,IAASC,KAAYC,GACrBC,IAAU,CAACC,KAAU,CAACJ,GACtBK,IAAWD,KAAUF,KAAa,CAACD,KAAY,EAAQK;CAC7D,OAAO;EACL;EACA;EACA;EACA,YAAYH,KAAW,CAACE;EACxB,iBAAiB;GACf,eAAeA,IAAWE,IAAaJ,KAAWI;GAClD,UAAUF,IAAW,KAAA,IAAY;EACnC;CACF;AACF;AAGA,SAAgBG,EAAc,EAC5B,YACA,aACA,WACA,oBACA,uBACA,GAAGC,KACY;CACf,OACE,kBAAA9B,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAM,MAAS;GACb,AAAI+B,MACF,EAAK,QAAQP,GACbO,EAAK,gBAAgB,SAASP,CAAO;EAEzC;EACA,eAAaA,KAAW,KAAA;EAR1B,UAAA;GAUE,kBAACf,GAAD,EAAY,GAAIqB,EAAO,CAAA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aAAWH;IACX,aAAWI;IACX,eAAazD,IAAY,KAAA,IAAY;IACrC,gBAAcO;IACd,WAAW;KAAC;KAAa;KAAoBmD;IAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;IAEhF,UAAA,kBAACvC,GAAD;KACW;KACF;KACM;KACJ;KACE;KACF;KACG;KACH;KACM;KACL;KACF;KACR,iBAAiBH,IAAWC,IAAkB,KAAA;KAC1B;KAEnB;IACY,CAAA;GACZ,CAAA;EACF,CAAA;CACQ,CAAA,GACf6B,CACF;AACF,CAAC"}
@@ -1,2 +1,2 @@
1
- const e=require("../components/Button/index.cjs"),t=require("./transitionDuration-B4UnScFc.cjs"),n=require("./mergeRefs-CZ-SArlE.cjs"),r=require("./overlayLayer-CtOTt1xB.cjs"),i=require("./dialogLabel-CNNQbtob.cjs");let a=require("react"),o=require("react-dom"),s=require("react/jsx-runtime");function c({title:t,description:n,onClose:r,hasHeader:i,variant:a,closeLabel:o,titleId:c,descriptionId:l,closeRef:u}){return(0,s.jsxs)(`header`,{className:`ds-drawer__head`,hidden:!i,children:[(0,s.jsxs)(`div`,{className:`ds-drawer__titles`,children:[(0,s.jsx)(`h2`,{id:c,className:`ds-drawer__title`,children:t}),n&&(0,s.jsx)(`p`,{id:l,className:`ds-drawer__description`,children:n})]}),(0,s.jsx)(e.Button,{ref:u,variant:`simple`,size:a===`navigation`?`lg`:`sm`,isIconOnly:!0,iconStart:`x`,className:a===`navigation`?`ds-drawer__close`:void 0,"aria-label":o,onClick:r})]})}function l({isOpen:e,isVisible:t,isActive:n,onInactivePress:r,ariaHidden:i}){let a=n&&t,o=!e||!a,s=e&&t&&!n&&!!r;return{active:a,isInert:o,canPress:s,frameInert:o&&!s,panelAttributes:{"aria-hidden":s?i:o||i,tabIndex:s?void 0:-1}}}function u({isInert:t,children:n,footer:r,onInactivePress:i,inactivePressLabel:a,...o}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`ds-drawer__content`,ref:e=>{e&&(e.inert=t,e.toggleAttribute(`inert`,t))},"aria-hidden":t||void 0,children:[(0,s.jsx)(c,{...o}),(0,s.jsx)(`div`,{className:`ds-drawer__body`,children:n}),r&&(0,s.jsx)(`footer`,{className:`ds-drawer__footer ds-field-surface`,children:r})]}),i&&(0,s.jsx)(e.Button,{variant:`simple`,className:`ds-drawer__inactive-press`,"aria-label":a??(typeof o.title==`string`?`Return to ${o.title}`:`Activate drawer`),tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),i()}})]})}function d(e,n){let[r,i]=(0,a.useState)(e),[o,s]=(0,a.useState)(!1);return r!==e&&(i(e),s(!e)),(0,a.useEffect)(()=>{if(!o||e)return;let r=t.t(n.current),i=window.setTimeout(()=>s(!1),r);return()=>window.clearTimeout(i)},[o,e,n]),[o,t=>{t.target===t.currentTarget&&t.propertyName===`opacity`&&!e&&s(!1)}]}var f=(0,a.forwardRef)(function({isOpen:e,isHidden:t=!1,onClose:c,title:f,description:p,side:m=`end`,size:h=`md`,hasHeader:g=!0,isActive:_=!0,onInactivePress:v,inactivePressLabel:y,hasScrim:b=!0,overlayLayer:x,variant:S=`default`,closeLabel:C=`Close`,portalContainer:w,footer:T,className:E,children:D,...O},k){let{layer:A,isVisible:j,isResumed:M}=r.r(e,t,x),{active:N,isInert:P,canPress:F,frameInert:I,panelAttributes:L}=l({isOpen:e,isVisible:j,isActive:_,onInactivePress:v,ariaHidden:O[`aria-hidden`]}),R=(0,a.useRef)(null),z=(0,a.useRef)(null),B=(0,a.useRef)(null),V=(0,a.useId)(),H=(0,a.useId)(),[U,W]=d(e,z),{onScrimMouseDown:G,order:K}=i.n({isOpen:e,isActive:N,layer:A,panelRef:R,onClose:c,initialFocus:S===`navigation`&&g?()=>B.current:void 0,preventScroll:!0,container:w}),q=i.r(K,e||U,w);return r.c(z,e,{keepDir:O.dir!==void 0}),!e&&!U||!q?null:(0,o.createPortal)((0,s.jsx)(r.t,{layer:A,isSuspended:P,children:(0,s.jsx)(`div`,{ref:e=>{z.current=e,e&&(e.inert=I)},className:`ds-drawer-scrim`,hidden:!j,"data-scrim":b?void 0:`none`,"data-inactive-press":F||void 0,"data-resumed":M||void 0,style:{zIndex:A},dir:O.dir,"data-side":m,"data-variant":S,"data-contained":w?``:void 0,"data-state":e?`open`:`closed`,"aria-hidden":I||void 0,onTransitionEnd:W,onMouseDown:G,children:(0,s.jsx)(`div`,{...O,ref:n.t(R,k),...i.t(O,V,H,!!p,N),...L,"data-side":m,"data-size":h,"data-header":g?void 0:`none`,"data-variant":S,className:[`ds-drawer`,`ds-field-surface`,E].filter(Boolean).join(` `),children:(0,s.jsx)(u,{isInert:P,title:f,description:p,onClose:c,hasHeader:g,variant:S,closeLabel:C,titleId:V,descriptionId:H,closeRef:B,footer:T,onInactivePress:F?v:void 0,inactivePressLabel:y,children:D})})})}),q)});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
2
- //# sourceMappingURL=Drawer-B2dcTh5l.cjs.map
1
+ const e=require("../components/Button/index.cjs"),t=require("./transitionDuration-B4UnScFc.cjs"),n=require("./mergeRefs-CZ-SArlE.cjs"),r=require("./overlayLayer-CPd3zj_u.cjs"),i=require("./dialogLabel-Dx-WEEzI.cjs");let a=require("react"),o=require("react-dom"),s=require("react/jsx-runtime");function c({title:t,description:n,onClose:r,hasHeader:i,variant:a,closeLabel:o,titleId:c,descriptionId:l,closeRef:u}){return(0,s.jsxs)(`header`,{className:`ds-drawer__head`,hidden:!i,children:[(0,s.jsxs)(`div`,{className:`ds-drawer__titles`,children:[(0,s.jsx)(`h2`,{id:c,className:`ds-drawer__title`,children:t}),n&&(0,s.jsx)(`p`,{id:l,className:`ds-drawer__description`,children:n})]}),(0,s.jsx)(e.Button,{ref:u,variant:`simple`,size:a===`navigation`?`lg`:`sm`,isIconOnly:!0,iconStart:`x`,className:a===`navigation`?`ds-drawer__close`:void 0,"aria-label":o,onClick:r})]})}function l({isOpen:e,isVisible:t,isActive:n,onInactivePress:r,ariaHidden:i}){let a=n&&t,o=!e||!a,s=e&&t&&!n&&!!r;return{active:a,isInert:o,canPress:s,frameInert:o&&!s,panelAttributes:{"aria-hidden":s?i:o||i,tabIndex:s?void 0:-1}}}function u({isInert:t,children:n,footer:r,onInactivePress:i,inactivePressLabel:a,...o}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`div`,{className:`ds-drawer__content`,ref:e=>{e&&(e.inert=t,e.toggleAttribute(`inert`,t))},"aria-hidden":t||void 0,children:[(0,s.jsx)(c,{...o}),(0,s.jsx)(`div`,{className:`ds-drawer__body`,children:n}),r&&(0,s.jsx)(`footer`,{className:`ds-drawer__footer ds-field-surface`,children:r})]}),i&&(0,s.jsx)(e.Button,{variant:`simple`,className:`ds-drawer__inactive-press`,"aria-label":a??(typeof o.title==`string`?`Return to ${o.title}`:`Activate drawer`),tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),i()}})]})}function d(e,n){let[r,i]=(0,a.useState)(e),[o,s]=(0,a.useState)(!1);return r!==e&&(i(e),s(!e)),(0,a.useEffect)(()=>{if(!o||e)return;let r=t.t(n.current),i=window.setTimeout(()=>s(!1),r);return()=>window.clearTimeout(i)},[o,e,n]),[o,t=>{t.target===t.currentTarget&&t.propertyName===`opacity`&&!e&&s(!1)}]}var f=(0,a.forwardRef)(function({isOpen:e,isHidden:t=!1,onClose:c,title:f,description:p,side:m=`end`,size:h=`md`,hasHeader:g=!0,isActive:_=!0,onInactivePress:v,inactivePressLabel:y,hasScrim:b=!0,overlayLayer:x,variant:S=`default`,closeLabel:C=`Close`,portalContainer:w,footer:T,className:E,children:D,...O},k){let{layer:A,isVisible:j,isResumed:M}=r.r(e,t,x),{active:N,isInert:P,canPress:F,frameInert:I,panelAttributes:L}=l({isOpen:e,isVisible:j,isActive:_,onInactivePress:v,ariaHidden:O[`aria-hidden`]}),R=(0,a.useRef)(null),z=(0,a.useRef)(null),B=(0,a.useRef)(null),V=(0,a.useId)(),H=(0,a.useId)(),[U,W]=d(e,z),{onScrimMouseDown:G,order:K}=i.n({isOpen:e,isActive:N,layer:A,panelRef:R,onClose:c,initialFocus:S===`navigation`&&g?()=>B.current:void 0,preventScroll:!0,container:w}),q=i.r(K,e||U,w);return r.c(z,e,{keepDir:O.dir!==void 0}),!e&&!U||!q?null:(0,o.createPortal)((0,s.jsx)(r.t,{layer:A,isSuspended:P,children:(0,s.jsx)(`div`,{ref:e=>{z.current=e,e&&(e.inert=I)},className:`ds-drawer-scrim`,hidden:!j,"data-scrim":b?void 0:`none`,"data-inactive-press":F||void 0,"data-resumed":M||void 0,style:{zIndex:A},dir:O.dir,"data-side":m,"data-variant":S,"data-contained":w?``:void 0,"data-state":e?`open`:`closed`,"aria-hidden":I||void 0,onTransitionEnd:W,onMouseDown:G,children:(0,s.jsx)(`div`,{...O,ref:n.t(R,k),...i.t(O,V,H,!!p,N),...L,"data-side":m,"data-size":h,"data-header":g?void 0:`none`,"data-variant":S,className:[`ds-drawer`,`ds-field-surface`,E].filter(Boolean).join(` `),children:(0,s.jsx)(u,{isInert:P,title:f,description:p,onClose:c,hasHeader:g,variant:S,closeLabel:C,titleId:V,descriptionId:H,closeRef:B,footer:T,onInactivePress:F?v:void 0,inactivePressLabel:y,children:D})})})}),q)});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
2
+ //# sourceMappingURL=Drawer-BzvSfkCL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer-B2dcTh5l.cjs","names":["Button","_Fragment","Button","useState","transitionDurationMs","forwardRef","useDialogPresence","useRef","useId","useModalDialog","useDialogPortal","createPortal","DialogContent","mergeRefs","dialogAttributes","require_components_Button_index","require_transitionDuration","require_mergeRefs","require_overlayLayer","require_dialogLabel","react","react_dom","react_jsx_runtime","DrawerHead","hasHeader","titleId","title","description","descriptionId","closeRef","variant","closeLabel","onClose","drawerInteraction","active","isActive","isVisible","isInert","isOpen","canPress","onInactivePress","ariaHidden","DrawerContent","head","node","footer","inactivePressLabel","event","useDrawerExit","previousOpen","setPreviousOpen","exiting","setExiting","duration","scrimRef","timeout","Drawer","rest","isHidden","overlayLayer","panelRef","onTransitionEnd","portalContainer","portal","order","frameInert","hasScrim","isResumed","layer","side","onScrimMouseDown","ref","panelAttributes","size","className"],"sources":["../../src/components/Drawer/head.tsx","../../src/components/Drawer/content.tsx","../../src/components/Drawer/index.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { Button } from \"../Button\";\nimport type { DrawerProps } from \".\";\ntype HeadProps = Pick<\n DrawerProps,\n \"title\" | \"description\" | \"onClose\" | \"hasHeader\" | \"variant\" | \"closeLabel\"\n> & { titleId: string; descriptionId: string; closeRef: RefObject<HTMLButtonElement | null> };\nexport function DrawerHead({\n title,\n description,\n onClose,\n hasHeader,\n variant,\n closeLabel,\n titleId,\n descriptionId,\n closeRef,\n}: HeadProps) {\n return (\n <header\n className=\"ds-drawer__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-drawer__titles\">\n <h2\n id={titleId}\n className=\"ds-drawer__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-drawer__description\"\n >\n {description}\n </p>\n )}\n </div>\n <Button\n ref={closeRef}\n variant=\"simple\"\n size={variant === \"navigation\" ? \"lg\" : \"sm\"}\n isIconOnly\n iconStart=\"x\"\n className={variant === \"navigation\" ? \"ds-drawer__close\" : undefined}\n aria-label={closeLabel}\n onClick={onClose}\n />\n </header>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { Button } from \"../Button\";\nimport { DrawerHead } from \"./head\";\nimport type { DrawerProps } from \".\";\n\ntype ContentProps = ComponentProps<typeof DrawerHead> &\n Pick<DrawerProps, \"children\" | \"footer\" | \"onInactivePress\" | \"inactivePressLabel\"> & {\n isInert: boolean;\n };\n\n/** Distinguish modal participation from an application's inactive-panel action. */\nexport function drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden,\n}: {\n isOpen: boolean;\n isVisible: boolean;\n isActive: boolean;\n onInactivePress?: () => void;\n ariaHidden?: DrawerProps[\"aria-hidden\"];\n}) {\n const active = isActive && isVisible;\n const isInert = !isOpen || !active;\n const canPress = isOpen && isVisible && !isActive && Boolean(onInactivePress);\n return {\n active,\n isInert,\n canPress,\n frameInert: isInert && !canPress,\n panelAttributes: {\n \"aria-hidden\": canPress ? ariaHidden : isInert || ariaHidden,\n tabIndex: canPress ? undefined : -1,\n },\n };\n}\n\n/** Keep editors mounted inside an inert boundary, with activation outside it. */\nexport function DrawerContent({\n isInert,\n children,\n footer,\n onInactivePress,\n inactivePressLabel,\n ...head\n}: ContentProps) {\n return (\n <>\n <div\n className=\"ds-drawer__content\"\n ref={(node) => {\n if (node) {\n node.inert = isInert;\n node.toggleAttribute(\"inert\", isInert);\n }\n }}\n aria-hidden={isInert || undefined}\n >\n <DrawerHead {...head} />\n <div className=\"ds-drawer__body\">{children}</div>\n {footer && <footer className=\"ds-drawer__footer ds-field-surface\">{footer}</footer>}\n </div>\n {onInactivePress && (\n <Button\n variant=\"simple\"\n className=\"ds-drawer__inactive-press\"\n aria-label={\n inactivePressLabel ??\n (typeof head.title === \"string\" ? `Return to ${head.title}` : \"Activate drawer\")\n }\n tabIndex={-1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={(event) => {\n event.stopPropagation();\n onInactivePress();\n }}\n />\n )}\n </>\n );\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n type TransitionEvent,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { DrawerContent, drawerInteraction } from \"./content\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\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\";\nimport \"./style.css\";\n\nexport type DrawerSide = \"end\" | \"start\" | \"bottom\";\nexport type DrawerSize = \"md\" | \"wide\";\n\nexport interface DrawerProps 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 title: ReactNode;\n description?: string;\n /** Which edge the panel is anchored to. */\n side?: DrawerSide;\n size?: DrawerSize;\n /** Without it the title still names the dialog; give people another way to close it. */\n hasHeader?: boolean;\n /**\n * Only the active panel traps focus and handles Escape. An inactive open\n * panel stays visible and mounted as an inert background panel.\n */\n isActive?: boolean;\n /** Activate an exposed inactive panel. Its editor stays inert; the app decides whether to activate it. */\n onInactivePress?: () => void;\n /** Accessible name for the inactive-panel action; defaults to Return to {title} for string titles. */\n inactivePressLabel?: string;\n /** Without a scrim, presses outside the panel reach the page beneath. */\n hasScrim?: boolean;\n /**\n * z-index for this panel 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 /** Navigation uses a compact panel, header and footer. Both variants slide in and out. */\n variant?: \"default\" | \"navigation\";\n /** Accessible name of the dismiss button. */\n closeLabel?: string;\n /**\n * Defaults to document.body, covering the viewport. A navigation drawer\n * portaled into a positioned element, such as an app shell, stays inside it.\n */\n portalContainer?: HTMLElement | null;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\nfunction useDrawerExit(isOpen: boolean, scrimRef: RefObject<HTMLDivElement | null>) {\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n\n useEffect(() => {\n if (!exiting || isOpen) {\n return;\n }\n // Read the actual transition, including token overrides and reduced motion.\n const duration = transitionDurationMs(scrimRef.current!);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }, [exiting, isOpen, scrimRef]);\n\n const onTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n };\n return [exiting, onTransitionEnd] as const;\n}\n\n/**\n * A side panel for work that belongs beside the page rather than on top of it\n * — editing one record, a filter set, a revision history. Same frame, rules\n * and footer band as `Modal`, with square corners and a full slide through\n * its anchored edge. Focus is trapped while open.\n */\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n side = \"end\",\n size = \"md\",\n hasHeader = true,\n isActive = true,\n onInactivePress,\n inactivePressLabel,\n hasScrim = true,\n overlayLayer,\n variant = \"default\",\n closeLabel = \"Close\",\n portalContainer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const { layer, isVisible, isResumed } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const { active, isInert, canPress, frameInert, panelAttributes } = drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden: rest[\"aria-hidden\"],\n });\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef<HTMLButtonElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const [exiting, onTransitionEnd] = useDrawerExit(isOpen, scrimRef);\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: active,\n layer,\n panelRef,\n onClose,\n // A hidden header's close button can't take focus.\n initialFocus: variant === \"navigation\" && hasHeader ? () => closeRef.current : undefined,\n // Panels start off-screen; focusing them must not scroll the page with them.\n preventScroll: true,\n container: portalContainer,\n });\n const portal = useDialogPortal(order, isOpen || exiting, portalContainer);\n useInheritedPortalScope(scrimRef, isOpen, { keepDir: rest.dir !== undefined });\n\n if ((!isOpen && !exiting) || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={isInert}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n if (node) {\n node.inert = frameInert;\n }\n }}\n className=\"ds-drawer-scrim\"\n hidden={!isVisible}\n data-scrim={hasScrim ? undefined : \"none\"}\n data-inactive-press={canPress || undefined}\n data-resumed={isResumed || undefined}\n style={{ zIndex: layer }}\n dir={rest.dir}\n data-side={side}\n data-variant={variant}\n data-contained={portalContainer ? \"\" : undefined}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={frameInert || undefined}\n onTransitionEnd={onTransitionEnd}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), active)}\n {...panelAttributes}\n data-side={side}\n data-size={size}\n data-header={hasHeader ? undefined : \"none\"}\n data-variant={variant}\n className={[\"ds-drawer\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <DrawerContent\n isInert={isInert}\n title={title}\n description={description}\n onClose={onClose}\n hasHeader={hasHeader}\n variant={variant}\n closeLabel={closeLabel}\n titleId={titleId}\n descriptionId={descriptionId}\n closeRef={closeRef}\n footer={footer}\n onInactivePress={canPress ? onInactivePress : undefined}\n inactivePressLabel={inactivePressLabel}\n >\n {children}\n </DrawerContent>\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":"A,qSAOA,SAAgBuB,EAAW,CACzB,QACA,cACA,UACA,YACA,UACA,aACA,UACA,gBACA,YACY,CACZ,OACE,EAAAD,EAAA,KAAA,CAAC,SAAD,CACE,UAAU,kBACV,OAAQ,CAACE,EAFX,SAAA,EAIE,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD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hD,EAAA,IAAA,CAAC,MAAD,CACE,GAAImC,EACJ,IAAK5C,EAAAA,EAAU+C,EAAUW,CAAG,EAC5B,GAAIzD,EAAAA,EAAiB2C,EAAMhC,EAASG,EAAe,EAAQD,EAAcO,CAAM,EAC/E,GAAIsC,EACJ,YAAWH,EACX,YAAWI,EACX,cAAajD,EAAY,IAAA,GAAY,OACrC,eAAcM,EACd,UAAW,CAAC,YAAa,mBAAoB4C,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAEhF,UAAA,EAAApD,EAAA,IAAA,CAACoB,EAAD,CACW,UACF,QACM,cACJ,UACE,YACF,UACG,aACH,UACM,gBACL,WACF,SACR,gBAAiBH,EAAWC,EAAkB,IAAA,GAC1B,qBAEnB,UACY,CAAA,CACZ,CAAA,CACF,CAAA,CACQ,CAAA,EACfuB,CACF,CACF,CAAC,E"}
1
+ {"version":3,"file":"Drawer-BzvSfkCL.cjs","names":["Button","_Fragment","Button","useState","transitionDurationMs","forwardRef","useDialogPresence","useRef","useId","useModalDialog","useDialogPortal","createPortal","DialogContent","mergeRefs","dialogAttributes","require_components_Button_index","require_transitionDuration","require_mergeRefs","require_overlayLayer","require_dialogLabel","react","react_dom","react_jsx_runtime","DrawerHead","hasHeader","titleId","title","description","descriptionId","closeRef","variant","closeLabel","onClose","drawerInteraction","active","isActive","isVisible","isInert","isOpen","canPress","onInactivePress","ariaHidden","DrawerContent","head","node","footer","inactivePressLabel","event","useDrawerExit","previousOpen","setPreviousOpen","exiting","setExiting","duration","scrimRef","timeout","Drawer","rest","isHidden","overlayLayer","panelRef","onTransitionEnd","portalContainer","portal","order","frameInert","hasScrim","isResumed","layer","side","onScrimMouseDown","ref","panelAttributes","size","className"],"sources":["../../src/components/Drawer/head.tsx","../../src/components/Drawer/content.tsx","../../src/components/Drawer/index.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { Button } from \"../Button\";\nimport type { DrawerProps } from \".\";\ntype HeadProps = Pick<\n DrawerProps,\n \"title\" | \"description\" | \"onClose\" | \"hasHeader\" | \"variant\" | \"closeLabel\"\n> & { titleId: string; descriptionId: string; closeRef: RefObject<HTMLButtonElement | null> };\nexport function DrawerHead({\n title,\n description,\n onClose,\n hasHeader,\n variant,\n closeLabel,\n titleId,\n descriptionId,\n closeRef,\n}: HeadProps) {\n return (\n <header\n className=\"ds-drawer__head\"\n hidden={!hasHeader}\n >\n <div className=\"ds-drawer__titles\">\n <h2\n id={titleId}\n className=\"ds-drawer__title\"\n >\n {title}\n </h2>\n {description && (\n <p\n id={descriptionId}\n className=\"ds-drawer__description\"\n >\n {description}\n </p>\n )}\n </div>\n <Button\n ref={closeRef}\n variant=\"simple\"\n size={variant === \"navigation\" ? \"lg\" : \"sm\"}\n isIconOnly\n iconStart=\"x\"\n className={variant === \"navigation\" ? \"ds-drawer__close\" : undefined}\n aria-label={closeLabel}\n onClick={onClose}\n />\n </header>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { Button } from \"../Button\";\nimport { DrawerHead } from \"./head\";\nimport type { DrawerProps } from \".\";\n\ntype ContentProps = ComponentProps<typeof DrawerHead> &\n Pick<DrawerProps, \"children\" | \"footer\" | \"onInactivePress\" | \"inactivePressLabel\"> & {\n isInert: boolean;\n };\n\n/** Distinguish modal participation from an application's inactive-panel action. */\nexport function drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden,\n}: {\n isOpen: boolean;\n isVisible: boolean;\n isActive: boolean;\n onInactivePress?: () => void;\n ariaHidden?: DrawerProps[\"aria-hidden\"];\n}) {\n const active = isActive && isVisible;\n const isInert = !isOpen || !active;\n const canPress = isOpen && isVisible && !isActive && Boolean(onInactivePress);\n return {\n active,\n isInert,\n canPress,\n frameInert: isInert && !canPress,\n panelAttributes: {\n \"aria-hidden\": canPress ? ariaHidden : isInert || ariaHidden,\n tabIndex: canPress ? undefined : -1,\n },\n };\n}\n\n/** Keep editors mounted inside an inert boundary, with activation outside it. */\nexport function DrawerContent({\n isInert,\n children,\n footer,\n onInactivePress,\n inactivePressLabel,\n ...head\n}: ContentProps) {\n return (\n <>\n <div\n className=\"ds-drawer__content\"\n ref={(node) => {\n if (node) {\n node.inert = isInert;\n node.toggleAttribute(\"inert\", isInert);\n }\n }}\n aria-hidden={isInert || undefined}\n >\n <DrawerHead {...head} />\n <div className=\"ds-drawer__body\">{children}</div>\n {footer && <footer className=\"ds-drawer__footer ds-field-surface\">{footer}</footer>}\n </div>\n {onInactivePress && (\n <Button\n variant=\"simple\"\n className=\"ds-drawer__inactive-press\"\n aria-label={\n inactivePressLabel ??\n (typeof head.title === \"string\" ? `Return to ${head.title}` : \"Activate drawer\")\n }\n tabIndex={-1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={(event) => {\n event.stopPropagation();\n onInactivePress();\n }}\n />\n )}\n </>\n );\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n type TransitionEvent,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { DrawerContent, drawerInteraction } from \"./content\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\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\";\nimport \"./style.css\";\n\nexport type DrawerSide = \"end\" | \"start\" | \"bottom\";\nexport type DrawerSize = \"md\" | \"wide\";\n\nexport interface DrawerProps 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 title: ReactNode;\n description?: string;\n /** Which edge the panel is anchored to. */\n side?: DrawerSide;\n size?: DrawerSize;\n /** Without it the title still names the dialog; give people another way to close it. */\n hasHeader?: boolean;\n /**\n * Only the active panel traps focus and handles Escape. An inactive open\n * panel stays visible and mounted as an inert background panel.\n */\n isActive?: boolean;\n /** Activate an exposed inactive panel. Its editor stays inert; the app decides whether to activate it. */\n onInactivePress?: () => void;\n /** Accessible name for the inactive-panel action; defaults to Return to {title} for string titles. */\n inactivePressLabel?: string;\n /** Without a scrim, presses outside the panel reach the page beneath. */\n hasScrim?: boolean;\n /**\n * z-index for this panel 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 /** Navigation uses a compact panel, header and footer. Both variants slide in and out. */\n variant?: \"default\" | \"navigation\";\n /** Accessible name of the dismiss button. */\n closeLabel?: string;\n /**\n * Defaults to document.body, covering the viewport. A navigation drawer\n * portaled into a positioned element, such as an app shell, stays inside it.\n */\n portalContainer?: HTMLElement | null;\n /** Actions, right-aligned. The confirming action goes last. */\n footer?: ReactNode;\n children?: ReactNode;\n}\n\nfunction useDrawerExit(isOpen: boolean, scrimRef: RefObject<HTMLDivElement | null>) {\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n\n useEffect(() => {\n if (!exiting || isOpen) {\n return;\n }\n // Read the actual transition, including token overrides and reduced motion.\n const duration = transitionDurationMs(scrimRef.current!);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }, [exiting, isOpen, scrimRef]);\n\n const onTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n };\n return [exiting, onTransitionEnd] as const;\n}\n\n/**\n * A side panel for work that belongs beside the page rather than on top of it\n * — editing one record, a filter set, a revision history. Same frame, rules\n * and footer band as `Modal`, with square corners and a full slide through\n * its anchored edge. Focus is trapped while open.\n */\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n isHidden = false,\n onClose,\n title,\n description,\n side = \"end\",\n size = \"md\",\n hasHeader = true,\n isActive = true,\n onInactivePress,\n inactivePressLabel,\n hasScrim = true,\n overlayLayer,\n variant = \"default\",\n closeLabel = \"Close\",\n portalContainer,\n footer,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const { layer, isVisible, isResumed } = useDialogPresence(isOpen, isHidden, overlayLayer);\n const { active, isInert, canPress, frameInert, panelAttributes } = drawerInteraction({\n isOpen,\n isVisible,\n isActive,\n onInactivePress,\n ariaHidden: rest[\"aria-hidden\"],\n });\n const panelRef = useRef<HTMLDivElement | null>(null);\n const scrimRef = useRef<HTMLDivElement | null>(null);\n const closeRef = useRef<HTMLButtonElement | null>(null);\n const titleId = useId();\n const descriptionId = useId();\n const [exiting, onTransitionEnd] = useDrawerExit(isOpen, scrimRef);\n const { onScrimMouseDown, order } = useModalDialog({\n isOpen,\n isActive: active,\n layer,\n panelRef,\n onClose,\n // A hidden header's close button can't take focus.\n initialFocus: variant === \"navigation\" && hasHeader ? () => closeRef.current : undefined,\n // Panels start off-screen; focusing them must not scroll the page with them.\n preventScroll: true,\n container: portalContainer,\n });\n const portal = useDialogPortal(order, isOpen || exiting, portalContainer);\n useInheritedPortalScope(scrimRef, isOpen, { keepDir: rest.dir !== undefined });\n\n if ((!isOpen && !exiting) || !portal) {\n return null;\n }\n\n return createPortal(\n <DialogContent\n layer={layer}\n isSuspended={isInert}\n >\n <div\n ref={(node) => {\n scrimRef.current = node;\n if (node) {\n node.inert = frameInert;\n }\n }}\n className=\"ds-drawer-scrim\"\n hidden={!isVisible}\n data-scrim={hasScrim ? undefined : \"none\"}\n data-inactive-press={canPress || undefined}\n data-resumed={isResumed || undefined}\n style={{ zIndex: layer }}\n dir={rest.dir}\n data-side={side}\n data-variant={variant}\n data-contained={portalContainer ? \"\" : undefined}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={frameInert || undefined}\n onTransitionEnd={onTransitionEnd}\n onMouseDown={onScrimMouseDown}\n >\n <div\n {...rest}\n ref={mergeRefs(panelRef, ref)}\n {...dialogAttributes(rest, titleId, descriptionId, Boolean(description), active)}\n {...panelAttributes}\n data-side={side}\n data-size={size}\n data-header={hasHeader ? undefined : \"none\"}\n data-variant={variant}\n className={[\"ds-drawer\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <DrawerContent\n isInert={isInert}\n title={title}\n description={description}\n onClose={onClose}\n hasHeader={hasHeader}\n variant={variant}\n closeLabel={closeLabel}\n titleId={titleId}\n descriptionId={descriptionId}\n closeRef={closeRef}\n footer={footer}\n onInactivePress={canPress ? onInactivePress : undefined}\n inactivePressLabel={inactivePressLabel}\n >\n {children}\n </DrawerContent>\n </div>\n </div>\n </DialogContent>,\n portal,\n );\n});\n"],"mappings":"A,qSAOA,SAAgBuB,EAAW,CACzB,QACA,cACA,UACA,YACA,UACA,aACA,UACA,gBACA,YACY,CACZ,OACE,EAAAD,EAAA,KAAA,CAAC,SAAD,CACE,UAAU,kBACV,OAAQ,CAACE,EAFX,SAAA,EAIE,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,oBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CACE,GAAIG,EACJ,UAAU,mBAET,SAAAC,CACC,CAAA,EACHC,IACC,EAAAL,EAAA,IAAA,CAAC,IAAD,CACE,GAAIM,EACJ,UAAU,yBAET,SAAAD,CACA,CAAA,CAEF,CACL,CAAA,GAAA,EAAAL,EAAA,IAAA,CAACtB,EAAAA,OAAD,CACE,IAAK6B,EACL,QAAQ,SACR,KAAMC,IAAY,aAAe,KAAO,KACxC,WAAA,GACA,UAAU,IACV,UAAWA,IAAY,aAAe,mBAAqB,IAAA,GAC3D,aAAYC,EACZ,QAASC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AApD,EAAA,IAAA,CAACoB,EAAD,CACW,UACF,QACM,cACJ,UACE,YACF,UACG,aACH,UACM,gBACL,WACF,SACR,gBAAiBH,EAAWC,EAAkB,IAAA,GAC1B,qBAEnB,UACY,CAAA,CACZ,CAAA,CACF,CAAA,CACQ,CAAA,EACfuB,CACF,CACF,CAAC,E"}
@@ -1,6 +1,6 @@
1
- import { t as e } from "./Icon-Bxvp1-td.js";
1
+ import { t as e } from "./Icon-kLLQC54Z.js";
2
2
  import { Button as t } from "../components/Button/index.js";
3
- import { d as n, g as r, u as i } from "./overlayLayer-Og07sIyl.js";
3
+ import { b as n, h as r, u as i } from "./overlayLayer-Dv1vmfaI.js";
4
4
  import { Badge as a } from "../components/Badge/index.js";
5
5
  import { r as o } from "./limit-s9zfxIMC.js";
6
6
  import { LimitReading as s } from "../components/LimitReading/index.js";
@@ -249,9 +249,9 @@ function H({ query: e, itemLabel: t, itemsLabel: n, canCreate: r }) {
249
249
  });
250
250
  }
251
251
  function U(e, t) {
252
- let n = e.closest(".ds-entry-picker__scroll") ?? e.parentElement, i = Array.from(n?.querySelectorAll(".ds-entry-picker__result") ?? []);
252
+ let r = e.closest(".ds-entry-picker__scroll") ?? e.parentElement, i = Array.from(r?.querySelectorAll(".ds-entry-picker__result") ?? []);
253
253
  for (let e of [...i.slice(t), ...i.slice(0, t).reverse()]) {
254
- let t = r(e)[0];
254
+ let t = n(e)[0];
255
255
  if (t) return t;
256
256
  }
257
257
  }
@@ -259,7 +259,7 @@ function W(e) {
259
259
  let t = x(null), i = x(null), { more: a, offset: o } = e;
260
260
  return v(() => {
261
261
  let e = i.current, o = t.current;
262
- e !== null && a.status !== "loading" && (i.current = null, o && n(document.activeElement) && (a.status === "error" ? r(o)[0] : U(o, e))?.focus());
262
+ e !== null && a.status !== "loading" && (i.current = null, o && r(document.activeElement) && (a.status === "error" ? n(o)[0] : U(o, e))?.focus());
263
263
  }, [a.status, o]), {
264
264
  pagingRef: t,
265
265
  load: () => {
@@ -273,7 +273,7 @@ function G(e, t) {
273
273
  if (i.current === t) return;
274
274
  i.current = t;
275
275
  let a = e.current;
276
- a && n(document.activeElement) && (r(a)[0] ?? U(a, Infinity))?.focus();
276
+ a && r(document.activeElement) && (n(a)[0] ?? U(a, Infinity))?.focus();
277
277
  }, [e, t]);
278
278
  }
279
279
  function K({ count: e, total: n, isRemote: r, pageSize: i, remote: a, itemsLabel: o }) {
@@ -874,4 +874,4 @@ function ye({ items: e = ve, value: n, defaultValue: r = [], onValueChange: i, m
874
874
  //#endregion
875
875
  export { Z as a, P as c, ne as i, k as l, ge as n, V as o, re as r, B as s, ye as t };
876
876
 
877
- //# sourceMappingURL=EntryPicker-Ie9T47hA.js.map
877
+ //# sourceMappingURL=EntryPicker-BGWxiLJ_.js.map