@ssa-ui-kit/core 2.10.0 → 2.10.1

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.
@@ -1,3 +1,3 @@
1
1
  import { RadioGroupProps } from './types';
2
- declare const RadioGroup: ({ name, isRequired, initialState, onChange, children, className, }: RadioGroupProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ declare const RadioGroup: ({ name, isRequired, externalState, onChange, children, className, }: RadioGroupProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  export default RadioGroup;
@@ -2,8 +2,8 @@ import { RadioProps } from '../Radio/types';
2
2
  export interface RadioGroupProps {
3
3
  name: string;
4
4
  isRequired?: boolean;
5
- initialState?: string;
5
+ externalState?: string | number;
6
6
  className?: string;
7
- onChange: (value: string) => void;
7
+ onChange: (value: string | number) => void;
8
8
  children?: React.ReactElement<RadioProps>[] | React.ReactElement<RadioProps>;
9
9
  }
package/dist/index.js CHANGED
@@ -4424,12 +4424,15 @@ const RadioGroupBase = /*#__PURE__*/base_default()("div", true ? {
4424
4424
  const RadioGroup = ({
4425
4425
  name,
4426
4426
  isRequired,
4427
- initialState,
4427
+ externalState,
4428
4428
  onChange,
4429
4429
  children,
4430
4430
  className
4431
4431
  }) => {
4432
- const [activeValue, setActiveValue] = (0,external_react_namespaceObject.useState)(initialState);
4432
+ const [activeValue, setActiveValue] = (0,external_react_namespaceObject.useState)(externalState);
4433
+ (0,external_react_namespaceObject.useEffect)(() => {
4434
+ setActiveValue(externalState);
4435
+ }, [externalState]);
4433
4436
  const onRadioValueChange = value => {
4434
4437
  setActiveValue(value);
4435
4438
  onChange(value);
@@ -18618,7 +18621,7 @@ const RadioWidget = props => {
18618
18621
  return (0,jsx_runtime_namespaceObject.jsx)(RadioGroup_RadioGroup, {
18619
18622
  name: name,
18620
18623
  onChange: handleChange,
18621
- initialState: selectedIndex,
18624
+ externalState: selectedIndex,
18622
18625
  isRequired: required,
18623
18626
  css: /*#__PURE__*/(0,react_namespaceObject.css)({
18624
18627
  [`> label`]: {