@bonprix-ds/react-radio-group 1.0.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/dist/index.d.ts +39 -0
- package/dist/index.js +4282 -0
- package/dist/index.js.map +1 -0
- package/dist/react-radio-group.css +2 -0
- package/package.json +51 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ControlGroupProps } from '@bonprix-ds/utils';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
declare interface ControlledInputProps extends Omit<ControlGroupProps, "componentName"> {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare interface Props {
|
|
12
|
+
/** The value of the radio button. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** The label of the radio button. */
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
/** Suffix that will be placed on the far right side inside the `<label>` to further visualize the item's value, e.g. with icon(s) or logo(s). Make sure to only include allowed children here to avoid irregular HTML markup. */
|
|
17
|
+
suffix?: ReactNode;
|
|
18
|
+
/** Additional content to be displayed when item is selected. */
|
|
19
|
+
additional?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const RadioGroup: FC<RadioGroupProps> & Subcomponents;
|
|
23
|
+
export default RadioGroup;
|
|
24
|
+
|
|
25
|
+
declare const RadioGroupItem: ({ value, label, additional, suffix }: Props) => default_2.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export declare type RadioGroupProps = ControlledInputProps | UncontrolledInputProps;
|
|
28
|
+
|
|
29
|
+
declare interface Subcomponents {
|
|
30
|
+
Item: typeof RadioGroupItem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare interface UncontrolledInputProps extends Omit<ControlGroupProps, "componentName"> {
|
|
34
|
+
value?: never;
|
|
35
|
+
defaultValue: string;
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { }
|