base-themes 0.1.1 → 0.1.3
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/CHANGELOG.md +25 -0
- package/CODE_OF_CONDUCT.md +22 -0
- package/CONTRIBUTING.md +98 -0
- package/LICENSE +21 -0
- package/README.md +324 -5
- package/RELEASE.md +80 -0
- package/SECURITY.md +49 -0
- package/bin/base-themes.mjs +143 -0
- package/dist/base-themes.css +1 -1
- package/dist/base-themes.js +857 -302
- package/dist/llms-full.txt +288 -0
- package/dist/llms.txt +79 -0
- package/dist/types/blocks/AuthCard.d.ts +2 -0
- package/dist/types/blocks/CommandPaletteBlock.d.ts +2 -0
- package/dist/types/blocks/DashboardShell.d.ts +2 -0
- package/dist/types/blocks/DataTableBlock.d.ts +2 -0
- package/dist/types/blocks/PricingPanel.d.ts +2 -0
- package/dist/types/blocks/SettingsForm.d.ts +2 -0
- package/dist/types/blocks/TeamActivityFeed.d.ts +2 -0
- package/dist/types/blocks/ThemeShowcaseCard.d.ts +2 -0
- package/dist/types/blocks/index.d.ts +8 -0
- package/dist/types/components/ui/Input.d.ts +3 -0
- package/dist/types/components/ui/index.d.ts +1 -1
- package/dist/types/lib.d.ts +1 -0
- package/docs/adoption-dashboard.md +149 -0
- package/docs/analytics-setup.md +145 -0
- package/docs/community-gallery-proposal.md +64 -0
- package/docs/community-proof-telemetry.md +47 -0
- package/docs/contributor-issue-seeds.md +240 -0
- package/docs/registry-access-telemetry.md +87 -0
- package/docs/release-announcement-kit.md +229 -0
- package/docs/search-console-setup.md +111 -0
- package/docs/theme-token-contract.md +113 -0
- package/examples/dashboard/README.md +24 -0
- package/examples/dashboard/index.html +12 -0
- package/examples/dashboard/package-lock.json +1212 -0
- package/examples/dashboard/package.json +24 -0
- package/examples/dashboard/src/App.tsx +115 -0
- package/examples/dashboard/src/main.tsx +11 -0
- package/examples/dashboard/src/styles.css +129 -0
- package/examples/dashboard/src/vite-env.d.ts +4 -0
- package/examples/dashboard/tsconfig.app.json +23 -0
- package/examples/dashboard/tsconfig.json +7 -0
- package/examples/dashboard/tsconfig.node.json +15 -0
- package/examples/dashboard/vite.config.ts +6 -0
- package/examples/next/README.md +29 -0
- package/examples/next/app/base-themes-demo.tsx +70 -0
- package/examples/next/app/layout.tsx +16 -0
- package/examples/next/app/page.tsx +9 -0
- package/examples/next/app/styles.css +106 -0
- package/examples/next/next-env.d.ts +6 -0
- package/examples/next/next.config.ts +5 -0
- package/examples/next/package-lock.json +1199 -0
- package/examples/next/package.json +27 -0
- package/examples/next/tsconfig.json +36 -0
- package/examples/registry-copy/README.md +73 -0
- package/examples/registry-copy/plan-copy.mjs +130 -0
- package/examples/theme-customization/README.md +26 -0
- package/examples/theme-customization/index.html +12 -0
- package/examples/theme-customization/package-lock.json +1212 -0
- package/examples/theme-customization/package.json +24 -0
- package/examples/theme-customization/src/App.tsx +138 -0
- package/examples/theme-customization/src/main.tsx +11 -0
- package/examples/theme-customization/src/styles.css +138 -0
- package/examples/theme-customization/src/vite-env.d.ts +4 -0
- package/examples/theme-customization/tsconfig.app.json +23 -0
- package/examples/theme-customization/tsconfig.json +7 -0
- package/examples/theme-customization/tsconfig.node.json +15 -0
- package/examples/theme-customization/vite.config.ts +6 -0
- package/examples/vite/README.md +32 -0
- package/examples/vite/index.html +12 -0
- package/examples/vite/package-lock.json +1200 -0
- package/examples/vite/package.json +24 -0
- package/examples/vite/src/App.tsx +101 -0
- package/examples/vite/src/main.tsx +11 -0
- package/examples/vite/src/styles.css +125 -0
- package/examples/vite/src/vite-env.d.ts +4 -0
- package/examples/vite/tsconfig.app.json +23 -0
- package/examples/vite/tsconfig.json +7 -0
- package/examples/vite/tsconfig.node.json +15 -0
- package/examples/vite/vite.config.ts +6 -0
- package/llms-full.txt +288 -0
- package/llms.txt +79 -0
- package/package.json +157 -14
- package/public/previews/base-themes-bauhaus.png +0 -0
- package/public/previews/base-themes-bento.png +0 -0
- package/public/previews/base-themes-calm.png +0 -0
- package/public/previews/base-themes-cyberpunk.png +0 -0
- package/public/previews/base-themes-data-dense.png +0 -0
- package/public/previews/base-themes-editorial.png +0 -0
- package/public/previews/base-themes-enterprise.png +0 -0
- package/public/previews/base-themes-fluent.png +0 -0
- package/public/previews/base-themes-glass.png +0 -0
- package/public/previews/base-themes-linear.png +0 -0
- package/public/previews/base-themes-luxury.png +0 -0
- package/public/previews/base-themes-material.png +0 -0
- package/public/previews/base-themes-minimal.png +0 -0
- package/public/previews/base-themes-mono.png +0 -0
- package/public/previews/base-themes-neo-brutalism.png +0 -0
- package/public/previews/base-themes-playful.png +0 -0
- package/public/previews/base-themes-retro.png +0 -0
- package/public/previews/base-themes-shadcn.png +0 -0
- package/public/previews/base-themes-soft-ui.png +0 -0
- package/public/previews/base-themes-terminal.png +0 -0
- package/registry/items/accordion.json +101 -0
- package/registry/items/alert-dialog.json +107 -0
- package/registry/items/autocomplete.json +106 -0
- package/registry/items/avatar.json +101 -0
- package/registry/items/block-auth-card.json +105 -0
- package/registry/items/block-command-palette.json +99 -0
- package/registry/items/block-dashboard-shell.json +101 -0
- package/registry/items/block-data-table.json +99 -0
- package/registry/items/block-pricing-panel.json +99 -0
- package/registry/items/block-settings-form.json +107 -0
- package/registry/items/block-team-activity-feed.json +99 -0
- package/registry/items/block-theme-showcase-card.json +99 -0
- package/registry/items/button.json +102 -0
- package/registry/items/checkbox-group.json +106 -0
- package/registry/items/checkbox.json +102 -0
- package/registry/items/collapsible.json +101 -0
- package/registry/items/combobox.json +101 -0
- package/registry/items/context-menu.json +106 -0
- package/registry/items/csp-provider.json +96 -0
- package/registry/items/dialog.json +102 -0
- package/registry/items/direction-provider.json +101 -0
- package/registry/items/drawer.json +101 -0
- package/registry/items/field.json +101 -0
- package/registry/items/fieldset.json +101 -0
- package/registry/items/form.json +101 -0
- package/registry/items/input.json +102 -0
- package/registry/items/menu.json +101 -0
- package/registry/items/menubar.json +106 -0
- package/registry/items/meter.json +101 -0
- package/registry/items/navigation-menu.json +101 -0
- package/registry/items/number-field.json +101 -0
- package/registry/items/otp-field.json +101 -0
- package/registry/items/popover.json +102 -0
- package/registry/items/preview-card.json +101 -0
- package/registry/items/progress.json +101 -0
- package/registry/items/radio-group.json +102 -0
- package/registry/items/radio.json +101 -0
- package/registry/items/scroll-area.json +101 -0
- package/registry/items/select.json +102 -0
- package/registry/items/separator.json +101 -0
- package/registry/items/slider.json +102 -0
- package/registry/items/switch.json +102 -0
- package/registry/items/tabs.json +101 -0
- package/registry/items/theme-bauhaus.json +107 -0
- package/registry/items/theme-bento.json +107 -0
- package/registry/items/theme-calm.json +107 -0
- package/registry/items/theme-cyberpunk.json +108 -0
- package/registry/items/theme-data-dense.json +107 -0
- package/registry/items/theme-editorial.json +107 -0
- package/registry/items/theme-enterprise.json +108 -0
- package/registry/items/theme-fluent.json +107 -0
- package/registry/items/theme-glass.json +107 -0
- package/registry/items/theme-linear.json +107 -0
- package/registry/items/theme-luxury.json +107 -0
- package/registry/items/theme-material.json +107 -0
- package/registry/items/theme-minimal.json +107 -0
- package/registry/items/theme-mono.json +107 -0
- package/registry/items/theme-neo-brutalism.json +107 -0
- package/registry/items/theme-playful.json +107 -0
- package/registry/items/theme-retro.json +107 -0
- package/registry/items/theme-shadcn.json +107 -0
- package/registry/items/theme-soft-ui.json +107 -0
- package/registry/items/theme-terminal.json +107 -0
- package/registry/items/toast.json +106 -0
- package/registry/items/toggle-group.json +101 -0
- package/registry/items/toggle.json +101 -0
- package/registry/items/toolbar.json +101 -0
- package/registry/items/tooltip.json +102 -0
- package/registry/registry.json +564 -49
- package/registry/shadcn-registry.json +415 -0
- package/research/telemetry-fixtures/analytics-events.jsonl +9 -0
- package/research/telemetry-fixtures/bundle-report.json +44 -0
- package/research/telemetry-fixtures/community-proof.csv +5 -0
- package/research/telemetry-fixtures/registry-access.jsonl +10 -0
- package/research/telemetry-fixtures/search-console-export.csv +4 -0
- package/scripts/registry-plan.mjs +434 -0
- package/scripts/render-launch-actions.mjs +405 -0
- package/scripts/render-launch-status.mjs +373 -0
- package/scripts/render-release-announcement.mjs +329 -0
- package/scripts/verify-launch-readiness.mjs +415 -0
- package/scripts/verify-telemetry-fixtures.mjs +85 -0
- package/scripts/verify-telemetry-report.mjs +89 -0
- package/skills/base-themes/SKILL.md +156 -43
- package/src/blocks/AuthCard.tsx +29 -0
- package/src/blocks/Blocks.css +182 -0
- package/src/blocks/CommandPaletteBlock.tsx +32 -0
- package/src/blocks/DashboardShell.tsx +36 -0
- package/src/blocks/DataTableBlock.tsx +44 -0
- package/src/blocks/PricingPanel.tsx +28 -0
- package/src/blocks/SettingsForm.tsx +37 -0
- package/src/blocks/TeamActivityFeed.tsx +38 -0
- package/src/blocks/ThemeShowcaseCard.tsx +32 -0
- package/src/blocks/index.ts +8 -0
- package/src/components/ui/Accordion.css +42 -0
- package/src/components/ui/Accordion.tsx +41 -0
- package/src/components/ui/AlertDialog.css +40 -0
- package/src/components/ui/AlertDialog.tsx +52 -0
- package/src/components/ui/Autocomplete.css +3 -0
- package/src/components/ui/Autocomplete.tsx +50 -0
- package/src/components/ui/Avatar.css +45 -0
- package/src/components/ui/Avatar.tsx +36 -0
- package/src/components/ui/Button.css +79 -0
- package/src/components/ui/Button.tsx +20 -0
- package/src/components/ui/Checkbox.css +37 -0
- package/src/components/ui/Checkbox.tsx +32 -0
- package/src/components/ui/CheckboxGroup.tsx +21 -0
- package/src/components/ui/Collapsible.css +34 -0
- package/src/components/ui/Collapsible.tsx +29 -0
- package/src/components/ui/Combobox.css +75 -0
- package/src/components/ui/Combobox.tsx +53 -0
- package/src/components/ui/ContextMenu.css +9 -0
- package/src/components/ui/ContextMenu.tsx +47 -0
- package/src/components/ui/CspProvider.tsx +10 -0
- package/src/components/ui/Dialog.css +41 -0
- package/src/components/ui/Dialog.tsx +45 -0
- package/src/components/ui/DirectionProvider.tsx +17 -0
- package/src/components/ui/Drawer.css +77 -0
- package/src/components/ui/Drawer.tsx +56 -0
- package/src/components/ui/Field.css +19 -0
- package/src/components/ui/Field.tsx +24 -0
- package/src/components/ui/Fieldset.css +16 -0
- package/src/components/ui/Fieldset.tsx +19 -0
- package/src/components/ui/Form.css +5 -0
- package/src/components/ui/Form.tsx +12 -0
- package/src/components/ui/Input.css +50 -0
- package/src/components/ui/Input.tsx +62 -0
- package/src/components/ui/Menu.css +59 -0
- package/src/components/ui/Menu.tsx +50 -0
- package/src/components/ui/Menubar.css +26 -0
- package/src/components/ui/Menubar.tsx +42 -0
- package/src/components/ui/Meter.css +45 -0
- package/src/components/ui/Meter.tsx +37 -0
- package/src/components/ui/NavigationMenu.css +103 -0
- package/src/components/ui/NavigationMenu.tsx +64 -0
- package/src/components/ui/NumberField.css +38 -0
- package/src/components/ui/NumberField.tsx +28 -0
- package/src/components/ui/OtpField.css +28 -0
- package/src/components/ui/OtpField.tsx +24 -0
- package/src/components/ui/Popover.css +25 -0
- package/src/components/ui/Popover.tsx +37 -0
- package/src/components/ui/PreviewCard.css +33 -0
- package/src/components/ui/PreviewCard.tsx +43 -0
- package/src/components/ui/Progress.css +33 -0
- package/src/components/ui/Progress.tsx +28 -0
- package/src/components/ui/Radio.tsx +22 -0
- package/src/components/ui/RadioGroup.css +42 -0
- package/src/components/ui/RadioGroup.tsx +29 -0
- package/src/components/ui/ScrollArea.css +42 -0
- package/src/components/ui/ScrollArea.tsx +22 -0
- package/src/components/ui/Select.css +86 -0
- package/src/components/ui/Select.tsx +39 -0
- package/src/components/ui/Separator.css +14 -0
- package/src/components/ui/Separator.tsx +12 -0
- package/src/components/ui/Slider.css +39 -0
- package/src/components/ui/Slider.tsx +21 -0
- package/src/components/ui/Switch.css +45 -0
- package/src/components/ui/Switch.tsx +29 -0
- package/src/components/ui/Tabs.css +72 -0
- package/src/components/ui/Tabs.tsx +44 -0
- package/src/components/ui/Toast.css +75 -0
- package/src/components/ui/Toast.tsx +48 -0
- package/src/components/ui/Toggle.tsx +12 -0
- package/src/components/ui/ToggleGroup.css +35 -0
- package/src/components/ui/ToggleGroup.tsx +30 -0
- package/src/components/ui/Toolbar.css +60 -0
- package/src/components/ui/Toolbar.tsx +36 -0
- package/src/components/ui/Tooltip.css +14 -0
- package/src/components/ui/Tooltip.tsx +31 -0
- package/src/components/ui/index.ts +83 -0
- package/src/components/ui/useDirection.ts +1 -0
- package/src/components/ui/useToastManager.ts +11 -0
- package/src/docs/blockMeta.json +66 -0
- package/src/docs/componentMeta.json +322 -0
- package/src/docs/staticPageMeta.json +143 -0
- package/src/docs/themeMeta.json +22 -0
- package/src/styles/tokenContract.json +61 -0
- package/workers/analytics-receiver.mjs +170 -0
- package/wrangler.analytics.jsonc +12 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "base-themes-next-example",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev -H 0.0.0.0 -p 3001",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start -H 0.0.0.0 -p 3001"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@base-ui/react": "^1.5.0",
|
|
13
|
+
"base-themes": "file:../..",
|
|
14
|
+
"next": "^16.0.6",
|
|
15
|
+
"react": "^19.2.6",
|
|
16
|
+
"react-dom": "^19.2.6"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^24.12.3",
|
|
20
|
+
"@types/react": "^19.2.14",
|
|
21
|
+
"@types/react-dom": "^19.2.3",
|
|
22
|
+
"typescript": "~6.0.2"
|
|
23
|
+
},
|
|
24
|
+
"overrides": {
|
|
25
|
+
"postcss": "^8.5.10"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"lib": [
|
|
5
|
+
"DOM",
|
|
6
|
+
"DOM.Iterable",
|
|
7
|
+
"ES2023"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": false,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"isolatedModules": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
"incremental": true,
|
|
20
|
+
"plugins": [
|
|
21
|
+
{
|
|
22
|
+
"name": "next"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"next-env.d.ts",
|
|
28
|
+
"**/*.ts",
|
|
29
|
+
"**/*.tsx",
|
|
30
|
+
".next/types/**/*.ts",
|
|
31
|
+
".next/dev/types/**/*.ts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": [
|
|
34
|
+
"node_modules"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Registry Copy Example
|
|
2
|
+
|
|
3
|
+
This example demonstrates how tools and agents can consume `base-themes/registry.json` to inspect the package registry, plan a source-copy install, preview copied files, and diagnose a consumer app.
|
|
4
|
+
|
|
5
|
+
The script mirrors the published `base-themes` CLI and resolves component names, `block:<name>` requests, and `theme:<style>` requests. It prints:
|
|
6
|
+
|
|
7
|
+
- package dependencies
|
|
8
|
+
- global and token CSS files
|
|
9
|
+
- block source files and shared block CSS
|
|
10
|
+
- component source files
|
|
11
|
+
- requested and available theme variants
|
|
12
|
+
- registry item imports and hosted item URLs for agent workflows
|
|
13
|
+
|
|
14
|
+
## Run
|
|
15
|
+
|
|
16
|
+
From the repository root:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm run example:registry-copy -- button select block:dashboard-shell theme:enterprise
|
|
20
|
+
npm run example:registry-copy -- plan button select block:dashboard-shell theme:enterprise --json
|
|
21
|
+
npm run example:registry-copy -- add button select block:dashboard-shell theme:enterprise --target . --dry-run --json
|
|
22
|
+
npm run example:registry-copy -- doctor examples/vite --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or run the script directly:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node examples/registry-copy/plan-copy.mjs button select block:dashboard-shell theme:enterprise
|
|
29
|
+
node examples/registry-copy/plan-copy.mjs list --json
|
|
30
|
+
node examples/registry-copy/plan-copy.mjs plan button select block:dashboard-shell theme:enterprise --json
|
|
31
|
+
node examples/registry-copy/plan-copy.mjs add button select block:dashboard-shell theme:enterprise --target . --dry-run
|
|
32
|
+
node examples/registry-copy/plan-copy.mjs doctor examples/vite
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The published package also exposes the same planner through the `base-themes` CLI:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx base-themes list
|
|
39
|
+
npx base-themes list --json
|
|
40
|
+
npx base-themes plan button select block:dashboard-shell theme:enterprise
|
|
41
|
+
npx base-themes plan button select block:dashboard-shell theme:enterprise --json
|
|
42
|
+
npx base-themes add button select block:dashboard-shell theme:enterprise --target . --dry-run
|
|
43
|
+
npx base-themes add button select block:dashboard-shell theme:enterprise --target . --dry-run --json
|
|
44
|
+
npx base-themes doctor .
|
|
45
|
+
npx base-themes doctor . --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`add` runs the conservative copy path for users who want source files in their app. It copies only registry-listed files, skips existing files by default, and requires `--force` before overwriting.
|
|
49
|
+
|
|
50
|
+
`doctor` is meant for a consumer app root. It reports missing dependencies, the CSS import, and theme attributes, then prints the next fix and bug-report link for failed checks.
|
|
51
|
+
|
|
52
|
+
Example output:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
Base Themes registry copy plan
|
|
56
|
+
Components: button, select, progress, meter
|
|
57
|
+
Blocks: dashboard-shell
|
|
58
|
+
Themes: enterprise
|
|
59
|
+
Dependencies: @base-ui/react, clsx, lucide-react
|
|
60
|
+
Style files: src/index.css, src/styles/tokens.css, src/styles/themes.css, ...
|
|
61
|
+
Block files:
|
|
62
|
+
- src/blocks/DashboardShell.tsx
|
|
63
|
+
- src/blocks/Blocks.css
|
|
64
|
+
Component files:
|
|
65
|
+
- src/components/ui/Button.tsx
|
|
66
|
+
- src/components/ui/Button.css
|
|
67
|
+
...
|
|
68
|
+
Registry item imports:
|
|
69
|
+
- button: base-themes/registry/items/button.json
|
|
70
|
+
- theme:enterprise: base-themes/registry/items/theme-enterprise.json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`plan` is intentionally a planner. `add` is intentionally conservative: source-copy tools should still decide lockfile behavior and app-specific formatting explicitly.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createDoctorReport, createRegistryAdd, createRegistryPlan, formatDoctorReport, formatRegistryAdd, formatRegistryList, formatRegistryPlan, loadRegistry } from '../../scripts/registry-plan.mjs'
|
|
3
|
+
|
|
4
|
+
const registry = loadRegistry()
|
|
5
|
+
const [maybeCommand, ...rest] = process.argv.slice(2)
|
|
6
|
+
|
|
7
|
+
function printHelp() {
|
|
8
|
+
console.log(`Registry Copy Example
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
node examples/registry-copy/plan-copy.mjs list [--json]
|
|
12
|
+
node examples/registry-copy/plan-copy.mjs plan <component...> [block:<block-name>...] [theme:<style>...] [--json]
|
|
13
|
+
node examples/registry-copy/plan-copy.mjs add <component...> [block:<block-name>...] [theme:<style>...] [--target <dir>] [--dry-run] [--force] [--json]
|
|
14
|
+
node examples/registry-copy/plan-copy.mjs doctor [project-root] [--json]
|
|
15
|
+
|
|
16
|
+
Backwards-compatible shorthand:
|
|
17
|
+
node examples/registry-copy/plan-copy.mjs <component...> [block:<block-name>...] [theme:<style>...] [--json]
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
node examples/registry-copy/plan-copy.mjs button select block:dashboard-shell theme:enterprise
|
|
21
|
+
node examples/registry-copy/plan-copy.mjs plan button select block:dashboard-shell theme:enterprise --json
|
|
22
|
+
node examples/registry-copy/plan-copy.mjs add button select block:dashboard-shell theme:enterprise --target . --dry-run
|
|
23
|
+
`)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function parseRegistryArgs(args) {
|
|
27
|
+
const requested = []
|
|
28
|
+
const options = {}
|
|
29
|
+
|
|
30
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
31
|
+
const arg = args[index]
|
|
32
|
+
if (arg === '--dry-run') {
|
|
33
|
+
options.dryRun = true
|
|
34
|
+
continue
|
|
35
|
+
}
|
|
36
|
+
if (arg === '--force') {
|
|
37
|
+
options.force = true
|
|
38
|
+
continue
|
|
39
|
+
}
|
|
40
|
+
if (arg === '--json') {
|
|
41
|
+
options.json = true
|
|
42
|
+
continue
|
|
43
|
+
}
|
|
44
|
+
if (arg === '--target') {
|
|
45
|
+
const target = args[index + 1]
|
|
46
|
+
if (!target) throw new Error('Missing value for --target')
|
|
47
|
+
options.target = target
|
|
48
|
+
index += 1
|
|
49
|
+
continue
|
|
50
|
+
}
|
|
51
|
+
if (arg.startsWith('--target=')) {
|
|
52
|
+
options.target = arg.slice('--target='.length)
|
|
53
|
+
continue
|
|
54
|
+
}
|
|
55
|
+
if (arg.startsWith('--')) throw new Error(`Unknown registry-copy option: ${arg}`)
|
|
56
|
+
requested.push(arg)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { requested, options }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function printResult(value, json, formatter) {
|
|
63
|
+
console.log(json ? JSON.stringify(value, null, 2) : formatter(value))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function failWithUsage(message, usage) {
|
|
67
|
+
if (message) console.error(message)
|
|
68
|
+
console.error(usage)
|
|
69
|
+
process.exit(1)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!maybeCommand || maybeCommand === 'help' || maybeCommand === '--help' || maybeCommand === '-h') {
|
|
73
|
+
printHelp()
|
|
74
|
+
process.exit(0)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const knownCommands = new Set(['list', 'plan', 'add', 'doctor'])
|
|
78
|
+
const command = knownCommands.has(maybeCommand) ? maybeCommand : 'plan'
|
|
79
|
+
const args = command === 'plan' && !knownCommands.has(maybeCommand) ? [maybeCommand, ...rest] : rest
|
|
80
|
+
|
|
81
|
+
if (command === 'list') {
|
|
82
|
+
const json = args.includes('--json')
|
|
83
|
+
const unknownArgs = args.filter((arg) => arg !== '--json')
|
|
84
|
+
if (unknownArgs.length > 0) failWithUsage(`Unknown list option: ${unknownArgs[0]}`, 'Usage: node examples/registry-copy/plan-copy.mjs list [--json]')
|
|
85
|
+
printResult(registry, json, formatRegistryList)
|
|
86
|
+
process.exit(0)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (command === 'plan') {
|
|
90
|
+
let parsed
|
|
91
|
+
try {
|
|
92
|
+
parsed = parseRegistryArgs(args)
|
|
93
|
+
} catch (error) {
|
|
94
|
+
failWithUsage(error.message, 'Usage: node examples/registry-copy/plan-copy.mjs plan <component...> [block:<block-name>...] [theme:<style>...] [--json]')
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (parsed.requested.length === 0) failWithUsage(undefined, 'Usage: node examples/registry-copy/plan-copy.mjs plan <component...> [block:<block-name>...] [theme:<style>...] [--json]')
|
|
98
|
+
|
|
99
|
+
const plan = createRegistryPlan(registry, parsed.requested)
|
|
100
|
+
printResult(plan, parsed.options.json, formatRegistryPlan)
|
|
101
|
+
process.exit(plan.ok ? 0 : 1)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (command === 'add') {
|
|
105
|
+
let parsed
|
|
106
|
+
try {
|
|
107
|
+
parsed = parseRegistryArgs(args)
|
|
108
|
+
} catch (error) {
|
|
109
|
+
failWithUsage(error.message, 'Usage: node examples/registry-copy/plan-copy.mjs add <component...> [block:<block-name>...] [theme:<style>...] [--target <dir>] [--dry-run] [--force] [--json]')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (parsed.requested.length === 0) failWithUsage(undefined, 'Usage: node examples/registry-copy/plan-copy.mjs add <component...> [block:<block-name>...] [theme:<style>...] [--target <dir>] [--dry-run] [--force] [--json]')
|
|
113
|
+
|
|
114
|
+
const result = createRegistryAdd(registry, parsed.requested, parsed.options)
|
|
115
|
+
printResult(result, parsed.options.json, formatRegistryAdd)
|
|
116
|
+
process.exit(result.ok ? 0 : 1)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (command === 'doctor') {
|
|
120
|
+
const json = args.includes('--json')
|
|
121
|
+
const positional = args.filter((arg) => arg !== '--json')
|
|
122
|
+
if (positional.some((arg) => arg.startsWith('--'))) failWithUsage(`Unknown doctor option: ${positional.find((arg) => arg.startsWith('--'))}`, 'Usage: node examples/registry-copy/plan-copy.mjs doctor [project-root] [--json]')
|
|
123
|
+
if (positional.length > 1) failWithUsage(undefined, 'Usage: node examples/registry-copy/plan-copy.mjs doctor [project-root] [--json]')
|
|
124
|
+
const root = positional[0] ?? process.cwd()
|
|
125
|
+
const report = createDoctorReport(root)
|
|
126
|
+
printResult(report, json, formatDoctorReport)
|
|
127
|
+
process.exit(report.ok ? 0 : 1)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
failWithUsage(`Unknown command: ${command}`, 'Usage: node examples/registry-copy/plan-copy.mjs help')
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Base Themes Theme Customization Example
|
|
2
|
+
|
|
3
|
+
This Vite example shows how to customize Base Themes from the public package surface. It imports the package CSS once, then overrides semantic CSS tokens for brand color, radius, font, and density.
|
|
4
|
+
|
|
5
|
+
## Run
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open `http://localhost:5178`.
|
|
13
|
+
|
|
14
|
+
## Verify
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm run build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The example intentionally imports only documented package paths:
|
|
21
|
+
|
|
22
|
+
- `base-themes`
|
|
23
|
+
- `base-themes/styles.css`
|
|
24
|
+
- `base-themes/registry.json`
|
|
25
|
+
|
|
26
|
+
Use it when validating token changes, custom brand overrides, or docs that explain `data-style`, `data-theme`, and CSS variable customization.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="light" data-style="bento">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Base Themes Theme Customization Example</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|