@pushwoosh/dumb-components 1.1.6 → 1.1.8

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 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;
@@ -22,7 +23,8 @@ export function Radio(props) {
22
23
  });
23
24
  return React.createElement(NativeLabel, {
24
25
  htmlFor: localId,
25
- "$color": isDisabled ? 'locked' : color
26
+ "$color": isDisabled ? 'locked' : color,
27
+ "$size": size
26
28
  }, React.createElement(NativeRadio, {
27
29
  type: "radio",
28
30
  id: localId,
@@ -30,6 +32,7 @@ export function Radio(props) {
30
32
  name: name,
31
33
  checked: isChecked,
32
34
  disabled: isDisabled,
35
+ "$size": size,
33
36
  onChange: event => onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value),
34
37
  onBlur: onBlur
35
38
  }), label && React.createElement("span", null, label));
package/Radio/styles.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- import type { RadioTextColor } from './types';
2
- export declare const NativeRadio: import("styled-components").StyledComponent<"input", any, {}, never>;
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;
7
+ $size: RadioSize;
5
8
  }, never>;
package/Radio/styles.js CHANGED
@@ -4,10 +4,20 @@ 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: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);
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"
11
- })(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"], FontSize.REGULAR, LineHeight.REGULAR, ({
19
+ })(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"], ({
20
+ $size
21
+ }) => $size === 'compact' ? FontSize.SMALL : FontSize.REGULAR, LineHeight.REGULAR, ({
12
22
  $color
13
23
  }) => $color && `color: ${ColorMap[$color]};`, NativeRadio, Spacing.S3);
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",