@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
|
@@ -27,12 +27,12 @@ describe('TabItem', () => {
|
|
|
27
27
|
it('when prop isSelected is set to false component should not render "isSelected" class', () => {
|
|
28
28
|
const component = createComponent({ isSelected: false });
|
|
29
29
|
|
|
30
|
-
expect(component.find('.-isSelected').exists()).toBe(false);
|
|
30
|
+
expect(component.find('.-ds-isSelected').exists()).toBe(false);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
it('when prop isSelected is set to true component should render "isSelected" class', () => {
|
|
34
34
|
const component = createComponent({ isSelected: true });
|
|
35
35
|
|
|
36
|
-
expect(component.find('.-isSelected').exists()).toBe(true);
|
|
36
|
+
expect(component.find('.-ds-isSelected').exists()).toBe(true);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="tabItem"
|
|
3
|
+
class="ds-tabItem"
|
|
4
4
|
:title="label"
|
|
5
5
|
:class="{
|
|
6
|
-
'-sizeMedium': size === TAB_ITEM_SIZES.MEDIUM,
|
|
7
|
-
'-sizeSmall': size === TAB_ITEM_SIZES.SMALL,
|
|
8
|
-
'-isSelected': isSelected,
|
|
6
|
+
'-ds-sizeMedium': size === TAB_ITEM_SIZES.MEDIUM,
|
|
7
|
+
'-ds-sizeSmall': size === TAB_ITEM_SIZES.SMALL,
|
|
8
|
+
'-ds-isSelected': isSelected,
|
|
9
9
|
}"
|
|
10
10
|
@click="$emit('click')"
|
|
11
11
|
>
|
|
12
12
|
<ds-icon
|
|
13
13
|
v-if="icon !== null"
|
|
14
|
-
class="tabItem__icon"
|
|
14
|
+
class="ds-tabItem__icon"
|
|
15
15
|
:icon="icon"
|
|
16
16
|
:size="ICON_SIZES.X_SMALL"
|
|
17
17
|
/>
|
|
18
|
-
<span v-if="label" class="tabItem__label" :class="{ '-ellipsis': labelEllipsis }">{{
|
|
18
|
+
<span v-if="label" class="ds-tabItem__label" :class="{ '-ds-ellipsis': labelEllipsis }">{{
|
|
19
19
|
label
|
|
20
20
|
}}</span>
|
|
21
21
|
</div>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@import '../../../styles/settings/typography/tokens';
|
|
28
28
|
@import '../../../styles/settings/animations';
|
|
29
29
|
|
|
30
|
-
.tabItem {
|
|
30
|
+
.ds-tabItem {
|
|
31
31
|
$self: &;
|
|
32
32
|
|
|
33
33
|
align-items: center;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
color: $color-neutral-text;
|
|
48
48
|
transition: color ease-in-out $default-transition-time;
|
|
49
49
|
|
|
50
|
-
&.-ellipsis {
|
|
50
|
+
&.-ds-ellipsis {
|
|
51
51
|
overflow: hidden;
|
|
52
52
|
text-overflow: ellipsis;
|
|
53
53
|
white-space: nowrap;
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
&.-isSelected {
|
|
68
|
+
&.-ds-isSelected {
|
|
69
69
|
box-shadow: inset 0 -1px 0 $color-primary-border;
|
|
70
70
|
|
|
71
71
|
#{$self}__icon {
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
&.-sizeSmall {
|
|
80
|
+
&.-ds-sizeSmall {
|
|
81
81
|
@include label-m-default-bold;
|
|
82
82
|
|
|
83
83
|
column-gap: $space-4xs;
|
|
84
84
|
padding: $space-xs;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
&.-sizeMedium {
|
|
87
|
+
&.-ds-sizeMedium {
|
|
88
88
|
@include label-l-default-bold;
|
|
89
89
|
|
|
90
90
|
column-gap: $space-2xs;
|
|
@@ -45,10 +45,10 @@ describe('Tile', () => {
|
|
|
45
45
|
interactive: true,
|
|
46
46
|
};
|
|
47
47
|
const component = createComponent(props);
|
|
48
|
-
expect(component.find('.
|
|
49
|
-
expect(component.find('.
|
|
50
|
-
expect(component.find('.
|
|
51
|
-
expect(component.find('.
|
|
48
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
49
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
50
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(false);
|
|
51
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(false);
|
|
52
52
|
|
|
53
53
|
expect(component.find('.a-additionalText').exists()).toBe(false);
|
|
54
54
|
});
|
|
@@ -61,10 +61,10 @@ describe('Tile', () => {
|
|
|
61
61
|
iconRight: Object.freeze(ICONS.FA_CHEVRON_RIGHT),
|
|
62
62
|
};
|
|
63
63
|
const component = createComponent(props);
|
|
64
|
-
expect(component.find('.
|
|
65
|
-
expect(component.find('.
|
|
66
|
-
expect(component.find('.
|
|
67
|
-
expect(component.find('.
|
|
64
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
65
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
66
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(true);
|
|
67
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(false);
|
|
68
68
|
|
|
69
69
|
expect(component.find('.a-additionalText').exists()).toBe(false);
|
|
70
70
|
});
|
|
@@ -78,10 +78,10 @@ describe('Tile', () => {
|
|
|
78
78
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
79
79
|
};
|
|
80
80
|
const component = createComponent(props);
|
|
81
|
-
expect(component.find('.
|
|
82
|
-
expect(component.find('.
|
|
83
|
-
expect(component.find('.
|
|
84
|
-
expect(component.find('.
|
|
81
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
82
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
83
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(true);
|
|
84
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
85
85
|
|
|
86
86
|
expect(component.find('.a-additionalText').exists()).toBe(false);
|
|
87
87
|
});
|
|
@@ -93,12 +93,12 @@ describe('Tile', () => {
|
|
|
93
93
|
interactive: true,
|
|
94
94
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
95
95
|
});
|
|
96
|
-
expect(component.find('.
|
|
97
|
-
expect(component.find('.
|
|
98
|
-
expect(component.find('.
|
|
99
|
-
expect(component.find('.
|
|
96
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
97
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
98
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(false);
|
|
99
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
100
100
|
|
|
101
|
-
expect(component.find('.
|
|
101
|
+
expect(component.find('.ds-tile__additionalText').exists()).toBe(true);
|
|
102
102
|
});
|
|
103
103
|
it('Is not interactive without right icon and additionalText', () => {
|
|
104
104
|
const component = createComponent({
|
|
@@ -106,12 +106,12 @@ describe('Tile', () => {
|
|
|
106
106
|
eyebrowText: 'eyebrowText text',
|
|
107
107
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
108
108
|
});
|
|
109
|
-
expect(component.find('.
|
|
110
|
-
expect(component.find('.
|
|
109
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
110
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
111
111
|
|
|
112
|
-
expect(component.find('.
|
|
113
|
-
expect(component.find('.
|
|
114
|
-
expect(component.find('.
|
|
112
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
113
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(false);
|
|
114
|
+
expect(component.find('.ds-tile__additionalText').exists()).toBe(false);
|
|
115
115
|
});
|
|
116
116
|
it('Is not interactive with right and without additionalText', () => {
|
|
117
117
|
const component = createComponent({
|
|
@@ -120,12 +120,12 @@ describe('Tile', () => {
|
|
|
120
120
|
iconRight: Object.freeze(ICONS.FA_ANGLE_RIGHT),
|
|
121
121
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
122
122
|
});
|
|
123
|
-
expect(component.find('.
|
|
124
|
-
expect(component.find('.
|
|
125
|
-
expect(component.find('.
|
|
123
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
124
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
125
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(true);
|
|
126
126
|
|
|
127
|
-
expect(component.find('.
|
|
128
|
-
expect(component.find('.
|
|
127
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
128
|
+
expect(component.find('.ds-tile__additionalText').exists()).toBe(false);
|
|
129
129
|
});
|
|
130
130
|
it('Is not interactive without right and with additionalText', () => {
|
|
131
131
|
const component = createComponent({
|
|
@@ -134,12 +134,12 @@ describe('Tile', () => {
|
|
|
134
134
|
additionalText: 'additionalText text',
|
|
135
135
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
136
136
|
});
|
|
137
|
-
expect(component.find('.
|
|
138
|
-
expect(component.find('.
|
|
139
|
-
expect(component.find('.
|
|
140
|
-
expect(component.find('.
|
|
137
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
138
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
139
|
+
expect(component.find('.ds-tile__iconRight').exists()).toBe(false);
|
|
140
|
+
expect(component.find('.ds-tile__additionalText').exists()).toBe(true);
|
|
141
141
|
|
|
142
|
-
expect(component.find('.
|
|
142
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
143
143
|
});
|
|
144
144
|
it('Is not interactive with right and additionalText but additionalText is not visible when right is present', () => {
|
|
145
145
|
const component = createComponent({
|
|
@@ -149,12 +149,12 @@ describe('Tile', () => {
|
|
|
149
149
|
iconRight: Object.freeze(ICONS.FA_ANGLE_RIGHT),
|
|
150
150
|
iconLeft: Object.freeze(ICONS.FA_BOX_ARCHIVE),
|
|
151
151
|
});
|
|
152
|
-
expect(component.find('.
|
|
153
|
-
expect(component.find('.
|
|
154
|
-
expect(component.find('.
|
|
155
|
-
expect(component.find('.
|
|
152
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
153
|
+
expect(component.find('.ds-tile__text').text()).toBe('text text');
|
|
154
|
+
expect(component.find('.ds-tile__iconRight .-ds-interactive').exists()).toBe(false);
|
|
155
|
+
expect(component.find('.ds-tile__additionalText').exists()).toBe(false);
|
|
156
156
|
|
|
157
|
-
expect(component.find('.
|
|
157
|
+
expect(component.find('.ds-tile__iconLeft').exists()).toBe(true);
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
it('Eyebrowtext is uppercased when isEyebrowTextUppercase', () => {
|
|
@@ -164,7 +164,7 @@ describe('Tile', () => {
|
|
|
164
164
|
additionalText: 'additionalText text',
|
|
165
165
|
isEyebrowTextUppercase: true,
|
|
166
166
|
});
|
|
167
|
-
expect(component.find('.
|
|
168
|
-
expect(component.find('.
|
|
167
|
+
expect(component.find('.ds-tile__eyebrowText').text()).toBe('eyebrowText text');
|
|
168
|
+
expect(component.find('.ds-tile__eyebrowText').classes()).toContain('-ds-uppercase');
|
|
169
169
|
});
|
|
170
170
|
});
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="[tileColor, tileState, { '-interactive': interactive }]" class="
|
|
2
|
+
<div :class="[tileColor, tileState, { '-ds-interactive': interactive }]" class="ds-tile">
|
|
3
3
|
<ds-icon
|
|
4
4
|
v-if="iconLeft"
|
|
5
5
|
:icon="iconLeft"
|
|
6
6
|
:size="ICON_SIZES.SMALL"
|
|
7
|
-
class="
|
|
7
|
+
class="ds-tile__iconLeft"
|
|
8
8
|
/>
|
|
9
|
-
<div class="
|
|
9
|
+
<div class="ds-tile__center">
|
|
10
10
|
<span
|
|
11
11
|
v-if="eyebrowText"
|
|
12
|
-
class="
|
|
13
|
-
:class="{
|
|
12
|
+
class="ds-tile__eyebrowText"
|
|
13
|
+
:class="{
|
|
14
|
+
'-ds-uppercase': isEyebrowTextUppercase,
|
|
15
|
+
'-ds-ellipsis': eyebrowEllipsis,
|
|
16
|
+
}"
|
|
14
17
|
v-text="eyebrowText"
|
|
15
18
|
/>
|
|
16
|
-
<span class="
|
|
19
|
+
<span class="ds-tile__text" :class="{ '-ds-ellipsis': textEllipsis }" v-text="text" />
|
|
17
20
|
</div>
|
|
18
21
|
<ds-icon
|
|
19
22
|
v-if="state === TILE_STATES.LOADING"
|
|
20
|
-
class="
|
|
23
|
+
class="ds-tile__iconRight"
|
|
21
24
|
:icon="ICONS.FAD_SPINNER_THIRD"
|
|
22
25
|
:size="ICON_SIZES.SMALL"
|
|
23
26
|
spinning
|
|
24
27
|
/>
|
|
25
28
|
<ds-icon
|
|
26
29
|
v-else-if="iconRight"
|
|
27
|
-
class="
|
|
30
|
+
class="ds-tile__iconRight"
|
|
28
31
|
:icon="iconRight"
|
|
29
32
|
:size="ICON_SIZES.SMALL"
|
|
30
33
|
/>
|
|
31
|
-
<div v-else-if="additionalText" class="
|
|
34
|
+
<div v-else-if="additionalText" class="ds-tile__additionalText">
|
|
32
35
|
{{ additionalText }}
|
|
33
36
|
</div>
|
|
34
37
|
</div>
|
|
@@ -161,28 +164,28 @@ $tile-colors: (
|
|
|
161
164
|
color: map-get($color-map, 'icon');
|
|
162
165
|
}
|
|
163
166
|
|
|
164
|
-
&.-interactive {
|
|
167
|
+
&.-ds-interactive {
|
|
165
168
|
#{$root}__iconRight {
|
|
166
169
|
color: map-get($color-map, 'icon-interactive');
|
|
167
170
|
}
|
|
168
171
|
|
|
169
|
-
&:not(.-loading):hover {
|
|
172
|
+
&:not(.-ds-loading):hover {
|
|
170
173
|
background-color: map-get($color-map, 'background-hover');
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
|
|
174
|
-
&.-loading {
|
|
177
|
+
&.-ds-loading {
|
|
175
178
|
#{$root}__iconRight {
|
|
176
179
|
color: map-get($color-map, 'icon-interactive');
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
|
|
181
|
-
.
|
|
184
|
+
.ds-tile {
|
|
182
185
|
$self: &;
|
|
183
186
|
|
|
184
187
|
@each $color-name, $color-map in $tile-colors {
|
|
185
|
-
|
|
188
|
+
&.-ds-#{$color-name} {
|
|
186
189
|
@include setColors($self, map-get($color-map, 'default'));
|
|
187
190
|
}
|
|
188
191
|
}
|
|
@@ -195,9 +198,9 @@ $tile-colors: (
|
|
|
195
198
|
padding: $space-2xs $space-xs;
|
|
196
199
|
transition: background-color ease-in-out $default-transition-time;
|
|
197
200
|
|
|
198
|
-
&.-disabled {
|
|
201
|
+
&.-ds-disabled {
|
|
199
202
|
@each $color-name, $color-map in $tile-colors {
|
|
200
|
-
|
|
203
|
+
&.-ds-#{$color-name} {
|
|
201
204
|
@include setColors($self, map-get($color-map, 'disabled'));
|
|
202
205
|
}
|
|
203
206
|
}
|
|
@@ -231,11 +234,11 @@ $tile-colors: (
|
|
|
231
234
|
|
|
232
235
|
margin-bottom: $space-4xs;
|
|
233
236
|
|
|
234
|
-
&.-uppercase {
|
|
237
|
+
&.-ds-uppercase {
|
|
235
238
|
@include info-m-extensive-bold-uppercase();
|
|
236
239
|
}
|
|
237
240
|
|
|
238
|
-
&.-ellipsis {
|
|
241
|
+
&.-ds-ellipsis {
|
|
239
242
|
overflow: hidden;
|
|
240
243
|
text-overflow: ellipsis;
|
|
241
244
|
white-space: nowrap;
|
|
@@ -247,7 +250,7 @@ $tile-colors: (
|
|
|
247
250
|
|
|
248
251
|
color: $color-neutral-text-heavy;
|
|
249
252
|
|
|
250
|
-
&.-ellipsis {
|
|
253
|
+
&.-ds-ellipsis {
|
|
251
254
|
overflow: hidden;
|
|
252
255
|
text-overflow: ellipsis;
|
|
253
256
|
white-space: nowrap;
|
|
@@ -262,7 +265,7 @@ $tile-colors: (
|
|
|
262
265
|
margin-left: $space-xs;
|
|
263
266
|
}
|
|
264
267
|
|
|
265
|
-
&.-interactive:not(.-disabled):not(.-loading) {
|
|
268
|
+
&.-ds-interactive:not(.-ds-disabled):not(.-ds-loading) {
|
|
266
269
|
cursor: pointer;
|
|
267
270
|
}
|
|
268
271
|
}
|
|
@@ -289,20 +292,20 @@ export default {
|
|
|
289
292
|
computed: {
|
|
290
293
|
tileColor() {
|
|
291
294
|
return {
|
|
292
|
-
[TILE_COLORS.NEUTRAL]: '-neutral',
|
|
293
|
-
[TILE_COLORS.NEUTRAL_WEAK]: '-neutralWeak',
|
|
294
|
-
[TILE_COLORS.PRIMARY]: '-primary',
|
|
295
|
-
[TILE_COLORS.SUCCESS]: '-success',
|
|
296
|
-
[TILE_COLORS.FAIL]: '-fail',
|
|
297
|
-
[TILE_COLORS.WARNING]: '-warning',
|
|
298
|
-
[TILE_COLORS.INFO]: '-info',
|
|
295
|
+
[TILE_COLORS.NEUTRAL]: '-ds-neutral',
|
|
296
|
+
[TILE_COLORS.NEUTRAL_WEAK]: '-ds-neutralWeak',
|
|
297
|
+
[TILE_COLORS.PRIMARY]: '-ds-primary',
|
|
298
|
+
[TILE_COLORS.SUCCESS]: '-ds-success',
|
|
299
|
+
[TILE_COLORS.FAIL]: '-ds-fail',
|
|
300
|
+
[TILE_COLORS.WARNING]: '-ds-warning',
|
|
301
|
+
[TILE_COLORS.INFO]: '-ds-info',
|
|
299
302
|
}[this.color];
|
|
300
303
|
},
|
|
301
304
|
tileState() {
|
|
302
305
|
return {
|
|
303
306
|
[TILE_STATES.DEFAULT]: null,
|
|
304
|
-
[TILE_STATES.DISABLED]: '-disabled',
|
|
305
|
-
[TILE_STATES.LOADING]: '-loading',
|
|
307
|
+
[TILE_STATES.DISABLED]: '-ds-disabled',
|
|
308
|
+
[TILE_STATES.LOADING]: '-ds-loading',
|
|
306
309
|
}[this.state];
|
|
307
310
|
},
|
|
308
311
|
},
|
|
@@ -20,17 +20,17 @@ describe('CounterToggle', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
test.each([
|
|
23
|
-
[{ props: { color: COUNTER_TOGGLE_COLORS.INVERTED }, expectedClass: '-color-inverted' }],
|
|
23
|
+
[{ props: { color: COUNTER_TOGGLE_COLORS.INVERTED }, expectedClass: '-ds-color-inverted' }],
|
|
24
24
|
[
|
|
25
25
|
{
|
|
26
26
|
props: { color: COUNTER_TOGGLE_COLORS.NEUTRAL_STRONG },
|
|
27
|
-
expectedClass: '-color-neutralStrong',
|
|
27
|
+
expectedClass: '-ds-color-neutralStrong',
|
|
28
28
|
},
|
|
29
29
|
],
|
|
30
|
-
[{ props: { color: COUNTER_TOGGLE_COLORS.NEUTRAL }, expectedClass: '-color-neutral' }],
|
|
31
|
-
[{ props: { color: COUNTER_TOGGLE_COLORS.PRIMARY }, expectedClass: '-color-primary' }],
|
|
32
|
-
[{ props: { isSelected: true }, expectedClass: '-selected' }],
|
|
33
|
-
[{ props: { isDisabled: true }, expectedClass: '-disabled' }],
|
|
30
|
+
[{ props: { color: COUNTER_TOGGLE_COLORS.NEUTRAL }, expectedClass: '-ds-color-neutral' }],
|
|
31
|
+
[{ props: { color: COUNTER_TOGGLE_COLORS.PRIMARY }, expectedClass: '-ds-color-primary' }],
|
|
32
|
+
[{ props: { isSelected: true }, expectedClass: '-ds-selected' }],
|
|
33
|
+
[{ props: { isDisabled: true }, expectedClass: '-ds-disabled' }],
|
|
34
34
|
])('correct class for props', ({ props, expectedClass }) => {
|
|
35
35
|
const outlinedCounterToggle = createComponent(props);
|
|
36
36
|
expect(outlinedCounterToggle.classes()).toContain(expectedClass);
|
|
@@ -38,7 +38,7 @@ describe('CounterToggle', () => {
|
|
|
38
38
|
|
|
39
39
|
it('should render icon', () => {
|
|
40
40
|
const icon = createComponent({ icon: Object.freeze(ICONS.FA_XMARK) });
|
|
41
|
-
let iconElement = icon.findComponent<typeof CounterToggle>('.counterToggle__icon');
|
|
41
|
+
let iconElement = icon.findComponent<typeof CounterToggle>('.ds-counterToggle__icon');
|
|
42
42
|
expect(iconElement.exists()).toBe(true);
|
|
43
43
|
expect(iconElement.props().icon).toEqual(Object.freeze(ICONS.FA_XMARK));
|
|
44
44
|
});
|
|
@@ -54,7 +54,7 @@ describe('CounterToggle', () => {
|
|
|
54
54
|
[{ props: { counter: 'test' }, expectedText: 'test', expectedToExist: true }],
|
|
55
55
|
])('correct counter', ({ props, expectedText, expectedToExist }) => {
|
|
56
56
|
const counterToggle = createComponent(props);
|
|
57
|
-
const counterElement = counterToggle.find('.counterToggle__counter');
|
|
57
|
+
const counterElement = counterToggle.find('.ds-counterToggle__counter');
|
|
58
58
|
expect(counterElement.exists()).toBe(expectedToExist);
|
|
59
59
|
if (expectedToExist) {
|
|
60
60
|
expect(counterElement.text()).toBe(expectedText);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="counterToggle"
|
|
4
|
-
:class="[{ '-selected': isSelected, '-disabled': isDisabled }, colorClass]"
|
|
3
|
+
class="ds-counterToggle"
|
|
4
|
+
:class="[{ '-ds-selected': isSelected, '-ds-disabled': isDisabled }, colorClass]"
|
|
5
5
|
>
|
|
6
|
-
<icon class="counterToggle__icon" :icon="icon" :size="ICON_SIZES.X_SMALL" />
|
|
7
|
-
<span v-if="hasCounter" class="counterToggle__counter">{{ counter }}</span>
|
|
6
|
+
<icon class="ds-counterToggle__icon" :icon="icon" :size="ICON_SIZES.X_SMALL" />
|
|
7
|
+
<span v-if="hasCounter" class="ds-counterToggle__counter">{{ counter }}</span>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -143,46 +143,46 @@ $counter-toggle-colors: (
|
|
|
143
143
|
background-color: $background;
|
|
144
144
|
|
|
145
145
|
&:hover,
|
|
146
|
-
&.-hovered {
|
|
146
|
+
&.-ds-hovered {
|
|
147
147
|
background-color: $background-hover;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
&:active,
|
|
151
|
-
&.-active {
|
|
151
|
+
&.-ds-active {
|
|
152
152
|
background-color: $background-pressed;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
&:focus,
|
|
156
|
-
&.-focused {
|
|
156
|
+
&.-ds-focused {
|
|
157
157
|
background-color: $background-focus;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
@mixin setCounterToggleDisabled($disabled-color, $disabled-icon, $disabled-background) {
|
|
162
162
|
&:disabled,
|
|
163
|
-
&.-disabled {
|
|
163
|
+
&.-ds-disabled {
|
|
164
164
|
background-color: $disabled-background;
|
|
165
165
|
color: $disabled-color;
|
|
166
166
|
|
|
167
|
-
.counterToggle__icon {
|
|
167
|
+
.ds-counterToggle__icon {
|
|
168
168
|
color: $disabled-icon;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
@mixin setCounterToggleAdditions($icon) {
|
|
174
|
-
.counterToggle {
|
|
174
|
+
.ds-counterToggle {
|
|
175
175
|
&__icon {
|
|
176
176
|
color: $icon;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.counterToggle {
|
|
181
|
+
.ds-counterToggle {
|
|
182
182
|
$self: &;
|
|
183
183
|
|
|
184
184
|
@each $color-name, $color-map in $counter-toggle-colors {
|
|
185
|
-
&.-color-#{$color-name} {
|
|
185
|
+
&.-ds-color-#{$color-name} {
|
|
186
186
|
@include setCounterToggleColor(map-get($color-map, 'default', 'color'));
|
|
187
187
|
@include setCounterToggleBackground(
|
|
188
188
|
map-get($color-map, 'default', 'background'),
|
|
@@ -213,9 +213,9 @@ $counter-toggle-colors: (
|
|
|
213
213
|
user-select: none;
|
|
214
214
|
width: auto;
|
|
215
215
|
|
|
216
|
-
&.-selected {
|
|
216
|
+
&.-ds-selected {
|
|
217
217
|
@each $color-name, $color-map in $counter-toggle-colors {
|
|
218
|
-
&.-color-#{$color-name} {
|
|
218
|
+
&.-ds-color-#{$color-name} {
|
|
219
219
|
@include setCounterToggleColor(map-get($color-map, 'selected', 'color'));
|
|
220
220
|
@include setCounterToggleBackground(
|
|
221
221
|
map-get($color-map, 'selected', 'background'),
|
|
@@ -234,7 +234,7 @@ $counter-toggle-colors: (
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
&:disabled,
|
|
237
|
-
&.-disabled {
|
|
237
|
+
&.-ds-disabled {
|
|
238
238
|
pointer-events: none;
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -295,7 +295,7 @@ export default {
|
|
|
295
295
|
},
|
|
296
296
|
computed: {
|
|
297
297
|
colorClass(): string {
|
|
298
|
-
return `-color-${this.color}`;
|
|
298
|
+
return `-ds-color-${this.color}`;
|
|
299
299
|
},
|
|
300
300
|
hasCounter(): boolean {
|
|
301
301
|
return this.counter !== null && this.counter !== '' && this.counter !== undefined;
|