@designcrowd/fe-shared-lib 1.5.20-ast-icons-1 → 1.5.20-dts-upgrades
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/.claude/settings.local.json +33 -0
- package/.npm-publish-token +1 -0
- package/MODERNIZATION_ROADMAP.md +264 -0
- package/docs/plans/2026-01-19-typescript-declarations-design.md +114 -0
- package/docs/plans/2026-01-19-typescript-declarations-tdd-plan.md +953 -0
- package/index.d.ts +309 -0
- package/package.json +2 -1
- package/src/atoms/components/Icon/Icon.stories.js +0 -2
- package/src/atoms/components/Icon/Icon.vue +0 -4
- package/src/useSharedLibTranslate.js +2 -0
- package/types-test/all-components.test.ts +81 -0
- package/types-test/basic-imports.test.ts +16 -0
- package/types-test/button-props.test.ts +63 -0
- package/types-test/checkbox-toggle-props.test.ts +78 -0
- package/types-test/dropdown-props.test.ts +36 -0
- package/types-test/icon-props.test.ts +42 -0
- package/types-test/loader-props.test.ts +7 -0
- package/types-test/modal-props.test.ts +39 -0
- package/types-test/select-props.test.ts +97 -0
- package/types-test/text-input-props.test.ts +80 -0
- package/types-test/textarea-props.test.ts +72 -0
- package/types-test/tsconfig.json +12 -0
- package/dist/css/tailwind-brandCrowd.css +0 -2496
- package/dist/css/tailwind-brandPage.css +0 -2180
- package/dist/css/tailwind-crazyDomains.css +0 -2496
- package/dist/css/tailwind-designCom.css +0 -2496
- package/dist/css/tailwind-designCrowd.css +0 -2496
- package/public/css/tailwind-brandCrowd.css +0 -2504
- package/public/css/tailwind-brandPage.css +0 -2184
- package/public/css/tailwind-crazyDomains.css +0 -2504
- package/public/css/tailwind-designCom.css +0 -2504
- package/public/css/tailwind-designCrowd.css +0 -2504
- package/src/atoms/components/Icon/icons/digital-business-card-filled.vue +0 -8
- package/src/atoms/components/Icon/icons/link-in-bio-filled.vue +0 -8
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// types-test/icon-props.test.ts
|
|
2
|
+
// This file tests that IconProps interface is properly exported and typed
|
|
3
|
+
|
|
4
|
+
import { Icon, type IconProps } from '..';
|
|
5
|
+
|
|
6
|
+
// Test that IconProps can be used as a type
|
|
7
|
+
const props: IconProps = {
|
|
8
|
+
name: 'chevron-right',
|
|
9
|
+
size: 'md',
|
|
10
|
+
color: 'primary-500',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Test that name is required
|
|
14
|
+
const requiredName: IconProps['name'] = 'check';
|
|
15
|
+
|
|
16
|
+
// Test optional props
|
|
17
|
+
const viewBox: IconProps['viewBox'] = '0 0 16 16';
|
|
18
|
+
const altText: IconProps['altText'] = 'Check icon';
|
|
19
|
+
const color: IconProps['color'] = 'success-500';
|
|
20
|
+
const classes: IconProps['classes'] = 'custom-class';
|
|
21
|
+
|
|
22
|
+
// Test size variants
|
|
23
|
+
const sizesProps: IconProps = { name: 'check', size: 'xs' };
|
|
24
|
+
const sizesProps2: IconProps = { name: 'check', size: 'sm' };
|
|
25
|
+
const sizesProps3: IconProps = { name: 'check', size: 'md' };
|
|
26
|
+
const sizesProps4: IconProps = { name: 'check', size: 'lg' };
|
|
27
|
+
const sizesProps5: IconProps = { name: 'check', size: 'xl' };
|
|
28
|
+
const sizesProps6: IconProps = { name: 'check', size: '2xl' };
|
|
29
|
+
const sizesProps7: IconProps = { name: 'check', size: '3xl' };
|
|
30
|
+
const sizesProps8: IconProps = { name: 'check', size: '4xl' };
|
|
31
|
+
const sizesProps9: IconProps = { name: 'check', size: '5xl' };
|
|
32
|
+
const sizesProps10: IconProps = { name: 'check', size: 'full' };
|
|
33
|
+
const sizesProps11: IconProps = { name: 'check', size: 'button-icon' };
|
|
34
|
+
|
|
35
|
+
// Test that Icon component is typed
|
|
36
|
+
const _icon: typeof Icon = Icon;
|
|
37
|
+
|
|
38
|
+
// Test altText can be null
|
|
39
|
+
const nullAltText: IconProps = {
|
|
40
|
+
name: 'check',
|
|
41
|
+
altText: null,
|
|
42
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// types-test/modal-props.test.ts
|
|
2
|
+
import { Modal, type ModalProps, type ModalEmits } from '..';
|
|
3
|
+
|
|
4
|
+
// Test ModalProps is properly typed
|
|
5
|
+
const props: ModalProps = {
|
|
6
|
+
visible: true,
|
|
7
|
+
mandatory: false,
|
|
8
|
+
size: 'md',
|
|
9
|
+
closeOnEsc: true,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Test individual prop types
|
|
13
|
+
const visible: ModalProps['visible'] = true;
|
|
14
|
+
const size: ModalProps['size'] = 'xl';
|
|
15
|
+
const mode: ModalProps['mode'] = 'image';
|
|
16
|
+
|
|
17
|
+
// Test all boolean props
|
|
18
|
+
const simple: ModalProps['simple'] = false;
|
|
19
|
+
const removeHorizontalMargin: ModalProps['removeHorizontalMargin'] = true;
|
|
20
|
+
const removeHorizontalPadding: ModalProps['removeHorizontalPadding'] = false;
|
|
21
|
+
const hideScrollbar: ModalProps['hideScrollbar'] = true;
|
|
22
|
+
const showModalBackgroundImage: ModalProps['showModalBackgroundImage'] = false;
|
|
23
|
+
const disableBodyScrollOnVisible: ModalProps['disableBodyScrollOnVisible'] = true;
|
|
24
|
+
const darkOverlay: ModalProps['darkOverlay'] = false;
|
|
25
|
+
const transparentModal: ModalProps['transparentModal'] = true;
|
|
26
|
+
|
|
27
|
+
// Test classes props
|
|
28
|
+
const classes: ModalProps['classes'] = 'tw-my-class';
|
|
29
|
+
const classesObj: ModalProps['classes'] = { 'tw-my-class': true };
|
|
30
|
+
const contentClasses: ModalProps['contentClasses'] = ['tw-class-1', 'tw-class-2'];
|
|
31
|
+
|
|
32
|
+
// Test string props with specific values
|
|
33
|
+
const fullScreenBreakpoint: ModalProps['fullScreenBreakpoint'] = 'sm';
|
|
34
|
+
|
|
35
|
+
// Verify Modal component accepts ModalProps
|
|
36
|
+
const _modal: typeof Modal = Modal;
|
|
37
|
+
|
|
38
|
+
// Verify ModalEmits type exists
|
|
39
|
+
type CloseModalEvent = ModalEmits['close-modal'];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Select, type SelectProps, type SelectEmits, type SelectOption } from '..';
|
|
2
|
+
|
|
3
|
+
// Test SelectOption interface
|
|
4
|
+
const simpleOption: SelectOption = {
|
|
5
|
+
label: 'Option 1',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const disabledOption: SelectOption = {
|
|
9
|
+
$isDisabled: true,
|
|
10
|
+
label: 'Disabled Option',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const customOption: SelectOption = {
|
|
14
|
+
isCustom: true,
|
|
15
|
+
label: 'Custom Option',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const optionWithExtra: SelectOption = {
|
|
19
|
+
label: 'With Extra',
|
|
20
|
+
value: 123,
|
|
21
|
+
customField: 'custom value',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Test SelectProps with object options
|
|
25
|
+
const selectWithObjectOptions: SelectProps = {
|
|
26
|
+
options: [simpleOption, disabledOption],
|
|
27
|
+
modelValue: simpleOption,
|
|
28
|
+
trackBy: 'value',
|
|
29
|
+
label: 'label',
|
|
30
|
+
isSearchable: true,
|
|
31
|
+
placeholder: 'Select an option',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Test SelectProps with string options
|
|
35
|
+
const selectWithStringOptions: SelectProps = {
|
|
36
|
+
options: ['Option 1', 'Option 2', 'Option 3'],
|
|
37
|
+
modelValue: 'Option 1',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Test full props from selectMixin
|
|
41
|
+
const fullMixinProps: SelectProps = {
|
|
42
|
+
options: [],
|
|
43
|
+
isInternalSearch: true,
|
|
44
|
+
modelValue: null,
|
|
45
|
+
trackBy: 'id',
|
|
46
|
+
label: 'name',
|
|
47
|
+
imageUrlField: 'imageUrl',
|
|
48
|
+
isSearchable: true,
|
|
49
|
+
shouldHideSelected: false,
|
|
50
|
+
placeholder: 'Select...',
|
|
51
|
+
shouldAllowEmpty: true,
|
|
52
|
+
shouldResetAfter: false,
|
|
53
|
+
shouldCloseOnSelect: true,
|
|
54
|
+
customLabel: (option, label) => {
|
|
55
|
+
if (typeof option === 'string') return option;
|
|
56
|
+
return label ? String(option[label]) : String(option);
|
|
57
|
+
},
|
|
58
|
+
shouldAllowCustom: true,
|
|
59
|
+
customPlaceholder: 'Press enter to create',
|
|
60
|
+
customPosition: 'top',
|
|
61
|
+
id: 'my-select',
|
|
62
|
+
optionsLimit: 100,
|
|
63
|
+
shouldPreserveSearch: false,
|
|
64
|
+
shouldPreselectFirst: false,
|
|
65
|
+
shouldPreventAutofocus: false,
|
|
66
|
+
isDisabled: false,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Test props from Select.vue
|
|
70
|
+
const selectVueProps: SelectProps = {
|
|
71
|
+
options: [],
|
|
72
|
+
name: 'country-select',
|
|
73
|
+
selectLabel: 'Press enter to select',
|
|
74
|
+
selectedLabel: 'Selected',
|
|
75
|
+
deselectLabel: 'Press enter to remove',
|
|
76
|
+
shouldShowLabels: true,
|
|
77
|
+
maxHeight: 300,
|
|
78
|
+
isLoading: false,
|
|
79
|
+
openDirection: 'below',
|
|
80
|
+
shouldShowNoResults: true,
|
|
81
|
+
tabindex: 0,
|
|
82
|
+
shouldSelectExactMatchOnBlur: false,
|
|
83
|
+
isInvalid: false,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Test openDirection options
|
|
87
|
+
const aboveDirection: SelectProps = { options: [], openDirection: 'above' };
|
|
88
|
+
const belowDirection: SelectProps = { options: [], openDirection: 'below' };
|
|
89
|
+
const topDirection: SelectProps = { options: [], openDirection: 'top' };
|
|
90
|
+
const bottomDirection: SelectProps = { options: [], openDirection: 'bottom' };
|
|
91
|
+
|
|
92
|
+
// Test customPosition options
|
|
93
|
+
const topPosition: SelectProps = { options: [], customPosition: 'top' };
|
|
94
|
+
const bottomPosition: SelectProps = { options: [], customPosition: 'bottom' };
|
|
95
|
+
|
|
96
|
+
// Verify component type includes props and emits
|
|
97
|
+
type SelectComponent = typeof Select;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// types-test/text-input-props.test.ts
|
|
2
|
+
// This file tests that TextInputProps and TextInputEmits interfaces are properly exported and typed
|
|
3
|
+
|
|
4
|
+
import { TextInput, type TextInputProps, type TextInputEmits } from '..';
|
|
5
|
+
|
|
6
|
+
// Test that TextInputProps can be used as a type
|
|
7
|
+
const props: TextInputProps = {
|
|
8
|
+
modelValue: 'test value',
|
|
9
|
+
placeholder: 'Enter text...',
|
|
10
|
+
label: 'Username',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Test form control mixin props
|
|
14
|
+
const attrs: TextInputProps['attrs'] = { 'data-testid': 'input' };
|
|
15
|
+
const modelValue: TextInputProps['modelValue'] = 'value';
|
|
16
|
+
const modelValueNumber: TextInputProps['modelValue'] = 123;
|
|
17
|
+
const id: TextInputProps['id'] = 'input-1';
|
|
18
|
+
const placeholder: TextInputProps['placeholder'] = 'Enter value';
|
|
19
|
+
const size: TextInputProps['size'] = 'sm';
|
|
20
|
+
const label: TextInputProps['label'] = 'Label';
|
|
21
|
+
const showLabelScreenReaderOnly: TextInputProps['showLabelScreenReaderOnly'] = true;
|
|
22
|
+
const icon: TextInputProps['icon'] = 'search';
|
|
23
|
+
const required: TextInputProps['required'] = true;
|
|
24
|
+
const error: TextInputProps['error'] = false;
|
|
25
|
+
const warning: TextInputProps['warning'] = false;
|
|
26
|
+
const success: TextInputProps['success'] = false;
|
|
27
|
+
const disabled: TextInputProps['disabled'] = false;
|
|
28
|
+
const readonly: TextInputProps['readonly'] = false;
|
|
29
|
+
const name: TextInputProps['name'] = 'username';
|
|
30
|
+
const maxlength: TextInputProps['maxlength'] = 100;
|
|
31
|
+
const minlength: TextInputProps['minlength'] = 1;
|
|
32
|
+
const isSpaceDisabled: TextInputProps['isSpaceDisabled'] = false;
|
|
33
|
+
const requiredMessage: TextInputProps['requiredMessage'] = 'This field is required';
|
|
34
|
+
|
|
35
|
+
// Test TextInput-specific props
|
|
36
|
+
const type: TextInputProps['type'] = 'text';
|
|
37
|
+
const typePassword: TextInputProps['type'] = 'password';
|
|
38
|
+
const typeEmail: TextInputProps['type'] = 'email';
|
|
39
|
+
const typeNumber: TextInputProps['type'] = 'number';
|
|
40
|
+
const typeTel: TextInputProps['type'] = 'tel';
|
|
41
|
+
const typeUrl: TextInputProps['type'] = 'url';
|
|
42
|
+
const enableClear: TextInputProps['enableClear'] = true;
|
|
43
|
+
const enableClearConfirmation: TextInputProps['enableClearConfirmation'] = true;
|
|
44
|
+
const borderLeft: TextInputProps['borderLeft'] = true;
|
|
45
|
+
const borderRight: TextInputProps['borderRight'] = true;
|
|
46
|
+
const prefixText: TextInputProps['prefixText'] = 'https://';
|
|
47
|
+
const elementClasses: TextInputProps['elementClasses'] = 'custom-class';
|
|
48
|
+
|
|
49
|
+
// Test that TextInput component is typed
|
|
50
|
+
const _textInput: typeof TextInput = TextInput;
|
|
51
|
+
|
|
52
|
+
// Test complete props object
|
|
53
|
+
const fullProps: TextInputProps = {
|
|
54
|
+
attrs: { 'data-testid': 'input' },
|
|
55
|
+
modelValue: '',
|
|
56
|
+
id: 'email-input',
|
|
57
|
+
placeholder: 'Enter email',
|
|
58
|
+
size: 'sm',
|
|
59
|
+
label: 'Email',
|
|
60
|
+
showLabelScreenReaderOnly: false,
|
|
61
|
+
icon: 'envelope-email',
|
|
62
|
+
required: true,
|
|
63
|
+
error: false,
|
|
64
|
+
warning: false,
|
|
65
|
+
success: false,
|
|
66
|
+
disabled: false,
|
|
67
|
+
readonly: false,
|
|
68
|
+
name: 'email',
|
|
69
|
+
maxlength: 255,
|
|
70
|
+
minlength: 5,
|
|
71
|
+
isSpaceDisabled: true,
|
|
72
|
+
requiredMessage: 'Email is required',
|
|
73
|
+
type: 'email',
|
|
74
|
+
enableClear: true,
|
|
75
|
+
enableClearConfirmation: false,
|
|
76
|
+
borderLeft: true,
|
|
77
|
+
borderRight: true,
|
|
78
|
+
prefixText: undefined,
|
|
79
|
+
elementClasses: '',
|
|
80
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// types-test/textarea-props.test.ts
|
|
2
|
+
// This file tests that TextareaProps interface is properly exported and typed
|
|
3
|
+
|
|
4
|
+
import { Textarea, type TextareaProps, type TextInputEmits } from '..';
|
|
5
|
+
|
|
6
|
+
// Test that TextareaProps can be used as a type
|
|
7
|
+
const props: TextareaProps = {
|
|
8
|
+
modelValue: 'test value',
|
|
9
|
+
placeholder: 'Enter text...',
|
|
10
|
+
label: 'Description',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Test form control mixin props (shared with TextInput)
|
|
14
|
+
const attrs: TextareaProps['attrs'] = { 'data-testid': 'textarea' };
|
|
15
|
+
const modelValue: TextareaProps['modelValue'] = 'value';
|
|
16
|
+
const modelValueNumber: TextareaProps['modelValue'] = 123;
|
|
17
|
+
const id: TextareaProps['id'] = 'textarea-1';
|
|
18
|
+
const placeholder: TextareaProps['placeholder'] = 'Enter value';
|
|
19
|
+
const label: TextareaProps['label'] = 'Label';
|
|
20
|
+
const showLabelScreenReaderOnly: TextareaProps['showLabelScreenReaderOnly'] = true;
|
|
21
|
+
const icon: TextareaProps['icon'] = 'edit';
|
|
22
|
+
const required: TextareaProps['required'] = true;
|
|
23
|
+
const error: TextareaProps['error'] = false;
|
|
24
|
+
const warning: TextareaProps['warning'] = false;
|
|
25
|
+
const success: TextareaProps['success'] = false;
|
|
26
|
+
const disabled: TextareaProps['disabled'] = false;
|
|
27
|
+
const readonly: TextareaProps['readonly'] = false;
|
|
28
|
+
const name: TextareaProps['name'] = 'description';
|
|
29
|
+
const maxlength: TextareaProps['maxlength'] = 1000;
|
|
30
|
+
const minlength: TextareaProps['minlength'] = 10;
|
|
31
|
+
const isSpaceDisabled: TextareaProps['isSpaceDisabled'] = false;
|
|
32
|
+
const requiredMessage: TextareaProps['requiredMessage'] = 'This field is required';
|
|
33
|
+
|
|
34
|
+
// Test size variants (Textarea supports sm, md, lg)
|
|
35
|
+
const sizeSm: TextareaProps = { size: 'sm' };
|
|
36
|
+
const sizeMd: TextareaProps = { size: 'md' };
|
|
37
|
+
const sizeLg: TextareaProps = { size: 'lg' };
|
|
38
|
+
|
|
39
|
+
// Test Textarea-specific props
|
|
40
|
+
const resize: TextareaProps['resize'] = true;
|
|
41
|
+
const resizeFalse: TextareaProps['resize'] = false;
|
|
42
|
+
const shouldAutoFitContent: TextareaProps['shouldAutoFitContent'] = true;
|
|
43
|
+
const elementClasses: TextareaProps['elementClasses'] = 'custom-class';
|
|
44
|
+
|
|
45
|
+
// Test that Textarea component is typed
|
|
46
|
+
const _textarea: typeof Textarea = Textarea;
|
|
47
|
+
|
|
48
|
+
// Test complete props object
|
|
49
|
+
const fullProps: TextareaProps = {
|
|
50
|
+
attrs: { 'data-testid': 'textarea' },
|
|
51
|
+
modelValue: '',
|
|
52
|
+
id: 'bio-textarea',
|
|
53
|
+
placeholder: 'Tell us about yourself',
|
|
54
|
+
size: 'md',
|
|
55
|
+
label: 'Bio',
|
|
56
|
+
showLabelScreenReaderOnly: false,
|
|
57
|
+
icon: undefined,
|
|
58
|
+
required: false,
|
|
59
|
+
error: false,
|
|
60
|
+
warning: false,
|
|
61
|
+
success: false,
|
|
62
|
+
disabled: false,
|
|
63
|
+
readonly: false,
|
|
64
|
+
name: 'bio',
|
|
65
|
+
maxlength: 500,
|
|
66
|
+
minlength: 0,
|
|
67
|
+
isSpaceDisabled: false,
|
|
68
|
+
requiredMessage: 'Bio is required',
|
|
69
|
+
resize: true,
|
|
70
|
+
shouldAutoFitContent: false,
|
|
71
|
+
elementClasses: '',
|
|
72
|
+
};
|