@spectrum-web-components/iconset 1.1.0-beta.1 → 1.1.0-beta.11

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/iconset",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.1.0-beta.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -60,7 +60,7 @@
60
60
  "lit-html"
61
61
  ],
62
62
  "dependencies": {
63
- "@spectrum-web-components/base": "^1.1.0-beta.1"
63
+ "@spectrum-web-components/base": "^1.1.0-beta.11"
64
64
  },
65
65
  "types": "./src/index.d.ts",
66
66
  "customElements": "custom-elements.json",
@@ -71,5 +71,5 @@
71
71
  "./stories/iconsList.json",
72
72
  "./**/*.dev.js"
73
73
  ],
74
- "gitHead": "3a50fd95f2aa2e05d05ae3e5307dfac05b19aba1"
74
+ "gitHead": "9c66809834e40bb767fcb7b6e9ce156f4a3ad93d"
75
75
  }
@@ -194,10 +194,12 @@ export let IconsDemo = class extends SpectrumElement {
194
194
  (icon) => icon.name.toLowerCase().includes(this.search.toLowerCase())
195
195
  ) : this.icons;
196
196
  const iconVersion = this.spectrumVersion === 2 ? "s2" : "s1";
197
- matchingIcons = matchingIcons.filter((icon) => {
198
- const iconName = icon.name.replace(/\s/g, "").toLowerCase();
199
- return iconsList[iconVersion].includes(iconName);
200
- });
197
+ if (this.name === "workflow") {
198
+ matchingIcons = matchingIcons.filter((icon) => {
199
+ const iconName = icon.name.replace(/\s/g, "").toLowerCase();
200
+ return iconsList[iconVersion].includes(iconName);
201
+ });
202
+ }
201
203
  return html`
202
204
  <div class="search" part="search">
203
205
  <sp-field-label for="search">Spectrum icons:</sp-field-label>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["icons-demo.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { IconsetAddedDetail } from '@spectrum-web-components/iconset';\nimport {\n css,\n CSSResultGroup,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n customElement,\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { Search } from '@spectrum-web-components/search';\nimport '@spectrum-web-components/search/sp-search.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport bodyStyles from '@spectrum-web-components/styles/body.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nimport iconsList from './iconsList.json' assert { type: 'json' };\n\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport type { SystemVariant } from '@spectrum-web-components/theme';\n\n@customElement('delayed-ready')\nexport class DelayedReady extends SpectrumElement {\n _delayedReady!: Promise<void>;\n _resolveDelayedReady!: () => void;\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.handleSlotchange}></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this._delayedReady = new Promise(\n (res) => (this._resolveDelayedReady = res)\n );\n }\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this._delayedReady;\n return complete;\n }\n\n public handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (target.assignedElements({ flatten: true }).length) {\n requestAnimationFrame(() => {\n this._resolveDelayedReady();\n });\n }\n }\n}\n\n@customElement('icons-demo')\nexport class IconsDemo extends SpectrumElement {\n @property()\n public name = 'ui';\n\n @property()\n public package = '';\n\n @property()\n public size = 'm';\n\n @property()\n public search = '';\n\n @property({ attribute: false })\n public icons: {\n name: string;\n story(size: string): TemplateResult;\n tag: string;\n }[] = [];\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n private iconset: string[] = [];\n public constructor() {\n super();\n this.iconset = [];\n this.handleIconSetAdded = this.handleIconSetAdded.bind(this);\n }\n\n public override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.requestSystemContext();\n window.addEventListener('sp-iconset-added', this.handleIconSetAdded);\n }\n public override disconnectedCallback(): void {\n window.removeEventListener('sp-iconset-added', this.handleIconSetAdded);\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private requestSystemContext(): void {\n this.dispatchEvent(\n new CustomEvent('sp-system-context', {\n detail: {\n callback: (\n system: SystemVariant,\n unsubscribe: () => void\n ) => {\n this.spectrumVersion =\n system === 'spectrum-two' ? 2 : 1;\n this.unsubscribeSystemContext = unsubscribe;\n },\n },\n bubbles: true,\n composed: true,\n })\n );\n }\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n public handleIconSetAdded(event: CustomEvent<IconsetAddedDetail>): void {\n const { iconset } = event.detail;\n this.iconset = iconset.getIconList();\n this.requestUpdate();\n }\n public static override get styles(): CSSResultGroup {\n return [\n ...bodyStyles,\n css`\n :host {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 20px;\n align-items: flex-start;\n }\n .icon {\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n border-radius: var(\n --spectrum-alias-focus-ring-gap,\n var(--spectrum-global-dimension-static-size-25)\n );\n }\n :host([package]) .icon {\n cursor: pointer;\n }\n sp-icon {\n margin-bottom: 10px;\n }\n .search {\n grid-column-start: 1;\n grid-column-end: -1;\n }\n .icon[tabindex]:focus {\n outline: none;\n }\n .icon[tabindex]:focus-visible {\n outline: var(--spectrum-alias-focus-ring-size) solid\n var(--spectrum-alias-focus-ring-color);\n outline-offset: calc(\n var(\n --spectrum-alias-focus-ring-gap,\n var(--spectrum-global-dimension-static-size-25)\n ) * 2\n );\n }\n `,\n ];\n }\n private handleKeydown(event: KeyboardEvent, tag: string): void {\n const { code } = event;\n if (code !== 'Enter' && code !== 'NumpadEnter' && code !== 'Space') {\n return;\n }\n event.preventDefault();\n this.shouldCopy(tag);\n }\n\n private shouldCopy(tag: string): void {\n if (!this.package) return;\n const conditionedTag = tag.slice(1, tag.length - 1);\n const importURL = `import '@spectrum-web-components/${this.package}/icons/${conditionedTag}.js';`;\n this.dispatchEvent(\n new CustomEvent('copy-text', {\n bubbles: true,\n composed: true,\n detail: {\n message: 'Import statement copied to clipboard!',\n text: importURL,\n },\n })\n );\n }\n private updateSearch(event: Event & { target: Search }): void {\n event.stopPropagation();\n this.search = event.target.value;\n }\n private submit(event: Event & { target: Search }): void {\n event.stopPropagation();\n this.updateSearch(event);\n }\n private renderSearch(): TemplateResult {\n let matchingIcons = this.search\n ? this.icons.filter((icon) =>\n icon.name.toLowerCase().includes(this.search.toLowerCase())\n )\n : this.icons;\n\n const iconVersion = this.spectrumVersion === 2 ? 's2' : 's1';\n // Filter out icons that are not in the current version\n matchingIcons = matchingIcons.filter((icon) => {\n const iconName = icon.name.replace(/\\s/g, '').toLowerCase();\n return iconsList[iconVersion].includes(iconName);\n });\n\n return html`\n <div class=\"search\" part=\"search\">\n <sp-field-label for=\"search\">Spectrum icons:</sp-field-label>\n <sp-search\n id=\"search\"\n @keydown=${this.updateSearch}\n @input=${this.updateSearch}\n @submit=${this.submit}\n .value=${this.search}\n label=\"Search for icons\"\n autocomplete=\"off\"\n >\n <sp-help-text slot=\"help-text\">\n Showing ${matchingIcons.length} of ${this.icons.length}\n available icons.\n </sp-help-text>\n </sp-search>\n </div>\n ${matchingIcons.map((icon) => {\n return html`\n <bdo\n class=\"icon\"\n part=\"icon\"\n dir=\"ltr\"\n class=\"icon\"\n @click=${() => this.shouldCopy(icon.tag)}\n @keydown=${(event: KeyboardEvent) =>\n this.handleKeydown(event, icon.tag)}\n tabindex=${ifDefined(this.package ? '0' : undefined)}\n >\n ${icon.story(this.size)} ${icon.tag}\n </bdo>\n `;\n })}\n `;\n }\n protected override render(): TemplateResult {\n return html`\n ${this.icons.length\n ? this.renderSearch()\n : html`\n <slot></slot>\n `}\n ${this.iconset.map(\n (icon) => html`\n <bdo class=\"icon\" dir=\"ltr\">\n <sp-icon\n size=\"xl\"\n name=${`${this.name}:${icon}`}\n ></sp-icon>\n ${icon}\n </bdo>\n `\n )}\n `;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EACI;AAAA,EAEA;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO,gBAAgB;AACvB,OAAO;AACP,OAAO;AAEP,OAAO,eAAe;AAEtB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAKA,WAAM,eAAN,cAA2B,gBAAgB;AAAA,EAI3B,SAAyB;AACxC,WAAO;AAAA,gCACiB,KAAK,gBAAgB;AAAA;AAAA,EAEjD;AAAA,EAEmB,eAAqB;AACpC,SAAK,gBAAgB,IAAI;AAAA,MACrB,CAAC,QAAS,KAAK,uBAAuB;AAAA,IAC1C;AAAA,EACJ;AAAA,EAEA,MAAyB,oBAAsC;AAC3D,UAAM,WAAY,MAAM,MAAM,kBAAkB;AAChD,UAAM,KAAK;AACX,WAAO;AAAA,EACX;AAAA,EAEO,iBAAiB;AAAA,IACpB;AAAA,EACJ,GAA8C;AAC1C,QAAI,OAAO,iBAAiB,EAAE,SA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,EAET;AACJ;AAlOW;AAAA,EADN,SAAS;AAAA,GADD,UAEF;AAGA;AAAA,EADN,SAAS;AAAA,GAJD,UAKF;AAGA;AAAA,EADN,SAAS;AAAA,GAPD,UAQF;AAGA;AAAA,EADN,SAAS;AAAA,GAVD,UAWF;AAGA;AAAA,EADN,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAbrB,UAcF;AASA;AAAA,EADN,MAAM;AAAA,GAtBE,UAuBF;AAvBE,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { IconsetAddedDetail } from '@spectrum-web-components/iconset';\nimport {\n css,\n CSSResultGroup,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n customElement,\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { Search } from '@spectrum-web-components/search';\nimport '@spectrum-web-components/search/sp-search.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport bodyStyles from '@spectrum-web-components/styles/body.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nimport iconsList from './iconsList.json' assert { type: 'json' };\n\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport type { SystemVariant } from '@spectrum-web-components/theme';\n\n@customElement('delayed-ready')\nexport class DelayedReady extends SpectrumElement {\n _delayedReady!: Promise<void>;\n _resolveDelayedReady!: () => void;\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.handleSlotchange}></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this._delayedReady = new Promise(\n (res) => (this._resolveDelayedReady = res)\n );\n }\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this._delayedReady;\n return complete;\n }\n\n public handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (target.assignedElements({ flatten: true }).length) {\n requestAnimationFrame(() => {\n this._resolveDelayedReady();\n });\n }\n }\n}\n\n@customElement('icons-demo')\nexport class IconsDemo extends SpectrumElement {\n @property()\n public name = 'ui';\n\n @property()\n public package = '';\n\n @property()\n public size = 'm';\n\n @property()\n public search = '';\n\n @property({ attribute: false })\n public icons: {\n name: string;\n story(size: string): TemplateResult;\n tag: string;\n }[] = [];\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n private iconset: string[] = [];\n public constructor() {\n super();\n this.iconset = [];\n this.handleIconSetAdded = this.handleIconSetAdded.bind(this);\n }\n\n public override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.requestSystemContext();\n window.addEventListener('sp-iconset-added', this.handleIconSetAdded);\n }\n public override disconnectedCallback(): void {\n window.removeEventListener('sp-iconset-added', this.handleIconSetAdded);\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private requestSystemContext(): void {\n this.dispatchEvent(\n new CustomEvent('sp-system-context', {\n detail: {\n callback: (\n system: SystemVariant,\n unsubscribe: () => void\n ) => {\n this.spectrumVersion =\n system === 'spectrum-two' ? 2 : 1;\n this.unsubscribeSystemContext = unsubscribe;\n },\n },\n bubbles: true,\n composed: true,\n })\n );\n }\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n public handleIconSetAdded(event: CustomEvent<IconsetAddedDetail>): void {\n const { iconset } = event.detail;\n this.iconset = iconset.getIconList();\n this.requestUpdate();\n }\n public static override get styles(): CSSResultGroup {\n return [\n ...bodyStyles,\n css`\n :host {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 20px;\n align-items: flex-start;\n }\n .icon {\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n border-radius: var(\n --spectrum-alias-focus-ring-gap,\n var(--spectrum-global-dimension-static-size-25)\n );\n }\n :host([package]) .icon {\n cursor: pointer;\n }\n sp-icon {\n margin-bottom: 10px;\n }\n .search {\n grid-column-start: 1;\n grid-column-end: -1;\n }\n .icon[tabindex]:focus {\n outline: none;\n }\n .icon[tabindex]:focus-visible {\n outline: var(--spectrum-alias-focus-ring-size) solid\n var(--spectrum-alias-focus-ring-color);\n outline-offset: calc(\n var(\n --spectrum-alias-focus-ring-gap,\n var(--spectrum-global-dimension-static-size-25)\n ) * 2\n );\n }\n `,\n ];\n }\n private handleKeydown(event: KeyboardEvent, tag: string): void {\n const { code } = event;\n if (code !== 'Enter' && code !== 'NumpadEnter' && code !== 'Space') {\n return;\n }\n event.preventDefault();\n this.shouldCopy(tag);\n }\n\n private shouldCopy(tag: string): void {\n if (!this.package) return;\n const conditionedTag = tag.slice(1, tag.length - 1);\n const importURL = `import '@spectrum-web-components/${this.package}/icons/${conditionedTag}.js';`;\n this.dispatchEvent(\n new CustomEvent('copy-text', {\n bubbles: true,\n composed: true,\n detail: {\n message: 'Import statement copied to clipboard!',\n text: importURL,\n },\n })\n );\n }\n private updateSearch(event: Event & { target: Search }): void {\n event.stopPropagation();\n this.search = event.target.value;\n }\n private submit(event: Event & { target: Search }): void {\n event.stopPropagation();\n this.updateSearch(event);\n }\n private renderSearch(): TemplateResult {\n let matchingIcons = this.search\n ? this.icons.filter((icon) =>\n icon.name.toLowerCase().includes(this.search.toLowerCase())\n )\n : this.icons;\n\n const iconVersion = this.spectrumVersion === 2 ? 's2' : 's1';\n // Filter out icons that are not in the current version for workflow icons\n if (this.name === 'workflow') {\n matchingIcons = matchingIcons.filter((icon) => {\n const iconName = icon.name.replace(/\\s/g, '').toLowerCase();\n return iconsList[iconVersion].includes(iconName);\n });\n }\n\n return html`\n <div class=\"search\" part=\"search\">\n <sp-field-label for=\"search\">Spectrum icons:</sp-field-label>\n <sp-search\n id=\"search\"\n @keydown=${this.updateSearch}\n @input=${this.updateSearch}\n @submit=${this.submit}\n .value=${this.search}\n label=\"Search for icons\"\n autocomplete=\"off\"\n >\n <sp-help-text slot=\"help-text\">\n Showing ${matchingIcons.length} of ${this.icons.length}\n available icons.\n </sp-help-text>\n </sp-search>\n </div>\n ${matchingIcons.map((icon) => {\n return html`\n <bdo\n class=\"icon\"\n part=\"icon\"\n dir=\"ltr\"\n class=\"icon\"\n @click=${() => this.shouldCopy(icon.tag)}\n @keydown=${(event: KeyboardEvent) =>\n this.handleKeydown(event, icon.tag)}\n tabindex=${ifDefined(this.package ? '0' : undefined)}\n >\n ${icon.story(this.size)} ${icon.tag}\n </bdo>\n `;\n })}\n `;\n }\n protected override render(): TemplateResult {\n return html`\n ${this.icons.length\n ? this.renderSearch()\n : html`\n <slot></slot>\n `}\n ${this.iconset.map(\n (icon) => html`\n <bdo class=\"icon\" dir=\"ltr\">\n <sp-icon\n size=\"xl\"\n name=${`${this.name}:${icon}`}\n ></sp-icon>\n ${icon}\n </bdo>\n `\n )}\n `;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EACI;AAAA,EAEA;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO,gBAAgB;AACvB,OAAO;AACP,OAAO;AAEP,O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