@descope/web-components-ui 1.0.398 → 1.0.400

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8689],{43713:(t,o,e)=>{e.r(o),e.d(o,{ContainerClass:()=>l});var r=e(94619),n=e(70263),s=e(7138);const i=(0,e(14944).xE)("container");class p extends((0,n.q)({componentName:i,baseSelector:"slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: auto;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}}const l=(0,s.Zz)((0,r.RF)({mappings:{hostHeight:{selector:()=>":host",property:"height"},hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},itemsGrow:{selector:()=>"::slotted(*)",property:"flex-grow",fallback:"0"},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:{},flexWrap:{},backgroundColor:{},color:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{}}}),r.VO,r.tQ)(p);customElements.define(i,l)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8689],{43713:(t,o,e)=>{e.r(o),e.d(o,{ContainerClass:()=>a});var n=e(94619),r=e(70263),s=e(7138);const i=(0,e(14944).xE)("container");class d extends((0,r.q)({componentName:i,baseSelector:"slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host > slot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: auto;\n\t\t\t}\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t"}}const a=(0,s.Zz)((0,n.RF)({mappings:{hostHeight:{selector:()=>":host",property:"height"},hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},itemsGrow:{selector:()=>"::slotted(*)",property:"flex-grow",fallback:"0"},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:{},flexWrap:{},backgroundColor:{},backgroundImage:{},backgroundPositionX:{},backgroundPositionY:{},backgroundSize:{},backgroundRepeat:{},color:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{}}}),n.VO,n.tQ)(d);customElements.define(i,a)}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.398",
3
+ "version": "1.0.400",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -53,7 +53,7 @@
53
53
  "@babel/plugin-transform-logical-assignment-operators": "^7.23.4",
54
54
  "@babel/preset-env": "^7.22.2",
55
55
  "@jest/globals": "^29.7.0",
56
- "@playwright/test": "^1.38.1",
56
+ "@playwright/test": "1.38.1",
57
57
  "@rollup/plugin-node-resolve": "^15.0.2",
58
58
  "@storybook/addon-actions": "^6.4.9",
59
59
  "@storybook/addon-controls": "^6.4.9",
@@ -44,6 +44,12 @@ export const ContainerClass = compose(
44
44
  flexWrap: {},
45
45
 
46
46
  backgroundColor: {},
47
+ backgroundImage: {},
48
+ backgroundPositionX: {},
49
+ backgroundPositionY: {},
50
+ backgroundSize: {},
51
+ backgroundRepeat: {},
52
+
47
53
  color: {},
48
54
  borderRadius: {},
49
55
 
@@ -148,7 +148,14 @@ export const themeToStyle = ({ globals, components }, themeName) => ({
148
148
  components: createComponentsTheme(components),
149
149
  });
150
150
 
151
- export const useVar = (varName) => `var(${varName})`;
151
+ // allows to generate css variables with nested fallbacks
152
+ export const useVar = (...varNames) => {
153
+ return varNames.reduceRight((acc, value) => {
154
+ if (value.startsWith('--')) return `var(${value}${acc ? `, ${acc}` : acc})`;
155
+
156
+ return `${value}${acc ? `, ${acc}` : acc}`;
157
+ }, '');
158
+ };
152
159
 
153
160
  export const createHelperVars = (theme, prefix) => {
154
161
  const res = transformTheme(theme, [], (path, value) => {
@@ -16,13 +16,17 @@ export const externalInputMixin =
16
16
  }
17
17
 
18
18
  createExternalInput() {
19
- if (!this.isExternalInput) {
19
+ if (!this.isExternalInput || this.isReadOnly || this.isDisabled) {
20
20
  return null;
21
21
  }
22
22
 
23
23
  // use original input element as reference
24
24
  const origInput = this.baseElement.querySelector('input');
25
25
 
26
+ if (!origInput) {
27
+ return null;
28
+ }
29
+
26
30
  // to avoid focus loop between external-input and origInput
27
31
  // we set origInput's tabindex to -1
28
32
  // otherwise, shift-tab will never leave the component focus
@@ -1,6 +1,6 @@
1
- import globals from '../globals';
2
- import { getThemeRefs, createHelperVars } from '../../helpers/themeHelpers';
3
1
  import { ContainerClass, componentName } from '../../components/descope-container/ContainerClass';
2
+ import { createHelperVars, getThemeRefs } from '../../helpers/themeHelpers';
3
+ import globals from '../globals';
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
6
 
@@ -35,7 +35,15 @@ const container = {
35
35
  [compVars.itemsGrow]: '0',
36
36
  [compVars.hostWidth]: '100%',
37
37
  [compVars.boxShadow]: 'none',
38
+
38
39
  [compVars.backgroundColor]: globalRefs.colors.surface.main,
40
+
41
+ [compVars.backgroundImage]: '', // we need to set a value to avoid inner containers from inheriting the parent's background image
42
+ [compVars.backgroundPositionX]: 'center',
43
+ [compVars.backgroundPositionY]: 'center',
44
+ [compVars.backgroundSize]: 'cover',
45
+ [compVars.backgroundRepeat]: 'no-repeat',
46
+
39
47
  [compVars.color]: globalRefs.colors.surface.contrast,
40
48
  [compVars.borderRadius]: '0px',
41
49
  [compVars.hostDirection]: globalRefs.direction,