jaci-ui 0.7.0 → 0.8.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 (146) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +17 -0
  3. package/dist/components/alert-dialog/alert-dialog.cjs +4 -1
  4. package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
  5. package/dist/components/alert-dialog/alert-dialog.d.cts +2 -2
  6. package/dist/components/alert-dialog/alert-dialog.d.ts +2 -2
  7. package/dist/components/alert-dialog/alert-dialog.js +4 -1
  8. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  9. package/dist/components/color-picker/color-picker.cjs +4 -1
  10. package/dist/components/color-picker/color-picker.cjs.map +1 -1
  11. package/dist/components/color-picker/color-picker.d.cts +2 -2
  12. package/dist/components/color-picker/color-picker.d.ts +2 -2
  13. package/dist/components/color-picker/color-picker.js +4 -1
  14. package/dist/components/color-picker/color-picker.js.map +1 -1
  15. package/dist/components/combobox/combobox.cjs +4 -1
  16. package/dist/components/combobox/combobox.cjs.map +1 -1
  17. package/dist/components/combobox/combobox.d.cts +2 -2
  18. package/dist/components/combobox/combobox.d.ts +2 -2
  19. package/dist/components/combobox/combobox.js +4 -1
  20. package/dist/components/combobox/combobox.js.map +1 -1
  21. package/dist/components/command/command.cjs +73 -12
  22. package/dist/components/command/command.cjs.map +1 -1
  23. package/dist/components/command/command.d.cts +7 -1
  24. package/dist/components/command/command.d.ts +7 -1
  25. package/dist/components/command/command.js +73 -12
  26. package/dist/components/command/command.js.map +1 -1
  27. package/dist/components/command/index.d.cts +2 -2
  28. package/dist/components/command/index.d.ts +2 -2
  29. package/dist/components/context-menu/context-menu.cjs +4 -1
  30. package/dist/components/context-menu/context-menu.cjs.map +1 -1
  31. package/dist/components/context-menu/context-menu.d.cts +2 -2
  32. package/dist/components/context-menu/context-menu.d.ts +2 -2
  33. package/dist/components/context-menu/context-menu.js +4 -1
  34. package/dist/components/context-menu/context-menu.js.map +1 -1
  35. package/dist/components/date-picker/date-picker.cjs +4 -1
  36. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  37. package/dist/components/date-picker/date-picker.d.cts +2 -2
  38. package/dist/components/date-picker/date-picker.d.ts +2 -2
  39. package/dist/components/date-picker/date-picker.js +4 -1
  40. package/dist/components/date-picker/date-picker.js.map +1 -1
  41. package/dist/components/date-range-picker/date-range-picker.cjs +4 -1
  42. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
  43. package/dist/components/date-range-picker/date-range-picker.d.cts +2 -2
  44. package/dist/components/date-range-picker/date-range-picker.d.ts +2 -2
  45. package/dist/components/date-range-picker/date-range-picker.js +4 -1
  46. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  47. package/dist/components/dialog/dialog.cjs +4 -1
  48. package/dist/components/dialog/dialog.cjs.map +1 -1
  49. package/dist/components/dialog/dialog.d.cts +2 -2
  50. package/dist/components/dialog/dialog.d.ts +2 -2
  51. package/dist/components/dialog/dialog.js +4 -1
  52. package/dist/components/dialog/dialog.js.map +1 -1
  53. package/dist/components/drawer/drawer.cjs +4 -1
  54. package/dist/components/drawer/drawer.cjs.map +1 -1
  55. package/dist/components/drawer/drawer.d.cts +2 -2
  56. package/dist/components/drawer/drawer.d.ts +2 -2
  57. package/dist/components/drawer/drawer.js +4 -1
  58. package/dist/components/drawer/drawer.js.map +1 -1
  59. package/dist/components/figure/figure.cjs +45 -36
  60. package/dist/components/figure/figure.cjs.map +1 -1
  61. package/dist/components/figure/figure.js +45 -36
  62. package/dist/components/figure/figure.js.map +1 -1
  63. package/dist/components/image/image.cjs +41 -32
  64. package/dist/components/image/image.cjs.map +1 -1
  65. package/dist/components/image/image.js +41 -32
  66. package/dist/components/image/image.js.map +1 -1
  67. package/dist/components/menu/menu.cjs +4 -1
  68. package/dist/components/menu/menu.cjs.map +1 -1
  69. package/dist/components/menu/menu.d.cts +2 -2
  70. package/dist/components/menu/menu.d.ts +2 -2
  71. package/dist/components/menu/menu.js +4 -1
  72. package/dist/components/menu/menu.js.map +1 -1
  73. package/dist/components/menubar/menubar.cjs +4 -1
  74. package/dist/components/menubar/menubar.cjs.map +1 -1
  75. package/dist/components/menubar/menubar.d.cts +2 -2
  76. package/dist/components/menubar/menubar.d.ts +2 -2
  77. package/dist/components/menubar/menubar.js +4 -1
  78. package/dist/components/menubar/menubar.js.map +1 -1
  79. package/dist/components/navigation/navigation.cjs +3 -1
  80. package/dist/components/navigation/navigation.cjs.map +1 -1
  81. package/dist/components/navigation/navigation.js +3 -1
  82. package/dist/components/navigation/navigation.js.map +1 -1
  83. package/dist/components/navigation-menu/navigation-menu.cjs +4 -1
  84. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  85. package/dist/components/navigation-menu/navigation-menu.d.cts +2 -2
  86. package/dist/components/navigation-menu/navigation-menu.d.ts +2 -2
  87. package/dist/components/navigation-menu/navigation-menu.js +4 -1
  88. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  89. package/dist/components/popover/popover.cjs +4 -1
  90. package/dist/components/popover/popover.cjs.map +1 -1
  91. package/dist/components/popover/popover.d.cts +2 -2
  92. package/dist/components/popover/popover.d.ts +2 -2
  93. package/dist/components/popover/popover.js +4 -1
  94. package/dist/components/popover/popover.js.map +1 -1
  95. package/dist/components/select/select.cjs +4 -1
  96. package/dist/components/select/select.cjs.map +1 -1
  97. package/dist/components/select/select.d.cts +2 -2
  98. package/dist/components/select/select.d.ts +2 -2
  99. package/dist/components/select/select.js +4 -1
  100. package/dist/components/select/select.js.map +1 -1
  101. package/dist/components/sidebar/sidebar.cjs +24 -17
  102. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  103. package/dist/components/sidebar/sidebar.d.cts +4 -2
  104. package/dist/components/sidebar/sidebar.d.ts +4 -2
  105. package/dist/components/sidebar/sidebar.js +24 -17
  106. package/dist/components/sidebar/sidebar.js.map +1 -1
  107. package/dist/components/toast/toast.cjs +4 -1
  108. package/dist/components/toast/toast.cjs.map +1 -1
  109. package/dist/components/toast/toast.d.cts +1 -1
  110. package/dist/components/toast/toast.d.ts +1 -1
  111. package/dist/components/toast/toast.js +4 -1
  112. package/dist/components/toast/toast.js.map +1 -1
  113. package/dist/components/tooltip/tooltip.cjs +4 -1
  114. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  115. package/dist/components/tooltip/tooltip.d.cts +2 -2
  116. package/dist/components/tooltip/tooltip.d.ts +2 -2
  117. package/dist/components/tooltip/tooltip.js +4 -1
  118. package/dist/components/tooltip/tooltip.js.map +1 -1
  119. package/dist/index.cjs +1 -0
  120. package/dist/index.cjs.map +1 -0
  121. package/dist/index.d.cts +2 -2
  122. package/dist/index.d.ts +2 -2
  123. package/dist/index.js +1 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/styled-system/recipes/command.cjs +3 -3
  126. package/dist/styled-system/recipes/command.cjs.map +1 -1
  127. package/dist/styled-system/recipes/command.js +3 -3
  128. package/dist/styled-system/recipes/command.js.map +1 -1
  129. package/dist/styled-system/recipes/figure.cjs +1 -0
  130. package/dist/styled-system/recipes/figure.cjs.map +1 -1
  131. package/dist/styled-system/recipes/figure.js +1 -0
  132. package/dist/styled-system/recipes/figure.js.map +1 -1
  133. package/dist/styled-system/recipes/image.cjs +1 -0
  134. package/dist/styled-system/recipes/image.cjs.map +1 -1
  135. package/dist/styled-system/recipes/image.js +1 -0
  136. package/dist/styled-system/recipes/image.js.map +1 -1
  137. package/dist/styles.css +70 -50
  138. package/dist/theme/theme-provider.cjs +18 -8
  139. package/dist/theme/theme-provider.cjs.map +1 -1
  140. package/dist/theme/theme-provider.js +18 -8
  141. package/dist/theme/theme-provider.js.map +1 -1
  142. package/dist/theme/theme-scope.cjs +21 -0
  143. package/dist/theme/theme-scope.cjs.map +1 -0
  144. package/dist/theme/theme-scope.js +19 -0
  145. package/dist/theme/theme-scope.js.map +1 -0
  146. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cd7966c: Harden package compatibility, tarball validation, tree-shaking and CI coverage for React and framework consumers.
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Accessible, themeable React components for React 18.2 and React 19 applications.
4
4
 
5
+ The published package supports Node 18.18 or newer. Node 22.18 or newer is required only for
6
+ working on the repository because it is used by the build toolchain.
7
+
5
8
  ## Installation
6
9
 
7
10
  ```sh
@@ -18,6 +21,11 @@ import "jaci-ui/styles.css";
18
21
  The package declares `react` and `react-dom` as peer dependencies. `@base-ui/react` is installed
19
22
  as a runtime dependency for accessible interactive primitives.
20
23
 
24
+ The package publishes ESM and CommonJS entry points, TypeScript declarations and sourcemaps.
25
+ `jaci-ui/styles.css` is the only declared side effect, so bundlers can tree-shake unused
26
+ component modules. Import `jaci-ui/panda-preset` only when an application also uses Panda CSS;
27
+ the regular package does not require Panda at runtime.
28
+
21
29
  ## Usage
22
30
 
23
31
  Components use named exports and compound APIs where several accessible parts work together:
@@ -338,6 +346,15 @@ export function App() {
338
346
  mounting. The provider is a client module, so Next.js App Router applications should place it
339
347
  inside a client boundary. Direct `data-jaci-theme` and `--jaci-*` variables remain supported.
340
348
 
349
+ Popups rendered through Jaci portal slots inherit the nearest `ThemeProvider` scope, including
350
+ local accent tokens. An explicit `container` prop on a portal still takes precedence. Without a
351
+ provider, portals keep Base UI's default document-level behavior.
352
+
353
+ When combining responsive utility classes with `Sidebar` or `BottomNavigation`, import
354
+ `jaci-ui/styles.css` before the application's utility stylesheet. Their structural display rule
355
+ uses a low-specificity selector, so classes such as `hidden md:flex` and `md:hidden` can control
356
+ visibility without inline styles.
357
+
341
358
  The package exposes semantic surface, foreground, border, status, spacing, radius, shadow and
342
359
  transition tokens. See the Theming guide in Storybook for the complete token vocabulary.
343
360
 
@@ -2,6 +2,7 @@
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
3
  const require_base_ui = require("../base-ui.cjs");
4
4
  const require_dialog = require("../../styled-system/recipes/dialog.cjs");
5
+ const require_theme_scope = require("../../theme/theme-scope.cjs");
5
6
  let react = require("react");
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
7
8
  let _base_ui_react_alert_dialog = require("@base-ui/react/alert-dialog");
@@ -17,7 +18,9 @@ const AlertDialogTrigger = (0, react.forwardRef)(function AlertDialogTrigger({ c
17
18
  "data-slot": "alert-dialog-trigger"
18
19
  });
19
20
  });
20
- const AlertDialogPortal = _base_ui_react_alert_dialog.AlertDialog.Portal;
21
+ function AlertDialogPortal(props) {
22
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_alert_dialog.AlertDialog.Portal, { ...require_theme_scope.useThemePortalProps(props) });
23
+ }
21
24
  const AlertDialogBackdrop = (0, react.forwardRef)(function AlertDialogBackdrop({ className, ...props }, ref) {
22
25
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_alert_dialog.AlertDialog.Backdrop, {
23
26
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","withRecipeClassName","dialog","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport const AlertDialogPortal: typeof BaseAlertDialog.Portal = BaseAlertDialog.Portal;\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;AAkBA,SAAgB,gBAAmC,OAAsC;CACvF,OAAO,iBAAA,G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eAAAA,OAAO,CAAC,CAAC,QAAQ,SAAS;EACxC,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBACP,EAAE,cAAc,WAAW,UAAU,WAAW,aAAa,UAAU,GAAG,SAC1E,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAAA,YAAgB,OAAjB;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAWC,gBAAAA,oBACT,kBAAkBC,eAAAA,OAAO,CAAC,CAAC,SAASA,eAAAA,OAAO,CAAC,CAAC,OAC7C,SACF;EACA,aAAW,YAAY;YAEtB,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcF,4BAAAA,YAAgB;AAChC"}
1
+ {"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,gBAAmC,OAAsC;CACvF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAAA,YAAgB,QAAjB,EAAwB,GAAIG,oBAAAA,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAIA,MAAa,uBAAA,GAAA,MAAA,WAAA,CACX,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACH,4BAAAA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CA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kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcF,4BAAAA,YAAgB;AAChC"}
@@ -12,7 +12,7 @@ declare function AlertDialogRoot$1<Payload = unknown>(props: AlertDialogRootProp
12
12
  type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof AlertDialog.Trigger>;
13
13
  declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
14
14
  type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof AlertDialog.Portal>;
15
- declare const AlertDialogPortal: typeof AlertDialog.Portal;
15
+ declare function AlertDialogPortal(props: AlertDialogPortalProps): import("react").JSX.Element;
16
16
  type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof AlertDialog.Backdrop>;
17
17
  declare const AlertDialogBackdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
18
18
  type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof AlertDialog.Viewport>;
@@ -48,7 +48,7 @@ declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<
48
48
  declare const AlertDialog$1: {
49
49
  Root: typeof AlertDialogRoot$1;
50
50
  Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
51
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
+ Portal: typeof AlertDialogPortal;
52
52
  Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
53
53
  Viewport: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
54
54
  Popup: import("react").ForwardRefExoticComponent<AlertDialogPopupProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -12,7 +12,7 @@ declare function AlertDialogRoot$1<Payload = unknown>(props: AlertDialogRootProp
12
12
  type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof AlertDialog.Trigger>;
13
13
  declare const AlertDialogTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
14
14
  type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof AlertDialog.Portal>;
15
- declare const AlertDialogPortal: typeof AlertDialog.Portal;
15
+ declare function AlertDialogPortal(props: AlertDialogPortalProps): import("react").JSX.Element;
16
16
  type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof AlertDialog.Backdrop>;
17
17
  declare const AlertDialogBackdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
18
18
  type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof AlertDialog.Viewport>;
@@ -48,7 +48,7 @@ declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<
48
48
  declare const AlertDialog$1: {
49
49
  Root: typeof AlertDialogRoot$1;
50
50
  Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogTriggerProps<unknown>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
51
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
+ Portal: typeof AlertDialogPortal;
52
52
  Backdrop: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
53
53
  Viewport: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AlertDialogViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
54
54
  Popup: import("react").ForwardRefExoticComponent<AlertDialogPopupProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -2,6 +2,7 @@
2
2
  import { cx } from "../../styled-system/css/cx.js";
3
3
  import { withRecipeClassName } from "../base-ui.js";
4
4
  import { dialog } from "../../styled-system/recipes/dialog.js";
5
+ import { useThemePortalProps } from "../../theme/theme-scope.js";
5
6
  import { forwardRef } from "react";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { AlertDialog } from "@base-ui/react/alert-dialog";
@@ -17,7 +18,9 @@ const AlertDialogTrigger = forwardRef(function AlertDialogTrigger({ className, .
17
18
  "data-slot": "alert-dialog-trigger"
18
19
  });
19
20
  });
20
- const AlertDialogPortal = AlertDialog.Portal;
21
+ function AlertDialogPortal(props) {
22
+ return /* @__PURE__ */ jsx(AlertDialog.Portal, { ...useThemePortalProps(props) });
23
+ }
21
24
  const AlertDialogBackdrop = forwardRef(function AlertDialogBackdrop({ className, ...props }, ref) {
22
25
  return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
23
26
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport const AlertDialogPortal: typeof BaseAlertDialog.Portal = BaseAlertDialog.Portal;\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;AAkBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAmDA,YAAgB;AAIhF,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YA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OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,CAAC,CAAC,QAAQ,SAAS;EACxC,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,mBAAmB,WAC9B,SAAS,iBACP,EAAE,cAAc,WAAW,UAAU,WAAW,aAAa,UAAU,GAAG,SAC1E,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,oBAACA,YAAgB,OAAjB;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAW,oBACT,kBAAkB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,OAC7C,SACF;EACA,aAAW,YAAY;YAEtB,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAaC,gBAAc;CACzB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcC,YAAgB;AAChC"}
1
+ {"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,oBAACA,YAAgB,QAAjB,EAAwB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAOA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,OAAO,MAAM,GAAG,SAAS,KAAK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U,GAAG,SAC1E,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,oBAACA,YAAgB,OAAjB;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAW,oBACT,kBAAkB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,OAC7C,SACF;EACA,aAAW,YAAY;YAEtB,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAaC,gBAAc;CACzB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcC,YAAgB;AAChC"}
@@ -2,6 +2,7 @@
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
3
  const require_base_ui = require("../base-ui.cjs");
4
4
  const require_color_picker = require("../../styled-system/recipes/color-picker.cjs");
5
+ const require_theme_scope = require("../../theme/theme-scope.cjs");
5
6
  const require_color_utils = require("./color-utils.cjs");
6
7
  let react = require("react");
7
8
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -102,7 +103,9 @@ const ColorPickerValue = (0, react.forwardRef)(function ColorPickerValue({ class
102
103
  children: props.children ?? value
103
104
  });
104
105
  });
105
- const ColorPickerPortal = _base_ui_react_popover.Popover.Portal;
106
+ function ColorPickerPortal(props) {
107
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Portal, { ...require_theme_scope.useThemePortalProps(props) });
108
+ }
106
109
  const ColorPickerPositioner = (0, react.forwardRef)(function ColorPickerPositioner({ className, ...props }, ref) {
107
110
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Positioner, {
108
111
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.cjs","names":["defaultColor","parseColor","formatColor","BasePopover","cx","colorPicker","withRecipeClassName"],"sources":["../../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { createContext, forwardRef, useContext, useEffect, useId, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, CSSProperties, PointerEvent, ReactNode } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { colorPicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { defaultColor, formatColor, parseColor } from \"./color-utils\";\nimport type { ColorFormat, ColorModel } from \"./color-utils\";\n\nexport type { ColorFormat, ColorModel } from \"./color-utils\";\nexport { defaultColor, formatColor, parseColor } from \"./color-utils\";\n\ninterface ColorPickerContextValue {\n color: ColorModel;\n disabled: boolean;\n format: ColorFormat;\n inputId: string;\n setColor: (color: ColorModel) => void;\n showAlpha: boolean;\n swatches: string[];\n value: string;\n}\n\nconst ColorPickerContext = createContext<ColorPickerContextValue | null>(null);\n\nfunction useColorPicker() {\n const context = useContext(ColorPickerContext);\n if (!context) throw new Error(\"ColorPicker parts must be rendered inside ColorPicker.Root.\");\n return context;\n}\n\nexport interface ColorPickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n children?: ReactNode;\n defaultValue?: string;\n disabled?: boolean;\n format?: ColorFormat;\n id?: string;\n name?: string;\n onValueChange?: (value: string) => void;\n showAlpha?: boolean;\n swatches?: string[];\n value?: string;\n}\n\nexport function ColorPickerRoot({\n children,\n defaultValue = \"#000000\",\n disabled = false,\n format = \"hex\",\n id,\n name,\n onValueChange,\n showAlpha = false,\n swatches = [],\n value: controlledValue,\n ...popoverProps\n}: ColorPickerRootProps) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const [uncontrolledColor, setUncontrolledColor] = useState<ColorModel>(() =>\n defaultColor(defaultValue),\n );\n const parsedControlled = parseColor(controlledValue);\n const color = parsedControlled ?? uncontrolledColor;\n const formattedValue = formatColor(color, format, showAlpha);\n const setColor = (nextColor: ColorModel) => {\n setUncontrolledColor(nextColor);\n onValueChange?.(formatColor(nextColor, format, showAlpha));\n };\n\n return (\n <ColorPickerContext.Provider\n value={{\n color,\n disabled,\n format,\n inputId,\n setColor,\n showAlpha,\n swatches,\n value: formattedValue,\n }}\n >\n <BasePopover.Root {...popoverProps}>\n {children}\n {name ? (\n <input\n aria-hidden=\"true\"\n id={`${inputId}-value`}\n name={name}\n type=\"hidden\"\n value={formattedValue}\n />\n ) : null}\n </BasePopover.Root>\n </ColorPickerContext.Provider>\n );\n}\n\nexport interface ColorPickerLabelProps extends ComponentPropsWithoutRef<\"label\"> {}\nexport const ColorPickerLabel = forwardRef<HTMLLabelElement, ColorPickerLabelProps>(\n function ColorPickerLabel({ children, className, htmlFor, ...props }, ref) {\n const { inputId } = useColorPicker();\n return (\n <label\n {...props}\n ref={ref}\n className={cx(colorPicker().label, className)}\n data-slot=\"color-picker-label\"\n htmlFor={htmlFor ?? inputId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type ColorPickerControlProps = ComponentPropsWithoutRef<\"div\">;\nexport const ColorPickerControl = forwardRef<HTMLDivElement, ColorPickerControlProps>(\n function ColorPickerControl({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(colorPicker().control, className)}\n data-slot=\"color-picker-control\"\n />\n );\n },\n);\n\nexport type ColorPickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\nexport const ColorPickerTrigger = forwardRef<HTMLButtonElement, ColorPickerTriggerProps>(\n function ColorPickerTrigger({ className, disabled, ...props }, ref) {\n const context = useColorPicker();\n return (\n <BasePopover.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(colorPicker().trigger, className)}\n data-jaci-component=\"color-picker\"\n data-slot=\"color-picker-trigger\"\n disabled={disabled ?? context.disabled}\n id={props.id ?? context.inputId}\n />\n );\n },\n);\n\nexport type ColorPickerPreviewProps = ComponentPropsWithoutRef<\"span\">;\nexport const ColorPickerPreview = forwardRef<HTMLSpanElement, ColorPickerPreviewProps>(\n function ColorPickerPreview({ className, style, ...props }, ref) {\n const { value } = useColorPicker();\n return (\n <span\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? value}\n className={cx(colorPicker().preview, className)}\n data-slot=\"color-picker-preview\"\n role=\"img\"\n style={{ backgroundColor: value, ...style }}\n />\n );\n },\n);\n\nexport type ColorPickerValueProps = ComponentPropsWithoutRef<\"span\">;\nexport const ColorPickerValue = forwardRef<HTMLSpanElement, ColorPickerValueProps>(\n function ColorPickerValue({ className, ...props }, ref) {\n const { value } = useColorPicker();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(colorPicker().value, className)}\n data-slot=\"color-picker-value\"\n >\n {props.children ?? value}\n </span>\n );\n },\n);\n\nexport const ColorPickerPortal: typeof BasePopover.Portal = BasePopover.Portal;\nexport type ColorPickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\nexport const ColorPickerPositioner = forwardRef<HTMLDivElement, ColorPickerPositionerProps>(\n function ColorPickerPositioner({ className, ...props }, ref) {\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(colorPicker().positioner, className)}\n data-slot=\"color-picker-positioner\"\n />\n );\n },\n);\n\nexport type ColorPickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\nexport const ColorPickerPopup = forwardRef<HTMLDivElement, ColorPickerPopupProps>(\n function ColorPickerPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Color picker\"}\n ref={ref}\n className={withRecipeClassName(colorPicker().popup, className)}\n data-jaci-component=\"color-picker\"\n data-slot=\"color-picker-popup\"\n />\n );\n },\n);\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value));\n}\n\nfunction formatPalettePercentage(value: number) {\n return `${Number(value.toFixed(2))}%`;\n}\n\nfunction hslToPalettePosition(color: ColorModel) {\n const lightness = clamp(color.lightness / 100, 0, 1);\n const saturation = clamp(color.saturation / 100, 0, 1);\n const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;\n const value = lightness + chroma / 2;\n\n return {\n lightness: (1 - value) * 100,\n saturation: value === 0 ? 0 : (chroma / value) * 100,\n };\n}\n\nfunction palettePositionToHsl(\n saturation: number,\n lightness: number,\n color: ColorModel,\n): ColorModel {\n const hsvSaturation = clamp(saturation / 100, 0, 1);\n const value = 1 - clamp(lightness / 100, 0, 1);\n const hslLightness = value * (1 - hsvSaturation / 2);\n const hslSaturation =\n hslLightness === 0 || hslLightness === 1\n ? 0\n : ((value - hslLightness) / Math.min(hslLightness, 1 - hslLightness)) * 100;\n\n return {\n ...color,\n lightness: hslLightness * 100,\n saturation: clamp(hslSaturation, 0, 100),\n };\n}\n\nfunction updateFromPoint(\n event: PointerEvent<HTMLDivElement>,\n setColor: (color: ColorModel) => void,\n color: ColorModel,\n) {\n const rect = event.currentTarget.getBoundingClientRect();\n const saturation = Math.round(clamp((event.clientX - rect.left) / rect.width, 0, 1) * 100);\n const lightness = Math.round(clamp((event.clientY - rect.top) / rect.height, 0, 1) * 100);\n setColor(palettePositionToHsl(saturation, lightness, color));\n}\n\nexport type ColorPickerPaletteProps = Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\">;\nexport const ColorPickerPalette = forwardRef<HTMLDivElement, ColorPickerPaletteProps>(\n function ColorPickerPalette(\n {\n children,\n className,\n onKeyDown,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n style,\n ...props\n },\n ref,\n ) {\n const { color, disabled, setColor, value } = useColorPicker();\n const [isDragging, setIsDragging] = useState(false);\n const background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${color.hue} 100% 50%))`;\n const palettePosition = hslToPalettePosition(color);\n const paletteStyle = {\n \"--jaci-color-palette-lightness\": formatPalettePercentage(palettePosition.lightness),\n \"--jaci-color-palette-saturation\": formatPalettePercentage(palettePosition.saturation),\n background,\n ...style,\n } as CSSProperties;\n\n const releasePointer = (event: PointerEvent<HTMLDivElement>) => {\n if (event.currentTarget.hasPointerCapture?.(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n setIsDragging(false);\n };\n\n return (\n <div\n {...props}\n ref={ref}\n aria-disabled={disabled || undefined}\n aria-label={props[\"aria-label\"] ?? \"Color saturation and lightness\"}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={Math.round(palettePosition.saturation)}\n aria-valuetext={value}\n className={cx(colorPicker().palette, className)}\n data-disabled={disabled || undefined}\n data-dragging={isDragging || undefined}\n data-slot=\"color-picker-palette\"\n onKeyDown={(event) => {\n const step = event.shiftKey ? 10 : 1;\n if (\n event.key === \"ArrowLeft\" ||\n event.key === \"ArrowRight\" ||\n event.key === \"ArrowUp\" ||\n event.key === \"ArrowDown\"\n ) {\n event.preventDefault();\n const saturation =\n event.key === \"ArrowLeft\"\n ? Math.max(0, palettePosition.saturation - step)\n : event.key === \"ArrowRight\"\n ? Math.min(100, palettePosition.saturation + step)\n : palettePosition.saturation;\n const lightness =\n event.key === \"ArrowDown\"\n ? Math.min(100, palettePosition.lightness + step)\n : event.key === \"ArrowUp\"\n ? Math.max(0, palettePosition.lightness - step)\n : palettePosition.lightness;\n setColor(palettePositionToHsl(saturation, lightness, color));\n }\n onKeyDown?.(event);\n }}\n onPointerDown={(event) => {\n if (!disabled) {\n updateFromPoint(event, setColor, color);\n setIsDragging(true);\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // Pointer capture is not available in every test environment.\n }\n }\n onPointerDown?.(event);\n }}\n onPointerMove={(event) => {\n if (!disabled && isDragging) updateFromPoint(event, setColor, color);\n onPointerMove?.(event);\n }}\n onPointerUp={(event) => {\n releasePointer(event);\n onPointerUp?.(event);\n }}\n onPointerCancel={(event) => {\n releasePointer(event);\n onPointerCancel?.(event);\n }}\n role=\"slider\"\n style={paletteStyle}\n tabIndex={props.tabIndex ?? (disabled ? -1 : 0)}\n >\n <span\n aria-hidden=\"true\"\n className={colorPicker().paletteIndicator}\n data-slot=\"color-picker-palette-indicator\"\n />\n {children}\n </div>\n );\n },\n);\n\nexport type ColorPickerHueProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"max\" | \"min\" | \"onChange\" | \"step\" | \"type\" | \"value\"\n>;\nexport const ColorPickerHue = forwardRef<HTMLInputElement, ColorPickerHueProps>(\n function ColorPickerHue({ className, onInput, ...props }, ref) {\n const { color, setColor } = useColorPicker();\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Hue\"}\n className={cx(colorPicker().hue, className)}\n data-slot=\"color-picker-hue\"\n max={360}\n min={0}\n onInput={(event) => {\n setColor({ ...color, hue: Number(event.currentTarget.value) });\n onInput?.(event);\n }}\n step={1}\n type=\"range\"\n value={color.hue}\n />\n );\n },\n);\n\nexport type ColorPickerAlphaProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"max\" | \"min\" | \"onChange\" | \"step\" | \"type\" | \"value\"\n>;\nexport const ColorPickerAlpha = forwardRef<HTMLInputElement, ColorPickerAlphaProps>(\n function ColorPickerAlpha({ className, onInput, style, ...props }, ref) {\n const { color, setColor, showAlpha } = useColorPicker();\n if (!showAlpha) return null;\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Opacity\"}\n className={cx(colorPicker().alpha, className)}\n data-slot=\"color-picker-alpha\"\n max={1}\n min={0}\n onInput={(event) => {\n setColor({ ...color, alpha: Number(event.currentTarget.value) });\n onInput?.(event);\n }}\n step={0.01}\n style={{\n ...style,\n background: `linear-gradient(to right, transparent, ${formatColor({ ...color, alpha: 1 }, \"rgb\")})`,\n }}\n type=\"range\"\n value={color.alpha}\n />\n );\n },\n);\n\nexport type ColorPickerSwatchesProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport const ColorPickerSwatches = forwardRef<HTMLFieldSetElement, ColorPickerSwatchesProps>(\n function ColorPickerSwatches({ children, className, ...props }, ref) {\n const { swatches } = useColorPicker();\n return (\n <fieldset\n {...props}\n ref={ref}\n className={cx(colorPicker().swatches, className)}\n data-slot=\"color-picker-swatches\"\n >\n {children ?? swatches.map((color) => <ColorPickerSwatch color={color} key={color} />)}\n </fieldset>\n );\n },\n);\n\nexport interface ColorPickerSwatchProps extends ComponentPropsWithoutRef<\"button\"> {\n color: string;\n}\nexport const ColorPickerSwatch = forwardRef<HTMLButtonElement, ColorPickerSwatchProps>(\n function ColorPickerSwatch({ children, className, color, style, ...props }, ref) {\n const context = useColorPicker();\n const parsed = parseColor(color);\n const selected =\n parsed && formatColor(parsed, context.format, context.showAlpha) === context.value;\n return (\n <button\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? color}\n aria-pressed={selected || undefined}\n className={cx(colorPicker().swatch, className)}\n data-selected={selected || undefined}\n data-slot=\"color-picker-swatch\"\n onClick={(event) => {\n if (parsed) context.setColor(parsed);\n props.onClick?.(event);\n }}\n style={{ backgroundColor: color, ...style }}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type ColorPickerInputProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\nexport const ColorPickerInput = forwardRef<HTMLInputElement, ColorPickerInputProps>(\n function ColorPickerInput({ className, onBlur, onKeyDown, ...props }, ref) {\n const { format, setColor, showAlpha, value } = useColorPicker();\n const [draft, setDraft] = useState(value);\n const [invalid, setInvalid] = useState(false);\n useEffect(() => setDraft(value), [value]);\n const commit = () => {\n const parsed = parseColor(draft);\n if (!parsed) {\n setInvalid(true);\n setDraft(value);\n return;\n }\n setInvalid(false);\n setColor(parsed);\n setDraft(formatColor(parsed, format, showAlpha));\n };\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Color value\"}\n aria-invalid={invalid || undefined}\n className={cx(colorPicker().input, className)}\n data-slot=\"color-picker-input\"\n onBlur={(event) => {\n commit();\n onBlur?.(event);\n }}\n onChange={(event) => {\n setDraft(event.currentTarget.value);\n setInvalid(false);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n }\n onKeyDown?.(event);\n }}\n type=\"text\"\n value={draft}\n />\n );\n },\n);\n\nexport type ColorPickerNativeInputProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\nexport const ColorPickerNativeInput = forwardRef<HTMLInputElement, ColorPickerNativeInputProps>(\n function ColorPickerNativeInput({ className, onInput, ...props }, ref) {\n const { color, setColor, showAlpha } = useColorPicker();\n const value = formatColor({ ...color, alpha: 1 }, \"hex\");\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Choose a color\"}\n className={cx(colorPicker().nativeInput, className)}\n data-slot=\"color-picker-native-input\"\n onInput={(event) => {\n const parsed = parseColor(event.currentTarget.value);\n if (parsed) setColor({ ...parsed, alpha: showAlpha ? color.alpha : 1 });\n onInput?.(event);\n }}\n type=\"color\"\n value={value.slice(0, 7)}\n />\n );\n },\n);\n\nexport const ColorPicker = {\n Root: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n Trigger: ColorPickerTrigger,\n Preview: ColorPickerPreview,\n Value: ColorPickerValue,\n Portal: ColorPickerPortal,\n Positioner: ColorPickerPositioner,\n Popup: ColorPickerPopup,\n Palette: ColorPickerPalette,\n Hue: ColorPickerHue,\n Alpha: ColorPickerAlpha,\n Swatches: ColorPickerSwatches,\n Swatch: ColorPickerSwatch,\n Input: ColorPickerInput,\n NativeInput: ColorPickerNativeInput,\n createHandle: BasePopover.createHandle,\n};\n"],"mappings":";;;;;;;;;AA2BA,MAAM,sBAAA,GAAA,MAAA,cAAA,CAAmE,IAAI;AAE7E,SAAS,iBAAiB;CACxB,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,kBAAkB;CAC7C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,6DAA6D;CAC3F,OAAO;AACT;AAeA,SAAgB,gBAAgB,EAC9B,UACA,eAAe,WACf,WAAW,OACX,SAAS,OACT,IACA,MACA,eACA,YAAY,OACZ,WAAW,CAAC,GACZ,OAAO,iBACP,GAAG,gBACoB;CACvB,MAAM,eAAA,GAAA,MAAA,MAAA,CAAoB;CAC1B,MAAM,UAAU,MAAM;CACtB,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,OACxBA,oBAAAA,aAAa,YAAY,CAC3B;CAEA,MAAM,QADmBC,oBAAAA,WAAW,eACP,KAAK;CAClC,MAAM,iBAAiBC,oBAAAA,YAAY,OAAO,QAAQ,SAAS;CAC3D,MAAM,YAAY,cAA0B;EAC1C,qBAAqB,SAAS;EAC9B,gBAAgBA,oBAAAA,YAAY,WAAW,QAAQ,SAAS,CAAC;CAC3D;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAmB,UAApB;EACE,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA,OAAO;EACT;YAEA,iBAAA,GAAA,kBAAA,KAAA,CAACC,uBAAAA,QAAY,MAAb;GAAkB,GAAI;aAAtB,CACG,UACA,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;IACE,eAAY;IACZ,IAAI,GAAG,QAAQ;IACT;IACN,MAAK;IACL,OAAO;GACR,CAAA,IACC,IACY;;CACS,CAAA;AAEjC;AAGA,MAAa,oBAAA,GAAA,MA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CACF;AAMA,MAAa,0BAAA,GAAA,MAAA,WAAA,CACX,SAAS,uBAAuB,EAAE,WAAW,SAAS,GAAG,SAAS,KAAK;CACrE,MAAM,EAAE,OAAO,UAAU,cAAc,eAAe;CACtD,MAAM,QAAQH,oBAAAA,YAAY;EAAE,GAAG;EAAO,OAAO;CAAE,GAAG,KAAK;CACvD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;EACE,GAAI;EACC;EACL,cAAY,MAAM,iBAAiB;EACnC,WAAWE,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,aAAa,SAAS;EAClD,aAAU;EACV,UAAU,UAAU;GAClB,MAAM,SAASJ,oBAAAA,WAAW,MAAM,cAAc,KAAK;GACnD,IAAI,QAAQ,SAAS;IAAE,GAAG;IAAQ,OAAO,YAAY,MAAM,QAAQ;GAAE,CAAC;GACtE,UAAU,KAAK;EACjB;EACA,MAAK;EACL,OAAO,MAAM,MAAM,GAAG,CAAC;CACxB,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,SAAS;CACT,KAAK;CACL,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,aAAa;CACb,cAAcE,uBAAAA,QAAY;AAC5B"}
1
+ {"version":3,"file":"color-picker.cjs","names":["defaultColor","parseColor","formatColor","BasePopover","cx","colorPicker","withRecipeClassName","useThemePortalProps"],"sources":["../../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { createContext, forwardRef, useContext, useEffect, useId, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, CSSProperties, PointerEvent, ReactNode } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { colorPicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport { defaultColor, formatColor, parseColor } from \"./color-utils\";\nimport type { ColorFormat, ColorModel } from \"./color-utils\";\n\nexport type { ColorFormat, ColorModel } from \"./color-utils\";\nexport { defaultColor, formatColor, parseColor } from \"./color-utils\";\n\ninterface ColorPickerContextValue {\n color: ColorModel;\n disabled: boolean;\n format: ColorFormat;\n inputId: string;\n setColor: (color: ColorModel) => void;\n showAlpha: boolean;\n swatches: string[];\n value: string;\n}\n\nconst ColorPickerContext = createContext<ColorPickerContextValue | null>(null);\n\nfunction useColorPicker() {\n const context = useContext(ColorPickerContext);\n if (!context) throw new Error(\"ColorPicker parts must be rendered inside ColorPicker.Root.\");\n return context;\n}\n\nexport interface ColorPickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n children?: ReactNode;\n defaultValue?: string;\n disabled?: boolean;\n format?: ColorFormat;\n id?: string;\n name?: string;\n onValueChange?: (value: string) => void;\n showAlpha?: boolean;\n swatches?: string[];\n value?: string;\n}\n\nexport function ColorPickerRoot({\n children,\n defaultValue = \"#000000\",\n disabled = false,\n format = \"hex\",\n id,\n name,\n onValueChange,\n showAlpha = false,\n swatches = [],\n value: controlledValue,\n ...popoverProps\n}: ColorPickerRootProps) {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const [uncontrolledColor, setUncontrolledColor] = useState<ColorModel>(() =>\n defaultColor(defaultValue),\n );\n const parsedControlled = parseColor(controlledValue);\n const color = parsedControlled ?? uncontrolledColor;\n const formattedValue = formatColor(color, format, showAlpha);\n const setColor = (nextColor: ColorModel) => {\n setUncontrolledColor(nextColor);\n onValueChange?.(formatColor(nextColor, format, showAlpha));\n };\n\n return (\n <ColorPickerContext.Provider\n value={{\n color,\n disabled,\n format,\n inputId,\n setColor,\n showAlpha,\n swatches,\n value: formattedValue,\n }}\n >\n <BasePopover.Root {...popoverProps}>\n {children}\n {name ? (\n <input\n aria-hidden=\"true\"\n id={`${inputId}-value`}\n name={name}\n type=\"hidden\"\n value={formattedValue}\n />\n ) : null}\n </BasePopover.Root>\n </ColorPickerContext.Provider>\n );\n}\n\nexport interface ColorPickerLabelProps extends ComponentPropsWithoutRef<\"label\"> {}\nexport const ColorPickerLabel = forwardRef<HTMLLabelElement, ColorPickerLabelProps>(\n function ColorPickerLabel({ children, className, htmlFor, ...props }, ref) {\n const { inputId } = useColorPicker();\n return (\n <label\n {...props}\n ref={ref}\n className={cx(colorPicker().label, className)}\n data-slot=\"color-picker-label\"\n htmlFor={htmlFor ?? inputId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type ColorPickerControlProps = ComponentPropsWithoutRef<\"div\">;\nexport const ColorPickerControl = forwardRef<HTMLDivElement, ColorPickerControlProps>(\n function ColorPickerControl({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(colorPicker().control, className)}\n data-slot=\"color-picker-control\"\n />\n );\n },\n);\n\nexport type ColorPickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\nexport const ColorPickerTrigger = forwardRef<HTMLButtonElement, ColorPickerTriggerProps>(\n function ColorPickerTrigger({ className, disabled, ...props }, ref) {\n const context = useColorPicker();\n return (\n <BasePopover.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(colorPicker().trigger, className)}\n data-jaci-component=\"color-picker\"\n data-slot=\"color-picker-trigger\"\n disabled={disabled ?? context.disabled}\n id={props.id ?? context.inputId}\n />\n );\n },\n);\n\nexport type ColorPickerPreviewProps = ComponentPropsWithoutRef<\"span\">;\nexport const ColorPickerPreview = forwardRef<HTMLSpanElement, ColorPickerPreviewProps>(\n function ColorPickerPreview({ className, style, ...props }, ref) {\n const { value } = useColorPicker();\n return (\n <span\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? value}\n className={cx(colorPicker().preview, className)}\n data-slot=\"color-picker-preview\"\n role=\"img\"\n style={{ backgroundColor: value, ...style }}\n />\n );\n },\n);\n\nexport type ColorPickerValueProps = ComponentPropsWithoutRef<\"span\">;\nexport const ColorPickerValue = forwardRef<HTMLSpanElement, ColorPickerValueProps>(\n function ColorPickerValue({ className, ...props }, ref) {\n const { value } = useColorPicker();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(colorPicker().value, className)}\n data-slot=\"color-picker-value\"\n >\n {props.children ?? value}\n </span>\n );\n },\n);\n\nexport function ColorPickerPortal(props: ComponentPropsWithoutRef<typeof BasePopover.Portal>) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\nexport type ColorPickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\nexport const ColorPickerPositioner = forwardRef<HTMLDivElement, ColorPickerPositionerProps>(\n function ColorPickerPositioner({ className, ...props }, ref) {\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(colorPicker().positioner, className)}\n data-slot=\"color-picker-positioner\"\n />\n );\n },\n);\n\nexport type ColorPickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\nexport const ColorPickerPopup = forwardRef<HTMLDivElement, ColorPickerPopupProps>(\n function ColorPickerPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Color picker\"}\n ref={ref}\n className={withRecipeClassName(colorPicker().popup, className)}\n data-jaci-component=\"color-picker\"\n data-slot=\"color-picker-popup\"\n />\n );\n },\n);\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value));\n}\n\nfunction formatPalettePercentage(value: number) {\n return `${Number(value.toFixed(2))}%`;\n}\n\nfunction hslToPalettePosition(color: ColorModel) {\n const lightness = clamp(color.lightness / 100, 0, 1);\n const saturation = clamp(color.saturation / 100, 0, 1);\n const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;\n const value = lightness + chroma / 2;\n\n return {\n lightness: (1 - value) * 100,\n saturation: value === 0 ? 0 : (chroma / value) * 100,\n };\n}\n\nfunction palettePositionToHsl(\n saturation: number,\n lightness: number,\n color: ColorModel,\n): ColorModel {\n const hsvSaturation = clamp(saturation / 100, 0, 1);\n const value = 1 - clamp(lightness / 100, 0, 1);\n const hslLightness = value * (1 - hsvSaturation / 2);\n const hslSaturation =\n hslLightness === 0 || hslLightness === 1\n ? 0\n : ((value - hslLightness) / Math.min(hslLightness, 1 - hslLightness)) * 100;\n\n return {\n ...color,\n lightness: hslLightness * 100,\n saturation: clamp(hslSaturation, 0, 100),\n };\n}\n\nfunction updateFromPoint(\n event: PointerEvent<HTMLDivElement>,\n setColor: (color: ColorModel) => void,\n color: ColorModel,\n) {\n const rect = event.currentTarget.getBoundingClientRect();\n const saturation = Math.round(clamp((event.clientX - rect.left) / rect.width, 0, 1) * 100);\n const lightness = Math.round(clamp((event.clientY - rect.top) / rect.height, 0, 1) * 100);\n setColor(palettePositionToHsl(saturation, lightness, color));\n}\n\nexport type ColorPickerPaletteProps = Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\">;\nexport const ColorPickerPalette = forwardRef<HTMLDivElement, ColorPickerPaletteProps>(\n function ColorPickerPalette(\n {\n children,\n className,\n onKeyDown,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n style,\n ...props\n },\n ref,\n ) {\n const { color, disabled, setColor, value } = useColorPicker();\n const [isDragging, setIsDragging] = useState(false);\n const background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${color.hue} 100% 50%))`;\n const palettePosition = hslToPalettePosition(color);\n const paletteStyle = {\n \"--jaci-color-palette-lightness\": formatPalettePercentage(palettePosition.lightness),\n \"--jaci-color-palette-saturation\": formatPalettePercentage(palettePosition.saturation),\n background,\n ...style,\n } as CSSProperties;\n\n const releasePointer = (event: PointerEvent<HTMLDivElement>) => {\n if (event.currentTarget.hasPointerCapture?.(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n setIsDragging(false);\n };\n\n return (\n <div\n {...props}\n ref={ref}\n aria-disabled={disabled || undefined}\n aria-label={props[\"aria-label\"] ?? \"Color saturation and lightness\"}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={Math.round(palettePosition.saturation)}\n aria-valuetext={value}\n className={cx(colorPicker().palette, className)}\n data-disabled={disabled || undefined}\n data-dragging={isDragging || undefined}\n data-slot=\"color-picker-palette\"\n onKeyDown={(event) => {\n const step = event.shiftKey ? 10 : 1;\n if (\n event.key === \"ArrowLeft\" ||\n event.key === \"ArrowRight\" ||\n event.key === \"ArrowUp\" ||\n event.key === \"ArrowDown\"\n ) {\n event.preventDefault();\n const saturation =\n event.key === \"ArrowLeft\"\n ? Math.max(0, palettePosition.saturation - step)\n : event.key === \"ArrowRight\"\n ? Math.min(100, palettePosition.saturation + step)\n : palettePosition.saturation;\n const lightness =\n event.key === \"ArrowDown\"\n ? Math.min(100, palettePosition.lightness + step)\n : event.key === \"ArrowUp\"\n ? Math.max(0, palettePosition.lightness - step)\n : palettePosition.lightness;\n setColor(palettePositionToHsl(saturation, lightness, color));\n }\n onKeyDown?.(event);\n }}\n onPointerDown={(event) => {\n if (!disabled) {\n updateFromPoint(event, setColor, color);\n setIsDragging(true);\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // Pointer capture is not available in every test environment.\n }\n }\n onPointerDown?.(event);\n }}\n onPointerMove={(event) => {\n if (!disabled && isDragging) updateFromPoint(event, setColor, color);\n onPointerMove?.(event);\n }}\n onPointerUp={(event) => {\n releasePointer(event);\n onPointerUp?.(event);\n }}\n onPointerCancel={(event) => {\n releasePointer(event);\n onPointerCancel?.(event);\n }}\n role=\"slider\"\n style={paletteStyle}\n tabIndex={props.tabIndex ?? (disabled ? -1 : 0)}\n >\n <span\n aria-hidden=\"true\"\n className={colorPicker().paletteIndicator}\n data-slot=\"color-picker-palette-indicator\"\n />\n {children}\n </div>\n );\n },\n);\n\nexport type ColorPickerHueProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"max\" | \"min\" | \"onChange\" | \"step\" | \"type\" | \"value\"\n>;\nexport const ColorPickerHue = forwardRef<HTMLInputElement, ColorPickerHueProps>(\n function ColorPickerHue({ className, onInput, ...props }, ref) {\n const { color, setColor } = useColorPicker();\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Hue\"}\n className={cx(colorPicker().hue, className)}\n data-slot=\"color-picker-hue\"\n max={360}\n min={0}\n onInput={(event) => {\n setColor({ ...color, hue: Number(event.currentTarget.value) });\n onInput?.(event);\n }}\n step={1}\n type=\"range\"\n value={color.hue}\n />\n );\n },\n);\n\nexport type ColorPickerAlphaProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"max\" | \"min\" | \"onChange\" | \"step\" | \"type\" | \"value\"\n>;\nexport const ColorPickerAlpha = forwardRef<HTMLInputElement, ColorPickerAlphaProps>(\n function ColorPickerAlpha({ className, onInput, style, ...props }, ref) {\n const { color, setColor, showAlpha } = useColorPicker();\n if (!showAlpha) return null;\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Opacity\"}\n className={cx(colorPicker().alpha, className)}\n data-slot=\"color-picker-alpha\"\n max={1}\n min={0}\n onInput={(event) => {\n setColor({ ...color, alpha: Number(event.currentTarget.value) });\n onInput?.(event);\n }}\n step={0.01}\n style={{\n ...style,\n background: `linear-gradient(to right, transparent, ${formatColor({ ...color, alpha: 1 }, \"rgb\")})`,\n }}\n type=\"range\"\n value={color.alpha}\n />\n );\n },\n);\n\nexport type ColorPickerSwatchesProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport const ColorPickerSwatches = forwardRef<HTMLFieldSetElement, ColorPickerSwatchesProps>(\n function ColorPickerSwatches({ children, className, ...props }, ref) {\n const { swatches } = useColorPicker();\n return (\n <fieldset\n {...props}\n ref={ref}\n className={cx(colorPicker().swatches, className)}\n data-slot=\"color-picker-swatches\"\n >\n {children ?? swatches.map((color) => <ColorPickerSwatch color={color} key={color} />)}\n </fieldset>\n );\n },\n);\n\nexport interface ColorPickerSwatchProps extends ComponentPropsWithoutRef<\"button\"> {\n color: string;\n}\nexport const ColorPickerSwatch = forwardRef<HTMLButtonElement, ColorPickerSwatchProps>(\n function ColorPickerSwatch({ children, className, color, style, ...props }, ref) {\n const context = useColorPicker();\n const parsed = parseColor(color);\n const selected =\n parsed && formatColor(parsed, context.format, context.showAlpha) === context.value;\n return (\n <button\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? color}\n aria-pressed={selected || undefined}\n className={cx(colorPicker().swatch, className)}\n data-selected={selected || undefined}\n data-slot=\"color-picker-swatch\"\n onClick={(event) => {\n if (parsed) context.setColor(parsed);\n props.onClick?.(event);\n }}\n style={{ backgroundColor: color, ...style }}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type ColorPickerInputProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\nexport const ColorPickerInput = forwardRef<HTMLInputElement, ColorPickerInputProps>(\n function ColorPickerInput({ className, onBlur, onKeyDown, ...props }, ref) {\n const { format, setColor, showAlpha, value } = useColorPicker();\n const [draft, setDraft] = useState(value);\n const [invalid, setInvalid] = useState(false);\n useEffect(() => setDraft(value), [value]);\n const commit = () => {\n const parsed = parseColor(draft);\n if (!parsed) {\n setInvalid(true);\n setDraft(value);\n return;\n }\n setInvalid(false);\n setColor(parsed);\n setDraft(formatColor(parsed, format, showAlpha));\n };\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Color value\"}\n aria-invalid={invalid || undefined}\n className={cx(colorPicker().input, className)}\n data-slot=\"color-picker-input\"\n onBlur={(event) => {\n commit();\n onBlur?.(event);\n }}\n onChange={(event) => {\n setDraft(event.currentTarget.value);\n setInvalid(false);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n }\n onKeyDown?.(event);\n }}\n type=\"text\"\n value={draft}\n />\n );\n },\n);\n\nexport type ColorPickerNativeInputProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\nexport const ColorPickerNativeInput = forwardRef<HTMLInputElement, ColorPickerNativeInputProps>(\n function ColorPickerNativeInput({ className, onInput, ...props }, ref) {\n const { color, setColor, showAlpha } = useColorPicker();\n const value = formatColor({ ...color, alpha: 1 }, \"hex\");\n return (\n <input\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Choose a color\"}\n className={cx(colorPicker().nativeInput, className)}\n data-slot=\"color-picker-native-input\"\n onInput={(event) => {\n const parsed = parseColor(event.currentTarget.value);\n if (parsed) setColor({ ...parsed, alpha: showAlpha ? color.alpha : 1 });\n onInput?.(event);\n }}\n type=\"color\"\n value={value.slice(0, 7)}\n />\n );\n },\n);\n\nexport const ColorPicker = {\n Root: ColorPickerRoot,\n Label: ColorPickerLabel,\n Control: ColorPickerControl,\n Trigger: ColorPickerTrigger,\n Preview: ColorPickerPreview,\n Value: ColorPickerValue,\n Portal: ColorPickerPortal,\n Positioner: ColorPickerPositioner,\n Popup: ColorPickerPopup,\n Palette: ColorPickerPalette,\n Hue: ColorPickerHue,\n Alpha: ColorPickerAlpha,\n Swatches: ColorPickerSwatches,\n Swatch: ColorPickerSwatch,\n Input: ColorPickerInput,\n NativeInput: ColorPickerNativeInput,\n createHandle: BasePopover.createHandle,\n};\n"],"mappings":";;;;;;;;;;AA4BA,MAAM,sBAAA,GAAA,MAAA,cAAA,CAAmE,IAAI;AAE7E,SAAS,iBAAiB;CACxB,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,kBAAkB;CAC7C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,6DAA6D;CAC3F,OAAO;AACT;AAeA,SAAgB,gBAAgB,EAC9B,UACA,eAAe,WACf,WAAW,OACX,SAAS,OACT,IACA,MACA,eACA,YAAY,OACZ,WAAW,CAAC,GACZ,OAAO,iBACP,GAAG,gBACoB;CACvB,MAAM,eAAA,GAAA,MAAA,MAAA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B,MAAM,SAASJ,oBAAAA,WAAW,MAAM,cAAc,KAAK;GACnD,IAAI,QAAQ,SAAS;IAAE,GAAG;IAAQ,OAAO,YAAY,MAAM,QAAQ;GAAE,CAAC;GACtE,UAAU,KAAK;EACjB;EACA,MAAK;EACL,OAAO,MAAM,MAAM,GAAG,CAAC;CACxB,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,SAAS;CACT,KAAK;CACL,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,aAAa;CACb,cAAcE,uBAAAA,QAAY;AAC5B"}
@@ -37,7 +37,7 @@ type ColorPickerPreviewProps = ComponentPropsWithoutRef<"span">;
37
37
  declare const ColorPickerPreview: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
38
38
  type ColorPickerValueProps = ComponentPropsWithoutRef<"span">;
39
39
  declare const ColorPickerValue: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
40
- declare const ColorPickerPortal: typeof Popover.Portal;
40
+ declare function ColorPickerPortal(props: ComponentPropsWithoutRef<typeof Popover.Portal>): import("react").JSX.Element;
41
41
  type ColorPickerPositionerProps = ComponentPropsWithoutRef<typeof Popover.Positioner>;
42
42
  declare const ColorPickerPositioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
43
43
  type ColorPickerPopupProps = ComponentPropsWithoutRef<typeof Popover.Popup>;
@@ -77,7 +77,7 @@ declare const ColorPicker: {
77
77
  } & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
78
78
  Preview: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
79
79
  Value: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
80
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
80
+ Portal: typeof ColorPickerPortal;
81
81
  Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
82
82
  Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
83
83
  Palette: import("react").ForwardRefExoticComponent<ColorPickerPaletteProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -37,7 +37,7 @@ type ColorPickerPreviewProps = ComponentPropsWithoutRef<"span">;
37
37
  declare const ColorPickerPreview: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
38
38
  type ColorPickerValueProps = ComponentPropsWithoutRef<"span">;
39
39
  declare const ColorPickerValue: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
40
- declare const ColorPickerPortal: typeof Popover.Portal;
40
+ declare function ColorPickerPortal(props: ComponentPropsWithoutRef<typeof Popover.Portal>): import("react").JSX.Element;
41
41
  type ColorPickerPositionerProps = ComponentPropsWithoutRef<typeof Popover.Positioner>;
42
42
  declare const ColorPickerPositioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
43
43
  type ColorPickerPopupProps = ComponentPropsWithoutRef<typeof Popover.Popup>;
@@ -77,7 +77,7 @@ declare const ColorPicker: {
77
77
  } & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
78
78
  Preview: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
79
79
  Value: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
80
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
80
+ Portal: typeof ColorPickerPortal;
81
81
  Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
82
82
  Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
83
83
  Palette: import("react").ForwardRefExoticComponent<ColorPickerPaletteProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -2,6 +2,7 @@
2
2
  import { cx } from "../../styled-system/css/cx.js";
3
3
  import { withRecipeClassName } from "../base-ui.js";
4
4
  import { colorPicker } from "../../styled-system/recipes/color-picker.js";
5
+ import { useThemePortalProps } from "../../theme/theme-scope.js";
5
6
  import { defaultColor, formatColor, parseColor } from "./color-utils.js";
6
7
  import { createContext, forwardRef, useContext, useEffect, useId, useState } from "react";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -102,7 +103,9 @@ const ColorPickerValue = forwardRef(function ColorPickerValue({ className, ...pr
102
103
  children: props.children ?? value
103
104
  });
104
105
  });
105
- const ColorPickerPortal = Popover.Portal;
106
+ function ColorPickerPortal(props) {
107
+ return /* @__PURE__ */ jsx(Popover.Portal, { ...useThemePortalProps(props) });
108
+ }
106
109
  const ColorPickerPositioner = forwardRef(function ColorPickerPositioner({ className, ...props }, ref) {
107
110
  return /* @__PURE__ */ jsx(Popover.Positioner, {
108
111
  ...props,