@swisspost/design-system-components 1.3.10 → 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-non-empty-35b4d0b5.js +14 -0
- package/dist/cjs/check-non-empty-35b4d0b5.js.map +1 -0
- package/dist/cjs/check-one-of-4c2e8b2e.js +10 -0
- package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
- package/dist/cjs/{package-f6bb523d.js → check-type-508a21a5.js} +1 -10
- 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-272283b3.js → index-12cc37c9.js} +121 -5
- package/dist/{post-components/p-0096c140.js.map → cjs/index-12cc37c9.js.map} +1 -1
- 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 +6 -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 +14 -29
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +35 -0
- package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +29 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +136 -0
- package/dist/cjs/post-tabs.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
- package/dist/collection/animations/fade.js +6 -0
- package/dist/collection/animations/fade.js.map +1 -0
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/index.js.map +1 -0
- package/dist/collection/collection-manifest.json +6 -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-tab-header/post-tab-header.css +337 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js +68 -0
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.css +3 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +55 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -0
- package/dist/collection/components/post-tabs/post-tabs.css +148 -0
- package/dist/collection/components/post-tabs/post-tabs.js +208 -0
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -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-non-empty.js +11 -0
- package/dist/components/check-non-empty.js.map +1 -0
- package/dist/components/check-one-of.js +8 -0
- package/dist/components/check-one-of.js.map +1 -0
- package/dist/{esm/package-bcf00737.js → components/check-type.js} +2 -9
- package/dist/components/check-type.js.map +1 -0
- package/dist/components/fade.js +9 -0
- package/dist/components/fade.js.map +1 -0
- package/dist/components/package.js +2 -20
- package/dist/components/package.js.map +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 +3 -1
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-icon.js +1 -141
- 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-tab-header.d.ts +11 -0
- package/dist/components/post-tab-header.js +52 -0
- package/dist/components/post-tab-header.js.map +1 -0
- package/dist/components/post-tab-panel.d.ts +11 -0
- package/dist/components/post-tab-panel.js +46 -0
- package/dist/components/post-tab-panel.js.map +1 -0
- package/dist/components/post-tabs.d.ts +11 -0
- package/dist/components/post-tabs.js +153 -0
- package/dist/components/post-tabs.js.map +1 -0
- 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 +441 -1
- package/dist/esm/check-non-empty-554bdf88.js +11 -0
- package/dist/esm/check-non-empty-554bdf88.js.map +1 -0
- 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-18ebb4e7.js +16 -0
- 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-60a84798.js → index-5611074b.js} +121 -6
- 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 -2
- 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 -21
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-tab-header.entry.js +31 -0
- package/dist/esm/post-tab-header.entry.js.map +1 -0
- package/dist/esm/post-tab-panel.entry.js +25 -0
- package/dist/esm/post-tab-panel.entry.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +132 -0
- package/dist/esm/post-tabs.entry.js.map +1 -0
- 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-99ccf0cf.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-24b07f64.js.map +1 -0
- package/dist/post-components/p-29535fea.entry.js +2 -0
- package/dist/post-components/p-29535fea.entry.js.map +1 -0
- 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-c7497ecb.entry.js +2 -0
- package/dist/post-components/p-c7497ecb.entry.js.map +1 -0
- package/dist/post-components/p-c8efe0ae.js +2 -0
- package/dist/post-components/p-c8efe0ae.js.map +1 -0
- 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/animations/fade.d.ts +2 -0
- package/dist/types/animations/index.d.ts +1 -0
- 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-tab-header/post-tab-header.d.ts +11 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +10 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +34 -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 +190 -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 +13 -9
- package/dist/cjs/index-272283b3.js.map +0 -1
- package/dist/cjs/package-f6bb523d.js.map +0 -1
- package/dist/esm/index-60a84798.js.map +0 -1
- package/dist/esm/package-bcf00737.js.map +0 -1
- package/dist/post-components/p-0096c140.js +0 -3
- package/dist/post-components/p-4a3ff4c0.js +0 -2
- package/dist/post-components/p-4a3ff4c0.js.map +0 -1
- package/dist/post-components/p-99ccf0cf.entry.js +0 -2
- package/dist/post-components/p-cafa0281.entry.js +0 -2
- package/dist/post-components/p-cafa0281.entry.js.map +0 -1
|
@@ -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,11 @@
|
|
|
1
|
+
export declare class PostTabHeader {
|
|
2
|
+
host: HTMLPostTabHeaderElement;
|
|
3
|
+
tabId: string;
|
|
4
|
+
/**
|
|
5
|
+
* The name of the panel controlled by the tab header.
|
|
6
|
+
*/
|
|
7
|
+
readonly panel: HTMLPostTabPanelElement['name'];
|
|
8
|
+
validateFor(newValue: HTMLPostTabPanelElement['name']): void;
|
|
9
|
+
componentWillLoad(): void;
|
|
10
|
+
render(): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class PostTabs {
|
|
3
|
+
private activeTab;
|
|
4
|
+
private showing;
|
|
5
|
+
private hiding;
|
|
6
|
+
private isLoaded;
|
|
7
|
+
private get tabs();
|
|
8
|
+
host: HTMLPostTabsElement;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the panel that is initially shown.
|
|
11
|
+
* If not specified, it defaults to the panel associated with the first tab.
|
|
12
|
+
*
|
|
13
|
+
* **Changing this value after initialization has no effect.**
|
|
14
|
+
*/
|
|
15
|
+
readonly activePanel: HTMLPostTabPanelElement['name'];
|
|
16
|
+
/**
|
|
17
|
+
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.
|
|
18
|
+
* The payload is the name of the newly shown panel.
|
|
19
|
+
*/
|
|
20
|
+
tabChange: EventEmitter<HTMLPostTabPanelElement['name']>;
|
|
21
|
+
componentDidLoad(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the panel with the given name and selects its associated tab.
|
|
24
|
+
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
25
|
+
*/
|
|
26
|
+
show(panelName: string): Promise<void>;
|
|
27
|
+
private moveMisplacedTabs;
|
|
28
|
+
private enableTabs;
|
|
29
|
+
private activateTab;
|
|
30
|
+
private hidePanel;
|
|
31
|
+
private showSelectedPanel;
|
|
32
|
+
private getPanel;
|
|
33
|
+
render(): any;
|
|
34
|
+
}
|
|
@@ -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.
|
|
@@ -53,8 +85,69 @@ export namespace Components {
|
|
|
53
85
|
*/
|
|
54
86
|
"scale"?: number | null;
|
|
55
87
|
}
|
|
88
|
+
interface PostTabHeader {
|
|
89
|
+
/**
|
|
90
|
+
* The name of the panel controlled by the tab header.
|
|
91
|
+
*/
|
|
92
|
+
"panel": HTMLPostTabPanelElement['name'];
|
|
93
|
+
}
|
|
94
|
+
interface PostTabPanel {
|
|
95
|
+
/**
|
|
96
|
+
* The name of the panel, used to associate it with a tab header.
|
|
97
|
+
*/
|
|
98
|
+
"name": string;
|
|
99
|
+
}
|
|
100
|
+
interface PostTabs {
|
|
101
|
+
/**
|
|
102
|
+
* The name of the panel that is initially shown. If not specified, it defaults to the panel associated with the first tab. **Changing this value after initialization has no effect.**
|
|
103
|
+
*/
|
|
104
|
+
"activePanel": HTMLPostTabPanelElement['name'];
|
|
105
|
+
/**
|
|
106
|
+
* Shows the panel with the given name and selects its associated tab. Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
107
|
+
*/
|
|
108
|
+
"show": (panelName: string) => Promise<void>;
|
|
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;
|
|
139
|
+
}
|
|
140
|
+
export interface PostTabsCustomEvent<T> extends CustomEvent<T> {
|
|
141
|
+
detail: T;
|
|
142
|
+
target: HTMLPostTabsElement;
|
|
56
143
|
}
|
|
57
144
|
declare global {
|
|
145
|
+
interface HTMLPostAlertElement extends Components.PostAlert, HTMLStencilElement {
|
|
146
|
+
}
|
|
147
|
+
var HTMLPostAlertElement: {
|
|
148
|
+
prototype: HTMLPostAlertElement;
|
|
149
|
+
new (): HTMLPostAlertElement;
|
|
150
|
+
};
|
|
58
151
|
interface HTMLPostCollapsibleElement extends Components.PostCollapsible, HTMLStencilElement {
|
|
59
152
|
}
|
|
60
153
|
var HTMLPostCollapsibleElement: {
|
|
@@ -70,12 +163,67 @@ declare global {
|
|
|
70
163
|
prototype: HTMLPostIconElement;
|
|
71
164
|
new (): HTMLPostIconElement;
|
|
72
165
|
};
|
|
166
|
+
interface HTMLPostTabHeaderElement extends Components.PostTabHeader, HTMLStencilElement {
|
|
167
|
+
}
|
|
168
|
+
var HTMLPostTabHeaderElement: {
|
|
169
|
+
prototype: HTMLPostTabHeaderElement;
|
|
170
|
+
new (): HTMLPostTabHeaderElement;
|
|
171
|
+
};
|
|
172
|
+
interface HTMLPostTabPanelElement extends Components.PostTabPanel, HTMLStencilElement {
|
|
173
|
+
}
|
|
174
|
+
var HTMLPostTabPanelElement: {
|
|
175
|
+
prototype: HTMLPostTabPanelElement;
|
|
176
|
+
new (): HTMLPostTabPanelElement;
|
|
177
|
+
};
|
|
178
|
+
interface HTMLPostTabsElement extends Components.PostTabs, HTMLStencilElement {
|
|
179
|
+
}
|
|
180
|
+
var HTMLPostTabsElement: {
|
|
181
|
+
prototype: HTMLPostTabsElement;
|
|
182
|
+
new (): HTMLPostTabsElement;
|
|
183
|
+
};
|
|
184
|
+
interface HTMLPostTooltipElement extends Components.PostTooltip, HTMLStencilElement {
|
|
185
|
+
}
|
|
186
|
+
var HTMLPostTooltipElement: {
|
|
187
|
+
prototype: HTMLPostTooltipElement;
|
|
188
|
+
new (): HTMLPostTooltipElement;
|
|
189
|
+
};
|
|
73
190
|
interface HTMLElementTagNameMap {
|
|
191
|
+
"post-alert": HTMLPostAlertElement;
|
|
74
192
|
"post-collapsible": HTMLPostCollapsibleElement;
|
|
75
193
|
"post-icon": HTMLPostIconElement;
|
|
194
|
+
"post-tab-header": HTMLPostTabHeaderElement;
|
|
195
|
+
"post-tab-panel": HTMLPostTabPanelElement;
|
|
196
|
+
"post-tabs": HTMLPostTabsElement;
|
|
197
|
+
"post-tooltip": HTMLPostTooltipElement;
|
|
76
198
|
}
|
|
77
199
|
}
|
|
78
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
|
+
}
|
|
79
227
|
interface PostCollapsible {
|
|
80
228
|
/**
|
|
81
229
|
* If `true`, the element is initially collapsed otherwise it is displayed.
|
|
@@ -119,20 +267,62 @@ declare namespace LocalJSX {
|
|
|
119
267
|
*/
|
|
120
268
|
"scale"?: number | null;
|
|
121
269
|
}
|
|
270
|
+
interface PostTabHeader {
|
|
271
|
+
/**
|
|
272
|
+
* The name of the panel controlled by the tab header.
|
|
273
|
+
*/
|
|
274
|
+
"panel"?: HTMLPostTabPanelElement['name'];
|
|
275
|
+
}
|
|
276
|
+
interface PostTabPanel {
|
|
277
|
+
/**
|
|
278
|
+
* The name of the panel, used to associate it with a tab header.
|
|
279
|
+
*/
|
|
280
|
+
"name"?: string;
|
|
281
|
+
}
|
|
282
|
+
interface PostTabs {
|
|
283
|
+
/**
|
|
284
|
+
* The name of the panel that is initially shown. If not specified, it defaults to the panel associated with the first tab. **Changing this value after initialization has no effect.**
|
|
285
|
+
*/
|
|
286
|
+
"activePanel"?: HTMLPostTabPanelElement['name'];
|
|
287
|
+
/**
|
|
288
|
+
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished. The payload is the name of the newly shown panel.
|
|
289
|
+
*/
|
|
290
|
+
"onTabChange"?: (event: PostTabsCustomEvent<HTMLPostTabPanelElement['name']>) => void;
|
|
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
|
+
}
|
|
122
302
|
interface IntrinsicElements {
|
|
303
|
+
"post-alert": PostAlert;
|
|
123
304
|
"post-collapsible": PostCollapsible;
|
|
124
305
|
"post-icon": PostIcon;
|
|
306
|
+
"post-tab-header": PostTabHeader;
|
|
307
|
+
"post-tab-panel": PostTabPanel;
|
|
308
|
+
"post-tabs": PostTabs;
|
|
309
|
+
"post-tooltip": PostTooltip;
|
|
125
310
|
}
|
|
126
311
|
}
|
|
127
312
|
export { LocalJSX as JSX };
|
|
128
313
|
declare module "@stencil/core" {
|
|
129
314
|
export namespace JSX {
|
|
130
315
|
interface IntrinsicElements {
|
|
316
|
+
"post-alert": LocalJSX.PostAlert & JSXBase.HTMLAttributes<HTMLPostAlertElement>;
|
|
131
317
|
"post-collapsible": LocalJSX.PostCollapsible & JSXBase.HTMLAttributes<HTMLPostCollapsibleElement>;
|
|
132
318
|
/**
|
|
133
319
|
* @class PostIcon - representing a stencil component
|
|
134
320
|
*/
|
|
135
321
|
"post-icon": LocalJSX.PostIcon & JSXBase.HTMLAttributes<HTMLPostIconElement>;
|
|
322
|
+
"post-tab-header": LocalJSX.PostTabHeader & JSXBase.HTMLAttributes<HTMLPostTabHeaderElement>;
|
|
323
|
+
"post-tab-panel": LocalJSX.PostTabPanel & JSXBase.HTMLAttributes<HTMLPostTabPanelElement>;
|
|
324
|
+
"post-tabs": LocalJSX.PostTabs & JSXBase.HTMLAttributes<HTMLPostTabsElement>;
|
|
325
|
+
"post-tooltip": LocalJSX.PostTooltip & JSXBase.HTMLAttributes<HTMLPostTooltipElement>;
|
|
136
326
|
}
|
|
137
327
|
}
|
|
138
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.
|
|
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.
|
|
43
|
-
"eslint-plugin-react": "7.33.
|
|
46
|
+
"eslint": "8.50.0",
|
|
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": {
|