@descope/web-components-ui 2.1.17 → 2.1.18

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.
@@ -1446,16 +1446,25 @@ const globals = {
1446
1446
  };
1447
1447
  getThemeVars$1(globals);
1448
1448
 
1449
- const createCssVar$1 = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;
1449
+ const getOverrideCssVarName$1 = (origVarName) => `${origVarName}__override`;
1450
+
1451
+ const createCssVar$1 = (varName, fallback, createOverride = false) => {
1452
+ const ret = `var(${varName}${fallback ? `, ${fallback}` : ''})`;
1453
+
1454
+ if (!createOverride) return ret;
1455
+
1456
+ // we are generating an override css var to allow override with fallback to the default var
1457
+ const overrideVarName = getOverrideCssVarName$1(varName);
1458
+ return `var(${overrideVarName}, ${ret})`;
1459
+ };
1450
1460
 
1451
1461
  const createCssSelector$1 = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>
1452
1462
  isFunction(relativeSelectorOrSelectorFn)
1453
1463
  ? relativeSelectorOrSelectorFn(baseSelector)
1454
- : `${baseSelector}${
1455
- /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)
1456
- ? ` ${relativeSelectorOrSelectorFn}`
1457
- : relativeSelectorOrSelectorFn
1458
- }`;
1464
+ : `${baseSelector}${/^[A-Za-z]/.test(relativeSelectorOrSelectorFn)
1465
+ ? ` ${relativeSelectorOrSelectorFn}`
1466
+ : relativeSelectorOrSelectorFn
1467
+ }`;
1459
1468
 
1460
1469
  let StyleBuilder$1 = class StyleBuilder {
1461
1470
  constructor() {
@@ -1495,6 +1504,7 @@ const getFallbackVarName$1 = (origVarName, suffix = 'fallback') => kebabCaseJoin
1495
1504
 
1496
1505
  const createStyle$1 = (componentName, baseSelector, mappings) => {
1497
1506
  const style = new StyleBuilder$1();
1507
+ // we generate all the fallback vars recursively
1498
1508
  const createFallbackVar = (fallback, origVarName) => {
1499
1509
  if (!fallback) return '';
1500
1510
  if (typeof fallback === 'string') return fallback;
@@ -1514,7 +1524,7 @@ const createStyle$1 = (componentName, baseSelector, mappings) => {
1514
1524
  style.add(
1515
1525
  createCssSelector$1(baseSelector, relativeSelectorOrSelectorFn),
1516
1526
  isFunction(property) ? property() : property,
1517
- createCssVar$1(cssVarName, fallbackValue) + (important ? '!important' : '')
1527
+ createCssVar$1(cssVarName, fallbackValue, true) + (important ? '!important' : '')
1518
1528
  );
1519
1529
  }
1520
1530
  );
@@ -1541,6 +1551,8 @@ const createCssVarsList$1 = (componentName, mappings) =>
1541
1551
  return Object.assign(
1542
1552
  acc,
1543
1553
  { [attr]: varName },
1554
+ // we are exposing the override css var names, the convention is to add 'Override' suffix to the attribute name
1555
+ { [attr + 'Override']: getOverrideCssVarName$1(varName) },
1544
1556
  getFallbackVarsNames$1(attr, varName, mappings[attr])
1545
1557
  );
1546
1558
  }, {});
@@ -3451,7 +3463,17 @@ var button$1 = /*#__PURE__*/Object.freeze({
3451
3463
  vars: vars$12
3452
3464
  });
3453
3465
 
3454
- const createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;
3466
+ const getOverrideCssVarName = (origVarName) => `${origVarName}__override`;
3467
+
3468
+ const createCssVar = (varName, fallback, createOverride = false) => {
3469
+ const ret = `var(${varName}${fallback ? `, ${fallback}` : ''})`;
3470
+
3471
+ if (!createOverride) return ret;
3472
+
3473
+ // we are generating an override css var to allow override with fallback to the default var
3474
+ const overrideVarName = getOverrideCssVarName(varName);
3475
+ return `var(${overrideVarName}, ${ret})`;
3476
+ };
3455
3477
 
3456
3478
  const createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>
3457
3479
  isFunction$1(relativeSelectorOrSelectorFn)
@@ -3500,6 +3522,7 @@ const getFallbackVarName = (origVarName, suffix = 'fallback') => kebabCaseJoin$1
3500
3522
 
3501
3523
  const createStyle = (componentName, baseSelector, mappings) => {
3502
3524
  const style = new StyleBuilder();
3525
+ // we generate all the fallback vars recursively
3503
3526
  const createFallbackVar = (fallback, origVarName) => {
3504
3527
  if (!fallback) return '';
3505
3528
  if (typeof fallback === 'string') return fallback;
@@ -3519,7 +3542,7 @@ const createStyle = (componentName, baseSelector, mappings) => {
3519
3542
  style.add(
3520
3543
  createCssSelector(baseSelector, relativeSelectorOrSelectorFn),
3521
3544
  isFunction$1(property) ? property() : property,
3522
- createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')
3545
+ createCssVar(cssVarName, fallbackValue, true) + (important ? '!important' : '')
3523
3546
  );
3524
3547
  }
3525
3548
  );
@@ -3546,6 +3569,8 @@ const createCssVarsList = (componentName, mappings) =>
3546
3569
  return Object.assign(
3547
3570
  acc,
3548
3571
  { [attr]: varName },
3572
+ // we are exposing the override css var names, the convention is to add 'Override' suffix to the attribute name
3573
+ { [attr + 'Override']: getOverrideCssVarName(varName) },
3549
3574
  getFallbackVarsNames(attr, varName, mappings[attr])
3550
3575
  );
3551
3576
  }, {});
@@ -18116,125 +18141,9 @@ var dateField$1 = /*#__PURE__*/Object.freeze({
18116
18141
  vars: vars$l
18117
18142
  });
18118
18143
 
18119
- const componentName$n = getComponentName('apps-list');
18120
-
18121
- const itemRenderer$4 = ({ name, icon, url }, _, ref) => `
18122
- <a ${url ? `href="${url}" title="${url}"` : ''} target="_blank">
18123
- <descope-list-item>
18124
- <descope-avatar
18125
- ${icon ? `img="${icon}"` : ''}
18126
- ${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
18127
- size=${ref.size}
18128
- ></descope-avatar>
18129
- <descope-text
18130
- variant="body1"
18131
- mode="primary"
18132
- >${name}</descope-text>
18133
- </descope-list-item>
18134
- </a>
18135
- `;
18144
+ const componentName$n = getComponentName('list-item');
18136
18145
 
18137
18146
  const customMixin$3 = (superclass) =>
18138
- class AppsListMixinClass extends superclass {
18139
- get size() {
18140
- return this.getAttribute('size') || 'sm';
18141
- }
18142
- };
18143
-
18144
- const AppsListClass = compose(
18145
- createStyleMixin$1({
18146
- mappings: {
18147
- maxHeight: { selector: () => ':host' },
18148
- minHeight: { selector: () => ':host' },
18149
- hostDirection: { selector: () => ':host', property: 'direction' },
18150
- itemsFontWeight: {
18151
- selector: TextClass.componentName,
18152
- property: TextClass.cssVarList.fontWeight,
18153
- },
18154
- itemsFontSize: {
18155
- selector: TextClass.componentName,
18156
- property: TextClass.cssVarList.fontSize,
18157
- },
18158
- itemsTextAlign: {
18159
- selector: TextClass.componentName,
18160
- property: TextClass.cssVarList.textAlign,
18161
- },
18162
- },
18163
- }),
18164
- createDynamicDataMixin$1({ itemRenderer: itemRenderer$4, rerenderAttrsList: ['size'] }),
18165
- draggableMixin$1,
18166
- componentNameValidationMixin$1,
18167
- customMixin$3
18168
- )(
18169
- createProxy$1({
18170
- slots: ['empty-state'],
18171
- wrappedEleName: 'descope-list',
18172
- excludeAttrsSync: ['tabindex', 'class', 'empty', 'style'],
18173
- componentName: componentName$n,
18174
- style: () => `
18175
- :host {
18176
- width: 100%;
18177
- display: inline-flex;
18178
- }
18179
-
18180
- descope-text::part(text-wrapper) {
18181
- display: -webkit-box;
18182
- -webkit-line-clamp: 2;
18183
- -webkit-box-orient: vertical;
18184
- overflow: hidden;
18185
- }
18186
-
18187
- a {
18188
- text-decoration: none;
18189
- }
18190
-
18191
- descope-text {
18192
- ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
18193
- }
18194
- `,
18195
- })
18196
- );
18197
-
18198
- const vars$k = AppsListClass.cssVarList;
18199
- const globalRefs$a = getThemeRefs$1(globals);
18200
-
18201
- const defaultHeight = '400px';
18202
-
18203
- const appsList = {
18204
- [vars$k.itemsFontWeight]: 'normal',
18205
- [vars$k.itemsTextAlign]: 'start',
18206
- [vars$k.hostDirection]: globalRefs$a.direction,
18207
- [vars$k.maxHeight]: defaultHeight,
18208
-
18209
- _empty: {
18210
- [vars$k.minHeight]: defaultHeight,
18211
- },
18212
-
18213
- size: {
18214
- xs: {
18215
- [vars$k.itemsFontSize]: '14px',
18216
- },
18217
- sm: {
18218
- [vars$k.itemsFontSize]: '14px',
18219
- },
18220
- md: {
18221
- [vars$k.itemsFontSize]: '16px',
18222
- },
18223
- lg: {
18224
- [vars$k.itemsFontSize]: '20px',
18225
- },
18226
- },
18227
- };
18228
-
18229
- var appsList$1 = /*#__PURE__*/Object.freeze({
18230
- __proto__: null,
18231
- default: appsList,
18232
- vars: vars$k
18233
- });
18234
-
18235
- const componentName$m = getComponentName('list-item');
18236
-
18237
- const customMixin$2 = (superclass) =>
18238
18147
  class ListItemMixinClass extends superclass {
18239
18148
  constructor() {
18240
18149
  super();
@@ -18287,14 +18196,14 @@ const ListItemClass = compose(
18287
18196
  }),
18288
18197
  draggableMixin$1,
18289
18198
  componentNameValidationMixin$1,
18290
- customMixin$2,
18199
+ customMixin$3,
18291
18200
  activeableMixin,
18292
- )(createBaseClass$1({ componentName: componentName$m, baseSelector: 'slot' }));
18201
+ )(createBaseClass$1({ componentName: componentName$n, baseSelector: 'slot' }));
18293
18202
 
18294
- const componentName$l = getComponentName('list');
18203
+ const componentName$m = getComponentName('list');
18295
18204
 
18296
18205
  class RawList extends createBaseClass$1({
18297
- componentName: componentName$l,
18206
+ componentName: componentName$m,
18298
18207
  baseSelector: '.wrapper',
18299
18208
  }) {
18300
18209
  static get observedAttributes() {
@@ -18462,13 +18371,194 @@ const ListClass = compose(
18462
18371
  componentNameValidationMixin$1,
18463
18372
  )(RawList);
18464
18373
 
18374
+ const componentName$l = getComponentName('apps-list');
18375
+
18376
+ const itemRenderer$4 = ({ name, icon, url }, _, ref) => `
18377
+ <a ${url ? `href="${url}" title="${url}"` : ''} target="_blank">
18378
+ <descope-list-item>
18379
+ <descope-avatar
18380
+ ${icon ? `img="${icon}"` : ''}
18381
+ ${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
18382
+ size="${ref.logoSize || ref.size}"
18383
+ ></descope-avatar>
18384
+ <descope-text
18385
+ variant="${ref.itemTextVariant}"
18386
+ mode="primary"
18387
+ >${name}</descope-text>
18388
+ </descope-list-item>
18389
+ </a>
18390
+ `;
18391
+
18392
+ const customMixin$2 = (superclass) =>
18393
+ class AppsListMixinClass extends superclass {
18394
+ // size controls both item logo size and font size
18395
+ get size() {
18396
+ return this.getAttribute('size') || 'sm';
18397
+ }
18398
+
18399
+ get itemTextVariant() {
18400
+ return this.getAttribute('item-text-variant') || 'body1';
18401
+ }
18402
+
18403
+ get logoSize() {
18404
+ return this.getAttribute('logo-size');
18405
+ }
18406
+ };
18407
+
18408
+ const AppsListClass = compose(
18409
+ createStyleMixin$1({
18410
+ mappings: {
18411
+ maxHeight: { selector: () => ':host' },
18412
+ minHeight: { selector: () => ':host' },
18413
+ hostDirection: { selector: () => ':host', property: 'direction' },
18414
+ itemsFontWeight: {
18415
+ selector: TextClass.componentName,
18416
+ property: TextClass.cssVarList.fontWeightOverride,
18417
+ },
18418
+ itemsFontSize: {
18419
+ selector: TextClass.componentName,
18420
+ property: TextClass.cssVarList.fontSizeOverride,
18421
+ },
18422
+ itemsTextAlign: {
18423
+ selector: TextClass.componentName,
18424
+ property: TextClass.cssVarList.textAlign,
18425
+ },
18426
+ itemBackgroundColor: {
18427
+ selector: ListItemClass.componentName,
18428
+ property: ListItemClass.cssVarList.backgroundColor,
18429
+ },
18430
+ backgroundColor: {
18431
+ selector: ListClass.componentName,
18432
+ property: ListClass.cssVarList.backgroundColorOverride,
18433
+ },
18434
+ itemBorderStyle: {
18435
+ selector: ListItemClass.componentName,
18436
+ property: ListItemClass.cssVarList.borderStyleOverride,
18437
+ },
18438
+ itemBorderColor: {
18439
+ selector: ListItemClass.componentName,
18440
+ property: ListItemClass.cssVarList.borderColorOverride,
18441
+ },
18442
+ itemBorderWidth: {
18443
+ selector: ListItemClass.componentName,
18444
+ property: ListItemClass.cssVarList.borderWidthOverride,
18445
+ },
18446
+ itemVerticalPadding: {
18447
+ selector: ListItemClass.componentName,
18448
+ property: ListItemClass.cssVarList.verticalPaddingOverride,
18449
+ },
18450
+ itemHorizontalPadding: {
18451
+ selector: ListItemClass.componentName,
18452
+ property: ListItemClass.cssVarList.horizontalPaddingOverride,
18453
+ },
18454
+ itemAlignment: [
18455
+ { selector: ListItemClass.componentName, property: ListItemClass.cssVarList.alignItemsOverride },
18456
+ { selector: TextClass.componentName, property: TextClass.cssVarList.textAlign },
18457
+ ]
18458
+ },
18459
+ }),
18460
+ createDynamicDataMixin$1({ itemRenderer: itemRenderer$4, rerenderAttrsList: ['size', 'item-text-variant', 'logo-size'] }),
18461
+ draggableMixin$1,
18462
+ componentNameValidationMixin$1,
18463
+ customMixin$2
18464
+ )(
18465
+ createProxy$1({
18466
+ slots: ['empty-state'],
18467
+ wrappedEleName: 'descope-list',
18468
+ excludeAttrsSync: ['tabindex', 'class', 'empty', 'style'],
18469
+ componentName: componentName$l,
18470
+ style: () => `
18471
+ :host {
18472
+ width: 100%;
18473
+ display: inline-flex;
18474
+ }
18475
+
18476
+ descope-text::part(text-wrapper) {
18477
+ display: -webkit-box;
18478
+ -webkit-line-clamp: 2;
18479
+ -webkit-box-orient: vertical;
18480
+ overflow: hidden;
18481
+ }
18482
+
18483
+ a {
18484
+ text-decoration: none;
18485
+ }
18486
+
18487
+ descope-text {
18488
+ ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
18489
+ max-width: 100%;
18490
+ }
18491
+ `,
18492
+ })
18493
+ );
18494
+
18495
+ const vars$k = AppsListClass.cssVarList;
18496
+ const globalRefs$a = getThemeRefs$1(globals);
18497
+
18498
+ const defaultHeight = '400px';
18499
+
18500
+ const appsList = {
18501
+ [vars$k.itemsFontWeight]: 'normal',
18502
+ [vars$k.itemsTextAlign]: 'start',
18503
+ [vars$k.hostDirection]: globalRefs$a.direction,
18504
+ [vars$k.maxHeight]: defaultHeight,
18505
+
18506
+ _empty: {
18507
+ [vars$k.minHeight]: defaultHeight,
18508
+ },
18509
+
18510
+ size: {
18511
+ xs: {
18512
+ [vars$k.itemsFontSize]: '14px',
18513
+ },
18514
+ sm: {
18515
+ [vars$k.itemsFontSize]: '14px',
18516
+ },
18517
+ md: {
18518
+ [vars$k.itemsFontSize]: '16px',
18519
+ },
18520
+ lg: {
18521
+ [vars$k.itemsFontSize]: '20px',
18522
+ },
18523
+ },
18524
+
18525
+ itemPadding: {
18526
+ xs: {
18527
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.xs,
18528
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.xs,
18529
+ },
18530
+ sm: {
18531
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.sm,
18532
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.sm,
18533
+ },
18534
+ md: {
18535
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.md,
18536
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.md,
18537
+ },
18538
+ lg: {
18539
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.lg,
18540
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.lg,
18541
+ },
18542
+ xl: {
18543
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.xl,
18544
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.xl,
18545
+ },
18546
+ },
18547
+ };
18548
+
18549
+ var appsList$1 = /*#__PURE__*/Object.freeze({
18550
+ __proto__: null,
18551
+ default: appsList,
18552
+ vars: vars$k
18553
+ });
18554
+
18465
18555
  const globalRefs$9 = getThemeRefs$1(globals);
18466
18556
 
18467
18557
  const compVars$3 = ListClass.cssVarList;
18468
18558
 
18469
18559
  const [helperTheme$1, helperRefs$1, helperVars$1] = createHelperVars$1(
18470
18560
  { shadowColor: '#00000020' },
18471
- componentName$l
18561
+ componentName$m
18472
18562
  );
18473
18563
 
18474
18564
  const { shadowColor: shadowColor$1 } = helperRefs$1;