@descope/web-components-ui 3.21.1 → 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
@@ -26328,7 +26328,11 @@ const resolveAuthType = (authType) => {
26328
26328
  return { label: authType.toUpperCase(), configured: true };
26329
26329
  };
26330
26330
 
26331
- const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26331
+ const itemRenderer$1 = (
26332
+ { id, name, isDefault, link, authType, authOnly },
26333
+ _,
26334
+ ref,
26335
+ ) => {
26332
26336
  const deleteAction =
26333
26337
  !isDefault && ref?.allowDelete
26334
26338
  ? `<span
@@ -26351,9 +26355,14 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26351
26355
  : '';
26352
26356
 
26353
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
+ : '';
26354
26362
  const authTypeRow = configured
26355
26363
  ? `<div class="auth-type-row">
26356
26364
  <descope-badge class="auth-type-badge" size="xs"></descope-badge>
26365
+ ${authOnlyBadge}
26357
26366
  </div>`
26358
26367
  : `<div class="auth-type-row">
26359
26368
  <descope-text
@@ -26361,6 +26370,7 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26361
26370
  variant="body2"
26362
26371
  mode="secondary"
26363
26372
  >${ref?.notConfiguredLabel}</descope-text>
26373
+ ${authOnlyBadge}
26364
26374
  </div>`;
26365
26375
 
26366
26376
  const template = document.createElement('template');
@@ -26405,6 +26415,9 @@ const itemRenderer$1 = ({ id, name, isDefault, link, authType }, _, ref) => {
26405
26415
 
26406
26416
  const authTypeBadge = template.content.querySelector('.auth-type-badge');
26407
26417
  if (authTypeBadge) authTypeBadge.textContent = authTypeLabel;
26418
+
26419
+ const authOnlyEl = template.content.querySelector('.auth-only-text');
26420
+ if (authOnlyEl) authOnlyEl.textContent = ref?.authOnlyLabel;
26408
26421
  return template;
26409
26422
  };
26410
26423
 
@@ -26529,6 +26542,28 @@ class RawMultiSsoClass extends BaseClass$3 {
26529
26542
  .auth-type-row {
26530
26543
  display: flex;
26531
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;
26532
26567
  }
26533
26568
 
26534
26569
  .action {
@@ -26576,6 +26611,10 @@ class RawMultiSsoClass extends BaseClass$3 {
26576
26611
  return this.getAttribute('configure-tooltip-label') ?? '';
26577
26612
  }
26578
26613
 
26614
+ get authOnlyLabel() {
26615
+ return this.getAttribute('auth-only-label') || 'Authentication only';
26616
+ }
26617
+
26579
26618
  init() {
26580
26619
  super.init?.();
26581
26620
 
@@ -26697,6 +26736,10 @@ const MultiSsoClass = compose$1(
26697
26736
  selector: () => '.action',
26698
26737
  property: 'gap',
26699
26738
  },
26739
+ authTypeRowGap: {
26740
+ selector: () => '.auth-type-row',
26741
+ property: 'gap',
26742
+ },
26700
26743
  unconfiguredAuthTypeTextColor: {
26701
26744
  selector: () => '[not-configured]',
26702
26745
  property: TextClass.cssVarList.textColor,
@@ -26828,6 +26871,7 @@ const MultiSsoClass = compose$1(
26828
26871
  'not-configured-label',
26829
26872
  'delete-tooltip-label',
26830
26873
  'configure-tooltip-label',
26874
+ 'auth-only-label',
26831
26875
  ],
26832
26876
  }),
26833
26877
  componentNameValidationMixin$1,
@@ -26843,6 +26887,8 @@ const MultiSso = {
26843
26887
  [vars$P.headerListGap]: globalRefs$s.spacing.md,
26844
26888
  [vars$P.itemContentGap]: globalRefs$s.spacing.md,
26845
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,
26846
26892
  [vars$P.unconfiguredAuthTypeTextColor]: globalRefs$s.colors.surface.dark,
26847
26893
  [vars$P.unconfiguredAuthTypeTextFontStyle]: 'italic',
26848
26894
  [vars$P.buttonMaxWidth]: '50%',