uniweb 0.2.15 → 0.2.19

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 (69) hide show
  1. package/README.md +133 -35
  2. package/package.json +4 -3
  3. package/src/partials/search-docs.hbs +110 -0
  4. package/src/templates/processor.js +44 -1
  5. package/templates/_shared/CLAUDE.md.hbs +146 -0
  6. package/templates/_shared/package.json.hbs +23 -0
  7. package/templates/_shared/pnpm-workspace.yaml +5 -0
  8. package/templates/multi/CLAUDE.md.hbs +100 -0
  9. package/templates/multi/README.md.hbs +96 -0
  10. package/templates/multi/foundations/default/package.json.hbs +37 -0
  11. package/templates/multi/foundations/default/src/components/Section/index.jsx +121 -0
  12. package/templates/multi/foundations/default/src/components/Section/meta.js +66 -0
  13. package/templates/multi/foundations/default/src/entry-runtime.js +3 -0
  14. package/templates/multi/foundations/default/src/index.js +32 -0
  15. package/templates/multi/foundations/default/src/meta.js.hbs +6 -0
  16. package/templates/multi/foundations/default/src/styles.css +11 -0
  17. package/templates/multi/foundations/default/vite.config.js +3 -0
  18. package/templates/multi/package.json.hbs +25 -0
  19. package/templates/multi/pnpm-workspace.yaml +5 -0
  20. package/templates/multi/sites/main/index.html.hbs +13 -0
  21. package/templates/multi/sites/main/package.json.hbs +27 -0
  22. package/templates/multi/sites/main/pages/home/1-welcome.md.hbs +14 -0
  23. package/templates/multi/sites/main/pages/home/page.yml +2 -0
  24. package/templates/multi/sites/main/site.yml.hbs +9 -0
  25. package/templates/multi/sites/main/src/main.jsx +1 -0
  26. package/templates/multi/sites/main/vite.config.js +7 -0
  27. package/templates/multi/template.json +4 -0
  28. package/templates/single/README.md.hbs +101 -0
  29. package/templates/single/foundation/package.json.hbs +37 -0
  30. package/templates/single/foundation/src/components/Section/index.jsx +121 -0
  31. package/templates/single/foundation/src/components/Section/meta.js +66 -0
  32. package/templates/single/foundation/src/entry-runtime.js +3 -0
  33. package/templates/single/foundation/src/index.js +35 -0
  34. package/templates/single/foundation/src/meta.js.hbs +6 -0
  35. package/templates/single/foundation/src/styles.css +11 -0
  36. package/templates/single/foundation/vite.config.js +3 -0
  37. package/templates/single/site/index.html.hbs +19 -0
  38. package/templates/single/site/package.json.hbs +27 -0
  39. package/templates/single/site/pages/home/1-welcome.md.hbs +14 -0
  40. package/templates/single/site/pages/home/page.yml +2 -0
  41. package/templates/single/site/site.yml.hbs +7 -0
  42. package/templates/single/site/src/main.jsx +1 -0
  43. package/templates/single/site/vite.config.js +3 -0
  44. package/templates/single/template.json +10 -0
  45. package/templates/template/README.md.hbs +65 -0
  46. package/templates/template/package.json.hbs +33 -0
  47. package/templates/template/template/CLAUDE.md.hbs +70 -0
  48. package/templates/template/template/foundation/package.json.hbs +37 -0
  49. package/templates/template/template/foundation/src/components/Features/index.jsx +75 -0
  50. package/templates/template/template/foundation/src/components/Features/meta.js +41 -0
  51. package/templates/template/template/foundation/src/components/Hero/index.jsx +89 -0
  52. package/templates/template/template/foundation/src/components/Hero/meta.js +47 -0
  53. package/templates/template/template/foundation/src/entry-runtime.js +3 -0
  54. package/templates/template/template/foundation/src/index.js +36 -0
  55. package/templates/template/template/foundation/src/meta.js.hbs +6 -0
  56. package/templates/template/template/foundation/src/styles.css +12 -0
  57. package/templates/template/template/foundation/vite.config.js +3 -0
  58. package/templates/template/template/package.json.hbs +14 -0
  59. package/templates/template/template/pnpm-workspace.yaml +3 -0
  60. package/templates/template/template/site/index.html.hbs +13 -0
  61. package/templates/template/template/site/package.json.hbs +27 -0
  62. package/templates/template/template/site/pages/home/1-hero.md.hbs +16 -0
  63. package/templates/template/template/site/pages/home/2-features.md +21 -0
  64. package/templates/template/template/site/pages/home/page.yml +2 -0
  65. package/templates/template/template/site/site.yml.hbs +8 -0
  66. package/templates/template/template/site/src/main.jsx +1 -0
  67. package/templates/template/template/site/vite.config.js +3 -0
  68. package/templates/template/template/template.json.hbs +7 -0
  69. package/templates/template/template.json +4 -0
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "foundation",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./src/index.js",
6
+ "exports": {
7
+ ".": "./src/index.js",
8
+ "./styles": "./src/styles.css",
9
+ "./dist": "./dist/foundation.js",
10
+ "./dist/styles": "./dist/assets/style.css"
11
+ },
12
+ "files": ["dist", "src"],
13
+ "scripts": {
14
+ "dev": "vite",
15
+ "build": "uniweb build",
16
+ "build:vite": "vite build",
17
+ "preview": "vite preview"
18
+ },
19
+ "peerDependencies": {
20
+ "react": "^18.0.0 || ^19.0.0",
21
+ "react-dom": "^18.0.0 || ^19.0.0"
22
+ },
23
+ "dependencies": {
24
+ "@uniweb/core": "{{version "@uniweb/core"}}",
25
+ "@uniweb/kit": "{{version "@uniweb/kit"}}"
26
+ },
27
+ "devDependencies": {
28
+ "@tailwindcss/vite": "^4.0.0",
29
+ "@vitejs/plugin-react": "^5.0.0",
30
+ "react": "^18.2.0",
31
+ "react-dom": "^18.2.0",
32
+ "tailwindcss": "^4.0.0",
33
+ "uniweb": "{{version "uniweb"}}",
34
+ "vite": "^7.0.0",
35
+ "vite-plugin-svgr": "^4.2.0"
36
+ }
37
+ }
@@ -0,0 +1,75 @@
1
+ import React from 'react'
2
+ import { H2, H3, P, cn } from '@uniweb/kit'
3
+
4
+ /**
5
+ * Features Component
6
+ *
7
+ * Display a list of features in a grid. Uses items (H3 sections)
8
+ * from the markdown content.
9
+ */
10
+ export function Features({ content, params }) {
11
+ const { title, subtitle } = content.main?.header || {}
12
+ const items = content.items || []
13
+
14
+ const {
15
+ columns = 3,
16
+ theme = 'light',
17
+ } = params || {}
18
+
19
+ const themes = {
20
+ light: 'bg-white text-gray-900',
21
+ gray: 'bg-gray-50 text-gray-900',
22
+ dark: 'bg-gray-900 text-white',
23
+ }
24
+
25
+ const gridCols = {
26
+ 2: 'md:grid-cols-2',
27
+ 3: 'md:grid-cols-3',
28
+ 4: 'md:grid-cols-4',
29
+ }
30
+
31
+ return (
32
+ <section className={cn('py-16 px-6', themes[theme])}>
33
+ <div className="max-w-6xl mx-auto">
34
+ {(title || subtitle) && (
35
+ <div className="text-center mb-12">
36
+ {title && (
37
+ <H2 text={title} className="text-3xl font-bold mb-4" />
38
+ )}
39
+ {subtitle && (
40
+ <p className={cn(
41
+ 'text-lg',
42
+ theme === 'light' || theme === 'gray' ? 'text-gray-600' : 'text-gray-300'
43
+ )}>
44
+ {subtitle}
45
+ </p>
46
+ )}
47
+ </div>
48
+ )}
49
+
50
+ <div className={cn('grid gap-8', gridCols[columns] || 'md:grid-cols-3')}>
51
+ {items.map((item, index) => (
52
+ <div key={index} className="text-center">
53
+ {item.header?.title && (
54
+ <H3
55
+ text={item.header.title}
56
+ className="text-xl font-semibold mb-3"
57
+ />
58
+ )}
59
+ {item.body?.paragraphs?.[0] && (
60
+ <P
61
+ text={item.body.paragraphs[0]}
62
+ className={cn(
63
+ theme === 'light' || theme === 'gray' ? 'text-gray-600' : 'text-gray-300'
64
+ )}
65
+ />
66
+ )}
67
+ </div>
68
+ ))}
69
+ </div>
70
+ </div>
71
+ </section>
72
+ )
73
+ }
74
+
75
+ export default Features
@@ -0,0 +1,41 @@
1
+ export default {
2
+ title: 'Features',
3
+ description: 'Display a list of features in a grid',
4
+ category: 'Content',
5
+
6
+ elements: {
7
+ title: {
8
+ label: 'Section Title',
9
+ },
10
+ subtitle: {
11
+ label: 'Section Subtitle',
12
+ },
13
+ items: {
14
+ label: 'Features',
15
+ description: 'Each H3 becomes a feature item',
16
+ },
17
+ },
18
+
19
+ properties: {
20
+ columns: {
21
+ type: 'select',
22
+ label: 'Columns',
23
+ options: [
24
+ { value: 2, label: '2 Columns' },
25
+ { value: 3, label: '3 Columns' },
26
+ { value: 4, label: '4 Columns' },
27
+ ],
28
+ default: 3,
29
+ },
30
+ theme: {
31
+ type: 'select',
32
+ label: 'Theme',
33
+ options: [
34
+ { value: 'light', label: 'Light' },
35
+ { value: 'gray', label: 'Gray' },
36
+ { value: 'dark', label: 'Dark' },
37
+ ],
38
+ default: 'light',
39
+ },
40
+ },
41
+ }
@@ -0,0 +1,89 @@
1
+ import React from 'react'
2
+ import { H1, P, Link, cn } from '@uniweb/kit'
3
+
4
+ /**
5
+ * Hero Component
6
+ *
7
+ * A hero section for landing pages. Customize this component
8
+ * for your template's needs.
9
+ */
10
+ export function Hero({ content, params }) {
11
+ const { title, pretitle, subtitle } = content.main?.header || {}
12
+ const { paragraphs = [], links = [], imgs = [] } = content.main?.body || {}
13
+
14
+ const {
15
+ theme = 'light',
16
+ layout = 'center',
17
+ } = params || {}
18
+
19
+ const themes = {
20
+ light: 'bg-white text-gray-900',
21
+ dark: 'bg-gray-900 text-white',
22
+ gradient: 'bg-gradient-to-br from-primary to-primary-dark text-white',
23
+ }
24
+
25
+ const description = paragraphs[0]
26
+ const cta = links[0]
27
+ const secondaryCta = links[1]
28
+
29
+ return (
30
+ <section className={cn('py-20 px-6', themes[theme])}>
31
+ <div className={cn('max-w-4xl mx-auto', layout === 'center' && 'text-center')}>
32
+ {pretitle && (
33
+ <span className="inline-block px-4 py-1 text-sm font-medium rounded-full bg-primary/10 text-primary mb-4">
34
+ {pretitle}
35
+ </span>
36
+ )}
37
+
38
+ {title && (
39
+ <H1
40
+ text={title}
41
+ className="text-4xl sm:text-5xl font-bold mb-6 tracking-tight"
42
+ />
43
+ )}
44
+
45
+ {subtitle && (
46
+ <p className={cn(
47
+ 'text-xl mb-4',
48
+ theme === 'light' ? 'text-gray-600' : 'text-gray-300'
49
+ )}>
50
+ {subtitle}
51
+ </p>
52
+ )}
53
+
54
+ {description && (
55
+ <P
56
+ text={description}
57
+ className={cn(
58
+ 'text-lg mb-8',
59
+ theme === 'light' ? 'text-gray-600' : 'text-gray-300'
60
+ )}
61
+ />
62
+ )}
63
+
64
+ {(cta || secondaryCta) && (
65
+ <div className={cn('flex gap-4 flex-wrap', layout === 'center' && 'justify-center')}>
66
+ {cta && (
67
+ <Link
68
+ href={cta.href}
69
+ className="px-6 py-3 font-semibold rounded-lg bg-primary text-white hover:bg-primary-dark transition-colors"
70
+ >
71
+ {cta.label}
72
+ </Link>
73
+ )}
74
+ {secondaryCta && (
75
+ <Link
76
+ href={secondaryCta.href}
77
+ className="px-6 py-3 font-semibold rounded-lg border-2 border-current hover:bg-gray-100 transition-colors"
78
+ >
79
+ {secondaryCta.label}
80
+ </Link>
81
+ )}
82
+ </div>
83
+ )}
84
+ </div>
85
+ </section>
86
+ )
87
+ }
88
+
89
+ export default Hero
@@ -0,0 +1,47 @@
1
+ export default {
2
+ title: 'Hero',
3
+ description: 'A hero section for landing pages',
4
+ category: 'Headers',
5
+
6
+ elements: {
7
+ pretitle: {
8
+ label: 'Eyebrow',
9
+ description: 'Small text above the title',
10
+ },
11
+ title: {
12
+ label: 'Headline',
13
+ required: true,
14
+ },
15
+ subtitle: {
16
+ label: 'Subtitle',
17
+ },
18
+ paragraphs: {
19
+ label: 'Description',
20
+ },
21
+ links: {
22
+ label: 'Call to Action',
23
+ },
24
+ },
25
+
26
+ properties: {
27
+ theme: {
28
+ type: 'select',
29
+ label: 'Theme',
30
+ options: [
31
+ { value: 'light', label: 'Light' },
32
+ { value: 'dark', label: 'Dark' },
33
+ { value: 'gradient', label: 'Gradient' },
34
+ ],
35
+ default: 'light',
36
+ },
37
+ layout: {
38
+ type: 'select',
39
+ label: 'Layout',
40
+ options: [
41
+ { value: 'center', label: 'Center' },
42
+ { value: 'left', label: 'Left' },
43
+ ],
44
+ default: 'center',
45
+ },
46
+ },
47
+ }
@@ -0,0 +1,3 @@
1
+ import './styles.css'
2
+ export * from './index.js'
3
+ export { default } from './index.js'
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Foundation Entry Point
3
+ *
4
+ * Export all your template's components here.
5
+ */
6
+
7
+ import Hero from './components/Hero/index.jsx'
8
+ import Features from './components/Features/index.jsx'
9
+
10
+ const components = {
11
+ Hero,
12
+ Features,
13
+ }
14
+
15
+ export function getComponent(name) {
16
+ return components[name]
17
+ }
18
+
19
+ export function listComponents() {
20
+ return Object.keys(components)
21
+ }
22
+
23
+ export function getSchema(name) {
24
+ return components[name]?.schema
25
+ }
26
+
27
+ export function getAllSchemas() {
28
+ const schemas = {}
29
+ for (const [name, component] of Object.entries(components)) {
30
+ if (component.schema) schemas[name] = component.schema
31
+ }
32
+ return schemas
33
+ }
34
+
35
+ export { Hero, Features }
36
+ export default { getComponent, listComponents, getSchema, getAllSchemas, components }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ name: 'foundation',
3
+ version: '0.1.0',
4
+ title: '{{templateTitle}}',
5
+ description: '{{templateDescription}}',
6
+ }
@@ -0,0 +1,12 @@
1
+ @import "tailwindcss";
2
+
3
+ @source "./components/**/*.{js,jsx}";
4
+
5
+ @theme {
6
+ /* Customize your template's colors */
7
+ --color-primary: #3b82f6;
8
+ --color-primary-light: #60a5fa;
9
+ --color-primary-dark: #2563eb;
10
+ --color-secondary: #64748b;
11
+ --color-accent: #8b5cf6;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { defineFoundationConfig } from '@uniweb/build'
2
+
3
+ export default defineFoundationConfig()
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "{{templateName}}-workspace",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "pnpm --filter site dev",
8
+ "build": "pnpm --filter foundation build && pnpm --filter site build",
9
+ "preview": "pnpm --filter site preview"
10
+ },
11
+ "devDependencies": {
12
+ "@types/node": "^22.0.0"
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ packages:
2
+ - foundation
3
+ - site
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>{{templateTitle}}</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "site",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "dev:runtime": "VITE_FOUNDATION_MODE=runtime vite",
9
+ "build": "vite build",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "@uniweb/runtime": "{{version "@uniweb/runtime"}}",
14
+ "foundation": "file:../foundation"
15
+ },
16
+ "devDependencies": {
17
+ "@tailwindcss/vite": "^4.0.0",
18
+ "@uniweb/build": "{{version "@uniweb/build"}}",
19
+ "@vitejs/plugin-react": "^5.0.0",
20
+ "react": "^18.2.0",
21
+ "react-dom": "^18.2.0",
22
+ "react-router-dom": "^7.0.0",
23
+ "tailwindcss": "^4.0.0",
24
+ "vite": "^7.0.0",
25
+ "vite-plugin-svgr": "^4.2.0"
26
+ }
27
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: Hero
3
+ theme: gradient
4
+ layout: center
5
+ ---
6
+
7
+ ### New Template
8
+
9
+ # {{templateTitle}}
10
+
11
+ ## {{templateDescription}}
12
+
13
+ Build amazing websites with Uniweb components.
14
+
15
+ [Get Started](#features)
16
+ [Learn More](https://github.com/uniweb)
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: Features
3
+ columns: 3
4
+ theme: light
5
+ ---
6
+
7
+ # Features
8
+
9
+ ## What makes this template great
10
+
11
+ ### Easy to Use
12
+
13
+ Simple markdown content with powerful components. No complex setup required.
14
+
15
+ ### Customizable
16
+
17
+ Tailor every aspect of your site with Tailwind CSS and React components.
18
+
19
+ ### Fast
20
+
21
+ Built on Vite for lightning-fast development and optimal production builds.
@@ -0,0 +1,2 @@
1
+ title: Home
2
+ description: Welcome page
@@ -0,0 +1,8 @@
1
+ name: {{templateTitle}}
2
+ description: {{templateDescription}}
3
+
4
+ theme:
5
+ primary: '#3b82f6'
6
+
7
+ build:
8
+ prerender: true
@@ -0,0 +1 @@
1
+ import 'virtual:uniweb-site-entry'
@@ -0,0 +1,3 @@
1
+ import { defineSiteConfig } from '@uniweb/build/site'
2
+
3
+ export default defineSiteConfig()
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "{{templateTitle}}",
3
+ "description": "{{templateDescription}}",
4
+ "uniweb": ">=0.2.0",
5
+ "tags": ["{{templateName}}"],
6
+ "components": ["Hero", "Features"]
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Template Starter",
3
+ "description": "A starter for creating your own Uniweb templates. Use this to build custom templates that can be shared via npm or GitHub."
4
+ }