@redsift/pickers 10.2.0 → 10.3.0-alpha.10
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/CONTRIBUTING.md +4 -4
- package/index.d.ts +149 -79
- package/index.js +395 -262
- package/index.js.map +1 -1
- package/package.json +8 -8
package/CONTRIBUTING.md
CHANGED
|
@@ -58,6 +58,10 @@ The Design System is following a monorepo architecture, providing multiple packa
|
|
|
58
58
|
|
|
59
59
|
This package provides dashboard-related components and decorators to make charts and datagrid filterable using [crossfilter](https://crossfilter.github.io/crossfilter/).
|
|
60
60
|
|
|
61
|
+
- `@redsift/products`
|
|
62
|
+
|
|
63
|
+
This package provides ready-to-use implementation of components with a customize style to fit Red Sift's use cases. It is based on all other packages.
|
|
64
|
+
|
|
61
65
|
- _Deprecated_ `@redsift/design-system-legacy`
|
|
62
66
|
|
|
63
67
|
This package contains all components prior to the 6.0.0 version. These components are deprecated and contributing to this package is discouraged since it will be removed in the future.
|
|
@@ -133,9 +137,6 @@ import { BadgeProps } from './types';
|
|
|
133
137
|
|
|
134
138
|
const COMPONENT_NAME = 'Badge';
|
|
135
139
|
const CLASSNAME = 'redsift-badge';
|
|
136
|
-
const DEFAULT_PROPS: Partial<BadgeProps> = {
|
|
137
|
-
// default values
|
|
138
|
-
};
|
|
139
140
|
|
|
140
141
|
/**
|
|
141
142
|
* The Badge component.
|
|
@@ -158,7 +159,6 @@ export const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) =
|
|
|
158
159
|
);
|
|
159
160
|
});
|
|
160
161
|
Badge.className = CLASSNAME;
|
|
161
|
-
Badge.defaultProps = DEFAULT_PROPS;
|
|
162
162
|
Badge.displayName = COMPONENT_NAME;
|
|
163
163
|
```
|
|
164
164
|
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import * as _redsift_design_system from '@redsift/design-system';
|
|
2
|
-
import { ValueOf, TextProps, Theme, FlexboxProps,
|
|
2
|
+
import { ContainerProps, Comp, ValueOf, TextProps, Theme, FlexboxProps, ListboxContextProps, ButtonColor, ButtonVariant, TextFieldVariant } from '@redsift/design-system';
|
|
3
|
+
import React, { ComponentProps, RefObject, ReactElement, ReactNode } from 'react';
|
|
3
4
|
import { PopoverProps, PopoverContentProps, PopoverTriggerProps } from '@redsift/popovers';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Component props.
|
|
8
|
+
*/
|
|
9
|
+
interface ComboboxContentFooterProps extends ComponentProps<'div'>, ContainerProps {
|
|
10
|
+
}
|
|
11
|
+
type StyledComboboxContentFooterProps = ComboboxContentFooterProps & {};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The ComboboxContentFooter component.
|
|
15
|
+
*/
|
|
16
|
+
declare const ComboboxContentFooter: Comp<ComboboxContentFooterProps, HTMLDivElement>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Component props.
|
|
20
|
+
*/
|
|
21
|
+
interface ComboboxContentHeaderProps extends ComponentProps<'div'>, ContainerProps {
|
|
22
|
+
}
|
|
23
|
+
type StyledComboboxContentHeaderProps = ComboboxContentHeaderProps & {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The ComboboxContentHeader component.
|
|
27
|
+
*/
|
|
28
|
+
declare const ComboboxContentHeader: Comp<ComboboxContentHeaderProps, HTMLDivElement>;
|
|
5
29
|
|
|
6
30
|
/**
|
|
7
31
|
* Component variant.
|
|
@@ -46,6 +70,12 @@ type ComboboxState = {
|
|
|
46
70
|
freeTextItemRef?: RefObject<HTMLDivElement>;
|
|
47
71
|
/** Id of the first item used to create values. */
|
|
48
72
|
freeTextItemId?: string;
|
|
73
|
+
/** Class name to append to the trigger. */
|
|
74
|
+
readonly triggerClassName?: string;
|
|
75
|
+
/** Ref to the form, if any. */
|
|
76
|
+
formRef?: RefObject<HTMLFormElement>;
|
|
77
|
+
/** Ref to the submit button, if any. */
|
|
78
|
+
submitRef?: RefObject<HTMLButtonElement>;
|
|
49
79
|
};
|
|
50
80
|
/**
|
|
51
81
|
* Component props.
|
|
@@ -67,6 +97,10 @@ interface ComboboxProps extends PopoverProps {
|
|
|
67
97
|
type: 'startsWith' | 'contains' | 'endsWith';
|
|
68
98
|
caseSensitive?: boolean;
|
|
69
99
|
};
|
|
100
|
+
/** Ref to the form, if any. */
|
|
101
|
+
formRef?: RefObject<HTMLFormElement>;
|
|
102
|
+
/** Ref to the submit button, if any. */
|
|
103
|
+
submitRef?: RefObject<HTMLButtonElement>;
|
|
70
104
|
/** Whether the component is disabled or not. */
|
|
71
105
|
isDisabled?: boolean;
|
|
72
106
|
/** Whether the component is invalid or not. */
|
|
@@ -88,23 +122,13 @@ interface ComboboxProps extends PopoverProps {
|
|
|
88
122
|
selectionMode?: ComboboxSelectionMode;
|
|
89
123
|
/** Theme. */
|
|
90
124
|
theme?: Theme;
|
|
125
|
+
/** Class name to append to the trigger. */
|
|
126
|
+
triggerClassName?: string;
|
|
91
127
|
/** Props to forward to the wrapper. */
|
|
92
128
|
wrapperProps?: Omit<FlexboxProps, 'ref'>;
|
|
93
129
|
}
|
|
94
130
|
type StyledComboboxProps = ComboboxProps;
|
|
95
131
|
|
|
96
|
-
/**
|
|
97
|
-
* Component props.
|
|
98
|
-
*/
|
|
99
|
-
interface ComboboxContentFooterProps extends ComponentProps<'div'>, ContainerProps {
|
|
100
|
-
}
|
|
101
|
-
type StyledComboboxContentFooterProps = ComboboxContentFooterProps & {};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* The ComboboxContentFooter component.
|
|
105
|
-
*/
|
|
106
|
-
declare const ComboboxContentFooter: Comp<ComboboxContentFooterProps, HTMLDivElement>;
|
|
107
|
-
|
|
108
132
|
/**
|
|
109
133
|
* Component props.
|
|
110
134
|
*/
|
|
@@ -117,18 +141,6 @@ interface ComboboxContentListboxProps extends FlexboxProps {
|
|
|
117
141
|
*/
|
|
118
142
|
declare const ComboboxContentListbox: Comp<ComboboxContentListboxProps, HTMLDivElement>;
|
|
119
143
|
|
|
120
|
-
/**
|
|
121
|
-
* Component props.
|
|
122
|
-
*/
|
|
123
|
-
interface ComboboxContentHeaderProps extends ComponentProps<'div'>, ContainerProps {
|
|
124
|
-
}
|
|
125
|
-
type StyledComboboxContentHeaderProps = ComboboxContentHeaderProps & {};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The ComboboxContentHeader component.
|
|
129
|
-
*/
|
|
130
|
-
declare const ComboboxContentHeader: Comp<ComboboxContentHeaderProps, HTMLDivElement>;
|
|
131
|
-
|
|
132
144
|
/**
|
|
133
145
|
* Component props.
|
|
134
146
|
*/
|
|
@@ -156,6 +168,8 @@ interface ComboboxTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
|
|
|
156
168
|
value?: ComboboxValue;
|
|
157
169
|
isOpen?: boolean;
|
|
158
170
|
}) => ReactElement);
|
|
171
|
+
/** Whether the clear button should be hiding (not recommended) */
|
|
172
|
+
hideClearButton?: boolean;
|
|
159
173
|
/** Whether or not the expand/collapse icon button should be displayed or not. */
|
|
160
174
|
hideExpandButton?: boolean;
|
|
161
175
|
/** Whether the popover should open on focus. */
|
|
@@ -188,6 +202,73 @@ declare const Combobox: React.FC<ComboboxProps> & {
|
|
|
188
202
|
};
|
|
189
203
|
};
|
|
190
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Component props.
|
|
207
|
+
*/
|
|
208
|
+
interface MenuButtonContentFooterProps extends ComponentProps<'div'>, ContainerProps {
|
|
209
|
+
}
|
|
210
|
+
type StyledMenuButtonContentFooterProps = MenuButtonContentFooterProps & {};
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The MenuButtonContentFooter component.
|
|
214
|
+
*/
|
|
215
|
+
declare const MenuButtonContentFooter: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Component props.
|
|
219
|
+
*/
|
|
220
|
+
interface MenuButtonContentHeaderProps extends ComponentProps<'div'>, ContainerProps {
|
|
221
|
+
}
|
|
222
|
+
type StyledMenuButtonContentHeaderProps = MenuButtonContentHeaderProps & {};
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The MenuButtonContentHeader component.
|
|
226
|
+
*/
|
|
227
|
+
declare const MenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Component props.
|
|
231
|
+
*/
|
|
232
|
+
interface MenuButtonContentMenuProps extends FlexboxProps {
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The MenuButtonContentMenu component.
|
|
237
|
+
*/
|
|
238
|
+
declare const MenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Component props.
|
|
242
|
+
*/
|
|
243
|
+
interface MenuButtonContentProps extends PopoverContentProps {
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The MenuButtonContent component.
|
|
248
|
+
*/
|
|
249
|
+
declare const BaseMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement>;
|
|
250
|
+
declare const MenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> & {
|
|
251
|
+
Header: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
252
|
+
Menu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
253
|
+
Footer: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Component props.
|
|
258
|
+
*/
|
|
259
|
+
interface MenuButtonTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
|
|
260
|
+
/** Children */
|
|
261
|
+
children: ReactElement | ((state: {
|
|
262
|
+
value?: string;
|
|
263
|
+
isOpen?: boolean;
|
|
264
|
+
}) => ReactElement);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The MenuButtonTrigger component.
|
|
269
|
+
*/
|
|
270
|
+
declare const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement>;
|
|
271
|
+
|
|
191
272
|
/**
|
|
192
273
|
* Context props.
|
|
193
274
|
*/
|
|
@@ -196,7 +277,7 @@ type MenuButtonState = {
|
|
|
196
277
|
readonly color?: ButtonColor;
|
|
197
278
|
/** Whether the trigger is disabled or not. */
|
|
198
279
|
readonly isDisabled: boolean;
|
|
199
|
-
/** Class name to append to the
|
|
280
|
+
/** Class name to append to the trigger. */
|
|
200
281
|
readonly triggerClassName?: string;
|
|
201
282
|
/** Button variant that will be forward to the trigger. */
|
|
202
283
|
readonly variant?: ButtonVariant;
|
|
@@ -217,7 +298,7 @@ interface MenuButtonProps extends PopoverProps {
|
|
|
217
298
|
label?: string | ReactElement;
|
|
218
299
|
/** Additional label properties. */
|
|
219
300
|
labelProps?: Omit<TextProps, 'ref'>;
|
|
220
|
-
/** Class name to append to the
|
|
301
|
+
/** Class name to append to the trigger. */
|
|
221
302
|
triggerClassName?: string;
|
|
222
303
|
/** Button variant that will be forward to the trigger. */
|
|
223
304
|
variant?: ButtonVariant;
|
|
@@ -228,52 +309,60 @@ interface MenuButtonProps extends PopoverProps {
|
|
|
228
309
|
}
|
|
229
310
|
type StyledMenuButtonProps = MenuButtonProps;
|
|
230
311
|
|
|
312
|
+
/**
|
|
313
|
+
* The MenuButton component.
|
|
314
|
+
*/
|
|
315
|
+
declare const BaseMenuButton: React.FC<MenuButtonProps> & {
|
|
316
|
+
displayName?: string;
|
|
317
|
+
className?: string;
|
|
318
|
+
};
|
|
319
|
+
declare const MenuButton: React.FC<MenuButtonProps> & {
|
|
320
|
+
displayName?: string | undefined;
|
|
321
|
+
className?: string | undefined;
|
|
322
|
+
} & {
|
|
323
|
+
Trigger: _redsift_design_system.Comp<MenuButtonTriggerProps, HTMLButtonElement>;
|
|
324
|
+
Content: _redsift_design_system.Comp<MenuButtonContentProps, HTMLDivElement> & {
|
|
325
|
+
Header: _redsift_design_system.Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
326
|
+
Menu: _redsift_design_system.Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
327
|
+
Footer: _redsift_design_system.Comp<MenuButtonContentFooterProps, HTMLDivElement>;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
|
|
231
331
|
/**
|
|
232
332
|
* Component props.
|
|
233
333
|
*/
|
|
234
|
-
interface
|
|
334
|
+
interface SelectContentProps extends PopoverContentProps {
|
|
235
335
|
}
|
|
236
336
|
|
|
237
337
|
/**
|
|
238
|
-
* The
|
|
338
|
+
* The SelectContent component.
|
|
239
339
|
*/
|
|
240
|
-
declare const
|
|
340
|
+
declare const SelectContent: Comp<SelectContentProps, HTMLDivElement>;
|
|
241
341
|
|
|
242
342
|
/**
|
|
243
343
|
* Component props.
|
|
244
344
|
*/
|
|
245
|
-
interface
|
|
345
|
+
interface SelectTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
|
|
246
346
|
/** Children */
|
|
247
347
|
children: ReactElement | ((state: {
|
|
248
348
|
value?: string;
|
|
249
349
|
isOpen?: boolean;
|
|
250
350
|
}) => ReactElement);
|
|
351
|
+
/** Whether or not the expand/collapse icon button should be displayed or not. */
|
|
352
|
+
hideExpandButton?: boolean;
|
|
251
353
|
}
|
|
252
354
|
|
|
253
355
|
/**
|
|
254
|
-
* The
|
|
255
|
-
*/
|
|
256
|
-
declare const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement>;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* The MenuButton component.
|
|
356
|
+
* The SelectTrigger component.
|
|
260
357
|
*/
|
|
261
|
-
declare const
|
|
262
|
-
displayName?: string;
|
|
263
|
-
className?: string;
|
|
264
|
-
};
|
|
265
|
-
declare const MenuButton: React.FC<MenuButtonProps> & {
|
|
266
|
-
displayName?: string | undefined;
|
|
267
|
-
className?: string | undefined;
|
|
268
|
-
} & {
|
|
269
|
-
Trigger: _redsift_design_system.Comp<MenuButtonTriggerProps, HTMLButtonElement>;
|
|
270
|
-
Content: _redsift_design_system.Comp<MenuButtonContentProps, HTMLDivElement>;
|
|
271
|
-
};
|
|
358
|
+
declare const SelectTrigger: Comp<SelectTriggerProps, HTMLButtonElement>;
|
|
272
359
|
|
|
273
360
|
/**
|
|
274
361
|
* Context props.
|
|
275
362
|
*/
|
|
276
363
|
type SelectState = {
|
|
364
|
+
/** Button color that will be forward to the trigger. */
|
|
365
|
+
readonly color?: ButtonColor;
|
|
277
366
|
/** Whether the select is disabled or not. */
|
|
278
367
|
readonly isDisabled: boolean;
|
|
279
368
|
/** Whether the select is invalid or not. */
|
|
@@ -282,11 +371,17 @@ type SelectState = {
|
|
|
282
371
|
setValue(value: string): void;
|
|
283
372
|
/** Current selected value. */
|
|
284
373
|
readonly value: string;
|
|
374
|
+
/** Class name to append to the trigger. */
|
|
375
|
+
readonly triggerClassName?: string;
|
|
376
|
+
/** Button variant that will be forward to the trigger. */
|
|
377
|
+
readonly variant?: ButtonVariant | TextFieldVariant;
|
|
285
378
|
};
|
|
286
379
|
/**
|
|
287
380
|
* Component props.
|
|
288
381
|
*/
|
|
289
382
|
interface SelectProps extends PopoverProps {
|
|
383
|
+
/** Button color that will be forward to the trigger. */
|
|
384
|
+
color?: ButtonColor;
|
|
290
385
|
/**
|
|
291
386
|
* Default selected value.
|
|
292
387
|
* Used for uncontrolled version.
|
|
@@ -307,42 +402,17 @@ interface SelectProps extends PopoverProps {
|
|
|
307
402
|
* Used for controlled version.
|
|
308
403
|
*/
|
|
309
404
|
value?: string;
|
|
405
|
+
/** Button variant that will be forward to the trigger. */
|
|
406
|
+
variant?: ButtonVariant | TextFieldVariant;
|
|
310
407
|
/** Theme. */
|
|
311
408
|
theme?: Theme;
|
|
409
|
+
/** Class name to append to the trigger. */
|
|
410
|
+
triggerClassName?: string;
|
|
312
411
|
/** Props to forward to the wrapper. */
|
|
313
412
|
wrapperProps?: Omit<FlexboxProps, 'ref'>;
|
|
314
413
|
}
|
|
315
414
|
type StyledSelectProps = SelectProps;
|
|
316
415
|
|
|
317
|
-
/**
|
|
318
|
-
* Component props.
|
|
319
|
-
*/
|
|
320
|
-
interface SelectContentProps extends PopoverContentProps {
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* The SelectContent component.
|
|
325
|
-
*/
|
|
326
|
-
declare const SelectContent: Comp<SelectContentProps, HTMLDivElement>;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Component props.
|
|
330
|
-
*/
|
|
331
|
-
interface SelectTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
|
|
332
|
-
/** Children */
|
|
333
|
-
children: ReactElement | ((state: {
|
|
334
|
-
value?: string;
|
|
335
|
-
isOpen?: boolean;
|
|
336
|
-
}) => ReactElement);
|
|
337
|
-
/** Whether or not the expand/collapse icon button should be displayed or not. */
|
|
338
|
-
hideExpandButton?: boolean;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* The SelectTrigger component.
|
|
343
|
-
*/
|
|
344
|
-
declare const SelectTrigger: Comp<SelectTriggerProps, HTMLButtonElement>;
|
|
345
|
-
|
|
346
416
|
/**
|
|
347
417
|
* The Select component.
|
|
348
418
|
*/
|
|
@@ -358,4 +428,4 @@ declare const Select: React.FC<SelectProps> & {
|
|
|
358
428
|
Content: _redsift_design_system.Comp<SelectContentProps, HTMLDivElement>;
|
|
359
429
|
};
|
|
360
430
|
|
|
361
|
-
export { BaseCombobox, BaseComboboxContent, BaseMenuButton, BaseSelect, Combobox, ComboboxContent, ComboboxContentFooter, ComboboxContentFooterProps, ComboboxContentHeader, ComboboxContentHeaderProps, ComboboxContentListbox, ComboboxContentListboxProps, ComboboxContentProps, ComboboxProps, ComboboxSelectionMode, ComboboxState, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxVariant, MenuButton, MenuButtonContent, MenuButtonContentProps, MenuButtonProps, MenuButtonState, MenuButtonTrigger, MenuButtonTriggerProps, Select, SelectContent, SelectContentProps, SelectProps, SelectState, SelectTrigger, SelectTriggerProps, StyledComboboxContentFooterProps, StyledComboboxContentHeaderProps, StyledComboboxProps, StyledMenuButtonProps, StyledSelectProps };
|
|
431
|
+
export { BaseCombobox, BaseComboboxContent, BaseMenuButton, BaseMenuButtonContent, BaseSelect, Combobox, ComboboxContent, ComboboxContentFooter, ComboboxContentFooterProps, ComboboxContentHeader, ComboboxContentHeaderProps, ComboboxContentListbox, ComboboxContentListboxProps, ComboboxContentProps, ComboboxProps, ComboboxSelectionMode, ComboboxState, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxVariant, MenuButton, MenuButtonContent, MenuButtonContentFooter, MenuButtonContentFooterProps, MenuButtonContentHeader, MenuButtonContentHeaderProps, MenuButtonContentMenu, MenuButtonContentMenuProps, MenuButtonContentProps, MenuButtonProps, MenuButtonState, MenuButtonTrigger, MenuButtonTriggerProps, Select, SelectContent, SelectContentProps, SelectProps, SelectState, SelectTrigger, SelectTriggerProps, StyledComboboxContentFooterProps, StyledComboboxContentHeaderProps, StyledComboboxProps, StyledMenuButtonContentFooterProps, StyledMenuButtonContentHeaderProps, StyledMenuButtonProps, StyledSelectProps };
|