@pushwoosh/dumb-components 1.1.6 → 1.1.7
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/Radio/Radio.js +2 -0
- package/Radio/styles.d.ts +4 -2
- package/Radio/styles.js +9 -1
- package/Radio/types.d.ts +2 -0
- package/package.json +1 -1
package/Radio/Radio.js
CHANGED
|
@@ -10,6 +10,7 @@ export function Radio(props) {
|
|
|
10
10
|
color,
|
|
11
11
|
isChecked,
|
|
12
12
|
isDisabled,
|
|
13
|
+
size = 'normal',
|
|
13
14
|
onChange,
|
|
14
15
|
onBlur
|
|
15
16
|
} = props;
|
|
@@ -30,6 +31,7 @@ export function Radio(props) {
|
|
|
30
31
|
name: name,
|
|
31
32
|
checked: isChecked,
|
|
32
33
|
disabled: isDisabled,
|
|
34
|
+
"$size": size,
|
|
33
35
|
onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
|
|
34
36
|
onBlur: onBlur
|
|
35
37
|
}), label && React.createElement("span", null, label));
|
package/Radio/styles.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { RadioTextColor } from './types';
|
|
2
|
-
export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {
|
|
1
|
+
import type { RadioSize, RadioTextColor } from './types';
|
|
2
|
+
export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {
|
|
3
|
+
$size: RadioSize;
|
|
4
|
+
}, never>;
|
|
3
5
|
export declare const NativeLabel: import("styled-components").StyledComponent<"label", any, {
|
|
4
6
|
$color?: RadioTextColor;
|
|
5
7
|
}, never>;
|
package/Radio/styles.js
CHANGED
|
@@ -4,7 +4,15 @@ import { ColorMap } from './maps';
|
|
|
4
4
|
export const NativeRadio = styled.input.withConfig({
|
|
5
5
|
displayName: "NativeRadio",
|
|
6
6
|
componentId: "sc-34lgtl-0"
|
|
7
|
-
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:
|
|
7
|
+
})(["appearance:none;-webkit-appearance:none;-moz-appearance:none;width:", ";height:", ";border:", ";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:", ";}&[type=radio]:checked:hover{border-color:", ";}&[type=radio]:checked:disabled{border-color:", ";background-color:", ";}"], ({
|
|
8
|
+
$size
|
|
9
|
+
}) => $size === 'compact' ? '12px' : '20px', ({
|
|
10
|
+
$size
|
|
11
|
+
}) => $size === 'compact' ? '12px' : '20px', ({
|
|
12
|
+
$size
|
|
13
|
+
}) => `${$size === 'compact' ? '1px' : '2px'} solid ${Color.PHANTOM}`, Color.CLEAR, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN, ({
|
|
14
|
+
$size
|
|
15
|
+
}) => `${$size === 'compact' ? '4px' : '6px'} solid ${Color.PRIMARY}`, Color.PRIMARY_HOVER, Color.LOCKED, Color.FROZEN);
|
|
8
16
|
export const NativeLabel = styled.label.withConfig({
|
|
9
17
|
displayName: "NativeLabel",
|
|
10
18
|
componentId: "sc-34lgtl-1"
|
package/Radio/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type RadioTextColor = 'main' | 'primary' | 'danger' | 'current' | 'locked';
|
|
2
|
+
export type RadioSize = 'normal' | 'compact';
|
|
2
3
|
export type RadioProps = {
|
|
3
4
|
label?: string;
|
|
4
5
|
id?: string;
|
|
@@ -7,6 +8,7 @@ export type RadioProps = {
|
|
|
7
8
|
color?: RadioTextColor;
|
|
8
9
|
isChecked?: boolean;
|
|
9
10
|
isDisabled?: boolean;
|
|
11
|
+
size?: RadioSize;
|
|
10
12
|
onChange?: (checked: string | number) => void;
|
|
11
13
|
onBlur?: () => void;
|
|
12
14
|
};
|