@vectoriox/iox-ui 5.141.0 → 5.143.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/composite-core/index.d.ts +40 -1
- package/design-core/index.d.ts +262 -28
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +155 -90
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +539 -268
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +61 -4
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1547 -742
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +510 -20
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +170 -22
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +17 -3
- package/generation-core/index.d.ts +638 -148
- package/harness-core/index.d.ts +359 -20
- package/index.d.ts +94 -10
- package/package.json +1 -1
- package/src/composite-core/accordion.ts +16 -1
- package/src/composite-core/card.ts +22 -2
- package/src/composite-core/consent.ts +2 -2
- package/src/composite-core/recipe-parts.ts +7 -0
- package/src/composite-core/segmented.ts +17 -2
- package/src/composite-core/slider.ts +19 -3
- package/src/composite-core/tabs.ts +16 -1
- package/src/design-core/contrast-audit.ts +18 -0
- package/src/design-core/flavor-spec.generated.ts +212 -25
- package/src/design-core/ink-on-ground.ts +36 -0
- package/src/design-core/list-classes.ts +37 -0
- package/src/design-core/locale-direction.ts +24 -0
- package/src/design-core/menu-look.ts +2 -1
- package/src/design-core/node-classes.ts +3 -2
- package/src/design-core/public-api.ts +3 -0
- package/src/forms-core/form-presets.ts +72 -3
- package/src/generation-core/check-layout.ts +4 -1
- package/src/generation-core/check-list.ts +144 -5
- package/src/generation-core/compose-layout.ts +165 -20
- package/src/generation-core/compose-site.ts +58 -21
- package/src/generation-core/footer-mix.ts +8 -0
- package/src/generation-core/layout-fingerprint.ts +5 -1
- package/src/generation-core/layout-language.ts +5 -0
- package/src/generation-core/layout-wire.ts +64 -24
- package/src/generation-core/list-panel.ts +122 -0
- package/src/generation-core/list-space.ts +54 -1
- package/src/generation-core/list-table.ts +101 -0
- package/src/generation-core/nav-shape.ts +3 -2
- package/src/generation-core/node-baselines.generated.ts +3 -1
- package/src/generation-core/patterns.ts +4 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/serialized-node.ts +2 -0
- package/src/generation-core/site-plan.model.ts +16 -2
- package/src/generation-core/site-spec.generated.ts +469 -201
- package/src/generation-core/validate-site-plan.ts +8 -4
- package/src/harness-core/business-types.ts +11 -0
- package/src/harness-core/film-idea.ts +178 -0
- package/src/harness-core/harness-spec.generated.ts +380 -18
- package/src/harness-core/intake.ts +8 -1
- package/src/harness-core/public-api.ts +1 -0
- package/styles/iox-design.css +420 -45
package/index.d.ts
CHANGED
|
@@ -764,6 +764,8 @@ declare class ClientSliderContainerComponent implements AfterViewInit, OnDestroy
|
|
|
764
764
|
/** Premium M4: the scroll plays it — a runway (a Scene root the ONE driver drives) holds it mid-screen; otherwise the
|
|
765
765
|
* wrapper is `display: contents` and the slider lays out exactly as before. */
|
|
766
766
|
scrollPlays: boolean;
|
|
767
|
+
/** AW11-D1: the creative effect's named setting (`fan` — a list's fan you drag). */
|
|
768
|
+
creativePreset: string;
|
|
767
769
|
childrenHost: ViewContainerRef;
|
|
768
770
|
leadHost: ViewContainerRef;
|
|
769
771
|
trailHost: ViewContainerRef;
|
|
@@ -795,7 +797,7 @@ declare class ClientSliderContainerComponent implements AfterViewInit, OnDestroy
|
|
|
795
797
|
private boot;
|
|
796
798
|
private inputs;
|
|
797
799
|
static ɵfac: i0.ɵɵFactoryDeclaration<ClientSliderContainerComponent, never>;
|
|
798
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ClientSliderContainerComponent, "iox-slider-container", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "slidesPerView": { "alias": "slidesPerView"; "required": false; }; "slidesPerGroup": { "alias": "slidesPerGroup"; "required": false; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; }; "speed": { "alias": "speed"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "grabCursor": { "alias": "grabCursor"; "required": false; }; "centeredSlides": { "alias": "centeredSlides"; "required": false; }; "initialSlide": { "alias": "initialSlide"; "required": false; }; "autoHeight": { "alias": "autoHeight"; "required": false; }; "slideToClickedSlide": { "alias": "slideToClickedSlide"; "required": false; }; "freeMode": { "alias": "freeMode"; "required": false; }; "enableNavigation": { "alias": "enableNavigation"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableScrollbar": { "alias": "enableScrollbar"; "required": false; }; "enableAutoplay": { "alias": "enableAutoplay"; "required": false; }; "enableKeyboard": { "alias": "enableKeyboard"; "required": false; }; "enableMousewheel": { "alias": "enableMousewheel"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "enableGrid": { "alias": "enableGrid"; "required": false; }; "enableParallax": { "alias": "enableParallax"; "required": false; }; "autoplayDelay": { "alias": "autoplayDelay"; "required": false; }; "autoplayPauseOnMouseEnter": { "alias": "autoplayPauseOnMouseEnter"; "required": false; }; "autoplayDisableOnInteraction": { "alias": "autoplayDisableOnInteraction"; "required": false; }; "paginationType": { "alias": "paginationType"; "required": false; }; "paginationClickable": { "alias": "paginationClickable"; "required": false; }; "paginationDynamicBullets": { "alias": "paginationDynamicBullets"; "required": false; }; "navigationColor": { "alias": "navigationColor"; "required": false; }; "paginationColor": { "alias": "paginationColor"; "required": false; }; "gridRows": { "alias": "gridRows"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "controlParts": { "alias": "controlParts"; "required": false; }; "scrollPlays": { "alias": "scrollPlays"; "required": false; }; }, {}, never, never, false, never>;
|
|
800
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ClientSliderContainerComponent, "iox-slider-container", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "slidesPerView": { "alias": "slidesPerView"; "required": false; }; "slidesPerGroup": { "alias": "slidesPerGroup"; "required": false; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; }; "speed": { "alias": "speed"; "required": false; }; "effect": { "alias": "effect"; "required": false; }; "grabCursor": { "alias": "grabCursor"; "required": false; }; "centeredSlides": { "alias": "centeredSlides"; "required": false; }; "initialSlide": { "alias": "initialSlide"; "required": false; }; "autoHeight": { "alias": "autoHeight"; "required": false; }; "slideToClickedSlide": { "alias": "slideToClickedSlide"; "required": false; }; "freeMode": { "alias": "freeMode"; "required": false; }; "enableNavigation": { "alias": "enableNavigation"; "required": false; }; "enablePagination": { "alias": "enablePagination"; "required": false; }; "enableScrollbar": { "alias": "enableScrollbar"; "required": false; }; "enableAutoplay": { "alias": "enableAutoplay"; "required": false; }; "enableKeyboard": { "alias": "enableKeyboard"; "required": false; }; "enableMousewheel": { "alias": "enableMousewheel"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "enableGrid": { "alias": "enableGrid"; "required": false; }; "enableParallax": { "alias": "enableParallax"; "required": false; }; "autoplayDelay": { "alias": "autoplayDelay"; "required": false; }; "autoplayPauseOnMouseEnter": { "alias": "autoplayPauseOnMouseEnter"; "required": false; }; "autoplayDisableOnInteraction": { "alias": "autoplayDisableOnInteraction"; "required": false; }; "paginationType": { "alias": "paginationType"; "required": false; }; "paginationClickable": { "alias": "paginationClickable"; "required": false; }; "paginationDynamicBullets": { "alias": "paginationDynamicBullets"; "required": false; }; "navigationColor": { "alias": "navigationColor"; "required": false; }; "paginationColor": { "alias": "paginationColor"; "required": false; }; "gridRows": { "alias": "gridRows"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "controlParts": { "alias": "controlParts"; "required": false; }; "scrollPlays": { "alias": "scrollPlays"; "required": false; }; "creativePreset": { "alias": "creativePreset"; "required": false; }; }, {}, never, never, false, never>;
|
|
799
801
|
}
|
|
800
802
|
|
|
801
803
|
/**
|
|
@@ -1771,6 +1773,8 @@ interface SliderInputs {
|
|
|
1771
1773
|
responsive?: ResponsiveOverrides | null;
|
|
1772
1774
|
/** Premium M4: the scroll plays it — held mid-screen, resting on each picture; no swipe, no loop, no autoplay. */
|
|
1773
1775
|
scrollPlays?: boolean;
|
|
1776
|
+
/** AW11: a named setting for the `creative` effect (`fan` — a list's fan you drag). */
|
|
1777
|
+
creativePreset?: string;
|
|
1774
1778
|
}
|
|
1775
1779
|
/** The slider's controls, when they are PARTS (CC3) — the elements Swiper is handed. */
|
|
1776
1780
|
interface SliderControlElements {
|
|
@@ -1832,6 +1836,47 @@ declare const SLIDER_CARDS: {
|
|
|
1832
1836
|
/** The longest a step takes under reduced motion (ms). */
|
|
1833
1837
|
readonly stillSpeed: 200;
|
|
1834
1838
|
};
|
|
1839
|
+
/** The named settings the `creative` effect knows (AW11). */
|
|
1840
|
+
declare enum SliderCreativePreset {
|
|
1841
|
+
/** A list's fan you drag (AW11-D1): the cards either side turn away round a point below them, as in the hand. */
|
|
1842
|
+
Fan = "fan"
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* A FAN you drag (AW11-D1, board award-lists): each card either side of the front one turns `step` degrees further and
|
|
1846
|
+
* moves aside and down, round its bottom edge; at most four wait on each side. The step is the contract's list-fan-step
|
|
1847
|
+
* at its default (9°). Under reduced motion the cards are stepped aside, never turned, and the step is short.
|
|
1848
|
+
*/
|
|
1849
|
+
declare const SLIDER_FAN: {
|
|
1850
|
+
readonly step: 9;
|
|
1851
|
+
readonly motion: {
|
|
1852
|
+
limitProgress: number;
|
|
1853
|
+
shadowPerProgress: boolean;
|
|
1854
|
+
prev: {
|
|
1855
|
+
translate: (string | number)[];
|
|
1856
|
+
rotate: number[];
|
|
1857
|
+
origin: string;
|
|
1858
|
+
};
|
|
1859
|
+
next: {
|
|
1860
|
+
translate: (string | number)[];
|
|
1861
|
+
rotate: number[];
|
|
1862
|
+
origin: string;
|
|
1863
|
+
};
|
|
1864
|
+
};
|
|
1865
|
+
readonly still: {
|
|
1866
|
+
limitProgress: number;
|
|
1867
|
+
shadowPerProgress: boolean;
|
|
1868
|
+
prev: {
|
|
1869
|
+
translate: (string | number)[];
|
|
1870
|
+
rotate: number[];
|
|
1871
|
+
origin: string;
|
|
1872
|
+
};
|
|
1873
|
+
next: {
|
|
1874
|
+
translate: (string | number)[];
|
|
1875
|
+
rotate: number[];
|
|
1876
|
+
origin: string;
|
|
1877
|
+
};
|
|
1878
|
+
};
|
|
1879
|
+
};
|
|
1835
1880
|
/** At or under this width one picture takes the full width (M1.3) unless the author said otherwise there. */
|
|
1836
1881
|
declare const SLIDER_PHONE_BREAKPOINT = "mobile";
|
|
1837
1882
|
/** The pagination part's classes — Swiper's own position CSS (`.swiper-pagination-bullets.swiper-pagination-horizontal`)
|
|
@@ -2046,16 +2091,11 @@ type StateMaps = Record<string, Record<string, any> | undefined> | null | undefi
|
|
|
2046
2091
|
declare function stateTransitionProperties(stateStyles: StateMaps, responsive?: Record<string, {
|
|
2047
2092
|
stateStyles?: StateMaps;
|
|
2048
2093
|
} | undefined> | null, type?: string | null): string[];
|
|
2049
|
-
/**
|
|
2050
|
-
* What an element style animates beyond the properties its states change (premium M4): a link's underline is DRAWN by
|
|
2051
|
-
* the shared CSS (`iox-design.css`) as a background line that grows from the reading start on hover — its growth is a
|
|
2052
|
-
* `background-size` the node's own transition must name, or it would jump.
|
|
2053
|
-
*/
|
|
2054
|
-
declare const ELEMENT_STYLE_TRANSITION_EXTRAS: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
2055
2094
|
/**
|
|
2056
2095
|
* `styleProps` as a renderer compiles them: a hovering node with no timing of its own takes the default hover timing,
|
|
2057
|
-
* and a node whose transition names no properties gets the ones its states change (
|
|
2058
|
-
* `
|
|
2096
|
+
* and a node whose transition names no properties gets the ones its states change (premium M4's link line, which named
|
|
2097
|
+
* `background-size` here too, was reversed 2026-11-22). An author's own `transitionProperty` (or a raw `transition`)
|
|
2098
|
+
* always wins. Pure:
|
|
2059
2099
|
* the node's stored styles are never touched.
|
|
2060
2100
|
*/
|
|
2061
2101
|
declare function withStateTransitions(styleProps: Record<string, any>, stateStyles: StateMaps, elementStyle?: string | null, responsive?: Record<string, {
|
|
@@ -2654,6 +2694,26 @@ interface ScrollPlanContext {
|
|
|
2654
2694
|
}
|
|
2655
2695
|
declare function planScroll(scroll: string | null | undefined, ctx: ScrollPlanContext): LenisOptions | null;
|
|
2656
2696
|
|
|
2697
|
+
/**
|
|
2698
|
+
* engine#31 — the page never moves sideways when its scrollbar would come and go: a page that fits the window, a held
|
|
2699
|
+
* scroll (a dialog or popover: `PageScrollProvider.stop()` sets `overflow: hidden` when no Lenis runs), a page
|
|
2700
|
+
* transition. Where the browser's scrollbars take width (Windows, Linux, a mac with a mouse) the scroller holds a
|
|
2701
|
+
* stable gutter; where they take none (phones, a mac's trackpad, a headless renderer that hides its bars) it holds
|
|
2702
|
+
* nothing — a gutter there would lay the page out in a blank strip narrower than its window.
|
|
2703
|
+
*
|
|
2704
|
+
* ONE probe, marking `<html>` with {@link SCROLLBARS_TAKE_WIDTH_CLASS}; the shared CSS keys the gutter off that class
|
|
2705
|
+
* (the live site: the engine's `html.iox-scrollbars-take-width`; the builder's Preview: `iox-page-component`'s wrapper).
|
|
2706
|
+
* The live site must run it BEFORE the first paint, so the server writes {@link scrollbarsTakeWidthScript} into `<head>`.
|
|
2707
|
+
*/
|
|
2708
|
+
declare const SCROLLBARS_TAKE_WIDTH_CLASS = "iox-scrollbars-take-width";
|
|
2709
|
+
/**
|
|
2710
|
+
* Measures a scroll box off screen and marks `<html>` when its scrollbar takes width. Returns whether it does.
|
|
2711
|
+
* ⚠️ Self-contained (no outer name, the class written out): {@link scrollbarsTakeWidthScript} ships its source text.
|
|
2712
|
+
*/
|
|
2713
|
+
declare function markScrollbarsTakeWidth(doc: Document): boolean;
|
|
2714
|
+
/** The probe as an inline `<script>` body, for a server to write into `<head>` (before the first paint). */
|
|
2715
|
+
declare function scrollbarsTakeWidthScript(): string;
|
|
2716
|
+
|
|
2657
2717
|
/**
|
|
2658
2718
|
* THE interaction keyframes (composite plan T2 · CC1 N5). Both runtimes — the builder's
|
|
2659
2719
|
* InteractionEngineService and the live site's ClientInteractionService — animate an element action
|
|
@@ -3299,6 +3359,9 @@ interface PipeContext {
|
|
|
3299
3359
|
currency?: string;
|
|
3300
3360
|
}
|
|
3301
3361
|
type PipeFn = (value: any, args: any[], ctx: PipeContext) => any;
|
|
3362
|
+
/** AW11-D10: the pipes a colour block's `style:` bindings carry (the ground drawn, the ink on it). */
|
|
3363
|
+
declare const LIST_GROUND_PIPE = "aaGround";
|
|
3364
|
+
declare const LIST_INK_PIPE = "inkOnGround";
|
|
3302
3365
|
/** The registry — adding a pipe here (+ a descriptor below) makes it work on both sides and appear in
|
|
3303
3366
|
* the authoring UI. Keyed by name; unknown names are passed through by `applyBindingPipes`. */
|
|
3304
3367
|
declare const PIPE_REGISTRY: Record<string, PipeFn>;
|
|
@@ -3395,6 +3458,27 @@ interface BoundValueSpec {
|
|
|
3395
3458
|
*/
|
|
3396
3459
|
declare function resolveBoundValue(sourceData: unknown, binding: BoundValueSpec, ctx?: PipeContext): unknown;
|
|
3397
3460
|
|
|
3461
|
+
/**
|
|
3462
|
+
* A BOUND STYLE (award-ingredients-plan §7.1f, AW11-D10): a binding whose prop is `style:--list-item-<name>` sets that
|
|
3463
|
+
* custom property inline on the element, per row — the one way a list item's OWN value (a colour block's ground and
|
|
3464
|
+
* ink) reaches its paint. The shared CSS reads the property with the look's ramp as its fallback, so a renderer that
|
|
3465
|
+
* does not apply it yet still draws a readable block. Only `--list-item-*` names and hex colours pass: a page document
|
|
3466
|
+
* never injects CSS. Both renderers call this one function; never re-implement the check.
|
|
3467
|
+
*/
|
|
3468
|
+
declare const BOUND_STYLE_PREFIX = "style:";
|
|
3469
|
+
/** True for a binding prop this module answers. */
|
|
3470
|
+
declare function isBoundStyleProp(prop: unknown): prop is string;
|
|
3471
|
+
/** The custom property and value a `style:` binding sets, or null (an unknown name, a value that is no hex colour). */
|
|
3472
|
+
declare function boundStyleOf(prop: string, value: unknown): {
|
|
3473
|
+
name: string;
|
|
3474
|
+
value: string;
|
|
3475
|
+
} | null;
|
|
3476
|
+
/** `--list-item-ground:#abcdef;--list-item-ink:#ffffff` for the string renderer (the raw SSR), '' for none. */
|
|
3477
|
+
declare function boundStyleCss(entries: ReadonlyArray<{
|
|
3478
|
+
prop: string;
|
|
3479
|
+
value: unknown;
|
|
3480
|
+
}>): string;
|
|
3481
|
+
|
|
3398
3482
|
/**
|
|
3399
3483
|
* The canonical shape of a page's SEO metadata, plus the flat tag list both renderers emit.
|
|
3400
3484
|
*
|
|
@@ -4843,5 +4927,5 @@ declare function formToastsOnSend(form: Element | null | undefined): boolean;
|
|
|
4843
4927
|
/** Raise the form's Sent toast (from the form — its scope and its look). */
|
|
4844
4928
|
declare function raiseFormToast(form: Element): ToastHandle | null;
|
|
4845
4929
|
|
|
4846
|
-
export { A11yAttribute, A11yTrait, ACCESSIBLE_NAME_TYPES, AOSService, ARIA_CURRENT_PAGE, BACKDROP_TWIN_KEY, BACKDROP_WHOLE_KEY, BLUR_IN_START_PX, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CALENDAR_CLOSING_ATTRIBUTE, CALENDAR_DESIGN_ATTRIBUTE, CALENDAR_INSTANT_ATTRIBUTE, CALENDAR_SHEET_QUERY, COMPONENT_STATE_SELECTOR, CONTAINER_HTML_TAGS, CONTEXT_ACTION_TYPES, COUNT_ATTRIBUTE, COUNT_DEFAULT_MS, COUNT_MAX_MS, COUNT_UP_ACTION, CURRENT_LINK_TYPES, CalendarClass, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ComponentState, ContainerComponent, ContextStore, CoverPaint, DECORATIVE_TYPES, DEFAULT_GALLERY_SCHEDULER, DEFAULT_INTERACTION_EASING, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DEPTH_CLIP_ATTRIBUTE, DIALOG_CLOSE_ABOVE_ATTRIBUTE, DIALOG_NODE_TYPE, DatePickerRuntime, DeclarationContext, EASING_KEYWORDS, EASING_TOKENS,
|
|
4930
|
+
export { A11yAttribute, A11yTrait, ACCESSIBLE_NAME_TYPES, AOSService, ARIA_CURRENT_PAGE, BACKDROP_TWIN_KEY, BACKDROP_WHOLE_KEY, BLUR_IN_START_PX, BOUND_STYLE_PREFIX, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CALENDAR_CLOSING_ATTRIBUTE, CALENDAR_DESIGN_ATTRIBUTE, CALENDAR_INSTANT_ATTRIBUTE, CALENDAR_SHEET_QUERY, COMPONENT_STATE_SELECTOR, CONTAINER_HTML_TAGS, CONTEXT_ACTION_TYPES, COUNT_ATTRIBUTE, COUNT_DEFAULT_MS, COUNT_MAX_MS, COUNT_UP_ACTION, CURRENT_LINK_TYPES, CalendarClass, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ComponentState, ContainerComponent, ContextStore, CoverPaint, DECORATIVE_TYPES, DEFAULT_GALLERY_SCHEDULER, DEFAULT_INTERACTION_EASING, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DEPTH_CLIP_ATTRIBUTE, DIALOG_CLOSE_ABOVE_ATTRIBUTE, DIALOG_NODE_TYPE, DatePickerRuntime, DeclarationContext, EASING_KEYWORDS, EASING_TOKENS, ENTRANCE_ACTION_TYPES, ENTRANCE_FALLBACK_CSS, ENTRANCE_NOSCRIPT_CSS, ENTRANCE_PRESTATE_ATTRIBUTE, EXIT_ACTION_TYPES, EasingKeyword, EasingToken, FLOATING_GAP, FLOATING_LAYER_CLASS, FLOATING_MARGIN, FLOATING_SHEET_QUERY, FloatingAlign, FloatingSide, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, HEADER_SCROLL_HYSTERESIS_PX, HOVER_DEFAULT_TRANSITION_TRAITS, HOVER_MEDIA_QUERY, HOVER_STATES, HeaderInkRuntime, HeaderRuntime, INTERACTION_ANIMATION_ID, INTERACTION_HIDDEN_ATTRIBUTE, INTERACTION_MARKER_ATTRIBUTES, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, InlineEditEvent, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxDialogComponent, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxPopoverComponent, IoxSubmitButtonComponent, IoxUiModule, IoxVideoComponent, LAST_EMITTED_STATES, LEGACY_DIRECTION_KEY, LEGACY_HOVER_TRANSITION_TRAITS, LEGACY_SWIPER_CONTROLS, LIST_GROUND_PIPE, LIST_INK_PIPE, LinkedContainerComponent, MANAGED_A11Y_ATTRIBUTES, MAX_LINES_KEY, NAMED_GROUP_ROLES, NO_PAGE_TRANSITION, ON_STATE_ROLES, OUTER_STYLE_PROPS, PAGE_LEAVE_RATIO, PAGE_STYLE_TOKENS, PAGE_TOKEN_FALLBACKS, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PART_CLASS_NAMES, PART_PAGINATION_MODIFIER, PHONE_TRANSITION_QUERY, PIPE_DESCRIPTORS, PIPE_REGISTRY, POPOVER_SELECTOR, PRELOADER_AT_ATTRIBUTE, PRELOADER_CLASS, PRELOADER_CSS, PRELOADER_END_EVENT, PRELOADER_RUN_ATTRIBUTE, PRELOADING_ATTRIBUTE, PROGRESS_ATTRIBUTE, PageScrollProvider, PageStyleField, PageStyleSource, PausableTimer, PauseReason, PointerKind, PopoverAttribute, REDUCED_ENTRANCE_FRAMES, REDUCED_MOTION_QUERY, REDUCED_PAGE_LEAVE, RELATIONAL_STATE_PSEUDO, RevealActionType, SCROLLBARS_TAKE_WIDTH_CLASS, SCROLLED_ATTRIBUTE, SCROLLED_STATE_ROLE, SCROLLED_THRESHOLD_PX, SCROLL_ANIMATION_ID, SCROLL_EASINGS, SELF_PLAYING_TRIGGERS, SHAKE_DURATION_MS, SHAKE_EASING, SHAKE_KEYFRAMES, SLIDER_CARDS, SLIDER_FAN, SLIDER_FEEL, SLIDER_INPUTS_ATTRIBUTE, SLIDER_INPUT_NAMES, SLIDER_PHONE_BREAKPOINT, SLIDER_RUNWAY_CLASS, SLIDER_STEPS_PROPERTY, SLIDE_CAPTION_ATTRIBUTE, STATE_PSEUDO_CLASS, STRUCTURAL_STATES, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_A11Y_OPTIONS, SWIPER_RESPONSIVE_TRAITS, SWIPER_TRIGGER_EVENTS, ScrollActionType, ScrollEasing, SectionComponent, SettleMode, SliderCreativePreset, StringFormRuntime, SwiperModuleName, TARGETED_STATE_SUFFIX, TEXT_ALIGN_KEY, TEXT_DIRECTION_KEY, TOAST_CLOSE_WORDS, TOAST_DESIGN_ATTRIBUTE, TOAST_EDGE_ATTRIBUTE, TOAST_FIRST_LANDS_MS, TOAST_MAX_MS, TOAST_MAX_VISIBLE, TOAST_MIN_MS, TOAST_MS_PER_CHAR, TOOLTIP_ATTRIBUTE, TOOLTIP_FIRST_DELAY_MS, TOOLTIP_HIDE_GRACE_MS, TOOLTIP_INSTANT_ATTRIBUTE, TOOLTIP_PINNED_ATTRIBUTE, TOOLTIP_PLACEMENT_ATTRIBUTE, TOOLTIP_SIDE_ATTRIBUTE, TOOLTIP_TYPES, TOOLTIP_WARM_MS, TRANSITION_FEELS, TRANSITION_PROPERTY_KEY, TextAlign, TextBlockComponent, ToastClass, ToastEdge, TooltipClass, TooltipRuntime, VALIDATION_STATES, VALIDATION_STATE_CLASS, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, VisibilityActionType, activeActions, afterPreloader, animateAction, applyBindingPipes, applyFeel, armCountUp, armInteractionCounts, attachDatePicker, attachDatePickers, attachScrollProgress, attachStringForm, attachTooltips, bootSlider, boundStyleCss, boundStyleOf, breakpointDef, breakpointForWidth, breakpointQueryFor, buildInteractionKeyframes, buildPartSelector, buildPreloaderLayer, buildSwiperBreakpoints, buildTargetedStateSelector, buildTargetedSuffixSelector, buildTransitionTimeline, canPopover, cascadeChain, clearInputOverride, clearOverride, clearToasts, closeAboveMediaQuery, closeAllPopovers, closePopover, collectContextSlotKeys, commitInlineEdit, compileDeclarations, compilePageStyle, componentStatesFor, composeVirtualTraits, containerHtmlTag, contextActionEffect, contextSlotKeys, countDuration, countIsReadable, countLocaleOf, countOverrides, countValueAt, coverPanelStyle, createCoverPanel, datePickerOf, declaredInputNames, decomposeBackdropFilter, defaultHoverTransitionTraits, defaultMessageResolver, deriveSeoFromContent, describePageStyle, describeSeoFields, dialogCloseAboveMinWidth, directionalFrames, domHasSliderParts, durationMs, effectiveActionType, effectiveTransitionId, ensurePreloaderStyles, entrancePreStateStyle, entranceStartsHidden, feelFor, fieldLanguage, finalKeyframe, firstScreenReadiness, floatingLayer, floatingScope, formSentWords, formToastsOnSend, formatCount, framesFromLiveValue, gateHoverRule, getSeoValue, hasCounted, hasHoverState, hasOwnPageTransition, hasOwnTransition, headerShouldHide, hideFromTopLayer, hidingHeadersIn, initialSlotValues, inkFollowingHeadersIn, interactionMarkerAttributes, isActionEnabled, isBoundProp, isBoundStyleProp, isContextAction, isCubicBezier, isCurrentLink, isEasingToken, isExternalOrFragment, isGradientPaint, isHoverPointer, isHoverState, isInputOverriddenAt, isInteractionEasing, isLastEmittedStateKey, isOpenPopover, isOperated, isOverriddenAt, isPopoverOpen, isPreloading, isPressFeedback, isScrolled, isStructuralState, isValidSlotKey, isWholeBackdropSet, keyframePropertyName, keyframeStyleEntries, layerFrame, legacyEnterToTransition, lookEaseOf, markScrollbarsTakeWidth, mediaQueryFor, mergeSwiperBreakpoints, migrateLegacyDirection, migrateLegacyTextAlign, motionAllowed, mountPreloader, nearestCommonAncestorId, needsAccessibleName, needsGroupName, nodeA11yAttributes, nodeCssId, nodeTraitValue, nodeUsesContext, normalizeAppPath, normalizeGalleryImage, normalizeIconClass, openPopover, openingPictureOf, orderStatesForEmit, pageTransitionOf, parentBreakpoint, parseCount, parseUrlList, partClassName, placeFloating, placePopover, planPartRule, planResponsiveRules, planScroll, planStateRule, planSwiperOptions, playCountUp, playDualLayerTransition, playInteraction, playPreloaderPreview, playsOnScroll, popoverPanelAttributes, popoverSide, prefersReducedMotion, preloaderContentOf, preloaderHeadScript, raiseFloatingLayer, raiseFormToast, rectInLayer, reducedEntranceFades, reducedEntranceRun, renderDefaultDeclarations, resetPageStyleField, resetSeoField, resolveBoundValue, resolveContextValue, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolveInteractionEasing, resolvePageTransition, resolvePath, resolveSeo, resolveStateStyles, resolveStyleProps, resolveToggleVisibility, resolveValueChain, restoreCountUp, rewriteViewportUnits, runPreloader, safeSetInput, scrollActionKind, scrollMotionEnv, scrollbarsTakeWidthScript, scrubUntilOf, serializeA11yAttributes, setDateFieldValue, setInputOverride, setOverride, setSeoAuto, setSeoBinding, setSeoOverride, setSeoValue, settleInteraction, settleModeFor, shakeElement, showCalendarDesign, showInTopLayer, showToast, showToastDesign, sliderControlElements, sliderInputsFromProps, sliderInputsOf, sliderRunwayHtml, splitOuterProps, splitPressFeedback, stateNamesIn, statePseudoClass, stateSelectorSuffix, stateTransitionProperties, stringFormRuntimeOf, stripSuppressedProps, swiperAutoplayAllowed, swiperLoopOptions, swiperModuleNames, syncInteractionMarkers, syncNodeA11yAttributes, syncSubmitButtons, targetedStateSelector, toLayerRect, toastCloseWord, toastDuration, toastEdge, toastsToEvict, togglePopover, tooltipSide, tooltipTiming, tooltipWords, tooltipsOf, transitionPropertyList, translateYOf, viewportTransitionContext, watchHeaderInk, watchHeaders, watchScrolled, withContextSlots, withPhoneDefaults, withStateTransitions, wrapInBreakpointQuery, wrapInMediaQuery };
|
|
4847
4931
|
export type { A11yNodeSource, AnimateActionOptions, BoundValueSpec, BreakpointDef, ContextActionEffect, ContextActionLike, ContextItemRef, ContextSlotDefault, ContextValueSpec, ContextWriteScope, CountTarget, CoverPanelContext, CurrentLinkOptions, DatePickerOptions, FloatingLayerOptions, FloatingOptions, FloatingPlacement, FloatingRect, FloatingSize, FloatingViewport, FormMessageResolver, GalleryBoundSource, GalleryDurations, GalleryEffect, GalleryEffectDescriptor, GalleryImage, GalleryLoopOptions, GalleryLoopScheduler, GalleryLoopState, GallerySlideState, HeaderRuntimeOptions, IBuilderEventEmitter, InlineEditableNode, InputMap, InteractionKeyframe, IoxContextSlot, IoxPipe, LayerFrame, MatchMediaHost, NodeA11yContext, OverrideBreakpoint, PageCoverSpec, PageScrollStart, PageStyleFieldState, PageStyleOptions, PageStyleSettings, PageTransitionCategory, PageTransitionCategoryMeta, PageTransitionContext, PageTransitionOptions, PageTransitionPreset, PipeArgSpec, PipeContext, PipeDescriptor, PlannedPageTransition, PopoverCloseOptions, PopoverOpenOptions, PreloaderContent, PreloaderPreviewOptions, PreloaderRunOptions, PressAction, RegisteredField, ResolvedPageCover, ResolvedPageTransition, ResponsiveLayer, ResponsiveOverrides, ResponsiveRuleSet, RouteAnimationLike, ScrollPlanContext, ScrollProgressAction, ScrollProgressHost, ScrollProgressInteraction, ScrollSource, SeoDerivedContent, SeoFieldSource, SeoFieldState, SeoResolveContext, SetContextParams, SettleOptions, SliderBootOptions, SliderControlElements, SliderInputs, StateRulePlan, StateScope, StateStyleMap, StringFormOptions, StyleMap, StyleTreeNode, SwiperBreakpointMap, SwiperModuleFlags, SwiperPlan, SwiperPlanContext, ToastHandle, ToastOptions, ToggleableAction, TooltipRuntimeOptions, TooltipTimingState, TransitionFeel, TransitionPhase, TransitionPreviewLayers, TransitionTimelineInput, TransitionViewport, ValueSource, VirtualTraitGroup };
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readOwnedTrait } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
import { recipeLang } from './recipe-parts';
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
AccordionRole, COMPOSITE_KIND_ROLES, CompositeKind, compositeKindOfRole, isToggleKind,
|
|
@@ -77,6 +78,18 @@ export const ACCORDION_WORDS: ReadonlyArray<AccordionWords> = [
|
|
|
77
78
|
{ question: 'Write the third question', answer: 'Answer it plainly, in two or three short sentences.' },
|
|
78
79
|
];
|
|
79
80
|
export const ACCORDION_NEW_ITEM_WORDS: Readonly<AccordionWords> = { question: 'Write a new question', answer: 'Answer it plainly, in two or three short sentences.' };
|
|
81
|
+
/** The same on a Hebrew site (iox-ui#112). */
|
|
82
|
+
export const ACCORDION_WORDS_HE: ReadonlyArray<AccordionWords> = [
|
|
83
|
+
{ question: 'כתבו את השאלה הראשונה שאנשים שואלים', answer: 'ענו בפשטות, בשניים או שלושה משפטים קצרים.' },
|
|
84
|
+
{ question: 'כתבו את השאלה השנייה', answer: 'ענו בפשטות, בשניים או שלושה משפטים קצרים.' },
|
|
85
|
+
{ question: 'כתבו את השאלה השלישית', answer: 'ענו בפשטות, בשניים או שלושה משפטים קצרים.' },
|
|
86
|
+
];
|
|
87
|
+
export const ACCORDION_NEW_ITEM_WORDS_HE: Readonly<AccordionWords> = { question: 'כתבו שאלה חדשה', answer: 'ענו בפשטות, בשניים או שלושה משפטים קצרים.' };
|
|
88
|
+
|
|
89
|
+
/** A fresh accordion's items in a language. */
|
|
90
|
+
export function accordionWords(lang?: string | null): ReadonlyArray<AccordionWords> {
|
|
91
|
+
return recipeLang(lang) === 'he' ? ACCORDION_WORDS_HE : ACCORDION_WORDS;
|
|
92
|
+
}
|
|
80
93
|
|
|
81
94
|
enum Type {
|
|
82
95
|
Container = 'Container',
|
|
@@ -126,6 +139,8 @@ export interface AccordionOptions {
|
|
|
126
139
|
multiple?: boolean;
|
|
127
140
|
defaultOn?: AccordionDefaultOn;
|
|
128
141
|
icon?: AccordionIcon;
|
|
142
|
+
/** The language of the default items' words (iox-ui#112; English when not given). */
|
|
143
|
+
lang?: string | null;
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
function make(create: CompositeNodeFactory, key: string, type: string, role: AccordionRole | null, style: string,
|
|
@@ -165,7 +180,7 @@ export function buildAccordionRecipe(create: CompositeNodeFactory, options: Acco
|
|
|
165
180
|
const root = make(create, 'accordion', Type.Container, AccordionRole.Accordion, Style.Root, {}, 'Accordion');
|
|
166
181
|
writeProp(root, CompositeBehaviourTrait.Multiple, options.multiple ?? false);
|
|
167
182
|
writeProp(root, CompositeBehaviourTrait.DefaultOn, options.defaultOn ?? AccordionDefaultOn.First);
|
|
168
|
-
const words = options.items ??
|
|
183
|
+
const words = options.items ?? accordionWords(options.lang);
|
|
169
184
|
root.children = words.map((w, i) => buildAccordionItem(create, w, `k${i + 1}`, options.icon ?? AccordionIcon.Chevron));
|
|
170
185
|
return root;
|
|
171
186
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { COLOR_SCHEME_TRAIT, elementStyleById, LinkType, setColorScheme, switchElementStyle } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
import { recipeLang } from './recipe-parts';
|
|
2
3
|
|
|
3
4
|
import { BadgeTone, buildBadge } from './badge';
|
|
4
5
|
import {
|
|
@@ -114,6 +115,23 @@ export const CARD_WORDS: Readonly<CardWords> = {
|
|
|
114
115
|
person: 'Their name',
|
|
115
116
|
};
|
|
116
117
|
|
|
118
|
+
/** A fresh card's words on a Hebrew site (iox-ui#112). */
|
|
119
|
+
export const CARD_WORDS_HE: Readonly<CardWords> = {
|
|
120
|
+
eyebrow: 'קטגוריה',
|
|
121
|
+
title: 'כותרת הכרטיס',
|
|
122
|
+
text: 'משפט או שניים על הפריט הזה.',
|
|
123
|
+
primary: 'למידע נוסף',
|
|
124
|
+
secondary: 'שמירה',
|
|
125
|
+
badge: 'חדש',
|
|
126
|
+
quote: 'המילים שלהם, כפי שאמרו אותן.',
|
|
127
|
+
person: 'השם שלהם',
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** A fresh card's words in a language. */
|
|
131
|
+
export function cardWords(lang?: string | null): Readonly<CardWords> {
|
|
132
|
+
return recipeLang(lang) === 'he' ? CARD_WORDS_HE : CARD_WORDS;
|
|
133
|
+
}
|
|
134
|
+
|
|
117
135
|
/** The breakpoint whose layer stacks an "Image side" card (Breakpoint.Mobile, ≤767px). */
|
|
118
136
|
export const CARD_STACK_BREAKPOINT = 'mobile';
|
|
119
137
|
|
|
@@ -265,6 +283,8 @@ export interface CardOptions extends CardEditOptions {
|
|
|
265
283
|
/** Which optional parts the card starts with (all, by default). */
|
|
266
284
|
parts?: Partial<Record<CardPart, boolean>>;
|
|
267
285
|
words?: Partial<CardWords>;
|
|
286
|
+
/** The language of the recipe's own words (iox-ui#112; English when not given). */
|
|
287
|
+
lang?: string | null;
|
|
268
288
|
badgeTone?: BadgeTone;
|
|
269
289
|
/** The badge's glyph (else its tone's — `BADGE_TONE_ICONS`): the pricing pattern's "Most popular" sparkle (CC4b). */
|
|
270
290
|
badgeIcon?: string;
|
|
@@ -327,7 +347,7 @@ function buildTitle(create: CompositeNodeFactory, words: CardWords): CompositeNo
|
|
|
327
347
|
|
|
328
348
|
/** A fresh Card v2: every part a node with its role and element style, laid out by `options.layout`. */
|
|
329
349
|
export function buildCardRecipe(create: CompositeNodeFactory, options: CardOptions = {}): CompositeNode {
|
|
330
|
-
const words: CardWords = { ...
|
|
350
|
+
const words: CardWords = { ...cardWords(options.lang), ...(options.words ?? {}) };
|
|
331
351
|
const tone = options.badgeTone ?? BadgeTone.Accent;
|
|
332
352
|
const on = (part: CardPart) => options.parts?.[part] ?? !CARD_PARTS_OFF_AT_START.has(part);
|
|
333
353
|
const card = make(create, 'card', Type.Container, CardRole.Card, Style.Card, {}, 'Card');
|
|
@@ -511,7 +531,7 @@ export function setCardPart(card: CompositeNode, part: CardPart, on: boolean, cr
|
|
|
511
531
|
if (existing || !create) return null;
|
|
512
532
|
const layout = detectCardLayout(card);
|
|
513
533
|
const spec = LAYOUTS[layout === CARD_LAYOUT_CUSTOM ? CardLayout.Top : layout];
|
|
514
|
-
const words: CardWords = { ...
|
|
534
|
+
const words: CardWords = { ...cardWords(options.lang), ...(options.words ?? {}) };
|
|
515
535
|
const node = PART_BUILDERS[part](create, words, options.badgeTone ?? BadgeTone.Accent);
|
|
516
536
|
const content = findByRole(card, CardRole.Content);
|
|
517
537
|
switch (part) {
|
|
@@ -207,8 +207,8 @@ export function buildConsentRecipe(create: CompositeNodeFactory, options: Consen
|
|
|
207
207
|
recipeText(create, 'consent-body', ConsentRole.Body, Style.Body, t.body, 'Words', { ...WORDS, maxWidth: '560px' }),
|
|
208
208
|
...(options.privacyRoute
|
|
209
209
|
? [recipePart(create, 'consent-privacy', 'Link', ConsentRole.Privacy, Style.Link,
|
|
210
|
-
// Hugs its words: the words column stretches its children, and a stretched link
|
|
211
|
-
// column's whole width (AW1 Rule 0, 2026-11-21). `flex-start` is logical — the start side in Hebrew too.
|
|
210
|
+
// Hugs its words: the words column stretches its children, and a stretched link's box (its focus ring, its
|
|
211
|
+
// hover) ran the column's whole width (AW1 Rule 0, 2026-11-21). `flex-start` is logical — the start side in Hebrew too.
|
|
212
212
|
{ label: options.privacyLabel || t.privacy, linkType: 'page', pageRoute: options.privacyRoute }, 'Privacy policy',
|
|
213
213
|
{ ...WORDS, alignSelf: 'flex-start' })]
|
|
214
214
|
: []),
|
|
@@ -6,6 +6,13 @@ import { CompositeNode, CompositeNodeFactory, makeCompositePart } from './compos
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export const ZERO = '0px 0px 0px 0px';
|
|
9
|
+
|
|
10
|
+
/** The languages a recipe's own words come in (iox-ui#112) — a Hebrew site's fresh parts speak Hebrew. */
|
|
11
|
+
export type RecipeLang = 'en' | 'he';
|
|
12
|
+
/** The recipe language of a site/page locale ('he', 'he-IL' → Hebrew; anything else English). */
|
|
13
|
+
export function recipeLang(lang?: string | null): RecipeLang {
|
|
14
|
+
return (lang ?? '').toLowerCase().startsWith('he') ? 'he' : 'en';
|
|
15
|
+
}
|
|
9
16
|
/** Words that take their own size (a recipe never stamps a Text's 10px or a box's 200px — W1.1 `BASELINE_ROLES`). */
|
|
10
17
|
export const WORDS: Readonly<Record<string, string>> = { width: 'auto', minHeight: 'auto', padding: ZERO, margin: ZERO };
|
|
11
18
|
export const ROW = { display: 'flex', flexDirection: 'row', alignItems: 'center', width: 'auto', height: 'auto', minHeight: 'auto', padding: ZERO };
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
ITEM_OPEN_STATE, ON_ATTRIBUTE, SCOPE_ATTRIBUTE,
|
|
4
4
|
} from './accordion';
|
|
5
5
|
import { BadgeTone, buildBadge } from './badge';
|
|
6
|
+
import { recipeLang } from './recipe-parts';
|
|
6
7
|
import { CompositeKind, SegmentedRole } from './composite-kinds';
|
|
7
8
|
import { CompositeNode, CompositeNodeFactory, makeCompositePart, readProp, walkComposite, writeProp, writeStyles } from './composite-node';
|
|
8
9
|
import { TabsActivateOn, TabsBehaviour, TabsOrientation, TabsScope } from './tabs';
|
|
@@ -52,6 +53,17 @@ export const SEGMENTED_NAME = 'Billing period';
|
|
|
52
53
|
/** Q33: the saving badge's words start as a PLACEHOLDER — a saving is a price claim, never invented. */
|
|
53
54
|
export const SEGMENTED_BADGE_WORDS = 'Yearly saving';
|
|
54
55
|
export const SEGMENTED_BADGE_TONE = BadgeTone.Success;
|
|
56
|
+
/** The same on a Hebrew site (iox-ui#112) — the keys stay, the words are Hebrew. */
|
|
57
|
+
export const SEGMENTED_WORDS_HE: ReadonlyArray<SegmentedOptionWords> = [
|
|
58
|
+
{ key: 'monthly', label: 'חודשי' },
|
|
59
|
+
{ key: 'yearly', label: 'שנתי' },
|
|
60
|
+
];
|
|
61
|
+
export const SEGMENTED_NAME_HE = 'תקופת חיוב';
|
|
62
|
+
|
|
63
|
+
/** A fresh Segmented control's options and name in a language. */
|
|
64
|
+
export function segmentedWords(lang?: string | null): { options: ReadonlyArray<SegmentedOptionWords>; name: string } {
|
|
65
|
+
return recipeLang(lang) === 'he' ? { options: SEGMENTED_WORDS_HE, name: SEGMENTED_NAME_HE } : { options: SEGMENTED_WORDS, name: SEGMENTED_NAME };
|
|
66
|
+
}
|
|
55
67
|
|
|
56
68
|
enum Type {
|
|
57
69
|
Container = 'Container',
|
|
@@ -92,6 +104,8 @@ export interface SegmentedOptions {
|
|
|
92
104
|
defaultOn?: string;
|
|
93
105
|
/** The radio group's accessible name. */
|
|
94
106
|
label?: string;
|
|
107
|
+
/** The language of the default options and name (iox-ui#112; English when not given). */
|
|
108
|
+
lang?: string | null;
|
|
95
109
|
}
|
|
96
110
|
|
|
97
111
|
/** One option: a ButtonBlock carrying its key, holding its words. */
|
|
@@ -106,11 +120,12 @@ export function buildSegmentedOption(create: CompositeNodeFactory, words: Segmen
|
|
|
106
120
|
|
|
107
121
|
/** A fresh Segmented control: Monthly · Yearly, Monthly on, named "Billing period" (board 10 ▸ Palette). */
|
|
108
122
|
export function buildSegmentedRecipe(create: CompositeNodeFactory, options: SegmentedOptions = {}): CompositeNode {
|
|
109
|
-
const
|
|
123
|
+
const fresh = segmentedWords(options.lang);
|
|
124
|
+
const words = options.options ?? fresh.options;
|
|
110
125
|
const root = make(create, 'segmented', Type.Container, SegmentedRole.Segmented, Style.Root, {}, 'Segmented');
|
|
111
126
|
root.children = words.map(w => buildSegmentedOption(create, w));
|
|
112
127
|
writeProp(root, SegmentedTrait.DefaultOn, options.defaultOn && words.some(w => w.key === options.defaultOn) ? options.defaultOn : words[0]?.key ?? '');
|
|
113
|
-
writeProp(root, SegmentedTrait.Label, options.label ??
|
|
128
|
+
writeProp(root, SegmentedTrait.Label, options.label ?? fresh.name);
|
|
114
129
|
return root;
|
|
115
130
|
}
|
|
116
131
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CompositeNode, CompositeNodeFactory, makeCompositePart, NO_ELEMENT_STYLE, readProp, writeProp, writeStyles } from './composite-node';
|
|
2
|
+
import { recipeLang, RecipeLang } from './recipe-parts';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* THE ACCESSIBLE CAROUSEL (CC3 — complex-components plan §7c, board 6; board 9 Q13). The Slider's controls are no
|
|
@@ -455,7 +456,7 @@ export const SLIDER_WORDS: Readonly<Record<'en' | 'he', SliderWords>> = {
|
|
|
455
456
|
};
|
|
456
457
|
|
|
457
458
|
export function sliderWords(lang?: string | null): SliderWords {
|
|
458
|
-
return (lang
|
|
459
|
+
return SLIDER_WORDS[recipeLang(lang)];
|
|
459
460
|
}
|
|
460
461
|
|
|
461
462
|
/** The wrapper's live region (APG): silent while the slides move on their own, polite otherwise. */
|
|
@@ -494,10 +495,21 @@ export const CAROUSEL_QUOTES: ReadonlyArray<CarouselQuote> = [
|
|
|
494
495
|
{ quote: 'A third sample quote so the rotation has somewhere to go.', who: '[Client name] · [Project, city]' },
|
|
495
496
|
];
|
|
496
497
|
|
|
498
|
+
/** The same on a Hebrew site (iox-ui#112) — still placeholders. */
|
|
499
|
+
export const CAROUSEL_QUOTES_HE: ReadonlyArray<CarouselQuote> = [
|
|
500
|
+
{ quote: 'ציטוט לדוגמה, שתי שורות, במילים של הלקוח.', who: '[שם הלקוח] · [פרויקט, עיר]' },
|
|
501
|
+
{ quote: 'המלצות הן עובדות: החליפו אותן במילים שלקוח באמת אמר.', who: '[שם הלקוח] · [פרויקט, עיר]' },
|
|
502
|
+
{ quote: 'ציטוט שלישי לדוגמה, כדי שלמצגת יהיה לאן להמשיך.', who: '[שם הלקוח] · [פרויקט, עיר]' },
|
|
503
|
+
];
|
|
504
|
+
/** The carousel's name when the author gives none, per language. */
|
|
505
|
+
export const CAROUSEL_NAME: Readonly<Record<RecipeLang, string>> = { en: 'What clients say', he: 'מה הלקוחות אומרים' };
|
|
506
|
+
|
|
497
507
|
export interface CarouselOptions {
|
|
498
508
|
/** The carousel's accessible name (a `region` landmark). */
|
|
499
509
|
name?: string;
|
|
500
510
|
quotes?: ReadonlyArray<CarouselQuote>;
|
|
511
|
+
/** The language of the default quotes, name and control names (iox-ui#112; English when not given). */
|
|
512
|
+
lang?: string | null;
|
|
501
513
|
}
|
|
502
514
|
|
|
503
515
|
/** A quote card. The carousel's controls sit in a ROW above the slides and the dots below them (board 6), so the
|
|
@@ -520,11 +532,12 @@ export function buildCarouselRecipe(create: CompositeNodeFactory, options: Carou
|
|
|
520
532
|
for (const [name, value] of Object.entries({
|
|
521
533
|
// Rewind: Previous and Next are always there to press (board 6) — neither greys out at an end.
|
|
522
534
|
slidesPerView: 1, spaceBetween: 0, loop: 'rewind', enableNavigation: true, enablePagination: true, enableAutoplay: true, autoplayDelay: 5000,
|
|
523
|
-
autoplayPauseOnMouseEnter: true, autoHeight: true, [SLIDER_NAME_TRAIT]: options.name ??
|
|
535
|
+
autoplayPauseOnMouseEnter: true, autoHeight: true, [SLIDER_NAME_TRAIT]: options.name ?? CAROUSEL_NAME[recipeLang(options.lang)],
|
|
524
536
|
// Board 6 draws its controls in a row above the quotes — its own place, not the M4 bar under a picture.
|
|
525
537
|
[SLIDER_PLACEMENT_TRAIT]: SliderPlacement.Over,
|
|
526
538
|
})) writeProp(slider, name, value);
|
|
527
|
-
|
|
539
|
+
const lang = recipeLang(options.lang);
|
|
540
|
+
slider.children = (options.quotes ?? (lang === 'he' ? CAROUSEL_QUOTES_HE : CAROUSEL_QUOTES)).map((q, i) => {
|
|
528
541
|
const slide = makeCompositePart(create, { key: `slide-${i + 1}`, type: SLIDE_TYPE, props: {}, elementStyle: 'card' }, null, 'Slide', QUOTE_SLIDE_BASE);
|
|
529
542
|
slide.children = [
|
|
530
543
|
makeCompositePart(create, { key: `quote-${i + 1}`, type: 'Text', props: { content: q.quote, tag: 'p' }, elementStyle: 'lead' }, null, 'Quote', QUOTE_TEXT_BASE),
|
|
@@ -533,9 +546,12 @@ export function buildCarouselRecipe(create: CompositeNodeFactory, options: Carou
|
|
|
533
546
|
return slide;
|
|
534
547
|
});
|
|
535
548
|
syncSliderParts(slider, create);
|
|
549
|
+
const words = SLIDER_WORDS[lang];
|
|
536
550
|
for (const part of slider.children ?? []) {
|
|
537
551
|
if (part.role === SliderRole.Pagination) writeStyles(part, ROW_DOTS_BASE);
|
|
538
552
|
else if (isSliderPart(part)) writeStyles(part, ROW_CONTROL_BASE);
|
|
553
|
+
// The arrows' names in the site's language (the pause control's are the runtime's, `sliderPauseAttributes`).
|
|
554
|
+
if (part.role === SliderRole.Prev || part.role === SliderRole.Next) writeProp(part, SLIDER_NAME_TRAIT, part.role === SliderRole.Prev ? words.prev : words.next);
|
|
539
555
|
}
|
|
540
556
|
return slider;
|
|
541
557
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { elementStyleById } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
import { recipeLang } from './recipe-parts';
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
AccordionDomIds, accordionDomIds, AccordionKeyAction, CompositeBinding, compositeScopeId, ContentFieldLike, COMPOSITE_ATTRIBUTE, DomAttributes,
|
|
@@ -69,6 +70,18 @@ export const TABS_WORDS: ReadonlyArray<TabWords> = [
|
|
|
69
70
|
{ label: 'Third tab', text: 'Say what this tab is about in a sentence or two. Its picture sits beside it.' },
|
|
70
71
|
];
|
|
71
72
|
export const TABS_NEW_TAB_WORDS: Readonly<TabWords> = { label: 'New tab', text: 'Say what this tab is about in a sentence or two. Its picture sits beside it.' };
|
|
73
|
+
/** The same on a Hebrew site (iox-ui#112). */
|
|
74
|
+
export const TABS_WORDS_HE: ReadonlyArray<TabWords> = [
|
|
75
|
+
{ label: 'לשונית ראשונה', text: 'כתבו במשפט או שניים על מה הלשונית הזו. התמונה שלה לצידה.' },
|
|
76
|
+
{ label: 'לשונית שנייה', text: 'כתבו במשפט או שניים על מה הלשונית הזו. התמונה שלה לצידה.' },
|
|
77
|
+
{ label: 'לשונית שלישית', text: 'כתבו במשפט או שניים על מה הלשונית הזו. התמונה שלה לצידה.' },
|
|
78
|
+
];
|
|
79
|
+
export const TABS_NEW_TAB_WORDS_HE: Readonly<TabWords> = { label: 'לשונית חדשה', text: 'כתבו במשפט או שניים על מה הלשונית הזו. התמונה שלה לצידה.' };
|
|
80
|
+
|
|
81
|
+
/** A fresh Tabs' words in a language. */
|
|
82
|
+
export function tabsWords(lang?: string | null): ReadonlyArray<TabWords> {
|
|
83
|
+
return recipeLang(lang) === 'he' ? TABS_WORDS_HE : TABS_WORDS;
|
|
84
|
+
}
|
|
72
85
|
|
|
73
86
|
enum Type {
|
|
74
87
|
Container = 'Container',
|
|
@@ -143,6 +156,8 @@ export interface TabsOptions {
|
|
|
143
156
|
orientation?: TabsOrientation;
|
|
144
157
|
/** The tab list's accessible name (empty: unnamed — a section heading usually names the section). */
|
|
145
158
|
label?: string;
|
|
159
|
+
/** The language of the default tabs' words (iox-ui#112; English when not given). */
|
|
160
|
+
lang?: string | null;
|
|
146
161
|
}
|
|
147
162
|
|
|
148
163
|
function make(create: CompositeNodeFactory, key: string, type: string, role: TabsRole | null, style: string,
|
|
@@ -181,7 +196,7 @@ export function buildTabsRecipe(create: CompositeNodeFactory, options: TabsOptio
|
|
|
181
196
|
if (options.label) writeProp(root, TabsBehaviourTrait.Label, options.label);
|
|
182
197
|
const list = make(create, 'list', Type.Container, TabsRole.List, Style.List, {}, 'Tab list');
|
|
183
198
|
const panels = make(create, 'panels', Type.Container, TabsRole.Panels, Style.Panels, {}, 'Panels');
|
|
184
|
-
const pairs = (options.tabs ??
|
|
199
|
+
const pairs = (options.tabs ?? tabsWords(options.lang)).map((w, i) => buildTabPair(create, w, `k${i + 1}`));
|
|
185
200
|
list.children = pairs.map(p => p.tab);
|
|
186
201
|
panels.children = pairs.map(p => p.panel);
|
|
187
202
|
root.children = [list, panels];
|
|
@@ -66,6 +66,15 @@ const NOT_CONTENT: ReadonlySet<string> = new Set(['rule', 'media']);
|
|
|
66
66
|
/** Styles whose fill IS their mark (premium M6: a reading bar): the fill is judged as a graphic (3:1, WCAG 1.4.11) against
|
|
67
67
|
* the ground it sits on, never its own ink on it — it holds no words. The contract's audit, 1:1. */
|
|
68
68
|
export const MARK_STYLES: ReadonlySet<string> = new Set(['progress-bar']);
|
|
69
|
+
/**
|
|
70
|
+
* A LINK in running text draws no line (Doron 2026-11-22) and must still be told from the words around it (WCAG 1.4.1):
|
|
71
|
+
* by its WEIGHT — at least `LINK_WEIGHT_STEP` above the body's (technique G182) — else by a colour ≥ 3:1 against its
|
|
72
|
+
* text's ink (G183), judged as the `beside text` pair. Colour alone cannot carry it in every look: a Brand or Muted
|
|
73
|
+
* section has one ink. The contract's audit, 1:1 (colour.mjs `TEXT_LINK_STYLES`).
|
|
74
|
+
*/
|
|
75
|
+
export const TEXT_LINK_STYLES: ReadonlySet<string> = new Set(['link']);
|
|
76
|
+
export const LINK_WEIGHT_STEP = 100;
|
|
77
|
+
const BODY_STYLE = 'body';
|
|
69
78
|
const SECTION_STYLE = 'section';
|
|
70
79
|
const ICON_STYLE = 'icon';
|
|
71
80
|
const GLYPH_GROUP = 'Media';
|
|
@@ -95,6 +104,10 @@ const opaque = (paints: Rgba[]) => paints.some(c => c.a > 0);
|
|
|
95
104
|
|
|
96
105
|
const ownStyle = (e: ElementStyle) => (e.base ?? {}) as StyleMap;
|
|
97
106
|
|
|
107
|
+
/** How much heavier a style's words are than the body's (NaN when either weight is not a number). */
|
|
108
|
+
const weightStep = (values: Values, style: StyleMap, bodyWeight: string | undefined) =>
|
|
109
|
+
Number(resolveIn(values, style['fontWeight'])) - Number(resolveIn(values, bodyWeight));
|
|
110
|
+
|
|
98
111
|
function inkScoped(values: Values, styleId: string): Values {
|
|
99
112
|
const scope = INK_SCOPES.find(s => s.styles.includes(styleId));
|
|
100
113
|
return scope ? { ...values, ...scope.set } : values;
|
|
@@ -149,6 +162,7 @@ function sweepDesignContrast(rows: ReadonlyArray<DesignTokenLike>, mode: Resolve
|
|
|
149
162
|
const notices = styles.filter(e => e.group === FORMS_GROUP && ownStyle(e)['color']);
|
|
150
163
|
const section = ownStyle(byId.get(SECTION_STYLE) as ElementStyle);
|
|
151
164
|
const iconColour = ownStyle(byId.get(ICON_STYLE) as ElementStyle)['color'];
|
|
165
|
+
const bodyWeight = ownStyle(byId.get(BODY_STYLE) as ElementStyle)['fontWeight'];
|
|
152
166
|
|
|
153
167
|
for (const schemeId of SCHEME_IDS) {
|
|
154
168
|
const values = resolveSchemeTokenValues(rows, mode, schemeId);
|
|
@@ -195,6 +209,10 @@ function sweepDesignContrast(rows: ReadonlyArray<DesignTokenLike>, mode: Resolve
|
|
|
195
209
|
const under = fill.length && opaque(fill) ? overAll(fill, bgs) : bgs;
|
|
196
210
|
const ink = s['color'] ? parseCssColour(resolveIn(values, s['color']), boxInk) : boxInk;
|
|
197
211
|
check(e.id, state === 'base' ? (glyph ? 'glyph' : 'text') : `${state} text`, ink, under, glyph ? WCAG_AA_UI : WCAG_AA_TEXT);
|
|
212
|
+
// A link in running text: its weight tells it from its text, else its colour must (3:1 against the text's ink).
|
|
213
|
+
if (state === 'base' && TEXT_LINK_STYLES.has(e.id) && !(weightStep(values, s, bodyWeight) >= LINK_WEIGHT_STEP)) {
|
|
214
|
+
check(e.id, 'beside text', ink, boxInk ? [boxInk] : [], WCAG_AA_UI);
|
|
215
|
+
}
|
|
198
216
|
// The active tab's mark is the selected state's indicator (WCAG 1.4.11) — the contract's audit, 1:1.
|
|
199
217
|
const on = state === 'on' ? (e.on as StyleMap | undefined) : undefined;
|
|
200
218
|
const mark = on?.['borderColor'];
|