@beehexa/design-rules 2611.3.3 → 2611.5.2

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 (171) hide show
  1. package/README.md +1 -1
  2. package/dist/AGENTS.md +1 -7
  3. package/dist/catalog.json +703 -321
  4. package/dist/docs/public/_redirects +2 -0
  5. package/dist/docs/scripts/color-pairs.mjs +5 -1
  6. package/dist/docs/scripts/token-utils.d.mts +5 -1
  7. package/dist/docs/scripts/token-utils.mjs +44 -4
  8. package/dist/docs/src/brand/structure-proposal.md +1 -1
  9. package/dist/docs/src/components/ColorDemo.astro +56 -18
  10. package/dist/docs/src/components/ElevationDemo.astro +196 -0
  11. package/dist/docs/src/components/LayoutDemo.astro +1 -1
  12. package/dist/docs/src/components/MotionDemo.astro +135 -0
  13. package/dist/docs/src/components/NativeControlsDemo.astro +279 -0
  14. package/dist/docs/src/components/OpacityDemo.astro +95 -0
  15. package/dist/docs/src/components/RoleGuides.astro +2 -2
  16. package/dist/docs/src/components/ShapeDemo.astro +88 -44
  17. package/dist/docs/src/components/ShapePin.astro +5 -3
  18. package/dist/docs/src/components/SiteHeader.astro +19 -4
  19. package/dist/docs/src/components/SystemAreas.astro +1 -1
  20. package/dist/docs/src/components/TokenTable.astro +16 -1
  21. package/dist/docs/src/components/TypeDemo.astro +15 -15
  22. package/dist/docs/src/components/ZIndexDemo.astro +102 -0
  23. package/dist/docs/src/components/logos/LogoInUse.astro +3 -3
  24. package/dist/docs/src/content/components/button/accessibility.mdx +41 -8
  25. package/dist/docs/src/content/components/button/code.mdx +8 -1
  26. package/dist/docs/src/content/components/button/examples.mdx +23 -4
  27. package/dist/docs/src/content/components/button/usage.mdx +26 -0
  28. package/dist/docs/src/content/components/resizable-panel/accessibility.mdx +61 -0
  29. package/dist/docs/src/content/components/resizable-panel/changelog.mdx +20 -0
  30. package/dist/docs/src/content/components/resizable-panel/code.mdx +79 -0
  31. package/dist/docs/src/content/components/resizable-panel/examples.mdx +85 -0
  32. package/dist/docs/src/content/components/resizable-panel/meta.json +5 -0
  33. package/dist/docs/src/content/components/resizable-panel/usage.mdx +101 -0
  34. package/dist/docs/src/content/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
  35. package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +45 -0
  36. package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +58 -0
  37. package/dist/docs/src/content/foundations/guidelines/accessibility.mdx +100 -11
  38. package/dist/docs/src/content/foundations/guidelines/content.mdx +11 -2
  39. package/dist/docs/src/content/foundations/index.mdx +3 -3
  40. package/dist/docs/src/content/foundations/styles/border.mdx +13 -6
  41. package/dist/docs/src/content/foundations/styles/color/accessibility.mdx +4 -2
  42. package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +2 -2
  43. package/dist/docs/src/content/foundations/styles/color/index.mdx +14 -2
  44. package/dist/docs/src/content/foundations/styles/color/palette.mdx +4 -4
  45. package/dist/docs/src/content/foundations/styles/color/tokens.mdx +2 -2
  46. package/dist/docs/src/content/foundations/styles/color/usage.mdx +34 -5
  47. package/dist/docs/src/content/foundations/styles/data-visualization.mdx +150 -6
  48. package/dist/docs/src/content/foundations/styles/elevation.mdx +72 -3
  49. package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
  50. package/dist/docs/src/content/foundations/styles/icons/code.mdx +6 -18
  51. package/dist/docs/src/content/foundations/styles/icons/index.mdx +2 -2
  52. package/dist/docs/src/content/foundations/styles/icons/usage.mdx +13 -8
  53. package/dist/docs/src/content/foundations/styles/interaction-states.mdx +82 -9
  54. package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +12 -4
  55. package/dist/docs/src/content/foundations/styles/layout/breakpoints.mdx +10 -7
  56. package/dist/docs/src/content/foundations/styles/layout/grid.mdx +4 -2
  57. package/dist/docs/src/content/foundations/styles/layout/index.mdx +3 -3
  58. package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +28 -37
  59. package/dist/docs/src/content/foundations/styles/layout/page-widths.mdx +4 -4
  60. package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +7 -7
  61. package/dist/docs/src/content/foundations/styles/logos/index.mdx +13 -2
  62. package/dist/docs/src/content/foundations/styles/logos/placement-and-containers.mdx +4 -2
  63. package/dist/docs/src/content/foundations/styles/logos/product-logos.mdx +2 -2
  64. package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +3 -1
  65. package/dist/docs/src/content/foundations/styles/motion.mdx +131 -3
  66. package/dist/docs/src/content/foundations/styles/opacity.mdx +49 -5
  67. package/dist/docs/src/content/foundations/styles/radius.mdx +63 -15
  68. package/dist/docs/src/content/foundations/styles/scrollbars.mdx +176 -0
  69. package/dist/docs/src/content/foundations/styles/size-and-density.mdx +23 -6
  70. package/dist/docs/src/content/foundations/styles/spacing.mdx +17 -3
  71. package/dist/docs/src/content/foundations/styles/typography/code.mdx +5 -3
  72. package/dist/docs/src/content/foundations/styles/typography/index.mdx +13 -3
  73. package/dist/docs/src/content/foundations/styles/typography/usage.mdx +5 -3
  74. package/dist/docs/src/content/foundations/styles/typography/vietnamese.mdx +2 -2
  75. package/dist/docs/src/content/foundations/styles/z-index.mdx +67 -5
  76. package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +11 -0
  77. package/dist/docs/src/content/foundations/tokens/index.mdx +17 -9
  78. package/dist/docs/src/content/get-started/design.mdx +1 -1
  79. package/dist/docs/src/content/get-started/develop.mdx +2 -6
  80. package/dist/docs/src/content/get-started/index.mdx +1 -1
  81. package/dist/docs/src/content/release-phases/index.mdx +1 -1
  82. package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +571 -19
  83. package/dist/docs/src/content/tools/application-content.mdx +176 -0
  84. package/dist/docs/src/content/tools/editors.mdx +271 -0
  85. package/dist/docs/src/content/tools/eslint.mdx +1 -1
  86. package/dist/docs/src/content/tools/index.mdx +2 -2
  87. package/dist/docs/src/content/tools/mermaid.mdx +190 -0
  88. package/dist/docs/src/content/tools/vueflow.mdx +179 -0
  89. package/dist/docs/src/content-vi/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
  90. package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +45 -0
  91. package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +58 -0
  92. package/dist/docs/src/content-vi/foundations/guidelines/accessibility.mdx +108 -0
  93. package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +34 -0
  94. package/dist/docs/src/content-vi/foundations/index.mdx +9 -0
  95. package/dist/docs/src/content-vi/foundations/styles/border.mdx +12 -6
  96. package/dist/docs/src/content-vi/foundations/styles/color/accessibility.mdx +4 -2
  97. package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +2 -2
  98. package/dist/docs/src/content-vi/foundations/styles/color/index.mdx +14 -2
  99. package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +5 -5
  100. package/dist/docs/src/content-vi/foundations/styles/color/tokens.mdx +2 -2
  101. package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +34 -5
  102. package/dist/docs/src/content-vi/foundations/styles/data-visualization.mdx +75 -6
  103. package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +81 -0
  104. package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +1 -1
  105. package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +6 -18
  106. package/dist/docs/src/content-vi/foundations/styles/icons/index.mdx +2 -2
  107. package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +13 -8
  108. package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +22 -8
  109. package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +13 -1
  110. package/dist/docs/src/content-vi/foundations/styles/layout/breakpoints.mdx +10 -7
  111. package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +4 -2
  112. package/dist/docs/src/content-vi/foundations/styles/layout/index.mdx +3 -3
  113. package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +36 -0
  114. package/dist/docs/src/content-vi/foundations/styles/layout/page-widths.mdx +5 -1
  115. package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +7 -7
  116. package/dist/docs/src/content-vi/foundations/styles/logos/index.mdx +13 -2
  117. package/dist/docs/src/content-vi/foundations/styles/logos/placement-and-containers.mdx +4 -2
  118. package/dist/docs/src/content-vi/foundations/styles/logos/product-logos.mdx +2 -2
  119. package/dist/docs/src/content-vi/foundations/styles/logos/using-the-logo.mdx +3 -1
  120. package/dist/docs/src/content-vi/foundations/styles/motion.mdx +139 -0
  121. package/dist/docs/src/content-vi/foundations/styles/opacity.mdx +49 -5
  122. package/dist/docs/src/content-vi/foundations/styles/radius.mdx +63 -15
  123. package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +23 -6
  124. package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +17 -3
  125. package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +5 -3
  126. package/dist/docs/src/content-vi/foundations/styles/typography/index.mdx +14 -4
  127. package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +4 -2
  128. package/dist/docs/src/content-vi/foundations/styles/typography/vietnamese.mdx +2 -2
  129. package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +67 -5
  130. package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +47 -0
  131. package/dist/docs/src/content-vi/foundations/tokens/index.mdx +35 -0
  132. package/dist/docs/src/lib/i18n.ts +0 -1
  133. package/dist/docs/src/lib/token-descriptions-vi.ts +81 -14
  134. package/dist/docs/src/lib/tokens.ts +3 -0
  135. package/dist/docs/src/styles/chrome.css +21 -14
  136. package/dist/docs/src/styles/color.css +50 -53
  137. package/dist/docs/src/styles/docs.css +37 -55
  138. package/dist/docs/src/styles/elevation.css +83 -0
  139. package/dist/docs/src/styles/global.css +21 -10
  140. package/dist/docs/src/styles/icons.css +20 -23
  141. package/dist/docs/src/styles/kit.css +116 -0
  142. package/dist/docs/src/styles/layout.css +8 -13
  143. package/dist/docs/src/styles/motion.css +34 -0
  144. package/dist/docs/src/styles/opacity.css +43 -0
  145. package/dist/docs/src/styles/scrollbars.css +74 -0
  146. package/dist/docs/src/styles/shapes.css +35 -29
  147. package/dist/docs/src/styles/tokens.css +1663 -4
  148. package/dist/docs/src/styles/tokens.js +538 -4
  149. package/dist/docs/src/styles/typography.css +8 -11
  150. package/dist/docs/src/styles/zindex.css +59 -0
  151. package/dist/docs/tokens/border.json +1 -1
  152. package/dist/docs/tokens/color.json +75 -4
  153. package/dist/docs/tokens/content.json +24 -0
  154. package/dist/docs/tokens/diagram.json +54 -0
  155. package/dist/docs/tokens/editor.json +129 -0
  156. package/dist/docs/tokens/elevation.json +15 -5
  157. package/dist/docs/tokens/flow.json +497 -0
  158. package/dist/docs/tokens/layout.json +4 -0
  159. package/dist/docs/tokens/motion.json +37 -5
  160. package/dist/docs/tokens/opacity.json +9 -0
  161. package/dist/docs/tokens/radius.json +52 -8
  162. package/dist/docs/tokens/resize.json +79 -0
  163. package/dist/docs/tokens/scrollbar.json +40 -0
  164. package/dist/docs/tokens/size.json +7 -1
  165. package/dist/docs/tokens/spacing.json +35 -5
  166. package/dist/docs/tokens/switch.json +280 -0
  167. package/dist/docs/tokens/typography.json +5 -0
  168. package/dist/docs/tokens/visualization.json +123 -0
  169. package/dist/docs/tokens/z-index.json +49 -0
  170. package/dist/index.js +703 -321
  171. package/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ ---
2
+ title: Mermaid and execution diagrams
3
+ description: Source-backed Mermaid configuration, descriptive execution states, interaction and image export.
4
+ order: 6
5
+ ---
6
+
7
+ Use `@beehexa/mermaid-tokens` for every Mermaid initialization. It returns a fresh
8
+ `MermaidConfig` from `@beehexa/design-tokens`; Mermaid remains a peer dependency.
9
+ Pass the active `dark` and `locale` on every render. A theme or language change
10
+ requires rendering again: SVG paint and text measurements do not update from CSS alone.
11
+
12
+ ```ts
13
+ import { createMermaidConfig, createCanvasTheme } from '@beehexa/mermaid-tokens';
14
+
15
+ mermaid.initialize(createMermaidConfig({ dark: true, locale: 'vi' }));
16
+ const canvas = createCanvasTheme({ dark: true, locale: 'vi' });
17
+ ```
18
+
19
+ The factory secures `theme`, `look`, `themeVariables`, `themeCSS`, `fontFamily`,
20
+ `fontSize` and `htmlLabels` before `layout`. Mermaid 12 appends this secure array
21
+ to its own default security keys. Definition init CSS must not replace rich-card
22
+ token fonts; topology, definition-owned state styles and unrelated layout directives
23
+ remain available. This configuration contract is not a claim that a rendered smoke
24
+ matrix has passed.
25
+
26
+ ## Meaning before colour
27
+
28
+ `diagram.*` roles describe an operational execution graph, not an explanatory
29
+ brand schematic or a chart series palette. The same roles apply to the drawing,
30
+ its inspector and its exported artifact.
31
+
32
+ - Default and indeterminate nodes use `node-*` neutral pairs.
33
+ - `state-ran-ok` means **ran without a reported failure**, not a verified business
34
+ success. Informational paint and a completion marker distinguish execution from
35
+ untouched nodes without using business-success green. HTTP/business outcomes
36
+ retain their appropriate status labels independently.
37
+ - Failed nodes use `fail-*`, with a failure marker and state text.
38
+ - Log-only `log-reached` uses a reach marker. `log-unfinished` uses warning
39
+ paint, an ellipsis and a dashed boundary; it is never a proven failure.
40
+ - Never-reached nodes use `unreached-*` and an explicit state label; they are not
41
+ disabled controls. Not-taken branches use `nottaken-*` plus a dashed boundary.
42
+ - Repeat counts use the neutral `badge-*` pair. Repetition alone is not a warning.
43
+ - Category glyphs use `tile-*`. They identify step type, not run state.
44
+ - Selection and hover use `selection-ring` as **separate geometry outside the
45
+ node boundary**. Never repaint a failed node to indicate that it is selected.
46
+ - Field labels use `code-key`, values `code-value`, on `code-bg`. These descriptive
47
+ fields are not links. Full code blocks retain the existing `color.code.*` pair.
48
+
49
+ Always keep labels, markers, shapes or dash patterns: colour alone is not evidence.
50
+ Pair foregrounds only with their named fills. Validate actual SVG text and meaningful
51
+ line contrast in both themes; token existence does not certify a rendered diagram.
52
+
53
+ ## Type, space and interaction
54
+
55
+ `diagram.node-font` aliases `font.body.default`, including taller Vietnamese lines.
56
+ Use complete source font styles for node labels, inspector titles, metadata and code.
57
+ Do not replace their weight or line height with component-specific recipes. Let
58
+ Vietnamese marks and long labels wrap without clipping. `diagram.padding` is internal
59
+ node padding; `diagram.export-padding` frames fitted/exported drawing bounds. Graph
60
+ coordinates and existing layout topology are not spacing-scale choices.
61
+
62
+ Native compact worker flows keep the actual `compactFlowMermaid` output and the
63
+ public `flowStylesheet()` from `@beehexa/hexasync-template-model`. Install that
64
+ sheet before Mermaid measures labels, then include it in the SVG for standalone
65
+ export. Add `hx-flow` to the SVG root and bind `workerFlowSvgStyle(canvas)` from
66
+ `@beehexa/mermaid-tokens` as its inline style. Native card geometry, family masks
67
+ and typed state line-work remain native; the adapter owns literal source paint,
68
+ neutral category tile/glyph pairs and the canonical tile radius.
69
+
70
+ The installed worker package emits compact labels and has no rich-label/DOM
71
+ callback option. Its own stylesheet uses `p::first-line`, which cannot identify
72
+ the full wrapped title independently from the subtitle. Full rich-title parity
73
+ requires an upstream public anatomy/label capability. Do not add a downstream
74
+ emitter, label DOM mutation or first-line workaround to simulate that capability.
75
+ Embedded SVG CSS also supplies opaque source edge-label pairs and explicit
76
+ `"cv05", "cv08"` features alongside the complete font shorthand; SVG/export must
77
+ not depend on the document's universal font-feature rule.
78
+
79
+ Interactive preview nodes opt in with `bh-mermaid-interactive-node` on the actual
80
+ SVG group. Keep native role/tabindex, keyboard handling and real selection state;
81
+ bind `aria-selected="true"` for a supported selectable role or `aria-pressed="true"`
82
+ for a toggle button, never merely for expansion. The embedded
83
+ stylesheet adds `border.width.focused` / `diagram.selection-ring` outside the node
84
+ on hover, focus-visible and selection with `state.focus.offset`; it never repaints
85
+ run-state fill/stroke. `bh-mermaid-category-glyph` on authored SVG icon paths uses
86
+ `diagram.tile-glyph`, `border.width.default` and round caps/joins. Path coordinates
87
+ and transforms remain graph geometry.
88
+
89
+ Import `@beehexa/mermaid-tokens/css` once for HTML surrounding the SVG.
90
+ `data-bh-diagram="canvas|code|key|value|description|badge"` selects existing
91
+ `diagram.canvas`, `code-bg`, `code-key`, `code-value`, `node-desc` and the paired
92
+ repeat-count badge roles. The badge recipe includes its ordinary `radius.050`
93
+ label frame; content font markers and structural composition remain independent.
94
+ No local colour, border or canvas-background recipes are required.
95
+
96
+ Embedded `foreignObject` text also sets `-webkit-text-fill-color: currentcolor`.
97
+ This bridges HTML-to-image clones to the already resolved SVG label colour rather
98
+ than a document host's inherited text-fill; do not inject a second app stylesheet
99
+ during PNG capture.
100
+
101
+ Actual pan/zoom hosts use `bh-diagram-viewport`, with
102
+ `data-bh-dragging="true"` only during dragging, for grab/grabbing, touch-action
103
+ and user-select behavior. The application retains event handling, pointer capture,
104
+ viewport transforms, clipping and fit/export bounds; no native Mermaid layout API
105
+ can replace those application gesture mechanics. Rich nodes with decorated outer
106
+ rings use `data-bh-clickable="true"` and `data-bh-ring="hover"` on the hover ring.
107
+ Embedded CSS owns pointer/hover visibility, without changing ring geometry or the
108
+ separate selection/disclosure state.
109
+
110
+ Native evidence-navigation buttons use `data-bh-diagram="occurrence"` with
111
+ `aria-current="true"` to underline the current occurrence. This is navigation
112
+ state, not an execution-status colour; native focus/keyboard behavior stays intact.
113
+
114
+ Rectangular node/cluster/actor/note surfaces, execution cards, category tiles and
115
+ small label surfaces use `radius.100` (8 px), including SVG export. Circles,
116
+ diamonds and edge paths retain topology geometry. Consumer-owned inspector cards
117
+ and viewport controls/toolbars use `--bh-radius-100`; dialogs/drawers use
118
+ `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).
119
+
120
+ Authoring previews use `diagram.preview-height` for both split panels and
121
+ `diagram.minimum-height` for the drawing viewport; fullscreen fills the enclosing
122
+ host instead. Read-only split diagrams retain a zero minimum so they shrink with
123
+ their host. Structured evidence viewers use `diagram.evidence-height`; multiple
124
+ request-body panes use `diagram.evidence-minimum-height` to keep every part reachable.
125
+
126
+
127
+ Use a flat opaque sheet. No gradients, glass, decorative animation, animated
128
+ traversal or state transitions. Retain zoom, fit, fullscreen/escape and PNG export
129
+ controls. Interaction must not overwrite definition-owned fill, stroke, dashes or
130
+ failure markers. Controls stay outside the captured SVG host.
131
+
132
+ ## Export the rendered theme
133
+
134
+ Resolve literal token values for Mermaid configuration fields that require them.
135
+ Native worker-flow CSS uses its own `--hx-*` properties; Source supplies their
136
+ semantic paint and preserves native literal evidence-edge/arrowhead paint.
137
+ Snapshot the rendered theme and opaque canvas background on the SVG host. Export the live, fully decorated drawing at its natural bounds with
138
+ `exportPadding`, not the transformed viewport. Preserve the snapshot even if the
139
+ application theme changes before the new drawing lands. Fonts, locale line height,
140
+ state paint and outer selection geometry must survive SVG/PNG capture. A transparent
141
+ image or white sheet behind dark labels is not a valid fallback.
142
+
143
+ All package source is in `tokens/diagram.json`; consumers must not maintain a
144
+ second palette or copy generated token values. Local package references are for
145
+ local development only until an authorized release exists.
146
+
147
+ Use the actual installed model APIs: `compactWorkerFlow` supplies its public
148
+ compact graph and authored-address-to-compact-id map, and `compactFlowMermaid`
149
+ serializes that graph. `RenderNodeOverlay` accepts only `{ state?, repeat? }`;
150
+ do not pass `roles`, caller colour resolvers, stroke overrides or unsupported
151
+ renderer options. The native model owns state readings, repeat badges and
152
+ implicit `indeterminate` nodes once any drawn state is supplied.
153
+
154
+ Log mentions establish only `reached` or `unfinished`, never typed `ranOk` or
155
+ `ranFailed` evidence. The Source `mermaidEvidenceStyles` adapter accepts compact
156
+ node IDs, actual public compact edge indices and explicit `{ dark, locale }`.
157
+ Typed evidence takes precedence for named steps and their owned junctions, even when
158
+ a failed owner's junction has no explicit state. Consumers retain authored
159
+ address resolution, failure attribution, repeated occurrences and execution data;
160
+ source owns theme paint and interaction recipes. No second palette is required.
161
+
162
+ Edge emphasis uses literal Source colours, not `var(...)` or custom-property
163
+ declarations: Mermaid12's DSL rejects those functions. Do not append `!important`
164
+ inside the DSL: native coloured-marker cloning treats that suffix as part of
165
+ the SVG colour attribute. After rendering/sanitization,
166
+ `preserveMermaidDefinitionPaint(svg)` promotes the actual native edge stroke and
167
+ explicit coloured-marker attributes over the worker sheet's neutral important
168
+ paint, without changing paths, marker geometry or IDs. Unknown transitions remain
169
+ unknown; consecutive recorded global indices may prove a unique direct edge,
170
+ but two executed endpoints alone do not prove a typed traversal.
171
+
172
+ ## Shared drawing viewport and dock
173
+
174
+ Data Flow is the canonical canvas reference: `diagram.canvas` and `diagram.grid`,
175
+ with native18px grid spacing and1.2px dots in camera coordinates. These are graph
176
+ geometry, not reader-target dimensions. `.bh-diagram-viewport` supplies the Source
177
+ dot pattern; bind its `--bh-canvas-grid-x`, `--bh-canvas-grid-y` and
178
+ `--bh-canvas-grid-scale` to the existing camera. The SVG root and default stage
179
+ body (`diagram.group-fill`) are transparent on screen, not opaque pale sheets
180
+ covering the grid. Native stage boundaries/titles remain intact. Export still
181
+ uses the rendered theme's snapshotted opaque Source canvas.
182
+
183
+ Put real native controls **inside** that viewport, outside the transformed drawing
184
+ and captured SVG host. `bh-diagram-dock` on native Space plus `bh-control-group`
185
+ `data-bh-variant="dock"` supplies the lower-left floating dock and shared native
186
+ Data Flow control family. No separate external toolbar/header row and no reserved
187
+ blank band. Stop pointer/wheel/non-Escape keyboard propagation on the dock,
188
+ preserving native focus, popups and overlay Escape handling. Keep genuine action
189
+ differences; do not copy Data Flow-only actions into Mermaid.
190
+
@@ -0,0 +1,179 @@
1
+ ---
2
+ title: VueFlow theme
3
+ description: Source-backed operational graph categories, paired themes, fixed geometry and VueFlow 1 integration.
4
+ order: 5
5
+ ---
6
+
7
+ `@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy
8
+ VueFlow source, bundle Vue, generate graph data, or change relationship direction.
9
+
10
+ ## Install and apply
11
+
12
+ Install this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and
13
+ minimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph
14
+ entry before adapter CSS; load native design-token CSS once with a 16px root/14px body.
15
+ Local source packages remain private `0.0.0`; that is not a registry release.
16
+
17
+ ```vue
18
+ <script setup lang="ts">
19
+ import { computed } from 'vue'
20
+ import { VueFlow } from '@vue-flow/core'
21
+ import { Background } from '@vue-flow/background'
22
+ import { Controls } from '@vue-flow/controls'
23
+ import { MiniMap } from '@vue-flow/minimap'
24
+ import { createVueFlowTheme } from '@beehexa/vueflow-tokens'
25
+ import '@beehexa/design-tokens/css'
26
+ import '@vue-flow/core/dist/style.css'
27
+ import '@vue-flow/core/dist/theme-default.css'
28
+ import '@vue-flow/controls/dist/style.css'
29
+ import '@vue-flow/minimap/dist/style.css'
30
+ import '@beehexa/vueflow-tokens/css'
31
+
32
+ const props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()
33
+ const theme = computed(() => createVueFlowTheme(props))
34
+ // nodes and edges remain application graph data; never recreate their IDs on theme changes.
35
+ </script>
36
+
37
+ <template>
38
+ <VueFlow :class="theme.class" :style="theme.style" v-bind="theme.flowOptions">
39
+ <Background v-bind="theme.background" />
40
+ <Controls />
41
+ <MiniMap v-bind="theme.minimap" />
42
+ </VueFlow>
43
+ </template>
44
+ ```
45
+
46
+ The factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.
47
+ It resolves light plus dark overrides and Vietnamese typography alternatives from the token
48
+ package. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph
49
+ with padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual
50
+ `fitViewOnInit` option is used; do not pass invented viewport option names.
51
+
52
+ ## Operational categories are not statuses
53
+
54
+ `flow.category.*` identifies the existing product's node kinds: task blue, dependency red,
55
+ transformation green, validation deep red, push step gold, decision cyan, loop magenta and
56
+ grouped nodes purple. These categorical identities must not be interpreted as success,
57
+ failure or warning. Keep the node's type label and icon; colour is never its sole identity.
58
+ A category colour does not certify the state of an execution.
59
+
60
+ Each category supplies `foreground`, `background`, `border` and `hover` as an opaque paired
61
+ light/dark role. Use `getNodeColorPalette(category)` for CSS-backed bindings and
62
+ `getNodeColor(nodeType)` for the frame/edge identity. These source roles replace historical
63
+ application-owned palettes, alpha overlays, gradients and palette-adjustment functions.
64
+ Never append hex alpha suffixes to a CSS variable, or lighten a resolved role downstream.
65
+ For a native category Tag, bind `getFlowCategoryBadgeStyles(nodeType)` to the
66
+ public `style` prop and omit `color`. This cached immutable recipe pairs the
67
+ category foreground/background/border instead of putting native white text on a
68
+ frame/edge stroke. The canonical contrast check includes all eight small-text
69
+ category pairs in both themes at WCAG AA 4.5:1; the native family demonstrates
70
+ their actual paint. Decision foreground and border remain separate roles.
71
+
72
+
73
+ Selection uses `color.border.selected` plus the selected outline; keyboard focus separately
74
+ uses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the
75
+ danger frame plus dashed/non-colour indication and a readable error label. Selection or focus
76
+ must not overwrite category identity, hide an error, or be conveyed only through colour.
77
+ Resting handles use the neutral icon role. Focus color is reserved for actual focus,
78
+ not an always-on connector decoration.
79
+
80
+ ## Custom content and geometry
81
+
82
+ Use `getFlowNodeStyles(NodeType, state)` for custom node bodies. It binds semantic fonts,
83
+ spacing, shape, categorical pairs and source dimensions. Keep custom icons, connector logos,
84
+ labels, handles, accessibility semantics and events in the application. Meaningful loading
85
+ indicators may move; decorative node entrances, pulsing identities, rotating idle icons,
86
+ hover transforms, flowing edge dashes, gradients and glass are not part of the theme.
87
+
88
+ Custom semantic category content uses `getFlowCategoryStyles(type, part?)`;
89
+ `foreground` sets category text, `border` sets border colour and `background`
90
+ sets its paired surface. Category glyphs use `getFlowIconStyles(type, options)`,
91
+ whose default colour is category border, not text. Options accept source icon
92
+ size names or numeric API sizes, an already source-resolved colour, and disabled.
93
+ Status icon keys (`status-success|warning|error|info|loading`) and control keys
94
+ (`control-expand|collapse|help`) resolve separate operational/neutral icon roles.
95
+ `edge-dependency|edge-transformation` preserve their categorical identity.
96
+ `bh-flow-icon[data-bh-loading="true"]` supplies meaningful loading motion with
97
+ reduced-motion support. Never animate an idle category icon.
98
+
99
+ For a labelled relationship indicator use `bh-flow-category-mark` and
100
+ `data-bh-category="<FlowCategory>"`: the source owns its `space.075` circular
101
+ geometry and categorical border-colour fill. A label/count must preserve the
102
+ non-colour meaning; this mark does not communicate execution status.
103
+
104
+ `NODE_DIMENSIONS`, `GRID_SPACING` and `TASK_DATA_LAYOUT` read `tokens/flow.json`. The scoped
105
+ operational matrix is: task, task dependency, task transformation and task data **450×130**;
106
+ three groups **350×130**; validation, transformation and push step **200×130**;
107
+ decision **160×160**, loop **120×120**, profile **240×100**. Do not confuse task-transformation
108
+ cards with individual transformation steps. Rendering, layout and half-dimension centering
109
+ must use the same source. Preserve existing graph coordinates during theme adoption.
110
+
111
+ Graph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are
112
+ not palette values. Do not arbitrarily round them to the spacing scale. Category adaptation
113
+ must not mutate the graph's IDs, expansion state, saved positions or relationship semantics.
114
+
115
+ Ordinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).
116
+ Controls round exposed button corners without clipping focus. Connector logos
117
+ retain their nested `radius.075` (6 px). Decision and loop nodes keep their true
118
+ circular geometry, as do connection handles; edge-routing radius remains path
119
+ geometry. Custom inspector cards and graph controls/toolbars use `--bh-radius-100`;
120
+ dialogs/drawers use `radius.150` (12 px). Follow the [Radius role scale](/foundations/styles/radius/).
121
+
122
+ Bind the user's high-contrast setting to `data-bh-high-contrast="true"` on the actual
123
+ `bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom
124
+ `role="button"` focus outlines from `border.width.focused` (2 px) to
125
+ `border.width.accent` (4 px), preserving source focus colour/offset. Do not keep
126
+ an application-owned descendant focus recipe.
127
+
128
+ The same host accepts `data-bh-large-text="true"` and
129
+ `data-bh-increased-spacing="true"` for the user's opt-in accessibility settings:
130
+ 1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.
131
+ Keep actual user preference bindings; do not duplicate descendant CSS locally.
132
+
133
+ ## Edges, controls and export
134
+
135
+ `styleTargetEdge(edge, nodes)` preserves the directed edge's target identity on both stroke
136
+ and marker, keeps other edge data, and disables decorative traversal motion. The application
137
+ may retain dashed lines to communicate transformation or conditional semantics. The custom
138
+ edge renderer must consume the supplied stroke rather than replace it with an unrelated
139
+ edge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle size.
140
+
141
+ Custom edge paths use `getFlowEdgeStyles(category, suppliedStyle?)` for the full
142
+ SVG presentation recipe. It preserves a supplied directed target stroke over the
143
+ category fallback, uses `FLOW_EDGE.width`, no fill, non-scaling stroke and static
144
+ relation dashes (solid dependency; dashed transformation/conditional/dataFlow).
145
+ Path coordinates, marker shapes and relationship direction remain graph geometry.
146
+ Edge styles and node container styles use VueFlow's public `Styles` type, including
147
+ custom theme variables. Detail simplification accepts and returns that same native
148
+ contract; applications do not need casts or copied style objects to assign it.
149
+ `styleTargetEdge` retains an explicit open/closed arrow kind and resolves a missing
150
+ target type through `data.nodeType` before the task-category fallback.
151
+
152
+ The CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,
153
+ Controls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus
154
+ states and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;
155
+ remove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.
156
+
157
+ Export the current theme and font from the measured graph surface. Do not force a white
158
+ background or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,
159
+ resolution feedback and capture fallback handling. Check the real exported image, not just a
160
+ successful capture call.
161
+
162
+ Graph fullscreen uses an isolated local stacking context at `z-index.modal` (400), not
163
+ `z-index.fullscreen` (450), so global inspectors remain above it. Private child chrome
164
+ ordering such as z10/z15 stays inside that context; do not assign global1001/1002
165
+ to graph controls. Verify real inspector/dialog ordering, Escape and focus return.
166
+
167
+ `getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;
168
+ basic and detailed return the supplied style unchanged. It never reduces opacity:
169
+ node state, text contrast, focus and category semantics must remain readable at
170
+ every zoom level. Viewport thresholds, metadata, measured positions and scheduling
171
+ remain consumer logic; no nodes, relationships or data fields may be discarded.
172
+
173
+ ## Verification
174
+
175
+ Exercise light and dark, English and Vietnamese, selected plus focused and error nodes,
176
+ long labels, every fixed dimension, target-coloured arrows, zoom/snap/fitting, expanded groups,
177
+ cycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast
178
+ for the actual paired foreground/background and meaningful borders in each rendered theme;
179
+ source tokens and typed configuration alone are not accessibility or visual proof.
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: Bàn phím và focus
3
+ description: Nhiều người không bao giờ dùng chuột. Focus di chuyển qua màn hình thế nào, focus ring trông ra sao, và mỗi loại control dùng phím gì.
4
+ order: 1
5
+ audience: Designer, developer
6
+ updated: 2026-11-04
7
+ ---
8
+
9
+ Nhiều người không bao giờ chạm vào chuột: người dùng trình đọc màn hình, người bị run tay hay gãy cổ tay, và những người làm nhanh hơn với phím tắt. Với họ, bàn phím là toàn bộ giao diện.
10
+
11
+ ## Thứ tự focus
12
+
13
+ **Focus đi theo thứ tự người ta đọc: từ trên xuống dưới, từ đầu tới cuối mỗi dòng.**
14
+
15
+ - Trong bản thiết kế, đánh số các điểm dừng Tab, để khi dựng sẽ theo đúng thứ tự đó.
16
+ - Giữ thứ tự DOM giống thứ tự nhìn thấy. Không sửa thứ tự bằng `tabindex` dương.
17
+ - Bắt đầu mỗi trang bằng một link "Bỏ qua tới nội dung", nhảy qua header và menu bên.
18
+ - Chỉ những thứ người dùng thao tác được mới nhận focus. Dùng `tabindex="0"` cho control tự làm hoặc vùng cuộn, không bao giờ cho chữ hay tiêu đề.
19
+ - Vùng cuộn ngang, như một bảng rộng, nhận focus để người dùng cuộn bằng phím mũi tên. Đặt tên cho nó bằng `aria-label`.
20
+
21
+ ## Focus ring
22
+
23
+ **Focus của bàn phím luôn nhìn thấy: viền 2 px, cách thành phần 2 px.**
24
+
25
+ | Phần | Token | Giá trị |
26
+ | --- | --- | --- |
27
+ | Màu | `color.border.focus` | Xanh dương, tương phản ít nhất 3:1 với trang ở giao diện sáng và tối |
28
+ | Độ dày | `border.width.focused` | 2 px |
29
+ | Khoảng cách | `state.focus.offset` | 2 px |
30
+
31
+ - Hiện ring bằng `:focus-visible`, để click chuột không vẽ ring nhưng bàn phím thì luôn vẽ.
32
+ - Không bao giờ bỏ outline mà không đặt lại một ring giống vậy.
33
+ - Ring không bao giờ màu vàng: vàng thương hiệu quá nhạt trên nền trắng nên không nhìn thấy.
34
+ - Header dính, drawer hay toast không được che thành phần đang có focus. Chừa chỗ bằng `scroll-padding-top`.
35
+
36
+ ## Di chuyển focus
37
+
38
+ **Khi một thứ mở ra, focus đi vào trong nó. Khi nó đóng lại, focus quay về thứ đã mở nó.**
39
+
40
+ | Khi | Focus đi tới | Khi đóng |
41
+ | --- | --- | --- |
42
+ | Dialog mở | Ô nhập đầu tiên, hoặc tiêu đề của dialog nếu không có ô nhập | Quay về nút đã mở nó |
43
+ | Drawer hoặc menu mở | Mục đầu tiên | Quay về nút đã mở nó |
44
+ | Toast hiện ra | Giữ nguyên chỗ cũ; nội dung toast được đọc lên | Không có gì di chuyển |
45
+ | Một mục trong danh sách bị xóa | Mục kế tiếp, hoặc tiêu đề danh sách nếu đó là mục cuối | |
46
+ | Trang tải lại sau khi gửi form | Tiêu đề trang, hoặc lỗi đầu tiên | |
47
+
48
+ - Dialog giữ focus bên trong cho tới khi đóng. Phím Escape đóng dialog.
49
+ - Không bao giờ để focus rơi về đầu trang. Nếu thành phần đang có focus biến mất, chuyển focus tới thành phần gần nhất hợp lý.
50
+
51
+ ## Phím cho từng loại control
52
+
53
+ Component Beehexa theo [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/), hướng dẫn của W3C về cách mỗi loại control hoạt động với bàn phím và trình đọc màn hình. Một nhóm control, như tab hay menu, là một điểm dừng Tab; phím mũi tên di chuyển bên trong nhóm.
54
+
55
+ | Mẫu | Phím | Trang mẫu |
56
+ | --- | --- | --- |
57
+ | Nút | <kbd>Enter</kbd> hoặc <kbd>Space</kbd> kích hoạt | [Button](https://www.w3.org/WAI/ARIA/apg/patterns/button/) |
58
+ | Link | <kbd>Enter</kbd> đi theo link | [Link](https://www.w3.org/WAI/ARIA/apg/patterns/link/) |
59
+ | Checkbox, switch | <kbd>Space</kbd> bật tắt | [Checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/), [Switch](https://www.w3.org/WAI/ARIA/apg/patterns/switch/) |
60
+ | Nhóm radio | Phím mũi tên di chuyển và chọn; Tab rời khỏi nhóm | [Radio group](https://www.w3.org/WAI/ARIA/apg/patterns/radio/) |
61
+ | Tab | Trái và Phải chuyển giữa các tab; Home và End nhảy tới tab đầu và cuối | [Tabs](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/) |
62
+ | Menu | Lên và Xuống di chuyển; Enter chọn; Escape đóng | [Menu button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/) |
63
+ | Select, combobox | Lên và Xuống đi qua các lựa chọn; Enter chọn; Escape đóng danh sách, bấm lần nữa thì xóa chữ | [Combobox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) |
64
+ | Dialog | Tab đi vòng bên trong; Escape đóng | [Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/) |
65
+ | Disclosure, accordion | <kbd>Enter</kbd> hoặc <kbd>Space</kbd> mở và đóng | [Disclosure](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/), [Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/) |
66
+ | Bảng dữ liệu | Tab tới các control trong dòng; tiêu đề cột sắp xếp được là một nút | [Table](https://www.w3.org/WAI/ARIA/apg/patterns/table/) |
67
+
68
+ Tab Accessibility của mỗi component, như [Button](/vi/components/button/accessibility/), liệt kê đúng các phím và mọi điểm khác so với mẫu.
69
+
70
+ ## Phím tắt
71
+
72
+ - Mọi phím tắt đều có cách khác để làm cùng việc, như một nút hay một mục menu.
73
+ - Dùng <kbd>Ctrl</kbd> hoặc <kbd>⌘</kbd> kèm một chữ cái. Phím tắt một chữ cái phải tắt được hoặc đổi được (WCAG 2.1.4).
74
+ - Không chiếm các phím mà trình duyệt và trình đọc màn hình dùng, như <kbd>Ctrl</kbd> <kbd>F</kbd> hay phím mũi tên bên ngoài một widget.
75
+ - Hiện phím tắt trong tooltip và menu, để người dùng học được.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Tuyên bố về khả năng tiếp cận
3
+ description: Chuẩn Beehexa theo, cách kiểm tra, các lỗi đã biết và cách báo cho chúng tôi một vấn đề.
4
+ order: 3
5
+ sidebarLabel: Tuyên bố
6
+ audience: Mọi người
7
+ updated: 2026-11-04
8
+ ---
9
+
10
+ Tuyên bố này áp dụng cho beehexa.design và các component Beehexa được mô tả trên site. Lần rà soát gần nhất là ngày 4 tháng 11 năm 2026.
11
+
12
+ Beehexa muốn mọi người đều dùng được site này và các sản phẩm xây trên nó, dù khả năng của họ thế nào và dù họ làm việc bằng cách nào: với bàn phím, trình đọc màn hình, kính lúp phần mềm hay điều khiển bằng giọng nói.
13
+
14
+ ## Chuẩn
15
+
16
+ Site này và các component Beehexa được xây theo **WCAG 2.2 mức AA**, cùng các quy tắc Beehexa chặt hơn về tương phản, focus, vùng chạm và chuyển động trong trang [Khả năng tiếp cận](/vi/foundations/guidelines/accessibility/#quy-tắc-beehexa). Sản phẩm Beehexa xây trên các component này và hướng tới cùng mức đó; mỗi team sản phẩm chịu trách nhiệm cho màn hình của mình.
17
+
18
+ Mọi chỗ trên site này chưa đạt chuẩn trên được liệt kê ở [Lỗi đã biết](#lỗi-đã-biết).
19
+
20
+ WCAG 2.2 AA cũng bao trùm các yêu cầu web của những chuẩn khác mà khách hàng hay hỏi:
21
+
22
+ | Chuẩn | Áp dụng ở đâu | Liên quan thế nào |
23
+ | --- | --- | --- |
24
+ | EN 301 549 V4.1.1 | Liên minh châu Âu, gồm cả Đạo luật Tiếp cận châu Âu (European Accessibility Act) | Yêu cầu về web và phần mềm theo WCAG 2.2 AA, cộng thêm vài điều khoản như tôn trọng cài đặt của người dùng |
25
+ | [Section 508](https://www.section508.gov/) | Mua sắm của chính phủ liên bang Mỹ | Theo WCAG 2.0 AA, vốn nằm trong WCAG 2.2 AA |
26
+
27
+ Bảng này giải thích các chuẩn liên quan với nhau thế nào. Đây không phải tuyên bố đạt EN 301 549 hay Section 508; báo cáo tuân thủ mới là tuyên bố đó.
28
+
29
+ ## Cách chúng tôi kiểm tra
30
+
31
+ - **Mỗi lần build** kiểm tương phản của mọi cặp màu chữ, icon và viền ở giao diện sáng và tối. Một cặp không đạt sẽ làm build dừng lại.
32
+ - **Mỗi thay đổi** ở một trang hay một component được kiểm bằng axe, bằng bàn phím, ở mức phóng 200% và ở độ rộng 320 px trước khi đưa lên.
33
+ - **Mỗi bản phát hành lớn** được kiểm với NVDA, JAWS, VoiceOver và TalkBack, như liệt kê trong [Kiểm thử](/vi/foundations/guidelines/accessibility/testing/#trình-đọc-màn-hình-và-trình-duyệt).
34
+
35
+ ## Lỗi đã biết
36
+
37
+ | Phạm vi | Vấn đề | Trạng thái |
38
+ | --- | --- | --- |
39
+ | Trang tiếng Việt | Trang chưa có bản tiếng Việt hiện bản tiếng Anh, được đánh dấu là tiếng Anh cho trình đọc màn hình. | Đang làm |
40
+ | Báo cáo tuân thủ | Báo cáo tuân thủ (ACR) đầu tiên, theo mẫu VPAT®, sẽ bao gồm site này và Button, và sẽ được đăng trên trang này. | Đã lên kế hoạch |
41
+ | Trình đọc màn hình | Site này và Button chưa được kiểm với NVDA, JAWS, VoiceOver hay TalkBack. | Đã lên kế hoạch |
42
+
43
+ ## Góp ý
44
+
45
+ Nếu có gì trên site này hay trong một component khó dùng với bàn phím, trình đọc màn hình, khi phóng to hay theo bất kỳ cách làm việc nào của bạn, chúng tôi muốn biết. Viết tới [hello@beehexa.com](mailto:hello@beehexa.com?subject=Accessibility%20feedback). Cho biết trang hoặc component nào, bạn đã thử gì và điều gì đã xảy ra. Vấn đề đã được xác nhận sẽ được thêm vào danh sách lỗi đã biết ở trên.
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: Kiểm thử
3
+ description: Cần kiểm gì trước khi một màn hình phát hành, ai kiểm, và dùng công cụ cùng trình đọc màn hình nào.
4
+ order: 2
5
+ audience: Designer, developer
6
+ updated: 2026-11-04
7
+ ---
8
+
9
+ **Kiểm tra khả năng tiếp cận trong lúc thiết kế và xây dựng, không đợi tới cuối.** Một nhãn bị thiếu tốn một phút để sửa trong Figma, và một ngày sau khi đã phát hành.
10
+
11
+ ## Trước khi bàn giao (designer)
12
+
13
+ - **Tương phản**: chữ và icon dùng các cặp token trong [Màu sắc › Khả năng tiếp cận](/vi/foundations/styles/color/accessibility/). Tự kiểm chữ trên hình và biểu đồ.
14
+ - **Không chỉ dùng màu**: mọi trạng thái, lỗi và lựa chọn đều có chữ, icon hoặc một dấu hiệu thứ hai.
15
+ - **Thứ tự focus**: đánh số các điểm dừng Tab trên frame. Ghi rõ focus đi đâu khi dialog, drawer hay menu mở và đóng.
16
+ - **Tên gọi**: viết điều trình đọc màn hình cần đọc cho mọi nút chỉ có icon và mọi hình. Đánh dấu hình trang trí là hình trang trí.
17
+ - **Tiêu đề và landmark**: đánh dấu tiêu đề trang (một H1), tiêu đề các phần theo thứ tự, và vùng header, điều hướng và nội dung chính.
18
+ - **Trạng thái**: thiết kế đủ hover, focus, nhấn, đang chọn, vô hiệu, đang tải, trống và lỗi.
19
+ - **Kích thước**: control ít nhất 24 px; trên màn hình cảm ứng, vùng chạm ít nhất 44 px.
20
+ - **Chữ**: kiểm chuỗi tiếng Việt dài, cỡ chữ 200% và độ rộng 320 px.
21
+
22
+ ## Trước khi merge (developer)
23
+
24
+ - **Kiểm tự động**: chạy axe (tiện ích trình duyệt hoặc test runner) trên mọi màn hình mới. Không có lỗi nào ở WCAG 2.2 AA.
25
+ - **Bàn phím**: cất chuột đi. Tới và dùng được mọi control bằng Tab, Shift Tab, phím mũi tên, Enter, Space và Escape. Focus ring luôn nhìn thấy và không bao giờ bị mất.
26
+ - **Phóng to**: ở mức phóng 200% của trình duyệt và ở độ rộng 320 px, không có gì bị cắt và không có gì cuộn ngang, trừ bảng và code.
27
+ - **Giao diện và chuyển động**: kiểm giao diện sáng, tối và giảm chuyển động.
28
+ - **Trình đọc màn hình**: đi hết thao tác chính bằng một trình đọc màn hình trong danh sách dưới đây. Mọi control đọc lên tên, vai trò và trạng thái; các thay đổi như "Đã lưu" được đọc lên.
29
+ - **Ngôn ngữ**: trang có `lang` đúng; giọng đọc tiếng Việt đọc chữ tiếng Việt đúng thanh điệu.
30
+
31
+ ## Trình đọc màn hình và trình duyệt
32
+
33
+ Kiểm với ít nhất một cặp trên nền tảng mà người dùng của bạn dùng nhiều nhất. Trước một bản phát hành lớn, kiểm tất cả.
34
+
35
+ | Trình đọc màn hình | Trình duyệt | Nền tảng |
36
+ | --- | --- | --- |
37
+ | NVDA | Firefox hoặc Chrome | Windows |
38
+ | JAWS | Chrome | Windows |
39
+ | VoiceOver | Safari | macOS |
40
+ | VoiceOver | Safari | iOS |
41
+ | TalkBack | Chrome | Android |
42
+
43
+ ## Công cụ
44
+
45
+ | Công cụ | Dùng để |
46
+ | --- | --- |
47
+ | axe DevTools hoặc axe test runner | Kiểm WCAG tự động trên một trang hoặc trong test |
48
+ | Công cụ dành cho nhà phát triển của trình duyệt | Xem cây accessibility, đo tương phản, giả lập giảm chuyển động và giao diện tối |
49
+ | Accessibility Insights | Kiểm có hướng dẫn cho bàn phím và các điểm dừng Tab |
50
+ | Một công cụ đo tương phản màu | Chữ trên hình, biểu đồ và mọi thứ ngoài các cặp token |
51
+
52
+ ## Với con người
53
+
54
+ Công cụ không cho bạn biết một thao tác có dễ hay không. Hãy nhờ những người dùng trình đọc màn hình, kính lúp phần mềm hoặc bàn phím thử các thao tác chính của sản phẩm, và sửa trước những gì làm họ chậm lại.
55
+
56
+ ## Báo một vấn đề
57
+
58
+ Bạn thấy vấn đề trong một component Beehexa hay trên site này? Dùng link góp ý ở cuối trang, hoặc viết tới [hello@beehexa.com](mailto:hello@beehexa.com?subject=Accessibility%20feedback). Vấn đề đã được xác nhận sẽ nằm trong danh sách [lỗi đã biết](/vi/foundations/guidelines/accessibility/statement/#lỗi-đã-biết) cho tới khi được sửa.