@swisspost/design-system-components 1.3.3 → 1.3.5
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/{index-126f28cf.js → index-f95ab17b.js} +62 -20
- package/dist/cjs/index-f95ab17b.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{package-f1eacd4f.js → package-5e7ba83a.js} +2 -2
- package/dist/cjs/{package-f1eacd4f.js.map → package-5e7ba83a.js.map} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +3 -3
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-components.cjs.js.map +1 -1
- package/dist/cjs/post-icon.cjs.entry.js +28 -90
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/post-collapsible/post-collapsible.css +1166 -48
- package/dist/collection/components/post-icon/post-icon.css +10 -10
- package/dist/collection/components/post-icon/post-icon.js +53 -105
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js +36 -0
- package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js.map +1 -0
- package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js +13 -0
- package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js.map +1 -0
- package/dist/collection/utils/property-checkers/tests/check-type.spec.js +103 -0
- package/dist/collection/utils/property-checkers/tests/check-type.spec.js.map +1 -0
- package/dist/collection/utils/property-checkers/tests/empty-or.spec.js +23 -0
- package/dist/collection/utils/property-checkers/tests/empty-or.spec.js.map +1 -0
- package/dist/collection/utils/tests/should-reduce-motion.spec.js +16 -0
- package/dist/collection/utils/tests/should-reduce-motion.spec.js.map +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-collapsible.js +2 -2
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +28 -90
- package/dist/components/post-icon.js.map +1 -1
- package/dist/docs.json +36 -9
- package/dist/esm/{index-286143e7.js → index-0cfe0348.js} +62 -20
- package/dist/esm/index-0cfe0348.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{package-144d0036.js → package-1c534bc2.js} +2 -2
- package/dist/esm/{package-144d0036.js.map → package-1c534bc2.js.map} +1 -1
- package/dist/esm/post-collapsible.entry.js +3 -3
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-components.js.map +1 -1
- package/dist/esm/post-icon.entry.js +28 -90
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/post-components/{p-d2e9b37c.js → p-0049f179.js} +2 -2
- package/dist/post-components/p-50562794.entry.js +2 -0
- package/dist/post-components/{p-72fc6cda.entry.js.map → p-50562794.entry.js.map} +1 -1
- package/dist/post-components/p-8f4d1bc9.js +3 -0
- package/dist/post-components/p-8f4d1bc9.js.map +1 -0
- package/dist/post-components/p-fd9201c2.entry.js +2 -0
- package/dist/post-components/p-fd9201c2.entry.js.map +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/components/post-icon/post-icon.d.ts +14 -15
- package/dist/types/components.d.ts +17 -17
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/loader/index.d.ts +1 -1
- package/package.json +13 -14
- package/dist/cjs/index-126f28cf.js.map +0 -1
- package/dist/esm/index-286143e7.js.map +0 -1
- package/dist/post-components/p-0c286590.js +0 -3
- package/dist/post-components/p-0c286590.js.map +0 -1
- package/dist/post-components/p-20d342a4.entry.js +0 -2
- package/dist/post-components/p-20d342a4.entry.js.map +0 -1
- package/dist/post-components/p-72fc6cda.entry.js +0 -2
- /package/dist/post-components/{p-d2e9b37c.js.map → p-0049f179.js.map} +0 -0
|
@@ -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","
|
|
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.3.1/node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.3.1 | 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,UAAApB"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
declare const ANIMATION_NAMES: readonly ["cylon", "cylon-vertical", "spin", "spin-reverse", "fade", "throb"];
|
|
2
|
+
type Animation = (typeof ANIMATION_NAMES)[number];
|
|
1
3
|
/**
|
|
2
4
|
* @class PostIcon - representing a stencil component
|
|
3
5
|
*/
|
|
4
6
|
export declare class PostIcon {
|
|
5
7
|
private path;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
pathForceCDN: boolean;
|
|
8
|
+
host: HTMLPostIconElement;
|
|
9
|
+
svgStyles: string;
|
|
9
10
|
svgOutput: string;
|
|
10
11
|
/**
|
|
11
|
-
* The name of the animation
|
|
12
|
+
* The name of the animation.
|
|
12
13
|
*/
|
|
13
|
-
readonly animation?:
|
|
14
|
-
validateAnimation(newValue?:
|
|
14
|
+
readonly animation?: Animation | null;
|
|
15
|
+
validateAnimation(newValue?: "cylon" | "cylon-vertical" | "spin" | "spin-reverse" | "fade" | "throb"): void;
|
|
15
16
|
/**
|
|
16
|
-
* The base path, where the icons are located (must be a public url).
|
|
17
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
17
18
|
*/
|
|
18
|
-
readonly base?: string;
|
|
19
|
+
readonly base?: string | null;
|
|
19
20
|
validateBase(newValue?: string): void;
|
|
20
21
|
/**
|
|
21
22
|
* When set to `true`, the icon will be flipped horizontally.
|
|
@@ -33,20 +34,18 @@ export declare class PostIcon {
|
|
|
33
34
|
readonly name: string;
|
|
34
35
|
validateName(newValue?: string): void;
|
|
35
36
|
/**
|
|
36
|
-
* The
|
|
37
|
+
* The number of degree for the css rotate transformation.
|
|
37
38
|
*/
|
|
38
|
-
readonly rotate?: number;
|
|
39
|
+
readonly rotate?: number | null;
|
|
39
40
|
validateRotate(newValue?: number): void;
|
|
40
41
|
/**
|
|
41
|
-
* The
|
|
42
|
+
* The number for the css scale transformation.
|
|
42
43
|
*/
|
|
43
|
-
readonly scale?: number;
|
|
44
|
+
readonly scale?: number | null;
|
|
44
45
|
validateScale(newValue?: number): void;
|
|
45
46
|
componentWillLoad(): void;
|
|
46
47
|
componentWillRender(): void;
|
|
47
48
|
private setPath;
|
|
48
|
-
private getPath;
|
|
49
|
-
private fetchIcon;
|
|
50
|
-
private createIcon;
|
|
51
49
|
render(): any;
|
|
52
50
|
}
|
|
51
|
+
export {};
|
|
@@ -25,13 +25,13 @@ export namespace Components {
|
|
|
25
25
|
*/
|
|
26
26
|
interface PostIcon {
|
|
27
27
|
/**
|
|
28
|
-
* The name of the animation
|
|
28
|
+
* The name of the animation.
|
|
29
29
|
*/
|
|
30
|
-
"animation"?:
|
|
30
|
+
"animation"?: Animation | null;
|
|
31
31
|
/**
|
|
32
|
-
* The base path, where the icons are located (must be a public url).
|
|
32
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
33
33
|
*/
|
|
34
|
-
"base"?: string;
|
|
34
|
+
"base"?: string | null;
|
|
35
35
|
/**
|
|
36
36
|
* When set to `true`, the icon will be flipped horizontally.
|
|
37
37
|
*/
|
|
@@ -45,13 +45,13 @@ export namespace Components {
|
|
|
45
45
|
*/
|
|
46
46
|
"name": string;
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
48
|
+
* The number of degree for the css rotate transformation.
|
|
49
49
|
*/
|
|
50
|
-
"rotate"?: number;
|
|
50
|
+
"rotate"?: number | null;
|
|
51
51
|
/**
|
|
52
|
-
* The
|
|
52
|
+
* The number for the css scale transformation.
|
|
53
53
|
*/
|
|
54
|
-
"scale"?: number;
|
|
54
|
+
"scale"?: number | null;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
declare global {
|
|
@@ -91,13 +91,13 @@ declare namespace LocalJSX {
|
|
|
91
91
|
*/
|
|
92
92
|
interface PostIcon {
|
|
93
93
|
/**
|
|
94
|
-
* The name of the animation
|
|
94
|
+
* The name of the animation.
|
|
95
95
|
*/
|
|
96
|
-
"animation"?:
|
|
96
|
+
"animation"?: Animation | null;
|
|
97
97
|
/**
|
|
98
|
-
* The base path, where the icons are located (must be a public url).
|
|
98
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
99
99
|
*/
|
|
100
|
-
"base"?: string;
|
|
100
|
+
"base"?: string | null;
|
|
101
101
|
/**
|
|
102
102
|
* When set to `true`, the icon will be flipped horizontally.
|
|
103
103
|
*/
|
|
@@ -109,15 +109,15 @@ declare namespace LocalJSX {
|
|
|
109
109
|
/**
|
|
110
110
|
* The name/id of the icon (e.g. 1000, 1001, ...).
|
|
111
111
|
*/
|
|
112
|
-
"name"
|
|
112
|
+
"name": string;
|
|
113
113
|
/**
|
|
114
|
-
* The
|
|
114
|
+
* The number of degree for the css rotate transformation.
|
|
115
115
|
*/
|
|
116
|
-
"rotate"?: number;
|
|
116
|
+
"rotate"?: number | null;
|
|
117
117
|
/**
|
|
118
|
-
* The
|
|
118
|
+
* The number for the css scale transformation.
|
|
119
119
|
*/
|
|
120
|
-
"scale"?: number;
|
|
120
|
+
"scale"?: number | null;
|
|
121
121
|
}
|
|
122
122
|
interface IntrinsicElements {
|
|
123
123
|
"post-collapsible": PostCollapsible;
|
package/loader/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface CustomElementsDefineOptions {
|
|
|
11
11
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
|
|
12
12
|
export declare function applyPolyfills(): Promise<void>;
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
15
|
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
16
|
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
17
|
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
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": "dist/index.cjs.js",
|
|
@@ -25,29 +25,28 @@
|
|
|
25
25
|
"linkDirectory": true
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@stencil/core": "3.
|
|
28
|
+
"@stencil/core": "3.3.1",
|
|
29
|
+
"@swisspost/design-system-styles": "6.2.2"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@percy/cli": "1.
|
|
32
|
+
"@percy/cli": "1.25.0",
|
|
32
33
|
"@percy/cypress": "3.1.2",
|
|
33
|
-
"@popperjs/core": "2.11.7",
|
|
34
34
|
"@stencil-community/eslint-plugin": "^0.5.0",
|
|
35
|
-
"@stencil/react-output-target": "0.
|
|
36
|
-
"@stencil/sass": "3.0.
|
|
37
|
-
"@swisspost/design-system-styles": "6.1.0",
|
|
35
|
+
"@stencil/react-output-target": "0.5.3",
|
|
36
|
+
"@stencil/sass": "3.0.4",
|
|
38
37
|
"@types/jest": "27.5.2",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
40
|
-
"@typescript-eslint/parser": "5.
|
|
41
|
-
"bootstrap": "5.
|
|
42
|
-
"cypress": "12.
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.59.9",
|
|
39
|
+
"@typescript-eslint/parser": "5.59.9",
|
|
40
|
+
"bootstrap": "5.3.0",
|
|
41
|
+
"cypress": "12.14.0",
|
|
43
42
|
"cypress-storybook": "0.5.1",
|
|
44
|
-
"eslint": "8.
|
|
43
|
+
"eslint": "8.42.0",
|
|
45
44
|
"eslint-plugin-react": "7.32.2",
|
|
46
45
|
"jest": "27.5.1",
|
|
47
46
|
"jest-cli": "27.5.1",
|
|
48
47
|
"npm-run-all": "4.1.5",
|
|
49
|
-
"puppeteer": "
|
|
50
|
-
"sass": "1.
|
|
48
|
+
"puppeteer": "20.5.0",
|
|
49
|
+
"sass": "1.63.3",
|
|
51
50
|
"typescript": "4.9.5"
|
|
52
51
|
},
|
|
53
52
|
"scripts": {
|