@epilot/spark-ui 0.25.0 → 0.26.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 (129) hide show
  1. package/dist/components/alert-dialog.cjs +4 -2
  2. package/dist/components/alert-dialog.cjs.map +1 -1
  3. package/dist/components/alert-dialog.d.cts +4 -1
  4. package/dist/components/alert-dialog.d.ts +4 -1
  5. package/dist/components/alert-dialog.js +4 -2
  6. package/dist/components/alert-dialog.js.map +1 -1
  7. package/dist/components/autocomplete.cjs +3 -2
  8. package/dist/components/autocomplete.cjs.map +1 -1
  9. package/dist/components/autocomplete.js +3 -2
  10. package/dist/components/autocomplete.js.map +1 -1
  11. package/dist/components/avatar.js +1 -1
  12. package/dist/components/badge.js +1 -1
  13. package/dist/components/banner.cjs +74 -0
  14. package/dist/components/banner.cjs.map +1 -0
  15. package/dist/components/banner.d.cts +27 -0
  16. package/dist/components/banner.d.ts +27 -0
  17. package/dist/components/banner.js +72 -0
  18. package/dist/components/banner.js.map +1 -0
  19. package/dist/components/box.js +1 -1
  20. package/dist/components/bubble.d.cts +1 -1
  21. package/dist/components/bubble.d.ts +1 -1
  22. package/dist/components/button-group.js +1 -1
  23. package/dist/components/button.d.cts +3 -3
  24. package/dist/components/button.d.ts +3 -3
  25. package/dist/components/button.js +1 -1
  26. package/dist/components/card.js +1 -1
  27. package/dist/components/checkbox.js +1 -1
  28. package/dist/components/data-list.cjs +39 -0
  29. package/dist/components/data-list.cjs.map +1 -0
  30. package/dist/components/data-list.d.cts +33 -0
  31. package/dist/components/data-list.d.ts +33 -0
  32. package/dist/components/data-list.js +35 -0
  33. package/dist/components/data-list.js.map +1 -0
  34. package/dist/components/dialog.cjs +4 -2
  35. package/dist/components/dialog.cjs.map +1 -1
  36. package/dist/components/dialog.d.cts +4 -1
  37. package/dist/components/dialog.d.ts +4 -1
  38. package/dist/components/dialog.js +4 -2
  39. package/dist/components/dialog.js.map +1 -1
  40. package/dist/components/drawer.cjs +12 -2
  41. package/dist/components/drawer.cjs.map +1 -1
  42. package/dist/components/drawer.d.cts +4 -1
  43. package/dist/components/drawer.d.ts +4 -1
  44. package/dist/components/drawer.js +13 -3
  45. package/dist/components/drawer.js.map +1 -1
  46. package/dist/components/dropdown-menu.cjs +5 -3
  47. package/dist/components/dropdown-menu.cjs.map +1 -1
  48. package/dist/components/dropdown-menu.d.cts +1 -0
  49. package/dist/components/dropdown-menu.d.ts +1 -0
  50. package/dist/components/dropdown-menu.js +5 -3
  51. package/dist/components/dropdown-menu.js.map +1 -1
  52. package/dist/components/empty-state.cjs +107 -25
  53. package/dist/components/empty-state.cjs.map +1 -1
  54. package/dist/components/empty-state.d.cts +28 -11
  55. package/dist/components/empty-state.d.ts +28 -11
  56. package/dist/components/empty-state.js +104 -26
  57. package/dist/components/empty-state.js.map +1 -1
  58. package/dist/components/field.cjs +1 -1
  59. package/dist/components/field.js +1 -1
  60. package/dist/components/icon.js +1 -1
  61. package/dist/components/info-block.d.cts +1 -1
  62. package/dist/components/info-block.d.ts +1 -1
  63. package/dist/components/input-otp.cjs +1 -1
  64. package/dist/components/input-otp.js +1 -1
  65. package/dist/components/input.cjs +1 -1
  66. package/dist/components/input.js +1 -1
  67. package/dist/components/kbd.cjs +14 -0
  68. package/dist/components/kbd.cjs.map +1 -0
  69. package/dist/components/kbd.d.cts +13 -0
  70. package/dist/components/kbd.d.ts +13 -0
  71. package/dist/components/kbd.js +13 -0
  72. package/dist/components/kbd.js.map +1 -0
  73. package/dist/components/list.cjs +5 -4
  74. package/dist/components/list.cjs.map +1 -1
  75. package/dist/components/list.d.cts +7 -2
  76. package/dist/components/list.d.ts +7 -2
  77. package/dist/components/list.js +5 -4
  78. package/dist/components/list.js.map +1 -1
  79. package/dist/components/marker.d.cts +1 -1
  80. package/dist/components/marker.d.ts +1 -1
  81. package/dist/components/message-scroller.cjs +1 -1
  82. package/dist/components/message-scroller.js +1 -1
  83. package/dist/components/page-header.d.cts +1 -1
  84. package/dist/components/page-header.d.ts +1 -1
  85. package/dist/components/pill.js +1 -1
  86. package/dist/components/popover.cjs +3 -2
  87. package/dist/components/popover.cjs.map +1 -1
  88. package/dist/components/popover.js +3 -2
  89. package/dist/components/popover.js.map +1 -1
  90. package/dist/components/radio.js +1 -1
  91. package/dist/components/select.cjs +4 -3
  92. package/dist/components/select.cjs.map +1 -1
  93. package/dist/components/select.js +4 -3
  94. package/dist/components/select.js.map +1 -1
  95. package/dist/components/separator.cjs +35 -17
  96. package/dist/components/separator.cjs.map +1 -1
  97. package/dist/components/separator.d.cts +1 -0
  98. package/dist/components/separator.d.ts +1 -0
  99. package/dist/components/separator.js +35 -17
  100. package/dist/components/separator.js.map +1 -1
  101. package/dist/components/sheet.cjs +4 -2
  102. package/dist/components/sheet.cjs.map +1 -1
  103. package/dist/components/sheet.d.cts +4 -1
  104. package/dist/components/sheet.d.ts +4 -1
  105. package/dist/components/sheet.js +4 -2
  106. package/dist/components/sheet.js.map +1 -1
  107. package/dist/components/switch.js +1 -1
  108. package/dist/components/textarea.cjs +1 -1
  109. package/dist/components/textarea.js +1 -1
  110. package/dist/components/theme.cjs +118 -24
  111. package/dist/components/theme.cjs.map +1 -1
  112. package/dist/components/theme.d.cts +7 -1
  113. package/dist/components/theme.d.ts +7 -1
  114. package/dist/components/theme.js +120 -27
  115. package/dist/components/theme.js.map +1 -1
  116. package/dist/components/toast.cjs +3 -2
  117. package/dist/components/toast.cjs.map +1 -1
  118. package/dist/components/toast.js +3 -2
  119. package/dist/components/toast.js.map +1 -1
  120. package/dist/components/toggle-group.js +1 -1
  121. package/dist/components/toggle.cjs +1 -1
  122. package/dist/components/toggle.js +2 -2
  123. package/dist/components/tooltip.cjs +5 -3
  124. package/dist/components/tooltip.cjs.map +1 -1
  125. package/dist/components/tooltip.d.cts +1 -0
  126. package/dist/components/tooltip.d.ts +1 -0
  127. package/dist/components/tooltip.js +5 -3
  128. package/dist/components/tooltip.js.map +1 -1
  129. package/package.json +1 -1
@@ -10,7 +10,7 @@ declare function BubbleGroup({
10
10
  ...props
11
11
  }: React$1.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
12
  declare const bubbleVariants: (props?: ({
13
- variant?: "ghost" | "outline" | "secondary" | "destructive" | "default" | "muted" | "tinted" | null | undefined;
13
+ variant?: "ghost" | "outline" | "default" | "secondary" | "muted" | "tinted" | "destructive" | null | undefined;
14
14
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
15
  declare function Bubble({
16
16
  variant,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  "use client";
3
- import { accentByColor } from "../lib/accent-colors.js";
4
3
  import { cn } from "../utils/cn.js";
4
+ import { accentByColor } from "../lib/accent-colors.js";
5
5
  import * as React$1 from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { Button } from "@base-ui/react/button";
@@ -7,9 +7,9 @@ import { VariantProps } from "class-variance-authority";
7
7
 
8
8
  //#region src/components/button.d.ts
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "primary" | "secondary" | "tertiary" | "bare" | "destructive" | null | undefined;
11
- color?: "accent" | "neutral" | "primary" | "destructive" | "danger" | null | undefined;
12
- size?: "small" | "default" | "medium" | "icon-small" | "icon" | "icon-medium" | null | undefined;
10
+ variant?: "secondary" | "destructive" | "primary" | "tertiary" | "bare" | null | undefined;
11
+ color?: "neutral" | "accent" | "destructive" | "primary" | "danger" | null | undefined;
12
+ size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  /** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */
15
15
  type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
@@ -7,9 +7,9 @@ import { VariantProps } from "class-variance-authority";
7
7
 
8
8
  //#region src/components/button.d.ts
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "primary" | "secondary" | "tertiary" | "bare" | "destructive" | null | undefined;
11
- color?: "accent" | "neutral" | "primary" | "destructive" | "danger" | null | undefined;
12
- size?: "small" | "default" | "medium" | "icon-small" | "icon" | "icon-medium" | null | undefined;
10
+ variant?: "secondary" | "destructive" | "primary" | "tertiary" | "bare" | null | undefined;
11
+ color?: "neutral" | "accent" | "destructive" | "primary" | "danger" | null | undefined;
12
+ size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  /** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */
15
15
  type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  "use client";
3
- import { accentByColor } from "../lib/accent-colors.js";
4
3
  import { cn } from "../utils/cn.js";
4
+ import { accentByColor } from "../lib/accent-colors.js";
5
5
  import * as React$1 from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { Button as Button$1 } from "@base-ui/react/button";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
3
2
  import { cn } from "../utils/cn.js";
3
+ import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
4
4
  import * as React$1 from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { cva } from "class-variance-authority";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { accentByColor } from "../lib/accent-colors.js";
3
2
  import { cn } from "../utils/cn.js";
3
+ import { accentByColor } from "../lib/accent-colors.js";
4
4
  import * as React$1 from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_components_separator = require("./separator.cjs");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let cn = require("cn");
6
+ //#region src/components/data-list.tsx
7
+ const DataList = ({ variant = "plain", className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
8
+ "data-slot": "data-list",
9
+ "data-variant": variant,
10
+ className: (0, cn.cn)("group/data-list flex flex-col text-sm text-gray", variant === "stacked" ? "gap-4" : "gap-2", className),
11
+ ...props
12
+ });
13
+ const DataListItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
14
+ "data-slot": "data-list-item",
15
+ className: (0, cn.cn)("flex items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-col group-data-[variant=stacked]/data-list:items-stretch group-data-[variant=stacked]/data-list:gap-1", className),
16
+ ...props
17
+ });
18
+ const DataListLabel = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dt", {
19
+ "data-slot": "data-list-label",
20
+ className: (0, cn.cn)("flex flex-1 items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-none group-data-[variant=stacked]/data-list:text-gray-light", className),
21
+ ...props,
22
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_separator.Separator, {
23
+ variant: "dotted",
24
+ className: "hidden min-w-4 flex-1 group-data-[variant=dotted]/data-list:block",
25
+ "aria-hidden": true
26
+ })]
27
+ });
28
+ const DataListValue = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
29
+ "data-slot": "data-list-value",
30
+ className: (0, cn.cn)("min-w-0 text-end wrap-break-word tabular-nums group-data-[variant=dotted]/data-list:shrink-0 group-data-[variant=stacked]/data-list:text-start", className),
31
+ ...props
32
+ });
33
+ //#endregion
34
+ exports.DataList = DataList;
35
+ exports.DataListItem = DataListItem;
36
+ exports.DataListLabel = DataListLabel;
37
+ exports.DataListValue = DataListValue;
38
+
39
+ //# sourceMappingURL=data-list.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-list.cjs","names":["Separator"],"sources":["../../src/components/data-list.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Separator } from './separator'\n\ninterface DataListProps extends React.HTMLAttributes<HTMLDListElement> {\n /**\n * `dotted` joins each label to its value with a dotted leader; `stacked` puts\n * each label above its value.\n */\n variant?: 'plain' | 'dotted' | 'stacked'\n}\n\nconst DataList = ({\n variant = 'plain',\n className,\n ...props\n}: DataListProps) => (\n <dl\n data-slot=\"data-list\"\n data-variant={variant}\n className={cn(\n 'group/data-list flex flex-col text-sm text-gray',\n variant === 'stacked' ? 'gap-4' : 'gap-2',\n className,\n )}\n {...props}\n />\n)\n\nconst DataListItem = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"data-list-item\"\n className={cn(\n 'flex items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-col group-data-[variant=stacked]/data-list:items-stretch group-data-[variant=stacked]/data-list:gap-1',\n className,\n )}\n {...props}\n />\n)\n\n// The leader lives inside <dt>: a <dl> item may only hold <dt> and <dd>.\n// A plain value wraps instead of overflowing; a dotted one (an amount) never breaks.\nconst DataListLabel = ({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) => (\n <dt\n data-slot=\"data-list-label\"\n className={cn(\n 'flex flex-1 items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-none group-data-[variant=stacked]/data-list:text-gray-light',\n className,\n )}\n {...props}\n >\n <span>{children}</span>\n <Separator\n variant=\"dotted\"\n className=\"hidden min-w-4 flex-1 group-data-[variant=dotted]/data-list:block\"\n aria-hidden\n />\n </dt>\n)\n\nconst DataListValue = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLElement>) => (\n <dd\n data-slot=\"data-list-value\"\n className={cn(\n 'min-w-0 text-end wrap-break-word tabular-nums group-data-[variant=dotted]/data-list:shrink-0 group-data-[variant=stacked]/data-list:text-start',\n className,\n )}\n {...props}\n />\n)\n\nexport { DataList, DataListItem, DataListLabel, DataListValue }\nexport type { DataListProps }\n"],"mappings":";;;;;;AAYA,MAAM,YAAY,EAChB,UAAU,SACV,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,MAAD;CACE,aAAU;CACV,gBAAc;CACd,YAAA,GAAA,GAAA,IACE,mDACA,YAAY,YAAY,UAAU,SAClC,SACF;CACA,GAAI;AACL,CAAA;AAGH,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,OAAD;CACE,aAAU;CACV,YAAA,GAAA,GAAA,IACE,+KACA,SACF;CACA,GAAI;AACL,CAAA;AAKH,MAAM,iBAAiB,EACrB,WACA,UACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,MAAC,MAAD;CACE,aAAU;CACV,YAAA,GAAA,GAAA,IACE,4IACA,SACF;CACA,GAAI;WANN,CAQE,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAO,SAAe,CAAA,GACtB,iBAAA,GAAA,kBAAA,KAACA,6BAAAA,WAAD;EACE,SAAQ;EACR,WAAU;EACV,eAAA;CACD,CAAA,CACC;;AAGN,MAAM,iBAAiB,EACrB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,MAAD;CACE,aAAU;CACV,YAAA,GAAA,GAAA,IACE,kJACA,SACF;CACA,GAAI;AACL,CAAA"}
@@ -0,0 +1,33 @@
1
+ "use client";
2
+
3
+ import * as React$1 from "react";
4
+
5
+ //#region src/components/data-list.d.ts
6
+ interface DataListProps extends React$1.HTMLAttributes<HTMLDListElement> {
7
+ /**
8
+ * `dotted` joins each label to its value with a dotted leader; `stacked` puts
9
+ * each label above its value.
10
+ */
11
+ variant?: 'plain' | 'dotted' | 'stacked';
12
+ }
13
+ declare const DataList: ({
14
+ variant,
15
+ className,
16
+ ...props
17
+ }: DataListProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const DataListItem: ({
19
+ className,
20
+ ...props
21
+ }: React$1.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
22
+ declare const DataListLabel: ({
23
+ className,
24
+ children,
25
+ ...props
26
+ }: React$1.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
27
+ declare const DataListValue: ({
28
+ className,
29
+ ...props
30
+ }: React$1.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
31
+ //#endregion
32
+ export { DataList, DataListItem, DataListLabel, type DataListProps, DataListValue };
33
+ //# sourceMappingURL=data-list.d.cts.map
@@ -0,0 +1,33 @@
1
+ "use client";
2
+
3
+ import * as React$1 from "react";
4
+
5
+ //#region src/components/data-list.d.ts
6
+ interface DataListProps extends React$1.HTMLAttributes<HTMLDListElement> {
7
+ /**
8
+ * `dotted` joins each label to its value with a dotted leader; `stacked` puts
9
+ * each label above its value.
10
+ */
11
+ variant?: 'plain' | 'dotted' | 'stacked';
12
+ }
13
+ declare const DataList: ({
14
+ variant,
15
+ className,
16
+ ...props
17
+ }: DataListProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const DataListItem: ({
19
+ className,
20
+ ...props
21
+ }: React$1.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
22
+ declare const DataListLabel: ({
23
+ className,
24
+ children,
25
+ ...props
26
+ }: React$1.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
27
+ declare const DataListValue: ({
28
+ className,
29
+ ...props
30
+ }: React$1.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
31
+ //#endregion
32
+ export { DataList, DataListItem, DataListLabel, type DataListProps, DataListValue };
33
+ //# sourceMappingURL=data-list.d.ts.map
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { Separator } from "./separator.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/data-list.tsx
6
+ const DataList = ({ variant = "plain", className, ...props }) => /* @__PURE__ */ jsx("dl", {
7
+ "data-slot": "data-list",
8
+ "data-variant": variant,
9
+ className: cn("group/data-list flex flex-col text-sm text-gray", variant === "stacked" ? "gap-4" : "gap-2", className),
10
+ ...props
11
+ });
12
+ const DataListItem = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
13
+ "data-slot": "data-list-item",
14
+ className: cn("flex items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-col group-data-[variant=stacked]/data-list:items-stretch group-data-[variant=stacked]/data-list:gap-1", className),
15
+ ...props
16
+ });
17
+ const DataListLabel = ({ className, children, ...props }) => /* @__PURE__ */ jsxs("dt", {
18
+ "data-slot": "data-list-label",
19
+ className: cn("flex flex-1 items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-none group-data-[variant=stacked]/data-list:text-gray-light", className),
20
+ ...props,
21
+ children: [/* @__PURE__ */ jsx("span", { children }), /* @__PURE__ */ jsx(Separator, {
22
+ variant: "dotted",
23
+ className: "hidden min-w-4 flex-1 group-data-[variant=dotted]/data-list:block",
24
+ "aria-hidden": true
25
+ })]
26
+ });
27
+ const DataListValue = ({ className, ...props }) => /* @__PURE__ */ jsx("dd", {
28
+ "data-slot": "data-list-value",
29
+ className: cn("min-w-0 text-end wrap-break-word tabular-nums group-data-[variant=dotted]/data-list:shrink-0 group-data-[variant=stacked]/data-list:text-start", className),
30
+ ...props
31
+ });
32
+ //#endregion
33
+ export { DataList, DataListItem, DataListLabel, DataListValue };
34
+
35
+ //# sourceMappingURL=data-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-list.js","names":[],"sources":["../../src/components/data-list.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Separator } from './separator'\n\ninterface DataListProps extends React.HTMLAttributes<HTMLDListElement> {\n /**\n * `dotted` joins each label to its value with a dotted leader; `stacked` puts\n * each label above its value.\n */\n variant?: 'plain' | 'dotted' | 'stacked'\n}\n\nconst DataList = ({\n variant = 'plain',\n className,\n ...props\n}: DataListProps) => (\n <dl\n data-slot=\"data-list\"\n data-variant={variant}\n className={cn(\n 'group/data-list flex flex-col text-sm text-gray',\n variant === 'stacked' ? 'gap-4' : 'gap-2',\n className,\n )}\n {...props}\n />\n)\n\nconst DataListItem = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"data-list-item\"\n className={cn(\n 'flex items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-col group-data-[variant=stacked]/data-list:items-stretch group-data-[variant=stacked]/data-list:gap-1',\n className,\n )}\n {...props}\n />\n)\n\n// The leader lives inside <dt>: a <dl> item may only hold <dt> and <dd>.\n// A plain value wraps instead of overflowing; a dotted one (an amount) never breaks.\nconst DataListLabel = ({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLElement>) => (\n <dt\n data-slot=\"data-list-label\"\n className={cn(\n 'flex flex-1 items-baseline gap-2 group-data-[variant=stacked]/data-list:flex-none group-data-[variant=stacked]/data-list:text-gray-light',\n className,\n )}\n {...props}\n >\n <span>{children}</span>\n <Separator\n variant=\"dotted\"\n className=\"hidden min-w-4 flex-1 group-data-[variant=dotted]/data-list:block\"\n aria-hidden\n />\n </dt>\n)\n\nconst DataListValue = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLElement>) => (\n <dd\n data-slot=\"data-list-value\"\n className={cn(\n 'min-w-0 text-end wrap-break-word tabular-nums group-data-[variant=dotted]/data-list:shrink-0 group-data-[variant=stacked]/data-list:text-start',\n className,\n )}\n {...props}\n />\n)\n\nexport { DataList, DataListItem, DataListLabel, DataListValue }\nexport type { DataListProps }\n"],"mappings":";;;;;AAYA,MAAM,YAAY,EAChB,UAAU,SACV,WACA,GAAG,YAEH,oBAAC,MAAD;CACE,aAAU;CACV,gBAAc;CACd,WAAW,GACT,mDACA,YAAY,YAAY,UAAU,SAClC,SACF;CACA,GAAI;AACL,CAAA;AAGH,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,oBAAC,OAAD;CACE,aAAU;CACV,WAAW,GACT,+KACA,SACF;CACA,GAAI;AACL,CAAA;AAKH,MAAM,iBAAiB,EACrB,WACA,UACA,GAAG,YAEH,qBAAC,MAAD;CACE,aAAU;CACV,WAAW,GACT,4IACA,SACF;CACA,GAAI;WANN,CAQE,oBAAC,QAAD,EAAO,SAAe,CAAA,GACtB,oBAAC,WAAD;EACE,SAAQ;EACR,WAAU;EACV,eAAA;CACD,CAAA,CACC;;AAGN,MAAM,iBAAiB,EACrB,WACA,GAAG,YAEH,oBAAC,MAAD;CACE,aAAU;CACV,WAAW,GACT,kJACA,SACF;CACA,GAAI;AACL,CAAA"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  const require_components_button = require("./button.cjs");
5
+ const require_components_theme = require("./theme.cjs");
5
6
  let react = require("react");
6
7
  react = require_chunk.__toESM(react);
7
8
  let _epilot_spark_icons = require("@epilot/spark-icons");
@@ -31,10 +32,11 @@ function DialogTrigger(props) {
31
32
  ...props
32
33
  });
33
34
  }
34
- function DialogPortal(props) {
35
+ function DialogPortal({ children, ...props }) {
35
36
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Portal, {
36
37
  "data-slot": "dialog-portal",
37
- ...props
38
+ ...props,
39
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_theme.PortalTheme, { children })
38
40
  });
39
41
  }
40
42
  function DialogClose({ className, children, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.cjs","names":["DialogPrimitive","buttonVariants","Close"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { Close } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\n// Our dialogs contain interactive elements that are mounted outside of the dialog\n// Browser extensions like password managers or grammar checkers are also mounted outside\n// We still dismiss on a click/tap outside: a genuine outside press lands on a\n// backdrop (our styled one, or Base UI's internal inert backdrop when modal)\nfunction isBackdropPress(event: Event | undefined) {\n const target = event?.target\n return (\n target instanceof HTMLElement &&\n (target.dataset.overlay === 'true' ||\n target.hasAttribute('data-base-ui-inert'))\n )\n}\n\nfunction Dialog({\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return (\n <DialogPrimitive.Root\n {...props}\n onOpenChange={(open, eventDetails) => {\n if (\n !open &&\n eventDetails.reason === 'outside-press' &&\n !isBackdropPress(eventDetails.event)\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n />\n )\n}\n\nfunction DialogTrigger(\n props: React.ComponentProps<typeof DialogPrimitive.Trigger>,\n) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal(\n props: React.ComponentProps<typeof DialogPrimitive.Portal>,\n) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\n// bare = the ready-made corner X (label is the consumer's, via aria-label);\n// with children or a render prop it stays the bare primitive (footer buttons, custom closes)\nfunction DialogClose({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n if (children || props.render) {\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={className}\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-2.5 right-3 rounded-full',\n className,\n )}\n {...props}\n >\n <Close className=\"[--spark-icon-size:calc(20px*var(--spark-scaling,1))]\" />\n </DialogPrimitive.Close>\n )\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:transition-none',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup>) {\n return (\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-(--spark-viewport-center-y,50%) left-[50%] z-50 grid w-[90%] max-w-lg min-w-80 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg bg-gray-2 p-4 text-gray shadow-lg transition-[top,opacity,translate,scale] duration-200 motion-reduce:transition-none sm:w-1/2',\n // enter/exit: fade + zoom + a slight upward offset (was animate-in/out)\n 'data-starting-style:translate-y-[-52%] data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:translate-y-[-52%] data-ending-style:scale-95 data-ending-style:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-1', className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAS,gBAAgB,OAA0B;CACjD,MAAM,SAAS,OAAO;CACtB,OACE,kBAAkB,gBACjB,OAAO,QAAQ,YAAY,UAC1B,OAAO,aAAa,oBAAoB;AAE9C;AAEA,SAAS,OAAO,EACd,cACA,GAAG,SACiD;CACpD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,MAAjB;EACE,GAAI;EACJ,eAAe,MAAM,iBAAiB;GACpC,IACE,CAAC,QACD,aAAa,WAAW,mBACxB,CAAC,gBAAgB,aAAa,KAAK,GACnC;IACA,aAAa,OAAO;IACpB;GACF;GACA,eAAe,MAAM,YAAY;EACnC;CACD,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAIA,SAAS,YAAY,EACnB,WACA,UACA,GAAG,SACkD;CACrD,IAAI,YAAY,MAAM,QACpB,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACC;EACX,GAAI;EAEH;CACoB,CAAA;CAI3B,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACEC,0BAAAA,eAAe;GAAE,MAAM;GAAQ,SAAS;EAAW,CAAC,GACpD,yCACA,SACF;EACA,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,OAAD,EAAO,WAAU,wDAAyD,CAAA;CACrD,CAAA;AAE3B;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACqD;CACxD,OACE,iBAAA,GAAA,kBAAA,KAACF,sBAAAA,OAAgB,UAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,kRACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,kRAEA,qGACA,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,0DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"dialog.cjs","names":["DialogPrimitive","PortalTheme","buttonVariants","Close"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { Close } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { PortalTheme } from './theme'\n\n// Our dialogs contain interactive elements that are mounted outside of the dialog\n// Browser extensions like password managers or grammar checkers are also mounted outside\n// We still dismiss on a click/tap outside: a genuine outside press lands on a\n// backdrop (our styled one, or Base UI's internal inert backdrop when modal)\nfunction isBackdropPress(event: Event | undefined) {\n const target = event?.target\n return (\n target instanceof HTMLElement &&\n (target.dataset.overlay === 'true' ||\n target.hasAttribute('data-base-ui-inert'))\n )\n}\n\nfunction Dialog({\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return (\n <DialogPrimitive.Root\n {...props}\n onOpenChange={(open, eventDetails) => {\n if (\n !open &&\n eventDetails.reason === 'outside-press' &&\n !isBackdropPress(eventDetails.event)\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n />\n )\n}\n\nfunction DialogTrigger(\n props: React.ComponentProps<typeof DialogPrimitive.Trigger>,\n) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return (\n <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props}>\n <PortalTheme>{children}</PortalTheme>\n </DialogPrimitive.Portal>\n )\n}\n\n// bare = the ready-made corner X (label is the consumer's, via aria-label);\n// with children or a render prop it stays the bare primitive (footer buttons, custom closes)\nfunction DialogClose({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n if (children || props.render) {\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={className}\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-2.5 right-3 rounded-full',\n className,\n )}\n {...props}\n >\n <Close className=\"[--spark-icon-size:calc(20px*var(--spark-scaling,1))]\" />\n </DialogPrimitive.Close>\n )\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:transition-none',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup>) {\n return (\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-(--spark-viewport-center-y,50%) left-[50%] z-50 grid w-[90%] max-w-lg min-w-80 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg bg-gray-2 p-4 text-gray shadow-lg transition-[top,opacity,translate,scale] duration-200 motion-reduce:transition-none sm:w-1/2',\n // enter/exit: fade + zoom + a slight upward offset (was animate-in/out)\n 'data-starting-style:translate-y-[-52%] data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:translate-y-[-52%] data-ending-style:scale-95 data-ending-style:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-1', className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,gBAAgB,OAA0B;CACjD,MAAM,SAAS,OAAO;CACtB,OACE,kBAAkB,gBACjB,OAAO,QAAQ,YAAY,UAC1B,OAAO,aAAa,oBAAoB;AAE9C;AAEA,SAAS,OAAO,EACd,cACA,GAAG,SACiD;CACpD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,MAAjB;EACE,GAAI;EACJ,eAAe,MAAM,iBAAiB;GACpC,IACE,CAAC,QACD,aAAa,WAAW,mBACxB,CAAC,gBAAgB,aAAa,KAAK,GACnC;IACA,aAAa,OAAO;IACpB;GACF;GACA,eAAe,MAAM,YAAY;EACnC;CACD,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,UACA,GAAG,SACmD;CACtD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;YACpD,iBAAA,GAAA,kBAAA,KAACC,yBAAAA,aAAD,EAAc,SAAsB,CAAA;CACd,CAAA;AAE5B;AAIA,SAAS,YAAY,EACnB,WACA,UACA,GAAG,SACkD;CACrD,IAAI,YAAY,MAAM,QACpB,OACE,iBAAA,GAAA,kBAAA,KAACD,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACC;EACX,GAAI;EAEH;CACoB,CAAA;CAI3B,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACEE,0BAAAA,eAAe;GAAE,MAAM;GAAQ,SAAS;EAAW,CAAC,GACpD,yCACA,SACF;EACA,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,OAAD,EAAO,WAAU,wDAAyD,CAAA;CACrD,CAAA;AAE3B;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACqD;CACxD,OACE,iBAAA,GAAA,kBAAA,KAACH,sBAAAA,OAAgB,UAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,kRACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,kRAEA,qGACA,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,0DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
@@ -9,7 +9,10 @@ declare function Dialog({
9
9
  ...props
10
10
  }: React$1.ComponentProps<typeof Dialog$1.Root>): import("react/jsx-runtime").JSX.Element;
11
11
  declare function DialogTrigger(props: React$1.ComponentProps<typeof Dialog$1.Trigger>): import("react/jsx-runtime").JSX.Element;
12
- declare function DialogPortal(props: React$1.ComponentProps<typeof Dialog$1.Portal>): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogPortal({
13
+ children,
14
+ ...props
15
+ }: React$1.ComponentProps<typeof Dialog$1.Portal>): import("react/jsx-runtime").JSX.Element;
13
16
  declare function DialogClose({
14
17
  className,
15
18
  children,
@@ -9,7 +9,10 @@ declare function Dialog({
9
9
  ...props
10
10
  }: React$1.ComponentProps<typeof Dialog$1.Root>): import("react/jsx-runtime").JSX.Element;
11
11
  declare function DialogTrigger(props: React$1.ComponentProps<typeof Dialog$1.Trigger>): import("react/jsx-runtime").JSX.Element;
12
- declare function DialogPortal(props: React$1.ComponentProps<typeof Dialog$1.Portal>): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogPortal({
13
+ children,
14
+ ...props
15
+ }: React$1.ComponentProps<typeof Dialog$1.Portal>): import("react/jsx-runtime").JSX.Element;
13
16
  declare function DialogClose({
14
17
  className,
15
18
  children,
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
3
  import { buttonVariants } from "./button.js";
4
+ import { PortalTheme } from "./theme.js";
4
5
  import "react";
5
6
  import { Close } from "@epilot/spark-icons";
6
7
  import { jsx } from "react/jsx-runtime";
@@ -28,10 +29,11 @@ function DialogTrigger(props) {
28
29
  ...props
29
30
  });
30
31
  }
31
- function DialogPortal(props) {
32
+ function DialogPortal({ children, ...props }) {
32
33
  return /* @__PURE__ */ jsx(Dialog$1.Portal, {
33
34
  "data-slot": "dialog-portal",
34
- ...props
35
+ ...props,
36
+ children: /* @__PURE__ */ jsx(PortalTheme, { children })
35
37
  });
36
38
  }
37
39
  function DialogClose({ className, children, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { Close } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\n// Our dialogs contain interactive elements that are mounted outside of the dialog\n// Browser extensions like password managers or grammar checkers are also mounted outside\n// We still dismiss on a click/tap outside: a genuine outside press lands on a\n// backdrop (our styled one, or Base UI's internal inert backdrop when modal)\nfunction isBackdropPress(event: Event | undefined) {\n const target = event?.target\n return (\n target instanceof HTMLElement &&\n (target.dataset.overlay === 'true' ||\n target.hasAttribute('data-base-ui-inert'))\n )\n}\n\nfunction Dialog({\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return (\n <DialogPrimitive.Root\n {...props}\n onOpenChange={(open, eventDetails) => {\n if (\n !open &&\n eventDetails.reason === 'outside-press' &&\n !isBackdropPress(eventDetails.event)\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n />\n )\n}\n\nfunction DialogTrigger(\n props: React.ComponentProps<typeof DialogPrimitive.Trigger>,\n) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal(\n props: React.ComponentProps<typeof DialogPrimitive.Portal>,\n) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\n// bare = the ready-made corner X (label is the consumer's, via aria-label);\n// with children or a render prop it stays the bare primitive (footer buttons, custom closes)\nfunction DialogClose({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n if (children || props.render) {\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={className}\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-2.5 right-3 rounded-full',\n className,\n )}\n {...props}\n >\n <Close className=\"[--spark-icon-size:calc(20px*var(--spark-scaling,1))]\" />\n </DialogPrimitive.Close>\n )\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:transition-none',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup>) {\n return (\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-(--spark-viewport-center-y,50%) left-[50%] z-50 grid w-[90%] max-w-lg min-w-80 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg bg-gray-2 p-4 text-gray shadow-lg transition-[top,opacity,translate,scale] duration-200 motion-reduce:transition-none sm:w-1/2',\n // enter/exit: fade + zoom + a slight upward offset (was animate-in/out)\n 'data-starting-style:translate-y-[-52%] data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:translate-y-[-52%] data-ending-style:scale-95 data-ending-style:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-1', className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB,OAA0B;CACjD,MAAM,SAAS,OAAO;CACtB,OACE,kBAAkB,gBACjB,OAAO,QAAQ,YAAY,UAC1B,OAAO,aAAa,oBAAoB;AAE9C;AAEA,SAAS,OAAO,EACd,cACA,GAAG,SACiD;CACpD,OACE,oBAACA,SAAgB,MAAjB;EACE,GAAI;EACJ,eAAe,MAAM,iBAAiB;GACpC,IACE,CAAC,QACD,aAAa,WAAW,mBACxB,CAAC,gBAAgB,aAAa,KAAK,GACnC;IACA,aAAa,OAAO;IACpB;GACF;GACA,eAAe,MAAM,YAAY;EACnC;CACD,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aACP,OACA;CACA,OAAO,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAIA,SAAS,YAAY,EACnB,WACA,UACA,GAAG,SACkD;CACrD,IAAI,YAAY,MAAM,QACpB,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACC;EACX,GAAI;EAEH;CACoB,CAAA;CAI3B,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,eAAe;GAAE,MAAM;GAAQ,SAAS;EAAW,CAAC,GACpD,yCACA,SACF;EACA,GAAI;YAEJ,oBAAC,OAAD,EAAO,WAAU,wDAAyD,CAAA;CACrD,CAAA;AAE3B;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACqD;CACxD,OACE,oBAACA,SAAgB,UAAjB;EACE,aAAU;EACV,WAAW,GACT,kRACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,kRAEA,qGACA,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,0DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { Close } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { PortalTheme } from './theme'\n\n// Our dialogs contain interactive elements that are mounted outside of the dialog\n// Browser extensions like password managers or grammar checkers are also mounted outside\n// We still dismiss on a click/tap outside: a genuine outside press lands on a\n// backdrop (our styled one, or Base UI's internal inert backdrop when modal)\nfunction isBackdropPress(event: Event | undefined) {\n const target = event?.target\n return (\n target instanceof HTMLElement &&\n (target.dataset.overlay === 'true' ||\n target.hasAttribute('data-base-ui-inert'))\n )\n}\n\nfunction Dialog({\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return (\n <DialogPrimitive.Root\n {...props}\n onOpenChange={(open, eventDetails) => {\n if (\n !open &&\n eventDetails.reason === 'outside-press' &&\n !isBackdropPress(eventDetails.event)\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n />\n )\n}\n\nfunction DialogTrigger(\n props: React.ComponentProps<typeof DialogPrimitive.Trigger>,\n) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return (\n <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props}>\n <PortalTheme>{children}</PortalTheme>\n </DialogPrimitive.Portal>\n )\n}\n\n// bare = the ready-made corner X (label is the consumer's, via aria-label);\n// with children or a render prop it stays the bare primitive (footer buttons, custom closes)\nfunction DialogClose({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n if (children || props.render) {\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={className}\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className={cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-2.5 right-3 rounded-full',\n className,\n )}\n {...props}\n >\n <Close className=\"[--spark-icon-size:calc(20px*var(--spark-scaling,1))]\" />\n </DialogPrimitive.Close>\n )\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs motion-reduce:transition-none',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup>) {\n return (\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-(--spark-viewport-center-y,50%) left-[50%] z-50 grid w-[90%] max-w-lg min-w-80 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg bg-gray-2 p-4 text-gray shadow-lg transition-[top,opacity,translate,scale] duration-200 motion-reduce:transition-none sm:w-1/2',\n // enter/exit: fade + zoom + a slight upward offset (was animate-in/out)\n 'data-starting-style:translate-y-[-52%] data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-ending-style:translate-y-[-52%] data-ending-style:scale-95 data-ending-style:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-1', className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"],"mappings":";;;;;;;;;AAWA,SAAS,gBAAgB,OAA0B;CACjD,MAAM,SAAS,OAAO;CACtB,OACE,kBAAkB,gBACjB,OAAO,QAAQ,YAAY,UAC1B,OAAO,aAAa,oBAAoB;AAE9C;AAEA,SAAS,OAAO,EACd,cACA,GAAG,SACiD;CACpD,OACE,oBAACA,SAAgB,MAAjB;EACE,GAAI;EACJ,eAAe,MAAM,iBAAiB;GACpC,IACE,CAAC,QACD,aAAa,WAAW,mBACxB,CAAC,gBAAgB,aAAa,KAAK,GACnC;IACA,aAAa,OAAO;IACpB;GACF;GACA,eAAe,MAAM,YAAY;EACnC;CACD,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,UACA,GAAG,SACmD;CACtD,OACE,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;YACpD,oBAAC,aAAD,EAAc,SAAsB,CAAA;CACd,CAAA;AAE5B;AAIA,SAAS,YAAY,EACnB,WACA,UACA,GAAG,SACkD;CACrD,IAAI,YAAY,MAAM,QACpB,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACC;EACX,GAAI;EAEH;CACoB,CAAA;CAI3B,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,eAAe;GAAE,MAAM;GAAQ,SAAS;EAAW,CAAC,GACpD,yCACA,SACF;EACA,GAAI;YAEJ,oBAAC,OAAD,EAAO,WAAU,wDAAyD,CAAA;CACrD,CAAA;AAE3B;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACqD;CACxD,OACE,oBAACA,SAAgB,UAAjB;EACE,aAAU;EACV,WAAW,GACT,kRACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,kRAEA,qGACA,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,0DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
@@ -1,9 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
+ const require_components_theme = require("./theme.cjs");
4
5
  let react = require("react");
5
6
  react = require_chunk.__toESM(react);
6
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
+ let _base_ui_react_use_render = require("@base-ui/react/use-render");
7
9
  let vaul = require("vaul");
8
10
  let cn = require("cn");
9
11
  //#region src/components/drawer.tsx
@@ -20,12 +22,20 @@ function DrawerTrigger(props) {
20
22
  ...props
21
23
  });
22
24
  }
23
- function DrawerPortal(props) {
25
+ function DrawerPortal({ children, ...props }) {
24
26
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Portal, {
25
27
  "data-slot": "drawer-portal",
26
- ...props
28
+ ...props,
29
+ children: react.Children.map(children, (child) => react.isValidElement(child) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerPortalChild, { children: child }) : child)
27
30
  });
28
31
  }
32
+ const DrawerPortalChild = react.forwardRef(function DrawerPortalChild({ children }, ref) {
33
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_theme.PortalTheme, { children: (0, _base_ui_react_use_render.useRender)({
34
+ render: children,
35
+ ref,
36
+ props: {}
37
+ }) });
38
+ });
29
39
  function DrawerClose(props) {
30
40
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Close, {
31
41
  "data-slot": "drawer-close",
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.cjs","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\nimport { cn } from '../utils/cn'\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n )\n}\n\nfunction DrawerTrigger(\n props: React.ComponentProps<typeof DrawerPrimitive.Trigger>,\n) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal(\n props: React.ComponentProps<typeof DrawerPrimitive.Portal>,\n) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose(\n props: React.ComponentProps<typeof DrawerPrimitive.Close>,\n) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) supports-backdrop-filter:backdrop-blur-xs motion-reduce:animate-none! motion-reduce:transition-none!',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\ninterface DrawerContentProps extends React.ComponentProps<\n typeof DrawerPrimitive.Content\n> {\n pillClassName?: string\n}\n\nconst onInteractOutsideHandler = (event: CustomEvent) => {\n const target = event.target as HTMLElement\n const isOverlay = target.dataset.overlay === 'true'\n\n // Our drawers contain interactive elements that are mounted outside of the drawer\n // Browser extensions like password managers or grammar checkers are also mounted outside\n // We still dismiss on a click/tap outside\n if (!isOverlay) event.preventDefault()\n}\n\nfunction DrawerContent({\n className,\n pillClassName,\n children,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-gray-2 text-gray motion-reduce:animate-none! motion-reduce:transition-none!',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-(--spark-viewport-bottom-offset,0) data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg',\n 'data-[vaul-drawer-direction=left]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:border-gray-a1 data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'data-[vaul-drawer-direction=right]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-gray-a1 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n onInteractOutside={onInteractOutsideHandler}\n {...props}\n >\n <div\n className={cn(\n 'mx-auto mt-2.5 hidden h-1.5 w-16 shrink-0 rounded-full bg-base-gray-soft group-data-[vaul-drawer-direction=bottom]/drawer-content:block',\n pillClassName,\n )}\n />\n {children}\n </DrawerPrimitive.Content>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('flex flex-col gap-1 px-6 py-3', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\nexport type { DrawerContentProps }\n"],"mappings":";;;;;;;;;AAIA,SAAS,OAAO,EACd,wBAAwB,MACxB,GAAG,SACiD;CACpD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,MAAjB;EACE,aAAU;EACa;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,YACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,qNACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAQA,MAAM,4BAA4B,UAAuB;CAOvD,IAAI,EANW,MAAM,OACI,QAAQ,YAAY,SAK7B,MAAM,eAAe;AACvC;AAEA,SAAS,cAAc,EACrB,WACA,eACA,UACA,GAAG,SACkB;CACrB,OACE,iBAAA,GAAA,kBAAA,MAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,uIACA,2QACA,+OACA,gWACA,wWACA,SACF;EACA,mBAAmB;EACnB,GAAI;YAXN,CAaE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EACE,YAAA,GAAA,GAAA,IACE,2IACA,aACF,EACD,CAAA,GACA,QACsB;;AAE7B;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"drawer.cjs","names":["DrawerPrimitive","React","PortalTheme"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\nimport { cn } from '../utils/cn'\nimport { PortalTheme } from './theme'\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n )\n}\n\nfunction DrawerTrigger(\n props: React.ComponentProps<typeof DrawerPrimitive.Trigger>,\n) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return (\n <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props}>\n {React.Children.map(children, (child) =>\n React.isValidElement(child) ? (\n <DrawerPortalChild>{child}</DrawerPortalChild>\n ) : (\n child\n ),\n )}\n </DrawerPrimitive.Portal>\n )\n}\n\n// Radix clones each portal child with the Presence ref that gates the exit animation; it must land on the part, not the theme wrapper.\nconst DrawerPortalChild = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(function DrawerPortalChild({ children }, ref) {\n const part = useRender({ render: children, ref, props: {} })\n return <PortalTheme>{part}</PortalTheme>\n})\n\nfunction DrawerClose(\n props: React.ComponentProps<typeof DrawerPrimitive.Close>,\n) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) supports-backdrop-filter:backdrop-blur-xs motion-reduce:animate-none! motion-reduce:transition-none!',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\ninterface DrawerContentProps extends React.ComponentProps<\n typeof DrawerPrimitive.Content\n> {\n pillClassName?: string\n}\n\nconst onInteractOutsideHandler = (event: CustomEvent) => {\n const target = event.target as HTMLElement\n const isOverlay = target.dataset.overlay === 'true'\n\n // Our drawers contain interactive elements that are mounted outside of the drawer\n // Browser extensions like password managers or grammar checkers are also mounted outside\n // We still dismiss on a click/tap outside\n if (!isOverlay) event.preventDefault()\n}\n\nfunction DrawerContent({\n className,\n pillClassName,\n children,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-gray-2 text-gray motion-reduce:animate-none! motion-reduce:transition-none!',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-(--spark-viewport-bottom-offset,0) data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg',\n 'data-[vaul-drawer-direction=left]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:border-gray-a1 data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'data-[vaul-drawer-direction=right]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-gray-a1 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n onInteractOutside={onInteractOutsideHandler}\n {...props}\n >\n <div\n className={cn(\n 'mx-auto mt-2.5 hidden h-1.5 w-16 shrink-0 rounded-full bg-base-gray-soft group-data-[vaul-drawer-direction=bottom]/drawer-content:block',\n pillClassName,\n )}\n />\n {children}\n </DrawerPrimitive.Content>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('flex flex-col gap-1 px-6 py-3', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\nexport type { DrawerContentProps }\n"],"mappings":";;;;;;;;;;;AAMA,SAAS,OAAO,EACd,wBAAwB,MACxB,GAAG,SACiD;CACpD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,MAAjB;EACE,aAAU;EACa;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,UACA,GAAG,SACmD;CACtD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;YACnDC,MAAM,SAAS,IAAI,WAAW,UAC7BA,MAAM,eAAe,KAAK,IACxB,iBAAA,GAAA,kBAAA,KAAC,mBAAD,EAAA,UAAoB,MAAyB,CAAA,IAE7C,KAEJ;CACsB,CAAA;AAE5B;AAGA,MAAM,oBAAoBA,MAAM,WAG9B,SAAS,kBAAkB,EAAE,YAAY,KAAK;CAE9C,OAAO,iBAAA,GAAA,kBAAA,KAACC,yBAAAA,aAAD,EAAA,WAAA,GAAA,0BAAA,WADgB;EAAE,QAAQ;EAAU;EAAK,OAAO,CAAC;CAAE,CAClC,EAAe,CAAA;AACzC,CAAC;AAED,SAAS,YACP,OACA;CACA,OAAO,iBAAA,GAAA,kBAAA,KAACF,KAAAA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,qNACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAQA,MAAM,4BAA4B,UAAuB;CAOvD,IAAI,EANW,MAAM,OACI,QAAQ,YAAY,SAK7B,MAAM,eAAe;AACvC;AAEA,SAAS,cAAc,EACrB,WACA,eACA,UACA,GAAG,SACkB;CACrB,OACE,iBAAA,GAAA,kBAAA,MAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,uIACA,2QACA,+OACA,gWACA,wWACA,SACF;EACA,mBAAmB;EACnB,GAAI;YAXN,CAaE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EACE,YAAA,GAAA,GAAA,IACE,2IACA,aACF,EACD,CAAA,GACA,QACsB;;AAE7B;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
@@ -9,7 +9,10 @@ declare function Drawer({
9
9
  ...props
10
10
  }: React$1.ComponentProps<typeof Drawer$1.Root>): import("react/jsx-runtime").JSX.Element;
11
11
  declare function DrawerTrigger(props: React$1.ComponentProps<typeof Drawer$1.Trigger>): import("react/jsx-runtime").JSX.Element;
12
- declare function DrawerPortal(props: React$1.ComponentProps<typeof Drawer$1.Portal>): import("react/jsx-runtime").JSX.Element;
12
+ declare function DrawerPortal({
13
+ children,
14
+ ...props
15
+ }: React$1.ComponentProps<typeof Drawer$1.Portal>): import("react/jsx-runtime").JSX.Element;
13
16
  declare function DrawerClose(props: React$1.ComponentProps<typeof Drawer$1.Close>): import("react/jsx-runtime").JSX.Element;
14
17
  declare function DrawerOverlay({
15
18
  className,
@@ -9,7 +9,10 @@ declare function Drawer({
9
9
  ...props
10
10
  }: React$1.ComponentProps<typeof Drawer$1.Root>): import("react/jsx-runtime").JSX.Element;
11
11
  declare function DrawerTrigger(props: React$1.ComponentProps<typeof Drawer$1.Trigger>): import("react/jsx-runtime").JSX.Element;
12
- declare function DrawerPortal(props: React$1.ComponentProps<typeof Drawer$1.Portal>): import("react/jsx-runtime").JSX.Element;
12
+ declare function DrawerPortal({
13
+ children,
14
+ ...props
15
+ }: React$1.ComponentProps<typeof Drawer$1.Portal>): import("react/jsx-runtime").JSX.Element;
13
16
  declare function DrawerClose(props: React$1.ComponentProps<typeof Drawer$1.Close>): import("react/jsx-runtime").JSX.Element;
14
17
  declare function DrawerOverlay({
15
18
  className,
@@ -1,7 +1,9 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
- import "react";
3
+ import { PortalTheme } from "./theme.js";
4
+ import * as React$1 from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { useRender } from "@base-ui/react/use-render";
5
7
  import { Drawer as Drawer$1 } from "vaul";
6
8
  //#region src/components/drawer.tsx
7
9
  function Drawer({ shouldScaleBackground = true, ...props }) {
@@ -17,12 +19,20 @@ function DrawerTrigger(props) {
17
19
  ...props
18
20
  });
19
21
  }
20
- function DrawerPortal(props) {
22
+ function DrawerPortal({ children, ...props }) {
21
23
  return /* @__PURE__ */ jsx(Drawer$1.Portal, {
22
24
  "data-slot": "drawer-portal",
23
- ...props
25
+ ...props,
26
+ children: React$1.Children.map(children, (child) => React$1.isValidElement(child) ? /* @__PURE__ */ jsx(DrawerPortalChild, { children: child }) : child)
24
27
  });
25
28
  }
29
+ const DrawerPortalChild = React$1.forwardRef(function DrawerPortalChild({ children }, ref) {
30
+ return /* @__PURE__ */ jsx(PortalTheme, { children: useRender({
31
+ render: children,
32
+ ref,
33
+ props: {}
34
+ }) });
35
+ });
26
36
  function DrawerClose(props) {
27
37
  return /* @__PURE__ */ jsx(Drawer$1.Close, {
28
38
  "data-slot": "drawer-close",
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\nimport { cn } from '../utils/cn'\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n )\n}\n\nfunction DrawerTrigger(\n props: React.ComponentProps<typeof DrawerPrimitive.Trigger>,\n) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal(\n props: React.ComponentProps<typeof DrawerPrimitive.Portal>,\n) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose(\n props: React.ComponentProps<typeof DrawerPrimitive.Close>,\n) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) supports-backdrop-filter:backdrop-blur-xs motion-reduce:animate-none! motion-reduce:transition-none!',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\ninterface DrawerContentProps extends React.ComponentProps<\n typeof DrawerPrimitive.Content\n> {\n pillClassName?: string\n}\n\nconst onInteractOutsideHandler = (event: CustomEvent) => {\n const target = event.target as HTMLElement\n const isOverlay = target.dataset.overlay === 'true'\n\n // Our drawers contain interactive elements that are mounted outside of the drawer\n // Browser extensions like password managers or grammar checkers are also mounted outside\n // We still dismiss on a click/tap outside\n if (!isOverlay) event.preventDefault()\n}\n\nfunction DrawerContent({\n className,\n pillClassName,\n children,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-gray-2 text-gray motion-reduce:animate-none! motion-reduce:transition-none!',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-(--spark-viewport-bottom-offset,0) data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg',\n 'data-[vaul-drawer-direction=left]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:border-gray-a1 data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'data-[vaul-drawer-direction=right]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-gray-a1 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n onInteractOutside={onInteractOutsideHandler}\n {...props}\n >\n <div\n className={cn(\n 'mx-auto mt-2.5 hidden h-1.5 w-16 shrink-0 rounded-full bg-base-gray-soft group-data-[vaul-drawer-direction=bottom]/drawer-content:block',\n pillClassName,\n )}\n />\n {children}\n </DrawerPrimitive.Content>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('flex flex-col gap-1 px-6 py-3', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\nexport type { DrawerContentProps }\n"],"mappings":";;;;;;AAIA,SAAS,OAAO,EACd,wBAAwB,MACxB,GAAG,SACiD;CACpD,OACE,oBAACA,SAAgB,MAAjB;EACE,aAAU;EACa;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aACP,OACA;CACA,OAAO,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,YACP,OACA;CACA,OAAO,oBAACA,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,qNACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAQA,MAAM,4BAA4B,UAAuB;CAOvD,IAAI,EANW,MAAM,OACI,QAAQ,YAAY,SAK7B,MAAM,eAAe;AACvC;AAEA,SAAS,cAAc,EACrB,WACA,eACA,UACA,GAAG,SACkB;CACrB,OACE,qBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,uIACA,2QACA,+OACA,gWACA,wWACA,SACF;EACA,mBAAmB;EACnB,GAAI;YAXN,CAaE,oBAAC,OAAD,EACE,WAAW,GACT,2IACA,aACF,EACD,CAAA,GACA,QACsB;;AAE7B;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"drawer.js","names":["DrawerPrimitive","React"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\nimport { cn } from '../utils/cn'\nimport { PortalTheme } from './theme'\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n )\n}\n\nfunction DrawerTrigger(\n props: React.ComponentProps<typeof DrawerPrimitive.Trigger>,\n) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return (\n <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props}>\n {React.Children.map(children, (child) =>\n React.isValidElement(child) ? (\n <DrawerPortalChild>{child}</DrawerPortalChild>\n ) : (\n child\n ),\n )}\n </DrawerPrimitive.Portal>\n )\n}\n\n// Radix clones each portal child with the Presence ref that gates the exit animation; it must land on the part, not the theme wrapper.\nconst DrawerPortalChild = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(function DrawerPortalChild({ children }, ref) {\n const part = useRender({ render: children, ref, props: {} })\n return <PortalTheme>{part}</PortalTheme>\n})\n\nfunction DrawerClose(\n props: React.ComponentProps<typeof DrawerPrimitive.Close>,\n) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed top-(--spark-viewport-top,0) right-0 left-0 z-50 h-(--spark-viewport-height,100%) bg-(--color-overlay) supports-backdrop-filter:backdrop-blur-xs motion-reduce:animate-none! motion-reduce:transition-none!',\n className,\n )}\n data-overlay=\"true\"\n {...props}\n />\n )\n}\n\ninterface DrawerContentProps extends React.ComponentProps<\n typeof DrawerPrimitive.Content\n> {\n pillClassName?: string\n}\n\nconst onInteractOutsideHandler = (event: CustomEvent) => {\n const target = event.target as HTMLElement\n const isOverlay = target.dataset.overlay === 'true'\n\n // Our drawers contain interactive elements that are mounted outside of the drawer\n // Browser extensions like password managers or grammar checkers are also mounted outside\n // We still dismiss on a click/tap outside\n if (!isOverlay) event.preventDefault()\n}\n\nfunction DrawerContent({\n className,\n pillClassName,\n children,\n ...props\n}: DrawerContentProps) {\n return (\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-gray-2 text-gray motion-reduce:animate-none! motion-reduce:transition-none!',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-(--spark-viewport-bottom-offset,0) data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg',\n 'data-[vaul-drawer-direction=left]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:border-gray-a1 data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'data-[vaul-drawer-direction=right]:top-(--spark-viewport-top,0) data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-(--spark-viewport-height,100%) data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-gray-a1 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n onInteractOutside={onInteractOutsideHandler}\n {...props}\n >\n <div\n className={cn(\n 'mx-auto mt-2.5 hidden h-1.5 w-16 shrink-0 rounded-full bg-base-gray-soft group-data-[vaul-drawer-direction=bottom]/drawer-content:block',\n pillClassName,\n )}\n />\n {children}\n </DrawerPrimitive.Content>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('flex flex-col gap-1 px-6 py-3', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-lg font-bold text-gray', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-sm text-gray-light', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\nexport type { DrawerContentProps }\n"],"mappings":";;;;;;;;AAMA,SAAS,OAAO,EACd,wBAAwB,MACxB,GAAG,SACiD;CACpD,OACE,oBAACA,SAAgB,MAAjB;EACE,aAAU;EACa;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cACP,OACA;CACA,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,UACA,GAAG,SACmD;CACtD,OACE,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;YACnDC,QAAM,SAAS,IAAI,WAAW,UAC7BA,QAAM,eAAe,KAAK,IACxB,oBAAC,mBAAD,EAAA,UAAoB,MAAyB,CAAA,IAE7C,KAEJ;CACsB,CAAA;AAE5B;AAGA,MAAM,oBAAoBA,QAAM,WAG9B,SAAS,kBAAkB,EAAE,YAAY,KAAK;CAE9C,OAAO,oBAAC,aAAD,EAAA,UADM,UAAU;EAAE,QAAQ;EAAU;EAAK,OAAO,CAAC;CAAE,CAClC,EAAe,CAAA;AACzC,CAAC;AAED,SAAS,YACP,OACA;CACA,OAAO,oBAACD,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,qNACA,SACF;EACA,gBAAa;EACb,GAAI;CACL,CAAA;AAEL;AAQA,MAAM,4BAA4B,UAAuB;CAOvD,IAAI,EANW,MAAM,OACI,QAAQ,YAAY,SAK7B,MAAM,eAAe;AACvC;AAEA,SAAS,cAAc,EACrB,WACA,eACA,UACA,GAAG,SACkB;CACrB,OACE,qBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,uIACA,2QACA,+OACA,gWACA,wWACA,SACF;EACA,mBAAmB;EACnB,GAAI;YAXN,CAaE,oBAAC,OAAD,EACE,WAAW,GACT,2IACA,aACF,EACD,CAAA,GACA,QACsB;;AAE7B;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
+ const require_components_theme = require("./theme.cjs");
4
5
  let react = require("react");
5
6
  react = require_chunk.__toESM(react);
6
7
  let _epilot_spark_icons = require("@epilot/spark-icons");
@@ -11,10 +12,11 @@ let cn = require("cn");
11
12
  function DropdownMenu({ ...props }) {
12
13
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_menu.Menu.Root, { ...props });
13
14
  }
14
- function DropdownMenuPortal({ ...props }) {
15
+ function DropdownMenuPortal({ children, ...props }) {
15
16
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_menu.Menu.Portal, {
16
17
  "data-slot": "dropdown-menu-portal",
17
- ...props
18
+ ...props,
19
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_theme.PortalTheme, { children })
18
20
  });
19
21
  }
20
22
  function DropdownMenuTrigger({ ...props }) {
@@ -24,7 +26,7 @@ function DropdownMenuTrigger({ ...props }) {
24
26
  });
25
27
  }
26
28
  function DropdownMenuContent({ className, align = "start", alignOffset, side, sideOffset = 4, container, ...props }) {
27
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_menu.Menu.Portal, {
29
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropdownMenuPortal, {
28
30
  container,
29
31
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_menu.Menu.Positioner, {
30
32
  align,