@bethinkpl/design-system 16.2.1 → 16.3.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/.env +1 -0
- package/.yarnrc.yml +1 -0
- package/README.md +1 -1
- package/dist/design-system.umd.js +5511 -3951
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Drawer/DrawerContent/DrawerContent.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerContent/DrawerContent.vue.d.ts +4 -0
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue.d.ts +20 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/index.d.ts +2 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +3 -0
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue.d.ts +4 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +224 -0
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +8 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.consts.d.ts +7 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +257 -0
- package/dist/lib/js/components/Headers/OverlayHeader/index.d.ts +3 -0
- package/dist/lib/js/components/Headers/PageHeader/PageHeader.consts.d.ts +4 -0
- package/dist/lib/js/components/Headers/PageHeader/PageHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/PageHeader/index.d.ts +3 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.consts.d.ts +10 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +286 -0
- package/dist/lib/js/components/Headers/SectionHeader/index.d.ts +3 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.consts.d.ts +4 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.stories.d.ts +5 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.vue.d.ts +3 -0
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +57 -3
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +183 -0
- package/dist/lib/js/index.d.ts +14 -4
- package/dist/tools/importers/helpers/structures.d.ts +4 -4
- package/docs/iframe.html +1 -1
- package/docs/main.e7609578.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/lib/js/components/Drawer/DrawerContent/DrawerContent.stories.ts +29 -0
- package/lib/js/components/Drawer/DrawerContent/DrawerContent.vue +22 -0
- package/lib/js/components/Drawer/DrawerDivider/DrawerDivider.stories.ts +48 -0
- package/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue +36 -0
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.stories.ts +57 -0
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue +204 -0
- package/lib/js/components/Drawer/DrawerHeader/index.ts +3 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.ts +7 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.ts +43 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue +79 -0
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.ts +31 -0
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue +19 -0
- package/lib/js/components/Drawer/DrawerSection/DrawerSection.stories.ts +41 -0
- package/lib/js/components/Drawer/DrawerSection/DrawerSection.vue +107 -0
- package/lib/js/components/Drawer/DrawerTile/DrawerTile.stories.ts +30 -0
- package/lib/js/components/Drawer/DrawerTile/DrawerTile.vue +22 -0
- package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.stories.ts +1 -1
- package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.vue +14 -10
- package/lib/js/components/Headers/PageHeader/PageHeader.consts.ts +4 -0
- package/lib/js/components/Headers/PageHeader/PageHeader.stories.ts +75 -0
- package/lib/js/components/Headers/PageHeader/PageHeader.vue +125 -0
- package/lib/js/components/Headers/PageHeader/index.ts +4 -0
- package/lib/js/components/Headers/SectionHeader/SectionHeader.consts.ts +10 -0
- package/lib/js/components/{SectionHeader → Headers/SectionHeader}/SectionHeader.stories.ts +46 -13
- package/lib/js/components/Headers/SectionHeader/SectionHeader.vue +395 -0
- package/lib/js/components/SectionTitle/SectionTitle.consts.ts +5 -0
- package/lib/js/components/SectionTitle/SectionTitle.stories.ts +41 -0
- package/lib/js/components/SectionTitle/SectionTitle.vue +58 -0
- package/lib/js/components/Tile/Tile.sb.shared.ts +54 -0
- package/lib/js/components/Tile/Tile.stories.ts +8 -67
- package/lib/js/index.ts +14 -4
- package/lib/styles/settings/colors/_tokens-variables.scss +4 -0
- package/lib/styles/settings/colors/_tokens.json +1 -1
- package/lib/styles/settings/colors/_tokens.scss +4 -0
- package/package.json +1 -1
- package/tools/importers/helpers/structures.ts +4 -4
- package/docs/main.1bbe2ef5.iframe.bundle.js +0 -1
- package/lib/js/components/SectionHeader/SectionHeader.consts.ts +0 -4
- package/lib/js/components/SectionHeader/SectionHeader.vue +0 -230
- /package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.consts.ts +0 -0
- /package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/index.ts +0 -0
- /package/lib/js/components/{SectionHeader → Headers/SectionHeader}/index.ts +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="sectionHeader"
|
|
4
|
+
:class="{
|
|
5
|
+
'-expandable': isExpandable,
|
|
6
|
+
'-horizontal': mobileLayout === SECTION_HEADER_MOBILE_LAYOUTS.HORIZONTAL,
|
|
7
|
+
[sizeClass]: true,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div class="sectionHeader__wrapper">
|
|
11
|
+
<div class="sectionHeader__main">
|
|
12
|
+
<div class="sectionHeader__header">
|
|
13
|
+
<div class="sectionHeader__titleWrapper" @click="onTitleWrapperClicked">
|
|
14
|
+
<ds-icon
|
|
15
|
+
v-if="iconLeft"
|
|
16
|
+
class="sectionHeader__icon"
|
|
17
|
+
:icon="iconLeft"
|
|
18
|
+
:size="iconSize"
|
|
19
|
+
/>
|
|
20
|
+
<div class="sectionHeader__titleContainer">
|
|
21
|
+
<div v-if="eyebrow" class="sectionHeader__eyebrow">{{ eyebrow }}</div>
|
|
22
|
+
<div class="sectionHeader__title">{{ title }}</div>
|
|
23
|
+
</div>
|
|
24
|
+
<ds-icon
|
|
25
|
+
v-if="iconRight"
|
|
26
|
+
class="sectionHeader__icon"
|
|
27
|
+
:icon="iconRight"
|
|
28
|
+
:size="iconSize"
|
|
29
|
+
/>
|
|
30
|
+
<ds-icon
|
|
31
|
+
v-if="isExpandable"
|
|
32
|
+
class="sectionHeader__icon"
|
|
33
|
+
:icon="ICONS.FA_CHEVRON_DOWN"
|
|
34
|
+
:rotation="chevronRotation"
|
|
35
|
+
:size="iconSize"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
<div v-if="info" class="sectionHeader__info">
|
|
39
|
+
<ds-icon-button
|
|
40
|
+
:icon="ICONS.FA_CIRCLE_QUESTION"
|
|
41
|
+
:size="ICON_BUTTON_SIZES.X_SMALL"
|
|
42
|
+
:color="ICON_BUTTON_COLORS.NEUTRAL_WEAK"
|
|
43
|
+
:touchable="false"
|
|
44
|
+
@click.prevent.stop="onInfoClicked"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div v-if="$slots.default && showSlot" class="sectionHeader__slotHorizontal">
|
|
49
|
+
<slot />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div
|
|
54
|
+
v-if="supportingText"
|
|
55
|
+
class="sectionHeader__supportingText"
|
|
56
|
+
:class="{
|
|
57
|
+
'-withoutPadding':
|
|
58
|
+
!divider ||
|
|
59
|
+
(!divider && mobileLayout === SECTION_HEADER_MOBILE_LAYOUTS.HORIZONTAL),
|
|
60
|
+
}"
|
|
61
|
+
>{{ supportingText }}
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div
|
|
65
|
+
v-if="$slots.default && showSlot"
|
|
66
|
+
class="sectionHeader__slotVertical"
|
|
67
|
+
:class="{ '-withoutPadding': !divider }"
|
|
68
|
+
>
|
|
69
|
+
<slot />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<ds-divider v-if="divider" />
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<style scoped lang="scss">
|
|
77
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
78
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
79
|
+
@import '../../../../styles/settings/media-queries';
|
|
80
|
+
@import '../../../../styles/settings/spacings';
|
|
81
|
+
|
|
82
|
+
.sectionHeader {
|
|
83
|
+
$root: &;
|
|
84
|
+
|
|
85
|
+
padding: 0;
|
|
86
|
+
|
|
87
|
+
&__wrapper {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
padding: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__main {
|
|
94
|
+
align-items: center;
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
gap: $space-xxs;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
padding: $space-xxxxs 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__supportingText {
|
|
103
|
+
@include text-s-compact-regular;
|
|
104
|
+
|
|
105
|
+
color: $color-neutral-text;
|
|
106
|
+
padding: 0 0 $space-xs;
|
|
107
|
+
|
|
108
|
+
&.-withoutPadding {
|
|
109
|
+
padding: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&__header {
|
|
114
|
+
align-items: center;
|
|
115
|
+
display: flex;
|
|
116
|
+
gap: $space-xxs;
|
|
117
|
+
width: 100%;
|
|
118
|
+
|
|
119
|
+
@media #{breakpoint-s()} {
|
|
120
|
+
width: auto;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.-expandable &__header {
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
#{$root}__icon {
|
|
129
|
+
color: $color-neutral-icon-hovered;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#{$root}__title {
|
|
133
|
+
color: $color-neutral-text-strong-hovered;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__titleWrapper {
|
|
139
|
+
align-items: center;
|
|
140
|
+
display: flex;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__icon {
|
|
144
|
+
color: $color-neutral-icon;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&__titleContainer {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
gap: $space-xxxxxs;
|
|
151
|
+
padding: $space-xxs 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__title {
|
|
155
|
+
color: $color-neutral-text-strong;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__info {
|
|
159
|
+
padding: $space-xxxs 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&__eyebrow {
|
|
163
|
+
@include info-xs-extensive-bold-uppercase;
|
|
164
|
+
|
|
165
|
+
color: $color-neutral-text-weak;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.-size-large {
|
|
169
|
+
#{$root}__main {
|
|
170
|
+
padding: $space-xxxxxs 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#{$root}__header {
|
|
174
|
+
@include heading-l-default-bold;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
#{$root}__titleWrapper {
|
|
178
|
+
gap: $space-xxs;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
#{$root}__info {
|
|
182
|
+
padding: $space-xxs 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
#{$root}__eyebrow {
|
|
186
|
+
@include info-s-extensive-bold-uppercase;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&.-size-medium {
|
|
191
|
+
#{$root}__header {
|
|
192
|
+
@include heading-m-default-bold;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
#{$root}__titleWrapper {
|
|
196
|
+
gap: $space-xxs;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
#{$root}__info {
|
|
200
|
+
padding: $space-xxs 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
#{$root}__eyebrow {
|
|
204
|
+
@include info-s-extensive-bold-uppercase;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&.-size-small {
|
|
209
|
+
#{$root}__main {
|
|
210
|
+
padding: $space-xxxxxs 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
#{$root}__header {
|
|
214
|
+
@include heading-s-default-bold;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
#{$root}__titleWrapper {
|
|
218
|
+
gap: $space-xxxs;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
#{$root}__info {
|
|
222
|
+
padding: $space-xxs 0;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&.-size-x-small {
|
|
227
|
+
#{$root}__main {
|
|
228
|
+
padding: 0 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
#{$root}__titleContainer {
|
|
232
|
+
padding: $space-xxxs 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
#{$root}__titleWrapper {
|
|
236
|
+
gap: $space-xxxs;
|
|
237
|
+
padding: $space-xxxs 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
#{$root}__header {
|
|
241
|
+
@include heading-xs-default-bold-uppercase;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&__slotHorizontal {
|
|
246
|
+
display: none;
|
|
247
|
+
|
|
248
|
+
@media #{breakpoint-s()} {
|
|
249
|
+
display: block;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
&__slotVertical {
|
|
254
|
+
display: block;
|
|
255
|
+
padding: 0 0 $space-xxxs;
|
|
256
|
+
|
|
257
|
+
@media #{breakpoint-s()} {
|
|
258
|
+
display: none;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&.-withoutPadding {
|
|
262
|
+
padding: 0;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&.-horizontal {
|
|
267
|
+
#{$root}__slotHorizontal {
|
|
268
|
+
display: block;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
#{$root}__slotVertical {
|
|
272
|
+
display: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
</style>
|
|
277
|
+
|
|
278
|
+
<script lang="ts">
|
|
279
|
+
import { SECTION_HEADER_MOBILE_LAYOUTS, SECTION_HEADER_SIZES } from './SectionHeader.consts';
|
|
280
|
+
import DsIcon, { ICON_SIZES, IconItem, ICONS } from '../../Icons/Icon';
|
|
281
|
+
import DsIconButton, { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES } from '../../Buttons/IconButton';
|
|
282
|
+
import DsDivider from '../../Divider';
|
|
283
|
+
import { toRaw } from 'vue';
|
|
284
|
+
|
|
285
|
+
export default {
|
|
286
|
+
name: 'SectionHeader',
|
|
287
|
+
components: {
|
|
288
|
+
DsIcon,
|
|
289
|
+
DsIconButton,
|
|
290
|
+
DsDivider,
|
|
291
|
+
},
|
|
292
|
+
props: {
|
|
293
|
+
isExpandable: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: false,
|
|
296
|
+
},
|
|
297
|
+
hideSlotWhenCollapsed: {
|
|
298
|
+
type: Boolean,
|
|
299
|
+
default: false,
|
|
300
|
+
},
|
|
301
|
+
iconLeft: {
|
|
302
|
+
type: Object as () => IconItem,
|
|
303
|
+
default: null,
|
|
304
|
+
validator(iconLeft: IconItem) {
|
|
305
|
+
return Object.values(ICONS).includes(toRaw(iconLeft));
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
iconRight: {
|
|
309
|
+
type: Object as () => IconItem,
|
|
310
|
+
default: null,
|
|
311
|
+
validator(iconRight: IconItem) {
|
|
312
|
+
return Object.values(ICONS).includes(toRaw(iconRight));
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
isExpanded: {
|
|
316
|
+
type: Boolean,
|
|
317
|
+
default: false,
|
|
318
|
+
},
|
|
319
|
+
info: {
|
|
320
|
+
type: Boolean,
|
|
321
|
+
default: false,
|
|
322
|
+
},
|
|
323
|
+
size: {
|
|
324
|
+
type: String,
|
|
325
|
+
default: SECTION_HEADER_SIZES.MEDIUM,
|
|
326
|
+
validator(size) {
|
|
327
|
+
return Object.values(SECTION_HEADER_SIZES).includes(size);
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
title: {
|
|
331
|
+
type: String,
|
|
332
|
+
required: true,
|
|
333
|
+
},
|
|
334
|
+
eyebrow: {
|
|
335
|
+
type: String,
|
|
336
|
+
default: '',
|
|
337
|
+
},
|
|
338
|
+
supportingText: {
|
|
339
|
+
type: String,
|
|
340
|
+
default: null,
|
|
341
|
+
},
|
|
342
|
+
divider: {
|
|
343
|
+
type: Boolean,
|
|
344
|
+
default: true,
|
|
345
|
+
},
|
|
346
|
+
mobileLayout: {
|
|
347
|
+
type: String,
|
|
348
|
+
default: SECTION_HEADER_MOBILE_LAYOUTS.VERTICAL,
|
|
349
|
+
validator: (value) => Object.values(SECTION_HEADER_MOBILE_LAYOUTS).includes(value),
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
emits: ['info-click', 'update:isExpanded'],
|
|
353
|
+
data() {
|
|
354
|
+
return {
|
|
355
|
+
ICONS: Object.freeze(ICONS),
|
|
356
|
+
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
357
|
+
ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
|
|
358
|
+
ICON_BUTTON_COLORS: Object.freeze(ICON_BUTTON_COLORS),
|
|
359
|
+
SECTION_HEADER_MOBILE_LAYOUTS: Object.freeze(SECTION_HEADER_MOBILE_LAYOUTS),
|
|
360
|
+
};
|
|
361
|
+
},
|
|
362
|
+
computed: {
|
|
363
|
+
chevronRotation(): number | undefined {
|
|
364
|
+
return this.isExpanded ? 180 : undefined;
|
|
365
|
+
},
|
|
366
|
+
showSlot(): boolean {
|
|
367
|
+
return this.isExpanded || !this.hideSlotWhenCollapsed;
|
|
368
|
+
},
|
|
369
|
+
sizeClass(): string {
|
|
370
|
+
return `-size-${this.size}`;
|
|
371
|
+
},
|
|
372
|
+
iconSize(): string {
|
|
373
|
+
if (
|
|
374
|
+
this.size === SECTION_HEADER_SIZES.MEDIUM ||
|
|
375
|
+
this.size === SECTION_HEADER_SIZES.LARGE
|
|
376
|
+
) {
|
|
377
|
+
return ICON_SIZES.X_SMALL;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return ICON_SIZES.XX_SMALL;
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
methods: {
|
|
384
|
+
onInfoClicked(): void {
|
|
385
|
+
this.$emit('info-click');
|
|
386
|
+
},
|
|
387
|
+
onTitleWrapperClicked(): void {
|
|
388
|
+
if (!this.isExpandable) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
this.$emit('update:isExpanded', !this.isExpanded);
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import SectionTitle from './SectionTitle.vue';
|
|
2
|
+
import { SECTION_TITLE_SIZES } from './SectionTitle.consts';
|
|
3
|
+
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/SectionTitle',
|
|
8
|
+
component: SectionTitle,
|
|
9
|
+
} as Meta<typeof SectionTitle>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof SectionTitle> = (args, { updateArgs }) => ({
|
|
12
|
+
components: { SectionTitle },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: `<section-title :size="size" :supporting-text="supportingText" :title-text="titleText" />`,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const Interactive = StoryTemplate.bind({});
|
|
20
|
+
|
|
21
|
+
const args = {
|
|
22
|
+
supportingText: '',
|
|
23
|
+
titleText: 'Title',
|
|
24
|
+
} as Args;
|
|
25
|
+
|
|
26
|
+
const argTypes = {
|
|
27
|
+
size: {
|
|
28
|
+
control: { type: 'select', options: Object.values(SECTION_TITLE_SIZES) },
|
|
29
|
+
defaultValue: SECTION_TITLE_SIZES.XS,
|
|
30
|
+
},
|
|
31
|
+
} as ArgTypes;
|
|
32
|
+
|
|
33
|
+
Interactive.argTypes = argTypes;
|
|
34
|
+
Interactive.args = args;
|
|
35
|
+
|
|
36
|
+
Interactive.parameters = {
|
|
37
|
+
design: {
|
|
38
|
+
type: 'figma',
|
|
39
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111037&t=2Z2n2tIHRHEsWjoW-4',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sectionTitle">
|
|
3
|
+
<div class="sectionTitle__title">{{ titleText }}</div>
|
|
4
|
+
<div class="sectionTitle__supportingText">{{ supportingText }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<style scoped lang="scss">
|
|
9
|
+
@import '../../../styles/settings/colors/tokens';
|
|
10
|
+
@import '../../../styles/settings/typography/tokens';
|
|
11
|
+
@import '../../../styles/settings/spacings';
|
|
12
|
+
|
|
13
|
+
.sectionTitle {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: $space-xxxxs;
|
|
17
|
+
overflow-wrap: break-word;
|
|
18
|
+
padding: $space-xxs 0;
|
|
19
|
+
|
|
20
|
+
&__title {
|
|
21
|
+
@include heading-xs-default-bold;
|
|
22
|
+
|
|
23
|
+
color: $color-neutral-text-heavy;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__supportingText {
|
|
27
|
+
@include info-s-default-regular;
|
|
28
|
+
|
|
29
|
+
color: $color-neutral-text-weak;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
33
|
+
|
|
34
|
+
<script lang="ts">
|
|
35
|
+
import { SECTION_TITLE_SIZES } from './SectionTitle.consts';
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: 'SectionTitle',
|
|
39
|
+
props: {
|
|
40
|
+
// It's unused for now but we want to have the prop already
|
|
41
|
+
size: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: SECTION_TITLE_SIZES.XS,
|
|
44
|
+
validator(size) {
|
|
45
|
+
return Object.values(SECTION_TITLE_SIZES).includes(size);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
supportingText: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: null,
|
|
51
|
+
},
|
|
52
|
+
titleText: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ICONS } from '../Icons/Icon';
|
|
2
|
+
import { TILE_COLORS, TILE_STATES } from './Tile.consts';
|
|
3
|
+
import { Args, ArgTypes } from '@storybook/vue3';
|
|
4
|
+
|
|
5
|
+
export const template = (componentTag: string) => `
|
|
6
|
+
<${componentTag}
|
|
7
|
+
:additional-text="additionalText"
|
|
8
|
+
:color="color"
|
|
9
|
+
:eyebrow-ellipsis="eyebrowEllipsis"
|
|
10
|
+
:eyebrow-text="eyebrowText"
|
|
11
|
+
:icon-left="ICONS[iconLeft]"
|
|
12
|
+
:icon-right="ICONS[iconRight]"
|
|
13
|
+
:interactive="interactive"
|
|
14
|
+
:is-eyebrow-text-uppercase="isEyebrowTextUppercase"
|
|
15
|
+
:state="state"
|
|
16
|
+
:text-ellipsis="textEllipsis"
|
|
17
|
+
:text="text"
|
|
18
|
+
/>`;
|
|
19
|
+
|
|
20
|
+
export const data = () => ({
|
|
21
|
+
ICONS: Object.freeze(ICONS),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const args = {
|
|
25
|
+
interactive: true,
|
|
26
|
+
iconLeft: null,
|
|
27
|
+
iconRight: null,
|
|
28
|
+
text: 'this is a text text',
|
|
29
|
+
eyebrowText: 'this is an eyebrowText text',
|
|
30
|
+
additionalText: '',
|
|
31
|
+
isEyebrowTextUppercase: false,
|
|
32
|
+
state: TILE_STATES.DEFAULT,
|
|
33
|
+
eyebrowEllipsis: true,
|
|
34
|
+
textEllipsis: true,
|
|
35
|
+
} as Args;
|
|
36
|
+
|
|
37
|
+
export const argTypes = {
|
|
38
|
+
iconLeft: {
|
|
39
|
+
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
40
|
+
defaultValue: null,
|
|
41
|
+
},
|
|
42
|
+
iconRight: {
|
|
43
|
+
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
44
|
+
defaultValue: null,
|
|
45
|
+
},
|
|
46
|
+
color: {
|
|
47
|
+
control: { type: 'select', options: [...Object.values(TILE_COLORS)] },
|
|
48
|
+
defaultValue: TILE_COLORS.NEUTRAL,
|
|
49
|
+
},
|
|
50
|
+
state: {
|
|
51
|
+
control: { type: 'select', options: [...Object.values(TILE_STATES)] },
|
|
52
|
+
defaultValue: TILE_STATES.DEFAULT,
|
|
53
|
+
},
|
|
54
|
+
} as ArgTypes;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Tile from './Tile.vue';
|
|
2
|
-
import {
|
|
3
|
-
import { ICONS } from '../Icons/Icon';
|
|
2
|
+
import { TILE_STATES } from './Tile.consts';
|
|
4
3
|
|
|
5
|
-
import { Args,
|
|
4
|
+
import { Args, Meta, StoryFn } from '@storybook/vue3';
|
|
5
|
+
import { args, argTypes, data, template } from './Tile.sb.shared';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/Tile',
|
|
@@ -14,49 +14,12 @@ const StoryTemplate: StoryFn<typeof Tile> = (args) => ({
|
|
|
14
14
|
setup() {
|
|
15
15
|
return { ...args };
|
|
16
16
|
},
|
|
17
|
-
template:
|
|
18
|
-
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
ICONS: Object.freeze(ICONS),
|
|
22
|
-
};
|
|
23
|
-
},
|
|
17
|
+
template: template('tile'),
|
|
18
|
+
data,
|
|
24
19
|
});
|
|
25
20
|
|
|
26
21
|
export const Interactive = StoryTemplate.bind({});
|
|
27
22
|
|
|
28
|
-
const args = {
|
|
29
|
-
interactive: true,
|
|
30
|
-
iconLeft: null,
|
|
31
|
-
iconRight: null,
|
|
32
|
-
text: 'this is a text text',
|
|
33
|
-
eyebrowText: 'this is an eyebrowText text',
|
|
34
|
-
additionalText: '',
|
|
35
|
-
isEyebrowTextUppercase: false,
|
|
36
|
-
state: TILE_STATES.DEFAULT,
|
|
37
|
-
eyebrowEllipsis: true,
|
|
38
|
-
textEllipsis: true,
|
|
39
|
-
} as Args;
|
|
40
|
-
|
|
41
|
-
const argTypes = {
|
|
42
|
-
iconLeft: {
|
|
43
|
-
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
44
|
-
defaultValue: null,
|
|
45
|
-
},
|
|
46
|
-
iconRight: {
|
|
47
|
-
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
48
|
-
defaultValue: null,
|
|
49
|
-
},
|
|
50
|
-
color: {
|
|
51
|
-
control: { type: 'select', options: [...Object.values(TILE_COLORS)] },
|
|
52
|
-
defaultValue: TILE_COLORS.NEUTRAL,
|
|
53
|
-
},
|
|
54
|
-
state: {
|
|
55
|
-
control: { type: 'select', options: [...Object.values(TILE_STATES)] },
|
|
56
|
-
defaultValue: TILE_STATES.DEFAULT,
|
|
57
|
-
},
|
|
58
|
-
} as ArgTypes;
|
|
59
|
-
|
|
60
23
|
Interactive.argTypes = argTypes;
|
|
61
24
|
Interactive.args = args;
|
|
62
25
|
|
|
@@ -75,35 +38,13 @@ const StoryStaticTemplate: StoryFn<typeof Tile> = (args) => ({
|
|
|
75
38
|
setup() {
|
|
76
39
|
return { ...args };
|
|
77
40
|
},
|
|
78
|
-
template:
|
|
79
|
-
|
|
80
|
-
data() {
|
|
81
|
-
return {
|
|
82
|
-
ICONS: Object.freeze(ICONS),
|
|
83
|
-
};
|
|
84
|
-
},
|
|
41
|
+
template: template('tile'),
|
|
42
|
+
data,
|
|
85
43
|
});
|
|
86
44
|
|
|
87
45
|
export const Static = StoryStaticTemplate.bind({});
|
|
88
46
|
|
|
89
|
-
Static.argTypes =
|
|
90
|
-
iconLeft: {
|
|
91
|
-
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
92
|
-
defaultValue: null,
|
|
93
|
-
},
|
|
94
|
-
iconRight: {
|
|
95
|
-
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
96
|
-
defaultValue: null,
|
|
97
|
-
},
|
|
98
|
-
color: {
|
|
99
|
-
control: { type: 'select', options: [null, ...Object.values(TILE_COLORS)] },
|
|
100
|
-
defaultValue: TILE_COLORS.NEUTRAL,
|
|
101
|
-
},
|
|
102
|
-
state: {
|
|
103
|
-
control: { type: 'select', options: [...Object.values(TILE_STATES)] },
|
|
104
|
-
defaultValue: TILE_STATES.DEFAULT,
|
|
105
|
-
},
|
|
106
|
-
} as ArgTypes;
|
|
47
|
+
Static.argTypes = argTypes;
|
|
107
48
|
|
|
108
49
|
Static.args = {
|
|
109
50
|
interactive: false,
|
package/lib/js/index.ts
CHANGED
|
@@ -40,10 +40,20 @@ export * from './components/SurveyQuestions/SurveyQuestion.consts';
|
|
|
40
40
|
export * from './components/SurveyQuestions/SurveyQuestion.domain';
|
|
41
41
|
export { default as Ripple } from './components/Ripple';
|
|
42
42
|
export * from './components/Ripple/Ripple.consts';
|
|
43
|
-
export { default as SectionHeader } from './components/SectionHeader';
|
|
44
|
-
export * from './components/SectionHeader/SectionHeader.consts';
|
|
43
|
+
export { default as SectionHeader } from './components/Headers/SectionHeader';
|
|
44
|
+
export * from './components/Headers/SectionHeader/SectionHeader.consts';
|
|
45
|
+
export { default as SectionTitle } from './components/SectionTitle/SectionTitle.vue';
|
|
46
|
+
export * from './components/SectionTitle/SectionTitle.consts';
|
|
45
47
|
export { default as Drawer } from './components/Drawer';
|
|
48
|
+
export { default as DrawerHeader } from './components/Drawer/DrawerHeader';
|
|
46
49
|
export * from './components/Drawer/Drawer.consts';
|
|
50
|
+
export { default as DrawerContent } from './components/Drawer/DrawerContent/DrawerContent.vue';
|
|
51
|
+
export { default as DrawerDivider } from './components/Drawer/DrawerDivider/DrawerDivider.vue';
|
|
52
|
+
export { default as DrawerListItem } from './components/Drawer/DrawerListItem/DrawerListItem.vue';
|
|
53
|
+
export { default as DrawerListItemGroup } from './components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue';
|
|
54
|
+
export * from './components/Drawer/DrawerListItem/DrawerListItem.consts';
|
|
55
|
+
export { default as DrawerTile } from './components/Drawer/DrawerTile/DrawerTile.vue';
|
|
56
|
+
export { default as DrawerSection } from './components/Drawer/DrawerSection/DrawerSection.vue';
|
|
47
57
|
export { default as Pill } from './components/Pill';
|
|
48
58
|
export * from './components/Pill/Pill.consts';
|
|
49
59
|
export { default as CounterToggle } from './components/Toggles/CounterToggle';
|
|
@@ -65,8 +75,8 @@ export { default as IconText } from './components/IconText';
|
|
|
65
75
|
export * from './components/IconText/IconText.consts';
|
|
66
76
|
export { default as Pagination } from './components/Pagination';
|
|
67
77
|
export * from './components/Pagination/Pagination.consts';
|
|
68
|
-
export { default as OverlayHeader } from './components/OverlayHeader';
|
|
69
|
-
export * from './components/OverlayHeader/OverlayHeader.consts';
|
|
78
|
+
export { default as OverlayHeader } from './components/Headers/OverlayHeader';
|
|
79
|
+
export * from './components/Headers/OverlayHeader/OverlayHeader.consts';
|
|
70
80
|
export { default as Well } from './components/Well';
|
|
71
81
|
export * from './components/Well/Well.consts';
|
|
72
82
|
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
--color-neutral-text-heavy: var(--raw-gray-900);
|
|
79
79
|
--color-neutral-text-heavy-disabled: var(--raw-gray-400);
|
|
80
80
|
--color-neutral-text-strong: var(--raw-gray-800);
|
|
81
|
+
--color-neutral-text-strong-hovered: var(--raw-gray-900);
|
|
82
|
+
--color-neutral-text-strong-focused: var(--raw-gray-900);
|
|
81
83
|
--color-neutral-text-strong-disabled: var(--raw-gray-400);
|
|
82
84
|
--color-neutral-text: var(--raw-gray-700);
|
|
83
85
|
--color-neutral-text-hovered: var(--raw-gray-900);
|
|
@@ -88,6 +90,8 @@
|
|
|
88
90
|
--color-neutral-text-weak-focused: var(--raw-gray-700);
|
|
89
91
|
--color-neutral-text-weak-disabled: var(--raw-gray-400);
|
|
90
92
|
--color-neutral-icon-strong: var(--raw-gray-800);
|
|
93
|
+
--color-neutral-icon-strong-hovered: var(--raw-gray-900);
|
|
94
|
+
--color-neutral-icon-strong-focused: var(--raw-gray-900);
|
|
91
95
|
--color-neutral-icon-strong-disabled: var(--raw-gray-300);
|
|
92
96
|
--color-neutral-icon: var(--raw-gray-600);
|
|
93
97
|
--color-neutral-icon-hovered: var(--raw-gray-800);
|