@fluentui/react-checkbox 9.0.0-beta.2 → 9.0.0-beta.6

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 (51) hide show
  1. package/CHANGELOG.json +331 -1
  2. package/CHANGELOG.md +75 -2
  3. package/Spec.md +25 -115
  4. package/dist/react-checkbox.d.ts +37 -46
  5. package/lib/components/Checkbox/Checkbox.d.ts +2 -1
  6. package/lib/components/Checkbox/Checkbox.js +10 -8
  7. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  8. package/lib/components/Checkbox/Checkbox.types.d.ts +29 -34
  9. package/lib/components/Checkbox/renderCheckbox.d.ts +1 -1
  10. package/lib/components/Checkbox/renderCheckbox.js +11 -10
  11. package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
  12. package/lib/components/Checkbox/useCheckbox.d.ts +5 -9
  13. package/lib/components/Checkbox/useCheckbox.js +99 -68
  14. package/lib/components/Checkbox/useCheckbox.js.map +1 -1
  15. package/lib/components/Checkbox/useCheckboxStyles.d.ts +2 -1
  16. package/lib/components/Checkbox/useCheckboxStyles.js +216 -159
  17. package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
  18. package/lib-commonjs/Checkbox.js +7 -2
  19. package/lib-commonjs/Checkbox.js.map +1 -1
  20. package/lib-commonjs/components/Checkbox/Checkbox.d.ts +2 -1
  21. package/lib-commonjs/components/Checkbox/Checkbox.js +20 -10
  22. package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
  23. package/lib-commonjs/components/Checkbox/Checkbox.types.d.ts +29 -34
  24. package/lib-commonjs/components/Checkbox/Checkbox.types.js +4 -1
  25. package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
  26. package/lib-commonjs/components/Checkbox/index.js +11 -2
  27. package/lib-commonjs/components/Checkbox/index.js.map +1 -1
  28. package/lib-commonjs/components/Checkbox/renderCheckbox.d.ts +1 -1
  29. package/lib-commonjs/components/Checkbox/renderCheckbox.js +23 -15
  30. package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
  31. package/lib-commonjs/components/Checkbox/useCheckbox.d.ts +5 -9
  32. package/lib-commonjs/components/Checkbox/useCheckbox.js +113 -73
  33. package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
  34. package/lib-commonjs/components/Checkbox/useCheckboxStyles.d.ts +2 -1
  35. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +228 -163
  36. package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
  37. package/lib-commonjs/index.js +7 -2
  38. package/lib-commonjs/index.js.map +1 -1
  39. package/package.json +11 -11
  40. package/lib/common/isConformant.d.ts +0 -4
  41. package/lib/common/isConformant.js +0 -12
  42. package/lib/common/isConformant.js.map +0 -1
  43. package/lib/components/Checkbox/DefaultIcons.d.ts +0 -4
  44. package/lib/components/Checkbox/DefaultIcons.js +0 -10
  45. package/lib/components/Checkbox/DefaultIcons.js.map +0 -1
  46. package/lib-commonjs/common/isConformant.d.ts +0 -4
  47. package/lib-commonjs/common/isConformant.js +0 -16
  48. package/lib-commonjs/common/isConformant.js.map +0 -1
  49. package/lib-commonjs/components/Checkbox/DefaultIcons.d.ts +0 -4
  50. package/lib-commonjs/components/Checkbox/DefaultIcons.js +0 -17
  51. package/lib-commonjs/components/Checkbox/DefaultIcons.js.map +0 -1
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  //# sourceMappingURL=Checkbox.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.types.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
4
9
  tslib_1.__exportStar(require("./Checkbox"), exports);
10
+
5
11
  tslib_1.__exportStar(require("./Checkbox.types"), exports);
12
+
6
13
  tslib_1.__exportStar(require("./renderCheckbox"), exports);
14
+
7
15
  tslib_1.__exportStar(require("./useCheckbox"), exports);
16
+
8
17
  tslib_1.__exportStar(require("./useCheckboxStyles"), exports);
9
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,2DAAiC;AACjC,2DAAiC;AACjC,wDAA8B;AAC9B,8DAAoC"}
1
+ {"version":3,"sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
@@ -1,2 +1,2 @@
1
1
  import { CheckboxState } from './Checkbox.types';
2
- export declare const renderCheckbox: (state: CheckboxState) => JSX.Element;
2
+ export declare const renderCheckbox_unstable: (state: CheckboxState) => JSX.Element;
@@ -1,18 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderCheckbox = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var react_utilities_1 = require("@fluentui/react-utilities");
7
- var useCheckbox_1 = require("./useCheckbox");
8
- var renderCheckbox = function (state) {
9
- var _a = react_utilities_1.getSlots(state, useCheckbox_1.checkboxShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
10
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
- state.labelPosition === 'before' && slotProps.root.children,
12
- React.createElement("div", { className: state.containerClassName },
13
- React.createElement(slots.indicator, tslib_1.__assign({}, slotProps.indicator)),
14
- React.createElement(slots.input, tslib_1.__assign({}, slotProps.input))),
15
- state.labelPosition === 'after' && slotProps.root.children));
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderCheckbox_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const renderCheckbox_unstable = state => {
13
+ const {
14
+ slots,
15
+ slotProps
16
+ } = react_utilities_1.getSlots(state);
17
+ return React.createElement(slots.root, { ...slotProps.root
18
+ }, state.labelPosition === 'before' && slots.label && React.createElement(slots.label, { ...slotProps.label
19
+ }), React.createElement(slots.indicator, { ...slotProps.indicator
20
+ }), React.createElement(slots.input, { ...slotProps.input
21
+ }), state.labelPosition === 'after' && slots.label && React.createElement(slots.label, { ...slotProps.label
22
+ }));
16
23
  };
17
- exports.renderCheckbox = renderCheckbox;
24
+
25
+ exports.renderCheckbox_unstable = renderCheckbox_unstable;
18
26
  //# sourceMappingURL=renderCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/renderCheckbox.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6DAAqD;AAErD,6CAAuD;AAEhD,IAAM,cAAc,GAAG,UAAC,KAAoB;IAC3C,IAAA,KAAuB,0BAAQ,CAAgB,KAAK,EAAE,oCAAsB,CAAC,EAA3E,KAAK,WAAA,EAAE,SAAS,eAA2D,CAAC;IAEpF,OAAO,CACL,oBAAC,KAAK,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mC,KAAK,CAAC,KAAzC,IAAkD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CAJrD,CADF;AAQD,CAXM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
@@ -1,16 +1,12 @@
1
1
  import * as React from 'react';
2
- import { CheckboxProps, CheckboxSlots, CheckboxState } from './Checkbox.types';
3
- /**
4
- * Array of all shorthand properties listed as the keys of CheckboxSlots
5
- */
6
- export declare const checkboxShorthandProps: Array<keyof CheckboxSlots>;
2
+ import { CheckboxProps, CheckboxState } from './Checkbox.types';
7
3
  /**
8
4
  * Create the state required to render Checkbox.
9
5
  *
10
- * The returned state can be modified with hooks such as useCheckboxStyles,
11
- * before being passed to renderCheckbox.
6
+ * The returned state can be modified with hooks such as useCheckboxStyles_unstable,
7
+ * before being passed to renderCheckbox_unstable.
12
8
  *
13
9
  * @param props - props from this instance of Checkbox
14
- * @param ref - reference to root HTMLElement of Checkbox
10
+ * @param ref - reference to `<input>` element of Checkbox
15
11
  */
16
- export declare const useCheckbox: (props: CheckboxProps, ref: React.Ref<HTMLElement>) => CheckboxState;
12
+ export declare const useCheckbox_unstable: (props: CheckboxProps, ref: React.Ref<HTMLInputElement>) => CheckboxState;
@@ -1,84 +1,124 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCheckbox = exports.checkboxShorthandProps = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var react_utilities_1 = require("@fluentui/react-utilities");
7
- var DefaultIcons_1 = require("./DefaultIcons");
8
- var react_label_1 = require("@fluentui/react-label");
9
- /**
10
- * Array of all shorthand properties listed as the keys of CheckboxSlots
11
- */
12
- exports.checkboxShorthandProps = ['root', 'indicator', 'input'];
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useCheckbox_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
13
+
14
+ const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
13
15
  /**
14
16
  * Create the state required to render Checkbox.
15
17
  *
16
- * The returned state can be modified with hooks such as useCheckboxStyles,
17
- * before being passed to renderCheckbox.
18
+ * The returned state can be modified with hooks such as useCheckboxStyles_unstable,
19
+ * before being passed to renderCheckbox_unstable.
18
20
  *
19
21
  * @param props - props from this instance of Checkbox
20
- * @param ref - reference to root HTMLElement of Checkbox
22
+ * @param ref - reference to `<input>` element of Checkbox
21
23
  */
22
- var useCheckbox = function (props, ref) {
23
- var _a = props.disabled, disabled = _a === void 0 ? false : _a, _b = props.circular, circular = _b === void 0 ? false : _b, _c = props.required, required = _c === void 0 ? false : _c, id = props.id, rootId = props.rootId, userOnChange = props.onChange;
24
- var _d = react_utilities_1.useControllableState({
25
- defaultState: props.defaultChecked,
26
- state: props.checked,
27
- initialState: false,
28
- }), checked = _d[0], setChecked = _d[1];
29
- var inputInternalRef = React.useRef(null);
30
- var inputShorthand = react_utilities_1.resolveShorthand(props.input, {
31
- required: true,
32
- defaultProps: {
33
- disabled: disabled,
34
- type: 'checkbox',
35
- required: required,
36
- },
37
- });
38
- var state = {
39
- circular: circular,
40
- checked: checked,
41
- size: 'medium',
42
- labelPosition: 'after',
43
- rootId: rootId,
44
- components: {
45
- root: props.children !== undefined ? react_label_1.Label : 'span',
46
- indicator: 'div',
47
- input: 'input',
48
- },
49
- input: tslib_1.__assign(tslib_1.__assign({}, inputShorthand), { ref: react_utilities_1.useMergedRefs(inputShorthand.ref, inputInternalRef) }),
50
- indicator: react_utilities_1.resolveShorthand(props.indicator, {
51
- required: true,
52
- }),
53
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
54
- };
55
- state.input.checked = checked === true;
56
- state.checked = checked ? checked : false;
57
- if (state.indicator && !state.indicator.children) {
58
- if (state.size === 'medium') {
59
- state.indicator.children = checked === 'mixed' ? React.createElement(DefaultIcons_1.Mixed12Regular, null) : React.createElement(DefaultIcons_1.Checkmark12Regular, null);
60
- }
61
- else {
62
- state.indicator.children = checked === 'mixed' ? React.createElement(DefaultIcons_1.Mixed16Regular, null) : React.createElement(DefaultIcons_1.Checkmark16Regular, null);
63
- }
24
+
25
+
26
+ const useCheckbox_unstable = (props, ref) => {
27
+ const {
28
+ disabled,
29
+ required,
30
+ circular = false,
31
+ size = 'medium',
32
+ labelPosition = 'after',
33
+ onChange
34
+ } = props;
35
+ const [checked, setChecked] = react_utilities_1.useControllableState({
36
+ defaultState: props.defaultChecked,
37
+ state: props.checked,
38
+ initialState: false
39
+ });
40
+ const nativeProps = react_utilities_1.getPartitionedNativeProps({
41
+ props,
42
+ primarySlotTagName: 'input',
43
+ excludedPropNames: ['checked', 'defaultChecked', 'size', 'onChange']
44
+ });
45
+ const mixed = checked === 'mixed';
46
+ const id = react_utilities_1.useId('checkbox-', nativeProps.primary.id);
47
+ let checkmarkIcon;
48
+
49
+ if (mixed) {
50
+ if (circular) {
51
+ checkmarkIcon = size === 'large' ? React.createElement(react_icons_1.Circle16Filled, null) : React.createElement(react_icons_1.Circle12Filled, null);
52
+ } else {
53
+ checkmarkIcon = size === 'large' ? React.createElement(react_icons_1.Square16Filled, null) : React.createElement(react_icons_1.Square12Filled, null);
64
54
  }
65
- var inputOnChange = state.input.onChange;
66
- state.input.onChange = react_utilities_1.useEventCallback(function (ev) {
67
- ev.stopPropagation();
68
- inputOnChange === null || inputOnChange === void 0 ? void 0 : inputOnChange(ev);
69
- var val = ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked;
70
- userOnChange === null || userOnChange === void 0 ? void 0 : userOnChange(ev, { checked: val });
71
- setChecked(val);
55
+ } else {
56
+ checkmarkIcon = size === 'large' ? React.createElement(react_icons_1.Checkmark16Filled, null) : React.createElement(react_icons_1.Checkmark12Filled, null);
57
+ }
58
+
59
+ const state = {
60
+ circular,
61
+ checked,
62
+ size,
63
+ labelPosition,
64
+ components: {
65
+ root: 'span',
66
+ input: 'input',
67
+ indicator: 'div',
68
+ label: react_label_1.Label
69
+ },
70
+ root: react_utilities_1.resolveShorthand(props.root, {
71
+ required: true,
72
+ defaultProps: nativeProps.root
73
+ }),
74
+ input: react_utilities_1.resolveShorthand(props.input, {
75
+ required: true,
76
+ defaultProps: {
77
+ type: 'checkbox',
78
+ id,
79
+ ref,
80
+ checked: checked === true,
81
+ ...nativeProps.primary
82
+ }
83
+ }),
84
+ label: react_utilities_1.resolveShorthand(props.label, {
85
+ required: false,
86
+ defaultProps: {
87
+ htmlFor: id,
88
+ disabled,
89
+ required,
90
+ size: 'medium' // Even if the checkbox itself is large
91
+
92
+ }
93
+ }),
94
+ indicator: react_utilities_1.resolveShorthand(props.indicator, {
95
+ required: true,
96
+ defaultProps: {
97
+ 'aria-hidden': true,
98
+ children: checkmarkIcon
99
+ }
100
+ })
101
+ };
102
+ state.input.onChange = react_utilities_1.useEventCallback(ev => {
103
+ const val = ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked;
104
+ onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
105
+ checked: val
72
106
  });
73
- state.input.id = react_utilities_1.useId('checkbox-', id);
74
- state.root.id = state.rootId;
75
- var isMixed = checked === 'mixed';
76
- react_utilities_1.useIsomorphicLayoutEffect(function () {
77
- if (inputInternalRef.current) {
78
- inputInternalRef.current.indeterminate = isMixed;
79
- }
80
- }, [isMixed]);
81
- return state;
107
+ setChecked(val);
108
+ }); // Create a ref object for the input element so we can use it to set the indeterminate prop.
109
+ // Use useMergedRefs, since the ref might be undefined or a function-ref (no .current)
110
+
111
+ const inputRef = react_utilities_1.useMergedRefs(state.input.ref);
112
+ state.input.ref = inputRef; // Set the <input> element's checked and indeterminate properties based on our tri-state property.
113
+ // Since indeterminate can only be set via javascript, it has to be done in a layout effect.
114
+
115
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
116
+ if (inputRef.current) {
117
+ inputRef.current.indeterminate = mixed;
118
+ }
119
+ }, [inputRef, mixed]);
120
+ return state;
82
121
  };
83
- exports.useCheckbox = useCheckbox;
122
+
123
+ exports.useCheckbox_unstable = useCheckbox_unstable;
84
124
  //# sourceMappingURL=useCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/useCheckbox.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6DAQmC;AAEnC,+CAAwG;AACxG,qDAA0D;AAE1D;;GAEG;AACU,QAAA,sBAAsB,GAA+B,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAEjG;;;;;;;;GAQG;AACI,IAAM,WAAW,GAAG,UAAC,KAAoB,EAAE,GAA2B;IACnE,IAAA,KAA6F,KAAK,SAAlF,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAA2E,KAAK,SAAhE,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAAyD,KAAK,SAA9C,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,EAAE,GAAqC,KAAK,GAA1C,EAAE,MAAM,GAA6B,KAAK,OAAlC,EAAY,YAAY,GAAK,KAAK,SAAV,CAAW;IACrG,IAAA,KAAwB,sCAAoB,CAAC;QACjD,YAAY,EAAE,KAAK,CAAC,cAAc;QAClC,KAAK,EAAE,KAAK,CAAC,OAAO;QACpB,YAAY,EAAE,KAAK;KACpB,CAAC,EAJK,OAAO,QAAA,EAAE,UAAU,QAIxB,CAAC;IAEH,IAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC9D,IAAM,cAAc,GAAG,kCAAgB,CAAC,KAAK,CAAC,KAAK,EAAE;QACnD,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE;YACZ,QAAQ,UAAA;YACR,IAAI,EAAE,UAAU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;AAkC3B,IAAA,SAAS,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,SAAvB,EAAkC;AAC3C,MAAA,QAAQ,EAAE,IADiC;AAE3C,MAAA,YAAY,EAAE;AACZ,uBAAe,IADH;AAEZ,QAAA,QAAQ,EAAE;AAFE;AAF6B,KAAlC;AAlCgB,GAA7B;AA2CA,EAAA,KAAK,CAAC,KAAN,CAAY,QAAZ,GAAuB,iBAAA,CAAA,gBAAA,CAAiB,EAAE,IAAG;AAC3C,UAAM,GAAG,GAAG,EAAE,CAAC,aAAH,CAAiB,aAAjB,GAAiC,OAAjC,GAA2C,EAAE,CAAC,aAAH,CAAiB,OAAxE;AACA,IAAA,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,EAAH,EAAO;AAAE,MAAA,OAAO,EAAE;AAAX,KAAP,CAAR;AACA,IAAA,UAAU,CAAC,GAAD,CAAV;AACD,GAJsB,CAAvB,CAxE4G,CA8E5G;AACA;;AACA,QAAM,QAAQ,GAAG,iBAAA,CAAA,aAAA,CAAc,KAAK,CAAC,KAAN,CAAY,GAA1B,CAAjB;AACA,EAAA,KAAK,CAAC,KAAN,CAAY,GAAZ,GAAkB,QAAlB,CAjF4G,CAmF5G;AACA;;AACA,EAAA,iBAAA,CAAA,yBAAA,CAA0B,MAAK;AAC7B,QAAI,QAAQ,CAAC,OAAb,EAAsB;AACpB,MAAA,QAAQ,CAAC,OAAT,CAAiB,aAAjB,GAAiC,KAAjC;AACD;AACF,GAJD,EAIG,CAAC,QAAD,EAAW,KAAX,CAJH;AAMA,SAAO,KAAP;AACD,CA5FM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
@@ -1,5 +1,6 @@
1
1
  import { CheckboxState } from './Checkbox.types';
2
+ export declare const checkboxClassName = "fui-Checkbox";
2
3
  /**
3
4
  * Apply styling to the Checkbox slots based on the state
4
5
  */
5
- export declare const useCheckboxStyles: (state: CheckboxState) => CheckboxState;
6
+ export declare const useCheckboxStyles_unstable: (state: CheckboxState) => CheckboxState;