@vectoriox/iox-ui 5.85.0 → 5.86.1

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 (31) hide show
  1. package/actions-core/index.d.ts +30 -2
  2. package/design-core/index.d.ts +1488 -224
  3. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +136 -70
  4. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs +1751 -279
  6. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-forms-core.mjs +27 -4
  8. package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +223 -12
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-scene-core.mjs +3 -4
  12. package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui.mjs +1272 -69
  14. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  15. package/forms-core/index.d.ts +23 -4
  16. package/generation-core/index.d.ts +5 -1
  17. package/index.d.ts +426 -22
  18. package/package.json +1 -1
  19. package/src/actions-core/action.model.ts +1 -1
  20. package/src/actions-core/dialog-opener.ts +9 -3
  21. package/src/actions-core/element-actions.ts +25 -1
  22. package/src/actions-core/popover-opener.ts +50 -0
  23. package/src/actions-core/public-api.ts +1 -0
  24. package/src/design-core/flavor-spec.generated.ts +1750 -277
  25. package/src/forms-core/submit-lifecycle.ts +30 -3
  26. package/src/generation-core/baseline-roles.ts +1 -0
  27. package/src/generation-core/node-baselines.generated.ts +214 -8
  28. package/src/generation-core/pictures.ts +8 -4
  29. package/src/scene-core/scroll-driver.ts +2 -1
  30. package/styles/iox-design.css +216 -14
  31. package/styles/iox-forms.css +24 -2
@@ -1,6 +1,7 @@
1
1
  import { AccordionRole, CompositeItemAction, DisclosureRole, SegmentedRole, SLIDE_TO_ROW, TabsRole } from '@vectoriox/iox-ui/composite-core';
2
2
 
3
3
  import { ActionDescriptor } from './action.model';
4
+ import { POPOVER_NODE_TYPE } from './popover-opener';
4
5
 
5
6
  /** The items an item action may target: an accordion's item, or a disclosure (its own one item). */
6
7
  const ITEM_TARGET_ROLES = [AccordionRole.Item, DisclosureRole.Disclosure];
@@ -72,6 +73,26 @@ export const ELEMENT_ACTION_DESCRIPTORS: readonly ActionDescriptor[] = Object.fr
72
73
  { type: 'toggleDialog', labelKey: 'builder.actions.toggleDialog', kind: 'instant', group: 'dialog', builderBehaviour: 'run',
73
74
  target: { required: true, types: ['Dialog'] } },
74
75
 
76
+ // ── Popover (premium M5, N4): an anchored, NON-modal panel beside the element that opens it. The canvas RUNS them,
77
+ // like the dialog actions — a popover you cannot open from its button is a popover you cannot design.
78
+ { type: 'openPopover', labelKey: 'builder.actions.openPopover', kind: 'instant', group: 'popover', builderBehaviour: 'run',
79
+ target: { required: true, types: [POPOVER_NODE_TYPE] } },
80
+ { type: 'closePopover', labelKey: 'builder.actions.closePopover', kind: 'instant', group: 'popover', builderBehaviour: 'run',
81
+ target: { required: true, types: [POPOVER_NODE_TYPE] } },
82
+ { type: 'togglePopover', labelKey: 'builder.actions.togglePopover', kind: 'instant', group: 'popover', builderBehaviour: 'run',
83
+ target: { required: true, types: [POPOVER_NODE_TYPE] } },
84
+
85
+ // ── Notice (premium M5, N3): a toast at an edge of the screen — the author's words, never the visitor's. The canvas
86
+ // RUNS it inside the page's frame.
87
+ { type: 'showToast', labelKey: 'builder.actions.showToast', kind: 'instant', group: 'notice', builderBehaviour: 'run',
88
+ params: [
89
+ { name: 'text', type: 'string', label: 'builder.actions.params.toastText' },
90
+ { name: 'edge', type: 'string', label: 'builder.actions.params.toastEdge', options: [
91
+ { value: 'bottom', labelKey: 'builder.actions.params.toastBottom' },
92
+ { value: 'top', labelKey: 'builder.actions.params.toastTop' },
93
+ ] },
94
+ ] },
95
+
75
96
  // ── Item (CC2.1 — composite T14): drive an accordion item or a disclosure from anywhere ("See shipping"
76
97
  // opens FAQ item 3). The canvas RUNS them, like the dialog actions: it is the same runtime, and an item you
77
98
  // cannot open from the button is a button you cannot design.
@@ -147,6 +168,9 @@ export const SERVER_ELEMENT_ACTION_TYPES: ReadonlySet<string> =
147
168
  export const BEHAVIOUR_ACTION_TYPES: ReadonlySet<string> =
148
169
  new Set(['navigate', 'scrollTo', 'submitForm', 'copyToClipboard']);
149
170
 
171
+ /** The toast action's dispatch set (premium M5) — the engines branch on it beside DIALOG / POPOVER. */
172
+ export const TOAST_ACTION_TYPES: ReadonlySet<string> = new Set(['showToast']);
173
+
150
174
  /** The item actions' dispatch set (T14) and what each does to its item — the engines branch on it beside
151
175
  * DIALOG/BEHAVIOUR, and composite-core `runCompositeItemAction` runs it on the target item's own runtime. */
152
176
  export const ITEM_ACTION_TYPES: Readonly<Record<string, CompositeItemAction>> = Object.freeze({
@@ -172,7 +196,7 @@ export const CONSENT_ACTION_TYPES: ReadonlySet<string> =
172
196
 
173
197
  /** Picker order — most-used groups first, services last (they are the shop window, not the shop). */
174
198
  export const ELEMENT_ACTION_GROUP_ORDER: readonly string[] =
175
- Object.freeze(['motion', 'visibility', 'navigate', 'dialog', 'item', 'form', 'data', 'consent', 'service']);
199
+ Object.freeze(['motion', 'visibility', 'navigate', 'dialog', 'popover', 'notice', 'item', 'form', 'data', 'consent', 'service']);
176
200
 
177
201
  /** The catalog, grouped and ordered for the picker — one derivation, no hand-kept second list. */
178
202
  export function groupedElementActions(): ReadonlyArray<{ group: string; actions: ActionDescriptor[] }> {
@@ -0,0 +1,50 @@
1
+ import { OpenerAttribute, OpenerNodeLike, openedTargetId } from './dialog-opener';
2
+
3
+ /**
4
+ * What an element that OPENS a popover says about itself (premium components M5, N4 — the APG disclosure pattern over a
5
+ * non-modal dialog): `aria-haspopup="dialog"`, `aria-controls` = the popover's DOM id, and `aria-expanded` — `false` in
6
+ * the server render, kept in step by the runtime. ONE decision for every renderer, read the way a dialog opener is
7
+ * (`openedTargetId`); the popover's DOM id comes from `popoverDomId`, the one place that names it.
8
+ */
9
+
10
+ /** The Popover node type. */
11
+ export const POPOVER_NODE_TYPE = 'Popover';
12
+
13
+ /** The actions that open a popover (close-only actions do not make an opener). */
14
+ export const POPOVER_OPENER_ACTION_TYPES: ReadonlySet<string> = new Set(['openPopover', 'togglePopover']);
15
+
16
+ /** Every action that opens, closes or toggles a popover — what the engines dispatch. */
17
+ export const POPOVER_ACTION_TYPE_SET: ReadonlySet<string> = new Set(['openPopover', 'closePopover', 'togglePopover']);
18
+
19
+ const POPOVER_ID_PREFIX = 'iox-popover-';
20
+
21
+ /** The DOM id of a Popover node's panel — what an opener's `aria-controls` names. */
22
+ export function popoverDomId(nodeId: string): string {
23
+ return `${POPOVER_ID_PREFIX}${nodeId}`;
24
+ }
25
+
26
+ /** The node id a popover DOM id names, or null. */
27
+ export function nodeIdOfPopoverDomId(domId: string | null | undefined): string | null {
28
+ return domId && domId.startsWith(POPOVER_ID_PREFIX) ? domId.slice(POPOVER_ID_PREFIX.length) : null;
29
+ }
30
+
31
+ /** The Popover node id the element's click opens, or null. */
32
+ export function openedPopoverId(node: OpenerNodeLike | null | undefined): string | null {
33
+ return openedTargetId(node, POPOVER_OPENER_ACTION_TYPES);
34
+ }
35
+
36
+ /** The opener attributes for a node: `{}` when its click opens no popover. */
37
+ export function popoverOpenerAttributes(node: OpenerNodeLike | null | undefined, open = false): Record<string, string> {
38
+ const popoverId = openedPopoverId(node);
39
+ if (!popoverId) return {};
40
+ return {
41
+ [OpenerAttribute.HasPopup]: 'dialog',
42
+ [OpenerAttribute.Controls]: popoverDomId(popoverId),
43
+ [OpenerAttribute.Expanded]: open ? 'true' : 'false',
44
+ };
45
+ }
46
+
47
+ /** The selector of every opener of one popover (by its DOM id). */
48
+ export function popoverOpenersSelector(popoverDomIdValue: string): string {
49
+ return `[${OpenerAttribute.Controls}="${popoverDomIdValue}"]`;
50
+ }
@@ -12,4 +12,5 @@ export * from './action.model';
12
12
  export * from './availability';
13
13
  export * from './element-actions';
14
14
  export * from './dialog-opener';
15
+ export * from './popover-opener';
15
16
  export * from './dialog-motion';