@vectoriox/iox-ui 5.41.0 → 5.41.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.
@@ -758,6 +758,8 @@ interface CardOptions extends CardEditOptions {
758
758
  parts?: Partial<Record<CardPart, boolean>>;
759
759
  words?: Partial<CardWords>;
760
760
  badgeTone?: BadgeTone;
761
+ /** The badge's glyph (else its tone's — `BADGE_TONE_ICONS`): the pricing pattern's "Most popular" sparkle (CC4b). */
762
+ badgeIcon?: string;
761
763
  }
762
764
  /** A fresh Card v2: every part a node with its role and element style, laid out by `options.layout`. */
763
765
  declare function buildCardRecipe(create: CompositeNodeFactory, options?: CardOptions): CompositeNode;
@@ -1690,8 +1690,8 @@ const PART_BUILDERS = {
1690
1690
  media.children = [image];
1691
1691
  return media;
1692
1692
  },
1693
- [CardPart.Badge]: (create, words, tone) => {
1694
- const badge = buildBadge(create, { tone, text: words.badge, key: 'badge' });
1693
+ [CardPart.Badge]: (create, words, tone, badgeIcon) => {
1694
+ const badge = buildBadge(create, { tone, text: words.badge, key: 'badge', ...(badgeIcon ? { icon: badgeIcon } : {}) });
1695
1695
  badge.role = CardRole.Badge;
1696
1696
  badge.label = 'Badge';
1697
1697
  return badge;
@@ -1728,7 +1728,7 @@ function buildCardRecipe(create, options = {}) {
1728
1728
  ];
1729
1729
  card.children = [...(on(CardPart.Media) ? [PART_BUILDERS[CardPart.Media](create, words, tone)] : []), content];
1730
1730
  if (on(CardPart.Badge))
1731
- placeBadge(card, PART_BUILDERS[CardPart.Badge](create, words, tone), true);
1731
+ placeBadge(card, PART_BUILDERS[CardPart.Badge](create, words, tone, options.badgeIcon), true);
1732
1732
  applyCardLayout(card, options.layout ?? CardLayout.Top, options);
1733
1733
  return card;
1734
1734
  }
@@ -3237,10 +3237,12 @@ var Style;
3237
3237
  })(Style || (Style = {}));
3238
3238
  const ZERO_BOX = '0px 0px 0px 0px';
3239
3239
  /** What each part holds — layout only; its LOOK is its element style (the track's fill, border, radius and pad; the
3240
- * option's ink, pad, radius and 44px target). The options sit in a flex row a gap token apart (board 10). */
3240
+ * option's ink, pad, radius and 44px target). The options sit in a flex row a gap token apart (board 10); each GROWS,
3241
+ * which changes nothing while the track hugs them and shares the row when the track is stretched (the pricing
3242
+ * pattern's phone layer: board 10's full-width control). */
3241
3243
  const PART_BASE = {
3242
3244
  [SegmentedRole.Segmented]: { display: 'inline-flex', flexDirection: 'row', alignItems: 'stretch', gap: 'var(--iox-segmented-gap)', width: 'auto', maxWidth: '100%', height: 'auto' },
3243
- [SegmentedRole.Option]: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', gap: '8px', width: 'auto', height: 'auto', cursor: 'pointer' },
3245
+ [SegmentedRole.Option]: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', gap: '8px', width: 'auto', height: 'auto', cursor: 'pointer', flexGrow: '1' },
3244
3246
  };
3245
3247
  const LABEL_BASE = { width: 'auto', minHeight: 'auto', padding: ZERO_BOX, margin: ZERO_BOX };
3246
3248
  /** The badge inside an option keeps to the option's row (never its own line). */