@swisspost/design-system-components 1.3.8 → 1.3.10

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 (73) hide show
  1. package/dist/cjs/{index-0e16bf18.js → index-272283b3.js} +9 -5
  2. package/dist/cjs/index-272283b3.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +10 -1
  4. package/dist/cjs/loader.cjs.js.map +1 -1
  5. package/dist/cjs/{package-e69a4462.js → package-f6bb523d.js} +2 -2
  6. package/dist/cjs/package-f6bb523d.js.map +1 -0
  7. package/dist/cjs/post-collapsible.cjs.entry.js +3 -3
  8. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  9. package/dist/cjs/post-components.cjs.js +5 -2
  10. package/dist/cjs/post-components.cjs.js.map +1 -1
  11. package/dist/cjs/post-icon.cjs.entry.js +2 -2
  12. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  13. package/dist/collection/collection-manifest.json +3 -3
  14. package/dist/collection/components/post-collapsible/post-collapsible.css +165 -15688
  15. package/dist/collection/components/post-collapsible/post-collapsible.js +4 -5
  16. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  17. package/dist/collection/components/post-icon/post-icon.js +4 -5
  18. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  19. package/dist/collection/utils/on-transition-end.js +1 -1
  20. package/dist/collection/utils/property-checkers/check-non-empty.js +1 -1
  21. package/dist/collection/utils/property-checkers/empty-or.js +1 -1
  22. package/dist/collection/utils/property-checkers/index.js +3 -3
  23. package/dist/components/package.js +1 -1
  24. package/dist/components/package.js.map +1 -1
  25. package/dist/components/post-collapsible.js +1 -1
  26. package/dist/components/post-collapsible.js.map +1 -1
  27. package/dist/components/post-icon.js.map +1 -1
  28. package/dist/docs.d.ts +1 -18
  29. package/dist/docs.json +5 -72
  30. package/dist/esm/{index-fc5f363d.js → index-60a84798.js} +9 -5
  31. package/dist/esm/index-60a84798.js.map +1 -0
  32. package/dist/esm/loader.js +11 -2
  33. package/dist/esm/loader.js.map +1 -1
  34. package/dist/esm/{package-e41b18ed.js → package-bcf00737.js} +2 -2
  35. package/dist/esm/package-bcf00737.js.map +1 -0
  36. package/dist/esm/polyfills/css-shim.js +1 -0
  37. package/dist/esm/post-collapsible.entry.js +3 -3
  38. package/dist/esm/post-collapsible.entry.js.map +1 -1
  39. package/dist/esm/post-components.js +6 -3
  40. package/dist/esm/post-components.js.map +1 -1
  41. package/dist/esm/post-icon.entry.js +2 -2
  42. package/dist/esm/post-icon.entry.js.map +1 -1
  43. package/dist/post-components/p-0096c140.js +3 -0
  44. package/dist/post-components/p-0096c140.js.map +1 -0
  45. package/dist/post-components/{p-0484ba12.js → p-4a3ff4c0.js} +2 -2
  46. package/dist/post-components/p-4a3ff4c0.js.map +1 -0
  47. package/dist/post-components/p-99ccf0cf.entry.js +2 -0
  48. package/dist/post-components/p-99ccf0cf.entry.js.map +1 -0
  49. package/dist/post-components/{p-32e2283f.entry.js → p-cafa0281.entry.js} +2 -2
  50. package/dist/post-components/p-cafa0281.entry.js.map +1 -0
  51. package/dist/post-components/post-components.esm.js +1 -1
  52. package/dist/post-components/post-components.esm.js.map +1 -1
  53. package/package.json +16 -15
  54. package/dist/cjs/index-0e16bf18.js.map +0 -1
  55. package/dist/cjs/package-e69a4462.js.map +0 -1
  56. package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js +0 -36
  57. package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js.map +0 -1
  58. package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js +0 -13
  59. package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js.map +0 -1
  60. package/dist/collection/utils/property-checkers/tests/check-type.spec.js +0 -103
  61. package/dist/collection/utils/property-checkers/tests/check-type.spec.js.map +0 -1
  62. package/dist/collection/utils/property-checkers/tests/empty-or.spec.js +0 -23
  63. package/dist/collection/utils/property-checkers/tests/empty-or.spec.js.map +0 -1
  64. package/dist/collection/utils/tests/should-reduce-motion.spec.js +0 -16
  65. package/dist/collection/utils/tests/should-reduce-motion.spec.js.map +0 -1
  66. package/dist/esm/index-fc5f363d.js.map +0 -1
  67. package/dist/esm/package-e41b18ed.js.map +0 -1
  68. package/dist/post-components/p-0484ba12.js.map +0 -1
  69. package/dist/post-components/p-23b39cf3.entry.js +0 -2
  70. package/dist/post-components/p-23b39cf3.entry.js.map +0 -1
  71. package/dist/post-components/p-32e2283f.entry.js.map +0 -1
  72. package/dist/post-components/p-96ca500c.js +0 -3
  73. package/dist/post-components/p-96ca500c.js.map +0 -1
@@ -1,103 +0,0 @@
1
- import { checkType } from "../check-type";
2
- describe('checkType', () => {
3
- let type;
4
- let error;
5
- const runCheckForValue = value => () => checkType(value, type, error);
6
- describe('boolean', () => {
7
- beforeAll(() => {
8
- type = 'boolean';
9
- error = 'Not a boolean.';
10
- });
11
- it('should not throw an error if the value is a boolean', () => {
12
- [true, false].forEach(boolean => {
13
- expect(runCheckForValue(boolean)).not.toThrow();
14
- });
15
- });
16
- it('should throw an error if the value is not a boolean', () => {
17
- [undefined, null, 42, NaN, 'string', [], {}, () => { }].forEach(nonBoolean => {
18
- expect(runCheckForValue(nonBoolean)).toThrow(error);
19
- });
20
- });
21
- });
22
- describe('number', () => {
23
- beforeAll(() => {
24
- type = 'number';
25
- error = 'Not a number.';
26
- });
27
- it('should not throw an error if the value is a number', () => {
28
- [42, 4.2, 4200, 2.4434634e9, NaN].forEach(number => {
29
- expect(runCheckForValue(number)).not.toThrow();
30
- });
31
- });
32
- it('should throw an error if the value is not a number', () => {
33
- [undefined, null, true, 'string', [], {}, () => { }].forEach(nonNumber => {
34
- expect(runCheckForValue(nonNumber)).toThrow(error);
35
- });
36
- });
37
- });
38
- describe('string', () => {
39
- beforeAll(() => {
40
- type = 'string';
41
- error = 'Not a string.';
42
- });
43
- it('should not throw an error if the value is a string', () => {
44
- ['', 'string', '42', '¡¡Olé 🙌!!'].forEach(string => {
45
- expect(runCheckForValue(string)).not.toThrow();
46
- });
47
- });
48
- it('should throw an error if the value is not string', () => {
49
- [undefined, null, true, 42, NaN, [], {}, () => { }].forEach(nonString => {
50
- expect(runCheckForValue(nonString)).toThrow(error);
51
- });
52
- });
53
- });
54
- describe('array', () => {
55
- beforeAll(() => {
56
- type = 'array';
57
- error = 'Not an array.';
58
- });
59
- it('should not throw an error if the value is an array', () => {
60
- [[], [1, 'a']].forEach(array => {
61
- expect(runCheckForValue(array)).not.toThrow();
62
- });
63
- });
64
- it('should throw an error if the value is not an array', () => {
65
- [undefined, null, true, 42, NaN, 'string', {}, () => { }].forEach(nonArray => {
66
- expect(runCheckForValue(nonArray)).toThrow(error);
67
- });
68
- });
69
- });
70
- describe('object', () => {
71
- beforeAll(() => {
72
- type = 'object';
73
- error = 'Not an object.';
74
- });
75
- it('should not throw an error if the value is an object', () => {
76
- [null, {}].forEach(object => {
77
- expect(runCheckForValue(object)).not.toThrow();
78
- });
79
- });
80
- it('should throw an error if the value is not an object', () => {
81
- [undefined, true, 42, NaN, 'string', () => { }].forEach(nonObject => {
82
- expect(runCheckForValue(nonObject)).toThrow(error);
83
- });
84
- });
85
- });
86
- describe('function', () => {
87
- beforeAll(() => {
88
- type = 'function';
89
- error = 'Not a function.';
90
- });
91
- it('should not throw an error if the value is a function', () => {
92
- [function () { }, () => { }].forEach(fn => {
93
- expect(runCheckForValue(fn)).not.toThrow();
94
- });
95
- });
96
- it('should throw an error if the value is not a function', () => {
97
- [undefined, null, true, 42, NaN, 'string', [], {}].forEach(nonFn => {
98
- expect(runCheckForValue(nonFn)).toThrow(error);
99
- });
100
- });
101
- });
102
- });
103
- //# sourceMappingURL=check-type.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-type.spec.js","sourceRoot":"","sources":["../../../../../src/utils/property-checkers/tests/check-type.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAC;AAExD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EACzB,IA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kType, PropertyType } from '../check-type';\n\ndescribe('checkType', () => {\n let type: PropertyType;\n let error: string;\n const runCheckForValue = value => () => checkType(value, type, error);\n\n describe('boolean', () => {\n beforeAll(() => {\n type = 'boolean';\n error = 'Not a boolean.';\n });\n\n it('should not throw an error if the value is a boolean', () => {\n [true, false].forEach(boolean => {\n expect(runCheckForValue(boolean)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not a boolean', () => {\n [undefined, null, 42, NaN, 'string', [], {}, () => {/* empty */}].forEach(nonBoolean => {\n expect(runCheckForValue(nonBoolean)).toThrow(error);\n });\n });\n });\n\n describe('number', () => {\n beforeAll(() => {\n type = 'number';\n error = 'Not a number.';\n });\n\n it('should not throw an error if the value is a number', () => {\n [ 42, 4.2, 4_200, 2.4434634e9, NaN ].forEach(number => {\n expect(runCheckForValue(number)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not a number', () => {\n [undefined, null, true, 'string', [], {}, () => {/* empty */}].forEach(nonNumber => {\n expect(runCheckForValue(nonNumber)).toThrow(error);\n });\n });\n });\n\n describe('string', () => {\n beforeAll(() => {\n type = 'string';\n error = 'Not a string.';\n });\n\n it('should not throw an error if the value is a string', () => {\n ['', 'string', '42', '¡¡Olé 🙌!!'].forEach(string => {\n expect(runCheckForValue(string)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not string', () => {\n [undefined, null, true, 42, NaN, [], {}, () => {/* empty */}].forEach(nonString => {\n expect(runCheckForValue(nonString)).toThrow(error);\n });\n });\n });\n\n describe('array', () => {\n beforeAll(() => {\n type = 'array';\n error = 'Not an array.';\n });\n\n it('should not throw an error if the value is an array', () => {\n [[], [1, 'a']].forEach(array => {\n expect(runCheckForValue(array)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not an array', () => {\n [undefined, null, true, 42, NaN, 'string', {}, () => {/* empty */}].forEach(nonArray => {\n expect(runCheckForValue(nonArray)).toThrow(error);\n });\n });\n });\n\n describe('object', () => {\n beforeAll(() => {\n type = 'object';\n error = 'Not an object.';\n });\n\n it('should not throw an error if the value is an object', () => {\n [null, {}].forEach(object => {\n expect(runCheckForValue(object)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not an object', () => {\n [undefined, true, 42, NaN, 'string', () => {/* empty */}].forEach(nonObject => {\n expect(runCheckForValue(nonObject)).toThrow(error);\n });\n });\n });\n\n describe('function', () => {\n beforeAll(() => {\n type = 'function';\n error = 'Not a function.';\n });\n\n it('should not throw an error if the value is a function', () => {\n [function () {/* empty */}, () => {/* empty */}].forEach(fn => {\n expect(runCheckForValue(fn)).not.toThrow();\n });\n });\n\n it('should throw an error if the value is not a function', () => {\n [undefined, null, true, 42, NaN, 'string', [], {}].forEach(nonFn => {\n expect(runCheckForValue(nonFn)).toThrow(error);\n });\n });\n });\n});\n"]}
@@ -1,23 +0,0 @@
1
- import { emptyOr } from "../empty-or";
2
- describe('emptyOr', () => {
3
- const mockCheck = jest.fn();
4
- const mockEmptyOrCheck = emptyOr(mockCheck);
5
- it('should not run the check if the provided value is empty', () => {
6
- [undefined, null, ''].forEach(emptyValue => {
7
- mockEmptyOrCheck(emptyValue);
8
- expect(mockCheck).not.toHaveBeenCalled();
9
- });
10
- });
11
- it('should run the check if the provided value is not empty', () => {
12
- [0, NaN, ' ', false, [], {}, () => { }].forEach((nonEmptyValue, index) => {
13
- mockEmptyOrCheck(nonEmptyValue);
14
- expect(mockCheck).toHaveBeenCalledTimes(index + 1);
15
- });
16
- });
17
- it('should pass all provided arguments to the nested check function', () => {
18
- const args = ['non empty value', true, false, ['arg in an array'], { arg: 'in an object' }];
19
- mockEmptyOrCheck(...args);
20
- expect(mockCheck).toHaveBeenCalledWith(...args);
21
- });
22
- });
23
- //# sourceMappingURL=empty-or.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"empty-or.spec.js","sourceRoot":"","sources":["../../../../../src/utils/property-checkers/tests/empty-or.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;A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jest.fn();\n const mockEmptyOrCheck = emptyOr(mockCheck);\n\n it('should not run the check if the provided value is empty', () => {\n [undefined, null, ''].forEach(emptyValue => {\n mockEmptyOrCheck(emptyValue);\n expect(mockCheck).not.toHaveBeenCalled();\n });\n });\n\n it('should run the check if the provided value is not empty', () => {\n [0, NaN, ' ', false, [], {}, () => {/* empty */}].forEach((nonEmptyValue, index) => {\n mockEmptyOrCheck(nonEmptyValue);\n expect(mockCheck).toHaveBeenCalledTimes(index + 1);\n });\n });\n\n it('should pass all provided arguments to the nested check function', () => {\n const args = ['non empty value', true, false, ['arg in an array'], {arg: 'in an object'}];\n mockEmptyOrCheck(...args);\n expect(mockCheck).toHaveBeenCalledWith(...args);\n });\n});\n"]}
@@ -1,16 +0,0 @@
1
- import { shouldReduceMotion } from "../should-reduce-motion";
2
- describe('shouldReduceMotion', () => {
3
- let matchMedia;
4
- beforeEach(() => {
5
- matchMedia = window.matchMedia = jest.fn();
6
- });
7
- it('should return true if reduced motion is requested', () => {
8
- matchMedia.mockReturnValue({ matches: true });
9
- expect(shouldReduceMotion()).toBe(true);
10
- });
11
- it('should return false if reduced motion is not requested', () => {
12
- matchMedia.mockReturnValue({ matches: false });
13
- expect(shouldReduceMotion()).toBe(false);
14
- });
15
- });
16
- //# sourceMappingURL=should-reduce-motion.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"should-reduce-motion.spec.js","sourceRoot":"","sources":["../../../../src/utils/tests/should-reduce-motion.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;EAClC,IAAI,UAAU,CAAC;EAEf,UAAU,CAAC,GAAG,EAAE;IACd,UAAU,GAAG,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;EAC7C,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC3D,UAAU,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;IAChE,UAAU,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { shouldReduceMotion } from '../should-reduce-motion';\n\ndescribe('shouldReduceMotion', () => {\n let matchMedia;\n\n beforeEach(() => {\n matchMedia = window.matchMedia = jest.fn();\n });\n\n it('should return true if reduced motion is requested', () => {\n matchMedia.mockReturnValue({ matches: true });\n expect(shouldReduceMotion()).toBe(true);\n });\n\n it('should return false if reduced motion is not requested', () => {\n matchMedia.mockReturnValue({ matches: false });\n expect(shouldReduceMotion()).toBe(false);\n });\n});\n"]}