@apliteni/apliteni-ui 0.158.2 → 0.160.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 CHANGED
@@ -72,6 +72,30 @@ families support weights 300–700.
72
72
  If a family does not load, the browser uses its system fallback stack. The kit does not
73
73
  display a message about this fallback.
74
74
 
75
+ ## Lint app styles
76
+
77
+ The package ships a stylelint config at `@apliteni/apliteni-ui/stylelint`. It refuses a
78
+ raw colour, a raw `px`, `rem` or `em` spacing value, and an override of a `.ui-*` kit
79
+ class. Install stylelint, then extend the config:
80
+
81
+ ```bash
82
+ npm install --save-dev stylelint
83
+ ```
84
+
85
+ ```json
86
+ {
87
+ "extends": ["@apliteni/apliteni-ui/stylelint"]
88
+ }
89
+ ```
90
+
91
+ Use a semantic colour token such as `var(--text)` and a spacing token such as
92
+ `var(--space-4)` from `@apliteni/apliteni-ui/tokens`. Turn a rule off only with a
93
+ comment that names the approved exception, after `--`:
94
+
95
+ ```css
96
+ /* stylelint-disable color-no-hex -- an approved brand colour */
97
+ ```
98
+
75
99
  ## Theme and accent
76
100
 
77
101
  Set the theme on `<html>` with `data-theme="dark|light"`. You can set an accent separately
@@ -665,7 +665,7 @@ larger.
665
665
  ### Dense financial tables
666
666
 
667
667
  The table is markup. A named scroll region contains a native `<table>`, and you apply the
668
- recipes as classes. Zebra adds no grey stripes. Hover gives a row a quiet neutral fill.
668
+ recipes as classes. Zebra adds no grey stripes. Hover gives a row a quiet neutral fill across the table width. Without zebra, the fill has round ends, and the first and last content sit 8px inside it. No row line crosses those ends.
669
669
  Keyboard focus keeps its ring, and a landed row keeps its own mark. `compact` sets a 33px minimum row, but larger or wrapped content makes the row
670
670
  taller. **Columns scroll rather than disappear**, while sticky headers and pinned identity cells
671
671
  keep opaque backgrounds, the shared focus composition, and their full accessible names. **A
@@ -0,0 +1,33 @@
1
+ # Guideline index
2
+
3
+ Each row names one guideline page, the screen parts it covers, and when to read it.
4
+
5
+ | Page | Screen parts | When to read |
6
+ | --- | --- | --- |
7
+ | [The page](the-page.md) | The page shell, content width, headings, the main action, card stacks, table density and the page introduction. | Read it before you build any screen. |
8
+ | [Dashboards and reports](dashboards-and-reports.md) | Dashboard figures, trends and exceptions, report tables, chart cards and a report export. | Read it before you build a dashboard or a report. |
9
+ | [Destructive actions](destructive-actions.md) | Danger controls, action names and confirmation or undo. | Read it before you add a delete, revoke or remove action. |
10
+ | [Colour and theming](colour-and-theming.md) | Colour tokens, accents, signal colours, theme checks and forced colours. | Read it before you pick colours, accents or check contrast. |
11
+ | [The full state set](state-set.md) | Focus rings, busy controls, errors and screen loading. | Read it before you build focus, busy, error or loading states. |
12
+ | [Empty states](empty-states.md) | An empty page or list and a no-matches message. | Read it when a screen can show no content. |
13
+ | [Component choice](component-choice.md) | Buttons, dialogs, toasts, tabs, segmented controls and dropdown search. | Read it before you choose a control, a dialog or a notice. |
14
+ | [Microcopy and tone](microcopy.md) | Names for controls and their current state. | Read it before you name controls or states. |
15
+ | [Text length](text-length.md) | Labels, buttons, captions, callouts and introductions. | Read it when you write labels, captions or callouts. |
16
+ | [Labels and titles](labels-and-titles.md) | Text ink, sentence case, card titles and eyebrows. | Read it when you write labels, titles or eyebrows. |
17
+ | [Button labels](button-labels.md) | Button words, glyphs and wordless buttons. | Read it before you write button words or add glyphs. |
18
+ | [Iconography](iconography.md) | Icon-only controls, status glyphs and glyph paths. | Read it before you use a glyph or an icon-only control. |
19
+ | [Layout and density](layout-and-density.md) | Page width, the reading column, the spacing scale and breakpoints. | Read it before you set page width, columns or breakpoints. |
20
+ | [Spacing](spacing.md) | Page gaps, title placement and the text edge. | Read it before you set gaps on a page. |
21
+ | [Density and accents](density-and-accents.md) | Stat band stacking, a list-and-preview pair and accent use. | Read it before you build a stat band or a list preview. |
22
+ | [Dense tables](dense-tables.md) | Table surface, alignment, units, scrolling and a filter bar. | Read it before you build a table. |
23
+ | [Accessibility minimums](accessibility-floor.md) | Target size, tap zones, focus contrast, disabled controls and keyboard. | Read it before you size targets, fields or focus. |
24
+ | [Pagination](pagination.md) | Page steps, counts and page sizes. | Read it before you add paging to a table. |
25
+ | [Stat bands](stat-bands.md) | Key figures, change colour and the comparison basis. | Read it before you show key figures. |
26
+ | [Drawers](drawer.md) | A drawer or a page, drawer content and dividers. | Read it before you open a record in a panel. |
27
+ | [File drop](file-drop.md) | The upload row, the drag target and file states. | Read it before you build a file upload. |
28
+ | [Motion](motion.md) | Motion durations, curves and reduced motion. | Read it before you add animation or transitions. |
29
+ | [The command palette](command-palette.md) | Palette contents, ranking and keyboard. | Read it before you build or change the palette. |
30
+ | [Hover readouts](hover-readouts.md) | Hover values, their placement and touch access. | Read it before you show values on hover or tap. |
31
+ | [Going back](going-back.md) | The back link, its destination and the parent address. | Read it when a page sits under another page. |
32
+ | [Account and settings](account-and-settings.md) | The account window, the account menu and settings rows. | Read it before you build the account menu or settings. |
33
+ | [Guidelines](overview.md) | No screen parts. The file holds only the collection heading. | Read it only for the heading. The six-card overview is in Storybook, not in the package. |
@@ -8,9 +8,9 @@
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:** Let the row edge mark hover.
11
+ **Do:** Mark a hovered row with an inset grey fill that leaves room at both ends of the row.
12
12
 
13
- **Don't:** Add a grey zebra or hover fill.
13
+ **Don't:** Add a grey zebra.
14
14
 
15
15
  ## Choose density without shrinking type
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.158.2",
3
+ "version": "0.160.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -30,6 +30,7 @@
30
30
  "default": "./src/motion.js"
31
31
  },
32
32
  "./inline": "./src/inline.js",
33
+ "./stylelint": "./src/stylelint.js",
33
34
  "./css": "./src/index.css",
34
35
  "./tokens": "./src/tokens/tokens.css",
35
36
  "./accents": "./src/tokens/accents.css",
@@ -68,12 +69,21 @@
68
69
  "engines": {
69
70
  "node": ">=20"
70
71
  },
72
+ "peerDependencies": {
73
+ "stylelint": ">=16"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "stylelint": {
77
+ "optional": true
78
+ }
79
+ },
71
80
  "devDependencies": {
72
81
  "@storybook/addon-a11y": "^10.5.5",
73
82
  "@storybook/react-vite": "^10.6.1",
74
83
  "axe-core": "^4.12.1",
75
84
  "jsdom": "^30.0.1",
76
85
  "storybook": "^10.6.4",
86
+ "stylelint": "^18.0.0",
77
87
  "vite": "^8.2.0"
78
88
  }
79
89
  }
@@ -0,0 +1,31 @@
1
+ // stylelint config for app styles. Import it as `@apliteni/apliteni-ui/stylelint`.
2
+ // A rule is off only with a comment that names an approved exception:
3
+ // `/* stylelint-disable <rule> -- <reason> */`.
4
+
5
+ const colourMessage = 'Use a semantic colour token from @apliteni/apliteni-ui/tokens.';
6
+
7
+ export default {
8
+ reportDescriptionlessDisables: true,
9
+ rules: {
10
+ 'color-no-hex': [true, { message: colourMessage }],
11
+ 'color-named': ['never', { message: colourMessage }],
12
+ 'function-disallowed-list': [
13
+ [/^(rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)$/i],
14
+ { message: 'Use a semantic colour token or a color-mix() of tokens from @apliteni/apliteni-ui/tokens.' },
15
+ ],
16
+ 'declaration-property-unit-disallowed-list': [
17
+ {
18
+ '/^margin/': ['px', 'rem', 'em'],
19
+ '/^padding/': ['px', 'rem', 'em'],
20
+ '/gap/': ['px', 'rem', 'em'],
21
+ '/^inset/': ['px', 'rem', 'em'],
22
+ '/^(top|right|bottom|left)$/': ['px', 'rem', 'em'],
23
+ },
24
+ { message: 'Use a spacing token such as var(--space-4) from @apliteni/apliteni-ui/tokens.' },
25
+ ],
26
+ 'selector-disallowed-list': [
27
+ [/\.ui-/],
28
+ { message: 'Do not override a kit class. Use the kit component, or file the missing part.' },
29
+ ],
30
+ },
31
+ };
@@ -58,30 +58,32 @@
58
58
  .ui-table tr.is-dead td { /* muted-ink: state — revoked row */ color: var(--muted); }
59
59
  .ui-table tbody tr { transition: background var(--dur-fast) var(--ease); }
60
60
 
61
- /* Row hover: an inset, rounded fill so the highlight never sits flush against a
62
- * container's border (#71). The separate border model with zero spacing keeps the row
63
- * separators continuous while letting the row ends round, and table padding — which
64
- * only applies in that model — insets the rows. Zebra keeps the original full-bleed
65
- * tint (finance ledger) and is excluded here; its hover rule is below. */
61
+ /* Row hover: a rounded fill across the full table width. The separate border model with
62
+ * zero spacing lets the row ends round. The table has no side padding, so the end cells
63
+ * hold the room: --space-2 inside the fill at each end, header and body alike, so a
64
+ * column and its header share one edge. A pinned column sticks at the frame's edge with
65
+ * that room inside it (#736). The dense and compact variants and an end action cell
66
+ * keep the same room. Zebra keeps the original full-bleed tint
67
+ * (finance ledger) and is excluded here; its hover rule is below. why: #773 */
66
68
  .ui-table--hover:not(.ui-table--zebra) {
67
69
  border-collapse: separate;
68
70
  border-spacing: 0;
69
- padding: 0 var(--space-2);
70
71
  }
71
- /* A pinned column sticks at the frame's edge, so its first cell owns the start inset
72
- and the text does not move when the table scrolls. why: #736 */
73
- .ui-table--hover.ui-table--pinned:not(.ui-table--zebra) { padding: 0 var(--space-2) 0 0; }
74
- .ui-table--hover.ui-table--pinned:not(.ui-table--zebra) :is(th, td):first-child { padding-left: var(--space-2); }
75
- .ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:first-child {
72
+ :where(.ui-table--hover:not(.ui-table--zebra)) :is(th, td):not(.ui-table__act):first-child { padding-left: var(--space-2); }
73
+ :where(.ui-table--hover:not(.ui-table--zebra)) :is(th, td):not(.ui-table__act):last-child { padding-right: var(--space-2); }
74
+ :where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__act:last-child { padding-right: var(--space-2); }
75
+ .ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th):first-child {
76
76
  border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
77
- .ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:last-child {
77
+ .ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th):last-child {
78
78
  border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
79
- /* The hover band is the last cell, which ends where the figures end, so a hovered row's fill
80
- stopped at the last glyph. The last column of a hover table keeps one cell gap of room
81
- inside the band, header and body alike, so the figures and their header still share one
82
- right edge. The dense and compact variants state their own end padding below, and an
83
- action cell keeps none. */
84
- :where(.ui-table--hover:not(.ui-table--zebra)) :is(th, td):not(.ui-table__act):last-child { padding-right: var(--space-4); }
79
+ /* A row line that met a round corner crossed it. A hovered row drops the line below it,
80
+ the row before it drops the line above it, and the header drops its line over the
81
+ first row. why: #773 */
82
+ .ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th),
83
+ .ui-table--hover:not(.ui-table--zebra) tbody tr:has(+ tr:hover) > :is(td, th),
84
+ .ui-table--hover:not(.ui-table--zebra) thead:has(+ tbody > tr:first-child:hover) > tr > th {
85
+ border-bottom-color: transparent;
86
+ }
85
87
 
86
88
  /* Data-table modifiers, composable: .ui-table--dense --zebra --hover.
87
89
  * --dense --space-3 across, --space-2 down — one step in from the base table
@@ -194,9 +196,13 @@
194
196
  }
195
197
  /* The last cell gave up its end gap above, so the link it holds gives up the same. */
196
198
  .ui-table td.ui-table__linked:where(:last-child) > :is(a:not([class]), a.ui-identity):only-child { padding-right: 0; }
197
- :where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-4); }
199
+ /* A hover table's end cells hold the room inside the fill, so a linked end cell's link does. */
200
+ :where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-2); }
201
+ :where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
198
202
  .ui-table--dense td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding: var(--space-2) var(--space-3); }
199
203
  .ui-table--compact td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding: var(--space-1) var(--space-3); }
204
+ :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-2); }
205
+ :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
200
206
  /* Zebra insets the row's END cells only, so the fill does too: a marked identity behind a
201
207
  selection column is a middle cell, and a step it never gave up would move its name. */
202
208
  .ui-table--zebra td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-3); }
@@ -305,23 +311,32 @@
305
311
  .ui-card > .ui-table-scroll:has(> .ui-table--dense) {
306
312
  margin-inline: calc(-1 * var(--space-4));
307
313
  }
308
- /* A hover table's 8px row inset came on top of the bleed above, so a dense hover table
309
- straight in a card started 8px inside the card's text edge. #757 */
310
- .ui-card > .ui-table-scroll > .ui-table--dense,
314
+ /* A hover table holds 8px at its ends, so a dense one hangs out by that much. why: #773 */
311
315
  .ui-card > .ui-table--dense.ui-table--hover:not(.ui-table--zebra) {
312
- padding-inline: 0;
316
+ width: calc(100% + 2 * var(--space-2));
317
+ margin-inline: calc(-1 * var(--space-2));
318
+ }
319
+ .ui-card--fit > .ui-table--dense.ui-table--hover:not(.ui-table--zebra) {
320
+ width: auto;
321
+ max-width: calc(100% + 2 * var(--space-2));
313
322
  }
314
- /* A hover table's row inset plus the frame's 4px band is one --space-3, so the
315
- frame hangs out by that much and the first column meets the title. why: #736 */
316
- .ui-card > .ui-table-scroll:has(> .ui-table--hover:not(.ui-table--dense)) {
323
+ /* A hover table's 8px end-cell room plus the frame's 4px band is one --space-3, so the
324
+ frame hangs out by that much and the first column meets the title. A dense zebra hover
325
+ table keeps the dense bleed. why: #736, #773 */
326
+ .ui-card > .ui-table-scroll:has(> .ui-table--hover:not(.ui-table--dense.ui-table--zebra)) {
317
327
  margin-inline: calc(-1 * var(--space-3));
318
328
  }
319
329
  .ui-table td.ui-table__num { text-align: right; }
320
330
  .ui-table--compact td,
321
331
  .ui-table--compact :is(tbody, tfoot) th { padding: var(--space-1) var(--space-3); font-size: var(--text-sm); line-height: var(--leading-snug); height: 33px; }
322
332
  .ui-table--compact th { padding: var(--space-2) var(--space-3); }
333
+ .ui-table--compact th:first-child,
334
+ .ui-table--compact td:first-child { padding-left: var(--space-3); }
323
335
  .ui-table--compact th:last-child,
324
336
  .ui-table--compact td:last-child { padding-right: var(--space-3); }
337
+ /* A hover table holds --space-2 inside the fill at each end, and dense and compact too. why: #773 */
338
+ :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) :is(th, td):first-child { padding-left: var(--space-2); }
339
+ :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) :is(th, td):last-child { padding-right: var(--space-2); }
325
340
  /* Columns past the box's edge, said in paint. Two shades, one per side, under two
326
341
  cover layers that ride the content: `local` moves a cover with the scroll, so
327
342
  reaching an end slides that cover over its shade. A cover is solid for its first