@beehexa/design-rules 2611.4.1 → 2611.5.3
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 +602 -248
- package/dist/docs/public/_redirects +2 -0
- package/dist/docs/scripts/token-utils.d.mts +5 -1
- package/dist/docs/scripts/token-utils.mjs +28 -3
- package/dist/docs/src/brand/structure-proposal.md +1 -1
- package/dist/docs/src/components/ColorDemo.astro +52 -14
- 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 +8 -8
- package/dist/docs/src/components/RoleGuides.astro +2 -2
- package/dist/docs/src/components/ShapeDemo.astro +78 -35
- 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 +1 -1
- 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 +10 -3
- 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 +25 -3
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +76 -0
- package/dist/docs/src/content/foundations/styles/elevation.mdx +7 -1
- 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 +4 -2
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +82 -9
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +2 -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 +7 -1
- 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 +16 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +4 -2
- 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 +4 -0
- 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 +474 -12
- package/dist/docs/src/content/tools/application-content.mdx +166 -32
- package/dist/docs/src/content/tools/editors.mdx +247 -3
- 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 +108 -13
- package/dist/docs/src/content/tools/vueflow.mdx +58 -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 +9 -3
- 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 +24 -2
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +7 -1
- 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 +4 -2
- 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 +3 -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 +8 -2
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +16 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +4 -2
- 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 +4 -0
- 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 +60 -9
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/styles/chrome.css +10 -3
- package/dist/docs/src/styles/color.css +33 -23
- package/dist/docs/src/styles/docs.css +26 -28
- package/dist/docs/src/styles/elevation.css +4 -4
- package/dist/docs/src/styles/global.css +21 -1
- package/dist/docs/src/styles/icons.css +10 -9
- package/dist/docs/src/styles/kit.css +36 -32
- package/dist/docs/src/styles/layout.css +7 -7
- package/dist/docs/src/styles/motion.css +34 -0
- package/dist/docs/src/styles/opacity.css +3 -3
- package/dist/docs/src/styles/scrollbars.css +74 -0
- package/dist/docs/src/styles/shapes.css +21 -11
- package/dist/docs/src/styles/tokens.css +392 -12
- package/dist/docs/src/styles/tokens.js +185 -6
- package/dist/docs/src/styles/typography.css +4 -4
- package/dist/docs/src/styles/zindex.css +10 -7
- package/dist/docs/tokens/color.json +18 -1
- package/dist/docs/tokens/content.json +8 -3
- package/dist/docs/tokens/diagram.json +9 -3
- package/dist/docs/tokens/flow.json +2 -2
- package/dist/docs/tokens/layout.json +4 -0
- package/dist/docs/tokens/motion.json +37 -5
- package/dist/docs/tokens/radius.json +52 -8
- package/dist/docs/tokens/resize.json +12 -0
- package/dist/docs/tokens/scrollbar.json +40 -0
- package/dist/docs/tokens/size.json +1 -1
- package/dist/docs/tokens/spacing.json +31 -1
- package/dist/docs/tokens/switch.json +280 -0
- package/dist/index.js +602 -248
- package/package.json +1 -1
|
@@ -160,11 +160,26 @@ const otherHref = localize(base, otherLang);
|
|
|
160
160
|
event.preventDefault();
|
|
161
161
|
location.href = document.documentElement.lang === 'vi' ? `/vi${results[active].href}` : results[active].href;
|
|
162
162
|
} else if (event.key === 'Escape') {
|
|
163
|
+
// WAI-ARIA combobox pattern: Escape closes the list and keeps focus in the field; a second
|
|
164
|
+
// Escape clears the field. Small screens show the field over the header, opened from the
|
|
165
|
+
// search button: there it closes and focus goes back to that button, never to the page.
|
|
166
|
+
// preventDefault stops the browser's own Escape on a search field, which clears the text.
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
if (!list.hidden) {
|
|
169
|
+
list.hidden = true;
|
|
170
|
+
input.setAttribute('aria-expanded', 'false');
|
|
171
|
+
input.setAttribute('aria-activedescendant', '');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
163
174
|
input.value = '';
|
|
164
175
|
results = [];
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
176
|
+
active = -1;
|
|
177
|
+
// body also carries data-search-open while the field is open, so ask for the button.
|
|
178
|
+
const opener = document.querySelector<HTMLButtonElement>('button[data-search-open]');
|
|
179
|
+
if (opener && getComputedStyle(opener).display !== 'none') {
|
|
180
|
+
document.body.removeAttribute('data-search-open');
|
|
181
|
+
opener.focus();
|
|
182
|
+
}
|
|
168
183
|
}
|
|
169
184
|
});
|
|
170
185
|
document.addEventListener('click', (event) => {
|
|
@@ -180,7 +195,7 @@ const otherHref = localize(base, otherLang);
|
|
|
180
195
|
input.focus();
|
|
181
196
|
}
|
|
182
197
|
});
|
|
183
|
-
document.querySelector('[data-search-open]')?.addEventListener('click', () => {
|
|
198
|
+
document.querySelector('button[data-search-open]')?.addEventListener('click', () => {
|
|
184
199
|
document.body.setAttribute('data-search-open', '');
|
|
185
200
|
input.focus();
|
|
186
201
|
});
|
|
@@ -11,7 +11,7 @@ const plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
|
|
11
11
|
const areas = [
|
|
12
12
|
{ title: 'Foundations', href: '/foundations/', text: 'Tokens, guidelines and styles such as color, type and logos.', meta: plural(count('foundations'), 'page') },
|
|
13
13
|
{ title: 'Components', href: '/components/', text: 'Building blocks with usage, code and accessibility notes.', meta: plural(components, 'component') },
|
|
14
|
-
{ title: 'Tools', href: '/tools/', text: 'Lint rules
|
|
14
|
+
{ title: 'Tools', href: '/tools/', text: 'Lint rules and docs for AI agents.', meta: plural(count('tools'), 'tool') },
|
|
15
15
|
{ title: 'News', href: '/news/', text: 'Changes to the system, newest first.', meta: plural(news, 'post') },
|
|
16
16
|
];
|
|
17
17
|
---
|
|
@@ -6,14 +6,28 @@ import { langOf } from '../lib/i18n';
|
|
|
6
6
|
// Lists every token whose name starts with `prefix`, read from tokens/*.json.
|
|
7
7
|
interface Props {
|
|
8
8
|
prefix: string;
|
|
9
|
+
/** Show only the scale or only the family tokens. */
|
|
10
|
+
only?: 'scale' | 'family';
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
// Scale tokens (tier 1) and role tokens of a family (tier 2) are listed in two tables, so people
|
|
14
|
+
// see the raw steps apart from the tokens to use for a kind of element.
|
|
15
|
+
const all = tokensByPrefix(Astro.props.prefix);
|
|
16
|
+
const scale = all.filter((token) => !token.family);
|
|
17
|
+
const roles = all.filter((token) => token.family);
|
|
18
|
+
const only = Astro.props.only;
|
|
19
|
+
const groups = only
|
|
20
|
+
? [{ title: null, tokens: only === 'family' ? roles : scale }]
|
|
21
|
+
: roles.length && scale.length
|
|
22
|
+
? [{ title: null, tokens: scale }, { title: true, tokens: roles }]
|
|
23
|
+
: [{ title: null, tokens: all }];
|
|
12
24
|
const vi = langOf(Astro.url.pathname) === 'vi';
|
|
13
25
|
const L = (en: string, viText: string) => (vi ? viText : en);
|
|
14
26
|
const describe = (name: string, en: string) => (vi ? tokenDescriptionsVi[name] ?? en : en);
|
|
15
27
|
---
|
|
16
28
|
|
|
29
|
+
{groups.map(({ title, tokens }) => (<>
|
|
30
|
+
{title && <p class="token-table-title"><strong>{L('Family tokens', 'Token theo nhóm')}</strong> · {L('Use these for a kind of element; each points to a step of the scale above.', 'Dùng cho từng loại phần tử; mỗi token trỏ tới một bậc của thang ở trên.')}</p>}
|
|
17
31
|
<div class="table-wrap">
|
|
18
32
|
<table class="token-table">
|
|
19
33
|
<thead>
|
|
@@ -38,3 +52,4 @@ const describe = (name: string, en: string) => (vi ? tokenDescriptionsVi[name] ?
|
|
|
38
52
|
</tbody>
|
|
39
53
|
</table>
|
|
40
54
|
</div>
|
|
55
|
+
</>))}
|
|
@@ -13,27 +13,27 @@ const L = (en: string, viText: string) => (vi ? viText : en);
|
|
|
13
13
|
|
|
14
14
|
// Every text style, read from the tokens, with a sample in its role.
|
|
15
15
|
import { tokensByPrefix } from '../lib/tokens';
|
|
16
|
-
const groups: { name: string; styles: { id: string; sample: string; tnum?: boolean }[] }[] = [
|
|
16
|
+
const groups: { name: string; styles: { id: string; sample: string; viSample?: string; tnum?: boolean }[] }[] = [
|
|
17
17
|
{ name: 'Display', styles: [
|
|
18
|
-
{ id: 'display.large', sample: 'Sync everything' },
|
|
19
|
-
{ id: 'display.medium', sample: 'Sync everything' },
|
|
20
|
-
{ id: 'display.small', sample: 'Sync everything' },
|
|
18
|
+
{ id: 'display.large', sample: 'Sync everything', viSample: 'Đồng bộ mọi thứ' },
|
|
19
|
+
{ id: 'display.medium', sample: 'Sync everything', viSample: 'Đồng bộ mọi thứ' },
|
|
20
|
+
{ id: 'display.small', sample: 'Sync everything', viSample: 'Đồng bộ mọi thứ' },
|
|
21
21
|
] },
|
|
22
22
|
{ name: 'Heading', styles: [
|
|
23
|
-
{ id: 'heading.xlarge', sample: 'Connect your first store' },
|
|
24
|
-
{ id: 'heading.large', sample: 'Orders' },
|
|
25
|
-
{ id: 'heading.medium', sample: 'Sync settings' },
|
|
26
|
-
{ id: 'heading.small', sample: 'Online store → ERP' },
|
|
27
|
-
{ id: 'heading.xsmall', sample: 'Inventory' },
|
|
23
|
+
{ id: 'heading.xlarge', sample: 'Connect your first store', viSample: 'Kết nối cửa hàng đầu tiên' },
|
|
24
|
+
{ id: 'heading.large', sample: 'Orders', viSample: 'Đơn hàng' },
|
|
25
|
+
{ id: 'heading.medium', sample: 'Sync settings', viSample: 'Cài đặt đồng bộ' },
|
|
26
|
+
{ id: 'heading.small', sample: 'Online store → ERP', viSample: 'Cửa hàng online → ERP' },
|
|
27
|
+
{ id: 'heading.xsmall', sample: 'Inventory', viSample: 'Tồn kho' },
|
|
28
28
|
] },
|
|
29
29
|
{ name: 'Body', styles: [
|
|
30
|
-
{ id: 'body.large', sample: 'Orders from your online store are copied to the ERP every 5 minutes.' },
|
|
31
|
-
{ id: 'body.default', sample: 'Last synced 2 minutes ago. 3 orders are waiting.' },
|
|
32
|
-
{ id: 'body.small', sample: 'Updated by Linh · 24/10/2026 09:41' },
|
|
30
|
+
{ id: 'body.large', sample: 'Orders from your online store are copied to the ERP every 5 minutes.', viSample: 'Đơn hàng từ cửa hàng online được chép sang ERP mỗi 5 phút.' },
|
|
31
|
+
{ id: 'body.default', sample: 'Last synced 2 minutes ago. 3 orders are waiting.', viSample: 'Đồng bộ lần cuối 2 phút trước. 3 đơn hàng đang chờ.' },
|
|
32
|
+
{ id: 'body.small', sample: 'Updated by Linh · 24/10/2026 09:41', viSample: 'Linh cập nhật · 24/10/2026 09:41' },
|
|
33
33
|
] },
|
|
34
34
|
{ name: 'Label', styles: [
|
|
35
|
-
{ id: 'label.default', sample: 'Save changes' },
|
|
36
|
-
{ id: 'label.small', sample: 'Synced' },
|
|
35
|
+
{ id: 'label.default', sample: 'Save changes', viSample: 'Lưu thay đổi' },
|
|
36
|
+
{ id: 'label.small', sample: 'Synced', viSample: 'Đã đồng bộ' },
|
|
37
37
|
] },
|
|
38
38
|
{ name: 'Code', styles: [
|
|
39
39
|
{ id: 'code.default', sample: 'order_id: SO-10421' },
|
|
@@ -105,7 +105,7 @@ const features = [
|
|
|
105
105
|
<code>font.{st.id}</code>
|
|
106
106
|
<span class="type-num">{i.size}/{i.lh} · {i.weight}</span>
|
|
107
107
|
</div>
|
|
108
|
-
<div class="type-specimen" style={`font:var(${i.cssVar});${st.tnum ? 'font-variant-numeric:tabular-nums;' : ''}`}>{st.sample}</div>
|
|
108
|
+
<div class="type-specimen" style={`font:var(${i.cssVar});${st.tnum ? 'font-variant-numeric:tabular-nums;' : ''}`}>{L(st.sample, st.viSample ?? st.sample)}</div>
|
|
109
109
|
<p class="type-use">{i.use}</p>
|
|
110
110
|
</div>
|
|
111
111
|
);
|
|
@@ -53,7 +53,7 @@ const legend = [
|
|
|
53
53
|
{kind === 'screen' && (
|
|
54
54
|
<div class="zi-screen-wrap sh-root">
|
|
55
55
|
<div class="zi-screen" role="img" aria-label={L('A sync log screen with an app header, a sticky table header, an open menu, a tooltip and a toast, each numbered', 'Màn hình nhật ký đồng bộ có header app, header bảng dính, menu đang mở, tooltip và toast, mỗi phần được đánh số')}>
|
|
56
|
-
<div class="zi-head"><span class="zi-n">1</span><b>HexaSync</b><span class="zi-head-r"><span class="zi-icon" aria-label="Help"><CircleHelp size={16} aria-hidden="true" /></span></span></div>
|
|
56
|
+
<div class="zi-head"><span class="zi-n">1</span><b>HexaSync</b><span class="zi-head-r"><span class="zi-icon" role="img" aria-label="Help"><CircleHelp size={16} aria-hidden="true" /></span></span></div>
|
|
57
57
|
<div class="zi-body">
|
|
58
58
|
<div class="zi-toolbar"><span class="sp-btn is-small el-btn-icon">{L('Actions', 'Thao tác')}<ChevronDown size={16} aria-hidden="true" /></span></div>
|
|
59
59
|
<div class="zi-table">
|
|
@@ -112,7 +112,7 @@ const L = {
|
|
|
112
112
|
<div class="mock mock-partner">
|
|
113
113
|
<LogoSvg iconPx={24} />
|
|
114
114
|
<span class="mock-divider" aria-hidden="true" />
|
|
115
|
-
<span class="mock-partner-logo"
|
|
115
|
+
<span class="mock-partner-logo" data-sample={L.partnerLogo} />
|
|
116
116
|
</div>
|
|
117
117
|
<div class="logo-card-body"><p class="card-title">{L.partner[0]}</p><p>{L.partner[1]}</p></div>
|
|
118
118
|
</div>
|
|
@@ -145,7 +145,7 @@ const L = {
|
|
|
145
145
|
<div class="mock-bizcard is-back">
|
|
146
146
|
<LogoSvg kind="icon" version="graphite" iconPx={14} />
|
|
147
147
|
<span class="bizcard-text"><strong>{L.cardName}</strong><span>{L.cardRole}</span></span>
|
|
148
|
-
<span class="bizcard-text bizcard-contact"><span
|
|
148
|
+
<span class="bizcard-text bizcard-contact" aria-hidden="true"><span data-sample="name@beehexa.com" /><span data-sample="beehexa.com" /></span>
|
|
149
149
|
</div>
|
|
150
150
|
<div class="mock-bizcard is-front"><LogoSvg version="dark" iconPx={14} /></div>
|
|
151
151
|
</div>
|
|
@@ -186,7 +186,7 @@ const L = {
|
|
|
186
186
|
<div class="mock mock-market">
|
|
187
187
|
<div class="mock-listing is-ours">
|
|
188
188
|
<img src="/brand/logos/app/icon-192.png" width="40" height="40" alt="" />
|
|
189
|
-
<span><strong>{L.appName}</strong><small
|
|
189
|
+
<span><strong>{L.appName}</strong><small data-sample={L.by} /></span>
|
|
190
190
|
</div>
|
|
191
191
|
<div class="mock-listing"><i class="mock-tile" /><span class="mock-lines"><b /><i style="width:60%" /></span></div>
|
|
192
192
|
<div class="mock-listing"><i class="mock-tile" /><span class="mock-lines"><b /><i style="width:50%" /></span></div>
|
|
@@ -1,18 +1,51 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: How Button meets WCAG 2.2 AA, its keys, what it gives you and what your team does.
|
|
2
3
|
---
|
|
3
4
|
|
|
5
|
+
## Conformance
|
|
6
|
+
|
|
7
|
+
**Button meets WCAG 2.2 level AA when used as described on this page.** It follows the [Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/) of the WAI-ARIA Authoring Practices.
|
|
8
|
+
|
|
4
9
|
## Keyboard
|
|
5
10
|
|
|
6
11
|
| Key | Action |
|
|
7
12
|
| --- | --- |
|
|
8
|
-
| <kbd>Tab</kbd> | Moves focus to the button. |
|
|
13
|
+
| <kbd>Tab</kbd> | Moves focus to the button. Disabled buttons are skipped. |
|
|
9
14
|
| <kbd>Enter</kbd> or <kbd>Space</kbd> | Activates the button. |
|
|
10
15
|
|
|
11
|
-
##
|
|
16
|
+
## What Button gives you
|
|
17
|
+
|
|
18
|
+
- A native `<button>` element with `type="button"`, so it has the role, keyboard behaviour and focus of a button.
|
|
19
|
+
- A 2 px focus ring in `color.border.focus`, 2 px away from the button (`border.width.focused`, `state.focus.offset`).
|
|
20
|
+
- Heights of 24, 32 and 40 px, all at least the 24 × 24 px target; on touch screens the tap area grows to 44 × 44 px (`size.target.touch`).
|
|
21
|
+
- Text and background that meet 4.5:1 in every state except disabled, in light and dark.
|
|
22
|
+
- A disabled state that is removed from the tab order and announced as unavailable.
|
|
23
|
+
|
|
24
|
+
## What your team does
|
|
25
|
+
|
|
26
|
+
- **Name it.** Start the label with a verb: "Sync orders", not "OK". An icon-only button needs an `aria-label` that says the action, such as "Delete store".
|
|
27
|
+
- **Use a link to go somewhere.** A button does something; a link goes to a page.
|
|
28
|
+
- **Say what happened.** When a button shows that it is busy, announce the result when it finishes, for example with a toast or a live region: "Orders synced".
|
|
29
|
+
- **Avoid disabling.** A disabled button cannot explain why. Prefer keeping it active and showing what is missing when it is pressed.
|
|
30
|
+
- **Toggle buttons** set `aria-pressed="true"` or `"false"`, or change their label, such as "Pause" and "Play".
|
|
31
|
+
|
|
32
|
+
## WCAG criteria
|
|
33
|
+
|
|
34
|
+
| Criterion | Level | How Button meets it |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| 1.4.3 Contrast (Minimum) | AA | Label meets 4.5:1 in every enabled state |
|
|
37
|
+
| 1.4.11 Non-text Contrast | AA | Edges and the focus ring meet 3:1 |
|
|
38
|
+
| 2.1.1 Keyboard | A | Native button: Tab, Enter and Space |
|
|
39
|
+
| 2.4.7 Focus Visible | AA | 2 px focus ring on `:focus-visible` |
|
|
40
|
+
| 2.5.3 Label in Name | A | The accessible name is the visible label |
|
|
41
|
+
| 2.5.8 Target Size (Minimum) | AA | Every height is at least 24 px |
|
|
42
|
+
| 4.1.2 Name, Role, Value | A | Native button role; name from the label or `aria-label` |
|
|
43
|
+
|
|
44
|
+
## Checks
|
|
12
45
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
46
|
+
| Check | Status | Date |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| Automated (axe, WCAG 2.2 AA), light and dark | Passed | 4 Nov 2026 |
|
|
49
|
+
| Keyboard | Passed | 4 Nov 2026 |
|
|
50
|
+
| Touch target, phone screen size | Passed | 4 Nov 2026 |
|
|
51
|
+
| Screen readers (NVDA, VoiceOver) | Planned | |
|
|
@@ -21,7 +21,14 @@ Buttons come from Ant Design Vue. Apply the [Beehexa theme](/tools/ant-design-vu
|
|
|
21
21
|
|
|
22
22
|
| Prop | Values | Notes |
|
|
23
23
|
| --- | --- | --- |
|
|
24
|
-
| `type` | `default`, `primary`, `link`, `text` | Use `primary` once per screen. |
|
|
24
|
+
| `type` | `default`, `primary`, `dashed`, `link`, `text` | Use `primary` once per screen; preserve each variant's role. |
|
|
25
25
|
| `danger` | `boolean` | For destructive actions. |
|
|
26
|
+
| `ghost` | `boolean` | Transparent outlined native variant; use the appropriate host/foreground pair, not solid-primary label overrides. |
|
|
26
27
|
| `loading` | `boolean` | Shows a spinner and blocks repeat clicks. |
|
|
27
28
|
| `disabled` | `boolean` | Prefer explaining why an action is unavailable. |
|
|
29
|
+
| `size` | `small`, `middle`, `large` | Share the adjacent native field's size. |
|
|
30
|
+
| `#icon` | Vue slot | Use the native slot for Lucide or AntD icons; do not add a local margin. |
|
|
31
|
+
|
|
32
|
+
For a compact bordered utility trigger, omit `type` or use `default`. Text Buttons
|
|
33
|
+
remain frameless. Give an icon-only Button an accessible name and keep actual
|
|
34
|
+
Dropdown/Menu open state, Escape and focus restoration in the feature.
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
---
|
|
3
3
|
import CodeExample from '../../../components/CodeExample.astro';
|
|
4
|
+
import NativeControlsDemo from '../../../components/NativeControlsDemo.astro';
|
|
5
|
+
|
|
6
|
+
## Live native control family
|
|
7
|
+
|
|
8
|
+
<NativeControlsDemo />
|
|
9
|
+
|
|
10
|
+
Real AntD components with the public source theme and CSS. Change the site's theme
|
|
11
|
+
or language to inspect the family; keyboard focus, Dropdown, search, selection,
|
|
12
|
+
clear filters and action details use real native behavior. The bordered language
|
|
13
|
+
and icon-only utility controls share page-control geometry; account actions remain
|
|
14
|
+
frameless deliberately.
|
|
15
|
+
|
|
16
|
+
The state matrix uses actual native default/primary/dashed/link/text/danger/
|
|
17
|
+
ghost Buttons, native loading/disabled props, all three native sizes and a
|
|
18
|
+
disabled native anchor. The activation counter exercises native blocking
|
|
19
|
+
behavior; hover, pressed and keyboard focus are real interactions, not painted
|
|
20
|
+
facsimiles. A dark primary is deliberately light; its resting lower shadow is
|
|
21
|
+
not blue. The same live demo includes [read-only segmented Progress](/tools/ant-design-vue-theme/#read-only-segmented-native-progress)
|
|
22
|
+
with editable real count, first/middle/final states and a native opt-out.
|
|
4
23
|
|
|
5
24
|
## Default
|
|
6
25
|
|
|
7
|
-
<CodeExample code={`<
|
|
26
|
+
<CodeExample lang="vue" code={`<a-button>Cancel</a-button>`} />
|
|
8
27
|
|
|
9
28
|
## Primary
|
|
10
29
|
|
|
11
30
|
Use one primary button for the main action on a screen.
|
|
12
31
|
|
|
13
|
-
<CodeExample code={`<
|
|
32
|
+
<CodeExample lang="vue" code={`<a-button type="primary">Save changes</a-button>`} />
|
|
14
33
|
|
|
15
34
|
## Danger
|
|
16
35
|
|
|
17
|
-
<CodeExample code={`<
|
|
36
|
+
<CodeExample lang="vue" code={`<a-button danger>Delete integration</a-button>`} />
|
|
18
37
|
|
|
19
38
|
## Disabled
|
|
20
39
|
|
|
21
|
-
<CodeExample code={`<
|
|
40
|
+
<CodeExample lang="vue" code={`<a-button type="primary" disabled>Save changes</a-button>`} />
|
|
@@ -16,3 +16,29 @@
|
|
|
16
16
|
- Start the label with a verb and keep it short: "Sync orders".
|
|
17
17
|
- Put the primary button last in a group, on the right.
|
|
18
18
|
- Ask for confirmation before destructive actions.
|
|
19
|
+
|
|
20
|
+
## One control family, role-based variants
|
|
21
|
+
|
|
22
|
+
- Language/theme utilities use native bordered `type="default"` Buttons at the
|
|
23
|
+
same size as page Button/Input/Select controls. No shell-specific skin.
|
|
24
|
+
- Account/avatar menus may legitimately use frameless `type="text"`; native Space
|
|
25
|
+
centers the Avatar and text. Do not globally turn text Buttons into default.
|
|
26
|
+
- Put icons in `#icon`, labels in one child, and name icon-only actions. The source
|
|
27
|
+
adapter supplies one scalable icon/text gap for AntD and external SVG icons.
|
|
28
|
+
- Small/default/large controls are24/32/40px at the nominal16px root; control
|
|
29
|
+
corners are radius050 (4px). Menu frames also050; Select popup remains100.
|
|
30
|
+
- Preserve hover/pressed/focus/disabled/loading and actual Dropdown open semantics.
|
|
31
|
+
`data-bh-target="responsive"` adds44px minimums only on coarse pointers.
|
|
32
|
+
- A light primary background with dark text in dark mode is the intentional
|
|
33
|
+
neutral-bold/inverse pair. Link actions keep their own link palette.
|
|
34
|
+
- A blue lower stripe on an unfocused primary Button is not a legitimate
|
|
35
|
+
variant. The source adapter removes native resting outline shadows while
|
|
36
|
+
retaining the separate gapped keyboard focus ring.
|
|
37
|
+
- Danger primary uses on-bold text; outlined/frameless danger uses readable
|
|
38
|
+
danger text. A primary danger `ghost` Button must not inherit the solid label.
|
|
39
|
+
|
|
40
|
+
The [native adapter contract](/tools/ant-design-vue-theme/#one-native-control-family-distinct-roles)
|
|
41
|
+
owns token aliases and framework state gaps. Use its live matrix rather than
|
|
42
|
+
copying a consumer shadow reset or repainting all variants alike.
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Keyboard, pointer, touch and assistive-technology behavior for resizable panes.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Separator semantics
|
|
6
|
+
|
|
7
|
+
The source component owns the focusable `role="separator"`. Consumers provide a
|
|
8
|
+
translated, contextual `separatorLabel` such as “Resize source and preview”. Do
|
|
9
|
+
not put another focusable drag handle inside it or replace its name with a glyph.
|
|
10
|
+
The source supplies unique SSR-safe pane IDs, `aria-controls` for the first pane,
|
|
11
|
+
and percentage value/min/max attributes. `aria-orientation` describes the
|
|
12
|
+
**separator line**: vertical for horizontal left/right panes, horizontal for
|
|
13
|
+
vertical top/bottom panes.
|
|
14
|
+
|
|
15
|
+
Hidden-second and fixed-bound layouts have no visible/reachable separator. Hidden
|
|
16
|
+
second content is display-hidden and inert but remains mounted. Real endpoint
|
|
17
|
+
collapse requires `min=0`; collapsed content remains mounted and overflow-clipped,
|
|
18
|
+
but is inert and omitted from the accessibility tree. Tab/Shift+Tab must skip its
|
|
19
|
+
retained controls. Restoring the pane restores their ordinary native focusability,
|
|
20
|
+
without replacing the controls or their local state.
|
|
21
|
+
|
|
22
|
+
## Keyboard alternative to dragging
|
|
23
|
+
|
|
24
|
+
- Left/Right move the separator in a horizontal left/right split.
|
|
25
|
+
- Up/Down move it in a vertical top/bottom split.
|
|
26
|
+
- Arrow moves are 1 percentage point; Shift+Arrow moves are 10.
|
|
27
|
+
- Home and End select the current lower and upper bounds.
|
|
28
|
+
- Enter resets the split to its initial ratio, constrained by the current bounds.
|
|
29
|
+
Double-click offers the same reset for a pointer, without bubbling into a pane.
|
|
30
|
+
- Key repeats form one resize lifecycle; releasing a supported key or leaving the
|
|
31
|
+
separator ends it. Unrelated shortcuts are not consumed.
|
|
32
|
+
|
|
33
|
+
The reset point is captured when the component is created. Later model updates,
|
|
34
|
+
container changes and responsive direction changes do not redefine it. A visible
|
|
35
|
+
token-backed focus ring stays on the handle. Use the same layout in keyboard,
|
|
36
|
+
pointer and touch modes; do not leave disabled controls accepting gestures.
|
|
37
|
+
|
|
38
|
+
## Pointer and touch
|
|
39
|
+
|
|
40
|
+
A thin source-token divider is not the hit target. The target spans the cross
|
|
41
|
+
axis, grows from `resize.target` to `resize.touchTarget` for coarse pointers, and
|
|
42
|
+
uses `touch-action: none` only on the gesture surface. Pointer capture and a local
|
|
43
|
+
shield above the panes avoid editor/iframe interception; gesture-scoped selection
|
|
44
|
+
prevention avoids selecting pane content. Other controls and the document do not
|
|
45
|
+
receive permanent cursor/selection overrides.
|
|
46
|
+
|
|
47
|
+
Pointer up, pointer cancel, lost capture, window blur, hidden/locked constraints
|
|
48
|
+
and direction changes terminate the gesture. Cancellation retains the last valid
|
|
49
|
+
ratio. Unmount removes capture, document/window listeners, observations and
|
|
50
|
+
pending layout work. Each instance owns its own state.
|
|
51
|
+
|
|
52
|
+
## Contrast, motion and reading preferences
|
|
53
|
+
|
|
54
|
+
The handle remains above independently clipped panes in both axes. The line is
|
|
55
|
+
centered at 90% length by default, and the handle is at the midpoint, not at an
|
|
56
|
+
edge that can disappear beneath a pane. Active/focus paint uses source resize
|
|
57
|
+
roles and light/dark token values; forced-colors mode retains a system-color
|
|
58
|
+
border/focus indicator. Reader rem scaling affects token-sized targets/handles.
|
|
59
|
+
No resize transition animates under reduced motion (or during ordinary dragging).
|
|
60
|
+
Locale changes update the consumer-provided label without reconstructing child
|
|
61
|
+
editors, models or zoom state.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Source implementation history for the Vue resizable panel.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Source implementation
|
|
6
|
+
|
|
7
|
+
- Added the real `@beehexa/vue-components` Vue 3 `ResizablePanel`, independent of Ant Design Vue.
|
|
8
|
+
- Added bounded two-axis layouts, reactive ratio/constraints/visibility, and retained slot instances.
|
|
9
|
+
- Add explicit `preserveMinimum` document-access mode: preserve the configured pane minima plus the real interaction gutter when page chrome exhausts the allocation; keep default bounded relaxation and retained children unchanged.
|
|
10
|
+
- Make pane wrappers shrinkable column flex containers so bounded Cards, Monaco and canvases fill instead of collapsing to their intrinsic height.
|
|
11
|
+
- Added a centered 90% divider line with a visible locally layered midpoint handle in both axes.
|
|
12
|
+
- Reserved a real token-sized gutter in both axes; pane ratio/pixel bounds and pointer coordinates exclude it, and coarse-pointer targets no longer cover pane scrollbars.
|
|
13
|
+
- Replaced the repeating grip paint with exactly three source-token circular dots, with symmetric ink geometry centered inside the unchanged handle in both orientations and at reader scales.
|
|
14
|
+
- Let nested fixed overlays share their actual overlay owner's stack instead of trapping them beneath an outer sibling separator. Keep root/pane stacking contexts only during an active pointer gesture for the local iframe shield.
|
|
15
|
+
- Added typed, after-layout resize measurements for pointer, keyboard, container and programmatic changes.
|
|
16
|
+
- Added pointer capture/cancellation, iframe shielding, keyboard bounds/reset, accessible separator values, and cleanup.
|
|
17
|
+
- Keep real endpoint-collapsed panes inert and outside the accessibility tree while preserving their mounted controls/state; keyboard traversal resumes normally when the pane is restored.
|
|
18
|
+
- Added source-token light/dark, reader scaling, coarse-pointer targets, reduced motion and forced-colors support.
|
|
19
|
+
|
|
20
|
+
This describes the authored implementation, not a registry publication or release approval.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Typed Vue exports, complete props and measured resize lifecycle.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Imports
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
ResizablePanel,
|
|
10
|
+
type ResizablePanelDirection,
|
|
11
|
+
type ResizablePanelResizeEvent,
|
|
12
|
+
} from '@beehexa/vue-components';
|
|
13
|
+
import '@beehexa/vue-components/css';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Vue 3.5+ is a peer; `@beehexa/design-tokens` is the only package dependency.
|
|
17
|
+
The CSS export is typed for strict side-effect imports and includes source-token
|
|
18
|
+
CSS. The component uses a TypeScript render function, so consuming its built ESM
|
|
19
|
+
does not require an SFC compiler or Ant Design Vue. Use the actual local package
|
|
20
|
+
reference until an authorized registry release exists; source `0.0.0` is private,
|
|
21
|
+
not a published version claim.
|
|
22
|
+
|
|
23
|
+
## Props and slots
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Contract |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `direction` | `'horizontal'` or `'vertical'` | `'horizontal'` | Left/right or top/bottom panes. Consumer owns breakpoints. |
|
|
28
|
+
| `ratio` | `number` | `0.5` | Requested first-pane fraction; `v-model:ratio`. |
|
|
29
|
+
| `min` | `number` | `100` | CSS-pixel minimum for each pane; use `0` for endpoint collapse. |
|
|
30
|
+
| `max` | `number` | `Infinity` | First-pane CSS-pixel maximum. |
|
|
31
|
+
| `preserveMinimum` | `boolean` | `false` | Explicit document-access mode: retain the existing per-pane `min` plus the physical gutter along the active axis. The ancestor must provide real overflow access; ordinary bounded panes still relax minima. |
|
|
32
|
+
| `minRatio` | `number` | `0` | Lower first-pane fraction in `[0, 1]`. |
|
|
33
|
+
| `maxRatio` | `number` | `1` | Upper first-pane fraction in `[0, 1]`. |
|
|
34
|
+
| `secondVisible` | `boolean` | `true` | Hide/inert second pane without unmounting it; first fills host and ratio restores on show. |
|
|
35
|
+
| `resizerSize` | `string` | `'90%'` | Reactive CSS length/percentage for visible divider-line cross-axis length, centered and capped at host length. |
|
|
36
|
+
| `separatorLabel` | `string` | `'Resize panels'` | Consumer-localized accessible name. |
|
|
37
|
+
|
|
38
|
+
`#first` and `#second` supply the two retained pane subtrees. The component owns
|
|
39
|
+
no heading, editor model, chart zoom, application locale or fullscreen state.
|
|
40
|
+
|
|
41
|
+
Pixel minima relax equally when the host cannot fit both; explicit maximums win
|
|
42
|
+
incompatible minima. Equal live bounds disable interaction while retaining the
|
|
43
|
+
physical gutter; equal endpoint bounds also hide it. Live constraints cancel
|
|
44
|
+
active gestures without unmounting either pane.
|
|
45
|
+
Temporary host constraints clamp layout without replacing the requested model
|
|
46
|
+
ratio. Enter/double-click resets to the ratio captured at initial construction,
|
|
47
|
+
within current constraints; programmatic changes do not redefine that reset point.
|
|
48
|
+
|
|
49
|
+
## Events and types
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
type ResizablePanelDirection = 'horizontal' | 'vertical';
|
|
53
|
+
interface ResizablePanelResizeEvent {
|
|
54
|
+
ratio: number;
|
|
55
|
+
direction: ResizablePanelDirection;
|
|
56
|
+
first: { width: number; height: number };
|
|
57
|
+
second: { width: number; height: number };
|
|
58
|
+
source: 'pointer' | 'keyboard' | 'container' | 'programmatic';
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Event | Payload | When |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `update:ratio` | `number` | Pointer/keyboard changes request a bounded first-pane fraction. |
|
|
65
|
+
| `resize-start` | `ResizablePanelResizeEvent` | Pointer starts, supported keyboard gesture starts, or explicit reset starts. |
|
|
66
|
+
| `resize` | `ResizablePanelResizeEvent` | Interactive ratio change; initial/container measurement; external model, direction, visibility or constraint change. |
|
|
67
|
+
| `resize-end` | `ResizablePanelResizeEvent` | Up/cancel/lost capture/blur, keyboard keyup/focus loss, reset completion, or gesture termination by live prop changes. |
|
|
68
|
+
|
|
69
|
+
Measured events run after Vue updates the DOM and the next animation frame. Width
|
|
70
|
+
and height come from each pane's actual rendered rectangle. A hidden second pane
|
|
71
|
+
reports zero; `ratio` remains the effective split fraction for restoration.
|
|
72
|
+
Movement events coalesce per frame without reordering start/end. A normal parent
|
|
73
|
+
`v-model` echo does not relabel the user's event as programmatic. Container and
|
|
74
|
+
programmatic changes emit `resize` without fabricated interactive start/end.
|
|
75
|
+
|
|
76
|
+
Use these dimensions to relayout a retained editor/chart/workflow host, not to
|
|
77
|
+
change its key, model, zoom or mount state. The ResizeObserver and all gesture
|
|
78
|
+
listeners/capture/animation work clean up on unmount. SSR import/render is safe;
|
|
79
|
+
layout observation starts on mount and pane IDs use Vue's SSR-safe `useId`.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Bounded source/preview and responsive split-pane integration.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Retained source and preview
|
|
6
|
+
|
|
7
|
+
Import the source CSS once. Supply a bounded parent and keep the slot components
|
|
8
|
+
mounted; the panel handles clipping, visibility and resize mechanics.
|
|
9
|
+
|
|
10
|
+
```vue
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { ref } from 'vue';
|
|
13
|
+
import { ResizablePanel, type ResizablePanelResizeEvent } from '@beehexa/vue-components';
|
|
14
|
+
import '@beehexa/vue-components/css';
|
|
15
|
+
|
|
16
|
+
const ratio = ref(0.62);
|
|
17
|
+
const previewVisible = ref(true);
|
|
18
|
+
const sourceHost = ref<HTMLElement>();
|
|
19
|
+
const previewHost = ref<HTMLElement>();
|
|
20
|
+
const paneSizes = ref<ResizablePanelResizeEvent>();
|
|
21
|
+
function resized(event: ResizablePanelResizeEvent) {
|
|
22
|
+
paneSizes.value = event;
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div style="height: 32rem; min-height: 0; min-width: 0">
|
|
28
|
+
<ResizablePanel
|
|
29
|
+
v-model:ratio="ratio"
|
|
30
|
+
:second-visible="previewVisible"
|
|
31
|
+
:min="0"
|
|
32
|
+
separator-label="Resize source and preview"
|
|
33
|
+
@resize="resized"
|
|
34
|
+
>
|
|
35
|
+
<template #first><div ref="sourceHost" style="height: 100%; min-height: 0" /></template>
|
|
36
|
+
<template #second><div ref="previewHost" style="height: 100%; min-height: 0" /></template>
|
|
37
|
+
</ResizablePanel>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Attach retained editor/canvas instances to the two hosts. React to `paneSizes`
|
|
43
|
+
with the renderer's native layout API; preserve its existing model and zoom. Do
|
|
44
|
+
not replace a host or remount a model merely to react to a width/height change.
|
|
45
|
+
With `min=0`, Home/End can really collapse a pane while retaining its instance.
|
|
46
|
+
Enter or divider double-click restores the initial 0.62 ratio within live bounds.
|
|
47
|
+
|
|
48
|
+
## Responsive direction and translated naming
|
|
49
|
+
|
|
50
|
+
The application already owns breakpoint and locale state. Derive the direction
|
|
51
|
+
from that existing state; do not key the panel or its children on it.
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<ResizablePanel
|
|
55
|
+
v-model:ratio="ratio"
|
|
56
|
+
:direction="isMobile ? 'vertical' : 'horizontal'"
|
|
57
|
+
:separator-label="t('resizeSourceAndPreview')"
|
|
58
|
+
:min="100"
|
|
59
|
+
resizer-size="90%"
|
|
60
|
+
@resize="onPaneResize"
|
|
61
|
+
>
|
|
62
|
+
<template #first><SourceEditor /></template>
|
|
63
|
+
<template #second><WorkflowPreview /></template>
|
|
64
|
+
</ResizablePanel>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`isMobile`, `t`, retained editor/preview components and the native relayout callback
|
|
68
|
+
belong to the consumer. The library imposes neither an app breakpoint nor a
|
|
69
|
+
translation singleton. Theme changes use source CSS variables live.
|
|
70
|
+
|
|
71
|
+
Both examples reserve a physical source-token gutter between the panes. In the
|
|
72
|
+
responsive example, verify three centered vertical dots before the axis change
|
|
73
|
+
and three centered horizontal dots afterward. The handle and hitbox sizes do not
|
|
74
|
+
change to fake centering; root-font scaling scales dot diameter and spacing
|
|
75
|
+
together, with equal margins around the complete ink cluster.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Fixed/fullscreen retained panes
|
|
79
|
+
|
|
80
|
+
For a first-only fullscreen surface, use `min=0` and equal ratio bounds of `1`;
|
|
81
|
+
for a second-only surface, use equal bounds of `0`. This hides/disables the
|
|
82
|
+
separator without moving or unmounting slot children. Restoring ordinary bounds
|
|
83
|
+
restores the requested split. If the requirement is simply a temporarily hidden
|
|
84
|
+
second pane, use `secondVisible` instead. The component adds no fullscreen or
|
|
85
|
+
modal chrome; preserve native parent fullscreen/overlay behavior.
|