design-system-next 2.19.3 → 2.20.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-next.es.js +11824 -8467
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +13 -13
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +36 -33
- package/package.json +36 -33
- package/src/assets/scripts/border-radius.ts +15 -15
- package/src/assets/scripts/colors.ts +134 -134
- package/src/assets/scripts/max-width.ts +11 -11
- package/src/assets/scripts/spacing.ts +23 -23
- package/src/assets/scripts/utilities.ts +15 -15
- package/src/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.ts +43 -43
- package/src/components/banner/banner.ts +20 -20
- package/src/components/button/button.ts +72 -72
- package/src/components/button/button.vue +15 -15
- package/src/components/card/card.vue +4 -1
- package/src/components/card/use-card.ts +12 -12
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/date-picker.ts +3 -3
- package/src/components/date-picker/tabs/DatePickerCalendarTab.vue +4 -13
- package/src/components/dropdown/dropdown.vue +1 -1
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- package/src/components/empty-state/empty-state.ts +50 -50
- package/src/components/file-upload/file-upload.ts +87 -87
- package/src/components/floating-action/floating-action.ts +12 -12
- package/src/components/input/input-email/input-email.vue +17 -17
- package/src/components/input/input-password/input-password.vue +5 -1
- package/src/components/input/input-search/input-search.vue +13 -13
- package/src/components/input/input-url/input-url.vue +20 -20
- package/src/components/input/input-username/input-username.vue +17 -17
- package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
- package/src/components/list/list.ts +13 -0
- package/src/components/list/list.vue +106 -32
- package/src/components/list/use-list.ts +21 -5
- package/src/components/logo/logo.ts +43 -43
- package/src/components/logo/logo.vue +14 -14
- package/src/components/logo/use-logo.ts +41 -41
- package/src/components/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select-ladderized/select-ladderized.ts +2 -1
- package/src/components/select/select-multiple/select-multiple.ts +20 -0
- package/src/components/select/select-multiple/select-multiple.vue +6 -4
- package/src/components/select/select-multiple/use-select-multiple.ts +87 -54
- package/src/components/sidepanel/sidepanel.vue +55 -55
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
- package/src/components/slider/slider.ts +38 -38
- package/src/components/snackbar/snack/snack.ts +71 -71
- package/src/components/snackbar/use-snackbar.ts +34 -34
- package/src/components/status/status.ts +19 -19
- package/src/components/status/status.vue +13 -13
- package/src/components/stepper/step/step.ts +47 -47
- package/src/components/stepper/stepper.ts +47 -47
- package/src/components/stepper/stepper.vue +34 -34
- package/src/components/switch/switch.ts +42 -42
- package/src/components/table/table-actions/table-actions.ts +42 -42
- package/src/components/table/table-actions/table-actions.vue +40 -40
- package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
- package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
- package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
- package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
- package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
- package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
- package/src/components/tabs/tabs.ts +43 -43
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/stores/useSnackbarStore.ts +44 -44
- package/src/vite-env.d.ts +6 -0
- package/src/vue.d.ts +5 -0
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
const ACCORDION_TRIGGER = ['header', 'button'] as const;
|
|
4
|
-
|
|
5
|
-
export interface AccordionItem {
|
|
6
|
-
title: string;
|
|
7
|
-
subtitle?: string;
|
|
8
|
-
collapseId: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Defines the prop types for the Accordion component.
|
|
13
|
-
*
|
|
14
|
-
* @property accordionItems - An array of accordion items. This property is required and defaults to an empty array.
|
|
15
|
-
* @property alwaysOpen - A boolean indicating whether multiple accordion items can be open at the same time. Defaults to `false`.
|
|
16
|
-
* @property isDefaultOpen - A boolean indicating whether the accordion is open by default. Defaults to `false`. Won't work if alwaysOpen is false.
|
|
17
|
-
*/
|
|
18
|
-
export const accordionPropTypes = {
|
|
19
|
-
accordionItems: {
|
|
20
|
-
type: Array as PropType<AccordionItem[]>,
|
|
21
|
-
required: true,
|
|
22
|
-
default: () => [],
|
|
23
|
-
},
|
|
24
|
-
alwaysOpen: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
isDefaultOpen: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
accordionTrigger: {
|
|
33
|
-
type: String,
|
|
34
|
-
validator: (value: (typeof ACCORDION_TRIGGER)[number]) => ACCORDION_TRIGGER.includes(value),
|
|
35
|
-
default: 'button'
|
|
36
|
-
},
|
|
37
|
-
bordered: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: true
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type AccordionPropTypes = ExtractPropTypes<typeof accordionPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
const ACCORDION_TRIGGER = ['header', 'button'] as const;
|
|
4
|
+
|
|
5
|
+
export interface AccordionItem {
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
collapseId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Defines the prop types for the Accordion component.
|
|
13
|
+
*
|
|
14
|
+
* @property accordionItems - An array of accordion items. This property is required and defaults to an empty array.
|
|
15
|
+
* @property alwaysOpen - A boolean indicating whether multiple accordion items can be open at the same time. Defaults to `false`.
|
|
16
|
+
* @property isDefaultOpen - A boolean indicating whether the accordion is open by default. Defaults to `false`. Won't work if alwaysOpen is false.
|
|
17
|
+
*/
|
|
18
|
+
export const accordionPropTypes = {
|
|
19
|
+
accordionItems: {
|
|
20
|
+
type: Array as PropType<AccordionItem[]>,
|
|
21
|
+
required: true,
|
|
22
|
+
default: () => [],
|
|
23
|
+
},
|
|
24
|
+
alwaysOpen: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
isDefaultOpen: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
accordionTrigger: {
|
|
33
|
+
type: String,
|
|
34
|
+
validator: (value: (typeof ACCORDION_TRIGGER)[number]) => ACCORDION_TRIGGER.includes(value),
|
|
35
|
+
default: 'button'
|
|
36
|
+
},
|
|
37
|
+
bordered: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type AccordionPropTypes = ExtractPropTypes<typeof accordionPropTypes>;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
import type { AccordionPropTypes } from './accordion';
|
|
3
|
-
import { toRefs, reactive, ref } from 'vue';
|
|
4
|
-
|
|
5
|
-
export const useAccordion = (props: AccordionPropTypes) => {
|
|
6
|
-
const { accordionItems, isDefaultOpen, alwaysOpen } = toRefs(props);
|
|
7
|
-
const clickedIndex = ref<number>()
|
|
8
|
-
|
|
9
|
-
const collapsedState = reactive(accordionItems.value.map(() => isDefaultOpen.value && alwaysOpen.value));
|
|
10
|
-
|
|
11
|
-
const toggleCollapse = (index: number) => {
|
|
12
|
-
if (index < 0 || index >= collapsedState.length) return;
|
|
13
|
-
|
|
14
|
-
collapsedState[index] = !collapsedState[index];
|
|
15
|
-
|
|
16
|
-
if (!props.alwaysOpen) {
|
|
17
|
-
collapsedState.forEach((_, i) => {
|
|
18
|
-
if (i !== index) {
|
|
19
|
-
collapsedState[i] = false;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const setClickedIndex = (index: number) => {
|
|
26
|
-
clickedIndex.value = index
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const clearIndex = () => {
|
|
30
|
-
clickedIndex.value = undefined
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
accordionItems,
|
|
35
|
-
isDefaultOpen,
|
|
36
|
-
alwaysOpen,
|
|
37
|
-
collapsedState,
|
|
38
|
-
toggleCollapse,
|
|
39
|
-
setClickedIndex,
|
|
40
|
-
clearIndex,
|
|
41
|
-
clickedIndex
|
|
42
|
-
}
|
|
43
|
-
};
|
|
1
|
+
|
|
2
|
+
import type { AccordionPropTypes } from './accordion';
|
|
3
|
+
import { toRefs, reactive, ref } from 'vue';
|
|
4
|
+
|
|
5
|
+
export const useAccordion = (props: AccordionPropTypes) => {
|
|
6
|
+
const { accordionItems, isDefaultOpen, alwaysOpen } = toRefs(props);
|
|
7
|
+
const clickedIndex = ref<number>()
|
|
8
|
+
|
|
9
|
+
const collapsedState = reactive(accordionItems.value.map(() => isDefaultOpen.value && alwaysOpen.value));
|
|
10
|
+
|
|
11
|
+
const toggleCollapse = (index: number) => {
|
|
12
|
+
if (index < 0 || index >= collapsedState.length) return;
|
|
13
|
+
|
|
14
|
+
collapsedState[index] = !collapsedState[index];
|
|
15
|
+
|
|
16
|
+
if (!props.alwaysOpen) {
|
|
17
|
+
collapsedState.forEach((_, i) => {
|
|
18
|
+
if (i !== index) {
|
|
19
|
+
collapsedState[i] = false;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const setClickedIndex = (index: number) => {
|
|
26
|
+
clickedIndex.value = index
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const clearIndex = () => {
|
|
30
|
+
clickedIndex.value = undefined
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
accordionItems,
|
|
35
|
+
isDefaultOpen,
|
|
36
|
+
alwaysOpen,
|
|
37
|
+
collapsedState,
|
|
38
|
+
toggleCollapse,
|
|
39
|
+
setClickedIndex,
|
|
40
|
+
clearIndex,
|
|
41
|
+
clickedIndex
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const BANNER_TYPE = ['success', 'error', 'info', 'pending', 'caution'] as const;
|
|
4
|
-
|
|
5
|
-
export const bannerProps = {
|
|
6
|
-
type: {
|
|
7
|
-
type: String as PropType<(typeof BANNER_TYPE)[number]>,
|
|
8
|
-
validator: (value: (typeof BANNER_TYPE)[number]) => BANNER_TYPE.includes(value),
|
|
9
|
-
default: 'success',
|
|
10
|
-
},
|
|
11
|
-
showCloseButton: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: false,
|
|
14
|
-
},
|
|
15
|
-
message: {
|
|
16
|
-
type: String,
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type BannerPropTypes = ExtractPropTypes<typeof bannerProps>;
|
|
1
|
+
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const BANNER_TYPE = ['success', 'error', 'info', 'pending', 'caution'] as const;
|
|
4
|
+
|
|
5
|
+
export const bannerProps = {
|
|
6
|
+
type: {
|
|
7
|
+
type: String as PropType<(typeof BANNER_TYPE)[number]>,
|
|
8
|
+
validator: (value: (typeof BANNER_TYPE)[number]) => BANNER_TYPE.includes(value),
|
|
9
|
+
default: 'success',
|
|
10
|
+
},
|
|
11
|
+
showCloseButton: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
message: {
|
|
16
|
+
type: String,
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type BannerPropTypes = ExtractPropTypes<typeof bannerProps>;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
const BUTTON_TONES = ['neutral', 'success', 'danger'] as const;
|
|
6
|
-
const BUTTON_SIZES = ['small', 'medium', 'large'] as const;
|
|
7
|
-
const BUTTON_TYPES = ['button', 'submit', 'reset'] as const;
|
|
8
|
-
const BUTTON_STATES = ['base', 'hover', 'pressed', 'focus'] as const;
|
|
9
|
-
const BUTTON_VARIANTS = ['primary', 'secondary', 'tertiary'] as const;
|
|
10
|
-
|
|
11
|
-
export const buttonPropTypes = {
|
|
12
|
-
/**
|
|
13
|
-
* @description Button tone
|
|
14
|
-
*/
|
|
15
|
-
tone: {
|
|
16
|
-
type: String as PropType<(typeof BUTTON_TONES)[number]>,
|
|
17
|
-
validator: (value: (typeof BUTTON_TONES)[number]) => BUTTON_TONES.includes(value),
|
|
18
|
-
default: 'neutral',
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* @description Button size
|
|
22
|
-
*/
|
|
23
|
-
size: {
|
|
24
|
-
type: String as PropType<(typeof BUTTON_SIZES)[number]>,
|
|
25
|
-
validator: (value: (typeof BUTTON_SIZES)[number]) => BUTTON_SIZES.includes(value),
|
|
26
|
-
default: 'medium',
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* @description Native button type
|
|
30
|
-
*/
|
|
31
|
-
type: {
|
|
32
|
-
type: String as PropType<(typeof BUTTON_TYPES)[number]>,
|
|
33
|
-
validator: (value: (typeof BUTTON_TYPES)[number]) => BUTTON_TYPES.includes(value),
|
|
34
|
-
default: 'button',
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* @description Button state
|
|
38
|
-
*/
|
|
39
|
-
state: {
|
|
40
|
-
type: String as PropType<(typeof BUTTON_STATES)[number]>,
|
|
41
|
-
validator: (value: (typeof BUTTON_STATES)[number]) => BUTTON_STATES.includes(value),
|
|
42
|
-
default: 'base',
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* @description Button Variant
|
|
46
|
-
*/
|
|
47
|
-
variant: {
|
|
48
|
-
type: String as PropType<(typeof BUTTON_VARIANTS)[number]>,
|
|
49
|
-
validator: (value: (typeof BUTTON_VARIANTS)[number]) => BUTTON_VARIANTS.includes(value),
|
|
50
|
-
default: 'primary',
|
|
51
|
-
},
|
|
52
|
-
disabled: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
hasIcon: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
fullwidth: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const buttonEmitTypes = {
|
|
67
|
-
click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type ButtonPropTypes = ExtractPropTypes<typeof buttonPropTypes>;
|
|
71
|
-
export type ButtonEmitTypes = typeof buttonEmitTypes;
|
|
72
|
-
export type ButtonType = ButtonPropTypes['type'];
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
const BUTTON_TONES = ['neutral', 'success', 'danger'] as const;
|
|
6
|
+
const BUTTON_SIZES = ['small', 'medium', 'large'] as const;
|
|
7
|
+
const BUTTON_TYPES = ['button', 'submit', 'reset'] as const;
|
|
8
|
+
const BUTTON_STATES = ['base', 'hover', 'pressed', 'focus'] as const;
|
|
9
|
+
const BUTTON_VARIANTS = ['primary', 'secondary', 'tertiary'] as const;
|
|
10
|
+
|
|
11
|
+
export const buttonPropTypes = {
|
|
12
|
+
/**
|
|
13
|
+
* @description Button tone
|
|
14
|
+
*/
|
|
15
|
+
tone: {
|
|
16
|
+
type: String as PropType<(typeof BUTTON_TONES)[number]>,
|
|
17
|
+
validator: (value: (typeof BUTTON_TONES)[number]) => BUTTON_TONES.includes(value),
|
|
18
|
+
default: 'neutral',
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description Button size
|
|
22
|
+
*/
|
|
23
|
+
size: {
|
|
24
|
+
type: String as PropType<(typeof BUTTON_SIZES)[number]>,
|
|
25
|
+
validator: (value: (typeof BUTTON_SIZES)[number]) => BUTTON_SIZES.includes(value),
|
|
26
|
+
default: 'medium',
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description Native button type
|
|
30
|
+
*/
|
|
31
|
+
type: {
|
|
32
|
+
type: String as PropType<(typeof BUTTON_TYPES)[number]>,
|
|
33
|
+
validator: (value: (typeof BUTTON_TYPES)[number]) => BUTTON_TYPES.includes(value),
|
|
34
|
+
default: 'button',
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* @description Button state
|
|
38
|
+
*/
|
|
39
|
+
state: {
|
|
40
|
+
type: String as PropType<(typeof BUTTON_STATES)[number]>,
|
|
41
|
+
validator: (value: (typeof BUTTON_STATES)[number]) => BUTTON_STATES.includes(value),
|
|
42
|
+
default: 'base',
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @description Button Variant
|
|
46
|
+
*/
|
|
47
|
+
variant: {
|
|
48
|
+
type: String as PropType<(typeof BUTTON_VARIANTS)[number]>,
|
|
49
|
+
validator: (value: (typeof BUTTON_VARIANTS)[number]) => BUTTON_VARIANTS.includes(value),
|
|
50
|
+
default: 'primary',
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
hasIcon: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
fullwidth: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const buttonEmitTypes = {
|
|
67
|
+
click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type ButtonPropTypes = ExtractPropTypes<typeof buttonPropTypes>;
|
|
71
|
+
export type ButtonEmitTypes = typeof buttonEmitTypes;
|
|
72
|
+
export type ButtonType = ButtonPropTypes['type'];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button ref="buttonRef" :class="buttonClassses" v-bind="buttonProps" @click="handleClick">
|
|
3
|
-
<slot />
|
|
4
|
-
</button>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts" setup>
|
|
8
|
-
import { buttonEmitTypes, buttonPropTypes } from './button';
|
|
9
|
-
import { useButton } from './use-button';
|
|
10
|
-
|
|
11
|
-
const props = defineProps(buttonPropTypes);
|
|
12
|
-
const emit = defineEmits(buttonEmitTypes);
|
|
13
|
-
|
|
14
|
-
const { buttonRef, buttonClassses, buttonProps, handleClick } = useButton(props, emit);
|
|
15
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<button ref="buttonRef" :class="buttonClassses" v-bind="buttonProps" @click="handleClick">
|
|
3
|
+
<slot />
|
|
4
|
+
</button>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { buttonEmitTypes, buttonPropTypes } from './button';
|
|
9
|
+
import { useButton } from './use-button';
|
|
10
|
+
|
|
11
|
+
const props = defineProps(buttonPropTypes);
|
|
12
|
+
const emit = defineEmits(buttonEmitTypes);
|
|
13
|
+
|
|
14
|
+
const { buttonRef, buttonClassses, buttonProps, handleClick } = useButton(props, emit);
|
|
15
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="cardClasses.baseClasses" :style="{ borderWidth: props.borderWidth }">
|
|
2
|
+
<div v-bind="id ? { id } : {}" :class="cardClasses.baseClasses" :style="{ borderWidth: props.borderWidth }">
|
|
3
3
|
<div v-if="props.showHeader && ($slots.header || props.title)" :class="cardClasses.headerClasses">
|
|
4
4
|
<div v-if="props.title" class="spr-flex spr-items-center">
|
|
5
5
|
<Icon
|
|
@@ -41,5 +41,8 @@ import { useCard } from './use-card';
|
|
|
41
41
|
const props = defineProps(cardPropTypes);
|
|
42
42
|
const slots = useSlots();
|
|
43
43
|
|
|
44
|
+
// Destructure id for template usage
|
|
45
|
+
const { id } = props;
|
|
46
|
+
|
|
44
47
|
const { cardClasses } = useCard(props, slots);
|
|
45
48
|
</script>
|
|
@@ -50,10 +50,10 @@ export const useCard = (props: CardPropTypes, slots: Slots) => {
|
|
|
50
50
|
'spr-border-color-danger-base': toneValue === 'danger',
|
|
51
51
|
|
|
52
52
|
// Border radius
|
|
53
|
-
'spr-rounded-border-radius-2xs': borderRadiusSize.value === '
|
|
54
|
-
'spr-rounded-border-radius-xs': borderRadiusSize.value === '
|
|
55
|
-
'spr-rounded-border-radius-sm': borderRadiusSize.value === '
|
|
56
|
-
'spr-rounded-border-radius-md': borderRadiusSize.value === '
|
|
53
|
+
'spr-rounded-border-radius-2xs': borderRadiusSize.value === '2xs',
|
|
54
|
+
'spr-rounded-border-radius-xs': borderRadiusSize.value === 'xs',
|
|
55
|
+
'spr-rounded-border-radius-sm': borderRadiusSize.value === 'sm',
|
|
56
|
+
'spr-rounded-border-radius-md': borderRadiusSize.value === 'md',
|
|
57
57
|
'spr-rounded-border-radius-lg': borderRadiusSize.value === 'lg',
|
|
58
58
|
'spr-rounded-border-radius-xl': borderRadiusSize.value === 'xl' || !borderRadiusSize.value,
|
|
59
59
|
|
|
@@ -67,10 +67,10 @@ export const useCard = (props: CardPropTypes, slots: Slots) => {
|
|
|
67
67
|
(title.value || headerIcon.value) && (slots.content || slots.default),
|
|
68
68
|
'spr-border-transparent': hasCollapsible.value && !isCollapsibleOpen.value,
|
|
69
69
|
'spr-py-size-spacing-2xs spr-px-size-spacing-xs': title.value || headerIcon.value,
|
|
70
|
-
'spr-rounded-t-border-radius-2xs': borderRadiusSize.value === '
|
|
71
|
-
'spr-rounded-t-border-radius-xs': borderRadiusSize.value === '
|
|
72
|
-
'spr-rounded-t-border-radius-sm': borderRadiusSize.value === '
|
|
73
|
-
'spr-rounded-t-border-radius-md': borderRadiusSize.value === '
|
|
70
|
+
'spr-rounded-t-border-radius-2xs': borderRadiusSize.value === '2xs',
|
|
71
|
+
'spr-rounded-t-border-radius-xs': borderRadiusSize.value === 'xs',
|
|
72
|
+
'spr-rounded-t-border-radius-sm': borderRadiusSize.value === 'sm',
|
|
73
|
+
'spr-rounded-t-border-radius-md': borderRadiusSize.value === 'md',
|
|
74
74
|
'spr-rounded-t-border-radius-lg': borderRadiusSize.value === 'lg',
|
|
75
75
|
'spr-rounded-t-border-radius-xl': borderRadiusSize.value === 'xl' || !borderRadiusSize.value,
|
|
76
76
|
});
|
|
@@ -82,10 +82,10 @@ export const useCard = (props: CardPropTypes, slots: Slots) => {
|
|
|
82
82
|
const footerClasses = classNames(
|
|
83
83
|
`spr-flex spr-items-center spr-border-0 spr-border-t spr-border-solid spr-border-mushroom-200 spr-py-size-spacing-2xs spr-px-size-spacing-xs`,
|
|
84
84
|
{
|
|
85
|
-
'spr-rounded-b-border-radius-2xs': borderRadiusSize.value === '
|
|
86
|
-
'spr-rounded-b-border-radius-xs': borderRadiusSize.value === '
|
|
87
|
-
'spr-rounded-b-border-radius-sm': borderRadiusSize.value === '
|
|
88
|
-
'spr-rounded-b-border-radius-md': borderRadiusSize.value === '
|
|
85
|
+
'spr-rounded-b-border-radius-2xs': borderRadiusSize.value === '2xs',
|
|
86
|
+
'spr-rounded-b-border-radius-xs': borderRadiusSize.value === 'xs',
|
|
87
|
+
'spr-rounded-b-border-radius-sm': borderRadiusSize.value === 'sm',
|
|
88
|
+
'spr-rounded-b-border-radius-md': borderRadiusSize.value === 'md',
|
|
89
89
|
'spr-rounded-b-border-radius-lg': borderRadiusSize.value === 'lg',
|
|
90
90
|
'spr-rounded-b-border-radius-xl': borderRadiusSize.value === 'xl' || !borderRadiusSize.value,
|
|
91
91
|
},
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const checkboxPropTypes = {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: false,
|
|
9
|
-
},
|
|
10
|
-
label: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: '',
|
|
13
|
-
},
|
|
14
|
-
description: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: '',
|
|
17
|
-
},
|
|
18
|
-
disabled: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
checked: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false,
|
|
25
|
-
},
|
|
26
|
-
indeterminate: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false,
|
|
29
|
-
},
|
|
30
|
-
bordered: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false,
|
|
33
|
-
},
|
|
34
|
-
fullWidth: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false,
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const checkboxEmitTypes = {
|
|
41
|
-
'update:modelValue': (value: boolean) => typeof value === 'boolean',
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type CheckboxPropTypes = ExtractPropTypes<typeof checkboxPropTypes>;
|
|
45
|
-
export type CheckboxEmitTypes = typeof checkboxEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const checkboxPropTypes = {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
},
|
|
10
|
+
label: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
checked: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
indeterminate: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
bordered: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
fullWidth: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const checkboxEmitTypes = {
|
|
41
|
+
'update:modelValue': (value: boolean) => typeof value === 'boolean',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type CheckboxPropTypes = ExtractPropTypes<typeof checkboxPropTypes>;
|
|
45
|
+
export type CheckboxEmitTypes = typeof checkboxEmitTypes;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from "vue";
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const collapsiblePropTypes = {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
transitionDuration: {
|
|
11
|
-
type: Number,
|
|
12
|
-
default: 150, // Default transition duration in milliseconds
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const collapsibleEmitTypes = {
|
|
17
|
-
'update:modelValue': (value: boolean) => typeof value === 'boolean',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type CollapsibleEmitTypes = typeof collapsibleEmitTypes
|
|
21
|
-
export type CollapsibleProps = ExtractPropTypes<typeof collapsiblePropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from "vue";
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const collapsiblePropTypes = {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
transitionDuration: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 150, // Default transition duration in milliseconds
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const collapsibleEmitTypes = {
|
|
17
|
+
'update:modelValue': (value: boolean) => typeof value === 'boolean',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type CollapsibleEmitTypes = typeof collapsibleEmitTypes
|
|
21
|
+
export type CollapsibleProps = ExtractPropTypes<typeof collapsiblePropTypes>;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="collapsibleClasses.container">
|
|
3
|
-
<slot name="trigger" :toggle-collapsible="toggleCollapsible" />
|
|
4
|
-
<Transition
|
|
5
|
-
:css="false"
|
|
6
|
-
@before-enter="onBeforeEnter"
|
|
7
|
-
@enter="onEnter"
|
|
8
|
-
@before-leave="onBeforeLeave"
|
|
9
|
-
@leave="onLeave"
|
|
10
|
-
>
|
|
11
|
-
<div v-show="modelValue" :style="contentStyle">
|
|
12
|
-
<slot />
|
|
13
|
-
</div>
|
|
14
|
-
</Transition>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { collapsiblePropTypes, collapsibleEmitTypes } from './collapsible';
|
|
20
|
-
import { useCollapsible } from './use-collapsible';
|
|
21
|
-
|
|
22
|
-
const props = defineProps(collapsiblePropTypes);
|
|
23
|
-
const emit = defineEmits(collapsibleEmitTypes);
|
|
24
|
-
|
|
25
|
-
const { collapsibleClasses, contentStyle, toggleCollapsible, onBeforeEnter, onEnter, onBeforeLeave, onLeave } =
|
|
26
|
-
useCollapsible(props, emit);
|
|
27
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="collapsibleClasses.container">
|
|
3
|
+
<slot name="trigger" :toggle-collapsible="toggleCollapsible" />
|
|
4
|
+
<Transition
|
|
5
|
+
:css="false"
|
|
6
|
+
@before-enter="onBeforeEnter"
|
|
7
|
+
@enter="onEnter"
|
|
8
|
+
@before-leave="onBeforeLeave"
|
|
9
|
+
@leave="onLeave"
|
|
10
|
+
>
|
|
11
|
+
<div v-show="modelValue" :style="contentStyle">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</Transition>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { collapsiblePropTypes, collapsibleEmitTypes } from './collapsible';
|
|
20
|
+
import { useCollapsible } from './use-collapsible';
|
|
21
|
+
|
|
22
|
+
const props = defineProps(collapsiblePropTypes);
|
|
23
|
+
const emit = defineEmits(collapsibleEmitTypes);
|
|
24
|
+
|
|
25
|
+
const { collapsibleClasses, contentStyle, toggleCollapsible, onBeforeEnter, onEnter, onBeforeLeave, onLeave } =
|
|
26
|
+
useCollapsible(props, emit);
|
|
27
|
+
</script>
|
|
@@ -172,9 +172,9 @@ export interface TabComponentProps {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export interface CalendarTabEmits {
|
|
175
|
-
'update:date':
|
|
176
|
-
'update:month':
|
|
177
|
-
'update:year':
|
|
175
|
+
'update:date': [day: { date: Date; inactive: boolean }];
|
|
176
|
+
'update:month': [month: number];
|
|
177
|
+
'update:year': [year: number];
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export interface MonthTabEmits {
|