@apliteni/apliteni-ui 0.31.0 → 0.33.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 +33 -34
- package/package.json +1 -1
- package/react/README.md +7 -9
- package/react/dist/index.css +10 -2
- package/react/dist/index.d.ts +25 -1
- package/react/dist/index.js +136 -92
- package/src/components/dropdown.js +77 -30
- package/src/components/footer.js +6 -1
- package/src/components/index.js +2 -2
- package/src/components/nav.js +4 -3
- package/src/components/pagination.js +9 -31
- package/src/components/shell.js +197 -30
- package/src/components/stat.js +75 -0
- package/src/components/success.js +12 -1
- package/src/index.css +2 -0
- package/src/index.js +1 -0
- package/src/inline.js +4 -0
- package/src/styles/button.css +6 -5
- package/src/styles/callout.css +7 -4
- package/src/styles/card.css +12 -19
- package/src/styles/command-palette.css +6 -5
- package/src/styles/confirm.css +10 -19
- package/src/styles/drawer.css +6 -6
- package/src/styles/dropdown.css +36 -20
- package/src/styles/feedback.css +11 -13
- package/src/styles/field-zoom.css +20 -0
- package/src/styles/input.css +17 -2
- package/src/styles/layout.css +208 -57
- package/src/styles/motion.css +3 -3
- package/src/styles/nav.css +88 -10
- package/src/styles/pagination.css +1 -0
- package/src/styles/segmented.css +1 -2
- package/src/styles/stat.css +121 -0
- package/src/styles/success.css +2 -2
- package/src/styles/tooltip.css +3 -4
- package/src/styles/topbar.css +36 -10
- package/src/tokens/accents.css +7 -6
- package/src/tokens/tokens.css +51 -38
package/README.md
CHANGED
|
@@ -4,38 +4,37 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://ui.apli.tech)
|
|
6
6
|
|
|
7
|
-
The Apliteni design system
|
|
8
|
-
|
|
9
|
-
ships next).
|
|
7
|
+
The Apliteni design system and UI kit supplies shared UI for the strategy deck,
|
|
8
|
+
the text portal, `/account`, the operating model, and future product surfaces.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
It provides framework-agnostic **HTML + CSS** and **React components** for stateful
|
|
11
|
+
surfaces, with shared tokens, dark and light themes, and **accent sub-themes**.
|
|
12
|
+
Review components in **Storybook** at **ui.apli.tech**.
|
|
14
13
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- **Live site + Storybook** → [ui.apli.tech](https://ui.apli.tech)
|
|
15
|
+
- **Package** → [`@apliteni/apliteni-ui`](https://www.npmjs.com/package/@apliteni/apliteni-ui) (public npm)
|
|
16
|
+
- **React components** → `@apliteni/apliteni-ui/react` — a subpath of the same package, source in [`react/`](./react)
|
|
18
17
|
|
|
19
18
|
## HTML + CSS *and* React
|
|
20
19
|
|
|
21
|
-
The
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
no framework drift. Storybook (`@storybook/html-vite`) renders exactly what ships.
|
|
20
|
+
The strategy portal (`apliteni/strategy`, `viz/`) server-renders HTML strings from
|
|
21
|
+
`.mjs` modules without a component framework. The kit supplies token CSS, component
|
|
22
|
+
CSS, and HTML-string factories that the portal can import without a rewrite.
|
|
23
|
+
Storybook (`@storybook/html-vite`) renders those same strings.
|
|
26
24
|
|
|
27
|
-
React
|
|
28
|
-
|
|
29
|
-
as the vanilla kit, so the two layers can't drift.
|
|
25
|
+
React components handle client state in dashboards, tables, filters, and forms.
|
|
26
|
+
They use the vanilla kit's `.ui-*` classes and tokens.
|
|
30
27
|
|
|
31
28
|
**Which one:** does the surface hold meaningful client state? No → the HTML-string
|
|
32
29
|
factories below. Yes → the [React components](#react-components-stateful-surfaces).
|
|
33
30
|
|
|
34
|
-
Either layer follows the same UI rules —
|
|
35
|
-
owes, how colour and wording work. They live in the **Guidelines** section
|
|
36
|
-
which opens on
|
|
37
|
-
[an overview of
|
|
38
|
-
and what the kit does and does not yet meet.
|
|
31
|
+
Either layer follows the same UI rules — what one page may hold, which component to reach
|
|
32
|
+
for, the states it owes, how colour and wording work. They live in the **Guidelines** section
|
|
33
|
+
of Storybook, which opens on
|
|
34
|
+
[an overview of every page](https://ui.apli.tech/storybook/?path=/story/guidelines-overview--overview)
|
|
35
|
+
and what the kit does and does not yet meet.
|
|
36
|
+
[The page](https://ui.apli.tech/storybook/?path=/story/guidelines-the-page--the-page) is the one
|
|
37
|
+
to read before you design a screen: the limits one page keeps, whatever it is about.
|
|
39
38
|
|
|
40
39
|
## Install
|
|
41
40
|
|
|
@@ -67,10 +66,9 @@ tables, fields, paragraphs, chat, which is most of an application. Weights 300-7
|
|
|
67
66
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap">
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
kit's:
|
|
69
|
+
If either font is missing, that role falls back to its system stack, and nothing says so.
|
|
70
|
+
For the old single-family appearance, set both roles to the same family in your stylesheet,
|
|
71
|
+
after the kit's:
|
|
74
72
|
|
|
75
73
|
```css
|
|
76
74
|
:root { --font-sans: var(--font-display); }
|
|
@@ -82,7 +80,7 @@ The whole `/account` layout (topbar + sticky sidebar + page body) ships as one
|
|
|
82
80
|
factory, so every product renders the same account shell instead of re-building it:
|
|
83
81
|
|
|
84
82
|
```js
|
|
85
|
-
import { accountShell, card, switchToggle, wireTopbar } from '@apliteni/apliteni-ui';
|
|
83
|
+
import { accountShell, card, switchToggle, wireTopbar, wireShell } from '@apliteni/apliteni-ui';
|
|
86
84
|
|
|
87
85
|
el.innerHTML = accountShell({
|
|
88
86
|
word: 'Strategy', // the product word in the topbar
|
|
@@ -93,8 +91,10 @@ el.innerHTML = accountShell({
|
|
|
93
91
|
body: card({ title: 'Appearance', body: switchToggle({ label: 'Reduce motion' }) }),
|
|
94
92
|
});
|
|
95
93
|
wireTopbar(el); // menus, theme toggle, segmented controls
|
|
94
|
+
wireShell(el); // the toggle that folds the rail, the reader's menu, the nav's groups
|
|
96
95
|
|
|
97
96
|
// Custom sidebar nav? pass `nav: [['prefs','gear','Preferences'], ['billing','wallet','Billing']]`
|
|
97
|
+
// A page that will never call wireShell()? pass `collapsible: false` and no toggle is drawn
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
Server-rendered apps that inline CSS (like the strategy portal) import the stylesheet
|
|
@@ -111,18 +111,17 @@ import { tokensCss, topbarCss, cssText } from '@apliteni/apliteni-ui/inline';
|
|
|
111
111
|
same tokens, TypeScript types included. They ship as a **subpath of this package**,
|
|
112
112
|
not as a package of their own: one install, one version, one pin.
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
Install `react` and `react-dom`, version 18 or newer, yourself. The kit declares
|
|
115
|
+
neither a regular nor a peer dependency on React, so npm neither installs it nor
|
|
116
|
+
warns when it is missing:
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
119
|
npm install @apliteni/apliteni-ui react react-dom
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
its tree.
|
|
122
|
+
Without them, importing `@apliteni/apliteni-ui/react` fails at build or runtime with
|
|
123
|
+
a module-not-found error for `react`. Plain HTML consumers can install the kit alone;
|
|
124
|
+
the other entry points are unaffected and do not bring React into the dependency tree.
|
|
126
125
|
|
|
127
126
|
```tsx
|
|
128
127
|
import '@apliteni/apliteni-ui/css'; // kit tokens + .ui-* classes
|
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# React components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tokens as the vanilla kit, so the two layers can't drift.
|
|
3
|
+
The kit's React layer supplies components for stateful surfaces: dashboards, tables,
|
|
4
|
+
filters, and forms. They use the vanilla kit's `.ui-*` classes and tokens.
|
|
6
5
|
|
|
7
6
|
This directory is a **private workspace**, not a package. It builds to `react/dist/`
|
|
8
7
|
and ships as the `@apliteni/apliteni-ui/react` subpath of the kit — one package, one
|
|
@@ -29,7 +28,7 @@ import '@apliteni/apliteni-ui/react/css'; // React components' shell styles (mo
|
|
|
29
28
|
import { DataTable, Modal, Button } from '@apliteni/apliteni-ui/react';
|
|
30
29
|
```
|
|
31
30
|
|
|
32
|
-
Components: `DataTable`, `Pagination`, `Modal`, `Drawer`, `CommandPalette`, `Button`, `Badge`, `Card`, `Icon`.
|
|
31
|
+
Components: `DataTable`, `Pagination`, `StatBand`, `Modal`, `Drawer`, `CommandPalette`, `Button`, `Badge`, `Card`, `Icon`.
|
|
33
32
|
|
|
34
33
|
`CommandPalette` renders the kit's `commandPalette()` markup, class for class, and imports the
|
|
35
34
|
kit's ranking rather than repeating it — so a palette a server rendered and the same palette
|
|
@@ -105,16 +104,15 @@ npm run storybook -w react # http://localhost:6007
|
|
|
105
104
|
npm run build # tsup -> react/dist/
|
|
106
105
|
```
|
|
107
106
|
|
|
108
|
-
6007 is
|
|
109
|
-
|
|
110
|
-
by following that drift — it probes 6007 through 6016 (the window Storybook's own
|
|
107
|
+
If port 6007 is occupied, Storybook tries higher ports until one is free. The root
|
|
108
|
+
Storybook composes these components by following that drift — it probes 6007 through 6016 (the window Storybook's own
|
|
111
109
|
port-finder searches) and takes the first one whose `index.json` lists every story
|
|
112
110
|
file this workspace has on disk. A stranger on the port fails that check and is
|
|
113
111
|
never shown under "React components"; the section is simply absent, and the root
|
|
114
112
|
Storybook's terminal says which ports it tried and what it found.
|
|
115
113
|
|
|
116
|
-
The probe runs once
|
|
117
|
-
|
|
114
|
+
The probe runs once when the root Storybook starts. If you start the React Storybook
|
|
115
|
+
later, restart the root Storybook to include it.
|
|
118
116
|
|
|
119
117
|
The bare `@apliteni/apliteni-ui` specifier in this source resolves to the kit itself
|
|
120
118
|
once installed. In the repo there is no copy to resolve to, so `kit-alias.ts` points
|
package/react/dist/index.css
CHANGED
|
@@ -17,6 +17,15 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/* ../src/styles/field-zoom.css */
|
|
21
|
+
@media (pointer: coarse) {
|
|
22
|
+
input:not(:where([type=button], [type=checkbox], [type=color], [type=file], [type=hidden], [type=image], [type=radio], [type=range], [type=reset], [type=submit])),
|
|
23
|
+
select,
|
|
24
|
+
textarea {
|
|
25
|
+
font-size: 16px !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
/* src/Modal.css */
|
|
21
30
|
.rx-scrim {
|
|
22
31
|
position: fixed;
|
|
@@ -34,10 +43,9 @@
|
|
|
34
43
|
}
|
|
35
44
|
.rx-modal {
|
|
36
45
|
width: min(480px, 92vw);
|
|
37
|
-
background: var(--
|
|
46
|
+
background: var(--bg-elevated);
|
|
38
47
|
border: 1px solid var(--border);
|
|
39
48
|
border-radius: var(--radius-xl);
|
|
40
|
-
box-shadow: var(--shadow-lg);
|
|
41
49
|
overflow: hidden;
|
|
42
50
|
transform: translateY(8px);
|
|
43
51
|
transition: transform var(--dur-med) var(--ease);
|
package/react/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,30 @@ declare function Card({ title, sub, level, children }: {
|
|
|
31
31
|
children?: ReactNode;
|
|
32
32
|
}): react.JSX.Element;
|
|
33
33
|
|
|
34
|
+
type StatTone = 'good' | 'bad' | 'neutral';
|
|
35
|
+
type StatVariant = 'band' | 'tiles' | 'open';
|
|
36
|
+
interface StatDelta {
|
|
37
|
+
value: string | null;
|
|
38
|
+
tone?: StatTone;
|
|
39
|
+
basis?: string;
|
|
40
|
+
direction?: 'up' | 'down' | 'flat';
|
|
41
|
+
none?: string;
|
|
42
|
+
}
|
|
43
|
+
interface StatFigure {
|
|
44
|
+
label: string;
|
|
45
|
+
value: ReactNode;
|
|
46
|
+
delta?: StatDelta;
|
|
47
|
+
trend?: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
interface StatBandProps {
|
|
50
|
+
stats: StatFigure[];
|
|
51
|
+
variant?: StatVariant;
|
|
52
|
+
basis?: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
id?: string;
|
|
55
|
+
}
|
|
56
|
+
declare function StatBand({ stats, variant, basis, label, id }: StatBandProps): react.JSX.Element;
|
|
57
|
+
|
|
34
58
|
type ModalProps = {
|
|
35
59
|
open: boolean;
|
|
36
60
|
title: string;
|
|
@@ -222,4 +246,4 @@ declare function Denied({ title, sub, need, icon, className, children, }: Denied
|
|
|
222
246
|
declare const PAGE_SIZES: readonly number[];
|
|
223
247
|
declare const DEFAULT_PAGE_SIZE: number;
|
|
224
248
|
|
|
225
|
-
export { Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, Denied, type DeniedProps, Drawer, type DrawerProps, Icon, Modal, type ModalProps, PAGE_SIZES, Pagination, type PaginationProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, type TableSort, sortTableRows };
|
|
249
|
+
export { Badge, BusyRegion, type BusyRegionProps, Button, type ButtonProps, Card, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, Denied, type DeniedProps, Drawer, type DrawerProps, Icon, Modal, type ModalProps, PAGE_SIZES, Pagination, type PaginationProps, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, type TableSort, sortTableRows };
|