@apliteni/apliteni-ui 0.158.2 → 0.159.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 +24 -0
- package/guidelines/INDEX.md +33 -0
- package/package.json +11 -1
- package/src/stylelint.js +31 -0
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
|
|
@@ -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. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apliteni/apliteni-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.159.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
|
}
|
package/src/stylelint.js
ADDED
|
@@ -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
|
+
};
|