@apliteni/apliteni-ui 0.149.0 → 0.154.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 +2 -2
- package/TRADEMARK.md +22 -0
- package/docs/components.md +1384 -0
- package/docs/foundations.md +494 -0
- package/guidelines/account-and-settings.md +2 -2
- package/guidelines/dashboards-and-reports.md +14 -0
- package/guidelines/dense-tables.md +16 -2
- package/guidelines/density-and-accents.md +1 -1
- package/guidelines/going-back.md +5 -5
- package/guidelines/the-page.md +2 -0
- package/package.json +5 -2
- package/react/README.md +5 -14
- package/react/dist/index.css +8 -0
- package/react/dist/index.d.ts +19 -23
- package/react/dist/index.js +720 -493
- package/src/assets/icons.js +10 -0
- package/src/logic/dropdown-placement.js +17 -1
- package/src/styles/back.css +2 -2
- package/src/styles/card.css +55 -0
- package/src/styles/chart.css +6 -0
- package/src/styles/dropdown.css +14 -0
- package/src/styles/layout.css +7 -3
- package/src/styles/nav.css +3 -38
- package/src/styles/tap-zone.css +8 -0
- package/src/tokens/tokens.css +12 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
# Foundations
|
|
2
|
+
|
|
3
|
+
The kit ships these values, and every component meets these minimums.
|
|
4
|
+
[components.md](components.md) is the other half. It explains each component and its promise.
|
|
5
|
+
The design rules for a screen are in [the guidelines](../guidelines/overview.md). The issue that
|
|
6
|
+
settled a number explains why it has that value.
|
|
7
|
+
|
|
8
|
+
Everything here is a CSS custom property that you can read and re-point. Take the tokens from
|
|
9
|
+
`@apliteni/apliteni-ui/tokens` and `/accents`, or take the full stylesheet from `/css`.
|
|
10
|
+
|
|
11
|
+
## Widths
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
--container: 1120px; /* the page, gutter to gutter */
|
|
15
|
+
--measure: 860px; /* the reading column inside a track */
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use the first value for a box that bounds the page. Use the second for a box that bounds a line
|
|
19
|
+
of text. The kit does not write a page-scale width as a number.
|
|
20
|
+
|
|
21
|
+
`appShell({ width })` sets the content column. `centered` limits and centres it, and is the
|
|
22
|
+
default. `wide` removes that limit and fills the track beside the rail. `maxWidth` replaces the
|
|
23
|
+
limit under either name. If the kit cannot use a value, it drops that value.
|
|
24
|
+
|
|
25
|
+
## Boxes below the page
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
--panel-sm: 320px; --prose-display: 14ch; /* where a headline rags */
|
|
29
|
+
--panel-md: 420px; --prose-caption: 44ch; /* a sentence under a glyph */
|
|
30
|
+
--panel-lg: 560px; --prose-lede: 54ch; /* the line under a title */
|
|
31
|
+
--prose-body: 62ch; /* a left-aligned column */
|
|
32
|
+
--prose-dense: 72ch; /* reference prose below 13px */
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The unit tells you which scale to use. A box holding a **component** uses a `--panel-*` step in
|
|
36
|
+
px. A box holding a **line** uses a `--prose-*` step in ch. Put a `--prose-*` step on the
|
|
37
|
+
paragraph, not on a wrapper. `ch` uses the font size of the element that carries it.
|
|
38
|
+
|
|
39
|
+
## Breakpoints
|
|
40
|
+
|
|
41
|
+
The kit has three breakpoints, and every media query it ships uses one of them.
|
|
42
|
+
|
|
43
|
+
| step | what changes at it |
|
|
44
|
+
| ------- | -------------------------------------------------------------------------------------- |
|
|
45
|
+
| `860px` | the page stops holding three tracks — a three-across grid drops to two, a side-by-side pair stacks |
|
|
46
|
+
| `720px` | the shell folds — the app rail becomes an icon strip, link columns halve, a secondary label drops out |
|
|
47
|
+
| `560px` | one column — every remaining grid is a single track, and a floating panel goes edge to edge |
|
|
48
|
+
|
|
49
|
+
A step describes a viewport class, not a preference for one surface. The values are written as
|
|
50
|
+
literals because a media query cannot read a custom property, and the kit has no build step to
|
|
51
|
+
inline one. `560` is also `--panel-lg`, and `860` is also `--measure`. This is arithmetic, not
|
|
52
|
+
a relationship. If you move the reading column, the steps stay where they are.
|
|
53
|
+
|
|
54
|
+
## Spacing and rhythm
|
|
55
|
+
|
|
56
|
+
Every padding, margin and gap in the kit is `0` or a `--space-*` step, including modifiers. A
|
|
57
|
+
density variant uses the same scale at a different index. When a value fell between two steps,
|
|
58
|
+
its purpose decided the direction: a dense table rounds down, and clearance rounds up.
|
|
59
|
+
|
|
60
|
+
**A padding modifier changes the vertical rhythm but keeps the horizontal inset**, so cards with
|
|
61
|
+
different padding can stack in one column while their text lines up. It also lets a dense or
|
|
62
|
+
zebra table inside a card start its first column at the card's own text edge.
|
|
63
|
+
|
|
64
|
+
**Two gaps space a page.** The inner gap, `--space-2` (8px), separates the parts of one group:
|
|
65
|
+
a title and what it names, a control row and the table it filters, wrapped rows of controls. The
|
|
66
|
+
group gap, `--space-8` (32px), separates groups: the page head and its first block, one section
|
|
67
|
+
and the next. On a touch phone the inner gap of a group of small controls is `--tap-gap` (20px),
|
|
68
|
+
and the view strip wraps its rows `--space-1` (4px) apart. A control that draws no box starts its
|
|
69
|
+
first label on the page title's edge.
|
|
70
|
+
|
|
71
|
+
## Typefaces
|
|
72
|
+
|
|
73
|
+
The kit uses two families, and the split is based on role:
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
--font-display: 'Poppins', …; /* headings, brand lockups, large readouts */
|
|
77
|
+
--font-sans: 'IBM Plex Sans', …; /* text, tables, fields, chat — most of an app */
|
|
78
|
+
--font-mono: ui-monospace, …; /* code */
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- **The element decides, never the size.** `h1`–`h6` use the display face. Everything else uses
|
|
82
|
+
the text face from `body`. A card, drawer or confirmation title is a heading tag in the text
|
|
83
|
+
face, and its own rule states this.
|
|
84
|
+
- **A brand mark is not text**: a wordmark keeps the display face at any size. This is the one
|
|
85
|
+
exception.
|
|
86
|
+
- **`b` and `strong` are `--weight-semibold`.** 700 is still available by name.
|
|
87
|
+
- **Neither family is bundled.** Your page loads both. If a family named by a token is not
|
|
88
|
+
loaded, the browser falls back silently.
|
|
89
|
+
|
|
90
|
+
Component sizes use the `--text-*` scale. A size between two steps uses the nearest step plus a
|
|
91
|
+
fixed pixel offset, so a host override still moves it. The 16px touch-field size is the one
|
|
92
|
+
safety exception. See
|
|
93
|
+
[A field is 16px on a touch screen](#a-field-is-16px-on-a-touch-screen).
|
|
94
|
+
|
|
95
|
+
## Labels and titles
|
|
96
|
+
|
|
97
|
+
**Text is never set in capitals by style.** No stylesheet in the kit changes the case of the
|
|
98
|
+
text it receives. It does not use `text-transform` or small capitals. A label is written in
|
|
99
|
+
sentence case and renders as written. A word that is capitalised in itself stays that way.
|
|
100
|
+
|
|
101
|
+
**Six ranks, each under the one above it.**
|
|
102
|
+
|
|
103
|
+
| rank | size | weight | line-height | what takes it |
|
|
104
|
+
| ------------ | ------------- | ------------------- | ------------------ | ------------- |
|
|
105
|
+
| `page-title` | `--text-2xl` | `--weight-bold` | `1.1` | the page's `h1` inside `appShell()` |
|
|
106
|
+
| `card-title` | `--text-lg` | `--weight-semibold` | `--leading-snug` | a card's title |
|
|
107
|
+
| `body` | `--text-base` | `--weight-normal` | `--leading-normal` | running text |
|
|
108
|
+
| `label` | `--text-sm` | `--weight-medium` | inherited | an eyebrow, a table head, a nav or menu caption, a footer column title, a code sample's label |
|
|
109
|
+
| `caption` | `--text-sm` | `--weight-normal` | inherited | a sentence under a specimen, figure or screenshot |
|
|
110
|
+
| `chip` | `--text-xs` | `--weight-semibold` | inherited | a badge, a pill, a menu row's badge, a version badge |
|
|
111
|
+
|
|
112
|
+
On the kit's scale, these are 30, 18, 14.5, 13, 13 and 11px. When two ranks share a size,
|
|
113
|
+
their weight separates them. `label` and `caption` are both 13px. Words use body ink, including
|
|
114
|
+
labels and captions. See [Text ink](#text-ink).
|
|
115
|
+
|
|
116
|
+
**A card title is a heading, one level under the page's.** `card()` and `<Card>` emit an `h2`.
|
|
117
|
+
`level` moves it to `h3`–`h6`. An eyebrow above a card title is a label, not a heading.
|
|
118
|
+
|
|
119
|
+
## Motion
|
|
120
|
+
|
|
121
|
+
**The drawer is the kit's default motion, and all other motion follows it.** A panel that
|
|
122
|
+
appears takes 250ms on `cubic-bezier(0.4, 0, 0.2, 1)`. It moves `transform` and `opacity`
|
|
123
|
+
only. Every duration is one of four tokens:
|
|
124
|
+
|
|
125
|
+
| token | resolves to | what it times |
|
|
126
|
+
| --------------- | ----------- | -------------------------------------------------------------------- |
|
|
127
|
+
| `--dur-instant` | `80ms` | a press: the frame of feedback under a finger, too short to read as motion |
|
|
128
|
+
| `--dur-fast` | `150ms` | a control changing state — hover, focus, a colour, a border, a caret turning |
|
|
129
|
+
| `--dur-med` | `250ms` | a surface arriving or leaving — drawer, confirm, dropdown, menu, toast, scrim |
|
|
130
|
+
| `--dur-slow` | `400ms` | an entrance or a reveal: the motion library's effects, scroll reveals |
|
|
131
|
+
|
|
132
|
+
Every easing is also a token. `--ease` is the default. The other options are `--ease-out`,
|
|
133
|
+
`--ease-in`, `--ease-sharp` and `--ease-spring`. `linear` is also available.
|
|
134
|
+
|
|
135
|
+
- **Any transition of `visibility` uses `linear`.**
|
|
136
|
+
- **Anything that appears or leaves after the page has loaded moves.** Nothing animates on
|
|
137
|
+
first render. Text that changes in place, such as a count or a range, changes immediately.
|
|
138
|
+
- A `transition` always reads a duration token. An `animation` may keep its own number in two
|
|
139
|
+
cases, named at the declaration: **ambient** motion with no interaction origin, and
|
|
140
|
+
**choreographed** sequences timed against each other. There is no third kind.
|
|
141
|
+
- **A published motion helper accepts a missing element.** `transitionMs(el)` returns the
|
|
142
|
+
stylesheet's transition time for `el`: the longest duration plus its own delay, in
|
|
143
|
+
milliseconds. It returns `0` for no element, for anything that is not an element, and `0`
|
|
144
|
+
again where there is no window to ask for a computed style. `playEntrance()` and `replay()`
|
|
145
|
+
do nothing for a missing element. None of the three ask whether the element is still in the
|
|
146
|
+
document, so a node you detached gets no promise here: what `transitionMs()` answers for one
|
|
147
|
+
is whatever the engine's style API says about it. A caller sizing a backstop timer for a fade
|
|
148
|
+
can read the stylesheet instead of copying a duration token, and an unmounted ref gets a timer
|
|
149
|
+
that fires immediately instead of an exception.
|
|
150
|
+
|
|
151
|
+
### Reduced motion travels with the stylesheet
|
|
152
|
+
|
|
153
|
+
With `prefers-reduced-motion: reduce`, nothing slides, fades or loops. A one-shot animation
|
|
154
|
+
settles on its final frame. The net is in one file, and **both** published stylesheets include
|
|
155
|
+
it. A consumer who takes only `@apliteni/apliteni-ui/react/css` therefore gets the net as
|
|
156
|
+
well as the motion styles. Taking both is harmless because every rule in the net is
|
|
157
|
+
idempotent.
|
|
158
|
+
|
|
159
|
+
The net gives every element a 0.01ms transition. As a result, an open drawer, confirm,
|
|
160
|
+
palette or dropdown panel has no transition inside it while it is open. Focus also lands
|
|
161
|
+
where it does when motion is enabled.
|
|
162
|
+
|
|
163
|
+
## Text ink
|
|
164
|
+
|
|
165
|
+
Words use `--text`, or the full-strength foreground of their surface, at every size. Do not
|
|
166
|
+
show hierarchy by fading descriptions, labels, captions, timestamps, counts, code comments
|
|
167
|
+
or enabled actions with `--muted`, `--dim` or opacity. Use size, weight and spacing for that
|
|
168
|
+
hierarchy. Signal colours still report status and errors. Links keep their link ink.
|
|
169
|
+
|
|
170
|
+
Muted and dim ink have exactly four uses:
|
|
171
|
+
|
|
172
|
+
- **glyph** — a mark that is not words: an arrow, a chevron, a dismiss icon.
|
|
173
|
+
- **state** — colour reporting off, unset, disabled or archived, rather than rank.
|
|
174
|
+
- **placeholder** — a slot with no value, such as an empty field or cell.
|
|
175
|
+
- **chrome** — the furniture around a drawing: a chart's value axis, its period row
|
|
176
|
+
and its legend. Exact data values must remain reachable at full strength through
|
|
177
|
+
pointer readouts and keyboard announcements. The values table is optional and opens
|
|
178
|
+
on request. A field's label, a caption and a timestamp keep body ink. The one other use
|
|
179
|
+
is the title of a supporting card, such as a document beside the data read from it:
|
|
180
|
+
add `ui-card__title--muted` so it ranks below its neighbour. Its size and weight stay
|
|
181
|
+
the card title's.
|
|
182
|
+
|
|
183
|
+
An empty-state explanation is not an empty slot. A keyboard shortcut is language. A count is
|
|
184
|
+
not a status. Generic badges use body ink. Archive and disabled variants keep their state
|
|
185
|
+
ink. A dropdown badge asks for state ink with `tone: 'state'`. A neutral chip uses
|
|
186
|
+
`--chip-neutral-fill`, a low-alpha muted wash. Badge, pill, dropdown chip and archived
|
|
187
|
+
version badge all use that token when the tone carries no verdict. The wash leaves its
|
|
188
|
+
ground in the same direction as status chip fills. It is lighter in dark and darker in light.
|
|
189
|
+
Its text still clears 4.5:1. The theme alphas differ because muted ink differs between themes.
|
|
190
|
+
The neutral fill separates from a card by about 1.22:1 in dark and 1.20:1 in light.
|
|
191
|
+
|
|
192
|
+
## Colour and contrast
|
|
193
|
+
|
|
194
|
+
**A status chip's ink and fill form one pair.** Change them together and check the result
|
|
195
|
+
on the page, a card and a floating panel in both themes. Keep text at least 4.5:1.
|
|
196
|
+
Light success has a stronger aim of **7:1** on its fill. It currently measures 7.17:1.
|
|
197
|
+
This stronger aim is a written consumer rule only. The automated badge checks enforce 4.5:1,
|
|
198
|
+
so they would accept the previous success pair at 5.29:1. The other light status pairs
|
|
199
|
+
meet 4.5:1 but do not all meet 7:1. Dark danger measures at least 6.30:1 on these three grounds.
|
|
200
|
+
|
|
201
|
+
**Archive has little contrast to spare.** Its muted ink measures 4.64:1 on the light page
|
|
202
|
+
and 4.56:1 on a dark floating panel. These are the narrowest Archive pairs.
|
|
203
|
+
Check both before changing muted ink, the neutral fill or a containing surface.
|
|
204
|
+
Do not fade Archive further or assume that a card measurement covers these grounds.
|
|
205
|
+
|
|
206
|
+
On the light page, warn and pending fills separate by only 1.043:1, and live by 1.047:1.
|
|
207
|
+
Their status ink also identifies them. The neutral fill separates by 1.188:1 on that ground.
|
|
208
|
+
These fill ratios describe separation, not text contrast.
|
|
209
|
+
|
|
210
|
+
- **The accent is measured against its own wash, not against the surfaces.** Every one of
|
|
211
|
+
the eight theme × accent cells clears 4.5:1. The wash *is* the accent at low alpha, so
|
|
212
|
+
changing one without the other is only a partial change.
|
|
213
|
+
- **A disabled control is painted, never faded.** Every disabled rule with a label under it
|
|
214
|
+
uses `--disabled-ink` on `--disabled-surface` at full opacity. A ghost button paints no box
|
|
215
|
+
and uses `--disabled-ink-bare`. One rule still fades: the switch track, which has no label
|
|
216
|
+
inside it.
|
|
217
|
+
- **The floor is 3:1, and a disabled control never shows the pair it shows enabled.** Contrast
|
|
218
|
+
provides legibility. The paint provides the state.
|
|
219
|
+
- **A field has no fill step, so the ground you put it on decides whether its box is seen.**
|
|
220
|
+
`--field-bg` and `--disabled-surface` are both `--surface` in both themes. A field is
|
|
221
|
+
therefore drawn by its edge. On the page ground, a disabled field measures 1.12:1. This is
|
|
222
|
+
a white box on a grey page. **Put a form on a card.**
|
|
223
|
+
- **The box reports the state, so a field that is off draws the fainter edge of the two.** The
|
|
224
|
+
same two tokens paint a button, so a button that is off drops a rung with the field.
|
|
225
|
+
- **A disabled select carries the kit's own paint and no fade.** The kit's disabled field
|
|
226
|
+
rule resets the `opacity: 0.7` that Chromium's user-agent stylesheet applies to one.
|
|
227
|
+
- **A dropdown trigger uses the live control edge while it is live.** It uses
|
|
228
|
+
`--control-edge`, as `.ui-btn` does. When it is off, it uses `--disabled-border`,
|
|
229
|
+
`--disabled-ink`, and `cursor: not-allowed`. Hover does not take the accent from an
|
|
230
|
+
off trigger. A native disabled trigger also leaves the tab order and does not open.
|
|
231
|
+
|
|
232
|
+
## Elevation
|
|
233
|
+
|
|
234
|
+
**A surface casts a shadow only to show that it is higher.** A level keeps its step on a
|
|
235
|
+
ladder of lightness in both themes. **Each raised level draws a line. Light adds a faint short
|
|
236
|
+
shadow. Dark draws the line only.** In light, the line is `--level-line`, half way between
|
|
237
|
+
`--border` and `--border-strong`. A floating surface in dark draws the outer line and an
|
|
238
|
+
inner line, and it keeps `--elev-drop`. A line that divides two regions of one surface is not
|
|
239
|
+
a level. It stays a line in both themes. Examples include a card's row dividers, a table's
|
|
240
|
+
row rules, the rail's head band and the topbar's bottom rule. A field is not a level either
|
|
241
|
+
because its edge says "type here". A scroll shade is not a level. A table shades the edge
|
|
242
|
+
where columns scroll under its frame or its pinned column, in both themes. A step of lightness on its own has a contrast of about
|
|
243
|
+
1.1, so a level never has only its step.
|
|
244
|
+
|
|
245
|
+
| Level | Light line | Light shadow | Dark line | Dark shadow |
|
|
246
|
+
| --- | --- | --- | --- | --- |
|
|
247
|
+
| page | none | none | none | none |
|
|
248
|
+
| card | `--level-line` | `--elev-rest` | `--border` | none |
|
|
249
|
+
| rail | `--level-line`, right side | `--elev-rail` | `--border` | none |
|
|
250
|
+
| menu, popover, drawer, toast | `--level-line`, one line | `--elev-drop` | `--border-strong` outside, `--border` inside | `--elev-drop` |
|
|
251
|
+
| modal | `--level-line`, one line | `--elev-drop` | none, the deep scrim separates it | `--elev-drop` |
|
|
252
|
+
|
|
253
|
+
Each level reads its line from one token in both themes: `--card-edge`, `--rail-edge`,
|
|
254
|
+
`--float-edge`, `--float-edge-inner` and `--modal-edge` (`src/tokens/tokens.css`). The React
|
|
255
|
+
modal draws `--modal-edge` as an inset line (`react/src/Modal.css`).
|
|
256
|
+
|
|
257
|
+
The ladder, from bottom to top:
|
|
258
|
+
|
|
259
|
+
| Token | The step | Dark | Light |
|
|
260
|
+
| --- | --- | --- | --- |
|
|
261
|
+
| `--bg` | the page | `#0e0d14` | `#f2f3f6` |
|
|
262
|
+
| `--surface-2` | non-text sunken marks and tracks | `#161520` | `#e9ecf3` |
|
|
263
|
+
| `--surface` | a card | `#211e2d` | `#ffffff` |
|
|
264
|
+
| `--bg-elevated` | floating — a menu, a panel, the drawer, a modal, a toast | `#2a2639` | `#ffffff` |
|
|
265
|
+
| `--surface-3` | non-text quiet fills | `#2d293c` | `#eef0f5` |
|
|
266
|
+
|
|
267
|
+
**Text sits on the page, card or floating panel surface, never on a grey inset.** In both
|
|
268
|
+
themes, fields, code blocks, navigation labels and segmented controls use those reading
|
|
269
|
+
surfaces. `--surface-2` and `--surface-3` are for non-text fills and tracks. A status chip
|
|
270
|
+
is the named exception. It uses a soft fill, and neutral chip tones use
|
|
271
|
+
`--chip-neutral-fill`. This avoids the old card-surface badge, which sat darker than a
|
|
272
|
+
floating panel in dark and vanished on a white card in light.
|
|
273
|
+
|
|
274
|
+
**A selected item is the one exception.** Selection is marked by a background highlight. An
|
|
275
|
+
enabled chosen segmented pill fills `--accent` on its track, with `--accent-contrast` ink in light
|
|
276
|
+
and `--signal-contrast` ink in dark. A disabled chosen pill keeps `--surface-3` and the disabled
|
|
277
|
+
ink.
|
|
278
|
+
|
|
279
|
+
**What floats depends on the surface's job, not on its rung.** A floating surface has the
|
|
280
|
+
whole purpose of being temporarily above something else. It writes both devices as one
|
|
281
|
+
`box-shadow` list. The inset line comes first, followed by the drops. Each rung has one token
|
|
282
|
+
per theme: `--elev-rest` under a card, `--elev-rail` beside the rail, `--elev-drop` under a
|
|
283
|
+
floating surface, and `--elev-edge` to re-point the inner line:
|
|
284
|
+
|
|
285
|
+
```css
|
|
286
|
+
box-shadow: inset 0 0 0 1px var(--elev-edge, var(--float-edge-inner)), var(--elev-drop);
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**The focus ring does not touch that list.** The band is an `outline`, so a focused panel keeps
|
|
290
|
+
the edge and the drop it rests on without restating them.
|
|
291
|
+
|
|
292
|
+
Inside a floating panel, rows keep a reading surface. A hovered row takes its own background fill, distinct from a selected row's fill, and no outline. Fields use the same field tokens as
|
|
293
|
+
elsewhere. A chip uses `--chip-neutral-fill` rather than the card surface. The floating panel is
|
|
294
|
+
itself lighter than a card in dark, so the card surface is the darker step there.
|
|
295
|
+
|
|
296
|
+
`--shadow-sm`, `--shadow-md`, `--shadow-lg`, `--shadow-seg` and `--shadow-card` are still
|
|
297
|
+
published. All five are the transparent shadow `0 0 #0000` in both themes. They are
|
|
298
|
+
transparent rather than `none`, because `none` would invalidate any list in which it
|
|
299
|
+
appears. A zero-offset layer in a signal's own colour is a **glow**. `--glow-*` and `--sheen`
|
|
300
|
+
have that shape. `--ring` does not: it is an `outline` value, so no box-shadow answers focus.
|
|
301
|
+
|
|
302
|
+
**An inline code chip paints the reading surface that its container is not on.** The container
|
|
303
|
+
states which surface that is in `--code-bg`, and the chip reads that value. The chip never
|
|
304
|
+
declares it:
|
|
305
|
+
|
|
306
|
+
| The ground | What it hands a chip | Token |
|
|
307
|
+
| --- | --- | --- |
|
|
308
|
+
| the page | the card | `--code-bg: var(--surface)` on `:root` |
|
|
309
|
+
| a card, a panel, any painted container | the page | `--code-bg: var(--bg)` |
|
|
310
|
+
| a table | the card in dark, the page in light | `--table-code-bg`, the pair of `--table-bg` |
|
|
311
|
+
| a tinted card or snippet | the card it is a variant of | `--code-bg: var(--surface)` |
|
|
312
|
+
| a translucent wash over any of them | the page in dark, the card in light | `--wash-code-bg` |
|
|
313
|
+
|
|
314
|
+
If you paint your own reading surface, give `--code-bg` the other surface. A table sets
|
|
315
|
+
`--table-bg` and `--table-code-bg` together. A wash that takes caller markup sets
|
|
316
|
+
`--code-bg: var(--wash-code-bg)`. The chip keeps at least 1.065 against every ground the kit
|
|
317
|
+
draws, in both themes.
|
|
318
|
+
|
|
319
|
+
**A tinted card stays above the page.** `.ui-card--accent` and `.ui-card--live` mix their
|
|
320
|
+
colour into `--surface` through `--card-tint`. Dark can spend 9%. Light can spend 5%. Each
|
|
321
|
+
variant edges itself in its own colour.
|
|
322
|
+
|
|
323
|
+
**The ladder is capped by ink.** `--muted` carries state and placeholder information. It
|
|
324
|
+
clears AA on every step that the ladder raises. It is re-picked against the top of the
|
|
325
|
+
ladder, rather than against the page.
|
|
326
|
+
|
|
327
|
+
## The focus ring
|
|
328
|
+
|
|
329
|
+
One indicator: a 2px solid accent band, drawn as a real `outline`, with 1px between it and the
|
|
330
|
+
control. There is no halo. The offset is left **unpainted**, so what shows in that 1px is
|
|
331
|
+
whatever surface the control is already standing on.
|
|
332
|
+
|
|
333
|
+
A link that breaks across two lines draws one band per line, because an `outline` follows each
|
|
334
|
+
line box it covers. This is the same thing the browser's own outline already did, so a link
|
|
335
|
+
gets no new limit by taking the kit's band instead.
|
|
336
|
+
|
|
337
|
+
```css
|
|
338
|
+
--ring-width: 2px;
|
|
339
|
+
--ring-color: var(--accent);
|
|
340
|
+
--ring-gap-width: 1px;
|
|
341
|
+
--ring: var(--ring-width) solid var(--ring-color);
|
|
342
|
+
--ring-offset: var(--ring-gap-width);
|
|
343
|
+
--ring-scroll: var(--ring);
|
|
344
|
+
--ring-scroll-offset: calc(-1 * (var(--ring-gap-width) + var(--ring-width)));
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
A consumer takes the band and the offset that places it. Take one without the other and the band
|
|
348
|
+
is drawn flush against the control, closing the gap it is read across:
|
|
349
|
+
|
|
350
|
+
```css
|
|
351
|
+
.my-control:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Tune it at `--ring-width`, `--ring-color` and `--ring-gap-width`. The four values built from them
|
|
355
|
+
are declared once each, at `:root`, and **no surface recomposes any of them**: a direct `--ring`
|
|
356
|
+
override reaches every control. There is no gap colour to hand down.
|
|
357
|
+
|
|
358
|
+
**`--ring-scroll` is the indicator a box takes when its own edges are a surface's edges.** It uses
|
|
359
|
+
the same 1px gap and 2px band, but draws them inward. A scroll region inside a surface is one such
|
|
360
|
+
box. A link filling a table cell is another, and so is a line of text inside a cell that clips. You
|
|
361
|
+
need both values, or the band appears outside the box.
|
|
362
|
+
|
|
363
|
+
**Every focusable control the kit ships draws the band**, including a roving row the keyboard
|
|
364
|
+
reaches with an arrow key rather than Tab. None falls back to the browser's own outline, which
|
|
365
|
+
ignores the accent and is black in both themes. **Every link draws it too,
|
|
366
|
+
including one of your own with no class on it.** The ring is claimed for the `a` element, so a
|
|
367
|
+
link in running text, a router link and a plain `<a>` used as an action all answer the keyboard
|
|
368
|
+
with the band and take nothing to opt into. A component that rings its own anchor — a table
|
|
369
|
+
cell's link or the footer's — is the more specific rule and keeps the shape and the
|
|
370
|
+
corner it already drew. **A control of your own wears `.ui-focusable`**, the kit's opt-in class,
|
|
371
|
+
for a focusable that is neither a link nor a kit control — a `div` or `span` you gave a
|
|
372
|
+
`tabindex`.
|
|
373
|
+
|
|
374
|
+
**A focused control draws the band and nothing beside it.** A boxed text field keeps its 1px border width during visible focus.
|
|
375
|
+
The same rule applies to a text area, select and search field. Their border becomes transparent during visible focus.
|
|
376
|
+
This applies to vanilla and React fields, including the Dropdown search field. The ring keeps its 2px width and accent ink.
|
|
377
|
+
It also keeps a 1px clear gap. Other edges keep their resting ink.
|
|
378
|
+
If a hover rule would outrank focus, it stands aside with `:not(:focus-visible)`.
|
|
379
|
+
A drop zone still recolours its dashed edge while a file is over it. That edge marks the drop target, not focus.
|
|
380
|
+
|
|
381
|
+
**An outline means focus; selection is a background highlight.** A selected, current or active
|
|
382
|
+
item is marked by its fill, its ink and its weight, never by an edge drawn around it — an edge on
|
|
383
|
+
a selected row is the band's own shape one pixel further in. One mark is a deliberate exception
|
|
384
|
+
and says so beside its rule: the date picker's current period keeps its accent hairline at rest,
|
|
385
|
+
which stands aside while the cell holds focus.
|
|
386
|
+
|
|
387
|
+
Controls use native `:focus-visible`, including inputs and invalid fields. An invalid field keeps
|
|
388
|
+
its error message while its focused border becomes transparent. **Forced colours needs nothing extra**: the band
|
|
389
|
+
is a real outline, which is what the system repaints, so no consumer carries a transparent stand-in
|
|
390
|
+
outline. The ring uses no layout space, so an ancestor's overflow boundary can clip its 3px
|
|
391
|
+
footprint.
|
|
392
|
+
|
|
393
|
+
**Migrating from the box-shadow ring.** `--ring` was a `box-shadow` value and is an `outline`
|
|
394
|
+
value. A sheet that writes `box-shadow: var(--ring)` draws nothing — the declaration is invalid —
|
|
395
|
+
and has to write the pair above instead. `--ring-gap` is gone with the painted gap it coloured; if
|
|
396
|
+
you set it on a painted container of your own, or recomposed `--ring` there, delete both.
|
|
397
|
+
`--ring-width`, `--ring-color` and `--ring-gap-width` are unchanged.
|
|
398
|
+
|
|
399
|
+
## A field is 16px on a touch screen
|
|
400
|
+
|
|
401
|
+
iOS Safari zooms the page into a focused field when its text is smaller than 16px. It does not
|
|
402
|
+
zoom back out.
|
|
403
|
+
|
|
404
|
+
- **One net, over elements rather than classes.** A single `@media (pointer: coarse)` rule
|
|
405
|
+
sets `input`, `select` and `textarea` to 16px. Both published stylesheets import it. Controls
|
|
406
|
+
with nothing to type into are excluded because they do not zoom. The rule uses `!important`
|
|
407
|
+
because it must outrank a component rule that it has not seen.
|
|
408
|
+
- **The size is real, never a scaled 16px.** The zoom uses the computed font size. A 16px field
|
|
409
|
+
that is made smaller with a `transform` still zooms.
|
|
410
|
+
- **`font-size` and not the viewport.** `user-scalable=no` also stops the zoom. It removes
|
|
411
|
+
pinch-zoom for every reader of the page, which fails WCAG 1.4.4.
|
|
412
|
+
- **It is a flat size rather than a floor**, so a host field *designed above 16px* — a 20px
|
|
413
|
+
hero search — becomes smaller on a touch screen. Use your own `!important` rule, with higher
|
|
414
|
+
specificity than the net, instead of repeating it:
|
|
415
|
+
|
|
416
|
+
```css
|
|
417
|
+
/* more specific than the net's bare element, so it wins whichever sheet loads first */
|
|
418
|
+
.hero-search input { font-size: 20px !important; }
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
A bare `input { font-size: 20px !important; }` has the same specificity as the net. It works
|
|
422
|
+
only while your stylesheet loads after the kit's.
|
|
423
|
+
|
|
424
|
+
## A tap reaches the floor below the phone step
|
|
425
|
+
|
|
426
|
+
A finger covers more area than a cursor. Below the phone step, the kit's own small controls
|
|
427
|
+
measure under 44px on at least one axis. **Two floors:** `--tap-min` is 44, the target the
|
|
428
|
+
sheet aims for, and `--tap-aa` is 24, WCAG 2.5.8, which the kit keeps at every width.
|
|
429
|
+
|
|
430
|
+
**The extra size goes outside the drawn shape**. The kit adds a transparent, centred layer for
|
|
431
|
+
each small-control family. **The control keeps the size it draws.** A layer never crosses a
|
|
432
|
+
neighbour's drawn edge. `--tap-clear-x` and `--tap-clear-y` define the clear space to the
|
|
433
|
+
nearest neighbour on each axis. A layer uses **half** of that space on each side and then
|
|
434
|
+
stops. The container declares the clamp because it is the only part that knows its own gap.
|
|
435
|
+
**Both default to zero**, so declare the clearance when you build a row of small controls.
|
|
436
|
+
Otherwise, their targets stay at the size they draw.
|
|
437
|
+
|
|
438
|
+
**Where the kit packs tighter than a zone needs, the gap opens** to `--tap-gap`, which is 20.
|
|
439
|
+
**The controls do not change size**. Only the space between them changes. A row opens down
|
|
440
|
+
unless it cannot overflow. Only a row whose marks are each a fixed square, a drawer header,
|
|
441
|
+
or a dense table's action cell opens across. Some families get no layer. The Accessibility
|
|
442
|
+
minimums page names all of them. Rows that share an edge have no space outside a row for a
|
|
443
|
+
layer. `input`, `select` and `textarea` generate no pseudo-element and use their own height.
|
|
444
|
+
A back link draws 24 on both axes because it cannot know what the shell places above it.
|
|
445
|
+
|
|
446
|
+
The whole system is behind `@media (max-width: 560px) and (pointer: coarse)`. A transparent
|
|
447
|
+
layer is also a hover surface, and a coarse pointer has no hover. The sheet is imported
|
|
448
|
+
**last**, and its openings use `!important` because each one overrides a gap already set by a
|
|
449
|
+
component. `--tap-min` is declared in that sheet rather than the token file because the React
|
|
450
|
+
entry imports these nets without `tokens.css`. It is still a token, and you can move it.
|
|
451
|
+
|
|
452
|
+
**A row that already has the room opens nothing and still says so.** The shell's band
|
|
453
|
+
remains a 52px row. Its phone palette trigger measures 37.05px tall, and its theme switch
|
|
454
|
+
remains 34px square. The existing space lets their targets reach 44px without changing
|
|
455
|
+
those drawn sizes.
|
|
456
|
+
|
|
457
|
+
On a phone, the product topbar uses two rows with a 44px minimum height per row.
|
|
458
|
+
Brand, theme and account occupy the first row. The view and version switches occupy the
|
|
459
|
+
second row. Both rows use the same 12px side inset, with an 8px gap between rows. The theme switch
|
|
460
|
+
and the account end at that inset whatever the version label's width. A band with one row
|
|
461
|
+
stays 52px, as on a wide screen.
|
|
462
|
+
The theme switch stays 34px square and keeps its 44px target.
|
|
463
|
+
|
|
464
|
+
Both containers declare `--space-3` of clearance. Half of 12px gives each side 6px,
|
|
465
|
+
but the theme switch's layer stops at the 44px floor, 5px from its drawn edge.
|
|
466
|
+
The 8px phone gap keeps that layer clear of its neighbour's drawn box. The neighbour
|
|
467
|
+
carries no layer of its own there. Above 560px, the topbar keeps its single 52px row
|
|
468
|
+
and 14px gaps, and the transparent tap layer does not apply.
|
|
469
|
+
|
|
470
|
+
## Icons and glyphs
|
|
471
|
+
|
|
472
|
+
**A stroked glyph earns the graphic bar from its width.** A reader sees
|
|
473
|
+
`stroke-width × box ÷ viewBox`. So, when the same stroke is stated once and reused at a
|
|
474
|
+
second box, the result is two different marks. At or above **1.5 CSS px**, a mark is a graphic
|
|
475
|
+
and uses the 3:1 bar. Below that, it looks like a text stem and uses the 4.5:1 text bar instead.
|
|
476
|
+
|
|
477
|
+
**Every stroked glyph in the kit clears 1.5 CSS px.** The rule that sets a glyph's box also sets
|
|
478
|
+
its stroke. The two values stay together. There is **no second bar for a control's glyph**. A
|
|
479
|
+
glyph inside a button is not exempt because it is small.
|
|
480
|
+
|
|
481
|
+
**A select draws one chevron on its right edge in every theme and state.** The glyph is a
|
|
482
|
+
background image. Its settings use three longhands: `background-image`, `-repeat` and
|
|
483
|
+
`-position`. Any `background` shorthand applied to the same element resets all three. A rule
|
|
484
|
+
that repaints this element sets `background-color`, not `background`. Controls that paint only
|
|
485
|
+
a colour keep the shorthand.
|
|
486
|
+
|
|
487
|
+
`iconOnlyAllowed` and `iconMeanings` publish the two icon rules as data. They state which
|
|
488
|
+
glyphs may appear without a word and what each glyph means.
|
|
489
|
+
|
|
490
|
+
**A status glyph is circled.** A circled glyph reports a state. A bare glyph names an action.
|
|
491
|
+
`toast()` and `callout()` use the circled status glyphs for success, danger and warning:
|
|
492
|
+
`circleCheck`, `circleX` and `circleAlert`. Info and neutral callouts use `info`. An explicit
|
|
493
|
+
`icon` still wins. A neutral toast still uses `bolt`, because it reports an event without a
|
|
494
|
+
verdict.
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
|
|
33
33
|
<!-- rule: menu -->
|
|
34
34
|
|
|
35
|
-
**Rule:** Keep the account menu to the reader,
|
|
35
|
+
**Rule:** Keep the account menu to the reader, a few ways in, a Theme submenu and Sign out.
|
|
36
36
|
|
|
37
37
|
**Why:** A setting answered inside a menu has no address to link, search or come back to.
|
|
38
38
|
|
|
39
|
-
**Do:** Name the reader, then
|
|
39
|
+
**Do:** Name the reader, then Account settings and Support.
|
|
40
40
|
|
|
41
41
|
**Don't:** Answer the settings in the menu, a row per setting.
|
|
42
42
|
|
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
|
|
89
89
|
**Don't:** The rows stacked under the bars, in one block or the next.
|
|
90
90
|
|
|
91
|
+
## Leave the range out of a chart card
|
|
92
|
+
|
|
93
|
+
<!-- rule: no-range-on-chart -->
|
|
94
|
+
|
|
95
|
+
**Rule:** Title a chart card by what it measures, and leave out the range of its data.
|
|
96
|
+
|
|
97
|
+
**Why:** The page or the filter around the chart already holds the range.
|
|
98
|
+
|
|
99
|
+
**Do:** Spend against estimate, with no subtitle.
|
|
100
|
+
|
|
101
|
+
**Don't:** The same card with the first half of 2026 under its title.
|
|
102
|
+
|
|
91
103
|
## Name the lines by their values or a key
|
|
92
104
|
|
|
93
105
|
<!-- rule: value-not-legend -->
|
|
@@ -108,6 +120,8 @@
|
|
|
108
120
|
|
|
109
121
|
**Why:** Past two lines, the colours are hard to tell apart and the crossings hide the shape of each line.
|
|
110
122
|
|
|
123
|
+
**Except:** Three smooth areas compared by shape.
|
|
124
|
+
|
|
111
125
|
**Do:** Spend against Estimated, then revenue against expenses on a second chart.
|
|
112
126
|
|
|
113
127
|
**Don't:** All four lines on one chart.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**Rule:** Put tables on a white surface in light mode and the base canvas in dark mode.
|
|
10
10
|
|
|
11
|
-
**Do:**
|
|
11
|
+
**Do:** Let the row edge mark hover.
|
|
12
12
|
|
|
13
13
|
**Don't:** Add a grey zebra or hover fill.
|
|
14
14
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
**Rule:** Right-align numeric headers and values.
|
|
34
34
|
|
|
35
|
-
**Do:**
|
|
35
|
+
**Do:** Use tabular numerals, and keep text left-aligned.
|
|
36
36
|
|
|
37
37
|
**Don't:** Align numbers to their labels or sort formatted strings.
|
|
38
38
|
|
|
@@ -111,3 +111,17 @@
|
|
|
111
111
|
**Do:** Retain rows while refreshing, report busy state, distinguish no data from no matches and errors, and preserve focus when filters change.
|
|
112
112
|
|
|
113
113
|
**Don't:** Replace the table with a blank state or move focus without telling the reader why.
|
|
114
|
+
|
|
115
|
+
## Give every table its filter bar
|
|
116
|
+
|
|
117
|
+
<!-- rule: filter-bar -->
|
|
118
|
+
|
|
119
|
+
**Why:** Readers narrow rows before reading them, and look for the bar where other tables put it.
|
|
120
|
+
|
|
121
|
+
**Rule:** Put a bar with a search field and column filters directly above every table.
|
|
122
|
+
|
|
123
|
+
**Do:** Search, then a status filter, on the row above the table.
|
|
124
|
+
|
|
125
|
+
**Don't:** Leave rows that the reader cannot narrow.
|
|
126
|
+
|
|
127
|
+
**Except:** Two tables take no bar: one that compares a document line by line, where a filter hides lines the reviewer must check, and a chart's Table view, which holds only the chart's points.
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
|
|
49
49
|
**Do:** Lead with the extracted fields, in the wider column, with each value heavier than its label, and put the accent on the pane's own name.
|
|
50
50
|
|
|
51
|
-
**Don't:** Give the
|
|
51
|
+
**Don't:** Give the document preview the leading, wider pane, or let a control inside it hold the only accent on the screen while the saved values hold none.
|
|
52
52
|
|
|
53
53
|
**Except:** Fade nothing to make a block quieter; a quieter block is smaller, later or uncoloured, never muted.
|
package/guidelines/going-back.md
CHANGED
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
|
|
41
41
|
**Except:** After search or another record, still link to the parent; browser Back returns to the previous location.
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Skip the trail
|
|
44
44
|
|
|
45
45
|
<!-- rule: one-or-the-other -->
|
|
46
46
|
|
|
47
|
-
**Rule:** Put one back link
|
|
47
|
+
**Rule:** Put one back link, to the parent, above a subpage’s title.
|
|
48
48
|
|
|
49
|
-
**Why:**
|
|
49
|
+
**Why:** The sidebar already shows the section, so a trail names the same place again.
|
|
50
50
|
|
|
51
|
-
**Do:**
|
|
51
|
+
**Do:** Link Invoices above an invoice.
|
|
52
52
|
|
|
53
|
-
**Don't:**
|
|
53
|
+
**Don't:** Stack a link for each level, such as Finance then Invoices.
|
|
54
54
|
|
|
55
55
|
## Keep the section active
|
|
56
56
|
|
package/guidelines/the-page.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apliteni/apliteni-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.154.0",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
"!src/**/*.test.js",
|
|
47
47
|
"react/dist",
|
|
48
48
|
"guidelines",
|
|
49
|
-
"README.md"
|
|
49
|
+
"react/README.md",
|
|
50
|
+
"docs/components.md",
|
|
51
|
+
"docs/foundations.md",
|
|
52
|
+
"TRADEMARK.md"
|
|
50
53
|
],
|
|
51
54
|
"sideEffects": [
|
|
52
55
|
"*.css"
|