@dxos/lit-ui 0.8.4-main.fbb7a13 → 0.8.4-main.fcfe5033a5
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/src/dx-anchor/dx-anchor.d.ts +1 -1
- package/dist/src/dx-anchor/dx-anchor.d.ts.map +1 -1
- package/dist/src/dx-anchor/dx-anchor.js +4 -4
- package/dist/src/dx-anchor/dx-anchor.js.map +1 -1
- package/dist/src/dx-avatar/dx-avatar.d.ts +1 -1
- package/dist/src/dx-avatar/dx-avatar.d.ts.map +1 -1
- package/dist/src/dx-avatar/dx-avatar.js +5 -3
- package/dist/src/dx-avatar/dx-avatar.js.map +1 -1
- package/dist/src/dx-avatar/dx-avatar.lit-stories.js +1 -1
- package/dist/src/dx-avatar/dx-avatar.lit-stories.js.map +1 -1
- package/dist/src/react.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/dx-anchor/dx-anchor.ts +5 -8
- package/src/dx-avatar/dx-avatar.lit-stories.ts +1 -1
- package/src/dx-avatar/dx-avatar.pcss +53 -33
- package/src/dx-avatar/dx-avatar.ts +6 -4
- package/src/dx-tag-picker/dx-tag-picker.pcss +6 -4
- package/src/react.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/lit-ui",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fcfe5033a5",
|
|
4
4
|
"description": "Web Components for DXOS using Lit",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@lit/react": "^1.0.8",
|
|
45
45
|
"lit": "^3.3.1",
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/util": "0.8.4-main.
|
|
46
|
+
"@dxos/ui-types": "0.8.4-main.fcfe5033a5",
|
|
47
|
+
"@dxos/react-hooks": "0.8.4-main.fcfe5033a5",
|
|
48
|
+
"@dxos/util": "0.8.4-main.fcfe5033a5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
51
|
+
"@dxos/test-utils": "0.8.4-main.fcfe5033a5"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -12,22 +12,21 @@ import { DxAnchorActivate } from '@dxos/ui-types';
|
|
|
12
12
|
|
|
13
13
|
@customElement('dx-anchor')
|
|
14
14
|
export class DxAnchor extends LitElement {
|
|
15
|
-
|
|
16
15
|
// TODO(thure): There is a case (in)sensitivity issue here which is pernicious:
|
|
17
16
|
// Only refactoring the properties here to all-lowercase fixes the binding in `RefField.tsx`, but that
|
|
18
17
|
// should be unnecessary, and it isn’t an issue for `DxAvatar` or `DxGrid`. What’s going on?
|
|
19
18
|
|
|
20
19
|
@property({ type: String })
|
|
21
|
-
|
|
20
|
+
dxn: string = '';
|
|
22
21
|
|
|
23
22
|
@property({ type: String })
|
|
24
23
|
rootclassname: string | undefined = undefined;
|
|
25
24
|
|
|
26
|
-
override connectedCallback
|
|
25
|
+
override connectedCallback(): void {
|
|
27
26
|
super.connectedCallback();
|
|
28
27
|
this.tabIndex = 0;
|
|
29
|
-
this.classList.add(this.getAttribute('data-visible-focus')==='false' ? 'outline-
|
|
30
|
-
if(this.rootclassname){
|
|
28
|
+
this.classList.add(this.getAttribute('data-visible-focus') === 'false' ? 'outline-hidden' : 'dx-focus-ring');
|
|
29
|
+
if (this.rootclassname) {
|
|
31
30
|
this.classList.add(this.rootclassname);
|
|
32
31
|
}
|
|
33
32
|
this.setAttribute('role', 'button');
|
|
@@ -40,9 +39,7 @@ export class DxAnchor extends LitElement {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
private handleActivate(event: { type: string }): void {
|
|
43
|
-
this.dispatchEvent(
|
|
44
|
-
new DxAnchorActivate({ refId: this.refid, label: this.textContent ?? '', trigger: this }),
|
|
45
|
-
);
|
|
42
|
+
this.dispatchEvent(new DxAnchorActivate({ dxn: this.dxn, label: this.textContent ?? '', trigger: this }));
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
override createRenderRoot(): this {
|
|
@@ -17,5 +17,5 @@ export default {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const Basic = (_props: DxAvatarProps) => {
|
|
20
|
-
return html
|
|
20
|
+
return html` <dx-avatar hue="teal" fallback="Composer user" icon="/icons.svg#ph--basketball--regular"></dx-avatar> `;
|
|
21
21
|
};
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
/* Tailwind v4: Fixed @apply directives - converted to direct CSS */
|
|
1
2
|
.dx-avatar-group {
|
|
2
|
-
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding-right: 0.5rem;
|
|
3
6
|
}
|
|
4
7
|
|
|
5
8
|
.dx-avatar-group .dx-avatar {
|
|
6
|
-
|
|
9
|
+
margin-right: -0.5rem;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
.dx-avatar-group .dx-avatar {
|
|
10
|
-
&[size=
|
|
11
|
-
|
|
13
|
+
&[size='0'],
|
|
14
|
+
&[size='px'],
|
|
15
|
+
&[size='0.5'],
|
|
16
|
+
&[size='1'],
|
|
17
|
+
&[size='1.5'],
|
|
18
|
+
&[size='2'],
|
|
19
|
+
&[size='2.5'] {
|
|
20
|
+
margin-right: -0.25rem;
|
|
12
21
|
}
|
|
13
22
|
}
|
|
14
23
|
|
|
@@ -17,68 +26,79 @@ dx-avatar {
|
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
.dx-avatar {
|
|
20
|
-
|
|
29
|
+
position: relative;
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
/* Tailwind v4 migration: converted @apply to direct CSS properties */
|
|
21
33
|
|
|
22
34
|
.dx-avatar__frame {
|
|
23
|
-
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
24
37
|
}
|
|
25
38
|
|
|
26
|
-
.dx-avatar__frame,
|
|
27
|
-
|
|
39
|
+
.dx-avatar__frame,
|
|
40
|
+
.dx-avatar__ring {
|
|
41
|
+
border-radius: 9999px;
|
|
28
42
|
}
|
|
29
43
|
|
|
30
|
-
&[data-variant=
|
|
31
|
-
.dx-avatar__frame,
|
|
32
|
-
|
|
44
|
+
&[data-variant='square'] {
|
|
45
|
+
.dx-avatar__frame,
|
|
46
|
+
.dx-avatar__ring {
|
|
47
|
+
border-radius: 0.125rem;
|
|
33
48
|
}
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
.dx-avatar__status-icon {
|
|
37
|
-
|
|
52
|
+
position: absolute;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
right: 0;
|
|
38
55
|
}
|
|
39
56
|
|
|
40
57
|
.dx-avatar__ring {
|
|
41
|
-
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset: 0;
|
|
60
|
+
border-width: 2px;
|
|
61
|
+
border-color: var(--surface-bg);
|
|
42
62
|
}
|
|
43
63
|
|
|
44
|
-
&[data-status=
|
|
45
|
-
|
|
64
|
+
&[data-status='active'] .dx-avatar__ring {
|
|
65
|
+
border-color: var(--color-success-border);
|
|
46
66
|
}
|
|
47
67
|
|
|
48
|
-
&[data-status=
|
|
49
|
-
|
|
68
|
+
&[data-status='inactive'] .dx-avatar__ring {
|
|
69
|
+
border-color: var(--color-neutral-border);
|
|
50
70
|
}
|
|
51
71
|
|
|
52
|
-
&[data-status=
|
|
53
|
-
|
|
72
|
+
&[data-status='current'] .dx-avatar__ring {
|
|
73
|
+
border-color: var(--color-accent-focus-indicator);
|
|
54
74
|
}
|
|
55
75
|
|
|
56
|
-
&[data-status=
|
|
57
|
-
|
|
76
|
+
&[data-status='internal'] .dx-avatar__ring {
|
|
77
|
+
border-color: var(--color-separator);
|
|
58
78
|
}
|
|
59
79
|
|
|
60
|
-
&[data-status=
|
|
61
|
-
|
|
80
|
+
&[data-status='error'] .dx-avatar__ring {
|
|
81
|
+
border-color: var(--color-error-border);
|
|
62
82
|
}
|
|
63
83
|
|
|
64
|
-
&[data-status=
|
|
65
|
-
|
|
84
|
+
&[data-status='warning'] .dx-avatar__ring {
|
|
85
|
+
border-color: var(--color-warning-border);
|
|
66
86
|
}
|
|
67
87
|
|
|
68
|
-
&[data-animation=
|
|
69
|
-
|
|
88
|
+
&[data-animation='pulse'] .dx-avatar__ring {
|
|
89
|
+
animation: halo-pulse var(--duration, 1s) ease-in-out infinite;
|
|
70
90
|
}
|
|
71
91
|
|
|
72
|
-
&[data-state-loading-status=
|
|
73
|
-
.dx-avatar__fallback-text,
|
|
74
|
-
|
|
92
|
+
&[data-state-loading-status='loaded'] {
|
|
93
|
+
.dx-avatar__fallback-text,
|
|
94
|
+
.dx-avatar__status-icon {
|
|
95
|
+
display: none;
|
|
75
96
|
}
|
|
76
97
|
}
|
|
77
98
|
|
|
78
|
-
&[data-state-loading-status=
|
|
99
|
+
&[data-state-loading-status='error'] {
|
|
79
100
|
.dx-avatar__image {
|
|
80
|
-
|
|
101
|
+
display: none;
|
|
81
102
|
}
|
|
82
103
|
}
|
|
83
104
|
}
|
|
84
|
-
|
|
@@ -13,7 +13,7 @@ import { type Size } from '../defs';
|
|
|
13
13
|
export type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
14
14
|
|
|
15
15
|
export type AvatarVariant = 'square' | 'circle';
|
|
16
|
-
export type AvatarStatus = 'active' | 'inactive' | 'current' | '
|
|
16
|
+
export type AvatarStatus = 'active' | 'inactive' | 'current' | 'internal' | 'error' | 'warning';
|
|
17
17
|
export type AvatarAnimation = 'pulse' | 'none';
|
|
18
18
|
|
|
19
19
|
const rx = '0.125rem';
|
|
@@ -118,11 +118,13 @@ export class DxAvatar extends LitElement {
|
|
|
118
118
|
? 'transparent'
|
|
119
119
|
: this.hue
|
|
120
120
|
? this.hueVariant === 'surface'
|
|
121
|
-
? `var(--
|
|
122
|
-
: `var(--
|
|
121
|
+
? `var(--color-${this.hue}-surface)`
|
|
122
|
+
: `var(--color-${this.hue === 'neutral' ? 'input-surface' : `${this.hue}-fill`})`
|
|
123
123
|
: 'var(--surface-bg)';
|
|
124
124
|
const fg =
|
|
125
|
-
this.hue && this.hueVariant === 'surface'
|
|
125
|
+
this.hue && this.hueVariant === 'surface'
|
|
126
|
+
? `var(--color-${this.hue}-surface-text)`
|
|
127
|
+
: 'var(--color-accent-surface-text)';
|
|
126
128
|
|
|
127
129
|
return html`<span
|
|
128
130
|
role="none"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@reference "../../../ui-theme/src/main.css";
|
|
2
|
+
|
|
1
3
|
@layer dx-components {
|
|
2
4
|
dx-tag-picker-item {
|
|
3
5
|
display: inline-block;
|
|
@@ -8,16 +10,16 @@
|
|
|
8
10
|
@apply p-0 m-0 flex;
|
|
9
11
|
|
|
10
12
|
button {
|
|
11
|
-
@apply
|
|
12
|
-
padding-block: var(--
|
|
13
|
+
@apply px-1;
|
|
14
|
+
padding-block: var(--spacing-tag-padding-block);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
&[data-remove='true'] {
|
|
16
18
|
button:first-child {
|
|
17
|
-
@apply
|
|
19
|
+
@apply pr-0.5;
|
|
18
20
|
}
|
|
19
21
|
button:last-child {
|
|
20
|
-
@apply
|
|
22
|
+
@apply pl-0.5;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|