@redsift/popovers 7.8.0 → 8.0.0-alpha.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/CONTRIBUTING.md CHANGED
@@ -48,11 +48,11 @@ The Design System is following a monorepo architecture, providing multiple packa
48
48
 
49
49
  - `@redsift/charts`
50
50
 
51
- This package provides charts components. Charts are based on [d3.js](https://d3js.org/) and are mainly static. For filterable charts, see `@redsift/dashboard`.
51
+ This package provides charts components. Charts are based on [d3.js](https://d3js.org/) for computation, [react](https://react.dev/) for rendering and events and [react-spring](https://www.react-spring.dev/) for animations and transitions.
52
52
 
53
53
  - `@redsift/dashboard`
54
54
 
55
- This package provides dashboard-related components. Charts are based on [dc.js](https://dc-js.github.io/dc.js/), [d3fc](https://d3fc.io/) and [crossfilter](https://crossfilter.github.io/crossfilter/) and datagrids are based on `@redsift/table`. It contains every filterable elements to use inside a dashboard. For static charts, see `@redsift/charts`.
55
+ This package provides dashboard-related components and decorators to make charts and datagrid filterable using [crossfilter](https://crossfilter.github.io/crossfilter/).
56
56
 
57
57
  - _Deprecated_ `@redsift/design-system-legacy`
58
58
 
package/index.d.ts CHANGED
@@ -1,266 +1,10 @@
1
- import React$1, { Ref, ReactElement, ComponentProps, Dispatch, SetStateAction, ReactNode } from 'react';
1
+ import React$1, { Dispatch, SetStateAction, ReactNode, ComponentProps } from 'react';
2
+ import * as _redsift_design_system from '@redsift/design-system';
3
+ import { ValueOf, ContainerProps, Comp, HeadingProps, StylingProps, InternalSpacingProps, SpacingProps, SizingProps } from '@redsift/design-system';
2
4
  import * as _floating_ui_react from '@floating-ui/react';
5
+ import * as _floating_ui_core from '@floating-ui/core';
3
6
  import { ClearWaitingQueueParams } from 'react-toastify';
4
7
 
5
- /** Component Type. */
6
- type Comp<P, T = HTMLElement> = {
7
- (props: P & {
8
- ref?: Ref<T>;
9
- }): ReactElement | null;
10
- /** React component type. */
11
- readonly $$typeof: symbol;
12
- /** Component default props. */
13
- defaultProps?: Partial<P>;
14
- /** Component name. */
15
- displayName?: string;
16
- /** Component base class name. */
17
- className?: string;
18
- };
19
- /** Get types of the values of a record. */
20
- type ValueOf<T extends Record<any, any>> = T[keyof T];
21
-
22
- declare const AlignSelf: {
23
- readonly auto: "auto";
24
- readonly normal: "normal";
25
- readonly start: "start";
26
- readonly end: "end";
27
- readonly center: "center";
28
- readonly 'flex-start': "flex-start";
29
- readonly 'flex-end': "flex-end";
30
- readonly 'self-start': "self-start";
31
- readonly 'self-end': "self-end";
32
- readonly baseline: "baseline";
33
- readonly stretch: "stretch";
34
- };
35
- type AlignSelf = ValueOf<typeof AlignSelf>;
36
- declare const AlignContent: {
37
- readonly 'flex-start': "flex-start";
38
- readonly 'flex-end': "flex-end";
39
- readonly center: "center";
40
- readonly 'space-between': "space-between";
41
- readonly 'space-around': "space-around";
42
- readonly 'space-evenly': "space-evenly";
43
- readonly stretch: "stretch";
44
- readonly start: "start";
45
- readonly end: "end";
46
- readonly baseline: "baseline";
47
- readonly 'first baseline': "first baseline";
48
- readonly 'last baseline': "last baseline";
49
- };
50
- type AlignContent = ValueOf<typeof AlignContent>;
51
- declare const AlignItems: {
52
- readonly stretch: "stretch";
53
- readonly 'flex-start': "flex-start";
54
- readonly 'flex-end': "flex-end";
55
- readonly center: "center";
56
- readonly baseline: "baseline";
57
- readonly 'first baseline': "first baseline";
58
- readonly 'last baseline': "last baseline";
59
- readonly start: "start";
60
- readonly end: "end";
61
- readonly 'self-start': "self-start";
62
- readonly 'self-end': "self-end";
63
- };
64
- type AlignItems = ValueOf<typeof AlignItems>;
65
- declare const FlexDirection: {
66
- readonly row: "row";
67
- readonly 'row-reverse': "row-reverse";
68
- readonly column: "column";
69
- readonly 'column-reverse': "column-reverse";
70
- };
71
- type FlexDirection = ValueOf<typeof FlexDirection>;
72
- declare const FlexWrap: {
73
- readonly nowrap: "nowrap";
74
- readonly wrap: "wrap";
75
- readonly 'wrap-reverse': "wrap-reverse";
76
- };
77
- type FlexWrap = ValueOf<typeof FlexWrap>;
78
- declare const JustifyContent: {
79
- readonly 'flex-start': "flex-start";
80
- readonly 'flex-end': "flex-end";
81
- readonly center: "center";
82
- readonly 'space-between': "space-between";
83
- readonly 'space-around': "space-around";
84
- readonly 'space-evenly': "space-evenly";
85
- readonly start: "start";
86
- readonly end: "end";
87
- readonly left: "left";
88
- readonly right: "right";
89
- readonly baseline: "baseline";
90
- readonly 'first baseline': "first baseline";
91
- readonly 'last baseline': "last baseline";
92
- readonly stretch: "stretch";
93
- };
94
- type JustifyContent = ValueOf<typeof JustifyContent>;
95
- declare const JustifyItems: {
96
- readonly start: "start";
97
- readonly end: "end";
98
- readonly center: "center";
99
- readonly stretch: "stretch";
100
- };
101
- type JustifyItems = ValueOf<typeof JustifyItems>;
102
- interface LayoutProps {
103
- /** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex">MDN</a>. */
104
- flex?: string;
105
- /** When used in a flex layout, specifies how the element will grow to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow">MDN</a>. */
106
- flexGrow?: number;
107
- /** When used in a flex layout, specifies how the element will shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink">MDN</a>. */
108
- flexShrink?: number;
109
- /** When used in a flex layout, specifies the initial main size of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex_basis">MDN</a>. */
110
- flexBasis?: string;
111
- /** Overrides the alignItems property of a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-self">MDN</a>. */
112
- alignSelf?: AlignSelf;
113
- /** Specifies how the element is justified inside a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self">MDN</a>. */
114
- justifySelf?: string;
115
- /** The layout order for the element within a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/order">MDN</a>. */
116
- order?: number;
117
- /** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area">MDN</a>. */
118
- gridArea?: string;
119
- /** When used in a grid layout, specifies the column the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column">MDN</a>. */
120
- gridColumn?: string;
121
- /** When used in a grid layout, specifies the row the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row">MDN</a>. */
122
- gridRow?: string;
123
- /** When used in a grid layout, specifies the starting column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start">MDN</a>. */
124
- gridColumnStart?: string;
125
- /** When used in a grid layout, specifies the ending column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end">MDN</a>. */
126
- gridColumnEnd?: string;
127
- /** When used in a grid layout, specifies the starting row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start">MDN</a>. */
128
- gridRowStart?: string;
129
- /** When used in a grid layout, specifies the ending row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end">MDN</a>. */
130
- gridRowEnd?: string;
131
- }
132
- interface SpacingProps {
133
- /** The margin for all four sides of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin">MDN</a>. */
134
- margin?: string;
135
- /** The margin for the bottom side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom">MDN</a>. */
136
- marginBottom?: string;
137
- /** The margin for the left side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left">MDN</a>. */
138
- marginLeft?: string;
139
- /** The margin for the right side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right">MDN</a>. */
140
- marginRight?: string;
141
- /** The margin for the top side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top">MDN</a>. */
142
- marginTop?: string;
143
- }
144
- interface SizingProps {
145
- /** The height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/height">MDN</a>. */
146
- height?: string | number;
147
- /** The maximum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-height">MDN</a>. */
148
- maxHeight?: string;
149
- /** The maximum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-width">MDN</a>. */
150
- maxWidth?: string;
151
- /** The minimum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-height">MDN</a>. */
152
- minHeight?: string;
153
- /** The minimum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-width">MDN</a>. */
154
- minWidth?: string;
155
- /** The width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/width">MDN</a>. */
156
- width?: string | number;
157
- }
158
- interface PositioningProps {
159
- /** Specifies how the element is positioned. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN</a>. */
160
- position?: string;
161
- /** The top position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/top">MDN</a>. */
162
- top?: string;
163
- /** The bottom position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/bottom">MDN</a>. */
164
- bottom?: string;
165
- /** The left position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/left">MDN</a>. Consider using start instead for RTL support. */
166
- left?: string;
167
- /** The right position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/right">MDN</a>. Consider using start instead for RTL support. */
168
- right?: string;
169
- /** The stacking order for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index">MDN</a>. */
170
- zIndex?: string;
171
- }
172
- interface FlexLayoutProps {
173
- /** The distribution of space around child items along the cross axis. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-content">MDN</a>. */
174
- alignContent?: AlignContent;
175
- /** The alignment of children within their container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-items">MDN</a>. */
176
- alignItems?: AlignItems;
177
- /** The direction in which to layout children. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction">MDN</a>. */
178
- flexDirection?: FlexDirection;
179
- /** Whether to wrap items onto multiple lines. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap">MDN</a>. */
180
- flexWrap?: FlexWrap;
181
- /** The space to display between both rows and columns. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/gap">MDN</a>. */
182
- gap?: string;
183
- /** Whether the box is displayed inline or not. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display">MDN</a>. */
184
- inline?: boolean;
185
- /** The distribution of space around items along the main axis. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content">MDN</a>. */
186
- justifyContent?: JustifyContent;
187
- }
188
- interface GridLayoutProps {
189
- /** The distribution of space around child items along the cross axis. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-content">MDN</a>. */
190
- alignContent?: AlignContent;
191
- /** The alignment of children within their container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-items">MDN</a>. */
192
- alignItems?: AlignItems;
193
- /** The space to display between both rows and columns. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/gap">MDN</a>. */
194
- gap?: string;
195
- /** Defines the size of implicitly generated columns. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns">MDN</a>. */
196
- gridAutoColumns?: string;
197
- /** Defines the size of implicitly generated rows. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows">MDN</a>. */
198
- gridAutoRows?: string;
199
- /** Defines named grid areas. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas">MDN</a>. */
200
- gridTemplateAreas?: string;
201
- /** Defines the sizes of each column in the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns">MDN</a>. */
202
- gridTemplateColumns?: string;
203
- /** Defines the sizes of each row in the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows">MDN</a>. */
204
- gridTemplateRows?: string;
205
- /** Whether the box is displayed inline or not. */
206
- inline?: boolean;
207
- /** The distribution of space around items along the main axis. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content">MDN</a>. */
208
- justifyContent?: JustifyContent;
209
- /** Defines the default justifySelf for all items in the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items">MDN</a>. */
210
- justifyItems?: JustifyItems;
211
- }
212
- interface StylingProps extends LayoutProps, SpacingProps, SizingProps, PositioningProps {
213
- }
214
- interface InternalSpacingProps {
215
- /** The padding for all four sides of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding">MDN</a>. */
216
- padding?: string;
217
- /** The padding for the bottom side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom">MDN</a>. */
218
- paddingBottom?: string;
219
- /** The padding for the left side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left">MDN</a>. */
220
- paddingLeft?: string;
221
- /** The padding for the right side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right">MDN</a>. */
222
- paddingRight?: string;
223
- /** The padding for the top side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top">MDN</a>. */
224
- paddingTop?: string;
225
- }
226
- interface ContainerProps extends Omit<FlexLayoutProps, 'inline'>, Omit<GridLayoutProps, 'inline'>, InternalSpacingProps {
227
- /** Sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display">MDN</a>. */
228
- display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'grid' | 'inline-grid' | 'inherit';
229
- }
230
-
231
- /**
232
- * Component variant.
233
- */
234
- declare const HeadingVariant: {
235
- readonly h1: "h1";
236
- readonly h2: "h2";
237
- readonly h3: "h3";
238
- readonly h4: "h4";
239
- readonly h5: "h5";
240
- readonly body: "body";
241
- };
242
- type HeadingVariant = ValueOf<typeof HeadingVariant>;
243
- declare const HeadingComponent: {
244
- readonly h1: "h1";
245
- readonly h2: "h2";
246
- readonly h3: "h3";
247
- readonly h4: "h4";
248
- readonly h5: "h5";
249
- readonly span: "span";
250
- };
251
- type HeadingComponent = ValueOf<typeof HeadingComponent>;
252
- /**
253
- * Component props.
254
- */
255
- interface HeadingProps extends ComponentProps<'span'>, StylingProps {
256
- /** The actual component rendered in the DOM. */
257
- as: HeadingComponent;
258
- /** Whether the text will truncate with a text overflow ellipsis or wrap. */
259
- noWrap?: boolean;
260
- /** The component the Heading will look like. */
261
- variant?: HeadingVariant;
262
- }
263
-
264
8
  declare function useDialog({ defaultOpen, hasCloseButton, initialFocus, isOpen: propsIsOpen, onOpen, size, }: Omit<DialogProps, 'children'>): {
265
9
  labelId: string | undefined;
266
10
  descriptionId: string | undefined;
@@ -447,11 +191,11 @@ declare const Dialog: React$1.FC<DialogProps> & {
447
191
  displayName?: string | undefined;
448
192
  className?: string | undefined;
449
193
  } & {
450
- Trigger: Comp<DialogTriggerProps, HTMLButtonElement>;
451
- Content: Comp<DialogContentProps, HTMLDivElement> & {
452
- Header: Comp<DialogContentHeaderProps, HTMLDivElement>;
453
- Body: Comp<DialogContentBodyProps, HTMLDivElement>;
454
- Actions: Comp<DialogContentActionsProps, HTMLDivElement>;
194
+ Trigger: _redsift_design_system.Comp<DialogTriggerProps, HTMLButtonElement>;
195
+ Content: _redsift_design_system.Comp<DialogContentProps, HTMLDivElement> & {
196
+ Header: _redsift_design_system.Comp<DialogContentHeaderProps, HTMLDivElement>;
197
+ Body: _redsift_design_system.Comp<DialogContentBodyProps, HTMLDivElement>;
198
+ Actions: _redsift_design_system.Comp<DialogContentActionsProps, HTMLDivElement>;
455
199
  };
456
200
  };
457
201
 
@@ -466,9 +210,9 @@ declare const useDialogContext: () => {
466
210
  headerRef: React$1.MutableRefObject<null>;
467
211
  bodyRef: React$1.MutableRefObject<null>;
468
212
  actionsRef: React$1.MutableRefObject<null>;
469
- placement: undefined;
470
- strategy: undefined;
471
- middlewareData: undefined;
213
+ placement: _floating_ui_core.Placement;
214
+ strategy: _floating_ui_core.Strategy;
215
+ middlewareData: _floating_ui_core.MiddlewareData;
472
216
  x: number | null;
473
217
  y: number | null;
474
218
  update: () => void;
@@ -478,9 +222,9 @@ declare const useDialogContext: () => {
478
222
  context: {
479
223
  x: number | null;
480
224
  y: number | null;
481
- placement: undefined;
482
- strategy: undefined;
483
- middlewareData: undefined;
225
+ placement: _floating_ui_core.Placement;
226
+ strategy: _floating_ui_core.Strategy;
227
+ middlewareData: _floating_ui_core.MiddlewareData;
484
228
  update: () => void;
485
229
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
486
230
  floating: (node: HTMLElement | null) => void;
@@ -628,15 +372,15 @@ declare const Popover: React$1.FC<PopoverProps> & {
628
372
  displayName?: string | undefined;
629
373
  className?: string | undefined;
630
374
  } & {
631
- Trigger: Comp<PopoverTriggerProps, HTMLButtonElement>;
632
- Content: Comp<PopoverContentProps, HTMLDivElement>;
375
+ Trigger: _redsift_design_system.Comp<PopoverTriggerProps, HTMLButtonElement>;
376
+ Content: _redsift_design_system.Comp<PopoverContentProps, HTMLDivElement>;
633
377
  };
634
378
 
635
379
  declare const usePopoverContext: () => {
636
380
  isModal: boolean | undefined;
637
- placement: undefined;
638
- strategy: undefined;
639
- middlewareData: undefined;
381
+ placement: _floating_ui_core.Placement;
382
+ strategy: _floating_ui_core.Strategy;
383
+ middlewareData: _floating_ui_core.MiddlewareData;
640
384
  x: number | null;
641
385
  y: number | null;
642
386
  update: () => void;
@@ -646,9 +390,9 @@ declare const usePopoverContext: () => {
646
390
  context: {
647
391
  x: number | null;
648
392
  y: number | null;
649
- placement: undefined;
650
- strategy: undefined;
651
- middlewareData: undefined;
393
+ placement: _floating_ui_core.Placement;
394
+ strategy: _floating_ui_core.Strategy;
395
+ middlewareData: _floating_ui_core.MiddlewareData;
652
396
  update: () => void;
653
397
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
654
398
  floating: (node: HTMLElement | null) => void;
@@ -919,16 +663,16 @@ declare const Tooltip: React$1.FC<TooltipProps> & {
919
663
  displayName?: string | undefined;
920
664
  className?: string | undefined;
921
665
  } & {
922
- Trigger: Comp<TooltipTriggerProps, HTMLSpanElement>;
923
- Content: Comp<TooltipContentProps, HTMLDivElement>;
666
+ Trigger: _redsift_design_system.Comp<TooltipTriggerProps, HTMLSpanElement>;
667
+ Content: _redsift_design_system.Comp<TooltipContentProps, HTMLDivElement>;
924
668
  };
925
669
 
926
670
  declare const useTooltipContext: () => {
927
671
  arrowRef: React$1.MutableRefObject<null>;
928
672
  tooltipId: string;
929
- placement: undefined;
930
- strategy: undefined;
931
- middlewareData: undefined;
673
+ placement: _floating_ui_core.Placement;
674
+ strategy: _floating_ui_core.Strategy;
675
+ middlewareData: _floating_ui_core.MiddlewareData;
932
676
  x: number | null;
933
677
  y: number | null;
934
678
  update: () => void;
@@ -938,9 +682,9 @@ declare const useTooltipContext: () => {
938
682
  context: {
939
683
  x: number | null;
940
684
  y: number | null;
941
- placement: undefined;
942
- strategy: undefined;
943
- middlewareData: undefined;
685
+ placement: _floating_ui_core.Placement;
686
+ strategy: _floating_ui_core.Strategy;
687
+ middlewareData: _floating_ui_core.MiddlewareData;
944
688
  update: () => void;
945
689
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
946
690
  floating: (node: HTMLElement | null) => void;