@bethinkpl/design-system 41.1.3 → 41.1.5
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 +7145 -7148
- 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/Drawer.consts.d.ts +6 -0
- package/dist/lib/js/components/Drawer/Drawer.vue.d.ts +13 -1
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.consts.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +63 -1394
- 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.vue.d.ts +1 -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/lib/js/components/Cards/Card/Card.vue +4 -0
- package/lib/js/components/Drawer/Drawer.consts.ts +9 -0
- package/lib/js/components/Drawer/Drawer.spec.ts +36 -0
- package/lib/js/components/Drawer/Drawer.stories.ts +7 -2
- package/lib/js/components/Drawer/Drawer.vue +35 -2
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.consts.ts +8 -0
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.spec.ts +40 -1
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.stories.ts +22 -8
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue +129 -146
- package/lib/js/icons/fontawesome.ts +2 -0
- package/package.json +1 -1
|
@@ -1,65 +1,76 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
v-if="hasBackButton"
|
|
16
|
-
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
17
|
-
:icon="ICONS.FA_CHEVRON_LEFT"
|
|
2
|
+
<div
|
|
3
|
+
class="ds-drawerHeader"
|
|
4
|
+
:class="{
|
|
5
|
+
'-ds-backgroundDefault': backgroundColor === DRAWER_HEADER_BACKGROUND_COLORS.DEFAULT,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<div class="ds-drawerHeader__headerWrapper">
|
|
9
|
+
<div class="ds-drawerHeader__titleWrapper">
|
|
10
|
+
<ds-button
|
|
11
|
+
v-if="isSecondLevel"
|
|
12
|
+
:icon-left="ICONS.FA_CHEVRON_LEFT"
|
|
13
|
+
:type="BUTTON_TYPES.TEXT"
|
|
14
|
+
class="ds-drawerHeader__secondLevel"
|
|
18
15
|
@click="$emit('backClicked')"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
>
|
|
30
|
-
{{ eyebrowText }}
|
|
31
|
-
</span>
|
|
32
|
-
<div class="ds-drawerHeader__title">
|
|
33
|
-
<icon
|
|
34
|
-
v-if="leftIcon"
|
|
35
|
-
:icon="leftIcon"
|
|
36
|
-
:size="ICON_SIZES.X_SMALL"
|
|
37
|
-
class="ds-drawerHeader__leftIcon"
|
|
38
|
-
/>
|
|
16
|
+
>
|
|
17
|
+
{{ t('ds.globals.back') }}
|
|
18
|
+
</ds-button>
|
|
19
|
+
<div :class="{ '-ds-hidden': isSecondLevel }" class="ds-drawerHeader__firstLevel">
|
|
20
|
+
<icon-button
|
|
21
|
+
v-if="hasBackButton"
|
|
22
|
+
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
23
|
+
:icon="ICONS.FA_CHEVRON_LEFT"
|
|
24
|
+
@click="$emit('backClicked')"
|
|
25
|
+
/>
|
|
26
|
+
<div class="ds-drawerHeader__textWrapper">
|
|
39
27
|
<span
|
|
40
|
-
v-if="
|
|
41
|
-
class="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
v-if="eyebrowText"
|
|
29
|
+
:class="{
|
|
30
|
+
'-ds-isInteractive': isInteractiveEyebrow,
|
|
31
|
+
'-ds-ellipsis': eyebrowEllipsis,
|
|
32
|
+
}"
|
|
33
|
+
class="ds-drawerHeader__eyebrow"
|
|
34
|
+
@click="isInteractiveEyebrow && $emit('eyebrowClicked')"
|
|
45
35
|
>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
{{ eyebrowText }}
|
|
37
|
+
</span>
|
|
38
|
+
<div class="ds-drawerHeader__title">
|
|
39
|
+
<icon
|
|
40
|
+
v-if="leftIcon"
|
|
41
|
+
:icon="leftIcon"
|
|
42
|
+
:size="ICON_SIZES.X_SMALL"
|
|
43
|
+
class="ds-drawerHeader__leftIcon"
|
|
44
|
+
/>
|
|
45
|
+
<span
|
|
46
|
+
v-if="title"
|
|
47
|
+
class="ds-drawerHeader__titleText"
|
|
48
|
+
:class="{
|
|
49
|
+
'-ds-ellipsis': titleEllipsis,
|
|
50
|
+
[`-ds-${titleColor}`]: true,
|
|
51
|
+
}"
|
|
52
|
+
:title="titleEllipsis ? title : undefined"
|
|
53
|
+
>{{ title }}</span
|
|
54
|
+
>
|
|
55
|
+
<chip v-if="chipLabel" :label="chipLabel" />
|
|
56
|
+
<div v-if="$slots.titleTrailing">
|
|
57
|
+
<slot name="titleTrailing" />
|
|
58
|
+
</div>
|
|
49
59
|
</div>
|
|
50
60
|
</div>
|
|
51
61
|
</div>
|
|
62
|
+
<div v-if="$slots.actions" class="ds-drawerHeader__actions">
|
|
63
|
+
<slot name="actions" />
|
|
64
|
+
</div>
|
|
65
|
+
<icon-button
|
|
66
|
+
v-if="isClosable"
|
|
67
|
+
:color="ICON_COLORS.NEUTRAL"
|
|
68
|
+
:icon="ICONS.FA_XMARK"
|
|
69
|
+
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
70
|
+
@click="$emit('close')"
|
|
71
|
+
/>
|
|
52
72
|
</div>
|
|
53
|
-
<
|
|
54
|
-
<slot name="actions" />
|
|
55
|
-
</div>
|
|
56
|
-
<icon-button
|
|
57
|
-
v-if="isClosable"
|
|
58
|
-
:color="ICON_COLORS.NEUTRAL"
|
|
59
|
-
:icon="ICONS.FA_XMARK"
|
|
60
|
-
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
61
|
-
@click="$emit('close')"
|
|
62
|
-
/>
|
|
73
|
+
<slot name="supporting" />
|
|
63
74
|
</div>
|
|
64
75
|
<divider v-if="hasDivider" :size="DIVIDER_SIZES.L" :prominence="DIVIDER_PROMINENCES.WEAK" />
|
|
65
76
|
</div>
|
|
@@ -76,6 +87,15 @@ $minimal-drawer-header-height: 58px;
|
|
|
76
87
|
display: flex;
|
|
77
88
|
flex-direction: column;
|
|
78
89
|
|
|
90
|
+
&.-ds-backgroundDefault {
|
|
91
|
+
background-color: $color-default-background;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__headerWrapper {
|
|
95
|
+
min-height: $minimal-drawer-header-height;
|
|
96
|
+
padding: $space-6;
|
|
97
|
+
}
|
|
98
|
+
|
|
79
99
|
&__secondLevel {
|
|
80
100
|
position: absolute !important; // it is required so firstLevel content does not make component wider when hidden, and important is needed so component does not change its width when button was clicked
|
|
81
101
|
}
|
|
@@ -148,8 +168,6 @@ $minimal-drawer-header-height: 58px;
|
|
|
148
168
|
column-gap: $space-2;
|
|
149
169
|
display: flex;
|
|
150
170
|
justify-content: space-between;
|
|
151
|
-
min-height: $minimal-drawer-header-height;
|
|
152
|
-
padding: $space-6;
|
|
153
171
|
}
|
|
154
172
|
|
|
155
173
|
&__actions {
|
|
@@ -158,96 +176,61 @@ $minimal-drawer-header-height: 58px;
|
|
|
158
176
|
}
|
|
159
177
|
</style>
|
|
160
178
|
|
|
161
|
-
<script lang="ts">
|
|
162
|
-
import {
|
|
163
|
-
|
|
164
|
-
import
|
|
165
|
-
import
|
|
166
|
-
import
|
|
167
|
-
import
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
import { DRAWER_HEADER_TITLE_COLORS, DrawerHeaderTitleColor } from './DrawerHeader.consts';
|
|
179
|
+
<script setup lang="ts">
|
|
180
|
+
import DsButton, { BUTTON_TYPES } from '../../Buttons/Button';
|
|
181
|
+
import Divider, { DIVIDER_PROMINENCES, DIVIDER_SIZES } from '../../Divider';
|
|
182
|
+
import IconButton, { ICON_BUTTON_SIZES } from '../../Buttons/IconButton';
|
|
183
|
+
import Chip from '../../Chip';
|
|
184
|
+
import Icon, { ICON_COLORS, ICON_SIZES, ICONS, IconItem } from '../../Icons/Icon';
|
|
185
|
+
import {
|
|
186
|
+
DRAWER_HEADER_BACKGROUND_COLORS,
|
|
187
|
+
DRAWER_HEADER_TITLE_COLORS,
|
|
188
|
+
DrawerHeaderBackgroundColor,
|
|
189
|
+
DrawerHeaderTitleColor,
|
|
190
|
+
} from './DrawerHeader.consts';
|
|
174
191
|
import { useLegacyI18n } from '../../../composables/useLegacyI18n';
|
|
175
192
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
type: Boolean,
|
|
220
|
-
default: true,
|
|
221
|
-
},
|
|
222
|
-
hasDivider: {
|
|
223
|
-
type: Boolean,
|
|
224
|
-
default: false,
|
|
225
|
-
},
|
|
226
|
-
isSecondLevel: {
|
|
227
|
-
type: Boolean,
|
|
228
|
-
default: false,
|
|
229
|
-
},
|
|
230
|
-
hasBackButton: {
|
|
231
|
-
type: Boolean,
|
|
232
|
-
default: false,
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
// TODO fix me when touching this file
|
|
236
|
-
// eslint-disable-next-line vue/require-emit-validator
|
|
237
|
-
emits: ['backClicked', 'close', 'eyebrowClicked'],
|
|
238
|
-
setup() {
|
|
239
|
-
const { t } = useLegacyI18n();
|
|
240
|
-
|
|
241
|
-
return {
|
|
242
|
-
t,
|
|
243
|
-
BUTTON_TYPES,
|
|
244
|
-
DIVIDER_SIZES,
|
|
245
|
-
DIVIDER_PROMINENCES,
|
|
246
|
-
ICONS,
|
|
247
|
-
ICON_BUTTON_SIZES,
|
|
248
|
-
ICON_SIZES,
|
|
249
|
-
ICON_COLORS,
|
|
250
|
-
};
|
|
251
|
-
},
|
|
252
|
-
});
|
|
193
|
+
const {
|
|
194
|
+
eyebrowText = null,
|
|
195
|
+
isInteractiveEyebrow = false,
|
|
196
|
+
eyebrowEllipsis = false,
|
|
197
|
+
title = null,
|
|
198
|
+
titleEllipsis = false,
|
|
199
|
+
titleColor = DRAWER_HEADER_TITLE_COLORS.NEUTRAL_STRONG,
|
|
200
|
+
leftIcon = null,
|
|
201
|
+
chipLabel = null,
|
|
202
|
+
isClosable = true,
|
|
203
|
+
hasDivider = false,
|
|
204
|
+
isSecondLevel = false,
|
|
205
|
+
hasBackButton = false,
|
|
206
|
+
backgroundColor = DRAWER_HEADER_BACKGROUND_COLORS.NONE,
|
|
207
|
+
} = defineProps<{
|
|
208
|
+
eyebrowText?: string | null;
|
|
209
|
+
isInteractiveEyebrow?: boolean;
|
|
210
|
+
eyebrowEllipsis?: boolean;
|
|
211
|
+
title?: string | null;
|
|
212
|
+
titleEllipsis?: boolean;
|
|
213
|
+
titleColor?: DrawerHeaderTitleColor;
|
|
214
|
+
leftIcon?: IconItem | null;
|
|
215
|
+
chipLabel?: string | null;
|
|
216
|
+
isClosable?: boolean;
|
|
217
|
+
hasDivider?: boolean;
|
|
218
|
+
isSecondLevel?: boolean;
|
|
219
|
+
hasBackButton?: boolean;
|
|
220
|
+
backgroundColor?: DrawerHeaderBackgroundColor;
|
|
221
|
+
}>();
|
|
222
|
+
|
|
223
|
+
defineSlots<{
|
|
224
|
+
titleTrailing?: () => any;
|
|
225
|
+
actions?: () => any;
|
|
226
|
+
supporting?: () => any;
|
|
227
|
+
}>();
|
|
228
|
+
|
|
229
|
+
defineEmits<{
|
|
230
|
+
backClicked: [];
|
|
231
|
+
close: [];
|
|
232
|
+
eyebrowClicked: [];
|
|
233
|
+
}>();
|
|
234
|
+
|
|
235
|
+
const { t } = useLegacyI18n();
|
|
253
236
|
</script>
|
|
@@ -208,6 +208,7 @@ import { faCheck as fasCheck } from '@fortawesome/pro-solid-svg-icons/faCheck';
|
|
|
208
208
|
import { faCircleCheck as fasCircleCheck } from '@fortawesome/pro-solid-svg-icons/faCircleCheck';
|
|
209
209
|
import { faCirclePlay as fasCirclePlay } from '@fortawesome/pro-solid-svg-icons/faCirclePlay';
|
|
210
210
|
import { faComment as fasComment } from '@fortawesome/pro-solid-svg-icons/faComment';
|
|
211
|
+
import { faComments as fasComments } from '@fortawesome/pro-solid-svg-icons/faComments';
|
|
211
212
|
import { faCompass as fasCompass } from '@fortawesome/pro-solid-svg-icons/faCompass';
|
|
212
213
|
import { faExclamation as fasExclamation } from '@fortawesome/pro-solid-svg-icons/faExclamation';
|
|
213
214
|
import { faFileLines as fasFileLines } from '@fortawesome/pro-solid-svg-icons/faFileLines';
|
|
@@ -371,6 +372,7 @@ export const FONTAWESOME_ICONS = {
|
|
|
371
372
|
FA_COMMENT: faComment,
|
|
372
373
|
FA_COMMENTS_QUESTION_CHECK: faCommentsQuestionCheck,
|
|
373
374
|
FA_COMMENTS_QUESTION: faCommentsQuestion,
|
|
375
|
+
FA_COMMENTS_SOLID: fasComments,
|
|
374
376
|
FA_COMMENTS: faComments,
|
|
375
377
|
FA_COMPASS_SOLID: fasCompass,
|
|
376
378
|
FA_COMPRESS: faCompress,
|