@constructive-io/ui 0.1.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 (176) hide show
  1. package/dist/components/alert-dialog.d.ts +31 -0
  2. package/dist/components/alert-dialog.js +314 -0
  3. package/dist/components/alert-dialog.js.map +1 -0
  4. package/dist/components/alert.d.ts +14 -0
  5. package/dist/components/alert.js +38 -0
  6. package/dist/components/alert.js.map +1 -0
  7. package/dist/components/autocomplete.d.ts +28 -0
  8. package/dist/components/autocomplete.js +395 -0
  9. package/dist/components/autocomplete.js.map +1 -0
  10. package/dist/components/avatar.d.ts +13 -0
  11. package/dist/components/avatar.js +37 -0
  12. package/dist/components/avatar.js.map +1 -0
  13. package/dist/components/badge.d.ts +15 -0
  14. package/dist/components/badge.js +43 -0
  15. package/dist/components/badge.js.map +1 -0
  16. package/dist/components/breadcrumb.d.ts +14 -0
  17. package/dist/components/breadcrumb.js +154 -0
  18. package/dist/components/breadcrumb.js.map +1 -0
  19. package/dist/components/button.d.ts +17 -0
  20. package/dist/components/button.js +62 -0
  21. package/dist/components/button.js.map +1 -0
  22. package/dist/components/calendar-rac.d.ts +13 -0
  23. package/dist/components/calendar-rac.js +82 -0
  24. package/dist/components/calendar-rac.js.map +1 -0
  25. package/dist/components/card.d.ts +19 -0
  26. package/dist/components/card.js +75 -0
  27. package/dist/components/card.js.map +1 -0
  28. package/dist/components/checkbox-group.d.ts +7 -0
  29. package/dist/components/checkbox-group.js +16 -0
  30. package/dist/components/checkbox-group.js.map +1 -0
  31. package/dist/components/checkbox.d.ts +8 -0
  32. package/dist/components/checkbox.js +67 -0
  33. package/dist/components/checkbox.js.map +1 -0
  34. package/dist/components/collapsible.d.ts +54 -0
  35. package/dist/components/collapsible.js +121 -0
  36. package/dist/components/collapsible.js.map +1 -0
  37. package/dist/components/combobox.d.ts +44 -0
  38. package/dist/components/combobox.js +486 -0
  39. package/dist/components/combobox.js.map +1 -0
  40. package/dist/components/command.d.ts +43 -0
  41. package/dist/components/command.js +690 -0
  42. package/dist/components/command.js.map +1 -0
  43. package/dist/components/dialog.d.ts +35 -0
  44. package/dist/components/dialog.js +440 -0
  45. package/dist/components/dialog.js.map +1 -0
  46. package/dist/components/dock.d.ts +31 -0
  47. package/dist/components/dock.js +111 -0
  48. package/dist/components/dock.js.map +1 -0
  49. package/dist/components/drawer.d.ts +16 -0
  50. package/dist/components/drawer.js +147 -0
  51. package/dist/components/drawer.js.map +1 -0
  52. package/dist/components/dropdown-menu.d.ts +50 -0
  53. package/dist/components/dropdown-menu.js +380 -0
  54. package/dist/components/dropdown-menu.js.map +1 -0
  55. package/dist/components/field.d.ts +51 -0
  56. package/dist/components/field.js +115 -0
  57. package/dist/components/field.js.map +1 -0
  58. package/dist/components/flickering-grid.d.ts +15 -0
  59. package/dist/components/flickering-grid.js +147 -0
  60. package/dist/components/flickering-grid.js.map +1 -0
  61. package/dist/components/form-control.d.ts +15 -0
  62. package/dist/components/form-control.js +173 -0
  63. package/dist/components/form-control.js.map +1 -0
  64. package/dist/components/form.d.ts +37 -0
  65. package/dist/components/form.js +179 -0
  66. package/dist/components/form.js.map +1 -0
  67. package/dist/components/input-group.d.ts +18 -0
  68. package/dist/components/input-group.js +177 -0
  69. package/dist/components/input-group.js.map +1 -0
  70. package/dist/components/input.d.ts +11 -0
  71. package/dist/components/input.js +60 -0
  72. package/dist/components/input.js.map +1 -0
  73. package/dist/components/json-input.d.ts +25 -0
  74. package/dist/components/json-input.js +351 -0
  75. package/dist/components/json-input.js.map +1 -0
  76. package/dist/components/label.d.ts +11 -0
  77. package/dist/components/label.js +27 -0
  78. package/dist/components/label.js.map +1 -0
  79. package/dist/components/motion-grid.d.ts +20 -0
  80. package/dist/components/motion-grid.js +81 -0
  81. package/dist/components/motion-grid.js.map +1 -0
  82. package/dist/components/multi-select.d.ts +198 -0
  83. package/dist/components/multi-select.js +882 -0
  84. package/dist/components/multi-select.js.map +1 -0
  85. package/dist/components/page-header.d.ts +17 -0
  86. package/dist/components/page-header.js +17 -0
  87. package/dist/components/page-header.js.map +1 -0
  88. package/dist/components/pagination.d.ts +19 -0
  89. package/dist/components/pagination.js +144 -0
  90. package/dist/components/pagination.js.map +1 -0
  91. package/dist/components/popover.d.ts +35 -0
  92. package/dist/components/popover.js +188 -0
  93. package/dist/components/popover.js.map +1 -0
  94. package/dist/components/portal.d.ts +108 -0
  95. package/dist/components/portal.js +75 -0
  96. package/dist/components/portal.js.map +1 -0
  97. package/dist/components/progress.d.ts +10 -0
  98. package/dist/components/progress.js +30 -0
  99. package/dist/components/progress.js.map +1 -0
  100. package/dist/components/progressive-blur-scroll-container.d.ts +25 -0
  101. package/dist/components/progressive-blur-scroll-container.js +142 -0
  102. package/dist/components/progressive-blur-scroll-container.js.map +1 -0
  103. package/dist/components/progressive-blur.d.ts +16 -0
  104. package/dist/components/progressive-blur.js +68 -0
  105. package/dist/components/progressive-blur.js.map +1 -0
  106. package/dist/components/radio-group.d.ts +10 -0
  107. package/dist/components/radio-group.js +37 -0
  108. package/dist/components/radio-group.js.map +1 -0
  109. package/dist/components/record-picker.d.ts +16 -0
  110. package/dist/components/record-picker.js +366 -0
  111. package/dist/components/record-picker.js.map +1 -0
  112. package/dist/components/resizable.d.ts +11 -0
  113. package/dist/components/resizable.js +52 -0
  114. package/dist/components/resizable.js.map +1 -0
  115. package/dist/components/responsive-diagram.d.ts +10 -0
  116. package/dist/components/responsive-diagram.js +63 -0
  117. package/dist/components/responsive-diagram.js.map +1 -0
  118. package/dist/components/scroll-area.d.ts +12 -0
  119. package/dist/components/scroll-area.js +69 -0
  120. package/dist/components/scroll-area.js.map +1 -0
  121. package/dist/components/select.d.ts +47 -0
  122. package/dist/components/select.js +287 -0
  123. package/dist/components/select.js.map +1 -0
  124. package/dist/components/separator.d.ts +11 -0
  125. package/dist/components/separator.js +24 -0
  126. package/dist/components/separator.js.map +1 -0
  127. package/dist/components/sheet.d.ts +112 -0
  128. package/dist/components/sheet.js +600 -0
  129. package/dist/components/sheet.js.map +1 -0
  130. package/dist/components/sidebar.d.ts +77 -0
  131. package/dist/components/sidebar.js +1217 -0
  132. package/dist/components/sidebar.js.map +1 -0
  133. package/dist/components/skeleton.d.ts +7 -0
  134. package/dist/components/skeleton.js +16 -0
  135. package/dist/components/skeleton.js.map +1 -0
  136. package/dist/components/sonner.d.ts +10 -0
  137. package/dist/components/sonner.js +23 -0
  138. package/dist/components/sonner.js.map +1 -0
  139. package/dist/components/stack/index.d.ts +663 -0
  140. package/dist/components/stack/index.js +1418 -0
  141. package/dist/components/stack/index.js.map +1 -0
  142. package/dist/components/stepper.d.ts +30 -0
  143. package/dist/components/stepper.js +280 -0
  144. package/dist/components/stepper.js.map +1 -0
  145. package/dist/components/switch.d.ts +8 -0
  146. package/dist/components/switch.js +40 -0
  147. package/dist/components/switch.js.map +1 -0
  148. package/dist/components/table.d.ts +15 -0
  149. package/dist/components/table.js +65 -0
  150. package/dist/components/table.js.map +1 -0
  151. package/dist/components/tabs.d.ts +10 -0
  152. package/dist/components/tabs.js +48 -0
  153. package/dist/components/tabs.js.map +1 -0
  154. package/dist/components/tags.d.ts +42 -0
  155. package/dist/components/tags.js +728 -0
  156. package/dist/components/tags.js.map +1 -0
  157. package/dist/components/textarea.d.ts +10 -0
  158. package/dist/components/textarea.js +54 -0
  159. package/dist/components/textarea.js.map +1 -0
  160. package/dist/components/toast/index.d.ts +52 -0
  161. package/dist/components/toast/index.js +221 -0
  162. package/dist/components/toast/index.js.map +1 -0
  163. package/dist/components/tooltip.d.ts +29 -0
  164. package/dist/components/tooltip.js +174 -0
  165. package/dist/components/tooltip.js.map +1 -0
  166. package/dist/components/unlink-button.d.ts +14 -0
  167. package/dist/components/unlink-button.js +91 -0
  168. package/dist/components/unlink-button.js.map +1 -0
  169. package/dist/index.cjs +7692 -0
  170. package/dist/index.cjs.map +1 -0
  171. package/dist/index.d.cts +2157 -0
  172. package/dist/index.d.ts +2157 -0
  173. package/dist/index.js +7375 -0
  174. package/dist/index.js.map +1 -0
  175. package/package.json +490 -0
  176. package/src/styles/globals.css +397 -0
@@ -0,0 +1,31 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
4
+
5
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialog$1.Root>): react_jsx_runtime.JSX.Element;
6
+ type AlertDialogTriggerProps = Omit<React.ComponentProps<typeof AlertDialog$1.Trigger>, 'render' | 'nativeButton'> & {
7
+ /** When true, merges props onto the child element instead of rendering a button */
8
+ asChild?: boolean;
9
+ /** Whether the child renders a native button. Defaults to true when asChild is used. */
10
+ nativeButton?: boolean;
11
+ };
12
+ declare function AlertDialogTrigger({ asChild, nativeButton, children, ...props }: AlertDialogTriggerProps): react_jsx_runtime.JSX.Element;
13
+ declare function AlertDialogPortal({ keepMounted, ...props }: React.ComponentProps<typeof AlertDialog$1.Portal>): react_jsx_runtime.JSX.Element;
14
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Backdrop>): react_jsx_runtime.JSX.Element;
15
+ declare function AlertDialogContent({ className, children, ...props }: React.ComponentProps<typeof AlertDialog$1.Popup>): react_jsx_runtime.JSX.Element;
16
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
17
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
18
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>): react_jsx_runtime.JSX.Element;
19
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>): react_jsx_runtime.JSX.Element;
20
+ /**
21
+ * AlertDialogAction - A button that performs the primary action and closes the dialog.
22
+ * Wraps AlertDialogPrimitive.Close with primary button styling.
23
+ */
24
+ declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Close>): react_jsx_runtime.JSX.Element;
25
+ /**
26
+ * AlertDialogCancel - A button that cancels the action and closes the dialog.
27
+ * Wraps AlertDialogPrimitive.Close with outline button styling.
28
+ */
29
+ declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Close>): react_jsx_runtime.JSX.Element;
30
+
31
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
@@ -0,0 +1,314 @@
1
+ "use client";
2
+ import * as React2 from 'react';
3
+ import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
4
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ import { cva } from 'class-variance-authority';
8
+
9
+ var PORTAL_ROOT_ID = "portal-root";
10
+ var PortalContext = React2.createContext({
11
+ layer: "base",
12
+ depth: 0,
13
+ floatingPortalStrategy: "root",
14
+ floatingZIndex: "default"
15
+ });
16
+ function ModalPortalScope({
17
+ children,
18
+ floatingPortalStrategy = "nested",
19
+ floatingZIndex = "default"
20
+ }) {
21
+ const parentContext = React2.useContext(PortalContext);
22
+ const depth = parentContext.layer === "modal" ? parentContext.depth + 1 : 0;
23
+ const value = React2.useMemo(
24
+ () => ({
25
+ layer: "modal",
26
+ depth,
27
+ floatingPortalStrategy,
28
+ floatingZIndex
29
+ }),
30
+ [depth, floatingPortalStrategy, floatingZIndex]
31
+ );
32
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
33
+ }
34
+ function useRootPortalContainer() {
35
+ const [container, setContainer] = React2.useState(null);
36
+ React2.useLayoutEffect(() => {
37
+ const el = document.getElementById(PORTAL_ROOT_ID);
38
+ setContainer(el);
39
+ }, []);
40
+ return container;
41
+ }
42
+ function composeRefs(...refs) {
43
+ return (node) => {
44
+ refs.forEach((ref) => {
45
+ if (typeof ref === "function") {
46
+ ref(node);
47
+ } else if (ref != null) {
48
+ ref.current = node;
49
+ }
50
+ });
51
+ };
52
+ }
53
+ function mergeProps(slotProps, childProps) {
54
+ const overrideProps = { ...childProps };
55
+ for (const propName in childProps) {
56
+ if (propName === "ref") continue;
57
+ const slotPropValue = slotProps[propName];
58
+ const childPropValue = childProps[propName];
59
+ if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
60
+ overrideProps[propName] = (...args) => {
61
+ childPropValue(...args);
62
+ slotPropValue(...args);
63
+ };
64
+ } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
65
+ overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
66
+ } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
67
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
68
+ }
69
+ }
70
+ return { ...slotProps, ...overrideProps };
71
+ }
72
+ function mergePropsWithRef(parentProps, childElement) {
73
+ const childProps = childElement.props;
74
+ const parentRef = parentProps.ref;
75
+ const childRef = childProps.ref;
76
+ const mergedProps = mergeProps(parentProps, childProps);
77
+ if (parentRef || childRef) {
78
+ mergedProps.ref = composeRefs(parentRef, childRef);
79
+ }
80
+ return mergedProps;
81
+ }
82
+ function isSlottable(child) {
83
+ return React2.isValidElement(child);
84
+ }
85
+ var Slot = React2.forwardRef((props, forwardedRef) => {
86
+ const { children, ...slotProps } = props;
87
+ if (isSlottable(children)) {
88
+ const childProps = children.props;
89
+ const childRef = childProps.ref;
90
+ return React2.cloneElement(children, {
91
+ ...mergeProps(slotProps, childProps),
92
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
93
+ });
94
+ }
95
+ if (React2.Children.count(children) > 1) {
96
+ const childrenArray = React2.Children.toArray(children);
97
+ const slottableChild = childrenArray.find(
98
+ (child) => React2.isValidElement(child) && child.type === Slottable
99
+ );
100
+ if (slottableChild) {
101
+ const newElement = slottableChild.props.children;
102
+ if (isSlottable(newElement)) {
103
+ const newElementProps = newElement.props;
104
+ const newChildren = childrenArray.map((child) => {
105
+ if (child === slottableChild) {
106
+ return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
107
+ }
108
+ return child;
109
+ });
110
+ const childRef = newElementProps.ref;
111
+ return React2.cloneElement(newElement, {
112
+ ...mergeProps(slotProps, newElementProps),
113
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
114
+ children: newChildren
115
+ });
116
+ }
117
+ }
118
+ }
119
+ return /* @__PURE__ */ jsx(Fragment, { children });
120
+ });
121
+ Slot.displayName = "Slot";
122
+ function Slottable({ children }) {
123
+ return /* @__PURE__ */ jsx(Fragment, { children });
124
+ }
125
+ function cn(...inputs) {
126
+ return twMerge(clsx(inputs));
127
+ }
128
+ var buttonVariants = cva(
129
+ "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
130
+ {
131
+ defaultVariants: {
132
+ size: "default",
133
+ variant: "default"
134
+ },
135
+ variants: {
136
+ size: {
137
+ default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
138
+ icon: "size-9 sm:size-8",
139
+ "icon-lg": "size-10 sm:size-9",
140
+ "icon-sm": "size-8 sm:size-7",
141
+ "icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
142
+ "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-3.5',
143
+ lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
144
+ sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
145
+ xl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
146
+ xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*="size-"])]:size-4 sm:[&_svg:not([class*="size-"])]:size-3.5'
147
+ },
148
+ variant: {
149
+ default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
150
+ destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
151
+ "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
152
+ ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
153
+ link: "border-transparent underline-offset-4 hover:underline",
154
+ outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
155
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
156
+ }
157
+ }
158
+ }
159
+ );
160
+ var Button = React2.forwardRef(
161
+ ({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
162
+ const buttonClasses = cn(buttonVariants({ className, size, variant }));
163
+ if (asChild && React2.isValidElement(children)) {
164
+ const childProps = children.props;
165
+ return React2.cloneElement(children, {
166
+ ...props,
167
+ className: cn(buttonClasses, childProps.className),
168
+ "data-slot": "button"
169
+ });
170
+ }
171
+ return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
172
+ }
173
+ );
174
+ Button.displayName = "Button";
175
+ function AlertDialog({ ...props }) {
176
+ return /* @__PURE__ */ jsx(AlertDialog$1.Root, { "data-slot": "alert-dialog", ...props });
177
+ }
178
+ function AlertDialogTrigger({ asChild, nativeButton, children, ...props }) {
179
+ if (asChild && React2.isValidElement(children)) {
180
+ return /* @__PURE__ */ jsx(
181
+ AlertDialog$1.Trigger,
182
+ {
183
+ "data-slot": "alert-dialog-trigger",
184
+ nativeButton: nativeButton ?? true,
185
+ ...props,
186
+ render: (triggerProps) => {
187
+ const { nativeButton: _, ...rest } = triggerProps;
188
+ return React2.cloneElement(
189
+ children,
190
+ mergePropsWithRef(rest, children)
191
+ );
192
+ }
193
+ }
194
+ );
195
+ }
196
+ return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, { "data-slot": "alert-dialog-trigger", nativeButton, ...props, children });
197
+ }
198
+ function AlertDialogPortal({ keepMounted = true, ...props }) {
199
+ const container = useRootPortalContainer();
200
+ const style = {
201
+ ...props.style ?? {},
202
+ ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
203
+ };
204
+ return /* @__PURE__ */ jsx(
205
+ AlertDialog$1.Portal,
206
+ {
207
+ "data-slot": "alert-dialog-portal",
208
+ keepMounted,
209
+ container,
210
+ ...props,
211
+ style
212
+ }
213
+ );
214
+ }
215
+ function AlertDialogOverlay({ className, ...props }) {
216
+ return /* @__PURE__ */ jsx(
217
+ AlertDialog$1.Backdrop,
218
+ {
219
+ "data-slot": "alert-dialog-overlay",
220
+ className: cn(
221
+ "fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/80 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
222
+ className
223
+ ),
224
+ ...props
225
+ }
226
+ );
227
+ }
228
+ function AlertDialogContent({ className, children, ...props }) {
229
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
230
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
231
+ /* @__PURE__ */ jsx(
232
+ AlertDialog$1.Popup,
233
+ {
234
+ "data-slot": "alert-dialog-content",
235
+ className: cn(
236
+ `bg-background fixed top-1/2 left-1/2 z-[var(--z-layer-modal-content)] grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)]
237
+ -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border p-6 shadow-lg
238
+ transition-[opacity,scale] duration-200 data-[ending-style]:scale-95 data-[starting-style]:scale-95
239
+ data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 sm:max-w-100`,
240
+ className
241
+ ),
242
+ ...props,
243
+ children: /* @__PURE__ */ jsx(ModalPortalScope, { children })
244
+ }
245
+ )
246
+ ] });
247
+ }
248
+ function AlertDialogHeader({ className, ...props }) {
249
+ return /* @__PURE__ */ jsx(
250
+ "div",
251
+ {
252
+ "data-slot": "alert-dialog-header",
253
+ className: cn("flex flex-col gap-1 text-center sm:text-left", className),
254
+ ...props
255
+ }
256
+ );
257
+ }
258
+ function AlertDialogFooter({ className, ...props }) {
259
+ return /* @__PURE__ */ jsx(
260
+ "div",
261
+ {
262
+ "data-slot": "alert-dialog-footer",
263
+ className: cn("flex flex-col-reverse gap-3 sm:flex-row sm:justify-end", className),
264
+ ...props
265
+ }
266
+ );
267
+ }
268
+ function AlertDialogTitle({ className, ...props }) {
269
+ return /* @__PURE__ */ jsx(
270
+ AlertDialog$1.Title,
271
+ {
272
+ "data-slot": "alert-dialog-title",
273
+ className: cn("text-lg font-semibold", className),
274
+ ...props
275
+ }
276
+ );
277
+ }
278
+ function AlertDialogDescription({
279
+ className,
280
+ ...props
281
+ }) {
282
+ return /* @__PURE__ */ jsx(
283
+ AlertDialog$1.Description,
284
+ {
285
+ "data-slot": "alert-dialog-description",
286
+ className: cn("text-muted-foreground text-sm", className),
287
+ ...props
288
+ }
289
+ );
290
+ }
291
+ function AlertDialogAction({ className, ...props }) {
292
+ return /* @__PURE__ */ jsx(
293
+ AlertDialog$1.Close,
294
+ {
295
+ "data-slot": "alert-dialog-action",
296
+ className: cn(buttonVariants(), className),
297
+ ...props
298
+ }
299
+ );
300
+ }
301
+ function AlertDialogCancel({ className, ...props }) {
302
+ return /* @__PURE__ */ jsx(
303
+ AlertDialog$1.Close,
304
+ {
305
+ "data-slot": "alert-dialog-cancel",
306
+ className: cn(buttonVariants({ variant: "outline" }), className),
307
+ ...props
308
+ }
309
+ );
310
+ }
311
+
312
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
313
+ //# sourceMappingURL=alert-dialog.js.map
314
+ //# sourceMappingURL=alert-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/portal.tsx","../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/alert-dialog.tsx"],"names":["React","jsx","React3","AlertDialogPrimitive","React4"],"mappings":";;;;;;;AA4CO,IAAM,cAAA,GAAiB,aAAA;AAM9B,IAAM,gBAAsBA,MAAA,CAAA,aAAA,CAAkC;AAAA,EAC7D,KAAA,EAAO,MAAA;AAAA,EACP,KAAA,EAAO,CAAA;AAAA,EACP,sBAAA,EAAwB,MAAA;AAAA,EACxB,cAAA,EAAgB;AACjB,CAAC,CAAA;AAuBM,SAAS,gBAAA,CAAiB;AAAA,EAChC,QAAA;AAAA,EACA,sBAAA,GAAyB,QAAA;AAAA,EACzB,cAAA,GAAiB;AAClB,CAAA,EAIG;AACF,EAAA,MAAM,aAAA,GAAsBA,kBAAW,aAAa,CAAA;AAGpD,EAAA,MAAM,QAAQ,aAAA,CAAc,KAAA,KAAU,OAAA,GAAU,aAAA,CAAc,QAAQ,CAAA,GAAI,CAAA;AAE1E,EAAA,MAAM,KAAA,GAAcA,MAAA,CAAA,OAAA;AAAA,IACnB,OAAO;AAAA,MACN,KAAA,EAAO,OAAA;AAAA,MACP,KAAA;AAAA,MACA,sBAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,sBAAA,EAAwB,cAAc;AAAA,GAC/C;AAEA,EAAA,uBAAO,GAAA,CAAC,aAAA,CAAc,QAAA,EAAd,EAAuB,OAAe,QAAA,EAAS,CAAA;AACxD;AAwBO,SAAS,sBAAA,GAA6C;AAC5D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAUA,gBAA6B,IAAI,CAAA;AAEzE,EAAMA,uBAAgB,MAAM;AAC3B,IAAA,MAAM,EAAA,GAAK,QAAA,CAAS,cAAA,CAAe,cAAc,CAAA;AACjD,IAAA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S,iBAAA,CAAkB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4D;AAC5G,EAAA,uBACCF,GAAAA;AAAA,IAACE,aAAA,CAAqB,KAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,cAAA,EAAe,EAAG,SAAS,CAAA;AAAA,MACxC,GAAG;AAAA;AAAA,GACL;AAEF;AAMA,SAAS,iBAAA,CAAkB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4D;AAC5G,EAAA,uBACCF,GAAAA;AAAA,IAACE,aAAA,CAAqB,KAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,SAAA,EAAW,GAAG,SAAS,CAAA;AAAA,MAC9D,GAAG;AAAA;AAAA,GACL;AAEF","file":"alert-dialog.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot='portal-root'\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-9 px-[calc(--spacing(3)-1px)] sm:h-8',\n\t\t\t\ticon: 'size-9 sm:size-8',\n\t\t\t\t'icon-lg': 'size-10 sm:size-9',\n\t\t\t\t'icon-sm': 'size-8 sm:size-7',\n\t\t\t\t'icon-xl': 'size-11 sm:size-10 [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t\tlg: 'h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9',\n\t\t\t\tsm: 'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7',\n\t\t\t\txl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\txs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*=\"size-\"])]:size-4 sm:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\tdestructive:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, variant }));\n\n\t\t// If asChild, render children with merged props (for wrapping Links, etc.)\n\t\tif (asChild && React.isValidElement(children)) {\n\t\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t\treturn React.cloneElement(children as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t...props,\n\t\t\t\tclassName: cn(buttonClasses, childProps.className as string | undefined),\n\t\t\t\t'data-slot': 'button',\n\t\t\t});\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';\n\nimport { ModalPortalScope, useRootPortalContainer } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\nimport { buttonVariants } from './button';\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot='alert-dialog' {...props} />;\n}\n\ntype AlertDialogTriggerProps = Omit<React.ComponentProps<typeof AlertDialogPrimitive.Trigger>, 'render' | 'nativeButton'> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n\t/** Whether the child renders a native button. Defaults to true when asChild is used. */\n\tnativeButton?: boolean;\n};\n\nfunction AlertDialogTrigger({ asChild, nativeButton, children, ...props }: AlertDialogTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<AlertDialogPrimitive.Trigger\n\t\t\t\tdata-slot='alert-dialog-trigger'\n\t\t\t\tnativeButton={nativeButton ?? true}\n\t\t\t\t{...props}\n\t\t\t\trender={(triggerProps) => {\n\t\t\t\t\tconst { nativeButton: _, ...rest } = triggerProps as Record<string, unknown>;\n\t\t\t\t\treturn React.cloneElement(\n\t\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\tmergePropsWithRef(rest, children as React.ReactElement),\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<AlertDialogPrimitive.Trigger data-slot='alert-dialog-trigger' nativeButton={nativeButton} {...props}>\n\t\t\t{children}\n\t\t</AlertDialogPrimitive.Trigger>\n\t);\n}\n\nfunction AlertDialogPortal({ keepMounted = true, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\tconst container = useRootPortalContainer();\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn (\n\t\t<AlertDialogPrimitive.Portal\n\t\t\tdata-slot='alert-dialog-portal'\n\t\t\tkeepMounted={keepMounted}\n\t\t\tcontainer={container}\n\t\t\t{...props}\n\t\t\tstyle={style}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Backdrop>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Backdrop\n\t\t\tdata-slot='alert-dialog-overlay'\n\t\t\tclassName={cn(\n\t\t\t\t'fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/80 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Popup>) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Popup\n\t\t\t\tdata-slot='alert-dialog-content'\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`bg-background fixed top-1/2 left-1/2 z-[var(--z-layer-modal-content)] grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)]\n\t\t\t\t\t-translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border p-6 shadow-lg\n\t\t\t\t\ttransition-[opacity,scale] duration-200 data-[ending-style]:scale-95 data-[starting-style]:scale-95\n\t\t\t\t\tdata-[ending-style]:opacity-0 data-[starting-style]:opacity-0 sm:max-w-100`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t{children}\n\t\t\t\t</ModalPortalScope>\n\t\t\t</AlertDialogPrimitive.Popup>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot='alert-dialog-header'\n\t\t\tclassName={cn('flex flex-col gap-1 text-center sm:text-left', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot='alert-dialog-footer'\n\t\t\tclassName={cn('flex flex-col-reverse gap-3 sm:flex-row sm:justify-end', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot='alert-dialog-title'\n\t\t\tclassName={cn('text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot='alert-dialog-description'\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * AlertDialogAction - A button that performs the primary action and closes the dialog.\n * Wraps AlertDialogPrimitive.Close with primary button styling.\n */\nfunction AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Close>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Close\n\t\t\tdata-slot='alert-dialog-action'\n\t\t\tclassName={cn(buttonVariants(), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * AlertDialogCancel - A button that cancels the action and closes the dialog.\n * Wraps AlertDialogPrimitive.Close with outline button styling.\n */\nfunction AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Close>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Close\n\t\t\tdata-slot='alert-dialog-cancel'\n\t\t\tclassName={cn(buttonVariants({ variant: 'outline' }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogOverlay,\n\tAlertDialogPortal,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"]}
@@ -0,0 +1,14 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const alertVariants: (props?: ({
6
+ variant?: "default" | "destructive" | null | undefined;
7
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
8
+ declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
9
+ variant?: "default" | "destructive" | null | undefined;
10
+ } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
12
+ declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
13
+
14
+ export { Alert, AlertDescription, AlertTitle, alertVariants };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ var alertVariants = cva(
12
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "bg-background text-foreground",
17
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: "default"
22
+ }
23
+ }
24
+ );
25
+ var Alert = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
26
+ Alert.displayName = "Alert";
27
+ var AlertTitle = React.forwardRef(
28
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("h5", { ref, className: cn("mb-1 leading-none font-medium tracking-tight", className), ...props })
29
+ );
30
+ AlertTitle.displayName = "AlertTitle";
31
+ var AlertDescription = React.forwardRef(
32
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props })
33
+ );
34
+ AlertDescription.displayName = "AlertDescription";
35
+
36
+ export { Alert, AlertDescription, AlertTitle, alertVariants };
37
+ //# sourceMappingURL=alert.js.map
38
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/alert.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACrB,2JAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,+BAAA;AAAA,QACT,WAAA,EAAa;AAAA;AACd,KACD;AAAA,IACA,eAAA,EAAiB;AAAA,MAChB,OAAA,EAAS;AAAA;AACV;AAEF;AAEA,IAAM,KAAA,GAAc,KAAA,CAAA,UAAA,CAGlB,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,GAAG,KAAA,EAAM,EAAG,GAAA,qBACpC,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,MAAK,OAAA,EAAQ,SAAA,EAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,CAAA,EAAG,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAC7F;AACD,KAAA,CAAM,WAAA,GAAc,OAAA;AAEpB,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA;AAAA,EACxB,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACzB,GAAA,CAAC,IAAA,EAAA,EAAG,GAAA,EAAU,WAAW,EAAA,CAAG,8CAAA,EAAgD,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAErG;AACA,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,gBAAA,GAAyB,KAAA,CAAA,UAAA;AAAA,EAC9B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACzB,GAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,WAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAEvF;AACA,gBAAA,CAAiB,WAAA,GAAc,kBAAA","file":"alert.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst alertVariants = cva(\n\t'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: 'bg-background text-foreground',\n\t\t\t\tdestructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t},\n\t},\n);\n\nconst Alert = React.forwardRef<\n\tHTMLDivElement,\n\tReact.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n\t<div ref={ref} role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n));\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n\t({ className, ...props }, ref) => (\n\t\t<h5 ref={ref} className={cn('mb-1 leading-none font-medium tracking-tight', className)} {...props} />\n\t),\n);\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n\t({ className, ...props }, ref) => (\n\t\t<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />\n\t),\n);\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n"]}
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
3
+
4
+ declare const Autocomplete: typeof Autocomplete$1.Root;
5
+ declare function AutocompleteInput({ className, showTrigger, showClear, startAddon, size, ...props }: Omit<Autocomplete$1.Input.Props, "size"> & {
6
+ showTrigger?: boolean;
7
+ showClear?: boolean;
8
+ startAddon?: React.ReactNode;
9
+ size?: "sm" | "default" | "lg";
10
+ ref?: React.Ref<HTMLInputElement>;
11
+ }): react_jsx_runtime.JSX.Element;
12
+ declare function AutocompletePopup({ className, children, sideOffset, ...props }: Autocomplete$1.Popup.Props & {
13
+ sideOffset?: number;
14
+ }): react_jsx_runtime.JSX.Element;
15
+ declare function AutocompleteItem({ className, children, ...props }: Autocomplete$1.Item.Props): react_jsx_runtime.JSX.Element;
16
+ declare function AutocompleteSeparator({ className, ...props }: Autocomplete$1.Separator.Props): react_jsx_runtime.JSX.Element;
17
+ declare function AutocompleteGroup({ className, ...props }: Autocomplete$1.Group.Props): react_jsx_runtime.JSX.Element;
18
+ declare function AutocompleteGroupLabel({ className, ...props }: Autocomplete$1.GroupLabel.Props): react_jsx_runtime.JSX.Element;
19
+ declare function AutocompleteEmpty({ className, ...props }: Autocomplete$1.Empty.Props): react_jsx_runtime.JSX.Element;
20
+ declare function AutocompleteRow({ className, ...props }: Autocomplete$1.Row.Props): react_jsx_runtime.JSX.Element;
21
+ declare function AutocompleteValue({ ...props }: Autocomplete$1.Value.Props): react_jsx_runtime.JSX.Element;
22
+ declare function AutocompleteList({ className, ...props }: Autocomplete$1.List.Props): react_jsx_runtime.JSX.Element;
23
+ declare function AutocompleteClear({ className, ...props }: Autocomplete$1.Clear.Props): react_jsx_runtime.JSX.Element;
24
+ declare function AutocompleteStatus({ className, ...props }: Autocomplete$1.Status.Props): react_jsx_runtime.JSX.Element;
25
+ declare function AutocompleteCollection({ ...props }: Autocomplete$1.Collection.Props): react_jsx_runtime.JSX.Element;
26
+ declare function AutocompleteTrigger({ className, ...props }: Autocomplete$1.Trigger.Props): react_jsx_runtime.JSX.Element;
27
+
28
+ export { Autocomplete, AutocompleteClear, AutocompleteCollection, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, AutocompleteRow, AutocompleteSeparator, AutocompleteStatus, AutocompleteTrigger, AutocompleteValue };