@mrshmllw/smores-react 2.1.18 → 2.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/dist/ConfirmationRadioButtons/Confirmation.d.ts +0 -1
- package/dist/ConfirmationRadioButtons/Confirmation.js +8 -19
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +1 -1
- package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +1 -1
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js +3 -4
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +1 -1
- package/package.json +1 -1
@@ -1,13 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import styled
|
2
|
+
import styled from 'styled-components';
|
3
3
|
import { theme } from '../theme';
|
4
4
|
import { Box } from '../Box';
|
5
5
|
import { Text } from '../Text';
|
6
6
|
import { RadioButton } from './RadioButtonStyled';
|
7
|
-
export const Confirmation = ({ checked, onChange, id, error = false, errorMsg = '', label, onBlur, sublabel, yesLabel = 'Yes', noLabel = 'No',
|
7
|
+
export const Confirmation = ({ checked, onChange, id, error = false, errorMsg = '', label, onBlur, sublabel, yesLabel = 'Yes', noLabel = 'No', }) => {
|
8
8
|
return (React.createElement(ConfirmationWrapper, null,
|
9
|
-
|
10
|
-
label &&
|
9
|
+
(label || sublabel) && (React.createElement(TextWrapper, null,
|
10
|
+
label && React.createElement(SectionHeadingText, { tag: "h3" }, label),
|
11
11
|
sublabel && (React.createElement(Text, { tag: "p", typo: "base-small", color: theme.colors.subtext }, sublabel)))),
|
12
12
|
React.createElement(RadioButtonGroupWrapper, null,
|
13
13
|
React.createElement(RadioButtonGroup, null,
|
@@ -39,7 +39,7 @@ const getColor = (checked, error) => {
|
|
39
39
|
const RadioButtonWrapper = styled.div `
|
40
40
|
background-color: ${({ checked }) => !checked && `${theme.colors.background}`};
|
41
41
|
border: ${({ checked, error }) => getColor(checked, error)};
|
42
|
-
margin:
|
42
|
+
margin-right: 10px;
|
43
43
|
width: 139px;
|
44
44
|
display: flex;
|
45
45
|
align-items: center;
|
@@ -59,20 +59,9 @@ const ConfirmationWrapper = styled(Box) `
|
|
59
59
|
grid-template-columns: 1fr 1fr;
|
60
60
|
align-items: center;
|
61
61
|
`;
|
62
|
-
const SectionHeadingText = styled(Text)
|
63
|
-
|
64
|
-
|
65
|
-
`
|
66
|
-
clip: rect(1, 1, 1, 1);
|
67
|
-
clipPath: inset(50%);
|
68
|
-
height: 1;
|
69
|
-
margin: -1;
|
70
|
-
overflow: hidden;
|
71
|
-
padding: 0;
|
72
|
-
position: absolute;
|
73
|
-
width: 1;
|
74
|
-
`}
|
75
|
-
`);
|
62
|
+
const SectionHeadingText = styled(Text) `
|
63
|
+
font-weight: bold;
|
64
|
+
`;
|
76
65
|
const TextWrapper = styled.div `
|
77
66
|
display: flex;
|
78
67
|
flex-direction: column;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,MAAM,
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAa,MAAM,qBAAqB,CAAA;AAe5D,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAClD,OAAO,EACP,QAAQ,EACR,EAAE,EACF,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,EAAE,EACb,KAAK,EACL,MAAM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GAAG,CAAA;;;CAGzC,CAAA;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGlC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,OAAiB,EAAE,KAAe,EAAE,EAAE;IACtD,IAAI,KAAK,EAAE;QACT,OAAO,aAAa,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;KACzC;SAAM,IAAI,OAAO,EAAE;QAClB,OAAO,aAAa,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,CAAA;KAC7C;SAAM;QACL,OAAO,MAAM,CAAA;KACd;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAW;sBAC1B,CAAC,EAAE,OAAO,EAAa,EAAE,EAAE,CAC7C,CAAC,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;YAChC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;;;;;;;;;CAStE,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;;WAIjB,KAAK,CAAC,MAAM,CAAC,KAAK;CAC5B,CAAA;AAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAItC,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEtC,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG7B,CAAA"}
|
@@ -3,7 +3,7 @@ import { noop } from '../utils/noop';
|
|
3
3
|
import { Confirmation } from './Confirmation';
|
4
4
|
import { Container } from './Container';
|
5
5
|
export default {
|
6
|
-
title: 'Confirmation Radio
|
6
|
+
title: 'Confirmation Radio Button',
|
7
7
|
component: Confirmation,
|
8
8
|
argTypes: { onChange: { action: 'clicked' } },
|
9
9
|
};
|
@@ -42,12 +42,11 @@ WithCustomLabel.args = {
|
|
42
42
|
label: 'Do you like marshmallows?',
|
43
43
|
yesLabel: 'Correct',
|
44
44
|
};
|
45
|
-
export const
|
46
|
-
|
45
|
+
export const WithNoLabel = Template.bind({});
|
46
|
+
WithNoLabel.args = {
|
47
47
|
id: 'radioButton',
|
48
48
|
onChange: noop,
|
49
49
|
checked: undefined,
|
50
50
|
yesLabel: 'Yes',
|
51
|
-
labelHidden: true,
|
52
51
|
};
|
53
52
|
//# sourceMappingURL=Confirmation.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Confirmation.stories.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"Confirmation.stories.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,oBAAC,YAAY,oBAAK,KAAK,EAAI,CAAA;AAE1E,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IA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