@bethinkpl/design-system 39.1.0 → 40.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system.css +1 -1
- package/dist/design-system.js +19329 -19161
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/ActionContent/ActionContent.vue.d.ts +42 -0
- package/dist/lib/js/components/ActionContent/index.d.ts +3 -0
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +3 -1
- package/dist/lib/js/components/Cards/Card/Card.consts.d.ts +13 -8
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +22 -9
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +77 -21
- package/dist/lib/js/components/Chip/Chip.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +3 -1
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +7 -5
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +4 -2
- package/dist/lib/js/components/Divider/Divider.vue.d.ts +1 -1
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue.d.ts +1 -1
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +10 -3
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +2 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +10 -4
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +4 -4
- package/dist/lib/js/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/lib/js/components/Form/FormField/FormField.utils.d.ts +1 -1
- package/dist/lib/js/components/Form/InputField/InputField.vue.d.ts +2 -2
- package/dist/lib/js/components/Form/PasswordField/PasswordField.vue.d.ts +2 -2
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +2 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +9 -5
- package/dist/lib/js/components/Headers/PageHeader/PageHeader.vue.d.ts +1 -1
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +7 -3
- package/dist/lib/js/components/IconText/IconText.vue.d.ts +1 -1
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +2 -0
- package/dist/lib/js/components/Image/Image.vue.d.ts +1 -1
- package/dist/lib/js/components/Menu/MenuDivider/MenuDivider.vue.d.ts +1 -1
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +2 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +6 -2
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +6 -2
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +6 -2
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +2 -0
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +2 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +44 -23
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +6 -4
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.vue.d.ts +1 -1
- package/dist/lib/js/components/Skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +2 -0
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +2 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +82 -22
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +82 -22
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +2 -0
- package/dist/lib/js/components/TextGroup/TextGroup.consts.d.ts +14 -3
- package/dist/lib/js/components/TextGroup/TextGroup.vue.d.ts +8 -3
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +4 -2
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +2 -2
- package/dist/lib/js/components/Toast/Toast.vue.d.ts +76 -22
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +4 -2
- package/dist/lib/js/components/Well/Well.consts.d.ts +24 -0
- package/dist/lib/js/components/Well/Well.vue.d.ts +13 -1
- package/dist/lib/js/icons/fontawesome.d.ts +1 -0
- package/dist/lib/js/index.d.ts +2 -0
- package/dist/lib/js/utils/type.utils.d.ts +3 -0
- package/lib/images/icons/comment-lock.svg +1 -0
- package/lib/js/components/ActionContent/ActionContent.spec.ts +99 -0
- package/lib/js/components/ActionContent/ActionContent.stories.ts +141 -0
- package/lib/js/components/ActionContent/ActionContent.vue +104 -0
- package/lib/js/components/ActionContent/index.ts +3 -0
- package/lib/js/components/Cards/Card/Card.consts.ts +15 -8
- package/lib/js/components/Cards/Card/Card.spec.ts +61 -1
- package/lib/js/components/Cards/Card/Card.stories.ts +20 -13
- package/lib/js/components/Cards/Card/Card.vue +65 -34
- package/lib/js/components/Chip/Chip.spec.ts +28 -0
- package/lib/js/components/Chip/Chip.stories.ts +7 -2
- package/lib/js/components/Chip/Chip.vue +14 -3
- package/lib/js/components/Icons/Icon/Icon.consts.ts +2 -0
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.spec.ts +3 -3
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +8 -1
- package/lib/js/components/TextGroup/TextGroup.consts.ts +15 -1
- package/lib/js/components/TextGroup/TextGroup.stories.ts +14 -5
- package/lib/js/components/TextGroup/TextGroup.vue +51 -28
- package/lib/js/components/Well/Well.consts.ts +16 -0
- package/lib/js/components/Well/Well.spec.ts +112 -0
- package/lib/js/components/Well/Well.stories.ts +90 -1
- package/lib/js/components/Well/Well.vue +135 -4
- package/lib/js/icons/fontawesome.ts +2 -0
- package/lib/js/index.ts +2 -0
- package/lib/js/utils/type.utils.ts +16 -0
- package/package.json +14 -6
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
'ds-card',
|
|
5
5
|
{
|
|
6
6
|
'-ds-paddingLarge': paddingSize === CARD_PADDING_SIZES.LARGE,
|
|
7
|
-
'-ds-
|
|
8
|
-
|
|
7
|
+
'-ds-leftRibbon':
|
|
8
|
+
hasRibbon && !hasLoadingBar && ribbonPosition === CARD_RIBBON_POSITIONS.LEFT,
|
|
9
9
|
'-ds-flat': isFlat,
|
|
10
|
+
'-ds-noRadius': !hasRadius,
|
|
11
|
+
'-ds-backgroundNeutral': backgroundColor === CARD_BACKGROUND_COLORS.NEUTRAL,
|
|
10
12
|
},
|
|
11
13
|
]"
|
|
12
14
|
>
|
|
13
|
-
<div v-if="
|
|
15
|
+
<div v-if="hasRibbon || hasLoadingBar" class="ds-card__ribbon">
|
|
14
16
|
<ds-container-ribbon
|
|
15
|
-
v-if="
|
|
16
|
-
:size="
|
|
17
|
-
:color="
|
|
17
|
+
v-if="hasRibbon && !hasLoadingBar"
|
|
18
|
+
:size="ribbonSize"
|
|
19
|
+
:color="ribbonColor"
|
|
18
20
|
:layout="ribbonLayout"
|
|
19
21
|
:radius="ribbonRadius"
|
|
20
22
|
/>
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
v-if="hasLoadingBar"
|
|
23
25
|
:time="loadingBarTime"
|
|
24
26
|
:color="loadingBarColor"
|
|
25
|
-
:size="
|
|
27
|
+
:size="ribbonSize"
|
|
26
28
|
/>
|
|
27
29
|
</div>
|
|
28
30
|
|
|
@@ -82,9 +84,17 @@
|
|
|
82
84
|
background-color: $color-default-background;
|
|
83
85
|
border-radius: $card-border-radius;
|
|
84
86
|
box-shadow: $shadow-s;
|
|
87
|
+
|
|
88
|
+
&.-ds-backgroundNeutral {
|
|
89
|
+
background-color: $color-neutral-background;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.-ds-noRadius {
|
|
93
|
+
border-radius: 0;
|
|
94
|
+
}
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
&.-ds-
|
|
97
|
+
&.-ds-leftRibbon {
|
|
88
98
|
flex-direction: row;
|
|
89
99
|
}
|
|
90
100
|
|
|
@@ -147,9 +157,9 @@
|
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
159
|
|
|
150
|
-
// the
|
|
160
|
+
// the ribbon container is added to avoid adding overflow hidden to the card itself
|
|
151
161
|
// which would clip floating elements rendered within the card (e.g. dropdowns)
|
|
152
|
-
&
|
|
162
|
+
&__ribbon {
|
|
153
163
|
display: flex;
|
|
154
164
|
flex-shrink: 0;
|
|
155
165
|
|
|
@@ -159,13 +169,17 @@
|
|
|
159
169
|
overflow: hidden;
|
|
160
170
|
}
|
|
161
171
|
|
|
162
|
-
#{$root}:not(.-ds-flat).-ds-
|
|
172
|
+
#{$root}:not(.-ds-flat).-ds-leftRibbon & {
|
|
163
173
|
border-bottom-left-radius: $card-border-radius;
|
|
164
174
|
border-top-left-radius: $card-border-radius;
|
|
165
175
|
border-top-right-radius: 0;
|
|
166
176
|
}
|
|
167
177
|
|
|
168
|
-
.-ds-
|
|
178
|
+
#{$root}:not(.-ds-flat).-ds-noRadius & {
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.-ds-leftRibbon & {
|
|
169
183
|
height: 100%;
|
|
170
184
|
left: 0;
|
|
171
185
|
position: absolute;
|
|
@@ -178,18 +192,21 @@
|
|
|
178
192
|
<script lang="ts" setup>
|
|
179
193
|
import { computed } from 'vue';
|
|
180
194
|
|
|
195
|
+
import { RemovedProp } from '../../../utils/type.utils';
|
|
181
196
|
import DsDivider from '../../Divider/Divider.vue';
|
|
182
197
|
import DsLoadingBar, { LOADING_BAR_COLORS, LoadingBarColors } from '../../LoadingBar';
|
|
183
198
|
import DsContainerRibbon from '../../ContainerRibbon/ContainerRibbon.vue';
|
|
184
199
|
import { CONTAINER_RIBBON_LAYOUTS, CONTAINER_RIBBON_RADIUSES } from '../../ContainerRibbon';
|
|
185
200
|
import {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
201
|
+
CARD_BACKGROUND_COLORS,
|
|
202
|
+
CARD_RIBBON_COLORS,
|
|
203
|
+
CARD_RIBBON_POSITIONS,
|
|
204
|
+
CARD_RIBBON_SIZES,
|
|
189
205
|
CARD_PADDING_SIZES,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
206
|
+
CardBackgroundColor,
|
|
207
|
+
CardRibbonColors,
|
|
208
|
+
CardRibbonPositions,
|
|
209
|
+
CardRibbonSizes,
|
|
193
210
|
CardPaddingSize,
|
|
194
211
|
} from './Card.consts';
|
|
195
212
|
|
|
@@ -200,10 +217,12 @@ const {
|
|
|
200
217
|
footerHasPadding = false,
|
|
201
218
|
paddingSize = CARD_PADDING_SIZES.SMALL,
|
|
202
219
|
dividerUnderHeader = false,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
220
|
+
hasRibbon = false,
|
|
221
|
+
hasRadius = true,
|
|
222
|
+
backgroundColor = CARD_BACKGROUND_COLORS.DEFAULT,
|
|
223
|
+
ribbonPosition = CARD_RIBBON_POSITIONS.TOP,
|
|
224
|
+
ribbonSize = CARD_RIBBON_SIZES.MEDIUM,
|
|
225
|
+
ribbonColor = CARD_RIBBON_COLORS.NEUTRAL_HEAVY,
|
|
207
226
|
hasRibbonRadius = false,
|
|
208
227
|
hasLoadingBar = false,
|
|
209
228
|
loadingBarColor = LOADING_BAR_COLORS.NEUTRAL_HEAVY,
|
|
@@ -216,16 +235,28 @@ const {
|
|
|
216
235
|
footerHasPadding?: boolean;
|
|
217
236
|
paddingSize?: CardPaddingSize;
|
|
218
237
|
dividerUnderHeader?: boolean;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
238
|
+
hasRibbon?: boolean;
|
|
239
|
+
hasRadius?: boolean;
|
|
240
|
+
backgroundColor?: CardBackgroundColor;
|
|
241
|
+
ribbonPosition?: CardRibbonPositions;
|
|
242
|
+
ribbonSize?: CardRibbonSizes;
|
|
243
|
+
ribbonColor?: CardRibbonColors;
|
|
223
244
|
hasRibbonRadius?: boolean;
|
|
224
245
|
hasLoadingBar?: boolean;
|
|
225
246
|
loadingBarColor?: LoadingBarColors;
|
|
226
247
|
loadingBarTime?: string;
|
|
227
248
|
isFlat?: boolean;
|
|
228
249
|
isContentScrollable?: boolean;
|
|
250
|
+
|
|
251
|
+
// Renamed props kept as removal markers so existing usages fail type-checking.
|
|
252
|
+
/** @deprecated renamed to `hasRibbon` */
|
|
253
|
+
hasBorder?: RemovedProp<'renamed to hasRibbon'>;
|
|
254
|
+
/** @deprecated renamed to `ribbonPosition` */
|
|
255
|
+
borderPosition?: RemovedProp<'renamed to ribbonPosition'>;
|
|
256
|
+
/** @deprecated renamed to `ribbonSize` */
|
|
257
|
+
borderSize?: RemovedProp<'renamed to ribbonSize'>;
|
|
258
|
+
/** @deprecated renamed to `ribbonColor` */
|
|
259
|
+
borderColor?: RemovedProp<'renamed to ribbonColor'>;
|
|
229
260
|
}>();
|
|
230
261
|
|
|
231
262
|
defineSlots<{
|
|
@@ -236,19 +267,19 @@ defineSlots<{
|
|
|
236
267
|
|
|
237
268
|
const ribbonLayout = computed(() => {
|
|
238
269
|
const layoutMap = {
|
|
239
|
-
[
|
|
240
|
-
[
|
|
270
|
+
[CARD_RIBBON_POSITIONS.TOP]: CONTAINER_RIBBON_LAYOUTS.HORIZONTAL,
|
|
271
|
+
[CARD_RIBBON_POSITIONS.LEFT]: CONTAINER_RIBBON_LAYOUTS.VERTICAL,
|
|
241
272
|
};
|
|
242
|
-
return layoutMap[
|
|
273
|
+
return layoutMap[ribbonPosition] || CONTAINER_RIBBON_LAYOUTS.HORIZONTAL;
|
|
243
274
|
});
|
|
244
275
|
|
|
245
276
|
const ribbonRadius = computed(() => {
|
|
246
|
-
const
|
|
247
|
-
[
|
|
248
|
-
[
|
|
277
|
+
const ribbonPositionToRibbonRadiusMap = {
|
|
278
|
+
[CARD_RIBBON_POSITIONS.TOP]: CONTAINER_RIBBON_RADIUSES.BOTTOM,
|
|
279
|
+
[CARD_RIBBON_POSITIONS.LEFT]: CONTAINER_RIBBON_RADIUSES.RIGHT,
|
|
249
280
|
};
|
|
250
|
-
return hasRibbonRadius && isFlat
|
|
251
|
-
?
|
|
281
|
+
return hasRibbonRadius && (isFlat || !hasRadius)
|
|
282
|
+
? ribbonPositionToRibbonRadiusMap[ribbonPosition]
|
|
252
283
|
: CONTAINER_RIBBON_RADIUSES.NONE;
|
|
253
284
|
});
|
|
254
285
|
</script>
|
|
@@ -10,6 +10,7 @@ import IconButton from '../Buttons/IconButton';
|
|
|
10
10
|
interface createComponentOptions {
|
|
11
11
|
label?: string;
|
|
12
12
|
leftIcon?: IconDefinition | null;
|
|
13
|
+
rightIcon?: IconDefinition | null;
|
|
13
14
|
isRemovable?: boolean;
|
|
14
15
|
size?: string;
|
|
15
16
|
color?: string;
|
|
@@ -20,6 +21,7 @@ describe('Chip', () => {
|
|
|
20
21
|
const createComponent = ({
|
|
21
22
|
label = 'random label',
|
|
22
23
|
leftIcon = null,
|
|
24
|
+
rightIcon = null,
|
|
23
25
|
isRemovable = false,
|
|
24
26
|
size = CHIP_SIZES.SMALL,
|
|
25
27
|
color = CHIP_COLORS.NEUTRAL,
|
|
@@ -29,6 +31,7 @@ describe('Chip', () => {
|
|
|
29
31
|
props: {
|
|
30
32
|
label,
|
|
31
33
|
leftIcon,
|
|
34
|
+
rightIcon,
|
|
32
35
|
isRemovable,
|
|
33
36
|
size,
|
|
34
37
|
color,
|
|
@@ -65,6 +68,31 @@ describe('Chip', () => {
|
|
|
65
68
|
);
|
|
66
69
|
});
|
|
67
70
|
|
|
71
|
+
it("doesn't render rightIcon by default", () => {
|
|
72
|
+
const component = createComponent({ rightIcon: null });
|
|
73
|
+
|
|
74
|
+
expect(component.find('.ds-chip__rightIcon').exists()).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('renders rightIcon', () => {
|
|
78
|
+
const component = createComponent({ rightIcon: Object.freeze(ICONS.FA_TAG) });
|
|
79
|
+
|
|
80
|
+
expect(component.find('.ds-chip__rightIcon').exists()).toBe(true);
|
|
81
|
+
expect(component.find('.ds-chip__rightIcon').findComponent(Icon).props().icon).toEqual(
|
|
82
|
+
ICONS.FA_TAG,
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('renders rightIcon before the remove button', () => {
|
|
87
|
+
const component = createComponent({
|
|
88
|
+
rightIcon: Object.freeze(ICONS.FA_TAG),
|
|
89
|
+
isRemovable: true,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const html = component.html();
|
|
93
|
+
expect(html.indexOf('ds-chip__rightIcon')).toBeLessThan(html.indexOf('ds-chip__remove'));
|
|
94
|
+
});
|
|
95
|
+
|
|
68
96
|
it("doesn't render leftIcon by default", () => {
|
|
69
97
|
const component = createComponent({ isRemovable: false });
|
|
70
98
|
|
|
@@ -21,7 +21,7 @@ const StoryTemplate: StoryFn<typeof Chip> = (args) => ({
|
|
|
21
21
|
return args;
|
|
22
22
|
},
|
|
23
23
|
template:
|
|
24
|
-
'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius" :is-interactive="isInteractive" />',
|
|
24
|
+
'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :right-icon="ICONS[rightIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius" :is-interactive="isInteractive" />',
|
|
25
25
|
data() {
|
|
26
26
|
return {
|
|
27
27
|
ICONS: Object.freeze(ICONS),
|
|
@@ -34,7 +34,7 @@ const StoryTemplateWithAccessory: StoryFn<typeof Chip> = (args) => ({
|
|
|
34
34
|
return args;
|
|
35
35
|
},
|
|
36
36
|
template:
|
|
37
|
-
'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius" :is-interactive="isInteractive">' +
|
|
37
|
+
'<chip :label="label" :is-label-uppercase="isLabelUppercase" :left-icon="ICONS[leftIcon]" :right-icon="ICONS[rightIcon]" :is-removable="isRemovable" :size="size" :color="color" :color-hex="colorHex" :state="state" :radius="radius" :is-interactive="isInteractive">' +
|
|
38
38
|
'<template #accessory><logo-badge :style="svgStyle" /></template>' +
|
|
39
39
|
'</chip>',
|
|
40
40
|
data() {
|
|
@@ -59,6 +59,7 @@ const args = {
|
|
|
59
59
|
label: 'Chip z labelem',
|
|
60
60
|
isLabelUppercase: false,
|
|
61
61
|
leftIcon: null,
|
|
62
|
+
rightIcon: null,
|
|
62
63
|
radius: CHIP_RADIUSES.CAPSULE,
|
|
63
64
|
size: CHIP_SIZES.SMALL,
|
|
64
65
|
color: CHIP_DEFAULT_COLOR,
|
|
@@ -72,6 +73,10 @@ const argTypes = {
|
|
|
72
73
|
control: 'select',
|
|
73
74
|
options: [null, ...Object.keys(ICONS)],
|
|
74
75
|
},
|
|
76
|
+
rightIcon: {
|
|
77
|
+
control: 'select',
|
|
78
|
+
options: [null, ...Object.keys(ICONS)],
|
|
79
|
+
},
|
|
75
80
|
size: {
|
|
76
81
|
control: 'select',
|
|
77
82
|
options: Object.values(CHIP_SIZES),
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
</slot>
|
|
24
24
|
</span>
|
|
25
25
|
<span v-if="label" class="ds-chip__label">{{ label }}</span>
|
|
26
|
+
<span v-if="rightIcon" class="ds-chip__rightIcon">
|
|
27
|
+
<icon
|
|
28
|
+
:icon="rightIcon"
|
|
29
|
+
:size="size === CHIP_SIZES.X_SMALL ? ICON_SIZES.XXX_SMALL : ICON_SIZES.XX_SMALL"
|
|
30
|
+
/>
|
|
31
|
+
</span>
|
|
26
32
|
<icon-button
|
|
27
33
|
v-if="size !== CHIP_SIZES.X_SMALL && isRemovable"
|
|
28
34
|
class="ds-chip__remove"
|
|
@@ -178,7 +184,8 @@ $chip-colors: (
|
|
|
178
184
|
&.-ds-color-#{$color-name} {
|
|
179
185
|
background-color: map-get($color-map, 'background');
|
|
180
186
|
|
|
181
|
-
#{$self}__leftIcon
|
|
187
|
+
#{$self}__leftIcon,
|
|
188
|
+
#{$self}__rightIcon {
|
|
182
189
|
color: map-get($color-map, 'icon');
|
|
183
190
|
fill: map-get($color-map, 'icon');
|
|
184
191
|
}
|
|
@@ -198,7 +205,8 @@ $chip-colors: (
|
|
|
198
205
|
&.-ds-disabled {
|
|
199
206
|
background-color: map-get(map-get($color-map, 'disabled'), 'background');
|
|
200
207
|
|
|
201
|
-
#{$self}__leftIcon
|
|
208
|
+
#{$self}__leftIcon,
|
|
209
|
+
#{$self}__rightIcon {
|
|
202
210
|
color: map-get(map-get($color-map, 'disabled'), 'icon');
|
|
203
211
|
fill: map-get($color-map, 'icon');
|
|
204
212
|
}
|
|
@@ -250,7 +258,8 @@ $chip-colors: (
|
|
|
250
258
|
white-space: nowrap;
|
|
251
259
|
}
|
|
252
260
|
|
|
253
|
-
&__leftIcon
|
|
261
|
+
&__leftIcon,
|
|
262
|
+
&__rightIcon {
|
|
254
263
|
display: flex;
|
|
255
264
|
}
|
|
256
265
|
|
|
@@ -315,6 +324,7 @@ const {
|
|
|
315
324
|
label = null,
|
|
316
325
|
isLabelUppercase = false,
|
|
317
326
|
leftIcon = null,
|
|
327
|
+
rightIcon = null,
|
|
318
328
|
radius = CHIP_RADIUSES.CAPSULE,
|
|
319
329
|
size = CHIP_SIZES.SMALL,
|
|
320
330
|
color = CHIP_DEFAULT_COLOR,
|
|
@@ -326,6 +336,7 @@ const {
|
|
|
326
336
|
label?: string | null;
|
|
327
337
|
isLabelUppercase?: boolean;
|
|
328
338
|
leftIcon?: IconItem | null;
|
|
339
|
+
rightIcon?: IconItem | null;
|
|
329
340
|
radius?: ChipRadius;
|
|
330
341
|
size?: ChipSize;
|
|
331
342
|
color?: ChipColor;
|
|
@@ -2,6 +2,7 @@ import HeadWithQuestionMark from '../../../../images/icons/head-with-question-ma
|
|
|
2
2
|
import Ribbon from '../../../../images/icons/ribbon.svg';
|
|
3
3
|
import SlidersSearch from '../../../../images/icons/sliders-search.svg';
|
|
4
4
|
import CommentsCheck from '../../../../images/icons/comments-check.svg';
|
|
5
|
+
import CommentLock from '../../../../images/icons/comment-lock.svg';
|
|
5
6
|
import Answers from '../../../../images/icons/icon-answers.svg';
|
|
6
7
|
import HideAnswers from '../../../../images/icons/icon-hide-answers.svg';
|
|
7
8
|
import SidebarFlipSolid from '../../../../images/icons/sidebar-flip-solid.svg';
|
|
@@ -47,6 +48,7 @@ export type IconSize = Value<typeof ICON_SIZES>;
|
|
|
47
48
|
const BETHINK_ICONS = {
|
|
48
49
|
ANSWERS: Answers,
|
|
49
50
|
CHANGE: Change,
|
|
51
|
+
COMMENT_LOCK: CommentLock,
|
|
50
52
|
COMMENTS_CHECK: CommentsCheck,
|
|
51
53
|
HEAD_WITH_QUESTION_MARK: HeadWithQuestionMark,
|
|
52
54
|
HIDE_ANSWERS: HideAnswers,
|
|
@@ -89,8 +89,8 @@ describe('ProgressDonutChart', () => {
|
|
|
89
89
|
});
|
|
90
90
|
const tracks = component.findAll('.ds-progressDonutChart__track');
|
|
91
91
|
expect(tracks.length).toBe(3);
|
|
92
|
-
expect(tracks
|
|
93
|
-
expect(tracks
|
|
94
|
-
expect(tracks
|
|
92
|
+
expect(tracks[0]?.attributes('style')).toBe('--length: 30; transform: rotate(90deg);');
|
|
93
|
+
expect(tracks[1]?.attributes('style')).toBe('--length: 25; transform: rotate(198deg);');
|
|
94
|
+
expect(tracks[2]?.attributes('style')).toBe('--length: 25; transform: rotate(288deg);');
|
|
95
95
|
});
|
|
96
96
|
});
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
:eyebrow-text="eyebrow"
|
|
37
37
|
:eyebrow-text-ellipsis="eyebrowEllipsis"
|
|
38
38
|
:is-eyebrow-text-uppercase="isEyebrowUppercase"
|
|
39
|
-
:
|
|
39
|
+
:main-text-color="textGroupMainTextColor"
|
|
40
40
|
:is-interactive="false"
|
|
41
41
|
:main-text="text"
|
|
42
42
|
:main-text-ellipsis="textEllipsis"
|
|
@@ -96,8 +96,10 @@
|
|
|
96
96
|
import { defineComponent, PropType, toRaw } from 'vue';
|
|
97
97
|
import { ICON_COLORS, IconColor, IconItem, ICONS } from '../../Icons/Icon';
|
|
98
98
|
import {
|
|
99
|
+
TEXT_GROUP_MAIN_TEXT_COLORS,
|
|
99
100
|
TEXT_GROUP_SIZES,
|
|
100
101
|
TEXT_GROUP_STATES,
|
|
102
|
+
TextGroupMainTextColor,
|
|
101
103
|
TextGroupSize,
|
|
102
104
|
TextGroupState,
|
|
103
105
|
} from '../../TextGroup';
|
|
@@ -290,6 +292,11 @@ export default defineComponent({
|
|
|
290
292
|
}
|
|
291
293
|
return TEXT_GROUP_STATES.DEFAULT;
|
|
292
294
|
},
|
|
295
|
+
textGroupMainTextColor(): TextGroupMainTextColor {
|
|
296
|
+
return this.isTextGroupSelected
|
|
297
|
+
? TEXT_GROUP_MAIN_TEXT_COLORS.PRIMARY
|
|
298
|
+
: TEXT_GROUP_MAIN_TEXT_COLORS.NEUTRAL;
|
|
299
|
+
},
|
|
293
300
|
},
|
|
294
301
|
});
|
|
295
302
|
</script>
|
|
@@ -13,7 +13,18 @@ export const TEXT_GROUP_SIZES = {
|
|
|
13
13
|
X_SMALL: 'x-small',
|
|
14
14
|
SMALL: 'small',
|
|
15
15
|
MEDIUM: 'medium',
|
|
16
|
-
|
|
16
|
+
LARGE: 'large',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export const TEXT_GROUP_ALIGNS = {
|
|
20
|
+
LEFT: 'left',
|
|
21
|
+
CENTER: 'center',
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export const TEXT_GROUP_MAIN_TEXT_COLORS = {
|
|
25
|
+
NEUTRAL: 'neutral',
|
|
26
|
+
PRIMARY: 'primary',
|
|
27
|
+
} as const;
|
|
17
28
|
|
|
18
29
|
export const TEXT_GROUP_STATES = {
|
|
19
30
|
DEFAULT: 'default',
|
|
@@ -28,3 +39,6 @@ export type TextGroupLoadingSize =
|
|
|
28
39
|
(typeof TEXT_GROUP_LOADING_SIZES)[keyof typeof TEXT_GROUP_LOADING_SIZES];
|
|
29
40
|
export type TextGroupSize = (typeof TEXT_GROUP_SIZES)[keyof typeof TEXT_GROUP_SIZES];
|
|
30
41
|
export type TextGroupState = (typeof TEXT_GROUP_STATES)[keyof typeof TEXT_GROUP_STATES];
|
|
42
|
+
export type TextGroupAlign = (typeof TEXT_GROUP_ALIGNS)[keyof typeof TEXT_GROUP_ALIGNS];
|
|
43
|
+
export type TextGroupMainTextColor =
|
|
44
|
+
(typeof TEXT_GROUP_MAIN_TEXT_COLORS)[keyof typeof TEXT_GROUP_MAIN_TEXT_COLORS];
|
|
@@ -2,7 +2,9 @@ import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
|
2
2
|
import DsDivider from '../Divider/Divider.vue';
|
|
3
3
|
import DsTextGroup from './TextGroup.vue';
|
|
4
4
|
import {
|
|
5
|
+
TEXT_GROUP_ALIGNS,
|
|
5
6
|
TEXT_GROUP_LOADING_SIZES,
|
|
7
|
+
TEXT_GROUP_MAIN_TEXT_COLORS,
|
|
6
8
|
TEXT_GROUP_PROMINENCE,
|
|
7
9
|
TEXT_GROUP_SIZES,
|
|
8
10
|
TEXT_GROUP_STATES,
|
|
@@ -21,6 +23,8 @@ const StoryTemplate: StoryFn<typeof DsTextGroup> = (args) => ({
|
|
|
21
23
|
template: `
|
|
22
24
|
<ds-text-group
|
|
23
25
|
:size="size"
|
|
26
|
+
:align="align"
|
|
27
|
+
:main-text-color="mainTextColor"
|
|
24
28
|
:prominence="prominence"
|
|
25
29
|
:eyebrow-text="eyebrowText === 'null' ? null : eyebrowText"
|
|
26
30
|
:eyebrow-text-ellipsis="eyebrowTextEllipsis"
|
|
@@ -31,7 +35,6 @@ const StoryTemplate: StoryFn<typeof DsTextGroup> = (args) => ({
|
|
|
31
35
|
:supporting-text-ellipsis="supportingTextEllipsis"
|
|
32
36
|
:is-interactive="isInteractive"
|
|
33
37
|
:skeleton-loading-size="skeletonLoadingSize"
|
|
34
|
-
:is-selected="isSelected"
|
|
35
38
|
:state="state"
|
|
36
39
|
:is-supporting-text-tooltip-enabled="isSupportingTextTooltipEnabled"
|
|
37
40
|
:is-supporting-text-tooltip-enabled-on-mobile="isSupportingTextTooltipEnabledOnMobile"
|
|
@@ -54,6 +57,8 @@ export const Interactive = StoryTemplate.bind({});
|
|
|
54
57
|
Interactive.args = {
|
|
55
58
|
mainTextSlot: '',
|
|
56
59
|
size: TEXT_GROUP_SIZES.MEDIUM,
|
|
60
|
+
align: TEXT_GROUP_ALIGNS.LEFT,
|
|
61
|
+
mainTextColor: TEXT_GROUP_MAIN_TEXT_COLORS.NEUTRAL,
|
|
57
62
|
prominence: TEXT_GROUP_PROMINENCE.DEFAULT,
|
|
58
63
|
eyebrowText: 'Eyebrow Uppercase Veritatis aspernatur cupiditate magnam quidem',
|
|
59
64
|
eyebrowTextEllipsis: false,
|
|
@@ -66,7 +71,6 @@ Interactive.args = {
|
|
|
66
71
|
supportingTextEllipsis: false,
|
|
67
72
|
isInteractive: true,
|
|
68
73
|
skeletonLoadingSize: TEXT_GROUP_LOADING_SIZES.LARGE,
|
|
69
|
-
isSelected: false,
|
|
70
74
|
state: TEXT_GROUP_STATES.DEFAULT,
|
|
71
75
|
isSupportingTextTooltipEnabled: false,
|
|
72
76
|
isSupportingTextTooltipEnabledOnMobile: true,
|
|
@@ -79,6 +83,14 @@ Interactive.argTypes = {
|
|
|
79
83
|
control: 'select',
|
|
80
84
|
options: Object.values(TEXT_GROUP_SIZES),
|
|
81
85
|
},
|
|
86
|
+
align: {
|
|
87
|
+
control: 'select',
|
|
88
|
+
options: Object.values(TEXT_GROUP_ALIGNS),
|
|
89
|
+
},
|
|
90
|
+
mainTextColor: {
|
|
91
|
+
control: 'select',
|
|
92
|
+
options: Object.values(TEXT_GROUP_MAIN_TEXT_COLORS),
|
|
93
|
+
},
|
|
82
94
|
prominence: {
|
|
83
95
|
control: 'select',
|
|
84
96
|
options: Object.values(TEXT_GROUP_PROMINENCE),
|
|
@@ -114,9 +126,6 @@ Interactive.argTypes = {
|
|
|
114
126
|
control: 'select',
|
|
115
127
|
options: Object.values(TEXT_GROUP_LOADING_SIZES),
|
|
116
128
|
},
|
|
117
|
-
isSelected: {
|
|
118
|
-
control: 'boolean',
|
|
119
|
-
},
|
|
120
129
|
state: {
|
|
121
130
|
control: 'select',
|
|
122
131
|
options: Object.values(TEXT_GROUP_STATES),
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
:class="{
|
|
5
5
|
'-ds-x-small': size === TEXT_GROUP_SIZES.X_SMALL,
|
|
6
6
|
'-ds-small': size === TEXT_GROUP_SIZES.SMALL,
|
|
7
|
+
'-ds-large': size === TEXT_GROUP_SIZES.LARGE,
|
|
8
|
+
|
|
9
|
+
'-ds-align-center': align === TEXT_GROUP_ALIGNS.CENTER,
|
|
7
10
|
|
|
8
11
|
'-ds-hovered': state === TEXT_GROUP_STATES.HOVERED,
|
|
9
12
|
'-ds-loading': isLoading,
|
|
10
13
|
'-ds-disabled': state === TEXT_GROUP_STATES.DISABLED,
|
|
11
14
|
|
|
12
15
|
'-ds-interactive': isInteractive,
|
|
13
|
-
'-ds-
|
|
16
|
+
'-ds-mainTextColor-primary': mainTextColor === TEXT_GROUP_MAIN_TEXT_COLORS.PRIMARY,
|
|
14
17
|
|
|
15
18
|
[loadingSizeClassName]: isLoading,
|
|
16
19
|
|
|
@@ -100,9 +103,6 @@ $text-group-colors: (
|
|
|
100
103
|
'main-text-color': $color-neutral-text-strong,
|
|
101
104
|
'main-text-color-hovered': $color-neutral-text-strong-hovered,
|
|
102
105
|
'main-text-color-disabled': $color-neutral-text-strong-disabled,
|
|
103
|
-
'main-text-color-selected': $color-primary-text,
|
|
104
|
-
'main-text-color-selected-hovered': $color-primary-text-hovered,
|
|
105
|
-
'main-text-color-selected-disabled': $color-primary-text-disabled,
|
|
106
106
|
'supporting-text-color': $color-neutral-text,
|
|
107
107
|
'supporting-text-color-hovered': $color-neutral-text-hovered,
|
|
108
108
|
'supporting-text-color-disabled': $color-neutral-text-disabled,
|
|
@@ -114,9 +114,6 @@ $text-group-colors: (
|
|
|
114
114
|
'main-text-color': $color-neutral-text-heavy,
|
|
115
115
|
'main-text-color-hovered': $color-neutral-text-heavy-hovered,
|
|
116
116
|
'main-text-color-disabled': $color-neutral-text-heavy-disabled,
|
|
117
|
-
'main-text-color-selected': $color-primary-text,
|
|
118
|
-
'main-text-color-selected-hovered': $color-primary-text-hovered,
|
|
119
|
-
'main-text-color-selected-disabled': $color-primary-text-disabled,
|
|
120
117
|
'supporting-text-color': $color-neutral-text,
|
|
121
118
|
'supporting-text-color-hovered': $color-neutral-text-hovered,
|
|
122
119
|
'supporting-text-color-disabled': $color-neutral-text-disabled,
|
|
@@ -166,25 +163,6 @@ $text-group-colors: (
|
|
|
166
163
|
color: map-get($map, 'supporting-text-color-disabled');
|
|
167
164
|
}
|
|
168
165
|
}
|
|
169
|
-
|
|
170
|
-
&.-ds-selected {
|
|
171
|
-
#{$self}__main {
|
|
172
|
-
color: map-get($map, 'main-text-color-selected');
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
&.-ds-interactive:hover,
|
|
176
|
-
&.-ds-hovered {
|
|
177
|
-
#{$self}__main {
|
|
178
|
-
color: map-get($map, 'main-text-color-selected-hovered');
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.-ds-disabled {
|
|
183
|
-
#{$self}__main {
|
|
184
|
-
color: map-get($map, 'main-text-color-selected-disabled');
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
166
|
}
|
|
189
167
|
|
|
190
168
|
.ds-textGroup {
|
|
@@ -302,6 +280,40 @@ $text-group-colors: (
|
|
|
302
280
|
}
|
|
303
281
|
}
|
|
304
282
|
|
|
283
|
+
&.-ds-large {
|
|
284
|
+
#{$self}__main {
|
|
285
|
+
@include text-l-compact-bold;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
#{$self}__supporting {
|
|
289
|
+
@include text-m-compact-regular;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
&.-ds-align-center {
|
|
294
|
+
align-items: center;
|
|
295
|
+
text-align: center;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&.-ds-mainTextColor-primary {
|
|
299
|
+
#{$self}__main {
|
|
300
|
+
color: $color-primary-text;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&.-ds-interactive:hover,
|
|
304
|
+
&.-ds-hovered {
|
|
305
|
+
#{$self}__main {
|
|
306
|
+
color: $color-primary-text-hovered;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&.-ds-disabled {
|
|
311
|
+
#{$self}__main {
|
|
312
|
+
color: $color-primary-text-disabled;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
305
317
|
&.-ds-interactive:hover,
|
|
306
318
|
&.-ds-hovered {
|
|
307
319
|
cursor: pointer;
|
|
@@ -346,9 +358,13 @@ import { throttle } from 'lodash';
|
|
|
346
358
|
import { useElementSize } from '@vueuse/core';
|
|
347
359
|
import DsSkeleton from '../Skeleton/Skeleton.vue';
|
|
348
360
|
import {
|
|
361
|
+
TEXT_GROUP_ALIGNS,
|
|
349
362
|
TEXT_GROUP_LOADING_SIZES,
|
|
363
|
+
TEXT_GROUP_MAIN_TEXT_COLORS,
|
|
350
364
|
TEXT_GROUP_SIZES,
|
|
351
365
|
TEXT_GROUP_STATES,
|
|
366
|
+
TextGroupAlign,
|
|
367
|
+
TextGroupMainTextColor,
|
|
352
368
|
TextGroupProminence,
|
|
353
369
|
TextGroupLoadingSize,
|
|
354
370
|
TextGroupSize,
|
|
@@ -356,9 +372,12 @@ import {
|
|
|
356
372
|
TEXT_GROUP_PROMINENCE,
|
|
357
373
|
} from './TextGroup.consts';
|
|
358
374
|
import DsTooltip from '../Tooltip';
|
|
375
|
+
import { RemovedProp } from '../../utils/type.utils';
|
|
359
376
|
|
|
360
377
|
const {
|
|
361
378
|
size = TEXT_GROUP_SIZES.MEDIUM,
|
|
379
|
+
align = TEXT_GROUP_ALIGNS.LEFT,
|
|
380
|
+
mainTextColor = TEXT_GROUP_MAIN_TEXT_COLORS.NEUTRAL,
|
|
362
381
|
prominence = TEXT_GROUP_PROMINENCE.DEFAULT,
|
|
363
382
|
eyebrowText,
|
|
364
383
|
eyebrowTextEllipsis = false,
|
|
@@ -370,7 +389,6 @@ const {
|
|
|
370
389
|
supportingTextEllipsis = false,
|
|
371
390
|
isInteractive = true,
|
|
372
391
|
skeletonLoadingSize = TEXT_GROUP_LOADING_SIZES.LARGE,
|
|
373
|
-
isSelected = false,
|
|
374
392
|
state = TEXT_GROUP_STATES.DEFAULT,
|
|
375
393
|
isSupportingTextTooltipEnabled = false,
|
|
376
394
|
isSupportingTextTooltipEnabledOnMobile = true,
|
|
@@ -378,6 +396,8 @@ const {
|
|
|
378
396
|
supportingTextTooltipContent,
|
|
379
397
|
} = defineProps<{
|
|
380
398
|
size?: TextGroupSize;
|
|
399
|
+
align?: TextGroupAlign;
|
|
400
|
+
mainTextColor?: TextGroupMainTextColor;
|
|
381
401
|
prominence?: TextGroupProminence;
|
|
382
402
|
eyebrowText?: string | null;
|
|
383
403
|
eyebrowTextEllipsis?: boolean;
|
|
@@ -389,12 +409,15 @@ const {
|
|
|
389
409
|
supportingTextEllipsis?: boolean;
|
|
390
410
|
isInteractive?: boolean;
|
|
391
411
|
skeletonLoadingSize?: TextGroupLoadingSize;
|
|
392
|
-
isSelected?: boolean;
|
|
393
412
|
state?: TextGroupState;
|
|
394
413
|
isSupportingTextTooltipEnabled?: boolean;
|
|
395
414
|
isSupportingTextTooltipEnabledOnMobile?: boolean;
|
|
396
415
|
isSupportingTextTooltipAutoFilledWithContent?: boolean;
|
|
397
416
|
supportingTextTooltipContent?: string;
|
|
417
|
+
|
|
418
|
+
// Removed prop kept as a removal marker so existing usages fail type-checking.
|
|
419
|
+
/** @deprecated use `mainTextColor` set to `primary` instead */
|
|
420
|
+
isSelected?: RemovedProp<'use mainTextColor=primary instead'>;
|
|
398
421
|
}>();
|
|
399
422
|
|
|
400
423
|
const prominenceClassName = computed(() => `-ds-${prominence}`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Value } from '../../utils/type.utils';
|
|
2
|
+
import { CONTAINER_RIBBON_COLORS, CONTAINER_RIBBON_SIZES } from '../ContainerRibbon';
|
|
2
3
|
|
|
3
4
|
export const WELL_PADDINGS = {
|
|
4
5
|
SMALL: 'small',
|
|
@@ -21,3 +22,18 @@ export const WELL_COLORS = {
|
|
|
21
22
|
export type WellColor = Value<typeof WELL_COLORS>;
|
|
22
23
|
|
|
23
24
|
export const WELL_DEFAULT_COLOR = WELL_COLORS.NEUTRAL;
|
|
25
|
+
|
|
26
|
+
export const WELL_RIBBON_COLORS = CONTAINER_RIBBON_COLORS;
|
|
27
|
+
|
|
28
|
+
export type WellRibbonColor = Value<typeof WELL_RIBBON_COLORS>;
|
|
29
|
+
|
|
30
|
+
export const WELL_RIBBON_SIZES = CONTAINER_RIBBON_SIZES;
|
|
31
|
+
|
|
32
|
+
export type WellRibbonSize = Value<typeof WELL_RIBBON_SIZES>;
|
|
33
|
+
|
|
34
|
+
export const WELL_RIBBON_POSITIONS = {
|
|
35
|
+
TOP: 'top',
|
|
36
|
+
LEFT: 'left',
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
export type WellRibbonPosition = Value<typeof WELL_RIBBON_POSITIONS>;
|