@fluentui/react-checkbox 9.0.0-beta.1 → 9.0.0-beta.5

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.
Files changed (37) hide show
  1. package/CHANGELOG.json +197 -1
  2. package/CHANGELOG.md +57 -2
  3. package/dist/react-checkbox.d.ts +18 -31
  4. package/lib/common/isConformant.js +1 -1
  5. package/lib/common/isConformant.js.map +1 -1
  6. package/lib/components/Checkbox/Checkbox.js +2 -2
  7. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  8. package/lib/components/Checkbox/Checkbox.types.d.ts +14 -24
  9. package/lib/components/Checkbox/DefaultIcons.js +8 -8
  10. package/lib/components/Checkbox/DefaultIcons.js.map +1 -1
  11. package/lib/components/Checkbox/renderCheckbox.js +5 -7
  12. package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
  13. package/lib/components/Checkbox/useCheckbox.d.ts +3 -7
  14. package/lib/components/Checkbox/useCheckbox.js +50 -42
  15. package/lib/components/Checkbox/useCheckbox.js.map +1 -1
  16. package/lib/components/Checkbox/useCheckboxStyles.d.ts +1 -0
  17. package/lib/components/Checkbox/useCheckboxStyles.js +45 -46
  18. package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
  19. package/lib-commonjs/Checkbox.js +1 -1
  20. package/lib-commonjs/common/isConformant.js +3 -3
  21. package/lib-commonjs/common/isConformant.js.map +1 -1
  22. package/lib-commonjs/components/Checkbox/Checkbox.js +6 -6
  23. package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
  24. package/lib-commonjs/components/Checkbox/Checkbox.types.d.ts +14 -24
  25. package/lib-commonjs/components/Checkbox/DefaultIcons.js +9 -9
  26. package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +1 -1
  27. package/lib-commonjs/components/Checkbox/index.js +1 -1
  28. package/lib-commonjs/components/Checkbox/renderCheckbox.js +7 -9
  29. package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
  30. package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +3 -7
  31. package/lib-commonjs/components/Checkbox/useCheckbox.js +54 -46
  32. package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
  33. package/lib-commonjs/components/Checkbox/useCheckboxStyles.d.ts +1 -0
  34. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +48 -49
  35. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
  36. package/lib-commonjs/index.js +1 -1
  37. package/package.json +7 -8
package/CHANGELOG.json CHANGED
@@ -2,7 +2,203 @@
2
2
  "name": "@fluentui/react-checkbox",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 06 Oct 2021 10:36:00 GMT",
5
+ "date": "Thu, 25 Nov 2021 08:31:31 GMT",
6
+ "tag": "@fluentui/react-checkbox_v9.0.0-beta.5",
7
+ "version": "9.0.0-beta.5",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "behowell@microsoft.com",
12
+ "package": "@fluentui/react-checkbox",
13
+ "commit": "99adff5a9aab9086e8bc4737040654ab23f0febe",
14
+ "comment": "Implement primary slot: 'input' is now the primary slot and receives native props passed to Checkbox"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-checkbox",
19
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4",
20
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-checkbox",
25
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4",
26
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-checkbox",
31
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.4",
32
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-checkbox",
37
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-beta.5",
38
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-checkbox",
43
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4",
44
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-checkbox",
49
+ "comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4",
50
+ "commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Fri, 12 Nov 2021 13:25:18 GMT",
57
+ "tag": "@fluentui/react-checkbox_v9.0.0-beta.4",
58
+ "version": "9.0.0-beta.4",
59
+ "comments": {
60
+ "none": [
61
+ {
62
+ "author": "lingfangao@hotmail.com",
63
+ "package": "@fluentui/react-checkbox",
64
+ "commit": "00f70581480b536e723fb69edf0ae617beac4807",
65
+ "comment": "Remove beta release tag"
66
+ },
67
+ {
68
+ "author": "olfedias@microsoft.com",
69
+ "package": "@fluentui/react-checkbox",
70
+ "commit": "9186578324773f95f4d61be3d70e67752159d843",
71
+ "comment": "update snapshots"
72
+ }
73
+ ],
74
+ "prerelease": [
75
+ {
76
+ "author": "olfedias@microsoft.com",
77
+ "package": "@fluentui/react-checkbox",
78
+ "commit": "7eb7d2daebaa11dbdcd555b0b962407013a7ca80",
79
+ "comment": "export static classes for components"
80
+ },
81
+ {
82
+ "author": "gcox@microsoft.com",
83
+ "package": "@fluentui/react-checkbox",
84
+ "commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
85
+ "comment": "Updated beta and RC components to ES2019"
86
+ },
87
+ {
88
+ "author": "beachball",
89
+ "package": "@fluentui/react-checkbox",
90
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3",
91
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
92
+ },
93
+ {
94
+ "author": "beachball",
95
+ "package": "@fluentui/react-checkbox",
96
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3",
97
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
98
+ },
99
+ {
100
+ "author": "beachball",
101
+ "package": "@fluentui/react-checkbox",
102
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.3",
103
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
104
+ },
105
+ {
106
+ "author": "beachball",
107
+ "package": "@fluentui/react-checkbox",
108
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-beta.4",
109
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
110
+ },
111
+ {
112
+ "author": "beachball",
113
+ "package": "@fluentui/react-checkbox",
114
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3",
115
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
116
+ },
117
+ {
118
+ "author": "beachball",
119
+ "package": "@fluentui/react-checkbox",
120
+ "comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3",
121
+ "commit": "742342e52c65066f779232e4e1302fedf0dd460d"
122
+ }
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ "date": "Wed, 27 Oct 2021 12:14:16 GMT",
128
+ "tag": "@fluentui/react-checkbox_v9.0.0-beta.3",
129
+ "version": "9.0.0-beta.3",
130
+ "comments": {
131
+ "prerelease": [
132
+ {
133
+ "author": "peter@draxler.ml",
134
+ "package": "@fluentui/react-checkbox",
135
+ "commit": "f6db7c8d6b7db0902775e7857b62b745be35b59a",
136
+ "comment": "added styling of documentation"
137
+ },
138
+ {
139
+ "author": "beachball",
140
+ "package": "@fluentui/react-checkbox",
141
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.2",
142
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
143
+ },
144
+ {
145
+ "author": "beachball",
146
+ "package": "@fluentui/react-checkbox",
147
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-beta.2",
148
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
149
+ },
150
+ {
151
+ "author": "beachball",
152
+ "package": "@fluentui/react-checkbox",
153
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.2",
154
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
155
+ },
156
+ {
157
+ "author": "beachball",
158
+ "package": "@fluentui/react-checkbox",
159
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-beta.3",
160
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
161
+ },
162
+ {
163
+ "author": "beachball",
164
+ "package": "@fluentui/react-checkbox",
165
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2",
166
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
167
+ },
168
+ {
169
+ "author": "beachball",
170
+ "package": "@fluentui/react-checkbox",
171
+ "comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2",
172
+ "commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
173
+ }
174
+ ],
175
+ "none": [
176
+ {
177
+ "author": "ndresx@gmail.com",
178
+ "package": "@fluentui/react-checkbox",
179
+ "commit": "d8162eddd0a6ba0893a7984b8244a033f5cb0f39",
180
+ "comment": "Migrate react-checkbox tests to rtl"
181
+ }
182
+ ]
183
+ }
184
+ },
185
+ {
186
+ "date": "Tue, 12 Oct 2021 19:45:58 GMT",
187
+ "tag": "@fluentui/react-checkbox_v9.0.0-beta.2",
188
+ "version": "9.0.0-beta.2",
189
+ "comments": {
190
+ "prerelease": [
191
+ {
192
+ "author": "beachball",
193
+ "package": "@fluentui/react-checkbox",
194
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-beta.2",
195
+ "commit": "bdd19e2bb827fc1d8eb329e6ed48cd0542048358"
196
+ }
197
+ ]
198
+ }
199
+ },
200
+ {
201
+ "date": "Wed, 06 Oct 2021 10:37:22 GMT",
6
202
  "tag": "@fluentui/react-checkbox_v9.0.0-beta.1",
7
203
  "version": "9.0.0-beta.1",
8
204
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,67 @@
1
1
  # Change Log - @fluentui/react-checkbox
2
2
 
3
- This log was last generated on Wed, 06 Oct 2021 10:36:00 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 25 Nov 2021 08:31:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-beta.5)
8
+
9
+ Thu, 25 Nov 2021 08:31:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-beta.4..@fluentui/react-checkbox_v9.0.0-beta.5)
11
+
12
+ ### Changes
13
+
14
+ - Implement primary slot: 'input' is now the primary slot and receives native props passed to Checkbox ([PR #20617](https://github.com/microsoft/fluentui/pull/20617) by behowell@microsoft.com)
15
+ - Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
17
+ - Bump @fluentui/react-label to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.0.0-beta.5 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
19
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
20
+ - Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
21
+
22
+ ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-beta.4)
23
+
24
+ Fri, 12 Nov 2021 13:25:18 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-beta.3..@fluentui/react-checkbox_v9.0.0-beta.4)
26
+
27
+ ### Changes
28
+
29
+ - export static classes for components ([PR #20454](https://github.com/microsoft/fluentui/pull/20454) by olfedias@microsoft.com)
30
+ - Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
31
+ - Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
32
+ - Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
33
+ - Bump @fluentui/react-label to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
34
+ - Bump @fluentui/react-tabster to v9.0.0-beta.4 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
35
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
36
+ - Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
37
+
38
+ ## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-beta.3)
39
+
40
+ Wed, 27 Oct 2021 12:14:16 GMT
41
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-beta.2..@fluentui/react-checkbox_v9.0.0-beta.3)
42
+
43
+ ### Changes
44
+
45
+ - added styling of documentation ([PR #20193](https://github.com/microsoft/fluentui/pull/20193) by peter@draxler.ml)
46
+ - Bump @fluentui/react-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
47
+ - Bump @fluentui/react-utilities to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
48
+ - Bump @fluentui/react-label to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
49
+ - Bump @fluentui/react-tabster to v9.0.0-beta.3 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
50
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
51
+ - Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
52
+
53
+ ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-beta.2)
54
+
55
+ Tue, 12 Oct 2021 19:45:58 GMT
56
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-beta.1..@fluentui/react-checkbox_v9.0.0-beta.2)
57
+
58
+ ### Changes
59
+
60
+ - Bump @fluentui/react-tabster to v9.0.0-beta.2 ([PR #20132](https://github.com/microsoft/fluentui/pull/20132) by beachball)
61
+
7
62
  ## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-beta.1)
8
63
 
9
- Wed, 06 Oct 2021 10:36:00 GMT
64
+ Wed, 06 Oct 2021 10:37:22 GMT
10
65
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.48..@fluentui/react-checkbox_v9.0.0-beta.1)
11
66
 
12
67
  ### Changes
@@ -11,20 +11,13 @@ import * as React_2 from 'react';
11
11
  */
12
12
  export declare const Checkbox: ForwardRefComponent<CheckboxProps>;
13
13
 
14
- /**
15
- * TODO:
16
- * - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.
17
- * - Instead of extending LabelProps, extend LabelCommons once it's added.
18
- */
14
+ export declare const checkboxClassName = "fui-Checkbox";
15
+
19
16
  export declare interface CheckboxCommons {
20
17
  /**
21
18
  * A checkbox can be rendered with a circular shape.
22
19
  */
23
- circular: boolean;
24
- /**
25
- * ID of the root element that wraps the checkbox and label.
26
- */
27
- rootId: string | undefined;
20
+ circular: boolean | undefined;
28
21
  /**
29
22
  * A checkbox's state can be controlled.
30
23
  * @defaultvalue false
@@ -57,11 +50,7 @@ export declare interface CheckboxOnChangeData {
57
50
  /**
58
51
  * Checkbox Props
59
52
  */
60
- export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots>, 'defaultChecked'> & Partial<CheckboxCommons> & {
61
- /**
62
- * ID of the native element that represents the checkbox.
63
- */
64
- id?: string;
53
+ export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots, 'input'>, 'size' | 'checked' | 'defaultChecked'> & Partial<CheckboxCommons> & {
65
54
  /**
66
55
  * Callback to be called when the checked state value changes.
67
56
  */
@@ -70,25 +59,21 @@ export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots>, 'default
70
59
  * Whether the checkbox should be rendered as checked by default.
71
60
  */
72
61
  defaultChecked?: 'mixed' | boolean;
73
- /**
74
- * Required state of the checkbox.
75
- */
76
- required?: boolean;
77
- /**
78
- * Disabled
79
- */
80
- disabled?: boolean;
81
62
  };
82
63
 
83
- /**
84
- * Array of all shorthand properties listed as the keys of CheckboxSlots
85
- */
86
- export declare const checkboxShorthandProps: Array<keyof CheckboxSlots>;
87
-
88
64
  export declare type CheckboxSlots = {
65
+ /**
66
+ * The root element of the checkbox is its `<label>`.
67
+ *
68
+ * The root slot receives the `className` and `style` specified directly on the `<Checkbox>`.
69
+ * All other native props will be applied to the primary slot: `input`
70
+ */
89
71
  root: ObjectShorthandProps<LabelProps> | IntrinsicShorthandProps<'span'>;
90
72
  /**
91
73
  * Hidden input that handles the checkbox's functionality.
74
+ *
75
+ * This is the PRIMARY slot: all native properties specified directly on `<Checkbox>` will be applied to this slot,
76
+ * except `className` and `style`, which remain on the root slot.
92
77
  */
93
78
  input: IntrinsicShorthandProps<'input'>;
94
79
  /**
@@ -100,7 +85,9 @@ export declare type CheckboxSlots = {
100
85
  /**
101
86
  * State used in rendering Checkbox
102
87
  */
103
- export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons;
88
+ export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons & {
89
+ hasLabel: boolean;
90
+ };
104
91
 
105
92
  export declare const renderCheckbox: (state: CheckboxState) => JSX.Element;
106
93
 
@@ -111,9 +98,9 @@ export declare const renderCheckbox: (state: CheckboxState) => JSX.Element;
111
98
  * before being passed to renderCheckbox.
112
99
  *
113
100
  * @param props - props from this instance of Checkbox
114
- * @param ref - reference to root HTMLElement of Checkbox
101
+ * @param ref - reference to `<input>` element of Checkbox
115
102
  */
116
- export declare const useCheckbox: (props: CheckboxProps, ref: React_2.Ref<HTMLElement>) => CheckboxState;
103
+ export declare const useCheckbox: (props: CheckboxProps, ref: React_2.Ref<HTMLInputElement>) => CheckboxState;
117
104
 
118
105
  /**
119
106
  * Apply styling to the Checkbox slots based on the state
@@ -1,7 +1,7 @@
1
1
  import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
2
  import makeStylesTests from '@fluentui/react-conformance-make-styles';
3
3
  export function isConformant(testInfo) {
4
- var defaultOptions = {
4
+ const defaultOptions = {
5
5
  asPropHandlesRef: true,
6
6
  componentPath: module.parent.filename.replace('.test', ''),
7
7
  extraTests: makeStylesTests,
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAmC,MAAM,6BAA6B,CAAC;AAChH,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAEtE,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5D,UAAU,EAAE,eAAqC;QACjD,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAmC,MAAM,6BAA6B,CAAC;AAChH,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAEtE,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,MAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5D,UAAU,EAAE,eAAqC;QACjD,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
@@ -5,8 +5,8 @@ import { useCheckboxStyles } from './useCheckboxStyles';
5
5
  /**
6
6
  * A Checkbox component provides a way to represent options that can be selected
7
7
  */
8
- export var Checkbox = React.forwardRef(function (props, ref) {
9
- var state = useCheckbox(props, ref);
8
+ export const Checkbox = React.forwardRef((props, ref) => {
9
+ const state = useCheckbox(props, ref);
10
10
  useCheckboxStyles(state);
11
11
  return renderCheckbox(state);
12
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAuC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;IACtF,IAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAuC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -1,20 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
3
3
  import { LabelProps } from '@fluentui/react-label';
4
- /**
5
- * TODO:
6
- * - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.
7
- * - Instead of extending LabelProps, extend LabelCommons once it's added.
8
- */
9
4
  export interface CheckboxCommons {
10
5
  /**
11
6
  * A checkbox can be rendered with a circular shape.
12
7
  */
13
- circular: boolean;
14
- /**
15
- * ID of the root element that wraps the checkbox and label.
16
- */
17
- rootId: string | undefined;
8
+ circular: boolean | undefined;
18
9
  /**
19
10
  * A checkbox's state can be controlled.
20
11
  * @defaultvalue false
@@ -43,9 +34,18 @@ export interface CheckboxOnChangeData {
43
34
  checked: 'mixed' | boolean;
44
35
  }
45
36
  export declare type CheckboxSlots = {
37
+ /**
38
+ * The root element of the checkbox is its `<label>`.
39
+ *
40
+ * The root slot receives the `className` and `style` specified directly on the `<Checkbox>`.
41
+ * All other native props will be applied to the primary slot: `input`
42
+ */
46
43
  root: ObjectShorthandProps<LabelProps> | IntrinsicShorthandProps<'span'>;
47
44
  /**
48
45
  * Hidden input that handles the checkbox's functionality.
46
+ *
47
+ * This is the PRIMARY slot: all native properties specified directly on `<Checkbox>` will be applied to this slot,
48
+ * except `className` and `style`, which remain on the root slot.
49
49
  */
50
50
  input: IntrinsicShorthandProps<'input'>;
51
51
  /**
@@ -56,11 +56,7 @@ export declare type CheckboxSlots = {
56
56
  /**
57
57
  * Checkbox Props
58
58
  */
59
- export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots>, 'defaultChecked'> & Partial<CheckboxCommons> & {
60
- /**
61
- * ID of the native element that represents the checkbox.
62
- */
63
- id?: string;
59
+ export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots, 'input'>, 'size' | 'checked' | 'defaultChecked'> & Partial<CheckboxCommons> & {
64
60
  /**
65
61
  * Callback to be called when the checked state value changes.
66
62
  */
@@ -69,16 +65,10 @@ export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots>, 'default
69
65
  * Whether the checkbox should be rendered as checked by default.
70
66
  */
71
67
  defaultChecked?: 'mixed' | boolean;
72
- /**
73
- * Required state of the checkbox.
74
- */
75
- required?: boolean;
76
- /**
77
- * Disabled
78
- */
79
- disabled?: boolean;
80
68
  };
81
69
  /**
82
70
  * State used in rendering Checkbox
83
71
  */
84
- export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons;
72
+ export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons & {
73
+ hasLabel: boolean;
74
+ };
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- export var Mixed12Regular = function () { return (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
3
- React.createElement("rect", { width: "8", height: "8", x: "2", y: "2" }))); };
4
- export var Mixed16Regular = function () { return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
5
- React.createElement("rect", { width: "10", height: "10", x: "3", y: "3" }))); };
6
- export var Checkmark12Regular = function () { return (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
7
- React.createElement("path", { d: "M9.85355 3.14645C10.0488 3.34171 10.0488 3.65829 9.85355 3.85355L5.35355 8.35355C5.15829 8.54882 4.84171 8.54882 4.64645 8.35355L2.64645 6.35355C2.45118 6.15829 2.45118 5.84171 2.64645 5.64645C2.84171 5.45118 3.15829 5.45118 3.35355 5.64645L5 7.29289L9.14645 3.14645C9.34171 2.95118 9.65829 2.95118 9.85355 3.14645Z" }))); };
8
- export var Checkmark16Regular = function () { return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
9
- React.createElement("path", { d: "M13.8639 3.65609C14.0533 3.85704 14.0439 4.17348 13.8429 4.36288L5.91309 11.8368C5.67573 12.0605 5.30311 12.0536 5.07417 11.8213L2.39384 9.10093C2.20003 8.90422 2.20237 8.58765 2.39907 8.39384C2.59578 8.20003 2.91235 8.20237 3.10616 8.39908L5.51192 10.8407L13.1571 3.63517C13.358 3.44577 13.6745 3.45513 13.8639 3.65609Z" }))); };
2
+ export const Mixed12Regular = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
3
+ React.createElement("rect", { width: "8", height: "8", x: "2", y: "2" })));
4
+ export const Mixed16Regular = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
5
+ React.createElement("rect", { width: "10", height: "10", x: "3", y: "3" })));
6
+ export const Checkmark12Regular = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
7
+ React.createElement("path", { d: "M9.85355 3.14645C10.0488 3.34171 10.0488 3.65829 9.85355 3.85355L5.35355 8.35355C5.15829 8.54882 4.84171 8.54882 4.64645 8.35355L2.64645 6.35355C2.45118 6.15829 2.45118 5.84171 2.64645 5.64645C2.84171 5.45118 3.15829 5.45118 3.35355 5.64645L5 7.29289L9.14645 3.14645C9.34171 2.95118 9.65829 2.95118 9.85355 3.14645Z" })));
8
+ export const Checkmark16Regular = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
9
+ React.createElement("path", { d: "M13.8639 3.65609C14.0533 3.85704 14.0439 4.17348 13.8429 4.36288L5.91309 11.8368C5.67573 12.0605 5.30311 12.0536 5.07417 11.8213L2.39384 9.10093C2.20003 8.90422 2.20237 8.58765 2.39907 8.39384C2.59578 8.20003 2.91235 8.20237 3.10616 8.39908L5.51192 10.8407L13.1571 3.63517C13.358 3.44577 13.6745 3.45513 13.8639 3.65609Z" })));
10
10
  //# sourceMappingURL=DefaultIcons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultIcons.js","sourceRoot":"","sources":["../../../src/components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,IAAM,cAAc,GAAG,cAAM,OAAA,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACrC,CACP,EAJmC,CAInC,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,cAAM,OAAA,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACvC,CACP,EAJmC,CAInC,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG,cAAM,OAAA,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,6TAA6T,GAAG,CACpU,CACP,EAJuC,CAIvC,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG,cAAM,OAAA,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,kUAAkU,GAAG,CACzU,CACP,EAJuC,CAIvC,CAAC"}
1
+ {"version":3,"file":"DefaultIcons.js","sourceRoot":"","sources":["../../../src/components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACrC,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACvC,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,6TAA6T,GAAG,CACpU,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,kUAAkU,GAAG,CACzU,CACP,CAAC"}
@@ -1,14 +1,12 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
- import { checkboxShorthandProps } from './useCheckbox';
5
- export var renderCheckbox = function (state) {
6
- var _a = getSlots(state, checkboxShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
7
- return (React.createElement(slots.root, __assign({}, slotProps.root),
3
+ export const renderCheckbox = (state) => {
4
+ const { slots, slotProps } = getSlots(state, ['root', 'indicator', 'input']);
5
+ return (React.createElement(slots.root, Object.assign({}, slotProps.root),
8
6
  state.labelPosition === 'before' && slotProps.root.children,
9
7
  React.createElement("div", { className: state.containerClassName },
10
- React.createElement(slots.indicator, __assign({}, slotProps.indicator)),
11
- React.createElement(slots.input, __assign({}, slotProps.input))),
8
+ React.createElement(slots.indicator, Object.assign({}, slotProps.indicator)),
9
+ React.createElement(slots.input, Object.assign({}, slotProps.input))),
12
10
  state.labelPosition === 'after' && slotProps.root.children));
13
11
  };
14
12
  //# sourceMappingURL=renderCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,QAAQ,CAAgB,KAAK,EAAE,sBAAsB,CAAC,EAA3E,KAAK,WAAA,EAAE,SAAS,eAA2D,CAAC;IAEpF,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ;QAC5D,6BAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB;YACtC,oBAAC,KAAK,CAAC,SAAS,eAAK,SAAS,CAAC,SAAS,EAAI;YAC5C,oBAAC,KAAK,CAAC,KAAK,eAAK,SAAS,CAAC,KAAK,EAAI,CAChC;QACL,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAChD,CACd,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"renderCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAoB,EAAE,EAAE;IACrD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAgB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5F,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,oBAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ;QAC5D,6BAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB;YACtC,oBAAC,KAAK,CAAC,SAAS,oBAAK,SAAS,CAAC,SAAS,EAAI;YAC5C,oBAAC,KAAK,CAAC,KAAK,oBAAK,SAAS,CAAC,KAAK,EAAI,CAChC;QACL,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAChD,CACd,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +1,5 @@
1
1
  import * as React from 'react';
2
- import { CheckboxProps, CheckboxSlots, CheckboxState } from './Checkbox.types';
3
- /**
4
- * Array of all shorthand properties listed as the keys of CheckboxSlots
5
- */
6
- export declare const checkboxShorthandProps: Array<keyof CheckboxSlots>;
2
+ import { CheckboxProps, CheckboxState } from './Checkbox.types';
7
3
  /**
8
4
  * Create the state required to render Checkbox.
9
5
  *
@@ -11,6 +7,6 @@ export declare const checkboxShorthandProps: Array<keyof CheckboxSlots>;
11
7
  * before being passed to renderCheckbox.
12
8
  *
13
9
  * @param props - props from this instance of Checkbox
14
- * @param ref - reference to root HTMLElement of Checkbox
10
+ * @param ref - reference to `<input>` element of Checkbox
15
11
  */
16
- export declare const useCheckbox: (props: CheckboxProps, ref: React.Ref<HTMLElement>) => CheckboxState;
12
+ export declare const useCheckbox: (props: CheckboxProps, ref: React.Ref<HTMLInputElement>) => CheckboxState;