@sebgroup/green-react 1.3.1 → 1.4.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.
package/index.js
CHANGED
|
@@ -2092,7 +2092,8 @@ const IconButton = _a => {
|
|
|
2092
2092
|
const ButtonGroup = ({
|
|
2093
2093
|
children,
|
|
2094
2094
|
selectedIndex,
|
|
2095
|
-
variant
|
|
2095
|
+
variant,
|
|
2096
|
+
id
|
|
2096
2097
|
}) => {
|
|
2097
2098
|
const [selected, setSelected] = useState(selectedIndex);
|
|
2098
2099
|
const [buttons, setButtons] = useState([]);
|
|
@@ -2112,9 +2113,12 @@ const ButtonGroup = ({
|
|
|
2112
2113
|
});
|
|
2113
2114
|
setButtons(buttonProps);
|
|
2114
2115
|
}, [children, selected, variant]);
|
|
2115
|
-
return jsx(Group, {
|
|
2116
|
+
return jsx(Group, Object.assign({
|
|
2117
|
+
"data-label": "button-group",
|
|
2118
|
+
id: id
|
|
2119
|
+
}, {
|
|
2116
2120
|
children: buttons.map(props => jsx(Button, Object.assign({}, props), props.key))
|
|
2117
|
-
});
|
|
2121
|
+
}));
|
|
2118
2122
|
};
|
|
2119
2123
|
|
|
2120
2124
|
/* eslint-disable-next-line */
|
|
@@ -2298,6 +2302,7 @@ const FormItems = ({
|
|
|
2298
2302
|
};
|
|
2299
2303
|
|
|
2300
2304
|
function Group({
|
|
2305
|
+
id,
|
|
2301
2306
|
children,
|
|
2302
2307
|
error,
|
|
2303
2308
|
groupBorder = false
|
|
@@ -2305,7 +2310,8 @@ function Group({
|
|
|
2305
2310
|
const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
|
|
2306
2311
|
const errorMessage = error ? error.message || error : '';
|
|
2307
2312
|
return jsxs("div", Object.assign({
|
|
2308
|
-
className: "form-group"
|
|
2313
|
+
className: "form-group",
|
|
2314
|
+
id: id
|
|
2309
2315
|
}, {
|
|
2310
2316
|
children: [jsx("div", Object.assign({
|
|
2311
2317
|
className: groupClassName
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^17 || ^18",
|
|
6
6
|
"react-dom": "^17 || ^18"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sebgroup/chlorophyll": "^1.
|
|
10
|
-
"@sebgroup/extract": "^1.3.
|
|
9
|
+
"@sebgroup/chlorophyll": "^1.7.0",
|
|
10
|
+
"@sebgroup/extract": "^1.3.1",
|
|
11
11
|
"classnames": "^2.3.2"
|
|
12
12
|
},
|
|
13
13
|
"description": "React components built on top of @sebgroup/chlorophyll.",
|
|
@@ -5,6 +5,7 @@ interface ButtonGroupProps {
|
|
|
5
5
|
children: ReactElement<ButtonProps> | ReactElement<ButtonProps>[];
|
|
6
6
|
selectedIndex?: number;
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
|
+
id?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const ButtonGroup: ({ children, selectedIndex, variant, }: ButtonGroupProps) => JSX.Element;
|
|
10
|
+
export declare const ButtonGroup: ({ children, selectedIndex, variant, id, }: ButtonGroupProps) => JSX.Element;
|
|
10
11
|
export default ButtonGroup;
|
|
@@ -4,6 +4,7 @@ export interface GroupProps {
|
|
|
4
4
|
error?: Error | string;
|
|
5
5
|
groupBorder?: boolean;
|
|
6
6
|
invalid?: boolean;
|
|
7
|
+
id?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function Group({ children, error, groupBorder }: GroupProps): JSX.Element;
|
|
9
|
+
export declare function Group({ id, children, error, groupBorder, }: GroupProps): JSX.Element;
|
|
9
10
|
export default Group;
|