@zeyos/zx 2.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 +74 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +598 -0
- package/README.md +288 -0
- package/dist/zx-compat.esm.js +16880 -0
- package/dist/zx-compat.esm.min.js +1 -0
- package/dist/zx-compat.global.js +23068 -0
- package/dist/zx-compat.global.min.js +3 -0
- package/dist/zx-zeyos.esm.js +11581 -0
- package/dist/zx-zeyos.esm.min.js +1 -0
- package/dist/zx.css +4946 -0
- package/dist/zx.esm.js +19934 -0
- package/dist/zx.esm.min.js +3 -0
- package/dist/zx.global.js +19958 -0
- package/dist/zx.global.min.js +3 -0
- package/dist/zx.min.css +1 -0
- package/docs/api.json +5248 -0
- package/docs/llms.md +1315 -0
- package/docs/llms.txt +45 -0
- package/package.json +74 -0
package/docs/llms.txt
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Zx
|
|
2
|
+
|
|
3
|
+
> Zx is the dependency-free, vanilla-JavaScript UI component library for ZeyOS business
|
|
4
|
+
> applications. ES2022 modules, WAI-ARIA-accessible native
|
|
5
|
+
> controls, semantic `--zx-*` design tokens with light/dark/density theming, and lifecycle-safe
|
|
6
|
+
> components. Source modules run directly in the browser; a build step emits ESM, IIFE-global,
|
|
7
|
+
> gx-compatibility, and CSS bundles. Zero runtime dependencies.
|
|
8
|
+
|
|
9
|
+
Instantiate every component as `new Component(target, options)` where `target` is an Element, a
|
|
10
|
+
selector string, or `null` (the component creates and owns its root, retrieved via `.toElement()`).
|
|
11
|
+
Subscribe with `.on(type, fn)` or an `on<type>` option; handlers receive a `CustomEvent` whose
|
|
12
|
+
`.detail` is an object. Call `.destroy()` to clean up. The same API is available as ESM named
|
|
13
|
+
exports and as `window.zx.*`.
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
- [Documentation site](../website/docs.html): getting started, every component with a live demo and its JavaScript source, and the application layouts. Machine index: [website/llms.txt](../website/llms.txt).
|
|
17
|
+
- [README](../README.md): what Zx is, quick start (ESM + global script), component index, theming, browser support, gx compat.
|
|
18
|
+
- [API reference](llms.md): per-component constructor options, methods, and events for all 30+ components plus the core helpers.
|
|
19
|
+
- [Skill](../.claude/skills/zx/SKILL.md): task-oriented guide — mental model, recipes, ZeyOS HTTP client, theming, gotchas, commands.
|
|
20
|
+
- [Changelog](../CHANGELOG.md): what changed in each release, including behaviour changes an upgrade has to account for.
|
|
21
|
+
- [Migration guide](../MIGRATION.md): gx→zx class map, script-tag replacement, deliberate behavior changes, unsupported legacy APIs.
|
|
22
|
+
- [Contributor contract](../AGENTS.md): conventions for editing component source (token rules, render-time state, listeners, ARIA/APG).
|
|
23
|
+
|
|
24
|
+
## Components
|
|
25
|
+
- Inputs: `button()`, `buttonGroup()`, `badge()`/`badgeGroup()`, `CheckButton`, `Toggle`, `Search`, `Select` (APG combobox; `filter: false|'local'|async`), `Checklist`, `TagPicker`, `NumberField`, `Rating`, `Slider`, `copyButton()`/`CopyInput`, `DatePicker`, `MonthPicker`, `TimePicker`, `Datebox`/`DateTimeBox`, `DateRangePicker`/`DateRangeBox`, `Timebox`.
|
|
26
|
+
- Overlays: `Message` (toasts/inline/progress), `Modal`, `Dialog` (+ `alert`/`confirm`/`prompt` Promises), `Dropdown`, `MenuButton`, `ContextMenu` (right-click; `selector` for per-row menus), `Tooltip`/`tooltip()`/`describe()`.
|
|
27
|
+
- Data: `Table` (sortable, selectable, sticky header, opt-in inline cell/row editing via `editMode`), `DataFilter`, `Pagination` (+ pure `paginationRange()`), `TreeView` (APG tree), `Finder` (Miller columns).
|
|
28
|
+
- Forms: `Form`, `Fieldset`, `Field` (type registry), `ValueList`, `MultiValueEditor`, `FieldUpload`, `Permission`.
|
|
29
|
+
- Layout: `stack()`/`grid()`/`aspect()` (spacing, an intrinsically reflowing grid, a fixed-ratio box), `Groupbox`, `Panel` (header/footer action buttons), `MasterPanel`, `Tabbox` (`variant: 'divided'|'bracket'|'line'|'segmented'`), `NavigationBar`, `Toolbar` (APG toolbar with overflow menu), `SplitView`, `Stepper`, `Breadcrumb`, `emptyState()`.
|
|
30
|
+
- Feedback: `spinner()` (unknown duration), `ProgressBar` (known share; determinate or indeterminate), `InlineLoading` (a wait resolving into its outcome in place), `skeleton()`/`skeletonText()`/`skeletonTable()` (placeholders shaped like the content; `aria-hidden`, set `aria-busy` on the region).
|
|
31
|
+
- 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).
|
|
32
|
+
- 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).
|
|
33
|
+
|
|
34
|
+
## Theming
|
|
35
|
+
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.
|
|
36
|
+
|
|
37
|
+
## Talking to ZeyOS
|
|
38
|
+
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`. It replaces the legacy `gx.zeyos.Client`/`gx.zeyos.Request`. 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.
|
|
39
|
+
|
|
40
|
+
## Installing
|
|
41
|
+
`npm install @zeyos/zx`. Entry points: `.` (components), `./zeyos` (ZeyOS binding), `./compat`
|
|
42
|
+
(gx namespace), `./zx.css` (styles), `./global` (classic script tag). Docs: https://zx.zeyos.com
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
`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
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zeyos/zx",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Dependency-free, accessible UI component library for ZeyOS business applications.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://zx.zeyos.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/zeyos/zx.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/zeyos/zx/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"zeyos",
|
|
17
|
+
"ui",
|
|
18
|
+
"components",
|
|
19
|
+
"design-system",
|
|
20
|
+
"accessibility",
|
|
21
|
+
"wai-aria",
|
|
22
|
+
"vanilla-js",
|
|
23
|
+
"erp"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": [
|
|
26
|
+
"*.css",
|
|
27
|
+
"./dist/zx.global.js",
|
|
28
|
+
"./dist/zx.global.min.js",
|
|
29
|
+
"./dist/zx-compat.global.js",
|
|
30
|
+
"./dist/zx-compat.global.min.js"
|
|
31
|
+
],
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./dist/zx.esm.js",
|
|
34
|
+
"./zeyos": "./dist/zx-zeyos.esm.js",
|
|
35
|
+
"./compat": "./dist/zx-compat.esm.js",
|
|
36
|
+
"./global": "./dist/zx.global.js",
|
|
37
|
+
"./compat-global": "./dist/zx-compat.global.js",
|
|
38
|
+
"./zx.css": "./dist/zx.css",
|
|
39
|
+
"./zx.min.css": "./dist/zx.min.css",
|
|
40
|
+
"./dist/*": "./dist/*",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"main": "./dist/zx.esm.js",
|
|
44
|
+
"module": "./dist/zx.esm.js",
|
|
45
|
+
"style": "./dist/zx.css",
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"docs/llms.md",
|
|
49
|
+
"docs/llms.txt",
|
|
50
|
+
"docs/api.json",
|
|
51
|
+
"CHANGELOG.md",
|
|
52
|
+
"README.md",
|
|
53
|
+
"MIGRATION.md",
|
|
54
|
+
"LICENSE"
|
|
55
|
+
],
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=20"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"serve": "node tools/serve.js",
|
|
64
|
+
"serve:site": "SERVE_ROOT=site node tools/serve.js",
|
|
65
|
+
"build": "node tools/build.js",
|
|
66
|
+
"build:site": "node tools/build-api.js && node tools/build-site.js",
|
|
67
|
+
"test": "node --test && node tests/lint-tokens.js",
|
|
68
|
+
"prepublishOnly": "npm test && npm run build",
|
|
69
|
+
"build:api": "node tools/build-api.js"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"esbuild": "latest"
|
|
73
|
+
}
|
|
74
|
+
}
|