sprintify-ui 0.7.4 → 0.7.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 +4401 -4343
- package/dist/style.css +1 -1
- package/dist/types/components/BaseAddressForm.vue.d.ts +2 -2
- package/dist/types/components/BaseAutocomplete.vue.d.ts +3 -3
- package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +3 -3
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +3 -3
- package/dist/types/components/BaseBadge.vue.d.ts +3 -3
- package/dist/types/components/BaseBelongsTo.vue.d.ts +3 -3
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +3 -3
- package/dist/types/components/BaseButton.vue.d.ts +6 -0
- package/dist/types/components/BaseButtonGroup.vue.d.ts +3 -3
- package/dist/types/components/BaseCardRow.vue.d.ts +3 -3
- package/dist/types/components/BaseColor.vue.d.ts +3 -3
- package/dist/types/components/BaseContainer.vue.d.ts +47 -30
- package/dist/types/components/BaseDataIterator.vue.d.ts +3 -3
- package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +12 -12
- package/dist/types/components/BaseDataTable.vue.d.ts +3 -3
- package/dist/types/components/BaseDataTableRowAction.vue.d.ts +2 -2
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +3 -3
- package/dist/types/components/BaseDatePicker.vue.d.ts +2 -2
- package/dist/types/components/BaseDateSelect.vue.d.ts +3 -3
- package/dist/types/components/BaseField.vue.d.ts +3 -3
- package/dist/types/components/BaseInput.vue.d.ts +3 -3
- package/dist/types/components/BaseInputError.vue.d.ts +3 -3
- package/dist/types/components/BaseInputLabel.vue.d.ts +3 -3
- package/dist/types/components/BaseJsonReader.vue.d.ts +2 -2
- package/dist/types/components/BaseMenu.vue.d.ts +1 -1
- package/dist/types/components/BasePassword.vue.d.ts +3 -3
- package/dist/types/components/BaseRichText.vue.d.ts +3 -3
- package/dist/types/components/BaseSelect.vue.d.ts +3 -3
- package/dist/types/components/BaseSwitch.vue.d.ts +3 -3
- package/dist/types/components/BaseTableColumn.vue.d.ts +1 -1
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +3 -3
- package/dist/types/components/BaseTextarea.vue.d.ts +3 -3
- package/dist/types/components/BaseTextareaAutoresize.vue.d.ts +3 -3
- package/dist/types/components/BaseTimePicker.vue.d.ts +3 -3
- package/dist/types/composables/field.d.ts +1 -1
- package/dist/types/composables/inputSize.d.ts +1 -1
- package/dist/types/utils/sizeBehaviors.d.ts +4 -0
- package/dist/types/utils/sizes.d.ts +15 -0
- package/package.json +1 -1
- package/src/assets/base-rich-text.css +101 -0
- package/src/components/BaseAddressForm.stories.js +2 -1
- package/src/components/BaseAddressForm.vue +2 -0
- package/src/components/BaseAutocomplete.stories.js +1 -3
- package/src/components/BaseAutocompleteFetch.stories.js +1 -3
- package/src/components/BaseBadge.stories.js +11 -4
- package/src/components/BaseBadge.vue +7 -4
- package/src/components/BaseBelongsTo.stories.js +1 -3
- package/src/components/BaseBelongsToFetch.stories.js +1 -4
- package/src/components/BaseButton.stories.js +1 -8
- package/src/components/BaseButton.vue +29 -21
- package/src/components/BaseButtonGroup.stories.js +1 -3
- package/src/components/BaseButtonGroup.vue +2 -0
- package/src/components/BaseColor.stories.js +1 -3
- package/src/components/BaseContainer.vue +55 -41
- package/src/components/BaseDataIterator.stories.js +1 -2
- package/src/components/BaseDataIteratorSectionButton.vue +1 -1
- package/src/components/BaseDatePicker.stories.js +1 -4
- package/src/components/BaseDatePicker.vue +4 -0
- package/src/components/BaseDateSelect.stories.js +1 -4
- package/src/components/BaseDateSelect.vue +2 -0
- package/src/components/BaseHasMany.stories.js +1 -3
- package/src/components/BaseInput.stories.js +1 -1
- package/src/components/BaseInput.vue +6 -0
- package/src/components/BaseInputError.vue +2 -0
- package/src/components/BaseInputLabel.vue +2 -0
- package/src/components/BaseJsonReader.stories.js +1 -2
- package/src/components/BaseJsonReaderItem.vue +8 -0
- package/src/components/BasePassword.stories.js +1 -3
- package/src/components/BaseRichText.stories.js +1 -2
- package/src/components/BaseRichText.vue +4 -1
- package/src/components/BaseSelect.stories.js +1 -2
- package/src/components/BaseSelect.vue +2 -0
- package/src/components/BaseShortcut.stories.js +2 -4
- package/src/components/BaseSwitch.stories.js +1 -3
- package/src/components/BaseTagAutocomplete.stories.js +1 -3
- package/src/components/BaseTagAutocomplete.vue +12 -0
- package/src/components/BaseTagAutocompleteFetch.stories.js +1 -3
- package/src/components/BaseTextarea.stories.js +1 -4
- package/src/components/BaseTextarea.vue +2 -0
- package/src/components/BaseTextareaAutoresize.stories.js +1 -4
- package/src/components/BaseTextareaAutoresize.vue +6 -4
- package/src/components/BaseTimePicker.stories.js +1 -4
- package/src/components/BaseTimePicker.vue +22 -18
- package/src/stories/PageInputSizes.vue +16 -18
- package/src/utils/sizeBehaviors.ts +4 -0
- package/src/utils/sizes.ts +18 -3
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
4
|
-
:class="[width, { 'px-4': !paddinglessMobile }]"
|
|
3
|
+
:class="classInternal"
|
|
5
4
|
>
|
|
6
5
|
<slot />
|
|
7
6
|
</div>
|
|
8
7
|
</template>
|
|
9
8
|
|
|
10
|
-
<script lang="ts">
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { twMerge } from 'tailwind-merge';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
defineOptions({
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const sizes = {
|
|
18
|
+
lg: 'max-w-lg',
|
|
19
|
+
xl: 'max-w-xl',
|
|
20
|
+
'2xl': 'max-w-2xl',
|
|
21
|
+
'3xl': 'max-w-3xl',
|
|
22
|
+
'4xl': 'max-w-4xl',
|
|
23
|
+
'5xl': 'max-w-5xl',
|
|
24
|
+
'6xl': 'max-w-6xl',
|
|
25
|
+
'7xl': 'max-w-7xl',
|
|
26
|
+
full: 'max-w-full',
|
|
27
|
+
} as { [key: string]: string };
|
|
28
|
+
|
|
29
|
+
type Size = keyof typeof sizes;
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<{
|
|
32
|
+
class?: string | string[];
|
|
33
|
+
size?: Size,
|
|
34
|
+
paddinglessMobile?: boolean;
|
|
35
|
+
fluid?: boolean;
|
|
36
|
+
}>(), {
|
|
37
|
+
class: '',
|
|
38
|
+
size: '7xl',
|
|
39
|
+
paddinglessMobile: false,
|
|
40
|
+
fluid: false,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const widthClass = computed(() => {
|
|
44
|
+
if (props.fluid) {
|
|
45
|
+
return 'max-w-full';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return sizes[props.size] || 'max-w-5xl';
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
const classInternal = computed(() => {
|
|
52
|
+
|
|
53
|
+
const baseClass = 'mx-auto w-full';
|
|
54
|
+
const paddingClass = props.paddinglessMobile ? 'px-0 md:px-8' : 'px-4 md:px-8';
|
|
55
|
+
|
|
56
|
+
return twMerge(
|
|
57
|
+
baseClass,
|
|
58
|
+
paddingClass,
|
|
59
|
+
widthClass.value,
|
|
60
|
+
props.class,
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
50
64
|
</script>
|
|
@@ -3,8 +3,7 @@ import BaseSelect from './BaseSelect.vue';
|
|
|
3
3
|
import BaseCard from './BaseCard.vue';
|
|
4
4
|
import BaseCardRow from './BaseCardRow.vue';
|
|
5
5
|
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
6
|
-
|
|
7
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
6
|
+
import { sizes } from '../../.storybook/utils';
|
|
8
7
|
|
|
9
8
|
export default {
|
|
10
9
|
title: 'Data/BaseDataIterator',
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import BaseDatePicker from './BaseDatePicker.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
3
|
import { DateTime } from 'luxon';
|
|
4
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
5
|
-
|
|
6
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
4
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
7
5
|
|
|
8
6
|
export default {
|
|
9
7
|
title: 'Form/BaseDatePicker',
|
|
@@ -149,7 +147,6 @@ const TemplateSizes = (args) => ({
|
|
|
149
147
|
components: { BaseDatePicker },
|
|
150
148
|
setup() {
|
|
151
149
|
const value = ref(null);
|
|
152
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
153
150
|
return { args, value, sizes };
|
|
154
151
|
},
|
|
155
152
|
template: `
|
|
@@ -312,6 +312,8 @@ const classes = computed(() => {
|
|
|
312
312
|
'xs': 'pl-[1.54rem] pr-5',
|
|
313
313
|
'sm': 'pl-[2.1rem] pr-6',
|
|
314
314
|
'md': 'pl-10 pr-7',
|
|
315
|
+
'lg': 'pl-10 pr-7',
|
|
316
|
+
'xl': 'pl-11 pr-7',
|
|
315
317
|
}[sizeInternal.value];
|
|
316
318
|
|
|
317
319
|
const paddingRight = props.modelValue ? padding : 'pr-0';
|
|
@@ -335,6 +337,8 @@ const iconWrapClasses = computed(() => {
|
|
|
335
337
|
'xs': 'pl-2',
|
|
336
338
|
'sm': 'pl-2.5',
|
|
337
339
|
'md': 'pl-3',
|
|
340
|
+
'lg': 'pl-3',
|
|
341
|
+
'xl': 'pl-3',
|
|
338
342
|
}[sizeInternal.value];
|
|
339
343
|
|
|
340
344
|
return twMerge(
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import BaseDateSelect from './BaseDateSelect.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
4
|
-
|
|
5
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
3
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
6
4
|
|
|
7
5
|
export default {
|
|
8
6
|
title: 'Form/BaseDateSelect',
|
|
@@ -51,7 +49,6 @@ const TemplateSizes = (args) => ({
|
|
|
51
49
|
components: { BaseDateSelect },
|
|
52
50
|
setup() {
|
|
53
51
|
const value = ref(null);
|
|
54
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
55
52
|
return { args, value, sizes };
|
|
56
53
|
},
|
|
57
54
|
template: `
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import BaseHasMany from './BaseHasMany.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
|
-
import { createFieldStory, options } from '../../.storybook/utils';
|
|
3
|
+
import { createFieldStory, options, sizes } from '../../.storybook/utils';
|
|
4
4
|
import BaseAppSnackbars from './BaseAppSnackbars.vue';
|
|
5
5
|
import QueryString from 'qs';
|
|
6
6
|
import { random } from 'lodash';
|
|
7
7
|
|
|
8
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
9
|
-
|
|
10
8
|
export default {
|
|
11
9
|
title: 'Form/BaseHasMany',
|
|
12
10
|
component: BaseHasMany,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseInput from './BaseInput.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
3
|
import { createFieldStory } from '@/../.storybook/utils';
|
|
4
|
+
import { sizes } from '../../.storybook/utils';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Form/BaseInput',
|
|
@@ -172,7 +173,6 @@ const TemplateSizes = (args) => ({
|
|
|
172
173
|
components: { BaseInput },
|
|
173
174
|
setup() {
|
|
174
175
|
const value = ref(null);
|
|
175
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
176
176
|
return { args, value, sizes };
|
|
177
177
|
},
|
|
178
178
|
template: `
|
|
@@ -315,6 +315,8 @@ const baseClasses = computed(() => {
|
|
|
315
315
|
xs: [hasLeftDecoration.value ? 'pl-0' : 'pl-2', hasRightDecoration.value ? 'pr-0' : 'pr-2'],
|
|
316
316
|
sm: [hasLeftDecoration.value ? 'pl-0' : 'pl-2.5', hasRightDecoration.value ? 'pr-0' : 'pr-2.5'],
|
|
317
317
|
md: [hasLeftDecoration.value ? 'pl-0' : 'pl-3', hasRightDecoration.value ? 'pr-1' : 'pr-3'],
|
|
318
|
+
lg: [hasLeftDecoration.value ? 'pl-0' : 'pl-4', hasRightDecoration.value ? 'pr-0' : 'pr-4'],
|
|
319
|
+
xl: [hasLeftDecoration.value ? 'pl-0' : 'pl-5', hasRightDecoration.value ? 'pr-0' : 'pr-5'],
|
|
318
320
|
}[sizeInternal.value];
|
|
319
321
|
|
|
320
322
|
return [
|
|
@@ -331,6 +333,8 @@ const decorationWrapClasses = computed(() => {
|
|
|
331
333
|
xs: 'first:pl-0.5 last:pr-0.5 py-0.5',
|
|
332
334
|
sm: 'first:pl-1 last:pr-1 py-1',
|
|
333
335
|
md: 'first:pl-1 last:pr-1 py-1',
|
|
336
|
+
lg: 'first:pl-1 last:pr-1 py-1.5',
|
|
337
|
+
xl: 'first:pl-1 last:pr-1 py-2',
|
|
334
338
|
}[sizeInternal.value];
|
|
335
339
|
|
|
336
340
|
return [
|
|
@@ -346,6 +350,8 @@ const decorationClasses = computed(() => {
|
|
|
346
350
|
xs: 'p-1',
|
|
347
351
|
sm: 'p-1.5',
|
|
348
352
|
md: 'p-2',
|
|
353
|
+
lg: 'p-1.5',
|
|
354
|
+
xl: 'p-1.5',
|
|
349
355
|
}[sizeInternal.value];
|
|
350
356
|
|
|
351
357
|
return `${base} ${textColor} ${padding}`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { sizes } from '../../.storybook/utils';
|
|
1
2
|
import BaseJsonReader from './BaseJsonReader.vue';
|
|
2
3
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
4
|
|
|
4
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
5
|
-
|
|
6
5
|
export default {
|
|
7
6
|
title: 'Components/BaseJsonReader',
|
|
8
7
|
component: BaseJsonReader,
|
|
@@ -99,6 +99,14 @@ const classSizeChevron = computed(() => {
|
|
|
99
99
|
width: 'w-3.5',
|
|
100
100
|
height: 'h-3.5',
|
|
101
101
|
},
|
|
102
|
+
lg: {
|
|
103
|
+
width: 'w-4',
|
|
104
|
+
height: 'h-4',
|
|
105
|
+
},
|
|
106
|
+
xl: {
|
|
107
|
+
width: 'w-5',
|
|
108
|
+
height: 'h-5',
|
|
109
|
+
},
|
|
102
110
|
};
|
|
103
111
|
|
|
104
112
|
const sizeConfig = chevronSizes[props.size];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { sizes } from '../../.storybook/utils';
|
|
1
2
|
import BasePassword from './BasePassword.vue';
|
|
2
3
|
import { createFieldStory } from '@/../.storybook/utils';
|
|
3
4
|
|
|
4
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
5
|
-
|
|
6
5
|
export default {
|
|
7
6
|
title: 'Form/BasePassword',
|
|
8
7
|
component: BasePassword,
|
|
@@ -67,7 +66,6 @@ const TemplateSizes = (args) => ({
|
|
|
67
66
|
components: { BasePassword },
|
|
68
67
|
setup() {
|
|
69
68
|
const value = ref(null);
|
|
70
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
71
69
|
return { args, value, sizes };
|
|
72
70
|
},
|
|
73
71
|
template: `
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import BaseRichText from './BaseRichText.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
3
|
import { createFieldStory } from '@/../.storybook/utils';
|
|
4
|
-
|
|
5
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
4
|
+
import { sizes } from '../../.storybook/utils';
|
|
6
5
|
|
|
7
6
|
const toolbarOptions = [
|
|
8
7
|
'full',
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
class="base-rich-text relative"
|
|
4
4
|
:class="[
|
|
5
5
|
hasErrorInternal ? 'error' : '',
|
|
6
|
-
sizeInternal == 'sm' ? 'base-rich-text-sm' : '',
|
|
7
6
|
sizeInternal == 'xs' ? 'base-rich-text-xs' : '',
|
|
7
|
+
sizeInternal == 'sm' ? 'base-rich-text-sm' : '',
|
|
8
|
+
sizeInternal == 'md' ? 'base-rich-text-base' : '',
|
|
9
|
+
sizeInternal == 'lg' ? 'base-rich-text-lg' : '',
|
|
10
|
+
sizeInternal == 'xl' ? 'base-rich-text-xl' : '',
|
|
8
11
|
]"
|
|
9
12
|
>
|
|
10
13
|
<quill-editor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseSelect from './BaseSelect.vue';
|
|
2
2
|
import BaseInputLabel from './BaseInputLabel.vue';
|
|
3
3
|
import ShowValue from '../../.storybook/components/ShowValue.vue';
|
|
4
|
-
import { createFieldStory } from '../../.storybook/utils.js';
|
|
4
|
+
import { createFieldStory, sizes } from '../../.storybook/utils.js';
|
|
5
5
|
import { options } from '../../.storybook/utils';
|
|
6
6
|
import { computed } from 'vue';
|
|
7
7
|
|
|
@@ -82,7 +82,6 @@ const TemplateSizes = (args) => ({
|
|
|
82
82
|
components: { BaseSelect },
|
|
83
83
|
setup() {
|
|
84
84
|
const value = ref(null);
|
|
85
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
86
85
|
return { args, value, sizes, options };
|
|
87
86
|
},
|
|
88
87
|
template: `
|
|
@@ -3,8 +3,6 @@ import { palette } from '@/utils/colors';
|
|
|
3
3
|
|
|
4
4
|
const colors = [...Object.keys(palette), '#ff0000', '#dbeafe'];
|
|
5
5
|
|
|
6
|
-
const sizes = ['base', 'lg'];
|
|
7
|
-
|
|
8
6
|
export default {
|
|
9
7
|
title: 'Components/BaseShortcut',
|
|
10
8
|
component: BaseShortcut,
|
|
@@ -42,7 +40,7 @@ Basic.args = {
|
|
|
42
40
|
export const Colors = (args) => ({
|
|
43
41
|
components: { BaseShortcut },
|
|
44
42
|
setup() {
|
|
45
|
-
return { args, colors
|
|
43
|
+
return { args, colors };
|
|
46
44
|
},
|
|
47
45
|
template: `
|
|
48
46
|
<div v-for="color in colors" :key="color">
|
|
@@ -64,7 +62,7 @@ Colors.args = {
|
|
|
64
62
|
export const Contrast = (args) => ({
|
|
65
63
|
components: { BaseShortcut },
|
|
66
64
|
setup() {
|
|
67
|
-
return { args, colors
|
|
65
|
+
return { args, colors };
|
|
68
66
|
},
|
|
69
67
|
template: `
|
|
70
68
|
<div v-for="color in colors" :key="color">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseSwitch from './BaseSwitch.vue';
|
|
2
2
|
import BaseContainer from './BaseContainer.vue';
|
|
3
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
3
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Form/BaseSwitch',
|
|
@@ -82,8 +82,6 @@ const Colors = (args) => ({
|
|
|
82
82
|
export const AllColors = Colors.bind({});
|
|
83
83
|
AllColors.args = {};
|
|
84
84
|
|
|
85
|
-
const sizes = ['xs', 'sm', 'base', 'lg', 'xl'];
|
|
86
|
-
|
|
87
85
|
const Sizes = (args) => ({
|
|
88
86
|
components: {
|
|
89
87
|
BaseSwitch,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { createFieldStory, options } from '../../.storybook/utils';
|
|
1
|
+
import { createFieldStory, options, sizes } from '../../.storybook/utils';
|
|
2
2
|
import BaseTagAutocomplete from './BaseTagAutocomplete.vue';
|
|
3
3
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
4
4
|
import BaseAppSnackbars from './BaseAppSnackbars.vue';
|
|
5
5
|
|
|
6
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
7
|
-
|
|
8
6
|
export default {
|
|
9
7
|
title: 'Form/BaseTagAutocomplete',
|
|
10
8
|
component: BaseTagAutocomplete,
|
|
@@ -428,6 +428,8 @@ const wrapperClass = computed(() => {
|
|
|
428
428
|
'xs': 'min-h-control-xs gap-0.5 p-0.5',
|
|
429
429
|
'sm': 'min-h-control-sm gap-0.5 p-0.5',
|
|
430
430
|
'md': 'min-h-control-md gap-1 p-1',
|
|
431
|
+
'lg': 'min-h-control-lg gap-1 p-1',
|
|
432
|
+
'xl': 'min-h-control-xl gap-1 p-1',
|
|
431
433
|
}[sizeInternal.value];
|
|
432
434
|
|
|
433
435
|
const focus = opened.value ? 'input-focus border-blue-300' : '';
|
|
@@ -440,6 +442,8 @@ const innerHeight = computed(() => {
|
|
|
440
442
|
'xs': 'h-[calc(theme(spacing.control-xs)_-_theme(spacing[0.5])_-_theme(spacing[0.5])_-_2px)]',
|
|
441
443
|
'sm': 'h-[calc(theme(spacing.control-sm)_-_theme(spacing[0.5])_-_theme(spacing[0.5])_-_2px)]',
|
|
442
444
|
'md': 'h-[calc(theme(spacing.control-md)_-_theme(spacing.1)_-_theme(spacing.1)_-_2px)]',
|
|
445
|
+
'lg': 'h-[calc(theme(spacing.control-lg)_-_theme(spacing.1)_-_theme(spacing.1)_-_2px)]',
|
|
446
|
+
'xl': 'h-[calc(theme(spacing.control-xl)_-_theme(spacing.1)_-_theme(spacing.1)_-_2px)]',
|
|
443
447
|
}[sizeInternal.value];
|
|
444
448
|
|
|
445
449
|
return height;
|
|
@@ -455,6 +459,8 @@ const inputClasses = computed(() => {
|
|
|
455
459
|
'xs': 'pl-1.5',
|
|
456
460
|
'sm': 'pl-2',
|
|
457
461
|
'md': 'pl-2.5',
|
|
462
|
+
'lg': 'pl-2.5',
|
|
463
|
+
'xl': 'pl-2.5',
|
|
458
464
|
}[sizeInternal.value];
|
|
459
465
|
|
|
460
466
|
return [base, padding, innerHeight.value, focus, disabled, sizeConfig.fontSize];
|
|
@@ -468,12 +474,16 @@ const selectionClass = (selection: NormalizedOption): string => {
|
|
|
468
474
|
'xs': 'text-xs',
|
|
469
475
|
'sm': 'text-xs',
|
|
470
476
|
'md': 'text-sm',
|
|
477
|
+
'lg': 'text-base',
|
|
478
|
+
'xl': 'text-base',
|
|
471
479
|
}[sizeInternal.value];
|
|
472
480
|
|
|
473
481
|
const padding = {
|
|
474
482
|
'xs': 'pl-2',
|
|
475
483
|
'sm': 'pl-2',
|
|
476
484
|
'md': 'pl-3',
|
|
485
|
+
'lg': 'pl-3',
|
|
486
|
+
'xl': 'pl-4',
|
|
477
487
|
}[sizeInternal.value];
|
|
478
488
|
|
|
479
489
|
let color = 'bg-slate-200 border-slate-300';
|
|
@@ -497,6 +507,8 @@ const selectionDeleteClasses = computed(() => {
|
|
|
497
507
|
'xs': 'pl-1 pr-2',
|
|
498
508
|
'sm': 'pl-1 pr-2',
|
|
499
509
|
'md': 'pl-1 pr-3',
|
|
510
|
+
'lg': 'pl-2 pr-3',
|
|
511
|
+
'xl': 'pl-3 pr-4',
|
|
500
512
|
}[sizeInternal.value];
|
|
501
513
|
|
|
502
514
|
const disabled = props.disabled ? 'cursor-not-allowed opacity-60' : '';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
3
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
4
4
|
import BaseAppSnackbars from './BaseAppSnackbars.vue';
|
|
5
5
|
|
|
6
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
7
|
-
|
|
8
6
|
export default {
|
|
9
7
|
title: 'Form/BaseTagAutocompleteFetch',
|
|
10
8
|
component: BaseTagAutocompleteFetch,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
1
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
2
2
|
import BaseTextarea from './BaseTextarea.vue';
|
|
3
3
|
|
|
4
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
5
|
-
|
|
6
4
|
export default {
|
|
7
5
|
title: 'Form/BaseTextarea',
|
|
8
6
|
component: BaseTextarea,
|
|
@@ -54,7 +52,6 @@ const TemplateSizes = (args) => ({
|
|
|
54
52
|
components: { BaseTextarea },
|
|
55
53
|
setup() {
|
|
56
54
|
const value = ref(null);
|
|
57
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
58
55
|
return { args, value, sizes };
|
|
59
56
|
},
|
|
60
57
|
template: `
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import BaseTextareaAutoresize from './BaseTextareaAutoresize.vue';
|
|
2
2
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
3
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
4
|
-
|
|
5
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
3
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
6
4
|
|
|
7
5
|
export default {
|
|
8
6
|
title: 'Form/BaseTextareaAutoresize',
|
|
@@ -98,7 +96,6 @@ const TemplateSizes = (args) => ({
|
|
|
98
96
|
components: { BaseTextareaAutoresize },
|
|
99
97
|
setup() {
|
|
100
98
|
const value = ref(null);
|
|
101
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
102
99
|
return { args, value, sizes };
|
|
103
100
|
},
|
|
104
101
|
template: `
|
|
@@ -145,7 +145,7 @@ function onFocus(event: FocusEvent) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
const textareaClasses = computed(() => {
|
|
148
|
-
const base = 'input-rounded leading-normal tracking-normal border transition-colors duration-200';
|
|
148
|
+
const base = 'input-rounded leading-normal tracking-normal border transition-colors duration-200 min-h-[1rem]';
|
|
149
149
|
const disabled = 'disabled:cursor-not-allowed disabled:text-slate-300';
|
|
150
150
|
const focus = 'focus:input-focus';
|
|
151
151
|
const error = hasErrorInternal.value ? 'border-red-500 focus:input-focus-error' : 'border-slate-300';
|
|
@@ -153,9 +153,11 @@ const textareaClasses = computed(() => {
|
|
|
153
153
|
const sizeConfig = sizes[sizeInternal.value];
|
|
154
154
|
|
|
155
155
|
const sizeClasses = {
|
|
156
|
-
xs: 'px-2 py-[
|
|
157
|
-
sm: 'px-2.5 py-[
|
|
158
|
-
md: 'px-3 py-[
|
|
156
|
+
xs: 'px-2 py-[4px]',
|
|
157
|
+
sm: 'px-2.5 py-[5px]',
|
|
158
|
+
md: 'px-3 py-[7px]',
|
|
159
|
+
lg: 'px-3 py-[9px]',
|
|
160
|
+
xl: 'px-4 py-[13px]',
|
|
159
161
|
}[sizeInternal.value];
|
|
160
162
|
|
|
161
163
|
return twMerge(
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { createFieldStory } from '../../.storybook/utils';
|
|
1
|
+
import { createFieldStory, sizes } from '../../.storybook/utils';
|
|
2
2
|
import BaseTimePicker from './BaseTimePicker.vue';
|
|
3
3
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
4
4
|
|
|
5
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
6
|
-
|
|
7
5
|
export default {
|
|
8
6
|
title: 'Form/BaseTimePicker',
|
|
9
7
|
component: BaseTimePicker,
|
|
@@ -51,7 +49,6 @@ const TemplateSizes = (args) => ({
|
|
|
51
49
|
components: { BaseTimePicker },
|
|
52
50
|
setup() {
|
|
53
51
|
const value = ref(null);
|
|
54
|
-
const sizes = ['xs', 'sm', 'md'];
|
|
55
52
|
return { args, value, sizes };
|
|
56
53
|
},
|
|
57
54
|
template: `
|