@driveflux/beam 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/Badge.js +96 -7
- package/dist/button/Button.js +124 -12
- package/dist/chip/Chip.js +104 -3
- package/dist/command/command.js +170 -13
- package/dist/datepicker/DatePickerDrawer.js +110 -14
- package/dist/datepicker/DatePickerPopover.js +207 -35
- package/dist/dialog/index.js +180 -33
- package/dist/drawer/index.js +157 -12
- package/dist/input/Input.js +125 -11
- package/dist/input-select/InputSelect.js +357 -68
- package/dist/select/Select.js +315 -29
- package/dist/styles.css +19 -4
- package/package.json +1 -1
package/dist/badge/Badge.js
CHANGED
|
@@ -1,19 +1,108 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
1
80
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
81
|
import { cva } from 'class-variance-authority';
|
|
3
82
|
import Box from '../box/Box';
|
|
4
83
|
import { cn } from '../utils';
|
|
5
|
-
|
|
84
|
+
var badgeVariants = cva('inline-flex text-white w-max h-5 px-2 py-2 font-medium text-xs tracking-[0.5px] leading-[18px] uppercase bg-black rounded-sm', {
|
|
6
85
|
variants: {
|
|
7
86
|
colorScheme: {
|
|
8
87
|
success: 'bg-success4',
|
|
9
88
|
accent: 'bg-accent4',
|
|
10
89
|
warning: 'bg-warning4',
|
|
11
|
-
info: 'bg-links'
|
|
12
|
-
}
|
|
13
|
-
}
|
|
90
|
+
info: 'bg-links'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
14
93
|
});
|
|
15
|
-
function Badge(
|
|
16
|
-
|
|
94
|
+
function Badge(_param) {
|
|
95
|
+
var className = _param.className, colorScheme = _param.colorScheme, children = _param.children, props = _object_without_properties(_param, [
|
|
96
|
+
"className",
|
|
97
|
+
"colorScheme",
|
|
98
|
+
"children"
|
|
99
|
+
]);
|
|
100
|
+
return /*#__PURE__*/ _jsx(Box, _object_spread_props(_object_spread({
|
|
101
|
+
className: cn(badgeVariants({
|
|
102
|
+
colorScheme: colorScheme
|
|
103
|
+
}), 'items-center', className)
|
|
104
|
+
}, props), {
|
|
105
|
+
children: children
|
|
106
|
+
}));
|
|
17
107
|
}
|
|
18
108
|
export default Badge;
|
|
19
|
-
//# sourceMappingURL=Badge.js.map
|
package/dist/button/Button.js
CHANGED
|
@@ -1,4 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
81
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
82
|
import { cva } from 'class-variance-authority';
|
|
4
83
|
import * as React from 'react';
|
|
@@ -6,27 +85,60 @@ import LoadingAnimation from '../animations/LoadingAnimation.js';
|
|
|
6
85
|
import Box from '../box/Box.js';
|
|
7
86
|
import HStack from '../hstack/HStack.js';
|
|
8
87
|
import { cn } from '../utils.js';
|
|
9
|
-
|
|
88
|
+
var buttonVariants = cva('inline-flex items-center justify-center whitespace-nowrap text-xs px-4 py-6 h-12 bg-black hover:bg-primary4 text-white font-bold uppercase tracking-wider disabled:pointer-events-none disabled:opacity-30 ', {
|
|
10
89
|
variants: {
|
|
11
90
|
variant: {
|
|
12
91
|
outline: 'border border-black bg-white text-black hover:text-white hover:bg-black',
|
|
13
|
-
'outline-white': 'border border-white bg-transparent text-white hover:text-black hover:bg-white'
|
|
92
|
+
'outline-white': 'border border-white bg-transparent text-white hover:text-black hover:bg-white'
|
|
14
93
|
},
|
|
15
94
|
colorScheme: {
|
|
16
95
|
default: 'bg-black',
|
|
17
96
|
accent: 'bg-accent-500 hover:bg-accent4',
|
|
18
97
|
link: 'bg-links hover:bg-links2',
|
|
19
98
|
warning: 'bg-warning4 hover:bg-warning-500',
|
|
20
|
-
success: 'bg-success-200 hover:bg-success4'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
99
|
+
success: 'bg-success-200 hover:bg-success4'
|
|
100
|
+
}
|
|
101
|
+
}
|
|
23
102
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
103
|
+
var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
104
|
+
var className = _param.className, variant = _param.variant, colorScheme = _param.colorScheme, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, leftIcon = _param.leftIcon, rightIcon = _param.rightIcon, isDisabled = _param.isDisabled, isLoading = _param.isLoading, children = _param.children, props = _object_without_properties(_param, [
|
|
105
|
+
"className",
|
|
106
|
+
"variant",
|
|
107
|
+
"colorScheme",
|
|
108
|
+
"asChild",
|
|
109
|
+
"leftIcon",
|
|
110
|
+
"rightIcon",
|
|
111
|
+
"isDisabled",
|
|
112
|
+
"isLoading",
|
|
113
|
+
"children"
|
|
114
|
+
]);
|
|
115
|
+
var Comp = asChild ? Slot : 'button';
|
|
116
|
+
return /*#__PURE__*/ _jsx(Comp, _object_spread_props(_object_spread({
|
|
117
|
+
className: cn('min-w-32 rounded-lg', buttonVariants({
|
|
118
|
+
variant: variant,
|
|
119
|
+
colorScheme: colorScheme,
|
|
120
|
+
className: className
|
|
121
|
+
}), isLoading ? 'disabled:opacity-100!' : ''),
|
|
122
|
+
ref: ref,
|
|
123
|
+
disabled: isDisabled || isLoading
|
|
124
|
+
}, props), {
|
|
125
|
+
children: /*#__PURE__*/ _jsx(HStack, {
|
|
126
|
+
className: 'gap-2 items-center',
|
|
127
|
+
children: isLoading ? /*#__PURE__*/ _jsx(LoadingAnimation, {
|
|
128
|
+
colorScheme: colorScheme === 'default' || colorScheme === undefined ? 'default' : 'white'
|
|
129
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
130
|
+
children: [
|
|
131
|
+
leftIcon && /*#__PURE__*/ _jsx(Box, {
|
|
132
|
+
children: leftIcon
|
|
133
|
+
}),
|
|
134
|
+
children,
|
|
135
|
+
rightIcon && /*#__PURE__*/ _jsx(Box, {
|
|
136
|
+
children: rightIcon
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}));
|
|
29
142
|
});
|
|
30
143
|
Button.displayName = 'Button';
|
|
31
144
|
export default Button;
|
|
32
|
-
//# sourceMappingURL=Button.js.map
|
package/dist/chip/Chip.js
CHANGED
|
@@ -1,10 +1,111 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
1
80
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
81
|
import * as React from 'react';
|
|
3
82
|
import HStack from '../hstack/HStack';
|
|
4
83
|
import IconClose from '../icons/IconClose';
|
|
5
84
|
import { cn } from '../utils';
|
|
6
|
-
|
|
7
|
-
|
|
85
|
+
var Chip = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
86
|
+
var className = _param.className, variant = _param.variant, onClick = _param.onClick, value = _param.value, _param_isRemovable = _param.isRemovable, isRemovable = _param_isRemovable === void 0 ? false : _param_isRemovable, props = _object_without_properties(_param, [
|
|
87
|
+
"className",
|
|
88
|
+
"variant",
|
|
89
|
+
"onClick",
|
|
90
|
+
"value",
|
|
91
|
+
"isRemovable"
|
|
92
|
+
]);
|
|
93
|
+
return /*#__PURE__*/ _jsxs(HStack, _object_spread_props(_object_spread({
|
|
94
|
+
as: "button",
|
|
95
|
+
type: "button",
|
|
96
|
+
className: cn('flex p-3 text-sm text-primary3 tracking-normal min-w-max h-8 justify-center items-center gap-2 bg-[#F7F7F7] hover:border-black hover:border-[0.5px] hover:transition-all duration-200 ease-in-out transform active:scale-90 transition-transform rounded-sm', variant === 'outline' && 'border border-black', isRemovable && 'bg-primary1 p-3 hover:border-none hover:transition-none', className),
|
|
97
|
+
ref: ref,
|
|
98
|
+
onClick: onClick
|
|
99
|
+
}, props), {
|
|
100
|
+
children: [
|
|
101
|
+
props.children,
|
|
102
|
+
isRemovable && /*#__PURE__*/ _jsx(IconClose, {
|
|
103
|
+
title: "Close",
|
|
104
|
+
size: '12px',
|
|
105
|
+
className: "text-primary3"
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
8
110
|
Chip.displayName = 'Chip';
|
|
9
111
|
export default Chip;
|
|
10
|
-
//# sourceMappingURL=Chip.js.map
|
package/dist/command/command.js
CHANGED
|
@@ -1,30 +1,187 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function _object_without_properties(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
57
|
+
var key, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
60
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
61
|
+
key = sourceSymbolKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
64
|
+
target[key] = source[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function _object_without_properties_loose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
2
81
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
82
|
import { Command as CommandPrimitive } from 'cmdk';
|
|
4
83
|
import * as React from 'react';
|
|
5
84
|
import { Dialog, DialogContent } from '../dialog/index';
|
|
6
85
|
import IconSearch from '../icons/IconSearch';
|
|
7
86
|
import { cn } from '../utils';
|
|
8
|
-
|
|
87
|
+
var Command = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
88
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
89
|
+
"className"
|
|
90
|
+
]);
|
|
91
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive, _object_spread({
|
|
92
|
+
ref: ref,
|
|
93
|
+
className: cn('flex h-full w-full flex-col overflow-hidden rounded-lg bg-white text-zinc-950 dark:bg-zinc-950 dark:text-zinc-50', className)
|
|
94
|
+
}, props));
|
|
95
|
+
});
|
|
9
96
|
Command.displayName = CommandPrimitive.displayName;
|
|
10
|
-
|
|
11
|
-
|
|
97
|
+
var CommandDialog = function(_param) {
|
|
98
|
+
var children = _param.children, props = _object_without_properties(_param, [
|
|
99
|
+
"children"
|
|
100
|
+
]);
|
|
101
|
+
return /*#__PURE__*/ _jsx(Dialog, _object_spread_props(_object_spread({}, props), {
|
|
102
|
+
children: /*#__PURE__*/ _jsx(DialogContent, {
|
|
103
|
+
className: "overflow-hidden p-0 shadow-lg",
|
|
104
|
+
children: /*#__PURE__*/ _jsx(Command, {
|
|
105
|
+
className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-zinc-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-zinc-400",
|
|
106
|
+
children: children
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
}));
|
|
12
110
|
};
|
|
13
|
-
|
|
111
|
+
var CommandInput = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
112
|
+
var className = _param.className, containerClassName = _param.containerClassName, props = _object_without_properties(_param, [
|
|
113
|
+
"className",
|
|
114
|
+
"containerClassName"
|
|
115
|
+
]);
|
|
116
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: cn('flex h-10 items-center border-b px-3', containerClassName),
|
|
118
|
+
"cmdk-input-wrapper": "",
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ _jsx(IconSearch, {
|
|
121
|
+
className: "mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ _jsx(CommandPrimitive.Input, _object_spread({
|
|
124
|
+
ref: ref,
|
|
125
|
+
className: cn('flex w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-zinc-400', className)
|
|
126
|
+
}, props))
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
});
|
|
14
130
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
15
|
-
|
|
131
|
+
var CommandList = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
132
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
133
|
+
"className"
|
|
134
|
+
]);
|
|
135
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.List, _object_spread({
|
|
136
|
+
ref: ref,
|
|
137
|
+
className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)
|
|
138
|
+
}, props));
|
|
139
|
+
});
|
|
16
140
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
17
|
-
|
|
141
|
+
var CommandEmpty = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
142
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Empty, _object_spread({
|
|
143
|
+
ref: ref,
|
|
144
|
+
className: "py-6 text-center text-sm"
|
|
145
|
+
}, props));
|
|
146
|
+
});
|
|
18
147
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
19
|
-
|
|
148
|
+
var CommandGroup = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
149
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
150
|
+
"className"
|
|
151
|
+
]);
|
|
152
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Group, _object_spread({
|
|
153
|
+
ref: ref,
|
|
154
|
+
className: cn('overflow-hidden p-1 text-zinc-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-zinc-500 dark:text-zinc-50 dark:[&_[cmdk-group-heading]]:text-zinc-400', className)
|
|
155
|
+
}, props));
|
|
156
|
+
});
|
|
20
157
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
21
|
-
|
|
158
|
+
var CommandSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
159
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
160
|
+
"className"
|
|
161
|
+
]);
|
|
162
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Separator, _object_spread({
|
|
163
|
+
ref: ref,
|
|
164
|
+
className: cn('-mx-1 h-px bg-zinc-200 dark:bg-zinc-800', className)
|
|
165
|
+
}, props));
|
|
166
|
+
});
|
|
22
167
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
23
|
-
|
|
168
|
+
var CommandItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
169
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
170
|
+
"className"
|
|
171
|
+
]);
|
|
172
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Item, _object_spread({
|
|
173
|
+
ref: ref,
|
|
174
|
+
className: cn("relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-zinc-100 data-[selected=true]:text-zinc-900 data-[disabled=true]:opacity-50 dark:data-[selected='true']:bg-zinc-800 dark:data-[selected=true]:text-zinc-50", className)
|
|
175
|
+
}, props));
|
|
176
|
+
});
|
|
24
177
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
25
|
-
|
|
26
|
-
|
|
178
|
+
var CommandShortcut = function(_param) {
|
|
179
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
180
|
+
"className"
|
|
181
|
+
]);
|
|
182
|
+
return /*#__PURE__*/ _jsx("span", _object_spread({
|
|
183
|
+
className: cn('ml-auto text-xs tracking-widest text-zinc-500 dark:text-zinc-400', className)
|
|
184
|
+
}, props));
|
|
27
185
|
};
|
|
28
186
|
CommandShortcut.displayName = 'CommandShortcut';
|
|
29
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator,
|
|
30
|
-
//# sourceMappingURL=command.js.map
|
|
187
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|