@brycks/core-front 0.3.5 → 0.5.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 (168) hide show
  1. package/dist/components/data/List/List.cjs +1 -1
  2. package/dist/components/data/List/List.cjs.map +1 -1
  3. package/dist/components/data/List/List.js +1 -1
  4. package/dist/components/data/List/List.js.map +1 -1
  5. package/dist/components/data/Table/Table.cjs +1 -1
  6. package/dist/components/data/Table/Table.cjs.map +1 -1
  7. package/dist/components/data/Table/Table.js +196 -166
  8. package/dist/components/data/Table/Table.js.map +1 -1
  9. package/dist/components/data/TreeView/TreeView.cjs +1 -1
  10. package/dist/components/data/TreeView/TreeView.cjs.map +1 -1
  11. package/dist/components/data/TreeView/TreeView.js +1 -1
  12. package/dist/components/data/TreeView/TreeView.js.map +1 -1
  13. package/dist/components/data.cjs +1 -1
  14. package/dist/components/data.js +23 -21
  15. package/dist/components/feedback/Alert/Alert.cjs +1 -1
  16. package/dist/components/feedback/Alert/Alert.cjs.map +1 -1
  17. package/dist/components/feedback/Alert/Alert.js +20 -19
  18. package/dist/components/feedback/Alert/Alert.js.map +1 -1
  19. package/dist/components/feedback/Banner/Banner.cjs +2 -0
  20. package/dist/components/feedback/Banner/Banner.cjs.map +1 -0
  21. package/dist/components/feedback/Banner/Banner.js +77 -0
  22. package/dist/components/feedback/Banner/Banner.js.map +1 -0
  23. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.cjs +2 -0
  24. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.cjs.map +1 -0
  25. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.js +68 -0
  26. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.js.map +1 -0
  27. package/dist/components/feedback/Drawer/Drawer.cjs +2 -2
  28. package/dist/components/feedback/Drawer/Drawer.cjs.map +1 -1
  29. package/dist/components/feedback/Drawer/Drawer.js +58 -57
  30. package/dist/components/feedback/Drawer/Drawer.js.map +1 -1
  31. package/dist/components/feedback/Modal/Modal.cjs +1 -1
  32. package/dist/components/feedback/Modal/Modal.cjs.map +1 -1
  33. package/dist/components/feedback/Modal/Modal.js +101 -91
  34. package/dist/components/feedback/Modal/Modal.js.map +1 -1
  35. package/dist/components/feedback/Popover/Popover.cjs +2 -2
  36. package/dist/components/feedback/Popover/Popover.cjs.map +1 -1
  37. package/dist/components/feedback/Popover/Popover.js +93 -85
  38. package/dist/components/feedback/Popover/Popover.js.map +1 -1
  39. package/dist/components/feedback/Toast/Toast.cjs +2 -2
  40. package/dist/components/feedback/Toast/Toast.cjs.map +1 -1
  41. package/dist/components/feedback/Toast/Toast.js +102 -93
  42. package/dist/components/feedback/Toast/Toast.js.map +1 -1
  43. package/dist/components/feedback.cjs +1 -1
  44. package/dist/components/feedback.js +17 -13
  45. package/dist/components/feedback.js.map +1 -1
  46. package/dist/components/form/Combobox/Combobox.cjs +2 -2
  47. package/dist/components/form/Combobox/Combobox.cjs.map +1 -1
  48. package/dist/components/form/Combobox/Combobox.js +187 -167
  49. package/dist/components/form/Combobox/Combobox.js.map +1 -1
  50. package/dist/components/form/DateInput/DateInput.cjs +1 -1
  51. package/dist/components/form/DateInput/DateInput.cjs.map +1 -1
  52. package/dist/components/form/DateInput/DateInput.js +2 -2
  53. package/dist/components/form/DateInput/DateInput.js.map +1 -1
  54. package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
  55. package/dist/components/form/DateRangePicker/DateRangePicker.cjs.map +1 -1
  56. package/dist/components/form/DateRangePicker/DateRangePicker.js +34 -34
  57. package/dist/components/form/DateRangePicker/DateRangePicker.js.map +1 -1
  58. package/dist/components/form/DropZone/DropZone.cjs +1 -1
  59. package/dist/components/form/DropZone/DropZone.cjs.map +1 -1
  60. package/dist/components/form/DropZone/DropZone.js +10 -10
  61. package/dist/components/form/DropZone/DropZone.js.map +1 -1
  62. package/dist/components/form/FileInput/FileInput.cjs +1 -1
  63. package/dist/components/form/FileInput/FileInput.cjs.map +1 -1
  64. package/dist/components/form/FileInput/FileInput.js +1 -1
  65. package/dist/components/form/FileInput/FileInput.js.map +1 -1
  66. package/dist/components/form/FormCard/FormCard.cjs +1 -1
  67. package/dist/components/form/FormCard/FormCard.cjs.map +1 -1
  68. package/dist/components/form/FormCard/FormCard.js +9 -9
  69. package/dist/components/form/FormCard/FormCard.js.map +1 -1
  70. package/dist/components/form/FormField/FormField.cjs +1 -1
  71. package/dist/components/form/FormField/FormField.cjs.map +1 -1
  72. package/dist/components/form/FormField/FormField.js +67 -55
  73. package/dist/components/form/FormField/FormField.js.map +1 -1
  74. package/dist/components/form/MultiSelect/MultiSelect.cjs +1 -1
  75. package/dist/components/form/MultiSelect/MultiSelect.cjs.map +1 -1
  76. package/dist/components/form/MultiSelect/MultiSelect.js +2 -3
  77. package/dist/components/form/MultiSelect/MultiSelect.js.map +1 -1
  78. package/dist/components/form/Radio/Radio.cjs +1 -1
  79. package/dist/components/form/Radio/Radio.cjs.map +1 -1
  80. package/dist/components/form/Radio/Radio.js +20 -20
  81. package/dist/components/form/Radio/Radio.js.map +1 -1
  82. package/dist/components/form/SearchInput/SearchInput.cjs +2 -0
  83. package/dist/components/form/SearchInput/SearchInput.cjs.map +1 -0
  84. package/dist/components/form/SearchInput/SearchInput.js +68 -0
  85. package/dist/components/form/SearchInput/SearchInput.js.map +1 -0
  86. package/dist/components/form/TagInput/TagInput.cjs +1 -1
  87. package/dist/components/form/TagInput/TagInput.cjs.map +1 -1
  88. package/dist/components/form/TagInput/TagInput.js +104 -102
  89. package/dist/components/form/TagInput/TagInput.js.map +1 -1
  90. package/dist/components/form/TimePicker/TimePicker.cjs +1 -1
  91. package/dist/components/form/TimePicker/TimePicker.cjs.map +1 -1
  92. package/dist/components/form/TimePicker/TimePicker.js +29 -30
  93. package/dist/components/form/TimePicker/TimePicker.js.map +1 -1
  94. package/dist/components/form.cjs +1 -1
  95. package/dist/components/form.js +15 -13
  96. package/dist/components/form.js.map +1 -1
  97. package/dist/components/layout/Card/Card.cjs +1 -1
  98. package/dist/components/layout/Card/Card.cjs.map +1 -1
  99. package/dist/components/layout/Card/Card.js +7 -5
  100. package/dist/components/layout/Card/Card.js.map +1 -1
  101. package/dist/components/layout/Collapse/Collapse.cjs.map +1 -1
  102. package/dist/components/layout/Collapse/Collapse.js.map +1 -1
  103. package/dist/components/media/Image/Image.cjs +1 -1
  104. package/dist/components/media/Image/Image.cjs.map +1 -1
  105. package/dist/components/media/Image/Image.js +9 -9
  106. package/dist/components/media/Image/Image.js.map +1 -1
  107. package/dist/components/media/ImageThumbnail/ImageThumbnail.cjs +1 -1
  108. package/dist/components/media/ImageThumbnail/ImageThumbnail.cjs.map +1 -1
  109. package/dist/components/media/ImageThumbnail/ImageThumbnail.js +6 -6
  110. package/dist/components/media/ImageThumbnail/ImageThumbnail.js.map +1 -1
  111. package/dist/components/navigation/Accordion/Accordion.cjs +1 -1
  112. package/dist/components/navigation/Accordion/Accordion.cjs.map +1 -1
  113. package/dist/components/navigation/Accordion/Accordion.js +0 -1
  114. package/dist/components/navigation/Accordion/Accordion.js.map +1 -1
  115. package/dist/components/navigation/Menu/Menu.cjs +1 -1
  116. package/dist/components/navigation/Menu/Menu.cjs.map +1 -1
  117. package/dist/components/navigation/Menu/Menu.js +87 -86
  118. package/dist/components/navigation/Menu/Menu.js.map +1 -1
  119. package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
  120. package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
  121. package/dist/components/navigation/Pagination/Pagination.js +107 -99
  122. package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
  123. package/dist/components/navigation/SegmentedControl/SegmentedControl.cjs +2 -0
  124. package/dist/components/navigation/SegmentedControl/SegmentedControl.cjs.map +1 -0
  125. package/dist/components/navigation/SegmentedControl/SegmentedControl.js +90 -0
  126. package/dist/components/navigation/SegmentedControl/SegmentedControl.js.map +1 -0
  127. package/dist/components/navigation.cjs +1 -1
  128. package/dist/components/navigation.js +25 -23
  129. package/dist/components/navigation.js.map +1 -1
  130. package/dist/components/utility/Avatar/Avatar.cjs +1 -1
  131. package/dist/components/utility/Avatar/Avatar.cjs.map +1 -1
  132. package/dist/components/utility/Avatar/Avatar.js +18 -18
  133. package/dist/components/utility/Avatar/Avatar.js.map +1 -1
  134. package/dist/components/utility/Badge/Badge.cjs +1 -1
  135. package/dist/components/utility/Badge/Badge.cjs.map +1 -1
  136. package/dist/components/utility/Badge/Badge.js +31 -23
  137. package/dist/components/utility/Badge/Badge.js.map +1 -1
  138. package/dist/components/utility/Kbd/Kbd.cjs +2 -0
  139. package/dist/components/utility/Kbd/Kbd.cjs.map +1 -0
  140. package/dist/components/utility/Kbd/Kbd.js +20 -0
  141. package/dist/components/utility/Kbd/Kbd.js.map +1 -0
  142. package/dist/components/utility/Logo/Logo.cjs +1 -1
  143. package/dist/components/utility/Logo/Logo.cjs.map +1 -1
  144. package/dist/components/utility/Logo/Logo.js +21 -21
  145. package/dist/components/utility/Logo/Logo.js.map +1 -1
  146. package/dist/components/utility.cjs +1 -1
  147. package/dist/components/utility.js +9 -7
  148. package/dist/components/utility.js.map +1 -1
  149. package/dist/data.d.ts +34 -1
  150. package/dist/design-system/themes/ThemeProvider.cjs +1 -1
  151. package/dist/design-system/themes/ThemeProvider.cjs.map +1 -1
  152. package/dist/design-system/themes/ThemeProvider.js +46 -46
  153. package/dist/design-system/themes/ThemeProvider.js.map +1 -1
  154. package/dist/design-system/tokens/zIndex.cjs +1 -1
  155. package/dist/design-system/tokens/zIndex.cjs.map +1 -1
  156. package/dist/design-system/tokens/zIndex.js +2 -0
  157. package/dist/design-system/tokens/zIndex.js.map +1 -1
  158. package/dist/feedback.d.ts +75 -2
  159. package/dist/form.d.ts +41 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.d.ts +213 -3
  162. package/dist/index.js +177 -165
  163. package/dist/index.js.map +1 -1
  164. package/dist/navigation.d.ts +58 -0
  165. package/dist/styles.css +1 -1
  166. package/dist/tokens.d.ts +2 -0
  167. package/dist/utility.d.ts +19 -0
  168. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Banner.js","sources":["../../../../src/components/feedback/Banner/Banner.tsx"],"sourcesContent":["/**\n * Banner Component\n *\n * App-level announcement bar for status, alerts, and notices.\n * Horizontal, full-width layout designed to sit at the top of a page or app shell.\n *\n * Unlike Alert (a contained, in-flow message), Banner spans the full width and\n * picks its ARIA role from the intent: critical intents (warning/error) announce\n * assertively as `alert`, informational intents (info/success/neutral) as `status`.\n *\n * All color styles are handled via CSS classes for easy customization.\n */\n\nimport React, {\n forwardRef,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type BannerIntent = 'info' | 'success' | 'warning' | 'error' | 'neutral'\n\nexport interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Visual intent/status */\n intent?: BannerIntent\n /** Banner title (stronger weight, sits above the description) */\n title?: ReactNode\n /** Custom icon (overrides the default per-intent icon) */\n icon?: ReactNode\n /** Whether to show the leading icon */\n showIcon?: boolean\n /** Action element (button, link) shown on the trailing edge */\n action?: ReactNode\n /** Whether the banner can be dismissed */\n isDismissible?: boolean\n /** Callback when dismissed */\n onDismiss?: () => void\n /** Accessible label of the dismiss button */\n dismissLabel?: string\n /**\n * ARIA live-region role. Defaults to `alert` for warning/error and\n * `status` for info/success/neutral. Override when the default is wrong.\n */\n role?: 'alert' | 'status'\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n /** Banner content (description) */\n children?: ReactNode\n}\n\nconst defaultIcons: Record<Exclude<BannerIntent, 'neutral'>, React.JSX.Element> = {\n info: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"9\" r=\"7.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M9 8V12\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n <circle cx=\"9\" cy=\"5.5\" r=\"0.75\" fill=\"currentColor\" />\n </svg>\n ),\n success: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"9\" r=\"7.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M6 9L8 11L12 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ),\n warning: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M9 2L16.5 15H1.5L9 2Z\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinejoin=\"round\" />\n <path d=\"M9 7V10\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n <circle cx=\"9\" cy=\"12.5\" r=\"0.75\" fill=\"currentColor\" />\n </svg>\n ),\n error: (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"9\" r=\"7.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M6.5 6.5L11.5 11.5M11.5 6.5L6.5 11.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n ),\n}\n\nconst criticalIntents: ReadonlySet<BannerIntent> = new Set<BannerIntent>(['warning', 'error'])\n\nexport const Banner = forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n intent = 'info',\n title,\n icon,\n showIcon = true,\n action,\n isDismissible,\n onDismiss,\n dismissLabel = 'Dismiss',\n role,\n className,\n style,\n testId,\n children,\n ...props\n },\n ref\n) {\n const resolvedRole = role ?? (criticalIntents.has(intent) ? 'alert' : 'status')\n const resolvedIcon = icon ?? (intent === 'neutral' ? null : defaultIcons[intent])\n\n return (\n <div\n ref={ref}\n role={resolvedRole}\n aria-live={resolvedRole === 'alert' ? 'assertive' : 'polite'}\n className={cx('brycks-banner', `brycks-banner--${intent}`, className)}\n style={style}\n data-testid={testId}\n {...props}\n >\n {showIcon && resolvedIcon && (\n <span className=\"brycks-banner__icon\">{resolvedIcon}</span>\n )}\n\n <div className=\"brycks-banner__content\">\n {title && <div className=\"brycks-banner__title\">{title}</div>}\n {children && <div className=\"brycks-banner__description\">{children}</div>}\n </div>\n\n {(action || isDismissible) && (\n <div className=\"brycks-banner__actions\">\n {action}\n {isDismissible && (\n <button\n type=\"button\"\n className=\"brycks-banner__dismiss\"\n onClick={onDismiss}\n aria-label={dismissLabel}\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M3 3L11 11M11 3L3 11\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </button>\n )}\n </div>\n )}\n </div>\n )\n})\n\nBanner.displayName = 'Banner'\n"],"names":["defaultIcons","jsxs","jsx","criticalIntents","Banner","forwardRef","intent","title","icon","showIcon","action","isDismissible","onDismiss","dismissLabel","role","className","style","testId","children","props","ref","resolvedRole","resolvedIcon","cx"],"mappings":";;;AAoDA,MAAMA,IAA4E;AAAA,EAChF,MACE,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,eAAY,QACtE,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAA,EAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM,QAAO,gBAAe,aAAY,MAAA,CAAM;AAAA,IACtE,gBAAAA,EAAC,UAAK,GAAE,WAAU,QAAO,gBAAe,aAAY,OAAM,eAAc,QAAA,CAAQ;AAAA,IAChF,gBAAAA,EAAC,YAAO,IAAG,KAAI,IAAG,OAAM,GAAE,QAAO,MAAK,eAAA,CAAe;AAAA,EAAA,GACvD;AAAA,EAEF,SACE,gBAAAD,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,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;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAEDE,EAAO,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("react"),b=require("../Modal/Modal.cjs"),n=require("../../primitives/Button/Button.cjs"),x={margin:0,fontSize:"var(--brycks-fs-body-base)",lineHeight:1.5,color:"var(--brycks-foreground-default)"},h={display:"flex",justifyContent:"flex-end",gap:"var(--brycks-spacing-2, 8px)",marginTop:"var(--brycks-spacing-6, 24px)"},l=p.forwardRef(function({isOpen:t,onClose:i,onConfirm:a,title:c,message:o,confirmLabel:f="Confirm",cancelLabel:d="Cancel",closeLabel:u="Close",variant:y="default",isLoading:e=!1,testId:m,children:C},g){const s=()=>{e||i()};return r.jsxs(b.Modal,{ref:g,isOpen:t,onClose:s,title:c,size:"sm",closeLabel:u,closeOnOverlayClick:!e,closeOnEscape:!e,testId:m,children:[o&&r.jsx("p",{style:x,children:o}),C,r.jsxs("div",{style:h,className:"brycks-confirm-dialog__footer",children:[r.jsx(n.Button,{size:"sm",variant:"ghost",onClick:s,isDisabled:e,children:d}),r.jsx(n.Button,{size:"sm",intent:y==="danger"?"error":"primary",onClick:a,isLoading:e,children:f})]})]})});l.displayName="ConfirmDialog";exports.ConfirmDialog=l;
2
+ //# sourceMappingURL=ConfirmDialog.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmDialog.cjs","sources":["../../../../src/components/feedback/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["/**\n * ConfirmDialog Component\n *\n * A small confirmation dialog built on top of Modal. Asks the user to confirm\n * or cancel an action, with an optional destructive (`danger`) styling and a\n * loading state for async confirmations.\n *\n * The component is i18n-agnostic: button labels default to English and should be\n * passed in by the consuming app when localization is needed.\n */\n\nimport {\n forwardRef,\n type ReactNode,\n type CSSProperties,\n} from 'react'\nimport { Modal } from '../Modal'\nimport { Button } from '../../primitives/Button'\n\nexport type ConfirmDialogVariant = 'default' | 'danger'\n\nexport interface ConfirmDialogProps {\n /** Whether the dialog is open */\n isOpen: boolean\n /** Callback when the dialog should close (cancel / overlay / escape) */\n onClose: () => void\n /** Callback when the user confirms */\n onConfirm: () => void\n /** Dialog title */\n title: ReactNode\n /** Body message (use `children` for richer content) */\n message?: ReactNode\n /** Label of the confirm button */\n confirmLabel?: string\n /** Label of the cancel button */\n cancelLabel?: string\n /** Accessible label of the modal close button */\n closeLabel?: string\n /** Visual variant — `danger` for destructive actions */\n variant?: ConfirmDialogVariant\n /** Whether the confirm action is in progress (disables cancel, spins confirm) */\n isLoading?: boolean\n /** Test ID */\n testId?: string\n /** Richer body content (rendered below `message`) */\n children?: ReactNode\n}\n\nconst messageStyle: CSSProperties = {\n margin: 0,\n fontSize: 'var(--brycks-fs-body-base)',\n lineHeight: 1.5,\n color: 'var(--brycks-foreground-default)',\n}\n\nconst footerStyle: CSSProperties = {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 'var(--brycks-spacing-2, 8px)',\n marginTop: 'var(--brycks-spacing-6, 24px)',\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, ConfirmDialogProps>(function ConfirmDialog(\n {\n isOpen,\n onClose,\n onConfirm,\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n closeLabel = 'Close',\n variant = 'default',\n isLoading = false,\n testId,\n children,\n },\n ref\n) {\n // Block close while the async confirm is running.\n const handleClose = () => {\n if (!isLoading) onClose()\n }\n\n return (\n <Modal\n ref={ref}\n isOpen={isOpen}\n onClose={handleClose}\n title={title}\n size=\"sm\"\n closeLabel={closeLabel}\n closeOnOverlayClick={!isLoading}\n closeOnEscape={!isLoading}\n testId={testId}\n >\n {message && <p style={messageStyle}>{message}</p>}\n {children}\n <div style={footerStyle} className=\"brycks-confirm-dialog__footer\">\n <Button size=\"sm\" variant=\"ghost\" onClick={handleClose} isDisabled={isLoading}>\n {cancelLabel}\n </Button>\n <Button\n size=\"sm\"\n intent={variant === 'danger' ? 'error' : 'primary'}\n onClick={onConfirm}\n isLoading={isLoading}\n >\n {confirmLabel}\n </Button>\n </div>\n </Modal>\n )\n})\n\nConfirmDialog.displayName = 'ConfirmDialog'\n"],"names":["messageStyle","footerStyle","ConfirmDialog","forwardRef","isOpen","onClose","onConfirm","title","message","confirmLabel","cancelLabel","closeLabel","variant","isLoading","testId","children","ref","handleClose","jsxs","Modal","jsx","Button"],"mappings":"wNAgDMA,EAA8B,CAClC,OAAQ,EACR,SAAU,6BACV,WAAY,IACZ,MAAO,kCACT,EAEMC,EAA6B,CACjC,QAAS,OACT,eAAgB,WAChB,IAAK,+BACL,UAAW,+BACb,EAEaC,EAAgBC,EAAAA,WAA+C,SAC1E,CACE,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,QAAAC,EACA,aAAAC,EAAe,UACf,YAAAC,EAAc,SACd,WAAAC,EAAa,QACb,QAAAC,EAAU,UACV,UAAAC,EAAY,GACZ,OAAAC,EACA,SAAAC,CACF,EACAC,EACA,CAEA,MAAMC,EAAc,IAAM,CACnBJ,GAAWR,EAAA,CAClB,EAEA,OACEa,EAAAA,KAACC,EAAAA,MAAA,CACC,IAAAH,EACA,OAAAZ,EACA,QAASa,EACT,MAAAV,EACA,KAAK,KACL,WAAAI,EACA,oBAAqB,CAACE,EACtB,cAAe,CAACA,EAChB,OAAAC,EAEC,SAAA,CAAAN,GAAWY,EAAAA,IAAC,IAAA,CAAE,MAAOpB,EAAe,SAAAQ,EAAQ,EAC5CO,EACDG,EAAAA,KAAC,MAAA,CAAI,MAAOjB,EAAa,UAAU,gCACjC,SAAA,CAAAmB,EAAAA,IAACC,EAAAA,OAAA,CAAO,KAAK,KAAK,QAAQ,QAAQ,QAASJ,EAAa,WAAYJ,EACjE,SAAAH,CAAA,CACH,EACAU,EAAAA,IAACC,EAAAA,OAAA,CACC,KAAK,KACL,OAAQT,IAAY,SAAW,QAAU,UACzC,QAASN,EACT,UAAAO,EAEC,SAAAJ,CAAA,CAAA,CACH,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC,EAEDP,EAAc,YAAc"}
@@ -0,0 +1,68 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as b } from "react";
3
+ import { Modal as h } from "../Modal/Modal.js";
4
+ import { Button as s } from "../../primitives/Button/Button.js";
5
+ const k = {
6
+ margin: 0,
7
+ fontSize: "var(--brycks-fs-body-base)",
8
+ lineHeight: 1.5,
9
+ color: "var(--brycks-foreground-default)"
10
+ }, u = {
11
+ display: "flex",
12
+ justifyContent: "flex-end",
13
+ gap: "var(--brycks-spacing-2, 8px)",
14
+ marginTop: "var(--brycks-spacing-6, 24px)"
15
+ }, v = b(function({
16
+ isOpen: i,
17
+ onClose: t,
18
+ onConfirm: a,
19
+ title: c,
20
+ message: o,
21
+ confirmLabel: f = "Confirm",
22
+ cancelLabel: m = "Cancel",
23
+ closeLabel: p = "Close",
24
+ variant: d = "default",
25
+ isLoading: r = !1,
26
+ testId: y,
27
+ children: C
28
+ }, g) {
29
+ const l = () => {
30
+ r || t();
31
+ };
32
+ return /* @__PURE__ */ n(
33
+ h,
34
+ {
35
+ ref: g,
36
+ isOpen: i,
37
+ onClose: l,
38
+ title: c,
39
+ size: "sm",
40
+ closeLabel: p,
41
+ closeOnOverlayClick: !r,
42
+ closeOnEscape: !r,
43
+ testId: y,
44
+ children: [
45
+ o && /* @__PURE__ */ e("p", { style: k, children: o }),
46
+ C,
47
+ /* @__PURE__ */ n("div", { style: u, className: "brycks-confirm-dialog__footer", children: [
48
+ /* @__PURE__ */ e(s, { size: "sm", variant: "ghost", onClick: l, isDisabled: r, children: m }),
49
+ /* @__PURE__ */ e(
50
+ s,
51
+ {
52
+ size: "sm",
53
+ intent: d === "danger" ? "error" : "primary",
54
+ onClick: a,
55
+ isLoading: r,
56
+ children: f
57
+ }
58
+ )
59
+ ] })
60
+ ]
61
+ }
62
+ );
63
+ });
64
+ v.displayName = "ConfirmDialog";
65
+ export {
66
+ v as ConfirmDialog
67
+ };
68
+ //# sourceMappingURL=ConfirmDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmDialog.js","sources":["../../../../src/components/feedback/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["/**\n * ConfirmDialog Component\n *\n * A small confirmation dialog built on top of Modal. Asks the user to confirm\n * or cancel an action, with an optional destructive (`danger`) styling and a\n * loading state for async confirmations.\n *\n * The component is i18n-agnostic: button labels default to English and should be\n * passed in by the consuming app when localization is needed.\n */\n\nimport {\n forwardRef,\n type ReactNode,\n type CSSProperties,\n} from 'react'\nimport { Modal } from '../Modal'\nimport { Button } from '../../primitives/Button'\n\nexport type ConfirmDialogVariant = 'default' | 'danger'\n\nexport interface ConfirmDialogProps {\n /** Whether the dialog is open */\n isOpen: boolean\n /** Callback when the dialog should close (cancel / overlay / escape) */\n onClose: () => void\n /** Callback when the user confirms */\n onConfirm: () => void\n /** Dialog title */\n title: ReactNode\n /** Body message (use `children` for richer content) */\n message?: ReactNode\n /** Label of the confirm button */\n confirmLabel?: string\n /** Label of the cancel button */\n cancelLabel?: string\n /** Accessible label of the modal close button */\n closeLabel?: string\n /** Visual variant — `danger` for destructive actions */\n variant?: ConfirmDialogVariant\n /** Whether the confirm action is in progress (disables cancel, spins confirm) */\n isLoading?: boolean\n /** Test ID */\n testId?: string\n /** Richer body content (rendered below `message`) */\n children?: ReactNode\n}\n\nconst messageStyle: CSSProperties = {\n margin: 0,\n fontSize: 'var(--brycks-fs-body-base)',\n lineHeight: 1.5,\n color: 'var(--brycks-foreground-default)',\n}\n\nconst footerStyle: CSSProperties = {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 'var(--brycks-spacing-2, 8px)',\n marginTop: 'var(--brycks-spacing-6, 24px)',\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, ConfirmDialogProps>(function ConfirmDialog(\n {\n isOpen,\n onClose,\n onConfirm,\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n closeLabel = 'Close',\n variant = 'default',\n isLoading = false,\n testId,\n children,\n },\n ref\n) {\n // Block close while the async confirm is running.\n const handleClose = () => {\n if (!isLoading) onClose()\n }\n\n return (\n <Modal\n ref={ref}\n isOpen={isOpen}\n onClose={handleClose}\n title={title}\n size=\"sm\"\n closeLabel={closeLabel}\n closeOnOverlayClick={!isLoading}\n closeOnEscape={!isLoading}\n testId={testId}\n >\n {message && <p style={messageStyle}>{message}</p>}\n {children}\n <div style={footerStyle} className=\"brycks-confirm-dialog__footer\">\n <Button size=\"sm\" variant=\"ghost\" onClick={handleClose} isDisabled={isLoading}>\n {cancelLabel}\n </Button>\n <Button\n size=\"sm\"\n intent={variant === 'danger' ? 'error' : 'primary'}\n onClick={onConfirm}\n isLoading={isLoading}\n >\n {confirmLabel}\n </Button>\n </div>\n </Modal>\n )\n})\n\nConfirmDialog.displayName = 'ConfirmDialog'\n"],"names":["messageStyle","footerStyle","ConfirmDialog","forwardRef","isOpen","onClose","onConfirm","title","message","confirmLabel","cancelLabel","closeLabel","variant","isLoading","testId","children","ref","handleClose","jsxs","Modal","jsx","Button"],"mappings":";;;;AAgDA,MAAMA,IAA8B;AAAA,EAClC,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AACT,GAEMC,IAA6B;AAAA,EACjC,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,KAAK;AAAA,EACL,WAAW;AACb,GAEaC,IAAgBC,EAA+C,SAC1E;AAAA,EACE,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,UAAAC;AACF,GACAC,GACA;AAEA,QAAMC,IAAc,MAAM;AACxB,IAAKJ,KAAWR,EAAA;AAAA,EAClB;AAEA,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,QAAAZ;AAAA,MACA,SAASa;AAAA,MACT,OAAAV;AAAA,MACA,MAAK;AAAA,MACL,YAAAI;AAAA,MACA,qBAAqB,CAACE;AAAA,MACtB,eAAe,CAACA;AAAA,MAChB,QAAAC;AAAA,MAEC,UAAA;AAAA,QAAAN,KAAW,gBAAAY,EAAC,KAAA,EAAE,OAAOpB,GAAe,UAAAQ,GAAQ;AAAA,QAC5CO;AAAA,QACD,gBAAAG,EAAC,OAAA,EAAI,OAAOjB,GAAa,WAAU,iCACjC,UAAA;AAAA,UAAA,gBAAAmB,EAACC,GAAA,EAAO,MAAK,MAAK,SAAQ,SAAQ,SAASJ,GAAa,YAAYJ,GACjE,UAAAH,EAAA,CACH;AAAA,UACA,gBAAAU;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,QAAQT,MAAY,WAAW,UAAU;AAAA,cACzC,SAASN;AAAA,cACT,WAAAO;AAAA,cAEC,UAAAJ;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAEDP,EAAc,cAAc;"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),X=require("react-dom"),Y=require("../../../utils/styles.cjs"),K={sm:"320px",md:"400px",lg:"560px",xl:"720px",full:"100%"};function W(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:r.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const x=t.forwardRef(function({isOpen:s,onClose:n,placement:o="right",size:u="md",title:c,closeOnOverlayClick:f=!0,closeOnEscape:y=!0,showCloseButton:b=!0,showOverlay:p=!0,className:j,style:S,children:E,testId:D,...R},l){const i=t.useRef(null),m=t.useRef(null),k=t.useRef(n);t.useEffect(()=>{k.current=n},[n]),t.useEffect(()=>{if(!s)return;m.current=document.activeElement;const e=i.current;e&&e.focus()},[s]),t.useEffect(()=>{if(!s)return;const e=i.current,v=a=>{if(a.key==="Escape"&&y){k.current();return}if(a.key==="Tab"&&e){const d=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),h=d[0],g=d[d.length-1];a.shiftKey&&document.activeElement===h?(a.preventDefault(),g?.focus()):!a.shiftKey&&document.activeElement===g&&(a.preventDefault(),h?.focus())}};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow="",m.current?.focus()}},[s,y]);const C=t.useCallback(e=>{e.target===e.currentTarget&&f&&n()},[f,n]);if(!s)return null;const T=o==="left"||o==="right",w=K[u],z={position:"fixed",inset:0,zIndex:"var(--brycks-z-drawer)",display:"flex",backgroundColor:p?"var(--brycks-background-overlay)":"transparent",animation:"brycks-drawer-overlay-in 200ms ease-out"},M={...(()=>{const e={position:"absolute",backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden"};return T?{...e,top:0,bottom:0,[o]:0,width:w,maxWidth:"100vw"}:{...e,left:0,right:0,[o]:0,height:w,maxHeight:"100vh"}})(),animation:`brycks-drawer-${o}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,outline:"none",...S},N={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--brycks-border-muted)",flexShrink:0},q={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0},I={display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out"},L={flex:1,overflow:"auto",padding:20},P=r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),K=require("react-dom"),W=require("../../../utils/styles.cjs"),$=require("../../../hooks/useId.cjs"),A={sm:"320px",md:"400px",lg:"560px",xl:"720px",full:"100%"};function B(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const p=t.forwardRef(function({isOpen:s,onClose:n,placement:o="right",size:u="md",title:c,closeOnOverlayClick:f=!0,closeOnEscape:y=!0,showCloseButton:b=!0,closeLabel:j="Close drawer",showOverlay:S=!0,className:E,style:D,children:R,testId:C,...I},l){const d=t.useRef(null),m=$.useId("drawer-title"),k=t.useRef(null),v=t.useRef(n);t.useEffect(()=>{v.current=n},[n]),t.useEffect(()=>{if(!s)return;k.current=document.activeElement;const e=d.current;e&&e.focus()},[s]),t.useEffect(()=>{if(!s)return;const e=d.current,h=a=>{if(a.key==="Escape"&&y){v.current();return}if(a.key==="Tab"&&e){const i=e.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])'),g=i[0],x=i[i.length-1];a.shiftKey&&document.activeElement===g?(a.preventDefault(),x?.focus()):!a.shiftKey&&document.activeElement===x&&(a.preventDefault(),g?.focus())}};return document.addEventListener("keydown",h),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",h),document.body.style.overflow="",k.current?.focus()}},[s,y]);const T=t.useCallback(e=>{e.target===e.currentTarget&&f&&n()},[f,n]);if(!s)return null;const q=o==="left"||o==="right",w=A[u],z={position:"fixed",inset:0,zIndex:"var(--brycks-z-drawer)",display:"flex",backgroundColor:S?"var(--brycks-background-overlay)":"transparent",animation:"brycks-drawer-overlay-in 200ms ease-out"},M={...(()=>{const e={position:"absolute",backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden"};return q?{...e,top:0,bottom:0,[o]:0,width:w,maxWidth:"100vw"}:{...e,left:0,right:0,[o]:0,height:w,maxHeight:"100vh"}})(),animation:`brycks-drawer-${o}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,outline:"none",...D},N={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--brycks-border-muted)",flexShrink:0},L={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0},P={display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out"},X={flex:1,overflow:"auto",padding:20},Y=r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`
2
2
  @keyframes brycks-drawer-overlay-in {
3
3
  from { opacity: 0; }
4
4
  to { opacity: 1; }
@@ -19,5 +19,5 @@
19
19
  from { transform: translateY(100%); }
20
20
  to { transform: translateY(0); }
21
21
  }
22
- `}),r.jsx("div",{className:"brycks-drawer-overlay",style:z,onClick:C,"aria-hidden":"true",children:r.jsxs("div",{ref:e=>{i.current=e,typeof l=="function"?l(e):l&&(l.current=e)},role:"dialog","aria-modal":"true","aria-labelledby":c?"brycks-drawer-title":void 0,className:Y.cx("brycks-drawer",`brycks-drawer--${o}`,`brycks-drawer--${u}`,j),style:M,tabIndex:-1,"data-testid":D,...R,children:[(c||b)&&r.jsxs("div",{className:"brycks-drawer-header",style:N,children:[c&&r.jsx("h2",{id:"brycks-drawer-title",style:q,children:c}),b&&r.jsx("button",{type:"button",className:"brycks-drawer-close",style:I,onClick:n,"aria-label":"Close drawer",onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--brycks-background-muted)",e.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--brycks-foreground-muted)"},children:r.jsx(W,{})})]}),r.jsx("div",{className:"brycks-drawer-content",style:L,children:E})]})})]});return X.createPortal(P,document.body)});x.displayName="Drawer";exports.Drawer=x;
22
+ `}),r.jsx("div",{className:"brycks-drawer-overlay",style:z,onClick:T,children:r.jsxs("div",{ref:e=>{d.current=e,typeof l=="function"?l(e):l&&(l.current=e)},role:"dialog","aria-modal":"true","aria-labelledby":c?m:void 0,className:W.cx("brycks-drawer",`brycks-drawer--${o}`,`brycks-drawer--${u}`,E),style:M,tabIndex:-1,"data-testid":C,...I,children:[(c||b)&&r.jsxs("div",{className:"brycks-drawer-header",style:N,children:[c&&r.jsx("h2",{id:m,style:L,children:c}),b&&r.jsx("button",{type:"button",className:"brycks-drawer-close",style:P,onClick:n,"aria-label":j,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--brycks-background-muted)",e.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--brycks-foreground-muted)"},children:r.jsx(B,{})})]}),r.jsx("div",{className:"brycks-drawer-content",style:X,children:R})]})})]});return K.createPortal(Y,document.body)});p.displayName="Drawer";exports.Drawer=p;
23
23
  //# sourceMappingURL=Drawer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.cjs","sources":["../../../../src/components/feedback/Drawer/Drawer.tsx"],"sourcesContent":["/**\n * Drawer Component\n *\n * A slide-out panel that can appear from any edge of the screen.\n * Supports focus trapping and keyboard navigation.\n */\n\nimport {\n forwardRef,\n useEffect,\n useRef,\n useCallback,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { cx } from '../../../utils/styles'\n\nexport type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom'\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Whether the drawer is open */\n isOpen: boolean\n /** Callback when drawer should close */\n onClose: () => void\n /** Drawer placement */\n placement?: DrawerPlacement\n /** Drawer size */\n size?: DrawerSize\n /** Drawer title */\n title?: ReactNode\n /** Whether to close on overlay click */\n closeOnOverlayClick?: boolean\n /** Whether to close on escape key */\n closeOnEscape?: boolean\n /** Whether to show close button */\n showCloseButton?: boolean\n /** Whether to show overlay */\n showOverlay?: boolean\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeMap: Record<DrawerSize, string> = {\n sm: '320px',\n md: '400px',\n lg: '560px',\n xl: '720px',\n full: '100%',\n}\n\nfunction CloseIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path d=\"M4 4l8 8M12 4l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n onClose,\n placement = 'right',\n size = 'md',\n title,\n closeOnOverlayClick = true,\n closeOnEscape = true,\n showCloseButton = true,\n showOverlay = true,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const drawerRef = useRef<HTMLDivElement>(null)\n const previousActiveElement = useRef<HTMLElement | null>(null)\n\n // Store onClose in a ref to avoid re-running effects when it changes\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n // Focus drawer when it opens (only once)\n useEffect(() => {\n if (!isOpen) return\n\n previousActiveElement.current = document.activeElement as HTMLElement\n const drawer = drawerRef.current\n if (drawer) {\n drawer.focus()\n }\n }, [isOpen])\n\n // Keyboard handling and body scroll lock\n useEffect(() => {\n if (!isOpen) return\n\n const drawer = drawerRef.current\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onCloseRef.current()\n return\n }\n\n if (e.key === 'Tab' && drawer) {\n const focusableElements = drawer.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n document.body.style.overflow = 'hidden'\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n document.body.style.overflow = ''\n previousActiveElement.current?.focus()\n }\n }, [isOpen, closeOnEscape])\n\n const handleOverlayClick = useCallback(\n (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose()\n }\n },\n [closeOnOverlayClick, onClose]\n )\n\n if (!isOpen) return null\n\n const isHorizontal = placement === 'left' || placement === 'right'\n const drawerSize = sizeMap[size]\n\n const overlayStyle: CSSProperties = {\n position: 'fixed',\n inset: 0,\n zIndex: 'var(--brycks-z-drawer)' as unknown as number,\n display: 'flex',\n backgroundColor: showOverlay ? 'var(--brycks-background-overlay)' : 'transparent',\n animation: 'brycks-drawer-overlay-in 200ms ease-out',\n }\n\n const getPositionStyles = (): CSSProperties => {\n const base: CSSProperties = {\n position: 'absolute',\n backgroundColor: 'var(--brycks-background-elevated)',\n boxShadow: 'var(--brycks-shadow-2xl)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n }\n\n if (isHorizontal) {\n return {\n ...base,\n top: 0,\n bottom: 0,\n [placement]: 0,\n width: drawerSize,\n maxWidth: '100vw',\n }\n }\n\n return {\n ...base,\n left: 0,\n right: 0,\n [placement]: 0,\n height: drawerSize,\n maxHeight: '100vh',\n }\n }\n\n const drawerStyle: CSSProperties = {\n ...getPositionStyles(),\n animation: `brycks-drawer-${placement}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,\n outline: 'none',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontSize: 18,\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n margin: 0,\n }\n\n const closeButtonStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 32,\n height: 32,\n borderRadius: 'var(--brycks-radius-md)',\n color: 'var(--brycks-foreground-muted)',\n transition: 'all 150ms ease-out',\n }\n\n const contentStyle: CSSProperties = {\n flex: 1,\n overflow: 'auto',\n padding: 20,\n }\n\n const drawerContent = (\n <>\n <style>\n {`\n @keyframes brycks-drawer-overlay-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes brycks-drawer-left-in {\n from { transform: translateX(-100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-right-in {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-top-in {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n @keyframes brycks-drawer-bottom-in {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n `}\n </style>\n <div\n className=\"brycks-drawer-overlay\"\n style={overlayStyle}\n onClick={handleOverlayClick}\n aria-hidden=\"true\"\n >\n <div\n ref={(node) => {\n (drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? 'brycks-drawer-title' : undefined}\n className={cx('brycks-drawer', `brycks-drawer--${placement}`, `brycks-drawer--${size}`, className)}\n style={drawerStyle}\n tabIndex={-1}\n data-testid={testId}\n {...props}\n >\n {(title || showCloseButton) && (\n <div className=\"brycks-drawer-header\" style={headerStyle}>\n {title && <h2 id=\"brycks-drawer-title\" style={titleStyle}>{title}</h2>}\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"brycks-drawer-close\"\n style={closeButtonStyle}\n onClick={onClose}\n aria-label=\"Close drawer\"\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = 'var(--brycks-background-muted)'\n e.currentTarget.style.color = 'var(--brycks-foreground-default)'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = 'transparent'\n e.currentTarget.style.color = 'var(--brycks-foreground-muted)'\n }}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n )}\n <div className=\"brycks-drawer-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n </div>\n </>\n )\n\n return createPortal(drawerContent, document.body)\n})\n\nDrawer.displayName = 'Drawer'\n"],"names":["sizeMap","CloseIcon","jsx","Drawer","forwardRef","isOpen","onClose","placement","size","title","closeOnOverlayClick","closeOnEscape","showCloseButton","showOverlay","className","style","children","testId","props","ref","drawerRef","useRef","previousActiveElement","onCloseRef","useEffect","drawer","handleKeyDown","e","focusableElements","firstElement","lastElement","handleOverlayClick","useCallback","isHorizontal","drawerSize","overlayStyle","drawerStyle","base","headerStyle","titleStyle","closeButtonStyle","contentStyle","drawerContent","jsxs","Fragment","node","cx","createPortal"],"mappings":"sMA+CMA,EAAsC,CAC1C,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,KAAM,MACR,EAEA,SAASC,GAAY,CACnB,OACEC,MAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACnD,eAAC,OAAA,CAAK,EAAE,qBAAqB,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,CAAA,CAC7F,CAEJ,CAEO,MAAMC,EAASC,EAAAA,WAAwC,SAC5D,CACE,OAAAC,EACA,QAAAC,EACA,UAAAC,EAAY,QACZ,KAAAC,EAAO,KACP,MAAAC,EACA,oBAAAC,EAAsB,GACtB,cAAAC,EAAgB,GAChB,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AAAA;AAAA,UAsBH,EACAA,EAAAA,IAAC,MAAA,CACC,UAAU,wBACV,MAAOiC,EACP,QAASJ,EACT,cAAY,OAEZ,SAAAY,EAAAA,KAAC,MAAA,CACC,IAAME,GAAS,CACZzB,EAA4D,QAAUyB,EACnE,OAAO1B,GAAQ,WAAYA,EAAI0B,CAAI,EAC9B1B,MAAS,QAAU0B,EAC9B,EACA,KAAK,SACL,aAAW,OACX,kBAAiBpC,EAAQ,sBAAwB,OACjD,UAAWqC,EAAAA,GAAG,gBAAiB,kBAAkBvC,CAAS,GAAI,kBAAkBC,CAAI,GAAIM,CAAS,EACjG,MAAOsB,EACP,SAAU,GACV,cAAanB,EACZ,GAAGC,EAEF,SAAA,EAAAT,GAASG,IACT+B,EAAAA,KAAC,MAAA,CAAI,UAAU,uBAAuB,MAAOL,EAC1C,SAAA,CAAA7B,SAAU,KAAA,CAAG,GAAG,sBAAsB,MAAO8B,EAAa,SAAA9B,EAAM,EAChEG,GACCV,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,sBACV,MAAOsC,EACP,QAASlC,EACT,aAAW,eACX,aAAe,GAAM,CACnB,EAAE,cAAc,MAAM,gBAAkB,iCACxC,EAAE,cAAc,MAAM,MAAQ,kCAChC,EACA,aAAe,GAAM,CACnB,EAAE,cAAc,MAAM,gBAAkB,cACxC,EAAE,cAAc,MAAM,MAAQ,gCAChC,EAEA,eAACL,EAAA,CAAA,CAAU,CAAA,CAAA,CACb,EAEJ,QAED,MAAA,CAAI,UAAU,wBAAwB,MAAOwC,EAC3C,SAAAzB,CAAA,CACH,CAAA,CAAA,CAAA,CACF,CAAA,CACF,EACF,EAGF,OAAO+B,eAAaL,EAAe,SAAS,IAAI,CAClD,CAAC,EAEDvC,EAAO,YAAc"}
1
+ {"version":3,"file":"Drawer.cjs","sources":["../../../../src/components/feedback/Drawer/Drawer.tsx"],"sourcesContent":["/**\n * Drawer Component\n *\n * A slide-out panel that can appear from any edge of the screen.\n * Supports focus trapping and keyboard navigation.\n */\n\nimport {\n forwardRef,\n useEffect,\n useRef,\n useCallback,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom'\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Whether the drawer is open */\n isOpen: boolean\n /** Callback when drawer should close */\n onClose: () => void\n /** Drawer placement */\n placement?: DrawerPlacement\n /** Drawer size */\n size?: DrawerSize\n /** Drawer title */\n title?: ReactNode\n /** Whether to close on overlay click */\n closeOnOverlayClick?: boolean\n /** Whether to close on escape key */\n closeOnEscape?: boolean\n /** Whether to show close button */\n showCloseButton?: boolean\n /** Accessible label of the close button */\n closeLabel?: string\n /** Whether to show overlay */\n showOverlay?: boolean\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeMap: Record<DrawerSize, string> = {\n sm: '320px',\n md: '400px',\n lg: '560px',\n xl: '720px',\n full: '100%',\n}\n\nfunction CloseIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M4 4l8 8M12 4l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n onClose,\n placement = 'right',\n size = 'md',\n title,\n closeOnOverlayClick = true,\n closeOnEscape = true,\n showCloseButton = true,\n closeLabel = 'Close drawer',\n showOverlay = true,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const drawerRef = useRef<HTMLDivElement>(null)\n const titleId = useId('drawer-title')\n const previousActiveElement = useRef<HTMLElement | null>(null)\n\n // Store onClose in a ref to avoid re-running effects when it changes\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n // Focus drawer when it opens (only once)\n useEffect(() => {\n if (!isOpen) return\n\n previousActiveElement.current = document.activeElement as HTMLElement\n const drawer = drawerRef.current\n if (drawer) {\n drawer.focus()\n }\n }, [isOpen])\n\n // Keyboard handling and body scroll lock\n useEffect(() => {\n if (!isOpen) return\n\n const drawer = drawerRef.current\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onCloseRef.current()\n return\n }\n\n if (e.key === 'Tab' && drawer) {\n const focusableElements = drawer.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n document.body.style.overflow = 'hidden'\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n document.body.style.overflow = ''\n previousActiveElement.current?.focus()\n }\n }, [isOpen, closeOnEscape])\n\n const handleOverlayClick = useCallback(\n (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose()\n }\n },\n [closeOnOverlayClick, onClose]\n )\n\n if (!isOpen) return null\n\n const isHorizontal = placement === 'left' || placement === 'right'\n const drawerSize = sizeMap[size]\n\n const overlayStyle: CSSProperties = {\n position: 'fixed',\n inset: 0,\n zIndex: 'var(--brycks-z-drawer)' as unknown as number,\n display: 'flex',\n backgroundColor: showOverlay ? 'var(--brycks-background-overlay)' : 'transparent',\n animation: 'brycks-drawer-overlay-in 200ms ease-out',\n }\n\n const getPositionStyles = (): CSSProperties => {\n const base: CSSProperties = {\n position: 'absolute',\n backgroundColor: 'var(--brycks-background-elevated)',\n boxShadow: 'var(--brycks-shadow-2xl)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n }\n\n if (isHorizontal) {\n return {\n ...base,\n top: 0,\n bottom: 0,\n [placement]: 0,\n width: drawerSize,\n maxWidth: '100vw',\n }\n }\n\n return {\n ...base,\n left: 0,\n right: 0,\n [placement]: 0,\n height: drawerSize,\n maxHeight: '100vh',\n }\n }\n\n const drawerStyle: CSSProperties = {\n ...getPositionStyles(),\n animation: `brycks-drawer-${placement}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,\n outline: 'none',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontSize: 18,\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n margin: 0,\n }\n\n const closeButtonStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 32,\n height: 32,\n borderRadius: 'var(--brycks-radius-md)',\n color: 'var(--brycks-foreground-muted)',\n transition: 'all 150ms ease-out',\n }\n\n const contentStyle: CSSProperties = {\n flex: 1,\n overflow: 'auto',\n padding: 20,\n }\n\n const drawerContent = (\n <>\n <style>\n {`\n @keyframes brycks-drawer-overlay-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes brycks-drawer-left-in {\n from { transform: translateX(-100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-right-in {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-top-in {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n @keyframes brycks-drawer-bottom-in {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n `}\n </style>\n <div\n className=\"brycks-drawer-overlay\"\n style={overlayStyle}\n onClick={handleOverlayClick}\n >\n <div\n ref={(node) => {\n (drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n className={cx('brycks-drawer', `brycks-drawer--${placement}`, `brycks-drawer--${size}`, className)}\n style={drawerStyle}\n tabIndex={-1}\n data-testid={testId}\n {...props}\n >\n {(title || showCloseButton) && (\n <div className=\"brycks-drawer-header\" style={headerStyle}>\n {title && <h2 id={titleId} style={titleStyle}>{title}</h2>}\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"brycks-drawer-close\"\n style={closeButtonStyle}\n onClick={onClose}\n aria-label={closeLabel}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = 'var(--brycks-background-muted)'\n e.currentTarget.style.color = 'var(--brycks-foreground-default)'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = 'transparent'\n e.currentTarget.style.color = 'var(--brycks-foreground-muted)'\n }}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n )}\n <div className=\"brycks-drawer-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n </div>\n </>\n )\n\n return createPortal(drawerContent, document.body)\n})\n\nDrawer.displayName = 'Drawer'\n"],"names":["sizeMap","CloseIcon","jsx","Drawer","forwardRef","isOpen","onClose","placement","size","title","closeOnOverlayClick","closeOnEscape","showCloseButton","closeLabel","showOverlay","className","style","children","testId","props","ref","drawerRef","useRef","titleId","useId","previousActiveElement","onCloseRef","useEffect","drawer","handleKeyDown","e","focusableElements","firstElement","lastElement","handleOverlayClick","useCallback","isHorizontal","drawerSize","overlayStyle","drawerStyle","base","headerStyle","titleStyle","closeButtonStyle","contentStyle","drawerContent","jsxs","Fragment","node","cx","createPortal"],"mappings":"4OAkDMA,EAAsC,CAC1C,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,Q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,cAAc,MAAM,gBAAkB,cACxC,EAAE,cAAc,MAAM,MAAQ,gCAChC,EAEA,eAACZ,EAAA,CAAA,CAAU,CAAA,CAAA,CACb,EAEJ,QAED,MAAA,CAAI,UAAU,wBAAwB,MAAO2C,EAC3C,SAAA3B,CAAA,CACH,CAAA,CAAA,CAAA,CACF,CAAA,CACF,EACF,EAGF,OAAOiC,eAAaL,EAAe,SAAS,IAAI,CAClD,CAAC,EAED1C,EAAO,YAAc"}
@@ -1,18 +1,19 @@
1
- import { jsxs as d, Fragment as P, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as W, useRef as u, useEffect as f, useCallback as $ } from "react";
3
- import { createPortal as A } from "react-dom";
4
- import { cx as B } from "../../../utils/styles.js";
5
- const H = {
1
+ import { jsxs as c, Fragment as $, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as A, useRef as u, useEffect as f, useCallback as B } from "react";
3
+ import { createPortal as H } from "react-dom";
4
+ import { cx as q } from "../../../utils/styles.js";
5
+ import { useId as F } from "../../../hooks/useId.js";
6
+ const G = {
6
7
  sm: "320px",
7
8
  md: "400px",
8
9
  lg: "560px",
9
10
  xl: "720px",
10
11
  full: "100%"
11
12
  };
12
- function q() {
13
- return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
13
+ function J() {
14
+ return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
14
15
  }
15
- const F = W(function({
16
+ const Q = A(function({
16
17
  isOpen: a,
17
18
  onClose: t,
18
19
  placement: o = "right",
@@ -21,54 +22,55 @@ const F = W(function({
21
22
  closeOnOverlayClick: m = !0,
22
23
  closeOnEscape: b = !0,
23
24
  showCloseButton: k = !0,
24
- showOverlay: S = !0,
25
- className: E,
26
- style: C,
27
- children: D,
28
- testId: z,
29
- ...N
25
+ closeLabel: E = "Close drawer",
26
+ showOverlay: C = !0,
27
+ className: D,
28
+ style: I,
29
+ children: z,
30
+ testId: N,
31
+ ...T
30
32
  }, l) {
31
- const c = u(null), w = u(null), h = u(t);
33
+ const d = u(null), h = F("drawer-title"), v = u(null), w = u(t);
32
34
  f(() => {
33
- h.current = t;
35
+ w.current = t;
34
36
  }, [t]), f(() => {
35
37
  if (!a) return;
36
- w.current = document.activeElement;
37
- const r = c.current;
38
+ v.current = document.activeElement;
39
+ const r = d.current;
38
40
  r && r.focus();
39
41
  }, [a]), f(() => {
40
42
  if (!a) return;
41
- const r = c.current, g = (n) => {
43
+ const r = d.current, x = (n) => {
42
44
  if (n.key === "Escape" && b) {
43
- h.current();
45
+ w.current();
44
46
  return;
45
47
  }
46
48
  if (n.key === "Tab" && r) {
47
49
  const i = r.querySelectorAll(
48
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
49
- ), x = i[0], p = i[i.length - 1];
50
- n.shiftKey && document.activeElement === x ? (n.preventDefault(), p?.focus()) : !n.shiftKey && document.activeElement === p && (n.preventDefault(), x?.focus());
50
+ 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])'
51
+ ), p = i[0], S = i[i.length - 1];
52
+ n.shiftKey && document.activeElement === p ? (n.preventDefault(), S?.focus()) : !n.shiftKey && document.activeElement === S && (n.preventDefault(), p?.focus());
51
53
  }
52
54
  };
53
- return document.addEventListener("keydown", g), document.body.style.overflow = "hidden", () => {
54
- document.removeEventListener("keydown", g), document.body.style.overflow = "", w.current?.focus();
55
+ return document.addEventListener("keydown", x), document.body.style.overflow = "hidden", () => {
56
+ document.removeEventListener("keydown", x), document.body.style.overflow = "", v.current?.focus();
55
57
  };
56
58
  }, [a, b]);
57
- const T = $(
59
+ const M = B(
58
60
  (r) => {
59
61
  r.target === r.currentTarget && m && t();
60
62
  },
61
63
  [m, t]
62
64
  );
63
65
  if (!a) return null;
64
- const I = o === "left" || o === "right", v = H[y], M = {
66
+ const R = o === "left" || o === "right", g = G[y], j = {
65
67
  position: "fixed",
66
68
  inset: 0,
67
69
  zIndex: "var(--brycks-z-drawer)",
68
70
  display: "flex",
69
- backgroundColor: S ? "var(--brycks-background-overlay)" : "transparent",
71
+ backgroundColor: C ? "var(--brycks-background-overlay)" : "transparent",
70
72
  animation: "brycks-drawer-overlay-in 200ms ease-out"
71
- }, R = {
73
+ }, L = {
72
74
  ...(() => {
73
75
  const r = {
74
76
  position: "absolute",
@@ -78,38 +80,38 @@ const F = W(function({
78
80
  flexDirection: "column",
79
81
  overflow: "hidden"
80
82
  };
81
- return I ? {
83
+ return R ? {
82
84
  ...r,
83
85
  top: 0,
84
86
  bottom: 0,
85
87
  [o]: 0,
86
- width: v,
88
+ width: g,
87
89
  maxWidth: "100vw"
88
90
  } : {
89
91
  ...r,
90
92
  left: 0,
91
93
  right: 0,
92
94
  [o]: 0,
93
- height: v,
95
+ height: g,
94
96
  maxHeight: "100vh"
95
97
  };
96
98
  })(),
97
99
  animation: `brycks-drawer-${o}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,
98
100
  outline: "none",
99
- ...C
100
- }, j = {
101
+ ...I
102
+ }, X = {
101
103
  display: "flex",
102
104
  alignItems: "center",
103
105
  justifyContent: "space-between",
104
106
  padding: "16px 20px",
105
107
  borderBottom: "1px solid var(--brycks-border-muted)",
106
108
  flexShrink: 0
107
- }, L = {
109
+ }, Y = {
108
110
  fontSize: 18,
109
111
  fontWeight: 600,
110
112
  color: "var(--brycks-foreground-default)",
111
113
  margin: 0
112
- }, X = {
114
+ }, K = {
113
115
  display: "flex",
114
116
  alignItems: "center",
115
117
  justifyContent: "center",
@@ -118,11 +120,11 @@ const F = W(function({
118
120
  borderRadius: "var(--brycks-radius-md)",
119
121
  color: "var(--brycks-foreground-muted)",
120
122
  transition: "all 150ms ease-out"
121
- }, Y = {
123
+ }, P = {
122
124
  flex: 1,
123
125
  overflow: "auto",
124
126
  padding: 20
125
- }, K = /* @__PURE__ */ d(P, { children: [
127
+ }, W = /* @__PURE__ */ c($, { children: [
126
128
  /* @__PURE__ */ e("style", { children: `
127
129
  @keyframes brycks-drawer-overlay-in {
128
130
  from { opacity: 0; }
@@ -149,55 +151,54 @@ const F = W(function({
149
151
  "div",
150
152
  {
151
153
  className: "brycks-drawer-overlay",
152
- style: M,
153
- onClick: T,
154
- "aria-hidden": "true",
155
- children: /* @__PURE__ */ d(
154
+ style: j,
155
+ onClick: M,
156
+ children: /* @__PURE__ */ c(
156
157
  "div",
157
158
  {
158
159
  ref: (r) => {
159
- c.current = r, typeof l == "function" ? l(r) : l && (l.current = r);
160
+ d.current = r, typeof l == "function" ? l(r) : l && (l.current = r);
160
161
  },
161
162
  role: "dialog",
162
163
  "aria-modal": "true",
163
- "aria-labelledby": s ? "brycks-drawer-title" : void 0,
164
- className: B("brycks-drawer", `brycks-drawer--${o}`, `brycks-drawer--${y}`, E),
165
- style: R,
164
+ "aria-labelledby": s ? h : void 0,
165
+ className: q("brycks-drawer", `brycks-drawer--${o}`, `brycks-drawer--${y}`, D),
166
+ style: L,
166
167
  tabIndex: -1,
167
- "data-testid": z,
168
- ...N,
168
+ "data-testid": N,
169
+ ...T,
169
170
  children: [
170
- (s || k) && /* @__PURE__ */ d("div", { className: "brycks-drawer-header", style: j, children: [
171
- s && /* @__PURE__ */ e("h2", { id: "brycks-drawer-title", style: L, children: s }),
171
+ (s || k) && /* @__PURE__ */ c("div", { className: "brycks-drawer-header", style: X, children: [
172
+ s && /* @__PURE__ */ e("h2", { id: h, style: Y, children: s }),
172
173
  k && /* @__PURE__ */ e(
173
174
  "button",
174
175
  {
175
176
  type: "button",
176
177
  className: "brycks-drawer-close",
177
- style: X,
178
+ style: K,
178
179
  onClick: t,
179
- "aria-label": "Close drawer",
180
+ "aria-label": E,
180
181
  onMouseEnter: (r) => {
181
182
  r.currentTarget.style.backgroundColor = "var(--brycks-background-muted)", r.currentTarget.style.color = "var(--brycks-foreground-default)";
182
183
  },
183
184
  onMouseLeave: (r) => {
184
185
  r.currentTarget.style.backgroundColor = "transparent", r.currentTarget.style.color = "var(--brycks-foreground-muted)";
185
186
  },
186
- children: /* @__PURE__ */ e(q, {})
187
+ children: /* @__PURE__ */ e(J, {})
187
188
  }
188
189
  )
189
190
  ] }),
190
- /* @__PURE__ */ e("div", { className: "brycks-drawer-content", style: Y, children: D })
191
+ /* @__PURE__ */ e("div", { className: "brycks-drawer-content", style: P, children: z })
191
192
  ]
192
193
  }
193
194
  )
194
195
  }
195
196
  )
196
197
  ] });
197
- return A(K, document.body);
198
+ return H(W, document.body);
198
199
  });
199
- F.displayName = "Drawer";
200
+ Q.displayName = "Drawer";
200
201
  export {
201
- F as Drawer
202
+ Q as Drawer
202
203
  };
203
204
  //# sourceMappingURL=Drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sources":["../../../../src/components/feedback/Drawer/Drawer.tsx"],"sourcesContent":["/**\n * Drawer Component\n *\n * A slide-out panel that can appear from any edge of the screen.\n * Supports focus trapping and keyboard navigation.\n */\n\nimport {\n forwardRef,\n useEffect,\n useRef,\n useCallback,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { cx } from '../../../utils/styles'\n\nexport type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom'\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Whether the drawer is open */\n isOpen: boolean\n /** Callback when drawer should close */\n onClose: () => void\n /** Drawer placement */\n placement?: DrawerPlacement\n /** Drawer size */\n size?: DrawerSize\n /** Drawer title */\n title?: ReactNode\n /** Whether to close on overlay click */\n closeOnOverlayClick?: boolean\n /** Whether to close on escape key */\n closeOnEscape?: boolean\n /** Whether to show close button */\n showCloseButton?: boolean\n /** Whether to show overlay */\n showOverlay?: boolean\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeMap: Record<DrawerSize, string> = {\n sm: '320px',\n md: '400px',\n lg: '560px',\n xl: '720px',\n full: '100%',\n}\n\nfunction CloseIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path d=\"M4 4l8 8M12 4l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n onClose,\n placement = 'right',\n size = 'md',\n title,\n closeOnOverlayClick = true,\n closeOnEscape = true,\n showCloseButton = true,\n showOverlay = true,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const drawerRef = useRef<HTMLDivElement>(null)\n const previousActiveElement = useRef<HTMLElement | null>(null)\n\n // Store onClose in a ref to avoid re-running effects when it changes\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n // Focus drawer when it opens (only once)\n useEffect(() => {\n if (!isOpen) return\n\n previousActiveElement.current = document.activeElement as HTMLElement\n const drawer = drawerRef.current\n if (drawer) {\n drawer.focus()\n }\n }, [isOpen])\n\n // Keyboard handling and body scroll lock\n useEffect(() => {\n if (!isOpen) return\n\n const drawer = drawerRef.current\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onCloseRef.current()\n return\n }\n\n if (e.key === 'Tab' && drawer) {\n const focusableElements = drawer.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n document.body.style.overflow = 'hidden'\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n document.body.style.overflow = ''\n previousActiveElement.current?.focus()\n }\n }, [isOpen, closeOnEscape])\n\n const handleOverlayClick = useCallback(\n (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose()\n }\n },\n [closeOnOverlayClick, onClose]\n )\n\n if (!isOpen) return null\n\n const isHorizontal = placement === 'left' || placement === 'right'\n const drawerSize = sizeMap[size]\n\n const overlayStyle: CSSProperties = {\n position: 'fixed',\n inset: 0,\n zIndex: 'var(--brycks-z-drawer)' as unknown as number,\n display: 'flex',\n backgroundColor: showOverlay ? 'var(--brycks-background-overlay)' : 'transparent',\n animation: 'brycks-drawer-overlay-in 200ms ease-out',\n }\n\n const getPositionStyles = (): CSSProperties => {\n const base: CSSProperties = {\n position: 'absolute',\n backgroundColor: 'var(--brycks-background-elevated)',\n boxShadow: 'var(--brycks-shadow-2xl)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n }\n\n if (isHorizontal) {\n return {\n ...base,\n top: 0,\n bottom: 0,\n [placement]: 0,\n width: drawerSize,\n maxWidth: '100vw',\n }\n }\n\n return {\n ...base,\n left: 0,\n right: 0,\n [placement]: 0,\n height: drawerSize,\n maxHeight: '100vh',\n }\n }\n\n const drawerStyle: CSSProperties = {\n ...getPositionStyles(),\n animation: `brycks-drawer-${placement}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,\n outline: 'none',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontSize: 18,\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n margin: 0,\n }\n\n const closeButtonStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 32,\n height: 32,\n borderRadius: 'var(--brycks-radius-md)',\n color: 'var(--brycks-foreground-muted)',\n transition: 'all 150ms ease-out',\n }\n\n const contentStyle: CSSProperties = {\n flex: 1,\n overflow: 'auto',\n padding: 20,\n }\n\n const drawerContent = (\n <>\n <style>\n {`\n @keyframes brycks-drawer-overlay-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes brycks-drawer-left-in {\n from { transform: translateX(-100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-right-in {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-top-in {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n @keyframes brycks-drawer-bottom-in {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n `}\n </style>\n <div\n className=\"brycks-drawer-overlay\"\n style={overlayStyle}\n onClick={handleOverlayClick}\n aria-hidden=\"true\"\n >\n <div\n ref={(node) => {\n (drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? 'brycks-drawer-title' : undefined}\n className={cx('brycks-drawer', `brycks-drawer--${placement}`, `brycks-drawer--${size}`, className)}\n style={drawerStyle}\n tabIndex={-1}\n data-testid={testId}\n {...props}\n >\n {(title || showCloseButton) && (\n <div className=\"brycks-drawer-header\" style={headerStyle}>\n {title && <h2 id=\"brycks-drawer-title\" style={titleStyle}>{title}</h2>}\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"brycks-drawer-close\"\n style={closeButtonStyle}\n onClick={onClose}\n aria-label=\"Close drawer\"\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = 'var(--brycks-background-muted)'\n e.currentTarget.style.color = 'var(--brycks-foreground-default)'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = 'transparent'\n e.currentTarget.style.color = 'var(--brycks-foreground-muted)'\n }}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n )}\n <div className=\"brycks-drawer-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n </div>\n </>\n )\n\n return createPortal(drawerContent, document.body)\n})\n\nDrawer.displayName = 'Drawer'\n"],"names":["sizeMap","CloseIcon","jsx","Drawer","forwardRef","isOpen","onClose","placement","size","title","closeOnOverlayClick","closeOnEscape","showCloseButton","showOverlay","className","style","children","testId","props","ref","drawerRef","useRef","previousActiveElement","onCloseRef","useEffect","drawer","handleKeyDown","e","focusableElements","firstElement","lastElement","handleOverlayClick","useCallback","isHorizontal","drawerSize","overlayStyle","drawerStyle","base","headerStyle","titleStyle","closeButtonStyle","contentStyle","drawerContent","jsxs","Fragment","node","cx","createPortal"],"mappings":";;;;AA+CA,MAAMA,IAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAEA,SAASC,IAAY;AACnB,SACE,gBAAAC,EAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QACnD,4BAAC,QAAA,EAAK,GAAE,sBAAqB,QAAO,gBAAe,aAAY,OAAM,eAAc,SAAQ,EAAA,CAC7F;AAEJ;AAEO,MAAMC,IAASC,EAAwC,SAC5D;AAAA,EACE,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,eAAAC,IAAgB;AAAA,EAChB,iBAAAC,IAAkB;AAAA,EAClB,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GACA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,CAACqB,MAAM;AACnB,sBAAAA,EAAE,cAAc,MAAM,kBAAkB,kCACxCA,EAAE,cAAc,MAAM,QAAQ;AAAA,oBAChC;AAAA,oBACA,cAAc,CAACA,MAAM;AACnB,sBAAAA,EAAE,cAAc,MAAM,kBAAkB,eACxCA,EAAE,cAAc,MAAM,QAAQ;AAAA,oBAChC;AAAA,oBAEA,4BAAC1B,GAAA,CAAA,CAAU;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACb,GAEJ;AAAA,gCAED,OAAA,EAAI,WAAU,yBAAwB,OAAOwC,GAC3C,UAAAzB,EAAA,CACH;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAGF,SAAO+B,EAAaL,GAAe,SAAS,IAAI;AAClD,CAAC;AAEDvC,EAAO,cAAc;"}
1
+ {"version":3,"file":"Drawer.js","sources":["../../../../src/components/feedback/Drawer/Drawer.tsx"],"sourcesContent":["/**\n * Drawer Component\n *\n * A slide-out panel that can appear from any edge of the screen.\n * Supports focus trapping and keyboard navigation.\n */\n\nimport {\n forwardRef,\n useEffect,\n useRef,\n useCallback,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom'\nexport type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\nexport interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Whether the drawer is open */\n isOpen: boolean\n /** Callback when drawer should close */\n onClose: () => void\n /** Drawer placement */\n placement?: DrawerPlacement\n /** Drawer size */\n size?: DrawerSize\n /** Drawer title */\n title?: ReactNode\n /** Whether to close on overlay click */\n closeOnOverlayClick?: boolean\n /** Whether to close on escape key */\n closeOnEscape?: boolean\n /** Whether to show close button */\n showCloseButton?: boolean\n /** Accessible label of the close button */\n closeLabel?: string\n /** Whether to show overlay */\n showOverlay?: boolean\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeMap: Record<DrawerSize, string> = {\n sm: '320px',\n md: '400px',\n lg: '560px',\n xl: '720px',\n full: '100%',\n}\n\nfunction CloseIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M4 4l8 8M12 4l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n isOpen,\n onClose,\n placement = 'right',\n size = 'md',\n title,\n closeOnOverlayClick = true,\n closeOnEscape = true,\n showCloseButton = true,\n closeLabel = 'Close drawer',\n showOverlay = true,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const drawerRef = useRef<HTMLDivElement>(null)\n const titleId = useId('drawer-title')\n const previousActiveElement = useRef<HTMLElement | null>(null)\n\n // Store onClose in a ref to avoid re-running effects when it changes\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n // Focus drawer when it opens (only once)\n useEffect(() => {\n if (!isOpen) return\n\n previousActiveElement.current = document.activeElement as HTMLElement\n const drawer = drawerRef.current\n if (drawer) {\n drawer.focus()\n }\n }, [isOpen])\n\n // Keyboard handling and body scroll lock\n useEffect(() => {\n if (!isOpen) return\n\n const drawer = drawerRef.current\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onCloseRef.current()\n return\n }\n\n if (e.key === 'Tab' && drawer) {\n const focusableElements = drawer.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n document.body.style.overflow = 'hidden'\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n document.body.style.overflow = ''\n previousActiveElement.current?.focus()\n }\n }, [isOpen, closeOnEscape])\n\n const handleOverlayClick = useCallback(\n (e: React.MouseEvent) => {\n if (e.target === e.currentTarget && closeOnOverlayClick) {\n onClose()\n }\n },\n [closeOnOverlayClick, onClose]\n )\n\n if (!isOpen) return null\n\n const isHorizontal = placement === 'left' || placement === 'right'\n const drawerSize = sizeMap[size]\n\n const overlayStyle: CSSProperties = {\n position: 'fixed',\n inset: 0,\n zIndex: 'var(--brycks-z-drawer)' as unknown as number,\n display: 'flex',\n backgroundColor: showOverlay ? 'var(--brycks-background-overlay)' : 'transparent',\n animation: 'brycks-drawer-overlay-in 200ms ease-out',\n }\n\n const getPositionStyles = (): CSSProperties => {\n const base: CSSProperties = {\n position: 'absolute',\n backgroundColor: 'var(--brycks-background-elevated)',\n boxShadow: 'var(--brycks-shadow-2xl)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden',\n }\n\n if (isHorizontal) {\n return {\n ...base,\n top: 0,\n bottom: 0,\n [placement]: 0,\n width: drawerSize,\n maxWidth: '100vw',\n }\n }\n\n return {\n ...base,\n left: 0,\n right: 0,\n [placement]: 0,\n height: drawerSize,\n maxHeight: '100vh',\n }\n }\n\n const drawerStyle: CSSProperties = {\n ...getPositionStyles(),\n animation: `brycks-drawer-${placement}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,\n outline: 'none',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontSize: 18,\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n margin: 0,\n }\n\n const closeButtonStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 32,\n height: 32,\n borderRadius: 'var(--brycks-radius-md)',\n color: 'var(--brycks-foreground-muted)',\n transition: 'all 150ms ease-out',\n }\n\n const contentStyle: CSSProperties = {\n flex: 1,\n overflow: 'auto',\n padding: 20,\n }\n\n const drawerContent = (\n <>\n <style>\n {`\n @keyframes brycks-drawer-overlay-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes brycks-drawer-left-in {\n from { transform: translateX(-100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-right-in {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes brycks-drawer-top-in {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n @keyframes brycks-drawer-bottom-in {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n `}\n </style>\n <div\n className=\"brycks-drawer-overlay\"\n style={overlayStyle}\n onClick={handleOverlayClick}\n >\n <div\n ref={(node) => {\n (drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n className={cx('brycks-drawer', `brycks-drawer--${placement}`, `brycks-drawer--${size}`, className)}\n style={drawerStyle}\n tabIndex={-1}\n data-testid={testId}\n {...props}\n >\n {(title || showCloseButton) && (\n <div className=\"brycks-drawer-header\" style={headerStyle}>\n {title && <h2 id={titleId} style={titleStyle}>{title}</h2>}\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"brycks-drawer-close\"\n style={closeButtonStyle}\n onClick={onClose}\n aria-label={closeLabel}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = 'var(--brycks-background-muted)'\n e.currentTarget.style.color = 'var(--brycks-foreground-default)'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = 'transparent'\n e.currentTarget.style.color = 'var(--brycks-foreground-muted)'\n }}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n )}\n <div className=\"brycks-drawer-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n </div>\n </>\n )\n\n return createPortal(drawerContent, document.body)\n})\n\nDrawer.displayName = 'Drawer'\n"],"names":["sizeMap","CloseIcon","jsx","Drawer","forwardRef","isOpen","onClose","placement","size","title","closeOnOverlayClick","closeOnEscape","showCloseButton","closeLabel","showOverlay","className","style","children","testId","props","ref","drawerRef","useRef","titleId","useId","previousActiveElement","onCloseRef","useEffect","drawer","handleKeyDown","e","focusableElements","firstElement","lastElement","handleOverlayClick","useCallback","isHorizontal","drawerSize","overlayStyle","drawerStyle","base","headerStyle","titleStyle","closeButtonStyle","contentStyle","drawerContent","jsxs","Fragment","node","cx","createPortal"],"mappings":";;;;;AAkDA,MAAMA,IAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAEA,SAASC,IAAY;AACnB,SACE,gBAAAC,EAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,eAAY,QACtE,UAAA,gBAAAA,EAAC,QAAA,EAAK,GAAE,sBAAqB,QAAO,gBAAe,aAAY,OAAM,eAAc,QAAA,CAAQ,EAAA,CAC7F;AAEJ;AAEO,MAAMC,IAASC,EAAwC,SAC5D;AAAA,EACE,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,eAAAC,IAAgB;AAAA,EAChB,iBAAAC,IAAkB;AAAA,EAClB,YAAAC,IAAa;AAAA,EACb,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,E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AU;AAAA,oBACV,OAAOyC;AAAA,oBACP,SAASrC;AAAA,oBACT,cAAYO;AAAA,oBACZ,cAAc,CAACiB,MAAM;AACnB,sBAAAA,EAAE,cAAc,MAAM,kBAAkB,kCACxCA,EAAE,cAAc,MAAM,QAAQ;AAAA,oBAChC;AAAA,oBACA,cAAc,CAACA,MAAM;AACnB,sBAAAA,EAAE,cAAc,MAAM,kBAAkB,eACxCA,EAAE,cAAc,MAAM,QAAQ;AAAA,oBAChC;AAAA,oBAEA,4BAAC7B,GAAA,CAAA,CAAU;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACb,GAEJ;AAAA,gCAED,OAAA,EAAI,WAAU,yBAAwB,OAAO2C,GAC3C,UAAA3B,EAAA,CACH;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAGF,SAAOiC,EAAaL,GAAe,SAAS,IAAI;AAClD,CAAC;AAED1C,EAAO,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),A=require("react-dom"),P=require("../../../utils/styles.cjs"),E=require("../../../design-system/primitives/layout.cjs"),s=require("../../../design-system/tokens/spacing.cjs"),j=require("../../../design-system/tokens/typography.cjs"),F=require("../../../design-system/primitives/sizing.cjs"),G={sm:"400px",md:"500px",lg:"640px",xl:"800px","2xl":"1200px",full:"calc(100vw - 48px)"},J=t.memo(function(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),w=t.forwardRef(function({isOpen:n,onClose:o,size:c="md",title:l,description:u,closeOnOverlayClick:b=!0,closeOnEscape:v=!0,showCloseButton:k=!0,className:C,style:g,testId:R,children:q,...L},i){const y=t.useRef(null),f=t.useRef(null),d=t.useRef(!1);t.useEffect(()=>{n&&!d.current?(f.current=document.activeElement,d.current=!0):!n&&d.current&&(document.activeElement instanceof HTMLElement&&document.activeElement.blur(),f.current?.focus(),f.current=null,d.current=!1)},[n]);const x=t.useRef(o);t.useEffect(()=>{x.current=o},[o]),t.useEffect(()=>{if(!n)return;const e=y.current;e&&e.focus()},[n]),t.useEffect(()=>{if(!n)return;const e=y.current,p=a=>{if(a.key==="Escape"&&v){x.current();return}if(a.key==="Tab"&&e){const m=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),h=m[0],S=m[m.length-1];a.shiftKey&&document.activeElement===h?(a.preventDefault(),S?.focus()):!a.shiftKey&&document.activeElement===S&&(a.preventDefault(),h?.focus())}};return document.addEventListener("keydown",p),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",p),document.body.style.overflow=""}},[n,v]);const T=t.useCallback(e=>{e.target===e.currentTarget&&b&&o()},[b,o]),z=t.useMemo(()=>({position:"fixed",inset:0,zIndex:"var(--brycks-z-modal)",display:"flex",alignItems:"center",justifyContent:"center",padding:s.spacing[6],backgroundColor:"var(--brycks-background-overlay)",backdropFilter:"blur(4px)",animation:"brycks-fade-in var(--brycks-duration-normal) var(--brycks-ease-out)"}),[]),I=t.useMemo(()=>({position:"relative",width:"100%",maxWidth:G[c],maxHeight:c==="full"?"calc(100vh - 48px)":"85vh",backgroundColor:"var(--brycks-background-elevated)",borderRadius:"var(--brycks-radius-xl)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"brycks-scale-in var(--brycks-duration-normal) var(--brycks-ease-spring)",outline:"none",...g}),[c,g]);if(!n)return null;const D={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${s.spacing[5]}px ${s.spacing[6]}px`,borderBottom:"1px solid var(--brycks-border-muted)"},N={display:"flex",flexDirection:"column",gap:s.spacing[1]},B={fontSize:j.fontSizes.lg,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},W={fontSize:j.fontSizes.base,color:"var(--brycks-foreground-muted)",margin:0},H={display:"flex",alignItems:"center",justifyContent:"center",width:E.iconButtonSizes.sm,height:E.iconButtonSizes.sm,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all var(--brycks-duration-fast) var(--brycks-ease-out)",marginLeft:F.componentGap.xl,flexShrink:0},K={flex:1,overflow:"auto",padding:s.spacing[6]},$=r.jsx("div",{className:"brycks-modal-overlay",style:z,onClick:T,children:r.jsxs("div",{ref:e=>{y.current=e,typeof i=="function"?i(e):i&&(i.current=e)},role:"dialog","aria-modal":"true","aria-labelledby":l?"brycks-modal-title":void 0,"aria-describedby":u?"brycks-modal-description":void 0,className:P.cx("brycks-modal",`brycks-modal--${c}`,C),style:I,tabIndex:-1,"data-testid":R,...L,children:[(l||k)&&r.jsxs("div",{className:"brycks-modal-header",style:D,children:[r.jsxs("div",{style:N,children:[l&&r.jsx("h2",{id:"brycks-modal-title",style:B,children:l}),u&&r.jsx("p",{id:"brycks-modal-description",style:W,children:u})]}),k&&r.jsx("button",{type:"button",className:"brycks-modal-close",style:H,onClick:o,"aria-label":"Close modal",onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--brycks-background-muted)",e.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--brycks-foreground-muted)"},children:r.jsx(J,{})})]}),r.jsx("div",{className:"brycks-modal-content",style:K,children:q})]})});return A.createPortal($,document.body)});w.displayName="Modal";exports.Modal=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),U=require("react-dom"),V=require("../../../utils/styles.cjs"),I=require("../../../hooks/useId.cjs"),C=require("../../../design-system/primitives/layout.cjs"),o=require("../../../design-system/tokens/spacing.cjs"),M=require("../../../design-system/tokens/typography.cjs"),X=require("../../../design-system/primitives/sizing.cjs"),Y={sm:"400px",md:"500px",lg:"640px",xl:"800px","2xl":"1200px",full:"calc(100vw - 48px)"},Z=t.memo(function(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),R=t.forwardRef(function({isOpen:n,onClose:s,size:c="md",title:l,description:u,closeOnOverlayClick:b=!0,closeOnEscape:v=!0,showCloseButton:g=!0,closeLabel:T="Close modal",footer:x,className:L,style:p,testId:z,children:N,...D},i){const f=t.useRef(null),k=I.useId("modal-title"),h=I.useId("modal-description"),y=t.useRef(null),d=t.useRef(!1);t.useEffect(()=>{n&&!d.current?(y.current=document.activeElement,d.current=!0):!n&&d.current&&(document.activeElement instanceof HTMLElement&&document.activeElement.blur(),y.current?.focus(),y.current=null,d.current=!1)},[n]);const S=t.useRef(s);t.useEffect(()=>{S.current=s},[s]),t.useEffect(()=>{if(!n)return;const e=f.current;e&&e.focus()},[n]),t.useEffect(()=>{if(!n)return;const e=f.current,j=a=>{if(a.key==="Escape"&&v){S.current();return}if(a.key==="Tab"&&e){const m=e.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])'),E=m[0],w=m[m.length-1];a.shiftKey&&document.activeElement===E?(a.preventDefault(),w?.focus()):!a.shiftKey&&document.activeElement===w&&(a.preventDefault(),E?.focus())}};return document.addEventListener("keydown",j),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",j),document.body.style.overflow=""}},[n,v]);const $=t.useCallback(e=>{e.target===e.currentTarget&&b&&s()},[b,s]),B=t.useMemo(()=>({position:"fixed",inset:0,zIndex:"var(--brycks-z-modal)",display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing[6],backgroundColor:"var(--brycks-background-overlay)",animation:"brycks-fade-in var(--brycks-duration-normal) var(--brycks-ease-out)"}),[]),W=t.useMemo(()=>({position:"relative",width:"100%",maxWidth:Y[c],maxHeight:c==="full"?"calc(100vh - 48px)":"85vh",backgroundColor:"var(--brycks-background-elevated)",borderRadius:"var(--brycks-radius-xl)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"brycks-scale-in var(--brycks-duration-normal) var(--brycks-ease-out)",outline:"none",...p}),[c,p]);if(!n)return null;const H={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${o.spacing[5]}px ${o.spacing[6]}px`,borderBottom:"1px solid var(--brycks-border-muted)"},K={display:"flex",flexDirection:"column",gap:o.spacing[1]},A={fontSize:M.fontSizes.lg,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},P={fontSize:M.fontSizes.base,color:"var(--brycks-foreground-muted)",margin:0},G={display:"flex",alignItems:"center",justifyContent:"center",width:C.iconButtonSizes.sm,height:C.iconButtonSizes.sm,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all var(--brycks-duration-fast) var(--brycks-ease-out)",marginLeft:X.componentGap.xl,flexShrink:0},F={flex:1,overflow:"auto",padding:o.spacing[6]},J={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:o.spacing[2],padding:`${o.spacing[4]}px ${o.spacing[6]}px`,borderTop:"1px solid var(--brycks-border-muted)"},Q=r.jsx("div",{className:"brycks-modal-overlay",style:B,onClick:$,children:r.jsxs("div",{ref:e=>{f.current=e,typeof i=="function"?i(e):i&&(i.current=e)},role:"dialog","aria-modal":"true","aria-labelledby":l?k:void 0,"aria-describedby":u?h:void 0,className:V.cx("brycks-modal",`brycks-modal--${c}`,L),style:W,tabIndex:-1,"data-testid":z,...D,children:[(l||g)&&r.jsxs("div",{className:"brycks-modal-header",style:H,children:[r.jsxs("div",{style:K,children:[l&&r.jsx("h2",{id:k,style:A,children:l}),u&&r.jsx("p",{id:h,style:P,children:u})]}),g&&r.jsx("button",{type:"button",className:"brycks-modal-close",style:G,onClick:s,"aria-label":T,onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--brycks-background-muted)",e.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--brycks-foreground-muted)"},children:r.jsx(Z,{})})]}),r.jsx("div",{className:"brycks-modal-content",style:F,children:N}),x&&r.jsx("div",{className:"brycks-modal-footer",style:J,children:x})]})});return U.createPortal(Q,document.body)});R.displayName="Modal";exports.Modal=R;
2
2
  //# sourceMappingURL=Modal.cjs.map