@bethinkpl/design-system 21.0.2 → 22.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/design-system.umd.js +1533 -1485
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +1 -1
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +3 -284
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +3 -230
- package/dist/lib/js/components/PopOver/PopOver.consts.d.ts +1 -0
- package/dist/lib/js/components/SelectList/SelectList.vue.d.ts +3 -4
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +3 -260
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +1 -1
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +1 -1
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +2 -1
- package/docs/iframe.html +1 -1
- package/docs/main.3376b2f2.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/lib/js/components/BadgeScore/BadgeScore.spec.ts +40 -40
- package/lib/js/components/BadgeScore/BadgeScore.vue +20 -20
- package/lib/js/components/Banner/Banner.vue +28 -29
- package/lib/js/components/Buttons/Button/Button.spec.ts +22 -22
- package/lib/js/components/Buttons/Button/Button.vue +17 -17
- package/lib/js/components/Buttons/IconButton/IconButton.vue +47 -47
- package/lib/js/components/Cards/Card/Card.spec.ts +9 -7
- package/lib/js/components/Cards/Card/Card.vue +10 -9
- package/lib/js/components/Cards/CardExpandable/CardExpandable.spec.ts +6 -6
- package/lib/js/components/Cards/CardExpandable/CardExpandable.vue +7 -7
- package/lib/js/components/Chip/Chip.spec.ts +24 -25
- package/lib/js/components/Chip/Chip.vue +19 -19
- package/lib/js/components/Divider/Divider.vue +16 -16
- package/lib/js/components/Drawer/Drawer.vue +16 -16
- package/lib/js/components/Drawer/DrawerContent/DrawerContent.vue +2 -2
- package/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue +2 -2
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue +19 -19
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue +5 -5
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue +2 -2
- package/lib/js/components/Drawer/DrawerSection/DrawerSection.vue +1 -1
- package/lib/js/components/Drawer/DrawerTile/DrawerTile.vue +2 -2
- package/lib/js/components/Dropdown/Dropdown.vue +10 -10
- package/lib/js/components/Form/SelectionControl/SelectionControl.vue +27 -27
- package/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue +18 -18
- package/lib/js/components/Headers/PageHeader/PageHeader.vue +11 -11
- package/lib/js/components/Headers/SectionHeader/SectionHeader.vue +40 -38
- package/lib/js/components/IconText/IconText.vue +22 -22
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue +22 -22
- package/lib/js/components/Icons/Icon/Icon.vue +7 -7
- package/lib/js/components/Layouts/ThreeColumnLayout/ThreeColumnLayout.vue +24 -24
- package/lib/js/components/Modal/Modal.vue +2 -0
- package/lib/js/components/Modals/Modal/Modal.vue +8 -8
- package/lib/js/components/Modals/ModalDialog/ModalDialog.vue +1 -1
- package/lib/js/components/NumberInCircle/NumberInCircle.vue +27 -27
- package/lib/js/components/Outline/OutlineDivider/OutlineDivider.vue +2 -2
- package/lib/js/components/Outline/OutlineItem/OutlineItem.vue +38 -34
- package/lib/js/components/Outline/OutlineSectionHeader/OutlineSectionHeader.vue +2 -2
- package/lib/js/components/Pagination/Pagination.vue +17 -17
- package/lib/js/components/PopOver/PopOver.consts.ts +1 -0
- package/lib/js/components/PopOver/PopOver.vue +64 -50
- package/lib/js/components/ProgressBar/ProgressBar.vue +32 -32
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.spec.ts +6 -6
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue +14 -18
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +9 -9
- package/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.vue +11 -11
- package/lib/js/components/RichList/RichListItem/RichListItem.vue +52 -52
- package/lib/js/components/SectionTitle/SectionTitle.vue +4 -4
- package/lib/js/components/SelectList/SelectList.vue +2 -2
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +23 -23
- package/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.vue +2 -2
- package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue +2 -2
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue +3 -3
- package/lib/js/components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue +5 -3
- package/lib/js/components/SelectionTile/SelectionTile.vue +21 -21
- package/lib/js/components/Statuses/AccessStatus/AccessStatus.vue +9 -10
- package/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue +7 -8
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue +8 -8
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.spec.ts +8 -6
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +24 -24
- package/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue +2 -2
- package/lib/js/components/SurveyToggle/SurveyToggle.spec.ts +4 -4
- package/lib/js/components/SurveyToggle/SurveyToggle.vue +23 -19
- package/lib/js/components/Switch/Switch.vue +53 -44
- package/lib/js/components/TabItem/TabItem.spec.ts +2 -2
- package/lib/js/components/TabItem/TabItem.vue +11 -11
- package/lib/js/components/Tile/Tile.spec.ts +39 -39
- package/lib/js/components/Tile/Tile.vue +32 -29
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.spec.ts +8 -8
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.vue +16 -16
- package/lib/js/components/Toggles/ToggleButton/ToggleButton.vue +39 -39
- package/lib/js/components/Well/Well.vue +6 -6
- package/lib/js/styles/ColorsThemes/ColorsThemes.stories.ts +2 -2
- package/lib/js/styles/ColorsTokensPrimaryBodywork/ColorsTokensPrimaryBodywork.stories.ts +1 -1
- package/lib/js/styles/ColorsTokensPrimaryWnl/ColorsTokensPrimaryWnl.stories.ts +1 -1
- package/lib/js/styles/ItemsList.vue +3 -1
- package/lib/js/styles/TypographyTokensLms/TypographyTokensLms.stories.ts +1 -1
- package/lib/js/styles/TypographyVariables/TypographyVariables.stories.ts +1 -1
- package/lib/styles/components/_buttons.scss +38 -38
- package/lib/styles/components/_icons.scss +43 -25
- package/lib/styles/components/_items-list-item.scss +3 -0
- package/lib/styles/design-system.scss +1 -5
- package/lib/styles/modifiers/_typography.scss +14 -28
- package/lib/styles/settings/_icons.scss +1 -1
- package/lib/styles/settings/colors/_raw-bodywork.scss +1 -1
- package/lib/styles/settings/colors/_raw-wnl.scss +1 -1
- package/lib/styles/settings/colors/_tokens-bodywork-variables.scss +1 -1
- package/lib/styles/settings/colors/_tokens-wnl-variables.scss +1 -1
- package/lib/styles/storybook.scss +2 -1
- package/package.json +1 -1
- package/stylelint.config.js +1 -0
- package/tools/importers/SynchronizeColorsTokens.ts +4 -4
- package/tools/importers/helpers/modifiers.ts +1 -1
- package/docs/main.147130f0.iframe.bundle.js +0 -1
- package/lib/styles/components/_links.scss +0 -21
- package/lib/styles/modifiers/_layout.scss +0 -12
- package/lib/styles/modifiers/_media-queries.scss +0 -17
- package/lib/styles/modifiers/_shadows.scss +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="blockadeStatus" :class="statusClass">
|
|
3
|
-
<icon :size="ICON_SIZES.X_SMALL" :icon="icon" class="blockadeStatus__icon" />
|
|
4
|
-
<span class="blockadeStatus__text">{{ text }}</span>
|
|
2
|
+
<div class="ds-blockadeStatus" :class="statusClass">
|
|
3
|
+
<icon :size="ICON_SIZES.X_SMALL" :icon="icon" class="ds-blockadeStatus__icon" />
|
|
4
|
+
<span class="ds-blockadeStatus__text">{{ text }}</span>
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@import '../../../../styles/settings/colors/tokens';
|
|
11
11
|
@import '../../../../styles/settings/typography/tokens';
|
|
12
12
|
|
|
13
|
-
.blockadeStatus {
|
|
13
|
+
.ds-blockadeStatus {
|
|
14
14
|
$self: &;
|
|
15
15
|
|
|
16
16
|
align-items: center;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
margin-right: $space-4xs;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
&.-active {
|
|
25
|
+
&.-ds-active {
|
|
26
26
|
color: $color-danger-text;
|
|
27
27
|
#{$self}__icon {
|
|
28
28
|
color: $color-danger-icon;
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
</style>
|
|
37
37
|
|
|
38
38
|
<script lang="ts">
|
|
39
|
-
import Icon from '../../Icons/Icon';
|
|
40
|
-
import { ICONS, ICON_SIZES } from '../../Icons/Icon';
|
|
39
|
+
import Icon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
41
40
|
import { COURSE_BLOCKADE_ACCESS_STATUS } from '../../../consts/user';
|
|
42
41
|
|
|
43
42
|
export default {
|
|
@@ -66,7 +65,7 @@ export default {
|
|
|
66
65
|
},
|
|
67
66
|
statusClass() {
|
|
68
67
|
if (this.status === COURSE_BLOCKADE_ACCESS_STATUS.ACTIVE) {
|
|
69
|
-
return '-active';
|
|
68
|
+
return '-ds-active';
|
|
70
69
|
}
|
|
71
70
|
return '';
|
|
72
71
|
},
|
package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="surveyQuestionOpenEnded"
|
|
4
|
-
:class="{ '-disabled': state === SURVEY_QUESTION_STATES.DISABLED }"
|
|
3
|
+
class="ds-surveyQuestionOpenEnded"
|
|
4
|
+
:class="{ '-ds-disabled': state === SURVEY_QUESTION_STATES.DISABLED }"
|
|
5
5
|
>
|
|
6
6
|
<ds-modal v-if="showModal" @close-modal="showModal = false">
|
|
7
7
|
<slot name="explanation" />
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
</ds-modal>
|
|
16
16
|
<ds-card>
|
|
17
17
|
<template #content>
|
|
18
|
-
<div class="surveyQuestionOpenEnded__header">
|
|
19
|
-
<label class="surveyQuestionOpenEnded__title" :for="inputId">
|
|
18
|
+
<div class="ds-surveyQuestionOpenEnded__header">
|
|
19
|
+
<label class="ds-surveyQuestionOpenEnded__title" :for="inputId">
|
|
20
20
|
{{ title }}
|
|
21
21
|
</label>
|
|
22
22
|
<icon-button
|
|
23
23
|
v-if="$slots.explanation"
|
|
24
|
-
class="surveyQuestionOpenEnded__explanation"
|
|
24
|
+
class="ds-surveyQuestionOpenEnded__explanation"
|
|
25
25
|
:color="ICON_BUTTON_COLORS.NEUTRAL_WEAK"
|
|
26
26
|
:icon="ICONS.FA_CIRCLE_QUESTION"
|
|
27
27
|
:size="ICON_SIZES.MEDIUM"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
@click="showModal = true"
|
|
30
30
|
/>
|
|
31
31
|
</div>
|
|
32
|
-
<div class="surveyQuestionOpenEnded__content">
|
|
32
|
+
<div class="ds-surveyQuestionOpenEnded__content">
|
|
33
33
|
<survey-question-textarea
|
|
34
34
|
:id="inputId"
|
|
35
|
-
class="surveyQuestionOpenEnded__input"
|
|
35
|
+
class="ds-surveyQuestionOpenEnded__input"
|
|
36
36
|
:disabled="state === SURVEY_QUESTION_STATES.DISABLED"
|
|
37
37
|
:value="value"
|
|
38
38
|
:placeholder="placeholder"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
@import '../../../../styles/settings/colors/tokens';
|
|
51
51
|
@import '../../../../styles/settings/typography/tokens';
|
|
52
52
|
|
|
53
|
-
.surveyQuestionOpenEnded {
|
|
53
|
+
.ds-surveyQuestionOpenEnded {
|
|
54
54
|
&__header {
|
|
55
55
|
display: flex;
|
|
56
56
|
justify-content: space-between;
|
|
@@ -55,32 +55,34 @@ describe('SurveyQuestionScale', () => {
|
|
|
55
55
|
it('should render surveyQuestionScale class', () => {
|
|
56
56
|
const component = createComponent();
|
|
57
57
|
|
|
58
|
-
expect(component.find('.surveyQuestionScale').exists()).toBe(true);
|
|
58
|
+
expect(component.find('.ds-surveyQuestionScale').exists()).toBe(true);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
it('should render text from title prop', () => {
|
|
62
62
|
const title = 'Wspłynąłem na suchego przestwór oceanu';
|
|
63
63
|
const component = createComponent({ title });
|
|
64
64
|
|
|
65
|
-
expect(component.find('.surveyQuestionScale__title').text()).toContain(title);
|
|
65
|
+
expect(component.find('.ds-surveyQuestionScale__title').text()).toContain(title);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it("Don't show explanation icon when slot is empty", async () => {
|
|
69
69
|
const component = createComponent();
|
|
70
70
|
|
|
71
|
-
expect(component.find('.surveyQuestionScale__explanation').exists()).toBe(false);
|
|
71
|
+
expect(component.find('.ds-surveyQuestionScale__explanation').exists()).toBe(false);
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it('Show explanation icon when slot is not empty', async () => {
|
|
75
75
|
const component = createComponent({ explanation: 'test' });
|
|
76
76
|
|
|
77
|
-
expect(component.find('.surveyQuestionScale__explanation').exists()).toBe(true);
|
|
77
|
+
expect(component.find('.ds-surveyQuestionScale__explanation').exists()).toBe(true);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('click on survey toggle should emit "selectChange" event', async () => {
|
|
81
81
|
const component = createComponent({ scaleOptions: OPTIONS });
|
|
82
82
|
|
|
83
|
-
await component
|
|
83
|
+
await component
|
|
84
|
+
.find('.ds-surveyQuestionScale__toggle .ds-surveyToggle__toggle')
|
|
85
|
+
.trigger('click');
|
|
84
86
|
|
|
85
87
|
expect(component.emitted()?.['select-change']?.[0]).toBeDefined();
|
|
86
88
|
});
|
|
@@ -88,6 +90,6 @@ describe('SurveyQuestionScale', () => {
|
|
|
88
90
|
it('should render SurveyToggle for each item in scaleOptions prop', () => {
|
|
89
91
|
const component = createComponent({ scaleOptions: OPTIONS });
|
|
90
92
|
|
|
91
|
-
expect(component.findAll('.surveyToggle').length).toBe(OPTIONS.length);
|
|
93
|
+
expect(component.findAll('.ds-surveyToggle').length).toBe(OPTIONS.length);
|
|
92
94
|
});
|
|
93
95
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="surveyQuestionScale">
|
|
2
|
+
<div class="ds-surveyQuestionScale">
|
|
3
3
|
<ds-modal v-if="showModal" @close-modal="showModal = false">
|
|
4
4
|
<slot name="explanation" />
|
|
5
5
|
<template #footer>
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
</ds-modal>
|
|
13
13
|
<ds-card>
|
|
14
14
|
<template #content>
|
|
15
|
-
<div class="surveyQuestionScale__header">
|
|
16
|
-
<span class="surveyQuestionScale__title">{{ title }}</span>
|
|
15
|
+
<div class="ds-surveyQuestionScale__header">
|
|
16
|
+
<span class="ds-surveyQuestionScale__title">{{ title }}</span>
|
|
17
17
|
<icon-button
|
|
18
18
|
v-if="$slots.explanation"
|
|
19
|
-
class="surveyQuestionScale__explanation"
|
|
19
|
+
class="ds-surveyQuestionScale__explanation"
|
|
20
20
|
:color="ICON_BUTTON_COLORS.NEUTRAL_WEAK"
|
|
21
21
|
:icon="ICONS.FA_CIRCLE_QUESTION"
|
|
22
22
|
:size="ICON_SIZES.MEDIUM"
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
/>
|
|
26
26
|
</div>
|
|
27
27
|
<div
|
|
28
|
-
class="surveyQuestionScale__content"
|
|
28
|
+
class="ds-surveyQuestionScale__content"
|
|
29
29
|
:class="{ '-oneContainer': containers === SURVEY_QUESTION_CONTAINERS.ONE }"
|
|
30
30
|
>
|
|
31
31
|
<div
|
|
32
|
-
class="surveyQuestionScale__container"
|
|
32
|
+
class="ds-surveyQuestionScale__container"
|
|
33
33
|
:class="{
|
|
34
|
-
'-oneContainer': containers === SURVEY_QUESTION_CONTAINERS.ONE,
|
|
34
|
+
'-ds-oneContainer': containers === SURVEY_QUESTION_CONTAINERS.ONE,
|
|
35
35
|
}"
|
|
36
36
|
>
|
|
37
37
|
<template
|
|
38
38
|
v-for="(option, index) in scaleOptions"
|
|
39
|
-
:key="`surveyQuestionScale-${index}`"
|
|
39
|
+
:key="`ds-surveyQuestionScale-${index}`"
|
|
40
40
|
>
|
|
41
41
|
<div
|
|
42
|
-
class="surveyQuestionScale__toggle"
|
|
42
|
+
class="ds-surveyQuestionScale__toggle"
|
|
43
43
|
:class="{
|
|
44
|
-
'-hideOnDesktop':
|
|
44
|
+
'-ds-hideOnDesktop':
|
|
45
45
|
option.standalone &&
|
|
46
46
|
containers === SURVEY_QUESTION_CONTAINERS.TWO,
|
|
47
47
|
}"
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
standaloneOptions.length > 0 &&
|
|
72
72
|
containers === SURVEY_QUESTION_CONTAINERS.TWO
|
|
73
73
|
"
|
|
74
|
-
class="surveyQuestionScale__container -justifyEnd -hideOnMobile"
|
|
74
|
+
class="ds-surveyQuestionScale__container -ds-justifyEnd -ds-hideOnMobile"
|
|
75
75
|
>
|
|
76
76
|
<template
|
|
77
77
|
v-for="(option, index) in standaloneOptions"
|
|
78
|
-
:key="`surveyQuestionScale-standalone-${index}`"
|
|
78
|
+
:key="`ds-surveyQuestionScale-standalone-${index}`"
|
|
79
79
|
>
|
|
80
|
-
<div class="surveyQuestionScale__toggle">
|
|
80
|
+
<div class="ds-surveyQuestionScale__toggle">
|
|
81
81
|
<survey-toggle
|
|
82
82
|
:meaning="option.meaning"
|
|
83
83
|
:content-text="option.content"
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
</div>
|
|
101
101
|
|
|
102
102
|
<template v-if="selectedValue !== null && elaborationLabel !== null">
|
|
103
|
-
<hr class="surveyQuestionScale__separator" />
|
|
104
|
-
<div class="surveyQuestionScale__elaboration">
|
|
105
|
-
<label class="surveyQuestionScale__elaborationLabel" :for="inputId">
|
|
103
|
+
<hr class="ds-surveyQuestionScale__separator" />
|
|
104
|
+
<div class="ds-surveyQuestionScale__elaboration">
|
|
105
|
+
<label class="ds-surveyQuestionScale__elaborationLabel" :for="inputId">
|
|
106
106
|
{{ elaborationLabel }}
|
|
107
107
|
</label>
|
|
108
108
|
<survey-question-textarea
|
|
109
109
|
:id="inputId"
|
|
110
110
|
:value="elaborationValue"
|
|
111
|
-
class="surveyQuestionScale__elaborationInput"
|
|
111
|
+
class="ds-surveyQuestionScale__elaborationInput"
|
|
112
112
|
:placeholder="placeholder"
|
|
113
113
|
:disabled="state === SURVEY_QUESTION_STATES.DISABLED"
|
|
114
114
|
@input="$emit('elaboration-change', $event)"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
@import '../../../../styles/settings/colors/tokens';
|
|
130
130
|
@import '../../../../styles/settings/typography/tokens';
|
|
131
131
|
|
|
132
|
-
.surveyQuestionScale {
|
|
132
|
+
.ds-surveyQuestionScale {
|
|
133
133
|
&__header {
|
|
134
134
|
@include heading-m-default-regular;
|
|
135
135
|
|
|
@@ -160,13 +160,13 @@
|
|
|
160
160
|
gap: $space-l;
|
|
161
161
|
padding: $space-s $space-l;
|
|
162
162
|
|
|
163
|
-
&:not(.-oneContainer) {
|
|
163
|
+
&:not(.-ds-oneContainer) {
|
|
164
164
|
justify-content: center;
|
|
165
165
|
overflow-x: initial;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
&.-oneContainer {
|
|
169
|
+
&.-ds-oneContainer {
|
|
170
170
|
overflow-x: auto;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
display: flex;
|
|
176
176
|
justify-content: center;
|
|
177
177
|
|
|
178
|
-
&.-hideOnDesktop {
|
|
178
|
+
&.-ds-hideOnDesktop {
|
|
179
179
|
display: flex;
|
|
180
180
|
|
|
181
181
|
@media #{breakpoint-s()} {
|
|
@@ -209,15 +209,15 @@
|
|
|
209
209
|
flex-direction: row;
|
|
210
210
|
gap: $space-l;
|
|
211
211
|
|
|
212
|
-
&.-justifyEnd {
|
|
212
|
+
&.-ds-justifyEnd {
|
|
213
213
|
justify-content: flex-end;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
&.-oneContainer {
|
|
216
|
+
&.-ds-oneContainer {
|
|
217
217
|
justify-content: space-between;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
&.-hideOnMobile {
|
|
220
|
+
&.-ds-hideOnMobile {
|
|
221
221
|
display: none;
|
|
222
222
|
|
|
223
223
|
@media #{breakpoint-s()} {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<textarea
|
|
3
3
|
ref="textarea"
|
|
4
|
-
class="surveyQuestionTextarea"
|
|
4
|
+
class="ds-surveyQuestionTextarea"
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:placeholder="placeholder"
|
|
7
7
|
:value="value"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@import '../../../styles/settings/colors/tokens';
|
|
16
16
|
@import '../../../styles/settings/typography/tokens';
|
|
17
17
|
|
|
18
|
-
.surveyQuestionTextarea {
|
|
18
|
+
.ds-surveyQuestionTextarea {
|
|
19
19
|
@include formText-s-default-regular;
|
|
20
20
|
|
|
21
21
|
border: 1px solid $color-neutral-border-weak;
|
|
@@ -35,20 +35,20 @@ describe('SurveyToggle', () => {
|
|
|
35
35
|
it('should render surveyToggle class', () => {
|
|
36
36
|
const component = createComponent();
|
|
37
37
|
|
|
38
|
-
expect(component.find('.surveyToggle').exists()).toBe(true);
|
|
38
|
+
expect(component.find('.ds-surveyToggle').exists()).toBe(true);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
it('should render text from label prop', () => {
|
|
42
42
|
const label = 'Wspłynąłem na suchego przestwór oceanu';
|
|
43
43
|
const component = createComponent({ label });
|
|
44
44
|
|
|
45
|
-
expect(component.find('.surveyToggle__label').text()).toContain(label);
|
|
45
|
+
expect(component.find('.ds-surveyToggle__label').text()).toContain(label);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
it('after click on toggle component should emit "click" event', async () => {
|
|
49
49
|
const component = createComponent();
|
|
50
50
|
|
|
51
|
-
await component.find('.surveyToggle__toggle').trigger('click');
|
|
51
|
+
await component.find('.ds-surveyToggle__toggle').trigger('click');
|
|
52
52
|
|
|
53
53
|
expect(component.emitted()?.click?.[0]).toBeDefined();
|
|
54
54
|
});
|
|
@@ -70,6 +70,6 @@ describe('SurveyToggle', () => {
|
|
|
70
70
|
color: SURVEY_TOGGLE_MEANINGS.PRIMARY,
|
|
71
71
|
contentText,
|
|
72
72
|
});
|
|
73
|
-
expect(component.find('.surveyToggle__content').text()).toContain(contentText);
|
|
73
|
+
expect(component.find('.ds-surveyToggle__content').text()).toContain(contentText);
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="surveyToggle"
|
|
3
|
+
class="ds-surveyToggle"
|
|
4
4
|
:class="{
|
|
5
|
-
'-primary-selected': isPrimarySelected,
|
|
6
|
-
'-primary': isPrimary,
|
|
7
|
-
'-neutral': isNeutral,
|
|
8
|
-
'-neutral-selected': isNeutralSelected,
|
|
9
|
-
'-disabled': state === SURVEY_TOGGLE_STATES.DISABLED,
|
|
10
|
-
'-hovered': isHoveredState,
|
|
5
|
+
'-ds-primary-selected': isPrimarySelected,
|
|
6
|
+
'-ds-primary': isPrimary,
|
|
7
|
+
'-ds-neutral': isNeutral,
|
|
8
|
+
'-ds-neutral-selected': isNeutralSelected,
|
|
9
|
+
'-ds-disabled': state === SURVEY_TOGGLE_STATES.DISABLED,
|
|
10
|
+
'-ds-hovered': isHoveredState,
|
|
11
11
|
}"
|
|
12
12
|
>
|
|
13
|
-
<div
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
<div
|
|
14
|
+
class="ds-surveyToggle__toggle"
|
|
15
|
+
@mouseover="hovered = true"
|
|
16
|
+
@mouseleave="hovered = false"
|
|
17
|
+
>
|
|
18
|
+
<div class="ds-surveyToggle__ring">
|
|
19
|
+
<span v-if="isPrimarySelected || isNeutralSelected" class="ds-surveyToggle__icon">
|
|
16
20
|
<ds-icon :icon="selectedIcon" :size="ICON_SIZES.X_SMALL" />
|
|
17
21
|
</span>
|
|
18
|
-
<span v-else class="surveyToggle__content">
|
|
22
|
+
<span v-else class="ds-surveyToggle__content">
|
|
19
23
|
{{ contentText }}
|
|
20
24
|
</span>
|
|
21
25
|
</div>
|
|
22
26
|
</div>
|
|
23
|
-
<div v-if="label" class="surveyToggle__label">{{ label }}</div>
|
|
27
|
+
<div v-if="label" class="ds-surveyToggle__label">{{ label }}</div>
|
|
24
28
|
</div>
|
|
25
29
|
</template>
|
|
26
30
|
|
|
@@ -80,7 +84,7 @@ $survey-toggle-colors: (
|
|
|
80
84
|
@mixin setSurveyToggleOtherStates($background, $icon: null) {
|
|
81
85
|
background-color: $background;
|
|
82
86
|
|
|
83
|
-
.surveyToggle__icon {
|
|
87
|
+
.ds-surveyToggle__icon {
|
|
84
88
|
color: $icon;
|
|
85
89
|
}
|
|
86
90
|
}
|
|
@@ -95,11 +99,11 @@ $survey-toggle-colors: (
|
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
.surveyToggle {
|
|
102
|
+
.ds-surveyToggle {
|
|
99
103
|
$self: &;
|
|
100
104
|
|
|
101
105
|
@each $color-name, $color-map in $survey-toggle-colors {
|
|
102
|
-
|
|
106
|
+
&.-ds-#{$color-name} {
|
|
103
107
|
@include setSurveyToggleNormalState(
|
|
104
108
|
$self,
|
|
105
109
|
map-get($color-map, 'background'),
|
|
@@ -111,13 +115,13 @@ $survey-toggle-colors: (
|
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
&:hover,
|
|
114
|
-
&.-hovered {
|
|
118
|
+
&.-ds-hovered {
|
|
115
119
|
#{$self}__toggle {
|
|
116
120
|
@include setSurveyToggleOtherStates(map-get($color-map, 'background-hovered'));
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
|
|
120
|
-
&.-disabled {
|
|
124
|
+
&.-ds-disabled {
|
|
121
125
|
#{$self}__toggle {
|
|
122
126
|
@include setSurveyToggleOtherStates(
|
|
123
127
|
map-get($color-map, 'disabled', 'background'),
|
|
@@ -161,7 +165,7 @@ $survey-toggle-colors: (
|
|
|
161
165
|
box-shadow ease-in-out $default-transition-time;
|
|
162
166
|
width: $survey-toggle-size;
|
|
163
167
|
|
|
164
|
-
.-hovered & {
|
|
168
|
+
.-ds-hovered & {
|
|
165
169
|
@include setSurveyToggleOtherStates(
|
|
166
170
|
map-get($survey-toggle-colors, 'primary', 'background-hovered')
|
|
167
171
|
);
|
|
@@ -181,7 +185,7 @@ $survey-toggle-colors: (
|
|
|
181
185
|
width: 100%;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
&.-disabled {
|
|
188
|
+
&.-ds-disabled {
|
|
185
189
|
pointer-events: none;
|
|
186
190
|
}
|
|
187
191
|
|
|
@@ -1,67 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="switch"
|
|
3
|
+
class="ds-switch"
|
|
4
4
|
:class="{
|
|
5
|
-
'-small': size === SWITCH_SIZE.SMALL,
|
|
6
|
-
'-medium': size === SWITCH_SIZE.MEDIUM,
|
|
7
|
-
|
|
8
|
-
'-
|
|
9
|
-
|
|
10
|
-
'-disabled': state === SWITCH_STATE.DISABLED,
|
|
5
|
+
'-ds-small': size === SWITCH_SIZE.SMALL,
|
|
6
|
+
'-ds-medium': size === SWITCH_SIZE.MEDIUM,
|
|
7
|
+
'-ds-rounded': radius === SWITCH_RADIUSES.ROUNDED,
|
|
8
|
+
'-ds-disabled': state === SWITCH_STATE.DISABLED,
|
|
11
9
|
}"
|
|
10
|
+
@click="onSwitch"
|
|
12
11
|
>
|
|
13
12
|
<div
|
|
14
|
-
class="switch__item -left"
|
|
13
|
+
class="ds-switch__item -ds-left"
|
|
15
14
|
:class="{
|
|
16
|
-
'-clickable':
|
|
17
|
-
|
|
15
|
+
'-ds-clickable':
|
|
16
|
+
currentSide !== SWITCH_SIDE.LEFT && state !== SWITCH_STATE.DISABLED,
|
|
17
|
+
'-ds-selected': currentSide === SWITCH_SIDE.LEFT,
|
|
18
18
|
}"
|
|
19
19
|
:title="labelLeft"
|
|
20
|
-
@click="onSwitch(SWITCH_SIDE.LEFT)"
|
|
21
20
|
>
|
|
22
21
|
<ds-icon
|
|
23
22
|
v-if="iconLeft"
|
|
24
|
-
class="switch__icon"
|
|
23
|
+
class="ds-switch__icon"
|
|
25
24
|
:icon="iconLeft"
|
|
26
25
|
:size="ICON_SIZES.XX_SMALL"
|
|
27
26
|
/>
|
|
28
|
-
<div v-if="labelLeft" class="switch__label">
|
|
27
|
+
<div v-if="labelLeft" class="ds-switch__label">
|
|
29
28
|
{{ labelLeft }}
|
|
30
29
|
</div>
|
|
31
30
|
</div>
|
|
32
31
|
<div
|
|
33
|
-
class="switch__item -right"
|
|
32
|
+
class="ds-switch__item -ds-right"
|
|
34
33
|
:class="{
|
|
35
|
-
'-clickable':
|
|
36
|
-
|
|
34
|
+
'-ds-clickable':
|
|
35
|
+
currentSide !== SWITCH_SIDE.RIGHT && state !== SWITCH_STATE.DISABLED,
|
|
36
|
+
'-ds-selected': currentSide === SWITCH_SIDE.RIGHT,
|
|
37
37
|
}"
|
|
38
38
|
:title="labelRight"
|
|
39
|
-
@click="onSwitch(SWITCH_SIDE.RIGHT)"
|
|
40
39
|
>
|
|
41
40
|
<ds-icon
|
|
42
41
|
v-if="iconRight"
|
|
43
|
-
class="switch__icon"
|
|
42
|
+
class="ds-switch__icon"
|
|
44
43
|
:icon="iconRight"
|
|
45
44
|
:size="ICON_SIZES.XX_SMALL"
|
|
46
45
|
/>
|
|
47
|
-
<div v-if="labelRight" class="switch__label">
|
|
46
|
+
<div v-if="labelRight" class="ds-switch__label">
|
|
48
47
|
{{ labelRight }}
|
|
49
48
|
</div>
|
|
50
49
|
</div>
|
|
51
50
|
<div
|
|
52
|
-
class="switch__item -selection"
|
|
51
|
+
class="ds-switch__item -ds-selection"
|
|
53
52
|
:class="{
|
|
54
|
-
'-left': currentSide === SWITCH_SIDE.LEFT,
|
|
55
|
-
'-right': currentSide === SWITCH_SIDE.RIGHT,
|
|
53
|
+
'-ds-left': currentSide === SWITCH_SIDE.LEFT,
|
|
54
|
+
'-ds-right': currentSide === SWITCH_SIDE.RIGHT,
|
|
56
55
|
}"
|
|
57
56
|
>
|
|
58
57
|
<ds-icon
|
|
59
58
|
v-if="currentIcon"
|
|
60
|
-
class="switch__icon"
|
|
59
|
+
class="ds-switch__icon"
|
|
61
60
|
:icon="currentIcon"
|
|
62
61
|
:size="ICON_SIZES.XX_SMALL"
|
|
63
62
|
/>
|
|
64
|
-
<div v-if="currentLabel" class="switch__label">{{ currentLabel }}</div>
|
|
63
|
+
<div v-if="currentLabel" class="ds-switch__label">{{ currentLabel }}</div>
|
|
65
64
|
</div>
|
|
66
65
|
</div>
|
|
67
66
|
</template>
|
|
@@ -75,7 +74,7 @@
|
|
|
75
74
|
|
|
76
75
|
$switch-transition: all $default-transition-time ease-out;
|
|
77
76
|
|
|
78
|
-
.switch {
|
|
77
|
+
.ds-switch {
|
|
79
78
|
$root: &;
|
|
80
79
|
|
|
81
80
|
background-color: $color-default-background;
|
|
@@ -85,6 +84,10 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
85
84
|
max-width: 100%;
|
|
86
85
|
position: relative;
|
|
87
86
|
|
|
87
|
+
/* Prevent text select */
|
|
88
|
+
-webkit-user-select: none; /* Safari */
|
|
89
|
+
user-select: none;
|
|
90
|
+
|
|
88
91
|
&__icon {
|
|
89
92
|
color: $color-neutral-icon;
|
|
90
93
|
}
|
|
@@ -98,7 +101,7 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
98
101
|
white-space: nowrap;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
.-selected {
|
|
104
|
+
.-ds-selected {
|
|
102
105
|
#{$root}__icon {
|
|
103
106
|
color: $color-primary-icon;
|
|
104
107
|
}
|
|
@@ -128,15 +131,15 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
128
131
|
transition: $switch-transition;
|
|
129
132
|
z-index: 2;
|
|
130
133
|
|
|
131
|
-
&.-left {
|
|
134
|
+
&.-ds-left {
|
|
132
135
|
margin: -1px 0 -1px -1px;
|
|
133
136
|
}
|
|
134
137
|
|
|
135
|
-
&.-right {
|
|
138
|
+
&.-ds-right {
|
|
136
139
|
margin: -1px -1px -1px 0;
|
|
137
140
|
}
|
|
138
141
|
|
|
139
|
-
&.-selection {
|
|
142
|
+
&.-ds-selection {
|
|
140
143
|
background-color: $color-primary-background;
|
|
141
144
|
border: 1px solid $color-primary-border;
|
|
142
145
|
position: absolute;
|
|
@@ -154,29 +157,29 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
154
157
|
width: max-content;
|
|
155
158
|
}
|
|
156
159
|
|
|
157
|
-
&.-left {
|
|
160
|
+
&.-ds-left {
|
|
158
161
|
left: 0;
|
|
159
162
|
}
|
|
160
163
|
|
|
161
|
-
&.-right {
|
|
164
|
+
&.-ds-right {
|
|
162
165
|
left: calc(100% + 1px);
|
|
163
166
|
transform: translateX(-100%);
|
|
164
167
|
}
|
|
165
168
|
}
|
|
166
169
|
|
|
167
|
-
&.-selected,
|
|
168
|
-
&.-selection:hover {
|
|
170
|
+
&.-ds-selected,
|
|
171
|
+
&.-ds-selection:hover {
|
|
169
172
|
cursor: default;
|
|
170
173
|
flex-shrink: 0;
|
|
171
174
|
text-overflow: initial;
|
|
172
175
|
}
|
|
173
176
|
|
|
174
|
-
&.-clickable:hover {
|
|
177
|
+
&.-ds-clickable:hover {
|
|
175
178
|
background-color: $color-neutral-background-ghost-hovered;
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
&.-rounded {
|
|
182
|
+
&.-ds-rounded {
|
|
180
183
|
border-radius: $radius-xl;
|
|
181
184
|
|
|
182
185
|
#{$root}__item {
|
|
@@ -184,7 +187,7 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
|
|
187
|
-
&.-small &__item {
|
|
190
|
+
&.-ds-small &__item {
|
|
188
191
|
gap: $space-4xs;
|
|
189
192
|
max-width: calc(100% - 48px);
|
|
190
193
|
min-height: 24px;
|
|
@@ -192,7 +195,7 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
192
195
|
padding: 0 $space-xs;
|
|
193
196
|
}
|
|
194
197
|
|
|
195
|
-
&.-disabled &__item {
|
|
198
|
+
&.-ds-disabled &__item {
|
|
196
199
|
cursor: default;
|
|
197
200
|
pointer-events: none;
|
|
198
201
|
|
|
@@ -204,7 +207,7 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
204
207
|
color: $color-neutral-text-disabled;
|
|
205
208
|
}
|
|
206
209
|
|
|
207
|
-
&.-selected {
|
|
210
|
+
&.-ds-selected {
|
|
208
211
|
#{$root}__icon {
|
|
209
212
|
color: $color-primary-icon-disabled;
|
|
210
213
|
}
|
|
@@ -214,7 +217,7 @@ $switch-transition: all $default-transition-time ease-out;
|
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
|
|
217
|
-
&.-selection {
|
|
220
|
+
&.-ds-selection {
|
|
218
221
|
background-color: $color-primary-background-disabled;
|
|
219
222
|
border-color: $color-primary-border-disabled;
|
|
220
223
|
}
|
|
@@ -234,7 +237,7 @@ import {
|
|
|
234
237
|
SwitchSize,
|
|
235
238
|
SwitchState,
|
|
236
239
|
} from './Switch.consts';
|
|
237
|
-
import DsIcon, { ICON_SIZES,
|
|
240
|
+
import DsIcon, { ICON_SIZES, IconItem, ICONS } from '../Icons/Icon';
|
|
238
241
|
|
|
239
242
|
export default {
|
|
240
243
|
// eslint-disable-next-line vue/no-reserved-component-names
|
|
@@ -317,6 +320,12 @@ export default {
|
|
|
317
320
|
currentLabel() {
|
|
318
321
|
return this.currentSide === SWITCH_SIDE.LEFT ? this.labelLeft : this.labelRight;
|
|
319
322
|
},
|
|
323
|
+
oppositeSide() {
|
|
324
|
+
if (this.currentSide === SWITCH_SIDE.LEFT) {
|
|
325
|
+
return SWITCH_SIDE.RIGHT;
|
|
326
|
+
}
|
|
327
|
+
return SWITCH_SIDE.LEFT;
|
|
328
|
+
},
|
|
320
329
|
},
|
|
321
330
|
watch: {
|
|
322
331
|
selectedSide: {
|
|
@@ -329,12 +338,12 @@ export default {
|
|
|
329
338
|
},
|
|
330
339
|
},
|
|
331
340
|
methods: {
|
|
332
|
-
onSwitch(
|
|
333
|
-
if (this.state === SWITCH_STATE.DISABLED
|
|
341
|
+
onSwitch() {
|
|
342
|
+
if (this.state === SWITCH_STATE.DISABLED) {
|
|
334
343
|
return;
|
|
335
344
|
}
|
|
336
|
-
this.currentSide =
|
|
337
|
-
this.$emit('update:selectedSide',
|
|
345
|
+
this.currentSide = this.oppositeSide;
|
|
346
|
+
this.$emit('update:selectedSide', this.currentSide);
|
|
338
347
|
},
|
|
339
348
|
},
|
|
340
349
|
};
|