@pushwoosh/dumb-components 1.1.16 → 1.1.18
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/Badge/styles.js +2 -2
- package/Banner/styles.js +3 -3
- package/EmailTemplatePreview/helpers.js +2 -2
- package/Table/components/DataTable/DataTable.js +8 -8
- package/Tabs/components/TabBar/styles.js +4 -4
- package/Tabs/components/TabBarScrollableFrame/styles.js +6 -6
- package/Tooltip/styles.js +3 -3
- package/native/Input.js +2 -2
- package/native/Select.js +2 -2
- package/native/Textarea.js +3 -3
- package/package.json +1 -1
package/Badge/styles.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, FontSize, FontWeight, FontFamily, LineHeight, ShapeRadius
|
|
2
|
+
import { Color, FontSize, FontWeight, FontFamily, LineHeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { BadgeColorToColorMap, BadgeColorToLightColorMap } from './maps';
|
|
4
4
|
export const BadgeBox = styled.div.withConfig({
|
|
5
5
|
displayName: "BadgeBox",
|
|
6
6
|
componentId: "sc-6ptm8-0"
|
|
7
|
-
})(["display:inline-block;width:fit-content;padding:
|
|
7
|
+
})(["display:inline-block;width:fit-content;padding:2px 6px;border-radius:", ";color:", ";background-color:", ";font-size:", ";font-family:", ";font-weight:", ";line-height:", ";text-transform:uppercase;user-select:none;"], ShapeRadius.CONTROL, ({
|
|
8
8
|
$isSaturated,
|
|
9
9
|
$color
|
|
10
10
|
}) => $isSaturated ? Color.CLEAR : BadgeColorToColorMap[$color], ({
|
package/Banner/styles.js
CHANGED
|
@@ -9,7 +9,7 @@ export const BannerSpinner = styled.div.withConfig({
|
|
|
9
9
|
export const ActionButton = styled.button.withConfig({
|
|
10
10
|
displayName: "ActionButton",
|
|
11
11
|
componentId: "sc-9uu4ap-1"
|
|
12
|
-
})(["appearance:none !important;border:none;background:initial;cursor:pointer;padding:
|
|
12
|
+
})(["appearance:none !important;border:none;background:initial;cursor:pointer;padding:6px;position:relative;font-weight:", ";white-space:nowrap;height:fit-content;> span{visibility:", ";}opacity:", ";"], FontWeight.BOLD, ({
|
|
13
13
|
$isLoading
|
|
14
14
|
}) => $isLoading ? 'hidden' : 'visible', ({
|
|
15
15
|
$isPressed,
|
|
@@ -18,7 +18,7 @@ export const ActionButton = styled.button.withConfig({
|
|
|
18
18
|
export const CloseButton = styled.button.withConfig({
|
|
19
19
|
displayName: "CloseButton",
|
|
20
20
|
componentId: "sc-9uu4ap-2"
|
|
21
|
-
})(["appearance:none !important;border:none;background:initial;cursor:pointer;padding:0
|
|
21
|
+
})(["appearance:none !important;border:none;background:initial;cursor:pointer;padding:0 8px 0 0;height:fit-content;align-self:center;opacity:", ";"], props => props.$isPressed ? 0.5 : 1);
|
|
22
22
|
export const BannerBox = styled.div.withConfig({
|
|
23
23
|
displayName: "BannerBox",
|
|
24
24
|
componentId: "sc-9uu4ap-3"
|
|
@@ -42,4 +42,4 @@ export const BannerShape = styled(BannerBox).withConfig({
|
|
|
42
42
|
export const BannerGhost = styled(BannerBox).withConfig({
|
|
43
43
|
displayName: "BannerGhost",
|
|
44
44
|
componentId: "sc-9uu4ap-7"
|
|
45
|
-
})(["background:", ";", "{color:", ";background:", ";}", "{color:", ";background:", ";;border-radius:", ";&:hover{text-decoration:none;background:", ";border-radius:", ";}}", "{color:", ";> *{&:hover{text-decoration:none;background:", ";border-radius:
|
|
45
|
+
})(["background:", ";", "{color:", ";background:", ";}", "{color:", ";background:", ";;border-radius:", ";&:hover{text-decoration:none;background:", ";border-radius:", ";}}", "{color:", ";> *{&:hover{text-decoration:none;background:", ";border-radius:16px;}}}"], props => colors[props.$type].ghost.base.bgColor, IconContainer, props => colors[props.$type].ghost.iconArea.color, props => rgba(colors[props.$type].ghost.iconArea.bgColor, 0.14), ActionButton, props => colors[props.$type].ghost.iconArea.color, props => props.$isLoading ? colors[props.$type].ghost.base.bgColor : 'initial', props => props.$isLoading ? ShapeRadius.CONTROL : 'initial', props => colors[props.$type].ghost.hover.bgColor, ShapeRadius.CONTROL, CloseButton, props => colors[props.$type].ghost.iconArea.color, props => colors[props.$type].ghost.hover.bgColor);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function replaceLocalization(str, values) {
|
|
2
|
-
const re = /{{([
|
|
2
|
+
const re = /{{([^|{}]+)\|(text|html|color)\|([^}]*)?}}/g;
|
|
3
3
|
return str.replace(re, (_, key, _type, defaultValue) => {
|
|
4
4
|
return (key in values ? values[key] : defaultValue) || '';
|
|
5
5
|
});
|
|
6
6
|
}
|
|
7
7
|
export function replacePlaceholders(str, values) {
|
|
8
8
|
const allAvailableModifiers = ['CapitalizeFirst', 'CapitalizeAllFirst', 'UPPERCASE', 'lowercase', 'regular', 'cent', 'dollar', 'comma', 'euro', 'jpy', 'lira', 'M-d-y', 'm-d-y', 'M d y', 'M d Y', 'l', 'M d', 'H:i', 'm-d-y H:i'];
|
|
9
|
-
const re = new RegExp(`{([
|
|
9
|
+
const re = new RegExp(`{([^|{}]{1,64})\\|(${allAvailableModifiers.join('|')})(?:\\|([^}]*))?}`, 'g');
|
|
10
10
|
return str.replace(re, (_, key, _modifier, defaultValue) => {
|
|
11
11
|
return (key in values ? values[key] : defaultValue) || '';
|
|
12
12
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { WarningRoundIcon } from '@pushwoosh/kit-icons';
|
|
5
5
|
import { Text } from '@pushwoosh/kit-typography';
|
|
@@ -38,14 +38,14 @@ export function DataTable(props) {
|
|
|
38
38
|
allLimits: [10, 20, 50, 100],
|
|
39
39
|
padding: paginationPadding
|
|
40
40
|
}, data.loading && React.createElement(Horizontal, {
|
|
41
|
-
"$
|
|
42
|
-
"$
|
|
41
|
+
"$alignItems": "center",
|
|
42
|
+
"$gap": 4
|
|
43
43
|
}, React.createElement(Spinner, {
|
|
44
44
|
size: "medium",
|
|
45
45
|
color: Color.LOCKED
|
|
46
46
|
}), React.createElement(LockedText, null, "Loading...")), !data.loading && data.error && React.createElement(Horizontal, {
|
|
47
|
-
"$
|
|
48
|
-
"$
|
|
47
|
+
"$alignItems": "center",
|
|
48
|
+
"$gap": 4
|
|
49
49
|
}, React.createElement(WarningRoundIcon, {
|
|
50
50
|
size: "medium",
|
|
51
51
|
view: "lined",
|
|
@@ -54,14 +54,14 @@ export function DataTable(props) {
|
|
|
54
54
|
"$color": Color.WARNING
|
|
55
55
|
}, "Request is failed")), !data.loading && !data.error && (((_data$value2 = data.value) === null || _data$value2 === void 0 ? void 0 : _data$value2.total) ?? 0) > 0 && React.createElement(Horizontal, {
|
|
56
56
|
"$placeItems": "center",
|
|
57
|
-
"$gap":
|
|
57
|
+
"$gap": 4
|
|
58
58
|
}, "Result:", React.createElement(LockedText, null, `${(_data$value3 = data.value) === null || _data$value3 === void 0 ? void 0 : _data$value3.total} item${(((_data$value4 = data.value) === null || _data$value4 === void 0 ? void 0 : _data$value4.total) ?? 0) > 1 ? 's' : ''}`)), !data.loading && !data.error && (((_data$value5 = data.value) === null || _data$value5 === void 0 ? void 0 : _data$value5.total) ?? 0) === 0 && !isFiltered && React.createElement(Horizontal, {
|
|
59
59
|
"$placeItems": "center"
|
|
60
60
|
}, React.createElement(LockedText, null, "No items yet")), !data.loading && (((_data$value6 = data.value) === null || _data$value6 === void 0 || (_data$value6 = _data$value6.items) === null || _data$value6 === void 0 ? void 0 : _data$value6.length) ?? 0) === 0 && isFiltered && React.createElement(Horizontal, {
|
|
61
|
-
"$gap":
|
|
61
|
+
"$gap": 16
|
|
62
62
|
}, !data.error && React.createElement(Horizontal, {
|
|
63
63
|
"$placeItems": "center",
|
|
64
|
-
"$gap":
|
|
64
|
+
"$gap": 4
|
|
65
65
|
}, "Result:", React.createElement(LockedText, null, "No match found")), React.createElement(Button, {
|
|
66
66
|
color: "primary",
|
|
67
67
|
view: "ghost",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarContainer",
|
|
5
5
|
componentId: "sc-pu8yhh-0"
|
|
6
|
-
})(["position:relative;display:grid;grid-template-columns:", ";width:100%;height:40px;background:", ";border-radius:8px;padding:
|
|
6
|
+
})(["position:relative;display:grid;grid-template-columns:", ";width:100%;height:40px;background:", ";border-radius:8px;padding:4px;overflow:hidden;"], ({
|
|
7
7
|
hasTitle
|
|
8
|
-
}) => hasTitle ? 'max-content 1fr' : '1fr', Color.SOFT_LIGHT
|
|
8
|
+
}) => hasTitle ? 'max-content 1fr' : '1fr', Color.SOFT_LIGHT);
|
|
9
9
|
export const TabBarTitleBox = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarTitleBox",
|
|
11
11
|
componentId: "sc-pu8yhh-1"
|
|
12
|
-
})(["display:flex;align-items:center;position:relative;padding:0
|
|
12
|
+
})(["display:flex;align-items:center;position:relative;padding:0 12px 0 16px;"]);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, Shadow, ShapeRadius
|
|
2
|
+
import { Color, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarArrowContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarArrowContainer",
|
|
5
5
|
componentId: "sc-1sonok9-0"
|
|
6
|
-
})(["position:absolute;top:0;", ":0;display:flex;align-items:center;height:32px;cursor:pointer;color:", ";background-color:", ";box-shadow:", ";border-radius:", ";padding:
|
|
6
|
+
})(["position:absolute;top:0;", ":0;display:flex;align-items:center;height:32px;cursor:pointer;color:", ";background-color:", ";box-shadow:", ";border-radius:", ";padding:8px 4px;&:hover{color:", ";}"], ({
|
|
7
7
|
$right
|
|
8
|
-
}) => $right ? 'right' : 'left', Color.MAIN, Color.CLEAR, Shadow.SMALL, ShapeRadius.CONTROL,
|
|
8
|
+
}) => $right ? 'right' : 'left', Color.MAIN, Color.CLEAR, Shadow.SMALL, ShapeRadius.CONTROL, Color.PRIMARY_HOVER);
|
|
9
9
|
export const TabBarWindow = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarWindow",
|
|
11
11
|
componentId: "sc-1sonok9-1"
|
|
12
|
-
})(["position:relative;height:32px;
|
|
12
|
+
})(["position:relative;width:100%;height:32px;overflow:hidden;"]);
|
|
13
13
|
export const TabsListContentBase = styled.div.withConfig({
|
|
14
14
|
displayName: "TabsListContentBase",
|
|
15
15
|
componentId: "sc-1sonok9-2"
|
|
@@ -17,9 +17,9 @@ export const TabsListContentBase = styled.div.withConfig({
|
|
|
17
17
|
export const TabBarContent = styled(TabsListContentBase).withConfig({
|
|
18
18
|
displayName: "TabBarContent",
|
|
19
19
|
componentId: "sc-1sonok9-3"
|
|
20
|
-
})(["left:", "px;gap:
|
|
20
|
+
})(["left:", "px;gap:4px;"], ({
|
|
21
21
|
left
|
|
22
|
-
}) => left
|
|
22
|
+
}) => left);
|
|
23
23
|
export const TabBarFrame = styled.div.withConfig({
|
|
24
24
|
displayName: "TabBarFrame",
|
|
25
25
|
componentId: "sc-1sonok9-4"
|
package/Tooltip/styles.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Tippy from '@tippyjs/react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { Color, FontSize, ShapeRadius
|
|
3
|
+
import { Color, FontSize, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
4
|
import { getBottomPosition, getLeftPosition, getRightPosition, getTopPosition, getTransform } from './maps';
|
|
5
5
|
export const TooltipBox = styled(Tippy).withConfig({
|
|
6
6
|
displayName: "TooltipBox",
|
|
7
7
|
componentId: "sc-1hariht-0"
|
|
8
|
-
})(["&::after{content:\"\";position:absolute;top:", ";right:", ";bottom:", ";left:", ";width:10px;height:10px;margin:auto;border-radius:2px;background-color:", ";transform:", ";}&.tippy-box{position:static;display:block;padding:
|
|
8
|
+
})(["&::after{content:\"\";position:absolute;top:", ";right:", ";bottom:", ";left:", ";width:10px;height:10px;margin:auto;border-radius:2px;background-color:", ";transform:", ";}&.tippy-box{position:static;display:block;padding:12px;color:", ";background-color:", ";border-radius:", ";font-size:", ";line-height:inherit;outline:0;transition:none;}.tippy-content{position:static;padding:0;z-index:auto;}.tippy-arrow{display:none;}"], ({
|
|
9
9
|
$position,
|
|
10
10
|
$arrowOffset
|
|
11
11
|
}) => getTopPosition($position, $arrowOffset), ({
|
|
@@ -19,4 +19,4 @@ export const TooltipBox = styled(Tippy).withConfig({
|
|
|
19
19
|
$arrowOffset
|
|
20
20
|
}) => getLeftPosition($position, $arrowOffset), Color.MAIN, ({
|
|
21
21
|
$position
|
|
22
|
-
}) => getTransform($position),
|
|
22
|
+
}) => getTransform($position), Color.CLEAR, Color.MAIN, ShapeRadius.DIALOG, FontSize.REGULAR);
|
package/native/Input.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, FontSize, LineHeight,
|
|
2
|
+
import { Color, FontSize, LineHeight, ShapeRadius, UnitSize } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const NativeInput = styled.input.withConfig({
|
|
4
4
|
displayName: "NativeInput",
|
|
5
5
|
componentId: "sc-oqkcxd-0"
|
|
6
|
-
})(["height:", ";padding:0 calc(
|
|
6
|
+
})(["height:", ";padding:0 calc(12px - 1px);border:1px solid ", ";border-radius:", ";font-size:", ";line-height:", ";background-color:", ";&:focus{outline:none;border-color:", ";}&:disabled{background-color:", ";}&::placeholder{color:", ";}"], UnitSize.FIELD_HEIGHT, ({
|
|
7
7
|
$isErrored
|
|
8
8
|
}) => $isErrored ? Color.DANGER : Color.FORM, ShapeRadius.CONTROL, FontSize.REGULAR, LineHeight.REGULAR, Color.CLEAR, Color.BRIGHT, Color.FROZEN, Color.PHANTOM);
|
package/native/Select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, FontSize, ShapeRadius,
|
|
2
|
+
import { Color, FontSize, ShapeRadius, UnitSize } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const NativeSelect = styled.select.withConfig({
|
|
4
4
|
displayName: "NativeSelect",
|
|
5
5
|
componentId: "sc-1fsh619-0"
|
|
6
|
-
})(["height:", ";padding:0
|
|
6
|
+
})(["height:", ";padding:0 24px 0 12px;border:1px solid ", ";border-radius:", ";font-size:", ";color:", ";background-color:", ";background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 16px) calc(1em + 1px),calc(100% - 11px) calc(1em + 1px);background-size:5px 5px;background-repeat:no-repeat;appearance:none;&:hover{border-color:", ";}&:focus{outline:none;border:1px solid ", ";}&:read-only{border:1px solid ", ";}&:disabled{background-color:", ";cursor:not-allowed;}&:read-only{border:1px solid ", ";}&:read-only:hover{border-color:", ";}&::placeholder{color:", ";}"], UnitSize.FIELD_HEIGHT, Color.FORM, ShapeRadius.CONTROL, FontSize.REGULAR, Color.MAIN, Color.CLEAR, Color.PHANTOM, Color.BRIGHT, Color.FORM, Color.FROZEN, ({
|
|
7
7
|
$isErrored
|
|
8
8
|
}) => $isErrored ? Color.DANGER : Color.FORM, ({
|
|
9
9
|
$isErrored
|
package/native/Textarea.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color, FontSize, LineHeight,
|
|
2
|
+
import { Color, FontSize, LineHeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const NativeTextarea = styled.textarea.withConfig({
|
|
4
4
|
displayName: "NativeTextarea",
|
|
5
5
|
componentId: "sc-1xe83i4-0"
|
|
6
|
-
})(["width:", ";min-width:", ";max-width:", ";min-height:56px;padding:
|
|
6
|
+
})(["width:", ";min-width:", ";max-width:", ";min-height:56px;padding:8px 12px;border:1px solid ", ";border-radius:", ";font-size:", ";line-height:", ";background-color:", ";&:focus{outline:none;border-color:", ";}&:disabled{background-color:", ";}&::placeholder{color:", ";}"], ({
|
|
7
7
|
$width
|
|
8
8
|
}) => $width || '100%', ({
|
|
9
9
|
$width
|
|
10
10
|
}) => $width || '180px', ({
|
|
11
11
|
$width
|
|
12
|
-
}) => $width || '100%',
|
|
12
|
+
}) => $width || '100%', ({
|
|
13
13
|
$isErrored
|
|
14
14
|
}) => $isErrored ? Color.DANGER : Color.FORM, ShapeRadius.CONTROL, FontSize.REGULAR, LineHeight.REGULAR, Color.CLEAR, Color.BRIGHT, Color.FROZEN, Color.PHANTOM);
|