@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.
- package/CHANGELOG.json +240 -7
- package/CHANGELOG.md +62 -8
- package/Spec.md +25 -115
- package/dist/react-checkbox.d.ts +40 -31
- package/lib/Checkbox.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -1
- package/lib/components/Checkbox/Checkbox.js +10 -8
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.types.d.ts +34 -24
- package/lib/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib/components/Checkbox/index.js.map +1 -1
- package/lib/components/Checkbox/renderCheckbox.d.ts +1 -1
- package/lib/components/Checkbox/renderCheckbox.js +11 -8
- package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckbox.d.ts +3 -3
- package/lib/components/Checkbox/useCheckbox.js +98 -75
- package/lib/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckboxStyles.d.ts +1 -1
- package/lib/components/Checkbox/useCheckboxStyles.js +199 -160
- package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Checkbox.js +7 -2
- package/lib-commonjs/Checkbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.d.ts +2 -1
- package/lib-commonjs/components/Checkbox/Checkbox.js +20 -10
- package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.types.d.ts +34 -24
- package/lib-commonjs/components/Checkbox/Checkbox.types.js +4 -1
- package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib-commonjs/components/Checkbox/index.js +11 -2
- package/lib-commonjs/components/Checkbox/index.js.map +1 -1
- package/lib-commonjs/components/Checkbox/renderCheckbox.d.ts +1 -1
- package/lib-commonjs/components/Checkbox/renderCheckbox.js +23 -13
- package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +3 -3
- package/lib-commonjs/components/Checkbox/useCheckbox.js +112 -80
- package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.d.ts +1 -1
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +211 -164
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib-commonjs/index.js +7 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -10
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Checkbox/DefaultIcons.d.ts +0 -4
- package/lib/components/Checkbox/DefaultIcons.js +0 -10
- package/lib/components/Checkbox/DefaultIcons.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -16
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Checkbox/DefaultIcons.d.ts +0 -4
- package/lib-commonjs/components/Checkbox/DefaultIcons.js +0 -17
- package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +0 -1
|
@@ -1,175 +1,222 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCheckboxStyles_unstable = exports.checkboxClassName = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
11
|
+
|
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
13
|
+
|
|
6
14
|
exports.checkboxClassName = 'fui-Checkbox';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color: theme.colorNeutralForeground3,
|
|
45
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
46
|
-
borderColor: theme.colorNeutralStrokeAccessible,
|
|
47
|
-
'& > *': {
|
|
48
|
-
opacity: 0,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
':hover': {
|
|
52
|
-
color: theme.colorNeutralForeground2,
|
|
53
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
54
|
-
borderColor: theme.colorNeutralStrokeAccessibleHover,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
':active': {
|
|
58
|
-
color: theme.colorNeutralForeground1,
|
|
59
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
60
|
-
borderColor: theme.colorNeutralStrokeAccessiblePressed,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
checked: theme => ({
|
|
65
|
-
color: theme.colorNeutralForeground1,
|
|
66
|
-
// TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added
|
|
67
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
68
|
-
backgroundColor: theme.colorCompoundBrandBackground,
|
|
69
|
-
color: theme.colorNeutralForegroundInverted,
|
|
70
|
-
borderColor: theme.colorBrandBackground,
|
|
71
|
-
},
|
|
72
|
-
':active': {
|
|
73
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
74
|
-
backgroundColor: theme.colorCompoundBrandBackgroundPressed,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
':hover': {
|
|
78
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
79
|
-
backgroundColor: theme.colorCompoundBrandBackgroundHover,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
mixed: theme => ({
|
|
84
|
-
color: theme.colorNeutralForeground1,
|
|
85
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
86
|
-
borderColor: theme.colorCompoundBrandStroke,
|
|
87
|
-
color: theme.colorCompoundBrandForeground1,
|
|
88
|
-
},
|
|
89
|
-
':active': {
|
|
90
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
91
|
-
borderColor: theme.colorCompoundBrandStrokePressed,
|
|
92
|
-
color: theme.colorCompoundBrandForeground1Pressed,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
':hover': {
|
|
96
|
-
[`& .${exports.checkboxClassName}-indicator`]: {
|
|
97
|
-
borderColor: theme.colorCompoundBrandStrokeHover,
|
|
98
|
-
color: theme.colorCompoundBrandForeground1Hover,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
}),
|
|
102
|
-
focusIndicator: theme => react_tabster_1.createFocusOutlineStyle(theme, { style: { outlineOffset: '2px' }, selector: 'focus-within' }),
|
|
15
|
+
const indicatorClassName = 'fui-Checkbox__indicator';
|
|
16
|
+
const labelClassName = 'fui-Checkbox__label'; // TODO replace these spacing constants with theme values once they're on the theme
|
|
17
|
+
|
|
18
|
+
const spacingHorizontalS = '8px';
|
|
19
|
+
const spacingHorizontalM = '12px'; // The indicator size is used by the indicator and label styles
|
|
20
|
+
|
|
21
|
+
const indicatorSizeMedium = '16px';
|
|
22
|
+
const indicatorSizeLarge = '20px';
|
|
23
|
+
|
|
24
|
+
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
25
|
+
"base": {
|
|
26
|
+
"qhf8xq": "f10pi13n",
|
|
27
|
+
"mc9l5x": "ftuwxu6",
|
|
28
|
+
"i8kkvl": "f4akndk",
|
|
29
|
+
"z8tnut": "fp9bwmr",
|
|
30
|
+
"z189sj": ["f19lj068", "f177v4lu"],
|
|
31
|
+
"Byoj8tv": "f150uoa4",
|
|
32
|
+
"uwmqm3": ["f177v4lu", "f19lj068"],
|
|
33
|
+
"B486eqv": "f2hkw1w",
|
|
34
|
+
"c2y4jd": "fsofd9k",
|
|
35
|
+
"B8vm7ur": "f12sql3b",
|
|
36
|
+
"f4hv8x": "f1i4q40k",
|
|
37
|
+
"Gpan81": "fcrbge9",
|
|
38
|
+
"z7afg": "ft464mn",
|
|
39
|
+
"rsjj6t": "fskqmiq",
|
|
40
|
+
"Bqsd8kq": "f2gy8jn",
|
|
41
|
+
"sfhsbh": "f1pke3uf",
|
|
42
|
+
"Bugh3ej": "f18xdlq9",
|
|
43
|
+
"hpanx6": "f1114nks",
|
|
44
|
+
"Bjkpy09": "f1unftzx",
|
|
45
|
+
"Jxg1p8": "f8rjbh6",
|
|
46
|
+
"Bc94xmo": ["fxfgh6q", "f8l10fm"],
|
|
47
|
+
"Bj23z95": ["f8l10fm", "fxfgh6q"]
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
"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;}"],
|
|
51
|
+
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
103
52
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
53
|
+
|
|
54
|
+
const useInputStyles = /*#__PURE__*/react_1.__styles({
|
|
55
|
+
"base": {
|
|
56
|
+
"qhf8xq": "f1euv43f",
|
|
57
|
+
"oyh7mz": ["f1vgc2s3", "f1e31b4d"],
|
|
58
|
+
"Bhzewxz": "f15twtuk",
|
|
59
|
+
"a9b677": "fly5x3f",
|
|
60
|
+
"Bqenvij": "f1l02sjl",
|
|
61
|
+
"B7ck84d": "f1ewtqcl",
|
|
62
|
+
"B6of3ja": "f1hu3pq6",
|
|
63
|
+
"t21cq0": ["f11qmguv", "f1tyq0we"],
|
|
64
|
+
"jrapky": "f19f4twv",
|
|
65
|
+
"Frg6f3": ["f1tyq0we", "f11qmguv"],
|
|
66
|
+
"abs64n": "fk73vx1",
|
|
67
|
+
"Bceei9c": "f1k6fduh",
|
|
68
|
+
"B26k0as": "f1yrrd5t",
|
|
69
|
+
"k0xvi9": "fvfr0er",
|
|
70
|
+
"Bqb28oy": "fcwiijr",
|
|
71
|
+
"Fszymg": ["f11s8ldy", "f37mzfx"],
|
|
72
|
+
"s5xoki": "forfpyi",
|
|
73
|
+
"cfw8t2": ["f37mzfx", "f11s8ldy"],
|
|
74
|
+
"b9fajx": "f1vd61pd",
|
|
75
|
+
"pff03s": "f1mzgjal",
|
|
76
|
+
"Bk0s23q": ["f1iwu0i3", "f6umev3"],
|
|
77
|
+
"Bfc5gcl": "femu9zt",
|
|
78
|
+
"a4vgqw": ["f6umev3", "f1iwu0i3"],
|
|
79
|
+
"Fum7gy": "f1s8s9qo",
|
|
80
|
+
"B5tev9i": "fuvx3by",
|
|
81
|
+
"ecjak0": ["fuqx993", "f1akce7s"],
|
|
82
|
+
"B006ete": "feccz1o",
|
|
83
|
+
"Bxlzfhf": ["f1akce7s", "fuqx993"],
|
|
84
|
+
"qzqrip": "fqgvcms",
|
|
85
|
+
"xmoia3": "f1wvbx6q",
|
|
86
|
+
"i1phtq": "fcsc0bc",
|
|
87
|
+
"Bi8r3f5": "fkf9h0q",
|
|
88
|
+
"yvncz7": ["faeo8p5", "f4rpdul"],
|
|
89
|
+
"D2mvea": "fsk3itm",
|
|
90
|
+
"Bjmkmyo": ["f4rpdul", "faeo8p5"],
|
|
91
|
+
"B525uqd": "f4wqdms",
|
|
92
|
+
"B5z3g6i": "ftufdon",
|
|
93
|
+
"Bwnzx1a": ["f1ni78ii", "f1pe82pw"],
|
|
94
|
+
"w3j1jp": "fxl8eb7",
|
|
95
|
+
"n2zbqb": ["f1pe82pw", "f1ni78ii"],
|
|
96
|
+
"Bek439x": "f12pgwe7",
|
|
97
|
+
"Bgt4g9q": "f1c5u0pt",
|
|
98
|
+
"Bkzkukt": ["fyfn4nz", "f1aaeu2t"],
|
|
99
|
+
"wg1kw8": "ffzx9q8",
|
|
100
|
+
"Bh7u92y": ["f1aaeu2t", "fyfn4nz"],
|
|
101
|
+
"B40413r": "f1rm0htn",
|
|
102
|
+
"B9f5amx": "fpb7n6l",
|
|
103
|
+
"gbnyp0": ["f1uwkm0d", "fakdbj6"],
|
|
104
|
+
"ilwfws": "f180qsza",
|
|
105
|
+
"Fk4w3x": ["fakdbj6", "f1uwkm0d"],
|
|
106
|
+
"tfmijd": "f3nyagc",
|
|
107
|
+
"Bketd8w": "f1eh922j",
|
|
108
|
+
"s1clob": ["f1f3l6lh", "faa1us6"],
|
|
109
|
+
"B8s8lrk": "f1g6jlfz",
|
|
110
|
+
"Bp3qae9": ["faa1us6", "f1f3l6lh"],
|
|
111
|
+
"c4h28b": "f1d2ycii",
|
|
112
|
+
"Bvff7ki": "f18ruat1",
|
|
113
|
+
"B0usqpl": ["f18b6ltw", "fd6ao2z"],
|
|
114
|
+
"ckdfsi": "fdz9k82",
|
|
115
|
+
"B2hfjzz": ["fd6ao2z", "f18b6ltw"],
|
|
116
|
+
"B0rx68v": "f8c3d4w",
|
|
117
|
+
"ezr58z": "fvxnmui",
|
|
118
|
+
"Bdfu378": "f1ceq7vh",
|
|
119
|
+
"fvfg5q": "f4ohyq5",
|
|
120
|
+
"Bbnnodr": ["f1kakd2g", "f3ulah5"],
|
|
121
|
+
"B7y28oj": "f5fda5m",
|
|
122
|
+
"Dpxclb": ["f3ulah5", "f1kakd2g"],
|
|
123
|
+
"E1kcat": "f1c3drxw"
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
"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);}"]
|
|
127
127
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
128
|
+
|
|
129
|
+
const useIndicatorStyles = /*#__PURE__*/react_1.__styles({
|
|
130
|
+
"base": {
|
|
131
|
+
"qb2dma": "fjgzulp",
|
|
132
|
+
"B7ck84d": "f1ewtqcl",
|
|
133
|
+
"Bnnss6s": "fi64zpg",
|
|
134
|
+
"mc9l5x": "f22iagw",
|
|
135
|
+
"Bt984gj": "f122n59",
|
|
136
|
+
"Brf1p80": "f4d9j23",
|
|
137
|
+
"B68tc82": "f1p9o1ba",
|
|
138
|
+
"Bmxbyg5": "f1sil6mw",
|
|
139
|
+
"B4j52fo": "f192inf7",
|
|
140
|
+
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
|
141
|
+
"Bn0qgzm": "f1vxd6vx",
|
|
142
|
+
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
|
143
|
+
"icvyot": "fzkkow9",
|
|
144
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
145
|
+
"oivjwe": "fg706s2",
|
|
146
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
147
|
+
"Bbmb7ep": ["f1g3puop", "fi2rrw2"],
|
|
148
|
+
"Beyfa6y": ["fi2rrw2", "f1g3puop"],
|
|
149
|
+
"B7oj6ja": ["f1rstyi9", "f1s4nn1u"],
|
|
150
|
+
"Btl43ni": ["f1s4nn1u", "f1rstyi9"],
|
|
151
|
+
"Bkfmm31": "f1w9h62z",
|
|
152
|
+
"Bkecrkj": "f1aehjj5"
|
|
153
|
+
},
|
|
154
|
+
"medium": {
|
|
155
|
+
"a9b677": "fjw5fx7",
|
|
156
|
+
"Bqenvij": "fd461yt",
|
|
157
|
+
"Be2twd7": "f1ugzwwg"
|
|
158
|
+
},
|
|
159
|
+
"large": {
|
|
160
|
+
"a9b677": "f64fuq3",
|
|
161
|
+
"Bqenvij": "fjamq6b",
|
|
162
|
+
"Be2twd7": "f4ybsrx"
|
|
163
|
+
},
|
|
164
|
+
"circular": {
|
|
165
|
+
"Bbmb7ep": ["f8fbkgy", "f1nfllo7"],
|
|
166
|
+
"Beyfa6y": ["f1nfllo7", "f8fbkgy"],
|
|
167
|
+
"B7oj6ja": ["f1djnp8u", "f1s8kh49"],
|
|
168
|
+
"Btl43ni": ["f1s8kh49", "f1djnp8u"]
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
"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);}"]
|
|
139
172
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
173
|
+
|
|
174
|
+
const useLabelStyles = /*#__PURE__*/react_1.__styles({
|
|
175
|
+
"base": {
|
|
176
|
+
"qb2dma": "f7nlbp4",
|
|
177
|
+
"famaaq": "f1xqy1su",
|
|
178
|
+
"Bceei9c": "fpo1scq",
|
|
179
|
+
"sj55zd": "f1ym3bx4"
|
|
180
|
+
},
|
|
181
|
+
"medium": {
|
|
182
|
+
"B6of3ja": "fjzwpt6",
|
|
183
|
+
"t21cq0": ["f11qmguv", "f1tyq0we"],
|
|
184
|
+
"jrapky": "fh6j2fo",
|
|
185
|
+
"Frg6f3": ["f1tyq0we", "f11qmguv"]
|
|
186
|
+
},
|
|
187
|
+
"large": {
|
|
188
|
+
"B6of3ja": "f1xlvstr",
|
|
189
|
+
"t21cq0": ["f11qmguv", "f1tyq0we"],
|
|
190
|
+
"jrapky": "f49ad5g",
|
|
191
|
+
"Frg6f3": ["f1tyq0we", "f11qmguv"]
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
"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);}"]
|
|
158
195
|
});
|
|
159
196
|
/**
|
|
160
197
|
* Apply styling to the Checkbox slots based on the state
|
|
161
198
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
const useCheckboxStyles_unstable = state => {
|
|
202
|
+
const rootStyles = useRootStyles();
|
|
203
|
+
state.root.className = react_1.mergeClasses(exports.checkboxClassName, rootStyles.base, state.root.className);
|
|
204
|
+
const inputStyles = useInputStyles();
|
|
205
|
+
state.input.className = react_1.mergeClasses(inputStyles.base, state.input.className);
|
|
206
|
+
const indicatorStyles = useIndicatorStyles();
|
|
207
|
+
|
|
208
|
+
if (state.indicator) {
|
|
209
|
+
state.indicator.className = react_1.mergeClasses(indicatorClassName, indicatorStyles.base, indicatorStyles[state.size], state.shape === 'circular' && indicatorStyles.circular, state.indicator.className);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const labelStyles = useLabelStyles();
|
|
213
|
+
|
|
214
|
+
if (state.label) {
|
|
215
|
+
state.label.className = react_1.mergeClasses(labelClassName, labelStyles.base, labelStyles[state.size], state.label.className);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return state;
|
|
173
219
|
};
|
|
174
|
-
|
|
220
|
+
|
|
221
|
+
exports.useCheckboxStyles_unstable = useCheckboxStyles_unstable;
|
|
175
222
|
//# sourceMappingURL=useCheckboxStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":"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","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-commonjs/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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("./Checkbox"), exports);
|
|
5
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Checkbox';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-checkbox",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.9",
|
|
4
4
|
"description": "Fluent UI checkbox component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"just": "just-scripts",
|
|
19
19
|
"lint": "just-scripts lint",
|
|
20
20
|
"start": "yarn storybook",
|
|
21
|
-
"test": "jest",
|
|
21
|
+
"test": "jest --passWithNoTests",
|
|
22
22
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
23
|
-
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-checkbox/src && yarn docs",
|
|
24
|
-
"storybook": "
|
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-checkbox/src && yarn docs",
|
|
24
|
+
"storybook": "node ../../scripts/storybook/runner",
|
|
25
|
+
"type-check": "tsc -b tsconfig.json"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@fluentui/eslint-plugin": "*",
|
|
28
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.4",
|
|
29
29
|
"@fluentui/react-conformance": "*",
|
|
30
|
-
"@fluentui/react-conformance-
|
|
30
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.3",
|
|
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,12 @@
|
|
|
41
41
|
"react-test-renderer": "^16.3.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@fluentui/react-
|
|
45
|
-
"@fluentui/react-
|
|
46
|
-
"@fluentui/react-
|
|
47
|
-
"@fluentui/react-
|
|
44
|
+
"@fluentui/react-icons": "^2.0.159-beta.10",
|
|
45
|
+
"@fluentui/react-label": "9.0.0-beta.8",
|
|
46
|
+
"@fluentui/react-tabster": "9.0.0-rc.4",
|
|
47
|
+
"@fluentui/react-theme": "9.0.0-rc.3",
|
|
48
|
+
"@fluentui/react-utilities": "9.0.0-rc.4",
|
|
49
|
+
"@griffel/react": "1.0.0",
|
|
48
50
|
"tslib": "^2.1.0"
|
|
49
51
|
},
|
|
50
52
|
"peerDependencies": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
|
3
|
-
export function isConformant(testInfo) {
|
|
4
|
-
const defaultOptions = {
|
|
5
|
-
asPropHandlesRef: true,
|
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
7
|
-
extraTests: makeStylesTests,
|
|
8
|
-
skipAsPropTests: true,
|
|
9
|
-
};
|
|
10
|
-
baseIsConformant(defaultOptions, testInfo);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAmC,MAAM,6BAA6B,CAAC;AAChH,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAEtE,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,MAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5D,UAAU,EAAE,eAAqC;QACjD,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export const Mixed12Regular = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
|
|
3
|
-
React.createElement("rect", { width: "8", height: "8", x: "2", y: "2" })));
|
|
4
|
-
export const Mixed16Regular = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false" },
|
|
5
|
-
React.createElement("rect", { width: "10", height: "10", x: "3", y: "3" })));
|
|
6
|
-
export const Checkmark12Regular = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
|
|
7
|
-
React.createElement("path", { d: "M9.85355 3.14645C10.0488 3.34171 10.0488 3.65829 9.85355 3.85355L5.35355 8.35355C5.15829 8.54882 4.84171 8.54882 4.64645 8.35355L2.64645 6.35355C2.45118 6.15829 2.45118 5.84171 2.64645 5.64645C2.84171 5.45118 3.15829 5.45118 3.35355 5.64645L5 7.29289L9.14645 3.14645C9.34171 2.95118 9.65829 2.95118 9.85355 3.14645Z" })));
|
|
8
|
-
export const Checkmark16Regular = () => (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
-
React.createElement("path", { d: "M13.8639 3.65609C14.0533 3.85704 14.0439 4.17348 13.8429 4.36288L5.91309 11.8368C5.67573 12.0605 5.30311 12.0536 5.07417 11.8213L2.39384 9.10093C2.20003 8.90422 2.20237 8.58765 2.39907 8.39384C2.59578 8.20003 2.91235 8.20237 3.10616 8.39908L5.51192 10.8407L13.1571 3.63517C13.358 3.44577 13.6745 3.45513 13.8639 3.65609Z" })));
|
|
10
|
-
//# sourceMappingURL=DefaultIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultIcons.js","sourceRoot":"","sources":["../../../src/components/Checkbox/DefaultIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACrC,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,OAAO;IAClG,8BAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,CACvC,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,6TAA6T,GAAG,CACpU,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CACtC,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;IAChF,8BAAM,CAAC,EAAC,kUAAkU,GAAG,CACzU,CACP,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isConformant = void 0;
|
|
4
|
-
const react_conformance_1 = require("@fluentui/react-conformance");
|
|
5
|
-
const react_conformance_make_styles_1 = require("@fluentui/react-conformance-make-styles");
|
|
6
|
-
function isConformant(testInfo) {
|
|
7
|
-
const defaultOptions = {
|
|
8
|
-
asPropHandlesRef: true,
|
|
9
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
10
|
-
extraTests: react_conformance_make_styles_1.default,
|
|
11
|
-
skipAsPropTests: true,
|
|
12
|
-
};
|
|
13
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
|
14
|
-
}
|
|
15
|
-
exports.isConformant = isConformant;
|
|
16
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;AAAA,mEAAgH;AAChH,2FAAsE;AAEtE,SAAgB,YAAY,CAC1B,QAAyF;IAEzF,MAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5D,UAAU,EAAE,uCAAqC;QACjD,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAXD,oCAWC"}
|