@vectoriox/iox-ui 5.112.0 → 5.113.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/design-core/index.d.ts +80 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +94 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +58 -39
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/generation-core/index.d.ts +2 -44
- package/package.json +1 -1
- package/src/design-core/flavor-spec.generated.ts +94 -0
- package/src/generation-core/compose-layout.ts +57 -18
- package/src/generation-core/site-spec.generated.ts +1 -22
- package/styles/iox-design.css +39 -0
|
@@ -7096,28 +7096,7 @@ const SPEC_SITE_LAYOUT = {
|
|
|
7096
7096
|
"phone.stack": "one under another",
|
|
7097
7097
|
"phone.two-up": "two across"
|
|
7098
7098
|
},
|
|
7099
|
-
"waits": {
|
|
7100
|
-
"arrange.deck": {
|
|
7101
|
-
"phase": "LI4",
|
|
7102
|
-
"drawnAs": "row"
|
|
7103
|
-
},
|
|
7104
|
-
"who.middle": {
|
|
7105
|
-
"phase": "LI4",
|
|
7106
|
-
"drawnAs": "none"
|
|
7107
|
-
},
|
|
7108
|
-
"how.bigger": {
|
|
7109
|
-
"phase": "LI4",
|
|
7110
|
-
"drawnAs": null
|
|
7111
|
-
},
|
|
7112
|
-
"how.raised": {
|
|
7113
|
-
"phase": "LI4",
|
|
7114
|
-
"drawnAs": null
|
|
7115
|
-
},
|
|
7116
|
-
"how.brighter": {
|
|
7117
|
-
"phase": "LI4",
|
|
7118
|
-
"drawnAs": null
|
|
7119
|
-
}
|
|
7120
|
-
},
|
|
7099
|
+
"waits": {},
|
|
7121
7100
|
"defaults": {
|
|
7122
7101
|
"item": "card",
|
|
7123
7102
|
"arrange": "grid",
|
|
@@ -17165,6 +17144,8 @@ function galleryLayer(id, l, lc, ctx) {
|
|
|
17165
17144
|
/** The width a row's card takes: three across a laptop, most of a phone's width with the next one peeking. */
|
|
17166
17145
|
const LIST_ROW_SLIDE = `calc((100% - ${2 * SLIDE_GAP}px) / 3)`;
|
|
17167
17146
|
const LIST_ROW_SLIDE_PHONE = '82%';
|
|
17147
|
+
/** A deck is one card wide (LI4): a laptop's card, most of a phone. */
|
|
17148
|
+
const LIST_DECK_WIDTH = 'min(440px, 80%)';
|
|
17168
17149
|
const LIST_GAP = 'var(--iox-space-gap)';
|
|
17169
17150
|
const LIST_PHOTO_ASPECT = '4 / 3';
|
|
17170
17151
|
/** A row or a deck turns by itself this often (the wire's autoplay). */
|
|
@@ -17292,10 +17273,11 @@ function composeList(id, l, mix, source, list, lc, ctx) {
|
|
|
17292
17273
|
arrange = arrangeWait.drawnAs;
|
|
17293
17274
|
}
|
|
17294
17275
|
const strips = arrange === LayoutListArrange.Strips;
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17276
|
+
const deck = arrange === LayoutListArrange.Deck;
|
|
17277
|
+
const standout = mix.standout && mix.standout.who !== LayoutListWho.None ? mix.standout : null;
|
|
17278
|
+
const standWait = standout ? listWait('who', standout.who) ?? (standout.how ? listWait('how', standout.how) : null) : null;
|
|
17279
|
+
if (standout && standWait) {
|
|
17280
|
+
gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.standout`, `standing out (${standout.who}${standout.how ? ` · ${standout.how}` : ''}) is drawn in ${standWait.phase}`);
|
|
17299
17281
|
}
|
|
17300
17282
|
const masonry = arrange === LayoutListArrange.Masonry;
|
|
17301
17283
|
const item = mix.item === LayoutListItem.Card
|
|
@@ -17304,40 +17286,48 @@ function composeList(id, l, mix, source, list, lc, ctx) {
|
|
|
17304
17286
|
if (strips)
|
|
17305
17287
|
return composeStrips(id, frame, item, mix, source, ctx);
|
|
17306
17288
|
item.interactions = [...item.interactions, listArriveInteraction(item.id, mix.arrive, ctx)];
|
|
17307
|
-
|
|
17289
|
+
// LI4: the one that stands out — a deck's top card IS its standing out; strips draw their own (wider).
|
|
17290
|
+
const shown = standout && !standWait && !deck ? standWrap(`${id}-stand`, item, standout) : item;
|
|
17291
|
+
if (arrange === LayoutListArrange.Row || deck) {
|
|
17308
17292
|
const scrollPlays = mix.move.includes(LayoutListMove.Page) && !lc.held;
|
|
17309
17293
|
const played = scrollPlays || lc.held;
|
|
17310
17294
|
const drag = mix.move.includes(LayoutListMove.Drag);
|
|
17311
17295
|
const slider = create$1(`${id}-slider`, T.Slider, {
|
|
17312
|
-
|
|
17313
|
-
|
|
17296
|
+
// A deck (LI4) is Swiper's cards: one card on top, the rest waiting behind, dragged away or stepped.
|
|
17297
|
+
dir: ctx.rtl ? 'rtl' : 'ltr', effect: deck ? 'cards' : 'slide', slidesPerView: deck ? 1 : 'auto', spaceBetween: deck ? 0 : SLIDE_GAP,
|
|
17298
|
+
centeredSlides: !deck && standout?.who === LayoutListWho.Middle, loop: 'off', freeMode: !deck && drag && !played, grabCursor: drag && !played,
|
|
17314
17299
|
speed: GALLERY_SPEED, enableParallax: false, enableAutoplay: mix.move.includes(LayoutListMove.Auto) && !played,
|
|
17315
17300
|
autoplayDelay: LIST_AUTOPLAY_MS, autoplayDisableOnInteraction: true, enableKeyboard: true, scrollPlays,
|
|
17316
17301
|
enableCaption: false, enableCount: false, enableNavigation: mix.move.includes(LayoutListMove.Arrows) && !played,
|
|
17317
17302
|
[SLIDER_PLACEMENT_TRAIT]: SliderPlacement.Under, ariaLabel: l.text ?? '',
|
|
17318
17303
|
}, NO_ELEMENT_STYLE);
|
|
17319
17304
|
slider.bindings.push({ prop: 'source', source, path: '' });
|
|
17320
|
-
setStyleProps(slider, scrollPlays ? { width: FULL, height: FULL, minHeight: ZERO$1 } : {
|
|
17305
|
+
setStyleProps(slider, scrollPlays ? { width: FULL, height: FULL, minHeight: ZERO$1 } : deck ? {
|
|
17306
|
+
// A deck fills its holder (below); the cards behind show past its edges.
|
|
17307
|
+
width: FULL, height: FULL, minHeight: ZERO$1, display: 'flex', flexDirection: 'column', overflow: 'visible',
|
|
17308
|
+
} : {
|
|
17321
17309
|
position: 'absolute', top: ZERO$1, right: ZERO$1, bottom: ZERO$1, left: ZERO$1, width: FULL, height: FULL, minHeight: ZERO$1,
|
|
17322
17310
|
display: 'flex', flexDirection: 'column',
|
|
17323
17311
|
});
|
|
17324
|
-
phone(slider, scrollPlays ? { height: 'auto' } : { position: 'relative', height: 'auto' });
|
|
17312
|
+
phone(slider, scrollPlays || deck ? { height: 'auto' } : { position: 'relative', height: 'auto' });
|
|
17325
17313
|
// A row keeps its own slide width on a phone (most of the screen, the next item peeking): the slider's phone
|
|
17326
|
-
// default is one slide the full width, unless the phone layer names its slides per view.
|
|
17327
|
-
|
|
17314
|
+
// default is one slide the full width, unless the phone layer names its slides per view. A deck stays a deck.
|
|
17315
|
+
if (!deck)
|
|
17316
|
+
slider.responsive[LAYOUT_PHONE_BREAKPOINT].inputs = { slidesPerView: 'auto' };
|
|
17328
17317
|
if (mix.phone !== LayoutListPhone.Swipe)
|
|
17329
|
-
gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, `a
|
|
17318
|
+
gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, `a ${arrange} stays one you swipe on a phone (${mix.phone} is a grid's)`);
|
|
17330
17319
|
const slide = create$1(`${id}-slide`, T.Slide, { caption: '' }, NO_ELEMENT_STYLE);
|
|
17331
|
-
setStyleProps(slide, { width: LIST_ROW_SLIDE, height: FULL, display: 'flex', aspectRatio: 'auto' });
|
|
17332
|
-
|
|
17333
|
-
|
|
17320
|
+
setStyleProps(slide, { width: deck ? FULL : LIST_ROW_SLIDE, height: FULL, display: 'flex', aspectRatio: 'auto' });
|
|
17321
|
+
if (!deck)
|
|
17322
|
+
phone(slide, { width: LIST_ROW_SLIDE_PHONE });
|
|
17323
|
+
slide.children = [shown];
|
|
17334
17324
|
slider.children = [slide];
|
|
17335
17325
|
syncSliderParts(slider, partFactory(`${id}-slider`));
|
|
17336
17326
|
walkSerialized([slider], node => {
|
|
17337
17327
|
if (node.role === SliderRole.Prev || node.role === SliderRole.Next)
|
|
17338
17328
|
node.props[LAYOUT_TOOLTIP_TRAIT] = node.props['ariaLabel'];
|
|
17339
17329
|
});
|
|
17340
|
-
frame.children = [slider];
|
|
17330
|
+
frame.children = [deck ? deckHolder(`${id}-deck`, slider) : slider];
|
|
17341
17331
|
return frame;
|
|
17342
17332
|
}
|
|
17343
17333
|
const items = create$1(`${id}-items`, 'Repeater', {}, 'box');
|
|
@@ -17355,10 +17345,39 @@ function composeList(id, l, mix, source, list, lc, ctx) {
|
|
|
17355
17345
|
if (mix.phone === LayoutListPhone.Swipe)
|
|
17356
17346
|
gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, 'a grid stacks on a phone; only a row swipes');
|
|
17357
17347
|
}
|
|
17358
|
-
items.children = [
|
|
17348
|
+
items.children = [shown];
|
|
17359
17349
|
frame.children = [items];
|
|
17360
17350
|
return frame;
|
|
17361
17351
|
}
|
|
17352
|
+
/**
|
|
17353
|
+
* A deck (LI4) is a card wide, centred in its cell. The width sits on a holder, never the slider: the slider's own
|
|
17354
|
+
* scoped `.swiper { width: 100% }` out-ranks a node's width class. On a phone the holder is the cell's width and the
|
|
17355
|
+
* shared `.swiper.swiper-cards` rule (iox-design.css) makes the deck a centred card with its neighbours peeking.
|
|
17356
|
+
*/
|
|
17357
|
+
function deckHolder(id, slider) {
|
|
17358
|
+
const holder = create$1(id, T.Container, {}, NO_ELEMENT_STYLE);
|
|
17359
|
+
setStyleProps(holder, {
|
|
17360
|
+
position: 'absolute', top: ZERO$1, right: ZERO$1, bottom: ZERO$1, left: ZERO$1, width: LIST_DECK_WIDTH, maxWidth: FULL, height: FULL,
|
|
17361
|
+
minHeight: ZERO$1, margin: '0px auto', display: 'flex', flexDirection: 'column',
|
|
17362
|
+
});
|
|
17363
|
+
phone(holder, { position: 'relative', height: 'auto', width: FULL });
|
|
17364
|
+
holder.children = [slider];
|
|
17365
|
+
return holder;
|
|
17366
|
+
}
|
|
17367
|
+
/**
|
|
17368
|
+
* Standing out (LI4): the item inside a holder whose role names who and how (`list.first-bigger`) — the shared CSS
|
|
17369
|
+
* (iox-design.css) finds the one that stands out (the first row, Swiper's active slide, the one pointed at or focused)
|
|
17370
|
+
* and moves it by the look's tokens; `brighter` rests the others. The holder, never the card, moves: the card keeps
|
|
17371
|
+
* its own hover and arrival.
|
|
17372
|
+
*/
|
|
17373
|
+
function standWrap(id, item, standout) {
|
|
17374
|
+
const holder = create$1(id, T.Container, {}, NO_ELEMENT_STYLE);
|
|
17375
|
+
holder.role = `${LayoutListRole.List}.${standout.who}-${standout.how ?? LayoutListHow.Raised}`;
|
|
17376
|
+
setStyleProps(holder, { position: 'relative', display: 'flex', flexDirection: 'column', width: FULL, minHeight: ZERO$1 });
|
|
17377
|
+
setStyleProps(item, { flexGrow: '1' });
|
|
17378
|
+
holder.children = [item];
|
|
17379
|
+
return holder;
|
|
17380
|
+
}
|
|
17362
17381
|
/**
|
|
17363
17382
|
* Strips (LI3): a Repeater over the list whose ONE row is a strip item holding the card (picture filling it, words on
|
|
17364
17383
|
* the scrim) or the picture. Everything strips DO — the open one wider, pointing and focus, the phone — is the shared
|