velloo 0.0.0 → 0.2.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/BUN-LICENSE.md +91 -0
- package/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +288 -2
- package/THIRD-PARTY-NOTICES.md +467 -0
- package/assets/elsewhere-alps-9fqhv029.jpg +0 -0
- package/assets/elsewhere-bali-vp60g115.jpg +0 -0
- package/assets/elsewhere-forest-xgn23zrj.jpg +0 -0
- package/assets/elsewhere-japan-qs7qkbr2.jpg +0 -0
- package/assets/elsewhere-kyoto-map-n2bvkrya.svg +1 -0
- package/assets/elsewhere-kyoto-qemtn6nk.jpg +0 -0
- package/assets/elsewhere-room-g1gaw7cs.jpg +0 -0
- package/canvas/apple-touch-icon.png +0 -0
- package/canvas/assets/index-BCvDZiBo.css +2 -0
- package/canvas/assets/index-ClaBqcaS.js +28 -0
- package/canvas/assets/lucide-all-iIF-pmzN.js +1 -0
- package/canvas/assets/radix-C3HaOB-d.js +41 -0
- package/canvas/assets/react-D0Ec-185.js +9 -0
- package/canvas/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/canvas/assets/vendor-CKmQ-Zst.js +53 -0
- package/canvas/favicon.ico +0 -0
- package/canvas/favicon.svg +12 -0
- package/canvas/fonts/OFL-1.1.txt +93 -0
- package/canvas/fonts/poppins-700.woff2 +0 -0
- package/canvas/icon-192.png +0 -0
- package/canvas/icon-512.png +0 -0
- package/canvas/index.html +22 -0
- package/canvas/site.webmanifest +11 -0
- package/chunk-08sv3k41.js +4 -0
- package/chunk-0fe83yzt.js +2 -0
- package/chunk-0t68szgr.js +3 -0
- package/chunk-1h55s5he.js +2 -0
- package/chunk-2c7jbx46.js +2 -0
- package/chunk-2smsg2ct.js +7 -0
- package/chunk-308ynsxd.js +2 -0
- package/chunk-3e8vez4d.js +1229 -0
- package/chunk-40xgcth8.js +63 -0
- package/chunk-4dn75m6t.js +3 -0
- package/chunk-4fj5tahv.js +3 -0
- package/chunk-6nqghjda.js +3 -0
- package/chunk-6tx68d90.js +3 -0
- package/chunk-6w6ch4ce.js +2 -0
- package/chunk-735ezz23.js +86 -0
- package/chunk-7eq7nx37.js +7 -0
- package/chunk-7eyb8yrf.js +6 -0
- package/chunk-80fjfyha.js +86 -0
- package/chunk-80r93t2e.js +4 -0
- package/chunk-94vx1yb0.js +3 -0
- package/chunk-9vg3yafz.js +3 -0
- package/chunk-a84n72m2.js +4 -0
- package/chunk-ampmdzz4.js +10 -0
- package/chunk-avns4dbf.js +2 -0
- package/chunk-ayrb3qnm.js +3 -0
- package/chunk-bwnvcncx.js +3 -0
- package/chunk-ccszg02q.js +5 -0
- package/chunk-cvn689d5.js +3 -0
- package/chunk-cxe6jjwj.js +3 -0
- package/chunk-dg6z4vdd.js +3 -0
- package/chunk-dgwjpbp9.js +3 -0
- package/chunk-dy41n60j.js +52 -0
- package/chunk-ek71z2fv.js +226 -0
- package/chunk-er1fxb7d.js +2 -0
- package/chunk-eyr8hrzf.js +2 -0
- package/chunk-fjbzk4sw.js +3 -0
- package/chunk-fsbsksga.js +3 -0
- package/chunk-h6gchare.js +3 -0
- package/chunk-hcb68zt7.js +85 -0
- package/chunk-hggap8fq.js +3 -0
- package/chunk-j11fyeqh.js +2 -0
- package/chunk-jb21jkp1.js +8 -0
- package/chunk-jfx9xjmr.js +18 -0
- package/chunk-jr0ss0mm.js +303 -0
- package/chunk-jrsknzjt.js +3 -0
- package/chunk-jv0xggh0.js +2 -0
- package/chunk-k17gfwq3.js +2 -0
- package/chunk-mh2pr7cq.js +5 -0
- package/chunk-mnapdp1y.js +2 -0
- package/chunk-mzhdrawd.js +3 -0
- package/chunk-n9gs6yx9.js +2 -0
- package/chunk-ngnymg2q.js +3 -0
- package/chunk-nwx5700b.js +3 -0
- package/chunk-pjtg3wnm.js +4 -0
- package/chunk-pp86v6m6.js +3 -0
- package/chunk-r22epxz2.js +3 -0
- package/chunk-rgasy862.js +5 -0
- package/chunk-rpwpeph5.js +3 -0
- package/chunk-s23gtejf.js +3 -0
- package/chunk-sjgqnykd.js +6 -0
- package/chunk-sn3x2m0m.js +6 -0
- package/chunk-t448rrfr.js +2 -0
- package/chunk-tdsk5wxa.js +451 -0
- package/chunk-v40fn08f.js +442 -0
- package/chunk-vbk1qhdz.js +3 -0
- package/chunk-vdkrbzh1.js +2 -0
- package/chunk-vgmr98cv.js +40 -0
- package/chunk-vsv8z729.js +6 -0
- package/chunk-x4f4k9pp.js +26 -0
- package/chunk-xt5ayg7g.js +4 -0
- package/chunk-ydhwv29b.js +244 -0
- package/chunk-zb6hc1y0.js +2 -0
- package/cli.js +3 -0
- package/launcher.cjs +97 -0
- package/package.json +58 -5
- package/pkgs/helpers/src/box.tsx +21 -0
- package/pkgs/helpers/src/cn.ts +32 -0
- package/pkgs/helpers/src/descriptors.ts +270 -0
- package/pkgs/helpers/src/divider.tsx +123 -0
- package/pkgs/helpers/src/gradient.tsx +90 -0
- package/pkgs/helpers/src/heading.tsx +20 -0
- package/pkgs/helpers/src/icon-data.ts +8009 -0
- package/pkgs/helpers/src/icon.tsx +53 -0
- package/pkgs/helpers/src/image.tsx +111 -0
- package/pkgs/helpers/src/index.ts +29 -0
- package/pkgs/helpers/src/layer.tsx +61 -0
- package/pkgs/helpers/src/lowering.ts +53 -0
- package/pkgs/helpers/src/paths.ts +47 -0
- package/pkgs/helpers/src/placeholder.tsx +88 -0
- package/pkgs/helpers/src/prose.tsx +42 -0
- package/pkgs/helpers/src/registry.ts +41 -0
- package/pkgs/helpers/src/svg.tsx +62 -0
- package/pkgs/helpers/src/text.tsx +16 -0
- package/pkgs/provider-antd/src/index.ts +78 -0
- package/pkgs/provider-antd/src/intro.ts +14 -0
- package/pkgs/provider-antd/src/manifest.ts +439 -0
- package/pkgs/provider-antd/src/overlays.ts +176 -0
- package/pkgs/provider-antd/src/registry.ts +104 -0
- package/pkgs/provider-antd/src/render-pass.ts +43 -0
- package/pkgs/provider-antd/src/tailwind-entry.css +21 -0
- package/pkgs/provider-antd/src/theme.ts +132 -0
- package/pkgs/provider-antd/src/version.ts +8 -0
- package/pkgs/provider-chakra/src/index.ts +80 -0
- package/pkgs/provider-chakra/src/intro.ts +14 -0
- package/pkgs/provider-chakra/src/manifest.ts +421 -0
- package/pkgs/provider-chakra/src/overlays.ts +246 -0
- package/pkgs/provider-chakra/src/registry.ts +227 -0
- package/pkgs/provider-chakra/src/render-pass.ts +55 -0
- package/pkgs/provider-chakra/src/tailwind-entry.css +21 -0
- package/pkgs/provider-chakra/src/theme.ts +180 -0
- package/pkgs/provider-chakra/src/version.ts +8 -0
- package/pkgs/provider-mui/src/index.ts +117 -0
- package/pkgs/provider-mui/src/intro.ts +12 -0
- package/pkgs/provider-mui/src/manifest.ts +263 -0
- package/pkgs/provider-mui/src/overlays.ts +124 -0
- package/pkgs/provider-mui/src/registry.ts +120 -0
- package/pkgs/provider-mui/src/render-pass.ts +36 -0
- package/pkgs/provider-mui/src/tailwind-entry.css +21 -0
- package/pkgs/provider-mui/src/theme.ts +129 -0
- package/pkgs/provider-mui/src/version.ts +8 -0
- package/pkgs/provider-none/src/components-inline.tsx +204 -0
- package/pkgs/provider-none/src/components.tsx +155 -0
- package/pkgs/provider-none/src/index.ts +57 -0
- package/pkgs/provider-none/src/intro.ts +18 -0
- package/pkgs/provider-none/src/manifest.ts +163 -0
- package/pkgs/provider-none/src/registry-inline.ts +36 -0
- package/pkgs/provider-none/src/registry.ts +39 -0
- package/pkgs/provider-none/src/tailwind-entry.css +57 -0
- package/pkgs/provider-none/src/version.ts +10 -0
- package/pkgs/schema/src/annotation.ts +120 -0
- package/pkgs/schema/src/asset.ts +66 -0
- package/pkgs/schema/src/board.ts +71 -0
- package/pkgs/schema/src/comment.ts +107 -0
- package/pkgs/schema/src/config.ts +185 -0
- package/pkgs/schema/src/css-sanitize.ts +56 -0
- package/pkgs/schema/src/extension.ts +105 -0
- package/pkgs/schema/src/fonts.ts +690 -0
- package/pkgs/schema/src/frame.ts +40 -0
- package/pkgs/schema/src/icon-name.ts +21 -0
- package/pkgs/schema/src/ids.ts +14 -0
- package/pkgs/schema/src/index.ts +169 -0
- package/pkgs/schema/src/migrate.ts +297 -0
- package/pkgs/schema/src/node.ts +229 -0
- package/pkgs/schema/src/paths.ts +28 -0
- package/pkgs/schema/src/repo.ts +134 -0
- package/pkgs/schema/src/screen.ts +30 -0
- package/pkgs/schema/src/snippet-resolve.ts +193 -0
- package/pkgs/schema/src/snippet.ts +104 -0
- package/pkgs/schema/src/svg-sanitize.ts +487 -0
- package/pkgs/schema/src/theme.ts +218 -0
- package/pkgs/schema/src/typeset.ts +693 -0
- package/pkgs/schema/src/validate-ids.ts +46 -0
- package/pkgs/schema/src/viewport.ts +8 -0
- package/pkgs/shadcn-snapshot/dist/manifest.json +8109 -0
- package/pkgs/shadcn-snapshot/src/components/canvas-portal.tsx +55 -0
- package/pkgs/shadcn-snapshot/src/components/ui/accordion.tsx +122 -0
- package/pkgs/shadcn-snapshot/src/components/ui/alert-dialog.tsx +164 -0
- package/pkgs/shadcn-snapshot/src/components/ui/alert.tsx +74 -0
- package/pkgs/shadcn-snapshot/src/components/ui/aspect-ratio.tsx +13 -0
- package/pkgs/shadcn-snapshot/src/components/ui/attachment.tsx +197 -0
- package/pkgs/shadcn-snapshot/src/components/ui/avatar.tsx +100 -0
- package/pkgs/shadcn-snapshot/src/components/ui/badge.tsx +50 -0
- package/pkgs/shadcn-snapshot/src/components/ui/breadcrumb.tsx +109 -0
- package/pkgs/shadcn-snapshot/src/components/ui/bubble.tsx +130 -0
- package/pkgs/shadcn-snapshot/src/components/ui/button-group.tsx +82 -0
- package/pkgs/shadcn-snapshot/src/components/ui/button.tsx +72 -0
- package/pkgs/shadcn-snapshot/src/components/ui/calendar.tsx +229 -0
- package/pkgs/shadcn-snapshot/src/components/ui/card.tsx +92 -0
- package/pkgs/shadcn-snapshot/src/components/ui/carousel.tsx +235 -0
- package/pkgs/shadcn-snapshot/src/components/ui/chart-option.ts +250 -0
- package/pkgs/shadcn-snapshot/src/components/ui/chart.tsx +177 -0
- package/pkgs/shadcn-snapshot/src/components/ui/checkbox.tsx +41 -0
- package/pkgs/shadcn-snapshot/src/components/ui/collapsible.tsx +32 -0
- package/pkgs/shadcn-snapshot/src/components/ui/combobox.tsx +196 -0
- package/pkgs/shadcn-snapshot/src/components/ui/context-menu.tsx +227 -0
- package/pkgs/shadcn-snapshot/src/components/ui/dialog.tsx +131 -0
- package/pkgs/shadcn-snapshot/src/components/ui/direction.tsx +24 -0
- package/pkgs/shadcn-snapshot/src/components/ui/drawer.tsx +112 -0
- package/pkgs/shadcn-snapshot/src/components/ui/dropdown-menu.tsx +205 -0
- package/pkgs/shadcn-snapshot/src/components/ui/empty.tsx +98 -0
- package/pkgs/shadcn-snapshot/src/components/ui/field.tsx +228 -0
- package/pkgs/shadcn-snapshot/src/components/ui/hover-card.tsx +51 -0
- package/pkgs/shadcn-snapshot/src/components/ui/input-group.tsx +148 -0
- package/pkgs/shadcn-snapshot/src/components/ui/input.tsx +43 -0
- package/pkgs/shadcn-snapshot/src/components/ui/item.tsx +187 -0
- package/pkgs/shadcn-snapshot/src/components/ui/kbd.tsx +30 -0
- package/pkgs/shadcn-snapshot/src/components/ui/label.tsx +25 -0
- package/pkgs/shadcn-snapshot/src/components/ui/marker.tsx +71 -0
- package/pkgs/shadcn-snapshot/src/components/ui/menubar.tsx +243 -0
- package/pkgs/shadcn-snapshot/src/components/ui/message.tsx +89 -0
- package/pkgs/shadcn-snapshot/src/components/ui/native-select.tsx +60 -0
- package/pkgs/shadcn-snapshot/src/components/ui/navigation-menu.tsx +165 -0
- package/pkgs/shadcn-snapshot/src/components/ui/pagination.tsx +117 -0
- package/pkgs/shadcn-snapshot/src/components/ui/popover.tsx +66 -0
- package/pkgs/shadcn-snapshot/src/components/ui/progress.tsx +35 -0
- package/pkgs/shadcn-snapshot/src/components/ui/radio-group.tsx +48 -0
- package/pkgs/shadcn-snapshot/src/components/ui/scroll-area.tsx +59 -0
- package/pkgs/shadcn-snapshot/src/components/ui/select.tsx +180 -0
- package/pkgs/shadcn-snapshot/src/components/ui/separator.tsx +32 -0
- package/pkgs/shadcn-snapshot/src/components/ui/sheet.tsx +107 -0
- package/pkgs/shadcn-snapshot/src/components/ui/skeleton.tsx +17 -0
- package/pkgs/shadcn-snapshot/src/components/ui/slider.tsx +68 -0
- package/pkgs/shadcn-snapshot/src/components/ui/sonner.tsx +91 -0
- package/pkgs/shadcn-snapshot/src/components/ui/spinner.tsx +21 -0
- package/pkgs/shadcn-snapshot/src/components/ui/switch.tsx +41 -0
- package/pkgs/shadcn-snapshot/src/components/ui/table.tsx +93 -0
- package/pkgs/shadcn-snapshot/src/components/ui/tabs.tsx +84 -0
- package/pkgs/shadcn-snapshot/src/components/ui/textarea.tsx +24 -0
- package/pkgs/shadcn-snapshot/src/components/ui/toggle-group.tsx +94 -0
- package/pkgs/shadcn-snapshot/src/components/ui/toggle.tsx +50 -0
- package/pkgs/shadcn-snapshot/src/components/ui/tooltip.tsx +47 -0
- package/pkgs/shadcn-snapshot/src/examples.ts +36 -0
- package/pkgs/shadcn-snapshot/src/groups.ts +87 -0
- package/pkgs/shadcn-snapshot/src/index.ts +43 -0
- package/pkgs/shadcn-snapshot/src/lib/utils.ts +4 -0
- package/pkgs/shadcn-snapshot/src/manifest.ts +12 -0
- package/pkgs/shadcn-snapshot/src/notes.ts +97 -0
- package/pkgs/shadcn-snapshot/src/paths.ts +47 -0
- package/pkgs/shadcn-snapshot/src/registry-files.ts +293 -0
- package/pkgs/shadcn-snapshot/src/registry.ts +631 -0
- package/pkgs/shadcn-snapshot/src/shadcn-tailwind.css +632 -0
- package/pkgs/shadcn-snapshot/src/tailwind-entry.css +159 -0
- package/pkgs/shadcn-snapshot/src/version.ts +8 -0
- package/plugins/claude/velloo/.claude-plugin/plugin.json +6 -0
- package/plugins/claude/velloo/agents/velloo-design-reviewer.md +33 -0
- package/plugins/claude/velloo/agents/velloo-designer.md +39 -0
- package/plugins/claude/velloo/commands/design.md +11 -0
- package/plugins/claude/velloo/commands/implement.md +10 -0
- package/plugins/claude/velloo/commands/review.md +8 -0
- package/plugins/gemini/GEMINI.md +31 -0
- package/plugins/gemini/commands/velloo/design.toml +10 -0
- package/plugins/gemini/commands/velloo/implement.toml +9 -0
- package/plugins/gemini/gemini-extension.json +9 -0
- package/skills/velloo-brand/SKILL.md +124 -0
- package/skills/velloo-design/SKILL.md +144 -0
- package/skills/velloo-design-system/SKILL.md +90 -0
- package/skills/velloo-implement/SKILL.md +101 -0
- package/skills/velloo-logo/SKILL.md +93 -0
- package/skills/velloo-setup/SKILL.md +156 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
AlertDescription,
|
|
4
|
+
AlertIcon,
|
|
5
|
+
AlertTitle,
|
|
6
|
+
Avatar,
|
|
7
|
+
Badge,
|
|
8
|
+
Box,
|
|
9
|
+
Breadcrumb,
|
|
10
|
+
BreadcrumbItem,
|
|
11
|
+
BreadcrumbLink,
|
|
12
|
+
Button,
|
|
13
|
+
Card,
|
|
14
|
+
CardBody,
|
|
15
|
+
CardFooter,
|
|
16
|
+
CardHeader,
|
|
17
|
+
Checkbox,
|
|
18
|
+
Container,
|
|
19
|
+
chakra,
|
|
20
|
+
Divider,
|
|
21
|
+
Flex,
|
|
22
|
+
Grid,
|
|
23
|
+
GridItem,
|
|
24
|
+
Heading,
|
|
25
|
+
HStack,
|
|
26
|
+
IconButton,
|
|
27
|
+
Input,
|
|
28
|
+
List,
|
|
29
|
+
ListItem,
|
|
30
|
+
Progress,
|
|
31
|
+
Radio,
|
|
32
|
+
Select,
|
|
33
|
+
Skeleton,
|
|
34
|
+
Slider,
|
|
35
|
+
SliderFilledTrack,
|
|
36
|
+
SliderThumb,
|
|
37
|
+
SliderTrack,
|
|
38
|
+
Spacer,
|
|
39
|
+
Stack,
|
|
40
|
+
Stat,
|
|
41
|
+
StatArrow,
|
|
42
|
+
StatHelpText,
|
|
43
|
+
StatLabel,
|
|
44
|
+
StatNumber,
|
|
45
|
+
Switch,
|
|
46
|
+
Tab,
|
|
47
|
+
TabList,
|
|
48
|
+
Table,
|
|
49
|
+
TableContainer,
|
|
50
|
+
TabPanel,
|
|
51
|
+
TabPanels,
|
|
52
|
+
Tabs,
|
|
53
|
+
Tag,
|
|
54
|
+
Tbody,
|
|
55
|
+
Td,
|
|
56
|
+
Text,
|
|
57
|
+
Textarea,
|
|
58
|
+
Th,
|
|
59
|
+
Thead,
|
|
60
|
+
Tr,
|
|
61
|
+
VStack,
|
|
62
|
+
} from "@chakra-ui/react";
|
|
63
|
+
import {
|
|
64
|
+
Gradient as VellooGradient,
|
|
65
|
+
Icon as VellooIcon,
|
|
66
|
+
Image as VellooImage,
|
|
67
|
+
Layer as VellooLayer,
|
|
68
|
+
Placeholder as VellooPlaceholder,
|
|
69
|
+
Prose as VellooProse,
|
|
70
|
+
SVG as VellooSVG,
|
|
71
|
+
} from "@velloo/helpers";
|
|
72
|
+
import type { ComponentRegistry } from "@velloo/provider";
|
|
73
|
+
import {
|
|
74
|
+
Drawer,
|
|
75
|
+
DrawerBody,
|
|
76
|
+
DrawerContent,
|
|
77
|
+
DrawerFooter,
|
|
78
|
+
DrawerHeader,
|
|
79
|
+
DrawerOverlay,
|
|
80
|
+
Menu,
|
|
81
|
+
MenuButton,
|
|
82
|
+
MenuDivider,
|
|
83
|
+
MenuItem,
|
|
84
|
+
MenuList,
|
|
85
|
+
Modal,
|
|
86
|
+
ModalBody,
|
|
87
|
+
ModalCloseButton,
|
|
88
|
+
ModalContent,
|
|
89
|
+
ModalFooter,
|
|
90
|
+
ModalHeader,
|
|
91
|
+
ModalOverlay,
|
|
92
|
+
Popover,
|
|
93
|
+
PopoverArrow,
|
|
94
|
+
PopoverBody,
|
|
95
|
+
PopoverContent,
|
|
96
|
+
PopoverHeader,
|
|
97
|
+
PopoverTrigger,
|
|
98
|
+
Tooltip,
|
|
99
|
+
} from "./overlays.ts";
|
|
100
|
+
|
|
101
|
+
// `chakra()` makes sx resolve through the same theme/runtime as native Chakra
|
|
102
|
+
// primitives while preserving each helper's Velloo-specific behavior.
|
|
103
|
+
const helperRegistry: ComponentRegistry = {
|
|
104
|
+
Icon: chakra(VellooIcon),
|
|
105
|
+
Image: chakra(VellooImage, {
|
|
106
|
+
// Velloo's fill-mode Image owns a wrapper. Keep layout styles (including
|
|
107
|
+
// width/height) on that root, and let ordinary Chakra `objectFit` /
|
|
108
|
+
// `objectPosition` values flow through to the actual child image.
|
|
109
|
+
baseStyle: {
|
|
110
|
+
objectFit: "cover",
|
|
111
|
+
objectPosition: "50% 50%",
|
|
112
|
+
"& > img": { objectFit: "inherit", objectPosition: "inherit" },
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
Placeholder: chakra(VellooPlaceholder),
|
|
116
|
+
SVG: chakra(VellooSVG),
|
|
117
|
+
Layer: chakra(VellooLayer),
|
|
118
|
+
Gradient: chakra(VellooGradient),
|
|
119
|
+
Prose: chakra(VellooProse),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The runtime registry for chakra-native folders: design `$ref` ids → real
|
|
124
|
+
* Chakra v2 components, SSR'd in-process via the adapter's emotion render
|
|
125
|
+
* pass. The overlay surface (Modal/Drawer/Popover/Menu/Tooltip and their
|
|
126
|
+
* composition parts) is canvas-safe-wrapped in `overlays.ts` — chakra's own
|
|
127
|
+
* overlays portal and render NOTHING in SSR, and their sub-parts throw
|
|
128
|
+
* outside the real parent's context, so the shims render the whole
|
|
129
|
+
* composition open + inline. Chakra's own `Icon`/`Image` are deliberately not
|
|
130
|
+
* registered — those ids belong to the framework-neutral velloo helpers
|
|
131
|
+
* (Icon → lucide), like on the MUI/antd folders.
|
|
132
|
+
*/
|
|
133
|
+
export const registry: ComponentRegistry = {
|
|
134
|
+
// layout
|
|
135
|
+
Box,
|
|
136
|
+
Container,
|
|
137
|
+
Flex,
|
|
138
|
+
Grid,
|
|
139
|
+
GridItem,
|
|
140
|
+
HStack,
|
|
141
|
+
Spacer,
|
|
142
|
+
Stack,
|
|
143
|
+
VStack,
|
|
144
|
+
// surfaces + data display
|
|
145
|
+
Alert,
|
|
146
|
+
AlertDescription,
|
|
147
|
+
AlertIcon,
|
|
148
|
+
AlertTitle,
|
|
149
|
+
Avatar,
|
|
150
|
+
Badge,
|
|
151
|
+
Card,
|
|
152
|
+
CardBody,
|
|
153
|
+
CardFooter,
|
|
154
|
+
CardHeader,
|
|
155
|
+
Divider,
|
|
156
|
+
Progress,
|
|
157
|
+
Skeleton,
|
|
158
|
+
Stat,
|
|
159
|
+
StatArrow,
|
|
160
|
+
StatHelpText,
|
|
161
|
+
StatLabel,
|
|
162
|
+
StatNumber,
|
|
163
|
+
Tag,
|
|
164
|
+
// typography
|
|
165
|
+
Heading,
|
|
166
|
+
Text,
|
|
167
|
+
// controls
|
|
168
|
+
Button,
|
|
169
|
+
Checkbox,
|
|
170
|
+
IconButton,
|
|
171
|
+
Input,
|
|
172
|
+
Radio,
|
|
173
|
+
Select,
|
|
174
|
+
Slider,
|
|
175
|
+
SliderFilledTrack,
|
|
176
|
+
SliderThumb,
|
|
177
|
+
SliderTrack,
|
|
178
|
+
Switch,
|
|
179
|
+
Textarea,
|
|
180
|
+
// data
|
|
181
|
+
Breadcrumb,
|
|
182
|
+
BreadcrumbItem,
|
|
183
|
+
BreadcrumbLink,
|
|
184
|
+
List,
|
|
185
|
+
ListItem,
|
|
186
|
+
Tab,
|
|
187
|
+
Table,
|
|
188
|
+
TableContainer,
|
|
189
|
+
TabList,
|
|
190
|
+
TabPanel,
|
|
191
|
+
TabPanels,
|
|
192
|
+
Tabs,
|
|
193
|
+
Tbody,
|
|
194
|
+
Td,
|
|
195
|
+
Th,
|
|
196
|
+
Thead,
|
|
197
|
+
Tr,
|
|
198
|
+
// overlays (canvas-safe shims)
|
|
199
|
+
Drawer,
|
|
200
|
+
DrawerBody,
|
|
201
|
+
DrawerContent,
|
|
202
|
+
DrawerFooter,
|
|
203
|
+
DrawerHeader,
|
|
204
|
+
DrawerOverlay,
|
|
205
|
+
Menu,
|
|
206
|
+
MenuButton,
|
|
207
|
+
MenuDivider,
|
|
208
|
+
MenuItem,
|
|
209
|
+
MenuList,
|
|
210
|
+
Modal,
|
|
211
|
+
ModalBody,
|
|
212
|
+
ModalCloseButton,
|
|
213
|
+
ModalContent,
|
|
214
|
+
ModalFooter,
|
|
215
|
+
ModalHeader,
|
|
216
|
+
ModalOverlay,
|
|
217
|
+
Popover,
|
|
218
|
+
PopoverArrow,
|
|
219
|
+
PopoverBody,
|
|
220
|
+
PopoverContent,
|
|
221
|
+
PopoverHeader,
|
|
222
|
+
PopoverTrigger,
|
|
223
|
+
Tooltip,
|
|
224
|
+
// Framework-neutral behavior, wrapped so Chakra's sx channel styles the
|
|
225
|
+
// helper root just like it styles Box/Button/Card.
|
|
226
|
+
...helperRegistry,
|
|
227
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChakraProvider, extendTheme } from "@chakra-ui/react";
|
|
2
|
+
import createCache from "@emotion/cache";
|
|
3
|
+
import { CacheProvider } from "@emotion/react";
|
|
4
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
5
|
+
import type { RenderPass } from "@velloo/provider";
|
|
6
|
+
import type { Theme as VellooTheme } from "@velloo/schema";
|
|
7
|
+
import { createElement } from "react";
|
|
8
|
+
import { chakraThemeOptions } from "./theme.ts";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A fresh emotion + chakra render pass for one SSR. `wrap` nests the tree
|
|
12
|
+
* under a per-render emotion CacheProvider + a ChakraProvider carrying
|
|
13
|
+
* `extendTheme` over the projected velloo tokens; `css(html)` extracts the
|
|
14
|
+
* emotion rules the render registered — including chakra's Global styles
|
|
15
|
+
* (the `--chakra-*` CSS variables every component references), which
|
|
16
|
+
* `extractCriticalToChunks` keeps because globals are never in
|
|
17
|
+
* `cache.registered`. The renderer injects that CSS into a
|
|
18
|
+
* `data-velloo-adapter` <style>.
|
|
19
|
+
*
|
|
20
|
+
* SSR works in-process because @chakra-ui/react is a velloo dependency, so it
|
|
21
|
+
* links the shared monorepo React — no dual-React hazard.
|
|
22
|
+
*/
|
|
23
|
+
export function makeRenderPass(theme: VellooTheme, dark = false): RenderPass {
|
|
24
|
+
const cache = createCache({ key: "vchakra", prepend: true });
|
|
25
|
+
const server = createEmotionServer(cache);
|
|
26
|
+
const chakraTheme = extendTheme(chakraThemeOptions(theme, dark));
|
|
27
|
+
return {
|
|
28
|
+
wrap: (element) =>
|
|
29
|
+
createElement(
|
|
30
|
+
CacheProvider,
|
|
31
|
+
{ value: cache },
|
|
32
|
+
createElement(
|
|
33
|
+
ChakraProvider,
|
|
34
|
+
{ theme: chakraTheme },
|
|
35
|
+
// The projected theme already carries real dark values at :root, but
|
|
36
|
+
// the data-theme/classname scope also switches chakra's own `_dark`
|
|
37
|
+
// component styling (whiteAlpha borders etc.) — ColorModeScript
|
|
38
|
+
// would set these on <html> in a real app; SSR has no client pass.
|
|
39
|
+
createElement(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
"data-theme": dark ? "dark" : "light",
|
|
43
|
+
className: dark ? "chakra-ui-dark" : "chakra-ui-light",
|
|
44
|
+
},
|
|
45
|
+
element,
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
css: (html) =>
|
|
50
|
+
server
|
|
51
|
+
.extractCriticalToChunks(html)
|
|
52
|
+
.styles.map((s) => s.css)
|
|
53
|
+
.join(""),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Chakra styles components via emotion (the extendTheme tokens + the `sx`
|
|
3
|
+
* prop), not Tailwind utility classes — so this entry mostly exists to
|
|
4
|
+
* satisfy the JIT contract. It still imports Tailwind + declares the token
|
|
5
|
+
* @theme so any stray utility class resolves, and the canvas base reads themed.
|
|
6
|
+
*/
|
|
7
|
+
@import "tailwindcss";
|
|
8
|
+
|
|
9
|
+
@theme {
|
|
10
|
+
--color-background: oklch(1 0 0);
|
|
11
|
+
--color-foreground: oklch(0.145 0 0);
|
|
12
|
+
--color-primary: oklch(0.205 0 0);
|
|
13
|
+
--color-primary-foreground: oklch(0.985 0 0);
|
|
14
|
+
--font-sans: system-ui, -apple-system, sans-serif;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html, body {
|
|
18
|
+
background: var(--color-background);
|
|
19
|
+
color: var(--color-foreground);
|
|
20
|
+
font-family: var(--font-sans);
|
|
21
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ColorPair,
|
|
3
|
+
DEFAULT_TYPESET_NAME,
|
|
4
|
+
resolveColors,
|
|
5
|
+
typesetScale,
|
|
6
|
+
type Theme as VellooTheme,
|
|
7
|
+
} from "@velloo/schema";
|
|
8
|
+
import { converter, formatHex, formatRgb, parse } from "culori";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Chakra's color utilities (@ctrl/tinycolor inside @chakra-ui/theme-tools,
|
|
12
|
+
* behind the Alert/Tag/Badge subtle variants) parse `#hex`, `rgb()/rgba()`,
|
|
13
|
+
* `hsl()/hsla()` — NOT `oklch()`, which is exactly what velloo themes store.
|
|
14
|
+
* Convert anything outside that set to `rgb(...)` via culori; pass
|
|
15
|
+
* chakra-native formats through untouched so a hex theme stays hex (and
|
|
16
|
+
* round-trips identically in codegen).
|
|
17
|
+
*/
|
|
18
|
+
function chakraColor(css: string): string {
|
|
19
|
+
const s = css.trim();
|
|
20
|
+
if (/^(#|rgb|hsl)/i.test(s)) return s;
|
|
21
|
+
return formatRgb(parse(s)) ?? s;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A color slot is a CSS string or a { DEFAULT, foreground } pair — pull the base color (chakra-safe). */
|
|
25
|
+
function base(slot: ColorPair | undefined, fallback: string): string {
|
|
26
|
+
if (typeof slot === "string") return chakraColor(slot);
|
|
27
|
+
if (slot && typeof slot === "object" && typeof slot.DEFAULT === "string")
|
|
28
|
+
return chakraColor(slot.DEFAULT);
|
|
29
|
+
return chakraColor(fallback);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const toOklch = converter("oklch");
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Derive a chakra 50–900 `brand` color scale from the theme's primary color.
|
|
36
|
+
* The primary lands verbatim at `brand.500` (what `colorScheme="brand"` solid
|
|
37
|
+
* buttons use in light mode); lighter steps walk a fixed OKLCH lightness ramp
|
|
38
|
+
* with chroma eased toward white, darker steps scale the base lightness down.
|
|
39
|
+
* Tuned for mid-lightness brand colors (the norm); a gray primary (chroma 0)
|
|
40
|
+
* degrades to a clean neutral ramp.
|
|
41
|
+
*/
|
|
42
|
+
export function brandScale(primary: string): Record<string, string> {
|
|
43
|
+
const safe = chakraColor(primary);
|
|
44
|
+
const okl = (() => {
|
|
45
|
+
const parsed = parse(primary);
|
|
46
|
+
return parsed ? toOklch(parsed) : undefined;
|
|
47
|
+
})();
|
|
48
|
+
if (!okl) {
|
|
49
|
+
// Unparsable color: a flat scale keeps every `brand.*` reference resolving.
|
|
50
|
+
return Object.fromEntries(
|
|
51
|
+
["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"].map((k) => [k, safe]),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
const { l = 0.55, c = 0, h } = okl;
|
|
55
|
+
const at = (lightness: number, chroma: number): string =>
|
|
56
|
+
formatHex({
|
|
57
|
+
mode: "oklch",
|
|
58
|
+
l: Math.min(Math.max(lightness, 0), 1),
|
|
59
|
+
c: Math.max(chroma, 0),
|
|
60
|
+
// An achromatic color has no hue — omit the key rather than passing
|
|
61
|
+
// undefined, which culori's Oklch type (rightly) does not accept.
|
|
62
|
+
...(h === undefined ? {} : { h }),
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
50: at(0.982, c * 0.12),
|
|
66
|
+
100: at(0.955, c * 0.25),
|
|
67
|
+
200: at(0.9, c * 0.45),
|
|
68
|
+
300: at(0.83, c * 0.65),
|
|
69
|
+
400: at(0.73, c * 0.85),
|
|
70
|
+
500: safe,
|
|
71
|
+
600: at(l * 0.88, c),
|
|
72
|
+
700: at(l * 0.74, c * 0.95),
|
|
73
|
+
800: at(l * 0.6, c * 0.85),
|
|
74
|
+
900: at(l * 0.47, c * 0.72),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Chakra radii are CSS lengths; coerce velloo's radius.md (number or CSS len). */
|
|
79
|
+
function radiusCss(theme: VellooTheme): string {
|
|
80
|
+
const md = (theme.radius as Record<string, unknown> | undefined)?.md;
|
|
81
|
+
if (typeof md === "number") return `${md}px`;
|
|
82
|
+
if (typeof md === "string") return md;
|
|
83
|
+
return "8px";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** The extendTheme input POJO `chakraThemeOptions` projects — typed so tests read fields directly. */
|
|
87
|
+
export interface ChakraThemeOptions {
|
|
88
|
+
config: { initialColorMode: "light" | "dark"; useSystemColorMode: boolean };
|
|
89
|
+
colors: { brand: Record<string, string> };
|
|
90
|
+
semanticTokens: { colors: Record<string, string> };
|
|
91
|
+
fonts: { heading: string; body: string; mono?: string };
|
|
92
|
+
fontSizes: Record<string, string>;
|
|
93
|
+
lineHeights: Record<string, number>;
|
|
94
|
+
letterSpacings: Record<string, string>;
|
|
95
|
+
fontWeights: Record<string, number>;
|
|
96
|
+
radii: { md: string };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Project the default typeset onto chakra's typography scales.
|
|
101
|
+
*
|
|
102
|
+
* chakra's theme is a serialized POJO — it ends up in an `extendTheme(...)`
|
|
103
|
+
* artifact where no CSS variables exist — so this reads `typesetScale`, the
|
|
104
|
+
* concrete-value form of the same ratio table `typesetCss` uses symbolically.
|
|
105
|
+
* Keys are the velloo role names, so `fontSize="h1"` in a chakra folder resolves
|
|
106
|
+
* to the same size the canvas paints.
|
|
107
|
+
*/
|
|
108
|
+
function chakraTypography(
|
|
109
|
+
theme: VellooTheme,
|
|
110
|
+
fallbackSans: string,
|
|
111
|
+
): Pick<
|
|
112
|
+
ChakraThemeOptions,
|
|
113
|
+
"fonts" | "fontSizes" | "lineHeights" | "letterSpacings" | "fontWeights"
|
|
114
|
+
> {
|
|
115
|
+
const typography = theme.typography;
|
|
116
|
+
const scale = typesetScale(typography.typesets?.[DEFAULT_TYPESET_NAME], {
|
|
117
|
+
...(typography.fontFamily ? { fontFamily: typography.fontFamily } : {}),
|
|
118
|
+
});
|
|
119
|
+
const fontSizes: Record<string, string> = {};
|
|
120
|
+
const lineHeights: Record<string, number> = {};
|
|
121
|
+
const letterSpacings: Record<string, string> = {};
|
|
122
|
+
const fontWeights: Record<string, number> = {};
|
|
123
|
+
for (const [role, resolved] of Object.entries(scale)) {
|
|
124
|
+
fontSizes[role] = `${resolved.fontSize}px`;
|
|
125
|
+
lineHeights[role] = resolved.lineHeight;
|
|
126
|
+
letterSpacings[role] = resolved.letterSpacing;
|
|
127
|
+
fontWeights[role] = resolved.fontWeight;
|
|
128
|
+
}
|
|
129
|
+
const mono = typography.fontFamily?.mono;
|
|
130
|
+
return {
|
|
131
|
+
fonts: {
|
|
132
|
+
// The heading face, which the typeset names explicitly. Before typesets
|
|
133
|
+
// this was the body font, so a folder with a display face never used it.
|
|
134
|
+
heading: scale.h1.fontFamily ?? fallbackSans,
|
|
135
|
+
body: scale.body.fontFamily ?? fallbackSans,
|
|
136
|
+
...(mono ? { mono } : {}),
|
|
137
|
+
},
|
|
138
|
+
fontSizes,
|
|
139
|
+
lineHeights,
|
|
140
|
+
letterSpacings,
|
|
141
|
+
fontWeights,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Project velloo's unified token tree onto chakra `extendTheme` options — the
|
|
147
|
+
* SINGLE source of the velloo→chakra mapping shared by the runtime render pass
|
|
148
|
+
* and codegen, so the preview and the emitted theme never diverge.
|
|
149
|
+
*
|
|
150
|
+
* Dark is a dark-FLAVORED theme, not a mode flag: `colorsDark` overlays the
|
|
151
|
+
* color slots and the projected values land as plain strings on chakra's own
|
|
152
|
+
* semantic tokens (`chakra-body-bg` etc.), so they apply at `:root` — a static
|
|
153
|
+
* SSR shows real dark surfaces without the client-side `data-theme` attribute
|
|
154
|
+
* ColorModeScript would set. `initialColorMode` flips too so context-driven
|
|
155
|
+
* (`useColorModeValue`) styling agrees.
|
|
156
|
+
*/
|
|
157
|
+
export function chakraThemeOptions(theme: VellooTheme, dark = false): ChakraThemeOptions {
|
|
158
|
+
const c = resolveColors(theme, dark);
|
|
159
|
+
const fg = chakraColor(c.foreground);
|
|
160
|
+
const sans = theme.typography.fontFamily?.sans ?? "system-ui, -apple-system, sans-serif";
|
|
161
|
+
return {
|
|
162
|
+
config: { initialColorMode: dark ? "dark" : "light", useSystemColorMode: false },
|
|
163
|
+
colors: { brand: brandScale(base(c.primary, "#4f46e5")) },
|
|
164
|
+
semanticTokens: {
|
|
165
|
+
colors: {
|
|
166
|
+
"chakra-body-bg": chakraColor(c.background),
|
|
167
|
+
"chakra-body-text": fg,
|
|
168
|
+
...(c.border ? { "chakra-border-color": chakraColor(c.border) } : {}),
|
|
169
|
+
...(c.muted
|
|
170
|
+
? {
|
|
171
|
+
"chakra-subtle-text": base(c.muted, fg),
|
|
172
|
+
"chakra-placeholder-color": base(c.muted, fg),
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
...chakraTypography(theme, sans),
|
|
178
|
+
radii: { md: radiusCss(theme) },
|
|
179
|
+
};
|
|
180
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lives in its own module (exported as `@velloo/provider-chakra/version`) so
|
|
3
|
+
* version-only consumers — the CLI init wizard — don't pull the provider's
|
|
4
|
+
* registry (and with it all of @chakra-ui/react) into their import graph.
|
|
5
|
+
* The bundled CLI lazy-loads the full provider per folder config; see
|
|
6
|
+
* `packages/server/src/providers.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export const CHAKRA_VERSION = "2" as const;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { helperSourcePath } from "@velloo/helpers/paths";
|
|
4
|
+
import {
|
|
5
|
+
type CanvasComponentSpec,
|
|
6
|
+
catalogFromManifest,
|
|
7
|
+
type FrameworkAdapter,
|
|
8
|
+
type Manifest,
|
|
9
|
+
SX_PROP,
|
|
10
|
+
} from "@velloo/provider";
|
|
11
|
+
import { resolveProviderSrcDir } from "@velloo/provider/src-dir";
|
|
12
|
+
import { MUI_INTRO } from "./intro.ts";
|
|
13
|
+
import { MUI_MANIFEST } from "./manifest.ts";
|
|
14
|
+
import { registry } from "./registry.ts";
|
|
15
|
+
import { makeRenderPass } from "./render-pass.ts";
|
|
16
|
+
import { muiThemeOptions } from "./theme.ts";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Material UI v6 provider — a first-class FrameworkAdapter. MUI ships as a
|
|
20
|
+
* velloo dependency (pre-bundle), so its components SSR in-process against the shared monorepo
|
|
21
|
+
* React; the adapter's emotion `renderPass` extracts the critical CSS. Styling
|
|
22
|
+
* is the `sx` prop (not Tailwind), and the theme projects velloo tokens onto a
|
|
23
|
+
* MUI `createTheme`. Canvas-safe overlays (Dialog/Menu/Popover/Drawer/Snackbar),
|
|
24
|
+
* `sx`/`createTheme` codegen, `velloo init --library=mui`, the catalog, and the
|
|
25
|
+
* installed-component canvas bundle (`canvasBundleSpec`) are all wired. The only
|
|
26
|
+
* deliberate non-build is a `.d.ts` manifest generator — the curated
|
|
27
|
+
* `MUI_MANIFEST` reads better than a generated dump of MUI's type surface.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export { MUI_VERSION } from "./version.ts";
|
|
31
|
+
|
|
32
|
+
import { MUI_VERSION } from "./version.ts";
|
|
33
|
+
|
|
34
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
35
|
+
|
|
36
|
+
/** Resolve the provider src (Tailwind entry + sources), from dev + the bundled CLI. */
|
|
37
|
+
const srcDir = resolveProviderSrcDir(here, "provider-mui", process.env.VELLOO_MUI_SRC);
|
|
38
|
+
|
|
39
|
+
export function createProvider(): FrameworkAdapter {
|
|
40
|
+
const overlayIds = ["Dialog", "Menu", "Popover", "Drawer", "Snackbar"];
|
|
41
|
+
return {
|
|
42
|
+
id: "mui",
|
|
43
|
+
version: MUI_VERSION,
|
|
44
|
+
label: "Material UI v6",
|
|
45
|
+
componentsDir: srcDir,
|
|
46
|
+
styleEntryPath: join(srcDir, "tailwind-entry.css"),
|
|
47
|
+
registry,
|
|
48
|
+
loadManifest: async (): Promise<Manifest> => MUI_MANIFEST,
|
|
49
|
+
// The catalog is the MUI *library* surface — every `@mui/material` component,
|
|
50
|
+
// all installed (bundled). The reused velloo helpers (source "velloo", e.g.
|
|
51
|
+
// Icon→lucide) are always-available built-ins, not library components to
|
|
52
|
+
// install, so they're excluded.
|
|
53
|
+
catalog: async () =>
|
|
54
|
+
catalogFromManifest(
|
|
55
|
+
MUI_MANIFEST.filter((c) => c.source === "mui"),
|
|
56
|
+
{ importPath: "@mui/material" },
|
|
57
|
+
),
|
|
58
|
+
styleChannel: SX_PROP,
|
|
59
|
+
styleChannels: ["sx"],
|
|
60
|
+
mcpIntro: () => [...MUI_INTRO],
|
|
61
|
+
renderPass: (theme, dark) => makeRenderPass(theme, dark ?? false),
|
|
62
|
+
codegenModule: "@mui/material",
|
|
63
|
+
themeToNative: (theme, dark) => muiThemeOptions(theme, dark),
|
|
64
|
+
themeModule: {
|
|
65
|
+
importLines: ['import { createTheme } from "@mui/material/styles";'],
|
|
66
|
+
factory: "createTheme",
|
|
67
|
+
defaultPath: "theme.ts",
|
|
68
|
+
},
|
|
69
|
+
canvasBundleSpec: {
|
|
70
|
+
components: (ids) =>
|
|
71
|
+
ids.flatMap((id): CanvasComponentSpec[] => {
|
|
72
|
+
const descriptor = MUI_MANIFEST.find((entry) => entry.id === id);
|
|
73
|
+
if (!descriptor) return [];
|
|
74
|
+
if (descriptor.source === "velloo") {
|
|
75
|
+
const path = helperSourcePath(id);
|
|
76
|
+
return path
|
|
77
|
+
? [
|
|
78
|
+
{
|
|
79
|
+
id,
|
|
80
|
+
sources: [
|
|
81
|
+
{
|
|
82
|
+
importPath: path,
|
|
83
|
+
exportName: id,
|
|
84
|
+
fidelity: "fallback" as const,
|
|
85
|
+
note: "Velloo helper used alongside the host framework.",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
]
|
|
90
|
+
: [];
|
|
91
|
+
}
|
|
92
|
+
return [
|
|
93
|
+
{
|
|
94
|
+
id,
|
|
95
|
+
sources: [
|
|
96
|
+
{
|
|
97
|
+
importPath: `@mui/material/${id}`,
|
|
98
|
+
exportName: id,
|
|
99
|
+
fidelity: overlayIds.includes(id) ? ("adapted" as const) : ("exact" as const),
|
|
100
|
+
...(overlayIds.includes(id)
|
|
101
|
+
? { note: "Real MUI surface rendered through an inline canvas overlay shim." }
|
|
102
|
+
: {}),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
}),
|
|
108
|
+
overlayIds,
|
|
109
|
+
styleRuntime: { kind: "emotion", cacheKey: "vmui", stylesModule: "@mui/material/styles" },
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The id used in `Library.id` to select this provider. */
|
|
115
|
+
export const MUI_PROVIDER_ID = "mui" as const;
|
|
116
|
+
|
|
117
|
+
export { muiThemeFrom, muiThemeOptions } from "./theme.ts";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP instruction framing for a MUI folder (`FrameworkAdapter.mcpIntro`).
|
|
3
|
+
*
|
|
4
|
+
* The server's base brief is framework-neutral, so this states the vocabulary
|
|
5
|
+
* and the style channel positively rather than correcting a shadcn claim.
|
|
6
|
+
*/
|
|
7
|
+
export const MUI_INTRO: readonly string[] = [
|
|
8
|
+
"**This folder targets Material UI.** Components are real MUI: `Box`/`Stack`/`Container`/`Paper` for layout, `Card`/`CardContent`/`CardHeader`/`CardActions`, `Typography` (ALL text — pick `variant` for the type scale), `Button`/`IconButton`, `TextField`, `Chip`, `Divider`, `Avatar`, `List`/`ListItem`, `Table*`, `Tabs`/`Tab`, `Alert`, `Tooltip`, and the overlay surface `Dialog`/`Menu`/`Popover`/`Drawer`/`Snackbar` (rendered open + inline in design mode). Call `list_components` for the full set and per-component `example` props.",
|
|
9
|
+
"",
|
|
10
|
+
'**Style through `sx`.** `update_props { style: { display: "flex", alignItems: "center", gap: 2, p: 3, color: "primary.main" } }` — an object of MUI system props, where spacing is theme units (`p: 2` = 16px). It merges shallowly; an inner `null` drops a key, `style: null` clears. `emit_code` emits `<Component sx={{…}} />` importing from `@mui/material`; `emit_theme` emits a `createTheme(...)` module. Tailwind utility diagnostics do not apply here — style via `sx` plus the shared theme tokens from `get_theme`, which project onto MUI.',
|
|
11
|
+
"",
|
|
12
|
+
];
|