@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
|
@@ -2,10 +2,154 @@
|
|
|
2
2
|
title: "Data visualization"
|
|
3
3
|
description: "Colours, type and rules for charts, KPI tiles and other data displays."
|
|
4
4
|
order: 13
|
|
5
|
-
planned:
|
|
6
|
-
- "A chart palette for series, with contrast in light and dark"
|
|
7
|
-
- "Status colours in charts"
|
|
8
|
-
- "Chart types and when to use each"
|
|
9
|
-
- "Axis, legend, tooltip and number formats"
|
|
10
|
-
- "Accessible charts: not by colour alone, text alternatives"
|
|
11
5
|
---
|
|
6
|
+
|
|
7
|
+
## Choose by the question
|
|
8
|
+
|
|
9
|
+
Use a line chart for a value over time, a compact sparkline only beside its current
|
|
10
|
+
value, a proportional bar for parts of a stated total, and a timeline for when
|
|
11
|
+
executions happened. A health ring must also show its numeric score and a named
|
|
12
|
+
assessment. Do not use decorative area fills, gradients, glass or pulsing failures.
|
|
13
|
+
|
|
14
|
+
## Metrics, categories and status are different
|
|
15
|
+
|
|
16
|
+
`visualization.metric.*` defines named operational series: total jobs, completed,
|
|
17
|
+
failed, success rate, active jobs, average execution time and queue depth. Volume
|
|
18
|
+
and duration alone are not warnings. Keep units, thresholds and metric names visible.
|
|
19
|
+
|
|
20
|
+
`visualization.job-type.*` defines queue-status, sync-history, polling-jobs and
|
|
21
|
+
generic-jobs as categorical identities, never as success/warning/failure. Their
|
|
22
|
+
foundation colour aliases adapt in light and dark. Always pair colour with the
|
|
23
|
+
job-type name or distinct glyph. In combined timeline mode, the outer mark encodes
|
|
24
|
+
job type and the inner mark encodes status; explain both in the legend. In status
|
|
25
|
+
mode, use `color.text.success`, `danger`, `info`, `warning` or neutral text by the
|
|
26
|
+
actual state. Preserve visible status labels and outcome icons.
|
|
27
|
+
|
|
28
|
+
`visualization.priority.1` through `.5` encode ranked queue urgency, always labelled
|
|
29
|
+
P1–P5. Priority is not an execution outcome. P1 is highest; P5 is lowest. Do not
|
|
30
|
+
reuse a priority colour to claim success or failure.
|
|
31
|
+
|
|
32
|
+
## Geometry and typography
|
|
33
|
+
|
|
34
|
+
Use `visualization.line-width`, `sparkline-width`, `grid-width`, `point-radius`
|
|
35
|
+
and `hover-point-radius` for SVG series and markers. Strokes are CSS pixel
|
|
36
|
+
dimensions; use a measured viewBox or non-scaling strokes to avoid distortion.
|
|
37
|
+
`timeline-track-height` and `activity-track-height` set compact proportional tracks.
|
|
38
|
+
`ring-size` is a CSS dimension; `ring-width` is the Ant Design percent-based stroke
|
|
39
|
+
API, and `ring-gap` is degrees. Convert dimensions only at numeric API boundaries.
|
|
40
|
+
Data coordinates and measured container sizes remain data, not design tokens.
|
|
41
|
+
|
|
42
|
+
`timeline-node-size` and `timeline-node-inner-size` define the outer categorical and
|
|
43
|
+
inner status marks. Their `touch` and `tablet` variants preserve legibility without
|
|
44
|
+
changing the encoding. `timeline-cluster-size` sets an aggregate count mark; paint
|
|
45
|
+
its boundary with the category/status role and keep its count in normal text on a
|
|
46
|
+
normal surface, never white on a theme-adapted bright mark. Use `size.target.touch`
|
|
47
|
+
for the interactive footprint, independent of the visible mark.
|
|
48
|
+
`chart-height`, `chart-initial-width`, `sparkline-height`,
|
|
49
|
+
`sparkline-compact-height` and `sparkline-initial-width` define plotting viewports;
|
|
50
|
+
initial widths are replaced by measured widths. `sparkline-point-radius` is the
|
|
51
|
+
compact endpoint radius. These are not data scales or axis values.
|
|
52
|
+
|
|
53
|
+
Use `font.heading.large` with tabular figures for KPI values, `font.body.small` for
|
|
54
|
+
metadata, axes and tooltip copy, and `font.label.small` for legend labels.
|
|
55
|
+
Use `color.border` for decorative grids, `color.text.subtle` for labels and the
|
|
56
|
+
surface/inverse text pair for tooltips. A meaningful data mark needs at least 3:1
|
|
57
|
+
against its actual surface; normal text needs 4.5:1. Check actual theme pairs rather
|
|
58
|
+
than assuming an alias proves rendered contrast.
|
|
59
|
+
|
|
60
|
+
## Labels, formats and interaction
|
|
61
|
+
|
|
62
|
+
Keep locale-aware number, timestamp and duration formatting consistent with the
|
|
63
|
+
adjacent table. Include units and time range; preserve timezone context. Never
|
|
64
|
+
silently turn a count into a rate or truncate a duration. Legends must name every
|
|
65
|
+
shown series; a selected series needs an indicator other than colour. Tooltips
|
|
66
|
+
must stay inside the chart container and must not be the only way to read values.
|
|
67
|
+
Provide an adjacent numeric summary or table for the same data and an accessible
|
|
68
|
+
chart name. Keyboard-operable legend controls retain visible focus.
|
|
69
|
+
|
|
70
|
+
## Traffic assessment bands
|
|
71
|
+
|
|
72
|
+
`visualization.traffic.{healthy,attention,degraded,critical,unavailable,fault}.{fill,outline}`
|
|
73
|
+
provides paired band paints. Healthy means accepted traffic; attention, degraded and
|
|
74
|
+
critical describe increasing rejected-request ratio thresholds. State the thresholds
|
|
75
|
+
in labels or tooltips. Attention and degraded share warning colours: use a distinct
|
|
76
|
+
dash pattern and explicit labels, not colour alone. Unavailable means no requests
|
|
77
|
+
to assess. Fault means internal/backend request-processing errors, not a ratio band;
|
|
78
|
+
show a separate fault count, explicit label/icon and cross-hatching. Fetch failures remain errors, not a band. Never turn missing
|
|
79
|
+
data into zero or a healthy result. Use normal `color.text` for text on subtle fills.
|
|
80
|
+
|
|
81
|
+
## Source-owned presentation boundaries
|
|
82
|
+
|
|
83
|
+
Semantic data does not authorize a local CSS recipe. Prefer a source-configured
|
|
84
|
+
native chart, Progress, Tag or Timeline API when it can preserve the required
|
|
85
|
+
structure, behavior and accessibility. Custom SVG/data DOM uses the companion
|
|
86
|
+
`@beehexa/ant-design-vue-tokens/css` source recipes:
|
|
87
|
+
|
|
88
|
+
- `bh-data-track` and `bh-data-fill` own proportional track presentation.
|
|
89
|
+
Default thickness is `timeline-track-height`; `data-bh-density="activity"` uses
|
|
90
|
+
`activity-track-height`. Coordinates, measured widths and percentages remain data.
|
|
91
|
+
- `bh-data-band` is a labeled assessment chip; `bh-data-accent` is a leading
|
|
92
|
+
semantic edge; `bh-data-mark` applies the source mark foreground.
|
|
93
|
+
- `bh-data-line`, `bh-data-point`, `bh-data-grid`, `bh-data-axis`,
|
|
94
|
+
`bh-data-outline` and `bh-data-hatch` own SVG paint/stroke roles.
|
|
95
|
+
`data-bh-density="sparkline"` selects the compact series/point geometry.
|
|
96
|
+
Dash/hatch geometry may encode distinct data classes, never decorative effects.
|
|
97
|
+
- `bh-data-tooltip` owns the source paired tooltip canvas and typography;
|
|
98
|
+
the host preserves containment, positioning and equivalent numeric content.
|
|
99
|
+
|
|
100
|
+
Bind a source semantic discriminator at the relevant host or mark:
|
|
101
|
+
`data-bh-band="good|attention|critical"` maps health assessments to
|
|
102
|
+
success/warning/danger pairs; `data-bh-status="success|warning|danger|info|neutral|disabled"`
|
|
103
|
+
describes an actual operational state. Threshold classification remains domain
|
|
104
|
+
logic and must be explicit in labels; these attributes never calculate a score.
|
|
105
|
+
`data-bh-traffic` uses the six traffic bands above. `data-bh-metric`,
|
|
106
|
+
`data-bh-job-type` and `data-bh-priority` use the exact named source keys.
|
|
107
|
+
Private `--bh-data-*` properties belong to these recipes, not consumer aliases.
|
|
108
|
+
|
|
109
|
+
Native APIs requiring resolved color values use
|
|
110
|
+
`getVisualizationColor(role, { dark })` or
|
|
111
|
+
`getStatusColor(tone, 'text' | 'border' | 'background', { dark })` from
|
|
112
|
+
`@beehexa/ant-design-vue-tokens/visualization`. Keep the mode reactive.
|
|
113
|
+
The caller classifies domain outcomes; source owns the corresponding paint.
|
|
114
|
+
Do not recreate a downstream color map, including token-string maps.
|
|
115
|
+
|
|
116
|
+
### Focus, selection and temporal marks
|
|
117
|
+
|
|
118
|
+
`bh-data-hit-target` owns the transparent SVG hit area and visible keyboard-focus
|
|
119
|
+
stroke; geometry and domain hit interval remain consumer data. A selected region uses
|
|
120
|
+
`bh-data-outline` with `data-bh-shape="selection"` for its no-fill selected frame and
|
|
121
|
+
`bh-data-point` with the same attribute for a selected marker. Selection is not focus.
|
|
122
|
+
`bh-data-grid[data-bh-current="true"]` marks the current time; `bh-data-axis-tick`
|
|
123
|
+
owns a gauge tick's paint while the consumer positions it on the scale.
|
|
124
|
+
|
|
125
|
+
Timeline marks use `bh-data-mark` with `data-bh-mark="timeline-outer|timeline-inner|cluster"`.
|
|
126
|
+
The outer category and inner execution state are independent encodings. Source defaults
|
|
127
|
+
are16/8px for the two diameters; coarse-pointer marks use18/10px. A cluster's minimum
|
|
128
|
+
diameter is24px. Hit targets remain distinct from these visible marks.
|
|
129
|
+
`data-bh-mark="legend|dot"` uses the source8px circular mark; a hidden series label's
|
|
130
|
+
`data-bh-hidden="true"` adds a strike cue rather than changing its meaning through
|
|
131
|
+
opacity alone. `data-bh-selected="true"` adds a separate selected outline.
|
|
132
|
+
|
|
133
|
+
`bh-data-line[data-bh-line="hover"]` owns the hover guide dash pattern; source
|
|
134
|
+
`bh-data-grid` owns grid dashes, and `data-bh-curve="step"` owns a stepped line's
|
|
135
|
+
join. Use source point roles for sparkline endpoints rather than local radius paint.
|
|
136
|
+
`bh-data-connector` describes a relationship between progress items; status is explicit
|
|
137
|
+
and `data-bh-skipped="true"` adds a dashed cue. Prefer native Steps/Progress when they
|
|
138
|
+
can preserve the actual structure. The connector recipe exists for split-edge layouts
|
|
139
|
+
whose paired half-connectors cannot be represented by those native APIs.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
`bh-data-area` fills an SVG area without adding an outline, including a hatch
|
|
143
|
+
pattern canvas. `bh-data-swatch` owns the source12px square legend, frame and
|
|
144
|
+
paired fill; source `data-bh-traffic="degraded"` supplies a dashed outline both
|
|
145
|
+
for a swatch and for `bh-data-outline` intervals. Fault remains a cross-hatch,
|
|
146
|
+
not merely another color. Pattern coordinates and domain intervals remain data.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Actual native Progress accepts `semanticProgressProps` from
|
|
150
|
+
`@beehexa/ant-design-vue-tokens/visualization`, together with the appropriate
|
|
151
|
+
`data-bh-band` or `data-bh-status` discriminator. These are native stroke/trail
|
|
152
|
+
props using source CSS variables, reactive across themes without a downstream
|
|
153
|
+
color map or a new theme-store dependency. Use native Progress/Steps/Tag/Statistic
|
|
154
|
+
instead of recreating their tracks, connectors, pills or figures in HTML.
|
|
155
|
+
|
|
@@ -1,12 +1,81 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Elevation
|
|
3
|
-
description:
|
|
3
|
+
description: "How far a surface seems to sit above the page. It sets items apart, marks what is temporary and points attention at what matters now."
|
|
4
4
|
order: 8
|
|
5
5
|
---
|
|
6
|
+
import ElevationDemo from '../../../components/ElevationDemo.astro';
|
|
6
7
|
import TokenTable from '../../../components/TokenTable.astro';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
Elevation is the distance a surface seems to have from the page, shown with a shadow and, in dark mode, a lighter background. It tells people what stands apart from the page, what is temporary, and what needs attention first.
|
|
10
|
+
|
|
11
|
+
<ElevationDemo kind="hero" />
|
|
12
|
+
|
|
13
|
+
## How it works
|
|
14
|
+
|
|
15
|
+
- **Each level is a pair: a background and a shadow.** Use the two tokens of a level together.
|
|
16
|
+
- **The further from the page, the larger and softer the shadow.** A card has a faint shadow; a dialog a deep one.
|
|
17
|
+
- **Three shadow levels only.** If everything floats, nothing stands out.
|
|
18
|
+
|
|
19
|
+
Elevation shows how high a surface looks. [Z-index](/foundations/styles/z-index/) decides which surface is drawn on top.
|
|
20
|
+
|
|
21
|
+
| Level | Background | Shadow | Use for |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| Page | `color.surface.page`, `color.surface.subtle` | none | The page, panels, tables, side navigation, headers |
|
|
24
|
+
| Raised | `color.surface` | `elevation.shadow.raised` | Cards |
|
|
25
|
+
| Overlay | `color.surface.overlay` | `elevation.shadow.overlay` | Menus, select lists, popovers, date pickers, toasts |
|
|
26
|
+
| Modal | `color.surface.overlay` | `elevation.shadow.modal` | Dialogs, drawers, full sheets |
|
|
27
|
+
|
|
28
|
+
## Page
|
|
29
|
+
|
|
30
|
+
Most of the screen sits on the page with no shadow. Separate panels and tables with a `color.border` border. Side navigation and table headers use `color.surface.subtle`.
|
|
31
|
+
|
|
32
|
+
<ElevationDemo kind="level" item="page" />
|
|
33
|
+
|
|
34
|
+
## Raised
|
|
35
|
+
|
|
36
|
+
For one item people treat as a unit: a sync job, a connection, a dashboard widget. Cards keep their border, because a faint shadow can disappear on a bright screen or in high-contrast mode.
|
|
37
|
+
|
|
38
|
+
<ElevationDemo kind="level" item="raised" />
|
|
39
|
+
|
|
40
|
+
## Overlay
|
|
41
|
+
|
|
42
|
+
For things that open from a control and close again: menus, select lists, popovers. Toasts use the same surface and shadow.
|
|
43
|
+
|
|
44
|
+
<ElevationDemo kind="level" item="overlay" />
|
|
45
|
+
|
|
46
|
+
## Modal
|
|
47
|
+
|
|
48
|
+
For dialogs and drawers that block the page until people finish or cancel. A modal always sits on `color.surface.scrim`, which dims the page and shows it is unavailable.
|
|
49
|
+
|
|
50
|
+
<ElevationDemo kind="level" item="modal" />
|
|
51
|
+
|
|
52
|
+
## Dark mode
|
|
53
|
+
|
|
54
|
+
**The higher the surface, the lighter it is.** A dark shadow barely shows on a dark page, so each level also gets a lighter background: page graphite 1, cards graphite 2, menus and dialogs graphite 3. The token names are the same in both themes.
|
|
55
|
+
|
|
56
|
+
<ElevationDemo kind="dark" />
|
|
57
|
+
|
|
58
|
+
## Inside menus and dialogs
|
|
59
|
+
|
|
60
|
+
Rows inside a floating surface use the overlay state colours, such as `color.surface.overlay.hover`. The page's hover colour would match the menu background in dark mode and disappear. Mark a selected row with a check, not colour alone.
|
|
61
|
+
|
|
62
|
+
<ElevationDemo kind="states" />
|
|
63
|
+
|
|
64
|
+
## Do and don’t
|
|
65
|
+
|
|
66
|
+
<ElevationDemo kind="dodont" item="pair" />
|
|
67
|
+
<ElevationDemo kind="dodont" item="flat" />
|
|
68
|
+
<ElevationDemo kind="dodont" item="own" />
|
|
69
|
+
<ElevationDemo kind="dodont" item="border" />
|
|
10
70
|
|
|
11
71
|
## Tokens
|
|
72
|
+
|
|
12
73
|
<TokenTable prefix="elevation" />
|
|
74
|
+
|
|
75
|
+
## Related
|
|
76
|
+
|
|
77
|
+
- [Z-index](/foundations/styles/z-index/): which surface is drawn on top.
|
|
78
|
+
- [Opacity](/foundations/styles/opacity/): the scrim behind dialogs and drawers.
|
|
79
|
+
- [Color usage](/foundations/styles/color/usage/#surfaces-and-backgrounds): surface and background tokens.
|
|
80
|
+
|
|
81
|
+
<TokenTable prefix="color.surface.overlay" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Accessibility
|
|
3
|
-
description:
|
|
3
|
+
description: Some people never see an icon; others need it large and clear. Give each icon a name or hide it, and make clickable icons easy to hit.
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
import IconDemo from '../../../../components/IconDemo.astro';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Code
|
|
3
|
-
description:
|
|
3
|
+
description: Install Lucide, import icons by name, and size, colour and label them in Vue, with short notes for React and Astro.
|
|
4
4
|
order: 4
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -107,11 +107,10 @@ Set the gap on the control, from its size: 4 px (`space.050`) with a 16 px icon
|
|
|
107
107
|
Lucide hides an icon from screen readers with `aria-hidden="true"`, unless you give it an `aria-*`, `role` or `title` prop. Name icon-only buttons on the button, and add a tooltip with the same text.
|
|
108
108
|
|
|
109
109
|
```vue
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</a-tooltip>
|
|
110
|
+
<!-- Wrap the button in your Tooltip component, with the same text: "Settings" -->
|
|
111
|
+
<button type="button" class="icon-button" aria-label="Settings">
|
|
112
|
+
<Settings />
|
|
113
|
+
</button>
|
|
115
114
|
```
|
|
116
115
|
|
|
117
116
|
A meaningful icon on its own gets a role and a label, which also removes `aria-hidden`:
|
|
@@ -120,17 +119,6 @@ A meaningful icon on its own gets a role and a label, which also removes `aria-h
|
|
|
120
119
|
<CircleX role="img" aria-label="Failed" />
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
## Inside Ant Design Vue
|
|
124
|
-
|
|
125
|
-
Put the icon in the `icon` slot and add the `anticon` class, so Ant Design Vue lines it up like its own icons.
|
|
126
|
-
|
|
127
|
-
```vue
|
|
128
|
-
<a-button>
|
|
129
|
-
<template #icon><Plus class="anticon" /></template>
|
|
130
|
-
Add store
|
|
131
|
-
</a-button>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
122
|
## React
|
|
135
123
|
|
|
136
124
|
`lucide-react` has the same icons and props, in camelCase. Set the default size once with `LucideProvider`.
|
|
@@ -162,7 +150,7 @@ import Search from '@lucide/astro/icons/search';
|
|
|
162
150
|
|
|
163
151
|
## Custom icons
|
|
164
152
|
|
|
165
|
-
Lucide
|
|
153
|
+
If Lucide has no icon for something Beehexa needs, draw it on Lucide’s 24 px grid with the same stroke and caps, name it in kebab-case with a `bh-` prefix, and add it to the library.
|
|
166
154
|
|
|
167
155
|
## Updating Lucide
|
|
168
156
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Icons
|
|
3
|
-
description:
|
|
3
|
+
description: Icons help people scan a screen and spot an action. Beehexa uses Lucide's outline icons, with a few rules for size, colour, labels and accessibility.
|
|
4
4
|
order: 11
|
|
5
5
|
sidebarLabel: Overview
|
|
6
6
|
---
|
|
@@ -45,7 +45,7 @@ An icon takes the colour of the text next to it. Use a status colour only when t
|
|
|
45
45
|
| Contrast | 3:1 or more for icons that carry meaning (WCAG 1.4.11) |
|
|
46
46
|
| Target | 24 × 24 or more (WCAG 2.5.8); icon buttons in products are 32 × 32 |
|
|
47
47
|
| Names | One name per meaning, kebab-case, such as `circle-check` |
|
|
48
|
-
| Package | Lucide
|
|
48
|
+
| Package | Lucide 1.62.0, pinned, each icon imported by name |
|
|
49
49
|
| Right to left | Not needed: products are in Vietnamese and English |
|
|
50
50
|
|
|
51
51
|
## In this section
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Usage
|
|
3
|
-
description:
|
|
3
|
+
description: Pick the right size, colour and label for an icon, and use the same icon for the same action everywhere.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
import IconDemo from '../../../../components/IconDemo.astro';
|
|
7
7
|
import ColorDemo from '../../../../components/ColorDemo.astro';
|
|
8
8
|
|
|
9
|
+
An icon works when people learn it once and recognise it everywhere after that.
|
|
10
|
+
|
|
9
11
|
**Use 16 px icons in the colour of the text, with a label, and the same icon for the same meaning everywhere.**
|
|
10
12
|
|
|
11
13
|
## Sizes
|
|
12
14
|
|
|
13
15
|
**Pick the size from the text next to the icon.**
|
|
14
16
|
|
|
15
|
-
| Size | Use it for |
|
|
16
|
-
|
|
17
|
-
| 16 px | Default. Buttons, menus, tables, form fields, next to 14 px text. |
|
|
18
|
-
| 20 px | Next to 16 px text, in toolbars and in the page header. |
|
|
19
|
-
| 24 px | An icon on its own, such as a status in a card or a small empty state. |
|
|
20
|
-
| 32 px | Empty states only. |
|
|
17
|
+
| Size | Token | Use it for |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| 16 px | `size.icon.default` | Default. Buttons, menus, tables, form fields, next to 14 px text. |
|
|
20
|
+
| 20 px | `size.icon.medium` | Next to 16 px text, in toolbars and in the page header. |
|
|
21
|
+
| 24 px | `size.icon.large` | An icon on its own, such as a status in a card or a small empty state. |
|
|
22
|
+
| 32 px | `size.icon.empty` | Empty states only. |
|
|
21
23
|
|
|
22
24
|
Don’t use other sizes. Don’t scale an icon to fit a box: change the box.
|
|
23
25
|
|
|
26
|
+
Bind these roles through CSS variables or convert them at numeric icon APIs;
|
|
27
|
+
the documented pixel sizes are not separate consumer constants.
|
|
28
|
+
|
|
24
29
|
<IconDemo kind="dodont" item="size" />
|
|
25
30
|
|
|
26
31
|
## Stroke
|
|
@@ -81,7 +86,7 @@ Use an icon on its own only when all three are true:
|
|
|
81
86
|
|
|
82
87
|
## Common actions
|
|
83
88
|
|
|
84
|
-
**One icon per meaning.** Use this icon whenever you show one of these actions or objects, in every product. If a meaning is missing, ask before you choose one, so it is added here.
|
|
89
|
+
**One icon per meaning.** Use this icon whenever you show one of these actions or objects, in every product. If a meaning is missing, ask the design system team before you choose one, so it is added here.
|
|
85
90
|
|
|
86
91
|
<IconDemo kind="actions" />
|
|
87
92
|
|
|
@@ -1,36 +1,103 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Interaction states
|
|
3
|
-
description:
|
|
3
|
+
description: Every control shows when it is hovered, focused, pressed, selected or turned off, so people know what will happen before they act.
|
|
4
4
|
order: 10
|
|
5
5
|
---
|
|
6
6
|
import TokenTable from '../../../components/TokenTable.astro';
|
|
7
|
+
import NativeControlsDemo from '../../../components/NativeControlsDemo.astro';
|
|
7
8
|
|
|
8
|
-
Every interactive element
|
|
9
|
+
People need to see that a button is under the pointer, that the keyboard is on it, that it was pressed, or that it cannot be used right now. Every interactive element has all of these states. Each state has its own colour token, so every component shows it the same way, in light and dark, without extra code.
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## How it works
|
|
11
12
|
|
|
12
13
|
1. Every state uses its own token. Find the token of the element at rest, then add the state: `color.background.neutral` at rest becomes `color.background.neutral.hover` on hover and `color.background.neutral.pressed` when pressed.
|
|
13
14
|
2. Never draw a state with opacity, a transparent overlay, `filter: brightness()` or a mixed colour. The result changes with whatever is under the element, and its contrast can't be checked.
|
|
14
|
-
3. Never invent a hover or pressed colour. If the token you need doesn't exist, ask
|
|
15
|
+
3. Never invent a hover or pressed colour. If the token you need doesn't exist, ask the design system team to add it.
|
|
15
16
|
4. Keyboard focus is always visible, on every element that can take focus. Hover is never the only way to show something.
|
|
16
17
|
|
|
17
18
|
## Each state
|
|
18
19
|
|
|
19
20
|
| State | When | Background | Text and icon | Border |
|
|
20
21
|
| --- | --- | --- | --- | --- |
|
|
21
|
-
| Rest | Nothing is happening. | The token for the element, such as `color.background.neutral` or `color.background.danger.bold` | The paired text token (see
|
|
22
|
+
| Rest | Nothing is happening. | The token for the element, such as `color.background.neutral` or `color.background.danger.bold` | The paired text token (see [Pairing](/foundations/styles/color/accessibility/#pairing)) | `color.border` or `color.border.bold` |
|
|
22
23
|
| Hover | A pointer is over the element. | The same token plus `.hover`: one step up the scale | Unchanged | Unchanged |
|
|
23
24
|
| Pressed | The element is being clicked or tapped. | The same token plus `.pressed`: two steps up | Unchanged | Unchanged |
|
|
24
|
-
|
|
25
|
-
The primary button is the one exception. It rests on graphite 12, the last step, so it has no step above: on hover it moves one step back (graphite 11) and when pressed two steps back (graphite 10). Its tokens already do this.
|
|
26
25
|
| Focus | The element has keyboard focus (`:focus-visible`). | Unchanged | Unchanged | Add a ring: `outline: var(--bh-border-width-focused) solid var(--bh-color-border-focus); outline-offset: var(--bh-state-focus-offset);` |
|
|
27
|
-
| Selected | The element is chosen, like a table row, a tab or a menu item. | `color.background.selected`, and `color.background.selected.hover` on hover | Unchanged, and a second cue: a check, the yellow indicator bar (`color.border.selected`)
|
|
26
|
+
| Selected | The element is chosen, like a table row, a tab or a menu item. | `color.background.selected`, and `color.background.selected.hover` on hover | Unchanged, and a second cue: a check in a menu, or the yellow indicator bar (`color.border.selected`) | Unchanged |
|
|
28
27
|
| Disabled | The element cannot be used now. | `color.background.disabled` | `color.text.disabled`, `color.icon.disabled` | `color.border.disabled` |
|
|
29
28
|
|
|
29
|
+
Primary buttons and ON Switches are exceptions. They rest on graphite 12, the last step, so they have no step above: on hover they move one step back (graphite 11) and when pressed two steps back (graphite 10). Their tokens already do this.
|
|
30
|
+
|
|
30
31
|
## Rows, menu items and ghost buttons
|
|
31
32
|
|
|
32
33
|
Elements with no fill at rest use `color.background.neutral.subtle`, which is transparent. On hover they take `color.background.neutral.subtle.hover`; when pressed, `color.background.neutral.subtle.pressed`.
|
|
33
34
|
|
|
35
|
+
Native Button variants keep their own roles; `ghost` is not permission to use
|
|
36
|
+
the solid-primary label over a transparent background. Framework “outline”
|
|
37
|
+
aliases can also paint resting shadows. Removing that resting shadow must
|
|
38
|
+
never remove the independent focused color, width and gap. See the
|
|
39
|
+
[native Button state contract and live matrix](/tools/ant-design-vue-theme/#one-native-control-family-distinct-roles)
|
|
40
|
+
for the source-owned alias split, disabled/loading behavior and danger pairs.
|
|
41
|
+
|
|
42
|
+
## Interactive cards
|
|
43
|
+
|
|
44
|
+
A bordered interactive card rests on `color.surface` with `color.border`. Hover
|
|
45
|
+
strengthens its frame to `color.border.bold` and adds `elevation.shadow.raised`;
|
|
46
|
+
it never hides the border or lowers opacity. Keyboard focus keeps that meaningful
|
|
47
|
+
frame and raised shadow and adds the standard focused outline/offset. Keep
|
|
48
|
+
`radius.100` (8 px) in every state. Hoverability alone does not make a Card keyboard
|
|
49
|
+
operable: use a real link/button for its action or provide the appropriate focus
|
|
50
|
+
and keyboard semantics.
|
|
51
|
+
|
|
52
|
+
## Boolean Switch
|
|
53
|
+
|
|
54
|
+
A Switch describes a boolean setting, not business success. ON uses the existing
|
|
55
|
+
neutral-bold family, never success green or brand yellow. OFF is an available
|
|
56
|
+
control with a strong thumb, readable label and meaningful edge; it is not the
|
|
57
|
+
disabled treatment. `switch.on.*` and `switch.off.*` own the paired track, thumb,
|
|
58
|
+
label and border. Never put one shared white thumb/text pair over both tracks.
|
|
59
|
+
|
|
60
|
+
| State | OFF pair | ON pair | Additional cue |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| Normal | Track `background.neutral`; thumb `icon`; label `text`; edge `border.bold` | Track/edge `background.neutral.bold`; thumb `icon.inverse`; label `text.inverse` | Native thumb position and `aria-checked`; concise On/Off or Bật/Tắt labels |
|
|
63
|
+
| Hover | Track `.hover`; same paired thumb/label and edge | Track/edge `.hover`; same paired inverse thumb/label | Pointer affordance without changing checked state |
|
|
64
|
+
| Pressed | Track `.pressed`; same paired thumb/label; edge graphite 10 | Track/edge `.pressed`; same paired inverse thumb/label | Native press/handle feedback; the stronger OFF edge retains 3:1 against its pressed fill |
|
|
65
|
+
| Focus | `.focus` aliases the normal pair; hover/pressed may coexist | `.focus` aliases the normal pair; hover/pressed may coexist | Independent `switch.focus-ring`, existing focused width and gap; never replace state with ring color |
|
|
66
|
+
| Loading | `.loading` preserves the current normal OFF pair | `.loading` preserves the current normal ON pair | Native spinner with the paired `switch.{off,on}.loading-icon`; native button disabled until work settles. Loading paint takes precedence while the spinner is present, including when disabled is also set. |
|
|
67
|
+
| Disabled | Explicit `.disabled`: background, icon, text and border disabled roles | Same explicit disabled roles, but checked position and label remain ON | Native disabled behavior; no opacity dimming and no change callbacks |
|
|
68
|
+
|
|
69
|
+
All names in the table's color pairs have the `color.` prefix. The exported
|
|
70
|
+
Switch roles are `switch.{off,on}.{track,thumb,label,border}` at rest, plus
|
|
71
|
+
`.hover`, `.pressed`, `.focus`, `.loading` and `.disabled`. They resolve through
|
|
72
|
+
the existing palette in light and dark; there are no copied hex colors, mixed
|
|
73
|
+
states or transparent state overlays. Enabled label and thumb pairs have a
|
|
74
|
+
minimum measured contrast of **5.64:1** across both themes and every state
|
|
75
|
+
(the light ON pressed pair). OFF edges retain at least **3.00:1** against their
|
|
76
|
+
track; the focus ring has at least **6.64:1** against page, surface, subtle and
|
|
77
|
+
overlay surfaces. Disabled pairs are intentionally lower contrast and exempt.
|
|
78
|
+
|
|
79
|
+
Normal and small Switches share these paints and `radius.full`; their existing
|
|
80
|
+
native height, handle size, travel and label spacing do not change. EN and VI use
|
|
81
|
+
the existing source typography and short On/Off or Bật/Tắt labels. Keep the native
|
|
82
|
+
button, controlled `checked`/`v-model:checked`, `change` callback, keyboard handling
|
|
83
|
+
and disabled/loading safety. Do not replace them with a styled checkbox or
|
|
84
|
+
product-specific success palette. Applications own the setting and save operation,
|
|
85
|
+
not Switch skin. The [Ant Design Vue contract](/tools/ant-design-vue-theme/#native-switch-contract)
|
|
86
|
+
documents the actual adapter API and its narrow native gaps.
|
|
87
|
+
|
|
88
|
+
### Live native Switch states
|
|
89
|
+
|
|
90
|
+
This is the real AntD4 Switch under the public theme and companion CSS, not a
|
|
91
|
+
static imitation. Both sizes show initially OFF/ON available, loading and disabled
|
|
92
|
+
examples, localized labels and a visible change counter. The explicitly simulated
|
|
93
|
+
save keeps its checked binding unchanged while pending, then commits it once;
|
|
94
|
+
attempting another activation during loading must not add a save. Use the site's
|
|
95
|
+
light/dark and EN/VI controls, then hover, press and keyboard-focus the examples.
|
|
96
|
+
|
|
97
|
+
<NativeControlsDemo />
|
|
98
|
+
|
|
99
|
+
<TokenTable prefix="switch" />
|
|
100
|
+
|
|
34
101
|
## Disabled
|
|
35
102
|
|
|
36
103
|
- Use the three disabled colour tokens above. Don't lower the opacity.
|
|
@@ -38,7 +105,7 @@ Elements with no fill at rest use `color.background.neutral.subtle`, which is tr
|
|
|
38
105
|
- WCAG doesn't require contrast for disabled controls, so the disabled colours are light on purpose.
|
|
39
106
|
- Prefer telling people why something can't be used, for example in helper text, over a silent disabled control.
|
|
40
107
|
|
|
41
|
-
## Dark
|
|
108
|
+
## Dark mode
|
|
42
109
|
|
|
43
110
|
The same tokens work in dark. In dark, fills get lighter on hover and when pressed instead of darker, and the primary button moves back from graphite 12 the same way; the tokens already do this, so the code doesn’t change.
|
|
44
111
|
|
|
@@ -47,3 +114,9 @@ The same tokens work in dark. In dark, fills get lighter on hover and when press
|
|
|
47
114
|
The colours are on the [Color](/foundations/styles/color/) page. The focus ring width, `border.width.focused`, is on the [Border](/foundations/styles/border/) page. This group holds the gap between a control and its ring.
|
|
48
115
|
|
|
49
116
|
<TokenTable prefix="state" />
|
|
117
|
+
|
|
118
|
+
## Related
|
|
119
|
+
|
|
120
|
+
- [Color usage](/foundations/styles/color/usage/#interaction-states): the state tokens for each part of a screen.
|
|
121
|
+
- [Border](/foundations/styles/border/): the focus ring and the selected bar.
|
|
122
|
+
- [Keyboard and focus](/foundations/guidelines/accessibility/keyboard-and-focus/): where focus goes and how it looks.
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: App frame
|
|
3
|
-
description: The header, side navigation and page header
|
|
3
|
+
description: The header, side navigation and page header stay in the same place on every page, so people never have to look for them.
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
import LayoutDemo from '../../../../components/LayoutDemo.astro';
|
|
7
7
|
|
|
8
8
|
**The header, the side navigation and the page header repeat on every page, in the same place and at the same size.**
|
|
9
9
|
|
|
10
|
+
The global header and side navigation are one continuous shell surface: both use
|
|
11
|
+
`surface.subtle` (`--bh-color-surface-subtle`) in light and dark themes. The mobile
|
|
12
|
+
navigation drawer, including its logo row, uses that same surface. Do not give the
|
|
13
|
+
header `surface` while the sidebar uses `surface.subtle`. Page headers belong to
|
|
14
|
+
the content surface, not this global shell.
|
|
15
|
+
|
|
16
|
+
In a mobile navigation drawer, the logo row does not shrink. The menu occupies the
|
|
17
|
+
remaining height and scrolls only when its contents do not fit. Do not give a menu
|
|
18
|
+
below a logo row `min-height: 100%`: that adds the logo height to a full-height menu.
|
|
19
|
+
|
|
10
20
|
## Header
|
|
11
21
|
|
|
12
22
|
**48 px high, across the full width. It holds what belongs to the whole product.**
|
|
@@ -17,9 +27,7 @@ import LayoutDemo from '../../../../components/LayoutDemo.astro';
|
|
|
17
27
|
| Holds | Menu button (below 1024 px), logo, global search, workspace switcher, notifications, account |
|
|
18
28
|
| Does not hold | The breadcrumb and page actions. They change with the page, so they go in the page header |
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
The sidebar widths below are `layout.sidebar.expanded` and `layout.sidebar.collapsed`.
|
|
22
|
-
Convert source units at numeric framework API boundaries instead of copying their values.
|
|
30
|
+
In code, the header height is `layout.header.height` and the side navigation widths are `layout.sidebar.expanded` and `layout.sidebar.collapsed`. Use the tokens rather than copying the numbers.
|
|
23
31
|
|
|
24
32
|
## Side navigation
|
|
25
33
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Breakpoints
|
|
3
|
-
description:
|
|
3
|
+
description: Beehexa layouts adapt to the window, from a phone to a wide monitor. See what changes at each width and how to design for it.
|
|
4
4
|
order: 4
|
|
5
5
|
---
|
|
6
6
|
import LayoutDemo from '../../../../components/LayoutDemo.astro';
|
|
7
7
|
import TokenTable from '../../../../components/TokenTable.astro';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
People check an order on a phone and work through a day of syncs on a wide monitor. The layout changes at a few widths so each screen fits the window it is in.
|
|
10
|
+
|
|
11
|
+
**The layout changes at three window widths: 768, 1024 and 1440 px. Every screen also works at 320 px.**
|
|
10
12
|
|
|
11
13
|
<LayoutDemo kind="breakpoints" />
|
|
12
14
|
|
|
@@ -45,12 +47,13 @@ In code, the base styles are for the smallest window, and each breakpoint adds t
|
|
|
45
47
|
| 360 and 320 px | Phones, and the narrowest window allowed |
|
|
46
48
|
| 400% zoom | People who enlarge the page |
|
|
47
49
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
<TokenTable prefix="breakpoint" />
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
50
|
+
## Code
|
|
53
51
|
|
|
54
52
|
- Write media queries with `min-width`: `@media (min-width: 768px)`.
|
|
55
53
|
- CSS custom properties cannot be used in media queries. Use the pixel values of these tokens.
|
|
56
54
|
- Change the layout at breakpoints, never the spacing tokens or text sizes inside a component.
|
|
55
|
+
|
|
56
|
+
## Tokens
|
|
57
|
+
|
|
58
|
+
<TokenTable prefix="breakpoint" />
|
|
59
|
+
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Grid
|
|
3
|
-
description: A
|
|
3
|
+
description: A 4, 8 or 12-column grid keeps content aligned on every screen, with gutters and margins from the spacing tokens.
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
import LayoutDemo from '../../../../components/LayoutDemo.astro';
|
|
7
7
|
|
|
8
|
+
A grid gives every page the same rhythm, so cards, forms and tables line up and screens feel like one product.
|
|
9
|
+
|
|
8
10
|
**Lay out the main content area on 4 columns on phones, 8 on tablets and 12 from 1024 px.**
|
|
9
11
|
|
|
10
12
|
<LayoutDemo kind="grid" />
|
|
@@ -24,7 +26,7 @@ The values are spacing tokens: 16 px is `space.200`, 24 px is `space.300` and 32
|
|
|
24
26
|
- **4 columns on phones** give two halves or four quarters. **8 on tablets** keep the same halves and quarters with more room.
|
|
25
27
|
- **Gutters** are 16 px on phones and 24 px from 768 px, where there is room to separate cards more clearly.
|
|
26
28
|
- **Page margins** start at 16 px and grow to 32 px on wide screens, so content does not touch the edge of a large window.
|
|
27
|
-
- **Every value is a spacing token and a multiple of 8 px
|
|
29
|
+
- **Every value is a spacing token and a multiple of 8 px.** Text line heights sit on the same 4 px grid, so cards, text and controls line up.
|
|
28
30
|
|
|
29
31
|
Use the same gutter between rows, so cards are as far apart down as across.
|
|
30
32
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Layout
|
|
3
|
-
description:
|
|
3
|
+
description: Every Beehexa app shares one frame, so people always know where the menu, search and page actions are.
|
|
4
4
|
order: 4
|
|
5
5
|
sidebarLabel: Overview
|
|
6
6
|
---
|
|
7
7
|
import LayoutDemo from '../../../../components/LayoutDemo.astro';
|
|
8
8
|
|
|
9
|
-
**Every Beehexa app uses one frame: a header across the top, side navigation on the left, and the page beside it.**
|
|
10
|
-
|
|
11
9
|
People move between screens all day. When the menu, the search and the page actions stay in the same place, they find them without looking.
|
|
12
10
|
|
|
11
|
+
**Every Beehexa app uses one frame: a header across the top, side navigation on the left, and the page beside it.**
|
|
12
|
+
|
|
13
13
|
<LayoutDemo kind="anatomy" />
|
|
14
14
|
|
|
15
15
|
## Where each part is set
|