@legalaidalberta/luic 0.0.0
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/CHANGELOG.md +93 -0
- package/README.md +73 -0
- package/dist/components/card/card.d.ts +6 -0
- package/dist/components/card/card.stories.d.ts +24 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +24 -0
- package/dist/components/checkbox/checkbox.stories.d.ts +47 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/color-picker/color-picker.d.ts +32 -0
- package/dist/components/color-picker/color-picker.stories.d.ts +74 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/currency-input/currency-input.d.ts +48 -0
- package/dist/components/currency-input/currency-input.stories.d.ts +86 -0
- package/dist/components/currency-input/index.d.ts +1 -0
- package/dist/components/data-table/data-table.d.ts +100 -0
- package/dist/components/data-table/data-table.stories.d.ts +82 -0
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/date-picker/date-picker.d.ts +33 -0
- package/dist/components/date-picker/date-picker.stories.d.ts +65 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/file-upload/file-upload.d.ts +44 -0
- package/dist/components/file-upload/file-upload.stories.d.ts +72 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/multi-select/index.d.ts +1 -0
- package/dist/components/multi-select/multi-select.d.ts +63 -0
- package/dist/components/multi-select/multi-select.stories.d.ts +71 -0
- package/dist/components/numeric-input/index.d.ts +1 -0
- package/dist/components/numeric-input/numeric-input.d.ts +65 -0
- package/dist/components/numeric-input/numeric-input.stories.d.ts +90 -0
- package/dist/components/password-input/index.d.ts +1 -0
- package/dist/components/password-input/password-input.d.ts +32 -0
- package/dist/components/password-input/password-input.stories.d.ts +64 -0
- package/dist/components/percentage-input/index.d.ts +1 -0
- package/dist/components/percentage-input/percentage-input.d.ts +44 -0
- package/dist/components/percentage-input/percentage-input.stories.d.ts +78 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/radio.d.ts +26 -0
- package/dist/components/radio/radio.stories.d.ts +46 -0
- package/dist/components/rating/index.d.ts +1 -0
- package/dist/components/rating/rating.d.ts +51 -0
- package/dist/components/rating/rating.stories.d.ts +81 -0
- package/dist/components/search-input/index.d.ts +1 -0
- package/dist/components/search-input/search-input.d.ts +35 -0
- package/dist/components/search-input/search-input.stories.d.ts +64 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select.d.ts +41 -0
- package/dist/components/select/select.stories.d.ts +47 -0
- package/dist/components/shared/FormErrorText.d.ts +12 -0
- package/dist/components/shared/FormField.d.ts +61 -0
- package/dist/components/shared/FormHelperText.d.ts +12 -0
- package/dist/components/shared/FormLabel.d.ts +25 -0
- package/dist/components/shared/index.d.ts +7 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/slider.d.ts +59 -0
- package/dist/components/slider/slider.stories.d.ts +86 -0
- package/dist/components/tag-input/index.d.ts +1 -0
- package/dist/components/tag-input/tag-input.d.ts +55 -0
- package/dist/components/tag-input/tag-input.stories.d.ts +68 -0
- package/dist/components/text-input/index.d.ts +1 -0
- package/dist/components/text-input/text-input.d.ts +24 -0
- package/dist/components/text-input/text-input.stories.d.ts +54 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +36 -0
- package/dist/components/textarea/textarea.stories.d.ts +68 -0
- package/dist/components/time-picker/index.d.ts +1 -0
- package/dist/components/time-picker/time-picker.d.ts +37 -0
- package/dist/components/time-picker/time-picker.stories.d.ts +73 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/toggle.d.ts +34 -0
- package/dist/components/toggle/toggle.stories.d.ts +61 -0
- package/dist/components/url-input/index.d.ts +1 -0
- package/dist/components/url-input/url-input.d.ts +28 -0
- package/dist/components/url-input/url-input.stories.d.ts +60 -0
- package/dist/hooks/useControllableValue.d.ts +44 -0
- package/dist/hooks/useFormField.d.ts +73 -0
- package/dist/index.d.ts +27 -0
- package/dist/luic.cjs.js +6 -0
- package/dist/luic.es.js +2475 -0
- package/dist/luic.umd.js +6 -0
- package/dist/styles.css +2 -0
- package/dist/types/common.d.ts +59 -0
- package/dist/utils/cn.d.ts +18 -0
- package/package.json +77 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./data-table').DataTableProps<unknown> & import('react').RefAttributes<HTMLTableElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "text";
|
|
10
|
+
};
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
selectable: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "boolean";
|
|
40
|
+
};
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
hoverable: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "boolean";
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
striped: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "boolean";
|
|
52
|
+
};
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
size: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "select";
|
|
58
|
+
};
|
|
59
|
+
options: string[];
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export default meta;
|
|
65
|
+
type Story = StoryObj<typeof meta>;
|
|
66
|
+
export declare const Default: Story;
|
|
67
|
+
export declare const WithHelperText: Story;
|
|
68
|
+
export declare const WithError: Story;
|
|
69
|
+
export declare const Selectable: Story;
|
|
70
|
+
export declare const PreSelectedRows: Story;
|
|
71
|
+
export declare const Disabled: Story;
|
|
72
|
+
export declare const DisabledWithSelection: Story;
|
|
73
|
+
export declare const EmptyState: Story;
|
|
74
|
+
export declare const SmallSize: Story;
|
|
75
|
+
export declare const LargeSize: Story;
|
|
76
|
+
export declare const Striped: Story;
|
|
77
|
+
export declare const NotHoverable: Story;
|
|
78
|
+
export declare const CustomCellRendering: Story;
|
|
79
|
+
export declare const WithRowClick: Story;
|
|
80
|
+
export declare const CustomColumnWidths: Story;
|
|
81
|
+
export declare const ProductsTable: Story;
|
|
82
|
+
export declare const OrdersTable: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataTable, type DataTableProps, type DataTableColumn, } from './data-table';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { BaseFormFieldProps } from '../../types/common';
|
|
3
|
+
export interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'type'>, BaseFormFieldProps {
|
|
4
|
+
/**
|
|
5
|
+
* Custom ID for the input element
|
|
6
|
+
* If not provided, a unique ID will be generated
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Minimum selectable date in YYYY-MM-DD format
|
|
11
|
+
*/
|
|
12
|
+
min?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum selectable date in YYYY-MM-DD format
|
|
15
|
+
*/
|
|
16
|
+
max?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* DatePicker component for selecting dates with a calendar interface
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <DatePicker
|
|
24
|
+
* label="Birth Date"
|
|
25
|
+
* value={birthDate}
|
|
26
|
+
* onChange={(e) => setBirthDate(e.target.value)}
|
|
27
|
+
* min="1900-01-01"
|
|
28
|
+
* max="2023-12-31"
|
|
29
|
+
* helperText="Select your date of birth"
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./date-picker').DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "text";
|
|
10
|
+
};
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
min: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "text";
|
|
40
|
+
};
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
max: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "text";
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export default meta;
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
53
|
+
export declare const Default: Story;
|
|
54
|
+
export declare const WithHelperText: Story;
|
|
55
|
+
export declare const WithError: Story;
|
|
56
|
+
export declare const Required: Story;
|
|
57
|
+
export declare const Disabled: Story;
|
|
58
|
+
export declare const WithMinDate: Story;
|
|
59
|
+
export declare const WithMaxDate: Story;
|
|
60
|
+
export declare const WithDateRange: Story;
|
|
61
|
+
export declare const BirthDatePicker: Story;
|
|
62
|
+
export declare const AppointmentPicker: Story;
|
|
63
|
+
export declare const EventDate: Story;
|
|
64
|
+
export declare const DeadlinePicker: Story;
|
|
65
|
+
export declare const MultipleDatePickers: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker, type DatePickerProps } from './date-picker';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { BaseFormFieldProps } from '../../types/common';
|
|
3
|
+
export interface FileUploadProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'type'>, BaseFormFieldProps {
|
|
4
|
+
/**
|
|
5
|
+
* Custom ID for the input element
|
|
6
|
+
* If not provided, a unique ID will be generated
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Allowed file types (e.g., '.pdf,.doc,.docx' or 'image/*')
|
|
11
|
+
*/
|
|
12
|
+
accept?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to allow multiple file selection
|
|
15
|
+
*/
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum file size in bytes
|
|
19
|
+
*/
|
|
20
|
+
maxSize?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Callback when files are selected
|
|
23
|
+
*/
|
|
24
|
+
onFilesSelected?: (files: FileList | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to show the file list
|
|
27
|
+
*/
|
|
28
|
+
showFileList?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* FileUpload component for selecting and uploading files
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <FileUpload
|
|
36
|
+
* label="Upload Document"
|
|
37
|
+
* accept=".pdf,.doc,.docx"
|
|
38
|
+
* multiple
|
|
39
|
+
* helperText="Max file size: 10MB"
|
|
40
|
+
* onFilesSelected={(files) => handleUpload(files)}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const FileUpload: import('react').ForwardRefExoticComponent<FileUploadProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./file-upload').FileUploadProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "text";
|
|
10
|
+
};
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
multiple: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "boolean";
|
|
40
|
+
};
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
accept: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "text";
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
showFileList: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "boolean";
|
|
52
|
+
};
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export default meta;
|
|
58
|
+
type Story = StoryObj<typeof meta>;
|
|
59
|
+
export declare const Default: Story;
|
|
60
|
+
export declare const WithHelperText: Story;
|
|
61
|
+
export declare const WithError: Story;
|
|
62
|
+
export declare const Required: Story;
|
|
63
|
+
export declare const Disabled: Story;
|
|
64
|
+
export declare const MultipleFiles: Story;
|
|
65
|
+
export declare const ImageUpload: Story;
|
|
66
|
+
export declare const DocumentUpload: Story;
|
|
67
|
+
export declare const WithMaxSize: Story;
|
|
68
|
+
export declare const ProfilePicture: Story;
|
|
69
|
+
export declare const AttachmentUpload: Story;
|
|
70
|
+
export declare const VideoUpload: Story;
|
|
71
|
+
export declare const WithoutFileList: Story;
|
|
72
|
+
export declare const MultipleUploads: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileUpload, type FileUploadProps } from './file-upload';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MultiSelect, type MultiSelectProps, type MultiSelectOption } from './multi-select';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { BaseFormFieldProps } from '../../types/common';
|
|
3
|
+
export interface MultiSelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface MultiSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange' | 'multiple' | 'id'>, BaseFormFieldProps {
|
|
9
|
+
/**
|
|
10
|
+
* Custom ID for the select element
|
|
11
|
+
* If not provided, a unique ID will be generated
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Available options
|
|
16
|
+
*/
|
|
17
|
+
options: MultiSelectOption[];
|
|
18
|
+
/**
|
|
19
|
+
* Selected values
|
|
20
|
+
*/
|
|
21
|
+
value?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when selection changes
|
|
24
|
+
*/
|
|
25
|
+
onChange?: (values: string[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder text when no options are selected
|
|
28
|
+
* @default "Select options..."
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of selected items to display before showing count
|
|
33
|
+
* @default 2
|
|
34
|
+
*/
|
|
35
|
+
maxDisplay?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to show select/deselect all buttons
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
showSelectAll?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Custom class name for the dropdown container
|
|
43
|
+
*/
|
|
44
|
+
dropdownClassName?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Multi-select dropdown component for selecting multiple options
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <MultiSelect
|
|
52
|
+
* label="Skills"
|
|
53
|
+
* options={[
|
|
54
|
+
* { value: 'react', label: 'React' },
|
|
55
|
+
* { value: 'vue', label: 'Vue' },
|
|
56
|
+
* { value: 'angular', label: 'Angular' }
|
|
57
|
+
* ]}
|
|
58
|
+
* value={selectedSkills}
|
|
59
|
+
* onChange={setSelectedSkills}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const MultiSelect: import('react').ForwardRefExoticComponent<MultiSelectProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./multi-select').MultiSelectProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "text";
|
|
10
|
+
};
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
placeholder: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "text";
|
|
40
|
+
};
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
maxDisplay: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "number";
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
showSelectAll: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "boolean";
|
|
52
|
+
};
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export default meta;
|
|
58
|
+
type Story = StoryObj<typeof meta>;
|
|
59
|
+
export declare const Default: Story;
|
|
60
|
+
export declare const WithHelperText: Story;
|
|
61
|
+
export declare const WithError: Story;
|
|
62
|
+
export declare const Required: Story;
|
|
63
|
+
export declare const Disabled: Story;
|
|
64
|
+
export declare const WithInitialSelection: Story;
|
|
65
|
+
export declare const ManyOptions: Story;
|
|
66
|
+
export declare const WithMaxDisplay: Story;
|
|
67
|
+
export declare const WithoutSelectAll: Story;
|
|
68
|
+
export declare const WithDisabledOptions: Story;
|
|
69
|
+
export declare const EmptyOptions: Story;
|
|
70
|
+
export declare const Categories: Story;
|
|
71
|
+
export declare const Tags: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NumericInput, type NumericInputProps } from './numeric-input';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { BaseFormFieldProps } from '../../types/common';
|
|
3
|
+
export interface NumericInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'id'>, BaseFormFieldProps {
|
|
4
|
+
/**
|
|
5
|
+
* Custom ID for the input element
|
|
6
|
+
* If not provided, a unique ID will be generated
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Minimum value
|
|
11
|
+
*/
|
|
12
|
+
min?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum value
|
|
15
|
+
*/
|
|
16
|
+
max?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Step increment/decrement value
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
step?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Current value
|
|
24
|
+
*/
|
|
25
|
+
value?: number | string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to show increment/decrement buttons
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
showSteppers?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback fired when value changes
|
|
33
|
+
*/
|
|
34
|
+
onValueChange?: (value: number | null) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Custom class name for the input wrapper
|
|
37
|
+
*/
|
|
38
|
+
wrapperClassName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Allow decimal values
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
allowDecimal?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Allow negative values
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
allowNegative?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Numeric input component with optional increment/decrement buttons
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <NumericInput
|
|
56
|
+
* label="Quantity"
|
|
57
|
+
* min={1}
|
|
58
|
+
* max={100}
|
|
59
|
+
* step={1}
|
|
60
|
+
* value={quantity}
|
|
61
|
+
* onValueChange={setQuantity}
|
|
62
|
+
* />
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const NumericInput: import('react').ForwardRefExoticComponent<NumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./numeric-input').NumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "text";
|
|
10
|
+
};
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
error: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helperText: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
min: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "number";
|
|
40
|
+
};
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
max: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "number";
|
|
46
|
+
};
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
step: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "number";
|
|
52
|
+
};
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
showSteppers: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
};
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
allowDecimal: {
|
|
62
|
+
control: {
|
|
63
|
+
type: "boolean";
|
|
64
|
+
};
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
allowNegative: {
|
|
68
|
+
control: {
|
|
69
|
+
type: "boolean";
|
|
70
|
+
};
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export default meta;
|
|
76
|
+
type Story = StoryObj<typeof meta>;
|
|
77
|
+
export declare const Default: Story;
|
|
78
|
+
export declare const WithHelperText: Story;
|
|
79
|
+
export declare const WithError: Story;
|
|
80
|
+
export declare const Required: Story;
|
|
81
|
+
export declare const Disabled: Story;
|
|
82
|
+
export declare const WithMinMax: Story;
|
|
83
|
+
export declare const WithCustomStep: Story;
|
|
84
|
+
export declare const WithoutSteppers: Story;
|
|
85
|
+
export declare const DecimalValues: Story;
|
|
86
|
+
export declare const NegativeValues: Story;
|
|
87
|
+
export declare const PositiveOnly: Story;
|
|
88
|
+
export declare const CartQuantity: Story;
|
|
89
|
+
export declare const LargeNumbers: Story;
|
|
90
|
+
export declare const Percentage: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PasswordInput, type PasswordInputProps } from './password-input';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { BaseFormFieldProps } from '../../types/common';
|
|
3
|
+
export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'id'>, BaseFormFieldProps {
|
|
4
|
+
/**
|
|
5
|
+
* Custom ID for the input element
|
|
6
|
+
* If not provided, a unique ID will be generated
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to show the toggle visibility button
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
showToggle?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Custom class name for the input wrapper
|
|
16
|
+
*/
|
|
17
|
+
wrapperClassName?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Password input component with show/hide toggle functionality
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <PasswordInput
|
|
25
|
+
* label="Password"
|
|
26
|
+
* placeholder="Enter your password"
|
|
27
|
+
* required
|
|
28
|
+
* helperText="Must be at least 8 characters"
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const PasswordInput: import('react').ForwardRefExoticComponent<PasswordInputProps & import('react').RefAttributes<HTMLInputElement>>;
|