@fluentui/react-checkbox 9.0.0-alpha.35 → 9.0.0-alpha.39

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 (53) hide show
  1. package/CHANGELOG.json +123 -1
  2. package/CHANGELOG.md +47 -2
  3. package/lib/Checkbox.js.map +1 -1
  4. package/lib/common/isConformant.js.map +1 -1
  5. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  6. package/lib/components/Checkbox/Checkbox.types.js.map +1 -1
  7. package/lib/components/Checkbox/DefaultIcons.js.map +1 -1
  8. package/lib/components/Checkbox/index.js.map +1 -1
  9. package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
  10. package/lib/components/Checkbox/useCheckbox.js.map +1 -1
  11. package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib-commonjs/Checkbox.js.map +1 -1
  14. package/lib-commonjs/common/isConformant.js.map +1 -1
  15. package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
  16. package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
  17. package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +1 -1
  18. package/lib-commonjs/components/Checkbox/index.js.map +1 -1
  19. package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
  20. package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
  21. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
  22. package/lib-commonjs/index.js.map +1 -1
  23. package/package.json +9 -9
  24. package/lib-amd/Checkbox.d.ts +0 -1
  25. package/lib-amd/Checkbox.js +0 -6
  26. package/lib-amd/Checkbox.js.map +0 -1
  27. package/lib-amd/common/isConformant.d.ts +0 -4
  28. package/lib-amd/common/isConformant.js +0 -15
  29. package/lib-amd/common/isConformant.js.map +0 -1
  30. package/lib-amd/components/Checkbox/Checkbox.d.ts +0 -6
  31. package/lib-amd/components/Checkbox/Checkbox.js +0 -15
  32. package/lib-amd/components/Checkbox/Checkbox.js.map +0 -1
  33. package/lib-amd/components/Checkbox/Checkbox.types.d.ts +0 -85
  34. package/lib-amd/components/Checkbox/Checkbox.types.js +0 -5
  35. package/lib-amd/components/Checkbox/Checkbox.types.js.map +0 -1
  36. package/lib-amd/components/Checkbox/DefaultIcons.d.ts +0 -4
  37. package/lib-amd/components/Checkbox/DefaultIcons.js +0 -18
  38. package/lib-amd/components/Checkbox/DefaultIcons.js.map +0 -1
  39. package/lib-amd/components/Checkbox/index.d.ts +0 -5
  40. package/lib-amd/components/Checkbox/index.js +0 -10
  41. package/lib-amd/components/Checkbox/index.js.map +0 -1
  42. package/lib-amd/components/Checkbox/renderCheckbox.d.ts +0 -2
  43. package/lib-amd/components/Checkbox/renderCheckbox.js +0 -16
  44. package/lib-amd/components/Checkbox/renderCheckbox.js.map +0 -1
  45. package/lib-amd/components/Checkbox/useCheckbox.d.ts +0 -16
  46. package/lib-amd/components/Checkbox/useCheckbox.js +0 -81
  47. package/lib-amd/components/Checkbox/useCheckbox.js.map +0 -1
  48. package/lib-amd/components/Checkbox/useCheckboxStyles.d.ts +0 -5
  49. package/lib-amd/components/Checkbox/useCheckboxStyles.js +0 -184
  50. package/lib-amd/components/Checkbox/useCheckboxStyles.js.map +0 -1
  51. package/lib-amd/index.d.ts +0 -1
  52. package/lib-amd/index.js +0 -6
  53. package/lib-amd/index.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,129 @@
2
2
  "name": "@fluentui/react-checkbox",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 16 Sep 2021 07:35:43 GMT",
5
+ "date": "Wed, 22 Sep 2021 10:08:31 GMT",
6
+ "tag": "@fluentui/react-checkbox_v9.0.0-alpha.39",
7
+ "version": "9.0.0-alpha.39",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-checkbox",
13
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-alpha.70",
14
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-checkbox",
19
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-alpha.50",
20
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-checkbox",
25
+ "comment": "Bump @fluentui/react-label to v9.0.0-alpha.43",
26
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-checkbox",
31
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-alpha.64",
32
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-checkbox",
37
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.45",
38
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-checkbox",
43
+ "comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-alpha.14",
44
+ "commit": "bc3f1ec72fc7784a558b0dd6598ee0662f4649c1"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Tue, 21 Sep 2021 07:42:34 GMT",
51
+ "tag": "@fluentui/react-checkbox_v9.0.0-alpha.38",
52
+ "version": "9.0.0-alpha.38",
53
+ "comments": {
54
+ "prerelease": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-checkbox",
58
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-alpha.69",
59
+ "commit": "363765ba3d08d2facbb97fb80ab54ff27ac714fd"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-checkbox",
64
+ "comment": "Bump @fluentui/react-label to v9.0.0-alpha.42",
65
+ "commit": "363765ba3d08d2facbb97fb80ab54ff27ac714fd"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-checkbox",
70
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-alpha.63",
71
+ "commit": "363765ba3d08d2facbb97fb80ab54ff27ac714fd"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-checkbox",
76
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.44",
77
+ "commit": "363765ba3d08d2facbb97fb80ab54ff27ac714fd"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-checkbox",
82
+ "comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-alpha.13",
83
+ "commit": "363765ba3d08d2facbb97fb80ab54ff27ac714fd"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Mon, 20 Sep 2021 07:36:26 GMT",
90
+ "tag": "@fluentui/react-checkbox_v9.0.0-alpha.37",
91
+ "version": "9.0.0-alpha.37",
92
+ "comments": {
93
+ "none": [
94
+ {
95
+ "author": "lingfangao@hotmail.com",
96
+ "package": "@fluentui/react-checkbox",
97
+ "comment": "chore: use versioon eslint-plugin and react-conformance in dev dependencies",
98
+ "commit": "b8a304770f77c0353553a152dad34421070400a6"
99
+ }
100
+ ],
101
+ "prerelease": [
102
+ {
103
+ "author": "lingfangao@hotmail.com",
104
+ "package": "@fluentui/react-checkbox",
105
+ "commit": "b8a304770f77c0353553a152dad34421070400a6",
106
+ "comment": "Bump @fluentui/react-checkbox to v9.0.0-alpha.37"
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ {
112
+ "date": "Fri, 17 Sep 2021 07:35:26 GMT",
113
+ "tag": "@fluentui/react-checkbox_v9.0.0-alpha.36",
114
+ "version": "9.0.0-alpha.36",
115
+ "comments": {
116
+ "prerelease": [
117
+ {
118
+ "author": "Humberto.Morimoto@microsoft.com",
119
+ "package": "@fluentui/react-checkbox",
120
+ "commit": "90d71a0914acbb73a0365d60a85237e3d58ef575",
121
+ "comment": "Bump @fluentui/react-checkbox to v9.0.0-alpha.36"
122
+ }
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ "date": "Thu, 16 Sep 2021 07:38:39 GMT",
6
128
  "tag": "@fluentui/react-checkbox_v9.0.0-alpha.35",
7
129
  "version": "9.0.0-alpha.35",
8
130
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,57 @@
1
1
  # Change Log - @fluentui/react-checkbox
2
2
 
3
- This log was last generated on Thu, 16 Sep 2021 07:35:43 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 Sep 2021 10:08:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-alpha.39](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-alpha.39)
8
+
9
+ Wed, 22 Sep 2021 10:08:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.38..@fluentui/react-checkbox_v9.0.0-alpha.39)
11
+
12
+ ### Changes
13
+
14
+ - Bump @fluentui/react-make-styles to v9.0.0-alpha.70 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
15
+ - Bump @fluentui/react-utilities to v9.0.0-alpha.50 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
16
+ - Bump @fluentui/react-label to v9.0.0-alpha.43 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.0.0-alpha.64 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
18
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.45 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
19
+ - Bump @fluentui/react-conformance-make-styles to v9.0.0-alpha.14 ([commit](https://github.com/microsoft/fluentui/commit/bc3f1ec72fc7784a558b0dd6598ee0662f4649c1) by beachball)
20
+
21
+ ## [9.0.0-alpha.38](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-alpha.38)
22
+
23
+ Tue, 21 Sep 2021 07:42:34 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.37..@fluentui/react-checkbox_v9.0.0-alpha.38)
25
+
26
+ ### Changes
27
+
28
+ - Bump @fluentui/react-make-styles to v9.0.0-alpha.69 ([PR #19865](https://github.com/microsoft/fluentui/pull/19865) by beachball)
29
+ - Bump @fluentui/react-label to v9.0.0-alpha.42 ([PR #19865](https://github.com/microsoft/fluentui/pull/19865) by beachball)
30
+ - Bump @fluentui/react-tabster to v9.0.0-alpha.63 ([PR #19865](https://github.com/microsoft/fluentui/pull/19865) by beachball)
31
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.44 ([PR #19865](https://github.com/microsoft/fluentui/pull/19865) by beachball)
32
+ - Bump @fluentui/react-conformance-make-styles to v9.0.0-alpha.13 ([PR #19865](https://github.com/microsoft/fluentui/pull/19865) by beachball)
33
+
34
+ ## [9.0.0-alpha.37](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-alpha.37)
35
+
36
+ Mon, 20 Sep 2021 07:36:26 GMT
37
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.36..@fluentui/react-checkbox_v9.0.0-alpha.37)
38
+
39
+ ### Changes
40
+
41
+ - Bump @fluentui/react-checkbox to v9.0.0-alpha.37 ([PR #19844](https://github.com/microsoft/fluentui/pull/19844) by lingfangao@hotmail.com)
42
+
43
+ ## [9.0.0-alpha.36](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-alpha.36)
44
+
45
+ Fri, 17 Sep 2021 07:35:26 GMT
46
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.35..@fluentui/react-checkbox_v9.0.0-alpha.36)
47
+
48
+ ### Changes
49
+
50
+ - Bump @fluentui/react-checkbox to v9.0.0-alpha.36 ([PR #19840](https://github.com/microsoft/fluentui/pull/19840) by Humberto.Morimoto@microsoft.com)
51
+
7
52
  ## [9.0.0-alpha.35](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.0.0-alpha.35)
8
53
 
9
- Thu, 16 Sep 2021 07:35:43 GMT
54
+ Thu, 16 Sep 2021 07:38:39 GMT
10
55
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.0.0-alpha.34..@fluentui/react-checkbox_v9.0.0-alpha.35)
11
56
 
12
57
  ### Changes
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["Checkbox.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/Checkbox/index';\n"]}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["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;KAClD,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions, TestObject } from '@fluentui/react-conformance';\nimport makeStylesTests from '@fluentui/react-conformance-make-styles';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n extraTests: makeStylesTests as TestObject<TProps>,\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
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;KAClD,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;IAC9E,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","sourcesContent":["import * as React from 'react';\nimport { useCheckbox } from './useCheckbox';\nimport { CheckboxProps } from './Checkbox.types';\nimport { renderCheckbox } from './renderCheckbox';\nimport { useCheckboxStyles } from './useCheckboxStyles';\n\n/**\n * A Checkbox component provides a way to represent options that can be selected\n */\nexport const Checkbox = React.forwardRef<HTMLElement, CheckboxProps>((props, ref) => {\n const state = useCheckbox(props, ref);\n\n useCheckboxStyles(state);\n return renderCheckbox(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"]}
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;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;IAC9E,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 +1 @@
1
- {"version":3,"file":"Checkbox.types.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport { LabelProps } from '@fluentui/react-label';\n\n/**\n * TODO:\n * - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.\n * - Instead of extending LabelProps, extend LabelCommons once it's added.\n */\nexport interface CheckboxCommons extends Omit<LabelProps, 'defaultChecked' | 'onChange' | 'as'> {\n /**\n * Disabled state of the checkbox.\n */\n disabled?: boolean;\n\n /**\n * Required state of the checkbox.\n */\n required?: boolean;\n\n /**\n * A checkbox can be rendered with a circular shape.\n */\n circular?: boolean;\n\n /**\n * A checkbox's state can be controlled.\n * @defaultvalue false\n */\n checked?: 'mixed' | boolean;\n\n /**\n * Whether the checkbox should be rendered as checked by default.\n */\n defaultChecked?: 'mixed' | boolean;\n\n /**\n * Checkbox supports two different checkbox sizes.\n * @defaultvalue 'medium'\n */\n size: 'medium' | 'large';\n\n /**\n * Determines whether the label should be positioned before or after the checkbox.\n * @defaultvalue 'after'\n */\n labelPosition: 'before' | 'after';\n\n /**\n * ID of the root element that wraps the checkbox and label.\n */\n rootId?: string;\n\n /**\n * ID of the native element that represents the checkbox.\n */\n id?: string;\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.FormEvent<HTMLInputElement>, data: CheckboxOnChangeData) => void;\n}\n\n/**\n * Data for the onChange event for checkbox.\n */\nexport interface CheckboxOnChangeData {\n checked: 'mixed' | boolean;\n}\n\n/**\n * Checkbox Props\n */\nexport interface CheckboxProps extends ComponentPropsCompat, Partial<CheckboxCommons> {\n /**\n * Hidden input that handles the checkbox's functionality.\n */\n input?: ShorthandPropsCompat<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;\n\n /**\n * Renders the checkbox, with the checkmark icon as its child when checked.\n */\n indicator?: ShorthandPropsCompat<React.HTMLAttributes<HTMLDivElement>>;\n}\n\n/**\n * State used in rendering Checkbox\n */\nexport interface CheckboxState\n extends ComponentStateCompat<CheckboxProps, 'input' | 'indicator', 'size' | 'labelPosition' | 'input' | 'indicator'> {\n /**\n * Ref to the root element.\n */\n ref: React.Ref<HTMLElement>;\n\n /**\n * CSS class for the container of the input element and indicator slot.\n */\n containerClassName?: string;\n}\n"]}
1
+ {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultIcons.js","sourceRoot":"../src/","sources":["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","sourcesContent":["import * as React from 'react';\n\nexport const Mixed12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"8\" height=\"8\" x=\"2\" y=\"2\" />\n </svg>\n);\n\nexport const Mixed16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" />\n </svg>\n);\n\nexport const Checkmark12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n\nexport const Checkmark16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n"]}
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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './Checkbox';\nexport * from './Checkbox.types';\nexport * from './renderCheckbox';\nexport * from './useCheckbox';\nexport * from './useCheckboxStyles';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,cAAc,CAAC,KAAK,EAAE,sBAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;IAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ;QACnD,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,KAAK,CAAC,QAAQ,CACvC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { CheckboxState } from './Checkbox.types';\nimport { checkboxShorthandProps } from './useCheckbox';\n\nexport const renderCheckbox = (state: CheckboxState) => {\n const { slots, slotProps } = getSlotsCompat(state, checkboxShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {state.labelPosition === 'before' && state.children}\n <div className={state.containerClassName}>\n <slots.indicator {...slotProps.indicator} />\n <slots.input {...slotProps.input} />\n </div>\n {state.labelPosition === 'after' && state.children}\n </slots.root>\n );\n};\n"]}
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,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,cAAc,CAAC,KAAK,EAAE,sBAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;IAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ;QACnD,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,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AC;QACrB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,EAAE,EAAE;QACnB,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;QAChC,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;KACvC;IAED,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;QAChC,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;KACvC;IAED,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAExB,IAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAC;IAC3B,IAAM,OAAO,GAAG,OAAO,KAAK,OAAO,CAAC;IACpC,yBAAyB,CAAC;QACxB,IAAI,QAAQ,CAAC,OAAO,EAAE;YACpB,QAAQ,CAAC,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;SAC1C;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport {\n resolveShorthandProps,\n makeMergeProps,\n useControllableState,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { CheckboxProps, CheckboxState } from './Checkbox.types';\nimport { Mixed12Regular, Mixed16Regular, Checkmark12Regular, Checkmark16Regular } from './DefaultIcons';\nimport { Label } from '@fluentui/react-label';\n\n/**\n * Array of all shorthand properties listed as the keys of CheckboxSlots\n */\nexport const checkboxShorthandProps = ['indicator', 'input'] as const;\n\nconst mergeProps = makeMergeProps<CheckboxState>({ deepMerge: checkboxShorthandProps });\n\n/**\n * Create the state required to render Checkbox.\n *\n * The returned state can be modified with hooks such as useCheckboxStyles,\n * before being passed to renderCheckbox.\n *\n * @param props - props from this instance of Checkbox\n * @param ref - reference to root HTMLElement of Checkbox\n */\nexport const useCheckbox = (props: CheckboxProps, ref: React.Ref<HTMLElement>): CheckboxState => {\n const state: CheckboxState = mergeProps(\n {\n ref,\n as: props.children !== undefined ? Label : 'span',\n id: useId('checkbox-'),\n size: 'medium',\n labelPosition: 'after',\n input: {\n as: 'input',\n type: 'checkbox',\n children: null,\n },\n indicator: {\n as: 'div',\n },\n },\n resolveShorthandProps(props, checkboxShorthandProps),\n );\n\n const [checked, setCheckedInternal] = useControllableState({\n defaultState: props.defaultChecked,\n state: props.checked,\n initialState: false,\n });\n\n const setChecked = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, val: boolean | 'mixed') => {\n const onChange = state.onChange;\n onChange?.(ev, { checked: val });\n setCheckedInternal(val);\n },\n [state.onChange, setCheckedInternal],\n );\n\n state.input.checked = checked === true;\n state.checked = checked ? checked : false;\n\n if (!state.indicator.children) {\n if (state.size === 'medium') {\n state.indicator.children = checked === 'mixed' ? <Mixed12Regular /> : <Checkmark12Regular />;\n } else {\n state.indicator.children = checked === 'mixed' ? <Mixed16Regular /> : <Checkmark16Regular />;\n }\n }\n\n const userOnChange = state.input.onChange;\n state.input.onChange = useEventCallback(ev => {\n ev.stopPropagation();\n userOnChange?.(ev);\n setChecked(ev, ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked);\n });\n\n if (state.disabled !== undefined) {\n state.input.disabled = state.disabled;\n }\n\n if (state.required !== undefined) {\n state.input.required = state.required;\n }\n\n state.input.id = state.id;\n state.id = state.rootId;\n\n const inputRef = useMergedRefs(state.input.ref);\n state.input.ref = inputRef;\n const isMixed = checked === 'mixed';\n useIsomorphicLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = isMixed;\n }\n }, [inputRef, isMixed]);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,KAAK,EACL,yBAAyB,EACzB,aAAa,EACb,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,IAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAEtE,IAAM,UAAU,GAAG,cAAc,CAAgB,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAAoB,EAAE,GAA2B;IAC3E,IAAM,KAAK,GAAkB,UAAU,CACrC;QACE,GAAG,KAAA;QACH,EAAE,EAAE,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QACjD,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC;QACtB,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,OAAO;QACtB,KAAK,EAAE;YACL,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE;YACT,EAAE,EAAE,KAAK;SACV;KACF,EACD,qBAAqB,CAAC,KAAK,EAA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CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CACzD,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,YAAY,CACtC,eAAe,CAAC,GAAG,EACnB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAC1C,uBAAuB,EACvB,KAAK,CAAC,SAAS,CAAC,SAAS,CAC1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport { CheckboxState } from './Checkbox.types';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n display: 'inline-flex',\n position: 'relative',\n alignSelf: 'flex-start',\n alignItems: 'center',\n padding: '4px',\n userSelect: 'none',\n cursor: 'pointer',\n }),\n\n disabled: theme => ({\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n cursor: 'default',\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n }),\n\n unchecked: theme => ({\n color: theme.alias.color.neutral.neutralForeground3,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessible,\n '& > *': {\n opacity: 0,\n },\n },\n\n ':hover': {\n color: theme.alias.color.neutral.neutralForeground2,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessibleHover,\n },\n },\n\n ':active': {\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessiblePressed,\n },\n },\n }),\n\n checked: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackground,\n color: theme.alias.color.neutral.neutralForegroundInverted,\n borderColor: theme.alias.color.neutral.brandBackground,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundPressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundHover,\n },\n },\n }),\n\n mixed: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStroke,\n color: theme.alias.color.neutral.compoundBrandForeground1,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokePressed,\n color: theme.alias.color.neutral.compoundBrandForeground1Pressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokeHover,\n color: theme.alias.color.neutral.compoundBrandForeground1Hover,\n },\n },\n }),\n\n focusIndictor: createFocusIndicatorStyleRule(\n theme => ({\n ':after': {\n content: \"''\",\n position: 'absolute',\n width: '100%',\n height: '100%',\n border: `2px solid ${theme.alias.color.neutral.neutralForeground1}`,\n borderRadius: '4px',\n margin: '-6px',\n },\n }),\n { selector: 'focus-within' },\n ),\n});\n\nconst useContainerStyles = makeStyles({\n container: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n medium: {\n width: '16px',\n height: '16px',\n },\n\n large: {\n width: '20px',\n height: '20px',\n },\n\n // TODO: change marginLeft to Spacing horizontal M once it's added\n before: theme => ({\n marginLeft: '12px',\n }),\n\n // TODO: change marginRight to Spacing horizontal M once it's added\n after: theme => ({\n marginRight: '12px',\n }),\n});\n\nconst useInputStyles = makeStyles({\n input: {\n opacity: 0,\n position: 'absolute',\n margin: 0,\n padding: 0,\n cursor: 'pointer',\n },\n\n disabled: {\n cursor: 'not-allowed',\n },\n});\n\nconst useIndicatorStyles = makeStyles({\n box: theme => ({\n width: '100%',\n height: '100%',\n fill: 'currentColor',\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderRadius: theme.global.borderRadius.small,\n borderWidth: theme.global.strokeWidth.thin,\n }),\n\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n});\n\n/**\n * Apply styling to the Checkbox slots based on the state\n */\nexport const useCheckboxStyles = (state: CheckboxState): CheckboxState => {\n const checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';\n const indicatorStyles = useIndicatorStyles();\n const inputStyles = useInputStyles();\n const containerStyles = useContainerStyles();\n const styles = useStyles();\n\n state.className = mergeClasses(\n styles.root,\n styles.focusIndictor,\n styles[checkedState],\n state.disabled && styles.disabled,\n state.className,\n );\n\n state.input.className = mergeClasses(\n containerStyles[state.size],\n inputStyles.input,\n state.disabled && inputStyles.disabled,\n state.input.className,\n );\n\n state.containerClassName = mergeClasses(\n containerStyles.container,\n containerStyles[state.size],\n !!state.children && containerStyles[state.labelPosition],\n );\n state.indicator.className = mergeClasses(\n indicatorStyles.box,\n containerStyles[state.size],\n state.circular && indicatorStyles.circular,\n 'ms-checkbox-indicator',\n state.indicator.className,\n );\n\n return state;\n};\n"]}
1
+ {"version":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AC,KAAK,CAAC,SAAS,CACtB,CAAC;IAEF,KAAK,CAAC,kBAAkB,GAAG,YAAY,CACrC,eAAe,CAAC,SAAS,EACzB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CACzD,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,YAAY,CACtC,eAAe,CAAC,GAAG,EACnB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAC1C,uBAAuB,EACvB,KAAK,CAAC,SAAS,CAAC,SAAS,CAC1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC","sourcesContent":["export * from './Checkbox';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["Checkbox.ts"],"names":[],"mappings":";;;AAAA,sEAA4C","sourcesContent":["export * from './components/Checkbox/index';\n"]}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;AAAA,iEAAgH;AAChH,yFAAsE;AAEtE,SAAgB,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,uCAAqC;KAClD,CAAC;IAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAVD,oCAUC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions, TestObject } from '@fluentui/react-conformance';\nimport makeStylesTests from '@fluentui/react-conformance-make-styles';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n extraTests: makeStylesTests as TestObject<TProps>,\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
1
+ {"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;AAAA,iEAAgH;AAChH,yFAAsE;AAEtE,SAAgB,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,uCAAqC;KAClD,CAAC;IAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAVD,oCAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6CAA4C;AAE5C,mDAAkD;AAClD,yDAAwD;AAExD;;GAEG;AACU,QAAA,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;IAC9E,IAAM,KAAK,GAAG,yBAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtC,qCAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,+BAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import * as React from 'react';\nimport { useCheckbox } from './useCheckbox';\nimport { CheckboxProps } from './Checkbox.types';\nimport { renderCheckbox } from './renderCheckbox';\nimport { useCheckboxStyles } from './useCheckboxStyles';\n\n/**\n * A Checkbox component provides a way to represent options that can be selected\n */\nexport const Checkbox = React.forwardRef<HTMLElement, CheckboxProps>((props, ref) => {\n const state = useCheckbox(props, ref);\n\n useCheckboxStyles(state);\n return renderCheckbox(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"]}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6CAA4C;AAE5C,mDAAkD;AAClD,yDAAwD;AAExD;;GAEG;AACU,QAAA,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;IAC9E,IAAM,KAAK,GAAG,yBAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtC,qCAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,+BAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.types.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport { LabelProps } from '@fluentui/react-label';\n\n/**\n * TODO:\n * - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.\n * - Instead of extending LabelProps, extend LabelCommons once it's added.\n */\nexport interface CheckboxCommons extends Omit<LabelProps, 'defaultChecked' | 'onChange' | 'as'> {\n /**\n * Disabled state of the checkbox.\n */\n disabled?: boolean;\n\n /**\n * Required state of the checkbox.\n */\n required?: boolean;\n\n /**\n * A checkbox can be rendered with a circular shape.\n */\n circular?: boolean;\n\n /**\n * A checkbox's state can be controlled.\n * @defaultvalue false\n */\n checked?: 'mixed' | boolean;\n\n /**\n * Whether the checkbox should be rendered as checked by default.\n */\n defaultChecked?: 'mixed' | boolean;\n\n /**\n * Checkbox supports two different checkbox sizes.\n * @defaultvalue 'medium'\n */\n size: 'medium' | 'large';\n\n /**\n * Determines whether the label should be positioned before or after the checkbox.\n * @defaultvalue 'after'\n */\n labelPosition: 'before' | 'after';\n\n /**\n * ID of the root element that wraps the checkbox and label.\n */\n rootId?: string;\n\n /**\n * ID of the native element that represents the checkbox.\n */\n id?: string;\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.FormEvent<HTMLInputElement>, data: CheckboxOnChangeData) => void;\n}\n\n/**\n * Data for the onChange event for checkbox.\n */\nexport interface CheckboxOnChangeData {\n checked: 'mixed' | boolean;\n}\n\n/**\n * Checkbox Props\n */\nexport interface CheckboxProps extends ComponentPropsCompat, Partial<CheckboxCommons> {\n /**\n * Hidden input that handles the checkbox's functionality.\n */\n input?: ShorthandPropsCompat<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;\n\n /**\n * Renders the checkbox, with the checkmark icon as its child when checked.\n */\n indicator?: ShorthandPropsCompat<React.HTMLAttributes<HTMLDivElement>>;\n}\n\n/**\n * State used in rendering Checkbox\n */\nexport interface CheckboxState\n extends ComponentStateCompat<CheckboxProps, 'input' | 'indicator', 'size' | 'labelPosition' | 'input' | 'indicator'> {\n /**\n * Ref to the root element.\n */\n ref: React.Ref<HTMLElement>;\n\n /**\n * CSS class for the container of the input element and indicator slot.\n */\n containerClassName?: string;\n}\n"]}
1
+ {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultIcons.js","sourceRoot":"../src/","sources":["components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAExB,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;AAJW,QAAA,cAAc,kBAIzB;AAEK,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;AAJW,QAAA,cAAc,kBAIzB;AAEK,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;AAJW,QAAA,kBAAkB,sBAI7B;AAEK,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;AAJW,QAAA,kBAAkB,sBAI7B","sourcesContent":["import * as React from 'react';\n\nexport const Mixed12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"8\" height=\"8\" x=\"2\" y=\"2\" />\n </svg>\n);\n\nexport const Mixed16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" />\n </svg>\n);\n\nexport const Checkmark12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n\nexport const Checkmark16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n"]}
1
+ {"version":3,"file":"DefaultIcons.js","sourceRoot":"","sources":["../../../src/components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAExB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":";;;AAAA,qDAA2B;AAC3B,2DAAiC;AACjC,2DAAiC;AACjC,wDAA8B;AAC9B,8DAAoC","sourcesContent":["export * from './Checkbox';\nexport * from './Checkbox.types';\nexport * from './renderCheckbox';\nexport * from './useCheckbox';\nexport * from './useCheckboxStyles';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,2DAAiC;AACjC,2DAAiC;AACjC,wDAA8B;AAC9B,8DAAoC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6DAA2D;AAE3D,6CAAuD;AAEhD,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,oCAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;IAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ;QACnD,6BAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB;YACtC,oBAAC,KAAK,CAAC,SAAS,uBAAK,SAAS,CAAC,SAAS,EAAI;YAC5C,oBAAC,KAAK,CAAC,KAAK,uBAAK,SAAS,CAAC,KAAK,EAAI,CAChC;QACL,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,KAAK,CAAC,QAAQ,CACvC,CACd,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { CheckboxState } from './Checkbox.types';\nimport { checkboxShorthandProps } from './useCheckbox';\n\nexport const renderCheckbox = (state: CheckboxState) => {\n const { slots, slotProps } = getSlotsCompat(state, checkboxShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {state.labelPosition === 'before' && state.children}\n <div className={state.containerClassName}>\n <slots.indicator {...slotProps.indicator} />\n <slots.input {...slotProps.input} />\n </div>\n {state.labelPosition === 'after' && state.children}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"file":"renderCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6DAA2D;AAE3D,6CAAuD;AAEhD,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,oCAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;IAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ;QACnD,6BAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB;YACtC,oBAAC,KAAK,CAAC,SAAS,uBAAK,SAAS,CAAC,SAAS,EAAI;YAC5C,oBAAC,KAAK,CAAC,KAAK,uBAAK,SAAS,CAAC,KAAK,EAAI,CAChC;QACL,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,KAAK,CAAC,QAAQ,CACvC,CACd,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/useCheckbox.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAQmC;AAEnC,+CAAwG;AACxG,qDAA8C;AAE9C;;GAEG;AACU,QAAA,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAEtE,IAAM,UAAU,GAAG,gCAAc,CAAgB,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC,CAAC;AAExF;;;;;;;;GA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K,CAAC,GAAG,GAAG,QAAQ,CAAC;IAC3B,IAAM,OAAO,GAAG,OAAO,KAAK,OAAO,CAAC;IACpC,2CAAyB,CAAC;QACxB,IAAI,QAAQ,CAAC,OAAO,EAAE;YACpB,QAAQ,CAAC,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;SAC1C;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA1EW,QAAA,WAAW,eA0EtB","sourcesContent":["import * as React from 'react';\nimport {\n resolveShorthandProps,\n makeMergeProps,\n useControllableState,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { CheckboxProps, CheckboxState } from './Checkbox.types';\nimport { Mixed12Regular, Mixed16Regular, Checkmark12Regular, Checkmark16Regular } from './DefaultIcons';\nimport { Label } from '@fluentui/react-label';\n\n/**\n * Array of all shorthand properties listed as the keys of CheckboxSlots\n */\nexport const checkboxShorthandProps = ['indicator', 'input'] as const;\n\nconst mergeProps = makeMergeProps<CheckboxState>({ deepMerge: checkboxShorthandProps });\n\n/**\n * Create the state required to render Checkbox.\n *\n * The returned state can be modified with hooks such as useCheckboxStyles,\n * before being passed to renderCheckbox.\n *\n * @param props - props from this instance of Checkbox\n * @param ref - reference to root HTMLElement of Checkbox\n */\nexport const useCheckbox = (props: CheckboxProps, ref: React.Ref<HTMLElement>): CheckboxState => {\n const state: CheckboxState = mergeProps(\n {\n ref,\n as: props.children !== undefined ? Label : 'span',\n id: useId('checkbox-'),\n size: 'medium',\n labelPosition: 'after',\n input: {\n as: 'input',\n type: 'checkbox',\n children: null,\n },\n indicator: {\n as: 'div',\n },\n },\n resolveShorthandProps(props, checkboxShorthandProps),\n );\n\n const [checked, setCheckedInternal] = useControllableState({\n defaultState: props.defaultChecked,\n state: props.checked,\n initialState: false,\n });\n\n const setChecked = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, val: boolean | 'mixed') => {\n const onChange = state.onChange;\n onChange?.(ev, { checked: val });\n setCheckedInternal(val);\n },\n [state.onChange, setCheckedInternal],\n );\n\n state.input.checked = checked === true;\n state.checked = checked ? checked : false;\n\n if (!state.indicator.children) {\n if (state.size === 'medium') {\n state.indicator.children = checked === 'mixed' ? <Mixed12Regular /> : <Checkmark12Regular />;\n } else {\n state.indicator.children = checked === 'mixed' ? <Mixed16Regular /> : <Checkmark16Regular />;\n }\n }\n\n const userOnChange = state.input.onChange;\n state.input.onChange = useEventCallback(ev => {\n ev.stopPropagation();\n userOnChange?.(ev);\n setChecked(ev, ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked);\n });\n\n if (state.disabled !== undefined) {\n state.input.disabled = state.disabled;\n }\n\n if (state.required !== undefined) {\n state.input.required = state.required;\n }\n\n state.input.id = state.id;\n state.id = state.rootId;\n\n const inputRef = useMergedRefs(state.input.ref);\n state.input.ref = inputRef;\n const isMixed = checked === 'mixed';\n useIsomorphicLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = isMixed;\n }\n }, [inputRef, isMixed]);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckbox.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAQmC;AAEnC,+CAAwG;AACxG,qDAA8C;AAE9C;;GAEG;AACU,QAAA,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAEtE,IAAM,UAAU,GAAG,gCAAc,CAAgB,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACI,IAAM,WAAW,GAAG,UAAC,KAAoB,EAAE,GAA2B;IAC3E,IAAM,KAAK,GAAkB,UAAU,CACrC;QACE,GAAG,KAAA;QACH,EAAE,EAAE,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,mBAA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3B,WAAW,CAAC,KAAK,EACjB,KAAK,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EACtC,KAAK,CAAC,KAAK,CAAC,SAAS,CACtB,CAAC;IAEF,KAAK,CAAC,kBAAkB,GAAG,gCAAY,CACrC,eAAe,CAAC,SAAS,EACzB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CACzD,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,gCAAY,CACtC,eAAe,CAAC,GAAG,EACnB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAC1C,uBAAuB,EACvB,KAAK,CAAC,SAAS,CAAC,SAAS,CAC1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport { CheckboxState } from './Checkbox.types';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n display: 'inline-flex',\n position: 'relative',\n alignSelf: 'flex-start',\n alignItems: 'center',\n padding: '4px',\n userSelect: 'none',\n cursor: 'pointer',\n }),\n\n disabled: theme => ({\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n cursor: 'default',\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n }),\n\n unchecked: theme => ({\n color: theme.alias.color.neutral.neutralForeground3,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessible,\n '& > *': {\n opacity: 0,\n },\n },\n\n ':hover': {\n color: theme.alias.color.neutral.neutralForeground2,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessibleHover,\n },\n },\n\n ':active': {\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessiblePressed,\n },\n },\n }),\n\n checked: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackground,\n color: theme.alias.color.neutral.neutralForegroundInverted,\n borderColor: theme.alias.color.neutral.brandBackground,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundPressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundHover,\n },\n },\n }),\n\n mixed: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStroke,\n color: theme.alias.color.neutral.compoundBrandForeground1,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokePressed,\n color: theme.alias.color.neutral.compoundBrandForeground1Pressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokeHover,\n color: theme.alias.color.neutral.compoundBrandForeground1Hover,\n },\n },\n }),\n\n focusIndictor: createFocusIndicatorStyleRule(\n theme => ({\n ':after': {\n content: \"''\",\n position: 'absolute',\n width: '100%',\n height: '100%',\n border: `2px solid ${theme.alias.color.neutral.neutralForeground1}`,\n borderRadius: '4px',\n margin: '-6px',\n },\n }),\n { selector: 'focus-within' },\n ),\n});\n\nconst useContainerStyles = makeStyles({\n container: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n medium: {\n width: '16px',\n height: '16px',\n },\n\n large: {\n width: '20px',\n height: '20px',\n },\n\n // TODO: change marginLeft to Spacing horizontal M once it's added\n before: theme => ({\n marginLeft: '12px',\n }),\n\n // TODO: change marginRight to Spacing horizontal M once it's added\n after: theme => ({\n marginRight: '12px',\n }),\n});\n\nconst useInputStyles = makeStyles({\n input: {\n opacity: 0,\n position: 'absolute',\n margin: 0,\n padding: 0,\n cursor: 'pointer',\n },\n\n disabled: {\n cursor: 'not-allowed',\n },\n});\n\nconst useIndicatorStyles = makeStyles({\n box: theme => ({\n width: '100%',\n height: '100%',\n fill: 'currentColor',\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderRadius: theme.global.borderRadius.small,\n borderWidth: theme.global.strokeWidth.thin,\n }),\n\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n});\n\n/**\n * Apply styling to the Checkbox slots based on the state\n */\nexport const useCheckboxStyles = (state: CheckboxState): CheckboxState => {\n const checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';\n const indicatorStyles = useIndicatorStyles();\n const inputStyles = useInputStyles();\n const containerStyles = useContainerStyles();\n const styles = useStyles();\n\n state.className = mergeClasses(\n styles.root,\n styles.focusIndictor,\n styles[checkedState],\n state.disabled && styles.disabled,\n state.className,\n );\n\n state.input.className = mergeClasses(\n containerStyles[state.size],\n inputStyles.input,\n state.disabled && inputStyles.disabled,\n state.input.className,\n );\n\n state.containerClassName = mergeClasses(\n containerStyles.container,\n containerStyles[state.size],\n !!state.children && containerStyles[state.labelPosition],\n );\n state.indicator.className = mergeClasses(\n indicatorStyles.box,\n containerStyles[state.size],\n state.circular && indicatorStyles.circular,\n 'ms-checkbox-indicator',\n state.indicator.className,\n );\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useCheckboxStyles.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":";;;AAAA,iEAAuE;AACvE,yDAAwE;AAGxE;;GAEG;AACH,IAAM,SAAS,GAAG,8BAAU,CAAC;IAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,OAAO,EAAE,aAAa;QACtB,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,SAAS;KAClB,CAAC,EARa,CAQb;IAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;QAC1D,MAAM,EAAE,SAAS;QAEjB,0BAA0B,EAAE;YAC1B,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB;YAC5D,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;YAC1D,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;SAC9D;QAED,QAAQ,EAAE;YACR,0BAA0B,EAAE;gBAC1B,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB;gBAC5D,KAAK,EAAE,KAAK,CAAC,KAAK,CAA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KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,gCAAY,CAClC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EACtC,KAAK,CAAC,KAAK,CAAC,SAAS,CACtB,CAAC;IAEF,KAAK,CAAC,kBAAkB,GAAG,gCAAY,CACrC,eAAe,CAAC,SAAS,EACzB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CACzD,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,gCAAY,CACtC,eAAe,CAAC,GAAG,EACnB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAC1C,uBAAuB,EACvB,KAAK,CAAC,SAAS,CAAC,SAAS,CAC1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B","sourcesContent":["export * from './Checkbox';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-checkbox",
3
- "version": "9.0.0-alpha.35",
3
+ "version": "9.0.0-alpha.39",
4
4
  "description": "Fluent UI checkbox component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -24,10 +24,10 @@
24
24
  "storybook": "start-storybook"
25
25
  },
26
26
  "devDependencies": {
27
- "@fluentui/eslint-plugin": "^1.4.1",
28
- "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.41",
29
- "@fluentui/react-conformance": "^0.5.0",
30
- "@fluentui/react-conformance-make-styles": "9.0.0-alpha.10",
27
+ "@fluentui/eslint-plugin": "*",
28
+ "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.45",
29
+ "@fluentui/react-conformance": "*",
30
+ "@fluentui/react-conformance-make-styles": "9.0.0-alpha.14",
31
31
  "@fluentui/scripts": "^1.0.0",
32
32
  "@types/enzyme": "3.10.3",
33
33
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -41,10 +41,10 @@
41
41
  "react-test-renderer": "^16.3.0"
42
42
  },
43
43
  "dependencies": {
44
- "@fluentui/react-make-styles": "9.0.0-alpha.66",
45
- "@fluentui/react-utilities": "9.0.0-alpha.48",
46
- "@fluentui/react-label": "9.0.0-alpha.39",
47
- "@fluentui/react-tabster": "9.0.0-alpha.60",
44
+ "@fluentui/react-make-styles": "9.0.0-alpha.70",
45
+ "@fluentui/react-utilities": "9.0.0-alpha.50",
46
+ "@fluentui/react-label": "9.0.0-alpha.43",
47
+ "@fluentui/react-tabster": "9.0.0-alpha.64",
48
48
  "tslib": "^2.1.0"
49
49
  },
50
50
  "peerDependencies": {
@@ -1 +0,0 @@
1
- export * from './components/Checkbox/index';
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/Checkbox/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["Checkbox.ts"],"names":[],"mappings":";;;IAAA,uCAA4C","sourcesContent":["export * from './components/Checkbox/index';\n"]}
@@ -1,4 +0,0 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
- componentPath?: string;
4
- }): void;
@@ -1,15 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-conformance", "@fluentui/react-conformance-make-styles"], function (require, exports, react_conformance_1, react_conformance_make_styles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.isConformant = void 0;
5
- function isConformant(testInfo) {
6
- var defaultOptions = {
7
- asPropHandlesRef: true,
8
- componentPath: module.parent.filename.replace('.test', ''),
9
- extraTests: react_conformance_make_styles_1.default,
10
- };
11
- react_conformance_1.isConformant(defaultOptions, testInfo);
12
- }
13
- exports.isConformant = isConformant;
14
- });
15
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;;IAGA,SAAgB,YAAY,CAC1B,QAAyF;QAEzF,IAAM,cAAc,GAAyC;YAC3D,gBAAgB,EAAE,IAAI;YACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAC5D,UAAU,EAAE,uCAAqC;SAClD,CAAC;QAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAVD,oCAUC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions, TestObject } from '@fluentui/react-conformance';\nimport makeStylesTests from '@fluentui/react-conformance-make-styles';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n extraTests: makeStylesTests as TestObject<TProps>,\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { CheckboxProps } from './Checkbox.types';
3
- /**
4
- * A Checkbox component provides a way to represent options that can be selected
5
- */
6
- export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLElement>>;
@@ -1,15 +0,0 @@
1
- define(["require", "exports", "react", "./useCheckbox", "./renderCheckbox", "./useCheckboxStyles"], function (require, exports, React, useCheckbox_1, renderCheckbox_1, useCheckboxStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Checkbox = void 0;
5
- /**
6
- * A Checkbox component provides a way to represent options that can be selected
7
- */
8
- exports.Checkbox = React.forwardRef(function (props, ref) {
9
- var state = useCheckbox_1.useCheckbox(props, ref);
10
- useCheckboxStyles_1.useCheckboxStyles(state);
11
- return renderCheckbox_1.renderCheckbox(state);
12
- });
13
- exports.Checkbox.displayName = 'Checkbox';
14
- });
15
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACU,QAAA,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;QAC9E,IAAM,KAAK,GAAG,yBAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEtC,qCAAiB,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,+BAAc,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import * as React from 'react';\nimport { useCheckbox } from './useCheckbox';\nimport { CheckboxProps } from './Checkbox.types';\nimport { renderCheckbox } from './renderCheckbox';\nimport { useCheckboxStyles } from './useCheckboxStyles';\n\n/**\n * A Checkbox component provides a way to represent options that can be selected\n */\nexport const Checkbox = React.forwardRef<HTMLElement, CheckboxProps>((props, ref) => {\n const state = useCheckbox(props, ref);\n\n useCheckboxStyles(state);\n return renderCheckbox(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"]}
@@ -1,85 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
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
- export interface CheckboxCommons extends Omit<LabelProps, 'defaultChecked' | 'onChange' | 'as'> {
10
- /**
11
- * Disabled state of the checkbox.
12
- */
13
- disabled?: boolean;
14
- /**
15
- * Required state of the checkbox.
16
- */
17
- required?: boolean;
18
- /**
19
- * A checkbox can be rendered with a circular shape.
20
- */
21
- circular?: boolean;
22
- /**
23
- * A checkbox's state can be controlled.
24
- * @defaultvalue false
25
- */
26
- checked?: 'mixed' | boolean;
27
- /**
28
- * Whether the checkbox should be rendered as checked by default.
29
- */
30
- defaultChecked?: 'mixed' | boolean;
31
- /**
32
- * Checkbox supports two different checkbox sizes.
33
- * @defaultvalue 'medium'
34
- */
35
- size: 'medium' | 'large';
36
- /**
37
- * Determines whether the label should be positioned before or after the checkbox.
38
- * @defaultvalue 'after'
39
- */
40
- labelPosition: 'before' | 'after';
41
- /**
42
- * ID of the root element that wraps the checkbox and label.
43
- */
44
- rootId?: string;
45
- /**
46
- * ID of the native element that represents the checkbox.
47
- */
48
- id?: string;
49
- /**
50
- * Callback to be called when the checked state value changes.
51
- */
52
- onChange?: (ev: React.FormEvent<HTMLInputElement>, data: CheckboxOnChangeData) => void;
53
- }
54
- /**
55
- * Data for the onChange event for checkbox.
56
- */
57
- export interface CheckboxOnChangeData {
58
- checked: 'mixed' | boolean;
59
- }
60
- /**
61
- * Checkbox Props
62
- */
63
- export interface CheckboxProps extends ComponentPropsCompat, Partial<CheckboxCommons> {
64
- /**
65
- * Hidden input that handles the checkbox's functionality.
66
- */
67
- input?: ShorthandPropsCompat<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
68
- /**
69
- * Renders the checkbox, with the checkmark icon as its child when checked.
70
- */
71
- indicator?: ShorthandPropsCompat<React.HTMLAttributes<HTMLDivElement>>;
72
- }
73
- /**
74
- * State used in rendering Checkbox
75
- */
76
- export interface CheckboxState extends ComponentStateCompat<CheckboxProps, 'input' | 'indicator', 'size' | 'labelPosition' | 'input' | 'indicator'> {
77
- /**
78
- * Ref to the root element.
79
- */
80
- ref: React.Ref<HTMLElement>;
81
- /**
82
- * CSS class for the container of the input element and indicator slot.
83
- */
84
- containerClassName?: string;
85
- }
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=Checkbox.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.types.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport { LabelProps } from '@fluentui/react-label';\n\n/**\n * TODO:\n * - Remove as from Omit. Currently it's needed since checkbox Commons shouldn't have as.\n * - Instead of extending LabelProps, extend LabelCommons once it's added.\n */\nexport interface CheckboxCommons extends Omit<LabelProps, 'defaultChecked' | 'onChange' | 'as'> {\n /**\n * Disabled state of the checkbox.\n */\n disabled?: boolean;\n\n /**\n * Required state of the checkbox.\n */\n required?: boolean;\n\n /**\n * A checkbox can be rendered with a circular shape.\n */\n circular?: boolean;\n\n /**\n * A checkbox's state can be controlled.\n * @defaultvalue false\n */\n checked?: 'mixed' | boolean;\n\n /**\n * Whether the checkbox should be rendered as checked by default.\n */\n defaultChecked?: 'mixed' | boolean;\n\n /**\n * Checkbox supports two different checkbox sizes.\n * @defaultvalue 'medium'\n */\n size: 'medium' | 'large';\n\n /**\n * Determines whether the label should be positioned before or after the checkbox.\n * @defaultvalue 'after'\n */\n labelPosition: 'before' | 'after';\n\n /**\n * ID of the root element that wraps the checkbox and label.\n */\n rootId?: string;\n\n /**\n * ID of the native element that represents the checkbox.\n */\n id?: string;\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.FormEvent<HTMLInputElement>, data: CheckboxOnChangeData) => void;\n}\n\n/**\n * Data for the onChange event for checkbox.\n */\nexport interface CheckboxOnChangeData {\n checked: 'mixed' | boolean;\n}\n\n/**\n * Checkbox Props\n */\nexport interface CheckboxProps extends ComponentPropsCompat, Partial<CheckboxCommons> {\n /**\n * Hidden input that handles the checkbox's functionality.\n */\n input?: ShorthandPropsCompat<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;\n\n /**\n * Renders the checkbox, with the checkmark icon as its child when checked.\n */\n indicator?: ShorthandPropsCompat<React.HTMLAttributes<HTMLDivElement>>;\n}\n\n/**\n * State used in rendering Checkbox\n */\nexport interface CheckboxState\n extends ComponentStateCompat<CheckboxProps, 'input' | 'indicator', 'size' | 'labelPosition' | 'input' | 'indicator'> {\n /**\n * Ref to the root element.\n */\n ref: React.Ref<HTMLElement>;\n\n /**\n * CSS class for the container of the input element and indicator slot.\n */\n containerClassName?: string;\n}\n"]}
@@ -1,4 +0,0 @@
1
- export declare const Mixed12Regular: () => JSX.Element;
2
- export declare const Mixed16Regular: () => JSX.Element;
3
- export declare const Checkmark12Regular: () => JSX.Element;
4
- export declare const Checkmark16Regular: () => JSX.Element;
@@ -1,18 +0,0 @@
1
- define(["require", "exports", "react"], function (require, exports, React) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Checkmark16Regular = exports.Checkmark12Regular = exports.Mixed16Regular = exports.Mixed12Regular = void 0;
5
- 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" },
6
- React.createElement("rect", { width: "8", height: "8", x: "2", y: "2" }))); };
7
- exports.Mixed12Regular = Mixed12Regular;
8
- 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" },
9
- React.createElement("rect", { width: "10", height: "10", x: "3", y: "3" }))); };
10
- exports.Mixed16Regular = Mixed16Regular;
11
- var Checkmark12Regular = function () { return (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
12
- 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" }))); };
13
- exports.Checkmark12Regular = Checkmark12Regular;
14
- var Checkmark16Regular = function () { return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
15
- 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" }))); };
16
- exports.Checkmark16Regular = Checkmark16Regular;
17
- });
18
- //# sourceMappingURL=DefaultIcons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultIcons.js","sourceRoot":"../src/","sources":["components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":";;;;IAEO,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;QAClG,8BAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACrC,CACP,EAJmC,CAInC,CAAC;IAJW,QAAA,cAAc,kBAIzB;IAEK,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;QAClG,8BAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACvC,CACP,EAJmC,CAInC,CAAC;IAJW,QAAA,cAAc,kBAIzB;IAEK,IAAM,kBAAkB,GAAG,cAAM,OAAA,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;QAChF,8BAAM,CAAC,EAAC,6TAA6T,GAAG,CACpU,CACP,EAJuC,CAIvC,CAAC;IAJW,QAAA,kBAAkB,sBAI7B;IAEK,IAAM,kBAAkB,GAAG,cAAM,OAAA,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;QAChF,8BAAM,CAAC,EAAC,kUAAkU,GAAG,CACzU,CACP,EAJuC,CAIvC,CAAC;IAJW,QAAA,kBAAkB,sBAI7B","sourcesContent":["import * as React from 'react';\n\nexport const Mixed12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"8\" height=\"8\" x=\"2\" y=\"2\" />\n </svg>\n);\n\nexport const Mixed16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" />\n </svg>\n);\n\nexport const Checkmark12Regular = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n\nexport const Checkmark16Regular = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n);\n"]}
@@ -1,5 +0,0 @@
1
- export * from './Checkbox';
2
- export * from './Checkbox.types';
3
- export * from './renderCheckbox';
4
- export * from './useCheckbox';
5
- export * from './useCheckboxStyles';
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "tslib", "./Checkbox", "./Checkbox.types", "./renderCheckbox", "./useCheckbox", "./useCheckboxStyles"], function (require, exports, tslib_1, Checkbox_1, Checkbox_types_1, renderCheckbox_1, useCheckbox_1, useCheckboxStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Checkbox_1, exports);
5
- tslib_1.__exportStar(Checkbox_types_1, exports);
6
- tslib_1.__exportStar(renderCheckbox_1, exports);
7
- tslib_1.__exportStar(useCheckbox_1, exports);
8
- tslib_1.__exportStar(useCheckboxStyles_1, exports);
9
- });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Checkbox/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,gDAAiC;IACjC,gDAAiC;IACjC,6CAA8B;IAC9B,mDAAoC","sourcesContent":["export * from './Checkbox';\nexport * from './Checkbox.types';\nexport * from './renderCheckbox';\nexport * from './useCheckbox';\nexport * from './useCheckboxStyles';\n"]}
@@ -1,2 +0,0 @@
1
- import { CheckboxState } from './Checkbox.types';
2
- export declare const renderCheckbox: (state: CheckboxState) => JSX.Element;
@@ -1,16 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./useCheckbox"], function (require, exports, tslib_1, React, react_utilities_1, useCheckbox_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderCheckbox = void 0;
5
- var renderCheckbox = function (state) {
6
- var _a = react_utilities_1.getSlotsCompat(state, useCheckbox_1.checkboxShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
7
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
8
- state.labelPosition === 'before' && state.children,
9
- React.createElement("div", { className: state.containerClassName },
10
- React.createElement(slots.indicator, tslib_1.__assign({}, slotProps.indicator)),
11
- React.createElement(slots.input, tslib_1.__assign({}, slotProps.input))),
12
- state.labelPosition === 'after' && state.children));
13
- };
14
- exports.renderCheckbox = renderCheckbox;
15
- });
16
- //# sourceMappingURL=renderCheckbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";;;;IAKO,IAAM,cAAc,GAAG,UAAC,KAAoB;QAC3C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,oCAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;QAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ;YACnD,6BAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB;gBACtC,oBAAC,KAAK,CAAC,SAAS,uBAAK,SAAS,CAAC,SAAS,EAAI;gBAC5C,oBAAC,KAAK,CAAC,KAAK,uBAAK,SAAS,CAAC,KAAK,EAAI,CAChC;YACL,KAAK,CAAC,aAAa,KAAK,OAAO,IAAI,KAAK,CAAC,QAAQ,CACvC,CACd,CAAC;IACJ,CAAC,CAAC;IAbW,QAAA,cAAc,kBAazB","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { CheckboxState } from './Checkbox.types';\nimport { checkboxShorthandProps } from './useCheckbox';\n\nexport const renderCheckbox = (state: CheckboxState) => {\n const { slots, slotProps } = getSlotsCompat(state, checkboxShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {state.labelPosition === 'before' && state.children}\n <div className={state.containerClassName}>\n <slots.indicator {...slotProps.indicator} />\n <slots.input {...slotProps.input} />\n </div>\n {state.labelPosition === 'after' && state.children}\n </slots.root>\n );\n};\n"]}
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import { CheckboxProps, CheckboxState } from './Checkbox.types';
3
- /**
4
- * Array of all shorthand properties listed as the keys of CheckboxSlots
5
- */
6
- export declare const checkboxShorthandProps: readonly ["indicator", "input"];
7
- /**
8
- * Create the state required to render Checkbox.
9
- *
10
- * The returned state can be modified with hooks such as useCheckboxStyles,
11
- * before being passed to renderCheckbox.
12
- *
13
- * @param props - props from this instance of Checkbox
14
- * @param ref - reference to root HTMLElement of Checkbox
15
- */
16
- export declare const useCheckbox: (props: CheckboxProps, ref: React.Ref<HTMLElement>) => CheckboxState;
@@ -1,81 +0,0 @@
1
- define(["require", "exports", "react", "@fluentui/react-utilities", "./DefaultIcons", "@fluentui/react-label"], function (require, exports, React, react_utilities_1, DefaultIcons_1, react_label_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useCheckbox = exports.checkboxShorthandProps = void 0;
5
- /**
6
- * Array of all shorthand properties listed as the keys of CheckboxSlots
7
- */
8
- exports.checkboxShorthandProps = ['indicator', 'input'];
9
- var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.checkboxShorthandProps });
10
- /**
11
- * Create the state required to render Checkbox.
12
- *
13
- * The returned state can be modified with hooks such as useCheckboxStyles,
14
- * before being passed to renderCheckbox.
15
- *
16
- * @param props - props from this instance of Checkbox
17
- * @param ref - reference to root HTMLElement of Checkbox
18
- */
19
- var useCheckbox = function (props, ref) {
20
- var state = mergeProps({
21
- ref: ref,
22
- as: props.children !== undefined ? react_label_1.Label : 'span',
23
- id: react_utilities_1.useId('checkbox-'),
24
- size: 'medium',
25
- labelPosition: 'after',
26
- input: {
27
- as: 'input',
28
- type: 'checkbox',
29
- children: null,
30
- },
31
- indicator: {
32
- as: 'div',
33
- },
34
- }, react_utilities_1.resolveShorthandProps(props, exports.checkboxShorthandProps));
35
- var _a = react_utilities_1.useControllableState({
36
- defaultState: props.defaultChecked,
37
- state: props.checked,
38
- initialState: false,
39
- }), checked = _a[0], setCheckedInternal = _a[1];
40
- var setChecked = React.useCallback(function (ev, val) {
41
- var onChange = state.onChange;
42
- onChange === null || onChange === void 0 ? void 0 : onChange(ev, { checked: val });
43
- setCheckedInternal(val);
44
- }, [state.onChange, setCheckedInternal]);
45
- state.input.checked = checked === true;
46
- state.checked = checked ? checked : false;
47
- if (!state.indicator.children) {
48
- if (state.size === 'medium') {
49
- state.indicator.children = checked === 'mixed' ? React.createElement(DefaultIcons_1.Mixed12Regular, null) : React.createElement(DefaultIcons_1.Checkmark12Regular, null);
50
- }
51
- else {
52
- state.indicator.children = checked === 'mixed' ? React.createElement(DefaultIcons_1.Mixed16Regular, null) : React.createElement(DefaultIcons_1.Checkmark16Regular, null);
53
- }
54
- }
55
- var userOnChange = state.input.onChange;
56
- state.input.onChange = react_utilities_1.useEventCallback(function (ev) {
57
- ev.stopPropagation();
58
- userOnChange === null || userOnChange === void 0 ? void 0 : userOnChange(ev);
59
- setChecked(ev, ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked);
60
- });
61
- if (state.disabled !== undefined) {
62
- state.input.disabled = state.disabled;
63
- }
64
- if (state.required !== undefined) {
65
- state.input.required = state.required;
66
- }
67
- state.input.id = state.id;
68
- state.id = state.rootId;
69
- var inputRef = react_utilities_1.useMergedRefs(state.input.ref);
70
- state.input.ref = inputRef;
71
- var isMixed = checked === 'mixed';
72
- react_utilities_1.useIsomorphicLayoutEffect(function () {
73
- if (inputRef.current) {
74
- inputRef.current.indeterminate = isMixed;
75
- }
76
- }, [inputRef, isMixed]);
77
- return state;
78
- };
79
- exports.useCheckbox = useCheckbox;
80
- });
81
- //# sourceMappingURL=useCheckbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/useCheckbox.tsx"],"names":[],"mappings":";;;;IAcA;;OAEG;IACU,QAAA,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;IAEtE,IAAM,UAAU,GAAG,gCAAc,CAAgB,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC,CAAC;IAExF;;;;;;;;OAQG;IACI,IAAM,WAAW,GAAG,UAAC,KAAoB,EAAE,GAA2B;QAC3E,IAAM,KAAK,GAAkB,UAAU,CACrC;YACE,GAAG,KAAA;YACH,EAAE,EAAE,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAK,CAAC,CAAC,CAAC,MAAM;YACjD,EAAE,EAAE,uBAAK,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,QAAQ;YACd,aAAa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,KAAK,CAAC;IACf,CAAC,CAAC;IA1EW,QAAA,WAAW,eA0EtB","sourcesContent":["import * as React from 'react';\nimport {\n resolveShorthandProps,\n makeMergeProps,\n useControllableState,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { CheckboxProps, CheckboxState } from './Checkbox.types';\nimport { Mixed12Regular, Mixed16Regular, Checkmark12Regular, Checkmark16Regular } from './DefaultIcons';\nimport { Label } from '@fluentui/react-label';\n\n/**\n * Array of all shorthand properties listed as the keys of CheckboxSlots\n */\nexport const checkboxShorthandProps = ['indicator', 'input'] as const;\n\nconst mergeProps = makeMergeProps<CheckboxState>({ deepMerge: checkboxShorthandProps });\n\n/**\n * Create the state required to render Checkbox.\n *\n * The returned state can be modified with hooks such as useCheckboxStyles,\n * before being passed to renderCheckbox.\n *\n * @param props - props from this instance of Checkbox\n * @param ref - reference to root HTMLElement of Checkbox\n */\nexport const useCheckbox = (props: CheckboxProps, ref: React.Ref<HTMLElement>): CheckboxState => {\n const state: CheckboxState = mergeProps(\n {\n ref,\n as: props.children !== undefined ? Label : 'span',\n id: useId('checkbox-'),\n size: 'medium',\n labelPosition: 'after',\n input: {\n as: 'input',\n type: 'checkbox',\n children: null,\n },\n indicator: {\n as: 'div',\n },\n },\n resolveShorthandProps(props, checkboxShorthandProps),\n );\n\n const [checked, setCheckedInternal] = useControllableState({\n defaultState: props.defaultChecked,\n state: props.checked,\n initialState: false,\n });\n\n const setChecked = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, val: boolean | 'mixed') => {\n const onChange = state.onChange;\n onChange?.(ev, { checked: val });\n setCheckedInternal(val);\n },\n [state.onChange, setCheckedInternal],\n );\n\n state.input.checked = checked === true;\n state.checked = checked ? checked : false;\n\n if (!state.indicator.children) {\n if (state.size === 'medium') {\n state.indicator.children = checked === 'mixed' ? <Mixed12Regular /> : <Checkmark12Regular />;\n } else {\n state.indicator.children = checked === 'mixed' ? <Mixed16Regular /> : <Checkmark16Regular />;\n }\n }\n\n const userOnChange = state.input.onChange;\n state.input.onChange = useEventCallback(ev => {\n ev.stopPropagation();\n userOnChange?.(ev);\n setChecked(ev, ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked);\n });\n\n if (state.disabled !== undefined) {\n state.input.disabled = state.disabled;\n }\n\n if (state.required !== undefined) {\n state.input.required = state.required;\n }\n\n state.input.id = state.id;\n state.id = state.rootId;\n\n const inputRef = useMergedRefs(state.input.ref);\n state.input.ref = inputRef;\n const isMixed = checked === 'mixed';\n useIsomorphicLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = isMixed;\n }\n }, [inputRef, isMixed]);\n\n return state;\n};\n"]}
@@ -1,5 +0,0 @@
1
- import { CheckboxState } from './Checkbox.types';
2
- /**
3
- * Apply styling to the Checkbox slots based on the state
4
- */
5
- export declare const useCheckboxStyles: (state: CheckboxState) => CheckboxState;
@@ -1,184 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-make-styles", "@fluentui/react-tabster"], function (require, exports, react_make_styles_1, react_tabster_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useCheckboxStyles = void 0;
5
- /**
6
- * Styles for the root slot
7
- */
8
- var useStyles = react_make_styles_1.makeStyles({
9
- root: function (theme) { return ({
10
- display: 'inline-flex',
11
- position: 'relative',
12
- alignSelf: 'flex-start',
13
- alignItems: 'center',
14
- padding: '4px',
15
- userSelect: 'none',
16
- cursor: 'pointer',
17
- }); },
18
- disabled: function (theme) { return ({
19
- color: theme.alias.color.neutral.neutralForegroundDisabled,
20
- cursor: 'default',
21
- '& .ms-checkbox-indicator': {
22
- borderColor: theme.alias.color.neutral.neutralStrokeDisabled,
23
- color: theme.alias.color.neutral.neutralForegroundDisabled,
24
- backgroundColor: theme.alias.color.neutral.neutralBackground1,
25
- },
26
- ':hover': {
27
- '& .ms-checkbox-indicator': {
28
- borderColor: theme.alias.color.neutral.neutralStrokeDisabled,
29
- color: theme.alias.color.neutral.neutralForegroundDisabled,
30
- backgroundColor: theme.alias.color.neutral.neutralBackground1,
31
- },
32
- },
33
- ':active': {
34
- '& .ms-checkbox-indicator': {
35
- borderColor: theme.alias.color.neutral.neutralStrokeDisabled,
36
- color: theme.alias.color.neutral.neutralForegroundDisabled,
37
- backgroundColor: theme.alias.color.neutral.neutralBackground1,
38
- },
39
- },
40
- }); },
41
- unchecked: function (theme) { return ({
42
- color: theme.alias.color.neutral.neutralForeground3,
43
- '& .ms-checkbox-indicator': {
44
- borderColor: theme.alias.color.neutral.neutralStrokeAccessible,
45
- '& > *': {
46
- opacity: 0,
47
- },
48
- },
49
- ':hover': {
50
- color: theme.alias.color.neutral.neutralForeground2,
51
- '& .ms-checkbox-indicator': {
52
- borderColor: theme.alias.color.neutral.neutralStrokeAccessibleHover,
53
- },
54
- },
55
- ':active': {
56
- color: theme.alias.color.neutral.neutralForeground1,
57
- '& .ms-checkbox-indicator': {
58
- borderColor: theme.alias.color.neutral.neutralStrokeAccessiblePressed,
59
- },
60
- },
61
- }); },
62
- checked: function (theme) { return ({
63
- color: theme.alias.color.neutral.neutralForeground1,
64
- // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added
65
- '& .ms-checkbox-indicator': {
66
- backgroundColor: theme.alias.color.neutral.compoundBrandBackground,
67
- color: theme.alias.color.neutral.neutralForegroundInverted,
68
- borderColor: theme.alias.color.neutral.brandBackground,
69
- },
70
- ':active': {
71
- '& .ms-checkbox-indicator': {
72
- backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundPressed,
73
- },
74
- },
75
- ':hover': {
76
- '& .ms-checkbox-indicator': {
77
- backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundHover,
78
- },
79
- },
80
- }); },
81
- mixed: function (theme) { return ({
82
- color: theme.alias.color.neutral.neutralForeground1,
83
- '& .ms-checkbox-indicator': {
84
- borderColor: theme.alias.color.neutral.compoundBrandStroke,
85
- color: theme.alias.color.neutral.compoundBrandForeground1,
86
- },
87
- ':active': {
88
- '& .ms-checkbox-indicator': {
89
- borderColor: theme.alias.color.neutral.compoundBrandStrokePressed,
90
- color: theme.alias.color.neutral.compoundBrandForeground1Pressed,
91
- },
92
- },
93
- ':hover': {
94
- '& .ms-checkbox-indicator': {
95
- borderColor: theme.alias.color.neutral.compoundBrandStrokeHover,
96
- color: theme.alias.color.neutral.compoundBrandForeground1Hover,
97
- },
98
- },
99
- }); },
100
- focusIndictor: react_tabster_1.createFocusIndicatorStyleRule(function (theme) { return ({
101
- ':after': {
102
- content: "''",
103
- position: 'absolute',
104
- width: '100%',
105
- height: '100%',
106
- border: "2px solid " + theme.alias.color.neutral.neutralForeground1,
107
- borderRadius: '4px',
108
- margin: '-6px',
109
- },
110
- }); }, { selector: 'focus-within' }),
111
- });
112
- var useContainerStyles = react_make_styles_1.makeStyles({
113
- container: {
114
- position: 'relative',
115
- display: 'flex',
116
- alignItems: 'center',
117
- justifyContent: 'center',
118
- },
119
- medium: {
120
- width: '16px',
121
- height: '16px',
122
- },
123
- large: {
124
- width: '20px',
125
- height: '20px',
126
- },
127
- // TODO: change marginLeft to Spacing horizontal M once it's added
128
- before: function (theme) { return ({
129
- marginLeft: '12px',
130
- }); },
131
- // TODO: change marginRight to Spacing horizontal M once it's added
132
- after: function (theme) { return ({
133
- marginRight: '12px',
134
- }); },
135
- });
136
- var useInputStyles = react_make_styles_1.makeStyles({
137
- input: {
138
- opacity: 0,
139
- position: 'absolute',
140
- margin: 0,
141
- padding: 0,
142
- cursor: 'pointer',
143
- },
144
- disabled: {
145
- cursor: 'not-allowed',
146
- },
147
- });
148
- var useIndicatorStyles = react_make_styles_1.makeStyles({
149
- box: function (theme) { return ({
150
- width: '100%',
151
- height: '100%',
152
- fill: 'currentColor',
153
- overflow: 'hidden',
154
- display: 'flex',
155
- alignItems: 'center',
156
- justifyContent: 'center',
157
- position: 'absolute',
158
- boxSizing: 'border-box',
159
- borderStyle: 'solid',
160
- borderRadius: theme.global.borderRadius.small,
161
- borderWidth: theme.global.strokeWidth.thin,
162
- }); },
163
- circular: function (theme) { return ({
164
- borderRadius: theme.global.borderRadius.circular,
165
- }); },
166
- });
167
- /**
168
- * Apply styling to the Checkbox slots based on the state
169
- */
170
- var useCheckboxStyles = function (state) {
171
- var checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';
172
- var indicatorStyles = useIndicatorStyles();
173
- var inputStyles = useInputStyles();
174
- var containerStyles = useContainerStyles();
175
- var styles = useStyles();
176
- state.className = react_make_styles_1.mergeClasses(styles.root, styles.focusIndictor, styles[checkedState], state.disabled && styles.disabled, state.className);
177
- state.input.className = react_make_styles_1.mergeClasses(containerStyles[state.size], inputStyles.input, state.disabled && inputStyles.disabled, state.input.className);
178
- state.containerClassName = react_make_styles_1.mergeClasses(containerStyles.container, containerStyles[state.size], !!state.children && containerStyles[state.labelPosition]);
179
- state.indicator.className = react_make_styles_1.mergeClasses(indicatorStyles.box, containerStyles[state.size], state.circular && indicatorStyles.circular, 'ms-checkbox-indicator', state.indicator.className);
180
- return state;
181
- };
182
- exports.useCheckboxStyles = useCheckboxStyles;
183
- });
184
- //# sourceMappingURL=useCheckboxStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCheckboxStyles.js","sourceRoot":"../src/","sources":["components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,SAAS;SAClB,CAAC,EARa,CAQb;QAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK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ourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport { CheckboxState } from './Checkbox.types';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n display: 'inline-flex',\n position: 'relative',\n alignSelf: 'flex-start',\n alignItems: 'center',\n padding: '4px',\n userSelect: 'none',\n cursor: 'pointer',\n }),\n\n disabled: theme => ({\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n cursor: 'default',\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n },\n },\n }),\n\n unchecked: theme => ({\n color: theme.alias.color.neutral.neutralForeground3,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessible,\n '& > *': {\n opacity: 0,\n },\n },\n\n ':hover': {\n color: theme.alias.color.neutral.neutralForeground2,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessibleHover,\n },\n },\n\n ':active': {\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.neutralStrokeAccessiblePressed,\n },\n },\n }),\n\n checked: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackground,\n color: theme.alias.color.neutral.neutralForegroundInverted,\n borderColor: theme.alias.color.neutral.brandBackground,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundPressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n backgroundColor: theme.alias.color.neutral.compoundBrandBackgroundHover,\n },\n },\n }),\n\n mixed: theme => ({\n color: theme.alias.color.neutral.neutralForeground1,\n\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStroke,\n color: theme.alias.color.neutral.compoundBrandForeground1,\n },\n\n ':active': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokePressed,\n color: theme.alias.color.neutral.compoundBrandForeground1Pressed,\n },\n },\n\n ':hover': {\n '& .ms-checkbox-indicator': {\n borderColor: theme.alias.color.neutral.compoundBrandStrokeHover,\n color: theme.alias.color.neutral.compoundBrandForeground1Hover,\n },\n },\n }),\n\n focusIndictor: createFocusIndicatorStyleRule(\n theme => ({\n ':after': {\n content: \"''\",\n position: 'absolute',\n width: '100%',\n height: '100%',\n border: `2px solid ${theme.alias.color.neutral.neutralForeground1}`,\n borderRadius: '4px',\n margin: '-6px',\n },\n }),\n { selector: 'focus-within' },\n ),\n});\n\nconst useContainerStyles = makeStyles({\n container: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n medium: {\n width: '16px',\n height: '16px',\n },\n\n large: {\n width: '20px',\n height: '20px',\n },\n\n // TODO: change marginLeft to Spacing horizontal M once it's added\n before: theme => ({\n marginLeft: '12px',\n }),\n\n // TODO: change marginRight to Spacing horizontal M once it's added\n after: theme => ({\n marginRight: '12px',\n }),\n});\n\nconst useInputStyles = makeStyles({\n input: {\n opacity: 0,\n position: 'absolute',\n margin: 0,\n padding: 0,\n cursor: 'pointer',\n },\n\n disabled: {\n cursor: 'not-allowed',\n },\n});\n\nconst useIndicatorStyles = makeStyles({\n box: theme => ({\n width: '100%',\n height: '100%',\n fill: 'currentColor',\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderRadius: theme.global.borderRadius.small,\n borderWidth: theme.global.strokeWidth.thin,\n }),\n\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n});\n\n/**\n * Apply styling to the Checkbox slots based on the state\n */\nexport const useCheckboxStyles = (state: CheckboxState): CheckboxState => {\n const checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';\n const indicatorStyles = useIndicatorStyles();\n const inputStyles = useInputStyles();\n const containerStyles = useContainerStyles();\n const styles = useStyles();\n\n state.className = mergeClasses(\n styles.root,\n styles.focusIndictor,\n styles[checkedState],\n state.disabled && styles.disabled,\n state.className,\n );\n\n state.input.className = mergeClasses(\n containerStyles[state.size],\n inputStyles.input,\n state.disabled && inputStyles.disabled,\n state.input.className,\n );\n\n state.containerClassName = mergeClasses(\n containerStyles.container,\n containerStyles[state.size],\n !!state.children && containerStyles[state.labelPosition],\n );\n state.indicator.className = mergeClasses(\n indicatorStyles.box,\n containerStyles[state.size],\n state.circular && indicatorStyles.circular,\n 'ms-checkbox-indicator',\n state.indicator.className,\n );\n\n return state;\n};\n"]}
@@ -1 +0,0 @@
1
- export * from './Checkbox';
package/lib-amd/index.js DELETED
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./Checkbox"], function (require, exports, tslib_1, Checkbox_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Checkbox_1, exports);
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B","sourcesContent":["export * from './Checkbox';\n"]}