@mijn-ui/react-command 0.2.1 → 0.3.0
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/index.d.ts +169 -71
- package/dist/index.js +31 -17
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,175 +1,259 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _mijn_ui_react_core from '@mijn-ui/react-core';
|
|
3
|
+
import { UnstyledComponentWithSlots } from '@mijn-ui/react-core';
|
|
2
4
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
+
import { VariantProps } from 'tailwind-variants';
|
|
6
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
5
7
|
import * as React from 'react';
|
|
6
8
|
import { DialogProps } from '@mijn-ui/react-dialog';
|
|
7
9
|
import { Command as Command$1 } from 'cmdk';
|
|
8
10
|
|
|
11
|
+
declare const commandStyles: tailwind_variants.TVReturnType<{
|
|
12
|
+
[key: string]: {
|
|
13
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
14
|
+
base?: tailwind_merge.ClassNameValue;
|
|
15
|
+
dialogWrapper?: tailwind_merge.ClassNameValue;
|
|
16
|
+
dialog?: tailwind_merge.ClassNameValue;
|
|
17
|
+
list?: tailwind_merge.ClassNameValue;
|
|
18
|
+
group?: tailwind_merge.ClassNameValue;
|
|
19
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
20
|
+
item?: tailwind_merge.ClassNameValue;
|
|
21
|
+
input?: tailwind_merge.ClassNameValue;
|
|
22
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
23
|
+
shortcut?: tailwind_merge.ClassNameValue;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
[x: string]: {
|
|
28
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
29
|
+
base?: tailwind_merge.ClassNameValue;
|
|
30
|
+
dialogWrapper?: tailwind_merge.ClassNameValue;
|
|
31
|
+
dialog?: tailwind_merge.ClassNameValue;
|
|
32
|
+
list?: tailwind_merge.ClassNameValue;
|
|
33
|
+
group?: tailwind_merge.ClassNameValue;
|
|
34
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
35
|
+
item?: tailwind_merge.ClassNameValue;
|
|
36
|
+
input?: tailwind_merge.ClassNameValue;
|
|
37
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
38
|
+
shortcut?: tailwind_merge.ClassNameValue;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {}, {
|
|
42
|
+
base: string;
|
|
43
|
+
dialogWrapper: string;
|
|
44
|
+
dialog: string;
|
|
45
|
+
list: string;
|
|
46
|
+
group: string;
|
|
47
|
+
separator: string;
|
|
48
|
+
item: string;
|
|
49
|
+
input: string;
|
|
50
|
+
empty: string;
|
|
51
|
+
shortcut: string;
|
|
52
|
+
}, undefined, {
|
|
53
|
+
[key: string]: {
|
|
54
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
55
|
+
base?: tailwind_merge.ClassNameValue;
|
|
56
|
+
dialogWrapper?: tailwind_merge.ClassNameValue;
|
|
57
|
+
dialog?: tailwind_merge.ClassNameValue;
|
|
58
|
+
list?: tailwind_merge.ClassNameValue;
|
|
59
|
+
group?: tailwind_merge.ClassNameValue;
|
|
60
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
61
|
+
item?: tailwind_merge.ClassNameValue;
|
|
62
|
+
input?: tailwind_merge.ClassNameValue;
|
|
63
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
64
|
+
shortcut?: tailwind_merge.ClassNameValue;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
} | {}, {
|
|
68
|
+
base: string;
|
|
69
|
+
dialogWrapper: string;
|
|
70
|
+
dialog: string;
|
|
71
|
+
list: string;
|
|
72
|
+
group: string;
|
|
73
|
+
separator: string;
|
|
74
|
+
item: string;
|
|
75
|
+
input: string;
|
|
76
|
+
empty: string;
|
|
77
|
+
shortcut: string;
|
|
78
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
79
|
+
base: string;
|
|
80
|
+
dialogWrapper: string;
|
|
81
|
+
dialog: string;
|
|
82
|
+
list: string;
|
|
83
|
+
group: string;
|
|
84
|
+
separator: string;
|
|
85
|
+
item: string;
|
|
86
|
+
input: string;
|
|
87
|
+
empty: string;
|
|
88
|
+
shortcut: string;
|
|
89
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
90
|
+
type CommandVariantProps = VariantProps<typeof commandStyles>;
|
|
91
|
+
type CommandSlots = keyof ReturnType<typeof commandStyles>;
|
|
92
|
+
|
|
9
93
|
type CommandBaseProps = UnstyledComponentWithSlots<CommandSlots>;
|
|
10
94
|
declare const useCommandStyles: (unstyledOverride?: boolean) => {
|
|
11
|
-
classNames:
|
|
95
|
+
classNames: _mijn_ui_react_core.SlotsToClasses<"base" | "dialogWrapper" | "dialog" | "list" | "group" | "separator" | "item" | "input" | "empty" | "shortcut"> | undefined;
|
|
12
96
|
isUnstyled: boolean | undefined;
|
|
13
|
-
base: (slotProps?: ({
|
|
97
|
+
base: (slotProps?: ({
|
|
14
98
|
[x: string]: string | number | undefined;
|
|
15
99
|
[x: number]: string | number | undefined;
|
|
16
|
-
} & tailwind_variants.ClassProp<
|
|
100
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
17
101
|
[x: string]: string | number | undefined;
|
|
18
102
|
[x: number]: string | number | undefined;
|
|
19
|
-
} & tailwind_variants.ClassProp<
|
|
103
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
20
104
|
[x: string]: string | number | undefined;
|
|
21
105
|
[x: number]: string | number | undefined;
|
|
22
|
-
} & tailwind_variants.ClassProp<
|
|
106
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
23
107
|
[x: string]: string | number | undefined;
|
|
24
108
|
[x: number]: string | number | undefined;
|
|
25
|
-
} & tailwind_variants.ClassProp<
|
|
109
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
26
110
|
[x: string]: string | number | undefined;
|
|
27
111
|
[x: number]: string | number | undefined;
|
|
28
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
29
|
-
dialogWrapper: (slotProps?: ({
|
|
112
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
113
|
+
dialogWrapper: (slotProps?: ({
|
|
30
114
|
[x: string]: string | number | undefined;
|
|
31
115
|
[x: number]: string | number | undefined;
|
|
32
|
-
} & tailwind_variants.ClassProp<
|
|
116
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
33
117
|
[x: string]: string | number | undefined;
|
|
34
118
|
[x: number]: string | number | undefined;
|
|
35
|
-
} & tailwind_variants.ClassProp<
|
|
119
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
36
120
|
[x: string]: string | number | undefined;
|
|
37
121
|
[x: number]: string | number | undefined;
|
|
38
|
-
} & tailwind_variants.ClassProp<
|
|
122
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
39
123
|
[x: string]: string | number | undefined;
|
|
40
124
|
[x: number]: string | number | undefined;
|
|
41
|
-
} & tailwind_variants.ClassProp<
|
|
125
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
42
126
|
[x: string]: string | number | undefined;
|
|
43
127
|
[x: number]: string | number | undefined;
|
|
44
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
45
|
-
dialog: (slotProps?: ({
|
|
128
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
129
|
+
dialog: (slotProps?: ({
|
|
46
130
|
[x: string]: string | number | undefined;
|
|
47
131
|
[x: number]: string | number | undefined;
|
|
48
|
-
} & tailwind_variants.ClassProp<
|
|
132
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
49
133
|
[x: string]: string | number | undefined;
|
|
50
134
|
[x: number]: string | number | undefined;
|
|
51
|
-
} & tailwind_variants.ClassProp<
|
|
135
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
52
136
|
[x: string]: string | number | undefined;
|
|
53
137
|
[x: number]: string | number | undefined;
|
|
54
|
-
} & tailwind_variants.ClassProp<
|
|
138
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
55
139
|
[x: string]: string | number | undefined;
|
|
56
140
|
[x: number]: string | number | undefined;
|
|
57
|
-
} & tailwind_variants.ClassProp<
|
|
141
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
58
142
|
[x: string]: string | number | undefined;
|
|
59
143
|
[x: number]: string | number | undefined;
|
|
60
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
61
|
-
list: (slotProps?: ({
|
|
144
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
145
|
+
list: (slotProps?: ({
|
|
62
146
|
[x: string]: string | number | undefined;
|
|
63
147
|
[x: number]: string | number | undefined;
|
|
64
|
-
} & tailwind_variants.ClassProp<
|
|
148
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
65
149
|
[x: string]: string | number | undefined;
|
|
66
150
|
[x: number]: string | number | undefined;
|
|
67
|
-
} & tailwind_variants.ClassProp<
|
|
151
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
68
152
|
[x: string]: string | number | undefined;
|
|
69
153
|
[x: number]: string | number | undefined;
|
|
70
|
-
} & tailwind_variants.ClassProp<
|
|
154
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
71
155
|
[x: string]: string | number | undefined;
|
|
72
156
|
[x: number]: string | number | undefined;
|
|
73
|
-
} & tailwind_variants.ClassProp<
|
|
157
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
74
158
|
[x: string]: string | number | undefined;
|
|
75
159
|
[x: number]: string | number | undefined;
|
|
76
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
77
|
-
group: (slotProps?: ({
|
|
160
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
161
|
+
group: (slotProps?: ({
|
|
78
162
|
[x: string]: string | number | undefined;
|
|
79
163
|
[x: number]: string | number | undefined;
|
|
80
|
-
} & tailwind_variants.ClassProp<
|
|
164
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
81
165
|
[x: string]: string | number | undefined;
|
|
82
166
|
[x: number]: string | number | undefined;
|
|
83
|
-
} & tailwind_variants.ClassProp<
|
|
167
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
84
168
|
[x: string]: string | number | undefined;
|
|
85
169
|
[x: number]: string | number | undefined;
|
|
86
|
-
} & tailwind_variants.ClassProp<
|
|
170
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
87
171
|
[x: string]: string | number | undefined;
|
|
88
172
|
[x: number]: string | number | undefined;
|
|
89
|
-
} & tailwind_variants.ClassProp<
|
|
173
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
90
174
|
[x: string]: string | number | undefined;
|
|
91
175
|
[x: number]: string | number | undefined;
|
|
92
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
93
|
-
separator: (slotProps?: ({
|
|
176
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
177
|
+
separator: (slotProps?: ({
|
|
94
178
|
[x: string]: string | number | undefined;
|
|
95
179
|
[x: number]: string | number | undefined;
|
|
96
|
-
} & tailwind_variants.ClassProp<
|
|
180
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
97
181
|
[x: string]: string | number | undefined;
|
|
98
182
|
[x: number]: string | number | undefined;
|
|
99
|
-
} & tailwind_variants.ClassProp<
|
|
183
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
100
184
|
[x: string]: string | number | undefined;
|
|
101
185
|
[x: number]: string | number | undefined;
|
|
102
|
-
} & tailwind_variants.ClassProp<
|
|
186
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
103
187
|
[x: string]: string | number | undefined;
|
|
104
188
|
[x: number]: string | number | undefined;
|
|
105
|
-
} & tailwind_variants.ClassProp<
|
|
189
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
106
190
|
[x: string]: string | number | undefined;
|
|
107
191
|
[x: number]: string | number | undefined;
|
|
108
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
109
|
-
item: (slotProps?: ({
|
|
192
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
193
|
+
item: (slotProps?: ({
|
|
110
194
|
[x: string]: string | number | undefined;
|
|
111
195
|
[x: number]: string | number | undefined;
|
|
112
|
-
} & tailwind_variants.ClassProp<
|
|
196
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
113
197
|
[x: string]: string | number | undefined;
|
|
114
198
|
[x: number]: string | number | undefined;
|
|
115
|
-
} & tailwind_variants.ClassProp<
|
|
199
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
116
200
|
[x: string]: string | number | undefined;
|
|
117
201
|
[x: number]: string | number | undefined;
|
|
118
|
-
} & tailwind_variants.ClassProp<
|
|
202
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
119
203
|
[x: string]: string | number | undefined;
|
|
120
204
|
[x: number]: string | number | undefined;
|
|
121
|
-
} & tailwind_variants.ClassProp<
|
|
205
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
122
206
|
[x: string]: string | number | undefined;
|
|
123
207
|
[x: number]: string | number | undefined;
|
|
124
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
125
|
-
input: (slotProps?: ({
|
|
208
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
209
|
+
input: (slotProps?: ({
|
|
126
210
|
[x: string]: string | number | undefined;
|
|
127
211
|
[x: number]: string | number | undefined;
|
|
128
|
-
} & tailwind_variants.ClassProp<
|
|
212
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
129
213
|
[x: string]: string | number | undefined;
|
|
130
214
|
[x: number]: string | number | undefined;
|
|
131
|
-
} & tailwind_variants.ClassProp<
|
|
215
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
132
216
|
[x: string]: string | number | undefined;
|
|
133
217
|
[x: number]: string | number | undefined;
|
|
134
|
-
} & tailwind_variants.ClassProp<
|
|
218
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
135
219
|
[x: string]: string | number | undefined;
|
|
136
220
|
[x: number]: string | number | undefined;
|
|
137
|
-
} & tailwind_variants.ClassProp<
|
|
221
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
138
222
|
[x: string]: string | number | undefined;
|
|
139
223
|
[x: number]: string | number | undefined;
|
|
140
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
141
|
-
empty: (slotProps?: ({
|
|
224
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
225
|
+
empty: (slotProps?: ({
|
|
142
226
|
[x: string]: string | number | undefined;
|
|
143
227
|
[x: number]: string | number | undefined;
|
|
144
|
-
} & tailwind_variants.ClassProp<
|
|
228
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
145
229
|
[x: string]: string | number | undefined;
|
|
146
230
|
[x: number]: string | number | undefined;
|
|
147
|
-
} & tailwind_variants.ClassProp<
|
|
231
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
148
232
|
[x: string]: string | number | undefined;
|
|
149
233
|
[x: number]: string | number | undefined;
|
|
150
|
-
} & tailwind_variants.ClassProp<
|
|
234
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
151
235
|
[x: string]: string | number | undefined;
|
|
152
236
|
[x: number]: string | number | undefined;
|
|
153
|
-
} & tailwind_variants.ClassProp<
|
|
237
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
154
238
|
[x: string]: string | number | undefined;
|
|
155
239
|
[x: number]: string | number | undefined;
|
|
156
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
157
|
-
shortcut: (slotProps?: ({
|
|
240
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
241
|
+
shortcut: (slotProps?: ({
|
|
158
242
|
[x: string]: string | number | undefined;
|
|
159
243
|
[x: number]: string | number | undefined;
|
|
160
|
-
} & tailwind_variants.ClassProp<
|
|
244
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
161
245
|
[x: string]: string | number | undefined;
|
|
162
246
|
[x: number]: string | number | undefined;
|
|
163
|
-
} & tailwind_variants.ClassProp<
|
|
247
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
164
248
|
[x: string]: string | number | undefined;
|
|
165
249
|
[x: number]: string | number | undefined;
|
|
166
|
-
} & tailwind_variants.ClassProp<
|
|
250
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
167
251
|
[x: string]: string | number | undefined;
|
|
168
252
|
[x: number]: string | number | undefined;
|
|
169
|
-
} & tailwind_variants.ClassProp<
|
|
253
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
170
254
|
[x: string]: string | number | undefined;
|
|
171
255
|
[x: number]: string | number | undefined;
|
|
172
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
256
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
173
257
|
};
|
|
174
258
|
type CommandProps = React.ComponentPropsWithRef<typeof Command$1> & CommandBaseProps;
|
|
175
259
|
declare const Command: ({ className, classNames, unstyled, ...props }: CommandProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -177,19 +261,33 @@ type CommandDialogProps = Omit<DialogProps, "classNames"> & CommandBaseProps & {
|
|
|
177
261
|
className?: string;
|
|
178
262
|
};
|
|
179
263
|
declare const CommandDialog: ({ children, className, classNames, unstyled, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
|
|
180
|
-
type CommandInputProps = React.ComponentPropsWithRef<typeof Command$1.Input> &
|
|
264
|
+
type CommandInputProps = React.ComponentPropsWithRef<typeof Command$1.Input> & {
|
|
265
|
+
unstyled?: boolean;
|
|
266
|
+
};
|
|
181
267
|
declare const CommandInput: ({ className, unstyled, ...props }: CommandInputProps) => react_jsx_runtime.JSX.Element;
|
|
182
|
-
type CommandListProps = React.ComponentPropsWithRef<typeof Command$1.List> &
|
|
268
|
+
type CommandListProps = React.ComponentPropsWithRef<typeof Command$1.List> & {
|
|
269
|
+
unstyled?: boolean;
|
|
270
|
+
};
|
|
183
271
|
declare const CommandList: ({ className, unstyled, ...props }: CommandListProps) => react_jsx_runtime.JSX.Element;
|
|
184
|
-
type CommandEmptyProps = React.ComponentPropsWithRef<typeof Command$1.Empty> &
|
|
272
|
+
type CommandEmptyProps = React.ComponentPropsWithRef<typeof Command$1.Empty> & {
|
|
273
|
+
unstyled?: boolean;
|
|
274
|
+
};
|
|
185
275
|
declare const CommandEmpty: ({ unstyled, className, ...props }: CommandEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
186
|
-
type CommandGroupProps = React.ComponentPropsWithRef<typeof Command$1.Group> &
|
|
276
|
+
type CommandGroupProps = React.ComponentPropsWithRef<typeof Command$1.Group> & {
|
|
277
|
+
unstyled?: boolean;
|
|
278
|
+
};
|
|
187
279
|
declare const CommandGroup: ({ className, unstyled, ...props }: CommandGroupProps) => react_jsx_runtime.JSX.Element;
|
|
188
|
-
type CommandSeparatorProps = React.ComponentPropsWithRef<typeof Command$1.Separator> &
|
|
280
|
+
type CommandSeparatorProps = React.ComponentPropsWithRef<typeof Command$1.Separator> & {
|
|
281
|
+
unstyled?: boolean;
|
|
282
|
+
};
|
|
189
283
|
declare const CommandSeparator: ({ className, unstyled, ...props }: CommandSeparatorProps) => react_jsx_runtime.JSX.Element;
|
|
190
|
-
type CommandItemProps = React.ComponentPropsWithRef<typeof Command$1.Item> &
|
|
284
|
+
type CommandItemProps = React.ComponentPropsWithRef<typeof Command$1.Item> & {
|
|
285
|
+
unstyled?: boolean;
|
|
286
|
+
};
|
|
191
287
|
declare const CommandItem: ({ className, unstyled, ...props }: CommandItemProps) => react_jsx_runtime.JSX.Element;
|
|
192
|
-
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
288
|
+
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
289
|
+
unstyled?: boolean;
|
|
290
|
+
};
|
|
193
291
|
declare const CommandShortcut: ({ className, unstyled, ...props }: CommandShortcutProps) => react_jsx_runtime.JSX.Element;
|
|
194
292
|
|
|
195
|
-
export { Command, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, useCommandStyles };
|
|
293
|
+
export { Command, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, type CommandSlots, type CommandVariantProps, commandStyles, useCommandStyles };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/command.tsx
|
|
4
|
-
import { createTVUnstyledSlots } from "@mijn-ui/react-core";
|
|
5
|
-
import { Dialog, DialogContent } from "@mijn-ui/react-dialog";
|
|
6
|
-
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
7
4
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
createContext,
|
|
6
|
+
createTVUnstyledSlots,
|
|
7
|
+
useTVUnstyled
|
|
8
|
+
} from "@mijn-ui/react-core";
|
|
9
|
+
import { Dialog, DialogContent } from "@mijn-ui/react-dialog";
|
|
12
10
|
import { Command as CommandPrimitive } from "cmdk";
|
|
11
|
+
import { cnBase, tv } from "tailwind-variants";
|
|
13
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var commandStyles = tv({
|
|
14
|
+
slots: {
|
|
15
|
+
base: "border-outline-default bg-bg-default-alt text-fg-default flex size-full flex-col overflow-hidden rounded-md border",
|
|
16
|
+
dialogWrapper: "overflow-hidden p-0 shadow-lg",
|
|
17
|
+
dialog: "[&_[cmdk-group-heading]]:text-fg-tertiary [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5",
|
|
18
|
+
list: "max-h-[300px] overflow-y-auto overflow-x-hidden",
|
|
19
|
+
group: "text-fg-default [&_[cmdk-group-heading]]:text-fg-tertiary overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
20
|
+
separator: "bg-outline-default h-px -mx-1",
|
|
21
|
+
item: "data-[selected='true']:bg-bg-secondary relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-auto data-[disabled=true]:opacity-50",
|
|
22
|
+
input: "",
|
|
23
|
+
empty: "py-6 text-center text-sm",
|
|
24
|
+
shortcut: "text-fg-tertiary ml-auto text-xs tracking-widest"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
14
27
|
var [CommandProvider, useCommandContext] = createContext({
|
|
15
28
|
name: "CommandContext",
|
|
16
29
|
strict: true,
|
|
@@ -32,7 +45,7 @@ var Command = ({
|
|
|
32
45
|
return /* @__PURE__ */ jsx(CommandProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
|
|
33
46
|
CommandPrimitive,
|
|
34
47
|
{
|
|
35
|
-
className: base({ className:
|
|
48
|
+
className: base({ className: cnBase(classNames?.base, className) }),
|
|
36
49
|
...props
|
|
37
50
|
}
|
|
38
51
|
) });
|
|
@@ -56,13 +69,13 @@ var CommandDialog = ({
|
|
|
56
69
|
DialogContent,
|
|
57
70
|
{
|
|
58
71
|
className: dialogWrapper({
|
|
59
|
-
className:
|
|
72
|
+
className: cnBase(classNames?.dialogWrapper)
|
|
60
73
|
}),
|
|
61
74
|
children: /* @__PURE__ */ jsx(
|
|
62
75
|
Command,
|
|
63
76
|
{
|
|
64
77
|
className: dialog({
|
|
65
|
-
className:
|
|
78
|
+
className: cnBase(classNames?.dialog, className)
|
|
66
79
|
}),
|
|
67
80
|
children
|
|
68
81
|
}
|
|
@@ -76,7 +89,7 @@ var CommandInput = ({ className, unstyled, ...props }) => {
|
|
|
76
89
|
CommandPrimitive.Input,
|
|
77
90
|
{
|
|
78
91
|
className: input({
|
|
79
|
-
className:
|
|
92
|
+
className: cnBase(classNames?.input, className)
|
|
80
93
|
}),
|
|
81
94
|
...props
|
|
82
95
|
}
|
|
@@ -88,7 +101,7 @@ var CommandList = ({ className, unstyled, ...props }) => {
|
|
|
88
101
|
CommandPrimitive.List,
|
|
89
102
|
{
|
|
90
103
|
className: list({
|
|
91
|
-
className:
|
|
104
|
+
className: cnBase(classNames?.list, className)
|
|
92
105
|
}),
|
|
93
106
|
...props
|
|
94
107
|
}
|
|
@@ -100,7 +113,7 @@ var CommandEmpty = ({ unstyled, className, ...props }) => {
|
|
|
100
113
|
CommandPrimitive.Empty,
|
|
101
114
|
{
|
|
102
115
|
className: empty({
|
|
103
|
-
className:
|
|
116
|
+
className: cnBase(classNames?.empty, className)
|
|
104
117
|
}),
|
|
105
118
|
...props
|
|
106
119
|
}
|
|
@@ -112,7 +125,7 @@ var CommandGroup = ({ className, unstyled, ...props }) => {
|
|
|
112
125
|
CommandPrimitive.Group,
|
|
113
126
|
{
|
|
114
127
|
className: group({
|
|
115
|
-
className:
|
|
128
|
+
className: cnBase(classNames?.group, className)
|
|
116
129
|
}),
|
|
117
130
|
...props
|
|
118
131
|
}
|
|
@@ -128,7 +141,7 @@ var CommandSeparator = ({
|
|
|
128
141
|
CommandPrimitive.Separator,
|
|
129
142
|
{
|
|
130
143
|
className: separator({
|
|
131
|
-
className:
|
|
144
|
+
className: cnBase(classNames?.separator, className)
|
|
132
145
|
}),
|
|
133
146
|
...props
|
|
134
147
|
}
|
|
@@ -140,7 +153,7 @@ var CommandItem = ({ className, unstyled, ...props }) => {
|
|
|
140
153
|
CommandPrimitive.Item,
|
|
141
154
|
{
|
|
142
155
|
className: item({
|
|
143
|
-
className:
|
|
156
|
+
className: cnBase(classNames?.item, className)
|
|
144
157
|
}),
|
|
145
158
|
...props
|
|
146
159
|
}
|
|
@@ -156,7 +169,7 @@ var CommandShortcut = ({
|
|
|
156
169
|
"span",
|
|
157
170
|
{
|
|
158
171
|
className: shortcut({
|
|
159
|
-
className:
|
|
172
|
+
className: cnBase(classNames?.shortcut, className)
|
|
160
173
|
}),
|
|
161
174
|
...props
|
|
162
175
|
}
|
|
@@ -172,5 +185,6 @@ export {
|
|
|
172
185
|
CommandList,
|
|
173
186
|
CommandSeparator,
|
|
174
187
|
CommandShortcut,
|
|
188
|
+
commandStyles,
|
|
175
189
|
useCommandStyles
|
|
176
190
|
};
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/command.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/command.tsx":{"bytes":9714,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":26,"imports":[{"path":"src/command.tsx","kind":"import-statement","original":"./command"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut","commandStyles","useCommandStyles"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":5339},"src/index.ts":{"bytesInOutput":0}},"bytes":5566}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-command",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -26,23 +26,21 @@
|
|
|
26
26
|
"lucide-react": "^0.479.0",
|
|
27
27
|
"react": "19.0.0",
|
|
28
28
|
"react-dom": "19.0.0",
|
|
29
|
-
"@mijn-ui/react-core": "0.
|
|
30
|
-
"@mijn-ui/react-input": "0.
|
|
31
|
-
"@mijn-ui/react-theme": "0.2.0",
|
|
29
|
+
"@mijn-ui/react-core": "0.3.0",
|
|
30
|
+
"@mijn-ui/react-input": "0.3.0",
|
|
32
31
|
"eslint-config-custom": "0.0.1",
|
|
33
32
|
"tsconfig": "0.0.0",
|
|
34
33
|
"tsup-config": "0.0.0"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"cmdk": "^1.0.4",
|
|
38
|
-
"@mijn-ui/react-dialog": "0.
|
|
39
|
-
"@mijn-ui/react-hooks": "0.0.19",
|
|
40
|
-
"@mijn-ui/react-utilities": "0.0.9",
|
|
37
|
+
"@mijn-ui/react-dialog": "0.3.0",
|
|
41
38
|
"@mijn-ui/shared-icons": "0.1.0"
|
|
42
39
|
},
|
|
43
40
|
"peerDependencies": {
|
|
44
|
-
"@mijn-ui/react-core": "^0.
|
|
45
|
-
"
|
|
41
|
+
"@mijn-ui/react-core": "^0.3.0",
|
|
42
|
+
"tailwind-merge": "^3.0.0",
|
|
43
|
+
"tailwind-variants": "^3.0.0",
|
|
46
44
|
"react": "^19.0",
|
|
47
45
|
"react-dom": "^19.0"
|
|
48
46
|
},
|