@uipath/apollo-wind 0.7.2-pr188.4865fad
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/LICENSE +21 -0
- package/README.md +188 -0
- package/dist/components/forms/data-fetcher.cjs +250 -0
- package/dist/components/forms/data-fetcher.d.ts +173 -0
- package/dist/components/forms/data-fetcher.js +207 -0
- package/dist/components/forms/demo-mocks.cjs +1031 -0
- package/dist/components/forms/demo-mocks.d.ts +10 -0
- package/dist/components/forms/demo-mocks.js +997 -0
- package/dist/components/forms/field-renderer.cjs +595 -0
- package/dist/components/forms/field-renderer.d.ts +14 -0
- package/dist/components/forms/field-renderer.js +561 -0
- package/dist/components/forms/form-designer.cjs +2314 -0
- package/dist/components/forms/form-designer.d.ts +1 -0
- package/dist/components/forms/form-designer.js +2280 -0
- package/dist/components/forms/form-examples.cjs +962 -0
- package/dist/components/forms/form-examples.d.ts +46 -0
- package/dist/components/forms/form-examples.js +907 -0
- package/dist/components/forms/form-plugins.cjs +225 -0
- package/dist/components/forms/form-plugins.d.ts +11 -0
- package/dist/components/forms/form-plugins.js +176 -0
- package/dist/components/forms/form-schema.cjs +56 -0
- package/dist/components/forms/form-schema.d.ts +324 -0
- package/dist/components/forms/form-schema.js +13 -0
- package/dist/components/forms/form-state-viewer.cjs +498 -0
- package/dist/components/forms/form-state-viewer.d.ts +15 -0
- package/dist/components/forms/form-state-viewer.js +464 -0
- package/dist/components/forms/index.cjs +103 -0
- package/dist/components/forms/index.d.ts +13 -0
- package/dist/components/forms/index.js +9 -0
- package/dist/components/forms/metadata-form.cjs +400 -0
- package/dist/components/forms/metadata-form.d.ts +16 -0
- package/dist/components/forms/metadata-form.js +366 -0
- package/dist/components/forms/rules-engine.cjs +343 -0
- package/dist/components/forms/rules-engine.d.ts +99 -0
- package/dist/components/forms/rules-engine.js +293 -0
- package/dist/components/forms/schema-serializer.cjs +250 -0
- package/dist/components/forms/schema-serializer.d.ts +27 -0
- package/dist/components/forms/schema-serializer.js +213 -0
- package/dist/components/forms/schema-viewer.cjs +157 -0
- package/dist/components/forms/schema-viewer.d.ts +29 -0
- package/dist/components/forms/schema-viewer.js +117 -0
- package/dist/components/forms/validation-converter.cjs +154 -0
- package/dist/components/forms/validation-converter.d.ts +42 -0
- package/dist/components/forms/validation-converter.js +114 -0
- package/dist/components/ui/accordion.cjs +82 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +39 -0
- package/dist/components/ui/alert-dialog.cjs +126 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +62 -0
- package/dist/components/ui/alert.cjs +77 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/alert.js +37 -0
- package/dist/components/ui/aspect-ratio.cjs +38 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/avatar.cjs +63 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/avatar.js +23 -0
- package/dist/components/ui/badge.cjs +63 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.cjs +118 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/breadcrumb.js +66 -0
- package/dist/components/ui/button-group.cjs +68 -0
- package/dist/components/ui/button-group.d.ts +14 -0
- package/dist/components/ui/button-group.js +28 -0
- package/dist/components/ui/button.cjs +78 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +41 -0
- package/dist/components/ui/calendar.cjs +144 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/calendar.js +107 -0
- package/dist/components/ui/card.cjs +89 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/card.js +40 -0
- package/dist/components/ui/checkbox.cjs +52 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.js +18 -0
- package/dist/components/ui/collapsible.cjs +45 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/combobox.cjs +102 -0
- package/dist/components/ui/combobox.d.ts +15 -0
- package/dist/components/ui/combobox.js +68 -0
- package/dist/components/ui/command.cjs +131 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/command.js +73 -0
- package/dist/components/ui/context-menu.cjs +173 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/context-menu.js +97 -0
- package/dist/components/ui/data-table.cjs +292 -0
- package/dist/components/ui/data-table.d.ts +23 -0
- package/dist/components/ui/data-table.js +252 -0
- package/dist/components/ui/date-picker.cjs +118 -0
- package/dist/components/ui/date-picker.d.ts +21 -0
- package/dist/components/ui/date-picker.js +81 -0
- package/dist/components/ui/datetime-picker.cjs +154 -0
- package/dist/components/ui/datetime-picker.d.ts +9 -0
- package/dist/components/ui/datetime-picker.js +120 -0
- package/dist/components/ui/dialog.cjs +159 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/dialog.js +98 -0
- package/dist/components/ui/drawer.cjs +116 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +55 -0
- package/dist/components/ui/dropdown-menu.cjs +174 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/dropdown-menu.js +98 -0
- package/dist/components/ui/editable-cell.cjs +256 -0
- package/dist/components/ui/editable-cell.d.ts +24 -0
- package/dist/components/ui/editable-cell.js +219 -0
- package/dist/components/ui/empty-state.cjs +73 -0
- package/dist/components/ui/empty-state.d.ts +16 -0
- package/dist/components/ui/empty-state.js +39 -0
- package/dist/components/ui/file-upload.cjs +236 -0
- package/dist/components/ui/file-upload.d.ts +10 -0
- package/dist/components/ui/file-upload.js +202 -0
- package/dist/components/ui/hover-card.cjs +55 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.js +15 -0
- package/dist/components/ui/index.cjs +546 -0
- package/dist/components/ui/index.d.ts +55 -0
- package/dist/components/ui/index.js +55 -0
- package/dist/components/ui/input.cjs +45 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +11 -0
- package/dist/components/ui/label.cjs +47 -0
- package/dist/components/ui/label.d.ts +7 -0
- package/dist/components/ui/label.js +13 -0
- package/dist/components/ui/layout/column.cjs +84 -0
- package/dist/components/ui/layout/column.d.ts +21 -0
- package/dist/components/ui/layout/column.js +50 -0
- package/dist/components/ui/layout/grid.cjs +101 -0
- package/dist/components/ui/layout/grid.d.ts +22 -0
- package/dist/components/ui/layout/grid.js +67 -0
- package/dist/components/ui/layout/index.cjs +44 -0
- package/dist/components/ui/layout/index.d.ts +7 -0
- package/dist/components/ui/layout/index.js +4 -0
- package/dist/components/ui/layout/row.cjs +84 -0
- package/dist/components/ui/layout/row.d.ts +21 -0
- package/dist/components/ui/layout/row.js +50 -0
- package/dist/components/ui/layout/types.cjs +18 -0
- package/dist/components/ui/layout/types.d.ts +149 -0
- package/dist/components/ui/layout/types.js +0 -0
- package/dist/components/ui/layout/utils.cjs +324 -0
- package/dist/components/ui/layout/utils.d.ts +76 -0
- package/dist/components/ui/layout/utils.js +239 -0
- package/dist/components/ui/menubar.cjs +210 -0
- package/dist/components/ui/menubar.d.ts +28 -0
- package/dist/components/ui/menubar.js +131 -0
- package/dist/components/ui/multi-select.cjs +187 -0
- package/dist/components/ui/multi-select.d.ts +18 -0
- package/dist/components/ui/multi-select.js +153 -0
- package/dist/components/ui/navigation-menu.cjs +122 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.js +64 -0
- package/dist/components/ui/pagination.cjs +131 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/pagination.js +79 -0
- package/dist/components/ui/popover.cjs +61 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.js +18 -0
- package/dist/components/ui/progress.cjs +51 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/progress.js +17 -0
- package/dist/components/ui/radio-group.cjs +61 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +24 -0
- package/dist/components/ui/resizable.cjs +60 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/resizable.js +20 -0
- package/dist/components/ui/scroll-area.cjs +67 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.js +30 -0
- package/dist/components/ui/search.cjs +153 -0
- package/dist/components/ui/search.d.ts +19 -0
- package/dist/components/ui/search.js +116 -0
- package/dist/components/ui/select.cjs +151 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/select.js +90 -0
- package/dist/components/ui/separator.cjs +47 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +13 -0
- package/dist/components/ui/sheet.cjs +142 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sheet.js +81 -0
- package/dist/components/ui/skeleton.cjs +43 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +9 -0
- package/dist/components/ui/slider.cjs +63 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +29 -0
- package/dist/components/ui/sonner.cjs +76 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.js +39 -0
- package/dist/components/ui/spinner.cjs +78 -0
- package/dist/components/ui/spinner.d.ts +11 -0
- package/dist/components/ui/spinner.js +41 -0
- package/dist/components/ui/stats-card.cjs +102 -0
- package/dist/components/ui/stats-card.d.ts +15 -0
- package/dist/components/ui/stats-card.js +68 -0
- package/dist/components/ui/stepper.cjs +99 -0
- package/dist/components/ui/stepper.d.ts +14 -0
- package/dist/components/ui/stepper.js +65 -0
- package/dist/components/ui/switch.cjs +48 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.js +14 -0
- package/dist/components/ui/table.cjs +110 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +55 -0
- package/dist/components/ui/tabs.cjs +67 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.js +24 -0
- package/dist/components/ui/textarea.cjs +44 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.js +10 -0
- package/dist/components/ui/toggle-group.cjs +73 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.js +36 -0
- package/dist/components/ui/toggle.cjs +71 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/toggle.js +34 -0
- package/dist/components/ui/tooltip.cjs +58 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +15 -0
- package/dist/examples/admin-layout-example.d.ts +92 -0
- package/dist/examples/app-shell-example.d.ts +52 -0
- package/dist/examples/dashboard-example.d.ts +11 -0
- package/dist/examples/data-management-example.d.ts +1 -0
- package/dist/examples/flow-editor-layout-example.d.ts +22 -0
- package/dist/examples/flow-start-example.d.ts +30 -0
- package/dist/examples/form-builder-example.d.ts +1 -0
- package/dist/examples/new-project-example.d.ts +30 -0
- package/dist/examples/settings-example.d.ts +1 -0
- package/dist/examples/vscode-example.d.ts +80 -0
- package/dist/index.cjs +830 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +67 -0
- package/dist/lib/index.cjs +42 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +2 -0
- package/dist/lib/utils.cjs +70 -0
- package/dist/lib/utils.d.ts +14 -0
- package/dist/lib/utils.js +30 -0
- package/dist/postcss.config.export.cjs +43 -0
- package/dist/postcss.config.export.js +9 -0
- package/dist/styles.css +6868 -0
- package/dist/tailwind.css +239 -0
- package/dist/tailwind.preset.cjs +77 -0
- package/dist/tailwind.preset.js +43 -0
- package/package.json +157 -0
- package/postcss.config.export.js +9 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
MultiSelect: ()=>MultiSelect
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const external_badge_cjs_namespaceObject = require("./badge.cjs");
|
|
33
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
34
|
+
const external_command_cjs_namespaceObject = require("./command.cjs");
|
|
35
|
+
const external_popover_cjs_namespaceObject = require("./popover.cjs");
|
|
36
|
+
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
37
|
+
const MultiSelect = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ options, selected, onChange, placeholder = 'Select items...', emptyMessage = 'No items found.', className, maxSelected, disabled = false, searchPlaceholder = 'Search...', clearAllText }, ref)=>{
|
|
38
|
+
const [open, setOpen] = external_react_namespaceObject.useState(false);
|
|
39
|
+
const handleUnselect = (value)=>{
|
|
40
|
+
onChange(selected.filter((s)=>s !== value));
|
|
41
|
+
};
|
|
42
|
+
const handleSelect = (value)=>{
|
|
43
|
+
if (selected.includes(value)) handleUnselect(value);
|
|
44
|
+
else {
|
|
45
|
+
if (maxSelected && selected.length >= maxSelected) return;
|
|
46
|
+
onChange([
|
|
47
|
+
...selected,
|
|
48
|
+
value
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const handleClearAll = ()=>{
|
|
53
|
+
onChange([]);
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
56
|
+
ref: ref,
|
|
57
|
+
className: (0, index_cjs_namespaceObject.cn)('relative', className),
|
|
58
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
59
|
+
open: open,
|
|
60
|
+
onOpenChange: setOpen,
|
|
61
|
+
children: [
|
|
62
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
63
|
+
asChild: true,
|
|
64
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
|
|
65
|
+
variant: "outline",
|
|
66
|
+
role: "combobox",
|
|
67
|
+
"aria-expanded": open,
|
|
68
|
+
"aria-label": selected.length > 0 ? `${selected.length} items selected` : placeholder,
|
|
69
|
+
className: (0, index_cjs_namespaceObject.cn)('w-full justify-between', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
73
|
+
className: "flex flex-wrap gap-1 flex-1",
|
|
74
|
+
children: 0 === selected.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
75
|
+
className: "text-muted-foreground",
|
|
76
|
+
children: placeholder
|
|
77
|
+
}) : selected.map((value)=>{
|
|
78
|
+
const option = options.find((opt)=>opt.value === value);
|
|
79
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_badge_cjs_namespaceObject.Badge, {
|
|
80
|
+
variant: "secondary",
|
|
81
|
+
className: "mr-1",
|
|
82
|
+
onClick: (e)=>{
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
handleUnselect(value);
|
|
85
|
+
},
|
|
86
|
+
children: [
|
|
87
|
+
option?.label,
|
|
88
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
89
|
+
role: "button",
|
|
90
|
+
tabIndex: 0,
|
|
91
|
+
"aria-label": `Remove ${option?.label}`,
|
|
92
|
+
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",
|
|
93
|
+
onKeyDown: (e)=>{
|
|
94
|
+
if ('Enter' === e.key || ' ' === e.key) {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
handleUnselect(value);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
onMouseDown: (e)=>{
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
},
|
|
103
|
+
onClick: (e)=>{
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
handleUnselect(value);
|
|
107
|
+
},
|
|
108
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
109
|
+
className: "h-3 w-3 text-muted-foreground hover:text-foreground"
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
}, value);
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronsUpDown, {
|
|
117
|
+
className: "h-4 w-4 shrink-0 opacity-50"
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
123
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
124
|
+
align: "start",
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.Command, {
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandInput, {
|
|
129
|
+
placeholder: searchPlaceholder
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandList, {
|
|
132
|
+
children: [
|
|
133
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandEmpty, {
|
|
134
|
+
children: emptyMessage
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandGroup, {
|
|
137
|
+
children: options.map((option)=>{
|
|
138
|
+
const isSelected = selected.includes(option.value);
|
|
139
|
+
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
140
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandItem, {
|
|
141
|
+
onSelect: ()=>{
|
|
142
|
+
if (!isDisabled) handleSelect(option.value);
|
|
143
|
+
},
|
|
144
|
+
disabled: isDisabled,
|
|
145
|
+
className: (0, index_cjs_namespaceObject.cn)(isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
146
|
+
children: [
|
|
147
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
148
|
+
className: (0, index_cjs_namespaceObject.cn)('mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary', isSelected ? 'bg-primary text-primary-foreground' : 'opacity-50 [&_svg]:invisible'),
|
|
149
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Check, {
|
|
150
|
+
className: "h-4 w-4"
|
|
151
|
+
})
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
154
|
+
children: option.label
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}, option.value);
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}),
|
|
164
|
+
selected.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
165
|
+
className: "border-t p-2",
|
|
166
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
167
|
+
variant: "ghost",
|
|
168
|
+
size: "sm",
|
|
169
|
+
className: "w-full",
|
|
170
|
+
onClick: handleClearAll,
|
|
171
|
+
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
MultiSelect.displayName = 'MultiSelect';
|
|
181
|
+
exports.MultiSelect = __webpack_exports__.MultiSelect;
|
|
182
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
183
|
+
"MultiSelect"
|
|
184
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
185
|
+
Object.defineProperty(exports, '__esModule', {
|
|
186
|
+
value: true
|
|
187
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MultiSelectProps {
|
|
3
|
+
options: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
selected: string[];
|
|
8
|
+
onChange: (selected: string[]) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
emptyMessage?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
maxSelected?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
searchPlaceholder?: string;
|
|
15
|
+
clearAllText?: string | ((count: number) => string);
|
|
16
|
+
}
|
|
17
|
+
declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { MultiSelect };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, ChevronsUpDown, X } from "lucide-react";
|
|
3
|
+
import { forwardRef, useState } from "react";
|
|
4
|
+
import { Badge } from "./badge.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
8
|
+
import { cn } from "../../lib/index.js";
|
|
9
|
+
const MultiSelect = /*#__PURE__*/ forwardRef(({ options, selected, onChange, placeholder = 'Select items...', emptyMessage = 'No items found.', className, maxSelected, disabled = false, searchPlaceholder = 'Search...', clearAllText }, ref)=>{
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const handleUnselect = (value)=>{
|
|
12
|
+
onChange(selected.filter((s)=>s !== value));
|
|
13
|
+
};
|
|
14
|
+
const handleSelect = (value)=>{
|
|
15
|
+
if (selected.includes(value)) handleUnselect(value);
|
|
16
|
+
else {
|
|
17
|
+
if (maxSelected && selected.length >= maxSelected) return;
|
|
18
|
+
onChange([
|
|
19
|
+
...selected,
|
|
20
|
+
value
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const handleClearAll = ()=>{
|
|
25
|
+
onChange([]);
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/ jsx("div", {
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: cn('relative', className),
|
|
30
|
+
children: /*#__PURE__*/ jsxs(Popover, {
|
|
31
|
+
open: open,
|
|
32
|
+
onOpenChange: setOpen,
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
35
|
+
asChild: true,
|
|
36
|
+
children: /*#__PURE__*/ jsxs(Button, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
role: "combobox",
|
|
39
|
+
"aria-expanded": open,
|
|
40
|
+
"aria-label": selected.length > 0 ? `${selected.length} items selected` : placeholder,
|
|
41
|
+
className: cn('w-full justify-between', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ jsx("div", {
|
|
45
|
+
className: "flex flex-wrap gap-1 flex-1",
|
|
46
|
+
children: 0 === selected.length ? /*#__PURE__*/ jsx("span", {
|
|
47
|
+
className: "text-muted-foreground",
|
|
48
|
+
children: placeholder
|
|
49
|
+
}) : selected.map((value)=>{
|
|
50
|
+
const option = options.find((opt)=>opt.value === value);
|
|
51
|
+
return /*#__PURE__*/ jsxs(Badge, {
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
className: "mr-1",
|
|
54
|
+
onClick: (e)=>{
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
handleUnselect(value);
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
option?.label,
|
|
60
|
+
/*#__PURE__*/ jsx("span", {
|
|
61
|
+
role: "button",
|
|
62
|
+
tabIndex: 0,
|
|
63
|
+
"aria-label": `Remove ${option?.label}`,
|
|
64
|
+
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",
|
|
65
|
+
onKeyDown: (e)=>{
|
|
66
|
+
if ('Enter' === e.key || ' ' === e.key) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
handleUnselect(value);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
onMouseDown: (e)=>{
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
},
|
|
75
|
+
onClick: (e)=>{
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
e.stopPropagation();
|
|
78
|
+
handleUnselect(value);
|
|
79
|
+
},
|
|
80
|
+
children: /*#__PURE__*/ jsx(X, {
|
|
81
|
+
className: "h-3 w-3 text-muted-foreground hover:text-foreground"
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
}, value);
|
|
86
|
+
})
|
|
87
|
+
}),
|
|
88
|
+
/*#__PURE__*/ jsx(ChevronsUpDown, {
|
|
89
|
+
className: "h-4 w-4 shrink-0 opacity-50"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ jsxs(PopoverContent, {
|
|
95
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
96
|
+
align: "start",
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ jsxs(Command, {
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ jsx(CommandInput, {
|
|
101
|
+
placeholder: searchPlaceholder
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ jsxs(CommandList, {
|
|
104
|
+
children: [
|
|
105
|
+
/*#__PURE__*/ jsx(CommandEmpty, {
|
|
106
|
+
children: emptyMessage
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ jsx(CommandGroup, {
|
|
109
|
+
children: options.map((option)=>{
|
|
110
|
+
const isSelected = selected.includes(option.value);
|
|
111
|
+
const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
|
|
112
|
+
return /*#__PURE__*/ jsxs(CommandItem, {
|
|
113
|
+
onSelect: ()=>{
|
|
114
|
+
if (!isDisabled) handleSelect(option.value);
|
|
115
|
+
},
|
|
116
|
+
disabled: isDisabled,
|
|
117
|
+
className: cn(isDisabled && 'opacity-50 cursor-not-allowed'),
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ jsx("div", {
|
|
120
|
+
className: cn('mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary', isSelected ? 'bg-primary text-primary-foreground' : 'opacity-50 [&_svg]:invisible'),
|
|
121
|
+
children: /*#__PURE__*/ jsx(Check, {
|
|
122
|
+
className: "h-4 w-4"
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ jsx("span", {
|
|
126
|
+
children: option.label
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}, option.value);
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
}),
|
|
136
|
+
selected.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
137
|
+
className: "border-t p-2",
|
|
138
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
size: "sm",
|
|
141
|
+
className: "w-full",
|
|
142
|
+
onClick: handleClearAll,
|
|
143
|
+
children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
MultiSelect.displayName = 'MultiSelect';
|
|
153
|
+
export { MultiSelect };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
NavigationMenuLink: ()=>NavigationMenuLink,
|
|
28
|
+
NavigationMenuIndicator: ()=>NavigationMenuIndicator,
|
|
29
|
+
navigationMenuTriggerStyle: ()=>navigationMenuTriggerStyle,
|
|
30
|
+
NavigationMenuViewport: ()=>NavigationMenuViewport,
|
|
31
|
+
NavigationMenu: ()=>NavigationMenu,
|
|
32
|
+
NavigationMenuContent: ()=>NavigationMenuContent,
|
|
33
|
+
NavigationMenuList: ()=>NavigationMenuList,
|
|
34
|
+
NavigationMenuTrigger: ()=>NavigationMenuTrigger,
|
|
35
|
+
NavigationMenuItem: ()=>NavigationMenuItem
|
|
36
|
+
});
|
|
37
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
38
|
+
const react_navigation_menu_namespaceObject = require("@radix-ui/react-navigation-menu");
|
|
39
|
+
const external_class_variance_authority_namespaceObject = require("class-variance-authority");
|
|
40
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
41
|
+
const external_react_namespaceObject = require("react");
|
|
42
|
+
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
43
|
+
const NavigationMenu = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.Root, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
className: (0, index_cjs_namespaceObject.cn)('relative z-10 flex max-w-max flex-1 items-center justify-center', className),
|
|
46
|
+
...props,
|
|
47
|
+
children: [
|
|
48
|
+
children,
|
|
49
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NavigationMenuViewport, {})
|
|
50
|
+
]
|
|
51
|
+
}));
|
|
52
|
+
NavigationMenu.displayName = react_navigation_menu_namespaceObject.Root.displayName;
|
|
53
|
+
const NavigationMenuList = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.List, {
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: (0, index_cjs_namespaceObject.cn)('group flex flex-1 list-none items-center justify-center space-x-1', className),
|
|
56
|
+
...props
|
|
57
|
+
}));
|
|
58
|
+
NavigationMenuList.displayName = react_navigation_menu_namespaceObject.List.displayName;
|
|
59
|
+
const NavigationMenuItem = react_navigation_menu_namespaceObject.Item;
|
|
60
|
+
const navigationMenuTriggerStyle = (0, external_class_variance_authority_namespaceObject.cva)('group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent');
|
|
61
|
+
const NavigationMenuTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_navigation_menu_namespaceObject.Trigger, {
|
|
62
|
+
ref: ref,
|
|
63
|
+
className: (0, index_cjs_namespaceObject.cn)(navigationMenuTriggerStyle(), 'group', className),
|
|
64
|
+
...props,
|
|
65
|
+
children: [
|
|
66
|
+
children,
|
|
67
|
+
' ',
|
|
68
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
69
|
+
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}));
|
|
74
|
+
NavigationMenuTrigger.displayName = react_navigation_menu_namespaceObject.Trigger.displayName;
|
|
75
|
+
const NavigationMenuContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Content, {
|
|
76
|
+
ref: ref,
|
|
77
|
+
className: (0, index_cjs_namespaceObject.cn)('left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ', className),
|
|
78
|
+
...props
|
|
79
|
+
}));
|
|
80
|
+
NavigationMenuContent.displayName = react_navigation_menu_namespaceObject.Content.displayName;
|
|
81
|
+
const NavigationMenuLink = react_navigation_menu_namespaceObject.Link;
|
|
82
|
+
const NavigationMenuViewport = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
83
|
+
className: (0, index_cjs_namespaceObject.cn)('absolute left-0 top-full flex justify-center'),
|
|
84
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Viewport, {
|
|
85
|
+
className: (0, index_cjs_namespaceObject.cn)('origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]', className),
|
|
86
|
+
ref: ref,
|
|
87
|
+
...props
|
|
88
|
+
})
|
|
89
|
+
}));
|
|
90
|
+
NavigationMenuViewport.displayName = react_navigation_menu_namespaceObject.Viewport.displayName;
|
|
91
|
+
const NavigationMenuIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_navigation_menu_namespaceObject.Indicator, {
|
|
92
|
+
ref: ref,
|
|
93
|
+
className: (0, index_cjs_namespaceObject.cn)('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', className),
|
|
94
|
+
...props,
|
|
95
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
96
|
+
className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"
|
|
97
|
+
})
|
|
98
|
+
}));
|
|
99
|
+
NavigationMenuIndicator.displayName = react_navigation_menu_namespaceObject.Indicator.displayName;
|
|
100
|
+
exports.NavigationMenu = __webpack_exports__.NavigationMenu;
|
|
101
|
+
exports.NavigationMenuContent = __webpack_exports__.NavigationMenuContent;
|
|
102
|
+
exports.NavigationMenuIndicator = __webpack_exports__.NavigationMenuIndicator;
|
|
103
|
+
exports.NavigationMenuItem = __webpack_exports__.NavigationMenuItem;
|
|
104
|
+
exports.NavigationMenuLink = __webpack_exports__.NavigationMenuLink;
|
|
105
|
+
exports.NavigationMenuList = __webpack_exports__.NavigationMenuList;
|
|
106
|
+
exports.NavigationMenuTrigger = __webpack_exports__.NavigationMenuTrigger;
|
|
107
|
+
exports.NavigationMenuViewport = __webpack_exports__.NavigationMenuViewport;
|
|
108
|
+
exports.navigationMenuTriggerStyle = __webpack_exports__.navigationMenuTriggerStyle;
|
|
109
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
110
|
+
"NavigationMenu",
|
|
111
|
+
"NavigationMenuContent",
|
|
112
|
+
"NavigationMenuIndicator",
|
|
113
|
+
"NavigationMenuItem",
|
|
114
|
+
"NavigationMenuLink",
|
|
115
|
+
"NavigationMenuList",
|
|
116
|
+
"NavigationMenuTrigger",
|
|
117
|
+
"NavigationMenuViewport",
|
|
118
|
+
"navigationMenuTriggerStyle"
|
|
119
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
120
|
+
Object.defineProperty(exports, '__esModule', {
|
|
121
|
+
value: true
|
|
122
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
5
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
6
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
+
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Content, Indicator, Item, Link, List, Root, Trigger, Viewport } from "@radix-ui/react-navigation-menu";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { cn } from "../../lib/index.js";
|
|
7
|
+
const NavigationMenu = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(Root, {
|
|
8
|
+
ref: ref,
|
|
9
|
+
className: cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className),
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
children,
|
|
13
|
+
/*#__PURE__*/ jsx(NavigationMenuViewport, {})
|
|
14
|
+
]
|
|
15
|
+
}));
|
|
16
|
+
NavigationMenu.displayName = Root.displayName;
|
|
17
|
+
const NavigationMenuList = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(List, {
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: cn('group flex flex-1 list-none items-center justify-center space-x-1', className),
|
|
20
|
+
...props
|
|
21
|
+
}));
|
|
22
|
+
NavigationMenuList.displayName = List.displayName;
|
|
23
|
+
const NavigationMenuItem = Item;
|
|
24
|
+
const navigationMenuTriggerStyle = cva('group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent');
|
|
25
|
+
const NavigationMenuTrigger = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(Trigger, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: cn(navigationMenuTriggerStyle(), 'group', className),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
' ',
|
|
32
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
33
|
+
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180",
|
|
34
|
+
"aria-hidden": "true"
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}));
|
|
38
|
+
NavigationMenuTrigger.displayName = Trigger.displayName;
|
|
39
|
+
const NavigationMenuContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Content, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: cn('left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ', className),
|
|
42
|
+
...props
|
|
43
|
+
}));
|
|
44
|
+
NavigationMenuContent.displayName = Content.displayName;
|
|
45
|
+
const NavigationMenuLink = Link;
|
|
46
|
+
const NavigationMenuViewport = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
47
|
+
className: cn('absolute left-0 top-full flex justify-center'),
|
|
48
|
+
children: /*#__PURE__*/ jsx(Viewport, {
|
|
49
|
+
className: cn('origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]', className),
|
|
50
|
+
ref: ref,
|
|
51
|
+
...props
|
|
52
|
+
})
|
|
53
|
+
}));
|
|
54
|
+
NavigationMenuViewport.displayName = Viewport.displayName;
|
|
55
|
+
const NavigationMenuIndicator = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Indicator, {
|
|
56
|
+
ref: ref,
|
|
57
|
+
className: cn('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', className),
|
|
58
|
+
...props,
|
|
59
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
60
|
+
className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"
|
|
61
|
+
})
|
|
62
|
+
}));
|
|
63
|
+
NavigationMenuIndicator.displayName = Indicator.displayName;
|
|
64
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|