@bethinkpl/design-system 41.0.0 → 41.0.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/dist/design-system.css +1 -1
- package/dist/design-system.js +2121 -2115
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +2 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +2 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +2 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +2 -0
- package/dist/lib/js/components/Toast/Toast.vue.d.ts +2 -0
- package/lib/js/components/Cards/Card/Card.spec.ts +50 -0
- package/lib/js/components/Cards/Card/Card.stories.ts +5 -0
- package/lib/js/components/Cards/Card/Card.vue +14 -0
- package/package.json +1 -1
|
@@ -5,10 +5,12 @@ declare function __VLS_template(): Readonly<{
|
|
|
5
5
|
header?: () => any;
|
|
6
6
|
content?: () => any;
|
|
7
7
|
footer?: () => any;
|
|
8
|
+
experimentalContent?: () => any;
|
|
8
9
|
}> & {
|
|
9
10
|
header?: () => any;
|
|
10
11
|
content?: () => any;
|
|
11
12
|
footer?: () => any;
|
|
13
|
+
experimentalContent?: () => any;
|
|
12
14
|
};
|
|
13
15
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
14
16
|
contentHasPadding?: boolean;
|
|
@@ -533,10 +533,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
533
533
|
header?: () => any;
|
|
534
534
|
content?: () => any;
|
|
535
535
|
footer?: () => any;
|
|
536
|
+
experimentalContent?: () => any;
|
|
536
537
|
}> & {
|
|
537
538
|
header?: () => any;
|
|
538
539
|
content?: () => any;
|
|
539
540
|
footer?: () => any;
|
|
541
|
+
experimentalContent?: () => any;
|
|
540
542
|
};
|
|
541
543
|
});
|
|
542
544
|
DsIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -660,10 +660,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
660
660
|
header?: () => any;
|
|
661
661
|
content?: () => any;
|
|
662
662
|
footer?: () => any;
|
|
663
|
+
experimentalContent?: () => any;
|
|
663
664
|
}> & {
|
|
664
665
|
header?: () => any;
|
|
665
666
|
content?: () => any;
|
|
666
667
|
footer?: () => any;
|
|
668
|
+
experimentalContent?: () => any;
|
|
667
669
|
};
|
|
668
670
|
});
|
|
669
671
|
IconButton: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts
CHANGED
|
@@ -632,10 +632,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
632
632
|
header?: () => any;
|
|
633
633
|
content?: () => any;
|
|
634
634
|
footer?: () => any;
|
|
635
|
+
experimentalContent?: () => any;
|
|
635
636
|
}> & {
|
|
636
637
|
header?: () => any;
|
|
637
638
|
content?: () => any;
|
|
638
639
|
footer?: () => any;
|
|
640
|
+
experimentalContent?: () => any;
|
|
639
641
|
};
|
|
640
642
|
});
|
|
641
643
|
IconButton: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -409,10 +409,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
409
409
|
header?: () => any;
|
|
410
410
|
content?: () => any;
|
|
411
411
|
footer?: () => any;
|
|
412
|
+
experimentalContent?: () => any;
|
|
412
413
|
}> & {
|
|
413
414
|
header?: () => any;
|
|
414
415
|
content?: () => any;
|
|
415
416
|
footer?: () => any;
|
|
417
|
+
experimentalContent?: () => any;
|
|
416
418
|
};
|
|
417
419
|
});
|
|
418
420
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -55,6 +55,56 @@ describe('Card', () => {
|
|
|
55
55
|
expect(component.text()).toContain(footer);
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
it('should render experimentalContent slot', () => {
|
|
59
|
+
const experimentalContent = 'Wpłynąlem na suchego przestwór oceanu';
|
|
60
|
+
const component = createComponent({
|
|
61
|
+
slots: {
|
|
62
|
+
experimentalContent: () => [h('span', experimentalContent)],
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
expect(component.find('.ds-card__experimentalContent').exists()).toBe(true);
|
|
67
|
+
expect(component.find('.ds-card__experimentalContent').text()).toContain(
|
|
68
|
+
experimentalContent,
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('should skip standard slots when experimentalContent is used', () => {
|
|
73
|
+
const component = createComponent({
|
|
74
|
+
slots: {
|
|
75
|
+
header: () => [h('span', 'header')],
|
|
76
|
+
content: () => [h('span', 'content')],
|
|
77
|
+
footer: () => [h('span', 'footer')],
|
|
78
|
+
experimentalContent: () => [h('span', 'experimental')],
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
expect(component.find('.ds-card__header').exists()).toBe(false);
|
|
83
|
+
expect(component.find('.ds-card__content').exists()).toBe(false);
|
|
84
|
+
expect(component.find('.ds-card__footer').exists()).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should not render the slotsWrapper when experimentalContent is used', () => {
|
|
88
|
+
const component = createComponent({
|
|
89
|
+
slots: {
|
|
90
|
+
experimentalContent: () => [h('span', 'experimental')],
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(component.find('.ds-card__slotsWrapper').exists()).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('should still render the ribbon when experimentalContent is used', () => {
|
|
98
|
+
const component = createComponent({
|
|
99
|
+
props: { hasRibbon: true },
|
|
100
|
+
slots: {
|
|
101
|
+
experimentalContent: () => [h('span', 'experimental')],
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
expect(component.find('.ds-card__ribbon').exists()).toBe(true);
|
|
106
|
+
});
|
|
107
|
+
|
|
58
108
|
it('should render content slot with padding by default', () => {
|
|
59
109
|
const content = 'Wpłynąlem na suchego przestwór oceanu';
|
|
60
110
|
const component = createComponent({
|
|
@@ -31,6 +31,9 @@ const StoryTemplate: StoryFn<typeof Card> = (args) => ({
|
|
|
31
31
|
<template v-if="args.footer" #footer>
|
|
32
32
|
<div v-html="args.footer" />
|
|
33
33
|
</template>
|
|
34
|
+
<template v-if="args.experimentalContent" #experimentalContent>
|
|
35
|
+
<div v-html="args.experimentalContent" />
|
|
36
|
+
</template>
|
|
34
37
|
</card>`,
|
|
35
38
|
});
|
|
36
39
|
|
|
@@ -40,6 +43,7 @@ const args = {
|
|
|
40
43
|
header: 'header slot',
|
|
41
44
|
content: 'content slot that supports <b>HTML markup</b>',
|
|
42
45
|
footer: 'footer slot',
|
|
46
|
+
experimentalContent: '',
|
|
43
47
|
contentHasPadding: true,
|
|
44
48
|
headerHasPadding: false,
|
|
45
49
|
footerHasPadding: false,
|
|
@@ -65,6 +69,7 @@ const argTypes = {
|
|
|
65
69
|
control: 'text',
|
|
66
70
|
},
|
|
67
71
|
footer: { control: 'text' },
|
|
72
|
+
experimentalContent: { control: 'text' },
|
|
68
73
|
backgroundColor: {
|
|
69
74
|
control: 'select',
|
|
70
75
|
options: Object.values(CARD_BACKGROUND_COLORS),
|
|
@@ -28,7 +28,12 @@
|
|
|
28
28
|
/>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
+
<div v-if="$slots.experimentalContent" class="ds-card__experimentalContent">
|
|
32
|
+
<slot name="experimentalContent" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
31
35
|
<div
|
|
36
|
+
v-else
|
|
32
37
|
class="ds-card__slotsWrapper"
|
|
33
38
|
:class="{ '-ds-containerIsScrollable': isContentScrollable }"
|
|
34
39
|
>
|
|
@@ -110,6 +115,14 @@
|
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
117
|
|
|
118
|
+
&__experimentalContent {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex: 1;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
// prevents excessive width due to child elements
|
|
123
|
+
min-width: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
113
126
|
&__header {
|
|
114
127
|
&.-ds-withPadding {
|
|
115
128
|
padding: $space-8;
|
|
@@ -252,6 +265,7 @@ defineSlots<{
|
|
|
252
265
|
header?: () => any;
|
|
253
266
|
content?: () => any;
|
|
254
267
|
footer?: () => any;
|
|
268
|
+
experimentalContent?: () => any;
|
|
255
269
|
}>();
|
|
256
270
|
|
|
257
271
|
const ribbonLayout = computed(() => {
|