@scaleflex/ui-tw 0.0.109 → 0.0.112
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/dropdown-menu/dropdown-menu.component.d.ts +34 -17
- package/dropdown-menu/dropdown-menu.component.js +159 -22
- package/dropdown-menu/dropdown-menu.constants.d.ts +41 -0
- package/dropdown-menu/dropdown-menu.constants.js +13 -0
- package/dropdown-menu/index.d.ts +1 -1
- package/dropdown-menu/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import { DropdownMenuItemSize } from '@scaleflex/ui-tw/dropdown-menu/dropdown-menu.constants';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function
|
|
4
|
+
import { type ComponentProps, ReactNode } from 'react';
|
|
5
|
+
declare function DropdownMenu({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuPortal({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuTrigger({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
9
|
+
declare function DropdownMenuGroup({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
10
|
+
declare function DropdownMenuItem({ className, inset, variant, size, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
11
|
inset?: boolean;
|
|
10
12
|
variant?: 'default' | 'destructive';
|
|
13
|
+
size?: DropdownMenuItemSize;
|
|
11
14
|
}): React.JSX.Element;
|
|
12
|
-
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare function
|
|
16
|
-
|
|
15
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, size, ...props }: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
16
|
+
size?: DropdownMenuItemSize;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuRadioGroup({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuRadioItem({ className, children, size, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
20
|
+
size?: DropdownMenuItemSize;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuLabel({ className, size, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
23
|
+
size?: DropdownMenuItemSize;
|
|
17
24
|
}): React.JSX.Element;
|
|
18
|
-
declare function DropdownMenuSeparator({ className, ...props }:
|
|
19
|
-
declare function DropdownMenuShortcut({ className, ...props }:
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
26
|
+
declare function DropdownMenuShortcut({ className, size, ...props }: ComponentProps<'span'> & {
|
|
27
|
+
size?: DropdownMenuItemSize;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
declare function DropdownMenuSub({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
30
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, size, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
31
|
inset?: boolean;
|
|
32
|
+
size?: DropdownMenuItemSize;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
declare function DropdownMenuButtonTrigger({ className, children, label, labelClassName, size, icon, asChild, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Trigger> & {
|
|
35
|
+
size?: DropdownMenuItemSize;
|
|
36
|
+
label?: string;
|
|
37
|
+
labelClassName?: string;
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
asChild?: boolean;
|
|
23
40
|
}): React.JSX.Element;
|
|
24
|
-
declare function DropdownMenuSubContent({ className, ...props }:
|
|
25
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
41
|
+
declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
42
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuButtonTrigger, DropdownMenuSubContent, };
|
|
@@ -1,19 +1,89 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
5
|
var _excluded = ["className", "sideOffset"],
|
|
5
|
-
_excluded2 = ["className", "inset", "variant"],
|
|
6
|
-
_excluded3 = ["className", "children", "checked"],
|
|
7
|
-
_excluded4 = ["className", "children"],
|
|
8
|
-
_excluded5 = ["className", "
|
|
6
|
+
_excluded2 = ["className", "inset", "variant", "size"],
|
|
7
|
+
_excluded3 = ["className", "children", "checked", "size"],
|
|
8
|
+
_excluded4 = ["className", "children", "size"],
|
|
9
|
+
_excluded5 = ["className", "size"],
|
|
9
10
|
_excluded6 = ["className"],
|
|
10
|
-
_excluded7 = ["className"],
|
|
11
|
-
_excluded8 = ["className", "inset", "children"],
|
|
12
|
-
_excluded9 = ["className"]
|
|
11
|
+
_excluded7 = ["className", "size"],
|
|
12
|
+
_excluded8 = ["className", "inset", "children", "size"],
|
|
13
|
+
_excluded9 = ["className", "children", "label", "labelClassName", "size", "icon", "asChild"],
|
|
14
|
+
_excluded10 = ["className"];
|
|
13
15
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
16
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
17
|
+
import { DropdownMenuItemSize, dropdownMenuButtonTriggerOptions, dropdownMenuCheckboxItemSizeOptions, dropdownMenuIconSizeOptions, dropdownMenuItemIconSizeOptions, dropdownMenuItemIndicatorSizeOptions, dropdownMenuItemSizeOptions, dropdownMenuShortcutSizeOptions } from '@scaleflex/ui-tw/dropdown-menu/dropdown-menu.constants';
|
|
18
|
+
import { focusRingClassNames } from '@scaleflex/ui-tw/styles/shared-classes';
|
|
14
19
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
15
|
-
import {
|
|
20
|
+
import { cva } from 'class-variance-authority';
|
|
21
|
+
import { CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
16
22
|
import * as React from 'react';
|
|
23
|
+
var dropdownMenuItemVariants = cva('', {
|
|
24
|
+
variants: {
|
|
25
|
+
size: dropdownMenuItemSizeOptions
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: DropdownMenuItemSize.Sm
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var dropdownMenuCheckboxItemVariants = cva('', {
|
|
32
|
+
variants: {
|
|
33
|
+
size: dropdownMenuCheckboxItemSizeOptions
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
size: DropdownMenuItemSize.Sm
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var dropdownMenuButtonTriggerVariants = cva(['inline-flex cursor-pointer rounded-md items-center justify-between font-medium text-foreground select-none', 'disabled:pointer-events-none disabled:opacity-50', focusRingClassNames].join(' '), {
|
|
40
|
+
variants: {
|
|
41
|
+
size: dropdownMenuButtonTriggerOptions
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: DropdownMenuItemSize.Sm
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var dropdownMenuItemIndicatorVariants = cva('', {
|
|
48
|
+
variants: {
|
|
49
|
+
size: dropdownMenuItemIndicatorSizeOptions
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
size: DropdownMenuItemSize.Sm
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var dropdownMenuItemIconVariants = cva('', {
|
|
56
|
+
variants: {
|
|
57
|
+
size: dropdownMenuItemIconSizeOptions
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
size: DropdownMenuItemSize.Sm
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var dropdownMenuShortcutVariants = cva('', {
|
|
64
|
+
variants: {
|
|
65
|
+
size: dropdownMenuShortcutSizeOptions
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: {
|
|
68
|
+
size: DropdownMenuItemSize.Sm
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var dropdownMenuIconVariants = cva('', {
|
|
72
|
+
variants: {
|
|
73
|
+
size: dropdownMenuIconSizeOptions
|
|
74
|
+
},
|
|
75
|
+
defaultVariants: {
|
|
76
|
+
size: DropdownMenuItemSize.Sm
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var dropdownMenuLabelVariants = cva('font-medium', {
|
|
80
|
+
variants: {
|
|
81
|
+
size: _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'px-3 py-1.5 text-sm'), DropdownMenuItemSize.Md, 'px-4 py-2 text-base'), DropdownMenuItemSize.Lg, 'px-5 py-2.5 text-lg')
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
size: DropdownMenuItemSize.Sm
|
|
85
|
+
}
|
|
86
|
+
});
|
|
17
87
|
function DropdownMenu(_ref) {
|
|
18
88
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
19
89
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Root, _extends({
|
|
@@ -54,27 +124,43 @@ function DropdownMenuItem(_ref6) {
|
|
|
54
124
|
inset = _ref6.inset,
|
|
55
125
|
_ref6$variant = _ref6.variant,
|
|
56
126
|
variant = _ref6$variant === void 0 ? 'default' : _ref6$variant,
|
|
127
|
+
_ref6$size = _ref6.size,
|
|
128
|
+
size = _ref6$size === void 0 ? DropdownMenuItemSize.Sm : _ref6$size,
|
|
57
129
|
props = _objectWithoutProperties(_ref6, _excluded2);
|
|
58
130
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Item, _extends({
|
|
59
131
|
"data-slot": "dropdown-menu-item",
|
|
60
132
|
"data-inset": inset,
|
|
61
133
|
"data-variant": variant,
|
|
62
|
-
className: cn('relative flex cursor-
|
|
134
|
+
className: cn('relative flex cursor-pointer items-center gap-2 rounded-sm outline-hidden select-none', dropdownMenuItemVariants({
|
|
135
|
+
size: size
|
|
136
|
+
}), 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'focus:bg-accent focus:text-accent-foreground', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", dropdownMenuIconVariants({
|
|
137
|
+
size: size
|
|
138
|
+
}), className)
|
|
63
139
|
}, props));
|
|
64
140
|
}
|
|
65
141
|
function DropdownMenuCheckboxItem(_ref7) {
|
|
66
142
|
var className = _ref7.className,
|
|
67
143
|
children = _ref7.children,
|
|
68
144
|
checked = _ref7.checked,
|
|
145
|
+
_ref7$size = _ref7.size,
|
|
146
|
+
size = _ref7$size === void 0 ? DropdownMenuItemSize.Sm : _ref7$size,
|
|
69
147
|
props = _objectWithoutProperties(_ref7, _excluded3);
|
|
70
148
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.CheckboxItem, _extends({
|
|
71
149
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
72
|
-
className: cn('relative flex cursor-
|
|
150
|
+
className: cn('relative flex cursor-pointer items-center gap-2 rounded-sm pr-2 pl-2 outline-hidden select-none', dropdownMenuItemVariants({
|
|
151
|
+
size: size
|
|
152
|
+
}), 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'data-[state=checked]:bg-accent data-[state=checked]:text-primary', 'focus:bg-accent focus:text-accent-foreground', "[&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-primary data-[state=checked]:[&_svg:not([class*='text-'])]:text-primary [&_svg]:pointer-events-none [&_svg]:shrink-0", dropdownMenuIconVariants({
|
|
153
|
+
size: size
|
|
154
|
+
}), className),
|
|
73
155
|
checked: checked
|
|
74
156
|
}, props), children, /*#__PURE__*/React.createElement("span", {
|
|
75
|
-
className:
|
|
157
|
+
className: cn('pointer-events-none absolute flex items-center justify-center', dropdownMenuItemIndicatorVariants({
|
|
158
|
+
size: size
|
|
159
|
+
}))
|
|
76
160
|
}, /*#__PURE__*/React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
77
|
-
className:
|
|
161
|
+
className: dropdownMenuItemIconVariants({
|
|
162
|
+
size: size
|
|
163
|
+
})
|
|
78
164
|
}))));
|
|
79
165
|
}
|
|
80
166
|
function DropdownMenuRadioGroup(_ref8) {
|
|
@@ -86,24 +172,32 @@ function DropdownMenuRadioGroup(_ref8) {
|
|
|
86
172
|
function DropdownMenuRadioItem(_ref9) {
|
|
87
173
|
var className = _ref9.className,
|
|
88
174
|
children = _ref9.children,
|
|
175
|
+
_ref9$size = _ref9.size,
|
|
176
|
+
size = _ref9$size === void 0 ? DropdownMenuItemSize.Sm : _ref9$size,
|
|
89
177
|
props = _objectWithoutProperties(_ref9, _excluded4);
|
|
90
178
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.RadioItem, _extends({
|
|
91
179
|
"data-slot": "dropdown-menu-radio-item",
|
|
92
|
-
className: cn('relative flex cursor-
|
|
180
|
+
className: cn('relative flex cursor-pointer items-center gap-2 select-none', dropdownMenuCheckboxItemVariants({
|
|
181
|
+
size: size
|
|
182
|
+
}), 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'focus:bg-accent focus:text-accent-foreground', "[&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-primary data-[state=checked]:[&_svg:not([class*='text-'])]:text-primary [&_svg]:pointer-events-none [&_svg]:shrink-0", dropdownMenuIconVariants({
|
|
183
|
+
size: size
|
|
184
|
+
}), className)
|
|
93
185
|
}, props), /*#__PURE__*/React.createElement("span", {
|
|
94
|
-
className:
|
|
186
|
+
className: cn('pointer-events-none absolute left-2 flex size-3.5 items-center justify-center')
|
|
95
187
|
}, /*#__PURE__*/React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /*#__PURE__*/React.createElement(CircleIcon, {
|
|
96
188
|
className: "size-2 fill-current"
|
|
97
189
|
}))), children);
|
|
98
190
|
}
|
|
99
191
|
function DropdownMenuLabel(_ref10) {
|
|
100
192
|
var className = _ref10.className,
|
|
101
|
-
|
|
193
|
+
_ref10$size = _ref10.size,
|
|
194
|
+
size = _ref10$size === void 0 ? DropdownMenuItemSize.Sm : _ref10$size,
|
|
102
195
|
props = _objectWithoutProperties(_ref10, _excluded5);
|
|
103
196
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Label, _extends({
|
|
104
197
|
"data-slot": "dropdown-menu-label",
|
|
105
|
-
|
|
106
|
-
|
|
198
|
+
className: cn(dropdownMenuLabelVariants({
|
|
199
|
+
size: size
|
|
200
|
+
}), className)
|
|
107
201
|
}, props));
|
|
108
202
|
}
|
|
109
203
|
function DropdownMenuSeparator(_ref11) {
|
|
@@ -116,10 +210,13 @@ function DropdownMenuSeparator(_ref11) {
|
|
|
116
210
|
}
|
|
117
211
|
function DropdownMenuShortcut(_ref12) {
|
|
118
212
|
var className = _ref12.className,
|
|
213
|
+
size = _ref12.size,
|
|
119
214
|
props = _objectWithoutProperties(_ref12, _excluded7);
|
|
120
215
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
121
216
|
"data-slot": "dropdown-menu-shortcut",
|
|
122
|
-
className: cn('text-muted-foreground
|
|
217
|
+
className: cn('text-muted-foreground absolute tracking-widest', dropdownMenuShortcutVariants({
|
|
218
|
+
size: size
|
|
219
|
+
}), className)
|
|
123
220
|
}, props));
|
|
124
221
|
}
|
|
125
222
|
function DropdownMenuSub(_ref13) {
|
|
@@ -132,21 +229,61 @@ function DropdownMenuSubTrigger(_ref14) {
|
|
|
132
229
|
var className = _ref14.className,
|
|
133
230
|
inset = _ref14.inset,
|
|
134
231
|
children = _ref14.children,
|
|
232
|
+
_ref14$size = _ref14.size,
|
|
233
|
+
size = _ref14$size === void 0 ? DropdownMenuItemSize.Sm : _ref14$size,
|
|
135
234
|
props = _objectWithoutProperties(_ref14, _excluded8);
|
|
136
235
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.SubTrigger, _extends({
|
|
137
236
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
138
237
|
"data-inset": inset,
|
|
139
|
-
className: cn('focus:bg-accent focus:text-accent-foreground', 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', 'flex cursor-
|
|
238
|
+
className: cn('focus:bg-accent focus:text-accent-foreground relative', 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', 'flex cursor-pointer items-center rounded-sm text-sm outline-hidden select-none', dropdownMenuItemVariants({
|
|
239
|
+
size: size
|
|
240
|
+
}), className)
|
|
140
241
|
}, props), children, /*#__PURE__*/React.createElement(ChevronRightIcon, {
|
|
141
|
-
className:
|
|
242
|
+
className: cn('text-muted-foreground absolute', dropdownMenuItemIndicatorVariants({
|
|
243
|
+
size: size
|
|
244
|
+
}))
|
|
142
245
|
}));
|
|
143
246
|
}
|
|
144
|
-
function
|
|
247
|
+
function DropdownMenuButtonTrigger(_ref15) {
|
|
145
248
|
var className = _ref15.className,
|
|
249
|
+
children = _ref15.children,
|
|
250
|
+
label = _ref15.label,
|
|
251
|
+
labelClassName = _ref15.labelClassName,
|
|
252
|
+
_ref15$size = _ref15.size,
|
|
253
|
+
size = _ref15$size === void 0 ? DropdownMenuItemSize.Sm : _ref15$size,
|
|
254
|
+
icon = _ref15.icon,
|
|
255
|
+
_ref15$asChild = _ref15.asChild,
|
|
256
|
+
asChild = _ref15$asChild === void 0 ? false : _ref15$asChild,
|
|
146
257
|
props = _objectWithoutProperties(_ref15, _excluded9);
|
|
258
|
+
var Comp = asChild ? Slot : 'button';
|
|
259
|
+
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Trigger, _extends({
|
|
260
|
+
asChild: true
|
|
261
|
+
}, props), /*#__PURE__*/React.createElement(Comp, {
|
|
262
|
+
className: cn(dropdownMenuButtonTriggerVariants({
|
|
263
|
+
size: size
|
|
264
|
+
}), className)
|
|
265
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
266
|
+
className: cn('flex min-w-0 items-center', size === 'sm' ? 'gap-1.5' : 'gap-2')
|
|
267
|
+
}, icon ? /*#__PURE__*/React.createElement("span", {
|
|
268
|
+
className: cn(dropdownMenuIconVariants({
|
|
269
|
+
size: size
|
|
270
|
+
}))
|
|
271
|
+
}, icon) : null, label ? /*#__PURE__*/React.createElement("span", {
|
|
272
|
+
className: cn('text-secondary-foreground', labelClassName)
|
|
273
|
+
}, label, ":") : null, /*#__PURE__*/React.createElement("span", {
|
|
274
|
+
className: "truncate"
|
|
275
|
+
}, children)), /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
276
|
+
className: cn('text-muted-foreground', dropdownMenuItemIndicatorVariants({
|
|
277
|
+
size: size
|
|
278
|
+
}))
|
|
279
|
+
})));
|
|
280
|
+
}
|
|
281
|
+
function DropdownMenuSubContent(_ref16) {
|
|
282
|
+
var className = _ref16.className,
|
|
283
|
+
props = _objectWithoutProperties(_ref16, _excluded10);
|
|
147
284
|
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.SubContent, _extends({
|
|
148
285
|
"data-slot": "dropdown-menu-sub-content",
|
|
149
286
|
className: cn('origin-(--radix-dropdown-menu-content-transform-origin)', 'bg-popover text-popover-foreground border-border z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg', 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', className)
|
|
150
287
|
}, props));
|
|
151
288
|
}
|
|
152
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent };
|
|
289
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuButtonTrigger, DropdownMenuSubContent };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const DropdownMenuItemSize: {
|
|
2
|
+
readonly Sm: "sm";
|
|
3
|
+
readonly Md: "md";
|
|
4
|
+
readonly Lg: "lg";
|
|
5
|
+
};
|
|
6
|
+
export declare const dropdownMenuItemSizeOptions: {
|
|
7
|
+
readonly sm: "px-3 py-1.5 data-[inset]:pl-8 text-sm";
|
|
8
|
+
readonly md: "px-4 py-2 data-[inset]:pl-10 text-base";
|
|
9
|
+
readonly lg: "px-5 py-2.5 data-[inset]:pl-12 text-lg";
|
|
10
|
+
};
|
|
11
|
+
export declare const dropdownMenuCheckboxItemSizeOptions: {
|
|
12
|
+
readonly sm: "px-3 py-1.5 pl-8 text-sm";
|
|
13
|
+
readonly md: "px-4 py-2 pl-8 text-base";
|
|
14
|
+
readonly lg: "px-5 py-2.5 pl-8 text-lg";
|
|
15
|
+
};
|
|
16
|
+
export declare const dropdownMenuButtonTriggerOptions: {
|
|
17
|
+
readonly sm: "px-3 py-1.5 gap-1 text-sm";
|
|
18
|
+
readonly md: "px-4 py-2 gap-2 text-base";
|
|
19
|
+
readonly lg: "px-5 py-2.5 gap-2 text-lg";
|
|
20
|
+
};
|
|
21
|
+
export declare const dropdownMenuItemIndicatorSizeOptions: {
|
|
22
|
+
readonly sm: "right-2 size-3.5";
|
|
23
|
+
readonly md: "right-3 size-4";
|
|
24
|
+
readonly lg: "right-3 size-5";
|
|
25
|
+
};
|
|
26
|
+
export declare const dropdownMenuItemIconSizeOptions: {
|
|
27
|
+
readonly sm: "size-3.5";
|
|
28
|
+
readonly md: "size-4";
|
|
29
|
+
readonly lg: "size-5";
|
|
30
|
+
};
|
|
31
|
+
export declare const dropdownMenuShortcutSizeOptions: {
|
|
32
|
+
readonly sm: "right-2 text-xs";
|
|
33
|
+
readonly md: "right-3 text-xs";
|
|
34
|
+
readonly lg: "right-3 text-xs";
|
|
35
|
+
};
|
|
36
|
+
export declare const dropdownMenuIconSizeOptions: {
|
|
37
|
+
readonly sm: "[&_svg:not([class*='size-'])]:size-3.5";
|
|
38
|
+
readonly md: "[&_svg:not([class*='size-'])]:size-4.5";
|
|
39
|
+
readonly lg: "[&_svg:not([class*='size-'])]:size-5";
|
|
40
|
+
};
|
|
41
|
+
export type DropdownMenuItemSize = (typeof DropdownMenuItemSize)[keyof typeof DropdownMenuItemSize];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
export var DropdownMenuItemSize = {
|
|
3
|
+
Sm: 'sm',
|
|
4
|
+
Md: 'md',
|
|
5
|
+
Lg: 'lg'
|
|
6
|
+
};
|
|
7
|
+
export var dropdownMenuItemSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'px-3 py-1.5 data-[inset]:pl-8 text-sm'), DropdownMenuItemSize.Md, 'px-4 py-2 data-[inset]:pl-10 text-base'), DropdownMenuItemSize.Lg, 'px-5 py-2.5 data-[inset]:pl-12 text-lg');
|
|
8
|
+
export var dropdownMenuCheckboxItemSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'px-3 py-1.5 pl-8 text-sm'), DropdownMenuItemSize.Md, 'px-4 py-2 pl-8 text-base'), DropdownMenuItemSize.Lg, 'px-5 py-2.5 pl-8 text-lg');
|
|
9
|
+
export var dropdownMenuButtonTriggerOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'px-3 py-1.5 gap-1 text-sm'), DropdownMenuItemSize.Md, 'px-4 py-2 gap-2 text-base'), DropdownMenuItemSize.Lg, 'px-5 py-2.5 gap-2 text-lg');
|
|
10
|
+
export var dropdownMenuItemIndicatorSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'right-2 size-3.5'), DropdownMenuItemSize.Md, 'right-3 size-4'), DropdownMenuItemSize.Lg, 'right-3 size-5');
|
|
11
|
+
export var dropdownMenuItemIconSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'size-3.5'), DropdownMenuItemSize.Md, 'size-4'), DropdownMenuItemSize.Lg, 'size-5');
|
|
12
|
+
export var dropdownMenuShortcutSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, 'right-2 text-xs'), DropdownMenuItemSize.Md, 'right-3 text-xs'), DropdownMenuItemSize.Lg, 'right-3 text-xs');
|
|
13
|
+
export var dropdownMenuIconSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, DropdownMenuItemSize.Sm, "[&_svg:not([class*='size-'])]:size-3.5"), DropdownMenuItemSize.Md, "[&_svg:not([class*='size-'])]:size-4.5"), DropdownMenuItemSize.Lg, "[&_svg:not([class*='size-'])]:size-5");
|
package/dropdown-menu/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './dropdown-menu.component';
|
|
1
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuButtonTrigger, DropdownMenuSubContent, } from './dropdown-menu.component';
|
package/dropdown-menu/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from './dropdown-menu.component';
|
|
1
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuButtonTrigger, DropdownMenuSubContent } from './dropdown-menu.component';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"author": "scaleflex",
|
|
5
5
|
"repository": "github:scaleflex/ui",
|
|
6
6
|
"homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@radix-ui/react-slot": "^1.1.2",
|
|
26
26
|
"@radix-ui/react-switch": "^1.0.1",
|
|
27
27
|
"@radix-ui/react-tooltip": "^1.2.6",
|
|
28
|
-
"@scaleflex/icons-tw": "^0.0.
|
|
28
|
+
"@scaleflex/icons-tw": "^0.0.112",
|
|
29
29
|
"@tanstack/react-table": "^8.21.3",
|
|
30
30
|
"@types/lodash.merge": "^4.6.9",
|
|
31
31
|
"class-variance-authority": "^0.7.1",
|