@vkzstudio/muza-ui 1.0.42 → 1.0.44
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/dist/components/Accordion/Accordion.d.ts +42 -6
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +74 -12
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +60 -55
- package/dist/components/Button/Button.stories.d.ts +2 -0
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +52 -15
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +69 -36
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts +16 -12
- package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.js +70 -46
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts +2 -0
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts +73 -8
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +3 -0
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/index.d.ts +1 -1
- package/dist/components/ExpandableTable/index.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.d.ts +16 -0
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +105 -42
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +33 -34
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +50 -23
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +48 -1
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +34 -17
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +38 -21
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.d.ts +82 -46
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/index.d.ts +1 -1
- package/dist/components/TextEditor/index.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +41 -10
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8C9B,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,CAAC,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AAK,CAAC,SAAS,CAAA;IAC/B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,oEAAoE;IACpE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/C;AAED,qEAAqE;AACrE,UAAU,iBAAkB,SAAQ,iBAAiB;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;CACX;AAED,oFAAoF;AACpF,UAAU,gBAAiB,SAAQ,iBAAiB;IAClD,MAAM,EAAE,KAAK,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wGAAwG;AACxG,KAAK,aAAa,GAAG,iBAAiB,GAAG,gBAAgB,CAAA;AAsEzD,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAuO5C,CAAA"}
|
|
@@ -9,117 +9,180 @@ declare const fileUploadVariants: (props?: ({
|
|
|
9
9
|
/**
|
|
10
10
|
* Represents a remote file that is already uploaded and accessible via URL.
|
|
11
11
|
* Used to display previously-uploaded files without re-fetching them as `File` objects.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const urls: PreselectedUrl[] = [
|
|
15
|
+
* { url: 'https://cdn.example.com/photo.jpg', name: 'photo.jpg', type: 'image/jpeg', secondaryText: '3.2 MB' },
|
|
16
|
+
* { url: 'https://cdn.example.com/report.pdf', name: 'report.pdf', type: 'application/pdf' },
|
|
17
|
+
* ]
|
|
12
18
|
*/
|
|
13
19
|
export interface PreselectedUrl {
|
|
14
|
-
/** Direct URL to the file. */
|
|
20
|
+
/** Direct URL to the file. Used for opening the file in a new tab on download. */
|
|
15
21
|
url: string;
|
|
16
|
-
/** Display name
|
|
22
|
+
/** Display name shown in the file list item. */
|
|
17
23
|
name: string;
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* MIME type used to pick the file icon. If it starts with `"image/"` the item renders a
|
|
26
|
+
* thumbnail from `url`. When omitted, the extension in `name` is used as a fallback.
|
|
27
|
+
*/
|
|
19
28
|
type?: string;
|
|
20
|
-
/** File size in bytes
|
|
29
|
+
/** File size in bytes. Currently informational; not rendered directly — use `secondaryText` for display. */
|
|
21
30
|
size?: number;
|
|
22
|
-
/** Secondary text displayed below the file name (e.g., formatted file size). */
|
|
31
|
+
/** Secondary text displayed below the file name (e.g., formatted file size like `'3.2 MB'`). */
|
|
23
32
|
secondaryText?: React.ReactNode;
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Upload status for a single file in `FileUpload`, matched by index to `preselectedFiles`.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // Second file is 75% uploaded, first and third are done
|
|
39
|
+
* const status: FileUploadStatus[] = [
|
|
40
|
+
* { uploaded: true },
|
|
41
|
+
* { uploaded: false, progress: 75 },
|
|
42
|
+
* { uploaded: true },
|
|
43
|
+
* ]
|
|
44
|
+
*/
|
|
45
|
+
export interface FileUploadStatus {
|
|
46
|
+
/** Whether the file has finished uploading. Controls the icon (close vs download/trash). */
|
|
47
|
+
uploaded: boolean;
|
|
48
|
+
/** Upload progress in percent (0–100). Renders a progress bar under the item while strictly between 0 and 100. */
|
|
49
|
+
progress?: number;
|
|
50
|
+
}
|
|
25
51
|
/**
|
|
26
52
|
* Props for the FileUpload component.
|
|
27
53
|
* Extends standard div attributes except `onDrop`, `onError`, and `onChange`
|
|
28
54
|
* (replaced by component-specific callbacks).
|
|
29
55
|
*/
|
|
30
56
|
export interface FileUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop' | 'onError' | 'onChange'>, Omit<VariantProps<typeof fileUploadVariants>, 'isDragActive'> {
|
|
31
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Fires when files are dropped or selected (after internal validation). Receives the
|
|
59
|
+
* array of newly accepted files from the current interaction only — not the cumulative
|
|
60
|
+
* list. Use `onChange` for the full list after each change.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <FileUpload onDrop={(files) => uploadToServer(files)} />
|
|
64
|
+
*/
|
|
32
65
|
onDrop?: (acceptedFiles: File[]) => void;
|
|
33
66
|
/**
|
|
34
|
-
* Accepted file types as MIME type strings.
|
|
67
|
+
* Accepted file types as MIME type strings. Accepts either a single MIME type or an array.
|
|
68
|
+
* Wildcards (`image/*`, `video/*`) are supported.
|
|
35
69
|
*
|
|
36
70
|
* @example
|
|
37
|
-
* accept="image/*"
|
|
38
|
-
* accept={['image/*', 'application/pdf']}
|
|
71
|
+
* <FileUpload accept="image/*" />
|
|
72
|
+
* <FileUpload accept={['image/*', 'application/pdf']} />
|
|
39
73
|
*/
|
|
40
74
|
accept?: string | string[];
|
|
41
|
-
/** Allows selecting multiple files simultaneously. @default true */
|
|
75
|
+
/** Allows selecting multiple files simultaneously. When `false`, the dropzone hides after the first file is selected. @default true */
|
|
42
76
|
multiple?: boolean;
|
|
43
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Maximum allowed file size in bytes. Files exceeding this size are rejected and trigger `onError`.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* <FileUpload maxSize={5 * 1024 * 1024} /> // 5 MB
|
|
82
|
+
*/
|
|
44
83
|
maxSize?: number;
|
|
45
84
|
/** Custom error message when a file exceeds `maxSize`. Defaults to a translated message with the size in MB. */
|
|
46
85
|
maxSizeErrorMessage?: string;
|
|
47
|
-
/** Maximum number of files allowed. When reached, the dropzone is hidden. */
|
|
86
|
+
/** Maximum number of files allowed (counts both `preselectedFiles` and `preselectedUrls`). When reached, the dropzone is hidden. */
|
|
48
87
|
maxFiles?: number;
|
|
49
|
-
/** Custom error message when file count exceeds `maxFiles`. Defaults to a translated message. */
|
|
88
|
+
/** Custom error message when file count exceeds `maxFiles`. Defaults to a translated message with the count. */
|
|
50
89
|
maxFilesErrorMessage?: string;
|
|
51
90
|
/** Controls the visual size of file items in the list. @default 'base' */
|
|
52
91
|
size?: 'sm' | 'base' | 'lg';
|
|
53
|
-
/** Prevents interaction and applies disabled styling. @default false */
|
|
92
|
+
/** Prevents interaction and applies disabled styling to the dropzone and all file items. @default false */
|
|
54
93
|
disabled?: boolean;
|
|
55
|
-
/** Hides the dropzone and shows only uploaded files without delete buttons. @default false */
|
|
94
|
+
/** Hides the dropzone and shows only uploaded files without delete buttons. Download buttons remain available. @default false */
|
|
56
95
|
readOnly?: boolean;
|
|
57
96
|
/** Title text displayed inside the dropzone area. Defaults to a translated string. */
|
|
58
97
|
title?: string;
|
|
59
|
-
/** Label displayed above the upload area
|
|
98
|
+
/** Label displayed above the upload area via `FormField`. */
|
|
60
99
|
label?: string;
|
|
61
|
-
/** Subtitle text displayed below the title inside the dropzone. */
|
|
100
|
+
/** Subtitle text displayed below the title inside the dropzone (typically used for supported formats hint). */
|
|
62
101
|
subtitle?: string;
|
|
63
|
-
/** Applies error border and text styling to the dropzone. */
|
|
102
|
+
/** Applies error border and text styling to the dropzone. Independent of per-file errors in `itemErrors`. */
|
|
64
103
|
error?: boolean;
|
|
65
104
|
/** Marks the field as required and displays a red asterisk next to the label. @default false */
|
|
66
105
|
required?: boolean;
|
|
67
106
|
/** Hides the required asterisk even when `required` is true. @default false */
|
|
68
107
|
disableRequiredAsterisk?: boolean;
|
|
69
108
|
/**
|
|
70
|
-
* Additional options passed to react-dropzone.
|
|
71
|
-
*
|
|
109
|
+
* Additional options passed to the underlying react-dropzone hook. Props already managed by
|
|
110
|
+
* `FileUpload` (`onDrop`, `accept`, `multiple`, `maxSize`, `maxFiles`, `disabled`) are excluded.
|
|
111
|
+
*
|
|
72
112
|
* @see DropzoneOptions
|
|
73
113
|
*/
|
|
74
114
|
dropzoneOptions?: Omit<DropzoneOptions, 'onDrop' | 'accept' | 'multiple' | 'maxSize' | 'maxFiles' | 'disabled'>;
|
|
75
115
|
/** Files displayed in the list on mount. @default [] */
|
|
76
116
|
preselectedFiles?: File[];
|
|
77
117
|
/**
|
|
78
|
-
* Upload status for each file, matched by index to `preselectedFiles`.
|
|
79
|
-
*
|
|
118
|
+
* Upload status for each file, matched by index to `preselectedFiles`. Omit or pass an empty
|
|
119
|
+
* array to treat all files as not-yet-uploaded.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* <FileUpload
|
|
123
|
+
* preselectedFiles={[file1, file2]}
|
|
124
|
+
* fileStatus={[{ uploaded: true }, { uploaded: false, progress: 42 }]}
|
|
125
|
+
* />
|
|
126
|
+
*
|
|
127
|
+
* @see FileUploadStatus
|
|
80
128
|
* @default []
|
|
81
129
|
*/
|
|
82
|
-
fileStatus?:
|
|
83
|
-
uploaded: boolean;
|
|
84
|
-
progress?: number;
|
|
85
|
-
}[];
|
|
130
|
+
fileStatus?: FileUploadStatus[];
|
|
86
131
|
/**
|
|
87
|
-
* Per-file error messages keyed by File reference.
|
|
132
|
+
* Per-file error messages keyed by File reference. Displayed below the file item with error styling.
|
|
88
133
|
*
|
|
89
134
|
* @example
|
|
90
|
-
* const
|
|
91
|
-
* <FileUpload itemErrors={
|
|
135
|
+
* const itemErrors = new Map<File, React.ReactNode>([[file, 'Upload failed']])
|
|
136
|
+
* <FileUpload itemErrors={itemErrors} />
|
|
92
137
|
*/
|
|
93
138
|
itemErrors?: Map<File, React.ReactNode>;
|
|
94
139
|
/**
|
|
95
|
-
* Per-file hint messages keyed by File reference.
|
|
140
|
+
* Per-file hint messages keyed by File reference. Displayed below the file item with secondary styling.
|
|
96
141
|
*
|
|
97
142
|
* @example
|
|
98
|
-
* const
|
|
99
|
-
* <FileUpload itemHints={
|
|
143
|
+
* const itemHints = new Map<File, React.ReactNode>([[file, 'Will be optimized before upload']])
|
|
144
|
+
* <FileUpload itemHints={itemHints} />
|
|
100
145
|
*/
|
|
101
146
|
itemHints?: Map<File, React.ReactNode>;
|
|
102
147
|
/**
|
|
103
|
-
* Per-file secondary text keyed by File reference (e.g., formatted file size).
|
|
148
|
+
* Per-file secondary text keyed by File reference (e.g., formatted file size). Displayed below the file name inside the item.
|
|
104
149
|
*
|
|
105
150
|
* @example
|
|
106
|
-
* const
|
|
107
|
-
* <FileUpload itemSecondaryTexts={
|
|
151
|
+
* const itemSecondaryTexts = new Map<File, React.ReactNode>([[file, '7 MB']])
|
|
152
|
+
* <FileUpload itemSecondaryTexts={itemSecondaryTexts} />
|
|
108
153
|
*/
|
|
109
154
|
itemSecondaryTexts?: Map<File, React.ReactNode>;
|
|
110
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Fires when an error occurs (file too large, too many files, processing or deletion failure).
|
|
157
|
+
* Receives the error message and the optional file that caused it.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* <FileUpload onError={(msg, file) => toast({ variant: 'error', text: msg })} />
|
|
161
|
+
*/
|
|
111
162
|
onError?: (error: string, file?: File) => void;
|
|
112
|
-
/** Fires when a
|
|
163
|
+
/** Fires when a `File` item is removed. Receives the deleted file and its index in `preselectedFiles`. */
|
|
113
164
|
onDelete?: (file: File, index: number) => void;
|
|
114
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Fires when the internal file list changes (after drop or delete). Receives the full updated array,
|
|
167
|
+
* including previously-selected files.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* <FileUpload onChange={(files) => setValue('attachments', files)} />
|
|
171
|
+
*/
|
|
115
172
|
onChange?: (files: File[]) => void;
|
|
116
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Already-uploaded files to display via URL, without needing `File` objects. Rendered before
|
|
175
|
+
* `preselectedFiles` in the list.
|
|
176
|
+
*
|
|
177
|
+
* @see PreselectedUrl
|
|
178
|
+
* @default []
|
|
179
|
+
*/
|
|
117
180
|
preselectedUrls?: PreselectedUrl[];
|
|
118
|
-
/** Fires when a URL-backed item is
|
|
181
|
+
/** Fires when a URL-backed item is removed. Receives the item and its index in `preselectedUrls`. @see PreselectedUrl */
|
|
119
182
|
onDeleteUrl?: (item: PreselectedUrl, index: number) => void;
|
|
120
|
-
/** Extra content rendered inline next to the label (e.g. a tooltip icon). */
|
|
183
|
+
/** Extra content rendered inline next to the label (e.g. a tooltip icon). Takes precedence over `infoTooltip`. */
|
|
121
184
|
labelExtra?: React.ReactNode;
|
|
122
|
-
/** Tooltip content shown in an info icon next to the label.
|
|
185
|
+
/** Tooltip content shown in an info icon next to the label. Ignored when `labelExtra` is provided. */
|
|
123
186
|
infoTooltip?: string;
|
|
124
187
|
}
|
|
125
188
|
declare const FileUpload: React.ForwardRefExoticComponent<FileUploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,gBAAgB,CAAA;AASlE,QAAA,MAAM,kBAAkB;;;;8EAoCvB,CAAA;AAgBD
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,gBAAgB,CAAA;AASlE,QAAA,MAAM,kBAAkB;;;;8EAoCvB,CAAA;AAgBD;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAA;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4GAA4G;IAC5G,IAAI,CAAC,EAAE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AsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,QAAA,MAAM,UAAU,wFAyRf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FileUpload, type FileUploadProps, type PreselectedUrl, } from './FileUpload';
|
|
1
|
+
export { FileUpload, type FileUploadProps, type FileUploadStatus, type PreselectedUrl, } from './FileUpload';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA"}
|
|
@@ -7,53 +7,54 @@ declare const inputWrapperVariants: (props?: ({
|
|
|
7
7
|
/**
|
|
8
8
|
* Props for the Input component.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Extends standard input attributes except `size` (replaced by a custom size
|
|
11
|
+
* variant), `type` (narrowed to a supported union), and `prefix`/`suffix`
|
|
12
|
+
* (replaced by ReactNode slots rendered inside the wrapper).
|
|
12
13
|
*/
|
|
13
14
|
export interface InputProps extends Omit<ComponentProps<'input'>, 'size' | 'prefix' | 'suffix' | 'type'>, VariantProps<typeof inputWrapperVariants> {
|
|
14
|
-
/**
|
|
15
|
+
/** Label text rendered above the input. */
|
|
15
16
|
label?: string;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @default
|
|
18
|
+
* HTML input type controlling keyboard layout and browser validation.
|
|
19
|
+
* @default 'text'
|
|
19
20
|
*/
|
|
20
21
|
type?: 'text' | 'email' | 'password' | 'number' | 'time';
|
|
21
|
-
/**
|
|
22
|
-
* Controls the visual size variant affecting height and typography.
|
|
23
|
-
* @default "base"
|
|
24
|
-
*/
|
|
22
|
+
/** Controls height and typography. @default 'base' */
|
|
25
23
|
size?: 'xs' | 'sm' | 'base' | 'lg';
|
|
26
|
-
/**
|
|
27
|
-
* Enables error state with red border and red hint text.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
24
|
+
/** Applies error border and hint styling. @default false */
|
|
30
25
|
error?: boolean;
|
|
31
|
-
/**
|
|
26
|
+
/** Content rendered before the input value (e.g. an icon). */
|
|
32
27
|
prefix?: ReactNode;
|
|
33
|
-
/**
|
|
28
|
+
/** Content rendered after the input value (e.g. an icon or action button). */
|
|
34
29
|
suffix?: ReactNode;
|
|
35
30
|
/**
|
|
36
|
-
* Hides the required asterisk
|
|
31
|
+
* Hides the required asterisk in the label even when `required` is `true`.
|
|
37
32
|
* @default false
|
|
38
33
|
*/
|
|
39
34
|
disableRequiredAsterisk?: boolean;
|
|
40
|
-
/**
|
|
35
|
+
/** Helper or error text rendered below the input. */
|
|
41
36
|
hint?: string;
|
|
42
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Custom content rendered inline next to the label. Takes precedence over
|
|
39
|
+
* `infoTooltip` when both are provided.
|
|
40
|
+
*/
|
|
43
41
|
labelExtra?: ReactNode;
|
|
44
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Tooltip content shown in an info icon next to the label. Ignored when
|
|
44
|
+
* `labelExtra` is provided.
|
|
45
|
+
*/
|
|
45
46
|
infoTooltip?: string;
|
|
46
47
|
/**
|
|
47
|
-
* Input mask pattern using react-imask syntax.
|
|
48
|
+
* Input mask pattern using [react-imask](https://imask.js.org/) syntax.
|
|
49
|
+
* All alphabetic input is automatically uppercased.
|
|
48
50
|
*
|
|
49
|
-
*
|
|
50
|
-
* - `0`
|
|
51
|
-
* - `a`
|
|
52
|
-
* - `*`
|
|
53
|
-
* -
|
|
51
|
+
* Pattern tokens:
|
|
52
|
+
* - `0` — digit (0-9)
|
|
53
|
+
* - `a` — letter (auto-uppercased)
|
|
54
|
+
* - `*` — alphanumeric (auto-uppercased)
|
|
55
|
+
* - any other character — literal
|
|
54
56
|
*
|
|
55
57
|
* @example
|
|
56
|
-
* ```tsx
|
|
57
58
|
* // Phone number: (123) 456-7890
|
|
58
59
|
* <Input mask="(000) 000-0000" />
|
|
59
60
|
*
|
|
@@ -62,18 +63,16 @@ export interface InputProps extends Omit<ComponentProps<'input'>, 'size' | 'pref
|
|
|
62
63
|
*
|
|
63
64
|
* // Mixed format: AB-1234-CD
|
|
64
65
|
* <Input mask="aa-0000-aa" />
|
|
65
|
-
* ```
|
|
66
66
|
*/
|
|
67
67
|
mask?: string;
|
|
68
68
|
/**
|
|
69
|
-
* Stops `click` events on the wrapper from propagating to ancestors. Use
|
|
70
|
-
* when the Input
|
|
71
|
-
* ReorderableTable row
|
|
72
|
-
*
|
|
69
|
+
* Stops `click` events on the wrapper from propagating to ancestors. Use
|
|
70
|
+
* when the Input sits inside a clickable container (e.g. a DataTable or
|
|
71
|
+
* ReorderableTable row with `onRowClick`) so clicking the input's padding,
|
|
72
|
+
* prefix, or suffix area does not trigger the parent's click handler.
|
|
73
73
|
*
|
|
74
|
-
*
|
|
75
|
-
* and `keydown`
|
|
76
|
-
* itself is preserved.
|
|
74
|
+
* Only `click` events are stopped — `focus`, `pointerdown`/`mousedown`,
|
|
75
|
+
* and `keydown` still bubble, and focus behavior on the input is preserved.
|
|
77
76
|
* @default false
|
|
78
77
|
*/
|
|
79
78
|
stopClickPropagation?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AACd,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B,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,KAAK,sHAiJjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAgK5B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAA;AAGnC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,KAgBtC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAgBnC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAgB3B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAyB3B,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,KAyBvC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAqBtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAA"}
|
|
@@ -1,31 +1,53 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Single selectable option in the MultiSelect dropdown.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* const option: IMultiSelectOption = {
|
|
7
|
+
* value: 'food',
|
|
8
|
+
* label: 'Food & Dining',
|
|
9
|
+
* icon: <Cutlery />,
|
|
10
|
+
* disabled: false,
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface IMultiSelectOption {
|
|
14
|
+
/** Unique value identifying the option. Matched against `value` to determine selection. */
|
|
15
|
+
value: string;
|
|
16
|
+
/** Display content rendered inside the dropdown item and inside the selected tag. */
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
/** Prevents the option from being toggled. Still visible in the dropdown. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Icon rendered before the label inside the dropdown item. */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
}
|
|
2
23
|
/**
|
|
3
24
|
* Props for the MultiSelect component.
|
|
4
25
|
*/
|
|
5
26
|
export interface IMultiSelectProps {
|
|
6
|
-
/** Label
|
|
27
|
+
/** Label rendered above the select via FormField. */
|
|
7
28
|
label?: string;
|
|
8
|
-
/** Helper text
|
|
29
|
+
/** Helper text rendered below the select. Switches to error color when `error` is true. */
|
|
9
30
|
hint?: string;
|
|
10
|
-
/** Applies error
|
|
31
|
+
/** Applies error border and switches `hint` to error color. @default false */
|
|
11
32
|
error?: boolean;
|
|
12
|
-
/** Marks the field as required
|
|
33
|
+
/** Marks the field as required. Renders an asterisk next to the label and sets `aria-required`. @default false */
|
|
13
34
|
required?: boolean;
|
|
14
35
|
/** Hides the required asterisk even when `required` is true. @default false */
|
|
15
36
|
disableRequiredAsterisk?: boolean;
|
|
16
|
-
/**
|
|
37
|
+
/** Reserved slot for content rendered after the selected values. Not currently rendered. */
|
|
17
38
|
suffix?: ReactNode;
|
|
18
|
-
/** Icon or element
|
|
39
|
+
/** Icon or element rendered before the selected tags or placeholder inside the trigger. */
|
|
19
40
|
prefix?: ReactNode;
|
|
20
|
-
/** Placeholder
|
|
41
|
+
/** Placeholder rendered when no options are selected. @default translations.select.placeholder */
|
|
21
42
|
placeholder?: string;
|
|
22
|
-
/** Text
|
|
43
|
+
/** Text rendered inside the dropdown when `options` is empty. @default translations.select.noOptions */
|
|
23
44
|
emptyMessage?: string;
|
|
24
|
-
/** Controls height and padding. @default 'base' */
|
|
45
|
+
/** Controls trigger height and padding. @default 'base' */
|
|
25
46
|
size?: 'xs' | 'sm' | 'base' | 'lg';
|
|
26
47
|
/**
|
|
27
|
-
*
|
|
48
|
+
* Selectable options rendered inside the dropdown.
|
|
28
49
|
*
|
|
50
|
+
* @see IMultiSelectOption
|
|
29
51
|
* @example
|
|
30
52
|
* <MultiSelect options={[
|
|
31
53
|
* { value: 'a', label: 'Option A' },
|
|
@@ -33,25 +55,30 @@ export interface IMultiSelectProps {
|
|
|
33
55
|
* { value: 'c', label: 'Option C', icon: <Icon /> },
|
|
34
56
|
* ]} />
|
|
35
57
|
*/
|
|
36
|
-
options:
|
|
37
|
-
|
|
38
|
-
label: ReactNode;
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
icon?: ReactNode;
|
|
41
|
-
}>;
|
|
42
|
-
/** Prevents interaction and applies disabled styling. */
|
|
58
|
+
options: IMultiSelectOption[];
|
|
59
|
+
/** Prevents interaction and applies disabled styling. @default false */
|
|
43
60
|
disabled?: boolean;
|
|
44
|
-
/** Maximum number of tag chips
|
|
61
|
+
/** Maximum number of tag chips rendered before overflow collapses into a `+N` counter tag. @default 2 */
|
|
45
62
|
maxNumberOfVisibleTags?: number;
|
|
46
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Currently selected option values. Use with `onChange` for controlled mode.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* <MultiSelect value={['apple', 'banana']} onChange={setValue} options={...} />
|
|
68
|
+
*/
|
|
47
69
|
value?: string[];
|
|
48
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Fires when the selection changes. Receives the full updated array of selected values.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <MultiSelect onChange={(values) => setSelected(values)} />
|
|
75
|
+
*/
|
|
49
76
|
onChange?: (value: string[]) => void;
|
|
50
|
-
/** Extra content rendered inline next to the label (e.g. a tooltip icon). */
|
|
77
|
+
/** Extra content rendered inline next to the label (e.g. a tooltip icon). Takes precedence over `infoTooltip`. */
|
|
51
78
|
labelExtra?: ReactNode;
|
|
52
|
-
/** Tooltip content
|
|
79
|
+
/** Tooltip content rendered in an info icon next to the label. Ignored if `labelExtra` is provided. */
|
|
53
80
|
infoTooltip?: string;
|
|
54
|
-
/** Distance in pixels from viewport edge before the dropdown repositions.
|
|
81
|
+
/** Distance in pixels from the viewport edge before the dropdown repositions. Forwarded to Radix `collisionPadding`. */
|
|
55
82
|
collisionPadding?: number;
|
|
56
83
|
}
|
|
57
84
|
export declare const MultiSelect: React.ForwardRefExoticComponent<IMultiSelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAgBd;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAgBd;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,KAAK,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,KAAK,EAAE,SAAS,CAAA;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,kHAAkH;IAClH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+EAA+E;IAC/E,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAClC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yGAAyG;IACzG,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACpC,kHAAkH;IAClH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,uGAAuG;IACvG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wHAAwH;IACxH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,WAAW,6FAkOvB,CAAA"}
|
|
@@ -32,19 +32,40 @@ export interface ReorderableGroupProps<T> {
|
|
|
32
32
|
* Fires when items are reordered with the new array order.
|
|
33
33
|
* Required unless `onSync` is provided, in which case it becomes an optional
|
|
34
34
|
* pass-through for immediate local feedback.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const [items, setItems] = useState(initialItems)
|
|
38
|
+
* <ReorderableGroup values={items} onReorder={setItems}>...</ReorderableGroup>
|
|
35
39
|
*/
|
|
36
40
|
onReorder?: (newOrder: T[]) => void;
|
|
37
41
|
/**
|
|
38
42
|
* Debounced sync callback. Fires once after the user finishes reordering
|
|
39
43
|
* (`syncDelay` ms after the last reorder event). When provided, the component
|
|
40
44
|
* manages internal state and blocks external `values` updates while sync is pending.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Persist new order to the server after the user finishes dragging
|
|
48
|
+
* <ReorderableGroup
|
|
49
|
+
* values={serverItems}
|
|
50
|
+
* onSync={(order) => api.saveOrder(order)}
|
|
51
|
+
* syncDelay={500}
|
|
52
|
+
* >
|
|
53
|
+
* {(items) => items.map(item => <ReorderableItem key={item.id} value={item}>...</ReorderableItem>)}
|
|
54
|
+
* </ReorderableGroup>
|
|
41
55
|
*/
|
|
42
56
|
onSync?: (newOrder: T[]) => void;
|
|
43
57
|
/** Milliseconds to wait after the last reorder event before calling `onSync`. @default 300 */
|
|
44
58
|
syncDelay?: number;
|
|
45
59
|
/**
|
|
46
|
-
*
|
|
60
|
+
* Fires when the internal sync pending state changes.
|
|
47
61
|
* Useful for showing loading indicators or disabling other interactions during sync.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <ReorderableGroup
|
|
65
|
+
* values={items}
|
|
66
|
+
* onSync={handleSync}
|
|
67
|
+
* onSyncPendingChange={setIsSyncing}
|
|
68
|
+
* >...</ReorderableGroup>
|
|
48
69
|
*/
|
|
49
70
|
onSyncPendingChange?: (isPending: boolean) => void;
|
|
50
71
|
/** Fires when a pointer drag interaction starts (handle grab or direct item drag). */
|
|
@@ -64,6 +85,14 @@ export interface ReorderableGroupProps<T> {
|
|
|
64
85
|
/**
|
|
65
86
|
* Wraps children with AnimatePresence to enable exit animations on ReorderableItems.
|
|
66
87
|
* Pass `true` for defaults (`mode="popLayout"`, `initial={false}`) or an object for custom config.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
* @example
|
|
91
|
+
* // Enable defaults
|
|
92
|
+
* <ReorderableGroup animatePresence values={items} onReorder={setItems}>...</ReorderableGroup>
|
|
93
|
+
*
|
|
94
|
+
* // Custom AnimatePresence config
|
|
95
|
+
* <ReorderableGroup animatePresence={{ mode: 'wait' }} values={items} onReorder={setItems}>...</ReorderableGroup>
|
|
67
96
|
*/
|
|
68
97
|
animatePresence?: boolean | Omit<AnimatePresenceProps, 'children'>;
|
|
69
98
|
/** Additional CSS classes. */
|
|
@@ -88,6 +117,16 @@ declare const ReorderableGroup: <T>(props: ReorderableGroupProps<T> & {
|
|
|
88
117
|
type ReorderableItemElement = 'li' | 'div' | 'tr';
|
|
89
118
|
/**
|
|
90
119
|
* Custom animation configuration for enter/exit transitions on a ReorderableItem.
|
|
120
|
+
* Passed to a ReorderableItem via the `animation` prop. Any omitted field falls back
|
|
121
|
+
* to the built-in default (opacity + scale fade).
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const slideIn: ReorderableItemAnimationConfig = {
|
|
125
|
+
* initial: { opacity: 0, x: -20 },
|
|
126
|
+
* animate: { opacity: 1, x: 0 },
|
|
127
|
+
* exit: { opacity: 0, x: 20 },
|
|
128
|
+
* transition: { duration: 0.15, ease: 'easeOut' },
|
|
129
|
+
* }
|
|
91
130
|
*/
|
|
92
131
|
export interface ReorderableItemAnimationConfig {
|
|
93
132
|
/** Mount animation state (motion `initial`). Set `false` to skip enter animation. */
|
|
@@ -128,6 +167,10 @@ export interface ReorderableItemProps<T> {
|
|
|
128
167
|
* - Object: merges with defaults — only override what you need.
|
|
129
168
|
* - `false` or omitted: no animation unless the parent group has `animatePresence` enabled,
|
|
130
169
|
* in which case defaults are applied automatically.
|
|
170
|
+
*
|
|
171
|
+
* @see ReorderableItemAnimationConfig
|
|
172
|
+
* @example
|
|
173
|
+
* <ReorderableItem animation={{ initial: { opacity: 0, x: -20 } }} value={item}>...</ReorderableItem>
|
|
131
174
|
*/
|
|
132
175
|
animation?: boolean | ReorderableItemAnimationConfig;
|
|
133
176
|
/** Additional CSS classes. */
|
|
@@ -139,6 +182,10 @@ export interface ReorderableItemProps<T> {
|
|
|
139
182
|
/**
|
|
140
183
|
* Controls Motion's layout animation mode.
|
|
141
184
|
* Use `"position"` to animate only position and prevent scale distortion when item height changes.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* // Prevent scale distortion on items with dynamic height
|
|
188
|
+
* <ReorderableItem layout="position" value={item}>...</ReorderableItem>
|
|
142
189
|
*/
|
|
143
190
|
layout?: true | 'position';
|
|
144
191
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reorderable.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAA;AAWrB,UAAU,4BAA4B,CAAC,CAAC,GAAG,OAAO;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAcD,QAAA,MAAM,mBAAmB,GAAI,CAAC,OACW,4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