@rovula/ui 0.0.78 → 0.0.79
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/dist/cjs/bundle.css +15 -3
- package/dist/cjs/bundle.js +3 -3
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +5 -1
- package/dist/cjs/types/components/Menu/Menu.d.ts +65 -0
- package/dist/cjs/types/components/Menu/Menu.stories.d.ts +31 -0
- package/dist/cjs/types/components/Menu/helpers.d.ts +19 -0
- package/dist/cjs/types/components/Menu/index.d.ts +4 -0
- package/dist/cjs/types/components/Search/Search.d.ts +46 -3
- package/dist/cjs/types/components/Search/Search.stories.d.ts +46 -27
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.js +41 -19
- package/dist/components/Dropdown/Dropdown.stories.js +13 -0
- package/dist/components/Menu/Menu.js +64 -0
- package/dist/components/Menu/Menu.stories.js +406 -0
- package/dist/components/Menu/helpers.js +28 -0
- package/dist/components/Menu/index.js +3 -0
- package/dist/esm/bundle.css +15 -3
- package/dist/esm/bundle.js +3 -3
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +5 -1
- package/dist/esm/types/components/Menu/Menu.d.ts +65 -0
- package/dist/esm/types/components/Menu/Menu.stories.d.ts +31 -0
- package/dist/esm/types/components/Menu/helpers.d.ts +19 -0
- package/dist/esm/types/components/Menu/index.d.ts +4 -0
- package/dist/esm/types/components/Search/Search.d.ts +46 -3
- package/dist/esm/types/components/Search/Search.stories.d.ts +46 -27
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/index.d.ts +111 -3
- package/dist/index.js +1 -0
- package/dist/src/theme/global.css +20 -4
- package/package.json +1 -1
- package/src/components/Dropdown/Dropdown.stories.tsx +31 -0
- package/src/components/Dropdown/Dropdown.tsx +73 -54
- package/src/components/Menu/Menu.stories.tsx +586 -0
- package/src/components/Menu/Menu.tsx +235 -0
- package/src/components/Menu/helpers.ts +45 -0
- package/src/components/Menu/index.ts +7 -0
- package/src/components/Search/Search.tsx +24 -11
- package/src/index.ts +1 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Menu } from "./Menu";
|
|
4
|
+
import { optionsToMenuItems } from "./helpers";
|
|
5
|
+
import Button from "../Button/Button";
|
|
6
|
+
import Icon from "../Icon/Icon";
|
|
7
|
+
import TextInput from "../TextInput/TextInput";
|
|
8
|
+
import { ChevronDownIcon } from "@heroicons/react/16/solid";
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/Menu",
|
|
11
|
+
component: Menu,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "centered",
|
|
15
|
+
},
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (_jsx("div", { className: "p-20 flex justify-center", children: _jsx(Story, {}) })),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
// ==================== Basic Menu ====================
|
|
22
|
+
export const Basic = {
|
|
23
|
+
render: () => {
|
|
24
|
+
const items = [
|
|
25
|
+
{ type: "item", item: { value: "1", label: "Option 1" } },
|
|
26
|
+
{ type: "item", item: { value: "2", label: "Option 2" } },
|
|
27
|
+
{ type: "item", item: { value: "3", label: "Option 3" } },
|
|
28
|
+
{ type: "separator" },
|
|
29
|
+
{ type: "item", item: { value: "4", label: "Option 4", disabled: true } },
|
|
30
|
+
{ type: "item", item: { value: "5", label: "Delete", danger: true } },
|
|
31
|
+
];
|
|
32
|
+
return (_jsx(Menu, { items: items, onSelect: (value) => console.log("Selected:", value) }));
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
// ==================== With Icons ====================
|
|
36
|
+
export const WithIcons = {
|
|
37
|
+
render: () => {
|
|
38
|
+
const items = [
|
|
39
|
+
{
|
|
40
|
+
type: "item",
|
|
41
|
+
item: {
|
|
42
|
+
value: "profile",
|
|
43
|
+
label: "Profile",
|
|
44
|
+
icon: _jsx(Icon, { type: "heroicons", name: "user", className: "size-4" }),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "item",
|
|
49
|
+
item: {
|
|
50
|
+
value: "settings",
|
|
51
|
+
label: "Settings",
|
|
52
|
+
icon: _jsx(Icon, { type: "heroicons", name: "cog-6-tooth", className: "size-4" }),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "item",
|
|
57
|
+
item: {
|
|
58
|
+
value: "help",
|
|
59
|
+
label: "Help",
|
|
60
|
+
icon: (_jsx(Icon, { type: "heroicons", name: "question-mark-circle", className: "size-4" })),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{ type: "separator" },
|
|
64
|
+
{
|
|
65
|
+
type: "item",
|
|
66
|
+
item: {
|
|
67
|
+
value: "logout",
|
|
68
|
+
label: "Logout",
|
|
69
|
+
icon: (_jsx(Icon, { type: "heroicons", name: "arrow-right-on-rectangle", className: "size-4" })),
|
|
70
|
+
danger: true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
return (_jsx(Menu, { items: items, onSelect: (value) => console.log("Selected:", value) }));
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
// ==================== With Checkbox ====================
|
|
78
|
+
export const WithCheckbox = {
|
|
79
|
+
render: () => {
|
|
80
|
+
const [checked, setChecked] = useState({
|
|
81
|
+
notifications: true,
|
|
82
|
+
emails: false,
|
|
83
|
+
updates: true,
|
|
84
|
+
});
|
|
85
|
+
const items = [
|
|
86
|
+
{ type: "label", label: "Preferences" },
|
|
87
|
+
{
|
|
88
|
+
type: "item",
|
|
89
|
+
item: {
|
|
90
|
+
value: "notifications",
|
|
91
|
+
label: "Notifications",
|
|
92
|
+
type: "checkbox",
|
|
93
|
+
checked: checked.notifications,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: "item",
|
|
98
|
+
item: {
|
|
99
|
+
value: "emails",
|
|
100
|
+
label: "Email Alerts",
|
|
101
|
+
type: "checkbox",
|
|
102
|
+
checked: checked.emails,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "item",
|
|
107
|
+
item: {
|
|
108
|
+
value: "updates",
|
|
109
|
+
label: "Product Updates",
|
|
110
|
+
type: "checkbox",
|
|
111
|
+
checked: checked.updates,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
return (_jsx(Menu, { items: items, onSelect: (value) => {
|
|
116
|
+
setChecked((prev) => (Object.assign(Object.assign({}, prev), { [value]: !prev[value] })));
|
|
117
|
+
} }));
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
// ==================== With Radio ====================
|
|
121
|
+
export const WithRadio = {
|
|
122
|
+
render: () => {
|
|
123
|
+
const [selected, setSelected] = useState("light");
|
|
124
|
+
const items = [
|
|
125
|
+
{ type: "label", label: "Theme" },
|
|
126
|
+
{
|
|
127
|
+
type: "item",
|
|
128
|
+
item: {
|
|
129
|
+
value: "light",
|
|
130
|
+
label: "Light",
|
|
131
|
+
type: "radio",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "item",
|
|
136
|
+
item: {
|
|
137
|
+
value: "dark",
|
|
138
|
+
label: "Dark",
|
|
139
|
+
type: "radio",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: "item",
|
|
144
|
+
item: {
|
|
145
|
+
value: "system",
|
|
146
|
+
label: "System",
|
|
147
|
+
type: "radio",
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
return (_jsx(Menu, { items: items, selectedValues: [selected], onSelect: (value) => setSelected(value) }));
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
// ==================== Complex Menu ====================
|
|
155
|
+
export const ComplexMenu = {
|
|
156
|
+
render: () => {
|
|
157
|
+
const [preferences, setPreferences] = useState({
|
|
158
|
+
notifications: true,
|
|
159
|
+
emails: false,
|
|
160
|
+
});
|
|
161
|
+
const [theme, setTheme] = useState("light");
|
|
162
|
+
const items = [
|
|
163
|
+
{ type: "label", label: "My Account" },
|
|
164
|
+
{
|
|
165
|
+
type: "item",
|
|
166
|
+
item: {
|
|
167
|
+
value: "profile",
|
|
168
|
+
label: "Profile",
|
|
169
|
+
icon: _jsx(Icon, { type: "heroicons", name: "user", className: "size-4" }),
|
|
170
|
+
onClick: () => console.log("Go to profile"),
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: "item",
|
|
175
|
+
item: {
|
|
176
|
+
value: "billing",
|
|
177
|
+
label: "Billing",
|
|
178
|
+
icon: _jsx(Icon, { type: "heroicons", name: "credit-card", className: "size-4" }),
|
|
179
|
+
onClick: () => console.log("Go to billing"),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{ type: "separator" },
|
|
183
|
+
{ type: "label", label: "Preferences" },
|
|
184
|
+
{
|
|
185
|
+
type: "item",
|
|
186
|
+
item: {
|
|
187
|
+
value: "notifications",
|
|
188
|
+
label: "Push Notifications",
|
|
189
|
+
type: "checkbox",
|
|
190
|
+
checked: preferences.notifications,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: "item",
|
|
195
|
+
item: {
|
|
196
|
+
value: "emails",
|
|
197
|
+
label: "Email Notifications",
|
|
198
|
+
type: "checkbox",
|
|
199
|
+
checked: preferences.emails,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{ type: "separator" },
|
|
203
|
+
{ type: "label", label: "Theme" },
|
|
204
|
+
{
|
|
205
|
+
type: "item",
|
|
206
|
+
item: {
|
|
207
|
+
value: "light",
|
|
208
|
+
label: "Light Mode",
|
|
209
|
+
type: "radio",
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: "item",
|
|
214
|
+
item: {
|
|
215
|
+
value: "dark",
|
|
216
|
+
label: "Dark Mode",
|
|
217
|
+
type: "radio",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{ type: "separator" },
|
|
221
|
+
{
|
|
222
|
+
type: "item",
|
|
223
|
+
item: {
|
|
224
|
+
value: "logout",
|
|
225
|
+
label: "Logout",
|
|
226
|
+
icon: (_jsx(Icon, { type: "heroicons", name: "arrow-right-on-rectangle", className: "size-4" })),
|
|
227
|
+
danger: true,
|
|
228
|
+
onClick: () => console.log("Logout"),
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
return (_jsx(Menu, { items: items, selectedValues: [theme], onSelect: (value, item) => {
|
|
233
|
+
// Handle different types
|
|
234
|
+
if (item.type === "checkbox") {
|
|
235
|
+
// Toggle checkbox
|
|
236
|
+
const key = value;
|
|
237
|
+
if (key in preferences) {
|
|
238
|
+
setPreferences(Object.assign(Object.assign({}, preferences), { [key]: !preferences[key] }));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else if (item.type === "radio") {
|
|
242
|
+
// Radio select
|
|
243
|
+
setTheme(value);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
// Regular item
|
|
247
|
+
console.log("Item clicked:", value);
|
|
248
|
+
}
|
|
249
|
+
} }));
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
// ==================== With Dropdown Trigger ====================
|
|
253
|
+
export const WithDropdownTrigger = {
|
|
254
|
+
render: () => {
|
|
255
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
256
|
+
const items = [
|
|
257
|
+
{
|
|
258
|
+
type: "item",
|
|
259
|
+
item: {
|
|
260
|
+
value: "edit",
|
|
261
|
+
label: "Edit",
|
|
262
|
+
icon: _jsx(Icon, { type: "heroicons", name: "pencil", className: "size-4" }),
|
|
263
|
+
onClick: () => {
|
|
264
|
+
console.log("Edit");
|
|
265
|
+
setIsOpen(false);
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
type: "item",
|
|
271
|
+
item: {
|
|
272
|
+
value: "duplicate",
|
|
273
|
+
label: "Duplicate",
|
|
274
|
+
icon: (_jsx(Icon, { type: "heroicons", name: "document-duplicate", className: "size-4" })),
|
|
275
|
+
onClick: () => {
|
|
276
|
+
console.log("Duplicate");
|
|
277
|
+
setIsOpen(false);
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{ type: "separator" },
|
|
282
|
+
{
|
|
283
|
+
type: "item",
|
|
284
|
+
item: {
|
|
285
|
+
value: "archive",
|
|
286
|
+
label: "Archive",
|
|
287
|
+
icon: _jsx(Icon, { type: "heroicons", name: "archive-box", className: "size-4" }),
|
|
288
|
+
onClick: () => {
|
|
289
|
+
console.log("Archive");
|
|
290
|
+
setIsOpen(false);
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: "item",
|
|
296
|
+
item: {
|
|
297
|
+
value: "delete",
|
|
298
|
+
label: "Delete",
|
|
299
|
+
icon: _jsx(Icon, { type: "heroicons", name: "trash", className: "size-4" }),
|
|
300
|
+
danger: true,
|
|
301
|
+
onClick: () => {
|
|
302
|
+
console.log("Delete");
|
|
303
|
+
setIsOpen(false);
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
];
|
|
308
|
+
return (_jsxs("div", { className: "relative", children: [_jsx(Button, { onClick: () => setIsOpen(!isOpen), children: "Actions" }), isOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsOpen(false) }), _jsx("div", { className: "absolute top-full mt-2 z-50", children: _jsx(Menu, { items: items }) })] }))] }));
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
// ==================== Custom Items ====================
|
|
312
|
+
export const CustomItems = {
|
|
313
|
+
render: () => {
|
|
314
|
+
const items = [
|
|
315
|
+
{ type: "label", label: "Recent Projects" },
|
|
316
|
+
{
|
|
317
|
+
type: "custom",
|
|
318
|
+
render: () => (_jsxs("div", { className: "px-4 py-3 hover:bg-[var(--dropdown-menu-hover-bg)] cursor-pointer", children: [_jsx("div", { className: "font-semibold", children: "Project Alpha" }), _jsx("div", { className: "text-xs text-gray-500", children: "Updated 2 hours ago" })] })),
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
type: "custom",
|
|
322
|
+
render: () => (_jsxs("div", { className: "px-4 py-3 hover:bg-[var(--dropdown-menu-hover-bg)] cursor-pointer", children: [_jsx("div", { className: "font-semibold", children: "Project Beta" }), _jsx("div", { className: "text-xs text-gray-500", children: "Updated yesterday" })] })),
|
|
323
|
+
},
|
|
324
|
+
{ type: "separator" },
|
|
325
|
+
{
|
|
326
|
+
type: "item",
|
|
327
|
+
item: {
|
|
328
|
+
value: "view-all",
|
|
329
|
+
label: "View All Projects",
|
|
330
|
+
icon: _jsx(Icon, { type: "heroicons", name: "folder-open", className: "size-4" }),
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
];
|
|
334
|
+
return (_jsx(Menu, { items: items, onSelect: (value) => console.log("Selected:", value) }));
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
// ==================== Dropdown Pattern (Select with Search) ====================
|
|
338
|
+
export const DropdownPattern = {
|
|
339
|
+
render: () => {
|
|
340
|
+
var _a;
|
|
341
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
342
|
+
const [selectedValue, setSelectedValue] = useState("");
|
|
343
|
+
const [searchText, setSearchText] = useState("");
|
|
344
|
+
// Simulate options like Dropdown component
|
|
345
|
+
const allOptions = [
|
|
346
|
+
{ value: "apple", label: "Apple" },
|
|
347
|
+
{ value: "banana", label: "Banana" },
|
|
348
|
+
{ value: "cherry", label: "Cherry" },
|
|
349
|
+
{ value: "date", label: "Date" },
|
|
350
|
+
{ value: "elderberry", label: "Elderberry" },
|
|
351
|
+
{ value: "fig", label: "Fig" },
|
|
352
|
+
{ value: "grape", label: "Grape" },
|
|
353
|
+
];
|
|
354
|
+
// Filter options based on search
|
|
355
|
+
const filteredOptions = allOptions.filter((opt) => opt.label.toLowerCase().includes(searchText.toLowerCase()));
|
|
356
|
+
// Convert to MenuItemType
|
|
357
|
+
const menuItems = optionsToMenuItems(filteredOptions);
|
|
358
|
+
// Add "not found" message if no results
|
|
359
|
+
if (filteredOptions.length === 0) {
|
|
360
|
+
menuItems.push({
|
|
361
|
+
type: "custom",
|
|
362
|
+
render: () => (_jsx("div", { className: "px-4 py-14 text-center text-input-text", children: "Not found" })),
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
const selectedLabel = ((_a = allOptions.find((opt) => opt.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) || "";
|
|
366
|
+
return (_jsxs("div", { className: "relative w-80", children: [_jsx(TextInput, { value: searchText || selectedLabel, onChange: (e) => setSearchText(e.target.value), onFocus: () => setIsOpen(true), onBlur: () => setTimeout(() => setIsOpen(false), 200), placeholder: "Select a fruit...", endIcon: _jsx(ChevronDownIcon, { className: "size-5 text-gray-400" }) }), isOpen && (_jsx("div", { className: "absolute top-full mt-1 w-full z-50", children: _jsx(Menu, { items: menuItems, selectedValues: [selectedValue], onSelect: (value) => {
|
|
367
|
+
setSelectedValue(value);
|
|
368
|
+
setSearchText("");
|
|
369
|
+
setIsOpen(false);
|
|
370
|
+
}, className: "max-h-60 overflow-y-auto" }) }))] }));
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
// ==================== Multi-Select Pattern ====================
|
|
374
|
+
export const MultiSelectPattern = {
|
|
375
|
+
render: () => {
|
|
376
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
377
|
+
const [selectedValues, setSelectedValues] = useState([]);
|
|
378
|
+
const options = [
|
|
379
|
+
{ value: "react", label: "React" },
|
|
380
|
+
{ value: "vue", label: "Vue" },
|
|
381
|
+
{ value: "angular", label: "Angular" },
|
|
382
|
+
{ value: "svelte", label: "Svelte" },
|
|
383
|
+
{ value: "solid", label: "Solid" },
|
|
384
|
+
];
|
|
385
|
+
const items = options.map((opt) => ({
|
|
386
|
+
type: "item",
|
|
387
|
+
item: {
|
|
388
|
+
value: opt.value,
|
|
389
|
+
label: opt.label,
|
|
390
|
+
type: "checkbox",
|
|
391
|
+
checked: selectedValues.includes(opt.value),
|
|
392
|
+
},
|
|
393
|
+
}));
|
|
394
|
+
const displayText = selectedValues.length > 0
|
|
395
|
+
? `${selectedValues.length} selected`
|
|
396
|
+
: "Select frameworks...";
|
|
397
|
+
return (_jsxs("div", { className: "relative w-80", children: [_jsxs(Button, { onClick: () => setIsOpen(!isOpen), className: "w-full justify-between", children: [displayText, _jsx(ChevronDownIcon, { className: "size-5 ml-2" })] }), isOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsOpen(false) }), _jsx("div", { className: "absolute top-full mt-2 w-full z-50", children: _jsx(Menu, { items: items, onSelect: (value) => {
|
|
398
|
+
if (selectedValues.includes(value)) {
|
|
399
|
+
setSelectedValues(selectedValues.filter((v) => v !== value));
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
setSelectedValues([...selectedValues, value]);
|
|
403
|
+
}
|
|
404
|
+
} }) })] }))] }));
|
|
405
|
+
},
|
|
406
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to convert simple options to MenuItemType
|
|
3
|
+
* Useful for integrating with Dropdown component
|
|
4
|
+
*/
|
|
5
|
+
export function optionsToMenuItems(options) {
|
|
6
|
+
return options.map((option) => ({
|
|
7
|
+
type: "item",
|
|
8
|
+
item: {
|
|
9
|
+
value: option.value,
|
|
10
|
+
label: option.label,
|
|
11
|
+
disabled: option.disabled,
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Helper to add separator between menu items
|
|
17
|
+
*/
|
|
18
|
+
export function withSeparator(items, atIndex) {
|
|
19
|
+
const result = [...items];
|
|
20
|
+
result.splice(atIndex, 0, { type: "separator" });
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Helper to add label/header to menu items
|
|
25
|
+
*/
|
|
26
|
+
export function withLabel(label, items) {
|
|
27
|
+
return [{ type: "label", label }, ...items];
|
|
28
|
+
}
|
package/dist/esm/bundle.css
CHANGED
|
@@ -662,6 +662,9 @@ input[type=number] {
|
|
|
662
662
|
.z-10{
|
|
663
663
|
z-index: 10;
|
|
664
664
|
}
|
|
665
|
+
.z-40{
|
|
666
|
+
z-index: 40;
|
|
667
|
+
}
|
|
665
668
|
.z-50{
|
|
666
669
|
z-index: 50;
|
|
667
670
|
}
|
|
@@ -671,9 +674,6 @@ input[type=number] {
|
|
|
671
674
|
.z-\[100\]{
|
|
672
675
|
z-index: 100;
|
|
673
676
|
}
|
|
674
|
-
.z-\[9999\]{
|
|
675
|
-
z-index: 9999;
|
|
676
|
-
}
|
|
677
677
|
.col-span-3{
|
|
678
678
|
grid-column: span 3 / span 3;
|
|
679
679
|
}
|
|
@@ -943,6 +943,9 @@ input[type=number] {
|
|
|
943
943
|
.w-8{
|
|
944
944
|
width: 2rem;
|
|
945
945
|
}
|
|
946
|
+
.w-80{
|
|
947
|
+
width: 20rem;
|
|
948
|
+
}
|
|
946
949
|
.w-\[100px\]{
|
|
947
950
|
width: 100px;
|
|
948
951
|
}
|
|
@@ -3590,6 +3593,9 @@ input[type=number] {
|
|
|
3590
3593
|
.caret-primary{
|
|
3591
3594
|
caret-color: color-mix(in srgb, var(--state-color-primary-default) calc(100% * 1), transparent);
|
|
3592
3595
|
}
|
|
3596
|
+
.opacity-50{
|
|
3597
|
+
opacity: 0.5;
|
|
3598
|
+
}
|
|
3593
3599
|
.opacity-60{
|
|
3594
3600
|
opacity: 0.6;
|
|
3595
3601
|
}
|
|
@@ -4004,6 +4010,9 @@ input[type=number] {
|
|
|
4004
4010
|
--tw-border-opacity: 1;
|
|
4005
4011
|
border-color: color-mix(in srgb, var(--input-color-active-stroke) calc(100% * var(--tw-border-opacity, 1)), transparent);
|
|
4006
4012
|
}
|
|
4013
|
+
.hover\:bg-\[var\(--dropdown-menu-hover-bg\)\]:hover{
|
|
4014
|
+
background-color: var(--dropdown-menu-hover-bg);
|
|
4015
|
+
}
|
|
4007
4016
|
.hover\:bg-action-button-icon-active-hover:hover{
|
|
4008
4017
|
--tw-bg-opacity: 1;
|
|
4009
4018
|
background-color: color-mix(in srgb, var(--action-button-icon-active-hover-bg) calc(100% * var(--tw-bg-opacity, 1)), transparent);
|
|
@@ -4215,6 +4224,9 @@ input[type=number] {
|
|
|
4215
4224
|
.hover\:fill-input-default-text:hover{
|
|
4216
4225
|
fill: color-mix(in srgb, var(--input-color-default-text) calc(100% * 1), transparent);
|
|
4217
4226
|
}
|
|
4227
|
+
.hover\:text-\[var\(--dropdown-menu-hover-text\)\]:hover{
|
|
4228
|
+
color: var(--dropdown-menu-hover-text);
|
|
4229
|
+
}
|
|
4218
4230
|
.hover\:text-action-button-icon-active-hover:hover{
|
|
4219
4231
|
--tw-text-opacity: 1;
|
|
4220
4232
|
color: color-mix(in srgb, var(--action-button-icon-active-hover-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
|