@trackunit/react-form-components 1.8.91 → 1.8.93
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.93",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,23 +8,24 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"usehooks-ts": "^3.1.0",
|
|
12
11
|
"react-select": "^5.10.0",
|
|
12
|
+
"usehooks-ts": "^3.1.0",
|
|
13
13
|
"libphonenumber-js": "^1.12.22",
|
|
14
14
|
"@testing-library/react": "16.2.0",
|
|
15
15
|
"jest-fetch-mock": "^3.0.3",
|
|
16
16
|
"zod": "^3.23.8",
|
|
17
17
|
"react-hook-form": "7.62.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
20
|
-
"@trackunit/react-components": "1.10.
|
|
21
|
-
"@trackunit/ui-icons": "1.7.
|
|
22
|
-
"@trackunit/shared-utils": "1.9.
|
|
23
|
-
"@trackunit/ui-design-tokens": "1.7.
|
|
24
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
19
|
+
"@trackunit/css-class-variance-utilities": "1.7.60",
|
|
20
|
+
"@trackunit/react-components": "1.10.28",
|
|
21
|
+
"@trackunit/ui-icons": "1.7.61",
|
|
22
|
+
"@trackunit/shared-utils": "1.9.60",
|
|
23
|
+
"@trackunit/ui-design-tokens": "1.7.60",
|
|
24
|
+
"@trackunit/i18n-library-translation": "1.7.72",
|
|
25
25
|
"string-ts": "^2.0.0",
|
|
26
|
-
"@trackunit/react-test-setup": "1.4.
|
|
27
|
-
"@js-temporal/polyfill": "^0.5.1"
|
|
26
|
+
"@trackunit/react-test-setup": "1.4.60",
|
|
27
|
+
"@js-temporal/polyfill": "^0.5.1",
|
|
28
|
+
"@storybook/react-webpack5": "9.1.13"
|
|
28
29
|
},
|
|
29
30
|
"module": "./index.esm.js",
|
|
30
31
|
"main": "./index.cjs.js",
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common argTypes shared across Select component stories
|
|
3
|
+
* Essential controls for Select components
|
|
4
|
+
*/
|
|
5
|
+
export declare const selectMostImportantArgTypes: {
|
|
6
|
+
readonly options: {
|
|
7
|
+
readonly description: "Array of options to display in the select menu.";
|
|
8
|
+
};
|
|
9
|
+
readonly value: {
|
|
10
|
+
readonly table: {};
|
|
11
|
+
};
|
|
12
|
+
readonly defaultValue: {
|
|
13
|
+
readonly table: {};
|
|
14
|
+
};
|
|
15
|
+
readonly onChange: {
|
|
16
|
+
readonly table: {};
|
|
17
|
+
};
|
|
18
|
+
readonly placeholder: {
|
|
19
|
+
readonly control: {
|
|
20
|
+
readonly type: "text";
|
|
21
|
+
};
|
|
22
|
+
readonly description: "Text to display when no value is selected.";
|
|
23
|
+
};
|
|
24
|
+
readonly disabled: {
|
|
25
|
+
readonly control: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
readonly description: "Whether the select is disabled.";
|
|
29
|
+
};
|
|
30
|
+
readonly readOnly: {
|
|
31
|
+
readonly control: {
|
|
32
|
+
readonly type: "boolean";
|
|
33
|
+
};
|
|
34
|
+
readonly description: "Whether the select is read-only.";
|
|
35
|
+
};
|
|
36
|
+
readonly isLoading: {
|
|
37
|
+
readonly control: {
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
};
|
|
40
|
+
readonly description: "Display a loading indicator.";
|
|
41
|
+
};
|
|
42
|
+
readonly isClearable: {
|
|
43
|
+
readonly control: {
|
|
44
|
+
readonly type: "boolean";
|
|
45
|
+
};
|
|
46
|
+
readonly description: "Allow the user to clear the selected value. Displays a an × icon in the select field.";
|
|
47
|
+
};
|
|
48
|
+
readonly isSearchable: {
|
|
49
|
+
readonly control: {
|
|
50
|
+
readonly type: "boolean";
|
|
51
|
+
};
|
|
52
|
+
readonly description: "Allow the user to search/filter options by typing.";
|
|
53
|
+
};
|
|
54
|
+
readonly fieldSize: {
|
|
55
|
+
readonly control: {
|
|
56
|
+
readonly type: "radio";
|
|
57
|
+
};
|
|
58
|
+
readonly options: readonly ["small", "medium", "large"];
|
|
59
|
+
readonly description: "Size of the select field.";
|
|
60
|
+
};
|
|
61
|
+
readonly label: {
|
|
62
|
+
readonly control: {
|
|
63
|
+
readonly type: "text";
|
|
64
|
+
};
|
|
65
|
+
readonly description: "Label text for the select field.";
|
|
66
|
+
};
|
|
67
|
+
readonly hasError: {
|
|
68
|
+
readonly control: {
|
|
69
|
+
readonly type: "boolean";
|
|
70
|
+
};
|
|
71
|
+
readonly description: "Whether the select has a validation error. Puts a red border around the select field.";
|
|
72
|
+
};
|
|
73
|
+
readonly errorMessage: {
|
|
74
|
+
readonly control: {
|
|
75
|
+
readonly type: "text";
|
|
76
|
+
};
|
|
77
|
+
readonly description: "Error message to display when hasError is true.";
|
|
78
|
+
};
|
|
79
|
+
readonly helpText: {
|
|
80
|
+
readonly control: {
|
|
81
|
+
readonly type: "text";
|
|
82
|
+
};
|
|
83
|
+
readonly description: "Help text to display below the select.";
|
|
84
|
+
};
|
|
85
|
+
readonly onMenuOpen: {
|
|
86
|
+
readonly control: false;
|
|
87
|
+
readonly table: {
|
|
88
|
+
readonly type: {
|
|
89
|
+
readonly summary: "() => void";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly description: "Callback fired when the menu is opened.";
|
|
93
|
+
};
|
|
94
|
+
readonly getOptionLabel: {
|
|
95
|
+
readonly control: false;
|
|
96
|
+
readonly table: {
|
|
97
|
+
readonly type: {
|
|
98
|
+
readonly summary: "(option: Option) => string";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly description: "Resolves option data to a string to be displayed as the label for that option.";
|
|
102
|
+
};
|
|
103
|
+
readonly getOptionValue: {
|
|
104
|
+
readonly control: false;
|
|
105
|
+
readonly table: {
|
|
106
|
+
readonly type: {
|
|
107
|
+
readonly summary: "(option: Option) => string";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly description: "Resolves option data to a string to compare options and specify value attributes";
|
|
111
|
+
};
|
|
112
|
+
readonly getOptionLabelDescription: {
|
|
113
|
+
readonly control: false;
|
|
114
|
+
readonly table: {
|
|
115
|
+
readonly type: {
|
|
116
|
+
readonly summary: "(option: Option) => string | undefined";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly description: "Resolves option data to a string to be displayed as a description for that option. The option description is only shown in the the menu list, not in the selected value.";
|
|
120
|
+
};
|
|
121
|
+
readonly getOptionPrefix: {
|
|
122
|
+
readonly control: false;
|
|
123
|
+
readonly table: {
|
|
124
|
+
readonly type: {
|
|
125
|
+
readonly summary: "(option: Option) => ReactNode";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly description: "Resolves option data to a an element to be displayed as a prefix for that option.";
|
|
129
|
+
};
|
|
130
|
+
readonly prefix: {
|
|
131
|
+
readonly control: false;
|
|
132
|
+
readonly table: {
|
|
133
|
+
readonly type: {
|
|
134
|
+
readonly summary: "ReactNode";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly description: "Element to render before the text in the select (typically an icon).";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Combined argTypes object for Select components
|
|
142
|
+
*/
|
|
143
|
+
export declare const selectArgTypes: {
|
|
144
|
+
readonly options: {
|
|
145
|
+
readonly description: "Array of options to display in the select menu.";
|
|
146
|
+
};
|
|
147
|
+
readonly value: {
|
|
148
|
+
readonly table: {};
|
|
149
|
+
};
|
|
150
|
+
readonly defaultValue: {
|
|
151
|
+
readonly table: {};
|
|
152
|
+
};
|
|
153
|
+
readonly onChange: {
|
|
154
|
+
readonly table: {};
|
|
155
|
+
};
|
|
156
|
+
readonly placeholder: {
|
|
157
|
+
readonly control: {
|
|
158
|
+
readonly type: "text";
|
|
159
|
+
};
|
|
160
|
+
readonly description: "Text to display when no value is selected.";
|
|
161
|
+
};
|
|
162
|
+
readonly disabled: {
|
|
163
|
+
readonly control: {
|
|
164
|
+
readonly type: "boolean";
|
|
165
|
+
};
|
|
166
|
+
readonly description: "Whether the select is disabled.";
|
|
167
|
+
};
|
|
168
|
+
readonly readOnly: {
|
|
169
|
+
readonly control: {
|
|
170
|
+
readonly type: "boolean";
|
|
171
|
+
};
|
|
172
|
+
readonly description: "Whether the select is read-only.";
|
|
173
|
+
};
|
|
174
|
+
readonly isLoading: {
|
|
175
|
+
readonly control: {
|
|
176
|
+
readonly type: "boolean";
|
|
177
|
+
};
|
|
178
|
+
readonly description: "Display a loading indicator.";
|
|
179
|
+
};
|
|
180
|
+
readonly isClearable: {
|
|
181
|
+
readonly control: {
|
|
182
|
+
readonly type: "boolean";
|
|
183
|
+
};
|
|
184
|
+
readonly description: "Allow the user to clear the selected value. Displays a an × icon in the select field.";
|
|
185
|
+
};
|
|
186
|
+
readonly isSearchable: {
|
|
187
|
+
readonly control: {
|
|
188
|
+
readonly type: "boolean";
|
|
189
|
+
};
|
|
190
|
+
readonly description: "Allow the user to search/filter options by typing.";
|
|
191
|
+
};
|
|
192
|
+
readonly fieldSize: {
|
|
193
|
+
readonly control: {
|
|
194
|
+
readonly type: "radio";
|
|
195
|
+
};
|
|
196
|
+
readonly options: readonly ["small", "medium", "large"];
|
|
197
|
+
readonly description: "Size of the select field.";
|
|
198
|
+
};
|
|
199
|
+
readonly label: {
|
|
200
|
+
readonly control: {
|
|
201
|
+
readonly type: "text";
|
|
202
|
+
};
|
|
203
|
+
readonly description: "Label text for the select field.";
|
|
204
|
+
};
|
|
205
|
+
readonly hasError: {
|
|
206
|
+
readonly control: {
|
|
207
|
+
readonly type: "boolean";
|
|
208
|
+
};
|
|
209
|
+
readonly description: "Whether the select has a validation error. Puts a red border around the select field.";
|
|
210
|
+
};
|
|
211
|
+
readonly errorMessage: {
|
|
212
|
+
readonly control: {
|
|
213
|
+
readonly type: "text";
|
|
214
|
+
};
|
|
215
|
+
readonly description: "Error message to display when hasError is true.";
|
|
216
|
+
};
|
|
217
|
+
readonly helpText: {
|
|
218
|
+
readonly control: {
|
|
219
|
+
readonly type: "text";
|
|
220
|
+
};
|
|
221
|
+
readonly description: "Help text to display below the select.";
|
|
222
|
+
};
|
|
223
|
+
readonly onMenuOpen: {
|
|
224
|
+
readonly control: false;
|
|
225
|
+
readonly table: {
|
|
226
|
+
readonly type: {
|
|
227
|
+
readonly summary: "() => void";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly description: "Callback fired when the menu is opened.";
|
|
231
|
+
};
|
|
232
|
+
readonly getOptionLabel: {
|
|
233
|
+
readonly control: false;
|
|
234
|
+
readonly table: {
|
|
235
|
+
readonly type: {
|
|
236
|
+
readonly summary: "(option: Option) => string";
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly description: "Resolves option data to a string to be displayed as the label for that option.";
|
|
240
|
+
};
|
|
241
|
+
readonly getOptionValue: {
|
|
242
|
+
readonly control: false;
|
|
243
|
+
readonly table: {
|
|
244
|
+
readonly type: {
|
|
245
|
+
readonly summary: "(option: Option) => string";
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
readonly description: "Resolves option data to a string to compare options and specify value attributes";
|
|
249
|
+
};
|
|
250
|
+
readonly getOptionLabelDescription: {
|
|
251
|
+
readonly control: false;
|
|
252
|
+
readonly table: {
|
|
253
|
+
readonly type: {
|
|
254
|
+
readonly summary: "(option: Option) => string | undefined";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly description: "Resolves option data to a string to be displayed as a description for that option. The option description is only shown in the the menu list, not in the selected value.";
|
|
258
|
+
};
|
|
259
|
+
readonly getOptionPrefix: {
|
|
260
|
+
readonly control: false;
|
|
261
|
+
readonly table: {
|
|
262
|
+
readonly type: {
|
|
263
|
+
readonly summary: "(option: Option) => ReactNode";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
readonly description: "Resolves option data to a an element to be displayed as a prefix for that option.";
|
|
267
|
+
};
|
|
268
|
+
readonly prefix: {
|
|
269
|
+
readonly control: false;
|
|
270
|
+
readonly table: {
|
|
271
|
+
readonly type: {
|
|
272
|
+
readonly summary: "ReactNode";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
readonly description: "Element to render before the text in the select (typically an icon).";
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Legacy individual argTypes for backward compatibility
|
|
280
|
+
*/
|
|
281
|
+
export declare const fieldSizeArgType: {
|
|
282
|
+
readonly control: {
|
|
283
|
+
readonly type: "radio";
|
|
284
|
+
};
|
|
285
|
+
readonly options: readonly ["small", "medium", "large"];
|
|
286
|
+
readonly description: "Size of the select field.";
|
|
287
|
+
};
|
|
288
|
+
export declare const getOptionLabelArgType: {
|
|
289
|
+
readonly control: false;
|
|
290
|
+
readonly table: {
|
|
291
|
+
readonly type: {
|
|
292
|
+
readonly summary: "(option: Option) => string";
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
readonly description: "Resolves option data to a string to be displayed as the label for that option.";
|
|
296
|
+
};
|
|
297
|
+
export declare const getOptionValueArgType: {
|
|
298
|
+
readonly control: false;
|
|
299
|
+
readonly table: {
|
|
300
|
+
readonly type: {
|
|
301
|
+
readonly summary: "(option: Option) => string";
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
readonly description: "Resolves option data to a string to compare options and specify value attributes";
|
|
305
|
+
};
|
|
306
|
+
export declare const getOptionLabelDescriptionArgType: {
|
|
307
|
+
readonly control: false;
|
|
308
|
+
readonly table: {
|
|
309
|
+
readonly type: {
|
|
310
|
+
readonly summary: "(option: Option) => string | undefined";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly description: "Resolves option data to a string to be displayed as a description for that option. The option description is only shown in the the menu list, not in the selected value.";
|
|
314
|
+
};
|
|
315
|
+
export declare const getOptionPrefixArgType: {
|
|
316
|
+
readonly control: false;
|
|
317
|
+
readonly table: {
|
|
318
|
+
readonly type: {
|
|
319
|
+
readonly summary: "(option: Option) => ReactNode";
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
readonly description: "Resolves option data to a an element to be displayed as a prefix for that option.";
|
|
323
|
+
};
|