@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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/pagination/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Pagination",
|
|
6
|
+
category: "Navigation",
|
|
7
|
+
description: "A page navigation control with full, simple, and compact variants, ellipsis handling, and optional page-info text.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
id: "Optional id attribute applied to the pagination navigation element.",
|
|
10
|
+
className: "Additional CSS class applied to the pagination navigation element.",
|
|
11
|
+
page: {
|
|
12
|
+
description: "Current page number (1-indexed).",
|
|
13
|
+
type: "number"
|
|
14
|
+
},
|
|
15
|
+
totalPages: {
|
|
16
|
+
description: "Total number of pages. The component renders nothing when this is <= 1.",
|
|
17
|
+
type: "number"
|
|
18
|
+
},
|
|
19
|
+
onPageChange: {
|
|
20
|
+
description: "Called with the event and the next page number when a page is selected.",
|
|
21
|
+
type: "(event: React.ChangeEvent<unknown>, page: number) => void"
|
|
22
|
+
},
|
|
23
|
+
maxVisiblePages: {
|
|
24
|
+
description: "Maximum page numbers to display before using ellipsis. Set to 0 to show only prev/next.",
|
|
25
|
+
type: "number",
|
|
26
|
+
defaultValue: "4"
|
|
27
|
+
},
|
|
28
|
+
variant: {
|
|
29
|
+
description: "Layout style: \"full\" (numbers), \"simple\" (prev/next only), or \"compact\" (page indicator with all nav buttons).",
|
|
30
|
+
type: "\"full\" | \"simple\" | \"compact\"",
|
|
31
|
+
defaultValue: "\"full\""
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
description: "Size of the pagination control.",
|
|
35
|
+
type: "\"small\" | \"medium\" | \"large\"",
|
|
36
|
+
defaultValue: "\"medium\""
|
|
37
|
+
},
|
|
38
|
+
showFirstLastButtons: {
|
|
39
|
+
description: "Whether to show first/last page buttons.",
|
|
40
|
+
type: "boolean",
|
|
41
|
+
defaultValue: "true"
|
|
42
|
+
},
|
|
43
|
+
showPageInfo: {
|
|
44
|
+
description: "Whether to show \"Page X of Y\" text (used with the \"simple\" variant).",
|
|
45
|
+
type: "boolean",
|
|
46
|
+
defaultValue: "false"
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
examples: [{
|
|
50
|
+
title: "Full pagination",
|
|
51
|
+
code: "<Pagination page={page} totalPages={10} onPageChange={(_, next) => setPage(next)} />"
|
|
52
|
+
}, {
|
|
53
|
+
title: "Compact pagination",
|
|
54
|
+
code: "<Pagination page={page} totalPages={10} onPageChange={(_, next) => setPage(next)} variant=\"compact\" />"
|
|
55
|
+
}],
|
|
56
|
+
keywords: [
|
|
57
|
+
"pagination",
|
|
58
|
+
"pager",
|
|
59
|
+
"pages",
|
|
60
|
+
"navigation"
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { meta };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/popover/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Popover",
|
|
6
|
+
category: "Overlays",
|
|
7
|
+
description: "A floating popover built on Radix, composed of Popover, PopoverTrigger, and PopoverContent, with content pre-sized to the available viewport space and a styleless PopoverContentUnstyled variant.",
|
|
8
|
+
props: defineProps({}),
|
|
9
|
+
examples: [{
|
|
10
|
+
title: "Basic popover",
|
|
11
|
+
code: "<Popover>\n <PopoverTrigger asChild><Button variant=\"outline\">Open</Button></PopoverTrigger>\n <PopoverContent>Popover body</PopoverContent>\n</Popover>"
|
|
12
|
+
}, {
|
|
13
|
+
title: "Unstyled content",
|
|
14
|
+
code: "<Popover>\n <PopoverTrigger>Open</PopoverTrigger>\n <PopoverContentUnstyled>{custom}</PopoverContentUnstyled>\n</Popover>"
|
|
15
|
+
}],
|
|
16
|
+
notes: ["PopoverContent forwards all Radix PopoverContent props (align, side, sideOffset, etc.)."],
|
|
17
|
+
related: ["Combobox", "Tooltip"],
|
|
18
|
+
keywords: [
|
|
19
|
+
"popover",
|
|
20
|
+
"overlay",
|
|
21
|
+
"floating",
|
|
22
|
+
"dropdown"
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { meta };
|
package/dist/rating/Rating.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -35,7 +35,7 @@ declare function RatingButton({
|
|
|
35
35
|
index,
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: RatingButtonProps):
|
|
38
|
+
}: RatingButtonProps): react_jsx_runtime14.JSX.Element;
|
|
39
39
|
declare function Rating({
|
|
40
40
|
value: valueProp,
|
|
41
41
|
defaultValue,
|
|
@@ -53,6 +53,6 @@ declare function Rating({
|
|
|
53
53
|
children,
|
|
54
54
|
id,
|
|
55
55
|
...props
|
|
56
|
-
}: React$1.PropsWithChildren<RatingProps>):
|
|
56
|
+
}: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime14.JSX.Element;
|
|
57
57
|
//#endregion
|
|
58
58
|
export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/rating/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Rating",
|
|
6
|
+
category: "Forms",
|
|
7
|
+
description: "An accessible star/circle rating input supporting controlled or uncontrolled value, hover preview, keyboard navigation, and a hidden form field.",
|
|
8
|
+
htmlElement: "div",
|
|
9
|
+
props: defineProps({
|
|
10
|
+
value: {
|
|
11
|
+
description: "Controlled rating value.",
|
|
12
|
+
type: "number"
|
|
13
|
+
},
|
|
14
|
+
defaultValue: {
|
|
15
|
+
description: "Initial value when uncontrolled.",
|
|
16
|
+
type: "number"
|
|
17
|
+
},
|
|
18
|
+
onValueChange: {
|
|
19
|
+
description: "Called with the new rating value when the selection changes.",
|
|
20
|
+
type: "(value: number) => void"
|
|
21
|
+
},
|
|
22
|
+
max: {
|
|
23
|
+
description: "Number of rating items when `options` is not provided.",
|
|
24
|
+
type: "number",
|
|
25
|
+
defaultValue: "5"
|
|
26
|
+
},
|
|
27
|
+
options: "Explicit rating items as `{ label, value }[]`; overrides `max` and provides accessible labels.",
|
|
28
|
+
iconType: {
|
|
29
|
+
description: "Glyph used for each rating item.",
|
|
30
|
+
type: "\"star\" | \"circle\"",
|
|
31
|
+
defaultValue: "\"star\""
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
description: "Icon size.",
|
|
35
|
+
type: "\"sm\" | \"default\" | \"lg\" | \"xl\"",
|
|
36
|
+
defaultValue: "\"default\""
|
|
37
|
+
},
|
|
38
|
+
readOnly: {
|
|
39
|
+
description: "Renders the rating as non-interactive display only.",
|
|
40
|
+
type: "boolean",
|
|
41
|
+
defaultValue: "false"
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
description: "Disables interaction and dims the control.",
|
|
45
|
+
type: "boolean",
|
|
46
|
+
defaultValue: "false"
|
|
47
|
+
},
|
|
48
|
+
name: "Name for the hidden input, so the value participates in native form submission.",
|
|
49
|
+
required: "Marks the hidden form input as required.",
|
|
50
|
+
color: {
|
|
51
|
+
description: "Color theme applied to the filled icons.",
|
|
52
|
+
type: "\"default\" | \"primary\" | \"secondary\" | \"destructive\" | \"foreground\" | \"accent\" | \"muted\" | \"ring\"",
|
|
53
|
+
defaultValue: "\"default\""
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
examples: [{
|
|
57
|
+
title: "Controlled rating",
|
|
58
|
+
code: "<Rating value={rating} onValueChange={setRating} max={5} />"
|
|
59
|
+
}, {
|
|
60
|
+
title: "Read-only circles",
|
|
61
|
+
code: "<Rating value={4} readOnly iconType=\"circle\" color=\"primary\" />"
|
|
62
|
+
}],
|
|
63
|
+
keywords: [
|
|
64
|
+
"rating",
|
|
65
|
+
"stars",
|
|
66
|
+
"review",
|
|
67
|
+
"score",
|
|
68
|
+
"form"
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { meta };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/rich-text-editor/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "RichTextEditor",
|
|
6
|
+
category: "Forms",
|
|
7
|
+
description: "A TipTap-based WYSIWYG editor with a configurable toolbar (bold, italic, headings, lists, links, alignment, code) that reads and writes HTML.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
value: {
|
|
10
|
+
description: "HTML content of the editor (React-style value, mapped to TipTap content).",
|
|
11
|
+
type: "string"
|
|
12
|
+
},
|
|
13
|
+
onChange: {
|
|
14
|
+
description: "Called with the editor HTML whenever the content changes.",
|
|
15
|
+
type: "(content: string) => void"
|
|
16
|
+
},
|
|
17
|
+
editable: {
|
|
18
|
+
description: "Whether the editor accepts input.",
|
|
19
|
+
type: "boolean",
|
|
20
|
+
defaultValue: "true"
|
|
21
|
+
},
|
|
22
|
+
showToolbar: {
|
|
23
|
+
description: "Whether the formatting toolbar is shown.",
|
|
24
|
+
type: "boolean",
|
|
25
|
+
defaultValue: "true"
|
|
26
|
+
},
|
|
27
|
+
toolbarItems: "Explicit toolbar items: predefined command strings, \"|\" separators, or custom button objects.",
|
|
28
|
+
extensions: "Additional TipTap extensions to add to the editor.",
|
|
29
|
+
editorProps: "Custom TipTap editorProps merged into the defaults.",
|
|
30
|
+
slots: "Class overrides for the root, toolbar (and its buttons/separators), and content area.",
|
|
31
|
+
placeholder: "Placeholder text shown when the editor is empty.",
|
|
32
|
+
tooltipMode: {
|
|
33
|
+
description: "How toolbar button tooltips are rendered.",
|
|
34
|
+
type: "ToolbarButtonTooltipMode",
|
|
35
|
+
defaultValue: "\"native\""
|
|
36
|
+
},
|
|
37
|
+
immediatelyRender: {
|
|
38
|
+
description: "Render the editor immediately on mount (helps with SSR/hydration).",
|
|
39
|
+
type: "boolean",
|
|
40
|
+
defaultValue: "false"
|
|
41
|
+
},
|
|
42
|
+
allowLinkTarget: {
|
|
43
|
+
description: "Whether the link popover exposes target controls.",
|
|
44
|
+
type: "boolean",
|
|
45
|
+
defaultValue: "false"
|
|
46
|
+
},
|
|
47
|
+
openOnClick: {
|
|
48
|
+
description: "Whether clicking a link opens it inside the editor.",
|
|
49
|
+
type: "boolean",
|
|
50
|
+
defaultValue: "false"
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
dependencies: [{
|
|
54
|
+
name: "@tiptap/react",
|
|
55
|
+
type: "peer"
|
|
56
|
+
}, {
|
|
57
|
+
name: "@tiptap/starter-kit",
|
|
58
|
+
type: "peer"
|
|
59
|
+
}],
|
|
60
|
+
examples: [{
|
|
61
|
+
title: "Basic editor",
|
|
62
|
+
code: "<RichTextEditor value={html} onChange={setHtml} placeholder=\"Write something…\" />"
|
|
63
|
+
}, {
|
|
64
|
+
title: "Custom toolbar",
|
|
65
|
+
code: "<RichTextEditor value={html} onChange={setHtml} toolbarItems={[\"bold\", \"italic\", \"|\", \"bulletList\"]} />"
|
|
66
|
+
}],
|
|
67
|
+
keywords: [
|
|
68
|
+
"rich text",
|
|
69
|
+
"editor",
|
|
70
|
+
"wysiwyg",
|
|
71
|
+
"tiptap",
|
|
72
|
+
"html",
|
|
73
|
+
"form"
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { meta };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/scaled-preview/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "ScaledPreview",
|
|
6
|
+
category: "Layout",
|
|
7
|
+
description: "Renders fixed-size content scaled to fit a smaller preview box, keeping the content centered — useful for thumbnails and design previews.",
|
|
8
|
+
htmlElement: "div",
|
|
9
|
+
props: defineProps({
|
|
10
|
+
scaleFactor: {
|
|
11
|
+
description: "Scale factor for the preview box relative to baseSize (e.g. 0.5 = 50%). Ignored when previewBoxSize is set.",
|
|
12
|
+
type: "number"
|
|
13
|
+
},
|
|
14
|
+
baseSize: {
|
|
15
|
+
description: "Intrinsic content dimensions being scaled.",
|
|
16
|
+
type: "{ width: number; height: number }",
|
|
17
|
+
defaultValue: "{ width: 1000, height: 1000 }"
|
|
18
|
+
},
|
|
19
|
+
previewBoxSize: {
|
|
20
|
+
description: "Explicit preview box size. When provided, overrides scaleFactor.",
|
|
21
|
+
type: "{ width: number; height: number }"
|
|
22
|
+
},
|
|
23
|
+
padding: {
|
|
24
|
+
description: "Padding in pixels that reduces the space available for the scaled content.",
|
|
25
|
+
type: "number",
|
|
26
|
+
defaultValue: "0"
|
|
27
|
+
},
|
|
28
|
+
forceScale: {
|
|
29
|
+
description: "Manual content scale override that bypasses the automatic fit calculation.",
|
|
30
|
+
type: "number"
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
examples: [{
|
|
34
|
+
title: "Half-scale preview",
|
|
35
|
+
code: "<ScaledPreview scaleFactor={0.25} baseSize={{ width: 1080, height: 1080 }}>\n {content}\n</ScaledPreview>"
|
|
36
|
+
}],
|
|
37
|
+
keywords: [
|
|
38
|
+
"preview",
|
|
39
|
+
"scale",
|
|
40
|
+
"thumbnail",
|
|
41
|
+
"zoom",
|
|
42
|
+
"layout"
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { meta };
|
package/dist/select/Select.cjs
CHANGED
|
@@ -12,7 +12,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
12
12
|
|
|
13
13
|
//#region src/select/Select.tsx
|
|
14
14
|
function Select(props) {
|
|
15
|
-
const { options, value = "", onChange, placeholder, contentProps, keyboardMode = "dropdown", open: openProp, onOpenChange: onOpenChangeProp, position, clearable = false, disabled, className, id,...
|
|
15
|
+
const { options, value = "", onChange, placeholder, contentProps, keyboardMode = "dropdown", open: openProp, onOpenChange: onOpenChangeProp, position, clearable = false, disabled, name, required, className, id,...triggerProps } = props;
|
|
16
16
|
const [uncontrolledOpen, setUncontrolledOpen] = react.default.useState(false);
|
|
17
17
|
const open = openProp ?? uncontrolledOpen;
|
|
18
18
|
const handleOpenChange = (nextOpen) => {
|
|
@@ -28,14 +28,16 @@ function Select(props) {
|
|
|
28
28
|
getValue: (option) => String(option.value)
|
|
29
29
|
});
|
|
30
30
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Select, {
|
|
31
|
-
...restProps,
|
|
32
31
|
value,
|
|
33
32
|
open,
|
|
34
33
|
onValueChange: onChange,
|
|
35
34
|
onOpenChange: handleOpenChange,
|
|
35
|
+
name,
|
|
36
|
+
required,
|
|
36
37
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
37
38
|
className: "relative w-full",
|
|
38
39
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.SelectTrigger, {
|
|
40
|
+
...triggerProps,
|
|
39
41
|
id,
|
|
40
42
|
className: (0, __pixpilot_shadcn.cn)("w-full", className),
|
|
41
43
|
onKeyDown: handleTriggerKeyDown,
|
package/dist/select/Select.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Select, SelectContent } from "@pixpilot/shadcn";
|
|
1
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
2
|
+
import { Select, SelectContent, SelectTrigger } from "@pixpilot/shadcn";
|
|
3
3
|
import React, { ComponentProps } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/select/Select.d.ts
|
|
@@ -45,12 +45,21 @@ type BaseSelectProps = {
|
|
|
45
45
|
* Whether to show a clear button when a value is selected
|
|
46
46
|
*/
|
|
47
47
|
clearable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Controlled open state of the dropdown
|
|
50
|
+
*/
|
|
51
|
+
open?: ComponentProps<typeof Select>['open'];
|
|
52
|
+
/**
|
|
53
|
+
* Callback function called when the open state changes
|
|
54
|
+
*/
|
|
55
|
+
onOpenChange?: ComponentProps<typeof Select>['onOpenChange'];
|
|
48
56
|
id?: string;
|
|
49
57
|
disabled?: boolean;
|
|
50
58
|
name?: string;
|
|
51
59
|
required?: boolean;
|
|
60
|
+
/** Styles the visible trigger. */
|
|
52
61
|
className?: string;
|
|
53
|
-
} & Omit<ComponentProps<typeof
|
|
54
|
-
declare function Select$1(props: BaseSelectProps):
|
|
62
|
+
} & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
|
|
63
|
+
declare function Select$1(props: BaseSelectProps): react_jsx_runtime16.JSX.Element;
|
|
55
64
|
//#endregion
|
|
56
65
|
export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
|
package/dist/select/Select.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select, SelectContent } from "@pixpilot/shadcn";
|
|
1
|
+
import { Select, SelectContent, SelectTrigger } from "@pixpilot/shadcn";
|
|
2
2
|
import React, { ComponentProps } from "react";
|
|
3
3
|
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -45,12 +45,21 @@ type BaseSelectProps = {
|
|
|
45
45
|
* Whether to show a clear button when a value is selected
|
|
46
46
|
*/
|
|
47
47
|
clearable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Controlled open state of the dropdown
|
|
50
|
+
*/
|
|
51
|
+
open?: ComponentProps<typeof Select>['open'];
|
|
52
|
+
/**
|
|
53
|
+
* Callback function called when the open state changes
|
|
54
|
+
*/
|
|
55
|
+
onOpenChange?: ComponentProps<typeof Select>['onOpenChange'];
|
|
48
56
|
id?: string;
|
|
49
57
|
disabled?: boolean;
|
|
50
58
|
name?: string;
|
|
51
59
|
required?: boolean;
|
|
60
|
+
/** Styles the visible trigger. */
|
|
52
61
|
className?: string;
|
|
53
|
-
} & Omit<ComponentProps<typeof
|
|
62
|
+
} & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
|
|
54
63
|
declare function Select$1(props: BaseSelectProps): react_jsx_runtime17.JSX.Element;
|
|
55
64
|
//#endregion
|
|
56
65
|
export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
|
package/dist/select/Select.js
CHANGED
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/select/Select.tsx
|
|
9
9
|
function Select$1(props) {
|
|
10
|
-
const { options, value = "", onChange, placeholder, contentProps, keyboardMode = "dropdown", open: openProp, onOpenChange: onOpenChangeProp, position, clearable = false, disabled, className, id,...
|
|
10
|
+
const { options, value = "", onChange, placeholder, contentProps, keyboardMode = "dropdown", open: openProp, onOpenChange: onOpenChangeProp, position, clearable = false, disabled, name, required, className, id,...triggerProps } = props;
|
|
11
11
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
|
|
12
12
|
const open = openProp ?? uncontrolledOpen;
|
|
13
13
|
const handleOpenChange = (nextOpen) => {
|
|
@@ -23,14 +23,16 @@ function Select$1(props) {
|
|
|
23
23
|
getValue: (option) => String(option.value)
|
|
24
24
|
});
|
|
25
25
|
return /* @__PURE__ */ jsxs(Select, {
|
|
26
|
-
...restProps,
|
|
27
26
|
value,
|
|
28
27
|
open,
|
|
29
28
|
onValueChange: onChange,
|
|
30
29
|
onOpenChange: handleOpenChange,
|
|
30
|
+
name,
|
|
31
|
+
required,
|
|
31
32
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
32
33
|
className: "relative w-full",
|
|
33
34
|
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
35
|
+
...triggerProps,
|
|
34
36
|
id,
|
|
35
37
|
className: cn("w-full", className),
|
|
36
38
|
onKeyDown: handleTriggerKeyDown,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/select/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Select",
|
|
6
|
+
category: "Forms",
|
|
7
|
+
htmlElement: "button",
|
|
8
|
+
description: "A single-select dropdown driven by an options array, with configurable keyboard navigation, dropdown positioning, and an optional clear button.",
|
|
9
|
+
props: defineProps({
|
|
10
|
+
options: "Selectable options as `{ label, value }[]` where value is a string or number.",
|
|
11
|
+
value: "Controlled selected value (compared as a string).",
|
|
12
|
+
onChange: "Called with the selected value when it changes; called with \"\" when cleared.",
|
|
13
|
+
placeholder: "Placeholder text shown before a value is selected.",
|
|
14
|
+
contentProps: "Props forwarded to the underlying select content popover.",
|
|
15
|
+
keyboardMode: {
|
|
16
|
+
description: "How arrow keys behave: \"dropdown\" opens the menu, \"cycle\" steps through options in place.",
|
|
17
|
+
type: "\"cycle\" | \"dropdown\"",
|
|
18
|
+
defaultValue: "\"dropdown\""
|
|
19
|
+
},
|
|
20
|
+
position: {
|
|
21
|
+
description: "Dropdown positioning strategy.",
|
|
22
|
+
type: "\"item-aligned\" | \"popper\""
|
|
23
|
+
},
|
|
24
|
+
clearable: {
|
|
25
|
+
description: "Shows a clear button when a value is selected.",
|
|
26
|
+
type: "boolean",
|
|
27
|
+
defaultValue: "false"
|
|
28
|
+
},
|
|
29
|
+
disabled: "Disables the select trigger.",
|
|
30
|
+
name: "Name used when the select participates in native form submission.",
|
|
31
|
+
required: "Marks the select as required.",
|
|
32
|
+
id: "Optional id attribute applied to the select trigger.",
|
|
33
|
+
className: "Additional CSS class applied to the select trigger.",
|
|
34
|
+
open: {
|
|
35
|
+
description: "Controlled open state of the dropdown.",
|
|
36
|
+
type: "boolean"
|
|
37
|
+
},
|
|
38
|
+
onOpenChange: {
|
|
39
|
+
description: "Called when the dropdown opens or closes.",
|
|
40
|
+
type: "(open: boolean) => void"
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
description: "Controls the trigger height.",
|
|
44
|
+
type: "\"sm\" | \"default\"",
|
|
45
|
+
defaultValue: "\"default\""
|
|
46
|
+
},
|
|
47
|
+
asChild: {
|
|
48
|
+
description: "Render the trigger behavior and styles through the child element instead of a native button.",
|
|
49
|
+
type: "boolean",
|
|
50
|
+
defaultValue: "false"
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
examples: [{
|
|
54
|
+
title: "Basic select",
|
|
55
|
+
code: "<Select value={value} onChange={setValue} options={[{ label: \"One\", value: \"1\" }, { label: \"Two\", value: \"2\" }]} placeholder=\"Choose…\" />"
|
|
56
|
+
}, {
|
|
57
|
+
title: "Clearable select",
|
|
58
|
+
code: "<Select value={value} onChange={setValue} options={options} clearable />"
|
|
59
|
+
}],
|
|
60
|
+
related: ["Combobox", "ColorSelect"],
|
|
61
|
+
keywords: [
|
|
62
|
+
"select",
|
|
63
|
+
"dropdown",
|
|
64
|
+
"options",
|
|
65
|
+
"form"
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { meta };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/slider/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Slider",
|
|
6
|
+
category: "Forms",
|
|
7
|
+
description: "A range slider wrapping the shadcn slider with extra vertical padding. Supports single-thumb and multi-thumb (range) values.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
value: {
|
|
10
|
+
description: "Controlled value(s). Provide multiple numbers for a range slider.",
|
|
11
|
+
type: "number[]"
|
|
12
|
+
},
|
|
13
|
+
defaultValue: {
|
|
14
|
+
description: "Initial value(s) when uncontrolled.",
|
|
15
|
+
type: "number[]"
|
|
16
|
+
},
|
|
17
|
+
onValueChange: {
|
|
18
|
+
description: "Called with the new value array as the thumb(s) move.",
|
|
19
|
+
type: "(value: number[]) => void"
|
|
20
|
+
},
|
|
21
|
+
min: {
|
|
22
|
+
description: "Minimum value.",
|
|
23
|
+
type: "number",
|
|
24
|
+
defaultValue: "0"
|
|
25
|
+
},
|
|
26
|
+
max: {
|
|
27
|
+
description: "Maximum value.",
|
|
28
|
+
type: "number",
|
|
29
|
+
defaultValue: "100"
|
|
30
|
+
},
|
|
31
|
+
step: {
|
|
32
|
+
description: "Step increment between values.",
|
|
33
|
+
type: "number",
|
|
34
|
+
defaultValue: "1"
|
|
35
|
+
},
|
|
36
|
+
disabled: "Disables slider interaction.",
|
|
37
|
+
orientation: {
|
|
38
|
+
description: "Slider orientation.",
|
|
39
|
+
type: "\"horizontal\" | \"vertical\"",
|
|
40
|
+
defaultValue: "\"horizontal\""
|
|
41
|
+
},
|
|
42
|
+
onValueCommit: {
|
|
43
|
+
description: "Called with the final value array when the user stops dragging.",
|
|
44
|
+
type: "(value: number[]) => void"
|
|
45
|
+
},
|
|
46
|
+
minStepsBetweenThumbs: {
|
|
47
|
+
description: "Minimum number of steps to keep between thumbs in a range slider.",
|
|
48
|
+
type: "number",
|
|
49
|
+
defaultValue: "0"
|
|
50
|
+
},
|
|
51
|
+
inverted: {
|
|
52
|
+
description: "Visually and functionally inverts the slider direction.",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
defaultValue: "false"
|
|
55
|
+
},
|
|
56
|
+
name: "Form field name submitted with the slider value for native form integration.",
|
|
57
|
+
form: "Associates the slider with a form by id when rendered outside of it.",
|
|
58
|
+
asChild: {
|
|
59
|
+
description: "Merge behavior and styles onto the child element instead of the default wrapper.",
|
|
60
|
+
type: "boolean",
|
|
61
|
+
defaultValue: "false"
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
examples: [{
|
|
65
|
+
title: "Single value",
|
|
66
|
+
code: "<Slider value={[volume]} onValueChange={([v]) => setVolume(v)} max={100} />"
|
|
67
|
+
}, {
|
|
68
|
+
title: "Range",
|
|
69
|
+
code: "<Slider value={range} onValueChange={setRange} min={0} max={1000} step={10} />"
|
|
70
|
+
}],
|
|
71
|
+
keywords: [
|
|
72
|
+
"slider",
|
|
73
|
+
"range",
|
|
74
|
+
"input",
|
|
75
|
+
"form"
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { meta };
|
package/dist/tabs/mcp.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineProps } from "../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/tabs/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "Tabs",
|
|
6
|
+
category: "Navigation",
|
|
7
|
+
description: "A tabbed navigation container composed with TabsList, TabsTrigger, and TabsContent. TabsList adds an \"underline\" variant on top of the shadcn variants.",
|
|
8
|
+
props: defineProps({
|
|
9
|
+
value: {
|
|
10
|
+
description: "Controlled active tab value.",
|
|
11
|
+
type: "string"
|
|
12
|
+
},
|
|
13
|
+
defaultValue: {
|
|
14
|
+
description: "Initial active tab value when uncontrolled.",
|
|
15
|
+
type: "string"
|
|
16
|
+
},
|
|
17
|
+
onValueChange: {
|
|
18
|
+
description: "Called with the newly selected tab value.",
|
|
19
|
+
type: "(value: string) => void"
|
|
20
|
+
},
|
|
21
|
+
orientation: {
|
|
22
|
+
description: "Tab orientation.",
|
|
23
|
+
type: "\"horizontal\" | \"vertical\"",
|
|
24
|
+
defaultValue: "\"horizontal\""
|
|
25
|
+
},
|
|
26
|
+
activationMode: {
|
|
27
|
+
description: "Whether a tab activates automatically on focus or manually on click/Enter.",
|
|
28
|
+
type: "\"automatic\" | \"manual\"",
|
|
29
|
+
defaultValue: "\"automatic\""
|
|
30
|
+
},
|
|
31
|
+
asChild: {
|
|
32
|
+
description: "Merge behavior and styles onto the child element instead of the default wrapper.",
|
|
33
|
+
type: "boolean",
|
|
34
|
+
defaultValue: "false"
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
notes: ["TabsList accepts a `variant` of \"default\" | \"underline\" | \"outline\" | \"ghost\" | \"pill\"."],
|
|
38
|
+
examples: [{
|
|
39
|
+
title: "Underline tabs",
|
|
40
|
+
code: "<Tabs defaultValue=\"a\">\n <TabsList variant=\"underline\">\n <TabsTrigger value=\"a\">A</TabsTrigger>\n <TabsTrigger value=\"b\">B</TabsTrigger>\n </TabsList>\n <TabsContent value=\"a\">First</TabsContent>\n <TabsContent value=\"b\">Second</TabsContent>\n</Tabs>"
|
|
41
|
+
}],
|
|
42
|
+
keywords: [
|
|
43
|
+
"tabs",
|
|
44
|
+
"navigation",
|
|
45
|
+
"panels",
|
|
46
|
+
"segmented"
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { meta };
|