@descope-ui/descope-apps-list 2.1.17 → 2.2.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/CHANGELOG.md +4 -0
- package/e2e/descope-apps-list.spec.ts +40 -1
- package/package.json +8 -7
- package/src/component/AppsListClass.js +49 -5
- package/src/theme.js +23 -0
- package/stories/descope-apps-list.stories.js +40 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [2.2.0](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.18...web-components-ui-2.2.0) (2025-10-26)
|
|
6
|
+
|
|
7
|
+
## [2.1.18](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.17...web-components-ui-2.1.18) (2025-10-26)
|
|
8
|
+
|
|
5
9
|
## [2.1.17](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.16...web-components-ui-2.1.17) (2025-10-20)
|
|
6
10
|
|
|
7
11
|
## [2.1.16](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.15...web-components-ui-2.1.16) (2025-10-19)
|
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
import { test, expect } from '@playwright/test';
|
|
2
|
-
import { getStoryUrl, loopConfig } from 'e2e-utils';
|
|
2
|
+
import { getStoryUrl, loopConfig, loopPresets } from 'e2e-utils';
|
|
3
3
|
|
|
4
4
|
const componentAttributes = {
|
|
5
5
|
direction: ['ltr', 'rtl'],
|
|
6
6
|
numberOfItems: ['0'],
|
|
7
7
|
size: ['xs', 'sm', 'md', 'lg'],
|
|
8
8
|
variant: ['list', 'tiles'],
|
|
9
|
+
'item-padding': ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
10
|
+
'st-background-color': ['red'],
|
|
11
|
+
'logo-size': ['xs', 'sm', 'md', 'lg'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const presets = {
|
|
15
|
+
'item alignment center in tiles mode': {
|
|
16
|
+
'st-item-alignment': 'center',
|
|
17
|
+
variant: 'tiles',
|
|
18
|
+
},
|
|
19
|
+
'item alignment start in tiles mode': {
|
|
20
|
+
'st-item-alignment': 'start',
|
|
21
|
+
variant: 'tiles',
|
|
22
|
+
},
|
|
23
|
+
'item alignment end in tiles mode': {
|
|
24
|
+
'st-item-alignment': 'end',
|
|
25
|
+
variant: 'tiles',
|
|
26
|
+
},
|
|
27
|
+
'item text variant h1': {
|
|
28
|
+
'item-text-variant': 'h1',
|
|
29
|
+
size: '!undefined',
|
|
30
|
+
},
|
|
31
|
+
'item text variant subtitle1': {
|
|
32
|
+
'item-text-variant': 'subtitle1',
|
|
33
|
+
size: '!undefined',
|
|
34
|
+
},
|
|
35
|
+
'item text variant body1': {
|
|
36
|
+
'item-text-variant': 'body1',
|
|
37
|
+
size: '!undefined',
|
|
38
|
+
},
|
|
9
39
|
};
|
|
10
40
|
|
|
11
41
|
const storyName = 'descope-apps-list';
|
|
@@ -24,4 +54,13 @@ test.describe('theme', () => {
|
|
|
24
54
|
});
|
|
25
55
|
});
|
|
26
56
|
});
|
|
57
|
+
|
|
58
|
+
loopPresets(presets, (preset, name) => {
|
|
59
|
+
test(name, async ({ page }) => {
|
|
60
|
+
await page.goto(getStoryUrl(storyName, preset));
|
|
61
|
+
const component = page.locator(componentName);
|
|
62
|
+
expect(await component.screenshot()).toMatchSnapshot();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
27
65
|
});
|
|
66
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope-ui/descope-apps-list",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./src/component/index.js"
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@playwright/test": "1.38.1",
|
|
17
|
-
"e2e-utils": "2.
|
|
17
|
+
"e2e-utils": "2.2.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@descope-ui/common": "2.
|
|
21
|
-
"@descope-ui/theme-globals": "2.
|
|
22
|
-
"@descope-ui/descope-list": "2.
|
|
23
|
-
"@descope-ui/descope-
|
|
24
|
-
"@descope-ui/descope-
|
|
20
|
+
"@descope-ui/common": "2.2.0",
|
|
21
|
+
"@descope-ui/theme-globals": "2.2.0",
|
|
22
|
+
"@descope-ui/descope-list": "2.2.0",
|
|
23
|
+
"@descope-ui/descope-list-item": "2.2.0",
|
|
24
|
+
"@descope-ui/descope-avatar": "2.2.0",
|
|
25
|
+
"@descope-ui/descope-text": "2.2.0"
|
|
25
26
|
},
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"link-workspace-packages": false
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
createDynamicDataMixin,
|
|
9
9
|
} from '@descope-ui/common/components-mixins';
|
|
10
10
|
import { TextClass } from '@descope-ui/descope-text/class';
|
|
11
|
+
import { ListClass } from '@descope-ui/descope-list/class';
|
|
12
|
+
import { ListItemClass } from '@descope-ui/descope-list-item/class';
|
|
11
13
|
|
|
12
14
|
export const componentName = getComponentName('apps-list');
|
|
13
15
|
|
|
@@ -17,10 +19,10 @@ const itemRenderer = ({ name, icon, url }, _, ref) => `
|
|
|
17
19
|
<descope-avatar
|
|
18
20
|
${icon ? `img="${icon}"` : ''}
|
|
19
21
|
${name ? `display-name="${name}" abbr=${limitAbbreviation(name)}` : ''}
|
|
20
|
-
size
|
|
22
|
+
size="${ref.logoSize || ref.size}"
|
|
21
23
|
></descope-avatar>
|
|
22
24
|
<descope-text
|
|
23
|
-
variant="
|
|
25
|
+
variant="${ref.itemTextVariant}"
|
|
24
26
|
mode="primary"
|
|
25
27
|
>${name}</descope-text>
|
|
26
28
|
</descope-list-item>
|
|
@@ -29,9 +31,18 @@ const itemRenderer = ({ name, icon, url }, _, ref) => `
|
|
|
29
31
|
|
|
30
32
|
const customMixin = (superclass) =>
|
|
31
33
|
class AppsListMixinClass extends superclass {
|
|
34
|
+
// size controls both item logo size and font size
|
|
32
35
|
get size() {
|
|
33
36
|
return this.getAttribute('size') || 'sm';
|
|
34
37
|
}
|
|
38
|
+
|
|
39
|
+
get itemTextVariant() {
|
|
40
|
+
return this.getAttribute('item-text-variant') || 'body1';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get logoSize() {
|
|
44
|
+
return this.getAttribute('logo-size');
|
|
45
|
+
}
|
|
35
46
|
};
|
|
36
47
|
|
|
37
48
|
export const AppsListClass = compose(
|
|
@@ -42,19 +53,51 @@ export const AppsListClass = compose(
|
|
|
42
53
|
hostDirection: { selector: () => ':host', property: 'direction' },
|
|
43
54
|
itemsFontWeight: {
|
|
44
55
|
selector: TextClass.componentName,
|
|
45
|
-
property: TextClass.cssVarList.
|
|
56
|
+
property: TextClass.cssVarList.fontWeightOverride,
|
|
46
57
|
},
|
|
47
58
|
itemsFontSize: {
|
|
48
59
|
selector: TextClass.componentName,
|
|
49
|
-
property: TextClass.cssVarList.
|
|
60
|
+
property: TextClass.cssVarList.fontSizeOverride,
|
|
50
61
|
},
|
|
51
62
|
itemsTextAlign: {
|
|
52
63
|
selector: TextClass.componentName,
|
|
53
64
|
property: TextClass.cssVarList.textAlign,
|
|
54
65
|
},
|
|
66
|
+
itemBackgroundColor: {
|
|
67
|
+
selector: ListItemClass.componentName,
|
|
68
|
+
property: ListItemClass.cssVarList.backgroundColor,
|
|
69
|
+
},
|
|
70
|
+
backgroundColor: {
|
|
71
|
+
selector: ListClass.componentName,
|
|
72
|
+
property: ListClass.cssVarList.backgroundColorOverride,
|
|
73
|
+
},
|
|
74
|
+
itemBorderStyle: {
|
|
75
|
+
selector: ListItemClass.componentName,
|
|
76
|
+
property: ListItemClass.cssVarList.borderStyleOverride,
|
|
77
|
+
},
|
|
78
|
+
itemBorderColor: {
|
|
79
|
+
selector: ListItemClass.componentName,
|
|
80
|
+
property: ListItemClass.cssVarList.borderColorOverride,
|
|
81
|
+
},
|
|
82
|
+
itemBorderWidth: {
|
|
83
|
+
selector: ListItemClass.componentName,
|
|
84
|
+
property: ListItemClass.cssVarList.borderWidthOverride,
|
|
85
|
+
},
|
|
86
|
+
itemVerticalPadding: {
|
|
87
|
+
selector: ListItemClass.componentName,
|
|
88
|
+
property: ListItemClass.cssVarList.verticalPaddingOverride,
|
|
89
|
+
},
|
|
90
|
+
itemHorizontalPadding: {
|
|
91
|
+
selector: ListItemClass.componentName,
|
|
92
|
+
property: ListItemClass.cssVarList.horizontalPaddingOverride,
|
|
93
|
+
},
|
|
94
|
+
itemAlignment: [
|
|
95
|
+
{ selector: ListItemClass.componentName, property: ListItemClass.cssVarList.alignItemsOverride },
|
|
96
|
+
{ selector: TextClass.componentName, property: TextClass.cssVarList.textAlign },
|
|
97
|
+
]
|
|
55
98
|
},
|
|
56
99
|
}),
|
|
57
|
-
createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size'] }),
|
|
100
|
+
createDynamicDataMixin({ itemRenderer, rerenderAttrsList: ['size', 'item-text-variant', 'logo-size'] }),
|
|
58
101
|
draggableMixin,
|
|
59
102
|
componentNameValidationMixin,
|
|
60
103
|
customMixin
|
|
@@ -83,6 +126,7 @@ export const AppsListClass = compose(
|
|
|
83
126
|
|
|
84
127
|
descope-text {
|
|
85
128
|
${TextClass.cssVarList.hostDirection}: var(${AppsListClass.cssVarList.hostDirection});
|
|
129
|
+
max-width: 100%;
|
|
86
130
|
}
|
|
87
131
|
`,
|
|
88
132
|
})
|
package/src/theme.js
CHANGED
|
@@ -31,6 +31,29 @@ const appsList = {
|
|
|
31
31
|
[vars.itemsFontSize]: '20px',
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
+
|
|
35
|
+
itemPadding: {
|
|
36
|
+
xs: {
|
|
37
|
+
[vars.itemVerticalPadding]: globalRefs.spacing.xs,
|
|
38
|
+
[vars.itemHorizontalPadding]: globalRefs.spacing.xs,
|
|
39
|
+
},
|
|
40
|
+
sm: {
|
|
41
|
+
[vars.itemVerticalPadding]: globalRefs.spacing.sm,
|
|
42
|
+
[vars.itemHorizontalPadding]: globalRefs.spacing.sm,
|
|
43
|
+
},
|
|
44
|
+
md: {
|
|
45
|
+
[vars.itemVerticalPadding]: globalRefs.spacing.md,
|
|
46
|
+
[vars.itemHorizontalPadding]: globalRefs.spacing.md,
|
|
47
|
+
},
|
|
48
|
+
lg: {
|
|
49
|
+
[vars.itemVerticalPadding]: globalRefs.spacing.lg,
|
|
50
|
+
[vars.itemHorizontalPadding]: globalRefs.spacing.lg,
|
|
51
|
+
},
|
|
52
|
+
xl: {
|
|
53
|
+
[vars.itemVerticalPadding]: globalRefs.spacing.xl,
|
|
54
|
+
[vars.itemHorizontalPadding]: globalRefs.spacing.xl,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
34
57
|
};
|
|
35
58
|
|
|
36
59
|
export default appsList;
|
|
@@ -7,11 +7,21 @@ const Template = ({
|
|
|
7
7
|
emptyState,
|
|
8
8
|
size,
|
|
9
9
|
variant,
|
|
10
|
+
'logo-size': logoSize,
|
|
11
|
+
'item-padding': itemPadding,
|
|
12
|
+
'item-text-variant': itemTextVariant,
|
|
13
|
+
'st-item-alignment': itemAlignment,
|
|
14
|
+
'st-background-color': backgroundColor,
|
|
10
15
|
}) => `
|
|
11
16
|
<descope-apps-list
|
|
12
17
|
st-host-direction="${direction || ''}"
|
|
13
|
-
size
|
|
18
|
+
size="${size || ''}"
|
|
14
19
|
variant="${variant}"
|
|
20
|
+
logo-size="${logoSize || ''}"
|
|
21
|
+
item-padding="${itemPadding || ''}"
|
|
22
|
+
item-text-variant="${itemTextVariant || ''}"
|
|
23
|
+
st-item-alignment="${itemAlignment || ''}"
|
|
24
|
+
st-background-color="${backgroundColor || ''}"
|
|
15
25
|
>
|
|
16
26
|
<div slot="empty-state">${emptyState}</div>
|
|
17
27
|
</descope-apps-list>
|
|
@@ -37,12 +47,40 @@ export default {
|
|
|
37
47
|
],
|
|
38
48
|
argTypes: {
|
|
39
49
|
...directionControl,
|
|
40
|
-
|
|
50
|
+
size: {
|
|
51
|
+
name: 'Size',
|
|
52
|
+
options: [undefined,'xs', 'sm', 'md', 'lg'],
|
|
53
|
+
control: { type: 'select' },
|
|
54
|
+
},
|
|
41
55
|
variant: {
|
|
42
56
|
name: 'Variant',
|
|
43
57
|
options: ['list', 'tiles'],
|
|
44
58
|
control: { type: 'radio' },
|
|
45
59
|
},
|
|
60
|
+
'logo-size': {
|
|
61
|
+
name: 'Logo Size',
|
|
62
|
+
options: ['xs', 'sm', 'md', 'lg'],
|
|
63
|
+
control: { type: 'select' },
|
|
64
|
+
},
|
|
65
|
+
'item-padding': {
|
|
66
|
+
name: 'Item Padding',
|
|
67
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
68
|
+
control: { type: 'select' },
|
|
69
|
+
},
|
|
70
|
+
'item-text-variant': {
|
|
71
|
+
name: 'Item Text Variant',
|
|
72
|
+
options: ['h1', 'h2', 'h3', 'subtitle1', 'subtitle2', 'body1', 'body2'],
|
|
73
|
+
control: { type: 'select' },
|
|
74
|
+
},
|
|
75
|
+
'st-item-alignment': {
|
|
76
|
+
name: 'Item Alignment',
|
|
77
|
+
options: ['start', 'center', 'end'],
|
|
78
|
+
control: { type: 'select' },
|
|
79
|
+
},
|
|
80
|
+
'st-background-color': {
|
|
81
|
+
name: 'Background Color',
|
|
82
|
+
control: 'color',
|
|
83
|
+
},
|
|
46
84
|
},
|
|
47
85
|
};
|
|
48
86
|
|