@fluentui/react-checkbox 9.0.0-beta.3 → 9.0.0-beta.8

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 (55) hide show
  1. package/CHANGELOG.json +311 -1
  2. package/CHANGELOG.md +73 -2
  3. package/Spec.md +25 -115
  4. package/dist/react-checkbox.d.ts +37 -46
  5. package/lib/Checkbox.js.map +1 -1
  6. package/lib/components/Checkbox/Checkbox.d.ts +2 -1
  7. package/lib/components/Checkbox/Checkbox.js +10 -8
  8. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  9. package/lib/components/Checkbox/Checkbox.types.d.ts +29 -34
  10. package/lib/components/Checkbox/Checkbox.types.js.map +1 -1
  11. package/lib/components/Checkbox/index.js.map +1 -1
  12. package/lib/components/Checkbox/renderCheckbox.d.ts +1 -1
  13. package/lib/components/Checkbox/renderCheckbox.js +11 -10
  14. package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
  15. package/lib/components/Checkbox/useCheckbox.d.ts +5 -9
  16. package/lib/components/Checkbox/useCheckbox.js +99 -68
  17. package/lib/components/Checkbox/useCheckbox.js.map +1 -1
  18. package/lib/components/Checkbox/useCheckboxStyles.d.ts +2 -1
  19. package/lib/components/Checkbox/useCheckboxStyles.js +216 -159
  20. package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
  21. package/lib/index.js.map +1 -1
  22. package/lib-commonjs/Checkbox.js +7 -2
  23. package/lib-commonjs/Checkbox.js.map +1 -1
  24. package/lib-commonjs/components/Checkbox/Checkbox.d.ts +2 -1
  25. package/lib-commonjs/components/Checkbox/Checkbox.js +20 -10
  26. package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
  27. package/lib-commonjs/components/Checkbox/Checkbox.types.d.ts +29 -34
  28. package/lib-commonjs/components/Checkbox/Checkbox.types.js +4 -1
  29. package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
  30. package/lib-commonjs/components/Checkbox/index.js +11 -2
  31. package/lib-commonjs/components/Checkbox/index.js.map +1 -1
  32. package/lib-commonjs/components/Checkbox/renderCheckbox.d.ts +1 -1
  33. package/lib-commonjs/components/Checkbox/renderCheckbox.js +23 -15
  34. package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
  35. package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +5 -9
  36. package/lib-commonjs/components/Checkbox/useCheckbox.js +113 -73
  37. package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
  38. package/lib-commonjs/components/Checkbox/useCheckboxStyles.d.ts +2 -1
  39. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +228 -163
  40. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
  41. package/lib-commonjs/index.js +7 -2
  42. package/lib-commonjs/index.js.map +1 -1
  43. package/package.json +11 -11
  44. package/lib/common/isConformant.d.ts +0 -4
  45. package/lib/common/isConformant.js +0 -12
  46. package/lib/common/isConformant.js.map +0 -1
  47. package/lib/components/Checkbox/DefaultIcons.d.ts +0 -4
  48. package/lib/components/Checkbox/DefaultIcons.js +0 -10
  49. package/lib/components/Checkbox/DefaultIcons.js.map +0 -1
  50. package/lib-commonjs/common/isConformant.d.ts +0 -4
  51. package/lib-commonjs/common/isConformant.js +0 -16
  52. package/lib-commonjs/common/isConformant.js.map +0 -1
  53. package/lib-commonjs/components/Checkbox/DefaultIcons.d.ts +0 -4
  54. package/lib-commonjs/components/Checkbox/DefaultIcons.js +0 -17
  55. package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { CheckboxState } from './Checkbox.types';
2
+ export declare const checkboxClassName = "fui-Checkbox";
2
3
  /**
3
4
  * Apply styling to the Checkbox slots based on the state
4
5
  */
5
- export declare const useCheckboxStyles: (state: CheckboxState) => CheckboxState;
6
+ export declare const useCheckboxStyles_unstable: (state: CheckboxState) => CheckboxState;
@@ -1,172 +1,229 @@
1
- import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';
1
+ import { shorthands, __styles, mergeClasses } from '@griffel/react';
2
2
  import { createFocusOutlineStyle } from '@fluentui/react-tabster';
3
+ import { tokens } from '@fluentui/react-theme';
4
+ export const checkboxClassName = 'fui-Checkbox';
5
+ const indicatorClassName = 'fui-Checkbox-indicator'; // TODO replace these spacing constants with theme values once they're on the theme
6
+
7
+ const spacingHorizontalS = '8px';
8
+ const spacingHorizontalM = '12px'; // The indicator size is used by the indicator and label styles
9
+
10
+ const indicatorSizeMedium = '16px';
11
+ const indicatorSizeLarge = '20px';
3
12
  /**
4
13
  * Styles for the root slot
5
14
  */
6
- var useStyles = makeStyles({
7
- root: function (theme) { return ({
8
- display: 'inline-flex',
9
- position: 'relative',
10
- alignSelf: 'flex-start',
11
- alignItems: 'center',
12
- padding: '4px',
13
- userSelect: 'none',
14
- cursor: 'pointer',
15
- }); },
16
- disabled: function (theme) { return ({
17
- color: theme.colorNeutralForegroundDisabled,
18
- cursor: 'default',
19
- '& .ms-checkbox-indicator': {
20
- borderColor: theme.colorNeutralStrokeDisabled,
21
- color: theme.colorNeutralForegroundDisabled,
22
- backgroundColor: theme.colorNeutralBackground1,
23
- },
24
- ':hover': {
25
- '& .ms-checkbox-indicator': {
26
- borderColor: theme.colorNeutralStrokeDisabled,
27
- color: theme.colorNeutralForegroundDisabled,
28
- backgroundColor: theme.colorNeutralBackground1,
29
- },
30
- },
31
- ':active': {
32
- '& .ms-checkbox-indicator': {
33
- borderColor: theme.colorNeutralStrokeDisabled,
34
- color: theme.colorNeutralForegroundDisabled,
35
- backgroundColor: theme.colorNeutralBackground1,
36
- },
37
- },
38
- }); },
39
- unchecked: function (theme) { return ({
40
- color: theme.colorNeutralForeground3,
41
- '& .ms-checkbox-indicator': {
42
- borderColor: theme.colorNeutralStrokeAccessible,
43
- '& > *': {
44
- opacity: 0,
45
- },
46
- },
47
- ':hover': {
48
- color: theme.colorNeutralForeground2,
49
- '& .ms-checkbox-indicator': {
50
- borderColor: theme.colorNeutralStrokeAccessibleHover,
51
- },
52
- },
53
- ':active': {
54
- color: theme.colorNeutralForeground1,
55
- '& .ms-checkbox-indicator': {
56
- borderColor: theme.colorNeutralStrokeAccessiblePressed,
57
- },
58
- },
59
- }); },
60
- checked: function (theme) { return ({
61
- color: theme.colorNeutralForeground1,
62
- // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added
63
- '& .ms-checkbox-indicator': {
64
- backgroundColor: theme.colorCompoundBrandBackground,
65
- color: theme.colorNeutralForegroundInverted,
66
- borderColor: theme.colorBrandBackground,
67
- },
68
- ':active': {
69
- '& .ms-checkbox-indicator': {
70
- backgroundColor: theme.colorCompoundBrandBackgroundPressed,
71
- },
72
- },
73
- ':hover': {
74
- '& .ms-checkbox-indicator': {
75
- backgroundColor: theme.colorCompoundBrandBackgroundHover,
76
- },
77
- },
78
- }); },
79
- mixed: function (theme) { return ({
80
- color: theme.colorNeutralForeground1,
81
- '& .ms-checkbox-indicator': {
82
- borderColor: theme.colorCompoundBrandStroke,
83
- color: theme.colorCompoundBrandForeground1,
84
- },
85
- ':active': {
86
- '& .ms-checkbox-indicator': {
87
- borderColor: theme.colorCompoundBrandStrokePressed,
88
- color: theme.colorCompoundBrandForeground1Pressed,
89
- },
90
- },
91
- ':hover': {
92
- '& .ms-checkbox-indicator': {
93
- borderColor: theme.colorCompoundBrandStrokeHover,
94
- color: theme.colorCompoundBrandForeground1Hover,
95
- },
96
- },
97
- }); },
98
- focusIndicator: function (theme) {
99
- return createFocusOutlineStyle(theme, { style: { outlineOffset: '2px' }, selector: 'focus-within' });
100
- },
15
+
16
+ const useRootStyles = /*#__PURE__*/__styles({
17
+ "base": {
18
+ "qhf8xq": "f10pi13n",
19
+ "mc9l5x": "ftuwxu6",
20
+ "Beiy3e4": "f1063pyq",
21
+ "Bceei9c": "f1k6fduh",
22
+ "i8kkvl": "f4akndk",
23
+ "z8tnut": "fp9bwmr",
24
+ "z189sj": ["f19lj068", "f177v4lu"],
25
+ "Byoj8tv": "f150uoa4",
26
+ "uwmqm3": ["f177v4lu", "f19lj068"]
27
+ },
28
+ "disabled": {
29
+ "Bceei9c": "f158kwzp"
30
+ },
31
+ "focusIndicator": {
32
+ "B486eqv": "f2hkw1w",
33
+ "c2y4jd": "fsofd9k",
34
+ "B8vm7ur": "f12sql3b",
35
+ "f4hv8x": "f1i4q40k",
36
+ "Gpan81": "fcrbge9",
37
+ "z7afg": "ft464mn",
38
+ "rsjj6t": "fskqmiq",
39
+ "Bqsd8kq": "f2gy8jn",
40
+ "sfhsbh": "f1pke3uf",
41
+ "Bugh3ej": "f18xdlq9",
42
+ "hpanx6": "f1114nks",
43
+ "Bjkpy09": "f1unftzx",
44
+ "Jxg1p8": "f8rjbh6",
45
+ "Bc94xmo": ["fxfgh6q", "f8l10fm"],
46
+ "Bj23z95": ["f8l10fm", "fxfgh6q"]
47
+ },
48
+ "uncheckedColors": {
49
+ "sj55zd": "f11d4kpn",
50
+ "B2uuno9": "fwkyayc",
51
+ "qasus0": ["f7aqmyg", "ft2adke"],
52
+ "joesme": "f1w1qo1y",
53
+ "qcmoe7": ["ft2adke", "f7aqmyg"],
54
+ "Bi91k9c": "f3p8bqa",
55
+ "vpay66": "fft1thc",
56
+ "fgdpeo": ["f1w8do5y", "fepve6s"],
57
+ "ooapsn": "fdf0l0r",
58
+ "ev9ftv": ["fepve6s", "f1w8do5y"],
59
+ "Bfw6nra": "fesph6q",
60
+ "Brbcl2": "f1mhtrce",
61
+ "E16u1b": ["f17v52hn", "fg62ii9"],
62
+ "c4amgi": "f1r1cpih",
63
+ "Bepp5ky": ["fg62ii9", "f17v52hn"]
64
+ },
65
+ "checkedColors": {
66
+ "sj55zd": "f19n0e5",
67
+ "mrtg77": "f1nckptt",
68
+ "bxuuxi": "f19uhq4u",
69
+ "B2uuno9": "ffzu9nk",
70
+ "qasus0": ["f1g19ujf", "fvb8adx"],
71
+ "joesme": "f1emw82k",
72
+ "qcmoe7": ["fvb8adx", "f1g19ujf"],
73
+ "Bqcm5gq": "fc90h92",
74
+ "vpay66": "f1gd0goh",
75
+ "fgdpeo": ["f926psx", "f1pjby8k"],
76
+ "ooapsn": "f1b2jcp4",
77
+ "ev9ftv": ["f1pjby8k", "f926psx"],
78
+ "Bn43wis": "f8zpi21",
79
+ "Brbcl2": "f1irvqu2",
80
+ "E16u1b": ["f5uvb4g", "f1vydb2"],
81
+ "c4amgi": "fgkonep",
82
+ "Bepp5ky": ["f1vydb2", "f5uvb4g"]
83
+ },
84
+ "mixedColors": {
85
+ "sj55zd": "f19n0e5",
86
+ "B2uuno9": "fkebysb",
87
+ "qasus0": ["f1k0bg1", "f4oydaf"],
88
+ "joesme": "fi1mkuk",
89
+ "qcmoe7": ["f4oydaf", "f1k0bg1"],
90
+ "bxuuxi": "f1n04o3z",
91
+ "vpay66": "fdfakjf",
92
+ "fgdpeo": ["fvqbddr", "f1babrrv"],
93
+ "ooapsn": "f1jbek0d",
94
+ "ev9ftv": ["f1babrrv", "fvqbddr"],
95
+ "Iwvt79": "f1mps0ds",
96
+ "Brbcl2": "f1tallx",
97
+ "E16u1b": ["f9cmnyc", "f1skyj24"],
98
+ "c4amgi": "f12y7q7q",
99
+ "Bepp5ky": ["f1skyj24", "f9cmnyc"],
100
+ "Ewzbd8": "f135b915"
101
+ },
102
+ "disabledColors": {
103
+ "sj55zd": "f1s2aq7o",
104
+ "B2uuno9": "f1bezmwk",
105
+ "qasus0": ["fb9vlya", "f1ubioqa"],
106
+ "joesme": "fu4x4v",
107
+ "qcmoe7": ["f1ubioqa", "fb9vlya"],
108
+ "bxuuxi": "fpjy2vv"
109
+ }
110
+ }, {
111
+ "d": [".f10pi13n{position:relative;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".f1k6fduh{cursor:pointer;}", ".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".f158kwzp{cursor:default;}", "[data-keyboard-nav] .fsofd9k:focus-within{border-color:transparent;}", "[data-keyboard-nav] .f12sql3b:focus-within:after{content:\"\";}", "[data-keyboard-nav] .f1i4q40k:focus-within:after{position:absolute;}", "[data-keyboard-nav] .fcrbge9:focus-within:after{pointer-events:none;}", "[data-keyboard-nav] .ft464mn:focus-within:after{box-sizing:outline-box;}", "[data-keyboard-nav] .fskqmiq:focus-within:after{z-index:1;}", "[data-keyboard-nav] .f2gy8jn:focus-within:after{border-style:solid;}", "[data-keyboard-nav] .f1pke3uf:focus-within:after{border-width:2px;}", "[data-keyboard-nav] .f18xdlq9:focus-within:after{border-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f1114nks:focus-within:after{border-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1unftzx:focus-within:after{top:-2px;}", "[data-keyboard-nav] .f8rjbh6:focus-within:after{bottom:-2px;}", "[data-keyboard-nav] .fxfgh6q:focus-within:after{left:-2px;}", "[data-keyboard-nav] .f8l10fm:focus-within:after{right:-2px;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fwkyayc .fui-Checkbox-indicator{border-top-color:var(--colorNeutralStrokeAccessible);}", ".f7aqmyg .fui-Checkbox-indicator{border-right-color:var(--colorNeutralStrokeAccessible);}", ".ft2adke .fui-Checkbox-indicator{border-left-color:var(--colorNeutralStrokeAccessible);}", ".f1w1qo1y .fui-Checkbox-indicator{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1nckptt .fui-Checkbox-indicator{background-color:var(--colorCompoundBrandBackground);}", ".f19uhq4u .fui-Checkbox-indicator{color:var(--colorNeutralForegroundOnBrand);}", ".ffzu9nk .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandBackground);}", ".f1g19ujf .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandBackground);}", ".fvb8adx .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandBackground);}", ".f1emw82k .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandBackground);}", ".fkebysb .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandStroke);}", ".f1k0bg1 .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandStroke);}", ".f4oydaf .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandStroke);}", ".fi1mkuk .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandStroke);}", ".f1n04o3z .fui-Checkbox-indicator{color:var(--colorCompoundBrandForeground1);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1bezmwk .fui-Checkbox-indicator{border-top-color:var(--colorNeutralStrokeDisabled);}", ".fb9vlya .fui-Checkbox-indicator{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1ubioqa .fui-Checkbox-indicator{border-left-color:var(--colorNeutralStrokeDisabled);}", ".fu4x4v .fui-Checkbox-indicator{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".fpjy2vv .fui-Checkbox-indicator{color:var(--colorNeutralForegroundDisabled);}"],
112
+ "i": [".f2hkw1w:focus-visible{outline-style:none;}"],
113
+ "h": [".f3p8bqa:hover{color:var(--colorNeutralForeground2);}", ".fft1thc:hover .fui-Checkbox-indicator{border-top-color:var(--colorNeutralStrokeAccessibleHover);}", ".f1w8do5y:hover .fui-Checkbox-indicator{border-right-color:var(--colorNeutralStrokeAccessibleHover);}", ".fepve6s:hover .fui-Checkbox-indicator{border-left-color:var(--colorNeutralStrokeAccessibleHover);}", ".fdf0l0r:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".fc90h92:hover .fui-Checkbox-indicator{background-color:var(--colorCompoundBrandBackgroundHover);}", ".f1gd0goh:hover .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandBackgroundHover);}", ".f926psx:hover .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandBackgroundHover);}", ".f1pjby8k:hover .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandBackgroundHover);}", ".f1b2jcp4:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandBackgroundHover);}", ".fdfakjf:hover .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandStrokeHover);}", ".fvqbddr:hover .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandStrokeHover);}", ".f1babrrv:hover .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandStrokeHover);}", ".f1jbek0d:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandStrokeHover);}", ".f1mps0ds:hover .fui-Checkbox-indicator{color:var(--colorCompoundBrandForeground1Hover);}"],
114
+ "a": [".fesph6q:active:hover{color:var(--colorNeutralForeground1);}", ".f1mhtrce:active:hover .fui-Checkbox-indicator{border-top-color:var(--colorNeutralStrokeAccessiblePressed);}", ".f17v52hn:active:hover .fui-Checkbox-indicator{border-right-color:var(--colorNeutralStrokeAccessiblePressed);}", ".fg62ii9:active:hover .fui-Checkbox-indicator{border-left-color:var(--colorNeutralStrokeAccessiblePressed);}", ".f1r1cpih:active:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}", ".f8zpi21:active:hover .fui-Checkbox-indicator{background-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1irvqu2:active:hover .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandBackgroundPressed);}", ".f5uvb4g:active:hover .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1vydb2:active:hover .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandBackgroundPressed);}", ".fgkonep:active:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1tallx:active:hover .fui-Checkbox-indicator{border-top-color:var(--colorCompoundBrandStrokePressed);}", ".f9cmnyc:active:hover .fui-Checkbox-indicator{border-right-color:var(--colorCompoundBrandStrokePressed);}", ".f1skyj24:active:hover .fui-Checkbox-indicator{border-left-color:var(--colorCompoundBrandStrokePressed);}", ".f12y7q7q:active:hover .fui-Checkbox-indicator{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".f135b915:active:hover .fui-Checkbox-indicator{color:var(--colorCompoundBrandForeground1Pressed);}"]
101
115
  });
102
- var useContainerStyles = makeStyles({
103
- container: {
104
- position: 'relative',
105
- display: 'flex',
106
- alignItems: 'center',
107
- justifyContent: 'center',
108
- },
109
- medium: {
110
- width: '16px',
111
- height: '16px',
112
- },
113
- large: {
114
- width: '20px',
115
- height: '20px',
116
- },
117
- // TODO: change marginLeft to Spacing horizontal M once it's added
118
- before: function (theme) { return ({
119
- marginLeft: '12px',
120
- }); },
121
- // TODO: change marginRight to Spacing horizontal M once it's added
122
- after: function (theme) { return ({
123
- marginRight: '12px',
124
- }); },
116
+
117
+ const useInputStyles = /*#__PURE__*/__styles({
118
+ "base": {
119
+ "qhf8xq": "f1euv43f",
120
+ "oyh7mz": ["f1vgc2s3", "f1e31b4d"],
121
+ "Bhzewxz": "f15twtuk",
122
+ "a9b677": "fly5x3f",
123
+ "Bqenvij": "f1l02sjl",
124
+ "B7ck84d": "f1ewtqcl",
125
+ "B6of3ja": "f1hu3pq6",
126
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
127
+ "jrapky": "f19f4twv",
128
+ "Frg6f3": ["f1tyq0we", "f11qmguv"],
129
+ "abs64n": "fk73vx1",
130
+ "Bceei9c": "fpo1scq"
131
+ }
132
+ }, {
133
+ "d": [".f1euv43f{position:absolute;}", ".f1vgc2s3{left:0;}", ".f1e31b4d{right:0;}", ".f15twtuk{top:0;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1ewtqcl{box-sizing:border-box;}", ".f1hu3pq6{margin-top:0;}", ".f11qmguv{margin-right:0;}", ".f1tyq0we{margin-left:0;}", ".f19f4twv{margin-bottom:0;}", ".fk73vx1{opacity:0;}", ".fpo1scq{cursor:inherit;}"]
125
134
  });
126
- var useInputStyles = makeStyles({
127
- input: {
128
- opacity: 0,
129
- position: 'absolute',
130
- margin: 0,
131
- padding: 0,
132
- cursor: 'pointer',
133
- },
134
- disabled: {
135
- cursor: 'not-allowed',
136
- },
135
+
136
+ const useIndicatorStyles = /*#__PURE__*/__styles({
137
+ "base": {
138
+ "qb2dma": "fjgzulp",
139
+ "B7ck84d": "f1ewtqcl",
140
+ "Bnnss6s": "fi64zpg",
141
+ "mc9l5x": "f22iagw",
142
+ "Bt984gj": "f122n59",
143
+ "Brf1p80": "f4d9j23",
144
+ "B68tc82": "f1p9o1ba",
145
+ "Bmxbyg5": "f1sil6mw",
146
+ "B4j52fo": "f192inf7",
147
+ "Bekrc4i": ["f5tn483", "f1ojsxk5"],
148
+ "Bn0qgzm": "f1vxd6vx",
149
+ "ibv6hh": ["f1ojsxk5", "f5tn483"],
150
+ "icvyot": "fzkkow9",
151
+ "vrafjx": ["fcdblym", "fjik90z"],
152
+ "oivjwe": "fg706s2",
153
+ "wvpqe5": ["fjik90z", "fcdblym"],
154
+ "Bbmb7ep": ["f1g3puop", "fi2rrw2"],
155
+ "Beyfa6y": ["fi2rrw2", "f1g3puop"],
156
+ "B7oj6ja": ["f1rstyi9", "f1s4nn1u"],
157
+ "Btl43ni": ["f1s4nn1u", "f1rstyi9"],
158
+ "Bkfmm31": "f1w9h62z",
159
+ "Bceei9c": "fpo1scq"
160
+ },
161
+ "medium": {
162
+ "a9b677": "fjw5fx7",
163
+ "Bqenvij": "fd461yt"
164
+ },
165
+ "large": {
166
+ "a9b677": "f64fuq3",
167
+ "Bqenvij": "fjamq6b"
168
+ },
169
+ "circular": {
170
+ "Bbmb7ep": ["f8fbkgy", "f1nfllo7"],
171
+ "Beyfa6y": ["f1nfllo7", "f8fbkgy"],
172
+ "B7oj6ja": ["f1djnp8u", "f1s8kh49"],
173
+ "Btl43ni": ["f1s8kh49", "f1djnp8u"]
174
+ },
175
+ "unchecked": {
176
+ "Bm7m4lb": "f1byn578"
177
+ }
178
+ }, {
179
+ "d": [".fjgzulp{-webkit-align-self:flex-start;-ms-flex-item-align:flex-start;align-self:flex-start;}", ".f1ewtqcl{box-sizing:border-box;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1g3puop{border-bottom-right-radius:var(--borderRadiusSmall);}", ".fi2rrw2{border-bottom-left-radius:var(--borderRadiusSmall);}", ".f1rstyi9{border-top-right-radius:var(--borderRadiusSmall);}", ".f1s4nn1u{border-top-left-radius:var(--borderRadiusSmall);}", ".f1w9h62z{fill:currentColor;}", ".fpo1scq{cursor:inherit;}", ".fjw5fx7{width:16px;}", ".fd461yt{height:16px;}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".f1byn578>*{opacity:0;}"]
137
180
  });
138
- var useIndicatorStyles = makeStyles({
139
- box: function (theme) { return ({
140
- width: '100%',
141
- height: '100%',
142
- fill: 'currentColor',
143
- overflow: 'hidden',
144
- display: 'flex',
145
- alignItems: 'center',
146
- justifyContent: 'center',
147
- position: 'absolute',
148
- boxSizing: 'border-box',
149
- borderStyle: 'solid',
150
- borderRadius: theme.borderRadiusSmall,
151
- borderWidth: theme.strokeWidthThin,
152
- }); },
153
- circular: function (theme) { return ({
154
- borderRadius: theme.borderRadiusCircular,
155
- }); },
181
+
182
+ const useLabelStyles = /*#__PURE__*/__styles({
183
+ "base": {
184
+ "qb2dma": "f7nlbp4",
185
+ "famaaq": "f1xqy1su",
186
+ "Bceei9c": "fpo1scq",
187
+ "sj55zd": "f1ym3bx4"
188
+ },
189
+ "medium": {
190
+ "B6of3ja": "fjzwpt6",
191
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
192
+ "jrapky": "fh6j2fo",
193
+ "Frg6f3": ["f1tyq0we", "f11qmguv"]
194
+ },
195
+ "large": {
196
+ "B6of3ja": "f1xlvstr",
197
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
198
+ "jrapky": "f49ad5g",
199
+ "Frg6f3": ["f1tyq0we", "f11qmguv"]
200
+ }
201
+ }, {
202
+ "d": [".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".fpo1scq{cursor:inherit;}", ".f1ym3bx4{color:inherit;}", ".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}", ".f11qmguv{margin-right:0;}", ".f1tyq0we{margin-left:0;}", ".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}", ".f1xlvstr{margin-top:calc((20px - var(--lineHeightBase300)) / 2);}", ".f49ad5g{margin-bottom:calc((20px - var(--lineHeightBase300)) / 2);}"]
156
203
  });
157
204
  /**
158
205
  * Apply styling to the Checkbox slots based on the state
159
206
  */
160
- export var useCheckboxStyles = function (state) {
161
- var checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';
162
- var indicatorStyles = useIndicatorStyles();
163
- var inputStyles = useInputStyles();
164
- var containerStyles = useContainerStyles();
165
- var styles = useStyles();
166
- state.root.className = mergeClasses(styles.root, styles.focusIndicator, styles[checkedState], state.input.disabled && styles.disabled, state.root.className);
167
- state.input.className = mergeClasses(containerStyles[state.size], inputStyles.input, state.input.disabled && inputStyles.disabled, state.input.className);
168
- state.containerClassName = mergeClasses(containerStyles.container, containerStyles[state.size], !!state.root.children && containerStyles[state.labelPosition]);
169
- state.indicator.className = mergeClasses(indicatorStyles.box, containerStyles[state.size], state.circular && indicatorStyles.circular, 'ms-checkbox-indicator', state.indicator.className);
170
- return state;
207
+
208
+
209
+ export const useCheckboxStyles_unstable = state => {
210
+ const rootStyles = useRootStyles();
211
+ state.root.className = mergeClasses(checkboxClassName, rootStyles.base, rootStyles.focusIndicator, state.input.disabled && rootStyles.disabled, // Pick exactly one of the color classes, based on `disabled` and `checked`
212
+ state.input.disabled ? rootStyles.disabledColors : state.checked === 'mixed' ? rootStyles.mixedColors : state.checked ? rootStyles.checkedColors : rootStyles.uncheckedColors, state.root.className);
213
+ const inputStyles = useInputStyles();
214
+ state.input.className = mergeClasses(inputStyles.base, state.input.className);
215
+ const indicatorStyles = useIndicatorStyles();
216
+
217
+ if (state.indicator) {
218
+ state.indicator.className = mergeClasses(indicatorClassName, indicatorStyles.base, indicatorStyles[state.size], state.circular && indicatorStyles.circular, !state.checked && indicatorStyles.unchecked, state.indicator.className);
219
+ }
220
+
221
+ const labelStyles = useLabelStyles();
222
+
223
+ if (state.label) {
224
+ state.label.className = mergeClasses(labelStyles.base, labelStyles[state.size], state.label.className);
225
+ }
226
+
227
+ return state;
171
228
  };
172
229
  //# sourceMappingURL=useCheckboxStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckboxStyles.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckboxStyles.ts"],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,CAAC,OAAN,GACA,UAAU,CAAC,aADX,GAEA,UAAU,CAAC,eAZkB,EAajC,KAAK,CAAC,IAAN,CAAW,SAbsB,CAAnC;AAgBA,QAAM,WAAW,GAAG,cAAc,EAAlC;AACA,EAAA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,YAAY,CAAC,WAAW,CAAC,IAAb,EAAmB,KAAK,CAAC,KAAN,CAAY,SAA/B,CAApC;AAEA,QAAM,eAAe,GAAG,kBAAkB,EAA1C;;AACA,MAAI,KAAK,CAAC,SAAV,EAAqB;AACnB,IAAA,KAAK,CAAC,SAAN,CAAgB,SAAhB,GAA4B,YAAY,CACtC,kBADsC,EAEtC,eAAe,CAAC,IAFsB,EAGtC,eAAe,CAAC,KAAK,CAAC,IAAP,CAHuB,EAItC,KAAK,CAAC,QAAN,IAAkB,eAAe,CAAC,QAJI,EAKtC,CAAC,KAAK,CAAC,OAAP,IAAkB,eAAe,CAAC,SALI,EAMtC,KAAK,CAAC,SAAN,CAAgB,SANsB,CAAxC;AAQD;;AAED,QAAM,WAAW,GAAG,cAAc,EAAlC;;AACA,MAAI,KAAK,CAAC,KAAV,EAAiB;AACf,IAAA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,YAAY,CAAC,WAAW,CAAC,IAAb,EAAmB,WAAW,CAAC,KAAK,CAAC,IAAP,CAA9B,EAA4C,KAAK,CAAC,KAAN,CAAY,SAAxD,CAApC;AACD;;AAED,SAAO,KAAP;AACD,CAvCM","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { CheckboxState } from './Checkbox.types';\n\nexport const checkboxClassName = 'fui-Checkbox';\nconst indicatorClassName = 'fui-Checkbox-indicator';\n\n// TODO replace these spacing constants with theme values once they're on the theme\nconst spacingHorizontalS = '8px';\nconst spacingHorizontalM = '12px';\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSizeMedium = '16px';\nconst indicatorSizeLarge = '20px';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n position: 'relative',\n display: 'inline-flex',\n flexDirection: 'row',\n cursor: 'pointer',\n columnGap: spacingHorizontalM,\n ...shorthands.padding(spacingHorizontalS),\n },\n\n disabled: {\n cursor: 'default',\n },\n\n focusIndicator: createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n\n // These `__Colors` styles are mutually exclusive: exactly one should be applied at any time\n uncheckedColors: {\n color: tokens.colorNeutralForeground3,\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n },\n\n ':hover': {\n color: tokens.colorNeutralForeground2,\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessibleHover),\n },\n },\n\n ':active:hover': {\n color: tokens.colorNeutralForeground1,\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessiblePressed),\n },\n },\n },\n\n checkedColors: {\n color: tokens.colorNeutralForeground1,\n [`& .${indicatorClassName}`]: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackground),\n },\n\n ':hover': {\n [`& .${indicatorClassName}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundHover),\n },\n },\n\n ':active:hover': {\n [`& .${indicatorClassName}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundPressed),\n },\n },\n },\n\n mixedColors: {\n color: tokens.colorNeutralForeground1,\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke),\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokeHover),\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':active:hover': {\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokePressed),\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n disabledColors: {\n color: tokens.colorNeutralForegroundDisabled,\n [`& .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n base: {\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n ...shorthands.margin(0),\n opacity: 0,\n cursor: 'inherit',\n },\n});\n\nconst useIndicatorStyles = makeStyles({\n base: {\n alignSelf: 'flex-start',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n ...shorthands.overflow('hidden'),\n\n ...shorthands.border(tokens.strokeWidthThin, 'solid'),\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n fill: 'currentColor',\n cursor: 'inherit',\n },\n\n medium: {\n width: indicatorSizeMedium,\n height: indicatorSizeMedium,\n },\n\n large: {\n width: indicatorSizeLarge,\n height: indicatorSizeLarge,\n },\n\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n\n unchecked: {\n '& > *': {\n opacity: '0',\n },\n },\n});\n\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n userSelect: 'none',\n cursor: 'inherit',\n color: 'inherit',\n },\n\n // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.\n // This prevents the label from expanding the height of the Checkbox, but preserves line height if the label wraps.\n medium: {\n ...shorthands.margin(`calc((${indicatorSizeMedium} - ${tokens.lineHeightBase300}) / 2)`, 0),\n },\n large: {\n ...shorthands.margin(`calc((${indicatorSizeLarge} - ${tokens.lineHeightBase300}) / 2)`, 0),\n },\n});\n\n/**\n * Apply styling to the Checkbox slots based on the state\n */\nexport const useCheckboxStyles_unstable = (state: CheckboxState): CheckboxState => {\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n checkboxClassName,\n rootStyles.base,\n rootStyles.focusIndicator,\n state.input.disabled && rootStyles.disabled,\n // Pick exactly one of the color classes, based on `disabled` and `checked`\n state.input.disabled\n ? rootStyles.disabledColors\n : state.checked === 'mixed'\n ? rootStyles.mixedColors\n : state.checked\n ? rootStyles.checkedColors\n : rootStyles.uncheckedColors,\n state.root.className,\n );\n\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(inputStyles.base, state.input.className);\n\n const indicatorStyles = useIndicatorStyles();\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n indicatorClassName,\n indicatorStyles.base,\n indicatorStyles[state.size],\n state.circular && indicatorStyles.circular,\n !state.checked && indicatorStyles.unchecked,\n state.indicator.className,\n );\n }\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(labelStyles.base, labelStyles[state.size], state.label.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC","sourcesContent":["export * from './Checkbox';\n"]}
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
4
9
  tslib_1.__exportStar(require("./components/Checkbox/index"), exports);
5
10
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
1
+ {"version":3,"sources":["Checkbox.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,6BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Checkbox/index';\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,7 @@
1
1
  import type { CheckboxProps } from './Checkbox.types';
2
2
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * A Checkbox component provides a way to represent options that can be selected
4
+ * Checkboxes give people a way to select one or more items from a group,
5
+ * or switch between two mutually exclusive options (checked or unchecked).
5
6
  */
6
7
  export declare const Checkbox: ForwardRefComponent<CheckboxProps>;
@@ -1,17 +1,27 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.Checkbox = void 0;
4
- var React = require("react");
5
- var useCheckbox_1 = require("./useCheckbox");
6
- var renderCheckbox_1 = require("./renderCheckbox");
7
- var useCheckboxStyles_1 = require("./useCheckboxStyles");
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const useCheckbox_1 = /*#__PURE__*/require("./useCheckbox");
11
+
12
+ const renderCheckbox_1 = /*#__PURE__*/require("./renderCheckbox");
13
+
14
+ const useCheckboxStyles_1 = /*#__PURE__*/require("./useCheckboxStyles");
8
15
  /**
9
- * A Checkbox component provides a way to represent options that can be selected
16
+ * Checkboxes give people a way to select one or more items from a group,
17
+ * or switch between two mutually exclusive options (checked or unchecked).
10
18
  */
11
- exports.Checkbox = React.forwardRef(function (props, ref) {
12
- var state = useCheckbox_1.useCheckbox(props, ref);
13
- useCheckboxStyles_1.useCheckboxStyles(state);
14
- return renderCheckbox_1.renderCheckbox(state);
19
+
20
+
21
+ exports.Checkbox = /*#__PURE__*/React.forwardRef((props, ref) => {
22
+ const state = useCheckbox_1.useCheckbox_unstable(props, ref);
23
+ useCheckboxStyles_1.useCheckboxStyles_unstable(state);
24
+ return renderCheckbox_1.renderCheckbox_unstable(state);
15
25
  });
16
26
  exports.Checkbox.displayName = 'Checkbox';
17
27
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6CAA4C;AAC5C,mDAAkD;AAClD,yDAAwD;AAIxD;;GAEG;AACU,QAAA,QAAQ,GAAuC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;IACtF,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
+ {"version":3,"sources":["components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,aAAA,CAAA,oBAAA,CAAqB,KAArB,EAA4B,GAA5B,CAAd;AAEA,EAAA,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;AACA,SAAO,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAP;AACD,CAL2D,CAA/C;AAOb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourcesContent":["import * as React from 'react';\nimport { useCheckbox_unstable } from './useCheckbox';\nimport { renderCheckbox_unstable } from './renderCheckbox';\nimport { useCheckboxStyles_unstable } from './useCheckboxStyles';\nimport type { CheckboxProps } from './Checkbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Checkboxes give people a way to select one or more items from a group,\n * or switch between two mutually exclusive options (checked or unchecked).\n */\nexport const Checkbox: ForwardRefComponent<CheckboxProps> = React.forwardRef((props, ref) => {\n const state = useCheckbox_unstable(props, ref);\n\n useCheckboxStyles_unstable(state);\n return renderCheckbox_unstable(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"],"sourceRoot":"../src/"}