@descope/web-components-ui 1.0.399 → 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.
- package/dist/cjs/index.cjs.js +22 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +22 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/package.json +2 -2
- package/src/components/descope-container/ContainerClass.js +6 -0
- package/src/helpers/themeHelpers/index.js +8 -1
- package/src/theme/components/container.js +10 -2
@@ -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:()=>
|
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.
|
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": "
|
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
|
-
|
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) => {
|
@@ -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,
|