konpeki 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 (121) hide show
  1. package/.agents/skills/authoring-visuals/SKILL.md +82 -0
  2. package/AGENTS.md +33 -0
  3. package/AUTHORING.md +233 -0
  4. package/LICENSE +201 -0
  5. package/README.md +70 -0
  6. package/SETUP.md +86 -0
  7. package/composition/README.md +166 -0
  8. package/composition/compile.ts +227 -0
  9. package/composition/document.ts +709 -0
  10. package/composition/schema.json +2992 -0
  11. package/composition/schema.ts +435 -0
  12. package/composition/theme-tokens.ts +16 -0
  13. package/composition/types.ts +286 -0
  14. package/composition/validate.ts +684 -0
  15. package/composition/vector.ts +143 -0
  16. package/composition/visualizations.ts +335 -0
  17. package/design/README.md +17 -0
  18. package/design/palettes/README.md +14 -0
  19. package/design/palettes/base.ts +14 -0
  20. package/design/palettes/candidates.ts +19 -0
  21. package/design/palettes/index.ts +78 -0
  22. package/design/review/color-theme.md +44 -0
  23. package/design/review/layout.md +16 -0
  24. package/design/review/text.md +18 -0
  25. package/design/review/typography.md +15 -0
  26. package/design/review/visuals.md +31 -0
  27. package/design/semantic-patterns.md +43 -0
  28. package/design/themes/README.md +22 -0
  29. package/design/themes/index.ts +13 -0
  30. package/design/visual-languages/technical-product.md +17 -0
  31. package/design/visual-review.md +88 -0
  32. package/docs/development.md +140 -0
  33. package/docs/workflow.md +61 -0
  34. package/index.html +17 -0
  35. package/lib/assets.d.ts +8 -0
  36. package/lib/charts.ts +18 -0
  37. package/lib/contrast.ts +16 -0
  38. package/lib/layouts.ts +50 -0
  39. package/lib/slide.tsx +42 -0
  40. package/lib/taste.ts +17 -0
  41. package/lib/text.tsx +89 -0
  42. package/lib/typeface.ts +44 -0
  43. package/package.json +85 -0
  44. package/runtime/konpeki.mjs +1685 -0
  45. package/scripts/migrate-react-page.ts +120 -0
  46. package/slides/README.md +153 -0
  47. package/slides/architecture/PROMPT.md +31 -0
  48. package/slides/architecture/index.tsx +102 -0
  49. package/slides/article-brief/PROMPT.md +35 -0
  50. package/slides/article-brief/index.tsx +71 -0
  51. package/slides/bar-chart/PROMPT.md +39 -0
  52. package/slides/bar-chart/index.tsx +97 -0
  53. package/slides/comparison/PROMPT.md +29 -0
  54. package/slides/comparison/index.tsx +95 -0
  55. package/slides/decision-memo/PROMPT.md +34 -0
  56. package/slides/decision-memo/index.tsx +85 -0
  57. package/slides/delivery-plan/PROMPT.md +45 -0
  58. package/slides/delivery-plan/index.tsx +105 -0
  59. package/slides/experiment/PROMPT.md +44 -0
  60. package/slides/experiment/index.tsx +127 -0
  61. package/slides/incident-workflow/PROMPT.md +57 -0
  62. package/slides/incident-workflow/index.tsx +78 -0
  63. package/slides/introducing-konpeki/PROMPT.md +19 -0
  64. package/slides/introducing-konpeki/README.md +54 -0
  65. package/slides/introducing-konpeki/SOURCE.md +20 -0
  66. package/slides/introducing-konpeki/author.ts +163 -0
  67. package/slides/introducing-konpeki/composition.json +3265 -0
  68. package/slides/line-chart/PROMPT.md +40 -0
  69. package/slides/line-chart/index.tsx +72 -0
  70. package/slides/migration/PROMPT.md +38 -0
  71. package/slides/migration/index.tsx +89 -0
  72. package/slides/og-images/PROMPT.md +21 -0
  73. package/slides/og-images/index.tsx +76 -0
  74. package/slides/product-introduction/PROMPT.md +24 -0
  75. package/slides/product-introduction/index.tsx +105 -0
  76. package/slides/research-brief/PROMPT.md +40 -0
  77. package/slides/research-brief/index.tsx +104 -0
  78. package/slides/results-explanation/PROMPT.md +32 -0
  79. package/slides/results-explanation/index.tsx +96 -0
  80. package/slides/retrospective/PROMPT.md +43 -0
  81. package/slides/retrospective/index.tsx +105 -0
  82. package/slides/sankey/PROMPT.md +11 -0
  83. package/slides/sankey/index.tsx +93 -0
  84. package/slides/teaching/PROMPT.md +45 -0
  85. package/slides/teaching/index.tsx +124 -0
  86. package/slides/vertical-bar-charts/PROMPT.md +13 -0
  87. package/slides/vertical-bar-charts/index.tsx +97 -0
  88. package/src/app/App.tsx +694 -0
  89. package/src/assets/konpeki-mark.png +0 -0
  90. package/src/components/Canvas.tsx +1168 -0
  91. package/src/components/DiagramTypeIcon.tsx +78 -0
  92. package/src/components/InspectorPanel.tsx +687 -0
  93. package/src/components/LeftPanel.tsx +107 -0
  94. package/src/components/PageSizePicker.tsx +30 -0
  95. package/src/components/Presentation.tsx +105 -0
  96. package/src/components/RightPanel.tsx +201 -0
  97. package/src/components/VectorOverflowWarning.tsx +46 -0
  98. package/src/components/WorkspaceChrome.tsx +199 -0
  99. package/src/components/ui.tsx +53 -0
  100. package/src/lib/examples/react-page-migration.json +1295 -0
  101. package/src/lib/examples.ts +42 -0
  102. package/src/lib/export-png.ts +101 -0
  103. package/src/lib/file-session.ts +74 -0
  104. package/src/lib/history.ts +53 -0
  105. package/src/lib/model.ts +188 -0
  106. package/src/lib/page-size.ts +24 -0
  107. package/src/lib/presentation.ts +17 -0
  108. package/src/lib/storage.ts +43 -0
  109. package/src/lib/theme.ts +25 -0
  110. package/src/lib/use-file-session.ts +162 -0
  111. package/src/main.tsx +26 -0
  112. package/src/styles/base.css +105 -0
  113. package/src/styles/canvas.css +268 -0
  114. package/src/styles/chrome.css +214 -0
  115. package/src/styles/component-previews.css +386 -0
  116. package/src/styles/feedback.css +71 -0
  117. package/src/styles/left-panel.css +125 -0
  118. package/src/styles/presentation.css +72 -0
  119. package/src/styles/right-panel.css +1172 -0
  120. package/src/styles/shell.css +247 -0
  121. package/vite.config.ts +6 -0
@@ -0,0 +1,78 @@
1
+ import type { DiagramType } from "../../composition/types.ts";
2
+
3
+ export function DiagramTypeIcon({
4
+ type,
5
+ className = "",
6
+ }: {
7
+ type: DiagramType;
8
+ className?: string;
9
+ }) {
10
+ const nodes = (points: [number, number][]) =>
11
+ points.map(([cx, cy], index) => (
12
+ <circle key={index} cx={cx} cy={cy} r="2.5" />
13
+ ));
14
+ return (
15
+ <svg
16
+ className={`diagram-type-icon ${className}`.trim()}
17
+ viewBox="0 0 48 32"
18
+ aria-hidden="true"
19
+ >
20
+ {type === "architecture" ? <>
21
+ <rect x="19" y="11" width="10" height="10" rx="2" />
22
+ {nodes([[6, 7], [42, 7], [6, 25], [42, 25]])}
23
+ <path d="M19 14 8 8m21 6 11-6M19 18 8 24m21-6 11 6" />
24
+ </> : type === "it-current-state" ? <>
25
+ <rect x="3" y="4" width="14" height="8" rx="1" /><rect x="28" y="3" width="17" height="10" rx="1" /><rect x="8" y="21" width="16" height="8" rx="1" /><rect x="34" y="20" width="11" height="9" rx="1" /><path d="M17 8h11M15 12l-3 9m12 4h10M36 13l3 7" />
26
+ </> : type === "high-level" ? <>
27
+ <rect x="3" y="8" width="12" height="16" rx="2" /><rect x="18" y="8" width="12" height="16" rx="2" /><rect x="33" y="8" width="12" height="16" rx="2" />
28
+ </> : type === "deployment" ? <>
29
+ <rect x="3" y="4" width="42" height="24" rx="2" /><path d="M24 4v24" /><rect x="7" y="9" width="12" height="7" rx="1" /><rect x="29" y="17" width="12" height="7" rx="1" /><path d="M19 12h7l-2-2m2 2-2 2" />
30
+ </> : type === "nested" ? <>
31
+ <rect x="3" y="4" width="42" height="24" rx="2" /><rect x="9" y="9" width="30" height="14" rx="2" /><rect x="16" y="13" width="16" height="6" rx="1" />
32
+ </> : type === "flowchart" ? <>
33
+ <rect x="2" y="11" width="10" height="9" rx="2" /><path d="m24 8 8 8-8 8-8-8Z M12 16h4m16 0h8" /><circle cx="43" cy="16" r="3" />
34
+ </> : type === "sequence" ? <>
35
+ {nodes([[8, 5], [24, 5], [40, 5]])}<path d="M8 9v18M24 9v18M40 9v18M8 13h16l-3-2m3 2-3 2M40 20H24l3-2m-3 2 3 2" />
36
+ </> : type === "state-machine" ? <>
37
+ {nodes([[8, 16], [24, 7], [40, 16], [24, 25]])}<path d="m11 14 10-5m6 0 10 5m0 4-10 5m-6 0-10-5" />
38
+ </> : type === "swimlane" ? <>
39
+ <path d="M2 9h44M2 22h44M15 3v26" /><rect x="19" y="12" width="9" height="6" rx="1" /><path d="M28 15h9" />
40
+ </> : type === "process" ? <>
41
+ {nodes([[6, 16], [18, 16], [30, 16], [42, 16]])}<path d="M9 16h6m6 0h6m6 0h6" />
42
+ </> : type === "user-journey" ? <>
43
+ <path d="M4 20C12 7 20 25 28 12s12-3 16-6" />{nodes([[5, 19], [16, 15], [28, 12], [43, 6]])}<path d="M7 26h8m3 0h8m3 0h8" />
44
+ </> : type === "data-flow" ? <>
45
+ <rect x="2" y="11" width="11" height="10" rx="2" /><circle cx="25" cy="16" r="6" /><path d="M13 16h6m12 0h8l-3-3m3 3-3 3" /><path d="M40 10v12" />
46
+ </> : type === "dp-integration" ? <>
47
+ <rect x="2" y="7" width="11" height="18" rx="2" /><rect x="19" y="4" width="10" height="24" rx="2" /><rect x="35" y="7" width="11" height="18" rx="2" /><path d="M13 16h6m10 0h6" />
48
+ </> : type === "er-data-model" ? <>
49
+ <rect x="2" y="8" width="14" height="16" rx="1" /><rect x="32" y="8" width="14" height="16" rx="1" /><path d="m24 10 6 6-6 6-6-6Zm-8 6h2m12 0h2" />
50
+ </> : type === "database-schema" ? <>
51
+ <rect x="2" y="6" width="15" height="20" rx="1" /><path d="M2 12h15M6 16h7M6 20h7" /><rect x="31" y="6" width="15" height="20" rx="1" /><path d="M31 12h15M35 16h7M17 17h14" />
52
+ </> : type === "medallion" ? <>
53
+ <ellipse cx="12" cy="16" rx="9" ry="12" /><ellipse cx="24" cy="16" rx="9" ry="12" /><ellipse cx="36" cy="16" rx="9" ry="12" /><path d="M8 16h8m4 0h8m4 0h8" />
54
+ </> : type === "layer-stack" ? <>
55
+ <path d="m24 3 18 7-18 7-18-7Zm-18 13 18 7 18-7M6 22l18 7 18-7" />
56
+ </> : type === "dp-security-matrix" ? <>
57
+ <rect x="7" y="4" width="34" height="24" rx="1" /><path d="M7 12h34M7 20h34M18 4v24M29 4v24" /><circle cx="35" cy="16" r="2" />
58
+ </> : type === "dependency-graph" ? <>
59
+ {nodes([[6, 8], [6, 24], [24, 16], [42, 8], [42, 24]])}<path d="M8 9 21 15M8 23l13-6m6-2 13-6m-13 8 13 6" />
60
+ </> : type === "uml-class" ? <>
61
+ <rect x="10" y="3" width="28" height="26" rx="1" /><path d="M10 10h28M10 18h28M15 14h12M15 22h17M15 25h12" />
62
+ </> : type === "tree" ? <>
63
+ {nodes([[24, 5], [12, 16], [36, 16], [6, 27], [18, 27], [30, 27], [42, 27]])}<path d="M22 7 14 14m12-7 8 7M11 18l-4 7m7-7 3 7m18-7-4 7m7-7 3 7" />
64
+ </> : type === "org-chart" ? <>
65
+ <rect x="19" y="2" width="10" height="7" rx="1" /><path d="M24 9v7M8 16h32M8 16v6M24 16v6M40 16v6" /><rect x="3" y="22" width="10" height="7" rx="1" /><rect x="19" y="22" width="10" height="7" rx="1" /><rect x="35" y="22" width="10" height="7" rx="1" />
66
+ </> : type === "pyramid-funnel" ? <path d="M5 4h38l-6 7H11Zm8 10h22l-5 6H18Zm7 9h8l-4 6Z" />
67
+ : type === "timeline" ? <>{nodes([[7, 16], [20, 16], [33, 16], [44, 16]])}<path d="M3 16h42M7 13V7M20 19v7M33 13V7" /></>
68
+ : type === "gantt" ? <><path d="M12 3v26M2 9h44M2 16h44M2 23h44" /><path className="filled" d="M16 5h15v3H16zm8 7h18v3H24zm-7 7h13v3H17zm14 7h11v3H31z" /></>
69
+ : type === "kanban" ? <><rect x="3" y="3" width="42" height="26" rx="2" /><path d="M17 3v26M31 3v26" /><rect x="6" y="8" width="8" height="5" rx="1" /><rect x="20" y="8" width="8" height="8" rx="1" /><rect x="34" y="8" width="8" height="12" rx="1" /></>
70
+ : type === "story-map" ? <><path d="M3 10h42M15 3v26M28 3v26M3 21h42" /><rect x="5" y="4" width="8" height="4" rx="1" /><rect x="17" y="13" width="9" height="5" rx="1" /><rect x="31" y="23" width="11" height="4" rx="1" /></>
71
+ : type === "quadrant" ? <><path d="M5 27V4m0 23h39M24 4v23M5 16h39" />{nodes([[13, 10], [20, 21], [32, 8], [39, 23]])}</>
72
+ : type === "wardley-map" ? <><path d="M5 27V4m0 23h39M10 22 20 15l8 5 10-12M20 15l-3-7m11 12 8 4" />{nodes([[10, 22], [20, 15], [17, 8], [28, 20], [38, 8], [36, 24]])}</>
73
+ : type === "loop-flywheel" ? <><circle cx="24" cy="16" r="11" /><path d="m29 5 5 1-2 5M19 27l-5-1 2-5" />{nodes([[24, 5], [35, 16], [24, 27], [13, 16]])}</>
74
+ : type === "venn" ? <><circle cx="19" cy="16" r="10" /><circle cx="29" cy="16" r="10" /></>
75
+ : <><path d="M5 16h37M37 12l5 4-5 4M13 16 7 7M20 16l-4-12M27 16l7-10M34 16l8 8" />{nodes([[7, 7], [16, 4], [34, 6], [42, 24]])}</>}
76
+ </svg>
77
+ );
78
+ }