@pixpilot/shadcn-ui 1.39.0 → 2.0.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/README.md +1 -0
- package/dist/ColorPicker/mcp.js +105 -0
- package/dist/ColorPickerBase/mcp.js +97 -0
- package/dist/absolute-fill/AbsoluteFill.d.cts +2 -2
- package/dist/absolute-fill/mcp.js +23 -0
- package/dist/alert/mcp.js +41 -0
- package/dist/avatar-upload/mcp.js +86 -0
- package/dist/button/Button.d.cts +2 -2
- package/dist/button/Button.d.ts +2 -2
- package/dist/button-extended/ButtonExtended.d.cts +2 -2
- package/dist/button-extended/ButtonExtended.d.ts +2 -2
- package/dist/button-extended/mcp.js +53 -0
- package/dist/button-group/mcp.js +28 -0
- package/dist/card/Card.d.cts +3 -3
- package/dist/circle-loader/mcp.js +48 -0
- package/dist/close-button-absolute/mcp.js +39 -0
- package/dist/close-button-rounded/mcp.js +39 -0
- package/dist/color-select/ColorSelect.cjs +2 -2
- package/dist/color-select/ColorSelect.d.cts +3 -2
- package/dist/color-select/ColorSelect.d.ts +1 -0
- package/dist/color-select/ColorSelect.js +3 -3
- package/dist/color-select/mcp.js +59 -0
- package/dist/combobox/Combobox.cjs +4 -3
- package/dist/combobox/Combobox.d.cts +7 -3
- package/dist/combobox/Combobox.d.ts +7 -3
- package/dist/combobox/Combobox.js +5 -4
- package/dist/combobox/mcp.js +64 -0
- package/dist/confirmation-dialog/mcp.js +55 -0
- package/dist/content-card/ContentCard.d.cts +2 -2
- package/dist/content-card/mcp.js +30 -0
- package/dist/date-picker/mcp.js +43 -0
- package/dist/dialog/mcp.js +53 -0
- package/dist/dialog-provider/mcp.js +24 -0
- package/dist/file-upload/FileUpload.d.cts +2 -2
- package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
- package/dist/file-upload-inline/mcp.js +89 -0
- package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
- package/dist/file-upload-root/mcp.js +84 -0
- package/dist/generated/mcp-registry.js +84 -6
- package/dist/icon-selector/IconPicker.cjs +2 -2
- package/dist/icon-selector/IconPicker.d.cts +1 -0
- package/dist/icon-selector/IconPicker.d.ts +1 -0
- package/dist/icon-selector/IconPicker.js +2 -2
- package/dist/icon-selector/mcp.js +60 -0
- package/dist/icon-toggle/mcp.js +62 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/input/Input.d.cts +2 -2
- package/dist/input/mcp.js +33 -0
- package/dist/layout/mcp.js +29 -0
- package/dist/loading-overlay/mcp.js +64 -0
- package/dist/pagination/mcp.js +65 -0
- package/dist/popover/mcp.js +27 -0
- package/dist/rating/Rating.d.cts +3 -3
- package/dist/rating/mcp.js +73 -0
- package/dist/rich-text-editor/mcp.js +78 -0
- package/dist/scaled-preview/mcp.js +47 -0
- package/dist/select/Select.cjs +4 -2
- package/dist/select/Select.d.cts +13 -4
- package/dist/select/Select.d.ts +11 -2
- package/dist/select/Select.js +4 -2
- package/dist/select/mcp.js +70 -0
- package/dist/slider/mcp.js +80 -0
- package/dist/tabs/mcp.js +51 -0
- package/dist/tags-input/TagsInput.cjs +67 -65
- package/dist/tags-input/TagsInput.d.cts +6 -33
- package/dist/tags-input/TagsInput.d.ts +5 -32
- package/dist/tags-input/TagsInput.js +68 -66
- package/dist/tags-input/TagsInputInline.d.cts +2 -2
- package/dist/tags-input/index.d.cts +2 -2
- package/dist/tags-input/index.d.ts +2 -2
- package/dist/tags-input/mcp.js +100 -0
- package/dist/theme-provider/mcp.js +57 -0
- package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
- package/dist/theme-toggle/mcp.js +38 -0
- package/dist/toast/mcp.js +52 -0
- package/dist/toggle-button/mcp.js +58 -0
- package/dist/toggle-group/mcp.js +67 -0
- package/dist/tooltip/mcp.js +24 -0
- package/package.json +4 -4
|
@@ -31,7 +31,8 @@ const EMPTY_OPTIONS = [];
|
|
|
31
31
|
* - Options support with dropdown (like Select)
|
|
32
32
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
33
33
|
*/
|
|
34
|
-
function TagsInput(
|
|
34
|
+
function TagsInput(props) {
|
|
35
|
+
const { id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate, addButtonVisibility = "touch",...restProps } = props;
|
|
35
36
|
const [open, setOpen] = (0, react.useState)(false);
|
|
36
37
|
const [searchValue, setSearchValue] = (0, react.useState)("");
|
|
37
38
|
const [freeInputValue, setFreeInputValue] = (0, react.useState)("");
|
|
@@ -135,6 +136,7 @@ function TagsInput({ id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS,
|
|
|
135
136
|
value
|
|
136
137
|
]);
|
|
137
138
|
if (!hasOptions) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TagsInputInline.TagsInputInline, {
|
|
139
|
+
...restProps,
|
|
138
140
|
id,
|
|
139
141
|
label,
|
|
140
142
|
className,
|
|
@@ -160,81 +162,81 @@ function TagsInput({ id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS,
|
|
|
160
162
|
onAddCurrentInput: handleAddCurrentInput,
|
|
161
163
|
showClear: value.length > 0 && !disabled && !readOnly
|
|
162
164
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
const showLabel = label !== void 0 && label !== "";
|
|
166
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(showLabel ? "div" : react.default.Fragment, {
|
|
167
|
+
...showLabel ? { className: (0, __pixpilot_shadcn.cn)("relative", className) } : {},
|
|
168
|
+
children: [showLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TagsInputInLineLabel, { children: label }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Popover, {
|
|
166
169
|
open: open && !disabled && !readOnly,
|
|
167
170
|
onOpenChange: setOpen,
|
|
168
171
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverTrigger, {
|
|
169
172
|
asChild: true,
|
|
170
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
e.stopPropagation();
|
|
190
|
-
setOpen(true);
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
inputRef,
|
|
194
|
-
inputPlaceholder: placeholder,
|
|
195
|
-
inputValue: searchValue,
|
|
196
|
-
onInputFocus: (e) => {
|
|
173
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TagsInputInline.TagsInputInline, {
|
|
174
|
+
...restProps,
|
|
175
|
+
className: (0, __pixpilot_shadcn.cn)("w-full", className),
|
|
176
|
+
id,
|
|
177
|
+
label,
|
|
178
|
+
showLabel: false,
|
|
179
|
+
disabled,
|
|
180
|
+
editable,
|
|
181
|
+
max: maxTags,
|
|
182
|
+
onValueChange: handleValueChange,
|
|
183
|
+
onValidate: handleValidate,
|
|
184
|
+
readOnly,
|
|
185
|
+
value: stringValues,
|
|
186
|
+
delimiter: freeSolo ? delimiter : void 0,
|
|
187
|
+
addOnPaste: freeSolo ? addOnPaste : false,
|
|
188
|
+
addOnTab: freeSolo ? addOnTab : false,
|
|
189
|
+
items: inlineItems,
|
|
190
|
+
onListClick: (e) => {
|
|
191
|
+
if (!disabled && !readOnly) {
|
|
197
192
|
e.stopPropagation();
|
|
198
193
|
setOpen(true);
|
|
199
|
-
}
|
|
200
|
-
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
inputRef,
|
|
197
|
+
inputPlaceholder: placeholder,
|
|
198
|
+
inputValue: searchValue,
|
|
199
|
+
onInputFocus: (e) => {
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
setOpen(true);
|
|
202
|
+
},
|
|
203
|
+
onInputChange: (e) => {
|
|
204
|
+
e.stopPropagation();
|
|
205
|
+
setSearchValue(e.target.value);
|
|
206
|
+
},
|
|
207
|
+
onInputKeyDown: (e) => {
|
|
208
|
+
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
209
|
+
e.preventDefault();
|
|
201
210
|
e.stopPropagation();
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
const command = document.querySelector("[cmdk-root]");
|
|
212
|
+
if (command) {
|
|
213
|
+
const event = new KeyboardEvent("keydown", {
|
|
214
|
+
key: e.key,
|
|
215
|
+
bubbles: true,
|
|
216
|
+
cancelable: true
|
|
217
|
+
});
|
|
218
|
+
command.dispatchEvent(event);
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (open && e.key === "Enter") {
|
|
223
|
+
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
224
|
+
if (selectedItem) {
|
|
206
225
|
e.preventDefault();
|
|
207
226
|
e.stopPropagation();
|
|
208
|
-
|
|
209
|
-
if (command) {
|
|
210
|
-
const event = new KeyboardEvent("keydown", {
|
|
211
|
-
key: e.key,
|
|
212
|
-
bubbles: true,
|
|
213
|
-
cancelable: true
|
|
214
|
-
});
|
|
215
|
-
command.dispatchEvent(event);
|
|
216
|
-
}
|
|
227
|
+
selectedItem.click();
|
|
217
228
|
return;
|
|
218
229
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
onInputMouseDown: (e) => {
|
|
231
|
-
e.stopPropagation();
|
|
232
|
-
},
|
|
233
|
-
addButtonVisibility,
|
|
234
|
-
canAddCurrentValue,
|
|
235
|
-
onAddCurrentInput: handleAddCurrentInput,
|
|
236
|
-
showClear: value.length > 0 && !disabled && !readOnly
|
|
237
|
-
})
|
|
230
|
+
}
|
|
231
|
+
e.stopPropagation();
|
|
232
|
+
},
|
|
233
|
+
onInputMouseDown: (e) => {
|
|
234
|
+
e.stopPropagation();
|
|
235
|
+
},
|
|
236
|
+
addButtonVisibility,
|
|
237
|
+
canAddCurrentValue,
|
|
238
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
239
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
238
240
|
})
|
|
239
241
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverContent, {
|
|
240
242
|
className: "p-0",
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { CommandOptionListItem } from "../command-option-list/CommandOptionList.cjs";
|
|
2
|
-
import
|
|
2
|
+
import { TagsInputInline } from "./TagsInputInline.cjs";
|
|
3
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
3
5
|
|
|
4
6
|
//#region src/tags-input/TagsInput.d.ts
|
|
5
|
-
interface TagsInputProps {
|
|
6
|
-
id?: string;
|
|
7
|
+
interface TagsInputProps extends Omit<ComponentProps<typeof TagsInputInline>, 'onChange' | 'value' | 'onValueChange' | 'onValidate' | 'items' | 'max' | 'inputRef' | 'inputPlaceholder' | 'inputValue' | 'onInputFocus' | 'onInputChange' | 'onInputKeyDown' | 'onInputMouseDown' | 'onListClick' | 'canAddCurrentValue' | 'onAddCurrentInput' | 'showClear'> {
|
|
7
8
|
value?: Array<string | number>;
|
|
8
9
|
onChange?: (value: Array<string | number>) => void;
|
|
9
10
|
options?: CommandOptionListItem[];
|
|
10
11
|
freeSolo?: boolean;
|
|
12
|
+
/** Placeholder for the tag input field. */
|
|
11
13
|
placeholder?: string;
|
|
12
14
|
emptyText?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
readOnly?: boolean;
|
|
16
15
|
maxTags?: number;
|
|
17
16
|
allowDuplicates?: boolean;
|
|
18
|
-
editable?: boolean;
|
|
19
|
-
label?: string;
|
|
20
|
-
delimiter?: string;
|
|
21
|
-
addOnPaste?: boolean;
|
|
22
|
-
addOnTab?: boolean;
|
|
23
17
|
onValidate?: (value: string) => boolean;
|
|
24
|
-
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
25
18
|
}
|
|
26
19
|
/**
|
|
27
20
|
* TagsInput component - Inline tags input based on DiceUI
|
|
@@ -39,26 +32,6 @@ interface TagsInputProps {
|
|
|
39
32
|
* - Options support with dropdown (like Select)
|
|
40
33
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
41
34
|
*/
|
|
42
|
-
declare function TagsInput(
|
|
43
|
-
id,
|
|
44
|
-
value,
|
|
45
|
-
onChange,
|
|
46
|
-
options,
|
|
47
|
-
freeSolo,
|
|
48
|
-
placeholder,
|
|
49
|
-
emptyText,
|
|
50
|
-
className,
|
|
51
|
-
disabled,
|
|
52
|
-
readOnly,
|
|
53
|
-
maxTags,
|
|
54
|
-
allowDuplicates,
|
|
55
|
-
editable,
|
|
56
|
-
label,
|
|
57
|
-
delimiter,
|
|
58
|
-
addOnPaste,
|
|
59
|
-
addOnTab,
|
|
60
|
-
onValidate,
|
|
61
|
-
addButtonVisibility
|
|
62
|
-
}: TagsInputProps): react_jsx_runtime23.JSX.Element;
|
|
35
|
+
declare function TagsInput(props: TagsInputProps): react_jsx_runtime17.JSX.Element;
|
|
63
36
|
//#endregion
|
|
64
37
|
export { TagsInput, TagsInputProps };
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { CommandOptionListItem } from "../command-option-list/CommandOptionList.js";
|
|
2
|
+
import { TagsInputInline } from "./TagsInputInline.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
2
4
|
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
5
|
|
|
4
6
|
//#region src/tags-input/TagsInput.d.ts
|
|
5
|
-
interface TagsInputProps {
|
|
6
|
-
id?: string;
|
|
7
|
+
interface TagsInputProps extends Omit<ComponentProps<typeof TagsInputInline>, 'onChange' | 'value' | 'onValueChange' | 'onValidate' | 'items' | 'max' | 'inputRef' | 'inputPlaceholder' | 'inputValue' | 'onInputFocus' | 'onInputChange' | 'onInputKeyDown' | 'onInputMouseDown' | 'onListClick' | 'canAddCurrentValue' | 'onAddCurrentInput' | 'showClear'> {
|
|
7
8
|
value?: Array<string | number>;
|
|
8
9
|
onChange?: (value: Array<string | number>) => void;
|
|
9
10
|
options?: CommandOptionListItem[];
|
|
10
11
|
freeSolo?: boolean;
|
|
12
|
+
/** Placeholder for the tag input field. */
|
|
11
13
|
placeholder?: string;
|
|
12
14
|
emptyText?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
readOnly?: boolean;
|
|
16
15
|
maxTags?: number;
|
|
17
16
|
allowDuplicates?: boolean;
|
|
18
|
-
editable?: boolean;
|
|
19
|
-
label?: string;
|
|
20
|
-
delimiter?: string;
|
|
21
|
-
addOnPaste?: boolean;
|
|
22
|
-
addOnTab?: boolean;
|
|
23
17
|
onValidate?: (value: string) => boolean;
|
|
24
|
-
addButtonVisibility?: 'always' | 'touch' | 'never';
|
|
25
18
|
}
|
|
26
19
|
/**
|
|
27
20
|
* TagsInput component - Inline tags input based on DiceUI
|
|
@@ -39,26 +32,6 @@ interface TagsInputProps {
|
|
|
39
32
|
* - Options support with dropdown (like Select)
|
|
40
33
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
41
34
|
*/
|
|
42
|
-
declare function TagsInput(
|
|
43
|
-
id,
|
|
44
|
-
value,
|
|
45
|
-
onChange,
|
|
46
|
-
options,
|
|
47
|
-
freeSolo,
|
|
48
|
-
placeholder,
|
|
49
|
-
emptyText,
|
|
50
|
-
className,
|
|
51
|
-
disabled,
|
|
52
|
-
readOnly,
|
|
53
|
-
maxTags,
|
|
54
|
-
allowDuplicates,
|
|
55
|
-
editable,
|
|
56
|
-
label,
|
|
57
|
-
delimiter,
|
|
58
|
-
addOnPaste,
|
|
59
|
-
addOnTab,
|
|
60
|
-
onValidate,
|
|
61
|
-
addButtonVisibility
|
|
62
|
-
}: TagsInputProps): react_jsx_runtime19.JSX.Element;
|
|
35
|
+
declare function TagsInput(props: TagsInputProps): react_jsx_runtime19.JSX.Element;
|
|
63
36
|
//#endregion
|
|
64
37
|
export { TagsInput, TagsInputProps };
|
|
@@ -5,7 +5,7 @@ import { CommandOptionList } from "../command-option-list/CommandOptionList.js";
|
|
|
5
5
|
import "../command-option-list/index.js";
|
|
6
6
|
import { TagsInputInline } from "./TagsInputInline.js";
|
|
7
7
|
import { Command, Popover, PopoverContent, PopoverTrigger, TagsInputInLineLabel, cn } from "@pixpilot/shadcn";
|
|
8
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region src/tags-input/TagsInput.tsx
|
|
@@ -27,7 +27,8 @@ const EMPTY_OPTIONS = [];
|
|
|
27
27
|
* - Options support with dropdown (like Select)
|
|
28
28
|
* - freeSolo mode for custom tags (like MUI Autocomplete)
|
|
29
29
|
*/
|
|
30
|
-
function TagsInput(
|
|
30
|
+
function TagsInput(props) {
|
|
31
|
+
const { id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS, freeSolo = true, placeholder = "Add tags...", emptyText = "No options found.", className, disabled = false, readOnly = false, maxTags, allowDuplicates = false, editable = false, label, delimiter = ",", addOnPaste = true, addOnTab = true, onValidate, addButtonVisibility = "touch",...restProps } = props;
|
|
31
32
|
const [open, setOpen] = useState(false);
|
|
32
33
|
const [searchValue, setSearchValue] = useState("");
|
|
33
34
|
const [freeInputValue, setFreeInputValue] = useState("");
|
|
@@ -131,6 +132,7 @@ function TagsInput({ id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS,
|
|
|
131
132
|
value
|
|
132
133
|
]);
|
|
133
134
|
if (!hasOptions) return /* @__PURE__ */ jsx(TagsInputInline, {
|
|
135
|
+
...restProps,
|
|
134
136
|
id,
|
|
135
137
|
label,
|
|
136
138
|
className,
|
|
@@ -156,81 +158,81 @@ function TagsInput({ id, value = EMPTY_ARRAY, onChange, options = EMPTY_OPTIONS,
|
|
|
156
158
|
onAddCurrentInput: handleAddCurrentInput,
|
|
157
159
|
showClear: value.length > 0 && !disabled && !readOnly
|
|
158
160
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
const showLabel = label !== void 0 && label !== "";
|
|
162
|
+
return /* @__PURE__ */ jsxs(showLabel ? "div" : React.Fragment, {
|
|
163
|
+
...showLabel ? { className: cn("relative", className) } : {},
|
|
164
|
+
children: [showLabel ? /* @__PURE__ */ jsx(TagsInputInLineLabel, { children: label }) : null, /* @__PURE__ */ jsxs(Popover, {
|
|
162
165
|
open: open && !disabled && !readOnly,
|
|
163
166
|
onOpenChange: setOpen,
|
|
164
167
|
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
165
168
|
asChild: true,
|
|
166
|
-
children: /* @__PURE__ */ jsx(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
e.stopPropagation();
|
|
186
|
-
setOpen(true);
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
inputRef,
|
|
190
|
-
inputPlaceholder: placeholder,
|
|
191
|
-
inputValue: searchValue,
|
|
192
|
-
onInputFocus: (e) => {
|
|
169
|
+
children: /* @__PURE__ */ jsx(TagsInputInline, {
|
|
170
|
+
...restProps,
|
|
171
|
+
className: cn("w-full", className),
|
|
172
|
+
id,
|
|
173
|
+
label,
|
|
174
|
+
showLabel: false,
|
|
175
|
+
disabled,
|
|
176
|
+
editable,
|
|
177
|
+
max: maxTags,
|
|
178
|
+
onValueChange: handleValueChange,
|
|
179
|
+
onValidate: handleValidate,
|
|
180
|
+
readOnly,
|
|
181
|
+
value: stringValues,
|
|
182
|
+
delimiter: freeSolo ? delimiter : void 0,
|
|
183
|
+
addOnPaste: freeSolo ? addOnPaste : false,
|
|
184
|
+
addOnTab: freeSolo ? addOnTab : false,
|
|
185
|
+
items: inlineItems,
|
|
186
|
+
onListClick: (e) => {
|
|
187
|
+
if (!disabled && !readOnly) {
|
|
193
188
|
e.stopPropagation();
|
|
194
189
|
setOpen(true);
|
|
195
|
-
}
|
|
196
|
-
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
inputRef,
|
|
193
|
+
inputPlaceholder: placeholder,
|
|
194
|
+
inputValue: searchValue,
|
|
195
|
+
onInputFocus: (e) => {
|
|
196
|
+
e.stopPropagation();
|
|
197
|
+
setOpen(true);
|
|
198
|
+
},
|
|
199
|
+
onInputChange: (e) => {
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
setSearchValue(e.target.value);
|
|
202
|
+
},
|
|
203
|
+
onInputKeyDown: (e) => {
|
|
204
|
+
if (open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
205
|
+
e.preventDefault();
|
|
197
206
|
e.stopPropagation();
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
207
|
+
const command = document.querySelector("[cmdk-root]");
|
|
208
|
+
if (command) {
|
|
209
|
+
const event = new KeyboardEvent("keydown", {
|
|
210
|
+
key: e.key,
|
|
211
|
+
bubbles: true,
|
|
212
|
+
cancelable: true
|
|
213
|
+
});
|
|
214
|
+
command.dispatchEvent(event);
|
|
215
|
+
}
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (open && e.key === "Enter") {
|
|
219
|
+
const selectedItem = document.querySelector("[cmdk-item][data-selected=\"true\"]");
|
|
220
|
+
if (selectedItem) {
|
|
202
221
|
e.preventDefault();
|
|
203
222
|
e.stopPropagation();
|
|
204
|
-
|
|
205
|
-
if (command) {
|
|
206
|
-
const event = new KeyboardEvent("keydown", {
|
|
207
|
-
key: e.key,
|
|
208
|
-
bubbles: true,
|
|
209
|
-
cancelable: true
|
|
210
|
-
});
|
|
211
|
-
command.dispatchEvent(event);
|
|
212
|
-
}
|
|
223
|
+
selectedItem.click();
|
|
213
224
|
return;
|
|
214
225
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
onInputMouseDown: (e) => {
|
|
227
|
-
e.stopPropagation();
|
|
228
|
-
},
|
|
229
|
-
addButtonVisibility,
|
|
230
|
-
canAddCurrentValue,
|
|
231
|
-
onAddCurrentInput: handleAddCurrentInput,
|
|
232
|
-
showClear: value.length > 0 && !disabled && !readOnly
|
|
233
|
-
})
|
|
226
|
+
}
|
|
227
|
+
e.stopPropagation();
|
|
228
|
+
},
|
|
229
|
+
onInputMouseDown: (e) => {
|
|
230
|
+
e.stopPropagation();
|
|
231
|
+
},
|
|
232
|
+
addButtonVisibility,
|
|
233
|
+
canAddCurrentValue,
|
|
234
|
+
onAddCurrentInput: handleAddCurrentInput,
|
|
235
|
+
showClear: value.length > 0 && !disabled && !readOnly
|
|
234
236
|
})
|
|
235
237
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
236
238
|
className: "p-0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/tags-input/TagsInputInline.d.ts
|
|
@@ -77,6 +77,6 @@ declare function TagsInputInline({
|
|
|
77
77
|
canAddCurrentValue,
|
|
78
78
|
onAddCurrentInput,
|
|
79
79
|
showClear
|
|
80
|
-
}: TagsInputInlineProps):
|
|
80
|
+
}: TagsInputInlineProps): react_jsx_runtime18.JSX.Element;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps } from "./TagsInputInline.cjs";
|
|
2
|
+
import { TagsInput, TagsInputProps } from "./TagsInput.cjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps } from "./TagsInputInline.js";
|
|
2
|
+
import { TagsInput, TagsInputProps } from "./TagsInput.js";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/tags-input/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "TagsInput",
|
|
6
|
+
category: "Forms",
|
|
7
|
+
description: "An inline tags/multi-select input supporting free-text tags, an optional options dropdown, validation, paste parsing, and per-tag editing.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
id: "Optional id attribute applied to the input element.",
|
|
10
|
+
className: "Additional CSS class applied to the input wrapper.",
|
|
11
|
+
value: {
|
|
12
|
+
description: "Controlled list of tag values.",
|
|
13
|
+
type: "Array<string | number>"
|
|
14
|
+
},
|
|
15
|
+
onChange: {
|
|
16
|
+
description: "Called with the new list of tags when they change.",
|
|
17
|
+
type: "(value: Array<string | number>) => void"
|
|
18
|
+
},
|
|
19
|
+
options: "Optional selectable options as `{ label, value }[]`. When provided, a dropdown is shown.",
|
|
20
|
+
freeSolo: {
|
|
21
|
+
description: "Allows arbitrary tags not present in `options` (MUI Autocomplete style).",
|
|
22
|
+
type: "boolean",
|
|
23
|
+
defaultValue: "true"
|
|
24
|
+
},
|
|
25
|
+
placeholder: {
|
|
26
|
+
description: "Placeholder for the tag input.",
|
|
27
|
+
type: "string",
|
|
28
|
+
defaultValue: "\"Add tags...\""
|
|
29
|
+
},
|
|
30
|
+
emptyText: {
|
|
31
|
+
description: "Message shown when the options dropdown has no matches.",
|
|
32
|
+
type: "string",
|
|
33
|
+
defaultValue: "\"No options found.\""
|
|
34
|
+
},
|
|
35
|
+
disabled: "Disables the input.",
|
|
36
|
+
readOnly: "Renders tags without allowing edits.",
|
|
37
|
+
maxTags: "Maximum number of tags allowed.",
|
|
38
|
+
allowDuplicates: {
|
|
39
|
+
description: "Allows the same tag value to be added more than once.",
|
|
40
|
+
type: "boolean",
|
|
41
|
+
defaultValue: "false"
|
|
42
|
+
},
|
|
43
|
+
editable: {
|
|
44
|
+
description: "Allows editing an existing tag inline.",
|
|
45
|
+
type: "boolean",
|
|
46
|
+
defaultValue: "false"
|
|
47
|
+
},
|
|
48
|
+
label: "Optional label rendered above the input.",
|
|
49
|
+
showLabel: {
|
|
50
|
+
description: "Hides the label element while keeping the `label` value available.",
|
|
51
|
+
type: "boolean",
|
|
52
|
+
defaultValue: "true"
|
|
53
|
+
},
|
|
54
|
+
slots: {
|
|
55
|
+
description: "Per-part prop overrides for the inline input, e.g. `{ list, label, item, input, addButton, clear }`.",
|
|
56
|
+
type: "{ list?: { className?: string }; label?: object; item?: object; input?: object; addButton?: { className?: string }; clear?: object }"
|
|
57
|
+
},
|
|
58
|
+
delimiter: {
|
|
59
|
+
description: "Character that splits pasted or typed text into multiple tags.",
|
|
60
|
+
type: "string",
|
|
61
|
+
defaultValue: "\",\""
|
|
62
|
+
},
|
|
63
|
+
addOnPaste: {
|
|
64
|
+
description: "Adds tags when pasting delimited text.",
|
|
65
|
+
type: "boolean",
|
|
66
|
+
defaultValue: "true"
|
|
67
|
+
},
|
|
68
|
+
addOnTab: {
|
|
69
|
+
description: "Commits the current input as a tag when pressing Tab.",
|
|
70
|
+
type: "boolean",
|
|
71
|
+
defaultValue: "true"
|
|
72
|
+
},
|
|
73
|
+
onValidate: {
|
|
74
|
+
description: "Custom validator returning false to reject a candidate tag.",
|
|
75
|
+
type: "(value: string) => boolean"
|
|
76
|
+
},
|
|
77
|
+
addButtonVisibility: {
|
|
78
|
+
description: "When the inline add button is shown.",
|
|
79
|
+
type: "\"always\" | \"touch\" | \"never\"",
|
|
80
|
+
defaultValue: "\"touch\""
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
examples: [{
|
|
84
|
+
title: "Free-text tags",
|
|
85
|
+
code: "<TagsInput value={tags} onChange={setTags} placeholder=\"Add tags…\" />"
|
|
86
|
+
}, {
|
|
87
|
+
title: "With options",
|
|
88
|
+
code: "<TagsInput value={tags} onChange={setTags} options={options} freeSolo={false} />"
|
|
89
|
+
}],
|
|
90
|
+
keywords: [
|
|
91
|
+
"tags",
|
|
92
|
+
"input",
|
|
93
|
+
"multi-select",
|
|
94
|
+
"chips",
|
|
95
|
+
"form"
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
export { meta };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/theme-provider/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "ThemeProvider",
|
|
6
|
+
category: "Utilities",
|
|
7
|
+
description: "A thin wrapper around the next-themes ThemeProvider preconfigured for class-based theming with system detection.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
children: "Application subtree that reads the current theme.",
|
|
10
|
+
attribute: {
|
|
11
|
+
description: "How the theme is applied to the html element.",
|
|
12
|
+
type: "string | string[]",
|
|
13
|
+
defaultValue: "\"class\""
|
|
14
|
+
},
|
|
15
|
+
defaultTheme: {
|
|
16
|
+
description: "Theme used when none is stored.",
|
|
17
|
+
type: "string",
|
|
18
|
+
defaultValue: "\"system\""
|
|
19
|
+
},
|
|
20
|
+
enableSystem: {
|
|
21
|
+
description: "Whether to follow the OS color-scheme preference.",
|
|
22
|
+
type: "boolean",
|
|
23
|
+
defaultValue: "true"
|
|
24
|
+
},
|
|
25
|
+
storageKey: "localStorage key used to persist the selected theme.",
|
|
26
|
+
themes: "List of available theme names.",
|
|
27
|
+
forcedTheme: "Forces a specific theme for the subtree, ignoring stored and system preferences.",
|
|
28
|
+
disableTransitionOnChange: {
|
|
29
|
+
description: "Disables CSS transitions while switching themes to avoid flashes.",
|
|
30
|
+
type: "boolean",
|
|
31
|
+
defaultValue: "false"
|
|
32
|
+
},
|
|
33
|
+
enableColorScheme: {
|
|
34
|
+
description: "Whether to set the `color-scheme` style so native UI (scrollbars, inputs) matches.",
|
|
35
|
+
type: "boolean",
|
|
36
|
+
defaultValue: "true"
|
|
37
|
+
},
|
|
38
|
+
value: "Mapping of theme name to the value written to the DOM attribute.",
|
|
39
|
+
nonce: "CSP nonce applied to the injected theme script.",
|
|
40
|
+
scriptProps: "Extra props spread onto the injected theme <script> tag."
|
|
41
|
+
}),
|
|
42
|
+
notes: ["All other next-themes ThemeProvider props are forwarded."],
|
|
43
|
+
examples: [{
|
|
44
|
+
title: "Wrap the app",
|
|
45
|
+
code: "<ThemeProvider>\n <App />\n</ThemeProvider>"
|
|
46
|
+
}],
|
|
47
|
+
related: ["ThemeModeToggleButton"],
|
|
48
|
+
keywords: [
|
|
49
|
+
"theme",
|
|
50
|
+
"dark mode",
|
|
51
|
+
"provider",
|
|
52
|
+
"next-themes"
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { meta };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeToggleButton.d.ts
|
|
4
4
|
interface ThemeModeToggleButtonProps {
|
|
@@ -14,7 +14,7 @@ interface ThemeModeToggleButtonProps {
|
|
|
14
14
|
* Light/Dark toggle button.
|
|
15
15
|
* Pure component - toggles between light and dark.
|
|
16
16
|
*/
|
|
17
|
-
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps):
|
|
17
|
+
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime22.JSX.Element;
|
|
18
18
|
declare namespace ThemeModeToggleButton {
|
|
19
19
|
var displayName: string;
|
|
20
20
|
}
|