@transferwise/components 46.58.1 → 46.59.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.
@@ -9,7 +9,8 @@ function RadioGroup({
9
9
  name,
10
10
  radios,
11
11
  selectedValue: controlledValue,
12
- onChange
12
+ onChange,
13
+ UNSAFE_inputAttributes
13
14
  }) {
14
15
  const inputAttributes = contexts.useInputAttributes({
15
16
  nonLabelable: true
@@ -18,6 +19,7 @@ function RadioGroup({
18
19
  return radios.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
19
20
  role: "radiogroup",
20
21
  ...inputAttributes,
22
+ ...UNSAFE_inputAttributes,
21
23
  children: radios.map(({
22
24
  value = '',
23
25
  ...restProps
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;;;AAkBwB,SAAAA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;AAC9BC,EAAAA,QAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE,IAAA;AAAM,GAAA,CAAC,CAAA;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,cAAQ,CAACP,eAAe,CAAC,CAAA;AAE3E,EAAA,OAAOF,MAAM,CAACU,MAAM,GAAG,CAAC,gBACtBC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAAS,IAAAA,QAAA,EACvCb,MAAM,CAACc,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC,SAAAA;AAAS,KAAE,EAAEC,KAAK,kBACnDN,cAAA,CAACO,KAAAA;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACbjB,MAAAA,IAAI,EAAEA,IAAK;AACXgB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCJ,QAAQ,EAAGiB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC,CAAA;QAC/BjB,QAAQ,CAACiB,SAAS,CAAC,CAAA;AACrB,OAAA;AAAE,KAAA,EARGH,KAQH,CAEL,CAAA;GACE,CAAC,GACJ,IAAI,CAAA;AACV;;;;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA,sBAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE,IAAA;AAAM,GAAA,CAAC,CAAA;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,cAAQ,CAACR,eAAe,CAAC,CAAA;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC,SAAAA;AAAS,KAAE,EAAEC,KAAK,kBACnDN,cAAA,CAACO,KAAAA;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC,CAAA;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC,CAAA;AACrB,OAAA;AAAE,KAAA,EARGH,KAQH,CAEL,CAAA;GACE,CAAC,GACJ,IAAI,CAAA;AACV;;;;"}
@@ -7,7 +7,8 @@ function RadioGroup({
7
7
  name,
8
8
  radios,
9
9
  selectedValue: controlledValue,
10
- onChange
10
+ onChange,
11
+ UNSAFE_inputAttributes
11
12
  }) {
12
13
  const inputAttributes = useInputAttributes({
13
14
  nonLabelable: true
@@ -16,6 +17,7 @@ function RadioGroup({
16
17
  return radios.length > 0 ? /*#__PURE__*/jsx("div", {
17
18
  role: "radiogroup",
18
19
  ...inputAttributes,
20
+ ...UNSAFE_inputAttributes,
19
21
  children: radios.map(({
20
22
  value = '',
21
23
  ...restProps
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.mjs","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;AAkBwB,SAAAA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;AAC9BC,EAAAA,QAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE,IAAA;AAAM,GAAA,CAAC,CAAA;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,QAAQ,CAACP,eAAe,CAAC,CAAA;AAE3E,EAAA,OAAOF,MAAM,CAACU,MAAM,GAAG,CAAC,gBACtBC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAAS,IAAAA,QAAA,EACvCb,MAAM,CAACc,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC,SAAAA;AAAS,KAAE,EAAEC,KAAK,kBACnDN,GAAA,CAACO,KAAAA;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACbjB,MAAAA,IAAI,EAAEA,IAAK;AACXgB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCJ,QAAQ,EAAGiB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC,CAAA;QAC/BjB,QAAQ,CAACiB,SAAS,CAAC,CAAA;AACrB,OAAA;AAAE,KAAA,EARGH,KAQH,CAEL,CAAA;GACE,CAAC,GACJ,IAAI,CAAA;AACV;;;;"}
1
+ {"version":3,"file":"RadioGroup.mjs","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA,sBAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE,IAAA;AAAM,GAAA,CAAC,CAAA;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,QAAQ,CAACR,eAAe,CAAC,CAAA;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC,SAAAA;AAAS,KAAE,EAAEC,KAAK,kBACnDN,GAAA,CAACO,KAAAA;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC,CAAA;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC,CAAA;AACrB,OAAA;AAAE,KAAA,EARGH,KAQH,CAEL,CAAA;GACE,CAAC,GACJ,IAAI,CAAA;AACV;;;;"}
@@ -1,10 +1,12 @@
1
1
  import { RadioProps } from '../radio/Radio';
2
+ import { WithInputAttributesProps } from '../inputs/contexts';
2
3
  export type RadioGroupRadio<T extends string | number = string> = Omit<RadioProps<T>, 'name' | 'checked' | 'onChange' | 'className'>;
3
4
  export interface RadioGroupProps<T extends string | number = string> {
4
5
  name: string;
5
6
  radios: readonly RadioGroupRadio<T>[];
6
7
  selectedValue?: T;
7
8
  onChange: NonNullable<RadioProps<T>['onChange']>;
9
+ UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];
8
10
  }
9
- export default function RadioGroup<T extends string | number = never>({ name, radios, selectedValue: controlledValue, onChange, }: RadioGroupProps<T>): import("react").JSX.Element | null;
11
+ export default function RadioGroup<T extends string | number = never>({ name, radios, selectedValue: controlledValue, onChange, UNSAFE_inputAttributes, }: RadioGroupProps<T>): import("react").JSX.Element | null;
10
12
  //# sourceMappingURL=RadioGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/radioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI,IAAI,CACpE,UAAU,CAAC,CAAC,CAAC,EACb,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAC9C,CAAC;AAEF,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,KAAK,EAAE,EACpE,IAAI,EACJ,MAAM,EACN,aAAa,EAAE,eAAe,EAC9B,QAAQ,GACT,EAAE,eAAe,CAAC,CAAC,CAAC,sCAuBpB"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/radioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAsB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAElF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI,IAAI,CACpE,UAAU,CAAC,CAAC,CAAC,EACb,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAC9C,CAAC;AAEF,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IACjD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;CACtE;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,KAAK,EAAE,EACpE,IAAI,EACJ,MAAM,EACN,aAAa,EAAE,eAAe,EAC9B,QAAQ,EACR,sBAAsB,GACvB,EAAE,eAAe,CAAC,CAAC,CAAC,sCAuBpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.58.1",
3
+ "version": "46.59.0",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -92,8 +92,8 @@
92
92
  "rollup": "^4.18.1",
93
93
  "rollup-preserve-directives": "^1.1.1",
94
94
  "storybook": "^8.2.2",
95
- "@transferwise/less-config": "3.1.0",
96
95
  "@transferwise/neptune-css": "14.13.4",
96
+ "@transferwise/less-config": "3.1.0",
97
97
  "@wise/components-theming": "1.6.0"
98
98
  },
99
99
  "peerDependencies": {
@@ -3,6 +3,7 @@ import { Search } from '@transferwise/icons';
3
3
  import { useRef, useState } from 'react';
4
4
 
5
5
  import ActionButton from '../actionButton';
6
+ import { Field } from '../field/Field';
6
7
 
7
8
  import { Input } from './Input';
8
9
  import { InputGroup } from './InputGroup';
@@ -40,6 +41,13 @@ export const WithSuffix: Story = {
40
41
  args: {
41
42
  disabled: false,
42
43
  },
44
+ decorators: [
45
+ (Story) => (
46
+ <Field label="Label">
47
+ <Story />
48
+ </Field>
49
+ ),
50
+ ],
43
51
  };
44
52
 
45
53
  function InputGroupWithSuffix(args: NonNullable<Story['args']>) {
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { useState } from 'react';
3
3
 
4
4
  import { Size } from '../common';
5
+ import { Field } from '../field/Field';
5
6
 
6
7
  import { SearchInput } from './SearchInput';
7
8
 
@@ -24,6 +25,13 @@ export const Basic: Story = {
24
25
  action: 'changed',
25
26
  },
26
27
  },
28
+ decorators: [
29
+ (Story) => (
30
+ <Field label="Label">
31
+ <Story />
32
+ </Field>
33
+ ),
34
+ ],
27
35
  };
28
36
 
29
37
  function SearchInputBasic({ onChange, ...restProps }: NonNullable<Story['args']>) {
@@ -2,7 +2,7 @@ import { useState } from 'react';
2
2
 
3
3
  import Radio from '../radio';
4
4
  import { RadioProps } from '../radio/Radio';
5
- import { useInputAttributes } from '../inputs/contexts';
5
+ import { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';
6
6
 
7
7
  export type RadioGroupRadio<T extends string | number = string> = Omit<
8
8
  RadioProps<T>,
@@ -14,6 +14,7 @@ export interface RadioGroupProps<T extends string | number = string> {
14
14
  radios: readonly RadioGroupRadio<T>[];
15
15
  selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4
16
16
  onChange: NonNullable<RadioProps<T>['onChange']>;
17
+ UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];
17
18
  }
18
19
 
19
20
  export default function RadioGroup<T extends string | number = never>({
@@ -21,13 +22,14 @@ export default function RadioGroup<T extends string | number = never>({
21
22
  radios,
22
23
  selectedValue: controlledValue,
23
24
  onChange,
25
+ UNSAFE_inputAttributes,
24
26
  }: RadioGroupProps<T>) {
25
27
  const inputAttributes = useInputAttributes({ nonLabelable: true });
26
28
 
27
29
  const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);
28
30
 
29
31
  return radios.length > 0 ? (
30
- <div role="radiogroup" {...inputAttributes}>
32
+ <div role="radiogroup" {...inputAttributes} {...UNSAFE_inputAttributes}>
31
33
  {radios.map(({ value = '' as T, ...restProps }, index) => (
32
34
  <Radio
33
35
  // eslint-disable-next-line react/no-array-index-key