@usememos/ui 26.10.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.
- package/README.md +117 -0
- package/dist/button.cjs +74 -0
- package/dist/button.d.cts +15 -0
- package/dist/button.d.ts +15 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.cjs +98 -0
- package/dist/checkbox.d.cts +16 -0
- package/dist/checkbox.d.ts +16 -0
- package/dist/checkbox.js +7 -0
- package/dist/chunk-3DNMGJFC.js +216 -0
- package/dist/chunk-3VYNJ6UM.js +27 -0
- package/dist/chunk-3YY2G3JK.js +125 -0
- package/dist/chunk-5GQEJQKE.js +60 -0
- package/dist/chunk-6TNEFWVX.js +9 -0
- package/dist/chunk-BH4MPO4N.js +25 -0
- package/dist/chunk-F6GH4X7N.js +34 -0
- package/dist/chunk-HYN2P4OY.js +84 -0
- package/dist/chunk-OIUVLPTE.js +54 -0
- package/dist/chunk-S6LVYCE6.js +157 -0
- package/dist/chunk-SNSDJKJP.js +44 -0
- package/dist/chunk-WPO54YPG.js +328 -0
- package/dist/chunk-Z3ME5VRQ.js +98 -0
- package/dist/control-size-Bz2gyuyO.d.cts +3 -0
- package/dist/control-size-Bz2gyuyO.d.ts +3 -0
- package/dist/dialog.cjs +203 -0
- package/dist/dialog.d.cts +34 -0
- package/dist/dialog.d.ts +34 -0
- package/dist/dialog.js +8 -0
- package/dist/dropdown-menu.cjs +378 -0
- package/dist/dropdown-menu.d.cts +60 -0
- package/dist/dropdown-menu.d.ts +60 -0
- package/dist/dropdown-menu.js +8 -0
- package/dist/index.cjs +1223 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +48 -0
- package/dist/input.cjs +67 -0
- package/dist/input.d.cts +11 -0
- package/dist/input.d.ts +11 -0
- package/dist/input.js +7 -0
- package/dist/popover.cjs +175 -0
- package/dist/popover.d.cts +53 -0
- package/dist/popover.d.ts +53 -0
- package/dist/popover.js +8 -0
- package/dist/radio-group.cjs +122 -0
- package/dist/radio-group.d.cts +25 -0
- package/dist/radio-group.d.ts +25 -0
- package/dist/radio-group.js +7 -0
- package/dist/select.cjs +266 -0
- package/dist/select.d.cts +45 -0
- package/dist/select.d.ts +45 -0
- package/dist/select.js +8 -0
- package/dist/separator.cjs +82 -0
- package/dist/separator.d.cts +12 -0
- package/dist/separator.d.ts +12 -0
- package/dist/separator.js +7 -0
- package/dist/switch.cjs +92 -0
- package/dist/switch.d.cts +16 -0
- package/dist/switch.d.ts +16 -0
- package/dist/switch.js +7 -0
- package/dist/theme.css +1097 -0
- package/dist/tooltip.cjs +148 -0
- package/dist/tooltip.d.cts +24 -0
- package/dist/tooltip.d.ts +24 -0
- package/dist/tooltip.js +8 -0
- package/package.json +172 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOverlayLayerProps
|
|
3
|
+
} from "./chunk-BH4MPO4N.js";
|
|
4
|
+
import {
|
|
5
|
+
cx
|
|
6
|
+
} from "./chunk-6TNEFWVX.js";
|
|
7
|
+
|
|
8
|
+
// src/overlay/dropdown-menu.tsx
|
|
9
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
// ../primitives/src/overlay/dropdown-menu.tsx
|
|
12
|
+
import { Menu as DropdownMenuPrimitive } from "@base-ui/react/menu";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var Root = (props) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-scope": "dropdown-menu", "data-part": "root", ...props });
|
|
17
|
+
};
|
|
18
|
+
var Trigger = React.forwardRef((props, ref) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { ref, "data-scope": "dropdown-menu", "data-part": "trigger", ...props });
|
|
20
|
+
});
|
|
21
|
+
var Portal = (props) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-scope": "dropdown-menu", "data-part": "portal", ...props });
|
|
23
|
+
};
|
|
24
|
+
var Content = React.forwardRef(
|
|
25
|
+
({
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
align = "start",
|
|
29
|
+
collisionPadding = 8,
|
|
30
|
+
sideOffset = 4,
|
|
31
|
+
...props
|
|
32
|
+
}, ref) => {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
DropdownMenuPrimitive.Positioner,
|
|
35
|
+
{
|
|
36
|
+
"data-scope": "dropdown-menu",
|
|
37
|
+
"data-part": "positioner",
|
|
38
|
+
align,
|
|
39
|
+
collisionPadding,
|
|
40
|
+
sideOffset,
|
|
41
|
+
...props,
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
DropdownMenuPrimitive.Popup,
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
"data-scope": "dropdown-menu",
|
|
47
|
+
"data-part": "content",
|
|
48
|
+
className,
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
var Item = React.forwardRef((props, ref) => {
|
|
57
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, { ref, "data-scope": "dropdown-menu", "data-part": "item", ...props });
|
|
58
|
+
});
|
|
59
|
+
var CheckboxItem = React.forwardRef((props, ref) => {
|
|
60
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.CheckboxItem, { ref, "data-scope": "dropdown-menu", "data-part": "checkbox-item", ...props });
|
|
61
|
+
});
|
|
62
|
+
var CheckboxItemIndicator = React.forwardRef((props, ref) => {
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
DropdownMenuPrimitive.CheckboxItemIndicator,
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
"data-scope": "dropdown-menu",
|
|
68
|
+
"data-part": "checkbox-item-indicator",
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
var RadioItem = React.forwardRef((props, ref) => {
|
|
74
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioItem, { ref, "data-scope": "dropdown-menu", "data-part": "radio-item", ...props });
|
|
75
|
+
});
|
|
76
|
+
var RadioItemIndicator = React.forwardRef((props, ref) => {
|
|
77
|
+
return /* @__PURE__ */ jsx(
|
|
78
|
+
DropdownMenuPrimitive.RadioItemIndicator,
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
"data-scope": "dropdown-menu",
|
|
82
|
+
"data-part": "radio-item-indicator",
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
var Label = React.forwardRef((props, ref) => {
|
|
88
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.GroupLabel, { ref, "data-scope": "dropdown-menu", "data-part": "label", ...props });
|
|
89
|
+
});
|
|
90
|
+
var Separator = React.forwardRef((props, ref) => {
|
|
91
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, "data-scope": "dropdown-menu", "data-part": "separator", ...props });
|
|
92
|
+
});
|
|
93
|
+
var Group = (props) => {
|
|
94
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-scope": "dropdown-menu", "data-part": "group", ...props });
|
|
95
|
+
};
|
|
96
|
+
var Sub = (props) => {
|
|
97
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubmenuRoot, { "data-scope": "dropdown-menu", "data-part": "sub", ...props });
|
|
98
|
+
};
|
|
99
|
+
var SubTrigger = React.forwardRef((props, ref) => {
|
|
100
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubmenuTrigger, { ref, "data-scope": "dropdown-menu", "data-part": "sub-trigger", ...props });
|
|
101
|
+
});
|
|
102
|
+
var SubContent = React.forwardRef(
|
|
103
|
+
({
|
|
104
|
+
className,
|
|
105
|
+
children,
|
|
106
|
+
align = "start",
|
|
107
|
+
collisionPadding = 8,
|
|
108
|
+
sideOffset = 4,
|
|
109
|
+
...props
|
|
110
|
+
}, ref) => {
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
DropdownMenuPrimitive.Positioner,
|
|
113
|
+
{
|
|
114
|
+
"data-scope": "dropdown-menu",
|
|
115
|
+
"data-part": "sub-positioner",
|
|
116
|
+
align,
|
|
117
|
+
collisionPadding,
|
|
118
|
+
sideOffset,
|
|
119
|
+
...props,
|
|
120
|
+
children: /* @__PURE__ */ jsx(
|
|
121
|
+
DropdownMenuPrimitive.Popup,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
"data-scope": "dropdown-menu",
|
|
125
|
+
"data-part": "sub-content",
|
|
126
|
+
className,
|
|
127
|
+
children
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
var RadioGroup = (props) => {
|
|
135
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, { "data-scope": "dropdown-menu", "data-part": "radio-group", ...props });
|
|
136
|
+
};
|
|
137
|
+
Root.displayName = "DropdownMenu.Root";
|
|
138
|
+
Trigger.displayName = "DropdownMenu.Trigger";
|
|
139
|
+
Portal.displayName = "DropdownMenu.Portal";
|
|
140
|
+
Content.displayName = "DropdownMenu.Content";
|
|
141
|
+
Item.displayName = "DropdownMenu.Item";
|
|
142
|
+
CheckboxItem.displayName = "DropdownMenu.CheckboxItem";
|
|
143
|
+
CheckboxItemIndicator.displayName = "DropdownMenu.CheckboxItemIndicator";
|
|
144
|
+
RadioItem.displayName = "DropdownMenu.RadioItem";
|
|
145
|
+
RadioItemIndicator.displayName = "DropdownMenu.RadioItemIndicator";
|
|
146
|
+
Label.displayName = "DropdownMenu.Label";
|
|
147
|
+
Separator.displayName = "DropdownMenu.Separator";
|
|
148
|
+
Group.displayName = "DropdownMenu.Group";
|
|
149
|
+
Sub.displayName = "DropdownMenu.Sub";
|
|
150
|
+
SubTrigger.displayName = "DropdownMenu.SubTrigger";
|
|
151
|
+
SubContent.displayName = "DropdownMenu.SubContent";
|
|
152
|
+
RadioGroup.displayName = "DropdownMenu.RadioGroup";
|
|
153
|
+
var DropdownMenu = {
|
|
154
|
+
Root,
|
|
155
|
+
Trigger,
|
|
156
|
+
Portal,
|
|
157
|
+
Content,
|
|
158
|
+
Item,
|
|
159
|
+
CheckboxItem,
|
|
160
|
+
CheckboxItemIndicator,
|
|
161
|
+
RadioItem,
|
|
162
|
+
RadioItemIndicator,
|
|
163
|
+
Label,
|
|
164
|
+
Separator,
|
|
165
|
+
Group,
|
|
166
|
+
Sub,
|
|
167
|
+
SubTrigger,
|
|
168
|
+
SubContent,
|
|
169
|
+
RadioGroup
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// src/overlay/dropdown-menu.tsx
|
|
173
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
174
|
+
var Root2 = DropdownMenu.Root;
|
|
175
|
+
var Trigger2 = DropdownMenu.Trigger;
|
|
176
|
+
var Portal2 = DropdownMenu.Portal;
|
|
177
|
+
var Group2 = DropdownMenu.Group;
|
|
178
|
+
var Sub2 = DropdownMenu.Sub;
|
|
179
|
+
var RadioGroup2 = DropdownMenu.RadioGroup;
|
|
180
|
+
function ItemText({ className, ...props }) {
|
|
181
|
+
return /* @__PURE__ */ jsx2("span", { className: cx("mui-dropdown-menu__item-text", className), ...props });
|
|
182
|
+
}
|
|
183
|
+
function Shortcut({ className, ...props }) {
|
|
184
|
+
return /* @__PURE__ */ jsx2("span", { className: cx("mui-dropdown-menu__shortcut", className), ...props });
|
|
185
|
+
}
|
|
186
|
+
function Content2({
|
|
187
|
+
className,
|
|
188
|
+
sideOffset = 4,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
const layerProps = useOverlayLayerProps(props);
|
|
192
|
+
return /* @__PURE__ */ jsx2(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx2(
|
|
193
|
+
DropdownMenu.Content,
|
|
194
|
+
{
|
|
195
|
+
className: cx("mui-dropdown-menu__content", className),
|
|
196
|
+
sideOffset,
|
|
197
|
+
...layerProps
|
|
198
|
+
}
|
|
199
|
+
) });
|
|
200
|
+
}
|
|
201
|
+
function Item2({
|
|
202
|
+
className,
|
|
203
|
+
children,
|
|
204
|
+
...props
|
|
205
|
+
}) {
|
|
206
|
+
return /* @__PURE__ */ jsxs(
|
|
207
|
+
DropdownMenu.Item,
|
|
208
|
+
{
|
|
209
|
+
className: cx("mui-dropdown-menu__item", className),
|
|
210
|
+
...props,
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ jsx2("span", { className: "mui-dropdown-menu__item-leading", "aria-hidden": "true" }),
|
|
213
|
+
/* @__PURE__ */ jsx2(ItemText, { children })
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
function CheckboxItem2({
|
|
219
|
+
className,
|
|
220
|
+
children,
|
|
221
|
+
...props
|
|
222
|
+
}) {
|
|
223
|
+
return /* @__PURE__ */ jsxs(
|
|
224
|
+
DropdownMenu.CheckboxItem,
|
|
225
|
+
{
|
|
226
|
+
className: cx("mui-dropdown-menu__item", className),
|
|
227
|
+
...props,
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ jsx2("span", { className: "mui-dropdown-menu__item-leading", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(DropdownMenu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx2(CheckIcon, { className: "mui-dropdown-menu__item-indicator", size: 10 }) }) }),
|
|
230
|
+
/* @__PURE__ */ jsx2(ItemText, { children })
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function RadioItem2({
|
|
236
|
+
className,
|
|
237
|
+
children,
|
|
238
|
+
...props
|
|
239
|
+
}) {
|
|
240
|
+
return /* @__PURE__ */ jsxs(
|
|
241
|
+
DropdownMenu.RadioItem,
|
|
242
|
+
{
|
|
243
|
+
className: cx("mui-dropdown-menu__item", className),
|
|
244
|
+
...props,
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsx2("span", { className: "mui-dropdown-menu__item-leading", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(DropdownMenu.RadioItemIndicator, { children: /* @__PURE__ */ jsx2(CircleIcon, { className: "mui-dropdown-menu__item-indicator", size: 6, fill: "currentColor" }) }) }),
|
|
247
|
+
/* @__PURE__ */ jsx2(ItemText, { children })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
function Label2({
|
|
253
|
+
className,
|
|
254
|
+
...props
|
|
255
|
+
}) {
|
|
256
|
+
return /* @__PURE__ */ jsx2(
|
|
257
|
+
DropdownMenu.Label,
|
|
258
|
+
{
|
|
259
|
+
className: cx("mui-dropdown-menu__label", className),
|
|
260
|
+
...props
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function Separator2({
|
|
265
|
+
className,
|
|
266
|
+
...props
|
|
267
|
+
}) {
|
|
268
|
+
return /* @__PURE__ */ jsx2(
|
|
269
|
+
DropdownMenu.Separator,
|
|
270
|
+
{
|
|
271
|
+
className: cx("mui-dropdown-menu__separator", className),
|
|
272
|
+
...props
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
function SubTrigger2({
|
|
277
|
+
className,
|
|
278
|
+
children,
|
|
279
|
+
...props
|
|
280
|
+
}) {
|
|
281
|
+
return /* @__PURE__ */ jsxs(
|
|
282
|
+
DropdownMenu.SubTrigger,
|
|
283
|
+
{
|
|
284
|
+
className: cx("mui-dropdown-menu__sub-trigger", className),
|
|
285
|
+
...props,
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ jsx2("span", { className: "mui-dropdown-menu__item-leading", "aria-hidden": "true" }),
|
|
288
|
+
/* @__PURE__ */ jsx2(ItemText, { children }),
|
|
289
|
+
/* @__PURE__ */ jsx2("span", { className: "mui-dropdown-menu__item-trailing", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(ChevronRightIcon, { size: 12 }) })
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
function SubContent2({
|
|
295
|
+
className,
|
|
296
|
+
...props
|
|
297
|
+
}) {
|
|
298
|
+
const layerProps = useOverlayLayerProps(props);
|
|
299
|
+
return /* @__PURE__ */ jsx2(
|
|
300
|
+
DropdownMenu.SubContent,
|
|
301
|
+
{
|
|
302
|
+
className: cx("mui-dropdown-menu__content", className),
|
|
303
|
+
...layerProps
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
var DropdownMenu2 = {
|
|
308
|
+
Root: Root2,
|
|
309
|
+
Trigger: Trigger2,
|
|
310
|
+
Portal: Portal2,
|
|
311
|
+
Group: Group2,
|
|
312
|
+
Sub: Sub2,
|
|
313
|
+
RadioGroup: RadioGroup2,
|
|
314
|
+
Content: Content2,
|
|
315
|
+
Item: Item2,
|
|
316
|
+
CheckboxItem: CheckboxItem2,
|
|
317
|
+
RadioItem: RadioItem2,
|
|
318
|
+
Label: Label2,
|
|
319
|
+
Separator: Separator2,
|
|
320
|
+
ItemText,
|
|
321
|
+
Shortcut,
|
|
322
|
+
SubTrigger: SubTrigger2,
|
|
323
|
+
SubContent: SubContent2
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export {
|
|
327
|
+
DropdownMenu2 as DropdownMenu
|
|
328
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOverlayLayerProps
|
|
3
|
+
} from "./chunk-BH4MPO4N.js";
|
|
4
|
+
import {
|
|
5
|
+
cx
|
|
6
|
+
} from "./chunk-6TNEFWVX.js";
|
|
7
|
+
|
|
8
|
+
// ../primitives/src/overlay/tooltip.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var Provider = (props) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { "data-scope": "tooltip", "data-part": "provider", ...props });
|
|
14
|
+
};
|
|
15
|
+
var Root = (props) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-scope": "tooltip", "data-part": "root", ...props });
|
|
17
|
+
};
|
|
18
|
+
var Trigger = React.forwardRef((props, ref) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { ref, "data-scope": "tooltip", "data-part": "trigger", ...props });
|
|
20
|
+
});
|
|
21
|
+
var Portal = (props) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { "data-scope": "tooltip", "data-part": "portal", ...props });
|
|
23
|
+
};
|
|
24
|
+
var Content = React.forwardRef(
|
|
25
|
+
({
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
align = "center",
|
|
29
|
+
collisionPadding = 8,
|
|
30
|
+
sideOffset = 4,
|
|
31
|
+
...props
|
|
32
|
+
}, ref) => {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
TooltipPrimitive.Positioner,
|
|
35
|
+
{
|
|
36
|
+
"data-scope": "tooltip",
|
|
37
|
+
"data-part": "positioner",
|
|
38
|
+
align,
|
|
39
|
+
collisionPadding,
|
|
40
|
+
sideOffset,
|
|
41
|
+
...props,
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
TooltipPrimitive.Popup,
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
"data-scope": "tooltip",
|
|
47
|
+
"data-part": "content",
|
|
48
|
+
className,
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
Provider.displayName = "Tooltip.Provider";
|
|
57
|
+
Root.displayName = "Tooltip.Root";
|
|
58
|
+
Trigger.displayName = "Tooltip.Trigger";
|
|
59
|
+
Portal.displayName = "Tooltip.Portal";
|
|
60
|
+
Content.displayName = "Tooltip.Content";
|
|
61
|
+
var Tooltip = {
|
|
62
|
+
Provider,
|
|
63
|
+
Root,
|
|
64
|
+
Trigger,
|
|
65
|
+
Portal,
|
|
66
|
+
Content
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/overlay/tooltip.tsx
|
|
70
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
71
|
+
var Provider2 = Tooltip.Provider;
|
|
72
|
+
var Root2 = Tooltip.Root;
|
|
73
|
+
var Trigger2 = Tooltip.Trigger;
|
|
74
|
+
function Content2({
|
|
75
|
+
className,
|
|
76
|
+
sideOffset = 6,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
const layerProps = useOverlayLayerProps(props);
|
|
80
|
+
return /* @__PURE__ */ jsx2(Tooltip.Portal, { children: /* @__PURE__ */ jsx2(
|
|
81
|
+
Tooltip.Content,
|
|
82
|
+
{
|
|
83
|
+
className: cx("mui-tooltip__content", className),
|
|
84
|
+
sideOffset,
|
|
85
|
+
...layerProps
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
88
|
+
}
|
|
89
|
+
var Tooltip2 = {
|
|
90
|
+
Provider: Provider2,
|
|
91
|
+
Root: Root2,
|
|
92
|
+
Trigger: Trigger2,
|
|
93
|
+
Content: Content2
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
Tooltip2 as Tooltip
|
|
98
|
+
};
|
package/dist/dialog.cjs
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/dialog.ts
|
|
31
|
+
var dialog_exports = {};
|
|
32
|
+
__export(dialog_exports, {
|
|
33
|
+
Dialog: () => Dialog2
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(dialog_exports);
|
|
36
|
+
|
|
37
|
+
// src/overlay/dialog.tsx
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var React3 = __toESM(require("react"), 1);
|
|
40
|
+
|
|
41
|
+
// ../primitives/src/overlay/dialog.tsx
|
|
42
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var Root = (props) => {
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { "data-scope": "dialog", "data-part": "root", ...props });
|
|
47
|
+
};
|
|
48
|
+
var Trigger = React.forwardRef((props, ref) => {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Trigger, { ref, "data-scope": "dialog", "data-part": "trigger", ...props });
|
|
50
|
+
});
|
|
51
|
+
var Portal = (props) => {
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Portal, { "data-scope": "dialog", "data-part": "portal", ...props });
|
|
53
|
+
};
|
|
54
|
+
var Overlay = React.forwardRef((props, ref) => {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Backdrop, { ref, "data-scope": "dialog", "data-part": "overlay", ...props });
|
|
56
|
+
});
|
|
57
|
+
var Content = React.forwardRef((props, ref) => {
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Popup, { ref, "data-scope": "dialog", "data-part": "content", ...props });
|
|
59
|
+
});
|
|
60
|
+
var Close = React.forwardRef((props, ref) => {
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { ref, "data-scope": "dialog", "data-part": "close", ...props });
|
|
62
|
+
});
|
|
63
|
+
var Title = React.forwardRef((props, ref) => {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { ref, "data-scope": "dialog", "data-part": "title", ...props });
|
|
65
|
+
});
|
|
66
|
+
var Description = React.forwardRef((props, ref) => {
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Description, { ref, "data-scope": "dialog", "data-part": "description", ...props });
|
|
68
|
+
});
|
|
69
|
+
Root.displayName = "Dialog.Root";
|
|
70
|
+
Trigger.displayName = "Dialog.Trigger";
|
|
71
|
+
Portal.displayName = "Dialog.Portal";
|
|
72
|
+
Overlay.displayName = "Dialog.Overlay";
|
|
73
|
+
Content.displayName = "Dialog.Content";
|
|
74
|
+
Close.displayName = "Dialog.Close";
|
|
75
|
+
Title.displayName = "Dialog.Title";
|
|
76
|
+
Description.displayName = "Dialog.Description";
|
|
77
|
+
var Dialog = {
|
|
78
|
+
Root,
|
|
79
|
+
Trigger,
|
|
80
|
+
Portal,
|
|
81
|
+
Overlay,
|
|
82
|
+
Content,
|
|
83
|
+
Close,
|
|
84
|
+
Title,
|
|
85
|
+
Description
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/overlay/layer-context.tsx
|
|
89
|
+
var React2 = __toESM(require("react"), 1);
|
|
90
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
91
|
+
var OverlayLayerContext = React2.createContext("root");
|
|
92
|
+
function OverlayLayerProvider({
|
|
93
|
+
children,
|
|
94
|
+
value
|
|
95
|
+
}) {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OverlayLayerContext.Provider, { value, children });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/shared/cx.ts
|
|
100
|
+
var import_clsx = require("clsx");
|
|
101
|
+
function cx(...values) {
|
|
102
|
+
return (0, import_clsx.clsx)(values);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/overlay/dialog.tsx
|
|
106
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
107
|
+
var Root2 = Dialog.Root;
|
|
108
|
+
var Trigger2 = Dialog.Trigger;
|
|
109
|
+
var Portal2 = Dialog.Portal;
|
|
110
|
+
var Overlay2 = React3.forwardRef(({ className, ...props }, ref) => {
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
112
|
+
Dialog.Overlay,
|
|
113
|
+
{
|
|
114
|
+
ref,
|
|
115
|
+
className: cx("mui-dialog__overlay", className),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
var Close2 = React3.forwardRef(({ className, children, ...props }, ref) => {
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
122
|
+
Dialog.Close,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: cx("mui-dialog__close", className),
|
|
126
|
+
...props,
|
|
127
|
+
children: [
|
|
128
|
+
children ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.XIcon, { size: 14, "aria-hidden": "true" }),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: "Close" })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
var Content2 = React3.forwardRef(({ className, children, showCloseButton = true, slotProps, ...props }, ref) => {
|
|
135
|
+
const closeProps = {
|
|
136
|
+
"aria-label": "Close dialog",
|
|
137
|
+
...slotProps?.close
|
|
138
|
+
};
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Portal2, { children: [
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Overlay2, {}),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
142
|
+
Dialog.Content,
|
|
143
|
+
{
|
|
144
|
+
ref,
|
|
145
|
+
className: cx("mui-dialog__content", className),
|
|
146
|
+
...props,
|
|
147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(OverlayLayerProvider, { value: "modal", children: [
|
|
148
|
+
children,
|
|
149
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Close2, { ...closeProps }) : null
|
|
150
|
+
] })
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] });
|
|
154
|
+
});
|
|
155
|
+
var Header = React3.forwardRef(
|
|
156
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref, className: cx("mui-dialog__header", className), ...props })
|
|
157
|
+
);
|
|
158
|
+
var Footer = React3.forwardRef(
|
|
159
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref, className: cx("mui-dialog__footer", className), ...props })
|
|
160
|
+
);
|
|
161
|
+
var Title2 = React3.forwardRef(({ className, ...props }, ref) => {
|
|
162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
163
|
+
Dialog.Title,
|
|
164
|
+
{
|
|
165
|
+
ref,
|
|
166
|
+
className: cx("mui-dialog__title", className),
|
|
167
|
+
...props
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
});
|
|
171
|
+
var Description2 = React3.forwardRef(({ className, ...props }, ref) => {
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
173
|
+
Dialog.Description,
|
|
174
|
+
{
|
|
175
|
+
ref,
|
|
176
|
+
className: cx("mui-dialog__description", className),
|
|
177
|
+
...props
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
Header.displayName = "Dialog.Header";
|
|
182
|
+
Footer.displayName = "Dialog.Footer";
|
|
183
|
+
Title2.displayName = "Dialog.Title";
|
|
184
|
+
Description2.displayName = "Dialog.Description";
|
|
185
|
+
Close2.displayName = "Dialog.Close";
|
|
186
|
+
Content2.displayName = "Dialog.Content";
|
|
187
|
+
Overlay2.displayName = "Dialog.Overlay";
|
|
188
|
+
var Dialog2 = {
|
|
189
|
+
Root: Root2,
|
|
190
|
+
Trigger: Trigger2,
|
|
191
|
+
Portal: Portal2,
|
|
192
|
+
Overlay: Overlay2,
|
|
193
|
+
Content: Content2,
|
|
194
|
+
Close: Close2,
|
|
195
|
+
Header,
|
|
196
|
+
Footer,
|
|
197
|
+
Title: Title2,
|
|
198
|
+
Description: Description2
|
|
199
|
+
};
|
|
200
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
201
|
+
0 && (module.exports = {
|
|
202
|
+
Dialog
|
|
203
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as _base_ui_react from '@base-ui/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dialog as Dialog$2 } from '@base-ui/react/dialog';
|
|
4
|
+
|
|
5
|
+
declare const Dialog$1: {
|
|
6
|
+
Root: React.FC<Dialog$2.Root.Props<unknown>>;
|
|
7
|
+
Trigger: React.ForwardRefExoticComponent<Omit<_base_ui_react.DialogTriggerProps<unknown> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
Portal: React.FC<Omit<Omit<_base_ui_react.DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">>;
|
|
9
|
+
Overlay: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Content: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
Close: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
Title: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
|
+
Description: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare const Dialog: {
|
|
17
|
+
Root: React.FC<_base_ui_react.DialogRoot.Props<unknown>>;
|
|
18
|
+
Trigger: React.ForwardRefExoticComponent<Omit<_base_ui_react.DialogTriggerProps<unknown> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
Portal: React.FC<Omit<Omit<_base_ui_react.DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">>;
|
|
20
|
+
Overlay: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
Content: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
slotProps?: {
|
|
24
|
+
close?: React.ComponentPropsWithoutRef<typeof Dialog$1.Close>;
|
|
25
|
+
};
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Close: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
Header: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
Footer: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Title: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
31
|
+
Description: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Dialog };
|