@justeattakeaway/pie-button
Advanced tools
Comparing version 0.10.1 to 0.10.2
# Changelog | ||
## 0.10.2 | ||
### Patch Changes | ||
- [Added] Declare global statement back in. ([#393](https://github.com/justeattakeaway/pie/pull/393)) by [@kevinrodrigues](https://github.com/kevinrodrigues) | ||
## 0.10.1 | ||
@@ -7,3 +13,3 @@ | ||
- [Fixed] - Added module entry for component | ||
- [Fixed] - Added module entry for component ([#378](https://github.com/justeattakeaway/pie/pull/378)) by [@ashleynolan](https://github.com/ashleynolan) | ||
@@ -10,0 +16,0 @@ ## 0.10.0 |
import { unsafeCSS as f, LitElement as h, html as g } from "lit"; | ||
import { classMap as m } from "lit/directives/class-map.js"; | ||
import { property as u, customElement as v } from "lit/decorators.js"; | ||
import { property as b, customElement as v } from "lit/decorators.js"; | ||
const x = `.o-btn{border-radius:50rem;border:none;font-family:JetSansDigital;font-weight:700;cursor:pointer;user-select:none;outline:none}.o-btn:focus-visible{outline:2px solid #4996fd}.o-btn--xsmall{padding:6px 8px;min-height:32px;font-size:14px;line-height:20px}.o-btn--small{padding:8px 16px;min-height:40px;font-size:19px;line-height:28px}.o-btn--medium{padding:10px 24px;min-height:48px;font-size:20px;line-height:28px}.o-btn--large{padding:14px 24px;min-height:56px;font-size:20px;line-height:28px}.o-btn--primary{background-color:#f36805;color:#fff}.o-btn--primary:hover{background-color:#df5f05}.o-btn--primary:active{background-color:#b74e04}.o-btn--secondary{background-color:#f5f3f1;color:#242e30}.o-btn--secondary:hover{background-color:#ede9e5}.o-btn--secondary:active{background-color:#dcd4cd}.o-btn--outline{outline:1px solid #dbd9d7;background-color:#fff;color:#303d3f}.o-btn--outline:hover{background-color:#f5f5f5}.o-btn--outline:active{background-color:#e0e0e0}.o-btn--ghost{background-color:#fff;color:#242e30}.o-btn--ghost:hover{background-color:#f5f5f5}.o-btn--ghost:active{background-color:#e0e0e0}.o-btn.o-btn--is-disabled{background-color:#efedea;color:#8c999b;outline:1px solid #efedea;cursor:default}.o-btn.o-btn--is-disabled.o-btn--ghost{background-color:#fff;outline:none} | ||
`, p = (o, n) => function(i, t) { | ||
const e = `#${t}`; | ||
`, p = (e, n) => function(i, t) { | ||
const o = `#${t}`; | ||
Object.defineProperty(i, t, { | ||
get() { | ||
return this[e]; | ||
return this[o]; | ||
}, | ||
set(r) { | ||
const s = this[e]; | ||
o.includes(r) ? this[e] = r : (console.error( | ||
const s = this[o]; | ||
e.includes(r) ? this[o] = r : (console.error( | ||
`[pie-button] Invalid value "${r}" provided for property "${t}".`, | ||
`Must be one of: ${o.join(" | ")}.`, | ||
`Must be one of: ${e.join(" | ")}.`, | ||
`Falling back to default value: "${n}"` | ||
), this[e] = n), this.requestUpdate(t, s); | ||
), this[o] = n), this.requestUpdate(t, s); | ||
} | ||
}); | ||
}; | ||
var a = /* @__PURE__ */ ((o) => (o.XSMALL = "xsmall", o.SMALL = "small", o.MEDIUM = "medium", o.LARGE = "large", o))(a || {}), d = /* @__PURE__ */ ((o) => (o.SUBMIT = "submit", o.BUTTON = "button", o.RESET = "reset", o.MENU = "menu", o))(d || {}), b = /* @__PURE__ */ ((o) => (o.PRIMARY = "primary", o.SECONDARY = "secondary", o.OUTLINE = "outline", o.GHOST = "ghost", o))(b || {}), y = Object.defineProperty, M = Object.getOwnPropertyDescriptor, c = (o, n, i, t) => { | ||
for (var e = t > 1 ? void 0 : t ? M(n, i) : n, r = o.length - 1, s; r >= 0; r--) | ||
(s = o[r]) && (e = (t ? s(n, i, e) : s(e)) || e); | ||
return t && e && y(n, i, e), e; | ||
var a = /* @__PURE__ */ ((e) => (e.XSMALL = "xsmall", e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(a || {}), d = /* @__PURE__ */ ((e) => (e.SUBMIT = "submit", e.BUTTON = "button", e.RESET = "reset", e.MENU = "menu", e))(d || {}), u = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.OUTLINE = "outline", e.GHOST = "ghost", e))(u || {}), y = Object.defineProperty, M = Object.getOwnPropertyDescriptor, c = (e, n, i, t) => { | ||
for (var o = t > 1 ? void 0 : t ? M(n, i) : n, r = e.length - 1, s; r >= 0; r--) | ||
(s = e[r]) && (o = (t ? s(n, i, o) : s(o)) || o); | ||
return t && o && y(n, i, o), o; | ||
}; | ||
function k(o) { | ||
function k(e) { | ||
return (n) => { | ||
if (!customElements.get(o)) | ||
return v(o)(n); | ||
if (!customElements.get(e)) | ||
return v(e)(n); | ||
}; | ||
@@ -34,12 +34,12 @@ } | ||
constructor() { | ||
super(...arguments), this.size = a.MEDIUM, this.type = d.SUBMIT, this.variant = b.PRIMARY, this.disabled = !1; | ||
super(...arguments), this.size = a.MEDIUM, this.type = d.SUBMIT, this.variant = u.PRIMARY, this.disabled = !1; | ||
} | ||
render() { | ||
const { size: o, type: n, variant: i, disabled: t } = this, e = { | ||
const { size: e, type: n, variant: i, disabled: t } = this, o = { | ||
"o-btn": !0, | ||
[`o-btn--${o}`]: o, | ||
[`o-btn--${e}`]: e, | ||
[`o-btn--${i}`]: i, | ||
"o-btn--is-disabled": t | ||
}, r = () => { | ||
const s = new Event("CustomEvent"); | ||
const s = new CustomEvent("CustomEvent", { detail: "WC event dispatched" }); | ||
console.info("WC event dispatched"), this.dispatchEvent(s); | ||
@@ -49,3 +49,3 @@ }; | ||
<button | ||
class=${m(e)} | ||
class=${m(o)} | ||
type=${n} | ||
@@ -60,15 +60,15 @@ ?disabled=${t} | ||
c([ | ||
u(), | ||
b(), | ||
p(Object.values(a), a.MEDIUM) | ||
], l.prototype, "size", 2); | ||
c([ | ||
u(), | ||
b(), | ||
p(Object.values(d), d.SUBMIT) | ||
], l.prototype, "type", 2); | ||
c([ | ||
u(), | ||
p(Object.values(b), b.PRIMARY) | ||
b(), | ||
p(Object.values(u), u.PRIMARY) | ||
], l.prototype, "variant", 2); | ||
c([ | ||
u({ type: Boolean, reflect: !0 }) | ||
b({ type: Boolean, reflect: !0 }) | ||
], l.prototype, "disabled", 2); | ||
@@ -81,4 +81,4 @@ l = c([ | ||
d as BUTTON_TYPE, | ||
b as BUTTON_VARIANT, | ||
u as BUTTON_VARIANT, | ||
l as PieButton | ||
}; |
@@ -12,2 +12,7 @@ import { LitElement } from 'lit'; | ||
} | ||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'pie-button': PieButton; | ||
} | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@justeattakeaway/pie-button", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "PIE design system button built using web components", | ||
@@ -13,3 +13,7 @@ "type": "module", | ||
"dev": "run -T vite", | ||
"test": "echo \"Error: no test specified\" && exit 0" | ||
"test": "echo \"Error: no test specified\" && exit 0", | ||
"test:browsers": "npx playwright test -c ./playwright-lit.config.ts", | ||
"test:browsers:ci": "yarn test:browsers", | ||
"test:visual": "run -T cross-env-shell PERCY_TOKEN=${PERCY_TOKEN_PIE_BUTTON} percy exec --allowed-hostname cloudfront.net -- npx playwright test -c ./playwright-lit-visual.config.ts", | ||
"test:visual:ci": "yarn test:visual" | ||
}, | ||
@@ -16,0 +20,0 @@ "author": "JustEatTakeaway - Design System Web Team", |
@@ -49,3 +49,3 @@ import { LitElement, html, unsafeCSS } from 'lit'; | ||
const raiseWCEvent = () => { | ||
const event = new Event('CustomEvent') | ||
const event = new CustomEvent('CustomEvent', { detail: 'WC event dispatched' }) | ||
console.info('WC event dispatched') | ||
@@ -68,1 +68,7 @@ this.dispatchEvent(event) | ||
} | ||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'pie-button': PieButton; | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "ES2022", | ||
"lib": ["es2020", "DOM", "DOM.Iterable"], | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"outDir": "./compiled", | ||
"rootDir": "./src", | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"experimentalDecorators": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": ["src/**/*.ts","./declaration.d.ts"], | ||
"exclude": [] | ||
} | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "ES2022", | ||
"lib": ["es2020", "DOM", "DOM.Iterable"], | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"outDir": "./compiled", | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
}, | ||
"rootDir": ".", | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"experimentalDecorators": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": ["src/**/*.ts","./declaration.d.ts", "test/**/*.ts"], | ||
"exclude": [] | ||
} |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29775
27
500
0