@umbraco-ui/uui-card-user 0.0.2 → 0.0.3
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/README.md +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +11 -7
- package/lib/uui-card-user.element.d.ts +6 -1
- package/package.json +7 -6
- package/lib/uui-card-user.element.js +0 -117
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ npm i @umbraco-ui/uui-card-user
|
|
|
9
9
|
Import the registration of `<uui-card-user>` via:
|
|
10
10
|
|
|
11
11
|
```javascript
|
|
12
|
-
import '@umbraco-ui/uui-card-user
|
|
12
|
+
import '@umbraco-ui/uui-card-user';
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
When looking to leverage the `UUICardUserElement` base class as a type and/or for extension purposes, do so via:
|
|
16
16
|
|
|
17
17
|
```javascript
|
|
18
|
-
import { UUICardUserElement } from '@umbraco-ui/uui-card-user
|
|
18
|
+
import { UUICardUserElement } from '@umbraco-ui/uui-card-user';
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Example
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './uui-card-user.element';
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { UUICardElement } from '@umbraco-ui/uui-card/lib';
|
|
2
|
+
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
1
3
|
import { css, html, nothing } from 'lit';
|
|
2
4
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import { UUICardElement } from '@umbraco-ui/uui-card/lib/uui-card.element';
|
|
4
5
|
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -13,15 +14,13 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
14
|
__defProp(target, key, result);
|
|
14
15
|
return result;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
let UUICardUserElement = class extends UUICardElement {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
19
20
|
this.name = "";
|
|
20
21
|
}
|
|
21
22
|
render() {
|
|
22
23
|
return html`
|
|
23
|
-
<slot name="tag"></slot>
|
|
24
|
-
<slot name="actions"></slot>
|
|
25
24
|
<uui-avatar id="avatar" name=${this.name} size="m"></uui-avatar>
|
|
26
25
|
<div
|
|
27
26
|
id="open-part"
|
|
@@ -31,9 +30,11 @@ class UUICardUserElement extends UUICardElement {
|
|
|
31
30
|
<span> ${this.name} </span>
|
|
32
31
|
</div>
|
|
33
32
|
<slot></slot>
|
|
33
|
+
<slot name="tag"></slot>
|
|
34
|
+
<slot name="actions"></slot>
|
|
34
35
|
`;
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
+
};
|
|
37
38
|
UUICardUserElement.styles = [
|
|
38
39
|
...UUICardElement.styles,
|
|
39
40
|
css`
|
|
@@ -46,7 +47,7 @@ UUICardUserElement.styles = [
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
slot:not([name])::slotted(*) {
|
|
49
|
-
font-size: var(--uui-size
|
|
50
|
+
font-size: var(--uui-type-small-size,12px);
|
|
50
51
|
line-height: var(--uui-size-6,18px);
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -113,5 +114,8 @@ UUICardUserElement.styles = [
|
|
|
113
114
|
__decorateClass([
|
|
114
115
|
property({ type: String })
|
|
115
116
|
], UUICardUserElement.prototype, "name", 2);
|
|
117
|
+
UUICardUserElement = __decorateClass([
|
|
118
|
+
defineElement("uui-card-user")
|
|
119
|
+
], UUICardUserElement);
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
export { UUICardUserElement };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UUICardElement } from '@umbraco-ui/uui-card/lib
|
|
1
|
+
import { UUICardElement } from '@umbraco-ui/uui-card/lib';
|
|
2
2
|
/**
|
|
3
3
|
* @element uui-card-user
|
|
4
4
|
* @fires {UUICardEvent} open - fires when the user card title is clicked
|
|
@@ -16,3 +16,8 @@ export declare class UUICardUserElement extends UUICardElement {
|
|
|
16
16
|
name: string;
|
|
17
17
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'uui-card-user': UUICardUserElement;
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-card-user",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -20,19 +20,20 @@
|
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/umbraco/Umbraco.UI/issues"
|
|
22
22
|
},
|
|
23
|
-
"main": "./
|
|
23
|
+
"main": "./lib/index.js",
|
|
24
24
|
"module": "./lib/index.js",
|
|
25
|
+
"types": "./lib/index.d.ts",
|
|
26
|
+
"type": "module",
|
|
25
27
|
"customElements": "custom-elements.json",
|
|
26
28
|
"files": [
|
|
27
|
-
"dist",
|
|
28
29
|
"lib/**/*.d.ts",
|
|
29
30
|
"lib/**/*.js",
|
|
30
31
|
"custom-elements.json"
|
|
31
32
|
],
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@umbraco-ui/uui-avatar": "^0.0.15",
|
|
34
|
-
"@umbraco-ui/uui-base": "0.0.
|
|
35
|
-
"@umbraco-ui/uui-card": "0.0.
|
|
35
|
+
"@umbraco-ui/uui-base": "0.0.16",
|
|
36
|
+
"@umbraco-ui/uui-card": "0.0.3"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"access": "public"
|
|
44
45
|
},
|
|
45
46
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-card-user",
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6fbddfc1295e2ea00a532d4f9eb798165b2d39ac"
|
|
47
48
|
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { css, html, nothing } from 'lit';
|
|
2
|
-
import { property } from 'lit/decorators.js';
|
|
3
|
-
import { UUICardElement } from '@umbraco-ui/uui-card/lib/uui-card.element';
|
|
4
|
-
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
-
if (decorator = decorators[i])
|
|
11
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
-
if (kind && result)
|
|
13
|
-
__defProp(target, key, result);
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
class UUICardUserElement extends UUICardElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.name = "";
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return html`
|
|
23
|
-
<slot name="tag"></slot>
|
|
24
|
-
<slot name="actions"></slot>
|
|
25
|
-
<uui-avatar id="avatar" name=${this.name} size="m"></uui-avatar>
|
|
26
|
-
<div
|
|
27
|
-
id="open-part"
|
|
28
|
-
tabindex=${this.disabled ? nothing : "0"}
|
|
29
|
-
@click=${this.handleOpenClick}
|
|
30
|
-
@keydown=${this.handleOpenKeydown}>
|
|
31
|
-
<span> ${this.name} </span>
|
|
32
|
-
</div>
|
|
33
|
-
<slot></slot>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
UUICardUserElement.styles = [
|
|
38
|
-
...UUICardElement.styles,
|
|
39
|
-
css`
|
|
40
|
-
:host {
|
|
41
|
-
min-width: 250px;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
padding: var(--uui-size-3,9px);
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
slot:not([name])::slotted(*) {
|
|
49
|
-
font-size: var(--uui-size-4,12px);
|
|
50
|
-
line-height: var(--uui-size-6,18px);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
::slotted(*) {
|
|
54
|
-
text-align: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
slot[name='tag'] {
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 6px;
|
|
60
|
-
right: 6px;
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: right;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
slot[name='actions'] {
|
|
66
|
-
position: absolute;
|
|
67
|
-
top: var(--uui-size-4,12px);
|
|
68
|
-
right: var(--uui-size-4,12px);
|
|
69
|
-
display: flex;
|
|
70
|
-
justify-content: right;
|
|
71
|
-
|
|
72
|
-
opacity: 0;
|
|
73
|
-
transition: opacity 120ms;
|
|
74
|
-
}
|
|
75
|
-
:host(:focus) slot[name='actions'],
|
|
76
|
-
:host(:focus-within) slot[name='actions'],
|
|
77
|
-
:host(:hover) slot[name='actions'] {
|
|
78
|
-
opacity: 1;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
#avatar {
|
|
82
|
-
margin: var(--uui-size-3,9px);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
slot[name='icon']::slotted(*) {
|
|
86
|
-
font-size: 1.2em;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
#open-part {
|
|
90
|
-
display: flex;
|
|
91
|
-
position: relative;
|
|
92
|
-
font-weight: 700;
|
|
93
|
-
align-items: center;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
margin: 0 0 3px 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
:host([disabled]) #open-part {
|
|
99
|
-
pointer-events: none;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
#open-part > span {
|
|
103
|
-
vertical-align: center;
|
|
104
|
-
margin-top: 3px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
#open-part:hover {
|
|
108
|
-
text-decoration: underline;
|
|
109
|
-
color: var(--uui-interface-contrast-hover,#1b264f);
|
|
110
|
-
}
|
|
111
|
-
`
|
|
112
|
-
];
|
|
113
|
-
__decorateClass([
|
|
114
|
-
property({ type: String })
|
|
115
|
-
], UUICardUserElement.prototype, "name", 2);
|
|
116
|
-
|
|
117
|
-
export { UUICardUserElement };
|