sprintify-ui 0.8.3 → 0.8.5
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/sprintify-ui.es.js +2859 -2797
- package/dist/style.css +1 -1
- package/dist/types/components/BaseCollapse.vue.d.ts +86 -0
- package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +0 -8
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +0 -2
- package/dist/types/components/BaseLoadingCover.vue.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/types/index.d.ts +0 -2
- package/package.json +1 -1
- package/src/assets/flatpickr.css +15 -11
- package/src/components/BaseCollapse.stories.js +169 -0
- package/src/components/BaseCollapse.vue +98 -0
- package/src/components/index.ts +3 -1
- package/src/types/index.ts +0 -4
package/src/assets/flatpickr.css
CHANGED
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
|
|
21
21
|
.flatpickr-calendar {
|
|
22
22
|
border: inherit;
|
|
23
|
-
@apply bg-white
|
|
23
|
+
@apply bg-white rounded shadow-lg border border-slate-200 left-1/2;
|
|
24
24
|
padding: var(--calendarPadding);
|
|
25
|
-
width: calc(var(--daysWidth) + calc(var(--calendarPadding)*
|
|
25
|
+
width: calc(var(--daysWidth) + calc(var(--calendarPadding)*3));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.flatpickr-calendar.inline {
|
|
29
29
|
position: static;
|
|
30
30
|
width: 100%;
|
|
31
|
-
@apply bg-white pt-3 px-1
|
|
31
|
+
@apply bg-white pt-3 px-1 border-0 shadow-none;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@screen lg {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.flatpickr-day {
|
|
70
|
-
@apply
|
|
70
|
+
@apply text-sm font-medium text-slate-600;
|
|
71
71
|
max-width: var(--daySize);
|
|
72
72
|
height: var(--daySize);
|
|
73
73
|
line-height: var(--daySize);
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
.flatpickr-day.selected.startRange.endRange,
|
|
102
102
|
.flatpickr-day.startRange.startRange.endRange,
|
|
103
103
|
.flatpickr-day.endRange.startRange.endRange {
|
|
104
|
-
|
|
104
|
+
@apply rounded-none;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.flatpickr-day.flatpickr-disabled,
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
.flatpickr-day.notAllowed,
|
|
112
112
|
.flatpickr-day.notAllowed.prevMonthDay,
|
|
113
113
|
.flatpickr-day.notAllowed.nextMonthDay {
|
|
114
|
-
@apply text-slate-400
|
|
114
|
+
@apply text-slate-400;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.rangeMode .flatpickr-day {
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
.flatpickr-day.selected.nextMonthDay,
|
|
137
137
|
.flatpickr-day.startRange.nextMonthDay,
|
|
138
138
|
.flatpickr-day.endRange.nextMonthDay {
|
|
139
|
-
@apply bg-primary-
|
|
139
|
+
@apply bg-primary-600 text-primary-50;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.flatpickr-day.inRange,
|
|
@@ -153,7 +153,11 @@
|
|
|
153
153
|
.flatpickr-day.nextMonthDay:focus,
|
|
154
154
|
.flatpickr-day.today:hover,
|
|
155
155
|
.flatpickr-day.today:focus {
|
|
156
|
-
@apply bg-primary-
|
|
156
|
+
@apply bg-primary-500 text-primary-50;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.flatpickr-day.today {
|
|
160
|
+
@apply ring-1 ring-inset ring-primary-500;
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
.flatpickr-day.inRange,
|
|
@@ -173,7 +177,7 @@
|
|
|
173
177
|
.flatpickr-months .flatpickr-next-month {
|
|
174
178
|
position: static;
|
|
175
179
|
height: auto;
|
|
176
|
-
@apply text-slate-600 hover:text-slate-900
|
|
180
|
+
@apply text-slate-600 hover:text-slate-900;
|
|
177
181
|
}
|
|
178
182
|
|
|
179
183
|
.flatpickr-months .flatpickr-prev-month svg,
|
|
@@ -197,7 +201,7 @@
|
|
|
197
201
|
}
|
|
198
202
|
|
|
199
203
|
.flatpickr-months .flatpickr-month {
|
|
200
|
-
@apply text-slate-800
|
|
204
|
+
@apply text-slate-800;
|
|
201
205
|
height: auto;
|
|
202
206
|
line-height: inherit;
|
|
203
207
|
}
|
|
@@ -233,7 +237,7 @@
|
|
|
233
237
|
}
|
|
234
238
|
|
|
235
239
|
span.flatpickr-weekday {
|
|
236
|
-
@apply text-slate-400
|
|
240
|
+
@apply text-slate-400 font-medium text-xs;
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
.flatpickr-calendar.arrowTop::before,
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { method } from 'lodash';
|
|
2
|
+
import BaseCollapse from './BaseCollapse.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/BaseCollapse',
|
|
6
|
+
component: BaseCollapse,
|
|
7
|
+
args: {},
|
|
8
|
+
argTypes: {
|
|
9
|
+
defaultOpen: {
|
|
10
|
+
control: { type: 'boolean' },
|
|
11
|
+
},
|
|
12
|
+
icon: {
|
|
13
|
+
control: { type: 'text' },
|
|
14
|
+
},
|
|
15
|
+
isOpenIconClass: {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
},
|
|
18
|
+
isCloseIconClass: {
|
|
19
|
+
control: { type: 'text' },
|
|
20
|
+
},
|
|
21
|
+
twIcon: {
|
|
22
|
+
control: { type: 'text' },
|
|
23
|
+
},
|
|
24
|
+
twHeader: {
|
|
25
|
+
control: { type: 'text' },
|
|
26
|
+
},
|
|
27
|
+
twContent: {
|
|
28
|
+
control: { type: 'text' },
|
|
29
|
+
},
|
|
30
|
+
twTitle: {
|
|
31
|
+
control: { type: 'text' },
|
|
32
|
+
},
|
|
33
|
+
iconPosition: {
|
|
34
|
+
control: { type: 'select' },
|
|
35
|
+
options: ['left', 'right'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const Template = (args) => ({
|
|
41
|
+
components: { BaseCollapse },
|
|
42
|
+
setup() {
|
|
43
|
+
return { args };
|
|
44
|
+
},
|
|
45
|
+
template: `
|
|
46
|
+
<BaseCollapse v-bind="args" class="mb-1">
|
|
47
|
+
<template #title>
|
|
48
|
+
<h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
49
|
+
</template>
|
|
50
|
+
<template #content={isOpen}>
|
|
51
|
+
<p class="p-3">
|
|
52
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
53
|
+
</p>
|
|
54
|
+
</template>
|
|
55
|
+
</BaseCollapse>
|
|
56
|
+
|
|
57
|
+
<BaseCollapse v-bind="args" class="mb-1">
|
|
58
|
+
<template #title>
|
|
59
|
+
<h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
60
|
+
</template>
|
|
61
|
+
<template #content>
|
|
62
|
+
<p class="p-3">
|
|
63
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
64
|
+
</p>
|
|
65
|
+
</template>
|
|
66
|
+
</BaseCollapse>
|
|
67
|
+
|
|
68
|
+
<BaseCollapse v-bind="args" class="mb-1">
|
|
69
|
+
<template #title>
|
|
70
|
+
<h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
71
|
+
</template>
|
|
72
|
+
<template #content>
|
|
73
|
+
<p class="p-3">
|
|
74
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
75
|
+
</p>
|
|
76
|
+
</template>
|
|
77
|
+
</BaseCollapse>
|
|
78
|
+
|
|
79
|
+
`,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const Demo = Template.bind({});
|
|
83
|
+
Demo.args = {
|
|
84
|
+
defaultOpen: false,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
const CustomHeaderTemplate = (args) => ({
|
|
89
|
+
components: { BaseCollapse },
|
|
90
|
+
setup() {
|
|
91
|
+
return { args };
|
|
92
|
+
},
|
|
93
|
+
method: {
|
|
94
|
+
toggle() {
|
|
95
|
+
this.defaultOpen = !this.defaultOpen;
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
template: `
|
|
99
|
+
|
|
100
|
+
<BaseCollapse v-bind="args" class="mb-3">
|
|
101
|
+
<template #header={toggle}>
|
|
102
|
+
<h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
103
|
+
</template>
|
|
104
|
+
<template #content>
|
|
105
|
+
<p class="p-3">
|
|
106
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
107
|
+
</p>
|
|
108
|
+
</template>
|
|
109
|
+
</BaseCollapse>
|
|
110
|
+
|
|
111
|
+
<BaseCollapse v-bind="args" class="mb-3">
|
|
112
|
+
<template #header={toggle}>
|
|
113
|
+
<h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
114
|
+
</template>
|
|
115
|
+
<template #content>
|
|
116
|
+
<p class="p-3">
|
|
117
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
118
|
+
</p>
|
|
119
|
+
</template>
|
|
120
|
+
</BaseCollapse>
|
|
121
|
+
|
|
122
|
+
<BaseCollapse v-bind="args" class="mb-3">
|
|
123
|
+
<template #header={toggle}>
|
|
124
|
+
<h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
|
|
125
|
+
</template>
|
|
126
|
+
<template #content>
|
|
127
|
+
<p class="p-3">
|
|
128
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
|
|
129
|
+
</p>
|
|
130
|
+
</template>
|
|
131
|
+
</BaseCollapse>
|
|
132
|
+
|
|
133
|
+
`,
|
|
134
|
+
argTypes: {
|
|
135
|
+
defaultOpen: {
|
|
136
|
+
control: { type: 'boolean' },
|
|
137
|
+
},
|
|
138
|
+
icon: {
|
|
139
|
+
control: { type: 'text' },
|
|
140
|
+
},
|
|
141
|
+
isOpenIconClass: {
|
|
142
|
+
control: { type: 'text' },
|
|
143
|
+
},
|
|
144
|
+
isCloseIconClass: {
|
|
145
|
+
control: { type: 'text' },
|
|
146
|
+
},
|
|
147
|
+
twIcon: {
|
|
148
|
+
control: { type: 'text' },
|
|
149
|
+
},
|
|
150
|
+
twHeader: {
|
|
151
|
+
control: { type: 'text' },
|
|
152
|
+
},
|
|
153
|
+
twContent: {
|
|
154
|
+
control: { type: 'text' },
|
|
155
|
+
},
|
|
156
|
+
twTitle: {
|
|
157
|
+
control: { type: 'text' },
|
|
158
|
+
},
|
|
159
|
+
iconPosition: {
|
|
160
|
+
control: { type: 'select' },
|
|
161
|
+
options: ['left', 'right'],
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
export const CustomHeader = CustomHeaderTemplate.bind({});
|
|
166
|
+
|
|
167
|
+
CustomHeader.args = {
|
|
168
|
+
defaultOpen: false,
|
|
169
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div>
|
|
4
|
+
<slot
|
|
5
|
+
name="header"
|
|
6
|
+
:open="isOpen"
|
|
7
|
+
:toggle="toggle"
|
|
8
|
+
>
|
|
9
|
+
<button
|
|
10
|
+
:class="headerClass"
|
|
11
|
+
type="button"
|
|
12
|
+
@click="toggle()"
|
|
13
|
+
>
|
|
14
|
+
<BaseIcon
|
|
15
|
+
v-if="iconPosition === 'left'"
|
|
16
|
+
:class="internalIconClass"
|
|
17
|
+
:icon="icon"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<div :class="internalTitleClass">
|
|
21
|
+
<slot
|
|
22
|
+
name="title"
|
|
23
|
+
:open="isOpen"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<BaseIcon
|
|
27
|
+
v-if="iconPosition === 'right'"
|
|
28
|
+
:class="internalIconClass"
|
|
29
|
+
:icon="icon"
|
|
30
|
+
/>
|
|
31
|
+
</button>
|
|
32
|
+
</slot>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
v-show="isOpen"
|
|
37
|
+
:class="internalContentClass"
|
|
38
|
+
>
|
|
39
|
+
<slot
|
|
40
|
+
name="content"
|
|
41
|
+
:open="isOpen"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script lang="ts" setup>
|
|
48
|
+
|
|
49
|
+
import { twMerge } from 'tailwind-merge';
|
|
50
|
+
|
|
51
|
+
const internalIconClass = computed(() => {
|
|
52
|
+
const base = "w-6 h-6 flex items-center justify-center transition duration-300 ease-in-out transform cursor-pointer";
|
|
53
|
+
|
|
54
|
+
return twMerge(base, props.twIcon, isOpen.value ? props.isOpenIconClass : props.isCloseIconClass,);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const headerClass = computed(() => {
|
|
58
|
+
return twMerge('flex items-center w-full space-x-1', props.twHeader);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const internalContentClass = computed(() => {
|
|
62
|
+
return twMerge('transition duration-300 ease-in-out transform', props.twContent);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const internalTitleClass = computed(() => {
|
|
66
|
+
return twMerge(props.twTitle, '');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
function toggle() {
|
|
70
|
+
isOpen.value = !isOpen.value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
const props = withDefaults(defineProps<{
|
|
75
|
+
defaultOpen?: boolean;
|
|
76
|
+
icon?: string;
|
|
77
|
+
iconPosition?: 'left' | 'right';
|
|
78
|
+
isOpenIconClass?: string;
|
|
79
|
+
isCloseIconClass?: string;
|
|
80
|
+
twIcon?: string | string[] | null;
|
|
81
|
+
twHeader?: string | string[] | null;
|
|
82
|
+
twTitle?: string | string[] | null;
|
|
83
|
+
twContent?: string | string[] | null;
|
|
84
|
+
}>(), {
|
|
85
|
+
defaultOpen: true,
|
|
86
|
+
icon: 'heroicons:chevron-down-16-solid',
|
|
87
|
+
iconPosition: 'left',
|
|
88
|
+
twIcon: null,
|
|
89
|
+
twHeader: null,
|
|
90
|
+
twTitle: null,
|
|
91
|
+
twContent: null,
|
|
92
|
+
isOpenIconClass: '-rotate-0',
|
|
93
|
+
isCloseIconClass: '-rotate-90',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const isOpen = ref(props.defaultOpen as boolean);
|
|
97
|
+
|
|
98
|
+
</script>
|
package/src/components/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ import BaseCardRow from './BaseCardRow.vue';
|
|
|
20
20
|
import BaseCharacterCounter from './BaseCharacterCounter.vue';
|
|
21
21
|
import BaseClipboard from './BaseClipboard.vue';
|
|
22
22
|
import BaseCalendar from './BaseCalendar.vue';
|
|
23
|
+
import BaseCollapse from './BaseCollapse.vue';
|
|
23
24
|
import BaseColor from './BaseColor.vue';
|
|
24
25
|
import BaseContainer from './BaseContainer.vue';
|
|
25
26
|
import BaseCounter from './BaseCounter.vue';
|
|
@@ -127,6 +128,7 @@ export {
|
|
|
127
128
|
BaseCharacterCounter,
|
|
128
129
|
BaseClipboard,
|
|
129
130
|
BaseCalendar,
|
|
131
|
+
BaseCollapse,
|
|
130
132
|
BaseColor,
|
|
131
133
|
BaseContainer,
|
|
132
134
|
BaseCounter,
|
|
@@ -135,7 +137,6 @@ export {
|
|
|
135
137
|
BaseDataIterator,
|
|
136
138
|
BaseDataTable,
|
|
137
139
|
BaseDatePicker,
|
|
138
|
-
BaseTimePicker,
|
|
139
140
|
BaseDateSelect,
|
|
140
141
|
BaseDescriptionList,
|
|
141
142
|
BaseDescriptionListItem,
|
|
@@ -203,6 +204,7 @@ export {
|
|
|
203
204
|
BaseTextareaAutoresize,
|
|
204
205
|
BaseTimeline,
|
|
205
206
|
BaseTimelineItem,
|
|
207
|
+
BaseTimePicker,
|
|
206
208
|
BaseTooltip,
|
|
207
209
|
BaseUniqueCode,
|
|
208
210
|
BaseLayoutStacked,
|
package/src/types/index.ts
CHANGED
|
@@ -120,10 +120,6 @@ export interface BaseTableColumnData {
|
|
|
120
120
|
style: {
|
|
121
121
|
width: undefined | number;
|
|
122
122
|
};
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
124
|
-
thAttrs: (column: BaseTableColumnData) => Record<string, any>;
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
-
tdAttrs: (row: Row, column: BaseTableColumnData) => Record<string, any>;
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
/**
|