@zeyos/zx 2.3.0 → 3.0.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/DESIGN-SYSTEM.md +136 -0
  3. package/MIGRATION.md +155 -4
  4. package/README.md +24 -13
  5. package/dist/types/compat/map/data.d.ts +3 -2
  6. package/dist/types/components/account-menu/account-menu.d.ts +144 -0
  7. package/dist/types/components/app-rail/app-rail.d.ts +250 -0
  8. package/dist/types/components/app-sidebar/app-sidebar.d.ts +169 -0
  9. package/dist/types/components/avatar/avatar.d.ts +100 -0
  10. package/dist/types/components/chart/chart.d.ts +321 -0
  11. package/dist/types/components/date-picker/month-picker.d.ts +6 -0
  12. package/dist/types/components/dialog/dialog.d.ts +9 -0
  13. package/dist/types/components/dock/dock.d.ts +495 -0
  14. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  15. package/dist/types/components/field/field.d.ts +14 -0
  16. package/dist/types/components/field-upload/field-upload.d.ts +37 -4
  17. package/dist/types/components/form/form.d.ts +25 -3
  18. package/dist/types/components/grid/grid.d.ts +172 -0
  19. package/dist/types/components/launcher/launcher.d.ts +300 -0
  20. package/dist/types/components/layout/layout.d.ts +4 -4
  21. package/dist/types/components/menu-button/menu-button.d.ts +10 -2
  22. package/dist/types/components/modal/modal.d.ts +25 -0
  23. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +7 -1
  24. package/dist/types/components/questionnaire/items.d.ts +327 -0
  25. package/dist/types/components/questionnaire/questionnaire.d.ts +449 -0
  26. package/dist/types/components/sheet/sheet-stack.d.ts +167 -0
  27. package/dist/types/components/sheet/sheet.d.ts +294 -0
  28. package/dist/types/components/split-view/split-view.d.ts +2 -21
  29. package/dist/types/components/table/table.d.ts +219 -12
  30. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  31. package/dist/types/components/value-list/value-list.d.ts +24 -3
  32. package/dist/types/core/dom.d.ts +114 -0
  33. package/dist/types/core/drag-axis.d.ts +111 -0
  34. package/dist/types/core/position.d.ts +4 -2
  35. package/dist/types/index.d.ts +12 -2
  36. package/dist/zx-compat.esm.js +641 -277
  37. package/dist/zx-compat.esm.min.js +1 -1
  38. package/dist/zx-compat.global.js +7609 -2236
  39. package/dist/zx-compat.global.min.js +3 -3
  40. package/dist/zx-zeyos.esm.js +546 -87
  41. package/dist/zx-zeyos.esm.min.js +1 -1
  42. package/dist/zx.css +1452 -101
  43. package/dist/zx.esm.js +7952 -2592
  44. package/dist/zx.esm.min.js +3 -3
  45. package/dist/zx.global.js +7952 -2592
  46. package/dist/zx.global.min.js +3 -3
  47. package/dist/zx.min.css +1 -1
  48. package/docs/api.json +2276 -337
  49. package/docs/llms.md +426 -30
  50. package/docs/llms.txt +21 -9
  51. package/package.json +4 -2
  52. package/src/compat/globals.js +3 -1
  53. package/src/compat/map/data.js +31 -9
  54. package/src/components/account-menu/account-menu.css +70 -0
  55. package/src/components/account-menu/account-menu.js +208 -0
  56. package/src/components/app-rail/app-rail.css +107 -0
  57. package/src/components/app-rail/app-rail.js +668 -0
  58. package/src/components/app-sidebar/app-sidebar.css +68 -0
  59. package/src/components/app-sidebar/app-sidebar.js +388 -0
  60. package/src/components/avatar/avatar.css +61 -0
  61. package/src/components/avatar/avatar.js +222 -0
  62. package/src/components/button/button.css +0 -1
  63. package/src/components/chart/chart.css +61 -0
  64. package/src/components/chart/chart.js +518 -0
  65. package/src/components/date-picker/month-picker.js +9 -0
  66. package/src/components/dialog/dialog.js +11 -4
  67. package/src/components/dock/dock.css +228 -0
  68. package/src/components/dock/dock.js +977 -0
  69. package/src/components/dropdown/dropdown.js +1 -1
  70. package/src/components/field/field.js +2 -0
  71. package/src/components/field-upload/field-upload.js +9 -4
  72. package/src/components/form/form.js +6 -3
  73. package/src/components/grid/grid.css +6 -0
  74. package/src/components/grid/grid.js +213 -0
  75. package/src/components/launcher/launcher.css +100 -0
  76. package/src/components/launcher/launcher.js +557 -0
  77. package/src/components/layout/layout.js +2 -2
  78. package/src/components/menu-button/menu-button.js +27 -2
  79. package/src/components/modal/modal.css +5 -1
  80. package/src/components/modal/modal.js +37 -2
  81. package/src/components/multi-value-editor/multi-value-editor.js +2 -1
  82. package/src/components/questionnaire/items.js +370 -0
  83. package/src/components/questionnaire/questionnaire.css +387 -0
  84. package/src/components/questionnaire/questionnaire.js +1033 -0
  85. package/src/components/select/select.css +0 -1
  86. package/src/components/sheet/sheet-stack.js +304 -0
  87. package/src/components/sheet/sheet.css +351 -0
  88. package/src/components/sheet/sheet.js +551 -0
  89. package/src/components/split-view/split-view.js +76 -161
  90. package/src/components/table/table.css +43 -0
  91. package/src/components/table/table.js +523 -45
  92. package/src/components/tooltip/tooltip.js +5 -2
  93. package/src/components/value-list/value-list.js +6 -3
  94. package/src/core/dom.js +302 -0
  95. package/src/core/drag-axis.js +203 -0
  96. package/src/core/position.js +68 -22
  97. package/src/index.js +19 -2
  98. package/styles/tokens/dark.css +2 -3
  99. package/styles/tokens/global.css +5 -5
  100. package/styles/tokens/semantic.css +5 -3
  101. package/styles/tokens/themes.css +1 -1
  102. package/styles/zx.css +10 -1
  103. package/dist/types/components/permission/permission.d.ts +0 -96
  104. package/src/components/permission/permission.css +0 -47
  105. package/src/components/permission/permission.js +0 -201
@@ -0,0 +1,111 @@
1
+ /** Pixels an arrow key moves a handle. */
2
+ export declare const STEP = 16;
3
+ /** Pixels a shifted arrow key moves a handle. */
4
+ export declare const STEP_LARGE = 64;
5
+ export type DragAxisOptions = {
6
+ /**
7
+ * Axis the handle moves along. `horizontal` reads
8
+ * `clientX`, `vertical` reads `clientY`.
9
+ */
10
+ orientation: 'horizontal' | 'vertical';
11
+ /**
12
+ * Called on pointer-down before the
13
+ * drag begins. Return `false` to refuse it — the usual reason being that there is nothing to
14
+ * resize on either side of the handle.
15
+ */
16
+ onStart?: (event: PointerEvent) => boolean | void;
17
+ /**
18
+ * Called at most once per frame with the signed pixel
19
+ * distance travelled along the axis since pointer-down.
20
+ */
21
+ onMove: (delta: number) => void;
22
+ /**
23
+ * Called once the pointer is released.
24
+ * `moved` is false for a press that never travelled, which is a click rather than a drag.
25
+ */
26
+ onEnd?: (delta: number, moved: boolean) => void;
27
+ /**
28
+ * Called for an arrow key along the
29
+ * axis. `large` is true while Shift is held.
30
+ */
31
+ onStep?: (direction: -1 | 1, large: boolean) => void;
32
+ /**
33
+ * Called for Home and End.
34
+ */
35
+ onJump?: (edge: 'min' | 'max') => void;
36
+ /**
37
+ * Called for Enter and Space, which components use for the
38
+ * collapse affordance a splitter is expected to offer.
39
+ */
40
+ onActivate?: () => void;
41
+ /**
42
+ * Consulted before every interaction.
43
+ */
44
+ disabled?: () => boolean;
45
+ };
46
+ export type DragAxisController = {
47
+ /**
48
+ * Whether a drag is in flight.
49
+ */
50
+ isDragging: () => boolean;
51
+ /**
52
+ * Ends any drag in flight without reporting it.
53
+ */
54
+ cancel: () => void;
55
+ /**
56
+ * Removes listeners and cancels any drag in flight.
57
+ */
58
+ destroy: () => void;
59
+ };
60
+ /**
61
+ * @typedef {Object} DragAxisOptions
62
+ * @property {'horizontal'|'vertical'} orientation Axis the handle moves along. `horizontal` reads
63
+ * `clientX`, `vertical` reads `clientY`.
64
+ * @property {(event: PointerEvent) => boolean|void} [onStart] Called on pointer-down before the
65
+ * drag begins. Return `false` to refuse it — the usual reason being that there is nothing to
66
+ * resize on either side of the handle.
67
+ * @property {(delta: number) => void} onMove Called at most once per frame with the signed pixel
68
+ * distance travelled along the axis since pointer-down.
69
+ * @property {(delta: number, moved: boolean) => void} [onEnd] Called once the pointer is released.
70
+ * `moved` is false for a press that never travelled, which is a click rather than a drag.
71
+ * @property {(direction: -1|1, large: boolean) => void} [onStep] Called for an arrow key along the
72
+ * axis. `large` is true while Shift is held.
73
+ * @property {(edge: 'min'|'max') => void} [onJump] Called for Home and End.
74
+ * @property {() => void} [onActivate] Called for Enter and Space, which components use for the
75
+ * collapse affordance a splitter is expected to offer.
76
+ * @property {() => boolean} [disabled] Consulted before every interaction.
77
+ */
78
+ /**
79
+ * @typedef {Object} DragAxisController
80
+ * @property {() => boolean} isDragging Whether a drag is in flight.
81
+ * @property {() => void} cancel Ends any drag in flight without reporting it.
82
+ * @property {() => void} destroy Removes listeners and cancels any drag in flight.
83
+ */
84
+ /**
85
+ * Pointer and keyboard mechanics for anything dragged along one axis — a split divider, a dock
86
+ * divider, the resizable edge of a sheet.
87
+ *
88
+ * Deliberately knows nothing about sizes. It reports the signed distance travelled and leaves
89
+ * every consumer to do its own arithmetic, because the three that need it disagree about what a
90
+ * drag means: a split view moves one boundary, a dock moves size between two neighbours, and a
91
+ * sheet grows in the opposite direction depending on which edge it is attached to. What they do
92
+ * share is the fiddly part — pointer capture that survives the pointer leaving the handle, one
93
+ * write per frame however fast the pointer reports, telling a click apart from a zero-distance
94
+ * drag, and the WAI-ARIA keyboard map.
95
+ *
96
+ * @param {Element} handle Element the pointer grabs; also the keyboard target.
97
+ * @param {DragAxisOptions} options Axis and callbacks.
98
+ * @returns {DragAxisController}
99
+ */
100
+ export declare function dragAxis(handle: Element, options: DragAxisOptions): DragAxisController;
101
+ /**
102
+ * Resolves a size option to pixels without touching the DOM.
103
+ *
104
+ * Numbers, bare numeric strings, and `px` lengths are pixels; a percentage resolves against
105
+ * `total`. Every other CSS length — `rem`, `vh`, `calc()` — needs the browser, so it returns `NaN`
106
+ * and the caller hands the value to CSS instead of guessing at it.
107
+ * @param {number|string} value Size option.
108
+ * @param {number} total Container size along the split axis, in pixels.
109
+ * @returns {number} Pixels, or `NaN` when only the browser can resolve the value.
110
+ */
111
+ export declare function resolveSize(value: number | string, total: number): number;
@@ -1,5 +1,6 @@
1
+ export type Placement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top' | 'right-start' | 'right-end' | 'left-start' | 'left-end' | 'right' | 'left';
1
2
  export type PositionOptions = {
2
- placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top';
3
+ placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top' | 'right-start' | 'right-end' | 'left-start' | 'left-end' | 'right' | 'left';
3
4
  /**
4
5
  * Gap between anchor and floating element.
5
6
  */
@@ -23,9 +24,10 @@ export type PositionController = {
23
24
  */
24
25
  destroy: () => void;
25
26
  };
27
+ /** @typedef {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'|'right-start'|'right-end'|'left-start'|'left-end'|'right'|'left'} Placement */
26
28
  /**
27
29
  * @typedef {Object} PositionOptions
28
- * @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'} [placement='bottom-start']
30
+ * @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'|'right-start'|'right-end'|'left-start'|'left-end'|'right'|'left'} [placement='bottom-start']
29
31
  * @property {number} [offset=4] Gap between anchor and floating element.
30
32
  * @property {boolean} [flip=true] Flip vertically when the preferred side overflows.
31
33
  * @property {boolean} [matchWidth=false] Set the floating element's minimum width to the anchor width.
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export declare function registerFieldAdapters(): void;
10
10
  export { Component } from './core/component.js';
11
- export { h, htmlEscape, resolveElement, highlightMatch } from './core/dom.js';
11
+ export { h, htmlEscape, resolveElement, highlightMatch, __, compactElement, fragment, parseCompactTag, applyCompactProperties, appendContent, appendCompact, appendCompactChild, onCompactEvent, offCompactEvent, fireCompactEvent } from './core/dom.js';
12
12
  export { position } from './core/position.js';
13
13
  export { breakpoints, breakpointOf, matchBreakpoint, onBreakpoint } from './core/breakpoint.js';
14
14
  export { Http, zeyosService, parseResult } from './core/http.js';
@@ -40,15 +40,23 @@ export { Groupbox } from './components/groupbox/groupbox.js';
40
40
  export { Panel } from './components/panel/panel.js';
41
41
  export { MasterPanel } from './components/master-panel/master-panel.js';
42
42
  export { SplitView, clampSize, resolveSize, snapSize } from './components/split-view/split-view.js';
43
+ export { Dock } from './components/dock/dock.js';
43
44
  export { Tabbox } from './components/tabbox/tabbox.js';
44
45
  export { NavigationBar } from './components/navigation-bar/navigation-bar.js';
45
46
  export { Stepper } from './components/stepper/stepper.js';
46
47
  export { Breadcrumb } from './components/breadcrumb/breadcrumb.js';
47
48
  export { Pagination, paginationRange } from './components/pagination/pagination.js';
48
49
  export { Search } from './components/search/search.js';
50
+ export { Launcher, rankLauncherItems } from './components/launcher/launcher.js';
51
+ export { Avatar, avatarInitials } from './components/avatar/avatar.js';
52
+ export { AccountMenu } from './components/account-menu/account-menu.js';
53
+ export { AppRail, normalizeAppItems } from './components/app-rail/app-rail.js';
54
+ export { AppSidebar } from './components/app-sidebar/app-sidebar.js';
49
55
  export { Message } from './components/message/message.js';
50
56
  export { Modal } from './components/modal/modal.js';
51
57
  export { Dialog } from './components/dialog/dialog.js';
58
+ export { Sheet } from './components/sheet/sheet.js';
59
+ export { SheetStack } from './components/sheet/sheet-stack.js';
52
60
  export { Dropdown } from './components/dropdown/dropdown.js';
53
61
  export { Tooltip, tooltip, describe } from './components/tooltip/tooltip.js';
54
62
  export { MenuButton } from './components/menu-button/menu-button.js';
@@ -59,7 +67,6 @@ export { TagPicker } from './components/tag-picker/tag-picker.js';
59
67
  export { NumberField, parseNumber, snapNumber } from './components/number-field/number-field.js';
60
68
  export { Rating } from './components/rating/rating.js';
61
69
  export { Slider, stepPrecision } from './components/slider/slider.js';
62
- export { Permission } from './components/permission/permission.js';
63
70
  export { DatePicker } from './components/date-picker/date-picker.js';
64
71
  export { MonthPicker } from './components/date-picker/month-picker.js';
65
72
  export { TimePicker } from './components/date-picker/time-picker.js';
@@ -68,12 +75,15 @@ export { DateRangePicker, clampRange, defaultDateRangePresets, normalizeRange, r
68
75
  export { DateRangeBox, formatRangeText, parseRangeText } from './components/datebox/date-range-box.js';
69
76
  export { Timebox, splitTime, joinTime } from './components/timebox/timebox.js';
70
77
  export { Table } from './components/table/table.js';
78
+ export { Grid, billingColumns, isBillingLine } from './components/grid/grid.js';
79
+ export { Chart, ChartJsAdapter, chartSummaryTable, cloneChartValue, isEmptyChartData } from './components/chart/chart.js';
71
80
  export { TreeView } from './components/tree/tree.js';
72
81
  export { Finder } from './components/finder/finder.js';
73
82
  export { DataFilter } from './components/data-filter/data-filter.js';
74
83
  export { Field } from './components/field/field.js';
75
84
  export { Fieldset } from './components/fieldset/fieldset.js';
76
85
  export { Form } from './components/form/form.js';
86
+ export { Questionnaire } from './components/questionnaire/questionnaire.js';
77
87
  export { ValueList } from './components/value-list/value-list.js';
78
88
  export { MultiValueEditor } from './components/multi-value-editor/multi-value-editor.js';
79
89
  export { FieldUpload } from './components/field-upload/field-upload.js';