@designcrowd/fe-shared-lib 1.5.20-dts-upgrades → 1.5.20

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/index.d.ts DELETED
@@ -1,309 +0,0 @@
1
- // index.d.ts
2
- import { DefineComponent } from 'vue';
3
-
4
- // ============ Utility Functions ============
5
- export function setSharedLibLocaleAsync(locale?: string): Promise<void>;
6
- export function tr(key: string, params?: Record<string, unknown>): string;
7
-
8
- // ============ API Clients ============
9
- export const brandPageApiClient: unknown;
10
- export const brandCrowdApiClient: unknown;
11
-
12
- // ============ Constants ============
13
- export const WEBSITE_UPGRADE_CONTEXT_TYPES: Record<string, string>;
14
-
15
- // ============ Experience Components (Stubs) ============
16
- export const UploadYourLogoDropzone: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
17
- export const UploadYourLogoApplication: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
18
- export const UploadedLogoSearchResultCard: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
19
- export const SignUpModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
20
- export const SignUp: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
21
- export const SignIn: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
22
- export const ForgotPasswordModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
23
- export const ForgotPassword: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
24
- export const ResetPasswordModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
25
- export const ResetPassword: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
26
- export const ResetPasswordSuccessModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
27
- export const PaymentConfigList: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
28
- export const PaymentConfigDropdown: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
29
- export const SellDomainNameListModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
30
- export const SellDomainNameList: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
31
- export const SellDomainNameWidget: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
32
- export const PublishBrandPageModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
33
- export const PublishBrandPageCard: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
34
- export const WebsiteContextualUpgradeModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
35
-
36
- // ============ Detailed Component Types ============
37
-
38
- export interface ButtonProps {
39
- attrs?: Record<string, unknown>;
40
- label?: string;
41
- url?: string | null;
42
- theme?: 'brandCrowd' | 'crazyDomains' | string | null;
43
- variant?: 'primary' | 'secondary' | 'success' | 'outline' | 'outline-primary' | 'outline-success' | 'outline-no-hover' | 'warning' | 'info' | 'info-filled' | 'gray' | 'no-border' | 'flat' | 'pill' | 'dark-mode-pill' | 'ai' | 'primary-with-icon' | string | null;
44
- size?: 'small' | 'small-wide' | 'small-medium' | 'medium' | 'large' | string | null;
45
- iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | string;
46
- icon?: string | null;
47
- iconViewBox?: string | null;
48
- iconLeft?: string;
49
- iconLeftSize?: string;
50
- iconRight?: string;
51
- iconRightSize?: string;
52
- iconTop?: string;
53
- iconTopSize?: string;
54
- iconColor?: string;
55
- fullWidth?: boolean;
56
- fullHeight?: boolean;
57
- classes?: string | Record<string, boolean>;
58
- containerClasses?: string;
59
- greyOutLeft?: boolean;
60
- white?: boolean;
61
- rounded?: boolean;
62
- roundedLeft?: boolean;
63
- roundedRight?: boolean;
64
- disabled?: boolean;
65
- isBusy?: boolean;
66
- isBusyLabel?: string;
67
- download?: string;
68
- active?: boolean;
69
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
70
- justify?: 'center' | 'between' | string;
71
- type?: 'button' | 'submit' | 'reset' | string;
72
- showLabel?: boolean;
73
- dataAttribute?: string;
74
- altText?: string | null;
75
- }
76
-
77
- export interface ButtonEmits {
78
- 'on-click': [event: Event];
79
- }
80
-
81
- export interface ModalProps {
82
- simple?: boolean;
83
- removeHorizontalMargin?: boolean;
84
- removeHorizontalPadding?: boolean;
85
- visible?: boolean;
86
- mandatory?: boolean;
87
- mode?: 'image' | string;
88
- classes?: string | Record<string, boolean>;
89
- contentClasses?: string[];
90
- size?: 'md' | 'xl' | string;
91
- fullScreenBreakpoint?: 'sm' | string;
92
- closeOnEsc?: boolean;
93
- hideScrollbar?: boolean;
94
- showModalBackgroundImage?: boolean;
95
- disableBodyScrollOnVisible?: boolean;
96
- darkOverlay?: boolean;
97
- transparentModal?: boolean;
98
- }
99
-
100
- export interface ModalEmits {
101
- 'close-modal': [event?: Event];
102
- }
103
-
104
- export interface IconProps {
105
- viewBox?: string;
106
- name: string; // required
107
- altText?: string | null;
108
- color?: string;
109
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | 'full' | 'button-icon' | string;
110
- classes?: string;
111
- }
112
-
113
- export interface TextInputProps {
114
- // From FormControlMixin
115
- attrs?: Record<string, unknown>;
116
- modelValue?: string | number;
117
- id?: string;
118
- placeholder?: string;
119
- size?: 'sm' | string;
120
- label?: string;
121
- showLabelScreenReaderOnly?: boolean;
122
- icon?: string;
123
- required?: boolean;
124
- error?: boolean;
125
- warning?: boolean;
126
- success?: boolean;
127
- disabled?: boolean;
128
- readonly?: boolean;
129
- name?: string;
130
- maxlength?: number;
131
- minlength?: number;
132
- isSpaceDisabled?: boolean;
133
- requiredMessage?: string;
134
- // TextInput-specific
135
- type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | string;
136
- enableClear?: boolean;
137
- enableClearConfirmation?: boolean;
138
- borderLeft?: boolean;
139
- borderRight?: boolean;
140
- prefixText?: string;
141
- elementClasses?: string;
142
- }
143
-
144
- export interface TextInputEmits {
145
- 'update:modelValue': [value: string | number];
146
- 'input': [value: string | number];
147
- 'keyup': [value: string | number];
148
- 'keydown': [value: string | number];
149
- 'focus': [value: string | number];
150
- 'blur': [value: string | number];
151
- 'enter-key-up': [value: string | number];
152
- 'on-clear': [];
153
- 'on-clear-confirmation': [];
154
- }
155
-
156
- export interface TextareaProps {
157
- // Same as TextInput mixin props
158
- attrs?: Record<string, unknown>;
159
- modelValue?: string | number;
160
- id?: string;
161
- placeholder?: string;
162
- size?: 'sm' | 'md' | 'lg' | string;
163
- label?: string;
164
- showLabelScreenReaderOnly?: boolean;
165
- icon?: string;
166
- required?: boolean;
167
- error?: boolean;
168
- warning?: boolean;
169
- success?: boolean;
170
- disabled?: boolean;
171
- readonly?: boolean;
172
- name?: string;
173
- maxlength?: number;
174
- minlength?: number;
175
- isSpaceDisabled?: boolean;
176
- requiredMessage?: string;
177
- // Textarea-specific
178
- resize?: boolean;
179
- shouldAutoFitContent?: boolean;
180
- elementClasses?: string;
181
- }
182
-
183
- export interface CheckboxProps {
184
- modelValue: boolean; // required
185
- id: string; // required
186
- label?: string;
187
- showLabelScreenReaderOnly?: boolean;
188
- inline?: boolean;
189
- required?: boolean;
190
- disabled?: boolean;
191
- color?: 'success' | 'info' | 'error' | 'warning' | 'primary' | string;
192
- size?: 'sm' | 'md' | string;
193
- showBorder?: boolean;
194
- classes?: string | Record<string, boolean>;
195
- }
196
-
197
- export interface CheckboxEmits {
198
- 'update:modelValue': [value: boolean];
199
- }
200
-
201
- export interface DropdownProps {
202
- menuAlign?: 'left' | 'right' | string;
203
- title?: string;
204
- elementClasses?: string;
205
- menuElementClasses?: string;
206
- disabled?: boolean;
207
- show?: boolean;
208
- iconSize?: 'xs' | 'sm' | 'md' | 'lg' | string;
209
- tooltip?: string;
210
- }
211
-
212
- export interface DropdownEmits {
213
- 'update:show': [value: boolean];
214
- }
215
-
216
- export interface SelectOption {
217
- $isDisabled?: boolean;
218
- isCustom?: boolean;
219
- label?: string;
220
- [key: string]: unknown;
221
- }
222
-
223
- export interface SelectProps {
224
- // From selectMixin
225
- isInternalSearch?: boolean;
226
- options: SelectOption[] | string[]; // required
227
- modelValue?: string | SelectOption | null;
228
- trackBy?: string | null;
229
- label?: string;
230
- imageUrlField?: string | null;
231
- isSearchable?: boolean;
232
- shouldHideSelected?: boolean;
233
- placeholder?: string;
234
- shouldAllowEmpty?: boolean;
235
- shouldResetAfter?: boolean;
236
- shouldCloseOnSelect?: boolean;
237
- customLabel?: (option: SelectOption | string, label?: string) => string;
238
- shouldAllowCustom?: boolean;
239
- customPlaceholder?: string;
240
- customPosition?: 'top' | 'bottom' | string;
241
- id?: string | null;
242
- optionsLimit?: number;
243
- shouldPreserveSearch?: boolean;
244
- shouldPreselectFirst?: boolean;
245
- shouldPreventAutofocus?: boolean;
246
- isDisabled?: boolean;
247
- // From Select.vue
248
- name?: string;
249
- selectLabel?: string;
250
- selectedLabel?: string;
251
- deselectLabel?: string;
252
- shouldShowLabels?: boolean;
253
- maxHeight?: number;
254
- isLoading?: boolean;
255
- openDirection?: 'above' | 'below' | 'top' | 'bottom' | string;
256
- shouldShowNoResults?: boolean;
257
- tabindex?: number;
258
- shouldSelectExactMatchOnBlur?: boolean;
259
- isInvalid?: boolean;
260
- }
261
-
262
- export interface SelectEmits {
263
- 'update:modelValue': [option: SelectOption | string | null, id?: string | null];
264
- 'search-change': [search: string, id?: string | null];
265
- 'remove': [option: SelectOption | string, id?: string | null];
266
- 'open': [id?: string | null];
267
- 'close': [value: SelectOption | string | null, id?: string | null];
268
- 'custom': [label: string, id?: string | null];
269
- }
270
-
271
- // Loader has no props - it's a simple SVG spinner
272
- export interface LoaderProps {}
273
-
274
- // ============ Atom Components (Stubs) ============
275
- export const Button: DefineComponent<ButtonProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, ButtonEmits>;
276
- export const ButtonGroup: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
277
- export const Dropdown: DefineComponent<DropdownProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, DropdownEmits>;
278
- export const DropdownItem: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
279
- export const Icon: DefineComponent<IconProps, Record<string, unknown>, unknown>;
280
- export const DcomIcon: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
281
- export const Modal: DefineComponent<ModalProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, ModalEmits>;
282
- export const Loader: DefineComponent<LoaderProps>;
283
- export const Tooltip: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
284
- export const Picture: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
285
- export const HelloBar: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
286
- export const PromoCard: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
287
- export const SearchBar: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
288
- export const StarRating: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
289
- export const TabMenu: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
290
- export const TextInput: DefineComponent<TextInputProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, TextInputEmits>;
291
- export const TextCopyField: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
292
- export const Textarea: DefineComponent<TextareaProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, TextInputEmits>;
293
- export const Toggle: DefineComponent<CheckboxProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, CheckboxEmits>;
294
- export const Checkbox: DefineComponent<CheckboxProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, CheckboxEmits>;
295
- export const ColorPicker: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
296
- export const Carousel: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
297
- export const Checktile: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
298
- export const Pill: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
299
- export const PillBar: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
300
- export const Notice: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
301
- export const Masonry: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
302
- export const CollapsiblePanel: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
303
- export const Slider: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
304
- export const Price: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
305
- export const HashRouteModal: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
306
- export const Select: DefineComponent<SelectProps, Record<string, unknown>, unknown, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, SelectEmits>;
307
- export const NumberStepper: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
308
- export const CopyToClipboardText: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
309
- export const SparkleIcon: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
@@ -1,81 +0,0 @@
1
- // types-test/all-components.test.ts
2
- import {
3
- // Experiences
4
- UploadYourLogoDropzone,
5
- UploadYourLogoApplication,
6
- UploadedLogoSearchResultCard,
7
- SignUpModal,
8
- SignUp,
9
- SignIn,
10
- ForgotPasswordModal,
11
- ForgotPassword,
12
- ResetPasswordModal,
13
- ResetPassword,
14
- ResetPasswordSuccessModal,
15
- PaymentConfigList,
16
- PaymentConfigDropdown,
17
- SellDomainNameListModal,
18
- SellDomainNameList,
19
- SellDomainNameWidget,
20
- PublishBrandPageModal,
21
- PublishBrandPageCard,
22
- WebsiteContextualUpgradeModal,
23
- // Atoms
24
- Button,
25
- ButtonGroup,
26
- Dropdown,
27
- DropdownItem,
28
- Icon,
29
- DcomIcon,
30
- Modal,
31
- Loader,
32
- Tooltip,
33
- Picture,
34
- HelloBar,
35
- PromoCard,
36
- SearchBar,
37
- StarRating,
38
- TabMenu,
39
- TextInput,
40
- TextCopyField,
41
- Textarea,
42
- Toggle,
43
- Checkbox,
44
- ColorPicker,
45
- Carousel,
46
- Checktile,
47
- Pill,
48
- PillBar,
49
- Notice,
50
- Masonry,
51
- CollapsiblePanel,
52
- Slider,
53
- Price,
54
- HashRouteModal,
55
- Select,
56
- NumberStepper,
57
- CopyToClipboardText,
58
- SparkleIcon,
59
- // Utilities
60
- setSharedLibLocaleAsync,
61
- tr,
62
- brandPageApiClient,
63
- brandCrowdApiClient,
64
- WEBSITE_UPGRADE_CONTEXT_TYPES,
65
- } from '..';
66
-
67
- // All imports should be defined
68
- const components = [
69
- UploadYourLogoDropzone, UploadYourLogoApplication, UploadedLogoSearchResultCard,
70
- SignUpModal, SignUp, SignIn, ForgotPasswordModal, ForgotPassword,
71
- ResetPasswordModal, ResetPassword, ResetPasswordSuccessModal,
72
- PaymentConfigList, PaymentConfigDropdown, SellDomainNameListModal,
73
- SellDomainNameList, SellDomainNameWidget, PublishBrandPageModal,
74
- PublishBrandPageCard, WebsiteContextualUpgradeModal,
75
- Button, ButtonGroup, Dropdown, DropdownItem, Icon, DcomIcon, Modal,
76
- Loader, Tooltip, Picture, HelloBar, PromoCard, SearchBar, StarRating,
77
- TabMenu, TextInput, TextCopyField, Textarea, Toggle, Checkbox,
78
- ColorPicker, Carousel, Checktile, Pill, PillBar, Notice, Masonry,
79
- CollapsiblePanel, Slider, Price, HashRouteModal, Select, NumberStepper,
80
- CopyToClipboardText, SparkleIcon,
81
- ];
@@ -1,16 +0,0 @@
1
- // types-test/basic-imports.test.ts
2
- // This file tests that basic imports work - compilation = pass
3
-
4
- import { Button, Modal, Icon, setSharedLibLocaleAsync, tr } from '..';
5
-
6
- // If this file compiles, the basic exports are typed
7
- const _button: typeof Button = Button;
8
- const _modal: typeof Modal = Modal;
9
- const _icon: typeof Icon = Icon;
10
-
11
- // Test utility function types
12
- async function testUtils() {
13
- await setSharedLibLocaleAsync('en-US');
14
- const translated: string = tr('key');
15
- const translatedWithParams: string = tr('key', { name: 'test' });
16
- }
@@ -1,63 +0,0 @@
1
- // types-test/button-props.test.ts
2
- // This file tests that ButtonProps interface is properly exported and typed
3
-
4
- import { Button, type ButtonProps } from '..';
5
-
6
- // Test that ButtonProps can be used as a type
7
- const props: ButtonProps = {
8
- label: 'Click me',
9
- variant: 'primary',
10
- disabled: false,
11
- };
12
-
13
- // Test that props have specific types (these should compile without errors)
14
- const label: ButtonProps['label'] = 'test';
15
- const variant: ButtonProps['variant'] = 'primary';
16
- const disabled: ButtonProps['disabled'] = true;
17
- const size: ButtonProps['size'] = 'medium';
18
- const theme: ButtonProps['theme'] = 'brandCrowd';
19
- const fullWidth: ButtonProps['fullWidth'] = true;
20
- const iconLeft: ButtonProps['iconLeft'] = 'chevron-left';
21
- const iconRight: ButtonProps['iconRight'] = 'chevron-right';
22
- const isBusy: ButtonProps['isBusy'] = false;
23
- const target: ButtonProps['target'] = '_blank';
24
- const type: ButtonProps['type'] = 'submit';
25
-
26
- // Test that Button component is typed
27
- const _button: typeof Button = Button;
28
-
29
- // Test that all known variants are accepted
30
- const variantProps: ButtonProps = {
31
- variant: 'outline-primary',
32
- };
33
-
34
- const variantProps2: ButtonProps = {
35
- variant: 'success',
36
- };
37
-
38
- const variantProps3: ButtonProps = {
39
- variant: 'warning',
40
- };
41
-
42
- // Test size values
43
- const sizeProps: ButtonProps = {
44
- size: 'small',
45
- };
46
-
47
- const sizeProps2: ButtonProps = {
48
- size: 'large',
49
- };
50
-
51
- // Test classes can be string or object
52
- const classesString: ButtonProps = {
53
- classes: 'custom-class',
54
- };
55
-
56
- const classesObject: ButtonProps = {
57
- classes: { 'custom-class': true },
58
- };
59
-
60
- // Test that attrs accepts Record<string, unknown>
61
- const attrsProps: ButtonProps = {
62
- attrs: { 'data-testid': 'button-test' },
63
- };
@@ -1,78 +0,0 @@
1
- // types-test/checkbox-toggle-props.test.ts
2
- // This file tests that CheckboxProps and CheckboxEmits interfaces are properly exported and typed
3
-
4
- import { Checkbox, Toggle, type CheckboxProps, type CheckboxEmits } from '..';
5
-
6
- // Test that CheckboxProps can be used as a type
7
- const props: CheckboxProps = {
8
- modelValue: true,
9
- id: 'checkbox-1',
10
- label: 'Accept terms',
11
- };
12
-
13
- // Test required props
14
- const modelValue: CheckboxProps['modelValue'] = true;
15
- const id: CheckboxProps['id'] = 'checkbox-id';
16
-
17
- // Test optional props
18
- const label: CheckboxProps['label'] = 'Remember me';
19
- const showLabelScreenReaderOnly: CheckboxProps['showLabelScreenReaderOnly'] = true;
20
- const inline: CheckboxProps['inline'] = true;
21
- const required: CheckboxProps['required'] = true;
22
- const disabled: CheckboxProps['disabled'] = false;
23
- const showBorder: CheckboxProps['showBorder'] = true;
24
-
25
- // Test color variants
26
- const colorSuccess: CheckboxProps = { modelValue: true, id: 'cb', color: 'success' };
27
- const colorInfo: CheckboxProps = { modelValue: true, id: 'cb', color: 'info' };
28
- const colorError: CheckboxProps = { modelValue: true, id: 'cb', color: 'error' };
29
- const colorWarning: CheckboxProps = { modelValue: true, id: 'cb', color: 'warning' };
30
- const colorPrimary: CheckboxProps = { modelValue: true, id: 'cb', color: 'primary' };
31
-
32
- // Test size variants
33
- const sizeSm: CheckboxProps = { modelValue: true, id: 'cb', size: 'sm' };
34
- const sizeMd: CheckboxProps = { modelValue: true, id: 'cb', size: 'md' };
35
-
36
- // Test classes can be string or object
37
- const classesString: CheckboxProps = {
38
- modelValue: true,
39
- id: 'cb',
40
- classes: 'custom-class',
41
- };
42
-
43
- const classesObject: CheckboxProps = {
44
- modelValue: true,
45
- id: 'cb',
46
- classes: { 'custom-class': true },
47
- };
48
-
49
- // Test that Checkbox component is typed
50
- const _checkbox: typeof Checkbox = Checkbox;
51
-
52
- // Test that Toggle component uses same props
53
- const _toggle: typeof Toggle = Toggle;
54
-
55
- // Toggle with same props as Checkbox
56
- const toggleProps: CheckboxProps = {
57
- modelValue: false,
58
- id: 'toggle-1',
59
- label: 'Dark mode',
60
- color: 'primary',
61
- size: 'md',
62
- inline: true,
63
- };
64
-
65
- // Test complete props object
66
- const fullProps: CheckboxProps = {
67
- modelValue: true,
68
- id: 'terms-checkbox',
69
- label: 'I accept the terms and conditions',
70
- showLabelScreenReaderOnly: false,
71
- inline: false,
72
- required: true,
73
- disabled: false,
74
- color: 'success',
75
- size: 'md',
76
- showBorder: true,
77
- classes: 'my-checkbox',
78
- };
@@ -1,36 +0,0 @@
1
- import { Dropdown, type DropdownProps, type DropdownEmits } from '..';
2
-
3
- // Test DropdownProps interface
4
- const dropdownProps: DropdownProps = {
5
- menuAlign: 'right',
6
- title: 'Select an option',
7
- elementClasses: 'tw-custom-class',
8
- menuElementClasses: 'tw-menu-class',
9
- disabled: false,
10
- show: false,
11
- iconSize: 'sm',
12
- tooltip: 'Click to open',
13
- };
14
-
15
- // Test with minimal props
16
- const minimalProps: DropdownProps = {};
17
-
18
- // Test menu alignment options
19
- const leftAligned: DropdownProps = { menuAlign: 'left' };
20
- const rightAligned: DropdownProps = { menuAlign: 'right' };
21
- const customAlign: DropdownProps = { menuAlign: 'center' }; // string allows custom values
22
-
23
- // Test icon sizes
24
- const xsIcon: DropdownProps = { iconSize: 'xs' };
25
- const smIcon: DropdownProps = { iconSize: 'sm' };
26
- const mdIcon: DropdownProps = { iconSize: 'md' };
27
- const lgIcon: DropdownProps = { iconSize: 'lg' };
28
-
29
- // Test disabled state
30
- const disabledDropdown: DropdownProps = { disabled: true };
31
-
32
- // Test show state (v-model:show)
33
- const visibleDropdown: DropdownProps = { show: true };
34
-
35
- // Verify component type includes props and emits
36
- type DropdownComponent = typeof Dropdown;
@@ -1,42 +0,0 @@
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
- };
@@ -1,7 +0,0 @@
1
- import { Loader, type LoaderProps } from '..';
2
-
3
- // Loader has no props - it's a simple SVG spinner
4
- const props: LoaderProps = {};
5
-
6
- // Verify component type
7
- type LoaderComponent = typeof Loader;
@@ -1,39 +0,0 @@
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'];