@justeattakeaway/pie-assistive-text
Advanced tools
Comparing version 0.0.0-snapshot-release-20240216130104 to 0.0.0-snapshot-release-20240226141240
@@ -59,13 +59,2 @@ { | ||
"attribute": "variant" | ||
}, | ||
{ | ||
"kind": "method", | ||
"name": "renderIcon", | ||
"privacy": "private", | ||
"return": { | ||
"type": { | ||
"text": "TemplateResult" | ||
} | ||
}, | ||
"description": "Renders the assistive-text icon content." | ||
} | ||
@@ -72,0 +61,0 @@ ], |
import type { CSSResult } from 'lit'; | ||
import type { LitElement } from 'lit'; | ||
import type { TemplateResult } from 'lit'; | ||
import type { TemplateResult } from 'lit-html'; | ||
@@ -18,7 +18,2 @@ export declare interface AssistiveTextProps { | ||
variant?: AssistiveTextProps['variant']; | ||
/** | ||
* Renders the assistive-text icon content. | ||
* @private | ||
*/ | ||
private renderIcon; | ||
render(): TemplateResult<1>; | ||
@@ -25,0 +20,0 @@ static styles: CSSResult; |
@@ -1,2 +0,2 @@ | ||
import { unsafeCSS as p, LitElement as f, html as i, nothing as l } from "lit"; | ||
import { unsafeCSS as p, LitElement as f, html as c, nothing as l } from "lit"; | ||
import { property as d } from "lit/decorators.js"; | ||
@@ -9,22 +9,12 @@ import { validPropertyValues as x, defineCustomElement as m } from "@justeattakeaway/pie-webc-core"; | ||
`, y = ["default", "error", "success"]; | ||
var g = Object.defineProperty, T = Object.getOwnPropertyDescriptor, b = (r, t, o, s) => { | ||
for (var e = s > 1 ? void 0 : s ? T(t, o) : t, a = r.length - 1, n; a >= 0; a--) | ||
(n = r[a]) && (e = (s ? n(t, o, e) : n(e)) || e); | ||
return s && e && g(t, o, e), e; | ||
var g = Object.defineProperty, T = Object.getOwnPropertyDescriptor, b = (i, t, r, s) => { | ||
for (var e = s > 1 ? void 0 : s ? T(t, r) : t, o = i.length - 1, a; o >= 0; o--) | ||
(a = i[o]) && (e = (s ? a(t, r, e) : a(e)) || e); | ||
return s && e && g(t, r, e), e; | ||
}; | ||
const v = "pie-assistive-text"; | ||
class c extends f { | ||
class n extends f { | ||
constructor() { | ||
super(...arguments), this.variant = "default"; | ||
} | ||
/** | ||
* Renders the assistive-text icon content. | ||
* @private | ||
*/ | ||
renderIcon() { | ||
const { variant: t } = this; | ||
return i` | ||
${t === "success" ? i`<icon-check-circle class="c-assistiveText-icon" size="s" />` : l} | ||
${t === "error" ? i`<icon-alert-circle class="c-assistiveText-icon" size="s" />` : l}`; | ||
} | ||
render() { | ||
@@ -34,3 +24,3 @@ const { | ||
} = this; | ||
return i` | ||
return c` | ||
<p | ||
@@ -40,16 +30,17 @@ class="c-assistiveText" | ||
variant=${u(t)}> | ||
${this.renderIcon()} | ||
<slot></slot> | ||
</p>`; | ||
${t === "success" ? c`<icon-check-circle class="c-assistiveText-icon" size="s"></icon-check-circle>` : l} | ||
${t === "error" ? c`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : l} | ||
<slot></slot> | ||
</p>`; | ||
} | ||
} | ||
c.styles = p(h); | ||
n.styles = p(h); | ||
b([ | ||
d({ type: String }), | ||
d(), | ||
x(v, y, "default") | ||
], c.prototype, "variant", 2); | ||
m(v, c); | ||
], n.prototype, "variant", 2); | ||
m(v, n); | ||
export { | ||
c as PieAssistiveText, | ||
n as PieAssistiveText, | ||
y as variants | ||
}; |
import type { CSSResult } from 'lit'; | ||
import type { LitElement } from 'lit'; | ||
import * as React_2 from 'react'; | ||
import type { TemplateResult } from 'lit'; | ||
import type { TemplateResult } from 'lit-html'; | ||
@@ -21,7 +21,2 @@ export declare interface AssistiveTextProps { | ||
variant?: AssistiveTextProps['variant']; | ||
/** | ||
* Renders the assistive-text icon content. | ||
* @private | ||
*/ | ||
private renderIcon; | ||
render(): TemplateResult<1>; | ||
@@ -28,0 +23,0 @@ static styles: CSSResult; |
{ | ||
"name": "@justeattakeaway/pie-assistive-text", | ||
"description": "PIE Design System Assistive Text built using Web Components", | ||
"version": "0.0.0-snapshot-release-20240216130104", | ||
"version": "0.0.0-snapshot-release-20240226141240", | ||
"type": "module", | ||
@@ -38,4 +38,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@justeattakeaway/pie-icons-webc": "0.17.3", | ||
"@justeattakeaway/pie-webc-core": "0.18.0" | ||
"@justeattakeaway/pie-icons-webc": "0.18.0", | ||
"@justeattakeaway/pie-webc-core": "0.19.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "volta": { |
import { | ||
LitElement, html, unsafeCSS, nothing, TemplateResult, | ||
LitElement, html, unsafeCSS, nothing, | ||
} from 'lit'; | ||
@@ -24,17 +24,6 @@ | ||
export class PieAssistiveText extends LitElement implements AssistiveTextProps { | ||
@property({ type: String }) | ||
@property() | ||
@validPropertyValues(componentSelector, variants, 'default') | ||
public variant?: AssistiveTextProps['variant'] = 'default'; | ||
/** | ||
* Renders the assistive-text icon content. | ||
* @private | ||
*/ | ||
private renderIcon (): TemplateResult { | ||
const { variant } = this; | ||
return html` | ||
${variant === 'success' ? html`<icon-check-circle class="c-assistiveText-icon" size="s" />` : nothing} | ||
${variant === 'error' ? html`<icon-alert-circle class="c-assistiveText-icon" size="s" />` : nothing}`; | ||
} | ||
render () { | ||
@@ -50,8 +39,8 @@ const { | ||
variant=${ifDefined(variant)}> | ||
${this.renderIcon()} | ||
<slot></slot> | ||
</p>`; | ||
${variant === 'success' ? html`<icon-check-circle class="c-assistiveText-icon" size="s"></icon-check-circle>` : nothing} | ||
${variant === 'error' ? html`<icon-alert-circle class="c-assistiveText-icon" size="s"></icon-alert-circle>` : nothing} | ||
<slot></slot> | ||
</p>`; | ||
} | ||
// Renders a `CSSResult` generated from SCSS by Vite | ||
static styles = unsafeCSS(styles); | ||
@@ -58,0 +47,0 @@ } |
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
15330
274
+ Added@justeattakeaway/pie-icons-webc@0.18.0(transitive)
+ Added@justeattakeaway/pie-webc-core@0.19.0(transitive)
- Removed@justeattakeaway/pie-icons-webc@0.17.3(transitive)
- Removed@justeattakeaway/pie-webc-core@0.18.0(transitive)