@purpurds/checkbox 3.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.
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+ export type CheckedState = boolean | "indeterminate";
3
+ export type CheckboxProps = {
4
+ /**
5
+ * To use when no label is given (not recommended).
6
+ * */
7
+ ["aria-label"]?: string;
8
+ /**
9
+ * To use with custom label (not recommended).
10
+ * */
11
+ ["aria-labelledby"]?: string;
12
+ ["data-testid"]?: string;
13
+ checked?: CheckedState;
14
+ /**
15
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
20
+ */
21
+ defaultChecked?: boolean;
22
+ /**
23
+ * When `true`, prevents the user from interacting with the checkbox.
24
+ */
25
+ disabled?: boolean;
26
+ /**
27
+ * Use to render error message below the checkbox. The checkbox renders with error appearance.
28
+ * */
29
+ errorText?: string;
30
+ /**
31
+ * ID of the checkbox.
32
+ * */
33
+ id: string;
34
+ /**
35
+ * The label of the checkbox.
36
+ * */
37
+ label?: string;
38
+ /**
39
+ * The name of the checkbox. Submitted with its owning form as part of a name/value pair.
40
+ * */
41
+ name?: string;
42
+ /**
43
+ * Event handler called when the checked state of the checkbox changes.
44
+ * */
45
+ onChange?: (value: CheckedState) => void;
46
+ /**
47
+ * When `true`, indicates that the user must check the checkbox before the owning form can be submitted.
48
+ * */
49
+ required?: boolean;
50
+ /**
51
+ * The value given as data when submitted with a name.
52
+ * */
53
+ value?: string;
54
+ };
55
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
56
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../src/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAUxD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG;IAC1B;;SAEK;IACL,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC;IACxB;;SAEK;IACL,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAC;IAC7B,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;SAEK;IACL,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;SAEK;IACL,EAAE,EAAE,MAAM,CAAC;IACX;;SAEK;IACL,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;SAEK;IACL,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;SAEK;IACL,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC;;SAEK;IACL,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;SAEK;IACL,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuEF,eAAO,MAAM,QAAQ,yFAAgC,CAAC"}