@bethinkpl/design-system 35.0.3 → 35.1.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 +5241 -5188
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +3 -0
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +1 -0
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +1 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +2 -0
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +2 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +2 -0
- package/dist/lib/js/components/ProgressBar/ProgressBar.consts.d.ts +5 -0
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +52 -17
- package/dist/lib/js/components/ProgressBar/ProgressBarLabelDataWrapper.vue.d.ts +19 -0
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +1 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +3 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +3 -0
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +1 -0
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +1 -0
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -0
- package/dist/lib/js/icons/fontawesome.d.ts +1 -0
- package/dist/storybook/localhost:8080/node_modules/.vite/deps/@bethinkpl_design-system.js?v=62a0baa6 +7919 -0
- package/lib/js/components/ProgressBar/ProgressBar.consts.ts +7 -0
- package/lib/js/components/ProgressBar/ProgressBar.spec.ts +2 -0
- package/lib/js/components/ProgressBar/ProgressBar.stories.ts +8 -0
- package/lib/js/components/ProgressBar/ProgressBar.vue +67 -56
- package/lib/js/components/ProgressBar/ProgressBarLabelDataWrapper.vue +62 -0
- package/lib/js/icons/fontawesome.ts +2 -0
- package/package.json +1 -1
|
@@ -83,3 +83,10 @@ export interface ProgressBarRange {
|
|
|
83
83
|
icon?: IconItem;
|
|
84
84
|
data?: string;
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
export const PROGRESS_BAR_LABEL_DATA_POSITIONS = {
|
|
88
|
+
TOP: 'top',
|
|
89
|
+
BOTTOM: 'bottom',
|
|
90
|
+
} as const;
|
|
91
|
+
|
|
92
|
+
export type ProgressBarLabelDataPositions = Value<typeof PROGRESS_BAR_LABEL_DATA_POSITIONS>;
|
|
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
|
|
|
2
2
|
import { mount } from '@vue/test-utils';
|
|
3
3
|
import ProgressBar from './ProgressBar.vue';
|
|
4
4
|
import {
|
|
5
|
+
PROGRESS_BAR_LABEL_DATA_POSITIONS,
|
|
5
6
|
PROGRESS_BAR_LAYOUTS,
|
|
6
7
|
PROGRESS_BAR_RANGE_COLORS,
|
|
7
8
|
ProgressBarRange,
|
|
@@ -33,6 +34,7 @@ const defaultProps = {
|
|
|
33
34
|
labelDataSuffix: '(%)',
|
|
34
35
|
labelTextEllipsis: false,
|
|
35
36
|
hasLegend: false,
|
|
37
|
+
labelDataPosition: PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
const createComponent = (props = defaultProps) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ProgressBar from './ProgressBar.vue';
|
|
2
2
|
import {
|
|
3
3
|
PROGRESS_BAR_BADGE_COLORS,
|
|
4
|
+
PROGRESS_BAR_LABEL_DATA_POSITIONS,
|
|
4
5
|
PROGRESS_BAR_LABEL_TEXT_SIZES,
|
|
5
6
|
PROGRESS_BAR_LAYOUTS,
|
|
6
7
|
PROGRESS_BAR_RADII,
|
|
@@ -98,6 +99,10 @@ const argTypes = {
|
|
|
98
99
|
hasLegendPercentValue: {
|
|
99
100
|
control: 'boolean',
|
|
100
101
|
},
|
|
102
|
+
labelDataPosition: {
|
|
103
|
+
control: 'select',
|
|
104
|
+
options: Object.values(PROGRESS_BAR_LABEL_DATA_POSITIONS),
|
|
105
|
+
},
|
|
101
106
|
} as ArgTypes;
|
|
102
107
|
|
|
103
108
|
Interactive.argTypes = argTypes;
|
|
@@ -142,6 +147,7 @@ Interactive.args = {
|
|
|
142
147
|
hasLegend: false,
|
|
143
148
|
legendSize: PROGRESS_BAR_LEGEND_SIZES.SMALL,
|
|
144
149
|
hasLegendPercentValue: true,
|
|
150
|
+
labelDataPosition: PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP,
|
|
145
151
|
} as Args;
|
|
146
152
|
|
|
147
153
|
Interactive.parameters = {
|
|
@@ -228,6 +234,7 @@ Compact.args = {
|
|
|
228
234
|
labelDataSupporting: '100',
|
|
229
235
|
labelDataSuffix: '(%)',
|
|
230
236
|
labelTextEllipsis: false,
|
|
237
|
+
labelDataPosition: PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP,
|
|
231
238
|
} as Args;
|
|
232
239
|
|
|
233
240
|
export const LegendWithoutIcons = StoryTemplate.bind({});
|
|
@@ -259,4 +266,5 @@ LegendWithoutIcons.args = {
|
|
|
259
266
|
hasLegend: true,
|
|
260
267
|
hasLegendPercentValue: true,
|
|
261
268
|
legendSize: PROGRESS_BAR_LEGEND_SIZES.SMALL,
|
|
269
|
+
labelDataPosition: PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP,
|
|
262
270
|
} as Args;
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
>
|
|
17
17
|
{{ labelText }}
|
|
18
18
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
|
|
20
|
+
<progress-bar-label-data-wrapper
|
|
21
|
+
v-if="
|
|
22
|
+
labelDataExists && labelDataPosition === PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP
|
|
23
|
+
"
|
|
24
|
+
class="ds-progressBar__labelDataWrapperTop"
|
|
25
|
+
:label-data="labelData"
|
|
26
|
+
:label-data-supporting="labelDataSupporting"
|
|
27
|
+
:label-data-suffix="labelDataSuffix"
|
|
28
|
+
/>
|
|
29
29
|
</div>
|
|
30
30
|
<div
|
|
31
31
|
class="ds-progressBar__barWrapper"
|
|
@@ -62,14 +62,32 @@
|
|
|
62
62
|
"
|
|
63
63
|
/>
|
|
64
64
|
</div>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
<div class="ds-progressBar__bottomWrapper">
|
|
66
|
+
<progress-bar-legend
|
|
67
|
+
v-if="hasLegend"
|
|
68
|
+
class="ds-progressBar__legend"
|
|
69
|
+
:ranges="ranges"
|
|
70
|
+
:layout="layout"
|
|
71
|
+
:size="legendSize"
|
|
72
|
+
:has-percent-value="hasLegendPercentValue"
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<template
|
|
76
|
+
v-if="
|
|
77
|
+
labelDataExists &&
|
|
78
|
+
labelDataPosition === PROGRESS_BAR_LABEL_DATA_POSITIONS.BOTTOM
|
|
79
|
+
"
|
|
80
|
+
>
|
|
81
|
+
<div v-if="!hasLegend" />
|
|
82
|
+
|
|
83
|
+
<progress-bar-label-data-wrapper
|
|
84
|
+
class="ds-progressBar__labelDataWrapperBottom"
|
|
85
|
+
:label-data="labelData"
|
|
86
|
+
:label-data-supporting="labelDataSupporting"
|
|
87
|
+
:label-data-suffix="labelDataSuffix"
|
|
88
|
+
/>
|
|
89
|
+
</template>
|
|
90
|
+
</div>
|
|
73
91
|
</div>
|
|
74
92
|
</template>
|
|
75
93
|
|
|
@@ -88,7 +106,6 @@ $progress-bar-xs-height: 4px;
|
|
|
88
106
|
$progress-bar-border-radius: 8px;
|
|
89
107
|
|
|
90
108
|
$progress-bar-label-text-max-width: 70%;
|
|
91
|
-
$progress-bar-label-data-max-width: 30%;
|
|
92
109
|
|
|
93
110
|
$progress-bar-badge-size: 24px;
|
|
94
111
|
$progress-bar-badge-size-small: 16px;
|
|
@@ -240,36 +257,6 @@ $progress-bar-badge-colors: (
|
|
|
240
257
|
}
|
|
241
258
|
}
|
|
242
259
|
|
|
243
|
-
&__labelDataWrapper {
|
|
244
|
-
@include label-m-default-bold;
|
|
245
|
-
|
|
246
|
-
align-items: baseline;
|
|
247
|
-
color: $color-neutral-text-heavy;
|
|
248
|
-
display: flex;
|
|
249
|
-
flex-wrap: wrap;
|
|
250
|
-
justify-content: right;
|
|
251
|
-
margin-bottom: $space-5xs;
|
|
252
|
-
margin-left: $space-2xs;
|
|
253
|
-
max-width: $progress-bar-label-data-max-width;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
&__labelDataSupporting {
|
|
257
|
-
color: $color-neutral-text;
|
|
258
|
-
display: flex;
|
|
259
|
-
margin-left: $space-5xs;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
&__labelDataSeparator {
|
|
263
|
-
margin-right: $space-5xs;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
&__labelDataSuffix {
|
|
267
|
-
@include label-s-default-regular;
|
|
268
|
-
|
|
269
|
-
color: $color-neutral-text-weak;
|
|
270
|
-
margin-left: $space-4xs;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
260
|
&__range {
|
|
274
261
|
@each $class, $color-name in $progress-bar-range-colors {
|
|
275
262
|
&.-ds-#{$class} {
|
|
@@ -309,6 +296,21 @@ $progress-bar-badge-colors: (
|
|
|
309
296
|
width: $progress-bar-badge-size-small;
|
|
310
297
|
}
|
|
311
298
|
}
|
|
299
|
+
|
|
300
|
+
&__bottomWrapper {
|
|
301
|
+
align-items: center;
|
|
302
|
+
display: flex;
|
|
303
|
+
gap: $space-4xs;
|
|
304
|
+
justify-content: space-between;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&__labelDataWrapperTop {
|
|
308
|
+
margin-bottom: $space-5xs;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&__labelDataWrapperBottom {
|
|
312
|
+
padding-top: 10px;
|
|
313
|
+
}
|
|
312
314
|
}
|
|
313
315
|
</style>
|
|
314
316
|
|
|
@@ -316,11 +318,13 @@ $progress-bar-badge-colors: (
|
|
|
316
318
|
import { defineComponent, PropType } from 'vue';
|
|
317
319
|
import {
|
|
318
320
|
PROGRESS_BAR_BADGE_COLORS,
|
|
321
|
+
PROGRESS_BAR_LABEL_DATA_POSITIONS,
|
|
319
322
|
PROGRESS_BAR_LABEL_TEXT_SIZES,
|
|
320
323
|
PROGRESS_BAR_LAYOUTS,
|
|
321
324
|
PROGRESS_BAR_RADII,
|
|
322
325
|
PROGRESS_BAR_SIZES,
|
|
323
326
|
ProgressBarBadgeColor,
|
|
327
|
+
ProgressBarLabelDataPositions,
|
|
324
328
|
ProgressBarLabelTextSize,
|
|
325
329
|
ProgressBarLayout,
|
|
326
330
|
ProgressBarRadius,
|
|
@@ -331,10 +335,12 @@ import {
|
|
|
331
335
|
import DsIcon, { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
332
336
|
import ProgressBarLegend from './ProgressBarLegend.vue';
|
|
333
337
|
import { PROGRESS_BAR_LEGEND_SIZES, ProgressBarLegendSize } from './ProgressBarLegend.consts';
|
|
338
|
+
import ProgressBarLabelDataWrapper from './ProgressBarLabelDataWrapper.vue';
|
|
334
339
|
|
|
335
340
|
export default defineComponent({
|
|
336
341
|
name: 'ProgressBar',
|
|
337
342
|
components: {
|
|
343
|
+
ProgressBarLabelDataWrapper,
|
|
338
344
|
ProgressBarLegend,
|
|
339
345
|
DsIcon,
|
|
340
346
|
},
|
|
@@ -423,15 +429,20 @@ export default defineComponent({
|
|
|
423
429
|
type: Boolean,
|
|
424
430
|
default: true,
|
|
425
431
|
},
|
|
432
|
+
labelDataPosition: {
|
|
433
|
+
type: String as PropType<ProgressBarLabelDataPositions>,
|
|
434
|
+
default: PROGRESS_BAR_LABEL_DATA_POSITIONS.TOP,
|
|
435
|
+
},
|
|
426
436
|
},
|
|
427
|
-
|
|
437
|
+
setup() {
|
|
428
438
|
return {
|
|
429
|
-
PROGRESS_BAR_SIZES
|
|
430
|
-
PROGRESS_BAR_RADII
|
|
431
|
-
PROGRESS_BAR_LAYOUTS
|
|
432
|
-
PROGRESS_BAR_LABEL_TEXT_SIZES
|
|
433
|
-
ICONS
|
|
434
|
-
ICON_SIZES
|
|
439
|
+
PROGRESS_BAR_SIZES,
|
|
440
|
+
PROGRESS_BAR_RADII,
|
|
441
|
+
PROGRESS_BAR_LAYOUTS,
|
|
442
|
+
PROGRESS_BAR_LABEL_TEXT_SIZES,
|
|
443
|
+
ICONS,
|
|
444
|
+
ICON_SIZES,
|
|
445
|
+
PROGRESS_BAR_LABEL_DATA_POSITIONS,
|
|
435
446
|
};
|
|
436
447
|
},
|
|
437
448
|
computed: {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ds-progressBarLabelDataWrapper">
|
|
3
|
+
<span v-if="labelData" class="ds-progressBarLabelDataWrapper__labelData">{{
|
|
4
|
+
labelData
|
|
5
|
+
}}</span>
|
|
6
|
+
<span
|
|
7
|
+
v-if="labelDataSupporting"
|
|
8
|
+
class="ds-progressBarLabelDataWrapper__labelDataSupporting"
|
|
9
|
+
>
|
|
10
|
+
<span class="ds-progressBarLabelDataWrapper__labelDataSeparator">/</span>
|
|
11
|
+
{{ labelDataSupporting }}
|
|
12
|
+
</span>
|
|
13
|
+
<span v-if="labelDataSuffix" class="ds-progressBarLabelDataWrapper__labelDataSuffix">{{
|
|
14
|
+
labelDataSuffix
|
|
15
|
+
}}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped lang="scss">
|
|
20
|
+
@import '../../../styles/settings/spacings';
|
|
21
|
+
@import '../../../styles/settings/colors/tokens';
|
|
22
|
+
@import '../../../styles/settings/typography/tokens';
|
|
23
|
+
|
|
24
|
+
$progress-bar-label-data-max-width: 30%;
|
|
25
|
+
|
|
26
|
+
.ds-progressBarLabelDataWrapper {
|
|
27
|
+
@include label-m-default-bold;
|
|
28
|
+
|
|
29
|
+
align-items: baseline;
|
|
30
|
+
color: $color-neutral-text-heavy;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
justify-content: right;
|
|
34
|
+
margin-left: $space-2xs;
|
|
35
|
+
max-width: $progress-bar-label-data-max-width;
|
|
36
|
+
|
|
37
|
+
&__labelDataSupporting {
|
|
38
|
+
color: $color-neutral-text;
|
|
39
|
+
display: flex;
|
|
40
|
+
margin-left: $space-5xs;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__labelDataSeparator {
|
|
44
|
+
margin-right: $space-5xs;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__labelDataSuffix {
|
|
48
|
+
@include label-s-default-regular;
|
|
49
|
+
|
|
50
|
+
color: $color-neutral-text-weak;
|
|
51
|
+
margin-left: $space-4xs;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
|
|
56
|
+
<script lang="ts" setup>
|
|
57
|
+
defineProps<{
|
|
58
|
+
labelData?: string;
|
|
59
|
+
labelDataSupporting?: string;
|
|
60
|
+
labelDataSuffix?: string;
|
|
61
|
+
}>();
|
|
62
|
+
</script>
|
|
@@ -188,6 +188,7 @@ import { faFileCheck } from '@fortawesome/pro-regular-svg-icons/faFileCheck';
|
|
|
188
188
|
import { faFileArrowDown } from '@fortawesome/pro-regular-svg-icons/faFileArrowDown';
|
|
189
189
|
import { faArrowDown as fasArrowDown } from '@fortawesome/pro-solid-svg-icons/faArrowDown';
|
|
190
190
|
import { faArrowLeft as fasArrowLeft } from '@fortawesome/pro-solid-svg-icons/faArrowLeft';
|
|
191
|
+
import { faArrowLeftArrowRight as fasArrowLeftArrowRight } from '@fortawesome/pro-solid-svg-icons/faArrowLeftArrowRight';
|
|
191
192
|
import { faArrowRight as fasArrowRight } from '@fortawesome/pro-solid-svg-icons/faArrowRight';
|
|
192
193
|
import { faArrowsLeftRight as fasArrowsLeftRight } from '@fortawesome/pro-solid-svg-icons/faArrowsLeftRight';
|
|
193
194
|
import { faArrowUp as fasArrowUp } from '@fortawesome/pro-solid-svg-icons/faArrowUp';
|
|
@@ -285,6 +286,7 @@ export const FONTAWESOME_ICONS = {
|
|
|
285
286
|
FA_ARROW_UP_RIGHT_FROM_SQUARE: faArrowUpRightFromSquare,
|
|
286
287
|
FA_ARROW_UP_SOLID: fasArrowUp,
|
|
287
288
|
FA_ARROWS_LEFT_RIGHT_SOLID: fasArrowsLeftRight,
|
|
289
|
+
FA_ARROW_LEFT_ARROW_RIGHT: fasArrowLeftArrowRight,
|
|
288
290
|
FA_ARROWS_FROM_DOTTED_LINE: faArrowsFromDottedLine,
|
|
289
291
|
FA_ARROWS_MAXIMIZE: faArrowsMaximize,
|
|
290
292
|
FA_ARROWS_ROTATE: faArrowsRotate,
|