design-system-next 2.12.1 → 2.12.3

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 (84) hide show
  1. package/dist/design-system-next.es.js +5986 -6186
  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 +1 -1
  8. package/package.json +1 -1
  9. package/src/App.vue +49 -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/avatar/avatar.ts +64 -64
  18. package/src/components/badge/badge.ts +43 -43
  19. package/src/components/banner/banner.ts +20 -20
  20. package/src/components/button/button.ts +72 -72
  21. package/src/components/button/button.vue +15 -15
  22. package/src/components/card/card.ts +52 -52
  23. package/src/components/checkbox/checkbox.ts +45 -45
  24. package/src/components/chips/chips.ts +101 -95
  25. package/src/components/chips/use-chips.ts +11 -3
  26. package/src/components/collapsible/collapsible.ts +21 -21
  27. package/src/components/collapsible/collapsible.vue +27 -27
  28. package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
  29. package/src/components/date-picker/date-picker.ts +157 -157
  30. package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
  31. package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
  32. package/src/components/dropdown/fix-multi-number.ts +92 -92
  33. package/src/components/dropdown/use-dropdown.ts +488 -488
  34. package/src/components/empty-state/empty-state.ts +50 -50
  35. package/src/components/file-upload/file-upload.ts +87 -87
  36. package/src/components/floating-action/floating-action.ts +12 -12
  37. package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
  38. package/src/components/input/input-email/input-email.vue +17 -17
  39. package/src/components/input/input-password/use-input-password.ts +19 -19
  40. package/src/components/input/input-search/input-search.vue +13 -13
  41. package/src/components/input/input-url/input-url.vue +20 -20
  42. package/src/components/input/input-username/input-username.vue +17 -17
  43. package/src/components/input/input.vue +72 -72
  44. package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
  45. package/src/components/logo/logo.ts +43 -43
  46. package/src/components/logo/logo.vue +14 -14
  47. package/src/components/logo/use-logo.ts +41 -41
  48. package/src/components/modal/modal.ts +45 -45
  49. package/src/components/progress-bar/progress-bar.ts +39 -39
  50. package/src/components/radio/radio.ts +42 -42
  51. package/src/components/select/select.ts +144 -144
  52. package/src/components/sidepanel/sidepanel.vue +55 -55
  53. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
  54. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
  55. package/src/components/slider/slider.ts +38 -38
  56. package/src/components/snackbar/snack/snack.ts +71 -71
  57. package/src/components/snackbar/use-snackbar.ts +34 -34
  58. package/src/components/status/status.ts +19 -19
  59. package/src/components/status/status.vue +13 -13
  60. package/src/components/stepper/step/step.ts +47 -47
  61. package/src/components/stepper/stepper.ts +47 -47
  62. package/src/components/stepper/stepper.vue +34 -34
  63. package/src/components/switch/switch.ts +42 -42
  64. package/src/components/table/table-actions/table-actions.ts +42 -42
  65. package/src/components/table/table-actions/table-actions.vue +40 -40
  66. package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
  67. package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
  68. package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
  69. package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
  70. package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
  71. package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
  72. package/src/components/table/table-pagination/table-pagination.ts +63 -63
  73. package/src/components/table/table-pagination/table-pagination.vue +72 -72
  74. package/src/components/table/table.ts +174 -173
  75. package/src/components/table/table.vue +1 -1
  76. package/src/components/table/use-table.ts +13 -8
  77. package/src/components/tabs/tabs.ts +43 -43
  78. package/src/components/textarea/textarea.ts +72 -72
  79. package/src/components/textarea/textarea.vue +45 -45
  80. package/src/components/time-picker/time-picker.ts +69 -69
  81. package/src/components/tooltip/use-tooltip.ts +13 -13
  82. package/src/examples/dropdown-number-multi-select.vue +76 -76
  83. package/src/stores/useSnackbarStore.ts +44 -44
  84. package/src/vite-env.d.ts +0 -6
@@ -1,157 +1,157 @@
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 REST_DAYS_TYPES = ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'] as const;
6
-
7
- const POPPER_STRATEGY_TYPES = ['fixed', 'absolute'] as const;
8
- const PLACEMENTS_TYPES = [
9
- 'auto',
10
- 'auto-start',
11
- 'auto-end',
12
- 'top',
13
- 'top-start',
14
- 'top-end',
15
- 'right',
16
- 'right-start',
17
- 'right-end',
18
- 'bottom',
19
- 'bottom-start',
20
- 'bottom-end',
21
- 'left',
22
- 'left-start',
23
- 'left-end',
24
- ] as const;
25
-
26
- export const datePickerPropTypes = {
27
- id: {
28
- type: String,
29
- required: true,
30
- default: 'date-picker',
31
- },
32
- modelValue: {
33
- type: String,
34
- default: '',
35
- required: true,
36
- },
37
- label: {
38
- type: String,
39
- default: '',
40
- },
41
- active: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- disabled: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- readonly: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- error: {
54
- type: Boolean,
55
- default: false,
56
- },
57
- currentYear: {
58
- type: String,
59
- default: new Date().getFullYear().toString(),
60
- },
61
- minMaxYear: {
62
- type: Object as PropType<MinMaxYearType>,
63
- default: () => ({
64
- min: 1900,
65
- max: new Date().getFullYear(),
66
- }),
67
- },
68
- restDays: {
69
- type: Array as PropType<RestDayType[]>,
70
- validator: (value: RestDayType[]): boolean => {
71
- return value.every((val) => REST_DAYS_TYPES.includes(val));
72
- },
73
- default: [],
74
- },
75
- disabledDates: {
76
- type: Object as PropType<DisabledDatesType>,
77
- },
78
- displayHelper: {
79
- type: Boolean,
80
- default: false,
81
- },
82
- helperText: {
83
- type: String,
84
- default: '',
85
- },
86
- helperIcon: {
87
- type: String,
88
- default: null,
89
- },
90
- width: {
91
- type: String,
92
- default: '100%',
93
- },
94
- popperStrategy: {
95
- type: String,
96
- validator: (value: 'fixed' | 'absolute') => POPPER_STRATEGY_TYPES.includes(value),
97
- default: 'absolute',
98
- },
99
- placement: {
100
- type: String as PropType<(typeof PLACEMENTS_TYPES)[number]>,
101
- validator: (value: (typeof PLACEMENTS_TYPES)[number]) => PLACEMENTS_TYPES.includes(value),
102
- default: 'bottom',
103
- },
104
- format: {
105
- type: String,
106
- default: 'MM-DD-YYYY',
107
- description: 'Format for the selected date. For example: MM/DD/YYYY, YYYY-MM-DD, etc.',
108
- },
109
- };
110
-
111
- export type RestDayType = (typeof REST_DAYS_TYPES)[number];
112
-
113
- export type DisabledDatesType = {
114
- to: string;
115
- from: string;
116
- pastDates: boolean | string;
117
- futureDates: boolean | string;
118
- selectedDates: Array<string>;
119
- weekends: boolean;
120
- weekdays: boolean;
121
- selectedDays: Array<string>;
122
- };
123
-
124
- export type MinMaxYearType = {
125
- min: number;
126
- max: number;
127
- };
128
-
129
- export const datePickerEmitTypes = {
130
- 'update:modelValue': (value: string) => typeof value === 'string',
131
- getInputValue: (value: string | null) => value === null || typeof value === 'string',
132
- getDateFormats: (value: Record<string, string>) => {
133
- return (
134
- typeof value === 'object' &&
135
- value !== null &&
136
- !Array.isArray(value) &&
137
- Object.keys(value).every((key) => typeof value[key] === 'string')
138
- );
139
- },
140
- getMonthList: (value: Array<object>) => Array.isArray(value),
141
- getYearList: (value: Array<number>) => Array.isArray(value),
142
- getDateErrors: (value: Array<{ title: string; message: string }>) => {
143
- return (
144
- Array.isArray(value) &&
145
- value.every(
146
- (item) =>
147
- item !== null &&
148
- typeof item === 'object' &&
149
- typeof item.title === 'string' &&
150
- typeof item.message === 'string',
151
- )
152
- );
153
- },
154
- };
155
-
156
- export type DatePickerPropTypes = ExtractPropTypes<typeof datePickerPropTypes>;
157
- export type DatePickerEmitTypes = typeof datePickerEmitTypes;
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 REST_DAYS_TYPES = ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'] as const;
6
+
7
+ const POPPER_STRATEGY_TYPES = ['fixed', 'absolute'] as const;
8
+ const PLACEMENTS_TYPES = [
9
+ 'auto',
10
+ 'auto-start',
11
+ 'auto-end',
12
+ 'top',
13
+ 'top-start',
14
+ 'top-end',
15
+ 'right',
16
+ 'right-start',
17
+ 'right-end',
18
+ 'bottom',
19
+ 'bottom-start',
20
+ 'bottom-end',
21
+ 'left',
22
+ 'left-start',
23
+ 'left-end',
24
+ ] as const;
25
+
26
+ export const datePickerPropTypes = {
27
+ id: {
28
+ type: String,
29
+ required: true,
30
+ default: 'date-picker',
31
+ },
32
+ modelValue: {
33
+ type: String,
34
+ default: '',
35
+ required: true,
36
+ },
37
+ label: {
38
+ type: String,
39
+ default: '',
40
+ },
41
+ active: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ disabled: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ readonly: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ error: {
54
+ type: Boolean,
55
+ default: false,
56
+ },
57
+ currentYear: {
58
+ type: String,
59
+ default: new Date().getFullYear().toString(),
60
+ },
61
+ minMaxYear: {
62
+ type: Object as PropType<MinMaxYearType>,
63
+ default: () => ({
64
+ min: 1900,
65
+ max: new Date().getFullYear(),
66
+ }),
67
+ },
68
+ restDays: {
69
+ type: Array as PropType<RestDayType[]>,
70
+ validator: (value: RestDayType[]): boolean => {
71
+ return value.every((val) => REST_DAYS_TYPES.includes(val));
72
+ },
73
+ default: [],
74
+ },
75
+ disabledDates: {
76
+ type: Object as PropType<DisabledDatesType>,
77
+ },
78
+ displayHelper: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
82
+ helperText: {
83
+ type: String,
84
+ default: '',
85
+ },
86
+ helperIcon: {
87
+ type: String,
88
+ default: null,
89
+ },
90
+ width: {
91
+ type: String,
92
+ default: '100%',
93
+ },
94
+ popperStrategy: {
95
+ type: String,
96
+ validator: (value: 'fixed' | 'absolute') => POPPER_STRATEGY_TYPES.includes(value),
97
+ default: 'absolute',
98
+ },
99
+ placement: {
100
+ type: String as PropType<(typeof PLACEMENTS_TYPES)[number]>,
101
+ validator: (value: (typeof PLACEMENTS_TYPES)[number]) => PLACEMENTS_TYPES.includes(value),
102
+ default: 'bottom',
103
+ },
104
+ format: {
105
+ type: String,
106
+ default: 'MM-DD-YYYY',
107
+ description: 'Format for the selected date. For example: MM/DD/YYYY, YYYY-MM-DD, etc.',
108
+ },
109
+ };
110
+
111
+ export type RestDayType = (typeof REST_DAYS_TYPES)[number];
112
+
113
+ export type DisabledDatesType = {
114
+ to: string;
115
+ from: string;
116
+ pastDates: boolean | string;
117
+ futureDates: boolean | string;
118
+ selectedDates: Array<string>;
119
+ weekends: boolean;
120
+ weekdays: boolean;
121
+ selectedDays: Array<string>;
122
+ };
123
+
124
+ export type MinMaxYearType = {
125
+ min: number;
126
+ max: number;
127
+ };
128
+
129
+ export const datePickerEmitTypes = {
130
+ 'update:modelValue': (value: string) => typeof value === 'string',
131
+ getInputValue: (value: string | null) => value === null || typeof value === 'string',
132
+ getDateFormats: (value: Record<string, string>) => {
133
+ return (
134
+ typeof value === 'object' &&
135
+ value !== null &&
136
+ !Array.isArray(value) &&
137
+ Object.keys(value).every((key) => typeof value[key] === 'string')
138
+ );
139
+ },
140
+ getMonthList: (value: Array<object>) => Array.isArray(value),
141
+ getYearList: (value: Array<number>) => Array.isArray(value),
142
+ getDateErrors: (value: Array<{ title: string; message: string }>) => {
143
+ return (
144
+ Array.isArray(value) &&
145
+ value.every(
146
+ (item) =>
147
+ item !== null &&
148
+ typeof item === 'object' &&
149
+ typeof item.title === 'string' &&
150
+ typeof item.message === 'string',
151
+ )
152
+ );
153
+ },
154
+ };
155
+
156
+ export type DatePickerPropTypes = ExtractPropTypes<typeof datePickerPropTypes>;
157
+ export type DatePickerEmitTypes = typeof datePickerEmitTypes;
@@ -1,106 +1,106 @@
1
- // Test script for dropdown component
2
-
3
- import { describe, it, expect } from 'vitest';
4
- import { ref } from 'vue';
5
- import { useDropdown } from '../use-dropdown';
6
-
7
- describe('Dropdown Component Fixes', () => {
8
- describe('Value handling', () => {
9
- it('should handle string value selection correctly', () => {
10
- // Setup single-select dropdown with string value
11
- const modelValue = ref('');
12
- const menuList = [
13
- { text: 'Apple', value: 'apple' },
14
- { text: 'Banana', value: 'banana' }
15
- ];
16
-
17
- const { handleSelectedItem } = useDropdown({
18
- id: 'test',
19
- modelValue,
20
- menuList
21
- });
22
-
23
- // Simulate selecting an item
24
- handleSelectedItem([{ text: 'Apple', value: 'apple' }]);
25
-
26
- // Verify correct value is set
27
- expect(modelValue.value).toBe('apple');
28
- });
29
-
30
- it('should handle multiple selection correctly', () => {
31
- // Setup multi-select dropdown
32
- const modelValue = ref([]);
33
- const menuList = [
34
- { text: 'Apple', value: 'apple' },
35
- { text: 'Banana', value: 'banana' }
36
- ];
37
-
38
- const { handleSelectedItem } = useDropdown({
39
- id: 'test',
40
- modelValue,
41
- menuList,
42
- multiSelect: true
43
- });
44
-
45
- // Simulate selecting multiple items
46
- handleSelectedItem([
47
- { text: 'Apple', value: 'apple' },
48
- { text: 'Banana', value: 'banana' }
49
- ]);
50
-
51
- // Verify correct values are set
52
- expect(modelValue.value).toEqual(['apple', 'banana']);
53
- });
54
- });
55
-
56
- describe('Ladderized dropdown', () => {
57
- it('should handle ladderized dropdown selection', () => {
58
- // Setup ladderized dropdown
59
- const modelValue = ref([]);
60
- const menuList = [
61
- {
62
- text: 'Lion',
63
- value: 'lion',
64
- sublevel: [
65
- { text: 'Cub', value: 'cub' }
66
- ]
67
- }
68
- ];
69
-
70
- const { handleSelectedItem } = useDropdown({
71
- id: 'test',
72
- modelValue,
73
- menuList,
74
- ladderized: true
75
- });
76
-
77
- // Simulate selecting an item
78
- handleSelectedItem([{ text: 'Cub', value: 'cub', subvalue: 'lion' }]);
79
-
80
- // Verify correct values are set for ladderized dropdown
81
- expect(modelValue.value).toEqual(['lion', 'cub']);
82
- });
83
- });
84
-
85
- describe('Edge cases', () => {
86
- it('should handle empty selection', () => {
87
- const modelValue = ref('apple');
88
- const menuList = [
89
- { text: 'Apple', value: 'apple' },
90
- { text: 'Banana', value: 'banana' }
91
- ];
92
-
93
- const { handleSelectedItem } = useDropdown({
94
- id: 'test',
95
- modelValue,
96
- menuList
97
- });
98
-
99
- // Simulate clearing selection
100
- handleSelectedItem([]);
101
-
102
- // Verify value is cleared
103
- expect(modelValue.value).toBeUndefined();
104
- });
105
- });
106
- });
1
+ // Test script for dropdown component
2
+
3
+ import { describe, it, expect } from 'vitest';
4
+ import { ref } from 'vue';
5
+ import { useDropdown } from '../use-dropdown';
6
+
7
+ describe('Dropdown Component Fixes', () => {
8
+ describe('Value handling', () => {
9
+ it('should handle string value selection correctly', () => {
10
+ // Setup single-select dropdown with string value
11
+ const modelValue = ref('');
12
+ const menuList = [
13
+ { text: 'Apple', value: 'apple' },
14
+ { text: 'Banana', value: 'banana' }
15
+ ];
16
+
17
+ const { handleSelectedItem } = useDropdown({
18
+ id: 'test',
19
+ modelValue,
20
+ menuList
21
+ });
22
+
23
+ // Simulate selecting an item
24
+ handleSelectedItem([{ text: 'Apple', value: 'apple' }]);
25
+
26
+ // Verify correct value is set
27
+ expect(modelValue.value).toBe('apple');
28
+ });
29
+
30
+ it('should handle multiple selection correctly', () => {
31
+ // Setup multi-select dropdown
32
+ const modelValue = ref([]);
33
+ const menuList = [
34
+ { text: 'Apple', value: 'apple' },
35
+ { text: 'Banana', value: 'banana' }
36
+ ];
37
+
38
+ const { handleSelectedItem } = useDropdown({
39
+ id: 'test',
40
+ modelValue,
41
+ menuList,
42
+ multiSelect: true
43
+ });
44
+
45
+ // Simulate selecting multiple items
46
+ handleSelectedItem([
47
+ { text: 'Apple', value: 'apple' },
48
+ { text: 'Banana', value: 'banana' }
49
+ ]);
50
+
51
+ // Verify correct values are set
52
+ expect(modelValue.value).toEqual(['apple', 'banana']);
53
+ });
54
+ });
55
+
56
+ describe('Ladderized dropdown', () => {
57
+ it('should handle ladderized dropdown selection', () => {
58
+ // Setup ladderized dropdown
59
+ const modelValue = ref([]);
60
+ const menuList = [
61
+ {
62
+ text: 'Lion',
63
+ value: 'lion',
64
+ sublevel: [
65
+ { text: 'Cub', value: 'cub' }
66
+ ]
67
+ }
68
+ ];
69
+
70
+ const { handleSelectedItem } = useDropdown({
71
+ id: 'test',
72
+ modelValue,
73
+ menuList,
74
+ ladderized: true
75
+ });
76
+
77
+ // Simulate selecting an item
78
+ handleSelectedItem([{ text: 'Cub', value: 'cub', subvalue: 'lion' }]);
79
+
80
+ // Verify correct values are set for ladderized dropdown
81
+ expect(modelValue.value).toEqual(['lion', 'cub']);
82
+ });
83
+ });
84
+
85
+ describe('Edge cases', () => {
86
+ it('should handle empty selection', () => {
87
+ const modelValue = ref('apple');
88
+ const menuList = [
89
+ { text: 'Apple', value: 'apple' },
90
+ { text: 'Banana', value: 'banana' }
91
+ ];
92
+
93
+ const { handleSelectedItem } = useDropdown({
94
+ id: 'test',
95
+ modelValue,
96
+ menuList
97
+ });
98
+
99
+ // Simulate clearing selection
100
+ handleSelectedItem([]);
101
+
102
+ // Verify value is cleared
103
+ expect(modelValue.value).toBeUndefined();
104
+ });
105
+ });
106
+ });