@justeattakeaway/pie-card 0.22.0 → 0.23.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/dist/index.js +60 -60
- package/package.json +9 -6
- package/src/card.scss +13 -35
- package/src/index.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { LitElement as
|
|
1
|
+
import { LitElement as y, html as p, nothing as b, unsafeCSS as S } from "lit";
|
|
2
2
|
import { classMap as h } from "lit/directives/class-map.js";
|
|
3
|
-
import { ifDefined as
|
|
4
|
-
import { property as d, queryAssignedElements as
|
|
5
|
-
import { validPropertyValues as u, defineCustomElement as
|
|
6
|
-
const
|
|
3
|
+
import { ifDefined as f } from "lit/directives/if-defined.js";
|
|
4
|
+
import { property as d, queryAssignedElements as $ } from "lit/decorators.js";
|
|
5
|
+
import { validPropertyValues as u, defineCustomElement as k } from "@justeattakeaway/pie-webc-core";
|
|
6
|
+
const C = ".c-card.c-card--draggable{cursor:grab}.c-card.c-card--draggable:active{cursor:grabbing}*,*:after,*:before{box-sizing:inherit}.c-card{--int-states-mixin-bg-color: var(--dt-color-container-default);--card-color: var(--dt-color-content-default);--card-radius: var(--dt-radius-rounded-c);--card-border-color: transparent;display:block;position:relative;color:var(--card-color);background-color:var(--int-states-mixin-bg-color);border:1px solid var(--card-border-color);border-radius:var(--card-radius);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;text-decoration:none}.c-card.is-disabled{--int-states-mixin-bg-color: var(--dt-color-disabled-01);cursor:not-allowed}.c-card.is-disabled ::slotted(*){color:var(--dt-color-content-disabled)}.c-card.is-disabled img{opacity:.5}.c-card.c-card--default{box-shadow:var(--dt-elevation-card)}.c-card.c-card--default:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + var(--hover-modifier)))}.c-card.c-card--default:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--default.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-card.c-card--default:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-container-default))}.c-card.c-card--default:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--default.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-container-default))}}.c-card.c-card--outline{border-color:var(--dt-color-border-strong)}.c-card.c-card--outline:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + var(--hover-modifier)))}.c-card.c-card--outline:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--outline.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-card.c-card--outline:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-container-default))}.c-card.c-card--outline:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--outline.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-container-default))}}.c-card.c-card--inverse{--int-states-mixin-bg-color: var(--dt-color-container-inverse);--card-color: var(--dt-color-content-inverse);box-shadow:var(--dt-elevation-inverse-card)}.c-card.c-card--inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-container-inverse-h), var(--dt-color-container-inverse-s), calc(var(--dt-color-container-inverse-l) + var(--hover-modifier)))}.c-card.c-card--inverse:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--inverse.is-loading:not(:disabled,.is-disabled){--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-container-inverse-h), var(--dt-color-container-inverse-s), calc(var(--dt-color-container-inverse-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-card.c-card--inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-container-inverse))}.c-card.c-card--inverse:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--inverse.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-container-inverse))}}.c-card.c-card--outline-inverse{--int-states-mixin-bg-color: var(--dt-color-container-inverse);--card-color: var(--dt-color-content-inverse);border-color:var(--dt-color-border-inverse)}.c-card.c-card--outline-inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-container-inverse-h), var(--dt-color-container-inverse-s), calc(var(--dt-color-container-inverse-l) + var(--hover-modifier)))}.c-card.c-card--outline-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--outline-inverse.is-loading:not(:disabled,.is-disabled){--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-container-inverse-h), var(--dt-color-container-inverse-s), calc(var(--dt-color-container-inverse-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-card.c-card--outline-inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-container-inverse))}.c-card.c-card--outline-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.c-card.c-card--outline-inverse.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-container-inverse))}}.c-card.c-card--inverse.is-disabled,.c-card.c-card--outline-inverse.is-disabled{--int-states-mixin-bg-color: var(--dt-color-disabled-01-inverse)}.c-card:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}", w = ["default", "outline", "inverse", "outline-inverse"], E = ["a", "button"], x = ["a", "b", "c", "d", "e", "f", "g"], O = x.flatMap((v) => [v, ...x.map((r) => `${v},${r}`)]), n = {
|
|
7
7
|
disabled: !1,
|
|
8
8
|
variant: "default",
|
|
9
9
|
isDraggable: !1,
|
|
10
10
|
tag: "button"
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
for (var
|
|
14
|
-
(
|
|
15
|
-
return
|
|
12
|
+
var D = Object.defineProperty, t = (v, r, e, a) => {
|
|
13
|
+
for (var i = void 0, c = v.length - 1, s; c >= 0; c--)
|
|
14
|
+
(s = v[c]) && (i = s(r, e, i) || i);
|
|
15
|
+
return i && D(r, e, i), i;
|
|
16
16
|
};
|
|
17
|
-
const
|
|
17
|
+
const g = "pie-card", m = class m extends y {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(...arguments), this.tag =
|
|
19
|
+
super(...arguments), this.tag = n.tag, this.variant = n.variant, this.disabled = n.disabled, this.isDraggable = n.isDraggable;
|
|
20
20
|
}
|
|
21
21
|
onClickHandler(r) {
|
|
22
22
|
this.disabled && (r.preventDefault(), r.stopPropagation());
|
|
@@ -28,23 +28,23 @@ const p = "pie-card", f = class f extends S {
|
|
|
28
28
|
*/
|
|
29
29
|
renderAnchor(r) {
|
|
30
30
|
const e = this.generatePaddingCSS(), {
|
|
31
|
-
href:
|
|
32
|
-
rel:
|
|
33
|
-
target:
|
|
34
|
-
disabled:
|
|
35
|
-
aria:
|
|
31
|
+
href: a,
|
|
32
|
+
rel: i,
|
|
33
|
+
target: c,
|
|
34
|
+
disabled: s,
|
|
35
|
+
aria: l
|
|
36
36
|
} = this;
|
|
37
|
-
return
|
|
37
|
+
return p`
|
|
38
38
|
<a
|
|
39
39
|
class="${h(r)}"
|
|
40
|
-
data-test-id="pie-card"
|
|
41
|
-
href=${
|
|
42
|
-
target=${
|
|
43
|
-
rel=${
|
|
40
|
+
data-test-id="pie-card-link"
|
|
41
|
+
href=${f(a && !s ? a : void 0)}
|
|
42
|
+
target=${c || b}
|
|
43
|
+
rel=${i || b}
|
|
44
44
|
role="link"
|
|
45
|
-
aria-label=${(
|
|
46
|
-
aria-disabled=${
|
|
47
|
-
style=${
|
|
45
|
+
aria-label=${(l == null ? void 0 : l.label) || b}
|
|
46
|
+
aria-disabled=${s ? "true" : "false"}
|
|
47
|
+
style=${f(e)}>
|
|
48
48
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
49
49
|
</a>`;
|
|
50
50
|
}
|
|
@@ -63,8 +63,8 @@ const p = "pie-card", f = class f extends S {
|
|
|
63
63
|
let e = "";
|
|
64
64
|
if (!r)
|
|
65
65
|
return "";
|
|
66
|
-
const
|
|
67
|
-
return
|
|
66
|
+
const a = r.split(",").map((i) => i.trim()).filter((i) => /^[a-g]$/.test(i));
|
|
67
|
+
return a.length > 0 && a.length <= 2 && (e += `var(--dt-spacing-${a[0]})`, a.length > 1 && (e += ` var(--dt-spacing-${a[1]})`)), e ? `padding: ${e}` : "";
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Handles the slot change event and applies/removes opacity to images based on the `disabled` state.
|
|
@@ -81,8 +81,8 @@ const p = "pie-card", f = class f extends S {
|
|
|
81
81
|
*/
|
|
82
82
|
updateImagesOpacity() {
|
|
83
83
|
this.assignedElements && this.assignedElements.forEach((e) => {
|
|
84
|
-
const
|
|
85
|
-
this.applyOpacityToImages(
|
|
84
|
+
const a = e.querySelectorAll("img");
|
|
85
|
+
this.applyOpacityToImages(a);
|
|
86
86
|
});
|
|
87
87
|
const r = this.querySelectorAll("img");
|
|
88
88
|
this.applyOpacityToImages(r);
|
|
@@ -110,70 +110,70 @@ const p = "pie-card", f = class f extends S {
|
|
|
110
110
|
const {
|
|
111
111
|
variant: r,
|
|
112
112
|
disabled: e,
|
|
113
|
-
tag:
|
|
114
|
-
aria:
|
|
115
|
-
isDraggable:
|
|
116
|
-
} = this,
|
|
113
|
+
tag: a,
|
|
114
|
+
aria: i,
|
|
115
|
+
isDraggable: c
|
|
116
|
+
} = this, s = this.generatePaddingCSS(), l = {
|
|
117
117
|
"c-card": !0,
|
|
118
118
|
[`c-card--${r}`]: !0,
|
|
119
|
-
"c-card--draggable":
|
|
120
|
-
"
|
|
119
|
+
"c-card--draggable": c,
|
|
120
|
+
"is-disabled": e
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return a === "a" ? this.renderAnchor(l) : p`
|
|
123
123
|
<div
|
|
124
|
-
class="${h(
|
|
125
|
-
data-test-id="pie-card"
|
|
124
|
+
class="${h(l)}"
|
|
125
|
+
data-test-id="pie-card-button"
|
|
126
126
|
role="button"
|
|
127
127
|
tabindex=${e ? "-1" : "0"}
|
|
128
|
-
aria-label=${(
|
|
128
|
+
aria-label=${(i == null ? void 0 : i.label) || b}
|
|
129
129
|
aria-disabled=${e ? "true" : "false"}
|
|
130
|
-
style=${
|
|
130
|
+
style=${s || ""}
|
|
131
131
|
@click=${this.onClickHandler}>
|
|
132
132
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
133
133
|
</div>
|
|
134
134
|
</div>`;
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
let o =
|
|
139
|
-
|
|
137
|
+
m.styles = S(C);
|
|
138
|
+
let o = m;
|
|
139
|
+
t([
|
|
140
140
|
d({ type: String }),
|
|
141
|
-
u(
|
|
141
|
+
u(g, E, n.tag)
|
|
142
142
|
], o.prototype, "tag");
|
|
143
|
-
|
|
143
|
+
t([
|
|
144
144
|
d({ type: String }),
|
|
145
|
-
u(
|
|
145
|
+
u(g, w, n.variant)
|
|
146
146
|
], o.prototype, "variant");
|
|
147
|
-
|
|
147
|
+
t([
|
|
148
148
|
d({ type: String, reflect: !0 })
|
|
149
149
|
], o.prototype, "href");
|
|
150
|
-
|
|
150
|
+
t([
|
|
151
151
|
d({ type: String, reflect: !0 })
|
|
152
152
|
], o.prototype, "target");
|
|
153
|
-
|
|
153
|
+
t([
|
|
154
154
|
d({ type: String, reflect: !0 })
|
|
155
155
|
], o.prototype, "rel");
|
|
156
|
-
|
|
156
|
+
t([
|
|
157
157
|
d({ type: Boolean })
|
|
158
158
|
], o.prototype, "disabled");
|
|
159
|
-
|
|
159
|
+
t([
|
|
160
160
|
d({ type: Object })
|
|
161
161
|
], o.prototype, "aria");
|
|
162
|
-
|
|
162
|
+
t([
|
|
163
163
|
d({ type: Boolean })
|
|
164
164
|
], o.prototype, "isDraggable");
|
|
165
|
-
|
|
165
|
+
t([
|
|
166
166
|
d({ type: String }),
|
|
167
|
-
u(
|
|
167
|
+
u(g, O, void 0)
|
|
168
168
|
], o.prototype, "padding");
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
t([
|
|
170
|
+
$({ flatten: !0 })
|
|
171
171
|
], o.prototype, "assignedElements");
|
|
172
|
-
|
|
172
|
+
k(g, o);
|
|
173
173
|
export {
|
|
174
174
|
o as PieCard,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
n as defaultProps,
|
|
176
|
+
O as paddingValues,
|
|
177
|
+
E as tags,
|
|
178
|
+
w as variants
|
|
179
179
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-card",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"description": "PIE Design System Card built using Web Components",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/justeattakeaway/pie",
|
|
8
|
+
"directory": "packages/components/pie-card"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://pie.design/components/card/code/",
|
|
5
11
|
"type": "module",
|
|
6
12
|
"main": "dist/index.js",
|
|
7
13
|
"module": "dist/index.js",
|
|
@@ -24,9 +30,6 @@
|
|
|
24
30
|
"lint:style": "run -T stylelint ./src/**/*.{css,scss}",
|
|
25
31
|
"lint:style:fix": "yarn lint:style --fix",
|
|
26
32
|
"watch": "run -T vite build --watch",
|
|
27
|
-
"test": "echo \"Error: no test specified\" && exit 0",
|
|
28
|
-
"test:ci": "yarn test",
|
|
29
|
-
"test:browsers-setup": "npx playwright-lit-setup",
|
|
30
33
|
"test:browsers": "npx playwright test -c ./playwright-lit.config.ts",
|
|
31
34
|
"test:browsers:ci": "yarn test:browsers",
|
|
32
35
|
"test:visual": "run -T cross-env-shell PERCY_TOKEN=${PERCY_TOKEN_PIE_CARD} percy exec --allowed-hostname cloudfront.net -- npx playwright test -c ./playwright-lit-visual.config.ts",
|
|
@@ -37,8 +40,8 @@
|
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
42
|
"@justeattakeaway/pie-components-config": "0.18.0",
|
|
40
|
-
"@justeattakeaway/pie-css": "0.
|
|
41
|
-
"@justeattakeaway/pie-wrapper-react": "0.14.
|
|
43
|
+
"@justeattakeaway/pie-css": "0.15.1",
|
|
44
|
+
"@justeattakeaway/pie-wrapper-react": "0.14.3",
|
|
42
45
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
43
46
|
},
|
|
44
47
|
"dependencies": {
|
package/src/card.scss
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
@use '@justeattakeaway/pie-css/scss' as p;
|
|
2
2
|
|
|
3
|
-
@mixin card-interactive-states($bg-color, $mode: 'default') {
|
|
4
|
-
&:hover:not(.c-card--disabled) {
|
|
5
|
-
@if $mode == 'inverse' {
|
|
6
|
-
--hover-modifier: var(--dt-color-hover-01);
|
|
7
|
-
} @else {
|
|
8
|
-
--hover-modifier: calc(-1 * var(--dt-color-hover-01));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
--card-bg-color: hsl(var(#{$bg-color}-h), var(#{$bg-color}-s), calc(var(#{$bg-color}-l) + var(--hover-modifier)));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&:active:not(.c-card--disabled) {
|
|
15
|
-
@if $mode == 'inverse' {
|
|
16
|
-
--active-modifier: var(--dt-color-active-01);
|
|
17
|
-
} @else {
|
|
18
|
-
--active-modifier: calc(-1 * var(--dt-color-active-01));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
--card-bg-color: hsl(var(#{$bg-color}-h), var(#{$bg-color}-s), calc(var(#{$bg-color}-l) + var(--active-modifier)));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
3
|
.c-card {
|
|
26
|
-
--
|
|
4
|
+
--int-states-mixin-bg-color: var(--dt-color-container-default);
|
|
27
5
|
--card-color: var(--dt-color-content-default);
|
|
28
6
|
--card-radius: var(--dt-radius-rounded-c);
|
|
29
7
|
--card-border-color: transparent;
|
|
@@ -31,7 +9,7 @@
|
|
|
31
9
|
display: block;
|
|
32
10
|
position: relative;
|
|
33
11
|
color: var(--card-color);
|
|
34
|
-
background-color: var(--
|
|
12
|
+
background-color: var(--int-states-mixin-bg-color);
|
|
35
13
|
border: 1px solid var(--card-border-color);
|
|
36
14
|
border-radius: var(--card-radius);
|
|
37
15
|
cursor: pointer;
|
|
@@ -39,8 +17,8 @@
|
|
|
39
17
|
outline: none;
|
|
40
18
|
text-decoration: none;
|
|
41
19
|
|
|
42
|
-
&.
|
|
43
|
-
--
|
|
20
|
+
&.is-disabled {
|
|
21
|
+
--int-states-mixin-bg-color: var(--dt-color-disabled-01);
|
|
44
22
|
|
|
45
23
|
cursor: not-allowed;
|
|
46
24
|
|
|
@@ -56,36 +34,36 @@
|
|
|
56
34
|
&.c-card--default {
|
|
57
35
|
box-shadow: var(--dt-elevation-card);
|
|
58
36
|
|
|
59
|
-
@include
|
|
37
|
+
@include p.interactive-states('--dt-color-container-default');
|
|
60
38
|
}
|
|
61
39
|
|
|
62
40
|
&.c-card--outline {
|
|
63
41
|
border-color: var(--dt-color-border-strong);
|
|
64
42
|
|
|
65
|
-
@include
|
|
43
|
+
@include p.interactive-states('--dt-color-container-default');
|
|
66
44
|
}
|
|
67
45
|
|
|
68
46
|
&.c-card--inverse {
|
|
69
|
-
--
|
|
47
|
+
--int-states-mixin-bg-color: var(--dt-color-container-inverse);
|
|
70
48
|
--card-color: var(--dt-color-content-inverse);
|
|
71
49
|
|
|
72
50
|
box-shadow: var(--dt-elevation-inverse-card);
|
|
73
51
|
|
|
74
|
-
@include
|
|
52
|
+
@include p.interactive-states('--dt-color-container-inverse', 'inverse', '02');
|
|
75
53
|
}
|
|
76
54
|
|
|
77
55
|
&.c-card--outline-inverse {
|
|
78
|
-
--
|
|
56
|
+
--int-states-mixin-bg-color: var(--dt-color-container-inverse);
|
|
79
57
|
--card-color: var(--dt-color-content-inverse);
|
|
80
58
|
|
|
81
59
|
border-color: var(--dt-color-border-inverse);
|
|
82
60
|
|
|
83
|
-
@include
|
|
61
|
+
@include p.interactive-states('--dt-color-container-inverse', 'inverse', '02');
|
|
84
62
|
}
|
|
85
63
|
|
|
86
|
-
&.c-card--inverse.
|
|
87
|
-
&.c-card--outline-inverse.
|
|
88
|
-
--
|
|
64
|
+
&.c-card--inverse.is-disabled,
|
|
65
|
+
&.c-card--outline-inverse.is-disabled {
|
|
66
|
+
--int-states-mixin-bg-color: var(--dt-color-disabled-01-inverse);
|
|
89
67
|
}
|
|
90
68
|
|
|
91
69
|
&.c-card--draggable {
|
package/src/index.ts
CHANGED
|
@@ -78,7 +78,7 @@ export class PieCard extends LitElement implements CardProps {
|
|
|
78
78
|
return html`
|
|
79
79
|
<a
|
|
80
80
|
class="${classMap(classes)}"
|
|
81
|
-
data-test-id="pie-card"
|
|
81
|
+
data-test-id="pie-card-link"
|
|
82
82
|
href=${ifDefined(href && !disabled ? href : undefined)}
|
|
83
83
|
target=${target || nothing}
|
|
84
84
|
rel=${rel || nothing}
|
|
@@ -195,7 +195,7 @@ export class PieCard extends LitElement implements CardProps {
|
|
|
195
195
|
'c-card': true,
|
|
196
196
|
[`c-card--${variant}`]: true,
|
|
197
197
|
'c-card--draggable': isDraggable,
|
|
198
|
-
'
|
|
198
|
+
'is-disabled': disabled,
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
if (tag === 'a') return this.renderAnchor(classes);
|
|
@@ -203,7 +203,7 @@ export class PieCard extends LitElement implements CardProps {
|
|
|
203
203
|
return html`
|
|
204
204
|
<div
|
|
205
205
|
class="${classMap(classes)}"
|
|
206
|
-
data-test-id="pie-card"
|
|
206
|
+
data-test-id="pie-card-button"
|
|
207
207
|
role="button"
|
|
208
208
|
tabindex=${disabled ? '-1' : '0'}
|
|
209
209
|
aria-label=${aria?.label || nothing}
|