@redsift/pickers 10.2.0 → 10.3.0-alpha.2

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 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.
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, ContainerProps, Comp, ListboxContextProps, ButtonColor, ButtonVariant } from '@redsift/design-system';
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
- import React, { RefObject, ReactElement, ComponentProps, ReactNode } from 'react';
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,8 @@ 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;
49
75
  };
50
76
  /**
51
77
  * Component props.
@@ -88,23 +114,13 @@ interface ComboboxProps extends PopoverProps {
88
114
  selectionMode?: ComboboxSelectionMode;
89
115
  /** Theme. */
90
116
  theme?: Theme;
117
+ /** Class name to append to the trigger. */
118
+ triggerClassName?: string;
91
119
  /** Props to forward to the wrapper. */
92
120
  wrapperProps?: Omit<FlexboxProps, 'ref'>;
93
121
  }
94
122
  type StyledComboboxProps = ComboboxProps;
95
123
 
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
124
  /**
109
125
  * Component props.
110
126
  */
@@ -117,18 +133,6 @@ interface ComboboxContentListboxProps extends FlexboxProps {
117
133
  */
118
134
  declare const ComboboxContentListbox: Comp<ComboboxContentListboxProps, HTMLDivElement>;
119
135
 
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
136
  /**
133
137
  * Component props.
134
138
  */
@@ -156,6 +160,8 @@ interface ComboboxTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
156
160
  value?: ComboboxValue;
157
161
  isOpen?: boolean;
158
162
  }) => ReactElement);
163
+ /** Whether the clear button should be hiding (not recommended) */
164
+ hideClearButton?: boolean;
159
165
  /** Whether or not the expand/collapse icon button should be displayed or not. */
160
166
  hideExpandButton?: boolean;
161
167
  /** Whether the popover should open on focus. */
@@ -188,6 +194,73 @@ declare const Combobox: React.FC<ComboboxProps> & {
188
194
  };
189
195
  };
190
196
 
197
+ /**
198
+ * Component props.
199
+ */
200
+ interface MenuButtonContentFooterProps extends ComponentProps<'div'>, ContainerProps {
201
+ }
202
+ type StyledMenuButtonContentFooterProps = MenuButtonContentFooterProps & {};
203
+
204
+ /**
205
+ * The MenuButtonContentFooter component.
206
+ */
207
+ declare const MenuButtonContentFooter: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
208
+
209
+ /**
210
+ * Component props.
211
+ */
212
+ interface MenuButtonContentHeaderProps extends ComponentProps<'div'>, ContainerProps {
213
+ }
214
+ type StyledMenuButtonContentHeaderProps = MenuButtonContentHeaderProps & {};
215
+
216
+ /**
217
+ * The MenuButtonContentHeader component.
218
+ */
219
+ declare const MenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
220
+
221
+ /**
222
+ * Component props.
223
+ */
224
+ interface MenuButtonContentMenuProps extends FlexboxProps {
225
+ }
226
+
227
+ /**
228
+ * The MenuButtonContentMenu component.
229
+ */
230
+ declare const MenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
231
+
232
+ /**
233
+ * Component props.
234
+ */
235
+ interface MenuButtonContentProps extends PopoverContentProps {
236
+ }
237
+
238
+ /**
239
+ * The MenuButtonContent component.
240
+ */
241
+ declare const BaseMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement>;
242
+ declare const MenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> & {
243
+ Header: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
244
+ Menu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
245
+ Footer: Comp<MenuButtonContentFooterProps, HTMLDivElement>;
246
+ };
247
+
248
+ /**
249
+ * Component props.
250
+ */
251
+ interface MenuButtonTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
252
+ /** Children */
253
+ children: ReactElement | ((state: {
254
+ value?: string;
255
+ isOpen?: boolean;
256
+ }) => ReactElement);
257
+ }
258
+
259
+ /**
260
+ * The MenuButtonTrigger component.
261
+ */
262
+ declare const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement>;
263
+
191
264
  /**
192
265
  * Context props.
193
266
  */
@@ -196,7 +269,7 @@ type MenuButtonState = {
196
269
  readonly color?: ButtonColor;
197
270
  /** Whether the trigger is disabled or not. */
198
271
  readonly isDisabled: boolean;
199
- /** Class name to append to the Button. */
272
+ /** Class name to append to the trigger. */
200
273
  readonly triggerClassName?: string;
201
274
  /** Button variant that will be forward to the trigger. */
202
275
  readonly variant?: ButtonVariant;
@@ -217,7 +290,7 @@ interface MenuButtonProps extends PopoverProps {
217
290
  label?: string | ReactElement;
218
291
  /** Additional label properties. */
219
292
  labelProps?: Omit<TextProps, 'ref'>;
220
- /** Class name to append to the Button. */
293
+ /** Class name to append to the trigger. */
221
294
  triggerClassName?: string;
222
295
  /** Button variant that will be forward to the trigger. */
223
296
  variant?: ButtonVariant;
@@ -228,52 +301,60 @@ interface MenuButtonProps extends PopoverProps {
228
301
  }
229
302
  type StyledMenuButtonProps = MenuButtonProps;
230
303
 
304
+ /**
305
+ * The MenuButton component.
306
+ */
307
+ declare const BaseMenuButton: React.FC<MenuButtonProps> & {
308
+ displayName?: string;
309
+ className?: string;
310
+ };
311
+ declare const MenuButton: React.FC<MenuButtonProps> & {
312
+ displayName?: string | undefined;
313
+ className?: string | undefined;
314
+ } & {
315
+ Trigger: _redsift_design_system.Comp<MenuButtonTriggerProps, HTMLButtonElement>;
316
+ Content: _redsift_design_system.Comp<MenuButtonContentProps, HTMLDivElement> & {
317
+ Header: _redsift_design_system.Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
318
+ Menu: _redsift_design_system.Comp<MenuButtonContentMenuProps, HTMLDivElement>;
319
+ Footer: _redsift_design_system.Comp<MenuButtonContentFooterProps, HTMLDivElement>;
320
+ };
321
+ };
322
+
231
323
  /**
232
324
  * Component props.
233
325
  */
234
- interface MenuButtonContentProps extends PopoverContentProps {
326
+ interface SelectContentProps extends PopoverContentProps {
235
327
  }
236
328
 
237
329
  /**
238
- * The MenuButtonContent component.
330
+ * The SelectContent component.
239
331
  */
240
- declare const MenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement>;
332
+ declare const SelectContent: Comp<SelectContentProps, HTMLDivElement>;
241
333
 
242
334
  /**
243
335
  * Component props.
244
336
  */
245
- interface MenuButtonTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
337
+ interface SelectTriggerProps extends Omit<PopoverTriggerProps, 'children'> {
246
338
  /** Children */
247
339
  children: ReactElement | ((state: {
248
340
  value?: string;
249
341
  isOpen?: boolean;
250
342
  }) => ReactElement);
343
+ /** Whether or not the expand/collapse icon button should be displayed or not. */
344
+ hideExpandButton?: boolean;
251
345
  }
252
346
 
253
347
  /**
254
- * The MenuButtonTrigger component.
255
- */
256
- declare const MenuButtonTrigger: Comp<MenuButtonTriggerProps, HTMLButtonElement>;
257
-
258
- /**
259
- * The MenuButton component.
348
+ * The SelectTrigger component.
260
349
  */
261
- declare const BaseMenuButton: React.FC<MenuButtonProps> & {
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
- };
350
+ declare const SelectTrigger: Comp<SelectTriggerProps, HTMLButtonElement>;
272
351
 
273
352
  /**
274
353
  * Context props.
275
354
  */
276
355
  type SelectState = {
356
+ /** Button color that will be forward to the trigger. */
357
+ readonly color?: ButtonColor;
277
358
  /** Whether the select is disabled or not. */
278
359
  readonly isDisabled: boolean;
279
360
  /** Whether the select is invalid or not. */
@@ -282,11 +363,17 @@ type SelectState = {
282
363
  setValue(value: string): void;
283
364
  /** Current selected value. */
284
365
  readonly value: string;
366
+ /** Class name to append to the trigger. */
367
+ readonly triggerClassName?: string;
368
+ /** Button variant that will be forward to the trigger. */
369
+ readonly variant?: ButtonVariant | TextFieldVariant;
285
370
  };
286
371
  /**
287
372
  * Component props.
288
373
  */
289
374
  interface SelectProps extends PopoverProps {
375
+ /** Button color that will be forward to the trigger. */
376
+ color?: ButtonColor;
290
377
  /**
291
378
  * Default selected value.
292
379
  * Used for uncontrolled version.
@@ -307,42 +394,17 @@ interface SelectProps extends PopoverProps {
307
394
  * Used for controlled version.
308
395
  */
309
396
  value?: string;
397
+ /** Button variant that will be forward to the trigger. */
398
+ variant?: ButtonVariant | TextFieldVariant;
310
399
  /** Theme. */
311
400
  theme?: Theme;
401
+ /** Class name to append to the trigger. */
402
+ triggerClassName?: string;
312
403
  /** Props to forward to the wrapper. */
313
404
  wrapperProps?: Omit<FlexboxProps, 'ref'>;
314
405
  }
315
406
  type StyledSelectProps = SelectProps;
316
407
 
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
408
  /**
347
409
  * The Select component.
348
410
  */
@@ -358,4 +420,4 @@ declare const Select: React.FC<SelectProps> & {
358
420
  Content: _redsift_design_system.Comp<SelectContentProps, HTMLDivElement>;
359
421
  };
360
422
 
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 };
423
+ 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 };