@descope-ui/descope-list-item 0.0.1

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 ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
+
5
+ ## 0.0.1 (2025-07-21)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `e2e-utils` updated to version `0.0.1`
10
+ * `@descope-ui/common` updated to version `0.0.18`
11
+ * `@descope-ui/theme-globals` updated to version `0.0.19`
12
+ # Changelog
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@descope-ui/descope-list-item",
3
+ "version": "0.0.1",
4
+ "exports": {
5
+ ".": {
6
+ "import": "./src/component/index.js"
7
+ },
8
+ "./theme": {
9
+ "import": "./src/theme.js"
10
+ },
11
+ "./class": {
12
+ "import": "./src/component/ListItemClass.js"
13
+ }
14
+ },
15
+ "devDependencies": {
16
+ "@playwright/test": "1.38.1",
17
+ "e2e-utils": "0.0.1"
18
+ },
19
+ "dependencies": {
20
+ "@descope-ui/common": "0.0.18",
21
+ "@descope-ui/theme-globals": "0.0.19"
22
+ },
23
+ "publishConfig": {
24
+ "link-workspace-packages": false
25
+ },
26
+ "scripts": {
27
+ "test": "echo 'No tests defined' && exit 0",
28
+ "test:e2e": "echo 'No e2e tests defined' && exit 0"
29
+ }
30
+ }
package/project.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@descope-ui/descope-list-item",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/web-components/components/descope-list-item/src",
5
+ "projectType": "library",
6
+ "targets": {
7
+ "version": {
8
+ "executor": "@jscutlery/semver:version",
9
+ "options": {
10
+ "trackDeps": true,
11
+ "push": false,
12
+ "preset": "conventional"
13
+ }
14
+ }
15
+ },
16
+ "tags": []
17
+ }
@@ -0,0 +1,62 @@
1
+ import {
2
+ createStyleMixin,
3
+ draggableMixin,
4
+ componentNameValidationMixin,
5
+ activeableMixin,
6
+ } from '@descope-ui/common/components-mixins';
7
+ import { compose } from '@descope-ui/common/utils';
8
+ import { getComponentName } from '@descope-ui/common/components-helpers';
9
+ import { injectStyle } from '@descope-ui/common/components-helpers';
10
+ import { createBaseClass } from '@descope-ui/common/base-classes';
11
+
12
+ export const componentName = getComponentName('list-item');
13
+
14
+ const customMixin = (superclass) =>
15
+ class ListItemMixinClass extends superclass {
16
+ constructor() {
17
+ super();
18
+
19
+ this.attachShadow({ mode: 'open' }).innerHTML = `
20
+ <slot></slot>
21
+ `;
22
+
23
+ injectStyle(
24
+ `
25
+ slot {
26
+ width: 100%;
27
+ display: flex;
28
+ overflow: hidden;
29
+ box-sizing: border-box;
30
+ }
31
+ :host {
32
+ display: block;
33
+ }
34
+ `,
35
+ this
36
+ );
37
+ }
38
+ };
39
+
40
+ export const ListItemClass = compose(
41
+ createStyleMixin({
42
+ mappings: {
43
+ padding: {},
44
+ backgroundColor: {},
45
+ borderColor: {},
46
+ borderStyle: {},
47
+ borderWidth: {},
48
+ borderRadius: {},
49
+ outline: {},
50
+ cursor: {},
51
+ gap: {},
52
+ maxWidth: { selector: () => ':host' },
53
+ alignItems: {},
54
+ flexDirection: {},
55
+ transition: {},
56
+ },
57
+ }),
58
+ draggableMixin,
59
+ componentNameValidationMixin,
60
+ customMixin,
61
+ activeableMixin
62
+ )(createBaseClass({ componentName, baseSelector: 'slot' }));
@@ -0,0 +1,5 @@
1
+ import { componentName, ListItemClass } from './ListItemClass';
2
+
3
+ customElements.define(componentName, ListItemClass);
4
+
5
+ export { ListItemClass, componentName };
package/src/theme.js ADDED
@@ -0,0 +1,41 @@
1
+ import globals from '@descope-ui/theme-globals';
2
+ import { getThemeRefs } from '@descope-ui/common/theme-helpers';
3
+ import { ListItemClass } from './component/ListItemClass';
4
+
5
+ const globalRefs = getThemeRefs(globals);
6
+
7
+ export const vars = ListItemClass.cssVarList;
8
+
9
+ const listItem = {
10
+ [vars.backgroundColor]: globalRefs.colors.surface.main,
11
+ [vars.padding]: globalRefs.spacing.lg,
12
+ [vars.gap]: globalRefs.spacing.md,
13
+ [vars.borderStyle]: 'solid',
14
+ [vars.borderWidth]: globalRefs.border.xs,
15
+ [vars.borderColor]: globalRefs.colors.surface.main,
16
+ [vars.borderRadius]: globalRefs.radius.sm,
17
+ [vars.cursor]: 'pointer',
18
+ [vars.alignItems]: 'center',
19
+ [vars.flexDirection]: 'row',
20
+ [vars.transition]: 'border-color 0.2s, background-color 0.2s',
21
+
22
+ variant: {
23
+ tile: {
24
+ [vars.alignItems]: 'flex-start',
25
+ [vars.flexDirection]: 'column',
26
+ [vars.borderColor]: globalRefs.colors.surface.light,
27
+ },
28
+ },
29
+
30
+ _hover: {
31
+ [vars.backgroundColor]: globalRefs.colors.surface.highlight,
32
+ },
33
+
34
+ _active: {
35
+ [vars.backgroundColor]: globalRefs.colors.surface.main,
36
+ [vars.borderColor]: globalRefs.colors.primary.light,
37
+ [vars.outline]: `1px solid ${globalRefs.colors.primary.light}`,
38
+ },
39
+ };
40
+
41
+ export default listItem;