@fluentui/react-checkbox 9.0.0-alpha.7 → 9.0.0-beta.2
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 +1224 -1
- package/CHANGELOG.md +450 -2
- package/Spec.md +30 -34
- package/dist/react-checkbox.d.ts +81 -21
- package/lib/Checkbox.js.map +1 -1
- package/lib/common/isConformant.js +3 -0
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -3
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.types.d.ts +73 -13
- package/lib/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib/components/Checkbox/DefaultIcons.d.ts +4 -0
- package/lib/components/Checkbox/DefaultIcons.js +10 -0
- package/lib/components/Checkbox/DefaultIcons.js.map +1 -0
- package/lib/components/Checkbox/index.js.map +1 -1
- package/lib/components/Checkbox/renderCheckbox.d.ts +0 -3
- package/lib/components/Checkbox/renderCheckbox.js +8 -6
- package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckbox.d.ts +4 -5
- package/lib/components/Checkbox/useCheckbox.js +66 -11
- package/lib/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckboxStyles.js +156 -4
- package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Checkbox.js.map +1 -1
- package/lib-commonjs/common/isConformant.js +3 -0
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.d.ts +3 -3
- package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.types.d.ts +73 -13
- package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib-commonjs/components/Checkbox/DefaultIcons.d.ts +4 -0
- package/lib-commonjs/components/Checkbox/DefaultIcons.js +17 -0
- package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +1 -0
- package/lib-commonjs/components/Checkbox/index.js.map +1 -1
- package/lib-commonjs/components/Checkbox/renderCheckbox.d.ts +0 -3
- package/lib-commonjs/components/Checkbox/renderCheckbox.js +7 -5
- package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +4 -5
- package/lib-commonjs/components/Checkbox/useCheckbox.js +65 -10
- package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +156 -4
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +15 -11
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -7
- package/etc/react-checkbox.api.md +0 -44
- package/just.config.ts +0 -3
- package/lib-amd/Checkbox.d.ts +0 -1
- package/lib-amd/Checkbox.js +0 -6
- package/lib-amd/Checkbox.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -4
- package/lib-amd/common/isConformant.js +0 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Checkbox/Checkbox.d.ts +0 -6
- package/lib-amd/components/Checkbox/Checkbox.js +0 -15
- package/lib-amd/components/Checkbox/Checkbox.js.map +0 -1
- package/lib-amd/components/Checkbox/Checkbox.types.d.ts +0 -24
- package/lib-amd/components/Checkbox/Checkbox.types.js +0 -5
- package/lib-amd/components/Checkbox/Checkbox.types.js.map +0 -1
- package/lib-amd/components/Checkbox/index.d.ts +0 -5
- package/lib-amd/components/Checkbox/index.js +0 -10
- package/lib-amd/components/Checkbox/index.js.map +0 -1
- package/lib-amd/components/Checkbox/renderCheckbox.d.ts +0 -5
- package/lib-amd/components/Checkbox/renderCheckbox.js +0 -14
- package/lib-amd/components/Checkbox/renderCheckbox.js.map +0 -1
- package/lib-amd/components/Checkbox/useCheckbox.d.ts +0 -17
- package/lib-amd/components/Checkbox/useCheckbox.js +0 -30
- package/lib-amd/components/Checkbox/useCheckbox.js.map +0 -1
- package/lib-amd/components/Checkbox/useCheckboxStyles.d.ts +0 -5
- package/lib-amd/components/Checkbox/useCheckboxStyles.js +0 -25
- package/lib-amd/components/Checkbox/useCheckboxStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -1
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/src/components/Checkbox/Checkbox.types.ts +0 -34
|
@@ -2,22 +2,174 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCheckboxStyles = void 0;
|
|
4
4
|
var react_make_styles_1 = require("@fluentui/react-make-styles");
|
|
5
|
+
var react_tabster_1 = require("@fluentui/react-tabster");
|
|
5
6
|
/**
|
|
6
7
|
* Styles for the root slot
|
|
7
8
|
*/
|
|
8
9
|
var useStyles = react_make_styles_1.makeStyles({
|
|
9
10
|
root: function (theme) { return ({
|
|
10
|
-
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
position: 'relative',
|
|
13
|
+
alignSelf: 'flex-start',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
padding: '4px',
|
|
16
|
+
userSelect: 'none',
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
}); },
|
|
19
|
+
disabled: function (theme) { return ({
|
|
20
|
+
color: theme.colorNeutralForegroundDisabled,
|
|
21
|
+
cursor: 'default',
|
|
22
|
+
'& .ms-checkbox-indicator': {
|
|
23
|
+
borderColor: theme.colorNeutralStrokeDisabled,
|
|
24
|
+
color: theme.colorNeutralForegroundDisabled,
|
|
25
|
+
backgroundColor: theme.colorNeutralBackground1,
|
|
26
|
+
},
|
|
27
|
+
':hover': {
|
|
28
|
+
'& .ms-checkbox-indicator': {
|
|
29
|
+
borderColor: theme.colorNeutralStrokeDisabled,
|
|
30
|
+
color: theme.colorNeutralForegroundDisabled,
|
|
31
|
+
backgroundColor: theme.colorNeutralBackground1,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
':active': {
|
|
35
|
+
'& .ms-checkbox-indicator': {
|
|
36
|
+
borderColor: theme.colorNeutralStrokeDisabled,
|
|
37
|
+
color: theme.colorNeutralForegroundDisabled,
|
|
38
|
+
backgroundColor: theme.colorNeutralBackground1,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}); },
|
|
42
|
+
unchecked: function (theme) { return ({
|
|
43
|
+
color: theme.colorNeutralForeground3,
|
|
44
|
+
'& .ms-checkbox-indicator': {
|
|
45
|
+
borderColor: theme.colorNeutralStrokeAccessible,
|
|
46
|
+
'& > *': {
|
|
47
|
+
opacity: 0,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
':hover': {
|
|
51
|
+
color: theme.colorNeutralForeground2,
|
|
52
|
+
'& .ms-checkbox-indicator': {
|
|
53
|
+
borderColor: theme.colorNeutralStrokeAccessibleHover,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
':active': {
|
|
57
|
+
color: theme.colorNeutralForeground1,
|
|
58
|
+
'& .ms-checkbox-indicator': {
|
|
59
|
+
borderColor: theme.colorNeutralStrokeAccessiblePressed,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}); },
|
|
63
|
+
checked: function (theme) { return ({
|
|
64
|
+
color: theme.colorNeutralForeground1,
|
|
65
|
+
// TODO: neutralForegroundInverted change to NeutralForegroundOnBrand once it's added
|
|
66
|
+
'& .ms-checkbox-indicator': {
|
|
67
|
+
backgroundColor: theme.colorCompoundBrandBackground,
|
|
68
|
+
color: theme.colorNeutralForegroundInverted,
|
|
69
|
+
borderColor: theme.colorBrandBackground,
|
|
70
|
+
},
|
|
71
|
+
':active': {
|
|
72
|
+
'& .ms-checkbox-indicator': {
|
|
73
|
+
backgroundColor: theme.colorCompoundBrandBackgroundPressed,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
':hover': {
|
|
77
|
+
'& .ms-checkbox-indicator': {
|
|
78
|
+
backgroundColor: theme.colorCompoundBrandBackgroundHover,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}); },
|
|
82
|
+
mixed: function (theme) { return ({
|
|
83
|
+
color: theme.colorNeutralForeground1,
|
|
84
|
+
'& .ms-checkbox-indicator': {
|
|
85
|
+
borderColor: theme.colorCompoundBrandStroke,
|
|
86
|
+
color: theme.colorCompoundBrandForeground1,
|
|
87
|
+
},
|
|
88
|
+
':active': {
|
|
89
|
+
'& .ms-checkbox-indicator': {
|
|
90
|
+
borderColor: theme.colorCompoundBrandStrokePressed,
|
|
91
|
+
color: theme.colorCompoundBrandForeground1Pressed,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
':hover': {
|
|
95
|
+
'& .ms-checkbox-indicator': {
|
|
96
|
+
borderColor: theme.colorCompoundBrandStrokeHover,
|
|
97
|
+
color: theme.colorCompoundBrandForeground1Hover,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
}); },
|
|
101
|
+
focusIndicator: function (theme) {
|
|
102
|
+
return react_tabster_1.createFocusOutlineStyle(theme, { style: { outlineOffset: '2px' }, selector: 'focus-within' });
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
var useContainerStyles = react_make_styles_1.makeStyles({
|
|
106
|
+
container: {
|
|
107
|
+
position: 'relative',
|
|
108
|
+
display: 'flex',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
justifyContent: 'center',
|
|
111
|
+
},
|
|
112
|
+
medium: {
|
|
113
|
+
width: '16px',
|
|
114
|
+
height: '16px',
|
|
115
|
+
},
|
|
116
|
+
large: {
|
|
117
|
+
width: '20px',
|
|
118
|
+
height: '20px',
|
|
119
|
+
},
|
|
120
|
+
// TODO: change marginLeft to Spacing horizontal M once it's added
|
|
121
|
+
before: function (theme) { return ({
|
|
122
|
+
marginLeft: '12px',
|
|
123
|
+
}); },
|
|
124
|
+
// TODO: change marginRight to Spacing horizontal M once it's added
|
|
125
|
+
after: function (theme) { return ({
|
|
126
|
+
marginRight: '12px',
|
|
127
|
+
}); },
|
|
128
|
+
});
|
|
129
|
+
var useInputStyles = react_make_styles_1.makeStyles({
|
|
130
|
+
input: {
|
|
131
|
+
opacity: 0,
|
|
132
|
+
position: 'absolute',
|
|
133
|
+
margin: 0,
|
|
134
|
+
padding: 0,
|
|
135
|
+
cursor: 'pointer',
|
|
136
|
+
},
|
|
137
|
+
disabled: {
|
|
138
|
+
cursor: 'not-allowed',
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
var useIndicatorStyles = react_make_styles_1.makeStyles({
|
|
142
|
+
box: function (theme) { return ({
|
|
143
|
+
width: '100%',
|
|
144
|
+
height: '100%',
|
|
145
|
+
fill: 'currentColor',
|
|
146
|
+
overflow: 'hidden',
|
|
147
|
+
display: 'flex',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
justifyContent: 'center',
|
|
150
|
+
position: 'absolute',
|
|
151
|
+
boxSizing: 'border-box',
|
|
152
|
+
borderStyle: 'solid',
|
|
153
|
+
borderRadius: theme.borderRadiusSmall,
|
|
154
|
+
borderWidth: theme.strokeWidthThin,
|
|
155
|
+
}); },
|
|
156
|
+
circular: function (theme) { return ({
|
|
157
|
+
borderRadius: theme.borderRadiusCircular,
|
|
11
158
|
}); },
|
|
12
159
|
});
|
|
13
160
|
/**
|
|
14
161
|
* Apply styling to the Checkbox slots based on the state
|
|
15
162
|
*/
|
|
16
163
|
var useCheckboxStyles = function (state) {
|
|
164
|
+
var checkedState = state.checked === 'mixed' ? 'mixed' : state.checked ? 'checked' : 'unchecked';
|
|
165
|
+
var indicatorStyles = useIndicatorStyles();
|
|
166
|
+
var inputStyles = useInputStyles();
|
|
167
|
+
var containerStyles = useContainerStyles();
|
|
17
168
|
var styles = useStyles();
|
|
18
|
-
state.className = react_make_styles_1.mergeClasses(styles.root, state.className);
|
|
19
|
-
|
|
20
|
-
|
|
169
|
+
state.root.className = react_make_styles_1.mergeClasses(styles.root, styles.focusIndicator, styles[checkedState], state.input.disabled && styles.disabled, state.root.className);
|
|
170
|
+
state.input.className = react_make_styles_1.mergeClasses(containerStyles[state.size], inputStyles.input, state.input.disabled && inputStyles.disabled, state.input.className);
|
|
171
|
+
state.containerClassName = react_make_styles_1.mergeClasses(containerStyles.container, containerStyles[state.size], !!state.root.children && containerStyles[state.labelPosition]);
|
|
172
|
+
state.indicator.className = react_make_styles_1.mergeClasses(indicatorStyles.box, containerStyles[state.size], state.circular && indicatorStyles.circular, 'ms-checkbox-indicator', state.indicator.className);
|
|
21
173
|
return state;
|
|
22
174
|
};
|
|
23
175
|
exports.useCheckboxStyles = useCheckboxStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckboxStyles.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"useCheckboxStyles.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":";;;AAAA,iEAAuE;AACvE,yDAAkE;AAGlE;;GAEG;AACH,IAAM,SAAS,GAAG,8BAAU,CAAC;IAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,OAAO,EAAE,aAAa;QACtB,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,SAAS;KAClB,CAAC,EARa,CAQb;IAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,8BAA8B;QAC3C,MAAM,EAAE,SAAS;QAEjB,0BAA0B,EAAE;YAC1B,WAAW,EAAE,KAAK,CAAC,0BAA0B;YAC7C,KAAK,EAAE,KAAK,CAAC,8BAA8B;YAC3C,eAAe,EAAE,KAAK,CAAC,uBAAuB;SAC/C;QAED,QAAQ,EAAE;YACR,0BAA0B,EAAE;g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GAAG,gCAAY,CACjC,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,YAAY,CAAC,EACpB,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EACvC,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;IAEF,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,gCAAY,CAClC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAC5C,KAAK,CAAC,KAAK,CAAC,SAAS,CACtB,CAAC;IAEF,KAAK,CAAC,kBAAkB,GAAG,gCAAY,CACrC,eAAe,CAAC,SAAS,EACzB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CAC9D,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,gCAAY,CACtC,eAAe,CAAC,GAAG,EACnB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,KAAK,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAC1C,uBAAuB,EACvB,KAAK,CAAC,SAAS,CAAC,SAAS,CAC1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApCW,QAAA,iBAAiB,qBAoC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-checkbox",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-beta.2",
|
|
4
4
|
"description": "Fluent UI checkbox component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
"code-style": "just-scripts code-style",
|
|
18
18
|
"just": "just-scripts",
|
|
19
19
|
"lint": "just-scripts lint",
|
|
20
|
-
"start": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
20
|
+
"start": "yarn storybook",
|
|
21
|
+
"test": "jest",
|
|
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": "start-storybook"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@fluentui/eslint-plugin": "
|
|
27
|
-
"@fluentui/jest-serializer-make-styles": "
|
|
28
|
-
"@fluentui/react-conformance": "
|
|
27
|
+
"@fluentui/eslint-plugin": "*",
|
|
28
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.1",
|
|
29
|
+
"@fluentui/react-conformance": "*",
|
|
30
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-beta.1",
|
|
29
31
|
"@fluentui/scripts": "^1.0.0",
|
|
30
32
|
"@types/enzyme": "3.10.3",
|
|
31
33
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
|
@@ -39,8 +41,10 @@
|
|
|
39
41
|
"react-test-renderer": "^16.3.0"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@fluentui/react-make-styles": "
|
|
43
|
-
"@fluentui/react-utilities": "
|
|
44
|
+
"@fluentui/react-make-styles": "9.0.0-beta.1",
|
|
45
|
+
"@fluentui/react-utilities": "9.0.0-beta.1",
|
|
46
|
+
"@fluentui/react-label": "9.0.0-beta.1",
|
|
47
|
+
"@fluentui/react-tabster": "9.0.0-beta.2",
|
|
44
48
|
"tslib": "^2.1.0"
|
|
45
49
|
},
|
|
46
50
|
"peerDependencies": {
|
|
@@ -50,7 +54,7 @@
|
|
|
50
54
|
"react-dom": ">=16.8.0 <18.0.0"
|
|
51
55
|
},
|
|
52
56
|
"beachball": {
|
|
53
|
-
"tag": "
|
|
57
|
+
"tag": "beta",
|
|
54
58
|
"disallowedChangeTypes": [
|
|
55
59
|
"major",
|
|
56
60
|
"minor",
|
package/config/tests.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
## API Report File for "@fluentui/react-checkbox"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { ComponentPropsCompat } from '@fluentui/react-utilities';
|
|
8
|
-
import { ComponentStateCompat } from '@fluentui/react-utilities';
|
|
9
|
-
import * as React_2 from 'react';
|
|
10
|
-
|
|
11
|
-
// @public
|
|
12
|
-
export const Checkbox: React_2.ForwardRefExoticComponent<CheckboxProps & React_2.RefAttributes<HTMLElement>>;
|
|
13
|
-
|
|
14
|
-
// @public
|
|
15
|
-
export type CheckboxDefaultedProps = never;
|
|
16
|
-
|
|
17
|
-
// @public
|
|
18
|
-
export interface CheckboxProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// @public
|
|
22
|
-
export type CheckboxShorthandProps = never;
|
|
23
|
-
|
|
24
|
-
// @public
|
|
25
|
-
export const checkboxShorthandProps: CheckboxShorthandProps[];
|
|
26
|
-
|
|
27
|
-
// @public
|
|
28
|
-
export interface CheckboxState extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
|
|
29
|
-
ref: React_2.Ref<HTMLElement>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// @public
|
|
33
|
-
export const renderCheckbox: (state: CheckboxState) => JSX.Element;
|
|
34
|
-
|
|
35
|
-
// @public
|
|
36
|
-
export const useCheckbox: (props: CheckboxProps, ref: React_2.Ref<HTMLElement>, defaultProps?: CheckboxProps | undefined) => CheckboxState;
|
|
37
|
-
|
|
38
|
-
// @public
|
|
39
|
-
export const useCheckboxStyles: (state: CheckboxState) => CheckboxState;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// (No @packageDocumentation comment for this package)
|
|
43
|
-
|
|
44
|
-
```
|
package/just.config.ts
DELETED
package/lib-amd/Checkbox.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Checkbox/index';
|
package/lib-amd/Checkbox.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./components/Checkbox/index"], function (require, exports, tslib_1, index_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=Checkbox.js.map
|
package/lib-amd/Checkbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["Checkbox.ts"],"names":[],"mappings":";;;IAAA,uCAA4C","sourcesContent":["export * from './components/Checkbox/index';\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-conformance"], function (require, exports, react_conformance_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isConformant = void 0;
|
|
5
|
-
function isConformant(testInfo) {
|
|
6
|
-
var defaultOptions = {
|
|
7
|
-
asPropHandlesRef: true,
|
|
8
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
9
|
-
};
|
|
10
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
|
11
|
-
}
|
|
12
|
-
exports.isConformant = isConformant;
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;;IAEA,SAAgB,YAAY,CAC1B,QAAyF;QAEzF,IAAM,cAAc,GAAyC;YAC3D,gBAAgB,EAAE,IAAI;YACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SAC7D,CAAC;QAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IATD,oCASC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CheckboxProps } from './Checkbox.types';
|
|
3
|
-
/**
|
|
4
|
-
* A Checkbox component provides a way to represent options that can be selected
|
|
5
|
-
*/
|
|
6
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "./useCheckbox", "./renderCheckbox", "./useCheckboxStyles"], function (require, exports, React, useCheckbox_1, renderCheckbox_1, useCheckboxStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Checkbox = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* A Checkbox component provides a way to represent options that can be selected
|
|
7
|
-
*/
|
|
8
|
-
exports.Checkbox = React.forwardRef(function (props, ref) {
|
|
9
|
-
var state = useCheckbox_1.useCheckbox(props, ref);
|
|
10
|
-
useCheckboxStyles_1.useCheckboxStyles(state);
|
|
11
|
-
return renderCheckbox_1.renderCheckbox(state);
|
|
12
|
-
});
|
|
13
|
-
exports.Checkbox.displayName = 'Checkbox';
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACU,QAAA,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;QAC9E,IAAM,KAAK,GAAG,yBAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEtC,qCAAiB,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,+BAAc,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import * as React from 'react';\nimport { useCheckbox } from './useCheckbox';\nimport { CheckboxProps } from './Checkbox.types';\nimport { renderCheckbox } from './renderCheckbox';\nimport { useCheckboxStyles } from './useCheckboxStyles';\n\n/**\n * A Checkbox component provides a way to represent options that can be selected\n */\nexport const Checkbox = React.forwardRef<HTMLElement, CheckboxProps>((props, ref) => {\n const state = useCheckbox(props, ref);\n\n useCheckboxStyles(state);\n return renderCheckbox(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities';
|
|
3
|
-
/**
|
|
4
|
-
* Checkbox Props
|
|
5
|
-
*/
|
|
6
|
-
export interface CheckboxProps extends ComponentPropsCompat, React.HTMLAttributes<HTMLElement> {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Names of the shorthand properties in CheckboxProps
|
|
10
|
-
*/
|
|
11
|
-
export declare type CheckboxShorthandProps = never;
|
|
12
|
-
/**
|
|
13
|
-
* Names of CheckboxProps that have a default value in useCheckbox
|
|
14
|
-
*/
|
|
15
|
-
export declare type CheckboxDefaultedProps = never;
|
|
16
|
-
/**
|
|
17
|
-
* State used in rendering Checkbox
|
|
18
|
-
*/
|
|
19
|
-
export interface CheckboxState extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
|
|
20
|
-
/**
|
|
21
|
-
* Ref to the root element
|
|
22
|
-
*/
|
|
23
|
-
ref: React.Ref<HTMLElement>;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.types.js","sourceRoot":"../src/","sources":["components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities';\n\n/**\n * Checkbox Props\n */\nexport interface CheckboxProps extends ComponentPropsCompat, React.HTMLAttributes<HTMLElement> {\n /*\n * TODO Add props and slots here\n * Any slot property should be listed in the checkboxShorthandProps array below\n * Any property that has a default value should be listed in CheckboxDefaultedProps as e.g. 'size' | 'icon'\n */\n}\n\n/**\n * Names of the shorthand properties in CheckboxProps\n */\nexport type CheckboxShorthandProps = never; // TODO add shorthand property names\n\n/**\n * Names of CheckboxProps that have a default value in useCheckbox\n */\nexport type CheckboxDefaultedProps = never; // TODO add names of properties with default values\n\n/**\n * State used in rendering Checkbox\n */\nexport interface CheckboxState\n extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {\n /**\n * Ref to the root element\n */\n ref: React.Ref<HTMLElement>;\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./Checkbox", "./Checkbox.types", "./renderCheckbox", "./useCheckbox", "./useCheckboxStyles"], function (require, exports, tslib_1, Checkbox_1, Checkbox_types_1, renderCheckbox_1, useCheckbox_1, useCheckboxStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(Checkbox_1, exports);
|
|
5
|
-
tslib_1.__exportStar(Checkbox_types_1, exports);
|
|
6
|
-
tslib_1.__exportStar(renderCheckbox_1, exports);
|
|
7
|
-
tslib_1.__exportStar(useCheckbox_1, exports);
|
|
8
|
-
tslib_1.__exportStar(useCheckboxStyles_1, exports);
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Checkbox/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,gDAAiC;IACjC,gDAAiC;IACjC,6CAA8B;IAC9B,mDAAoC","sourcesContent":["export * from './Checkbox';\nexport * from './Checkbox.types';\nexport * from './renderCheckbox';\nexport * from './useCheckbox';\nexport * from './useCheckboxStyles';\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./useCheckbox"], function (require, exports, tslib_1, React, react_utilities_1, useCheckbox_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.renderCheckbox = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Render the final JSX of Checkbox
|
|
7
|
-
*/
|
|
8
|
-
var renderCheckbox = function (state) {
|
|
9
|
-
var _a = react_utilities_1.getSlotsCompat(state, useCheckbox_1.checkboxShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
-
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.children));
|
|
11
|
-
};
|
|
12
|
-
exports.renderCheckbox = renderCheckbox;
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=renderCheckbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,cAAc,GAAG,UAAC,KAAoB;QAC3C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,oCAAsB,CAAC,EAAlE,KAAK,WAAA,EAAE,SAAS,eAAkD,CAAC;QAE3E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,GAE3B,KAAK,CAAC,QAAQ,CACJ,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,cAAc,kBASzB","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { CheckboxState } from './Checkbox.types';\nimport { checkboxShorthandProps } from './useCheckbox';\n\n/**\n * Render the final JSX of Checkbox\n */\nexport const renderCheckbox = (state: CheckboxState) => {\n const { slots, slotProps } = getSlotsCompat(state, checkboxShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {/* TODO Add additional slots in the appropriate place */}\n {state.children}\n </slots.root>\n );\n};\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CheckboxProps, CheckboxShorthandProps, CheckboxState } from './Checkbox.types';
|
|
3
|
-
/**
|
|
4
|
-
* Array of all shorthand properties listed in CheckboxShorthandProps
|
|
5
|
-
*/
|
|
6
|
-
export declare const checkboxShorthandProps: CheckboxShorthandProps[];
|
|
7
|
-
/**
|
|
8
|
-
* Create the state required to render Checkbox.
|
|
9
|
-
*
|
|
10
|
-
* The returned state can be modified with hooks such as useCheckboxStyles,
|
|
11
|
-
* before being passed to renderCheckbox.
|
|
12
|
-
*
|
|
13
|
-
* @param props - props from this instance of Checkbox
|
|
14
|
-
* @param ref - reference to root HTMLElement of Checkbox
|
|
15
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
|
16
|
-
*/
|
|
17
|
-
export declare const useCheckbox: (props: CheckboxProps, ref: React.Ref<HTMLElement>, defaultProps?: CheckboxProps | undefined) => CheckboxState;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-utilities"], function (require, exports, react_utilities_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useCheckbox = exports.checkboxShorthandProps = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Array of all shorthand properties listed in CheckboxShorthandProps
|
|
7
|
-
*/
|
|
8
|
-
exports.checkboxShorthandProps = [
|
|
9
|
-
/* TODO add shorthand property names */
|
|
10
|
-
];
|
|
11
|
-
var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.checkboxShorthandProps });
|
|
12
|
-
/**
|
|
13
|
-
* Create the state required to render Checkbox.
|
|
14
|
-
*
|
|
15
|
-
* The returned state can be modified with hooks such as useCheckboxStyles,
|
|
16
|
-
* before being passed to renderCheckbox.
|
|
17
|
-
*
|
|
18
|
-
* @param props - props from this instance of Checkbox
|
|
19
|
-
* @param ref - reference to root HTMLElement of Checkbox
|
|
20
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
|
21
|
-
*/
|
|
22
|
-
var useCheckbox = function (props, ref, defaultProps) {
|
|
23
|
-
var state = mergeProps({
|
|
24
|
-
ref: ref,
|
|
25
|
-
}, defaultProps && react_utilities_1.resolveShorthandProps(defaultProps, exports.checkboxShorthandProps), react_utilities_1.resolveShorthandProps(props, exports.checkboxShorthandProps));
|
|
26
|
-
return state;
|
|
27
|
-
};
|
|
28
|
-
exports.useCheckbox = useCheckbox;
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=useCheckbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckbox.js","sourceRoot":"../src/","sources":["components/Checkbox/useCheckbox.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACU,QAAA,sBAAsB,GAA6B;IAC9D,uCAAuC;KACxC,CAAC;IAEF,IAAM,UAAU,GAAG,gCAAc,CAAgB,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC,CAAC;IAExF;;;;;;;;;OASG;IACI,IAAM,WAAW,GAAG,UACzB,KAAoB,EACpB,GAA2B,EAC3B,YAA4B;QAE5B,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;SACJ,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,8BAAsB,CAAC,EAC3E,uCAAqB,CAAC,KAAK,EAAE,8BAAsB,CAAC,CACrD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAdW,QAAA,WAAW,eActB","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { CheckboxProps, CheckboxShorthandProps, CheckboxState } from './Checkbox.types';\n\n/**\n * Array of all shorthand properties listed in CheckboxShorthandProps\n */\nexport const checkboxShorthandProps: CheckboxShorthandProps[] = [\n /* TODO add shorthand property names */\n];\n\nconst mergeProps = makeMergeProps<CheckboxState>({ deepMerge: checkboxShorthandProps });\n\n/**\n * Create the state required to render Checkbox.\n *\n * The returned state can be modified with hooks such as useCheckboxStyles,\n * before being passed to renderCheckbox.\n *\n * @param props - props from this instance of Checkbox\n * @param ref - reference to root HTMLElement of Checkbox\n * @param defaultProps - (optional) default prop values provided by the implementing type\n */\nexport const useCheckbox = (\n props: CheckboxProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CheckboxProps,\n): CheckboxState => {\n const state = mergeProps(\n {\n ref,\n },\n defaultProps && resolveShorthandProps(defaultProps, checkboxShorthandProps),\n resolveShorthandProps(props, checkboxShorthandProps),\n );\n\n return state;\n};\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-make-styles"], function (require, exports, react_make_styles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useCheckboxStyles = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Styles for the root slot
|
|
7
|
-
*/
|
|
8
|
-
var useStyles = react_make_styles_1.makeStyles({
|
|
9
|
-
root: function (theme) { return ({
|
|
10
|
-
// TODO Add default styles for the root element
|
|
11
|
-
}); },
|
|
12
|
-
});
|
|
13
|
-
/**
|
|
14
|
-
* Apply styling to the Checkbox slots based on the state
|
|
15
|
-
*/
|
|
16
|
-
var useCheckboxStyles = function (state) {
|
|
17
|
-
var styles = useStyles();
|
|
18
|
-
state.className = react_make_styles_1.mergeClasses(styles.root, state.className);
|
|
19
|
-
// TODO Add class names to slots, for example:
|
|
20
|
-
// state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
|
|
21
|
-
return state;
|
|
22
|
-
};
|
|
23
|
-
exports.useCheckboxStyles = useCheckboxStyles;
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=useCheckboxStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckboxStyles.js","sourceRoot":"../src/","sources":["components/Checkbox/useCheckboxStyles.ts"],"names":[],"mappings":";;;;IAGA;;OAEG;IACH,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,+CAA+C;SAChD,CAAC,EAFa,CAEb;KAGH,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAoB;QACpD,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,SAAS,GAAG,gCAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAE7D,8CAA8C;QAC9C,gFAAgF;QAEhF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,iBAAiB,qBAQ5B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { CheckboxState } from './Checkbox.types';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n // TODO Add default styles for the root element\n }),\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the Checkbox slots based on the state\n */\nexport const useCheckboxStyles = (state: CheckboxState): CheckboxState => {\n const styles = useStyles();\n state.className = mergeClasses(styles.root, state.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"]}
|
package/lib-amd/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Checkbox';
|
package/lib-amd/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./Checkbox"], function (require, exports, tslib_1, Checkbox_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(Checkbox_1, exports);
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B","sourcesContent":["export * from './Checkbox';\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Checkbox Props
|
|
6
|
-
*/
|
|
7
|
-
export interface CheckboxProps extends ComponentPropsCompat, React.HTMLAttributes<HTMLElement> {
|
|
8
|
-
/*
|
|
9
|
-
* TODO Add props and slots here
|
|
10
|
-
* Any slot property should be listed in the checkboxShorthandProps array below
|
|
11
|
-
* Any property that has a default value should be listed in CheckboxDefaultedProps as e.g. 'size' | 'icon'
|
|
12
|
-
*/
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Names of the shorthand properties in CheckboxProps
|
|
17
|
-
*/
|
|
18
|
-
export type CheckboxShorthandProps = never; // TODO add shorthand property names
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Names of CheckboxProps that have a default value in useCheckbox
|
|
22
|
-
*/
|
|
23
|
-
export type CheckboxDefaultedProps = never; // TODO add names of properties with default values
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* State used in rendering Checkbox
|
|
27
|
-
*/
|
|
28
|
-
export interface CheckboxState
|
|
29
|
-
extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
|
|
30
|
-
/**
|
|
31
|
-
* Ref to the root element
|
|
32
|
-
*/
|
|
33
|
-
ref: React.Ref<HTMLElement>;
|
|
34
|
-
}
|