@kondeio/kdf 0.1.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 (59) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/CONTRIBUTING.md +57 -0
  3. package/LICENSE +21 -0
  4. package/README.md +374 -0
  5. package/SECURITY.md +53 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +58 -0
  8. package/dist/css-generator.d.ts +17 -0
  9. package/dist/css-generator.js +59 -0
  10. package/dist/index.d.ts +48 -0
  11. package/dist/index.js +62 -0
  12. package/dist/plugin.d.ts +30 -0
  13. package/dist/plugin.js +40 -0
  14. package/dist/postinstall.d.ts +1 -0
  15. package/dist/postinstall.js +48 -0
  16. package/dist/resolver.d.ts +11 -0
  17. package/dist/resolver.js +184 -0
  18. package/dist/types.d.ts +44 -0
  19. package/dist/types.js +1 -0
  20. package/docs/kdf-doc.md +653 -0
  21. package/docs/kdf-skill.md +374 -0
  22. package/example/bootstrap/globals.css +12 -0
  23. package/example/bootstrap/hero-section.tsx +38 -0
  24. package/example/bootstrap/kdf/homepage.json +35 -0
  25. package/example/bootstrap/kdf/shared/button.json +10 -0
  26. package/example/bootstrap/kdf/shared/card.json +4 -0
  27. package/example/bootstrap/kdf/shared/color.json +17 -0
  28. package/example/bootstrap/kdf/shared/layout.json +7 -0
  29. package/example/bootstrap/kdf/shared/typography.json +8 -0
  30. package/example/bootstrap/konde-server.css +3 -0
  31. package/example/bootstrap/konde.css +3 -0
  32. package/example/preview.ts +428 -0
  33. package/example/pure-css/hero-section.tsx +40 -0
  34. package/example/pure-css/kdf/homepage.json +20 -0
  35. package/example/pure-css/kdf/shared/button.json +10 -0
  36. package/example/pure-css/kdf/shared/card.json +4 -0
  37. package/example/pure-css/kdf/shared/color.json +11 -0
  38. package/example/pure-css/kdf/shared/typography.json +8 -0
  39. package/example/pure-css/konde-server.css +3 -0
  40. package/example/pure-css/konde.css +3 -0
  41. package/example/pure-css/styles.css +34 -0
  42. package/example/sample-pages/about.json +30 -0
  43. package/example/sample-pages/dashboard.json +12 -0
  44. package/example/sample-pages/pricing.json +28 -0
  45. package/example/shadcn/globals.css +15 -0
  46. package/example/shadcn/hero-section.tsx +34 -0
  47. package/example/shadcn/konde-server.css +3 -0
  48. package/example/shadcn/konde.css +3 -0
  49. package/example/tailwind/globals.css +5 -0
  50. package/example/tailwind/hero-section.tsx +34 -0
  51. package/example/tailwind/konde-server.css +3 -0
  52. package/example/tailwind/konde.css +3 -0
  53. package/kdf/homepage.json +25 -0
  54. package/kdf/shared/button.json +10 -0
  55. package/kdf/shared/card.json +4 -0
  56. package/kdf/shared/color.json +17 -0
  57. package/kdf/shared/layout.json +7 -0
  58. package/kdf/shared/typography.json +8 -0
  59. package/package.json +77 -0
@@ -0,0 +1,34 @@
1
+ import { getDesign } from "@kondeio/kdf";
2
+ import { Button } from "@/components/ui/button";
3
+
4
+ export function HeroSection() {
5
+ const d = getDesign("homepage");
6
+
7
+ return (
8
+ <section data-kdf="hero.wrapper" className={d("hero.wrapper")}>
9
+ <div data-kdf="hero.content" className={d("hero.content")}>
10
+ <h1 data-kdf="hero.title" className={d("hero.title")}>
11
+ Build websites with AI
12
+ </h1>
13
+ <p data-kdf="hero.description" className={d("hero.description")}>
14
+ The AI orchestration platform for web development teams.
15
+ </p>
16
+ <div data-kdf="hero.actions" className={d("hero.actions")}>
17
+ <Button asChild data-kdf="hero.cta-secondary" className={d("hero.cta-secondary")}>
18
+ <a href="/about">Learn more</a>
19
+ </Button>
20
+ <Button asChild data-kdf="hero.cta-primary" className={d("hero.cta-primary")}>
21
+ <a href="/pricing">Get started</a>
22
+ </Button>
23
+ </div>
24
+ </div>
25
+ </section>
26
+ );
27
+ }
28
+
29
+ /*
30
+ kdf/homepage.json:
31
+ "hero.cta-primary": { "$": "Button", "variant": "default", "className": "@button.cta" }
32
+
33
+ shadcn Button gets KDF className on top of its own variant styles.
34
+ */
@@ -0,0 +1,3 @@
1
+ /* konde-server.css — Critical design overrides (server-rendered) */
2
+ /* Imported in layout.tsx — inlined in HTML, no FOUC */
3
+ /* Edit freely — KDF will never overwrite this file */
@@ -0,0 +1,3 @@
1
+ /* konde.css — Custom design overrides */
2
+ /* Loaded LAST in <head> for highest specificity */
3
+ /* Edit freely — KDF will never overwrite this file */
@@ -0,0 +1,5 @@
1
+ /* Tailwind CSS — via CDN or build */
2
+ /* CDN (dev only): add <script src="https://cdn.tailwindcss.com"></script> to HTML */
3
+ /* Build (production): @tailwind base; @tailwind components; @tailwind utilities; */
4
+
5
+ /* Load konde.css after framework CSS in the host app. withKDF() only exposes paths. */
@@ -0,0 +1,34 @@
1
+ import { getDesign } from "@kondeio/kdf";
2
+
3
+ export function HeroSection() {
4
+ const d = getDesign("homepage");
5
+
6
+ return (
7
+ <section data-kdf="hero.wrapper" className={d("hero.wrapper")}>
8
+ <div data-kdf="hero.content" className={d("hero.content")}>
9
+ <h1 data-kdf="hero.title" className={d("hero.title")}>
10
+ Build websites with AI
11
+ </h1>
12
+ <p data-kdf="hero.description" className={d("hero.description")}>
13
+ The AI orchestration platform for web development teams.
14
+ </p>
15
+ <div data-kdf="hero.actions" className={d("hero.actions")}>
16
+ <a href="/about" data-kdf="hero.cta-secondary" className={d("hero.cta-secondary")}>
17
+ Learn more
18
+ </a>
19
+ <a href="/pricing" data-kdf="hero.cta-primary" className={d("hero.cta-primary")}>
20
+ Get started
21
+ </a>
22
+ </div>
23
+ </div>
24
+ </section>
25
+ );
26
+ }
27
+
28
+ /*
29
+ kdf/shared/button.json:
30
+ "cta": "bg-blue-600 text-white shadow-lg hover:bg-blue-700 hover:shadow-xl"
31
+
32
+ kdf/homepage.json:
33
+ "hero.cta-primary": "@button.base @button.cta @button.md"
34
+ */
@@ -0,0 +1,3 @@
1
+ /* konde-server.css — Critical design overrides (server-rendered) */
2
+ /* Imported in layout.tsx — inlined in HTML, no FOUC */
3
+ /* Edit freely — KDF will never overwrite this file */
@@ -0,0 +1,3 @@
1
+ /* konde.css — Custom design overrides */
2
+ /* Loaded LAST in <head> for highest specificity */
3
+ /* Edit freely — KDF will never overwrite this file */
@@ -0,0 +1,25 @@
1
+ {
2
+ "hero": {
3
+ "wrapper": "flex flex-col gap-8 lg:flex-row lg:items-start lg:justify-between",
4
+ "content": "w-full lg:max-w-[500px]",
5
+ "title": "@typography.h1",
6
+ "description": "mt-4 @typography.body",
7
+ "actions": "mt-6 flex gap-3",
8
+ "cta-primary": "@button.base @button.cta @button.md",
9
+ "cta-secondary": "@button.base @button.outline @button.md",
10
+ "slider": "w-full lg:max-w-[500px]"
11
+ },
12
+ "template-grid": {
13
+ "wrapper": "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mt-10",
14
+ "card": "@card.base @card.hover",
15
+ "card-image": "aspect-video w-full object-cover",
16
+ "card-body": "p-4",
17
+ "card-title": "font-medium text-gray-900 text-sm",
18
+ "card-category": "@typography.small"
19
+ },
20
+ "pagination": {
21
+ "wrapper": "mt-8 flex justify-center gap-2",
22
+ "button": "@button.base @button.ghost @button.sm",
23
+ "active": "@button.base @button.primary @button.sm"
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "base": "inline-flex items-center gap-2 rounded font-medium transition-colors",
3
+ "primary": "bg-blue-600 text-white hover:bg-blue-700",
4
+ "outline": "border border-gray-300 text-gray-700 hover:bg-gray-50",
5
+ "ghost": "text-gray-600 hover:bg-gray-100 hover:text-gray-900",
6
+ "cta": "bg-blue-600 text-white shadow-lg hover:bg-blue-700 hover:shadow-xl",
7
+ "sm": "px-3 py-1.5 text-sm",
8
+ "md": "px-4 py-2 text-sm",
9
+ "lg": "px-6 py-3 text-base"
10
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "base": "bg-white border border-gray-200 rounded-lg overflow-hidden",
3
+ "hover": "hover:shadow-md transition-shadow"
4
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "primary": {
3
+ "css": { "--kdf-primary": "#4F46E5" }
4
+ },
5
+ "danger": {
6
+ "css": { "--kdf-danger": "#DC2626" }
7
+ },
8
+ "success": {
9
+ "css": { "--kdf-success": "#16A34A" }
10
+ },
11
+ "warning": {
12
+ "css": { "--kdf-warning": "#D97706" }
13
+ },
14
+ "accent": {
15
+ "css": { "--kdf-accent": "#FF6600" }
16
+ }
17
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "header": "sticky top-0 z-20 bg-white/80 backdrop-blur-md border-b border-gray-100 h-14 px-6",
3
+ "sidebar": "fixed inset-y-0 left-0 z-30 w-64 bg-white border-r border-gray-200 hidden lg:block",
4
+ "content": "flex-1 px-6 py-10 lg:px-10",
5
+ "main": "flex w-full flex-col lg:pl-64",
6
+ "footer": "border-t border-gray-200 py-8 px-6"
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "h1": "text-3xl font-bold leading-tight tracking-tight text-gray-900 sm:text-4xl",
3
+ "h2": "text-2xl font-bold tracking-tight sm:text-3xl",
4
+ "h3": "text-xl font-semibold",
5
+ "body": "text-sm leading-relaxed text-gray-600 sm:text-base",
6
+ "muted": "text-sm text-gray-500",
7
+ "small": "text-xs text-gray-400"
8
+ }
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@kondeio/kdf",
3
+ "version": "0.1.0",
4
+ "description": "Agent-first design consistency for Node-powered web apps. KDF gives AI agents a JSON source of truth for consistent UI.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "bin": {
10
+ "kdf": "dist/cli.js"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./plugin": {
18
+ "import": "./dist/plugin.js",
19
+ "types": "./dist/plugin.d.ts"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "docs",
25
+ "kdf",
26
+ "example",
27
+ "CONTRIBUTING.md",
28
+ "SECURITY.md",
29
+ "CHANGELOG.md"
30
+ ],
31
+ "scripts": {
32
+ "build": "tsc",
33
+ "postinstall": "node dist/postinstall.js",
34
+ "typecheck": "tsc --noEmit",
35
+ "test": "bun unit-test.ts"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/KondeIO/kdf.git"
40
+ },
41
+ "homepage": "https://github.com/KondeIO/kdf#readme",
42
+ "bugs": {
43
+ "url": "https://github.com/KondeIO/kdf/issues"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "sideEffects": false,
49
+ "engines": {
50
+ "node": ">=18"
51
+ },
52
+ "dependencies": {
53
+ "clsx": "^2.1.1"
54
+ },
55
+ "peerDependencies": {
56
+ "next": ">=14"
57
+ },
58
+ "peerDependenciesMeta": {
59
+ "next": {
60
+ "optional": true
61
+ }
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^25.6.0",
65
+ "tsx": "^4.0.0",
66
+ "typescript": "^6.0.2"
67
+ },
68
+ "keywords": [
69
+ "design-system",
70
+ "json",
71
+ "node",
72
+ "nextjs",
73
+ "astro",
74
+ "hono",
75
+ "design-tokens"
76
+ ]
77
+ }