sprintify-ui 0.6.47 → 0.6.50
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 +2823 -2809
- package/dist/types/src/components/BaseAutocompleteDrawer.vue.d.ts +1 -1
- package/dist/types/src/components/BaseButton.vue.d.ts +13 -10
- package/dist/types/src/components/BaseDisplayRelativeTime.vue.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/BaseBadge.vue +2 -1
- package/src/components/BaseButton.vue +13 -1
- package/src/components/BaseCounter.stories.js +1 -1
- package/src/components/BaseCounter.vue +3 -2
- package/src/components/BaseDialog.stories.js +19 -16
- package/src/components/BaseDialog.vue +14 -16
|
@@ -70,9 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
70
70
|
}, {
|
|
71
71
|
size: "xs" | "sm" | "md";
|
|
72
72
|
options: NormalizedOption[];
|
|
73
|
+
loading: boolean;
|
|
73
74
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
74
75
|
keywords: string;
|
|
75
|
-
loading: boolean;
|
|
76
76
|
loadingBottom: boolean;
|
|
77
77
|
twDrawer: string;
|
|
78
78
|
}, {}>, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClassNameValue } from 'tailwind-merge';
|
|
2
2
|
import { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
declare function focus(): void;
|
|
3
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
5
|
class: {
|
|
5
6
|
type: import("vue").PropType<string | false | 0 | ClassNameValue[] | null>;
|
|
@@ -29,19 +30,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
29
30
|
type: import("vue").PropType<boolean>;
|
|
30
31
|
default: boolean;
|
|
31
32
|
};
|
|
32
|
-
loading: {
|
|
33
|
-
type: import("vue").PropType<boolean>;
|
|
34
|
-
default: boolean;
|
|
35
|
-
};
|
|
36
33
|
as: {
|
|
37
34
|
type: import("vue").PropType<string>;
|
|
38
35
|
default: string;
|
|
39
36
|
};
|
|
37
|
+
loading: {
|
|
38
|
+
type: import("vue").PropType<boolean>;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
40
41
|
iconPosition: {
|
|
41
42
|
type: import("vue").PropType<"start" | "end">;
|
|
42
43
|
default: string;
|
|
43
44
|
};
|
|
44
|
-
}, {
|
|
45
|
+
}, {
|
|
46
|
+
focus: typeof focus;
|
|
47
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
48
|
click: (...args: any[]) => void;
|
|
46
49
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
50
|
class: {
|
|
@@ -72,14 +75,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
72
75
|
type: import("vue").PropType<boolean>;
|
|
73
76
|
default: boolean;
|
|
74
77
|
};
|
|
75
|
-
loading: {
|
|
76
|
-
type: import("vue").PropType<boolean>;
|
|
77
|
-
default: boolean;
|
|
78
|
-
};
|
|
79
78
|
as: {
|
|
80
79
|
type: import("vue").PropType<string>;
|
|
81
80
|
default: string;
|
|
82
81
|
};
|
|
82
|
+
loading: {
|
|
83
|
+
type: import("vue").PropType<boolean>;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
83
86
|
iconPosition: {
|
|
84
87
|
type: import("vue").PropType<"start" | "end">;
|
|
85
88
|
default: string;
|
|
@@ -94,8 +97,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
94
97
|
icon: string;
|
|
95
98
|
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
96
99
|
disabled: boolean;
|
|
97
|
-
loading: boolean;
|
|
98
100
|
as: string;
|
|
101
|
+
loading: boolean;
|
|
99
102
|
iconPosition: "start" | "end";
|
|
100
103
|
}, {}>, {
|
|
101
104
|
default?(_: {}): any;
|
package/package.json
CHANGED
|
@@ -75,7 +75,8 @@ const classes = computed(() => {
|
|
|
75
75
|
md: 'px-1.5 py-0.5 text-xs',
|
|
76
76
|
lg: 'px-1.5 py-0.5 text-sm',
|
|
77
77
|
}[sizeInternal.value];
|
|
78
|
-
|
|
78
|
+
|
|
79
|
+
const wrap = props.wrap ? '' : 'whitespace-nowrap';
|
|
79
80
|
|
|
80
81
|
return twMerge(base, wrap, size, props.class);
|
|
81
82
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="as"
|
|
4
|
-
ref="
|
|
4
|
+
ref="buttonRef"
|
|
5
5
|
:class="classes"
|
|
6
6
|
:style="styles"
|
|
7
7
|
:to="to"
|
|
@@ -205,4 +205,16 @@ const iconClass = computed(() => {
|
|
|
205
205
|
return classes;
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
+
const buttonRef = ref<HTMLElement | undefined>(undefined);
|
|
209
|
+
|
|
210
|
+
function focus() {
|
|
211
|
+
if (buttonRef.value) {
|
|
212
|
+
buttonRef.value.focus();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
defineExpose({
|
|
217
|
+
focus,
|
|
218
|
+
});
|
|
219
|
+
|
|
208
220
|
</script>
|
|
@@ -34,12 +34,13 @@ const props = defineProps({
|
|
|
34
34
|
const countLabel = computed((): string => {
|
|
35
35
|
const realMaxDigit = Math.max(1, props.maxDigit);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// Should work with 0.01
|
|
38
|
+
const countString = Math.round(props.count) + '';
|
|
38
39
|
const numberOfDigit = countString.length;
|
|
39
40
|
if (numberOfDigit > realMaxDigit) {
|
|
40
41
|
return padStart('+', realMaxDigit + 1, '9');
|
|
41
42
|
}
|
|
42
|
-
return
|
|
43
|
+
return props.count + '';
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
const sizeClass = computed((): string => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import BaseDialog from './BaseDialog.vue';
|
|
2
2
|
|
|
3
|
+
const colors = ['info', 'success', 'warning', 'danger'];
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
title: 'Components/BaseDialog',
|
|
5
7
|
component: BaseDialog,
|
|
@@ -10,6 +12,7 @@ export default {
|
|
|
10
12
|
},
|
|
11
13
|
},
|
|
12
14
|
args: {
|
|
15
|
+
color: 'info',
|
|
13
16
|
message:
|
|
14
17
|
'Nisi Lorem sunt amet aliqua dolor ullamco deserunt enim irure non ad. Excepteur culpa consectetur dolore culpa sunt aliquip proident quis.',
|
|
15
18
|
},
|
|
@@ -29,23 +32,23 @@ const Template = (args) => ({
|
|
|
29
32
|
export const Demo = Template.bind({});
|
|
30
33
|
Demo.args = {
|
|
31
34
|
title: 'Be careful',
|
|
32
|
-
color: 'warning',
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Success = Template.bind({});
|
|
36
|
-
Success.args = {
|
|
37
|
-
title: 'Success',
|
|
38
|
-
color: 'success',
|
|
39
35
|
};
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
37
|
+
const ColorsTemplate = (args) => ({
|
|
38
|
+
components: { BaseDialog },
|
|
39
|
+
setup() {
|
|
40
|
+
return { args, colors };
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<div v-for="color in colors" :key="color" class="mb-1">
|
|
44
|
+
<p class="text-xs text-slate-600 leading-tight">{{ color }}</p>
|
|
45
|
+
<BaseDialog v-bind="args" :color="color">
|
|
46
|
+
</BaseDialog>
|
|
47
|
+
</div>
|
|
48
|
+
`,
|
|
49
|
+
});
|
|
46
50
|
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
title: '
|
|
50
|
-
color: 'info',
|
|
51
|
+
export const Colors = ColorsTemplate.bind({});
|
|
52
|
+
Colors.args = {
|
|
53
|
+
title: 'Be careful',
|
|
51
54
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="relative transform overflow-hidden rounded-lg bg-white ring-1 ring-black ring-opacity-10 p-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"
|
|
3
|
+
class="relative transform overflow-hidden rounded-lg bg-white ring-1 ring-black ring-opacity-10 p-4 text-left shadow-xl transition-all || sm:my-8 sm:w-full sm:max-w-lg"
|
|
4
4
|
>
|
|
5
|
-
<div class="sm:flex sm:items-start">
|
|
5
|
+
<div class="sm:flex sm:items-start || sm:gap-4">
|
|
6
6
|
<div
|
|
7
7
|
class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full sm:mx-0 sm:h-10 sm:w-10"
|
|
8
8
|
:class="{
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
icon="heroicons:information-circle-20-solid"
|
|
34
34
|
/>
|
|
35
35
|
</div>
|
|
36
|
-
<div class="mt-3 text-center sm:mt-0 sm:
|
|
36
|
+
<div class="mt-3 text-center || sm:mt-0 sm:text-left">
|
|
37
37
|
<slot>
|
|
38
38
|
<h3
|
|
39
39
|
id="modal-title"
|
|
@@ -49,28 +49,25 @@
|
|
|
49
49
|
</slot>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
|
-
<div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
|
|
53
|
-
<
|
|
52
|
+
<div class="mt-5 || sm:mt-4 sm:flex sm:flex-row-reverse">
|
|
53
|
+
<BaseButton
|
|
54
54
|
ref="confirm"
|
|
55
55
|
type="button"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
'btn-danger': color == 'danger',
|
|
60
|
-
'btn-warning': color == 'warning',
|
|
61
|
-
'btn-success': color == 'success',
|
|
62
|
-
}"
|
|
56
|
+
size="sm"
|
|
57
|
+
class="mb-2 w-full sm:mb-0 sm:w-auto"
|
|
58
|
+
:color="color"
|
|
63
59
|
@click="$emit('confirm')"
|
|
64
60
|
>
|
|
65
61
|
{{ confirmText ?? t('sui.confirm') }}
|
|
66
|
-
</
|
|
67
|
-
<
|
|
62
|
+
</BaseButton>
|
|
63
|
+
<BaseButton
|
|
68
64
|
type="button"
|
|
69
|
-
|
|
65
|
+
size="sm"
|
|
66
|
+
class="w-full sm:mr-2 sm:w-auto"
|
|
70
67
|
@click="$emit('cancel')"
|
|
71
68
|
>
|
|
72
69
|
{{ cancelText ?? t('sui.cancel') }}
|
|
73
|
-
</
|
|
70
|
+
</BaseButton>
|
|
74
71
|
</div>
|
|
75
72
|
</div>
|
|
76
73
|
</template>
|
|
@@ -79,6 +76,7 @@
|
|
|
79
76
|
import { PropType } from 'vue';
|
|
80
77
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
81
78
|
import { t } from '@/i18n';
|
|
79
|
+
import BaseButton from './BaseButton.vue';
|
|
82
80
|
|
|
83
81
|
defineProps({
|
|
84
82
|
color: {
|