@beehexa/design-rules 2611.3.3 → 2611.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AGENTS.md +1 -7
- package/dist/catalog.json +703 -321
- package/dist/docs/public/_redirects +2 -0
- package/dist/docs/scripts/color-pairs.mjs +5 -1
- package/dist/docs/scripts/token-utils.d.mts +5 -1
- package/dist/docs/scripts/token-utils.mjs +44 -4
- package/dist/docs/src/brand/structure-proposal.md +1 -1
- package/dist/docs/src/components/ColorDemo.astro +56 -18
- package/dist/docs/src/components/ElevationDemo.astro +196 -0
- package/dist/docs/src/components/LayoutDemo.astro +1 -1
- package/dist/docs/src/components/MotionDemo.astro +135 -0
- package/dist/docs/src/components/NativeControlsDemo.astro +279 -0
- package/dist/docs/src/components/OpacityDemo.astro +95 -0
- package/dist/docs/src/components/RoleGuides.astro +2 -2
- package/dist/docs/src/components/ShapeDemo.astro +88 -44
- package/dist/docs/src/components/ShapePin.astro +5 -3
- package/dist/docs/src/components/SiteHeader.astro +19 -4
- package/dist/docs/src/components/SystemAreas.astro +1 -1
- package/dist/docs/src/components/TokenTable.astro +16 -1
- package/dist/docs/src/components/TypeDemo.astro +15 -15
- package/dist/docs/src/components/ZIndexDemo.astro +102 -0
- package/dist/docs/src/components/logos/LogoInUse.astro +3 -3
- package/dist/docs/src/content/components/button/accessibility.mdx +41 -8
- package/dist/docs/src/content/components/button/code.mdx +8 -1
- package/dist/docs/src/content/components/button/examples.mdx +23 -4
- package/dist/docs/src/content/components/button/usage.mdx +26 -0
- package/dist/docs/src/content/components/resizable-panel/accessibility.mdx +61 -0
- package/dist/docs/src/content/components/resizable-panel/changelog.mdx +20 -0
- package/dist/docs/src/content/components/resizable-panel/code.mdx +79 -0
- package/dist/docs/src/content/components/resizable-panel/examples.mdx +85 -0
- package/dist/docs/src/content/components/resizable-panel/meta.json +5 -0
- package/dist/docs/src/content/components/resizable-panel/usage.mdx +101 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility.mdx +100 -11
- package/dist/docs/src/content/foundations/guidelines/content.mdx +11 -2
- package/dist/docs/src/content/foundations/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/border.mdx +13 -6
- package/dist/docs/src/content/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content/foundations/styles/color/palette.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/usage.mdx +34 -5
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +150 -6
- package/dist/docs/src/content/foundations/styles/elevation.mdx +72 -3
- package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/usage.mdx +13 -8
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +82 -9
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +12 -4
- package/dist/docs/src/content/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +28 -37
- package/dist/docs/src/content/foundations/styles/layout/page-widths.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content/foundations/styles/motion.mdx +131 -3
- package/dist/docs/src/content/foundations/styles/opacity.mdx +49 -5
- package/dist/docs/src/content/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content/foundations/styles/scrollbars.mdx +176 -0
- package/dist/docs/src/content/foundations/styles/size-and-density.mdx +23 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +5 -3
- package/dist/docs/src/content/foundations/styles/typography/index.mdx +13 -3
- package/dist/docs/src/content/foundations/styles/typography/usage.mdx +5 -3
- package/dist/docs/src/content/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/z-index.mdx +67 -5
- package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +11 -0
- package/dist/docs/src/content/foundations/tokens/index.mdx +17 -9
- package/dist/docs/src/content/get-started/design.mdx +1 -1
- package/dist/docs/src/content/get-started/develop.mdx +2 -6
- package/dist/docs/src/content/get-started/index.mdx +1 -1
- package/dist/docs/src/content/release-phases/index.mdx +1 -1
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +571 -19
- package/dist/docs/src/content/tools/application-content.mdx +176 -0
- package/dist/docs/src/content/tools/editors.mdx +271 -0
- package/dist/docs/src/content/tools/eslint.mdx +1 -1
- package/dist/docs/src/content/tools/index.mdx +2 -2
- package/dist/docs/src/content/tools/mermaid.mdx +190 -0
- package/dist/docs/src/content/tools/vueflow.mdx +179 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility.mdx +108 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +34 -0
- package/dist/docs/src/content-vi/foundations/index.mdx +9 -0
- package/dist/docs/src/content-vi/foundations/styles/border.mdx +12 -6
- package/dist/docs/src/content-vi/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +5 -5
- package/dist/docs/src/content-vi/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +34 -5
- package/dist/docs/src/content-vi/foundations/styles/data-visualization.mdx +75 -6
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +81 -0
- package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content-vi/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +13 -8
- package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +22 -8
- package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +13 -1
- package/dist/docs/src/content-vi/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +36 -0
- package/dist/docs/src/content-vi/foundations/styles/layout/page-widths.mdx +5 -1
- package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content-vi/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content-vi/foundations/styles/motion.mdx +139 -0
- package/dist/docs/src/content-vi/foundations/styles/opacity.mdx +49 -5
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +23 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +5 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/index.mdx +14 -4
- package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +67 -5
- package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +47 -0
- package/dist/docs/src/content-vi/foundations/tokens/index.mdx +35 -0
- package/dist/docs/src/lib/i18n.ts +0 -1
- package/dist/docs/src/lib/token-descriptions-vi.ts +81 -14
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/styles/chrome.css +21 -14
- package/dist/docs/src/styles/color.css +50 -53
- package/dist/docs/src/styles/docs.css +37 -55
- package/dist/docs/src/styles/elevation.css +83 -0
- package/dist/docs/src/styles/global.css +21 -10
- package/dist/docs/src/styles/icons.css +20 -23
- package/dist/docs/src/styles/kit.css +116 -0
- package/dist/docs/src/styles/layout.css +8 -13
- package/dist/docs/src/styles/motion.css +34 -0
- package/dist/docs/src/styles/opacity.css +43 -0
- package/dist/docs/src/styles/scrollbars.css +74 -0
- package/dist/docs/src/styles/shapes.css +35 -29
- package/dist/docs/src/styles/tokens.css +1663 -4
- package/dist/docs/src/styles/tokens.js +538 -4
- package/dist/docs/src/styles/typography.css +8 -11
- package/dist/docs/src/styles/zindex.css +59 -0
- package/dist/docs/tokens/border.json +1 -1
- package/dist/docs/tokens/color.json +75 -4
- package/dist/docs/tokens/content.json +24 -0
- package/dist/docs/tokens/diagram.json +54 -0
- package/dist/docs/tokens/editor.json +129 -0
- package/dist/docs/tokens/elevation.json +15 -5
- package/dist/docs/tokens/flow.json +497 -0
- package/dist/docs/tokens/layout.json +4 -0
- package/dist/docs/tokens/motion.json +37 -5
- package/dist/docs/tokens/opacity.json +9 -0
- package/dist/docs/tokens/radius.json +52 -8
- package/dist/docs/tokens/resize.json +79 -0
- package/dist/docs/tokens/scrollbar.json +40 -0
- package/dist/docs/tokens/size.json +7 -1
- package/dist/docs/tokens/spacing.json +35 -5
- package/dist/docs/tokens/switch.json +280 -0
- package/dist/docs/tokens/typography.json +5 -0
- package/dist/docs/tokens/visualization.json +123 -0
- package/dist/docs/tokens/z-index.json +49 -0
- package/dist/index.js +703 -321
- package/package.json +1 -1
|
@@ -7,10 +7,11 @@ import { tokensByPrefix } from '../lib/tokens';
|
|
|
7
7
|
import { tokenDescriptionsVi } from '../lib/token-descriptions-vi';
|
|
8
8
|
import { langOf } from '../lib/i18n';
|
|
9
9
|
import Pin from './ShapePin.astro';
|
|
10
|
+
import CircleAlert from '@lucide/astro/icons/circle-alert';
|
|
10
11
|
|
|
11
12
|
interface Props {
|
|
12
13
|
kind: 'radius-scale' | 'radius-use' | 'nesting' | 'focus-radius' | 'border-scale' | 'border-use' | 'dodont';
|
|
13
|
-
/** 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. */
|
|
14
15
|
item?: string;
|
|
15
16
|
}
|
|
16
17
|
const { kind, item } = Astro.props;
|
|
@@ -58,7 +59,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
58
59
|
)}
|
|
59
60
|
|
|
60
61
|
{kind === 'radius-use' && (
|
|
61
|
-
<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' }]}>
|
|
62
63
|
{item === '0' && (
|
|
63
64
|
<div class="sh-ex">
|
|
64
65
|
<Pin label="radius.0" r="0px">
|
|
@@ -72,45 +73,73 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
72
73
|
</Pin>
|
|
73
74
|
</div>
|
|
74
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
|
+
)}
|
|
75
83
|
{item === '050' && (
|
|
76
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>
|
|
77
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>
|
|
78
|
-
<div class="sh-ex"><Pin label="radius.050" r="var(--bh-radius-050)"><span class="
|
|
79
|
-
<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>
|
|
80
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>
|
|
81
91
|
</Fragment>
|
|
82
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
|
+
)}
|
|
83
98
|
{item === '100' && (
|
|
84
99
|
<Fragment>
|
|
85
|
-
<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>
|
|
86
|
-
<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>
|
|
87
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>
|
|
88
|
-
<div class="sh-ex"><Pin label="radius.100" r="var(--bh-radius-100)"><span class="
|
|
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>
|
|
89
104
|
</Fragment>
|
|
90
105
|
)}
|
|
91
106
|
{item === '150' && (
|
|
92
107
|
<Fragment>
|
|
93
|
-
<div class="sh-ex"
|
|
94
|
-
|
|
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>
|
|
95
128
|
</Fragment>
|
|
96
129
|
)}
|
|
97
130
|
{item === '200' && (
|
|
98
131
|
<div class="sh-ex">
|
|
99
132
|
<Pin label="radius.200" r="var(--bh-radius-200)">
|
|
100
|
-
<span class="sh-
|
|
101
|
-
<b>{L('Disconnect the online store?', 'Ngắt kết nối cửa hàng online?')}</b>
|
|
102
|
-
<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>
|
|
103
|
-
<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>
|
|
104
|
-
</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>
|
|
105
134
|
</Pin>
|
|
106
135
|
</div>
|
|
107
136
|
)}
|
|
108
137
|
{item === 'full' && (
|
|
109
138
|
<Fragment>
|
|
110
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-
|
|
111
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-
|
|
112
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-default) / 2)"><span class="sh-chip">{L('
|
|
113
|
-
<div class="sh-ex"><Pin label="radius.full" r="calc(var(--bh-size-control-
|
|
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>
|
|
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>
|
|
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>
|
|
114
143
|
</Fragment>
|
|
115
144
|
)}
|
|
116
145
|
</div>
|
|
@@ -119,29 +148,44 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
119
148
|
{kind === 'nesting' && (
|
|
120
149
|
<div class="sh-nest-grid sh-root">
|
|
121
150
|
<figure class="sh-nest">
|
|
122
|
-
<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>
|
|
123
157
|
<span class="sh-sum">12 − 4 = 8</span>
|
|
124
|
-
<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>
|
|
125
159
|
</figure>
|
|
126
160
|
<figure class="sh-nest">
|
|
127
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
128
|
-
<span class="sh-sum">
|
|
129
|
-
<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>
|
|
130
164
|
</figure>
|
|
131
165
|
<figure class="sh-nest">
|
|
132
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
133
|
-
<span class="sh-sum">
|
|
134
|
-
<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>
|
|
135
179
|
</figure>
|
|
136
180
|
<figure class="sh-nest">
|
|
137
|
-
<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>
|
|
138
182
|
<span class="sh-sum">8 − 6 = 2</span>
|
|
139
|
-
<figcaption>{L('
|
|
183
|
+
<figcaption>{L('Card, image 6 px from the edge', 'Card, ảnh cách mép 6 px')}</figcaption>
|
|
140
184
|
</figure>
|
|
141
185
|
<figure class="sh-nest">
|
|
142
|
-
<div class="sh-outer" style="border-radius: var(--bh-radius-
|
|
143
|
-
<span class="sh-sum">24 >
|
|
144
|
-
<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>
|
|
145
189
|
</figure>
|
|
146
190
|
</div>
|
|
147
191
|
)}
|
|
@@ -149,10 +193,10 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
149
193
|
{kind === 'focus-radius' && (
|
|
150
194
|
<figure class="sh-fig sh-root">
|
|
151
195
|
<div class="sh-stage">
|
|
152
|
-
<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>
|
|
153
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>
|
|
154
198
|
</div>
|
|
155
|
-
<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>
|
|
156
200
|
</figure>
|
|
157
201
|
)}
|
|
158
202
|
|
|
@@ -179,7 +223,7 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
179
223
|
)}
|
|
180
224
|
{item === 'accent' && (
|
|
181
225
|
<Fragment>
|
|
182
|
-
<div class="sh-ex is-b is-span is-left"><Pin solid label="border.width.accent" at="left" wide><span class="sh-alert"><b>{L('
|
|
226
|
+
<div class="sh-ex is-b is-span is-left"><Pin solid label="border.width.accent" at="left" wide><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. Fields without a mapping are skipped.', 'Hãy ánh xạ các trường đơn hàng. Trường chưa ánh xạ sẽ bị bỏ qua.')}</span></span></Pin></div>
|
|
183
227
|
<div class="sh-ex is-b is-span is-left"><Pin solid label="border.width.accent" at="left"><p class="sh-quote">{L('Use one radius for every control.', 'Mọi control dùng chung một radius.')}</p></Pin></div>
|
|
184
228
|
<div class="sh-ex is-b is-span is-left">
|
|
185
229
|
<span class="sh-frame">
|
|
@@ -200,16 +244,16 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
200
244
|
<figure class="sp-dd-panel is-do">
|
|
201
245
|
<figcaption><span aria-hidden="true">✓</span> {L('Do', 'Nên')}</figcaption>
|
|
202
246
|
<div class="sp-dd-stage">
|
|
203
|
-
{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>}
|
|
204
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>}
|
|
205
|
-
{item === 'corners' && <span class="sh-alert"><b>{L('
|
|
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>}
|
|
206
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>}
|
|
207
|
-
{item === 'accent' && <span class="sh-alert"><b>{L('
|
|
251
|
+
{item === 'accent' && <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>}
|
|
208
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>}
|
|
209
253
|
</div>
|
|
210
254
|
<p>
|
|
211
|
-
{item === 'nested' && L('
|
|
212
|
-
{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.')}
|
|
213
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.')}
|
|
214
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.')}
|
|
215
259
|
{item === 'accent' && L('Put the 4 px accent on one edge only.', 'Chỉ đặt accent 4 px ở một cạnh.')}
|
|
@@ -219,19 +263,19 @@ const tick = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-
|
|
|
219
263
|
<figure class="sp-dd-panel is-dont">
|
|
220
264
|
<figcaption><span aria-hidden="true">✕</span> {L('Don’t', 'Không nên')}</figcaption>
|
|
221
265
|
<div class="sp-dd-stage">
|
|
222
|
-
{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>}
|
|
223
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>}
|
|
224
|
-
{item === 'corners' && <span class="sh-alert is-squared"><b>{L('
|
|
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>}
|
|
225
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>}
|
|
226
|
-
{item === 'accent' && <span class="sh-alert is-boxed"><b>{L('
|
|
270
|
+
{item === 'accent' && <span class="sh-alert is-boxed"><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>}
|
|
227
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>}
|
|
228
272
|
</div>
|
|
229
273
|
<p>
|
|
230
|
-
{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.')}
|
|
231
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.')}
|
|
232
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.')}
|
|
233
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.')}
|
|
234
|
-
{item === 'accent' && L('Draw 4 px all the way round. The
|
|
278
|
+
{item === 'accent' && L('Draw 4 px all the way round. The box shouts and the message gets lost.', 'Vẽ 4 px quanh cả hộp. Hộp trông quá nặng và nội dung bị lấn át.')}
|
|
235
279
|
{item === 'cards' && L('Give every card a 2 px border. Nothing can show selection any more.', 'Card nào cũng viền 2 px. Không còn cách nào để báo trạng thái đang chọn.')}
|
|
236
280
|
</p>
|
|
237
281
|
</figure>
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
interface Props {
|
|
6
6
|
label: string;
|
|
7
7
|
/** corner: the bottom-left corner. bottom / top: the middle of the bottom or top edge. left: the middle of the left edge. */
|
|
8
|
-
at?: 'corner' | 'bottom' | 'top' | 'left';
|
|
8
|
+
at?: 'corner' | 'bottom' | 'top' | 'left' | 'inside' | 'inside-left';
|
|
9
|
+
/** inside / inside-left: how far in from the left edge the dot sits, as a space token step. Use these to point at a fill (a surface colour), not an edge. */
|
|
10
|
+
inset?: string;
|
|
9
11
|
/** The element's radius, e.g. var(--bh-radius-100). Draws the curve inside the hexagon. Leave out for border pins. */
|
|
10
12
|
r?: string;
|
|
11
13
|
/** Line length as a space token step, e.g. '300' for space.300. */
|
|
@@ -17,6 +19,6 @@ interface Props {
|
|
|
17
19
|
/** Line length when a left pin drops down on narrow screens. */
|
|
18
20
|
lenNarrow?: string;
|
|
19
21
|
}
|
|
20
|
-
const { label, at = 'corner', r, len = '300', wide = false, solid = false, lenNarrow } = Astro.props;
|
|
22
|
+
const { label, at = 'corner', r, len = '300', wide = false, solid = false, lenNarrow, inset = '200' } = Astro.props;
|
|
21
23
|
---
|
|
22
|
-
<span class:list={['sh-pin', { 'is-wide': wide }]}><slot /><span class:list={['sh-anno', `is-${at}`, { 'is-solid': solid }]} style={`--sh-len: var(--bh-space-${len});${lenNarrow ? ` --sh-len-n: var(--bh-space-${lenNarrow});` : ''}${r ? ` --sh-r: ${r};` : ''}`} aria-hidden="true"><i class="sh-mark">{r && <b class="sh-arc"></b>}</i><b class="sh-ln"></b><code>{label}</code></span></span>
|
|
24
|
+
<span class:list={['sh-pin', { 'is-wide': wide }]}><slot /><span class:list={['sh-anno', `is-${at}`, { 'is-solid': solid }]} style={`--sh-len: var(--bh-space-${len}); --sh-in: var(--bh-space-${inset});${lenNarrow ? ` --sh-len-n: var(--bh-space-${lenNarrow});` : ''}${r ? ` --sh-r: ${r};` : ''}`} aria-hidden="true"><i class="sh-mark">{r && <b class="sh-arc"></b>}</i><b class="sh-ln"></b><code>{label}</code></span></span>
|
|
@@ -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
|
);
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Illustrations for the Z-index page. Each layer in the figures uses its own z-index token, and its
|
|
3
|
+
// surface and shadow come from the Elevation page, so the drawings stack the way the product does.
|
|
4
|
+
import '../styles/layout.css';
|
|
5
|
+
import '../styles/shapes.css';
|
|
6
|
+
import '../styles/elevation.css';
|
|
7
|
+
import '../styles/zindex.css';
|
|
8
|
+
import { langOf } from '../lib/i18n';
|
|
9
|
+
import ChevronDown from '@lucide/astro/icons/chevron-down';
|
|
10
|
+
import CircleHelp from '@lucide/astro/icons/circle-question-mark';
|
|
11
|
+
import Info from '@lucide/astro/icons/info';
|
|
12
|
+
import CircleAlert from '@lucide/astro/icons/circle-alert';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
kind: 'stack' | 'screen' | 'dodont';
|
|
16
|
+
/** dodont: 'toast' | 'inside' | 'scrim'. */
|
|
17
|
+
item?: string;
|
|
18
|
+
}
|
|
19
|
+
const { kind, item } = Astro.props;
|
|
20
|
+
const vi = langOf(Astro.url.pathname) === 'vi';
|
|
21
|
+
const L = (en: string, viText: string) => (vi ? viText : en);
|
|
22
|
+
const layers = [
|
|
23
|
+
{ id: 'sticky', v: 100, use: L('Sticky table header', 'Header bảng dính') },
|
|
24
|
+
{ id: 'navigation', v: 200, use: L('App header, side navigation', 'Header app, menu bên trái') },
|
|
25
|
+
{ id: 'overlay', v: 300, use: L('Menu, select list, popover', 'Menu, danh sách select, popover') },
|
|
26
|
+
{ id: 'modal', v: 400, use: L('Dialog, drawer, scrim', 'Dialog, drawer, lớp phủ mờ') },
|
|
27
|
+
{ id: 'spotlight', v: 500, use: L('Product tour', 'Tour hướng dẫn') },
|
|
28
|
+
{ id: 'tooltip', v: 600, use: 'Tooltip' },
|
|
29
|
+
{ id: 'toast', v: 700, use: L('Toast, skip link', 'Toast, skip link') },
|
|
30
|
+
];
|
|
31
|
+
const rows = [['#10293', 'ERP', L('Synced', 'Đã đồng bộ')], ['#10294', 'ERP', L('Synced', 'Đã đồng bộ')], ['#10295', L('Accounting', 'Kế toán'), L('Failed', 'Lỗi')]];
|
|
32
|
+
const legend = [
|
|
33
|
+
['1', 'z-index.navigation', L('App header', 'Header của app')],
|
|
34
|
+
['2', 'z-index.sticky', L('Table header while the table scrolls', 'Header của bảng khi bảng cuộn')],
|
|
35
|
+
['3', 'z-index.overlay', L('Menu opened from a button', 'Menu mở từ một nút')],
|
|
36
|
+
['4', 'z-index.tooltip', L('Tooltip on an icon button', 'Tooltip trên nút icon')],
|
|
37
|
+
['5', 'z-index.toast', L('Toast', 'Toast')],
|
|
38
|
+
];
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
{kind === 'stack' && (
|
|
42
|
+
<figure class="zi-stack-fig sh-root">
|
|
43
|
+
<div class="zi-stack" role="img" aria-label={L('Seven layers stacked from sticky at the bottom to toast at the top', 'Bảy lớp xếp chồng, từ sticky ở dưới cùng tới toast ở trên cùng')}>
|
|
44
|
+
<span class="zi-plate is-page"><b>Page</b><code>auto</code></span>
|
|
45
|
+
{layers.map((l, i) => (
|
|
46
|
+
<span class={`zi-plate is-${l.id}`} style={`--i: ${i + 1}; z-index: var(--bh-z-index-${l.id})`}><b>{l.id}</b><code>{l.v}</code><em>{l.use}</em></span>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
<figcaption>{L('Each layer covers the ones below it. The step is 100, so a new layer can go between two others.', 'Mỗi lớp che các lớp bên dưới. Các lớp cách nhau 100, nên có thể chèn lớp mới vào giữa hai lớp.')}</figcaption>
|
|
50
|
+
</figure>
|
|
51
|
+
)}
|
|
52
|
+
|
|
53
|
+
{kind === 'screen' && (
|
|
54
|
+
<div class="zi-screen-wrap sh-root">
|
|
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" role="img" aria-label="Help"><CircleHelp size={16} aria-hidden="true" /></span></span></div>
|
|
57
|
+
<div class="zi-body">
|
|
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
|
+
<div class="zi-table">
|
|
60
|
+
<div class="zi-th"><span class="zi-n">2</span><span>{L('Order', 'Đơn')}</span><span>{L('Destination', 'Đích')}</span><span>{L('Status', 'Trạng thái')}</span></div>
|
|
61
|
+
{rows.map((r) => <div class="zi-tr"><span>{r[0]}</span><span>{r[1]}</span><span>{r[2]}</span></div>)}
|
|
62
|
+
</div>
|
|
63
|
+
<span class="el-menu zi-menu"><span class="zi-n">3</span><span class="is-on">{L('Retry failed', 'Chạy lại đơn lỗi')}</span><span>{L('Export CSV', 'Xuất CSV')}</span></span>
|
|
64
|
+
<span class="zi-tip"><span class="zi-n">4</span>{L('Help', 'Trợ giúp')}</span>
|
|
65
|
+
<span class="el-toast is-info zi-toast"><span class="zi-n">5</span><Info size={16} aria-hidden="true" />{L('Retry started', 'Đã bắt đầu chạy lại')}</span>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<ol class="zi-legend">
|
|
69
|
+
{legend.map(([n, token, what]) => <li><span class="zi-n">{n}</span><code>{token}</code><span>{what}</span></li>)}
|
|
70
|
+
</ol>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
{kind === 'dodont' && (
|
|
75
|
+
<div class="sp-dd sh-root">
|
|
76
|
+
{['do', 'dont'].map((side) => (
|
|
77
|
+
<figure class={`sp-dd-panel is-${side}`}>
|
|
78
|
+
<figcaption><span aria-hidden="true">{side === 'do' ? '✓' : '✕'}</span> {side === 'do' ? L('Do', 'Nên') : L('Don’t', 'Không nên')}</figcaption>
|
|
79
|
+
<div class="sp-dd-stage zi-dd">
|
|
80
|
+
<div class={`zi-mini is-${item} is-${side}`} aria-hidden="true">
|
|
81
|
+
<span class="el-lines"><i></i><i></i><i></i></span>
|
|
82
|
+
<div class="el-scrim zi-mini-scrim"></div>
|
|
83
|
+
<div class="zi-mini-dialog">
|
|
84
|
+
<b>{L('New sync job', 'Tạo sync job')}</b>
|
|
85
|
+
{item === 'inside' && <span class="zi-field">{L('Destination', 'Đích')}<span class="zi-input">ERP<ChevronDown size={16} aria-hidden="true" /></span><span class="el-menu zi-mini-list"><span class="is-on">ERP</span><span>{L('Accounting', 'Kế toán')}</span><span>CRM</span><span>{L('Warehouse', 'Kho')}</span></span></span>}
|
|
86
|
+
{item !== 'inside' && <span class="zi-mini-text">{L('Choose a source and a destination.', 'Chọn nguồn và đích.')}</span>}
|
|
87
|
+
</div>
|
|
88
|
+
{item === 'toast' && <span class="el-toast is-danger zi-mini-toast"><CircleAlert size={16} aria-hidden="true" />{L('Connection lost', 'Mất kết nối')}</span>}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<p>
|
|
92
|
+
{item === 'toast' && side === 'do' && L('Give toasts z-index.toast. A toast stays readable while a dialog is open.', 'Cho toast dùng z-index.toast. Toast vẫn đọc được khi đang mở dialog.')}
|
|
93
|
+
{item === 'toast' && side === 'dont' && L('Don’t give a toast a lower value than the dialog. It ends up under the scrim.', 'Không cho toast giá trị thấp hơn dialog. Nó sẽ nằm dưới lớp phủ mờ.')}
|
|
94
|
+
{item === 'inside' && side === 'do' && L('Render a list that opens inside a dialog inside the dialog, so it can run past the dialog’s edge.', 'Danh sách mở ra bên trong dialog thì đặt luôn trong dialog, để nó có thể tràn qua mép dialog.')}
|
|
95
|
+
{item === 'inside' && side === 'dont' && L('Don’t let the dialog clip the list. Raising its z-index does not fix that.', 'Không để dialog cắt mất danh sách. Tăng z-index cũng không sửa được lỗi này.')}
|
|
96
|
+
{item === 'scrim' && side === 'do' && L('Put the scrim before the dialog. Both use z-index.modal, so the dialog draws on top.', 'Đặt lớp phủ mờ trước dialog. Cả hai dùng z-index.modal, nên dialog được vẽ lên trên.')}
|
|
97
|
+
{item === 'scrim' && side === 'dont' && L('Don’t put the scrim after the dialog. It dims the dialog too.', 'Không đặt lớp phủ mờ sau dialog. Nó sẽ làm mờ cả dialog.')}
|
|
98
|
+
</p>
|
|
99
|
+
</figure>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
)}
|
|
@@ -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>
|