@descope/web-components-ui 3.21.0 → 3.22.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/dist/index.esm.js CHANGED
@@ -24921,7 +24921,8 @@ var collapsibleContainer$1 = /*#__PURE__*/Object.freeze({
24921
24921
  const componentName$h = getComponentName$1('recovery-codes');
24922
24922
 
24923
24923
  const NO_ACTION = 'none';
24924
- const DEFAULT_ERROR_MESSAGE = 'Please save your recovery codes to continue';
24924
+ const DEFAULT_ERROR_MESSAGE =
24925
+ 'Copy or download your recovery codes to continue.';
24925
24926
 
24926
24927
  // default button label per action (buttons variant). the icons variant uses the vaadin
24927
24928
  // glyphs hardcoded in the shadow-DOM template below; the buttons variant uses image srcs.
@@ -26327,7 +26328,11 @@ const resolveAuthType = (authType) => {
26327
26328
  return { label: authType.toUpperCase(), configured: true };
26328
26329
  };
26329
26330
 
26330
- const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26331
+ const itemRenderer$1 = (
26332
+ { id, name, isDefault, link, authType, authOnly },
26333
+ _,
26334
+ ref,
26335
+ ) => {
26331
26336
  const deleteAction =
26332
26337
  !isDefault && ref?.allowDelete
26333
26338
  ? `<span
@@ -26350,9 +26355,14 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26350
26355
  : '';
26351
26356
 
26352
26357
  const { label: authTypeLabel, configured } = resolveAuthType(authType);
26358
+ // Sits next to the auth type because it says what the connection is FOR, the same kind of fact.
26359
+ const authOnlyBadge = authOnly
26360
+ ? `<descope-badge class="auth-only-badge" size="xs"><span class="auth-only-text"></span></descope-badge>`
26361
+ : '';
26353
26362
  const authTypeRow = configured
26354
26363
  ? `<div class="auth-type-row">
26355
26364
  <descope-badge class="auth-type-badge" size="xs"></descope-badge>
26365
+ ${authOnlyBadge}
26356
26366
  </div>`
26357
26367
  : `<div class="auth-type-row">
26358
26368
  <descope-text
@@ -26360,6 +26370,7 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26360
26370
  variant="body2"
26361
26371
  mode="secondary"
26362
26372
  >${ref?.notConfiguredLabel}</descope-text>
26373
+ ${authOnlyBadge}
26363
26374
  </div>`;
26364
26375
 
26365
26376
  const template = document.createElement('template');
@@ -26404,6 +26415,9 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26404
26415
 
26405
26416
  const authTypeBadge = template.content.querySelector('.auth-type-badge');
26406
26417
  if (authTypeBadge) authTypeBadge.textContent = authTypeLabel;
26418
+
26419
+ const authOnlyEl = template.content.querySelector('.auth-only-text');
26420
+ if (authOnlyEl) authOnlyEl.textContent = ref?.authOnlyLabel;
26407
26421
  return template;
26408
26422
  };
26409
26423
 
@@ -26528,6 +26542,28 @@ class RawMultiSsoClass extends BaseClass$3 {
26528
26542
  .auth-type-row {
26529
26543
  display: flex;
26530
26544
  align-items: center;
26545
+ min-width: 0;
26546
+ }
26547
+
26548
+ /* The auth type is short and fixed, so it keeps its size and the consumer-supplied label is
26549
+ the one that gives way. */
26550
+ .auth-type-badge {
26551
+ flex-shrink: 0;
26552
+ }
26553
+
26554
+ /* The label is consumer-supplied and localized, so it can be far longer than the row. It
26555
+ shrinks to whatever the row leaves it and ellipsises only then, rather than being held to a
26556
+ fixed width that would truncate it while space is still going spare. */
26557
+ .auth-only-badge {
26558
+ min-width: 0;
26559
+ flex-shrink: 1;
26560
+ }
26561
+
26562
+ .auth-only-text {
26563
+ display: block;
26564
+ overflow: hidden;
26565
+ text-overflow: ellipsis;
26566
+ white-space: nowrap;
26531
26567
  }
26532
26568
 
26533
26569
  .action {
@@ -26575,6 +26611,10 @@ class RawMultiSsoClass extends BaseClass$3 {
26575
26611
  return this.getAttribute('configure-tooltip-label') ?? '';
26576
26612
  }
26577
26613
 
26614
+ get authOnlyLabel() {
26615
+ return this.getAttribute('auth-only-label') || 'Authentication only';
26616
+ }
26617
+
26578
26618
  init() {
26579
26619
  super.init?.();
26580
26620
 
@@ -26696,6 +26736,10 @@ const MultiSsoClass = compose$1(
26696
26736
  selector: () => '.action',
26697
26737
  property: 'gap',
26698
26738
  },
26739
+ authTypeRowGap: {
26740
+ selector: () => '.auth-type-row',
26741
+ property: 'gap',
26742
+ },
26699
26743
  unconfiguredAuthTypeTextColor: {
26700
26744
  selector: () => '[not-configured]',
26701
26745
  property: TextClass.cssVarList.textColor,
@@ -26827,6 +26871,7 @@ const MultiSsoClass = compose$1(
26827
26871
  'not-configured-label',
26828
26872
  'delete-tooltip-label',
26829
26873
  'configure-tooltip-label',
26874
+ 'auth-only-label',
26830
26875
  ],
26831
26876
  }),
26832
26877
  componentNameValidationMixin$1,
@@ -26842,6 +26887,8 @@ const MultiSso = {
26842
26887
  [vars$P.headerListGap]: globalRefs$s.spacing.md,
26843
26888
  [vars$P.itemContentGap]: globalRefs$s.spacing.md,
26844
26889
  [vars$P.actionGap]: globalRefs$s.spacing.sm,
26890
+ // keeps the authentication-only badge off the auth-type badge beside it
26891
+ [vars$P.authTypeRowGap]: globalRefs$s.spacing.sm,
26845
26892
  [vars$P.unconfiguredAuthTypeTextColor]: globalRefs$s.colors.surface.dark,
26846
26893
  [vars$P.unconfiguredAuthTypeTextFontStyle]: 'italic',
26847
26894
  [vars$P.buttonMaxWidth]: '50%',