@pushwoosh/dumb-components 2.9.2 → 2.9.4
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/Calendar/CalendarMonthSlider/CalendarMonthSlider.js +1 -1
- package/Calendar/CalendarMonthSlider/styles.d.ts +1 -1
- package/Calendar/CalendarMonthSlider/styles.js +2 -2
- package/CardMetric/CardCollapse.js +2 -2
- package/CardMetric/CardMetric.js +4 -4
- package/CardMetric/__tests__/CardMetric.test.d.ts +1 -0
- package/CardMetric/__tests__/CardMetric.test.js +31 -0
- package/CardMetric/styles.d.ts +8 -4
- package/CardMetric/styles.js +23 -23
- package/CardMetric/types.d.ts +3 -3
- package/DateTimePicker/__tests__/YearView.test.d.ts +1 -0
- package/DateTimePicker/__tests__/YearView.test.js +15 -0
- package/DateTimePicker/components/DecadeView/DecadeView.js +1 -1
- package/DateTimePicker/components/YearView/YearView.js +1 -1
- package/DateTimePicker/styles.d.ts +1 -1
- package/DateTimePicker/styles.js +2 -2
- package/EditableField/EditableField.js +1 -1
- package/EditableField/__tests__/EditableField.test.d.ts +1 -0
- package/EditableField/__tests__/EditableField.test.js +19 -0
- package/EditableField/styles.d.ts +1 -1
- package/EditableField/styles.js +8 -8
- package/ExternalImagePreview/ExternalImagePreview.js +9 -9
- package/ExternalImagePreview/__tests__/ExternalImagePreview.test.d.ts +1 -0
- package/ExternalImagePreview/__tests__/ExternalImagePreview.test.js +18 -0
- package/ExternalImagePreview/styles.d.ts +7 -7
- package/ExternalImagePreview/styles.js +14 -14
- package/NativeRichMediaPreview/NativeRichMediaPreview.js +2 -2
- package/NativeRichMediaPreview/styles.d.ts +2 -2
- package/NativeRichMediaPreview/styles.js +4 -4
- package/PageHeader/__tests__/PageHeader.test.d.ts +1 -0
- package/PageHeader/__tests__/PageHeader.test.js +37 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +1 -1
- package/PageHeader/components/AutosizeInput/styles.js +2 -2
- package/PageHeader/components/AutosizeInput/types.d.ts +1 -1
- package/PageHeader/components/PageHeader/PageHeader.js +1 -1
- package/PageHeader/components/PageHeader/styles.d.ts +1 -1
- package/PageHeader/components/PageHeader/styles.js +2 -2
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +1 -1
- package/PageHeader/components/PageHeaderEditable/styles.d.ts +1 -1
- package/PageHeader/components/PageHeaderEditable/styles.js +2 -2
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +6 -6
- package/PageHeader/components/PageHeaderSkeleton/styles.d.ts +2 -2
- package/PageHeader/components/PageHeaderSkeleton/styles.js +4 -4
- package/Popover/types.d.ts +3 -3
- package/PushPreview/PushPreview.js +4 -4
- package/PushPreview/__tests__/PushPreview.test.d.ts +1 -0
- package/PushPreview/__tests__/PushPreview.test.js +26 -0
- package/PushPreview/components/MissedContentPreview/MissedContentPreview.js +3 -3
- package/PushPreview/components/SilentPushPreview/SilentPushPreview.js +3 -3
- package/PushPreview/styles.d.ts +4 -4
- package/PushPreview/styles.js +8 -8
- package/RadioCard/RadioCard.js +2 -2
- package/RadioCard/__tests__/RadioCard.test.d.ts +1 -0
- package/RadioCard/__tests__/RadioCard.test.js +23 -0
- package/RadioCard/styles.d.ts +2 -2
- package/RadioCard/styles.js +10 -10
- package/RichmediaPreview/RichmediaPreview.js +2 -2
- package/RichmediaPreview/__tests__/RichmediaPreview.test.d.ts +1 -0
- package/RichmediaPreview/__tests__/RichmediaPreview.test.js +21 -0
- package/RichmediaPreview/styles.d.ts +2 -2
- package/RichmediaPreview/styles.js +4 -4
- package/Spinner/Spinner.js +1 -1
- package/Spinner/__tests__/Spinner.test.d.ts +1 -0
- package/Spinner/__tests__/Spinner.test.js +15 -0
- package/Spinner/styles.d.ts +1 -1
- package/Spinner/styles.js +4 -4
- package/Switch/Switch.js +7 -7
- package/Switch/styles.js +18 -18
- package/Switch/types.d.ts +4 -4
- package/Tabs/__tests__/TabBar.test.d.ts +1 -0
- package/Tabs/__tests__/TabBar.test.js +36 -0
- package/Tabs/components/TabBar/TabBar.js +1 -1
- package/Tabs/components/TabBar/styles.d.ts +1 -1
- package/Tabs/components/TabBar/styles.js +2 -2
- package/Tabs/components/TabBarScrollableFrame/TabBarScrollableFrame.js +1 -1
- package/Tabs/components/TabBarScrollableFrame/styles.d.ts +1 -1
- package/Tabs/components/TabBarScrollableFrame/styles.js +2 -2
- package/Toast/Toast.js +2 -2
- package/Toast/__tests__/Toast.test.d.ts +1 -0
- package/Toast/__tests__/Toast.test.js +20 -0
- package/Toast/styles.d.ts +2 -2
- package/Toast/styles.js +4 -4
- package/Tooltip/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -7,6 +7,6 @@ export declare const TabBarWindow: import("styled-components").StyledComponent<"
|
|
|
7
7
|
}, never>;
|
|
8
8
|
export declare const TabsListContentBase: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
9
|
export declare const TabBarContent: import("styled-components").StyledComponent<"div", any, {
|
|
10
|
-
left: number;
|
|
10
|
+
$left: number;
|
|
11
11
|
}, never>;
|
|
12
12
|
export declare const TabBarFrame: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -23,8 +23,8 @@ export const TabBarContent = styled(TabsListContentBase).withConfig({
|
|
|
23
23
|
displayName: "TabBarContent",
|
|
24
24
|
componentId: "sc-1sonok9-3"
|
|
25
25
|
})(["left:", "px;gap:4px;"], ({
|
|
26
|
-
left
|
|
27
|
-
}) => left);
|
|
26
|
+
$left
|
|
27
|
+
}) => $left);
|
|
28
28
|
export const TabBarFrame = styled.div.withConfig({
|
|
29
29
|
displayName: "TabBarFrame",
|
|
30
30
|
componentId: "sc-1sonok9-4"
|
package/Toast/Toast.js
CHANGED
|
@@ -59,8 +59,8 @@ export function Toast(props) {
|
|
|
59
59
|
onButtonClick
|
|
60
60
|
} = toast;
|
|
61
61
|
return createPortal(_jsxs(RootBox, {
|
|
62
|
-
open: open,
|
|
63
|
-
type: type,
|
|
62
|
+
"$open": open,
|
|
63
|
+
"$type": type,
|
|
64
64
|
"$hasButton": !!(buttonText && onButtonClick),
|
|
65
65
|
children: [_jsx(IconBox, {
|
|
66
66
|
children: getIconByType(type)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { Toast } from '../Toast';
|
|
4
|
+
describe('Toast', () => {
|
|
5
|
+
it('slides in when open and keeps `open`/`type` off the DOM', () => {
|
|
6
|
+
render(_jsx(Toast, {
|
|
7
|
+
open: true,
|
|
8
|
+
toast: {
|
|
9
|
+
title: 'Saved',
|
|
10
|
+
type: 'success',
|
|
11
|
+
duration: false
|
|
12
|
+
},
|
|
13
|
+
onClose: jest.fn()
|
|
14
|
+
}));
|
|
15
|
+
const root = screen.getByText('Saved').closest('div[class]')?.parentElement;
|
|
16
|
+
expect(root).not.toHaveAttribute('open');
|
|
17
|
+
expect(root).not.toHaveAttribute('type');
|
|
18
|
+
expect(getComputedStyle(root).top).toBe('50px');
|
|
19
|
+
});
|
|
20
|
+
});
|
package/Toast/styles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToastType } from './types';
|
|
2
2
|
export declare const RootBox: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
open: boolean;
|
|
4
|
-
type: ToastType;
|
|
3
|
+
$open: boolean;
|
|
4
|
+
$type: ToastType;
|
|
5
5
|
$hasButton?: boolean;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const IconBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/Toast/styles.js
CHANGED
|
@@ -7,10 +7,10 @@ export const RootBox = styled.div.withConfig({
|
|
|
7
7
|
})(["position:fixed;display:grid;grid-template-columns:", ";align-items:center;width:380px;top:", ";left:50%;transform:translateX(-50%);color:", ";padding:16px 0 16px;border-radius:", ";border:1px solid ", ";background:", ";box-shadow:", ";transition:top 250ms;z-index:999999999;"], ({
|
|
8
8
|
$hasButton
|
|
9
9
|
}) => $hasButton ? '56px 1fr auto auto' : '56px 1fr auto', ({
|
|
10
|
-
open
|
|
11
|
-
}) => open ? '50px' : '-250px', Color.MAIN, ShapeRadius.DIALOG, ({
|
|
12
|
-
type
|
|
13
|
-
}) => TypeColorMap[type], Color.CLEAR, Shadow.LARGE);
|
|
10
|
+
$open
|
|
11
|
+
}) => $open ? '50px' : '-250px', Color.MAIN, ShapeRadius.DIALOG, ({
|
|
12
|
+
$type
|
|
13
|
+
}) => TypeColorMap[$type], Color.CLEAR, Shadow.LARGE);
|
|
14
14
|
export const IconBox = styled.div.withConfig({
|
|
15
15
|
displayName: "IconBox",
|
|
16
16
|
componentId: "sc-8jll5u-1"
|
package/Tooltip/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type TooltipProps = {
|
|
|
24
24
|
/** Controlled visibility; omit for hover/focus behavior. */
|
|
25
25
|
readonly isVisible?: boolean;
|
|
26
26
|
/** External anchor ref to attach to instead of wrapping `children`. */
|
|
27
|
-
readonly reference?: RefObject<Element>;
|
|
27
|
+
readonly reference?: RefObject<Element | null>;
|
|
28
28
|
/** The anchor element the tooltip wraps. */
|
|
29
29
|
readonly children?: ReactElement<unknown>;
|
|
30
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@pushwoosh/kit-constants": "^2.1.0",
|
|
44
44
|
"@pushwoosh/kit-helpers": "^4.12.7",
|
|
45
45
|
"@pushwoosh/kit-icons": "^2.3.3",
|
|
46
|
-
"@pushwoosh/kit-typography": "^1.8.
|
|
46
|
+
"@pushwoosh/kit-typography": "^1.8.6",
|
|
47
47
|
"@tippyjs/react": "^4.2.6",
|
|
48
48
|
"@uiw/codemirror-themes": "^4.23.8",
|
|
49
49
|
"@uiw/react-codemirror": "^4.23.8",
|