@descope/flow-components 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.
package/dist/index.cjs.js CHANGED
@@ -80964,16 +80964,25 @@ function requireIndex_cjs () {
80964
80964
  };
80965
80965
  getThemeVars$1(globals);
80966
80966
 
80967
- const createCssVar$1 = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;
80967
+ const getOverrideCssVarName$1 = (origVarName) => `${origVarName}__override`;
80968
+
80969
+ const createCssVar$1 = (varName, fallback, createOverride = false) => {
80970
+ const ret = `var(${varName}${fallback ? `, ${fallback}` : ''})`;
80971
+
80972
+ if (!createOverride) return ret;
80973
+
80974
+ // we are generating an override css var to allow override with fallback to the default var
80975
+ const overrideVarName = getOverrideCssVarName$1(varName);
80976
+ return `var(${overrideVarName}, ${ret})`;
80977
+ };
80968
80978
 
80969
80979
  const createCssSelector$1 = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>
80970
80980
  isFunction(relativeSelectorOrSelectorFn)
80971
80981
  ? relativeSelectorOrSelectorFn(baseSelector)
80972
- : `${baseSelector}${
80973
- /^[A-Za-z]/.test(relativeSelectorOrSelectorFn)
80974
- ? ` ${relativeSelectorOrSelectorFn}`
80975
- : relativeSelectorOrSelectorFn
80976
- }`;
80982
+ : `${baseSelector}${/^[A-Za-z]/.test(relativeSelectorOrSelectorFn)
80983
+ ? ` ${relativeSelectorOrSelectorFn}`
80984
+ : relativeSelectorOrSelectorFn
80985
+ }`;
80977
80986
 
80978
80987
  let StyleBuilder$1 = class StyleBuilder {
80979
80988
  constructor() {
@@ -81013,6 +81022,7 @@ function requireIndex_cjs () {
81013
81022
 
81014
81023
  const createStyle$1 = (componentName, baseSelector, mappings) => {
81015
81024
  const style = new StyleBuilder$1();
81025
+ // we generate all the fallback vars recursively
81016
81026
  const createFallbackVar = (fallback, origVarName) => {
81017
81027
  if (!fallback) return '';
81018
81028
  if (typeof fallback === 'string') return fallback;
@@ -81032,7 +81042,7 @@ function requireIndex_cjs () {
81032
81042
  style.add(
81033
81043
  createCssSelector$1(baseSelector, relativeSelectorOrSelectorFn),
81034
81044
  isFunction(property) ? property() : property,
81035
- createCssVar$1(cssVarName, fallbackValue) + (important ? '!important' : '')
81045
+ createCssVar$1(cssVarName, fallbackValue, true) + (important ? '!important' : '')
81036
81046
  );
81037
81047
  }
81038
81048
  );
@@ -81059,6 +81069,8 @@ function requireIndex_cjs () {
81059
81069
  return Object.assign(
81060
81070
  acc,
81061
81071
  { [attr]: varName },
81072
+ // we are exposing the override css var names, the convention is to add 'Override' suffix to the attribute name
81073
+ { [attr + 'Override']: getOverrideCssVarName$1(varName) },
81062
81074
  getFallbackVarsNames$1(attr, varName, mappings[attr])
81063
81075
  );
81064
81076
  }, {});
@@ -82969,7 +82981,17 @@ function requireIndex_cjs () {
82969
82981
  vars: vars$12
82970
82982
  });
82971
82983
 
82972
- const createCssVar = (varName, fallback) => `var(${varName}${fallback ? `, ${fallback}` : ''})`;
82984
+ const getOverrideCssVarName = (origVarName) => `${origVarName}__override`;
82985
+
82986
+ const createCssVar = (varName, fallback, createOverride = false) => {
82987
+ const ret = `var(${varName}${fallback ? `, ${fallback}` : ''})`;
82988
+
82989
+ if (!createOverride) return ret;
82990
+
82991
+ // we are generating an override css var to allow override with fallback to the default var
82992
+ const overrideVarName = getOverrideCssVarName(varName);
82993
+ return `var(${overrideVarName}, ${ret})`;
82994
+ };
82973
82995
 
82974
82996
  const createCssSelector = (baseSelector = '', relativeSelectorOrSelectorFn = '') =>
82975
82997
  isFunction$1(relativeSelectorOrSelectorFn)
@@ -83018,6 +83040,7 @@ function requireIndex_cjs () {
83018
83040
 
83019
83041
  const createStyle = (componentName, baseSelector, mappings) => {
83020
83042
  const style = new StyleBuilder();
83043
+ // we generate all the fallback vars recursively
83021
83044
  const createFallbackVar = (fallback, origVarName) => {
83022
83045
  if (!fallback) return '';
83023
83046
  if (typeof fallback === 'string') return fallback;
@@ -83037,7 +83060,7 @@ function requireIndex_cjs () {
83037
83060
  style.add(
83038
83061
  createCssSelector(baseSelector, relativeSelectorOrSelectorFn),
83039
83062
  isFunction$1(property) ? property() : property,
83040
- createCssVar(cssVarName, fallbackValue) + (important ? '!important' : '')
83063
+ createCssVar(cssVarName, fallbackValue, true) + (important ? '!important' : '')
83041
83064
  );
83042
83065
  }
83043
83066
  );
@@ -83064,6 +83087,8 @@ function requireIndex_cjs () {
83064
83087
  return Object.assign(
83065
83088
  acc,
83066
83089
  { [attr]: varName },
83090
+ // we are exposing the override css var names, the convention is to add 'Override' suffix to the attribute name
83091
+ { [attr + 'Override']: getOverrideCssVarName(varName) },
83067
83092
  getFallbackVarsNames(attr, varName, mappings[attr])
83068
83093
  );
83069
83094
  }, {});
@@ -97634,125 +97659,9 @@ descope-boolean-field-internal {
97634
97659
  vars: vars$l
97635
97660
  });
97636
97661
 
97637
- const componentName$n = getComponentName('apps-list');
97638
-
97639
- const itemRenderer$4 = ({ name, icon, url }, _, ref) => `
97640
- <a ${url ? `href="${url}" title="${url}"` : ''} target="_blank">
97641
- <descope-list-item>
97642
- <descope-avatar
97643
- ${icon ? `img="${icon}"` : ''}
97644
- ${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
97645
- size=${ref.size}
97646
- ></descope-avatar>
97647
- <descope-text
97648
- variant="body1"
97649
- mode="primary"
97650
- >${name}</descope-text>
97651
- </descope-list-item>
97652
- </a>
97653
- `;
97662
+ const componentName$n = getComponentName('list-item');
97654
97663
 
97655
97664
  const customMixin$3 = (superclass) =>
97656
- class AppsListMixinClass extends superclass {
97657
- get size() {
97658
- return this.getAttribute('size') || 'sm';
97659
- }
97660
- };
97661
-
97662
- const AppsListClass = compose(
97663
- createStyleMixin$1({
97664
- mappings: {
97665
- maxHeight: { selector: () => ':host' },
97666
- minHeight: { selector: () => ':host' },
97667
- hostDirection: { selector: () => ':host', property: 'direction' },
97668
- itemsFontWeight: {
97669
- selector: TextClass.componentName,
97670
- property: TextClass.cssVarList.fontWeight,
97671
- },
97672
- itemsFontSize: {
97673
- selector: TextClass.componentName,
97674
- property: TextClass.cssVarList.fontSize,
97675
- },
97676
- itemsTextAlign: {
97677
- selector: TextClass.componentName,
97678
- property: TextClass.cssVarList.textAlign,
97679
- },
97680
- },
97681
- }),
97682
- createDynamicDataMixin$1({ itemRenderer: itemRenderer$4, rerenderAttrsList: ['size'] }),
97683
- draggableMixin$1,
97684
- componentNameValidationMixin$1,
97685
- customMixin$3
97686
- )(
97687
- createProxy$1({
97688
- slots: ['empty-state'],
97689
- wrappedEleName: 'descope-list',
97690
- excludeAttrsSync: ['tabindex', 'class', 'empty', 'style'],
97691
- componentName: componentName$n,
97692
- style: () => `
97693
- :host {
97694
- width: 100%;
97695
- display: inline-flex;
97696
- }
97697
-
97698
- descope-text::part(text-wrapper) {
97699
- display: -webkit-box;
97700
- -webkit-line-clamp: 2;
97701
- -webkit-box-orient: vertical;
97702
- overflow: hidden;
97703
- }
97704
-
97705
- a {
97706
- text-decoration: none;
97707
- }
97708
-
97709
- descope-text {
97710
- ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
97711
- }
97712
- `,
97713
- })
97714
- );
97715
-
97716
- const vars$k = AppsListClass.cssVarList;
97717
- const globalRefs$a = getThemeRefs$1(globals);
97718
-
97719
- const defaultHeight = '400px';
97720
-
97721
- const appsList = {
97722
- [vars$k.itemsFontWeight]: 'normal',
97723
- [vars$k.itemsTextAlign]: 'start',
97724
- [vars$k.hostDirection]: globalRefs$a.direction,
97725
- [vars$k.maxHeight]: defaultHeight,
97726
-
97727
- _empty: {
97728
- [vars$k.minHeight]: defaultHeight,
97729
- },
97730
-
97731
- size: {
97732
- xs: {
97733
- [vars$k.itemsFontSize]: '14px',
97734
- },
97735
- sm: {
97736
- [vars$k.itemsFontSize]: '14px',
97737
- },
97738
- md: {
97739
- [vars$k.itemsFontSize]: '16px',
97740
- },
97741
- lg: {
97742
- [vars$k.itemsFontSize]: '20px',
97743
- },
97744
- },
97745
- };
97746
-
97747
- var appsList$1 = /*#__PURE__*/Object.freeze({
97748
- __proto__: null,
97749
- default: appsList,
97750
- vars: vars$k
97751
- });
97752
-
97753
- const componentName$m = getComponentName('list-item');
97754
-
97755
- const customMixin$2 = (superclass) =>
97756
97665
  class ListItemMixinClass extends superclass {
97757
97666
  constructor() {
97758
97667
  super();
@@ -97805,14 +97714,14 @@ descope-boolean-field-internal {
97805
97714
  }),
97806
97715
  draggableMixin$1,
97807
97716
  componentNameValidationMixin$1,
97808
- customMixin$2,
97717
+ customMixin$3,
97809
97718
  activeableMixin,
97810
- )(createBaseClass$1({ componentName: componentName$m, baseSelector: 'slot' }));
97719
+ )(createBaseClass$1({ componentName: componentName$n, baseSelector: 'slot' }));
97811
97720
 
97812
- const componentName$l = getComponentName('list');
97721
+ const componentName$m = getComponentName('list');
97813
97722
 
97814
97723
  class RawList extends createBaseClass$1({
97815
- componentName: componentName$l,
97724
+ componentName: componentName$m,
97816
97725
  baseSelector: '.wrapper',
97817
97726
  }) {
97818
97727
  static get observedAttributes() {
@@ -97980,13 +97889,194 @@ descope-boolean-field-internal {
97980
97889
  componentNameValidationMixin$1,
97981
97890
  )(RawList);
97982
97891
 
97892
+ const componentName$l = getComponentName('apps-list');
97893
+
97894
+ const itemRenderer$4 = ({ name, icon, url }, _, ref) => `
97895
+ <a ${url ? `href="${url}" title="${url}"` : ''} target="_blank">
97896
+ <descope-list-item>
97897
+ <descope-avatar
97898
+ ${icon ? `img="${icon}"` : ''}
97899
+ ${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
97900
+ size="${ref.logoSize || ref.size}"
97901
+ ></descope-avatar>
97902
+ <descope-text
97903
+ variant="${ref.itemTextVariant}"
97904
+ mode="primary"
97905
+ >${name}</descope-text>
97906
+ </descope-list-item>
97907
+ </a>
97908
+ `;
97909
+
97910
+ const customMixin$2 = (superclass) =>
97911
+ class AppsListMixinClass extends superclass {
97912
+ // size controls both item logo size and font size
97913
+ get size() {
97914
+ return this.getAttribute('size') || 'sm';
97915
+ }
97916
+
97917
+ get itemTextVariant() {
97918
+ return this.getAttribute('item-text-variant') || 'body1';
97919
+ }
97920
+
97921
+ get logoSize() {
97922
+ return this.getAttribute('logo-size');
97923
+ }
97924
+ };
97925
+
97926
+ const AppsListClass = compose(
97927
+ createStyleMixin$1({
97928
+ mappings: {
97929
+ maxHeight: { selector: () => ':host' },
97930
+ minHeight: { selector: () => ':host' },
97931
+ hostDirection: { selector: () => ':host', property: 'direction' },
97932
+ itemsFontWeight: {
97933
+ selector: TextClass.componentName,
97934
+ property: TextClass.cssVarList.fontWeightOverride,
97935
+ },
97936
+ itemsFontSize: {
97937
+ selector: TextClass.componentName,
97938
+ property: TextClass.cssVarList.fontSizeOverride,
97939
+ },
97940
+ itemsTextAlign: {
97941
+ selector: TextClass.componentName,
97942
+ property: TextClass.cssVarList.textAlign,
97943
+ },
97944
+ itemBackgroundColor: {
97945
+ selector: ListItemClass.componentName,
97946
+ property: ListItemClass.cssVarList.backgroundColor,
97947
+ },
97948
+ backgroundColor: {
97949
+ selector: ListClass.componentName,
97950
+ property: ListClass.cssVarList.backgroundColorOverride,
97951
+ },
97952
+ itemBorderStyle: {
97953
+ selector: ListItemClass.componentName,
97954
+ property: ListItemClass.cssVarList.borderStyleOverride,
97955
+ },
97956
+ itemBorderColor: {
97957
+ selector: ListItemClass.componentName,
97958
+ property: ListItemClass.cssVarList.borderColorOverride,
97959
+ },
97960
+ itemBorderWidth: {
97961
+ selector: ListItemClass.componentName,
97962
+ property: ListItemClass.cssVarList.borderWidthOverride,
97963
+ },
97964
+ itemVerticalPadding: {
97965
+ selector: ListItemClass.componentName,
97966
+ property: ListItemClass.cssVarList.verticalPaddingOverride,
97967
+ },
97968
+ itemHorizontalPadding: {
97969
+ selector: ListItemClass.componentName,
97970
+ property: ListItemClass.cssVarList.horizontalPaddingOverride,
97971
+ },
97972
+ itemAlignment: [
97973
+ { selector: ListItemClass.componentName, property: ListItemClass.cssVarList.alignItemsOverride },
97974
+ { selector: TextClass.componentName, property: TextClass.cssVarList.textAlign },
97975
+ ]
97976
+ },
97977
+ }),
97978
+ createDynamicDataMixin$1({ itemRenderer: itemRenderer$4, rerenderAttrsList: ['size', 'item-text-variant', 'logo-size'] }),
97979
+ draggableMixin$1,
97980
+ componentNameValidationMixin$1,
97981
+ customMixin$2
97982
+ )(
97983
+ createProxy$1({
97984
+ slots: ['empty-state'],
97985
+ wrappedEleName: 'descope-list',
97986
+ excludeAttrsSync: ['tabindex', 'class', 'empty', 'style'],
97987
+ componentName: componentName$l,
97988
+ style: () => `
97989
+ :host {
97990
+ width: 100%;
97991
+ display: inline-flex;
97992
+ }
97993
+
97994
+ descope-text::part(text-wrapper) {
97995
+ display: -webkit-box;
97996
+ -webkit-line-clamp: 2;
97997
+ -webkit-box-orient: vertical;
97998
+ overflow: hidden;
97999
+ }
98000
+
98001
+ a {
98002
+ text-decoration: none;
98003
+ }
98004
+
98005
+ descope-text {
98006
+ ${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
98007
+ max-width: 100%;
98008
+ }
98009
+ `,
98010
+ })
98011
+ );
98012
+
98013
+ const vars$k = AppsListClass.cssVarList;
98014
+ const globalRefs$a = getThemeRefs$1(globals);
98015
+
98016
+ const defaultHeight = '400px';
98017
+
98018
+ const appsList = {
98019
+ [vars$k.itemsFontWeight]: 'normal',
98020
+ [vars$k.itemsTextAlign]: 'start',
98021
+ [vars$k.hostDirection]: globalRefs$a.direction,
98022
+ [vars$k.maxHeight]: defaultHeight,
98023
+
98024
+ _empty: {
98025
+ [vars$k.minHeight]: defaultHeight,
98026
+ },
98027
+
98028
+ size: {
98029
+ xs: {
98030
+ [vars$k.itemsFontSize]: '14px',
98031
+ },
98032
+ sm: {
98033
+ [vars$k.itemsFontSize]: '14px',
98034
+ },
98035
+ md: {
98036
+ [vars$k.itemsFontSize]: '16px',
98037
+ },
98038
+ lg: {
98039
+ [vars$k.itemsFontSize]: '20px',
98040
+ },
98041
+ },
98042
+
98043
+ itemPadding: {
98044
+ xs: {
98045
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.xs,
98046
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.xs,
98047
+ },
98048
+ sm: {
98049
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.sm,
98050
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.sm,
98051
+ },
98052
+ md: {
98053
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.md,
98054
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.md,
98055
+ },
98056
+ lg: {
98057
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.lg,
98058
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.lg,
98059
+ },
98060
+ xl: {
98061
+ [vars$k.itemVerticalPadding]: globalRefs$a.spacing.xl,
98062
+ [vars$k.itemHorizontalPadding]: globalRefs$a.spacing.xl,
98063
+ },
98064
+ },
98065
+ };
98066
+
98067
+ var appsList$1 = /*#__PURE__*/Object.freeze({
98068
+ __proto__: null,
98069
+ default: appsList,
98070
+ vars: vars$k
98071
+ });
98072
+
97983
98073
  const globalRefs$9 = getThemeRefs$1(globals);
97984
98074
 
97985
98075
  const compVars$3 = ListClass.cssVarList;
97986
98076
 
97987
98077
  const [helperTheme$1, helperRefs$1, helperVars$1] = createHelperVars$1(
97988
98078
  { shadowColor: '#00000020' },
97989
- componentName$l
98079
+ componentName$m
97990
98080
  );
97991
98081
 
97992
98082
  const { shadowColor: shadowColor$1 } = helperRefs$1;
@@ -103486,7 +103576,7 @@ const List = React__default.default.forwardRef(({ emptyState, children, ...props
103486
103576
 
103487
103577
  const ListItem = React__default.default.forwardRef((props, ref) => (React__default.default.createElement("descope-list-item", { ...props, ref: ref })));
103488
103578
 
103489
- const AppsList = React__default.default.forwardRef(({ emptyState, data, ...props }, ref) => (React__default.default.createElement("descope-apps-list", { data: data ? JSON.stringify(data) : undefined, ...props, ref: ref },
103579
+ const AppsList = React__default.default.forwardRef(({ emptyState, data, variant, ...props }, ref) => (React__default.default.createElement("descope-apps-list", { data: data ? JSON.stringify(data) : undefined, variant: variant !== 'list' ? 'tiles' : 'list', ...props, ref: ref },
103490
103580
  React__default.default.createElement("div", { slot: "empty-state" }, emptyState))));
103491
103581
 
103492
103582
  const ScopesList = React__default.default.forwardRef(({ data, ...props }, ref) => (React__default.default.createElement("descope-scopes-list", { data: data ? JSON.stringify(data) : undefined, ...props, ref: ref })));
package/dist/index.d.ts CHANGED
@@ -835,7 +835,7 @@ declare const ListItem: React.ForwardRefExoticComponent<Props$f & React.RefAttri
835
835
 
836
836
  type Props$e = {
837
837
  emptyState?: React.ReactNode;
838
- variant?: 'list' | 'tiles';
838
+ variant?: 'list' | 'tiles' | 'custom';
839
839
  data?: any[];
840
840
  readonly?: boolean;
841
841
  };
package/dist/index.esm.js CHANGED
@@ -490,7 +490,7 @@ const List = React.forwardRef(({ emptyState, children, ...props }, ref) => (Reac
490
490
 
491
491
  const ListItem = React.forwardRef((props, ref) => (React.createElement("descope-list-item", { ...props, ref: ref })));
492
492
 
493
- const AppsList = React.forwardRef(({ emptyState, data, ...props }, ref) => (React.createElement("descope-apps-list", { data: data ? JSON.stringify(data) : undefined, ...props, ref: ref },
493
+ const AppsList = React.forwardRef(({ emptyState, data, variant, ...props }, ref) => (React.createElement("descope-apps-list", { data: data ? JSON.stringify(data) : undefined, variant: variant !== 'list' ? 'tiles' : 'list', ...props, ref: ref },
494
494
  React.createElement("div", { slot: "empty-state" }, emptyState))));
495
495
 
496
496
  const ScopesList = React.forwardRef(({ data, ...props }, ref) => (React.createElement("descope-scopes-list", { data: data ? JSON.stringify(data) : undefined, ...props, ref: ref })));
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { PropsToAttrs } from '../types';
3
3
  type Props = {
4
4
  emptyState?: React.ReactNode;
5
- variant?: 'list' | 'tiles';
5
+ variant?: 'list' | 'tiles' | 'custom';
6
6
  data?: any[];
7
7
  readonly?: boolean;
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -93,10 +93,10 @@
93
93
  "typescript": "^5.7.2",
94
94
  "webpack": "^5.74.0",
95
95
  "webpack-cli": "^6.0.1",
96
- "webpack-dev-server": "5.0.4"
96
+ "webpack-dev-server": "5.2.1"
97
97
  },
98
98
  "dependencies": {
99
- "@descope/web-components-ui": "2.1.17"
99
+ "@descope/web-components-ui": "2.1.18"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "react": ">= 18"
@@ -135,7 +135,8 @@
135
135
  "build:rollup": "rollup -c",
136
136
  "build:webpack": "webpack --mode production",
137
137
  "build": "npm run build:rollup && npm run build:webpack",
138
- "dev": "FEDERATION_IP=127.0.0.1 NODE_ENV=development webpack serve --mode development --port 4444",
138
+ "dev": "nx dev flow-components",
139
+ "dev-server": "FEDERATION_IP=127.0.0.1 NODE_ENV=development webpack serve --mode development --port 4444",
139
140
  "test": "exit 0",
140
141
  "lint": "eslint src/**/*.* --fix",
141
142
  "format": "prettier . -w --ignore-path .gitignore",