@apliteni/apliteni-ui 0.37.1 → 0.39.0
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 +5 -2
- package/guidelines/accessibility-floor.md +105 -0
- package/guidelines/colour-and-theming.md +56 -0
- package/guidelines/command-palette.md +79 -0
- package/guidelines/component-choice.md +71 -0
- package/guidelines/dense-tables.md +87 -0
- package/guidelines/destructive-actions.md +43 -0
- package/guidelines/drawer.md +53 -0
- package/guidelines/going-back.md +77 -0
- package/guidelines/hover-readouts.md +67 -0
- package/guidelines/iconography.md +57 -0
- package/guidelines/labels-and-titles.md +79 -0
- package/guidelines/layout-and-density.md +68 -0
- package/guidelines/microcopy.md +29 -0
- package/guidelines/motion.md +53 -0
- package/guidelines/overview.md +1 -0
- package/guidelines/pagination.md +89 -0
- package/guidelines/stat-bands.md +39 -0
- package/guidelines/state-set.md +57 -0
- package/guidelines/the-page.md +123 -0
- package/package.json +3 -1
- package/react/dist/index.d.ts +64 -2
- package/react/dist/index.js +160 -47
- package/src/components/filter-bar.js +56 -0
- package/src/components/index.js +4 -4
- package/src/components/segmented.js +40 -0
- package/src/components/table-values.js +32 -0
- package/src/index.css +1 -0
- package/src/index.js +4 -0
- package/src/inline.js +2 -0
- package/src/styles/filter-bar.css +10 -0
- package/src/styles/segmented.css +7 -0
- package/src/styles/table.css +45 -3
- package/src/tokens/tokens.css +5 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Iconography
|
|
2
|
+
|
|
3
|
+
## Icon-only controls
|
|
4
|
+
|
|
5
|
+
<!-- rule: icon-only -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Remove a control’s label only for an action on the closed list.
|
|
8
|
+
|
|
9
|
+
**Why:** Without a legend, readers need labels for unfamiliar glyphs.
|
|
10
|
+
|
|
11
|
+
**Except:** The list grows by decision, not review debate. Today: `x` (close or dismiss), `copy` (copy to clipboard), `moreHorizontal` (overflow menu), `moreVertical` (overflow menu), `chevronDown` (expand or collapse), and `chevronUp` (expand or collapse).
|
|
12
|
+
|
|
13
|
+
**Do:** Show an overflow menu without words; keep the Settings label.
|
|
14
|
+
|
|
15
|
+
**Don't:** Use a cog without words, even with a perfect `aria-label`.
|
|
16
|
+
|
|
17
|
+
## State and action
|
|
18
|
+
|
|
19
|
+
<!-- rule: meaning -->
|
|
20
|
+
|
|
21
|
+
**Rule:** A circled glyph represents a state; a bare glyph represents an action.
|
|
22
|
+
|
|
23
|
+
**Why:** Two meanings force readers to decide from context each time.
|
|
24
|
+
|
|
25
|
+
**Except:** Most glyphs show a thing, not a state or action, including `globe`, `database`, and `layers`. This split guides component choices, not catalogue organisation.
|
|
26
|
+
|
|
27
|
+
**Do:** Use `circleX` to report failure and the bare `x` to close a toast.
|
|
28
|
+
|
|
29
|
+
**Don't:** Use the same `x` for two different meanings.
|
|
30
|
+
|
|
31
|
+
## Preserve glyph paths
|
|
32
|
+
|
|
33
|
+
<!-- rule: provenance -->
|
|
34
|
+
|
|
35
|
+
**Rule:** Use the Lucide path unchanged, and state when a glyph name differs.
|
|
36
|
+
|
|
37
|
+
**Why:** The shared source keeps the set consistent, while the commit records its origin.
|
|
38
|
+
|
|
39
|
+
**Except:** A brand mark without a Lucide original is allowed. `github` and `linkedin` are the vendor’s own marks and belong in BRAND.
|
|
40
|
+
|
|
41
|
+
**Do:** Keep the Lucide path unchanged and document a different name.
|
|
42
|
+
|
|
43
|
+
**Don't:** Trace or copy a path without recording the difference.
|
|
44
|
+
|
|
45
|
+
## Status stroke width
|
|
46
|
+
|
|
47
|
+
<!-- rule: stroke-earns-the-bar -->
|
|
48
|
+
|
|
49
|
+
**Rule:** Stroke a status glyph at 1.5 CSS px or wider, or require 4.5:1 text contrast instead of 3:1 graphic contrast.
|
|
50
|
+
|
|
51
|
+
**Why:** Visible width is `stroke-width × box ÷ 24`; below 1.5 CSS px, the stroke reads as a text stem and needs 4.5:1, while above it uses WCAG 1.4.11’s 3:1 graphic bar.
|
|
52
|
+
|
|
53
|
+
**Except:** Non-status glyphs, such as close buttons and chevrons, have no five-status pair to measure; their control owns their contrast.
|
|
54
|
+
|
|
55
|
+
**Do:** Use a stroke at least 1.5 CSS px wide before using the 3:1 graphic contrast minimum.
|
|
56
|
+
|
|
57
|
+
**Don't:** Accept a thinner status stroke at only 3:1 contrast.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Labels and titles
|
|
2
|
+
|
|
3
|
+
## Use body ink
|
|
4
|
+
|
|
5
|
+
<!-- rule: text-ink -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Use body ink for all words; use size, weight and spacing for hierarchy.
|
|
8
|
+
|
|
9
|
+
**Why:** Muted text can look decorative, especially at small sizes, even when contrast passes.
|
|
10
|
+
|
|
11
|
+
**Do:** Use body ink at xs, sm and base; let size show hierarchy.
|
|
12
|
+
|
|
13
|
+
**Don't:** Use muted ink at different sizes to show rank.
|
|
14
|
+
|
|
15
|
+
## Limit muted ink
|
|
16
|
+
|
|
17
|
+
<!-- rule: text-ink-exceptions -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Use muted or dim ink only for the three named exception classes.
|
|
20
|
+
|
|
21
|
+
**Why:** A closed list prevents fading from becoming a hierarchy cue.
|
|
22
|
+
|
|
23
|
+
**Do:** Use muted ink for a disabled control or empty field placeholder.
|
|
24
|
+
|
|
25
|
+
**Don't:** Fade timestamps, counts or enabled actions.
|
|
26
|
+
|
|
27
|
+
**Except:** Only: (1) non-word glyphs, such as arrows, chevrons or dismiss marks; (2) colour reporting off, unset, disabled or archived state; (3) a valueless slot, such as an empty field or cell placeholder. Unselected options, “No earlier figure” sentences, counts, timestamps, keyboard shortcuts, enabled actions and empty-state instructions are information, not exceptions.
|
|
28
|
+
|
|
29
|
+
## Use sentence case
|
|
30
|
+
|
|
31
|
+
<!-- rule: sentence-case -->
|
|
32
|
+
|
|
33
|
+
**Rule:** Write every label in sentence case; never use capitals as style.
|
|
34
|
+
|
|
35
|
+
**Why:** Capitals are slower to read, take more space and make labels louder than their figures.
|
|
36
|
+
|
|
37
|
+
**Except:** Keep inherently capitalised words as written, including acronyms, currency codes and key names such as USD, API and Esc.
|
|
38
|
+
|
|
39
|
+
**Do:** Written and shown in sentence case.
|
|
40
|
+
|
|
41
|
+
**Don't:** Use all capitals, which pulls attention from the figures.
|
|
42
|
+
|
|
43
|
+
## Rank card titles
|
|
44
|
+
|
|
45
|
+
<!-- rule: title-rank -->
|
|
46
|
+
|
|
47
|
+
**Rule:** Set a card title one rank below the page title and one above the body.
|
|
48
|
+
|
|
49
|
+
**Why:** A page-sized card title divides the page, while body-sized text does not read as a title.
|
|
50
|
+
|
|
51
|
+
**Do:** Use --text-2xl for the page title and --text-lg for the card title.
|
|
52
|
+
|
|
53
|
+
**Don't:** Use a second h1 for the card; it creates two page titles.
|
|
54
|
+
|
|
55
|
+
## Use heading levels
|
|
56
|
+
|
|
57
|
+
<!-- rule: title-is-heading -->
|
|
58
|
+
|
|
59
|
+
**Rule:** Make a card title a heading one level below the page title, and let the class control its appearance.
|
|
60
|
+
|
|
61
|
+
**Why:** A div title is missing from the page outline.
|
|
62
|
+
|
|
63
|
+
**Do:** Use the next heading level for each card.
|
|
64
|
+
|
|
65
|
+
**Don't:** Put the card title in a div and make it look like a heading.
|
|
66
|
+
|
|
67
|
+
**Except:** A card inside a section with its own h2 uses level 3.
|
|
68
|
+
|
|
69
|
+
## Name the kind above
|
|
70
|
+
|
|
71
|
+
<!-- rule: eyebrow-names-the-kind -->
|
|
72
|
+
|
|
73
|
+
**Rule:** Place an eyebrow above a title to identify what kind of thing it is, never as a replacement for the title.
|
|
74
|
+
|
|
75
|
+
**Why:** An eyebrow alone cannot describe the card’s content.
|
|
76
|
+
|
|
77
|
+
**Do:** Use the eyebrow for the period and the title for what is shown.
|
|
78
|
+
|
|
79
|
+
**Don't:** Use a label-sized eyebrow as the only title.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Layout and density
|
|
2
|
+
|
|
3
|
+
## Use the container token
|
|
4
|
+
|
|
5
|
+
<!-- rule: container -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Read page width from `--container`; do not write the number.
|
|
8
|
+
|
|
9
|
+
**Why:** Shared tokens prevent conflicting page widths and topbar overrides.
|
|
10
|
+
|
|
11
|
+
**Do:** Use one token for both kit and site.
|
|
12
|
+
|
|
13
|
+
**Don't:** Put four page-width numbers in different files.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Use the measure token
|
|
17
|
+
|
|
18
|
+
<!-- rule: measure -->
|
|
19
|
+
|
|
20
|
+
**Rule:** Use `--measure`, never `--container`, for a reading column.
|
|
21
|
+
|
|
22
|
+
**Why:** `--container` spans the page, while `--measure` limits text beside a sidebar.
|
|
23
|
+
|
|
24
|
+
**Do:** Use `--measure` for a reading column with a sidebar.
|
|
25
|
+
|
|
26
|
+
**Don't:** Treat `--container` and `--measure` as competing page widths.
|
|
27
|
+
|
|
28
|
+
## Use the spacing scale
|
|
29
|
+
|
|
30
|
+
<!-- rule: density -->
|
|
31
|
+
|
|
32
|
+
**Rule:** Set density with the spacing scale; there is no kit-wide density mode.
|
|
33
|
+
|
|
34
|
+
**Why:** The ten-step scale aligns gaps and padding without runtime density switching.
|
|
35
|
+
|
|
36
|
+
**Do:** Use `--space-3` for rows inside a card.
|
|
37
|
+
|
|
38
|
+
**Don't:** Set separate values such as `13px`, `9px`, `14px`, `6px`, and `17px`.
|
|
39
|
+
|
|
40
|
+
**Except:** `.ui-table--dense` is component-local: use `--space-3` across and `--space-2` down inside base `--space-4`. It still uses the scale. Do not add a compact/comfortable mode, `data-density` attribute, or row-height scale.
|
|
41
|
+
|
|
42
|
+
## Use panel and prose units
|
|
43
|
+
|
|
44
|
+
<!-- rule: below-the-page -->
|
|
45
|
+
|
|
46
|
+
**Rule:** Below the reading column, use `--panel-*` in `px` for component boxes and `--prose-*` in `ch` for text lines.
|
|
47
|
+
|
|
48
|
+
**Why:** Panel tokens match component widths; prose tokens match text types.
|
|
49
|
+
|
|
50
|
+
**Do:** Use panel `sm/md/lg` for 320/420/560px boxes and prose tokens for caption, lede, body, and dense text.
|
|
51
|
+
|
|
52
|
+
**Don't:** Use t-shirt sizes for prose or put `ch` on a wrapper with two font sizes.
|
|
53
|
+
|
|
54
|
+
**Except:** Put `ch` on the element using its font size. The centred `.ui-section-head` uses `--panel-lg` for its 40px heading and 17px copy. Keep `.ui-footer__brand` at 300px because its flex track controls wrapping.
|
|
55
|
+
|
|
56
|
+
## Use the three breakpoints
|
|
57
|
+
|
|
58
|
+
<!-- rule: breakpoints -->
|
|
59
|
+
|
|
60
|
+
**Rule:** Use literal breakpoints of 860px, 720px or 560px.
|
|
61
|
+
|
|
62
|
+
**Why:** Media queries cannot read custom properties, and adding a compiler would make published CSS less readable.
|
|
63
|
+
|
|
64
|
+
**Do:** Use `@media (max-width: 860px)`.
|
|
65
|
+
|
|
66
|
+
**Don't:** Use `@media (max-width: var(--panel-lg))` or add other breakpoint values.
|
|
67
|
+
|
|
68
|
+
**Except:** `560` also equals `--panel-lg`, and `860` equals `--measure`, but viewport breakpoints and box widths are independent. Do not imply a link between them.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Microcopy and tone
|
|
2
|
+
|
|
3
|
+
## Name the current state
|
|
4
|
+
|
|
5
|
+
<!-- rule: state-not-destination -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Name a control for its current state, and rename it when the state changes.
|
|
8
|
+
|
|
9
|
+
**Why:** A name that is correct only once becomes unhelpful later.
|
|
10
|
+
|
|
11
|
+
**Do:** Name the checked switch “In-app notifications, on.”
|
|
12
|
+
|
|
13
|
+
**Don't:** Name the checked switch “Turn off in-app notifications.”
|
|
14
|
+
|
|
15
|
+
**Except:** An icon-only toggle may add the result: “Theme: Dark. Switch to light.”
|
|
16
|
+
|
|
17
|
+
## Name every control
|
|
18
|
+
|
|
19
|
+
<!-- rule: never-nameless -->
|
|
20
|
+
|
|
21
|
+
**Rule:** Give every control a name, including controls without visible text.
|
|
22
|
+
|
|
23
|
+
**Why:** The glyph is aria-hidden, so the label is the control’s only accessible name.
|
|
24
|
+
|
|
25
|
+
**Do:** Name the button “Dismiss.”
|
|
26
|
+
|
|
27
|
+
**Don't:** Leave the icon button unnamed.
|
|
28
|
+
|
|
29
|
+
**Except:** An identifier is not a name: the `name` option of `segmented()` seeds a data hook and is never read aloud.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Motion
|
|
2
|
+
|
|
3
|
+
## Move after load
|
|
4
|
+
|
|
5
|
+
<!-- rule: after-load -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Animate anything that appears or leaves after page load.
|
|
8
|
+
|
|
9
|
+
**Why:** Motion shows where content comes from; content present at load stays still.
|
|
10
|
+
|
|
11
|
+
**Do:** Slide a panel in from its edge.
|
|
12
|
+
|
|
13
|
+
**Don't:** Make new content appear in one frame.
|
|
14
|
+
|
|
15
|
+
**Except:** Update counts, ranges, and status lines immediately.
|
|
16
|
+
|
|
17
|
+
## Match duration to motion
|
|
18
|
+
|
|
19
|
+
<!-- rule: durations -->
|
|
20
|
+
|
|
21
|
+
**Rule:** Use 150ms for controls, 250ms for surfaces, 400ms for entrances, and 80ms (`--dur-instant`) for presses.
|
|
22
|
+
|
|
23
|
+
**Why:** Use only `--dur-fast`, `--dur-med`, `--dur-slow`, and `--dur-instant` to keep one tempo.
|
|
24
|
+
|
|
25
|
+
**Do:** Use the matching duration token.
|
|
26
|
+
|
|
27
|
+
**Don't:** Use an unrelated duration such as 300ms.
|
|
28
|
+
|
|
29
|
+
## Use the kit curves
|
|
30
|
+
|
|
31
|
+
<!-- rule: easing -->
|
|
32
|
+
|
|
33
|
+
**Rule:** Use `--ease` for surfaces that come and go, `--ease-out` for content that arrives and stays, and `linear` for visibility.
|
|
34
|
+
|
|
35
|
+
**Why:** Visibility keeps its old value during a transition, so easing adds no benefit.
|
|
36
|
+
|
|
37
|
+
**Do:** Transition visibility with `linear`.
|
|
38
|
+
|
|
39
|
+
**Don't:** Use CSS `ease` instead of `--ease`.
|
|
40
|
+
|
|
41
|
+
## Honor reduced motion
|
|
42
|
+
|
|
43
|
+
<!-- rule: reduced -->
|
|
44
|
+
|
|
45
|
+
**Rule:** When a reader asks for less motion, change immediately.
|
|
46
|
+
|
|
47
|
+
**Why:** Published bundles cap animations and transitions at 0.01ms under `prefers-reduced-motion`, so focus reaches a visible control without delay.
|
|
48
|
+
|
|
49
|
+
**Do:** Open drawers and confirmations without internal transitions.
|
|
50
|
+
|
|
51
|
+
**Don't:** Keep a transition running after reduced motion is requested.
|
|
52
|
+
|
|
53
|
+
**Except:** Spinners and skeletons also stop; the surrounding region announces the wait.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Guidelines
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
## Use the server count
|
|
4
|
+
|
|
5
|
+
<!-- rule: counted-total -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Use the total row count returned by the server when it is available.
|
|
8
|
+
|
|
9
|
+
**Why:** Readers need accurate ranges and totals, while some APIs can only report whether more rows exist.
|
|
10
|
+
|
|
11
|
+
**Do:** Show the current row range and the server’s total.
|
|
12
|
+
|
|
13
|
+
**Don't:** Discard a completed `COUNT(*)` result.
|
|
14
|
+
|
|
15
|
+
## Choose the main jump
|
|
16
|
+
|
|
17
|
+
<!-- rule: the-jump -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Use steps for filtering and sorting, numbers for short lists, or jump for a specific page.
|
|
20
|
+
|
|
21
|
+
**Why:** Filtering and sorting usually need quick jumps, while short lists can use numbered pages.
|
|
22
|
+
|
|
23
|
+
**Except:** Use numbered pages for short browsable lists such as changelogs and galleries.
|
|
24
|
+
|
|
25
|
+
**Do:** Use four fixed controls so a ledger’s first and last pages are one press away.
|
|
26
|
+
|
|
27
|
+
**Don't:** On page 25 of 49, show only 1, 24, 26, and 49 as direct choices.
|
|
28
|
+
|
|
29
|
+
## Disable ends in place
|
|
30
|
+
|
|
31
|
+
<!-- rule: ends-disable -->
|
|
32
|
+
|
|
33
|
+
**Rule:** Disable controls at each end without removing them.
|
|
34
|
+
|
|
35
|
+
**Why:** Fixed controls prevent layout shifts and tell screen-reader users when they reached an end.
|
|
36
|
+
|
|
37
|
+
**Do:** Keep First and Prev in place and mark them unavailable; native `disabled` removes them from Tab order.
|
|
38
|
+
|
|
39
|
+
**Don't:** Remove Prev on page one and move the other controls left.
|
|
40
|
+
|
|
41
|
+
## Hide one-page steps
|
|
42
|
+
|
|
43
|
+
<!-- rule: one-page -->
|
|
44
|
+
|
|
45
|
+
**Rule:** Do not show pagination steps when a table has one page.
|
|
46
|
+
|
|
47
|
+
**Why:** One-page controls provide no action.
|
|
48
|
+
|
|
49
|
+
**Do:** For 12 rows, show only the page-size control, or render nothing if no size choices exist.
|
|
50
|
+
|
|
51
|
+
**Don't:** Show two permanently useless buttons.
|
|
52
|
+
|
|
53
|
+
## Keep page turns stable
|
|
54
|
+
|
|
55
|
+
<!-- rule: page-turn -->
|
|
56
|
+
|
|
57
|
+
**Rule:** Keep controls, rows, positions, and heights stable while the next page loads.
|
|
58
|
+
|
|
59
|
+
**Why:** Readers may press the same control twice during loading.
|
|
60
|
+
|
|
61
|
+
**Do:** Disable the controls, mark the pager busy, and keep the range readable.
|
|
62
|
+
|
|
63
|
+
**Don't:** Use a placeholder that collapses the pager or moves the next click target.
|
|
64
|
+
|
|
65
|
+
## Announce only the range
|
|
66
|
+
|
|
67
|
+
<!-- rule: announce-range -->
|
|
68
|
+
|
|
69
|
+
**Rule:** Politely announce the complete result range, such as “1–100 of 4,812,” and nothing else.
|
|
70
|
+
|
|
71
|
+
**Why:** Rows can change without moving focus, so repeating each change creates unnecessary announcements.
|
|
72
|
+
|
|
73
|
+
**Except:** HTML callers that replace the pager must restore focus themselves; at an end, React restores focus to the remaining step after native `disabled` moves it to the body.
|
|
74
|
+
|
|
75
|
+
**Do:** Keep focus on the pressed control and announce the new range once.
|
|
76
|
+
|
|
77
|
+
**Don't:** Announce the same page change through the live region, page-size control, and every button.
|
|
78
|
+
|
|
79
|
+
## Offer consumer page sizes
|
|
80
|
+
|
|
81
|
+
<!-- rule: page-size -->
|
|
82
|
+
|
|
83
|
+
**Rule:** Offer page sizes from 25, 50, and 100, starting at 100, and let consumers choose and persist the selection.
|
|
84
|
+
|
|
85
|
+
**Why:** Consumers may need different choices and can save them in a URL or profile across reloads.
|
|
86
|
+
|
|
87
|
+
**Do:** Place rows per page between the count and pagination steps.
|
|
88
|
+
|
|
89
|
+
**Don't:** Force one size when readers must work through 4,812 rows.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Stat bands
|
|
2
|
+
|
|
3
|
+
## Use a stat band
|
|
4
|
+
|
|
5
|
+
<!-- rule: a-band-not-a-card -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Put key figures in a stat band, not in a card of parts.
|
|
8
|
+
|
|
9
|
+
**Why:** Each figure stays easy to compare and understand.
|
|
10
|
+
|
|
11
|
+
**Do:** Use one card per figure by default, with the figure largest, an arrow, a signed change, and one comparison caption above the row.
|
|
12
|
+
|
|
13
|
+
**Don't:** Use heading-sized figures with a capitalised 10px status chip and no comparison basis.
|
|
14
|
+
|
|
15
|
+
## Colour by meaning
|
|
16
|
+
|
|
17
|
+
<!-- rule: tone-not-direction -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Colour a change by whether it is good news, not by whether it rises or falls.
|
|
20
|
+
|
|
21
|
+
**Why:** Direction alone does not show whether a change is beneficial.
|
|
22
|
+
|
|
23
|
+
**Except:** Omitted tone and explicit “neutral” keep the arrow and comparison but use no colour for unscored volume, reader-dependent meaning, or net cashflow already explained by income less cost.
|
|
24
|
+
|
|
25
|
+
**Do:** Use four verdicts: rising Income and Cost use opposite colours; falling Unclassified is green; undeclared Net cashflow stays grey.
|
|
26
|
+
|
|
27
|
+
**Don't:** Colour four figures by sign, making three rises green, praising cost growth, and showing the year’s cleanup as red.
|
|
28
|
+
|
|
29
|
+
## State the comparison basis
|
|
30
|
+
|
|
31
|
+
<!-- rule: say-the-basis -->
|
|
32
|
+
|
|
33
|
+
**Rule:** State in reachable text what each change is measured against.
|
|
34
|
+
|
|
35
|
+
**Why:** Percentages need a basis that readers can find.
|
|
36
|
+
|
|
37
|
+
**Do:** Put the basis once in a caption referenced by each change, or beside an individual exception; keep the caption before and outside every figure.
|
|
38
|
+
|
|
39
|
+
**Don't:** Use a title attribute, put the note below the tiles, place it inside the first figure, omit the basis, or nest captions.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# The full state set
|
|
2
|
+
|
|
3
|
+
## Focus rings
|
|
4
|
+
|
|
5
|
+
<!-- rule: focus-visible -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Give every focusable control the same `--ring`, and show it only on `:focus-visible`.
|
|
8
|
+
|
|
9
|
+
**Why:** One solid band and halo keep focus consistent while the browser decides when to show it.
|
|
10
|
+
|
|
11
|
+
**Do:** Button and input share one ring.
|
|
12
|
+
|
|
13
|
+
**Don't:** The input draws its own ring.
|
|
14
|
+
|
|
15
|
+
**Except:** Text-entry controls may match `:focus-visible` on mouse focus. Surface backgrounds set the gap colour and recompose `--ring`; adjust width and colour at the root.
|
|
16
|
+
|
|
17
|
+
## Busy controls
|
|
18
|
+
|
|
19
|
+
<!-- rule: busy -->
|
|
20
|
+
|
|
21
|
+
**Rule:** Make busy controls disabled: use `aria-busy` and a real disabled state from one flag.
|
|
22
|
+
|
|
23
|
+
**Why:** A control that still accepts clicks can submit twice.
|
|
24
|
+
|
|
25
|
+
**Do:** Set `disabled` and `aria-busy` together.
|
|
26
|
+
|
|
27
|
+
**Don't:** Show “Saving…” while still accepting clicks.
|
|
28
|
+
|
|
29
|
+
**Except:** Disabled controls are excluded from the WCAG 1.4.3 contrast gate, so busy controls must remain visually legible.
|
|
30
|
+
|
|
31
|
+
## Marked errors
|
|
32
|
+
|
|
33
|
+
<!-- rule: error-in-markup -->
|
|
34
|
+
|
|
35
|
+
**Rule:** Put errors in markup, not only in paint, and connect each message to its field.
|
|
36
|
+
|
|
37
|
+
**Why:** Red alone communicates the state only to sighted readers.
|
|
38
|
+
|
|
39
|
+
**Do:** The field reads its reason with it.
|
|
40
|
+
|
|
41
|
+
**Don't:** Use the same red with no connected reason.
|
|
42
|
+
|
|
43
|
+
**Except:** Put `required` in the attribute, not the label wording; the asterisk is decoration and hidden from assistive technology.
|
|
44
|
+
|
|
45
|
+
## Screen loading
|
|
46
|
+
|
|
47
|
+
<!-- rule: loading -->
|
|
48
|
+
|
|
49
|
+
**Rule:** Design pending state for the whole screen, not only its button, and announce it.
|
|
50
|
+
|
|
51
|
+
**Why:** Silent loading gives screen-reader users no event.
|
|
52
|
+
|
|
53
|
+
**Do:** Announce the coming shape in a status region.
|
|
54
|
+
|
|
55
|
+
**Don't:** Let only the button know while the page reads as finished.
|
|
56
|
+
|
|
57
|
+
**Except:** A toast has its own live region, so a screen reporting through the toast stack needs no second one.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# The page
|
|
2
|
+
|
|
3
|
+
## Keep one shell
|
|
4
|
+
|
|
5
|
+
<!-- rule: layout -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Use one shell layout throughout the product: either the rail alone or the rail with a bar above the page containing search and the reader’s menu.
|
|
8
|
+
|
|
9
|
+
**Why:** Readers learn where search and account controls are once.
|
|
10
|
+
|
|
11
|
+
**Do:** Use the same shell on every screen.
|
|
12
|
+
|
|
13
|
+
**Don't:** Move search or the account menu between pages.
|
|
14
|
+
|
|
15
|
+
## Choose content width
|
|
16
|
+
|
|
17
|
+
<!-- rule: width -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Use the wide column for mostly tables and boards, and the centred column for mostly reading and forms.
|
|
20
|
+
|
|
21
|
+
**Why:** Tables need space, while reading needs a line length readers can follow.
|
|
22
|
+
|
|
23
|
+
**Do:** Show every table column at once in the wide column.
|
|
24
|
+
|
|
25
|
+
**Don't:** Put the same table in the centred column when its last column goes off-screen.
|
|
26
|
+
|
|
27
|
+
## Order page headings
|
|
28
|
+
|
|
29
|
+
<!-- rule: head -->
|
|
30
|
+
|
|
31
|
+
**Rule:** Put the way back first, then the page title and a short introduction, with everything else below.
|
|
32
|
+
|
|
33
|
+
**Why:** Readers should know which page they are on before choosing filters.
|
|
34
|
+
|
|
35
|
+
**Do:** Back link → title → introduction → filters.
|
|
36
|
+
|
|
37
|
+
**Don't:** Put filters above the title.
|
|
38
|
+
|
|
39
|
+
## Use one page title
|
|
40
|
+
|
|
41
|
+
<!-- rule: one-h1 -->
|
|
42
|
+
|
|
43
|
+
**Rule:** Give each page exactly one page title.
|
|
44
|
+
|
|
45
|
+
**Why:** Readers using heading navigation need one clear place to land.
|
|
46
|
+
|
|
47
|
+
**Do:** Use one h1 for the page.
|
|
48
|
+
|
|
49
|
+
**Don't:** Use multiple page titles or none.
|
|
50
|
+
|
|
51
|
+
## Follow heading levels
|
|
52
|
+
|
|
53
|
+
<!-- rule: outline -->
|
|
54
|
+
|
|
55
|
+
**Rule:** Use headings in order without skipping levels, and stop at h3: page, section, then group.
|
|
56
|
+
|
|
57
|
+
**Why:** Skipped levels hide structure, and a fourth level usually means the page should be split.
|
|
58
|
+
|
|
59
|
+
**Do:** Keep each heading level under the one above it.
|
|
60
|
+
|
|
61
|
+
**Don't:** Make readers guess which content belongs together.
|
|
62
|
+
|
|
63
|
+
## Emphasize one action
|
|
64
|
+
|
|
65
|
+
<!-- rule: one-primary -->
|
|
66
|
+
|
|
67
|
+
**Rule:** Use one filled button for the main action and give all other actions less emphasis.
|
|
68
|
+
|
|
69
|
+
**Why:** Equal emphasis makes the main action unclear.
|
|
70
|
+
|
|
71
|
+
**Do:** Make Create token primary, with Import agents and Export less prominent.
|
|
72
|
+
|
|
73
|
+
**Don't:** Give all three actions equal emphasis.
|
|
74
|
+
|
|
75
|
+
## Limit card stacks
|
|
76
|
+
|
|
77
|
+
<!-- rule: stacking -->
|
|
78
|
+
|
|
79
|
+
**Rule:** Stack no more than six cards, and never put cards inside other cards.
|
|
80
|
+
|
|
81
|
+
**Why:** Too many cards make readers scroll past other content to find their target.
|
|
82
|
+
|
|
83
|
+
**Do:** Show up to six cards.
|
|
84
|
+
|
|
85
|
+
**Don't:** Show twelve cards or nest cards inside cards.
|
|
86
|
+
|
|
87
|
+
## Leave pages closed
|
|
88
|
+
|
|
89
|
+
<!-- rule: at-rest -->
|
|
90
|
+
|
|
91
|
+
**Rule:** Show the page uncovered until the reader chooses to open something.
|
|
92
|
+
|
|
93
|
+
**Why:** An overlay on arrival interrupts reading and can move keyboard focus.
|
|
94
|
+
|
|
95
|
+
**Do:** Let the reader open a menu or dialog.
|
|
96
|
+
|
|
97
|
+
**Don't:** Open one automatically when the page loads.
|
|
98
|
+
|
|
99
|
+
## Keep table density consistent
|
|
100
|
+
|
|
101
|
+
<!-- rule: density -->
|
|
102
|
+
|
|
103
|
+
**Rule:** Use compact rows in every table on the page, or use compact rows in none of them.
|
|
104
|
+
|
|
105
|
+
**Why:** Consistent row heights make tables feel like one page.
|
|
106
|
+
|
|
107
|
+
**Do:** Use compact rows in both tables.
|
|
108
|
+
|
|
109
|
+
**Don't:** Use compact rows in one table and roomy rows in another.
|
|
110
|
+
|
|
111
|
+
**Except:** Use the spacing required by the busiest table.
|
|
112
|
+
|
|
113
|
+
## Write a useful introduction
|
|
114
|
+
|
|
115
|
+
<!-- rule: lede -->
|
|
116
|
+
|
|
117
|
+
**Rule:** Keep the introduction to two sentences or fewer and add information the title does not give.
|
|
118
|
+
|
|
119
|
+
**Why:** Repeating the title wastes the reader’s time.
|
|
120
|
+
|
|
121
|
+
**Do:** Add useful context below “Payouts.”
|
|
122
|
+
|
|
123
|
+
**Don't:** Write “This is the payouts page” below “Payouts.”
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apliteni/apliteni-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./src/index.js",
|
|
22
|
+
"./guidelines/*": "./guidelines/*",
|
|
22
23
|
"./motion": "./src/motion.js",
|
|
23
24
|
"./inline": "./src/inline.js",
|
|
24
25
|
"./css": "./src/index.css",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"src",
|
|
37
38
|
"!src/**/*.test.js",
|
|
38
39
|
"react/dist",
|
|
40
|
+
"guidelines",
|
|
39
41
|
"README.md"
|
|
40
42
|
],
|
|
41
43
|
"sideEffects": [
|