@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.12

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 (136) hide show
  1. package/README.md +17 -5
  2. package/dist/Button-B1umG8kJ.js +131 -0
  3. package/dist/ClickAwayListener-HI1G6ob9.js +107 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Popup-DFJQc_jn.js +1249 -0
  6. package/dist/Portal-D__zvwbZ.js +73 -0
  7. package/dist/SelectButton-DWtqAiwt.js +45 -0
  8. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  9. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  10. package/dist/assets/Advice.css +1 -0
  11. package/dist/assets/Button.css +1 -0
  12. package/dist/assets/Checkbox.css +1 -0
  13. package/dist/assets/Dialog.css +1 -1
  14. package/dist/assets/IconButton.css +1 -0
  15. package/dist/assets/Input.css +1 -0
  16. package/dist/assets/InputSearch.css +1 -0
  17. package/dist/assets/LoadingSpinner.css +1 -1
  18. package/dist/assets/PageHeader.css +1 -0
  19. package/dist/assets/Pagination.css +1 -0
  20. package/dist/assets/SelectButton.css +1 -0
  21. package/dist/assets/Skeleton.css +1 -0
  22. package/dist/assets/Snackbar.css +1 -0
  23. package/dist/assets/SortTooltip.css +1 -0
  24. package/dist/assets/Stepper.css +1 -0
  25. package/dist/assets/Table.css +1 -0
  26. package/dist/assets/Tabs.css +1 -0
  27. package/dist/assets/Toggle.css +1 -0
  28. package/dist/assets/Tooltip.css +1 -0
  29. package/dist/assets/Typography.css +1 -1
  30. package/dist/assets/global.css +1 -0
  31. package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
  32. package/dist/components/Advice/Advice.d.ts +16 -0
  33. package/dist/components/Advice/Advice.js +25 -0
  34. package/dist/components/Button/Button.d.ts +29 -0
  35. package/dist/components/Button/Button.js +70 -0
  36. package/dist/components/Button/Button.stories.d.ts +60 -0
  37. package/dist/components/Button/Button.stories.js +41 -0
  38. package/dist/components/Checkbox/Checkbox.d.ts +19 -0
  39. package/dist/components/Checkbox/Checkbox.js +56 -0
  40. package/dist/components/Dialog/Actions.js +1 -1
  41. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  42. package/dist/components/Dialog/Backdrop.js +2 -9
  43. package/dist/components/Dialog/CloseIconButton.js +11 -10
  44. package/dist/components/Dialog/Dialog.d.ts +5 -4
  45. package/dist/components/Dialog/Dialog.js +420 -20077
  46. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  47. package/dist/components/Dialog/Dialog.stories.js +60 -0
  48. package/dist/components/Dialog/Title.js +22 -7
  49. package/dist/components/Icon/Icon.d.ts +18 -0
  50. package/dist/components/Icon/Icon.js +95 -0
  51. package/dist/components/IconButton/IconButton.d.ts +22 -0
  52. package/dist/components/IconButton/IconButton.js +68 -0
  53. package/dist/components/Input/Input.d.ts +44 -0
  54. package/dist/components/Input/Input.js +497 -0
  55. package/dist/components/Input/Input.stories.d.ts +43 -0
  56. package/dist/components/Input/Input.stories.js +106 -0
  57. package/dist/components/InputSearch/InputSearch.d.ts +11 -0
  58. package/dist/components/InputSearch/InputSearch.js +29 -0
  59. package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
  60. package/dist/components/InputSearch/InputSearch.stories.js +36 -0
  61. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  62. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  63. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  64. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +39 -0
  65. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  66. package/dist/components/PageHeader/PageHeader.js +51 -0
  67. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  68. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  69. package/dist/components/Pagination/Pagination.d.ts +36 -0
  70. package/dist/components/Pagination/Pagination.js +219 -0
  71. package/dist/components/Select/Select.d.ts +25 -0
  72. package/dist/components/Select/Select.js +860 -0
  73. package/dist/components/Select/Select.stories.d.ts +31 -0
  74. package/dist/components/Select/Select.stories.js +66 -0
  75. package/dist/components/Select/SelectButton.d.ts +13 -0
  76. package/dist/components/Select/SelectButton.js +8 -0
  77. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  78. package/dist/components/Skeleton/Skeleton.js +26 -0
  79. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  80. package/dist/components/Snackbar/Snackbar.js +623 -0
  81. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  82. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  83. package/dist/components/Stepper/Stepper.d.ts +16 -0
  84. package/dist/components/Stepper/Stepper.js +33 -0
  85. package/dist/components/Table/Table.d.ts +39 -0
  86. package/dist/components/Table/Table.js +122 -0
  87. package/dist/components/Table/TableContext.d.ts +19 -0
  88. package/dist/components/Table/TableContext.js +21 -0
  89. package/dist/components/Tabs/Tab.d.ts +9 -0
  90. package/dist/components/Tabs/Tab.js +182 -0
  91. package/dist/components/Tabs/TabPanel.d.ts +8 -0
  92. package/dist/components/Tabs/TabPanel.js +119 -0
  93. package/dist/components/Tabs/Tabs.d.ts +11 -0
  94. package/dist/components/Tabs/Tabs.js +402 -0
  95. package/dist/components/Toggle/Toggle.d.ts +11 -0
  96. package/dist/components/Toggle/Toggle.js +252 -0
  97. package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
  98. package/dist/components/Toggle/Toggle.stories.js +33 -0
  99. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  100. package/dist/components/Tooltip/Tooltip.js +127 -0
  101. package/dist/components/Typography/Typography.d.ts +15 -6
  102. package/dist/components/Typography/Typography.js +75 -67
  103. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  104. package/dist/components/Typography/Typography.stories.js +31 -0
  105. package/dist/components/Typography/typography.test.d.ts +1 -0
  106. package/dist/components/Typography/typography.test.js +11358 -0
  107. package/dist/index-BJ8HbRCy.js +19585 -0
  108. package/dist/index-CqjC7P5Y.js +814 -0
  109. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  110. package/dist/main.d.ts +19 -2
  111. package/dist/main.js +60 -15
  112. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  113. package/dist/test-utils/assertStyles.d.ts +1 -0
  114. package/dist/test-utils/assertStyles.js +11 -0
  115. package/dist/types/helpers.d.ts +14 -7
  116. package/dist/useButton-Bc8IAgyk.js +106 -0
  117. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  118. package/dist/useControlled-CCMYYdCM.js +31 -0
  119. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  120. package/dist/useEventCallback-vAfOD-oT.js +45 -0
  121. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  122. package/dist/useList-ByMguSS_.js +437 -0
  123. package/dist/useTimeout-DxF9kiZL.js +36 -0
  124. package/dist/utils/styleStrings.d.ts +6 -0
  125. package/dist/utils/styleStrings.js +10 -0
  126. package/dist/utils/styleStrings.test.d.ts +1 -0
  127. package/dist/utils/styleStrings.test.js +41 -0
  128. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  129. package/package.json +53 -10
  130. package/dist/Button-REznN-RP.js +0 -1139
  131. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  132. package/dist/assets/CallToActionButton.css +0 -1
  133. package/dist/assets/main.css +0 -1
  134. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
  135. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  136. package/src/playground/Playground.tsx +0 -58
@@ -0,0 +1,623 @@
1
+ import '../../assets/Snackbar.css';
2
+ import { jsx as h, jsxs as Y } from "react/jsx-runtime";
3
+ import * as N from "react";
4
+ import C, { useState as V, useRef as X } from "react";
5
+ import { c as O } from "../../clsx-DB4S2d7J.js";
6
+ import { Icon as K } from "../Icon/Icon.js";
7
+ import { a as w, _ as j } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
8
+ import { g as $, a as z, e as H, b as U, P as t, c as J, d as Q } from "../../index-CqjC7P5Y.js";
9
+ import { u as Z } from "../../useTimeout-DxF9kiZL.js";
10
+ import { u as I } from "../../useEventCallback-vAfOD-oT.js";
11
+ import { C as B } from "../../ClickAwayListener-HI1G6ob9.js";
12
+ import { R as D } from "../../index-BJ8HbRCy.js";
13
+ const W = "Snackbar";
14
+ function ee(u) {
15
+ return $(W, u);
16
+ }
17
+ z(W, ["root"]);
18
+ function te(u = {}) {
19
+ const {
20
+ autoHideDuration: s = null,
21
+ disableWindowBlurListener: a = !1,
22
+ onClose: r,
23
+ open: n,
24
+ resumeHideDuration: e
25
+ } = u, o = Z();
26
+ N.useEffect(() => {
27
+ if (!n)
28
+ return;
29
+ function l(d) {
30
+ d.defaultPrevented || (d.key === "Escape" || d.key === "Esc") && (r == null || r(d, "escapeKeyDown"));
31
+ }
32
+ return document.addEventListener("keydown", l), () => {
33
+ document.removeEventListener("keydown", l);
34
+ };
35
+ }, [n, r]);
36
+ const i = I((l, d) => {
37
+ r == null || r(l, d);
38
+ }), c = I((l) => {
39
+ !r || l == null || o.start(l, () => {
40
+ i(null, "timeout");
41
+ });
42
+ });
43
+ N.useEffect(() => (n && c(s), o.clear), [n, s, c, o]);
44
+ const m = (l) => {
45
+ r == null || r(l, "clickaway");
46
+ }, p = o.clear, E = N.useCallback(() => {
47
+ s != null && c(e ?? s * 0.5);
48
+ }, [s, e, c]), x = (l) => (d) => {
49
+ const f = l.onBlur;
50
+ f == null || f(d), E();
51
+ }, g = (l) => (d) => {
52
+ const f = l.onFocus;
53
+ f == null || f(d), p();
54
+ }, R = (l) => (d) => {
55
+ const f = l.onMouseEnter;
56
+ f == null || f(d), p();
57
+ }, P = (l) => (d) => {
58
+ const f = l.onMouseLeave;
59
+ f == null || f(d), E();
60
+ };
61
+ return N.useEffect(() => {
62
+ if (!a && n)
63
+ return window.addEventListener("focus", E), window.addEventListener("blur", p), () => {
64
+ window.removeEventListener("focus", E), window.removeEventListener("blur", p);
65
+ };
66
+ }, [a, n, E, p]), {
67
+ getRootProps: (l = {}) => {
68
+ const d = w({}, H(u), H(l));
69
+ return w({
70
+ // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
71
+ // See https://github.com/mui/material-ui/issues/29080
72
+ role: "presentation"
73
+ }, l, d, {
74
+ onBlur: x(d),
75
+ onFocus: g(d),
76
+ onMouseEnter: R(d),
77
+ onMouseLeave: P(d)
78
+ });
79
+ },
80
+ onClickAway: m
81
+ };
82
+ }
83
+ const ne = ["autoHideDuration", "children", "disableWindowBlurListener", "exited", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "slotProps", "slots"], oe = () => J({
84
+ root: ["root"]
85
+ }, Q(ee)), q = /* @__PURE__ */ N.forwardRef(function(s, a) {
86
+ const {
87
+ autoHideDuration: r = null,
88
+ children: n,
89
+ disableWindowBlurListener: e = !1,
90
+ exited: o = !0,
91
+ onClose: i,
92
+ open: c,
93
+ resumeHideDuration: m,
94
+ slotProps: p = {},
95
+ slots: E = {}
96
+ } = s, x = j(s, ne), g = oe(), {
97
+ getRootProps: R,
98
+ onClickAway: P
99
+ } = te(w({}, s, {
100
+ autoHideDuration: r,
101
+ disableWindowBlurListener: e,
102
+ onClose: i,
103
+ open: c,
104
+ resumeHideDuration: m
105
+ })), L = s, l = E.root || "div", d = U({
106
+ elementType: l,
107
+ getSlotProps: R,
108
+ externalForwardedProps: x,
109
+ externalSlotProps: p.root,
110
+ additionalProps: {
111
+ ref: a
112
+ },
113
+ ownerState: L,
114
+ className: g.root
115
+ }), f = U({
116
+ elementType: B,
117
+ externalSlotProps: p.clickAwayListener,
118
+ additionalProps: {
119
+ onClickAway: P
120
+ },
121
+ ownerState: L
122
+ });
123
+ return delete f.ownerState, !c && o ? null : /* @__PURE__ */ h(B, w({}, f, {
124
+ children: /* @__PURE__ */ h(l, w({}, d, {
125
+ children: n
126
+ }))
127
+ }));
128
+ });
129
+ process.env.NODE_ENV !== "production" && (q.propTypes = {
130
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
131
+ // │ These PropTypes are generated from the TypeScript type definitions. │
132
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
133
+ // └─────────────────────────────────────────────────────────────────────┘
134
+ /**
135
+ * The number of milliseconds to wait before automatically calling the
136
+ * `onClose` function. `onClose` should then set the state of the `open`
137
+ * prop to hide the Snackbar. This behavior is disabled by default with
138
+ * the `null` value.
139
+ * @default null
140
+ */
141
+ autoHideDuration: t.number,
142
+ /**
143
+ * @ignore
144
+ */
145
+ children: t.node,
146
+ /**
147
+ * If `true`, the `autoHideDuration` timer will expire even if the window is not focused.
148
+ * @default false
149
+ */
150
+ disableWindowBlurListener: t.bool,
151
+ /**
152
+ * The prop used to handle exited transition and unmount the component.
153
+ * @default true
154
+ */
155
+ exited: t.bool,
156
+ /**
157
+ * Callback fired when the component requests to be closed.
158
+ * Typically `onClose` is used to set state in the parent component,
159
+ * which is used to control the `Snackbar` `open` prop.
160
+ * The `reason` parameter can optionally be used to control the response to `onClose`,
161
+ * for example ignoring `clickaway`.
162
+ *
163
+ * @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
164
+ * @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
165
+ */
166
+ onClose: t.func,
167
+ /**
168
+ * If `true`, the component is shown.
169
+ */
170
+ open: t.bool,
171
+ /**
172
+ * The number of milliseconds to wait before dismissing after user interaction.
173
+ * If `autoHideDuration` prop isn't specified, it does nothing.
174
+ * If `autoHideDuration` prop is specified but `resumeHideDuration` isn't,
175
+ * we default to `autoHideDuration / 2` ms.
176
+ */
177
+ resumeHideDuration: t.number,
178
+ /**
179
+ * The props used for each slot inside the Snackbar.
180
+ * @default {}
181
+ */
182
+ slotProps: t.shape({
183
+ clickAwayListener: t.oneOfType([t.func, t.shape({
184
+ children: t.element.isRequired,
185
+ disableReactTree: t.bool,
186
+ mouseEvent: t.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
187
+ onClickAway: t.func,
188
+ touchEvent: t.oneOf(["onTouchEnd", "onTouchStart", !1])
189
+ })]),
190
+ root: t.oneOfType([t.func, t.object])
191
+ }),
192
+ /**
193
+ * The components used for each slot inside the Snackbar.
194
+ * Either a string to use a HTML element or a component.
195
+ * @default {}
196
+ */
197
+ slots: t.shape({
198
+ root: t.elementType
199
+ })
200
+ });
201
+ function M(u, s) {
202
+ return M = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
203
+ return r.__proto__ = n, r;
204
+ }, M(u, s);
205
+ }
206
+ function re(u, s) {
207
+ u.prototype = Object.create(s.prototype), u.prototype.constructor = u, M(u, s);
208
+ }
209
+ const F = {
210
+ disabled: !1
211
+ };
212
+ var se = process.env.NODE_ENV !== "production" ? t.oneOfType([t.number, t.shape({
213
+ enter: t.number,
214
+ exit: t.number,
215
+ appear: t.number
216
+ }).isRequired]) : null;
217
+ process.env.NODE_ENV !== "production" && t.oneOfType([t.string, t.shape({
218
+ enter: t.string,
219
+ exit: t.string,
220
+ active: t.string
221
+ }), t.shape({
222
+ enter: t.string,
223
+ enterDone: t.string,
224
+ enterActive: t.string,
225
+ exit: t.string,
226
+ exitDone: t.string,
227
+ exitActive: t.string
228
+ })]);
229
+ const G = C.createContext(null);
230
+ var ie = function(s) {
231
+ return s.scrollTop;
232
+ }, S = "unmounted", v = "exited", k = "entering", y = "entered", A = "exiting", b = /* @__PURE__ */ function(u) {
233
+ re(s, u);
234
+ function s(r, n) {
235
+ var e;
236
+ e = u.call(this, r, n) || this;
237
+ var o = n, i = o && !o.isMounting ? r.enter : r.appear, c;
238
+ return e.appearStatus = null, r.in ? i ? (c = v, e.appearStatus = k) : c = y : r.unmountOnExit || r.mountOnEnter ? c = S : c = v, e.state = {
239
+ status: c
240
+ }, e.nextCallback = null, e;
241
+ }
242
+ s.getDerivedStateFromProps = function(n, e) {
243
+ var o = n.in;
244
+ return o && e.status === S ? {
245
+ status: v
246
+ } : null;
247
+ };
248
+ var a = s.prototype;
249
+ return a.componentDidMount = function() {
250
+ this.updateStatus(!0, this.appearStatus);
251
+ }, a.componentDidUpdate = function(n) {
252
+ var e = null;
253
+ if (n !== this.props) {
254
+ var o = this.state.status;
255
+ this.props.in ? o !== k && o !== y && (e = k) : (o === k || o === y) && (e = A);
256
+ }
257
+ this.updateStatus(!1, e);
258
+ }, a.componentWillUnmount = function() {
259
+ this.cancelNextCallback();
260
+ }, a.getTimeouts = function() {
261
+ var n = this.props.timeout, e, o, i;
262
+ return e = o = i = n, n != null && typeof n != "number" && (e = n.exit, o = n.enter, i = n.appear !== void 0 ? n.appear : o), {
263
+ exit: e,
264
+ enter: o,
265
+ appear: i
266
+ };
267
+ }, a.updateStatus = function(n, e) {
268
+ if (n === void 0 && (n = !1), e !== null)
269
+ if (this.cancelNextCallback(), e === k) {
270
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
271
+ var o = this.props.nodeRef ? this.props.nodeRef.current : D.findDOMNode(this);
272
+ o && ie(o);
273
+ }
274
+ this.performEnter(n);
275
+ } else
276
+ this.performExit();
277
+ else
278
+ this.props.unmountOnExit && this.state.status === v && this.setState({
279
+ status: S
280
+ });
281
+ }, a.performEnter = function(n) {
282
+ var e = this, o = this.props.enter, i = this.context ? this.context.isMounting : n, c = this.props.nodeRef ? [i] : [D.findDOMNode(this), i], m = c[0], p = c[1], E = this.getTimeouts(), x = i ? E.appear : E.enter;
283
+ if (!n && !o || F.disabled) {
284
+ this.safeSetState({
285
+ status: y
286
+ }, function() {
287
+ e.props.onEntered(m);
288
+ });
289
+ return;
290
+ }
291
+ this.props.onEnter(m, p), this.safeSetState({
292
+ status: k
293
+ }, function() {
294
+ e.props.onEntering(m, p), e.onTransitionEnd(x, function() {
295
+ e.safeSetState({
296
+ status: y
297
+ }, function() {
298
+ e.props.onEntered(m, p);
299
+ });
300
+ });
301
+ });
302
+ }, a.performExit = function() {
303
+ var n = this, e = this.props.exit, o = this.getTimeouts(), i = this.props.nodeRef ? void 0 : D.findDOMNode(this);
304
+ if (!e || F.disabled) {
305
+ this.safeSetState({
306
+ status: v
307
+ }, function() {
308
+ n.props.onExited(i);
309
+ });
310
+ return;
311
+ }
312
+ this.props.onExit(i), this.safeSetState({
313
+ status: A
314
+ }, function() {
315
+ n.props.onExiting(i), n.onTransitionEnd(o.exit, function() {
316
+ n.safeSetState({
317
+ status: v
318
+ }, function() {
319
+ n.props.onExited(i);
320
+ });
321
+ });
322
+ });
323
+ }, a.cancelNextCallback = function() {
324
+ this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
325
+ }, a.safeSetState = function(n, e) {
326
+ e = this.setNextCallback(e), this.setState(n, e);
327
+ }, a.setNextCallback = function(n) {
328
+ var e = this, o = !0;
329
+ return this.nextCallback = function(i) {
330
+ o && (o = !1, e.nextCallback = null, n(i));
331
+ }, this.nextCallback.cancel = function() {
332
+ o = !1;
333
+ }, this.nextCallback;
334
+ }, a.onTransitionEnd = function(n, e) {
335
+ this.setNextCallback(e);
336
+ var o = this.props.nodeRef ? this.props.nodeRef.current : D.findDOMNode(this), i = n == null && !this.props.addEndListener;
337
+ if (!o || i) {
338
+ setTimeout(this.nextCallback, 0);
339
+ return;
340
+ }
341
+ if (this.props.addEndListener) {
342
+ var c = this.props.nodeRef ? [this.nextCallback] : [o, this.nextCallback], m = c[0], p = c[1];
343
+ this.props.addEndListener(m, p);
344
+ }
345
+ n != null && setTimeout(this.nextCallback, n);
346
+ }, a.render = function() {
347
+ var n = this.state.status;
348
+ if (n === S)
349
+ return null;
350
+ var e = this.props, o = e.children;
351
+ e.in, e.mountOnEnter, e.unmountOnExit, e.appear, e.enter, e.exit, e.timeout, e.addEndListener, e.onEnter, e.onEntering, e.onEntered, e.onExit, e.onExiting, e.onExited, e.nodeRef;
352
+ var i = j(e, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
353
+ return (
354
+ // allows for nested Transitions
355
+ /* @__PURE__ */ C.createElement(G.Provider, {
356
+ value: null
357
+ }, typeof o == "function" ? o(n, i) : C.cloneElement(C.Children.only(o), i))
358
+ );
359
+ }, s;
360
+ }(C.Component);
361
+ b.contextType = G;
362
+ b.propTypes = process.env.NODE_ENV !== "production" ? {
363
+ /**
364
+ * A React reference to DOM element that need to transition:
365
+ * https://stackoverflow.com/a/51127130/4671932
366
+ *
367
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
368
+ * (e.g. `onEnter`) because user already has direct access to the node.
369
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
370
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
371
+ * (see
372
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
373
+ */
374
+ nodeRef: t.shape({
375
+ current: typeof Element > "u" ? t.any : function(u, s, a, r, n, e) {
376
+ var o = u[s];
377
+ return t.instanceOf(o && "ownerDocument" in o ? o.ownerDocument.defaultView.Element : Element)(u, s, a, r, n, e);
378
+ }
379
+ }),
380
+ /**
381
+ * A `function` child can be used instead of a React element. This function is
382
+ * called with the current transition status (`'entering'`, `'entered'`,
383
+ * `'exiting'`, `'exited'`), which can be used to apply context
384
+ * specific props to a component.
385
+ *
386
+ * ```jsx
387
+ * <Transition in={this.state.in} timeout={150}>
388
+ * {state => (
389
+ * <MyComponent className={`fade fade-${state}`} />
390
+ * )}
391
+ * </Transition>
392
+ * ```
393
+ */
394
+ children: t.oneOfType([t.func.isRequired, t.element.isRequired]).isRequired,
395
+ /**
396
+ * Show the component; triggers the enter or exit states
397
+ */
398
+ in: t.bool,
399
+ /**
400
+ * By default the child component is mounted immediately along with
401
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
402
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
403
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
404
+ */
405
+ mountOnEnter: t.bool,
406
+ /**
407
+ * By default the child component stays mounted after it reaches the `'exited'` state.
408
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
409
+ */
410
+ unmountOnExit: t.bool,
411
+ /**
412
+ * By default the child component does not perform the enter transition when
413
+ * it first mounts, regardless of the value of `in`. If you want this
414
+ * behavior, set both `appear` and `in` to `true`.
415
+ *
416
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
417
+ * > only adds an additional enter transition. However, in the
418
+ * > `<CSSTransition>` component that first enter transition does result in
419
+ * > additional `.appear-*` classes, that way you can choose to style it
420
+ * > differently.
421
+ */
422
+ appear: t.bool,
423
+ /**
424
+ * Enable or disable enter transitions.
425
+ */
426
+ enter: t.bool,
427
+ /**
428
+ * Enable or disable exit transitions.
429
+ */
430
+ exit: t.bool,
431
+ /**
432
+ * The duration of the transition, in milliseconds.
433
+ * Required unless `addEndListener` is provided.
434
+ *
435
+ * You may specify a single timeout for all transitions:
436
+ *
437
+ * ```jsx
438
+ * timeout={500}
439
+ * ```
440
+ *
441
+ * or individually:
442
+ *
443
+ * ```jsx
444
+ * timeout={{
445
+ * appear: 500,
446
+ * enter: 300,
447
+ * exit: 500,
448
+ * }}
449
+ * ```
450
+ *
451
+ * - `appear` defaults to the value of `enter`
452
+ * - `enter` defaults to `0`
453
+ * - `exit` defaults to `0`
454
+ *
455
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
456
+ */
457
+ timeout: function(s) {
458
+ var a = se;
459
+ s.addEndListener || (a = a.isRequired);
460
+ for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), e = 1; e < r; e++)
461
+ n[e - 1] = arguments[e];
462
+ return a.apply(void 0, [s].concat(n));
463
+ },
464
+ /**
465
+ * Add a custom transition end trigger. Called with the transitioning
466
+ * DOM node and a `done` callback. Allows for more fine grained transition end
467
+ * logic. Timeouts are still used as a fallback if provided.
468
+ *
469
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
470
+ *
471
+ * ```jsx
472
+ * addEndListener={(node, done) => {
473
+ * // use the css transitionend event to mark the finish of a transition
474
+ * node.addEventListener('transitionend', done, false);
475
+ * }}
476
+ * ```
477
+ */
478
+ addEndListener: t.func,
479
+ /**
480
+ * Callback fired before the "entering" status is applied. An extra parameter
481
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
482
+ *
483
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
484
+ *
485
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
486
+ */
487
+ onEnter: t.func,
488
+ /**
489
+ * Callback fired after the "entering" status is applied. An extra parameter
490
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
491
+ *
492
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
493
+ *
494
+ * @type Function(node: HtmlElement, isAppearing: bool)
495
+ */
496
+ onEntering: t.func,
497
+ /**
498
+ * Callback fired after the "entered" status is applied. An extra parameter
499
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
500
+ *
501
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
502
+ *
503
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
504
+ */
505
+ onEntered: t.func,
506
+ /**
507
+ * Callback fired before the "exiting" status is applied.
508
+ *
509
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
510
+ *
511
+ * @type Function(node: HtmlElement) -> void
512
+ */
513
+ onExit: t.func,
514
+ /**
515
+ * Callback fired after the "exiting" status is applied.
516
+ *
517
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
518
+ *
519
+ * @type Function(node: HtmlElement) -> void
520
+ */
521
+ onExiting: t.func,
522
+ /**
523
+ * Callback fired after the "exited" status is applied.
524
+ *
525
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
526
+ *
527
+ * @type Function(node: HtmlElement) -> void
528
+ */
529
+ onExited: t.func
530
+ } : {};
531
+ function _() {
532
+ }
533
+ b.defaultProps = {
534
+ in: !1,
535
+ mountOnEnter: !1,
536
+ unmountOnExit: !1,
537
+ appear: !1,
538
+ enter: !0,
539
+ exit: !0,
540
+ onEnter: _,
541
+ onEntering: _,
542
+ onEntered: _,
543
+ onExit: _,
544
+ onExiting: _,
545
+ onExited: _
546
+ };
547
+ b.UNMOUNTED = S;
548
+ b.EXITED = v;
549
+ b.ENTERING = k;
550
+ b.ENTERED = y;
551
+ b.EXITING = A;
552
+ const ae = "_snackbar_kt3bd_1", ue = "_bottomToTop_kt3bd_1", T = {
553
+ snackbar: ae,
554
+ "snackbar__snackbar-el-wrapper": "_snackbar__snackbar-el-wrapper_kt3bd_14",
555
+ "snackbar--content": "_snackbar--content_kt3bd_19",
556
+ "snackbar--success": "_snackbar--success_kt3bd_29",
557
+ "snackbar--error": "_snackbar--error_kt3bd_32",
558
+ "snackbar--attention": "_snackbar--attention_kt3bd_35",
559
+ "snackbar--message": "_snackbar--message_kt3bd_38",
560
+ "snackbar--action": "_snackbar--action_kt3bd_46",
561
+ bottomToTop: ue
562
+ }, ve = ({
563
+ snackbarMessage: u,
564
+ color: s,
565
+ autoHideDuration: a = 5e3,
566
+ open: r = !0,
567
+ onClose: n,
568
+ classNameWrapper: e,
569
+ "data-testid": o
570
+ }) => {
571
+ const [i, c] = V(!0), m = X(null), p = {
572
+ entering: "translateY(0)",
573
+ entered: "translateY(0)",
574
+ exiting: "translateY(80px)",
575
+ exited: "translateY(80px)",
576
+ unmounted: "translateY(80px)"
577
+ }, E = () => {
578
+ c(!1);
579
+ }, x = () => {
580
+ c(!0);
581
+ };
582
+ return /* @__PURE__ */ h("div", { className: O(T.snackbar, e), children: /* @__PURE__ */ h(
583
+ q,
584
+ {
585
+ autoHideDuration: a,
586
+ open: r,
587
+ onClose: n,
588
+ exited: i,
589
+ className: O(T["snackbar__snackbar-el-wrapper"]),
590
+ children: /* @__PURE__ */ h(
591
+ b,
592
+ {
593
+ timeout: { enter: 400, exit: 400 },
594
+ in: r,
595
+ appear: !0,
596
+ unmountOnExit: !0,
597
+ onEnter: E,
598
+ onExited: x,
599
+ nodeRef: m,
600
+ children: (g) => /* @__PURE__ */ Y(
601
+ "div",
602
+ {
603
+ className: O(T["snackbar--content"], T[`snackbar--${s}`]),
604
+ style: {
605
+ transform: p[g],
606
+ transition: "transform 300ms ease"
607
+ },
608
+ ref: m,
609
+ "data-testid": o,
610
+ children: [
611
+ /* @__PURE__ */ h("div", { className: O(T["snackbar--message"]), children: /* @__PURE__ */ h("p", { children: u }) }),
612
+ /* @__PURE__ */ h("div", { className: O(T["snackbar--action"]), children: /* @__PURE__ */ h("a", { onClick: n, children: /* @__PURE__ */ h(K, { icon: "xmark", color: "var(--white-100)", size: "1.5rem" }) }) })
613
+ ]
614
+ }
615
+ )
616
+ }
617
+ )
618
+ }
619
+ ) });
620
+ };
621
+ export {
622
+ ve as Snackbar
623
+ };
@@ -0,0 +1,26 @@
1
+ export type SortType = 'ASC' | 'DESC';
2
+ type SortCommonProps = {
3
+ className?: string;
4
+ 'data-testid'?: string;
5
+ };
6
+ export type SortTranslationsByKeys = {
7
+ asc: string;
8
+ desc: string;
9
+ };
10
+ type SortLanguages = 'pt' | 'en';
11
+ type SortTranslations = {
12
+ t?: SortTranslationsByKeys;
13
+ language?: SortLanguages;
14
+ };
15
+ type SortTooltipProps = {
16
+ onSort: (order: SortType) => void;
17
+ onClose: () => void;
18
+ sortType?: SortType;
19
+ show?: boolean;
20
+ anchorRef?: HTMLElement | null | undefined;
21
+ } & SortCommonProps & SortTranslations;
22
+ export declare const sortTooltipDefaultTranslations: {
23
+ [key in SortLanguages]: SortTranslationsByKeys;
24
+ };
25
+ declare const SortTooltip: ({ show, onSort, sortType, onClose, t, language, className, ...rest }: SortTooltipProps) => import("react/jsx-runtime").JSX.Element;
26
+ export { SortTooltip };