@bethinkpl/design-system 20.0.1 → 20.1.1
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/.github/workflows/build-to-review-on-trigger.yml +68 -0
- package/.yarnrc.yml +1 -0
- package/dist/design-system.umd.js +470 -328
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +3 -282
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +3 -228
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.stories.d.ts +5 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +107 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/index.d.ts +2 -0
- package/dist/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.consts.d.ts +29 -0
- package/dist/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.stories.d.ts +6 -0
- package/dist/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.vue.d.ts +32 -0
- package/dist/lib/js/components/RichList/GroupRichListItem/index.d.ts +3 -0
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.consts.d.ts +9 -15
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +38 -5
- package/dist/lib/js/components/SelectList/SelectList.vue.d.ts +3 -4
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +3 -258
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.vue.d.ts +3 -8
- package/dist/lib/js/index.d.ts +2 -2
- package/docs/iframe.html +1 -1
- package/docs/main.bd6db24d.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/lib/js/components/RichList/{RichListItemBasic/RichListItemBasic.stories.ts → BasicRichListItem/BasicRichListItem.stories.ts} +51 -17
- package/lib/js/components/RichList/{RichListItemBasic/RichListItemBasic.vue → BasicRichListItem/BasicRichListItem.vue} +90 -16
- package/lib/js/components/RichList/BasicRichListItem/index.ts +3 -0
- package/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.consts.ts +18 -0
- package/lib/js/components/RichList/GroupRichListItem/GroupRichListItem.stories.ts +337 -0
- package/lib/js/components/RichList/{RichListGroupItem/RichListGroupItem.vue → GroupRichListItem/GroupRichListItem.vue} +63 -16
- package/lib/js/components/RichList/GroupRichListItem/index.ts +4 -0
- package/lib/js/components/RichList/RichListItem/RichListItem.consts.ts +15 -18
- package/lib/js/components/RichList/RichListItem/RichListItem.stories.ts +42 -12
- package/lib/js/components/RichList/RichListItem/RichListItem.vue +242 -84
- package/lib/js/index.ts +2 -2
- package/lib/styles/mixins/_scrollbars.scss +9 -0
- package/package.json +1 -1
- package/docs/main.d1b90503.iframe.bundle.js +0 -1
- package/lib/js/components/RichList/RichListGroupItem/RichListGroupItem.consts.ts +0 -7
- package/lib/js/components/RichList/RichListGroupItem/RichListGroupItem.stories.ts +0 -327
- package/lib/js/components/RichList/RichListGroupItem/index.ts +0 -4
- package/lib/js/components/RichList/RichListItemBasic/index.ts +0 -3
package/docs/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1712303659633,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"metaFramework":{"name":"vue-cli","packageName":"@vue/cli-service","version":"5.0.8"},"packageManager":{"type":"yarn","version":"1.22.22"},"storybookVersion":"6.5.13","language":"typescript","storybookPackages":{"@storybook/builder-webpack5":{"version":"6.5.13"},"@storybook/manager-webpack5":{"version":"6.5.13"},"@storybook/vue3":{"version":"6.5.13"},"eslint-plugin-storybook":{"version":"0.6.6"}},"framework":{"name":"vue3"},"addons":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-controls":{"version":"6.5.15"},"@storybook/addon-storysource":{"version":"6.5.15"},"@storybook/addon-viewport":{"version":"6.5.15"},"storybook-addon-designs":{"version":"6.3.1"}}}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BasicRichListItem from './BasicRichListItem.vue';
|
|
2
2
|
|
|
3
3
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
4
|
import {
|
|
5
|
+
RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
5
6
|
RICH_LIST_ITEM_BORDER_COLOR,
|
|
6
|
-
|
|
7
|
+
RICH_LIST_ITEM_ELEVATION,
|
|
7
8
|
RICH_LIST_ITEM_SIZE,
|
|
8
9
|
RICH_LIST_ITEM_STATE,
|
|
9
10
|
RICH_LIST_ITEM_TYPE,
|
|
10
11
|
} from '../RichListItem';
|
|
11
|
-
import { ICONS } from '../../Icons/Icon';
|
|
12
|
+
import { ICON_COLORS, ICONS } from '../../Icons/Icon';
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
|
-
title: 'Components/RichList/
|
|
15
|
-
component:
|
|
15
|
+
title: 'Components/RichList/BasicRichListItem',
|
|
16
|
+
component: BasicRichListItem,
|
|
16
17
|
decorators: [
|
|
17
18
|
(story) => ({
|
|
18
19
|
components: { story },
|
|
19
20
|
template: "<div style='display: flex;padding: 16px;'><story /></div>",
|
|
20
21
|
}),
|
|
21
22
|
],
|
|
22
|
-
} as Meta<typeof
|
|
23
|
+
} as Meta<typeof BasicRichListItem>;
|
|
23
24
|
|
|
24
|
-
const StoryTemplate: StoryFn<typeof
|
|
25
|
-
components: {
|
|
25
|
+
const StoryTemplate: StoryFn<typeof BasicRichListItem> = (args, { updateArgs }) => ({
|
|
26
|
+
components: { BasicRichListItem },
|
|
26
27
|
setup() {
|
|
27
28
|
return { ...args };
|
|
28
29
|
},
|
|
@@ -31,8 +32,13 @@ const StoryTemplate: StoryFn<typeof RichListItemBasic> = (args) => ({
|
|
|
31
32
|
ICONS: Object.freeze(ICONS),
|
|
32
33
|
};
|
|
33
34
|
},
|
|
35
|
+
methods: {
|
|
36
|
+
updateIsSelected(isSelected) {
|
|
37
|
+
updateArgs({ isSelected });
|
|
38
|
+
},
|
|
39
|
+
},
|
|
34
40
|
template: `
|
|
35
|
-
<rich-list-item
|
|
41
|
+
<basic-rich-list-item
|
|
36
42
|
:size="size"
|
|
37
43
|
:type="type"
|
|
38
44
|
:is-interactive="isInteractive"
|
|
@@ -47,14 +53,21 @@ const StoryTemplate: StoryFn<typeof RichListItemBasic> = (args) => ({
|
|
|
47
53
|
:text="text"
|
|
48
54
|
:eyebrow="eyebrow"
|
|
49
55
|
:is-eyebrow-uppercase="isEyebrowUppercase"
|
|
56
|
+
:background-color="backgroundColor"
|
|
57
|
+
:elevation="elevation"
|
|
58
|
+
:has-draggable-handler="hasDraggableHandler"
|
|
59
|
+
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
60
|
+
:is-selectable="isSelectable"
|
|
61
|
+
:is-selected="isSelected"
|
|
62
|
+
@update:isSelected="updateIsSelected"
|
|
50
63
|
>
|
|
51
64
|
<template v-if="meta" #meta>
|
|
52
65
|
<div v-html="meta" />
|
|
53
66
|
</template>
|
|
54
|
-
<template v-if="
|
|
55
|
-
<div v-html="
|
|
67
|
+
<template v-if="actions" #actions>
|
|
68
|
+
<div v-html="actions" />
|
|
56
69
|
</template>
|
|
57
|
-
</rich-list-item
|
|
70
|
+
</basic-rich-list-item>`,
|
|
58
71
|
});
|
|
59
72
|
|
|
60
73
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -62,22 +75,29 @@ export const Interactive = StoryTemplate.bind({});
|
|
|
62
75
|
const args = {
|
|
63
76
|
size: RICH_LIST_ITEM_SIZE.MEDIUM,
|
|
64
77
|
type: RICH_LIST_ITEM_TYPE.DEFAULT,
|
|
65
|
-
|
|
78
|
+
backgroundColor: RICH_LIST_ITEM_BACKGROUND_COLOR.NEUTRAL,
|
|
79
|
+
elevation: null,
|
|
80
|
+
isDimmed: false,
|
|
66
81
|
isDraggable: true,
|
|
82
|
+
hasDraggableHandler: true,
|
|
67
83
|
icon: null,
|
|
68
84
|
iconColor: null,
|
|
69
85
|
iconColorHex: '',
|
|
70
|
-
|
|
86
|
+
hasActionsSlotDivider: true,
|
|
87
|
+
isSelectable: true,
|
|
88
|
+
isSelected: true,
|
|
71
89
|
borderColor: null,
|
|
72
90
|
borderColorHex: '',
|
|
73
91
|
state: RICH_LIST_ITEM_STATE.DEFAULT,
|
|
92
|
+
isInteractive: true,
|
|
93
|
+
draggableIconClassName: 'draggableIconClassName-1',
|
|
74
94
|
|
|
75
95
|
eyebrow: 'Eyebrow Uppercase',
|
|
76
96
|
text: 'Długa nazwa gdy się nie mieści Praesentium dicta sit. Molestiae unde voluptatem eaque labore.',
|
|
77
97
|
isEyebrowUppercase: false,
|
|
78
98
|
|
|
79
99
|
meta: 'Meta Slot',
|
|
80
|
-
|
|
100
|
+
actions: 'ACS',
|
|
81
101
|
} as Args;
|
|
82
102
|
|
|
83
103
|
const argTypes = {
|
|
@@ -94,7 +114,7 @@ const argTypes = {
|
|
|
94
114
|
control: { type: 'select' },
|
|
95
115
|
},
|
|
96
116
|
iconColor: {
|
|
97
|
-
options: [null, ...Object.values(
|
|
117
|
+
options: [null, ...Object.values(ICON_COLORS)],
|
|
98
118
|
control: { type: 'select' },
|
|
99
119
|
},
|
|
100
120
|
borderColor: {
|
|
@@ -120,15 +140,29 @@ const argTypes = {
|
|
|
120
140
|
meta: {
|
|
121
141
|
control: { type: 'text' },
|
|
122
142
|
},
|
|
123
|
-
|
|
143
|
+
actions: {
|
|
144
|
+
control: { type: 'text' },
|
|
145
|
+
},
|
|
146
|
+
draggableIconClassName: {
|
|
124
147
|
control: { type: 'text' },
|
|
125
148
|
},
|
|
149
|
+
backgroundColor: {
|
|
150
|
+
options: [null, ...Object.values(RICH_LIST_ITEM_BACKGROUND_COLOR)],
|
|
151
|
+
control: { type: 'select' },
|
|
152
|
+
},
|
|
153
|
+
elevation: {
|
|
154
|
+
options: [null, ...Object.values(RICH_LIST_ITEM_ELEVATION)],
|
|
155
|
+
control: { type: 'select' },
|
|
156
|
+
},
|
|
126
157
|
} as ArgTypes;
|
|
127
158
|
|
|
128
159
|
Interactive.argTypes = argTypes;
|
|
129
160
|
Interactive.args = args;
|
|
130
161
|
|
|
131
162
|
Interactive.parameters = {
|
|
163
|
+
actions: {
|
|
164
|
+
handles: ['icon-click', 'click', 'update:isSelected'],
|
|
165
|
+
},
|
|
132
166
|
layout: 'fullscreen',
|
|
133
167
|
design: {
|
|
134
168
|
type: 'figma',
|
|
@@ -11,18 +11,28 @@
|
|
|
11
11
|
:border-color="borderColor"
|
|
12
12
|
:border-color-hex="borderColorHex"
|
|
13
13
|
:state="state"
|
|
14
|
-
|
|
14
|
+
:background-color="backgroundColor"
|
|
15
|
+
:elevation="elevation"
|
|
16
|
+
:has-draggable-handler="hasDraggableHandler"
|
|
17
|
+
:has-actions-slot-divider="hasActionsSlotDivider"
|
|
18
|
+
:is-selectable="isSelectable"
|
|
19
|
+
:is-selected="isSelected"
|
|
20
|
+
class="basicRichListItem"
|
|
21
|
+
:class="{
|
|
22
|
+
'-small': size === RICH_LIST_ITEM_SIZE.SMALL,
|
|
23
|
+
}"
|
|
24
|
+
@update:is-selected="$emit('update:isSelected', $event)"
|
|
15
25
|
>
|
|
16
26
|
<template #content>
|
|
17
|
-
<div class="
|
|
27
|
+
<div class="basicRichListItem__content">
|
|
18
28
|
<div
|
|
19
|
-
class="
|
|
29
|
+
class="basicRichListItem__eyebrow"
|
|
20
30
|
:class="{ '-uppercase': isEyebrowUppercase }"
|
|
21
31
|
>
|
|
22
32
|
{{ eyebrow }}
|
|
23
33
|
</div>
|
|
24
34
|
|
|
25
|
-
<div class="
|
|
35
|
+
<div class="basicRichListItem__text">
|
|
26
36
|
{{ text }}
|
|
27
37
|
</div>
|
|
28
38
|
</div>
|
|
@@ -30,8 +40,8 @@
|
|
|
30
40
|
<template v-if="$slots.meta" #meta>
|
|
31
41
|
<slot name="meta" />
|
|
32
42
|
</template>
|
|
33
|
-
<template v-if="$slots.
|
|
34
|
-
<slot name="
|
|
43
|
+
<template v-if="$slots.actions" #actions>
|
|
44
|
+
<slot name="actions" />
|
|
35
45
|
</template>
|
|
36
46
|
</rich-list-item>
|
|
37
47
|
</template>
|
|
@@ -40,8 +50,12 @@
|
|
|
40
50
|
@import '../../../../styles/settings/colors/tokens';
|
|
41
51
|
@import '../../../../styles/settings/typography/tokens';
|
|
42
52
|
@import '../../../../styles/settings/spacings';
|
|
53
|
+
@import '../../../../styles/settings/media-queries';
|
|
54
|
+
@import '../../../../styles/mixins/scrollbars';
|
|
55
|
+
|
|
56
|
+
.basicRichListItem {
|
|
57
|
+
$root: &;
|
|
43
58
|
|
|
44
|
-
.richListItemBasic {
|
|
45
59
|
max-width: 100%;
|
|
46
60
|
|
|
47
61
|
&__content {
|
|
@@ -50,11 +64,11 @@
|
|
|
50
64
|
gap: $space-xxxxs;
|
|
51
65
|
justify-content: center;
|
|
52
66
|
min-width: 0; // to prevent the component from being pushed by the ellipses
|
|
53
|
-
padding: $space-
|
|
67
|
+
padding: $space-xs 0;
|
|
54
68
|
}
|
|
55
69
|
|
|
56
70
|
&__eyebrow {
|
|
57
|
-
@include info-s-
|
|
71
|
+
@include info-s-default-bold;
|
|
58
72
|
|
|
59
73
|
color: $color-neutral-text-weak;
|
|
60
74
|
min-width: 0;
|
|
@@ -65,37 +79,59 @@
|
|
|
65
79
|
&.-uppercase {
|
|
66
80
|
@include info-s-extensive-bold-uppercase;
|
|
67
81
|
}
|
|
82
|
+
|
|
83
|
+
&:hover {
|
|
84
|
+
color: $color-neutral-text-weak-hovered;
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
&__text {
|
|
71
89
|
@include text-m-compact-bold;
|
|
90
|
+
@include invisible-scrollbar;
|
|
72
91
|
|
|
73
92
|
color: $color-neutral-text;
|
|
74
93
|
min-width: 0;
|
|
75
|
-
overflow:
|
|
76
|
-
text-overflow: ellipsis;
|
|
94
|
+
overflow-x: scroll;
|
|
77
95
|
white-space: nowrap;
|
|
96
|
+
|
|
97
|
+
@media #{breakpoint-s()} {
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
color: $color-neutral-text-hovered;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.-small {
|
|
108
|
+
#{$root}__content {
|
|
109
|
+
padding: $space-xxxs 0;
|
|
110
|
+
}
|
|
78
111
|
}
|
|
79
112
|
}
|
|
80
113
|
</style>
|
|
81
114
|
|
|
82
115
|
<script lang="ts">
|
|
83
116
|
import RichListItem, {
|
|
117
|
+
RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
84
118
|
RICH_LIST_ITEM_BORDER_COLOR,
|
|
85
|
-
|
|
119
|
+
RICH_LIST_ITEM_ELEVATION,
|
|
86
120
|
RICH_LIST_ITEM_SIZE,
|
|
87
121
|
RICH_LIST_ITEM_STATE,
|
|
88
122
|
RICH_LIST_ITEM_TYPE,
|
|
123
|
+
RichListItemBackgroundColor,
|
|
89
124
|
RichListItemBorderColor,
|
|
90
|
-
|
|
125
|
+
RichListItemElevation,
|
|
91
126
|
RichListItemSize,
|
|
92
127
|
RichListItemState,
|
|
93
128
|
RichListItemType,
|
|
94
129
|
} from '../RichListItem';
|
|
95
130
|
import { PropType } from 'vue';
|
|
131
|
+
import { ICON_COLORS, IconColor } from '../../Icons/Icon';
|
|
96
132
|
|
|
97
133
|
export default {
|
|
98
|
-
name: '
|
|
134
|
+
name: 'BasicRichListItem',
|
|
99
135
|
components: {
|
|
100
136
|
RichListItem,
|
|
101
137
|
},
|
|
@@ -138,10 +174,10 @@ export default {
|
|
|
138
174
|
default: null,
|
|
139
175
|
},
|
|
140
176
|
iconColor: {
|
|
141
|
-
type: String as PropType<
|
|
177
|
+
type: String as PropType<IconColor>,
|
|
142
178
|
default: null,
|
|
143
179
|
validator(iconColor) {
|
|
144
|
-
return Object.values(
|
|
180
|
+
return Object.values(ICON_COLORS).includes(iconColor);
|
|
145
181
|
},
|
|
146
182
|
},
|
|
147
183
|
iconColorHex: {
|
|
@@ -171,6 +207,44 @@ export default {
|
|
|
171
207
|
type: Boolean,
|
|
172
208
|
default: false,
|
|
173
209
|
},
|
|
210
|
+
backgroundColor: {
|
|
211
|
+
type: String as PropType<RichListItemBackgroundColor>,
|
|
212
|
+
default: RICH_LIST_ITEM_BACKGROUND_COLOR.NEUTRAL,
|
|
213
|
+
validator(backgroundColor) {
|
|
214
|
+
return Object.values(RICH_LIST_ITEM_BACKGROUND_COLOR).includes(backgroundColor);
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
elevation: {
|
|
218
|
+
type: String as PropType<RichListItemElevation>,
|
|
219
|
+
default: null,
|
|
220
|
+
validator(evolution) {
|
|
221
|
+
return Object.values(RICH_LIST_ITEM_ELEVATION).includes(evolution);
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
hasDraggableHandler: {
|
|
225
|
+
type: Boolean,
|
|
226
|
+
default: true,
|
|
227
|
+
},
|
|
228
|
+
hasActionsSlotDivider: {
|
|
229
|
+
type: Boolean,
|
|
230
|
+
default: true,
|
|
231
|
+
},
|
|
232
|
+
isSelectable: {
|
|
233
|
+
type: Boolean,
|
|
234
|
+
default: true,
|
|
235
|
+
},
|
|
236
|
+
isSelected: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
default: false,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
emits: {
|
|
242
|
+
'update:isSelected': (value: boolean) => true,
|
|
243
|
+
},
|
|
244
|
+
data() {
|
|
245
|
+
return {
|
|
246
|
+
RICH_LIST_ITEM_SIZE: Object.freeze(RICH_LIST_ITEM_SIZE),
|
|
247
|
+
};
|
|
174
248
|
},
|
|
175
249
|
};
|
|
176
250
|
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
3
|
+
RICH_LIST_ITEM_BORDER_COLOR,
|
|
4
|
+
RichListItemBackgroundColor,
|
|
5
|
+
RichListItemBorderColor,
|
|
6
|
+
} from '../RichListItem';
|
|
7
|
+
|
|
8
|
+
export const GROUP_RICH_LIST_ITEM_BORDER_COLOR = {
|
|
9
|
+
...RICH_LIST_ITEM_BORDER_COLOR,
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export type GroupRichListItemBorderColor = RichListItemBorderColor;
|
|
13
|
+
|
|
14
|
+
export const GROUP_RICH_LIST_ITEM_BACKGROUND_COLOR = {
|
|
15
|
+
...RICH_LIST_ITEM_BACKGROUND_COLOR,
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export type GroupRichListItemBackgroundColor = RichListItemBackgroundColor;
|