@pushwoosh/dumb-components 0.0.19 → 1.0.1
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/ActionsGroup/ActionsGroup.d.ts +3 -0
- package/ActionsGroup/ActionsGroup.js +18 -0
- package/ActionsGroup/ActionsGroupItem.d.ts +3 -0
- package/ActionsGroup/ActionsGroupItem.js +12 -0
- package/ActionsGroup/index.d.ts +3 -0
- package/ActionsGroup/index.js +2 -0
- package/ActionsGroup/styles.d.ts +7 -0
- package/ActionsGroup/styles.js +22 -0
- package/ActionsGroup/types.d.ts +12 -0
- package/Badge/Badge.d.ts +3 -0
- package/Badge/Badge.js +16 -0
- package/Badge/index.d.ts +2 -0
- package/Badge/index.js +1 -0
- package/Badge/maps.d.ts +19 -0
- package/Badge/maps.js +19 -0
- package/Badge/styles.d.ts +5 -0
- package/Badge/styles.js +14 -0
- package/Badge/types.d.ts +8 -0
- package/Banner/Banner.d.ts +3 -0
- package/Banner/Banner.js +82 -0
- package/Banner/colors.d.ts +12 -0
- package/Banner/colors.js +115 -0
- package/Banner/index.d.ts +2 -0
- package/Banner/index.js +1 -0
- package/Banner/maps.d.ts +27 -0
- package/Banner/maps.js +19 -0
- package/Banner/styles.d.ts +29 -0
- package/Banner/styles.js +45 -0
- package/Banner/types.d.ts +20 -0
- package/Button/Button.d.ts +5 -0
- package/Button/Button.js +48 -0
- package/Button/GhostButton.d.ts +1 -0
- package/Button/GhostButton.js +5 -0
- package/Button/colors.d.ts +16 -0
- package/Button/colors.js +130 -0
- package/Button/index.d.ts +3 -0
- package/Button/index.js +2 -0
- package/Button/maps.d.ts +132 -0
- package/Button/maps.js +37 -0
- package/Button/styles.d.ts +120 -0
- package/Button/styles.js +103 -0
- package/Button/types.d.ts +26 -0
- package/CardMetric/CardChildren.d.ts +3 -0
- package/CardMetric/CardChildren.js +25 -0
- package/CardMetric/CardCollapse.d.ts +3 -0
- package/CardMetric/CardCollapse.js +13 -0
- package/CardMetric/CardMetric.d.ts +3 -0
- package/CardMetric/CardMetric.js +62 -0
- package/CardMetric/index.d.ts +2 -0
- package/CardMetric/index.js +1 -0
- package/CardMetric/styles.d.ts +13 -0
- package/CardMetric/styles.js +74 -0
- package/CardMetric/types.d.ts +34 -0
- package/Checkbox/Checkbox.d.ts +3 -0
- package/Checkbox/Checkbox.js +47 -0
- package/Checkbox/index.d.ts +2 -0
- package/Checkbox/index.js +1 -0
- package/Checkbox/maps.d.ts +3 -0
- package/Checkbox/maps.js +7 -0
- package/Checkbox/styles.d.ts +9 -0
- package/Checkbox/styles.js +17 -0
- package/Checkbox/types.d.ts +15 -0
- package/Drawer/Drawer.d.ts +3 -0
- package/Drawer/Drawer.js +62 -0
- package/Drawer/index.d.ts +1 -0
- package/Drawer/index.js +1 -0
- package/Drawer/maps.d.ts +6 -0
- package/Drawer/maps.js +6 -0
- package/Drawer/styles.d.ts +11 -0
- package/Drawer/styles.js +57 -0
- package/Drawer/types.d.ts +18 -0
- package/EditableField/EditableField.d.ts +3 -0
- package/EditableField/EditableField.js +61 -0
- package/EditableField/index.d.ts +2 -0
- package/EditableField/index.js +1 -0
- package/EditableField/styles.d.ts +8 -0
- package/EditableField/styles.js +25 -0
- package/EditableField/types.d.ts +15 -0
- package/EmailTemplatePreview/EmailTemplatePreview.d.ts +3 -11
- package/EmailTemplatePreview/EmailTemplatePreview.js +11 -10
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.d.ts +2 -2
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +3 -3
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/assets/PW_logo.svg +1 -5
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.js → styles.js} +2 -2
- package/EmailTemplatePreview/{styled.js → styles.js} +1 -1
- package/EmailTemplatePreview/types.d.ts +8 -0
- package/ExportResult/ExportResult.d.ts +2 -2
- package/ExportResult/ExportResult.js +10 -9
- package/ExportResult/{styled.js → styles.js} +5 -5
- package/FieldBox/FieldBox.d.ts +3 -3
- package/FieldBox/FieldBox.js +8 -7
- package/FieldBox/index.d.ts +1 -1
- package/FieldBox/types.js +1 -0
- package/NumberPicker/NumberPicker.js +2 -2
- package/NumberPicker/{AutosizeInput.d.ts → components/AutosizeInput/AutosizeInput.d.ts} +1 -1
- package/NumberPicker/{AutosizeInput.js → components/AutosizeInput/AutosizeInput.js} +3 -3
- package/NumberPicker/components/AutosizeInput/index.d.ts +1 -0
- package/NumberPicker/components/AutosizeInput/index.js +1 -0
- package/NumberPicker/{AutosizeInput.styled.js → components/AutosizeInput/styles.js} +1 -1
- package/NumberPicker/components/AutosizeInput/types.js +1 -0
- package/NumberPicker/{styled.js → styles.js} +3 -3
- package/Popover/Popover.d.ts +3 -0
- package/Popover/Popover.js +44 -0
- package/Popover/index.d.ts +4 -0
- package/Popover/index.js +2 -0
- package/Popover/styles.d.ts +6 -0
- package/Popover/styles.js +19 -0
- package/Popover/types.d.ts +12 -0
- package/Popover/types.js +1 -0
- package/ProgressBar/ProgressBar.d.ts +2 -2
- package/ProgressBar/ProgressBar.js +19 -16
- package/ProgressBar/{styled.js → styles.js} +10 -10
- package/PushPreview/PushPreview.js +3 -3
- package/PushPreview/{styled.js → styles.js} +8 -8
- package/Radio/Radio.d.ts +3 -0
- package/Radio/Radio.js +37 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.js +1 -0
- package/Radio/maps.d.ts +3 -0
- package/Radio/maps.js +8 -0
- package/Radio/styled.d.ts +5 -0
- package/Radio/styled.js +13 -0
- package/Radio/types.d.ts +12 -0
- package/Radio/types.js +1 -0
- package/Spinner/Spinner.d.ts +3 -0
- package/Spinner/Spinner.js +20 -0
- package/Spinner/assets/index.d.ts +4 -0
- package/Spinner/assets/index.js +6 -0
- package/Spinner/assets/spinner.medium.svg +1 -0
- package/Spinner/assets/spinner.small.svg +1 -0
- package/Spinner/index.d.ts +2 -0
- package/Spinner/index.js +1 -0
- package/Spinner/maps.d.ts +5 -0
- package/Spinner/maps.js +5 -0
- package/Spinner/styles.d.ts +5 -0
- package/Spinner/styles.js +20 -0
- package/Spinner/types.d.ts +6 -0
- package/Spinner/types.js +1 -0
- package/StatisticCard/StatisticCard.d.ts +2 -2
- package/StatisticCard/StatisticCard.js +15 -14
- package/Tabs/{tab/tab.d.ts → components/Tab/Tab.d.ts} +2 -2
- package/Tabs/{tab/tab.js → components/Tab/Tab.js} +2 -2
- package/Tabs/components/Tab/index.d.ts +1 -0
- package/Tabs/components/Tab/index.js +1 -0
- package/Tabs/{tab/tab.types.d.ts → components/Tab/types.d.ts} +1 -1
- package/Tabs/components/Tab/types.js +1 -0
- package/Tabs/{tab-bar/tab-bar.js → components/TabBar/TabBar.js} +2 -2
- package/Tabs/components/TabBar/index.d.ts +1 -0
- package/Tabs/components/TabBar/index.js +1 -0
- package/Tabs/{tab-bar/tab-bar.styles.js → components/TabBar/styles.js} +2 -2
- package/Tabs/components/TabBar/types.js +1 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.d.ts → components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts} +1 -1
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.js → components/TabBarScrollableFrame/TabBarScrollableFrame.js} +2 -2
- package/Tabs/components/TabBarScrollableFrame/index.d.ts +1 -0
- package/Tabs/components/TabBarScrollableFrame/index.js +1 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.js → components/TabBarScrollableFrame/styles.js} +5 -5
- package/Tabs/components/TabBarScrollableFrame/types.js +1 -0
- package/Tabs/{tab-base/tab-base.js → components/TabBase/TabBase.js} +1 -1
- package/Tabs/components/TabBase/index.d.ts +1 -0
- package/Tabs/components/TabBase/index.js +1 -0
- package/Tabs/{tab-base/tab-base.styles.js → components/TabBase/styles.js} +4 -4
- package/Tabs/components/TabBase/types.js +1 -0
- package/Tabs/{tab-panel/tab-panel.d.ts → components/TabPanel/TabPanel.d.ts} +1 -1
- package/Tabs/{tab-panel/tab-panel.js → components/TabPanel/TabPanel.js} +1 -1
- package/Tabs/components/TabPanel/index.d.ts +1 -0
- package/Tabs/components/TabPanel/index.js +1 -0
- package/Tabs/{tab-panel → components/TabPanel}/styles.js +1 -1
- package/Tabs/{tab-panel/tab-panel.types.d.ts → components/TabPanel/types.d.ts} +1 -1
- package/Tabs/components/TabPanel/types.js +1 -0
- package/Tabs/{tabs/tabs.d.ts → components/Tabs/Tabs.d.ts} +1 -1
- package/Tabs/{tabs/tabs.js → components/Tabs/Tabs.js} +1 -1
- package/Tabs/components/Tabs/index.d.ts +1 -0
- package/Tabs/components/Tabs/index.js +1 -0
- package/Tabs/{tabs → components/Tabs}/styles.js +1 -1
- package/Tabs/{tabs/tabs.types.d.ts → components/Tabs/types.d.ts} +1 -1
- package/Tabs/components/Tabs/types.js +1 -0
- package/Tabs/{tabs.context.d.ts → context.d.ts} +1 -1
- package/Tabs/index.d.ts +5 -5
- package/Tabs/index.js +4 -5
- package/Tabs/types.js +1 -0
- package/Tooltip/Tooltip.d.ts +3 -0
- package/Tooltip/Tooltip.js +47 -0
- package/Tooltip/index.d.ts +2 -0
- package/Tooltip/index.js +1 -0
- package/Tooltip/maps.d.ts +48 -0
- package/Tooltip/maps.js +161 -0
- package/Tooltip/styles.d.ts +5 -0
- package/Tooltip/styles.js +22 -0
- package/Tooltip/types.d.ts +14 -0
- package/Tooltip/types.js +1 -0
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +2 -0
- package/hooks/useElementWidth.d.ts +11 -0
- package/hooks/useElementWidth.js +27 -0
- package/hooks/useOnClickOutside.d.ts +4 -0
- package/hooks/useOnClickOutside.js +23 -0
- package/index.d.ts +14 -3
- package/index.js +12 -1
- package/package.json +7 -4
- package/Tabs/tab/index.d.ts +0 -2
- package/Tabs/tab/index.js +0 -2
- package/Tabs/tab-bar/index.d.ts +0 -2
- package/Tabs/tab-bar/index.js +0 -2
- package/Tabs/tab-base/index.d.ts +0 -3
- package/Tabs/tab-base/index.js +0 -3
- package/Tabs/tab-panel/index.d.ts +0 -2
- package/Tabs/tab-panel/index.js +0 -2
- package/Tabs/tabs/index.d.ts +0 -2
- package/Tabs/tabs/index.js +0 -2
- package/Tabs/tabs-list-slide-frame/index.d.ts +0 -3
- package/Tabs/tabs-list-slide-frame/index.js +0 -3
- package/{FieldBox/FieldBox.types.js → ActionsGroup/types.js} +0 -0
- package/{NumberPicker/AutosizeInput.types.js → Badge/types.js} +0 -0
- package/{Tabs/tab-bar/tab-bar.types.js → Banner/types.js} +0 -0
- package/{Tabs/tab-base/tab-base.types.js → Button/types.js} +0 -0
- package/{Tabs/tab-panel/tab-panel.types.js → CardMetric/types.js} +0 -0
- package/{Tabs/tab/tab.types.js → Checkbox/types.js} +0 -0
- package/{Tabs/tabs-list-slide-frame/tabs-list-slide-frame.types.js → Drawer/types.js} +0 -0
- package/{Tabs/tabs.types.js → EditableField/types.js} +0 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
- package/EmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
- package/{Tabs/tabs/tabs.types.js → EmailTemplatePreview/types.js} +0 -0
- package/ExportResult/{styled.d.ts → styles.d.ts} +0 -0
- package/FieldBox/{FieldBox.types.d.ts → types.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.constants.d.ts → components/AutosizeInput/constants.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.constants.js → components/AutosizeInput/constants.js} +0 -0
- package/NumberPicker/{AutosizeInput.styled.d.ts → components/AutosizeInput/styles.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.types.d.ts → components/AutosizeInput/types.d.ts} +0 -0
- package/NumberPicker/{styled.d.ts → styles.d.ts} +0 -0
- package/ProgressBar/{styled.d.ts → styles.d.ts} +0 -0
- package/PushPreview/{constants/urls.d.ts → constants.d.ts} +0 -0
- package/PushPreview/{constants/urls.js → constants.js} +0 -0
- package/PushPreview/{helpers/helpers.d.ts → helpers.d.ts} +0 -0
- package/PushPreview/{helpers/helpers.js → helpers.js} +0 -0
- package/PushPreview/{styled.d.ts → styles.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.d.ts → components/TabBar/TabBar.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.styles.d.ts → components/TabBar/styles.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.types.d.ts → components/TabBar/types.d.ts} +0 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.d.ts → components/TabBarScrollableFrame/styles.d.ts} +0 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.types.d.ts → components/TabBarScrollableFrame/types.d.ts} +0 -0
- package/Tabs/{tab-base/tab-base.d.ts → components/TabBase/TabBase.d.ts} +1 -1
- package/Tabs/{tab-base/tab-base.styles.d.ts → components/TabBase/styles.d.ts} +0 -0
- package/Tabs/{tab-base/tab-base.types.d.ts → components/TabBase/types.d.ts} +1 -1
- /package/Tabs/{tab-panel → components/TabPanel}/styles.d.ts +0 -0
- /package/Tabs/{tabs → components/Tabs}/styles.d.ts +0 -0
- /package/Tabs/{tabs.context.js → context.js} +0 -0
- /package/Tabs/{tabs.helpers.d.ts → helpers.d.ts} +0 -0
- /package/Tabs/{tabs.helpers.js → helpers.js} +0 -0
- /package/Tabs/{tabs.types.d.ts → types.d.ts} +0 -0
package/Radio/Radio.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { NativeLabel, NativeRadio } from './styled';
|
|
3
|
+
// eslint-disable-next-line prefer-const
|
|
4
|
+
let counter = 0;
|
|
5
|
+
export function Radio(props) {
|
|
6
|
+
const {
|
|
7
|
+
label,
|
|
8
|
+
id,
|
|
9
|
+
name,
|
|
10
|
+
value,
|
|
11
|
+
color,
|
|
12
|
+
isChecked,
|
|
13
|
+
isDisabled,
|
|
14
|
+
onChange,
|
|
15
|
+
onBlur
|
|
16
|
+
} = props;
|
|
17
|
+
const [localId] = useState(() => {
|
|
18
|
+
if (id) {
|
|
19
|
+
return id;
|
|
20
|
+
}
|
|
21
|
+
const newCounter = counter + 1;
|
|
22
|
+
return `radio-id-${newCounter}`;
|
|
23
|
+
});
|
|
24
|
+
return React.createElement(NativeLabel, {
|
|
25
|
+
htmlFor: localId,
|
|
26
|
+
"$color": isDisabled ? 'locked' : color
|
|
27
|
+
}, React.createElement(NativeRadio, {
|
|
28
|
+
type: "radio",
|
|
29
|
+
id: localId,
|
|
30
|
+
value: value,
|
|
31
|
+
name: name,
|
|
32
|
+
checked: isChecked,
|
|
33
|
+
disabled: isDisabled,
|
|
34
|
+
onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
|
|
35
|
+
onBlur: onBlur
|
|
36
|
+
}), label && React.createElement("span", null, label));
|
|
37
|
+
}
|
package/Radio/index.d.ts
ADDED
package/Radio/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio } from './Radio';
|
package/Radio/maps.d.ts
ADDED
package/Radio/maps.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RadioTextColor } from './types';
|
|
2
|
+
export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
3
|
+
export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
|
|
4
|
+
$color?: RadioTextColor;
|
|
5
|
+
}, never>;
|
package/Radio/styled.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing, FontSize, LineHeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { ColorMap } from './maps';
|
|
4
|
+
export const NativeRadio = styled.input.withConfig({
|
|
5
|
+
displayName: "NativeRadio",
|
|
6
|
+
componentId: "sc-154q01x-0"
|
|
7
|
+
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:20px;height:20px;border:2px solid ", ";border-radius:50%;background-color:", ";transition:border 0.1s,background-color 0.1s;cursor:pointer;&:focus{outline:none;}&[type=radio]:hover{border-color:", ";}&[type=radio]:disabled{cursor:not-allowed;border-color:", ";background-color:", ";}&[type=radio]:checked{border:6px solid ", ";}&[type=radio]:checked:hover{border-color:", ";}&[type=radio]:checked:disabled{border-color:", ";background-color:", ";}"], Color.PHANTOM, Color.CLEAR, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN, Color.PRIMARY, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN);
|
|
8
|
+
export const NativeLabel = styled.label.withConfig({
|
|
9
|
+
displayName: "NativeLabel",
|
|
10
|
+
componentId: "sc-154q01x-1"
|
|
11
|
+
})(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"], FontSize.REGULAR, LineHeight.REGULAR, ({
|
|
12
|
+
$color
|
|
13
|
+
}) => $color && `color: ${ColorMap[$color]};`, NativeRadio, Spacing.S3);
|
package/Radio/types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RadioTextColor = 'main' | 'primary' | 'danger' | 'current' | 'locked';
|
|
2
|
+
export type RadioProps = {
|
|
3
|
+
label?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
color?: RadioTextColor;
|
|
8
|
+
isChecked?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
onChange?: (checked: string | number) => void;
|
|
11
|
+
onBlur?: () => void;
|
|
12
|
+
};
|
package/Radio/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AssetsMap } from './assets';
|
|
3
|
+
import { SpinnerBox, SpinnerAnimate } from './styles';
|
|
4
|
+
export function Spinner(props) {
|
|
5
|
+
const {
|
|
6
|
+
boxRef,
|
|
7
|
+
size,
|
|
8
|
+
...rest
|
|
9
|
+
} = props;
|
|
10
|
+
const Icon = AssetsMap[size];
|
|
11
|
+
if (!Icon) {
|
|
12
|
+
console.error(`[Spinner]: incorrect size: ${size}!`);
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return React.createElement(SpinnerBox, {
|
|
16
|
+
...rest,
|
|
17
|
+
size: size,
|
|
18
|
+
ref: boxRef
|
|
19
|
+
}, React.createElement(SpinnerAnimate, null, React.createElement(Icon, null)));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><circle cx="12" cy="12" r="7" stroke="#00A2FF" stroke-width="3" opacity=".2"/><path stroke="#00A2FF" stroke-linecap="round" stroke-width="3" d="M19 12a7 7 0 0 0-7-7"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><circle cx="8" cy="8" r="5" stroke="#00A2FF" stroke-width="2" opacity=".2"/><path stroke="#00A2FF" stroke-linecap="round" stroke-width="2" d="M13 8a5 5 0 0 0-5-5"/></svg>
|
package/Spinner/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spinner } from './Spinner';
|
package/Spinner/maps.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SpinnerProps } from './types';
|
|
2
|
+
export declare const SpinnerBox: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
size: SpinnerProps["size"];
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const SpinnerAnimate: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled, { keyframes } from 'styled-components';
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { SizeInPxBySpinnerSizeMap } from './maps';
|
|
4
|
+
const rotate = keyframes(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]);
|
|
5
|
+
export const SpinnerBox = styled.div.withConfig({
|
|
6
|
+
displayName: "SpinnerBox",
|
|
7
|
+
componentId: "sc-y39y31-0"
|
|
8
|
+
})(["width:", ";height:", ";color:", ";line-height:0;user-select:none;"], ({
|
|
9
|
+
size
|
|
10
|
+
}) => SizeInPxBySpinnerSizeMap[size], ({
|
|
11
|
+
size
|
|
12
|
+
}) => SizeInPxBySpinnerSizeMap[size], ({
|
|
13
|
+
color
|
|
14
|
+
}) => color || Color.CURRENT);
|
|
15
|
+
export const SpinnerAnimate = styled.div.withConfig({
|
|
16
|
+
displayName: "SpinnerAnimate",
|
|
17
|
+
componentId: "sc-y39y31-1"
|
|
18
|
+
})(["line-height:0;animation:", " 0.5s linear infinite;"], rotate);
|
|
19
|
+
SpinnerBox.displayName = 'SpinnerBox';
|
|
20
|
+
SpinnerAnimate.displayName = 'SpinnerAnimate';
|
package/Spinner/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import { type StatisticCardProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function StatisticCard(props: StatisticCardProps): ReactElement;
|
|
@@ -5,19 +5,20 @@ import { Spinner } from '@pushwoosh/kit-spinner';
|
|
|
5
5
|
import { Container, RightSlotContainer, StatValue, Title } from './styles';
|
|
6
6
|
import { LockedText } from '../common';
|
|
7
7
|
import { formatNumberWithSpaces } from './helpers';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
export function StatisticCard(props) {
|
|
9
|
+
const {
|
|
10
|
+
title,
|
|
11
|
+
value,
|
|
12
|
+
valueSubtext,
|
|
13
|
+
footer,
|
|
14
|
+
active,
|
|
15
|
+
selectable,
|
|
16
|
+
rightSlot,
|
|
17
|
+
width,
|
|
18
|
+
isLoading,
|
|
19
|
+
onClick,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
21
22
|
const statisticValue = useMemo(() => {
|
|
22
23
|
if (isLoading) {
|
|
23
24
|
return React.createElement(Spinner, {
|
|
@@ -45,4 +46,4 @@ export const StatisticCard = ({
|
|
|
45
46
|
}, rightSlot), statisticValue, footer && React.createElement(LockedText, {
|
|
46
47
|
"$small": true
|
|
47
48
|
}, footer));
|
|
48
|
-
}
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const Tab: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "onClick"> & Readonly<{
|
|
3
|
-
code: import("
|
|
4
|
-
onActivate?: (code: import("
|
|
3
|
+
code: import("../..").TabCode;
|
|
4
|
+
onActivate?: (code: import("../..").TabCode) => void;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
6
|
isNew?: boolean;
|
|
7
7
|
icon?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { TabBase } from '../
|
|
3
|
-
import { useTabsContext } from '
|
|
2
|
+
import { TabBase } from '../TabBase';
|
|
3
|
+
import { useTabsContext } from '../../context';
|
|
4
4
|
export const Tab = forwardRef((props, ref) => {
|
|
5
5
|
const {
|
|
6
6
|
code,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tab } from './Tab';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tab } from './Tab';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { TabCode } from '
|
|
2
|
+
import type { TabCode } from '../../types';
|
|
3
3
|
export type TabProps = Omit<JSX.IntrinsicElements['div'], 'ref' | 'onClick'> & Readonly<{
|
|
4
4
|
code: TabCode;
|
|
5
5
|
onActivate?: (code: TabCode) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { H4 } from '@pushwoosh/kit-typography';
|
|
3
|
-
import { TabBarTitleBox, TabBarContainer } from './
|
|
4
|
-
import { TabBarScrollableFrame } from '../
|
|
3
|
+
import { TabBarTitleBox, TabBarContainer } from './styles';
|
|
4
|
+
import { TabBarScrollableFrame } from '../TabBarScrollableFrame';
|
|
5
5
|
export const TabBar = forwardRef((props, ref) => {
|
|
6
6
|
const {
|
|
7
7
|
children,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar } from './TabBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar } from './TabBar';
|
|
@@ -2,11 +2,11 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Color, Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-pu8yhh-0"
|
|
6
6
|
})(["position:relative;display:grid;grid-template-columns:", ";width:100%;height:40px;background:", ";border-radius:8px;padding:", ";overflow:hidden;"], ({
|
|
7
7
|
hasTitle
|
|
8
8
|
}) => hasTitle ? 'max-content 1fr' : '1fr', Color.SOFT_LIGHT, Spacing.S1);
|
|
9
9
|
export const TabBarTitleBox = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarTitleBox",
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-pu8yhh-1"
|
|
12
12
|
})(["display:flex;align-items:center;position:relative;padding:0 ", " 0 ", ";"], Spacing.S4, Spacing.S5);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { TabsListSlideFrameProps } from './types';
|
|
3
3
|
export declare const TabBarScrollableFrame: React.ForwardRefExoticComponent<TabsListSlideFrameProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debounce from 'lodash/debounce';
|
|
2
2
|
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
4
|
-
import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './
|
|
5
|
-
import { widthObserver } from '
|
|
4
|
+
import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './styles';
|
|
5
|
+
import { widthObserver } from '../../helpers';
|
|
6
6
|
export const TabBarScrollableFrame = forwardRef(({
|
|
7
7
|
children,
|
|
8
8
|
...props
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBarScrollableFrame } from './TabBarScrollableFrame';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBarScrollableFrame } from './TabBarScrollableFrame';
|
|
@@ -2,25 +2,25 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Color, Shadow, ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarArrowContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarArrowContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1sonok9-0"
|
|
6
6
|
})(["position:absolute;top:0;", ":0;display:flex;align-items:center;height:32px;cursor:pointer;color:", ";background-color:", ";box-shadow:", ";border-radius:", ";padding:", " ", ";&:hover{color:", ";}"], ({
|
|
7
7
|
$right
|
|
8
8
|
}) => $right ? 'right' : 'left', Color.MAIN, Color.CLEAR, Shadow.SMALL, ShapeRadius.CONTROL, Spacing.S3, Spacing.S1, Color.PRIMARY_HOVER);
|
|
9
9
|
export const TabBarWindow = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarWindow",
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-1sonok9-1"
|
|
12
12
|
})(["position:relative;height:32px;width:100%;"]);
|
|
13
13
|
export const TabsListContentBase = styled.div.withConfig({
|
|
14
14
|
displayName: "TabsListContentBase",
|
|
15
|
-
componentId: "sc-
|
|
15
|
+
componentId: "sc-1sonok9-2"
|
|
16
16
|
})(["position:absolute;top:0;display:flex;align-items:center;transition:left .4s ease-in;"]);
|
|
17
17
|
export const TabBarContent = styled(TabsListContentBase).withConfig({
|
|
18
18
|
displayName: "TabBarContent",
|
|
19
|
-
componentId: "sc-
|
|
19
|
+
componentId: "sc-1sonok9-3"
|
|
20
20
|
})(["left:", "px;gap:", ";"], ({
|
|
21
21
|
left
|
|
22
22
|
}) => left, Spacing.S1);
|
|
23
23
|
export const TabBarFrame = styled.div.withConfig({
|
|
24
24
|
displayName: "TabBarFrame",
|
|
25
|
-
componentId: "sc-
|
|
25
|
+
componentId: "sc-1sonok9-4"
|
|
26
26
|
})(["position:relative;width:100%;"]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './
|
|
2
|
+
import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './styles';
|
|
3
3
|
export const TabBase = forwardRef((props, ref) => {
|
|
4
4
|
const {
|
|
5
5
|
isActive,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBase } from './TabBase';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBase } from './TabBase';
|
|
@@ -4,7 +4,7 @@ import { H4 } from '@pushwoosh/kit-typography';
|
|
|
4
4
|
const tabBodyHover = css(["&:hover{color:", ";background-color:", ";}"], Color.PRIMARY_HOVER, Color.BRIGHT_LIGHT);
|
|
5
5
|
export const TabBody = styled.div.withConfig({
|
|
6
6
|
displayName: "TabBody",
|
|
7
|
-
componentId: "sc-
|
|
7
|
+
componentId: "sc-133yrgu-0"
|
|
8
8
|
})(["display:flex;justify-content:center;align-items:center;position:relative;padding:", " ", " ", " ", ";background-color:", ";border-radius:", ";box-shadow:", ";cursor:", ";user-select:none;white-space:nowrap;color:", ";", ""], Spacing.S2, ({
|
|
9
9
|
$hasIcon
|
|
10
10
|
}) => $hasIcon ? Spacing.S4 : Spacing.S5, Spacing.S2, Spacing.S5, ({
|
|
@@ -27,15 +27,15 @@ export const TabBody = styled.div.withConfig({
|
|
|
27
27
|
}) => !$isActive && !$isDisabled && tabBodyHover);
|
|
28
28
|
export const TabRedDot = styled.div.withConfig({
|
|
29
29
|
displayName: "TabRedDot",
|
|
30
|
-
componentId: "sc-
|
|
30
|
+
componentId: "sc-133yrgu-1"
|
|
31
31
|
})(["width:4px;height:20px;position:relative;&::before{content:\"\";background-color:", ";position:absolute;top:0;left:0;width:4px;height:4px;border-radius:4px;}"], Color.DANGER);
|
|
32
32
|
export const TabButtonLabel = styled(H4).withConfig({
|
|
33
33
|
displayName: "TabButtonLabel",
|
|
34
|
-
componentId: "sc-
|
|
34
|
+
componentId: "sc-133yrgu-2"
|
|
35
35
|
})(["opacity:", ";"], ({
|
|
36
36
|
$isActive
|
|
37
37
|
}) => $isActive ? 1 : 0.8);
|
|
38
38
|
export const TabIconBox = styled.div.withConfig({
|
|
39
39
|
displayName: "TabIconBox",
|
|
40
|
-
componentId: "sc-
|
|
40
|
+
componentId: "sc-133yrgu-3"
|
|
41
41
|
})(["margin-left:", ";"], Spacing.S1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabPanel } from './TabPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabPanel } from './TabPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs } from './Tabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs } from './Tabs';
|
|
@@ -2,5 +2,5 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabsContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabsContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1pr0dun-0"
|
|
6
6
|
})(["display:flex;flex-direction:column;gap:", ";width:100%;height:100%;"], Spacing.S5);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Tabs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { Tab } from './components/Tab';
|
|
2
|
+
export { TabBar } from './components/TabBar';
|
|
3
|
+
export { TabPanel } from './components/TabPanel';
|
|
4
|
+
export { Tabs } from './components/Tabs';
|
|
5
|
+
export type { TabCode } from './types';
|
package/Tabs/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './tab-panel';
|
|
1
|
+
export { Tab } from './components/Tab';
|
|
2
|
+
export { TabBar } from './components/TabBar';
|
|
3
|
+
export { TabPanel } from './components/TabPanel';
|
|
4
|
+
export { Tabs } from './components/Tabs';
|
package/Tabs/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipPositionToArrowOffsetMap, TooltipPositionToTippyOffsetMap, TooltipPositionToTippyPlacementMap } from './maps';
|
|
3
|
+
import { TooltipBox } from './styles';
|
|
4
|
+
export function Tooltip(props) {
|
|
5
|
+
const {
|
|
6
|
+
position = 'top-start',
|
|
7
|
+
arrowOffset = TooltipPositionToArrowOffsetMap[position],
|
|
8
|
+
offset = TooltipPositionToTippyOffsetMap[position],
|
|
9
|
+
maxWidth = 240,
|
|
10
|
+
zIndex = 999999,
|
|
11
|
+
isDisabled,
|
|
12
|
+
isVisible,
|
|
13
|
+
...rest
|
|
14
|
+
} = props;
|
|
15
|
+
return React.createElement(TooltipBox, {
|
|
16
|
+
animation: false,
|
|
17
|
+
delay: 0,
|
|
18
|
+
duration: 0,
|
|
19
|
+
disabled: isDisabled,
|
|
20
|
+
maxWidth: maxWidth,
|
|
21
|
+
zIndex: zIndex,
|
|
22
|
+
placement: TooltipPositionToTippyPlacementMap[position],
|
|
23
|
+
visible: isVisible,
|
|
24
|
+
"$position": position,
|
|
25
|
+
"$arrowOffset": arrowOffset,
|
|
26
|
+
popperOptions: {
|
|
27
|
+
strategy: 'fixed',
|
|
28
|
+
modifiers: [{
|
|
29
|
+
name: 'offset',
|
|
30
|
+
options: {
|
|
31
|
+
offset
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
name: 'flip',
|
|
35
|
+
options: {
|
|
36
|
+
fallbackPlacements: []
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
name: 'preventOverflow',
|
|
40
|
+
options: {
|
|
41
|
+
mainAxis: false
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
44
|
+
},
|
|
45
|
+
...rest
|
|
46
|
+
});
|
|
47
|
+
}
|
package/Tooltip/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './Tooltip';
|