@justeattakeaway/pie-assistive-text
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -1,21 +0,19 @@ | ||
import { unsafeCSS as x, LitElement as u, html as r, nothing as d } from "lit"; | ||
import { property as p } from "lit/decorators.js"; | ||
import { validPropertyValues as y, defineCustomElement as h } from "@justeattakeaway/pie-webc-core"; | ||
import { classMap as m } from "lit/directives/class-map.js"; | ||
import { LitElement as x, html as r, nothing as p, unsafeCSS as y } from "lit"; | ||
import { property as v } from "lit/decorators.js"; | ||
import { validPropertyValues as h, defineCustomElement as m } from "@justeattakeaway/pie-webc-core"; | ||
import { classMap as g } from "lit/directives/class-map.js"; | ||
import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js"; | ||
import "@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js"; | ||
const g = `*,*:after,*:before{box-sizing:inherit}.c-assistiveText{--assistive-text-color: var(--dt-color-content-subdued);margin:0;padding-block-start:var(--dt-spacing-a);color:var(--assistive-text-color);font-family:var(--dt-font-body-s-family);font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px);gap:var(--dt-spacing-b);display:flex;align-items:flex-start;overflow-wrap:anywhere}.c-assistiveText .c-assistiveText-icon{display:inline-flex}.c-assistiveText--success{--assistive-text-color: var(--dt-color-content-positive)}.c-assistiveText--error{--assistive-text-color: var(--dt-color-content-error)}.c-assistiveText--isVisuallyHidden{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap} | ||
`, b = ["default", "error", "success"], l = { | ||
const b = "*,*:after,*:before{box-sizing:inherit}.c-assistiveText{--assistive-text-color: var(--dt-color-content-subdued);margin:0;padding-block-start:var(--dt-spacing-a);color:var(--assistive-text-color);font-family:var(--dt-font-body-s-family);font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px);gap:var(--dt-spacing-b);display:flex;align-items:flex-start;overflow-wrap:anywhere}.c-assistiveText .c-assistiveText-icon{display:inline-flex}.c-assistiveText--success{--assistive-text-color: var(--dt-color-content-positive)}.c-assistiveText--error{--assistive-text-color: var(--dt-color-content-error)}.c-assistiveText--isVisuallyHidden{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}", w = ["default", "error", "success"], o = { | ||
variant: "default", | ||
isVisuallyHidden: !1 | ||
}; | ||
var T = Object.defineProperty, w = Object.getOwnPropertyDescriptor, v = (o, s, i, e) => { | ||
for (var t = e > 1 ? void 0 : e ? w(s, i) : s, n = o.length - 1, c; n >= 0; n--) | ||
(c = o[n]) && (t = (e ? c(s, i, t) : c(t)) || t); | ||
return e && t && T(s, i, t), t; | ||
var T = Object.defineProperty, f = (c, t, i, l) => { | ||
for (var s = void 0, a = c.length - 1, d; a >= 0; a--) | ||
(d = c[a]) && (s = d(t, i, s) || s); | ||
return s && T(t, i, s), s; | ||
}; | ||
const f = "pie-assistive-text"; | ||
class a extends u { | ||
const u = "pie-assistive-text", n = class n extends x { | ||
constructor() { | ||
super(...arguments), this.variant = l.variant, this.isVisuallyHidden = l.isVisuallyHidden; | ||
super(...arguments), this.variant = o.variant, this.isVisuallyHidden = o.isVisuallyHidden; | ||
} | ||
@@ -27,19 +25,19 @@ /** | ||
renderIcon() { | ||
const { variant: s } = this; | ||
const { variant: t } = this; | ||
return r` | ||
${s === "success" ? r`<icon-check-circle class="c-assistiveText-icon" size="s" ></icon-check-circle>` : d} | ||
${s === "error" ? r`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : d}`; | ||
${t === "success" ? r`<icon-check-circle class="c-assistiveText-icon" size="s" ></icon-check-circle>` : p} | ||
${t === "error" ? r`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : p}`; | ||
} | ||
render() { | ||
const { | ||
variant: s, | ||
variant: t, | ||
isVisuallyHidden: i | ||
} = this, e = { | ||
} = this, l = { | ||
"c-assistiveText": !0, | ||
"c-assistiveText--isVisuallyHidden": i, | ||
[`c-assistiveText--${s}`]: !0 | ||
[`c-assistiveText--${t}`]: !0 | ||
}; | ||
return r` | ||
<p | ||
class="${m(e)}" | ||
class="${g(l)}" | ||
data-test-id="pie-assistive-text"> | ||
@@ -50,16 +48,17 @@ ${this.renderIcon()} | ||
} | ||
} | ||
a.styles = x(g); | ||
v([ | ||
p({ type: String }), | ||
y(f, b, l.variant) | ||
], a.prototype, "variant", 2); | ||
v([ | ||
p({ type: Boolean }) | ||
], a.prototype, "isVisuallyHidden", 2); | ||
h(f, a); | ||
}; | ||
n.styles = y(b); | ||
let e = n; | ||
f([ | ||
v({ type: String }), | ||
h(u, w, o.variant) | ||
], e.prototype, "variant"); | ||
f([ | ||
v({ type: Boolean }) | ||
], e.prototype, "isVisuallyHidden"); | ||
m(u, e); | ||
export { | ||
a as PieAssistiveText, | ||
l as defaultProps, | ||
b as variants | ||
e as PieAssistiveText, | ||
o as defaultProps, | ||
w as variants | ||
}; |
@@ -1,22 +0,16 @@ | ||
import * as t from "react"; | ||
import { createComponent as e } from "@lit/react"; | ||
import { PieAssistiveText as i } from "./index.js"; | ||
import { defaultProps as A, variants as T } from "./index.js"; | ||
import "lit"; | ||
import "lit/decorators.js"; | ||
import "@justeattakeaway/pie-webc-core"; | ||
import "lit/directives/class-map.js"; | ||
import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js"; | ||
import "@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js"; | ||
const s = e({ | ||
import * as e from "react"; | ||
import { createComponent as t } from "@lit/react"; | ||
import { PieAssistiveText as s } from "./index.js"; | ||
import { defaultProps as v, variants as x } from "./index.js"; | ||
const i = t({ | ||
displayName: "PieAssistiveText", | ||
elementClass: i, | ||
react: t, | ||
elementClass: s, | ||
react: e, | ||
tagName: "pie-assistive-text", | ||
events: {} | ||
}), c = s; | ||
}), r = i; | ||
export { | ||
c as PieAssistiveText, | ||
A as defaultProps, | ||
T as variants | ||
r as PieAssistiveText, | ||
v as defaultProps, | ||
x as variants | ||
}; |
{ | ||
"name": "@justeattakeaway/pie-assistive-text", | ||
"description": "PIE Design System Assistive Text built using Web Components", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"type": "module", | ||
@@ -40,8 +40,8 @@ "main": "dist/index.js", | ||
"@justeattakeaway/pie-components-config": "0.18.0", | ||
"@justeattakeaway/pie-css": "0.12.1", | ||
"@justeattakeaway/pie-css": "0.13.0", | ||
"cem-plugin-module-file-extensions": "0.0.5" | ||
}, | ||
"dependencies": { | ||
"@justeattakeaway/pie-icons-webc": "0.25.1", | ||
"@justeattakeaway/pie-webc-core": "0.24.0" | ||
"@justeattakeaway/pie-icons-webc": "0.25.2", | ||
"@justeattakeaway/pie-webc-core": "0.24.1" | ||
}, | ||
@@ -48,0 +48,0 @@ "volta": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17630
386
+ Added@justeattakeaway/pie-icons-webc@0.25.2(transitive)
+ Added@justeattakeaway/pie-webc-core@0.24.1(transitive)
+ Addedlit@3.2.0(transitive)
- Removed@justeattakeaway/pie-icons-webc@0.25.1(transitive)
- Removed@justeattakeaway/pie-webc-core@0.24.0(transitive)
- Removedlit@3.1.3(transitive)