@bethinkpl/design-system 14.1.1 → 15.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.umd.js +657 -367
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Banner/Banner.stories.d.ts +56 -8
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +28 -4
- package/dist/lib/js/components/Buttons/Button/Button.stories.d.ts +14 -2
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +7 -1
- package/dist/lib/js/components/Buttons/IconButton/IconButton.stories.d.ts +98 -14
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +14 -2
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.stories.d.ts +14 -2
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +7 -1
- package/dist/lib/js/components/Dropdown/Dropdown.consts.d.ts +4 -0
- package/dist/lib/js/components/Dropdown/Dropdown.stories.d.ts +12 -0
- package/dist/lib/js/components/Dropdown/Dropdown.vue.d.ts +6 -0
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +7 -1
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +7 -1
- package/dist/lib/js/components/Modals/Modal/Modal.stories.d.ts +140 -20
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +28 -4
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.stories.d.ts +112 -16
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +28 -4
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.stories.d.ts +78 -6
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.vue.d.ts +39 -3
- package/dist/lib/js/components/Pagination/Pagination.stories.d.ts +42 -6
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +21 -3
- package/dist/lib/js/components/Pill/Pill.stories.d.ts +42 -6
- package/dist/lib/js/components/Pill/Pill.vue.d.ts +21 -3
- package/dist/lib/js/components/ProgressBar/ProgressBar.consts.d.ts +34 -13
- package/dist/lib/js/components/ProgressBar/ProgressBar.stories.d.ts +1477 -169
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +246 -28
- package/dist/lib/js/components/SectionHeader/SectionHeader.stories.d.ts +14 -2
- package/dist/lib/js/components/SectionHeader/SectionHeader.vue.d.ts +7 -1
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.d.ts +14 -2
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +7 -1
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.d.ts +14 -2
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +7 -1
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.stories.d.ts +14 -2
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +7 -1
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +7 -1
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockedeStatus.stories.d.ts +14 -2
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.d.ts +70 -10
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +35 -5
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.d.ts +140 -20
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +35 -5
- package/dist/lib/js/components/Tile/Tile.consts.d.ts +1 -0
- package/dist/lib/js/components/Tile/Tile.stories.d.ts +21 -3
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +7 -1
- package/dist/lib/js/icons/fontawesome.d.ts +7 -0
- package/docs/iframe.html +1 -1
- package/docs/main.a0d19173.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/docs/vendors~main.09187a93.iframe.bundle.js +3 -0
- package/docs/vendors~main.09187a93.iframe.bundle.js.map +1 -0
- package/lib/js/components/Dropdown/Dropdown.consts.ts +5 -0
- package/lib/js/components/Dropdown/Dropdown.stories.ts +14 -4
- package/lib/js/components/Dropdown/Dropdown.vue +16 -2
- package/lib/js/components/Icons/Icon/Icon.consts.ts +0 -2
- package/lib/js/components/OverlayHeader/OverlayHeader.vue +14 -3
- package/lib/js/components/ProgressBar/ProgressBar.consts.ts +41 -15
- package/lib/js/components/ProgressBar/ProgressBar.stories.ts +37 -49
- package/lib/js/components/ProgressBar/ProgressBar.vue +169 -113
- package/lib/js/components/Tile/Tile.consts.ts +1 -0
- package/lib/js/components/Tile/Tile.vue +16 -0
- package/lib/js/icons/fontawesome.ts +14 -0
- package/package.json +1 -1
- package/docs/main.58fb1ea2.iframe.bundle.js +0 -1
- package/docs/vendors~main.3e958b34.iframe.bundle.js +0 -3
- package/docs/vendors~main.3e958b34.iframe.bundle.js.map +0 -1
- package/lib/images/icons/clipboard-add.svg +0 -1
- /package/docs/{vendors~main.3e958b34.iframe.bundle.js.LICENSE.txt → vendors~main.09187a93.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors~main.09187a93.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import Dropdown from './Dropdown.vue';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DROPDOWN_PLACEMENTS,
|
|
4
|
+
DROPDOWN_RADIUSES,
|
|
5
|
+
DROPDOWN_TRIGGER_ACTIONS,
|
|
6
|
+
} from './Dropdown.consts';
|
|
3
7
|
import SelectList from '../SelectList/SelectList.vue';
|
|
4
8
|
|
|
5
9
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
|
|
@@ -13,8 +17,10 @@ export default {
|
|
|
13
17
|
const StoryTemplate: StoryFn<typeof Dropdown> = (argTypes) => ({
|
|
14
18
|
components: { Dropdown, SelectList, SelectListItem },
|
|
15
19
|
props: Object.keys(argTypes),
|
|
16
|
-
template:
|
|
17
|
-
<
|
|
20
|
+
template: `
|
|
21
|
+
<div style="position: relative">
|
|
22
|
+
<dropdown :trigger-action="triggerAction" :force-show="forceShow" :same-width="sameWidth" :radius="radius"
|
|
23
|
+
:placement="placement">
|
|
18
24
|
<template #reference><span>Dropdown entry point</span></template>
|
|
19
25
|
<template #default="{ close }">
|
|
20
26
|
<select-list>
|
|
@@ -23,7 +29,7 @@ const StoryTemplate: StoryFn<typeof Dropdown> = (argTypes) => ({
|
|
|
23
29
|
</select-list>
|
|
24
30
|
</template>
|
|
25
31
|
</dropdown>
|
|
26
|
-
|
|
32
|
+
</div>`,
|
|
27
33
|
});
|
|
28
34
|
|
|
29
35
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -44,6 +50,10 @@ const argTypes = {
|
|
|
44
50
|
control: { type: 'select', options: Object.values(DROPDOWN_RADIUSES) },
|
|
45
51
|
defaultValue: DROPDOWN_RADIUSES.BOTH,
|
|
46
52
|
},
|
|
53
|
+
placement: {
|
|
54
|
+
control: { type: 'select', options: Object.values(DROPDOWN_PLACEMENTS) },
|
|
55
|
+
defaultValue: DROPDOWN_PLACEMENTS.BOTTOM_START,
|
|
56
|
+
},
|
|
47
57
|
} as ArgTypes;
|
|
48
58
|
|
|
49
59
|
Interactive.argTypes = argTypes;
|
|
@@ -68,7 +68,11 @@
|
|
|
68
68
|
<script lang="ts">
|
|
69
69
|
import VuePopper from 'vue-popperjs';
|
|
70
70
|
import 'vue-popperjs/dist/vue-popper.css';
|
|
71
|
-
import {
|
|
71
|
+
import {
|
|
72
|
+
DROPDOWN_PLACEMENTS,
|
|
73
|
+
DROPDOWN_RADIUSES,
|
|
74
|
+
DROPDOWN_TRIGGER_ACTIONS,
|
|
75
|
+
} from './Dropdown.consts';
|
|
72
76
|
|
|
73
77
|
export default {
|
|
74
78
|
name: 'Dropdown',
|
|
@@ -102,6 +106,13 @@ export default {
|
|
|
102
106
|
return Object.values(DROPDOWN_RADIUSES).includes(radius);
|
|
103
107
|
},
|
|
104
108
|
},
|
|
109
|
+
placement: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: DROPDOWN_PLACEMENTS.BOTTOM_START,
|
|
112
|
+
validate(placement) {
|
|
113
|
+
return Object.values(DROPDOWN_PLACEMENTS).includes(placement);
|
|
114
|
+
},
|
|
115
|
+
},
|
|
105
116
|
},
|
|
106
117
|
data() {
|
|
107
118
|
return {
|
|
@@ -113,7 +124,7 @@ export default {
|
|
|
113
124
|
options() {
|
|
114
125
|
return {
|
|
115
126
|
modifiers: { preventOverflow: { padding: 0 } },
|
|
116
|
-
placement:
|
|
127
|
+
placement: this.placement,
|
|
117
128
|
...(this.sameWidth && {
|
|
118
129
|
// See https://github.com/floating-ui/floating-ui/issues/794
|
|
119
130
|
// We can't use onCreate because vue-popper overrides it.
|
|
@@ -135,6 +146,9 @@ export default {
|
|
|
135
146
|
boundariesSelector() {
|
|
136
147
|
this.updateKey();
|
|
137
148
|
},
|
|
149
|
+
placement() {
|
|
150
|
+
this.updateKey();
|
|
151
|
+
},
|
|
138
152
|
},
|
|
139
153
|
methods: {
|
|
140
154
|
close() {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ClipboardAdd from '../../../../images/icons/clipboard-add.svg';
|
|
2
1
|
import HeadWithQuestionMark from '../../../../images/icons/head-with-question-mark.svg';
|
|
3
2
|
import Ribbon from '../../../../images/icons/ribbon.svg';
|
|
4
3
|
import SlidersSearch from '../../../../images/icons/sliders-search.svg';
|
|
@@ -16,7 +15,6 @@ export const ICON_SIZES = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
const BETHINK_ICONS = {
|
|
19
|
-
CLIPBOARD_ADD: ClipboardAdd,
|
|
20
18
|
HEAD_WITH_QUESTION_MARK: HeadWithQuestionMark,
|
|
21
19
|
RIBBON: Ribbon,
|
|
22
20
|
SLIDERS_SEARCH: SlidersSearch,
|
|
@@ -61,12 +61,20 @@
|
|
|
61
61
|
/>
|
|
62
62
|
</template>
|
|
63
63
|
<template v-if="$scopedSlots.dropdown">
|
|
64
|
-
<ds-dropdown
|
|
64
|
+
<ds-dropdown
|
|
65
|
+
boundaries-selector="body"
|
|
66
|
+
:placement="DROPDOWN_PLACEMENTS.BOTTOM_END"
|
|
67
|
+
@show="isDropdownOpen = true"
|
|
68
|
+
@hide="isDropdownOpen = false"
|
|
69
|
+
>
|
|
65
70
|
<template #reference>
|
|
66
71
|
<icon-button
|
|
67
72
|
:icon="ICONS.FA_ELLIPSIS_VERTICAL"
|
|
68
73
|
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
69
74
|
:color="ICON_BUTTON_COLORS.NEUTRAL"
|
|
75
|
+
:state="
|
|
76
|
+
isDropdownOpen ? ICON_BUTTON_STATES.HOVERED : ICON_BUTTON_STATES.DEFAULT
|
|
77
|
+
"
|
|
70
78
|
/>
|
|
71
79
|
</template>
|
|
72
80
|
<template #default="{ close }">
|
|
@@ -255,8 +263,8 @@
|
|
|
255
263
|
<script lang="ts">
|
|
256
264
|
import IconButton from '../Buttons/IconButton/IconButton.vue';
|
|
257
265
|
import DsDivider, { DIVIDER_PROMINENCES } from '../Divider';
|
|
258
|
-
import DsDropdown from '../Dropdown';
|
|
259
|
-
import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES } from '../Buttons/IconButton';
|
|
266
|
+
import DsDropdown, { DROPDOWN_PLACEMENTS } from '../Dropdown';
|
|
267
|
+
import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES, ICON_BUTTON_STATES } from '../Buttons/IconButton';
|
|
260
268
|
import { ICONS } from '../Icons/Icon';
|
|
261
269
|
import { OVERLAY_HEADER_BORDER_COLORS } from './OverlayHeader.consts';
|
|
262
270
|
|
|
@@ -290,9 +298,12 @@ export default {
|
|
|
290
298
|
return {
|
|
291
299
|
ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
|
|
292
300
|
ICON_BUTTON_COLORS: Object.freeze(ICON_BUTTON_COLORS),
|
|
301
|
+
ICON_BUTTON_STATES: Object.freeze(ICON_BUTTON_STATES),
|
|
293
302
|
ICONS: Object.freeze(ICONS),
|
|
294
303
|
DIVIDER_PROMINENCES: Object.freeze(DIVIDER_PROMINENCES),
|
|
295
304
|
OVERLAY_HEADER_BORDER_COLORS: Object.freeze(OVERLAY_HEADER_BORDER_COLORS),
|
|
305
|
+
DROPDOWN_PLACEMENTS: Object.freeze(DROPDOWN_PLACEMENTS),
|
|
306
|
+
isDropdownOpen: false,
|
|
296
307
|
};
|
|
297
308
|
},
|
|
298
309
|
methods: {
|
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const PROGRESS_BAR_RANGE_COLORS = {
|
|
2
|
+
PRIMARY_MEDIUM: 'primaryMedium',
|
|
3
|
+
PRIMARY: 'primary',
|
|
4
|
+
PRIMARY_WEAK: 'primaryWeak',
|
|
5
|
+
PRIMARY_GHOST: 'primaryGhost',
|
|
6
|
+
|
|
7
|
+
NEUTRAL_MEDIUM: 'neutralMedium',
|
|
2
8
|
NEUTRAL: 'neutral',
|
|
9
|
+
NEUTRAL_WEAK: 'neutralWeak',
|
|
10
|
+
NEUTRAL_GHOST: 'neutralGhost',
|
|
11
|
+
|
|
12
|
+
INFO_MEDIUM: 'infoMedium',
|
|
3
13
|
INFO: 'info',
|
|
14
|
+
INFO_WEAK: 'infoWeak',
|
|
15
|
+
INFO_GHOST: 'infoGhost',
|
|
16
|
+
|
|
17
|
+
SUCCESS_MEDIUM: 'successMedium',
|
|
18
|
+
SUCCESS: 'success',
|
|
19
|
+
SUCCESS_WEAK: 'successWeak',
|
|
20
|
+
SUCCESS_GHOST: 'successGhost',
|
|
21
|
+
|
|
22
|
+
WARNING_MEDIUM: 'warningMedium',
|
|
23
|
+
WARNING: 'warning',
|
|
24
|
+
WARNING_WEAK: 'warningWeak',
|
|
25
|
+
WARNING_GHOST: 'warningGhost',
|
|
26
|
+
|
|
27
|
+
FAIL_MEDIUM: 'failMedium',
|
|
28
|
+
FAIL: 'fail',
|
|
29
|
+
FAIL_WEAK: 'failWeak',
|
|
30
|
+
FAIL_GHOST: 'failGhost',
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
export const PROGRESS_BAR_BADGE_COLORS = {
|
|
4
34
|
PRIMARY: 'primary',
|
|
35
|
+
NEUTRAL: 'neutral',
|
|
36
|
+
INFO: 'info',
|
|
5
37
|
SUCCESS: 'success',
|
|
6
38
|
WARNING: 'warning',
|
|
7
39
|
FAIL: 'fail',
|
|
@@ -13,6 +45,11 @@ export const PROGRESS_BAR_SIZES = {
|
|
|
13
45
|
XSMALL: 'extra small',
|
|
14
46
|
} as const;
|
|
15
47
|
|
|
48
|
+
export const PROGRESS_BAR_LABEL_TEXT_SIZES = {
|
|
49
|
+
MEDIUM: 'medium',
|
|
50
|
+
SMALL: 'small',
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
16
53
|
export const PROGRESS_BAR_RADII = {
|
|
17
54
|
DEFAULT: 'default',
|
|
18
55
|
NONE: 'none',
|
|
@@ -23,19 +60,8 @@ export const PROGRESS_BAR_LAYOUTS = {
|
|
|
23
60
|
COMPACT: 'compact',
|
|
24
61
|
};
|
|
25
62
|
|
|
26
|
-
export const PROGRESS_BAR_LAYERS = {
|
|
27
|
-
ONE: 1,
|
|
28
|
-
TWO: 2,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const PROGRESS_BAR_COLOR_SCHEMES = {
|
|
32
|
-
DEFAULT: 'default',
|
|
33
|
-
MEDIUM: 'medium',
|
|
34
|
-
MEDIUM_NEUTRAL: 'medium-neutral',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
63
|
export interface ProgressBarRange {
|
|
38
|
-
|
|
39
|
-
start:
|
|
40
|
-
length:
|
|
64
|
+
color: typeof PROGRESS_BAR_RANGE_COLORS[keyof typeof PROGRESS_BAR_RANGE_COLORS];
|
|
65
|
+
start: number;
|
|
66
|
+
length: number;
|
|
41
67
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import ProgressBar from './ProgressBar.vue';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
PROGRESS_BAR_RANGE_COLORS,
|
|
4
4
|
PROGRESS_BAR_SIZES,
|
|
5
5
|
PROGRESS_BAR_LAYOUTS,
|
|
6
6
|
PROGRESS_BAR_RADII,
|
|
7
|
-
PROGRESS_BAR_LAYERS,
|
|
8
|
-
PROGRESS_BAR_COLOR_SCHEMES,
|
|
9
7
|
ProgressBarRange,
|
|
8
|
+
PROGRESS_BAR_LABEL_TEXT_SIZES,
|
|
9
|
+
PROGRESS_BAR_BADGE_COLORS,
|
|
10
10
|
} from './ProgressBar.consts';
|
|
11
11
|
|
|
12
12
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
|
|
@@ -19,43 +19,39 @@ export default {
|
|
|
19
19
|
const StoryTemplate: StoryFn<typeof ProgressBar> = (argTypes) => ({
|
|
20
20
|
components: { ProgressBar },
|
|
21
21
|
props: Object.keys(argTypes),
|
|
22
|
-
template:
|
|
22
|
+
template: `
|
|
23
|
+
<ProgressBar
|
|
24
|
+
v-bind=$props
|
|
25
|
+
:badge-position="(typeof ($props.badgePosition) === 'undefined' || $props.badgePosition === '') ? null : parseInt($props.badgePosition, 10)"
|
|
26
|
+
/>`,
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
export const Interactive = StoryTemplate.bind({});
|
|
26
30
|
|
|
27
31
|
const argTypes = {
|
|
28
|
-
numberOfLayers: {
|
|
29
|
-
control: { type: 'select', options: Object.values(PROGRESS_BAR_LAYERS) },
|
|
30
|
-
defaultValue: PROGRESS_BAR_LAYERS.ONE,
|
|
31
|
-
},
|
|
32
|
-
colorScheme: {
|
|
33
|
-
control: { type: 'select', options: Object.values(PROGRESS_BAR_COLOR_SCHEMES) },
|
|
34
|
-
defaultValue: PROGRESS_BAR_COLOR_SCHEMES.DEFAULT,
|
|
35
|
-
},
|
|
36
|
-
color: {
|
|
37
|
-
control: { type: 'select', options: Object.values(PROGRESS_BAR_COLORS) },
|
|
38
|
-
defaultValue: PROGRESS_BAR_COLORS.INFO,
|
|
39
|
-
},
|
|
40
32
|
size: {
|
|
41
33
|
control: { type: 'select', options: Object.values(PROGRESS_BAR_SIZES) },
|
|
42
|
-
defaultValue: PROGRESS_BAR_SIZES.
|
|
34
|
+
defaultValue: PROGRESS_BAR_SIZES.SMALL,
|
|
35
|
+
},
|
|
36
|
+
labelTextSize: {
|
|
37
|
+
control: { type: 'select', options: Object.values(PROGRESS_BAR_LABEL_TEXT_SIZES) },
|
|
38
|
+
defaultValue: PROGRESS_BAR_LABEL_TEXT_SIZES.SMALL,
|
|
43
39
|
},
|
|
44
40
|
ranges: {
|
|
45
41
|
control: { type: 'array' },
|
|
46
42
|
defaultValue: [
|
|
47
43
|
{
|
|
48
|
-
|
|
44
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
49
45
|
start: 0,
|
|
50
46
|
length: 30,
|
|
51
47
|
} as ProgressBarRange,
|
|
52
48
|
{
|
|
53
|
-
|
|
49
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO_WEAK,
|
|
54
50
|
start: 30,
|
|
55
51
|
length: 10,
|
|
56
52
|
} as ProgressBarRange,
|
|
57
53
|
{
|
|
58
|
-
|
|
54
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO_GHOST,
|
|
59
55
|
start: 40,
|
|
60
56
|
length: 10,
|
|
61
57
|
} as ProgressBarRange,
|
|
@@ -85,6 +81,15 @@ const argTypes = {
|
|
|
85
81
|
control: { type: 'text' },
|
|
86
82
|
defaultValue: '(%)',
|
|
87
83
|
},
|
|
84
|
+
badgePosition: {
|
|
85
|
+
// we use `text` type, because Storybook doesn't allow empty field in `number` type which imitates null
|
|
86
|
+
control: { type: 'text' },
|
|
87
|
+
defaultValue: '50',
|
|
88
|
+
},
|
|
89
|
+
badgeColor: {
|
|
90
|
+
control: { type: 'select', options: Object.values(PROGRESS_BAR_BADGE_COLORS) },
|
|
91
|
+
defaultValue: PROGRESS_BAR_BADGE_COLORS.INFO,
|
|
92
|
+
},
|
|
88
93
|
} as ArgTypes;
|
|
89
94
|
|
|
90
95
|
Interactive.argTypes = argTypes;
|
|
@@ -96,90 +101,74 @@ Interactive.parameters = {
|
|
|
96
101
|
},
|
|
97
102
|
};
|
|
98
103
|
|
|
99
|
-
const argTypesColorOnly = {
|
|
100
|
-
color: {
|
|
101
|
-
control: { type: 'select', options: Object.values(PROGRESS_BAR_COLORS) },
|
|
102
|
-
defaultValue: PROGRESS_BAR_COLORS.INFO,
|
|
103
|
-
},
|
|
104
|
-
} as ArgTypes;
|
|
105
|
-
|
|
106
104
|
export const WithoutLabels = StoryTemplate.bind({});
|
|
107
105
|
|
|
108
106
|
WithoutLabels.args = {
|
|
109
|
-
color: PROGRESS_BAR_COLORS.PRIMARY,
|
|
110
107
|
ranges: [
|
|
111
108
|
{
|
|
112
|
-
|
|
109
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
113
110
|
start: 0,
|
|
114
111
|
length: 30,
|
|
115
112
|
} as ProgressBarRange,
|
|
116
113
|
],
|
|
117
114
|
} as Args;
|
|
118
|
-
WithoutLabels.argTypes = argTypesColorOnly;
|
|
119
115
|
|
|
120
|
-
export const
|
|
116
|
+
export const TwoColors = StoryTemplate.bind({});
|
|
121
117
|
|
|
122
|
-
|
|
123
|
-
color: PROGRESS_BAR_COLORS.PRIMARY,
|
|
124
|
-
numberOfLayers: 2,
|
|
118
|
+
TwoColors.args = {
|
|
125
119
|
ranges: [
|
|
126
120
|
{
|
|
127
|
-
|
|
121
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
128
122
|
start: 0,
|
|
129
123
|
length: 30,
|
|
130
124
|
} as ProgressBarRange,
|
|
131
125
|
{
|
|
132
|
-
|
|
126
|
+
color: PROGRESS_BAR_RANGE_COLORS.WARNING,
|
|
133
127
|
start: 30,
|
|
134
128
|
length: 30,
|
|
135
129
|
} as ProgressBarRange,
|
|
136
130
|
],
|
|
137
131
|
} as Args;
|
|
138
|
-
TwoLayers.argTypes = argTypesColorOnly;
|
|
139
132
|
|
|
140
133
|
export const WithGaps = StoryTemplate.bind({});
|
|
141
134
|
|
|
142
135
|
WithGaps.args = {
|
|
143
|
-
color: PROGRESS_BAR_COLORS.PRIMARY,
|
|
144
|
-
numberOfLayers: 2,
|
|
145
136
|
ranges: [
|
|
146
137
|
{
|
|
147
|
-
|
|
138
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
148
139
|
start: 0,
|
|
149
140
|
length: 10,
|
|
150
141
|
} as ProgressBarRange,
|
|
151
142
|
{
|
|
152
|
-
|
|
143
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO_WEAK,
|
|
153
144
|
start: 20,
|
|
154
145
|
length: 10,
|
|
155
146
|
} as ProgressBarRange,
|
|
156
147
|
{
|
|
157
|
-
|
|
148
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
158
149
|
start: 40,
|
|
159
150
|
length: 10,
|
|
160
151
|
} as ProgressBarRange,
|
|
161
152
|
{
|
|
162
|
-
|
|
153
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO_WEAK,
|
|
163
154
|
start: 50,
|
|
164
155
|
length: 10,
|
|
165
156
|
} as ProgressBarRange,
|
|
166
157
|
{
|
|
167
|
-
|
|
158
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
168
159
|
start: 70,
|
|
169
|
-
length:
|
|
160
|
+
length: 30,
|
|
170
161
|
} as ProgressBarRange,
|
|
171
162
|
],
|
|
172
163
|
} as Args;
|
|
173
|
-
WithGaps.argTypes = argTypesColorOnly;
|
|
174
164
|
|
|
175
165
|
export const Compact = StoryTemplate.bind({});
|
|
176
166
|
|
|
177
167
|
Compact.args = {
|
|
178
|
-
color: PROGRESS_BAR_COLORS.PRIMARY,
|
|
179
168
|
layout: PROGRESS_BAR_LAYOUTS.COMPACT,
|
|
180
169
|
ranges: [
|
|
181
170
|
{
|
|
182
|
-
|
|
171
|
+
color: PROGRESS_BAR_RANGE_COLORS.INFO,
|
|
183
172
|
start: 0,
|
|
184
173
|
length: 30,
|
|
185
174
|
} as ProgressBarRange,
|
|
@@ -189,4 +178,3 @@ Compact.args = {
|
|
|
189
178
|
labelDataSupporting: '100',
|
|
190
179
|
labelDataSuffix: '(%)',
|
|
191
180
|
} as Args;
|
|
192
|
-
Compact.argTypes = argTypesColorOnly;
|