@spectrum-web-components/asset
Advanced tools
Comparing version 0.7.0-devmode.0 to 0.7.0
{ | ||
"name": "@spectrum-web-components/asset", | ||
"version": "0.7.0-devmode.0+7b0ea531e", | ||
"version": "0.7.0", | ||
"publishConfig": { | ||
@@ -60,3 +60,3 @@ "access": "public" | ||
"dependencies": { | ||
"@spectrum-web-components/base": "^0.6.0", | ||
"@spectrum-web-components/base": "^0.7.0", | ||
"tslib": "^2.0.0" | ||
@@ -73,3 +73,3 @@ }, | ||
], | ||
"gitHead": "7b0ea531e9c7225c8964c5429bc5fd005618b80e" | ||
"gitHead": "05c81318844160db3f8156144106e643507fef97" | ||
} |
@@ -1,3 +0,2 @@ | ||
import { Asset } from "./src/Asset.js"; | ||
customElements.define("sp-asset", Asset); | ||
import{Asset as e}from"./src/Asset.js";customElements.define("sp-asset",e); | ||
//# sourceMappingURL=sp-asset.js.map |
@@ -1,3 +0,2 @@ | ||
import { css } from "@spectrum-web-components/base"; | ||
const styles = css` | ||
import{css as t}from"@spectrum-web-components/base";const r=t` | ||
:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var( | ||
@@ -16,4 +15,3 @@ --spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250) | ||
)} | ||
`; | ||
export default styles; | ||
`;export default r; | ||
//# sourceMappingURL=asset.css.js.map |
@@ -1,19 +0,2 @@ | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __decorateClass = (decorators, target, key, kind) => { | ||
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; | ||
for (var i = decorators.length - 1, decorator; i >= 0; i--) | ||
if (decorator = decorators[i]) | ||
result = (kind ? decorator(target, key, result) : decorator(result)) || result; | ||
if (kind && result) | ||
__defProp(target, key, result); | ||
return result; | ||
}; | ||
import { | ||
html, | ||
SpectrumElement | ||
} from "@spectrum-web-components/base"; | ||
import { property } from "@spectrum-web-components/base/src/decorators.js"; | ||
import styles from "./asset.css.js"; | ||
const file = (label) => html` | ||
var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var i=(e,t,c,r)=>{for(var l=r>1?void 0:r?d(t,c):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(l=(r?s(t,c,l):s(l))||l);return r&&l&&n(t,c,l),l};import{html as o,SpectrumElement as h}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import u from"./asset.css.js";const f=e=>o` | ||
<svg | ||
@@ -23,3 +6,3 @@ class="file" | ||
viewBox="0 0 128 128" | ||
aria-label=${label || "File"} | ||
aria-label=${e||"File"} | ||
> | ||
@@ -35,4 +18,3 @@ <path | ||
</svg> | ||
`; | ||
const folder = (label) => html` | ||
`,m=e=>o` | ||
<svg | ||
@@ -42,3 +24,3 @@ class="folder" | ||
viewBox="0 0 32 32" | ||
aria-label=${label || "Folder"} | ||
aria-label=${e||"Folder"} | ||
> | ||
@@ -54,28 +36,5 @@ <path | ||
</svg> | ||
`; | ||
export class Asset extends SpectrumElement { | ||
constructor() { | ||
super(...arguments); | ||
this.label = ""; | ||
} | ||
static get styles() { | ||
return [styles]; | ||
} | ||
render() { | ||
if (this.variant === "file") { | ||
return file(this.label); | ||
} else if (this.variant === "folder") { | ||
return folder(this.label); | ||
} | ||
return html` | ||
`;export class Asset extends h{constructor(){super(...arguments);this.label=""}static get styles(){return[u]}render(){return this.variant==="file"?f(this.label):this.variant==="folder"?m(this.label):o` | ||
<slot></slot> | ||
`; | ||
} | ||
} | ||
__decorateClass([ | ||
property({ type: String, reflect: true }) | ||
], Asset.prototype, "variant", 2); | ||
__decorateClass([ | ||
property() | ||
], Asset.prototype, "label", 2); | ||
`}}i([p({type:String,reflect:!0})],Asset.prototype,"variant",2),i([p()],Asset.prototype,"label",2); | ||
//# sourceMappingURL=Asset.js.map |
@@ -1,2 +0,2 @@ | ||
export * from "./Asset.js"; | ||
export*from"./Asset.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,2 @@ | ||
import { css } from "@spectrum-web-components/base"; | ||
const styles = css` | ||
import{css as t}from"@spectrum-web-components/base";const r=t` | ||
:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var( | ||
@@ -16,4 +15,3 @@ --spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250) | ||
)} | ||
`; | ||
export default styles; | ||
`;export default r; | ||
//# sourceMappingURL=spectrum-asset.css.js.map |
@@ -1,25 +0,10 @@ | ||
import { html } from "@spectrum-web-components/base"; | ||
import "@spectrum-web-components/asset/sp-asset.js"; | ||
import { portrait } from "../../card/stories/images"; | ||
export default { | ||
title: "Asset", | ||
component: "sp-asset" | ||
}; | ||
export const Default = () => { | ||
return html` | ||
import{html as t}from"@spectrum-web-components/base";import"@spectrum-web-components/asset/sp-asset.js";import{portrait as e}from"../../card/stories/images";export default{title:"Asset",component:"sp-asset"};export const Default=()=>t` | ||
<sp-asset style="height: 128px"> | ||
<img src=${portrait} alt="Demo Graphic" /> | ||
<img src=${e} alt="Demo Graphic" /> | ||
</sp-asset> | ||
`; | ||
}; | ||
export const File = () => { | ||
return html` | ||
`,File=()=>t` | ||
<sp-asset variant="file"></sp-asset> | ||
`; | ||
}; | ||
export const Folder = () => { | ||
return html` | ||
`,Folder=()=>t` | ||
<sp-asset variant="folder"></sp-asset> | ||
`; | ||
}; | ||
//# sourceMappingURL=asset.stories.js.map |
@@ -1,4 +0,2 @@ | ||
import * as stories from "../stories/asset.stories.js"; | ||
import { regressVisuals } from "../../../test/visual/test.js"; | ||
regressVisuals("AssetStories", stories); | ||
import*as s from"../stories/asset.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("AssetStories",s); | ||
//# sourceMappingURL=asset.test-vrt.js.map |
@@ -1,22 +0,2 @@ | ||
import { elementUpdated, expect, fixture } from "@open-wc/testing"; | ||
import { testForLitDevWarnings } from "../../../test/testing-helpers"; | ||
import { Default, File, Folder } from "../stories/asset.stories.js"; | ||
describe("Asset", () => { | ||
testForLitDevWarnings(async () => await fixture(Default())); | ||
it("loads default asset accessibly", async () => { | ||
const el = await fixture(Default()); | ||
await elementUpdated(el); | ||
await expect(el).to.be.accessible(); | ||
}); | ||
it('loads [variant="file"] accessibly', async () => { | ||
const el = await fixture(File()); | ||
await elementUpdated(el); | ||
await expect(el).to.be.accessible(); | ||
}); | ||
it('loads [variant="folder"] accessibly', async () => { | ||
const el = await fixture(Folder()); | ||
await elementUpdated(el); | ||
await expect(el).to.be.accessible(); | ||
}); | ||
}); | ||
import{elementUpdated as e,expect as s,fixture as t}from"@open-wc/testing";import{testForLitDevWarnings as c}from"../../../test/testing-helpers";import{Default as i,File as o,Folder as l}from"../stories/asset.stories.js";describe("Asset",()=>{c(async()=>await t(i())),it("loads default asset accessibly",async()=>{const a=await t(i());await e(a),await s(a).to.be.accessible()}),it('loads [variant="file"] accessibly',async()=>{const a=await t(o());await e(a),await s(a).to.be.accessible()}),it('loads [variant="folder"] accessibly',async()=>{const a=await t(l());await e(a),await s(a).to.be.accessible()})}); | ||
//# sourceMappingURL=asset.test.js.map |
@@ -1,7 +0,4 @@ | ||
import "@spectrum-web-components/asset/sp-asset.js"; | ||
import { html } from "lit"; | ||
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js"; | ||
measureFixtureCreation(html` | ||
import"@spectrum-web-components/asset/sp-asset.js";import{html as r}from"lit";import{measureFixtureCreation as t}from"../../../../test/benchmark/helpers.js";t(r` | ||
<sp-asset open></sp-asset> | ||
`); | ||
//# sourceMappingURL=basic-test.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
54824
381
+ Added@spectrum-web-components/base@0.7.5(transitive)
- Removed@spectrum-web-components/base@0.6.0(transitive)