@pixpilot/shadcn-ui 1.38.0 → 2.0.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.
Files changed (90) hide show
  1. package/README.md +1 -0
  2. package/dist/ColorPicker/mcp.js +105 -0
  3. package/dist/ColorPickerBase/mcp.js +97 -0
  4. package/dist/absolute-fill/AbsoluteFill.d.cts +2 -2
  5. package/dist/absolute-fill/mcp.js +23 -0
  6. package/dist/alert/mcp.js +41 -0
  7. package/dist/avatar-upload/mcp.js +86 -0
  8. package/dist/button-extended/ButtonExtended.d.cts +2 -2
  9. package/dist/button-extended/mcp.js +53 -0
  10. package/dist/button-group/mcp.js +28 -0
  11. package/dist/card/Card.d.cts +3 -3
  12. package/dist/circle-loader/mcp.js +48 -0
  13. package/dist/close-button-absolute/mcp.js +39 -0
  14. package/dist/close-button-rounded/mcp.js +39 -0
  15. package/dist/color-select/ColorSelect.cjs +2 -2
  16. package/dist/color-select/ColorSelect.d.cts +3 -2
  17. package/dist/color-select/ColorSelect.d.ts +3 -2
  18. package/dist/color-select/ColorSelect.js +3 -3
  19. package/dist/color-select/mcp.js +59 -0
  20. package/dist/combobox/Combobox.cjs +4 -3
  21. package/dist/combobox/Combobox.d.cts +8 -4
  22. package/dist/combobox/Combobox.d.ts +8 -4
  23. package/dist/combobox/Combobox.js +5 -4
  24. package/dist/combobox/index.d.cts +1 -1
  25. package/dist/combobox/index.d.ts +1 -1
  26. package/dist/combobox/mcp.js +64 -0
  27. package/dist/confirmation-dialog/mcp.js +55 -0
  28. package/dist/content-card/ContentCard.d.ts +2 -2
  29. package/dist/content-card/mcp.js +30 -0
  30. package/dist/date-picker/DatePicker.d.ts +2 -2
  31. package/dist/date-picker/mcp.js +43 -0
  32. package/dist/dialog/Dialog.d.ts +5 -5
  33. package/dist/dialog/mcp.js +53 -0
  34. package/dist/dialog-provider/mcp.js +24 -0
  35. package/dist/file-upload/FileUpload.d.cts +2 -2
  36. package/dist/file-upload/FileUpload.d.ts +2 -2
  37. package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
  38. package/dist/file-upload-inline/mcp.js +89 -0
  39. package/dist/file-upload-root/FileUploadRoot.d.ts +2 -2
  40. package/dist/file-upload-root/mcp.js +84 -0
  41. package/dist/generated/mcp-registry.js +84 -6
  42. package/dist/icon-selector/IconPicker.cjs +2 -2
  43. package/dist/icon-selector/IconPicker.d.cts +1 -0
  44. package/dist/icon-selector/IconPicker.d.ts +1 -0
  45. package/dist/icon-selector/IconPicker.js +2 -2
  46. package/dist/icon-selector/mcp.js +60 -0
  47. package/dist/icon-toggle/mcp.js +62 -0
  48. package/dist/index.d.cts +4 -4
  49. package/dist/index.d.ts +4 -4
  50. package/dist/input/mcp.js +33 -0
  51. package/dist/layout/mcp.js +29 -0
  52. package/dist/loading-overlay/mcp.js +64 -0
  53. package/dist/mcp/src/search.js +81 -0
  54. package/dist/mcp/src/server.js +10 -5
  55. package/dist/pagination/mcp.js +65 -0
  56. package/dist/popover/mcp.js +27 -0
  57. package/dist/rating/Rating.d.cts +3 -3
  58. package/dist/rating/Rating.d.ts +3 -3
  59. package/dist/rating/mcp.js +73 -0
  60. package/dist/rich-text-editor/mcp.js +78 -0
  61. package/dist/scaled-preview/mcp.js +47 -0
  62. package/dist/select/Select.cjs +4 -2
  63. package/dist/select/Select.d.cts +14 -5
  64. package/dist/select/Select.d.ts +14 -5
  65. package/dist/select/Select.js +4 -2
  66. package/dist/select/index.d.cts +1 -1
  67. package/dist/select/index.d.ts +1 -1
  68. package/dist/select/mcp.js +70 -0
  69. package/dist/slider/mcp.js +80 -0
  70. package/dist/tabs/mcp.js +51 -0
  71. package/dist/tags-input/TagsInput.cjs +67 -65
  72. package/dist/tags-input/TagsInput.d.cts +6 -33
  73. package/dist/tags-input/TagsInput.d.ts +6 -33
  74. package/dist/tags-input/TagsInput.js +68 -66
  75. package/dist/tags-input/TagsInputInline.d.cts +2 -2
  76. package/dist/tags-input/TagsInputInline.d.ts +2 -2
  77. package/dist/tags-input/index.d.cts +2 -2
  78. package/dist/tags-input/index.d.ts +2 -2
  79. package/dist/tags-input/mcp.js +100 -0
  80. package/dist/theme-provider/mcp.js +57 -0
  81. package/dist/theme-toggle/ThemeModeDropdown.d.ts +2 -2
  82. package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +2 -2
  83. package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +2 -2
  84. package/dist/theme-toggle/ThemeModeToggleButton.d.ts +2 -2
  85. package/dist/theme-toggle/mcp.js +38 -0
  86. package/dist/toast/mcp.js +52 -0
  87. package/dist/toggle-button/mcp.js +58 -0
  88. package/dist/toggle-group/mcp.js +67 -0
  89. package/dist/tooltip/mcp.js +24 -0
  90. package/package.json +6 -6
@@ -0,0 +1,64 @@
1
+ import { defineProps } from "../mcp/src/utils.js";
2
+
3
+ //#region src/loading-overlay/mcp.ts
4
+ const meta = {
5
+ name: "LoadingOverlay",
6
+ category: "Feedback",
7
+ description: "A spinner overlay that fades in over its container or the full viewport while a task is loading, with optional message and show/hide delays.",
8
+ props: defineProps({
9
+ show: {
10
+ description: "Whether the overlay is visible.",
11
+ type: "boolean"
12
+ },
13
+ backdrop: {
14
+ description: "Shows a semi-transparent backdrop behind the spinner.",
15
+ type: "boolean",
16
+ defaultValue: "true"
17
+ },
18
+ placement: {
19
+ description: "Vertical alignment of the loader within the overlay.",
20
+ type: "\"top\" | \"bottom\" | \"center\"",
21
+ defaultValue: "\"center\""
22
+ },
23
+ message: "Optional message rendered below the spinner.",
24
+ inDelay: {
25
+ description: "Delay in milliseconds before showing the loader.",
26
+ type: "number",
27
+ defaultValue: "0"
28
+ },
29
+ outDelay: {
30
+ description: "Delay in milliseconds before hiding the loader after `show` becomes false.",
31
+ type: "number",
32
+ defaultValue: "0"
33
+ },
34
+ scope: {
35
+ description: "Whether the overlay fills its relative parent (\"container\") or the viewport (\"fullscreen\").",
36
+ type: "\"container\" | \"fullscreen\"",
37
+ defaultValue: "\"container\""
38
+ },
39
+ size: {
40
+ description: "Spinner size.",
41
+ type: "\"sm\" | \"default\" | \"lg\"",
42
+ defaultValue: "\"default\""
43
+ },
44
+ slots: "Props forwarded to the inner spinner, message, and content elements.",
45
+ className: "Additional CSS class applied to the overlay wrapper."
46
+ }),
47
+ examples: [{
48
+ title: "Container overlay",
49
+ code: "<div className=\"relative\">{content}<LoadingOverlay show={isLoading} message=\"Loading…\" /></div>"
50
+ }, {
51
+ title: "Fullscreen overlay",
52
+ code: "<LoadingOverlay show={isLoading} scope=\"fullscreen\" />"
53
+ }],
54
+ keywords: [
55
+ "loading",
56
+ "overlay",
57
+ "spinner",
58
+ "busy",
59
+ "feedback"
60
+ ]
61
+ };
62
+
63
+ //#endregion
64
+ export { meta };
@@ -0,0 +1,81 @@
1
+ //#region ../mcp/src/search.ts
2
+ /** Default number of results returned when the caller does not pass a limit. */
3
+ const DEFAULT_SEARCH_LIMIT = 10;
4
+ /** Maximum edit distance still treated as a likely typo of a component name. */
5
+ const MAX_TYPO_DISTANCE = 2;
6
+ /** Points awarded for each kind of match, tuned so stronger signals win. */
7
+ const SCORE = {
8
+ nameExact: 100,
9
+ namePrefix: 50,
10
+ nameIncludes: 30,
11
+ keywordExact: 40,
12
+ categoryExact: 25,
13
+ categoryIncludes: 10,
14
+ tokenName: 8,
15
+ tokenKeyword: 6,
16
+ tokenDescription: 3,
17
+ fuzzyName: 15
18
+ };
19
+ function toResult(component, score) {
20
+ return {
21
+ name: component.name,
22
+ category: component.category,
23
+ description: component.description,
24
+ score
25
+ };
26
+ }
27
+ function scoreComponent(component, query, tokens) {
28
+ const name = component.name.toLowerCase();
29
+ const category = component.category.toLowerCase();
30
+ const description = component.description.toLowerCase();
31
+ const keywords = (component.keywords ?? []).map((keyword) => keyword.toLowerCase());
32
+ let score = 0;
33
+ if (name === query) score += SCORE.nameExact;
34
+ else if (name.startsWith(query)) score += SCORE.namePrefix;
35
+ else if (name.includes(query)) score += SCORE.nameIncludes;
36
+ if (keywords.includes(query)) score += SCORE.keywordExact;
37
+ if (category === query) score += SCORE.categoryExact;
38
+ else if (category.includes(query)) score += SCORE.categoryIncludes;
39
+ for (const token of tokens) {
40
+ if (name.includes(token)) score += SCORE.tokenName;
41
+ if (keywords.some((keyword) => keyword.includes(token))) score += SCORE.tokenKeyword;
42
+ if (description.includes(token)) score += SCORE.tokenDescription;
43
+ }
44
+ if (score === 0 && levenshtein(query, name) <= MAX_TYPO_DISTANCE) score += SCORE.fuzzyName;
45
+ return score;
46
+ }
47
+ /**
48
+ * Smart, dependency-free search over component metadata.
49
+ *
50
+ * With an empty query it acts as an alphabetical list; otherwise it ranks
51
+ * components by name, keyword, category, and description matches, with light
52
+ * typo tolerance on the name. Results are capped at `limit`.
53
+ */
54
+ function searchComponents(components, query, limit = DEFAULT_SEARCH_LIMIT) {
55
+ const max = Math.max(0, Math.trunc(limit));
56
+ const normalizedQuery = query.trim().toLowerCase();
57
+ if (!normalizedQuery) return [...components].sort((a, b) => a.name.localeCompare(b.name)).slice(0, max).map((component) => toResult(component, 0));
58
+ const tokens = normalizedQuery.split(/\s+/u).filter(Boolean);
59
+ return components.map((component) => toResult(component, scoreComponent(component, normalizedQuery, tokens))).filter((result) => result.score > 0).sort((a, b) => b.score - a.score || a.name.localeCompare(b.name)).slice(0, max);
60
+ }
61
+ /** Small, dependency-free Levenshtein distance for typo tolerance. */
62
+ function levenshtein(a, b) {
63
+ if (a === b) return 0;
64
+ if (a.length === 0) return b.length;
65
+ if (b.length === 0) return a.length;
66
+ const row = Array.from({ length: b.length + 1 }, (_, index) => index);
67
+ for (let i = 1; i <= a.length; i++) {
68
+ let diagonal = row[0] ?? 0;
69
+ row[0] = i;
70
+ for (let j = 1; j <= b.length; j++) {
71
+ const above = row[j] ?? 0;
72
+ const cost = a[i - 1] === b[j - 1] ? 0 : 1;
73
+ row[j] = Math.min(above + 1, (row[j - 1] ?? 0) + 1, diagonal + cost);
74
+ diagonal = above;
75
+ }
76
+ }
77
+ return row[b.length] ?? 0;
78
+ }
79
+
80
+ //#endregion
81
+ export { searchComponents };
@@ -1,3 +1,4 @@
1
+ import { searchComponents } from "./search.js";
1
2
  import process from "node:process";
2
3
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -28,11 +29,15 @@ function createComponentMcpServer({ packageName, packageVersion, registry }) {
28
29
  server.registerTool("list_components", {
29
30
  title: "List components",
30
31
  description: `List registered ${packageName} components.`
31
- }, async () => jsonToolResult({ components: components.map(({ name, category, description }) => ({
32
- name,
33
- category,
34
- description
35
- })) }));
32
+ }, async () => jsonToolResult({ components: components.map(({ name }) => name) }));
33
+ server.registerTool("search_components", {
34
+ title: "Search components",
35
+ description: `Search registered ${packageName} components by name, category, keywords, and description. Returns matches ranked by relevance score.`,
36
+ inputSchema: {
37
+ query: z.string(),
38
+ limit: z.number().int().min(1).optional()
39
+ }
40
+ }, async ({ query, limit }) => jsonToolResult({ results: searchComponents(components, query, limit) }));
36
41
  server.registerTool("get_component_details", {
37
42
  title: "Get component details",
38
43
  description: `Get the full MCP metadata object for a registered ${packageName} component.`,
@@ -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 };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 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): react_jsx_runtime17.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime15.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>): react_jsx_runtime17.JSX.Element;
56
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime15.JSX.Element;
57
57
  //#endregion
58
58
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as class_variance_authority_types0 from "class-variance-authority/types";
5
5
 
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime15.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime20.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>): react_jsx_runtime15.JSX.Element;
56
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime20.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 };
@@ -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,...restProps } = props;
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,
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime19 from "react/jsx-runtime";
2
- import { Select, SelectContent } from "@pixpilot/shadcn";
1
+ import * as react_jsx_runtime17 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 Select>, 'value' | 'onValueChange' | 'children' | 'disabled' | 'name' | 'required'>;
54
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime19.JSX.Element;
62
+ } & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
63
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime17.JSX.Element;
55
64
  //#endregion
56
- export { Select$1 as Select, SelectContentProps, SelectOption };
65
+ export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
@@ -1,6 +1,6 @@
1
- import { Select, SelectContent } from "@pixpilot/shadcn";
1
+ import { Select, SelectContent, SelectTrigger } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime17 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime22 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/select/Select.d.ts
6
6
  interface SelectOption {
@@ -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 Select>, 'value' | 'onValueChange' | 'children' | 'disabled' | 'name' | 'required'>;
54
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime17.JSX.Element;
62
+ } & Omit<ComponentProps<typeof SelectTrigger>, 'onChange' | 'value'>;
63
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime22.JSX.Element;
55
64
  //#endregion
56
- export { Select$1 as Select, SelectContentProps, SelectOption };
65
+ export { BaseSelectProps, Select$1 as Select, SelectContentProps, SelectOption };
@@ -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,...restProps } = props;
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,
@@ -1 +1 @@
1
- import { Select, SelectContentProps, SelectOption } from "./Select.cjs";
1
+ import { BaseSelectProps, Select, SelectContentProps, SelectOption } from "./Select.cjs";
@@ -1 +1 @@
1
- import { Select, SelectContentProps, SelectOption } from "./Select.js";
1
+ import { BaseSelectProps, Select, SelectContentProps, SelectOption } from "./Select.js";