@swisspost/design-system-components 1.3.1 → 1.3.3
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-8880977f.js → index-126f28cf.js} +1 -11
- package/dist/cjs/index-126f28cf.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 +27 -0
- package/dist/cjs/package-f1eacd4f.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +11 -19
- 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 +107 -72
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.css +1420 -3930
- package/dist/collection/components/post-collapsible/post-collapsible.js +14 -11
- package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
- package/dist/collection/components/post-icon/post-icon.js +105 -90
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/get-element-height.js +0 -3
- package/dist/collection/utils/get-element-height.js.map +1 -1
- package/dist/collection/utils/index.js +0 -3
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/utils/on-transition-end.js +0 -3
- package/dist/collection/utils/on-transition-end.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-non-empty.js +7 -0
- package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -0
- package/dist/collection/utils/property-checkers/check-one-of.js +5 -0
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -0
- package/dist/collection/utils/property-checkers/check-type.js +13 -0
- package/dist/collection/utils/property-checkers/check-type.js.map +1 -0
- package/dist/collection/utils/property-checkers/constants.js +2 -0
- package/dist/collection/utils/property-checkers/constants.js.map +1 -0
- package/dist/collection/utils/property-checkers/empty-or.js +9 -0
- package/dist/collection/utils/property-checkers/empty-or.js.map +1 -0
- package/dist/collection/utils/property-checkers/index.js +9 -0
- package/dist/collection/utils/property-checkers/index.js.map +1 -0
- package/dist/collection/utils/should-reduce-motion.js +0 -3
- package/dist/collection/utils/should-reduce-motion.js.map +1 -1
- package/dist/components/package.js +23 -0
- package/dist/components/package.js.map +1 -0
- package/dist/components/post-collapsible.js +13 -20
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +106 -73
- package/dist/components/post-icon.js.map +1 -1
- package/dist/docs.json +2 -2
- package/dist/esm/{index-6d5a72fa.js → index-286143e7.js} +1 -11
- package/dist/esm/index-286143e7.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 +23 -0
- package/dist/esm/package-144d0036.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +10 -18
- 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 +103 -68
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/post-components/{p-a93114b9.js → p-0c286590.js} +3 -3
- package/dist/post-components/p-0c286590.js.map +1 -0
- package/dist/post-components/p-20d342a4.entry.js +2 -0
- package/dist/post-components/p-20d342a4.entry.js.map +1 -0
- package/dist/post-components/p-72fc6cda.entry.js +2 -0
- package/dist/post-components/p-72fc6cda.entry.js.map +1 -0
- package/dist/post-components/p-d2e9b37c.js +2 -0
- package/dist/post-components/p-d2e9b37c.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-collapsible/post-collapsible.d.ts +14 -13
- package/dist/types/components/post-icon/post-icon.d.ts +25 -23
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-type.d.ts +2 -0
- package/dist/types/utils/property-checkers/constants.d.ts +1 -0
- package/dist/types/utils/property-checkers/empty-or.d.ts +1 -0
- package/dist/types/utils/property-checkers/index.d.ts +5 -0
- package/package.json +19 -14
- package/dist/cjs/index-8880977f.js.map +0 -1
- package/dist/cjs/property-checkers-586ad9d4.js +0 -40
- package/dist/cjs/property-checkers-586ad9d4.js.map +0 -1
- package/dist/collection/utils/property-checkers.js +0 -31
- package/dist/collection/utils/property-checkers.js.map +0 -1
- package/dist/components/property-checkers.js +0 -34
- package/dist/components/property-checkers.js.map +0 -1
- package/dist/esm/index-6d5a72fa.js.map +0 -1
- package/dist/esm/property-checkers-484ca671.js +0 -34
- package/dist/esm/property-checkers-484ca671.js.map +0 -1
- package/dist/post-components/p-7cd9c1ad.js +0 -2
- package/dist/post-components/p-7cd9c1ad.js.map +0 -1
- package/dist/post-components/p-a93114b9.js.map +0 -1
- package/dist/post-components/p-b07185a3.entry.js +0 -2
- package/dist/post-components/p-b07185a3.entry.js.map +0 -1
- package/dist/post-components/p-d1bc7b0b.entry.js +0 -2
- package/dist/post-components/p-d1bc7b0b.entry.js.map +0 -1
- package/dist/types/utils/property-checkers.d.ts +0 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function checkOneOf(value, possibleValues, error) {
|
|
2
|
+
if (!possibleValues.includes(value))
|
|
3
|
+
throw new Error(error);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
function checkType(value, type, error) {
|
|
7
|
+
const typeIsArray = type === 'array';
|
|
8
|
+
const valueIsArray = Array.isArray(value);
|
|
9
|
+
if (typeIsArray || valueIsArray) {
|
|
10
|
+
if (valueIsArray !== typeIsArray)
|
|
11
|
+
throw new Error(error);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
if (typeof value !== type)
|
|
15
|
+
throw new Error(error);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const version = "1.3.3";
|
|
20
|
+
|
|
21
|
+
export { checkOneOf as a, checkType as c, version as v };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"package.js","mappings":"SAAgB,UAAU,CAAI,KAAQ,EAAE,cAAmB,EAAE,KAAa;EACxE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;IAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D;;SCMgB,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;EACzE,MAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;EACrC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;EAE1C,IAAI,WAAW,IAAI,YAAY,EAAE;IAC/B,IAAI,YAAY,KAAK,WAAW;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GAC1D;OAAM;IACL,IAAI,OAAO,KAAK,KAAK,IAAI;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GACnD;AACH;;;;;;","names":[],"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"],"version":3}
|