@bethinkpl/design-system 41.1.5 → 42.0.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.css +1 -1
- package/dist/design-system.js +7051 -7104
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +2 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +2 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +6 -0
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +2 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +4 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +4 -0
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +2 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +4 -0
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +4 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +4 -0
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +2 -0
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +2 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +2 -0
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +2 -0
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +2 -0
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +2 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +976 -154
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +967 -145
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +2 -0
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +2 -0
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +2 -0
- package/dist/lib/js/icons/fontawesome.d.ts +2 -0
- package/dist/lib/js/index.d.ts +0 -1
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue +7 -12
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +7 -12
- package/lib/js/icons/fontawesome.ts +4 -0
- package/lib/js/index.ts +0 -1
- package/package.json +1 -1
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +0 -395
- package/dist/lib/js/components/Modal/index.d.ts +0 -3
- package/lib/js/components/Modal/Modal.spec.ts +0 -58
- package/lib/js/components/Modal/Modal.vue +0 -137
- package/lib/js/components/Modal/index.ts +0 -3
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { shallowMount } from '@vue/test-utils';
|
|
3
|
-
|
|
4
|
-
import Modal from './Modal.vue';
|
|
5
|
-
|
|
6
|
-
describe('Modal', () => {
|
|
7
|
-
const createComponent = ({ headerSlot = '', slot = '', showHeader = true } = {}) => {
|
|
8
|
-
return shallowMount(Modal, {
|
|
9
|
-
props: {
|
|
10
|
-
showHeader,
|
|
11
|
-
} as any,
|
|
12
|
-
slots: {
|
|
13
|
-
header: headerSlot,
|
|
14
|
-
slot,
|
|
15
|
-
},
|
|
16
|
-
global: {
|
|
17
|
-
stubs: {
|
|
18
|
-
teleport: true,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
it('should create', () => {
|
|
25
|
-
const component = createComponent();
|
|
26
|
-
|
|
27
|
-
expect(component.exists()).toBe(true);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should render header slot', () => {
|
|
31
|
-
const header = 'Wpłynąłem na suchego przestwór oceanu';
|
|
32
|
-
const component = createComponent({ headerSlot: header });
|
|
33
|
-
|
|
34
|
-
expect(component.find('.m-modal__header').text()).toContain(header);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should render main slot', () => {
|
|
38
|
-
const slot = 'Wpłynąłem na suchego przestwór oceanu';
|
|
39
|
-
const component = createComponent({ headerSlot: slot });
|
|
40
|
-
|
|
41
|
-
expect(component.find('.m-modal__header').text()).toContain(slot);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('click on on modal should emit "close-modal" event', async () => {
|
|
45
|
-
const component = createComponent();
|
|
46
|
-
await component.find('.m-modal').trigger('click');
|
|
47
|
-
|
|
48
|
-
expect(component.emitted()?.['close-modal']?.[0]).toBeDefined();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it.each([false, true])(
|
|
52
|
-
'component should render header base on showHeader prop',
|
|
53
|
-
(showHeader) => {
|
|
54
|
-
const component = createComponent({ showHeader });
|
|
55
|
-
expect(component.find('.m-modal__header').exists()).toBe(showHeader);
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
});
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<teleport to="body">
|
|
3
|
-
<div class="m-modal" v-bind="$attrs" @click.stop="$emit('close-modal')">
|
|
4
|
-
<div class="m-modal__contentWrapper" @click.stop>
|
|
5
|
-
<div v-if="showHeader" class="m-modal__header">
|
|
6
|
-
<slot name="header" />
|
|
7
|
-
<wnl-icon
|
|
8
|
-
touchable-deprecated
|
|
9
|
-
:icon="ICONS.FA_XMARK"
|
|
10
|
-
class="m-modal__header__close"
|
|
11
|
-
:size="ICON_SIZES.SMALL"
|
|
12
|
-
@click.stop="$emit('close-modal')"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
<div
|
|
16
|
-
class="m-modal__content"
|
|
17
|
-
:class="{ 'scrollable-main-container': animateScrollingContent }"
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
</div>
|
|
21
|
-
<div class="m-modal__content__shadow" />
|
|
22
|
-
<div v-if="$slots.footer" class="m-modal__footer">
|
|
23
|
-
<slot name="footer" />
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</teleport>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<style lang="scss" scoped>
|
|
31
|
-
@import '../../../styles/settings/media-queries';
|
|
32
|
-
@import '../../../styles/settings/spacings';
|
|
33
|
-
@import '../../../styles/settings/shadows';
|
|
34
|
-
@import '../../../styles/settings/z-indexes';
|
|
35
|
-
@import '../../../styles/settings/colors/tokens';
|
|
36
|
-
@import '../../../styles/settings/typography/tokens';
|
|
37
|
-
|
|
38
|
-
// Deprecated component, no need to prefix class names.
|
|
39
|
-
/* stylelint-disable-next-line selector-class-pattern */
|
|
40
|
-
.m-modal {
|
|
41
|
-
@include text-l-default-regular;
|
|
42
|
-
|
|
43
|
-
align-items: center;
|
|
44
|
-
background-color: rgba(10, 10, 10, 0.85);
|
|
45
|
-
bottom: 0;
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
left: 0;
|
|
49
|
-
position: fixed;
|
|
50
|
-
right: 0;
|
|
51
|
-
top: 0;
|
|
52
|
-
z-index: $z-index-modal;
|
|
53
|
-
|
|
54
|
-
&__contentWrapper {
|
|
55
|
-
background-color: $color-default-background;
|
|
56
|
-
box-shadow: $shadow-xl;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
margin: $space-20 $space-8 $space-16;
|
|
60
|
-
max-height: calc(100vh - #{$space-20 + $space-16});
|
|
61
|
-
overflow: hidden;
|
|
62
|
-
position: relative;
|
|
63
|
-
width: 100%;
|
|
64
|
-
|
|
65
|
-
@media #{breakpoint-m()} {
|
|
66
|
-
margin: $space-28 auto $space-20;
|
|
67
|
-
max-height: calc(100vh - #{$space-28 + $space-20});
|
|
68
|
-
width: 640px;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&__header {
|
|
73
|
-
align-items: center;
|
|
74
|
-
box-shadow: 0 $space-2 $space-2 var(--raw-white);
|
|
75
|
-
display: flex;
|
|
76
|
-
justify-content: space-between;
|
|
77
|
-
padding: $space-6 $space-6 $space-3;
|
|
78
|
-
z-index: 1;
|
|
79
|
-
|
|
80
|
-
&__close {
|
|
81
|
-
color: $color-neutral-icon-weak;
|
|
82
|
-
|
|
83
|
-
&:only-child {
|
|
84
|
-
margin-left: auto;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&__footer {
|
|
90
|
-
padding: $space-12 0;
|
|
91
|
-
text-align: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&__content {
|
|
95
|
-
overflow: auto;
|
|
96
|
-
padding: $space-8;
|
|
97
|
-
|
|
98
|
-
&__shadow {
|
|
99
|
-
box-shadow: 0 #{-$space-2} $space-2 var(--raw-white);
|
|
100
|
-
content: ' ';
|
|
101
|
-
height: $space-2;
|
|
102
|
-
z-index: 1;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</style>
|
|
107
|
-
|
|
108
|
-
<script lang="ts">
|
|
109
|
-
import WnlIcon, { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
110
|
-
|
|
111
|
-
import { defineComponent } from 'vue';
|
|
112
|
-
|
|
113
|
-
export default defineComponent({
|
|
114
|
-
name: 'Modal',
|
|
115
|
-
components: { WnlIcon },
|
|
116
|
-
inheritAttrs: false,
|
|
117
|
-
props: {
|
|
118
|
-
showHeader: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: true,
|
|
121
|
-
},
|
|
122
|
-
animateScrollingContent: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
// TODO fix me when touching this file
|
|
128
|
-
// eslint-disable-next-line vue/require-emit-validator
|
|
129
|
-
emits: ['close-modal'],
|
|
130
|
-
data() {
|
|
131
|
-
return {
|
|
132
|
-
ICONS: Object.freeze(ICONS),
|
|
133
|
-
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
134
|
-
};
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
</script>
|