@zeyos/zx 5.6.0 → 5.7.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 +154 -0
- package/README.md +73 -7
- package/bin/zx-css.js +328 -0
- package/dist/types/components/account-menu/account-menu.d.ts +4 -2
- package/dist/types/components/activity-list/activity-list.d.ts +14 -8
- package/dist/types/components/agent-thread/ag-ui.d.ts +340 -0
- package/dist/types/components/agent-thread/agent-thread.d.ts +142 -14
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +401 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +14 -8
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +3 -3
- package/dist/types/components/calendar/calendar-model.d.ts +9 -2
- package/dist/types/components/calendar/calendar.d.ts +12 -4
- package/dist/types/components/chart/chart.d.ts +25 -13
- package/dist/types/components/code-editor/code-editor.d.ts +7 -2
- package/dist/types/components/composer/composer.d.ts +206 -4
- package/dist/types/components/composer/queue.d.ts +76 -0
- package/dist/types/components/copy/copy-button.d.ts +6 -4
- package/dist/types/components/copy/copy-input.d.ts +10 -6
- package/dist/types/components/datebox/date-range-box.d.ts +33 -0
- package/dist/types/components/datebox/placeholder.d.ts +7 -0
- package/dist/types/components/dock/dock.d.ts +12 -3
- package/dist/types/components/entity-ref/entity-ref.d.ts +5 -3
- package/dist/types/components/field-upload/field-upload.d.ts +3 -2
- package/dist/types/components/file-item/file-item.d.ts +3 -2
- package/dist/types/components/file-list/file-list.d.ts +14 -8
- package/dist/types/components/filter/filter-model.d.ts +31 -1
- package/dist/types/components/filter/filter.d.ts +20 -2
- package/dist/types/components/finder/finder.d.ts +14 -6
- package/dist/types/components/flag/flag.d.ts +99 -0
- package/dist/types/components/grid/grid.d.ts +1 -1
- package/dist/types/components/kanban-view/kanban-view.d.ts +8 -66
- package/dist/types/components/launcher/launcher.d.ts +2 -0
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +3 -2
- package/dist/types/components/number-field/number-field.d.ts +17 -6
- package/dist/types/components/prompt-starters/prompt-starters.d.ts +107 -0
- package/dist/types/components/prose/prose.d.ts +9 -6
- package/dist/types/components/questionnaire/conditions.d.ts +270 -0
- package/dist/types/components/questionnaire/items.d.ts +52 -30
- package/dist/types/components/questionnaire/questionnaire.d.ts +44 -4
- package/dist/types/components/rating/rating.d.ts +5 -3
- package/dist/types/components/select/country.d.ts +106 -0
- package/dist/types/components/select/field-adapter.d.ts +2 -1
- package/dist/types/components/select/locale.d.ts +102 -0
- package/dist/types/components/select/select.d.ts +41 -2
- package/dist/types/components/slider/slider.d.ts +1 -0
- package/dist/types/components/sort-control/sort-control.d.ts +7 -3
- package/dist/types/components/source-list/source-list.d.ts +7 -5
- package/dist/types/components/split-view/split-view.d.ts +5 -3
- package/dist/types/components/surface/catalog.d.ts +260 -0
- package/dist/types/components/surface/elicit.d.ts +81 -0
- package/dist/types/components/surface/mcp.d.ts +165 -0
- package/dist/types/components/surface/schema.d.ts +314 -0
- package/dist/types/components/surface/stream.d.ts +118 -0
- package/dist/types/components/surface/surface.d.ts +718 -0
- package/dist/types/components/surface/text.d.ts +277 -0
- package/dist/types/components/surface/validate.d.ts +339 -0
- package/dist/types/components/table/table.d.ts +55 -3
- package/dist/types/components/table/window.d.ts +203 -0
- package/dist/types/components/toolbar/toolbar.d.ts +10 -6
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree/tree.d.ts +20 -13
- package/dist/types/core/component.d.ts +10 -0
- package/dist/types/core/date.d.ts +8 -1
- package/dist/types/core/dom.d.ts +1 -0
- package/dist/types/core/http.d.ts +10 -0
- package/dist/types/core/i18n.d.ts +38 -0
- package/dist/types/core/messages.d.ts +344 -1
- package/dist/types/core/storage.d.ts +7 -2
- package/dist/types/elements/define.d.ts +21 -46
- package/dist/types/elements/definitions.d.ts +147 -0
- package/dist/types/elements/kit.d.ts +7 -0
- package/dist/types/elements/reflect.d.ts +6 -3
- package/dist/types/index.d.ts +10 -1
- package/dist/types/internal/date-locale.d.ts +7 -0
- package/dist/types/internal/json-patch.d.ts +146 -0
- package/dist/types/locales/de.d.ts +13 -0
- package/dist/types/locales/en.d.ts +2 -0
- package/dist/types/locales/index.d.ts +823 -0
- package/dist/types/zeyos/view.d.ts +8 -1
- package/dist/zx-zeyos.esm.js +16802 -15180
- package/dist/zx-zeyos.esm.min.js +5 -5
- package/dist/zx.core.css +1276 -0
- package/dist/zx.core.min.css +1 -0
- package/dist/zx.css +498 -134
- package/dist/zx.esm.js +40778 -29654
- package/dist/zx.esm.min.js +36 -23
- package/dist/zx.global.js +40778 -29654
- package/dist/zx.global.min.js +36 -23
- package/dist/zx.layered.css +17302 -0
- package/dist/zx.layered.min.css +1 -0
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +12501 -0
- package/docs/agent-surfaces.md +340 -0
- package/docs/api.json +851 -121
- package/docs/llms.md +1018 -71
- package/docs/llms.txt +30 -9
- package/package.json +29 -6
- package/src/components/account-menu/account-menu.js +6 -3
- package/src/components/activity-item/activity-item.js +2 -1
- package/src/components/activity-list/activity-list.js +16 -10
- package/src/components/agent-thread/ag-ui.js +1439 -0
- package/src/components/agent-thread/agent-thread.js +359 -54
- package/src/components/agent-thread/ui-message-stream.js +1281 -0
- package/src/components/app-sidebar/app-sidebar.js +18 -8
- package/src/components/approval-card/approval-card.js +3 -2
- package/src/components/block-view/block-view.js +7 -6
- package/src/components/breadcrumb/breadcrumb.js +8 -5
- package/src/components/calendar/calendar-model.js +8 -2
- package/src/components/calendar/calendar.js +53 -18
- package/src/components/chart/chart.js +54 -23
- package/src/components/code-editor/code-editor.js +45 -8
- package/src/components/code-editor/field-adapter.js +1 -1
- package/src/components/composer/composer.css +80 -1
- package/src/components/composer/composer.js +390 -16
- package/src/components/composer/queue.js +78 -0
- package/src/components/context-menu/context-menu.js +12 -1
- package/src/components/copy/copy-button.js +9 -7
- package/src/components/copy/copy-input.js +10 -6
- package/src/components/date-picker/date-picker.js +2 -1
- package/src/components/date-picker/date-range-picker.js +8 -7
- package/src/components/datebox/date-range-box.js +3 -9
- package/src/components/datebox/datebox.js +18 -21
- package/src/components/datebox/placeholder.js +18 -0
- package/src/components/dialog/dialog.js +1 -1
- package/src/components/dock/dock.js +34 -13
- package/src/components/entity-ref/entity-ref.js +16 -5
- package/src/components/field-upload/field-upload.js +81 -38
- package/src/components/file-item/file-item.js +70 -40
- package/src/components/file-list/file-list.js +15 -9
- package/src/components/filter/filter-model.js +46 -8
- package/src/components/filter/filter.css +3 -3
- package/src/components/filter/filter.js +29 -10
- package/src/components/filter-panel/filter-panel.js +13 -5
- package/src/components/finder/finder.js +50 -26
- package/src/components/flag/flag.css +40 -0
- package/src/components/flag/flag.js +177 -0
- package/src/components/form/form.js +1 -1
- package/src/components/grid/grid.js +22 -8
- package/src/components/kanban-view/kanban-view.js +51 -81
- package/src/components/launcher/launcher.js +17 -2
- package/src/components/list-toolbar/list-toolbar.js +2 -1
- package/src/components/master-panel/master-panel.js +1 -1
- package/src/components/menu-button/menu-button.js +4 -0
- package/src/components/message/message.js +3 -0
- package/src/components/multi-value-editor/multi-value-editor.js +10 -9
- package/src/components/navigation-bar/navigation-bar.js +3 -3
- package/src/components/number-field/number-field.js +29 -13
- package/src/components/prompt-starters/prompt-starters.css +91 -0
- package/src/components/prompt-starters/prompt-starters.js +206 -0
- package/src/components/prose/prose.js +14 -10
- package/src/components/questionnaire/conditions.js +666 -0
- package/src/components/questionnaire/items.js +150 -41
- package/src/components/questionnaire/questionnaire.js +126 -32
- package/src/components/rating/rating.js +5 -4
- package/src/components/run-status/run-status.js +2 -2
- package/src/components/select/country.js +136 -0
- package/src/components/select/field-adapter.js +7 -2
- package/src/components/select/locale.js +219 -0
- package/src/components/select/select.css +20 -22
- package/src/components/select/select.js +94 -12
- package/src/components/sheet/sheet-stack.js +10 -1
- package/src/components/slider/slider.js +7 -2
- package/src/components/sort-control/sort-control.js +15 -5
- package/src/components/source-list/source-list.js +7 -4
- package/src/components/split-view/split-view.js +5 -3
- package/src/components/surface/catalog.js +1334 -0
- package/src/components/surface/elicit.js +107 -0
- package/src/components/surface/mcp.js +243 -0
- package/src/components/surface/schema.js +644 -0
- package/src/components/surface/stream.js +245 -0
- package/src/components/surface/surface.css +308 -0
- package/src/components/surface/surface.js +2291 -0
- package/src/components/surface/text.js +513 -0
- package/src/components/surface/validate.js +2218 -0
- package/src/components/tabbox/tabbox.js +9 -0
- package/src/components/table/table.css +63 -3
- package/src/components/table/table.js +167 -28
- package/src/components/table/window.js +317 -0
- package/src/components/toolbar/toolbar.js +12 -7
- package/src/components/tooltip/tooltip.css +2 -3
- package/src/components/tooltip/tooltip.js +32 -5
- package/src/components/tree/tree.js +53 -23
- package/src/core/component.js +25 -1
- package/src/core/date.js +62 -16
- package/src/core/dom.js +22 -2
- package/src/core/format.js +15 -13
- package/src/core/http.js +29 -20
- package/src/core/i18n.js +83 -10
- package/src/core/keyboard.js +79 -8
- package/src/core/messages.js +376 -2
- package/src/core/overlay-host.js +1 -0
- package/src/core/storage.js +59 -6
- package/src/elements/define.js +178 -130
- package/src/elements/definitions.js +229 -0
- package/src/elements/kit.js +444 -0
- package/src/elements/reflect.js +8 -3
- package/src/index.js +10 -1
- package/src/internal/date-locale.js +11 -0
- package/src/internal/json-patch.js +405 -0
- package/src/locales/de.js +911 -0
- package/src/locales/en.js +2 -0
- package/src/locales/index.js +7 -0
- package/src/zeyos/calendar.js +2 -1
- package/src/zeyos/form.js +2 -1
- package/src/zeyos/launcher.js +7 -6
- package/src/zeyos/module-bar.js +2 -1
- package/src/zeyos/schema.js +37 -23
- package/src/zeyos/select.js +4 -3
- package/src/zeyos/table.js +2 -13
- package/src/zeyos/view.js +57 -17
- package/styles/core.css +11 -0
- package/styles/tokens/semantic.css +1 -0
- package/styles/zeyos.css +2 -0
- package/styles/zx.css +4 -8
- package/styles/zx.layered.css +1 -0
package/docs/llms.txt
CHANGED
|
@@ -12,11 +12,26 @@ Subscribe with `.on(type, fn)` or an `on<type>` option; handlers receive a `Cust
|
|
|
12
12
|
`.detail` is an object. Call `.destroy()` to clean up. The same API is available as ESM named
|
|
13
13
|
exports and as `window.zx.*`.
|
|
14
14
|
|
|
15
|
+
## Optional integration requirements
|
|
16
|
+
|
|
17
|
+
Zx has no package runtime dependencies and its source modules import no external runtime packages.
|
|
18
|
+
Optional integrations still need application-provided assets or clients. `Chart` requires an injected
|
|
19
|
+
renderer; the only supplied renderer, `ChartJsAdapter`, requires Chart.js 4 supplied by the host.
|
|
20
|
+
There is no built-in chart renderer. Chart.js 4.5.1 is pinned as a development dependency and copied
|
|
21
|
+
to the documentation site's self-hosted vendor assets during its build; it is not bundled into Zx.
|
|
22
|
+
Core icons use bundled SVG by default. Opting into Font Awesome requires host-loaded CSS or a kit.
|
|
23
|
+
ZeyOS `moduleIcon()`, `moduleChip()`, and `zeyosAppIcon()` default to glyphs from the external custom
|
|
24
|
+
ZeyOS Font Awesome kit; `standard: true` still needs stock Font Awesome assets. `ZeyOS.connect()`
|
|
25
|
+
requires an injected compatible client and never imports the client package.
|
|
26
|
+
|
|
15
27
|
## Documentation
|
|
16
|
-
- [Documentation site](https://zx.zeyos.com/docs.html):
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
28
|
+
- [Documentation site](https://zx.zeyos.com/docs.html): supported APIs, live demos, and example source.
|
|
29
|
+
- [Locales guide](https://zx.zeyos.com/docs.html#getting-started/locales): add languages, regional catalogues, custom message keys, interpolation variables, plurals, and formatting options.
|
|
30
|
+
- [README](https://zx.zeyos.com/README.md): installation, component index, theming, and browser support.
|
|
31
|
+
- [API reference](https://zx.zeyos.com/docs/llms.md): options, methods, events, and core helpers.
|
|
32
|
+
- [Surface guide](https://zx.zeyos.com/docs/agent-surfaces.md): agent-authored surfaces and their reply contract.
|
|
33
|
+
- [Component catalogue](https://zx.zeyos.com/docs/agent-catalog.json): machine-readable surface component schemas.
|
|
34
|
+
- [Changelog](https://zx.zeyos.com/CHANGELOG.md): supported changes and upgrade notes.
|
|
20
35
|
|
|
21
36
|
## Start here: choosing
|
|
22
37
|
- Start every screen from the closest **layout**, never from a blank page. Gallery:
|
|
@@ -42,7 +57,8 @@ exports and as `window.zx.*`.
|
|
|
42
57
|
- Inputs: `button()`, `buttonGroup()`, `badge()`/`badgeGroup()`, `CheckButton`,
|
|
43
58
|
`Toggle`, `Search`,
|
|
44
59
|
`Select` (APG combobox; `filter: false|'local'|async`; priority, status, permission, and
|
|
45
|
-
`Select.entity()`
|
|
60
|
+
`Select.entity()`, `Select.locale()`, and `Select.country()` presets; locale and ISO country choices are
|
|
61
|
+
`Intl`-named, with `flag()` emoji, code chip, or app-served flag images), `Checklist`, `TagPicker` (icon/color identity), `NumberField`, `Rating`, `Slider`,
|
|
46
62
|
`copyButton()`/`CopyInput`, `DatePicker`, `MonthPicker`, `TimePicker`,
|
|
47
63
|
`Datebox`/`DateTimeBox`, `DateRangePicker`/`DateRangeBox`, `Timebox`.
|
|
48
64
|
- 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()`.
|
|
@@ -51,7 +67,7 @@ exports and as `window.zx.*`.
|
|
|
51
67
|
`Table` (sortable, selectable, sticky header, opt-in inline cell/row editing, row reorder,
|
|
52
68
|
column visibility), shared `RecordView` state through `TableView`, `CardView`, and `KanbanView`,
|
|
53
69
|
`Grid` with single-click editing and `Grid.BillingItems()`, engine-neutral
|
|
54
|
-
`Chart`
|
|
70
|
+
`Chart` requiring an injected renderer (`ChartJsAdapter` requires host-provided Chart.js 4), `Calendar` (agenda/day/week/month/year, pointer/keyboard
|
|
55
71
|
drag and resize, `optimistic: true|false`), backend-neutral nested `Filter`, simple client-side
|
|
56
72
|
`DataFilter`, `FilterPanel` (typed filter form built from a server's own field metadata;
|
|
57
73
|
`mode: 'draft'|'live'`, `serialize`), `ListToolbar` (search, live result count, view switch, and
|
|
@@ -83,10 +99,15 @@ exports and as `window.zx.*`.
|
|
|
83
99
|
`RunTrace` (the steps a run took: tool calls with arguments and results, retries, hand-offs),
|
|
84
100
|
`ApprovalCard` (a request that holds a run: approve, edit, reject, typed confirmation),
|
|
85
101
|
`SourceList` (cited sources with a card each; nothing remote is loaded), `Composer` (the message
|
|
86
|
-
box: mentions, `/` commands, attachments, context chips, Send that becomes Stop), `
|
|
87
|
-
|
|
102
|
+
box: mentions, `/` commands, attachments, context chips, Send that becomes Stop), `PromptStarters`
|
|
103
|
+
(starting points for an empty conversation; a pick is reported, never sent), `RunStatus` (a run's
|
|
104
|
+
state, steps, working time, tokens, and a cost meter against a budget), `Surface` (a surface an
|
|
105
|
+
agent composed as JSON, validated and drawn with library components; it ends in exactly one reply
|
|
106
|
+
and stays as its receipt), `openSurface()`, `elicit()` (a form-mode elicitation as a dialog),
|
|
107
|
+
`surfaceText()` (a reply's receipt as plain text).
|
|
88
108
|
- 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).
|
|
89
|
-
- Helpers: `formatNumber`/`formatCurrency`/`formatPercent`/`formatFileSize`/`formatRelativeTime` (locale-aware, cached `Intl`), `debounce`/`throttle`, `groupBy`/`sortBy`/`uniqueBy`, `escapeRegExp`/`highlightMatch`, `storage()` (
|
|
109
|
+
- Helpers: `formatNumber`/`formatCurrency`/`formatPercent`/`formatFileSize`/`formatRelativeTime` (locale-aware, cached `Intl`), `translatePlural(key, count, args, options)` and `Component.msgPlural(key, count, ...args)` (explicit count, cardinal forms), `debounce`/`throttle`, `groupBy`/`sortBy`/`uniqueBy`, `escapeRegExp`/`highlightMatch`, `storage()` (unambiguous namespaces, explicit `migrateLegacy(keys)`, degrades to memory), `toCsv`/`downloadBlob`/`copyToClipboard`, `truncate()`/`isTruncated()` (line clamp with the full value on hover).
|
|
110
|
+
- Locales: `locales/en.js`, `locales/de.js`, and opt-in `locales/index.js`; explicit locale, then active language, then English for formatting. ZeyOS module colours are opt-in through `styles/zeyos.css`.
|
|
90
111
|
|
|
91
112
|
## Theming
|
|
92
113
|
Load `zx.css` once; set `data-zx-theme` (`light`|`dark`|`auto`) on any ancestor. There is one geometry: spacing steps are multiples of `--zx-space-unit` (4px), radius steps are fractions of `--zx-radius` (4px: 2/3/4/6px), and controls are `--zx-control-height` (30px) tall — override those to tighten or loosen an application. Define a product theme by overriding semantic `--zx-color-*` / `--zx-control-*` tokens under `[data-zx-theme="name"]`. The theme studio controls accent, neutral tint, spacing, font, type size, radius, control height, and the CSS-first material: Glass (the default, a thin lit pane), Deep glass, Frost (milk glass), Smoke (tinted), Paper, Satin and Enamel (opaque, no blur), or Flat — each a token-override recipe composed from the theme's glass ingredients (`--zx-color-glass-rim/-ring/-lift/-shade/-edge/-tint`). Compact menus, pickers, tooltips, column menus, and toasts share responsive compact glass; Launcher, Modal, Dialog, and floating Sheets share a calmer reading panel. Both preserve scoped theme inheritance and refract Aurora/page content; docked Sheets and dense data surfaces remain opaque. Never use tier-1 palette tokens or raw color literals in application CSS.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeyos/zx",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"description": "Dependency-free JavaScript implementation of the Xenon Design System.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,12 @@
|
|
|
25
25
|
"sideEffects": [
|
|
26
26
|
"*.css",
|
|
27
27
|
"./dist/zx.global.js",
|
|
28
|
-
"./dist/zx.global.min.js"
|
|
28
|
+
"./dist/zx.global.min.js",
|
|
29
|
+
"./src/index.js",
|
|
30
|
+
"./dist/zx.esm.js",
|
|
31
|
+
"./dist/zx.esm.min.js",
|
|
32
|
+
"./dist/zx-zeyos.esm.js",
|
|
33
|
+
"./dist/zx-zeyos.esm.min.js"
|
|
29
34
|
],
|
|
30
35
|
"exports": {
|
|
31
36
|
".": {
|
|
@@ -42,10 +47,18 @@
|
|
|
42
47
|
},
|
|
43
48
|
"./zx.css": "./dist/zx.css",
|
|
44
49
|
"./zx.min.css": "./dist/zx.min.css",
|
|
50
|
+
"./zx.core.css": "./dist/zx.core.css",
|
|
51
|
+
"./zx.core.min.css": "./dist/zx.core.min.css",
|
|
52
|
+
"./zx.layered.css": "./dist/zx.layered.css",
|
|
45
53
|
"./src/components/*.js": {
|
|
46
54
|
"types": "./dist/types/components/*.d.ts",
|
|
47
55
|
"default": "./src/components/*.js"
|
|
48
56
|
},
|
|
57
|
+
"./locales/*.js": {
|
|
58
|
+
"types": "./dist/types/locales/*.d.ts",
|
|
59
|
+
"default": "./src/locales/*.js"
|
|
60
|
+
},
|
|
61
|
+
"./src/components/*.css": "./src/components/*.css",
|
|
49
62
|
"./styles/*": "./styles/*",
|
|
50
63
|
"./dist/*": "./dist/*",
|
|
51
64
|
"./package.json": "./package.json"
|
|
@@ -53,9 +66,13 @@
|
|
|
53
66
|
"main": "./dist/zx.esm.js",
|
|
54
67
|
"module": "./dist/zx.esm.js",
|
|
55
68
|
"style": "./dist/zx.css",
|
|
69
|
+
"bin": {
|
|
70
|
+
"zx-css": "bin/zx-css.js"
|
|
71
|
+
},
|
|
56
72
|
"files": [
|
|
57
73
|
"dist",
|
|
58
74
|
"dist/types",
|
|
75
|
+
"bin",
|
|
59
76
|
"styles",
|
|
60
77
|
"src",
|
|
61
78
|
"!src/compat",
|
|
@@ -63,6 +80,8 @@
|
|
|
63
80
|
"docs/llms.md",
|
|
64
81
|
"docs/llms.txt",
|
|
65
82
|
"docs/api.json",
|
|
83
|
+
"docs/agent-surfaces.md",
|
|
84
|
+
"docs/agent-catalog.json",
|
|
66
85
|
"CHANGELOG.md",
|
|
67
86
|
"README.md",
|
|
68
87
|
"LICENSE"
|
|
@@ -77,18 +96,22 @@
|
|
|
77
96
|
"serve": "node tools/serve.js",
|
|
78
97
|
"serve:site": "SERVE_ROOT=site node tools/serve.js",
|
|
79
98
|
"build": "node tools/build.js",
|
|
99
|
+
"check:size": "node tools/build.js && node tools/check-size.js",
|
|
80
100
|
"build:site": "node tools/build-api.js && node tools/build-site.js",
|
|
81
101
|
"test": "node --test && node tests/lint-tokens.js",
|
|
82
102
|
"prepublishOnly": "npm test && npm run build",
|
|
83
103
|
"build:api": "node tools/build-api.js",
|
|
104
|
+
"build:catalog": "node tools/build-agent-catalog.js",
|
|
84
105
|
"build:types": "tsc --project tsconfig.json",
|
|
85
|
-
"test:browser": "node tools/run-smoke.js"
|
|
106
|
+
"test:browser": "node tools/run-regressions.js && node tools/run-smoke.js",
|
|
107
|
+
"test:visual": "node tools/visual-diff.js",
|
|
108
|
+
"bench:table": "node tools/bench-table.js"
|
|
86
109
|
},
|
|
87
110
|
"devDependencies": {
|
|
88
111
|
"chart.js": "4.5.1",
|
|
89
|
-
"esbuild": "
|
|
90
|
-
"playwright-core": "
|
|
91
|
-
"typescript": "
|
|
112
|
+
"esbuild": "0.28.1",
|
|
113
|
+
"playwright-core": "1.62.1",
|
|
114
|
+
"typescript": "7.0.2"
|
|
92
115
|
},
|
|
93
116
|
"types": "./dist/types/index.d.ts"
|
|
94
117
|
}
|
|
@@ -19,7 +19,8 @@ import { MenuButton } from '../menu-button/menu-button.js';
|
|
|
19
19
|
* @property {AccountIdentity} [account={}] Account presentation supplied by the application.
|
|
20
20
|
* @property {MenuButtonItem[]} [items=[]] Account actions and `'-'` separators.
|
|
21
21
|
* @property {boolean} [compact=false] Whether only the avatar is visually shown in the trigger.
|
|
22
|
-
* @property {string|null} [label=null] Trigger label;
|
|
22
|
+
* @property {string|null} [label=null] Trigger label; null reads the `accountMenu.labelFor` message
|
|
23
|
+
* ("Account menu for <name>"), or `accountMenu.label` without a name.
|
|
23
24
|
* @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'|'right-start'|'right-end'|'left-start'|'left-end'|'right'|'left'} [placement='top-start'] Popup placement.
|
|
24
25
|
* @property {(event: CustomEvent<{value: unknown, item: object}>) => void} [onselect] Preventable action listener.
|
|
25
26
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open listener.
|
|
@@ -174,7 +175,9 @@ export class AccountMenu extends Component {
|
|
|
174
175
|
this.refs.secondary.hidden = !this._account.secondary;
|
|
175
176
|
const hasStatus = ['online', 'away', 'busy', 'offline'].includes(this._account.status);
|
|
176
177
|
const status = hasStatus && this._account.statusLabel ? `, ${this._account.statusLabel}` : '';
|
|
177
|
-
const
|
|
178
|
+
const name = this._account.name
|
|
179
|
+
? this.msg('accountMenu.labelFor', this._account.name) : this.msg('accountMenu.label');
|
|
180
|
+
const label = this.options.label || `${name}${status}`;
|
|
178
181
|
this.refs.trigger.setAttribute('aria-label', label);
|
|
179
182
|
this._renderPanelHeader();
|
|
180
183
|
}
|
|
@@ -187,7 +190,7 @@ export class AccountMenu extends Component {
|
|
|
187
190
|
class: 'zx-account-menu__panel-identity',
|
|
188
191
|
role: 'presentation'
|
|
189
192
|
},
|
|
190
|
-
h('strong', {}, this._account.name || '
|
|
193
|
+
h('strong', {}, this._account.name || this.msg('accountMenu.fallback')),
|
|
191
194
|
this._account.secondary ? h('span', {}, this._account.secondary) : null));
|
|
192
195
|
}
|
|
193
196
|
}
|
|
@@ -7,6 +7,7 @@ import { isElement, uid } from '../../core/util.js';
|
|
|
7
7
|
import { Avatar } from '../avatar/avatar.js';
|
|
8
8
|
import { badge } from '../badge/badge.js';
|
|
9
9
|
import { button } from '../button/button.js';
|
|
10
|
+
import { dateLocale } from '../../internal/date-locale.js';
|
|
10
11
|
|
|
11
12
|
/** @typedef {string|number|Node|Component|null} ActivityContent */
|
|
12
13
|
/** @typedef {import('../avatar/avatar.js').AvatarOptions} AvatarOptions */
|
|
@@ -586,7 +587,7 @@ function normalizeHeadingLevel(value) {
|
|
|
586
587
|
/** @param {Date} date @returns {string} */
|
|
587
588
|
function formatActivityDate(date) {
|
|
588
589
|
try {
|
|
589
|
-
return new Intl.DateTimeFormat(
|
|
590
|
+
return new Intl.DateTimeFormat(dateLocale(), {
|
|
590
591
|
dateStyle: 'medium', timeStyle: 'short'
|
|
591
592
|
}).format(date);
|
|
592
593
|
} catch {
|
|
@@ -29,13 +29,16 @@ import { ActivityItem } from '../activity-item/activity-item.js';
|
|
|
29
29
|
* @property {ActivityItemOptions[]} [items=[]] Initial activities in host-supplied chronological order.
|
|
30
30
|
* @property {ActivityGroupReader} [groupBy=null] Property or resolver used for stable grouping.
|
|
31
31
|
* @property {ActivityGroupLabel|null} [groupLabel=null] Group-heading renderer.
|
|
32
|
-
* @property {string} [label=
|
|
32
|
+
* @property {string|null} [label=null] Accessible collection name; null reads the
|
|
33
|
+
* `activityList.label` message ("Activity").
|
|
33
34
|
* @property {ActivityListVariant} [variant='default'] Entry layout, reflected as `data-variant` on
|
|
34
35
|
* the root. `'compact'` also makes an avatar descriptor without a `size` small.
|
|
35
36
|
* @property {boolean} [loading=false] Whether initial or incremental activity is loading.
|
|
36
37
|
* @property {number} [loadingCount=3] Placeholder rows shown for an empty loading list.
|
|
37
|
-
* @property {string} [loadingText
|
|
38
|
-
*
|
|
38
|
+
* @property {string|null} [loadingText] Loading status text, by default the `activityList.loading`
|
|
39
|
+
* message ("Loading activity"). Null shows none.
|
|
40
|
+
* @property {ActivityListContent} [emptyText] Empty-state content, by default the
|
|
41
|
+
* `activityList.empty` message ("No activity yet"). Null shows none.
|
|
39
42
|
* @property {1|2|3|4|5|6} [groupHeadingLevel=2] Semantic group-heading level.
|
|
40
43
|
* @property {1|2|3|4|5|6} [itemHeadingLevel=3] Default item-heading level.
|
|
41
44
|
* @property {(event:CustomEvent<{items:ActivityItemOptions[]}>)=>void} [ondatachange]
|
|
@@ -57,12 +60,13 @@ export class ActivityList extends Component {
|
|
|
57
60
|
items: [],
|
|
58
61
|
groupBy: null,
|
|
59
62
|
groupLabel: null,
|
|
60
|
-
label:
|
|
63
|
+
label: null,
|
|
61
64
|
variant: 'default',
|
|
62
65
|
loading: false,
|
|
63
66
|
loadingCount: 3,
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
// Undefined rather than null, which shows nothing.
|
|
68
|
+
loadingText: undefined,
|
|
69
|
+
emptyText: undefined,
|
|
66
70
|
groupHeadingLevel: 2,
|
|
67
71
|
itemHeadingLevel: 3
|
|
68
72
|
};
|
|
@@ -88,7 +92,7 @@ export class ActivityList extends Component {
|
|
|
88
92
|
this._loading = Boolean(this.options.loading);
|
|
89
93
|
this._itemComponents = [];
|
|
90
94
|
this._groupSequence = 0;
|
|
91
|
-
root.setAttribute('aria-label', String(this.options.label || '
|
|
95
|
+
root.setAttribute('aria-label', String(this.options.label || this.msg('activityList.label')));
|
|
92
96
|
this._variant = normalizeActivityListVariant(this.options.variant);
|
|
93
97
|
if (this._variant === 'compact') root.dataset.variant = 'compact';
|
|
94
98
|
try {
|
|
@@ -249,9 +253,10 @@ export class ActivityList extends Component {
|
|
|
249
253
|
const grouped = groupBy !== null;
|
|
250
254
|
for (const group of groups) content.push(this._createGroup(group, grouped));
|
|
251
255
|
} else if (!this._loading) {
|
|
256
|
+
const { emptyText = this.msg('activityList.empty') } = this.options;
|
|
252
257
|
content.push(h('div', {
|
|
253
258
|
class: 'zx-activity-list__empty', role: 'status'
|
|
254
|
-
}, listContent(
|
|
259
|
+
}, listContent(emptyText, 'ActivityList emptyText')));
|
|
255
260
|
}
|
|
256
261
|
if (this._loading) content.push(this._createLoading(this._items.length === 0));
|
|
257
262
|
root.replaceChildren(...content);
|
|
@@ -278,7 +283,7 @@ export class ActivityList extends Component {
|
|
|
278
283
|
const headingId = uid(`zx-activity-list-group-${this._groupSequence}`);
|
|
279
284
|
const label = this.options.groupLabel
|
|
280
285
|
? this.options.groupLabel(group.id, group.items.map(cloneActivityDescriptor))
|
|
281
|
-
: String(group.id ?? '
|
|
286
|
+
: String(group.id ?? this.msg('activityList.other'));
|
|
282
287
|
list.setAttribute('aria-labelledby', headingId);
|
|
283
288
|
return h('section', { class: 'zx-activity-list__group', ariaLabelledby: headingId },
|
|
284
289
|
h(`h${normalizeHeadingLevel(this.options.groupHeadingLevel, 2)}`, {
|
|
@@ -288,9 +293,10 @@ export class ActivityList extends Component {
|
|
|
288
293
|
|
|
289
294
|
/** @private @param {boolean} placeholders @returns {HTMLElement} */
|
|
290
295
|
_createLoading(placeholders) {
|
|
296
|
+
const { loadingText = this.msg('activityList.loading') } = this.options;
|
|
291
297
|
const region = h('div', {
|
|
292
298
|
class: 'zx-activity-list__loading', role: 'status', ariaLive: 'polite'
|
|
293
|
-
}, h('span', { class: 'zx-activity-list__loading-label' }, String(
|
|
299
|
+
}, h('span', { class: 'zx-activity-list__loading-label' }, String(loadingText ?? '')));
|
|
294
300
|
if (!placeholders) return region;
|
|
295
301
|
const rows = h('div', { class: 'zx-activity-list__skeletons', ariaHidden: 'true' });
|
|
296
302
|
const count = normalizeLoadingCount(this.options.loadingCount);
|