@swisspost/design-system-components 1.4.0 → 1.5.0
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/check-one-of-4c2e8b2e.js +10 -0
- package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
- package/dist/cjs/{check-type-f24cf91d.js → check-type-508a21a5.js} +1 -7
- package/dist/cjs/check-type-508a21a5.js.map +1 -0
- package/dist/cjs/fade-8c6d4fa7.js +12 -0
- package/dist/cjs/fade-8c6d4fa7.js.map +1 -0
- package/dist/cjs/{index-50d7d035.js → index-12cc37c9.js} +107 -5
- package/dist/cjs/index-12cc37c9.js.map +1 -0
- package/dist/cjs/index-f8f6f146.js +28 -0
- package/dist/cjs/index-f8f6f146.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-67091813.js +7 -0
- package/dist/cjs/package-67091813.js.map +1 -0
- package/dist/cjs/post-alert.cjs.entry.js +106 -0
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +5 -4
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-icon.cjs.entry.js +11 -20
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +5 -10
- package/dist/cjs/post-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/post-alert/alert-types.js +2 -0
- package/dist/collection/components/post-alert/alert-types.js.map +1 -0
- package/dist/collection/components/post-alert/post-alert.css +563 -0
- package/dist/collection/components/post-alert/post-alert.js +256 -0
- package/dist/collection/components/post-alert/post-alert.js.map +1 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +7 -0
- package/dist/collection/components/post-tooltip/post-tooltip.css +194 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js +338 -0
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -0
- package/dist/collection/components/post-tooltip/types.js +2 -0
- package/dist/collection/components/post-tooltip/types.js.map +1 -0
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +5 -0
- package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -0
- package/dist/collection/utils/property-checkers/index.js +3 -0
- package/dist/collection/utils/property-checkers/index.js.map +1 -1
- package/dist/components/check-one-of.js +8 -0
- package/dist/components/check-one-of.js.map +1 -0
- package/dist/components/check-type.js +1 -6
- package/dist/components/check-type.js.map +1 -1
- package/dist/components/fade.js +9 -0
- package/dist/components/fade.js.map +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-alert.d.ts +11 -0
- package/dist/components/post-alert.js +136 -0
- package/dist/components/post-alert.js.map +1 -0
- package/dist/components/post-collapsible.js +2 -1
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +1 -135
- package/dist/components/post-icon.js.map +1 -1
- package/dist/components/post-icon2.js +146 -0
- package/dist/components/post-icon2.js.map +1 -0
- package/dist/components/post-tabs.js +1 -6
- package/dist/components/post-tabs.js.map +1 -1
- package/dist/components/post-tooltip.d.ts +11 -0
- package/dist/components/post-tooltip.js +5118 -0
- package/dist/components/post-tooltip.js.map +1 -0
- package/dist/docs.json +313 -3
- package/dist/esm/check-one-of-ded5e15e.js +8 -0
- package/dist/esm/check-one-of-ded5e15e.js.map +1 -0
- package/dist/esm/{check-type-67411ed3.js → check-type-18ebb4e7.js} +2 -7
- package/dist/esm/check-type-18ebb4e7.js.map +1 -0
- package/dist/esm/fade-671f1489.js +9 -0
- package/dist/esm/fade-671f1489.js.map +1 -0
- package/dist/esm/{index-cc0e53f0.js → index-5611074b.js} +107 -5
- package/dist/esm/index-5611074b.js.map +1 -0
- package/dist/esm/index-7f723686.js +24 -0
- package/dist/esm/index-7f723686.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-f5cb3167.js +5 -0
- package/dist/esm/package-f5cb3167.js.map +1 -0
- package/dist/esm/post-alert.entry.js +102 -0
- package/dist/esm/post-alert.entry.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +4 -3
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-icon.entry.js +6 -15
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +3 -8
- package/dist/esm/post-tabs.entry.js.map +1 -1
- package/dist/esm/post-tooltip.entry.js +5093 -0
- package/dist/esm/post-tooltip.entry.js.map +1 -0
- package/dist/post-components/p-12046db8.entry.js +2 -0
- package/dist/post-components/{p-6dad6a8a.entry.js.map → p-12046db8.entry.js.map} +1 -1
- package/dist/post-components/p-15fc087f.js +2 -0
- package/dist/post-components/p-15fc087f.js.map +1 -0
- package/dist/post-components/p-24b07f64.js +2 -0
- package/dist/post-components/{p-b95ec099.entry.js → p-29535fea.entry.js} +2 -2
- package/dist/post-components/p-296af738.entry.js +2 -0
- package/dist/post-components/p-296af738.entry.js.map +1 -0
- package/dist/post-components/p-2b6ab354.entry.js +9 -0
- package/dist/post-components/p-2b6ab354.entry.js.map +1 -0
- package/dist/post-components/p-75a7b352.js +2 -0
- package/dist/post-components/p-75a7b352.js.map +1 -0
- package/dist/post-components/p-a14ec7bb.entry.js +2 -0
- package/dist/post-components/p-a14ec7bb.entry.js.map +1 -0
- package/dist/post-components/p-bcc705f1.js +2 -0
- package/dist/post-components/p-bcc705f1.js.map +1 -0
- package/dist/post-components/{p-1388585d.entry.js → p-c7497ecb.entry.js} +2 -2
- package/dist/post-components/p-cc6e4eb8.entry.js +2 -0
- package/dist/post-components/p-cc6e4eb8.entry.js.map +1 -0
- package/dist/post-components/p-d94db268.js +3 -0
- package/dist/post-components/p-d94db268.js.map +1 -0
- package/dist/post-components/p-e5306504.js +2 -0
- package/dist/post-components/p-e5306504.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-alert/alert-types.d.ts +2 -0
- package/dist/types/components/post-alert/post-alert.d.ts +49 -0
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +66 -0
- package/dist/types/components/post-tooltip/types.d.ts +2 -0
- package/dist/types/components.d.ts +115 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -0
- package/dist/types/utils/property-checkers/index.d.ts +3 -1
- package/package.json +12 -8
- package/dist/cjs/check-type-f24cf91d.js.map +0 -1
- package/dist/cjs/index-50d7d035.js.map +0 -1
- package/dist/cjs/package-e8a6597e.js +0 -7
- package/dist/cjs/package-e8a6597e.js.map +0 -1
- package/dist/esm/check-type-67411ed3.js.map +0 -1
- package/dist/esm/index-cc0e53f0.js.map +0 -1
- package/dist/esm/package-b514d0f6.js +0 -5
- package/dist/esm/package-b514d0f6.js.map +0 -1
- package/dist/post-components/p-58916755.js +0 -2
- package/dist/post-components/p-5b3445dc.entry.js +0 -2
- package/dist/post-components/p-5b3445dc.entry.js.map +0 -1
- package/dist/post-components/p-6341b9b4.js +0 -3
- package/dist/post-components/p-6341b9b4.js.map +0 -1
- package/dist/post-components/p-6dad6a8a.entry.js +0 -2
- package/dist/post-components/p-cc92afb7.entry.js +0 -2
- package/dist/post-components/p-cc92afb7.entry.js.map +0 -1
- package/dist/post-components/p-f549b3fc.js +0 -2
- package/dist/post-components/p-f549b3fc.js.map +0 -1
- /package/dist/post-components/{p-58916755.js.map → p-24b07f64.js.map} +0 -0
- /package/dist/post-components/{p-b95ec099.entry.js.map → p-29535fea.entry.js.map} +0 -0
- /package/dist/post-components/{p-1388585d.entry.js.map → p-c7497ecb.entry.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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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.
|
|
3
|
+
"version": "1.5.0",
|
|
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.
|
|
30
|
+
"@swisspost/design-system-styles": "6.4.1",
|
|
31
|
+
"ally.js": "1.4.1",
|
|
32
|
+
"long-press-event": "2.4.6"
|
|
29
33
|
},
|
|
30
34
|
"devDependencies": {
|
|
31
|
-
"@percy/cli": "1.
|
|
35
|
+
"@percy/cli": "1.27.2",
|
|
32
36
|
"@percy/cypress": "3.1.2",
|
|
33
|
-
"@stencil-community/eslint-plugin": "
|
|
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.
|
|
40
|
-
"cypress": "
|
|
43
|
+
"bootstrap": "5.3.2",
|
|
44
|
+
"cypress": "13.2.0",
|
|
41
45
|
"cypress-storybook": "0.5.1",
|
|
42
|
-
"eslint": "8.
|
|
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.
|
|
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}
|