@swisspost/design-system-components 1.3.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/check-non-empty-35b4d0b5.js +14 -0
- package/dist/cjs/check-non-empty-35b4d0b5.js.map +1 -0
- package/dist/cjs/{package-c661bf2f.js → check-type-f24cf91d.js} +1 -4
- package/dist/cjs/{package-c661bf2f.js.map → check-type-f24cf91d.js.map} +1 -1
- package/dist/cjs/{index-272283b3.js → index-50d7d035.js} +15 -1
- package/dist/cjs/index-50d7d035.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-e8a6597e.js +7 -0
- package/dist/cjs/package-e8a6597e.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +6 -5
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-icon.cjs.entry.js +9 -15
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +35 -0
- package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +29 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +141 -0
- package/dist/cjs/post-tabs.cjs.entry.js.map +1 -0
- package/dist/collection/animations/fade.js +6 -0
- package/dist/collection/animations/fade.js.map +1 -0
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/index.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/post-collapsible/post-collapsible.css +165 -15688
- package/dist/collection/components/post-tab-header/post-tab-header.css +337 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js +68 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.css +3 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +55 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -0
- package/dist/collection/components/post-tabs/post-tabs.css +148 -0
- package/dist/collection/components/post-tabs/post-tabs.js +208 -0
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -0
- package/dist/components/check-non-empty.js +11 -0
- package/dist/components/check-non-empty.js.map +1 -0
- package/dist/{esm/package-adf815bd.js → components/check-type.js} +2 -4
- package/dist/components/check-type.js.map +1 -0
- package/dist/components/package.js +2 -20
- package/dist/components/package.js.map +1 -1
- package/dist/components/post-collapsible.js +3 -2
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +3 -9
- package/dist/components/post-icon.js.map +1 -1
- package/dist/components/post-tab-header.d.ts +11 -0
- package/dist/components/post-tab-header.js +52 -0
- package/dist/components/post-tab-header.js.map +1 -0
- package/dist/components/post-tab-panel.d.ts +11 -0
- package/dist/components/post-tab-panel.js +46 -0
- package/dist/components/post-tab-panel.js.map +1 -0
- package/dist/components/post-tabs.d.ts +11 -0
- package/dist/components/post-tabs.js +158 -0
- package/dist/components/post-tabs.js.map +1 -0
- package/dist/docs.json +131 -1
- package/dist/esm/check-non-empty-554bdf88.js +11 -0
- package/dist/esm/check-non-empty-554bdf88.js.map +1 -0
- package/dist/esm/check-type-67411ed3.js +21 -0
- package/dist/esm/check-type-67411ed3.js.map +1 -0
- package/dist/esm/{index-60a84798.js → index-cc0e53f0.js} +15 -2
- package/dist/esm/index-cc0e53f0.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-b514d0f6.js +5 -0
- package/dist/esm/package-b514d0f6.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +4 -3
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-icon.entry.js +4 -10
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-tab-header.entry.js +31 -0
- package/dist/esm/post-tab-header.entry.js.map +1 -0
- package/dist/esm/post-tab-panel.entry.js +25 -0
- package/dist/esm/post-tab-panel.entry.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +137 -0
- package/dist/esm/post-tabs.entry.js.map +1 -0
- package/dist/post-components/p-1388585d.entry.js +2 -0
- package/dist/post-components/p-1388585d.entry.js.map +1 -0
- package/dist/post-components/p-58916755.js +2 -0
- package/dist/post-components/p-58916755.js.map +1 -0
- package/dist/post-components/p-5b3445dc.entry.js +2 -0
- package/dist/post-components/p-5b3445dc.entry.js.map +1 -0
- package/dist/post-components/p-6341b9b4.js +3 -0
- package/dist/post-components/p-6341b9b4.js.map +1 -0
- package/dist/post-components/p-6dad6a8a.entry.js +2 -0
- package/dist/post-components/p-6dad6a8a.entry.js.map +1 -0
- package/dist/post-components/p-b95ec099.entry.js +2 -0
- package/dist/post-components/p-b95ec099.entry.js.map +1 -0
- package/dist/post-components/p-c8efe0ae.js +2 -0
- package/dist/post-components/p-c8efe0ae.js.map +1 -0
- package/dist/post-components/p-cc92afb7.entry.js +2 -0
- package/dist/post-components/p-cc92afb7.entry.js.map +1 -0
- package/dist/post-components/p-f549b3fc.js +2 -0
- package/dist/post-components/{p-05d38c8e.js.map → p-f549b3fc.js.map} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/animations/fade.d.ts +2 -0
- package/dist/types/animations/index.d.ts +1 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +11 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +10 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +34 -0
- package/dist/types/components.d.ts +75 -0
- package/package.json +7 -8
- package/dist/cjs/index-272283b3.js.map +0 -1
- package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js +0 -36
- package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js.map +0 -1
- package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js +0 -13
- package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js.map +0 -1
- package/dist/collection/utils/property-checkers/tests/check-type.spec.js +0 -103
- package/dist/collection/utils/property-checkers/tests/check-type.spec.js.map +0 -1
- package/dist/collection/utils/property-checkers/tests/empty-or.spec.js +0 -23
- package/dist/collection/utils/property-checkers/tests/empty-or.spec.js.map +0 -1
- package/dist/collection/utils/tests/should-reduce-motion.spec.js +0 -16
- package/dist/collection/utils/tests/should-reduce-motion.spec.js.map +0 -1
- package/dist/esm/index-60a84798.js.map +0 -1
- package/dist/esm/package-adf815bd.js.map +0 -1
- package/dist/post-components/p-0096c140.js +0 -3
- package/dist/post-components/p-0096c140.js.map +0 -1
- package/dist/post-components/p-05d38c8e.js +0 -2
- package/dist/post-components/p-4eaaf8eb.entry.js +0 -2
- package/dist/post-components/p-4eaaf8eb.entry.js.map +0 -1
- package/dist/post-components/p-5cd6cb3a.entry.js +0 -2
- package/dist/post-components/p-5cd6cb3a.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["checkOneOf","value","possibleValues","error","includes","Error","checkType","type","typeIsArray","valueIsArray","Array","isArray"],"sources":["./src/utils/property-checkers/check-one-of.ts","./src/utils/property-checkers/check-type.ts"],"sourcesContent":["export function checkOneOf<T>(value: T, possibleValues: T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n","export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n"],"mappings":"SAAgBA,EAAcC,EAAUC,EAAqBC,GAC3D,IAAKD,EAAeE,SAASH,GAAQ,MAAM,IAAII,MAAMF,EACvD,C,SCMgBG,EAAUL,EAAgBM,EAAoBJ,GAC5D,MAAMK,EAAcD,IAAS,QAC7B,MAAME,EAAeC,MAAMC,QAAQV,GAEnC,GAAIO,GAAeC,EAAc,CAC/B,GAAIA,IAAiBD,EAAa,MAAM,IAAIH,MAAMF,E,KAC7C,CACL,UAAWF,IAAUM,EAAM,MAAM,IAAIF,MAAMF,E,CAE/C,
|
|
1
|
+
{"version":3,"names":["checkOneOf","value","possibleValues","error","includes","Error","checkType","type","typeIsArray","valueIsArray","Array","isArray"],"sources":["./src/utils/property-checkers/check-one-of.ts","./src/utils/property-checkers/check-type.ts"],"sourcesContent":["export function checkOneOf<T>(value: T, possibleValues: T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n","export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n"],"mappings":"SAAgBA,EAAcC,EAAUC,EAAqBC,GAC3D,IAAKD,EAAeE,SAASH,GAAQ,MAAM,IAAII,MAAMF,EACvD,C,SCMgBG,EAAUL,EAAgBM,EAAoBJ,GAC5D,MAAMK,EAAcD,IAAS,QAC7B,MAAME,EAAeC,MAAMC,QAAQV,GAEnC,GAAIO,GAAeC,EAAc,CAC/B,GAAIA,IAAiBD,EAAa,MAAM,IAAIH,MAAMF,E,KAC7C,CACL,UAAWF,IAAUM,EAAM,MAAM,IAAIF,MAAMF,E,CAE/C,Q"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-
|
|
1
|
+
import{p as e,b as a}from"./p-6341b9b4.js";export{s as setNonce}from"./p-6341b9b4.js";const p=()=>{const a=import.meta.url;const s={};if(a!==""){s.resourcesUrl=new URL(".",a).href}return e(s)};p().then((e=>a([["p-6dad6a8a",[[1,"post-collapsible",{collapsed:[4],headingLevel:[2,"heading-level"],collapseClasses:[32],collapseHeight:[32],collapsibleId:[32],hasHeader:[32],headingTag:[32],isOpen:[32],onAccordionButtonClick:[32],toggle:[64]}]]],["p-5b3445dc",[[1,"post-icon",{animation:[1],base:[1],flipH:[4,"flip-h"],flipV:[4,"flip-v"],name:[1],rotate:[2],scale:[2],svgStyles:[32],svgOutput:[32]}]]],["p-1388585d",[[1,"post-tab-header",{panel:[1],tabId:[32]}]]],["p-b95ec099",[[1,"post-tab-panel",{name:[1],panelId:[32]}]]],["p-cc92afb7",[[1,"post-tabs",{activePanel:[1,"active-panel"],show:[64]}]]]],e)));
|
|
2
2
|
//# sourceMappingURL=post-components.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","collapsed","headingLevel","collapseClasses","collapseHeight","collapsibleId","hasHeader","headingTag","isOpen","onAccordionButtonClick","toggle","animation","base","flipH","flipV","name","rotate","scale","svgStyles","svgOutput"],"sources":["../../node_modules/.pnpm/@stencil+core@3.4.2/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,sCAAsC,CAACC,UAAA,IAAAC,aAAA,oBAAAC,gBAAA,KAAAC,eAAA,KAAAC,cAAA,KAAAC,UAAA,KAAAC,WAAA,KAAAC,OAAA,KAAAC,uBAAA,KAAAC,OAAA,wCAAAC,UAAA,IAAAC,KAAA,IAAAC,MAAA,aAAAC,MAAA,aAAAC,KAAA,IAAAC,OAAA,IAAAC,MAAA,IAAAC,UAAA,KAAAC,UAAA,
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","collapsed","headingLevel","collapseClasses","collapseHeight","collapsibleId","hasHeader","headingTag","isOpen","onAccordionButtonClick","toggle","animation","base","flipH","flipV","name","rotate","scale","svgStyles","svgOutput","panel","tabId","panelId","activePanel","show"],"sources":["../../node_modules/.pnpm/@stencil+core@3.4.2/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,sCAAsC,CAACC,UAAA,IAAAC,aAAA,oBAAAC,gBAAA,KAAAC,eAAA,KAAAC,cAAA,KAAAC,UAAA,KAAAC,WAAA,KAAAC,OAAA,KAAAC,uBAAA,KAAAC,OAAA,wCAAAC,UAAA,IAAAC,KAAA,IAAAC,MAAA,aAAAC,MAAA,aAAAC,KAAA,IAAAC,OAAA,IAAAC,MAAA,IAAAC,UAAA,KAAAC,UAAA,8CAAAC,MAAA,IAAAC,MAAA,6CAAAN,KAAA,IAAAO,QAAA,wCAAAC,YAAA,mBAAAC,KAAA,UAAAzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fade';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class PostTabHeader {
|
|
2
|
+
host: HTMLPostTabHeaderElement;
|
|
3
|
+
tabId: string;
|
|
4
|
+
/**
|
|
5
|
+
* The name of the panel controlled by the tab header.
|
|
6
|
+
*/
|
|
7
|
+
readonly panel: HTMLPostTabPanelElement['name'];
|
|
8
|
+
validateFor(newValue: HTMLPostTabPanelElement['name']): void;
|
|
9
|
+
componentWillLoad(): void;
|
|
10
|
+
render(): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class PostTabs {
|
|
3
|
+
private activeTab;
|
|
4
|
+
private showing;
|
|
5
|
+
private hiding;
|
|
6
|
+
private isLoaded;
|
|
7
|
+
private get tabs();
|
|
8
|
+
host: HTMLPostTabsElement;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the panel that is initially shown.
|
|
11
|
+
* If not specified, it defaults to the panel associated with the first tab.
|
|
12
|
+
*
|
|
13
|
+
* **Changing this value after initialization has no effect.**
|
|
14
|
+
*/
|
|
15
|
+
readonly activePanel: HTMLPostTabPanelElement['name'];
|
|
16
|
+
/**
|
|
17
|
+
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.
|
|
18
|
+
* The payload is the name of the newly shown panel.
|
|
19
|
+
*/
|
|
20
|
+
tabChange: EventEmitter<HTMLPostTabPanelElement['name']>;
|
|
21
|
+
componentDidLoad(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the panel with the given name and selects its associated tab.
|
|
24
|
+
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
25
|
+
*/
|
|
26
|
+
show(panelName: string): Promise<void>;
|
|
27
|
+
private moveMisplacedTabs;
|
|
28
|
+
private enableTabs;
|
|
29
|
+
private activateTab;
|
|
30
|
+
private hidePanel;
|
|
31
|
+
private showSelectedPanel;
|
|
32
|
+
private getPanel;
|
|
33
|
+
render(): any;
|
|
34
|
+
}
|
|
@@ -53,6 +53,32 @@ export namespace Components {
|
|
|
53
53
|
*/
|
|
54
54
|
"scale"?: number | null;
|
|
55
55
|
}
|
|
56
|
+
interface PostTabHeader {
|
|
57
|
+
/**
|
|
58
|
+
* The name of the panel controlled by the tab header.
|
|
59
|
+
*/
|
|
60
|
+
"panel": HTMLPostTabPanelElement['name'];
|
|
61
|
+
}
|
|
62
|
+
interface PostTabPanel {
|
|
63
|
+
/**
|
|
64
|
+
* The name of the panel, used to associate it with a tab header.
|
|
65
|
+
*/
|
|
66
|
+
"name": string;
|
|
67
|
+
}
|
|
68
|
+
interface PostTabs {
|
|
69
|
+
/**
|
|
70
|
+
* The name of the panel that is initially shown. If not specified, it defaults to the panel associated with the first tab. **Changing this value after initialization has no effect.**
|
|
71
|
+
*/
|
|
72
|
+
"activePanel": HTMLPostTabPanelElement['name'];
|
|
73
|
+
/**
|
|
74
|
+
* Shows the panel with the given name and selects its associated tab. Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
75
|
+
*/
|
|
76
|
+
"show": (panelName: string) => Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export interface PostTabsCustomEvent<T> extends CustomEvent<T> {
|
|
80
|
+
detail: T;
|
|
81
|
+
target: HTMLPostTabsElement;
|
|
56
82
|
}
|
|
57
83
|
declare global {
|
|
58
84
|
interface HTMLPostCollapsibleElement extends Components.PostCollapsible, HTMLStencilElement {
|
|
@@ -70,9 +96,30 @@ declare global {
|
|
|
70
96
|
prototype: HTMLPostIconElement;
|
|
71
97
|
new (): HTMLPostIconElement;
|
|
72
98
|
};
|
|
99
|
+
interface HTMLPostTabHeaderElement extends Components.PostTabHeader, HTMLStencilElement {
|
|
100
|
+
}
|
|
101
|
+
var HTMLPostTabHeaderElement: {
|
|
102
|
+
prototype: HTMLPostTabHeaderElement;
|
|
103
|
+
new (): HTMLPostTabHeaderElement;
|
|
104
|
+
};
|
|
105
|
+
interface HTMLPostTabPanelElement extends Components.PostTabPanel, HTMLStencilElement {
|
|
106
|
+
}
|
|
107
|
+
var HTMLPostTabPanelElement: {
|
|
108
|
+
prototype: HTMLPostTabPanelElement;
|
|
109
|
+
new (): HTMLPostTabPanelElement;
|
|
110
|
+
};
|
|
111
|
+
interface HTMLPostTabsElement extends Components.PostTabs, HTMLStencilElement {
|
|
112
|
+
}
|
|
113
|
+
var HTMLPostTabsElement: {
|
|
114
|
+
prototype: HTMLPostTabsElement;
|
|
115
|
+
new (): HTMLPostTabsElement;
|
|
116
|
+
};
|
|
73
117
|
interface HTMLElementTagNameMap {
|
|
74
118
|
"post-collapsible": HTMLPostCollapsibleElement;
|
|
75
119
|
"post-icon": HTMLPostIconElement;
|
|
120
|
+
"post-tab-header": HTMLPostTabHeaderElement;
|
|
121
|
+
"post-tab-panel": HTMLPostTabPanelElement;
|
|
122
|
+
"post-tabs": HTMLPostTabsElement;
|
|
76
123
|
}
|
|
77
124
|
}
|
|
78
125
|
declare namespace LocalJSX {
|
|
@@ -119,9 +166,34 @@ declare namespace LocalJSX {
|
|
|
119
166
|
*/
|
|
120
167
|
"scale"?: number | null;
|
|
121
168
|
}
|
|
169
|
+
interface PostTabHeader {
|
|
170
|
+
/**
|
|
171
|
+
* The name of the panel controlled by the tab header.
|
|
172
|
+
*/
|
|
173
|
+
"panel"?: HTMLPostTabPanelElement['name'];
|
|
174
|
+
}
|
|
175
|
+
interface PostTabPanel {
|
|
176
|
+
/**
|
|
177
|
+
* The name of the panel, used to associate it with a tab header.
|
|
178
|
+
*/
|
|
179
|
+
"name"?: string;
|
|
180
|
+
}
|
|
181
|
+
interface PostTabs {
|
|
182
|
+
/**
|
|
183
|
+
* The name of the panel that is initially shown. If not specified, it defaults to the panel associated with the first tab. **Changing this value after initialization has no effect.**
|
|
184
|
+
*/
|
|
185
|
+
"activePanel"?: HTMLPostTabPanelElement['name'];
|
|
186
|
+
/**
|
|
187
|
+
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished. The payload is the name of the newly shown panel.
|
|
188
|
+
*/
|
|
189
|
+
"onTabChange"?: (event: PostTabsCustomEvent<HTMLPostTabPanelElement['name']>) => void;
|
|
190
|
+
}
|
|
122
191
|
interface IntrinsicElements {
|
|
123
192
|
"post-collapsible": PostCollapsible;
|
|
124
193
|
"post-icon": PostIcon;
|
|
194
|
+
"post-tab-header": PostTabHeader;
|
|
195
|
+
"post-tab-panel": PostTabPanel;
|
|
196
|
+
"post-tabs": PostTabs;
|
|
125
197
|
}
|
|
126
198
|
}
|
|
127
199
|
export { LocalJSX as JSX };
|
|
@@ -133,6 +205,9 @@ declare module "@stencil/core" {
|
|
|
133
205
|
* @class PostIcon - representing a stencil component
|
|
134
206
|
*/
|
|
135
207
|
"post-icon": LocalJSX.PostIcon & JSXBase.HTMLAttributes<HTMLPostIconElement>;
|
|
208
|
+
"post-tab-header": LocalJSX.PostTabHeader & JSXBase.HTMLAttributes<HTMLPostTabHeaderElement>;
|
|
209
|
+
"post-tab-panel": LocalJSX.PostTabPanel & JSXBase.HTMLAttributes<HTMLPostTabPanelElement>;
|
|
210
|
+
"post-tabs": LocalJSX.PostTabs & JSXBase.HTMLAttributes<HTMLPostTabsElement>;
|
|
136
211
|
}
|
|
137
212
|
}
|
|
138
213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "loader/index.cjs.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@stencil/core": "3.4.2",
|
|
28
|
-
"@swisspost/design-system-styles": "6.
|
|
28
|
+
"@swisspost/design-system-styles": "6.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@percy/cli": "1.26.
|
|
31
|
+
"@percy/cli": "1.26.3",
|
|
32
32
|
"@percy/cypress": "3.1.2",
|
|
33
33
|
"@stencil-community/eslint-plugin": "^0.5.0",
|
|
34
34
|
"@stencil/react-output-target": "0.5.3",
|
|
@@ -37,16 +37,15 @@
|
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
38
38
|
"@typescript-eslint/parser": "5.62.0",
|
|
39
39
|
"bootstrap": "5.3.1",
|
|
40
|
-
"cypress": "12.17.
|
|
40
|
+
"cypress": "12.17.4",
|
|
41
41
|
"cypress-storybook": "0.5.1",
|
|
42
|
-
"eslint": "8.
|
|
43
|
-
"eslint-plugin-react": "7.33.
|
|
42
|
+
"eslint": "8.48.0",
|
|
43
|
+
"eslint-plugin-react": "7.33.2",
|
|
44
44
|
"jest": "27.5.1",
|
|
45
45
|
"jest-cli": "27.5.1",
|
|
46
46
|
"npm-run-all": "4.1.5",
|
|
47
|
-
"puppeteer": "20.9.0",
|
|
48
47
|
"rimraf": "5.0.1",
|
|
49
|
-
"sass": "1.
|
|
48
|
+
"sass": "1.66.1",
|
|
50
49
|
"typescript": "4.9.5"
|
|
51
50
|
},
|
|
52
51
|
"scripts": {
|