@opensearch-project/oui 2.0.0-alpha.1 → 2.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -2
- package/dist/components/custom/avatar.d.ts +2 -2
- package/dist/components/custom/avatar.d.ts.map +1 -1
- package/dist/components/custom/avatar.js +6 -21
- package/dist/components/custom/avatar.js.map +1 -1
- package/dist/components/custom/breadcrumb.d.ts +1 -1
- package/dist/components/custom/breadcrumb.d.ts.map +1 -1
- package/dist/components/custom/breadcrumb.js +3 -18
- package/dist/components/custom/breadcrumb.js.map +1 -1
- package/dist/components/custom/button-group.d.ts +2 -2
- package/dist/components/custom/button-group.d.ts.map +1 -1
- package/dist/components/custom/button-group.js +5 -20
- package/dist/components/custom/button-group.js.map +1 -1
- package/dist/components/custom/button.d.ts +10 -3
- package/dist/components/custom/button.d.ts.map +1 -1
- package/dist/components/custom/button.js +16 -23
- package/dist/components/custom/button.js.map +1 -1
- package/dist/components/custom/checkbox.d.ts +1 -1
- package/dist/components/custom/checkbox.d.ts.map +1 -1
- package/dist/components/custom/checkbox.js +3 -18
- package/dist/components/custom/checkbox.js.map +1 -1
- package/dist/components/custom/combobox.d.ts +1 -1
- package/dist/components/custom/combobox.d.ts.map +1 -1
- package/dist/components/custom/combobox.js +47 -81
- package/dist/components/custom/combobox.js.map +1 -1
- package/dist/components/custom/context-menu.d.ts +4 -4
- package/dist/components/custom/context-menu.d.ts.map +1 -1
- package/dist/components/custom/context-menu.js +9 -20
- package/dist/components/custom/context-menu.js.map +1 -1
- package/dist/components/custom/pagination.d.ts +4 -4
- package/dist/components/custom/pagination.d.ts.map +1 -1
- package/dist/components/custom/pagination.js +9 -28
- package/dist/components/custom/pagination.js.map +1 -1
- package/dist/components/custom/progress.js +9 -19
- package/dist/components/custom/progress.js.map +1 -1
- package/dist/components/custom/radio-group.d.ts +2 -2
- package/dist/components/custom/radio-group.d.ts.map +1 -1
- package/dist/components/custom/radio-group.js +9 -24
- package/dist/components/custom/radio-group.js.map +1 -1
- package/dist/components/custom/select.d.ts +1 -1
- package/dist/components/custom/select.d.ts.map +1 -1
- package/dist/components/custom/select.js +3 -18
- package/dist/components/custom/select.js.map +1 -1
- package/dist/components/custom/switch.d.ts +1 -1
- package/dist/components/custom/switch.d.ts.map +1 -1
- package/dist/components/custom/switch.js +9 -29
- package/dist/components/custom/switch.js.map +1 -1
- package/dist/components/custom/tabs.d.ts +1 -1
- package/dist/components/custom/tabs.d.ts.map +1 -1
- package/dist/components/custom/tabs.js +6 -17
- package/dist/components/custom/tabs.js.map +1 -1
- package/dist/components/ui/accordion.d.ts +4 -4
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +8 -27
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +11 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +20 -33
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +3 -3
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +8 -23
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +1 -1
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +2 -13
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -3
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +7 -22
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +5 -20
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +7 -7
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +15 -32
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +3 -3
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +9 -24
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.d.ts +5 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +12 -21
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +2 -2
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +20 -38
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -7
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +15 -30
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +5 -5
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +40 -56
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +3 -20
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +4 -15
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts +9 -9
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +18 -36
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +15 -15
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +25 -51
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +10 -10
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +17 -38
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +10 -10
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +17 -32
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +15 -15
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +25 -51
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/form.d.ts +6 -6
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +35 -47
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +3 -3
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +5 -17
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +4 -4
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +14 -28
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +3 -18
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +3 -14
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +16 -16
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +28 -54
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +8 -8
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +18 -40
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +7 -7
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +15 -36
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +6 -18
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +3 -19
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +5 -18
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +3 -3
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +6 -22
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +6 -21
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -10
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +20 -48
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +3 -14
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +8 -8
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +21 -42
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +23 -23
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +108 -134
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +3 -18
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +8 -23
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +1 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +9 -24
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +3 -18
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.d.ts +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +3 -19
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +8 -8
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +17 -29
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +9 -24
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +3 -18
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +2 -2
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +8 -19
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +4 -15
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +7 -26
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-mobile.js +6 -6
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/react-compat.js +5 -5
- package/dist/lib/react-compat.js.map +1 -1
- package/dist/lib/utils.js +1 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/style.css +82 -49
- package/dist/style.scoped.css +116 -87
- package/package.json +7 -12
|
@@ -3,15 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
'use client';
|
|
6
|
-
|
|
7
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8
|
-
if (ar || !(i in from)) {
|
|
9
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
10
|
-
ar[i] = from[i];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
14
|
-
};
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
7
|
import * as React from 'react';
|
|
16
8
|
import { Check, ChevronsUpDown, X } from 'lucide-react';
|
|
17
9
|
import { cn } from '../../lib/utils';
|
|
@@ -20,30 +12,27 @@ import { Checkbox } from '../../components';
|
|
|
20
12
|
import { Badge } from '../../components';
|
|
21
13
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from '../ui/command';
|
|
22
14
|
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
|
|
23
|
-
export function Combobox(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _k = React.useState(false), open = _k[0], setOpen = _k[1];
|
|
34
|
-
var regularOptions = options.filter(function (option) { return !option.isAction; });
|
|
35
|
-
var actionOptions = options.filter(function (option) { return option.isAction; });
|
|
15
|
+
export function Combobox({ options,
|
|
16
|
+
// Single selection
|
|
17
|
+
value, onValueChange,
|
|
18
|
+
// Multi selection
|
|
19
|
+
multiple = false, values = [], onValuesChange, maxVisibleItems = 2,
|
|
20
|
+
// Common props
|
|
21
|
+
onActionSelect, placeholder = 'Select option...', searchPlaceholder = 'Search...', emptyText = 'No option found.', disabled = false, className, size = 'default', renderTrigger, popoverClassName, }) {
|
|
22
|
+
const [open, setOpen] = React.useState(false);
|
|
23
|
+
const regularOptions = options.filter((option) => !option.isAction);
|
|
24
|
+
const actionOptions = options.filter((option) => option.isAction);
|
|
36
25
|
// Handle both single and multi selection
|
|
37
|
-
|
|
38
|
-
? options.filter(
|
|
39
|
-
: options.find(
|
|
40
|
-
|
|
26
|
+
const selectedOptions = multiple
|
|
27
|
+
? options.filter((option) => values.includes(option.value) && !option.isAction)
|
|
28
|
+
: options.find((option) => option.value === value && !option.isAction);
|
|
29
|
+
const sizeClasses = {
|
|
41
30
|
sm: 'oui:h-8 oui:px-2 oui:text-sm',
|
|
42
31
|
default: 'oui:h-9 oui:px-3',
|
|
43
32
|
lg: 'oui:h-10 oui:px-4',
|
|
44
33
|
};
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
const handleSelect = (currentValue) => {
|
|
35
|
+
const option = options.find((opt) => opt.value === currentValue);
|
|
47
36
|
if (option === null || option === void 0 ? void 0 : option.isAction) {
|
|
48
37
|
onActionSelect === null || onActionSelect === void 0 ? void 0 : onActionSelect(currentValue);
|
|
49
38
|
if (!multiple)
|
|
@@ -51,78 +40,55 @@ export function Combobox(_a) {
|
|
|
51
40
|
return;
|
|
52
41
|
}
|
|
53
42
|
if (multiple) {
|
|
54
|
-
|
|
55
|
-
? values.filter(
|
|
56
|
-
:
|
|
43
|
+
const newValues = values.includes(currentValue)
|
|
44
|
+
? values.filter((v) => v !== currentValue)
|
|
45
|
+
: [...values, currentValue];
|
|
57
46
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(newValues);
|
|
58
47
|
}
|
|
59
48
|
else {
|
|
60
|
-
|
|
49
|
+
const newValue = currentValue === value ? '' : currentValue;
|
|
61
50
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue);
|
|
62
51
|
setOpen(false);
|
|
63
52
|
}
|
|
64
53
|
};
|
|
65
|
-
|
|
54
|
+
const handleRemoveValue = (valueToRemove) => {
|
|
66
55
|
if (multiple) {
|
|
67
|
-
|
|
56
|
+
const newValues = values.filter((v) => v !== valueToRemove);
|
|
68
57
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(newValues);
|
|
69
58
|
}
|
|
70
59
|
};
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
const renderMultiSelectTrigger = () => {
|
|
61
|
+
const selectedCount = Array.isArray(selectedOptions)
|
|
73
62
|
? selectedOptions.length
|
|
74
63
|
: 0;
|
|
75
|
-
return (
|
|
64
|
+
return (_jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: cn('oui:justify-between oui:font-normal', sizeClasses[size], selectedCount === 0
|
|
76
65
|
? 'oui:text-muted-foreground'
|
|
77
|
-
: 'oui:text-foreground', className), disabled: disabled },
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, onMouseDown: function (e) {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
e.stopPropagation();
|
|
89
|
-
}, onClick: function () { return handleRemoveValue(option.value); } },
|
|
90
|
-
React.createElement(X, { className: "oui:h-3 oui:w-3 oui:text-muted-foreground oui:hover:text-foreground" })))); }),
|
|
91
|
-
selectedCount > maxVisibleItems && (React.createElement(Badge, { variant: "outline", className: "oui:text-xs oui:text-muted-foreground" },
|
|
92
|
-
"+",
|
|
93
|
-
selectedCount - maxVisibleItems,
|
|
94
|
-
" more"))))),
|
|
95
|
-
React.createElement(ChevronsUpDown, { className: "oui:ml-2 oui:h-4 oui:w-4 oui:shrink-0 oui:opacity-50" })));
|
|
66
|
+
: 'oui:text-foreground', className), disabled: disabled, children: [_jsx("div", { className: "oui:flex oui:gap-1 oui:flex-1 oui:min-w-0 oui:items-center oui:overflow-hidden", children: selectedCount === 0 ? (_jsx("span", { children: placeholder })) : (_jsxs(_Fragment, { children: [Array.isArray(selectedOptions) &&
|
|
67
|
+
selectedOptions.slice(0, maxVisibleItems).map((option) => (_jsxs(Badge, { variant: "secondary", className: "oui:text-xs", children: [option.label, _jsx("button", { className: "oui:ml-1 oui:ring-offset-background oui:rounded-full oui:outline-none oui:focus:ring-2 oui:focus:ring-ring oui:focus:ring-offset-2", onKeyDown: (e) => {
|
|
68
|
+
if (e.key === 'Enter') {
|
|
69
|
+
handleRemoveValue(option.value);
|
|
70
|
+
}
|
|
71
|
+
}, onMouseDown: (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
}, onClick: () => handleRemoveValue(option.value), children: _jsx(X, { className: "oui:h-3 oui:w-3 oui:text-muted-foreground oui:hover:text-foreground" }) })] }, option.value))), selectedCount > maxVisibleItems && (_jsxs(Badge, { variant: "outline", className: "oui:text-xs oui:text-muted-foreground", children: ["+", selectedCount - maxVisibleItems, " more"] }))] })) }), _jsx(ChevronsUpDown, { className: "oui:ml-2 oui:h-4 oui:w-4 oui:shrink-0 oui:opacity-50" })] }));
|
|
96
75
|
};
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
const renderSingleSelectTrigger = () => {
|
|
77
|
+
const selectedOption = !Array.isArray(selectedOptions)
|
|
99
78
|
? selectedOptions
|
|
100
79
|
: undefined;
|
|
101
|
-
return (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
: placeholder,
|
|
105
|
-
React.createElement(ChevronsUpDown, { className: "oui:ml-2 oui:h-4 oui:w-4 oui:shrink-0 oui:opacity-50" })));
|
|
80
|
+
return (_jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: cn('oui:justify-between oui:font-normal', sizeClasses[size], selectedOption ? 'oui:text-foreground' : 'oui:text-muted-foreground', className), disabled: disabled, children: [selectedOption
|
|
81
|
+
? selectedOption.content || selectedOption.label
|
|
82
|
+
: placeholder, _jsx(ChevronsUpDown, { className: "oui:ml-2 oui:h-4 oui:w-4 oui:shrink-0 oui:opacity-50" })] }));
|
|
106
83
|
};
|
|
107
|
-
|
|
84
|
+
const defaultTrigger = multiple
|
|
108
85
|
? renderMultiSelectTrigger()
|
|
109
86
|
: renderSingleSelectTrigger();
|
|
110
|
-
return (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
React.createElement(CommandEmpty, null, emptyText),
|
|
117
|
-
regularOptions.length > 0 && (React.createElement(CommandGroup, null, regularOptions.map(function (option) {
|
|
118
|
-
var isSelected = multiple
|
|
119
|
-
? values.includes(option.value)
|
|
120
|
-
: value === option.value;
|
|
121
|
-
return (React.createElement(CommandItem, { key: option.value, value: option.value, disabled: option.disabled, onSelect: handleSelect },
|
|
122
|
-
multiple ? (React.createElement(Checkbox, { checked: isSelected, className: "oui:mr-2 oui:h-4 oui:w-4" })) : (React.createElement(Check, { className: cn('oui:mr-2 oui:h-4 oui:w-4', isSelected ? 'oui:opacity-100' : 'oui:opacity-0') })),
|
|
123
|
-
React.createElement("span", { className: "oui:text-foreground" }, option.content || option.label)));
|
|
124
|
-
}))),
|
|
125
|
-
actionOptions.length > 0 && regularOptions.length > 0 && (React.createElement(CommandSeparator, null)),
|
|
126
|
-
actionOptions.length > 0 && (React.createElement(CommandGroup, null, actionOptions.map(function (option) { return (React.createElement(CommandItem, { key: option.value, value: option.value, disabled: option.disabled, onSelect: handleSelect, className: "oui:text-muted-foreground" }, option.content || option.label)); }))))))));
|
|
87
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: renderTrigger ? renderTrigger(selectedOptions) : defaultTrigger }), _jsx(PopoverContent, { className: cn('oui:w-[200px] oui:p-0', popoverClassName), children: _jsxs(Command, { children: [_jsx(CommandInput, { placeholder: searchPlaceholder }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: emptyText }), regularOptions.length > 0 && (_jsx(CommandGroup, { children: regularOptions.map((option) => {
|
|
88
|
+
const isSelected = multiple
|
|
89
|
+
? values.includes(option.value)
|
|
90
|
+
: value === option.value;
|
|
91
|
+
return (_jsxs(CommandItem, { value: option.value, disabled: option.disabled, onSelect: handleSelect, children: [multiple ? (_jsx(Checkbox, { checked: isSelected, className: "oui:mr-2 oui:h-4 oui:w-4" })) : (_jsx(Check, { className: cn('oui:mr-2 oui:h-4 oui:w-4', isSelected ? 'oui:opacity-100' : 'oui:opacity-0') })), _jsx("span", { className: "oui:text-foreground", children: option.content || option.label })] }, option.value));
|
|
92
|
+
}) })), actionOptions.length > 0 && regularOptions.length > 0 && (_jsx(CommandSeparator, {})), actionOptions.length > 0 && (_jsx(CommandGroup, { children: actionOptions.map((option) => (_jsx(CommandItem, { value: option.value, disabled: option.disabled, onSelect: handleSelect, className: "oui:text-muted-foreground", children: option.content || option.label }, option.value))) }))] })] }) })] }));
|
|
127
93
|
}
|
|
128
94
|
//# sourceMappingURL=combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../../src/components/custom/combobox.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../../src/components/custom/combobox.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAA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E,EAAE,CAAC,CAC7B,KAAC,WAAW,IAEV,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,2BAA2B,YACpC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAL1B,MAAM,CAAC,KAAK,CAML,CACf,CAAC,GACW,CAChB,IACW,IACN,GACK,IACT,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem as BaseContextMenuItem, ContextMenuCheckboxItem as BaseContextMenuCheckboxItem, ContextMenuRadioItem as BaseContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger as BaseContextMenuSubTrigger, ContextMenuRadioGroup } from '../ui/context-menu';
|
|
3
|
-
declare function ContextMenuSubTrigger({ className, ...props }: React.ComponentProps<typeof BaseContextMenuSubTrigger>):
|
|
4
|
-
declare function ContextMenuItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuItem>):
|
|
5
|
-
declare function ContextMenuCheckboxItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuCheckboxItem>):
|
|
6
|
-
declare function ContextMenuRadioItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuRadioItem>):
|
|
3
|
+
declare function ContextMenuSubTrigger({ className, ...props }: React.ComponentProps<typeof BaseContextMenuSubTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ContextMenuItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuItem>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ContextMenuCheckboxItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuCheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function ContextMenuRadioItem({ className, ...props }: React.ComponentProps<typeof BaseContextMenuRadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuRadioGroup, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuSubTrigger, };
|
|
8
8
|
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/components/custom/context-menu.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,IAAI,mBAAmB,EACtC,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,IAAI,wBAAwB,EAChD,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,IAAI,yBAAyB,EAClD,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAI5B,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/components/custom/context-menu.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,IAAI,mBAAmB,EACtC,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,IAAI,wBAAwB,EAChD,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,IAAI,yBAAyB,EAClD,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAI5B,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,yBAAyB,CAAC,2CAUxD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,2CAUlD;AAED,iBAAS,uBAAuB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,2BAA2B,CAAC,2CAU1D;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,wBAAwB,CAAC,2CAUvD;AAED,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EAErB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GACtB,CAAC"}
|
|
@@ -3,17 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
'use client';
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
7
|
var t = {};
|
|
19
8
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,25 +14,25 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
14
|
}
|
|
26
15
|
return t;
|
|
27
16
|
};
|
|
28
|
-
import
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
18
|
import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem as BaseContextMenuItem, ContextMenuCheckboxItem as BaseContextMenuCheckboxItem, ContextMenuRadioItem as BaseContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger as BaseContextMenuSubTrigger, ContextMenuRadioGroup, } from '../ui/context-menu';
|
|
30
19
|
import { cn } from '../../lib/utils';
|
|
31
20
|
// Components that need secondary color overrides
|
|
32
21
|
function ContextMenuSubTrigger(_a) {
|
|
33
|
-
var className = _a
|
|
34
|
-
return (
|
|
22
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
+
return (_jsx(BaseContextMenuSubTrigger, Object.assign({ className: cn('oui:[&[data-highlighted]]:bg-secondary oui:[&[data-highlighted]]:text-secondary-foreground', className) }, props)));
|
|
35
24
|
}
|
|
36
25
|
function ContextMenuItem(_a) {
|
|
37
|
-
var className = _a
|
|
38
|
-
return (
|
|
26
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
27
|
+
return (_jsx(BaseContextMenuItem, Object.assign({ className: cn('oui:[&[data-highlighted]]:bg-secondary oui:[&[data-highlighted]]:text-secondary-foreground', className) }, props)));
|
|
39
28
|
}
|
|
40
29
|
function ContextMenuCheckboxItem(_a) {
|
|
41
|
-
var className = _a
|
|
42
|
-
return (
|
|
30
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
31
|
+
return (_jsx(BaseContextMenuCheckboxItem, Object.assign({ className: cn('oui:[&[data-highlighted]]:bg-secondary oui:[&[data-highlighted]]:text-secondary-foreground', className) }, props)));
|
|
43
32
|
}
|
|
44
33
|
function ContextMenuRadioItem(_a) {
|
|
45
|
-
var className = _a
|
|
46
|
-
return (
|
|
34
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
35
|
+
return (_jsx(BaseContextMenuRadioItem, Object.assign({ className: cn('oui:[&[data-highlighted]]:bg-secondary oui:[&[data-highlighted]]:text-secondary-foreground', className) }, props)));
|
|
47
36
|
}
|
|
48
37
|
export {
|
|
49
38
|
// Re-exported unchanged components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../../src/components/custom/context-menu.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../../src/components/custom/context-menu.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC;;;;;;;;;;;;;AAGb,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,IAAI,mBAAmB,EACtC,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,IAAI,wBAAwB,EAChD,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,IAAI,yBAAyB,EAClD,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,iDAAiD;AACjD,SAAS,qBAAqB,CAAC,EAG0B;QAH1B,EAC7B,SAAS,OAE8C,EADpD,KAAK,cAFqB,aAG9B,CADS;IAER,OAAO,CACL,KAAC,yBAAyB,kBACxB,SAAS,EAAE,EAAE,CACX,4FAA4F,EAC5F,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,EAG0B;QAH1B,EACvB,SAAS,OAEwC,EAD9C,KAAK,cAFe,aAGxB,CADS;IAER,OAAO,CACL,KAAC,mBAAmB,kBAClB,SAAS,EAAE,EAAE,CACX,4FAA4F,EAC5F,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAG0B;QAH1B,EAC/B,SAAS,OAEgD,EADtD,KAAK,cAFuB,aAGhC,CADS;IAER,OAAO,CACL,KAAC,2BAA2B,kBAC1B,SAAS,EAAE,EAAE,CACX,4FAA4F,EAC5F,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,EAG0B;QAH1B,EAC5B,SAAS,OAE6C,EADnD,KAAK,cAFoB,aAG7B,CADS;IAER,OAAO,CACL,KAAC,wBAAwB,kBACvB,SAAS,EAAE,EAAE,CACX,4FAA4F,EAC5F,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO;AACL,mCAAmC;AACnC,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB;AACrB,wBAAwB;AACxB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GACtB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Pagination as BasePagination, PaginationContent as BasePaginationContent, PaginationItem as BasePaginationItem, PaginationLink as BasePaginationLink, PaginationPrevious as BasePaginationPrevious, PaginationNext as BasePaginationNext, PaginationEllipsis as BasePaginationEllipsis } from '../ui/pagination';
|
|
3
|
-
declare function PaginationLink({ className, isActive, size, ...props }: React.ComponentProps<typeof BasePaginationLink>):
|
|
4
|
-
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof BasePaginationPrevious>):
|
|
5
|
-
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof BasePaginationNext>):
|
|
6
|
-
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<typeof BasePaginationEllipsis>):
|
|
3
|
+
declare function PaginationLink({ className, isActive, size, ...props }: React.ComponentProps<typeof BasePaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof BasePaginationPrevious>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof BasePaginationNext>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<typeof BasePaginationEllipsis>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { BasePagination as Pagination, BasePaginationContent as PaginationContent, BasePaginationItem as PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
8
8
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/custom/pagination.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,iBAAiB,IAAI,qBAAqB,EAC1C,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,kBAAkB,IAAI,sBAAsB,EAC5C,cAAc,IAAI,kBAAkB,EACpC,kBAAkB,IAAI,sBAAsB,EAC7C,MAAM,kBAAkB,CAAC;AAG1B,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/custom/pagination.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,iBAAiB,IAAI,qBAAqB,EAC1C,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,kBAAkB,IAAI,sBAAsB,EAC5C,cAAc,IAAI,kBAAkB,EACpC,kBAAkB,IAAI,sBAAsB,EAC7C,MAAM,kBAAkB,CAAC;AAG1B,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,2CAsBjD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,sBAAsB,CAAC,2CAWrD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,2CAWjD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,sBAAsB,CAAC,2CAOrD;AAED,OAAO,EAEL,cAAc,IAAI,UAAU,EAC5B,qBAAqB,IAAI,iBAAiB,EAC1C,kBAAkB,IAAI,cAAc,EAEpC,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,CAAC"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright OpenSearch Contributors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
2
|
var t = {};
|
|
18
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -24,14 +9,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
9
|
}
|
|
25
10
|
return t;
|
|
26
11
|
};
|
|
27
|
-
import
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
13
|
import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
29
14
|
import { cn } from '../../lib/utils';
|
|
30
15
|
import { Pagination as BasePagination, PaginationContent as BasePaginationContent, PaginationItem as BasePaginationItem, PaginationEllipsis as BasePaginationEllipsis, } from '../ui/pagination';
|
|
31
16
|
// Override PaginationLink completely to avoid buttonVariants conflicts
|
|
32
17
|
function PaginationLink(_a) {
|
|
33
|
-
var
|
|
34
|
-
return (
|
|
18
|
+
var { className, isActive, size = 'icon' } = _a, props = __rest(_a, ["className", "isActive", "size"]);
|
|
19
|
+
return (_jsx("a", Object.assign({ "aria-current": isActive ? 'page' : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(
|
|
35
20
|
// Base styling with rounded rectangle shape (not circular)
|
|
36
21
|
'oui:inline-flex oui:items-center oui:justify-center oui:whitespace-nowrap oui:text-sm oui:font-medium oui:transition-colors oui:focus-visible:outline-none oui:focus-visible:ring-1 oui:focus-visible:ring-ring oui:disabled:pointer-events-none oui:disabled:opacity-50',
|
|
37
22
|
// Size variants - using rounded-md for rectangular shape
|
|
@@ -44,20 +29,16 @@ function PaginationLink(_a) {
|
|
|
44
29
|
: 'oui:text-slate-950 oui:hover:bg-slate-100 oui:hover:text-slate-950 oui:dark:text-slate-50 oui:dark:hover:bg-slate-800', className) }, props)));
|
|
45
30
|
}
|
|
46
31
|
function PaginationPrevious(_a) {
|
|
47
|
-
var className = _a
|
|
48
|
-
return (
|
|
49
|
-
React.createElement(ChevronLeftIcon, { className: "oui:size-4" }),
|
|
50
|
-
React.createElement("span", { className: "oui:hidden oui:sm:block" }, "Previous")));
|
|
32
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
+
return (_jsxs(PaginationLink, Object.assign({ "aria-label": "Go to previous page", size: "default", className: cn('oui:gap-1 oui:px-2.5 oui:sm:pl-2.5', className) }, props, { children: [_jsx(ChevronLeftIcon, { className: "oui:size-4" }), _jsx("span", { className: "oui:hidden oui:sm:block", children: "Previous" })] })));
|
|
51
34
|
}
|
|
52
35
|
function PaginationNext(_a) {
|
|
53
|
-
var className = _a
|
|
54
|
-
return (
|
|
55
|
-
React.createElement("span", { className: "oui:hidden oui:sm:block" }, "Next"),
|
|
56
|
-
React.createElement(ChevronRightIcon, { className: "oui:size-4" })));
|
|
36
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
+
return (_jsxs(PaginationLink, Object.assign({ "aria-label": "Go to next page", size: "default", className: cn('oui:gap-1 oui:px-2.5 oui:sm:pr-2.5', className) }, props, { children: [_jsx("span", { className: "oui:hidden oui:sm:block", children: "Next" }), _jsx(ChevronRightIcon, { className: "oui:size-4" })] })));
|
|
57
38
|
}
|
|
58
39
|
function PaginationEllipsis(_a) {
|
|
59
|
-
var className = _a
|
|
60
|
-
return (
|
|
40
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
+
return (_jsx(BasePaginationEllipsis, Object.assign({ className: cn('oui:text-slate-950 oui:dark:text-slate-50', className) }, props)));
|
|
61
42
|
}
|
|
62
43
|
export {
|
|
63
44
|
// Re-exported unchanged components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/components/custom/pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/components/custom/pagination.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAMA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,iBAAiB,IAAI,qBAAqB,EAC1C,cAAc,IAAI,kBAAkB,EAIpC,kBAAkB,IAAI,sBAAsB,GAC7C,MAAM,kBAAkB,CAAC;AAE1B,uEAAuE;AACvE,SAAS,cAAc,CAAC,EAK0B;QAL1B,EACtB,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,MAAM,OAEmC,EAD7C,KAAK,cAJc,iCAKvB,CADS;IAER,OAAO,CACL,0CACgB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,eACjC,iBAAiB,iBACd,QAAQ,EACrB,SAAS,EAAE,EAAE;QACX,2DAA2D;QAC3D,0QAA0Q;QAC1Q,yDAAyD;QACzD,IAAI,KAAK,MAAM;YACb,CAAC,CAAC,2BAA2B;YAC7B,CAAC,CAAC,0CAA0C;QAC9C,kDAAkD;QAClD,QAAQ;YACN,CAAC,CAAC,kKAAkK;YACpK,CAAC,CAAC,uHAAuH,EAC3H,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAG0B;QAH1B,EAC1B,SAAS,OAE2C,EADjD,KAAK,cAFkB,aAG3B,CADS;IAER,OAAO,CACL,MAAC,cAAc,gCACF,qBAAqB,EAChC,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,IAC1D,KAAK,eACT,KAAC,eAAe,IAAC,SAAS,EAAC,YAAY,GAAG,EAC1C,eAAM,SAAS,EAAC,yBAAyB,yBAAgB,KAC1C,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAG0B;QAH1B,EACtB,SAAS,OAEuC,EAD7C,KAAK,cAFc,aAGvB,CADS;IAER,OAAO,CACL,MAAC,cAAc,gCACF,iBAAiB,EAC5B,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,IAC1D,KAAK,eACT,eAAM,SAAS,EAAC,yBAAyB,qBAAY,EACrD,KAAC,gBAAgB,IAAC,SAAS,EAAC,YAAY,GAAG,KAC5B,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAG0B;QAH1B,EAC1B,SAAS,OAE2C,EADjD,KAAK,cAFkB,aAG3B,CADS;IAER,OAAO,CACL,KAAC,sBAAsB,kBACrB,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE,SAAS,CAAC,IACjE,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO;AACL,mCAAmC;AACnC,cAAc,IAAI,UAAU,EAC5B,qBAAqB,IAAI,iBAAiB,EAC1C,kBAAkB,IAAI,cAAc;AACpC,wBAAwB;AACxB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,CAAC"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright OpenSearch Contributors
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
2
|
var t = {};
|
|
18
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -24,11 +9,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
9
|
}
|
|
25
10
|
return t;
|
|
26
11
|
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/*
|
|
14
|
+
* Copyright OpenSearch Contributors
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
*/
|
|
27
17
|
import * as React from 'react';
|
|
28
18
|
import { cva } from 'class-variance-authority';
|
|
29
19
|
import { cn } from '../../lib/utils';
|
|
30
20
|
import { Progress as BaseProgress } from '../ui/progress';
|
|
31
|
-
|
|
21
|
+
const progressVariants = cva('', {
|
|
32
22
|
variants: {
|
|
33
23
|
size: {
|
|
34
24
|
sm: 'oui:h-1 oui:w-64',
|
|
@@ -41,9 +31,9 @@ var progressVariants = cva('', {
|
|
|
41
31
|
size: 'default',
|
|
42
32
|
},
|
|
43
33
|
});
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
return (
|
|
34
|
+
const Progress = React.forwardRef(function Progress(_a, ref) {
|
|
35
|
+
var { className, size } = _a, props = __rest(_a, ["className", "size"]);
|
|
36
|
+
return (_jsx(BaseProgress, Object.assign({ ref: ref, className: cn(progressVariants({ size }), className) }, props)));
|
|
47
37
|
});
|
|
48
38
|
Progress.displayName = 'Progress';
|
|
49
39
|
export { Progress };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/components/custom/progress.tsx"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/components/custom/progress.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,gBAAgB,GAAG,GAAG,CAAC,EAAE,EAAE;IAC/B,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,kBAAkB;YACtB,OAAO,EAAE,kBAAkB;YAC3B,EAAE,EAAE,kBAAkB;YACtB,EAAE,EAAE,kBAAkB;SACvB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAOH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,SAAS,QAAQ,CAAC,EAA6B,EAAE,GAAG;QAAlC,EAAE,SAAS,EAAE,IAAI,OAAY,EAAP,KAAK,cAA3B,qBAA6B,CAAF;IAC7C,OAAO,CACL,KAAC,YAAY,kBACX,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,IAChD,KAAK,EACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -9,10 +9,10 @@ declare const radioGroupItemVariants: (props?: ({
|
|
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
10
|
interface RadioGroupProps extends React.ComponentProps<typeof RadioGroupPrimitive.Root>, VariantProps<typeof radioGroupVariants> {
|
|
11
11
|
}
|
|
12
|
-
declare function RadioGroup({ className, variant, ...props }: RadioGroupProps):
|
|
12
|
+
declare function RadioGroup({ className, variant, ...props }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
interface RadioGroupItemProps extends React.ComponentProps<typeof RadioGroupPrimitive.Item>, VariantProps<typeof radioGroupItemVariants> {
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
declare function RadioGroupItem({ className, variant, children, ...props }: RadioGroupItemProps):
|
|
16
|
+
declare function RadioGroupItem({ className, variant, children, ...props }: RadioGroupItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export { RadioGroup, RadioGroupItem };
|
|
18
18
|
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../src/components/custom/radio-group.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,QAAA,MAAM,kBAAkB;;mFAUtB,CAAC;AAEH,QAAA,MAAM,sBAAsB;;mFAc3B,CAAC;AAEF,UAAU,eACR,SACE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,EACrD,YAAY,CAAC,OAAO,kBAAkB,CAAC;CAAG;AAE9C,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../src/components/custom/radio-group.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,QAAA,MAAM,kBAAkB;;mFAUtB,CAAC;AAEH,QAAA,MAAM,sBAAsB;;mFAc3B,CAAC;AAEF,UAAU,eACR,SACE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,EACrD,YAAY,CAAC,OAAO,kBAAkB,CAAC;CAAG;AAE9C,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAmBpE;AAED,UAAU,mBACR,SACE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,EACrD,YAAY,CAAC,OAAO,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA+BrB;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -3,17 +3,6 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
'use client';
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
7
|
var t = {};
|
|
19
8
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,12 +14,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
14
|
}
|
|
26
15
|
return t;
|
|
27
16
|
};
|
|
28
|
-
import
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
18
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
30
19
|
import { cva } from 'class-variance-authority';
|
|
31
20
|
import { cn } from '../../lib/utils';
|
|
32
21
|
import { RadioGroup as BaseRadioGroup, RadioGroupItem as BaseRadioGroupItem, } from '../ui/radio-group';
|
|
33
|
-
|
|
22
|
+
const radioGroupVariants = cva('oui:grid', {
|
|
34
23
|
variants: {
|
|
35
24
|
variant: {
|
|
36
25
|
default: 'oui:gap-3',
|
|
@@ -41,7 +30,7 @@ var radioGroupVariants = cva('oui:grid', {
|
|
|
41
30
|
variant: 'default',
|
|
42
31
|
},
|
|
43
32
|
});
|
|
44
|
-
|
|
33
|
+
const radioGroupItemVariants = cva('oui:border oui:text-primary oui:focus-visible:border-ring oui:focus-visible:ring-ring/50 oui:aria-invalid:ring-destructive/20 oui:dark:aria-invalid:ring-destructive/40 oui:aria-invalid:border-destructive oui:transition-[color,box-shadow] oui:outline-none oui:focus-visible:ring-[3px] oui:disabled:cursor-not-allowed oui:disabled:opacity-50', {
|
|
45
34
|
variants: {
|
|
46
35
|
variant: {
|
|
47
36
|
default: 'oui:border-input oui:dark:bg-input/30 oui:aspect-square oui:size-4 oui:shrink-0 oui:rounded-full oui:shadow-xs',
|
|
@@ -53,26 +42,22 @@ var radioGroupItemVariants = cva('oui:border oui:text-primary oui:focus-visible:
|
|
|
53
42
|
},
|
|
54
43
|
});
|
|
55
44
|
function RadioGroup(_a) {
|
|
56
|
-
var
|
|
45
|
+
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
57
46
|
// For default variant, use the base UI component
|
|
58
47
|
if (variant === 'default' || !variant) {
|
|
59
|
-
return (
|
|
48
|
+
return (_jsx(BaseRadioGroup, Object.assign({ className: cn(radioGroupVariants({ variant }), className) }, props)));
|
|
60
49
|
}
|
|
61
50
|
// For custom variants, use the primitive directly
|
|
62
|
-
return (
|
|
51
|
+
return (_jsx(RadioGroupPrimitive.Root, Object.assign({ "data-slot": "radio-group", className: cn(radioGroupVariants({ variant }), className) }, props)));
|
|
63
52
|
}
|
|
64
53
|
function RadioGroupItem(_a) {
|
|
65
|
-
var
|
|
54
|
+
var { className, variant, children } = _a, props = __rest(_a, ["className", "variant", "children"]);
|
|
66
55
|
// For box variant, use custom implementation
|
|
67
56
|
if (variant === 'box') {
|
|
68
|
-
return (
|
|
69
|
-
React.createElement("div", { className: "oui:aspect-square oui:size-4 oui:shrink-0 oui:rounded-full oui:border oui:border-input oui:flex oui:items-center oui:justify-center oui:relative oui:group-data-[state=checked]:border-primary oui:group-data-[state=checked]:bg-primary" },
|
|
70
|
-
React.createElement(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "oui:relative oui:flex oui:items-center oui:justify-center" },
|
|
71
|
-
React.createElement("div", { className: "oui:size-2 oui:rounded-full oui:bg-white" }))),
|
|
72
|
-
children && (React.createElement("div", { className: "oui:flex oui:flex-col oui:gap-1.5 oui:flex-1" }, children))));
|
|
57
|
+
return (_jsxs(RadioGroupPrimitive.Item, Object.assign({ "data-slot": "radio-group-item", className: cn(radioGroupItemVariants({ variant }), className) }, props, { children: [_jsx("div", { className: "oui:aspect-square oui:size-4 oui:shrink-0 oui:rounded-full oui:border oui:border-input oui:flex oui:items-center oui:justify-center oui:relative oui:group-data-[state=checked]:border-primary oui:group-data-[state=checked]:bg-primary", children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "oui:relative oui:flex oui:items-center oui:justify-center", children: _jsx("div", { className: "oui:size-2 oui:rounded-full oui:bg-white" }) }) }), children && (_jsx("div", { className: "oui:flex oui:flex-col oui:gap-1.5 oui:flex-1", children: children }))] })));
|
|
73
58
|
}
|
|
74
59
|
// For default variant, extend the base UI component
|
|
75
|
-
return (
|
|
60
|
+
return (_jsx(BaseRadioGroupItem, Object.assign({ className: cn(radioGroupItemVariants({ variant }), className) }, props)));
|
|
76
61
|
}
|
|
77
62
|
export { RadioGroup, RadioGroupItem };
|
|
78
63
|
//# sourceMappingURL=radio-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/components/custom/radio-group.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/components/custom/radio-group.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC;;;;;;;;;;;;;AAGb,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,cAAc,IAAI,kBAAkB,GACrC,MAAM,mBAAmB,CAAC;AAE3B,MAAM,kBAAkB,GAAG,GAAG,CAAC,UAAU,EAAE;IACzC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,WAAW;YACpB,GAAG,EAAE,WAAW;SACjB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,GAAG,CAChC,qVAAqV,EACrV;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,gHAAgH;YAClH,GAAG,EAAE,yOAAyO;SAC/O;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAOF,SAAS,UAAU,CAAC,EAAiD;QAAjD,EAAE,SAAS,EAAE,OAAO,OAA6B,EAAxB,KAAK,cAA9B,wBAAgC,CAAF;IAChD,iDAAiD;IACjD,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,CACL,KAAC,cAAc,kBACb,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,IACrD,KAAK,EACT,CACH,CAAC;IACJ,CAAC;IAED,kDAAkD;IAClD,OAAO,CACL,KAAC,mBAAmB,CAAC,IAAI,+BACb,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,IACrD,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AASD,SAAS,cAAc,CAAC,EAKF;QALE,EACtB,SAAS,EACT,OAAO,EACP,QAAQ,OAEY,EADjB,KAAK,cAJc,oCAKvB,CADS;IAER,6CAA6C;IAC7C,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,CACL,MAAC,mBAAmB,CAAC,IAAI,+BACb,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,IACzD,KAAK,eACT,cAAK,SAAS,EAAC,0OAA0O,YACvP,KAAC,mBAAmB,CAAC,SAAS,iBAClB,uBAAuB,EACjC,SAAS,EAAC,2DAA2D,YACrE,cAAK,SAAS,EAAC,0CAA0C,GAAG,GAC9B,GAC5B,EACL,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,8CAA8C,YAC1D,QAAQ,GACL,CACP,KACwB,CAC5B,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,OAAO,CACL,KAAC,kBAAkB,kBACjB,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,IACzD,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger as BaseSelectTrigger, SelectValue } from '../ui/select';
|
|
3
|
-
declare function SelectTrigger({ className, ...props }: React.ComponentProps<typeof BaseSelectTrigger>):
|
|
3
|
+
declare function SelectTrigger({ className, ...props }: React.ComponentProps<typeof BaseSelectTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
5
5
|
//# sourceMappingURL=select.d.ts.map
|