design-system-next 2.20.1 → 2.20.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.
Files changed (74) hide show
  1. package/dist/design-system-next.es.js +6863 -6804
  2. package/dist/design-system-next.es.js.gz +0 -0
  3. package/dist/design-system-next.umd.js +12 -12
  4. package/dist/design-system-next.umd.js.gz +0 -0
  5. package/dist/main.css +1 -1
  6. package/dist/main.css.gz +0 -0
  7. package/dist/package.json.d.ts +3 -2
  8. package/package.json +3 -2
  9. package/src/App.vue +51 -1
  10. package/src/assets/scripts/border-radius.ts +15 -15
  11. package/src/assets/scripts/colors.ts +134 -134
  12. package/src/assets/scripts/max-width.ts +11 -11
  13. package/src/assets/scripts/spacing.ts +23 -23
  14. package/src/assets/scripts/utilities.ts +15 -15
  15. package/src/components/accordion/accordion.ts +43 -43
  16. package/src/components/accordion/use-accordion.ts +43 -43
  17. package/src/components/banner/banner.ts +20 -20
  18. package/src/components/button/button.ts +72 -72
  19. package/src/components/button/button.vue +15 -15
  20. package/src/components/checkbox/checkbox.ts +45 -45
  21. package/src/components/collapsible/collapsible.ts +21 -21
  22. package/src/components/collapsible/collapsible.vue +27 -27
  23. package/src/components/dropdown/fix-multi-number.ts +92 -92
  24. package/src/components/empty-state/empty-state.ts +50 -50
  25. package/src/components/floating-action/floating-action.ts +12 -12
  26. package/src/components/input/input-email/input-email.vue +17 -17
  27. package/src/components/input/input-search/input-search.vue +13 -13
  28. package/src/components/input/input-url/input-url.vue +20 -20
  29. package/src/components/input/input-username/input-username.vue +17 -17
  30. package/src/components/list/ladderized-list/ladderized-list.ts +47 -39
  31. package/src/components/list/ladderized-list/ladderized-list.vue +2 -0
  32. package/src/components/list/list-item/list-item.ts +48 -0
  33. package/src/components/list/list-item/list-item.vue +108 -0
  34. package/src/components/list/list-item/use-list-item.ts +36 -0
  35. package/src/components/list/list.ts +4 -0
  36. package/src/components/list/list.vue +68 -254
  37. package/src/components/list/use-list.ts +19 -5
  38. package/src/components/logo/logo.ts +43 -43
  39. package/src/components/logo/logo.vue +14 -14
  40. package/src/components/logo/use-logo.ts +41 -41
  41. package/src/components/lozenge/lozenge.ts +4 -18
  42. package/src/components/lozenge/lozenge.vue +14 -4
  43. package/src/components/lozenge/use-lozenge.ts +6 -0
  44. package/src/components/radio/radio.ts +42 -42
  45. package/src/components/select/select-ladderized/select-ladderized.ts +13 -1
  46. package/src/components/select/select-ladderized/select-ladderized.vue +5 -5
  47. package/src/components/select/select-multiple/select-multiple.ts +16 -2
  48. package/src/components/select/select-multiple/select-multiple.vue +5 -6
  49. package/src/components/select/select.ts +12 -1
  50. package/src/components/select/select.vue +21 -11
  51. package/src/components/sidepanel/sidepanel.vue +55 -55
  52. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
  53. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
  54. package/src/components/slider/slider.ts +38 -38
  55. package/src/components/snackbar/snack/snack.ts +71 -71
  56. package/src/components/snackbar/use-snackbar.ts +34 -34
  57. package/src/components/status/status.ts +19 -19
  58. package/src/components/status/status.vue +13 -13
  59. package/src/components/stepper/step/step.ts +47 -47
  60. package/src/components/stepper/stepper.ts +47 -47
  61. package/src/components/stepper/stepper.vue +34 -34
  62. package/src/components/switch/switch.ts +42 -42
  63. package/src/components/table/table-actions/table-actions.ts +42 -42
  64. package/src/components/table/table-actions/table-actions.vue +40 -40
  65. package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
  66. package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
  67. package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
  68. package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
  69. package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
  70. package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
  71. package/src/components/tabs/tabs.ts +43 -43
  72. package/src/components/time-picker/time-picker.ts +69 -69
  73. package/src/components/tooltip/use-tooltip.ts +13 -13
  74. package/src/stores/useSnackbarStore.ts +44 -44
@@ -1,39 +1,39 @@
1
- <template>
2
- <div v-if="activePanels.length > 0" :class="stackingSidepanelClasses.sidepanelStackBackdropClasses"></div>
3
- <div
4
- ref="stacking-sidepanel-base"
5
- :class="[stackingSidepanelClasses.sidepanelStackBaseClasses]"
6
- :style="stackingSidepanelBaseTransform"
7
- >
8
- <transition-group
9
- :enter-active-class="stackingSidepanelClasses.sidepanelStackTransitionEnterActiveClasses"
10
- :leave-active-class="stackingSidepanelClasses.sidepanelStackTransitionLeaveActiveClasses"
11
- :move-class="stackingSidepanelClasses.sidepanelStackMoveClasses"
12
- :enter-from-class="stackingSidepanelClasses.sidepanelStackEnterFromClasses"
13
- :leave-to-class="stackingSidepanelClasses.sidepanelStackLeaveToClasses"
14
- appear
15
- >
16
- <div v-for="name in activePanels" :key="name">
17
- <slot :name="name" />
18
- </div>
19
- </transition-group>
20
- </div>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import { useTemplateRef } from 'vue';
25
- import { useStackingSidepanel } from './use-stacking-sidepanel';
26
- import { stackingSidePanelProps, stackingSidePanelEmits } from './stacking-sidepanel';
27
-
28
- const stackingSidepanelBase = useTemplateRef('stacking-sidepanel-base');
29
- const props = defineProps(stackingSidePanelProps);
30
- const emits = defineEmits(stackingSidePanelEmits);
31
-
32
- const { showPanel, hidePanel, stackingSidepanelClasses, stackingSidepanelBaseTransform, activePanels } =
33
- useStackingSidepanel(props, emits, stackingSidepanelBase);
34
-
35
- defineExpose({
36
- showPanel,
37
- hidePanel,
38
- });
39
- </script>
1
+ <template>
2
+ <div v-if="activePanels.length > 0" :class="stackingSidepanelClasses.sidepanelStackBackdropClasses"></div>
3
+ <div
4
+ ref="stacking-sidepanel-base"
5
+ :class="[stackingSidepanelClasses.sidepanelStackBaseClasses]"
6
+ :style="stackingSidepanelBaseTransform"
7
+ >
8
+ <transition-group
9
+ :enter-active-class="stackingSidepanelClasses.sidepanelStackTransitionEnterActiveClasses"
10
+ :leave-active-class="stackingSidepanelClasses.sidepanelStackTransitionLeaveActiveClasses"
11
+ :move-class="stackingSidepanelClasses.sidepanelStackMoveClasses"
12
+ :enter-from-class="stackingSidepanelClasses.sidepanelStackEnterFromClasses"
13
+ :leave-to-class="stackingSidepanelClasses.sidepanelStackLeaveToClasses"
14
+ appear
15
+ >
16
+ <div v-for="name in activePanels" :key="name">
17
+ <slot :name="name" />
18
+ </div>
19
+ </transition-group>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import { useTemplateRef } from 'vue';
25
+ import { useStackingSidepanel } from './use-stacking-sidepanel';
26
+ import { stackingSidePanelProps, stackingSidePanelEmits } from './stacking-sidepanel';
27
+
28
+ const stackingSidepanelBase = useTemplateRef('stacking-sidepanel-base');
29
+ const props = defineProps(stackingSidePanelProps);
30
+ const emits = defineEmits(stackingSidePanelEmits);
31
+
32
+ const { showPanel, hidePanel, stackingSidepanelClasses, stackingSidepanelBaseTransform, activePanels } =
33
+ useStackingSidepanel(props, emits, stackingSidepanelBase);
34
+
35
+ defineExpose({
36
+ showPanel,
37
+ hidePanel,
38
+ });
39
+ </script>
@@ -1,38 +1,38 @@
1
- import type { PropType, ExtractPropTypes } from 'vue';
2
- const SLIDER_SIZES = ['sm','lg'] as const;
3
-
4
- export const sliderPropTypes = {
5
- size: {
6
- type: String as PropType<(typeof SLIDER_SIZES)[number]>,
7
- validator: (value: (typeof SLIDER_SIZES)[number]) => SLIDER_SIZES.includes(value),
8
- default: 'lg',
9
- },
10
- min: {
11
- type: Number,
12
- default: 0,
13
- },
14
- max: {
15
- type: Number,
16
- default: 100,
17
- },
18
- step: {
19
- type: Number,
20
- default: 1,
21
- },
22
- modelValue: {
23
- type: Number,
24
- default: 0,
25
- },
26
- disabled: {
27
- type: Boolean,
28
- default: false,
29
- }
30
- };
31
-
32
- export const sliderEmits = {
33
- 'update:modelValue': (value: number): value is number => typeof value === 'number',
34
- slideend: (value: number): value is number => typeof value === 'number',
35
- };
36
-
37
- export type SliderPropTypes = ExtractPropTypes<typeof sliderPropTypes>;
38
- export type SliderEmitTypes = typeof sliderEmits;
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+ const SLIDER_SIZES = ['sm','lg'] as const;
3
+
4
+ export const sliderPropTypes = {
5
+ size: {
6
+ type: String as PropType<(typeof SLIDER_SIZES)[number]>,
7
+ validator: (value: (typeof SLIDER_SIZES)[number]) => SLIDER_SIZES.includes(value),
8
+ default: 'lg',
9
+ },
10
+ min: {
11
+ type: Number,
12
+ default: 0,
13
+ },
14
+ max: {
15
+ type: Number,
16
+ default: 100,
17
+ },
18
+ step: {
19
+ type: Number,
20
+ default: 1,
21
+ },
22
+ modelValue: {
23
+ type: Number,
24
+ default: 0,
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false,
29
+ }
30
+ };
31
+
32
+ export const sliderEmits = {
33
+ 'update:modelValue': (value: number): value is number => typeof value === 'number',
34
+ slideend: (value: number): value is number => typeof value === 'number',
35
+ };
36
+
37
+ export type SliderPropTypes = ExtractPropTypes<typeof sliderPropTypes>;
38
+ export type SliderEmitTypes = typeof sliderEmits;
@@ -1,71 +1,71 @@
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 SNACKBAR_TONES = ['success', 'information', 'danger', 'caution'] as const;
6
- type ActionIconProps = {
7
- icon: string;
8
- tone: 'neutral' | 'success' | 'danger'
9
- }
10
-
11
- export const snackPropTypes = {
12
- /**
13
- * @description Text label shown in snack
14
- */
15
- text: {
16
- type: String,
17
- required: true,
18
- },
19
- /**
20
- * @description Snack tone either as 'success', 'information', 'danger', 'caution'
21
- */
22
- tone: {
23
- type: String as PropType<(typeof SNACKBAR_TONES)[number]>,
24
- validator: (value: (typeof SNACKBAR_TONES)[number]) => SNACKBAR_TONES.includes(value),
25
- default: 'information',
26
- },
27
- /**
28
- * @description To show action label in snack. Default is false
29
- */
30
- showAction: {
31
- type: Boolean,
32
- default: false,
33
- },
34
- /**
35
- * @description Text label for the action function.
36
- */
37
- actionText: {
38
- type: String,
39
- default: "action",
40
- },
41
- /**
42
- * @description On click function of the action text.
43
- */
44
- action: {
45
- type: Function,
46
- default: () => {},
47
- },
48
- /**
49
- * @description To show icon in snack. Default is false.
50
- */
51
- showIcon: {
52
- type: Boolean,
53
- default: false,
54
- },
55
- /**
56
- * @description Duration to show snack. Default is 4000 ms (4s) declared on store
57
- */
58
- duration: {
59
- type: Number,
60
- },
61
- actionIconProps: {
62
- type: Object as PropType<ActionIconProps>,
63
- },
64
- };
65
-
66
- export const snackEmitTypes = {
67
- click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
68
- };
69
-
70
- export type SnackPropTypes = ExtractPropTypes<typeof snackPropTypes>;
71
- export type SnackEmitTypes = typeof snackEmitTypes;
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 SNACKBAR_TONES = ['success', 'information', 'danger', 'caution'] as const;
6
+ type ActionIconProps = {
7
+ icon: string;
8
+ tone: 'neutral' | 'success' | 'danger'
9
+ }
10
+
11
+ export const snackPropTypes = {
12
+ /**
13
+ * @description Text label shown in snack
14
+ */
15
+ text: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ /**
20
+ * @description Snack tone either as 'success', 'information', 'danger', 'caution'
21
+ */
22
+ tone: {
23
+ type: String as PropType<(typeof SNACKBAR_TONES)[number]>,
24
+ validator: (value: (typeof SNACKBAR_TONES)[number]) => SNACKBAR_TONES.includes(value),
25
+ default: 'information',
26
+ },
27
+ /**
28
+ * @description To show action label in snack. Default is false
29
+ */
30
+ showAction: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ /**
35
+ * @description Text label for the action function.
36
+ */
37
+ actionText: {
38
+ type: String,
39
+ default: "action",
40
+ },
41
+ /**
42
+ * @description On click function of the action text.
43
+ */
44
+ action: {
45
+ type: Function,
46
+ default: () => {},
47
+ },
48
+ /**
49
+ * @description To show icon in snack. Default is false.
50
+ */
51
+ showIcon: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ /**
56
+ * @description Duration to show snack. Default is 4000 ms (4s) declared on store
57
+ */
58
+ duration: {
59
+ type: Number,
60
+ },
61
+ actionIconProps: {
62
+ type: Object as PropType<ActionIconProps>,
63
+ },
64
+ };
65
+
66
+ export const snackEmitTypes = {
67
+ click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
68
+ };
69
+
70
+ export type SnackPropTypes = ExtractPropTypes<typeof snackPropTypes>;
71
+ export type SnackEmitTypes = typeof snackEmitTypes;
@@ -1,34 +1,34 @@
1
- import { SnackPropTypes } from "@/components/snackbar/snack/snack";
2
- import { useSnackbarStore } from '@/stores/useSnackbarStore';
3
-
4
- export const useSnackbar = () => {
5
- const snackStore = useSnackbarStore();
6
-
7
- const showSnackbar = (payload: SnackPropTypes) => {
8
- snackStore.message(payload);
9
- }
10
-
11
- const showSuccess = (payload: SnackPropTypes) => {
12
- snackStore.message({ ...payload, tone: "success"});
13
- }
14
-
15
- const showInformation = (payload: SnackPropTypes) => {
16
- snackStore.message({ ...payload, tone: "information"});
17
- }
18
-
19
- const showDanger = (payload: SnackPropTypes) => {
20
- snackStore.message({ ...payload, tone: "danger"});
21
- }
22
-
23
- const showCaution = (payload: SnackPropTypes) => {
24
- snackStore.message({ ...payload, tone: "caution"});
25
- }
26
-
27
- return {
28
- showSnackbar,
29
- showSuccess,
30
- showInformation,
31
- showDanger,
32
- showCaution,
33
- }
34
- }
1
+ import { SnackPropTypes } from "@/components/snackbar/snack/snack";
2
+ import { useSnackbarStore } from '@/stores/useSnackbarStore';
3
+
4
+ export const useSnackbar = () => {
5
+ const snackStore = useSnackbarStore();
6
+
7
+ const showSnackbar = (payload: SnackPropTypes) => {
8
+ snackStore.message(payload);
9
+ }
10
+
11
+ const showSuccess = (payload: SnackPropTypes) => {
12
+ snackStore.message({ ...payload, tone: "success"});
13
+ }
14
+
15
+ const showInformation = (payload: SnackPropTypes) => {
16
+ snackStore.message({ ...payload, tone: "information"});
17
+ }
18
+
19
+ const showDanger = (payload: SnackPropTypes) => {
20
+ snackStore.message({ ...payload, tone: "danger"});
21
+ }
22
+
23
+ const showCaution = (payload: SnackPropTypes) => {
24
+ snackStore.message({ ...payload, tone: "caution"});
25
+ }
26
+
27
+ return {
28
+ showSnackbar,
29
+ showSuccess,
30
+ showInformation,
31
+ showDanger,
32
+ showCaution,
33
+ }
34
+ }
@@ -1,19 +1,19 @@
1
- import type { PropType, ExtractPropTypes } from 'vue';
2
-
3
- const STATUS_STATES = ['success', 'information', 'pending', 'caution', 'danger'] as const;
4
- const STATUS_SIZES = ['2xs', 'xs', 'sm', 'base', 'lg', 'xl', '2xl'] as const;
5
-
6
- export const statusPropTypes = {
7
- state: {
8
- type: String as PropType<(typeof STATUS_STATES)[number]>,
9
- validator: (value: (typeof STATUS_STATES)[number]) => STATUS_STATES.includes(value),
10
- default: 'success',
11
- },
12
- size: {
13
- type: String as PropType<(typeof STATUS_SIZES)[number]>,
14
- validator: (value: (typeof STATUS_SIZES)[number]) => STATUS_SIZES.includes(value),
15
- default: 'base',
16
- },
17
- };
18
-
19
- export type StatusPropTypes = ExtractPropTypes<typeof statusPropTypes>;
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+
3
+ const STATUS_STATES = ['success', 'information', 'pending', 'caution', 'danger'] as const;
4
+ const STATUS_SIZES = ['2xs', 'xs', 'sm', 'base', 'lg', 'xl', '2xl'] as const;
5
+
6
+ export const statusPropTypes = {
7
+ state: {
8
+ type: String as PropType<(typeof STATUS_STATES)[number]>,
9
+ validator: (value: (typeof STATUS_STATES)[number]) => STATUS_STATES.includes(value),
10
+ default: 'success',
11
+ },
12
+ size: {
13
+ type: String as PropType<(typeof STATUS_SIZES)[number]>,
14
+ validator: (value: (typeof STATUS_SIZES)[number]) => STATUS_SIZES.includes(value),
15
+ default: 'base',
16
+ },
17
+ };
18
+
19
+ export type StatusPropTypes = ExtractPropTypes<typeof statusPropTypes>;
@@ -1,13 +1,13 @@
1
- <template>
2
- <Icon :icon="statusIcon" :class="[statusClass, statusSize]" :aria-label="statusDescription" />
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- import { Icon } from '@iconify/vue';
7
- import { statusPropTypes } from './status';
8
- import { useStatus } from './use-status';
9
-
10
- const props = defineProps(statusPropTypes);
11
-
12
- const { statusIcon, statusClass, statusDescription, statusSize} = useStatus(props);
13
- </script>
1
+ <template>
2
+ <Icon :icon="statusIcon" :class="[statusClass, statusSize]" :aria-label="statusDescription" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import { Icon } from '@iconify/vue';
7
+ import { statusPropTypes } from './status';
8
+ import { useStatus } from './use-status';
9
+
10
+ const props = defineProps(statusPropTypes);
11
+
12
+ const { statusIcon, statusClass, statusDescription, statusSize} = useStatus(props);
13
+ </script>
@@ -1,47 +1,47 @@
1
- import type { ExtractPropTypes, PropType } from 'vue';
2
- import { STEPPER_TYPE } from '../stepper';
3
-
4
- export const STEP_STATES = ['pending', 'active', 'completed'] as const;
5
-
6
- export const stepPropTypes = {
7
- /**
8
- * @description Step number
9
- */
10
- number: {
11
- type: Number,
12
- required: true,
13
- },
14
- /**
15
- * @description Text label shown in step
16
- */
17
- label: {
18
- type: String,
19
- required: false,
20
- },
21
- description: {
22
- type: String,
23
- required: false,
24
- },
25
- /**
26
- * @description Step state either as 'pending', 'active', 'completed'
27
- */
28
- status: {
29
- type: String as PropType<(typeof STEP_STATES)[number]>,
30
- validator: (value: (typeof STEP_STATES)[number]) => STEP_STATES.includes(value),
31
- default: 'pending',
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
- }
40
- };
41
-
42
- export const stepEmitTypes = {
43
- click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
44
- };
45
-
46
- export type StepPropTypes = ExtractPropTypes<typeof stepPropTypes>;
47
- export type StepEmitTypes = typeof stepEmitTypes;
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import { STEPPER_TYPE } from '../stepper';
3
+
4
+ export const STEP_STATES = ['pending', 'active', 'completed'] as const;
5
+
6
+ export const stepPropTypes = {
7
+ /**
8
+ * @description Step number
9
+ */
10
+ number: {
11
+ type: Number,
12
+ required: true,
13
+ },
14
+ /**
15
+ * @description Text label shown in step
16
+ */
17
+ label: {
18
+ type: String,
19
+ required: false,
20
+ },
21
+ description: {
22
+ type: String,
23
+ required: false,
24
+ },
25
+ /**
26
+ * @description Step state either as 'pending', 'active', 'completed'
27
+ */
28
+ status: {
29
+ type: String as PropType<(typeof STEP_STATES)[number]>,
30
+ validator: (value: (typeof STEP_STATES)[number]) => STEP_STATES.includes(value),
31
+ default: 'pending',
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
+ }
40
+ };
41
+
42
+ export const stepEmitTypes = {
43
+ click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
44
+ };
45
+
46
+ export type StepPropTypes = ExtractPropTypes<typeof stepPropTypes>;
47
+ export type StepEmitTypes = typeof stepEmitTypes;
@@ -1,47 +1,47 @@
1
- import type { StepPropTypes } from '@/components/stepper/step/step';
2
- import type { ExtractPropTypes, PropType } from 'vue';
3
-
4
- export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
5
- const STEPPER_VARIANTS = ['horizontal', 'vertical'] as const;
6
- export const STEPPER_TYPE = ['compact', 'solid'];
7
- export const STEPPER_STATES = ['pending', 'active', 'completed'] as const;
8
-
9
- export const stepperPropTypes = {
10
- /**
11
- * @description Variant of the stepper
12
- */
13
- variant: {
14
- type: String as PropType<(typeof STEPPER_VARIANTS)[number]>,
15
- validator: (value: (typeof STEPPER_VARIANTS)[number]) => STEPPER_VARIANTS.includes(value),
16
- default: 'vertical',
17
- },
18
- /**
19
- * @description steps of the stepper
20
- * @type {Array<Step>}
21
- * @property {number} number - Step number
22
- * @property {string} label - Text label shown in step
23
- * @property {string} status - Step state either as 'pending', 'active', 'completed'
24
- * @property {string} description - Description shown in step
25
- */
26
- steps: {
27
- type: Array as PropType<StepPropTypes[]>,
28
- default: () => [],
29
- },
30
- /**
31
- * @description has lines between steps
32
- */
33
- hasLines: {
34
- type: Boolean,
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',
44
- }
45
- };
46
-
47
- export type StepperPropTypes = ExtractPropTypes<typeof stepperPropTypes>;
1
+ import type { StepPropTypes } from '@/components/stepper/step/step';
2
+ import type { ExtractPropTypes, PropType } from 'vue';
3
+
4
+ export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
5
+ const STEPPER_VARIANTS = ['horizontal', 'vertical'] as const;
6
+ export const STEPPER_TYPE = ['compact', 'solid'];
7
+ export const STEPPER_STATES = ['pending', 'active', 'completed'] as const;
8
+
9
+ export const stepperPropTypes = {
10
+ /**
11
+ * @description Variant of the stepper
12
+ */
13
+ variant: {
14
+ type: String as PropType<(typeof STEPPER_VARIANTS)[number]>,
15
+ validator: (value: (typeof STEPPER_VARIANTS)[number]) => STEPPER_VARIANTS.includes(value),
16
+ default: 'vertical',
17
+ },
18
+ /**
19
+ * @description steps of the stepper
20
+ * @type {Array<Step>}
21
+ * @property {number} number - Step number
22
+ * @property {string} label - Text label shown in step
23
+ * @property {string} status - Step state either as 'pending', 'active', 'completed'
24
+ * @property {string} description - Description shown in step
25
+ */
26
+ steps: {
27
+ type: Array as PropType<StepPropTypes[]>,
28
+ default: () => [],
29
+ },
30
+ /**
31
+ * @description has lines between steps
32
+ */
33
+ hasLines: {
34
+ type: Boolean,
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',
44
+ }
45
+ };
46
+
47
+ export type StepperPropTypes = ExtractPropTypes<typeof stepperPropTypes>;