@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
@@ -1,22 +1,23 @@
1
1
  export declare class PostCollapsible {
2
+ private collapsibleElement;
3
+ private isLoaded;
4
+ host: HTMLPostCollapsibleElement;
5
+ collapseClasses: string;
6
+ collapseHeight: string | null;
7
+ collapsibleId: string;
8
+ hasHeader: boolean;
9
+ headingTag: string | undefined;
10
+ isOpen: boolean;
11
+ onAccordionButtonClick: () => Promise<boolean>;
2
12
  /**
3
13
  * If `true`, the element is initially collapsed otherwise it is displayed.
4
14
  */
5
- collapsed?: boolean;
15
+ readonly collapsed?: boolean;
16
+ validateCollapsed(newValue?: boolean): void;
6
17
  /**
7
18
  * Defines the hierarchical level of the collapsible header within the headings structure.
8
19
  */
9
- headingLevel?: number;
10
- isOpen: boolean;
11
- collapseClasses: string;
12
- collapseHeight: string | null;
13
- headingTag: string | undefined;
14
- collapsibleId: string;
15
- hasHeader: boolean;
16
- host: HTMLElement;
17
- isLoaded: boolean;
18
- collapsibleElement: HTMLElement;
19
- validateCollapsed(newValue?: boolean): void;
20
+ readonly headingLevel?: number;
20
21
  validateHeadingLevel(newValue?: number): void;
21
22
  componentWillLoad(): void;
22
23
  componentDidLoad(): void;
@@ -24,7 +25,7 @@ export declare class PostCollapsible {
24
25
  * Triggers the collapse programmatically.
25
26
  */
26
27
  toggle(open?: boolean): Promise<boolean>;
27
- startTransition(): void;
28
+ private startTransition;
28
29
  private getCollapseClasses;
29
30
  render(): any;
30
31
  }
@@ -2,49 +2,51 @@
2
2
  * @class PostIcon - representing a stencil component
3
3
  */
4
4
  export declare class PostIcon {
5
+ private path;
6
+ private loadedPath;
7
+ private svgSource;
8
+ pathForceCDN: boolean;
9
+ svgOutput: string;
5
10
  /**
6
- * The name/id of the icon (e.g. 1000, 1001, ...).
11
+ * The name of the animation (`cylon`, `cylon-vertical`, `spin`, `spin-reverse`, `fade`, `throb`).
7
12
  */
8
- name: string;
13
+ readonly animation?: string;
14
+ validateAnimation(newValue?: string): void;
9
15
  /**
10
16
  * The base path, where the icons are located (must be a public url).
11
17
  */
12
- base?: string;
18
+ readonly base?: string;
19
+ validateBase(newValue?: string): void;
13
20
  /**
14
21
  * When set to `true`, the icon will be flipped horizontally.
15
22
  */
16
- flipH?: boolean;
23
+ readonly flipH?: boolean;
24
+ validateFlipH(newValue?: boolean): void;
17
25
  /**
18
26
  * When set to `true`, the icon will be flipped vertically.
19
27
  */
20
- flipV?: boolean;
28
+ readonly flipV?: boolean;
29
+ validateFlipV(newValue?: boolean): void;
21
30
  /**
22
- * The `number` for the css `scale` transformation.
31
+ * The name/id of the icon (e.g. 1000, 1001, ...).
23
32
  */
24
- scale?: number;
33
+ readonly name: string;
34
+ validateName(newValue?: string): void;
25
35
  /**
26
36
  * The `number` of degree for the css `rotate` transformation.
27
37
  */
28
- rotate?: number;
38
+ readonly rotate?: number;
39
+ validateRotate(newValue?: number): void;
29
40
  /**
30
- * The name of the animation (`cylon`, `cylon-vertical`, `spin`, `spin-reverse`, `fade`, `throb`).
41
+ * The `number` for the css `scale` transformation.
31
42
  */
32
- animation?: string;
33
- initialPath: string;
34
- path: string;
35
- svgSource: string;
36
- svgOutput: string;
37
- validateName(newValue?: string): void;
38
- validateBase(newValue?: string): void;
39
- validateFlipH(newValue?: boolean): void;
40
- validateFlipV(newValue?: boolean): void;
43
+ readonly scale?: number;
41
44
  validateScale(newValue?: number): void;
42
- validateRotate(newValue?: number): void;
43
- validateAnimation(newValue?: string): void;
44
- connectedCallback(): void;
45
45
  componentWillLoad(): void;
46
46
  componentWillRender(): void;
47
- getPath(basePath: string): string;
48
- fetchSVG(): void;
47
+ private setPath;
48
+ private getPath;
49
+ private fetchIcon;
50
+ private createIcon;
49
51
  render(): any;
50
52
  }
@@ -0,0 +1 @@
1
+ export declare function checkNonEmpty(value: unknown, error: string): void;
@@ -0,0 +1 @@
1
+ export declare function checkOneOf<T>(value: T, possibleValues: T[], error: string): void;
@@ -0,0 +1,2 @@
1
+ export type PropertyType = 'boolean' | 'number' | 'string' | 'array' | 'object' | 'function';
2
+ export declare function checkType(value: unknown, type: PropertyType, error: string): void;
@@ -0,0 +1 @@
1
+ export declare const EMPTY_VALUES: string[];
@@ -0,0 +1 @@
1
+ export declare function emptyOr<T extends unknown[]>(check: (...args: T) => void): (...args: T) => void;
@@ -0,0 +1,5 @@
1
+ export declare const checkEmptyOrOneOf: <T>(value: T, possibleValues: T[], error: string) => void;
2
+ export declare const checkEmptyOrType: (value: unknown, type: import("./check-type").PropertyType, error: string) => void;
3
+ export * from './check-non-empty';
4
+ export * from './check-one-of';
5
+ export * from './check-type';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
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,25 +25,30 @@
25
25
  "linkDirectory": true
26
26
  },
27
27
  "dependencies": {
28
- "@popperjs/core": "2.11.6",
29
- "@stencil/core": "3.0.1",
30
- "@stencil/react-output-target": "0.4.0",
31
- "@stencil/sass": "2.0.3",
32
- "@swisspost/design-system-styles": "5.4.1",
33
- "bootstrap": "5.1.3",
34
- "puppeteer": "19.7.2",
35
- "sass": "1.58.3"
28
+ "@stencil/core": "3.2.0"
36
29
  },
37
30
  "devDependencies": {
38
- "@percy/cli": "1.20.0",
31
+ "@percy/cli": "1.21.0",
39
32
  "@percy/cypress": "3.1.2",
33
+ "@popperjs/core": "2.11.7",
34
+ "@stencil-community/eslint-plugin": "^0.5.0",
35
+ "@stencil/react-output-target": "0.4.0",
36
+ "@stencil/sass": "3.0.0",
37
+ "@swisspost/design-system-styles": "6.1.0",
40
38
  "@types/jest": "27.5.2",
41
- "cypress": "12.6.0",
39
+ "@typescript-eslint/eslint-plugin": "5.56.0",
40
+ "@typescript-eslint/parser": "5.56.0",
41
+ "bootstrap": "5.2.3",
42
+ "cypress": "12.8.1",
42
43
  "cypress-storybook": "0.5.1",
44
+ "eslint": "8.36.0",
45
+ "eslint-plugin-react": "7.32.2",
43
46
  "jest": "27.5.1",
44
47
  "jest-cli": "27.5.1",
45
48
  "npm-run-all": "4.1.5",
46
- "typescript": "4.8.4"
49
+ "puppeteer": "19.8.0",
50
+ "sass": "1.60.0",
51
+ "typescript": "4.9.5"
47
52
  },
48
53
  "scripts": {
49
54
  "start": "stencil build --watch --docs-readme",
@@ -53,7 +58,7 @@
53
58
  "unit:watch": "stencil test --spec --watchAll --silent",
54
59
  "e2e": "cypress run",
55
60
  "e2e:watch": "cypress open",
56
- "snapshots": "percy exec -- cypress run --config-file ./cypress.snapshot.config.js",
57
- "generate": "stencil generate"
61
+ "generate": "stencil generate",
62
+ "lint": "eslint src/**/*{.ts,.tsx}"
58
63
  }
59
64
  }