@redsift/popovers 9.2.3 → 9.2.4-muiv5

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.
Files changed (171) hide show
  1. package/package.json +3 -2
  2. package/coverage/clover.xml +0 -763
  3. package/coverage/coverage-final.json +0 -53
  4. package/coverage/lcov-report/base.css +0 -224
  5. package/coverage/lcov-report/block-navigation.js +0 -87
  6. package/coverage/lcov-report/dialog/Dialog.tsx.html +0 -271
  7. package/coverage/lcov-report/dialog/context.ts.html +0 -97
  8. package/coverage/lcov-report/dialog/index.html +0 -191
  9. package/coverage/lcov-report/dialog/index.ts.html +0 -100
  10. package/coverage/lcov-report/dialog/types.ts.html +0 -241
  11. package/coverage/lcov-report/dialog/useDialog.tsx.html +0 -346
  12. package/coverage/lcov-report/dialog/useDialogContext.tsx.html +0 -121
  13. package/coverage/lcov-report/dialog-content/DialogContent.tsx.html +0 -484
  14. package/coverage/lcov-report/dialog-content/index.html +0 -146
  15. package/coverage/lcov-report/dialog-content/index.ts.html +0 -91
  16. package/coverage/lcov-report/dialog-content/intl/index.html +0 -116
  17. package/coverage/lcov-report/dialog-content/intl/index.ts.html +0 -106
  18. package/coverage/lcov-report/dialog-content/styles.ts.html +0 -256
  19. package/coverage/lcov-report/dialog-content-actions/DialogContentActions.tsx.html +0 -205
  20. package/coverage/lcov-report/dialog-content-actions/index.html +0 -146
  21. package/coverage/lcov-report/dialog-content-actions/index.ts.html +0 -91
  22. package/coverage/lcov-report/dialog-content-actions/styles.ts.html +0 -139
  23. package/coverage/lcov-report/dialog-content-body/DialogContentBody.tsx.html +0 -232
  24. package/coverage/lcov-report/dialog-content-body/index.html +0 -146
  25. package/coverage/lcov-report/dialog-content-body/index.ts.html +0 -91
  26. package/coverage/lcov-report/dialog-content-body/styles.ts.html +0 -259
  27. package/coverage/lcov-report/dialog-content-header/DialogContentHeader.tsx.html +0 -280
  28. package/coverage/lcov-report/dialog-content-header/index.html +0 -146
  29. package/coverage/lcov-report/dialog-content-header/index.ts.html +0 -91
  30. package/coverage/lcov-report/dialog-content-header/styles.ts.html +0 -193
  31. package/coverage/lcov-report/dialog-trigger/DialogTrigger.tsx.html +0 -217
  32. package/coverage/lcov-report/dialog-trigger/index.html +0 -131
  33. package/coverage/lcov-report/dialog-trigger/index.ts.html +0 -91
  34. package/coverage/lcov-report/favicon.png +0 -0
  35. package/coverage/lcov-report/index.html +0 -341
  36. package/coverage/lcov-report/popover/Popover.tsx.html +0 -295
  37. package/coverage/lcov-report/popover/context.ts.html +0 -97
  38. package/coverage/lcov-report/popover/index.html +0 -191
  39. package/coverage/lcov-report/popover/index.ts.html +0 -100
  40. package/coverage/lcov-report/popover/types.ts.html +0 -283
  41. package/coverage/lcov-report/popover/usePopover.tsx.html +0 -415
  42. package/coverage/lcov-report/popover/usePopoverContext.tsx.html +0 -121
  43. package/coverage/lcov-report/popover-content/PopoverContent.tsx.html +0 -229
  44. package/coverage/lcov-report/popover-content/index.html +0 -146
  45. package/coverage/lcov-report/popover-content/index.ts.html +0 -94
  46. package/coverage/lcov-report/popover-content/styles.ts.html +0 -370
  47. package/coverage/lcov-report/popover-trigger/PopoverTrigger.tsx.html +0 -202
  48. package/coverage/lcov-report/popover-trigger/index.html +0 -131
  49. package/coverage/lcov-report/popover-trigger/index.ts.html +0 -91
  50. package/coverage/lcov-report/prettify.css +0 -1
  51. package/coverage/lcov-report/prettify.js +0 -2
  52. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  53. package/coverage/lcov-report/sorter.js +0 -196
  54. package/coverage/lcov-report/toast/Toast.tsx.html +0 -373
  55. package/coverage/lcov-report/toast/index.html +0 -161
  56. package/coverage/lcov-report/toast/index.ts.html +0 -91
  57. package/coverage/lcov-report/toast/intl/index.html +0 -116
  58. package/coverage/lcov-report/toast/intl/index.ts.html +0 -106
  59. package/coverage/lcov-report/toast/styles.ts.html +0 -193
  60. package/coverage/lcov-report/toast/types.ts.html +0 -217
  61. package/coverage/lcov-report/toast-container/ToastContainer.tsx.html +0 -217
  62. package/coverage/lcov-report/toast-container/index.html +0 -161
  63. package/coverage/lcov-report/toast-container/index.ts.html +0 -94
  64. package/coverage/lcov-report/toast-container/styles.ts.html +0 -2284
  65. package/coverage/lcov-report/toast-container/useToast.tsx.html +0 -469
  66. package/coverage/lcov-report/tooltip/Tooltip.tsx.html +0 -250
  67. package/coverage/lcov-report/tooltip/context.ts.html +0 -97
  68. package/coverage/lcov-report/tooltip/index.html +0 -191
  69. package/coverage/lcov-report/tooltip/index.ts.html +0 -100
  70. package/coverage/lcov-report/tooltip/types.ts.html +0 -250
  71. package/coverage/lcov-report/tooltip/useTooltip.tsx.html +0 -358
  72. package/coverage/lcov-report/tooltip/useTooltipContext.tsx.html +0 -121
  73. package/coverage/lcov-report/tooltip-content/TooltipContent.tsx.html +0 -313
  74. package/coverage/lcov-report/tooltip-content/index.html +0 -146
  75. package/coverage/lcov-report/tooltip-content/index.ts.html +0 -91
  76. package/coverage/lcov-report/tooltip-content/styles.ts.html +0 -337
  77. package/coverage/lcov-report/tooltip-trigger/TooltipTrigger.tsx.html +0 -211
  78. package/coverage/lcov-report/tooltip-trigger/index.html +0 -131
  79. package/coverage/lcov-report/tooltip-trigger/index.ts.html +0 -91
  80. package/coverage/lcov.info +0 -1510
  81. package/coverage/storybook/coverage-storybook.json +0 -58724
  82. package/dist/package.json +0 -96
  83. package/index.ts +0 -1
  84. package/jest.config.js +0 -3
  85. package/rollup.config.js +0 -13
  86. package/src/components/dialog/Dialog.stories.tsx +0 -264
  87. package/src/components/dialog/Dialog.test.tsx +0 -116
  88. package/src/components/dialog/Dialog.tsx +0 -62
  89. package/src/components/dialog/context.ts +0 -4
  90. package/src/components/dialog/index.ts +0 -5
  91. package/src/components/dialog/types.ts +0 -52
  92. package/src/components/dialog/useDialog.tsx +0 -87
  93. package/src/components/dialog/useDialogContext.tsx +0 -12
  94. package/src/components/dialog-content/DialogContent.stories.tsx +0 -348
  95. package/src/components/dialog-content/DialogContent.tsx +0 -133
  96. package/src/components/dialog-content/index.ts +0 -2
  97. package/src/components/dialog-content/intl/en-US.json +0 -3
  98. package/src/components/dialog-content/intl/fr-FR.json +0 -3
  99. package/src/components/dialog-content/intl/index.ts +0 -7
  100. package/src/components/dialog-content/styles.ts +0 -57
  101. package/src/components/dialog-content/types.ts +0 -10
  102. package/src/components/dialog-content-actions/DialogContentActions.test.tsx +0 -68
  103. package/src/components/dialog-content-actions/DialogContentActions.tsx +0 -40
  104. package/src/components/dialog-content-actions/index.ts +0 -2
  105. package/src/components/dialog-content-actions/styles.ts +0 -18
  106. package/src/components/dialog-content-actions/types.ts +0 -11
  107. package/src/components/dialog-content-body/DialogContentBody.test.tsx +0 -63
  108. package/src/components/dialog-content-body/DialogContentBody.tsx +0 -49
  109. package/src/components/dialog-content-body/index.ts +0 -2
  110. package/src/components/dialog-content-body/styles.ts +0 -58
  111. package/src/components/dialog-content-body/types.ts +0 -14
  112. package/src/components/dialog-content-header/DialogContentHeader.test.tsx +0 -63
  113. package/src/components/dialog-content-header/DialogContentHeader.tsx +0 -65
  114. package/src/components/dialog-content-header/index.ts +0 -2
  115. package/src/components/dialog-content-header/styles.ts +0 -36
  116. package/src/components/dialog-content-header/types.ts +0 -21
  117. package/src/components/dialog-trigger/DialogTrigger.tsx +0 -44
  118. package/src/components/dialog-trigger/index.ts +0 -2
  119. package/src/components/dialog-trigger/types.ts +0 -9
  120. package/src/components/popover/Popover.stories.tsx +0 -129
  121. package/src/components/popover/Popover.test.tsx +0 -102
  122. package/src/components/popover/Popover.tsx +0 -70
  123. package/src/components/popover/context.ts +0 -4
  124. package/src/components/popover/index.ts +0 -5
  125. package/src/components/popover/types.ts +0 -66
  126. package/src/components/popover/usePopover.tsx +0 -110
  127. package/src/components/popover/usePopoverContext.tsx +0 -12
  128. package/src/components/popover-content/PopoverContent.tsx +0 -48
  129. package/src/components/popover-content/index.ts +0 -3
  130. package/src/components/popover-content/styles.ts +0 -95
  131. package/src/components/popover-content/types.ts +0 -11
  132. package/src/components/popover-trigger/PopoverTrigger.tsx +0 -39
  133. package/src/components/popover-trigger/index.ts +0 -2
  134. package/src/components/popover-trigger/types.ts +0 -9
  135. package/src/components/toast/Toast.stories.tsx +0 -68
  136. package/src/components/toast/Toast.test.tsx +0 -63
  137. package/src/components/toast/Toast.tsx +0 -96
  138. package/src/components/toast/index.ts +0 -2
  139. package/src/components/toast/intl/en-US.json +0 -3
  140. package/src/components/toast/intl/fr-FR.json +0 -3
  141. package/src/components/toast/intl/index.ts +0 -7
  142. package/src/components/toast/styles.ts +0 -36
  143. package/src/components/toast/types.ts +0 -44
  144. package/src/components/toast-container/ToastContainer.stories.tsx +0 -349
  145. package/src/components/toast-container/ToastContainer.tsx +0 -44
  146. package/src/components/toast-container/index.ts +0 -3
  147. package/src/components/toast-container/styles.ts +0 -733
  148. package/src/components/toast-container/types.ts +0 -110
  149. package/src/components/toast-container/useToast.test.tsx +0 -111
  150. package/src/components/toast-container/useToast.tsx +0 -128
  151. package/src/components/tooltip/Tooltip.stories.tsx +0 -196
  152. package/src/components/tooltip/Tooltip.test.tsx +0 -119
  153. package/src/components/tooltip/Tooltip.tsx +0 -55
  154. package/src/components/tooltip/context.ts +0 -4
  155. package/src/components/tooltip/index.ts +0 -5
  156. package/src/components/tooltip/types.ts +0 -55
  157. package/src/components/tooltip/useTooltip.tsx +0 -93
  158. package/src/components/tooltip/useTooltipContext.tsx +0 -12
  159. package/src/components/tooltip-content/TooltipContent.tsx +0 -76
  160. package/src/components/tooltip-content/index.ts +0 -2
  161. package/src/components/tooltip-content/styles.ts +0 -84
  162. package/src/components/tooltip-content/types.ts +0 -14
  163. package/src/components/tooltip-trigger/TooltipTrigger.tsx +0 -42
  164. package/src/components/tooltip-trigger/index.ts +0 -2
  165. package/src/components/tooltip-trigger/types.ts +0 -9
  166. package/src/index.ts +0 -16
  167. package/tsconfig.json +0 -3
  168. /package/{dist/CONTRIBUTING.md → CONTRIBUTING.md} +0 -0
  169. /package/{dist/index.d.ts → index.d.ts} +0 -0
  170. /package/{dist/index.js → index.js} +0 -0
  171. /package/{dist/index.js.map → index.js.map} +0 -0
@@ -1,349 +0,0 @@
1
- import React from 'react';
2
-
3
- import { ToastContainer, useToast } from '.';
4
- import { Button, Flexbox } from '@redsift/design-system';
5
-
6
- export default {
7
- title: 'Popovers/Toast/ToastContainer',
8
- component: ToastContainer,
9
- };
10
-
11
- export const Simple = () => {
12
- const { notify } = useToast();
13
-
14
- return (
15
- <>
16
- <Flexbox>
17
- <Button
18
- onClick={() =>
19
- notify({
20
- content: 'This is a success',
21
- variant: 'success',
22
- })
23
- }
24
- >
25
- Success
26
- </Button>
27
- <Button
28
- onClick={() =>
29
- notify({
30
- title: 'This is a warning',
31
- content: 'Cupcake ipsum dolor sit amet.',
32
- variant: 'warning',
33
- })
34
- }
35
- >
36
- Warning
37
- </Button>
38
- <Button
39
- onClick={() =>
40
- notify({
41
- title: 'This is an error',
42
- content:
43
- 'Cupcake ipsum dolor sit amet. Cookie chocolate cake muffin chocolate bar powder cake chupa chups. Gummies chocolate cake cupcake chupa chups sesame snaps soufflé soufflé gingerbread blueie. Caramels chocolate bar soufflé sesame snaps tiramisu. Cookie muffin pie cake cupcake sweet.',
44
- variant: 'error',
45
- })
46
- }
47
- >
48
- Error
49
- </Button>
50
- <Button
51
- onClick={() =>
52
- notify({
53
- title: 'This is an info',
54
- content:
55
- 'Cupcake ipsum dolor sit amet. Cookie chocolate cake muffin chocolate bar powder cake chupa chups.',
56
- variant: 'info',
57
- })
58
- }
59
- >
60
- Info
61
- </Button>
62
- </Flexbox>
63
- <ToastContainer />
64
- </>
65
- );
66
- };
67
-
68
- export const AllVariants = () => {
69
- const { notify, success, warning, error, info, loading } = useToast();
70
-
71
- return (
72
- <>
73
- <Flexbox
74
- flexDirection="row"
75
- flexWrap="wrap"
76
- justifyContent="center"
77
- alignItems="flex-start"
78
- marginTop="96px"
79
- >
80
- <Button
81
- variant="secondary"
82
- onClick={() =>
83
- notify({
84
- content: 'Default',
85
- })
86
- }
87
- >
88
- Default
89
- </Button>
90
- <Button
91
- variant="secondary"
92
- onClick={() =>
93
- success({
94
- content: 'Success',
95
- })
96
- }
97
- >
98
- Success
99
- </Button>
100
- <Button
101
- variant="secondary"
102
- onClick={() =>
103
- warning({
104
- content: 'Warning',
105
- })
106
- }
107
- >
108
- Warning
109
- </Button>
110
- <Button
111
- variant="secondary"
112
- onClick={() =>
113
- error({
114
- content: 'Error',
115
- })
116
- }
117
- >
118
- Error
119
- </Button>
120
- <Button
121
- variant="secondary"
122
- onClick={() =>
123
- info({
124
- content: 'Info',
125
- })
126
- }
127
- >
128
- Info
129
- </Button>
130
- <Button
131
- variant="secondary"
132
- onClick={() =>
133
- loading({
134
- content: 'Loading',
135
- })
136
- }
137
- >
138
- Loading
139
- </Button>
140
- </Flexbox>
141
- <ToastContainer />
142
- </>
143
- );
144
- };
145
-
146
- export const AllPlacements = () => {
147
- const { notify } = useToast();
148
-
149
- return (
150
- <>
151
- <Flexbox
152
- flexDirection="row"
153
- flexWrap="wrap"
154
- justifyContent="center"
155
- alignItems="flex-start"
156
- marginTop="96px"
157
- >
158
- <Button
159
- variant="secondary"
160
- onClick={() =>
161
- notify({
162
- content: 'Top-left',
163
- placement: 'top-left',
164
- })
165
- }
166
- >
167
- Top-left
168
- </Button>
169
- <Button
170
- variant="secondary"
171
- onClick={() =>
172
- notify({
173
- content: 'Top-center',
174
- placement: 'top-center',
175
- })
176
- }
177
- >
178
- Top-center
179
- </Button>
180
- <Button
181
- variant="secondary"
182
- onClick={() =>
183
- notify({
184
- content: 'Top-right',
185
- placement: 'top-right',
186
- })
187
- }
188
- >
189
- Top-right
190
- </Button>
191
- <Button
192
- variant="secondary"
193
- onClick={() =>
194
- notify({
195
- content: 'Bottom-left',
196
- placement: 'bottom-left',
197
- })
198
- }
199
- >
200
- Bottom-left
201
- </Button>
202
- <Button
203
- variant="secondary"
204
- onClick={() =>
205
- notify({
206
- content: 'Bottom-center',
207
- placement: 'bottom-center',
208
- })
209
- }
210
- >
211
- Bottom-center
212
- </Button>
213
- <Button
214
- variant="secondary"
215
- onClick={() =>
216
- notify({
217
- content: 'Bottom-right',
218
- placement: 'bottom-right',
219
- })
220
- }
221
- >
222
- Bottom-right
223
- </Button>
224
- </Flexbox>
225
- <ToastContainer />
226
- </>
227
- );
228
- };
229
-
230
- export const Dismiss = () => {
231
- const toastId = React.useRef<number | string | null>(null);
232
- const { notify, dismiss } = useToast();
233
-
234
- return (
235
- <>
236
- <Flexbox>
237
- <Button
238
- onClick={() => {
239
- toastId.current = notify({
240
- content: 'Saved!',
241
- autoClose: false,
242
- closeButton: false,
243
- });
244
- }}
245
- >
246
- Notify
247
- </Button>
248
- <Button
249
- onClick={() => {
250
- if (toastId.current) {
251
- dismiss(toastId.current);
252
- }
253
- }}
254
- >
255
- Dismiss
256
- </Button>
257
- <Button
258
- onClick={() => {
259
- dismiss();
260
- }}
261
- >
262
- Dismiss all
263
- </Button>
264
- </Flexbox>
265
- <ToastContainer />
266
- </>
267
- );
268
- };
269
-
270
- export const Update = () => {
271
- const toastId = React.useRef<number | string | null>(null);
272
- const { notify, update } = useToast();
273
-
274
- return (
275
- <>
276
- <Flexbox>
277
- <Button
278
- onClick={() => {
279
- toastId.current = notify({
280
- content: 'Saving...',
281
- variant: 'loading',
282
- autoClose: false,
283
- closeButton: false,
284
- });
285
- }}
286
- >
287
- Notify
288
- </Button>
289
- <Button
290
- onClick={() => {
291
- if (toastId.current) {
292
- update(toastId.current, {
293
- content: 'Saved!',
294
- autoClose: 5000,
295
- });
296
- }
297
- }}
298
- >
299
- Update
300
- </Button>
301
- </Flexbox>
302
- <ToastContainer />
303
- </>
304
- );
305
- };
306
-
307
- export const WithPromise = () => {
308
- const { promise } = useToast();
309
-
310
- return (
311
- <>
312
- <Flexbox>
313
- <Button
314
- variant="secondary"
315
- color="success"
316
- onClick={() => {
317
- const resolveAfter3Sec = new Promise((resolve) =>
318
- setTimeout(resolve, 3000)
319
- );
320
- promise(resolveAfter3Sec, {
321
- pending: { content: 'Promise is pending' },
322
- success: { content: 'Promise resolved!' },
323
- error: { content: 'Promise rejected!' },
324
- });
325
- }}
326
- >
327
- Successful promise
328
- </Button>
329
- <Button
330
- variant="secondary"
331
- color="error"
332
- onClick={() => {
333
- const failAfter3Sec = new Promise((_, reject) =>
334
- setTimeout(reject, 3000)
335
- );
336
- promise(failAfter3Sec, {
337
- pending: { content: 'Promise is pending' },
338
- success: { content: 'Promise resolved!' },
339
- error: { content: 'Promise rejected!' },
340
- });
341
- }}
342
- >
343
- Failing promise
344
- </Button>
345
- </Flexbox>
346
- <ToastContainer />
347
- </>
348
- );
349
- };
@@ -1,44 +0,0 @@
1
- import React, { forwardRef, RefObject } from 'react';
2
- import { Slide } from 'react-toastify';
3
-
4
- import { Comp } from '@redsift/design-system';
5
- import { ReactToastify, StyledToastContainer } from './styles';
6
- import { ToastContainerProps } from './types';
7
-
8
- const COMPONENT_NAME = 'ToastContainer';
9
- const CLASSNAME = 'redsift-toast-container';
10
- const DEFAULT_PROPS: Partial<ToastContainerProps> = {
11
- autoClose: 5000,
12
- closeOnClick: false,
13
- draggable: true,
14
- pauseOnFocusLoss: true,
15
- pauseOnHover: true,
16
- placement: 'top-right',
17
- };
18
-
19
- /**
20
- * The ToastContainer component.
21
- */
22
- export const ToastContainer: Comp<ToastContainerProps, HTMLDivElement> =
23
- forwardRef((props, ref) => {
24
- const { placement, ...forwardedProps } = props;
25
-
26
- return (
27
- <ReactToastify>
28
- <StyledToastContainer
29
- {...forwardedProps}
30
- className={ToastContainer.className}
31
- closeButton={false}
32
- icon={false}
33
- newestOnTop={placement!.includes('bottom')}
34
- position={placement}
35
- ref={ref as RefObject<HTMLDivElement>}
36
- theme="colored"
37
- transition={Slide}
38
- />
39
- </ReactToastify>
40
- );
41
- });
42
- ToastContainer.className = CLASSNAME;
43
- ToastContainer.defaultProps = DEFAULT_PROPS;
44
- ToastContainer.displayName = COMPONENT_NAME;
@@ -1,3 +0,0 @@
1
- export * from './types';
2
- export * from './ToastContainer';
3
- export * from './useToast';