@bonprix-ds/react-checkbox-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 +44 -0
- package/dist/index.js +3445 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SelectionControlGroupProps } from '@bonprix-ds/internal-components';
|
|
3
|
+
|
|
4
|
+
declare const CheckboxGroup: FC<CheckboxGroupProps> & Subcomponents;
|
|
5
|
+
export default CheckboxGroup;
|
|
6
|
+
|
|
7
|
+
declare interface CheckboxGroupBaseProps extends Omit<SelectionControlGroupProps, "componentName" | "divider" | "horizontalPadding"> {
|
|
8
|
+
/** The caption for the checkbox group. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The name of the checkbox group. Will be used as the `name` attribute for every item. */
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const CheckboxGroupItem: FC<CheckboxGroupItemProps>;
|
|
15
|
+
|
|
16
|
+
declare interface CheckboxGroupItemProps {
|
|
17
|
+
/** Value of the checkbox group item, which will be submitted. Defaults to the label if not provided. */
|
|
18
|
+
value?: string;
|
|
19
|
+
/** The label for the checkbox group item. */
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare type CheckboxGroupProps = ControlledCheckboxGroupProps | UncontrolledCheckboxGroupProps;
|
|
24
|
+
|
|
25
|
+
declare interface ControlledCheckboxGroupProps extends CheckboxGroupBaseProps {
|
|
26
|
+
/** The current values of the checkbox group. Should be used in conjunction with `onChange`, when controlling the values. Should be `undefined` otherwise. */
|
|
27
|
+
values: string[];
|
|
28
|
+
/** The default values of the checkbox group. Should be used when the checkbox group is uncontrolled. */
|
|
29
|
+
defaultValues?: never;
|
|
30
|
+
/** Callback function that is called when the checkbox group state changes. `values` should be adjusted appropriately. */
|
|
31
|
+
onChange: (value: string[]) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare interface Subcomponents {
|
|
35
|
+
Item: typeof CheckboxGroupItem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare interface UncontrolledCheckboxGroupProps extends CheckboxGroupBaseProps {
|
|
39
|
+
values?: never;
|
|
40
|
+
defaultValues: string[];
|
|
41
|
+
onChange?: (value: string[]) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { }
|