design-system-next 2.8.1 → 2.9.1
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.js +9266 -9121
- package/dist/design-system-next.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/banner/banner.ts +20 -0
- package/src/components/banner/banner.vue +28 -0
- package/src/components/banner/use-banner.ts +96 -0
- package/src/components/calendar/calendar.ts +4 -31
- package/src/components/calendar/calendar.vue +186 -223
- package/src/components/calendar/use-calendar.ts +72 -38
- package/src/components/calendar-cell/use-calendar-cell.ts +0 -1
- package/src/components/list/use-list.ts +10 -6
- package/src/components/select/select-ladderized/select-ladderized.ts +3 -3
- package/src/components/select/select-ladderized/select-ladderized.vue +7 -7
- package/src/components/select/select-ladderized/use-select-ladderized.ts +164 -165
- package/src/components/select/select-multiple/select-multiple.ts +1 -12
- package/src/components/select/select-multiple/select-multiple.vue +17 -72
- package/src/components/select/select-multiple/use-select-multiple.ts +52 -86
- package/src/components/select/select.ts +2 -2
- package/src/components/select/select.vue +12 -12
- package/src/components/select/use-select.ts +31 -26
- package/src/components/snackbar/snack/snack.vue +6 -1
- package/src/components/stepper/step/step.ts +8 -0
- package/src/components/stepper/step/step.vue +3 -1
- package/src/components/stepper/step/use-step.ts +22 -10
- package/src/components/stepper/stepper.ts +9 -0
- package/src/components/stepper/stepper.vue +1 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@click="handleClick"
|
|
7
7
|
>
|
|
8
8
|
<div class="spr-flex spr-flex-auto spr-items-center">
|
|
9
|
+
<slot name="icon">
|
|
9
10
|
<Icon
|
|
10
11
|
v-if="showIcon"
|
|
11
12
|
:icon="snackIcon"
|
|
@@ -13,7 +14,11 @@
|
|
|
13
14
|
:height="iconSize"
|
|
14
15
|
:class="[snackToneCssClass, 'spr-mr-size-spacing-3xs spr-flex-shrink-0']"
|
|
15
16
|
/>
|
|
16
|
-
|
|
17
|
+
</slot>
|
|
18
|
+
|
|
19
|
+
<slot name="label">
|
|
20
|
+
<label>{{ text }}</label>
|
|
21
|
+
</slot>
|
|
17
22
|
</div>
|
|
18
23
|
<template v-if="showAction">
|
|
19
24
|
<slot>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { STEPPER_TYPE } from '../stepper';
|
|
2
3
|
|
|
3
4
|
export const STEP_STATES = ['pending', 'active', 'completed'] as const;
|
|
4
5
|
|
|
@@ -29,6 +30,13 @@ export const stepPropTypes = {
|
|
|
29
30
|
validator: (value: (typeof STEP_STATES)[number]) => STEP_STATES.includes(value),
|
|
30
31
|
default: 'pending',
|
|
31
32
|
},
|
|
33
|
+
/**
|
|
34
|
+
* @description Display type of stepper if displayed as compact (no solid bg color) or solid
|
|
35
|
+
*/
|
|
36
|
+
type: {
|
|
37
|
+
type: String as PropType<(typeof STEPPER_TYPE)[number]>,
|
|
38
|
+
validator: (value: (typeof STEPPER_TYPE)[number]) => STEPPER_TYPE.includes(value),
|
|
39
|
+
}
|
|
32
40
|
};
|
|
33
41
|
|
|
34
42
|
export const stepEmitTypes = {
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
<div :class="stepClasses.baseClass">
|
|
3
3
|
<!-- STEP NUMBER -->
|
|
4
4
|
<div :class="stepClasses.badgeClass">
|
|
5
|
-
<
|
|
5
|
+
<icon v-if="props.status === 'completed' && props.type === 'solid'" icon="ph:check-bold" width="14px" height="14px" class="spr-text-color-inverted-strong"/>
|
|
6
|
+
<span v-else :class="stepClasses.numberClass">
|
|
6
7
|
{{ props.number }}
|
|
7
8
|
</span>
|
|
8
9
|
</div>
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
<script setup lang="ts">
|
|
24
25
|
import { stepEmitTypes, stepPropTypes } from '@/components/stepper/step/step';
|
|
25
26
|
import { useStep } from '@/components/stepper/step/use-step';
|
|
27
|
+
import { Icon } from '@iconify/vue';
|
|
26
28
|
|
|
27
29
|
const props = defineProps(stepPropTypes);
|
|
28
30
|
const emit = defineEmits(stepEmitTypes);
|
|
@@ -16,19 +16,29 @@ interface StepClasses {
|
|
|
16
16
|
export const useStep = (props: StepPropTypes, emit: SetupContext<StepEmitTypes>['emit']) => {
|
|
17
17
|
|
|
18
18
|
const stepClasses: ComputedRef<StepClasses> = computed(() => {
|
|
19
|
-
const baseClass = classNames(
|
|
19
|
+
const baseClass = classNames(
|
|
20
|
+
'spr-flex spr-gap-2 spr-items-top',
|
|
21
|
+
{
|
|
22
|
+
'spr-p-size-spacing-3xs spr-rounded-border-radius-lg': props.type === 'solid',
|
|
23
|
+
'spr-background-color-brand-weak': props.status === 'active' && props.type === 'solid',
|
|
24
|
+
'spr-opacity-60': props.status === 'completed' && props.type === 'solid'
|
|
25
|
+
}
|
|
26
|
+
);
|
|
20
27
|
|
|
21
28
|
// Usage of prop.status ensures reactivity instead of destructuring props
|
|
22
29
|
const badgeClass = classNames(
|
|
23
|
-
'spr-flex spr-items-center spr-justify-center spr-rounded-border-radius-full spr-h-6 spr-w-6 spr-border spr-border-solid
|
|
30
|
+
'spr-flex spr-items-center spr-justify-center spr-rounded-border-radius-full spr-h-6 spr-w-6 spr-border spr-border-solid',
|
|
24
31
|
{
|
|
25
|
-
'spr-
|
|
32
|
+
'spr-border-2': props.type !== 'solid',
|
|
33
|
+
'spr-border-1': props.type === 'solid',
|
|
34
|
+
'spr-background-color-brand-base spr-border-color-brand-base': props.status === 'active',
|
|
26
35
|
'spr-border-mushroom-300': props.status === 'pending',
|
|
27
36
|
'spr-border-kangkong-700': props.status === 'completed',
|
|
37
|
+
'spr-background-color-brand-base': props.status === 'completed' && props.type === 'solid'
|
|
28
38
|
}
|
|
29
39
|
);
|
|
30
40
|
|
|
31
|
-
const numberClass = classNames('spr-
|
|
41
|
+
const numberClass = classNames('spr-body-md-regular-medium',
|
|
32
42
|
{
|
|
33
43
|
'spr-text-white-50': props.status === 'active',
|
|
34
44
|
'spr-text-mushroom-600': props.status === 'pending',
|
|
@@ -36,18 +46,20 @@ export const useStep = (props: StepPropTypes, emit: SetupContext<StepEmitTypes>[
|
|
|
36
46
|
}
|
|
37
47
|
);
|
|
38
48
|
|
|
39
|
-
const textContainerClass = classNames('spr-flex spr-flex-col spr-
|
|
49
|
+
const textContainerClass = classNames('spr-flex spr-flex-col spr-mt-[2px]');
|
|
40
50
|
|
|
41
|
-
const labelClass = classNames('spr-
|
|
51
|
+
const labelClass = classNames('spr-body-md-regular spr-whitespace-nowrap',
|
|
42
52
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
'spr-text-kangkong-700 !spr-body-md-regular-medium': props.status === 'active' && props.type === 'compact',
|
|
54
|
+
'spr-text-mushroom-600': props.status === 'pending',
|
|
55
|
+
'spr-text-mushroom-950': props.status === 'completed',
|
|
46
56
|
}
|
|
47
57
|
);
|
|
48
58
|
|
|
49
59
|
// Absolute since the sample in the figma is a hanging text for description
|
|
50
|
-
const descriptionClass = classNames(
|
|
60
|
+
const descriptionClass = classNames(
|
|
61
|
+
'spr-body-sm-regular spr-text-color-supporting spr-whitespace-nowrap',
|
|
62
|
+
);
|
|
51
63
|
|
|
52
64
|
return {
|
|
53
65
|
baseClass,
|
|
@@ -3,6 +3,7 @@ import type { ExtractPropTypes, PropType } from 'vue';
|
|
|
3
3
|
|
|
4
4
|
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
5
|
const STEPPER_VARIANTS = ['horizontal', 'vertical'] as const;
|
|
6
|
+
export const STEPPER_TYPE = ['compact', 'solid'];
|
|
6
7
|
export const STEPPER_STATES = ['pending', 'active', 'completed'] as const;
|
|
7
8
|
|
|
8
9
|
export const stepperPropTypes = {
|
|
@@ -32,6 +33,14 @@ export const stepperPropTypes = {
|
|
|
32
33
|
hasLines: {
|
|
33
34
|
type: Boolean,
|
|
34
35
|
default: false,
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description Display type of stepper if displayed as compact (no solid bg color) or solid
|
|
39
|
+
*/
|
|
40
|
+
type: {
|
|
41
|
+
type: String as PropType<(typeof STEPPER_TYPE)[number]>,
|
|
42
|
+
validator: (value: (typeof STEPPER_TYPE)[number]) => STEPPER_TYPE.includes(value),
|
|
43
|
+
default: 'compact',
|
|
35
44
|
}
|
|
36
45
|
};
|
|
37
46
|
|