@ndlib/component-library 0.0.54 → 0.0.55
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.
|
@@ -34,7 +34,7 @@ export const CheckboxGroup = (_a) => {
|
|
|
34
34
|
return optionsByColumn;
|
|
35
35
|
}, [options, columns]);
|
|
36
36
|
return (_jsx(Row, Object.assign({}, rest, { children: optionsByColumn.map((options, index) => (_jsx(Column, Object.assign({ grow: 1, sx: Object.assign({ mr: 4 }, columnStyles) }, { children: options.map((option) => (_jsx(Group, Object.assign({ type: GROUP_TYPE.RAW }, { children: ({ labelTargetId }) => (_jsxs(Row, Object.assign({ sx: {
|
|
37
|
-
mb:
|
|
37
|
+
mb: 2,
|
|
38
38
|
alignItems: 'center',
|
|
39
39
|
} }, { children: [_jsx(Checkbox, { onChange: (checked) => {
|
|
40
40
|
const updatedSet = new Set(checkedOptions || []);
|
|
@@ -14,7 +14,7 @@ import { useTheme } from '../../../../theme';
|
|
|
14
14
|
export const Radio = (_a) => {
|
|
15
15
|
var { checked, onChange, sx } = _a, rest = __rest(_a, ["checked", "onChange", "sx"]);
|
|
16
16
|
const theme = useTheme();
|
|
17
|
-
return (_jsx("input", Object.assign({ type: "radio",
|
|
17
|
+
return (_jsx("input", Object.assign({ type: "radio", onChange: (e) => {
|
|
18
18
|
onChange(e.target.checked);
|
|
19
19
|
}, checked: checked, sx: Object.assign({ margin: '0px', height: '1.25rem', width: '1.25rem', cursor: 'pointer', ':hover': {
|
|
20
20
|
boxShadow: theme.boxShadow,
|
|
@@ -20,7 +20,7 @@ import { Radio } from '../Radio';
|
|
|
20
20
|
export const RadioGroup = (_a) => {
|
|
21
21
|
var { options, checked, onChange } = _a, rest = __rest(_a, ["options", "checked", "onChange"]);
|
|
22
22
|
return (_jsx(Column, Object.assign({}, rest, { children: options.map((option) => (_jsx(Group, Object.assign({ type: GROUP_TYPE.RAW }, { children: ({ labelTargetId }) => (_jsxs(Row, Object.assign({ sx: {
|
|
23
|
-
mb:
|
|
23
|
+
mb: 2,
|
|
24
24
|
alignItems: 'center',
|
|
25
25
|
} }, { children: [_jsx(Radio, { onChange: () => {
|
|
26
26
|
onChange(option.value);
|
|
@@ -29,7 +29,9 @@ export const Label = (_a) => {
|
|
|
29
29
|
const { labelId, labelTargetId, type: groupType } = useGroup();
|
|
30
30
|
const { flagInDevelopment } = useEnvironment();
|
|
31
31
|
const typography = typographyParam || SIZE_TYPOGRAPHY_MAP[size || LABEL_SIZE.MD];
|
|
32
|
-
if (groupType !== GROUP_TYPE.GROUP &&
|
|
32
|
+
if (groupType !== GROUP_TYPE.GROUP &&
|
|
33
|
+
groupType !== GROUP_TYPE.RAW &&
|
|
34
|
+
!standalone) {
|
|
33
35
|
flagInDevelopment('Label component should be used within a Group component with property type={GROUP_TYPE.GROUP} or given the standalone flag');
|
|
34
36
|
}
|
|
35
37
|
return (_jsx("label", Object.assign({ id: labelId, htmlFor: labelTargetId, sx: Object.assign(Object.assign({}, getTypographyStyles(typography)), sx) }, rest)));
|