sprintify-ui 0.0.10 → 0.0.12
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 +5174 -6624
- package/dist/style.css +1 -1
- package/dist/tailwindcss/index.js +23 -0
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +0 -1
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +0 -1
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +13 -3
- package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +143 -0
- package/dist/types/src/components/BaseDataTable.vue.d.ts +95 -64
- package/dist/types/src/components/BaseDialog.vue.d.ts +8 -8
- package/dist/types/src/components/BaseFilePicker.vue.d.ts +3 -3
- package/dist/types/src/components/BaseInput.vue.d.ts +39 -5
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +84 -12
- package/dist/types/src/components/BaseMenuItem.vue.d.ts +4 -4
- package/dist/types/src/components/BaseModalCenter.vue.d.ts +8 -8
- package/dist/types/src/components/BaseModalSide.vue.d.ts +8 -8
- package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +4 -4
- package/dist/types/src/components/BasePagination.vue.d.ts +105 -13
- package/dist/types/src/components/BasePaginationSimple.vue.d.ts +2 -2
- package/dist/types/src/components/BaseSelect.vue.d.ts +130 -26
- package/dist/types/src/components/BaseSwitch.vue.d.ts +15 -8
- package/dist/types/src/components/BaseTabItem.vue.d.ts +26 -4
- package/dist/types/src/components/BaseTableColumn.vue.d.ts +4 -4
- package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +175 -21
- package/dist/types/src/components/index.d.ts +24 -1
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/svg/BaseEmptyState.vue.d.ts +2 -0
- package/dist/types/src/{components/BaseSpinner.vue.d.ts → svg/BaseSpinnerLarge.vue.d.ts} +0 -0
- package/dist/types/src/svg/BaseSpinnerSmall.vue.d.ts +44 -0
- package/dist/types/src/types/types.d.ts +1 -1
- package/package.json +4 -2
- package/src/components/BaseAutocomplete.stories.js +7 -4
- package/src/components/BaseAutocomplete.vue +44 -15
- package/src/components/BaseAutocompleteFetch.stories.js +6 -3
- package/src/components/BaseAutocompleteFetch.vue +8 -3
- package/src/components/BaseBelongsTo.stories.js +9 -4
- package/src/components/BaseBelongsTo.vue +1 -0
- package/src/components/BaseCard.vue +1 -1
- package/src/components/BaseCharacterCounter.stories.js +30 -0
- package/src/components/BaseCharacterCounter.vue +60 -0
- package/src/components/BaseDataIterator.stories.js +102 -3
- package/src/components/BaseDataIterator.vue +75 -49
- package/src/components/BaseDataTable.stories.js +149 -2
- package/src/components/BaseDataTable.vue +34 -28
- package/src/components/BaseDataTableToggleColumns.vue +1 -1
- package/src/components/BaseDateSelect.vue +6 -2
- package/src/components/BaseDescriptionListItem.vue +40 -4
- package/src/components/BaseDialog.stories.js +51 -0
- package/src/components/BaseDialog.vue +13 -7
- package/src/components/BaseFilePicker.stories.js +51 -0
- package/src/components/BaseFilePicker.vue +6 -6
- package/src/components/BaseFileUploader.stories.js +80 -0
- package/src/components/BaseFileUploader.vue +16 -3
- package/src/components/BaseInput.stories.js +46 -0
- package/src/components/BaseInput.vue +10 -2
- package/src/components/BaseInputLabel.stories.js +31 -0
- package/src/components/BaseInputLabel.vue +1 -1
- package/src/components/BaseLoadingCover.stories.js +55 -0
- package/src/components/BaseLoadingCover.vue +27 -17
- package/src/components/BaseMenu.stories.js +125 -0
- package/src/components/BaseModalCenter.stories.js +61 -0
- package/src/components/BaseModalCenter.vue +2 -2
- package/src/components/BaseModalSide.stories.js +55 -0
- package/src/components/BaseModalSide.vue +2 -2
- package/src/components/BaseNavbar.stories.js +150 -0
- package/src/components/BaseNavbar.vue +3 -0
- package/src/components/BaseNavbarItem.vue +1 -0
- package/src/components/BaseNavbarItemContent.vue +3 -0
- package/src/components/BasePagination.stories.js +32 -0
- package/src/components/BasePagination.vue +126 -40
- package/src/components/BasePaginationSimple.vue +3 -3
- package/src/components/BasePanel.stories.js +56 -0
- package/src/components/BasePassword.stories.js +36 -0
- package/src/components/BasePassword.vue +11 -5
- package/src/components/BaseProcessRing.stories.js +27 -0
- package/src/components/BaseReadMore.stories.js +30 -0
- package/src/components/BaseReadMore.vue +1 -1
- package/src/components/BaseSelect.stories.js +67 -0
- package/src/components/BaseSelect.vue +144 -44
- package/src/components/BaseSideNavigation.stories.js +55 -0
- package/src/components/BaseSideNavigation.vue +7 -2
- package/src/components/BaseSideNavigationItem.vue +11 -3
- package/src/components/BaseSkeleton.stories.js +36 -0
- package/src/components/BaseSwitch.stories.js +101 -0
- package/src/components/BaseSwitch.vue +90 -12
- package/src/components/BaseSystemAlert.stories.js +63 -0
- package/src/components/BaseTabItem.vue +19 -6
- package/src/components/BaseTable.vue +42 -29
- package/src/components/BaseTableColumn.vue +2 -2
- package/src/components/BaseTabs.stories.js +54 -0
- package/src/components/BaseTabs.vue +3 -3
- package/src/components/BaseTextarea.stories.js +35 -0
- package/src/components/BaseTextarea.vue +1 -1
- package/src/components/BaseTextareaAutoresize.stories.js +49 -0
- package/src/components/BaseTextareaAutoresize.vue +83 -87
- package/src/components/index.ts +46 -0
- package/src/lang/en.json +1 -0
- package/src/lang/fr.json +1 -0
- package/src/svg/BaseEmptyState.vue +34 -0
- package/src/{components/BaseSpinner.vue → svg/BaseSpinnerLarge.vue} +0 -0
- package/src/svg/BaseSpinnerSmall.vue +9 -0
- package/src/types/types.ts +1 -1
- package/dist/types/src/components/BaseWordCount.vue.d.ts +0 -31
- package/src/components/BaseWordCount.vue +0 -36
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import BaseInputLabel from './BaseInputLabel.vue';
|
|
2
|
+
import BaseInput from './BaseInput.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/BaseInputLabel',
|
|
6
|
+
component: BaseInputLabel,
|
|
7
|
+
args: {
|
|
8
|
+
required: true,
|
|
9
|
+
label: 'First Name',
|
|
10
|
+
class: 'text-slate-600 block text-sm',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args) => ({
|
|
15
|
+
components: {
|
|
16
|
+
BaseInputLabel,
|
|
17
|
+
BaseInput,
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
return { args };
|
|
21
|
+
},
|
|
22
|
+
template: `
|
|
23
|
+
<form @submit.prevent="">
|
|
24
|
+
<BaseInputLabel v-bind="args"></BaseInputLabel>
|
|
25
|
+
<BaseInput required name="name" placeholder="Enter your first name"></BaseInput>
|
|
26
|
+
</form>
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const Demo = Template.bind({});
|
|
31
|
+
Demo.args = {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/BaseLoadingCover',
|
|
5
|
+
component: BaseLoadingCover,
|
|
6
|
+
args: {
|
|
7
|
+
delay: 0,
|
|
8
|
+
modelValue: true,
|
|
9
|
+
size: 'sm',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ['sm', 'lg'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Template = (args) => ({
|
|
20
|
+
components: {
|
|
21
|
+
BaseLoadingCover,
|
|
22
|
+
},
|
|
23
|
+
setup() {
|
|
24
|
+
return { args };
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<div class="relative bg-slate-100 p-6 py-10">
|
|
28
|
+
<p class="text-center text-slate-700">Non dolor consectetur et occaecat.</p>
|
|
29
|
+
<BaseLoadingCover v-bind="args" />
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const Demo = Template.bind({});
|
|
35
|
+
Demo.args = {};
|
|
36
|
+
|
|
37
|
+
export const SmallSpinner = Template.bind({});
|
|
38
|
+
SmallSpinner.args = {
|
|
39
|
+
size: 'sm',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const LargeSpinner = Template.bind({});
|
|
43
|
+
LargeSpinner.args = {
|
|
44
|
+
size: 'lg',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const SpinnerCustomClass = Template.bind({});
|
|
48
|
+
SpinnerCustomClass.args = {
|
|
49
|
+
iconClass: 'text-red-500 w-10 h-10',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const BackdropCustomClass = Template.bind({});
|
|
53
|
+
BackdropCustomClass.args = {
|
|
54
|
+
backdropClass: 'bg-slate-100 opacity-50',
|
|
55
|
+
};
|
|
@@ -12,49 +12,59 @@
|
|
|
12
12
|
class="absolute inset-0 flex h-full w-full items-center justify-center"
|
|
13
13
|
>
|
|
14
14
|
<div class="absolute h-full w-full" :class="backdropClass" />
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
:class="iconClass"
|
|
19
|
-
viewBox="0 0 24 24"
|
|
20
|
-
>
|
|
21
|
-
<path
|
|
22
|
-
fill="currentColor"
|
|
23
|
-
d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"
|
|
24
|
-
/>
|
|
25
|
-
</svg>
|
|
26
|
-
<BaseSpinner v-else-if="icon == 'spinner'" :class="iconClass" />
|
|
15
|
+
|
|
16
|
+
<BaseSpinnerSmall v-if="size == 'sm'" :class="iconClass" />
|
|
17
|
+
<BaseSpinnerLarge v-else-if="size == 'lg'" :class="iconClass" />
|
|
27
18
|
</div>
|
|
28
19
|
</Transition>
|
|
29
20
|
</template>
|
|
30
21
|
|
|
31
22
|
<script lang="ts" setup>
|
|
32
23
|
import { PropType } from 'vue';
|
|
33
|
-
import
|
|
24
|
+
import BaseSpinnerSmall from '../svg/BaseSpinnerSmall.vue';
|
|
25
|
+
import BaseSpinnerLarge from '../svg/BaseSpinnerLarge.vue';
|
|
34
26
|
|
|
35
27
|
const props = defineProps({
|
|
28
|
+
/**
|
|
29
|
+
* Show/Hide the loading cover
|
|
30
|
+
*/
|
|
36
31
|
modelValue: {
|
|
37
32
|
default: true,
|
|
38
33
|
type: Boolean,
|
|
39
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Classes added to the backdrop
|
|
37
|
+
*/
|
|
40
38
|
backdropClass: {
|
|
41
39
|
default: 'bg-white',
|
|
42
40
|
type: String,
|
|
43
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Classes added to the spinner icon
|
|
44
|
+
*/
|
|
44
45
|
iconClass: {
|
|
45
46
|
default: 'text-blue-500 w-10 h-10',
|
|
46
47
|
type: String,
|
|
47
48
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Change the type of spinner. 'sm' for a small spinner. 'lg' for a large spinner.
|
|
51
|
+
*/
|
|
52
|
+
size: {
|
|
53
|
+
default: 'sm',
|
|
54
|
+
type: String as PropType<'sm' | 'lg'>,
|
|
51
55
|
},
|
|
56
|
+
/**
|
|
57
|
+
* Transition duration class.
|
|
58
|
+
*/
|
|
52
59
|
duration: {
|
|
53
60
|
default: 'duration-300',
|
|
54
61
|
type: String,
|
|
55
62
|
},
|
|
63
|
+
/**
|
|
64
|
+
* Delay before showing the loading cover. This delay is used to avoid unnecessary showing the spinner for a fraction of second when the loading time is too short.
|
|
65
|
+
*/
|
|
56
66
|
delay: {
|
|
57
|
-
default:
|
|
67
|
+
default: 0,
|
|
58
68
|
type: Number,
|
|
59
69
|
},
|
|
60
70
|
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import BaseMenu from './BaseMenu.vue';
|
|
2
|
+
import { Icon as BaseIcon } from '@iconify/vue';
|
|
3
|
+
import BaseAvatar from './BaseAvatar.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/BaseMenu',
|
|
7
|
+
component: BaseMenu,
|
|
8
|
+
args: {
|
|
9
|
+
position: 'bottom-right',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
position: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ['bottom-left', 'bottom-right'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Template = (args) => ({
|
|
20
|
+
components: {
|
|
21
|
+
BaseMenu,
|
|
22
|
+
BaseIcon,
|
|
23
|
+
BaseAvatar,
|
|
24
|
+
},
|
|
25
|
+
setup() {
|
|
26
|
+
const items = [
|
|
27
|
+
{
|
|
28
|
+
label: 'Export file',
|
|
29
|
+
icon: 'mdi-export',
|
|
30
|
+
action() {
|
|
31
|
+
alert('Export!');
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Google',
|
|
36
|
+
icon: 'mdi-google',
|
|
37
|
+
href: 'https://google.com',
|
|
38
|
+
count: 1000,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
icon: 'mdi-access-point',
|
|
42
|
+
label: 'Reconnect',
|
|
43
|
+
to: 'home',
|
|
44
|
+
color: 'success',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
icon: 'mdi-archive',
|
|
48
|
+
label: 'Archive',
|
|
49
|
+
href: 'https://google.com',
|
|
50
|
+
color: 'warning',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
icon: 'mdi-trash-can',
|
|
54
|
+
label: 'Delete',
|
|
55
|
+
href: 'https://google.com',
|
|
56
|
+
color: 'danger',
|
|
57
|
+
count: 1,
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const user = {
|
|
62
|
+
email: 'jane@witify.io',
|
|
63
|
+
first_name: 'Jane',
|
|
64
|
+
last_name: 'Doe',
|
|
65
|
+
full_name: 'Jane Doe',
|
|
66
|
+
avatar_url:
|
|
67
|
+
'https://images.unsplash.com/photo-1494790108377-be9c29b29330??auto=format&fit=crop&w=200&h=200&q=80&g=face',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
args.items = items;
|
|
71
|
+
|
|
72
|
+
return { args, user };
|
|
73
|
+
},
|
|
74
|
+
template: `
|
|
75
|
+
<div class="pb-52">
|
|
76
|
+
|
|
77
|
+
<h2 class="mb-5 font-semibold">Various examples</h2>
|
|
78
|
+
|
|
79
|
+
<p class="text-sm mb-1 text-slate-600">Simple button</p>
|
|
80
|
+
|
|
81
|
+
<BaseMenu v-bind="args" class="inline-block">
|
|
82
|
+
<template #button="{ open }">
|
|
83
|
+
<div
|
|
84
|
+
class="btn"
|
|
85
|
+
:class="[open ? 'ring-2 ring-primary-500 ring-offset-2': '']"
|
|
86
|
+
>
|
|
87
|
+
Click me
|
|
88
|
+
</div>
|
|
89
|
+
</template>
|
|
90
|
+
</BaseMenu>
|
|
91
|
+
|
|
92
|
+
<br>
|
|
93
|
+
<br>
|
|
94
|
+
|
|
95
|
+
<p class="text-sm mb-1 text-slate-600">Contextual action button</p>
|
|
96
|
+
|
|
97
|
+
<BaseMenu v-bind="args" class="inline-block">
|
|
98
|
+
<template #button="{ open }">
|
|
99
|
+
<div
|
|
100
|
+
class="flex h-10 w-10 items-center justify-center rounded-full border border-slate-300 bg-white duration-150 hover:bg-slate-50"
|
|
101
|
+
:class="[open ? 'ring-2 ring-primary-500 ring-offset-2': '']"
|
|
102
|
+
>
|
|
103
|
+
<BaseIcon icon="heroicons-solid:dots-vertical" />
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
</BaseMenu>
|
|
107
|
+
|
|
108
|
+
<br>
|
|
109
|
+
<br>
|
|
110
|
+
|
|
111
|
+
<p class="text-sm mb-1 text-slate-600">With BaseAvatar</p>
|
|
112
|
+
|
|
113
|
+
<BaseMenu v-bind="args" class="inline-block">
|
|
114
|
+
<template #button="{ open }">
|
|
115
|
+
<div class="bg-white">
|
|
116
|
+
<BaseAvatar show-details :user="user" />
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
</BaseMenu>
|
|
120
|
+
</div>
|
|
121
|
+
`,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const Demo = Template.bind({});
|
|
125
|
+
Demo.args = {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import BaseModalCenter from './BaseModalCenter.vue';
|
|
2
|
+
import { Icon as BaseIcon } from '@iconify/vue';
|
|
3
|
+
import BaseAvatar from './BaseAvatar.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/BaseModalCenter',
|
|
7
|
+
component: BaseModalCenter,
|
|
8
|
+
args: {
|
|
9
|
+
position: 'bottom-right',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
verticalAlign: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ['center', 'top'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Template = (args) => ({
|
|
20
|
+
components: {
|
|
21
|
+
BaseModalCenter,
|
|
22
|
+
BaseIcon,
|
|
23
|
+
BaseAvatar,
|
|
24
|
+
},
|
|
25
|
+
setup() {
|
|
26
|
+
const show = ref(false);
|
|
27
|
+
return { args, show };
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<div class="">
|
|
31
|
+
<button @click="show = true" class="btn">Show modal</button>
|
|
32
|
+
<BaseModalCenter v-model="show" v-bind="args">
|
|
33
|
+
<template #default="{close}">
|
|
34
|
+
<div class="p-8">
|
|
35
|
+
<p class="mb-6">Hello!</p>
|
|
36
|
+
|
|
37
|
+
<button @click="close" class="btn btn-sm">Close</button>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</BaseModalCenter>
|
|
41
|
+
</div>
|
|
42
|
+
`,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const Demo = Template.bind({});
|
|
46
|
+
Demo.args = {};
|
|
47
|
+
|
|
48
|
+
export const VerticalAlignTop = Template.bind({});
|
|
49
|
+
VerticalAlignTop.args = {
|
|
50
|
+
verticalAlign: 'top',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const CustomBackdropClass = Template.bind({});
|
|
54
|
+
CustomBackdropClass.args = {
|
|
55
|
+
backdropClass: 'bg-red-500 bg-opacity-70',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const PreventLeave = Template.bind({});
|
|
59
|
+
PreventLeave.args = {
|
|
60
|
+
closeOnOutsideClick: false,
|
|
61
|
+
};
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
>
|
|
31
31
|
<div
|
|
32
32
|
v-if="modelValue"
|
|
33
|
-
:class="
|
|
33
|
+
:class="backdropClass"
|
|
34
34
|
class="fixed inset-0 transition-opacity"
|
|
35
35
|
@click="
|
|
36
36
|
closeOnOutsideClick
|
|
@@ -85,7 +85,7 @@ const props = defineProps({
|
|
|
85
85
|
default: 'center',
|
|
86
86
|
type: String,
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
backdropClass: {
|
|
89
89
|
default: 'bg-opacity-70 bg-slate-900',
|
|
90
90
|
type: String,
|
|
91
91
|
},
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import BaseModalSide from './BaseModalSide.vue';
|
|
2
|
+
import { Icon as BaseIcon } from '@iconify/vue';
|
|
3
|
+
import BaseAvatar from './BaseAvatar.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/BaseModalSide',
|
|
7
|
+
component: BaseModalSide,
|
|
8
|
+
args: {
|
|
9
|
+
position: 'bottom-right',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
components: {
|
|
15
|
+
BaseModalSide,
|
|
16
|
+
BaseIcon,
|
|
17
|
+
BaseAvatar,
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
const show = ref(false);
|
|
21
|
+
return { args, show };
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<div class="">
|
|
25
|
+
<button @click="show = true" class="btn">Show modal</button>
|
|
26
|
+
<BaseModalSide v-model="show" v-bind="args">
|
|
27
|
+
<template #default="{close}">
|
|
28
|
+
<div class="p-8">
|
|
29
|
+
<p class="mb-6">Hello!</p>
|
|
30
|
+
|
|
31
|
+
<button @click="close" class="btn btn-sm">Close</button>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</BaseModalSide>
|
|
35
|
+
</div>
|
|
36
|
+
`,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const Demo = Template.bind({});
|
|
40
|
+
Demo.args = {};
|
|
41
|
+
|
|
42
|
+
export const CustomMaxWidth = Template.bind({});
|
|
43
|
+
CustomMaxWidth.args = {
|
|
44
|
+
maxWidth: '16rem',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const CustomBackdropClass = Template.bind({});
|
|
48
|
+
CustomBackdropClass.args = {
|
|
49
|
+
backdropClass: 'bg-red-500 bg-opacity-70',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const PreventLeave = Template.bind({});
|
|
53
|
+
PreventLeave.args = {
|
|
54
|
+
closeOnOutsideClick: false,
|
|
55
|
+
};
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
26
|
v-show="modelValue"
|
|
27
|
-
:class="
|
|
27
|
+
:class="backdropClass"
|
|
28
28
|
class="fixed inset-0 transition-opacity"
|
|
29
29
|
@click="
|
|
30
30
|
closeOnOutsideClick
|
|
@@ -85,7 +85,7 @@ const props = defineProps({
|
|
|
85
85
|
default: '32rem',
|
|
86
86
|
type: String,
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
backdropClass: {
|
|
89
89
|
default: 'bg-opacity-70 bg-slate-900',
|
|
90
90
|
type: String,
|
|
91
91
|
},
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import BaseNavbar from './BaseNavbar.vue';
|
|
2
|
+
import BaseNavbarItem from './BaseNavbarItem.vue';
|
|
3
|
+
import BaseAvatar from './BaseAvatar.vue';
|
|
4
|
+
import BaseMenu from './BaseMenu.vue';
|
|
5
|
+
import { Icon as BaseIcon } from '@iconify/vue';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Layout/BaseNavbar',
|
|
9
|
+
component: BaseNavbar,
|
|
10
|
+
args: {},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
components: {
|
|
15
|
+
BaseNavbar,
|
|
16
|
+
BaseNavbarItem,
|
|
17
|
+
BaseIcon,
|
|
18
|
+
BaseAvatar,
|
|
19
|
+
BaseMenu,
|
|
20
|
+
},
|
|
21
|
+
setup() {
|
|
22
|
+
const user = {
|
|
23
|
+
email: 'jane@witify.io',
|
|
24
|
+
first_name: 'Jane',
|
|
25
|
+
last_name: 'Doe',
|
|
26
|
+
full_name: 'Jane Doe',
|
|
27
|
+
avatar_url:
|
|
28
|
+
'https://images.unsplash.com/photo-1494790108377-be9c29b29330??auto=format&fit=crop&w=200&h=200&q=80&g=face',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const menu = [
|
|
32
|
+
{
|
|
33
|
+
label: 'Home',
|
|
34
|
+
to: '/',
|
|
35
|
+
type: 'RouterLink',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Products',
|
|
39
|
+
to: '/',
|
|
40
|
+
count: 234,
|
|
41
|
+
type: 'RouterLink',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Settings',
|
|
45
|
+
to: '/',
|
|
46
|
+
type: 'RouterLink',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const userMenu = [
|
|
51
|
+
{
|
|
52
|
+
label: 'Home',
|
|
53
|
+
icon: 'heroicons:home',
|
|
54
|
+
href: 'https://google.com',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
line: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Logout',
|
|
61
|
+
icon: 'heroicons:arrow-right-on-rectangle',
|
|
62
|
+
href: 'https://google.com',
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
return { args, menu, userMenu, user };
|
|
67
|
+
},
|
|
68
|
+
template: `
|
|
69
|
+
<div class="mb-40">
|
|
70
|
+
<BaseNavbar v-bind="args">
|
|
71
|
+
<template #navbar>
|
|
72
|
+
<div class="flex h-16 justify-between">
|
|
73
|
+
<!-- Left -->
|
|
74
|
+
|
|
75
|
+
<div class="flex items-center justify-center">
|
|
76
|
+
<!-- Logo -->
|
|
77
|
+
<router-link to="/" class="flex flex-shrink-0 grow items-center p-2 pl-0">
|
|
78
|
+
<img
|
|
79
|
+
class="block h-8 w-auto"
|
|
80
|
+
src="https://sprintify.witify.io/img/logo/logo-side-dark.svg"
|
|
81
|
+
alt="Sprintify"
|
|
82
|
+
/>
|
|
83
|
+
</router-link>
|
|
84
|
+
|
|
85
|
+
<!-- Links (desktop) -->
|
|
86
|
+
<div class="ml-10 hidden items-center space-x-4 md:flex">
|
|
87
|
+
<BaseNavbarItem
|
|
88
|
+
v-for="item in menu"
|
|
89
|
+
:key="item.label"
|
|
90
|
+
:item="item"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<!-- Right -->
|
|
96
|
+
|
|
97
|
+
<div class="hidden md:ml-6 md:flex md:items-center">
|
|
98
|
+
<!-- Profile dropdown -->
|
|
99
|
+
<BaseMenu menu-class="w-52" :items="userMenu">
|
|
100
|
+
<template #button="{ open }">
|
|
101
|
+
<div
|
|
102
|
+
class="flex rounded-full"
|
|
103
|
+
:class="[open ? 'bg-slate-700 ring-2 ring-blue-500 ring-offset-2 ring-offset-slate-700' : '']"
|
|
104
|
+
>
|
|
105
|
+
<BaseAvatar class="text-white" :user="user" />
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
</BaseMenu>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<template #mobile>
|
|
114
|
+
<!-- Links mobile -->
|
|
115
|
+
<div class="space-y-1 p-2">
|
|
116
|
+
<BaseNavbarItem
|
|
117
|
+
v-for="item in menu"
|
|
118
|
+
:key="item.label"
|
|
119
|
+
:item="item"
|
|
120
|
+
class="flex w-full"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<hr class="my-4 border-slate-700" />
|
|
125
|
+
|
|
126
|
+
<!-- Profile links -->
|
|
127
|
+
<div class="p-2 pb-6">
|
|
128
|
+
<BaseAvatar
|
|
129
|
+
:user="user"
|
|
130
|
+
show-details
|
|
131
|
+
size="base"
|
|
132
|
+
class="px-3 text-white"
|
|
133
|
+
/>
|
|
134
|
+
<div class="mt-4 space-y-1">
|
|
135
|
+
<BaseNavbarItem
|
|
136
|
+
v-for="item in userMenu"
|
|
137
|
+
:key="item.label"
|
|
138
|
+
:item="item"
|
|
139
|
+
class="flex w-full"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
</BaseNavbar>
|
|
145
|
+
</div>
|
|
146
|
+
`,
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
export const Demo = Template.bind({});
|
|
150
|
+
Demo.args = {};
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script lang="ts" setup>
|
|
14
|
+
import { Icon as BaseIcon } from '@iconify/vue';
|
|
15
|
+
import BaseCounter from './BaseCounter.vue';
|
|
16
|
+
|
|
14
17
|
const buttonClasses =
|
|
15
18
|
'px-3 py-2 text-left rounded-md md:text-sm flex text-base font-normal w-full';
|
|
16
19
|
const buttonInactiveClasses =
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import BasePagination from './BasePagination.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/BasePagination',
|
|
5
|
+
component: BasePagination,
|
|
6
|
+
args: {
|
|
7
|
+
totalVisible: 12,
|
|
8
|
+
lastPage: 20,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args) => ({
|
|
13
|
+
components: {
|
|
14
|
+
BasePagination,
|
|
15
|
+
},
|
|
16
|
+
setup() {
|
|
17
|
+
const modelValue = ref(10);
|
|
18
|
+
|
|
19
|
+
return { args, modelValue };
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<div>
|
|
23
|
+
<BasePagination v-model="modelValue" v-bind="args"></BasePagination>
|
|
24
|
+
</div>
|
|
25
|
+
<div style="max-width: 500px;">
|
|
26
|
+
<BasePagination v-model="modelValue" v-bind="args"></BasePagination>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const Demo = Template.bind({});
|
|
32
|
+
Demo.args = {};
|