@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
package/docs/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1716286360999,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"metaFramework":{"name":"vue-cli","packageName":"@vue/cli-service","version":"5.0.8"},"packageManager":{"type":"yarn","version":"1.22.22"},"storybookVersion":"6.5.13","language":"typescript","storybookPackages":{"@storybook/builder-webpack5":{"version":"6.5.13"},"@storybook/manager-webpack5":{"version":"6.5.13"},"@storybook/vue3":{"version":"6.5.13"},"eslint-plugin-storybook":{"version":"0.6.6"}},"framework":{"name":"vue3"},"addons":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-controls":{"version":"6.5.15"},"@storybook/addon-storysource":{"version":"6.5.15"},"@storybook/addon-viewport":{"version":"6.5.15"},"storybook-addon-designs":{"version":"6.3.1"}}}
|
|
@@ -37,80 +37,80 @@ describe('BadgeScore', () => {
|
|
|
37
37
|
it(`when color is set as ${BADGE_SCORE_COLORS.SUCCESS} should render -success class`, () => {
|
|
38
38
|
const component = createComponent({ color: BADGE_SCORE_COLORS.SUCCESS });
|
|
39
39
|
|
|
40
|
-
expect(component.find('.-success').exists()).toBe(true);
|
|
41
|
-
expect(component.find('.-warning').exists()).toBe(false);
|
|
42
|
-
expect(component.find('.-fail').exists()).toBe(false);
|
|
43
|
-
expect(component.find('.-neutral').exists()).toBe(false);
|
|
44
|
-
expect(component.find('.-neutralWeak').exists()).toBe(false);
|
|
45
|
-
expect(component.find('.-inverted').exists()).toBe(false);
|
|
40
|
+
expect(component.find('.-ds-success').exists()).toBe(true);
|
|
41
|
+
expect(component.find('.-ds-warning').exists()).toBe(false);
|
|
42
|
+
expect(component.find('.-ds-fail').exists()).toBe(false);
|
|
43
|
+
expect(component.find('.-ds-neutral').exists()).toBe(false);
|
|
44
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(false);
|
|
45
|
+
expect(component.find('.-ds-inverted').exists()).toBe(false);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
it(`when color is set as ${BADGE_SCORE_COLORS.WARNING} should render -warning class`, () => {
|
|
49
49
|
const component = createComponent({ color: BADGE_SCORE_COLORS.WARNING });
|
|
50
50
|
|
|
51
|
-
expect(component.find('.-success').exists()).toBe(false);
|
|
52
|
-
expect(component.find('.-warning').exists()).toBe(true);
|
|
53
|
-
expect(component.find('.-fail').exists()).toBe(false);
|
|
54
|
-
expect(component.find('.-neutral').exists()).toBe(false);
|
|
55
|
-
expect(component.find('.-neutralWeak').exists()).toBe(false);
|
|
56
|
-
expect(component.find('.-inverted').exists()).toBe(false);
|
|
51
|
+
expect(component.find('.-ds-success').exists()).toBe(false);
|
|
52
|
+
expect(component.find('.-ds-warning').exists()).toBe(true);
|
|
53
|
+
expect(component.find('.-ds-fail').exists()).toBe(false);
|
|
54
|
+
expect(component.find('.-ds-neutral').exists()).toBe(false);
|
|
55
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(false);
|
|
56
|
+
expect(component.find('.-ds-inverted').exists()).toBe(false);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it(`when color is set as ${BADGE_SCORE_COLORS.FAIL} should render -fail class`, () => {
|
|
60
60
|
const component = createComponent({ color: BADGE_SCORE_COLORS.FAIL });
|
|
61
61
|
|
|
62
|
-
expect(component.find('.-success').exists()).toBe(false);
|
|
63
|
-
expect(component.find('.-warning').exists()).toBe(false);
|
|
64
|
-
expect(component.find('.-fail').exists()).toBe(true);
|
|
65
|
-
expect(component.find('.-neutral').exists()).toBe(false);
|
|
66
|
-
expect(component.find('.-neutralWeak').exists()).toBe(false);
|
|
67
|
-
expect(component.find('.-inverted').exists()).toBe(false);
|
|
62
|
+
expect(component.find('.-ds-success').exists()).toBe(false);
|
|
63
|
+
expect(component.find('.-ds-warning').exists()).toBe(false);
|
|
64
|
+
expect(component.find('.-ds-fail').exists()).toBe(true);
|
|
65
|
+
expect(component.find('.-ds-neutral').exists()).toBe(false);
|
|
66
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(false);
|
|
67
|
+
expect(component.find('.-ds-inverted').exists()).toBe(false);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
it(`when color is set as ${BADGE_SCORE_COLORS.INVERTED} should render -inverted class`, () => {
|
|
71
71
|
const component = createComponent({ color: BADGE_SCORE_COLORS.INVERTED });
|
|
72
72
|
|
|
73
|
-
expect(component.find('.-success').exists()).toBe(false);
|
|
74
|
-
expect(component.find('.-warning').exists()).toBe(false);
|
|
75
|
-
expect(component.find('.-fail').exists()).toBe(false);
|
|
76
|
-
expect(component.find('.-neutral').exists()).toBe(false);
|
|
77
|
-
expect(component.find('.-neutralWeak').exists()).toBe(false);
|
|
78
|
-
expect(component.find('.-inverted').exists()).toBe(true);
|
|
73
|
+
expect(component.find('.-ds-success').exists()).toBe(false);
|
|
74
|
+
expect(component.find('.-ds-warning').exists()).toBe(false);
|
|
75
|
+
expect(component.find('.-ds-fail').exists()).toBe(false);
|
|
76
|
+
expect(component.find('.-ds-neutral').exists()).toBe(false);
|
|
77
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(false);
|
|
78
|
+
expect(component.find('.-ds-inverted').exists()).toBe(true);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
it(`when color is set as ${BADGE_SCORE_COLORS.NEUTRAL} should render -fail class`, () => {
|
|
82
82
|
const component = createComponent({ color: BADGE_SCORE_COLORS.NEUTRAL });
|
|
83
83
|
|
|
84
|
-
expect(component.find('.-success').exists()).toBe(false);
|
|
85
|
-
expect(component.find('.-warning').exists()).toBe(false);
|
|
86
|
-
expect(component.find('.-fail').exists()).toBe(false);
|
|
87
|
-
expect(component.find('.-neutral').exists()).toBe(true);
|
|
88
|
-
expect(component.find('.-neutralWeak').exists()).toBe(false);
|
|
89
|
-
expect(component.find('.-inverted').exists()).toBe(false);
|
|
84
|
+
expect(component.find('.-ds-success').exists()).toBe(false);
|
|
85
|
+
expect(component.find('.-ds-warning').exists()).toBe(false);
|
|
86
|
+
expect(component.find('.-ds-fail').exists()).toBe(false);
|
|
87
|
+
expect(component.find('.-ds-neutral').exists()).toBe(true);
|
|
88
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(false);
|
|
89
|
+
expect(component.find('.-ds-inverted').exists()).toBe(false);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
it(`when color is set as ${BADGE_SCORE_COLORS.NEUTRAL_WEAK} should render -fail class`, () => {
|
|
93
93
|
const component = createComponent({ color: BADGE_SCORE_COLORS.NEUTRAL_WEAK });
|
|
94
94
|
|
|
95
|
-
expect(component.find('.-success').exists()).toBe(false);
|
|
96
|
-
expect(component.find('.-warning').exists()).toBe(false);
|
|
97
|
-
expect(component.find('.-fail').exists()).toBe(false);
|
|
98
|
-
expect(component.find('.-neutral').exists()).toBe(false);
|
|
99
|
-
expect(component.find('.-neutralWeak').exists()).toBe(true);
|
|
100
|
-
expect(component.find('.-inverted').exists()).toBe(false);
|
|
95
|
+
expect(component.find('.-ds-success').exists()).toBe(false);
|
|
96
|
+
expect(component.find('.-ds-warning').exists()).toBe(false);
|
|
97
|
+
expect(component.find('.-ds-fail').exists()).toBe(false);
|
|
98
|
+
expect(component.find('.-ds-neutral').exists()).toBe(false);
|
|
99
|
+
expect(component.find('.-ds-neutralWeak').exists()).toBe(true);
|
|
100
|
+
expect(component.find('.-ds-inverted').exists()).toBe(false);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
it(`when size is set as ${BADGE_SCORE_SIZES.SMALL} should render -small class`, () => {
|
|
104
104
|
const component = createComponent({ size: BADGE_SCORE_SIZES.SMALL });
|
|
105
105
|
|
|
106
|
-
expect(component.find('.-small').exists()).toBe(true);
|
|
107
|
-
expect(component.find('.-xsmall').exists()).toBe(false);
|
|
106
|
+
expect(component.find('.-ds-small').exists()).toBe(true);
|
|
107
|
+
expect(component.find('.-ds-xsmall').exists()).toBe(false);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
it(`when size is set as ${BADGE_SCORE_SIZES.XSMALL} should render -xsmall class`, () => {
|
|
111
111
|
const component = createComponent({ size: BADGE_SCORE_SIZES.XSMALL });
|
|
112
112
|
|
|
113
|
-
expect(component.find('.-small').exists()).toBe(false);
|
|
114
|
-
expect(component.find('.-xsmall').exists()).toBe(true);
|
|
113
|
+
expect(component.find('.-ds-small').exists()).toBe(false);
|
|
114
|
+
expect(component.find('.-ds-xsmall').exists()).toBe(true);
|
|
115
115
|
});
|
|
116
116
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="badgeScore"
|
|
3
|
+
class="ds-badgeScore"
|
|
4
4
|
:class="{
|
|
5
|
-
'-success': color === BADGE_SCORE_COLORS.SUCCESS,
|
|
6
|
-
'-warning': color === BADGE_SCORE_COLORS.WARNING,
|
|
7
|
-
'-fail': color === BADGE_SCORE_COLORS.FAIL,
|
|
8
|
-
'-inverted': color === BADGE_SCORE_COLORS.INVERTED,
|
|
9
|
-
'-neutralWeak': color === BADGE_SCORE_COLORS.NEUTRAL_WEAK,
|
|
10
|
-
'-neutral': color === BADGE_SCORE_COLORS.NEUTRAL,
|
|
11
|
-
'-small': size === BADGE_SCORE_SIZES.SMALL,
|
|
12
|
-
'-xsmall': size === BADGE_SCORE_SIZES.XSMALL,
|
|
13
|
-
'-fullWidth': fullWidth,
|
|
5
|
+
'-ds-success': color === BADGE_SCORE_COLORS.SUCCESS,
|
|
6
|
+
'-ds-warning': color === BADGE_SCORE_COLORS.WARNING,
|
|
7
|
+
'-ds-fail': color === BADGE_SCORE_COLORS.FAIL,
|
|
8
|
+
'-ds-inverted': color === BADGE_SCORE_COLORS.INVERTED,
|
|
9
|
+
'-ds-neutralWeak': color === BADGE_SCORE_COLORS.NEUTRAL_WEAK,
|
|
10
|
+
'-ds-neutral': color === BADGE_SCORE_COLORS.NEUTRAL,
|
|
11
|
+
'-ds-small': size === BADGE_SCORE_SIZES.SMALL,
|
|
12
|
+
'-ds-xsmall': size === BADGE_SCORE_SIZES.XSMALL,
|
|
13
|
+
'-ds-fullWidth': fullWidth,
|
|
14
14
|
}"
|
|
15
15
|
>
|
|
16
|
-
<wnl-icon v-if="icon" class="badgeScore__icon" :icon="icon" :size="iconSize" />
|
|
17
|
-
<div class="badgeScore__text">{{ text }}</div>
|
|
18
|
-
<span class="badgeScore__suffix">{{ suffix }}</span>
|
|
16
|
+
<wnl-icon v-if="icon" class="ds-badgeScore__icon" :icon="icon" :size="iconSize" />
|
|
17
|
+
<div class="ds-badgeScore__text">{{ text }}</div>
|
|
18
|
+
<span class="ds-badgeScore__suffix">{{ suffix }}</span>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
@@ -83,20 +83,20 @@ $badge-score-colors: (
|
|
|
83
83
|
color: $color-suffix;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
&.-xsmall {
|
|
86
|
+
&.-ds-xsmall {
|
|
87
87
|
#{$self}__suffix {
|
|
88
88
|
color: $color-suffix-xs;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
.badgeScore {
|
|
93
|
+
.ds-badgeScore {
|
|
94
94
|
$self: &;
|
|
95
95
|
|
|
96
96
|
@include label-2xl-default-bold;
|
|
97
97
|
|
|
98
98
|
@each $color-name, $color-map in $badge-score-colors {
|
|
99
|
-
|
|
99
|
+
&.-ds-#{$color-name} {
|
|
100
100
|
@include setBadgeScoreColor(
|
|
101
101
|
$self,
|
|
102
102
|
map-get($color-map, 'background'),
|
|
@@ -129,7 +129,7 @@ $badge-score-colors: (
|
|
|
129
129
|
align-self: baseline;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
&.-small {
|
|
132
|
+
&.-ds-small {
|
|
133
133
|
@include label-xl-default-bold;
|
|
134
134
|
|
|
135
135
|
min-width: $badge-score-small-min-width;
|
|
@@ -140,7 +140,7 @@ $badge-score-colors: (
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
&.-xsmall {
|
|
143
|
+
&.-ds-xsmall {
|
|
144
144
|
@include label-s-default-bold;
|
|
145
145
|
|
|
146
146
|
min-width: $badge-score-x-small-min-width;
|
|
@@ -151,7 +151,7 @@ $badge-score-colors: (
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
&.-fullWidth {
|
|
154
|
+
&.-ds-fullWidth {
|
|
155
155
|
width: 100%;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -159,7 +159,7 @@ $badge-score-colors: (
|
|
|
159
159
|
|
|
160
160
|
<script lang="ts">
|
|
161
161
|
import { BADGE_SCORE_COLORS, BADGE_SCORE_SIZES } from './BadgeScore.consts';
|
|
162
|
-
import WnlIcon, {
|
|
162
|
+
import WnlIcon, { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
163
163
|
import { toRaw } from 'vue';
|
|
164
164
|
|
|
165
165
|
export default {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<div
|
|
6
6
|
v-if="icon"
|
|
7
7
|
class="ds-banner__iconContainer"
|
|
8
|
-
:class="{ '-hideOnMobile': isIconHiddenOnMobile }"
|
|
8
|
+
:class="{ '-ds-hideOnMobile': isIconHiddenOnMobile }"
|
|
9
9
|
>
|
|
10
10
|
<!-- TODO: https://bethink.atlassian.net/browse/IT-3589 change to a-illustration in the future -->
|
|
11
11
|
<ds-icon class="ds-banner__icon" :class="[colorClass]" :icon="icon" />
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
padding: $space-xs;
|
|
84
84
|
|
|
85
85
|
@media #{breakpoint-s()} {
|
|
86
|
-
&.-horizontal {
|
|
86
|
+
&.-ds-horizontal {
|
|
87
87
|
#{$self}__iconContainer {
|
|
88
88
|
padding: $space-2xs 0;
|
|
89
89
|
}
|
|
@@ -115,37 +115,37 @@
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
&.-warning {
|
|
118
|
+
&.-ds-warning {
|
|
119
119
|
background-color: $color-warning-background;
|
|
120
120
|
border-color: $color-warning-border-weak;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
&.-success {
|
|
123
|
+
&.-ds-success {
|
|
124
124
|
background-color: $color-success-background;
|
|
125
125
|
border-color: $color-success-border-weak;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
&.-info {
|
|
128
|
+
&.-ds-info {
|
|
129
129
|
background-color: $color-info-background;
|
|
130
130
|
border-color: $color-info-border-weak;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
&.-fail {
|
|
133
|
+
&.-ds-fail {
|
|
134
134
|
background-color: $color-fail-background;
|
|
135
135
|
border-color: $color-fail-border-weak;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
&.-neutral {
|
|
138
|
+
&.-ds-neutral {
|
|
139
139
|
background-color: $color-neutral-background;
|
|
140
140
|
border-color: $color-neutral-border-weak;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
&.-default {
|
|
143
|
+
&.-ds-default {
|
|
144
144
|
background-color: $color-default-background;
|
|
145
145
|
border-color: $color-neutral-border-weak;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
&.-danger {
|
|
148
|
+
&.-ds-danger {
|
|
149
149
|
background-color: $color-danger-background;
|
|
150
150
|
border-color: $color-danger-border-weak;
|
|
151
151
|
}
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
margin-right: $space-s;
|
|
213
213
|
padding: $space-4xs 0;
|
|
214
214
|
|
|
215
|
-
&.-hideOnMobile {
|
|
215
|
+
&.-ds-hideOnMobile {
|
|
216
216
|
display: none;
|
|
217
217
|
|
|
218
218
|
@media #{breakpoint-s()} {
|
|
@@ -225,37 +225,37 @@
|
|
|
225
225
|
border-radius: 100px;
|
|
226
226
|
padding: $space-2xs;
|
|
227
227
|
|
|
228
|
-
&.-neutral {
|
|
228
|
+
&.-ds-neutral {
|
|
229
229
|
background-color: $color-neutral-background-medium;
|
|
230
230
|
color: $color-neutral-icon;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
&.-default {
|
|
233
|
+
&.-ds-default {
|
|
234
234
|
background-color: $color-neutral-background-medium;
|
|
235
235
|
color: $color-neutral-icon;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
&.-warning {
|
|
238
|
+
&.-ds-warning {
|
|
239
239
|
background-color: $color-warning-background-medium;
|
|
240
240
|
color: $color-warning-icon;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
&.-success {
|
|
243
|
+
&.-ds-success {
|
|
244
244
|
background-color: $color-success-background-medium;
|
|
245
245
|
color: $color-success-icon;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
&.-info {
|
|
248
|
+
&.-ds-info {
|
|
249
249
|
background-color: $color-info-background-medium;
|
|
250
250
|
color: $color-info-icon;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
&.-fail {
|
|
253
|
+
&.-ds-fail {
|
|
254
254
|
background-color: $color-fail-background-medium;
|
|
255
255
|
color: $color-fail-icon;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
&.-danger {
|
|
258
|
+
&.-ds-danger {
|
|
259
259
|
background-color: $color-danger-background-medium;
|
|
260
260
|
color: $color-danger-icon;
|
|
261
261
|
}
|
|
@@ -285,15 +285,14 @@
|
|
|
285
285
|
|
|
286
286
|
<script lang="ts">
|
|
287
287
|
import DsButton, {
|
|
288
|
-
BUTTON_RADIUSES,
|
|
289
|
-
BUTTON_TYPES,
|
|
290
288
|
BUTTON_COLORS,
|
|
289
|
+
BUTTON_RADIUSES,
|
|
291
290
|
BUTTON_SIZES,
|
|
291
|
+
BUTTON_TYPES,
|
|
292
292
|
} from '../Buttons/Button';
|
|
293
293
|
import DsDivider, { DIVIDER_PROMINENCES } from '../Divider';
|
|
294
|
-
import DsIcon from '../Icons/Icon';
|
|
294
|
+
import DsIcon, { ICONS } from '../Icons/Icon';
|
|
295
295
|
import DsIconButton, { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES } from '../Buttons/IconButton';
|
|
296
|
-
import { ICONS } from '../Icons/Icon';
|
|
297
296
|
import { BANNER_COLORS, BANNER_LAYOUTS } from './Banner.consts';
|
|
298
297
|
import { toRaw } from 'vue';
|
|
299
298
|
|
|
@@ -361,17 +360,17 @@ export default {
|
|
|
361
360
|
computed: {
|
|
362
361
|
colorClass() {
|
|
363
362
|
return {
|
|
364
|
-
[BANNER_COLORS.NEUTRAL]: '-neutral',
|
|
365
|
-
[BANNER_COLORS.DEFAULT]: '-default',
|
|
366
|
-
[BANNER_COLORS.FAIL]: '-fail',
|
|
367
|
-
[BANNER_COLORS.INFO]: '-info',
|
|
368
|
-
[BANNER_COLORS.SUCCESS]: '-success',
|
|
369
|
-
[BANNER_COLORS.WARNING]: '-warning',
|
|
370
|
-
[BANNER_COLORS.DANGER]: '-danger',
|
|
363
|
+
[BANNER_COLORS.NEUTRAL]: '-ds-neutral',
|
|
364
|
+
[BANNER_COLORS.DEFAULT]: '-ds-default',
|
|
365
|
+
[BANNER_COLORS.FAIL]: '-ds-fail',
|
|
366
|
+
[BANNER_COLORS.INFO]: '-ds-info',
|
|
367
|
+
[BANNER_COLORS.SUCCESS]: '-ds-success',
|
|
368
|
+
[BANNER_COLORS.WARNING]: '-ds-warning',
|
|
369
|
+
[BANNER_COLORS.DANGER]: '-ds-danger',
|
|
371
370
|
}[this.color];
|
|
372
371
|
},
|
|
373
372
|
layoutClass() {
|
|
374
|
-
return this.layout === BANNER_LAYOUTS.VERTICAL ? '-vertical' : '-horizontal';
|
|
373
|
+
return this.layout === BANNER_LAYOUTS.VERTICAL ? '-ds-vertical' : '-ds-horizontal';
|
|
375
374
|
},
|
|
376
375
|
},
|
|
377
376
|
watch: {
|
|
@@ -27,18 +27,18 @@ describe('Button', () => {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test.each([
|
|
30
|
-
[{ props: { type: BUTTON_TYPES.OUTLINED }, expectedClass: '-outlined' }],
|
|
31
|
-
[{ props: { type: BUTTON_TYPES.TEXT }, expectedClass: '-text' }],
|
|
32
|
-
[{ props: { size: BUTTON_SIZES.SMALL }, expectedClass: '-small' }],
|
|
33
|
-
[{ props: { size: BUTTON_SIZES.LARGE }, expectedClass: '-large' }],
|
|
34
|
-
[{ props: { color: BUTTON_COLORS.PRIMARY }, expectedClass: '-color-primary' }],
|
|
35
|
-
[{ props: { color: BUTTON_COLORS.DANGER }, expectedClass: '-color-danger' }],
|
|
36
|
-
[{ props: { color: BUTTON_COLORS.SUCCESS }, expectedClass: '-color-success' }],
|
|
37
|
-
[{ props: { radius: BUTTON_RADIUSES.ROUNDED }, expectedClass: '-rounded' }],
|
|
38
|
-
[{ props: { state: BUTTON_STATES.HOVERED }, expectedClass: '-hovered' }],
|
|
39
|
-
[{ props: { state: BUTTON_STATES.FOCUSED }, expectedClass: '-focused' }],
|
|
40
|
-
[{ props: { state: BUTTON_STATES.LOADING }, expectedClass: '-loading' }],
|
|
41
|
-
[{ props: { state: BUTTON_STATES.DISABLED }, expectedClass: '-disabled' }],
|
|
30
|
+
[{ props: { type: BUTTON_TYPES.OUTLINED }, expectedClass: '-ds-outlined' }],
|
|
31
|
+
[{ props: { type: BUTTON_TYPES.TEXT }, expectedClass: '-ds-text' }],
|
|
32
|
+
[{ props: { size: BUTTON_SIZES.SMALL }, expectedClass: '-ds-small' }],
|
|
33
|
+
[{ props: { size: BUTTON_SIZES.LARGE }, expectedClass: '-ds-large' }],
|
|
34
|
+
[{ props: { color: BUTTON_COLORS.PRIMARY }, expectedClass: '-ds-color-primary' }],
|
|
35
|
+
[{ props: { color: BUTTON_COLORS.DANGER }, expectedClass: '-ds-color-danger' }],
|
|
36
|
+
[{ props: { color: BUTTON_COLORS.SUCCESS }, expectedClass: '-ds-color-success' }],
|
|
37
|
+
[{ props: { radius: BUTTON_RADIUSES.ROUNDED }, expectedClass: '-ds-rounded' }],
|
|
38
|
+
[{ props: { state: BUTTON_STATES.HOVERED }, expectedClass: '-ds-hovered' }],
|
|
39
|
+
[{ props: { state: BUTTON_STATES.FOCUSED }, expectedClass: '-ds-focused' }],
|
|
40
|
+
[{ props: { state: BUTTON_STATES.LOADING }, expectedClass: '-ds-loading' }],
|
|
41
|
+
[{ props: { state: BUTTON_STATES.DISABLED }, expectedClass: '-ds-disabled' }],
|
|
42
42
|
])('correct class for props', ({ props, expectedClass }) => {
|
|
43
43
|
const outlinedButton = createComponent(props);
|
|
44
44
|
expect(outlinedButton.classes()).toContain(expectedClass);
|
|
@@ -47,27 +47,27 @@ describe('Button', () => {
|
|
|
47
47
|
it('loading should have correct text container and loading icon', () => {
|
|
48
48
|
const component = createComponent({ state: BUTTON_STATES.LOADING });
|
|
49
49
|
|
|
50
|
-
expect(component.find('.
|
|
51
|
-
expect(component.find('.
|
|
50
|
+
expect(component.find('.ds-button__content').exists()).toBe(true);
|
|
51
|
+
expect(component.find('.ds-button__loadingIcon').exists()).toBe(true);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
it('should render icon', () => {
|
|
55
55
|
const leftIcon = createComponent({ 'icon-left': Object.freeze(ICONS.FA_XMARK) });
|
|
56
|
-
expect(leftIcon.find('.
|
|
57
|
-
expect(
|
|
58
|
-
|
|
59
|
-
);
|
|
56
|
+
expect(leftIcon.find('.ds-button__icon.-ds-left').exists()).toBe(true);
|
|
57
|
+
expect(
|
|
58
|
+
leftIcon.findComponent<typeof Button>('.ds-button__icon.-ds-left').props().icon,
|
|
59
|
+
).toEqual(ICONS.FA_XMARK);
|
|
60
60
|
|
|
61
61
|
const rightIcon = createComponent({ 'icon-right': Object.freeze(ICONS.FA_CLOCK) });
|
|
62
|
-
expect(rightIcon.find('.
|
|
62
|
+
expect(rightIcon.find('.ds-button__icon.-ds-right').exists()).toBe(true);
|
|
63
63
|
expect(
|
|
64
|
-
rightIcon.findComponent<typeof Button>('.
|
|
64
|
+
rightIcon.findComponent<typeof Button>('.ds-button__icon.-ds-right').props().icon,
|
|
65
65
|
).toEqual(ICONS.FA_CLOCK);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('correct slot content', () => {
|
|
69
69
|
const component = createComponent({ 'icon-left': null });
|
|
70
|
-
expect(component.find('.
|
|
71
|
-
expect(component.find('.
|
|
70
|
+
expect(component.find('.ds-button__icon.-ds-left').exists()).toBe(false);
|
|
71
|
+
expect(component.find('.ds-button__content').text()).toBe('Hello');
|
|
72
72
|
});
|
|
73
73
|
});
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span
|
|
3
|
-
class="
|
|
3
|
+
class="ds-button"
|
|
4
4
|
:class="{
|
|
5
|
-
'-outlined': type === BUTTON_TYPES.OUTLINED,
|
|
6
|
-
'-text': type === BUTTON_TYPES.TEXT,
|
|
5
|
+
'-ds-outlined': type === BUTTON_TYPES.OUTLINED,
|
|
6
|
+
'-ds-text': type === BUTTON_TYPES.TEXT,
|
|
7
7
|
|
|
8
|
-
'-small': size === SIZES.SMALL,
|
|
9
|
-
'-large': size === SIZES.LARGE,
|
|
8
|
+
'-ds-small': size === SIZES.SMALL,
|
|
9
|
+
'-ds-large': size === SIZES.LARGE,
|
|
10
10
|
|
|
11
|
-
'-rounded': type !== BUTTON_TYPES.TEXT && radius === RADIUSES.ROUNDED,
|
|
11
|
+
'-ds-rounded': type !== BUTTON_TYPES.TEXT && radius === RADIUSES.ROUNDED,
|
|
12
12
|
|
|
13
|
-
'-hovered': state === STATES.HOVERED,
|
|
14
|
-
'-focused': state === STATES.FOCUSED,
|
|
15
|
-
'-loading': state === STATES.LOADING,
|
|
16
|
-
'-disabled': state === STATES.DISABLED,
|
|
13
|
+
'-ds-hovered': state === STATES.HOVERED,
|
|
14
|
+
'-ds-focused': state === STATES.FOCUSED,
|
|
15
|
+
'-ds-loading': state === STATES.LOADING,
|
|
16
|
+
'-ds-disabled': state === STATES.DISABLED,
|
|
17
17
|
|
|
18
18
|
[colorClassName]: true,
|
|
19
19
|
|
|
20
|
-
'-elevation-x-small': elevation === ELEVATIONS.X_SMALL,
|
|
21
|
-
'-elevation-small': elevation === ELEVATIONS.SMALL,
|
|
20
|
+
'-ds-elevation-x-small': elevation === ELEVATIONS.X_SMALL,
|
|
21
|
+
'-ds-elevation-small': elevation === ELEVATIONS.SMALL,
|
|
22
22
|
}"
|
|
23
23
|
>
|
|
24
|
-
<span class="
|
|
24
|
+
<span class="ds-button__content">
|
|
25
25
|
<wnl-icon
|
|
26
26
|
v-if="iconLeft"
|
|
27
|
-
class="
|
|
27
|
+
class="ds-button__icon -ds-left"
|
|
28
28
|
:icon="iconLeft"
|
|
29
29
|
:size="iconSize"
|
|
30
30
|
/>
|
|
31
31
|
<slot />
|
|
32
32
|
<wnl-icon
|
|
33
33
|
v-if="iconRight"
|
|
34
|
-
class="
|
|
34
|
+
class="ds-button__icon -ds-right"
|
|
35
35
|
:icon="iconRight"
|
|
36
36
|
:size="iconSize"
|
|
37
37
|
/>
|
|
38
38
|
</span>
|
|
39
39
|
<wnl-icon
|
|
40
40
|
v-if="state === STATES.LOADING"
|
|
41
|
-
class="
|
|
41
|
+
class="ds-button__loadingIcon"
|
|
42
42
|
:icon="ICONS.FAD_SPINNER_THIRD"
|
|
43
43
|
:size="loadingIconSize"
|
|
44
44
|
/>
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
149
149
|
return ICON_SIZES.X_SMALL;
|
|
150
150
|
},
|
|
151
151
|
colorClassName(): string {
|
|
152
|
-
return `-color-${this.color}`;
|
|
152
|
+
return `-ds-color-${this.color}`;
|
|
153
153
|
},
|
|
154
154
|
loadingIconSize(): string {
|
|
155
155
|
if (this.size === BUTTON_SIZES.LARGE) {
|