@apliteni/apliteni-ui 0.142.1 → 0.142.4
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 -36
- package/guidelines/state-set.md +4 -4
- package/package.json +3 -3
- package/react/dist/index.css +7 -3
- package/react/dist/index.js +12 -5
- package/src/index.d.ts +13 -96
- package/src/index.js +17 -30
- package/src/styles/command-palette.css +9 -5
- package/src/styles/drawer.css +8 -0
- package/src/styles/dropdown.css +30 -8
- package/src/styles/feedback.css +1 -1
- package/src/styles/filter-bar.css +5 -2
- package/src/styles/input.css +14 -15
- package/src/styles/layout.css +5 -2
- package/src/styles/table.css +28 -2
- package/src/styles/tap-zone.css +9 -4
- package/src/styles/topbar.css +8 -6
- package/src/components/account-nav.js +0 -37
- package/src/components/avatar.js +0 -53
- package/src/components/back.js +0 -57
- package/src/components/button-busy.js +0 -69
- package/src/components/command-palette.js +0 -471
- package/src/components/confirm.js +0 -131
- package/src/components/drawer.js +0 -169
- package/src/components/dropdown.js +0 -1055
- package/src/components/feedback.js +0 -171
- package/src/components/filter-bar.js +0 -86
- package/src/components/footer.js +0 -102
- package/src/components/index.js +0 -352
- package/src/components/loading.js +0 -127
- package/src/components/nav.js +0 -220
- package/src/components/overlay.js +0 -263
- package/src/components/pagination.js +0 -323
- package/src/components/segmented.js +0 -33
- package/src/components/shell.js +0 -511
- package/src/components/stat.js +0 -82
- package/src/components/success.js +0 -131
- package/src/components/table-values.js +0 -32
- package/src/components/tabs.js +0 -82
- package/src/components/toasts.js +0 -118
- package/src/components/tooltip.js +0 -347
- package/src/components/topbar.js +0 -270
package/README.md
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://ui.apli.tech)
|
|
6
6
|
|
|
7
|
-
The Apliteni design system and UI kit provides shared design tokens, components,
|
|
8
|
-
UI rules for the strategy deck, the text portal, `/account` and future product
|
|
7
|
+
The Apliteni design system and UI kit provides shared design tokens, React components,
|
|
8
|
+
themes and UI rules for the strategy deck, the text portal, `/account` and future product
|
|
9
|
+
surfaces.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
The kit ships tokens, component CSS and React components together. Server-rendered pages
|
|
12
|
+
that do not use a component framework can still take the CSS, tokens and the inline
|
|
13
|
+
strings, or write the kit's `.ui-*` classes by hand. The helpers the root entry publishes —
|
|
14
|
+
`icon`, `prism`, `sun`, `moon`, `brand`, `esc`, `safeUrl` and the shared logic — serve
|
|
15
|
+
both.
|
|
15
16
|
|
|
16
17
|
Every component is in Storybook at **[ui.apli.tech](https://ui.apli.tech)**.
|
|
17
18
|
|
|
@@ -27,8 +28,7 @@ npm install @apliteni/apliteni-ui react react-dom
|
|
|
27
28
|
Install React and React DOM yourself, using version 18 or newer. The kit does not declare
|
|
28
29
|
either package as a regular or peer dependency. npm therefore does not install them or warn
|
|
29
30
|
when they are missing. If they are missing, importing `@apliteni/apliteni-ui/react` fails
|
|
30
|
-
at build time or runtime with a module-not-found error.
|
|
31
|
-
the kit and is unaffected because React is not added to its dependency tree.
|
|
31
|
+
at build time or runtime with a module-not-found error.
|
|
32
32
|
|
|
33
33
|
The React components are a subpath of this package, not a separate package. You get one
|
|
34
34
|
install, one version and one version pin.
|
|
@@ -36,7 +36,7 @@ install, one version and one version pin.
|
|
|
36
36
|
| Import | What it is |
|
|
37
37
|
| --- | --- |
|
|
38
38
|
| `@apliteni/apliteni-ui/css` | Tokens and every component stylesheet. Import once at the app root. |
|
|
39
|
-
| `@apliteni/apliteni-ui` | The
|
|
39
|
+
| `@apliteni/apliteni-ui` | The helpers and shared logic: `icon`, `prism`, `sun`, `moon`, `brand`, `esc`, `safeUrl`, motion and the dropdown, chart, pagination and filter helpers. |
|
|
40
40
|
| `@apliteni/apliteni-ui/react` | The React components, TypeScript types included. |
|
|
41
41
|
| `@apliteni/apliteni-ui/react/css` | Their shell styles. |
|
|
42
42
|
| `@apliteni/apliteni-ui/inline` | The same CSS as strings, for a server that inlines it. |
|
|
@@ -44,24 +44,16 @@ install, one version and one version pin.
|
|
|
44
44
|
|
|
45
45
|
## Use it
|
|
46
46
|
|
|
47
|
-
```js
|
|
48
|
-
import '@apliteni/apliteni-ui/css';
|
|
49
|
-
import { topbar, card, button, wireTopbar } from '@apliteni/apliteni-ui';
|
|
50
|
-
|
|
51
|
-
el.innerHTML = topbar({ word: 'Strategy', account: { name, email } })
|
|
52
|
-
+ card({ title: 'Appearance', body: button({ label: 'Save', variant: 'primary' }) });
|
|
53
|
-
wireTopbar(document); // theme toggle, menus, segmented controls, copy buttons
|
|
54
|
-
```
|
|
55
|
-
|
|
56
47
|
```tsx
|
|
57
48
|
import '@apliteni/apliteni-ui/css';
|
|
58
49
|
import '@apliteni/apliteni-ui/react/css';
|
|
59
|
-
import { DataTable, Modal } from '@apliteni/apliteni-ui/react';
|
|
50
|
+
import { AppShell, DataTable, Modal } from '@apliteni/apliteni-ui/react';
|
|
51
|
+
import { icon } from '@apliteni/apliteni-ui';
|
|
60
52
|
```
|
|
61
53
|
|
|
62
|
-
The `
|
|
63
|
-
|
|
64
|
-
[component catalog](docs/components.md#component-catalog) lists
|
|
54
|
+
The `AppShell` component provides the complete product layout: the rail, the page body and
|
|
55
|
+
a topbar over it when you ask for one, so no product rebuilds it. The
|
|
56
|
+
[component catalog](docs/components.md#component-catalog) lists it and every other component.
|
|
65
57
|
Account and personal settings belong in a modal over the product rather than on a page of
|
|
66
58
|
their own — see [Guidelines / Account and settings](guidelines/account-and-settings.md).
|
|
67
59
|
|
|
@@ -102,14 +94,10 @@ rule. If the host wants to follow the operating system preference, its JavaScrip
|
|
|
102
94
|
choose the theme and add the attribute. See
|
|
103
95
|
[an absent attribute means dark](docs/components.md#an-absent-attribute-means-dark).
|
|
104
96
|
|
|
105
|
-
You can change the settings at runtime with `applyTheme('light')` and
|
|
106
|
-
`applyAccent('phoenix')`. These functions save the choices to `localStorage`. You can also
|
|
107
|
-
use `accentPicker()`, which `wireTopbar()` connects.
|
|
108
|
-
|
|
109
97
|
## The rules
|
|
110
98
|
|
|
111
99
|
The **Guidelines** explain what a page may contain, which component to choose, which states
|
|
112
|
-
it must support, and how to handle colour and wording.
|
|
100
|
+
it must support, and how to handle colour and wording. The kit follows these rules.
|
|
113
101
|
The guidelines ship as Markdown in the package and are also available as a Storybook
|
|
114
102
|
section.
|
|
115
103
|
|
|
@@ -123,7 +111,7 @@ section.
|
|
|
123
111
|
| --- | --- |
|
|
124
112
|
| [foundations.md](docs/foundations.md) | The tokens and the floors: widths, breakpoints, spacing, type, colour, elevation, the focus ring, the tap floor. |
|
|
125
113
|
| [components.md](docs/components.md) | The package: what to import, theming, the component catalog, and what each component guarantees. |
|
|
126
|
-
| [react/README.md](react/README.md) | The React components
|
|
114
|
+
| [react/README.md](react/README.md) | The React components and their props. |
|
|
127
115
|
| [contributing.md](docs/contributing.md) | Working on the kit: the repository's layout, Storybook, the guidelines collection, the site, the changelog and releases. |
|
|
128
116
|
|
|
129
117
|
## Contribute
|
|
@@ -132,7 +120,7 @@ Use Node 20 or newer. Install [jq](https://jqlang.github.io/jq/), then run:
|
|
|
132
120
|
|
|
133
121
|
```bash
|
|
134
122
|
npm ci
|
|
135
|
-
npm run storybook
|
|
123
|
+
npm run storybook
|
|
136
124
|
npm test && npm test -w react && npm run build-storybook && node site/build.mjs
|
|
137
125
|
```
|
|
138
126
|
|
|
@@ -142,14 +130,14 @@ Add a general, composable kit component only when all three conditions are true:
|
|
|
142
130
|
names at least two products that use it or have requested it; existing components cannot
|
|
143
131
|
provide it without copying markup or logic; and it contains no domain-specific data or
|
|
144
132
|
rules. If any condition is missing, compose the UI from existing components and add a
|
|
145
|
-
Storybook showcase.
|
|
133
|
+
Storybook showcase.
|
|
146
134
|
|
|
147
135
|
To add a component, put its token-based CSS in `src/styles/`. Include that CSS in
|
|
148
|
-
`src/index.css` and in both the `styles` map and `cssText` in `src/inline.js`. Put the
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
`src/index.css` and in both the `styles` map and `cssText` in `src/inline.js`. Put the
|
|
137
|
+
React component in `react/src/`; each one needs a test and a story that use the shared
|
|
138
|
+
classes and tokens. Shared logic the React components take from the root entry lives in
|
|
139
|
+
`src/logic/` and is exported from `src/index.js`. The [guidelines](guidelines/overview.md)
|
|
140
|
+
define the design rules.
|
|
153
141
|
|
|
154
142
|
Open an issue, create a branch from `main`, and link the issue in your PR. If you change a
|
|
155
143
|
published file, including this README, bump the version in `package.json` and
|
package/guidelines/state-set.md
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
<!-- rule: focus-visible -->
|
|
6
6
|
|
|
7
|
-
**Rule:**
|
|
7
|
+
**Rule:** Show one ring when focus is visible, and make a focused field's border transparent.
|
|
8
8
|
|
|
9
9
|
**Why:** One solid band keeps focus consistent while the browser decides when to show it.
|
|
10
10
|
|
|
11
|
-
**Do:**
|
|
11
|
+
**Do:** Give buttons and fields the same ring, with one clear gap around each control.
|
|
12
12
|
|
|
13
|
-
**Don't:**
|
|
13
|
+
**Don't:** Leave a field border visible inside its focus ring.
|
|
14
14
|
|
|
15
|
-
**Except:** A
|
|
15
|
+
**Except:** A scroll region or a box that fills a table cell uses `--ring-scroll` with its offset. A panel or card uses `--ring`. A text field can match `:focus-visible` on mouse focus. Both rings are defined once at the root because an outline leaves its offset unpainted. Adjust width and colour there.
|
|
16
16
|
|
|
17
17
|
## Busy controls
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apliteni/apliteni-ui",
|
|
3
|
-
"version": "0.142.
|
|
3
|
+
"version": "0.142.4",
|
|
4
4
|
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"react"
|
|
7
7
|
],
|
|
8
|
-
"description": "Apliteni shared design system & UI kit — tokens, components and the deck theme
|
|
8
|
+
"description": "Apliteni shared design system & UI kit — tokens, React components and the deck theme.",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "Apliteni",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@storybook/addon-a11y": "^10.5.5",
|
|
71
|
-
"@storybook/
|
|
71
|
+
"@storybook/react-vite": "^10.6.1",
|
|
72
72
|
"axe-core": "^4.12.1",
|
|
73
73
|
"jsdom": "^30.0.1",
|
|
74
74
|
"storybook": "^10.5.5",
|
package/react/dist/index.css
CHANGED
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
137
137
|
}
|
|
138
138
|
.ui-datepicker__presets {
|
|
139
|
+
row-gap: var(--tap-gap-bordered) !important;
|
|
139
140
|
--tap-clear-x: var(--space-1, 4px);
|
|
140
141
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
141
142
|
}
|
|
@@ -246,9 +247,9 @@
|
|
|
246
247
|
.rx-modal__title {
|
|
247
248
|
margin: 0;
|
|
248
249
|
font-family: var(--font-sans);
|
|
249
|
-
font-weight: var(--weight-
|
|
250
|
+
font-weight: var(--weight-semibold);
|
|
250
251
|
font-size: var(--text-base);
|
|
251
|
-
color: var(--
|
|
252
|
+
color: var(--strong);
|
|
252
253
|
}
|
|
253
254
|
.rx-modal__body {
|
|
254
255
|
padding: var(--space-4);
|
|
@@ -1058,7 +1059,7 @@
|
|
|
1058
1059
|
display: flex;
|
|
1059
1060
|
flex: 0 1 auto;
|
|
1060
1061
|
min-width: 56px;
|
|
1061
|
-
max-width: min(90px, calc(100vw -
|
|
1062
|
+
max-width: min(90px, calc(100vw - 263px));
|
|
1062
1063
|
}
|
|
1063
1064
|
.ui-react-app__band-control > .ui-btn {
|
|
1064
1065
|
min-width: 0;
|
|
@@ -1066,6 +1067,9 @@
|
|
|
1066
1067
|
max-width: 100%;
|
|
1067
1068
|
}
|
|
1068
1069
|
.ui-react-app .ui-app__bar .toggle {
|
|
1070
|
+
margin-inline-start: 2px;
|
|
1071
|
+
}
|
|
1072
|
+
.ui-react-app .ui-app__bar:not(.ui-app__bar--phone) > .ui-app__menu + .ui-app__brand--band {
|
|
1069
1073
|
margin-inline-start: 1px;
|
|
1070
1074
|
}
|
|
1071
1075
|
.ui-react-app .ui-app__user--bar {
|
package/react/dist/index.js
CHANGED
|
@@ -3138,7 +3138,14 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3138
3138
|
}
|
|
3139
3139
|
}
|
|
3140
3140
|
const prior = focused.current;
|
|
3141
|
-
if (!prior || prior.id === null && filters.
|
|
3141
|
+
if (!prior || prior.id === null && filters.some((f) => !filterChipUnset(f))) return;
|
|
3142
|
+
const kept = filters.some((f) => f.id === prior.id);
|
|
3143
|
+
if (kept) {
|
|
3144
|
+
const held = chips.find((c) => c.dataset.filterId === prior.id && !c.disabled);
|
|
3145
|
+
const lost = prior.remove && !held?.querySelector("[data-filter-remove]") && !blocked && held && bar.current && bar.current.ownerDocument.activeElement === bar.current.ownerDocument.body && held.querySelector("[data-dropdown-trigger]");
|
|
3146
|
+
if (lost) lost.focus();
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3142
3149
|
const next = chips.slice(prior.index).find((chip) => !chip.disabled) || chips.slice(0, prior.index).reverse().find((chip) => !chip.disabled);
|
|
3143
3150
|
const target = !blocked && next?.querySelector("[data-dropdown-trigger]");
|
|
3144
3151
|
focused.current = null;
|
|
@@ -3165,8 +3172,8 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3165
3172
|
className: "ui-filter-bar__chip",
|
|
3166
3173
|
"data-filter-id": filter.id,
|
|
3167
3174
|
disabled: filter.disabled,
|
|
3168
|
-
onFocus: () => {
|
|
3169
|
-
focused.current = { id: filter.id, index };
|
|
3175
|
+
onFocus: (event) => {
|
|
3176
|
+
focused.current = { id: filter.id, index, remove: Boolean(event.target.closest("[data-filter-remove]")) };
|
|
3170
3177
|
},
|
|
3171
3178
|
children: [
|
|
3172
3179
|
/* @__PURE__ */ jsx26("legend", { className: "ui-filter-bar__legend", children: filter.label }),
|
|
@@ -3184,7 +3191,7 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3184
3191
|
}
|
|
3185
3192
|
}
|
|
3186
3193
|
),
|
|
3187
|
-
/* @__PURE__ */ jsx26(
|
|
3194
|
+
!filterChipUnset(filter) && /* @__PURE__ */ jsx26(
|
|
3188
3195
|
"button",
|
|
3189
3196
|
{
|
|
3190
3197
|
type: "button",
|
|
@@ -3224,7 +3231,7 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3224
3231
|
}
|
|
3225
3232
|
}
|
|
3226
3233
|
) }),
|
|
3227
|
-
filters.
|
|
3234
|
+
filters.some((filter) => !filterChipUnset(filter)) && /* @__PURE__ */ jsx26("span", { "data-filter-clear": "", onFocus: () => {
|
|
3228
3235
|
focused.current = { id: null, index: 0 };
|
|
3229
3236
|
}, children: /* @__PURE__ */ jsx26(Button, { size: "sm", variant: clearVariant, onClick: () => {
|
|
3230
3237
|
if (!blocked) onClear();
|
package/src/index.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
/** Watch tab content and width without changing the current route. Call the result on removal. */
|
|
2
2
|
export declare function observeNavFit(nav: HTMLElement): () => void;
|
|
3
3
|
export declare function esc(value: unknown): string;
|
|
4
|
-
/** The URL boundary every
|
|
4
|
+
/** The URL boundary every component sends a destination through. */
|
|
5
5
|
export declare function safeUrl(value: unknown, fallback?: string): string;
|
|
6
6
|
/** Scroll a tab row so its `aria-current` link is inside the viewport. */
|
|
7
7
|
export declare function revealCurrentNav(nav: HTMLElement): void;
|
|
8
8
|
/** Scroll a tab row so the link a focus event landed on clears the row's edge. */
|
|
9
9
|
export declare function revealFocusedNav(nav: HTMLElement, target: EventTarget | null): void;
|
|
10
|
-
|
|
11
|
-
export declare function input(opts?: Record<string, unknown>): string;
|
|
12
|
-
export declare function textarea(opts?: Record<string, unknown>): string;
|
|
13
|
-
export declare function select(opts?: Record<string, unknown>): string;
|
|
14
|
-
export declare function numericValue(opts?: Record<string, unknown>): string;
|
|
15
|
-
export declare function deltaValue(opts?: Record<string, unknown>): string;
|
|
16
|
-
export declare function filterBar(opts?: Record<string, unknown>): string;
|
|
17
|
-
export declare function initFilterBar(host: Element, opts?: Record<string, unknown>): { update: (opts: Record<string, unknown>) => void; destroy: () => void };
|
|
10
|
+
|
|
18
11
|
export declare function filterChipText(filter?: { label?: string; value?: string }): string;
|
|
19
12
|
export declare function filterChipName(filter?: { label?: string; value?: string }): string;
|
|
20
13
|
export declare function filterChipUnset(filter?: { value?: string }): boolean;
|
|
@@ -26,27 +19,19 @@ export declare function focusNextStop(host: Element | null | undefined): HTMLEle
|
|
|
26
19
|
* whose value is in no row marks nothing rather than leaving a `selected` the caller
|
|
27
20
|
* set standing. The caller's array and objects are not written to. */
|
|
28
21
|
export declare function filterChipItems<T>(filter?: { value?: string; items?: T[] }): T[];
|
|
22
|
+
|
|
29
23
|
export declare function segmentedNextIndex(key: string, index: number, length: number): number | null;
|
|
24
|
+
|
|
30
25
|
export declare function icon(name: string, className?: string): string;
|
|
31
|
-
|
|
32
|
-
export declare function button(opts?: Record<string, unknown>): string;
|
|
33
|
-
export declare function badge(label: string, variant?: string): string;
|
|
26
|
+
|
|
34
27
|
export declare const AVATAR_HUES: 8;
|
|
35
28
|
/** Which of the eight person hues a key gets: FNV-1a 32 bit over its UTF-8 bytes, modulo 8. */
|
|
36
29
|
export declare function avatarHue(key: unknown): number;
|
|
37
30
|
/** The first letter of the first word and of the last word, upper-cased; '' for no name. */
|
|
38
31
|
export declare function avatarInitials(name: unknown): string;
|
|
39
|
-
|
|
40
|
-
key?: string | number; name?: string | null; initials?: string; src?: string; size?: 24 | 32; empty?: boolean;
|
|
41
|
-
}): string;
|
|
32
|
+
|
|
42
33
|
export declare const calloutIcons: Record<'neutral' | 'info' | 'success' | 'warn' | 'danger', string>;
|
|
43
|
-
|
|
44
|
-
export declare function card(opts?: Record<string, unknown>): string;
|
|
45
|
-
export declare function pagination(opts?: Record<string, unknown>): string;
|
|
46
|
-
export declare function drawerSection(opts?: Record<string, unknown>): string;
|
|
47
|
-
export declare function drawer(opts?: Record<string, unknown>): string;
|
|
48
|
-
export declare function dropdown(opts?: Record<string, unknown>): string;
|
|
49
|
-
export declare function wireDropdown(root?: Document | Element): void;
|
|
34
|
+
|
|
50
35
|
/** The kit's own match, asked rather than re-implemented by <Dropdown>. */
|
|
51
36
|
export declare function dropdownMatch(label: unknown, query: unknown): boolean;
|
|
52
37
|
export declare function dropdownFiltering(query: unknown): boolean;
|
|
@@ -127,13 +112,12 @@ export declare function dropdownRest(
|
|
|
127
112
|
open: boolean,
|
|
128
113
|
wait?: number,
|
|
129
114
|
): () => void;
|
|
130
|
-
|
|
131
|
-
export declare function statBand(opts?: Record<string, unknown>): string;
|
|
132
|
-
export declare function commandPalette(opts?: Record<string, unknown>): string;
|
|
115
|
+
|
|
133
116
|
export declare function rankGroups<G>(groups: readonly G[], query: string): G[];
|
|
134
117
|
export declare function rankCommands<I>(items: readonly I[], query: string): I[];
|
|
135
118
|
export declare function scoreCommand(item: Record<string, unknown>, query: string): number;
|
|
136
119
|
export declare function paletteHotkey(platform?: string): string;
|
|
120
|
+
|
|
137
121
|
export declare const PAGE_SIZES: number[];
|
|
138
122
|
export declare const DEFAULT_PAGE_SIZE: number;
|
|
139
123
|
export type NumericValueOptions = { value?: string | number | null; unit?: string; missing?: string };
|
|
@@ -159,6 +143,7 @@ export declare function pointTarget(
|
|
|
159
143
|
point: { x: number; y: number }, limits: PointTargetLimits,
|
|
160
144
|
): ChartTarget;
|
|
161
145
|
export declare const SCORE: Record<'exact' | 'prefix' | 'wordStart' | 'contains' | 'keyword' | 'description' | 'subsequence', number>;
|
|
146
|
+
|
|
162
147
|
export declare const iconNames: string[];
|
|
163
148
|
export declare const iconCategories: { name: string; names: string[] }[];
|
|
164
149
|
export declare const iconOnlyAllowed: Record<string, string>;
|
|
@@ -173,89 +158,21 @@ export declare function illo(name: string): string;
|
|
|
173
158
|
export * from './motion.js';
|
|
174
159
|
export declare const illoNames: string[];
|
|
175
160
|
|
|
176
|
-
|
|
177
|
-
// with the topbar wiring that re-exports it.
|
|
161
|
+
/** The custom properties one accent swatch button carries. */
|
|
178
162
|
export declare function accentSwatchStyle(accent: string): Record<string, string>;
|
|
179
163
|
|
|
180
|
-
// Vanilla factories accept their existing option bags and return HTML.
|
|
181
|
-
export declare function accentPicker(opts?: Record<string, unknown>): string;
|
|
182
|
-
export declare function accountMenu(opts?: Record<string, unknown>): string;
|
|
183
|
-
export declare function appShell(opts?: Record<string, unknown>): string;
|
|
184
|
-
export declare function breadcrumbs(opts?: Record<string, unknown>): string;
|
|
185
|
-
export declare function busyRegion(opts?: Record<string, unknown>): string;
|
|
186
|
-
export declare function checkbox(opts?: Record<string, unknown>): string;
|
|
187
|
-
export declare function confirm(opts?: Record<string, unknown>): string;
|
|
188
|
-
export declare function deniedState(opts?: Record<string, unknown>): string;
|
|
189
|
-
export declare function emptyState(opts?: Record<string, unknown>): string;
|
|
190
|
-
export declare function feedbackWidget(opts?: Record<string, unknown>): string;
|
|
191
|
-
export declare function footer(opts?: Record<string, unknown>): string;
|
|
192
|
-
export declare function nav(opts?: Record<string, unknown>): string;
|
|
193
|
-
export declare function navTabs(opts?: Record<string, unknown>): string;
|
|
194
|
-
export declare function rowIdentity(opts?: Record<string, unknown>): string;
|
|
195
|
-
export declare function segmented(opts?: Record<string, unknown>): string;
|
|
196
|
-
export declare function sidebarNav(opts?: Record<string, unknown>): string;
|
|
197
|
-
export declare function skeleton(opts?: Record<string, unknown>): string;
|
|
198
|
-
export declare function skeletonTable(opts?: Record<string, unknown>): string;
|
|
199
|
-
export declare function success(opts?: Record<string, unknown>): string;
|
|
200
|
-
export declare function successPanel(opts?: Record<string, unknown>): string;
|
|
201
|
-
export declare function switchToggle(opts?: Record<string, unknown>): string;
|
|
202
|
-
export declare function tabs(opts?: Record<string, unknown>): string;
|
|
203
|
-
export declare function toast(opts?: Record<string, unknown>): string;
|
|
204
|
-
export declare function tooltip(opts?: Record<string, unknown>): string;
|
|
205
|
-
export declare function topbar(opts?: Record<string, unknown>): string;
|
|
206
|
-
export declare function commandPaletteList(groups?: readonly Record<string, unknown>[], opts?: { uid?: string; from?: number }): string;
|
|
207
|
-
export declare function deckTextSwitch(active?: string): string;
|
|
208
|
-
export declare function hlShell(raw: string): string;
|
|
209
164
|
/** Token class from styles/code.css, or null for the text between tokens. */
|
|
210
165
|
export type CodeTokenClass = 'c' | 'f' | 'k' | 's' | 'u';
|
|
211
166
|
export type CodeLanguage = 'shell' | 'json' | 'ts';
|
|
212
167
|
export declare const codeLanguages: readonly CodeLanguage[];
|
|
213
168
|
export declare function codeTokens(raw: string, lang?: CodeLanguage): { cls: CodeTokenClass | null; text: string }[];
|
|
214
169
|
export declare function hlCode(raw: string, lang?: CodeLanguage): string;
|
|
215
|
-
export declare function
|
|
216
|
-
|
|
217
|
-
export declare function successCheck(variant?: 'line' | 'circled'): string;
|
|
170
|
+
export declare function hlShell(raw: string): string;
|
|
171
|
+
|
|
218
172
|
export declare function themeIcon(theme: string): string;
|
|
219
|
-
export declare function themeName(theme: string): string;
|
|
220
|
-
export declare function themeToggle(theme?: string): string;
|
|
221
|
-
export declare function versionSwitcher(versions?: { label: string; meta?: string; badge?: string }[], activeIdx?: number): string;
|
|
222
173
|
|
|
223
174
|
// A tuple, so React can derive its Accent union from it.
|
|
224
175
|
export declare const ACCENTS: readonly ['default', 'phoenix', 'ocean', 'emerald'];
|
|
225
176
|
export declare const ACCOUNT_NAV: { id: string; icon: string; label: string }[];
|
|
226
|
-
export declare const RAIL_COOKIE: 'apliteni-ui-rail';
|
|
227
|
-
export declare const STAT_TONES: string[];
|
|
228
|
-
export declare const STAT_VARIANTS: string[];
|
|
229
177
|
|
|
230
|
-
export declare function applyAccent(name: string, root?: HTMLElement): void;
|
|
231
|
-
export declare function applyTheme(theme: string, root?: HTMLElement): void;
|
|
232
|
-
export declare function railCollapsed(cookies?: string): boolean | null;
|
|
233
|
-
export declare function closeCommandPalette(root: Element | null): void;
|
|
234
|
-
export declare function closeConfirm(root: Element | null): void;
|
|
235
|
-
export declare function closeDrawer(root: Element | null): void;
|
|
236
|
-
export declare function openCommandPalette(root: Element | null, returnFocusTo?: HTMLElement | null): void;
|
|
237
|
-
export declare function openConfirm(root: Element | null, returnFocusTo?: HTMLElement | null): void;
|
|
238
|
-
export declare function openDrawer(root: Element | null, returnFocusTo?: HTMLElement | null): void;
|
|
239
|
-
export declare function setPaletteResults(root: HTMLElement, groups: readonly Record<string, unknown>[]): void;
|
|
240
|
-
export declare function hideTooltip(host: HTMLElement): void;
|
|
241
|
-
export declare function showTooltip(host: HTMLElement, mark: Element): void;
|
|
242
|
-
export declare function initRowIdentity(root?: Document | Element): void;
|
|
243
|
-
export declare function initSegmented(root?: Document | Element): () => void;
|
|
244
|
-
export declare function initTabs(root?: Document | Element): void;
|
|
245
|
-
export declare function wireCommandPalette(root?: Document | Element): void;
|
|
246
|
-
export declare function wireConfirm(root?: Document | Element): void;
|
|
247
|
-
export declare function wireDrawer(root?: Document | Element): void;
|
|
248
|
-
export declare function wireFeedback(opts?: Record<string, unknown>): void;
|
|
249
|
-
export declare function wireNav(root?: Document | Element): void;
|
|
250
|
-
export declare function wireShell(root?: Document | Element, opts?: { persist?: boolean }): void;
|
|
251
|
-
export declare function wireTooltip(root?: Document | Element): void;
|
|
252
|
-
export declare function wireTopbar(root?: Document | Element): void;
|
|
253
|
-
export declare function wireSuccess(root: Element, opts?: { onDone?: () => void }): () => void;
|
|
254
|
-
export declare function wirePagination(root?: Document | Element | string | null, opts?: { onPage?: (page: number) => void; onPageSize?: (size: number) => void }): () => void;
|
|
255
178
|
export declare function nearestSection(node: Node | null, root?: Element | null): Element | null;
|
|
256
|
-
export declare function dismissToast(element: HTMLElement): void;
|
|
257
|
-
export declare function wireToastStack(container: Element | string | null): Element | null;
|
|
258
|
-
export declare function pushToast(container: Element | string | null, opts?: Record<string, unknown>): Element | null;
|
|
259
|
-
export declare function setBusy(root: Element | string | null, opts?: { busy?: boolean; message?: string; body?: string }): Element | null;
|
|
260
|
-
export declare function setButtonBusy(element: HTMLElement, opts?: { busy?: boolean }): void;
|
|
261
|
-
export declare function setPagerStatus(root: Element | string | null, text: string): Element | null;
|
package/src/index.js
CHANGED
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
// apliteni-ui — public entry.
|
|
2
2
|
// Styles ship separately: `import 'apliteni-ui/css'`.
|
|
3
|
-
export * from './components/index.js';
|
|
4
|
-
export * from './components/avatar.js';
|
|
5
|
-
export * from './components/dropdown.js';
|
|
6
|
-
export * from './components/tooltip.js';
|
|
7
|
-
export * from './components/tabs.js';
|
|
8
|
-
export * from './components/nav.js';
|
|
9
|
-
export * from './components/back.js';
|
|
10
|
-
export * from './components/drawer.js';
|
|
11
|
-
export * from './components/confirm.js';
|
|
12
|
-
export * from './components/command-palette.js';
|
|
13
|
-
export * from './components/topbar.js';
|
|
14
|
-
export * from './components/shell.js';
|
|
15
|
-
export * from './components/footer.js';
|
|
16
|
-
export * from './components/feedback.js';
|
|
17
|
-
export * from './components/toasts.js';
|
|
18
|
-
export * from './components/success.js';
|
|
19
|
-
export * from './components/loading.js';
|
|
20
|
-
export * from './components/pagination.js';
|
|
21
|
-
export * from './components/stat.js';
|
|
22
3
|
export * from './assets/icons.js';
|
|
23
4
|
export * from './assets/brand.js';
|
|
5
|
+
export * from './assets/illustrations.js';
|
|
24
6
|
export * from './motion.js';
|
|
25
|
-
export {
|
|
7
|
+
export { esc, safeUrl } from './html.js';
|
|
26
8
|
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
export {
|
|
9
|
+
export { ACCENTS, accentSwatchStyle } from './logic/accents.js';
|
|
10
|
+
export { ACCOUNT_NAV } from './logic/account-nav.js';
|
|
11
|
+
export { AVATAR_HUES, avatarHue, avatarInitials } from './logic/avatar.js';
|
|
12
|
+
export { calloutIcons } from './logic/callout.js';
|
|
13
|
+
export { CHART_FLOOR, chartScale, bridgeWalk, pointTarget } from './logic/chart.js';
|
|
14
|
+
export { codeLanguages, codeTokens, hlCode, hlShell } from './logic/code.js';
|
|
32
15
|
export { SCORE, rankGroups, rankCommands, scoreCommand, paletteHotkey } from './logic/command-palette.js';
|
|
33
|
-
export {
|
|
16
|
+
export { dropdownMatch, dropdownFiltering, dropdownAvail } from './logic/dropdown.js';
|
|
17
|
+
export {
|
|
18
|
+
DD_MENU_FLOOR, filterPanelRow, filterPanelFit, dropdownHeightFit, dropdownLift,
|
|
19
|
+
dropdownReveal, dropdownRest, dropdownSnap, dropdownViewportFit,
|
|
20
|
+
} from './logic/dropdown-placement.js';
|
|
21
|
+
export { nearestSection } from './logic/feedback.js';
|
|
34
22
|
export { filterChipText, filterChipName, filterChipUnset, filterChipItems, nextFocusStop, focusNextStop } from './logic/filter-bar.js';
|
|
23
|
+
export { observeNavFit, revealCurrentNav, revealFocusedNav } from './logic/nav.js';
|
|
35
24
|
export { PAGE_SIZES, DEFAULT_PAGE_SIZE } from './logic/pagination.js';
|
|
36
|
-
export {
|
|
25
|
+
export { segmentedNextIndex } from './logic/segmented.js';
|
|
37
26
|
export { formatNumericValue, formatDeltaValue } from './logic/table-values.js';
|
|
38
|
-
export {
|
|
39
|
-
export { observeNavFit, revealCurrentNav, revealFocusedNav } from './logic/nav.js';
|
|
40
|
-
export { CHART_FLOOR, chartScale, bridgeWalk, pointTarget } from './logic/chart.js';
|
|
27
|
+
export { themeIcon } from './logic/theme.js';
|
|
@@ -124,13 +124,17 @@
|
|
|
124
124
|
color: var(--text);
|
|
125
125
|
background: none;
|
|
126
126
|
border: 0;
|
|
127
|
-
/* The
|
|
128
|
-
outline: var(--ring) back, against base.css. It is the only tab stop in
|
|
129
|
-
the dialog and it holds focus from the frame it opens, so a ring would be
|
|
130
|
-
painted the whole time the palette is up and would mark nothing; the panel
|
|
131
|
-
already carries one, and the caret says where the typing goes. */
|
|
127
|
+
/* The ring goes on the search row, which is this field's box. */
|
|
132
128
|
outline: none;
|
|
133
129
|
}
|
|
130
|
+
/* The shared field ring, drawn inward because the panel clips. The divider goes
|
|
131
|
+
transparent under it, as a field's border does, so focus has one line.
|
|
132
|
+
why: docs/foundations.md#the-focus-ring */
|
|
133
|
+
.ui-cmdk__search:has(.ui-cmdk__input:focus-visible) {
|
|
134
|
+
border-bottom-color: transparent;
|
|
135
|
+
outline: var(--ring-scroll);
|
|
136
|
+
outline-offset: var(--ring-scroll-offset);
|
|
137
|
+
}
|
|
134
138
|
.ui-cmdk__input::placeholder { /* muted-ink: placeholder — empty command search */ color: var(--muted); }
|
|
135
139
|
|
|
136
140
|
/* -- The list ------------------------------------------------------------- */
|
package/src/styles/drawer.css
CHANGED
|
@@ -232,6 +232,14 @@
|
|
|
232
232
|
padding-block: var(--space-1);
|
|
233
233
|
overflow-wrap: anywhere;
|
|
234
234
|
}
|
|
235
|
+
/* A control in the value column has its own border and padding, so its first line sits lower
|
|
236
|
+
than a label's. A row whose value holds a field or a dropdown lines both first lines up on
|
|
237
|
+
their baseline, whatever the control is, and a row of text keeps its place. At 560px and
|
|
238
|
+
below the label stacks over the value and there is nothing to align. A field's own label
|
|
239
|
+
stays for a screen reader only when one field fills the value cell. With two
|
|
240
|
+
fields, each label remains visible to name its control. */
|
|
241
|
+
.ui-drawer__row:has(> dd :is(.ui-input, .ui-textarea, .ui-select, .ui-dropdown)) > :is(dt, dd) { align-self: baseline; }
|
|
242
|
+
.ui-drawer__row > dd:has(> .ui-field:only-child) > .ui-field > .ui-field__label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
235
243
|
.ui-drawer__row dt { color: var(--text); }
|
|
236
244
|
.ui-drawer__row dd { color: var(--text); font-variant-numeric: tabular-nums; }
|
|
237
245
|
.ui-drawer .ui-drawer__rows + *,
|
package/src/styles/dropdown.css
CHANGED
|
@@ -83,14 +83,20 @@
|
|
|
83
83
|
--caret-ink: 1.6px;
|
|
84
84
|
--caret-off: calc((var(--caret) - var(--caret-ink)) / 2.8284); /* 2√2 — the 45° turn's projection */
|
|
85
85
|
width: var(--caret); height: var(--caret);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/* Two gradient strips, not borders: Chromium rounds a border to whole device pixels,
|
|
87
|
+
so a 1.6px border painted 1.03px of ink, where the select's SVG stroke paints 1.58px. */
|
|
88
|
+
background:
|
|
89
|
+
linear-gradient(var(--muted), var(--muted)) right / var(--caret-ink) 100% no-repeat,
|
|
90
|
+
linear-gradient(var(--muted), var(--muted)) bottom / 100% var(--caret-ink) no-repeat;
|
|
88
91
|
/* Shift BEFORE rotate, so it lands in page space rather than on the turned axis. */
|
|
89
92
|
transform: translateY(calc(var(--caret-off) * -1)) rotate(45deg);
|
|
90
93
|
transition: transform var(--dur-fast) var(--ease);
|
|
91
94
|
flex: none;
|
|
92
95
|
}
|
|
93
96
|
.ui-dropdown.open .ui-dropdown__chevron { transform: translateY(var(--caret-off)) rotate(-135deg); }
|
|
97
|
+
@media (forced-colors: active) {
|
|
98
|
+
.ui-dropdown__chevron { background: none; border-right: var(--caret-ink) solid ButtonText; border-bottom: var(--caret-ink) solid ButtonText; }
|
|
99
|
+
}
|
|
94
100
|
|
|
95
101
|
/* Panel — the popover surface */
|
|
96
102
|
.ui-dropdown__panel {
|
|
@@ -210,6 +216,12 @@
|
|
|
210
216
|
at the room the viewport left either way. #489 */
|
|
211
217
|
.ui-dropdown__panel.is-scroll { --ui-dropdown-cap: var(--ui-dropdown-max); }
|
|
212
218
|
|
|
219
|
+
/* On a phone, the panel keeps the page's 16px margin at the shell fold.
|
|
220
|
+
why: docs/components.md#the-dropdown-panel */
|
|
221
|
+
@media (max-width: 720px) {
|
|
222
|
+
.ui-dropdown__panel { --ui-dropdown-edge: var(--space-4); }
|
|
223
|
+
}
|
|
224
|
+
|
|
213
225
|
/* The wiring adds this where the room is below the floor: even spending the whole
|
|
214
226
|
edge inset, there is no usable height. The panel keeps its cap — it is never
|
|
215
227
|
taller than 300px — and scrolls inside it. Its room runs past the fold, so the
|
|
@@ -316,12 +328,22 @@
|
|
|
316
328
|
color: var(--text);
|
|
317
329
|
transition: background var(--dur-fast) var(--ease);
|
|
318
330
|
}
|
|
319
|
-
/*
|
|
320
|
-
|
|
321
|
-
comes later — which is one indicator rather than two.
|
|
331
|
+
/* Hover is a fill and an outline means focus, so a hovered row draws no edge. A row that is
|
|
332
|
+
hovered AND focused draws the ring over the fill.
|
|
322
333
|
why: docs/foundations.md#elevation */
|
|
323
|
-
.ui-dropdown__item:hover {
|
|
324
|
-
|
|
334
|
+
.ui-dropdown__item:hover { background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
|
|
335
|
+
/* Light only: the panel is --bg-elevated, which --surface matches exactly there, so the
|
|
336
|
+
hover fill above changed nothing. --surface-3 is the quiet fill the drawer's close mark
|
|
337
|
+
takes on hover, one step under the --surface-2 that .is-active takes below.
|
|
338
|
+
why: docs/foundations.md#elevation */
|
|
339
|
+
:where(:root[data-theme="light"]) .ui-dropdown__item:hover { background: var(--surface-3); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
|
|
340
|
+
@media (forced-colors: active) {
|
|
341
|
+
.ui-dropdown__item:hover { border: 1px solid Highlight; padding: 8px 11px; }
|
|
342
|
+
}
|
|
343
|
+
/* The row draws its ring inward, so a row scrolled flush with the list's edge cannot have it
|
|
344
|
+
clipped and the list scrolls as it did.
|
|
345
|
+
why: docs/foundations.md#the-focus-ring */
|
|
346
|
+
.ui-dropdown__item:focus-visible { background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ outline: var(--ring-scroll); outline-offset: var(--ring-scroll-offset); }
|
|
325
347
|
.ui-dropdown__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
326
348
|
.ui-dropdown__label { font-family: var(--font-sans); font-size: calc(var(--text-sm) - 0.5px); color: var(--strong); font-weight: 600; letter-spacing: 0.01em; }
|
|
327
349
|
.ui-dropdown__desc { font-size: var(--text-xs); color: var(--text); line-height: 1.35; }
|
|
@@ -444,7 +466,7 @@
|
|
|
444
466
|
|
|
445
467
|
.ui-dropdown__search-input::placeholder { /* muted-ink: placeholder — empty search field */ color: var(--muted); }
|
|
446
468
|
.ui-dropdown__search-input:hover { border-color: var(--field-edge-hover); }
|
|
447
|
-
.ui-dropdown__search-input:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
469
|
+
.ui-dropdown__search-input:focus-visible { border-color: transparent; outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
448
470
|
|
|
449
471
|
/* The rows' own cap, read from the same property the panel reads: the `scroll`
|
|
450
472
|
option lands on the list when there is a field above it. #489 */
|
package/src/styles/feedback.css
CHANGED
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
|
|
132
132
|
/* Error banner */
|
|
133
133
|
.ui-fbc__err { margin: 14px 20px 0; background: color-mix(in srgb, var(--pink) 14%, transparent); /* code-bg: inherit — text-only validation message has no nested focus target. */ color: var(--chip-danger-ink); font-size: var(--text-sm); padding: 11px 15px; border-radius: 11px; display: none; }
|
|
134
|
-
.ui-fbc__err.show { display: block; }
|
|
134
|
+
.ui-fbc__err.show { display: block; /* motion: still — the React Feedback renders the error already shown; its fade is the is-entering animation beside it. */ }
|
|
135
135
|
/* A failed send's line fades in; wireFeedback() adds the class as it shows it. */
|
|
136
136
|
.ui-fbc__err.is-entering { animation: m-fade var(--dur-fast) var(--ease-out) both; }
|
|
137
137
|
|