@dxos/lit-ui 0.8.4-main.e8ec1fe → 0.8.4-main.ef1bc66f44
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 +7 -5
- package/dist/src/dx-avatar/dx-avatar.js.map +1 -1
- package/dist/src/react.d.ts +1 -1
- package/dist/src/react.d.ts.map +1 -1
- package/dist/src/react.js +1 -1
- package/dist/src/react.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -12
- package/src/defs.ts +1 -1
- package/src/dx-anchor/dx-anchor.ts +4 -4
- package/src/dx-avatar/dx-avatar.pcss +1 -1
- package/src/dx-avatar/dx-avatar.ts +9 -6
- package/src/react.ts +2 -1
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/lit-ui",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ef1bc66f44",
|
|
4
4
|
"description": "Web Components for DXOS using Lit",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"*.css",
|
|
15
|
+
"*.pcss"
|
|
16
|
+
],
|
|
10
17
|
"type": "module",
|
|
11
18
|
"exports": {
|
|
12
19
|
".": {
|
|
13
|
-
"source": "./src/index.ts",
|
|
14
20
|
"types": "./dist/src/index.d.ts",
|
|
15
|
-
"
|
|
16
|
-
"node": "./dist/src/index.js"
|
|
21
|
+
"default": "./dist/src/index.js"
|
|
17
22
|
},
|
|
18
23
|
"./react": {
|
|
19
|
-
"source": "./src/react.ts",
|
|
20
24
|
"types": "./dist/src/react.d.ts",
|
|
21
|
-
"
|
|
22
|
-
"node": "./dist/src/react.js"
|
|
25
|
+
"default": "./dist/src/react.js"
|
|
23
26
|
},
|
|
24
27
|
"./dx-avatar.pcss": "./src/dx-avatar/dx-avatar.pcss",
|
|
25
28
|
"./dx-tag-picker.pcss": "./src/dx-tag-picker/dx-tag-picker.pcss"
|
|
@@ -40,12 +43,12 @@
|
|
|
40
43
|
"dependencies": {
|
|
41
44
|
"@lit/react": "^1.0.8",
|
|
42
45
|
"lit": "^3.3.1",
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/react-
|
|
45
|
-
"@dxos/util": "0.8.4-main.
|
|
46
|
+
"@dxos/ui-types": "0.8.4-main.ef1bc66f44",
|
|
47
|
+
"@dxos/react-hooks": "0.8.4-main.ef1bc66f44",
|
|
48
|
+
"@dxos/util": "0.8.4-main.ef1bc66f44"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
51
|
+
"@dxos/test-utils": "0.8.4-main.ef1bc66f44"
|
|
49
52
|
},
|
|
50
53
|
"publishConfig": {
|
|
51
54
|
"access": "public"
|
package/src/defs.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
// TODO(thure): I was unable to bring this in from `
|
|
5
|
+
// TODO(thure): I was unable to bring this in from `ui-types` because toolbox.ts would not acknowledge
|
|
6
6
|
// `"@dxos/lit-ui": [ "packages/ui/lit-ui/src/index.ts" ]` in tsconfig.paths.json. How is this meant to work? How is it
|
|
7
7
|
// okay with `react-hooks`?
|
|
8
8
|
export type Size =
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { LitElement } from 'lit';
|
|
9
9
|
import { customElement, property } from 'lit/decorators.js';
|
|
10
10
|
|
|
11
|
-
import { DxAnchorActivate } from '@dxos/
|
|
11
|
+
import { DxAnchorActivate } from '@dxos/ui-types';
|
|
12
12
|
|
|
13
13
|
@customElement('dx-anchor')
|
|
14
14
|
export class DxAnchor extends LitElement {
|
|
@@ -18,7 +18,7 @@ export class DxAnchor extends LitElement {
|
|
|
18
18
|
// should be unnecessary, and it isn’t an issue for `DxAvatar` or `DxGrid`. What’s going on?
|
|
19
19
|
|
|
20
20
|
@property({ type: String })
|
|
21
|
-
|
|
21
|
+
dxn: string = '';
|
|
22
22
|
|
|
23
23
|
@property({ type: String })
|
|
24
24
|
rootclassname: string | undefined = undefined;
|
|
@@ -27,7 +27,7 @@ export class DxAnchor extends LitElement {
|
|
|
27
27
|
super.connectedCallback();
|
|
28
28
|
this.tabIndex = 0;
|
|
29
29
|
this.classList.add(this.getAttribute('data-visible-focus')==='false' ? 'outline-none' : 'dx-focus-ring');
|
|
30
|
-
if(this.rootclassname){
|
|
30
|
+
if (this.rootclassname){
|
|
31
31
|
this.classList.add(this.rootclassname);
|
|
32
32
|
}
|
|
33
33
|
this.setAttribute('role', 'button');
|
|
@@ -41,7 +41,7 @@ export class DxAnchor extends LitElement {
|
|
|
41
41
|
|
|
42
42
|
private handleActivate(event: { type: string }): void {
|
|
43
43
|
this.dispatchEvent(
|
|
44
|
-
new DxAnchorActivate({
|
|
44
|
+
new DxAnchorActivate({ dxn: this.dxn, label: this.textContent ?? '', trigger: this }),
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -71,7 +71,7 @@ export class DxAvatar extends LitElement {
|
|
|
71
71
|
hue: string | undefined = undefined;
|
|
72
72
|
|
|
73
73
|
@property({ type: String })
|
|
74
|
-
hueVariant: 'fill' | 'surface' = 'fill';
|
|
74
|
+
hueVariant: 'fill' | 'surface' | 'transparent' = 'fill';
|
|
75
75
|
|
|
76
76
|
@property({ type: String })
|
|
77
77
|
size: Size = 10;
|
|
@@ -113,11 +113,14 @@ export class DxAvatar extends LitElement {
|
|
|
113
113
|
const r = sizePx / 2 - ringGap - ringWidth;
|
|
114
114
|
const isTextOnly = Boolean(this.fallback && /[0-9a-zA-Z]+/.test(this.fallback));
|
|
115
115
|
const fontScale = (isTextOnly ? 3 : 3.6) * (1 / 1.612);
|
|
116
|
-
const bg =
|
|
117
|
-
|
|
118
|
-
?
|
|
119
|
-
:
|
|
120
|
-
|
|
116
|
+
const bg =
|
|
117
|
+
this.hueVariant === 'transparent'
|
|
118
|
+
? 'transparent'
|
|
119
|
+
: this.hue
|
|
120
|
+
? this.hueVariant === 'surface'
|
|
121
|
+
? `var(--dx-${this.hue}Surface)`
|
|
122
|
+
: `var(--dx-${this.hue === 'neutral' ? 'inputSurface' : `${this.hue}Fill`})`
|
|
123
|
+
: 'var(--surface-bg)';
|
|
121
124
|
const fg =
|
|
122
125
|
this.hue && this.hueVariant === 'surface' ? `var(--dx-${this.hue}SurfaceText)` : 'var(--dx-accentSurfaceText)';
|
|
123
126
|
|
package/src/react.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type EventName, createComponent } from '@lit/react';
|
|
6
6
|
import React, { type ComponentPropsWithRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import { DX_ANCHOR_ACTIVATE, type DxAnchorActivate } from '@dxos/
|
|
8
|
+
import { DX_ANCHOR_ACTIVATE, type DxAnchorActivate } from '@dxos/ui-types';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
type DxTagPickerItemClick,
|
|
@@ -54,4 +54,5 @@ export const DxTagPickerItem = createComponent({
|
|
|
54
54
|
export type DxTagPickerItemProps = ComponentPropsWithRef<typeof DxTagPickerItem>;
|
|
55
55
|
|
|
56
56
|
export { createComponent };
|
|
57
|
+
|
|
57
58
|
export type { EventName };
|