@sebgroup/green-react 3.5.1 → 3.5.3

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.esm.js CHANGED
@@ -4027,8 +4027,8 @@ const Input = _a => {
4027
4027
  const showSimpleInput = !label && !info && !expandableInfo;
4028
4028
  const describedBy = classNames(ariaDescribedBy, {
4029
4029
  [`${uuid}_group-message`]: !showSimpleInput && (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0,
4030
- [`gds-expandable-info-${uuid}`]: !showSimpleInput && expandableInfo,
4031
- [`${uuid}_info`]: !showSimpleInput && info
4030
+ [`${uuid}_info`]: !showSimpleInput && info,
4031
+ [`gds-expandable-info-${uuid}`]: !showSimpleInput && expandableInfo
4032
4032
  });
4033
4033
  const inputClassName = classNames(className, {
4034
4034
  [validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)]: validator
@@ -4178,6 +4178,7 @@ const RadioGroup = ({
4178
4178
  const [selected, setSelected] = useState(valueSelected !== null && valueSelected !== void 0 ? valueSelected : defaultSelected);
4179
4179
  const [prevValueSelected, setPrevValueSelected] = useState(valueSelected);
4180
4180
  const [name] = useState(propName);
4181
+ const [uniqueId] = useState(randomId());
4181
4182
  if (valueSelected !== prevValueSelected) {
4182
4183
  setSelected(valueSelected);
4183
4184
  setPrevValueSelected(valueSelected);
@@ -4218,12 +4219,20 @@ const RadioGroup = ({
4218
4219
  const radioGroupWrapperClassNames = classNames('gds-radio-group-wrapper', {
4219
4220
  'gds-radio-group-wrapper--horizontal': horizontal
4220
4221
  });
4222
+ const describedBy = classNames({
4223
+ [`${uniqueId}_message`]: (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0,
4224
+ [`${uniqueId}_info`]: labelInformation,
4225
+ [`gds-expandable-info-${uniqueId}`]: expandableInfo
4226
+ });
4221
4227
  return jsx(FormItem, Object.assign({}, formItemProps, {
4228
+ inputId: uniqueId
4229
+ }, {
4222
4230
  children: jsx("div", Object.assign({
4223
4231
  className: radioGroupWrapperClassNames
4224
4232
  }, {
4225
4233
  children: React.Children.map(children, radioButton => {
4226
4234
  return /*#__PURE__*/React.isValidElement(radioButton) ? /*#__PURE__*/React.cloneElement(radioButton, {
4235
+ "aria-describedby": describedBy,
4227
4236
  validator: validator,
4228
4237
  onChange: handleOnChange,
4229
4238
  checked: selected === radioButton.props.value,
@@ -4508,6 +4517,10 @@ const List$1 = _a => {
4508
4517
  }
4509
4518
  };
4510
4519
 
4520
+ /**
4521
+ * @deprecated
4522
+ * Use `GroupedList` instead.
4523
+ */
4511
4524
  const Label = ({
4512
4525
  children
4513
4526
  }) => {
@@ -4515,6 +4528,10 @@ const Label = ({
4515
4528
  children: children
4516
4529
  });
4517
4530
  };
4531
+ /**
4532
+ * @deprecated
4533
+ * Use `GroupedList` instead.
4534
+ */
4518
4535
  const Value = ({
4519
4536
  children
4520
4537
  }) => {
@@ -4522,6 +4539,10 @@ const Value = ({
4522
4539
  children: children
4523
4540
  });
4524
4541
  };
4542
+ /**
4543
+ * @deprecated
4544
+ * Use `GroupedList` instead.
4545
+ */
4525
4546
  const List = ({
4526
4547
  children,
4527
4548
  inverted
@@ -4534,6 +4555,10 @@ const List = ({
4534
4555
  children: children
4535
4556
  }));
4536
4557
  };
4558
+ /**
4559
+ * @deprecated
4560
+ * Use `GroupedList` instead.
4561
+ */
4537
4562
  var valueList = {
4538
4563
  List,
4539
4564
  Label,
@@ -4637,9 +4662,9 @@ const Select = /*#__PURE__*/React.forwardRef((_a, ref) => {
4637
4662
  [`${validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)}`]: validator
4638
4663
  });
4639
4664
  const describedBy = classNames(ariaDescribedBy, {
4640
- [`${uuid}_info`]: info,
4641
- [`gds-expandable-info-${uuid}`]: expandableInfo,
4642
- [`${uuid}_message`]: (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0
4665
+ [`${uuid}_message`]: (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0,
4666
+ [`${uuid}_info`]: info || props.labelInformation,
4667
+ [`gds-expandable-info-${uuid}`]: expandableInfo
4643
4668
  });
4644
4669
  return jsx(FormItem, Object.assign({
4645
4670
  label: label,
@@ -6506,4 +6531,4 @@ const Table = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef((_a, ref) =
6506
6531
  }));
6507
6532
  }));
6508
6533
 
6509
- export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, ContextMenu, CoreDatepicker, CoreDropdown, CoreMenuHeading, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormContext, FormItem, FormItems, FormProvider, Group, GroupedList, IconButton, InPageWizardStepCard, Input, Link, List$1 as List, ListItem, MenuItem, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, Select, Slider, SortDirection, Stepper, Tab, Table, TableBody, TableCell, TableContext, TableHeader, TableHeaderCell, TableRow, Tabs, Text, TextArea, TextInput, valueList$1 as ValueList, filterArrayByColumns, onRowSelect, paginate, searchTextByColumns, sortArray, sumCols, useFormContext, useTableContext };
6534
+ export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, ContextMenu, CoreDatepicker, CoreDropdown, CoreMenuHeading, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, GroupedList, IconButton, InPageWizardStepCard, Input, Link, List$1 as List, ListItem, MenuItem, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, Select, Slider, SortDirection, Stepper, Tab, Table, TableBody, TableCell, TableContext, TableHeader, TableHeaderCell, TableRow, Tabs, Text, TextArea, TextInput, valueList$1 as ValueList, filterArrayByColumns, onRowSelect, paginate, searchTextByColumns, sortArray, sumCols, useTableContext };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "3.5.1",
3
+ "version": "3.5.3",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/green-core": "^1.10.0",
10
- "@sebgroup/chlorophyll": "^3.1.1",
9
+ "@sebgroup/green-core": "^1.11.0",
10
+ "@sebgroup/chlorophyll": "^3.3.1",
11
11
  "@sebgroup/extract": "^3.0.1",
12
12
  "@lit/react": "^1.0.2",
13
13
  "classnames": "^2.3.2"
@@ -10,4 +10,3 @@ export * from './text/text';
10
10
  export * from './radioButton/radioButton';
11
11
  export * from './radioButton/radioGroup';
12
12
  export * from './textarea/textarea';
13
- export * from './formContext';
@@ -6,9 +6,25 @@ interface ValueListProps {
6
6
  interface ValueListItemProps {
7
7
  children: string;
8
8
  }
9
+ /**
10
+ * @deprecated
11
+ * Use `GroupedList` instead.
12
+ */
9
13
  export declare const Label: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
14
+ /**
15
+ * @deprecated
16
+ * Use `GroupedList` instead.
17
+ */
10
18
  export declare const Value: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * @deprecated
21
+ * Use `GroupedList` instead.
22
+ */
11
23
  export declare const List: ({ children, inverted }: ValueListProps) => import("react/jsx-runtime").JSX.Element;
24
+ /**
25
+ * @deprecated
26
+ * Use `GroupedList` instead.
27
+ */
12
28
  declare const _default: {
13
29
  List: ({ children, inverted }: ValueListProps) => import("react/jsx-runtime").JSX.Element;
14
30
  Label: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;