@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.
Files changed (95) hide show
  1. package/dist/cjs/{index-8880977f.js → index-126f28cf.js} +1 -11
  2. package/dist/cjs/index-126f28cf.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +3 -3
  4. package/dist/cjs/loader.cjs.js.map +1 -1
  5. package/dist/cjs/package-f1eacd4f.js +27 -0
  6. package/dist/cjs/package-f1eacd4f.js.map +1 -0
  7. package/dist/cjs/post-collapsible.cjs.entry.js +11 -19
  8. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  9. package/dist/cjs/post-components.cjs.js +3 -3
  10. package/dist/cjs/post-components.cjs.js.map +1 -1
  11. package/dist/cjs/post-icon.cjs.entry.js +107 -72
  12. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  13. package/dist/collection/collection-manifest.json +1 -1
  14. package/dist/collection/components/post-collapsible/post-collapsible.css +1420 -3930
  15. package/dist/collection/components/post-collapsible/post-collapsible.js +14 -11
  16. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  17. package/dist/collection/components/post-icon/post-icon.js +105 -90
  18. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/collection/utils/get-element-height.js +0 -3
  21. package/dist/collection/utils/get-element-height.js.map +1 -1
  22. package/dist/collection/utils/index.js +0 -3
  23. package/dist/collection/utils/index.js.map +1 -1
  24. package/dist/collection/utils/on-transition-end.js +0 -3
  25. package/dist/collection/utils/on-transition-end.js.map +1 -1
  26. package/dist/collection/utils/property-checkers/check-non-empty.js +7 -0
  27. package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -0
  28. package/dist/collection/utils/property-checkers/check-one-of.js +5 -0
  29. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -0
  30. package/dist/collection/utils/property-checkers/check-type.js +13 -0
  31. package/dist/collection/utils/property-checkers/check-type.js.map +1 -0
  32. package/dist/collection/utils/property-checkers/constants.js +2 -0
  33. package/dist/collection/utils/property-checkers/constants.js.map +1 -0
  34. package/dist/collection/utils/property-checkers/empty-or.js +9 -0
  35. package/dist/collection/utils/property-checkers/empty-or.js.map +1 -0
  36. package/dist/collection/utils/property-checkers/index.js +9 -0
  37. package/dist/collection/utils/property-checkers/index.js.map +1 -0
  38. package/dist/collection/utils/should-reduce-motion.js +0 -3
  39. package/dist/collection/utils/should-reduce-motion.js.map +1 -1
  40. package/dist/components/package.js +23 -0
  41. package/dist/components/package.js.map +1 -0
  42. package/dist/components/post-collapsible.js +13 -20
  43. package/dist/components/post-collapsible.js.map +1 -1
  44. package/dist/components/post-icon.js +106 -73
  45. package/dist/components/post-icon.js.map +1 -1
  46. package/dist/docs.json +2 -2
  47. package/dist/esm/{index-6d5a72fa.js → index-286143e7.js} +1 -11
  48. package/dist/esm/index-286143e7.js.map +1 -0
  49. package/dist/esm/loader.js +4 -4
  50. package/dist/esm/loader.js.map +1 -1
  51. package/dist/esm/package-144d0036.js +23 -0
  52. package/dist/esm/package-144d0036.js.map +1 -0
  53. package/dist/esm/post-collapsible.entry.js +10 -18
  54. package/dist/esm/post-collapsible.entry.js.map +1 -1
  55. package/dist/esm/post-components.js +4 -4
  56. package/dist/esm/post-components.js.map +1 -1
  57. package/dist/esm/post-icon.entry.js +103 -68
  58. package/dist/esm/post-icon.entry.js.map +1 -1
  59. package/dist/post-components/{p-a93114b9.js → p-0c286590.js} +3 -3
  60. package/dist/post-components/p-0c286590.js.map +1 -0
  61. package/dist/post-components/p-20d342a4.entry.js +2 -0
  62. package/dist/post-components/p-20d342a4.entry.js.map +1 -0
  63. package/dist/post-components/p-72fc6cda.entry.js +2 -0
  64. package/dist/post-components/p-72fc6cda.entry.js.map +1 -0
  65. package/dist/post-components/p-d2e9b37c.js +2 -0
  66. package/dist/post-components/p-d2e9b37c.js.map +1 -0
  67. package/dist/post-components/post-components.esm.js +1 -1
  68. package/dist/post-components/post-components.esm.js.map +1 -1
  69. package/dist/types/components/post-collapsible/post-collapsible.d.ts +14 -13
  70. package/dist/types/components/post-icon/post-icon.d.ts +25 -23
  71. package/dist/types/utils/property-checkers/check-non-empty.d.ts +1 -0
  72. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -0
  73. package/dist/types/utils/property-checkers/check-type.d.ts +2 -0
  74. package/dist/types/utils/property-checkers/constants.d.ts +1 -0
  75. package/dist/types/utils/property-checkers/empty-or.d.ts +1 -0
  76. package/dist/types/utils/property-checkers/index.d.ts +5 -0
  77. package/package.json +19 -14
  78. package/dist/cjs/index-8880977f.js.map +0 -1
  79. package/dist/cjs/property-checkers-586ad9d4.js +0 -40
  80. package/dist/cjs/property-checkers-586ad9d4.js.map +0 -1
  81. package/dist/collection/utils/property-checkers.js +0 -31
  82. package/dist/collection/utils/property-checkers.js.map +0 -1
  83. package/dist/components/property-checkers.js +0 -34
  84. package/dist/components/property-checkers.js.map +0 -1
  85. package/dist/esm/index-6d5a72fa.js.map +0 -1
  86. package/dist/esm/property-checkers-484ca671.js +0 -34
  87. package/dist/esm/property-checkers-484ca671.js.map +0 -1
  88. package/dist/post-components/p-7cd9c1ad.js +0 -2
  89. package/dist/post-components/p-7cd9c1ad.js.map +0 -1
  90. package/dist/post-components/p-a93114b9.js.map +0 -1
  91. package/dist/post-components/p-b07185a3.entry.js +0 -2
  92. package/dist/post-components/p-b07185a3.entry.js.map +0 -1
  93. package/dist/post-components/p-d1bc7b0b.entry.js +0 -2
  94. package/dist/post-components/p-d1bc7b0b.entry.js.map +0 -1
  95. 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}