@pushwoosh/dumb-components 1.1.17 → 1.1.19
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/Checkbox/Checkbox.js +40 -12
- package/Checkbox/maps.d.ts +9 -3
- package/Checkbox/maps.js +13 -5
- package/Checkbox/styles.d.ts +60 -3
- package/Checkbox/styles.js +33 -7
- package/Checkbox/types.d.ts +4 -4
- package/Radio/Radio.js +3 -4
- package/Radio/styles.d.ts +56 -0
- package/Radio/styles.js +5 -1
- 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);
|
package/Checkbox/Checkbox.js
CHANGED
|
@@ -1,38 +1,66 @@
|
|
|
1
|
-
import React, { useRef, useEffect } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
|
+
import { HelpRoundIcon } from '@pushwoosh/kit-icons';
|
|
5
|
+
import { NativeLabel, NativeCheckbox, IconWrapper } from './styles';
|
|
6
|
+
import { Tooltip } from '../Tooltip';
|
|
7
|
+
let counter = 0;
|
|
3
8
|
export function Checkbox(props) {
|
|
4
9
|
const {
|
|
5
10
|
label,
|
|
6
11
|
id,
|
|
7
12
|
name,
|
|
8
13
|
value,
|
|
9
|
-
|
|
14
|
+
type = 'normal',
|
|
10
15
|
activeCheckboxColor,
|
|
16
|
+
tooltip,
|
|
11
17
|
isChecked,
|
|
12
18
|
isDisabled,
|
|
13
19
|
isIndeterminate,
|
|
14
|
-
onChange
|
|
15
|
-
className
|
|
20
|
+
onChange
|
|
16
21
|
} = props;
|
|
17
22
|
const checkboxRef = useRef(null);
|
|
23
|
+
const [localId] = useState(() => {
|
|
24
|
+
if (id) {
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
const newCounter = counter++;
|
|
28
|
+
return `checkbox-id-${newCounter}`;
|
|
29
|
+
});
|
|
18
30
|
useEffect(() => {
|
|
19
31
|
if (checkboxRef.current) {
|
|
20
32
|
checkboxRef.current.indeterminate = isIndeterminate ?? false;
|
|
21
33
|
}
|
|
22
34
|
}, [checkboxRef, isIndeterminate]);
|
|
23
|
-
|
|
24
|
-
htmlFor:
|
|
25
|
-
"$color":
|
|
26
|
-
|
|
35
|
+
const checkboxMarkup = React.createElement(NativeLabel, {
|
|
36
|
+
htmlFor: localId,
|
|
37
|
+
"$color": isDisabled ? Color.LOCKED : Color.MAIN
|
|
38
|
+
}, React.createElement(Horizontal, {
|
|
39
|
+
"$padding": 3
|
|
27
40
|
}, React.createElement(NativeCheckbox, {
|
|
28
41
|
type: "checkbox",
|
|
29
|
-
id:
|
|
42
|
+
id: localId,
|
|
30
43
|
ref: checkboxRef,
|
|
31
44
|
value: value,
|
|
32
|
-
color: activeCheckboxColor,
|
|
33
45
|
name: name,
|
|
46
|
+
"$color": activeCheckboxColor,
|
|
34
47
|
checked: isChecked,
|
|
35
48
|
disabled: isDisabled,
|
|
49
|
+
"$type": type,
|
|
36
50
|
onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.checked)
|
|
37
|
-
}), label && React.createElement("span", null, label));
|
|
51
|
+
})), label && React.createElement("span", null, label));
|
|
52
|
+
if (tooltip) {
|
|
53
|
+
return React.createElement(Horizontal, {
|
|
54
|
+
"$gap": 4,
|
|
55
|
+
"$alignItems": "start"
|
|
56
|
+
}, checkboxMarkup, React.createElement(Tooltip, {
|
|
57
|
+
content: tooltip
|
|
58
|
+
}, React.createElement(IconWrapper, {
|
|
59
|
+
"$padding": "4px 0"
|
|
60
|
+
}, React.createElement(HelpRoundIcon, {
|
|
61
|
+
size: "small",
|
|
62
|
+
view: "lined"
|
|
63
|
+
}))));
|
|
64
|
+
}
|
|
65
|
+
return checkboxMarkup;
|
|
38
66
|
}
|
package/Checkbox/maps.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type CheckboxType } from './types';
|
|
2
|
+
type CheckboxColorSet = {
|
|
3
|
+
checked: string;
|
|
4
|
+
notChecked: string;
|
|
5
|
+
hover: string;
|
|
6
|
+
checkmarkHover: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ColorByType: Record<CheckboxType, CheckboxColorSet>;
|
|
9
|
+
export {};
|
package/Checkbox/maps.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Color } from '@pushwoosh/kit-constants';
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export const ColorByType = {
|
|
3
|
+
normal: {
|
|
4
|
+
checked: Color.PRIMARY,
|
|
5
|
+
notChecked: Color.PHANTOM,
|
|
6
|
+
hover: Color.PRIMARY_HOVER,
|
|
7
|
+
checkmarkHover: Color.PHANTOM
|
|
8
|
+
},
|
|
9
|
+
error: {
|
|
10
|
+
checked: Color.DANGER,
|
|
11
|
+
notChecked: Color.DANGER,
|
|
12
|
+
hover: Color.DANGER_HOVER,
|
|
13
|
+
checkmarkHover: Color.DANGER_HOVER
|
|
14
|
+
}
|
|
7
15
|
};
|
package/Checkbox/styles.d.ts
CHANGED
|
@@ -1,9 +1,66 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CheckboxType } from './types';
|
|
2
2
|
export declare const NativeCheckbox: import("styled-components").StyledComponent<"input", any, {
|
|
3
3
|
type: "checkbox";
|
|
4
4
|
} & {
|
|
5
|
-
color?: string;
|
|
5
|
+
$color?: string;
|
|
6
|
+
$type: CheckboxType;
|
|
6
7
|
}, "type">;
|
|
7
8
|
export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
|
|
8
|
-
$color
|
|
9
|
+
$color: string;
|
|
9
10
|
}, never>;
|
|
11
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
13
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
14
|
+
$bgColor?: string | undefined;
|
|
15
|
+
$border?: string | ({
|
|
16
|
+
top?: string | undefined;
|
|
17
|
+
right?: string | undefined;
|
|
18
|
+
bottom?: string | undefined;
|
|
19
|
+
left?: string | undefined;
|
|
20
|
+
} | {
|
|
21
|
+
horizontal: string;
|
|
22
|
+
top?: string | undefined;
|
|
23
|
+
bottom?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
vertical: string;
|
|
26
|
+
right?: string | undefined;
|
|
27
|
+
left?: string | undefined;
|
|
28
|
+
}) | undefined;
|
|
29
|
+
$borderRadius?: (string | number) | undefined;
|
|
30
|
+
$boxShadow?: string | undefined;
|
|
31
|
+
$gap?: (string | number) | undefined;
|
|
32
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
33
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
34
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
35
|
+
$margin?: (string | number) | ({
|
|
36
|
+
top?: (string | number) | undefined;
|
|
37
|
+
right?: (string | number) | undefined;
|
|
38
|
+
bottom?: (string | number) | undefined;
|
|
39
|
+
left?: (string | number) | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
horizontal: string | number;
|
|
42
|
+
top?: (string | number) | undefined;
|
|
43
|
+
bottom?: (string | number) | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
vertical: string | number;
|
|
46
|
+
right?: (string | number) | undefined;
|
|
47
|
+
left?: (string | number) | undefined;
|
|
48
|
+
}) | undefined;
|
|
49
|
+
$padding?: (string | number) | ({
|
|
50
|
+
top?: (string | number) | undefined;
|
|
51
|
+
right?: (string | number) | undefined;
|
|
52
|
+
bottom?: (string | number) | undefined;
|
|
53
|
+
left?: (string | number) | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
horizontal: string | number;
|
|
56
|
+
top?: (string | number) | undefined;
|
|
57
|
+
bottom?: (string | number) | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
vertical: string | number;
|
|
60
|
+
right?: (string | number) | undefined;
|
|
61
|
+
left?: (string | number) | undefined;
|
|
62
|
+
}) | undefined;
|
|
63
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
64
|
+
} & {
|
|
65
|
+
$gridAutoFlow: string;
|
|
66
|
+
}, "$gridAutoFlow">;
|
package/Checkbox/styles.js
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Color,
|
|
3
|
-
import {
|
|
2
|
+
import { Color, FontSize, LineHeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
|
+
import { ColorByType } from './maps';
|
|
4
5
|
export const NativeCheckbox = styled.input.attrs({
|
|
5
6
|
type: 'checkbox'
|
|
6
7
|
}).withConfig({
|
|
7
8
|
displayName: "NativeCheckbox",
|
|
8
9
|
componentId: "sc-1lw3rny-0"
|
|
9
|
-
})(["
|
|
10
|
-
|
|
11
|
-
}) =>
|
|
10
|
+
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:18px;height:18px;outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;cursor:pointer;border:", ";border-radius:4px;box-sizing:border-box;background-color:", ";transition:background 0.3s,border-color 0.3s,box-shadow 0.2s;&:checked{background-color:", ";border-color:", ";--d-o:.3s;--d-t:.6s;--o:1;--r:43deg;}&:not(:checked):disabled{border-color:", ";background-color:", ";cursor:not-allowed;}&:disabled:is(:checked,:indeterminate){background-color:", ";border-color:", ";cursor:not-allowed;}&:hover:is(:checked,:indeterminate):not(:disabled){--o:0.5;border-color:", ";background-color:", ";}&:hover:not(:checked):not(:disabled):not(:indeterminate){--o:0.5;--checkmark-color:", ";--d-o:.3s;--d-t:.6s;--o:0.5;--r:43deg;}&:after{content:\"\";display:block;position:absolute;transition:transform var(--d-t,0.3s),opacity var(--d-o,0.2s);opacity:var(--o,0);width:4px;height:8px;border:1px solid var(--checkmark-color,", ");border-top:0;border-left:0;left:5px;top:1px;transform:rotate(var(--r,20deg)) scale(1.4);}&:indeterminate{background-color:", ";border-color:", ";}&:indeterminate:after{width:11.5px;height:1.5px;top:6.25px;left:1.3px;border:none;transform:none;background-color:", ";opacity:var(--o,1);transition:width var(--d-t,0.3s),height var(--d-o,0.2s),opacity var(--d-o,0.2s);}&:disabled + span{cursor:not-allowed;}"], ({
|
|
11
|
+
$type
|
|
12
|
+
}) => `2px solid ${ColorByType[$type].notChecked}`, Color.CLEAR, ({
|
|
13
|
+
$type,
|
|
14
|
+
$color
|
|
15
|
+
}) => $color ?? ColorByType[$type].checked, ({
|
|
16
|
+
$type,
|
|
17
|
+
$color
|
|
18
|
+
}) => $color ?? ColorByType[$type].checked, Color.LOCKED, Color.DIVIDER, Color.LOCKED, Color.LOCKED, ({
|
|
19
|
+
$type,
|
|
20
|
+
$color
|
|
21
|
+
}) => $color ?? ColorByType[$type].hover, ({
|
|
22
|
+
$type,
|
|
23
|
+
$color
|
|
24
|
+
}) => $color ?? ColorByType[$type].hover, ({
|
|
25
|
+
$type,
|
|
26
|
+
$color
|
|
27
|
+
}) => $color ? Color.PHANTOM : ColorByType[$type].checkmarkHover, Color.CLEAR, ({
|
|
28
|
+
$type,
|
|
29
|
+
$color
|
|
30
|
+
}) => $color ?? ColorByType[$type].checked, ({
|
|
31
|
+
$type,
|
|
32
|
+
$color
|
|
33
|
+
}) => $color ?? ColorByType[$type].checked, Color.CLEAR);
|
|
12
34
|
export const NativeLabel = styled.label.withConfig({
|
|
13
35
|
displayName: "NativeLabel",
|
|
14
36
|
componentId: "sc-1lw3rny-1"
|
|
15
|
-
})(["font-size:", ";line-height:", ";", " user-select:none
|
|
37
|
+
})(["font-size:", ";line-height:", ";", " user-select:none;display:flex;gap:8px;align-items:start;&:has(input:not(:disabled)){cursor:pointer;}&:has(input:disabled){cursor:not-allowed;}& > span{padding:2px 0;}span{max-width:800px;white-space:normal;overflow-wrap:break-word;}& > ", "{margin:1px;}"], FontSize.REGULAR, LineHeight.REGULAR, ({
|
|
16
38
|
$color
|
|
17
|
-
}) =>
|
|
39
|
+
}) => `color: ${$color};`, NativeCheckbox);
|
|
40
|
+
export const IconWrapper = styled(Horizontal).withConfig({
|
|
41
|
+
displayName: "IconWrapper",
|
|
42
|
+
componentId: "sc-1lw3rny-2"
|
|
43
|
+
})(["color:", ";&:hover{color:", ";cursor:pointer;}"], Color.PHANTOM, Color.PRIMARY_HOVER);
|
package/Checkbox/types.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type CheckboxType = 'normal' | 'error';
|
|
3
3
|
export type CheckboxProps = {
|
|
4
4
|
label?: ReactNode;
|
|
5
5
|
id?: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
value?: string | number;
|
|
8
|
-
|
|
9
|
-
activeCheckboxColor?: string;
|
|
8
|
+
type?: CheckboxType;
|
|
10
9
|
isChecked?: boolean;
|
|
11
10
|
isDisabled?: boolean;
|
|
12
11
|
isIndeterminate?: boolean;
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
activeCheckboxColor?: string;
|
|
13
14
|
onChange?: (checked: boolean) => void;
|
|
14
|
-
className?: string;
|
|
15
15
|
};
|
package/Radio/Radio.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { HelpRoundIcon } from '@pushwoosh/kit-icons';
|
|
5
|
-
import { InputContainer, NativeLabel, NativeRadio } from './styles';
|
|
5
|
+
import { IconWrapper, InputContainer, NativeLabel, NativeRadio } from './styles';
|
|
6
6
|
import { Tooltip } from '../Tooltip';
|
|
7
7
|
let counter = 0;
|
|
8
8
|
export function Radio(props) {
|
|
@@ -52,12 +52,11 @@ export function Radio(props) {
|
|
|
52
52
|
"$alignItems": "start"
|
|
53
53
|
}, radioMarkup, React.createElement(Tooltip, {
|
|
54
54
|
content: tooltip
|
|
55
|
-
}, React.createElement(
|
|
55
|
+
}, React.createElement(IconWrapper, {
|
|
56
56
|
"$padding": size === 'compact' ? 0 : '4px 0'
|
|
57
57
|
}, React.createElement(HelpRoundIcon, {
|
|
58
58
|
size: "small",
|
|
59
|
-
view: "lined"
|
|
60
|
-
color: Color.PHANTOM
|
|
59
|
+
view: "lined"
|
|
61
60
|
}))));
|
|
62
61
|
}
|
|
63
62
|
return radioMarkup;
|
package/Radio/styles.d.ts
CHANGED
|
@@ -65,3 +65,59 @@ export declare const NativeLabel: import("styled-components").StyledComponent<"l
|
|
|
65
65
|
$color: string;
|
|
66
66
|
$size: RadioSize;
|
|
67
67
|
}, never>;
|
|
68
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
69
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
70
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
71
|
+
$bgColor?: string | undefined;
|
|
72
|
+
$border?: string | ({
|
|
73
|
+
top?: string | undefined;
|
|
74
|
+
right?: string | undefined;
|
|
75
|
+
bottom?: string | undefined;
|
|
76
|
+
left?: string | undefined;
|
|
77
|
+
} | {
|
|
78
|
+
horizontal: string;
|
|
79
|
+
top?: string | undefined;
|
|
80
|
+
bottom?: string | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
vertical: string;
|
|
83
|
+
right?: string | undefined;
|
|
84
|
+
left?: string | undefined;
|
|
85
|
+
}) | undefined;
|
|
86
|
+
$borderRadius?: (string | number) | undefined;
|
|
87
|
+
$boxShadow?: string | undefined;
|
|
88
|
+
$gap?: (string | number) | undefined;
|
|
89
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
90
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
91
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
92
|
+
$margin?: (string | number) | ({
|
|
93
|
+
top?: (string | number) | undefined;
|
|
94
|
+
right?: (string | number) | undefined;
|
|
95
|
+
bottom?: (string | number) | undefined;
|
|
96
|
+
left?: (string | number) | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
horizontal: string | number;
|
|
99
|
+
top?: (string | number) | undefined;
|
|
100
|
+
bottom?: (string | number) | undefined;
|
|
101
|
+
} | {
|
|
102
|
+
vertical: string | number;
|
|
103
|
+
right?: (string | number) | undefined;
|
|
104
|
+
left?: (string | number) | undefined;
|
|
105
|
+
}) | undefined;
|
|
106
|
+
$padding?: (string | number) | ({
|
|
107
|
+
top?: (string | number) | undefined;
|
|
108
|
+
right?: (string | number) | undefined;
|
|
109
|
+
bottom?: (string | number) | undefined;
|
|
110
|
+
left?: (string | number) | undefined;
|
|
111
|
+
} | {
|
|
112
|
+
horizontal: string | number;
|
|
113
|
+
top?: (string | number) | undefined;
|
|
114
|
+
bottom?: (string | number) | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
vertical: string | number;
|
|
117
|
+
right?: (string | number) | undefined;
|
|
118
|
+
left?: (string | number) | undefined;
|
|
119
|
+
}) | undefined;
|
|
120
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
121
|
+
} & {
|
|
122
|
+
$gridAutoFlow: string;
|
|
123
|
+
}, "$gridAutoFlow">;
|
package/Radio/styles.js
CHANGED
|
@@ -53,4 +53,8 @@ export const NativeLabel = styled.label.withConfig({
|
|
|
53
53
|
$size
|
|
54
54
|
}) => $size === 'compact' ? '6px' : '8px', ({
|
|
55
55
|
$size
|
|
56
|
-
}) => $size === 'compact' ? '0px' : '2px 0');
|
|
56
|
+
}) => $size === 'compact' ? '0px' : '2px 0');
|
|
57
|
+
export const IconWrapper = styled(Horizontal).withConfig({
|
|
58
|
+
displayName: "IconWrapper",
|
|
59
|
+
componentId: "sc-34lgtl-3"
|
|
60
|
+
})(["color:", ";&:hover{color:", ";cursor:pointer;}"], Color.PHANTOM, Color.PRIMARY_HOVER);
|
|
@@ -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);
|