@misoto22/design 0.6.1 → 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 +1 -1
  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 +1 -1
  11. package/dist/agent/BarList.md +1 -1
  12. package/dist/agent/BigNumber.md +1 -1
  13. package/dist/agent/BoxPlot.md +1 -1
  14. package/dist/agent/Breadcrumb.md +1 -1
  15. package/dist/agent/BulletChart.md +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  43. package/dist/agent/Heatmap.md +1 -1
  44. package/dist/agent/Histogram.md +1 -1
  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 +1 -1
  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 +1 -1
  54. package/dist/agent/Popover.md +1 -1
  55. package/dist/agent/Progress.md +1 -1
  56. package/dist/agent/RadarChart.md +1 -1
  57. package/dist/agent/RadialChart.md +1 -1
  58. package/dist/agent/RadioGroup.md +1 -1
  59. package/dist/agent/SankeyChart.md +1 -1
  60. package/dist/agent/ScatterChart.md +1 -1
  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 +1 -1
  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 +1 -1
  83. package/dist/agent/WaterfallChart.md +1 -1
  84. package/dist/agent/WorkflowFigure.md +28 -0
  85. package/dist/agent/catalog.json +223 -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 +21 -7
package/README.md CHANGED
@@ -30,6 +30,18 @@ import '@misoto22/design/semantic.css' // roles
30
30
  import '@misoto22/design/keyframes.css' // motion
31
31
  ```
32
32
 
33
+ Diagrams ship from their own specifier, so a page that renders a `Badge` does
34
+ not pay for a routing engine:
35
+
36
+ ```tsx
37
+ import { ArchitectureFigure, DiagramCanvas } from '@misoto22/design/diagrams'
38
+ ```
39
+
40
+ Five server-rendered figures — architecture, workflow, sequence, data-flow and
41
+ lifecycle — plus the chrome to explore one. They read the JSON schemas
42
+ published by [archify](https://github.com/tt-a1i/archify), so a specification
43
+ authored for that tool renders here with no translation step.
44
+
33
45
  ## Theming
34
46
 
35
47
  Seven independent axes, each an attribute, each working on **any** element
@@ -4,7 +4,7 @@ Disclosure rows that open in place.
4
4
 
5
5
  - Group: Navigation
6
6
  - Import: `import { Accordion } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/accordion/
9
9
  - Related: tabs
10
10
 
@@ -4,7 +4,7 @@ A message about the page, in place.
4
4
 
5
5
  - Group: Feedback
6
6
  - Import: `import { Alert } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/alert/
9
9
  - Related: toast, error-state
10
10
 
@@ -4,7 +4,7 @@ Two columns on a desktop, a drawer on a phone.
4
4
 
5
5
  - Group: Surfaces
6
6
  - Import: `import { AppShell } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/app-shell/
9
9
  - Related: nav-item
10
10
 
@@ -0,0 +1,48 @@
1
+ # ArchitectureFigure
2
+
3
+ A component map: services, datastores, trust boundaries, and what talks to what.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { ArchitectureFigure } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/architecture-figure/
9
+ - Related: dataflow-figure, diagram, diagram-canvas
10
+
11
+ ## When to reach for it
12
+
13
+ Reach for it when the question is "what talks to what". If the question is "in what order", that is a workflow or a sequence; if it is "what is in this arrow", that is a data flow.
14
+
15
+ ## Accessibility
16
+
17
+ - The <svg> is role="img" with a name, so a screen reader announces a picture instead of walking two hundred <text> nodes in drawing order.
18
+ - The diagram’s content is published beside it as an ordinary list — every node with its kind, every relationship as "A → B: over HTTPS". That list is where the meaning lives for anyone not looking at the picture.
19
+ - Passing onSelectNode turns that list into real buttons, which is the keyboard’s only route to a selection: the plates inside the picture are presentational by construction.
20
+
21
+ ## ArchitectureFigure
22
+
23
+ A component map: services, datastores, boundaries, and what talks to what. Takes the same JSON an archify `architecture` specification carries — `components`, `boundaries`, `connections` — and draws it in this system's own terms: paper plates on a hairline, one reversed plate for the component the diagram is about, and seven drawn sigils where archify uses seven hues. IT RENDERS ON A SERVER because every position is already in the specification. A component gives a `row` and a `col` into a grid whose cell size is either declared or defaulted, or it gives an absolute `pos` — nothing here is solved for, relaxed, or measured. So the markup is a pure function of the input, it is identical on the server and in the browser, and there is no layout shift on hydration because there is no layout to do. BOUNDARIES ARE DRAWN FIRST, AND DRAWN DIFFERENTLY. A `region` is where something RUNS — a VPC, a zone, a cluster — and is a solid frame. A `security-group` is what may REACH it, and is dashed. That is not decoration: an infrastructure diagram is very often read for exactly one of those two questions, and a reader should be able to tell which line answers which without reading either label.
24
+
25
+ ### Props
26
+
27
+ - `spec` (required) — `ArchitectureSpec`.
28
+
29
+ Also accepts: `FigureChrome`.
30
+
31
+ ## Examples
32
+
33
+ ```tsx
34
+ <ArchitectureFigure
35
+ spec={{
36
+ meta: { title: 'Request path' },
37
+ components: [
38
+ { id: 'cdn', type: 'cloud', label: 'CloudFront', row: 0, col: 0 },
39
+ { id: 'api', type: 'backend', label: 'FastAPI', sublabel: 'ECS', row: 0, col: 1 },
40
+ { id: 'db', type: 'database', label: 'Postgres', row: 0, col: 2 },
41
+ ],
42
+ connections: [
43
+ { from: 'cdn', to: 'api', label: 'HTTPS' },
44
+ { from: 'api', to: 'db', label: 'SQL' },
45
+ ],
46
+ }}
47
+ />
48
+ ```
@@ -4,7 +4,7 @@ A filled series over a continuous axis, where the area means something.
4
4
 
5
5
  - Group: Charts
6
6
  - Import: `import { AreaChart } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/area-chart/
9
9
  - Related: line-chart, bar-chart, composed-chart
10
10
 
@@ -4,7 +4,7 @@ The long-form reading surface — everything a Markdown pipeline emits, in this
4
4
 
5
5
  - Group: Surfaces
6
6
  - Import: `import { Article } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/article/
9
9
  - Related: diagram, card
10
10
 
@@ -4,7 +4,7 @@ A person, as a circle, with initials until the image lands.
4
4
 
5
5
  - Group: Display
6
6
  - Import: `import { Avatar } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/avatar/
9
9
 
10
10
  ## Accessibility
@@ -4,7 +4,7 @@ A count or a state, set in mono so it reads as metadata.
4
4
 
5
5
  - Group: Display
6
6
  - Import: `import { Badge } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/badge/
9
9
  - Related: tag, status-pill
10
10
 
@@ -4,7 +4,7 @@ Discrete categories compared by length.
4
4
 
5
5
  - Group: Charts
6
6
  - Import: `import { BarChart } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/bar-chart/
9
9
  - Related: area-chart, composed-chart, radial-chart
10
10
 
@@ -4,7 +4,7 @@ A ranked list, with the bar behind the name rather than beside it.
4
4
 
5
5
  - Group: Data
6
6
  - Import: `import { BarList } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/bar-list/
9
9
  - Related: bar-chart, table
10
10
 
@@ -4,7 +4,7 @@ One number, at the size of a headline.
4
4
 
5
5
  - Group: Data
6
6
  - Import: `import { BigNumber } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/big-number/
9
9
  - Related: sparkline, figure-band
10
10
 
@@ -4,7 +4,7 @@ The spread of a measurement, per category.
4
4
 
5
5
  - Group: Charts
6
6
  - Import: `import { BoxPlot } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/box-plot/
9
9
  - Related: histogram, scatter-chart
10
10
 
@@ -4,7 +4,7 @@ Where you are, as a path.
4
4
 
5
5
  - Group: Navigation
6
6
  - Import: `import { Breadcrumb } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/breadcrumb/
9
9
  - Related: pagination
10
10
 
@@ -4,7 +4,7 @@ A measure, its target, and the bands that say whether it is any good.
4
4
 
5
5
  - Group: Data
6
6
  - Import: `import { BulletChart } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/bullet-chart/
9
9
  - Related: bar-list, big-number
10
10
 
@@ -4,7 +4,7 @@ The system’s action, on the same corner as the field beside it.
4
4
 
5
5
  - Group: Actions
6
6
  - Import: `import { Button } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/button/
9
9
  - Related: floating-icon-button, spinner
10
10
 
@@ -4,7 +4,7 @@ A month, as a grid of days.
4
4
 
5
5
  - Group: Surfaces
6
6
  - Import: `import { Calendar } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/calendar/
9
9
  - Related: date-picker
10
10
 
@@ -4,7 +4,7 @@ A bounded surface, with no shadow under it.
4
4
 
5
5
  - Group: Surfaces
6
6
  - Import: `import { Card } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/card/
9
9
  - Related: table, figure-band
10
10
 
@@ -4,7 +4,7 @@ A choice that takes effect when the form is submitted.
4
4
 
5
5
  - Group: Forms
6
6
  - Import: `import { Checkbox } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/checkbox/
9
9
  - Related: switch, radio-group
10
10
 
@@ -4,7 +4,7 @@ One thing that opens, on its own.
4
4
 
5
5
  - Group: Navigation
6
6
  - Import: `import { Collapsible } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/collapsible/
9
9
  - Related: accordion
10
10
 
@@ -4,7 +4,7 @@ A select you can type into.
4
4
 
5
5
  - Group: Forms
6
6
  - Import: `import { Combobox } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/combobox/
9
9
  - Related: select, command
10
10
 
@@ -4,7 +4,7 @@ A filterable list of actions — the ⌘K surface.
4
4
 
5
5
  - Group: Overlays
6
6
  - Import: `import { Command } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/command/
9
9
  - Related: combobox, dialog
10
10
 
@@ -4,7 +4,7 @@ Bars and lines over one axis — the volume, and the rate it moved at.
4
4
 
5
5
  - Group: Charts
6
6
  - Import: `import { ComposedChart } from '@misoto22/design/charts'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/composed-chart/
9
9
  - Related: bar-chart, line-chart
10
10
 
@@ -4,7 +4,7 @@ The menu a right-click opens.
4
4
 
5
5
  - Group: Overlays
6
6
  - Import: `import { ContextMenu } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/context-menu/
9
9
  - Related: dropdown-menu
10
10
 
@@ -0,0 +1,27 @@
1
+ # DataflowFigure
2
+
3
+ A pipeline: where data comes from, what happens to it, and who ends up with it.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DataflowFigure } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/dataflow-figure/
9
+ - Related: architecture-figure, lifecycle-figure
10
+
11
+ ## When to reach for it
12
+
13
+ Structurally close to an architecture map, read for a different question. classification gets its own chip because a governance reviewer is looking for exactly that.
14
+
15
+ ## Accessibility
16
+
17
+ - A flow’s classification is folded into its summary line, so "clickstream — PII touch" reaches a reader who cannot see the chip.
18
+
19
+ ## DataflowFigure
20
+
21
+ A pipeline: where data comes from, what happens to it, and who ends up with it. Structurally close to an architecture map and read for a completely different question, which is why it is a separate renderer rather than a preset. An architecture diagram is read for "what talks to what". A data-flow diagram is read for "what is IN this arrow" — and that question is why `classification` gets its own mono chip under the label rather than being folded into the wording. `clickstream / PII touch` and `clickstream` are two different facts, and a governance reviewer is looking for the second one. Stages are printed as column headings on a rule across the top. They are the axis of the figure: a node's `stage` is its position along the pipeline, and a reader should be able to answer "how far has this got" by looking up rather than by tracing arrows.
22
+
23
+ ### Props
24
+
25
+ - `spec` (required) — `DataflowSpec`.
26
+
27
+ Also accepts: `FigureChrome`.
@@ -4,7 +4,7 @@ A date — or a span of them — chosen from a calendar.
4
4
 
5
5
  - Group: Forms
6
6
  - Import: `import { DatePicker } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/date-picker/
9
9
  - Related: calendar, field
10
10
 
@@ -4,7 +4,7 @@ A flow or architecture figure, drawn out of the system’s own parts.
4
4
 
5
5
  - Group: Display
6
6
  - Import: `import { Diagram } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/diagram/
9
9
  - Related: card, figure-band
10
10
 
@@ -0,0 +1,47 @@
1
+ # DiagramCanvas
2
+
3
+ A frame that a picture larger than it can be panned and zoomed inside.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramCanvas } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-canvas/
9
+ - Related: diagram-minimap, architecture-figure, scroll-area
10
+
11
+ ## When to reach for it
12
+
13
+ Any oversized figure — an SVG, an image, a table that will not fold. It knows nothing about nodes, which is what makes it reusable.
14
+
15
+ ## Accessibility
16
+
17
+ - The frame is a real tab stop, so the keyboard controls can be pressed at all.
18
+ - A plain wheel scrolls the page. Zoom needs the platform modifier, so the canvas is never a scroll trap in the middle of an article.
19
+
20
+ ## Keyboard
21
+
22
+ - + / = — Zooms in about the centre of the frame.
23
+ - - — Zooms out.
24
+ - 0 — Resets the scale and the offset together.
25
+ - ← / → / ↑ / ↓ — Pans. Shift pans further per press.
26
+
27
+ ## DiagramCanvas
28
+
29
+ A frame that a picture larger than it can be moved around inside. Pan with a drag, zoom with the controls or with ⌘/Ctrl and the wheel, and reset with a key. That is the whole of it — this is deliberately a VIEWPORT and not a diagram editor: nothing here knows what a node is, so it works for any oversized figure, an SVG, an image, a table that will not fold. Three decisions here are not obvious. **A plain wheel scrolls the page, not the diagram.** A canvas that swallows the wheel is a scroll trap: a reader flicking down an article hits the figure and the page stops moving for no reason they can see. Zooming needs the modifier — which is also the platform gesture for zoom everywhere else, and is what a trackpad pinch already sends. **The transform is on a wrapper, not on the content.** The child keeps its own coordinate space, so a figure inside can still be measured, exported and read by anything that walks it. Scaling the child directly would make every `getBoundingClientRect` inside it a lie. **Keyboard first, and the frame is a real tab stop.** `+` / `-` / `0` and the arrow keys move the view; the frame takes focus so they can be pressed at all. A canvas that only answers a drag is a canvas half the readers cannot operate.
30
+
31
+ ### Props
32
+
33
+ - `children` (required) — `ReactNode`.
34
+ - `className` — `string`.
35
+ - `height` — `string` default `'24rem'`. How tall the frame is. Anything CSS accepts.
36
+ - `onViewChange` — `(view: CanvasView) => void`. Told about every view change, for a minimap or a percentage readout.
37
+ - `controls` — `boolean` default `true`. Hides the built-in zoom controls, for a caller supplying its own.
38
+ - `label` — `string` default `'Diagram canvas'`. Names the region for assistive tech.
39
+ - `ref` — `Ref<DiagramCanvasHandle>`.
40
+
41
+ ## Examples
42
+
43
+ ```tsx
44
+ <DiagramCanvas height="26rem" label="Request path">
45
+ <ArchitectureFigure spec={spec} heading={false} legend="hidden" cards={false} />
46
+ </DiagramCanvas>
47
+ ```
@@ -0,0 +1,38 @@
1
+ # DiagramExportMenu
2
+
3
+ Taking the figure off the page: PNG, JPEG, WebP, SVG and a 1200×630 share card.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramExportMenu } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-export-menu/
9
+ - Related: dropdown-menu, diagram-toolbar
10
+
11
+ ## When to reach for it
12
+
13
+ It does the export rather than emitting a format name, because the interesting half — baking custom properties into real colours before serialising — is the half a caller would not know to write.
14
+
15
+ ## Accessibility
16
+
17
+ - A failed export is reported through onResult rather than swallowed: a click that quietly does nothing is indistinguishable from a broken button.
18
+
19
+ ## DiagramExportMenu
20
+
21
+ Taking the figure off the page: five files, one menu. WHY THE MENU DOES THE WORK rather than handing back a format: every one of these exports is the same six steps — find the `<svg>`, walk it with `getComputedStyle` to bake the custom properties into real colours, serialise, rasterise, name the file, hand it to the browser — and only the last two differ between them. A menu that emitted `'png'` and left the caller to do the rest would be a menu that every consumer reimplements, badly, and the interesting half (a serialised SVG resolves `var(--ink)` to nothing and comes out invisible) is exactly the half a caller would not know to write. `onExport` is still there for a page with its own pipeline — a server-side renderer, a different frame size — and taking it turns everything below into a no-op. What each format actually is, stated rather than implied. **SVG** is the artwork with resolved colours. It is editable and it is the only lossless one, but it carries no web fonts: a machine without the family renders it in a fallback, so type metrics will differ. **PNG, JPEG and WebP** are the browser's own rasteriser re-drawing that SVG at 2×. Not a screenshot — antialiasing and any effect a page stylesheet applied from OUTSIDE the `<svg>` are not in it. **JPEG has no alpha**, so it is flattened onto the resolved paper colour rather than onto black, which is what a transparent PNG becomes when a format with no transparency is asked to hold it. **The share card** is a 1200 × 630 frame with the title on it and the whole diagram letterboxed inside — never cropped. A card that cropped to fill the frame would be a picture of a different diagram.
22
+
23
+ ### Props
24
+
25
+ - `targetRef` (required) — `RefObject<HTMLElement | SVGSVGElement | null>`. The `<svg>` to export, or an element containing exactly one. A ref rather than a selector, because a page can hold several figures and a selector would export whichever the document happened to reach first.
26
+ - `title` (required) — `string`. Names the file, and is printed on the share card.
27
+ - `trigger` — `ReactNode`. Replaces the trigger.
28
+ - `className` — `string`.
29
+ - `onExport` — `(format: ExportFormat) => void | Promise<void>`. Runs instead of the built-in export — for a caller with its own pipeline.
30
+ - `onResult` — `(result: ExportResult) => void`. Told what happened, so a page can raise a toast.
31
+
32
+ ## exportFigure
33
+
34
+ One figure, one format, one file. Exported so a page can wire a keyboard shortcut or its own button to exactly what the menu does, without reimplementing the six steps.
35
+
36
+ ## Types
37
+
38
+ - `ExportFormat` = `'png' | 'jpeg' | 'webp' | 'svg' | 'share-card'`
@@ -0,0 +1,50 @@
1
+ # DiagramInspector
2
+
3
+ What the reader just picked, written out beside the picture.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramInspector } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-inspector/
9
+ - Related: card, diagram-canvas
10
+
11
+ ## When to reach for it
12
+
13
+ A node holds about eight words before it stops being a node. Everything past those — the port, the owner, the six relationships — belongs here.
14
+
15
+ ## Accessibility
16
+
17
+ - A labelled region with aria-live="polite", not a dialog: the reader clicked a node, they did not open anything, so focus is never trapped or demanded.
18
+ - Relationships are real buttons when they carry onSelect, which is how the graph becomes walkable peer by peer from the keyboard.
19
+
20
+ ## DiagramInspector
21
+
22
+ What the reader just picked, written out. A diagram can hold about eight words per node before it stops being a diagram and starts being a document with lines drawn on it. Everything past those eight — the port, the owning team, the file it was read out of, the six relationships it takes part in — belongs beside the picture rather than inside it, and this is that place. NOT A DIALOG, and that is deliberate. An inspector is a REGION that changes with the selection, not a modal. Giving it `role="dialog"` would trap focus and demand dismissal for something the reader never opened — they clicked a node, and the panel followed. So it is a labelled region with `aria-live="polite"`, which is what makes a screen reader announce the new selection without stealing the cursor from whatever the reader was doing. The relationships are real buttons when they carry `onSelect`, which is how the diagram becomes navigable from the keyboard: a reader can walk the graph peer by peer without ever touching the picture.
23
+
24
+ ### Props
25
+
26
+ - `eyebrow` — `string`. The kicker over the title — what KIND of thing this panel is showing.
27
+ - `title` (required) — `string`.
28
+ - `description` — `ReactNode`.
29
+ - `facts` — `InspectorFact[]` default `[]`.
30
+ - `links` — `InspectorLink[]` default `[]`.
31
+ - `actions` — `ReactNode`. Buttons under the facts — copy a link, open the source.
32
+ - `onClose` — `() => void`.
33
+ - `className` — `string`.
34
+ - `floating` — `boolean`. Renders as a floating panel over the surface rather than in the flow.
35
+
36
+ ## Examples
37
+
38
+ ```tsx
39
+ <DiagramInspector
40
+ eyebrow="Service"
41
+ title="API Server"
42
+ description="FastAPI, behind the load balancer."
43
+ facts={[
44
+ { label: 'Port', value: '8000', mono: true },
45
+ { label: 'Id', value: 'api', mono: true },
46
+ ]}
47
+ links={[{ direction: 'out', label: 'SQL', peer: 'PostgreSQL' }]}
48
+ onClose={() => setSelected(null)}
49
+ />
50
+ ```
@@ -0,0 +1,34 @@
1
+ # DiagramLegend
2
+
3
+ The key: which drawn form means which kind of thing.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramLegend } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-legend/
9
+ - Related: architecture-figure, lifecycle-figure
10
+
11
+ ## When to reach for it
12
+
13
+ Not optional furniture in a monochrome system. When a queue and a cache differ by a sigil rather than a colour, this is the only place a reader is told what the sigil means.
14
+
15
+ ## Accessibility
16
+
17
+ - A list of pairs rather than a row of spans, so the count is part of what a screen reader says about it.
18
+ - kindLegend, variantLegend and stateLegend build the standard sets out of the renderers’ own drawing code, so the key can never drift from the figure.
19
+
20
+ ## DiagramLegend
21
+
22
+ The key: which drawn form means which kind of thing. Not optional furniture in a monochrome system, and this is the one place that has to be said plainly. When the difference between a queue and a cache is a sigil rather than a colour, the key is the only place a reader is told what the sigil means — a figure whose forms are undocumented is a figure whose forms might as well not have been drawn. A `<ul>` rather than a row of `<span>`s: it is a list of pairs, and the count is part of what a screen reader should say about it.
23
+
24
+ ### Props
25
+
26
+ - `entries` (required) — `DiagramLegendEntry[]`.
27
+ - `title` — `string | null` default `'Key'`. The kicker before the row. Pass null for a bare row.
28
+ - `className` — `string`.
29
+
30
+ ## Examples
31
+
32
+ ```tsx
33
+ <DiagramLegend entries={kindLegend(['backend', 'database'])} />
34
+ ```
@@ -0,0 +1,48 @@
1
+ # DiagramMinimap
2
+
3
+ Where you are in something bigger than the window.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramMinimap } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-minimap/
9
+ - Related: diagram-canvas
10
+
11
+ ## When to reach for it
12
+
13
+ Pairs with DiagramCanvas. The viewport rectangle is derived from the canvas’s own view, never stored — a map that disagrees with its territory is worse than none.
14
+
15
+ ## Accessibility
16
+
17
+ - The miniature is aria-hidden. The figure it mirrors already publishes its own summary, and a second copy would read the whole diagram out twice.
18
+
19
+ ## DiagramMinimap
20
+
21
+ Where you are in something bigger than the window. Two things at once, and both are needed: a miniature of the whole artwork, and a rectangle showing which part of it the frame is currently over. The miniature alone answers "what is there"; the rectangle answers "and where am I", which is the question a reader who has just panned twice actually has. THE RECTANGLE IS DERIVED, never stored. Its position comes out of the canvas's own view — the same three numbers the canvas is already transforming by — divided by the map's scale. Keeping a second copy of "where the viewport is" is how a minimap comes to disagree with the thing it is a map of, and a map that disagrees is worse than none. CLICKING RECENTRES rather than jumping. `onSeek` reports a point in CONTENT coordinates, which is what a canvas's `centerOn` takes. The minimap does not move anything itself: it has no authority over the view, it only says where the reader pointed.
22
+
23
+ ### Props
24
+
25
+ - `content` (required) — `{ width: number; height: number }`. The whole artwork, at its natural size in CSS pixels.
26
+ - `frame` (required) — `{ width: number; height: number }`. The frame the artwork is being looked at through, in CSS pixels.
27
+ - `view` (required) — `CanvasView`. Where that frame currently sits — a `DiagramCanvas`'s `onViewChange`.
28
+ - `children` — `ReactNode`. A miniature of the artwork. Usually the same figure, rendered again.
29
+ - `onSeek` — `(x: number, y: number) => void`. Called with a point in CONTENT coordinates when the reader picks one.
30
+ - `width` — `number` default `200`. How wide the map is, in CSS pixels. Height follows the aspect ratio.
31
+ - `className` — `string`.
32
+ - `label` — `string` default `'Diagram overview'`.
33
+
34
+ ## Examples
35
+
36
+ ```tsx
37
+ const canvas = useRef<DiagramCanvasHandle>(null)
38
+ const [view, setView] = useState({ scale: 1, x: 0, y: 0 })
39
+ // …
40
+ <DiagramMinimap
41
+ content={{ width: 1400, height: 620 }}
42
+ frame={{ width: 720, height: 400 }}
43
+ view={view}
44
+ onSeek={(x, y) => canvas.current?.centerOn(x, y)}
45
+ >
46
+ <ArchitectureFigure spec={spec} heading={false} legend="hidden" cards={false} />
47
+ </DiagramMinimap>
48
+ ```
@@ -0,0 +1,47 @@
1
+ # DiagramToolbar
2
+
3
+ A bar of actions belonging to the surface underneath them.
4
+
5
+ - Group: Diagrams
6
+ - Import: `import { DiagramToolbar } from '@misoto22/design/diagrams'`
7
+ - Version: 0.7.0
8
+ - Docs: https://ui.misoto22.com/components/diagram-toolbar/
9
+ - Related: floating-icon-button, diagram-export-menu
10
+
11
+ ## When to reach for it
12
+
13
+ FloatingIconButton is one pinned action. This is the container for several, so they read as one object rather than as a scatter.
14
+
15
+ ## Accessibility
16
+
17
+ - role="toolbar" announces a toolbar rather than six unrelated buttons. It does not implement roving focus — Tab visits every control, which is honest for a bar of three.
18
+
19
+ ## DiagramToolbar
20
+
21
+ A bar of actions that belong to the surface underneath them. The package already has `FloatingIconButton` for ONE pinned action. This is the container for several — which is a different problem, because several pinned buttons need to read as one object rather than as a scatter: one plate, one border, hairlines between the groups, and a single `role="toolbar"` so a screen reader announces a toolbar instead of six unrelated buttons. `role="toolbar"` also changes the keyboard contract, and callers should know what they are opting into: arrow keys are expected to move between the controls and Tab is expected to leave the bar. This component does not implement roving focus for you — a bar of three buttons where Tab visits all three is honest and fine — so pass `placement="inline"` and skip the role by using a plain `<div>` if that is not what you want.
22
+
23
+ ### Props
24
+
25
+ - `children` (required) — `ReactNode`.
26
+ - `placement` — `'inline' | 'floating'` default `'inline'`. Where it sits. `floating` pins it over the surface it acts on.
27
+ - `align` — `'start' | 'end'` default `'end'`. Which corner a floating bar pins to.
28
+ - `label` (required) — `string`.
29
+
30
+ Also accepts: `Omit<ComponentProps<'div'>, 'children'>`.
31
+
32
+ ## DiagramToolbarGroup
33
+
34
+ One run of related controls inside the bar. Separated by a hairline rather than by space, because a gap large enough to read as a group boundary is also large enough to stop the bar reading as one object — which is the whole reason the controls were collected into a bar.
35
+
36
+ ## Examples
37
+
38
+ ```tsx
39
+ <DiagramToolbar label="Diagram actions" placement="floating">
40
+ <DiagramToolbarGroup>
41
+ <Button size="sm" variant="ghost">Theme</Button>
42
+ </DiagramToolbarGroup>
43
+ <DiagramToolbarGroup>
44
+ <DiagramExportMenu targetRef={svg} title="Request path" />
45
+ </DiagramToolbarGroup>
46
+ </DiagramToolbar>
47
+ ```
@@ -4,7 +4,7 @@ A modal surface: portal, scrim, centred panel.
4
4
 
5
5
  - Group: Overlays
6
6
  - Import: `import { Dialog } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/dialog/
9
9
  - Related: dropdown-menu, tooltip
10
10
 
@@ -4,7 +4,7 @@ A menu of actions.
4
4
 
5
5
  - Group: Overlays
6
6
  - Import: `import { DropdownMenu } from '@misoto22/design'`
7
- - Version: 0.6.1
7
+ - Version: 0.7.0
8
8
  - Docs: https://ui.misoto22.com/components/dropdown-menu/
9
9
  - Related: dialog, select
10
10