@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,176 @@
1
+ ---
2
+ title: Application content
3
+ description: Native component composition, source semantic content and evidenced plugin capability boundaries.
4
+ order: 5
5
+ ---
6
+
7
+ ## Native components first
8
+
9
+ Use real AntD/framework components, native props, slots and behavior. A producer
10
+ stylesheet does not authorize a div-based replacement or a skin-only wrapper.
11
+ Use Card for cards/panels, Button for actions, Input/Textarea/Select for fields,
12
+ Tabs/Segmented for choices, List/Table for collections, Tag/Badge for labels,
13
+ Progress/Steps for progress, Divider for standalone separators, and native
14
+ feedback, Avatar/Image and Typography capabilities where available.
15
+
16
+ Business components retain actual data, state, behavior and meaningful native
17
+ composition. Inventory every replacement and migrate every caller/import/export.
18
+ For a retained custom capability, record native candidates, the concrete missing
19
+ capability and producer decision. Link/status/hover appearance alone is not a gap.
20
+ Do not relocate a product stylesheet upstream. See the complete
21
+ [native adapter contracts](/tools/ant-design-vue-theme/).
22
+
23
+ ## Identity is not status
24
+
25
+ A provider, person or connection identifies an entity. Keep its readable name,
26
+ actual brand asset and aspect ratio; use neutral native Tag/Avatar/Image anatomy.
27
+ Do not hash names into a palette or recolor identities as success/warning/danger.
28
+ Operational status, selection and keyboard focus are independent meanings.
29
+
30
+ | Content part | Source role (nominal16px root) |
31
+ |---|---|
32
+ | Connector/partner brand image height; intrinsic width | `content.partner-logo.image-size`28px |
33
+ | Person or permission-member avatar | `content.avatar.size`40px |
34
+ | System/provider frame / contained glyph | `content.identity-mark.size`44px / `image-size`24px |
35
+ | Empty-state illustration container | `content.empty-illustration.size`96px |
36
+
37
+ Use real native Image for connector/partner brands: `:preview="false"`,
38
+ `:height="tokenPixels('content.partner-logo.image-size', locale, root)"`,
39
+ `width="auto"` and `class="bh-partner-logo-image"`. **Same rendered height,
40
+ intrinsic width**: no square Avatar, equal width binding, maximum-width cap,
41
+ crop, per-logo offset or invisible square frame. Keep the actual asset and alt
42
+ text; retain a meaningful native text/icon fallback when no image is available.
43
+ The same class on an authored brand SVG uses that height and its own viewBox ratio.
44
+ Normal icon assets use their semantic icon-height role and intrinsic width too;
45
+ this never changes Button hit targets or graph node anatomy.
46
+
47
+ Actual person/permission identity Avatars keep their native size/shape behavior.
48
+ `tokenPixels(name, locale, root)` scales rem dimensions at numeric boundaries;
49
+ the AntD root observer supplies the reader's root and is reused by child setup
50
+ calls. Never duplicate numeric conversion locally. Normal icon roles remain
51
+ 16/20/24/32px. `content.partner-logo.size` is only a non-image placeholder extent,
52
+ not permission to put a brand in a square tile.
53
+
54
+ `bh-partner-logo-image` and `bh-content-icon-image` close native Image's
55
+ width:100% fit gap without cropping the asset; native height props own geometry.
56
+ `bh-status-mark` is optional paired
57
+ operational icon/background paint on a real Avatar, with
58
+ `data-bh-tone="success|warning|danger|info|neutral"`. It does not resize the Avatar
59
+ or turn identity into status. Use native shape and size props.
60
+
61
+ ## Page search
62
+
63
+ Compose the actual native affixed Input with a search prefix and `allow-clear`;
64
+ keep native control sizing and the input's single-row affix layout. A page action
65
+ layout class must **never** be put on that native root: wrapping the prefix,
66
+ input and suffix into separate rows breaks the component. Put the search on a
67
+ full-width row below the heading; if a create action exists, a real native Flex
68
+ holds the shrinking search (`flex: 1 1 0; min-width: 0`) and nonshrinking Button
69
+ beside it with `space.100` gap. Heading-to-search spacing is `space.200`.
70
+ Preserve native clear/Enter/Escape/query behavior and any genuine sticky owner.
71
+ A shortcut can remain keyboard-operable and exposed through `aria-keyshortcuts`
72
+ without displaying a stray keycap in the field.
73
+
74
+
75
+ ## Semantic content and genuine composition
76
+
77
+ Authored headings, paragraphs, code, lists and descriptions remain semantic HTML;
78
+ they are not reusable UI primitive replacements. Source `data-bh-font`,
79
+ `data-bh-text` and `data-bh-icon-size` roles own their presentation. Framework
80
+ RouterLink remains a real navigation link; `bh-content-link` supplies its source
81
+ link/focus paint. Prefer native TypographyLink for ordinary UI links. Preserve
82
+ href, modified-click, new-tab behavior and appropriate heading hierarchy.
83
+
84
+ The remaining source opt-ins have bounded purposes:
85
+
86
+ - `bh-control-group` extends a real native Space for a composed inspection toolbar
87
+ where AntD4 has no Toolbar: source4px inset/8px outer corners;
88
+ `data-bh-padding="8"` uses8px inset/12px outer corners. Native Buttons remain
89
+ real and independently focusable. This is not a replacement control group.
90
+ `data-bh-variant="dock"` is the compact inspection family shared with native
91
+ Data Flow: opaque surface, common frame/elevation, text Buttons, native Dividers,
92
+ `space.025` inter-control gaps, label-small typography, proportional Source
93
+ glyphs and responsive native touch targets. Native loading blocks input;
94
+ hover/open/pressed/focus/disabled retain distinct Source paint. On graphs add
95
+ `bh-diagram-dock` inside the viewport and keep one horizontally scrollable
96
+ control row; ordinary text-editor headers stay separate.
97
+ - `bh-ant-card-action-row` extends a real native header-only Card: leading title
98
+ and metadata share one flexible inline row; wrap only when they cannot fit.
99
+ The native `extra` slot keeps the independent trailing action boundary.
100
+ Stretch the Card/head in the actual grid or native column so native centered
101
+ actions align within each row even when names wrap or a Card has no logos.
102
+ Source adds `space.200` block inset: AntD4's ordinary one-line head has only a
103
+ minimum height, not block padding. The real RouterLink uses `space.100` gap,
104
+ `bh-card-link__title` on the flexible name and `bh-card-link__metadata` on its
105
+ optional native metadata Flex. Do not force title and logos into grid rows,
106
+ fix Card heights, hide metadata, insert fillers or add per-card offsets.
107
+ Put a real RouterLink with `bh-card-link` in `title`; optional noninteractive
108
+ metadata stays inside that link. Source extends its click/focus area across
109
+ the Card; native Buttons/dropdowns remain independent siblings in `extra`,
110
+ never nested in the link. Use native `bodyStyle` when the Card has no body.
111
+ Leading EntityName content may opt into native wrapping so long names and tags
112
+ remain visible without pushing the independent action slot.
113
+ - `bh-content-divider` adds an edge to meaningful native/document/plugin anatomy
114
+ whose API has no edge prop. Block-start is default; `data-bh-axis="vertical"`
115
+ selects inline-start; `data-bh-edge="end"` selects the opposite edge. Physical
116
+ `top|bottom` support document boundaries. Use actual Divider, not an empty div,
117
+ for a standalone separator. No spacing is imposed.
118
+ - `bh-content-inset` is canonical composed-document grouping16px, or8px with
119
+ `data-bh-density="compact"`, only after native anatomy has been checked.
120
+ It is not permission to replace Card body/Form/Drawer padding with a custom frame.
121
+ - `bh-content-sheet` is flat opaque reading/plugin fullscreen content, not a Card
122
+ or generic dialog replacement. `data-bh-surface="page|subtle"` selects the source
123
+ pair. It does not position an overlay, trap focus or replace overlay ownership.
124
+ - `bh-focus-target` supplies only a focus outline for genuine plotted marks.
125
+ Graph coordinates, hit testing, clustering and keyboard interaction stay domain
126
+ behavior; native Timeline is an event list, not a timestamp plotting canvas.
127
+
128
+ Native Card hover is explicitly `hoverable`. Native selection opt-ins add their
129
+ own fill/inset cue; operational accents survive it and focus stays an outside
130
+ outline. Omit an optional variant to recover the configured native base. Disabled
131
+ activation is native/business behavior, never a CSS substitute. Charts and severity
132
+ follow [data-visualization roles](/foundations/styles/data-visualization/).
133
+
134
+ ## Measured resize and gesture capabilities
135
+
136
+ Use `ResizablePanel` from `@beehexa/vue-components` for resizable two-pane
137
+ composition. It is a Beehexa Vue component, independent of Ant Design, not a
138
+ consumer-owned splitter or an AntD custom control. Its package stylesheet owns
139
+ the centered divider/visible handle, pointer/touch/keyboard behavior, constraints
140
+ and resize lifecycle. Consumers supply bounded hosts, localized separator labels,
141
+ slots and child viewport updates; do not retain duplicate splitter CSS or handlers.
142
+ See the complete ResizablePanel component rules and public package API.
143
+
144
+ Interactive editor/canvas children follow the shared
145
+ [allocated renderer viewport contract](/tools/editors/#allocated-interactive-renderer-viewports).
146
+ They fill remaining parent space; the source readable minimum is not a fixed
147
+ preview cap or a minimum imposed on the outer mobile pane. Keep intrinsic
148
+ metadata/chrome outside the viewport and preserve the renderer/model on resize.
149
+ For an existing renderer root with its own header, `bh-renderer-frame` owns one
150
+ access scroller around that intrinsic header and its sibling readable viewport;
151
+ the minimum applies to the SDK surface, never the header or outer mobile pane.
152
+
153
+
154
+ Sortable public hooks may use
155
+ `bh-drag-ghost`, `bh-drag-clone` and optional `bh-drag-chosen`; they change paint,
156
+ not item geometry, order or lifecycle. `bh-drag-surface` is only for an existing
157
+ owned direct-manipulation gesture, never scroll-only content.
158
+
159
+ `bh-height-transition` owns measured-height motion and reduced-motion behavior.
160
+ Its explicit `--bh-height-transition-duration` parameter preserves an existing
161
+ public duration prop; measurement/release timers must use that same duration.
162
+ `bh-content-reveal` is readiness opacity, with `data-bh-ready="true"`; it changes
163
+ neither layout nor focus/disabled semantics and is not hover disclosure.
164
+
165
+ ## Native hover-revealed actions
166
+
167
+ Set `data-bh-hover-scope` on an owned sanitized enhancement group and
168
+ `data-bh-reveal="hover"` on its actual native Buttons. On fine hover pointers,
169
+ rest opacity/pointer targeting is suppressed; group hover/focus-within or the
170
+ Button's own visible focus reveals it. The Button remains keyboard reachable.
171
+ Coarse/no-hover pointers always see the native action. Loading Buttons remain
172
+ visible with native loading opacity. Native source motion handles opacity;
173
+ reduced-motion disables the transition. Never use display/visibility/tabindex to
174
+ remove these actions. Generated-content attributes are added after sanitization,
175
+ not trusted from authored HTML. A native HTML `summary[data-bh-target="touch"]`
176
+ uses the44px source target without replacing its browser disclosure semantics.
@@ -0,0 +1,271 @@
1
+ ---
2
+ title: Editors and resize controls
3
+ description: Source-backed editor adapters, embedded rich content, diff pairs, numeric font boundaries and accessible resize handles.
4
+ order: 6
5
+ ---
6
+
7
+ ## Editor canvas and syntax
8
+
9
+ Editors use `editor.background` and `editor.text`, a theme-aware reading canvas. This is deliberately different from static fenced code blocks (`color.code.background` / `color.code.text`), whose dark canvas has its own paired text. Never combine the editor syntax foregrounds with that static code-block canvas.
10
+
11
+ Use `editor.syntax.comment`, `.string`, `.number`, `.keyword`, `.type` and `.delimiter` for language tokens. These aliases reuse readable semantic foregrounds on the editor surface in both themes. Syntax coloring names language constructs, not operational status: a green string is not a successful operation. Keep language punctuation and text available without color. Editor gutter, line numbers, selection, line highlight and cursor have their own `editor.*` roles. Selection must retain a caret, native selection range or another non-color cue.
12
+
13
+ ## Diff inspection
14
+
15
+ Inserted lines use `editor.diff.inserted.background` with the inserted `text` annotation; removed lines use the removed pair. Keep native + / − gutter markers and accessible diff navigation. Do not add transparency to these pairs or interpret a changed value as an application failure. Ordinary code within either line keeps the theme-aware syntax foregrounds.
16
+
17
+ ## Numeric framework APIs
18
+
19
+ Monaco and similar frameworks require resolved values, not CSS `var()` strings. Use the public `tokenPixels(name, locale)` export from `@beehexa/design-tokens` at numeric framework boundaries. It resolves Vietnamese dimension alternatives and converts `rem` to nominal pixels using the source 16 px reference. This conversion is independent of the CSS entrypoint: normal `/css` remains scalable with the reader's root setting, and neither the helper nor the editor adapter changes that setting. Do not copy a downstream token table. `editor.font.family`, `.size`, `.lineHeight` and `.weight` carry the complete `font.code.default` recipe (14/20, Vietnamese 14/24). Configure all four, not just font size. Preserve legitimate editor settings such as read-only, wrapping, language workers, cancellation and diff layout.
20
+
21
+ ## Public editor companion
22
+
23
+ The existing `@beehexa/ant-design-vue-tokens` package includes the `./editor`
24
+ companion subpath for embedded content and editors; it is not a sixth package.
25
+ Import the package's `styles.css` once alongside token CSS.
26
+
27
+ ```ts
28
+ import {
29
+ beehexaEditorOptions,
30
+ registerBeehexaMonacoThemes,
31
+ } from '@beehexa/ant-design-vue-tokens/editor'
32
+
33
+ // Use the runtime returned by the application's existing lazy editor loader.
34
+ registerBeehexaMonacoThemes(monaco)
35
+ const options = {
36
+ ...beehexaEditorOptions(locale),
37
+ theme: dark ? 'beehexa-dark' : 'beehexa-light',
38
+ readOnly: true,
39
+ }
40
+ ```
41
+
42
+ `beehexaEditorOptions(locale = 'en')` returns the complete code font recipe;
43
+ Vietnamese locale tags such as `vi` and `vi-VN` select its taller line height.
44
+ Apply the returned options again when locale changes. The four font fields form
45
+ the exported `BeehexaEditorOptions` structural subset of Monaco's official
46
+ construction options, not a replacement for its full option type.
47
+
48
+ `registerBeehexaMonacoThemes(runtime)` defines exactly `beehexa-light` and
49
+ `beehexa-dark`, including syntax, gutter, selection, diff, input, completion,
50
+ hover, menu and other native widget color pairs. A WeakSet registers each runtime
51
+ only once. Select the appropriate registered theme when application mode changes;
52
+ registration does not select a theme, create an editor or load Monaco.
53
+ `BeehexaMonacoRuntime`, `BeehexaMonacoThemeData` and `BeehexaMonacoTokenRule`
54
+ describe the official structural API boundary without importing a Monaco runtime,
55
+ adding a dependency or requiring a consumer ambient shim. The host retains Monaco
56
+ workers, language registration, cancellation, disposal and lazy loading.
57
+
58
+ Use `data-bh-editor-severity="error"` or `"warning"` on a viewer ancestor for
59
+ operational canvas severity. Keep a visible error/warning label or icon; these
60
+ backgrounds are not a language syntax palette or a replacement for diagnostics.
61
+ The companion CSS owns the native Monaco canvas/margin bridge. It also raises
62
+ detached hover, completion and parameter-hint widgets to `z-index.tooltip`.
63
+ Its sole layering `!important` is necessary to override Monaco's inline widget
64
+ z-index above an isolated fullscreen editor; it does not override widget paint.
65
+
66
+ ## Embedded rich content
67
+
68
+ Use `.bh-markdown` on sanitized semantic HTML inside a product page. Running prose
69
+ uses `body.large`; the embedded outline uses `heading.large` for `h1`,
70
+ `heading.medium` for `h2`, `heading.small` for `h3`, and `heading.xsmall` for
71
+ deeper headings. This is subordinate product content, not the standalone
72
+ documentation-page scale. Keep heading levels meaningful and in order.
73
+ Paragraph/list spacing, baseline-aligned table cells, table header `label.small`,
74
+ semibold emphasis, quote border, separators and code presentation belong to this
75
+ source recipe rather than a local renderer skin. Links use the semantic link/hover
76
+ pair and the standard visible keyboard focus ring.
77
+
78
+ `data-bh-density="compact"` on `.bh-markdown` is the editing-preview variant:
79
+ paragraph spacing is `space.100` rather than `space.200`; framed code uses
80
+ `space.150` padding on `surface.subtle`. It intentionally retains the host's
81
+ native heading/list/table metrics, so existing compact editor layouts are not
82
+ expanded by the reading-view recipe. Inline static code uses the complete
83
+ `color.code.background` / `color.code.text` pair. Ordinary reading-view inline
84
+ code uses the neutral `surface.subtle` / `text` pair at surrounding text size.
85
+
86
+ Unhighlighted fenced blocks use the static code pair. Highlight.js `.hljs` uses
87
+ the editor canvas/text and `editor.syntax.*` palette, including nested highlighted
88
+ blocks in rich content. Do not apply a bundled highlight theme or combine those
89
+ syntax foregrounds with the separate static-code canvas. Highlighted block
90
+ containers use the same editor canvas so their padded frame remains paired too.
91
+ Syntax names language constructs; operational severity, priority, status and data
92
+ visualization meanings remain separate and retain textual cues.
93
+
94
+ Image inspection uses `.bh-content-image` for `radius.100`; set
95
+ `data-bh-zoomable="true"` only when an actual click handler opens inspection,
96
+ which supplies the source zoom-in cursor. `.bh-content-image--fullscreen`
97
+ adds the overlay shadow and a default image cursor. `.bh-content-fullscreen`
98
+ provides the single scrim layer and zoom-out cursor for its click-to-close gesture.
99
+ Keep the image's propagation stop so clicking the image does not close inspection.
100
+ Image/copy/fullscreen buttons use
101
+ `.bh-content-action` from the package's interaction companion and
102
+ `data-bh-copied="true"` for a successful-copy icon cue. Keep an accessible copied
103
+ announcement or label; color alone is insufficient. `.bh-content-error` provides
104
+ the semantic danger text/surface/frame for an explicit content-render failure.
105
+
106
+ `.bh-content-skeleton` from the interaction companion supplies the neutral
107
+ `color.skeleton` fill and `radius.100` for custom loading placeholders. The host
108
+ retains the represented content's geometry and loading announcement; a placeholder
109
+ is not an interactive control and must not communicate a status outcome through color.
110
+
111
+ ## Allocated interactive renderer viewports
112
+
113
+ Interactive Monaco editors/diffs and workflow/Mermaid viewers fill the width and
114
+ remaining block allocation supplied by their parent. Their toolbar/header stays
115
+ intrinsic outside the viewport. Page, Card body, Tab pane, Drawer/modal and splitter
116
+ ancestors must each have a real allocation and allow shrinkage with `min-width: 0`
117
+ and `min-height: 0`; a percentage inside an auto-height chain is not an allocation.
118
+ Use native fill APIs and `bh-ant-fill-card`/Spin `wrapperClassName` before adding
119
+ structural hosts. Do not subtract guessed header pixels from a viewport unit.
120
+
121
+ `@beehexa/vue-components/css` exposes opt-ins for **existing** renderer hosts:
122
+ `bh-renderer-viewport` is the shrinkable fill/overflow shell;
123
+ `bh-renderer-viewport__surface` is its actual interactive surface. The latter
124
+ retains `layout.renderer.minimum-inline-size` and `minimum-block-size` only when
125
+ the available allocation is smaller (350px each at the nominal16px root, scaling
126
+ with the reader). Larger allocations are filled, never capped at the minimum.
127
+ The outer pane remains parent-sized, including narrow mobile panes. Keep one
128
+ explicit outer overflow owner for access below the minimum; native editor text
129
+ scrollbars are still owned by Monaco. If an enclosing content scroller already
130
+ provides the relevant access, do not add a competing scrolling wrapper.
131
+
132
+ When a renderer owns intrinsic header/notice chrome, its existing root can use
133
+ `bh-renderer-frame`. Keep the header a sibling **outside** the actual
134
+ `bh-renderer-viewport`; keep the SDK host as that viewport's
135
+ `bh-renderer-viewport__surface`. The frame owns the sole access scrollbar:
136
+ its nested viewport grows from the readable surface rather than shrinking to
137
+ zero when the header exceeds the allocation. A title followed directly by an
138
+ SDK surface is also supported. Size-only containment on those surfaces prevents
139
+ retained SDK canvas dimensions from determining a later allocation; it does not
140
+ clip paint, popups or focus, replace models, or observe/re-layout the editor.
141
+ The source minimum excludes chrome. At adequate size the viewport fills the
142
+ remainder; below minimum the parent-sized frame scrolls across chrome and SDK.
143
+ Do not add a second overflow owner to that nested viewport.
144
+
145
+ This intrinsic-header rule is for text editors, notices and genuine document
146
+ chrome. Graph navigation controls are different: Workflow/Mermaid/authoring
147
+ graphs use the Data Flow floating dock **inside** the drawing viewport,
148
+ default lower-left, never an external toolbar band. Follow the
149
+ [shared canvas and dock contract](/tools/mermaid/#shared-drawing-viewport-and-dock).
150
+
151
+ `bh-renderer-frame--document` on that same existing frame delegates access to an
152
+ already scrolling native Card/document. Its automatic block size and
153
+ nonshrinking renderer remove a competing frame scrollbar, including when a
154
+ shared editor normally declares `height: 100%`. Use the existing
155
+ `bh-ant-fill-tabs--document` role for intervening native Tabs; pass an editor's
156
+ public `height="auto"` where it explicitly controls its own block size.
157
+ Keep document wrappers and intrinsic descriptions nonshrinking and
158
+ overflow-visible. Do not mark a second wrapper as an SDK surface or leave a
159
+ nested zero-height text scroller beside it. Native fullscreen and explicit
160
+ `data-bh-overlay-owner` frames retain their bounded fullscreen allocation.
161
+ Use the default frame for a bounded standalone widget.
162
+ `bh-renderer-access` reserves only native toolbar/interaction rows in an
163
+ outer allocation when intrinsic page chrome would otherwise reduce it to zero;
164
+ its size follows existing control/coarse-pointer roles, not the readable SDK
165
+ minimum. Static placeholders receive neither SDK minimum nor forced scrollbars.
166
+
167
+
168
+ Apply the minimum to interactive renderers, not ordinary read-only fields,
169
+ labels, static Markdown code or an empty selection/loading/error placeholder.
170
+ Unbounded inline authoring previews use this same readable minimum as their
171
+ intrinsic budget, not a second fixed preview height. Metadata above an editor
172
+ remains intrinsic and accessible; let its editor section grow into any remainder.
173
+
174
+ Reuse renderer lifecycle APIs: Monaco `automaticLayout`/retained `layout()`, native
175
+ workflow viewport measurement and the retained Mermaid host's resize path.
176
+ Re-measure after hidden tabs, Drawer activation, collapse, splitter, root-scale or
177
+ fullscreen changes without replacing models, caret/undo state or graph instances.
178
+ Container resizing is **not** a request to run `fitView` again or reset manual
179
+ zoom/pan; initial and explicitly requested fit are separate actions.
180
+
181
+ Retained controls that move between native overlay owners must bind native
182
+ hover-only Tooltip triggers to the primary device's `(hover: hover)` capability.
183
+ Keep the Button's accessible name and native mouse hover; touch compatibility
184
+ mouse events must not leave an old owner’s hint intercepting the next control.
185
+ Do not hide tooltip paint or change pointer events to mask that lifecycle defect.
186
+
187
+ The renderer still owns sanitization, HTML structure, container layout and scroll
188
+ containment, image fitting and action positioning, zoom/pan, delegated events,
189
+ copying, fullscreen focus containment, Escape, focus return and scroll locking.
190
+ Use the interaction companion's action-size/icon-only/touch opt-ins for control
191
+ geometry rather than a local button sizing/padding recipe.
192
+ Do not transfer those behaviors into a stylesheet or remove them when adopting
193
+ the source classes. See [Typography usage](/foundations/styles/typography/usage/),
194
+ [Interaction states](/foundations/styles/interaction-states/) and
195
+ [Data visualization](/foundations/styles/data-visualization/) for the underlying
196
+ reading, control-state and semantic-data rules.
197
+
198
+ ## Semantic slots without local presentation CSS
199
+
200
+ Use existing source-configured native Typography, Tag, Avatar and other components
201
+ first. If replacing custom semantic HTML would change its structure, refs,
202
+ keyboard handling or layout, the same companion stylesheet exposes these minimal
203
+ source-role attributes. They do not impose display, positioning, margins,
204
+ truncation, wrapping, flex/grid or responsive layout.
205
+
206
+ | Attribute | Existing source roles |
207
+ |---|---|
208
+ | `data-bh-font` | `body-small`, `body-default`, `body-large`, `label-small`, `label-default`, `heading-xsmall`, `heading-small`, `heading-medium`, `heading-large`, `heading-xlarge`, `code-default` |
209
+ | `data-bh-text` | `neutral`, `subtle`, `subtlest`, `success`, `warning`, `danger`, `info`, `inverse`, `disabled`, `on-bold`, `on-brand` |
210
+ | `data-bh-numeric="tabular"` | Tabular figures for table numbers, changing counters and KPI values |
211
+ | `data-bh-icon-size` | `small` = `size.icon.default` (16 px); `default` = `size.icon.medium` (20 px); `large` = `size.icon.large` (24 px); `xlarge` = `size.icon.empty` (32 px, empty-state icons only) |
212
+ | `data-bh-diff` | `removed` and `inserted` use the corresponding `editor.diff.*.text` annotation roles, not operational failure/success |
213
+
214
+ `data-bh-font` applies the complete font shorthand, including locale-aware line
215
+ height; never follow it with a consumer weight, size or line-height override.
216
+ Native technical textareas/inputs may select `code-default` through this boundary
217
+ without introducing a dashboard input-font rule. Use semantic `em`/`i` for genuine
218
+ terms or titles requiring italics, sparingly, not a new local font-style recipe.
219
+ The font roles do not change the semantic heading level of their HTML element.
220
+
221
+ Text colors map to `color.text.*`; `neutral` means `color.text` itself.
222
+ On a `data-bh-icon-size` glyph the same semantic choices select the existing
223
+ `color.icon.*` counterparts. Both subtle text levels use `color.icon.subtle`
224
+ because the source does not define a separate tertiary icon role. `on-brand`
225
+ retains its explicit readable brand foreground. Do not resize a control's native
226
+ glyph with these content opt-ins. Icon dimensions are not interactive target sizes.
227
+ Status meanings still require explicit text, labels or recognizable glyphs.
228
+
229
+ `.bh-content-code` is a static-code content recipe: `code.default`, the complete
230
+ static code foreground/background pair, `radius.050` and `space.050` padding.
231
+ Add `--inline` for mono at the surrounding font size with horizontal-only padding,
232
+ `--field` for a readable technical value with `space.050` / `space.100` padding,
233
+ or `--block` for a code output region with `space.100` padding. Add
234
+ `data-bh-code-tone="neutral"` for the alternative `surface.subtle` / `text` pair.
235
+ These are reading/technical-value roles, not a configurable arbitrary box API.
236
+ The host keeps display, overflow and wrapping. Do not put editor syntax colors
237
+ on this static canvas; highlighted content uses the editor recipe above.
238
+
239
+ `.bh-content-table` is for static instructional/comparison tables whose actual
240
+ HTML table, scoped row headers and footer semantics must remain intact. It uses
241
+ `body.default` and `text`, a `border` cell frame and `space.150` cell padding.
242
+ Header cells and footer totals use `label.small` on `surface.subtle`. Keep width,
243
+ collapse, margins, alignment, no-wrap choices and responsive overflow structural;
244
+ do not reintroduce local table paint. Reuse native source-configured Table for
245
+ sorting, filtering, pagination or row-selection interactions.
246
+
247
+ `.bh-content-highlight` pairs `background.brand.bold` with `text.on-brand`,
248
+ zero padding and `radius.00` for an in-place search match. The matched text stays
249
+ real text and search navigation retains its accessible current-match indication.
250
+ `.bh-app` on `body` opts into `body.default`, `text` and `surface.page` without
251
+ setting root font size, margins or page geometry.
252
+
253
+ `data-bh-editor-severity` also owns the viewer's source-accent leading border,
254
+ using the matching danger/warning border role. Consumers keep its data meaning
255
+ and explicit label, not a local semantic presentation rule. All semantic content
256
+ presentation remains source-owned: token binding is not an exception permitting
257
+ dashboard colors, font declarations, borders, control geometry or state recipes.
258
+
259
+
260
+
261
+ ## Resize controls
262
+
263
+ Use `ResizablePanel` from `@beehexa/vue-components` for actual split panes; it is independent of Ant Design Vue. Import its typed CSS entry, bind `v-model:ratio`, supply `first`/`second` slots and a localized `separatorLabel`, and let the consumer's existing breakpoint select horizontal left/right or vertical top/bottom. Keep the same editor/model/canvas instances when direction, visibility, theme, locale or fullscreen changes. Listen to its after-layout `resize` dimensions to update retained renderer hosts, not to reset model/zoom or remount them.
264
+
265
+ `resize.divider` is the visible line, not its interaction area. The source component centers that line at 90% cross-axis length by default, with a clear midpoint handle inside the physical gutter and above independently clipped pane content. Resting panes/root do not create stacking contexts that trap nested overlays. Reactive `resizerSize` changes only the visible line's CSS length, not its full-cross-axis hit region. The handle uses `resize.handle.width`, `.height`, `.radius`, `.background`, `resize.color` and `resize.grip`. Hover, focus and drag use `resize.active` on the divider; the handle uses `resize.handle.activeBackground` with `resize.activeGrip`. Targets use `resize.target` / `resize.touchTarget`; focus uses source border roles. No arbitrary AntD/global-body selector is needed.
266
+
267
+ The component owns pointer capture/cancellation, local editor/iframe drag shielding, selection prevention, keyboard arrows/Shift/Home/End and Enter/double-click reset to the initial ratio within live bounds. It preserves named separator orientation/value/min/max/controls semantics, hidden-pane state, and cleanup. Read the complete active [Resizable panel API](/components/resizable-panel/code/), [usage](/components/resizable-panel/usage/) and [accessibility](/components/resizable-panel/accessibility/) rules before composing a consumer.
268
+
269
+ ## Fullscreen and popup ordering
270
+
271
+ Fullscreen editors, code viewers and image inspection use `z-index.fullscreen` (450) with isolation. Monaco completion, hover and parameter-hint widgets use `z-index.tooltip` (600); ordinary in-page popups keep framework layers inside their owner via the adapter's contextual container. Mark custom fullscreen hosts with `data-bh-overlay-owner`. Native confirmations resolve invocation-time ordering through `getAntDesignVueModalZIndex`, and nested drawers use `getAntDesignVueOverlayZIndex` with their live owner layer. Blocking global loading uses `z-index.loading` (650), below always-visible toast feedback (700). See [Z-index](/foundations/styles/z-index/) for the complete ordering. Avoid a new local z-index scale or a glass effect; custom fullscreen surfaces use semantic surfaces and image inspection uses one `color.surface.scrim` layer. Layering does not replace focus containment, Escape handling, focus return, scroll locking or reachable controls.
@@ -12,4 +12,4 @@ order: 2
12
12
  | --- | --- |
13
13
  | `beehexa/no-inline-style-values` | Raw colors and sizes in `style` bindings. |
14
14
  | `beehexa/no-deprecated-components` | Components in the Deprecated release phase. |
15
- | `beehexa/icon-button-label` | Icon-only `a-button` without `aria-label`. |
15
+ | `beehexa/icon-button-label` | Icon-only button without `aria-label`. |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Tools
3
- description: Lint rules, the Ant Design Vue theme and docs for AI agents that keep products on the system.
3
+ description: Lint rules and docs for AI agents that keep products on the system.
4
4
  order: 0
5
5
  ---
6
6
 
7
- These tools stop products drifting away from the design system: lint rules catch raw values, the theme makes Ant Design Vue use our tokens, and AI agents get docs they can read.
7
+ These tools stop products drifting away from the design system: lint rules catch raw values, and AI agents get docs they can read.