@zeyos/zx 3.0.0 → 4.1.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/CHANGELOG.md +95 -0
- package/DESIGN-SYSTEM.md +87 -71
- package/README.md +16 -37
- package/dist/types/components/app-icon/app-icon.d.ts +88 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +106 -32
- package/dist/types/components/card/card.d.ts +128 -0
- package/dist/types/components/chart/chart.d.ts +1 -0
- package/dist/types/components/filter/filter-model.d.ts +87 -0
- package/dist/types/components/filter/filter.d.ts +331 -0
- package/dist/types/components/launcher/launcher.d.ts +65 -6
- package/dist/types/components/select/select.d.ts +97 -4
- package/dist/types/components/table/table.d.ts +107 -3
- package/dist/types/components/tag-picker/tag-picker.d.ts +16 -0
- package/dist/types/core/dom.d.ts +9 -1
- package/dist/types/core/util.d.ts +9 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/{components/app-rail → internal}/app-rail.d.ts +34 -19
- package/dist/types/zeyos/icons.d.ts +24 -2
- package/dist/types/zeyos/index.d.ts +3 -2
- package/dist/types/zeyos/launcher.d.ts +147 -0
- package/dist/types/zeyos/select.d.ts +41 -0
- package/dist/zx-zeyos.esm.js +2018 -113
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +815 -16
- package/dist/zx.esm.js +2661 -338
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +2661 -338
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +602 -110
- package/docs/llms.md +181 -123
- package/docs/llms.txt +24 -21
- package/package.json +8 -17
- package/src/components/app-icon/app-icon.css +105 -0
- package/src/components/app-icon/app-icon.js +134 -0
- package/src/components/app-sidebar/app-sidebar.css +12 -0
- package/src/components/app-sidebar/app-sidebar.js +310 -110
- package/src/components/card/card.css +149 -0
- package/src/components/card/card.js +285 -0
- package/src/components/chart/chart.js +8 -3
- package/src/components/filter/filter-model.js +226 -0
- package/src/components/filter/filter.css +147 -0
- package/src/components/filter/filter.js +554 -0
- package/src/components/grid/grid.css +1 -1
- package/src/components/grid/grid.js +14 -4
- package/src/components/launcher/launcher.css +113 -3
- package/src/components/launcher/launcher.js +234 -26
- package/src/components/message/message.css +36 -3
- package/src/components/select/field-adapter.js +9 -4
- package/src/components/select/select.css +161 -10
- package/src/components/select/select.js +361 -48
- package/src/components/table/table.css +85 -0
- package/src/components/table/table.js +426 -31
- package/src/components/tag-picker/tag-picker.css +19 -0
- package/src/components/tag-picker/tag-picker.js +42 -5
- package/src/core/dom.js +21 -1
- package/src/core/util.js +20 -0
- package/src/index.js +9 -2
- package/src/{components/app-rail → internal}/app-rail.js +80 -30
- package/src/zeyos/icons.js +38 -20
- package/src/zeyos/index.js +8 -2
- package/src/zeyos/launcher.js +338 -0
- package/src/zeyos/modules.js +1 -0
- package/src/zeyos/select.js +116 -1
- package/styles/tokens/global.css +1 -1
- package/styles/tokens/modules.css +1 -0
- package/styles/tokens/semantic.css +9 -0
- package/styles/tokens/themes.css +2 -2
- package/styles/zx.css +3 -0
- package/MIGRATION.md +0 -749
- package/dist/types/compat/base.d.ts +0 -156
- package/dist/types/compat/globals.d.ts +0 -20
- package/dist/types/compat/index.d.ts +0 -128
- package/dist/types/compat/map/basic.d.ts +0 -175
- package/dist/types/compat/map/data.d.ts +0 -103
- package/dist/types/compat/map/date-time.d.ts +0 -80
- package/dist/types/compat/map/factory.d.ts +0 -9
- package/dist/types/compat/map/form.d.ts +0 -98
- package/dist/types/compat/map/helpers.d.ts +0 -12
- package/dist/types/compat/map/http.d.ts +0 -36
- package/dist/types/compat/map/layout.d.ts +0 -106
- package/dist/types/compat/map/options.d.ts +0 -80
- package/dist/types/compat/map/select.d.ts +0 -95
- package/dist/types/compat/map/stubs.d.ts +0 -32
- package/dist/types/compat/map/utilities.d.ts +0 -37
- package/dist/types/compat-entry.d.ts +0 -5
- package/dist/zx-compat.esm.js +0 -17848
- package/dist/zx-compat.esm.min.js +0 -1
- package/dist/zx-compat.global.js +0 -29008
- package/dist/zx-compat.global.min.js +0 -3
- package/src/compat/base.js +0 -291
- package/src/compat/globals.js +0 -167
- package/src/compat/index.js +0 -84
- package/src/compat/map/basic.js +0 -464
- package/src/compat/map/data.js +0 -254
- package/src/compat/map/date-time.js +0 -177
- package/src/compat/map/factory.js +0 -45
- package/src/compat/map/form.js +0 -330
- package/src/compat/map/helpers.js +0 -46
- package/src/compat/map/http.js +0 -117
- package/src/compat/map/layout.js +0 -256
- package/src/compat/map/options.js +0 -267
- package/src/compat/map/select.js +0 -198
- package/src/compat/map/stubs.js +0 -26
- package/src/compat/map/utilities.js +0 -113
- package/src/compat-entry.js +0 -11
package/docs/llms.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Xenon Design System (Zx) — agent reference
|
|
2
2
|
|
|
3
|
-
> Xenon is
|
|
3
|
+
> Xenon is a dependency-free design system for browser applications; Zx is its product-agnostic
|
|
4
4
|
> vanilla-JavaScript implementation. ES2022 modules, WAI-ARIA-accessible native controls, semantic `--zx-*` design
|
|
5
5
|
> tokens (light/dark + cozy/compact), and lifecycle-safe components. Zero runtime dependencies.
|
|
6
6
|
> This file is the single, complete reference a coding agent needs to build UI with Zx; each
|
|
@@ -73,6 +73,11 @@ renders every component family live and exports the CSS):
|
|
|
73
73
|
Keep the 600 stop at 4.5:1 or better against white and the 400 stop at 4.5:1 against the dark page
|
|
74
74
|
— that is what makes `--zx-color-on-accent` legible without being restated per theme.
|
|
75
75
|
|
|
76
|
+
The theme studio treats those stable IDs as complete recipes: selecting a preset also changes its
|
|
77
|
+
density, neutral tint, radius, control height, base text size, font stack, and material strength.
|
|
78
|
+
Its **Material** control is CSS-first (`Flat`, `Glass`, or `Deep glass`); only the deep setting uses
|
|
79
|
+
backdrop blur, and components fall back to solid surfaces under reduced-transparency preferences.
|
|
80
|
+
|
|
76
81
|
Define a product theme by overriding **semantic** tokens under a `[data-zx-theme="name"]` selector:
|
|
77
82
|
`--zx-color-bg-page/surface/raised/control/hover/selected`, `--zx-color-border(-strong/-control)`,
|
|
78
83
|
`--zx-color-text(-muted/-placeholder)`, `--zx-color-accent(-hover)/on-accent`,
|
|
@@ -85,8 +90,8 @@ override that works (global token → then, if needed, a component style).
|
|
|
85
90
|
|
|
86
91
|
For ZeyOS business data use the **dedicated client library** `@zeyos/client`
|
|
87
92
|
(`npm install @zeyos/client`) — a zero-dependency, typed OpenAPI client (accounts,
|
|
88
|
-
transactions/invoices, tickets, 50+ resources), OAuth2/session auth, retries, schema
|
|
89
|
-
introspection.
|
|
93
|
+
transactions/invoices, tickets, 50+ resources), OAuth2/session auth, retries, and schema
|
|
94
|
+
introspection. Zx accepts the client by injection and does not bundle it.
|
|
90
95
|
|
|
91
96
|
```js
|
|
92
97
|
import { createZeyosClient, MemoryTokenStore, normalizeListResult } from '@zeyos/client';
|
|
@@ -207,16 +212,6 @@ reflection and ElementInternals form association: `<zx-toggle>`, `<zx-check-butt
|
|
|
207
212
|
`<zx-checklist>`, `<zx-datebox>`, `<zx-timebox>`, `<zx-search>`, `<zx-groupbox>`, `<zx-tabbox>`,
|
|
208
213
|
`<zx-table>`, `<zx-dialog>`.
|
|
209
214
|
|
|
210
|
-
## gx compatibility
|
|
211
|
-
|
|
212
|
-
Load `zx-compat.global.js` (or import `zx-compat.esm.js`) →
|
|
213
|
-
`window.gx.{core,ui,util,zeyos,bootstrap}` wrapping Zx components (constructor/option/event-name
|
|
214
|
-
translation, MooTools-style `addEvent`). `gx.compat.installGlobals()` (opt-in) installs its gx
|
|
215
|
-
`__()` parser only when that name is free, plus `_()`, `String.htmlSpecialChars`, and the element
|
|
216
|
-
`store/retrieve` shim. Full namespace listing in
|
|
217
|
-
the "gx compatibility layer" component section below; class map and unsupported legacy APIs in
|
|
218
|
-
`MIGRATION.md`.
|
|
219
|
-
|
|
220
215
|
## Conventions (editing component source)
|
|
221
216
|
|
|
222
217
|
Follow `AGENTS.md`. Key rules: never declare instance class fields for state used in `render()`
|
|
@@ -229,14 +224,13 @@ pattern with `:focus-visible` rings and `prefers-reduced-motion` guards.
|
|
|
229
224
|
|
|
230
225
|
```
|
|
231
226
|
src/components/<name>/ component + CSS src/core/ kernel (component, dom, http, i18n, date…)
|
|
232
|
-
src/compat/ gx compat layer styles/ tokens + base.css
|
|
233
227
|
website/ marketing page + docs.html (docs.js) specs/ per-component specs
|
|
234
228
|
website/demos/ per-component demo modules website/layouts/ application layout examples
|
|
235
229
|
tests/ node unit + smoke dist/ built bundles
|
|
236
230
|
|
|
237
231
|
npm run serve # http://127.0.0.1:8321/website/docs.html (no build)
|
|
238
232
|
npm test # node --test tests/unit/*.test.js + node tests/lint-tokens.js
|
|
239
|
-
npm run build # dist/:
|
|
233
|
+
npm run build # dist/: ESM, global, ZeyOS binding, and CSS assets
|
|
240
234
|
node tools/build-module-tokens.js # regenerate styles/tokens/modules.css from src/zeyos/modules.js
|
|
241
235
|
```
|
|
242
236
|
|
|
@@ -428,14 +422,16 @@ permissions, recent-history/cache policy, and the route or command ultimately in
|
|
|
428
422
|
|
|
429
423
|
- **Constructor** — `new Launcher(null, options)` owns a body-level dialog;
|
|
430
424
|
`new Launcher(existingDialog, options)` enhances and later restores an existing `<dialog>`.
|
|
431
|
-
- **Options** — `items`, abortable `sources: [{id, label?, minQuery?, load(query, {signal})}]`,
|
|
425
|
+
- **Options** — `items`, abortable `sources: [{id, label?, minQuery?, when?, order?, load(query, {signal})}]`,
|
|
432
426
|
`query`, `debounce: 250`, `minQuery: 0`, `maxResults: 100`, `placeholder`, `label`, `emptyText`,
|
|
433
|
-
`loadingText`,
|
|
427
|
+
`loadingText`, `shortcut: 'mod+k'|false`, and visible `hints` labels (or `false`).
|
|
434
428
|
- **Items** — `{id, label, description?, keywords?, group?, icon?, badge?, value?, href?, target?,
|
|
435
|
-
invoke?, pinned?, disabled
|
|
436
|
-
|
|
429
|
+
invoke?, pinned?, disabled?, kind?, current?, when?, groupOrder?, itemOrder?}`. `icon` accepts a
|
|
430
|
+
bundled icon name, Node, or factory. Links stay native so modified and middle clicks work;
|
|
431
|
+
non-link commands may provide an application-owned `invoke` callback. Malformed and executable
|
|
432
|
+
URL schemes are stripped; a descriptor with no safe link or callback is disabled.
|
|
437
433
|
- **Methods** — `open()`, `close()`, `toggle()`, `isOpen()`, `focus()`, `setQuery()`, `getQuery()`,
|
|
438
|
-
`setItems()`, `setSources()`, `destroy()`.
|
|
434
|
+
`setItems()`, `setCurrent()`, `setSources()`, `destroy()`.
|
|
439
435
|
- **Events** — cancelable `select {item, value, source, query}`, `query {query}`, `open`, `close`,
|
|
440
436
|
and `error {source, error}`. Preventing `select` suppresses the supplied link or callback.
|
|
441
437
|
- **Ranking** — local results are case/diacritic-insensitive and deterministic: exact label,
|
|
@@ -443,8 +439,39 @@ permissions, recent-history/cache policy, and the route or command ultimately in
|
|
|
443
439
|
items retain an explicit order ahead of otherwise equal results. A new async query aborts and
|
|
444
440
|
ignores stale source work.
|
|
445
441
|
- **Keyboard** — Cmd+K on macOS or Ctrl+K elsewhere opens by default; the shortcut is ignored in
|
|
446
|
-
editable controls, composition, and modal contexts.
|
|
447
|
-
|
|
442
|
+
editable controls, composition, and modal contexts. Application tiles use spatial arrow-key
|
|
443
|
+
movement; Up/Down may continue into record groups. Home/End, Page Up/Down, and Enter operate the
|
|
444
|
+
single listbox selection model; Escape closes and restores focus. `aria-current` marks the
|
|
445
|
+
active destination independently from the keyboard's `aria-selected` option.
|
|
446
|
+
- **Optional ZeyOS adapter** — import `zeyosLauncher()` or `buildZeyosLauncherConfig()` from
|
|
447
|
+
`@zeyos/zx/zeyos`. The adapter receives the permitted module/menu catalogue, pins, current
|
|
448
|
+
identifier, recent loader or cache, abortable search, destination resolvers, and application/
|
|
449
|
+
record icon renderers explicitly. It maps the complete shell payload without reading globals or
|
|
450
|
+
taking over application routing.
|
|
451
|
+
<!-- /doc -->
|
|
452
|
+
|
|
453
|
+
<!-- doc:app-icon -->
|
|
454
|
+
### AppIcon — application identity
|
|
455
|
+
|
|
456
|
+
A fixed-size, product-agnostic application tile. It keeps glyph geometry stable in launchers,
|
|
457
|
+
sidebars, entity results, and recent-item rows while identity colour and material remain explicit
|
|
458
|
+
options rather than application globals.
|
|
459
|
+
|
|
460
|
+
- **Options** — `icon` (bundled name, Node, or lazy renderer), `color`, `size: 36`,
|
|
461
|
+
`iconSize: '52%'`, `label`, `badge`, `selected: false`, `glass: false|'subtle'|'strong'`, and
|
|
462
|
+
additional `class` names.
|
|
463
|
+
- **Methods** — `set(partialOptions)` updates the existing root; `destroy()` restores an enhanced
|
|
464
|
+
target. `appIcon(options)` is the element-returning convenience factory.
|
|
465
|
+
- **ZeyOS preset** — import `zeyosAppIcon(module, options)` from `@zeyos/zx/zeyos`. Every current
|
|
466
|
+
ZeyOS application/module has a canonical colour and icon mapping in `src/zeyos/modules.js`;
|
|
467
|
+
entity names and aliases resolve through the same catalogue. `moduleChip()` is the compatible
|
|
468
|
+
alias. An application may call `useZeyosIcons()` for the existing custom glyph kit or inject an
|
|
469
|
+
offline `icon` override; Zx never loads a network asset automatically.
|
|
470
|
+
- **Material** — subtle glass is a CSS border/highlight treatment; strong glass progressively adds
|
|
471
|
+
`backdrop-filter`. `prefers-reduced-transparency` and browsers without support receive a solid
|
|
472
|
+
tile. The glyph and label semantics do not depend on the visual treatment.
|
|
473
|
+
- **Accessibility** — a non-empty `label` gives the root `role="img"`; otherwise it is decorative.
|
|
474
|
+
The badge is visual supplementary status, so include its meaning in `label` when it matters.
|
|
448
475
|
<!-- /doc -->
|
|
449
476
|
|
|
450
477
|
<!-- doc:avatar -->
|
|
@@ -485,26 +512,34 @@ out, or mutates the session.
|
|
|
485
512
|
|
|
486
513
|
Unifies single-select, local filtering, and async loading.
|
|
487
514
|
|
|
488
|
-
- **Options** — `items: []`, `fixedItems: []`, `valueKey: 'ID'` (string key or `(item)=>id`),
|
|
489
|
-
`labelKey: 'name'` (string or `(item)=>string`), `renderItem`, `renderValue`,
|
|
490
|
-
`
|
|
491
|
-
`
|
|
515
|
+
- **Options** — `items: []`, `fixedItems: []`, optional `fixedLabel`, `valueKey: 'ID'` (string key or `(item)=>id`),
|
|
516
|
+
`labelKey: 'name'` (string or `(item)=>string`), `renderItem`, `renderValue`,
|
|
517
|
+
`renderValueAdornment`, `renderNone`, `noneLabel`, `actions`, `value`, `disabled`, `placeholder`,
|
|
518
|
+
`clearable: false`, `filter: false | 'local' | async (query)=>items`, `searchKeys`,
|
|
519
|
+
`minQuery: 0`, `debounce: 200`, `listHeight: 280`, `groupKey`.
|
|
492
520
|
- **Getters** — `.value`, `.selected`.
|
|
493
|
-
- **Methods** — `set(id, {silent})`, `setItems()`, `setFixedItems()`, `
|
|
494
|
-
`enable()`/`disable()`, `focus()`.
|
|
495
|
-
- **Events** — `change {value, item}` (`item` is null on clear),
|
|
496
|
-
`loaded {items}`.
|
|
521
|
+
- **Methods** — `set(id, {silent})`, `setItems()`, `setFixedItems()`, `setActions()`, `reset()`,
|
|
522
|
+
`open()`/`close()`, `enable()`/`disable()`, `focus()`.
|
|
523
|
+
- **Events** — `change {value, item}` (`item` is null on clear), preventable
|
|
524
|
+
`action {id, action, query, select}`, `open`, `close`, `query {query}`, `loaded {items}`.
|
|
497
525
|
- **Fixed choices** — `fixedItems` pins entries to the top of the list, separated by a rule (the
|
|
498
526
|
rule is dropped when `groupKey` is on, since a heading already divides them). They belong to the
|
|
499
527
|
control, not to its data: a `filter` function replaces `items` on every query, while the pinned
|
|
500
528
|
entries are narrowed locally against the same query and stay resolvable by `set()`. They survive
|
|
501
529
|
`setItems()` and are shown below `minQuery`. Use them for choices with no row in the source —
|
|
502
530
|
"Unassigned", "Everyone", "Private".
|
|
503
|
-
- **Presets** — `Select.priority(target, opts)
|
|
504
|
-
`Select.
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
`
|
|
531
|
+
- **Presets** — `Select.priority(target, opts)` renders the five-level, five-square ZeyOS priority
|
|
532
|
+
scale; `Select.status(target, opts)` supplies shape- and semantic-color-distinct workflow states
|
|
533
|
+
and accepts replacement `items`; `Select.permission(target, {groups, value})` pins Private and
|
|
534
|
+
Public above record-access groups. Its value is the tri-state ZeyOS stores (`false` private,
|
|
535
|
+
`true` public, or a group ID), and `groups` takes an array or loader `(query)=>items`.
|
|
536
|
+
- **Entity preset** — `Select.entity(target, options)` renders icon/color, label, and secondary
|
|
537
|
+
text using `iconKey`, `colorKey`, and `subtitleKey` (or `renderIcon`). `recent` pins a deduplicated
|
|
538
|
+
**Recent** section above ordinary/local/async results; `create: true|actionDescriptor` appends an
|
|
539
|
+
application-owned command at the bottom without changing the selected ID. `recentLabel` and the
|
|
540
|
+
ordinary Select options remain overridable. For schema-driven ZeyOS loading,
|
|
541
|
+
`zeyosEntitySelect(client, resource, options)` and `buildZeyosEntitySelectConfig()` compose this
|
|
542
|
+
preset from `@zeyos/zx/zeyos`; the core preset itself is backend-neutral.
|
|
508
543
|
- **Keyboard** (APG combobox) — ArrowDown/Alt+ArrowDown open; arrows navigate and wrap; Home/End;
|
|
509
544
|
Enter selects; Esc closes; Tab closes; printable characters filter (editable) or run a typeahead
|
|
510
545
|
(readonly). `aria-activedescendant` tracks the active option.
|
|
@@ -703,6 +738,8 @@ use `TimePicker` or `DateTimeBox`.
|
|
|
703
738
|
|
|
704
739
|
Floating toasts come from statics; `new Message(target)` gives an inline, non-floating area with
|
|
705
740
|
the same `.show()`. The toast region is `role="status"`/`aria-live` (`role="alert"` for errors).
|
|
741
|
+
The shared floating region is fixed to the upper-right logical corner by default, sizes to its
|
|
742
|
+
messages rather than the page, and uses the translucent glass surface tokens with a solid fallback.
|
|
706
743
|
|
|
707
744
|
- **Statics** — `Message.info/success/warning/error(msg, opts)`,
|
|
708
745
|
`Message.show(msg, { kind, timeout=4000, closable })` → `{ close() }`,
|
|
@@ -920,9 +957,9 @@ Two panes with a divider the user owns. The layout is a three-track CSS grid dri
|
|
|
920
957
|
<!-- doc:table -->
|
|
921
958
|
### Table
|
|
922
959
|
|
|
923
|
-
Sortable, selectable, sticky-header data table
|
|
924
|
-
|
|
925
|
-
|
|
960
|
+
Sortable, selectable, sticky-header data table. `fr` widths fill the container while px/auto
|
|
961
|
+
widths scroll horizontally, and multi-select adds a tri-state header checkbox plus Shift+click
|
|
962
|
+
range select.
|
|
926
963
|
|
|
927
964
|
- **Options** — `columns: [{ id, label, sortable?, width ('120px'|'2fr'|'auto'), align,
|
|
928
965
|
type?: 'text'|'number'|'currency'|'percent'|'unit', locale?, decimals?, currency?, unit?,
|
|
@@ -943,7 +980,8 @@ horizontally, and multi-select adds a tri-state header checkbox plus Shift+click
|
|
|
943
980
|
`toggleRow()`, `expandRow()`, `collapseRow()`, `expandAll()`, `collapseAll()`, and
|
|
944
981
|
`getExpanded()`. The native disclosure button works by pointer and keyboard without selecting
|
|
945
982
|
or clicking the row.
|
|
946
|
-
- **Editing** — `editMode: false|'cell'|'row'` (default `false`, and completely inert until set)
|
|
983
|
+
- **Editing** — `editMode: false|'cell'|'row'` (default `false`, and completely inert until set),
|
|
984
|
+
plus `editTrigger: 'double'|'single'` (Table defaults to double; Grid defaults to single).
|
|
947
985
|
`'cell'` edits one cell, `'row'` opens every editable cell of the row and commits them as a unit.
|
|
948
986
|
Editors are sized into the cell without changing row height, and an editing cell carries
|
|
949
987
|
`data-editing="true"` (`data-invalid="true"` plus an `aria-live` message when a validator rejects).
|
|
@@ -976,7 +1014,8 @@ horizontally, and multi-select adds a tri-state header checkbox plus Shift+click
|
|
|
976
1014
|
commit with no changes emits `editcommit` with an empty `changes` map and leaves the data alone.
|
|
977
1015
|
Sorting, filtering, or `setData()` while editing cancels the edit cleanly and emits `editcancel`.
|
|
978
1016
|
- **Editing keyboard** — Enter or F2 on a focused editable cell starts editing (editable cells share
|
|
979
|
-
one roving tab stop)
|
|
1017
|
+
one roving tab stop); the configured single/double pointer gesture starts it without emitting
|
|
1018
|
+
`rowdblclick`. Enter commits and
|
|
980
1019
|
returns focus to the cell (Shift+Enter stays a newline in a `'textarea'`, Space toggles a
|
|
981
1020
|
`'checkbox'`), Escape cancels and returns focus to the cell, Tab commits and moves to the next
|
|
982
1021
|
editable cell (Shift+Tab the previous), wrapping across rows, and tabbing past the last editable
|
|
@@ -1002,6 +1041,14 @@ horizontally, and multi-select adds a tri-state header checkbox plus Shift+click
|
|
|
1002
1041
|
- **Empty state** — `emptyText` takes a string, a Node, or a function returning one, so an empty
|
|
1003
1042
|
table can carry an icon, an explanation, and the action that resolves it (`emptyState({…})`).
|
|
1004
1043
|
A function is re-called on every render, which is what to use when the placeholder holds controls.
|
|
1044
|
+
- **Row order** — `rowReorder: true` adds a dedicated drag handle. Pointer drag moves rows before
|
|
1045
|
+
or after a sibling; Space/Enter grabs/releases the same handle and ArrowUp/ArrowDown moves it for
|
|
1046
|
+
keyboard users. `moveRow(id, targetId, position)` exposes the same guarded operation. Hierarchical
|
|
1047
|
+
rows only move among siblings, and an active local sort disables manual order. A cancelable
|
|
1048
|
+
`rowmove {row,id,target,targetId,position}` fires before `datachange`.
|
|
1049
|
+
- **Column visibility** — `columnVisibility: true` renders a chooser; `hiddenColumns` seeds it.
|
|
1050
|
+
`getVisibleColumns()`, `getHiddenColumns()`, `setColumnVisible()`, and `toggleColumn()` preserve
|
|
1051
|
+
caller column order and never allow the final visible column to disappear.
|
|
1005
1052
|
<!-- /doc -->
|
|
1006
1053
|
|
|
1007
1054
|
<!-- doc:grid -->
|
|
@@ -1011,9 +1058,11 @@ horizontally, and multi-select adds a tri-state header checkbox plus Shift+click
|
|
|
1011
1058
|
without forking its implementation, so sorting, selection, hierarchy, responsive stacking,
|
|
1012
1059
|
editable cells/rows, loading, events, and teardown keep the Table contract.
|
|
1013
1060
|
|
|
1014
|
-
- **Constructor** — `new Grid(target, tableOptions)` accepts the complete `Table` API
|
|
1061
|
+
- **Constructor** — `new Grid(target, tableOptions)` accepts the complete `Table` API and defaults
|
|
1062
|
+
editable cells to a single-click trigger.
|
|
1015
1063
|
- **Preset** — `Grid.BillingItems(target, options)` supplies an editable hierarchical billing
|
|
1016
|
-
schema for item, quantity, unit, unit price, currency, and line total. It
|
|
1064
|
+
schema for item, quantity, unit, unit price, currency, and line total. It enables single-click
|
|
1065
|
+
editing, hierarchy, row reorder handles, and the column visibility chooser. It returns a `Grid`.
|
|
1017
1066
|
- **Billing options** — `data`, `fields` key overrides, `units`, `currencies`, fallback `currency`,
|
|
1018
1067
|
`locale`, `decimals`, `columnOverrides`, complete `columns` replacement, `lineTotal(row, changes)`,
|
|
1019
1068
|
and `oneditcommit` in addition to ordinary Table options.
|
|
@@ -1064,6 +1113,35 @@ Declarative client-side filter bar producing a filtered array, commonly wired to
|
|
|
1064
1113
|
- **Events** — `filter {rows, state}`.
|
|
1065
1114
|
<!-- /doc -->
|
|
1066
1115
|
|
|
1116
|
+
<!-- doc:filter -->
|
|
1117
|
+
### Filter — dynamic backend-neutral expressions
|
|
1118
|
+
|
|
1119
|
+
An authoring component for typed, nested filter expressions. It never evaluates application data
|
|
1120
|
+
or interpolates query text: it emits a versioned, JSON-safe AST for an allowlisted application
|
|
1121
|
+
adapter to compile into its own backend query language.
|
|
1122
|
+
|
|
1123
|
+
- **AST** — `{version: 1, root: {kind:'group', id, logic:'and'|'or', children}}`; children are
|
|
1124
|
+
stable-ID groups or `{kind:'condition', id, field, operator, value}` records. Unknown field or
|
|
1125
|
+
operator IDs survive parsing and render as unavailable/invalid instead of being silently lost.
|
|
1126
|
+
- **Fields** — `{id,label,type,operators?,defaultOperator?,choices?,loadChoices?,editor?,minQuery?,
|
|
1127
|
+
debounce?}`. Built-in types cover text, number/money, date/datetime, boolean, enum/status/
|
|
1128
|
+
priority/country/currency/unit/entity, and tags. Compatible operators and their arity come from
|
|
1129
|
+
the exported `filterOperators` matrix; applications may explicitly override/add operator IDs.
|
|
1130
|
+
- **Options** — `fields`, `value`, `operators`, `allowGroups: true`, `maxDepth: 3`,
|
|
1131
|
+
`maxConditions: 50`, `autoApply: false`, `readonly`, `disabled`, `applyLabel`, `clearLabel`.
|
|
1132
|
+
- **Methods** — `getValue()`, atomic `setValue()`, `addCondition()`, `addGroup()`, `update()`,
|
|
1133
|
+
`remove()`, `move()`, `validate()`, `apply()`, `clear()`, `focus()`, `setReadonly()`,
|
|
1134
|
+
`enable()`/`disable()`.
|
|
1135
|
+
- **Events** — `change {value,valid,errors,reason,nodeId}`, `apply {value}`, `invalid {errors}`,
|
|
1136
|
+
and abortable async-choice lifecycle `query`, `loaded`, `error`. `apply()` returns null and
|
|
1137
|
+
focuses the first invalid condition when validation fails.
|
|
1138
|
+
- **Pure exports** — `emptyFilterAst`, `filterCondition`, `filterGroup`, `parseFilterAst`,
|
|
1139
|
+
`cloneFilterAst`, `cloneFilterValue`, `stringifyFilterAst`, and `validateFilterAst`.
|
|
1140
|
+
- **Boundary** — keep the AST in saved views/audit state and compile it in a backend-specific
|
|
1141
|
+
adapter with an allowlist and bound parameters. Do not put SQL, URL query fragments, functions,
|
|
1142
|
+
DOM nodes, Dates, non-finite numbers, or other executable/non-JSON values into conditions.
|
|
1143
|
+
<!-- /doc -->
|
|
1144
|
+
|
|
1067
1145
|
<!-- doc:tree -->
|
|
1068
1146
|
### TreeView
|
|
1069
1147
|
|
|
@@ -1274,10 +1352,13 @@ shows a fixed set, and `ValueList` takes free text with no catalogue. Unknown ID
|
|
|
1274
1352
|
`setValues` still render as tags, so a stored selection survives a catalogue that has not loaded
|
|
1275
1353
|
yet. Field type: `tagpicker`.
|
|
1276
1354
|
|
|
1277
|
-
- **Options** — `items`, `values: []`, `valueKey: 'ID'`, `labelKey: 'name'`, `
|
|
1355
|
+
- **Options** — `items`, `values: []`, `valueKey: 'ID'`, `labelKey: 'name'`, `iconKey: 'icon'`,
|
|
1356
|
+
`colorKey: 'color'`, `searchKeys`,
|
|
1278
1357
|
`filter: 'local'|(query)=>Promise<items>`, `minQuery: 0`, `debounce: 200`, `allowCreate: false`,
|
|
1279
1358
|
`max` (maximum tags; further options become `aria-disabled`), `closeOnSelect: false`,
|
|
1280
1359
|
`placeholder`, `listHeight: 260`, `disabled`, `readonly`, `renderItem`, `renderTag`.
|
|
1360
|
+
- **Tag identity** — icon values accept a bundled icon name or Node; colors are scoped to the tag
|
|
1361
|
+
and its option through `--zx-tag-color`. Custom `renderItem`/`renderTag` remain authoritative.
|
|
1281
1362
|
- **Methods** — `getValues()`, `getItems()`, `setValues(values, {silent})`, `addValue()`,
|
|
1282
1363
|
`removeValue()`, `clear()`, `reset()`, `setItems()`, `isFull()`, `open()`/`close()`, `focus()`,
|
|
1283
1364
|
`setReadonly()`, `enable()`/`disable()`.
|
|
@@ -1298,6 +1379,30 @@ Collapsible titled section built on the native `<details>` element.
|
|
|
1298
1379
|
- **Events** — `open`, `close`.
|
|
1299
1380
|
<!-- /doc -->
|
|
1300
1381
|
|
|
1382
|
+
<!-- doc:card -->
|
|
1383
|
+
### Card
|
|
1384
|
+
|
|
1385
|
+
A semantic content or record surface. Card is intentionally not a Panel preset: it has no
|
|
1386
|
+
disclosure state or application chrome, and composes as one repeated item in a grid or list. A
|
|
1387
|
+
linked Card keeps the root non-interactive and renders a real title anchor as its primary action,
|
|
1388
|
+
so buttons and links in its action, content, and footer regions remain valid sibling controls.
|
|
1389
|
+
|
|
1390
|
+
- **Options** — `title: ''`, `media: null`, `content: null`, `actions: []`, `footer: null`,
|
|
1391
|
+
`link: null|string|{href, target?, rel?, onclick?}`, `variant: 'outlined'|'raised'|'filled'`,
|
|
1392
|
+
`orientation: 'vertical'|'horizontal'`, `headingLevel: 3`.
|
|
1393
|
+
- **Methods** — `setTitle()`, `setMedia()`, `setContent()`, `setActions()`, `setFooter()`,
|
|
1394
|
+
`setLink()`.
|
|
1395
|
+
- **Content** — media, body, and footer accept text, a Node, a Component, or null. Enhanced target
|
|
1396
|
+
children become body content when no explicit content is supplied, and `destroy()` restores the
|
|
1397
|
+
target exactly.
|
|
1398
|
+
- **Interaction** — `link` stretches the native title anchor across the visual surface; secondary
|
|
1399
|
+
controls stay above it and are never nested inside it. A linked card requires a non-empty title.
|
|
1400
|
+
Executable/data URL schemes are rejected. Commands belong in `actions`, and selectable cards
|
|
1401
|
+
should compose a native checkbox or radio.
|
|
1402
|
+
- **Layout** — horizontal media uses the public `--zx-card-media-size` hook and stacks through a
|
|
1403
|
+
container query when the card itself becomes narrow.
|
|
1404
|
+
<!-- /doc -->
|
|
1405
|
+
|
|
1301
1406
|
<!-- doc:panel -->
|
|
1302
1407
|
### Panel / MasterPanel
|
|
1303
1408
|
|
|
@@ -1519,49 +1624,36 @@ menu on narrow widths.
|
|
|
1519
1624
|
<!-- /doc -->
|
|
1520
1625
|
|
|
1521
1626
|
<!-- doc:app-sidebar -->
|
|
1522
|
-
### AppSidebar —
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
inline.
|
|
1528
|
-
|
|
1529
|
-
- **Options** —
|
|
1530
|
-
`
|
|
1531
|
-
|
|
1532
|
-
`
|
|
1627
|
+
### AppSidebar — application navigation in every presentation
|
|
1628
|
+
|
|
1629
|
+
One route-agnostic application-navigation owner with an expanded vertical tree, a minimized
|
|
1630
|
+
vertical rail, and horizontal rail layouts. It mounts exactly one presentation at a time while
|
|
1631
|
+
preserving active and expanded branch state. Only the expanded vertical state reveals descendants
|
|
1632
|
+
inline; every rail state opens descendants toward the workspace in anchored flyouts.
|
|
1633
|
+
|
|
1634
|
+
- **Options** — `items`, `active`, `expanded`, `collapsed`, `collapsible`,
|
|
1635
|
+
`orientation: 'vertical'|'horizontal'`, `side: 'left'|'right'|'top'|'bottom'`, `label`,
|
|
1636
|
+
`header`, `footer`, `railHeader`, `railFooter`, `openDelay: 80`, `closeDelay: 160`, and
|
|
1637
|
+
`renderIcon(item, context)`. Icon values may also be names, nodes, components, or factories.
|
|
1638
|
+
- **Methods** — `setItems()`, `getItems()`, `setActive()`, `setExpanded()`, `getExpanded()`,
|
|
1639
|
+
`toggleBranch()`, `expand()`, `collapse()`, `setCollapsed()`, `isCollapsed()`,
|
|
1640
|
+
`setLayout({orientation, side})`, `openFlyout(id, {focus})`, `closeFlyout()`,
|
|
1641
|
+
`closeAllFlyouts()`, `isFlyoutOpen()`, `focus()`, `destroy()`.
|
|
1533
1642
|
- **Events** — cancelable `select {item, id, value, href, event}`,
|
|
1534
|
-
`branchchange {item, id, expanded, ids}
|
|
1535
|
-
`setExpanded()`), and `collapsechange {collapsed}`.
|
|
1536
|
-
- **Minimized state** — collapse composes `AppRail` over the same normalized item tree. Expanded
|
|
1537
|
-
branch IDs survive the round trip but are not rendered inline while minimized.
|
|
1538
|
-
- **Semantics** — persistent navigation uses `<nav>` and nested lists with native links and
|
|
1539
|
-
disclosure buttons, not menu or menubar roles. A parent with children is disclosure-only; give
|
|
1540
|
-
it an explicit Overview child when the parent also needs a destination.
|
|
1541
|
-
<!-- /doc -->
|
|
1542
|
-
|
|
1543
|
-
<!-- doc:app-rail -->
|
|
1544
|
-
### AppRail — minimized application navigation
|
|
1545
|
-
|
|
1546
|
-
The compact form of application navigation for left, right, top, or bottom placement. It can flow
|
|
1547
|
-
vertically or horizontally, but descendants are always anchored flyouts—never inline—and open
|
|
1548
|
-
toward the workspace.
|
|
1549
|
-
|
|
1550
|
-
- **Options** — shared application `items`, `active`, `orientation: 'vertical'|'horizontal'`,
|
|
1551
|
-
`side: 'left'|'right'|'top'|'bottom'`, `label`, `header`, `footer`, `openDelay: 80`, and
|
|
1552
|
-
`closeDelay: 160`.
|
|
1553
|
-
- **Methods** — `setItems()`, `setActive()`, `getItems()`, `openFlyout(id, {focus})`,
|
|
1554
|
-
`closeFlyout()`, `closeAllFlyouts()` (including pending hover/focus timers and descendant
|
|
1555
|
-
branches), `isFlyoutOpen()`, `focus()`, `destroy()`.
|
|
1556
|
-
- **Events** — cancelable `select {item, id, value, href, event}` and
|
|
1643
|
+
`branchchange {item, id, expanded, ids}`, `collapsechange {collapsed}`, and
|
|
1557
1644
|
`flyoutchange {item, id, open}`.
|
|
1558
|
-
- **
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
- **
|
|
1563
|
-
|
|
1564
|
-
|
|
1645
|
+
- **Presentation state** — horizontal navigation is always effectively minimized and never exposes
|
|
1646
|
+
an expand control. Switching layouts does not erase the saved vertical collapsed preference or
|
|
1647
|
+
expanded branch IDs. `AppSidebar` is the single public application-navigation component; use
|
|
1648
|
+
`collapsed: true` or `orientation: 'horizontal'` for its rail presentations.
|
|
1649
|
+
- **Pointer and focus** — hover or focus reveals rail descendants without stealing focus. Click,
|
|
1650
|
+
Enter, Space, and the arrow toward the workspace also open a flyout; Escape, outside activation,
|
|
1651
|
+
or selection closes it. Expanded navigation supports arrows plus Home/End across visible rows.
|
|
1652
|
+
- **Semantics** — persistent navigation uses `<nav>` and nested lists with native links and
|
|
1653
|
+
disclosure buttons, not menu or menubar roles. Icon-only destinations retain an accessible name
|
|
1654
|
+
and Tooltip. A parent with children is disclosure-only; add an Overview child when it also needs
|
|
1655
|
+
a destination. Malformed and executable URL schemes are stripped; an item with no remaining
|
|
1656
|
+
link or callback is disabled in every presentation.
|
|
1565
1657
|
<!-- /doc -->
|
|
1566
1658
|
|
|
1567
1659
|
<!-- doc:kernel -->
|
|
@@ -1569,16 +1661,16 @@ toward the workspace.
|
|
|
1569
1661
|
|
|
1570
1662
|
- **Component** — the base class: `on`/`off`/`once`/`emit`, `listen`, `toElement`, `msg`,
|
|
1571
1663
|
`destroy`, and the static `Component.from(el)`.
|
|
1572
|
-
- **DOM** — `h(tag, props, ...children)`, `h.raw(html)`, `htmlEscape`, `resolveElement`.
|
|
1573
|
-
|
|
1574
|
-
|
|
1664
|
+
- **DOM** — `h(tag, props, ...children)`, `h.raw(html)`, `htmlEscape`, `resolveElement`.
|
|
1665
|
+
`__(tag#id.class, properties, content)` is Zx's compact DOM builder and public alias for
|
|
1666
|
+
`compactElement()`. It preserves `D*` data, `S*` style, boolean/built-in property, attribute,
|
|
1575
1667
|
and legacy `on*` callback rules while keeping content text-safe. `applyCompactProperties`,
|
|
1576
1668
|
`appendContent`, `appendCompact` (parent return), `appendCompactChild` (child return), and
|
|
1577
1669
|
`fragment(...children)` are the pure forms.
|
|
1578
1670
|
- **Compact events** — `onCompactEvent`, `offCompactEvent`, and `fireCompactEvent` share one
|
|
1579
1671
|
newest-first handler registry. Existing `DOM.on/remEvt/fireEvt` methods can delegate to this
|
|
1580
|
-
triad. Zx never installs globals or alters DOM prototypes;
|
|
1581
|
-
|
|
1672
|
+
triad. Zx never installs globals or alters DOM prototypes; applications decide whether to expose
|
|
1673
|
+
these functions globally or compose them into their own UI and routing layer.
|
|
1582
1674
|
- **Icons** — `icon(name, {size, label})` and `icons`; see the Icons section — bundled inline SVG
|
|
1583
1675
|
by default, Font Awesome after an opt-in.
|
|
1584
1676
|
- **Positioning** — `position(anchor, floating, {placement, offset, flip, matchWidth})` →
|
|
@@ -1714,40 +1806,6 @@ bug wearing a layout costume, while a tooltip that is always there is noise.
|
|
|
1714
1806
|
`data-lines` plus `--zx-truncate-lines` select the multi-line form.
|
|
1715
1807
|
<!-- /doc -->
|
|
1716
1808
|
|
|
1717
|
-
<!-- doc:gx-compat -->
|
|
1718
|
-
### gx compatibility layer
|
|
1719
|
-
|
|
1720
|
-
Opt-in re-implementation of the legacy MooTools-era `gx` API on top of Zx, so existing ZeyOS
|
|
1721
|
-
screens keep running while their code is modernised file by file. It lives in its own bundle, is
|
|
1722
|
-
never imported by `src/index.js`, and adds nothing to an application that does not load it.
|
|
1723
|
-
|
|
1724
|
-
- **Loading** — classic: `<script src="/assets/zx-compat.global.js">` → `window.gx`; module:
|
|
1725
|
-
`import { gx } from '/assets/zx-compat.esm.js'` (or `src/compat/index.js` in-repo).
|
|
1726
|
-
`gx.compat.installGlobals()` additionally installs the gx `__()` parser only when that name is
|
|
1727
|
-
free, plus `_()`, `String.htmlSpecialChars`, and the element `store`/`retrieve` shim. It never
|
|
1728
|
-
replaces ZeyOS's compact builder. `gx.install(host)` assigns
|
|
1729
|
-
the namespace without the optional globals.
|
|
1730
|
-
- **`gx.zeyos`** — Select/SelectFilter/SelectDyn/SelectPrio, Table, Tabbox, Panel, MasterPanel,
|
|
1731
|
-
Groupbox, Search, Datebox, DatePicker, MonthPicker, TimePicker, Timebox, Toggle, Msgbox, Popup,
|
|
1732
|
-
Dialog, Dropdown, Checklist, Permission, Client, Request, Factory.
|
|
1733
|
-
- **`gx.bootstrap`** — Form, Fieldset, Field, the Select variants, Checklist, Table, Tabbox,
|
|
1734
|
-
NavigationBar, MenuButton, Message, Popup/PopupAlert/PopupConfirm, CheckButton, DataFilter,
|
|
1735
|
-
ValueList, MultiValueEditor, FieldUpload, Timebox.
|
|
1736
|
-
- **`gx.util`** — `formatNum`, `formatTime`, `getMinutes`, `getNumber`, `printf`, `parseResult`,
|
|
1737
|
-
`Parse`, `isArray`/`isObject`/`isFunction`/`isString`/`isNumber`/`isElement`/`isNode`,
|
|
1738
|
-
`Console`.
|
|
1739
|
-
- **`gx.ui`** — Container, SimpleTable, Timebox, and the inert visual-effect stubs
|
|
1740
|
-
Blend/Collapse/Hud/Toggling/HGroup/Templates. **`gx.core`** — Settings. **`gx.compat`** —
|
|
1741
|
-
installGlobals, installElementStorage, parse, GxWrapper.
|
|
1742
|
-
- **Migrating off it** — legacy classes collapse onto fewer Zx components: all four Select
|
|
1743
|
-
variants → one `Select` with a `filter` option; `gx.ui.Table` + `SimpleTable` → one `Table`;
|
|
1744
|
-
`Msgbox`/`bootstrap.Message` → `Message`; `Popup`/`PopupAlert`/`PopupConfirm` → `Modal`/`Dialog`
|
|
1745
|
-
with Promise-returning statics; `gx.zeyos.Client`/`Request` → `@zeyos/client`. Anything that
|
|
1746
|
-
depended on MooTools prototype extensions is gone. `MIGRATION.md` has the full map and the
|
|
1747
|
-
deliberate behaviour changes; `website/compat.html` runs legacy snippets against Zx as a smoke
|
|
1748
|
-
test.
|
|
1749
|
-
<!-- /doc -->
|
|
1750
|
-
|
|
1751
1809
|
<!-- doc:elements -->
|
|
1752
1810
|
### Custom elements — `defineElements()`
|
|
1753
1811
|
|
package/docs/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Xenon Design System (Zx)
|
|
2
2
|
|
|
3
|
-
> Xenon is
|
|
3
|
+
> Xenon is a dependency-free design system for browser applications; Zx is its product-agnostic
|
|
4
4
|
> vanilla-JavaScript implementation. ES2022 modules, WAI-ARIA-accessible native
|
|
5
5
|
> controls, semantic `--zx-*` design tokens with light/dark/density theming, and lifecycle-safe
|
|
6
6
|
> components. Source modules run directly in the browser; a build step emits ESM, IIFE-global,
|
|
7
|
-
>
|
|
7
|
+
> ZeyOS binding, and CSS bundles. Zero runtime dependencies.
|
|
8
8
|
|
|
9
9
|
Instantiate every component as `new Component(target, options)` where `target` is an Element, a
|
|
10
10
|
selector string, or `null` (the component creates and owns its root, retrieved via `.toElement()`).
|
|
@@ -13,45 +13,48 @@ Subscribe with `.on(type, fn)` or an `on<type>` option; handlers receive a `Cust
|
|
|
13
13
|
exports and as `window.zx.*`.
|
|
14
14
|
|
|
15
15
|
## Documentation
|
|
16
|
-
- [Documentation site](
|
|
17
|
-
- [README](../README.md): what Zx is, quick start (ESM + global script), component index, theming, browser support
|
|
16
|
+
- [Documentation site](https://zx.zeyos.com/docs.html): getting started, every component with a live demo and its JavaScript source, and the application layouts. Machine index: [llms.txt](https://zx.zeyos.com/llms.txt).
|
|
17
|
+
- [README](../README.md): what Zx is, quick start (ESM + global script), component index, theming, and browser support.
|
|
18
18
|
- [API reference](llms.md): per-component constructor options, methods, and events for all public components plus the core helpers.
|
|
19
|
-
- [Skill](
|
|
19
|
+
- [Skill](https://zx.zeyos.com/skills/zx/SKILL.md): task-oriented guide — mental model, recipes, ZeyOS HTTP client, theming, gotchas, commands.
|
|
20
20
|
- [Changelog](../CHANGELOG.md): what changed in each release, including behaviour changes an upgrade has to account for.
|
|
21
|
-
- [
|
|
22
|
-
- [Contributor contract](../AGENTS.md): conventions for editing component source (token rules, render-time state, listeners, ARIA/APG).
|
|
21
|
+
- [Contributor contract](https://github.com/zeyos/zx/blob/main/AGENTS.md): conventions for editing component source (token rules, render-time state, listeners, ARIA/APG).
|
|
23
22
|
|
|
24
23
|
## Components
|
|
25
24
|
- Inputs and identity: `button()`, `buttonGroup()`, `badge()`/`badgeGroup()`, `CheckButton`,
|
|
26
|
-
`Toggle`, `Search`, `
|
|
27
|
-
`filter: false|'local'|async
|
|
25
|
+
`Toggle`, `Search`, `AppIcon` (+ `zeyosAppIcon()` presets), `Avatar`,
|
|
26
|
+
`Select` (APG combobox; `filter: false|'local'|async`; priority, status, permission, and
|
|
27
|
+
`Select.entity()` presets), `Checklist`, `TagPicker` (icon/color identity), `NumberField`, `Rating`, `Slider`,
|
|
28
28
|
`copyButton()`/`CopyInput`, `DatePicker`, `MonthPicker`, `TimePicker`,
|
|
29
29
|
`Datebox`/`DateTimeBox`, `DateRangePicker`/`DateRangeBox`, `Timebox`.
|
|
30
30
|
- Overlays: `Message` (toasts/inline/progress), `Modal`, `Dialog` (+ `alert`/`confirm`/`prompt` Promises), `Sheet` (edge-anchored Dialog; `side`, `modal: true|'trap-focus'|false`, `backdrop`, `snap` detents, swipe-to-dismiss), `SheetStack` (drill-down; `stack`/`cascade`), `Dropdown`, `MenuButton`, `ContextMenu` (right-click; `selector` for per-row menus), `Tooltip`/`tooltip()`/`describe()`.
|
|
31
|
-
- Data: `Table` (sortable, selectable, sticky header, opt-in inline cell/row editing
|
|
32
|
-
|
|
33
|
-
`
|
|
31
|
+
- Data: `Table` (sortable, selectable, sticky header, opt-in inline cell/row editing, row reorder,
|
|
32
|
+
column visibility), `Grid` with single-click editing and `Grid.BillingItems()`, engine-neutral
|
|
33
|
+
`Chart` with injected `ChartJsAdapter`, backend-neutral nested `Filter`, simple client-side
|
|
34
|
+
`DataFilter`, `Pagination` (+ pure `paginationRange()`), `TreeView` (APG tree),
|
|
34
35
|
`Finder` (Miller columns).
|
|
35
36
|
- Forms: `Form`, `Fieldset`, `Questionnaire` (guided one-question-at-a-time flow with branching), `Field` (type registry), `ValueList`, `MultiValueEditor`, `FieldUpload`.
|
|
36
37
|
- Layout: `stack()`/`grid()`/`aspect()` (spacing, an intrinsically reflowing grid, a fixed-ratio
|
|
37
|
-
box), `Groupbox`, `
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
box), `Groupbox`, `Card` (media/title link/actions/footer), `Panel` (header/footer action
|
|
39
|
+
buttons), `MasterPanel`, `Tabbox`
|
|
40
|
+
(`variant: 'divided'|'bracket'|'line'|'segmented'`), `NavigationBar`, `AppSidebar` (expanded and
|
|
41
|
+
minimized vertical states plus horizontal rail layouts), `AccountMenu`, `Launcher`,
|
|
42
|
+
`spinner()`/`ProgressBar`/`InlineLoading`, `skeleton()`/`skeletonText()`/`skeletonTable()`,
|
|
43
|
+
`Toolbar` (APG toolbar with overflow menu), `SplitView`, `Dock`
|
|
40
44
|
(collapsible resizable pane stack; tab groups, regions, adopts a `Sheet`), `Stepper`,
|
|
41
45
|
`Breadcrumb`, `emptyState()`.
|
|
42
|
-
-
|
|
43
|
-
- Core: `Component`, `h`/`icon`, `position`, `breakpoints`/`breakpointOf`/`matchBreakpoint`/`onBreakpoint` (named width bands, observed on an element or the window), `Http`/`zeyosService`, i18n, date utils, `defineElements` (declarative `<zx-*>` custom elements).
|
|
46
|
+
- Core: `Component`, `h`/`__`/`icon`, `position`, `breakpoints`/`breakpointOf`/`matchBreakpoint`/`onBreakpoint` (named width bands, observed on an element or the window), `Http`/`zeyosService`, i18n, date utils, `defineElements` (declarative `<zx-*>` custom elements).
|
|
44
47
|
- Helpers: `formatNumber`/`formatCurrency`/`formatPercent`/`formatFileSize`/`formatRelativeTime` (locale-aware, cached `Intl`), `debounce`/`throttle`, `groupBy`/`sortBy`/`uniqueBy`, `escapeRegExp`/`highlightMatch`, `storage()` (namespaced JSON, degrades to memory), `toCsv`/`downloadBlob`/`copyToClipboard`, `truncate()`/`isTruncated()` (line clamp with the full value on hover).
|
|
45
48
|
|
|
46
49
|
## Theming
|
|
47
|
-
Load `zx.css` once; set `data-zx-theme` (`light`|`dark`|`auto`) and `data-zx-density` (`cozy`|`compact`) on any ancestor. Define a product theme by overriding semantic `--zx-color-*` / `--zx-control-*` tokens under `[data-zx-theme="name"]`. Never use tier-1 palette tokens or raw color literals in application CSS.
|
|
50
|
+
Load `zx.css` once; set `data-zx-theme` (`light`|`dark`|`auto`) and `data-zx-density` (`cozy`|`compact`) on any ancestor. Define a product theme by overriding semantic `--zx-color-*` / `--zx-control-*` tokens under `[data-zx-theme="name"]`. The theme studio controls accent, neutral tint, density, font, type size, radius, control height, and CSS-first glass material. Never use tier-1 palette tokens or raw color literals in application CSS.
|
|
48
51
|
|
|
49
52
|
## Talking to ZeyOS
|
|
50
|
-
Use the dedicated ZeyOS client library **`@zeyos/client`** (`npm install @zeyos/client`) for ZeyOS business data: `createZeyosClient({ platform, auth })`, typed `client.api.list/get/create/update<Resource>` over the full OpenAPI surface, `normalizeListResult`.
|
|
53
|
+
Use the dedicated ZeyOS client library **`@zeyos/client`** (`npm install @zeyos/client`) for ZeyOS business data: `createZeyosClient({ platform, auth })`, typed `client.api.list/get/create/update<Resource>` over the full OpenAPI surface, and `normalizeListResult`. Zx accepts the client by injection and does not bundle it. See the `website/layouts/zeyos-invoices.layout.js` layout for a Zx-components-on-@zeyos/client reference. Zx also ships a minimal `Http`/`zeyosService` for ad-hoc in-app `remotecall`, but `@zeyos/client` is the recommended default.
|
|
51
54
|
|
|
52
55
|
## Installing
|
|
53
|
-
`npm install @zeyos/zx`. Entry points: `.` (components), `./zeyos` (ZeyOS binding), `./
|
|
54
|
-
(
|
|
56
|
+
`npm install @zeyos/zx`. Entry points: `.` (components), `./zeyos` (ZeyOS binding), `./zx.css`
|
|
57
|
+
(styles), and `./global` (classic script tag). Docs: https://zx.zeyos.com
|
|
55
58
|
|
|
56
59
|
## Commands
|
|
57
60
|
`npm run serve` (no-build documentation at http://127.0.0.1:8321/website/docs.html) · `npm test` (unit + token lint) · `npm run build` (dist bundles).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeyos/zx",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Dependency-free JavaScript implementation of the Xenon Design System
|
|
3
|
+
"version": "4.1.0",
|
|
4
|
+
"description": "Dependency-free JavaScript implementation of the Xenon Design System.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://zx.zeyos.com",
|
|
@@ -25,9 +25,7 @@
|
|
|
25
25
|
"sideEffects": [
|
|
26
26
|
"*.css",
|
|
27
27
|
"./dist/zx.global.js",
|
|
28
|
-
"./dist/zx.global.min.js"
|
|
29
|
-
"./dist/zx-compat.global.js",
|
|
30
|
-
"./dist/zx-compat.global.min.js"
|
|
28
|
+
"./dist/zx.global.min.js"
|
|
31
29
|
],
|
|
32
30
|
"exports": {
|
|
33
31
|
".": {
|
|
@@ -38,23 +36,15 @@
|
|
|
38
36
|
"types": "./dist/types/zeyos/index.d.ts",
|
|
39
37
|
"default": "./dist/zx-zeyos.esm.js"
|
|
40
38
|
},
|
|
41
|
-
"./compat": {
|
|
42
|
-
"types": "./dist/types/compat/index.d.ts",
|
|
43
|
-
"default": "./dist/zx-compat.esm.js"
|
|
44
|
-
},
|
|
45
39
|
"./global": {
|
|
46
40
|
"types": "./dist/types/index.d.ts",
|
|
47
41
|
"default": "./dist/zx.global.js"
|
|
48
42
|
},
|
|
49
|
-
"./compat-global": {
|
|
50
|
-
"types": "./dist/types/compat/index.d.ts",
|
|
51
|
-
"default": "./dist/zx-compat.global.js"
|
|
52
|
-
},
|
|
53
43
|
"./zx.css": "./dist/zx.css",
|
|
54
44
|
"./zx.min.css": "./dist/zx.min.css",
|
|
55
|
-
"./src/*.js": {
|
|
56
|
-
"types": "./dist/types/*.d.ts",
|
|
57
|
-
"default": "./src/*.js"
|
|
45
|
+
"./src/components/*.js": {
|
|
46
|
+
"types": "./dist/types/components/*.d.ts",
|
|
47
|
+
"default": "./src/components/*.js"
|
|
58
48
|
},
|
|
59
49
|
"./styles/*": "./styles/*",
|
|
60
50
|
"./dist/*": "./dist/*",
|
|
@@ -68,13 +58,14 @@
|
|
|
68
58
|
"dist/types",
|
|
69
59
|
"styles",
|
|
70
60
|
"src",
|
|
61
|
+
"!src/compat",
|
|
62
|
+
"!src/compat-entry.js",
|
|
71
63
|
"docs/llms.md",
|
|
72
64
|
"docs/llms.txt",
|
|
73
65
|
"docs/api.json",
|
|
74
66
|
"CHANGELOG.md",
|
|
75
67
|
"README.md",
|
|
76
68
|
"DESIGN-SYSTEM.md",
|
|
77
|
-
"MIGRATION.md",
|
|
78
69
|
"LICENSE"
|
|
79
70
|
],
|
|
80
71
|
"engines": {
|