@beehexa/design-rules 2611.3.3 → 2611.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AGENTS.md +1 -7
- package/dist/catalog.json +703 -321
- package/dist/docs/public/_redirects +2 -0
- package/dist/docs/scripts/color-pairs.mjs +5 -1
- package/dist/docs/scripts/token-utils.d.mts +5 -1
- package/dist/docs/scripts/token-utils.mjs +44 -4
- package/dist/docs/src/brand/structure-proposal.md +1 -1
- package/dist/docs/src/components/ColorDemo.astro +56 -18
- package/dist/docs/src/components/ElevationDemo.astro +196 -0
- package/dist/docs/src/components/LayoutDemo.astro +1 -1
- package/dist/docs/src/components/MotionDemo.astro +135 -0
- package/dist/docs/src/components/NativeControlsDemo.astro +279 -0
- package/dist/docs/src/components/OpacityDemo.astro +95 -0
- package/dist/docs/src/components/RoleGuides.astro +2 -2
- package/dist/docs/src/components/ShapeDemo.astro +88 -44
- package/dist/docs/src/components/ShapePin.astro +5 -3
- package/dist/docs/src/components/SiteHeader.astro +19 -4
- package/dist/docs/src/components/SystemAreas.astro +1 -1
- package/dist/docs/src/components/TokenTable.astro +16 -1
- package/dist/docs/src/components/TypeDemo.astro +15 -15
- package/dist/docs/src/components/ZIndexDemo.astro +102 -0
- package/dist/docs/src/components/logos/LogoInUse.astro +3 -3
- package/dist/docs/src/content/components/button/accessibility.mdx +41 -8
- package/dist/docs/src/content/components/button/code.mdx +8 -1
- package/dist/docs/src/content/components/button/examples.mdx +23 -4
- package/dist/docs/src/content/components/button/usage.mdx +26 -0
- package/dist/docs/src/content/components/resizable-panel/accessibility.mdx +61 -0
- package/dist/docs/src/content/components/resizable-panel/changelog.mdx +20 -0
- package/dist/docs/src/content/components/resizable-panel/code.mdx +79 -0
- package/dist/docs/src/content/components/resizable-panel/examples.mdx +85 -0
- package/dist/docs/src/content/components/resizable-panel/meta.json +5 -0
- package/dist/docs/src/content/components/resizable-panel/usage.mdx +101 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility.mdx +100 -11
- package/dist/docs/src/content/foundations/guidelines/content.mdx +11 -2
- package/dist/docs/src/content/foundations/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/border.mdx +13 -6
- package/dist/docs/src/content/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content/foundations/styles/color/palette.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/usage.mdx +34 -5
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +150 -6
- package/dist/docs/src/content/foundations/styles/elevation.mdx +72 -3
- package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/usage.mdx +13 -8
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +82 -9
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +12 -4
- package/dist/docs/src/content/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +28 -37
- package/dist/docs/src/content/foundations/styles/layout/page-widths.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content/foundations/styles/motion.mdx +131 -3
- package/dist/docs/src/content/foundations/styles/opacity.mdx +49 -5
- package/dist/docs/src/content/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content/foundations/styles/scrollbars.mdx +176 -0
- package/dist/docs/src/content/foundations/styles/size-and-density.mdx +23 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +5 -3
- package/dist/docs/src/content/foundations/styles/typography/index.mdx +13 -3
- package/dist/docs/src/content/foundations/styles/typography/usage.mdx +5 -3
- package/dist/docs/src/content/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/z-index.mdx +67 -5
- package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +11 -0
- package/dist/docs/src/content/foundations/tokens/index.mdx +17 -9
- package/dist/docs/src/content/get-started/design.mdx +1 -1
- package/dist/docs/src/content/get-started/develop.mdx +2 -6
- package/dist/docs/src/content/get-started/index.mdx +1 -1
- package/dist/docs/src/content/release-phases/index.mdx +1 -1
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +571 -19
- package/dist/docs/src/content/tools/application-content.mdx +176 -0
- package/dist/docs/src/content/tools/editors.mdx +271 -0
- package/dist/docs/src/content/tools/eslint.mdx +1 -1
- package/dist/docs/src/content/tools/index.mdx +2 -2
- package/dist/docs/src/content/tools/mermaid.mdx +190 -0
- package/dist/docs/src/content/tools/vueflow.mdx +179 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility.mdx +108 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +34 -0
- package/dist/docs/src/content-vi/foundations/index.mdx +9 -0
- package/dist/docs/src/content-vi/foundations/styles/border.mdx +12 -6
- package/dist/docs/src/content-vi/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +5 -5
- package/dist/docs/src/content-vi/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +34 -5
- package/dist/docs/src/content-vi/foundations/styles/data-visualization.mdx +75 -6
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +81 -0
- package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content-vi/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +13 -8
- package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +22 -8
- package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +13 -1
- package/dist/docs/src/content-vi/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +36 -0
- package/dist/docs/src/content-vi/foundations/styles/layout/page-widths.mdx +5 -1
- package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content-vi/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content-vi/foundations/styles/motion.mdx +139 -0
- package/dist/docs/src/content-vi/foundations/styles/opacity.mdx +49 -5
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +23 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +5 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/index.mdx +14 -4
- package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +67 -5
- package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +47 -0
- package/dist/docs/src/content-vi/foundations/tokens/index.mdx +35 -0
- package/dist/docs/src/lib/i18n.ts +0 -1
- package/dist/docs/src/lib/token-descriptions-vi.ts +81 -14
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/styles/chrome.css +21 -14
- package/dist/docs/src/styles/color.css +50 -53
- package/dist/docs/src/styles/docs.css +37 -55
- package/dist/docs/src/styles/elevation.css +83 -0
- package/dist/docs/src/styles/global.css +21 -10
- package/dist/docs/src/styles/icons.css +20 -23
- package/dist/docs/src/styles/kit.css +116 -0
- package/dist/docs/src/styles/layout.css +8 -13
- package/dist/docs/src/styles/motion.css +34 -0
- package/dist/docs/src/styles/opacity.css +43 -0
- package/dist/docs/src/styles/scrollbars.css +74 -0
- package/dist/docs/src/styles/shapes.css +35 -29
- package/dist/docs/src/styles/tokens.css +1663 -4
- package/dist/docs/src/styles/tokens.js +538 -4
- package/dist/docs/src/styles/typography.css +8 -11
- package/dist/docs/src/styles/zindex.css +59 -0
- package/dist/docs/tokens/border.json +1 -1
- package/dist/docs/tokens/color.json +75 -4
- package/dist/docs/tokens/content.json +24 -0
- package/dist/docs/tokens/diagram.json +54 -0
- package/dist/docs/tokens/editor.json +129 -0
- package/dist/docs/tokens/elevation.json +15 -5
- package/dist/docs/tokens/flow.json +497 -0
- package/dist/docs/tokens/layout.json +4 -0
- package/dist/docs/tokens/motion.json +37 -5
- package/dist/docs/tokens/opacity.json +9 -0
- package/dist/docs/tokens/radius.json +52 -8
- package/dist/docs/tokens/resize.json +79 -0
- package/dist/docs/tokens/scrollbar.json +40 -0
- package/dist/docs/tokens/size.json +7 -1
- package/dist/docs/tokens/spacing.json +35 -5
- package/dist/docs/tokens/switch.json +280 -0
- package/dist/docs/tokens/typography.json +5 -0
- package/dist/docs/tokens/visualization.json +123 -0
- package/dist/docs/tokens/z-index.json +49 -0
- package/dist/index.js +703 -321
- package/package.json +1 -1
|
@@ -3,8 +3,13 @@ title: Ant Design Vue theme
|
|
|
3
3
|
description: Make Ant Design Vue components use Beehexa design tokens, breakpoints, grid, control heights and app frame.
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
|
+
import NativeControlsDemo from '../../components/NativeControlsDemo.astro';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
`@beehexa/ant-design-vue-tokens` owns the reusable Ant Design Vue 4 adapter.
|
|
9
|
+
Use its typed ESM API and companion CSS, backed by `@beehexa/design-tokens`.
|
|
10
|
+
Frameworks are peers: `ant-design-vue@^4.2.6` and `vue@^3.3.0`; neither is bundled.
|
|
11
|
+
Unreleased `0.0.0` packages use explicit local development references; only the authorized
|
|
12
|
+
release runner stamps real package versions. Do not copy a theme palette into an application.
|
|
8
13
|
|
|
9
14
|
**Beehexa tokens are the source of truth. Ant Design Vue only reads them.**
|
|
10
15
|
|
|
@@ -13,32 +18,159 @@ This page is the only place where the Beehexa foundations meet Ant Design Vue. T
|
|
|
13
18
|
## Usage
|
|
14
19
|
|
|
15
20
|
```vue
|
|
16
|
-
<script setup>
|
|
17
|
-
import {
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { computed, watchEffect } from 'vue';
|
|
23
|
+
import { createAntDesignVueTheme, getAntDesignVuePopupContainer, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';
|
|
18
24
|
import '@beehexa/design-tokens/css';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
import '@beehexa/ant-design-vue-tokens/css';
|
|
26
|
+
|
|
27
|
+
const props = defineProps<{ dark: boolean; locale: 'en' | 'vi' }>();
|
|
28
|
+
const rootFontSize = useAntDesignVueRootFontSize();
|
|
29
|
+
const theme = computed(() => createAntDesignVueTheme({
|
|
30
|
+
dark: props.dark, locale: props.locale, rootFontSize: rootFontSize.value
|
|
31
|
+
}));
|
|
32
|
+
watchEffect(() => {
|
|
33
|
+
if (typeof document === 'undefined') return;
|
|
34
|
+
document.documentElement.dataset.theme = props.dark ? 'dark' : 'light';
|
|
35
|
+
document.documentElement.lang = props.locale;
|
|
36
|
+
});
|
|
29
37
|
</script>
|
|
30
38
|
|
|
31
39
|
<template>
|
|
32
|
-
<a-config-provider :theme="theme">
|
|
40
|
+
<a-config-provider :theme="theme" :get-popup-container="getAntDesignVuePopupContainer">
|
|
33
41
|
<App />
|
|
34
42
|
</a-config-provider>
|
|
35
43
|
</template>
|
|
36
44
|
```
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
`createAntDesignVueTheme({ dark = false, locale = 'en', rootFontSize = 16 } = {})`
|
|
47
|
+
returns the native `ThemeConfig`. Recompute on theme/language/root-font changes;
|
|
48
|
+
each call returns a fresh object. `locale` selects source typography, not messages.
|
|
49
|
+
The setup-only source observer measures one inert1rem probe and cleans it up.
|
|
50
|
+
This keeps numeric native size/type/radius APIs aligned with scalable CSS units;
|
|
51
|
+
pixel-based borders and breakpoints do not scale. The pure factory reads no DOM.
|
|
52
|
+
Pass the appropriate AntD language pack through `ConfigProvider.locale`, and configure the
|
|
53
|
+
date library separately. Render native `useMessage`, `useNotification` and `useModal`
|
|
54
|
+
holders in a feedback host inside the sole root provider. Bind application notify facades
|
|
55
|
+
to those hook APIs; never use detached raw static feedback APIs. The factory sets
|
|
56
|
+
`hashed: false` because AntD4 contextual message/notification holders otherwise retain
|
|
57
|
+
stale hashes across theme/locale changes. Keep an existing notice open while switching
|
|
58
|
+
dark/Vietnamese to light/English; its typography and paint must follow the active theme.
|
|
59
|
+
|
|
60
|
+
Keep document `data-theme` and `lang` synchronized for teleported overlays. Import
|
|
61
|
+
companion CSS after application/framework styles. Use a native 16px root and 14px body;
|
|
62
|
+
numeric APIs resolve source rem at 16px. The pixel entrypoint is not the dashboard path.
|
|
63
|
+
|
|
64
|
+
## Overlay ownership and bounded native content
|
|
65
|
+
|
|
66
|
+
Triggered popups use `getAntDesignVuePopupContainer` to stay inside their nearest native
|
|
67
|
+
Modal/Drawer or custom `data-bh-overlay-owner` host. Native Modal/Drawer roots remain
|
|
68
|
+
body-hosted for viewport geometry. Provider-bound modal facades default their invocation
|
|
69
|
+
`zIndex` through `getAntDesignVueModalZIndex()` while preserving explicit caller values;
|
|
70
|
+
this keeps keyboard/awaited confirmations above their live owner. Nested drawers use
|
|
71
|
+
`getAntDesignVueOverlayZIndex(fullscreen, ownerZIndex)` as `rootStyle.zIndex` so
|
|
72
|
+
surface and mask move together; AntD4's `zIndex` prop styles only the content wrapper.
|
|
73
|
+
Body-teleported fullscreen editors/images and fullscreen native Modals capture
|
|
74
|
+
`getAntDesignVueFullscreenZIndex()` before mounting their root. This combines the
|
|
75
|
+
fullscreen role with above-owner ordering; a fixed450 must not fall below a nested
|
|
76
|
+
native Drawer451. Mark custom roots only once they are active, avoiding self-counting.
|
|
77
|
+
Tour's inline native default also requires its public
|
|
78
|
+
`zIndex` prop bound to `z-index.spotlight`.
|
|
79
|
+
|
|
80
|
+
Drawer wrappers intentionally inherit `pointer-events: none`; native content restores
|
|
81
|
+
pointer entry only for its own subtree. The companion CSS also restores
|
|
82
|
+
`pointer-events: auto` on actual native popup roots portaled into that wrapper
|
|
83
|
+
(Dropdown, Select/Picker/Cascader/TreeSelect/Mentions, submenu, Tooltip/Popover and
|
|
84
|
+
Tour). The wrapper stays pointer-transparent. Do not relocate popups into a scrolling
|
|
85
|
+
body, change z-indices or add page overrides to solve this inherited-pointer gap.
|
|
86
|
+
|
|
87
|
+
The companion CSS provides opt-in native structural contracts, not application selectors:
|
|
88
|
+
|
|
89
|
+
- `bh-ant-fill-drawer` / `bh-ant-drawer-flush`: bounded body, intrinsic header/footer,
|
|
90
|
+
optional zero body padding; bind through `rootClassName`. Keep the native body's
|
|
91
|
+
default automatic overflow rather than suppressing access when intrinsic
|
|
92
|
+
controls or preserved pane minima exceed a short allocation. Do not repeat
|
|
93
|
+
body flex/overflow styles at consumers.
|
|
94
|
+
- `bh-ant-fill-modal`: bind through native `wrapClassName`, not the unsupported
|
|
95
|
+
Modal `rootClassName`. The real fixed overlay allocates a token-inset bounded
|
|
96
|
+
dialog; its content/focus wrapper and body fill around intrinsic header/footer.
|
|
97
|
+
Width remains the caller's native width, bounded by the available overlay.
|
|
98
|
+
Use for interactive renderer inspection, not short confirmations. The renderer
|
|
99
|
+
viewport alone owns below-minimum overflow; do not subtract guessed chrome heights.
|
|
100
|
+
- `bh-ant-fill-tabs`: bounded native wrappers and active pane. Nested tabs opt in separately;
|
|
101
|
+
`bh-ant-fill-tabs--scroll` enables pane scrolling and `bh-ant-tabs-mobile-inset` adds the
|
|
102
|
+
source mobile inset. Inactive panes stay hidden.
|
|
103
|
+
Inner tabs inside that scrolling document can instead add
|
|
104
|
+
`bh-ant-fill-tabs--document`: wrappers keep intrinsic content height and grow
|
|
105
|
+
into adequate space, without clipping a renderer after long metadata exhausts
|
|
106
|
+
the allocation. The outer native scroll pane owns vertical access; do not put
|
|
107
|
+
both modifiers on the same root. Only the interactive renderer host receives
|
|
108
|
+
`--bh-layout-renderer-minimum-block-size`, not outer panes or static fields.
|
|
109
|
+
- `bh-ant-fill-spin` / `bh-ant-fill-card`: carry an existing bounded host through native wrappers.
|
|
110
|
+
Static document/tree/list content can remain nonshrinking and overflow-visible
|
|
111
|
+
inside the native Card's existing scroll owner. Do not pair that Card scroller
|
|
112
|
+
with a second zero-height inner scroller when its header exhausts a tiny pane.
|
|
113
|
+
This document composition adds no SDK-readable minimum to ordinary fields.
|
|
114
|
+
- `bh-ant-fit-empty`: only on a real native Empty inside an already allocated
|
|
115
|
+
placeholder. Native illustration choice alone does not guarantee a fit in a
|
|
116
|
+
short host. The opt-in removes outer and description paragraph margins (the
|
|
117
|
+
parent owns its inset), bounds the root and lets the image row shrink before
|
|
118
|
+
the intrinsic description/footer. The image keeps its native preferred height
|
|
119
|
+
and removes its inline baseline strut; neither enlarged artwork nor paragraph
|
|
120
|
+
margins consume a tiny host. It adds no readable-renderer minimum, palette,
|
|
121
|
+
text typography, image replacement or overflow suppression. Preserve the parent's one genuine
|
|
122
|
+
scroll owner when even the intrinsic text/actions cannot fit. Ordinary
|
|
123
|
+
document/list/table empties omit it and retain native defaults. The live native
|
|
124
|
+
family below compares 2/4/12rem allocations, the simple illustration and the
|
|
125
|
+
unchanged no-opt-in base.
|
|
126
|
+
- `AntDesignVuePopupScope`: only for retained renderers moved across native
|
|
127
|
+
overlay owners. Wrap the existing subtree outside its Teleport and pass the
|
|
128
|
+
existing HTMLElement root as `owner`; keep owner attributes on that actual
|
|
129
|
+
root. Keep a real element as the consuming component's root when callers use
|
|
130
|
+
`v-show` or other element directives; put the scope inside that existing root,
|
|
131
|
+
not in its place. A stable native popup holder moves with the owner because
|
|
132
|
+
AntD4 caches the first portal container. Nested scopes inherit the enclosing target.
|
|
133
|
+
Native ConfigProvider theme/locale, menus, focus and no-trigger body portals
|
|
134
|
+
remain native; no editor/model/graph rekey or global popup z-index is involved.
|
|
135
|
+
Fullscreen capture handlers yield menu/listbox Escape via
|
|
136
|
+
`isAntDesignVueMenuEvent(event)` before closing their own overlay.
|
|
137
|
+
Native Drawer portals can use the same stable host through the public scoped
|
|
138
|
+
slot: `<AntDesignVuePopupScope v-slot="{ getContainer }">` with
|
|
139
|
+
`<a-drawer :get-container="getContainer">`. HTML attributes on the scope
|
|
140
|
+
belong to that actual portal host; conditionally expose `role="dialog"`,
|
|
141
|
+
`aria-label` and `aria-modal` only while open when the native Drawer drops
|
|
142
|
+
these attributes. Do not add a second dialog wrapper or mutate native DOM.
|
|
143
|
+
AntD4 Flex also drops attributes other than class/style: use an existing real
|
|
144
|
+
semantic element when a controlled ID, region name or tab stop must survive.
|
|
145
|
+
- Independently selectable, disclosable choices compose actual Card title slots
|
|
146
|
+
with sibling native disclosure and selection Buttons plus a shortcut Tag.
|
|
147
|
+
Keep Card headers noninteractive; each Button owns only its own action.
|
|
148
|
+
AntD4 Collapse headers retain an ancestor `role="button"`/tab stop even in
|
|
149
|
+
icon-only mode, so do not nest independently actionable choices there.
|
|
150
|
+
Native conditional Card body slots own expanded content; no private header
|
|
151
|
+
role/keyboard patch or special choice-collapse CSS is needed.
|
|
152
|
+
- `bh-ant-inspection-descriptions`: source desktop label minimum and mobile stacked rows.
|
|
153
|
+
- `bh-ant-data-table`: generic pending/success/error row classes plus public `customCell`
|
|
154
|
+
markers `data-bh-cell-interaction="editable|readonly"` and `data-bh-cell-state="changed"`.
|
|
155
|
+
Native selection outranks operational row paint; changed cells keep diff paint on hover.
|
|
156
|
+
`bh-ant-table-nowrap` is an independent horizontal-content opt-in.
|
|
157
|
+
Add `bh-ant-row-indicators` for a `border.width.accent` inset danger marker on the
|
|
158
|
+
first cell of `bh-ant-row-error` rows. This non-colour issue cue does not change
|
|
159
|
+
column geometry, override selection or replace status text/icons.
|
|
160
|
+
- `data-bh-tone="warning"` on a native Badge root selects
|
|
161
|
+
`color.background.warning.bold` / `color.text.on-bold` for its count only.
|
|
162
|
+
Native operational status dots keep their separate source semantics and circles.
|
|
163
|
+
- Native Button `data-bh-target="touch"` selects `size.target.touch` as minimum
|
|
164
|
+
width/height without repainting it. `data-bh-target="responsive"` applies the
|
|
165
|
+
same target only for coarse pointers. Keep native type, size, disabled and
|
|
166
|
+
keyboard semantics; no page-owned target sizing is needed.
|
|
167
|
+
- The observed root can also be passed to `tokenPixels(name, locale, rootFontSize)`
|
|
168
|
+
for actual Avatar/Image numeric props replacing scalable rem CSS. Child setup
|
|
169
|
+
calls reuse the sole provider's readonly measurement, not another observer.
|
|
170
|
+
|
|
171
|
+
Keep custom business data/slot meaning and host structure in the consumer, not
|
|
172
|
+
presentation recipes. Do not recreate native selectors through per-page
|
|
173
|
+
`:deep(.ant-*)`, global overrides or priority escalation.
|
|
42
174
|
|
|
43
175
|
## Token mapping
|
|
44
176
|
|
|
@@ -47,9 +179,163 @@ for Vietnamese. Read the installed rule documents before implementing states or
|
|
|
47
179
|
| `colorPrimary` | `color.background.neutral.bold` |
|
|
48
180
|
| `colorText` | `color.text` |
|
|
49
181
|
| `colorBorder` | `color.border` |
|
|
50
|
-
| `borderRadius` | `radius.100` |
|
|
182
|
+
| `borderRadius` | `radius.100` (8 px) |
|
|
183
|
+
| `borderRadiusXS` / `borderRadiusSM` | `radius.025` (2 px) / `radius.050` (4 px) |
|
|
184
|
+
| `borderRadiusLG` / `borderRadiusOuter` | `radius.150` (12 px) / `radius.075` (6 px) |
|
|
51
185
|
| `fontFamily` | `font.family.sans` |
|
|
52
186
|
|
|
187
|
+
Use the complete [Radius role scale](/foundations/styles/radius/), not one radius
|
|
188
|
+
for every component. Buttons, inputs and selects use `radius.050` (4 px) at
|
|
189
|
+
small/default/large sizes, including explicit circle/round Button sizing. Menu
|
|
190
|
+
frames/items, checkboxes, tags and badge counts also use 4 px. A Select popup is
|
|
191
|
+
a separate surface and retains `radius.100` (8 px), as do Card/Popover/Tooltip/Alert.
|
|
192
|
+
Modal/Drawer use `radius.150` (12 px). Groups with 4 px padding use
|
|
193
|
+
8 px outside and nested 4 px inside; groups with 8 px padding use 12 px outside
|
|
194
|
+
and nested 4 px inside. `radius.200` (16 px) has no current component role.
|
|
195
|
+
Full-width tables, joined Search edges
|
|
196
|
+
and fullscreen surfaces remain square. `radius.full` is for avatars, switches
|
|
197
|
+
and pill-shaped chips; true radio/status circles and graph geometry remain intact.
|
|
198
|
+
`radius.025` (2 px) and `radius.075` (6 px) are nested parts, not control defaults.
|
|
199
|
+
The adapter pins role-specific component aliases and the companion CSS closes
|
|
200
|
+
fixed badge/Switch/Segmented/Drawer recipes. Consumers must remove competing
|
|
201
|
+
corner overrides, not add `.ant-*` radius patches.
|
|
202
|
+
Explicit Button `shape="circle"` / `shape="round"` props keep their native sizing,
|
|
203
|
+
but the source companion still gives them the 4 px control corner. They are not
|
|
204
|
+
avatar, Switch or pill-chip roles.
|
|
205
|
+
|
|
206
|
+
The adapter also pins semantic hover/pressed/disabled/link/status/selection/focus roles instead
|
|
207
|
+
of allowing a framework-generated blue palette to leak through. Inputs, selects, checkboxes
|
|
208
|
+
and radios use `color.border.bold` while cards/tables use `color.border`. Layout header and
|
|
209
|
+
sider and mobile navigation drawer share `color.surface.subtle`; there is no separate shell palette or nested isolated
|
|
210
|
+
theme. Use `font.body.default` for table data, `font.label.small` for headers/tags,
|
|
211
|
+
`font.heading.medium` for modal titles and `font.heading.small` for drawer titles.
|
|
212
|
+
|
|
213
|
+
Native Menu icons keep the source icon box and a `space.050` title gap. Title text
|
|
214
|
+
uses `font.label.default` rather than the row-height line box, keeping Vietnamese
|
|
215
|
+
labels and adjacent consumer-owned title/tag content vertically aligned.
|
|
216
|
+
|
|
217
|
+
### Ant Design Vue 4 component contracts
|
|
218
|
+
|
|
219
|
+
- Table reads `colorFillAlter`, `colorTextHeading`, `controlItemBgActive` and
|
|
220
|
+
`controlItemBgActiveHover`. AntD5 names such as `headerBg` and `headerColor` are ignored
|
|
221
|
+
by AntD Vue 4.2.6 and must not be used.
|
|
222
|
+
- Switch reads OFF tracks from `colorTextQuaternary`/`colorTextTertiary`, ON tracks from
|
|
223
|
+
`colorPrimary`/`colorPrimaryHover`, its shared thumb from `colorWhite`, **both** labels
|
|
224
|
+
from `colorTextLightSolid`, and disabled/loading opacity from `opacityLoading`.
|
|
225
|
+
These are component-scoped mappings, not changes to global primary/text colors.
|
|
226
|
+
AntD5 `trackBg`/`handleBg`-style names are not the AntD4 state API.
|
|
227
|
+
- Menu reads `colorItem*`, `radiusItem`, `radiusSubMenuItem` and `colorActiveBar*`.
|
|
228
|
+
Explicit `theme="dark"` menus receive the same source roles. Selection has a visible bar,
|
|
229
|
+
not a heavier label that shifts its neighbours or merely a changed fill.
|
|
230
|
+
- Form controls share source outline/focus/disabled roles. Validation retains danger/warning
|
|
231
|
+
text/icons and native state semantics. Do not replace meaningful input borders with divider
|
|
232
|
+
hairlines.
|
|
233
|
+
- Tag status presets are `success`, `processing`, `warning`, `error`; default is neutral.
|
|
234
|
+
They use source foreground and outline pairs. Arbitrary hue presets are not status names.
|
|
235
|
+
Badge counts are neutral; error/processing status dots retain their semantics.
|
|
236
|
+
- Tooltip and Message use the inverse surface/text pair. Modal/Drawer content uses surface,
|
|
237
|
+
scrim and overlay elevation. Progress is neutral by default and semantic on success/error.
|
|
238
|
+
|
|
239
|
+
### Native Switch contract
|
|
240
|
+
|
|
241
|
+
Use the native Switch inside the existing root ConfigProvider. `enabled`,
|
|
242
|
+
`saving`, `unavailable` and `locale` below are application state; do not create a
|
|
243
|
+
nested provider or local theme just for schedules, permissions or status toggles.
|
|
244
|
+
|
|
245
|
+
```vue
|
|
246
|
+
<a-switch
|
|
247
|
+
v-model:checked="enabled"
|
|
248
|
+
:loading="saving"
|
|
249
|
+
:disabled="unavailable"
|
|
250
|
+
:checked-children="locale === 'vi' ? 'Bật' : 'On'"
|
|
251
|
+
:un-checked-children="locale === 'vi' ? 'Tắt' : 'Off'"
|
|
252
|
+
:aria-label="settingLabel"
|
|
253
|
+
/>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`switch.on.*` is neutral-bold, never business-success green. `switch.off.*` has a
|
|
257
|
+
strong thumb, readable label and meaningful boundary so enabled OFF cannot be
|
|
258
|
+
mistaken for disabled. The source defines paired track/thumb/label/border roles
|
|
259
|
+
for normal, hover, pressed, focus, loading and disabled; normal and `size="small"`
|
|
260
|
+
use the same light/dark palette and existing native geometry. Native thumb
|
|
261
|
+
position, `aria-checked`, labels and the separate focus ring provide non-color
|
|
262
|
+
cues. Short EN/VI state labels use the existing source typography, not a patched
|
|
263
|
+
height or a consumer font declaration.
|
|
264
|
+
|
|
265
|
+
AntD4 supports only one shared thumb/label pair, no pressed track paint and no
|
|
266
|
+
explicit disabled color pairs. Its spinner foreground and translucent green
|
|
267
|
+
thumb shadow are also not configurable as paired parts. The companion CSS closes
|
|
268
|
+
those evidenced gaps, while normal/hover track paint stays in native aliases.
|
|
269
|
+
`opacityLoading: 1` removes native loading/disabled dimming; explicit opaque
|
|
270
|
+
disabled roles remain distinct from enabled OFF. Loading retains the current
|
|
271
|
+
normal checked pair and a high-contrast native spinner, including when both
|
|
272
|
+
loading and disabled props are set. It never predicts or changes the saved value.
|
|
273
|
+
|
|
274
|
+
Keep native controlled binding, `change` callback and keyboard operation. The
|
|
275
|
+
native button is disabled during loading; pending/disabled activation must not
|
|
276
|
+
save twice or update checked state. Business save operations and errors remain
|
|
277
|
+
application-owned. See the [active interaction-state demo](/foundations/styles/interaction-states/#live-native-switch-states)
|
|
278
|
+
for both sizes, OFF/ON loading and disabled states, EN/VI labels, visible callback
|
|
279
|
+
counts and a delayed controlled-save example. No consumer `.ant-switch` patch,
|
|
280
|
+
palette literal or custom Switch implementation is necessary.
|
|
281
|
+
|
|
282
|
+
### Companion CSS and structural classes
|
|
283
|
+
|
|
284
|
+
Use component tokens first. The package CSS fills actual AntD4 gaps: semantic label/header/title
|
|
285
|
+
typography, hard-coded submenu fill, selected bar colors, keyboard focus offsets, safe areas,
|
|
286
|
+
responsive Tour placement, reduced motion and neutral Badge count without recoloring error dots.
|
|
287
|
+
Application selectors and palette overrides belong neither in that CSS nor in a dashboard theme.
|
|
288
|
+
Consumers retain genuine portal layout and scrolling mechanics only. Framework paint
|
|
289
|
+
and typography fixes belong to the package, not duplicated consumer overrides.
|
|
290
|
+
|
|
291
|
+
Bordered Descriptions clip cell backgrounds inside the native rounded frame instead of
|
|
292
|
+
painting over its left corners. Header-only Cards omit the orphan header/body divider
|
|
293
|
+
and retain all four rounded corners; Cards with body/cover/actions keep native separation.
|
|
294
|
+
Bordered hoverable Cards keep `color.border.bold` plus `elevation.shadow.raised` on
|
|
295
|
+
hover and keyboard focus, rather than AntD4's transparent hover border. Focus also
|
|
296
|
+
uses the standard outline/offset; the application still owns keyboard action semantics.
|
|
297
|
+
These framework fixes are automatic, not per-page overrides.
|
|
298
|
+
|
|
299
|
+
Native Search, Input addon buttons, compact InputGroup and horizontal Space.Compact
|
|
300
|
+
share an intrinsic flex-stretched row: input and action top/bottom edges stay aligned,
|
|
301
|
+
adjacent borders overlap once, exposed corners stay 4 px and touching corners stay zero.
|
|
302
|
+
Source font roles are retained. Small Vietnamese fields/actions grow together to 26 px;
|
|
303
|
+
do not clip accents or shrink type to force 24 px. Default actions share field
|
|
304
|
+
error/warning/disabled borders; primary/danger actions retain their semantic roles.
|
|
305
|
+
Clear icons keep an icon-sized line box so they cannot inflate affix wrappers.
|
|
306
|
+
|
|
307
|
+
`bh-ant-tag-large` on a Tag selects the source large label (24px minimum, 8px inline padding);
|
|
308
|
+
the default is 20px minimum/6px. Both grow for Vietnamese line boxes rather than clipping marks.
|
|
309
|
+
`bh-ant-tree-fill` on an actual Tree fills a bounded flex host, including below an
|
|
310
|
+
intrinsic summary. Root and list establish the min-height-zero chain; only the
|
|
311
|
+
native list holder scrolls, preserving its keyboard scroll target. Do not pass a
|
|
312
|
+
fixed height or add another wrapping scroller. Intrinsic trees omit this opt-in.
|
|
313
|
+
Keyboard-navigation consumers bind the native `activeKey` / `onActiveChange` pair:
|
|
314
|
+
state `ref<TreeProps['activeKey']>()`, then `:active-key="activeKey"`
|
|
315
|
+
and `@active-change="activeKey = $event ?? undefined"`. AntD 4.2's uncontrolled
|
|
316
|
+
active-change path does not retain the requested node; a CSS fill opt-in cannot
|
|
317
|
+
supply that navigation state.
|
|
318
|
+
|
|
319
|
+
For data inspection, bind `width="var(--bh-ant-overlay-width)"` and apply
|
|
320
|
+
`bh-ant-inspection-modal` or Drawer `rootClassName="bh-ant-inspection-drawer"`.
|
|
321
|
+
Add `bh-ant-inspection-modal--wide` / `bh-ant-inspection-drawer--wide` only for an explicit
|
|
322
|
+
content-heavy variant. The variable selects `layout.overlay.default` / `.wide`, and `.mobile`
|
|
323
|
+
below `breakpoint.lg`. Short confirmations and navigation drawers retain their own widths.
|
|
324
|
+
Fullscreen modes are Modal `wrapClassName="full-screen"` and Drawer
|
|
325
|
+
`rootClassName="fullscreen"`; AntD4 Modal has no `rootClassName` prop. These preserve
|
|
326
|
+
bounded scroll mechanics, not decoration.
|
|
327
|
+
|
|
328
|
+
### Verify the actual framework
|
|
329
|
+
|
|
330
|
+
Exercise light/dark × English/Vietnamese with the real CSS imported: buttons and validated
|
|
331
|
+
inputs/selects, ordinary/selected/hovered table row checkboxes, sorting/filter portals,
|
|
332
|
+
expanded/collapsed/horizontal and submenu navigation, form help/error, Tooltip/Message,
|
|
333
|
+
Modal/Drawer and default/wide/fullscreen inspection at 1023/1024px. Check keyboard focus,
|
|
334
|
+
touch hit areas, reduced motion, narrow Tour and focus return. Use
|
|
335
|
+
**ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI** in controls, tags and rows.
|
|
336
|
+
Compilation alone does not establish those rendering/interaction outcomes.
|
|
337
|
+
|
|
338
|
+
|
|
53
339
|
## Spacing
|
|
54
340
|
|
|
55
341
|
Ant 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.
|
|
@@ -136,3 +422,269 @@ The header is 64 px by default and has no token for its height, so set it in the
|
|
|
136
422
|
The `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`.
|
|
137
423
|
|
|
138
424
|
See [Layout](/foundations/styles/layout/) for the frame.
|
|
425
|
+
|
|
426
|
+
## Interactive table rows
|
|
427
|
+
|
|
428
|
+
Bind `data-bh-interactive="true"` through `customRow` only when the complete row
|
|
429
|
+
already has an activation handler. The source companion owns the pointer cursor;
|
|
430
|
+
native selection keys/classes retain their selection recipe. Preserve accessible
|
|
431
|
+
row actions, keyboard behavior and actual record activation rather than replacing
|
|
432
|
+
selection with a custom outline.
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
## Native composition and optional variants
|
|
436
|
+
|
|
437
|
+
Use the real native component. These opt-ins do not authorize a div-based
|
|
438
|
+
replacement, a skin-only wrapper, or copying Card/Button geometry into the app.
|
|
439
|
+
|
|
440
|
+
- Native Card's `hoverable` prop remains optional. `data-bh-selected="true"`
|
|
441
|
+
adds a selected fill and independent inset cue; omitting it restores the base.
|
|
442
|
+
- Reuse `bh-data-accent` with an existing semantic `data-bh-status`, `data-bh-band`,
|
|
443
|
+
`data-bh-metric`, `data-bh-job-type` or `data-bh-priority` for an optional leading
|
|
444
|
+
edge on a real Card. It adds no selection or hover behavior. A status/category
|
|
445
|
+
edge survives selection; keyboard focus remains a separate outside outline.
|
|
446
|
+
Bind the discriminator appropriate to that mark rather than conflating status
|
|
447
|
+
with categorical identity. Labels are still mandatory.
|
|
448
|
+
- `data-bh-layout="content"` on a real Button allows a multiline composed label:
|
|
449
|
+
auto height, normal wrapping, start alignment and the source default-control
|
|
450
|
+
minimum height. Native props, padding and keyboard activation remain native.
|
|
451
|
+
Use ordinary Button size/block props when they suffice.
|
|
452
|
+
- `bh-ant-shell-region` removes native Header/Footer padding only when the region
|
|
453
|
+
already contains the composed app header/footer. It does not change native
|
|
454
|
+
height, paint or the surrounding responsive page-region layout.
|
|
455
|
+
- `bh-card-link` on a real navigation anchor wrapping Card removes competing
|
|
456
|
+
link paint/underline and supplies source keyboard focus, not Card skin.
|
|
457
|
+
|
|
458
|
+
Business components may own data, state, behavior and meaningful composition of
|
|
459
|
+
these primitives. Inventory and remove redundant replacement components and every
|
|
460
|
+
obsolete caller/import/export. Generated rich content must mount real native
|
|
461
|
+
enhancement controls when the host framework permits it; a producer stylesheet
|
|
462
|
+
alone is not evidence of missing native capability.
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
### Operational and composed native content
|
|
466
|
+
|
|
467
|
+
`Steps[data-bh-operational="true"]` uses success/info/danger/subtle for native
|
|
468
|
+
finish/process/error/wait states. It leaves categorical navigation Steps unchanged.
|
|
469
|
+
An actual Step's `data-bh-skipped="true"` adds a dashed tail in either orientation;
|
|
470
|
+
the caller retains ordering and the relationship's meaning. Custom icon slots do
|
|
471
|
+
not require rebuilding the Steps primitive.
|
|
472
|
+
|
|
473
|
+
`Result[data-bh-layout="step"]` retains a composed report's icon-and-title header
|
|
474
|
+
row, with subtitle/content and extra/actions below at full width. It only changes
|
|
475
|
+
native layout/padding; status paint and native slots remain native.
|
|
476
|
+
|
|
477
|
+
The native Tree title `data-bh-highlighted="true"` is a temporary locator cue,
|
|
478
|
+
not a selected key or keyboard focus. Native selected/disabled treenodes suppress
|
|
479
|
+
it; the source outline does not change title geometry.
|
|
480
|
+
|
|
481
|
+
Use `bh-partner-logo-image` on a real Image for connector/brand assets.
|
|
482
|
+
Bind only the Source partner-image height and `width="auto"`; native Image plus
|
|
483
|
+
the adapter preserves its intrinsic aspect ratio without a square frame or crop.
|
|
484
|
+
Actual identity Avatars stay native. Do not use brand hue as operational status.
|
|
485
|
+
|
|
486
|
+
### Native Image preview
|
|
487
|
+
|
|
488
|
+
The official Image `zIndexPopupBase` and `zIndexPopup` tokens use the fullscreen
|
|
489
|
+
band. That alone cannot clear an owner nested above it: AntD4.2.6 Preview drops
|
|
490
|
+
both declared Dialog `zIndex` and `wrapProps`. The setup composable
|
|
491
|
+
`useNativeImagePreviewContainer(labelGetter)` from
|
|
492
|
+
`@beehexa/ant-design-vue-tokens/image` owns the official lazy body portal:
|
|
493
|
+
pass its getter to native `preview.getContainer`. It names the real native
|
|
494
|
+
dialog, reacts to locale changes and captures a layer above live owners on
|
|
495
|
+
each opening, excluding its own previous layer. A closed portal is not an
|
|
496
|
+
overlay owner. Its observer/container are disposed on unmount. Native Image
|
|
497
|
+
still owns zoom/pan, keyboard close and focus return; there is no custom viewer.
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
`bh-ant-card-flush` opts a real Card body out of inset only for an edge-to-edge
|
|
501
|
+
embedded editor, canvas or composed pane. Ordinary cards retain native padding.
|
|
502
|
+
Reuse `bh-ant-fill-card` and `bh-ant-fill-spin` for existing bounded flex hosts;
|
|
503
|
+
do not create parallel fill aliases or restore private consumer selectors.
|
|
504
|
+
The flush Card clips embedded paint to its native rounded frame. A direct
|
|
505
|
+
browser iframe child has its UA border removed to avoid a second frame;
|
|
506
|
+
sandbox/srcdoc and embedded-document behavior remain browser-owned.
|
|
507
|
+
|
|
508
|
+
`semanticTableComponents` from `@beehexa/ant-design-vue-tokens/table` extends
|
|
509
|
+
the real Table's public `components` API. A column's `customCell` may return
|
|
510
|
+
`{ scope: 'row' }`; its body cell becomes a semantic `th`, forwarding the native
|
|
511
|
+
attributes and slot. Other cells remain `td`. AntD4 has no row-scope column prop
|
|
512
|
+
and its body-cell CSS only targets `td`, so the source companion supplies the
|
|
513
|
+
matching row-header size/border/hover/selection recipe for this actual HTML
|
|
514
|
+
semantics gap. Native columns, rows and Summary remain native.
|
|
515
|
+
|
|
516
|
+
An actual native ListItem may opt into `data-bh-interactive="true"` for a rich
|
|
517
|
+
activation row when no narrower native control meets its content contract.
|
|
518
|
+
The opt-in supplies hover/pointer/focus only; the consumer supplies a real action,
|
|
519
|
+
keyboard activation and accessible role. Do not nest competing interactive targets.
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
Connector and partner brands share `content.partner-logo.image-size` as their
|
|
523
|
+
rendered height, not a width cap. Keep natural width; wrap rows when needed.
|
|
524
|
+
Semantic icon-height roles likewise preserve proportional width and hit targets.
|
|
525
|
+
Native Table already styles `tfoot > tr > th` geometry at each size; the companion
|
|
526
|
+
adds only its missing Summary row-header border and semantic weight/alignment.
|
|
527
|
+
`a-typography-link[data-bh-target="responsive"]` uses the source minimum24px
|
|
528
|
+
target, increasing to44px only on coarse pointers; it adds no link skin.
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
Flush Cards clip embedded paint to their actual rounded frame. Native Drawer
|
|
532
|
+
footers retain their canonical inset or the device's safe-area inset, whichever
|
|
533
|
+
is larger. `Spin[data-bh-mode="nonblocking"]` removes the native veil/pointer
|
|
534
|
+
block only for progressive content that remains inspectable; omit it for actual
|
|
535
|
+
blocking work such as export. This does not change spinner timing or graph data.
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
## Read-only segmented native Progress
|
|
539
|
+
|
|
540
|
+
For “Step 3 of 7” feedback, use the real native `Progress` with its actual
|
|
541
|
+
`steps` and `percent`. This is not navigation: do not substitute `Steps`,
|
|
542
|
+
`Segmented`, a fabricated row of marks, or another progress engine.
|
|
543
|
+
|
|
544
|
+
AntD4 `size="small"` deliberately renders each step as a **2 × 8px vertical
|
|
545
|
+
fragment**. Its native `[width, height]` tuple means **per-segment** geometry.
|
|
546
|
+
The source helper resolves `content.step-progress.segment-width` and
|
|
547
|
+
`segment-height` to16 ×4px at root16 and20 ×5px at root20. Bind it reactively:
|
|
548
|
+
|
|
549
|
+
```vue
|
|
550
|
+
<script setup lang="ts">
|
|
551
|
+
import { computed } from 'vue'
|
|
552
|
+
import {
|
|
553
|
+
getAntDesignVueStepProgressSize,
|
|
554
|
+
useAntDesignVueRootFontSize
|
|
555
|
+
} from '@beehexa/ant-design-vue-tokens'
|
|
556
|
+
import { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization'
|
|
557
|
+
|
|
558
|
+
const props = defineProps<{ total: number; index: number; dark: boolean }>()
|
|
559
|
+
const rootFontSize = useAntDesignVueRootFontSize()
|
|
560
|
+
const progressSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value))
|
|
561
|
+
</script>
|
|
562
|
+
|
|
563
|
+
<template>
|
|
564
|
+
<a-space align="center" wrap>
|
|
565
|
+
<span>Step {{ props.index }} of {{ props.total }}</span>
|
|
566
|
+
<a-progress
|
|
567
|
+
class="bh-ant-step-progress"
|
|
568
|
+
:steps="props.total"
|
|
569
|
+
:percent="props.index / props.total * 100"
|
|
570
|
+
:size="progressSize"
|
|
571
|
+
:stroke-color="getStatusColor('info', 'border', { dark: props.dark })"
|
|
572
|
+
:show-info="false"
|
|
573
|
+
aria-hidden="true"
|
|
574
|
+
/>
|
|
575
|
+
</a-space>
|
|
576
|
+
</template>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
The feature owns the real positive total, current index, status text and
|
|
580
|
+
business transitions. The helper supplies geometry only; native Progress
|
|
581
|
+
owns the rendered count and active marks. Hide the redundant bar from assistive
|
|
582
|
+
technology only when adjacent text already conveys the same progress.
|
|
583
|
+
|
|
584
|
+
`bh-ant-step-progress` opts that native root into intrinsic inline width,
|
|
585
|
+
zero native outer margins, the source `content.step-progress.gap` (4px at
|
|
586
|
+
root16), and wrapping without a trailing item margin. CSS does not replace
|
|
587
|
+
the native size API or set per-mark width/height. The bar follows the status
|
|
588
|
+
on a wide row and wraps within the available width on mobile.
|
|
589
|
+
|
|
590
|
+
Omit the class and helper to retain the native base. Ordinary percentage,
|
|
591
|
+
upload and countdown progress do not opt in. The shared live matrix below
|
|
592
|
+
includes a real native no-opt-in comparison, editable total and first/middle/
|
|
593
|
+
final controls; check both root16 and root20, light/dark and narrow widths.
|
|
594
|
+
|
|
595
|
+
## One native control family, distinct roles
|
|
596
|
+
|
|
597
|
+
Use native default Button for compact bordered utility triggers (including
|
|
598
|
+
language and theme), with the same native size as adjacent page controls.
|
|
599
|
+
Use the public `#icon` slot and one label child; icon-only Buttons still need
|
|
600
|
+
an accessible name. Do not disguise `type="text"` globally as a default Button.
|
|
601
|
+
A frameless account/avatar menu legitimately uses `type="text"`, a real Avatar
|
|
602
|
+
and native Space: center it in the row rather than inventing a shell skin.
|
|
603
|
+
|
|
604
|
+
Button small/default/large use source control heights24/32/40px at the nominal
|
|
605
|
+
root; typography is label-small for small and label-default otherwise.
|
|
606
|
+
Button/Input/Select and Menu frame corners use radius050; Select popup is100.
|
|
607
|
+
The numeric theme/root observer and rem CSS scale together.
|
|
608
|
+
AntD4 only inserts margin for `.anticon` siblings, not Lucide SVGs in `#icon`;
|
|
609
|
+
the source supplies one space100 flex gap for all real Buttons and removes
|
|
610
|
+
the competing native/loading-icon margin. No shell-specific class is needed.
|
|
611
|
+
Native default/primary/text/link, disabled/loading, hover/pressed and keyboard
|
|
612
|
+
focus remain distinct. `data-bh-target="responsive"` adds touch minimums only
|
|
613
|
+
on coarse pointers. Open Dropdown/Menu state is not Button selection; keep
|
|
614
|
+
`aria-expanded`, menu keyboard behavior and focus return in the actual feature.
|
|
615
|
+
|
|
616
|
+
The primary neutral-bold/inverse pair is intentional: graphite in light mode,
|
|
617
|
+
light graphite with dark text in dark mode. A pale dark-mode Continue action
|
|
618
|
+
is not a reason to recolor every primary or text Button blue. Link actions
|
|
619
|
+
retain the source link palette; default utility actions remain bordered.
|
|
620
|
+
|
|
621
|
+
| Native variant | Source role and state contract |
|
|
622
|
+
| --- | --- |
|
|
623
|
+
| Default / dashed | Surface, text and border; neutral-subtle hover/pressed fill. Dashed retains its native dashed outline. |
|
|
624
|
+
| Primary | Neutral-bold/inverse pair and its own bold hover/pressed roles. |
|
|
625
|
+
| Danger primary | Danger-bold/on-bold pair, including hover/pressed. |
|
|
626
|
+
| 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. |
|
|
627
|
+
| Link / text | Distinct link/frameless roles, not a disguised default Button. |
|
|
628
|
+
| Ghost | Native transparent outlined variant with a role-appropriate foreground and host context; not a solid primary. |
|
|
629
|
+
| Disabled / loading | Native blocking behavior and disabled aliases remain authoritative, including disabled anchor Buttons. Loading does not fade an otherwise readable source pair. |
|
|
630
|
+
|
|
631
|
+
AntD4 paints a **resting lower shadow** from `controlOutline` on primary,
|
|
632
|
+
`controlTmpOutline` on default, and `colorErrorOutline` on danger-primary.
|
|
633
|
+
Those names are not exclusively keyboard-focus inputs. Reusing the global
|
|
634
|
+
blue focus alias there produces a stranded blue stripe even after all
|
|
635
|
+
animations finish. The source scopes these three Button component aliases
|
|
636
|
+
to transparent; it does not clear the global focus role or set its width
|
|
637
|
+
to zero.
|
|
638
|
+
|
|
639
|
+
Native Button keyboard focus instead reads `colorPrimaryBorder` and
|
|
640
|
+
`lineWidthBold`. Its component overrides use source focus color/width.
|
|
641
|
+
The companion's enabled `:focus-visible` rule supplies the independent,
|
|
642
|
+
gapped source outline/offset. Default/dashed state fills and the separate
|
|
643
|
+
danger text/on-bold pairs are the remaining native-token gaps; source CSS
|
|
644
|
+
handles only those cases, excluding disabled controls and genuine selection.
|
|
645
|
+
Apps must not add a local shadow/border reset or a focus suppression.
|
|
646
|
+
|
|
647
|
+
### Live native state and progress matrix
|
|
648
|
+
|
|
649
|
+
Use the site theme/language controls and browser root font preference.
|
|
650
|
+
Change Button size, hover/hold a press, Tab/Enter/Space through available
|
|
651
|
+
actions, and inspect actual activation counts. Loading/disabled Buttons and
|
|
652
|
+
the disabled native anchor must not activate. Progress uses the same actual
|
|
653
|
+
count/index for its opt-in and no-opt-in renderers.
|
|
654
|
+
|
|
655
|
+
<NativeControlsDemo />
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
### Native mobile composition and bounded content
|
|
659
|
+
|
|
660
|
+
The adapter stretches joined Input/Search/compact-group fields and their actions
|
|
661
|
+
as one row, including validation, disabled states and coarse-pointer targets.
|
|
662
|
+
Icon-only Buttons keep their native size proportions; on coarse pointers both
|
|
663
|
+
axes reach `size.target.touch`. Content-layout Buttons retain multiline text
|
|
664
|
+
without overriding explicit or responsive touch minimums.
|
|
665
|
+
|
|
666
|
+
Below `breakpoint.md`, every native Card header/meta title wraps, including
|
|
667
|
+
descendant Typography ellipsis, Tags and Space. This is global readable content,
|
|
668
|
+
not an optional consumer override. Header extras remain available. Standard
|
|
669
|
+
Timeline dots, tails and custom dots align to the first content line; wrapped
|
|
670
|
+
event content stays in the native timeline column. Label/alternate/right
|
|
671
|
+
timelines retain their distinct native alignment.
|
|
672
|
+
|
|
673
|
+
AntD4 Flex does not forward arbitrary `role`, `aria-*`, `data-*` or DOM listeners.
|
|
674
|
+
Do not put required semantics, source opt-ins or keyboard handlers on it. Use
|
|
675
|
+
native Space/Typography where appropriate, or retain a real semantic host with
|
|
676
|
+
minimal structural flex/grid CSS. Do not introduce a forwarding wrapper.
|
|
677
|
+
|
|
678
|
+
Use `bh-content-toolbar` and `bh-content-toolbar__group` on actual toolbar hosts;
|
|
679
|
+
the source owns spacing, padding, wrapping and mobile control minimums. These
|
|
680
|
+
recipes apply to editor/diagram/graph controls, not page-specific skins.
|
|
681
|
+
Keep the host and its flex children shrinkable with `min-width: 0`.
|
|
682
|
+
|
|
683
|
+
Bind `bh-ant-fill-spin` through Spin's **wrapperClassName**, not its class:
|
|
684
|
+
the nested-loading wrapper carries the bounded height. Drawer fill/flush modes
|
|
685
|
+
traverse the native content-wrapper/content/wrapper-body chain; header/footer
|
|
686
|
+
remain intrinsic and the body owns the remaining space. Tabs fill only their
|
|
687
|
+
own active pane. Consumers supply the actual bounded parent, not guessed
|
|
688
|
+
viewport-minus-header heights. Monaco/Mermaid observe that host's dimensions
|
|
689
|
+
without replacing the editor model or resetting existing chart pan/zoom.
|
|
690
|
+
|