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

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 +240 -7
  2. package/CHANGELOG.md +62 -8
  3. package/Spec.md +25 -115
  4. package/dist/react-checkbox.d.ts +40 -31
  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 +34 -24
  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 -8
  14. package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
  15. package/lib/components/Checkbox/useCheckbox.d.ts +3 -3
  16. package/lib/components/Checkbox/useCheckbox.js +98 -75
  17. package/lib/components/Checkbox/useCheckbox.js.map +1 -1
  18. package/lib/components/Checkbox/useCheckboxStyles.d.ts +1 -1
  19. package/lib/components/Checkbox/useCheckboxStyles.js +199 -160
  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 +34 -24
  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 -13
  34. package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
  35. package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +3 -3
  36. package/lib-commonjs/components/Checkbox/useCheckbox.js +112 -80
  37. package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
  38. package/lib-commonjs/components/Checkbox/useCheckboxStyles.d.ts +1 -1
  39. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +211 -164
  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 +12 -10
  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,171 +1,210 @@
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';
3
4
  export const checkboxClassName = 'fui-Checkbox';
4
- /**
5
- * Styles for the root slot
6
- */
7
- const useStyles = makeStyles({
8
- root: theme => ({
9
- display: 'inline-flex',
10
- position: 'relative',
11
- alignSelf: 'flex-start',
12
- alignItems: 'center',
13
- padding: '4px',
14
- userSelect: 'none',
15
- cursor: 'pointer',
16
- }),
17
- disabled: theme => ({
18
- color: theme.colorNeutralForegroundDisabled,
19
- cursor: 'default',
20
- [`& .${checkboxClassName}-indicator`]: {
21
- borderColor: theme.colorNeutralStrokeDisabled,
22
- color: theme.colorNeutralForegroundDisabled,
23
- backgroundColor: theme.colorNeutralBackground1,
24
- },
25
- ':hover': {
26
- [`& .${checkboxClassName}-indicator`]: {
27
- borderColor: theme.colorNeutralStrokeDisabled,
28
- color: theme.colorNeutralForegroundDisabled,
29
- backgroundColor: theme.colorNeutralBackground1,
30
- },
31
- },
32
- ':active': {
33
- [`& .${checkboxClassName}-indicator`]: {
34
- borderColor: theme.colorNeutralStrokeDisabled,
35
- color: theme.colorNeutralForegroundDisabled,
36
- backgroundColor: theme.colorNeutralBackground1,
37
- },
38
- },
39
- }),
40
- unchecked: theme => ({
41
- color: theme.colorNeutralForeground3,
42
- [`& .${checkboxClassName}-indicator`]: {
43
- borderColor: theme.colorNeutralStrokeAccessible,
44
- '& > *': {
45
- opacity: 0,
46
- },
47
- },
48
- ':hover': {
49
- color: theme.colorNeutralForeground2,
50
- [`& .${checkboxClassName}-indicator`]: {
51
- borderColor: theme.colorNeutralStrokeAccessibleHover,
52
- },
53
- },
54
- ':active': {
55
- color: theme.colorNeutralForeground1,
56
- [`& .${checkboxClassName}-indicator`]: {
57
- borderColor: theme.colorNeutralStrokeAccessiblePressed,
58
- },
59
- },
60
- }),
61
- checked: theme => ({
62
- color: theme.colorNeutralForeground1,
63
- // TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added
64
- [`& .${checkboxClassName}-indicator`]: {
65
- backgroundColor: theme.colorCompoundBrandBackground,
66
- color: theme.colorNeutralForegroundInverted,
67
- borderColor: theme.colorBrandBackground,
68
- },
69
- ':active': {
70
- [`& .${checkboxClassName}-indicator`]: {
71
- backgroundColor: theme.colorCompoundBrandBackgroundPressed,
72
- },
73
- },
74
- ':hover': {
75
- [`& .${checkboxClassName}-indicator`]: {
76
- backgroundColor: theme.colorCompoundBrandBackgroundHover,
77
- },
78
- },
79
- }),
80
- mixed: theme => ({
81
- color: theme.colorNeutralForeground1,
82
- [`& .${checkboxClassName}-indicator`]: {
83
- borderColor: theme.colorCompoundBrandStroke,
84
- color: theme.colorCompoundBrandForeground1,
85
- },
86
- ':active': {
87
- [`& .${checkboxClassName}-indicator`]: {
88
- borderColor: theme.colorCompoundBrandStrokePressed,
89
- color: theme.colorCompoundBrandForeground1Pressed,
90
- },
91
- },
92
- ':hover': {
93
- [`& .${checkboxClassName}-indicator`]: {
94
- borderColor: theme.colorCompoundBrandStrokeHover,
95
- color: theme.colorCompoundBrandForeground1Hover,
96
- },
97
- },
98
- }),
99
- focusIndicator: theme => createFocusOutlineStyle(theme, { style: { outlineOffset: '2px' }, selector: 'focus-within' }),
5
+ const indicatorClassName = 'fui-Checkbox__indicator';
6
+ const labelClassName = 'fui-Checkbox__label'; // TODO replace these spacing constants with theme values once they're on the theme
7
+
8
+ const spacingHorizontalS = '8px';
9
+ const spacingHorizontalM = '12px'; // The indicator size is used by the indicator and label styles
10
+
11
+ const indicatorSizeMedium = '16px';
12
+ const indicatorSizeLarge = '20px';
13
+
14
+ const useRootStyles = /*#__PURE__*/__styles({
15
+ "base": {
16
+ "qhf8xq": "f10pi13n",
17
+ "mc9l5x": "ftuwxu6",
18
+ "i8kkvl": "f4akndk",
19
+ "z8tnut": "fp9bwmr",
20
+ "z189sj": ["f19lj068", "f177v4lu"],
21
+ "Byoj8tv": "f150uoa4",
22
+ "uwmqm3": ["f177v4lu", "f19lj068"],
23
+ "B486eqv": "f2hkw1w",
24
+ "c2y4jd": "fsofd9k",
25
+ "B8vm7ur": "f12sql3b",
26
+ "f4hv8x": "f1i4q40k",
27
+ "Gpan81": "fcrbge9",
28
+ "z7afg": "ft464mn",
29
+ "rsjj6t": "fskqmiq",
30
+ "Bqsd8kq": "f2gy8jn",
31
+ "sfhsbh": "f1pke3uf",
32
+ "Bugh3ej": "f18xdlq9",
33
+ "hpanx6": "f1114nks",
34
+ "Bjkpy09": "f1unftzx",
35
+ "Jxg1p8": "f8rjbh6",
36
+ "Bc94xmo": ["fxfgh6q", "f8l10fm"],
37
+ "Bj23z95": ["f8l10fm", "fxfgh6q"]
38
+ }
39
+ }, {
40
+ "d": [".f10pi13n{position:relative;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", "[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;}"],
41
+ "i": [".f2hkw1w:focus-visible{outline-style:none;}"]
100
42
  });
101
- const useContainerStyles = makeStyles({
102
- container: {
103
- position: 'relative',
104
- display: 'flex',
105
- alignItems: 'center',
106
- justifyContent: 'center',
107
- },
108
- medium: {
109
- width: '16px',
110
- height: '16px',
111
- },
112
- large: {
113
- width: '20px',
114
- height: '20px',
115
- },
116
- // TODO: change marginLeft to Spacing horizontal M once it's added
117
- before: theme => ({
118
- marginLeft: '12px',
119
- }),
120
- // TODO: change marginRight to Spacing horizontal M once it's added
121
- after: theme => ({
122
- marginRight: '12px',
123
- }),
43
+
44
+ const useInputStyles = /*#__PURE__*/__styles({
45
+ "base": {
46
+ "qhf8xq": "f1euv43f",
47
+ "oyh7mz": ["f1vgc2s3", "f1e31b4d"],
48
+ "Bhzewxz": "f15twtuk",
49
+ "a9b677": "fly5x3f",
50
+ "Bqenvij": "f1l02sjl",
51
+ "B7ck84d": "f1ewtqcl",
52
+ "B6of3ja": "f1hu3pq6",
53
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
54
+ "jrapky": "f19f4twv",
55
+ "Frg6f3": ["f1tyq0we", "f11qmguv"],
56
+ "abs64n": "fk73vx1",
57
+ "Bceei9c": "f1k6fduh",
58
+ "B26k0as": "f1yrrd5t",
59
+ "k0xvi9": "fvfr0er",
60
+ "Bqb28oy": "fcwiijr",
61
+ "Fszymg": ["f11s8ldy", "f37mzfx"],
62
+ "s5xoki": "forfpyi",
63
+ "cfw8t2": ["f37mzfx", "f11s8ldy"],
64
+ "b9fajx": "f1vd61pd",
65
+ "pff03s": "f1mzgjal",
66
+ "Bk0s23q": ["f1iwu0i3", "f6umev3"],
67
+ "Bfc5gcl": "femu9zt",
68
+ "a4vgqw": ["f6umev3", "f1iwu0i3"],
69
+ "Fum7gy": "f1s8s9qo",
70
+ "B5tev9i": "fuvx3by",
71
+ "ecjak0": ["fuqx993", "f1akce7s"],
72
+ "B006ete": "feccz1o",
73
+ "Bxlzfhf": ["f1akce7s", "fuqx993"],
74
+ "qzqrip": "fqgvcms",
75
+ "xmoia3": "f1wvbx6q",
76
+ "i1phtq": "fcsc0bc",
77
+ "Bi8r3f5": "fkf9h0q",
78
+ "yvncz7": ["faeo8p5", "f4rpdul"],
79
+ "D2mvea": "fsk3itm",
80
+ "Bjmkmyo": ["f4rpdul", "faeo8p5"],
81
+ "B525uqd": "f4wqdms",
82
+ "B5z3g6i": "ftufdon",
83
+ "Bwnzx1a": ["f1ni78ii", "f1pe82pw"],
84
+ "w3j1jp": "fxl8eb7",
85
+ "n2zbqb": ["f1pe82pw", "f1ni78ii"],
86
+ "Bek439x": "f12pgwe7",
87
+ "Bgt4g9q": "f1c5u0pt",
88
+ "Bkzkukt": ["fyfn4nz", "f1aaeu2t"],
89
+ "wg1kw8": "ffzx9q8",
90
+ "Bh7u92y": ["f1aaeu2t", "fyfn4nz"],
91
+ "B40413r": "f1rm0htn",
92
+ "B9f5amx": "fpb7n6l",
93
+ "gbnyp0": ["f1uwkm0d", "fakdbj6"],
94
+ "ilwfws": "f180qsza",
95
+ "Fk4w3x": ["fakdbj6", "f1uwkm0d"],
96
+ "tfmijd": "f3nyagc",
97
+ "Bketd8w": "f1eh922j",
98
+ "s1clob": ["f1f3l6lh", "faa1us6"],
99
+ "B8s8lrk": "f1g6jlfz",
100
+ "Bp3qae9": ["faa1us6", "f1f3l6lh"],
101
+ "c4h28b": "f1d2ycii",
102
+ "Bvff7ki": "f18ruat1",
103
+ "B0usqpl": ["f18b6ltw", "fd6ao2z"],
104
+ "ckdfsi": "fdz9k82",
105
+ "B2hfjzz": ["fd6ao2z", "f18b6ltw"],
106
+ "B0rx68v": "f8c3d4w",
107
+ "ezr58z": "fvxnmui",
108
+ "Bdfu378": "f1ceq7vh",
109
+ "fvfg5q": "f4ohyq5",
110
+ "Bbnnodr": ["f1kakd2g", "f3ulah5"],
111
+ "B7y28oj": "f5fda5m",
112
+ "Dpxclb": ["f3ulah5", "f1kakd2g"],
113
+ "E1kcat": "f1c3drxw"
114
+ }
115
+ }, {
116
+ "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;}", ".f1k6fduh{cursor:pointer;}", ".f1yrrd5t:not(:checked):not(:indeterminate)~.fui-Checkbox__indicator>*{opacity:0;}", ".fvfr0er:enabled:not(:checked):not(:indeterminate)~.fui-Checkbox__label{color:var(--colorNeutralForeground3);}", ".fcwiijr:enabled:not(:checked):not(:indeterminate)~.fui-Checkbox__indicator{border-top-color:var(--colorNeutralStrokeAccessible);}", ".f11s8ldy:enabled:not(:checked):not(:indeterminate)~.fui-Checkbox__indicator{border-right-color:var(--colorNeutralStrokeAccessible);}", ".f37mzfx:enabled:not(:checked):not(:indeterminate)~.fui-Checkbox__indicator{border-left-color:var(--colorNeutralStrokeAccessible);}", ".forfpyi:enabled:not(:checked):not(:indeterminate)~.fui-Checkbox__indicator{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1vd61pd:enabled:not(:checked):not(:indeterminate):hover~.fui-Checkbox__label{color:var(--colorNeutralForeground2);}", ".f1mzgjal:enabled:not(:checked):not(:indeterminate):hover~.fui-Checkbox__indicator{border-top-color:var(--colorNeutralStrokeAccessibleHover);}", ".f1iwu0i3:enabled:not(:checked):not(:indeterminate):hover~.fui-Checkbox__indicator{border-right-color:var(--colorNeutralStrokeAccessibleHover);}", ".f6umev3:enabled:not(:checked):not(:indeterminate):hover~.fui-Checkbox__indicator{border-left-color:var(--colorNeutralStrokeAccessibleHover);}", ".femu9zt:enabled:not(:checked):not(:indeterminate):hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorNeutralStrokeAccessibleHover);}", ".f1s8s9qo:enabled:not(:checked):not(:indeterminate):active:hover~.fui-Checkbox__label{color:var(--colorNeutralForeground1);}", ".fuvx3by:enabled:not(:checked):not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-top-color:var(--colorNeutralStrokeAccessiblePressed);}", ".fuqx993:enabled:not(:checked):not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-right-color:var(--colorNeutralStrokeAccessiblePressed);}", ".f1akce7s:enabled:not(:checked):not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-left-color:var(--colorNeutralStrokeAccessiblePressed);}", ".feccz1o:enabled:not(:checked):not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorNeutralStrokeAccessiblePressed);}", ".fqgvcms:enabled:checked:not(:indeterminate)~.fui-Checkbox__label{color:var(--colorNeutralForeground1);}", ".f1wvbx6q:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{background-color:var(--colorCompoundBrandBackground);}", ".fcsc0bc:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{color:var(--colorNeutralForegroundOnBrand);}", ".fkf9h0q:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandBackground);}", ".faeo8p5:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandBackground);}", ".f4rpdul:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandBackground);}", ".fsk3itm:enabled:checked:not(:indeterminate)~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandBackground);}", ".f4wqdms:enabled:checked:not(:indeterminate):hover~.fui-Checkbox__indicator{background-color:var(--colorCompoundBrandBackgroundHover);}", ".ftufdon:enabled:checked:not(:indeterminate):hover~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandBackgroundHover);}", ".f1ni78ii:enabled:checked:not(:indeterminate):hover~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandBackgroundHover);}", ".f1pe82pw:enabled:checked:not(:indeterminate):hover~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandBackgroundHover);}", ".fxl8eb7:enabled:checked:not(:indeterminate):hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandBackgroundHover);}", ".f12pgwe7:enabled:checked:not(:indeterminate):active:hover~.fui-Checkbox__indicator{background-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1c5u0pt:enabled:checked:not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandBackgroundPressed);}", ".fyfn4nz:enabled:checked:not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1aaeu2t:enabled:checked:not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandBackgroundPressed);}", ".ffzx9q8:enabled:checked:not(:indeterminate):active:hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandBackgroundPressed);}", ".f1rm0htn:enabled:indeterminate~.fui-Checkbox__label{color:var(--colorNeutralForeground1);}", ".fpb7n6l:enabled:indeterminate~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandStroke);}", ".f1uwkm0d:enabled:indeterminate~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandStroke);}", ".fakdbj6:enabled:indeterminate~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandStroke);}", ".f180qsza:enabled:indeterminate~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandStroke);}", ".f3nyagc:enabled:indeterminate~.fui-Checkbox__indicator{color:var(--colorCompoundBrandForeground1);}", ".f1eh922j:enabled:indeterminate:hover~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandStrokeHover);}", ".f1f3l6lh:enabled:indeterminate:hover~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandStrokeHover);}", ".faa1us6:enabled:indeterminate:hover~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandStrokeHover);}", ".f1g6jlfz:enabled:indeterminate:hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandStrokeHover);}", ".f1d2ycii:enabled:indeterminate:hover~.fui-Checkbox__indicator{color:var(--colorCompoundBrandForeground1Hover);}", ".f18ruat1:enabled:indeterminate:active:hover~.fui-Checkbox__indicator{border-top-color:var(--colorCompoundBrandStrokePressed);}", ".f18b6ltw:enabled:indeterminate:active:hover~.fui-Checkbox__indicator{border-right-color:var(--colorCompoundBrandStrokePressed);}", ".fd6ao2z:enabled:indeterminate:active:hover~.fui-Checkbox__indicator{border-left-color:var(--colorCompoundBrandStrokePressed);}", ".fdz9k82:enabled:indeterminate:active:hover~.fui-Checkbox__indicator{border-bottom-color:var(--colorCompoundBrandStrokePressed);}", ".f8c3d4w:enabled:indeterminate:active:hover~.fui-Checkbox__indicator{color:var(--colorCompoundBrandForeground1Pressed);}", ".fvxnmui:disabled{cursor:default;}", ".f1ceq7vh:disabled~.fui-Checkbox__label{color:var(--colorNeutralForegroundDisabled);}", ".f4ohyq5:disabled~.fui-Checkbox__indicator{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f1kakd2g:disabled~.fui-Checkbox__indicator{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f3ulah5:disabled~.fui-Checkbox__indicator{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f5fda5m:disabled~.fui-Checkbox__indicator{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1c3drxw:disabled~.fui-Checkbox__indicator{color:var(--colorNeutralForegroundDisabled);}"]
124
117
  });
125
- const useInputStyles = makeStyles({
126
- input: {
127
- opacity: 0,
128
- position: 'absolute',
129
- margin: 0,
130
- padding: 0,
131
- cursor: 'pointer',
132
- },
133
- disabled: {
134
- cursor: 'not-allowed',
135
- },
118
+
119
+ const useIndicatorStyles = /*#__PURE__*/__styles({
120
+ "base": {
121
+ "qb2dma": "fjgzulp",
122
+ "B7ck84d": "f1ewtqcl",
123
+ "Bnnss6s": "fi64zpg",
124
+ "mc9l5x": "f22iagw",
125
+ "Bt984gj": "f122n59",
126
+ "Brf1p80": "f4d9j23",
127
+ "B68tc82": "f1p9o1ba",
128
+ "Bmxbyg5": "f1sil6mw",
129
+ "B4j52fo": "f192inf7",
130
+ "Bekrc4i": ["f5tn483", "f1ojsxk5"],
131
+ "Bn0qgzm": "f1vxd6vx",
132
+ "ibv6hh": ["f1ojsxk5", "f5tn483"],
133
+ "icvyot": "fzkkow9",
134
+ "vrafjx": ["fcdblym", "fjik90z"],
135
+ "oivjwe": "fg706s2",
136
+ "wvpqe5": ["fjik90z", "fcdblym"],
137
+ "Bbmb7ep": ["f1g3puop", "fi2rrw2"],
138
+ "Beyfa6y": ["fi2rrw2", "f1g3puop"],
139
+ "B7oj6ja": ["f1rstyi9", "f1s4nn1u"],
140
+ "Btl43ni": ["f1s4nn1u", "f1rstyi9"],
141
+ "Bkfmm31": "f1w9h62z",
142
+ "Bkecrkj": "f1aehjj5"
143
+ },
144
+ "medium": {
145
+ "a9b677": "fjw5fx7",
146
+ "Bqenvij": "fd461yt",
147
+ "Be2twd7": "f1ugzwwg"
148
+ },
149
+ "large": {
150
+ "a9b677": "f64fuq3",
151
+ "Bqenvij": "fjamq6b",
152
+ "Be2twd7": "f4ybsrx"
153
+ },
154
+ "circular": {
155
+ "Bbmb7ep": ["f8fbkgy", "f1nfllo7"],
156
+ "Beyfa6y": ["f1nfllo7", "f8fbkgy"],
157
+ "B7oj6ja": ["f1djnp8u", "f1s8kh49"],
158
+ "Btl43ni": ["f1s8kh49", "f1djnp8u"]
159
+ }
160
+ }, {
161
+ "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;}", ".f1aehjj5{pointer-events:none;}", ".fjw5fx7{width:16px;}", ".fd461yt{height:16px;}", ".f1ugzwwg{font-size:12px;}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".f4ybsrx{font-size:16px;}", ".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);}"]
136
162
  });
137
- const useIndicatorStyles = makeStyles({
138
- box: theme => ({
139
- width: '100%',
140
- height: '100%',
141
- fill: 'currentColor',
142
- overflow: 'hidden',
143
- display: 'flex',
144
- alignItems: 'center',
145
- justifyContent: 'center',
146
- position: 'absolute',
147
- boxSizing: 'border-box',
148
- borderStyle: 'solid',
149
- borderRadius: theme.borderRadiusSmall,
150
- borderWidth: theme.strokeWidthThin,
151
- }),
152
- circular: theme => ({
153
- borderRadius: theme.borderRadiusCircular,
154
- }),
163
+
164
+ const useLabelStyles = /*#__PURE__*/__styles({
165
+ "base": {
166
+ "qb2dma": "f7nlbp4",
167
+ "famaaq": "f1xqy1su",
168
+ "Bceei9c": "fpo1scq",
169
+ "sj55zd": "f1ym3bx4"
170
+ },
171
+ "medium": {
172
+ "B6of3ja": "fjzwpt6",
173
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
174
+ "jrapky": "fh6j2fo",
175
+ "Frg6f3": ["f1tyq0we", "f11qmguv"]
176
+ },
177
+ "large": {
178
+ "B6of3ja": "f1xlvstr",
179
+ "t21cq0": ["f11qmguv", "f1tyq0we"],
180
+ "jrapky": "f49ad5g",
181
+ "Frg6f3": ["f1tyq0we", "f11qmguv"]
182
+ }
183
+ }, {
184
+ "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);}"]
155
185
  });
156
186
  /**
157
187
  * Apply styling to the Checkbox slots based on the state
158
188
  */
159
- export const useCheckboxStyles = (state) => {
160
- const checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';
161
- const indicatorStyles = useIndicatorStyles();
162
- const inputStyles = useInputStyles();
163
- const containerStyles = useContainerStyles();
164
- const styles = useStyles();
165
- state.root.className = mergeClasses(checkboxClassName, styles.root, styles.focusIndicator, styles[checkedState], state.input.disabled && styles.disabled, state.root.className);
166
- state.input.className = mergeClasses(containerStyles[state.size], inputStyles.input, state.input.disabled && inputStyles.disabled, state.input.className);
167
- state.containerClassName = mergeClasses(containerStyles.container, containerStyles[state.size], state.hasLabel && containerStyles[state.labelPosition]);
168
- state.indicator.className = mergeClasses(`${checkboxClassName}-indicator`, indicatorStyles.box, containerStyles[state.size], state.circular && indicatorStyles.circular, state.indicator.className);
169
- return state;
189
+
190
+
191
+ export const useCheckboxStyles_unstable = state => {
192
+ const rootStyles = useRootStyles();
193
+ state.root.className = mergeClasses(checkboxClassName, rootStyles.base, state.root.className);
194
+ const inputStyles = useInputStyles();
195
+ state.input.className = mergeClasses(inputStyles.base, state.input.className);
196
+ const indicatorStyles = useIndicatorStyles();
197
+
198
+ if (state.indicator) {
199
+ state.indicator.className = mergeClasses(indicatorClassName, indicatorStyles.base, indicatorStyles[state.size], state.shape === 'circular' && indicatorStyles.circular, state.indicator.className);
200
+ }
201
+
202
+ const labelStyles = useLabelStyles();
203
+
204
+ if (state.label) {
205
+ state.label.className = mergeClasses(labelClassName, labelStyles.base, labelStyles[state.size], state.label.className);
206
+ }
207
+
208
+ return state;
170
209
  };
171
210
  //# sourceMappingURL=useCheckboxStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckboxStyles.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,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;IAEF,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,8BAA8B;QAC3C,MAAM,EAAE,SAAS;QAEjB,CAAC,MAAM,iB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AFsB,EAGlC,WAAW,CAAC,KAAK,CAAC,IAAP,CAHuB,EAIlC,KAAK,CAAC,KAAN,CAAY,SAJsB,CAApC;AAMD;;AAED,SAAO,KAAP;AACD,CA7BM","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';\nconst labelClassName = 'fui-Checkbox__label';\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\nconst useRootStyles = makeStyles({\n base: {\n position: 'relative',\n display: 'inline-flex',\n columnGap: spacingHorizontalM,\n ...shorthands.padding(spacingHorizontalS),\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\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: 'pointer',\n\n // When unchecked, hide the the checkmark icon (child of the indicator slot)\n [`:not(:checked):not(:indeterminate) ~ .${indicatorClassName} > *`]: {\n opacity: 0,\n },\n\n // Colors for the unchecked state\n ':enabled:not(:checked):not(:indeterminate)': {\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForeground3,\n },\n [`& ~ .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n },\n\n ':hover': {\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessibleHover),\n },\n },\n\n ':active:hover': {\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessiblePressed),\n },\n },\n },\n\n // Colors for the checked state\n ':enabled:checked:not(:indeterminate)': {\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForeground1,\n },\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 // Colors for the mixed state\n ':enabled:indeterminate': {\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForeground1,\n },\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 ':disabled': {\n cursor: 'default',\n\n [`& ~ .${labelClassName}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n [`& ~ .${indicatorClassName}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\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 pointerEvents: 'none',\n },\n\n medium: {\n width: indicatorSizeMedium,\n height: indicatorSizeMedium,\n fontSize: '12px',\n },\n\n large: {\n width: indicatorSizeLarge,\n height: indicatorSizeLarge,\n fontSize: '16px',\n },\n\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\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(checkboxClassName, rootStyles.base, state.root.className);\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.shape === 'circular' && indicatorStyles.circular,\n state.indicator.className,\n );\n }\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n labelClassName,\n labelStyles.base,\n labelStyles[state.size],\n state.label.className,\n );\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
- const 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
- const React = require("react");
5
- const useCheckbox_1 = require("./useCheckbox");
6
- const renderCheckbox_1 = require("./renderCheckbox");
7
- const 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((props, ref) => {
12
- const 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,+BAA+B;AAC/B,+CAA4C;AAC5C,qDAAkD;AAClD,2DAAwD;AAIxD;;GAEG;AACU,QAAA,QAAQ,GAAuC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1F,MAAM,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/"}
@@ -1,31 +1,34 @@
1
1
  import * as React from 'react';
2
- import { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
3
- import { LabelProps } from '@fluentui/react-label';
4
- export interface CheckboxCommons {
2
+ import { Label } from '@fluentui/react-label';
3
+ import { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
4
+ interface CheckboxCommons {
5
5
  /**
6
- * A checkbox can be rendered with a circular shape.
6
+ * The shape of the checkbox indicator.
7
+ *
8
+ * The `circular` variant is only recommended to be used in a tasks-style UI (checklist),
9
+ * since it otherwise could be confused for a `RadioItem`.
10
+ *
11
+ * @defaultvalue square
7
12
  */
8
- circular: boolean | undefined;
13
+ shape: 'square' | 'circular';
9
14
  /**
10
- * A checkbox's state can be controlled.
15
+ * The controlled value for the checkbox.
16
+ *
11
17
  * @defaultvalue false
12
18
  */
13
19
  checked: 'mixed' | boolean;
14
20
  /**
15
- * Checkbox supports two different checkbox sizes.
16
- * @defaultvalue 'medium'
21
+ * The size of the checkbox indicator.
22
+ *
23
+ * @defaultvalue medium
17
24
  */
18
25
  size: 'medium' | 'large';
19
26
  /**
20
- * Determines whether the label should be positioned before or after the checkbox.
21
- * @defaultvalue 'after'
27
+ * The position of the label relative to the checkbox indicator.
28
+ *
29
+ * @defaultvalue after
22
30
  */
23
31
  labelPosition: 'before' | 'after';
24
- /**
25
- * Field required to pass className to container instead of input
26
- * this will be solved by https://github.com/microsoft/fluentui/pull/18983
27
- */
28
- containerClassName?: string;
29
32
  }
30
33
  /**
31
34
  * Data for the onChange event for checkbox.
@@ -35,28 +38,36 @@ export interface CheckboxOnChangeData {
35
38
  }
36
39
  export declare type CheckboxSlots = {
37
40
  /**
38
- * The root element of the checkbox is its `<label>`.
41
+ * The root element of the Checkbox.
39
42
  *
40
43
  * The root slot receives the `className` and `style` specified directly on the `<Checkbox>`.
41
44
  * All other native props will be applied to the primary slot: `input`
42
45
  */
43
- root: ObjectShorthandProps<LabelProps> | IntrinsicShorthandProps<'span'>;
46
+ root: NonNullable<Slot<'span'>>;
47
+ /**
48
+ * The Checkbox's label.
49
+ */
50
+ label?: Slot<typeof Label>;
44
51
  /**
45
52
  * Hidden input that handles the checkbox's functionality.
46
53
  *
47
54
  * This is the PRIMARY slot: all native properties specified directly on `<Checkbox>` will be applied to this slot,
48
55
  * except `className` and `style`, which remain on the root slot.
49
56
  */
50
- input: IntrinsicShorthandProps<'input'>;
57
+ input: NonNullable<Slot<'input'>>;
51
58
  /**
52
- * Renders the checkbox, with the checkmark icon as its child when checked.
59
+ * The checkbox, with the checkmark icon as its child when checked.
53
60
  */
54
- indicator: IntrinsicShorthandProps<'div'>;
61
+ indicator: Slot<'div'>;
55
62
  };
56
63
  /**
57
64
  * Checkbox Props
58
65
  */
59
- export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots, 'input'>, 'size' | 'checked' | 'defaultChecked'> & Partial<CheckboxCommons> & {
66
+ export declare type CheckboxProps = Omit<ComponentProps<Partial<CheckboxSlots>, 'input'>, 'size' | 'checked' | 'defaultChecked' | 'onChange'> & Partial<CheckboxCommons> & {
67
+ /**
68
+ * Checkboxes don't support children. To add a label, use the `label` prop.
69
+ */
70
+ children?: never;
60
71
  /**
61
72
  * Callback to be called when the checked state value changes.
62
73
  */
@@ -69,6 +80,5 @@ export declare type CheckboxProps = Omit<ComponentProps<CheckboxSlots, 'input'>,
69
80
  /**
70
81
  * State used in rendering Checkbox
71
82
  */
72
- export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons & {
73
- hasLabel: boolean;
74
- };
83
+ export declare type CheckboxState = ComponentState<CheckboxSlots> & CheckboxCommons;
84
+ export {};