@beehexa/design-rules 2611.4.1 → 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/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 +457 -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
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<div data-native-control-family aria-label="Native control family demonstration"></div>
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import { computed, createApp, defineComponent, h, onBeforeUnmount, ref, useId } from 'vue';
|
|
5
|
+
import { Alert, Avatar, Button, Card, ConfigProvider, Dropdown, Empty, Flex, InputNumber, InputSearch, Menu, MenuItem, Modal, Progress, Select, Space, Switch, Tag, TypographyText, type SelectProps } from 'ant-design-vue';
|
|
6
|
+
import { ClearOutlined, GlobalOutlined, RightOutlined } from '@ant-design/icons-vue';
|
|
7
|
+
import { tokenPixels } from '@beehexa/design-tokens';
|
|
8
|
+
import { createAntDesignVueTheme, getAntDesignVueStepProgressSize, useAntDesignVueRootFontSize } from '@beehexa/ant-design-vue-tokens';
|
|
9
|
+
import { getStatusColor } from '@beehexa/ant-design-vue-tokens/visualization';
|
|
10
|
+
import { getFlowCategoryBadgeStyles } from '@beehexa/vueflow-tokens';
|
|
11
|
+
import '@beehexa/ant-design-vue-tokens/css';
|
|
12
|
+
|
|
13
|
+
const Demo = defineComponent({
|
|
14
|
+
setup() {
|
|
15
|
+
const rootFontSize = useAntDesignVueRootFontSize();
|
|
16
|
+
const dark = ref(document.documentElement.dataset.theme === 'dark');
|
|
17
|
+
const locale = ref<'en' | 'vi'>(document.documentElement.lang.startsWith('vi') ? 'vi' : 'en');
|
|
18
|
+
const language = ref('English');
|
|
19
|
+
const query = ref('');
|
|
20
|
+
const status = ref<SelectProps['value']>('all');
|
|
21
|
+
const details = ref(false);
|
|
22
|
+
const controlId = useId();
|
|
23
|
+
const languageOpen = ref(false);
|
|
24
|
+
const languageTrigger = ref<{ focus: () => void } | null>(null);
|
|
25
|
+
const closeLanguage = () => { languageOpen.value = false; languageTrigger.value?.focus(); };
|
|
26
|
+
const selectedChoice = ref('flow');
|
|
27
|
+
const buttonSize = ref<'small' | 'middle' | 'large'>('middle');
|
|
28
|
+
const buttonPresses = ref(0);
|
|
29
|
+
const activateButton = () => { buttonPresses.value += 1; };
|
|
30
|
+
const buttonSizeOptions = ['small', 'middle', 'large'].map(value => ({ value, label: value }));
|
|
31
|
+
const buttonAvailability = ['enabled', 'loading', 'disabled'] as const;
|
|
32
|
+
const buttonCases = (['default', 'primary', 'dashed', 'link', 'text'] as const).flatMap(type =>
|
|
33
|
+
[false, true].map(danger => ({ key: `${type}${danger ? '-danger' : ''}`, type, danger, ghost: false, inverse: false })));
|
|
34
|
+
buttonCases.push(
|
|
35
|
+
{ key: 'primary-ghost', type: 'primary', danger: false, ghost: true, inverse: false },
|
|
36
|
+
{ key: 'primary-ghost-danger', type: 'primary', danger: true, ghost: true, inverse: false },
|
|
37
|
+
{ key: 'inverse-ghost', type: 'default', danger: false, ghost: true, inverse: true }
|
|
38
|
+
);
|
|
39
|
+
const buttonWords = computed(() => locale.value === 'vi' ? {
|
|
40
|
+
title: 'Một họ Nút gốc, các vai trò khác nhau',
|
|
41
|
+
help: 'Nền chính sáng trong giao diện tối là có chủ đích; đường xanh phía dưới khi chưa lấy nét thì không. Di chuột, nhấn giữ và dùng Tab/Enter/Space. Chỉ nút khả dụng được tăng bộ đếm.',
|
|
42
|
+
default: 'Chi tiết', primary: 'Tiếp tục', dashed: 'Thêm ứng dụng', link: 'Hủy', text: 'Chọn ứng dụng khác',
|
|
43
|
+
enabled: 'Khả dụng', loading: 'Đang xử lý', disabled: 'Vô hiệu hóa', danger: 'Nguy hiểm', ghost: 'Viền trong suốt',
|
|
44
|
+
size: 'Cỡ nút', presses: 'Lần kích hoạt', anchor: 'Liên kết đã vô hiệu hóa'
|
|
45
|
+
} : {
|
|
46
|
+
title: 'One native Button family, distinct roles',
|
|
47
|
+
help: 'A light primary fill in dark mode is intentional; a blue lower stripe while unfocused is not. Hover, hold a press and use Tab/Enter/Space. Only available buttons may increment the counter.',
|
|
48
|
+
default: 'Details', primary: 'Continue', dashed: 'Add app', link: 'Cancel', text: 'Choose another app',
|
|
49
|
+
enabled: 'Available', loading: 'Loading', disabled: 'Disabled', danger: 'Danger', ghost: 'Ghost',
|
|
50
|
+
size: 'Button size', presses: 'Activations', anchor: 'Disabled link'
|
|
51
|
+
});
|
|
52
|
+
const stepTotal = ref(5);
|
|
53
|
+
const stepIndex = ref(2);
|
|
54
|
+
const stepSize = computed(() => getAntDesignVueStepProgressSize(rootFontSize.value));
|
|
55
|
+
const stepWords = computed(() => locale.value === 'vi' ? {
|
|
56
|
+
title: 'Tiến độ từng bước chỉ đọc', total: 'Tổng số bước', first: 'Đầu', middle: 'Giữa', last: 'Cuối',
|
|
57
|
+
current: `Bước ${stepIndex.value}/${stepTotal.value}`, optedIn: 'Thanh ngang có chọn dùng', base: 'Progress small gốc, không chọn dùng'
|
|
58
|
+
} : {
|
|
59
|
+
title: 'Read-only step progress', total: 'Total steps', first: 'First', middle: 'Middle', last: 'Last',
|
|
60
|
+
current: `Step ${stepIndex.value} of ${stepTotal.value}`, optedIn: 'Opt-in horizontal marks', base: 'Native small Progress, no opt-in'
|
|
61
|
+
});
|
|
62
|
+
const emptyWords = computed(() => locale.value === 'vi' ? {
|
|
63
|
+
title: 'Empty gốc trong vùng được cấp', description: 'Chọn một mục để xem chi tiết',
|
|
64
|
+
base: 'Empty gốc, không chọn dùng', simple: 'Hình đơn giản gốc'
|
|
65
|
+
} : {
|
|
66
|
+
title: 'Native Empty in allocated slots', description: 'Select an item to view details',
|
|
67
|
+
base: 'Native Empty, no opt-in', simple: 'Native simple illustration'
|
|
68
|
+
});
|
|
69
|
+
const expandedChoices = ref<string[]>(['flow']);
|
|
70
|
+
const choices = computed(() => locale.value === 'vi'
|
|
71
|
+
? [{ key: 'transform', title: 'Biến đổi dữ liệu đầu-cuối', shortcut: 'Ctrl+2' }, { key: 'flow', title: 'Luồng đồng bộ', shortcut: 'Ctrl+3' }]
|
|
72
|
+
: [{ key: 'transform', title: 'End-to-end transformations', shortcut: 'Ctrl+2' }, { key: 'flow', title: 'Sync flow', shortcut: 'Ctrl+3' }]);
|
|
73
|
+
const switchChanges = ref(0);
|
|
74
|
+
const switchSaves = ref(0);
|
|
75
|
+
const switchSaved = ref(false);
|
|
76
|
+
const switchSaving = ref(false);
|
|
77
|
+
let switchSaveTimer: ReturnType<typeof setTimeout> | undefined;
|
|
78
|
+
const switchExamples = (['default', 'small'] as const).flatMap(size =>
|
|
79
|
+
(['enabled', 'loading', 'disabled'] as const).flatMap(availability =>
|
|
80
|
+
[false, true].map(initialChecked => ({
|
|
81
|
+
id: `${controlId}-switch-${size}-${availability}-${initialChecked}`,
|
|
82
|
+
size, availability, initialChecked, checked: ref(initialChecked)
|
|
83
|
+
}))));
|
|
84
|
+
const switchWords = computed(() => locale.value === 'vi' ? {
|
|
85
|
+
title: 'Công tắc gốc: bật không có nghĩa là thành công',
|
|
86
|
+
help: 'Đổi giao diện sáng/tối và ngôn ngữ của trang. Di chuột, nhấn giữ hoặc dùng Tab, Space/Enter và phím trái/phải. Công tắc đang xử lý hoặc bị vô hiệu hóa không được tăng bộ đếm.',
|
|
87
|
+
on: 'Bật', off: 'Tắt', normal: 'Cỡ thường', small: 'Cỡ nhỏ',
|
|
88
|
+
enabled: 'Có thể dùng', loading: 'Đang xử lý', disabled: 'Vô hiệu hóa',
|
|
89
|
+
initialOn: 'ban đầu bật', initialOff: 'ban đầu tắt',
|
|
90
|
+
save: 'Lưu có kiểm soát (mô phỏng 1,2 giây)', callbacks: 'Lần gọi thay đổi', saves: 'Lần lưu', saving: 'Đang lưu', saved: 'Đã lưu'
|
|
91
|
+
} : {
|
|
92
|
+
title: 'Native Switch: ON does not mean success',
|
|
93
|
+
help: 'Change the site light/dark theme and language. Hover, hold a press or use Tab, Space/Enter and Left/Right. Loading and disabled switches must not increment the counter.',
|
|
94
|
+
on: 'On', off: 'Off', normal: 'Normal', small: 'Small',
|
|
95
|
+
enabled: 'Available', loading: 'Loading', disabled: 'Disabled',
|
|
96
|
+
initialOn: 'initially on', initialOff: 'initially off',
|
|
97
|
+
save: 'Controlled save (1.2-second simulation)', callbacks: 'Change callbacks', saves: 'Saves', saving: 'Saving', saved: 'Saved'
|
|
98
|
+
});
|
|
99
|
+
const switchExampleLabel = (sample: typeof switchExamples[number]) => {
|
|
100
|
+
const words = switchWords.value;
|
|
101
|
+
return `${sample.size === 'small' ? words.small : words.normal} / ${words[sample.availability]} / ${sample.initialChecked ? words.initialOn : words.initialOff}`;
|
|
102
|
+
};
|
|
103
|
+
const saveSwitch = (checked: boolean | string | number) => {
|
|
104
|
+
switchSaves.value += 1;
|
|
105
|
+
switchSaving.value = true;
|
|
106
|
+
switchSaveTimer = setTimeout(() => {
|
|
107
|
+
switchSaved.value = checked === true;
|
|
108
|
+
switchSaving.value = false;
|
|
109
|
+
switchSaveTimer = undefined;
|
|
110
|
+
}, 1200);
|
|
111
|
+
};
|
|
112
|
+
const syncContext = () => {
|
|
113
|
+
dark.value = document.documentElement.dataset.theme === 'dark';
|
|
114
|
+
locale.value = document.documentElement.lang.startsWith('vi') ? 'vi' : 'en';
|
|
115
|
+
};
|
|
116
|
+
const observer = new MutationObserver(syncContext);
|
|
117
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme', 'lang'] });
|
|
118
|
+
onBeforeUnmount(() => {
|
|
119
|
+
observer.disconnect();
|
|
120
|
+
if (switchSaveTimer !== undefined) clearTimeout(switchSaveTimer);
|
|
121
|
+
});
|
|
122
|
+
const theme = computed(() => createAntDesignVueTheme({ dark: dark.value, locale: locale.value, rootFontSize: rootFontSize.value }));
|
|
123
|
+
const gap = () => tokenPixels('space.100', locale.value, rootFontSize.value);
|
|
124
|
+
const clearFilters = () => { query.value = ''; status.value = 'all'; };
|
|
125
|
+
return () => h(ConfigProvider, { theme: theme.value }, () => h(Flex, { vertical: true, style: { gap: 'var(--bh-space-200)' } }, () => [
|
|
126
|
+
h(Alert, { type: 'info', message: 'Real native controls: utility triggers and page controls share one family; avatar actions remain frameless.' }),
|
|
127
|
+
h(Space, { size: gap(), wrap: true, align: 'center' }, () => [
|
|
128
|
+
h(Dropdown, { trigger: ['click'], open: languageOpen.value, 'onUpdate:open': (open: boolean) => { languageOpen.value = open; } }, {
|
|
129
|
+
default: () => h(Button, { ref: languageTrigger, 'data-bh-target': 'responsive', 'aria-label': 'Choose demonstration language', 'aria-haspopup': 'menu', 'aria-expanded': languageOpen.value }, {
|
|
130
|
+
icon: () => h(GlobalOutlined), default: () => language.value
|
|
131
|
+
}),
|
|
132
|
+
overlay: () => h(Menu, { selectedKeys: [language.value], onKeydown: (event: KeyboardEvent) => { if (event.key === 'Escape') { event.stopPropagation(); closeLanguage(); } }, onClick: ({ key }: { key: string | number }) => { language.value = String(key); closeLanguage(); } }, () => [
|
|
133
|
+
h(MenuItem, { key: 'English', lang: 'en' }, () => 'English'),
|
|
134
|
+
h(MenuItem, { key: 'Tiếng Việt', lang: 'vi' }, () => 'Tiếng Việt')
|
|
135
|
+
])
|
|
136
|
+
}),
|
|
137
|
+
h(Button, { 'data-bh-target': 'responsive', 'aria-label': 'Clear demonstration filters', onClick: clearFilters }, { icon: () => h(ClearOutlined) }),
|
|
138
|
+
h(Button, { type: 'text', 'data-bh-target': 'responsive', onClick: () => { details.value = true; } }, () => h(Space, { size: gap(), align: 'center' }, () => [
|
|
139
|
+
h(Avatar, { size: tokenPixels('size.control.small', locale.value, rootFontSize.value) }, () => 'BH'), 'Sample account'
|
|
140
|
+
]))
|
|
141
|
+
]),
|
|
142
|
+
...(['small', 'middle', 'large'] as const).map(size => h(Space, { size: gap(), wrap: true, align: 'center' }, () => [
|
|
143
|
+
h(Button, { size, onClick: () => { details.value = true; } }, () => 'Default action'),
|
|
144
|
+
h(Button, { size, type: 'primary', onClick: () => { details.value = true; } }, () => 'Primary action'),
|
|
145
|
+
h(InputSearch, { size, value: query.value, 'aria-label': `${size} search`, placeholder: 'Search', 'onUpdate:value': (value: string) => { query.value = value; }, onSearch: () => { details.value = true; }, style: { width: 'min(100%, 14rem)' } }),
|
|
146
|
+
h('label', { for: `${controlId}-${size}`, 'data-bh-font': 'label-default' }, `${size} status`),
|
|
147
|
+
h(Select, { id: `${controlId}-${size}`, size, value: status.value, options: [{ value: 'all', label: 'All statuses' }, { value: 'active', label: 'Active' }], 'onUpdate:value': (value: SelectProps['value']) => { status.value = value; }, style: { width: 'min(100%, 10rem)' } })
|
|
148
|
+
])),
|
|
149
|
+
h(Space, { size: gap(), wrap: true }, () => [
|
|
150
|
+
h(Button, { disabled: true }, () => 'Disabled'),
|
|
151
|
+
h(Button, { loading: true }, () => 'Loading'),
|
|
152
|
+
h(Button, { type: 'text', onClick: clearFilters }, () => 'Frameless action'),
|
|
153
|
+
h(Button, { type: 'link', onClick: () => { details.value = true; } }, () => 'Link-style action')
|
|
154
|
+
]),
|
|
155
|
+
h(Flex, { vertical: true, style: { gap: 'var(--bh-space-100)' } }, () => [
|
|
156
|
+
h('h3', { 'data-bh-font': 'heading-small' }, buttonWords.value.title),
|
|
157
|
+
h('p', { 'data-bh-font': 'body-small' }, buttonWords.value.help),
|
|
158
|
+
h(Space, { size: gap(), wrap: true }, () => [
|
|
159
|
+
h('label', { for: `${controlId}-button-size` }, buttonWords.value.size),
|
|
160
|
+
h(Select, {
|
|
161
|
+
id: `${controlId}-button-size`, value: buttonSize.value, style: { width: '8rem' },
|
|
162
|
+
options: buttonSizeOptions,
|
|
163
|
+
'onUpdate:value': (value: SelectProps['value']) => { if (value === 'small' || value === 'middle' || value === 'large') buttonSize.value = value; }
|
|
164
|
+
})
|
|
165
|
+
]),
|
|
166
|
+
...buttonCases.map(sample => h(Space, {
|
|
167
|
+
key: sample.key, size: gap(), wrap: true, align: 'center',
|
|
168
|
+
style: sample.inverse ? { background: 'var(--bh-color-surface-inverse)', padding: 'var(--bh-space-100)' } : undefined
|
|
169
|
+
}, () => [
|
|
170
|
+
h('span', { 'data-bh-font': 'label-small', style: sample.inverse ? { color: 'var(--bh-color-text-inverse)' } : undefined },
|
|
171
|
+
`${sample.type}${sample.danger ? ` / ${buttonWords.value.danger}` : ''}${sample.ghost ? ` / ${buttonWords.value.ghost}` : ''}`),
|
|
172
|
+
...buttonAvailability.map(availability => h(Button, {
|
|
173
|
+
type: sample.type, danger: sample.danger, ghost: sample.ghost, size: buttonSize.value,
|
|
174
|
+
loading: availability === 'loading', disabled: availability === 'disabled',
|
|
175
|
+
'data-native-button-case': `${sample.key}-${availability}`,
|
|
176
|
+
onClick: activateButton
|
|
177
|
+
}, { icon: () => h(RightOutlined), default: () => `${buttonWords.value[sample.type]} / ${buttonWords.value[availability]}` }))
|
|
178
|
+
])),
|
|
179
|
+
h(Button, { href: `#${controlId}-activations`, type: 'link', disabled: true, 'data-native-button-case': 'disabled-anchor' }, () => buttonWords.value.anchor),
|
|
180
|
+
h('output', { id: `${controlId}-activations`, role: 'status', 'data-bh-font': 'body-small' }, `${buttonWords.value.presses}: ${buttonPresses.value}`)
|
|
181
|
+
]),
|
|
182
|
+
h(Flex, { vertical: true, style: { gap: 'var(--bh-space-100)' } }, () => [
|
|
183
|
+
h('h3', { 'data-bh-font': 'heading-small' }, stepWords.value.title),
|
|
184
|
+
h(Space, { size: gap(), wrap: true, align: 'center' }, () => [
|
|
185
|
+
h('label', { for: `${controlId}-step-total` }, stepWords.value.total),
|
|
186
|
+
h(InputNumber, {
|
|
187
|
+
id: `${controlId}-step-total`, min: 1, precision: 0, value: stepTotal.value,
|
|
188
|
+
onChange: (value: number | string | null) => {
|
|
189
|
+
if (typeof value === 'number' && value >= 1) { stepTotal.value = value; stepIndex.value = Math.min(stepIndex.value, value); }
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
h(Button, { onClick: () => { stepIndex.value = 1; } }, () => stepWords.value.first),
|
|
193
|
+
h(Button, { onClick: () => { stepIndex.value = Math.ceil(stepTotal.value / 2); } }, () => stepWords.value.middle),
|
|
194
|
+
h(Button, { onClick: () => { stepIndex.value = stepTotal.value; } }, () => stepWords.value.last)
|
|
195
|
+
]),
|
|
196
|
+
h('span', { 'data-bh-font': 'label-small' }, stepWords.value.optedIn),
|
|
197
|
+
h(Space, { size: gap(), wrap: true, align: 'center' }, () => [
|
|
198
|
+
h('span', { 'data-bh-font': 'label-small' }, stepWords.value.current),
|
|
199
|
+
h(Progress, {
|
|
200
|
+
class: 'bh-ant-step-progress', steps: stepTotal.value, percent: stepIndex.value / stepTotal.value * 100,
|
|
201
|
+
size: stepSize.value, showInfo: false, 'aria-hidden': true,
|
|
202
|
+
strokeColor: getStatusColor('info', 'border', { dark: dark.value })
|
|
203
|
+
})
|
|
204
|
+
]),
|
|
205
|
+
h('span', { 'data-bh-font': 'label-small' }, stepWords.value.base),
|
|
206
|
+
h(Progress, {
|
|
207
|
+
steps: stepTotal.value, percent: stepIndex.value / stepTotal.value * 100, size: 'small',
|
|
208
|
+
showInfo: false, 'aria-hidden': true, strokeColor: getStatusColor('info', 'border', { dark: dark.value })
|
|
209
|
+
})
|
|
210
|
+
]),
|
|
211
|
+
h(Flex, { vertical: true, style: { gap: 'var(--bh-space-100)' } }, () => [
|
|
212
|
+
h('h3', { 'data-bh-font': 'heading-small' }, emptyWords.value.title),
|
|
213
|
+
...[2, 4, 12].map(rows => h(Card, { size: 'small', title: `${rows} rem` }, () =>
|
|
214
|
+
h('div', { 'data-native-empty-fit': rows, style: { display: 'flex', alignItems: 'center', justifyContent: 'center', blockSize: `${rows}rem`, minBlockSize: 0, overflow: 'auto' } },
|
|
215
|
+
h(Empty, { class: 'bh-ant-fit-empty', description: emptyWords.value.description })))),
|
|
216
|
+
h(Card, { size: 'small', title: emptyWords.value.simple }, () =>
|
|
217
|
+
h('div', { 'data-native-empty-fit': 'simple', style: { display: 'flex', alignItems: 'center', justifyContent: 'center', blockSize: '4rem', minBlockSize: 0, overflow: 'auto' } },
|
|
218
|
+
h(Empty, { class: 'bh-ant-fit-empty', image: Empty.PRESENTED_IMAGE_SIMPLE, description: emptyWords.value.description }))),
|
|
219
|
+
h(Card, { size: 'small', title: emptyWords.value.base }, () =>
|
|
220
|
+
h(Empty, { description: emptyWords.value.description }))
|
|
221
|
+
]),
|
|
222
|
+
h(Card, { title: locale.value === 'vi' ? 'Nhãn loại luồng' : 'Flow category badges', 'data-native-flow-categories': '' }, () =>
|
|
223
|
+
h(Space, { size: gap(), wrap: true }, () =>
|
|
224
|
+
['task', 'dependency', 'transformation', 'validation', 'pushStep', 'decision', 'loop', 'grouped'].map(category =>
|
|
225
|
+
h(Tag, { key: category, style: getFlowCategoryBadgeStyles(category) }, () => category)))),
|
|
226
|
+
h(Flex, { vertical: true, style: { gap: 'var(--bh-space-100)' } }, () => choices.value.map(choice => {
|
|
227
|
+
const expanded = expandedChoices.value.includes(choice.key);
|
|
228
|
+
return h(Card, { key: choice.key, size: 'small' }, {
|
|
229
|
+
title: () => h('div', { style: { display: 'grid', gridTemplateColumns: 'auto minmax(0, 1fr) max-content', alignItems: 'center', gap: 'var(--bh-space-100)' } }, [
|
|
230
|
+
h(Button, {
|
|
231
|
+
type: 'text', size: 'small', 'data-bh-target': 'responsive', 'aria-expanded': expanded,
|
|
232
|
+
'aria-controls': expanded ? `${controlId}-choice-${choice.key}` : undefined,
|
|
233
|
+
'aria-label': `${locale.value === 'vi' ? (expanded ? 'Thu gọn' : 'Mở rộng') : (expanded ? 'Collapse' : 'Expand')} ${choice.title}`,
|
|
234
|
+
onClick: () => { expandedChoices.value = expanded ? expandedChoices.value.filter(key => key !== choice.key) : [...expandedChoices.value, choice.key]; }
|
|
235
|
+
}, { icon: () => h(RightOutlined, { rotate: expanded ? 90 : 0 }) }),
|
|
236
|
+
h(Button, {
|
|
237
|
+
type: 'text', block: true, 'data-bh-layout': 'content',
|
|
238
|
+
'aria-current': selectedChoice.value === choice.key ? 'true' : undefined,
|
|
239
|
+
onClick: () => { selectedChoice.value = choice.key; }
|
|
240
|
+
}, { icon: () => h(GlobalOutlined), default: () => h(TypographyText, { strong: selectedChoice.value === choice.key }, () => choice.title) }),
|
|
241
|
+
h(Tag, () => choice.shortcut)
|
|
242
|
+
]),
|
|
243
|
+
...(expanded ? {
|
|
244
|
+
default: () => h('p', { id: `${controlId}-choice-${choice.key}` }, locale.value === 'vi'
|
|
245
|
+
? 'Nút mũi tên mở hoặc thu gọn chi tiết; nút tiêu đề chọn chế độ xem độc lập. Nhãn phím tắt minh họa căn cột, không gán phím của trình duyệt.'
|
|
246
|
+
: 'The arrow opens or closes details; the title independently selects the view. Shortcut labels demonstrate column alignment; this sample does not bind browser shortcuts.')
|
|
247
|
+
} : {})
|
|
248
|
+
});
|
|
249
|
+
})),
|
|
250
|
+
h(Flex, { vertical: true, style: { gap: 'var(--bh-space-100)' } }, () => [
|
|
251
|
+
h('h3', { 'data-bh-font': 'heading-small' }, switchWords.value.title),
|
|
252
|
+
h('p', { 'data-bh-font': 'body-small' }, switchWords.value.help),
|
|
253
|
+
...switchExamples.map(sample => h(Space, { key: sample.id, size: gap(), wrap: true, align: 'center' }, () => [
|
|
254
|
+
h('label', { for: sample.id, 'data-bh-font': 'label-small' }, switchExampleLabel(sample)),
|
|
255
|
+
h(Switch, {
|
|
256
|
+
id: sample.id, size: sample.size, checked: sample.checked.value,
|
|
257
|
+
checkedChildren: switchWords.value.on, unCheckedChildren: switchWords.value.off,
|
|
258
|
+
loading: sample.availability === 'loading', disabled: sample.availability === 'disabled',
|
|
259
|
+
'data-native-switch-case': `${sample.size}-${sample.availability}-${sample.initialChecked}`,
|
|
260
|
+
'onUpdate:checked': (checked: boolean | string | number) => { sample.checked.value = checked === true; },
|
|
261
|
+
onChange: () => { switchChanges.value += 1; }
|
|
262
|
+
})
|
|
263
|
+
])),
|
|
264
|
+
h(Space, { size: gap(), wrap: true, align: 'center' }, () => [
|
|
265
|
+
h('label', { for: `${controlId}-switch-save`, 'data-bh-font': 'label-small' }, switchWords.value.save),
|
|
266
|
+
h(Switch, {
|
|
267
|
+
id: `${controlId}-switch-save`, checked: switchSaved.value, loading: switchSaving.value,
|
|
268
|
+
checkedChildren: switchWords.value.on, unCheckedChildren: switchWords.value.off,
|
|
269
|
+
'data-native-switch-case': 'controlled-save', onChange: saveSwitch
|
|
270
|
+
})
|
|
271
|
+
]),
|
|
272
|
+
h('output', { role: 'status', 'data-bh-font': 'body-small' }, `${switchWords.value.callbacks}: ${switchChanges.value}; ${switchWords.value.saves}: ${switchSaves.value}; ${switchSaving.value ? switchWords.value.saving : switchWords.value.saved}: ${switchSaved.value ? switchWords.value.on : switchWords.value.off}.`)
|
|
273
|
+
]),
|
|
274
|
+
h(Modal, { open: details.value, title: 'Native action details', onCancel: () => { details.value = false; }, onOk: () => { details.value = false; } }, () => `Search: ${query.value || '(empty)'}; status: ${status.value}; language label: ${language.value}.`)
|
|
275
|
+
]));
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
for (const host of document.querySelectorAll<HTMLElement>('[data-native-control-family]')) createApp(Demo).mount(host);
|
|
279
|
+
</script>
|
|
@@ -28,15 +28,15 @@ const users = [['LN', 'Linh Nguyen', 'Admin', true], ['TP', 'Tuan Pham', 'Editor
|
|
|
28
28
|
<div class="op-grid">
|
|
29
29
|
{conns.map(([code, name, tone, isOn]) => (
|
|
30
30
|
<div class={isOn ? 'op-tile' : 'op-tile is-off'}>
|
|
31
|
-
<span class="op-tile-top"><span class={`op-logo is-${tone}`}
|
|
32
|
-
<b
|
|
31
|
+
<span class="op-tile-top"><span class={`op-logo is-${tone}`} data-sample={code} /><span class="op-switch"></span></span>
|
|
32
|
+
<b data-sample={name} /><span class="op-status" data-sample={isOn ? on : off} />
|
|
33
33
|
</div>
|
|
34
34
|
))}
|
|
35
35
|
</div>
|
|
36
36
|
<span class="op-label">{L('Team members', 'Thành viên')}</span>
|
|
37
37
|
<div class="op-list">
|
|
38
38
|
{users.map(([ini, name, role, isOn]) => (
|
|
39
|
-
<div class={isOn ? 'op-row' : 'op-row is-off'}><span class="op-avatar"
|
|
39
|
+
<div class={isOn ? 'op-row' : 'op-row is-off'}><span class="op-avatar" data-sample={ini} /><span class="op-name" data-sample={name} /><span class="op-role" data-sample={role} /></div>
|
|
40
40
|
))}
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -46,9 +46,9 @@ const users = [['LN', 'Linh Nguyen', 'Admin', true], ['TP', 'Tuan Pham', 'Editor
|
|
|
46
46
|
<div class="sh-ex-grid is-one sh-root">
|
|
47
47
|
<div class="sh-ex op-ex">
|
|
48
48
|
<div class="op-tile is-off op-tile-lg" role="img" aria-label={L('A turned-off connection: the logo is faded, the text uses the disabled colour', 'Một kết nối đã tắt: logo mờ đi, chữ dùng màu disabled')}>
|
|
49
|
-
<span class="op-tile-top"><Pin solid label={`${L('Opacity', 'Độ mờ')}: opacity.disabled`} at="top" len="200"><span class="op-logo is-c"
|
|
50
|
-
<b
|
|
51
|
-
<Pin solid label={`${L('Text', 'Chữ')}: color.text.disabled`} at="bottom" len="300"><span class="op-status"
|
|
49
|
+
<span class="op-tile-top"><Pin solid label={`${L('Opacity', 'Độ mờ')}: opacity.disabled`} at="top" len="200"><span class="op-logo is-c" data-sample="AC" /></Pin><span class="op-switch"></span></span>
|
|
50
|
+
<b data-sample={L('Accounting', 'Kế toán')} />
|
|
51
|
+
<Pin solid label={`${L('Text', 'Chữ')}: color.text.disabled`} at="bottom" len="300"><span class="op-status" data-sample={off} /></Pin>
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
@@ -77,10 +77,10 @@ const users = [['LN', 'Linh Nguyen', 'Admin', true], ['TP', 'Tuan Pham', 'Editor
|
|
|
77
77
|
<figcaption><span aria-hidden="true">{side === 'do' ? '✓' : '✕'}</span> {side === 'do' ? L('Do', 'Nên') : L('Don’t', 'Không nên')}</figcaption>
|
|
78
78
|
<div class="sp-dd-stage">
|
|
79
79
|
{item === 'container' && (
|
|
80
|
-
<div class={side === 'do' ? 'op-tile is-off' : 'op-tile is-wrong'}><span class="op-tile-top"><span class="op-logo is-c"
|
|
80
|
+
<div class={side === 'do' ? 'op-tile is-off' : 'op-tile is-wrong'} role="img" aria-label={side === 'do' ? L('Accounting connection, turned off: only the logo is faded', 'Kết nối Kế toán đã tắt: chỉ logo mờ đi') : L('Accounting connection, turned off: the whole tile is faded', 'Kết nối Kế toán đã tắt: cả ô bị làm mờ')}><span class="op-tile-top"><span class="op-logo is-c" data-sample="AC" /><span class="op-switch"></span></span><b data-sample={L('Accounting', 'Kế toán')} /><span class="op-status" data-sample={off} /></div>
|
|
81
81
|
)}
|
|
82
82
|
{item === 'controls' && (
|
|
83
|
-
<div class="op-band"><span class="op-band-text">{L('Sync paused for 2 stores', 'Đã tạm dừng đồng bộ 2 cửa hàng')}</span><span class={side === 'do' ? 'sp-btn op-btn-off' : 'sp-btn is-primary op-btn-faded'}
|
|
83
|
+
<div class="op-band" role="img" aria-label={L('Sync paused for 2 stores, with a disabled Resume button', 'Đã tạm dừng đồng bộ 2 cửa hàng, nút Tiếp tục bị vô hiệu')}><span class="op-band-text">{L('Sync paused for 2 stores', 'Đã tạm dừng đồng bộ 2 cửa hàng')}</span><span class={side === 'do' ? 'sp-btn op-btn-off' : 'sp-btn is-primary op-btn-faded'} data-sample={L('Resume', 'Tiếp tục')} /></div>
|
|
84
84
|
)}
|
|
85
85
|
</div>
|
|
86
86
|
<p>
|
|
@@ -15,10 +15,10 @@ const roles = [
|
|
|
15
15
|
{
|
|
16
16
|
title: 'Develop',
|
|
17
17
|
href: '/get-started/develop/',
|
|
18
|
-
summary: 'Ship the tokens
|
|
18
|
+
summary: 'Ship the tokens and lint rules.',
|
|
19
19
|
links: [
|
|
20
20
|
['Use the token CSS', '/foundations/tokens/all-tokens/'],
|
|
21
|
-
['
|
|
21
|
+
['Build for keyboard and focus', '/foundations/guidelines/accessibility/keyboard-and-focus/'],
|
|
22
22
|
['Add the lint rules', '/tools/stylelint/'],
|
|
23
23
|
['Docs for AI agents', '/tools/ai-agents/'],
|
|
24
24
|
],
|
|
@@ -11,7 +11,7 @@ import CircleAlert from '@lucide/astro/icons/circle-alert';
|
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
13
13
|
kind: 'radius-scale' | 'radius-use' | 'nesting' | 'focus-radius' | 'border-scale' | 'border-use' | 'dodont';
|
|
14
|
-
/** radius-use: '0' | '050' | '100' | '150' | '200' | 'full'. border-use: 'default' | 'selected' | 'focused' | 'accent'. dodont: see below. */
|
|
14
|
+
/** radius-use: '0' | '025' | '050' | '075' | '100' | '150' | '200' | 'full'. border-use: 'default' | 'selected' | 'focused' | 'accent'. dodont: see below. */
|
|
15
15
|
item?: string;
|
|
16
16
|
}
|
|
17
17
|
const { kind, item } = Astro.props;
|
|
@@ -59,7 +59,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
59
59
|
)}
|
|
60
60
|
|
|
61
61
|
{kind === 'radius-use' && (
|
|
62
|
-
<div class:list={['sh-ex-grid', 'sh-root', { 'is-one': item === '0' || item === '
|
|
62
|
+
<div class:list={['sh-ex-grid', 'sh-root', { 'is-one': item === '0' || item === '150' }]}>
|
|
63
63
|
{item === '0' && (
|
|
64
64
|
<div class="sh-ex">
|
|
65
65
|
<Pin label="radius.0" r="0px">
|
|
@@ -73,36 +73,64 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
73
73
|
</Pin>
|
|
74
74
|
</div>
|
|
75
75
|
)}
|
|
76
|
+
{item === '025' && (
|
|
77
|
+
<Fragment>
|
|
78
|
+
<div class="sh-ex"><Pin label="radius.025" r="var(--bh-radius-025)"><span class="sh-badge">3</span></Pin></div>
|
|
79
|
+
<div class="sh-ex"><span class="sh-row"><Pin label="radius.025" r="var(--bh-radius-025)"><span class="sh-check" set:html={tick}></span></Pin><span>{L('Sync stock', 'Đồng bộ tồn kho')}</span></span></div>
|
|
80
|
+
<div class="sh-ex"><Pin label="radius.025" r="var(--bh-radius-025)"><kbd class="sh-kbd">Ctrl K</kbd></Pin></div>
|
|
81
|
+
</Fragment>
|
|
82
|
+
)}
|
|
76
83
|
{item === '050' && (
|
|
77
84
|
<Fragment>
|
|
85
|
+
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="sp-btn is-primary">{L('Connect', 'Kết nối')}</span></Pin></div>
|
|
86
|
+
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="sp-input" style="width: 14rem"><span style="width: var(--bh-space-control-x)"></span><span>mystore.example.com</span></span></Pin></div>
|
|
78
87
|
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="sh-tag">{L('Online store', 'Cửa hàng online')}</span></Pin></div>
|
|
79
|
-
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="
|
|
80
|
-
<div class="sh-ex"><
|
|
88
|
+
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="kit-label">{L('Synced', 'Đã đồng bộ')}</span></Pin></div>
|
|
89
|
+
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="sp-btn is-small">{L('Retry', 'Thử lại')}</span></Pin></div>
|
|
81
90
|
<div class="sh-ex"><span class="sh-menu"><span>{L('Edit mapping', 'Sửa mapping')}</span><Pin label="radius.050" r="var(--bh-radius-050)" len="600"><span class="is-on" style="flex: 1">{L('Run sync now', 'Đồng bộ ngay')}</span></Pin><span>{L('Pause', 'Tạm dừng')}</span></span></div>
|
|
82
91
|
</Fragment>
|
|
83
92
|
)}
|
|
93
|
+
{item === '075' && (
|
|
94
|
+
<Fragment>
|
|
95
|
+
<div class="sh-ex"><Pin label="radius.075" r="var(--bh-radius-075)"><span class="kit-nav-item is-selected" style="width: 12rem">{L('Tasks', 'Tác vụ')}</span></Pin></div>
|
|
96
|
+
</Fragment>
|
|
97
|
+
)}
|
|
84
98
|
{item === '100' && (
|
|
85
99
|
<Fragment>
|
|
86
|
-
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="sp-btn is-primary">{L('Connect', 'Kết nối')}</span></Pin></div>
|
|
87
|
-
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="sp-input" style="width: 14rem"><span style="width: var(--bh-space-150)"></span><span>mystore.example.com</span></span></Pin></div>
|
|
88
100
|
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="sh-tip">{L('Copied to clipboard', 'Đã sao chép')}</span></Pin></div>
|
|
89
101
|
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="kit-banner is-danger"><CircleAlert size={16} aria-hidden="true" />{L('Sync failed for 12 orders. Retrying in 5 minutes.', 'Đồng bộ lỗi 12 đơn hàng. Thử lại sau 5 phút.')}</span></Pin></div>
|
|
102
|
+
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="sh-card"><b>{L('Online store', 'Cửa hàng online')}</b><span>{L('Connected · last sync 2 minutes ago', 'Đã kết nối · đồng bộ lần cuối 2 phút trước')}</span></span></Pin></div>
|
|
103
|
+
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="sh-group"><span class="is-on">{L('Orders', 'Đơn hàng')}</span><span>{L('Products', 'Sản phẩm')}</span></span></Pin></div>
|
|
90
104
|
</Fragment>
|
|
91
105
|
)}
|
|
92
106
|
{item === '150' && (
|
|
93
107
|
<Fragment>
|
|
94
|
-
<div class="sh-ex"
|
|
95
|
-
|
|
108
|
+
<div class="sh-ex">
|
|
109
|
+
<Pin label="radius.150" r="var(--bh-radius-150)">
|
|
110
|
+
<span class="sh-dialog" role="img" aria-label={L('A dialog with 12 px corners', 'Dialog bo góc 12 px')}>
|
|
111
|
+
<b>{L('Disconnect the online store?', 'Ngắt kết nối cửa hàng online?')}</b>
|
|
112
|
+
<p>{L('Orders stop syncing until you connect again.', 'Đơn hàng sẽ ngừng đồng bộ cho đến khi bạn kết nối lại.')}</p>
|
|
113
|
+
<span class="sh-row"><span class="sp-btn">{L('Cancel', 'Huỷ')}</span><span class="sp-btn is-primary">{L('Disconnect', 'Ngắt kết nối')}</span></span>
|
|
114
|
+
</span>
|
|
115
|
+
</Pin>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="sh-ex">
|
|
118
|
+
<Pin label="radius.150" r="var(--bh-radius-150)">
|
|
119
|
+
<div class="sh-frame is-framed" role="img" aria-label={L('A table in its own frame with 12 px corners', 'Bảng có khung riêng, bo góc 12 px')}>
|
|
120
|
+
<header>{L('Sync logs', 'Nhật ký đồng bộ')}</header>
|
|
121
|
+
<div class="sh-table">
|
|
122
|
+
<span><em>10:42:07</em>{L('Order #10293', 'Đơn #10293')}<em>{L('Synced', 'Đã đồng bộ')}</em></span>
|
|
123
|
+
<span><em>10:42:11</em>{L('Order #10295', 'Đơn #10295')}<em>{L('Synced', 'Đã đồng bộ')}</em></span>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</Pin>
|
|
127
|
+
</div>
|
|
96
128
|
</Fragment>
|
|
97
129
|
)}
|
|
98
130
|
{item === '200' && (
|
|
99
131
|
<div class="sh-ex">
|
|
100
132
|
<Pin label="radius.200" r="var(--bh-radius-200)">
|
|
101
|
-
<span class="sh-
|
|
102
|
-
<b>{L('Disconnect the online store?', 'Ngắt kết nối cửa hàng online?')}</b>
|
|
103
|
-
<p>{L('Orders stop syncing until you connect again.', 'Đơn hàng sẽ ngừng đồng bộ cho đến khi bạn kết nối lại.')}</p>
|
|
104
|
-
<span class="sh-row"><span class="sp-btn">{L('Cancel', 'Huỷ')}</span><span class="sp-btn is-primary">{L('Disconnect', 'Ngắt kết nối')}</span></span>
|
|
105
|
-
</span>
|
|
133
|
+
<span class="sh-swatch" style="border-radius: var(--bh-radius-200)" role="img" aria-label={L('16 px scale value; no current component role', 'Giá trị thang 16 px; chưa gán vai trò component hiện tại')}></span>
|
|
106
134
|
</Pin>
|
|
107
135
|
</div>
|
|
108
136
|
)}
|
|
@@ -110,8 +138,8 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
110
138
|
<Fragment>
|
|
111
139
|
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-default) / 2)"><span class="sh-avatar">TN</span></Pin></div>
|
|
112
140
|
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-space-250) / 2)"><span class="sh-switch" role="img" aria-label={L('Switch, on', 'Switch, đang bật')}></span></Pin></div>
|
|
113
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-default) / 2)"><span class="sh-chip">{L('
|
|
114
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-
|
|
141
|
+
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-default) / 2)"><span class="sh-chip">{L('Status: Failed', 'Trạng thái: Thất bại')}<span aria-hidden="true">×</span></span></Pin></div>
|
|
142
|
+
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-default) / 2)"><span class="sh-chip is-on" role="img" aria-label={L('Filter chip, on: Failed', 'Chip lọc, đang bật: Thất bại')}>{L('Failed', 'Thất bại')}</span></Pin></div>
|
|
115
143
|
</Fragment>
|
|
116
144
|
)}
|
|
117
145
|
</div>
|
|
@@ -120,29 +148,44 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
120
148
|
{kind === 'nesting' && (
|
|
121
149
|
<div class="sh-nest-grid sh-root">
|
|
122
150
|
<figure class="sh-nest">
|
|
123
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
151
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-100); padding: var(--bh-space-050)"><span class="sh-inner" style="border-radius: var(--bh-radius-050)">{L('Image', 'Ảnh')}</span></div>
|
|
152
|
+
<span class="sh-sum">8 − 4 = 4</span>
|
|
153
|
+
<figcaption>{L('No role: an image in a card, 4 px from the edge', 'Không có vai trò: ảnh trong card, cách mép 4 px')}</figcaption>
|
|
154
|
+
</figure>
|
|
155
|
+
<figure class="sh-nest">
|
|
156
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-150); padding: var(--bh-space-050)"><span class="sh-inner" style="border-radius: var(--bh-radius-100)">{L('Panel', 'Panel')}</span></div>
|
|
124
157
|
<span class="sh-sum">12 − 4 = 8</span>
|
|
125
|
-
<figcaption>{L('
|
|
158
|
+
<figcaption>{L('No role: a panel in a dialog, 4 px from the edge', 'Không có vai trò: panel trong dialog, cách mép 4 px')}</figcaption>
|
|
126
159
|
</figure>
|
|
127
160
|
<figure class="sh-nest">
|
|
128
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
129
|
-
<span class="sh-sum">
|
|
130
|
-
<figcaption>{L('
|
|
161
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-150); padding: var(--bh-space-100)"><span class="sh-inner" style="border-radius: var(--bh-radius-050)">{L('Image', 'Ảnh')}</span></div>
|
|
162
|
+
<span class="sh-sum">12 − 8 = 4</span>
|
|
163
|
+
<figcaption>{L('No role: an image in a drawer, 8 px from the edge', 'Không có vai trò: ảnh trong drawer, cách mép 8 px')}</figcaption>
|
|
131
164
|
</figure>
|
|
132
165
|
<figure class="sh-nest">
|
|
133
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
134
|
-
<span class="sh-sum">
|
|
135
|
-
<figcaption>{L('
|
|
166
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-card); padding: var(--bh-space-050)"><span class="sh-inner" style="border-radius: var(--bh-radius-control); min-height: var(--bh-size-control-default)">{L('Button', 'Nút')}</span></div>
|
|
167
|
+
<span class="sh-sum">{L('Role: 4', 'Vai trò: 4')}</span>
|
|
168
|
+
<figcaption>{L('Has a role: a button in a card keeps 4 px', 'Có vai trò: nút trong card giữ 4 px')}</figcaption>
|
|
169
|
+
</figure>
|
|
170
|
+
<figure class="sh-nest">
|
|
171
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-control); padding: var(--bh-space-050)"><span class="sh-inner" style="border-radius: var(--bh-radius-pill); min-height: var(--bh-space-250)">{L('Chip', 'Chip')}</span></div>
|
|
172
|
+
<span class="sh-sum">{L('Role: full', 'Vai trò: full')}</span>
|
|
173
|
+
<figcaption>{L('Has a role: a chip in an input stays fully round', 'Có vai trò: chip trong ô nhập vẫn bo tròn hẳn')}</figcaption>
|
|
174
|
+
</figure>
|
|
175
|
+
<figure class="sh-nest">
|
|
176
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-050); padding: var(--bh-space-050)"><span class="sh-inner" style="border-radius: var(--bh-radius-050)">{L('Menu item', 'Mục menu')}</span></div>
|
|
177
|
+
<span class="sh-sum">{L('4 ≥ 4: keep role 4', '4 ≥ 4: giữ vai trò 4')}</span>
|
|
178
|
+
<figcaption>{L('Menu frame and items keep their 4 px role', 'Khung và mục menu giữ vai trò 4 px')}</figcaption>
|
|
136
179
|
</figure>
|
|
137
180
|
<figure class="sh-nest">
|
|
138
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-100); padding: var(--bh-space-075)"><span class="sh-inner" style="border-radius: var(--bh-radius-025); min-height: var(--bh-space-250)">{L('
|
|
181
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-100); padding: var(--bh-space-075)"><span class="sh-inner" style="border-radius: var(--bh-radius-025); min-height: var(--bh-space-250)">{L('Inset image', 'Ảnh lồng bên trong')}</span></div>
|
|
139
182
|
<span class="sh-sum">8 − 6 = 2</span>
|
|
140
|
-
<figcaption>{L('
|
|
183
|
+
<figcaption>{L('Card, image 6 px from the edge', 'Card, ảnh cách mép 6 px')}</figcaption>
|
|
141
184
|
</figure>
|
|
142
185
|
<figure class="sh-nest">
|
|
143
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
144
|
-
<span class="sh-sum">24 >
|
|
145
|
-
<figcaption>{L('Padding larger than the radius: the button keeps its own
|
|
186
|
+
<div class="sh-outer" style="border-radius: var(--bh-radius-100); padding: var(--bh-space-300)"><span class="sh-inner" style="border-radius: var(--bh-radius-050); min-height: var(--bh-size-control-default)">{L('Button', 'Nút')}</span></div>
|
|
187
|
+
<span class="sh-sum">24 > 8</span>
|
|
188
|
+
<figcaption>{L('Padding larger than the radius: the button keeps its own 4 px', 'Padding lớn hơn radius: nút giữ 4 px của nó')}</figcaption>
|
|
146
189
|
</figure>
|
|
147
190
|
</div>
|
|
148
191
|
)}
|
|
@@ -150,10 +193,10 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
150
193
|
{kind === 'focus-radius' && (
|
|
151
194
|
<figure class="sh-fig sh-root">
|
|
152
195
|
<div class="sh-stage">
|
|
153
|
-
<span class="sh-col"><span class="sp-btn is-primary sh-ring">{L('Connect', 'Kết nối')}</span><span class="sh-label">{L('Outside: ring radius
|
|
196
|
+
<span class="sh-col"><span class="sp-btn is-primary sh-ring">{L('Connect', 'Kết nối')}</span><span class="sh-label">{L('Outside: ring radius 4 + 2 = 6', 'Ra ngoài: radius của ring 4 + 2 = 6')}</span></span>
|
|
154
197
|
<span class="sh-col"><span class="sh-menu"><span>{L('Edit mapping', 'Sửa mapping')}</span><span class="is-focus">{L('Run sync now', 'Đồng bộ ngay')}</span><span>{L('Pause', 'Tạm dừng')}</span></span><span class="sh-label">{L('Inside a clipping box: offset −2', 'Trong khung bị cắt: offset −2')}</span></span>
|
|
155
198
|
</div>
|
|
156
|
-
<figcaption><span>{L('The
|
|
199
|
+
<figcaption><span>{L('The ring is the element’s radius + 2 px. In code the browser draws it; in design files, draw it as radius + 2.', 'Ring có radius bằng radius của phần tử + 2 px. Trong code trình duyệt tự vẽ; trong file thiết kế, vẽ ring với radius + 2.')}</span></figcaption>
|
|
157
200
|
</figure>
|
|
158
201
|
)}
|
|
159
202
|
|
|
@@ -201,7 +244,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
201
244
|
<figure class="sp-dd-panel is-do">
|
|
202
245
|
<figcaption><span aria-hidden="true">✓</span> {L('Do', 'Nên')}</figcaption>
|
|
203
246
|
<div class="sp-dd-stage">
|
|
204
|
-
{item === 'nested' && <div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
247
|
+
{item === 'nested' && <div class="sh-outer" style="border-radius: var(--bh-radius-150); padding: var(--bh-space-100); width: 13rem"><span class="sh-inner" style="border-radius: var(--bh-radius-050); min-height: 4rem">{L('Nested control group', 'Nhóm control lồng nhau')}</span></div>}
|
|
205
248
|
{item === 'controls' && <span class="sh-row"><span class="sp-input" style="width: 11rem"><span style="width: var(--bh-space-150)"></span><span>{L('Search orders', 'Tìm đơn hàng')}</span></span><span class="sp-btn is-primary">{L('Search', 'Tìm')}</span></span>}
|
|
206
249
|
{item === 'corners' && <span class="sh-alert"><b>{L('Before the first sync', 'Trước lần đồng bộ đầu tiên')}</b><span>{L('Map the order fields.', 'Hãy ánh xạ các trường đơn hàng.')}</span></span>}
|
|
207
250
|
{item === 'selected' && <span class="sh-tabs"><span class="is-on">{L('Overview', 'Tổng quan')}</span><span>{L('Mappings', 'Mapping')}</span><span>{L('History', 'Lịch sử')}</span></span>}
|
|
@@ -209,8 +252,8 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
209
252
|
{item === 'cards' && <span class="sh-card"><b>{L('Online store', 'Cửa hàng online')}</b><span>{L('Connected', 'Đã kết nối')}</span></span>}
|
|
210
253
|
</div>
|
|
211
254
|
<p>
|
|
212
|
-
{item === 'nested' && L('
|
|
213
|
-
{item === 'controls' && L('Give inputs and buttons the same
|
|
255
|
+
{item === 'nested' && L('The inner group keeps its 4 px role; here it also matches the outer radius minus padding: 12 − 8 = 4.', 'Nhóm bên trong giữ vai trò 4 px; ở đây cũng bằng radius ngoài trừ padding: 12 − 8 = 4.')}
|
|
256
|
+
{item === 'controls' && L('Give inputs and buttons the same 4 px, so a row of controls lines up.', 'Ô nhập và nút dùng chung 4 px, để một hàng control thẳng hàng.')}
|
|
214
257
|
{item === 'corners' && L('Round all four corners and let the accent bar follow them.', 'Bo cả bốn góc và để thanh accent chạy theo góc.')}
|
|
215
258
|
{item === 'selected' && L('Mark the selected tab with a 2 px bar in the selected colour.', 'Đánh dấu tab đang chọn bằng thanh 2 px màu selected.')}
|
|
216
259
|
{item === 'accent' && L('Put the 4 px accent on one edge only.', 'Chỉ đặt accent 4 px ở một cạnh.')}
|
|
@@ -220,7 +263,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
220
263
|
<figure class="sp-dd-panel is-dont">
|
|
221
264
|
<figcaption><span aria-hidden="true">✕</span> {L('Don’t', 'Không nên')}</figcaption>
|
|
222
265
|
<div class="sp-dd-stage">
|
|
223
|
-
{item === 'nested' && <div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
266
|
+
{item === 'nested' && <div class="sh-outer" style="border-radius: var(--bh-radius-150); padding: var(--bh-space-100); width: 13rem"><span class="sh-inner" style="border-radius: var(--bh-radius-150); min-height: 4rem">{L('Nested control group', 'Nhóm control lồng nhau')}</span></div>}
|
|
224
267
|
{item === 'controls' && <span class="sh-row"><span class="sp-input" style="width: 11rem; border-radius: var(--bh-radius-050)"><span style="width: var(--bh-space-150)"></span><span>{L('Search orders', 'Tìm đơn hàng')}</span></span><span class="sp-btn is-primary" style="border-radius: var(--bh-radius-full)">{L('Search', 'Tìm')}</span></span>}
|
|
225
268
|
{item === 'corners' && <span class="sh-alert is-squared"><b>{L('Before the first sync', 'Trước lần đồng bộ đầu tiên')}</b><span>{L('Map the order fields.', 'Hãy ánh xạ các trường đơn hàng.')}</span></span>}
|
|
226
269
|
{item === 'selected' && <span class="sh-tabs" style="--sh-sel: var(--bh-border-width-accent)"><span class="is-on">{L('Overview', 'Tổng quan')}</span><span>{L('Mappings', 'Mapping')}</span><span>{L('History', 'Lịch sử')}</span></span>}
|
|
@@ -228,7 +271,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
228
271
|
{item === 'cards' && <span class="sh-card" style="border-width: var(--bh-border-width-selected); border-color: var(--bh-color-border-bold)"><b>{L('Online store', 'Cửa hàng online')}</b><span>{L('Connected', 'Đã kết nối')}</span></span>}
|
|
229
272
|
</div>
|
|
230
273
|
<p>
|
|
231
|
-
{item === 'nested' && L('The same
|
|
274
|
+
{item === 'nested' && L('The same 12 px inside and out. The gap is wider at the corners than along the sides.', 'Trong và ngoài cùng 12 px. Khoảng hở ở góc rộng hơn ở hai cạnh.')}
|
|
232
275
|
{item === 'controls' && L('A 4 px input next to a pill button. The row looks like two different products.', 'Ô nhập 4 px cạnh nút viên thuốc. Hàng control trông như của hai sản phẩm khác nhau.')}
|
|
233
276
|
{item === 'corners' && L('Square only the left corners. One box ends up with two radii.', 'Chỉ làm vuông hai góc trái. Một hộp có hai radius khác nhau.')}
|
|
234
277
|
{item === 'selected' && L('Use the 4 px accent for a selected tab. Accent is for status and emphasis.', 'Dùng accent 4 px cho tab đang chọn. Accent dành cho trạng thái và nhấn mạnh.')}
|