@misoto22/design 0.6.0 → 0.7.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 (157) hide show
  1. package/README.md +12 -0
  2. package/dist/agent/Accordion.md +1 -1
  3. package/dist/agent/Alert.md +1 -1
  4. package/dist/agent/AppShell.md +1 -1
  5. package/dist/agent/ArchitectureFigure.md +48 -0
  6. package/dist/agent/AreaChart.md +2 -2
  7. package/dist/agent/Article.md +1 -1
  8. package/dist/agent/Avatar.md +1 -1
  9. package/dist/agent/Badge.md +1 -1
  10. package/dist/agent/BarChart.md +2 -2
  11. package/dist/agent/BarList.md +2 -2
  12. package/dist/agent/BigNumber.md +2 -2
  13. package/dist/agent/BoxPlot.md +2 -2
  14. package/dist/agent/Breadcrumb.md +1 -1
  15. package/dist/agent/BulletChart.md +2 -2
  16. package/dist/agent/Button.md +1 -1
  17. package/dist/agent/Calendar.md +1 -1
  18. package/dist/agent/Card.md +1 -1
  19. package/dist/agent/Checkbox.md +1 -1
  20. package/dist/agent/Collapsible.md +1 -1
  21. package/dist/agent/Combobox.md +1 -1
  22. package/dist/agent/Command.md +1 -1
  23. package/dist/agent/ComposedChart.md +2 -2
  24. package/dist/agent/ContextMenu.md +1 -1
  25. package/dist/agent/DataflowFigure.md +27 -0
  26. package/dist/agent/DatePicker.md +1 -1
  27. package/dist/agent/Diagram.md +1 -1
  28. package/dist/agent/DiagramCanvas.md +47 -0
  29. package/dist/agent/DiagramExportMenu.md +38 -0
  30. package/dist/agent/DiagramInspector.md +50 -0
  31. package/dist/agent/DiagramLegend.md +34 -0
  32. package/dist/agent/DiagramMinimap.md +48 -0
  33. package/dist/agent/DiagramToolbar.md +47 -0
  34. package/dist/agent/Dialog.md +1 -1
  35. package/dist/agent/DropdownMenu.md +1 -1
  36. package/dist/agent/EmptyState.md +1 -1
  37. package/dist/agent/ErrorState.md +1 -1
  38. package/dist/agent/Facet.md +2 -2
  39. package/dist/agent/Field.md +1 -1
  40. package/dist/agent/FigureBand.md +1 -1
  41. package/dist/agent/FloatingIconButton.md +1 -1
  42. package/dist/agent/FunnelChart.md +2 -2
  43. package/dist/agent/Heatmap.md +2 -2
  44. package/dist/agent/Histogram.md +2 -2
  45. package/dist/agent/Input.md +1 -1
  46. package/dist/agent/Kbd.md +1 -1
  47. package/dist/agent/LifecycleFigure.md +28 -0
  48. package/dist/agent/LineChart.md +2 -2
  49. package/dist/agent/LinkArrow.md +1 -1
  50. package/dist/agent/NativeSelect.md +1 -1
  51. package/dist/agent/NavItem.md +1 -1
  52. package/dist/agent/Pagination.md +1 -1
  53. package/dist/agent/PieChart.md +2 -2
  54. package/dist/agent/Popover.md +1 -1
  55. package/dist/agent/Progress.md +1 -1
  56. package/dist/agent/RadarChart.md +2 -2
  57. package/dist/agent/RadialChart.md +2 -2
  58. package/dist/agent/RadioGroup.md +1 -1
  59. package/dist/agent/SankeyChart.md +2 -2
  60. package/dist/agent/ScatterChart.md +2 -2
  61. package/dist/agent/ScrollArea.md +1 -1
  62. package/dist/agent/SearchableMenu.md +1 -1
  63. package/dist/agent/Select.md +1 -1
  64. package/dist/agent/Separator.md +1 -1
  65. package/dist/agent/SequenceFigure.md +28 -0
  66. package/dist/agent/Sheet.md +1 -1
  67. package/dist/agent/Skeleton.md +1 -1
  68. package/dist/agent/Slider.md +1 -1
  69. package/dist/agent/Sparkline.md +2 -2
  70. package/dist/agent/Spinner.md +1 -1
  71. package/dist/agent/StatusDot.md +1 -1
  72. package/dist/agent/StatusPill.md +1 -1
  73. package/dist/agent/Steps.md +1 -1
  74. package/dist/agent/Switch.md +1 -1
  75. package/dist/agent/Table.md +1 -1
  76. package/dist/agent/Tabs.md +1 -1
  77. package/dist/agent/Tag.md +1 -1
  78. package/dist/agent/Textarea.md +1 -1
  79. package/dist/agent/Toast.md +1 -1
  80. package/dist/agent/ToggleGroup.md +1 -1
  81. package/dist/agent/Tooltip.md +1 -1
  82. package/dist/agent/TreemapChart.md +2 -2
  83. package/dist/agent/WaterfallChart.md +2 -2
  84. package/dist/agent/WorkflowFigure.md +28 -0
  85. package/dist/agent/catalog.json +295 -3
  86. package/dist/agent/index.md +15 -1
  87. package/dist/charts/index.d.ts +2 -1
  88. package/dist/charts/lib/export.d.ts +33 -43
  89. package/dist/charts/lib/export.js +16 -158
  90. package/dist/charts/lib/export.js.map +1 -1
  91. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.d.ts +49 -0
  92. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js +135 -0
  93. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js.map +1 -0
  94. package/dist/diagrams/DataflowFigure/DataflowFigure.d.ts +28 -0
  95. package/dist/diagrams/DataflowFigure/DataflowFigure.js +129 -0
  96. package/dist/diagrams/DataflowFigure/DataflowFigure.js.map +1 -0
  97. package/dist/diagrams/DiagramCanvas/DiagramCanvas.d.ts +64 -0
  98. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js +222 -0
  99. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js.map +1 -0
  100. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.d.ts +72 -0
  101. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js +125 -0
  102. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js.map +1 -0
  103. package/dist/diagrams/DiagramInspector/DiagramInspector.d.ts +70 -0
  104. package/dist/diagrams/DiagramInspector/DiagramInspector.js +94 -0
  105. package/dist/diagrams/DiagramInspector/DiagramInspector.js.map +1 -0
  106. package/dist/diagrams/DiagramLegend/DiagramLegend.d.ts +42 -0
  107. package/dist/diagrams/DiagramLegend/DiagramLegend.js +35 -0
  108. package/dist/diagrams/DiagramLegend/DiagramLegend.js.map +1 -0
  109. package/dist/diagrams/DiagramMinimap/DiagramMinimap.d.ts +61 -0
  110. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js +79 -0
  111. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js.map +1 -0
  112. package/dist/diagrams/DiagramToolbar/DiagramToolbar.d.ts +48 -0
  113. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js +53 -0
  114. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js.map +1 -0
  115. package/dist/diagrams/LifecycleFigure/LifecycleFigure.d.ts +31 -0
  116. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js +202 -0
  117. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js.map +1 -0
  118. package/dist/diagrams/SequenceFigure/SequenceFigure.d.ts +38 -0
  119. package/dist/diagrams/SequenceFigure/SequenceFigure.js +231 -0
  120. package/dist/diagrams/SequenceFigure/SequenceFigure.js.map +1 -0
  121. package/dist/diagrams/WorkflowFigure/WorkflowFigure.d.ts +34 -0
  122. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js +211 -0
  123. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js.map +1 -0
  124. package/dist/diagrams/index.d.ts +16 -0
  125. package/dist/diagrams/index.js +19 -0
  126. package/dist/diagrams/index.js.map +1 -0
  127. package/dist/diagrams/lib/frame.d.ts +97 -0
  128. package/dist/diagrams/lib/frame.js +116 -0
  129. package/dist/diagrams/lib/frame.js.map +1 -0
  130. package/dist/diagrams/lib/geometry.d.ts +114 -0
  131. package/dist/diagrams/lib/geometry.js +113 -0
  132. package/dist/diagrams/lib/geometry.js.map +1 -0
  133. package/dist/diagrams/lib/legend.d.ts +32 -0
  134. package/dist/diagrams/lib/legend.js +84 -0
  135. package/dist/diagrams/lib/legend.js.map +1 -0
  136. package/dist/diagrams/lib/marks.d.ts +207 -0
  137. package/dist/diagrams/lib/marks.js +480 -0
  138. package/dist/diagrams/lib/marks.js.map +1 -0
  139. package/dist/diagrams/lib/route.d.ts +85 -0
  140. package/dist/diagrams/lib/route.js +178 -0
  141. package/dist/diagrams/lib/route.js.map +1 -0
  142. package/dist/diagrams/lib/wires.d.ts +59 -0
  143. package/dist/diagrams/lib/wires.js +90 -0
  144. package/dist/diagrams/lib/wires.js.map +1 -0
  145. package/dist/diagrams/spec.d.ts +353 -0
  146. package/dist/diagrams/spec.js +1 -0
  147. package/dist/diagrams/spec.js.map +1 -0
  148. package/dist/lib/svg-export.d.ts +138 -0
  149. package/dist/lib/svg-export.js +198 -0
  150. package/dist/lib/svg-export.js.map +1 -0
  151. package/dist/semantic.css +34 -0
  152. package/dist/styles.css +1 -1
  153. package/dist/tokens.d.ts +16 -0
  154. package/dist/tokens.js +82 -0
  155. package/dist/tokens.json +82 -0
  156. package/package.json +5 -1
  157. package/skills/misoto22-design/SKILL.md +58 -6
package/dist/tokens.json CHANGED
@@ -879,6 +879,88 @@
879
879
  "category": "layer",
880
880
  "light": "var(--z-scrim)"
881
881
  },
882
+ "diagram-surface": {
883
+ "layer": "semantic",
884
+ "category": "other",
885
+ "light": "var(--paper)",
886
+ "comment": "─── Diagrams ─────────────────────────────────────────────────────────── The figures in `@misoto22/design/diagrams`, which draw in SVG and therefore cannot read a custom property from a presentation attribute — every one of these reaches a mark through a style rule. Named separately from the page's own rules rather than pointed straight at --rule-2 because a figure is a PICTURE inside a document: its hairline has to hold up against a 1200-wide raster export and a greyscale print, where the page's own hairline is chosen to disappear. Keeping the two apart is what lets a figure be tuned without touching a table. Nothing here is a hue. The seven kinds of node are separated by drawn sigils, and the only colour a figure spends is --success / --danger on a terminal lifecycle state — the same two the rest of the system reserves for state and refuses to spend on brand."
887
+ },
888
+ "diagram-node": {
889
+ "layer": "semantic",
890
+ "category": "other",
891
+ "light": "var(--paper)"
892
+ },
893
+ "diagram-node-2": {
894
+ "layer": "semantic",
895
+ "category": "other",
896
+ "light": "var(--paper-2)"
897
+ },
898
+ "diagram-band": {
899
+ "layer": "semantic",
900
+ "category": "other",
901
+ "light": "var(--stone)"
902
+ },
903
+ "diagram-chip": {
904
+ "layer": "semantic",
905
+ "category": "other",
906
+ "light": "var(--paper-2)"
907
+ },
908
+ "diagram-rule": {
909
+ "layer": "semantic",
910
+ "category": "other",
911
+ "light": "var(--rule-2)"
912
+ },
913
+ "diagram-rule-hard": {
914
+ "layer": "semantic",
915
+ "category": "other",
916
+ "light": "var(--ink-3-aa)"
917
+ },
918
+ "diagram-line": {
919
+ "layer": "semantic",
920
+ "category": "other",
921
+ "light": "var(--ink-2)"
922
+ },
923
+ "diagram-line-strong": {
924
+ "layer": "semantic",
925
+ "category": "other",
926
+ "light": "var(--ink)"
927
+ },
928
+ "diagram-line-soft": {
929
+ "layer": "semantic",
930
+ "category": "colour",
931
+ "light": "var(--ink-3-aa)"
932
+ },
933
+ "diagram-sigil": {
934
+ "layer": "semantic",
935
+ "category": "other",
936
+ "light": "var(--ink-3-aa)"
937
+ },
938
+ "diagram-ink": {
939
+ "layer": "semantic",
940
+ "category": "other",
941
+ "light": "var(--ink)"
942
+ },
943
+ "diagram-ink-2": {
944
+ "layer": "semantic",
945
+ "category": "other",
946
+ "light": "var(--ink-2)"
947
+ },
948
+ "diagram-ink-3": {
949
+ "layer": "semantic",
950
+ "category": "other",
951
+ "light": "var(--ink-3-aa)"
952
+ },
953
+ "diagram-plate": {
954
+ "layer": "semantic",
955
+ "category": "other",
956
+ "light": "var(--accent)",
957
+ "comment": "The reversed plate, and its type. A figure gets ONE of these — the node the diagram is about — for the same reason a page gets one Card variant=\"plate\"."
958
+ },
959
+ "diagram-plate-ink": {
960
+ "layer": "semantic",
961
+ "category": "other",
962
+ "light": "var(--accent-foreground)"
963
+ },
882
964
  "page-pad": {
883
965
  "layer": "semantic",
884
966
  "category": "space",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misoto22/design",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "description": "Monochrome design system — CSS tokens and accessible React primitives",
6
6
  "license": "MIT",
@@ -28,6 +28,10 @@
28
28
  "types": "./dist/charts/index.d.ts",
29
29
  "import": "./dist/charts/index.js"
30
30
  },
31
+ "./diagrams": {
32
+ "types": "./dist/diagrams/index.d.ts",
33
+ "import": "./dist/diagrams/index.js"
34
+ },
31
35
  "./styles.css": "./dist/styles.css",
32
36
  "./tokens.css": "./dist/tokens.css",
33
37
  "./semantic.css": "./dist/semantic.css",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: misoto22-design
3
- description: Builds UI with @misoto22/design — a monochrome design system of CSS tokens and 52 accessible React primitives. Use when a project imports '@misoto22/design', sets data-mode / data-surface / data-radius / data-accent, or uses cn(), CONTROL_BASE, or isInvalid. Also applies when adding a component, theming, or fixing a form, table, dialog, or toast in such a project.
3
+ description: Builds UI with @misoto22/design — a monochrome design system of CSS tokens and 83 accessible React primitives, charts and diagrams included. Use when a project imports '@misoto22/design', '@misoto22/design/charts' or '@misoto22/design/diagrams', sets data-mode / data-surface / data-radius / data-density, or uses cn(), CONTROL_BASE, or isInvalid. Also applies when adding a component, theming, plotting data, drawing an architecture, workflow, sequence, data-flow or lifecycle diagram, or fixing a form, table, dialog, or toast in such a project.
4
4
  allowed-tools: Bash(npx misoto22-design *), Bash(pnpm exec misoto22-design *), Bash(bunx misoto22-design *)
5
5
  ---
6
6
 
@@ -14,6 +14,54 @@ import { Button, Field, Input } from '@misoto22/design'
14
14
  import '@misoto22/design/styles.css'
15
15
  ```
16
16
 
17
+ ## Three entry points
18
+
19
+ The root entry has no dependencies a consumer has to install. Two groups live
20
+ behind their own specifier instead, each for weight the root should not carry:
21
+
22
+ ```tsx
23
+ import { AreaChart, BarList, BigNumber } from '@misoto22/design/charts'
24
+ import { ArchitectureFigure, DiagramCanvas } from '@misoto22/design/diagrams'
25
+ ```
26
+
27
+ Charts need a rendering engine and an animation runtime that nothing else in
28
+ the package does:
29
+
30
+ ```bash
31
+ pnpm add recharts motion # optional peers, only for the charts entry
32
+ ```
33
+
34
+ That separation is the reason an app that renders a Badge never resolves
35
+ `recharts` — so importing a chart from the root specifier does not render a
36
+ blank component, it throws. `docs <Component>` prints the right line for each
37
+ one; the `Import:` header is derived from the tree the component lives in, not
38
+ written by hand.
39
+
40
+ Some of the charts need no engine at all — `Heatmap` is a `<table>`,
41
+ `Sparkline` is one `<path>`, `BarList`, `BigNumber` and `BulletChart` are plain
42
+ HTML — but they ship from the charts entry all the same, so the boundary stays
43
+ one line rather than a list to memorise.
44
+
45
+ Diagrams need no peer at all; they carry an orthogonal routing engine instead,
46
+ which has no business in a bundle that renders a Badge. Reach for that entry
47
+ when the task is to DRAW a system rather than to build a screen:
48
+ `ArchitectureFigure` for what talks to what, `WorkflowFigure` for a process in
49
+ lanes, `SequenceFigure` for a call chain over time, `DataflowFigure` for a
50
+ pipeline, `LifecycleFigure` for a state machine. Each takes a typed JSON
51
+ specification and renders on a server. `Diagram` is a different thing and stays
52
+ on the root: a nesting CSS diagram for an article, not an SVG figure with
53
+ routed edges.
54
+
55
+ One more, for surfaces that cannot read a custom property — an OpenGraph card, a
56
+ `theme-color`, a canvas:
57
+
58
+ ```ts
59
+ import { TOKENS } from '@misoto22/design/tokens'
60
+ ```
61
+
62
+ Never for styling a component. A literal in a stylesheet is a value that stops
63
+ following the theme, and every one of these mirrors a token that does.
64
+
17
65
  ## What this project has installed
18
66
 
19
67
  ```
@@ -30,9 +78,10 @@ npx misoto22-design docs Button
30
78
  ```
31
79
 
32
80
  Run that before writing against a component you have not used in this session.
33
- The median component is ~500 tokens and the largest is ~1,300, against ~28,000
34
- for all fifty-two. It is generated from the installed source, so it cannot be
35
- out of date the way the website can.
81
+ The median component is ~500 tokens and the largest is ~1,300, against far more
82
+ for all eighty-three. It is generated from the installed source, so it cannot be
83
+ out of date the way the website can — and each file names the specifier it
84
+ ships from on its `Import:` line, which is the half that matters below.
36
85
 
37
86
  It also resolves parts and types, not just components: `docs CardBody`,
38
87
  `docs TH` and `docs ButtonVariant` all land on the right file. When an import
@@ -63,9 +112,12 @@ you are about to do that thing, not before.
63
112
  `border-(--border-color)`.
64
113
  - **Never write a `dark:` variant.** Dark mode is a value swap behind
65
114
  `data-mode="dark"`; a `dark:` override fights it and wins in only one theme.
66
- - **Theme with the seven `data-*` axes**, set on any element, not just `:root`.
115
+ - **Theme with the `data-*` axes**, set on any element, not just `:root`.
67
116
  `data-mode`, `data-surface`, `data-radius`, `data-rules`, `data-type`,
68
- `data-motion`, `data-density`, plus `data-accent`.
117
+ `data-motion`, `data-density`, `data-table-density`, `data-chart-palette`.
118
+ There is no `data-accent` — `--accent` is a custom property, re-pointed in
119
+ CSS. `npx misoto22-design docs --installed` prints the current list; it is
120
+ read out of the stylesheets rather than kept by hand here.
69
121
  - **Durations and radii come from tokens.** `duration-(--duration-fast)`,
70
122
  `rounded-(--radius)` — not `duration-150`, not `rounded-lg`.
71
123
  - **No blurred shadow.** `--shadow*` resolves to `none` on purpose. Depth is a