@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.
- package/README.md +12 -0
- package/dist/agent/Accordion.md +1 -1
- package/dist/agent/Alert.md +1 -1
- package/dist/agent/AppShell.md +1 -1
- package/dist/agent/ArchitectureFigure.md +48 -0
- package/dist/agent/AreaChart.md +1 -1
- package/dist/agent/Article.md +1 -1
- package/dist/agent/Avatar.md +1 -1
- package/dist/agent/Badge.md +1 -1
- package/dist/agent/BarChart.md +1 -1
- package/dist/agent/BarList.md +1 -1
- package/dist/agent/BigNumber.md +1 -1
- package/dist/agent/BoxPlot.md +1 -1
- package/dist/agent/Breadcrumb.md +1 -1
- package/dist/agent/BulletChart.md +1 -1
- package/dist/agent/Button.md +1 -1
- package/dist/agent/Calendar.md +1 -1
- package/dist/agent/Card.md +1 -1
- package/dist/agent/Checkbox.md +1 -1
- package/dist/agent/Collapsible.md +1 -1
- package/dist/agent/Combobox.md +1 -1
- package/dist/agent/Command.md +1 -1
- package/dist/agent/ComposedChart.md +1 -1
- package/dist/agent/ContextMenu.md +1 -1
- package/dist/agent/DataflowFigure.md +27 -0
- package/dist/agent/DatePicker.md +1 -1
- package/dist/agent/Diagram.md +1 -1
- package/dist/agent/DiagramCanvas.md +47 -0
- package/dist/agent/DiagramExportMenu.md +38 -0
- package/dist/agent/DiagramInspector.md +50 -0
- package/dist/agent/DiagramLegend.md +34 -0
- package/dist/agent/DiagramMinimap.md +48 -0
- package/dist/agent/DiagramToolbar.md +47 -0
- package/dist/agent/Dialog.md +1 -1
- package/dist/agent/DropdownMenu.md +1 -1
- package/dist/agent/EmptyState.md +1 -1
- package/dist/agent/ErrorState.md +1 -1
- package/dist/agent/Facet.md +1 -1
- package/dist/agent/Field.md +1 -1
- package/dist/agent/FigureBand.md +1 -1
- package/dist/agent/FloatingIconButton.md +1 -1
- package/dist/agent/FunnelChart.md +1 -1
- package/dist/agent/Heatmap.md +1 -1
- package/dist/agent/Histogram.md +1 -1
- package/dist/agent/Input.md +1 -1
- package/dist/agent/Kbd.md +1 -1
- package/dist/agent/LifecycleFigure.md +28 -0
- package/dist/agent/LineChart.md +1 -1
- package/dist/agent/LinkArrow.md +1 -1
- package/dist/agent/NativeSelect.md +1 -1
- package/dist/agent/NavItem.md +1 -1
- package/dist/agent/Pagination.md +1 -1
- package/dist/agent/PieChart.md +1 -1
- package/dist/agent/Popover.md +1 -1
- package/dist/agent/Progress.md +1 -1
- package/dist/agent/RadarChart.md +1 -1
- package/dist/agent/RadialChart.md +1 -1
- package/dist/agent/RadioGroup.md +1 -1
- package/dist/agent/SankeyChart.md +1 -1
- package/dist/agent/ScatterChart.md +1 -1
- package/dist/agent/ScrollArea.md +1 -1
- package/dist/agent/SearchableMenu.md +1 -1
- package/dist/agent/Select.md +1 -1
- package/dist/agent/Separator.md +1 -1
- package/dist/agent/SequenceFigure.md +28 -0
- package/dist/agent/Sheet.md +1 -1
- package/dist/agent/Skeleton.md +1 -1
- package/dist/agent/Slider.md +1 -1
- package/dist/agent/Sparkline.md +1 -1
- package/dist/agent/Spinner.md +1 -1
- package/dist/agent/StatusDot.md +1 -1
- package/dist/agent/StatusPill.md +1 -1
- package/dist/agent/Steps.md +1 -1
- package/dist/agent/Switch.md +1 -1
- package/dist/agent/Table.md +1 -1
- package/dist/agent/Tabs.md +1 -1
- package/dist/agent/Tag.md +1 -1
- package/dist/agent/Textarea.md +1 -1
- package/dist/agent/Toast.md +1 -1
- package/dist/agent/ToggleGroup.md +1 -1
- package/dist/agent/Tooltip.md +1 -1
- package/dist/agent/TreemapChart.md +1 -1
- package/dist/agent/WaterfallChart.md +1 -1
- package/dist/agent/WorkflowFigure.md +28 -0
- package/dist/agent/catalog.json +223 -3
- package/dist/agent/index.md +15 -1
- package/dist/charts/index.d.ts +2 -1
- package/dist/charts/lib/export.d.ts +33 -43
- package/dist/charts/lib/export.js +16 -158
- package/dist/charts/lib/export.js.map +1 -1
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.d.ts +49 -0
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js +135 -0
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js.map +1 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.d.ts +28 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.js +129 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.js.map +1 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.d.ts +64 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.js +222 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.js.map +1 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.d.ts +72 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js +125 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js.map +1 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.d.ts +70 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.js +94 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.js.map +1 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.d.ts +42 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.js +35 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.js.map +1 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.d.ts +61 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.js +79 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.js.map +1 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.d.ts +48 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.js +53 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.js.map +1 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.d.ts +31 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.js +202 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.js.map +1 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.d.ts +38 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.js +231 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.js.map +1 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.d.ts +34 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.js +211 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.js.map +1 -0
- package/dist/diagrams/index.d.ts +16 -0
- package/dist/diagrams/index.js +19 -0
- package/dist/diagrams/index.js.map +1 -0
- package/dist/diagrams/lib/frame.d.ts +97 -0
- package/dist/diagrams/lib/frame.js +116 -0
- package/dist/diagrams/lib/frame.js.map +1 -0
- package/dist/diagrams/lib/geometry.d.ts +114 -0
- package/dist/diagrams/lib/geometry.js +113 -0
- package/dist/diagrams/lib/geometry.js.map +1 -0
- package/dist/diagrams/lib/legend.d.ts +32 -0
- package/dist/diagrams/lib/legend.js +84 -0
- package/dist/diagrams/lib/legend.js.map +1 -0
- package/dist/diagrams/lib/marks.d.ts +207 -0
- package/dist/diagrams/lib/marks.js +480 -0
- package/dist/diagrams/lib/marks.js.map +1 -0
- package/dist/diagrams/lib/route.d.ts +85 -0
- package/dist/diagrams/lib/route.js +178 -0
- package/dist/diagrams/lib/route.js.map +1 -0
- package/dist/diagrams/lib/wires.d.ts +59 -0
- package/dist/diagrams/lib/wires.js +90 -0
- package/dist/diagrams/lib/wires.js.map +1 -0
- package/dist/diagrams/spec.d.ts +353 -0
- package/dist/diagrams/spec.js +1 -0
- package/dist/diagrams/spec.js.map +1 -0
- package/dist/lib/svg-export.d.ts +138 -0
- package/dist/lib/svg-export.js +198 -0
- package/dist/lib/svg-export.js.map +1 -0
- package/dist/semantic.css +34 -0
- package/dist/styles.css +1 -1
- package/dist/tokens.d.ts +16 -0
- package/dist/tokens.js +82 -0
- package/dist/tokens.json +82 -0
- package/package.json +5 -1
- 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
|
package/dist/agent/Accordion.md
CHANGED
package/dist/agent/Alert.md
CHANGED
package/dist/agent/AppShell.md
CHANGED
|
@@ -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
|
+
```
|
package/dist/agent/AreaChart.md
CHANGED
|
@@ -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.
|
|
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
|
|
package/dist/agent/Article.md
CHANGED
|
@@ -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.
|
|
7
|
+
- Version: 0.7.0
|
|
8
8
|
- Docs: https://ui.misoto22.com/components/article/
|
|
9
9
|
- Related: diagram, card
|
|
10
10
|
|
package/dist/agent/Avatar.md
CHANGED
package/dist/agent/Badge.md
CHANGED
package/dist/agent/BarChart.md
CHANGED
|
@@ -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.
|
|
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
|
|
package/dist/agent/BarList.md
CHANGED
|
@@ -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.
|
|
7
|
+
- Version: 0.7.0
|
|
8
8
|
- Docs: https://ui.misoto22.com/components/bar-list/
|
|
9
9
|
- Related: bar-chart, table
|
|
10
10
|
|
package/dist/agent/BigNumber.md
CHANGED
package/dist/agent/BoxPlot.md
CHANGED
package/dist/agent/Breadcrumb.md
CHANGED
|
@@ -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.
|
|
7
|
+
- Version: 0.7.0
|
|
8
8
|
- Docs: https://ui.misoto22.com/components/bullet-chart/
|
|
9
9
|
- Related: bar-list, big-number
|
|
10
10
|
|
package/dist/agent/Button.md
CHANGED
|
@@ -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.
|
|
7
|
+
- Version: 0.7.0
|
|
8
8
|
- Docs: https://ui.misoto22.com/components/button/
|
|
9
9
|
- Related: floating-icon-button, spinner
|
|
10
10
|
|
package/dist/agent/Calendar.md
CHANGED
package/dist/agent/Card.md
CHANGED
package/dist/agent/Checkbox.md
CHANGED
package/dist/agent/Combobox.md
CHANGED
package/dist/agent/Command.md
CHANGED
|
@@ -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.
|
|
7
|
+
- Version: 0.7.0
|
|
8
8
|
- Docs: https://ui.misoto22.com/components/composed-chart/
|
|
9
9
|
- Related: bar-chart, line-chart
|
|
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`.
|
package/dist/agent/DatePicker.md
CHANGED
package/dist/agent/Diagram.md
CHANGED
|
@@ -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.
|
|
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
|
+
```
|
package/dist/agent/Dialog.md
CHANGED