@beehexa/design-rules 2611.8.1 → 2611.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +10 -10
- package/dist/docs/src/components/NativeFlowDemo.astro +26 -8
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +3 -0
- package/dist/docs/src/content/tools/mermaid.mdx +5 -2
- package/dist/docs/src/content/tools/vueflow.mdx +27 -0
- package/dist/docs/src/content-vi/tools/ant-design-vue-theme.mdx +4 -1
- package/dist/docs/src/content-vi/tools/vueflow.mdx +24 -0
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/dist/catalog.json
CHANGED
|
@@ -2118,8 +2118,8 @@
|
|
|
2118
2118
|
"status": "active",
|
|
2119
2119
|
"releasePhase": null,
|
|
2120
2120
|
"planned": [],
|
|
2121
|
-
"body": "import NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` owns the reusable Ant Design Vue 4 adapter.\nUse its typed ESM API and companion CSS, backed by `@beehexa/design-tokens`.\nFrameworks are peers: `ant-design-vue@^4.2.6` and `vue@^3.3.0`; neither is bundled.\nUnreleased `0.0.0` packages use explicit local development references; only the authorized\nrelease runner stamps real package versions. Do not copy a theme palette into an application.\n\n**Beehexa tokens are the source of truth. Ant Design Vue only reads them.**\n\nThis page is the only place where the Beehexa foundations meet Ant Design Vue. The foundation pages stay the same whatever the product is built with.\n\n## Usage\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})`\nreturns the native `ThemeConfig`. Recompute on theme/language/root-font changes;\neach call returns a fresh object. `locale` selects source typography, not messages.\nThe setup-only source observer measures one inert1rem probe and cleans it up.\nThis keeps numeric native size/type/radius APIs aligned with scalable CSS units;\npixel-based borders and breakpoints do not scale. The pure factory reads no DOM.\nPass the appropriate AntD language pack through `ConfigProvider.locale`, and configure the\ndate library separately. Render native `useMessage`, `useNotification` and `useModal`\nholders in a feedback host inside the sole root provider. Bind application notify facades\nto those hook APIs; never use detached raw static feedback APIs. The factory sets\n`hashed: false` because AntD4 contextual message/notification holders otherwise retain\nstale hashes across theme/locale changes. Keep an existing notice open while switching\ndark/Vietnamese to light/English; its typography and paint must follow the active theme.\n\nKeep document `data-theme` and `lang` synchronized for teleported overlays. Import\ncompanion CSS after application/framework styles. Use a native 16px root and 14px body;\nnumeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.\n\n## Overlay ownership and bounded native content\n\nTriggered popups use `getAntDesignVuePopupContainer` to stay inside their nearest native\nModal/Drawer or custom `data-bh-overlay-owner` host. Native Modal/Drawer roots remain\nbody-hosted for viewport geometry. Provider-bound modal facades default their invocation\n`zIndex` through `getAntDesignVueModalZIndex()` while preserving explicit caller values;\nthis keeps keyboard/awaited confirmations above their live owner. Nested drawers use\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` as `rootStyle.zIndex` so\nsurface and mask move together; AntD4's `zIndex` prop styles only the content wrapper.\nBody-teleported fullscreen editors/images and fullscreen native Modals capture\n`getAntDesignVueFullscreenZIndex()` before mounting their root. This uses\n`z-index.modal` with above-owner ordering, not a separate fullscreen tier.\nMark custom roots only once they are active, avoiding self-counting. The seven\napproved tiers have no fullscreen450 or readiness650 token; blocking loading\nalso uses `z-index.modal`. Keep owner-relative ordering below\n`z-index.tooltip` and `z-index.toast`; reserve `z-index.spotlight` for tours.\nTour's inline native default also requires its public\n`zIndex` prop bound to `z-index.spotlight`.\n\nModal frames and Drawer content wrappers intentionally inherit `pointer-events: none`;\nnative content restores pointer entry only for its own subtree. The companion CSS also\nrestores `pointer-events: auto` on actual native popup roots portaled into either frame\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and\nTour). Frames remain pointer-transparent outside content and popups; native masks,\nfocus traps and dismissal remain unchanged. Do not relocate popups into a scrolling\nbody, change z-indices or add page overrides to solve this inherited-pointer gap.\n\nThe companion CSS provides opt-in native structural contracts, not application selectors:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: bounded body, intrinsic header/footer,\n optional zero body padding; bind through `rootClassName`. Keep the native body's\n default automatic overflow rather than suppressing access when intrinsic\n controls or preserved pane minima exceed a short allocation. Do not repeat\n body flex/overflow styles at consumers.\n- `bh-ant-fill-modal`: bind through native `wrapClassName`, not the unsupported\n Modal `rootClassName`. The real fixed overlay allocates a token-inset bounded\n dialog; its content/focus wrapper and body fill around intrinsic header/footer.\n Width remains the caller's native width, bounded by the available overlay.\n Use for interactive renderer inspection, not short confirmations. The renderer\n viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.\n- `bh-ant-fill-tabs`: bounded native wrappers and active pane. Nested tabs opt in separately;\n `bh-ant-fill-tabs--scroll` enables pane scrolling and `bh-ant-tabs-mobile-inset` adds the\n source mobile inset. Inactive panes stay hidden.\n Inner tabs inside that scrolling document can instead add\n `bh-ant-fill-tabs--document`: wrappers keep intrinsic content height and grow\n into adequate space, without clipping a renderer after long metadata exhausts\n the allocation. The outer native scroll pane owns vertical access; do not put\n both modifiers on the same root. Only the interactive renderer host receives\n `--bh-layout-renderer-minimum-block-size`, not outer panes or static fields.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: carry an existing bounded host through native wrappers.\n Static document/tree/list content can remain nonshrinking and overflow-visible\n inside the native Card's existing scroll owner. Do not pair that Card scroller\n with a second zero-height inner scroller when its header exhausts a tiny pane.\n This document composition adds no SDK-readable minimum to ordinary fields.\n- `bh-ant-fit-empty`: only on a real native Empty inside an already allocated\n placeholder. Native illustration choice alone does not guarantee a fit in a\n short host. The opt-in removes outer and description paragraph margins (the\n parent owns its inset), bounds the root and lets the image row shrink before\n the intrinsic description/footer. The image keeps its native preferred height\n and removes its inline baseline strut; neither enlarged artwork nor paragraph\n margins consume a tiny host. It adds no readable-renderer minimum, palette,\n text typography, image replacement or overflow suppression. Preserve the parent's one genuine\n scroll owner when even the intrinsic text/actions cannot fit. Ordinary\n document/list/table empties omit it and retain native defaults. The live native\n family below compares 2/4/12rem allocations, the simple illustration and the\n unchanged no-opt-in base.\n- `AntDesignVuePopupScope`: only for retained renderers moved across native\n overlay owners. Wrap the existing subtree outside its Teleport and pass the\n existing HTMLElement root as `owner`; keep owner attributes on that actual\n root. Keep a real element as the consuming component's root when callers use\n `v-show` or other element directives; put the scope inside that existing root,\n not in its place. A stable native popup holder moves with the owner because\n AntD4 caches the first portal container. Nested scopes inherit the enclosing target.\n Native ConfigProvider theme/locale, menus, focus and no-trigger body portals\n remain native; no editor/model/graph rekey or global popup z-index is involved.\n Fullscreen capture handlers yield menu/listbox Escape via\n `isAntDesignVueMenuEvent(event)` before closing their own overlay.\n Native Drawer portals can use the same stable host through the public scoped\n slot: `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` with\n `<a-drawer :get-container=\"getContainer\">`. HTML attributes on the scope\n belong to that actual portal host; conditionally expose `role=\"dialog\"`,\n `aria-label` and `aria-modal` only while open when the native Drawer drops\n these attributes. Do not add a second dialog wrapper or mutate native DOM.\n AntD4 Flex also drops attributes other than class/style: use an existing real\n semantic element when a controlled ID, region name or tab stop must survive.\n- Independently selectable, disclosable choices compose actual Card title slots\n with sibling native disclosure and selection Buttons plus a shortcut Tag.\n Keep Card headers noninteractive; each Button owns only its own action.\n AntD4 Collapse headers retain an ancestor `role=\"button\"`/tab stop even in\n icon-only mode, so do not nest independently actionable choices there.\n Native conditional Card body slots own expanded content; no private header\n role/keyboard patch or special choice-collapse CSS is needed.\n- `bh-ant-inspection-descriptions`: source desktop label minimum and mobile stacked rows.\n- `bh-ant-data-table`: generic pending/success/error row classes plus public `customCell`\n markers `data-bh-cell-interaction=\"editable|readonly\"` and `data-bh-cell-state=\"changed\"`.\n Native selection outranks operational row paint; changed cells keep diff paint on hover.\n `bh-ant-table-nowrap` is an independent horizontal-content opt-in.\n Add `bh-ant-row-indicators` for a `border.width.accent` inset danger marker on the\n first cell of `bh-ant-row-error` rows. This non-colour issue cue does not change\n column geometry, override selection or replace status text/icons.\n- `data-bh-tone=\"warning\"` on a native Badge root selects\n `color.background.warning.bold` / `color.text.on-bold` for its count only.\n Native operational status dots keep their separate source semantics and circles.\n- Native Button `data-bh-target=\"touch\"` selects `size.target.touch` as minimum\n width/height without repainting it. `data-bh-target=\"responsive\"` applies the\n same target only for coarse pointers. Keep native type, size, disabled and\n keyboard semantics; no page-owned target sizing is needed.\n- Native Modal/Drawer close controls also use the root-scaled coarse-pointer\n target. Closable Modal headers reserve the whole target height and center the\n title beside it, so the close hit area never covers the first body control.\n Modal titles reserve that native control's lane only when it is present;\n short `closable=false` confirmations do not receive an empty title inset.\n- A native Flex span inside Button remains a flex layout rather than inheriting\n AntD4's ordinary inline text-span display. Keep semantic title/description\n content separate through native composition, not another button wrapper.\n- Pass the observed root to `tokenPixels(name, locale, rootFontSize)` for actual\n Avatar/Image/Space/Row numeric props, including compact dock gaps. Omitting that\n argument intentionally returns nominal16px-root pixels; it does not read the\n browser's current root. Child setup calls reuse the sole provider's readonly\n measurement, not another observer. Keep CSS dimensions on scalable source roles.\n\nKeep custom business data/slot meaning and host structure in the consumer, not\npresentation recipes. Do not recreate native selectors through per-page\n`:deep(.ant-*)`, global overrides or priority escalation.\n\n## Token mapping\n\n| Ant Design token | Beehexa token |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nUse the [Radius roles](/foundations/styles/radius/), not one radius for every\ncomponent:\n\n| Component | Radius token |\n| --- | --- |\n| Button, Input, Select trigger, Radio button, Segmented, side navigation item | `radius.control` (6 px) |\n| 24 px controls | `radius.control.small` (4 px) |\n| Items in a dropdown or submenu popup | `radius.item` (4 px) |\n| Tooltip, tag, badge count | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs and other in-page containers | `radius.card` (8 px) |\n| Dropdown, submenu popup, Select popup, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (circle), Switch, chip | `radius.pill` |\n| Full-width table, joined Search edges, fullscreen surface | `radius.0` |\n\nGroups with 4 px padding use 8 px outside; groups with 8 px padding use 12 px\noutside. The adapter pins these component aliases and the companion CSS covers\nthe badge, Switch, Segmented and Drawer cases that have no theme input.\nConsumers must remove competing corner overrides, not add `.ant-*` radius patches.\nExplicit Button `shape=\"circle\"` / `shape=\"round\"` props keep their native sizing\nand the `radius.control` corner. They are not avatar, Switch or chip roles.\n\nThe adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead\nof allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes\nand radios use `color.border.bold` while cards/tables use `color.border`. Layout header and\nsider sit on `color.surface.page`, separated from the content by a `color.border` line; the mobile\nnavigation drawer is a drawer on `color.surface.overlay`. There is no separate shell palette or nested isolated\ntheme. Use `font.body.default` for table data, `font.label.small` for headers/tags,\n`font.heading.medium` for modal titles and `font.heading.small` for drawer titles.\n\nNative Menu icons use the native `icon` slot, source icon box and a `space.050`\ntitle gap. Do not rebuild the icon/label row in a Space with a page-specific gap.\nTitle text uses `font.label.default` rather than the row-height line box, keeping\nVietnamese labels and adjacent title/tag content vertically aligned.\nNative Tree content keeps its icon and shrinkable title centered as one row.\nIf a custom title already includes its glyphs, leave `showIcon` off; AntD4 otherwise\nreserves another empty icon box. Native selection, expansion and keyboard ownership\nare unchanged. Apply required content roles to a semantic host, not AntD4 Flex.\n\n### Ant Design Vue 4 component contracts\n\n- Table reads `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` and\n `controlItemBgActiveHover`. AntD5 names such as `headerBg` and `headerColor` are ignored\n by AntD Vue 4.2.6 and must not be used.\n- Switch reads OFF tracks from `colorTextQuaternary`/`colorTextTertiary`, ON tracks from\n `colorPrimary`/`colorPrimaryHover`, its shared thumb from `colorWhite`, **both** labels\n from `colorTextLightSolid`, and disabled/loading opacity from `opacityLoading`.\n These are component-scoped mappings, not changes to global primary/text colors.\n AntD5 `trackBg`/`handleBg`-style names are not the AntD4 state API.\n- Menu reads `colorItem*`, `radiusItem`, `radiusSubMenuItem` and `colorActiveBar*`.\n Explicit `theme=\"dark\"` menus receive the same source roles. Selection has a visible bar,\n not a heavier label that shifts its neighbours or merely a changed fill.\n- Form controls share source outline/focus/disabled roles. Validation retains danger/warning\n text/icons and native state semantics. Do not replace meaningful input borders with divider\n hairlines.\n- Tag status presets are `success`, `processing`, `warning`, `error`; default is neutral.\n They use source foreground and outline pairs. Arbitrary hue presets are not status names.\n Badge counts are neutral; error/processing status dots retain their semantics.\n- Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface,\n scrim and overlay elevation. Progress is neutral by default and semantic on success/error.\n\n### Native Switch contract\n\nUse the native Switch inside the existing root ConfigProvider. `enabled`,\n`saving`, `unavailable` and `locale` below are application state; do not create a\nnested provider or local theme just for schedules, permissions or status toggles.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` is neutral-bold, never business-success green. `switch.off.*` has a\nstrong thumb, readable label and meaningful boundary so enabled OFF cannot be\nmistaken for disabled. The source defines paired track/thumb/label/border roles\nfor normal, hover, pressed, focus, loading and disabled; normal and `size=\"small\"`\nuse the same light/dark palette and existing native geometry. Native thumb\nposition, `aria-checked`, labels and the separate focus ring provide non-color\ncues. Short EN/VI state labels use the existing source typography, not a patched\nheight or a consumer font declaration.\n\nAntD4 supports only one shared thumb/label pair, no pressed track paint and no\nexplicit disabled color pairs. Its spinner foreground and translucent green\nthumb shadow are also not configurable as paired parts. The companion CSS closes\nthose evidenced gaps, while normal/hover track paint stays in native aliases.\n`opacityLoading: 1` removes native loading/disabled dimming. Disabled ON uses\n`color.background.neutral.bold.pressed` with inverse thumb/label; disabled OFF uses\nthe disabled track, subtle thumb/label and bold boundary. Native checked position,\ndisabled behavior and cursor remain unchanged; both values must be readable.\nLoading retains the current normal checked pair and a high-contrast native spinner, including when both\nloading and disabled props are set. It never predicts or changes the saved value.\n\nKeep native controlled binding, `change` callback and keyboard operation. The\nnative button is disabled during loading; pending/disabled activation must not\nsave twice or update checked state. Business save operations and errors remain\napplication-owned. Test both sizes, OFF/ON loading and disabled states, EN/VI labels,\ncallback counts and a delayed controlled save. No consumer `.ant-switch` patch,\npalette literal or custom Switch implementation is necessary.\n\n### Contrast, links and native Segmented\n\nThe [Source contrast and link rules](/foundations/styles/color/accessibility/)\nare authoritative for every text/label/tag and effective background in both themes.\nRead-only IDs, titles, dependency names and status values must not use disabled\nroles. Use paired semantic status text/fills, not arbitrary hue tags or inverse\ntext over subtle fills. Normal text requires 4.5:1, large text 3:1 and meaningful\nboundaries 3:1 at rest, hover, pressed and selected states, including composites.\n\nAnchors, Typography links, link Buttons and prose links have no underline by\ndefault, including hover. `.bh-link-underline` is the sole explicit opt-in.\nKeep `color.link`/`color.link.hover` and Source focus rings; never mute a link\ninto metadata. Ordinary prose/document links use Source semibold as a persistent\nnon-colour cue; explicitly opt an authored link into underlining when its\nsurrounding prose is already semibold. Navigation and native link Buttons keep\ntheir existing component typography.\n\nUse native Segmented through this same root provider and companion CSS. Source\nremoves the opaque `::after` label overlay and applies paired backgrounds directly\nto stable item hover/pressed/selected-hover states. While AntD's native thumb is\npresent during motion, these opaque item fills are suppressed so they cannot\ncover it. Native selection and keyboard behavior remain unchanged.\nNever add consumer state paint or synthetic selected items.\nThe selected item and moving thumb use the native `boxShadow` alias for an inset\n`border.width.default` / `color.border.bold` boundary that identifies selection\npersistently without covering the label.\nThe [live native matrix](/foundations/styles/interaction-states/#live-native-switch-states)\nincludes all sizes, enabled/disabled and selected/unselected items for hover,\npress, click and keyboard verification. Follow the\n[spacing, truncation and motion invariants](/foundations/styles/interaction-states/#label-spacing-and-motion-invariants);\nhover must never obscure text or be the only way to expose information.\n\nKeep the size-specific native Segmented label `line-height`; do not apply a\nfont shorthand that resets it. The default toolbar Input, Segmented and Button\nmust share their native control center, including wrapped toolbar groups.\nFor metric rows, use headerless native Cards with `bh-ant-subgrid-card` in a\nparent grid with two shared automatic rows. Compose label/icon first and\nvalue/actions second, retaining native padding, source gaps and wrapping.\nUse `bh-icon-slot` with `data-bh-size=\"responsive\"` only for passive indicators\nbeside small responsive icon Buttons; it supplies matching geometry, not an action.\nDo not position labels or icons with manual pixel offsets to compensate for a\nnative line-box or shared-row defect.\n\n\n### Companion CSS and structural classes\n\nUse component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title\ntypography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas,\nresponsive Tour placement, reduced motion and neutral Badge count without recoloring error dots.\nApplication selectors and palette overrides belong neither in that CSS nor in a dashboard theme.\nConsumers retain genuine portal layout and scrolling mechanics only. Framework paint\nand typography fixes belong to the package, not duplicated consumer overrides.\n\nBordered Descriptions clip cell backgrounds inside the native rounded frame instead of\npainting over its left corners. Header-only Cards omit the orphan header/body divider\nand retain all four rounded corners; Cards with body/cover/actions keep native separation.\nBordered hoverable Cards keep `color.border.bold` plus `elevation.shadow.raised` on\nhover and keyboard focus, rather than AntD4's transparent hover border. Focus also\nuses the standard outline/offset; the application still owns keyboard action semantics.\nThese framework fixes are automatic, not per-page overrides.\n\nNative Search, Input addon buttons, compact InputGroup and horizontal Space.Compact\nshare an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,\nadjacent borders overlap once, exposed corners use `radius.control` and touching corners stay zero.\nSource font roles are retained. Small Vietnamese fields/actions grow together to 26 px;\ndo not clip accents or shrink type to force 24 px. Default actions share field\nerror/warning/disabled borders; primary/danger actions retain their semantic roles.\nClear icons keep an icon-sized line box so they cannot inflate affix wrappers.\n\n`bh-ant-tag-large` on a Tag selects the source large label (24px minimum, 8px inline padding);\nthe default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.\n`bh-ant-tree-fill` on an actual Tree fills a bounded flex host, including below an\nintrinsic summary. Root and list establish the min-height-zero chain; only the\nnative list holder scrolls, preserving its keyboard scroll target. Do not pass a\nfixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.\nKeyboard-navigation consumers bind the native `activeKey` / `onActiveChange` pair:\nstate `ref<TreeProps['activeKey']>()`, then `:active-key=\"activeKey\"`\nand `@active-change=\"activeKey = $event ?? undefined\"`. AntD 4.2's uncontrolled\nactive-change path does not retain the requested node; a CSS fill opt-in cannot\nsupply that navigation state.\n\nFor data inspection, bind `width=\"var(--bh-ant-overlay-width)\"` and apply\n`bh-ant-inspection-modal` or Drawer `rootClassName=\"bh-ant-inspection-drawer\"`.\nAdd `bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` only for an explicit\ncontent-heavy variant. The variable selects `layout.overlay.default` / `.wide`, and `.mobile`\nbelow `breakpoint.lg`. Short confirmations and navigation drawers retain their own widths.\nThe Modal's `max-width: 100%` caps that width to its native scrolling wrap, which\nexcludes the vertical scrollbar. Do not replace the cap with `100vw` or hide\nhorizontal overflow: the mobile width token may fill the viewport, but the actual\nModal must still fit its available containing block.\nFullscreen modes are Modal `wrapClassName=\"full-screen\"` and Drawer\n`rootClassName=\"fullscreen\"`; AntD4 Modal has no `rootClassName` prop. These preserve\nbounded scroll mechanics, not decoration.\n\n### Native field names\n\nBind a real `<label for=\"…\">` to the native Select's explicit `id`, or use the\ncorresponding native Form Item label association. In AntD4, an `aria-label` on\nSelect can name its outer generic wrapper while leaving the actual combobox\nunnamed. Check the combobox's accessible name and native label activation, not\njust an attribute on a component root. Use Vue `useId()` plus a row identity for\nrepeated fields; do not add a wrapper or an attribute-copying observer.\n\n### Verify the actual framework\n\nExercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated\ninputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals,\nexpanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message,\nModal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus,\ntouch hit areas, reduced motion, narrow Tour and focus return. Use\n**ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** in controls, tags and rows.\nCompilation alone does not establish those rendering/interaction outcomes.\n\n\n## Spacing\n\nAnt Design Vue sizes come from `sizeUnit` and `sizeStep`. Keep both at 4, so `size` is 16 px. The theme then sets each size from a [spacing](/foundations/styles/spacing/) token.\n\n| Beehexa token | Value | Ant Design Vue tokens |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` and `space.1000` have no Ant Design Vue token. Use their CSS variables in your own styles.\n\nProps that take a number, such as `size` on `a-space` and `gutter` on `a-row`, take pixels. Use a value from the scale: `<a-space :size=\"8\">`.\n\n## Control height\n\n| Beehexa token | Height | Ant Design Vue token | Component prop |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | None |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nThese are Ant Design Vue’s own heights. The theme still sets each one from its size token, so a change to the token reaches the components. See [Size and density](/foundations/styles/size-and-density/).\n\n## Breakpoints\n\n**Override the `screen*` tokens with the Beehexa <a class=\"bh-link-underline\" href=\"/foundations/styles/layout/breakpoints/\">breakpoints</a>.** The default Ant Design Vue values are different (576, 992, 1200 and 1600 px).\n\nThe `Min` and `Max` tokens are computed from the defaults, not from your overrides. Set them too: each `Max` is the next breakpoint minus 1.\n\n| Beehexa | Value | Ant Design Vue tokens |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue has six breakpoints and Beehexa has four, so `sm` switches with `md`, and `xxl` with `xl`. Use the `xs`, `md`, `lg` and `xl` props of `a-col`.\n\nThe props of `a-col` and the responsive `gutter` of `a-row` then switch at the Beehexa widths. Do not use `xxxl`: its media query is malformed in Ant Design Vue 4.2.6 and never matches.\n\n## Grid\n\nAnt Design Vue divides a row into 24 parts. The Beehexa [grid](/foundations/styles/layout/grid/) has 4, 8 or 12 columns, and each one fits 24 exactly.\n\n| Beehexa grid | Window | `a-col` span |\n|---|---|---|\n| 4 columns | Below 768 px | Beehexa span × 6 |\n| 8 columns | 768 to 1023 px | Beehexa span × 3 |\n| 12 columns | 1024 px and up | Beehexa span × 2 |\n\n| Layout | Beehexa spans (4 / 8 / 12 / 12) | Props of each `a-col` |\n|---|---|---|\n| Cards, 1 to 4 a row | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Main panel | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Side panel | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Summary tile | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nAnt Design Vue rows have no gutter by default. Set it from the spacing tokens, and set the page margin on the content area.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## App frame\n\n| Region | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Side navigation, open | 280 px | `<a-layout-sider :width=\"280\">` |\n| Side navigation, collapsed | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nThe header is 64 px by default and has no token for its height, so set it in the header’s style.\n\nThe `breakpoint` prop of `a-layout-sider` uses fixed widths that ignore the `screen*` tokens. Do not use it. Set `collapsed` from your own media query and the user’s choice: open from 1024 px, collapsed to the rail when the user asks, and the choice remembered. Below 1024 px, hide the sider and show the menu in `a-drawer`.\n\nSee [Layout](/foundations/styles/layout/) for the frame.\n\n## Interactive table rows\n\nBind `data-bh-interactive=\"true\"` through `customRow` only when the complete row\nalready has an activation handler. The source companion owns the pointer cursor;\nnative selection keys/classes retain their selection recipe. Preserve accessible\nrow actions, keyboard behavior and actual record activation rather than replacing\nselection with a custom outline.\n\n\n## Native composition and optional variants\n\nUse the real native component. These opt-ins do not authorize a div-based\nreplacement, a skin-only wrapper, or copying Card/Button geometry into the app.\n\n- Native Card's `hoverable` prop remains optional. `data-bh-selected=\"true\"`\n adds a selected fill and independent inset cue; omitting it restores the base.\n In a composed selectable Card, `data-bh-card-action=\"primary\"` on the primary\n native text Button retains `aria-pressed` and keyboard focus without duplicating\n the outer Card's selected frame. Independent actions retain ordinary Button paint.\n- Reuse `bh-data-accent` with an existing semantic `data-bh-status`, `data-bh-band`,\n `data-bh-metric`, `data-bh-job-type` or `data-bh-priority` for an optional leading\n edge on a real Card. It adds no selection or hover behavior. A status/category\n edge survives selection; keyboard focus remains a separate outside outline.\n Bind the discriminator appropriate to that mark rather than conflating status\n with categorical identity. Labels are still mandatory.\n- `data-bh-layout=\"content\"` on a real Button allows a multiline composed label:\n auto height, normal wrapping, start alignment and the source default-control\n minimum height. Native props, padding and keyboard activation remain native.\n Use ordinary Button size/block props when they suffice.\n- `bh-ant-shell-region` removes native Header/Footer padding only when the region\n already contains the composed app header/footer. It does not change native\n height, paint or the surrounding responsive page-region layout.\n- `bh-card-link` on a real navigation anchor wrapping Card removes competing\n link paint/underline and supplies source keyboard focus, not Card skin.\n- `bh-ant-card-action-row` uses the native Card title/extra slots with a shrinkable\n leading track and reserved trailing action. Source head inset stays consistent\n across Card sizes; the real link remains a flexible inline title/metadata row.\n See [application content](/tools/application-content/#semantic-content-and-genuine-composition).\n- `bh-ant-metric-tooltip` on a native Tooltip overlay and `bh-metric-tooltip`\n on its semantic title-slot host separate date/header, metric definition list and\n explanation. The token-backed readable width is capped by the viewport; native\n popup placement, theme, keyboard and touch behavior stay with the actual owner.\n\nBusiness components may own data, state, behavior and meaningful composition of\nthese primitives. Inventory and remove redundant replacement components and every\nobsolete caller/import/export. Generated rich content must mount real native\nenhancement controls when the host framework permits it; a producer stylesheet\nalone is not evidence of missing native capability.\n\n\n### Operational and composed native content\n\n`Steps[data-bh-operational=\"true\"]` uses success/info/danger/subtle for native\nfinish/process/error/wait states. It leaves categorical navigation Steps unchanged.\nAn actual Step's `data-bh-skipped=\"true\"` adds a dashed tail in either orientation;\nthe caller retains ordering and the relationship's meaning. Custom icon slots do\nnot require rebuilding the Steps primitive.\n\n`Result[data-bh-layout=\"step\"]` retains a composed report's icon-and-title header\nrow, with subtitle/content and extra/actions below at full width. It only changes\nnative layout/padding; status paint and native slots remain native.\n\nThe native Tree title `data-bh-highlighted=\"true\"` is a temporary locator cue,\nnot a selected key or keyboard focus. Native selected/disabled treenodes suppress\nit; the source outline does not change title geometry.\n\nUse `bh-partner-logo-image` on a real Image for connector/brand assets.\nBind only the Source partner-image height and `width=\"auto\"`; native Image plus\nthe adapter preserves its intrinsic aspect ratio without a square frame or crop.\nActual identity Avatars stay native. Do not use brand hue as operational status.\n\n### Native Image preview\n\nThe official Image `zIndexPopupBase` and `zIndexPopup` tokens use `z-index.modal`.\nThat alone cannot clear an owner nested above it: AntD4.2.6 Preview drops\nboth declared Dialog `zIndex` and `wrapProps`. The setup composable\n`useNativeImagePreviewContainer(labelGetter)` from\n`@beehexa/ant-design-vue-tokens/image` owns the official lazy body portal:\npass its getter to native `preview.getContainer`. It names the real native\ndialog, reacts to locale changes and captures a layer above live owners on\neach opening, excluding its own previous layer. A closed portal is not an\noverlay owner. Its observer/container are disposed on unmount. Native Image\nstill owns zoom/pan, keyboard close and focus return; there is no custom viewer.\n\n\n`bh-ant-card-flush` opts a real Card body out of inset only for an edge-to-edge\nembedded editor, canvas or composed pane. Ordinary cards retain native padding.\nReuse `bh-ant-fill-card` and `bh-ant-fill-spin` for existing bounded flex hosts;\ndo not create parallel fill aliases or restore private consumer selectors.\nThe flush Card clips embedded paint to its native rounded frame. A direct\nbrowser iframe child has its UA border removed to avoid a second frame;\nsandbox/srcdoc and embedded-document behavior remain browser-owned.\n\n`semanticTableComponents` from `@beehexa/ant-design-vue-tokens/table` extends\nthe real Table's public `components` API. A column's `customCell` may return\n`{ scope: 'row' }`; its body cell becomes a semantic `th`, forwarding the native\nattributes and slot. Other cells remain `td`. AntD4 has no row-scope column prop\nand its body-cell CSS only targets `td`, so the source companion supplies the\nmatching row-header size/border/hover/selection recipe for this actual HTML\nsemantics gap. Native columns, rows and Summary remain native.\n\nAn actual native ListItem may opt into `data-bh-interactive=\"true\"` for a rich\nactivation row when no narrower native control meets its content contract.\nThe opt-in supplies hover/pointer/focus only; the consumer supplies a real action,\nkeyboard activation and accessible role. Do not nest competing interactive targets.\n\n\nConnector and partner brands share `content.partner-logo.image-size` as their\nrendered height, not a width cap. Keep natural width; wrap rows when needed.\nSemantic icon-height roles likewise preserve proportional width and hit targets.\nNative Table already styles `tfoot > tr > th` geometry at each size; the companion\nadds only its missing Summary row-header border and semantic weight/alignment.\n`a-typography-link[data-bh-target=\"responsive\"]` uses the source minimum24px\ntarget, increasing to44px only on coarse pointers; it adds no link skin.\n\n\nFlush Cards clip embedded paint to their actual rounded frame. Native Drawer\nfooters retain their canonical inset or the device's safe-area inset, whichever\nis larger. `Spin[data-bh-mode=\"nonblocking\"]` removes the native veil/pointer\nblock only for progressive content that remains inspectable; omit it for actual\nblocking work such as export. This does not change spinner timing or graph data.\n\n\n## Read-only segmented native Progress\n\nFor “Step 3 of 7” feedback, use the real native `Progress` with its actual\n`steps` and `percent`. This is not navigation: do not substitute `Steps`,\n`Segmented`, a fabricated row of marks, or another progress engine.\n\nAntD4 `size=\"small\"` deliberately renders each step as a **2 × 8px vertical\nfragment**. Its native `[width, height]` tuple means **per-segment** geometry.\nThe source helper resolves `content.step-progress.segment-width` and\n`segment-height` to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Step {{ props.index }} of {{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n status=\"normal\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nThe feature owns the real positive total, current index, status text and\nbusiness transitions. The helper supplies geometry only; native Progress\nowns the rendered count and active marks. Hide the redundant bar from assistive\ntechnology only when adjacent text already conveys the same progress.\n\nFor current-position feedback, explicitly set `status=\"normal\"`: reaching the\nlast authored group does not mean the operation succeeded. Render failure or\ncompletion status only from actual workflow evidence, independently of the\nindex. A one-group workflow still has one real mark; an absent/zero total has no\nbar. Do not manufacture a denominator from screenshot geometry or API-step count.\n\n`bh-ant-step-progress` opts that native root into intrinsic inline width,\nzero native outer margins, the source `content.step-progress.gap` (4px at\nroot16), and wrapping without a trailing item margin. CSS does not replace\nthe native size API or set per-mark width/height. The bar follows the status\non a wide row and wraps within the available width on mobile.\n\nOmit the class and helper to retain the native base. Ordinary percentage,\nupload and countdown progress do not opt in. The shared live matrix below\nincludes a real native no-opt-in comparison, editable total and first/middle/\nfinal controls; check both root16 and root20, light/dark and narrow widths.\n\n## Thin navigation Progress\n\nFor route-loading feedback use real native `Progress` with `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` and its native size tuple.\nUse `border.width.focused` for the thin line and `color.brand.yellow` for its optional\nbrand stroke. The application owns fixed viewport positioning at `top: 0`, width and\nits layer from the seven [z-index](/foundations/styles/z-index/) tokens; the adapter removes AntD's inline baseline gap and outer margins,\nso the actual ink begins at the allocated top edge without negative offsets.\n\nProgress reflects completed navigation milestones, not invented network percentages.\nKeep the previous page while guards and route chunks resolve, advance to100%, and await\nthe actual finite native width transition before committing the new page. Cancellation,\nerrors and superseding navigation must clear their own progress without clearing a newer\nrequest. The source width transition uses `motion.duration.default` and\n`motion.easing.linear`; reduced motion removes it. Keep a named progressbar with actual\nmilestone values, and never use a page-covering scrim just to load a route.\n\n## One native control family, distinct roles\n\nUse native default Button for compact bordered utility triggers (including\nlanguage and theme), with the same native size as adjacent page controls.\nUse the public `#icon` slot and one label child; icon-only Buttons still need\nan accessible name. Do not disguise `type=\"text\"` globally as a default Button.\nA frameless account/avatar menu legitimately uses `type=\"text\"`, a real Avatar\nand native Space: center it in the row rather than inventing a shell skin.\n\nButton small/default/large use source control heights24/32/40px at the nominal\nroot; typography is label-small for small and label-default otherwise.\nButton/Input/Select and side navigation items use `radius.control`; Select popups and menus use `radius.overlay`.\nThe numeric theme/root observer and rem CSS scale together.\nAntD4 only inserts margin for `.anticon` siblings, not Lucide SVGs in `#icon`;\nthe source supplies one space100 flex gap for all real Buttons and removes\nthe competing native/loading-icon margin. No shell-specific class is needed.\nNative default/primary/text/link, disabled/loading, hover/pressed and keyboard\nfocus remain distinct. `data-bh-target=\"responsive\"` adds touch minimums only\non coarse pointers. Open Dropdown/Menu state is not Button selection; keep\n`aria-expanded`, menu keyboard behavior and focus return in the actual feature.\n\nThe primary neutral-bold/inverse pair is intentional: graphite in light mode,\nlight graphite with dark text in dark mode. A pale dark-mode Continue action\nis not a reason to recolor every primary or text Button blue. Link actions\nretain the source link palette; default utility actions remain bordered.\n\n| Native variant | Source role and state contract |\n| --- | --- |\n| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |\n| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |\n| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |\n| Danger default / dashed / text / ghost | Readable danger text; outlined variants retain danger borders. Available non-link variants use danger-subtle hover/pressed fill. Ghost starts transparent, never with the solid on-bold label. |\n| Link / text | Distinct link/frameless roles, not a disguised default Button. |\n| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |\n| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |\n\nAntD4 paints a **resting lower shadow** from `controlOutline` on primary,\n`controlTmpOutline` on default, and `colorErrorOutline` on danger-primary.\nThose names are not exclusively keyboard-focus inputs. Reusing the global\nblue focus alias there produces a stranded blue stripe even after all\nanimations finish. The source scopes these three Button component aliases\nto transparent; it does not clear the global focus role or set its width\nto zero.\n\nNative Button keyboard focus instead reads `colorPrimaryBorder` and\n`lineWidthBold`. Its component overrides use source focus color/width.\nThe companion's enabled `:focus-visible` rule supplies the independent,\ngapped source outline/offset. Default/dashed state fills and the separate\ndanger text/on-bold pairs are the remaining native-token gaps; source CSS\nhandles only those cases, excluding disabled controls and genuine selection.\nApps must not add a local shadow/border reset or a focus suppression.\n\nThe compact native dock uses `bh-control-group` and `data-bh-variant=\"dock\"`\non Space. Its neutral text-action paint excludes danger, ghost, real selected\ntoggles, loading controls and disabled anchors, so the same role/state contracts\nstill apply inside the dock. Open actions may use `aria-expanded`; genuine\ntoggles use `aria-pressed` and retain the selected fill plus structural indicator.\nAntD4 href Buttons render anchors with a native `disabled` attribute, not the\n`:disabled` pseudo-class or a generated disabled class. Native enabled hover/active\nselectors still match those anchors. The companion recognises `[disabled]` and\n`aria-disabled=\"true\"` with sufficient native-state specificity: disabled text\nstays disabled; fill/border roles match the native non-href Button for solid,\ntext/link, ghost and danger/ghost combinations. Set the native `disabled` prop, supply\n`aria-disabled=\"true\"` and `tabindex=\"-1\"` for an unavailable href Button; native\nAntD click handling blocks its navigation. ARIA or CSS alone never disables a\nlink. Do not manufacture AntD classes or replace genuine links with pointer-only\nhandlers.\n\n### Live native state and progress matrix\n\nUse the site theme/language controls and browser root font preference.\nChange Button size, hover/hold a press, Tab/Enter/Space through available\nactions, and inspect actual activation counts. Loading/disabled Buttons and\ngenuine disabled href variants must not activate, including inside the compact dock.\nToggle its selected action and check danger hover/pressed without neutral repaint.\nThe long native Card title wraps independently of its extra action on mobile.\nSwitch examples include loading and disabled together; loading retains checked\npaint and the spinner while callbacks stay blocked. Progress uses the same actual\ncount/index for its opt-in and no-opt-in renderers.\n\n<NativeControlsDemo />\n\n\n### Native mobile composition and bounded content\n\nThe adapter stretches joined Input/Search/compact-group fields and their actions\nas one row, including validation, disabled states and coarse-pointer targets.\nIcon-only Buttons keep their native size proportions; on coarse pointers both\naxes reach `size.target.touch`. Content-layout Buttons retain multiline text\nwithout overriding explicit or responsive touch minimums.\n\nBelow `breakpoint.md`, every native Card header/meta title wraps, including\ndescendant Typography ellipsis, Tags and Space. This is global readable content,\nnot an optional consumer override. Header extras remain available. Standard\nTimeline dots, tails and custom dots align to the first content line; wrapped\nevent content stays in the native timeline column. Label/alternate/right\ntimelines retain their distinct native alignment.\nFor event rows with inline native small Buttons, bind `data-bh-layout=\"actions\"`\non the Timeline and center the native Flex row. This shares the first line's\nallocation with `size.control.small` (or `size.target.touch` on coarse pointers),\nso the dot/tail do not stay above text beside a taller touch action. Plain text\ntimelines keep their normal source line box. AntD4 Timeline exposes no component\nsizing token; this bounded composition does not change label/right/alternate modes.\n\nAntD4 Flex does not forward arbitrary `role`, `aria-*`, `data-*` or DOM listeners.\nDo not put required semantics, source opt-ins or keyboard handlers on it. Use\nnative Space/Typography where appropriate, or retain a real semantic host with\nminimal structural flex/grid CSS. Do not introduce a forwarding wrapper.\n\nUse `bh-content-toolbar` and `bh-content-toolbar__group` on actual intrinsic\ntext-editor toolbar hosts; the source owns spacing, padding, wrapping and mobile\ncontrol minimums. Graph navigation instead uses the compact Source dock floating\ninside its drawing viewport, default lower-left, never a full-width header band.\nFollow the [canvas dock contract](/tools/mermaid/#shared-drawing-viewport-and-dock)\nwithout copying graph-only actions to text editors. These are shared recipes,\nnot page-specific skins. Keep hosts and flex children shrinkable with `min-width: 0`.\n\nBind `bh-ant-fill-spin` through Spin's **wrapperClassName**, not its class:\nthe nested-loading wrapper carries the bounded height. Drawer fill/flush modes\ntraverse the native content-wrapper/content/wrapper-body chain; header/footer\nremain intrinsic and the body owns the remaining space. Tabs fill only their\nown active pane. Consumers supply the actual bounded parent, not guessed\nviewport-minus-header heights. Monaco/Mermaid observe that host's dimensions\nwithout replacing the editor model or resetting existing chart pan/zoom.\n\n",
|
|
2122
|
-
"raw": "---\ntitle: Ant Design Vue theme\ndescription: Make Ant Design Vue components use Beehexa design tokens, breakpoints, grid, control heights and app frame.\norder: 3\n---\nimport NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` owns the reusable Ant Design Vue 4 adapter.\nUse its typed ESM API and companion CSS, backed by `@beehexa/design-tokens`.\nFrameworks are peers: `ant-design-vue@^4.2.6` and `vue@^3.3.0`; neither is bundled.\nUnreleased `0.0.0` packages use explicit local development references; only the authorized\nrelease runner stamps real package versions. Do not copy a theme palette into an application.\n\n**Beehexa tokens are the source of truth. Ant Design Vue only reads them.**\n\nThis page is the only place where the Beehexa foundations meet Ant Design Vue. The foundation pages stay the same whatever the product is built with.\n\n## Usage\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})`\nreturns the native `ThemeConfig`. Recompute on theme/language/root-font changes;\neach call returns a fresh object. `locale` selects source typography, not messages.\nThe setup-only source observer measures one inert1rem probe and cleans it up.\nThis keeps numeric native size/type/radius APIs aligned with scalable CSS units;\npixel-based borders and breakpoints do not scale. The pure factory reads no DOM.\nPass the appropriate AntD language pack through `ConfigProvider.locale`, and configure the\ndate library separately. Render native `useMessage`, `useNotification` and `useModal`\nholders in a feedback host inside the sole root provider. Bind application notify facades\nto those hook APIs; never use detached raw static feedback APIs. The factory sets\n`hashed: false` because AntD4 contextual message/notification holders otherwise retain\nstale hashes across theme/locale changes. Keep an existing notice open while switching\ndark/Vietnamese to light/English; its typography and paint must follow the active theme.\n\nKeep document `data-theme` and `lang` synchronized for teleported overlays. Import\ncompanion CSS after application/framework styles. Use a native 16px root and 14px body;\nnumeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.\n\n## Overlay ownership and bounded native content\n\nTriggered popups use `getAntDesignVuePopupContainer` to stay inside their nearest native\nModal/Drawer or custom `data-bh-overlay-owner` host. Native Modal/Drawer roots remain\nbody-hosted for viewport geometry. Provider-bound modal facades default their invocation\n`zIndex` through `getAntDesignVueModalZIndex()` while preserving explicit caller values;\nthis keeps keyboard/awaited confirmations above their live owner. Nested drawers use\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` as `rootStyle.zIndex` so\nsurface and mask move together; AntD4's `zIndex` prop styles only the content wrapper.\nBody-teleported fullscreen editors/images and fullscreen native Modals capture\n`getAntDesignVueFullscreenZIndex()` before mounting their root. This uses\n`z-index.modal` with above-owner ordering, not a separate fullscreen tier.\nMark custom roots only once they are active, avoiding self-counting. The seven\napproved tiers have no fullscreen450 or readiness650 token; blocking loading\nalso uses `z-index.modal`. Keep owner-relative ordering below\n`z-index.tooltip` and `z-index.toast`; reserve `z-index.spotlight` for tours.\nTour's inline native default also requires its public\n`zIndex` prop bound to `z-index.spotlight`.\n\nModal frames and Drawer content wrappers intentionally inherit `pointer-events: none`;\nnative content restores pointer entry only for its own subtree. The companion CSS also\nrestores `pointer-events: auto` on actual native popup roots portaled into either frame\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and\nTour). Frames remain pointer-transparent outside content and popups; native masks,\nfocus traps and dismissal remain unchanged. Do not relocate popups into a scrolling\nbody, change z-indices or add page overrides to solve this inherited-pointer gap.\n\nThe companion CSS provides opt-in native structural contracts, not application selectors:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: bounded body, intrinsic header/footer,\n optional zero body padding; bind through `rootClassName`. Keep the native body's\n default automatic overflow rather than suppressing access when intrinsic\n controls or preserved pane minima exceed a short allocation. Do not repeat\n body flex/overflow styles at consumers.\n- `bh-ant-fill-modal`: bind through native `wrapClassName`, not the unsupported\n Modal `rootClassName`. The real fixed overlay allocates a token-inset bounded\n dialog; its content/focus wrapper and body fill around intrinsic header/footer.\n Width remains the caller's native width, bounded by the available overlay.\n Use for interactive renderer inspection, not short confirmations. The renderer\n viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.\n- `bh-ant-fill-tabs`: bounded native wrappers and active pane. Nested tabs opt in separately;\n `bh-ant-fill-tabs--scroll` enables pane scrolling and `bh-ant-tabs-mobile-inset` adds the\n source mobile inset. Inactive panes stay hidden.\n Inner tabs inside that scrolling document can instead add\n `bh-ant-fill-tabs--document`: wrappers keep intrinsic content height and grow\n into adequate space, without clipping a renderer after long metadata exhausts\n the allocation. The outer native scroll pane owns vertical access; do not put\n both modifiers on the same root. Only the interactive renderer host receives\n `--bh-layout-renderer-minimum-block-size`, not outer panes or static fields.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: carry an existing bounded host through native wrappers.\n Static document/tree/list content can remain nonshrinking and overflow-visible\n inside the native Card's existing scroll owner. Do not pair that Card scroller\n with a second zero-height inner scroller when its header exhausts a tiny pane.\n This document composition adds no SDK-readable minimum to ordinary fields.\n- `bh-ant-fit-empty`: only on a real native Empty inside an already allocated\n placeholder. Native illustration choice alone does not guarantee a fit in a\n short host. The opt-in removes outer and description paragraph margins (the\n parent owns its inset), bounds the root and lets the image row shrink before\n the intrinsic description/footer. The image keeps its native preferred height\n and removes its inline baseline strut; neither enlarged artwork nor paragraph\n margins consume a tiny host. It adds no readable-renderer minimum, palette,\n text typography, image replacement or overflow suppression. Preserve the parent's one genuine\n scroll owner when even the intrinsic text/actions cannot fit. Ordinary\n document/list/table empties omit it and retain native defaults. The live native\n family below compares 2/4/12rem allocations, the simple illustration and the\n unchanged no-opt-in base.\n- `AntDesignVuePopupScope`: only for retained renderers moved across native\n overlay owners. Wrap the existing subtree outside its Teleport and pass the\n existing HTMLElement root as `owner`; keep owner attributes on that actual\n root. Keep a real element as the consuming component's root when callers use\n `v-show` or other element directives; put the scope inside that existing root,\n not in its place. A stable native popup holder moves with the owner because\n AntD4 caches the first portal container. Nested scopes inherit the enclosing target.\n Native ConfigProvider theme/locale, menus, focus and no-trigger body portals\n remain native; no editor/model/graph rekey or global popup z-index is involved.\n Fullscreen capture handlers yield menu/listbox Escape via\n `isAntDesignVueMenuEvent(event)` before closing their own overlay.\n Native Drawer portals can use the same stable host through the public scoped\n slot: `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` with\n `<a-drawer :get-container=\"getContainer\">`. HTML attributes on the scope\n belong to that actual portal host; conditionally expose `role=\"dialog\"`,\n `aria-label` and `aria-modal` only while open when the native Drawer drops\n these attributes. Do not add a second dialog wrapper or mutate native DOM.\n AntD4 Flex also drops attributes other than class/style: use an existing real\n semantic element when a controlled ID, region name or tab stop must survive.\n- Independently selectable, disclosable choices compose actual Card title slots\n with sibling native disclosure and selection Buttons plus a shortcut Tag.\n Keep Card headers noninteractive; each Button owns only its own action.\n AntD4 Collapse headers retain an ancestor `role=\"button\"`/tab stop even in\n icon-only mode, so do not nest independently actionable choices there.\n Native conditional Card body slots own expanded content; no private header\n role/keyboard patch or special choice-collapse CSS is needed.\n- `bh-ant-inspection-descriptions`: source desktop label minimum and mobile stacked rows.\n- `bh-ant-data-table`: generic pending/success/error row classes plus public `customCell`\n markers `data-bh-cell-interaction=\"editable|readonly\"` and `data-bh-cell-state=\"changed\"`.\n Native selection outranks operational row paint; changed cells keep diff paint on hover.\n `bh-ant-table-nowrap` is an independent horizontal-content opt-in.\n Add `bh-ant-row-indicators` for a `border.width.accent` inset danger marker on the\n first cell of `bh-ant-row-error` rows. This non-colour issue cue does not change\n column geometry, override selection or replace status text/icons.\n- `data-bh-tone=\"warning\"` on a native Badge root selects\n `color.background.warning.bold` / `color.text.on-bold` for its count only.\n Native operational status dots keep their separate source semantics and circles.\n- Native Button `data-bh-target=\"touch\"` selects `size.target.touch` as minimum\n width/height without repainting it. `data-bh-target=\"responsive\"` applies the\n same target only for coarse pointers. Keep native type, size, disabled and\n keyboard semantics; no page-owned target sizing is needed.\n- Native Modal/Drawer close controls also use the root-scaled coarse-pointer\n target. Closable Modal headers reserve the whole target height and center the\n title beside it, so the close hit area never covers the first body control.\n Modal titles reserve that native control's lane only when it is present;\n short `closable=false` confirmations do not receive an empty title inset.\n- A native Flex span inside Button remains a flex layout rather than inheriting\n AntD4's ordinary inline text-span display. Keep semantic title/description\n content separate through native composition, not another button wrapper.\n- Pass the observed root to `tokenPixels(name, locale, rootFontSize)` for actual\n Avatar/Image/Space/Row numeric props, including compact dock gaps. Omitting that\n argument intentionally returns nominal16px-root pixels; it does not read the\n browser's current root. Child setup calls reuse the sole provider's readonly\n measurement, not another observer. Keep CSS dimensions on scalable source roles.\n\nKeep custom business data/slot meaning and host structure in the consumer, not\npresentation recipes. Do not recreate native selectors through per-page\n`:deep(.ant-*)`, global overrides or priority escalation.\n\n## Token mapping\n\n| Ant Design token | Beehexa token |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nUse the [Radius roles](/foundations/styles/radius/), not one radius for every\ncomponent:\n\n| Component | Radius token |\n| --- | --- |\n| Button, Input, Select trigger, Radio button, Segmented, side navigation item | `radius.control` (6 px) |\n| 24 px controls | `radius.control.small` (4 px) |\n| Items in a dropdown or submenu popup | `radius.item` (4 px) |\n| Tooltip, tag, badge count | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs and other in-page containers | `radius.card` (8 px) |\n| Dropdown, submenu popup, Select popup, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (circle), Switch, chip | `radius.pill` |\n| Full-width table, joined Search edges, fullscreen surface | `radius.0` |\n\nGroups with 4 px padding use 8 px outside; groups with 8 px padding use 12 px\noutside. The adapter pins these component aliases and the companion CSS covers\nthe badge, Switch, Segmented and Drawer cases that have no theme input.\nConsumers must remove competing corner overrides, not add `.ant-*` radius patches.\nExplicit Button `shape=\"circle\"` / `shape=\"round\"` props keep their native sizing\nand the `radius.control` corner. They are not avatar, Switch or chip roles.\n\nThe adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead\nof allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes\nand radios use `color.border.bold` while cards/tables use `color.border`. Layout header and\nsider sit on `color.surface.page`, separated from the content by a `color.border` line; the mobile\nnavigation drawer is a drawer on `color.surface.overlay`. There is no separate shell palette or nested isolated\ntheme. Use `font.body.default` for table data, `font.label.small` for headers/tags,\n`font.heading.medium` for modal titles and `font.heading.small` for drawer titles.\n\nNative Menu icons use the native `icon` slot, source icon box and a `space.050`\ntitle gap. Do not rebuild the icon/label row in a Space with a page-specific gap.\nTitle text uses `font.label.default` rather than the row-height line box, keeping\nVietnamese labels and adjacent title/tag content vertically aligned.\nNative Tree content keeps its icon and shrinkable title centered as one row.\nIf a custom title already includes its glyphs, leave `showIcon` off; AntD4 otherwise\nreserves another empty icon box. Native selection, expansion and keyboard ownership\nare unchanged. Apply required content roles to a semantic host, not AntD4 Flex.\n\n### Ant Design Vue 4 component contracts\n\n- Table reads `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` and\n `controlItemBgActiveHover`. AntD5 names such as `headerBg` and `headerColor` are ignored\n by AntD Vue 4.2.6 and must not be used.\n- Switch reads OFF tracks from `colorTextQuaternary`/`colorTextTertiary`, ON tracks from\n `colorPrimary`/`colorPrimaryHover`, its shared thumb from `colorWhite`, **both** labels\n from `colorTextLightSolid`, and disabled/loading opacity from `opacityLoading`.\n These are component-scoped mappings, not changes to global primary/text colors.\n AntD5 `trackBg`/`handleBg`-style names are not the AntD4 state API.\n- Menu reads `colorItem*`, `radiusItem`, `radiusSubMenuItem` and `colorActiveBar*`.\n Explicit `theme=\"dark\"` menus receive the same source roles. Selection has a visible bar,\n not a heavier label that shifts its neighbours or merely a changed fill.\n- Form controls share source outline/focus/disabled roles. Validation retains danger/warning\n text/icons and native state semantics. Do not replace meaningful input borders with divider\n hairlines.\n- Tag status presets are `success`, `processing`, `warning`, `error`; default is neutral.\n They use source foreground and outline pairs. Arbitrary hue presets are not status names.\n Badge counts are neutral; error/processing status dots retain their semantics.\n- Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface,\n scrim and overlay elevation. Progress is neutral by default and semantic on success/error.\n\n### Native Switch contract\n\nUse the native Switch inside the existing root ConfigProvider. `enabled`,\n`saving`, `unavailable` and `locale` below are application state; do not create a\nnested provider or local theme just for schedules, permissions or status toggles.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` is neutral-bold, never business-success green. `switch.off.*` has a\nstrong thumb, readable label and meaningful boundary so enabled OFF cannot be\nmistaken for disabled. The source defines paired track/thumb/label/border roles\nfor normal, hover, pressed, focus, loading and disabled; normal and `size=\"small\"`\nuse the same light/dark palette and existing native geometry. Native thumb\nposition, `aria-checked`, labels and the separate focus ring provide non-color\ncues. Short EN/VI state labels use the existing source typography, not a patched\nheight or a consumer font declaration.\n\nAntD4 supports only one shared thumb/label pair, no pressed track paint and no\nexplicit disabled color pairs. Its spinner foreground and translucent green\nthumb shadow are also not configurable as paired parts. The companion CSS closes\nthose evidenced gaps, while normal/hover track paint stays in native aliases.\n`opacityLoading: 1` removes native loading/disabled dimming. Disabled ON uses\n`color.background.neutral.bold.pressed` with inverse thumb/label; disabled OFF uses\nthe disabled track, subtle thumb/label and bold boundary. Native checked position,\ndisabled behavior and cursor remain unchanged; both values must be readable.\nLoading retains the current normal checked pair and a high-contrast native spinner, including when both\nloading and disabled props are set. It never predicts or changes the saved value.\n\nKeep native controlled binding, `change` callback and keyboard operation. The\nnative button is disabled during loading; pending/disabled activation must not\nsave twice or update checked state. Business save operations and errors remain\napplication-owned. Test both sizes, OFF/ON loading and disabled states, EN/VI labels,\ncallback counts and a delayed controlled save. No consumer `.ant-switch` patch,\npalette literal or custom Switch implementation is necessary.\n\n### Contrast, links and native Segmented\n\nThe [Source contrast and link rules](/foundations/styles/color/accessibility/)\nare authoritative for every text/label/tag and effective background in both themes.\nRead-only IDs, titles, dependency names and status values must not use disabled\nroles. Use paired semantic status text/fills, not arbitrary hue tags or inverse\ntext over subtle fills. Normal text requires 4.5:1, large text 3:1 and meaningful\nboundaries 3:1 at rest, hover, pressed and selected states, including composites.\n\nAnchors, Typography links, link Buttons and prose links have no underline by\ndefault, including hover. `.bh-link-underline` is the sole explicit opt-in.\nKeep `color.link`/`color.link.hover` and Source focus rings; never mute a link\ninto metadata. Ordinary prose/document links use Source semibold as a persistent\nnon-colour cue; explicitly opt an authored link into underlining when its\nsurrounding prose is already semibold. Navigation and native link Buttons keep\ntheir existing component typography.\n\nUse native Segmented through this same root provider and companion CSS. Source\nremoves the opaque `::after` label overlay and applies paired backgrounds directly\nto stable item hover/pressed/selected-hover states. While AntD's native thumb is\npresent during motion, these opaque item fills are suppressed so they cannot\ncover it. Native selection and keyboard behavior remain unchanged.\nNever add consumer state paint or synthetic selected items.\nThe selected item and moving thumb use the native `boxShadow` alias for an inset\n`border.width.default` / `color.border.bold` boundary that identifies selection\npersistently without covering the label.\nThe [live native matrix](/foundations/styles/interaction-states/#live-native-switch-states)\nincludes all sizes, enabled/disabled and selected/unselected items for hover,\npress, click and keyboard verification. Follow the\n[spacing, truncation and motion invariants](/foundations/styles/interaction-states/#label-spacing-and-motion-invariants);\nhover must never obscure text or be the only way to expose information.\n\nKeep the size-specific native Segmented label `line-height`; do not apply a\nfont shorthand that resets it. The default toolbar Input, Segmented and Button\nmust share their native control center, including wrapped toolbar groups.\nFor metric rows, use headerless native Cards with `bh-ant-subgrid-card` in a\nparent grid with two shared automatic rows. Compose label/icon first and\nvalue/actions second, retaining native padding, source gaps and wrapping.\nUse `bh-icon-slot` with `data-bh-size=\"responsive\"` only for passive indicators\nbeside small responsive icon Buttons; it supplies matching geometry, not an action.\nDo not position labels or icons with manual pixel offsets to compensate for a\nnative line-box or shared-row defect.\n\n\n### Companion CSS and structural classes\n\nUse component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title\ntypography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas,\nresponsive Tour placement, reduced motion and neutral Badge count without recoloring error dots.\nApplication selectors and palette overrides belong neither in that CSS nor in a dashboard theme.\nConsumers retain genuine portal layout and scrolling mechanics only. Framework paint\nand typography fixes belong to the package, not duplicated consumer overrides.\n\nBordered Descriptions clip cell backgrounds inside the native rounded frame instead of\npainting over its left corners. Header-only Cards omit the orphan header/body divider\nand retain all four rounded corners; Cards with body/cover/actions keep native separation.\nBordered hoverable Cards keep `color.border.bold` plus `elevation.shadow.raised` on\nhover and keyboard focus, rather than AntD4's transparent hover border. Focus also\nuses the standard outline/offset; the application still owns keyboard action semantics.\nThese framework fixes are automatic, not per-page overrides.\n\nNative Search, Input addon buttons, compact InputGroup and horizontal Space.Compact\nshare an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,\nadjacent borders overlap once, exposed corners use `radius.control` and touching corners stay zero.\nSource font roles are retained. Small Vietnamese fields/actions grow together to 26 px;\ndo not clip accents or shrink type to force 24 px. Default actions share field\nerror/warning/disabled borders; primary/danger actions retain their semantic roles.\nClear icons keep an icon-sized line box so they cannot inflate affix wrappers.\n\n`bh-ant-tag-large` on a Tag selects the source large label (24px minimum, 8px inline padding);\nthe default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.\n`bh-ant-tree-fill` on an actual Tree fills a bounded flex host, including below an\nintrinsic summary. Root and list establish the min-height-zero chain; only the\nnative list holder scrolls, preserving its keyboard scroll target. Do not pass a\nfixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.\nKeyboard-navigation consumers bind the native `activeKey` / `onActiveChange` pair:\nstate `ref<TreeProps['activeKey']>()`, then `:active-key=\"activeKey\"`\nand `@active-change=\"activeKey = $event ?? undefined\"`. AntD 4.2's uncontrolled\nactive-change path does not retain the requested node; a CSS fill opt-in cannot\nsupply that navigation state.\n\nFor data inspection, bind `width=\"var(--bh-ant-overlay-width)\"` and apply\n`bh-ant-inspection-modal` or Drawer `rootClassName=\"bh-ant-inspection-drawer\"`.\nAdd `bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` only for an explicit\ncontent-heavy variant. The variable selects `layout.overlay.default` / `.wide`, and `.mobile`\nbelow `breakpoint.lg`. Short confirmations and navigation drawers retain their own widths.\nThe Modal's `max-width: 100%` caps that width to its native scrolling wrap, which\nexcludes the vertical scrollbar. Do not replace the cap with `100vw` or hide\nhorizontal overflow: the mobile width token may fill the viewport, but the actual\nModal must still fit its available containing block.\nFullscreen modes are Modal `wrapClassName=\"full-screen\"` and Drawer\n`rootClassName=\"fullscreen\"`; AntD4 Modal has no `rootClassName` prop. These preserve\nbounded scroll mechanics, not decoration.\n\n### Native field names\n\nBind a real `<label for=\"…\">` to the native Select's explicit `id`, or use the\ncorresponding native Form Item label association. In AntD4, an `aria-label` on\nSelect can name its outer generic wrapper while leaving the actual combobox\nunnamed. Check the combobox's accessible name and native label activation, not\njust an attribute on a component root. Use Vue `useId()` plus a row identity for\nrepeated fields; do not add a wrapper or an attribute-copying observer.\n\n### Verify the actual framework\n\nExercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated\ninputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals,\nexpanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message,\nModal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus,\ntouch hit areas, reduced motion, narrow Tour and focus return. Use\n**ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** in controls, tags and rows.\nCompilation alone does not establish those rendering/interaction outcomes.\n\n\n## Spacing\n\nAnt Design Vue sizes come from `sizeUnit` and `sizeStep`. Keep both at 4, so `size` is 16 px. The theme then sets each size from a [spacing](/foundations/styles/spacing/) token.\n\n| Beehexa token | Value | Ant Design Vue tokens |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` and `space.1000` have no Ant Design Vue token. Use their CSS variables in your own styles.\n\nProps that take a number, such as `size` on `a-space` and `gutter` on `a-row`, take pixels. Use a value from the scale: `<a-space :size=\"8\">`.\n\n## Control height\n\n| Beehexa token | Height | Ant Design Vue token | Component prop |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | None |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nThese are Ant Design Vue’s own heights. The theme still sets each one from its size token, so a change to the token reaches the components. See [Size and density](/foundations/styles/size-and-density/).\n\n## Breakpoints\n\n**Override the `screen*` tokens with the Beehexa <a class=\"bh-link-underline\" href=\"/foundations/styles/layout/breakpoints/\">breakpoints</a>.** The default Ant Design Vue values are different (576, 992, 1200 and 1600 px).\n\nThe `Min` and `Max` tokens are computed from the defaults, not from your overrides. Set them too: each `Max` is the next breakpoint minus 1.\n\n| Beehexa | Value | Ant Design Vue tokens |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue has six breakpoints and Beehexa has four, so `sm` switches with `md`, and `xxl` with `xl`. Use the `xs`, `md`, `lg` and `xl` props of `a-col`.\n\nThe props of `a-col` and the responsive `gutter` of `a-row` then switch at the Beehexa widths. Do not use `xxxl`: its media query is malformed in Ant Design Vue 4.2.6 and never matches.\n\n## Grid\n\nAnt Design Vue divides a row into 24 parts. The Beehexa [grid](/foundations/styles/layout/grid/) has 4, 8 or 12 columns, and each one fits 24 exactly.\n\n| Beehexa grid | Window | `a-col` span |\n|---|---|---|\n| 4 columns | Below 768 px | Beehexa span × 6 |\n| 8 columns | 768 to 1023 px | Beehexa span × 3 |\n| 12 columns | 1024 px and up | Beehexa span × 2 |\n\n| Layout | Beehexa spans (4 / 8 / 12 / 12) | Props of each `a-col` |\n|---|---|---|\n| Cards, 1 to 4 a row | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Main panel | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Side panel | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Summary tile | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nAnt Design Vue rows have no gutter by default. Set it from the spacing tokens, and set the page margin on the content area.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## App frame\n\n| Region | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Side navigation, open | 280 px | `<a-layout-sider :width=\"280\">` |\n| Side navigation, collapsed | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nThe header is 64 px by default and has no token for its height, so set it in the header’s style.\n\nThe `breakpoint` prop of `a-layout-sider` uses fixed widths that ignore the `screen*` tokens. Do not use it. Set `collapsed` from your own media query and the user’s choice: open from 1024 px, collapsed to the rail when the user asks, and the choice remembered. Below 1024 px, hide the sider and show the menu in `a-drawer`.\n\nSee [Layout](/foundations/styles/layout/) for the frame.\n\n## Interactive table rows\n\nBind `data-bh-interactive=\"true\"` through `customRow` only when the complete row\nalready has an activation handler. The source companion owns the pointer cursor;\nnative selection keys/classes retain their selection recipe. Preserve accessible\nrow actions, keyboard behavior and actual record activation rather than replacing\nselection with a custom outline.\n\n\n## Native composition and optional variants\n\nUse the real native component. These opt-ins do not authorize a div-based\nreplacement, a skin-only wrapper, or copying Card/Button geometry into the app.\n\n- Native Card's `hoverable` prop remains optional. `data-bh-selected=\"true\"`\n adds a selected fill and independent inset cue; omitting it restores the base.\n In a composed selectable Card, `data-bh-card-action=\"primary\"` on the primary\n native text Button retains `aria-pressed` and keyboard focus without duplicating\n the outer Card's selected frame. Independent actions retain ordinary Button paint.\n- Reuse `bh-data-accent` with an existing semantic `data-bh-status`, `data-bh-band`,\n `data-bh-metric`, `data-bh-job-type` or `data-bh-priority` for an optional leading\n edge on a real Card. It adds no selection or hover behavior. A status/category\n edge survives selection; keyboard focus remains a separate outside outline.\n Bind the discriminator appropriate to that mark rather than conflating status\n with categorical identity. Labels are still mandatory.\n- `data-bh-layout=\"content\"` on a real Button allows a multiline composed label:\n auto height, normal wrapping, start alignment and the source default-control\n minimum height. Native props, padding and keyboard activation remain native.\n Use ordinary Button size/block props when they suffice.\n- `bh-ant-shell-region` removes native Header/Footer padding only when the region\n already contains the composed app header/footer. It does not change native\n height, paint or the surrounding responsive page-region layout.\n- `bh-card-link` on a real navigation anchor wrapping Card removes competing\n link paint/underline and supplies source keyboard focus, not Card skin.\n- `bh-ant-card-action-row` uses the native Card title/extra slots with a shrinkable\n leading track and reserved trailing action. Source head inset stays consistent\n across Card sizes; the real link remains a flexible inline title/metadata row.\n See [application content](/tools/application-content/#semantic-content-and-genuine-composition).\n- `bh-ant-metric-tooltip` on a native Tooltip overlay and `bh-metric-tooltip`\n on its semantic title-slot host separate date/header, metric definition list and\n explanation. The token-backed readable width is capped by the viewport; native\n popup placement, theme, keyboard and touch behavior stay with the actual owner.\n\nBusiness components may own data, state, behavior and meaningful composition of\nthese primitives. Inventory and remove redundant replacement components and every\nobsolete caller/import/export. Generated rich content must mount real native\nenhancement controls when the host framework permits it; a producer stylesheet\nalone is not evidence of missing native capability.\n\n\n### Operational and composed native content\n\n`Steps[data-bh-operational=\"true\"]` uses success/info/danger/subtle for native\nfinish/process/error/wait states. It leaves categorical navigation Steps unchanged.\nAn actual Step's `data-bh-skipped=\"true\"` adds a dashed tail in either orientation;\nthe caller retains ordering and the relationship's meaning. Custom icon slots do\nnot require rebuilding the Steps primitive.\n\n`Result[data-bh-layout=\"step\"]` retains a composed report's icon-and-title header\nrow, with subtitle/content and extra/actions below at full width. It only changes\nnative layout/padding; status paint and native slots remain native.\n\nThe native Tree title `data-bh-highlighted=\"true\"` is a temporary locator cue,\nnot a selected key or keyboard focus. Native selected/disabled treenodes suppress\nit; the source outline does not change title geometry.\n\nUse `bh-partner-logo-image` on a real Image for connector/brand assets.\nBind only the Source partner-image height and `width=\"auto\"`; native Image plus\nthe adapter preserves its intrinsic aspect ratio without a square frame or crop.\nActual identity Avatars stay native. Do not use brand hue as operational status.\n\n### Native Image preview\n\nThe official Image `zIndexPopupBase` and `zIndexPopup` tokens use `z-index.modal`.\nThat alone cannot clear an owner nested above it: AntD4.2.6 Preview drops\nboth declared Dialog `zIndex` and `wrapProps`. The setup composable\n`useNativeImagePreviewContainer(labelGetter)` from\n`@beehexa/ant-design-vue-tokens/image` owns the official lazy body portal:\npass its getter to native `preview.getContainer`. It names the real native\ndialog, reacts to locale changes and captures a layer above live owners on\neach opening, excluding its own previous layer. A closed portal is not an\noverlay owner. Its observer/container are disposed on unmount. Native Image\nstill owns zoom/pan, keyboard close and focus return; there is no custom viewer.\n\n\n`bh-ant-card-flush` opts a real Card body out of inset only for an edge-to-edge\nembedded editor, canvas or composed pane. Ordinary cards retain native padding.\nReuse `bh-ant-fill-card` and `bh-ant-fill-spin` for existing bounded flex hosts;\ndo not create parallel fill aliases or restore private consumer selectors.\nThe flush Card clips embedded paint to its native rounded frame. A direct\nbrowser iframe child has its UA border removed to avoid a second frame;\nsandbox/srcdoc and embedded-document behavior remain browser-owned.\n\n`semanticTableComponents` from `@beehexa/ant-design-vue-tokens/table` extends\nthe real Table's public `components` API. A column's `customCell` may return\n`{ scope: 'row' }`; its body cell becomes a semantic `th`, forwarding the native\nattributes and slot. Other cells remain `td`. AntD4 has no row-scope column prop\nand its body-cell CSS only targets `td`, so the source companion supplies the\nmatching row-header size/border/hover/selection recipe for this actual HTML\nsemantics gap. Native columns, rows and Summary remain native.\n\nAn actual native ListItem may opt into `data-bh-interactive=\"true\"` for a rich\nactivation row when no narrower native control meets its content contract.\nThe opt-in supplies hover/pointer/focus only; the consumer supplies a real action,\nkeyboard activation and accessible role. Do not nest competing interactive targets.\n\n\nConnector and partner brands share `content.partner-logo.image-size` as their\nrendered height, not a width cap. Keep natural width; wrap rows when needed.\nSemantic icon-height roles likewise preserve proportional width and hit targets.\nNative Table already styles `tfoot > tr > th` geometry at each size; the companion\nadds only its missing Summary row-header border and semantic weight/alignment.\n`a-typography-link[data-bh-target=\"responsive\"]` uses the source minimum24px\ntarget, increasing to44px only on coarse pointers; it adds no link skin.\n\n\nFlush Cards clip embedded paint to their actual rounded frame. Native Drawer\nfooters retain their canonical inset or the device's safe-area inset, whichever\nis larger. `Spin[data-bh-mode=\"nonblocking\"]` removes the native veil/pointer\nblock only for progressive content that remains inspectable; omit it for actual\nblocking work such as export. This does not change spinner timing or graph data.\n\n\n## Read-only segmented native Progress\n\nFor “Step 3 of 7” feedback, use the real native `Progress` with its actual\n`steps` and `percent`. This is not navigation: do not substitute `Steps`,\n`Segmented`, a fabricated row of marks, or another progress engine.\n\nAntD4 `size=\"small\"` deliberately renders each step as a **2 × 8px vertical\nfragment**. Its native `[width, height]` tuple means **per-segment** geometry.\nThe source helper resolves `content.step-progress.segment-width` and\n`segment-height` to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Step {{ props.index }} of {{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n status=\"normal\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nThe feature owns the real positive total, current index, status text and\nbusiness transitions. The helper supplies geometry only; native Progress\nowns the rendered count and active marks. Hide the redundant bar from assistive\ntechnology only when adjacent text already conveys the same progress.\n\nFor current-position feedback, explicitly set `status=\"normal\"`: reaching the\nlast authored group does not mean the operation succeeded. Render failure or\ncompletion status only from actual workflow evidence, independently of the\nindex. A one-group workflow still has one real mark; an absent/zero total has no\nbar. Do not manufacture a denominator from screenshot geometry or API-step count.\n\n`bh-ant-step-progress` opts that native root into intrinsic inline width,\nzero native outer margins, the source `content.step-progress.gap` (4px at\nroot16), and wrapping without a trailing item margin. CSS does not replace\nthe native size API or set per-mark width/height. The bar follows the status\non a wide row and wraps within the available width on mobile.\n\nOmit the class and helper to retain the native base. Ordinary percentage,\nupload and countdown progress do not opt in. The shared live matrix below\nincludes a real native no-opt-in comparison, editable total and first/middle/\nfinal controls; check both root16 and root20, light/dark and narrow widths.\n\n## Thin navigation Progress\n\nFor route-loading feedback use real native `Progress` with `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` and its native size tuple.\nUse `border.width.focused` for the thin line and `color.brand.yellow` for its optional\nbrand stroke. The application owns fixed viewport positioning at `top: 0`, width and\nits layer from the seven [z-index](/foundations/styles/z-index/) tokens; the adapter removes AntD's inline baseline gap and outer margins,\nso the actual ink begins at the allocated top edge without negative offsets.\n\nProgress reflects completed navigation milestones, not invented network percentages.\nKeep the previous page while guards and route chunks resolve, advance to100%, and await\nthe actual finite native width transition before committing the new page. Cancellation,\nerrors and superseding navigation must clear their own progress without clearing a newer\nrequest. The source width transition uses `motion.duration.default` and\n`motion.easing.linear`; reduced motion removes it. Keep a named progressbar with actual\nmilestone values, and never use a page-covering scrim just to load a route.\n\n## One native control family, distinct roles\n\nUse native default Button for compact bordered utility triggers (including\nlanguage and theme), with the same native size as adjacent page controls.\nUse the public `#icon` slot and one label child; icon-only Buttons still need\nan accessible name. Do not disguise `type=\"text\"` globally as a default Button.\nA frameless account/avatar menu legitimately uses `type=\"text\"`, a real Avatar\nand native Space: center it in the row rather than inventing a shell skin.\n\nButton small/default/large use source control heights24/32/40px at the nominal\nroot; typography is label-small for small and label-default otherwise.\nButton/Input/Select and side navigation items use `radius.control`; Select popups and menus use `radius.overlay`.\nThe numeric theme/root observer and rem CSS scale together.\nAntD4 only inserts margin for `.anticon` siblings, not Lucide SVGs in `#icon`;\nthe source supplies one space100 flex gap for all real Buttons and removes\nthe competing native/loading-icon margin. No shell-specific class is needed.\nNative default/primary/text/link, disabled/loading, hover/pressed and keyboard\nfocus remain distinct. `data-bh-target=\"responsive\"` adds touch minimums only\non coarse pointers. Open Dropdown/Menu state is not Button selection; keep\n`aria-expanded`, menu keyboard behavior and focus return in the actual feature.\n\nThe primary neutral-bold/inverse pair is intentional: graphite in light mode,\nlight graphite with dark text in dark mode. A pale dark-mode Continue action\nis not a reason to recolor every primary or text Button blue. Link actions\nretain the source link palette; default utility actions remain bordered.\n\n| Native variant | Source role and state contract |\n| --- | --- |\n| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |\n| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |\n| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |\n| Danger default / dashed / text / ghost | Readable danger text; outlined variants retain danger borders. Available non-link variants use danger-subtle hover/pressed fill. Ghost starts transparent, never with the solid on-bold label. |\n| Link / text | Distinct link/frameless roles, not a disguised default Button. |\n| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |\n| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |\n\nAntD4 paints a **resting lower shadow** from `controlOutline` on primary,\n`controlTmpOutline` on default, and `colorErrorOutline` on danger-primary.\nThose names are not exclusively keyboard-focus inputs. Reusing the global\nblue focus alias there produces a stranded blue stripe even after all\nanimations finish. The source scopes these three Button component aliases\nto transparent; it does not clear the global focus role or set its width\nto zero.\n\nNative Button keyboard focus instead reads `colorPrimaryBorder` and\n`lineWidthBold`. Its component overrides use source focus color/width.\nThe companion's enabled `:focus-visible` rule supplies the independent,\ngapped source outline/offset. Default/dashed state fills and the separate\ndanger text/on-bold pairs are the remaining native-token gaps; source CSS\nhandles only those cases, excluding disabled controls and genuine selection.\nApps must not add a local shadow/border reset or a focus suppression.\n\nThe compact native dock uses `bh-control-group` and `data-bh-variant=\"dock\"`\non Space. Its neutral text-action paint excludes danger, ghost, real selected\ntoggles, loading controls and disabled anchors, so the same role/state contracts\nstill apply inside the dock. Open actions may use `aria-expanded`; genuine\ntoggles use `aria-pressed` and retain the selected fill plus structural indicator.\nAntD4 href Buttons render anchors with a native `disabled` attribute, not the\n`:disabled` pseudo-class or a generated disabled class. Native enabled hover/active\nselectors still match those anchors. The companion recognises `[disabled]` and\n`aria-disabled=\"true\"` with sufficient native-state specificity: disabled text\nstays disabled; fill/border roles match the native non-href Button for solid,\ntext/link, ghost and danger/ghost combinations. Set the native `disabled` prop, supply\n`aria-disabled=\"true\"` and `tabindex=\"-1\"` for an unavailable href Button; native\nAntD click handling blocks its navigation. ARIA or CSS alone never disables a\nlink. Do not manufacture AntD classes or replace genuine links with pointer-only\nhandlers.\n\n### Live native state and progress matrix\n\nUse the site theme/language controls and browser root font preference.\nChange Button size, hover/hold a press, Tab/Enter/Space through available\nactions, and inspect actual activation counts. Loading/disabled Buttons and\ngenuine disabled href variants must not activate, including inside the compact dock.\nToggle its selected action and check danger hover/pressed without neutral repaint.\nThe long native Card title wraps independently of its extra action on mobile.\nSwitch examples include loading and disabled together; loading retains checked\npaint and the spinner while callbacks stay blocked. Progress uses the same actual\ncount/index for its opt-in and no-opt-in renderers.\n\n<NativeControlsDemo />\n\n\n### Native mobile composition and bounded content\n\nThe adapter stretches joined Input/Search/compact-group fields and their actions\nas one row, including validation, disabled states and coarse-pointer targets.\nIcon-only Buttons keep their native size proportions; on coarse pointers both\naxes reach `size.target.touch`. Content-layout Buttons retain multiline text\nwithout overriding explicit or responsive touch minimums.\n\nBelow `breakpoint.md`, every native Card header/meta title wraps, including\ndescendant Typography ellipsis, Tags and Space. This is global readable content,\nnot an optional consumer override. Header extras remain available. Standard\nTimeline dots, tails and custom dots align to the first content line; wrapped\nevent content stays in the native timeline column. Label/alternate/right\ntimelines retain their distinct native alignment.\nFor event rows with inline native small Buttons, bind `data-bh-layout=\"actions\"`\non the Timeline and center the native Flex row. This shares the first line's\nallocation with `size.control.small` (or `size.target.touch` on coarse pointers),\nso the dot/tail do not stay above text beside a taller touch action. Plain text\ntimelines keep their normal source line box. AntD4 Timeline exposes no component\nsizing token; this bounded composition does not change label/right/alternate modes.\n\nAntD4 Flex does not forward arbitrary `role`, `aria-*`, `data-*` or DOM listeners.\nDo not put required semantics, source opt-ins or keyboard handlers on it. Use\nnative Space/Typography where appropriate, or retain a real semantic host with\nminimal structural flex/grid CSS. Do not introduce a forwarding wrapper.\n\nUse `bh-content-toolbar` and `bh-content-toolbar__group` on actual intrinsic\ntext-editor toolbar hosts; the source owns spacing, padding, wrapping and mobile\ncontrol minimums. Graph navigation instead uses the compact Source dock floating\ninside its drawing viewport, default lower-left, never a full-width header band.\nFollow the [canvas dock contract](/tools/mermaid/#shared-drawing-viewport-and-dock)\nwithout copying graph-only actions to text editors. These are shared recipes,\nnot page-specific skins. Keep hosts and flex children shrinkable with `min-width: 0`.\n\nBind `bh-ant-fill-spin` through Spin's **wrapperClassName**, not its class:\nthe nested-loading wrapper carries the bounded height. Drawer fill/flush modes\ntraverse the native content-wrapper/content/wrapper-body chain; header/footer\nremain intrinsic and the body owns the remaining space. Tabs fill only their\nown active pane. Consumers supply the actual bounded parent, not guessed\nviewport-minus-header heights. Monaco/Mermaid observe that host's dimensions\nwithout replacing the editor model or resetting existing chart pan/zoom.\n\n",
|
|
2121
|
+
"body": "import NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` owns the reusable Ant Design Vue 4 adapter.\nUse its typed ESM API and companion CSS, backed by `@beehexa/design-tokens`.\nFrameworks are peers: `ant-design-vue@^4.2.6` and `vue@^3.3.0`; neither is bundled.\nUnreleased `0.0.0` packages use explicit local development references; only the authorized\nrelease runner stamps real package versions. Do not copy a theme palette into an application.\n\n**Beehexa tokens are the source of truth. Ant Design Vue only reads them.**\n\nThis page is the only place where the Beehexa foundations meet Ant Design Vue. The foundation pages stay the same whatever the product is built with.\n\n## Usage\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})`\nreturns the native `ThemeConfig`. Recompute on theme/language/root-font changes;\neach call returns a fresh object. `locale` selects source typography, not messages.\nThe setup-only source observer measures one inert1rem probe and cleans it up.\nThis keeps numeric native size/type/radius APIs aligned with scalable CSS units;\npixel-based borders and breakpoints do not scale. The pure factory reads no DOM.\nPass the appropriate AntD language pack through `ConfigProvider.locale`, and configure the\ndate library separately. Render native `useMessage`, `useNotification` and `useModal`\nholders in a feedback host inside the sole root provider. Bind application notify facades\nto those hook APIs; never use detached raw static feedback APIs. The factory sets\n`hashed: false` because AntD4 contextual message/notification holders otherwise retain\nstale hashes across theme/locale changes. Keep an existing notice open while switching\ndark/Vietnamese to light/English; its typography and paint must follow the active theme.\n\nKeep document `data-theme` and `lang` synchronized for teleported overlays. Import\ncompanion CSS after application/framework styles. Use a native 16px root and 14px body;\nnumeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.\n\n## Overlay ownership and bounded native content\n\nTriggered popups use `getAntDesignVuePopupContainer` to stay inside their nearest native\nModal/Drawer or custom `data-bh-overlay-owner` host. Native Modal/Drawer roots remain\nbody-hosted for viewport geometry. Provider-bound modal facades default their invocation\n`zIndex` through `getAntDesignVueModalZIndex()` while preserving explicit caller values;\nthis keeps keyboard/awaited confirmations above their live owner. Nested drawers use\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` as `rootStyle.zIndex` so\nsurface and mask move together; AntD4's `zIndex` prop styles only the content wrapper.\nBody-teleported fullscreen editors/images and fullscreen native Modals capture\n`getAntDesignVueFullscreenZIndex()` before mounting their root. This uses\n`z-index.modal` with above-owner ordering, not a separate fullscreen tier.\nMark custom roots only once they are active, avoiding self-counting. The seven\napproved tiers have no fullscreen450 or readiness650 token; blocking loading\nalso uses `z-index.modal`. Keep owner-relative ordering below\n`z-index.tooltip` and `z-index.toast`; reserve `z-index.spotlight` for tours.\nTour's inline native default also requires its public\n`zIndex` prop bound to `z-index.spotlight`.\n\nModal frames and Drawer content wrappers intentionally inherit `pointer-events: none`;\nnative content restores pointer entry only for its own subtree. The companion CSS also\nrestores `pointer-events: auto` on actual native popup roots portaled into either frame\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and\nTour). Frames remain pointer-transparent outside content and popups; native masks,\nfocus traps and dismissal remain unchanged. Do not relocate popups into a scrolling\nbody, change z-indices or add page overrides to solve this inherited-pointer gap.\n\nThe companion CSS provides opt-in native structural contracts, not application selectors:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: bounded body, intrinsic header/footer,\n optional zero body padding; bind through `rootClassName`. Keep the native body's\n default automatic overflow rather than suppressing access when intrinsic\n controls or preserved pane minima exceed a short allocation. Do not repeat\n body flex/overflow styles at consumers.\n- `bh-ant-fill-modal`: bind through native `wrapClassName`, not the unsupported\n Modal `rootClassName`. The real fixed overlay allocates a token-inset bounded\n dialog; its content/focus wrapper and body fill around intrinsic header/footer.\n Width remains the caller's native width, bounded by the available overlay.\n Use for interactive renderer inspection, not short confirmations. The renderer\n viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.\n- `bh-ant-fill-tabs`: bounded native wrappers and active pane. Nested tabs opt in separately;\n `bh-ant-fill-tabs--scroll` enables pane scrolling and `bh-ant-tabs-mobile-inset` adds the\n source mobile inset. Inactive panes stay hidden.\n Inner tabs inside that scrolling document can instead add\n `bh-ant-fill-tabs--document`: wrappers keep intrinsic content height and grow\n into adequate space, without clipping a renderer after long metadata exhausts\n the allocation. The outer native scroll pane owns vertical access; do not put\n both modifiers on the same root. Only the interactive renderer host receives\n `--bh-layout-renderer-minimum-block-size`, not outer panes or static fields.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: carry an existing bounded host through native wrappers.\n Static document/tree/list content can remain nonshrinking and overflow-visible\n inside the native Card's existing scroll owner. Do not pair that Card scroller\n with a second zero-height inner scroller when its header exhausts a tiny pane.\n This document composition adds no SDK-readable minimum to ordinary fields.\n- `bh-ant-fit-empty`: only on a real native Empty inside an already allocated\n placeholder. Native illustration choice alone does not guarantee a fit in a\n short host. The opt-in removes outer and description paragraph margins (the\n parent owns its inset), bounds the root and lets the image row shrink before\n the intrinsic description/footer. The image keeps its native preferred height\n and removes its inline baseline strut; neither enlarged artwork nor paragraph\n margins consume a tiny host. It adds no readable-renderer minimum, palette,\n text typography, image replacement or overflow suppression. Preserve the parent's one genuine\n scroll owner when even the intrinsic text/actions cannot fit. Ordinary\n document/list/table empties omit it and retain native defaults. The live native\n family below compares 2/4/12rem allocations, the simple illustration and the\n unchanged no-opt-in base.\n- `AntDesignVuePopupScope`: only for retained renderers moved across native\n overlay owners. Wrap the existing subtree outside its Teleport and pass the\n existing HTMLElement root as `owner`; keep owner attributes on that actual\n root. Keep a real element as the consuming component's root when callers use\n `v-show` or other element directives; put the scope inside that existing root,\n not in its place. A stable native popup holder moves with the owner because\n AntD4 caches the first portal container. Nested scopes inherit the enclosing target.\n Native ConfigProvider theme/locale, menus, focus and no-trigger body portals\n remain native; no editor/model/graph rekey or global popup z-index is involved.\n Opt-in `feedback` (default `false`) sends trigger-less containers to the mounted\n scope host instead, so a `notification.useNotification()` / `message.useMessage()`\n holder inside the scope follows the overlay owner into native fullscreen.\n Fullscreen capture handlers yield menu/listbox Escape via\n `isAntDesignVueMenuEvent(event)` before closing their own overlay.\n Native Drawer portals can use the same stable host through the public scoped\n slot: `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` with\n `<a-drawer :get-container=\"getContainer\">`. HTML attributes on the scope\n belong to that actual portal host; conditionally expose `role=\"dialog\"`,\n `aria-label` and `aria-modal` only while open when the native Drawer drops\n these attributes. Do not add a second dialog wrapper or mutate native DOM.\n AntD4 Flex also drops attributes other than class/style: use an existing real\n semantic element when a controlled ID, region name or tab stop must survive.\n- Independently selectable, disclosable choices compose actual Card title slots\n with sibling native disclosure and selection Buttons plus a shortcut Tag.\n Keep Card headers noninteractive; each Button owns only its own action.\n AntD4 Collapse headers retain an ancestor `role=\"button\"`/tab stop even in\n icon-only mode, so do not nest independently actionable choices there.\n Native conditional Card body slots own expanded content; no private header\n role/keyboard patch or special choice-collapse CSS is needed.\n- `bh-ant-inspection-descriptions`: source desktop label minimum and mobile stacked rows.\n- `bh-ant-data-table`: generic pending/success/error row classes plus public `customCell`\n markers `data-bh-cell-interaction=\"editable|readonly\"` and `data-bh-cell-state=\"changed\"`.\n Native selection outranks operational row paint; changed cells keep diff paint on hover.\n `bh-ant-table-nowrap` is an independent horizontal-content opt-in.\n Add `bh-ant-row-indicators` for a `border.width.accent` inset danger marker on the\n first cell of `bh-ant-row-error` rows. This non-colour issue cue does not change\n column geometry, override selection or replace status text/icons.\n- `data-bh-tone=\"warning\"` on a native Badge root selects\n `color.background.warning.bold` / `color.text.on-bold` for its count only.\n Native operational status dots keep their separate source semantics and circles.\n- Native Button `data-bh-target=\"touch\"` selects `size.target.touch` as minimum\n width/height without repainting it. `data-bh-target=\"responsive\"` applies the\n same target only for coarse pointers. Keep native type, size, disabled and\n keyboard semantics; no page-owned target sizing is needed.\n- Native Modal/Drawer close controls also use the root-scaled coarse-pointer\n target. Closable Modal headers reserve the whole target height and center the\n title beside it, so the close hit area never covers the first body control.\n Modal titles reserve that native control's lane only when it is present;\n short `closable=false` confirmations do not receive an empty title inset.\n- A native Flex span inside Button remains a flex layout rather than inheriting\n AntD4's ordinary inline text-span display. Keep semantic title/description\n content separate through native composition, not another button wrapper.\n- Pass the observed root to `tokenPixels(name, locale, rootFontSize)` for actual\n Avatar/Image/Space/Row numeric props, including compact dock gaps. Omitting that\n argument intentionally returns nominal16px-root pixels; it does not read the\n browser's current root. Child setup calls reuse the sole provider's readonly\n measurement, not another observer. Keep CSS dimensions on scalable source roles.\n\nKeep custom business data/slot meaning and host structure in the consumer, not\npresentation recipes. Do not recreate native selectors through per-page\n`:deep(.ant-*)`, global overrides or priority escalation.\n\n## Token mapping\n\n| Ant Design token | Beehexa token |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nUse the [Radius roles](/foundations/styles/radius/), not one radius for every\ncomponent:\n\n| Component | Radius token |\n| --- | --- |\n| Button, Input, Select trigger, Radio button, Segmented, side navigation item | `radius.control` (6 px) |\n| 24 px controls | `radius.control.small` (4 px) |\n| Items in a dropdown or submenu popup | `radius.item` (4 px) |\n| Tooltip, tag, badge count | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs and other in-page containers | `radius.card` (8 px) |\n| Dropdown, submenu popup, Select popup, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (circle), Switch, chip | `radius.pill` |\n| Full-width table, joined Search edges, fullscreen surface | `radius.0` |\n\nGroups with 4 px padding use 8 px outside; groups with 8 px padding use 12 px\noutside. The adapter pins these component aliases and the companion CSS covers\nthe badge, Switch, Segmented and Drawer cases that have no theme input.\nConsumers must remove competing corner overrides, not add `.ant-*` radius patches.\nExplicit Button `shape=\"circle\"` / `shape=\"round\"` props keep their native sizing\nand the `radius.control` corner. They are not avatar, Switch or chip roles.\n\nThe adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead\nof allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes\nand radios use `color.border.bold` while cards/tables use `color.border`. Layout header and\nsider sit on `color.surface.page`, separated from the content by a `color.border` line; the mobile\nnavigation drawer is a drawer on `color.surface.overlay`. There is no separate shell palette or nested isolated\ntheme. Use `font.body.default` for table data, `font.label.small` for headers/tags,\n`font.heading.medium` for modal titles and `font.heading.small` for drawer titles.\n\nNative Menu icons use the native `icon` slot, source icon box and a `space.050`\ntitle gap. Do not rebuild the icon/label row in a Space with a page-specific gap.\nTitle text uses `font.label.default` rather than the row-height line box, keeping\nVietnamese labels and adjacent title/tag content vertically aligned.\nNative Tree content keeps its icon and shrinkable title centered as one row.\nIf a custom title already includes its glyphs, leave `showIcon` off; AntD4 otherwise\nreserves another empty icon box. Native selection, expansion and keyboard ownership\nare unchanged. Apply required content roles to a semantic host, not AntD4 Flex.\n\n### Ant Design Vue 4 component contracts\n\n- Table reads `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` and\n `controlItemBgActiveHover`. AntD5 names such as `headerBg` and `headerColor` are ignored\n by AntD Vue 4.2.6 and must not be used.\n- Switch reads OFF tracks from `colorTextQuaternary`/`colorTextTertiary`, ON tracks from\n `colorPrimary`/`colorPrimaryHover`, its shared thumb from `colorWhite`, **both** labels\n from `colorTextLightSolid`, and disabled/loading opacity from `opacityLoading`.\n These are component-scoped mappings, not changes to global primary/text colors.\n AntD5 `trackBg`/`handleBg`-style names are not the AntD4 state API.\n- Menu reads `colorItem*`, `radiusItem`, `radiusSubMenuItem` and `colorActiveBar*`.\n Explicit `theme=\"dark\"` menus receive the same source roles. Selection has a visible bar,\n not a heavier label that shifts its neighbours or merely a changed fill.\n- Form controls share source outline/focus/disabled roles. Validation retains danger/warning\n text/icons and native state semantics. Do not replace meaningful input borders with divider\n hairlines.\n- Tag status presets are `success`, `processing`, `warning`, `error`; default is neutral.\n They use source foreground and outline pairs. Arbitrary hue presets are not status names.\n Badge counts are neutral; error/processing status dots retain their semantics.\n- Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface,\n scrim and overlay elevation. Progress is neutral by default and semantic on success/error.\n\n### Native Switch contract\n\nUse the native Switch inside the existing root ConfigProvider. `enabled`,\n`saving`, `unavailable` and `locale` below are application state; do not create a\nnested provider or local theme just for schedules, permissions or status toggles.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` is neutral-bold, never business-success green. `switch.off.*` has a\nstrong thumb, readable label and meaningful boundary so enabled OFF cannot be\nmistaken for disabled. The source defines paired track/thumb/label/border roles\nfor normal, hover, pressed, focus, loading and disabled; normal and `size=\"small\"`\nuse the same light/dark palette and existing native geometry. Native thumb\nposition, `aria-checked`, labels and the separate focus ring provide non-color\ncues. Short EN/VI state labels use the existing source typography, not a patched\nheight or a consumer font declaration.\n\nAntD4 supports only one shared thumb/label pair, no pressed track paint and no\nexplicit disabled color pairs. Its spinner foreground and translucent green\nthumb shadow are also not configurable as paired parts. The companion CSS closes\nthose evidenced gaps, while normal/hover track paint stays in native aliases.\n`opacityLoading: 1` removes native loading/disabled dimming. Disabled ON uses\n`color.background.neutral.bold.pressed` with inverse thumb/label; disabled OFF uses\nthe disabled track, subtle thumb/label and bold boundary. Native checked position,\ndisabled behavior and cursor remain unchanged; both values must be readable.\nLoading retains the current normal checked pair and a high-contrast native spinner, including when both\nloading and disabled props are set. It never predicts or changes the saved value.\n\nKeep native controlled binding, `change` callback and keyboard operation. The\nnative button is disabled during loading; pending/disabled activation must not\nsave twice or update checked state. Business save operations and errors remain\napplication-owned. Test both sizes, OFF/ON loading and disabled states, EN/VI labels,\ncallback counts and a delayed controlled save. No consumer `.ant-switch` patch,\npalette literal or custom Switch implementation is necessary.\n\n### Contrast, links and native Segmented\n\nThe [Source contrast and link rules](/foundations/styles/color/accessibility/)\nare authoritative for every text/label/tag and effective background in both themes.\nRead-only IDs, titles, dependency names and status values must not use disabled\nroles. Use paired semantic status text/fills, not arbitrary hue tags or inverse\ntext over subtle fills. Normal text requires 4.5:1, large text 3:1 and meaningful\nboundaries 3:1 at rest, hover, pressed and selected states, including composites.\n\nAnchors, Typography links, link Buttons and prose links have no underline by\ndefault, including hover. `.bh-link-underline` is the sole explicit opt-in.\nKeep `color.link`/`color.link.hover` and Source focus rings; never mute a link\ninto metadata. Ordinary prose/document links use Source semibold as a persistent\nnon-colour cue; explicitly opt an authored link into underlining when its\nsurrounding prose is already semibold. Navigation and native link Buttons keep\ntheir existing component typography.\n\nUse native Segmented through this same root provider and companion CSS. Source\nremoves the opaque `::after` label overlay and applies paired backgrounds directly\nto stable item hover/pressed/selected-hover states. While AntD's native thumb is\npresent during motion, these opaque item fills are suppressed so they cannot\ncover it. Native selection and keyboard behavior remain unchanged.\nNever add consumer state paint or synthetic selected items.\nThe selected item and moving thumb use the native `boxShadow` alias for an inset\n`border.width.default` / `color.border.bold` boundary that identifies selection\npersistently without covering the label.\nThe [live native matrix](/foundations/styles/interaction-states/#live-native-switch-states)\nincludes all sizes, enabled/disabled and selected/unselected items for hover,\npress, click and keyboard verification. Follow the\n[spacing, truncation and motion invariants](/foundations/styles/interaction-states/#label-spacing-and-motion-invariants);\nhover must never obscure text or be the only way to expose information.\n\nKeep the size-specific native Segmented label `line-height`; do not apply a\nfont shorthand that resets it. The default toolbar Input, Segmented and Button\nmust share their native control center, including wrapped toolbar groups.\nFor metric rows, use headerless native Cards with `bh-ant-subgrid-card` in a\nparent grid with two shared automatic rows. Compose label/icon first and\nvalue/actions second, retaining native padding, source gaps and wrapping.\nUse `bh-icon-slot` with `data-bh-size=\"responsive\"` only for passive indicators\nbeside small responsive icon Buttons; it supplies matching geometry, not an action.\nDo not position labels or icons with manual pixel offsets to compensate for a\nnative line-box or shared-row defect.\n\n\n### Companion CSS and structural classes\n\nUse component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title\ntypography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas,\nresponsive Tour placement, reduced motion and neutral Badge count without recoloring error dots.\nApplication selectors and palette overrides belong neither in that CSS nor in a dashboard theme.\nConsumers retain genuine portal layout and scrolling mechanics only. Framework paint\nand typography fixes belong to the package, not duplicated consumer overrides.\n\nBordered Descriptions clip cell backgrounds inside the native rounded frame instead of\npainting over its left corners. Header-only Cards omit the orphan header/body divider\nand retain all four rounded corners; Cards with body/cover/actions keep native separation.\nBordered hoverable Cards keep `color.border.bold` plus `elevation.shadow.raised` on\nhover and keyboard focus, rather than AntD4's transparent hover border. Focus also\nuses the standard outline/offset; the application still owns keyboard action semantics.\nThese framework fixes are automatic, not per-page overrides.\n\nNative Search, Input addon buttons, compact InputGroup and horizontal Space.Compact\nshare an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,\nadjacent borders overlap once, exposed corners use `radius.control` and touching corners stay zero.\nSource font roles are retained. Small Vietnamese fields/actions grow together to 26 px;\ndo not clip accents or shrink type to force 24 px. Default actions share field\nerror/warning/disabled borders; primary/danger actions retain their semantic roles.\nClear icons keep an icon-sized line box so they cannot inflate affix wrappers.\n\n`bh-ant-tag-large` on a Tag selects the source large label (24px minimum, 8px inline padding);\nthe default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.\n`bh-ant-tree-fill` on an actual Tree fills a bounded flex host, including below an\nintrinsic summary. Root and list establish the min-height-zero chain; only the\nnative list holder scrolls, preserving its keyboard scroll target. Do not pass a\nfixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.\nKeyboard-navigation consumers bind the native `activeKey` / `onActiveChange` pair:\nstate `ref<TreeProps['activeKey']>()`, then `:active-key=\"activeKey\"`\nand `@active-change=\"activeKey = $event ?? undefined\"`. AntD 4.2's uncontrolled\nactive-change path does not retain the requested node; a CSS fill opt-in cannot\nsupply that navigation state.\n\nFor data inspection, bind `width=\"var(--bh-ant-overlay-width)\"` and apply\n`bh-ant-inspection-modal` or Drawer `rootClassName=\"bh-ant-inspection-drawer\"`.\nAdd `bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` only for an explicit\ncontent-heavy variant. The variable selects `layout.overlay.default` / `.wide`, and `.mobile`\nbelow `breakpoint.lg`. Short confirmations and navigation drawers retain their own widths.\nThe Modal's `max-width: 100%` caps that width to its native scrolling wrap, which\nexcludes the vertical scrollbar. Do not replace the cap with `100vw` or hide\nhorizontal overflow: the mobile width token may fill the viewport, but the actual\nModal must still fit its available containing block.\nFullscreen modes are Modal `wrapClassName=\"full-screen\"` and Drawer\n`rootClassName=\"fullscreen\"`; AntD4 Modal has no `rootClassName` prop. These preserve\nbounded scroll mechanics, not decoration.\n\n### Native field names\n\nBind a real `<label for=\"…\">` to the native Select's explicit `id`, or use the\ncorresponding native Form Item label association. In AntD4, an `aria-label` on\nSelect can name its outer generic wrapper while leaving the actual combobox\nunnamed. Check the combobox's accessible name and native label activation, not\njust an attribute on a component root. Use Vue `useId()` plus a row identity for\nrepeated fields; do not add a wrapper or an attribute-copying observer.\n\n### Verify the actual framework\n\nExercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated\ninputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals,\nexpanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message,\nModal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus,\ntouch hit areas, reduced motion, narrow Tour and focus return. Use\n**ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** in controls, tags and rows.\nCompilation alone does not establish those rendering/interaction outcomes.\n\n\n## Spacing\n\nAnt Design Vue sizes come from `sizeUnit` and `sizeStep`. Keep both at 4, so `size` is 16 px. The theme then sets each size from a [spacing](/foundations/styles/spacing/) token.\n\n| Beehexa token | Value | Ant Design Vue tokens |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` and `space.1000` have no Ant Design Vue token. Use their CSS variables in your own styles.\n\nProps that take a number, such as `size` on `a-space` and `gutter` on `a-row`, take pixels. Use a value from the scale: `<a-space :size=\"8\">`.\n\n## Control height\n\n| Beehexa token | Height | Ant Design Vue token | Component prop |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | None |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nThese are Ant Design Vue’s own heights. The theme still sets each one from its size token, so a change to the token reaches the components. See [Size and density](/foundations/styles/size-and-density/).\n\n## Breakpoints\n\n**Override the `screen*` tokens with the Beehexa <a class=\"bh-link-underline\" href=\"/foundations/styles/layout/breakpoints/\">breakpoints</a>.** The default Ant Design Vue values are different (576, 992, 1200 and 1600 px).\n\nThe `Min` and `Max` tokens are computed from the defaults, not from your overrides. Set them too: each `Max` is the next breakpoint minus 1.\n\n| Beehexa | Value | Ant Design Vue tokens |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue has six breakpoints and Beehexa has four, so `sm` switches with `md`, and `xxl` with `xl`. Use the `xs`, `md`, `lg` and `xl` props of `a-col`.\n\nThe props of `a-col` and the responsive `gutter` of `a-row` then switch at the Beehexa widths. Do not use `xxxl`: its media query is malformed in Ant Design Vue 4.2.6 and never matches.\n\n## Grid\n\nAnt Design Vue divides a row into 24 parts. The Beehexa [grid](/foundations/styles/layout/grid/) has 4, 8 or 12 columns, and each one fits 24 exactly.\n\n| Beehexa grid | Window | `a-col` span |\n|---|---|---|\n| 4 columns | Below 768 px | Beehexa span × 6 |\n| 8 columns | 768 to 1023 px | Beehexa span × 3 |\n| 12 columns | 1024 px and up | Beehexa span × 2 |\n\n| Layout | Beehexa spans (4 / 8 / 12 / 12) | Props of each `a-col` |\n|---|---|---|\n| Cards, 1 to 4 a row | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Main panel | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Side panel | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Summary tile | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nAnt Design Vue rows have no gutter by default. Set it from the spacing tokens, and set the page margin on the content area.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## App frame\n\n| Region | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Side navigation, open | 280 px | `<a-layout-sider :width=\"280\">` |\n| Side navigation, collapsed | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nThe header is 64 px by default and has no token for its height, so set it in the header’s style.\n\nThe `breakpoint` prop of `a-layout-sider` uses fixed widths that ignore the `screen*` tokens. Do not use it. Set `collapsed` from your own media query and the user’s choice: open from 1024 px, collapsed to the rail when the user asks, and the choice remembered. Below 1024 px, hide the sider and show the menu in `a-drawer`.\n\nSee [Layout](/foundations/styles/layout/) for the frame.\n\n## Interactive table rows\n\nBind `data-bh-interactive=\"true\"` through `customRow` only when the complete row\nalready has an activation handler. The source companion owns the pointer cursor;\nnative selection keys/classes retain their selection recipe. Preserve accessible\nrow actions, keyboard behavior and actual record activation rather than replacing\nselection with a custom outline.\n\n\n## Native composition and optional variants\n\nUse the real native component. These opt-ins do not authorize a div-based\nreplacement, a skin-only wrapper, or copying Card/Button geometry into the app.\n\n- Native Card's `hoverable` prop remains optional. `data-bh-selected=\"true\"`\n adds a selected fill and independent inset cue; omitting it restores the base.\n In a composed selectable Card, `data-bh-card-action=\"primary\"` on the primary\n native text Button retains `aria-pressed` and keyboard focus without duplicating\n the outer Card's selected frame. Independent actions retain ordinary Button paint.\n- Reuse `bh-data-accent` with an existing semantic `data-bh-status`, `data-bh-band`,\n `data-bh-metric`, `data-bh-job-type` or `data-bh-priority` for an optional leading\n edge on a real Card. It adds no selection or hover behavior. A status/category\n edge survives selection; keyboard focus remains a separate outside outline.\n Bind the discriminator appropriate to that mark rather than conflating status\n with categorical identity. Labels are still mandatory.\n- `data-bh-layout=\"content\"` on a real Button allows a multiline composed label:\n auto height, normal wrapping, start alignment and the source default-control\n minimum height. Native props, padding and keyboard activation remain native.\n Use ordinary Button size/block props when they suffice.\n- `bh-ant-shell-region` removes native Header/Footer padding only when the region\n already contains the composed app header/footer. It does not change native\n height, paint or the surrounding responsive page-region layout.\n- `bh-card-link` on a real navigation anchor wrapping Card removes competing\n link paint/underline and supplies source keyboard focus, not Card skin.\n- `bh-ant-card-action-row` uses the native Card title/extra slots with a shrinkable\n leading track and reserved trailing action. Source head inset stays consistent\n across Card sizes; the real link remains a flexible inline title/metadata row.\n See [application content](/tools/application-content/#semantic-content-and-genuine-composition).\n- `bh-ant-metric-tooltip` on a native Tooltip overlay and `bh-metric-tooltip`\n on its semantic title-slot host separate date/header, metric definition list and\n explanation. The token-backed readable width is capped by the viewport; native\n popup placement, theme, keyboard and touch behavior stay with the actual owner.\n\nBusiness components may own data, state, behavior and meaningful composition of\nthese primitives. Inventory and remove redundant replacement components and every\nobsolete caller/import/export. Generated rich content must mount real native\nenhancement controls when the host framework permits it; a producer stylesheet\nalone is not evidence of missing native capability.\n\n\n### Operational and composed native content\n\n`Steps[data-bh-operational=\"true\"]` uses success/info/danger/subtle for native\nfinish/process/error/wait states. It leaves categorical navigation Steps unchanged.\nAn actual Step's `data-bh-skipped=\"true\"` adds a dashed tail in either orientation;\nthe caller retains ordering and the relationship's meaning. Custom icon slots do\nnot require rebuilding the Steps primitive.\n\n`Result[data-bh-layout=\"step\"]` retains a composed report's icon-and-title header\nrow, with subtitle/content and extra/actions below at full width. It only changes\nnative layout/padding; status paint and native slots remain native.\n\nThe native Tree title `data-bh-highlighted=\"true\"` is a temporary locator cue,\nnot a selected key or keyboard focus. Native selected/disabled treenodes suppress\nit; the source outline does not change title geometry.\n\nUse `bh-partner-logo-image` on a real Image for connector/brand assets.\nBind only the Source partner-image height and `width=\"auto\"`; native Image plus\nthe adapter preserves its intrinsic aspect ratio without a square frame or crop.\nActual identity Avatars stay native. Do not use brand hue as operational status.\n\n### Native Image preview\n\nThe official Image `zIndexPopupBase` and `zIndexPopup` tokens use `z-index.modal`.\nThat alone cannot clear an owner nested above it: AntD4.2.6 Preview drops\nboth declared Dialog `zIndex` and `wrapProps`. The setup composable\n`useNativeImagePreviewContainer(labelGetter)` from\n`@beehexa/ant-design-vue-tokens/image` owns the official lazy body portal:\npass its getter to native `preview.getContainer`. It names the real native\ndialog, reacts to locale changes and captures a layer above live owners on\neach opening, excluding its own previous layer. A closed portal is not an\noverlay owner. Its observer/container are disposed on unmount. Native Image\nstill owns zoom/pan, keyboard close and focus return; there is no custom viewer.\n\n\n`bh-ant-card-flush` opts a real Card body out of inset only for an edge-to-edge\nembedded editor, canvas or composed pane. Ordinary cards retain native padding.\nReuse `bh-ant-fill-card` and `bh-ant-fill-spin` for existing bounded flex hosts;\ndo not create parallel fill aliases or restore private consumer selectors.\nThe flush Card clips embedded paint to its native rounded frame. A direct\nbrowser iframe child has its UA border removed to avoid a second frame;\nsandbox/srcdoc and embedded-document behavior remain browser-owned.\n\n`semanticTableComponents` from `@beehexa/ant-design-vue-tokens/table` extends\nthe real Table's public `components` API. A column's `customCell` may return\n`{ scope: 'row' }`; its body cell becomes a semantic `th`, forwarding the native\nattributes and slot. Other cells remain `td`. AntD4 has no row-scope column prop\nand its body-cell CSS only targets `td`, so the source companion supplies the\nmatching row-header size/border/hover/selection recipe for this actual HTML\nsemantics gap. Native columns, rows and Summary remain native.\n\nAn actual native ListItem may opt into `data-bh-interactive=\"true\"` for a rich\nactivation row when no narrower native control meets its content contract.\nThe opt-in supplies hover/pointer/focus only; the consumer supplies a real action,\nkeyboard activation and accessible role. Do not nest competing interactive targets.\n\n\nConnector and partner brands share `content.partner-logo.image-size` as their\nrendered height, not a width cap. Keep natural width; wrap rows when needed.\nSemantic icon-height roles likewise preserve proportional width and hit targets.\nNative Table already styles `tfoot > tr > th` geometry at each size; the companion\nadds only its missing Summary row-header border and semantic weight/alignment.\n`a-typography-link[data-bh-target=\"responsive\"]` uses the source minimum24px\ntarget, increasing to44px only on coarse pointers; it adds no link skin.\n\n\nFlush Cards clip embedded paint to their actual rounded frame. Native Drawer\nfooters retain their canonical inset or the device's safe-area inset, whichever\nis larger. `Spin[data-bh-mode=\"nonblocking\"]` removes the native veil/pointer\nblock only for progressive content that remains inspectable; omit it for actual\nblocking work such as export. This does not change spinner timing or graph data.\n\n\n## Read-only segmented native Progress\n\nFor “Step 3 of 7” feedback, use the real native `Progress` with its actual\n`steps` and `percent`. This is not navigation: do not substitute `Steps`,\n`Segmented`, a fabricated row of marks, or another progress engine.\n\nAntD4 `size=\"small\"` deliberately renders each step as a **2 × 8px vertical\nfragment**. Its native `[width, height]` tuple means **per-segment** geometry.\nThe source helper resolves `content.step-progress.segment-width` and\n`segment-height` to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Step {{ props.index }} of {{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n status=\"normal\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nThe feature owns the real positive total, current index, status text and\nbusiness transitions. The helper supplies geometry only; native Progress\nowns the rendered count and active marks. Hide the redundant bar from assistive\ntechnology only when adjacent text already conveys the same progress.\n\nFor current-position feedback, explicitly set `status=\"normal\"`: reaching the\nlast authored group does not mean the operation succeeded. Render failure or\ncompletion status only from actual workflow evidence, independently of the\nindex. A one-group workflow still has one real mark; an absent/zero total has no\nbar. Do not manufacture a denominator from screenshot geometry or API-step count.\n\n`bh-ant-step-progress` opts that native root into intrinsic inline width,\nzero native outer margins, the source `content.step-progress.gap` (4px at\nroot16), and wrapping without a trailing item margin. CSS does not replace\nthe native size API or set per-mark width/height. The bar follows the status\non a wide row and wraps within the available width on mobile.\n\nOmit the class and helper to retain the native base. Ordinary percentage,\nupload and countdown progress do not opt in. The shared live matrix below\nincludes a real native no-opt-in comparison, editable total and first/middle/\nfinal controls; check both root16 and root20, light/dark and narrow widths.\n\n## Thin navigation Progress\n\nFor route-loading feedback use real native `Progress` with `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` and its native size tuple.\nUse `border.width.focused` for the thin line and `color.brand.yellow` for its optional\nbrand stroke. The application owns fixed viewport positioning at `top: 0`, width and\nits layer from the seven [z-index](/foundations/styles/z-index/) tokens; the adapter removes AntD's inline baseline gap and outer margins,\nso the actual ink begins at the allocated top edge without negative offsets.\n\nProgress reflects completed navigation milestones, not invented network percentages.\nKeep the previous page while guards and route chunks resolve, advance to100%, and await\nthe actual finite native width transition before committing the new page. Cancellation,\nerrors and superseding navigation must clear their own progress without clearing a newer\nrequest. The source width transition uses `motion.duration.default` and\n`motion.easing.linear`; reduced motion removes it. Keep a named progressbar with actual\nmilestone values, and never use a page-covering scrim just to load a route.\n\n## One native control family, distinct roles\n\nUse native default Button for compact bordered utility triggers (including\nlanguage and theme), with the same native size as adjacent page controls.\nUse the public `#icon` slot and one label child; icon-only Buttons still need\nan accessible name. Do not disguise `type=\"text\"` globally as a default Button.\nA frameless account/avatar menu legitimately uses `type=\"text\"`, a real Avatar\nand native Space: center it in the row rather than inventing a shell skin.\n\nButton small/default/large use source control heights24/32/40px at the nominal\nroot; typography is label-small for small and label-default otherwise.\nButton/Input/Select and side navigation items use `radius.control`; Select popups and menus use `radius.overlay`.\nThe numeric theme/root observer and rem CSS scale together.\nAntD4 only inserts margin for `.anticon` siblings, not Lucide SVGs in `#icon`;\nthe source supplies one space100 flex gap for all real Buttons and removes\nthe competing native/loading-icon margin. No shell-specific class is needed.\nNative default/primary/text/link, disabled/loading, hover/pressed and keyboard\nfocus remain distinct. `data-bh-target=\"responsive\"` adds touch minimums only\non coarse pointers. Open Dropdown/Menu state is not Button selection; keep\n`aria-expanded`, menu keyboard behavior and focus return in the actual feature.\n\nThe primary neutral-bold/inverse pair is intentional: graphite in light mode,\nlight graphite with dark text in dark mode. A pale dark-mode Continue action\nis not a reason to recolor every primary or text Button blue. Link actions\nretain the source link palette; default utility actions remain bordered.\n\n| Native variant | Source role and state contract |\n| --- | --- |\n| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |\n| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |\n| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |\n| Danger default / dashed / text / ghost | Readable danger text; outlined variants retain danger borders. Available non-link variants use danger-subtle hover/pressed fill. Ghost starts transparent, never with the solid on-bold label. |\n| Link / text | Distinct link/frameless roles, not a disguised default Button. |\n| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |\n| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |\n\nAntD4 paints a **resting lower shadow** from `controlOutline` on primary,\n`controlTmpOutline` on default, and `colorErrorOutline` on danger-primary.\nThose names are not exclusively keyboard-focus inputs. Reusing the global\nblue focus alias there produces a stranded blue stripe even after all\nanimations finish. The source scopes these three Button component aliases\nto transparent; it does not clear the global focus role or set its width\nto zero.\n\nNative Button keyboard focus instead reads `colorPrimaryBorder` and\n`lineWidthBold`. Its component overrides use source focus color/width.\nThe companion's enabled `:focus-visible` rule supplies the independent,\ngapped source outline/offset. Default/dashed state fills and the separate\ndanger text/on-bold pairs are the remaining native-token gaps; source CSS\nhandles only those cases, excluding disabled controls and genuine selection.\nApps must not add a local shadow/border reset or a focus suppression.\n\nThe compact native dock uses `bh-control-group` and `data-bh-variant=\"dock\"`\non Space. Its neutral text-action paint excludes danger, ghost, real selected\ntoggles, loading controls and disabled anchors, so the same role/state contracts\nstill apply inside the dock. Open actions may use `aria-expanded`; genuine\ntoggles use `aria-pressed` and retain the selected fill plus structural indicator.\nAntD4 href Buttons render anchors with a native `disabled` attribute, not the\n`:disabled` pseudo-class or a generated disabled class. Native enabled hover/active\nselectors still match those anchors. The companion recognises `[disabled]` and\n`aria-disabled=\"true\"` with sufficient native-state specificity: disabled text\nstays disabled; fill/border roles match the native non-href Button for solid,\ntext/link, ghost and danger/ghost combinations. Set the native `disabled` prop, supply\n`aria-disabled=\"true\"` and `tabindex=\"-1\"` for an unavailable href Button; native\nAntD click handling blocks its navigation. ARIA or CSS alone never disables a\nlink. Do not manufacture AntD classes or replace genuine links with pointer-only\nhandlers.\n\n### Live native state and progress matrix\n\nUse the site theme/language controls and browser root font preference.\nChange Button size, hover/hold a press, Tab/Enter/Space through available\nactions, and inspect actual activation counts. Loading/disabled Buttons and\ngenuine disabled href variants must not activate, including inside the compact dock.\nToggle its selected action and check danger hover/pressed without neutral repaint.\nThe long native Card title wraps independently of its extra action on mobile.\nSwitch examples include loading and disabled together; loading retains checked\npaint and the spinner while callbacks stay blocked. Progress uses the same actual\ncount/index for its opt-in and no-opt-in renderers.\n\n<NativeControlsDemo />\n\n\n### Native mobile composition and bounded content\n\nThe adapter stretches joined Input/Search/compact-group fields and their actions\nas one row, including validation, disabled states and coarse-pointer targets.\nIcon-only Buttons keep their native size proportions; on coarse pointers both\naxes reach `size.target.touch`. Content-layout Buttons retain multiline text\nwithout overriding explicit or responsive touch minimums.\n\nBelow `breakpoint.md`, every native Card header/meta title wraps, including\ndescendant Typography ellipsis, Tags and Space. This is global readable content,\nnot an optional consumer override. Header extras remain available. Standard\nTimeline dots, tails and custom dots align to the first content line; wrapped\nevent content stays in the native timeline column. Label/alternate/right\ntimelines retain their distinct native alignment.\nFor event rows with inline native small Buttons, bind `data-bh-layout=\"actions\"`\non the Timeline and center the native Flex row. This shares the first line's\nallocation with `size.control.small` (or `size.target.touch` on coarse pointers),\nso the dot/tail do not stay above text beside a taller touch action. Plain text\ntimelines keep their normal source line box. AntD4 Timeline exposes no component\nsizing token; this bounded composition does not change label/right/alternate modes.\n\nAntD4 Flex does not forward arbitrary `role`, `aria-*`, `data-*` or DOM listeners.\nDo not put required semantics, source opt-ins or keyboard handlers on it. Use\nnative Space/Typography where appropriate, or retain a real semantic host with\nminimal structural flex/grid CSS. Do not introduce a forwarding wrapper.\n\nUse `bh-content-toolbar` and `bh-content-toolbar__group` on actual intrinsic\ntext-editor toolbar hosts; the source owns spacing, padding, wrapping and mobile\ncontrol minimums. Graph navigation instead uses the compact Source dock floating\ninside its drawing viewport, default lower-left, never a full-width header band.\nFollow the [canvas dock contract](/tools/mermaid/#shared-drawing-viewport-and-dock)\nwithout copying graph-only actions to text editors. These are shared recipes,\nnot page-specific skins. Keep hosts and flex children shrinkable with `min-width: 0`.\n\nBind `bh-ant-fill-spin` through Spin's **wrapperClassName**, not its class:\nthe nested-loading wrapper carries the bounded height. Drawer fill/flush modes\ntraverse the native content-wrapper/content/wrapper-body chain; header/footer\nremain intrinsic and the body owns the remaining space. Tabs fill only their\nown active pane. Consumers supply the actual bounded parent, not guessed\nviewport-minus-header heights. Monaco/Mermaid observe that host's dimensions\nwithout replacing the editor model or resetting existing chart pan/zoom.\n\n",
|
|
2122
|
+
"raw": "---\ntitle: Ant Design Vue theme\ndescription: Make Ant Design Vue components use Beehexa design tokens, breakpoints, grid, control heights and app frame.\norder: 3\n---\nimport NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` owns the reusable Ant Design Vue 4 adapter.\nUse its typed ESM API and companion CSS, backed by `@beehexa/design-tokens`.\nFrameworks are peers: `ant-design-vue@^4.2.6` and `vue@^3.3.0`; neither is bundled.\nUnreleased `0.0.0` packages use explicit local development references; only the authorized\nrelease runner stamps real package versions. Do not copy a theme palette into an application.\n\n**Beehexa tokens are the source of truth. Ant Design Vue only reads them.**\n\nThis page is the only place where the Beehexa foundations meet Ant Design Vue. The foundation pages stay the same whatever the product is built with.\n\n## Usage\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})`\nreturns the native `ThemeConfig`. Recompute on theme/language/root-font changes;\neach call returns a fresh object. `locale` selects source typography, not messages.\nThe setup-only source observer measures one inert1rem probe and cleans it up.\nThis keeps numeric native size/type/radius APIs aligned with scalable CSS units;\npixel-based borders and breakpoints do not scale. The pure factory reads no DOM.\nPass the appropriate AntD language pack through `ConfigProvider.locale`, and configure the\ndate library separately. Render native `useMessage`, `useNotification` and `useModal`\nholders in a feedback host inside the sole root provider. Bind application notify facades\nto those hook APIs; never use detached raw static feedback APIs. The factory sets\n`hashed: false` because AntD4 contextual message/notification holders otherwise retain\nstale hashes across theme/locale changes. Keep an existing notice open while switching\ndark/Vietnamese to light/English; its typography and paint must follow the active theme.\n\nKeep document `data-theme` and `lang` synchronized for teleported overlays. Import\ncompanion CSS after application/framework styles. Use a native 16px root and 14px body;\nnumeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.\n\n## Overlay ownership and bounded native content\n\nTriggered popups use `getAntDesignVuePopupContainer` to stay inside their nearest native\nModal/Drawer or custom `data-bh-overlay-owner` host. Native Modal/Drawer roots remain\nbody-hosted for viewport geometry. Provider-bound modal facades default their invocation\n`zIndex` through `getAntDesignVueModalZIndex()` while preserving explicit caller values;\nthis keeps keyboard/awaited confirmations above their live owner. Nested drawers use\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` as `rootStyle.zIndex` so\nsurface and mask move together; AntD4's `zIndex` prop styles only the content wrapper.\nBody-teleported fullscreen editors/images and fullscreen native Modals capture\n`getAntDesignVueFullscreenZIndex()` before mounting their root. This uses\n`z-index.modal` with above-owner ordering, not a separate fullscreen tier.\nMark custom roots only once they are active, avoiding self-counting. The seven\napproved tiers have no fullscreen450 or readiness650 token; blocking loading\nalso uses `z-index.modal`. Keep owner-relative ordering below\n`z-index.tooltip` and `z-index.toast`; reserve `z-index.spotlight` for tours.\nTour's inline native default also requires its public\n`zIndex` prop bound to `z-index.spotlight`.\n\nModal frames and Drawer content wrappers intentionally inherit `pointer-events: none`;\nnative content restores pointer entry only for its own subtree. The companion CSS also\nrestores `pointer-events: auto` on actual native popup roots portaled into either frame\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and\nTour). Frames remain pointer-transparent outside content and popups; native masks,\nfocus traps and dismissal remain unchanged. Do not relocate popups into a scrolling\nbody, change z-indices or add page overrides to solve this inherited-pointer gap.\n\nThe companion CSS provides opt-in native structural contracts, not application selectors:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: bounded body, intrinsic header/footer,\n optional zero body padding; bind through `rootClassName`. Keep the native body's\n default automatic overflow rather than suppressing access when intrinsic\n controls or preserved pane minima exceed a short allocation. Do not repeat\n body flex/overflow styles at consumers.\n- `bh-ant-fill-modal`: bind through native `wrapClassName`, not the unsupported\n Modal `rootClassName`. The real fixed overlay allocates a token-inset bounded\n dialog; its content/focus wrapper and body fill around intrinsic header/footer.\n Width remains the caller's native width, bounded by the available overlay.\n Use for interactive renderer inspection, not short confirmations. The renderer\n viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.\n- `bh-ant-fill-tabs`: bounded native wrappers and active pane. Nested tabs opt in separately;\n `bh-ant-fill-tabs--scroll` enables pane scrolling and `bh-ant-tabs-mobile-inset` adds the\n source mobile inset. Inactive panes stay hidden.\n Inner tabs inside that scrolling document can instead add\n `bh-ant-fill-tabs--document`: wrappers keep intrinsic content height and grow\n into adequate space, without clipping a renderer after long metadata exhausts\n the allocation. The outer native scroll pane owns vertical access; do not put\n both modifiers on the same root. Only the interactive renderer host receives\n `--bh-layout-renderer-minimum-block-size`, not outer panes or static fields.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: carry an existing bounded host through native wrappers.\n Static document/tree/list content can remain nonshrinking and overflow-visible\n inside the native Card's existing scroll owner. Do not pair that Card scroller\n with a second zero-height inner scroller when its header exhausts a tiny pane.\n This document composition adds no SDK-readable minimum to ordinary fields.\n- `bh-ant-fit-empty`: only on a real native Empty inside an already allocated\n placeholder. Native illustration choice alone does not guarantee a fit in a\n short host. The opt-in removes outer and description paragraph margins (the\n parent owns its inset), bounds the root and lets the image row shrink before\n the intrinsic description/footer. The image keeps its native preferred height\n and removes its inline baseline strut; neither enlarged artwork nor paragraph\n margins consume a tiny host. It adds no readable-renderer minimum, palette,\n text typography, image replacement or overflow suppression. Preserve the parent's one genuine\n scroll owner when even the intrinsic text/actions cannot fit. Ordinary\n document/list/table empties omit it and retain native defaults. The live native\n family below compares 2/4/12rem allocations, the simple illustration and the\n unchanged no-opt-in base.\n- `AntDesignVuePopupScope`: only for retained renderers moved across native\n overlay owners. Wrap the existing subtree outside its Teleport and pass the\n existing HTMLElement root as `owner`; keep owner attributes on that actual\n root. Keep a real element as the consuming component's root when callers use\n `v-show` or other element directives; put the scope inside that existing root,\n not in its place. A stable native popup holder moves with the owner because\n AntD4 caches the first portal container. Nested scopes inherit the enclosing target.\n Native ConfigProvider theme/locale, menus, focus and no-trigger body portals\n remain native; no editor/model/graph rekey or global popup z-index is involved.\n Opt-in `feedback` (default `false`) sends trigger-less containers to the mounted\n scope host instead, so a `notification.useNotification()` / `message.useMessage()`\n holder inside the scope follows the overlay owner into native fullscreen.\n Fullscreen capture handlers yield menu/listbox Escape via\n `isAntDesignVueMenuEvent(event)` before closing their own overlay.\n Native Drawer portals can use the same stable host through the public scoped\n slot: `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` with\n `<a-drawer :get-container=\"getContainer\">`. HTML attributes on the scope\n belong to that actual portal host; conditionally expose `role=\"dialog\"`,\n `aria-label` and `aria-modal` only while open when the native Drawer drops\n these attributes. Do not add a second dialog wrapper or mutate native DOM.\n AntD4 Flex also drops attributes other than class/style: use an existing real\n semantic element when a controlled ID, region name or tab stop must survive.\n- Independently selectable, disclosable choices compose actual Card title slots\n with sibling native disclosure and selection Buttons plus a shortcut Tag.\n Keep Card headers noninteractive; each Button owns only its own action.\n AntD4 Collapse headers retain an ancestor `role=\"button\"`/tab stop even in\n icon-only mode, so do not nest independently actionable choices there.\n Native conditional Card body slots own expanded content; no private header\n role/keyboard patch or special choice-collapse CSS is needed.\n- `bh-ant-inspection-descriptions`: source desktop label minimum and mobile stacked rows.\n- `bh-ant-data-table`: generic pending/success/error row classes plus public `customCell`\n markers `data-bh-cell-interaction=\"editable|readonly\"` and `data-bh-cell-state=\"changed\"`.\n Native selection outranks operational row paint; changed cells keep diff paint on hover.\n `bh-ant-table-nowrap` is an independent horizontal-content opt-in.\n Add `bh-ant-row-indicators` for a `border.width.accent` inset danger marker on the\n first cell of `bh-ant-row-error` rows. This non-colour issue cue does not change\n column geometry, override selection or replace status text/icons.\n- `data-bh-tone=\"warning\"` on a native Badge root selects\n `color.background.warning.bold` / `color.text.on-bold` for its count only.\n Native operational status dots keep their separate source semantics and circles.\n- Native Button `data-bh-target=\"touch\"` selects `size.target.touch` as minimum\n width/height without repainting it. `data-bh-target=\"responsive\"` applies the\n same target only for coarse pointers. Keep native type, size, disabled and\n keyboard semantics; no page-owned target sizing is needed.\n- Native Modal/Drawer close controls also use the root-scaled coarse-pointer\n target. Closable Modal headers reserve the whole target height and center the\n title beside it, so the close hit area never covers the first body control.\n Modal titles reserve that native control's lane only when it is present;\n short `closable=false` confirmations do not receive an empty title inset.\n- A native Flex span inside Button remains a flex layout rather than inheriting\n AntD4's ordinary inline text-span display. Keep semantic title/description\n content separate through native composition, not another button wrapper.\n- Pass the observed root to `tokenPixels(name, locale, rootFontSize)` for actual\n Avatar/Image/Space/Row numeric props, including compact dock gaps. Omitting that\n argument intentionally returns nominal16px-root pixels; it does not read the\n browser's current root. Child setup calls reuse the sole provider's readonly\n measurement, not another observer. Keep CSS dimensions on scalable source roles.\n\nKeep custom business data/slot meaning and host structure in the consumer, not\npresentation recipes. Do not recreate native selectors through per-page\n`:deep(.ant-*)`, global overrides or priority escalation.\n\n## Token mapping\n\n| Ant Design token | Beehexa token |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nUse the [Radius roles](/foundations/styles/radius/), not one radius for every\ncomponent:\n\n| Component | Radius token |\n| --- | --- |\n| Button, Input, Select trigger, Radio button, Segmented, side navigation item | `radius.control` (6 px) |\n| 24 px controls | `radius.control.small` (4 px) |\n| Items in a dropdown or submenu popup | `radius.item` (4 px) |\n| Tooltip, tag, badge count | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs and other in-page containers | `radius.card` (8 px) |\n| Dropdown, submenu popup, Select popup, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (circle), Switch, chip | `radius.pill` |\n| Full-width table, joined Search edges, fullscreen surface | `radius.0` |\n\nGroups with 4 px padding use 8 px outside; groups with 8 px padding use 12 px\noutside. The adapter pins these component aliases and the companion CSS covers\nthe badge, Switch, Segmented and Drawer cases that have no theme input.\nConsumers must remove competing corner overrides, not add `.ant-*` radius patches.\nExplicit Button `shape=\"circle\"` / `shape=\"round\"` props keep their native sizing\nand the `radius.control` corner. They are not avatar, Switch or chip roles.\n\nThe adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead\nof allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes\nand radios use `color.border.bold` while cards/tables use `color.border`. Layout header and\nsider sit on `color.surface.page`, separated from the content by a `color.border` line; the mobile\nnavigation drawer is a drawer on `color.surface.overlay`. There is no separate shell palette or nested isolated\ntheme. Use `font.body.default` for table data, `font.label.small` for headers/tags,\n`font.heading.medium` for modal titles and `font.heading.small` for drawer titles.\n\nNative Menu icons use the native `icon` slot, source icon box and a `space.050`\ntitle gap. Do not rebuild the icon/label row in a Space with a page-specific gap.\nTitle text uses `font.label.default` rather than the row-height line box, keeping\nVietnamese labels and adjacent title/tag content vertically aligned.\nNative Tree content keeps its icon and shrinkable title centered as one row.\nIf a custom title already includes its glyphs, leave `showIcon` off; AntD4 otherwise\nreserves another empty icon box. Native selection, expansion and keyboard ownership\nare unchanged. Apply required content roles to a semantic host, not AntD4 Flex.\n\n### Ant Design Vue 4 component contracts\n\n- Table reads `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` and\n `controlItemBgActiveHover`. AntD5 names such as `headerBg` and `headerColor` are ignored\n by AntD Vue 4.2.6 and must not be used.\n- Switch reads OFF tracks from `colorTextQuaternary`/`colorTextTertiary`, ON tracks from\n `colorPrimary`/`colorPrimaryHover`, its shared thumb from `colorWhite`, **both** labels\n from `colorTextLightSolid`, and disabled/loading opacity from `opacityLoading`.\n These are component-scoped mappings, not changes to global primary/text colors.\n AntD5 `trackBg`/`handleBg`-style names are not the AntD4 state API.\n- Menu reads `colorItem*`, `radiusItem`, `radiusSubMenuItem` and `colorActiveBar*`.\n Explicit `theme=\"dark\"` menus receive the same source roles. Selection has a visible bar,\n not a heavier label that shifts its neighbours or merely a changed fill.\n- Form controls share source outline/focus/disabled roles. Validation retains danger/warning\n text/icons and native state semantics. Do not replace meaningful input borders with divider\n hairlines.\n- Tag status presets are `success`, `processing`, `warning`, `error`; default is neutral.\n They use source foreground and outline pairs. Arbitrary hue presets are not status names.\n Badge counts are neutral; error/processing status dots retain their semantics.\n- Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface,\n scrim and overlay elevation. Progress is neutral by default and semantic on success/error.\n\n### Native Switch contract\n\nUse the native Switch inside the existing root ConfigProvider. `enabled`,\n`saving`, `unavailable` and `locale` below are application state; do not create a\nnested provider or local theme just for schedules, permissions or status toggles.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` is neutral-bold, never business-success green. `switch.off.*` has a\nstrong thumb, readable label and meaningful boundary so enabled OFF cannot be\nmistaken for disabled. The source defines paired track/thumb/label/border roles\nfor normal, hover, pressed, focus, loading and disabled; normal and `size=\"small\"`\nuse the same light/dark palette and existing native geometry. Native thumb\nposition, `aria-checked`, labels and the separate focus ring provide non-color\ncues. Short EN/VI state labels use the existing source typography, not a patched\nheight or a consumer font declaration.\n\nAntD4 supports only one shared thumb/label pair, no pressed track paint and no\nexplicit disabled color pairs. Its spinner foreground and translucent green\nthumb shadow are also not configurable as paired parts. The companion CSS closes\nthose evidenced gaps, while normal/hover track paint stays in native aliases.\n`opacityLoading: 1` removes native loading/disabled dimming. Disabled ON uses\n`color.background.neutral.bold.pressed` with inverse thumb/label; disabled OFF uses\nthe disabled track, subtle thumb/label and bold boundary. Native checked position,\ndisabled behavior and cursor remain unchanged; both values must be readable.\nLoading retains the current normal checked pair and a high-contrast native spinner, including when both\nloading and disabled props are set. It never predicts or changes the saved value.\n\nKeep native controlled binding, `change` callback and keyboard operation. The\nnative button is disabled during loading; pending/disabled activation must not\nsave twice or update checked state. Business save operations and errors remain\napplication-owned. Test both sizes, OFF/ON loading and disabled states, EN/VI labels,\ncallback counts and a delayed controlled save. No consumer `.ant-switch` patch,\npalette literal or custom Switch implementation is necessary.\n\n### Contrast, links and native Segmented\n\nThe [Source contrast and link rules](/foundations/styles/color/accessibility/)\nare authoritative for every text/label/tag and effective background in both themes.\nRead-only IDs, titles, dependency names and status values must not use disabled\nroles. Use paired semantic status text/fills, not arbitrary hue tags or inverse\ntext over subtle fills. Normal text requires 4.5:1, large text 3:1 and meaningful\nboundaries 3:1 at rest, hover, pressed and selected states, including composites.\n\nAnchors, Typography links, link Buttons and prose links have no underline by\ndefault, including hover. `.bh-link-underline` is the sole explicit opt-in.\nKeep `color.link`/`color.link.hover` and Source focus rings; never mute a link\ninto metadata. Ordinary prose/document links use Source semibold as a persistent\nnon-colour cue; explicitly opt an authored link into underlining when its\nsurrounding prose is already semibold. Navigation and native link Buttons keep\ntheir existing component typography.\n\nUse native Segmented through this same root provider and companion CSS. Source\nremoves the opaque `::after` label overlay and applies paired backgrounds directly\nto stable item hover/pressed/selected-hover states. While AntD's native thumb is\npresent during motion, these opaque item fills are suppressed so they cannot\ncover it. Native selection and keyboard behavior remain unchanged.\nNever add consumer state paint or synthetic selected items.\nThe selected item and moving thumb use the native `boxShadow` alias for an inset\n`border.width.default` / `color.border.bold` boundary that identifies selection\npersistently without covering the label.\nThe [live native matrix](/foundations/styles/interaction-states/#live-native-switch-states)\nincludes all sizes, enabled/disabled and selected/unselected items for hover,\npress, click and keyboard verification. Follow the\n[spacing, truncation and motion invariants](/foundations/styles/interaction-states/#label-spacing-and-motion-invariants);\nhover must never obscure text or be the only way to expose information.\n\nKeep the size-specific native Segmented label `line-height`; do not apply a\nfont shorthand that resets it. The default toolbar Input, Segmented and Button\nmust share their native control center, including wrapped toolbar groups.\nFor metric rows, use headerless native Cards with `bh-ant-subgrid-card` in a\nparent grid with two shared automatic rows. Compose label/icon first and\nvalue/actions second, retaining native padding, source gaps and wrapping.\nUse `bh-icon-slot` with `data-bh-size=\"responsive\"` only for passive indicators\nbeside small responsive icon Buttons; it supplies matching geometry, not an action.\nDo not position labels or icons with manual pixel offsets to compensate for a\nnative line-box or shared-row defect.\n\n\n### Companion CSS and structural classes\n\nUse component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title\ntypography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas,\nresponsive Tour placement, reduced motion and neutral Badge count without recoloring error dots.\nApplication selectors and palette overrides belong neither in that CSS nor in a dashboard theme.\nConsumers retain genuine portal layout and scrolling mechanics only. Framework paint\nand typography fixes belong to the package, not duplicated consumer overrides.\n\nBordered Descriptions clip cell backgrounds inside the native rounded frame instead of\npainting over its left corners. Header-only Cards omit the orphan header/body divider\nand retain all four rounded corners; Cards with body/cover/actions keep native separation.\nBordered hoverable Cards keep `color.border.bold` plus `elevation.shadow.raised` on\nhover and keyboard focus, rather than AntD4's transparent hover border. Focus also\nuses the standard outline/offset; the application still owns keyboard action semantics.\nThese framework fixes are automatic, not per-page overrides.\n\nNative Search, Input addon buttons, compact InputGroup and horizontal Space.Compact\nshare an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,\nadjacent borders overlap once, exposed corners use `radius.control` and touching corners stay zero.\nSource font roles are retained. Small Vietnamese fields/actions grow together to 26 px;\ndo not clip accents or shrink type to force 24 px. Default actions share field\nerror/warning/disabled borders; primary/danger actions retain their semantic roles.\nClear icons keep an icon-sized line box so they cannot inflate affix wrappers.\n\n`bh-ant-tag-large` on a Tag selects the source large label (24px minimum, 8px inline padding);\nthe default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.\n`bh-ant-tree-fill` on an actual Tree fills a bounded flex host, including below an\nintrinsic summary. Root and list establish the min-height-zero chain; only the\nnative list holder scrolls, preserving its keyboard scroll target. Do not pass a\nfixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.\nKeyboard-navigation consumers bind the native `activeKey` / `onActiveChange` pair:\nstate `ref<TreeProps['activeKey']>()`, then `:active-key=\"activeKey\"`\nand `@active-change=\"activeKey = $event ?? undefined\"`. AntD 4.2's uncontrolled\nactive-change path does not retain the requested node; a CSS fill opt-in cannot\nsupply that navigation state.\n\nFor data inspection, bind `width=\"var(--bh-ant-overlay-width)\"` and apply\n`bh-ant-inspection-modal` or Drawer `rootClassName=\"bh-ant-inspection-drawer\"`.\nAdd `bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` only for an explicit\ncontent-heavy variant. The variable selects `layout.overlay.default` / `.wide`, and `.mobile`\nbelow `breakpoint.lg`. Short confirmations and navigation drawers retain their own widths.\nThe Modal's `max-width: 100%` caps that width to its native scrolling wrap, which\nexcludes the vertical scrollbar. Do not replace the cap with `100vw` or hide\nhorizontal overflow: the mobile width token may fill the viewport, but the actual\nModal must still fit its available containing block.\nFullscreen modes are Modal `wrapClassName=\"full-screen\"` and Drawer\n`rootClassName=\"fullscreen\"`; AntD4 Modal has no `rootClassName` prop. These preserve\nbounded scroll mechanics, not decoration.\n\n### Native field names\n\nBind a real `<label for=\"…\">` to the native Select's explicit `id`, or use the\ncorresponding native Form Item label association. In AntD4, an `aria-label` on\nSelect can name its outer generic wrapper while leaving the actual combobox\nunnamed. Check the combobox's accessible name and native label activation, not\njust an attribute on a component root. Use Vue `useId()` plus a row identity for\nrepeated fields; do not add a wrapper or an attribute-copying observer.\n\n### Verify the actual framework\n\nExercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated\ninputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals,\nexpanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message,\nModal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus,\ntouch hit areas, reduced motion, narrow Tour and focus return. Use\n**ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** in controls, tags and rows.\nCompilation alone does not establish those rendering/interaction outcomes.\n\n\n## Spacing\n\nAnt Design Vue sizes come from `sizeUnit` and `sizeStep`. Keep both at 4, so `size` is 16 px. The theme then sets each size from a [spacing](/foundations/styles/spacing/) token.\n\n| Beehexa token | Value | Ant Design Vue tokens |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` and `space.1000` have no Ant Design Vue token. Use their CSS variables in your own styles.\n\nProps that take a number, such as `size` on `a-space` and `gutter` on `a-row`, take pixels. Use a value from the scale: `<a-space :size=\"8\">`.\n\n## Control height\n\n| Beehexa token | Height | Ant Design Vue token | Component prop |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | None |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nThese are Ant Design Vue’s own heights. The theme still sets each one from its size token, so a change to the token reaches the components. See [Size and density](/foundations/styles/size-and-density/).\n\n## Breakpoints\n\n**Override the `screen*` tokens with the Beehexa <a class=\"bh-link-underline\" href=\"/foundations/styles/layout/breakpoints/\">breakpoints</a>.** The default Ant Design Vue values are different (576, 992, 1200 and 1600 px).\n\nThe `Min` and `Max` tokens are computed from the defaults, not from your overrides. Set them too: each `Max` is the next breakpoint minus 1.\n\n| Beehexa | Value | Ant Design Vue tokens |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue has six breakpoints and Beehexa has four, so `sm` switches with `md`, and `xxl` with `xl`. Use the `xs`, `md`, `lg` and `xl` props of `a-col`.\n\nThe props of `a-col` and the responsive `gutter` of `a-row` then switch at the Beehexa widths. Do not use `xxxl`: its media query is malformed in Ant Design Vue 4.2.6 and never matches.\n\n## Grid\n\nAnt Design Vue divides a row into 24 parts. The Beehexa [grid](/foundations/styles/layout/grid/) has 4, 8 or 12 columns, and each one fits 24 exactly.\n\n| Beehexa grid | Window | `a-col` span |\n|---|---|---|\n| 4 columns | Below 768 px | Beehexa span × 6 |\n| 8 columns | 768 to 1023 px | Beehexa span × 3 |\n| 12 columns | 1024 px and up | Beehexa span × 2 |\n\n| Layout | Beehexa spans (4 / 8 / 12 / 12) | Props of each `a-col` |\n|---|---|---|\n| Cards, 1 to 4 a row | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Main panel | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Side panel | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Summary tile | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nAnt Design Vue rows have no gutter by default. Set it from the spacing tokens, and set the page margin on the content area.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## App frame\n\n| Region | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Side navigation, open | 280 px | `<a-layout-sider :width=\"280\">` |\n| Side navigation, collapsed | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nThe header is 64 px by default and has no token for its height, so set it in the header’s style.\n\nThe `breakpoint` prop of `a-layout-sider` uses fixed widths that ignore the `screen*` tokens. Do not use it. Set `collapsed` from your own media query and the user’s choice: open from 1024 px, collapsed to the rail when the user asks, and the choice remembered. Below 1024 px, hide the sider and show the menu in `a-drawer`.\n\nSee [Layout](/foundations/styles/layout/) for the frame.\n\n## Interactive table rows\n\nBind `data-bh-interactive=\"true\"` through `customRow` only when the complete row\nalready has an activation handler. The source companion owns the pointer cursor;\nnative selection keys/classes retain their selection recipe. Preserve accessible\nrow actions, keyboard behavior and actual record activation rather than replacing\nselection with a custom outline.\n\n\n## Native composition and optional variants\n\nUse the real native component. These opt-ins do not authorize a div-based\nreplacement, a skin-only wrapper, or copying Card/Button geometry into the app.\n\n- Native Card's `hoverable` prop remains optional. `data-bh-selected=\"true\"`\n adds a selected fill and independent inset cue; omitting it restores the base.\n In a composed selectable Card, `data-bh-card-action=\"primary\"` on the primary\n native text Button retains `aria-pressed` and keyboard focus without duplicating\n the outer Card's selected frame. Independent actions retain ordinary Button paint.\n- Reuse `bh-data-accent` with an existing semantic `data-bh-status`, `data-bh-band`,\n `data-bh-metric`, `data-bh-job-type` or `data-bh-priority` for an optional leading\n edge on a real Card. It adds no selection or hover behavior. A status/category\n edge survives selection; keyboard focus remains a separate outside outline.\n Bind the discriminator appropriate to that mark rather than conflating status\n with categorical identity. Labels are still mandatory.\n- `data-bh-layout=\"content\"` on a real Button allows a multiline composed label:\n auto height, normal wrapping, start alignment and the source default-control\n minimum height. Native props, padding and keyboard activation remain native.\n Use ordinary Button size/block props when they suffice.\n- `bh-ant-shell-region` removes native Header/Footer padding only when the region\n already contains the composed app header/footer. It does not change native\n height, paint or the surrounding responsive page-region layout.\n- `bh-card-link` on a real navigation anchor wrapping Card removes competing\n link paint/underline and supplies source keyboard focus, not Card skin.\n- `bh-ant-card-action-row` uses the native Card title/extra slots with a shrinkable\n leading track and reserved trailing action. Source head inset stays consistent\n across Card sizes; the real link remains a flexible inline title/metadata row.\n See [application content](/tools/application-content/#semantic-content-and-genuine-composition).\n- `bh-ant-metric-tooltip` on a native Tooltip overlay and `bh-metric-tooltip`\n on its semantic title-slot host separate date/header, metric definition list and\n explanation. The token-backed readable width is capped by the viewport; native\n popup placement, theme, keyboard and touch behavior stay with the actual owner.\n\nBusiness components may own data, state, behavior and meaningful composition of\nthese primitives. Inventory and remove redundant replacement components and every\nobsolete caller/import/export. Generated rich content must mount real native\nenhancement controls when the host framework permits it; a producer stylesheet\nalone is not evidence of missing native capability.\n\n\n### Operational and composed native content\n\n`Steps[data-bh-operational=\"true\"]` uses success/info/danger/subtle for native\nfinish/process/error/wait states. It leaves categorical navigation Steps unchanged.\nAn actual Step's `data-bh-skipped=\"true\"` adds a dashed tail in either orientation;\nthe caller retains ordering and the relationship's meaning. Custom icon slots do\nnot require rebuilding the Steps primitive.\n\n`Result[data-bh-layout=\"step\"]` retains a composed report's icon-and-title header\nrow, with subtitle/content and extra/actions below at full width. It only changes\nnative layout/padding; status paint and native slots remain native.\n\nThe native Tree title `data-bh-highlighted=\"true\"` is a temporary locator cue,\nnot a selected key or keyboard focus. Native selected/disabled treenodes suppress\nit; the source outline does not change title geometry.\n\nUse `bh-partner-logo-image` on a real Image for connector/brand assets.\nBind only the Source partner-image height and `width=\"auto\"`; native Image plus\nthe adapter preserves its intrinsic aspect ratio without a square frame or crop.\nActual identity Avatars stay native. Do not use brand hue as operational status.\n\n### Native Image preview\n\nThe official Image `zIndexPopupBase` and `zIndexPopup` tokens use `z-index.modal`.\nThat alone cannot clear an owner nested above it: AntD4.2.6 Preview drops\nboth declared Dialog `zIndex` and `wrapProps`. The setup composable\n`useNativeImagePreviewContainer(labelGetter)` from\n`@beehexa/ant-design-vue-tokens/image` owns the official lazy body portal:\npass its getter to native `preview.getContainer`. It names the real native\ndialog, reacts to locale changes and captures a layer above live owners on\neach opening, excluding its own previous layer. A closed portal is not an\noverlay owner. Its observer/container are disposed on unmount. Native Image\nstill owns zoom/pan, keyboard close and focus return; there is no custom viewer.\n\n\n`bh-ant-card-flush` opts a real Card body out of inset only for an edge-to-edge\nembedded editor, canvas or composed pane. Ordinary cards retain native padding.\nReuse `bh-ant-fill-card` and `bh-ant-fill-spin` for existing bounded flex hosts;\ndo not create parallel fill aliases or restore private consumer selectors.\nThe flush Card clips embedded paint to its native rounded frame. A direct\nbrowser iframe child has its UA border removed to avoid a second frame;\nsandbox/srcdoc and embedded-document behavior remain browser-owned.\n\n`semanticTableComponents` from `@beehexa/ant-design-vue-tokens/table` extends\nthe real Table's public `components` API. A column's `customCell` may return\n`{ scope: 'row' }`; its body cell becomes a semantic `th`, forwarding the native\nattributes and slot. Other cells remain `td`. AntD4 has no row-scope column prop\nand its body-cell CSS only targets `td`, so the source companion supplies the\nmatching row-header size/border/hover/selection recipe for this actual HTML\nsemantics gap. Native columns, rows and Summary remain native.\n\nAn actual native ListItem may opt into `data-bh-interactive=\"true\"` for a rich\nactivation row when no narrower native control meets its content contract.\nThe opt-in supplies hover/pointer/focus only; the consumer supplies a real action,\nkeyboard activation and accessible role. Do not nest competing interactive targets.\n\n\nConnector and partner brands share `content.partner-logo.image-size` as their\nrendered height, not a width cap. Keep natural width; wrap rows when needed.\nSemantic icon-height roles likewise preserve proportional width and hit targets.\nNative Table already styles `tfoot > tr > th` geometry at each size; the companion\nadds only its missing Summary row-header border and semantic weight/alignment.\n`a-typography-link[data-bh-target=\"responsive\"]` uses the source minimum24px\ntarget, increasing to44px only on coarse pointers; it adds no link skin.\n\n\nFlush Cards clip embedded paint to their actual rounded frame. Native Drawer\nfooters retain their canonical inset or the device's safe-area inset, whichever\nis larger. `Spin[data-bh-mode=\"nonblocking\"]` removes the native veil/pointer\nblock only for progressive content that remains inspectable; omit it for actual\nblocking work such as export. This does not change spinner timing or graph data.\n\n\n## Read-only segmented native Progress\n\nFor “Step 3 of 7” feedback, use the real native `Progress` with its actual\n`steps` and `percent`. This is not navigation: do not substitute `Steps`,\n`Segmented`, a fabricated row of marks, or another progress engine.\n\nAntD4 `size=\"small\"` deliberately renders each step as a **2 × 8px vertical\nfragment**. Its native `[width, height]` tuple means **per-segment** geometry.\nThe source helper resolves `content.step-progress.segment-width` and\n`segment-height` to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Step {{ props.index }} of {{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n status=\"normal\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nThe feature owns the real positive total, current index, status text and\nbusiness transitions. The helper supplies geometry only; native Progress\nowns the rendered count and active marks. Hide the redundant bar from assistive\ntechnology only when adjacent text already conveys the same progress.\n\nFor current-position feedback, explicitly set `status=\"normal\"`: reaching the\nlast authored group does not mean the operation succeeded. Render failure or\ncompletion status only from actual workflow evidence, independently of the\nindex. A one-group workflow still has one real mark; an absent/zero total has no\nbar. Do not manufacture a denominator from screenshot geometry or API-step count.\n\n`bh-ant-step-progress` opts that native root into intrinsic inline width,\nzero native outer margins, the source `content.step-progress.gap` (4px at\nroot16), and wrapping without a trailing item margin. CSS does not replace\nthe native size API or set per-mark width/height. The bar follows the status\non a wide row and wraps within the available width on mobile.\n\nOmit the class and helper to retain the native base. Ordinary percentage,\nupload and countdown progress do not opt in. The shared live matrix below\nincludes a real native no-opt-in comparison, editable total and first/middle/\nfinal controls; check both root16 and root20, light/dark and narrow widths.\n\n## Thin navigation Progress\n\nFor route-loading feedback use real native `Progress` with `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` and its native size tuple.\nUse `border.width.focused` for the thin line and `color.brand.yellow` for its optional\nbrand stroke. The application owns fixed viewport positioning at `top: 0`, width and\nits layer from the seven [z-index](/foundations/styles/z-index/) tokens; the adapter removes AntD's inline baseline gap and outer margins,\nso the actual ink begins at the allocated top edge without negative offsets.\n\nProgress reflects completed navigation milestones, not invented network percentages.\nKeep the previous page while guards and route chunks resolve, advance to100%, and await\nthe actual finite native width transition before committing the new page. Cancellation,\nerrors and superseding navigation must clear their own progress without clearing a newer\nrequest. The source width transition uses `motion.duration.default` and\n`motion.easing.linear`; reduced motion removes it. Keep a named progressbar with actual\nmilestone values, and never use a page-covering scrim just to load a route.\n\n## One native control family, distinct roles\n\nUse native default Button for compact bordered utility triggers (including\nlanguage and theme), with the same native size as adjacent page controls.\nUse the public `#icon` slot and one label child; icon-only Buttons still need\nan accessible name. Do not disguise `type=\"text\"` globally as a default Button.\nA frameless account/avatar menu legitimately uses `type=\"text\"`, a real Avatar\nand native Space: center it in the row rather than inventing a shell skin.\n\nButton small/default/large use source control heights24/32/40px at the nominal\nroot; typography is label-small for small and label-default otherwise.\nButton/Input/Select and side navigation items use `radius.control`; Select popups and menus use `radius.overlay`.\nThe numeric theme/root observer and rem CSS scale together.\nAntD4 only inserts margin for `.anticon` siblings, not Lucide SVGs in `#icon`;\nthe source supplies one space100 flex gap for all real Buttons and removes\nthe competing native/loading-icon margin. No shell-specific class is needed.\nNative default/primary/text/link, disabled/loading, hover/pressed and keyboard\nfocus remain distinct. `data-bh-target=\"responsive\"` adds touch minimums only\non coarse pointers. Open Dropdown/Menu state is not Button selection; keep\n`aria-expanded`, menu keyboard behavior and focus return in the actual feature.\n\nThe primary neutral-bold/inverse pair is intentional: graphite in light mode,\nlight graphite with dark text in dark mode. A pale dark-mode Continue action\nis not a reason to recolor every primary or text Button blue. Link actions\nretain the source link palette; default utility actions remain bordered.\n\n| Native variant | Source role and state contract |\n| --- | --- |\n| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |\n| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |\n| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |\n| Danger default / dashed / text / ghost | Readable danger text; outlined variants retain danger borders. Available non-link variants use danger-subtle hover/pressed fill. Ghost starts transparent, never with the solid on-bold label. |\n| Link / text | Distinct link/frameless roles, not a disguised default Button. |\n| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |\n| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |\n\nAntD4 paints a **resting lower shadow** from `controlOutline` on primary,\n`controlTmpOutline` on default, and `colorErrorOutline` on danger-primary.\nThose names are not exclusively keyboard-focus inputs. Reusing the global\nblue focus alias there produces a stranded blue stripe even after all\nanimations finish. The source scopes these three Button component aliases\nto transparent; it does not clear the global focus role or set its width\nto zero.\n\nNative Button keyboard focus instead reads `colorPrimaryBorder` and\n`lineWidthBold`. Its component overrides use source focus color/width.\nThe companion's enabled `:focus-visible` rule supplies the independent,\ngapped source outline/offset. Default/dashed state fills and the separate\ndanger text/on-bold pairs are the remaining native-token gaps; source CSS\nhandles only those cases, excluding disabled controls and genuine selection.\nApps must not add a local shadow/border reset or a focus suppression.\n\nThe compact native dock uses `bh-control-group` and `data-bh-variant=\"dock\"`\non Space. Its neutral text-action paint excludes danger, ghost, real selected\ntoggles, loading controls and disabled anchors, so the same role/state contracts\nstill apply inside the dock. Open actions may use `aria-expanded`; genuine\ntoggles use `aria-pressed` and retain the selected fill plus structural indicator.\nAntD4 href Buttons render anchors with a native `disabled` attribute, not the\n`:disabled` pseudo-class or a generated disabled class. Native enabled hover/active\nselectors still match those anchors. The companion recognises `[disabled]` and\n`aria-disabled=\"true\"` with sufficient native-state specificity: disabled text\nstays disabled; fill/border roles match the native non-href Button for solid,\ntext/link, ghost and danger/ghost combinations. Set the native `disabled` prop, supply\n`aria-disabled=\"true\"` and `tabindex=\"-1\"` for an unavailable href Button; native\nAntD click handling blocks its navigation. ARIA or CSS alone never disables a\nlink. Do not manufacture AntD classes or replace genuine links with pointer-only\nhandlers.\n\n### Live native state and progress matrix\n\nUse the site theme/language controls and browser root font preference.\nChange Button size, hover/hold a press, Tab/Enter/Space through available\nactions, and inspect actual activation counts. Loading/disabled Buttons and\ngenuine disabled href variants must not activate, including inside the compact dock.\nToggle its selected action and check danger hover/pressed without neutral repaint.\nThe long native Card title wraps independently of its extra action on mobile.\nSwitch examples include loading and disabled together; loading retains checked\npaint and the spinner while callbacks stay blocked. Progress uses the same actual\ncount/index for its opt-in and no-opt-in renderers.\n\n<NativeControlsDemo />\n\n\n### Native mobile composition and bounded content\n\nThe adapter stretches joined Input/Search/compact-group fields and their actions\nas one row, including validation, disabled states and coarse-pointer targets.\nIcon-only Buttons keep their native size proportions; on coarse pointers both\naxes reach `size.target.touch`. Content-layout Buttons retain multiline text\nwithout overriding explicit or responsive touch minimums.\n\nBelow `breakpoint.md`, every native Card header/meta title wraps, including\ndescendant Typography ellipsis, Tags and Space. This is global readable content,\nnot an optional consumer override. Header extras remain available. Standard\nTimeline dots, tails and custom dots align to the first content line; wrapped\nevent content stays in the native timeline column. Label/alternate/right\ntimelines retain their distinct native alignment.\nFor event rows with inline native small Buttons, bind `data-bh-layout=\"actions\"`\non the Timeline and center the native Flex row. This shares the first line's\nallocation with `size.control.small` (or `size.target.touch` on coarse pointers),\nso the dot/tail do not stay above text beside a taller touch action. Plain text\ntimelines keep their normal source line box. AntD4 Timeline exposes no component\nsizing token; this bounded composition does not change label/right/alternate modes.\n\nAntD4 Flex does not forward arbitrary `role`, `aria-*`, `data-*` or DOM listeners.\nDo not put required semantics, source opt-ins or keyboard handlers on it. Use\nnative Space/Typography where appropriate, or retain a real semantic host with\nminimal structural flex/grid CSS. Do not introduce a forwarding wrapper.\n\nUse `bh-content-toolbar` and `bh-content-toolbar__group` on actual intrinsic\ntext-editor toolbar hosts; the source owns spacing, padding, wrapping and mobile\ncontrol minimums. Graph navigation instead uses the compact Source dock floating\ninside its drawing viewport, default lower-left, never a full-width header band.\nFollow the [canvas dock contract](/tools/mermaid/#shared-drawing-viewport-and-dock)\nwithout copying graph-only actions to text editors. These are shared recipes,\nnot page-specific skins. Keep hosts and flex children shrinkable with `min-width: 0`.\n\nBind `bh-ant-fill-spin` through Spin's **wrapperClassName**, not its class:\nthe nested-loading wrapper carries the bounded height. Drawer fill/flush modes\ntraverse the native content-wrapper/content/wrapper-body chain; header/footer\nremain intrinsic and the body owns the remaining space. Tabs fill only their\nown active pane. Consumers supply the actual bounded parent, not guessed\nviewport-minus-header heights. Monaco/Mermaid observe that host's dimensions\nwithout replacing the editor model or resetting existing chart pan/zoom.\n\n",
|
|
2123
2123
|
"frontmatter": {
|
|
2124
2124
|
"title": "Ant Design Vue theme",
|
|
2125
2125
|
"description": "Make Ant Design Vue components use Beehexa design tokens, breakpoints, grid, control heights and app frame.",
|
|
@@ -2208,8 +2208,8 @@
|
|
|
2208
2208
|
"status": "active",
|
|
2209
2209
|
"releasePhase": null,
|
|
2210
2210
|
"planned": [],
|
|
2211
|
-
"body": "\nimport NativeFlowDemo from '../../components/NativeFlowDemo.astro';\n\n## Native anatomy and execution demonstration\n\n<NativeFlowDemo />\n\nThis is the public native compact model rendered by Mermaid, not a set of HTML\nlookalike cards. Switch execution evidence off to inspect the untouched definition;\nthe example's run readings are explicitly sample data, not business-success claims.\nChange the site theme/language, direction and zoom, select with a pointer or keyboard,\nthen export the actual SVG. Category masks, native shapes, edge labels and typed\nstate geometry survive those changes.\n\nUse `@beehexa/mermaid-tokens` for every Mermaid initialization. It returns a fresh\n`MermaidConfig` from `@beehexa/design-tokens`; Mermaid remains a peer dependency.\nPass the active `dark` and `locale` on every render. A theme or language change\nrequires rendering again: SVG paint and text measurements do not update from CSS alone.\n\n```ts\nimport { createMermaidConfig, createCanvasTheme } from '@beehexa/mermaid-tokens';\n\nmermaid.initialize(createMermaidConfig({ dark: true, locale: 'vi' }));\nconst canvas = createCanvasTheme({ dark: true, locale: 'vi' });\n```\n\nThe factory secures `theme`, `look`, `themeVariables`, `themeCSS`, `fontFamily`,\n`fontSize` and `htmlLabels` before `layout`. Mermaid 12 appends this secure array\nto its own default security keys. Definition init CSS must not replace rich-card\ntoken fonts; topology, definition-owned state styles and unrelated layout directives\nremain available. This configuration contract is not a claim that a rendered smoke\nmatrix has passed.\n\n## Meaning before colour\n\n`diagram.*` roles describe an operational execution graph, not an explanatory\nbrand schematic or a chart series palette. The same roles apply to the drawing,\nits inspector and its exported artifact.\n\n- Default and indeterminate nodes use `node-*` neutral pairs.\n- `state-ran-ok` means **ran without a reported failure**, not a verified business\n success. Informational paint and a completion marker distinguish execution from\n untouched nodes without using business-success green. HTTP/business outcomes\n retain their appropriate status labels independently.\n- Failed nodes use `fail-*`, with a failure marker and state text.\n- Log-only `log-reached` uses a reach marker. `log-unfinished` uses warning\n paint, an ellipsis and a dashed boundary; it is never a proven failure.\n- Never-reached nodes use `unreached-*` and an explicit state label; they are not\n disabled controls. Not-taken branches use `nottaken-*` plus a dashed boundary.\n- Repeat counts use the neutral `badge-*` pair. Repetition alone is not a warning.\n- Category glyphs use `tile-*`. They identify step type, not run state.\n- Selection and hover use `selection-ring` as **separate geometry outside the\n node boundary**. Never repaint a failed node to indicate that it is selected.\n- Field labels use `code-key`, values `code-value`, on `code-bg`. These descriptive\n fields are not links. Full code blocks retain the existing `color.code.*` pair.\n\nAlways keep labels, markers, shapes or dash patterns: colour alone is not evidence.\nPair foregrounds only with their named fills. Validate actual SVG text and meaningful\nline contrast in both themes; token existence does not certify a rendered diagram.\n\n## Type, space and interaction\n\n`diagram.node-font` aliases `font.body.default`, including taller Vietnamese lines.\nUse complete source font styles for node labels, inspector titles, metadata and code.\nDo not replace their weight or line height with component-specific recipes. Let\nVietnamese marks and long labels wrap without clipping. `diagram.padding` is internal\nnode padding; `diagram.export-padding` frames fitted/exported drawing bounds. Graph\ncoordinates and existing layout topology are not spacing-scale choices.\n\nNative compact worker flows keep the actual `compactFlowMermaid` output and the\npublic `flowStylesheet()` from `@beehexa/hexasync-template-model`. Install that\nsheet before Mermaid measures labels, then include it in the SVG for standalone\nexport. Add `hx-flow` to the SVG root and bind `workerFlowSvgStyle(canvas)` from\n`@beehexa/mermaid-tokens` as its inline style. Native card geometry, family masks\nand typed state line-work remain native; the adapter owns literal source paint,\nneutral category tile/glyph pairs and the canonical tile radius.\n\nThe native model now encloses the complete escaped title in renderer-owned `<b>`\nand separates secondary `KEY · TYPE` metadata with its native `<br>`. The adapter\nbinds the entire title to `font.heading.xsmall` and metadata to `font.body.small`;\nwrapping never changes a title line into metadata. Source supplies the fixed\ncategory tile/glyph dimensions and neutral pair, without replacing native shapes,\nfamily masks, state markers or compact/public address mapping. Authored markup\nremains escaped; a consumer must not mutate labels or substitute an emitter.\n\nThis anatomy is implemented in the canonical model source. The pinned published\nmodel predates the full-title implementation; local verification uses its built\npublic export through `HEXASYNC_LOCAL_PACKAGES=1`, not a source alias. A local\nbuild is not a claim that the model or this site has been released.\nEmbedded SVG CSS also supplies opaque source edge-label pairs and explicit\n`\"cv05\", \"cv08\"` features alongside the complete font shorthand; SVG/export must\nnot depend on the document's universal font-feature rule.\n\nInteractive preview nodes opt in with `bh-mermaid-interactive-node` on the actual\nSVG group. Keep native role/tabindex, keyboard handling and real selection state;\nbind `aria-selected=\"true\"` for a supported selectable role or `aria-pressed=\"true\"`\nfor a toggle button, never merely for expansion. The embedded\nstylesheet adds `border.width.focused` / `diagram.selection-ring` outside the node\non hover, focus-visible and selection with `state.focus.offset`; it never repaints\nrun-state fill/stroke. `bh-mermaid-category-glyph` on authored SVG icon paths uses\n`diagram.tile-glyph`, `border.width.default` and round caps/joins. Path coordinates\nand transforms remain graph geometry.\n\nImport `@beehexa/mermaid-tokens/css` once for HTML surrounding the SVG.\n`data-bh-diagram=\"canvas|code|key|value|description|badge\"` selects existing\n`diagram.canvas`, `code-bg`, `code-key`, `code-value`, `node-desc` and the paired\nrepeat-count badge roles. The badge recipe includes its ordinary `radius.050`\nlabel frame; content font markers and structural composition remain independent.\nNo local colour, border or canvas-background recipes are required.\n\nEmbedded `foreignObject` text also sets `-webkit-text-fill-color: currentcolor`.\nThis bridges HTML-to-image clones to the already resolved SVG label colour rather\nthan a document host's inherited text-fill; do not inject a second app stylesheet\nduring PNG capture.\n\nActual pan/zoom hosts use `bh-diagram-viewport`, with\n`data-bh-dragging=\"true\"` only during dragging, for grab/grabbing, touch-action\nand user-select behavior. The application retains event handling, pointer capture,\nviewport transforms, clipping and fit/export bounds; no native Mermaid layout API\ncan replace those application gesture mechanics. Rich nodes with decorated outer\nrings use `data-bh-clickable=\"true\"` and `data-bh-ring=\"hover\"` on the hover ring.\nEmbedded CSS owns pointer/hover visibility, without changing ring geometry or the\nseparate selection/disclosure state.\n\nNative evidence-navigation buttons use `data-bh-diagram=\"occurrence\"` with\n`aria-current=\"true\"` to underline the current occurrence. This is navigation\nstate, not an execution-status colour; native focus/keyboard behavior stays intact.\n\nRectangular node/cluster/actor/note surfaces, execution cards, category tiles and\nsmall label surfaces use `radius.100` (8 px), including SVG export. Circles,\ndiamonds and edge paths retain topology geometry. Inspector cards remain 8 px.\nViewport docks use an 8 px frame with 4 px padding and actual 4 px control\nbuttons, not 8 px Button corners. Dialogs/drawers use `radius.150` (12 px).\nFollow the [Radius role scale](/foundations/styles/radius/).\n\nAuthoring previews use `diagram.preview-height` for both split panels and\n`diagram.minimum-height` for the drawing viewport; fullscreen fills the enclosing\nhost instead. Read-only split diagrams retain a zero minimum so they shrink with\ntheir host. Structured evidence viewers use `diagram.evidence-height`; multiple\nrequest-body panes use `diagram.evidence-minimum-height` to keep every part reachable.\n\n\nUse a flat opaque sheet. No gradients, glass, decorative animation, animated\ntraversal or state transitions. Retain zoom, fit, fullscreen/escape and PNG export\ncontrols. Interaction must not overwrite definition-owned fill, stroke, dashes or\nfailure markers. Controls stay outside the captured SVG host.\n\n## Export the rendered theme\n\nResolve literal token values for Mermaid configuration fields that require them.\nNative worker-flow CSS uses its own `--hx-*` properties; Source supplies their\nsemantic paint and preserves native literal evidence-edge/arrowhead paint.\nSnapshot the rendered theme and opaque canvas background on the SVG host. Export the live, fully decorated drawing at its natural bounds with\n`exportPadding`, not the transformed viewport. Preserve the snapshot even if the\napplication theme changes before the new drawing lands. Fonts, locale line height,\nstate paint and outer selection geometry must survive SVG/PNG capture. A transparent\nimage or white sheet behind dark labels is not a valid fallback.\n\nThe native demo snapshots its opaque canvas colour onto each completed SVG before\nexport. Both the supported published model's plain `<p>` labels and local rich\n`<b>` titles retain one completion/reached/unfinished/failure glyph, not colour\nalone. Embedded body/title font shorthands explicitly retain Source `font.features`,\nso standalone downloads do not depend on document-wide token CSS for character variants.\n\nAll package source is in `tokens/diagram.json`; consumers must not maintain a\nsecond palette or copy generated token values. Local package references are for\nlocal development only until an authorized release exists.\n\nUse the actual installed model APIs: `compactWorkerFlow` supplies its public\ncompact graph and authored-address-to-compact-id map, and `compactFlowMermaid`\nserializes that graph. `RenderNodeOverlay` accepts only `{ state?, repeat? }`;\ndo not pass `roles`, caller colour resolvers, stroke overrides or unsupported\nrenderer options. The native model owns state readings, repeat badges and\nimplicit `indeterminate` nodes once any drawn state is supplied.\n\nLog mentions establish only `reached` or `unfinished`, never typed `ranOk` or\n`ranFailed` evidence. The Source `mermaidEvidenceStyles` adapter accepts compact\nnode IDs, actual public compact edge indices and explicit `{ dark, locale }`.\nTyped evidence takes precedence for named steps and their owned junctions, even when\na failed owner's junction has no explicit state. Consumers retain authored\naddress resolution, failure attribution, repeated occurrences and execution data;\nsource owns theme paint and interaction recipes. No second palette is required.\n\nEdge emphasis uses literal Source colours, not `var(...)` or custom-property\ndeclarations: Mermaid12's DSL rejects those functions. Do not append `!important`\ninside the DSL: native coloured-marker cloning treats that suffix as part of\nthe SVG colour attribute. After rendering/sanitization,\n`preserveMermaidDefinitionPaint(svg)` promotes the actual native edge stroke and\nexplicit coloured-marker attributes over the worker sheet's neutral important\npaint, without changing paths, marker geometry or IDs. Unknown transitions remain\nunknown; consecutive recorded global indices may prove a unique direct edge,\nbut two executed endpoints alone do not prove a typed traversal.\n\n## Shared drawing viewport and dock\n\nData Flow is the canonical canvas reference: `diagram.canvas` and `diagram.grid`,\nwith `diagram.grid-gap` (16 px) grid spacing and `diagram.grid-dot` (1 px) dots in camera coordinates. These are graph\ngeometry, not reader-target dimensions. `.bh-diagram-viewport` supplies the Source\ndot pattern; bind its `--bh-canvas-grid-x`, `--bh-canvas-grid-y` and\n`--bh-canvas-grid-scale` to the existing camera. The SVG root and default stage\nbody (`diagram.group-fill`) are transparent on screen, not opaque pale sheets\ncovering the grid. Native stage boundaries/titles remain intact. Export still\nuses the rendered theme's snapshotted opaque Source canvas.\n\nPut real native controls **inside** that viewport, outside the transformed drawing\nand captured SVG host. `bh-diagram-dock` on native Space plus `bh-control-group`\n`data-bh-variant=\"dock\"` supplies the lower-left floating dock and shared native\nData Flow control family. No separate external toolbar/header row and no reserved\nblank band. Stop pointer/wheel/non-Escape keyboard propagation on the dock,\npreserving native focus, popups and overlay Escape handling. Keep genuine action\ndifferences; do not copy Data Flow-only actions into Mermaid.\n\nThe complete native Space role combination keeps both Source insets inside the\nallocated viewport, including below-readable-minimum hosts. Its width constraint\ntakes precedence over the generic control-group width. Keep one native horizontal\nscroll row so every action remains fully reachable at larger reader roots; do not\nclip the last action or override the dock width in a consumer.\n\n",
|
|
2212
|
-
"raw": "---\ntitle: Mermaid and execution diagrams\ndescription: Source-backed Mermaid configuration, descriptive execution states, interaction and image export.\norder: 6\n---\n\nimport NativeFlowDemo from '../../components/NativeFlowDemo.astro';\n\n## Native anatomy and execution demonstration\n\n<NativeFlowDemo />\n\nThis is the public native compact model rendered by Mermaid, not a set of HTML\nlookalike cards. Switch execution evidence off to inspect the untouched definition;\nthe example's run readings are explicitly sample data, not business-success claims.\nChange the site theme/language, direction and zoom, select with a pointer or keyboard,\nthen export the actual SVG. Category masks, native shapes, edge labels and typed\nstate geometry survive those changes.\n\nUse `@beehexa/mermaid-tokens` for every Mermaid initialization. It returns a fresh\n`MermaidConfig` from `@beehexa/design-tokens`; Mermaid remains a peer dependency.\nPass the active `dark` and `locale` on every render. A theme or language change\nrequires rendering again: SVG paint and text measurements do not update from CSS alone.\n\n```ts\nimport { createMermaidConfig, createCanvasTheme } from '@beehexa/mermaid-tokens';\n\nmermaid.initialize(createMermaidConfig({ dark: true, locale: 'vi' }));\nconst canvas = createCanvasTheme({ dark: true, locale: 'vi' });\n```\n\nThe factory secures `theme`, `look`, `themeVariables`, `themeCSS`, `fontFamily`,\n`fontSize` and `htmlLabels` before `layout`. Mermaid 12 appends this secure array\nto its own default security keys. Definition init CSS must not replace rich-card\ntoken fonts; topology, definition-owned state styles and unrelated layout directives\nremain available. This configuration contract is not a claim that a rendered smoke\nmatrix has passed.\n\n## Meaning before colour\n\n`diagram.*` roles describe an operational execution graph, not an explanatory\nbrand schematic or a chart series palette. The same roles apply to the drawing,\nits inspector and its exported artifact.\n\n- Default and indeterminate nodes use `node-*` neutral pairs.\n- `state-ran-ok` means **ran without a reported failure**, not a verified business\n success. Informational paint and a completion marker distinguish execution from\n untouched nodes without using business-success green. HTTP/business outcomes\n retain their appropriate status labels independently.\n- Failed nodes use `fail-*`, with a failure marker and state text.\n- Log-only `log-reached` uses a reach marker. `log-unfinished` uses warning\n paint, an ellipsis and a dashed boundary; it is never a proven failure.\n- Never-reached nodes use `unreached-*` and an explicit state label; they are not\n disabled controls. Not-taken branches use `nottaken-*` plus a dashed boundary.\n- Repeat counts use the neutral `badge-*` pair. Repetition alone is not a warning.\n- Category glyphs use `tile-*`. They identify step type, not run state.\n- Selection and hover use `selection-ring` as **separate geometry outside the\n node boundary**. Never repaint a failed node to indicate that it is selected.\n- Field labels use `code-key`, values `code-value`, on `code-bg`. These descriptive\n fields are not links. Full code blocks retain the existing `color.code.*` pair.\n\nAlways keep labels, markers, shapes or dash patterns: colour alone is not evidence.\nPair foregrounds only with their named fills. Validate actual SVG text and meaningful\nline contrast in both themes; token existence does not certify a rendered diagram.\n\n## Type, space and interaction\n\n`diagram.node-font` aliases `font.body.default`, including taller Vietnamese lines.\nUse complete source font styles for node labels, inspector titles, metadata and code.\nDo not replace their weight or line height with component-specific recipes. Let\nVietnamese marks and long labels wrap without clipping. `diagram.padding` is internal\nnode padding; `diagram.export-padding` frames fitted/exported drawing bounds. Graph\ncoordinates and existing layout topology are not spacing-scale choices.\n\nNative compact worker flows keep the actual `compactFlowMermaid` output and the\npublic `flowStylesheet()` from `@beehexa/hexasync-template-model`. Install that\nsheet before Mermaid measures labels, then include it in the SVG for standalone\nexport. Add `hx-flow` to the SVG root and bind `workerFlowSvgStyle(canvas)` from\n`@beehexa/mermaid-tokens` as its inline style. Native card geometry, family masks\nand typed state line-work remain native; the adapter owns literal source paint,\nneutral category tile/glyph pairs and the canonical tile radius.\n\nThe native model now encloses the complete escaped title in renderer-owned `<b>`\nand separates secondary `KEY · TYPE` metadata with its native `<br>`. The adapter\nbinds the entire title to `font.heading.xsmall` and metadata to `font.body.small`;\nwrapping never changes a title line into metadata. Source supplies the fixed\ncategory tile/glyph dimensions and neutral pair, without replacing native shapes,\nfamily masks, state markers or compact/public address mapping. Authored markup\nremains escaped; a consumer must not mutate labels or substitute an emitter.\n\nThis anatomy is implemented in the canonical model source. The pinned published\nmodel predates the full-title implementation; local verification uses its built\npublic export through `HEXASYNC_LOCAL_PACKAGES=1`, not a source alias. A local\nbuild is not a claim that the model or this site has been released.\nEmbedded SVG CSS also supplies opaque source edge-label pairs and explicit\n`\"cv05\", \"cv08\"` features alongside the complete font shorthand; SVG/export must\nnot depend on the document's universal font-feature rule.\n\nInteractive preview nodes opt in with `bh-mermaid-interactive-node` on the actual\nSVG group. Keep native role/tabindex, keyboard handling and real selection state;\nbind `aria-selected=\"true\"` for a supported selectable role or `aria-pressed=\"true\"`\nfor a toggle button, never merely for expansion. The embedded\nstylesheet adds `border.width.focused` / `diagram.selection-ring` outside the node\non hover, focus-visible and selection with `state.focus.offset`; it never repaints\nrun-state fill/stroke. `bh-mermaid-category-glyph` on authored SVG icon paths uses\n`diagram.tile-glyph`, `border.width.default` and round caps/joins. Path coordinates\nand transforms remain graph geometry.\n\nImport `@beehexa/mermaid-tokens/css` once for HTML surrounding the SVG.\n`data-bh-diagram=\"canvas|code|key|value|description|badge\"` selects existing\n`diagram.canvas`, `code-bg`, `code-key`, `code-value`, `node-desc` and the paired\nrepeat-count badge roles. The badge recipe includes its ordinary `radius.050`\nlabel frame; content font markers and structural composition remain independent.\nNo local colour, border or canvas-background recipes are required.\n\nEmbedded `foreignObject` text also sets `-webkit-text-fill-color: currentcolor`.\nThis bridges HTML-to-image clones to the already resolved SVG label colour rather\nthan a document host's inherited text-fill; do not inject a second app stylesheet\nduring PNG capture.\n\nActual pan/zoom hosts use `bh-diagram-viewport`, with\n`data-bh-dragging=\"true\"` only during dragging, for grab/grabbing, touch-action\nand user-select behavior. The application retains event handling, pointer capture,\nviewport transforms, clipping and fit/export bounds; no native Mermaid layout API\ncan replace those application gesture mechanics. Rich nodes with decorated outer\nrings use `data-bh-clickable=\"true\"` and `data-bh-ring=\"hover\"` on the hover ring.\nEmbedded CSS owns pointer/hover visibility, without changing ring geometry or the\nseparate selection/disclosure state.\n\nNative evidence-navigation buttons use `data-bh-diagram=\"occurrence\"` with\n`aria-current=\"true\"` to underline the current occurrence. This is navigation\nstate, not an execution-status colour; native focus/keyboard behavior stays intact.\n\nRectangular node/cluster/actor/note surfaces, execution cards, category tiles and\nsmall label surfaces use `radius.100` (8 px), including SVG export. Circles,\ndiamonds and edge paths retain topology geometry. Inspector cards remain 8 px.\nViewport docks use an 8 px frame with 4 px padding and actual 4 px control\nbuttons, not 8 px Button corners. Dialogs/drawers use `radius.150` (12 px).\nFollow the [Radius role scale](/foundations/styles/radius/).\n\nAuthoring previews use `diagram.preview-height` for both split panels and\n`diagram.minimum-height` for the drawing viewport; fullscreen fills the enclosing\nhost instead. Read-only split diagrams retain a zero minimum so they shrink with\ntheir host. Structured evidence viewers use `diagram.evidence-height`; multiple\nrequest-body panes use `diagram.evidence-minimum-height` to keep every part reachable.\n\n\nUse a flat opaque sheet. No gradients, glass, decorative animation, animated\ntraversal or state transitions. Retain zoom, fit, fullscreen/escape and PNG export\ncontrols. Interaction must not overwrite definition-owned fill, stroke, dashes or\nfailure markers. Controls stay outside the captured SVG host.\n\n## Export the rendered theme\n\nResolve literal token values for Mermaid configuration fields that require them.\nNative worker-flow CSS uses its own `--hx-*` properties; Source supplies their\nsemantic paint and preserves native literal evidence-edge/arrowhead paint.\nSnapshot the rendered theme and opaque canvas background on the SVG host. Export the live, fully decorated drawing at its natural bounds with\n`exportPadding`, not the transformed viewport. Preserve the snapshot even if the\napplication theme changes before the new drawing lands. Fonts, locale line height,\nstate paint and outer selection geometry must survive SVG/PNG capture. A transparent\nimage or white sheet behind dark labels is not a valid fallback.\n\nThe native demo snapshots its opaque canvas colour onto each completed SVG before\nexport. Both the supported published model's plain `<p>` labels and local rich\n`<b>` titles retain one completion/reached/unfinished/failure glyph, not colour\nalone. Embedded body/title font shorthands explicitly retain Source `font.features`,\nso standalone downloads do not depend on document-wide token CSS for character variants.\n\nAll package source is in `tokens/diagram.json`; consumers must not maintain a\nsecond palette or copy generated token values. Local package references are for\nlocal development only until an authorized release exists.\n\nUse the actual installed model APIs: `compactWorkerFlow` supplies its public\ncompact graph and authored-address-to-compact-id map, and `compactFlowMermaid`\nserializes that graph. `RenderNodeOverlay` accepts only `{ state?, repeat? }`;\ndo not pass `roles`, caller colour resolvers, stroke overrides or unsupported\nrenderer options. The native model owns state readings, repeat badges and\nimplicit `indeterminate` nodes once any drawn state is supplied.\n\nLog mentions establish only `reached` or `unfinished`, never typed `ranOk` or\n`ranFailed` evidence. The Source `mermaidEvidenceStyles` adapter accepts compact\nnode IDs, actual public compact edge indices and explicit `{ dark, locale }`.\nTyped evidence takes precedence for named steps and their owned junctions, even when\na failed owner's junction has no explicit state. Consumers retain authored\naddress resolution, failure attribution, repeated occurrences and execution data;\nsource owns theme paint and interaction recipes. No second palette is required.\n\nEdge emphasis uses literal Source colours, not `var(...)` or custom-property\ndeclarations: Mermaid12's DSL rejects those functions. Do not append `!important`\ninside the DSL: native coloured-marker cloning treats that suffix as part of\nthe SVG colour attribute. After rendering/sanitization,\n`preserveMermaidDefinitionPaint(svg)` promotes the actual native edge stroke and\nexplicit coloured-marker attributes over the worker sheet's neutral important\npaint, without changing paths, marker geometry or IDs. Unknown transitions remain\nunknown; consecutive recorded global indices may prove a unique direct edge,\nbut two executed endpoints alone do not prove a typed traversal.\n\n## Shared drawing viewport and dock\n\nData Flow is the canonical canvas reference: `diagram.canvas` and `diagram.grid`,\nwith `diagram.grid-gap` (16 px) grid spacing and `diagram.grid-dot` (1 px) dots in camera coordinates. These are graph\ngeometry, not reader-target dimensions. `.bh-diagram-viewport` supplies the Source\ndot pattern; bind its `--bh-canvas-grid-x`, `--bh-canvas-grid-y` and\n`--bh-canvas-grid-scale` to the existing camera. The SVG root and default stage\nbody (`diagram.group-fill`) are transparent on screen, not opaque pale sheets\ncovering the grid. Native stage boundaries/titles remain intact. Export still\nuses the rendered theme's snapshotted opaque Source canvas.\n\nPut real native controls **inside** that viewport, outside the transformed drawing\nand captured SVG host. `bh-diagram-dock` on native Space plus `bh-control-group`\n`data-bh-variant=\"dock\"` supplies the lower-left floating dock and shared native\nData Flow control family. No separate external toolbar/header row and no reserved\nblank band. Stop pointer/wheel/non-Escape keyboard propagation on the dock,\npreserving native focus, popups and overlay Escape handling. Keep genuine action\ndifferences; do not copy Data Flow-only actions into Mermaid.\n\nThe complete native Space role combination keeps both Source insets inside the\nallocated viewport, including below-readable-minimum hosts. Its width constraint\ntakes precedence over the generic control-group width. Keep one native horizontal\nscroll row so every action remains fully reachable at larger reader roots; do not\nclip the last action or override the dock width in a consumer.\n\n",
|
|
2211
|
+
"body": "\nimport NativeFlowDemo from '../../components/NativeFlowDemo.astro';\n\n## Native anatomy and execution demonstration\n\n<NativeFlowDemo />\n\nThis is the public native compact model rendered by Mermaid, not a set of HTML\nlookalike cards. Set execution evidence to none to inspect the untouched definition,\nto typed outcomes for `ranOk` / `ranFailed` / `neverReached` / `branchNotTaken` (the\nedge into the not-taken branch is dashed `6 3`), or to log-derived readings for\n`mermaidEvidenceStyles` node `reached` / `unfinished` and edge `reached` / `unfinished`\n(dashed `4 3`) / `failed`. The run readings are explicitly sample data, not business-success claims.\nChange the site theme/language, direction and zoom, select with a pointer or keyboard,\nthen export the actual SVG. Category masks, native shapes, edge labels and typed\nstate geometry survive those changes.\n\nUse `@beehexa/mermaid-tokens` for every Mermaid initialization. It returns a fresh\n`MermaidConfig` from `@beehexa/design-tokens`; Mermaid remains a peer dependency.\nPass the active `dark` and `locale` on every render. A theme or language change\nrequires rendering again: SVG paint and text measurements do not update from CSS alone.\n\n```ts\nimport { createMermaidConfig, createCanvasTheme } from '@beehexa/mermaid-tokens';\n\nmermaid.initialize(createMermaidConfig({ dark: true, locale: 'vi' }));\nconst canvas = createCanvasTheme({ dark: true, locale: 'vi' });\n```\n\nThe factory secures `theme`, `look`, `themeVariables`, `themeCSS`, `fontFamily`,\n`fontSize` and `htmlLabels` before `layout`. Mermaid 12 appends this secure array\nto its own default security keys. Definition init CSS must not replace rich-card\ntoken fonts; topology, definition-owned state styles and unrelated layout directives\nremain available. This configuration contract is not a claim that a rendered smoke\nmatrix has passed.\n\n## Meaning before colour\n\n`diagram.*` roles describe an operational execution graph, not an explanatory\nbrand schematic or a chart series palette. The same roles apply to the drawing,\nits inspector and its exported artifact.\n\n- Default and indeterminate nodes use `node-*` neutral pairs.\n- `state-ran-ok` means **ran without a reported failure**, not a verified business\n success. Informational paint and a completion marker distinguish execution from\n untouched nodes without using business-success green. HTTP/business outcomes\n retain their appropriate status labels independently.\n- Failed nodes use `fail-*`, with a failure marker and state text.\n- Log-only `log-reached` uses a reach marker. `log-unfinished` uses warning\n paint, an ellipsis and a dashed boundary; it is never a proven failure.\n- Never-reached nodes use `unreached-*` and an explicit state label; they are not\n disabled controls. Not-taken branches use `nottaken-*` plus a dashed boundary.\n- Repeat counts use the neutral `badge-*` pair. Repetition alone is not a warning.\n- Category glyphs use `tile-*`. They identify step type, not run state.\n- Selection and hover use `selection-ring` as **separate geometry outside the\n node boundary**. Never repaint a failed node to indicate that it is selected.\n- Field labels use `code-key`, values `code-value`, on `code-bg`. These descriptive\n fields are not links. Full code blocks retain the existing `color.code.*` pair.\n\nAlways keep labels, markers, shapes or dash patterns: colour alone is not evidence.\nPair foregrounds only with their named fills. Validate actual SVG text and meaningful\nline contrast in both themes; token existence does not certify a rendered diagram.\n\n## Type, space and interaction\n\n`diagram.node-font` aliases `font.body.default`, including taller Vietnamese lines.\nUse complete source font styles for node labels, inspector titles, metadata and code.\nDo not replace their weight or line height with component-specific recipes. Let\nVietnamese marks and long labels wrap without clipping. `diagram.padding` is internal\nnode padding; `diagram.export-padding` frames fitted/exported drawing bounds. Graph\ncoordinates and existing layout topology are not spacing-scale choices.\n\nNative compact worker flows keep the actual `compactFlowMermaid` output and the\npublic `flowStylesheet()` from `@beehexa/hexasync-template-model`. Install that\nsheet before Mermaid measures labels, then include it in the SVG for standalone\nexport. Add `hx-flow` to the SVG root and bind `workerFlowSvgStyle(canvas)` from\n`@beehexa/mermaid-tokens` as its inline style. Native card geometry, family masks\nand typed state line-work remain native; the adapter owns literal source paint,\nneutral category tile/glyph pairs and the canonical tile radius.\n\nThe native model now encloses the complete escaped title in renderer-owned `<b>`\nand separates secondary `KEY · TYPE` metadata with its native `<br>`. The adapter\nbinds the entire title to `font.heading.xsmall` and metadata to `font.body.small`;\nwrapping never changes a title line into metadata. Source supplies the fixed\ncategory tile/glyph dimensions and neutral pair, without replacing native shapes,\nfamily masks, state markers or compact/public address mapping. Authored markup\nremains escaped; a consumer must not mutate labels or substitute an emitter.\n\nThis anatomy is implemented in the canonical model source. The pinned published\nmodel predates the full-title implementation; local verification uses its built\npublic export through `HEXASYNC_LOCAL_PACKAGES=1`, not a source alias. A local\nbuild is not a claim that the model or this site has been released.\nEmbedded SVG CSS also supplies opaque source edge-label pairs and explicit\n`\"cv05\", \"cv08\"` features alongside the complete font shorthand; SVG/export must\nnot depend on the document's universal font-feature rule.\n\nInteractive preview nodes opt in with `bh-mermaid-interactive-node` on the actual\nSVG group. Keep native role/tabindex, keyboard handling and real selection state;\nbind `aria-selected=\"true\"` for a supported selectable role or `aria-pressed=\"true\"`\nfor a toggle button, never merely for expansion. The embedded\nstylesheet adds `border.width.focused` / `diagram.selection-ring` outside the node\non hover, focus-visible and selection with `state.focus.offset`; it never repaints\nrun-state fill/stroke. `bh-mermaid-category-glyph` on authored SVG icon paths uses\n`diagram.tile-glyph`, `border.width.default` and round caps/joins. Path coordinates\nand transforms remain graph geometry.\n\nImport `@beehexa/mermaid-tokens/css` once for HTML surrounding the SVG.\n`data-bh-diagram=\"canvas|code|key|value|description|badge\"` selects existing\n`diagram.canvas`, `code-bg`, `code-key`, `code-value`, `node-desc` and the paired\nrepeat-count badge roles. The badge recipe includes its ordinary `radius.050`\nlabel frame; content font markers and structural composition remain independent.\nNo local colour, border or canvas-background recipes are required.\n\nEmbedded `foreignObject` text also sets `-webkit-text-fill-color: currentcolor`.\nThis bridges HTML-to-image clones to the already resolved SVG label colour rather\nthan a document host's inherited text-fill; do not inject a second app stylesheet\nduring PNG capture.\n\nActual pan/zoom hosts use `bh-diagram-viewport`, with\n`data-bh-dragging=\"true\"` only during dragging, for grab/grabbing, touch-action\nand user-select behavior. The application retains event handling, pointer capture,\nviewport transforms, clipping and fit/export bounds; no native Mermaid layout API\ncan replace those application gesture mechanics. Rich nodes with decorated outer\nrings use `data-bh-clickable=\"true\"` and `data-bh-ring=\"hover\"` on the hover ring.\nEmbedded CSS owns pointer/hover visibility, without changing ring geometry or the\nseparate selection/disclosure state.\n\nNative evidence-navigation buttons use `data-bh-diagram=\"occurrence\"` with\n`aria-current=\"true\"` to underline the current occurrence. This is navigation\nstate, not an execution-status colour; native focus/keyboard behavior stays intact.\n\nRectangular node/cluster/actor/note surfaces, execution cards, category tiles and\nsmall label surfaces use `radius.100` (8 px), including SVG export. Circles,\ndiamonds and edge paths retain topology geometry. Inspector cards remain 8 px.\nViewport docks use an 8 px frame with 4 px padding and actual 4 px control\nbuttons, not 8 px Button corners. Dialogs/drawers use `radius.150` (12 px).\nFollow the [Radius role scale](/foundations/styles/radius/).\n\nAuthoring previews use `diagram.preview-height` for both split panels and\n`diagram.minimum-height` for the drawing viewport; fullscreen fills the enclosing\nhost instead. Read-only split diagrams retain a zero minimum so they shrink with\ntheir host. Structured evidence viewers use `diagram.evidence-height`; multiple\nrequest-body panes use `diagram.evidence-minimum-height` to keep every part reachable.\n\n\nUse a flat opaque sheet. No gradients, glass, decorative animation, animated\ntraversal or state transitions. Retain zoom, fit, fullscreen/escape and PNG export\ncontrols. Interaction must not overwrite definition-owned fill, stroke, dashes or\nfailure markers. Controls stay outside the captured SVG host.\n\n## Export the rendered theme\n\nResolve literal token values for Mermaid configuration fields that require them.\nNative worker-flow CSS uses its own `--hx-*` properties; Source supplies their\nsemantic paint and preserves native literal evidence-edge/arrowhead paint.\nSnapshot the rendered theme and opaque canvas background on the SVG host. Export the live, fully decorated drawing at its natural bounds with\n`exportPadding`, not the transformed viewport. Preserve the snapshot even if the\napplication theme changes before the new drawing lands. Fonts, locale line height,\nstate paint and outer selection geometry must survive SVG/PNG capture. A transparent\nimage or white sheet behind dark labels is not a valid fallback.\n\nThe native demo snapshots its opaque canvas colour onto each completed SVG before\nexport. Both the supported published model's plain `<p>` labels and local rich\n`<b>` titles retain one completion/reached/unfinished/failure glyph, not colour\nalone. Embedded body/title font shorthands explicitly retain Source `font.features`,\nso standalone downloads do not depend on document-wide token CSS for character variants.\n\nAll package source is in `tokens/diagram.json`; consumers must not maintain a\nsecond palette or copy generated token values. Local package references are for\nlocal development only until an authorized release exists.\n\nUse the actual installed model APIs: `compactWorkerFlow` supplies its public\ncompact graph and authored-address-to-compact-id map, and `compactFlowMermaid`\nserializes that graph. `RenderNodeOverlay` accepts only `{ state?, repeat? }`;\ndo not pass `roles`, caller colour resolvers, stroke overrides or unsupported\nrenderer options. The native model owns state readings, repeat badges and\nimplicit `indeterminate` nodes once any drawn state is supplied.\n\nLog mentions establish only `reached` or `unfinished`, never typed `ranOk` or\n`ranFailed` evidence. The Source `mermaidEvidenceStyles` adapter accepts compact\nnode IDs, actual public compact edge indices and explicit `{ dark, locale }`.\nTyped evidence takes precedence for named steps and their owned junctions, even when\na failed owner's junction has no explicit state. Consumers retain authored\naddress resolution, failure attribution, repeated occurrences and execution data;\nsource owns theme paint and interaction recipes. No second palette is required.\n\nEdge emphasis uses literal Source colours, not `var(...)` or custom-property\ndeclarations: Mermaid12's DSL rejects those functions. Do not append `!important`\ninside the DSL: native coloured-marker cloning treats that suffix as part of\nthe SVG colour attribute. After rendering/sanitization,\n`preserveMermaidDefinitionPaint(svg)` promotes the actual native edge stroke and\nexplicit coloured-marker attributes over the worker sheet's neutral important\npaint, without changing paths, marker geometry or IDs. Unknown transitions remain\nunknown; consecutive recorded global indices may prove a unique direct edge,\nbut two executed endpoints alone do not prove a typed traversal.\n\n## Shared drawing viewport and dock\n\nData Flow is the canonical canvas reference: `diagram.canvas` and `diagram.grid`,\nwith `diagram.grid-gap` (16 px) grid spacing and `diagram.grid-dot` (1 px) dots in camera coordinates. These are graph\ngeometry, not reader-target dimensions. `.bh-diagram-viewport` supplies the Source\ndot pattern; bind its `--bh-canvas-grid-x`, `--bh-canvas-grid-y` and\n`--bh-canvas-grid-scale` to the existing camera. The SVG root and default stage\nbody (`diagram.group-fill`) are transparent on screen, not opaque pale sheets\ncovering the grid. Native stage boundaries/titles remain intact. Export still\nuses the rendered theme's snapshotted opaque Source canvas.\n\nPut real native controls **inside** that viewport, outside the transformed drawing\nand captured SVG host. `bh-diagram-dock` on native Space plus `bh-control-group`\n`data-bh-variant=\"dock\"` supplies the lower-left floating dock and shared native\nData Flow control family. No separate external toolbar/header row and no reserved\nblank band. Stop pointer/wheel/non-Escape keyboard propagation on the dock,\npreserving native focus, popups and overlay Escape handling. Keep genuine action\ndifferences; do not copy Data Flow-only actions into Mermaid.\n\nThe complete native Space role combination keeps both Source insets inside the\nallocated viewport, including below-readable-minimum hosts. Its width constraint\ntakes precedence over the generic control-group width. Keep one native horizontal\nscroll row so every action remains fully reachable at larger reader roots; do not\nclip the last action or override the dock width in a consumer.\n\n",
|
|
2212
|
+
"raw": "---\ntitle: Mermaid and execution diagrams\ndescription: Source-backed Mermaid configuration, descriptive execution states, interaction and image export.\norder: 6\n---\n\nimport NativeFlowDemo from '../../components/NativeFlowDemo.astro';\n\n## Native anatomy and execution demonstration\n\n<NativeFlowDemo />\n\nThis is the public native compact model rendered by Mermaid, not a set of HTML\nlookalike cards. Set execution evidence to none to inspect the untouched definition,\nto typed outcomes for `ranOk` / `ranFailed` / `neverReached` / `branchNotTaken` (the\nedge into the not-taken branch is dashed `6 3`), or to log-derived readings for\n`mermaidEvidenceStyles` node `reached` / `unfinished` and edge `reached` / `unfinished`\n(dashed `4 3`) / `failed`. The run readings are explicitly sample data, not business-success claims.\nChange the site theme/language, direction and zoom, select with a pointer or keyboard,\nthen export the actual SVG. Category masks, native shapes, edge labels and typed\nstate geometry survive those changes.\n\nUse `@beehexa/mermaid-tokens` for every Mermaid initialization. It returns a fresh\n`MermaidConfig` from `@beehexa/design-tokens`; Mermaid remains a peer dependency.\nPass the active `dark` and `locale` on every render. A theme or language change\nrequires rendering again: SVG paint and text measurements do not update from CSS alone.\n\n```ts\nimport { createMermaidConfig, createCanvasTheme } from '@beehexa/mermaid-tokens';\n\nmermaid.initialize(createMermaidConfig({ dark: true, locale: 'vi' }));\nconst canvas = createCanvasTheme({ dark: true, locale: 'vi' });\n```\n\nThe factory secures `theme`, `look`, `themeVariables`, `themeCSS`, `fontFamily`,\n`fontSize` and `htmlLabels` before `layout`. Mermaid 12 appends this secure array\nto its own default security keys. Definition init CSS must not replace rich-card\ntoken fonts; topology, definition-owned state styles and unrelated layout directives\nremain available. This configuration contract is not a claim that a rendered smoke\nmatrix has passed.\n\n## Meaning before colour\n\n`diagram.*` roles describe an operational execution graph, not an explanatory\nbrand schematic or a chart series palette. The same roles apply to the drawing,\nits inspector and its exported artifact.\n\n- Default and indeterminate nodes use `node-*` neutral pairs.\n- `state-ran-ok` means **ran without a reported failure**, not a verified business\n success. Informational paint and a completion marker distinguish execution from\n untouched nodes without using business-success green. HTTP/business outcomes\n retain their appropriate status labels independently.\n- Failed nodes use `fail-*`, with a failure marker and state text.\n- Log-only `log-reached` uses a reach marker. `log-unfinished` uses warning\n paint, an ellipsis and a dashed boundary; it is never a proven failure.\n- Never-reached nodes use `unreached-*` and an explicit state label; they are not\n disabled controls. Not-taken branches use `nottaken-*` plus a dashed boundary.\n- Repeat counts use the neutral `badge-*` pair. Repetition alone is not a warning.\n- Category glyphs use `tile-*`. They identify step type, not run state.\n- Selection and hover use `selection-ring` as **separate geometry outside the\n node boundary**. Never repaint a failed node to indicate that it is selected.\n- Field labels use `code-key`, values `code-value`, on `code-bg`. These descriptive\n fields are not links. Full code blocks retain the existing `color.code.*` pair.\n\nAlways keep labels, markers, shapes or dash patterns: colour alone is not evidence.\nPair foregrounds only with their named fills. Validate actual SVG text and meaningful\nline contrast in both themes; token existence does not certify a rendered diagram.\n\n## Type, space and interaction\n\n`diagram.node-font` aliases `font.body.default`, including taller Vietnamese lines.\nUse complete source font styles for node labels, inspector titles, metadata and code.\nDo not replace their weight or line height with component-specific recipes. Let\nVietnamese marks and long labels wrap without clipping. `diagram.padding` is internal\nnode padding; `diagram.export-padding` frames fitted/exported drawing bounds. Graph\ncoordinates and existing layout topology are not spacing-scale choices.\n\nNative compact worker flows keep the actual `compactFlowMermaid` output and the\npublic `flowStylesheet()` from `@beehexa/hexasync-template-model`. Install that\nsheet before Mermaid measures labels, then include it in the SVG for standalone\nexport. Add `hx-flow` to the SVG root and bind `workerFlowSvgStyle(canvas)` from\n`@beehexa/mermaid-tokens` as its inline style. Native card geometry, family masks\nand typed state line-work remain native; the adapter owns literal source paint,\nneutral category tile/glyph pairs and the canonical tile radius.\n\nThe native model now encloses the complete escaped title in renderer-owned `<b>`\nand separates secondary `KEY · TYPE` metadata with its native `<br>`. The adapter\nbinds the entire title to `font.heading.xsmall` and metadata to `font.body.small`;\nwrapping never changes a title line into metadata. Source supplies the fixed\ncategory tile/glyph dimensions and neutral pair, without replacing native shapes,\nfamily masks, state markers or compact/public address mapping. Authored markup\nremains escaped; a consumer must not mutate labels or substitute an emitter.\n\nThis anatomy is implemented in the canonical model source. The pinned published\nmodel predates the full-title implementation; local verification uses its built\npublic export through `HEXASYNC_LOCAL_PACKAGES=1`, not a source alias. A local\nbuild is not a claim that the model or this site has been released.\nEmbedded SVG CSS also supplies opaque source edge-label pairs and explicit\n`\"cv05\", \"cv08\"` features alongside the complete font shorthand; SVG/export must\nnot depend on the document's universal font-feature rule.\n\nInteractive preview nodes opt in with `bh-mermaid-interactive-node` on the actual\nSVG group. Keep native role/tabindex, keyboard handling and real selection state;\nbind `aria-selected=\"true\"` for a supported selectable role or `aria-pressed=\"true\"`\nfor a toggle button, never merely for expansion. The embedded\nstylesheet adds `border.width.focused` / `diagram.selection-ring` outside the node\non hover, focus-visible and selection with `state.focus.offset`; it never repaints\nrun-state fill/stroke. `bh-mermaid-category-glyph` on authored SVG icon paths uses\n`diagram.tile-glyph`, `border.width.default` and round caps/joins. Path coordinates\nand transforms remain graph geometry.\n\nImport `@beehexa/mermaid-tokens/css` once for HTML surrounding the SVG.\n`data-bh-diagram=\"canvas|code|key|value|description|badge\"` selects existing\n`diagram.canvas`, `code-bg`, `code-key`, `code-value`, `node-desc` and the paired\nrepeat-count badge roles. The badge recipe includes its ordinary `radius.050`\nlabel frame; content font markers and structural composition remain independent.\nNo local colour, border or canvas-background recipes are required.\n\nEmbedded `foreignObject` text also sets `-webkit-text-fill-color: currentcolor`.\nThis bridges HTML-to-image clones to the already resolved SVG label colour rather\nthan a document host's inherited text-fill; do not inject a second app stylesheet\nduring PNG capture.\n\nActual pan/zoom hosts use `bh-diagram-viewport`, with\n`data-bh-dragging=\"true\"` only during dragging, for grab/grabbing, touch-action\nand user-select behavior. The application retains event handling, pointer capture,\nviewport transforms, clipping and fit/export bounds; no native Mermaid layout API\ncan replace those application gesture mechanics. Rich nodes with decorated outer\nrings use `data-bh-clickable=\"true\"` and `data-bh-ring=\"hover\"` on the hover ring.\nEmbedded CSS owns pointer/hover visibility, without changing ring geometry or the\nseparate selection/disclosure state.\n\nNative evidence-navigation buttons use `data-bh-diagram=\"occurrence\"` with\n`aria-current=\"true\"` to underline the current occurrence. This is navigation\nstate, not an execution-status colour; native focus/keyboard behavior stays intact.\n\nRectangular node/cluster/actor/note surfaces, execution cards, category tiles and\nsmall label surfaces use `radius.100` (8 px), including SVG export. Circles,\ndiamonds and edge paths retain topology geometry. Inspector cards remain 8 px.\nViewport docks use an 8 px frame with 4 px padding and actual 4 px control\nbuttons, not 8 px Button corners. Dialogs/drawers use `radius.150` (12 px).\nFollow the [Radius role scale](/foundations/styles/radius/).\n\nAuthoring previews use `diagram.preview-height` for both split panels and\n`diagram.minimum-height` for the drawing viewport; fullscreen fills the enclosing\nhost instead. Read-only split diagrams retain a zero minimum so they shrink with\ntheir host. Structured evidence viewers use `diagram.evidence-height`; multiple\nrequest-body panes use `diagram.evidence-minimum-height` to keep every part reachable.\n\n\nUse a flat opaque sheet. No gradients, glass, decorative animation, animated\ntraversal or state transitions. Retain zoom, fit, fullscreen/escape and PNG export\ncontrols. Interaction must not overwrite definition-owned fill, stroke, dashes or\nfailure markers. Controls stay outside the captured SVG host.\n\n## Export the rendered theme\n\nResolve literal token values for Mermaid configuration fields that require them.\nNative worker-flow CSS uses its own `--hx-*` properties; Source supplies their\nsemantic paint and preserves native literal evidence-edge/arrowhead paint.\nSnapshot the rendered theme and opaque canvas background on the SVG host. Export the live, fully decorated drawing at its natural bounds with\n`exportPadding`, not the transformed viewport. Preserve the snapshot even if the\napplication theme changes before the new drawing lands. Fonts, locale line height,\nstate paint and outer selection geometry must survive SVG/PNG capture. A transparent\nimage or white sheet behind dark labels is not a valid fallback.\n\nThe native demo snapshots its opaque canvas colour onto each completed SVG before\nexport. Both the supported published model's plain `<p>` labels and local rich\n`<b>` titles retain one completion/reached/unfinished/failure glyph, not colour\nalone. Embedded body/title font shorthands explicitly retain Source `font.features`,\nso standalone downloads do not depend on document-wide token CSS for character variants.\n\nAll package source is in `tokens/diagram.json`; consumers must not maintain a\nsecond palette or copy generated token values. Local package references are for\nlocal development only until an authorized release exists.\n\nUse the actual installed model APIs: `compactWorkerFlow` supplies its public\ncompact graph and authored-address-to-compact-id map, and `compactFlowMermaid`\nserializes that graph. `RenderNodeOverlay` accepts only `{ state?, repeat? }`;\ndo not pass `roles`, caller colour resolvers, stroke overrides or unsupported\nrenderer options. The native model owns state readings, repeat badges and\nimplicit `indeterminate` nodes once any drawn state is supplied.\n\nLog mentions establish only `reached` or `unfinished`, never typed `ranOk` or\n`ranFailed` evidence. The Source `mermaidEvidenceStyles` adapter accepts compact\nnode IDs, actual public compact edge indices and explicit `{ dark, locale }`.\nTyped evidence takes precedence for named steps and their owned junctions, even when\na failed owner's junction has no explicit state. Consumers retain authored\naddress resolution, failure attribution, repeated occurrences and execution data;\nsource owns theme paint and interaction recipes. No second palette is required.\n\nEdge emphasis uses literal Source colours, not `var(...)` or custom-property\ndeclarations: Mermaid12's DSL rejects those functions. Do not append `!important`\ninside the DSL: native coloured-marker cloning treats that suffix as part of\nthe SVG colour attribute. After rendering/sanitization,\n`preserveMermaidDefinitionPaint(svg)` promotes the actual native edge stroke and\nexplicit coloured-marker attributes over the worker sheet's neutral important\npaint, without changing paths, marker geometry or IDs. Unknown transitions remain\nunknown; consecutive recorded global indices may prove a unique direct edge,\nbut two executed endpoints alone do not prove a typed traversal.\n\n## Shared drawing viewport and dock\n\nData Flow is the canonical canvas reference: `diagram.canvas` and `diagram.grid`,\nwith `diagram.grid-gap` (16 px) grid spacing and `diagram.grid-dot` (1 px) dots in camera coordinates. These are graph\ngeometry, not reader-target dimensions. `.bh-diagram-viewport` supplies the Source\ndot pattern; bind its `--bh-canvas-grid-x`, `--bh-canvas-grid-y` and\n`--bh-canvas-grid-scale` to the existing camera. The SVG root and default stage\nbody (`diagram.group-fill`) are transparent on screen, not opaque pale sheets\ncovering the grid. Native stage boundaries/titles remain intact. Export still\nuses the rendered theme's snapshotted opaque Source canvas.\n\nPut real native controls **inside** that viewport, outside the transformed drawing\nand captured SVG host. `bh-diagram-dock` on native Space plus `bh-control-group`\n`data-bh-variant=\"dock\"` supplies the lower-left floating dock and shared native\nData Flow control family. No separate external toolbar/header row and no reserved\nblank band. Stop pointer/wheel/non-Escape keyboard propagation on the dock,\npreserving native focus, popups and overlay Escape handling. Keep genuine action\ndifferences; do not copy Data Flow-only actions into Mermaid.\n\nThe complete native Space role combination keeps both Source insets inside the\nallocated viewport, including below-readable-minimum hosts. Its width constraint\ntakes precedence over the generic control-group width. Keep one native horizontal\nscroll row so every action remains fully reachable at larger reader roots; do not\nclip the last action or override the dock width in a consumer.\n\n",
|
|
2213
2213
|
"frontmatter": {
|
|
2214
2214
|
"title": "Mermaid and execution diagrams",
|
|
2215
2215
|
"description": "Source-backed Mermaid configuration, descriptive execution states, interaction and image export.",
|
|
@@ -2244,8 +2244,8 @@
|
|
|
2244
2244
|
"status": "active",
|
|
2245
2245
|
"releasePhase": null,
|
|
2246
2246
|
"planned": [],
|
|
2247
|
-
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Colour tones are not statuses\n\n`FlowTone` (`FLOW_TONES`) names eight generic colour tones: `blue`, `red`, `green`,\n`crimson`, `yellow`, `teal`, `magenta` and `purple`. Each reads one existing foundation\n`flow.category.*` role set; the foundation keys keep their names, and the package gives a\ntone no meaning. The consumer decides which of its own node or relation kinds takes which\ntone. A tone must not be interpreted as success, failure or warning. Keep the node's kind\nlabel and icon; colour is never its sole identity, and a tone does not certify the state of\nan execution.\n\nEach tone supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getFlowTonePalette(tone)` for CSS-backed bindings; its `border` is\nthe frame/edge identity. These source roles replace historical application-owned palettes,\nalpha overlays, gradients and palette-adjustment functions. Never append hex alpha suffixes\nto a CSS variable, or lighten a resolved role downstream.\nFor a native kind Tag, bind `getFlowToneBadgeStyles(tone)` to the public `style` prop and\nomit `color`. This cached immutable recipe pairs the tone foreground/background/border\ninstead of putting native white text on a frame/edge stroke. The canonical contrast check\nincludes all eight small-text pairs in both themes at WCAG AA 4.5:1; the native family\ndemonstrates their actual paint. The teal foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite tone identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Native WorkflowViewer anatomy\n\nKeep the actual `WorkflowViewer` / `WorkflowNodeCard` and provide its public\n`NodeLook`: title, subtitle, kind, caption, category icon, source/destination\nlogos, domain indicators and optional typed execution. The Source companion\n`.bh-workflow-canvas` binds those existing slots to complete Source roles:\n`font.heading.xsmall` for the fully wrapped title, `font.body.default` for the\ndescription and `font.body.small` for kind, caption and indicators. The fixed\nneutral category tile is not a run-state badge. Do not replace a rich native\nnode with its ID or a plain rectangle in order to apply tokens.\nNative stadium nodes grow to their content's intrinsic width within the existing\nnative minimum and maximum. Short terminal titles remain whole beside their category\nglyph and optional execution marker. Keep the native maximum; do not remove a marker,\nclip a title or add consumer-specific terminal widths.\n\nOrdinary cards can explicitly opt into `NodeLook.sizing: 'content'`. The native\ncanvas owns only the width mechanism: the box grows to content between\n`--wf-node-content-min-width` and `--wf-node-content-max-width`. The Source\ncompanion owns those roles (`diagram.card.width` and twice that role) and the whole\npresentation recipe: title/kind wrap, the growing head and every source/destination\nlogo kept within the card. No declaration is defined in both stylesheets. No fixed-width\nincrease applies to other consumers; stadium, diamond and ellipse cards ignore the opt-in.\nKeep all logos; do not supply guessed geometry or patch card internals downstream.\n\nNative `WorkflowEdge.tone` is orthogonal to `variant`. Use `blue`, `red` or `green`:\nSource binds `--wf-edge-tone-<tone>` to the existing foundation border roles\n`--bh-flow-category-task-border`, `--bh-flow-category-dependency-border` and\n`--bh-flow-category-transformation-border` in the current theme (foundation names\nunchanged), with static solid, short-dash and dash-dot cues. The consumer maps its own\nrelation kinds onto these tones. Do not use failure to colour a relation. The native\nrenderer validates tokens, retains tone ink/cues under hover, selection, trace, failure,\npossible and context, and carries them to arrowheads and jump swatches. PNG export reuses\nthe native exporter's DOM/stylesheet serialization, with no tone-specific path. Omitted tone\npreserves existing edge behavior.\n\nRelation certainty, context and failure are shape cues, never a new dash pattern,\na colour change of the tone or an opacity reduction, so each tone dash stays unique\n(WCAG 1.4.1/1.4.11):\n\n- **Possible** (`certainty: 'possible'`, a dynamic-route candidate or SWITCH case): a\n hollow mini-diamond at the source end, the BPMN 2.0 conditional-flow marker.\n- **Context** (`context: true`, retained breadcrumb context): a UML-style open\n arrowhead and the thinner resting stroke `--wf-edge-context-width`, a package-owned\n variable bound to the foundation `border.width.default`; highlight widens it as usual.\n- **Toned failure** (`variant: 'failure'` with a tone): tone ink and tone dash, plus\n the Lucide `CircleX` mark painted with `color.icon.danger` (`--wf-edge-failure-icon`)\n beside the edge label. The mark is decorative (`aria-hidden`); jump names and the\n legend keep the words. An untoned failure keeps the failure ink and `5 4` dash.\n\nPossible and context may combine. Pass the localized group name as `familyLabel`:\njump chips and lists are then named `{family} jump to {target}`, numbered `(n of m)`\nwhen parallel jumps would share a name. Localize the whole name, numbering and list\ntitles through the viewer's `texts.jumps` (`WorkflowJumpTexts`), keeping the group word\nfirst; a localized group inside the English default is not a localized name. Sources:\n`packages/vueflow-tokens/src/styles.css` and the native `workflow-canvas` edge.\nThese source bindings do not prove appearance: manually check both themes, many logos,\nlong titles, parallel tones, possible/context/failure marks, trace/hover/fullscreen\nand exported PNG.\n\n**Group frames.** A native group (`WorkflowNode.group`, the built-in `wf-group` node) is\nthe node's card as a header with a round expand/collapse toggle; expanded, its children sit\ninside a frame below the header. The companion binds the frame to the package-owned\n`--wf-group-*` variables, each over an existing foundation role: border `color.border`,\nborder width `border.width.default`, radius `radius.card`, fill `color.surface.subtle`\nand, for a frame inside a frame, `color.background.neutral`, so the levels read apart;\npadding `space.stack` and header gap `space.150`. No flow-specific foundation token backs\nthem. The native layout reads `--wf-group-padding` and\n`--wf-group-header-gap` from the canvas, so keep both plain lengths. High contrast draws\nthe frame border in text ink. A frame is a container, never a tone or a run state:\ndo not tint it by tone or status.\n\n**Selection box.** Shift + drag on the empty native canvas draws a box that selects the\ncards it touches (an expanded frame only when fully inside). The companion binds it to the\nsame selection recipe as `.bh-vue-flow .vue-flow__selection`: a transparent box (no fill, so\nthe swept cards stay visible) with a dashed `border.width.selected` border in\n`color.border.focus`, in light and dark. A selection keeps the node selection ring; the box\nis never a tone or run-state cue.\n\n**Find box.** The native viewer's find box (`/` or the dock's Search) is an overlay with a\nsearch field and result rows. The companion binds its `--wf-find-*` and the shared `--wf-list-*`\nroles: `color.surface.overlay`, `elevation.shadow.overlay` and `radius.overlay`, with no border\n(an overlay is set apart by its surface and shadow) and a `color.border` divider under the field.\nThe field and the empty state use `font.body.default`, the placeholder `color.text.subtlest`\nand the empty state `color.text.subtle`. A row uses `font.label.default` for the node's name,\n`space.075` / `space.item.x` padding, at least `size.control.default` high (`size.target.touch`\non coarse pointers and below 768 px) and `radius.item`; the kind label after the name is\n`font.body.small` in `color.text.subtle`, and a node without a name shows its id in\n`font.code.default`. Names wrap at word boundaries and are never truncated; only a single word\nwider than the row breaks. Rows take the overlay item states one step apart: the row under the\npointer `color.surface.overlay.hover`; the keyboard-active row `color.surface.overlay.selected`\nwith the `border.width.selected` start bar in `color.border.selected` as its non-colour cue;\nthat row hovered `color.surface.overlay.selected.hover`. Text keeps its colour in every state;\neach pair is in the checked contrast list. Focus is the field's ring around the whole box\n(`border.width.focused`, `color.border.focus`, `state.focus.offset`). While a row is under the\npointer or reached with ↓ / ↑, the canvas previews its node with the existing hover state and\nthe node's outer ring (`diagram.selection-ring`); it ends when the pointer leaves the list, the\nquery changes or the box closes, and never changes the selection, the trace or the viewport (an\noff-screen node is not panned to). Do not restyle the box per viewer.\n\nDiamond and ellipse titles and kind captions wrap at word boundaries and are never truncated:\ntheir side padding follows their width, so a mid-word break would read as two words and an\nellipsis would hide the node's own name. Only a single word wider than the content box\nbreaks. Ordinary cards may still break a long unbroken title anywhere.\n\n`NodeLook.execution` is absent for definitions. Typed states retain their\n`diagram.*` fill/stroke/text pairs and native non-colour marker; the not-taken\nboundary is dashed. Selection, hover and keyboard focus stay on independent\nouter-ring geometry, so a selected failed node remains visibly failed.\nRepetition, logos and group disclosure remain domain metadata.\n\nThe real native live demo belongs to the\n[`workflow-canvas` producer playground](https://github.com/hexasync-saas/workflow-canvas#native-source-anatomy-playground),\nnot a replacement renderer embedded here. In that checkout run\n`npm ci && npm run playground -- --host 127.0.0.1 --port 5174` and open\n`http://127.0.0.1:5174/?anatomy`. It reuses the existing nine-node credential,\n38-node RPA and loop fixtures with theme/language controls, explicit sample\ntyped execution, long title/metadata, native ports, selection and native PNG\nexport. Build Source packages first and prepend `HEXASYNC_LOCAL_PACKAGES=1`\nto verify unpublished adapter anatomy from built public exports. Default\nplayground installs remain registry-only; Source site CI needs no access to\nthe private native canvas package. The [Mermaid demonstration](/tools/mermaid/)\nruns here using its public native model and the same Source anatomy roles.\n\nRouting stays in the native canvas. Unpinned edges select attachment sides from\nthe current measured layout; authored source/target pins remain authoritative.\nAfter dragging a task or expanding a group, do not repin every edge to one side\nor resurrect a downstream layout processor to hide an attachment defect.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles({ tone, width, height, shape? }, state)` for custom node bodies.\nIt binds semantic fonts, spacing, the tone pair and the consumer-owned dimensions;\n`shape: 'circle'` rounds the body fully and `state.dashed` dashes its border. Keep custom\nicons, logos, labels, handles, accessibility semantics and events in the application.\nMeaningful loading indicators may move; decorative node entrances, pulsing identities,\nrotating idle icons, hover transforms, flowing edge dashes, gradients and glass are not part\nof the theme.\n\nCustom tone content uses `getFlowToneStyles(tone, part?)`;\n`foreground` sets tone text, `border` sets border colour and `background`\nsets its paired surface. Tone glyphs use `getFlowIconStyles(tone, options)`,\nwhose default colour is the tone border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle kind icon.\n\nFor a labelled relationship indicator use `bh-flow-tone-mark` and\n`data-bh-tone=\"<FlowTone>\"`: the source owns its `space.075` circular\ngeometry and tone border-colour fill (`blue` when unset). A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\nThe package ships no node-size, grid or layout tables: node geometry belongs to the\nconsumer, and rendering, layout and half-dimension centering must read the same consumer\nsource. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Tone adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nTheir actual control buttons use `radius.050` (4 px), without clipping focus;\n4 px frame padding nests those control corners inside the 8 px frame. Node\nlogos retain their nested `radius.075` (6 px). Circular nodes keep their\ntrue circular geometry, as do connection handles; edge-routing radius remains\npath geometry. Inspector cards remain 8 px and dialogs/drawers use\n`radius.150` (12 px). The native WorkflowDock shares this compact frame/control\nfamily and floats inside the viewport, default lower-left, outside camera\ntransforms; never replace it with a full-width toolbar band. Text-editor headers\nremain intrinsic document chrome. Follow the [Radius role scale](/foundations/styles/radius/).\nThe native dock's zoom-menu surface uses `radius.overlay` (8 px), independently\nof compact Buttons and menu items; do not derive it from a button radius plus\na fixed pixel offset. Keep native MiniMap/legend surfaces at\n`radius.100` and the actual keyboard-shortcuts Dialog at `radius.150`; its close\nButton still uses `radius.050`. These role bindings belong to the Source companion,\nnot per-viewer CSS or a global chrome-radius change.\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes, toneOf?)` preserves the directed edge's target identity on\nboth stroke and marker from the target node's tone (`toneOf(node)`, `blue` when omitted or\nwhen the target is missing), keeps other edge data, and disables decorative traversal\nmotion. The application may retain dashed lines to communicate its own relation semantics.\nThe custom edge renderer must consume the supplied stroke rather than replace it with an\nunrelated edge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle\nsize.\n\nCustom edge paths use `getFlowEdgeStyles(tone, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ntone fallback and a supplied static dash, and uses `FLOW_EDGE.width`, no fill and a\nnon-scaling stroke; the consumer owns what a dash means.\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind.\n`createVueFlowTheme({ nodeTone })` colours MiniMap nodes the same way (`blue` by default).\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), like\nother fullscreen surfaces, so global inspectors opened from it stay above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and tone semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, consumer-owned dimensions, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
2248
|
-
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed generic graph colour tones, paired themes and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Colour tones are not statuses\n\n`FlowTone` (`FLOW_TONES`) names eight generic colour tones: `blue`, `red`, `green`,\n`crimson`, `yellow`, `teal`, `magenta` and `purple`. Each reads one existing foundation\n`flow.category.*` role set; the foundation keys keep their names, and the package gives a\ntone no meaning. The consumer decides which of its own node or relation kinds takes which\ntone. A tone must not be interpreted as success, failure or warning. Keep the node's kind\nlabel and icon; colour is never its sole identity, and a tone does not certify the state of\nan execution.\n\nEach tone supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getFlowTonePalette(tone)` for CSS-backed bindings; its `border` is\nthe frame/edge identity. These source roles replace historical application-owned palettes,\nalpha overlays, gradients and palette-adjustment functions. Never append hex alpha suffixes\nto a CSS variable, or lighten a resolved role downstream.\nFor a native kind Tag, bind `getFlowToneBadgeStyles(tone)` to the public `style` prop and\nomit `color`. This cached immutable recipe pairs the tone foreground/background/border\ninstead of putting native white text on a frame/edge stroke. The canonical contrast check\nincludes all eight small-text pairs in both themes at WCAG AA 4.5:1; the native family\ndemonstrates their actual paint. The teal foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite tone identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Native WorkflowViewer anatomy\n\nKeep the actual `WorkflowViewer` / `WorkflowNodeCard` and provide its public\n`NodeLook`: title, subtitle, kind, caption, category icon, source/destination\nlogos, domain indicators and optional typed execution. The Source companion\n`.bh-workflow-canvas` binds those existing slots to complete Source roles:\n`font.heading.xsmall` for the fully wrapped title, `font.body.default` for the\ndescription and `font.body.small` for kind, caption and indicators. The fixed\nneutral category tile is not a run-state badge. Do not replace a rich native\nnode with its ID or a plain rectangle in order to apply tokens.\nNative stadium nodes grow to their content's intrinsic width within the existing\nnative minimum and maximum. Short terminal titles remain whole beside their category\nglyph and optional execution marker. Keep the native maximum; do not remove a marker,\nclip a title or add consumer-specific terminal widths.\n\nOrdinary cards can explicitly opt into `NodeLook.sizing: 'content'`. The native\ncanvas owns only the width mechanism: the box grows to content between\n`--wf-node-content-min-width` and `--wf-node-content-max-width`. The Source\ncompanion owns those roles (`diagram.card.width` and twice that role) and the whole\npresentation recipe: title/kind wrap, the growing head and every source/destination\nlogo kept within the card. No declaration is defined in both stylesheets. No fixed-width\nincrease applies to other consumers; stadium, diamond and ellipse cards ignore the opt-in.\nKeep all logos; do not supply guessed geometry or patch card internals downstream.\n\nNative `WorkflowEdge.tone` is orthogonal to `variant`. Use `blue`, `red` or `green`:\nSource binds `--wf-edge-tone-<tone>` to the existing foundation border roles\n`--bh-flow-category-task-border`, `--bh-flow-category-dependency-border` and\n`--bh-flow-category-transformation-border` in the current theme (foundation names\nunchanged), with static solid, short-dash and dash-dot cues. The consumer maps its own\nrelation kinds onto these tones. Do not use failure to colour a relation. The native\nrenderer validates tokens, retains tone ink/cues under hover, selection, trace, failure,\npossible and context, and carries them to arrowheads and jump swatches. PNG export reuses\nthe native exporter's DOM/stylesheet serialization, with no tone-specific path. Omitted tone\npreserves existing edge behavior.\n\nRelation certainty, context and failure are shape cues, never a new dash pattern,\na colour change of the tone or an opacity reduction, so each tone dash stays unique\n(WCAG 1.4.1/1.4.11):\n\n- **Possible** (`certainty: 'possible'`, a dynamic-route candidate or SWITCH case): a\n hollow mini-diamond at the source end, the BPMN 2.0 conditional-flow marker.\n- **Context** (`context: true`, retained breadcrumb context): a UML-style open\n arrowhead and the thinner resting stroke `--wf-edge-context-width`, a package-owned\n variable bound to the foundation `border.width.default`; highlight widens it as usual.\n- **Toned failure** (`variant: 'failure'` with a tone): tone ink and tone dash, plus\n the Lucide `CircleX` mark painted with `color.icon.danger` (`--wf-edge-failure-icon`)\n beside the edge label. The mark is decorative (`aria-hidden`); jump names and the\n legend keep the words. An untoned failure keeps the failure ink and `5 4` dash.\n\nPossible and context may combine. Pass the localized group name as `familyLabel`:\njump chips and lists are then named `{family} jump to {target}`, numbered `(n of m)`\nwhen parallel jumps would share a name. Localize the whole name, numbering and list\ntitles through the viewer's `texts.jumps` (`WorkflowJumpTexts`), keeping the group word\nfirst; a localized group inside the English default is not a localized name. Sources:\n`packages/vueflow-tokens/src/styles.css` and the native `workflow-canvas` edge.\nThese source bindings do not prove appearance: manually check both themes, many logos,\nlong titles, parallel tones, possible/context/failure marks, trace/hover/fullscreen\nand exported PNG.\n\n**Group frames.** A native group (`WorkflowNode.group`, the built-in `wf-group` node) is\nthe node's card as a header with a round expand/collapse toggle; expanded, its children sit\ninside a frame below the header. The companion binds the frame to the package-owned\n`--wf-group-*` variables, each over an existing foundation role: border `color.border`,\nborder width `border.width.default`, radius `radius.card`, fill `color.surface.subtle`\nand, for a frame inside a frame, `color.background.neutral`, so the levels read apart;\npadding `space.stack` and header gap `space.150`. No flow-specific foundation token backs\nthem. The native layout reads `--wf-group-padding` and\n`--wf-group-header-gap` from the canvas, so keep both plain lengths. High contrast draws\nthe frame border in text ink. A frame is a container, never a tone or a run state:\ndo not tint it by tone or status.\n\n**Selection box.** Shift + drag on the empty native canvas draws a box that selects the\ncards it touches (an expanded frame only when fully inside). The companion binds it to the\nsame selection recipe as `.bh-vue-flow .vue-flow__selection`: a transparent box (no fill, so\nthe swept cards stay visible) with a dashed `border.width.selected` border in\n`color.border.focus`, in light and dark. A selection keeps the node selection ring; the box\nis never a tone or run-state cue.\n\n**Find box.** The native viewer's find box (`/` or the dock's Search) is an overlay with a\nsearch field and result rows. The companion binds its `--wf-find-*` and the shared `--wf-list-*`\nroles: `color.surface.overlay`, `elevation.shadow.overlay` and `radius.overlay`, with no border\n(an overlay is set apart by its surface and shadow) and a `color.border` divider under the field.\nThe field and the empty state use `font.body.default`, the placeholder `color.text.subtlest`\nand the empty state `color.text.subtle`. A row uses `font.label.default` for the node's name,\n`space.075` / `space.item.x` padding, at least `size.control.default` high (`size.target.touch`\non coarse pointers and below 768 px) and `radius.item`; the kind label after the name is\n`font.body.small` in `color.text.subtle`, and a node without a name shows its id in\n`font.code.default`. Names wrap at word boundaries and are never truncated; only a single word\nwider than the row breaks. Rows take the overlay item states one step apart: the row under the\npointer `color.surface.overlay.hover`; the keyboard-active row `color.surface.overlay.selected`\nwith the `border.width.selected` start bar in `color.border.selected` as its non-colour cue;\nthat row hovered `color.surface.overlay.selected.hover`. Text keeps its colour in every state;\neach pair is in the checked contrast list. Focus is the field's ring around the whole box\n(`border.width.focused`, `color.border.focus`, `state.focus.offset`). While a row is under the\npointer or reached with ↓ / ↑, the canvas previews its node with the existing hover state and\nthe node's outer ring (`diagram.selection-ring`); it ends when the pointer leaves the list, the\nquery changes or the box closes, and never changes the selection, the trace or the viewport (an\noff-screen node is not panned to). Do not restyle the box per viewer.\n\nDiamond and ellipse titles and kind captions wrap at word boundaries and are never truncated:\ntheir side padding follows their width, so a mid-word break would read as two words and an\nellipsis would hide the node's own name. Only a single word wider than the content box\nbreaks. Ordinary cards may still break a long unbroken title anywhere.\n\n`NodeLook.execution` is absent for definitions. Typed states retain their\n`diagram.*` fill/stroke/text pairs and native non-colour marker; the not-taken\nboundary is dashed. Selection, hover and keyboard focus stay on independent\nouter-ring geometry, so a selected failed node remains visibly failed.\nRepetition, logos and group disclosure remain domain metadata.\n\nThe real native live demo belongs to the\n[`workflow-canvas` producer playground](https://github.com/hexasync-saas/workflow-canvas#native-source-anatomy-playground),\nnot a replacement renderer embedded here. In that checkout run\n`npm ci && npm run playground -- --host 127.0.0.1 --port 5174` and open\n`http://127.0.0.1:5174/?anatomy`. It reuses the existing nine-node credential,\n38-node RPA and loop fixtures with theme/language controls, explicit sample\ntyped execution, long title/metadata, native ports, selection and native PNG\nexport. Build Source packages first and prepend `HEXASYNC_LOCAL_PACKAGES=1`\nto verify unpublished adapter anatomy from built public exports. Default\nplayground installs remain registry-only; Source site CI needs no access to\nthe private native canvas package. The [Mermaid demonstration](/tools/mermaid/)\nruns here using its public native model and the same Source anatomy roles.\n\nRouting stays in the native canvas. Unpinned edges select attachment sides from\nthe current measured layout; authored source/target pins remain authoritative.\nAfter dragging a task or expanding a group, do not repin every edge to one side\nor resurrect a downstream layout processor to hide an attachment defect.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles({ tone, width, height, shape? }, state)` for custom node bodies.\nIt binds semantic fonts, spacing, the tone pair and the consumer-owned dimensions;\n`shape: 'circle'` rounds the body fully and `state.dashed` dashes its border. Keep custom\nicons, logos, labels, handles, accessibility semantics and events in the application.\nMeaningful loading indicators may move; decorative node entrances, pulsing identities,\nrotating idle icons, hover transforms, flowing edge dashes, gradients and glass are not part\nof the theme.\n\nCustom tone content uses `getFlowToneStyles(tone, part?)`;\n`foreground` sets tone text, `border` sets border colour and `background`\nsets its paired surface. Tone glyphs use `getFlowIconStyles(tone, options)`,\nwhose default colour is the tone border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle kind icon.\n\nFor a labelled relationship indicator use `bh-flow-tone-mark` and\n`data-bh-tone=\"<FlowTone>\"`: the source owns its `space.075` circular\ngeometry and tone border-colour fill (`blue` when unset). A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\nThe package ships no node-size, grid or layout tables: node geometry belongs to the\nconsumer, and rendering, layout and half-dimension centering must read the same consumer\nsource. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Tone adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nTheir actual control buttons use `radius.050` (4 px), without clipping focus;\n4 px frame padding nests those control corners inside the 8 px frame. Node\nlogos retain their nested `radius.075` (6 px). Circular nodes keep their\ntrue circular geometry, as do connection handles; edge-routing radius remains\npath geometry. Inspector cards remain 8 px and dialogs/drawers use\n`radius.150` (12 px). The native WorkflowDock shares this compact frame/control\nfamily and floats inside the viewport, default lower-left, outside camera\ntransforms; never replace it with a full-width toolbar band. Text-editor headers\nremain intrinsic document chrome. Follow the [Radius role scale](/foundations/styles/radius/).\nThe native dock's zoom-menu surface uses `radius.overlay` (8 px), independently\nof compact Buttons and menu items; do not derive it from a button radius plus\na fixed pixel offset. Keep native MiniMap/legend surfaces at\n`radius.100` and the actual keyboard-shortcuts Dialog at `radius.150`; its close\nButton still uses `radius.050`. These role bindings belong to the Source companion,\nnot per-viewer CSS or a global chrome-radius change.\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes, toneOf?)` preserves the directed edge's target identity on\nboth stroke and marker from the target node's tone (`toneOf(node)`, `blue` when omitted or\nwhen the target is missing), keeps other edge data, and disables decorative traversal\nmotion. The application may retain dashed lines to communicate its own relation semantics.\nThe custom edge renderer must consume the supplied stroke rather than replace it with an\nunrelated edge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle\nsize.\n\nCustom edge paths use `getFlowEdgeStyles(tone, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ntone fallback and a supplied static dash, and uses `FLOW_EDGE.width`, no fill and a\nnon-scaling stroke; the consumer owns what a dash means.\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind.\n`createVueFlowTheme({ nodeTone })` colours MiniMap nodes the same way (`blue` by default).\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), like\nother fullscreen surfaces, so global inspectors opened from it stay above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and tone semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, consumer-owned dimensions, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
2247
|
+
"body": "\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Colour tones are not statuses\n\n`FlowTone` (`FLOW_TONES`) names eight generic colour tones: `blue`, `red`, `green`,\n`crimson`, `yellow`, `teal`, `magenta` and `purple`. Each reads one existing foundation\n`flow.category.*` role set; the foundation keys keep their names, and the package gives a\ntone no meaning. The consumer decides which of its own node or relation kinds takes which\ntone. A tone must not be interpreted as success, failure or warning. Keep the node's kind\nlabel and icon; colour is never its sole identity, and a tone does not certify the state of\nan execution.\n\nEach tone supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getFlowTonePalette(tone)` for CSS-backed bindings; its `border` is\nthe frame/edge identity. These source roles replace historical application-owned palettes,\nalpha overlays, gradients and palette-adjustment functions. Never append hex alpha suffixes\nto a CSS variable, or lighten a resolved role downstream.\nFor a native kind Tag, bind `getFlowToneBadgeStyles(tone)` to the public `style` prop and\nomit `color`. This cached immutable recipe pairs the tone foreground/background/border\ninstead of putting native white text on a frame/edge stroke. The canonical contrast check\nincludes all eight small-text pairs in both themes at WCAG AA 4.5:1; the native family\ndemonstrates their actual paint. The teal foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite tone identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Native WorkflowViewer anatomy\n\nKeep the actual `WorkflowViewer` / `WorkflowNodeCard` and provide its public\n`NodeLook`: title, subtitle, kind, caption, category icon, source/destination\nlogos, domain indicators and optional typed execution. The Source companion\n`.bh-workflow-canvas` binds those existing slots to complete Source roles:\n`font.heading.xsmall` for the fully wrapped title, `font.body.default` for the\ndescription and `font.body.small` for kind, caption and indicators. The fixed\nneutral category tile is not a run-state badge. Do not replace a rich native\nnode with its ID or a plain rectangle in order to apply tokens.\nNative stadium nodes grow to their content's intrinsic width within the existing\nnative minimum and maximum. Short terminal titles remain whole beside their category\nglyph and optional execution marker. Keep the native maximum; do not remove a marker,\nclip a title or add consumer-specific terminal widths.\n\nOrdinary cards can explicitly opt into `NodeLook.sizing: 'content'`. The native\ncanvas owns only the width mechanism: the box grows to content between\n`--wf-node-content-min-width` and `--wf-node-content-max-width`. The Source\ncompanion owns those roles (`diagram.card.width` and twice that role) and the whole\npresentation recipe: title/kind wrap, the growing head and every source/destination\nlogo kept within the card. No declaration is defined in both stylesheets. No fixed-width\nincrease applies to other consumers; stadium, diamond and ellipse cards ignore the opt-in.\nKeep all logos; do not supply guessed geometry or patch card internals downstream.\n\nNative `WorkflowEdge.tone` is orthogonal to `variant`. Use `blue`, `red` or `green`:\nSource binds `--wf-edge-tone-<tone>` to the existing foundation border roles\n`--bh-flow-category-task-border`, `--bh-flow-category-dependency-border` and\n`--bh-flow-category-transformation-border` in the current theme (foundation names\nunchanged), with static solid, short-dash and dash-dot cues. The consumer maps its own\nrelation kinds onto these tones. Do not use failure to colour a relation. The native\nrenderer validates tokens, retains tone ink/cues under hover, selection, trace, failure,\npossible and context, and carries them to arrowheads and jump swatches. PNG export reuses\nthe native exporter's DOM/stylesheet serialization, with no tone-specific path. Omitted tone\npreserves existing edge behavior.\n\nRelation certainty, context and failure are shape cues, never a new dash pattern,\na colour change of the tone or an opacity reduction, so each tone dash stays unique\n(WCAG 1.4.1/1.4.11):\n\n- **Possible** (`certainty: 'possible'`, a dynamic-route candidate or SWITCH case): a\n hollow mini-diamond at the source end, the BPMN 2.0 conditional-flow marker.\n- **Context** (`context: true`, retained breadcrumb context): a UML-style open\n arrowhead and the thinner resting stroke `--wf-edge-context-width`, a package-owned\n variable bound to the foundation `border.width.default`; highlight widens it as usual.\n- **Toned failure** (`variant: 'failure'` with a tone): tone ink and tone dash, plus\n the Lucide `CircleX` mark painted with `color.icon.danger` (`--wf-edge-failure-icon`)\n beside the edge label. The mark is decorative (`aria-hidden`); jump names and the\n legend keep the words. An untoned failure keeps the failure ink and `5 4` dash.\n\nPossible and context may combine. Pass the localized group name as `familyLabel`:\njump chips and lists are then named `{family} jump to {target}`, numbered `(n of m)`\nwhen parallel jumps would share a name. Localize the whole name, numbering and list\ntitles through the viewer's `texts.jumps` (`WorkflowJumpTexts`), keeping the group word\nfirst; a localized group inside the English default is not a localized name. Sources:\n`packages/vueflow-tokens/src/styles.css` and the native `workflow-canvas` edge.\nThese source bindings do not prove appearance: manually check both themes, many logos,\nlong titles, parallel tones, possible/context/failure marks, trace/hover/fullscreen\nand exported PNG.\n\n**Group frames.** A native group (`WorkflowNode.group`, the built-in `wf-group` node) is\nthe node's card as a header with a round expand/collapse toggle; expanded, its children sit\ninside a frame below the header. The companion binds the frame to the package-owned\n`--wf-group-*` variables, each over an existing foundation role: border `color.border`,\nborder width `border.width.default`, radius `radius.card`, fill `color.surface.subtle`\nand, for a frame inside a frame, `color.background.neutral`, so the levels read apart;\npadding `space.stack` and header gap `space.150`. No flow-specific foundation token backs\nthem. The native layout reads `--wf-group-padding` and\n`--wf-group-header-gap` from the canvas, so keep both plain lengths. High contrast draws\nthe frame border in text ink. A frame is a container, never a tone or a run state:\ndo not tint it by tone or status.\n\n**Selection box.** Shift + drag on the empty native canvas draws a box that selects the\ncards it touches (an expanded frame only when fully inside). The companion binds it to the\nsame selection recipe as `.bh-vue-flow .vue-flow__selection`: a transparent box (no fill, so\nthe swept cards stay visible) with a dashed `border.width.selected` border in\n`color.border.focus`, in light and dark. A selection keeps the node selection ring; the box\nis never a tone or run-state cue.\n\n**Find box.** The native viewer's find box (`/` or the dock's Search) is an overlay with a\nsearch field and result rows. The companion binds its `--wf-find-*` and the shared `--wf-list-*`\nroles: `color.surface.overlay`, `elevation.shadow.overlay` and `radius.overlay`, with no border\n(an overlay is set apart by its surface and shadow) and a `color.border` divider under the field.\nThe field and the empty state use `font.body.default`, the placeholder `color.text.subtlest`\nand the empty state `color.text.subtle`. A row uses `font.label.default` for the node's name,\n`space.075` / `space.item.x` padding, at least `size.control.default` high (`size.target.touch`\non coarse pointers and below 768 px) and `radius.item`; the kind label after the name is\n`font.body.small` in `color.text.subtle`, and a node without a name shows its id in\n`font.code.default`. Names wrap at word boundaries and are never truncated; only a single word\nwider than the row breaks. Rows take the overlay item states one step apart: the row under the\npointer `color.surface.overlay.hover`; the keyboard-active row `color.surface.overlay.selected`\nwith the `border.width.selected` start bar in `color.border.selected` as its non-colour cue;\nthat row hovered `color.surface.overlay.selected.hover`. Text keeps its colour in every state;\neach pair is in the checked contrast list. Focus is the field's ring around the whole box\n(`border.width.focused`, `color.border.focus`, `state.focus.offset`). While a row is under the\npointer or reached with ↓ / ↑, the canvas previews its node with the existing hover state and\nthe node's outer ring (`diagram.selection-ring`); it ends when the pointer leaves the list, the\nquery changes or the box closes, and never changes the selection, the trace or the viewport (an\noff-screen node is not panned to). Do not restyle the box per viewer.\n\nDiamond and ellipse titles and kind captions wrap at word boundaries and are never truncated:\ntheir side padding follows their width, so a mid-word break would read as two words and an\nellipsis would hide the node's own name. Only a single word wider than the content box\nbreaks. Ordinary cards may still break a long unbroken title anywhere.\n\n`NodeLook.execution` is absent for definitions. Typed states retain their\n`diagram.*` fill/stroke/text pairs and native non-colour marker; the not-taken\nboundary is dashed. Selection, hover and keyboard focus stay on independent\nouter-ring geometry, so a selected failed node remains visibly failed.\nRepetition, logos and group disclosure remain domain metadata.\n\nLog-derived node readings `reached` (a legacy log says the step ran, no typed outcome) and\n`unfinished` (started, no recorded end) are not typed run outcomes. The companion paints them\nwith `diagram.log-reached` / `diagram.log-unfinished` as outline and marker ink\n(`--wf-node-state-ink`); nodes keep an independent selection ring, so node `reached` keeps the\nlog role. `unfinished` leaves the node's own fill and text (including high-contrast overrides)\nand dashes both the outline and the subroutine edge `4 3`. `--wf-node-execution-outline-width`\nbinds `border.width.focused` for `ranOk`, `ranFailed`, `reached` and `unfinished`, as Mermaid\ndraws them; `neverReached` / `branchNotTaken` keep the native default.\nNever present either reading as `ranOk` or `ranFailed`.\n\nEdge run evidence `WorkflowEdge.execution` (`reached`, `unfinished`, `failed`, `notTaken`) is\ndistinct from the authored failure route (`variant: 'failure'`) and from tone. Source binds:\n\n- `reached` to `color.text`, not `diagram.log-reached`: that role and the edge highlight\n (`--wf-edge-active`, `diagram.selection-ring`) are the same blue, so a resting walked edge\n would look selected. Its non-colour cue is the bold `--wf-edge-execution-width`\n (`border.width.focused`), like Mermaid's neutral walked edge.\n- `unfinished` to `diagram.log-unfinished`, dashed `4 3`.\n- `failed` to `diagram.fail-stroke`, with the circle-x failure mark.\n- `notTaken` (a declined route) to `diagram.nottaken-stroke` at the ordinary width, dashed `6 3`.\n\n`--wf-edge-execution-width` must be a CSS length. Execution ink wins over tone ink; the\n`unfinished` / `notTaken` dash wins over tone and failure dashes, and a displaced authored\nfailure keeps its circle-x mark. The legend names each present reading and edge accessible\nnames append it (`Edge from A to B, run failed`). In high contrast `reached` shares the edge ink\n(`color.text`) and is distinguished by width; the other readings keep their theme-resolved inks.\n\nThe real native live demo belongs to the\n[`workflow-canvas` producer playground](https://github.com/hexasync-saas/workflow-canvas#native-source-anatomy-playground),\nnot a replacement renderer embedded here. In that checkout run\n`npm ci && npm run playground -- --host 127.0.0.1 --port 5174` and open\n`http://127.0.0.1:5174/?anatomy`. It reuses the existing nine-node credential,\n38-node RPA and loop fixtures with theme/language controls, explicit sample\ntyped execution, long title/metadata, native ports, selection and native PNG\nexport. Build Source packages first and prepend `HEXASYNC_LOCAL_PACKAGES=1`\nto verify unpublished adapter anatomy from built public exports. Default\nplayground installs remain registry-only; Source site CI needs no access to\nthe private native canvas package. The [Mermaid demonstration](/tools/mermaid/)\nruns here using its public native model and the same Source anatomy roles.\n\nRouting stays in the native canvas. Unpinned edges select attachment sides from\nthe current measured layout; authored source/target pins remain authoritative.\nAfter dragging a task or expanding a group, do not repin every edge to one side\nor resurrect a downstream layout processor to hide an attachment defect.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles({ tone, width, height, shape? }, state)` for custom node bodies.\nIt binds semantic fonts, spacing, the tone pair and the consumer-owned dimensions;\n`shape: 'circle'` rounds the body fully and `state.dashed` dashes its border. Keep custom\nicons, logos, labels, handles, accessibility semantics and events in the application.\nMeaningful loading indicators may move; decorative node entrances, pulsing identities,\nrotating idle icons, hover transforms, flowing edge dashes, gradients and glass are not part\nof the theme.\n\nCustom tone content uses `getFlowToneStyles(tone, part?)`;\n`foreground` sets tone text, `border` sets border colour and `background`\nsets its paired surface. Tone glyphs use `getFlowIconStyles(tone, options)`,\nwhose default colour is the tone border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle kind icon.\n\nFor a labelled relationship indicator use `bh-flow-tone-mark` and\n`data-bh-tone=\"<FlowTone>\"`: the source owns its `space.075` circular\ngeometry and tone border-colour fill (`blue` when unset). A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\nThe package ships no node-size, grid or layout tables: node geometry belongs to the\nconsumer, and rendering, layout and half-dimension centering must read the same consumer\nsource. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Tone adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nTheir actual control buttons use `radius.050` (4 px), without clipping focus;\n4 px frame padding nests those control corners inside the 8 px frame. Node\nlogos retain their nested `radius.075` (6 px). Circular nodes keep their\ntrue circular geometry, as do connection handles; edge-routing radius remains\npath geometry. Inspector cards remain 8 px and dialogs/drawers use\n`radius.150` (12 px). The native WorkflowDock shares this compact frame/control\nfamily and floats inside the viewport, default lower-left, outside camera\ntransforms; never replace it with a full-width toolbar band. Text-editor headers\nremain intrinsic document chrome. Follow the [Radius role scale](/foundations/styles/radius/).\nThe native dock's zoom-menu surface uses `radius.overlay` (8 px), independently\nof compact Buttons and menu items; do not derive it from a button radius plus\na fixed pixel offset. Keep native MiniMap/legend surfaces at\n`radius.100` and the actual keyboard-shortcuts Dialog at `radius.150`; its close\nButton still uses `radius.050`. These role bindings belong to the Source companion,\nnot per-viewer CSS or a global chrome-radius change.\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes, toneOf?)` preserves the directed edge's target identity on\nboth stroke and marker from the target node's tone (`toneOf(node)`, `blue` when omitted or\nwhen the target is missing), keeps other edge data, and disables decorative traversal\nmotion. The application may retain dashed lines to communicate its own relation semantics.\nThe custom edge renderer must consume the supplied stroke rather than replace it with an\nunrelated edge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle\nsize.\n\nCustom edge paths use `getFlowEdgeStyles(tone, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ntone fallback and a supplied static dash, and uses `FLOW_EDGE.width`, no fill and a\nnon-scaling stroke; the consumer owns what a dash means.\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind.\n`createVueFlowTheme({ nodeTone })` colours MiniMap nodes the same way (`blue` by default).\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), like\nother fullscreen surfaces, so global inspectors opened from it stay above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and tone semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, consumer-owned dimensions, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
2248
|
+
"raw": "---\ntitle: VueFlow theme\ndescription: Source-backed generic graph colour tones, paired themes and VueFlow 1 integration.\norder: 5\n---\n\n`@beehexa/vueflow-tokens` adapts the authoritative tokens to VueFlow 1. It does not copy\nVueFlow source, bundle Vue, generate graph data, or change relationship direction.\n\n## Install and apply\n\nInstall this package, `@beehexa/design-tokens`, Vue 3, and the VueFlow 1 core, controls and\nminimap peers. Load upstream core, theme, controls and minimap CSS in the lazy graph\nentry before adapter CSS; load native design-token CSS once with a 16px root/14px body.\nLocal source packages remain private `0.0.0`; that is not a registry release.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nThe factory returns scoped variables, viewport bindings typed with `FlowProps` (not deprecated `FlowOptions`), and Background/MiniMap bindings.\nIt resolves light plus dark overrides and Vietnamese typography alternatives from the token\npackage. Recompute when theme or locale changes. Keep ready/error handlers and fit the graph\nwith padding `0.2` when the host becomes measurable or changes size. VueFlow 1's actual\n`fitViewOnInit` option is used; do not pass invented viewport option names.\n\n## Colour tones are not statuses\n\n`FlowTone` (`FLOW_TONES`) names eight generic colour tones: `blue`, `red`, `green`,\n`crimson`, `yellow`, `teal`, `magenta` and `purple`. Each reads one existing foundation\n`flow.category.*` role set; the foundation keys keep their names, and the package gives a\ntone no meaning. The consumer decides which of its own node or relation kinds takes which\ntone. A tone must not be interpreted as success, failure or warning. Keep the node's kind\nlabel and icon; colour is never its sole identity, and a tone does not certify the state of\nan execution.\n\nEach tone supplies `foreground`, `background`, `border` and `hover` as an opaque paired\nlight/dark role. Use `getFlowTonePalette(tone)` for CSS-backed bindings; its `border` is\nthe frame/edge identity. These source roles replace historical application-owned palettes,\nalpha overlays, gradients and palette-adjustment functions. Never append hex alpha suffixes\nto a CSS variable, or lighten a resolved role downstream.\nFor a native kind Tag, bind `getFlowToneBadgeStyles(tone)` to the public `style` prop and\nomit `color`. This cached immutable recipe pairs the tone foreground/background/border\ninstead of putting native white text on a frame/edge stroke. The canonical contrast check\nincludes all eight small-text pairs in both themes at WCAG AA 4.5:1; the native family\ndemonstrates their actual paint. The teal foreground and border remain separate roles.\n\n\nSelection uses `color.border.selected` plus the selected outline; keyboard focus separately\nuses `color.border.focus`, the focused border width and `state.focus.offset`. Errors use the\ndanger frame plus dashed/non-colour indication and a readable error label. Selection or focus\nmust not overwrite tone identity, hide an error, or be conveyed only through colour.\nResting handles use the neutral icon role. Focus color is reserved for actual focus,\nnot an always-on connector decoration.\n\n## Native WorkflowViewer anatomy\n\nKeep the actual `WorkflowViewer` / `WorkflowNodeCard` and provide its public\n`NodeLook`: title, subtitle, kind, caption, category icon, source/destination\nlogos, domain indicators and optional typed execution. The Source companion\n`.bh-workflow-canvas` binds those existing slots to complete Source roles:\n`font.heading.xsmall` for the fully wrapped title, `font.body.default` for the\ndescription and `font.body.small` for kind, caption and indicators. The fixed\nneutral category tile is not a run-state badge. Do not replace a rich native\nnode with its ID or a plain rectangle in order to apply tokens.\nNative stadium nodes grow to their content's intrinsic width within the existing\nnative minimum and maximum. Short terminal titles remain whole beside their category\nglyph and optional execution marker. Keep the native maximum; do not remove a marker,\nclip a title or add consumer-specific terminal widths.\n\nOrdinary cards can explicitly opt into `NodeLook.sizing: 'content'`. The native\ncanvas owns only the width mechanism: the box grows to content between\n`--wf-node-content-min-width` and `--wf-node-content-max-width`. The Source\ncompanion owns those roles (`diagram.card.width` and twice that role) and the whole\npresentation recipe: title/kind wrap, the growing head and every source/destination\nlogo kept within the card. No declaration is defined in both stylesheets. No fixed-width\nincrease applies to other consumers; stadium, diamond and ellipse cards ignore the opt-in.\nKeep all logos; do not supply guessed geometry or patch card internals downstream.\n\nNative `WorkflowEdge.tone` is orthogonal to `variant`. Use `blue`, `red` or `green`:\nSource binds `--wf-edge-tone-<tone>` to the existing foundation border roles\n`--bh-flow-category-task-border`, `--bh-flow-category-dependency-border` and\n`--bh-flow-category-transformation-border` in the current theme (foundation names\nunchanged), with static solid, short-dash and dash-dot cues. The consumer maps its own\nrelation kinds onto these tones. Do not use failure to colour a relation. The native\nrenderer validates tokens, retains tone ink/cues under hover, selection, trace, failure,\npossible and context, and carries them to arrowheads and jump swatches. PNG export reuses\nthe native exporter's DOM/stylesheet serialization, with no tone-specific path. Omitted tone\npreserves existing edge behavior.\n\nRelation certainty, context and failure are shape cues, never a new dash pattern,\na colour change of the tone or an opacity reduction, so each tone dash stays unique\n(WCAG 1.4.1/1.4.11):\n\n- **Possible** (`certainty: 'possible'`, a dynamic-route candidate or SWITCH case): a\n hollow mini-diamond at the source end, the BPMN 2.0 conditional-flow marker.\n- **Context** (`context: true`, retained breadcrumb context): a UML-style open\n arrowhead and the thinner resting stroke `--wf-edge-context-width`, a package-owned\n variable bound to the foundation `border.width.default`; highlight widens it as usual.\n- **Toned failure** (`variant: 'failure'` with a tone): tone ink and tone dash, plus\n the Lucide `CircleX` mark painted with `color.icon.danger` (`--wf-edge-failure-icon`)\n beside the edge label. The mark is decorative (`aria-hidden`); jump names and the\n legend keep the words. An untoned failure keeps the failure ink and `5 4` dash.\n\nPossible and context may combine. Pass the localized group name as `familyLabel`:\njump chips and lists are then named `{family} jump to {target}`, numbered `(n of m)`\nwhen parallel jumps would share a name. Localize the whole name, numbering and list\ntitles through the viewer's `texts.jumps` (`WorkflowJumpTexts`), keeping the group word\nfirst; a localized group inside the English default is not a localized name. Sources:\n`packages/vueflow-tokens/src/styles.css` and the native `workflow-canvas` edge.\nThese source bindings do not prove appearance: manually check both themes, many logos,\nlong titles, parallel tones, possible/context/failure marks, trace/hover/fullscreen\nand exported PNG.\n\n**Group frames.** A native group (`WorkflowNode.group`, the built-in `wf-group` node) is\nthe node's card as a header with a round expand/collapse toggle; expanded, its children sit\ninside a frame below the header. The companion binds the frame to the package-owned\n`--wf-group-*` variables, each over an existing foundation role: border `color.border`,\nborder width `border.width.default`, radius `radius.card`, fill `color.surface.subtle`\nand, for a frame inside a frame, `color.background.neutral`, so the levels read apart;\npadding `space.stack` and header gap `space.150`. No flow-specific foundation token backs\nthem. The native layout reads `--wf-group-padding` and\n`--wf-group-header-gap` from the canvas, so keep both plain lengths. High contrast draws\nthe frame border in text ink. A frame is a container, never a tone or a run state:\ndo not tint it by tone or status.\n\n**Selection box.** Shift + drag on the empty native canvas draws a box that selects the\ncards it touches (an expanded frame only when fully inside). The companion binds it to the\nsame selection recipe as `.bh-vue-flow .vue-flow__selection`: a transparent box (no fill, so\nthe swept cards stay visible) with a dashed `border.width.selected` border in\n`color.border.focus`, in light and dark. A selection keeps the node selection ring; the box\nis never a tone or run-state cue.\n\n**Find box.** The native viewer's find box (`/` or the dock's Search) is an overlay with a\nsearch field and result rows. The companion binds its `--wf-find-*` and the shared `--wf-list-*`\nroles: `color.surface.overlay`, `elevation.shadow.overlay` and `radius.overlay`, with no border\n(an overlay is set apart by its surface and shadow) and a `color.border` divider under the field.\nThe field and the empty state use `font.body.default`, the placeholder `color.text.subtlest`\nand the empty state `color.text.subtle`. A row uses `font.label.default` for the node's name,\n`space.075` / `space.item.x` padding, at least `size.control.default` high (`size.target.touch`\non coarse pointers and below 768 px) and `radius.item`; the kind label after the name is\n`font.body.small` in `color.text.subtle`, and a node without a name shows its id in\n`font.code.default`. Names wrap at word boundaries and are never truncated; only a single word\nwider than the row breaks. Rows take the overlay item states one step apart: the row under the\npointer `color.surface.overlay.hover`; the keyboard-active row `color.surface.overlay.selected`\nwith the `border.width.selected` start bar in `color.border.selected` as its non-colour cue;\nthat row hovered `color.surface.overlay.selected.hover`. Text keeps its colour in every state;\neach pair is in the checked contrast list. Focus is the field's ring around the whole box\n(`border.width.focused`, `color.border.focus`, `state.focus.offset`). While a row is under the\npointer or reached with ↓ / ↑, the canvas previews its node with the existing hover state and\nthe node's outer ring (`diagram.selection-ring`); it ends when the pointer leaves the list, the\nquery changes or the box closes, and never changes the selection, the trace or the viewport (an\noff-screen node is not panned to). Do not restyle the box per viewer.\n\nDiamond and ellipse titles and kind captions wrap at word boundaries and are never truncated:\ntheir side padding follows their width, so a mid-word break would read as two words and an\nellipsis would hide the node's own name. Only a single word wider than the content box\nbreaks. Ordinary cards may still break a long unbroken title anywhere.\n\n`NodeLook.execution` is absent for definitions. Typed states retain their\n`diagram.*` fill/stroke/text pairs and native non-colour marker; the not-taken\nboundary is dashed. Selection, hover and keyboard focus stay on independent\nouter-ring geometry, so a selected failed node remains visibly failed.\nRepetition, logos and group disclosure remain domain metadata.\n\nLog-derived node readings `reached` (a legacy log says the step ran, no typed outcome) and\n`unfinished` (started, no recorded end) are not typed run outcomes. The companion paints them\nwith `diagram.log-reached` / `diagram.log-unfinished` as outline and marker ink\n(`--wf-node-state-ink`); nodes keep an independent selection ring, so node `reached` keeps the\nlog role. `unfinished` leaves the node's own fill and text (including high-contrast overrides)\nand dashes both the outline and the subroutine edge `4 3`. `--wf-node-execution-outline-width`\nbinds `border.width.focused` for `ranOk`, `ranFailed`, `reached` and `unfinished`, as Mermaid\ndraws them; `neverReached` / `branchNotTaken` keep the native default.\nNever present either reading as `ranOk` or `ranFailed`.\n\nEdge run evidence `WorkflowEdge.execution` (`reached`, `unfinished`, `failed`, `notTaken`) is\ndistinct from the authored failure route (`variant: 'failure'`) and from tone. Source binds:\n\n- `reached` to `color.text`, not `diagram.log-reached`: that role and the edge highlight\n (`--wf-edge-active`, `diagram.selection-ring`) are the same blue, so a resting walked edge\n would look selected. Its non-colour cue is the bold `--wf-edge-execution-width`\n (`border.width.focused`), like Mermaid's neutral walked edge.\n- `unfinished` to `diagram.log-unfinished`, dashed `4 3`.\n- `failed` to `diagram.fail-stroke`, with the circle-x failure mark.\n- `notTaken` (a declined route) to `diagram.nottaken-stroke` at the ordinary width, dashed `6 3`.\n\n`--wf-edge-execution-width` must be a CSS length. Execution ink wins over tone ink; the\n`unfinished` / `notTaken` dash wins over tone and failure dashes, and a displaced authored\nfailure keeps its circle-x mark. The legend names each present reading and edge accessible\nnames append it (`Edge from A to B, run failed`). In high contrast `reached` shares the edge ink\n(`color.text`) and is distinguished by width; the other readings keep their theme-resolved inks.\n\nThe real native live demo belongs to the\n[`workflow-canvas` producer playground](https://github.com/hexasync-saas/workflow-canvas#native-source-anatomy-playground),\nnot a replacement renderer embedded here. In that checkout run\n`npm ci && npm run playground -- --host 127.0.0.1 --port 5174` and open\n`http://127.0.0.1:5174/?anatomy`. It reuses the existing nine-node credential,\n38-node RPA and loop fixtures with theme/language controls, explicit sample\ntyped execution, long title/metadata, native ports, selection and native PNG\nexport. Build Source packages first and prepend `HEXASYNC_LOCAL_PACKAGES=1`\nto verify unpublished adapter anatomy from built public exports. Default\nplayground installs remain registry-only; Source site CI needs no access to\nthe private native canvas package. The [Mermaid demonstration](/tools/mermaid/)\nruns here using its public native model and the same Source anatomy roles.\n\nRouting stays in the native canvas. Unpinned edges select attachment sides from\nthe current measured layout; authored source/target pins remain authoritative.\nAfter dragging a task or expanding a group, do not repin every edge to one side\nor resurrect a downstream layout processor to hide an attachment defect.\n\n## Custom content and geometry\n\nUse `getFlowNodeStyles({ tone, width, height, shape? }, state)` for custom node bodies.\nIt binds semantic fonts, spacing, the tone pair and the consumer-owned dimensions;\n`shape: 'circle'` rounds the body fully and `state.dashed` dashes its border. Keep custom\nicons, logos, labels, handles, accessibility semantics and events in the application.\nMeaningful loading indicators may move; decorative node entrances, pulsing identities,\nrotating idle icons, hover transforms, flowing edge dashes, gradients and glass are not part\nof the theme.\n\nCustom tone content uses `getFlowToneStyles(tone, part?)`;\n`foreground` sets tone text, `border` sets border colour and `background`\nsets its paired surface. Tone glyphs use `getFlowIconStyles(tone, options)`,\nwhose default colour is the tone border, not text. Options accept source icon\nsize names or numeric API sizes, an already source-resolved colour, and disabled.\nStatus icon keys (`status-success|warning|error|info|loading`) and control keys\n(`control-expand|collapse|help`) resolve separate operational/neutral icon roles.\n`bh-flow-icon[data-bh-loading=\"true\"]` supplies meaningful loading motion with\nreduced-motion support. Never animate an idle kind icon.\n\nFor a labelled relationship indicator use `bh-flow-tone-mark` and\n`data-bh-tone=\"<FlowTone>\"`: the source owns its `space.075` circular\ngeometry and tone border-colour fill (`blue` when unset). A label/count must preserve the\nnon-colour meaning; this mark does not communicate execution status.\n\nThe package ships no node-size, grid or layout tables: node geometry belongs to the\nconsumer, and rendering, layout and half-dimension centering must read the same consumer\nsource. Preserve existing graph coordinates during theme adoption.\n\nGraph layout coordinates, intrinsic sizing, flex/grid mechanics and viewport transforms are\nnot palette values. Do not arbitrarily round them to the spacing scale. Tone adaptation\nmust not mutate the graph's IDs, expansion state, saved positions or relationship semantics.\n\nOrdinary node bodies, MiniMap cards and Controls frames use `radius.100` (8 px).\nTheir actual control buttons use `radius.050` (4 px), without clipping focus;\n4 px frame padding nests those control corners inside the 8 px frame. Node\nlogos retain their nested `radius.075` (6 px). Circular nodes keep their\ntrue circular geometry, as do connection handles; edge-routing radius remains\npath geometry. Inspector cards remain 8 px and dialogs/drawers use\n`radius.150` (12 px). The native WorkflowDock shares this compact frame/control\nfamily and floats inside the viewport, default lower-left, outside camera\ntransforms; never replace it with a full-width toolbar band. Text-editor headers\nremain intrinsic document chrome. Follow the [Radius role scale](/foundations/styles/radius/).\nThe native dock's zoom-menu surface uses `radius.overlay` (8 px), independently\nof compact Buttons and menu items; do not derive it from a button radius plus\na fixed pixel offset. Keep native MiniMap/legend surfaces at\n`radius.100` and the actual keyboard-shortcuts Dialog at `radius.150`; its close\nButton still uses `radius.050`. These role bindings belong to the Source companion,\nnot per-viewer CSS or a global chrome-radius change.\n\nBind the user's high-contrast setting to `data-bh-high-contrast=\"true\"` on the actual\n`bh-vue-flow` host. The companion CSS widens node/edge/path, button and custom\n`role=\"button\"` focus outlines from `border.width.focused` (2 px) to\n`border.width.accent` (4 px), preserving source focus colour/offset. Do not keep\nan application-owned descendant focus recipe.\n\nThe same host accepts `data-bh-large-text=\"true\"` and\n`data-bh-increased-spacing=\"true\"` for the user's opt-in accessibility settings:\n1.125em node text, and 1.6 line-height / 0.02em letter-spacing respectively.\nKeep actual user preference bindings; do not duplicate descendant CSS locally.\n\nNative `WorkflowViewer` consumers use `.bh-workflow-canvas` with\n`data-bh-contrast=\"high\"`. Its companion recipe strengthens node boundaries,\ndescriptive text, edges and arrowheads with theme-resolved strong text ink.\nSelection and error paint retain their separate meanings; focus uses the accent\noutline width. Removing the attribute restores the base recipe, and changing\ntheme while enabled resolves the new theme's ink without remounting the graph.\nKeep navigator and accessibility actions in the viewer's native `#dock` extension\nslot alongside its built-in controls rather than replacing the dock.\n\n\n## Edges, controls and export\n\n`styleTargetEdge(edge, nodes, toneOf?)` preserves the directed edge's target identity on\nboth stroke and marker from the target node's tone (`toneOf(node)`, `blue` when omitted or\nwhen the target is missing), keeps other edge data, and disables decorative traversal\nmotion. The application may retain dashed lines to communicate its own relation semantics.\nThe custom edge renderer must consume the supplied stroke rather than replace it with an\nunrelated edge palette. `FLOW_EDGE` centralizes widths, marker size, path radius and handle\nsize.\n\nCustom edge paths use `getFlowEdgeStyles(tone, suppliedStyle?)` for the full\nSVG presentation recipe. It preserves a supplied directed target stroke over the\ntone fallback and a supplied static dash, and uses `FLOW_EDGE.width`, no fill and a\nnon-scaling stroke; the consumer owns what a dash means.\nPath coordinates, marker shapes and relationship direction remain graph geometry.\nEdge styles and node container styles use VueFlow's public `Styles` type, including\ncustom theme variables. Detail simplification accepts and returns that same native\ncontract; applications do not need casts or copied style objects to assign it.\n`styleTargetEdge` retains an explicit open/closed arrow kind.\n`createVueFlowTheme({ nodeTone })` colours MiniMap nodes the same way (`blue` by default).\n\nThe CSS companion addresses actual VueFlow core/default nodes, handles, edge labels, selection,\nControls buttons and MiniMap surfaces. Controls preserve normal, hover, disabled and focus\nstates and enlarge to source touch targets for coarse pointers. Import it after upstream CSS;\nremove competing consumer-wide core/controls/minimap paint rules rather than escalating specificity.\n\nExport the current theme and font from the measured graph surface. Do not force a white\nbackground or independent system-font palette. Preserve snapshot/fit/restore, overlay filtering,\nresolution feedback and capture fallback handling. Check the real exported image, not just a\nsuccessful capture call.\n\nGraph fullscreen uses an isolated local stacking context at `z-index.modal` (400), like\nother fullscreen surfaces, so global inspectors opened from it stay above it. Private child chrome\nordering such as z10/z15 stays inside that context; do not assign global1001/1002\nto graph controls. Verify real inspector/dialog ordering, Escape and focus return.\n\n`getFlowDetailStyles(level, suppliedStyle)` removes shadow at minimal detail;\nbasic and detailed return the supplied style unchanged. It never reduces opacity:\nnode state, text contrast, focus and tone semantics must remain readable at\nevery zoom level. Viewport thresholds, metadata, measured positions and scheduling\nremain consumer logic; no nodes, relationships or data fields may be discarded.\n\n## Verification\n\nExercise light and dark, English and Vietnamese, selected plus focused and error nodes,\nlong labels, consumer-owned dimensions, target-coloured arrows, zoom/snap/fitting, expanded groups,\ncycles, narrow and fullscreen hosts, ESC exit, Controls, MiniMap and export. Calculate contrast\nfor the actual paired foreground/background and meaningful borders in each rendered theme;\nsource tokens and typed configuration alone are not accessibility or visual proof.\n",
|
|
2249
2249
|
"frontmatter": {
|
|
2250
2250
|
"title": "VueFlow theme",
|
|
2251
2251
|
"description": "Source-backed generic graph colour tones, paired themes and VueFlow 1 integration.",
|
|
@@ -4335,8 +4335,8 @@
|
|
|
4335
4335
|
"status": "active",
|
|
4336
4336
|
"releasePhase": null,
|
|
4337
4337
|
"planned": [],
|
|
4338
|
-
"body": "import NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` sở hữu adapter Ant Design Vue 4 dùng lại được. Dùng API\nESM có kiểu và CSS đi kèm của nó, dựa trên `@beehexa/design-tokens`. Framework là peer:\n`ant-design-vue@^4.2.6` và `vue@^3.3.0`; không gói nào được đóng kèm. Gói `0.0.0` chưa phát\nhành dùng tham chiếu phát triển cục bộ rõ ràng; chỉ quy trình phát hành được duyệt mới gắn\nversion thật. Không chép bảng màu theme vào ứng dụng.\n\n**Token Beehexa là nguồn chân lý. Ant Design Vue chỉ đọc chúng.**\n\nTrang này là nơi duy nhất foundations của Beehexa gặp Ant Design Vue. Các trang foundations giữ nguyên dù sản phẩm được xây bằng gì.\n\n## Cách dùng\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})` trả về\n`ThemeConfig` gốc. Tính lại khi theme/ngôn ngữ/cỡ chữ root đổi; mỗi lần gọi trả về một object\nmới. `locale` chọn typography gốc, không chọn thông điệp. Observer gốc chỉ dùng trong setup đo\nmột phần tử thử 1rem không tương tác rồi dọn nó đi. Nhờ đó các API kích thước/chữ/radius dạng\nsố gốc khớp với đơn vị CSS co giãn; viền và breakpoint tính bằng pixel không co giãn. Factory\nthuần không đọc DOM. Truyền gói ngôn ngữ AntD phù hợp qua `ConfigProvider.locale`, và cấu hình\nthư viện ngày riêng. Render các holder gốc `useMessage`, `useNotification` và `useModal` trong\nmột host phản hồi bên trong provider root duy nhất. Gắn facade thông báo của ứng dụng vào các\nAPI hook đó; không bao giờ dùng API phản hồi tĩnh thô tách rời. Factory đặt `hashed: false`\nvì nếu không, holder message/notification theo ngữ cảnh của AntD4 sẽ giữ hash cũ khi đổi\ntheme/ngôn ngữ. Giữ một thông báo đang mở khi chuyển từ tối/tiếng Việt sang sáng/tiếng Anh;\nchữ và màu của nó phải theo theme đang dùng.\n\nGiữ `data-theme` và `lang` của document đồng bộ cho overlay được teleport. Import CSS đi kèm\nsau style của ứng dụng/framework. Dùng root gốc 16px và chữ thân 14px; API dạng số phân giải\nrem của nguồn ở 16px. Entry pixel không phải đường dùng cho dashboard.\n\n## Quyền sở hữu overlay và nội dung gốc có giới hạn\n\nPopup được kích hoạt dùng `getAntDesignVuePopupContainer` để nằm trong Modal/Drawer gốc gần\nnhất hoặc host `data-bh-overlay-owner` tuỳ chỉnh. Root của Modal/Drawer gốc vẫn gắn vào body\nđể có hình học theo viewport. Facade modal gắn với provider mặc định đặt `zIndex` lúc gọi qua\n`getAntDesignVueModalZIndex()` nhưng vẫn giữ giá trị bên gọi chỉ định rõ; nhờ vậy hộp xác\nnhận bằng bàn phím/có await nằm trên phần tử sở hữu hiện hành. Drawer lồng nhau dùng\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` làm `rootStyle.zIndex` để bề mặt và\nmask di chuyển cùng nhau; prop `zIndex` của AntD4 chỉ tạo style cho lớp bọc nội dung.\nEditor/ảnh toàn màn hình teleport vào body và Modal gốc toàn màn hình lấy\n`getAntDesignVueFullscreenZIndex()` trước khi gắn root. Hàm này dùng `z-index.modal`\nvới thứ tự nằm trên phần tử sở hữu, không tạo tầng toàn màn hình riêng. Chỉ đánh dấu\nroot tuỳ chỉnh khi chúng đang hoạt động, tránh tự đếm chính mình. Bảy tầng được duyệt\nkhông có token fullscreen450 hay readiness650; trạng thái chờ chặn thao tác cũng dùng\n`z-index.modal`. Giữ thứ tự tương đối theo phần tử sở hữu dưới `z-index.tooltip` và\n`z-index.toast`; dành `z-index.spotlight` cho hướng dẫn Tour. Mặc định inline gốc của\nTour cũng cần prop `zIndex` công khai gắn với `z-index.spotlight`.\n\nKhung Modal và lớp bọc nội dung Drawer cố ý kế thừa `pointer-events: none`; nội dung gốc chỉ\nkhôi phục khả năng nhận con trỏ cho cây con của chính nó. CSS đi kèm cũng khôi phục\n`pointer-events: auto` trên các root popup gốc thật được portal vào một trong hai khung đó\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover và Tour). Khung\nvẫn trong suốt với con trỏ ở ngoài nội dung và popup; mask, việc giữ focus và cách đóng gốc giữ\nnguyên. Không dời popup vào body đang cuộn, đổi z-index hay thêm ghi đè cho trang để xử lý\nkhoảng hở con trỏ kế thừa này.\n\nCSS đi kèm cung cấp các quy ước cấu trúc gốc tuỳ chọn, không phải selector của ứng dụng:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: thân có giới hạn, header/footer kích thước\n tự nhiên, tuỳ chọn bỏ padding thân; gắn qua `rootClassName`. Giữ overflow tự động mặc định\n của thân gốc thay vì chặn truy cập khi control tự nhiên hoặc mức tối thiểu của ô được giữ\n vượt phần cấp ngắn. Không lặp style flex/overflow của thân ở phía bên dùng.\n- `bh-ant-fill-modal`: gắn qua `wrapClassName` gốc, không phải `rootClassName` mà Modal không\n hỗ trợ. Overlay cố định thật cấp một hộp thoại có giới hạn, cách mép theo token; lớp bọc nội\n dung/focus và thân của nó lấp đầy quanh header/footer tự nhiên. Chiều rộng vẫn là chiều rộng\n gốc của bên gọi, giới hạn trong overlay khả dụng. Dùng cho việc xem trình hiển thị tương tác,\n không cho hộp xác nhận ngắn. Chỉ viewport của trình hiển thị sở hữu phần tràn khi nhỏ hơn\n mức tối thiểu; không trừ chiều cao khung đoán chừng.\n- `bh-ant-fill-tabs`: lớp bọc gốc và pane đang mở có giới hạn. Tabs lồng nhau bật riêng;\n `bh-ant-fill-tabs--scroll` bật cuộn trong pane và `bh-ant-tabs-mobile-inset` thêm lề mobile\n của nguồn. Pane không hoạt động vẫn ẩn.\n Tabs bên trong tài liệu đang cuộn đó có thể thay bằng `bh-ant-fill-tabs--document`: lớp bọc\n giữ chiều cao nội dung tự nhiên và lớn lên khi đủ chỗ, không cắt trình hiển thị sau khi\n metadata dài chiếm hết phần cấp. Pane cuộn gốc bên ngoài sở hữu truy cập theo chiều dọc;\n không đặt cả hai modifier trên cùng một root. Chỉ host trình hiển thị tương tác nhận\n `--bh-layout-renderer-minimum-block-size`, không phải pane bên ngoài hay trường tĩnh.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: đưa một host có giới hạn sẵn có đi qua các lớp bọc\n gốc. Nội dung tài liệu/cây/danh sách tĩnh có thể giữ không co và hiện phần tràn bên trong\n phần tử cuộn sẵn có của Card gốc. Không ghép vùng cuộn Card đó với vùng cuộn bên trong thứ\n hai cao 0 khi header của nó chiếm hết một pane nhỏ. Cách ghép tài liệu này không thêm mức\n tối thiểu dễ đọc của SDK cho trường thông thường.\n- `bh-ant-fit-empty`: chỉ trên Empty gốc thật bên trong một phần giữ chỗ đã được cấp. Chỉ chọn\n hình minh hoạ gốc không đảm bảo vừa trong host thấp. Tuỳ chọn này bỏ margin đoạn văn bên\n ngoài và của mô tả (cha sở hữu lề), giới hạn root và cho hàng ảnh co lại trước mô tả/footer\n tự nhiên. Ảnh giữ chiều cao ưu tiên gốc và bỏ khoảng baseline inline; cả hình phóng to lẫn\n margin đoạn văn đều không chiếm host nhỏ. Nó không thêm mức tối thiểu cho trình hiển thị,\n bảng màu, typography chữ, thay ảnh hay chặn tràn. Giữ đúng một phần tử cuộn thật của cha khi\n ngay cả chữ/thao tác tự nhiên cũng không vừa. Empty thông thường của tài liệu/danh sách/bảng\n bỏ qua nó và giữ mặc định gốc. Bộ component gốc trực tiếp bên dưới so sánh phần cấp\n 2/4/12rem, hình minh hoạ đơn giản và dạng gốc không bật tuỳ chọn.\n- `AntDesignVuePopupScope`: chỉ cho trình hiển thị được giữ di chuyển giữa các phần tử sở hữu\n overlay gốc. Bọc cây con sẵn có bên ngoài Teleport của nó và truyền root HTMLElement sẵn có\n làm `owner`; giữ thuộc tính owner trên root thật đó. Giữ một phần tử thật làm root của\n component dùng khi bên gọi dùng `v-show` hay directive phần tử khác; đặt scope bên trong root\n sẵn có đó, không thay chỗ nó. Holder popup gốc ổn định di chuyển cùng owner vì AntD4 cache\n container portal đầu tiên. Scope lồng nhau kế thừa đích bao ngoài. Theme/ngôn ngữ của\n ConfigProvider gốc, menu, focus và portal body không có trigger vẫn là gốc; không có rekey\n editor/model/đồ thị hay z-index popup toàn cục nào liên quan. Handler capture toàn màn hình\n nhường Escape cho menu/listbox qua `isAntDesignVueMenuEvent(event)` trước khi đóng overlay\n của chính nó. Portal Drawer gốc có thể dùng cùng host ổn định qua scoped slot công khai:\n `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` với\n `<a-drawer :get-container=\"getContainer\">`. Thuộc tính HTML trên scope thuộc về host portal\n thật đó; chỉ hiện `role=\"dialog\"`, `aria-label` và `aria-modal` có điều kiện khi đang mở,\n nếu Drawer gốc bỏ các thuộc tính này. Không thêm lớp bọc hộp thoại thứ hai hay sửa DOM gốc.\n Flex của AntD4 cũng bỏ các thuộc tính khác class/style: dùng một phần tử ngữ nghĩa thật sẵn\n có khi ID được điều khiển, tên vùng hay điểm dừng Tab phải được giữ.\n- Lựa chọn có thể chọn và mở rộng độc lập ghép slot tiêu đề Card thật với Button mở rộng và\n Button chọn gốc anh em cùng một Tag phím tắt. Giữ header Card không tương tác; mỗi Button chỉ\n sở hữu thao tác của nó. Header Collapse của AntD4 giữ `role=\"button\"`/điểm dừng Tab ở phần\n tử cha kể cả ở chế độ chỉ icon, nên không lồng lựa chọn có thao tác độc lập vào đó. Slot thân\n Card có điều kiện gốc sở hữu nội dung mở rộng; không cần vá role/bàn phím header riêng hay\n CSS thu gọn lựa chọn đặc biệt.\n- `bh-ant-inspection-descriptions`: chiều rộng nhãn tối thiểu trên desktop và hàng xếp chồng\n trên mobile theo nguồn.\n- `bh-ant-data-table`: class hàng pending/success/error chung cùng dấu `customCell` công khai\n `data-bh-cell-interaction=\"editable|readonly\"` và `data-bh-cell-state=\"changed\"`. Trạng\n thái chọn gốc được ưu tiên hơn màu hàng vận hành; ô đã đổi giữ màu diff khi hover.\n `bh-ant-table-nowrap` là tuỳ chọn độc lập cho nội dung ngang.\n Thêm `bh-ant-row-indicators` để có dấu danger lề trong `border.width.accent` ở ô đầu tiên\n của hàng `bh-ant-row-error`. Tín hiệu vấn đề không dựa vào màu này không đổi hình học cột,\n không ghi đè trạng thái chọn và không thay chữ/icon trạng thái.\n- `data-bh-tone=\"warning\"` trên root Badge gốc chọn `color.background.warning.bold` /\n `color.text.on-bold` chỉ cho số đếm. Chấm trạng thái vận hành gốc giữ ngữ nghĩa và hình\n tròn riêng của nguồn.\n- `data-bh-target=\"touch\"` trên Button gốc chọn `size.target.touch` làm chiều rộng/cao tối\n thiểu mà không tô lại nó. `data-bh-target=\"responsive\"` chỉ áp vùng bấm đó cho con trỏ thô.\n Giữ ngữ nghĩa type, size, disabled và bàn phím gốc; không cần trang tự định kích thước vùng\n bấm.\n- Root đã quan sát cũng có thể truyền vào `tokenPixels(name, locale, rootFontSize)` cho props\n dạng số thật của Avatar/Image thay cho CSS rem co giãn. Setup của phần tử con dùng lại số đo\n chỉ đọc của provider duy nhất, không tạo observer khác.\n\nGiữ dữ liệu nghiệp vụ tuỳ chỉnh/nghĩa của slot và cấu trúc host ở phía bên dùng, không giữ\ncông thức trình bày. Không tạo lại selector gốc bằng `:deep(.ant-*)` theo từng trang, ghi\nđè toàn cục hay tăng độ ưu tiên.\n\n## Ánh xạ token\n\n| Token Ant Design | Token Beehexa |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nDùng [radius theo vai trò](/vi/foundations/styles/radius/), không dùng một radius cho mọi\ncomponent:\n\n| Component | Token radius |\n| --- | --- |\n| Button, Input, ô chọn của Select, Radio button, Segmented, mục điều hướng bên | `radius.control` (6 px) |\n| Control 24 px | `radius.control.small` (4 px) |\n| Mục trong dropdown hoặc popup submenu | `radius.item` (4 px) |\n| Tooltip, tag, số đếm của badge | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs và các khung trong trang khác | `radius.card` (8 px) |\n| Dropdown, popup submenu, popup của Select, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (tròn), Switch, chip | `radius.pill` |\n| Bảng rộng hết cỡ, cạnh ghép của Search, bề mặt toàn màn hình | `radius.0` |\n\nNhóm có padding 4 px dùng góc ngoài 8 px; nhóm có padding 8 px dùng góc ngoài 12 px. Adapter\ncố định các alias component này và CSS đi kèm xử lý các trường hợp badge, Switch, Segmented và\nDrawer không có đầu vào theme. Bên dùng phải bỏ các ghi đè góc cạnh tranh, không thêm bản vá\nradius `.ant-*`. Props Button `shape=\"circle\"` / `shape=\"round\"` chỉ định rõ giữ kích thước\ngốc và góc `radius.control`. Chúng không phải vai trò avatar, Switch hay chip.\n\nAdapter cũng cố định các vai trò ngữ nghĩa hover/nhấn/vô hiệu/link/trạng thái/chọn/focus\nthay vì để bảng màu xanh do framework sinh lọt qua. Input, select, checkbox và radio dùng\n`color.border.bold`, còn card/bảng dùng `color.border`. Header và sider của Layout nằm trên\n`color.surface.page`, tách khỏi nội dung bằng một đường `color.border`; drawer điều hướng\ntrên mobile là drawer trên `color.surface.overlay`. Không có bảng màu khung riêng hay theme\nlồng cô lập. Dùng `font.body.default` cho dữ liệu bảng, `font.label.small` cho tiêu đề/tag,\n`font.heading.medium` cho tiêu đề modal và `font.heading.small` cho tiêu đề drawer.\n\nIcon Menu gốc giữ ô icon của nguồn và khoảng cách tới tiêu đề `space.050`. Chữ tiêu đề dùng\n`font.label.default` thay vì hộp dòng theo chiều cao hàng, giữ nhãn tiếng Việt và nội dung\ntiêu đề/tag bên cạnh do bên dùng sở hữu thẳng hàng theo chiều dọc.\n\n### Quy ước component Ant Design Vue 4\n\n- Table đọc `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` và\n `controlItemBgActiveHover`. Tên AntD5 như `headerBg` và `headerColor` bị AntD Vue 4.2.6 bỏ\n qua và không được dùng.\n- Switch đọc rãnh OFF từ `colorTextQuaternary`/`colorTextTertiary`, rãnh ON từ\n `colorPrimary`/`colorPrimaryHover`, con trượt dùng chung từ `colorWhite`, **cả hai** nhãn\n từ `colorTextLightSolid`, và độ mờ vô hiệu/loading từ `opacityLoading`. Đây là ánh xạ theo\n phạm vi component, không đổi màu primary/chữ toàn cục. Tên kiểu AntD5 như\n `trackBg`/`handleBg` không phải API trạng thái của AntD4.\n- Menu đọc `colorItem*`, `radiusItem`, `radiusSubMenuItem` và `colorActiveBar*`. Menu\n `theme=\"dark\"` chỉ định rõ nhận cùng vai trò nguồn. Trạng thái chọn có thanh hiển thị,\n không phải nhãn đậm hơn làm xê dịch phần tử bên cạnh hay chỉ đổi màu nền.\n- Control form dùng chung vai trò viền ngoài/focus/vô hiệu của nguồn. Kiểm tra hợp lệ giữ\n chữ/icon danger/warning và ngữ nghĩa trạng thái gốc. Không thay viền ô nhập có ý nghĩa bằng\n đường kẻ phân cách mảnh.\n- Preset trạng thái của Tag là `success`, `processing`, `warning`, `error`; mặc định là trung\n tính. Chúng dùng cặp màu chữ và viền ngoài của nguồn. Preset sắc màu tuỳ ý không phải tên\n trạng thái. Số đếm Badge là trung tính; chấm trạng thái error/processing giữ ngữ nghĩa của\n chúng.\n- Tooltip và Message dùng cặp bề mặt/chữ đảo (inverse). Nội dung Modal/Drawer dùng surface,\n scrim và độ nổi overlay. Progress mặc định trung tính và mang nghĩa khi success/error.\n\n### Quy ước Switch gốc\n\nDùng Switch gốc bên trong ConfigProvider root sẵn có. `enabled`, `saving`, `unavailable` và\n`locale` bên dưới là trạng thái của ứng dụng; không tạo provider lồng hay theme cục bộ chỉ\ncho lịch, phân quyền hay nút bật/tắt trạng thái.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` là trung tính đậm, không bao giờ là xanh thành công nghiệp vụ. `switch.off.*`\ncó con trượt đậm, nhãn đọc được và đường biên có ý nghĩa để trạng thái OFF đang bật không bị\nnhầm với vô hiệu. Nguồn định nghĩa các vai trò rãnh/con trượt/nhãn/viền đi cặp cho thường,\nhover, nhấn, focus, loading và vô hiệu; cỡ thường và `size=\"small\"` dùng cùng bảng màu\nsáng/tối và hình học gốc sẵn có. Vị trí con trượt gốc, `aria-checked`, nhãn và vòng focus\nriêng cung cấp tín hiệu không dựa vào màu. Nhãn trạng thái ngắn EN/VI dùng typography gốc\nsẵn có, không vá chiều cao hay khai báo font phía bên dùng.\n\nAntD4 chỉ hỗ trợ một cặp con trượt/nhãn dùng chung, không có màu rãnh khi nhấn và không có\ncặp màu vô hiệu rõ ràng. Màu spinner và bóng xanh trong suốt của con trượt cũng không cấu hình\nđược như các phần đi cặp. CSS đi kèm lấp các khoảng thiếu có căn cứ đó, còn màu rãnh thường/\nhover vẫn nằm trong alias gốc. `opacityLoading: 1` bỏ hiệu ứng làm mờ loading/vô hiệu gốc; vai\ntrò vô hiệu không trong suốt rõ ràng vẫn khác với OFF đang bật. Loading giữ cặp checked thường\nhiện tại và spinner gốc tương phản cao, kể cả khi đặt cả prop loading lẫn disabled. Nó không\nbao giờ đoán trước hay đổi giá trị đã lưu.\n\nGiữ binding có điều khiển, callback `change` và thao tác bàn phím gốc. Nút gốc bị vô hiệu khi\nloading; kích hoạt khi đang chờ/vô hiệu không được lưu hai lần hay cập nhật trạng thái checked.\nThao tác lưu nghiệp vụ và lỗi vẫn do ứng dụng sở hữu. Kiểm tra cả hai cỡ,\ntrạng thái loading OFF/ON và vô hiệu, nhãn EN/VI, số lần gọi callback và một lần lưu có điều\nkhiển có độ trễ. Không cần bản vá `.ant-switch`, giá trị màu viết cứng hay\nSwitch tự làm ở phía bên dùng.\n\n### CSS đi kèm và class cấu trúc\n\nƯu tiên token component. CSS của gói lấp các khoảng thiếu thật của AntD4: typography ngữ nghĩa\ncho nhãn/tiêu đề, màu nền submenu viết cứng, màu thanh chọn, khoảng lệch focus bàn phím, vùng\nan toàn, vị trí Tour đáp ứng, giảm chuyển động và số đếm Badge trung tính mà không tô lại chấm\nlỗi. Selector của ứng dụng và ghi đè bảng màu không thuộc về CSS đó hay theme dashboard. Bên\ndùng chỉ giữ cơ chế bố cục và cuộn của portal thật. Các bản sửa màu và typography của framework\nthuộc về gói, không lặp lại thành ghi đè phía bên dùng.\n\nDescriptions có viền cắt nền ô bên trong khung bo gốc thay vì tô đè lên các góc trái. Card chỉ\ncó header bỏ đường phân cách header/thân thừa và giữ đủ bốn góc bo; Card có thân/ảnh bìa/thao\ntác giữ phân tách gốc. Card có viền và hoverable giữ `color.border.bold` cùng\n`elevation.shadow.raised` khi hover và focus bàn phím, thay vì viền hover trong suốt của AntD4.\nFocus cũng dùng viền ngoài/khoảng lệch chuẩn; ứng dụng vẫn sở hữu ngữ nghĩa thao tác bàn phím.\nCác bản sửa framework này tự động, không phải ghi đè theo từng trang.\n\nSearch gốc, nút addon của Input, InputGroup gọn và Space.Compact ngang dùng chung một hàng flex\nkéo giãn tự nhiên: cạnh trên/dưới của ô nhập và thao tác thẳng hàng, viền kề nhau chồng lên\nnhau một lần, góc lộ ra dùng `radius.control` và góc tiếp xúc bằng 0. Vai trò font gốc được\ngiữ. Trường/thao tác nhỏ tiếng Việt cùng lớn lên 26 px; không cắt dấu hay thu nhỏ chữ để ép\n24 px. Thao tác mặc định dùng chung viền error/warning/vô hiệu của trường; thao tác primary/\ndanger giữ vai trò ngữ nghĩa của chúng. Icon xoá giữ hộp dòng cỡ icon để không làm phình lớp\nbọc affix.\n\n`bh-ant-tag-large` trên Tag chọn nhãn lớn của nguồn (tối thiểu 24px, padding ngang 8px); mặc\nđịnh là tối thiểu 20px/6px. Cả hai lớn lên theo hộp dòng tiếng Việt thay vì cắt dấu.\n`bh-ant-tree-fill` trên Tree thật lấp đầy một host flex có giới hạn, kể cả bên dưới phần tóm\ntắt tự nhiên. Root và danh sách tạo chuỗi min-height bằng 0; chỉ holder danh sách gốc cuộn,\ngiữ đích cuộn bàn phím của nó. Không truyền chiều cao cố định hay thêm vùng cuộn bọc khác. Cây\ncó kích thước tự nhiên bỏ tuỳ chọn này. Bên dùng có điều hướng bàn phím gắn cặp gốc\n`activeKey` / `onActiveChange`: trạng thái `ref<TreeProps['activeKey']>()`, rồi\n`:active-key=\"activeKey\"` và `@active-change=\"activeKey = $event ?? undefined\"`. Đường\nactive-change không điều khiển của AntD 4.2 không giữ nút được yêu cầu; một tuỳ chọn CSS lấp\nđầy không thể cung cấp trạng thái điều hướng đó.\n\nĐể xem dữ liệu, gắn `width=\"var(--bh-ant-overlay-width)\"` và áp `bh-ant-inspection-modal`\nhoặc Drawer `rootClassName=\"bh-ant-inspection-drawer\"`. Chỉ thêm\n`bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` cho biến thể nhiều nội dung\nchỉ định rõ. Biến này chọn `layout.overlay.default` / `.wide`, và `.mobile` dưới\n`breakpoint.lg`. Hộp xác nhận ngắn và drawer điều hướng giữ chiều rộng riêng. Chế độ toàn màn\nhình là Modal `wrapClassName=\"full-screen\"` và Drawer `rootClassName=\"fullscreen\"`; Modal của\nAntD4 không có prop `rootClassName`. Chúng giữ cơ chế cuộn có giới hạn, không phải trang trí.\n\n### Kiểm tra trên framework thật\n\nThử sáng/tối × tiếng Anh/tiếng Việt với CSS thật đã import: button và input/select có kiểm tra\nhợp lệ, checkbox ở hàng bảng thường/đã chọn/đang hover, portal sắp xếp/lọc, điều hướng mở\nrộng/thu gọn/ngang và submenu, trợ giúp/lỗi form, Tooltip/Message, Modal/Drawer và chế độ xem\nmặc định/rộng/toàn màn hình ở 1023/1024px. Kiểm tra focus bàn phím, vùng chạm, giảm chuyển\nđộng, Tour hẹp và trả focus. Dùng **ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** trong control, tag\nvà hàng. Chỉ biên dịch thành công chưa chứng minh được kết quả render/tương tác đó.\n\n\n## Khoảng cách\n\nKích thước của Ant Design Vue đến từ `sizeUnit` và `sizeStep`. Giữ cả hai ở 4, để `size` là 16 px. Theme sau đó đặt từng kích thước từ một token [spacing](/vi/foundations/styles/spacing/).\n\n| Token Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` và `space.1000` không có token Ant Design Vue. Dùng biến CSS của chúng trong style của bạn.\n\nProps nhận số, như `size` của `a-space` và `gutter` của `a-row`, nhận pixel. Dùng một giá trị trong thang: `<a-space :size=\"8\">`.\n\n## Chiều cao control\n\n| Token Beehexa | Chiều cao | Token Ant Design Vue | Prop component |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | Không có |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nĐây là các chiều cao riêng của Ant Design Vue. Theme vẫn đặt từng chiều cao từ token kích thước của nó, nên thay đổi token sẽ tới được component. Xem [Size and density](/vi/foundations/styles/size-and-density/).\n\n## Breakpoint\n\n**Ghi đè các token `screen*` bằng [breakpoint](/vi/foundations/styles/layout/breakpoints/) của Beehexa.** Giá trị mặc định của Ant Design Vue khác (576, 992, 1200 và 1600 px).\n\nToken `Min` và `Max` được tính từ giá trị mặc định, không từ giá trị bạn ghi đè. Đặt cả chúng: mỗi `Max` là breakpoint kế tiếp trừ 1.\n\n| Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue có sáu breakpoint còn Beehexa có bốn, nên `sm` chuyển cùng `md`, và `xxl` cùng `xl`. Dùng các prop `xs`, `md`, `lg` và `xl` của `a-col`.\n\nKhi đó props của `a-col` và `gutter` đáp ứng của `a-row` chuyển ở đúng các độ rộng của Beehexa. Không dùng `xxxl`: media query của nó bị sai trong Ant Design Vue 4.2.6 và không bao giờ khớp.\n\n## Grid\n\nAnt Design Vue chia một hàng thành 24 phần. [Grid](/vi/foundations/styles/layout/grid/) của Beehexa có 4, 8 hoặc 12 cột, và mỗi loại chia hết cho 24.\n\n| Grid Beehexa | Cửa sổ | Span của `a-col` |\n|---|---|---|\n| 4 cột | Dưới 768 px | Span Beehexa × 6 |\n| 8 cột | 768 đến 1023 px | Span Beehexa × 3 |\n| 12 cột | Từ 1024 px | Span Beehexa × 2 |\n\n| Bố cục | Span Beehexa (4 / 8 / 12 / 12) | Props của mỗi `a-col` |\n|---|---|---|\n| Thẻ, 1 đến 4 mỗi hàng | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Khung chính | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Khung bên | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Ô tóm tắt | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nHàng của Ant Design Vue mặc định không có gutter. Đặt nó từ token khoảng cách, và đặt lề trang trên vùng nội dung.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## Khung ứng dụng\n\n| Vùng | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Điều hướng bên, mở | 280 px | `<a-layout-sider :width=\"280\">` |\n| Điều hướng bên, thu gọn | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nHeader mặc định cao 64 px và không có token cho chiều cao, nên đặt nó trong style của header.\n\nProp `breakpoint` của `a-layout-sider` dùng độ rộng cố định, bỏ qua các token `screen*`. Không dùng nó. Đặt `collapsed` từ media query của bạn và lựa chọn của người dùng: mở từ 1024 px, thu gọn thành thanh hẹp khi người dùng yêu cầu, và ghi nhớ lựa chọn. Dưới 1024 px, ẩn sider và hiện menu trong `a-drawer`.\n\nXem [Layout](/vi/foundations/styles/layout/) cho khung.\n\n## Hàng bảng tương tác\n\nChỉ gắn `data-bh-interactive=\"true\"` qua `customRow` khi toàn bộ hàng đã có handler kích hoạt.\nCSS đi kèm của nguồn sở hữu con trỏ dạng tay; phím/class chọn gốc giữ công thức chọn của\nchúng. Giữ thao tác hàng có trợ năng, hành vi bàn phím và việc kích hoạt bản ghi thật thay vì\nthay trạng thái chọn bằng viền ngoài tự làm.\n\n\n## Ghép component gốc và biến thể tuỳ chọn\n\nDùng component gốc thật. Các tuỳ chọn này không cho phép thay bằng div, lớp bọc chỉ đổi giao\ndiện, hay chép hình học Card/Button vào ứng dụng.\n\n- Prop `hoverable` của Card gốc vẫn là tuỳ chọn. `data-bh-selected=\"true\"` thêm nền đã chọn\n và tín hiệu viền trong độc lập; bỏ nó sẽ trở về dạng gốc.\n- Dùng lại `bh-data-accent` với `data-bh-status`, `data-bh-band`, `data-bh-metric`,\n `data-bh-job-type` hoặc `data-bh-priority` ngữ nghĩa sẵn có cho cạnh đầu tuỳ chọn trên một\n Card thật. Nó không thêm hành vi chọn hay hover. Cạnh trạng thái/nhóm loại vẫn giữ khi chọn;\n focus bàn phím vẫn là viền ngoài riêng. Gắn thuộc tính phân biệt phù hợp với dấu đó thay vì\n gộp trạng thái với danh tính nhóm loại. Nhãn vẫn bắt buộc.\n- `data-bh-layout=\"content\"` trên Button thật cho phép nhãn ghép nhiều dòng: chiều cao tự động,\n xuống dòng bình thường, căn đầu và chiều cao tối thiểu của control mặc định theo nguồn.\n Props, padding và kích hoạt bàn phím vẫn là gốc. Dùng prop size/block thông thường của Button\n khi đủ.\n- `bh-ant-shell-region` bỏ padding gốc của Header/Footer chỉ khi vùng đó đã chứa header/footer\n ứng dụng được ghép. Nó không đổi chiều cao, màu gốc hay bố cục vùng trang đáp ứng xung quanh.\n- `bh-card-link` trên anchor điều hướng thật bọc Card bỏ màu/gạch chân link cạnh tranh và cung\n cấp focus bàn phím theo nguồn, không phải giao diện Card.\n\nComponent nghiệp vụ có thể sở hữu dữ liệu, trạng thái, hành vi và cách ghép có ý nghĩa của các\nkhối cơ bản này. Liệt kê và bỏ các component thay thế thừa cùng mọi nơi gọi/import/export đã\nlỗi thời. Nội dung phong phú được sinh ra phải gắn control nâng cao gốc thật khi framework chứa\ncho phép; riêng một stylesheet từ phía cung cấp không phải bằng chứng thiếu năng lực gốc.\n\n\n### Nội dung gốc vận hành và được ghép\n\n`Steps[data-bh-operational=\"true\"]` dùng success/info/danger/subtle cho các trạng thái gốc\nfinish/process/error/wait. Nó giữ nguyên Steps điều hướng theo nhóm loại. `data-bh-skipped=\"true\"`\ntrên một Step thật thêm đuôi nét đứt ở cả hai hướng; bên gọi giữ thứ tự và nghĩa của quan hệ.\nSlot icon tuỳ chỉnh không cần dựng lại khối Steps cơ bản.\n\n`Result[data-bh-layout=\"step\"]` giữ hàng header icon và tiêu đề của báo cáo được ghép, với\nphụ đề/nội dung và extra/thao tác bên dưới rộng hết cỡ. Nó chỉ đổi bố cục/padding gốc; màu\ntrạng thái và slot gốc vẫn là gốc.\n\n`data-bh-highlighted=\"true\"` trên tiêu đề Tree gốc là tín hiệu định vị tạm thời, không phải\nkey đã chọn hay focus bàn phím. Treenode gốc đã chọn/vô hiệu sẽ ẩn nó; viền ngoài của nguồn\nkhông đổi hình học tiêu đề.\n\nDùng `bh-partner-logo-image` trên Image thật cho tài sản connector/thương hiệu. Chỉ gắn chiều\ncao ảnh đối tác của nguồn và `width=\"auto\"`; Image gốc cùng adapter giữ tỉ lệ khung hình tự\nnhiên mà không có khung vuông hay cắt. Avatar định danh thật vẫn là gốc. Không dùng sắc màu\nthương hiệu làm trạng thái vận hành.\n\n### Xem trước Image gốc\n\nToken chính thức `zIndexPopupBase` và `zIndexPopup` của Image dùng dải toàn màn hình. Chỉ vậy\nchưa đủ vượt lên trên phần tử sở hữu lồng bên trên nó: Preview của AntD 4.2.6 bỏ cả `zIndex`\nkhai báo cho Dialog lẫn `wrapProps`. Composable setup `useNativeImagePreviewContainer(labelGetter)`\ntừ `@beehexa/ant-design-vue-tokens/image` sở hữu portal body lazy chính thức: truyền getter của\nnó vào `preview.getContainer` gốc. Nó đặt tên cho hộp thoại gốc thật, phản ứng khi đổi ngôn\nngữ và lấy một lớp nằm trên các phần tử sở hữu hiện hành ở mỗi lần mở, không tính lớp trước\nđó của chính nó. Portal đã đóng không phải phần tử sở hữu overlay. Observer/container của nó\nđược giải phóng khi gỡ. Image gốc vẫn sở hữu zoom/pan, đóng bằng bàn phím và trả focus; không\ncó trình xem tự làm.\n\n\n`bh-ant-card-flush` cho thân Card thật bỏ lề trong chỉ khi chứa editor, canvas hay ô ghép nhúng\nsát mép. Card thông thường giữ padding gốc. Dùng lại `bh-ant-fill-card` và `bh-ant-fill-spin`\ncho host flex có giới hạn sẵn có; không tạo alias lấp đầy song song hay khôi phục selector\nriêng phía bên dùng. Card flush cắt màu nhúng theo khung bo gốc của nó. iframe trình duyệt là\ncon trực tiếp được bỏ viền mặc định của trình duyệt để tránh khung thứ hai; hành vi\nsandbox/srcdoc và tài liệu nhúng vẫn do trình duyệt sở hữu.\n\n`semanticTableComponents` từ `@beehexa/ant-design-vue-tokens/table` mở rộng API `components`\ncông khai của Table thật. `customCell` của một cột có thể trả về `{ scope: 'row' }`; ô thân của\nnó trở thành `th` ngữ nghĩa, chuyển tiếp thuộc tính và slot gốc. Các ô khác vẫn là `td`. AntD4\nkhông có prop cột cho row scope và CSS ô thân của nó chỉ nhắm `td`, nên CSS đi kèm của nguồn\ncung cấp công thức kích thước/viền/hover/chọn cho tiêu đề hàng tương ứng, lấp khoảng thiếu\nngữ nghĩa HTML thật này. Cột, hàng và Summary gốc vẫn là gốc.\n\nMột ListItem gốc thật có thể bật `data-bh-interactive=\"true\"` cho hàng kích hoạt phong phú khi\nkhông có control gốc hẹp hơn nào đáp ứng quy ước nội dung của nó. Tuỳ chọn chỉ cung cấp hover/\ncon trỏ/focus; bên dùng cung cấp thao tác thật, kích hoạt bằng bàn phím và role có trợ năng.\nKhông lồng các đích tương tác cạnh tranh.\n\n\nThương hiệu connector và đối tác dùng chung `content.partner-logo.image-size` làm chiều cao\nhiển thị, không phải giới hạn chiều rộng. Giữ chiều rộng tự nhiên; cho hàng xuống dòng khi cần.\nVai trò chiều cao icon ngữ nghĩa cũng giữ chiều rộng theo tỉ lệ và vùng bấm. Table gốc đã tạo\nstyle hình học `tfoot > tr > th` ở mỗi cỡ; CSS đi kèm chỉ thêm viền tiêu đề hàng của Summary\ncòn thiếu và độ đậm/căn lề ngữ nghĩa. `a-typography-link[data-bh-target=\"responsive\"]` dùng\nvùng bấm tối thiểu 24px của nguồn, tăng lên 44px chỉ với con trỏ thô; nó không thêm giao diện\nlink.\n\n\nCard flush cắt màu nhúng theo khung bo thật của nó. Footer Drawer gốc giữ lề chuẩn hoặc lề vùng\nan toàn của thiết bị, lấy giá trị lớn hơn. `Spin[data-bh-mode=\"nonblocking\"]` bỏ lớp phủ/chặn\ncon trỏ gốc chỉ cho nội dung tải dần vẫn xem được; bỏ nó cho việc thật sự chặn như xuất dữ\nliệu. Điều này không đổi thời gian spinner hay dữ liệu đồ thị.\n\n\n## Progress gốc phân đoạn chỉ đọc\n\nVới phản hồi “Bước 3/7”, dùng `Progress` gốc thật với `steps` và `percent` thật. Đây không phải\nđiều hướng: không thay bằng `Steps`, `Segmented`, một hàng dấu tự dựng hay bộ máy tiến độ khác.\n\n`size=\"small\"` của AntD4 cố ý vẽ mỗi bước thành **mảnh dọc 2 × 8px**. Bộ `[width, height]` gốc\ncủa nó là hình học **của từng đoạn**. Helper của nguồn phân giải\n`content.step-progress.segment-width` và `segment-height` thành 16 × 4px ở root 16 và 20 × 5px\nở root 20. Gắn nó theo kiểu phản ứng:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Bước {{ props.index }}/{{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nTính năng sở hữu tổng số dương thật, chỉ số hiện tại, chữ trạng thái và các chuyển tiếp nghiệp\nvụ. Helper chỉ cung cấp hình học; Progress gốc sở hữu số đoạn đã render và các dấu đang hoạt\nđộng. Chỉ ẩn thanh thừa khỏi công nghệ hỗ trợ khi chữ bên cạnh đã truyền đạt cùng tiến độ.\n\n`bh-ant-step-progress` cho root gốc đó dùng chiều rộng inline tự nhiên, bỏ margin ngoài gốc,\ndùng `content.step-progress.gap` của nguồn (4px ở root 16) và xuống dòng mà không có margin ở\nmục cuối. CSS không thay API size gốc hay đặt chiều rộng/chiều cao cho từng dấu. Thanh nằm theo\nsau trạng thái trên hàng rộng và xuống dòng trong chiều rộng khả dụng trên mobile.\n\nBỏ class và helper để giữ dạng gốc. Progress phần trăm, tải lên và đếm ngược thông thường không\nbật tuỳ chọn này. Ma trận trực tiếp dùng chung bên dưới gồm một bản so sánh gốc thật không bật\ntuỳ chọn, tổng số chỉnh được và control đầu/giữa/cuối; kiểm tra cả root 16 và root 20, sáng/tối\nvà độ rộng hẹp.\n\n## Progress mảnh khi chuyển trang\n\nĐể báo đang tải trang, dùng `Progress` gốc thật với `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` và bộ kích thước gốc của nó.\nDùng `border.width.focused` cho độ dày đường và `color.brand.yellow` cho màu nét thương hiệu\n(tuỳ chọn). Ứng dụng tự định vị cố định ở `top: 0`, chiều rộng và lớp trong bảy token\n[z-index](/vi/foundations/styles/z-index/); adapter bỏ khoảng baseline inline và margin ngoài của\nAntD, để nét thật bắt đầu đúng ở mép trên được cấp mà không cần dịch âm.\n\nProgress thể hiện các mốc điều hướng đã xong, không phải phần trăm mạng tự đặt. Giữ trang cũ\ntrong lúc guard và chunk của route đang tải, tiến tới 100%, và chờ hiệu ứng chuyển chiều rộng gốc\nkết thúc rồi mới chuyển sang trang mới. Huỷ, lỗi và điều hướng mới hơn phải tự xoá tiến độ của\nchính nó mà không xoá yêu cầu mới hơn. Hiệu ứng chuyển chiều rộng dùng `motion.duration.default`\nvà `motion.easing.linear`; chế độ giảm chuyển động bỏ hiệu ứng này. Giữ một progressbar có tên\nvới giá trị mốc thật, và không bao giờ phủ cả trang chỉ để tải một route.\n\n## Một họ control gốc, các vai trò riêng biệt\n\nDùng Button default gốc cho trigger tiện ích gọn có viền (kể cả ngôn ngữ và theme), cùng cỡ gốc\nvới các control trang bên cạnh. Dùng slot `#icon` công khai và một phần tử con là nhãn; Button\nchỉ có icon vẫn cần tên truy cập. Không nguỵ trang `type=\"text\"` toàn cục thành Button default.\nMenu tài khoản/avatar không khung dùng `type=\"text\"` hợp lệ, một Avatar thật và Space gốc: căn\ngiữa nó trong hàng thay vì tự chế giao diện khung.\n\nButton small/default/large dùng chiều cao control của nguồn 24/32/40px ở root danh nghĩa;\ntypography là label-small cho cỡ small và label-default cho các cỡ khác. Button/Input/Select và\nmục điều hướng bên dùng `radius.control`; popup của Select và menu dùng `radius.overlay`.\nObserver root/theme dạng số và CSS rem co giãn cùng nhau. AntD4 chỉ chèn margin cho phần tử anh\nem `.anticon`, không cho SVG Lucide trong `#icon`; nguồn cung cấp một khoảng flex space100 cho\nmọi Button thật và bỏ margin gốc/icon loading cạnh tranh. Không cần class riêng cho khung ứng\ndụng. Default/primary/text/link, vô hiệu/loading, hover/nhấn và focus bàn phím gốc vẫn tách\nbiệt. `data-bh-target=\"responsive\"` thêm kích thước chạm tối thiểu chỉ với con trỏ thô. Trạng\nthái mở của Dropdown/Menu không phải trạng thái chọn của Button; giữ `aria-expanded`, hành vi\nbàn phím của menu và trả focus trong tính năng thật.\n\nCặp primary trung tính đậm/đảo là có chủ ý: graphite ở chế độ sáng, graphite nhạt với chữ tối ở\nchế độ tối. Thao tác Tiếp tục nhạt màu ở chế độ tối không phải lý do tô lại mọi Button primary\nhay text thành màu xanh. Thao tác link giữ bảng màu link của nguồn; thao tác tiện ích default vẫn\ncó viền.\n\n| Biến thể gốc | Vai trò nguồn và quy ước trạng thái |\n| --- | --- |\n| Default / dashed | Surface, chữ và viền; nền trung tính nhạt khi hover/nhấn. Dashed giữ viền nét đứt gốc. |\n| Primary | Cặp trung tính đậm/đảo cùng vai trò hover/nhấn đậm riêng. |\n| Danger primary | Cặp danger đậm/chữ trên nền đậm, kể cả hover/nhấn. |\n| Danger default / dashed / text / ghost | Chữ danger đọc được; biến thể có viền giữ viền danger. Biến thể không phải link dùng nền danger nhạt khi hover/nhấn. Ghost bắt đầu trong suốt, không bao giờ với nhãn đặc trên nền đậm. |\n| Link / text | Vai trò link/không khung riêng, không phải Button default nguỵ trang. |\n| Ghost | Biến thể có viền trong suốt gốc với màu chữ hợp vai trò và ngữ cảnh chứa; không phải primary đặc. |\n| Vô hiệu / loading | Hành vi chặn và alias vô hiệu gốc là chuẩn, kể cả Button dạng anchor bị vô hiệu. Loading không làm mờ một cặp màu nguồn vốn đọc được. |\n\nAntD4 vẽ **bóng dưới khi nghỉ** từ `controlOutline` cho primary, `controlTmpOutline` cho default\nvà `colorErrorOutline` cho danger-primary. Các tên này không chỉ là đầu vào cho focus bàn phím.\nDùng lại alias focus xanh toàn cục ở đó tạo ra một vệt xanh lạc lõng kể cả khi mọi animation đã\nxong. Nguồn đặt ba alias component Button này thành trong suốt; nó không xoá vai trò focus toàn\ncục hay đặt độ dày của nó bằng 0.\n\nFocus bàn phím của Button gốc thay vào đó đọc `colorPrimaryBorder` và `lineWidthBold`. Ghi đè\ncomponent của nó dùng màu/độ dày focus của nguồn. Quy tắc `:focus-visible` khi bật của CSS đi\nkèm cung cấp viền ngoài/khoảng lệch độc lập, có khe hở theo nguồn. Nền trạng thái default/dashed\nvà các cặp chữ danger/chữ trên nền đậm riêng là những khoảng thiếu token gốc còn lại; CSS nguồn\nchỉ xử lý các trường hợp đó, trừ control vô hiệu và trạng thái chọn thật. Ứng dụng không được\nthêm reset bóng/viền cục bộ hay chặn focus.\n\n### Ma trận trực tiếp trạng thái gốc và tiến độ\n\nDùng control theme/ngôn ngữ của site và tuỳ chọn cỡ chữ root của trình duyệt. Đổi cỡ Button,\nhover/giữ nhấn, Tab/Enter/Space qua các thao tác khả dụng, và xem số lần kích hoạt thật. Button\nloading/vô hiệu và anchor gốc vô hiệu không được kích hoạt. Progress dùng cùng số đếm/chỉ số\nthật cho bản bật và không bật tuỳ chọn.\n\n<NativeControlsDemo />\n\n\n### Ghép gốc trên mobile và nội dung có giới hạn\n\nAdapter kéo giãn các trường Input/Search/nhóm gọn ghép nối và thao tác của chúng thành một hàng,\nkể cả trạng thái kiểm tra hợp lệ, vô hiệu và vùng bấm cho con trỏ thô. Button chỉ có icon giữ tỉ\nlệ kích thước gốc; với con trỏ thô cả hai chiều đạt `size.target.touch`. Button bố cục theo nội\ndung giữ chữ nhiều dòng mà không ghi đè kích thước chạm tối thiểu chỉ định rõ hay đáp ứng.\n\nDưới `breakpoint.md`, mọi tiêu đề header/meta của Card gốc đều xuống dòng, kể cả ellipsis của\nTypography con, Tag và Space. Đây là nội dung dễ đọc toàn cục, không phải ghi đè tuỳ chọn của\nbên dùng. Extra của header vẫn dùng được. Chấm, đuôi và chấm tuỳ chỉnh của Timeline chuẩn căn\ntheo dòng nội dung đầu tiên; nội dung sự kiện xuống dòng vẫn nằm trong cột timeline gốc. Timeline\ndạng label/alternate/right giữ cách căn gốc riêng.\n\nFlex của AntD4 không chuyển tiếp `role`, `aria-*`, `data-*` hay listener DOM tuỳ ý. Không đặt\nngữ nghĩa bắt buộc, tuỳ chọn nguồn hay handler bàn phím trên nó. Dùng Space/Typography gốc khi\nphù hợp, hoặc giữ một host ngữ nghĩa thật với CSS flex/grid cấu trúc tối thiểu. Không thêm lớp\nbọc chuyển tiếp.\n\nDùng `bh-content-toolbar` và `bh-content-toolbar__group` trên host thanh công cụ thật; nguồn sở\nhữu khoảng cách, padding, xuống dòng và kích thước tối thiểu control trên mobile. Các công thức\nnày áp cho control editor/sơ đồ/đồ thị, không phải giao diện riêng của trang. Giữ host và các\nphần tử con flex co được bằng `min-width: 0`.\n\nGắn `bh-ant-fill-spin` qua **wrapperClassName** của Spin, không qua class: lớp bọc nested-loading\nmang chiều cao có giới hạn. Chế độ fill/flush của Drawer đi qua chuỗi content-wrapper/content/\nwrapper-body gốc; header/footer giữ kích thước tự nhiên và thân sở hữu phần không gian còn lại.\nTabs chỉ lấp pane đang mở của chính nó. Bên dùng cung cấp phần tử cha có giới hạn thật, không\nđoán chiều cao viewport trừ header. Monaco/Mermaid theo dõi kích thước host đó mà không thay\nmodel editor hay đặt lại pan/zoom biểu đồ hiện có.\n",
|
|
4339
|
-
"raw": "---\ntitle: Theme Ant Design Vue\ndescription: \"Cho component Ant Design Vue dùng design token, breakpoint, grid, chiều cao control và khung ứng dụng của Beehexa.\"\norder: 3\n---\nimport NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` sở hữu adapter Ant Design Vue 4 dùng lại được. Dùng API\nESM có kiểu và CSS đi kèm của nó, dựa trên `@beehexa/design-tokens`. Framework là peer:\n`ant-design-vue@^4.2.6` và `vue@^3.3.0`; không gói nào được đóng kèm. Gói `0.0.0` chưa phát\nhành dùng tham chiếu phát triển cục bộ rõ ràng; chỉ quy trình phát hành được duyệt mới gắn\nversion thật. Không chép bảng màu theme vào ứng dụng.\n\n**Token Beehexa là nguồn chân lý. Ant Design Vue chỉ đọc chúng.**\n\nTrang này là nơi duy nhất foundations của Beehexa gặp Ant Design Vue. Các trang foundations giữ nguyên dù sản phẩm được xây bằng gì.\n\n## Cách dùng\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})` trả về\n`ThemeConfig` gốc. Tính lại khi theme/ngôn ngữ/cỡ chữ root đổi; mỗi lần gọi trả về một object\nmới. `locale` chọn typography gốc, không chọn thông điệp. Observer gốc chỉ dùng trong setup đo\nmột phần tử thử 1rem không tương tác rồi dọn nó đi. Nhờ đó các API kích thước/chữ/radius dạng\nsố gốc khớp với đơn vị CSS co giãn; viền và breakpoint tính bằng pixel không co giãn. Factory\nthuần không đọc DOM. Truyền gói ngôn ngữ AntD phù hợp qua `ConfigProvider.locale`, và cấu hình\nthư viện ngày riêng. Render các holder gốc `useMessage`, `useNotification` và `useModal` trong\nmột host phản hồi bên trong provider root duy nhất. Gắn facade thông báo của ứng dụng vào các\nAPI hook đó; không bao giờ dùng API phản hồi tĩnh thô tách rời. Factory đặt `hashed: false`\nvì nếu không, holder message/notification theo ngữ cảnh của AntD4 sẽ giữ hash cũ khi đổi\ntheme/ngôn ngữ. Giữ một thông báo đang mở khi chuyển từ tối/tiếng Việt sang sáng/tiếng Anh;\nchữ và màu của nó phải theo theme đang dùng.\n\nGiữ `data-theme` và `lang` của document đồng bộ cho overlay được teleport. Import CSS đi kèm\nsau style của ứng dụng/framework. Dùng root gốc 16px và chữ thân 14px; API dạng số phân giải\nrem của nguồn ở 16px. Entry pixel không phải đường dùng cho dashboard.\n\n## Quyền sở hữu overlay và nội dung gốc có giới hạn\n\nPopup được kích hoạt dùng `getAntDesignVuePopupContainer` để nằm trong Modal/Drawer gốc gần\nnhất hoặc host `data-bh-overlay-owner` tuỳ chỉnh. Root của Modal/Drawer gốc vẫn gắn vào body\nđể có hình học theo viewport. Facade modal gắn với provider mặc định đặt `zIndex` lúc gọi qua\n`getAntDesignVueModalZIndex()` nhưng vẫn giữ giá trị bên gọi chỉ định rõ; nhờ vậy hộp xác\nnhận bằng bàn phím/có await nằm trên phần tử sở hữu hiện hành. Drawer lồng nhau dùng\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` làm `rootStyle.zIndex` để bề mặt và\nmask di chuyển cùng nhau; prop `zIndex` của AntD4 chỉ tạo style cho lớp bọc nội dung.\nEditor/ảnh toàn màn hình teleport vào body và Modal gốc toàn màn hình lấy\n`getAntDesignVueFullscreenZIndex()` trước khi gắn root. Hàm này dùng `z-index.modal`\nvới thứ tự nằm trên phần tử sở hữu, không tạo tầng toàn màn hình riêng. Chỉ đánh dấu\nroot tuỳ chỉnh khi chúng đang hoạt động, tránh tự đếm chính mình. Bảy tầng được duyệt\nkhông có token fullscreen450 hay readiness650; trạng thái chờ chặn thao tác cũng dùng\n`z-index.modal`. Giữ thứ tự tương đối theo phần tử sở hữu dưới `z-index.tooltip` và\n`z-index.toast`; dành `z-index.spotlight` cho hướng dẫn Tour. Mặc định inline gốc của\nTour cũng cần prop `zIndex` công khai gắn với `z-index.spotlight`.\n\nKhung Modal và lớp bọc nội dung Drawer cố ý kế thừa `pointer-events: none`; nội dung gốc chỉ\nkhôi phục khả năng nhận con trỏ cho cây con của chính nó. CSS đi kèm cũng khôi phục\n`pointer-events: auto` trên các root popup gốc thật được portal vào một trong hai khung đó\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover và Tour). Khung\nvẫn trong suốt với con trỏ ở ngoài nội dung và popup; mask, việc giữ focus và cách đóng gốc giữ\nnguyên. Không dời popup vào body đang cuộn, đổi z-index hay thêm ghi đè cho trang để xử lý\nkhoảng hở con trỏ kế thừa này.\n\nCSS đi kèm cung cấp các quy ước cấu trúc gốc tuỳ chọn, không phải selector của ứng dụng:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: thân có giới hạn, header/footer kích thước\n tự nhiên, tuỳ chọn bỏ padding thân; gắn qua `rootClassName`. Giữ overflow tự động mặc định\n của thân gốc thay vì chặn truy cập khi control tự nhiên hoặc mức tối thiểu của ô được giữ\n vượt phần cấp ngắn. Không lặp style flex/overflow của thân ở phía bên dùng.\n- `bh-ant-fill-modal`: gắn qua `wrapClassName` gốc, không phải `rootClassName` mà Modal không\n hỗ trợ. Overlay cố định thật cấp một hộp thoại có giới hạn, cách mép theo token; lớp bọc nội\n dung/focus và thân của nó lấp đầy quanh header/footer tự nhiên. Chiều rộng vẫn là chiều rộng\n gốc của bên gọi, giới hạn trong overlay khả dụng. Dùng cho việc xem trình hiển thị tương tác,\n không cho hộp xác nhận ngắn. Chỉ viewport của trình hiển thị sở hữu phần tràn khi nhỏ hơn\n mức tối thiểu; không trừ chiều cao khung đoán chừng.\n- `bh-ant-fill-tabs`: lớp bọc gốc và pane đang mở có giới hạn. Tabs lồng nhau bật riêng;\n `bh-ant-fill-tabs--scroll` bật cuộn trong pane và `bh-ant-tabs-mobile-inset` thêm lề mobile\n của nguồn. Pane không hoạt động vẫn ẩn.\n Tabs bên trong tài liệu đang cuộn đó có thể thay bằng `bh-ant-fill-tabs--document`: lớp bọc\n giữ chiều cao nội dung tự nhiên và lớn lên khi đủ chỗ, không cắt trình hiển thị sau khi\n metadata dài chiếm hết phần cấp. Pane cuộn gốc bên ngoài sở hữu truy cập theo chiều dọc;\n không đặt cả hai modifier trên cùng một root. Chỉ host trình hiển thị tương tác nhận\n `--bh-layout-renderer-minimum-block-size`, không phải pane bên ngoài hay trường tĩnh.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: đưa một host có giới hạn sẵn có đi qua các lớp bọc\n gốc. Nội dung tài liệu/cây/danh sách tĩnh có thể giữ không co và hiện phần tràn bên trong\n phần tử cuộn sẵn có của Card gốc. Không ghép vùng cuộn Card đó với vùng cuộn bên trong thứ\n hai cao 0 khi header của nó chiếm hết một pane nhỏ. Cách ghép tài liệu này không thêm mức\n tối thiểu dễ đọc của SDK cho trường thông thường.\n- `bh-ant-fit-empty`: chỉ trên Empty gốc thật bên trong một phần giữ chỗ đã được cấp. Chỉ chọn\n hình minh hoạ gốc không đảm bảo vừa trong host thấp. Tuỳ chọn này bỏ margin đoạn văn bên\n ngoài và của mô tả (cha sở hữu lề), giới hạn root và cho hàng ảnh co lại trước mô tả/footer\n tự nhiên. Ảnh giữ chiều cao ưu tiên gốc và bỏ khoảng baseline inline; cả hình phóng to lẫn\n margin đoạn văn đều không chiếm host nhỏ. Nó không thêm mức tối thiểu cho trình hiển thị,\n bảng màu, typography chữ, thay ảnh hay chặn tràn. Giữ đúng một phần tử cuộn thật của cha khi\n ngay cả chữ/thao tác tự nhiên cũng không vừa. Empty thông thường của tài liệu/danh sách/bảng\n bỏ qua nó và giữ mặc định gốc. Bộ component gốc trực tiếp bên dưới so sánh phần cấp\n 2/4/12rem, hình minh hoạ đơn giản và dạng gốc không bật tuỳ chọn.\n- `AntDesignVuePopupScope`: chỉ cho trình hiển thị được giữ di chuyển giữa các phần tử sở hữu\n overlay gốc. Bọc cây con sẵn có bên ngoài Teleport của nó và truyền root HTMLElement sẵn có\n làm `owner`; giữ thuộc tính owner trên root thật đó. Giữ một phần tử thật làm root của\n component dùng khi bên gọi dùng `v-show` hay directive phần tử khác; đặt scope bên trong root\n sẵn có đó, không thay chỗ nó. Holder popup gốc ổn định di chuyển cùng owner vì AntD4 cache\n container portal đầu tiên. Scope lồng nhau kế thừa đích bao ngoài. Theme/ngôn ngữ của\n ConfigProvider gốc, menu, focus và portal body không có trigger vẫn là gốc; không có rekey\n editor/model/đồ thị hay z-index popup toàn cục nào liên quan. Handler capture toàn màn hình\n nhường Escape cho menu/listbox qua `isAntDesignVueMenuEvent(event)` trước khi đóng overlay\n của chính nó. Portal Drawer gốc có thể dùng cùng host ổn định qua scoped slot công khai:\n `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` với\n `<a-drawer :get-container=\"getContainer\">`. Thuộc tính HTML trên scope thuộc về host portal\n thật đó; chỉ hiện `role=\"dialog\"`, `aria-label` và `aria-modal` có điều kiện khi đang mở,\n nếu Drawer gốc bỏ các thuộc tính này. Không thêm lớp bọc hộp thoại thứ hai hay sửa DOM gốc.\n Flex của AntD4 cũng bỏ các thuộc tính khác class/style: dùng một phần tử ngữ nghĩa thật sẵn\n có khi ID được điều khiển, tên vùng hay điểm dừng Tab phải được giữ.\n- Lựa chọn có thể chọn và mở rộng độc lập ghép slot tiêu đề Card thật với Button mở rộng và\n Button chọn gốc anh em cùng một Tag phím tắt. Giữ header Card không tương tác; mỗi Button chỉ\n sở hữu thao tác của nó. Header Collapse của AntD4 giữ `role=\"button\"`/điểm dừng Tab ở phần\n tử cha kể cả ở chế độ chỉ icon, nên không lồng lựa chọn có thao tác độc lập vào đó. Slot thân\n Card có điều kiện gốc sở hữu nội dung mở rộng; không cần vá role/bàn phím header riêng hay\n CSS thu gọn lựa chọn đặc biệt.\n- `bh-ant-inspection-descriptions`: chiều rộng nhãn tối thiểu trên desktop và hàng xếp chồng\n trên mobile theo nguồn.\n- `bh-ant-data-table`: class hàng pending/success/error chung cùng dấu `customCell` công khai\n `data-bh-cell-interaction=\"editable|readonly\"` và `data-bh-cell-state=\"changed\"`. Trạng\n thái chọn gốc được ưu tiên hơn màu hàng vận hành; ô đã đổi giữ màu diff khi hover.\n `bh-ant-table-nowrap` là tuỳ chọn độc lập cho nội dung ngang.\n Thêm `bh-ant-row-indicators` để có dấu danger lề trong `border.width.accent` ở ô đầu tiên\n của hàng `bh-ant-row-error`. Tín hiệu vấn đề không dựa vào màu này không đổi hình học cột,\n không ghi đè trạng thái chọn và không thay chữ/icon trạng thái.\n- `data-bh-tone=\"warning\"` trên root Badge gốc chọn `color.background.warning.bold` /\n `color.text.on-bold` chỉ cho số đếm. Chấm trạng thái vận hành gốc giữ ngữ nghĩa và hình\n tròn riêng của nguồn.\n- `data-bh-target=\"touch\"` trên Button gốc chọn `size.target.touch` làm chiều rộng/cao tối\n thiểu mà không tô lại nó. `data-bh-target=\"responsive\"` chỉ áp vùng bấm đó cho con trỏ thô.\n Giữ ngữ nghĩa type, size, disabled và bàn phím gốc; không cần trang tự định kích thước vùng\n bấm.\n- Root đã quan sát cũng có thể truyền vào `tokenPixels(name, locale, rootFontSize)` cho props\n dạng số thật của Avatar/Image thay cho CSS rem co giãn. Setup của phần tử con dùng lại số đo\n chỉ đọc của provider duy nhất, không tạo observer khác.\n\nGiữ dữ liệu nghiệp vụ tuỳ chỉnh/nghĩa của slot và cấu trúc host ở phía bên dùng, không giữ\ncông thức trình bày. Không tạo lại selector gốc bằng `:deep(.ant-*)` theo từng trang, ghi\nđè toàn cục hay tăng độ ưu tiên.\n\n## Ánh xạ token\n\n| Token Ant Design | Token Beehexa |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nDùng [radius theo vai trò](/vi/foundations/styles/radius/), không dùng một radius cho mọi\ncomponent:\n\n| Component | Token radius |\n| --- | --- |\n| Button, Input, ô chọn của Select, Radio button, Segmented, mục điều hướng bên | `radius.control` (6 px) |\n| Control 24 px | `radius.control.small` (4 px) |\n| Mục trong dropdown hoặc popup submenu | `radius.item` (4 px) |\n| Tooltip, tag, số đếm của badge | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs và các khung trong trang khác | `radius.card` (8 px) |\n| Dropdown, popup submenu, popup của Select, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (tròn), Switch, chip | `radius.pill` |\n| Bảng rộng hết cỡ, cạnh ghép của Search, bề mặt toàn màn hình | `radius.0` |\n\nNhóm có padding 4 px dùng góc ngoài 8 px; nhóm có padding 8 px dùng góc ngoài 12 px. Adapter\ncố định các alias component này và CSS đi kèm xử lý các trường hợp badge, Switch, Segmented và\nDrawer không có đầu vào theme. Bên dùng phải bỏ các ghi đè góc cạnh tranh, không thêm bản vá\nradius `.ant-*`. Props Button `shape=\"circle\"` / `shape=\"round\"` chỉ định rõ giữ kích thước\ngốc và góc `radius.control`. Chúng không phải vai trò avatar, Switch hay chip.\n\nAdapter cũng cố định các vai trò ngữ nghĩa hover/nhấn/vô hiệu/link/trạng thái/chọn/focus\nthay vì để bảng màu xanh do framework sinh lọt qua. Input, select, checkbox và radio dùng\n`color.border.bold`, còn card/bảng dùng `color.border`. Header và sider của Layout nằm trên\n`color.surface.page`, tách khỏi nội dung bằng một đường `color.border`; drawer điều hướng\ntrên mobile là drawer trên `color.surface.overlay`. Không có bảng màu khung riêng hay theme\nlồng cô lập. Dùng `font.body.default` cho dữ liệu bảng, `font.label.small` cho tiêu đề/tag,\n`font.heading.medium` cho tiêu đề modal và `font.heading.small` cho tiêu đề drawer.\n\nIcon Menu gốc giữ ô icon của nguồn và khoảng cách tới tiêu đề `space.050`. Chữ tiêu đề dùng\n`font.label.default` thay vì hộp dòng theo chiều cao hàng, giữ nhãn tiếng Việt và nội dung\ntiêu đề/tag bên cạnh do bên dùng sở hữu thẳng hàng theo chiều dọc.\n\n### Quy ước component Ant Design Vue 4\n\n- Table đọc `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` và\n `controlItemBgActiveHover`. Tên AntD5 như `headerBg` và `headerColor` bị AntD Vue 4.2.6 bỏ\n qua và không được dùng.\n- Switch đọc rãnh OFF từ `colorTextQuaternary`/`colorTextTertiary`, rãnh ON từ\n `colorPrimary`/`colorPrimaryHover`, con trượt dùng chung từ `colorWhite`, **cả hai** nhãn\n từ `colorTextLightSolid`, và độ mờ vô hiệu/loading từ `opacityLoading`. Đây là ánh xạ theo\n phạm vi component, không đổi màu primary/chữ toàn cục. Tên kiểu AntD5 như\n `trackBg`/`handleBg` không phải API trạng thái của AntD4.\n- Menu đọc `colorItem*`, `radiusItem`, `radiusSubMenuItem` và `colorActiveBar*`. Menu\n `theme=\"dark\"` chỉ định rõ nhận cùng vai trò nguồn. Trạng thái chọn có thanh hiển thị,\n không phải nhãn đậm hơn làm xê dịch phần tử bên cạnh hay chỉ đổi màu nền.\n- Control form dùng chung vai trò viền ngoài/focus/vô hiệu của nguồn. Kiểm tra hợp lệ giữ\n chữ/icon danger/warning và ngữ nghĩa trạng thái gốc. Không thay viền ô nhập có ý nghĩa bằng\n đường kẻ phân cách mảnh.\n- Preset trạng thái của Tag là `success`, `processing`, `warning`, `error`; mặc định là trung\n tính. Chúng dùng cặp màu chữ và viền ngoài của nguồn. Preset sắc màu tuỳ ý không phải tên\n trạng thái. Số đếm Badge là trung tính; chấm trạng thái error/processing giữ ngữ nghĩa của\n chúng.\n- Tooltip và Message dùng cặp bề mặt/chữ đảo (inverse). Nội dung Modal/Drawer dùng surface,\n scrim và độ nổi overlay. Progress mặc định trung tính và mang nghĩa khi success/error.\n\n### Quy ước Switch gốc\n\nDùng Switch gốc bên trong ConfigProvider root sẵn có. `enabled`, `saving`, `unavailable` và\n`locale` bên dưới là trạng thái của ứng dụng; không tạo provider lồng hay theme cục bộ chỉ\ncho lịch, phân quyền hay nút bật/tắt trạng thái.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` là trung tính đậm, không bao giờ là xanh thành công nghiệp vụ. `switch.off.*`\ncó con trượt đậm, nhãn đọc được và đường biên có ý nghĩa để trạng thái OFF đang bật không bị\nnhầm với vô hiệu. Nguồn định nghĩa các vai trò rãnh/con trượt/nhãn/viền đi cặp cho thường,\nhover, nhấn, focus, loading và vô hiệu; cỡ thường và `size=\"small\"` dùng cùng bảng màu\nsáng/tối và hình học gốc sẵn có. Vị trí con trượt gốc, `aria-checked`, nhãn và vòng focus\nriêng cung cấp tín hiệu không dựa vào màu. Nhãn trạng thái ngắn EN/VI dùng typography gốc\nsẵn có, không vá chiều cao hay khai báo font phía bên dùng.\n\nAntD4 chỉ hỗ trợ một cặp con trượt/nhãn dùng chung, không có màu rãnh khi nhấn và không có\ncặp màu vô hiệu rõ ràng. Màu spinner và bóng xanh trong suốt của con trượt cũng không cấu hình\nđược như các phần đi cặp. CSS đi kèm lấp các khoảng thiếu có căn cứ đó, còn màu rãnh thường/\nhover vẫn nằm trong alias gốc. `opacityLoading: 1` bỏ hiệu ứng làm mờ loading/vô hiệu gốc; vai\ntrò vô hiệu không trong suốt rõ ràng vẫn khác với OFF đang bật. Loading giữ cặp checked thường\nhiện tại và spinner gốc tương phản cao, kể cả khi đặt cả prop loading lẫn disabled. Nó không\nbao giờ đoán trước hay đổi giá trị đã lưu.\n\nGiữ binding có điều khiển, callback `change` và thao tác bàn phím gốc. Nút gốc bị vô hiệu khi\nloading; kích hoạt khi đang chờ/vô hiệu không được lưu hai lần hay cập nhật trạng thái checked.\nThao tác lưu nghiệp vụ và lỗi vẫn do ứng dụng sở hữu. Kiểm tra cả hai cỡ,\ntrạng thái loading OFF/ON và vô hiệu, nhãn EN/VI, số lần gọi callback và một lần lưu có điều\nkhiển có độ trễ. Không cần bản vá `.ant-switch`, giá trị màu viết cứng hay\nSwitch tự làm ở phía bên dùng.\n\n### CSS đi kèm và class cấu trúc\n\nƯu tiên token component. CSS của gói lấp các khoảng thiếu thật của AntD4: typography ngữ nghĩa\ncho nhãn/tiêu đề, màu nền submenu viết cứng, màu thanh chọn, khoảng lệch focus bàn phím, vùng\nan toàn, vị trí Tour đáp ứng, giảm chuyển động và số đếm Badge trung tính mà không tô lại chấm\nlỗi. Selector của ứng dụng và ghi đè bảng màu không thuộc về CSS đó hay theme dashboard. Bên\ndùng chỉ giữ cơ chế bố cục và cuộn của portal thật. Các bản sửa màu và typography của framework\nthuộc về gói, không lặp lại thành ghi đè phía bên dùng.\n\nDescriptions có viền cắt nền ô bên trong khung bo gốc thay vì tô đè lên các góc trái. Card chỉ\ncó header bỏ đường phân cách header/thân thừa và giữ đủ bốn góc bo; Card có thân/ảnh bìa/thao\ntác giữ phân tách gốc. Card có viền và hoverable giữ `color.border.bold` cùng\n`elevation.shadow.raised` khi hover và focus bàn phím, thay vì viền hover trong suốt của AntD4.\nFocus cũng dùng viền ngoài/khoảng lệch chuẩn; ứng dụng vẫn sở hữu ngữ nghĩa thao tác bàn phím.\nCác bản sửa framework này tự động, không phải ghi đè theo từng trang.\n\nSearch gốc, nút addon của Input, InputGroup gọn và Space.Compact ngang dùng chung một hàng flex\nkéo giãn tự nhiên: cạnh trên/dưới của ô nhập và thao tác thẳng hàng, viền kề nhau chồng lên\nnhau một lần, góc lộ ra dùng `radius.control` và góc tiếp xúc bằng 0. Vai trò font gốc được\ngiữ. Trường/thao tác nhỏ tiếng Việt cùng lớn lên 26 px; không cắt dấu hay thu nhỏ chữ để ép\n24 px. Thao tác mặc định dùng chung viền error/warning/vô hiệu của trường; thao tác primary/\ndanger giữ vai trò ngữ nghĩa của chúng. Icon xoá giữ hộp dòng cỡ icon để không làm phình lớp\nbọc affix.\n\n`bh-ant-tag-large` trên Tag chọn nhãn lớn của nguồn (tối thiểu 24px, padding ngang 8px); mặc\nđịnh là tối thiểu 20px/6px. Cả hai lớn lên theo hộp dòng tiếng Việt thay vì cắt dấu.\n`bh-ant-tree-fill` trên Tree thật lấp đầy một host flex có giới hạn, kể cả bên dưới phần tóm\ntắt tự nhiên. Root và danh sách tạo chuỗi min-height bằng 0; chỉ holder danh sách gốc cuộn,\ngiữ đích cuộn bàn phím của nó. Không truyền chiều cao cố định hay thêm vùng cuộn bọc khác. Cây\ncó kích thước tự nhiên bỏ tuỳ chọn này. Bên dùng có điều hướng bàn phím gắn cặp gốc\n`activeKey` / `onActiveChange`: trạng thái `ref<TreeProps['activeKey']>()`, rồi\n`:active-key=\"activeKey\"` và `@active-change=\"activeKey = $event ?? undefined\"`. Đường\nactive-change không điều khiển của AntD 4.2 không giữ nút được yêu cầu; một tuỳ chọn CSS lấp\nđầy không thể cung cấp trạng thái điều hướng đó.\n\nĐể xem dữ liệu, gắn `width=\"var(--bh-ant-overlay-width)\"` và áp `bh-ant-inspection-modal`\nhoặc Drawer `rootClassName=\"bh-ant-inspection-drawer\"`. Chỉ thêm\n`bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` cho biến thể nhiều nội dung\nchỉ định rõ. Biến này chọn `layout.overlay.default` / `.wide`, và `.mobile` dưới\n`breakpoint.lg`. Hộp xác nhận ngắn và drawer điều hướng giữ chiều rộng riêng. Chế độ toàn màn\nhình là Modal `wrapClassName=\"full-screen\"` và Drawer `rootClassName=\"fullscreen\"`; Modal của\nAntD4 không có prop `rootClassName`. Chúng giữ cơ chế cuộn có giới hạn, không phải trang trí.\n\n### Kiểm tra trên framework thật\n\nThử sáng/tối × tiếng Anh/tiếng Việt với CSS thật đã import: button và input/select có kiểm tra\nhợp lệ, checkbox ở hàng bảng thường/đã chọn/đang hover, portal sắp xếp/lọc, điều hướng mở\nrộng/thu gọn/ngang và submenu, trợ giúp/lỗi form, Tooltip/Message, Modal/Drawer và chế độ xem\nmặc định/rộng/toàn màn hình ở 1023/1024px. Kiểm tra focus bàn phím, vùng chạm, giảm chuyển\nđộng, Tour hẹp và trả focus. Dùng **ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** trong control, tag\nvà hàng. Chỉ biên dịch thành công chưa chứng minh được kết quả render/tương tác đó.\n\n\n## Khoảng cách\n\nKích thước của Ant Design Vue đến từ `sizeUnit` và `sizeStep`. Giữ cả hai ở 4, để `size` là 16 px. Theme sau đó đặt từng kích thước từ một token [spacing](/vi/foundations/styles/spacing/).\n\n| Token Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` và `space.1000` không có token Ant Design Vue. Dùng biến CSS của chúng trong style của bạn.\n\nProps nhận số, như `size` của `a-space` và `gutter` của `a-row`, nhận pixel. Dùng một giá trị trong thang: `<a-space :size=\"8\">`.\n\n## Chiều cao control\n\n| Token Beehexa | Chiều cao | Token Ant Design Vue | Prop component |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | Không có |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nĐây là các chiều cao riêng của Ant Design Vue. Theme vẫn đặt từng chiều cao từ token kích thước của nó, nên thay đổi token sẽ tới được component. Xem [Size and density](/vi/foundations/styles/size-and-density/).\n\n## Breakpoint\n\n**Ghi đè các token `screen*` bằng [breakpoint](/vi/foundations/styles/layout/breakpoints/) của Beehexa.** Giá trị mặc định của Ant Design Vue khác (576, 992, 1200 và 1600 px).\n\nToken `Min` và `Max` được tính từ giá trị mặc định, không từ giá trị bạn ghi đè. Đặt cả chúng: mỗi `Max` là breakpoint kế tiếp trừ 1.\n\n| Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue có sáu breakpoint còn Beehexa có bốn, nên `sm` chuyển cùng `md`, và `xxl` cùng `xl`. Dùng các prop `xs`, `md`, `lg` và `xl` của `a-col`.\n\nKhi đó props của `a-col` và `gutter` đáp ứng của `a-row` chuyển ở đúng các độ rộng của Beehexa. Không dùng `xxxl`: media query của nó bị sai trong Ant Design Vue 4.2.6 và không bao giờ khớp.\n\n## Grid\n\nAnt Design Vue chia một hàng thành 24 phần. [Grid](/vi/foundations/styles/layout/grid/) của Beehexa có 4, 8 hoặc 12 cột, và mỗi loại chia hết cho 24.\n\n| Grid Beehexa | Cửa sổ | Span của `a-col` |\n|---|---|---|\n| 4 cột | Dưới 768 px | Span Beehexa × 6 |\n| 8 cột | 768 đến 1023 px | Span Beehexa × 3 |\n| 12 cột | Từ 1024 px | Span Beehexa × 2 |\n\n| Bố cục | Span Beehexa (4 / 8 / 12 / 12) | Props của mỗi `a-col` |\n|---|---|---|\n| Thẻ, 1 đến 4 mỗi hàng | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Khung chính | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Khung bên | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Ô tóm tắt | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nHàng của Ant Design Vue mặc định không có gutter. Đặt nó từ token khoảng cách, và đặt lề trang trên vùng nội dung.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## Khung ứng dụng\n\n| Vùng | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Điều hướng bên, mở | 280 px | `<a-layout-sider :width=\"280\">` |\n| Điều hướng bên, thu gọn | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nHeader mặc định cao 64 px và không có token cho chiều cao, nên đặt nó trong style của header.\n\nProp `breakpoint` của `a-layout-sider` dùng độ rộng cố định, bỏ qua các token `screen*`. Không dùng nó. Đặt `collapsed` từ media query của bạn và lựa chọn của người dùng: mở từ 1024 px, thu gọn thành thanh hẹp khi người dùng yêu cầu, và ghi nhớ lựa chọn. Dưới 1024 px, ẩn sider và hiện menu trong `a-drawer`.\n\nXem [Layout](/vi/foundations/styles/layout/) cho khung.\n\n## Hàng bảng tương tác\n\nChỉ gắn `data-bh-interactive=\"true\"` qua `customRow` khi toàn bộ hàng đã có handler kích hoạt.\nCSS đi kèm của nguồn sở hữu con trỏ dạng tay; phím/class chọn gốc giữ công thức chọn của\nchúng. Giữ thao tác hàng có trợ năng, hành vi bàn phím và việc kích hoạt bản ghi thật thay vì\nthay trạng thái chọn bằng viền ngoài tự làm.\n\n\n## Ghép component gốc và biến thể tuỳ chọn\n\nDùng component gốc thật. Các tuỳ chọn này không cho phép thay bằng div, lớp bọc chỉ đổi giao\ndiện, hay chép hình học Card/Button vào ứng dụng.\n\n- Prop `hoverable` của Card gốc vẫn là tuỳ chọn. `data-bh-selected=\"true\"` thêm nền đã chọn\n và tín hiệu viền trong độc lập; bỏ nó sẽ trở về dạng gốc.\n- Dùng lại `bh-data-accent` với `data-bh-status`, `data-bh-band`, `data-bh-metric`,\n `data-bh-job-type` hoặc `data-bh-priority` ngữ nghĩa sẵn có cho cạnh đầu tuỳ chọn trên một\n Card thật. Nó không thêm hành vi chọn hay hover. Cạnh trạng thái/nhóm loại vẫn giữ khi chọn;\n focus bàn phím vẫn là viền ngoài riêng. Gắn thuộc tính phân biệt phù hợp với dấu đó thay vì\n gộp trạng thái với danh tính nhóm loại. Nhãn vẫn bắt buộc.\n- `data-bh-layout=\"content\"` trên Button thật cho phép nhãn ghép nhiều dòng: chiều cao tự động,\n xuống dòng bình thường, căn đầu và chiều cao tối thiểu của control mặc định theo nguồn.\n Props, padding và kích hoạt bàn phím vẫn là gốc. Dùng prop size/block thông thường của Button\n khi đủ.\n- `bh-ant-shell-region` bỏ padding gốc của Header/Footer chỉ khi vùng đó đã chứa header/footer\n ứng dụng được ghép. Nó không đổi chiều cao, màu gốc hay bố cục vùng trang đáp ứng xung quanh.\n- `bh-card-link` trên anchor điều hướng thật bọc Card bỏ màu/gạch chân link cạnh tranh và cung\n cấp focus bàn phím theo nguồn, không phải giao diện Card.\n\nComponent nghiệp vụ có thể sở hữu dữ liệu, trạng thái, hành vi và cách ghép có ý nghĩa của các\nkhối cơ bản này. Liệt kê và bỏ các component thay thế thừa cùng mọi nơi gọi/import/export đã\nlỗi thời. Nội dung phong phú được sinh ra phải gắn control nâng cao gốc thật khi framework chứa\ncho phép; riêng một stylesheet từ phía cung cấp không phải bằng chứng thiếu năng lực gốc.\n\n\n### Nội dung gốc vận hành và được ghép\n\n`Steps[data-bh-operational=\"true\"]` dùng success/info/danger/subtle cho các trạng thái gốc\nfinish/process/error/wait. Nó giữ nguyên Steps điều hướng theo nhóm loại. `data-bh-skipped=\"true\"`\ntrên một Step thật thêm đuôi nét đứt ở cả hai hướng; bên gọi giữ thứ tự và nghĩa của quan hệ.\nSlot icon tuỳ chỉnh không cần dựng lại khối Steps cơ bản.\n\n`Result[data-bh-layout=\"step\"]` giữ hàng header icon và tiêu đề của báo cáo được ghép, với\nphụ đề/nội dung và extra/thao tác bên dưới rộng hết cỡ. Nó chỉ đổi bố cục/padding gốc; màu\ntrạng thái và slot gốc vẫn là gốc.\n\n`data-bh-highlighted=\"true\"` trên tiêu đề Tree gốc là tín hiệu định vị tạm thời, không phải\nkey đã chọn hay focus bàn phím. Treenode gốc đã chọn/vô hiệu sẽ ẩn nó; viền ngoài của nguồn\nkhông đổi hình học tiêu đề.\n\nDùng `bh-partner-logo-image` trên Image thật cho tài sản connector/thương hiệu. Chỉ gắn chiều\ncao ảnh đối tác của nguồn và `width=\"auto\"`; Image gốc cùng adapter giữ tỉ lệ khung hình tự\nnhiên mà không có khung vuông hay cắt. Avatar định danh thật vẫn là gốc. Không dùng sắc màu\nthương hiệu làm trạng thái vận hành.\n\n### Xem trước Image gốc\n\nToken chính thức `zIndexPopupBase` và `zIndexPopup` của Image dùng dải toàn màn hình. Chỉ vậy\nchưa đủ vượt lên trên phần tử sở hữu lồng bên trên nó: Preview của AntD 4.2.6 bỏ cả `zIndex`\nkhai báo cho Dialog lẫn `wrapProps`. Composable setup `useNativeImagePreviewContainer(labelGetter)`\ntừ `@beehexa/ant-design-vue-tokens/image` sở hữu portal body lazy chính thức: truyền getter của\nnó vào `preview.getContainer` gốc. Nó đặt tên cho hộp thoại gốc thật, phản ứng khi đổi ngôn\nngữ và lấy một lớp nằm trên các phần tử sở hữu hiện hành ở mỗi lần mở, không tính lớp trước\nđó của chính nó. Portal đã đóng không phải phần tử sở hữu overlay. Observer/container của nó\nđược giải phóng khi gỡ. Image gốc vẫn sở hữu zoom/pan, đóng bằng bàn phím và trả focus; không\ncó trình xem tự làm.\n\n\n`bh-ant-card-flush` cho thân Card thật bỏ lề trong chỉ khi chứa editor, canvas hay ô ghép nhúng\nsát mép. Card thông thường giữ padding gốc. Dùng lại `bh-ant-fill-card` và `bh-ant-fill-spin`\ncho host flex có giới hạn sẵn có; không tạo alias lấp đầy song song hay khôi phục selector\nriêng phía bên dùng. Card flush cắt màu nhúng theo khung bo gốc của nó. iframe trình duyệt là\ncon trực tiếp được bỏ viền mặc định của trình duyệt để tránh khung thứ hai; hành vi\nsandbox/srcdoc và tài liệu nhúng vẫn do trình duyệt sở hữu.\n\n`semanticTableComponents` từ `@beehexa/ant-design-vue-tokens/table` mở rộng API `components`\ncông khai của Table thật. `customCell` của một cột có thể trả về `{ scope: 'row' }`; ô thân của\nnó trở thành `th` ngữ nghĩa, chuyển tiếp thuộc tính và slot gốc. Các ô khác vẫn là `td`. AntD4\nkhông có prop cột cho row scope và CSS ô thân của nó chỉ nhắm `td`, nên CSS đi kèm của nguồn\ncung cấp công thức kích thước/viền/hover/chọn cho tiêu đề hàng tương ứng, lấp khoảng thiếu\nngữ nghĩa HTML thật này. Cột, hàng và Summary gốc vẫn là gốc.\n\nMột ListItem gốc thật có thể bật `data-bh-interactive=\"true\"` cho hàng kích hoạt phong phú khi\nkhông có control gốc hẹp hơn nào đáp ứng quy ước nội dung của nó. Tuỳ chọn chỉ cung cấp hover/\ncon trỏ/focus; bên dùng cung cấp thao tác thật, kích hoạt bằng bàn phím và role có trợ năng.\nKhông lồng các đích tương tác cạnh tranh.\n\n\nThương hiệu connector và đối tác dùng chung `content.partner-logo.image-size` làm chiều cao\nhiển thị, không phải giới hạn chiều rộng. Giữ chiều rộng tự nhiên; cho hàng xuống dòng khi cần.\nVai trò chiều cao icon ngữ nghĩa cũng giữ chiều rộng theo tỉ lệ và vùng bấm. Table gốc đã tạo\nstyle hình học `tfoot > tr > th` ở mỗi cỡ; CSS đi kèm chỉ thêm viền tiêu đề hàng của Summary\ncòn thiếu và độ đậm/căn lề ngữ nghĩa. `a-typography-link[data-bh-target=\"responsive\"]` dùng\nvùng bấm tối thiểu 24px của nguồn, tăng lên 44px chỉ với con trỏ thô; nó không thêm giao diện\nlink.\n\n\nCard flush cắt màu nhúng theo khung bo thật của nó. Footer Drawer gốc giữ lề chuẩn hoặc lề vùng\nan toàn của thiết bị, lấy giá trị lớn hơn. `Spin[data-bh-mode=\"nonblocking\"]` bỏ lớp phủ/chặn\ncon trỏ gốc chỉ cho nội dung tải dần vẫn xem được; bỏ nó cho việc thật sự chặn như xuất dữ\nliệu. Điều này không đổi thời gian spinner hay dữ liệu đồ thị.\n\n\n## Progress gốc phân đoạn chỉ đọc\n\nVới phản hồi “Bước 3/7”, dùng `Progress` gốc thật với `steps` và `percent` thật. Đây không phải\nđiều hướng: không thay bằng `Steps`, `Segmented`, một hàng dấu tự dựng hay bộ máy tiến độ khác.\n\n`size=\"small\"` của AntD4 cố ý vẽ mỗi bước thành **mảnh dọc 2 × 8px**. Bộ `[width, height]` gốc\ncủa nó là hình học **của từng đoạn**. Helper của nguồn phân giải\n`content.step-progress.segment-width` và `segment-height` thành 16 × 4px ở root 16 và 20 × 5px\nở root 20. Gắn nó theo kiểu phản ứng:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Bước {{ props.index }}/{{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nTính năng sở hữu tổng số dương thật, chỉ số hiện tại, chữ trạng thái và các chuyển tiếp nghiệp\nvụ. Helper chỉ cung cấp hình học; Progress gốc sở hữu số đoạn đã render và các dấu đang hoạt\nđộng. Chỉ ẩn thanh thừa khỏi công nghệ hỗ trợ khi chữ bên cạnh đã truyền đạt cùng tiến độ.\n\n`bh-ant-step-progress` cho root gốc đó dùng chiều rộng inline tự nhiên, bỏ margin ngoài gốc,\ndùng `content.step-progress.gap` của nguồn (4px ở root 16) và xuống dòng mà không có margin ở\nmục cuối. CSS không thay API size gốc hay đặt chiều rộng/chiều cao cho từng dấu. Thanh nằm theo\nsau trạng thái trên hàng rộng và xuống dòng trong chiều rộng khả dụng trên mobile.\n\nBỏ class và helper để giữ dạng gốc. Progress phần trăm, tải lên và đếm ngược thông thường không\nbật tuỳ chọn này. Ma trận trực tiếp dùng chung bên dưới gồm một bản so sánh gốc thật không bật\ntuỳ chọn, tổng số chỉnh được và control đầu/giữa/cuối; kiểm tra cả root 16 và root 20, sáng/tối\nvà độ rộng hẹp.\n\n## Progress mảnh khi chuyển trang\n\nĐể báo đang tải trang, dùng `Progress` gốc thật với `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` và bộ kích thước gốc của nó.\nDùng `border.width.focused` cho độ dày đường và `color.brand.yellow` cho màu nét thương hiệu\n(tuỳ chọn). Ứng dụng tự định vị cố định ở `top: 0`, chiều rộng và lớp trong bảy token\n[z-index](/vi/foundations/styles/z-index/); adapter bỏ khoảng baseline inline và margin ngoài của\nAntD, để nét thật bắt đầu đúng ở mép trên được cấp mà không cần dịch âm.\n\nProgress thể hiện các mốc điều hướng đã xong, không phải phần trăm mạng tự đặt. Giữ trang cũ\ntrong lúc guard và chunk của route đang tải, tiến tới 100%, và chờ hiệu ứng chuyển chiều rộng gốc\nkết thúc rồi mới chuyển sang trang mới. Huỷ, lỗi và điều hướng mới hơn phải tự xoá tiến độ của\nchính nó mà không xoá yêu cầu mới hơn. Hiệu ứng chuyển chiều rộng dùng `motion.duration.default`\nvà `motion.easing.linear`; chế độ giảm chuyển động bỏ hiệu ứng này. Giữ một progressbar có tên\nvới giá trị mốc thật, và không bao giờ phủ cả trang chỉ để tải một route.\n\n## Một họ control gốc, các vai trò riêng biệt\n\nDùng Button default gốc cho trigger tiện ích gọn có viền (kể cả ngôn ngữ và theme), cùng cỡ gốc\nvới các control trang bên cạnh. Dùng slot `#icon` công khai và một phần tử con là nhãn; Button\nchỉ có icon vẫn cần tên truy cập. Không nguỵ trang `type=\"text\"` toàn cục thành Button default.\nMenu tài khoản/avatar không khung dùng `type=\"text\"` hợp lệ, một Avatar thật và Space gốc: căn\ngiữa nó trong hàng thay vì tự chế giao diện khung.\n\nButton small/default/large dùng chiều cao control của nguồn 24/32/40px ở root danh nghĩa;\ntypography là label-small cho cỡ small và label-default cho các cỡ khác. Button/Input/Select và\nmục điều hướng bên dùng `radius.control`; popup của Select và menu dùng `radius.overlay`.\nObserver root/theme dạng số và CSS rem co giãn cùng nhau. AntD4 chỉ chèn margin cho phần tử anh\nem `.anticon`, không cho SVG Lucide trong `#icon`; nguồn cung cấp một khoảng flex space100 cho\nmọi Button thật và bỏ margin gốc/icon loading cạnh tranh. Không cần class riêng cho khung ứng\ndụng. Default/primary/text/link, vô hiệu/loading, hover/nhấn và focus bàn phím gốc vẫn tách\nbiệt. `data-bh-target=\"responsive\"` thêm kích thước chạm tối thiểu chỉ với con trỏ thô. Trạng\nthái mở của Dropdown/Menu không phải trạng thái chọn của Button; giữ `aria-expanded`, hành vi\nbàn phím của menu và trả focus trong tính năng thật.\n\nCặp primary trung tính đậm/đảo là có chủ ý: graphite ở chế độ sáng, graphite nhạt với chữ tối ở\nchế độ tối. Thao tác Tiếp tục nhạt màu ở chế độ tối không phải lý do tô lại mọi Button primary\nhay text thành màu xanh. Thao tác link giữ bảng màu link của nguồn; thao tác tiện ích default vẫn\ncó viền.\n\n| Biến thể gốc | Vai trò nguồn và quy ước trạng thái |\n| --- | --- |\n| Default / dashed | Surface, chữ và viền; nền trung tính nhạt khi hover/nhấn. Dashed giữ viền nét đứt gốc. |\n| Primary | Cặp trung tính đậm/đảo cùng vai trò hover/nhấn đậm riêng. |\n| Danger primary | Cặp danger đậm/chữ trên nền đậm, kể cả hover/nhấn. |\n| Danger default / dashed / text / ghost | Chữ danger đọc được; biến thể có viền giữ viền danger. Biến thể không phải link dùng nền danger nhạt khi hover/nhấn. Ghost bắt đầu trong suốt, không bao giờ với nhãn đặc trên nền đậm. |\n| Link / text | Vai trò link/không khung riêng, không phải Button default nguỵ trang. |\n| Ghost | Biến thể có viền trong suốt gốc với màu chữ hợp vai trò và ngữ cảnh chứa; không phải primary đặc. |\n| Vô hiệu / loading | Hành vi chặn và alias vô hiệu gốc là chuẩn, kể cả Button dạng anchor bị vô hiệu. Loading không làm mờ một cặp màu nguồn vốn đọc được. |\n\nAntD4 vẽ **bóng dưới khi nghỉ** từ `controlOutline` cho primary, `controlTmpOutline` cho default\nvà `colorErrorOutline` cho danger-primary. Các tên này không chỉ là đầu vào cho focus bàn phím.\nDùng lại alias focus xanh toàn cục ở đó tạo ra một vệt xanh lạc lõng kể cả khi mọi animation đã\nxong. Nguồn đặt ba alias component Button này thành trong suốt; nó không xoá vai trò focus toàn\ncục hay đặt độ dày của nó bằng 0.\n\nFocus bàn phím của Button gốc thay vào đó đọc `colorPrimaryBorder` và `lineWidthBold`. Ghi đè\ncomponent của nó dùng màu/độ dày focus của nguồn. Quy tắc `:focus-visible` khi bật của CSS đi\nkèm cung cấp viền ngoài/khoảng lệch độc lập, có khe hở theo nguồn. Nền trạng thái default/dashed\nvà các cặp chữ danger/chữ trên nền đậm riêng là những khoảng thiếu token gốc còn lại; CSS nguồn\nchỉ xử lý các trường hợp đó, trừ control vô hiệu và trạng thái chọn thật. Ứng dụng không được\nthêm reset bóng/viền cục bộ hay chặn focus.\n\n### Ma trận trực tiếp trạng thái gốc và tiến độ\n\nDùng control theme/ngôn ngữ của site và tuỳ chọn cỡ chữ root của trình duyệt. Đổi cỡ Button,\nhover/giữ nhấn, Tab/Enter/Space qua các thao tác khả dụng, và xem số lần kích hoạt thật. Button\nloading/vô hiệu và anchor gốc vô hiệu không được kích hoạt. Progress dùng cùng số đếm/chỉ số\nthật cho bản bật và không bật tuỳ chọn.\n\n<NativeControlsDemo />\n\n\n### Ghép gốc trên mobile và nội dung có giới hạn\n\nAdapter kéo giãn các trường Input/Search/nhóm gọn ghép nối và thao tác của chúng thành một hàng,\nkể cả trạng thái kiểm tra hợp lệ, vô hiệu và vùng bấm cho con trỏ thô. Button chỉ có icon giữ tỉ\nlệ kích thước gốc; với con trỏ thô cả hai chiều đạt `size.target.touch`. Button bố cục theo nội\ndung giữ chữ nhiều dòng mà không ghi đè kích thước chạm tối thiểu chỉ định rõ hay đáp ứng.\n\nDưới `breakpoint.md`, mọi tiêu đề header/meta của Card gốc đều xuống dòng, kể cả ellipsis của\nTypography con, Tag và Space. Đây là nội dung dễ đọc toàn cục, không phải ghi đè tuỳ chọn của\nbên dùng. Extra của header vẫn dùng được. Chấm, đuôi và chấm tuỳ chỉnh của Timeline chuẩn căn\ntheo dòng nội dung đầu tiên; nội dung sự kiện xuống dòng vẫn nằm trong cột timeline gốc. Timeline\ndạng label/alternate/right giữ cách căn gốc riêng.\n\nFlex của AntD4 không chuyển tiếp `role`, `aria-*`, `data-*` hay listener DOM tuỳ ý. Không đặt\nngữ nghĩa bắt buộc, tuỳ chọn nguồn hay handler bàn phím trên nó. Dùng Space/Typography gốc khi\nphù hợp, hoặc giữ một host ngữ nghĩa thật với CSS flex/grid cấu trúc tối thiểu. Không thêm lớp\nbọc chuyển tiếp.\n\nDùng `bh-content-toolbar` và `bh-content-toolbar__group` trên host thanh công cụ thật; nguồn sở\nhữu khoảng cách, padding, xuống dòng và kích thước tối thiểu control trên mobile. Các công thức\nnày áp cho control editor/sơ đồ/đồ thị, không phải giao diện riêng của trang. Giữ host và các\nphần tử con flex co được bằng `min-width: 0`.\n\nGắn `bh-ant-fill-spin` qua **wrapperClassName** của Spin, không qua class: lớp bọc nested-loading\nmang chiều cao có giới hạn. Chế độ fill/flush của Drawer đi qua chuỗi content-wrapper/content/\nwrapper-body gốc; header/footer giữ kích thước tự nhiên và thân sở hữu phần không gian còn lại.\nTabs chỉ lấp pane đang mở của chính nó. Bên dùng cung cấp phần tử cha có giới hạn thật, không\nđoán chiều cao viewport trừ header. Monaco/Mermaid theo dõi kích thước host đó mà không thay\nmodel editor hay đặt lại pan/zoom biểu đồ hiện có.\n",
|
|
4338
|
+
"body": "import NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` sở hữu adapter Ant Design Vue 4 dùng lại được. Dùng API\nESM có kiểu và CSS đi kèm của nó, dựa trên `@beehexa/design-tokens`. Framework là peer:\n`ant-design-vue@^4.2.6` và `vue@^3.3.0`; không gói nào được đóng kèm. Gói `0.0.0` chưa phát\nhành dùng tham chiếu phát triển cục bộ rõ ràng; chỉ quy trình phát hành được duyệt mới gắn\nversion thật. Không chép bảng màu theme vào ứng dụng.\n\n**Token Beehexa là nguồn chân lý. Ant Design Vue chỉ đọc chúng.**\n\nTrang này là nơi duy nhất foundations của Beehexa gặp Ant Design Vue. Các trang foundations giữ nguyên dù sản phẩm được xây bằng gì.\n\n## Cách dùng\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})` trả về\n`ThemeConfig` gốc. Tính lại khi theme/ngôn ngữ/cỡ chữ root đổi; mỗi lần gọi trả về một object\nmới. `locale` chọn typography gốc, không chọn thông điệp. Observer gốc chỉ dùng trong setup đo\nmột phần tử thử 1rem không tương tác rồi dọn nó đi. Nhờ đó các API kích thước/chữ/radius dạng\nsố gốc khớp với đơn vị CSS co giãn; viền và breakpoint tính bằng pixel không co giãn. Factory\nthuần không đọc DOM. Truyền gói ngôn ngữ AntD phù hợp qua `ConfigProvider.locale`, và cấu hình\nthư viện ngày riêng. Render các holder gốc `useMessage`, `useNotification` và `useModal` trong\nmột host phản hồi bên trong provider root duy nhất. Gắn facade thông báo của ứng dụng vào các\nAPI hook đó; không bao giờ dùng API phản hồi tĩnh thô tách rời. Factory đặt `hashed: false`\nvì nếu không, holder message/notification theo ngữ cảnh của AntD4 sẽ giữ hash cũ khi đổi\ntheme/ngôn ngữ. Giữ một thông báo đang mở khi chuyển từ tối/tiếng Việt sang sáng/tiếng Anh;\nchữ và màu của nó phải theo theme đang dùng.\n\nGiữ `data-theme` và `lang` của document đồng bộ cho overlay được teleport. Import CSS đi kèm\nsau style của ứng dụng/framework. Dùng root gốc 16px và chữ thân 14px; API dạng số phân giải\nrem của nguồn ở 16px. Entry pixel không phải đường dùng cho dashboard.\n\n## Quyền sở hữu overlay và nội dung gốc có giới hạn\n\nPopup được kích hoạt dùng `getAntDesignVuePopupContainer` để nằm trong Modal/Drawer gốc gần\nnhất hoặc host `data-bh-overlay-owner` tuỳ chỉnh. Root của Modal/Drawer gốc vẫn gắn vào body\nđể có hình học theo viewport. Facade modal gắn với provider mặc định đặt `zIndex` lúc gọi qua\n`getAntDesignVueModalZIndex()` nhưng vẫn giữ giá trị bên gọi chỉ định rõ; nhờ vậy hộp xác\nnhận bằng bàn phím/có await nằm trên phần tử sở hữu hiện hành. Drawer lồng nhau dùng\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` làm `rootStyle.zIndex` để bề mặt và\nmask di chuyển cùng nhau; prop `zIndex` của AntD4 chỉ tạo style cho lớp bọc nội dung.\nEditor/ảnh toàn màn hình teleport vào body và Modal gốc toàn màn hình lấy\n`getAntDesignVueFullscreenZIndex()` trước khi gắn root. Hàm này dùng `z-index.modal`\nvới thứ tự nằm trên phần tử sở hữu, không tạo tầng toàn màn hình riêng. Chỉ đánh dấu\nroot tuỳ chỉnh khi chúng đang hoạt động, tránh tự đếm chính mình. Bảy tầng được duyệt\nkhông có token fullscreen450 hay readiness650; trạng thái chờ chặn thao tác cũng dùng\n`z-index.modal`. Giữ thứ tự tương đối theo phần tử sở hữu dưới `z-index.tooltip` và\n`z-index.toast`; dành `z-index.spotlight` cho hướng dẫn Tour. Mặc định inline gốc của\nTour cũng cần prop `zIndex` công khai gắn với `z-index.spotlight`.\n\nKhung Modal và lớp bọc nội dung Drawer cố ý kế thừa `pointer-events: none`; nội dung gốc chỉ\nkhôi phục khả năng nhận con trỏ cho cây con của chính nó. CSS đi kèm cũng khôi phục\n`pointer-events: auto` trên các root popup gốc thật được portal vào một trong hai khung đó\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover và Tour). Khung\nvẫn trong suốt với con trỏ ở ngoài nội dung và popup; mask, việc giữ focus và cách đóng gốc giữ\nnguyên. Không dời popup vào body đang cuộn, đổi z-index hay thêm ghi đè cho trang để xử lý\nkhoảng hở con trỏ kế thừa này.\n\nCSS đi kèm cung cấp các quy ước cấu trúc gốc tuỳ chọn, không phải selector của ứng dụng:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: thân có giới hạn, header/footer kích thước\n tự nhiên, tuỳ chọn bỏ padding thân; gắn qua `rootClassName`. Giữ overflow tự động mặc định\n của thân gốc thay vì chặn truy cập khi control tự nhiên hoặc mức tối thiểu của ô được giữ\n vượt phần cấp ngắn. Không lặp style flex/overflow của thân ở phía bên dùng.\n- `bh-ant-fill-modal`: gắn qua `wrapClassName` gốc, không phải `rootClassName` mà Modal không\n hỗ trợ. Overlay cố định thật cấp một hộp thoại có giới hạn, cách mép theo token; lớp bọc nội\n dung/focus và thân của nó lấp đầy quanh header/footer tự nhiên. Chiều rộng vẫn là chiều rộng\n gốc của bên gọi, giới hạn trong overlay khả dụng. Dùng cho việc xem trình hiển thị tương tác,\n không cho hộp xác nhận ngắn. Chỉ viewport của trình hiển thị sở hữu phần tràn khi nhỏ hơn\n mức tối thiểu; không trừ chiều cao khung đoán chừng.\n- `bh-ant-fill-tabs`: lớp bọc gốc và pane đang mở có giới hạn. Tabs lồng nhau bật riêng;\n `bh-ant-fill-tabs--scroll` bật cuộn trong pane và `bh-ant-tabs-mobile-inset` thêm lề mobile\n của nguồn. Pane không hoạt động vẫn ẩn.\n Tabs bên trong tài liệu đang cuộn đó có thể thay bằng `bh-ant-fill-tabs--document`: lớp bọc\n giữ chiều cao nội dung tự nhiên và lớn lên khi đủ chỗ, không cắt trình hiển thị sau khi\n metadata dài chiếm hết phần cấp. Pane cuộn gốc bên ngoài sở hữu truy cập theo chiều dọc;\n không đặt cả hai modifier trên cùng một root. Chỉ host trình hiển thị tương tác nhận\n `--bh-layout-renderer-minimum-block-size`, không phải pane bên ngoài hay trường tĩnh.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: đưa một host có giới hạn sẵn có đi qua các lớp bọc\n gốc. Nội dung tài liệu/cây/danh sách tĩnh có thể giữ không co và hiện phần tràn bên trong\n phần tử cuộn sẵn có của Card gốc. Không ghép vùng cuộn Card đó với vùng cuộn bên trong thứ\n hai cao 0 khi header của nó chiếm hết một pane nhỏ. Cách ghép tài liệu này không thêm mức\n tối thiểu dễ đọc của SDK cho trường thông thường.\n- `bh-ant-fit-empty`: chỉ trên Empty gốc thật bên trong một phần giữ chỗ đã được cấp. Chỉ chọn\n hình minh hoạ gốc không đảm bảo vừa trong host thấp. Tuỳ chọn này bỏ margin đoạn văn bên\n ngoài và của mô tả (cha sở hữu lề), giới hạn root và cho hàng ảnh co lại trước mô tả/footer\n tự nhiên. Ảnh giữ chiều cao ưu tiên gốc và bỏ khoảng baseline inline; cả hình phóng to lẫn\n margin đoạn văn đều không chiếm host nhỏ. Nó không thêm mức tối thiểu cho trình hiển thị,\n bảng màu, typography chữ, thay ảnh hay chặn tràn. Giữ đúng một phần tử cuộn thật của cha khi\n ngay cả chữ/thao tác tự nhiên cũng không vừa. Empty thông thường của tài liệu/danh sách/bảng\n bỏ qua nó và giữ mặc định gốc. Bộ component gốc trực tiếp bên dưới so sánh phần cấp\n 2/4/12rem, hình minh hoạ đơn giản và dạng gốc không bật tuỳ chọn.\n- `AntDesignVuePopupScope`: chỉ cho trình hiển thị được giữ di chuyển giữa các phần tử sở hữu\n overlay gốc. Bọc cây con sẵn có bên ngoài Teleport của nó và truyền root HTMLElement sẵn có\n làm `owner`; giữ thuộc tính owner trên root thật đó. Giữ một phần tử thật làm root của\n component dùng khi bên gọi dùng `v-show` hay directive phần tử khác; đặt scope bên trong root\n sẵn có đó, không thay chỗ nó. Holder popup gốc ổn định di chuyển cùng owner vì AntD4 cache\n container portal đầu tiên. Scope lồng nhau kế thừa đích bao ngoài. Theme/ngôn ngữ của\n ConfigProvider gốc, menu, focus và portal body không có trigger vẫn là gốc; không có rekey\n editor/model/đồ thị hay z-index popup toàn cục nào liên quan. Tuỳ chọn `feedback` (mặc định\n `false`) đưa container không có trigger về host scope đã mount, để holder\n `notification.useNotification()` / `message.useMessage()` bên trong scope theo owner overlay\n vào phần tử toàn màn hình gốc. Handler capture toàn màn hình\n nhường Escape cho menu/listbox qua `isAntDesignVueMenuEvent(event)` trước khi đóng overlay\n của chính nó. Portal Drawer gốc có thể dùng cùng host ổn định qua scoped slot công khai:\n `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` với\n `<a-drawer :get-container=\"getContainer\">`. Thuộc tính HTML trên scope thuộc về host portal\n thật đó; chỉ hiện `role=\"dialog\"`, `aria-label` và `aria-modal` có điều kiện khi đang mở,\n nếu Drawer gốc bỏ các thuộc tính này. Không thêm lớp bọc hộp thoại thứ hai hay sửa DOM gốc.\n Flex của AntD4 cũng bỏ các thuộc tính khác class/style: dùng một phần tử ngữ nghĩa thật sẵn\n có khi ID được điều khiển, tên vùng hay điểm dừng Tab phải được giữ.\n- Lựa chọn có thể chọn và mở rộng độc lập ghép slot tiêu đề Card thật với Button mở rộng và\n Button chọn gốc anh em cùng một Tag phím tắt. Giữ header Card không tương tác; mỗi Button chỉ\n sở hữu thao tác của nó. Header Collapse của AntD4 giữ `role=\"button\"`/điểm dừng Tab ở phần\n tử cha kể cả ở chế độ chỉ icon, nên không lồng lựa chọn có thao tác độc lập vào đó. Slot thân\n Card có điều kiện gốc sở hữu nội dung mở rộng; không cần vá role/bàn phím header riêng hay\n CSS thu gọn lựa chọn đặc biệt.\n- `bh-ant-inspection-descriptions`: chiều rộng nhãn tối thiểu trên desktop và hàng xếp chồng\n trên mobile theo nguồn.\n- `bh-ant-data-table`: class hàng pending/success/error chung cùng dấu `customCell` công khai\n `data-bh-cell-interaction=\"editable|readonly\"` và `data-bh-cell-state=\"changed\"`. Trạng\n thái chọn gốc được ưu tiên hơn màu hàng vận hành; ô đã đổi giữ màu diff khi hover.\n `bh-ant-table-nowrap` là tuỳ chọn độc lập cho nội dung ngang.\n Thêm `bh-ant-row-indicators` để có dấu danger lề trong `border.width.accent` ở ô đầu tiên\n của hàng `bh-ant-row-error`. Tín hiệu vấn đề không dựa vào màu này không đổi hình học cột,\n không ghi đè trạng thái chọn và không thay chữ/icon trạng thái.\n- `data-bh-tone=\"warning\"` trên root Badge gốc chọn `color.background.warning.bold` /\n `color.text.on-bold` chỉ cho số đếm. Chấm trạng thái vận hành gốc giữ ngữ nghĩa và hình\n tròn riêng của nguồn.\n- `data-bh-target=\"touch\"` trên Button gốc chọn `size.target.touch` làm chiều rộng/cao tối\n thiểu mà không tô lại nó. `data-bh-target=\"responsive\"` chỉ áp vùng bấm đó cho con trỏ thô.\n Giữ ngữ nghĩa type, size, disabled và bàn phím gốc; không cần trang tự định kích thước vùng\n bấm.\n- Root đã quan sát cũng có thể truyền vào `tokenPixels(name, locale, rootFontSize)` cho props\n dạng số thật của Avatar/Image thay cho CSS rem co giãn. Setup của phần tử con dùng lại số đo\n chỉ đọc của provider duy nhất, không tạo observer khác.\n\nGiữ dữ liệu nghiệp vụ tuỳ chỉnh/nghĩa của slot và cấu trúc host ở phía bên dùng, không giữ\ncông thức trình bày. Không tạo lại selector gốc bằng `:deep(.ant-*)` theo từng trang, ghi\nđè toàn cục hay tăng độ ưu tiên.\n\n## Ánh xạ token\n\n| Token Ant Design | Token Beehexa |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nDùng [radius theo vai trò](/vi/foundations/styles/radius/), không dùng một radius cho mọi\ncomponent:\n\n| Component | Token radius |\n| --- | --- |\n| Button, Input, ô chọn của Select, Radio button, Segmented, mục điều hướng bên | `radius.control` (6 px) |\n| Control 24 px | `radius.control.small` (4 px) |\n| Mục trong dropdown hoặc popup submenu | `radius.item` (4 px) |\n| Tooltip, tag, số đếm của badge | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs và các khung trong trang khác | `radius.card` (8 px) |\n| Dropdown, popup submenu, popup của Select, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (tròn), Switch, chip | `radius.pill` |\n| Bảng rộng hết cỡ, cạnh ghép của Search, bề mặt toàn màn hình | `radius.0` |\n\nNhóm có padding 4 px dùng góc ngoài 8 px; nhóm có padding 8 px dùng góc ngoài 12 px. Adapter\ncố định các alias component này và CSS đi kèm xử lý các trường hợp badge, Switch, Segmented và\nDrawer không có đầu vào theme. Bên dùng phải bỏ các ghi đè góc cạnh tranh, không thêm bản vá\nradius `.ant-*`. Props Button `shape=\"circle\"` / `shape=\"round\"` chỉ định rõ giữ kích thước\ngốc và góc `radius.control`. Chúng không phải vai trò avatar, Switch hay chip.\n\nAdapter cũng cố định các vai trò ngữ nghĩa hover/nhấn/vô hiệu/link/trạng thái/chọn/focus\nthay vì để bảng màu xanh do framework sinh lọt qua. Input, select, checkbox và radio dùng\n`color.border.bold`, còn card/bảng dùng `color.border`. Header và sider của Layout nằm trên\n`color.surface.page`, tách khỏi nội dung bằng một đường `color.border`; drawer điều hướng\ntrên mobile là drawer trên `color.surface.overlay`. Không có bảng màu khung riêng hay theme\nlồng cô lập. Dùng `font.body.default` cho dữ liệu bảng, `font.label.small` cho tiêu đề/tag,\n`font.heading.medium` cho tiêu đề modal và `font.heading.small` cho tiêu đề drawer.\n\nIcon Menu gốc giữ ô icon của nguồn và khoảng cách tới tiêu đề `space.050`. Chữ tiêu đề dùng\n`font.label.default` thay vì hộp dòng theo chiều cao hàng, giữ nhãn tiếng Việt và nội dung\ntiêu đề/tag bên cạnh do bên dùng sở hữu thẳng hàng theo chiều dọc.\n\n### Quy ước component Ant Design Vue 4\n\n- Table đọc `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` và\n `controlItemBgActiveHover`. Tên AntD5 như `headerBg` và `headerColor` bị AntD Vue 4.2.6 bỏ\n qua và không được dùng.\n- Switch đọc rãnh OFF từ `colorTextQuaternary`/`colorTextTertiary`, rãnh ON từ\n `colorPrimary`/`colorPrimaryHover`, con trượt dùng chung từ `colorWhite`, **cả hai** nhãn\n từ `colorTextLightSolid`, và độ mờ vô hiệu/loading từ `opacityLoading`. Đây là ánh xạ theo\n phạm vi component, không đổi màu primary/chữ toàn cục. Tên kiểu AntD5 như\n `trackBg`/`handleBg` không phải API trạng thái của AntD4.\n- Menu đọc `colorItem*`, `radiusItem`, `radiusSubMenuItem` và `colorActiveBar*`. Menu\n `theme=\"dark\"` chỉ định rõ nhận cùng vai trò nguồn. Trạng thái chọn có thanh hiển thị,\n không phải nhãn đậm hơn làm xê dịch phần tử bên cạnh hay chỉ đổi màu nền.\n- Control form dùng chung vai trò viền ngoài/focus/vô hiệu của nguồn. Kiểm tra hợp lệ giữ\n chữ/icon danger/warning và ngữ nghĩa trạng thái gốc. Không thay viền ô nhập có ý nghĩa bằng\n đường kẻ phân cách mảnh.\n- Preset trạng thái của Tag là `success`, `processing`, `warning`, `error`; mặc định là trung\n tính. Chúng dùng cặp màu chữ và viền ngoài của nguồn. Preset sắc màu tuỳ ý không phải tên\n trạng thái. Số đếm Badge là trung tính; chấm trạng thái error/processing giữ ngữ nghĩa của\n chúng.\n- Tooltip và Message dùng cặp bề mặt/chữ đảo (inverse). Nội dung Modal/Drawer dùng surface,\n scrim và độ nổi overlay. Progress mặc định trung tính và mang nghĩa khi success/error.\n\n### Quy ước Switch gốc\n\nDùng Switch gốc bên trong ConfigProvider root sẵn có. `enabled`, `saving`, `unavailable` và\n`locale` bên dưới là trạng thái của ứng dụng; không tạo provider lồng hay theme cục bộ chỉ\ncho lịch, phân quyền hay nút bật/tắt trạng thái.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` là trung tính đậm, không bao giờ là xanh thành công nghiệp vụ. `switch.off.*`\ncó con trượt đậm, nhãn đọc được và đường biên có ý nghĩa để trạng thái OFF đang bật không bị\nnhầm với vô hiệu. Nguồn định nghĩa các vai trò rãnh/con trượt/nhãn/viền đi cặp cho thường,\nhover, nhấn, focus, loading và vô hiệu; cỡ thường và `size=\"small\"` dùng cùng bảng màu\nsáng/tối và hình học gốc sẵn có. Vị trí con trượt gốc, `aria-checked`, nhãn và vòng focus\nriêng cung cấp tín hiệu không dựa vào màu. Nhãn trạng thái ngắn EN/VI dùng typography gốc\nsẵn có, không vá chiều cao hay khai báo font phía bên dùng.\n\nAntD4 chỉ hỗ trợ một cặp con trượt/nhãn dùng chung, không có màu rãnh khi nhấn và không có\ncặp màu vô hiệu rõ ràng. Màu spinner và bóng xanh trong suốt của con trượt cũng không cấu hình\nđược như các phần đi cặp. CSS đi kèm lấp các khoảng thiếu có căn cứ đó, còn màu rãnh thường/\nhover vẫn nằm trong alias gốc. `opacityLoading: 1` bỏ hiệu ứng làm mờ loading/vô hiệu gốc; vai\ntrò vô hiệu không trong suốt rõ ràng vẫn khác với OFF đang bật. Loading giữ cặp checked thường\nhiện tại và spinner gốc tương phản cao, kể cả khi đặt cả prop loading lẫn disabled. Nó không\nbao giờ đoán trước hay đổi giá trị đã lưu.\n\nGiữ binding có điều khiển, callback `change` và thao tác bàn phím gốc. Nút gốc bị vô hiệu khi\nloading; kích hoạt khi đang chờ/vô hiệu không được lưu hai lần hay cập nhật trạng thái checked.\nThao tác lưu nghiệp vụ và lỗi vẫn do ứng dụng sở hữu. Kiểm tra cả hai cỡ,\ntrạng thái loading OFF/ON và vô hiệu, nhãn EN/VI, số lần gọi callback và một lần lưu có điều\nkhiển có độ trễ. Không cần bản vá `.ant-switch`, giá trị màu viết cứng hay\nSwitch tự làm ở phía bên dùng.\n\n### CSS đi kèm và class cấu trúc\n\nƯu tiên token component. CSS của gói lấp các khoảng thiếu thật của AntD4: typography ngữ nghĩa\ncho nhãn/tiêu đề, màu nền submenu viết cứng, màu thanh chọn, khoảng lệch focus bàn phím, vùng\nan toàn, vị trí Tour đáp ứng, giảm chuyển động và số đếm Badge trung tính mà không tô lại chấm\nlỗi. Selector của ứng dụng và ghi đè bảng màu không thuộc về CSS đó hay theme dashboard. Bên\ndùng chỉ giữ cơ chế bố cục và cuộn của portal thật. Các bản sửa màu và typography của framework\nthuộc về gói, không lặp lại thành ghi đè phía bên dùng.\n\nDescriptions có viền cắt nền ô bên trong khung bo gốc thay vì tô đè lên các góc trái. Card chỉ\ncó header bỏ đường phân cách header/thân thừa và giữ đủ bốn góc bo; Card có thân/ảnh bìa/thao\ntác giữ phân tách gốc. Card có viền và hoverable giữ `color.border.bold` cùng\n`elevation.shadow.raised` khi hover và focus bàn phím, thay vì viền hover trong suốt của AntD4.\nFocus cũng dùng viền ngoài/khoảng lệch chuẩn; ứng dụng vẫn sở hữu ngữ nghĩa thao tác bàn phím.\nCác bản sửa framework này tự động, không phải ghi đè theo từng trang.\n\nSearch gốc, nút addon của Input, InputGroup gọn và Space.Compact ngang dùng chung một hàng flex\nkéo giãn tự nhiên: cạnh trên/dưới của ô nhập và thao tác thẳng hàng, viền kề nhau chồng lên\nnhau một lần, góc lộ ra dùng `radius.control` và góc tiếp xúc bằng 0. Vai trò font gốc được\ngiữ. Trường/thao tác nhỏ tiếng Việt cùng lớn lên 26 px; không cắt dấu hay thu nhỏ chữ để ép\n24 px. Thao tác mặc định dùng chung viền error/warning/vô hiệu của trường; thao tác primary/\ndanger giữ vai trò ngữ nghĩa của chúng. Icon xoá giữ hộp dòng cỡ icon để không làm phình lớp\nbọc affix.\n\n`bh-ant-tag-large` trên Tag chọn nhãn lớn của nguồn (tối thiểu 24px, padding ngang 8px); mặc\nđịnh là tối thiểu 20px/6px. Cả hai lớn lên theo hộp dòng tiếng Việt thay vì cắt dấu.\n`bh-ant-tree-fill` trên Tree thật lấp đầy một host flex có giới hạn, kể cả bên dưới phần tóm\ntắt tự nhiên. Root và danh sách tạo chuỗi min-height bằng 0; chỉ holder danh sách gốc cuộn,\ngiữ đích cuộn bàn phím của nó. Không truyền chiều cao cố định hay thêm vùng cuộn bọc khác. Cây\ncó kích thước tự nhiên bỏ tuỳ chọn này. Bên dùng có điều hướng bàn phím gắn cặp gốc\n`activeKey` / `onActiveChange`: trạng thái `ref<TreeProps['activeKey']>()`, rồi\n`:active-key=\"activeKey\"` và `@active-change=\"activeKey = $event ?? undefined\"`. Đường\nactive-change không điều khiển của AntD 4.2 không giữ nút được yêu cầu; một tuỳ chọn CSS lấp\nđầy không thể cung cấp trạng thái điều hướng đó.\n\nĐể xem dữ liệu, gắn `width=\"var(--bh-ant-overlay-width)\"` và áp `bh-ant-inspection-modal`\nhoặc Drawer `rootClassName=\"bh-ant-inspection-drawer\"`. Chỉ thêm\n`bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` cho biến thể nhiều nội dung\nchỉ định rõ. Biến này chọn `layout.overlay.default` / `.wide`, và `.mobile` dưới\n`breakpoint.lg`. Hộp xác nhận ngắn và drawer điều hướng giữ chiều rộng riêng. Chế độ toàn màn\nhình là Modal `wrapClassName=\"full-screen\"` và Drawer `rootClassName=\"fullscreen\"`; Modal của\nAntD4 không có prop `rootClassName`. Chúng giữ cơ chế cuộn có giới hạn, không phải trang trí.\n\n### Kiểm tra trên framework thật\n\nThử sáng/tối × tiếng Anh/tiếng Việt với CSS thật đã import: button và input/select có kiểm tra\nhợp lệ, checkbox ở hàng bảng thường/đã chọn/đang hover, portal sắp xếp/lọc, điều hướng mở\nrộng/thu gọn/ngang và submenu, trợ giúp/lỗi form, Tooltip/Message, Modal/Drawer và chế độ xem\nmặc định/rộng/toàn màn hình ở 1023/1024px. Kiểm tra focus bàn phím, vùng chạm, giảm chuyển\nđộng, Tour hẹp và trả focus. Dùng **ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** trong control, tag\nvà hàng. Chỉ biên dịch thành công chưa chứng minh được kết quả render/tương tác đó.\n\n\n## Khoảng cách\n\nKích thước của Ant Design Vue đến từ `sizeUnit` và `sizeStep`. Giữ cả hai ở 4, để `size` là 16 px. Theme sau đó đặt từng kích thước từ một token [spacing](/vi/foundations/styles/spacing/).\n\n| Token Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` và `space.1000` không có token Ant Design Vue. Dùng biến CSS của chúng trong style của bạn.\n\nProps nhận số, như `size` của `a-space` và `gutter` của `a-row`, nhận pixel. Dùng một giá trị trong thang: `<a-space :size=\"8\">`.\n\n## Chiều cao control\n\n| Token Beehexa | Chiều cao | Token Ant Design Vue | Prop component |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | Không có |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nĐây là các chiều cao riêng của Ant Design Vue. Theme vẫn đặt từng chiều cao từ token kích thước của nó, nên thay đổi token sẽ tới được component. Xem [Size and density](/vi/foundations/styles/size-and-density/).\n\n## Breakpoint\n\n**Ghi đè các token `screen*` bằng [breakpoint](/vi/foundations/styles/layout/breakpoints/) của Beehexa.** Giá trị mặc định của Ant Design Vue khác (576, 992, 1200 và 1600 px).\n\nToken `Min` và `Max` được tính từ giá trị mặc định, không từ giá trị bạn ghi đè. Đặt cả chúng: mỗi `Max` là breakpoint kế tiếp trừ 1.\n\n| Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue có sáu breakpoint còn Beehexa có bốn, nên `sm` chuyển cùng `md`, và `xxl` cùng `xl`. Dùng các prop `xs`, `md`, `lg` và `xl` của `a-col`.\n\nKhi đó props của `a-col` và `gutter` đáp ứng của `a-row` chuyển ở đúng các độ rộng của Beehexa. Không dùng `xxxl`: media query của nó bị sai trong Ant Design Vue 4.2.6 và không bao giờ khớp.\n\n## Grid\n\nAnt Design Vue chia một hàng thành 24 phần. [Grid](/vi/foundations/styles/layout/grid/) của Beehexa có 4, 8 hoặc 12 cột, và mỗi loại chia hết cho 24.\n\n| Grid Beehexa | Cửa sổ | Span của `a-col` |\n|---|---|---|\n| 4 cột | Dưới 768 px | Span Beehexa × 6 |\n| 8 cột | 768 đến 1023 px | Span Beehexa × 3 |\n| 12 cột | Từ 1024 px | Span Beehexa × 2 |\n\n| Bố cục | Span Beehexa (4 / 8 / 12 / 12) | Props của mỗi `a-col` |\n|---|---|---|\n| Thẻ, 1 đến 4 mỗi hàng | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Khung chính | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Khung bên | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Ô tóm tắt | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nHàng của Ant Design Vue mặc định không có gutter. Đặt nó từ token khoảng cách, và đặt lề trang trên vùng nội dung.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## Khung ứng dụng\n\n| Vùng | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Điều hướng bên, mở | 280 px | `<a-layout-sider :width=\"280\">` |\n| Điều hướng bên, thu gọn | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nHeader mặc định cao 64 px và không có token cho chiều cao, nên đặt nó trong style của header.\n\nProp `breakpoint` của `a-layout-sider` dùng độ rộng cố định, bỏ qua các token `screen*`. Không dùng nó. Đặt `collapsed` từ media query của bạn và lựa chọn của người dùng: mở từ 1024 px, thu gọn thành thanh hẹp khi người dùng yêu cầu, và ghi nhớ lựa chọn. Dưới 1024 px, ẩn sider và hiện menu trong `a-drawer`.\n\nXem [Layout](/vi/foundations/styles/layout/) cho khung.\n\n## Hàng bảng tương tác\n\nChỉ gắn `data-bh-interactive=\"true\"` qua `customRow` khi toàn bộ hàng đã có handler kích hoạt.\nCSS đi kèm của nguồn sở hữu con trỏ dạng tay; phím/class chọn gốc giữ công thức chọn của\nchúng. Giữ thao tác hàng có trợ năng, hành vi bàn phím và việc kích hoạt bản ghi thật thay vì\nthay trạng thái chọn bằng viền ngoài tự làm.\n\n\n## Ghép component gốc và biến thể tuỳ chọn\n\nDùng component gốc thật. Các tuỳ chọn này không cho phép thay bằng div, lớp bọc chỉ đổi giao\ndiện, hay chép hình học Card/Button vào ứng dụng.\n\n- Prop `hoverable` của Card gốc vẫn là tuỳ chọn. `data-bh-selected=\"true\"` thêm nền đã chọn\n và tín hiệu viền trong độc lập; bỏ nó sẽ trở về dạng gốc.\n- Dùng lại `bh-data-accent` với `data-bh-status`, `data-bh-band`, `data-bh-metric`,\n `data-bh-job-type` hoặc `data-bh-priority` ngữ nghĩa sẵn có cho cạnh đầu tuỳ chọn trên một\n Card thật. Nó không thêm hành vi chọn hay hover. Cạnh trạng thái/nhóm loại vẫn giữ khi chọn;\n focus bàn phím vẫn là viền ngoài riêng. Gắn thuộc tính phân biệt phù hợp với dấu đó thay vì\n gộp trạng thái với danh tính nhóm loại. Nhãn vẫn bắt buộc.\n- `data-bh-layout=\"content\"` trên Button thật cho phép nhãn ghép nhiều dòng: chiều cao tự động,\n xuống dòng bình thường, căn đầu và chiều cao tối thiểu của control mặc định theo nguồn.\n Props, padding và kích hoạt bàn phím vẫn là gốc. Dùng prop size/block thông thường của Button\n khi đủ.\n- `bh-ant-shell-region` bỏ padding gốc của Header/Footer chỉ khi vùng đó đã chứa header/footer\n ứng dụng được ghép. Nó không đổi chiều cao, màu gốc hay bố cục vùng trang đáp ứng xung quanh.\n- `bh-card-link` trên anchor điều hướng thật bọc Card bỏ màu/gạch chân link cạnh tranh và cung\n cấp focus bàn phím theo nguồn, không phải giao diện Card.\n\nComponent nghiệp vụ có thể sở hữu dữ liệu, trạng thái, hành vi và cách ghép có ý nghĩa của các\nkhối cơ bản này. Liệt kê và bỏ các component thay thế thừa cùng mọi nơi gọi/import/export đã\nlỗi thời. Nội dung phong phú được sinh ra phải gắn control nâng cao gốc thật khi framework chứa\ncho phép; riêng một stylesheet từ phía cung cấp không phải bằng chứng thiếu năng lực gốc.\n\n\n### Nội dung gốc vận hành và được ghép\n\n`Steps[data-bh-operational=\"true\"]` dùng success/info/danger/subtle cho các trạng thái gốc\nfinish/process/error/wait. Nó giữ nguyên Steps điều hướng theo nhóm loại. `data-bh-skipped=\"true\"`\ntrên một Step thật thêm đuôi nét đứt ở cả hai hướng; bên gọi giữ thứ tự và nghĩa của quan hệ.\nSlot icon tuỳ chỉnh không cần dựng lại khối Steps cơ bản.\n\n`Result[data-bh-layout=\"step\"]` giữ hàng header icon và tiêu đề của báo cáo được ghép, với\nphụ đề/nội dung và extra/thao tác bên dưới rộng hết cỡ. Nó chỉ đổi bố cục/padding gốc; màu\ntrạng thái và slot gốc vẫn là gốc.\n\n`data-bh-highlighted=\"true\"` trên tiêu đề Tree gốc là tín hiệu định vị tạm thời, không phải\nkey đã chọn hay focus bàn phím. Treenode gốc đã chọn/vô hiệu sẽ ẩn nó; viền ngoài của nguồn\nkhông đổi hình học tiêu đề.\n\nDùng `bh-partner-logo-image` trên Image thật cho tài sản connector/thương hiệu. Chỉ gắn chiều\ncao ảnh đối tác của nguồn và `width=\"auto\"`; Image gốc cùng adapter giữ tỉ lệ khung hình tự\nnhiên mà không có khung vuông hay cắt. Avatar định danh thật vẫn là gốc. Không dùng sắc màu\nthương hiệu làm trạng thái vận hành.\n\n### Xem trước Image gốc\n\nToken chính thức `zIndexPopupBase` và `zIndexPopup` của Image dùng dải toàn màn hình. Chỉ vậy\nchưa đủ vượt lên trên phần tử sở hữu lồng bên trên nó: Preview của AntD 4.2.6 bỏ cả `zIndex`\nkhai báo cho Dialog lẫn `wrapProps`. Composable setup `useNativeImagePreviewContainer(labelGetter)`\ntừ `@beehexa/ant-design-vue-tokens/image` sở hữu portal body lazy chính thức: truyền getter của\nnó vào `preview.getContainer` gốc. Nó đặt tên cho hộp thoại gốc thật, phản ứng khi đổi ngôn\nngữ và lấy một lớp nằm trên các phần tử sở hữu hiện hành ở mỗi lần mở, không tính lớp trước\nđó của chính nó. Portal đã đóng không phải phần tử sở hữu overlay. Observer/container của nó\nđược giải phóng khi gỡ. Image gốc vẫn sở hữu zoom/pan, đóng bằng bàn phím và trả focus; không\ncó trình xem tự làm.\n\n\n`bh-ant-card-flush` cho thân Card thật bỏ lề trong chỉ khi chứa editor, canvas hay ô ghép nhúng\nsát mép. Card thông thường giữ padding gốc. Dùng lại `bh-ant-fill-card` và `bh-ant-fill-spin`\ncho host flex có giới hạn sẵn có; không tạo alias lấp đầy song song hay khôi phục selector\nriêng phía bên dùng. Card flush cắt màu nhúng theo khung bo gốc của nó. iframe trình duyệt là\ncon trực tiếp được bỏ viền mặc định của trình duyệt để tránh khung thứ hai; hành vi\nsandbox/srcdoc và tài liệu nhúng vẫn do trình duyệt sở hữu.\n\n`semanticTableComponents` từ `@beehexa/ant-design-vue-tokens/table` mở rộng API `components`\ncông khai của Table thật. `customCell` của một cột có thể trả về `{ scope: 'row' }`; ô thân của\nnó trở thành `th` ngữ nghĩa, chuyển tiếp thuộc tính và slot gốc. Các ô khác vẫn là `td`. AntD4\nkhông có prop cột cho row scope và CSS ô thân của nó chỉ nhắm `td`, nên CSS đi kèm của nguồn\ncung cấp công thức kích thước/viền/hover/chọn cho tiêu đề hàng tương ứng, lấp khoảng thiếu\nngữ nghĩa HTML thật này. Cột, hàng và Summary gốc vẫn là gốc.\n\nMột ListItem gốc thật có thể bật `data-bh-interactive=\"true\"` cho hàng kích hoạt phong phú khi\nkhông có control gốc hẹp hơn nào đáp ứng quy ước nội dung của nó. Tuỳ chọn chỉ cung cấp hover/\ncon trỏ/focus; bên dùng cung cấp thao tác thật, kích hoạt bằng bàn phím và role có trợ năng.\nKhông lồng các đích tương tác cạnh tranh.\n\n\nThương hiệu connector và đối tác dùng chung `content.partner-logo.image-size` làm chiều cao\nhiển thị, không phải giới hạn chiều rộng. Giữ chiều rộng tự nhiên; cho hàng xuống dòng khi cần.\nVai trò chiều cao icon ngữ nghĩa cũng giữ chiều rộng theo tỉ lệ và vùng bấm. Table gốc đã tạo\nstyle hình học `tfoot > tr > th` ở mỗi cỡ; CSS đi kèm chỉ thêm viền tiêu đề hàng của Summary\ncòn thiếu và độ đậm/căn lề ngữ nghĩa. `a-typography-link[data-bh-target=\"responsive\"]` dùng\nvùng bấm tối thiểu 24px của nguồn, tăng lên 44px chỉ với con trỏ thô; nó không thêm giao diện\nlink.\n\n\nCard flush cắt màu nhúng theo khung bo thật của nó. Footer Drawer gốc giữ lề chuẩn hoặc lề vùng\nan toàn của thiết bị, lấy giá trị lớn hơn. `Spin[data-bh-mode=\"nonblocking\"]` bỏ lớp phủ/chặn\ncon trỏ gốc chỉ cho nội dung tải dần vẫn xem được; bỏ nó cho việc thật sự chặn như xuất dữ\nliệu. Điều này không đổi thời gian spinner hay dữ liệu đồ thị.\n\n\n## Progress gốc phân đoạn chỉ đọc\n\nVới phản hồi “Bước 3/7”, dùng `Progress` gốc thật với `steps` và `percent` thật. Đây không phải\nđiều hướng: không thay bằng `Steps`, `Segmented`, một hàng dấu tự dựng hay bộ máy tiến độ khác.\n\n`size=\"small\"` của AntD4 cố ý vẽ mỗi bước thành **mảnh dọc 2 × 8px**. Bộ `[width, height]` gốc\ncủa nó là hình học **của từng đoạn**. Helper của nguồn phân giải\n`content.step-progress.segment-width` và `segment-height` thành 16 × 4px ở root 16 và 20 × 5px\nở root 20. Gắn nó theo kiểu phản ứng:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Bước {{ props.index }}/{{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nTính năng sở hữu tổng số dương thật, chỉ số hiện tại, chữ trạng thái và các chuyển tiếp nghiệp\nvụ. Helper chỉ cung cấp hình học; Progress gốc sở hữu số đoạn đã render và các dấu đang hoạt\nđộng. Chỉ ẩn thanh thừa khỏi công nghệ hỗ trợ khi chữ bên cạnh đã truyền đạt cùng tiến độ.\n\n`bh-ant-step-progress` cho root gốc đó dùng chiều rộng inline tự nhiên, bỏ margin ngoài gốc,\ndùng `content.step-progress.gap` của nguồn (4px ở root 16) và xuống dòng mà không có margin ở\nmục cuối. CSS không thay API size gốc hay đặt chiều rộng/chiều cao cho từng dấu. Thanh nằm theo\nsau trạng thái trên hàng rộng và xuống dòng trong chiều rộng khả dụng trên mobile.\n\nBỏ class và helper để giữ dạng gốc. Progress phần trăm, tải lên và đếm ngược thông thường không\nbật tuỳ chọn này. Ma trận trực tiếp dùng chung bên dưới gồm một bản so sánh gốc thật không bật\ntuỳ chọn, tổng số chỉnh được và control đầu/giữa/cuối; kiểm tra cả root 16 và root 20, sáng/tối\nvà độ rộng hẹp.\n\n## Progress mảnh khi chuyển trang\n\nĐể báo đang tải trang, dùng `Progress` gốc thật với `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` và bộ kích thước gốc của nó.\nDùng `border.width.focused` cho độ dày đường và `color.brand.yellow` cho màu nét thương hiệu\n(tuỳ chọn). Ứng dụng tự định vị cố định ở `top: 0`, chiều rộng và lớp trong bảy token\n[z-index](/vi/foundations/styles/z-index/); adapter bỏ khoảng baseline inline và margin ngoài của\nAntD, để nét thật bắt đầu đúng ở mép trên được cấp mà không cần dịch âm.\n\nProgress thể hiện các mốc điều hướng đã xong, không phải phần trăm mạng tự đặt. Giữ trang cũ\ntrong lúc guard và chunk của route đang tải, tiến tới 100%, và chờ hiệu ứng chuyển chiều rộng gốc\nkết thúc rồi mới chuyển sang trang mới. Huỷ, lỗi và điều hướng mới hơn phải tự xoá tiến độ của\nchính nó mà không xoá yêu cầu mới hơn. Hiệu ứng chuyển chiều rộng dùng `motion.duration.default`\nvà `motion.easing.linear`; chế độ giảm chuyển động bỏ hiệu ứng này. Giữ một progressbar có tên\nvới giá trị mốc thật, và không bao giờ phủ cả trang chỉ để tải một route.\n\n## Một họ control gốc, các vai trò riêng biệt\n\nDùng Button default gốc cho trigger tiện ích gọn có viền (kể cả ngôn ngữ và theme), cùng cỡ gốc\nvới các control trang bên cạnh. Dùng slot `#icon` công khai và một phần tử con là nhãn; Button\nchỉ có icon vẫn cần tên truy cập. Không nguỵ trang `type=\"text\"` toàn cục thành Button default.\nMenu tài khoản/avatar không khung dùng `type=\"text\"` hợp lệ, một Avatar thật và Space gốc: căn\ngiữa nó trong hàng thay vì tự chế giao diện khung.\n\nButton small/default/large dùng chiều cao control của nguồn 24/32/40px ở root danh nghĩa;\ntypography là label-small cho cỡ small và label-default cho các cỡ khác. Button/Input/Select và\nmục điều hướng bên dùng `radius.control`; popup của Select và menu dùng `radius.overlay`.\nObserver root/theme dạng số và CSS rem co giãn cùng nhau. AntD4 chỉ chèn margin cho phần tử anh\nem `.anticon`, không cho SVG Lucide trong `#icon`; nguồn cung cấp một khoảng flex space100 cho\nmọi Button thật và bỏ margin gốc/icon loading cạnh tranh. Không cần class riêng cho khung ứng\ndụng. Default/primary/text/link, vô hiệu/loading, hover/nhấn và focus bàn phím gốc vẫn tách\nbiệt. `data-bh-target=\"responsive\"` thêm kích thước chạm tối thiểu chỉ với con trỏ thô. Trạng\nthái mở của Dropdown/Menu không phải trạng thái chọn của Button; giữ `aria-expanded`, hành vi\nbàn phím của menu và trả focus trong tính năng thật.\n\nCặp primary trung tính đậm/đảo là có chủ ý: graphite ở chế độ sáng, graphite nhạt với chữ tối ở\nchế độ tối. Thao tác Tiếp tục nhạt màu ở chế độ tối không phải lý do tô lại mọi Button primary\nhay text thành màu xanh. Thao tác link giữ bảng màu link của nguồn; thao tác tiện ích default vẫn\ncó viền.\n\n| Biến thể gốc | Vai trò nguồn và quy ước trạng thái |\n| --- | --- |\n| Default / dashed | Surface, chữ và viền; nền trung tính nhạt khi hover/nhấn. Dashed giữ viền nét đứt gốc. |\n| Primary | Cặp trung tính đậm/đảo cùng vai trò hover/nhấn đậm riêng. |\n| Danger primary | Cặp danger đậm/chữ trên nền đậm, kể cả hover/nhấn. |\n| Danger default / dashed / text / ghost | Chữ danger đọc được; biến thể có viền giữ viền danger. Biến thể không phải link dùng nền danger nhạt khi hover/nhấn. Ghost bắt đầu trong suốt, không bao giờ với nhãn đặc trên nền đậm. |\n| Link / text | Vai trò link/không khung riêng, không phải Button default nguỵ trang. |\n| Ghost | Biến thể có viền trong suốt gốc với màu chữ hợp vai trò và ngữ cảnh chứa; không phải primary đặc. |\n| Vô hiệu / loading | Hành vi chặn và alias vô hiệu gốc là chuẩn, kể cả Button dạng anchor bị vô hiệu. Loading không làm mờ một cặp màu nguồn vốn đọc được. |\n\nAntD4 vẽ **bóng dưới khi nghỉ** từ `controlOutline` cho primary, `controlTmpOutline` cho default\nvà `colorErrorOutline` cho danger-primary. Các tên này không chỉ là đầu vào cho focus bàn phím.\nDùng lại alias focus xanh toàn cục ở đó tạo ra một vệt xanh lạc lõng kể cả khi mọi animation đã\nxong. Nguồn đặt ba alias component Button này thành trong suốt; nó không xoá vai trò focus toàn\ncục hay đặt độ dày của nó bằng 0.\n\nFocus bàn phím của Button gốc thay vào đó đọc `colorPrimaryBorder` và `lineWidthBold`. Ghi đè\ncomponent của nó dùng màu/độ dày focus của nguồn. Quy tắc `:focus-visible` khi bật của CSS đi\nkèm cung cấp viền ngoài/khoảng lệch độc lập, có khe hở theo nguồn. Nền trạng thái default/dashed\nvà các cặp chữ danger/chữ trên nền đậm riêng là những khoảng thiếu token gốc còn lại; CSS nguồn\nchỉ xử lý các trường hợp đó, trừ control vô hiệu và trạng thái chọn thật. Ứng dụng không được\nthêm reset bóng/viền cục bộ hay chặn focus.\n\n### Ma trận trực tiếp trạng thái gốc và tiến độ\n\nDùng control theme/ngôn ngữ của site và tuỳ chọn cỡ chữ root của trình duyệt. Đổi cỡ Button,\nhover/giữ nhấn, Tab/Enter/Space qua các thao tác khả dụng, và xem số lần kích hoạt thật. Button\nloading/vô hiệu và anchor gốc vô hiệu không được kích hoạt. Progress dùng cùng số đếm/chỉ số\nthật cho bản bật và không bật tuỳ chọn.\n\n<NativeControlsDemo />\n\n\n### Ghép gốc trên mobile và nội dung có giới hạn\n\nAdapter kéo giãn các trường Input/Search/nhóm gọn ghép nối và thao tác của chúng thành một hàng,\nkể cả trạng thái kiểm tra hợp lệ, vô hiệu và vùng bấm cho con trỏ thô. Button chỉ có icon giữ tỉ\nlệ kích thước gốc; với con trỏ thô cả hai chiều đạt `size.target.touch`. Button bố cục theo nội\ndung giữ chữ nhiều dòng mà không ghi đè kích thước chạm tối thiểu chỉ định rõ hay đáp ứng.\n\nDưới `breakpoint.md`, mọi tiêu đề header/meta của Card gốc đều xuống dòng, kể cả ellipsis của\nTypography con, Tag và Space. Đây là nội dung dễ đọc toàn cục, không phải ghi đè tuỳ chọn của\nbên dùng. Extra của header vẫn dùng được. Chấm, đuôi và chấm tuỳ chỉnh của Timeline chuẩn căn\ntheo dòng nội dung đầu tiên; nội dung sự kiện xuống dòng vẫn nằm trong cột timeline gốc. Timeline\ndạng label/alternate/right giữ cách căn gốc riêng.\n\nFlex của AntD4 không chuyển tiếp `role`, `aria-*`, `data-*` hay listener DOM tuỳ ý. Không đặt\nngữ nghĩa bắt buộc, tuỳ chọn nguồn hay handler bàn phím trên nó. Dùng Space/Typography gốc khi\nphù hợp, hoặc giữ một host ngữ nghĩa thật với CSS flex/grid cấu trúc tối thiểu. Không thêm lớp\nbọc chuyển tiếp.\n\nDùng `bh-content-toolbar` và `bh-content-toolbar__group` trên host thanh công cụ thật; nguồn sở\nhữu khoảng cách, padding, xuống dòng và kích thước tối thiểu control trên mobile. Các công thức\nnày áp cho control editor/sơ đồ/đồ thị, không phải giao diện riêng của trang. Giữ host và các\nphần tử con flex co được bằng `min-width: 0`.\n\nGắn `bh-ant-fill-spin` qua **wrapperClassName** của Spin, không qua class: lớp bọc nested-loading\nmang chiều cao có giới hạn. Chế độ fill/flush của Drawer đi qua chuỗi content-wrapper/content/\nwrapper-body gốc; header/footer giữ kích thước tự nhiên và thân sở hữu phần không gian còn lại.\nTabs chỉ lấp pane đang mở của chính nó. Bên dùng cung cấp phần tử cha có giới hạn thật, không\nđoán chiều cao viewport trừ header. Monaco/Mermaid theo dõi kích thước host đó mà không thay\nmodel editor hay đặt lại pan/zoom biểu đồ hiện có.\n",
|
|
4339
|
+
"raw": "---\ntitle: Theme Ant Design Vue\ndescription: \"Cho component Ant Design Vue dùng design token, breakpoint, grid, chiều cao control và khung ứng dụng của Beehexa.\"\norder: 3\n---\nimport NativeControlsDemo from '../../components/NativeControlsDemo.astro';\n\n`@beehexa/ant-design-vue-tokens` sở hữu adapter Ant Design Vue 4 dùng lại được. Dùng API\nESM có kiểu và CSS đi kèm của nó, dựa trên `@beehexa/design-tokens`. Framework là peer:\n`ant-design-vue@^4.2.6` và `vue@^3.3.0`; không gói nào được đóng kèm. Gói `0.0.0` chưa phát\nhành dùng tham chiếu phát triển cục bộ rõ ràng; chỉ quy trình phát hành được duyệt mới gắn\nversion thật. Không chép bảng màu theme vào ứng dụng.\n\n**Token Beehexa là nguồn chân lý. Ant Design Vue chỉ đọc chúng.**\n\nTrang này là nơi duy nhất foundations của Beehexa gặp Ant Design Vue. Các trang foundations giữ nguyên dù sản phẩm được xây bằng gì.\n\n## Cách dùng\n\n```vue\n<script setup lang=\"ts\">\nimport { computed, watchEffect } from 'vue';\nimport { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';\nimport '@beehexa/design-tokens/css';\nimport '@beehexa/ant-design-vue-tokens/css';\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();\nconst rootFontSize = useAntDesignVueRootFontSize();\nconst theme = computed(() => createAntDesignVueTheme({\n dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value\n}));\nwatchEffect(() => {\n if (typeof document === 'undefined') return;\n document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';\n document.documentElement.lang = props.locale;\n});\n</script>\n\n<template>\n <a-config-provider :theme=\"theme\" :get-popup-container=\"getAntDesignVuePopupContainer\">\n <App />\n </a-config-provider>\n</template>\n```\n\n`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})` trả về\n`ThemeConfig` gốc. Tính lại khi theme/ngôn ngữ/cỡ chữ root đổi; mỗi lần gọi trả về một object\nmới. `locale` chọn typography gốc, không chọn thông điệp. Observer gốc chỉ dùng trong setup đo\nmột phần tử thử 1rem không tương tác rồi dọn nó đi. Nhờ đó các API kích thước/chữ/radius dạng\nsố gốc khớp với đơn vị CSS co giãn; viền và breakpoint tính bằng pixel không co giãn. Factory\nthuần không đọc DOM. Truyền gói ngôn ngữ AntD phù hợp qua `ConfigProvider.locale`, và cấu hình\nthư viện ngày riêng. Render các holder gốc `useMessage`, `useNotification` và `useModal` trong\nmột host phản hồi bên trong provider root duy nhất. Gắn facade thông báo của ứng dụng vào các\nAPI hook đó; không bao giờ dùng API phản hồi tĩnh thô tách rời. Factory đặt `hashed: false`\nvì nếu không, holder message/notification theo ngữ cảnh của AntD4 sẽ giữ hash cũ khi đổi\ntheme/ngôn ngữ. Giữ một thông báo đang mở khi chuyển từ tối/tiếng Việt sang sáng/tiếng Anh;\nchữ và màu của nó phải theo theme đang dùng.\n\nGiữ `data-theme` và `lang` của document đồng bộ cho overlay được teleport. Import CSS đi kèm\nsau style của ứng dụng/framework. Dùng root gốc 16px và chữ thân 14px; API dạng số phân giải\nrem của nguồn ở 16px. Entry pixel không phải đường dùng cho dashboard.\n\n## Quyền sở hữu overlay và nội dung gốc có giới hạn\n\nPopup được kích hoạt dùng `getAntDesignVuePopupContainer` để nằm trong Modal/Drawer gốc gần\nnhất hoặc host `data-bh-overlay-owner` tuỳ chỉnh. Root của Modal/Drawer gốc vẫn gắn vào body\nđể có hình học theo viewport. Facade modal gắn với provider mặc định đặt `zIndex` lúc gọi qua\n`getAntDesignVueModalZIndex()` nhưng vẫn giữ giá trị bên gọi chỉ định rõ; nhờ vậy hộp xác\nnhận bằng bàn phím/có await nằm trên phần tử sở hữu hiện hành. Drawer lồng nhau dùng\n`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` làm `rootStyle.zIndex` để bề mặt và\nmask di chuyển cùng nhau; prop `zIndex` của AntD4 chỉ tạo style cho lớp bọc nội dung.\nEditor/ảnh toàn màn hình teleport vào body và Modal gốc toàn màn hình lấy\n`getAntDesignVueFullscreenZIndex()` trước khi gắn root. Hàm này dùng `z-index.modal`\nvới thứ tự nằm trên phần tử sở hữu, không tạo tầng toàn màn hình riêng. Chỉ đánh dấu\nroot tuỳ chỉnh khi chúng đang hoạt động, tránh tự đếm chính mình. Bảy tầng được duyệt\nkhông có token fullscreen450 hay readiness650; trạng thái chờ chặn thao tác cũng dùng\n`z-index.modal`. Giữ thứ tự tương đối theo phần tử sở hữu dưới `z-index.tooltip` và\n`z-index.toast`; dành `z-index.spotlight` cho hướng dẫn Tour. Mặc định inline gốc của\nTour cũng cần prop `zIndex` công khai gắn với `z-index.spotlight`.\n\nKhung Modal và lớp bọc nội dung Drawer cố ý kế thừa `pointer-events: none`; nội dung gốc chỉ\nkhôi phục khả năng nhận con trỏ cho cây con của chính nó. CSS đi kèm cũng khôi phục\n`pointer-events: auto` trên các root popup gốc thật được portal vào một trong hai khung đó\n(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover và Tour). Khung\nvẫn trong suốt với con trỏ ở ngoài nội dung và popup; mask, việc giữ focus và cách đóng gốc giữ\nnguyên. Không dời popup vào body đang cuộn, đổi z-index hay thêm ghi đè cho trang để xử lý\nkhoảng hở con trỏ kế thừa này.\n\nCSS đi kèm cung cấp các quy ước cấu trúc gốc tuỳ chọn, không phải selector của ứng dụng:\n\n- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: thân có giới hạn, header/footer kích thước\n tự nhiên, tuỳ chọn bỏ padding thân; gắn qua `rootClassName`. Giữ overflow tự động mặc định\n của thân gốc thay vì chặn truy cập khi control tự nhiên hoặc mức tối thiểu của ô được giữ\n vượt phần cấp ngắn. Không lặp style flex/overflow của thân ở phía bên dùng.\n- `bh-ant-fill-modal`: gắn qua `wrapClassName` gốc, không phải `rootClassName` mà Modal không\n hỗ trợ. Overlay cố định thật cấp một hộp thoại có giới hạn, cách mép theo token; lớp bọc nội\n dung/focus và thân của nó lấp đầy quanh header/footer tự nhiên. Chiều rộng vẫn là chiều rộng\n gốc của bên gọi, giới hạn trong overlay khả dụng. Dùng cho việc xem trình hiển thị tương tác,\n không cho hộp xác nhận ngắn. Chỉ viewport của trình hiển thị sở hữu phần tràn khi nhỏ hơn\n mức tối thiểu; không trừ chiều cao khung đoán chừng.\n- `bh-ant-fill-tabs`: lớp bọc gốc và pane đang mở có giới hạn. Tabs lồng nhau bật riêng;\n `bh-ant-fill-tabs--scroll` bật cuộn trong pane và `bh-ant-tabs-mobile-inset` thêm lề mobile\n của nguồn. Pane không hoạt động vẫn ẩn.\n Tabs bên trong tài liệu đang cuộn đó có thể thay bằng `bh-ant-fill-tabs--document`: lớp bọc\n giữ chiều cao nội dung tự nhiên và lớn lên khi đủ chỗ, không cắt trình hiển thị sau khi\n metadata dài chiếm hết phần cấp. Pane cuộn gốc bên ngoài sở hữu truy cập theo chiều dọc;\n không đặt cả hai modifier trên cùng một root. Chỉ host trình hiển thị tương tác nhận\n `--bh-layout-renderer-minimum-block-size`, không phải pane bên ngoài hay trường tĩnh.\n- `bh-ant-fill-spin` / `bh-ant-fill-card`: đưa một host có giới hạn sẵn có đi qua các lớp bọc\n gốc. Nội dung tài liệu/cây/danh sách tĩnh có thể giữ không co và hiện phần tràn bên trong\n phần tử cuộn sẵn có của Card gốc. Không ghép vùng cuộn Card đó với vùng cuộn bên trong thứ\n hai cao 0 khi header của nó chiếm hết một pane nhỏ. Cách ghép tài liệu này không thêm mức\n tối thiểu dễ đọc của SDK cho trường thông thường.\n- `bh-ant-fit-empty`: chỉ trên Empty gốc thật bên trong một phần giữ chỗ đã được cấp. Chỉ chọn\n hình minh hoạ gốc không đảm bảo vừa trong host thấp. Tuỳ chọn này bỏ margin đoạn văn bên\n ngoài và của mô tả (cha sở hữu lề), giới hạn root và cho hàng ảnh co lại trước mô tả/footer\n tự nhiên. Ảnh giữ chiều cao ưu tiên gốc và bỏ khoảng baseline inline; cả hình phóng to lẫn\n margin đoạn văn đều không chiếm host nhỏ. Nó không thêm mức tối thiểu cho trình hiển thị,\n bảng màu, typography chữ, thay ảnh hay chặn tràn. Giữ đúng một phần tử cuộn thật của cha khi\n ngay cả chữ/thao tác tự nhiên cũng không vừa. Empty thông thường của tài liệu/danh sách/bảng\n bỏ qua nó và giữ mặc định gốc. Bộ component gốc trực tiếp bên dưới so sánh phần cấp\n 2/4/12rem, hình minh hoạ đơn giản và dạng gốc không bật tuỳ chọn.\n- `AntDesignVuePopupScope`: chỉ cho trình hiển thị được giữ di chuyển giữa các phần tử sở hữu\n overlay gốc. Bọc cây con sẵn có bên ngoài Teleport của nó và truyền root HTMLElement sẵn có\n làm `owner`; giữ thuộc tính owner trên root thật đó. Giữ một phần tử thật làm root của\n component dùng khi bên gọi dùng `v-show` hay directive phần tử khác; đặt scope bên trong root\n sẵn có đó, không thay chỗ nó. Holder popup gốc ổn định di chuyển cùng owner vì AntD4 cache\n container portal đầu tiên. Scope lồng nhau kế thừa đích bao ngoài. Theme/ngôn ngữ của\n ConfigProvider gốc, menu, focus và portal body không có trigger vẫn là gốc; không có rekey\n editor/model/đồ thị hay z-index popup toàn cục nào liên quan. Tuỳ chọn `feedback` (mặc định\n `false`) đưa container không có trigger về host scope đã mount, để holder\n `notification.useNotification()` / `message.useMessage()` bên trong scope theo owner overlay\n vào phần tử toàn màn hình gốc. Handler capture toàn màn hình\n nhường Escape cho menu/listbox qua `isAntDesignVueMenuEvent(event)` trước khi đóng overlay\n của chính nó. Portal Drawer gốc có thể dùng cùng host ổn định qua scoped slot công khai:\n `<AntDesignVuePopupScope v-slot=\"{ getContainer }\">` với\n `<a-drawer :get-container=\"getContainer\">`. Thuộc tính HTML trên scope thuộc về host portal\n thật đó; chỉ hiện `role=\"dialog\"`, `aria-label` và `aria-modal` có điều kiện khi đang mở,\n nếu Drawer gốc bỏ các thuộc tính này. Không thêm lớp bọc hộp thoại thứ hai hay sửa DOM gốc.\n Flex của AntD4 cũng bỏ các thuộc tính khác class/style: dùng một phần tử ngữ nghĩa thật sẵn\n có khi ID được điều khiển, tên vùng hay điểm dừng Tab phải được giữ.\n- Lựa chọn có thể chọn và mở rộng độc lập ghép slot tiêu đề Card thật với Button mở rộng và\n Button chọn gốc anh em cùng một Tag phím tắt. Giữ header Card không tương tác; mỗi Button chỉ\n sở hữu thao tác của nó. Header Collapse của AntD4 giữ `role=\"button\"`/điểm dừng Tab ở phần\n tử cha kể cả ở chế độ chỉ icon, nên không lồng lựa chọn có thao tác độc lập vào đó. Slot thân\n Card có điều kiện gốc sở hữu nội dung mở rộng; không cần vá role/bàn phím header riêng hay\n CSS thu gọn lựa chọn đặc biệt.\n- `bh-ant-inspection-descriptions`: chiều rộng nhãn tối thiểu trên desktop và hàng xếp chồng\n trên mobile theo nguồn.\n- `bh-ant-data-table`: class hàng pending/success/error chung cùng dấu `customCell` công khai\n `data-bh-cell-interaction=\"editable|readonly\"` và `data-bh-cell-state=\"changed\"`. Trạng\n thái chọn gốc được ưu tiên hơn màu hàng vận hành; ô đã đổi giữ màu diff khi hover.\n `bh-ant-table-nowrap` là tuỳ chọn độc lập cho nội dung ngang.\n Thêm `bh-ant-row-indicators` để có dấu danger lề trong `border.width.accent` ở ô đầu tiên\n của hàng `bh-ant-row-error`. Tín hiệu vấn đề không dựa vào màu này không đổi hình học cột,\n không ghi đè trạng thái chọn và không thay chữ/icon trạng thái.\n- `data-bh-tone=\"warning\"` trên root Badge gốc chọn `color.background.warning.bold` /\n `color.text.on-bold` chỉ cho số đếm. Chấm trạng thái vận hành gốc giữ ngữ nghĩa và hình\n tròn riêng của nguồn.\n- `data-bh-target=\"touch\"` trên Button gốc chọn `size.target.touch` làm chiều rộng/cao tối\n thiểu mà không tô lại nó. `data-bh-target=\"responsive\"` chỉ áp vùng bấm đó cho con trỏ thô.\n Giữ ngữ nghĩa type, size, disabled và bàn phím gốc; không cần trang tự định kích thước vùng\n bấm.\n- Root đã quan sát cũng có thể truyền vào `tokenPixels(name, locale, rootFontSize)` cho props\n dạng số thật của Avatar/Image thay cho CSS rem co giãn. Setup của phần tử con dùng lại số đo\n chỉ đọc của provider duy nhất, không tạo observer khác.\n\nGiữ dữ liệu nghiệp vụ tuỳ chỉnh/nghĩa của slot và cấu trúc host ở phía bên dùng, không giữ\ncông thức trình bày. Không tạo lại selector gốc bằng `:deep(.ant-*)` theo từng trang, ghi\nđè toàn cục hay tăng độ ưu tiên.\n\n## Ánh xạ token\n\n| Token Ant Design | Token Beehexa |\n| --- | --- |\n| `colorPrimary` | `color.background.neutral.bold` |\n| `colorText` | `color.text` |\n| `colorBorder` | `color.border` |\n| `borderRadius` | `radius.control` (6 px) |\n| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.control.small` (4 px) |\n| `borderRadiusLG` / `borderRadiusOuter` | `radius.card` (8 px) / `radius.control` (6 px) |\n| `fontFamily` | `font.family.sans` |\n\nDùng [radius theo vai trò](/vi/foundations/styles/radius/), không dùng một radius cho mọi\ncomponent:\n\n| Component | Token radius |\n| --- | --- |\n| Button, Input, ô chọn của Select, Radio button, Segmented, mục điều hướng bên | `radius.control` (6 px) |\n| Control 24 px | `radius.control.small` (4 px) |\n| Mục trong dropdown hoặc popup submenu | `radius.item` (4 px) |\n| Tooltip, tag, số đếm của badge | `radius.050` (4 px) |\n| Checkbox | `radius.025` (2 px) |\n| Card, Alert, Collapse, Tabs và các khung trong trang khác | `radius.card` (8 px) |\n| Dropdown, popup submenu, popup của Select, Popover, Message, Notification | `radius.overlay` (8 px) |\n| Modal, Drawer | `radius.modal` (12 px) |\n| Avatar (tròn), Switch, chip | `radius.pill` |\n| Bảng rộng hết cỡ, cạnh ghép của Search, bề mặt toàn màn hình | `radius.0` |\n\nNhóm có padding 4 px dùng góc ngoài 8 px; nhóm có padding 8 px dùng góc ngoài 12 px. Adapter\ncố định các alias component này và CSS đi kèm xử lý các trường hợp badge, Switch, Segmented và\nDrawer không có đầu vào theme. Bên dùng phải bỏ các ghi đè góc cạnh tranh, không thêm bản vá\nradius `.ant-*`. Props Button `shape=\"circle\"` / `shape=\"round\"` chỉ định rõ giữ kích thước\ngốc và góc `radius.control`. Chúng không phải vai trò avatar, Switch hay chip.\n\nAdapter cũng cố định các vai trò ngữ nghĩa hover/nhấn/vô hiệu/link/trạng thái/chọn/focus\nthay vì để bảng màu xanh do framework sinh lọt qua. Input, select, checkbox và radio dùng\n`color.border.bold`, còn card/bảng dùng `color.border`. Header và sider của Layout nằm trên\n`color.surface.page`, tách khỏi nội dung bằng một đường `color.border`; drawer điều hướng\ntrên mobile là drawer trên `color.surface.overlay`. Không có bảng màu khung riêng hay theme\nlồng cô lập. Dùng `font.body.default` cho dữ liệu bảng, `font.label.small` cho tiêu đề/tag,\n`font.heading.medium` cho tiêu đề modal và `font.heading.small` cho tiêu đề drawer.\n\nIcon Menu gốc giữ ô icon của nguồn và khoảng cách tới tiêu đề `space.050`. Chữ tiêu đề dùng\n`font.label.default` thay vì hộp dòng theo chiều cao hàng, giữ nhãn tiếng Việt và nội dung\ntiêu đề/tag bên cạnh do bên dùng sở hữu thẳng hàng theo chiều dọc.\n\n### Quy ước component Ant Design Vue 4\n\n- Table đọc `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` và\n `controlItemBgActiveHover`. Tên AntD5 như `headerBg` và `headerColor` bị AntD Vue 4.2.6 bỏ\n qua và không được dùng.\n- Switch đọc rãnh OFF từ `colorTextQuaternary`/`colorTextTertiary`, rãnh ON từ\n `colorPrimary`/`colorPrimaryHover`, con trượt dùng chung từ `colorWhite`, **cả hai** nhãn\n từ `colorTextLightSolid`, và độ mờ vô hiệu/loading từ `opacityLoading`. Đây là ánh xạ theo\n phạm vi component, không đổi màu primary/chữ toàn cục. Tên kiểu AntD5 như\n `trackBg`/`handleBg` không phải API trạng thái của AntD4.\n- Menu đọc `colorItem*`, `radiusItem`, `radiusSubMenuItem` và `colorActiveBar*`. Menu\n `theme=\"dark\"` chỉ định rõ nhận cùng vai trò nguồn. Trạng thái chọn có thanh hiển thị,\n không phải nhãn đậm hơn làm xê dịch phần tử bên cạnh hay chỉ đổi màu nền.\n- Control form dùng chung vai trò viền ngoài/focus/vô hiệu của nguồn. Kiểm tra hợp lệ giữ\n chữ/icon danger/warning và ngữ nghĩa trạng thái gốc. Không thay viền ô nhập có ý nghĩa bằng\n đường kẻ phân cách mảnh.\n- Preset trạng thái của Tag là `success`, `processing`, `warning`, `error`; mặc định là trung\n tính. Chúng dùng cặp màu chữ và viền ngoài của nguồn. Preset sắc màu tuỳ ý không phải tên\n trạng thái. Số đếm Badge là trung tính; chấm trạng thái error/processing giữ ngữ nghĩa của\n chúng.\n- Tooltip và Message dùng cặp bề mặt/chữ đảo (inverse). Nội dung Modal/Drawer dùng surface,\n scrim và độ nổi overlay. Progress mặc định trung tính và mang nghĩa khi success/error.\n\n### Quy ước Switch gốc\n\nDùng Switch gốc bên trong ConfigProvider root sẵn có. `enabled`, `saving`, `unavailable` và\n`locale` bên dưới là trạng thái của ứng dụng; không tạo provider lồng hay theme cục bộ chỉ\ncho lịch, phân quyền hay nút bật/tắt trạng thái.\n\n```vue\n<a-switch\n v-model:checked=\"enabled\"\n :loading=\"saving\"\n :disabled=\"unavailable\"\n :checked-children=\"locale === 'vi' ? 'Bật' : 'On'\"\n :un-checked-children=\"locale === 'vi' ? 'Tắt' : 'Off'\"\n :aria-label=\"settingLabel\"\n/>\n```\n\n`switch.on.*` là trung tính đậm, không bao giờ là xanh thành công nghiệp vụ. `switch.off.*`\ncó con trượt đậm, nhãn đọc được và đường biên có ý nghĩa để trạng thái OFF đang bật không bị\nnhầm với vô hiệu. Nguồn định nghĩa các vai trò rãnh/con trượt/nhãn/viền đi cặp cho thường,\nhover, nhấn, focus, loading và vô hiệu; cỡ thường và `size=\"small\"` dùng cùng bảng màu\nsáng/tối và hình học gốc sẵn có. Vị trí con trượt gốc, `aria-checked`, nhãn và vòng focus\nriêng cung cấp tín hiệu không dựa vào màu. Nhãn trạng thái ngắn EN/VI dùng typography gốc\nsẵn có, không vá chiều cao hay khai báo font phía bên dùng.\n\nAntD4 chỉ hỗ trợ một cặp con trượt/nhãn dùng chung, không có màu rãnh khi nhấn và không có\ncặp màu vô hiệu rõ ràng. Màu spinner và bóng xanh trong suốt của con trượt cũng không cấu hình\nđược như các phần đi cặp. CSS đi kèm lấp các khoảng thiếu có căn cứ đó, còn màu rãnh thường/\nhover vẫn nằm trong alias gốc. `opacityLoading: 1` bỏ hiệu ứng làm mờ loading/vô hiệu gốc; vai\ntrò vô hiệu không trong suốt rõ ràng vẫn khác với OFF đang bật. Loading giữ cặp checked thường\nhiện tại và spinner gốc tương phản cao, kể cả khi đặt cả prop loading lẫn disabled. Nó không\nbao giờ đoán trước hay đổi giá trị đã lưu.\n\nGiữ binding có điều khiển, callback `change` và thao tác bàn phím gốc. Nút gốc bị vô hiệu khi\nloading; kích hoạt khi đang chờ/vô hiệu không được lưu hai lần hay cập nhật trạng thái checked.\nThao tác lưu nghiệp vụ và lỗi vẫn do ứng dụng sở hữu. Kiểm tra cả hai cỡ,\ntrạng thái loading OFF/ON và vô hiệu, nhãn EN/VI, số lần gọi callback và một lần lưu có điều\nkhiển có độ trễ. Không cần bản vá `.ant-switch`, giá trị màu viết cứng hay\nSwitch tự làm ở phía bên dùng.\n\n### CSS đi kèm và class cấu trúc\n\nƯu tiên token component. CSS của gói lấp các khoảng thiếu thật của AntD4: typography ngữ nghĩa\ncho nhãn/tiêu đề, màu nền submenu viết cứng, màu thanh chọn, khoảng lệch focus bàn phím, vùng\nan toàn, vị trí Tour đáp ứng, giảm chuyển động và số đếm Badge trung tính mà không tô lại chấm\nlỗi. Selector của ứng dụng và ghi đè bảng màu không thuộc về CSS đó hay theme dashboard. Bên\ndùng chỉ giữ cơ chế bố cục và cuộn của portal thật. Các bản sửa màu và typography của framework\nthuộc về gói, không lặp lại thành ghi đè phía bên dùng.\n\nDescriptions có viền cắt nền ô bên trong khung bo gốc thay vì tô đè lên các góc trái. Card chỉ\ncó header bỏ đường phân cách header/thân thừa và giữ đủ bốn góc bo; Card có thân/ảnh bìa/thao\ntác giữ phân tách gốc. Card có viền và hoverable giữ `color.border.bold` cùng\n`elevation.shadow.raised` khi hover và focus bàn phím, thay vì viền hover trong suốt của AntD4.\nFocus cũng dùng viền ngoài/khoảng lệch chuẩn; ứng dụng vẫn sở hữu ngữ nghĩa thao tác bàn phím.\nCác bản sửa framework này tự động, không phải ghi đè theo từng trang.\n\nSearch gốc, nút addon của Input, InputGroup gọn và Space.Compact ngang dùng chung một hàng flex\nkéo giãn tự nhiên: cạnh trên/dưới của ô nhập và thao tác thẳng hàng, viền kề nhau chồng lên\nnhau một lần, góc lộ ra dùng `radius.control` và góc tiếp xúc bằng 0. Vai trò font gốc được\ngiữ. Trường/thao tác nhỏ tiếng Việt cùng lớn lên 26 px; không cắt dấu hay thu nhỏ chữ để ép\n24 px. Thao tác mặc định dùng chung viền error/warning/vô hiệu của trường; thao tác primary/\ndanger giữ vai trò ngữ nghĩa của chúng. Icon xoá giữ hộp dòng cỡ icon để không làm phình lớp\nbọc affix.\n\n`bh-ant-tag-large` trên Tag chọn nhãn lớn của nguồn (tối thiểu 24px, padding ngang 8px); mặc\nđịnh là tối thiểu 20px/6px. Cả hai lớn lên theo hộp dòng tiếng Việt thay vì cắt dấu.\n`bh-ant-tree-fill` trên Tree thật lấp đầy một host flex có giới hạn, kể cả bên dưới phần tóm\ntắt tự nhiên. Root và danh sách tạo chuỗi min-height bằng 0; chỉ holder danh sách gốc cuộn,\ngiữ đích cuộn bàn phím của nó. Không truyền chiều cao cố định hay thêm vùng cuộn bọc khác. Cây\ncó kích thước tự nhiên bỏ tuỳ chọn này. Bên dùng có điều hướng bàn phím gắn cặp gốc\n`activeKey` / `onActiveChange`: trạng thái `ref<TreeProps['activeKey']>()`, rồi\n`:active-key=\"activeKey\"` và `@active-change=\"activeKey = $event ?? undefined\"`. Đường\nactive-change không điều khiển của AntD 4.2 không giữ nút được yêu cầu; một tuỳ chọn CSS lấp\nđầy không thể cung cấp trạng thái điều hướng đó.\n\nĐể xem dữ liệu, gắn `width=\"var(--bh-ant-overlay-width)\"` và áp `bh-ant-inspection-modal`\nhoặc Drawer `rootClassName=\"bh-ant-inspection-drawer\"`. Chỉ thêm\n`bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` cho biến thể nhiều nội dung\nchỉ định rõ. Biến này chọn `layout.overlay.default` / `.wide`, và `.mobile` dưới\n`breakpoint.lg`. Hộp xác nhận ngắn và drawer điều hướng giữ chiều rộng riêng. Chế độ toàn màn\nhình là Modal `wrapClassName=\"full-screen\"` và Drawer `rootClassName=\"fullscreen\"`; Modal của\nAntD4 không có prop `rootClassName`. Chúng giữ cơ chế cuộn có giới hạn, không phải trang trí.\n\n### Kiểm tra trên framework thật\n\nThử sáng/tối × tiếng Anh/tiếng Việt với CSS thật đã import: button và input/select có kiểm tra\nhợp lệ, checkbox ở hàng bảng thường/đã chọn/đang hover, portal sắp xếp/lọc, điều hướng mở\nrộng/thu gọn/ngang và submenu, trợ giúp/lỗi form, Tooltip/Message, Modal/Drawer và chế độ xem\nmặc định/rộng/toàn màn hình ở 1023/1024px. Kiểm tra focus bàn phím, vùng chạm, giảm chuyển\nđộng, Tour hẹp và trả focus. Dùng **ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** trong control, tag\nvà hàng. Chỉ biên dịch thành công chưa chứng minh được kết quả render/tương tác đó.\n\n\n## Khoảng cách\n\nKích thước của Ant Design Vue đến từ `sizeUnit` và `sizeStep`. Giữ cả hai ở 4, để `size` là 16 px. Theme sau đó đặt từng kích thước từ một token [spacing](/vi/foundations/styles/spacing/).\n\n| Token Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `space.050` | 4 px | `sizeXXS, paddingXXS, marginXXS` |\n| `space.100` | 8 px | `sizeXS, paddingXS, marginXS` |\n| `space.150` | 12 px | `sizeSM, paddingSM, marginSM` |\n| `space.200` | 16 px | `size, sizeMS, padding, margin` |\n| `space.250` | 20 px | `sizeMD, paddingMD, marginMD` |\n| `space.300` | 24 px | `sizeLG, paddingLG, marginLG` |\n| `space.400` | 32 px | `sizeXL, paddingXL, marginXL` |\n| `space.600` | 48 px | `sizeXXL, marginXXL` |\n\n`space.0`, `space.025`, `space.075`, `space.500`, `space.800` và `space.1000` không có token Ant Design Vue. Dùng biến CSS của chúng trong style của bạn.\n\nProps nhận số, như `size` của `a-space` và `gutter` của `a-row`, nhận pixel. Dùng một giá trị trong thang: `<a-space :size=\"8\">`.\n\n## Chiều cao control\n\n| Token Beehexa | Chiều cao | Token Ant Design Vue | Prop component |\n|---|---|---|---|\n| `size.control.small` | 24 px | `controlHeightSM` | `size=\"small\"` |\n| `size.control.default` | 32 px | `controlHeight` | Không có |\n| `size.control.large` | 40 px | `controlHeightLG` | `size=\"large\"` |\n\nĐây là các chiều cao riêng của Ant Design Vue. Theme vẫn đặt từng chiều cao từ token kích thước của nó, nên thay đổi token sẽ tới được component. Xem [Size and density](/vi/foundations/styles/size-and-density/).\n\n## Breakpoint\n\n**Ghi đè các token `screen*` bằng [breakpoint](/vi/foundations/styles/layout/breakpoints/) của Beehexa.** Giá trị mặc định của Ant Design Vue khác (576, 992, 1200 và 1600 px).\n\nToken `Min` và `Max` được tính từ giá trị mặc định, không từ giá trị bạn ghi đè. Đặt cả chúng: mỗi `Max` là breakpoint kế tiếp trừ 1.\n\n| Beehexa | Giá trị | Token Ant Design Vue |\n|---|---|---|\n| `breakpoint.xs` | 0 | `screenXSMax: 767` |\n| `breakpoint.md` | 768 px | `screenSM`, `screenSMMin`, `screenMD`, `screenMDMin`: 768; `screenSMMax`, `screenMDMax`: 1023 |\n| `breakpoint.lg` | 1024 px | `screenLG`, `screenLGMin`: 1024; `screenLGMax`: 1439 |\n| `breakpoint.xl` | 1440 px | `screenXL`, `screenXLMin`, `screenXXL`, `screenXXLMin`: 1440 |\n\nAnt Design Vue có sáu breakpoint còn Beehexa có bốn, nên `sm` chuyển cùng `md`, và `xxl` cùng `xl`. Dùng các prop `xs`, `md`, `lg` và `xl` của `a-col`.\n\nKhi đó props của `a-col` và `gutter` đáp ứng của `a-row` chuyển ở đúng các độ rộng của Beehexa. Không dùng `xxxl`: media query của nó bị sai trong Ant Design Vue 4.2.6 và không bao giờ khớp.\n\n## Grid\n\nAnt Design Vue chia một hàng thành 24 phần. [Grid](/vi/foundations/styles/layout/grid/) của Beehexa có 4, 8 hoặc 12 cột, và mỗi loại chia hết cho 24.\n\n| Grid Beehexa | Cửa sổ | Span của `a-col` |\n|---|---|---|\n| 4 cột | Dưới 768 px | Span Beehexa × 6 |\n| 8 cột | 768 đến 1023 px | Span Beehexa × 3 |\n| 12 cột | Từ 1024 px | Span Beehexa × 2 |\n\n| Bố cục | Span Beehexa (4 / 8 / 12 / 12) | Props của mỗi `a-col` |\n|---|---|---|\n| Thẻ, 1 đến 4 mỗi hàng | 4 / 4 / 4 / 3 | `:xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\"` |\n| Khung chính | 4 / 8 / 8 / 9 | `:xs=\"24\" :lg=\"16\" :xl=\"18\"` |\n| Khung bên | 4 / 8 / 4 / 3 | `:xs=\"24\" :lg=\"8\" :xl=\"6\"` |\n| Ô tóm tắt | 2 / 2 / 3 / 2 | `:xs=\"12\" :md=\"6\" :xl=\"4\"` |\n\nHàng của Ant Design Vue mặc định không có gutter. Đặt nó từ token khoảng cách, và đặt lề trang trên vùng nội dung.\n\n```vue\n<a-row :gutter=\"[{ xs: 16, md: 24 }, { xs: 16, md: 24 }]\">\n <a-col :xs=\"24\" :md=\"12\" :lg=\"8\" :xl=\"6\">\n <OrderSummary />\n </a-col>\n</a-row>\n```\n\n## Khung ứng dụng\n\n| Vùng | Beehexa | Ant Design Vue |\n|---|---|---|\n| Header | 48 px | `<a-layout-header style=\"height: 48px; line-height: 48px\">` |\n| Điều hướng bên, mở | 280 px | `<a-layout-sider :width=\"280\">` |\n| Điều hướng bên, thu gọn | 64 px | `<a-layout-sider :collapsed-width=\"64\">` |\n\nHeader mặc định cao 64 px và không có token cho chiều cao, nên đặt nó trong style của header.\n\nProp `breakpoint` của `a-layout-sider` dùng độ rộng cố định, bỏ qua các token `screen*`. Không dùng nó. Đặt `collapsed` từ media query của bạn và lựa chọn của người dùng: mở từ 1024 px, thu gọn thành thanh hẹp khi người dùng yêu cầu, và ghi nhớ lựa chọn. Dưới 1024 px, ẩn sider và hiện menu trong `a-drawer`.\n\nXem [Layout](/vi/foundations/styles/layout/) cho khung.\n\n## Hàng bảng tương tác\n\nChỉ gắn `data-bh-interactive=\"true\"` qua `customRow` khi toàn bộ hàng đã có handler kích hoạt.\nCSS đi kèm của nguồn sở hữu con trỏ dạng tay; phím/class chọn gốc giữ công thức chọn của\nchúng. Giữ thao tác hàng có trợ năng, hành vi bàn phím và việc kích hoạt bản ghi thật thay vì\nthay trạng thái chọn bằng viền ngoài tự làm.\n\n\n## Ghép component gốc và biến thể tuỳ chọn\n\nDùng component gốc thật. Các tuỳ chọn này không cho phép thay bằng div, lớp bọc chỉ đổi giao\ndiện, hay chép hình học Card/Button vào ứng dụng.\n\n- Prop `hoverable` của Card gốc vẫn là tuỳ chọn. `data-bh-selected=\"true\"` thêm nền đã chọn\n và tín hiệu viền trong độc lập; bỏ nó sẽ trở về dạng gốc.\n- Dùng lại `bh-data-accent` với `data-bh-status`, `data-bh-band`, `data-bh-metric`,\n `data-bh-job-type` hoặc `data-bh-priority` ngữ nghĩa sẵn có cho cạnh đầu tuỳ chọn trên một\n Card thật. Nó không thêm hành vi chọn hay hover. Cạnh trạng thái/nhóm loại vẫn giữ khi chọn;\n focus bàn phím vẫn là viền ngoài riêng. Gắn thuộc tính phân biệt phù hợp với dấu đó thay vì\n gộp trạng thái với danh tính nhóm loại. Nhãn vẫn bắt buộc.\n- `data-bh-layout=\"content\"` trên Button thật cho phép nhãn ghép nhiều dòng: chiều cao tự động,\n xuống dòng bình thường, căn đầu và chiều cao tối thiểu của control mặc định theo nguồn.\n Props, padding và kích hoạt bàn phím vẫn là gốc. Dùng prop size/block thông thường của Button\n khi đủ.\n- `bh-ant-shell-region` bỏ padding gốc của Header/Footer chỉ khi vùng đó đã chứa header/footer\n ứng dụng được ghép. Nó không đổi chiều cao, màu gốc hay bố cục vùng trang đáp ứng xung quanh.\n- `bh-card-link` trên anchor điều hướng thật bọc Card bỏ màu/gạch chân link cạnh tranh và cung\n cấp focus bàn phím theo nguồn, không phải giao diện Card.\n\nComponent nghiệp vụ có thể sở hữu dữ liệu, trạng thái, hành vi và cách ghép có ý nghĩa của các\nkhối cơ bản này. Liệt kê và bỏ các component thay thế thừa cùng mọi nơi gọi/import/export đã\nlỗi thời. Nội dung phong phú được sinh ra phải gắn control nâng cao gốc thật khi framework chứa\ncho phép; riêng một stylesheet từ phía cung cấp không phải bằng chứng thiếu năng lực gốc.\n\n\n### Nội dung gốc vận hành và được ghép\n\n`Steps[data-bh-operational=\"true\"]` dùng success/info/danger/subtle cho các trạng thái gốc\nfinish/process/error/wait. Nó giữ nguyên Steps điều hướng theo nhóm loại. `data-bh-skipped=\"true\"`\ntrên một Step thật thêm đuôi nét đứt ở cả hai hướng; bên gọi giữ thứ tự và nghĩa của quan hệ.\nSlot icon tuỳ chỉnh không cần dựng lại khối Steps cơ bản.\n\n`Result[data-bh-layout=\"step\"]` giữ hàng header icon và tiêu đề của báo cáo được ghép, với\nphụ đề/nội dung và extra/thao tác bên dưới rộng hết cỡ. Nó chỉ đổi bố cục/padding gốc; màu\ntrạng thái và slot gốc vẫn là gốc.\n\n`data-bh-highlighted=\"true\"` trên tiêu đề Tree gốc là tín hiệu định vị tạm thời, không phải\nkey đã chọn hay focus bàn phím. Treenode gốc đã chọn/vô hiệu sẽ ẩn nó; viền ngoài của nguồn\nkhông đổi hình học tiêu đề.\n\nDùng `bh-partner-logo-image` trên Image thật cho tài sản connector/thương hiệu. Chỉ gắn chiều\ncao ảnh đối tác của nguồn và `width=\"auto\"`; Image gốc cùng adapter giữ tỉ lệ khung hình tự\nnhiên mà không có khung vuông hay cắt. Avatar định danh thật vẫn là gốc. Không dùng sắc màu\nthương hiệu làm trạng thái vận hành.\n\n### Xem trước Image gốc\n\nToken chính thức `zIndexPopupBase` và `zIndexPopup` của Image dùng dải toàn màn hình. Chỉ vậy\nchưa đủ vượt lên trên phần tử sở hữu lồng bên trên nó: Preview của AntD 4.2.6 bỏ cả `zIndex`\nkhai báo cho Dialog lẫn `wrapProps`. Composable setup `useNativeImagePreviewContainer(labelGetter)`\ntừ `@beehexa/ant-design-vue-tokens/image` sở hữu portal body lazy chính thức: truyền getter của\nnó vào `preview.getContainer` gốc. Nó đặt tên cho hộp thoại gốc thật, phản ứng khi đổi ngôn\nngữ và lấy một lớp nằm trên các phần tử sở hữu hiện hành ở mỗi lần mở, không tính lớp trước\nđó của chính nó. Portal đã đóng không phải phần tử sở hữu overlay. Observer/container của nó\nđược giải phóng khi gỡ. Image gốc vẫn sở hữu zoom/pan, đóng bằng bàn phím và trả focus; không\ncó trình xem tự làm.\n\n\n`bh-ant-card-flush` cho thân Card thật bỏ lề trong chỉ khi chứa editor, canvas hay ô ghép nhúng\nsát mép. Card thông thường giữ padding gốc. Dùng lại `bh-ant-fill-card` và `bh-ant-fill-spin`\ncho host flex có giới hạn sẵn có; không tạo alias lấp đầy song song hay khôi phục selector\nriêng phía bên dùng. Card flush cắt màu nhúng theo khung bo gốc của nó. iframe trình duyệt là\ncon trực tiếp được bỏ viền mặc định của trình duyệt để tránh khung thứ hai; hành vi\nsandbox/srcdoc và tài liệu nhúng vẫn do trình duyệt sở hữu.\n\n`semanticTableComponents` từ `@beehexa/ant-design-vue-tokens/table` mở rộng API `components`\ncông khai của Table thật. `customCell` của một cột có thể trả về `{ scope: 'row' }`; ô thân của\nnó trở thành `th` ngữ nghĩa, chuyển tiếp thuộc tính và slot gốc. Các ô khác vẫn là `td`. AntD4\nkhông có prop cột cho row scope và CSS ô thân của nó chỉ nhắm `td`, nên CSS đi kèm của nguồn\ncung cấp công thức kích thước/viền/hover/chọn cho tiêu đề hàng tương ứng, lấp khoảng thiếu\nngữ nghĩa HTML thật này. Cột, hàng và Summary gốc vẫn là gốc.\n\nMột ListItem gốc thật có thể bật `data-bh-interactive=\"true\"` cho hàng kích hoạt phong phú khi\nkhông có control gốc hẹp hơn nào đáp ứng quy ước nội dung của nó. Tuỳ chọn chỉ cung cấp hover/\ncon trỏ/focus; bên dùng cung cấp thao tác thật, kích hoạt bằng bàn phím và role có trợ năng.\nKhông lồng các đích tương tác cạnh tranh.\n\n\nThương hiệu connector và đối tác dùng chung `content.partner-logo.image-size` làm chiều cao\nhiển thị, không phải giới hạn chiều rộng. Giữ chiều rộng tự nhiên; cho hàng xuống dòng khi cần.\nVai trò chiều cao icon ngữ nghĩa cũng giữ chiều rộng theo tỉ lệ và vùng bấm. Table gốc đã tạo\nstyle hình học `tfoot > tr > th` ở mỗi cỡ; CSS đi kèm chỉ thêm viền tiêu đề hàng của Summary\ncòn thiếu và độ đậm/căn lề ngữ nghĩa. `a-typography-link[data-bh-target=\"responsive\"]` dùng\nvùng bấm tối thiểu 24px của nguồn, tăng lên 44px chỉ với con trỏ thô; nó không thêm giao diện\nlink.\n\n\nCard flush cắt màu nhúng theo khung bo thật của nó. Footer Drawer gốc giữ lề chuẩn hoặc lề vùng\nan toàn của thiết bị, lấy giá trị lớn hơn. `Spin[data-bh-mode=\"nonblocking\"]` bỏ lớp phủ/chặn\ncon trỏ gốc chỉ cho nội dung tải dần vẫn xem được; bỏ nó cho việc thật sự chặn như xuất dữ\nliệu. Điều này không đổi thời gian spinner hay dữ liệu đồ thị.\n\n\n## Progress gốc phân đoạn chỉ đọc\n\nVới phản hồi “Bước 3/7”, dùng `Progress` gốc thật với `steps` và `percent` thật. Đây không phải\nđiều hướng: không thay bằng `Steps`, `Segmented`, một hàng dấu tự dựng hay bộ máy tiến độ khác.\n\n`size=\"small\"` của AntD4 cố ý vẽ mỗi bước thành **mảnh dọc 2 × 8px**. Bộ `[width, height]` gốc\ncủa nó là hình học **của từng đoạn**. Helper của nguồn phân giải\n`content.step-progress.segment-width` và `segment-height` thành 16 × 4px ở root 16 và 20 × 5px\nở root 20. Gắn nó theo kiểu phản ứng:\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getAntDesignVueStepProgressSize,\n useAntDesignVueRootFontSize\n} from '@beehexa/ant-design-vue-tokens'\nimport { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'\n\nconst props = defineProps<{ total: number; index: number; dark: boolean }>()\nconst rootFontSize = useAntDesignVueRootFontSize()\nconst progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))\n</script>\n\n<template>\n <a-space align=\"center\" wrap>\n <span>Bước {{ props.index }}/{{ props.total }}</span>\n <a-progress\n class=\"bh-ant-step-progress\"\n :steps=\"props.total\"\n :percent=\"props.index / props.total * 100\"\n :size=\"progressSize\"\n :stroke-color=\"getStatusColor('info', 'border', { dark: props.dark })\"\n :show-info=\"false\"\n aria-hidden=\"true\"\n />\n </a-space>\n</template>\n```\n\nTính năng sở hữu tổng số dương thật, chỉ số hiện tại, chữ trạng thái và các chuyển tiếp nghiệp\nvụ. Helper chỉ cung cấp hình học; Progress gốc sở hữu số đoạn đã render và các dấu đang hoạt\nđộng. Chỉ ẩn thanh thừa khỏi công nghệ hỗ trợ khi chữ bên cạnh đã truyền đạt cùng tiến độ.\n\n`bh-ant-step-progress` cho root gốc đó dùng chiều rộng inline tự nhiên, bỏ margin ngoài gốc,\ndùng `content.step-progress.gap` của nguồn (4px ở root 16) và xuống dòng mà không có margin ở\nmục cuối. CSS không thay API size gốc hay đặt chiều rộng/chiều cao cho từng dấu. Thanh nằm theo\nsau trạng thái trên hàng rộng và xuống dòng trong chiều rộng khả dụng trên mobile.\n\nBỏ class và helper để giữ dạng gốc. Progress phần trăm, tải lên và đếm ngược thông thường không\nbật tuỳ chọn này. Ma trận trực tiếp dùng chung bên dưới gồm một bản so sánh gốc thật không bật\ntuỳ chọn, tổng số chỉnh được và control đầu/giữa/cuối; kiểm tra cả root 16 và root 20, sáng/tối\nvà độ rộng hẹp.\n\n## Progress mảnh khi chuyển trang\n\nĐể báo đang tải trang, dùng `Progress` gốc thật với `bh-ant-navigation-progress`,\n`showInfo=false`, `status=\"normal\"`, `strokeLinecap=\"square\"` và bộ kích thước gốc của nó.\nDùng `border.width.focused` cho độ dày đường và `color.brand.yellow` cho màu nét thương hiệu\n(tuỳ chọn). Ứng dụng tự định vị cố định ở `top: 0`, chiều rộng và lớp trong bảy token\n[z-index](/vi/foundations/styles/z-index/); adapter bỏ khoảng baseline inline và margin ngoài của\nAntD, để nét thật bắt đầu đúng ở mép trên được cấp mà không cần dịch âm.\n\nProgress thể hiện các mốc điều hướng đã xong, không phải phần trăm mạng tự đặt. Giữ trang cũ\ntrong lúc guard và chunk của route đang tải, tiến tới 100%, và chờ hiệu ứng chuyển chiều rộng gốc\nkết thúc rồi mới chuyển sang trang mới. Huỷ, lỗi và điều hướng mới hơn phải tự xoá tiến độ của\nchính nó mà không xoá yêu cầu mới hơn. Hiệu ứng chuyển chiều rộng dùng `motion.duration.default`\nvà `motion.easing.linear`; chế độ giảm chuyển động bỏ hiệu ứng này. Giữ một progressbar có tên\nvới giá trị mốc thật, và không bao giờ phủ cả trang chỉ để tải một route.\n\n## Một họ control gốc, các vai trò riêng biệt\n\nDùng Button default gốc cho trigger tiện ích gọn có viền (kể cả ngôn ngữ và theme), cùng cỡ gốc\nvới các control trang bên cạnh. Dùng slot `#icon` công khai và một phần tử con là nhãn; Button\nchỉ có icon vẫn cần tên truy cập. Không nguỵ trang `type=\"text\"` toàn cục thành Button default.\nMenu tài khoản/avatar không khung dùng `type=\"text\"` hợp lệ, một Avatar thật và Space gốc: căn\ngiữa nó trong hàng thay vì tự chế giao diện khung.\n\nButton small/default/large dùng chiều cao control của nguồn 24/32/40px ở root danh nghĩa;\ntypography là label-small cho cỡ small và label-default cho các cỡ khác. Button/Input/Select và\nmục điều hướng bên dùng `radius.control`; popup của Select và menu dùng `radius.overlay`.\nObserver root/theme dạng số và CSS rem co giãn cùng nhau. AntD4 chỉ chèn margin cho phần tử anh\nem `.anticon`, không cho SVG Lucide trong `#icon`; nguồn cung cấp một khoảng flex space100 cho\nmọi Button thật và bỏ margin gốc/icon loading cạnh tranh. Không cần class riêng cho khung ứng\ndụng. Default/primary/text/link, vô hiệu/loading, hover/nhấn và focus bàn phím gốc vẫn tách\nbiệt. `data-bh-target=\"responsive\"` thêm kích thước chạm tối thiểu chỉ với con trỏ thô. Trạng\nthái mở của Dropdown/Menu không phải trạng thái chọn của Button; giữ `aria-expanded`, hành vi\nbàn phím của menu và trả focus trong tính năng thật.\n\nCặp primary trung tính đậm/đảo là có chủ ý: graphite ở chế độ sáng, graphite nhạt với chữ tối ở\nchế độ tối. Thao tác Tiếp tục nhạt màu ở chế độ tối không phải lý do tô lại mọi Button primary\nhay text thành màu xanh. Thao tác link giữ bảng màu link của nguồn; thao tác tiện ích default vẫn\ncó viền.\n\n| Biến thể gốc | Vai trò nguồn và quy ước trạng thái |\n| --- | --- |\n| Default / dashed | Surface, chữ và viền; nền trung tính nhạt khi hover/nhấn. Dashed giữ viền nét đứt gốc. |\n| Primary | Cặp trung tính đậm/đảo cùng vai trò hover/nhấn đậm riêng. |\n| Danger primary | Cặp danger đậm/chữ trên nền đậm, kể cả hover/nhấn. |\n| Danger default / dashed / text / ghost | Chữ danger đọc được; biến thể có viền giữ viền danger. Biến thể không phải link dùng nền danger nhạt khi hover/nhấn. Ghost bắt đầu trong suốt, không bao giờ với nhãn đặc trên nền đậm. |\n| Link / text | Vai trò link/không khung riêng, không phải Button default nguỵ trang. |\n| Ghost | Biến thể có viền trong suốt gốc với màu chữ hợp vai trò và ngữ cảnh chứa; không phải primary đặc. |\n| Vô hiệu / loading | Hành vi chặn và alias vô hiệu gốc là chuẩn, kể cả Button dạng anchor bị vô hiệu. Loading không làm mờ một cặp màu nguồn vốn đọc được. |\n\nAntD4 vẽ **bóng dưới khi nghỉ** từ `controlOutline` cho primary, `controlTmpOutline` cho default\nvà `colorErrorOutline` cho danger-primary. Các tên này không chỉ là đầu vào cho focus bàn phím.\nDùng lại alias focus xanh toàn cục ở đó tạo ra một vệt xanh lạc lõng kể cả khi mọi animation đã\nxong. Nguồn đặt ba alias component Button này thành trong suốt; nó không xoá vai trò focus toàn\ncục hay đặt độ dày của nó bằng 0.\n\nFocus bàn phím của Button gốc thay vào đó đọc `colorPrimaryBorder` và `lineWidthBold`. Ghi đè\ncomponent của nó dùng màu/độ dày focus của nguồn. Quy tắc `:focus-visible` khi bật của CSS đi\nkèm cung cấp viền ngoài/khoảng lệch độc lập, có khe hở theo nguồn. Nền trạng thái default/dashed\nvà các cặp chữ danger/chữ trên nền đậm riêng là những khoảng thiếu token gốc còn lại; CSS nguồn\nchỉ xử lý các trường hợp đó, trừ control vô hiệu và trạng thái chọn thật. Ứng dụng không được\nthêm reset bóng/viền cục bộ hay chặn focus.\n\n### Ma trận trực tiếp trạng thái gốc và tiến độ\n\nDùng control theme/ngôn ngữ của site và tuỳ chọn cỡ chữ root của trình duyệt. Đổi cỡ Button,\nhover/giữ nhấn, Tab/Enter/Space qua các thao tác khả dụng, và xem số lần kích hoạt thật. Button\nloading/vô hiệu và anchor gốc vô hiệu không được kích hoạt. Progress dùng cùng số đếm/chỉ số\nthật cho bản bật và không bật tuỳ chọn.\n\n<NativeControlsDemo />\n\n\n### Ghép gốc trên mobile và nội dung có giới hạn\n\nAdapter kéo giãn các trường Input/Search/nhóm gọn ghép nối và thao tác của chúng thành một hàng,\nkể cả trạng thái kiểm tra hợp lệ, vô hiệu và vùng bấm cho con trỏ thô. Button chỉ có icon giữ tỉ\nlệ kích thước gốc; với con trỏ thô cả hai chiều đạt `size.target.touch`. Button bố cục theo nội\ndung giữ chữ nhiều dòng mà không ghi đè kích thước chạm tối thiểu chỉ định rõ hay đáp ứng.\n\nDưới `breakpoint.md`, mọi tiêu đề header/meta của Card gốc đều xuống dòng, kể cả ellipsis của\nTypography con, Tag và Space. Đây là nội dung dễ đọc toàn cục, không phải ghi đè tuỳ chọn của\nbên dùng. Extra của header vẫn dùng được. Chấm, đuôi và chấm tuỳ chỉnh của Timeline chuẩn căn\ntheo dòng nội dung đầu tiên; nội dung sự kiện xuống dòng vẫn nằm trong cột timeline gốc. Timeline\ndạng label/alternate/right giữ cách căn gốc riêng.\n\nFlex của AntD4 không chuyển tiếp `role`, `aria-*`, `data-*` hay listener DOM tuỳ ý. Không đặt\nngữ nghĩa bắt buộc, tuỳ chọn nguồn hay handler bàn phím trên nó. Dùng Space/Typography gốc khi\nphù hợp, hoặc giữ một host ngữ nghĩa thật với CSS flex/grid cấu trúc tối thiểu. Không thêm lớp\nbọc chuyển tiếp.\n\nDùng `bh-content-toolbar` và `bh-content-toolbar__group` trên host thanh công cụ thật; nguồn sở\nhữu khoảng cách, padding, xuống dòng và kích thước tối thiểu control trên mobile. Các công thức\nnày áp cho control editor/sơ đồ/đồ thị, không phải giao diện riêng của trang. Giữ host và các\nphần tử con flex co được bằng `min-width: 0`.\n\nGắn `bh-ant-fill-spin` qua **wrapperClassName** của Spin, không qua class: lớp bọc nested-loading\nmang chiều cao có giới hạn. Chế độ fill/flush của Drawer đi qua chuỗi content-wrapper/content/\nwrapper-body gốc; header/footer giữ kích thước tự nhiên và thân sở hữu phần không gian còn lại.\nTabs chỉ lấp pane đang mở của chính nó. Bên dùng cung cấp phần tử cha có giới hạn thật, không\nđoán chiều cao viewport trừ header. Monaco/Mermaid theo dõi kích thước host đó mà không thay\nmodel editor hay đặt lại pan/zoom biểu đồ hiện có.\n",
|
|
4340
4340
|
"frontmatter": {
|
|
4341
4341
|
"title": "Theme Ant Design Vue",
|
|
4342
4342
|
"description": "Cho component Ant Design Vue dùng design token, breakpoint, grid, chiều cao control và khung ứng dụng của Beehexa.",
|
|
@@ -4461,8 +4461,8 @@
|
|
|
4461
4461
|
"status": "active",
|
|
4462
4462
|
"releasePhase": null,
|
|
4463
4463
|
"planned": [],
|
|
4464
|
-
"body": "\n`@beehexa/vueflow-tokens` chuyển token chính thức sang VueFlow 1. Gói không chép mã nguồn\nVueFlow, không đóng gói Vue, không sinh dữ liệu đồ thị và không đổi chiều quan hệ.\n\n## Cài đặt và áp dụng\n\nCài gói này, `@beehexa/design-tokens`, Vue 3, và các peer core, controls, minimap của\nVueFlow 1. Nạp CSS core, theme, controls và minimap của upstream trong entry đồ thị lazy,\ntrước CSS của adapter; nạp CSS design token gốc một lần với root 16px/chữ thân 14px.\nCác gói nguồn cục bộ vẫn là `0.0.0` riêng tư; đó không phải một bản phát hành registry.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nFactory trả về các biến theo phạm vi, binding viewport có kiểu `FlowProps` (không dùng\n`FlowOptions` đã ngừng hỗ trợ), và binding cho Background/MiniMap. Nó lấy giá trị sáng\ncùng phần ghi đè tối và các phương án chữ tiếng Việt từ gói token. Tính lại khi theme hoặc\nngôn ngữ đổi. Giữ handler ready/error và fit đồ thị với padding `0.2` khi phần tử chứa đo\nđược hoặc đổi kích thước. Dùng đúng tùy chọn `fitViewOnInit` thật của VueFlow 1; không\ntruyền tên tùy chọn viewport tự đặt.\n\n## Tone màu không phải trạng thái\n\n`FlowTone` (`FLOW_TONES`) đặt tên tám tone màu chung: `blue`, `red`, `green`, `crimson`,\n`yellow`, `teal`, `magenta` và `purple`. Mỗi tone đọc một bộ vai trò `flow.category.*` có sẵn\ncủa nền tảng; các khóa nền tảng giữ nguyên tên, và gói không gán nghĩa nào cho tone. Bên dùng\ntự quyết định loại nút hay loại quan hệ nào của mình dùng tone nào. Tone không được hiểu là\nthành công, thất bại hay cảnh báo. Giữ nhãn loại và icon của nút; màu không bao giờ là cách\nnhận diện duy nhất, và tone không xác nhận trạng thái của một lần chạy.\n\nMỗi tone cung cấp `foreground`, `background`, `border` và `hover` như một vai trò sáng/tối đi\ncặp, không trong suốt. Dùng `getFlowTonePalette(tone)` cho binding dựa trên CSS; `border` của\nnó là danh tính khung/cạnh. Các vai trò gốc này thay cho bảng màu lịch sử do ứng dụng tự giữ,\nlớp phủ alpha, gradient và hàm chỉnh bảng màu. Không bao giờ nối hậu tố alpha hex vào biến\nCSS, hay làm sáng một vai trò đã phân giải ở phía sau. Với Tag loại gốc, gắn\n`getFlowToneBadgeStyles(tone)` vào prop `style` công khai và bỏ `color`. Công thức bất biến,\nđược cache này ghép foreground/background/border của tone thay vì đặt chữ trắng gốc lên nét\nkhung/cạnh. Kiểm tra tương phản chuẩn gồm cả tám cặp chữ nhỏ ở cả hai theme với mức WCAG AA\n4.5:1; bộ component gốc minh họa màu thật của chúng. Foreground và border của tone `teal` vẫn\nlà hai vai trò riêng.\n\n\nTrạng thái chọn dùng `color.border.selected` cùng viền ngoài khi chọn; focus bàn phím dùng\nriêng `color.border.focus`, độ dày viền focus và `state.focus.offset`. Lỗi dùng khung\ndanger cùng nét đứt/dấu hiệu không dựa vào màu và nhãn lỗi đọc được. Chọn hay focus không\nđược ghi đè danh tính tone, che lỗi, hay chỉ truyền đạt bằng màu.\nHandle khi nghỉ dùng vai trò icon trung tính. Màu focus dành cho focus thật, không phải\ntrang trí luôn bật cho điểm nối.\n\n## Nội dung tùy chỉnh và kích thước\n\nDùng `getFlowNodeStyles({ tone, width, height, shape? }, state)` cho thân nút tùy chỉnh. Hàm\ngắn font ngữ nghĩa, khoảng cách, cặp màu của tone và kích thước do bên dùng sở hữu;\n`shape: 'circle'` bo tròn hẳn thân nút và `state.dashed` vẽ viền nét đứt. Giữ icon tùy chỉnh,\nlogo, nhãn, handle, ngữ nghĩa trợ năng và sự kiện trong ứng dụng. Chỉ báo loading có\ný nghĩa có thể chuyển động; hiệu ứng nút xuất hiện để trang trí, danh tính nhấp nháy, icon\nxoay khi rảnh, biến đổi khi hover, nét đứt chạy trên cạnh, gradient và hiệu ứng kính không\nthuộc theme.\n\nNội dung theo tone tùy chỉnh dùng `getFlowToneStyles(tone, part?)`; `foreground` đặt màu chữ\ncủa tone, `border` đặt màu viền và `background` đặt bề mặt đi cặp. Ký hiệu theo tone dùng\n`getFlowIconStyles(tone, options)`, với màu mặc định là màu viền của tone, không phải màu chữ.\nOptions nhận tên kích thước icon gốc hoặc kích thước số của API, một màu đã phân giải từ\nnguồn, và disabled.\nKhóa icon trạng thái (`status-success|warning|error|info|loading`) và khóa control\n(`control-expand|collapse|help`) phân giải sang các vai trò icon vận hành/trung tính riêng.\n`bh-flow-icon[data-bh-loading=\"true\"]` cung cấp chuyển động loading có ý nghĩa, có hỗ trợ\ngiảm chuyển động. Không bao giờ tạo chuyển động cho icon loại khi rảnh.\n\nVới chỉ báo quan hệ có nhãn, dùng `bh-flow-tone-mark` và `data-bh-tone=\"<FlowTone>\"`: nguồn\nquyết định hình tròn `space.075` và màu tô bằng màu viền của tone (`blue` khi không đặt).\nNhãn/số đếm phải giữ nghĩa không dựa vào màu; dấu này không truyền đạt trạng thái chạy.\n\nGói không cung cấp bảng kích thước nút, lưới hay bố cục: hình học nút thuộc về bên dùng, và\nviệc vẽ, bố cục và căn giữa theo nửa kích thước phải đọc cùng một nguồn của bên dùng. Giữ\nnguyên tọa độ đồ thị hiện có khi áp theme.\n\nTọa độ bố cục đồ thị, kích thước tự nhiên, cơ chế flex/grid và biến đổi viewport không phải\ngiá trị bảng màu. Không tùy tiện làm tròn chúng theo thang khoảng cách. Việc áp tone không\nđược đổi ID, trạng thái mở rộng, vị trí đã lưu hay ngữ nghĩa quan hệ của đồ thị.\n\nThân nút thông thường, thẻ MiniMap và khung Controls dùng `radius.100` (8 px).\nControls bo các góc nút lộ ra mà không cắt focus. Logo của nút giữ `radius.075` (6 px)\nlồng bên trong. Nút hình tròn giữ hình tròn thật, handle kết nối cũng vậy; bán kính\nđịnh tuyến cạnh vẫn là hình học đường đi. Thẻ inspector tùy chỉnh và control/thanh công cụ\nđồ thị dùng `--bh-radius-100`; hộp thọai/drawer dùng `radius.150` (12 px). Theo\n[thang radius theo vai trò](/vi/foundations/styles/radius/).\nMenu thu phóng gốc của dock dùng `radius.overlay` (8 px), độc lập với Nút gọn\nvà mục menu giữ `radius.050` (4 px). Không suy ra bán kính bề mặt menu từ bán kính\nnút cộng một độ lệch pixel cố định; quy ước này thuộc CSS đi kèm của Source.\n\nGắn tùy chọn tương phản cao của người dùng vào `data-bh-high-contrast=\"true\"` trên phần tử\n`bh-vue-flow` thật. CSS đi kèm làm dày viền focus của nút/cạnh/đường, button và\n`role=\"button\"` tùy chỉnh từ `border.width.focused` (2 px) lên `border.width.accent` (4 px),\ngiữ nguyên màu/khoảng lệch focus gốc. Không giữ công thức focus cho phần tử con do ứng dụng\ntự làm.\n\nCùng phần tử đó nhận `data-bh-large-text=\"true\"` và `data-bh-increased-spacing=\"true\"` cho\ncác tùy chọn trợ năng người dùng bật: chữ nút 1.125em, và line-height 1.6 / letter-spacing\n0.02em. Giữ binding tùy chọn thật của người dùng; không lặp CSS phần tử con tại chỗ.\n\nBên dùng `WorkflowViewer` gốc dùng `.bh-workflow-canvas` với `data-bh-contrast=\"high\"`. Công\nthức đi kèm làm đậm đường biên nút, chữ mô tả, cạnh và mũi tên bằng màu chữ đậm theo theme. Màu\nchọn và màu lỗi giữ nghĩa riêng; focus dùng độ dày viền nhấn. Bỏ thuộc tính sẽ trở về công thức\ngốc, và đổi theme khi đang bật sẽ dùng màu chữ của theme mới mà không gắn lại đồ thị. Giữ các\nthao tác điều hướng và trợ năng trong slot mở rộng `#dock` gốc của trình xem, cạnh các control\ncó sẵn, thay vì thay cả dock.\n\nThẻ thông thường có thể chủ động bật `NodeLook.sizing: 'content'`. Canvas gốc chỉ giữ cơ chế\nđộ rộng: hộp lớn theo nội dung trong khoảng `--wf-node-content-min-width` và\n`--wf-node-content-max-width`. CSS đi kèm của Source sở hữu các vai trò đó (`diagram.card.width`\nvà gấp đôi vai trò ấy) cùng toàn bộ công thức trình bày: tiêu đề/loại xuống dòng, phần đầu thẻ\ncao theo nội dung và mọi logo nguồn/đích nằm gọn trong thẻ. Không khai báo nào được định nghĩa\nở cả hai stylesheet. Giữ mọi logo; không cung cấp hình học đoán trước hay vá phần trong thẻ.\n\n`WorkflowEdge.tone` gốc độc lập với `variant`: `blue`, `red` và `green` gắn\n`--wf-edge-tone-<tone>` vào các vai trò viền nền tảng có sẵn `--bh-flow-category-task-border`,\n`--bh-flow-category-dependency-border` và `--bh-flow-category-transformation-border` của theme\nhiện tại (tên nền tảng giữ nguyên), cùng nét liền, nét đứt ngắn và gạch-chấm. Bên dùng tự ánh\nxạ các loại quan hệ của mình sang các tone này. Màu và nét đứt của tone giữ nguyên khi hover,\nchọn, trace, lỗi, có thể xảy ra và ngữ cảnh. Độ chắc chắn, ngữ cảnh và lỗi là dấu hiệu hình\ndạng, không bao giờ là mẫu nét đứt mới, đổi màu tone hay giảm độ mờ, nên mỗi nét đứt của tone\nvẫn là duy nhất (WCAG 1.4.1/1.4.11):\n\n- **Có thể xảy ra** (`certainty: 'possible'`, ứng viên tuyến động hoặc nhánh SWITCH): hình thoi\n nhỏ rỗng ở đầu nguồn, theo dấu luồng có điều kiện của BPMN 2.0.\n- **Ngữ cảnh** (`context: true`, ngữ cảnh breadcrumb được giữ lại): mũi tên mở kiểu UML và nét\n nghỉ mảnh hơn `--wf-edge-context-width`, biến riêng của gói gắn vào `border.width.default`\n của nền tảng; khi làm nổi bật vẫn dày lên như thường.\n- **Lỗi có tone** (`variant: 'failure'` có tone): màu và nét đứt của tone, cùng dấu Lucide\n `CircleX` tô bằng `color.icon.danger` (`--wf-edge-failure-icon`) cạnh nhãn cạnh. Dấu này chỉ\n để trang trí (`aria-hidden`); tên jump và chú giải vẫn giữ chữ. Lỗi không có tone giữ màu lỗi\n và nét đứt `5 4`.\n\nCó thể xảy ra và ngữ cảnh có thể kết hợp. Truyền tên nhóm đã bản địa hóa qua `familyLabel`:\nchip và danh sách jump có tên `{family} jump to {target}`, đánh số `(n of m)` khi các jump song\nsong trùng tên. Bản địa hóa toàn bộ tên, cách đánh số và tiêu đề danh sách qua `texts.jumps`\n(`WorkflowJumpTexts`) của trình xem, giữ từ chỉ nhóm ở đầu; tên nhóm đã dịch nằm trong câu mặc\nđịnh tiếng Anh chưa phải là tên đã bản địa hóa. Nguồn: `packages/vueflow-tokens/src/styles.css`\nvà cạnh gốc của `workflow-canvas`. Các binding này không chứng minh hình ảnh: kiểm tra thủ công\ncả hai theme, dấu có thể xảy ra/ngữ cảnh/lỗi, tên jump với trình đọc màn hình và ảnh PNG xuất ra.\n\n**Khung nhóm.** Một nhóm gốc (`WorkflowNode.group`, node dựng sẵn `wf-group`) là thẻ của node\nlàm phần đầu, kèm nút tròn mở rộng/thu gọn; khi mở rộng, các node con nằm trong khung bên dưới\nphần đầu. Companion gắn khung vào các biến riêng của gói `--wf-group-*`, mỗi biến trỏ tới một\nvai trò nền tảng có sẵn: viền `color.border`, độ dày viền `border.width.default`, bo góc\n`radius.card`, nền `color.surface.subtle` và, với khung lồng trong khung,\n`color.background.neutral` để các cấp tách bạch; khoảng đệm `space.stack` và khoảng cách dưới\nphần đầu `space.150`. Không có token nền tảng riêng cho đồ thị nào đứng sau chúng. Bố cục gốc đọc\n`--wf-group-padding` và `--wf-group-header-gap` từ canvas, nên giữ cả hai là độ dài thuần. Chế\nđộ tương phản cao vẽ viền khung bằng màu chữ. Khung là vùng chứa, không phải tone hay trạng\nthái chạy: không tô khung theo tone hay trạng thái.\n\n**Khung chọn.** Giữ Shift và kéo trên vùng trống của canvas gốc sẽ vẽ một khung chọn các thẻ nó\nchạm tới (khung nhóm đang mở chỉ khi nằm trọn bên trong). Companion gắn khung chọn vào cùng công\nthức chọn với `.bh-vue-flow .vue-flow__selection`: khung trong suốt (không tô nền, để vẫn thấy các\nnode đã quét qua) với viền nét đứt `border.width.selected` màu `color.border.focus`, ở cả theme sáng và tối. Lựa chọn vẫn dùng\nvòng chọn của node; khung chọn không bao giờ là dấu hiệu loại hay trạng thái chạy.\n\n**Ô tìm kiếm.** Ô tìm kiếm của viewer gốc (`/` hoặc nút Tìm trên dock) là một lớp phủ gồm ô nhập\ntìm kiếm và các dòng kết quả. Companion gắn `--wf-find-*` và các vai trò dùng chung `--wf-list-*`:\n`color.surface.overlay`, `elevation.shadow.overlay` và `radius.overlay`, không có viền (lớp phủ\ntách khỏi trang bằng nền và bóng) và một đường phân cách `color.border` dưới ô nhập. Ô nhập và\ntrạng thái trống dùng `font.body.default`, chữ gợi ý `color.text.subtlest`, trạng thái trống\n`color.text.subtle`. Mỗi dòng dùng `font.label.default` cho tên node, khoảng đệm `space.075` /\n`space.item.x`, cao tối thiểu `size.control.default` (`size.target.touch` với con trỏ thô và\ndưới 768 px) và bo góc `radius.item`; nhãn loại sau tên là `font.body.small` màu\n`color.text.subtle`, node không có tên hiện mã định danh bằng `font.code.default`. Tên xuống dòng\nở ranh giới từ và không bao giờ bị cắt bớt; chỉ một từ rộng hơn cả dòng mới bị ngắt. Các dòng\ndùng trạng thái mục trong lớp phủ, mỗi trạng thái cách nhau một bậc: dòng dưới con trỏ\n`color.surface.overlay.hover`; dòng đang chọn bằng bàn phím `color.surface.overlay.selected`\nkèm thanh đầu dòng `border.width.selected` màu `color.border.selected` làm dấu hiệu không dựa vào\nmàu; dòng đó khi rê chuột `color.surface.overlay.selected.hover`. Chữ giữ nguyên màu ở mọi trạng\nthái; mọi cặp màu đều nằm trong danh sách kiểm tra tương phản. Tiêu điểm là vòng tiêu điểm của ô\nnhập bao quanh cả ô (`border.width.focused`, `color.border.focus`, `state.focus.offset`). Khi\nmột dòng nằm dưới con trỏ hoặc được chọn bằng ↓ / ↑, canvas xem trước node của dòng đó bằng trạng\nthái hover sẵn có và vòng ngoài của node (`diagram.selection-ring`); việc xem trước kết thúc khi\ncon trỏ rời danh sách, từ khóa thay đổi hoặc ô đóng lại, và không bao giờ đổi lựa chọn, đường\ntruy vết hay khung nhìn (node nằm ngoài màn hình không được kéo vào). Không tạo kiểu lại ô này\ncho từng viewer.\n\nTiêu đề và nhãn loại trong hình thoi và hình elip chỉ xuống dòng ở ranh giới từ và không bao giờ\nbị cắt bớt: khoảng đệm hai bên của chúng theo chiều rộng, nên ngắt giữa từ sẽ đọc thành hai từ và\ndấu lược sẽ che mất tên của chính nút đó. Chỉ một từ rộng hơn cả vùng nội dung mới bị ngắt. Thẻ\nthông thường vẫn có thể ngắt một tiêu đề dài liền mạch ở bất kỳ đâu.\n\n## Cạnh, control và xuất ảnh\n\n`styleTargetEdge(edge, nodes, toneOf?)` giữ danh tính đích của cạnh có hướng trên cả nét và\nmũi tên theo tone của nút đích (`toneOf(node)`, `blue` khi bỏ qua hoặc khi không có nút đích),\ngiữ dữ liệu khác của cạnh và tắt chuyển động chạy dọc trang trí. Ứng dụng có thể giữ nét đứt để\ntruyền đạt ngữ nghĩa quan hệ của riêng mình. Trình vẽ cạnh tùy chỉnh phải dùng nét được cung\ncấp thay vì thay bằng bảng màu cạnh không liên quan. `FLOW_EDGE` gom độ dày, kích thước mũi\ntên, bán kính đường và kích thước handle.\n\nĐường cạnh tùy chỉnh dùng `getFlowEdgeStyles(tone, suppliedStyle?)` cho toàn bộ công thức\ntrình bày SVG. Nó ưu tiên nét đích có hướng được cung cấp hơn màu dự phòng của tone, giữ nét\nđứt tĩnh được cung cấp, dùng `FLOW_EDGE.width`, không tô và nét không co giãn; bên dùng quyết\nđịnh nét đứt mang nghĩa gì.\nTọa độ đường, hình mũi tên và chiều quan hệ vẫn là hình học đồ thị.\nStyle cạnh và style container nút dùng kiểu `Styles` công khai của VueFlow, kể cả biến\ntheme tùy chỉnh. Hàm đơn giản hóa chi tiết nhận và trả về đúng quy ước gốc đó; ứng dụng\nkhông cần ép kiểu hay chép object style để gán.\n`styleTargetEdge` giữ loại mũi tên mở/đóng chỉ định rõ. `createVueFlowTheme({ nodeTone })`\ntô nút MiniMap theo cùng cách (`blue` theo mặc định).\n\nCSS đi kèm nhắm tới nút core/mặc định, handle, nhãn cạnh, vùng chọn, nút Controls và bề mặt\nMiniMap thật của VueFlow. Controls giữ trạng thái thường, hover, vô hiệu và focus, và lớn lên\nthành vùng chạm gốc với con trỏ thô. Import sau CSS upstream; bỏ các quy tắc tô core/\ncontrols/minimap toàn cục cạnh tranh của bên dùng thay vì tăng độ ưu tiên selector.\n\nXuất ảnh với theme và font hiện tại từ bề mặt đồ thị đã đo. Không ép nền trắng hay bảng\nmàu font hệ thống độc lập. Giữ nguyên snapshot/fit/khôi phục, lọc overlay, phản hồi độ phân\ngiải và xử lý dự phòng khi chụp. Kiểm tra ảnh xuất thật, không chỉ việc gọi chụp thành công.\n\nToàn màn hình đồ thị dùng stacking context cục bộ cô lập ở `z-index.modal` (400), như các\nbề mặt toàn màn hình khác, để inspector toàn cục mở từ đó vẫn nằm trên nó. Thứ tự khung con\nriêng như z10/z15 nằm trong context đó; không gán 1001/1002 toàn cục cho control đồ thị.\nKiểm tra thứ tự inspector/hộp thọai thật, Escape và việc trả focus.\n\n`getFlowDetailStyles(level, suppliedStyle)` bỏ bóng ở mức chi tiết tối thiểu; mức basic và\ndetailed trả lại style được cung cấp không đổi. Nó không bao giờ giảm độ mờ: trạng thái\nnút, tương phản chữ, focus và ngữ nghĩa tone phải đọc được ở mọi mức zoom. Ngưỡng\nviewport, metadata, vị trí đã đo và lịch xử lý vẫn là logic của bên dùng; không được bỏ\nnút, quan hệ hay trường dữ liệu nào.\n\n## Kiểm tra\n\nThử sáng và tối, tiếng Anh và tiếng Việt, nút vừa chọn vừa focus và nút lỗi, nhãn dài, kích\nthước do bên dùng sở hữu, mũi tên màu theo đích, zoom/snap/fit, nhóm mở rộng, vòng lặp, phần tử\nchứa hẹp và toàn màn hình, thoát bằng ESC, Controls, MiniMap và xuất ảnh. Tính tương phản\ncho cặp foreground/background thật và các viền có ý nghĩa trong mỗi theme đã render; chỉ\nriêng token gốc và cấu hình có kiểu không chứng minh được trợ năng hay hình ảnh.\n",
|
|
4465
|
-
"raw": "---\ntitle: Theme VueFlow\ndescription: \"Tone màu chung của đồ thị theo token gốc, theme đi cặp và tích hợp VueFlow 1.\"\norder: 5\n---\n\n`@beehexa/vueflow-tokens` chuyển token chính thức sang VueFlow 1. Gói không chép mã nguồn\nVueFlow, không đóng gói Vue, không sinh dữ liệu đồ thị và không đổi chiều quan hệ.\n\n## Cài đặt và áp dụng\n\nCài gói này, `@beehexa/design-tokens`, Vue 3, và các peer core, controls, minimap của\nVueFlow 1. Nạp CSS core, theme, controls và minimap của upstream trong entry đồ thị lazy,\ntrước CSS của adapter; nạp CSS design token gốc một lần với root 16px/chữ thân 14px.\nCác gói nguồn cục bộ vẫn là `0.0.0` riêng tư; đó không phải một bản phát hành registry.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nFactory trả về các biến theo phạm vi, binding viewport có kiểu `FlowProps` (không dùng\n`FlowOptions` đã ngừng hỗ trợ), và binding cho Background/MiniMap. Nó lấy giá trị sáng\ncùng phần ghi đè tối và các phương án chữ tiếng Việt từ gói token. Tính lại khi theme hoặc\nngôn ngữ đổi. Giữ handler ready/error và fit đồ thị với padding `0.2` khi phần tử chứa đo\nđược hoặc đổi kích thước. Dùng đúng tùy chọn `fitViewOnInit` thật của VueFlow 1; không\ntruyền tên tùy chọn viewport tự đặt.\n\n## Tone màu không phải trạng thái\n\n`FlowTone` (`FLOW_TONES`) đặt tên tám tone màu chung: `blue`, `red`, `green`, `crimson`,\n`yellow`, `teal`, `magenta` và `purple`. Mỗi tone đọc một bộ vai trò `flow.category.*` có sẵn\ncủa nền tảng; các khóa nền tảng giữ nguyên tên, và gói không gán nghĩa nào cho tone. Bên dùng\ntự quyết định loại nút hay loại quan hệ nào của mình dùng tone nào. Tone không được hiểu là\nthành công, thất bại hay cảnh báo. Giữ nhãn loại và icon của nút; màu không bao giờ là cách\nnhận diện duy nhất, và tone không xác nhận trạng thái của một lần chạy.\n\nMỗi tone cung cấp `foreground`, `background`, `border` và `hover` như một vai trò sáng/tối đi\ncặp, không trong suốt. Dùng `getFlowTonePalette(tone)` cho binding dựa trên CSS; `border` của\nnó là danh tính khung/cạnh. Các vai trò gốc này thay cho bảng màu lịch sử do ứng dụng tự giữ,\nlớp phủ alpha, gradient và hàm chỉnh bảng màu. Không bao giờ nối hậu tố alpha hex vào biến\nCSS, hay làm sáng một vai trò đã phân giải ở phía sau. Với Tag loại gốc, gắn\n`getFlowToneBadgeStyles(tone)` vào prop `style` công khai và bỏ `color`. Công thức bất biến,\nđược cache này ghép foreground/background/border của tone thay vì đặt chữ trắng gốc lên nét\nkhung/cạnh. Kiểm tra tương phản chuẩn gồm cả tám cặp chữ nhỏ ở cả hai theme với mức WCAG AA\n4.5:1; bộ component gốc minh họa màu thật của chúng. Foreground và border của tone `teal` vẫn\nlà hai vai trò riêng.\n\n\nTrạng thái chọn dùng `color.border.selected` cùng viền ngoài khi chọn; focus bàn phím dùng\nriêng `color.border.focus`, độ dày viền focus và `state.focus.offset`. Lỗi dùng khung\ndanger cùng nét đứt/dấu hiệu không dựa vào màu và nhãn lỗi đọc được. Chọn hay focus không\nđược ghi đè danh tính tone, che lỗi, hay chỉ truyền đạt bằng màu.\nHandle khi nghỉ dùng vai trò icon trung tính. Màu focus dành cho focus thật, không phải\ntrang trí luôn bật cho điểm nối.\n\n## Nội dung tùy chỉnh và kích thước\n\nDùng `getFlowNodeStyles({ tone, width, height, shape? }, state)` cho thân nút tùy chỉnh. Hàm\ngắn font ngữ nghĩa, khoảng cách, cặp màu của tone và kích thước do bên dùng sở hữu;\n`shape: 'circle'` bo tròn hẳn thân nút và `state.dashed` vẽ viền nét đứt. Giữ icon tùy chỉnh,\nlogo, nhãn, handle, ngữ nghĩa trợ năng và sự kiện trong ứng dụng. Chỉ báo loading có\ný nghĩa có thể chuyển động; hiệu ứng nút xuất hiện để trang trí, danh tính nhấp nháy, icon\nxoay khi rảnh, biến đổi khi hover, nét đứt chạy trên cạnh, gradient và hiệu ứng kính không\nthuộc theme.\n\nNội dung theo tone tùy chỉnh dùng `getFlowToneStyles(tone, part?)`; `foreground` đặt màu chữ\ncủa tone, `border` đặt màu viền và `background` đặt bề mặt đi cặp. Ký hiệu theo tone dùng\n`getFlowIconStyles(tone, options)`, với màu mặc định là màu viền của tone, không phải màu chữ.\nOptions nhận tên kích thước icon gốc hoặc kích thước số của API, một màu đã phân giải từ\nnguồn, và disabled.\nKhóa icon trạng thái (`status-success|warning|error|info|loading`) và khóa control\n(`control-expand|collapse|help`) phân giải sang các vai trò icon vận hành/trung tính riêng.\n`bh-flow-icon[data-bh-loading=\"true\"]` cung cấp chuyển động loading có ý nghĩa, có hỗ trợ\ngiảm chuyển động. Không bao giờ tạo chuyển động cho icon loại khi rảnh.\n\nVới chỉ báo quan hệ có nhãn, dùng `bh-flow-tone-mark` và `data-bh-tone=\"<FlowTone>\"`: nguồn\nquyết định hình tròn `space.075` và màu tô bằng màu viền của tone (`blue` khi không đặt).\nNhãn/số đếm phải giữ nghĩa không dựa vào màu; dấu này không truyền đạt trạng thái chạy.\n\nGói không cung cấp bảng kích thước nút, lưới hay bố cục: hình học nút thuộc về bên dùng, và\nviệc vẽ, bố cục và căn giữa theo nửa kích thước phải đọc cùng một nguồn của bên dùng. Giữ\nnguyên tọa độ đồ thị hiện có khi áp theme.\n\nTọa độ bố cục đồ thị, kích thước tự nhiên, cơ chế flex/grid và biến đổi viewport không phải\ngiá trị bảng màu. Không tùy tiện làm tròn chúng theo thang khoảng cách. Việc áp tone không\nđược đổi ID, trạng thái mở rộng, vị trí đã lưu hay ngữ nghĩa quan hệ của đồ thị.\n\nThân nút thông thường, thẻ MiniMap và khung Controls dùng `radius.100` (8 px).\nControls bo các góc nút lộ ra mà không cắt focus. Logo của nút giữ `radius.075` (6 px)\nlồng bên trong. Nút hình tròn giữ hình tròn thật, handle kết nối cũng vậy; bán kính\nđịnh tuyến cạnh vẫn là hình học đường đi. Thẻ inspector tùy chỉnh và control/thanh công cụ\nđồ thị dùng `--bh-radius-100`; hộp thọai/drawer dùng `radius.150` (12 px). Theo\n[thang radius theo vai trò](/vi/foundations/styles/radius/).\nMenu thu phóng gốc của dock dùng `radius.overlay` (8 px), độc lập với Nút gọn\nvà mục menu giữ `radius.050` (4 px). Không suy ra bán kính bề mặt menu từ bán kính\nnút cộng một độ lệch pixel cố định; quy ước này thuộc CSS đi kèm của Source.\n\nGắn tùy chọn tương phản cao của người dùng vào `data-bh-high-contrast=\"true\"` trên phần tử\n`bh-vue-flow` thật. CSS đi kèm làm dày viền focus của nút/cạnh/đường, button và\n`role=\"button\"` tùy chỉnh từ `border.width.focused` (2 px) lên `border.width.accent` (4 px),\ngiữ nguyên màu/khoảng lệch focus gốc. Không giữ công thức focus cho phần tử con do ứng dụng\ntự làm.\n\nCùng phần tử đó nhận `data-bh-large-text=\"true\"` và `data-bh-increased-spacing=\"true\"` cho\ncác tùy chọn trợ năng người dùng bật: chữ nút 1.125em, và line-height 1.6 / letter-spacing\n0.02em. Giữ binding tùy chọn thật của người dùng; không lặp CSS phần tử con tại chỗ.\n\nBên dùng `WorkflowViewer` gốc dùng `.bh-workflow-canvas` với `data-bh-contrast=\"high\"`. Công\nthức đi kèm làm đậm đường biên nút, chữ mô tả, cạnh và mũi tên bằng màu chữ đậm theo theme. Màu\nchọn và màu lỗi giữ nghĩa riêng; focus dùng độ dày viền nhấn. Bỏ thuộc tính sẽ trở về công thức\ngốc, và đổi theme khi đang bật sẽ dùng màu chữ của theme mới mà không gắn lại đồ thị. Giữ các\nthao tác điều hướng và trợ năng trong slot mở rộng `#dock` gốc của trình xem, cạnh các control\ncó sẵn, thay vì thay cả dock.\n\nThẻ thông thường có thể chủ động bật `NodeLook.sizing: 'content'`. Canvas gốc chỉ giữ cơ chế\nđộ rộng: hộp lớn theo nội dung trong khoảng `--wf-node-content-min-width` và\n`--wf-node-content-max-width`. CSS đi kèm của Source sở hữu các vai trò đó (`diagram.card.width`\nvà gấp đôi vai trò ấy) cùng toàn bộ công thức trình bày: tiêu đề/loại xuống dòng, phần đầu thẻ\ncao theo nội dung và mọi logo nguồn/đích nằm gọn trong thẻ. Không khai báo nào được định nghĩa\nở cả hai stylesheet. Giữ mọi logo; không cung cấp hình học đoán trước hay vá phần trong thẻ.\n\n`WorkflowEdge.tone` gốc độc lập với `variant`: `blue`, `red` và `green` gắn\n`--wf-edge-tone-<tone>` vào các vai trò viền nền tảng có sẵn `--bh-flow-category-task-border`,\n`--bh-flow-category-dependency-border` và `--bh-flow-category-transformation-border` của theme\nhiện tại (tên nền tảng giữ nguyên), cùng nét liền, nét đứt ngắn và gạch-chấm. Bên dùng tự ánh\nxạ các loại quan hệ của mình sang các tone này. Màu và nét đứt của tone giữ nguyên khi hover,\nchọn, trace, lỗi, có thể xảy ra và ngữ cảnh. Độ chắc chắn, ngữ cảnh và lỗi là dấu hiệu hình\ndạng, không bao giờ là mẫu nét đứt mới, đổi màu tone hay giảm độ mờ, nên mỗi nét đứt của tone\nvẫn là duy nhất (WCAG 1.4.1/1.4.11):\n\n- **Có thể xảy ra** (`certainty: 'possible'`, ứng viên tuyến động hoặc nhánh SWITCH): hình thoi\n nhỏ rỗng ở đầu nguồn, theo dấu luồng có điều kiện của BPMN 2.0.\n- **Ngữ cảnh** (`context: true`, ngữ cảnh breadcrumb được giữ lại): mũi tên mở kiểu UML và nét\n nghỉ mảnh hơn `--wf-edge-context-width`, biến riêng của gói gắn vào `border.width.default`\n của nền tảng; khi làm nổi bật vẫn dày lên như thường.\n- **Lỗi có tone** (`variant: 'failure'` có tone): màu và nét đứt của tone, cùng dấu Lucide\n `CircleX` tô bằng `color.icon.danger` (`--wf-edge-failure-icon`) cạnh nhãn cạnh. Dấu này chỉ\n để trang trí (`aria-hidden`); tên jump và chú giải vẫn giữ chữ. Lỗi không có tone giữ màu lỗi\n và nét đứt `5 4`.\n\nCó thể xảy ra và ngữ cảnh có thể kết hợp. Truyền tên nhóm đã bản địa hóa qua `familyLabel`:\nchip và danh sách jump có tên `{family} jump to {target}`, đánh số `(n of m)` khi các jump song\nsong trùng tên. Bản địa hóa toàn bộ tên, cách đánh số và tiêu đề danh sách qua `texts.jumps`\n(`WorkflowJumpTexts`) của trình xem, giữ từ chỉ nhóm ở đầu; tên nhóm đã dịch nằm trong câu mặc\nđịnh tiếng Anh chưa phải là tên đã bản địa hóa. Nguồn: `packages/vueflow-tokens/src/styles.css`\nvà cạnh gốc của `workflow-canvas`. Các binding này không chứng minh hình ảnh: kiểm tra thủ công\ncả hai theme, dấu có thể xảy ra/ngữ cảnh/lỗi, tên jump với trình đọc màn hình và ảnh PNG xuất ra.\n\n**Khung nhóm.** Một nhóm gốc (`WorkflowNode.group`, node dựng sẵn `wf-group`) là thẻ của node\nlàm phần đầu, kèm nút tròn mở rộng/thu gọn; khi mở rộng, các node con nằm trong khung bên dưới\nphần đầu. Companion gắn khung vào các biến riêng của gói `--wf-group-*`, mỗi biến trỏ tới một\nvai trò nền tảng có sẵn: viền `color.border`, độ dày viền `border.width.default`, bo góc\n`radius.card`, nền `color.surface.subtle` và, với khung lồng trong khung,\n`color.background.neutral` để các cấp tách bạch; khoảng đệm `space.stack` và khoảng cách dưới\nphần đầu `space.150`. Không có token nền tảng riêng cho đồ thị nào đứng sau chúng. Bố cục gốc đọc\n`--wf-group-padding` và `--wf-group-header-gap` từ canvas, nên giữ cả hai là độ dài thuần. Chế\nđộ tương phản cao vẽ viền khung bằng màu chữ. Khung là vùng chứa, không phải tone hay trạng\nthái chạy: không tô khung theo tone hay trạng thái.\n\n**Khung chọn.** Giữ Shift và kéo trên vùng trống của canvas gốc sẽ vẽ một khung chọn các thẻ nó\nchạm tới (khung nhóm đang mở chỉ khi nằm trọn bên trong). Companion gắn khung chọn vào cùng công\nthức chọn với `.bh-vue-flow .vue-flow__selection`: khung trong suốt (không tô nền, để vẫn thấy các\nnode đã quét qua) với viền nét đứt `border.width.selected` màu `color.border.focus`, ở cả theme sáng và tối. Lựa chọn vẫn dùng\nvòng chọn của node; khung chọn không bao giờ là dấu hiệu loại hay trạng thái chạy.\n\n**Ô tìm kiếm.** Ô tìm kiếm của viewer gốc (`/` hoặc nút Tìm trên dock) là một lớp phủ gồm ô nhập\ntìm kiếm và các dòng kết quả. Companion gắn `--wf-find-*` và các vai trò dùng chung `--wf-list-*`:\n`color.surface.overlay`, `elevation.shadow.overlay` và `radius.overlay`, không có viền (lớp phủ\ntách khỏi trang bằng nền và bóng) và một đường phân cách `color.border` dưới ô nhập. Ô nhập và\ntrạng thái trống dùng `font.body.default`, chữ gợi ý `color.text.subtlest`, trạng thái trống\n`color.text.subtle`. Mỗi dòng dùng `font.label.default` cho tên node, khoảng đệm `space.075` /\n`space.item.x`, cao tối thiểu `size.control.default` (`size.target.touch` với con trỏ thô và\ndưới 768 px) và bo góc `radius.item`; nhãn loại sau tên là `font.body.small` màu\n`color.text.subtle`, node không có tên hiện mã định danh bằng `font.code.default`. Tên xuống dòng\nở ranh giới từ và không bao giờ bị cắt bớt; chỉ một từ rộng hơn cả dòng mới bị ngắt. Các dòng\ndùng trạng thái mục trong lớp phủ, mỗi trạng thái cách nhau một bậc: dòng dưới con trỏ\n`color.surface.overlay.hover`; dòng đang chọn bằng bàn phím `color.surface.overlay.selected`\nkèm thanh đầu dòng `border.width.selected` màu `color.border.selected` làm dấu hiệu không dựa vào\nmàu; dòng đó khi rê chuột `color.surface.overlay.selected.hover`. Chữ giữ nguyên màu ở mọi trạng\nthái; mọi cặp màu đều nằm trong danh sách kiểm tra tương phản. Tiêu điểm là vòng tiêu điểm của ô\nnhập bao quanh cả ô (`border.width.focused`, `color.border.focus`, `state.focus.offset`). Khi\nmột dòng nằm dưới con trỏ hoặc được chọn bằng ↓ / ↑, canvas xem trước node của dòng đó bằng trạng\nthái hover sẵn có và vòng ngoài của node (`diagram.selection-ring`); việc xem trước kết thúc khi\ncon trỏ rời danh sách, từ khóa thay đổi hoặc ô đóng lại, và không bao giờ đổi lựa chọn, đường\ntruy vết hay khung nhìn (node nằm ngoài màn hình không được kéo vào). Không tạo kiểu lại ô này\ncho từng viewer.\n\nTiêu đề và nhãn loại trong hình thoi và hình elip chỉ xuống dòng ở ranh giới từ và không bao giờ\nbị cắt bớt: khoảng đệm hai bên của chúng theo chiều rộng, nên ngắt giữa từ sẽ đọc thành hai từ và\ndấu lược sẽ che mất tên của chính nút đó. Chỉ một từ rộng hơn cả vùng nội dung mới bị ngắt. Thẻ\nthông thường vẫn có thể ngắt một tiêu đề dài liền mạch ở bất kỳ đâu.\n\n## Cạnh, control và xuất ảnh\n\n`styleTargetEdge(edge, nodes, toneOf?)` giữ danh tính đích của cạnh có hướng trên cả nét và\nmũi tên theo tone của nút đích (`toneOf(node)`, `blue` khi bỏ qua hoặc khi không có nút đích),\ngiữ dữ liệu khác của cạnh và tắt chuyển động chạy dọc trang trí. Ứng dụng có thể giữ nét đứt để\ntruyền đạt ngữ nghĩa quan hệ của riêng mình. Trình vẽ cạnh tùy chỉnh phải dùng nét được cung\ncấp thay vì thay bằng bảng màu cạnh không liên quan. `FLOW_EDGE` gom độ dày, kích thước mũi\ntên, bán kính đường và kích thước handle.\n\nĐường cạnh tùy chỉnh dùng `getFlowEdgeStyles(tone, suppliedStyle?)` cho toàn bộ công thức\ntrình bày SVG. Nó ưu tiên nét đích có hướng được cung cấp hơn màu dự phòng của tone, giữ nét\nđứt tĩnh được cung cấp, dùng `FLOW_EDGE.width`, không tô và nét không co giãn; bên dùng quyết\nđịnh nét đứt mang nghĩa gì.\nTọa độ đường, hình mũi tên và chiều quan hệ vẫn là hình học đồ thị.\nStyle cạnh và style container nút dùng kiểu `Styles` công khai của VueFlow, kể cả biến\ntheme tùy chỉnh. Hàm đơn giản hóa chi tiết nhận và trả về đúng quy ước gốc đó; ứng dụng\nkhông cần ép kiểu hay chép object style để gán.\n`styleTargetEdge` giữ loại mũi tên mở/đóng chỉ định rõ. `createVueFlowTheme({ nodeTone })`\ntô nút MiniMap theo cùng cách (`blue` theo mặc định).\n\nCSS đi kèm nhắm tới nút core/mặc định, handle, nhãn cạnh, vùng chọn, nút Controls và bề mặt\nMiniMap thật của VueFlow. Controls giữ trạng thái thường, hover, vô hiệu và focus, và lớn lên\nthành vùng chạm gốc với con trỏ thô. Import sau CSS upstream; bỏ các quy tắc tô core/\ncontrols/minimap toàn cục cạnh tranh của bên dùng thay vì tăng độ ưu tiên selector.\n\nXuất ảnh với theme và font hiện tại từ bề mặt đồ thị đã đo. Không ép nền trắng hay bảng\nmàu font hệ thống độc lập. Giữ nguyên snapshot/fit/khôi phục, lọc overlay, phản hồi độ phân\ngiải và xử lý dự phòng khi chụp. Kiểm tra ảnh xuất thật, không chỉ việc gọi chụp thành công.\n\nToàn màn hình đồ thị dùng stacking context cục bộ cô lập ở `z-index.modal` (400), như các\nbề mặt toàn màn hình khác, để inspector toàn cục mở từ đó vẫn nằm trên nó. Thứ tự khung con\nriêng như z10/z15 nằm trong context đó; không gán 1001/1002 toàn cục cho control đồ thị.\nKiểm tra thứ tự inspector/hộp thọai thật, Escape và việc trả focus.\n\n`getFlowDetailStyles(level, suppliedStyle)` bỏ bóng ở mức chi tiết tối thiểu; mức basic và\ndetailed trả lại style được cung cấp không đổi. Nó không bao giờ giảm độ mờ: trạng thái\nnút, tương phản chữ, focus và ngữ nghĩa tone phải đọc được ở mọi mức zoom. Ngưỡng\nviewport, metadata, vị trí đã đo và lịch xử lý vẫn là logic của bên dùng; không được bỏ\nnút, quan hệ hay trường dữ liệu nào.\n\n## Kiểm tra\n\nThử sáng và tối, tiếng Anh và tiếng Việt, nút vừa chọn vừa focus và nút lỗi, nhãn dài, kích\nthước do bên dùng sở hữu, mũi tên màu theo đích, zoom/snap/fit, nhóm mở rộng, vòng lặp, phần tử\nchứa hẹp và toàn màn hình, thoát bằng ESC, Controls, MiniMap và xuất ảnh. Tính tương phản\ncho cặp foreground/background thật và các viền có ý nghĩa trong mỗi theme đã render; chỉ\nriêng token gốc và cấu hình có kiểu không chứng minh được trợ năng hay hình ảnh.\n",
|
|
4464
|
+
"body": "\n`@beehexa/vueflow-tokens` chuyển token chính thức sang VueFlow 1. Gói không chép mã nguồn\nVueFlow, không đóng gói Vue, không sinh dữ liệu đồ thị và không đổi chiều quan hệ.\n\n## Cài đặt và áp dụng\n\nCài gói này, `@beehexa/design-tokens`, Vue 3, và các peer core, controls, minimap của\nVueFlow 1. Nạp CSS core, theme, controls và minimap của upstream trong entry đồ thị lazy,\ntrước CSS của adapter; nạp CSS design token gốc một lần với root 16px/chữ thân 14px.\nCác gói nguồn cục bộ vẫn là `0.0.0` riêng tư; đó không phải một bản phát hành registry.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nFactory trả về các biến theo phạm vi, binding viewport có kiểu `FlowProps` (không dùng\n`FlowOptions` đã ngừng hỗ trợ), và binding cho Background/MiniMap. Nó lấy giá trị sáng\ncùng phần ghi đè tối và các phương án chữ tiếng Việt từ gói token. Tính lại khi theme hoặc\nngôn ngữ đổi. Giữ handler ready/error và fit đồ thị với padding `0.2` khi phần tử chứa đo\nđược hoặc đổi kích thước. Dùng đúng tùy chọn `fitViewOnInit` thật của VueFlow 1; không\ntruyền tên tùy chọn viewport tự đặt.\n\n## Tone màu không phải trạng thái\n\n`FlowTone` (`FLOW_TONES`) đặt tên tám tone màu chung: `blue`, `red`, `green`, `crimson`,\n`yellow`, `teal`, `magenta` và `purple`. Mỗi tone đọc một bộ vai trò `flow.category.*` có sẵn\ncủa nền tảng; các khóa nền tảng giữ nguyên tên, và gói không gán nghĩa nào cho tone. Bên dùng\ntự quyết định loại nút hay loại quan hệ nào của mình dùng tone nào. Tone không được hiểu là\nthành công, thất bại hay cảnh báo. Giữ nhãn loại và icon của nút; màu không bao giờ là cách\nnhận diện duy nhất, và tone không xác nhận trạng thái của một lần chạy.\n\nMỗi tone cung cấp `foreground`, `background`, `border` và `hover` như một vai trò sáng/tối đi\ncặp, không trong suốt. Dùng `getFlowTonePalette(tone)` cho binding dựa trên CSS; `border` của\nnó là danh tính khung/cạnh. Các vai trò gốc này thay cho bảng màu lịch sử do ứng dụng tự giữ,\nlớp phủ alpha, gradient và hàm chỉnh bảng màu. Không bao giờ nối hậu tố alpha hex vào biến\nCSS, hay làm sáng một vai trò đã phân giải ở phía sau. Với Tag loại gốc, gắn\n`getFlowToneBadgeStyles(tone)` vào prop `style` công khai và bỏ `color`. Công thức bất biến,\nđược cache này ghép foreground/background/border của tone thay vì đặt chữ trắng gốc lên nét\nkhung/cạnh. Kiểm tra tương phản chuẩn gồm cả tám cặp chữ nhỏ ở cả hai theme với mức WCAG AA\n4.5:1; bộ component gốc minh họa màu thật của chúng. Foreground và border của tone `teal` vẫn\nlà hai vai trò riêng.\n\n\nTrạng thái chọn dùng `color.border.selected` cùng viền ngoài khi chọn; focus bàn phím dùng\nriêng `color.border.focus`, độ dày viền focus và `state.focus.offset`. Lỗi dùng khung\ndanger cùng nét đứt/dấu hiệu không dựa vào màu và nhãn lỗi đọc được. Chọn hay focus không\nđược ghi đè danh tính tone, che lỗi, hay chỉ truyền đạt bằng màu.\nHandle khi nghỉ dùng vai trò icon trung tính. Màu focus dành cho focus thật, không phải\ntrang trí luôn bật cho điểm nối.\n\n## Nội dung tùy chỉnh và kích thước\n\nDùng `getFlowNodeStyles({ tone, width, height, shape? }, state)` cho thân nút tùy chỉnh. Hàm\ngắn font ngữ nghĩa, khoảng cách, cặp màu của tone và kích thước do bên dùng sở hữu;\n`shape: 'circle'` bo tròn hẳn thân nút và `state.dashed` vẽ viền nét đứt. Giữ icon tùy chỉnh,\nlogo, nhãn, handle, ngữ nghĩa trợ năng và sự kiện trong ứng dụng. Chỉ báo loading có\ný nghĩa có thể chuyển động; hiệu ứng nút xuất hiện để trang trí, danh tính nhấp nháy, icon\nxoay khi rảnh, biến đổi khi hover, nét đứt chạy trên cạnh, gradient và hiệu ứng kính không\nthuộc theme.\n\nNội dung theo tone tùy chỉnh dùng `getFlowToneStyles(tone, part?)`; `foreground` đặt màu chữ\ncủa tone, `border` đặt màu viền và `background` đặt bề mặt đi cặp. Ký hiệu theo tone dùng\n`getFlowIconStyles(tone, options)`, với màu mặc định là màu viền của tone, không phải màu chữ.\nOptions nhận tên kích thước icon gốc hoặc kích thước số của API, một màu đã phân giải từ\nnguồn, và disabled.\nKhóa icon trạng thái (`status-success|warning|error|info|loading`) và khóa control\n(`control-expand|collapse|help`) phân giải sang các vai trò icon vận hành/trung tính riêng.\n`bh-flow-icon[data-bh-loading=\"true\"]` cung cấp chuyển động loading có ý nghĩa, có hỗ trợ\ngiảm chuyển động. Không bao giờ tạo chuyển động cho icon loại khi rảnh.\n\nVới chỉ báo quan hệ có nhãn, dùng `bh-flow-tone-mark` và `data-bh-tone=\"<FlowTone>\"`: nguồn\nquyết định hình tròn `space.075` và màu tô bằng màu viền của tone (`blue` khi không đặt).\nNhãn/số đếm phải giữ nghĩa không dựa vào màu; dấu này không truyền đạt trạng thái chạy.\n\nGói không cung cấp bảng kích thước nút, lưới hay bố cục: hình học nút thuộc về bên dùng, và\nviệc vẽ, bố cục và căn giữa theo nửa kích thước phải đọc cùng một nguồn của bên dùng. Giữ\nnguyên tọa độ đồ thị hiện có khi áp theme.\n\nTọa độ bố cục đồ thị, kích thước tự nhiên, cơ chế flex/grid và biến đổi viewport không phải\ngiá trị bảng màu. Không tùy tiện làm tròn chúng theo thang khoảng cách. Việc áp tone không\nđược đổi ID, trạng thái mở rộng, vị trí đã lưu hay ngữ nghĩa quan hệ của đồ thị.\n\nThân nút thông thường, thẻ MiniMap và khung Controls dùng `radius.100` (8 px).\nControls bo các góc nút lộ ra mà không cắt focus. Logo của nút giữ `radius.075` (6 px)\nlồng bên trong. Nút hình tròn giữ hình tròn thật, handle kết nối cũng vậy; bán kính\nđịnh tuyến cạnh vẫn là hình học đường đi. Thẻ inspector tùy chỉnh và control/thanh công cụ\nđồ thị dùng `--bh-radius-100`; hộp thọai/drawer dùng `radius.150` (12 px). Theo\n[thang radius theo vai trò](/vi/foundations/styles/radius/).\nMenu thu phóng gốc của dock dùng `radius.overlay` (8 px), độc lập với Nút gọn\nvà mục menu giữ `radius.050` (4 px). Không suy ra bán kính bề mặt menu từ bán kính\nnút cộng một độ lệch pixel cố định; quy ước này thuộc CSS đi kèm của Source.\n\nGắn tùy chọn tương phản cao của người dùng vào `data-bh-high-contrast=\"true\"` trên phần tử\n`bh-vue-flow` thật. CSS đi kèm làm dày viền focus của nút/cạnh/đường, button và\n`role=\"button\"` tùy chỉnh từ `border.width.focused` (2 px) lên `border.width.accent` (4 px),\ngiữ nguyên màu/khoảng lệch focus gốc. Không giữ công thức focus cho phần tử con do ứng dụng\ntự làm.\n\nCùng phần tử đó nhận `data-bh-large-text=\"true\"` và `data-bh-increased-spacing=\"true\"` cho\ncác tùy chọn trợ năng người dùng bật: chữ nút 1.125em, và line-height 1.6 / letter-spacing\n0.02em. Giữ binding tùy chọn thật của người dùng; không lặp CSS phần tử con tại chỗ.\n\nBên dùng `WorkflowViewer` gốc dùng `.bh-workflow-canvas` với `data-bh-contrast=\"high\"`. Công\nthức đi kèm làm đậm đường biên nút, chữ mô tả, cạnh và mũi tên bằng màu chữ đậm theo theme. Màu\nchọn và màu lỗi giữ nghĩa riêng; focus dùng độ dày viền nhấn. Bỏ thuộc tính sẽ trở về công thức\ngốc, và đổi theme khi đang bật sẽ dùng màu chữ của theme mới mà không gắn lại đồ thị. Giữ các\nthao tác điều hướng và trợ năng trong slot mở rộng `#dock` gốc của trình xem, cạnh các control\ncó sẵn, thay vì thay cả dock.\n\nThẻ thông thường có thể chủ động bật `NodeLook.sizing: 'content'`. Canvas gốc chỉ giữ cơ chế\nđộ rộng: hộp lớn theo nội dung trong khoảng `--wf-node-content-min-width` và\n`--wf-node-content-max-width`. CSS đi kèm của Source sở hữu các vai trò đó (`diagram.card.width`\nvà gấp đôi vai trò ấy) cùng toàn bộ công thức trình bày: tiêu đề/loại xuống dòng, phần đầu thẻ\ncao theo nội dung và mọi logo nguồn/đích nằm gọn trong thẻ. Không khai báo nào được định nghĩa\nở cả hai stylesheet. Giữ mọi logo; không cung cấp hình học đoán trước hay vá phần trong thẻ.\n\n`WorkflowEdge.tone` gốc độc lập với `variant`: `blue`, `red` và `green` gắn\n`--wf-edge-tone-<tone>` vào các vai trò viền nền tảng có sẵn `--bh-flow-category-task-border`,\n`--bh-flow-category-dependency-border` và `--bh-flow-category-transformation-border` của theme\nhiện tại (tên nền tảng giữ nguyên), cùng nét liền, nét đứt ngắn và gạch-chấm. Bên dùng tự ánh\nxạ các loại quan hệ của mình sang các tone này. Màu và nét đứt của tone giữ nguyên khi hover,\nchọn, trace, lỗi, có thể xảy ra và ngữ cảnh. Độ chắc chắn, ngữ cảnh và lỗi là dấu hiệu hình\ndạng, không bao giờ là mẫu nét đứt mới, đổi màu tone hay giảm độ mờ, nên mỗi nét đứt của tone\nvẫn là duy nhất (WCAG 1.4.1/1.4.11):\n\n- **Có thể xảy ra** (`certainty: 'possible'`, ứng viên tuyến động hoặc nhánh SWITCH): hình thoi\n nhỏ rỗng ở đầu nguồn, theo dấu luồng có điều kiện của BPMN 2.0.\n- **Ngữ cảnh** (`context: true`, ngữ cảnh breadcrumb được giữ lại): mũi tên mở kiểu UML và nét\n nghỉ mảnh hơn `--wf-edge-context-width`, biến riêng của gói gắn vào `border.width.default`\n của nền tảng; khi làm nổi bật vẫn dày lên như thường.\n- **Lỗi có tone** (`variant: 'failure'` có tone): màu và nét đứt của tone, cùng dấu Lucide\n `CircleX` tô bằng `color.icon.danger` (`--wf-edge-failure-icon`) cạnh nhãn cạnh. Dấu này chỉ\n để trang trí (`aria-hidden`); tên jump và chú giải vẫn giữ chữ. Lỗi không có tone giữ màu lỗi\n và nét đứt `5 4`.\n\nBằng chứng chạy trên cạnh `WorkflowEdge.execution` (`reached`, `unfinished`, `failed`,\n`notTaken`) tách biệt với tuyến lỗi được soạn (`variant: 'failure'`) và với tone. Nguồn gắn:\n\n- `reached` vào `color.text`, không phải `diagram.log-reached`: vai trò đó và màu làm nổi bật\n cạnh (`--wf-edge-active`, `diagram.selection-ring`) cùng là màu xanh, nên cạnh đã đi qua lúc\n nghỉ sẽ trông như đang được chọn. Dấu hiệu không dựa vào màu là độ dày đậm\n `--wf-edge-execution-width` (`border.width.focused`), như cạnh đã đi qua màu trung tính của Mermaid.\n- `unfinished` vào `diagram.log-unfinished`, nét đứt `4 3`.\n- `failed` vào `diagram.fail-stroke`, kèm dấu lỗi hình tròn có chữ x.\n- `notTaken` (tuyến bị bỏ qua) vào `diagram.nottaken-stroke` với độ dày thường, nét đứt `6 3`.\n\n`--wf-edge-execution-width` phải là độ dài CSS. Màu thực thi thắng màu tone; nét đứt của\n`unfinished` / `notTaken` thắng nét đứt của tone và của lỗi, còn tuyến lỗi được soạn bị thay nét\nđứt vẫn giữ dấu tròn chữ x. Chú giải gọi tên từng trạng thái có mặt và tên truy cập của cạnh nối\nthêm trạng thái đó (`Edge from A to B, run failed`). Ở độ tương phản cao, `reached` dùng chung màu\ncạnh (`color.text`) và được phân biệt bằng độ dày; các trạng thái khác giữ màu theo theme.\n\nTrạng thái node `reached`/`unfinished` chỉ suy ra từ log, không phải kết quả chạy có kiểu: viền\nvà dấu dùng `diagram.log-reached` / `diagram.log-unfinished` (`--wf-node-state-ink`); node có vòng\nchọn độc lập nên `reached` của node giữ vai trò log. `unfinished` giữ nguyên nền và chữ của node\n(kể cả ghi đè độ tương phản cao), vẽ nét đứt `4 3` cho cả viền lẫn cạnh subroutine.\n`--wf-node-execution-outline-width` gắn `border.width.focused` cho `ranOk`, `ranFailed`,\n`reached` và `unfinished`, như Mermaid; `neverReached` / `branchNotTaken` giữ mặc định gốc.\n\nCó thể xảy ra và ngữ cảnh có thể kết hợp. Truyền tên nhóm đã bản địa hóa qua `familyLabel`:\nchip và danh sách jump có tên `{family} jump to {target}`, đánh số `(n of m)` khi các jump song\nsong trùng tên. Bản địa hóa toàn bộ tên, cách đánh số và tiêu đề danh sách qua `texts.jumps`\n(`WorkflowJumpTexts`) của trình xem, giữ từ chỉ nhóm ở đầu; tên nhóm đã dịch nằm trong câu mặc\nđịnh tiếng Anh chưa phải là tên đã bản địa hóa. Nguồn: `packages/vueflow-tokens/src/styles.css`\nvà cạnh gốc của `workflow-canvas`. Các binding này không chứng minh hình ảnh: kiểm tra thủ công\ncả hai theme, dấu có thể xảy ra/ngữ cảnh/lỗi, tên jump với trình đọc màn hình và ảnh PNG xuất ra.\n\n**Khung nhóm.** Một nhóm gốc (`WorkflowNode.group`, node dựng sẵn `wf-group`) là thẻ của node\nlàm phần đầu, kèm nút tròn mở rộng/thu gọn; khi mở rộng, các node con nằm trong khung bên dưới\nphần đầu. Companion gắn khung vào các biến riêng của gói `--wf-group-*`, mỗi biến trỏ tới một\nvai trò nền tảng có sẵn: viền `color.border`, độ dày viền `border.width.default`, bo góc\n`radius.card`, nền `color.surface.subtle` và, với khung lồng trong khung,\n`color.background.neutral` để các cấp tách bạch; khoảng đệm `space.stack` và khoảng cách dưới\nphần đầu `space.150`. Không có token nền tảng riêng cho đồ thị nào đứng sau chúng. Bố cục gốc đọc\n`--wf-group-padding` và `--wf-group-header-gap` từ canvas, nên giữ cả hai là độ dài thuần. Chế\nđộ tương phản cao vẽ viền khung bằng màu chữ. Khung là vùng chứa, không phải tone hay trạng\nthái chạy: không tô khung theo tone hay trạng thái.\n\n**Khung chọn.** Giữ Shift và kéo trên vùng trống của canvas gốc sẽ vẽ một khung chọn các thẻ nó\nchạm tới (khung nhóm đang mở chỉ khi nằm trọn bên trong). Companion gắn khung chọn vào cùng công\nthức chọn với `.bh-vue-flow .vue-flow__selection`: khung trong suốt (không tô nền, để vẫn thấy các\nnode đã quét qua) với viền nét đứt `border.width.selected` màu `color.border.focus`, ở cả theme sáng và tối. Lựa chọn vẫn dùng\nvòng chọn của node; khung chọn không bao giờ là dấu hiệu loại hay trạng thái chạy.\n\n**Ô tìm kiếm.** Ô tìm kiếm của viewer gốc (`/` hoặc nút Tìm trên dock) là một lớp phủ gồm ô nhập\ntìm kiếm và các dòng kết quả. Companion gắn `--wf-find-*` và các vai trò dùng chung `--wf-list-*`:\n`color.surface.overlay`, `elevation.shadow.overlay` và `radius.overlay`, không có viền (lớp phủ\ntách khỏi trang bằng nền và bóng) và một đường phân cách `color.border` dưới ô nhập. Ô nhập và\ntrạng thái trống dùng `font.body.default`, chữ gợi ý `color.text.subtlest`, trạng thái trống\n`color.text.subtle`. Mỗi dòng dùng `font.label.default` cho tên node, khoảng đệm `space.075` /\n`space.item.x`, cao tối thiểu `size.control.default` (`size.target.touch` với con trỏ thô và\ndưới 768 px) và bo góc `radius.item`; nhãn loại sau tên là `font.body.small` màu\n`color.text.subtle`, node không có tên hiện mã định danh bằng `font.code.default`. Tên xuống dòng\nở ranh giới từ và không bao giờ bị cắt bớt; chỉ một từ rộng hơn cả dòng mới bị ngắt. Các dòng\ndùng trạng thái mục trong lớp phủ, mỗi trạng thái cách nhau một bậc: dòng dưới con trỏ\n`color.surface.overlay.hover`; dòng đang chọn bằng bàn phím `color.surface.overlay.selected`\nkèm thanh đầu dòng `border.width.selected` màu `color.border.selected` làm dấu hiệu không dựa vào\nmàu; dòng đó khi rê chuột `color.surface.overlay.selected.hover`. Chữ giữ nguyên màu ở mọi trạng\nthái; mọi cặp màu đều nằm trong danh sách kiểm tra tương phản. Tiêu điểm là vòng tiêu điểm của ô\nnhập bao quanh cả ô (`border.width.focused`, `color.border.focus`, `state.focus.offset`). Khi\nmột dòng nằm dưới con trỏ hoặc được chọn bằng ↓ / ↑, canvas xem trước node của dòng đó bằng trạng\nthái hover sẵn có và vòng ngoài của node (`diagram.selection-ring`); việc xem trước kết thúc khi\ncon trỏ rời danh sách, từ khóa thay đổi hoặc ô đóng lại, và không bao giờ đổi lựa chọn, đường\ntruy vết hay khung nhìn (node nằm ngoài màn hình không được kéo vào). Không tạo kiểu lại ô này\ncho từng viewer.\n\nTiêu đề và nhãn loại trong hình thoi và hình elip chỉ xuống dòng ở ranh giới từ và không bao giờ\nbị cắt bớt: khoảng đệm hai bên của chúng theo chiều rộng, nên ngắt giữa từ sẽ đọc thành hai từ và\ndấu lược sẽ che mất tên của chính nút đó. Chỉ một từ rộng hơn cả vùng nội dung mới bị ngắt. Thẻ\nthông thường vẫn có thể ngắt một tiêu đề dài liền mạch ở bất kỳ đâu.\n\n## Cạnh, control và xuất ảnh\n\n`styleTargetEdge(edge, nodes, toneOf?)` giữ danh tính đích của cạnh có hướng trên cả nét và\nmũi tên theo tone của nút đích (`toneOf(node)`, `blue` khi bỏ qua hoặc khi không có nút đích),\ngiữ dữ liệu khác của cạnh và tắt chuyển động chạy dọc trang trí. Ứng dụng có thể giữ nét đứt để\ntruyền đạt ngữ nghĩa quan hệ của riêng mình. Trình vẽ cạnh tùy chỉnh phải dùng nét được cung\ncấp thay vì thay bằng bảng màu cạnh không liên quan. `FLOW_EDGE` gom độ dày, kích thước mũi\ntên, bán kính đường và kích thước handle.\n\nĐường cạnh tùy chỉnh dùng `getFlowEdgeStyles(tone, suppliedStyle?)` cho toàn bộ công thức\ntrình bày SVG. Nó ưu tiên nét đích có hướng được cung cấp hơn màu dự phòng của tone, giữ nét\nđứt tĩnh được cung cấp, dùng `FLOW_EDGE.width`, không tô và nét không co giãn; bên dùng quyết\nđịnh nét đứt mang nghĩa gì.\nTọa độ đường, hình mũi tên và chiều quan hệ vẫn là hình học đồ thị.\nStyle cạnh và style container nút dùng kiểu `Styles` công khai của VueFlow, kể cả biến\ntheme tùy chỉnh. Hàm đơn giản hóa chi tiết nhận và trả về đúng quy ước gốc đó; ứng dụng\nkhông cần ép kiểu hay chép object style để gán.\n`styleTargetEdge` giữ loại mũi tên mở/đóng chỉ định rõ. `createVueFlowTheme({ nodeTone })`\ntô nút MiniMap theo cùng cách (`blue` theo mặc định).\n\nCSS đi kèm nhắm tới nút core/mặc định, handle, nhãn cạnh, vùng chọn, nút Controls và bề mặt\nMiniMap thật của VueFlow. Controls giữ trạng thái thường, hover, vô hiệu và focus, và lớn lên\nthành vùng chạm gốc với con trỏ thô. Import sau CSS upstream; bỏ các quy tắc tô core/\ncontrols/minimap toàn cục cạnh tranh của bên dùng thay vì tăng độ ưu tiên selector.\n\nXuất ảnh với theme và font hiện tại từ bề mặt đồ thị đã đo. Không ép nền trắng hay bảng\nmàu font hệ thống độc lập. Giữ nguyên snapshot/fit/khôi phục, lọc overlay, phản hồi độ phân\ngiải và xử lý dự phòng khi chụp. Kiểm tra ảnh xuất thật, không chỉ việc gọi chụp thành công.\n\nToàn màn hình đồ thị dùng stacking context cục bộ cô lập ở `z-index.modal` (400), như các\nbề mặt toàn màn hình khác, để inspector toàn cục mở từ đó vẫn nằm trên nó. Thứ tự khung con\nriêng như z10/z15 nằm trong context đó; không gán 1001/1002 toàn cục cho control đồ thị.\nKiểm tra thứ tự inspector/hộp thọai thật, Escape và việc trả focus.\n\n`getFlowDetailStyles(level, suppliedStyle)` bỏ bóng ở mức chi tiết tối thiểu; mức basic và\ndetailed trả lại style được cung cấp không đổi. Nó không bao giờ giảm độ mờ: trạng thái\nnút, tương phản chữ, focus và ngữ nghĩa tone phải đọc được ở mọi mức zoom. Ngưỡng\nviewport, metadata, vị trí đã đo và lịch xử lý vẫn là logic của bên dùng; không được bỏ\nnút, quan hệ hay trường dữ liệu nào.\n\n## Kiểm tra\n\nThử sáng và tối, tiếng Anh và tiếng Việt, nút vừa chọn vừa focus và nút lỗi, nhãn dài, kích\nthước do bên dùng sở hữu, mũi tên màu theo đích, zoom/snap/fit, nhóm mở rộng, vòng lặp, phần tử\nchứa hẹp và toàn màn hình, thoát bằng ESC, Controls, MiniMap và xuất ảnh. Tính tương phản\ncho cặp foreground/background thật và các viền có ý nghĩa trong mỗi theme đã render; chỉ\nriêng token gốc và cấu hình có kiểu không chứng minh được trợ năng hay hình ảnh.\n",
|
|
4465
|
+
"raw": "---\ntitle: Theme VueFlow\ndescription: \"Tone màu chung của đồ thị theo token gốc, theme đi cặp và tích hợp VueFlow 1.\"\norder: 5\n---\n\n`@beehexa/vueflow-tokens` chuyển token chính thức sang VueFlow 1. Gói không chép mã nguồn\nVueFlow, không đóng gói Vue, không sinh dữ liệu đồ thị và không đổi chiều quan hệ.\n\n## Cài đặt và áp dụng\n\nCài gói này, `@beehexa/design-tokens`, Vue 3, và các peer core, controls, minimap của\nVueFlow 1. Nạp CSS core, theme, controls và minimap của upstream trong entry đồ thị lazy,\ntrước CSS của adapter; nạp CSS design token gốc một lần với root 16px/chữ thân 14px.\nCác gói nguồn cục bộ vẫn là `0.0.0` riêng tư; đó không phải một bản phát hành registry.\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { VueFlow } from '@vue-flow/core'\nimport { Background } from '@vue-flow/background'\nimport { Controls } from '@vue-flow/controls'\nimport { MiniMap } from '@vue-flow/minimap'\nimport { createVueFlowTheme } from '@beehexa/vueflow-tokens'\nimport '@beehexa/design-tokens/css'\nimport '@vue-flow/core/dist/style.css'\nimport '@vue-flow/core/dist/theme-default.css'\nimport '@vue-flow/controls/dist/style.css'\nimport '@vue-flow/minimap/dist/style.css'\nimport '@beehexa/vueflow-tokens/css'\n\nconst props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>()\nconst theme = computed(() => createVueFlowTheme(props))\n// nodes and edges remain application graph data; never recreate their IDs on theme changes.\n</script>\n\n<template>\n <VueFlow :class=\"theme.class\" :style=\"theme.style\" v-bind=\"theme.flowOptions\">\n <Background v-bind=\"theme.background\" />\n <Controls />\n <MiniMap v-bind=\"theme.minimap\" />\n </VueFlow>\n</template>\n```\n\nFactory trả về các biến theo phạm vi, binding viewport có kiểu `FlowProps` (không dùng\n`FlowOptions` đã ngừng hỗ trợ), và binding cho Background/MiniMap. Nó lấy giá trị sáng\ncùng phần ghi đè tối và các phương án chữ tiếng Việt từ gói token. Tính lại khi theme hoặc\nngôn ngữ đổi. Giữ handler ready/error và fit đồ thị với padding `0.2` khi phần tử chứa đo\nđược hoặc đổi kích thước. Dùng đúng tùy chọn `fitViewOnInit` thật của VueFlow 1; không\ntruyền tên tùy chọn viewport tự đặt.\n\n## Tone màu không phải trạng thái\n\n`FlowTone` (`FLOW_TONES`) đặt tên tám tone màu chung: `blue`, `red`, `green`, `crimson`,\n`yellow`, `teal`, `magenta` và `purple`. Mỗi tone đọc một bộ vai trò `flow.category.*` có sẵn\ncủa nền tảng; các khóa nền tảng giữ nguyên tên, và gói không gán nghĩa nào cho tone. Bên dùng\ntự quyết định loại nút hay loại quan hệ nào của mình dùng tone nào. Tone không được hiểu là\nthành công, thất bại hay cảnh báo. Giữ nhãn loại và icon của nút; màu không bao giờ là cách\nnhận diện duy nhất, và tone không xác nhận trạng thái của một lần chạy.\n\nMỗi tone cung cấp `foreground`, `background`, `border` và `hover` như một vai trò sáng/tối đi\ncặp, không trong suốt. Dùng `getFlowTonePalette(tone)` cho binding dựa trên CSS; `border` của\nnó là danh tính khung/cạnh. Các vai trò gốc này thay cho bảng màu lịch sử do ứng dụng tự giữ,\nlớp phủ alpha, gradient và hàm chỉnh bảng màu. Không bao giờ nối hậu tố alpha hex vào biến\nCSS, hay làm sáng một vai trò đã phân giải ở phía sau. Với Tag loại gốc, gắn\n`getFlowToneBadgeStyles(tone)` vào prop `style` công khai và bỏ `color`. Công thức bất biến,\nđược cache này ghép foreground/background/border của tone thay vì đặt chữ trắng gốc lên nét\nkhung/cạnh. Kiểm tra tương phản chuẩn gồm cả tám cặp chữ nhỏ ở cả hai theme với mức WCAG AA\n4.5:1; bộ component gốc minh họa màu thật của chúng. Foreground và border của tone `teal` vẫn\nlà hai vai trò riêng.\n\n\nTrạng thái chọn dùng `color.border.selected` cùng viền ngoài khi chọn; focus bàn phím dùng\nriêng `color.border.focus`, độ dày viền focus và `state.focus.offset`. Lỗi dùng khung\ndanger cùng nét đứt/dấu hiệu không dựa vào màu và nhãn lỗi đọc được. Chọn hay focus không\nđược ghi đè danh tính tone, che lỗi, hay chỉ truyền đạt bằng màu.\nHandle khi nghỉ dùng vai trò icon trung tính. Màu focus dành cho focus thật, không phải\ntrang trí luôn bật cho điểm nối.\n\n## Nội dung tùy chỉnh và kích thước\n\nDùng `getFlowNodeStyles({ tone, width, height, shape? }, state)` cho thân nút tùy chỉnh. Hàm\ngắn font ngữ nghĩa, khoảng cách, cặp màu của tone và kích thước do bên dùng sở hữu;\n`shape: 'circle'` bo tròn hẳn thân nút và `state.dashed` vẽ viền nét đứt. Giữ icon tùy chỉnh,\nlogo, nhãn, handle, ngữ nghĩa trợ năng và sự kiện trong ứng dụng. Chỉ báo loading có\ný nghĩa có thể chuyển động; hiệu ứng nút xuất hiện để trang trí, danh tính nhấp nháy, icon\nxoay khi rảnh, biến đổi khi hover, nét đứt chạy trên cạnh, gradient và hiệu ứng kính không\nthuộc theme.\n\nNội dung theo tone tùy chỉnh dùng `getFlowToneStyles(tone, part?)`; `foreground` đặt màu chữ\ncủa tone, `border` đặt màu viền và `background` đặt bề mặt đi cặp. Ký hiệu theo tone dùng\n`getFlowIconStyles(tone, options)`, với màu mặc định là màu viền của tone, không phải màu chữ.\nOptions nhận tên kích thước icon gốc hoặc kích thước số của API, một màu đã phân giải từ\nnguồn, và disabled.\nKhóa icon trạng thái (`status-success|warning|error|info|loading`) và khóa control\n(`control-expand|collapse|help`) phân giải sang các vai trò icon vận hành/trung tính riêng.\n`bh-flow-icon[data-bh-loading=\"true\"]` cung cấp chuyển động loading có ý nghĩa, có hỗ trợ\ngiảm chuyển động. Không bao giờ tạo chuyển động cho icon loại khi rảnh.\n\nVới chỉ báo quan hệ có nhãn, dùng `bh-flow-tone-mark` và `data-bh-tone=\"<FlowTone>\"`: nguồn\nquyết định hình tròn `space.075` và màu tô bằng màu viền của tone (`blue` khi không đặt).\nNhãn/số đếm phải giữ nghĩa không dựa vào màu; dấu này không truyền đạt trạng thái chạy.\n\nGói không cung cấp bảng kích thước nút, lưới hay bố cục: hình học nút thuộc về bên dùng, và\nviệc vẽ, bố cục và căn giữa theo nửa kích thước phải đọc cùng một nguồn của bên dùng. Giữ\nnguyên tọa độ đồ thị hiện có khi áp theme.\n\nTọa độ bố cục đồ thị, kích thước tự nhiên, cơ chế flex/grid và biến đổi viewport không phải\ngiá trị bảng màu. Không tùy tiện làm tròn chúng theo thang khoảng cách. Việc áp tone không\nđược đổi ID, trạng thái mở rộng, vị trí đã lưu hay ngữ nghĩa quan hệ của đồ thị.\n\nThân nút thông thường, thẻ MiniMap và khung Controls dùng `radius.100` (8 px).\nControls bo các góc nút lộ ra mà không cắt focus. Logo của nút giữ `radius.075` (6 px)\nlồng bên trong. Nút hình tròn giữ hình tròn thật, handle kết nối cũng vậy; bán kính\nđịnh tuyến cạnh vẫn là hình học đường đi. Thẻ inspector tùy chỉnh và control/thanh công cụ\nđồ thị dùng `--bh-radius-100`; hộp thọai/drawer dùng `radius.150` (12 px). Theo\n[thang radius theo vai trò](/vi/foundations/styles/radius/).\nMenu thu phóng gốc của dock dùng `radius.overlay` (8 px), độc lập với Nút gọn\nvà mục menu giữ `radius.050` (4 px). Không suy ra bán kính bề mặt menu từ bán kính\nnút cộng một độ lệch pixel cố định; quy ước này thuộc CSS đi kèm của Source.\n\nGắn tùy chọn tương phản cao của người dùng vào `data-bh-high-contrast=\"true\"` trên phần tử\n`bh-vue-flow` thật. CSS đi kèm làm dày viền focus của nút/cạnh/đường, button và\n`role=\"button\"` tùy chỉnh từ `border.width.focused` (2 px) lên `border.width.accent` (4 px),\ngiữ nguyên màu/khoảng lệch focus gốc. Không giữ công thức focus cho phần tử con do ứng dụng\ntự làm.\n\nCùng phần tử đó nhận `data-bh-large-text=\"true\"` và `data-bh-increased-spacing=\"true\"` cho\ncác tùy chọn trợ năng người dùng bật: chữ nút 1.125em, và line-height 1.6 / letter-spacing\n0.02em. Giữ binding tùy chọn thật của người dùng; không lặp CSS phần tử con tại chỗ.\n\nBên dùng `WorkflowViewer` gốc dùng `.bh-workflow-canvas` với `data-bh-contrast=\"high\"`. Công\nthức đi kèm làm đậm đường biên nút, chữ mô tả, cạnh và mũi tên bằng màu chữ đậm theo theme. Màu\nchọn và màu lỗi giữ nghĩa riêng; focus dùng độ dày viền nhấn. Bỏ thuộc tính sẽ trở về công thức\ngốc, và đổi theme khi đang bật sẽ dùng màu chữ của theme mới mà không gắn lại đồ thị. Giữ các\nthao tác điều hướng và trợ năng trong slot mở rộng `#dock` gốc của trình xem, cạnh các control\ncó sẵn, thay vì thay cả dock.\n\nThẻ thông thường có thể chủ động bật `NodeLook.sizing: 'content'`. Canvas gốc chỉ giữ cơ chế\nđộ rộng: hộp lớn theo nội dung trong khoảng `--wf-node-content-min-width` và\n`--wf-node-content-max-width`. CSS đi kèm của Source sở hữu các vai trò đó (`diagram.card.width`\nvà gấp đôi vai trò ấy) cùng toàn bộ công thức trình bày: tiêu đề/loại xuống dòng, phần đầu thẻ\ncao theo nội dung và mọi logo nguồn/đích nằm gọn trong thẻ. Không khai báo nào được định nghĩa\nở cả hai stylesheet. Giữ mọi logo; không cung cấp hình học đoán trước hay vá phần trong thẻ.\n\n`WorkflowEdge.tone` gốc độc lập với `variant`: `blue`, `red` và `green` gắn\n`--wf-edge-tone-<tone>` vào các vai trò viền nền tảng có sẵn `--bh-flow-category-task-border`,\n`--bh-flow-category-dependency-border` và `--bh-flow-category-transformation-border` của theme\nhiện tại (tên nền tảng giữ nguyên), cùng nét liền, nét đứt ngắn và gạch-chấm. Bên dùng tự ánh\nxạ các loại quan hệ của mình sang các tone này. Màu và nét đứt của tone giữ nguyên khi hover,\nchọn, trace, lỗi, có thể xảy ra và ngữ cảnh. Độ chắc chắn, ngữ cảnh và lỗi là dấu hiệu hình\ndạng, không bao giờ là mẫu nét đứt mới, đổi màu tone hay giảm độ mờ, nên mỗi nét đứt của tone\nvẫn là duy nhất (WCAG 1.4.1/1.4.11):\n\n- **Có thể xảy ra** (`certainty: 'possible'`, ứng viên tuyến động hoặc nhánh SWITCH): hình thoi\n nhỏ rỗng ở đầu nguồn, theo dấu luồng có điều kiện của BPMN 2.0.\n- **Ngữ cảnh** (`context: true`, ngữ cảnh breadcrumb được giữ lại): mũi tên mở kiểu UML và nét\n nghỉ mảnh hơn `--wf-edge-context-width`, biến riêng của gói gắn vào `border.width.default`\n của nền tảng; khi làm nổi bật vẫn dày lên như thường.\n- **Lỗi có tone** (`variant: 'failure'` có tone): màu và nét đứt của tone, cùng dấu Lucide\n `CircleX` tô bằng `color.icon.danger` (`--wf-edge-failure-icon`) cạnh nhãn cạnh. Dấu này chỉ\n để trang trí (`aria-hidden`); tên jump và chú giải vẫn giữ chữ. Lỗi không có tone giữ màu lỗi\n và nét đứt `5 4`.\n\nBằng chứng chạy trên cạnh `WorkflowEdge.execution` (`reached`, `unfinished`, `failed`,\n`notTaken`) tách biệt với tuyến lỗi được soạn (`variant: 'failure'`) và với tone. Nguồn gắn:\n\n- `reached` vào `color.text`, không phải `diagram.log-reached`: vai trò đó và màu làm nổi bật\n cạnh (`--wf-edge-active`, `diagram.selection-ring`) cùng là màu xanh, nên cạnh đã đi qua lúc\n nghỉ sẽ trông như đang được chọn. Dấu hiệu không dựa vào màu là độ dày đậm\n `--wf-edge-execution-width` (`border.width.focused`), như cạnh đã đi qua màu trung tính của Mermaid.\n- `unfinished` vào `diagram.log-unfinished`, nét đứt `4 3`.\n- `failed` vào `diagram.fail-stroke`, kèm dấu lỗi hình tròn có chữ x.\n- `notTaken` (tuyến bị bỏ qua) vào `diagram.nottaken-stroke` với độ dày thường, nét đứt `6 3`.\n\n`--wf-edge-execution-width` phải là độ dài CSS. Màu thực thi thắng màu tone; nét đứt của\n`unfinished` / `notTaken` thắng nét đứt của tone và của lỗi, còn tuyến lỗi được soạn bị thay nét\nđứt vẫn giữ dấu tròn chữ x. Chú giải gọi tên từng trạng thái có mặt và tên truy cập của cạnh nối\nthêm trạng thái đó (`Edge from A to B, run failed`). Ở độ tương phản cao, `reached` dùng chung màu\ncạnh (`color.text`) và được phân biệt bằng độ dày; các trạng thái khác giữ màu theo theme.\n\nTrạng thái node `reached`/`unfinished` chỉ suy ra từ log, không phải kết quả chạy có kiểu: viền\nvà dấu dùng `diagram.log-reached` / `diagram.log-unfinished` (`--wf-node-state-ink`); node có vòng\nchọn độc lập nên `reached` của node giữ vai trò log. `unfinished` giữ nguyên nền và chữ của node\n(kể cả ghi đè độ tương phản cao), vẽ nét đứt `4 3` cho cả viền lẫn cạnh subroutine.\n`--wf-node-execution-outline-width` gắn `border.width.focused` cho `ranOk`, `ranFailed`,\n`reached` và `unfinished`, như Mermaid; `neverReached` / `branchNotTaken` giữ mặc định gốc.\n\nCó thể xảy ra và ngữ cảnh có thể kết hợp. Truyền tên nhóm đã bản địa hóa qua `familyLabel`:\nchip và danh sách jump có tên `{family} jump to {target}`, đánh số `(n of m)` khi các jump song\nsong trùng tên. Bản địa hóa toàn bộ tên, cách đánh số và tiêu đề danh sách qua `texts.jumps`\n(`WorkflowJumpTexts`) của trình xem, giữ từ chỉ nhóm ở đầu; tên nhóm đã dịch nằm trong câu mặc\nđịnh tiếng Anh chưa phải là tên đã bản địa hóa. Nguồn: `packages/vueflow-tokens/src/styles.css`\nvà cạnh gốc của `workflow-canvas`. Các binding này không chứng minh hình ảnh: kiểm tra thủ công\ncả hai theme, dấu có thể xảy ra/ngữ cảnh/lỗi, tên jump với trình đọc màn hình và ảnh PNG xuất ra.\n\n**Khung nhóm.** Một nhóm gốc (`WorkflowNode.group`, node dựng sẵn `wf-group`) là thẻ của node\nlàm phần đầu, kèm nút tròn mở rộng/thu gọn; khi mở rộng, các node con nằm trong khung bên dưới\nphần đầu. Companion gắn khung vào các biến riêng của gói `--wf-group-*`, mỗi biến trỏ tới một\nvai trò nền tảng có sẵn: viền `color.border`, độ dày viền `border.width.default`, bo góc\n`radius.card`, nền `color.surface.subtle` và, với khung lồng trong khung,\n`color.background.neutral` để các cấp tách bạch; khoảng đệm `space.stack` và khoảng cách dưới\nphần đầu `space.150`. Không có token nền tảng riêng cho đồ thị nào đứng sau chúng. Bố cục gốc đọc\n`--wf-group-padding` và `--wf-group-header-gap` từ canvas, nên giữ cả hai là độ dài thuần. Chế\nđộ tương phản cao vẽ viền khung bằng màu chữ. Khung là vùng chứa, không phải tone hay trạng\nthái chạy: không tô khung theo tone hay trạng thái.\n\n**Khung chọn.** Giữ Shift và kéo trên vùng trống của canvas gốc sẽ vẽ một khung chọn các thẻ nó\nchạm tới (khung nhóm đang mở chỉ khi nằm trọn bên trong). Companion gắn khung chọn vào cùng công\nthức chọn với `.bh-vue-flow .vue-flow__selection`: khung trong suốt (không tô nền, để vẫn thấy các\nnode đã quét qua) với viền nét đứt `border.width.selected` màu `color.border.focus`, ở cả theme sáng và tối. Lựa chọn vẫn dùng\nvòng chọn của node; khung chọn không bao giờ là dấu hiệu loại hay trạng thái chạy.\n\n**Ô tìm kiếm.** Ô tìm kiếm của viewer gốc (`/` hoặc nút Tìm trên dock) là một lớp phủ gồm ô nhập\ntìm kiếm và các dòng kết quả. Companion gắn `--wf-find-*` và các vai trò dùng chung `--wf-list-*`:\n`color.surface.overlay`, `elevation.shadow.overlay` và `radius.overlay`, không có viền (lớp phủ\ntách khỏi trang bằng nền và bóng) và một đường phân cách `color.border` dưới ô nhập. Ô nhập và\ntrạng thái trống dùng `font.body.default`, chữ gợi ý `color.text.subtlest`, trạng thái trống\n`color.text.subtle`. Mỗi dòng dùng `font.label.default` cho tên node, khoảng đệm `space.075` /\n`space.item.x`, cao tối thiểu `size.control.default` (`size.target.touch` với con trỏ thô và\ndưới 768 px) và bo góc `radius.item`; nhãn loại sau tên là `font.body.small` màu\n`color.text.subtle`, node không có tên hiện mã định danh bằng `font.code.default`. Tên xuống dòng\nở ranh giới từ và không bao giờ bị cắt bớt; chỉ một từ rộng hơn cả dòng mới bị ngắt. Các dòng\ndùng trạng thái mục trong lớp phủ, mỗi trạng thái cách nhau một bậc: dòng dưới con trỏ\n`color.surface.overlay.hover`; dòng đang chọn bằng bàn phím `color.surface.overlay.selected`\nkèm thanh đầu dòng `border.width.selected` màu `color.border.selected` làm dấu hiệu không dựa vào\nmàu; dòng đó khi rê chuột `color.surface.overlay.selected.hover`. Chữ giữ nguyên màu ở mọi trạng\nthái; mọi cặp màu đều nằm trong danh sách kiểm tra tương phản. Tiêu điểm là vòng tiêu điểm của ô\nnhập bao quanh cả ô (`border.width.focused`, `color.border.focus`, `state.focus.offset`). Khi\nmột dòng nằm dưới con trỏ hoặc được chọn bằng ↓ / ↑, canvas xem trước node của dòng đó bằng trạng\nthái hover sẵn có và vòng ngoài của node (`diagram.selection-ring`); việc xem trước kết thúc khi\ncon trỏ rời danh sách, từ khóa thay đổi hoặc ô đóng lại, và không bao giờ đổi lựa chọn, đường\ntruy vết hay khung nhìn (node nằm ngoài màn hình không được kéo vào). Không tạo kiểu lại ô này\ncho từng viewer.\n\nTiêu đề và nhãn loại trong hình thoi và hình elip chỉ xuống dòng ở ranh giới từ và không bao giờ\nbị cắt bớt: khoảng đệm hai bên của chúng theo chiều rộng, nên ngắt giữa từ sẽ đọc thành hai từ và\ndấu lược sẽ che mất tên của chính nút đó. Chỉ một từ rộng hơn cả vùng nội dung mới bị ngắt. Thẻ\nthông thường vẫn có thể ngắt một tiêu đề dài liền mạch ở bất kỳ đâu.\n\n## Cạnh, control và xuất ảnh\n\n`styleTargetEdge(edge, nodes, toneOf?)` giữ danh tính đích của cạnh có hướng trên cả nét và\nmũi tên theo tone của nút đích (`toneOf(node)`, `blue` khi bỏ qua hoặc khi không có nút đích),\ngiữ dữ liệu khác của cạnh và tắt chuyển động chạy dọc trang trí. Ứng dụng có thể giữ nét đứt để\ntruyền đạt ngữ nghĩa quan hệ của riêng mình. Trình vẽ cạnh tùy chỉnh phải dùng nét được cung\ncấp thay vì thay bằng bảng màu cạnh không liên quan. `FLOW_EDGE` gom độ dày, kích thước mũi\ntên, bán kính đường và kích thước handle.\n\nĐường cạnh tùy chỉnh dùng `getFlowEdgeStyles(tone, suppliedStyle?)` cho toàn bộ công thức\ntrình bày SVG. Nó ưu tiên nét đích có hướng được cung cấp hơn màu dự phòng của tone, giữ nét\nđứt tĩnh được cung cấp, dùng `FLOW_EDGE.width`, không tô và nét không co giãn; bên dùng quyết\nđịnh nét đứt mang nghĩa gì.\nTọa độ đường, hình mũi tên và chiều quan hệ vẫn là hình học đồ thị.\nStyle cạnh và style container nút dùng kiểu `Styles` công khai của VueFlow, kể cả biến\ntheme tùy chỉnh. Hàm đơn giản hóa chi tiết nhận và trả về đúng quy ước gốc đó; ứng dụng\nkhông cần ép kiểu hay chép object style để gán.\n`styleTargetEdge` giữ loại mũi tên mở/đóng chỉ định rõ. `createVueFlowTheme({ nodeTone })`\ntô nút MiniMap theo cùng cách (`blue` theo mặc định).\n\nCSS đi kèm nhắm tới nút core/mặc định, handle, nhãn cạnh, vùng chọn, nút Controls và bề mặt\nMiniMap thật của VueFlow. Controls giữ trạng thái thường, hover, vô hiệu và focus, và lớn lên\nthành vùng chạm gốc với con trỏ thô. Import sau CSS upstream; bỏ các quy tắc tô core/\ncontrols/minimap toàn cục cạnh tranh của bên dùng thay vì tăng độ ưu tiên selector.\n\nXuất ảnh với theme và font hiện tại từ bề mặt đồ thị đã đo. Không ép nền trắng hay bảng\nmàu font hệ thống độc lập. Giữ nguyên snapshot/fit/khôi phục, lọc overlay, phản hồi độ phân\ngiải và xử lý dự phòng khi chụp. Kiểm tra ảnh xuất thật, không chỉ việc gọi chụp thành công.\n\nToàn màn hình đồ thị dùng stacking context cục bộ cô lập ở `z-index.modal` (400), như các\nbề mặt toàn màn hình khác, để inspector toàn cục mở từ đó vẫn nằm trên nó. Thứ tự khung con\nriêng như z10/z15 nằm trong context đó; không gán 1001/1002 toàn cục cho control đồ thị.\nKiểm tra thứ tự inspector/hộp thọai thật, Escape và việc trả focus.\n\n`getFlowDetailStyles(level, suppliedStyle)` bỏ bóng ở mức chi tiết tối thiểu; mức basic và\ndetailed trả lại style được cung cấp không đổi. Nó không bao giờ giảm độ mờ: trạng thái\nnút, tương phản chữ, focus và ngữ nghĩa tone phải đọc được ở mọi mức zoom. Ngưỡng\nviewport, metadata, vị trí đã đo và lịch xử lý vẫn là logic của bên dùng; không được bỏ\nnút, quan hệ hay trường dữ liệu nào.\n\n## Kiểm tra\n\nThử sáng và tối, tiếng Anh và tiếng Việt, nút vừa chọn vừa focus và nút lỗi, nhãn dài, kích\nthước do bên dùng sở hữu, mũi tên màu theo đích, zoom/snap/fit, nhóm mở rộng, vòng lặp, phần tử\nchứa hẹp và toàn màn hình, thoát bằng ESC, Controls, MiniMap và xuất ảnh. Tính tương phản\ncho cặp foreground/background thật và các viền có ý nghĩa trong mỗi theme đã render; chỉ\nriêng token gốc và cấu hình có kiểu không chứng minh được trợ năng hay hình ảnh.\n",
|
|
4466
4466
|
"frontmatter": {
|
|
4467
4467
|
"title": "Theme VueFlow",
|
|
4468
4468
|
"description": "Tone màu chung của đồ thị theo token gốc, theme đi cặp và tích hợp VueFlow 1.",
|