@toptal/picasso-radio 5.0.14-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.10 → 5.0.14-alpha-1757603192867.0

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.
Files changed (32) hide show
  1. package/package.json +16 -16
  2. package/src/Radio/Radio.tsx +7 -2
  3. package/src/RadioGroup/RadioGroup.tsx +6 -2
  4. package/LICENSE +0 -20
  5. package/dist-package/src/Radio/Radio.d.ts +0 -18
  6. package/dist-package/src/Radio/Radio.d.ts.map +0 -1
  7. package/dist-package/src/Radio/Radio.js +0 -47
  8. package/dist-package/src/Radio/Radio.js.map +0 -1
  9. package/dist-package/src/Radio/index.d.ts +0 -5
  10. package/dist-package/src/Radio/index.d.ts.map +0 -1
  11. package/dist-package/src/Radio/index.js +0 -2
  12. package/dist-package/src/Radio/index.js.map +0 -1
  13. package/dist-package/src/Radio/styles.d.ts +0 -4
  14. package/dist-package/src/Radio/styles.d.ts.map +0 -1
  15. package/dist-package/src/Radio/styles.js +0 -98
  16. package/dist-package/src/Radio/styles.js.map +0 -1
  17. package/dist-package/src/RadioCompound/index.d.ts +0 -5
  18. package/dist-package/src/RadioCompound/index.d.ts.map +0 -1
  19. package/dist-package/src/RadioCompound/index.js +0 -6
  20. package/dist-package/src/RadioCompound/index.js.map +0 -1
  21. package/dist-package/src/RadioGroup/RadioGroup.d.ts +0 -13
  22. package/dist-package/src/RadioGroup/RadioGroup.d.ts.map +0 -1
  23. package/dist-package/src/RadioGroup/RadioGroup.js +0 -28
  24. package/dist-package/src/RadioGroup/RadioGroup.js.map +0 -1
  25. package/dist-package/src/RadioGroup/index.d.ts +0 -5
  26. package/dist-package/src/RadioGroup/index.d.ts.map +0 -1
  27. package/dist-package/src/RadioGroup/index.js +0 -2
  28. package/dist-package/src/RadioGroup/index.js.map +0 -1
  29. package/dist-package/src/index.d.ts +0 -4
  30. package/dist-package/src/index.d.ts.map +0 -1
  31. package/dist-package/src/index.js +0 -4
  32. package/dist-package/src/index.js.map +0 -1
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@toptal/picasso-radio",
3
- "version": "5.0.14-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.10+7db07b500",
3
+ "version": "5.0.14-alpha-1757603192867.0",
4
4
  "description": "Toptal UI components library - Radio",
5
5
  "publishConfig": {
6
- "access": "public"
6
+ "access": "public",
7
+ "provenance": true
7
8
  },
8
9
  "main": "./dist-package/src/index.js",
9
10
  "module": "./dist-package/src/index.js",
10
11
  "scripts": {
11
12
  "build:package": "tsc -b tsconfig.json",
12
- "prepublishOnly": "yarn build:package"
13
+ "prepublishOnly": "echo 0"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -22,10 +23,10 @@
22
23
  },
23
24
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
25
  "dependencies": {
25
- "@toptal/picasso-form-label": "1.0.3-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.31+7db07b500",
26
- "@toptal/picasso-grid": "5.0.11-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.10+7db07b500",
27
- "@toptal/picasso-shared": "15.0.1-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.377+7db07b500",
28
- "@toptal/picasso-utils": "3.1.1-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.31+7db07b500",
26
+ "@toptal/picasso-form-label": "1.0.3-alpha-1757603192867.0",
27
+ "@toptal/picasso-grid": "5.0.11-alpha-1757603192867.0",
28
+ "@toptal/picasso-shared": "15.0.1-alpha-1757603192867.0",
29
+ "@toptal/picasso-utils": "3.1.1-alpha-1757603192867.0",
29
30
  "ap-style-title-case": "^1.1.2",
30
31
  "classnames": "^2.5.1"
31
32
  },
@@ -35,15 +36,15 @@
35
36
  ],
36
37
  "peerDependencies": {
37
38
  "@material-ui/core": "4.12.4",
38
- "@toptal/picasso-provider": "*",
39
- "@toptal/picasso-tailwind": ">=2.4.0",
40
- "@toptal/picasso-tailwind-merge": "^2.0.0",
41
- "react": ">=16.12.0 < 19.0.0"
39
+ "@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
40
+ "@toptal/picasso-tailwind-merge": "2.0.4-alpha-1757603192867.0",
41
+ "react": ">=16.12.0 < 19.0.0",
42
+ "@toptal/picasso-tailwind": "3.0.1-alpha-1757603192867.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@toptal/picasso-provider": "5.0.2-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.10+7db07b500",
45
- "@toptal/picasso-tailwind-merge": "2.0.4-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.31+7db07b500",
46
- "@toptal/picasso-test-utils": "1.1.2-alpha-MP-669-remove-default-props-dkjf3234-7db07b500.377+7db07b500",
45
+ "@toptal/picasso-provider": "5.0.2-alpha-1757603192867.0",
46
+ "@toptal/picasso-test-utils": "1.1.2-alpha-1757603192867.0",
47
+ "@toptal/picasso-tailwind-merge": "2.0.4-alpha-1757603192867.0",
47
48
  "styled-components": "^6.1.1"
48
49
  },
49
50
  "exports": {
@@ -53,6 +54,5 @@
53
54
  "dist-package/**",
54
55
  "!dist-package/tsconfig.tsbuildinfo",
55
56
  "src"
56
- ],
57
- "gitHead": "7db07b500402a91f0c09da3be294305a194fd1e4"
57
+ ]
58
58
  }
@@ -38,19 +38,20 @@ const useStyles = makeStyles<Theme, Props>(styles, {
38
38
 
39
39
  // eslint-disable-next-line react/display-name
40
40
  export const Radio = forwardRef<HTMLButtonElement | HTMLLabelElement, Props>(
41
- function Radio({ disabled = false, ...props }, ref) {
41
+ function Radio(props, ref) {
42
42
  const {
43
43
  className,
44
44
  style,
45
45
  label,
46
46
  checked,
47
+ disabled,
47
48
  value,
48
49
  onChange,
49
50
  titleCase,
50
51
  'data-private': dataPrivate,
51
52
  ...rest
52
53
  } = props
53
- const classes = useStyles({ disabled, ...props })
54
+ const classes = useStyles(props)
54
55
  const rootClasses = {
55
56
  root: classes.root,
56
57
  disabled: classes.disabled,
@@ -103,6 +104,10 @@ export const Radio = forwardRef<HTMLButtonElement | HTMLLabelElement, Props>(
103
104
  }
104
105
  )
105
106
 
107
+ Radio.defaultProps = {
108
+ disabled: false,
109
+ }
110
+
106
111
  Radio.displayName = 'Radio'
107
112
 
108
113
  export default Radio
@@ -15,8 +15,8 @@ export interface Props extends RadioGroupProps, GridSizeProps {
15
15
  spacing?: GridSpacing
16
16
  }
17
17
 
18
- const RadioGroup = ({ horizontal = false, ...props }: Props) => {
19
- const { spacing, xs, sm, md, lg, xl, ...rest } = props
18
+ const RadioGroup = (props: Props) => {
19
+ const { horizontal, spacing, xs, sm, md, lg, xl, ...rest } = props
20
20
  const { spacing: themeSpacing } = useTheme()
21
21
 
22
22
  const direction = horizontal ? 'row' : 'column'
@@ -49,4 +49,8 @@ const RadioGroup = ({ horizontal = false, ...props }: Props) => {
49
49
  )
50
50
  }
51
51
 
52
+ RadioGroup.defaultProps = {
53
+ horizontal: false,
54
+ }
55
+
52
56
  export default RadioGroup
package/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021-2022 Toptal, LLC
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the “Software”), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,18 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import React from 'react';
3
- import type { StandardProps, ButtonOrAnchorProps, TextLabelProps } from '@toptal/picasso-shared';
4
- export interface Props extends StandardProps, TextLabelProps, Omit<ButtonOrAnchorProps, 'onChange' | 'value'> {
5
- /** Text label for the `Radio` */
6
- label?: ReactNode;
7
- /** Value of the `Radio` component used with conjunction of `Radio.Group` */
8
- value?: string | number | boolean;
9
- /** Defines if `Radio` is disabled */
10
- disabled?: boolean;
11
- /** Defines if `Radio` is checked by default */
12
- checked?: boolean;
13
- /** Callback invoked when `Radio` changes its state */
14
- onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
15
- }
16
- export declare const Radio: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement | HTMLLabelElement>>;
17
- export default Radio;
18
- //# sourceMappingURL=Radio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAM/B,MAAM,WAAW,KACf,SAAQ,aAAa,EACnB,cAAc,EACd,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,OAAO,CAAC;IACjD,iCAAiC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACjC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAC1C,OAAO,EAAE,OAAO,KACb,IAAI,CAAA;CACV;AAOD,eAAO,MAAM,KAAK,oGAgEjB,CAAA;AAID,eAAe,KAAK,CAAA"}
@@ -1,47 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { forwardRef } from 'react';
13
- import { Radio as MUIRadio } from '@material-ui/core';
14
- import { makeStyles } from '@material-ui/core/styles';
15
- import cx from 'classnames';
16
- import { FormControlLabel } from '@toptal/picasso-form-label';
17
- import styles from './styles';
18
- const useStyles = makeStyles(styles, {
19
- name: 'Radio',
20
- });
21
- // eslint-disable-next-line react/display-name
22
- export const Radio = forwardRef(function Radio(_a, ref) {
23
- var { disabled = false } = _a, props = __rest(_a, ["disabled"]);
24
- const { className, style, label, checked, value, onChange, titleCase, 'data-private': dataPrivate } = props, rest = __rest(props, ["className", "style", "label", "checked", "value", "onChange", "titleCase", 'data-private']);
25
- const classes = useStyles(Object.assign({ disabled }, props));
26
- const rootClasses = {
27
- root: classes.root,
28
- disabled: classes.disabled,
29
- };
30
- const muiRadio = (React.createElement(MUIRadio, Object.assign({}, rest, { ref: label ? undefined : ref, checked: checked, disabled: disabled, onChange: onChange, value: value, icon: React.createElement("div", { className: classes.uncheckedIcon }), checkedIcon: React.createElement("div", { className: classes.checkedIcon }), color: 'default', classes: rootClasses, className: cx(className, {
31
- [classes.withLabel]: Boolean(label),
32
- }), style: style, focusVisibleClassName: classes.focused })));
33
- if (!label) {
34
- return muiRadio;
35
- }
36
- const externalEventListeners = {
37
- onMouseLeave: rest.onMouseLeave,
38
- onMouseOver: rest.onMouseOver,
39
- };
40
- return (React.createElement(FormControlLabel, Object.assign({}, externalEventListeners, { ref: ref, control: muiRadio, classes: {
41
- label: 'mt-[0.25em] max-w-[calc(100%_-_1.5em_+_1px)]',
42
- root: 'text-[1rem] items-start',
43
- }, style: style, label: label, "data-private": dataPrivate, disabled: disabled, titleCase: titleCase })));
44
- });
45
- Radio.displayName = 'Radio';
46
- export default Radio;
47
- //# sourceMappingURL=Radio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/Radio/Radio.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAMrD,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,MAAM,MAAM,UAAU,CAAA;AAqB7B,MAAM,SAAS,GAAG,UAAU,CAAe,MAAM,EAAE;IACjD,IAAI,EAAE,OAAO;CACd,CAAC,CAAA;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,SAAS,KAAK,CAAC,EAA8B,EAAE,GAAG;QAAnC,EAAE,QAAQ,GAAG,KAAK,OAAY,EAAP,KAAK,cAA5B,YAA8B,CAAF;IACzC,MAAM,EACJ,SAAS,EACT,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,cAAc,EAAE,WAAW,KAEzB,K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AW,EACzB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,IACpB,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,eAAe,KAAK,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props as InternalRadioProps } from './Radio';
3
- export { default as Radio } from './Radio';
4
- export declare type RadioProps = OmitInternalProps<InternalRadioProps>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AAC1C,oBAAY,UAAU,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as Radio } from './Radio';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Radio/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette, sizes, transitions }: Theme) => import("@material-ui/styles").StyleRules<{}, "root" | "disabled" | "focused" | "withLabel" | "uncheckedIcon" | "checkedIcon">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Radio/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;0DA6FJ,KAAK;AAAtD,wBAkDI"}
@@ -1,98 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- import { rem, outline, mix } from '@toptal/picasso-shared';
3
- import { PicassoProvider } from '@toptal/picasso-provider';
4
- const CONTROL_MARGIN_RIGHT = '0.5em';
5
- const RADIO_VERTICAL_MARGIN = '0.25em';
6
- PicassoProvider.override(({ palette, transitions }) => ({
7
- MuiRadio: {
8
- root: {
9
- color: palette.common.white,
10
- fontSize: '1rem',
11
- position: 'relative',
12
- width: '1em',
13
- height: '1em',
14
- padding: '0',
15
- margin: `${RADIO_VERTICAL_MARGIN} 0`,
16
- transition: `all ${transitions.duration.short}ms ${transitions.easing.easeInOut}`,
17
- '&$disabled': {
18
- opacity: 0.48,
19
- },
20
- },
21
- checked: {
22
- color: palette.primary.main,
23
- },
24
- },
25
- }));
26
- const centeredCircle = (backgroundColor) => ({
27
- position: 'absolute',
28
- width: '100%',
29
- height: '100%',
30
- top: '50%',
31
- left: '50%',
32
- borderRadius: '50%',
33
- transform: 'translate(-50%, -50%)',
34
- content: '""',
35
- background: backgroundColor,
36
- pointerEvents: 'none',
37
- transition: 'border-color',
38
- transitionDuration: 'inherit',
39
- transitionTimingFunction: 'inherit',
40
- });
41
- const iconStyles = ({ backgroundColor, borderColor, borderWidth, dotColor, dotOpacity, transition, }) => ({
42
- color: dotColor,
43
- transition,
44
- '&:before': iconBeforeStyles({
45
- borderWidth,
46
- borderColor,
47
- backgroundColor,
48
- }),
49
- '&:after': Object.assign(Object.assign({}, centeredCircle(dotColor)), { width: 'initial', height: 'initial', borderWidth: rem('2px'), borderStyle: 'solid', opacity: dotOpacity, transition }),
50
- });
51
- const iconBeforeStyles = ({ borderWidth, borderColor, backgroundColor, }) => (Object.assign(Object.assign({}, centeredCircle(backgroundColor)), { border: `${borderWidth} solid ${borderColor}` }));
52
- export default ({ palette, sizes, transitions }) => createStyles({
53
- root: {
54
- fontSize: '1rem',
55
- alignItems: 'flex-start',
56
- '&:hover $uncheckedIcon:before': iconBeforeStyles({
57
- borderWidth: sizes.borderWidth,
58
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59
- borderColor: palette.grey.main2,
60
- backgroundColor: palette.common.white,
61
- }),
62
- '&:hover $checkedIcon:before': iconBeforeStyles({
63
- borderWidth: sizes.borderWidth,
64
- borderColor: mix(palette.primary.main, palette.common.white, 0.16),
65
- backgroundColor: mix(palette.primary.main, palette.common.white, 0.16),
66
- }),
67
- },
68
- focused: {
69
- '& $checkedIcon:before, & $uncheckedIcon:before': Object.assign({}, outline(palette.primary.main)),
70
- },
71
- disabled: {
72
- '$uncheckedIcon:before': {
73
- boxShadow: 'none !important',
74
- },
75
- },
76
- withLabel: {
77
- marginRight: CONTROL_MARGIN_RIGHT,
78
- },
79
- uncheckedIcon: iconStyles({
80
- backgroundColor: palette.common.white,
81
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
82
- borderColor: palette.grey.main,
83
- borderWidth: sizes.borderWidth,
84
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
85
- dotColor: palette.grey.main,
86
- dotOpacity: 0,
87
- transition: `all ${transitions.duration.short}ms ${transitions.easing.easeInOut}`,
88
- }),
89
- checkedIcon: iconStyles({
90
- backgroundColor: palette.primary.main,
91
- borderColor: palette.primary.main,
92
- borderWidth: sizes.borderWidth,
93
- dotColor: palette.common.white,
94
- dotOpacity: 1,
95
- transition: `all ${transitions.duration.short}ms ${transitions.easing.easeInOut}`,
96
- }),
97
- });
98
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/Radio/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,MAAM,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,QAAQ,EAAE;QACR,uBAAuB,EAAE;YACvB,SAAS,EAAE,iBAAiB;SAC7B;KACF;IACD,SAAS,EAAE;QACT,WAAW,EAAE,oBAAoB;KAClC;IACD,aAAa,EAAE,UAAU,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;QACrC,oEAAoE;QACpE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,IAAK;QAC/B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,oEAAoE;QACpE,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,IAAK;QAC5B,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,MAAM,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;KAClF,CAAC;IACF,WAAW,EAAE,UAAU,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;QACrC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;QACjC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;QAC9B,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,MAAM,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;KAClF,CAAC;CACH,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const RadioCompound: import("react").ForwardRefExoticComponent<import("../Radio/Radio").Props & import("react").RefAttributes<HTMLButtonElement | HTMLLabelElement>> & {
3
- Group: ({ horizontal, ...props }: import("../RadioGroup/RadioGroup").Props) => JSX.Element;
4
- };
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RadioCompound/index.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,aAAa;;CAExB,CAAA"}
@@ -1,6 +0,0 @@
1
- import { Radio } from '../Radio';
2
- import { RadioGroup } from '../RadioGroup';
3
- export const RadioCompound = Object.assign(Radio, {
4
- Group: RadioGroup,
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/RadioCompound/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IAChD,KAAK,EAAE,UAAU;CAClB,CAAC,CAAA"}
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import type { RadioGroupProps } from '@material-ui/core';
3
- import type { GridSizeProps, GridProps } from '@toptal/picasso-grid';
4
- declare type GridSpacing = GridProps['spacing'];
5
- export interface Props extends RadioGroupProps, GridSizeProps {
6
- /** Align radios horizontally */
7
- horizontal?: boolean;
8
- /** Defines amount of space between radio buttons components (in px) */
9
- spacing?: GridSpacing;
10
- }
11
- declare const RadioGroup: ({ horizontal, ...props }: Props) => JSX.Element;
12
- export default RadioGroup;
13
- //# sourceMappingURL=RadioGroup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAGpE,aAAK,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;AAEvC,MAAM,WAAW,KAAM,SAAQ,eAAe,EAAE,aAAa;IAC3D,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,uEAAuE;IACvE,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED,QAAA,MAAM,UAAU,6BAAsC,KAAK,gBAgC1D,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,28 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- /* eslint-disable react/no-array-index-key */
13
- import React from 'react';
14
- import { RadioGroup as MUIRadioGroup } from '@material-ui/core';
15
- import { useTheme } from '@material-ui/core/styles';
16
- import { GridCompound as Grid } from '@toptal/picasso-grid';
17
- const RadioGroup = (_a) => {
18
- var { horizontal = false } = _a, props = __rest(_a, ["horizontal"]);
19
- const { spacing, xs, sm, md, lg, xl } = props, rest = __rest(props, ["spacing", "xs", "sm", "md", "lg", "xl"]);
20
- const { spacing: themeSpacing } = useTheme();
21
- const direction = horizontal ? 'row' : 'column';
22
- const gridSpacing = (spacing !== null && spacing !== void 0 ? spacing : horizontal) ? themeSpacing(2) : 0;
23
- const children = React.Children.toArray(rest.children);
24
- return (React.createElement(MUIRadioGroup, Object.assign({}, rest),
25
- React.createElement(Grid, { direction: direction, spacing: gridSpacing, className: 'mt-0 mb-0' }, children.map((child, index) => (React.createElement(Grid.Item, { key: index, className: 'leading-none [&&]:pt-0 [&&]:pb-0', xs: xs, sm: sm, md: md, lg: lg, xl: xl }, child))))));
26
- };
27
- export default RadioGroup;
28
- //# sourceMappingURL=RadioGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,6CAA6C;AAC7C,OAAO,KA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N,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,IAEL,KAAK,CACI,CACb,CAAC,CACG,CACO,CACjB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { OmitInternalProps } from '@toptal/picasso-shared';
2
- import type { Props as InternalRadioGroupProps } from './RadioGroup';
3
- export { default as RadioGroup } from './RadioGroup';
4
- export declare type RadioGroupProps = OmitInternalProps<InternalRadioGroupProps>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RadioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,oBAAY,eAAe,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as RadioGroup } from './RadioGroup';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/RadioGroup/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './RadioCompound';
2
- export * from './Radio';
3
- export { RadioGroupProps, RadioGroup } from './RadioGroup';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './RadioCompound';
2
- export * from './Radio';
3
- export { RadioGroup } from './RadioGroup';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,OAAO,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAA"}