@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 CHANGED
@@ -4,38 +4,37 @@
4
4
  [![license: MIT](https://img.shields.io/npm/l/@apliteni/apliteni-ui?color=3b9dff)](./LICENSE)
5
5
  [![live: ui.apli.tech](https://img.shields.io/badge/live-ui.apli.tech-9b5dff)](https://ui.apli.tech)
6
6
 
7
- The Apliteni design system & UI kit one source of UI for every product surface
8
- (the strategy deck, the text portal, `/account`, the operating model, and whatever
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
- Two layers over one set of design tokens: framework-agnostic **HTML + CSS**, and
12
- **React components** for stateful surfaces. Themeable dark and light with **accent
13
- sub-themes**. Showcased and reviewed in **Storybook**, and published on **ui.apli.tech**.
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
- - 🎨 **Live site + Storybook** → [ui.apli.tech](https://ui.apli.tech)
16
- - 📦 **Package** → [`@apliteni/apliteni-ui`](https://www.npmjs.com/package/@apliteni/apliteni-ui) (public npm)
17
- - ⚛️ **React components** → `@apliteni/apliteni-ui/react` — a subpath of the same package, source in [`react/`](./react)
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 core is HTML + CSS because the strategy portal (`apliteni/strategy`, `viz/`)
22
- server-renders HTML strings (`.mjs` modules), not a component framework. So the kit
23
- ships the same shape: token CSS + component CSS + tiny HTML-string factories. That
24
- makes it a *true* single source of truth — the portal imports it with no rewrite and
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 sits on top for surfaces that hold real client state dashboards, tables,
28
- filters, forms. Those components render the same `.ui-*` classes and the same tokens
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 — which component to reach for, the states it
35
- owes, how colour and wording work. They live in the **Guidelines** section of Storybook,
36
- which opens on
37
- [an overview of the five pages](https://ui.apli.tech/storybook/?path=/story/guidelines-overview--overview)
38
- and what the kit does and does not yet meet. Worth reading before you design a screen.
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
- Load only one of them and the other falls through to the system stack behind it, without
71
- saying so. Want the old
72
- single-family look back? Set both roles to the same family in your own stylesheet, after the
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
- **You install React yourself.** The kit declares no dependency on it — not a
115
- dependency, not a peer so npm will not warn you and will not pull it in. Bring your
116
- own `react` and `react-dom`, version 18 or newer:
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
- Miss them and the import of `@apliteni/apliteni-ui/react` fails at build or at
123
- runtime with a module-not-found error for `react`. Everything else in the kit is
124
- unaffected, so a plain HTML consumer installs the kit alone and never gets React in
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/react/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # React components
2
2
 
3
- Source for the kit's React layer for surfaces that hold real client state
4
- (dashboards, tables, filters, forms). They render the same `.ui-*` classes and
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 a request, not a promise: if something else already holds it, Storybook
109
- walks upward to the next free port. The root Storybook composes these components
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, while the root Storybook boots. Start this one afterwards and
117
- you have to restart the root Storybook before it appears.
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
@@ -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(--surface);
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);
@@ -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 };