@pushwoosh/dumb-components 1.1.21 → 1.1.23
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/Checkbox/Checkbox.js +6 -11
- package/Checkbox/styles.d.ts +0 -56
- package/Checkbox/styles.js +1 -6
- package/Radio/Radio.js +7 -11
- package/Radio/styles.d.ts +0 -56
- package/Radio/styles.js +1 -5
- package/Tooltip/HelpTooltip.d.ts +6 -0
- package/Tooltip/HelpTooltip.js +17 -0
- package/Tooltip/index.d.ts +1 -0
- package/Tooltip/index.js +2 -1
- package/Tooltip/styles.d.ts +56 -0
- package/Tooltip/styles.js +6 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/Checkbox/Checkbox.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Tooltip } from '../Tooltip';
|
|
4
|
+
import { NativeLabel, NativeCheckbox } from './styles';
|
|
5
|
+
import { HelpTooltip } from '../Tooltip';
|
|
7
6
|
let counter = 0;
|
|
8
7
|
export function Checkbox(props) {
|
|
9
8
|
const {
|
|
@@ -53,14 +52,10 @@ export function Checkbox(props) {
|
|
|
53
52
|
return React.createElement(Horizontal, {
|
|
54
53
|
"$gap": 4,
|
|
55
54
|
"$alignItems": "start"
|
|
56
|
-
}, checkboxMarkup, React.createElement(
|
|
57
|
-
content: tooltip
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, React.createElement(HelpRoundIcon, {
|
|
61
|
-
size: "small",
|
|
62
|
-
view: "lined"
|
|
63
|
-
}))));
|
|
55
|
+
}, checkboxMarkup, React.createElement(HelpTooltip, {
|
|
56
|
+
content: tooltip,
|
|
57
|
+
"$iconPadding": "4px 0"
|
|
58
|
+
}));
|
|
64
59
|
}
|
|
65
60
|
return checkboxMarkup;
|
|
66
61
|
}
|
package/Checkbox/styles.d.ts
CHANGED
|
@@ -8,59 +8,3 @@ export declare const NativeCheckbox: import("styled-components").StyledComponent
|
|
|
8
8
|
export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
|
|
9
9
|
$color: string;
|
|
10
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,6 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Color, FontSize, LineHeight } from '@pushwoosh/kit-constants';
|
|
3
|
-
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
3
|
import { ColorByType } from './maps';
|
|
5
4
|
export const NativeCheckbox = styled.input.attrs({
|
|
6
5
|
type: 'checkbox'
|
|
@@ -36,8 +35,4 @@ export const NativeLabel = styled.label.withConfig({
|
|
|
36
35
|
componentId: "sc-1lw3rny-1"
|
|
37
36
|
})(["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, ({
|
|
38
37
|
$color
|
|
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);
|
|
38
|
+
}) => `color: ${$color};`, NativeCheckbox);
|
package/Radio/Radio.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Tooltip } from '../Tooltip';
|
|
4
|
+
import { InputContainer, NativeLabel, NativeRadio } from './styles';
|
|
5
|
+
import { HelpTooltip } from '../Tooltip';
|
|
7
6
|
let counter = 0;
|
|
8
7
|
export function Radio(props) {
|
|
9
8
|
const {
|
|
@@ -50,14 +49,11 @@ export function Radio(props) {
|
|
|
50
49
|
return React.createElement(Horizontal, {
|
|
51
50
|
"$gap": 4,
|
|
52
51
|
"$alignItems": "start"
|
|
53
|
-
}, radioMarkup, React.createElement(
|
|
54
|
-
content: tooltip
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
}
|
|
58
|
-
size: "small",
|
|
59
|
-
view: "lined"
|
|
60
|
-
}))));
|
|
52
|
+
}, radioMarkup, React.createElement(HelpTooltip, {
|
|
53
|
+
content: tooltip,
|
|
54
|
+
"$iconPadding": size === 'compact' ? '0' : '4px 0',
|
|
55
|
+
position: "top-middle"
|
|
56
|
+
}));
|
|
61
57
|
}
|
|
62
58
|
return radioMarkup;
|
|
63
59
|
}
|
package/Radio/styles.d.ts
CHANGED
|
@@ -65,59 +65,3 @@ 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,8 +53,4 @@ export const NativeLabel = styled.label.withConfig({
|
|
|
53
53
|
$size
|
|
54
54
|
}) => $size === 'compact' ? '6px' : '8px', ({
|
|
55
55
|
$size
|
|
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);
|
|
56
|
+
}) => $size === 'compact' ? '0px' : '2px 0');
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { TooltipProps } from './types';
|
|
3
|
+
export type HelpTooltipProps = TooltipProps & {
|
|
4
|
+
$iconPadding?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function HelpTooltip({ $iconPadding, ...tooltipProps }: HelpTooltipProps): ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HelpRoundIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { HelpIconWrapper } from './styles';
|
|
4
|
+
import { Tooltip } from './Tooltip';
|
|
5
|
+
export function HelpTooltip({
|
|
6
|
+
$iconPadding = '0',
|
|
7
|
+
...tooltipProps
|
|
8
|
+
}) {
|
|
9
|
+
return React.createElement(Tooltip, {
|
|
10
|
+
...tooltipProps
|
|
11
|
+
}, React.createElement(HelpIconWrapper, {
|
|
12
|
+
"$padding": $iconPadding
|
|
13
|
+
}, React.createElement(HelpRoundIcon, {
|
|
14
|
+
size: "small",
|
|
15
|
+
view: "lined"
|
|
16
|
+
})));
|
|
17
|
+
}
|
package/Tooltip/index.d.ts
CHANGED
package/Tooltip/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Tooltip } from './Tooltip';
|
|
1
|
+
export { Tooltip } from './Tooltip';
|
|
2
|
+
export { HelpTooltip } from './HelpTooltip';
|
package/Tooltip/styles.d.ts
CHANGED
|
@@ -3,3 +3,59 @@ export declare const TooltipBox: import("styled-components").StyledComponent<imp
|
|
|
3
3
|
$arrowOffset: string;
|
|
4
4
|
$position: TooltipPosition;
|
|
5
5
|
}, never>;
|
|
6
|
+
export declare const HelpIconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
8
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
9
|
+
$bgColor?: string | undefined;
|
|
10
|
+
$border?: string | ({
|
|
11
|
+
top?: string | undefined;
|
|
12
|
+
right?: string | undefined;
|
|
13
|
+
bottom?: string | undefined;
|
|
14
|
+
left?: string | undefined;
|
|
15
|
+
} | {
|
|
16
|
+
horizontal: string;
|
|
17
|
+
top?: string | undefined;
|
|
18
|
+
bottom?: string | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
vertical: string;
|
|
21
|
+
right?: string | undefined;
|
|
22
|
+
left?: string | undefined;
|
|
23
|
+
}) | undefined;
|
|
24
|
+
$borderRadius?: (string | number) | undefined;
|
|
25
|
+
$boxShadow?: string | undefined;
|
|
26
|
+
$gap?: (string | number) | undefined;
|
|
27
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
28
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
29
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
30
|
+
$margin?: (string | number) | ({
|
|
31
|
+
top?: (string | number) | undefined;
|
|
32
|
+
right?: (string | number) | undefined;
|
|
33
|
+
bottom?: (string | number) | undefined;
|
|
34
|
+
left?: (string | number) | undefined;
|
|
35
|
+
} | {
|
|
36
|
+
horizontal: string | number;
|
|
37
|
+
top?: (string | number) | undefined;
|
|
38
|
+
bottom?: (string | number) | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
vertical: string | number;
|
|
41
|
+
right?: (string | number) | undefined;
|
|
42
|
+
left?: (string | number) | undefined;
|
|
43
|
+
}) | undefined;
|
|
44
|
+
$padding?: (string | number) | ({
|
|
45
|
+
top?: (string | number) | undefined;
|
|
46
|
+
right?: (string | number) | undefined;
|
|
47
|
+
bottom?: (string | number) | undefined;
|
|
48
|
+
left?: (string | number) | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
horizontal: string | number;
|
|
51
|
+
top?: (string | number) | undefined;
|
|
52
|
+
bottom?: (string | number) | undefined;
|
|
53
|
+
} | {
|
|
54
|
+
vertical: string | number;
|
|
55
|
+
right?: (string | number) | undefined;
|
|
56
|
+
left?: (string | number) | undefined;
|
|
57
|
+
}) | undefined;
|
|
58
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
59
|
+
} & {
|
|
60
|
+
$gridAutoFlow: string;
|
|
61
|
+
}, "$gridAutoFlow">;
|
package/Tooltip/styles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Tippy from '@tippyjs/react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Color, FontSize, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
|
+
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { getBottomPosition, getLeftPosition, getRightPosition, getTopPosition, getTransform } from './maps';
|
|
5
6
|
export const TooltipBox = styled(Tippy).withConfig({
|
|
6
7
|
displayName: "TooltipBox",
|
|
@@ -19,4 +20,8 @@ export const TooltipBox = styled(Tippy).withConfig({
|
|
|
19
20
|
$arrowOffset
|
|
20
21
|
}) => getLeftPosition($position, $arrowOffset), Color.MAIN, ({
|
|
21
22
|
$position
|
|
22
|
-
}) => getTransform($position), Color.CLEAR, Color.MAIN, ShapeRadius.DIALOG, FontSize.REGULAR);
|
|
23
|
+
}) => getTransform($position), Color.CLEAR, Color.MAIN, ShapeRadius.DIALOG, FontSize.REGULAR);
|
|
24
|
+
export const HelpIconWrapper = styled(Horizontal).withConfig({
|
|
25
|
+
displayName: "HelpIconWrapper",
|
|
26
|
+
componentId: "sc-1hariht-1"
|
|
27
|
+
})(["color:", ";&:hover{color:", ";cursor:pointer;}"], Color.PHANTOM, Color.PRIMARY_HOVER);
|
package/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { SortButton, type SortButtonParams } from './SortButton';
|
|
|
20
20
|
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX, type SelectBase, type MultiSelectOptions, } from './Select';
|
|
21
21
|
export { Switch } from './Switch';
|
|
22
22
|
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
23
|
-
export { Tooltip, type TooltipPosition } from './Tooltip';
|
|
23
|
+
export { Tooltip, type TooltipPosition, HelpTooltip } from './Tooltip';
|
|
24
24
|
export { Tab, TabBar, TabPanel, Tabs, type TabCode } from './Tabs';
|
|
25
25
|
export { Link } from './Link';
|
|
26
26
|
export { StatisticCard } from './StatisticCard';
|
package/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export { SortButton } from './SortButton';
|
|
|
20
20
|
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX } from './Select';
|
|
21
21
|
export { Switch } from './Switch';
|
|
22
22
|
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
23
|
-
export { Tooltip } from './Tooltip';
|
|
23
|
+
export { Tooltip, HelpTooltip } from './Tooltip';
|
|
24
24
|
export { Tab, TabBar, TabPanel, Tabs } from './Tabs';
|
|
25
25
|
export { Link } from './Link';
|
|
26
26
|
export { StatisticCard } from './StatisticCard';
|