beez-ui 2.7.0 → 3.0.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/CHANGELOG.md +78 -0
- package/README.md +43 -13
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/account-menu.d.ts +4 -3
- package/dist/components/account-menu.js +63 -54
- package/dist/components/alert.d.ts +15 -15
- package/dist/components/alert.js +289 -270
- package/dist/components/animated-theme-toggler.js +1 -1
- package/dist/components/avatar.d.ts +56 -31
- package/dist/components/avatar.js +394 -277
- package/dist/components/badge.d.ts +8 -28
- package/dist/components/badge.js +55 -108
- package/dist/components/calendar.d.ts +36 -26
- package/dist/components/calendar.js +132 -1227
- package/dist/components/card.d.ts +36 -25
- package/dist/components/card.js +895 -72
- package/dist/components/carousel.d.ts +63 -47
- package/dist/components/carousel.js +496 -777
- package/dist/components/data-table.d.ts +5 -4
- package/dist/components/data-table.js +7 -6
- package/dist/components/dialog-surface.d.ts +23 -1
- package/dist/components/dialog-surface.js +99 -3
- package/dist/components/dialog.d.ts +80 -45
- package/dist/components/dialog.js +258 -503
- package/dist/components/dropdown-menu.d.ts +56 -73
- package/dist/components/dropdown-menu.js +79 -714
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +49 -39
- package/dist/components/filter-presets-bar.js +2 -2
- package/dist/components/filter-query-bar.js +1 -1
- package/dist/components/hover-card.d.ts +42 -41
- package/dist/components/hover-card.js +57 -483
- package/dist/components/pagination.d.ts +53 -31
- package/dist/components/pagination.js +176 -412
- package/dist/components/popover.d.ts +11 -23
- package/dist/components/popover.js +19 -304
- package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
- package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +267 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +557 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +36 -0
- package/dist/components/primitives/select.js +407 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/radio-group.d.ts +30 -17
- package/dist/components/radio-group.js +266 -315
- package/dist/components/rich-link-editor.js +2 -2
- package/dist/components/select.d.ts +51 -42
- package/dist/components/select.js +163 -495
- package/dist/components/skeleton.d.ts +16 -15
- package/dist/components/skeleton.js +99 -205
- package/dist/components/split-button.js +1 -1
- package/dist/components/switch.d.ts +3 -6
- package/dist/components/switch.js +163 -170
- package/dist/components/tabs.d.ts +3 -11
- package/dist/components/tabs.js +61 -75
- package/dist/components/themed-toaster.d.ts +1 -1
- package/dist/components/themed-toaster.js +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/tooltip.d.ts +36 -31
- package/dist/components/tooltip.js +44 -284
- package/dist/constants/alert.d.ts +5 -1
- package/dist/constants/alert.js +5 -1
- package/dist/constants/avatar.d.ts +24 -1
- package/dist/constants/avatar.js +19 -0
- package/dist/constants/calendar.d.ts +12 -0
- package/dist/constants/calendar.js +12 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +31 -13
- package/dist/constants/carousel.js +32 -11
- package/dist/constants/dialog.d.ts +6 -1
- package/dist/constants/dialog.js +5 -1
- package/dist/constants/dropdown-menu.d.ts +2 -2
- package/dist/constants/dropdown-menu.js +2 -2
- package/dist/constants/pagination.d.ts +13 -2
- package/dist/constants/pagination.js +13 -2
- package/dist/constants/select.d.ts +4 -2
- package/dist/constants/select.js +4 -2
- package/dist/constants/switch.d.ts +5 -16
- package/dist/constants/switch.js +6 -14
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/motion/glide-indicator.d.ts +1 -1
- package/dist/motion/glide-indicator.js +1 -1
- package/dist/motion/presence.d.ts +0 -1
- package/dist/motion/presence.js +0 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -6
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Internal primitive of Arc's Dropdown menu (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): Arc's raised
|
|
5
|
+
* panel, item rows, danger tone, separators, placement defaults and staggered item entrance on its tokens, with
|
|
6
|
+
* beez-ui's reveal from the trigger edge and the highlight that glides between items with the keyboard. Internal: the
|
|
7
|
+
* Radix composition behind the public closed `DropdownMenu` and beez-ui's composite components; the package does not
|
|
8
|
+
* export it.
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
12
|
+
import { DROPDOWN_MENU_COLLISION_PADDING_PX, DROPDOWN_MENU_SIDE_OFFSET_PX } from "../../constants/dropdown-menu.js";
|
|
13
|
+
import { GlideSlot } from "../../motion/glide-slot.js";
|
|
14
|
+
import { MotionSlot } from "../../motion/motion-slot.js";
|
|
15
|
+
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../../motion/presence.js";
|
|
16
|
+
import { cn } from "../../lib/utils.js";
|
|
17
|
+
import { CheckIcon } from "lucide-react";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
/**
|
|
20
|
+
* Arc's menu panel on its tokens. It also sets the direction its items rise in from (`--menu-item-offset-*`, toward
|
|
21
|
+
* the trigger).
|
|
22
|
+
*/
|
|
23
|
+
const menuSurfaceClassName = "relative z-50 overflow-x-hidden overflow-y-auto rounded-(--radius-panel) border border-border bg-surface-raised p-[5px] text-foreground shadow-(--shadow-floating) data-[state=closed]:pointer-events-none data-[state=closed]:overflow-hidden [--menu-item-offset-x:0px] [--menu-item-offset-y:-2px] data-[side=top]:[--menu-item-offset-y:2px] data-[side=left]:[--menu-item-offset-x:2px] data-[side=left]:[--menu-item-offset-y:0px] data-[side=right]:[--menu-item-offset-x:-2px] data-[side=right]:[--menu-item-offset-y:0px]";
|
|
24
|
+
/**
|
|
25
|
+
* Arc's item row: 36px tall, a muted fill when highlighted and a muted icon (icons with their own `text-*` color keep
|
|
26
|
+
* it). Items fade and rise in once when the menu opens, staggered by 35ms up to the fifth row; reduced motion shows
|
|
27
|
+
* them at once. Only color, opacity and translate transition, so the highlight fill paints instantly and the
|
|
28
|
+
* keyboard glide owns its movement.
|
|
29
|
+
*/
|
|
30
|
+
const menuItemClassName = "relative flex min-h-9 cursor-pointer items-center gap-2.5 rounded-[calc(var(--radius-panel)-6px)] px-[11px] text-sm text-foreground outline-hidden select-none [transition:color_var(--duration-fast)_var(--ease-standard),opacity_var(--duration-standard)_var(--ease-enter)_var(--menu-item-delay,0ms),translate_var(--duration-standard)_var(--ease-enter)_var(--menu-item-delay,0ms)] starting:opacity-0 starting:[translate:var(--menu-item-offset-x,0px)_var(--menu-item-offset-y,0px)] nth-2:[--menu-item-delay:35ms] nth-3:[--menu-item-delay:70ms] nth-4:[--menu-item-delay:105ms] nth-[n+5]:[--menu-item-delay:140ms] motion-reduce:transition-none data-highlighted:bg-surface-muted data-inset:pl-[38px] data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[svg:not([class*='text-'])]:text-text-secondary";
|
|
31
|
+
/** Room at the end of checkbox and radio rows for their check, as in Arc's select options. */
|
|
32
|
+
const menuSelectableItemClassName = "pr-[34px]";
|
|
33
|
+
/**
|
|
34
|
+
* Arc's danger tone of a `destructive` row of any kind: danger text and icon over a faint danger fill when highlighted.
|
|
35
|
+
*/
|
|
36
|
+
const menuItemDestructiveClassName = "data-[variant=destructive]:text-danger data-[variant=destructive]:*:[svg:not([class*='text-'])]:text-danger data-[variant=destructive]:data-highlighted:bg-[color-mix(in_oklab,var(--danger)_8%,var(--surface))]";
|
|
37
|
+
/** Position and color of the check of checkbox and radio rows. */
|
|
38
|
+
const menuItemIndicatorClassName = "pointer-events-none absolute right-2.5 flex items-center justify-center text-foreground";
|
|
39
|
+
function DropdownMenu(t0) {
|
|
40
|
+
const $ = _c(9);
|
|
41
|
+
let props;
|
|
42
|
+
if ($[0] !== t0) {
|
|
43
|
+
({...props} = t0);
|
|
44
|
+
$[0] = t0;
|
|
45
|
+
$[1] = props;
|
|
46
|
+
} else {
|
|
47
|
+
props = $[1];
|
|
48
|
+
}
|
|
49
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
50
|
+
let t1;
|
|
51
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
52
|
+
t1 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Root, {
|
|
53
|
+
"data-slot": "dropdown-menu",
|
|
54
|
+
...props,
|
|
55
|
+
open: motionOpen,
|
|
56
|
+
onOpenChange: setMotionOpen
|
|
57
|
+
});
|
|
58
|
+
$[2] = motionOpen;
|
|
59
|
+
$[3] = props;
|
|
60
|
+
$[4] = setMotionOpen;
|
|
61
|
+
$[5] = t1;
|
|
62
|
+
} else {
|
|
63
|
+
t1 = $[5];
|
|
64
|
+
}
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
67
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
68
|
+
scope: "dropdown-menu",
|
|
69
|
+
open: motionOpen,
|
|
70
|
+
children: t1
|
|
71
|
+
});
|
|
72
|
+
$[6] = motionOpen;
|
|
73
|
+
$[7] = t1;
|
|
74
|
+
$[8] = t2;
|
|
75
|
+
} else {
|
|
76
|
+
t2 = $[8];
|
|
77
|
+
}
|
|
78
|
+
return t2;
|
|
79
|
+
}
|
|
80
|
+
function DropdownMenuTrigger(t0) {
|
|
81
|
+
const $ = _c(4);
|
|
82
|
+
let props;
|
|
83
|
+
if ($[0] !== t0) {
|
|
84
|
+
({...props} = t0);
|
|
85
|
+
$[0] = t0;
|
|
86
|
+
$[1] = props;
|
|
87
|
+
} else {
|
|
88
|
+
props = $[1];
|
|
89
|
+
}
|
|
90
|
+
let t1;
|
|
91
|
+
if ($[2] !== props) {
|
|
92
|
+
t1 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Trigger, {
|
|
93
|
+
"data-slot": "dropdown-menu-trigger",
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
$[2] = props;
|
|
97
|
+
$[3] = t1;
|
|
98
|
+
} else {
|
|
99
|
+
t1 = $[3];
|
|
100
|
+
}
|
|
101
|
+
return t1;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Arc's menu panel. It sizes action menus by their content, at least 12rem unless the viewport is narrower, instead
|
|
105
|
+
* of narrowing them to an icon trigger.
|
|
106
|
+
* @param props - Primitive properties. Arc's defaults: `align="start"`, a 6px `sideOffset`, a 12px
|
|
107
|
+
* `collisionPadding` and `loop`, so arrow keys wrap from the last item to the first.
|
|
108
|
+
* @returns The portaled menu, animated in and out with its open state.
|
|
109
|
+
*/
|
|
110
|
+
function DropdownMenuContent(t0) {
|
|
111
|
+
const $ = _c(23);
|
|
112
|
+
let className;
|
|
113
|
+
let onClick;
|
|
114
|
+
let props;
|
|
115
|
+
let t1;
|
|
116
|
+
let t2;
|
|
117
|
+
let t3;
|
|
118
|
+
let t4;
|
|
119
|
+
if ($[0] !== t0) {
|
|
120
|
+
({className, align: t1, sideOffset: t2, collisionPadding: t3, loop: t4, onClick, ...props} = t0);
|
|
121
|
+
$[0] = t0;
|
|
122
|
+
$[1] = className;
|
|
123
|
+
$[2] = onClick;
|
|
124
|
+
$[3] = props;
|
|
125
|
+
$[4] = t1;
|
|
126
|
+
$[5] = t2;
|
|
127
|
+
$[6] = t3;
|
|
128
|
+
$[7] = t4;
|
|
129
|
+
} else {
|
|
130
|
+
className = $[1];
|
|
131
|
+
onClick = $[2];
|
|
132
|
+
props = $[3];
|
|
133
|
+
t1 = $[4];
|
|
134
|
+
t2 = $[5];
|
|
135
|
+
t3 = $[6];
|
|
136
|
+
t4 = $[7];
|
|
137
|
+
}
|
|
138
|
+
const align = t1 === undefined ? "start" : t1;
|
|
139
|
+
const sideOffset = t2 === undefined ? DROPDOWN_MENU_SIDE_OFFSET_PX : t2;
|
|
140
|
+
const collisionPadding = t3 === undefined ? DROPDOWN_MENU_COLLISION_PADDING_PX : t3;
|
|
141
|
+
const loop = t4 === undefined ? true : t4;
|
|
142
|
+
let t5;
|
|
143
|
+
if ($[8] !== onClick) {
|
|
144
|
+
t5 = (event) => {
|
|
145
|
+
onClick?.(event);
|
|
146
|
+
event.stopPropagation();
|
|
147
|
+
};
|
|
148
|
+
$[8] = onClick;
|
|
149
|
+
$[9] = t5;
|
|
150
|
+
} else {
|
|
151
|
+
t5 = $[9];
|
|
152
|
+
}
|
|
153
|
+
const stopClickAtPanel = t5;
|
|
154
|
+
const t6 = props.forceMount;
|
|
155
|
+
let t7;
|
|
156
|
+
if ($[10] !== className) {
|
|
157
|
+
t7 = cn(menuSurfaceClassName, "max-h-(--radix-dropdown-menu-content-available-height) min-w-[min(12rem,var(--radix-dropdown-menu-content-available-width))] max-w-(--radix-dropdown-menu-content-available-width) origin-(--radix-dropdown-menu-content-transform-origin)", className);
|
|
158
|
+
$[10] = className;
|
|
159
|
+
$[11] = t7;
|
|
160
|
+
} else {
|
|
161
|
+
t7 = $[11];
|
|
162
|
+
}
|
|
163
|
+
let t8;
|
|
164
|
+
if ($[12] !== align || $[13] !== collisionPadding || $[14] !== loop || $[15] !== props || $[16] !== sideOffset || $[17] !== stopClickAtPanel || $[18] !== t7) {
|
|
165
|
+
t8 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
166
|
+
kind: "surface",
|
|
167
|
+
children: /* @__PURE__ */ _jsx(GlideSlot, {
|
|
168
|
+
preset: "menu",
|
|
169
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Content, {
|
|
170
|
+
forceMount: true,
|
|
171
|
+
"data-slot": "dropdown-menu-content",
|
|
172
|
+
sideOffset,
|
|
173
|
+
align,
|
|
174
|
+
collisionPadding,
|
|
175
|
+
loop,
|
|
176
|
+
className: t7,
|
|
177
|
+
...props,
|
|
178
|
+
onClick: stopClickAtPanel
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
$[12] = align;
|
|
183
|
+
$[13] = collisionPadding;
|
|
184
|
+
$[14] = loop;
|
|
185
|
+
$[15] = props;
|
|
186
|
+
$[16] = sideOffset;
|
|
187
|
+
$[17] = stopClickAtPanel;
|
|
188
|
+
$[18] = t7;
|
|
189
|
+
$[19] = t8;
|
|
190
|
+
} else {
|
|
191
|
+
t8 = $[19];
|
|
192
|
+
}
|
|
193
|
+
let t9;
|
|
194
|
+
if ($[20] !== props.forceMount || $[21] !== t8) {
|
|
195
|
+
t9 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Portal, {
|
|
196
|
+
forceMount: true,
|
|
197
|
+
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
198
|
+
scope: "dropdown-menu",
|
|
199
|
+
forceMount: t6,
|
|
200
|
+
children: t8
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
$[20] = props.forceMount;
|
|
204
|
+
$[21] = t8;
|
|
205
|
+
$[22] = t9;
|
|
206
|
+
} else {
|
|
207
|
+
t9 = $[22];
|
|
208
|
+
}
|
|
209
|
+
return t9;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Renders an action row. `destructive` draws Arc's danger tone: danger text and icon over a faint danger fill when
|
|
213
|
+
* highlighted.
|
|
214
|
+
* @param props - Primitive properties, `inset` to align with rows that carry an icon, and the `variant`.
|
|
215
|
+
* @returns The styled primitive with its original interaction contract.
|
|
216
|
+
*/
|
|
217
|
+
function DropdownMenuItem(t0) {
|
|
218
|
+
const $ = _c(12);
|
|
219
|
+
let className;
|
|
220
|
+
let inset;
|
|
221
|
+
let props;
|
|
222
|
+
let t1;
|
|
223
|
+
if ($[0] !== t0) {
|
|
224
|
+
({className, inset, variant: t1, ...props} = t0);
|
|
225
|
+
$[0] = t0;
|
|
226
|
+
$[1] = className;
|
|
227
|
+
$[2] = inset;
|
|
228
|
+
$[3] = props;
|
|
229
|
+
$[4] = t1;
|
|
230
|
+
} else {
|
|
231
|
+
className = $[1];
|
|
232
|
+
inset = $[2];
|
|
233
|
+
props = $[3];
|
|
234
|
+
t1 = $[4];
|
|
235
|
+
}
|
|
236
|
+
const variant = t1 === undefined ? "default" : t1;
|
|
237
|
+
let t2;
|
|
238
|
+
if ($[5] !== className) {
|
|
239
|
+
t2 = cn("group/dropdown-menu-item", menuItemClassName, menuItemDestructiveClassName, className);
|
|
240
|
+
$[5] = className;
|
|
241
|
+
$[6] = t2;
|
|
242
|
+
} else {
|
|
243
|
+
t2 = $[6];
|
|
244
|
+
}
|
|
245
|
+
let t3;
|
|
246
|
+
if ($[7] !== inset || $[8] !== props || $[9] !== t2 || $[10] !== variant) {
|
|
247
|
+
t3 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Item, {
|
|
248
|
+
"data-slot": "dropdown-menu-item",
|
|
249
|
+
"data-inset": inset,
|
|
250
|
+
"data-variant": variant,
|
|
251
|
+
className: t2,
|
|
252
|
+
...props
|
|
253
|
+
});
|
|
254
|
+
$[7] = inset;
|
|
255
|
+
$[8] = props;
|
|
256
|
+
$[9] = t2;
|
|
257
|
+
$[10] = variant;
|
|
258
|
+
$[11] = t3;
|
|
259
|
+
} else {
|
|
260
|
+
t3 = $[11];
|
|
261
|
+
}
|
|
262
|
+
return t3;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Renders a selectable checkbox action with its check at the end of the row. `destructive` draws Arc's danger tone.
|
|
266
|
+
* @param props - Primitive properties, `inset` to align with rows that carry an icon, and the `variant`.
|
|
267
|
+
* @returns The styled primitive with its original interaction contract.
|
|
268
|
+
*/
|
|
269
|
+
function DropdownMenuCheckboxItem(t0) {
|
|
270
|
+
const $ = _c(17);
|
|
271
|
+
let checked;
|
|
272
|
+
let children;
|
|
273
|
+
let className;
|
|
274
|
+
let inset;
|
|
275
|
+
let props;
|
|
276
|
+
let t1;
|
|
277
|
+
if ($[0] !== t0) {
|
|
278
|
+
({className, children, checked, inset, variant: t1, ...props} = t0);
|
|
279
|
+
$[0] = t0;
|
|
280
|
+
$[1] = checked;
|
|
281
|
+
$[2] = children;
|
|
282
|
+
$[3] = className;
|
|
283
|
+
$[4] = inset;
|
|
284
|
+
$[5] = props;
|
|
285
|
+
$[6] = t1;
|
|
286
|
+
} else {
|
|
287
|
+
checked = $[1];
|
|
288
|
+
children = $[2];
|
|
289
|
+
className = $[3];
|
|
290
|
+
inset = $[4];
|
|
291
|
+
props = $[5];
|
|
292
|
+
t1 = $[6];
|
|
293
|
+
}
|
|
294
|
+
const variant = t1 === undefined ? "default" : t1;
|
|
295
|
+
let t2;
|
|
296
|
+
if ($[7] !== className) {
|
|
297
|
+
t2 = cn(menuItemClassName, menuSelectableItemClassName, menuItemDestructiveClassName, className);
|
|
298
|
+
$[7] = className;
|
|
299
|
+
$[8] = t2;
|
|
300
|
+
} else {
|
|
301
|
+
t2 = $[8];
|
|
302
|
+
}
|
|
303
|
+
let t3;
|
|
304
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
305
|
+
t3 = /* @__PURE__ */ _jsx("span", {
|
|
306
|
+
className: menuItemIndicatorClassName,
|
|
307
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
308
|
+
children: /* @__PURE__ */ _jsx(MotionSlot, {
|
|
309
|
+
kind: "item-check",
|
|
310
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsx(CheckIcon, { strokeWidth: 1.75 }) })
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
$[9] = t3;
|
|
314
|
+
} else {
|
|
315
|
+
t3 = $[9];
|
|
316
|
+
}
|
|
317
|
+
let t4;
|
|
318
|
+
if ($[10] !== checked || $[11] !== children || $[12] !== inset || $[13] !== props || $[14] !== t2 || $[15] !== variant) {
|
|
319
|
+
t4 = /* @__PURE__ */ _jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
320
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
321
|
+
"data-inset": inset,
|
|
322
|
+
"data-variant": variant,
|
|
323
|
+
className: t2,
|
|
324
|
+
checked,
|
|
325
|
+
...props,
|
|
326
|
+
children: [t3, children]
|
|
327
|
+
});
|
|
328
|
+
$[10] = checked;
|
|
329
|
+
$[11] = children;
|
|
330
|
+
$[12] = inset;
|
|
331
|
+
$[13] = props;
|
|
332
|
+
$[14] = t2;
|
|
333
|
+
$[15] = variant;
|
|
334
|
+
$[16] = t4;
|
|
335
|
+
} else {
|
|
336
|
+
t4 = $[16];
|
|
337
|
+
}
|
|
338
|
+
return t4;
|
|
339
|
+
}
|
|
340
|
+
function DropdownMenuRadioGroup(t0) {
|
|
341
|
+
const $ = _c(4);
|
|
342
|
+
let props;
|
|
343
|
+
if ($[0] !== t0) {
|
|
344
|
+
({...props} = t0);
|
|
345
|
+
$[0] = t0;
|
|
346
|
+
$[1] = props;
|
|
347
|
+
} else {
|
|
348
|
+
props = $[1];
|
|
349
|
+
}
|
|
350
|
+
let t1;
|
|
351
|
+
if ($[2] !== props) {
|
|
352
|
+
t1 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.RadioGroup, {
|
|
353
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
354
|
+
...props
|
|
355
|
+
});
|
|
356
|
+
$[2] = props;
|
|
357
|
+
$[3] = t1;
|
|
358
|
+
} else {
|
|
359
|
+
t1 = $[3];
|
|
360
|
+
}
|
|
361
|
+
return t1;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Renders a mutually exclusive action with its check at the end of the row. `destructive` draws Arc's danger tone.
|
|
365
|
+
* @param props - Primitive properties, `inset` to align with rows that carry an icon, and the `variant`.
|
|
366
|
+
* @returns The styled primitive with its original interaction contract.
|
|
367
|
+
*/
|
|
368
|
+
function DropdownMenuRadioItem(t0) {
|
|
369
|
+
const $ = _c(15);
|
|
370
|
+
let children;
|
|
371
|
+
let className;
|
|
372
|
+
let inset;
|
|
373
|
+
let props;
|
|
374
|
+
let t1;
|
|
375
|
+
if ($[0] !== t0) {
|
|
376
|
+
({className, children, inset, variant: t1, ...props} = t0);
|
|
377
|
+
$[0] = t0;
|
|
378
|
+
$[1] = children;
|
|
379
|
+
$[2] = className;
|
|
380
|
+
$[3] = inset;
|
|
381
|
+
$[4] = props;
|
|
382
|
+
$[5] = t1;
|
|
383
|
+
} else {
|
|
384
|
+
children = $[1];
|
|
385
|
+
className = $[2];
|
|
386
|
+
inset = $[3];
|
|
387
|
+
props = $[4];
|
|
388
|
+
t1 = $[5];
|
|
389
|
+
}
|
|
390
|
+
const variant = t1 === undefined ? "default" : t1;
|
|
391
|
+
let t2;
|
|
392
|
+
if ($[6] !== className) {
|
|
393
|
+
t2 = cn(menuItemClassName, menuSelectableItemClassName, menuItemDestructiveClassName, className);
|
|
394
|
+
$[6] = className;
|
|
395
|
+
$[7] = t2;
|
|
396
|
+
} else {
|
|
397
|
+
t2 = $[7];
|
|
398
|
+
}
|
|
399
|
+
let t3;
|
|
400
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
401
|
+
t3 = /* @__PURE__ */ _jsx("span", {
|
|
402
|
+
className: menuItemIndicatorClassName,
|
|
403
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
404
|
+
children: /* @__PURE__ */ _jsx(MotionSlot, {
|
|
405
|
+
kind: "item-check",
|
|
406
|
+
children: /* @__PURE__ */ _jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsx(CheckIcon, { strokeWidth: 1.75 }) })
|
|
407
|
+
})
|
|
408
|
+
});
|
|
409
|
+
$[8] = t3;
|
|
410
|
+
} else {
|
|
411
|
+
t3 = $[8];
|
|
412
|
+
}
|
|
413
|
+
let t4;
|
|
414
|
+
if ($[9] !== children || $[10] !== inset || $[11] !== props || $[12] !== t2 || $[13] !== variant) {
|
|
415
|
+
t4 = /* @__PURE__ */ _jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
416
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
417
|
+
"data-inset": inset,
|
|
418
|
+
"data-variant": variant,
|
|
419
|
+
className: t2,
|
|
420
|
+
...props,
|
|
421
|
+
children: [t3, children]
|
|
422
|
+
});
|
|
423
|
+
$[9] = children;
|
|
424
|
+
$[10] = inset;
|
|
425
|
+
$[11] = props;
|
|
426
|
+
$[12] = t2;
|
|
427
|
+
$[13] = variant;
|
|
428
|
+
$[14] = t4;
|
|
429
|
+
} else {
|
|
430
|
+
t4 = $[14];
|
|
431
|
+
}
|
|
432
|
+
return t4;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Renders a muted group label aligned with the item text.
|
|
436
|
+
* @param props - Primitive properties and `inset` to align with rows that carry an icon.
|
|
437
|
+
* @returns The styled primitive with its original interaction contract.
|
|
438
|
+
*/
|
|
439
|
+
function DropdownMenuLabel(t0) {
|
|
440
|
+
const $ = _c(10);
|
|
441
|
+
let className;
|
|
442
|
+
let inset;
|
|
443
|
+
let props;
|
|
444
|
+
if ($[0] !== t0) {
|
|
445
|
+
({className, inset, ...props} = t0);
|
|
446
|
+
$[0] = t0;
|
|
447
|
+
$[1] = className;
|
|
448
|
+
$[2] = inset;
|
|
449
|
+
$[3] = props;
|
|
450
|
+
} else {
|
|
451
|
+
className = $[1];
|
|
452
|
+
inset = $[2];
|
|
453
|
+
props = $[3];
|
|
454
|
+
}
|
|
455
|
+
let t1;
|
|
456
|
+
if ($[4] !== className) {
|
|
457
|
+
t1 = cn("px-[11px] py-1.5 text-xs font-medium text-text-muted data-inset:pl-[38px]", className);
|
|
458
|
+
$[4] = className;
|
|
459
|
+
$[5] = t1;
|
|
460
|
+
} else {
|
|
461
|
+
t1 = $[5];
|
|
462
|
+
}
|
|
463
|
+
let t2;
|
|
464
|
+
if ($[6] !== inset || $[7] !== props || $[8] !== t1) {
|
|
465
|
+
t2 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Label, {
|
|
466
|
+
"data-slot": "dropdown-menu-label",
|
|
467
|
+
"data-inset": inset,
|
|
468
|
+
className: t1,
|
|
469
|
+
...props
|
|
470
|
+
});
|
|
471
|
+
$[6] = inset;
|
|
472
|
+
$[7] = props;
|
|
473
|
+
$[8] = t1;
|
|
474
|
+
$[9] = t2;
|
|
475
|
+
} else {
|
|
476
|
+
t2 = $[9];
|
|
477
|
+
}
|
|
478
|
+
return t2;
|
|
479
|
+
}
|
|
480
|
+
function DropdownMenuSeparator(t0) {
|
|
481
|
+
const $ = _c(8);
|
|
482
|
+
let className;
|
|
483
|
+
let props;
|
|
484
|
+
if ($[0] !== t0) {
|
|
485
|
+
({className, ...props} = t0);
|
|
486
|
+
$[0] = t0;
|
|
487
|
+
$[1] = className;
|
|
488
|
+
$[2] = props;
|
|
489
|
+
} else {
|
|
490
|
+
className = $[1];
|
|
491
|
+
props = $[2];
|
|
492
|
+
}
|
|
493
|
+
let t1;
|
|
494
|
+
if ($[3] !== className) {
|
|
495
|
+
t1 = cn("-mx-1 my-1 h-px bg-border-subtle", className);
|
|
496
|
+
$[3] = className;
|
|
497
|
+
$[4] = t1;
|
|
498
|
+
} else {
|
|
499
|
+
t1 = $[4];
|
|
500
|
+
}
|
|
501
|
+
let t2;
|
|
502
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
503
|
+
t2 = /* @__PURE__ */ _jsx(DropdownMenuPrimitive.Separator, {
|
|
504
|
+
"data-slot": "dropdown-menu-separator",
|
|
505
|
+
className: t1,
|
|
506
|
+
...props
|
|
507
|
+
});
|
|
508
|
+
$[5] = props;
|
|
509
|
+
$[6] = t1;
|
|
510
|
+
$[7] = t2;
|
|
511
|
+
} else {
|
|
512
|
+
t2 = $[7];
|
|
513
|
+
}
|
|
514
|
+
return t2;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Renders trailing content at the end of a row, such as a shortcut or a count, muted until the row is highlighted.
|
|
518
|
+
* @param props - Span properties.
|
|
519
|
+
* @returns The trailing slot.
|
|
520
|
+
*/
|
|
521
|
+
function DropdownMenuShortcut(t0) {
|
|
522
|
+
const $ = _c(8);
|
|
523
|
+
let className;
|
|
524
|
+
let props;
|
|
525
|
+
if ($[0] !== t0) {
|
|
526
|
+
({className, ...props} = t0);
|
|
527
|
+
$[0] = t0;
|
|
528
|
+
$[1] = className;
|
|
529
|
+
$[2] = props;
|
|
530
|
+
} else {
|
|
531
|
+
className = $[1];
|
|
532
|
+
props = $[2];
|
|
533
|
+
}
|
|
534
|
+
let t1;
|
|
535
|
+
if ($[3] !== className) {
|
|
536
|
+
t1 = cn("ml-auto flex items-center text-xs text-text-muted group-data-highlighted/dropdown-menu-item:text-text-secondary", className);
|
|
537
|
+
$[3] = className;
|
|
538
|
+
$[4] = t1;
|
|
539
|
+
} else {
|
|
540
|
+
t1 = $[4];
|
|
541
|
+
}
|
|
542
|
+
let t2;
|
|
543
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
544
|
+
t2 = /* @__PURE__ */ _jsx("span", {
|
|
545
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
546
|
+
className: t1,
|
|
547
|
+
...props
|
|
548
|
+
});
|
|
549
|
+
$[5] = props;
|
|
550
|
+
$[6] = t1;
|
|
551
|
+
$[7] = t2;
|
|
552
|
+
} else {
|
|
553
|
+
t2 = $[7];
|
|
554
|
+
}
|
|
555
|
+
return t2;
|
|
556
|
+
}
|
|
557
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal primitive of Arc's Hover Card (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a read-only
|
|
3
|
+
* preview of a person or link that opens after half a second of hover or on keyboard focus, grows from the trigger
|
|
4
|
+
* edge on a smooth spring and closes fast on leave. While a card is open, and briefly after it closes, moving to
|
|
5
|
+
* another trigger opens its card almost at once and only fades. Internal: the Radix composition behind the public
|
|
6
|
+
* closed `HoverCard`, plus Arc's `HoverCardProfile` preset, which the public module re-exports.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
10
|
+
/**
|
|
11
|
+
* Owns the open state and timing of one hover card.
|
|
12
|
+
* @param props - Radix root properties. `openDelay` defaults to Arc's 500ms and `closeDelay` to 140ms; within the
|
|
13
|
+
* skip window the card waits at most 80ms.
|
|
14
|
+
* @returns The hover card root.
|
|
15
|
+
*/
|
|
16
|
+
declare function HoverCard({ openDelay, closeDelay, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): React.JSX.Element;
|
|
17
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Renders Arc's card: raised surface, hairline border, panel radius and floating shadow, 18.5rem wide at most.
|
|
20
|
+
* @param props - Radix content properties. `align` defaults to `center`, `sideOffset` to 8px and `collisionPadding`
|
|
21
|
+
* to 12px.
|
|
22
|
+
* @returns The portaled card.
|
|
23
|
+
*/
|
|
24
|
+
declare function HoverCardContent({ className, align, sideOffset, collisionPadding, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): React.JSX.Element;
|
|
25
|
+
/** One number of `HoverCardProfile`, such as followers or projects. */
|
|
26
|
+
export interface HoverCardStat {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string | number;
|
|
29
|
+
}
|
|
30
|
+
/** A person preview for `HoverCardContent`. */
|
|
31
|
+
export interface HoverCardProfileProps {
|
|
32
|
+
name: string;
|
|
33
|
+
/** Role and team, such as "Diseñadora de producto, Pagos". */
|
|
34
|
+
role?: string;
|
|
35
|
+
/** A portrait URL, or your own image element such as an `Image` adapter. Initials show when it is missing. */
|
|
36
|
+
avatar?: string | React.ReactNode;
|
|
37
|
+
bio?: string;
|
|
38
|
+
stats?: HoverCardStat[];
|
|
39
|
+
/** A footer line, such as a location and local time. */
|
|
40
|
+
meta?: React.ReactNode;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Arc's person preview: portrait, name, role, a short bio, a couple of numbers and a quiet footer line. Its rows
|
|
45
|
+
* settle in with a tiny stagger, and stay still when the user prefers reduced motion.
|
|
46
|
+
* @param props - The person's details.
|
|
47
|
+
* @returns The profile, meant as the child of `HoverCardContent`.
|
|
48
|
+
*/
|
|
49
|
+
declare function HoverCardProfile({ name, role, avatar, bio, stats, meta, className }: HoverCardProfileProps): React.JSX.Element;
|
|
50
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardProfile };
|