@swisspost/design-system-components 1.4.0 → 1.5.1

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 (162) hide show
  1. package/dist/cjs/check-one-of-4c2e8b2e.js +10 -0
  2. package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
  3. package/dist/cjs/{check-type-f24cf91d.js → check-type-508a21a5.js} +1 -7
  4. package/dist/cjs/check-type-508a21a5.js.map +1 -0
  5. package/dist/cjs/fade-8c6d4fa7.js +12 -0
  6. package/dist/cjs/fade-8c6d4fa7.js.map +1 -0
  7. package/dist/cjs/{index-50d7d035.js → index-12cc37c9.js} +107 -5
  8. package/dist/cjs/index-12cc37c9.js.map +1 -0
  9. package/dist/cjs/index-f8f6f146.js +28 -0
  10. package/dist/cjs/index-f8f6f146.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/package-112e1698.js +7 -0
  13. package/dist/cjs/package-112e1698.js.map +1 -0
  14. package/dist/cjs/post-alert.cjs.entry.js +105 -0
  15. package/dist/cjs/post-alert.cjs.entry.js.map +1 -0
  16. package/dist/cjs/post-collapsible.cjs.entry.js +6 -5
  17. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  18. package/dist/cjs/post-components.cjs.js +2 -2
  19. package/dist/cjs/post-icon.cjs.entry.js +12 -21
  20. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  21. package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
  22. package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -1
  23. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  24. package/dist/cjs/post-tabs.cjs.entry.js +31 -17
  25. package/dist/cjs/post-tabs.cjs.entry.js.map +1 -1
  26. package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
  27. package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
  28. package/dist/collection/collection-manifest.json +3 -1
  29. package/dist/collection/components/post-alert/alert-types.js +2 -0
  30. package/dist/collection/components/post-alert/alert-types.js.map +1 -0
  31. package/dist/collection/components/post-alert/post-alert.css +35 -0
  32. package/dist/collection/components/post-alert/post-alert.js +255 -0
  33. package/dist/collection/components/post-alert/post-alert.js.map +1 -0
  34. package/dist/collection/components/post-collapsible/post-collapsible.css +2 -227
  35. package/dist/collection/components/post-icon/post-icon.css +1 -102
  36. package/dist/collection/components/post-tab-header/post-tab-header.css +3 -337
  37. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  38. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
  39. package/dist/collection/components/post-tab-panel/post-tab-panel.css +1 -3
  40. package/dist/collection/components/post-tabs/post-tabs.css +1 -148
  41. package/dist/collection/components/post-tabs/post-tabs.js +26 -7
  42. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
  43. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -0
  44. package/dist/collection/components/post-tooltip/post-tooltip.js +338 -0
  45. package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -0
  46. package/dist/collection/components/post-tooltip/types.js +2 -0
  47. package/dist/collection/components/post-tooltip/types.js.map +1 -0
  48. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
  49. package/dist/collection/utils/property-checkers/check-pattern.js +5 -0
  50. package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -0
  51. package/dist/collection/utils/property-checkers/index.js +3 -0
  52. package/dist/collection/utils/property-checkers/index.js.map +1 -1
  53. package/dist/components/check-one-of.js +8 -0
  54. package/dist/components/check-one-of.js.map +1 -0
  55. package/dist/components/check-type.js +1 -6
  56. package/dist/components/check-type.js.map +1 -1
  57. package/dist/components/fade.js +9 -0
  58. package/dist/components/fade.js.map +1 -0
  59. package/dist/components/package.js +1 -1
  60. package/dist/components/post-alert.d.ts +11 -0
  61. package/dist/components/post-alert.js +135 -0
  62. package/dist/components/post-alert.js.map +1 -0
  63. package/dist/components/post-collapsible.js +3 -2
  64. package/dist/components/post-collapsible.js.map +1 -1
  65. package/dist/components/post-icon.js +1 -135
  66. package/dist/components/post-icon.js.map +1 -1
  67. package/dist/components/post-icon2.js +146 -0
  68. package/dist/components/post-icon2.js.map +1 -0
  69. package/dist/components/post-tab-header.js +2 -2
  70. package/dist/components/post-tab-header.js.map +1 -1
  71. package/dist/components/post-tabs.js +27 -13
  72. package/dist/components/post-tabs.js.map +1 -1
  73. package/dist/components/post-tooltip.d.ts +11 -0
  74. package/dist/components/post-tooltip.js +5118 -0
  75. package/dist/components/post-tooltip.js.map +1 -0
  76. package/dist/docs.json +313 -3
  77. package/dist/esm/check-one-of-ded5e15e.js +8 -0
  78. package/dist/esm/check-one-of-ded5e15e.js.map +1 -0
  79. package/dist/esm/{check-type-67411ed3.js → check-type-18ebb4e7.js} +2 -7
  80. package/dist/esm/check-type-18ebb4e7.js.map +1 -0
  81. package/dist/esm/fade-671f1489.js +9 -0
  82. package/dist/esm/fade-671f1489.js.map +1 -0
  83. package/dist/esm/{index-cc0e53f0.js → index-5611074b.js} +107 -5
  84. package/dist/esm/index-5611074b.js.map +1 -0
  85. package/dist/esm/index-7f723686.js +24 -0
  86. package/dist/esm/index-7f723686.js.map +1 -0
  87. package/dist/esm/loader.js +3 -3
  88. package/dist/esm/package-331628f1.js +5 -0
  89. package/dist/esm/package-331628f1.js.map +1 -0
  90. package/dist/esm/post-alert.entry.js +101 -0
  91. package/dist/esm/post-alert.entry.js.map +1 -0
  92. package/dist/esm/post-collapsible.entry.js +5 -4
  93. package/dist/esm/post-collapsible.entry.js.map +1 -1
  94. package/dist/esm/post-components.js +3 -3
  95. package/dist/esm/post-icon.entry.js +7 -16
  96. package/dist/esm/post-icon.entry.js.map +1 -1
  97. package/dist/esm/post-tab-header.entry.js +4 -4
  98. package/dist/esm/post-tab-header.entry.js.map +1 -1
  99. package/dist/esm/post-tab-panel.entry.js +2 -2
  100. package/dist/esm/post-tabs.entry.js +29 -15
  101. package/dist/esm/post-tabs.entry.js.map +1 -1
  102. package/dist/esm/post-tooltip.entry.js +5093 -0
  103. package/dist/esm/post-tooltip.entry.js.map +1 -0
  104. package/dist/post-components/p-0d37fe44.entry.js +2 -0
  105. package/dist/post-components/p-0d37fe44.entry.js.map +1 -0
  106. package/dist/post-components/p-123bb6fb.entry.js +2 -0
  107. package/dist/post-components/p-123bb6fb.entry.js.map +1 -0
  108. package/dist/post-components/p-15fc087f.js +2 -0
  109. package/dist/post-components/p-15fc087f.js.map +1 -0
  110. package/dist/post-components/p-65a9d1c2.entry.js +2 -0
  111. package/dist/post-components/p-7240ae7b.entry.js +2 -0
  112. package/dist/post-components/p-7240ae7b.entry.js.map +1 -0
  113. package/dist/post-components/p-75a7b352.js +2 -0
  114. package/dist/post-components/p-75a7b352.js.map +1 -0
  115. package/dist/post-components/p-8c386036.entry.js +9 -0
  116. package/dist/post-components/p-8c386036.entry.js.map +1 -0
  117. package/dist/post-components/p-97a064da.entry.js +2 -0
  118. package/dist/post-components/{p-6dad6a8a.entry.js.map → p-97a064da.entry.js.map} +1 -1
  119. package/dist/post-components/p-bcc705f1.js +2 -0
  120. package/dist/post-components/p-bcc705f1.js.map +1 -0
  121. package/dist/post-components/p-ccae1c68.entry.js +2 -0
  122. package/dist/post-components/p-ccae1c68.entry.js.map +1 -0
  123. package/dist/post-components/p-d94db268.js +3 -0
  124. package/dist/post-components/p-d94db268.js.map +1 -0
  125. package/dist/post-components/p-e5306504.js +2 -0
  126. package/dist/post-components/p-e5306504.js.map +1 -0
  127. package/dist/post-components/p-eb3ff4dc.js +2 -0
  128. package/dist/post-components/post-components.esm.js +1 -1
  129. package/dist/post-components/post-components.esm.js.map +1 -1
  130. package/dist/types/components/post-alert/alert-types.d.ts +2 -0
  131. package/dist/types/components/post-alert/post-alert.d.ts +49 -0
  132. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -0
  133. package/dist/types/components/post-tooltip/post-tooltip.d.ts +66 -0
  134. package/dist/types/components/post-tooltip/types.d.ts +2 -0
  135. package/dist/types/components.d.ts +115 -0
  136. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
  137. package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -0
  138. package/dist/types/utils/property-checkers/index.d.ts +3 -1
  139. package/package.json +12 -8
  140. package/dist/cjs/check-type-f24cf91d.js.map +0 -1
  141. package/dist/cjs/index-50d7d035.js.map +0 -1
  142. package/dist/cjs/package-e8a6597e.js +0 -7
  143. package/dist/cjs/package-e8a6597e.js.map +0 -1
  144. package/dist/esm/check-type-67411ed3.js.map +0 -1
  145. package/dist/esm/index-cc0e53f0.js.map +0 -1
  146. package/dist/esm/package-b514d0f6.js +0 -5
  147. package/dist/esm/package-b514d0f6.js.map +0 -1
  148. package/dist/post-components/p-1388585d.entry.js +0 -2
  149. package/dist/post-components/p-1388585d.entry.js.map +0 -1
  150. package/dist/post-components/p-58916755.js +0 -2
  151. package/dist/post-components/p-5b3445dc.entry.js +0 -2
  152. package/dist/post-components/p-5b3445dc.entry.js.map +0 -1
  153. package/dist/post-components/p-6341b9b4.js +0 -3
  154. package/dist/post-components/p-6341b9b4.js.map +0 -1
  155. package/dist/post-components/p-6dad6a8a.entry.js +0 -2
  156. package/dist/post-components/p-b95ec099.entry.js +0 -2
  157. package/dist/post-components/p-cc92afb7.entry.js +0 -2
  158. package/dist/post-components/p-cc92afb7.entry.js.map +0 -1
  159. package/dist/post-components/p-f549b3fc.js +0 -2
  160. package/dist/post-components/p-f549b3fc.js.map +0 -1
  161. /package/dist/post-components/{p-b95ec099.entry.js.map → p-65a9d1c2.entry.js.map} +0 -0
  162. /package/dist/post-components/{p-58916755.js.map → p-eb3ff4dc.js.map} +0 -0
@@ -0,0 +1,49 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { AlertType } from './alert-types';
3
+ export declare class PostAlert {
4
+ host: HTMLPostAlertElement;
5
+ alertId: `${string}-${string}-${string}-${string}-${string}`;
6
+ classes: string;
7
+ hasActions: boolean;
8
+ hasHeading: boolean;
9
+ onDismissButtonClick: () => Promise<void>;
10
+ /**
11
+ * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.
12
+ */
13
+ readonly dismissible: boolean;
14
+ validateDismissible(isDismissible?: boolean): void;
15
+ /**
16
+ * The label to use for the close button of a dismissible alert.
17
+ */
18
+ readonly dismissLabel: string;
19
+ validateDismissLabel(dismissLabel?: string): void;
20
+ /**
21
+ * If `true`, the alert is positioned at the bottom of the window, from edge to edge.
22
+ */
23
+ readonly fixed: boolean;
24
+ validateFixed(isFixed?: boolean): void;
25
+ /**
26
+ * The icon to display in the alert. By default, the icon depends on the alert type.
27
+ *
28
+ * If `none`, no icon is displayed.
29
+ */
30
+ readonly icon: string;
31
+ validateIcon(icon?: string): void;
32
+ /**
33
+ * The type of the alert.
34
+ */
35
+ readonly type: AlertType;
36
+ validateType(type?: "info" | "success" | "primary" | "danger" | "warning" | "gray"): void;
37
+ /**
38
+ * An event emitted when the alert element is dismissed, after the transition.
39
+ * It has no payload and only relevant for dismissible alerts.
40
+ */
41
+ dismissed: EventEmitter<void>;
42
+ connectedCallback(): void;
43
+ componentWillRender(): void;
44
+ /**
45
+ * Triggers alert dismissal programmatically (same as clicking on the close button (×)).
46
+ */
47
+ dismiss(): Promise<void>;
48
+ render(): any;
49
+ }
@@ -30,5 +30,6 @@ export declare class PostTabs {
30
30
  private hidePanel;
31
31
  private showSelectedPanel;
32
32
  private getPanel;
33
+ private navigateTabs;
33
34
  render(): any;
34
35
  }
@@ -0,0 +1,66 @@
1
+ import { Placement } from '@floating-ui/dom';
2
+ import '@oddbird/popover-polyfill';
3
+ import 'long-press-event';
4
+ import { BackgroundColor } from './types';
5
+ export declare class PostTooltip {
6
+ private tooltipRef;
7
+ private arrowRef;
8
+ private clearAutoUpdate;
9
+ private readonly localShowTooltip;
10
+ private readonly localHideTooltip;
11
+ private readonly localToggleTooltip;
12
+ private eventTarget;
13
+ host: HTMLPostTooltipElement;
14
+ tooltipClasses: string;
15
+ /**
16
+ * Defines the background color of the tooltip.
17
+ * Choose the one that provides the best contrast in your scenario.
18
+ */
19
+ readonly backgroundColor?: BackgroundColor;
20
+ /**
21
+ * Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
22
+ * Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
23
+ * towards the viewport if they would overlap edge boundaries.
24
+ */
25
+ readonly placement?: Placement;
26
+ validateBackgroundColor(newValue?: "primary" | "yellow"): void;
27
+ constructor();
28
+ componentWillLoad(): void;
29
+ connectedCallback(): void;
30
+ /**
31
+ * Remove a bunch of event listeners if the tooltip gets removed from the DOM
32
+ */
33
+ disconnectedCallback(): void;
34
+ componentDidLoad(): boolean;
35
+ /**
36
+ * Programmatically display the tooltip
37
+ * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
38
+ */
39
+ show(target: HTMLElement): Promise<void>;
40
+ /**
41
+ * Programmatically hide this tooltip
42
+ */
43
+ hide(): Promise<void>;
44
+ /**
45
+ * Toggle tooltip display
46
+ * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
47
+ * @param force Pass true to always show or false to always hide
48
+ */
49
+ toggle(target: HTMLElement, force?: boolean): Promise<void>;
50
+ private get triggers();
51
+ private patchPopoverTargetActionInterest;
52
+ /**
53
+ * Start or stop auto updates based on tooltip events.
54
+ * Tooltips can be closed or opened with other methods than class members,
55
+ * therefore listening to the toggle event is safer for cleaning up.
56
+ * @param e ToggleEvent
57
+ */
58
+ private handleToggle;
59
+ /**
60
+ * Start listening for DOM updates, scroll events etc. that have
61
+ * an influence on tooltip positioning
62
+ */
63
+ private startAutoupdates;
64
+ private positionTooltip;
65
+ render(): any;
66
+ }
@@ -0,0 +1,2 @@
1
+ export declare const BACKGROUND_COLOR: readonly ["primary", "yellow"];
2
+ export type BackgroundColor = (typeof BACKGROUND_COLOR)[number];
@@ -5,7 +5,39 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { AlertType } from "./components/post-alert/alert-types";
9
+ import { BackgroundColor } from "./components/post-tooltip/types";
10
+ import { Placement } from "@floating-ui/dom";
11
+ export { AlertType } from "./components/post-alert/alert-types";
12
+ export { BackgroundColor } from "./components/post-tooltip/types";
13
+ export { Placement } from "@floating-ui/dom";
8
14
  export namespace Components {
15
+ interface PostAlert {
16
+ /**
17
+ * Triggers alert dismissal programmatically (same as clicking on the close button (×)).
18
+ */
19
+ "dismiss": () => Promise<void>;
20
+ /**
21
+ * The label to use for the close button of a dismissible alert.
22
+ */
23
+ "dismissLabel": string;
24
+ /**
25
+ * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.
26
+ */
27
+ "dismissible": boolean;
28
+ /**
29
+ * If `true`, the alert is positioned at the bottom of the window, from edge to edge.
30
+ */
31
+ "fixed": boolean;
32
+ /**
33
+ * The icon to display in the alert. By default, the icon depends on the alert type. If `none`, no icon is displayed.
34
+ */
35
+ "icon": string;
36
+ /**
37
+ * The type of the alert.
38
+ */
39
+ "type": AlertType;
40
+ }
9
41
  interface PostCollapsible {
10
42
  /**
11
43
  * If `true`, the element is initially collapsed otherwise it is displayed.
@@ -75,12 +107,47 @@ export namespace Components {
75
107
  */
76
108
  "show": (panelName: string) => Promise<void>;
77
109
  }
110
+ interface PostTooltip {
111
+ /**
112
+ * Defines the background color of the tooltip. Choose the one that provides the best contrast in your scenario.
113
+ */
114
+ "backgroundColor"?: BackgroundColor;
115
+ /**
116
+ * Programmatically hide this tooltip
117
+ */
118
+ "hide": () => Promise<void>;
119
+ /**
120
+ * Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement. Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.
121
+ */
122
+ "placement"?: Placement;
123
+ /**
124
+ * Programmatically display the tooltip
125
+ * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
126
+ */
127
+ "show": (target: HTMLElement) => Promise<void>;
128
+ /**
129
+ * Toggle tooltip display
130
+ * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
131
+ * @param force Pass true to always show or false to always hide
132
+ */
133
+ "toggle": (target: HTMLElement, force?: boolean) => Promise<void>;
134
+ }
135
+ }
136
+ export interface PostAlertCustomEvent<T> extends CustomEvent<T> {
137
+ detail: T;
138
+ target: HTMLPostAlertElement;
78
139
  }
79
140
  export interface PostTabsCustomEvent<T> extends CustomEvent<T> {
80
141
  detail: T;
81
142
  target: HTMLPostTabsElement;
82
143
  }
83
144
  declare global {
145
+ interface HTMLPostAlertElement extends Components.PostAlert, HTMLStencilElement {
146
+ }
147
+ var HTMLPostAlertElement: {
148
+ prototype: HTMLPostAlertElement;
149
+ new (): HTMLPostAlertElement;
150
+ };
84
151
  interface HTMLPostCollapsibleElement extends Components.PostCollapsible, HTMLStencilElement {
85
152
  }
86
153
  var HTMLPostCollapsibleElement: {
@@ -114,15 +181,49 @@ declare global {
114
181
  prototype: HTMLPostTabsElement;
115
182
  new (): HTMLPostTabsElement;
116
183
  };
184
+ interface HTMLPostTooltipElement extends Components.PostTooltip, HTMLStencilElement {
185
+ }
186
+ var HTMLPostTooltipElement: {
187
+ prototype: HTMLPostTooltipElement;
188
+ new (): HTMLPostTooltipElement;
189
+ };
117
190
  interface HTMLElementTagNameMap {
191
+ "post-alert": HTMLPostAlertElement;
118
192
  "post-collapsible": HTMLPostCollapsibleElement;
119
193
  "post-icon": HTMLPostIconElement;
120
194
  "post-tab-header": HTMLPostTabHeaderElement;
121
195
  "post-tab-panel": HTMLPostTabPanelElement;
122
196
  "post-tabs": HTMLPostTabsElement;
197
+ "post-tooltip": HTMLPostTooltipElement;
123
198
  }
124
199
  }
125
200
  declare namespace LocalJSX {
201
+ interface PostAlert {
202
+ /**
203
+ * The label to use for the close button of a dismissible alert.
204
+ */
205
+ "dismissLabel"?: string;
206
+ /**
207
+ * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.
208
+ */
209
+ "dismissible"?: boolean;
210
+ /**
211
+ * If `true`, the alert is positioned at the bottom of the window, from edge to edge.
212
+ */
213
+ "fixed"?: boolean;
214
+ /**
215
+ * The icon to display in the alert. By default, the icon depends on the alert type. If `none`, no icon is displayed.
216
+ */
217
+ "icon"?: string;
218
+ /**
219
+ * An event emitted when the alert element is dismissed, after the transition. It has no payload and only relevant for dismissible alerts.
220
+ */
221
+ "onDismissed"?: (event: PostAlertCustomEvent<void>) => void;
222
+ /**
223
+ * The type of the alert.
224
+ */
225
+ "type"?: AlertType;
226
+ }
126
227
  interface PostCollapsible {
127
228
  /**
128
229
  * If `true`, the element is initially collapsed otherwise it is displayed.
@@ -188,18 +289,31 @@ declare namespace LocalJSX {
188
289
  */
189
290
  "onTabChange"?: (event: PostTabsCustomEvent<HTMLPostTabPanelElement['name']>) => void;
190
291
  }
292
+ interface PostTooltip {
293
+ /**
294
+ * Defines the background color of the tooltip. Choose the one that provides the best contrast in your scenario.
295
+ */
296
+ "backgroundColor"?: BackgroundColor;
297
+ /**
298
+ * Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement. Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.
299
+ */
300
+ "placement"?: Placement;
301
+ }
191
302
  interface IntrinsicElements {
303
+ "post-alert": PostAlert;
192
304
  "post-collapsible": PostCollapsible;
193
305
  "post-icon": PostIcon;
194
306
  "post-tab-header": PostTabHeader;
195
307
  "post-tab-panel": PostTabPanel;
196
308
  "post-tabs": PostTabs;
309
+ "post-tooltip": PostTooltip;
197
310
  }
198
311
  }
199
312
  export { LocalJSX as JSX };
200
313
  declare module "@stencil/core" {
201
314
  export namespace JSX {
202
315
  interface IntrinsicElements {
316
+ "post-alert": LocalJSX.PostAlert & JSXBase.HTMLAttributes<HTMLPostAlertElement>;
203
317
  "post-collapsible": LocalJSX.PostCollapsible & JSXBase.HTMLAttributes<HTMLPostCollapsibleElement>;
204
318
  /**
205
319
  * @class PostIcon - representing a stencil component
@@ -208,6 +322,7 @@ declare module "@stencil/core" {
208
322
  "post-tab-header": LocalJSX.PostTabHeader & JSXBase.HTMLAttributes<HTMLPostTabHeaderElement>;
209
323
  "post-tab-panel": LocalJSX.PostTabPanel & JSXBase.HTMLAttributes<HTMLPostTabPanelElement>;
210
324
  "post-tabs": LocalJSX.PostTabs & JSXBase.HTMLAttributes<HTMLPostTabsElement>;
325
+ "post-tooltip": LocalJSX.PostTooltip & JSXBase.HTMLAttributes<HTMLPostTooltipElement>;
211
326
  }
212
327
  }
213
328
  }
@@ -1 +1 @@
1
- export declare function checkOneOf<T>(value: T, possibleValues: T[], error: string): void;
1
+ export declare function checkOneOf<T>(value: T, possibleValues: readonly T[], error: string): void;
@@ -0,0 +1 @@
1
+ export declare function checkPattern(value: unknown, pattern: RegExp, errorMessage: string): void;
@@ -1,5 +1,7 @@
1
- export declare const checkEmptyOrOneOf: <T>(value: T, possibleValues: T[], error: string) => void;
1
+ export declare const checkEmptyOrOneOf: <T>(value: T, possibleValues: readonly T[], error: string) => void;
2
+ export declare const checkEmptyOrPattern: (value: unknown, pattern: RegExp, errorMessage: string) => void;
2
3
  export declare const checkEmptyOrType: (value: unknown, type: import("./check-type").PropertyType, error: string) => void;
3
4
  export * from './check-non-empty';
4
5
  export * from './check-one-of';
6
+ export * from './check-pattern';
5
7
  export * from './check-type';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
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": "loader/index.cjs.js",
@@ -24,28 +24,32 @@
24
24
  "linkDirectory": true
25
25
  },
26
26
  "dependencies": {
27
+ "@floating-ui/dom": "1.5.1",
28
+ "@oddbird/popover-polyfill": "0.2.2",
27
29
  "@stencil/core": "3.4.2",
28
- "@swisspost/design-system-styles": "6.4.0"
30
+ "@swisspost/design-system-styles": "6.4.2",
31
+ "ally.js": "1.4.1",
32
+ "long-press-event": "2.4.6"
29
33
  },
30
34
  "devDependencies": {
31
- "@percy/cli": "1.26.3",
35
+ "@percy/cli": "1.27.2",
32
36
  "@percy/cypress": "3.1.2",
33
- "@stencil-community/eslint-plugin": "^0.5.0",
37
+ "@stencil-community/eslint-plugin": "0.5.0",
34
38
  "@stencil/react-output-target": "0.5.3",
35
39
  "@stencil/sass": "3.0.5",
36
40
  "@types/jest": "27.5.2",
37
41
  "@typescript-eslint/eslint-plugin": "5.62.0",
38
42
  "@typescript-eslint/parser": "5.62.0",
39
- "bootstrap": "5.3.1",
40
- "cypress": "12.17.4",
43
+ "bootstrap": "5.3.2",
44
+ "cypress": "13.2.0",
41
45
  "cypress-storybook": "0.5.1",
42
- "eslint": "8.48.0",
46
+ "eslint": "8.50.0",
43
47
  "eslint-plugin-react": "7.33.2",
44
48
  "jest": "27.5.1",
45
49
  "jest-cli": "27.5.1",
46
50
  "npm-run-all": "4.1.5",
47
51
  "rimraf": "5.0.1",
48
- "sass": "1.66.1",
52
+ "sass": "1.68.0",
49
53
  "typescript": "4.9.5"
50
54
  },
51
55
  "scripts": {
@@ -1 +0,0 @@
1
- {"file":"check-type-f24cf91d.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}