@oiz/stzh-components 3.8.0-beta1 → 3.8.0-beta2
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/{app-globals-02553278.js → app-globals-a393bc30.js} +2 -2
- package/dist/cjs/{app-globals-02553278.js.map → app-globals-a393bc30.js.map} +1 -1
- package/dist/cjs/{axios-69bcb71f.js → axios-bd44344d.js} +51 -96
- package/dist/cjs/axios-bd44344d.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/stzh-accordion_3.cjs.entry.js +2 -7
- package/dist/cjs/stzh-accordion_3.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-bathstatus-list.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chipselect.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chipselect.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +2 -2
- package/dist/cjs/stzh-contact.cjs.entry.js +2 -8
- package/dist/cjs/stzh-contact.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-datalist_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datalist_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-eventdata.cjs.entry.js +1 -1
- package/dist/cjs/stzh-eventdata.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js +2 -2
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +3 -2
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-poilist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-progressbar.cjs.entry.js +23 -0
- package/dist/cjs/stzh-progressbar.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +2 -2
- package/dist/cjs/stzh-search.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +20 -9
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +1 -1
- package/dist/collection/assets/i18n/de.json +9 -5
- package/dist/collection/assets/i18n/en.json +9 -5
- package/dist/collection/components/stzh-accordion/stzh-accordion.e2e.js +1 -0
- package/dist/collection/components/stzh-accordion/stzh-accordion.e2e.js.map +1 -1
- package/dist/collection/components/stzh-accordion/stzh-accordion.stories.js +86 -0
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +2 -7
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js.map +1 -1
- package/dist/collection/components/stzh-button/stzh-button.e2e.js +6 -3
- package/dist/collection/components/stzh-button/stzh-button.e2e.js.map +1 -1
- package/dist/collection/components/stzh-button/stzh-button.stories.js +200 -15
- package/dist/collection/components/stzh-chip/stzh-chip.stories.js +11 -0
- package/dist/collection/components/stzh-chipselect/stzh-chipselect.css +1 -6
- package/dist/collection/components/stzh-contact/stzh-contact.css +8 -0
- package/dist/collection/components/stzh-contact/stzh-contact.js +1 -7
- package/dist/collection/components/stzh-contact/stzh-contact.js.map +1 -1
- package/dist/collection/components/stzh-datalist/stzh-datalist.e2e.js +1 -0
- package/dist/collection/components/stzh-datalist/stzh-datalist.e2e.js.map +1 -1
- package/dist/collection/components/stzh-datalist/stzh-datalist.stories.js +32 -0
- package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +2 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +8 -1
- package/dist/collection/components/stzh-dropdown/stzh-dropdown.stories.js +107 -5
- package/dist/collection/components/stzh-eventdata/stzh-eventdata.css +0 -5
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js +2 -2
- package/dist/collection/components/stzh-geo-ref-data/stzh-geo-ref-data.js.map +1 -1
- package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js +3 -2
- package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js.map +1 -1
- package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +27 -2
- package/dist/collection/components/stzh-progressbar/stzh-progressbar.js.map +1 -1
- package/dist/collection/components/stzh-search/stzh-search.js +1 -1
- package/dist/collection/components/stzh-search/stzh-search.js.map +1 -1
- package/dist/collection/components/stzh-search/stzh-search.stories.js +51 -83
- package/dist/collection/components/stzh-skiplink/stzh-skiplink.stories.js +0 -1
- package/dist/collection/components/stzh-upload/models/stzh-photographing-url-details.dto.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.css +5 -0
- package/dist/collection/components/stzh-upload/stzh-upload.js +23 -9
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.localization.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.stories.js +3 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-16892790.js → p-345a1e99.js} +51 -96
- package/dist/components/p-345a1e99.js.map +1 -0
- package/dist/components/{p-82c163e4.js → p-47601c6a.js} +2 -2
- package/dist/components/{p-82c163e4.js.map → p-47601c6a.js.map} +1 -1
- package/dist/components/{p-ed75de26.js → p-4fec83e3.js} +2 -2
- package/dist/components/{p-ed75de26.js.map → p-4fec83e3.js.map} +1 -1
- package/dist/components/{p-3890d846.js → p-5efa3e34.js} +2 -2
- package/dist/components/p-5efa3e34.js.map +1 -0
- package/dist/components/{p-2a870524.js → p-6c754f8f.js} +3 -8
- package/dist/components/p-6c754f8f.js.map +1 -0
- package/dist/components/{p-3aefa2e3.js → p-6e8c91f8.js} +3 -3
- package/dist/components/{p-3aefa2e3.js.map → p-6e8c91f8.js.map} +1 -1
- package/dist/components/{p-c9ddf923.js → p-8ed7a61b.js} +2 -2
- package/dist/components/{p-c9ddf923.js.map → p-8ed7a61b.js.map} +1 -1
- package/dist/components/{p-e0e4416e.js → p-ebbe78de.js} +2 -2
- package/dist/components/p-ebbe78de.js.map +1 -0
- package/dist/components/stzh-accordion-item.js +1 -1
- package/dist/components/stzh-amount.js +1 -1
- package/dist/components/stzh-appointments.js +3 -3
- package/dist/components/stzh-bathstatus-list.js +1 -1
- package/dist/components/stzh-calendar.js +1 -1
- package/dist/components/stzh-card-searchresult.js +2 -2
- package/dist/components/stzh-card-superteaser.js +2 -2
- package/dist/components/stzh-chipselect.js +1 -1
- package/dist/components/stzh-contact.js +2 -8
- package/dist/components/stzh-contact.js.map +1 -1
- package/dist/components/stzh-datalist-item.js +1 -1
- package/dist/components/stzh-datalist.js +1 -1
- package/dist/components/stzh-datatable.js +4 -4
- package/dist/components/stzh-datepicker.js +1 -1
- package/dist/components/stzh-dropdown.js +1 -1
- package/dist/components/stzh-eventdata.js +1 -1
- package/dist/components/stzh-eventdata.js.map +1 -1
- package/dist/components/stzh-geo-ref-data.js +3 -3
- package/dist/components/stzh-geo-ref-data.js.map +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +4 -3
- package/dist/components/stzh-microsite-teaserlist.js.map +1 -1
- package/dist/components/stzh-monthyearpicker.js +1 -1
- package/dist/components/stzh-panorama.js +1 -1
- package/dist/components/stzh-poilist.js +2 -2
- package/dist/components/stzh-progressbar.js +26 -2
- package/dist/components/stzh-progressbar.js.map +1 -1
- package/dist/components/stzh-search.js +4 -4
- package/dist/components/stzh-search.js.map +1 -1
- package/dist/components/stzh-sitemap.js +2 -2
- package/dist/components/stzh-timepicker.js +1 -1
- package/dist/components/stzh-upload.js +23 -9
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/components/stzh-vbz-majorticker.js +1 -1
- package/dist/components/stzh-vbz-ticker.js +1 -1
- package/dist/esm/{app-globals-30dc1fec.js → app-globals-6ab4a484.js} +2 -2
- package/dist/esm/{app-globals-30dc1fec.js.map → app-globals-6ab4a484.js.map} +1 -1
- package/dist/esm/{axios-e0a35239.js → axios-0cc95004.js} +51 -96
- package/dist/esm/axios-0cc95004.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-accordion_3.entry.js +2 -7
- package/dist/esm/stzh-accordion_3.entry.js.map +1 -1
- package/dist/esm/stzh-bathstatus-list.entry.js +1 -1
- package/dist/esm/stzh-chipselect.entry.js +1 -1
- package/dist/esm/stzh-chipselect.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-contact.entry.js +2 -8
- package/dist/esm/stzh-contact.entry.js.map +1 -1
- package/dist/esm/stzh-datalist_2.entry.js +1 -1
- package/dist/esm/stzh-datalist_2.entry.js.map +1 -1
- package/dist/esm/stzh-dropdown.entry.js +1 -1
- package/dist/esm/stzh-dropdown.entry.js.map +1 -1
- package/dist/esm/stzh-eventdata.entry.js +1 -1
- package/dist/esm/stzh-eventdata.entry.js.map +1 -1
- package/dist/esm/stzh-geo-ref-data.entry.js +2 -2
- package/dist/esm/stzh-geo-ref-data.entry.js.map +1 -1
- package/dist/esm/stzh-microsite-teaserlist.entry.js +3 -2
- package/dist/esm/stzh-microsite-teaserlist.entry.js.map +1 -1
- package/dist/esm/stzh-poilist.entry.js +1 -1
- package/dist/esm/stzh-progressbar.entry.js +24 -1
- package/dist/esm/stzh-progressbar.entry.js.map +1 -1
- package/dist/esm/stzh-search.entry.js +2 -2
- package/dist/esm/stzh-search.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +20 -9
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/esm/stzh-vbz-majorticker.entry.js +1 -1
- package/dist/esm/stzh-vbz-ticker.entry.js +1 -1
- package/dist/stzh-components/assets/i18n/de.json +9 -5
- package/dist/stzh-components/assets/i18n/en.json +9 -5
- package/dist/stzh-components/p-129faf7d.entry.js +2 -0
- package/dist/stzh-components/p-129faf7d.entry.js.map +1 -0
- package/dist/stzh-components/{p-68dee00d.entry.js → p-23678dfc.entry.js} +2 -2
- package/dist/stzh-components/{p-68dee00d.entry.js.map → p-23678dfc.entry.js.map} +1 -1
- package/dist/stzh-components/p-345a1e99.js +2 -0
- package/dist/stzh-components/p-345a1e99.js.map +1 -0
- package/dist/stzh-components/{p-e5a451a0.entry.js → p-646958e0.entry.js} +2 -2
- package/dist/stzh-components/{p-ef38e1fe.entry.js → p-6f9626d1.entry.js} +2 -2
- package/dist/stzh-components/p-6f9626d1.entry.js.map +1 -0
- package/dist/stzh-components/{p-64ba89a2.js → p-7036f004.js} +2 -2
- package/dist/stzh-components/{p-8aab9098.entry.js → p-7c5e34db.entry.js} +2 -2
- package/dist/stzh-components/{p-b2986e24.entry.js → p-809076ff.entry.js} +2 -2
- package/dist/stzh-components/{p-5bafa548.entry.js → p-84f8307b.entry.js} +2 -2
- package/dist/stzh-components/p-84f8307b.entry.js.map +1 -0
- package/dist/stzh-components/{p-7b2bd184.entry.js → p-8856651e.entry.js} +2 -2
- package/dist/stzh-components/{p-7b2bd184.entry.js.map → p-8856651e.entry.js.map} +1 -1
- package/dist/stzh-components/p-8c5fb0e2.entry.js +2 -0
- package/dist/stzh-components/{p-f156650a.entry.js.map → p-8c5fb0e2.entry.js.map} +1 -1
- package/dist/stzh-components/{p-025a5c2e.entry.js → p-a47a14ef.entry.js} +2 -2
- package/dist/stzh-components/p-a47a14ef.entry.js.map +1 -0
- package/dist/stzh-components/p-a71fafbd.entry.js +2 -0
- package/dist/stzh-components/p-a71fafbd.entry.js.map +1 -0
- package/dist/stzh-components/{p-b25e8b20.entry.js → p-c83239a9.entry.js} +2 -2
- package/dist/stzh-components/p-c83239a9.entry.js.map +1 -0
- package/dist/stzh-components/{p-6f0cf6e3.entry.js → p-d97fbf1f.entry.js} +2 -2
- package/dist/stzh-components/p-fa4595c8.entry.js +2 -0
- package/dist/stzh-components/p-fa4595c8.entry.js.map +1 -0
- package/dist/stzh-components/p-fcc75797.entry.js +2 -0
- package/dist/stzh-components/p-fcc75797.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/stzh-components/stzh-components.esm.js.map +1 -1
- package/dist/types/components/stzh-accordion-item/stzh-accordion-item.d.ts +0 -1
- package/dist/types/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.d.ts +2 -2
- package/dist/types/components/stzh-progressbar/stzh-progressbar.d.ts +4 -0
- package/dist/types/components/stzh-upload/models/stzh-photographing-url-details.dto.d.ts +1 -0
- package/dist/types/components/stzh-upload/stzh-upload.d.ts +3 -0
- package/dist/types/components/stzh-upload/stzh-upload.localization.d.ts +2 -0
- package/package.json +9 -5
- package/dist/cjs/axios-69bcb71f.js.map +0 -1
- package/dist/components/p-16892790.js.map +0 -1
- package/dist/components/p-2a870524.js.map +0 -1
- package/dist/components/p-3890d846.js.map +0 -1
- package/dist/components/p-e0e4416e.js.map +0 -1
- package/dist/esm/axios-e0a35239.js.map +0 -1
- package/dist/stzh-components/p-025a5c2e.entry.js.map +0 -1
- package/dist/stzh-components/p-11abc40a.entry.js +0 -2
- package/dist/stzh-components/p-11abc40a.entry.js.map +0 -1
- package/dist/stzh-components/p-16892790.js +0 -2
- package/dist/stzh-components/p-16892790.js.map +0 -1
- package/dist/stzh-components/p-5ac0220a.entry.js +0 -2
- package/dist/stzh-components/p-5ac0220a.entry.js.map +0 -1
- package/dist/stzh-components/p-5bafa548.entry.js.map +0 -1
- package/dist/stzh-components/p-95427be2.entry.js +0 -2
- package/dist/stzh-components/p-95427be2.entry.js.map +0 -1
- package/dist/stzh-components/p-973c5df2.entry.js +0 -2
- package/dist/stzh-components/p-973c5df2.entry.js.map +0 -1
- package/dist/stzh-components/p-b25e8b20.entry.js.map +0 -1
- package/dist/stzh-components/p-ef38e1fe.entry.js.map +0 -1
- package/dist/stzh-components/p-f156650a.entry.js +0 -2
- /package/dist/stzh-components/{p-e5a451a0.entry.js.map → p-646958e0.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-64ba89a2.js.map → p-7036f004.js.map} +0 -0
- /package/dist/stzh-components/{p-8aab9098.entry.js.map → p-7c5e34db.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-b2986e24.entry.js.map → p-809076ff.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-6f0cf6e3.entry.js.map → p-d97fbf1f.entry.js.map} +0 -0
|
@@ -3,12 +3,18 @@ import { withActions } from '@storybook/addon-actions/decorator';
|
|
|
3
3
|
import readme from './readme.md?raw';
|
|
4
4
|
import { getFigmaLink } from '../../../figma';
|
|
5
5
|
import { fullwidthCentered } from '../../utils/decorators';
|
|
6
|
+
import { userEvent, waitFor } from "@storybook/testing-library";
|
|
7
|
+
import { expect } from '@storybook/jest';
|
|
8
|
+
import { getComponentByTestId, expectIsVisuallyHidden } from "../../../.storybook/utils/component-test-utils";
|
|
6
9
|
|
|
7
10
|
const COMPONENT_NAME = 'stzh-button';
|
|
8
11
|
const story = createComponentStory(COMPONENT_NAME);
|
|
9
12
|
|
|
13
|
+
const BUTTON_TEST_ID = 'BUTTON_TEST_ID';
|
|
14
|
+
let stzhButtonEl;
|
|
15
|
+
|
|
10
16
|
const TEMPLATE = `
|
|
11
|
-
<stzh-button></stzh-button>
|
|
17
|
+
<stzh-button data-testid="${BUTTON_TEST_ID}"></stzh-button>
|
|
12
18
|
`;
|
|
13
19
|
|
|
14
20
|
export default {
|
|
@@ -39,55 +45,234 @@ export const Default = {
|
|
|
39
45
|
render: (args) => story(args, TEMPLATE),
|
|
40
46
|
args: {
|
|
41
47
|
label: 'Button Text',
|
|
48
|
+
name: 'buttonName',
|
|
49
|
+
id: 'buttonId'
|
|
50
|
+
},
|
|
51
|
+
play: async ({ canvasElement, step }) => {
|
|
52
|
+
|
|
53
|
+
let eventDetail;
|
|
54
|
+
|
|
55
|
+
await step('Assert properties', async () => {
|
|
56
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
57
|
+
|
|
58
|
+
expect(stzhButtonEl).toHaveAttribute('label', 'Button Text');
|
|
59
|
+
expect(stzhButtonEl).toHaveAttribute('name', 'buttonName');
|
|
60
|
+
expect(stzhButtonEl).toHaveAttribute('id', 'buttonId');
|
|
61
|
+
expect(stzhButtonEl).toHaveAttribute('variant', 'default');
|
|
62
|
+
expect(stzhButtonEl).toHaveAttribute('text-align', 'default');
|
|
63
|
+
expect(stzhButtonEl).toHaveAttribute('size', 'default');
|
|
64
|
+
expect(stzhButtonEl).toHaveAttribute('tabindex', '-1');
|
|
65
|
+
expect(stzhButtonEl).not.toHaveAttribute('active');
|
|
66
|
+
expect(stzhButtonEl).not.toHaveAttribute('effect');
|
|
67
|
+
expect(stzhButtonEl).not.toHaveAttribute('disabled');
|
|
68
|
+
expect(stzhButtonEl).not.toHaveAttribute('href');
|
|
69
|
+
expect(stzhButtonEl).not.toHaveAttribute('rounded');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
await step('Assert stzhClick event details', async () => {
|
|
73
|
+
stzhButtonEl.addEventListener('stzhClick', (ev) => {
|
|
74
|
+
eventDetail = ev.detail;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const buttonEl = stzhButtonEl.querySelector('button');
|
|
78
|
+
await userEvent.click(buttonEl);
|
|
79
|
+
// component is stzh-button
|
|
80
|
+
expect(eventDetail).toHaveProperty('component', 'stzh-button');
|
|
81
|
+
// href is empty
|
|
82
|
+
expect(eventDetail).toHaveProperty('href', '');
|
|
83
|
+
// originalEvent is PointerEvent
|
|
84
|
+
expect(eventDetail.originalEvent).toHaveProperty('type', 'click');
|
|
85
|
+
});
|
|
42
86
|
},
|
|
43
87
|
};
|
|
44
88
|
|
|
45
|
-
export const
|
|
89
|
+
export const SecondaryWithIcon = {
|
|
46
90
|
render: (args) => story(args, TEMPLATE),
|
|
47
91
|
args: {
|
|
48
92
|
label: 'Button Text',
|
|
49
|
-
'
|
|
93
|
+
icon: 'filtering',
|
|
94
|
+
variant: 'secondary',
|
|
95
|
+
},
|
|
96
|
+
play: async ({ canvasElement, step }) => {
|
|
97
|
+
await step('Assert properties', async () => {
|
|
98
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
99
|
+
|
|
100
|
+
expect(stzhButtonEl).toHaveAttribute('variant', 'secondary');
|
|
101
|
+
expect(stzhButtonEl).toHaveAttribute('icon', 'filtering');
|
|
102
|
+
expect(stzhButtonEl).toHaveAttribute('icon-position', 'left');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
await step('Child component stzh-icon exists and is visible', async () => {
|
|
106
|
+
const stzhIconEl = stzhButtonEl.querySelector('stzh-icon');
|
|
107
|
+
expect(stzhIconEl).not.toBeNull();
|
|
108
|
+
expect(window.getComputedStyle(stzhIconEl).display).not.toBe('none');
|
|
109
|
+
});
|
|
50
110
|
},
|
|
51
111
|
};
|
|
52
112
|
|
|
53
|
-
export const
|
|
113
|
+
export const IconOnly = {
|
|
54
114
|
render: (args) => story(args, TEMPLATE),
|
|
55
115
|
args: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
116
|
+
'icon-only': true,
|
|
117
|
+
icon: 'filtering',
|
|
118
|
+
label: 'Icon Button'
|
|
119
|
+
},
|
|
120
|
+
play: async ({ canvasElement, step }) => {
|
|
121
|
+
|
|
122
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
123
|
+
|
|
124
|
+
await step('Assert properties', async () => {
|
|
125
|
+
expect(stzhButtonEl).toHaveProperty('label', 'Icon Button');
|
|
126
|
+
expect(stzhButtonEl).toHaveAttribute('icon-position', 'left');
|
|
127
|
+
expect(stzhButtonEl).toHaveAttribute('icon-only', 'true');
|
|
128
|
+
expect(stzhButtonEl).toHaveAttribute('icon', 'filtering');
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
await step('Label is visually hidden', async () => {
|
|
132
|
+
stzhButtonEl = canvasElement.querySelector(`[data-testid=${BUTTON_TEST_ID}]`);
|
|
133
|
+
|
|
134
|
+
const labelContainer = stzhButtonEl.querySelector('div.stzh-button__text');
|
|
135
|
+
await expect(labelContainer).not.toBeNull();
|
|
136
|
+
expectIsVisuallyHidden(labelContainer);
|
|
137
|
+
});
|
|
59
138
|
},
|
|
60
139
|
};
|
|
61
140
|
|
|
62
|
-
export const
|
|
141
|
+
export const Tertiary = {
|
|
63
142
|
render: (args) => story(args, TEMPLATE),
|
|
64
143
|
args: {
|
|
65
|
-
label: 'Button
|
|
66
|
-
|
|
144
|
+
label: 'Tertiary Button',
|
|
145
|
+
variant: 'tertiary',
|
|
146
|
+
active: true // ToDo: With PDESI-1507, this tests shouldn't fail anymore
|
|
147
|
+
},
|
|
148
|
+
tags: ['!test'],
|
|
149
|
+
play: async ({ canvasElement, step }) => {
|
|
150
|
+
|
|
151
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
152
|
+
|
|
153
|
+
await step('Assert properties', async () => {
|
|
154
|
+
expect(stzhButtonEl).toHaveProperty('label', 'Tertiary Button');
|
|
155
|
+
expect(stzhButtonEl).toHaveAttribute('variant', 'tertiary');
|
|
156
|
+
expect(stzhButtonEl).toHaveAttribute('size', 'default');
|
|
157
|
+
expect(stzhButtonEl).toHaveAttribute('active');
|
|
158
|
+
expect(stzhButtonEl).not.toHaveAttribute('active', 'false');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
await step('Background is transparent (fix with PDESI-1507)', async () => {
|
|
162
|
+
const buttonEl = stzhButtonEl.querySelector('button');
|
|
163
|
+
const computedStyle = window.getComputedStyle(buttonEl);
|
|
164
|
+
const backgroundColor = computedStyle.backgroundColor;
|
|
165
|
+
expect(backgroundColor).toBe('rgba(0, 0, 0, 0)');
|
|
166
|
+
});
|
|
67
167
|
},
|
|
68
168
|
};
|
|
69
169
|
|
|
70
|
-
export const
|
|
170
|
+
export const TertiaryPlain = {
|
|
71
171
|
render: (args) => story(args, TEMPLATE),
|
|
72
172
|
args: {
|
|
73
|
-
'
|
|
74
|
-
|
|
173
|
+
label: 'Tertiary Plain Button',
|
|
174
|
+
variant: 'tertiary-plain',
|
|
175
|
+
},
|
|
176
|
+
play: async ({ canvasElement, step }) => {
|
|
177
|
+
|
|
178
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
179
|
+
|
|
180
|
+
await step('Assert properties', async () => {
|
|
181
|
+
expect(stzhButtonEl).toHaveAttribute('variant', 'tertiary-plain');
|
|
182
|
+
});
|
|
75
183
|
},
|
|
76
184
|
};
|
|
77
185
|
|
|
78
|
-
export const
|
|
186
|
+
export const AsLink = {
|
|
79
187
|
render: (args) => story(args, TEMPLATE),
|
|
80
188
|
args: {
|
|
81
189
|
label: 'Button Text',
|
|
190
|
+
href: 'https://www.stadt-zuerich.ch/',
|
|
191
|
+
target: '_blank',
|
|
192
|
+
},
|
|
193
|
+
play: async ({ canvasElement, step }) => {
|
|
194
|
+
|
|
195
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
196
|
+
|
|
197
|
+
await step('Assert properties', async () => {
|
|
198
|
+
expect(stzhButtonEl).toHaveAttribute('href', 'https://www.stadt-zuerich.ch/');
|
|
199
|
+
expect(stzhButtonEl).toHaveAttribute('target', '_blank');
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
await step('Instead of button, there is an a element with href and target attributes', async () => {
|
|
203
|
+
const aEl = stzhButtonEl.querySelector('a.stzh-button');
|
|
204
|
+
const buttonEl = stzhButtonEl.querySelector('button.stzh-button');
|
|
205
|
+
expect(buttonEl).toBe(null);
|
|
206
|
+
expect(aEl).toHaveAttribute('href', 'https://www.stadt-zuerich.ch/');
|
|
207
|
+
expect(aEl).toHaveAttribute('target', '_blank');
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const CTA = {
|
|
213
|
+
render: (args) => story(args, TEMPLATE),
|
|
214
|
+
args: {
|
|
215
|
+
label: 'Call-To-Action Button',
|
|
82
216
|
effect: 'cta',
|
|
83
217
|
icon: 'arrow-right',
|
|
84
218
|
'icon-position': 'right',
|
|
85
219
|
},
|
|
220
|
+
play: async ({ canvasElement, step }) => {
|
|
221
|
+
|
|
222
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
223
|
+
|
|
224
|
+
await step('Assert properties', async () => {
|
|
225
|
+
expect(stzhButtonEl).toHaveAttribute('effect', 'cta');
|
|
226
|
+
expect(stzhButtonEl).toHaveAttribute('icon-position', 'right');
|
|
227
|
+
});
|
|
228
|
+
},
|
|
86
229
|
};
|
|
87
230
|
|
|
88
|
-
export const
|
|
231
|
+
export const DisableOnClick = {
|
|
89
232
|
render: (args) => story(args, TEMPLATE),
|
|
90
233
|
args: {
|
|
234
|
+
label: 'Button Text',
|
|
235
|
+
'disable-on-click': true,
|
|
236
|
+
},
|
|
237
|
+
play: async ({ canvasElement, step }) => {
|
|
238
|
+
|
|
239
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
240
|
+
let eventDetail;
|
|
241
|
+
|
|
242
|
+
await step('Assert properties', async () => {
|
|
243
|
+
expect(stzhButtonEl).toHaveAttribute('disable-on-click', 'true');
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
await step('Click sets disabled property', async () => {
|
|
247
|
+
stzhButtonEl.addEventListener('stzhClick', (ev) => {
|
|
248
|
+
eventDetail = ev.detail;
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
expect(stzhButtonEl).not.toHaveAttribute('disabled');
|
|
252
|
+
|
|
253
|
+
const buttonEl = stzhButtonEl.querySelector('button');
|
|
254
|
+
await userEvent.click(buttonEl);
|
|
255
|
+
|
|
256
|
+
await waitFor(() => expect(stzhButtonEl).toHaveAttribute('disabled'), {
|
|
257
|
+
timeout: 1000,
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const RoundedLongText = {
|
|
264
|
+
render: (args) => story(args, TEMPLATE),
|
|
265
|
+
args: {
|
|
266
|
+
rounded: true,
|
|
91
267
|
label: 'Laboris laborum aute id laboris culpa esse aliquip nisi anim velit',
|
|
92
268
|
},
|
|
269
|
+
play: async ({ canvasElement, step }) => {
|
|
270
|
+
|
|
271
|
+
stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
|
|
272
|
+
|
|
273
|
+
await step('Assert properties', async () => {
|
|
274
|
+
expect(stzhButtonEl).toHaveAttribute('rounded');
|
|
275
|
+
expect(stzhButtonEl).toHaveAttribute('label', 'Laboris laborum aute id laboris culpa esse aliquip nisi anim velit');
|
|
276
|
+
});
|
|
277
|
+
},
|
|
93
278
|
};
|
|
@@ -45,6 +45,17 @@ export const Filter = {
|
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
export const FilterLarge = {
|
|
49
|
+
render: (args) => story(args, TEMPLATE),
|
|
50
|
+
args: {
|
|
51
|
+
variant: 'filter',
|
|
52
|
+
label: 'Topic Tag',
|
|
53
|
+
size: 'large',
|
|
54
|
+
counter: '00',
|
|
55
|
+
icon: 'bulleted-list',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
export const Tag = {
|
|
49
60
|
render: (args) => story(args, TEMPLATE),
|
|
50
61
|
args: {
|
|
@@ -264,12 +264,7 @@
|
|
|
264
264
|
align-items: center;
|
|
265
265
|
flex-wrap: wrap;
|
|
266
266
|
border-radius: var(--stzh-button-border-radius);
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
@media screen and (min-width: 900px) {
|
|
270
|
-
.stzh-chipselect__chips {
|
|
271
|
-
row-gap: var(--stzh-space-medium);
|
|
272
|
-
}
|
|
267
|
+
gap: var(--stzh-space-medium);
|
|
273
268
|
}
|
|
274
269
|
.stzh-chipselect__chips:focus-within .is-focused[active] {
|
|
275
270
|
--background-color: var(--stzh-color-primary90);
|
|
@@ -196,6 +196,14 @@
|
|
|
196
196
|
height: 100%;
|
|
197
197
|
object-fit: cover;
|
|
198
198
|
}
|
|
199
|
+
@media screen and (min-width: 900px) {
|
|
200
|
+
:host[has-availability=false] {
|
|
201
|
+
--grid-template-areas: var(
|
|
202
|
+
--stzh-contact-grid-template-areas,
|
|
203
|
+
"heading heading heading heading heading heading heading heading" "image image image image . . . ." "info info info info info info info info" "additional additional additional additional additional additional additional additional"
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
199
207
|
|
|
200
208
|
:host[image-position=left] {
|
|
201
209
|
--grid-template-areas: var(
|
|
@@ -49,12 +49,6 @@ export class StzhContact {
|
|
|
49
49
|
else {
|
|
50
50
|
this._availability = newValue;
|
|
51
51
|
}
|
|
52
|
-
// if (this._availability) {
|
|
53
|
-
// this._availabilityDataItems = this._availability.map((item) => ({
|
|
54
|
-
// value: item.hours.join(' | '),
|
|
55
|
-
// label: item.weekday
|
|
56
|
-
// }));
|
|
57
|
-
// }
|
|
58
52
|
}
|
|
59
53
|
numbersWatcher(newValue) {
|
|
60
54
|
if (typeof newValue === "string") {
|
|
@@ -121,7 +115,7 @@ export class StzhContact {
|
|
|
121
115
|
const HeadingLevel = `h${this.headingLevel}`;
|
|
122
116
|
const NameHeadingLevel = this.nameHeadingLevel ? `h${this.nameHeadingLevel}` : "div";
|
|
123
117
|
const AvailabilityTitleElement = `h${this.availabilityTitleLevel}`;
|
|
124
|
-
return (h(Host, { "image-position": this.imagePosition }, h("div", { class: classes, itemscope: true, itemtype: `http://schema.org/${this.type}` }, h("div", { class: "stzh-contact__main-heading", itemprop: (this.type === "Organization" && !this.heading) || (this.type === "Person" && !this.name) ? "name" : null }, this.mainHeading ? (h("stzh-heading", { level: this.mainHeadingLevel }, this.mainHeading)) : (h("slot", { name: "main-heading" }))), h("div", { class: "stzh-contact__image-wrapper" }, h("div", { class: "stzh-contact__image" }, h("slot", { name: "image" }))), h("div", { class: "stzh-contact__info" }, this.heading && (h(HeadingLevel, { class: "stzh-contact__heading", itemprop: this.type === "Organization" || !this.name ? "name" : null, innerHTML: this.heading })), this.name && (h(NameHeadingLevel, { class: {
|
|
118
|
+
return (h(Host, { "image-position": this.imagePosition, "has-availability": !!this.availability ? 'true' : 'false' }, h("div", { class: classes, itemscope: true, itemtype: `http://schema.org/${this.type}` }, h("div", { class: "stzh-contact__main-heading", itemprop: (this.type === "Organization" && !this.heading) || (this.type === "Person" && !this.name) ? "name" : null }, this.mainHeading ? (h("stzh-heading", { level: this.mainHeadingLevel }, this.mainHeading)) : (h("slot", { name: "main-heading" }))), h("div", { class: "stzh-contact__image-wrapper" }, h("div", { class: "stzh-contact__image" }, h("slot", { name: "image" }))), h("div", { class: "stzh-contact__info" }, this.heading && (h(HeadingLevel, { class: "stzh-contact__heading", itemprop: this.type === "Organization" || !this.name ? "name" : null, innerHTML: this.heading })), this.name && (h(NameHeadingLevel, { class: {
|
|
125
119
|
"stzh-contact__name": true,
|
|
126
120
|
"is-heading": this.nameHeadingLevel !== "",
|
|
127
121
|
}, itemprop: this.type === "Person" ? "name" : null }, this.name)), h("div", { class: "stzh-contact__address", itemprop: "address", itemscope: true, itemtype: "http://schema.org/PostalAddress", innerHTML: this.address }, !this.address && (h(Fragment, null, this._street.length > 0 && (h("div", { class: "stzh-contact__street", itemprop: "streetAddress" }, this._street.map((street) => (h(Fragment, null, street, h("br", null)))), this._streetInfo.length > 0 && (h(Fragment, null, h("br", null), " ", this._streetInfo.map((streetInfo) => (h(Fragment, null, streetInfo, h("br", null)))))))), this.postalCode && (h("span", { class: "stzh-contact__postal-code", itemprop: "postalCode" }, this.postalCode, "\u00A0")), this.location && (h("span", { class: "stzh-contact__locality", itemprop: "addressLocality" }, this.location)), h("slot", { name: "address" })))), this._numbers.length > 0 && (h("div", { class: "stzh-contact__numbers" }, this._numbers.map(number => (h("div", { class: "stzh-contact__number" }, h("span", null, number.label, "\u00A0"), h("stzh-link", { size: "inherit", height: "auto", class: "stzh-contact__number-link", href: `${number.type}:${formatTel(number.number)}`, analyticsId: number.analyticsId || `${number.label} ${number.number}`, itemprop: number.type === "fax" ? "faxNumber" : "telephone" }, number.number)))))), this._emails.length > 0 && (h("div", { class: "stzh-contact__emails" }, this._emails.map(email => (h("div", { class: "stzh-contact__email" }, h("span", null, email.label, "\u00A0"), email.href ? (h("stzh-link", { size: "inherit", height: "auto", class: "stzh-container__email-link", href: `mailto:${email.href}`, analyticsId: email.analyticsId || `${email.label} ${email.text}`, itemprop: "email" }, email.text)) : (h("span", { class: "stzh-container__email-link", itemprop: "email" }, email.text))))))), h("div", { class: "stzh-contact__pobox", innerHTML: this.pobox }, !this.pobox && (h(Fragment, null, this.poboxHeading && h("div", { class: "stzh-contact__pobox-heading" }, this.poboxHeading), this.poboxTitle && h("div", { class: "stzh-contact__pobox-title" }, this.poboxTitle), this.poboxPostalCode && (h("span", { class: "stzh-contact__pobox-postal-code" }, this.poboxPostalCode, "\u00A0")), this.poboxLocation && h("span", { class: "stzh-contact__pobox-locality" }, this.poboxLocation), h("slot", { name: "pobox" }))))), this.availability && (h("div", { class: "stzh-contact__availability" }, this.availabilityTitle && (h(AvailabilityTitleElement, { class: "stzh-contact__availability-title" }, this.availabilityTitle)), this._availability.length > 0 && (h("ul", { class: "stzh-contact__availability-list" }, this._availability.map(item => (h("li", { class: "stzh-contact__availability-list-item" }, h("div", { class: "stzh-contact__availability-weekday" }, item.weekday), item.hours.length > 0 && (h("div", { class: "stzh-contact__availability-hours" }, item.hours.map((hour, index) => (h(Fragment, null, h("div", { class: "stzh-contact__availability-hour" }, hour), index < item.hours.length - 1 && (h("div", { class: "stzh-contact__availability-hours-separator" })))))))))))))), h("div", { class: "stzh-contact__additional" }, h("slot", null)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-contact.js","sourceRoot":"","sources":["../../../../src/components/stzh-contact/stzh-contact.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, h, Host, Prop, Watch } from \"@stencil/core\";\n\nimport { ContactEmail, ContactNumber, StzhContactAvailabilityItem } from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nfunction formatTel(tel: string) {\n return tel.replace(/\\s/g, \"\");\n}\n\n/**\n * @slot main-heading - slot for main heading\n * @slot image - slot for image\n * @slot address - slot for address (alternative for `address` property or separate properties `street`, `streetInfo`, `postalCode` & `location`)\n * @slot pobox - slot for pobox (alternative for `pobox` property or separate properties `poboxHeading`, `poboxTitle`, `poboxPostalCode` & `poboxLocation`)\n * @slot slot for additional (e.g. accordion with contact form, map or datalist)\n */\n@Component({\n tag: \"stzh-contact\",\n styleUrl: \"stzh-contact.scss\",\n scoped: true,\n})\nexport class StzhContact {\n /** Type */\n @Prop() type: \"Organization\" | \"Person\" = \"Organization\";\n\n /** Main heading */\n @Prop() mainHeading: string;\n\n /** Main heading level */\n @Prop() mainHeadingLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"2\";\n\n /** Heading */\n @Prop() heading: string;\n\n /** Heading level */\n @Prop() headingLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"3\";\n\n /** Name */\n @Prop() name: string;\n\n /** Name heading level */\n @Prop() nameHeadingLevel: \"\" | \"1\" | \"2\" | \"3\" | \"4\" = \"\";\n\n /** Address (alternative for address slot or separate properties `street`, `streetInfo`, `postalCode` & `location`) */\n @Prop() address: string;\n\n /** Street */\n @Prop() street: string | string[];\n private _street: string[] = [];\n\n /** Additional street info */\n @Prop() streetInfo: string | string[];\n private _streetInfo: string[] = [];\n\n /** Postal code */\n @Prop() postalCode: string;\n\n /** Location / city */\n @Prop() location: string;\n\n /** Location / city */\n @Prop() imagePosition: \"left\" | \"top\" = \"top\";\n\n /**\n * Numbers\n * Array of objects that can include the attributes `type` = `tel`|`fax`, `label`, `number`\n * and optionally `analyticsId` for setting `s-object-id` to the link element\n * (for Adobe Analytics, default value is `label` and `number`).\n */\n @Prop() numbers: ContactNumber[] | string = [];\n private _numbers: ContactNumber[] = [];\n\n /**\n * Numbers\n * Array of objects that can include the attributes `label`, `number`, `text`, `href`\n * and optionally `analyticsId` for setting `s-object-id` to the link element\n * (for Adobe Analytics, default value is `label` and `text`).\n */\n @Prop() emails: ContactEmail[] | string = [];\n private _emails: ContactEmail[] = [];\n\n /** Pobox (alternative for pobox slot or separate properties `poboxHeading`, `poboxTitle`, `poboxPostalCode` & `poboxLocation`) */\n @Prop() pobox: string;\n\n /** Post office box heading */\n @Prop() poboxHeading: string;\n\n /** Post office box title */\n @Prop() poboxTitle: string;\n\n /** Post office box postal code */\n @Prop() poboxPostalCode: string;\n\n /** Post office box location / city */\n @Prop() poboxLocation: string;\n\n /** Availability title */\n @Prop() availabilityTitle: string;\n\n /** Availability title level */\n @Prop() availabilityTitleLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"3\";\n\n /** Availability times */\n @Prop() availability: string | StzhContactAvailabilityItem[];\n private _availability: StzhContactAvailabilityItem[] = [];\n\n // private _availabilityDataItems: StzhDatalistItemEntry[] = [];\n\n @Watch(\"availability\")\n availabilityWatcher(newValue: string | StzhContactAvailabilityItem[]) {\n if (typeof newValue === \"string\") {\n this._availability = JSON.parse(newValue);\n } else {\n this._availability = newValue;\n }\n\n // if (this._availability) {\n // this._availabilityDataItems = this._availability.map((item) => ({\n // value: item.hours.join(' | '),\n // label: item.weekday\n // }));\n // }\n }\n\n @Watch(\"numbers\")\n numbersWatcher(newValue: ContactNumber[] | string) {\n if (typeof newValue === \"string\") {\n this._numbers = JSON.parse(newValue);\n } else {\n this._numbers = newValue;\n }\n }\n\n @Watch(\"emails\")\n emailsWatcher(newValue: ContactEmail[] | string) {\n if (typeof newValue === \"string\") {\n this._emails = JSON.parse(newValue);\n } else {\n this._emails = newValue;\n }\n }\n\n @Watch(\"street\")\n streetWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._street = JSON.parse(newValue);\n } catch (noArrayException) {\n this._street = [newValue];\n }\n } else if (newValue) {\n this._street = newValue;\n }\n }\n\n @Watch(\"streetInfo\")\n streetInfoWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._streetInfo = JSON.parse(newValue);\n } catch (noArrayException) {\n this._streetInfo = [newValue];\n }\n } else if (newValue) {\n this._streetInfo = newValue;\n }\n }\n\n @Element() element: HTMLStzhFigureElement;\n\n async componentWillLoad() {\n this.numbersWatcher(this.numbers);\n this.emailsWatcher(this.emails);\n this.availabilityWatcher(this.availability);\n this.streetWatcher(this.street);\n this.streetInfoWatcher(this.streetInfo);\n }\n\n render() {\n const hasImage = hasSlot(this.element, \"image\");\n const hasAddress = !!this.address || hasSlot(this.element, \"address\");\n const hasAddons = hasSlot(this.element, \"addons\");\n const hasLinks = hasSlot(this.element, \"links\");\n\n const classes = {\n \"stzh-contact\": true,\n \"stzh-contact--has-image\": hasImage,\n \"stzh-contact--has-address\": hasAddress,\n \"stzh-contact--has-addons\": hasAddons,\n \"stzh-contact--has-links\": hasLinks,\n [`stzh-contact--image-position-${this.imagePosition}`]: true,\n };\n\n const HeadingLevel = `h${this.headingLevel}`;\n const NameHeadingLevel = this.nameHeadingLevel ? `h${this.nameHeadingLevel}` : \"div\";\n const AvailabilityTitleElement = `h${this.availabilityTitleLevel}`;\n\n return (\n <Host image-position={this.imagePosition}>\n <div class={classes} itemscope itemtype={`http://schema.org/${this.type}`}>\n <div\n class=\"stzh-contact__main-heading\"\n itemprop={\n (this.type === \"Organization\" && !this.heading) || (this.type === \"Person\" && !this.name) ? \"name\" : null\n }\n >\n {this.mainHeading ? (\n <stzh-heading level={this.mainHeadingLevel}>{this.mainHeading}</stzh-heading>\n ) : (\n <slot name=\"main-heading\"></slot>\n )}\n </div>\n\n <div class=\"stzh-contact__image-wrapper\">\n <div class=\"stzh-contact__image\">\n <slot name=\"image\"></slot>\n </div>\n </div>\n\n <div class=\"stzh-contact__info\">\n {this.heading && (\n <HeadingLevel\n class=\"stzh-contact__heading\"\n itemprop={this.type === \"Organization\" || !this.name ? \"name\" : null}\n innerHTML={this.heading}\n ></HeadingLevel>\n )}\n\n {this.name && (\n <NameHeadingLevel\n class={{\n \"stzh-contact__name\": true,\n \"is-heading\": this.nameHeadingLevel !== \"\",\n }}\n itemprop={this.type === \"Person\" ? \"name\" : null}\n >\n {this.name}\n </NameHeadingLevel>\n )}\n\n <div\n class=\"stzh-contact__address\"\n itemprop=\"address\"\n itemscope\n itemtype=\"http://schema.org/PostalAddress\"\n innerHTML={this.address}\n >\n {!this.address && (\n <Fragment>\n {this._street.length > 0 && (\n <div class=\"stzh-contact__street\" itemprop=\"streetAddress\">\n {this._street.map((street: string) => (\n <Fragment>\n {street}\n <br />\n </Fragment>\n ))}\n {this._streetInfo.length > 0 && (\n <Fragment>\n <br />{\" \"}\n {this._streetInfo.map((streetInfo: string) => (\n <Fragment>\n {streetInfo}\n <br />\n </Fragment>\n ))}\n </Fragment>\n )}\n </div>\n )}\n\n {this.postalCode && (\n <span class=\"stzh-contact__postal-code\" itemprop=\"postalCode\">\n {this.postalCode} \n </span>\n )}\n\n {this.location && (\n <span class=\"stzh-contact__locality\" itemprop=\"addressLocality\">\n {this.location}\n </span>\n )}\n\n <slot name=\"address\"></slot>\n </Fragment>\n )}\n </div>\n\n {this._numbers.length > 0 && (\n <div class=\"stzh-contact__numbers\">\n {this._numbers.map(number => (\n <div class=\"stzh-contact__number\">\n <span>{number.label} </span>\n <stzh-link\n size=\"inherit\"\n height=\"auto\"\n class=\"stzh-contact__number-link\"\n href={`${number.type}:${formatTel(number.number)}`}\n analyticsId={number.analyticsId || `${number.label} ${number.number}`}\n itemprop={number.type === \"fax\" ? \"faxNumber\" : \"telephone\"}\n >\n {number.number}\n </stzh-link>\n </div>\n ))}\n </div>\n )}\n\n {this._emails.length > 0 && (\n <div class=\"stzh-contact__emails\">\n {this._emails.map(email => (\n <div class=\"stzh-contact__email\">\n <span>{email.label} </span>\n {email.href ? (\n <stzh-link\n size=\"inherit\"\n height=\"auto\"\n class=\"stzh-container__email-link\"\n href={`mailto:${email.href}`}\n analyticsId={email.analyticsId || `${email.label} ${email.text}`}\n itemprop=\"email\"\n >\n {email.text}\n </stzh-link>\n ) : (\n <span class=\"stzh-container__email-link\" itemprop=\"email\">\n {email.text}\n </span>\n )}\n </div>\n ))}\n </div>\n )}\n\n <div class=\"stzh-contact__pobox\" innerHTML={this.pobox}>\n {!this.pobox && (\n <Fragment>\n {this.poboxHeading && <div class=\"stzh-contact__pobox-heading\">{this.poboxHeading}</div>}\n {this.poboxTitle && <div class=\"stzh-contact__pobox-title\">{this.poboxTitle}</div>}\n {this.poboxPostalCode && (\n <span class=\"stzh-contact__pobox-postal-code\">{this.poboxPostalCode} </span>\n )}\n {this.poboxLocation && <span class=\"stzh-contact__pobox-locality\">{this.poboxLocation}</span>}\n <slot name=\"pobox\"></slot>\n </Fragment>\n )}\n </div>\n </div>\n\n {this.availability && (\n <div class=\"stzh-contact__availability\">\n {this.availabilityTitle && (\n <AvailabilityTitleElement class=\"stzh-contact__availability-title\">\n {this.availabilityTitle}\n </AvailabilityTitleElement>\n )}\n\n {this._availability.length > 0 && (\n <ul class=\"stzh-contact__availability-list\">\n {this._availability.map(item => (\n <li class=\"stzh-contact__availability-list-item\">\n <div class=\"stzh-contact__availability-weekday\">{item.weekday}</div>\n {item.hours.length > 0 && (\n <div class=\"stzh-contact__availability-hours\">\n {item.hours.map((hour, index) => (\n <Fragment>\n <div class=\"stzh-contact__availability-hour\">{hour}</div>\n {index < item.hours.length - 1 && (\n <div class=\"stzh-contact__availability-hours-separator\"></div>\n )}\n </Fragment>\n ))}\n </div>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n\n <div class=\"stzh-contact__additional\">\n <slot></slot>\n </div>\n </div>\n </Host>\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, h, Host, Prop, Watch } from \"@stencil/core\";\n\nimport { ContactEmail, ContactNumber, StzhContactAvailabilityItem } from \"../../index\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nfunction formatTel(tel: string) {\n return tel.replace(/\\s/g, \"\");\n}\n\n/**\n * @slot main-heading - slot for main heading\n * @slot image - slot for image\n * @slot address - slot for address (alternative for `address` property or separate properties `street`, `streetInfo`, `postalCode` & `location`)\n * @slot pobox - slot for pobox (alternative for `pobox` property or separate properties `poboxHeading`, `poboxTitle`, `poboxPostalCode` & `poboxLocation`)\n * @slot slot for additional (e.g. accordion with contact form, map or datalist)\n */\n@Component({\n tag: \"stzh-contact\",\n styleUrl: \"stzh-contact.scss\",\n scoped: true,\n})\nexport class StzhContact {\n /** Type */\n @Prop() type: \"Organization\" | \"Person\" = \"Organization\";\n\n /** Main heading */\n @Prop() mainHeading: string;\n\n /** Main heading level */\n @Prop() mainHeadingLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"2\";\n\n /** Heading */\n @Prop() heading: string;\n\n /** Heading level */\n @Prop() headingLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"3\";\n\n /** Name */\n @Prop() name: string;\n\n /** Name heading level */\n @Prop() nameHeadingLevel: \"\" | \"1\" | \"2\" | \"3\" | \"4\" = \"\";\n\n /** Address (alternative for address slot or separate properties `street`, `streetInfo`, `postalCode` & `location`) */\n @Prop() address: string;\n\n /** Street */\n @Prop() street: string | string[];\n private _street: string[] = [];\n\n /** Additional street info */\n @Prop() streetInfo: string | string[];\n private _streetInfo: string[] = [];\n\n /** Postal code */\n @Prop() postalCode: string;\n\n /** Location / city */\n @Prop() location: string;\n\n /** Location / city */\n @Prop() imagePosition: \"left\" | \"top\" = \"top\";\n\n /**\n * Numbers\n * Array of objects that can include the attributes `type` = `tel`|`fax`, `label`, `number`\n * and optionally `analyticsId` for setting `s-object-id` to the link element\n * (for Adobe Analytics, default value is `label` and `number`).\n */\n @Prop() numbers: ContactNumber[] | string = [];\n private _numbers: ContactNumber[] = [];\n\n /**\n * Numbers\n * Array of objects that can include the attributes `label`, `number`, `text`, `href`\n * and optionally `analyticsId` for setting `s-object-id` to the link element\n * (for Adobe Analytics, default value is `label` and `text`).\n */\n @Prop() emails: ContactEmail[] | string = [];\n private _emails: ContactEmail[] = [];\n\n /** Pobox (alternative for pobox slot or separate properties `poboxHeading`, `poboxTitle`, `poboxPostalCode` & `poboxLocation`) */\n @Prop() pobox: string;\n\n /** Post office box heading */\n @Prop() poboxHeading: string;\n\n /** Post office box title */\n @Prop() poboxTitle: string;\n\n /** Post office box postal code */\n @Prop() poboxPostalCode: string;\n\n /** Post office box location / city */\n @Prop() poboxLocation: string;\n\n /** Availability title */\n @Prop() availabilityTitle: string;\n\n /** Availability title level */\n @Prop() availabilityTitleLevel: \"1\" | \"2\" | \"3\" | \"4\" = \"3\";\n\n /** Availability times */\n @Prop() availability: string | StzhContactAvailabilityItem[];\n private _availability: StzhContactAvailabilityItem[] = [];\n\n // private _availabilityDataItems: StzhDatalistItemEntry[] = [];\n\n @Watch(\"availability\")\n availabilityWatcher(newValue: string | StzhContactAvailabilityItem[]) {\n if (typeof newValue === \"string\") {\n this._availability = JSON.parse(newValue);\n } else {\n this._availability = newValue;\n }\n }\n\n @Watch(\"numbers\")\n numbersWatcher(newValue: ContactNumber[] | string) {\n if (typeof newValue === \"string\") {\n this._numbers = JSON.parse(newValue);\n } else {\n this._numbers = newValue;\n }\n }\n\n @Watch(\"emails\")\n emailsWatcher(newValue: ContactEmail[] | string) {\n if (typeof newValue === \"string\") {\n this._emails = JSON.parse(newValue);\n } else {\n this._emails = newValue;\n }\n }\n\n @Watch(\"street\")\n streetWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._street = JSON.parse(newValue);\n } catch (noArrayException) {\n this._street = [newValue];\n }\n } else if (newValue) {\n this._street = newValue;\n }\n }\n\n @Watch(\"streetInfo\")\n streetInfoWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n try {\n this._streetInfo = JSON.parse(newValue);\n } catch (noArrayException) {\n this._streetInfo = [newValue];\n }\n } else if (newValue) {\n this._streetInfo = newValue;\n }\n }\n\n @Element() element: HTMLStzhFigureElement;\n\n async componentWillLoad() {\n this.numbersWatcher(this.numbers);\n this.emailsWatcher(this.emails);\n this.availabilityWatcher(this.availability);\n this.streetWatcher(this.street);\n this.streetInfoWatcher(this.streetInfo);\n }\n\n render() {\n const hasImage = hasSlot(this.element, \"image\");\n const hasAddress = !!this.address || hasSlot(this.element, \"address\");\n const hasAddons = hasSlot(this.element, \"addons\");\n const hasLinks = hasSlot(this.element, \"links\");\n\n const classes = {\n \"stzh-contact\": true,\n \"stzh-contact--has-image\": hasImage,\n \"stzh-contact--has-address\": hasAddress,\n \"stzh-contact--has-addons\": hasAddons,\n \"stzh-contact--has-links\": hasLinks,\n [`stzh-contact--image-position-${this.imagePosition}`]: true,\n };\n\n const HeadingLevel = `h${this.headingLevel}`;\n const NameHeadingLevel = this.nameHeadingLevel ? `h${this.nameHeadingLevel}` : \"div\";\n const AvailabilityTitleElement = `h${this.availabilityTitleLevel}`;\n\n return (\n <Host image-position={this.imagePosition} has-availability={!!this.availability ? 'true' : 'false'}>\n <div class={classes} itemscope itemtype={`http://schema.org/${this.type}`}>\n <div\n class=\"stzh-contact__main-heading\"\n itemprop={\n (this.type === \"Organization\" && !this.heading) || (this.type === \"Person\" && !this.name) ? \"name\" : null\n }\n >\n {this.mainHeading ? (\n <stzh-heading level={this.mainHeadingLevel}>{this.mainHeading}</stzh-heading>\n ) : (\n <slot name=\"main-heading\"></slot>\n )}\n </div>\n\n <div class=\"stzh-contact__image-wrapper\">\n <div class=\"stzh-contact__image\">\n <slot name=\"image\"></slot>\n </div>\n </div>\n\n <div class=\"stzh-contact__info\">\n {this.heading && (\n <HeadingLevel\n class=\"stzh-contact__heading\"\n itemprop={this.type === \"Organization\" || !this.name ? \"name\" : null}\n innerHTML={this.heading}\n ></HeadingLevel>\n )}\n\n {this.name && (\n <NameHeadingLevel\n class={{\n \"stzh-contact__name\": true,\n \"is-heading\": this.nameHeadingLevel !== \"\",\n }}\n itemprop={this.type === \"Person\" ? \"name\" : null}\n >\n {this.name}\n </NameHeadingLevel>\n )}\n\n <div\n class=\"stzh-contact__address\"\n itemprop=\"address\"\n itemscope\n itemtype=\"http://schema.org/PostalAddress\"\n innerHTML={this.address}\n >\n {!this.address && (\n <Fragment>\n {this._street.length > 0 && (\n <div class=\"stzh-contact__street\" itemprop=\"streetAddress\">\n {this._street.map((street: string) => (\n <Fragment>\n {street}\n <br />\n </Fragment>\n ))}\n {this._streetInfo.length > 0 && (\n <Fragment>\n <br />{\" \"}\n {this._streetInfo.map((streetInfo: string) => (\n <Fragment>\n {streetInfo}\n <br />\n </Fragment>\n ))}\n </Fragment>\n )}\n </div>\n )}\n\n {this.postalCode && (\n <span class=\"stzh-contact__postal-code\" itemprop=\"postalCode\">\n {this.postalCode} \n </span>\n )}\n\n {this.location && (\n <span class=\"stzh-contact__locality\" itemprop=\"addressLocality\">\n {this.location}\n </span>\n )}\n\n <slot name=\"address\"></slot>\n </Fragment>\n )}\n </div>\n\n {this._numbers.length > 0 && (\n <div class=\"stzh-contact__numbers\">\n {this._numbers.map(number => (\n <div class=\"stzh-contact__number\">\n <span>{number.label} </span>\n <stzh-link\n size=\"inherit\"\n height=\"auto\"\n class=\"stzh-contact__number-link\"\n href={`${number.type}:${formatTel(number.number)}`}\n analyticsId={number.analyticsId || `${number.label} ${number.number}`}\n itemprop={number.type === \"fax\" ? \"faxNumber\" : \"telephone\"}\n >\n {number.number}\n </stzh-link>\n </div>\n ))}\n </div>\n )}\n\n {this._emails.length > 0 && (\n <div class=\"stzh-contact__emails\">\n {this._emails.map(email => (\n <div class=\"stzh-contact__email\">\n <span>{email.label} </span>\n {email.href ? (\n <stzh-link\n size=\"inherit\"\n height=\"auto\"\n class=\"stzh-container__email-link\"\n href={`mailto:${email.href}`}\n analyticsId={email.analyticsId || `${email.label} ${email.text}`}\n itemprop=\"email\"\n >\n {email.text}\n </stzh-link>\n ) : (\n <span class=\"stzh-container__email-link\" itemprop=\"email\">\n {email.text}\n </span>\n )}\n </div>\n ))}\n </div>\n )}\n\n <div class=\"stzh-contact__pobox\" innerHTML={this.pobox}>\n {!this.pobox && (\n <Fragment>\n {this.poboxHeading && <div class=\"stzh-contact__pobox-heading\">{this.poboxHeading}</div>}\n {this.poboxTitle && <div class=\"stzh-contact__pobox-title\">{this.poboxTitle}</div>}\n {this.poboxPostalCode && (\n <span class=\"stzh-contact__pobox-postal-code\">{this.poboxPostalCode} </span>\n )}\n {this.poboxLocation && <span class=\"stzh-contact__pobox-locality\">{this.poboxLocation}</span>}\n <slot name=\"pobox\"></slot>\n </Fragment>\n )}\n </div>\n </div>\n\n {this.availability && (\n <div class=\"stzh-contact__availability\">\n {this.availabilityTitle && (\n <AvailabilityTitleElement class=\"stzh-contact__availability-title\">\n {this.availabilityTitle}\n </AvailabilityTitleElement>\n )}\n\n {this._availability.length > 0 && (\n <ul class=\"stzh-contact__availability-list\">\n {this._availability.map(item => (\n <li class=\"stzh-contact__availability-list-item\">\n <div class=\"stzh-contact__availability-weekday\">{item.weekday}</div>\n {item.hours.length > 0 && (\n <div class=\"stzh-contact__availability-hours\">\n {item.hours.map((hour, index) => (\n <Fragment>\n <div class=\"stzh-contact__availability-hour\">{hour}</div>\n {index < item.hours.length - 1 && (\n <div class=\"stzh-contact__availability-hours-separator\"></div>\n )}\n </Fragment>\n ))}\n </div>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n\n <div class=\"stzh-contact__additional\">\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stzh-datalist.e2e.js","sourceRoot":"","sources":["../../../../src/components/stzh-datalist/stzh-datalist.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAElC,MAAM,OAAO,GAAG;EACd,SAAS;EACT,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,SAAS;EACT,mBAAmB;CACpB,CAAC;AAEF,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EAC7B,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IAC1B,IAAI,CAAC,SAAS,OAAO,cAAc,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;MACtD,MAAM,UAAU,CAAC;QACf,OAAO;QACP,IAAI;QACJ,GAAG,EAAE,GAAG;OACT,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { test } from \"@playwright/test\";\nimport { visualDiff } from \"../../../.build/test/utils\";\n\nconst URL = \"components-datalist\";\n\nconst STORIES = [\n \"default\",\n \"urls\",\n \"nested\",\n \"details\",\n \"table\",\n \"slotted\",\n \"slotted-edit-mode\",\n];\n\ntest.describe(\"datalist\", () => {\n STORIES.forEach((storyId) => {\n test(`story ${storyId} visual diff`, async ({ page }) => {\n await visualDiff({\n storyId,\n page,\n url: URL\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"stzh-datalist.e2e.js","sourceRoot":"","sources":["../../../../src/components/stzh-datalist/stzh-datalist.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAElC,MAAM,OAAO,GAAG;EACd,SAAS;EACT,MAAM;EACN,cAAc;EACd,QAAQ;EACR,SAAS;EACT,OAAO;EACP,SAAS;EACT,mBAAmB;CACpB,CAAC;AAEF,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EAC7B,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IAC1B,IAAI,CAAC,SAAS,OAAO,cAAc,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;MACtD,MAAM,UAAU,CAAC;QACf,OAAO;QACP,IAAI;QACJ,GAAG,EAAE,GAAG;OACT,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { test } from \"@playwright/test\";\nimport { visualDiff } from \"../../../.build/test/utils\";\n\nconst URL = \"components-datalist\";\n\nconst STORIES = [\n \"default\",\n \"urls\",\n \"multi-column\",\n \"nested\",\n \"details\",\n \"table\",\n \"slotted\",\n \"slotted-edit-mode\",\n];\n\ntest.describe(\"datalist\", () => {\n STORIES.forEach((storyId) => {\n test(`story ${storyId} visual diff`, async ({ page }) => {\n await visualDiff({\n storyId,\n page,\n url: URL\n });\n });\n });\n});\n"]}
|
|
@@ -196,6 +196,38 @@ export const Urls = {
|
|
|
196
196
|
},
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
+
export const MultiColumn = {
|
|
200
|
+
render: (args) => story(args, TEMPLATE),
|
|
201
|
+
args: {
|
|
202
|
+
columns: 3,
|
|
203
|
+
items: [
|
|
204
|
+
{
|
|
205
|
+
label: 'Label',
|
|
206
|
+
value: 'Internal Link',
|
|
207
|
+
href: '#',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
label: 'Label',
|
|
211
|
+
value: 'External Link',
|
|
212
|
+
href: 'http://example.com',
|
|
213
|
+
target: '_blank',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
label: 'Label',
|
|
217
|
+
value: 'Phone Link',
|
|
218
|
+
href: 'tel:#',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: 'Label',
|
|
222
|
+
value: 'Download Link',
|
|
223
|
+
href: '#',
|
|
224
|
+
meta: ['PDF', '1 Seite', '60 KB'],
|
|
225
|
+
download: true,
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
|
|
199
231
|
export const Nested = {
|
|
200
232
|
render: (args) => story(args, TEMPLATE),
|
|
201
233
|
args: {
|
|
@@ -192,10 +192,11 @@
|
|
|
192
192
|
position: relative;
|
|
193
193
|
-webkit-text-decoration-line: none;
|
|
194
194
|
text-decoration-line: none;
|
|
195
|
-
display:
|
|
195
|
+
display: var(--wrapper-display);
|
|
196
196
|
align-items: center;
|
|
197
197
|
/* Button variant */
|
|
198
198
|
/* Interactive variant */
|
|
199
|
+
/* Vertical Variant */
|
|
199
200
|
/* Horizontal / Table Variant */
|
|
200
201
|
/** Table Variant */
|
|
201
202
|
/** Big label */
|
|
@@ -1379,7 +1379,7 @@ stzh-dropdown:where([size=tiny]):where([variant=filter]) {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
.stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item, .stzh-dropdown--is-multiple .stzh-dropdown__select.plugin-remove_button .stzh-dropdown__item {
|
|
1381
1381
|
display: inline-flex;
|
|
1382
|
-
align-items:
|
|
1382
|
+
align-items: center;
|
|
1383
1383
|
gap: var(--remove-gap);
|
|
1384
1384
|
padding-right: 0px;
|
|
1385
1385
|
}
|
|
@@ -1485,6 +1485,13 @@ stzh-dropdown:where([size=tiny]):where([variant=filter]) {
|
|
|
1485
1485
|
.stzh-dropdown--has-no-search .stzh-dropdown__select.input-active .ts-control, .stzh-dropdown--has-no-search .stzh-dropdown__select.input-active .ts-control > input {
|
|
1486
1486
|
cursor: pointer;
|
|
1487
1487
|
}
|
|
1488
|
+
.stzh-dropdown--filter .stzh-dropdown__option, .stzh-dropdown--plain .stzh-dropdown__option {
|
|
1489
|
+
background-color: var(--stzh-color-secondary10);
|
|
1490
|
+
color: var(--stzh-color-primary70);
|
|
1491
|
+
}
|
|
1492
|
+
.stzh-dropdown--filter .stzh-dropdown__option:hover, .stzh-dropdown--filter .stzh-dropdown__option.active, .stzh-dropdown--plain .stzh-dropdown__option:hover, .stzh-dropdown--plain .stzh-dropdown__option.active {
|
|
1493
|
+
background-color: var(--stzh-color-secondary20);
|
|
1494
|
+
}
|
|
1488
1495
|
.stzh-dropdown--filter .stzh-dropdown__select.single .ts-control, .stzh-dropdown--filter .stzh-dropdown__select.multi .ts-control, .stzh-dropdown--filter .stzh-dropdown__sizer {
|
|
1489
1496
|
border: none;
|
|
1490
1497
|
}
|