@bethinkpl/design-system 18.7.4 → 18.9.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 +299 -148
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Badges/Badge/Badge.consts.d.ts +1 -0
- package/dist/lib/js/components/Badges/Badge/Badge.vue.d.ts +21 -1
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +1 -0
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +2 -0
- 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/Drawer/DrawerContent/DrawerContent.vue.d.ts +4 -3
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue.d.ts +20 -3
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue.d.ts +4 -3
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +231 -3
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +63 -3
- package/dist/lib/js/components/Form/Checkbox/Checkbox.vue.d.ts +1 -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 +1 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +1 -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 +1 -0
- package/dist/lib/js/components/Outline/OutlineItem/OutlineItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +1 -0
- package/dist/lib/js/components/Pill/Pill.vue.d.ts +1 -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/RichListItem/RichListItem.consts.d.ts +53 -0
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.stories.d.ts +5 -0
- package/dist/lib/js/components/RichList/RichListItem/index.d.ts +3 -0
- package/dist/lib/js/components/RichList/RichListItemBasic/RichListItemBasic.stories.d.ts +5 -0
- package/dist/lib/js/components/RichList/RichListItemBasic/index.d.ts +2 -0
- package/dist/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue.d.ts +62 -3
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +58 -3
- package/dist/lib/js/components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue.d.ts +14 -3
- package/dist/lib/js/components/SelectionTile/SelectionTile.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/SurveyQuestion.consts.d.ts +4 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +13 -0
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +1 -0
- package/dist/lib/js/components/Tile/Tile.vue.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/docs/988.4ee26573.iframe.bundle.js +2 -0
- package/docs/iframe.html +1 -1
- package/docs/main.b20a2704.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/lib/js/components/Badges/Badge/Badge.consts.ts +1 -0
- package/lib/js/components/Badges/Badge/Badge.stories.ts +11 -2
- package/lib/js/components/Badges/Badge/Badge.vue +44 -4
- package/lib/js/components/Buttons/Button/Button.vue +9 -3
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue +1 -1
- package/lib/js/components/Outline/OutlineItem/OutlineItem.stories.ts +10 -8
- package/lib/js/components/Outline/OutlineItem/OutlineItem.vue +7 -3
- package/lib/js/components/RichList/RichListItem/RichListItem.consts.ts +64 -0
- package/lib/js/components/RichList/RichListItem/RichListItem.stories.ts +136 -0
- package/lib/js/components/RichList/RichListItem/RichListItem.vue +459 -0
- package/lib/js/components/RichList/RichListItem/index.ts +4 -0
- package/lib/js/components/RichList/RichListItemBasic/RichListItemBasic.stories.ts +137 -0
- package/lib/js/components/RichList/RichListItemBasic/RichListItemBasic.vue +176 -0
- package/lib/js/components/RichList/RichListItemBasic/index.ts +3 -0
- package/lib/js/components/SurveyQuestions/SurveyQuestion.consts.ts +5 -0
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.ts +72 -52
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +127 -42
- package/lib/js/icons/fontawesome.ts +2 -0
- package/package.json +2 -2
- package/docs/48.83e0f3f5.iframe.bundle.js +0 -2
- package/docs/main.a0cde6ec.iframe.bundle.js +0 -1
- /package/docs/{48.83e0f3f5.iframe.bundle.js.LICENSE.txt → 988.4ee26573.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="richListItem"
|
|
4
|
+
:class="{
|
|
5
|
+
'-default': type === RICH_LIST_ITEM_TYPE.DEFAULT,
|
|
6
|
+
'-flat': type === RICH_LIST_ITEM_TYPE.FLAT,
|
|
7
|
+
'-loading': state === RICH_LIST_ITEM_STATE.LOADING,
|
|
8
|
+
'-dimmed': isDimmed,
|
|
9
|
+
'-interactive': isInteractive,
|
|
10
|
+
'-small': size === RICH_LIST_ITEM_SIZE.SMALL,
|
|
11
|
+
}"
|
|
12
|
+
@click="$emit('click')"
|
|
13
|
+
>
|
|
14
|
+
<div class="richListItem__container -dimmable">
|
|
15
|
+
<div v-if="isDraggable" class="richListItem__dragAndDrop">
|
|
16
|
+
<ds-icon
|
|
17
|
+
:icon="ICONS.FA_BARS"
|
|
18
|
+
class="richListItem__dragAndDropIcon"
|
|
19
|
+
:class="{ [draggableIconClassName]: !!draggableIconClassName }"
|
|
20
|
+
:size="
|
|
21
|
+
size === RICH_LIST_ITEM_SIZE.SMALL
|
|
22
|
+
? ICON_SIZES.XX_SMALL
|
|
23
|
+
: ICON_SIZES.X_SMALL
|
|
24
|
+
"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<div v-if="icon" class="richListItem__iconWrapper">
|
|
28
|
+
<ds-icon
|
|
29
|
+
:icon="icon"
|
|
30
|
+
class="richListItem__icon"
|
|
31
|
+
:size="
|
|
32
|
+
size === RICH_LIST_ITEM_SIZE.SMALL
|
|
33
|
+
? ICON_SIZES.XX_SMALL
|
|
34
|
+
: ICON_SIZES.X_SMALL
|
|
35
|
+
"
|
|
36
|
+
:class="iconColorClass"
|
|
37
|
+
:style="iconColorStyle"
|
|
38
|
+
@click.prevent="$emit('icon-click')"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="richListItem__content">
|
|
42
|
+
<slot name="content" />
|
|
43
|
+
</div>
|
|
44
|
+
<div v-if="$slots.meta" class="richListItem__metaData -hideOnMobile">
|
|
45
|
+
<slot name="meta" />
|
|
46
|
+
</div>
|
|
47
|
+
<div v-if="$slots.trailing" class="richListItem__trailingSlot">
|
|
48
|
+
<slot name="trailing" />
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div v-if="$slots.meta" class="richListItem__metaData -dimmable -visibleOnMobile">
|
|
53
|
+
<slot name="meta" />
|
|
54
|
+
</div>
|
|
55
|
+
<div
|
|
56
|
+
v-if="borderColorClass || borderColorStyle"
|
|
57
|
+
class="richListItem__border"
|
|
58
|
+
:class="borderColorClass"
|
|
59
|
+
:style="borderColorStyle"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style scoped lang="scss">
|
|
65
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
66
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
67
|
+
@import '../../../../styles/settings/media-queries';
|
|
68
|
+
@import '../../../../styles/settings/radiuses';
|
|
69
|
+
@import '../../../../styles/settings/spacings';
|
|
70
|
+
|
|
71
|
+
$rich-list-item-border-colors: (
|
|
72
|
+
default: $color-default-border,
|
|
73
|
+
inverted: $color-inverted-border,
|
|
74
|
+
primary: $color-primary-border,
|
|
75
|
+
primary-weak: $color-primary-border-weak,
|
|
76
|
+
neutral-heavy: $color-neutral-border-heavy,
|
|
77
|
+
neutral-strong: $color-neutral-border-strong,
|
|
78
|
+
neutral: $color-neutral-border,
|
|
79
|
+
neutral-weak: $color-neutral-border-weak,
|
|
80
|
+
neutral-ghost: $color-neutral-border-ghost,
|
|
81
|
+
danger: $color-danger-border,
|
|
82
|
+
danger-weak: $color-danger-border-weak,
|
|
83
|
+
fail: $color-fail-border,
|
|
84
|
+
fail-weak: $color-fail-border-weak,
|
|
85
|
+
warning: $color-warning-border,
|
|
86
|
+
warning-weak: $color-warning-border-weak,
|
|
87
|
+
success: $color-success-border,
|
|
88
|
+
success-weak: $color-success-border-weak,
|
|
89
|
+
info: $color-info-border,
|
|
90
|
+
info-weak: $color-info-border-weak,
|
|
91
|
+
accent: $color-accent-border,
|
|
92
|
+
accent-weak: $color-accent-border-weak,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
$rich-list-item-icon-colors: (
|
|
96
|
+
default: $color-default-icon,
|
|
97
|
+
primary: $color-primary-icon,
|
|
98
|
+
primary-weak: $color-primary-icon-weak,
|
|
99
|
+
neutral: $color-neutral-icon,
|
|
100
|
+
neutral-weak: $color-neutral-icon-weak,
|
|
101
|
+
danger: $color-danger-icon,
|
|
102
|
+
fail: $color-fail-icon,
|
|
103
|
+
warning: $color-warning-icon,
|
|
104
|
+
success: $color-success-icon,
|
|
105
|
+
info: $color-info-icon,
|
|
106
|
+
accent: $color-accent-icon,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
.richListItem {
|
|
110
|
+
$root: &;
|
|
111
|
+
|
|
112
|
+
background: $color-neutral-background;
|
|
113
|
+
cursor: default;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex: 1;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
min-height: 62px;
|
|
119
|
+
padding: $space-xxxxs;
|
|
120
|
+
pointer-events: none;
|
|
121
|
+
position: relative;
|
|
122
|
+
|
|
123
|
+
@media #{breakpoint-s()} {
|
|
124
|
+
padding: 0 $space-xxxxs;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.-interactive {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
pointer-events: initial;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.-dimmed {
|
|
133
|
+
.-dimmable {
|
|
134
|
+
opacity: 0.65;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.-loading {
|
|
139
|
+
background-color: $color-neutral-background-hovered;
|
|
140
|
+
cursor: initial;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
|
|
143
|
+
.-dimmable {
|
|
144
|
+
opacity: 0.5;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.-flat {
|
|
149
|
+
background: $color-neutral-background-ghost;
|
|
150
|
+
|
|
151
|
+
&:hover {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
|
|
154
|
+
.-dimmable {
|
|
155
|
+
opacity: 1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:not(.-dimmed):hover {
|
|
160
|
+
background: $color-neutral-background-ghost-hovered;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#{$root}__wrapper {
|
|
164
|
+
border: none;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.-default {
|
|
169
|
+
border: 1px solid $color-neutral-border-weak;
|
|
170
|
+
border-radius: $radius-s;
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
.-dimmable {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:not(.-dimmed):hover {
|
|
179
|
+
background: $color-neutral-background-hovered;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
#{$root}__border {
|
|
183
|
+
@each $color, $value in $rich-list-item-border-colors {
|
|
184
|
+
&.-border-#{$color} {
|
|
185
|
+
background-color: $value;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
border-radius: $radius-s 0 0 $radius-s;
|
|
190
|
+
height: calc(100% + 2px);
|
|
191
|
+
left: -1px;
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: -1px;
|
|
194
|
+
width: $space-xxxxs;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&__container {
|
|
199
|
+
align-items: center;
|
|
200
|
+
align-self: stretch;
|
|
201
|
+
display: flex;
|
|
202
|
+
flex: 1;
|
|
203
|
+
width: 100%;
|
|
204
|
+
|
|
205
|
+
@media #{breakpoint-s()} {
|
|
206
|
+
align-self: initial;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&__dragAndDrop,
|
|
211
|
+
&__iconWrapper {
|
|
212
|
+
align-items: flex-start;
|
|
213
|
+
align-self: stretch;
|
|
214
|
+
display: flex;
|
|
215
|
+
padding: $space-xs $space-xxxs 0 $space-xs;
|
|
216
|
+
|
|
217
|
+
@media #{breakpoint-s()} {
|
|
218
|
+
align-items: center;
|
|
219
|
+
padding: $space-xxxs $space-xxxs $space-xxxs $space-s;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&__content {
|
|
224
|
+
align-items: center;
|
|
225
|
+
display: flex;
|
|
226
|
+
flex: 2 0 0;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
padding: 0 $space-xxs 0 $space-xxxs;
|
|
229
|
+
|
|
230
|
+
@media #{breakpoint-s()} {
|
|
231
|
+
padding: 0 $space-xxs;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&__metaData {
|
|
236
|
+
align-items: center;
|
|
237
|
+
padding-left: $space-xs;
|
|
238
|
+
|
|
239
|
+
@media #{breakpoint-s()} {
|
|
240
|
+
justify-content: flex-start;
|
|
241
|
+
padding: 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&.-hideOnMobile {
|
|
245
|
+
display: none;
|
|
246
|
+
|
|
247
|
+
@media #{breakpoint-s()} {
|
|
248
|
+
display: flex;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&.-visibleOnMobile {
|
|
253
|
+
display: flex;
|
|
254
|
+
|
|
255
|
+
@media #{breakpoint-s()} {
|
|
256
|
+
display: none;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&__trailingSlot {
|
|
262
|
+
align-items: center;
|
|
263
|
+
display: flex;
|
|
264
|
+
justify-content: flex-end;
|
|
265
|
+
padding: 0;
|
|
266
|
+
|
|
267
|
+
@media #{breakpoint-s()} {
|
|
268
|
+
padding-left: $space-xxs;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&__icon {
|
|
273
|
+
@each $color, $value in $rich-list-item-icon-colors {
|
|
274
|
+
&.-icon-color-#{$color} {
|
|
275
|
+
color: $value;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
color: $color-neutral-icon-weak;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&__dragAndDropIcon {
|
|
283
|
+
color: $color-neutral-icon-weak;
|
|
284
|
+
|
|
285
|
+
&:hover {
|
|
286
|
+
color: $color-neutral-icon-weak-hovered;
|
|
287
|
+
cursor: grab;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:active {
|
|
291
|
+
cursor: grabbing;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&.-small {
|
|
296
|
+
min-height: 44px;
|
|
297
|
+
padding: $space-xxxxs $space-xxxs $space-xxxxs $space-xxxxs;
|
|
298
|
+
|
|
299
|
+
@media #{breakpoint-s()} {
|
|
300
|
+
padding: 0 $space-xxxxs 0 0;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#{$root}__dragAndDrop,
|
|
304
|
+
#{$root}__iconWrapper {
|
|
305
|
+
padding: 0 0 0 $space-xs;
|
|
306
|
+
|
|
307
|
+
@media #{breakpoint-s()} {
|
|
308
|
+
padding: $space-xxxs 0 $space-xxxs $space-xs;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
#{$root}__content {
|
|
313
|
+
padding: 0 $space-xxxs 0 $space-xxs;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
#{$root}__metaData {
|
|
317
|
+
padding-left: $space-xs;
|
|
318
|
+
|
|
319
|
+
@media #{breakpoint-s()} {
|
|
320
|
+
padding-left: 0;
|
|
321
|
+
padding-right: $space-xxxs;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
#{$root}__trailingSlot {
|
|
326
|
+
padding: 0;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
</style>
|
|
331
|
+
|
|
332
|
+
<script lang="ts">
|
|
333
|
+
import DsIcon, { ICON_SIZES, ICONS } from '../../../components/Icons/Icon';
|
|
334
|
+
import { PropType } from 'vue';
|
|
335
|
+
import {
|
|
336
|
+
RICH_LIST_ITEM_BORDER_COLOR,
|
|
337
|
+
RICH_LIST_ITEM_ICON_COLOR,
|
|
338
|
+
RICH_LIST_ITEM_SIZE,
|
|
339
|
+
RICH_LIST_ITEM_STATE,
|
|
340
|
+
RICH_LIST_ITEM_TYPE,
|
|
341
|
+
RichListItemBorderColor,
|
|
342
|
+
RichListItemIconColor,
|
|
343
|
+
RichListItemSize,
|
|
344
|
+
RichListItemState,
|
|
345
|
+
RichListItemType,
|
|
346
|
+
} from './RichListItem.consts';
|
|
347
|
+
|
|
348
|
+
export default {
|
|
349
|
+
name: 'RichListItem',
|
|
350
|
+
components: {
|
|
351
|
+
DsIcon,
|
|
352
|
+
},
|
|
353
|
+
props: {
|
|
354
|
+
type: {
|
|
355
|
+
type: String as PropType<RichListItemType>,
|
|
356
|
+
default: RICH_LIST_ITEM_TYPE.DEFAULT,
|
|
357
|
+
validator(type) {
|
|
358
|
+
return Object.values(RICH_LIST_ITEM_TYPE).includes(type);
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
state: {
|
|
362
|
+
type: String as PropType<RichListItemState>,
|
|
363
|
+
default: RICH_LIST_ITEM_STATE.DEFAULT,
|
|
364
|
+
validator(state) {
|
|
365
|
+
return Object.values(RICH_LIST_ITEM_STATE).includes(state);
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
size: {
|
|
369
|
+
type: String as PropType<RichListItemSize>,
|
|
370
|
+
default: RICH_LIST_ITEM_SIZE.MEDIUM,
|
|
371
|
+
validator(size) {
|
|
372
|
+
return Object.values(RICH_LIST_ITEM_SIZE).includes(size);
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
isInteractive: {
|
|
376
|
+
type: Boolean,
|
|
377
|
+
default: true,
|
|
378
|
+
},
|
|
379
|
+
isDimmed: {
|
|
380
|
+
type: Boolean,
|
|
381
|
+
default: false,
|
|
382
|
+
},
|
|
383
|
+
isDraggable: {
|
|
384
|
+
type: Boolean,
|
|
385
|
+
default: true,
|
|
386
|
+
},
|
|
387
|
+
icon: {
|
|
388
|
+
type: String,
|
|
389
|
+
default: null,
|
|
390
|
+
},
|
|
391
|
+
iconColor: {
|
|
392
|
+
type: String as PropType<RichListItemIconColor>,
|
|
393
|
+
default: null,
|
|
394
|
+
validator(iconColor) {
|
|
395
|
+
return Object.values(RICH_LIST_ITEM_ICON_COLOR).includes(iconColor);
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
iconColorHex: {
|
|
399
|
+
type: String,
|
|
400
|
+
default: null,
|
|
401
|
+
},
|
|
402
|
+
borderColor: {
|
|
403
|
+
type: String as PropType<RichListItemBorderColor>,
|
|
404
|
+
default: null,
|
|
405
|
+
validator(borderColor) {
|
|
406
|
+
return Object.values(RICH_LIST_ITEM_BORDER_COLOR).includes(borderColor);
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
borderColorHex: {
|
|
410
|
+
type: String,
|
|
411
|
+
default: null,
|
|
412
|
+
},
|
|
413
|
+
draggableIconClassName: {
|
|
414
|
+
type: String,
|
|
415
|
+
default: null,
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
emits: ['icon-click', 'click'],
|
|
419
|
+
data() {
|
|
420
|
+
return {
|
|
421
|
+
ICONS: Object.freeze(ICONS),
|
|
422
|
+
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
423
|
+
RICH_LIST_ITEM_TYPE: Object.freeze(RICH_LIST_ITEM_TYPE),
|
|
424
|
+
RICH_LIST_ITEM_STATE: Object.freeze(RICH_LIST_ITEM_STATE),
|
|
425
|
+
RICH_LIST_ITEM_SIZE: Object.freeze(RICH_LIST_ITEM_SIZE),
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
computed: {
|
|
429
|
+
iconColorClass() {
|
|
430
|
+
if (!this.iconColor || (this.iconColor && this.iconColorHex)) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
return `-icon-color-${this.iconColor}`;
|
|
434
|
+
},
|
|
435
|
+
iconColorStyle() {
|
|
436
|
+
if (!this.iconColor || !this.iconColorHex) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
return {
|
|
440
|
+
color: this.iconColorHex,
|
|
441
|
+
};
|
|
442
|
+
},
|
|
443
|
+
borderColorClass() {
|
|
444
|
+
if (!this.borderColor || (this.borderColor && this.borderColorHex)) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
return `-border-${this.borderColor}`;
|
|
448
|
+
},
|
|
449
|
+
borderColorStyle() {
|
|
450
|
+
if (!this.borderColor || !this.borderColorHex) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
backgroundColor: this.borderColorHex,
|
|
455
|
+
};
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
};
|
|
459
|
+
</script>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import RichListItemBasic from './RichListItemBasic.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import {
|
|
5
|
+
RICH_LIST_ITEM_BORDER_COLOR,
|
|
6
|
+
RICH_LIST_ITEM_ICON_COLOR,
|
|
7
|
+
RICH_LIST_ITEM_SIZE,
|
|
8
|
+
RICH_LIST_ITEM_STATE,
|
|
9
|
+
RICH_LIST_ITEM_TYPE,
|
|
10
|
+
} from '../RichListItem';
|
|
11
|
+
import { ICONS } from '../../Icons/Icon';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Components/RichList/RichListItemBasic',
|
|
15
|
+
component: RichListItemBasic,
|
|
16
|
+
decorators: [
|
|
17
|
+
(story) => ({
|
|
18
|
+
components: { story },
|
|
19
|
+
template: "<div style='display: flex;padding: 16px;'><story /></div>",
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
} as Meta<typeof RichListItemBasic>;
|
|
23
|
+
|
|
24
|
+
const StoryTemplate: StoryFn<typeof RichListItemBasic> = (args) => ({
|
|
25
|
+
components: { RichListItemBasic },
|
|
26
|
+
setup() {
|
|
27
|
+
return { ...args };
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
ICONS: Object.freeze(ICONS),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<rich-list-item-basic
|
|
36
|
+
:size="size"
|
|
37
|
+
:type="type"
|
|
38
|
+
:is-interactive="isInteractive"
|
|
39
|
+
:is-draggable="isDraggable"
|
|
40
|
+
:icon="ICONS[icon]"
|
|
41
|
+
:icon-color="iconColor"
|
|
42
|
+
:icon-color-hex="iconColorHex"
|
|
43
|
+
:is-dimmed="isDimmed"
|
|
44
|
+
:border-color="borderColor"
|
|
45
|
+
:border-color-hex="borderColorHex"
|
|
46
|
+
:state="state"
|
|
47
|
+
:text="text"
|
|
48
|
+
:eyebrow="eyebrow"
|
|
49
|
+
:is-eyebrow-uppercase="isEyebrowUppercase"
|
|
50
|
+
>
|
|
51
|
+
<template v-if="meta" #meta>
|
|
52
|
+
<div v-html="meta" />
|
|
53
|
+
</template>
|
|
54
|
+
<template v-if="trailing" #trailing>
|
|
55
|
+
<div v-html="trailing" />
|
|
56
|
+
</template>
|
|
57
|
+
</rich-list-item-basic>`,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const Interactive = StoryTemplate.bind({});
|
|
61
|
+
|
|
62
|
+
const args = {
|
|
63
|
+
size: RICH_LIST_ITEM_SIZE.MEDIUM,
|
|
64
|
+
type: RICH_LIST_ITEM_TYPE.DEFAULT,
|
|
65
|
+
isInteractive: true,
|
|
66
|
+
isDraggable: true,
|
|
67
|
+
icon: null,
|
|
68
|
+
iconColor: null,
|
|
69
|
+
iconColorHex: '',
|
|
70
|
+
isDimmed: false,
|
|
71
|
+
borderColor: null,
|
|
72
|
+
borderColorHex: '',
|
|
73
|
+
state: RICH_LIST_ITEM_STATE.DEFAULT,
|
|
74
|
+
|
|
75
|
+
eyebrow: 'Eyebrow Uppercase',
|
|
76
|
+
text: 'Długa nazwa gdy się nie mieści Praesentium dicta sit. Molestiae unde voluptatem eaque labore.',
|
|
77
|
+
isEyebrowUppercase: false,
|
|
78
|
+
|
|
79
|
+
meta: 'Meta Slot',
|
|
80
|
+
trailing: 'Tailing Slot',
|
|
81
|
+
} as Args;
|
|
82
|
+
|
|
83
|
+
const argTypes = {
|
|
84
|
+
type: {
|
|
85
|
+
options: Object.values(RICH_LIST_ITEM_TYPE),
|
|
86
|
+
control: { type: 'select' },
|
|
87
|
+
},
|
|
88
|
+
size: {
|
|
89
|
+
options: Object.values(RICH_LIST_ITEM_SIZE),
|
|
90
|
+
control: { type: 'select' },
|
|
91
|
+
},
|
|
92
|
+
state: {
|
|
93
|
+
options: Object.values(RICH_LIST_ITEM_STATE),
|
|
94
|
+
control: { type: 'select' },
|
|
95
|
+
},
|
|
96
|
+
iconColor: {
|
|
97
|
+
options: [null, ...Object.values(RICH_LIST_ITEM_ICON_COLOR)],
|
|
98
|
+
control: { type: 'select' },
|
|
99
|
+
},
|
|
100
|
+
borderColor: {
|
|
101
|
+
options: [null, ...Object.values(RICH_LIST_ITEM_BORDER_COLOR)],
|
|
102
|
+
control: { type: 'select' },
|
|
103
|
+
},
|
|
104
|
+
icon: {
|
|
105
|
+
options: [null, ...Object.keys(ICONS)],
|
|
106
|
+
control: { type: 'select' },
|
|
107
|
+
},
|
|
108
|
+
iconColorHex: {
|
|
109
|
+
control: { type: 'text' },
|
|
110
|
+
},
|
|
111
|
+
borderColorHex: {
|
|
112
|
+
control: { type: 'text' },
|
|
113
|
+
},
|
|
114
|
+
text: {
|
|
115
|
+
control: { type: 'text' },
|
|
116
|
+
},
|
|
117
|
+
eyebrow: {
|
|
118
|
+
control: { type: 'text' },
|
|
119
|
+
},
|
|
120
|
+
meta: {
|
|
121
|
+
control: { type: 'text' },
|
|
122
|
+
},
|
|
123
|
+
trailing: {
|
|
124
|
+
control: { type: 'text' },
|
|
125
|
+
},
|
|
126
|
+
} as ArgTypes;
|
|
127
|
+
|
|
128
|
+
Interactive.argTypes = argTypes;
|
|
129
|
+
Interactive.args = args;
|
|
130
|
+
|
|
131
|
+
Interactive.parameters = {
|
|
132
|
+
layout: 'fullscreen',
|
|
133
|
+
design: {
|
|
134
|
+
type: 'figma',
|
|
135
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=8673-2345&mode=design&t=QeEz8TmzxDbrGYK3-4',
|
|
136
|
+
},
|
|
137
|
+
};
|