@fluentui/react-checkbox 9.1.3 → 9.1.5
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/.swcrc +30 -0
- package/CHANGELOG.json +103 -1
- package/CHANGELOG.md +32 -2
- package/lib/Checkbox.js.map +1 -1
- package/lib/CheckboxField.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.types.js +1 -1
- package/lib/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib/components/Checkbox/index.js.map +1 -1
- package/lib/components/Checkbox/renderCheckbox.js +1 -11
- package/lib/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckbox.js +1 -2
- package/lib/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib/components/CheckboxField/CheckboxField.js +1 -2
- package/lib/components/CheckboxField/CheckboxField.js.map +1 -1
- package/lib/components/CheckboxField/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Checkbox.js +5 -4
- package/lib-commonjs/Checkbox.js.map +1 -1
- package/lib-commonjs/CheckboxField.js +5 -4
- package/lib-commonjs/CheckboxField.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.js +19 -21
- package/lib-commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/Checkbox.types.js +5 -2
- package/lib-commonjs/components/Checkbox/Checkbox.types.js.map +1 -1
- package/lib-commonjs/components/Checkbox/index.js +9 -8
- package/lib-commonjs/components/Checkbox/index.js.map +1 -1
- package/lib-commonjs/components/Checkbox/renderCheckbox.js +13 -23
- package/lib-commonjs/components/Checkbox/renderCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckbox.js +107 -113
- package/lib-commonjs/components/Checkbox/useCheckbox.js.map +1 -1
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js +344 -161
- package/lib-commonjs/components/Checkbox/useCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/CheckboxField/CheckboxField.js +27 -21
- package/lib-commonjs/components/CheckboxField/CheckboxField.js.map +1 -1
- package/lib-commonjs/components/CheckboxField/index.js +5 -4
- package/lib-commonjs/components/CheckboxField/index.js.map +1 -1
- package/lib-commonjs/index.js +21 -49
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -11
- package/lib-amd/Checkbox.js +0 -6
- package/lib-amd/Checkbox.js.map +0 -1
- package/lib-amd/CheckboxField.js +0 -6
- package/lib-amd/CheckboxField.js.map +0 -1
- package/lib-amd/components/Checkbox/Checkbox.js +0 -18
- package/lib-amd/components/Checkbox/Checkbox.js.map +0 -1
- 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.js +0 -10
- package/lib-amd/components/Checkbox/index.js.map +0 -1
- package/lib-amd/components/Checkbox/renderCheckbox.js +0 -15
- package/lib-amd/components/Checkbox/renderCheckbox.js.map +0 -1
- package/lib-amd/components/Checkbox/useCheckbox.js +0 -97
- package/lib-amd/components/Checkbox/useCheckbox.js.map +0 -1
- package/lib-amd/components/Checkbox/useCheckboxStyles.js +0 -163
- package/lib-amd/components/Checkbox/useCheckboxStyles.js.map +0 -1
- package/lib-amd/components/CheckboxField/CheckboxField.js +0 -12
- package/lib-amd/components/CheckboxField/CheckboxField.js.map +0 -1
- package/lib-amd/components/CheckboxField/index.js +0 -6
- package/lib-amd/components/CheckboxField/index.js.map +0 -1
- package/lib-amd/index.js +0 -13
- package/lib-amd/index.js.map +0 -1
package/.swcrc
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"/testing",
|
|
5
|
+
"/**/*.cy.ts",
|
|
6
|
+
"/**/*.cy.tsx",
|
|
7
|
+
"/**/*.spec.ts",
|
|
8
|
+
"/**/*.spec.tsx",
|
|
9
|
+
"/**/*.test.ts",
|
|
10
|
+
"/**/*.test.tsx"
|
|
11
|
+
],
|
|
12
|
+
"jsc": {
|
|
13
|
+
"parser": {
|
|
14
|
+
"syntax": "typescript",
|
|
15
|
+
"tsx": true,
|
|
16
|
+
"decorators": false,
|
|
17
|
+
"dynamicImport": false
|
|
18
|
+
},
|
|
19
|
+
"externalHelpers": true,
|
|
20
|
+
"transform": {
|
|
21
|
+
"react": {
|
|
22
|
+
"runtime": "classic",
|
|
23
|
+
"useSpread": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
27
|
+
},
|
|
28
|
+
"minify": false,
|
|
29
|
+
"sourceMaps": true
|
|
30
|
+
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,109 @@
|
|
|
2
2
|
"name": "@fluentui/react-checkbox",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 21 Mar 2023 21:18:40 GMT",
|
|
6
|
+
"tag": "@fluentui/react-checkbox_v9.1.5",
|
|
7
|
+
"version": "9.1.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-checkbox",
|
|
13
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
14
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "tristan.watanabe@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-checkbox",
|
|
19
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
20
|
+
"comment": "fix: add node field to package.json exports map."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "makotom@microsoft.com",
|
|
24
|
+
"package": "@fluentui/react-checkbox",
|
|
25
|
+
"commit": "7fde5c94869ff9841b142b7ff1d0a3df0ab58f74",
|
|
26
|
+
"comment": "chore: Bumping version of @fluentui/react-icons to ^2.0.196."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-checkbox",
|
|
31
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.27",
|
|
32
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-checkbox",
|
|
37
|
+
"comment": "Bump @fluentui/react-label to v9.1.5",
|
|
38
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-checkbox",
|
|
43
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
|
|
44
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-checkbox",
|
|
49
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
|
50
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-checkbox",
|
|
55
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
56
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-checkbox",
|
|
61
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
62
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-checkbox",
|
|
67
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
68
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"date": "Thu, 16 Mar 2023 14:36:59 GMT",
|
|
75
|
+
"tag": "@fluentui/react-checkbox_v9.1.4",
|
|
76
|
+
"version": "9.1.4",
|
|
77
|
+
"comments": {
|
|
78
|
+
"patch": [
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-checkbox",
|
|
82
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.26",
|
|
83
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-checkbox",
|
|
88
|
+
"comment": "Bump @fluentui/react-label to v9.1.4",
|
|
89
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-checkbox",
|
|
94
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.0",
|
|
95
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-checkbox",
|
|
100
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.1",
|
|
101
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"date": "Wed, 15 Mar 2023 10:19:53 GMT",
|
|
6
108
|
"tag": "@fluentui/react-checkbox_v9.1.3",
|
|
7
109
|
"version": "9.1.3",
|
|
8
110
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-checkbox
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 21 Mar 2023 21:18:40 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.1.5)
|
|
8
|
+
|
|
9
|
+
Tue, 21 Mar 2023 21:18:40 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.1.4..@fluentui/react-checkbox_v9.1.5)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
15
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
16
|
+
- chore: Bumping version of @fluentui/react-icons to ^2.0.196. ([PR #27100](https://github.com/microsoft/fluentui/pull/27100) by makotom@microsoft.com)
|
|
17
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.27 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
18
|
+
- Bump @fluentui/react-label to v9.1.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
19
|
+
- Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
21
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
23
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
24
|
+
|
|
25
|
+
## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.1.4)
|
|
26
|
+
|
|
27
|
+
Thu, 16 Mar 2023 14:36:59 GMT
|
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.1.3..@fluentui/react-checkbox_v9.1.4)
|
|
29
|
+
|
|
30
|
+
### Patches
|
|
31
|
+
|
|
32
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.26 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
33
|
+
- Bump @fluentui/react-label to v9.1.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
34
|
+
- Bump @fluentui/react-tabster to v9.6.0 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
35
|
+
- Bump @fluentui/react-utilities to v9.7.1 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
36
|
+
|
|
7
37
|
## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-checkbox_v9.1.3)
|
|
8
38
|
|
|
9
|
-
Wed, 15 Mar 2023 10:
|
|
39
|
+
Wed, 15 Mar 2023 10:19:53 GMT
|
|
10
40
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-checkbox_v9.1.2..@fluentui/react-checkbox_v9.1.3)
|
|
11
41
|
|
|
12
42
|
### Patches
|
package/lib/Checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/Checkbox.ts"],"sourcesContent":["export * from './components/Checkbox/index';\n"],"mappings":"AAAA,cAAc"}
|
package/lib/CheckboxField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/CheckboxField.ts"],"sourcesContent":["export * from './components/CheckboxField/index';\n"],"mappings":"AAAA,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCheckbox_unstable","renderCheckbox_unstable","useCheckboxStyles_unstable","useCustomStyleHooks_unstable","Checkbox","forwardRef","props","ref","state","useAccordionHeaderStyles_unstable","useCustomStyles","displayName"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","useCheckbox_unstable","renderCheckbox_unstable","useCheckboxStyles_unstable","useCustomStyleHooks_unstable","Checkbox","forwardRef","props","ref","state","useAccordionHeaderStyles_unstable","useCustomStyles","displayName"],"sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCheckbox_unstable } from './useCheckbox';\nimport { renderCheckbox_unstable } from './renderCheckbox';\nimport { useCheckboxStyles_unstable } from './useCheckboxStyles';\nimport type { CheckboxProps } from './Checkbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Checkboxes give people a way to select one or more items from a group,\n * or switch between two mutually exclusive options (checked or unchecked).\n */\nexport const Checkbox: ForwardRefComponent<CheckboxProps> = React.forwardRef((props, ref) => {\n const state = useCheckbox_unstable(props, ref);\n\n useCheckboxStyles_unstable(state);\n\n const { useAccordionHeaderStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderCheckbox_unstable(state);\n});\n\nCheckbox.displayName = 'Checkbox';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,4BAA4B,QAAQ;AAE7C;;;;AAIA,OAAO,MAAMC,QAAA,gBAA+CL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3F,MAAMC,KAAA,GAAQR,oBAAA,CAAqBM,KAAA,EAAOC,GAAA;EAE1CL,0BAAA,CAA2BM,KAAA;EAE3B,MAAM;IAAEC,iCAAA,EAAmCC;EAAe,CAAE,GAAGP,4BAAA;EAC/DO,eAAA,CAAgBF,KAAA;EAEhB,OAAOP,uBAAA,CAAwBO,KAAA;AACjC;AAEAJ,QAAA,CAASO,WAAW,GAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
//# sourceMappingURL=Checkbox.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React"],"sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type CheckboxSlots = {\n /**\n * The root element of the Checkbox.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Checkbox>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Checkbox's label.\n */\n label?: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the checkbox's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Checkbox>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * The checkbox, with the checkmark icon as its child when checked.\n */\n indicator: Slot<'div'>;\n};\n\n/**\n * Checkbox Props\n */\nexport type CheckboxProps = Omit<\n ComponentProps<Partial<CheckboxSlots>, 'input'>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> & {\n /**\n * The controlled value for the checkbox.\n *\n * @default false\n */\n checked?: 'mixed' | boolean;\n\n /**\n * Checkboxes don't support children. To add a label, use the `label` prop.\n */\n children?: never;\n\n /**\n * Whether the checkbox should be rendered as checked by default.\n */\n defaultChecked?: 'mixed' | boolean;\n\n /**\n * The position of the label relative to the checkbox indicator.\n *\n * @default after\n */\n labelPosition?: 'before' | 'after';\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: CheckboxOnChangeData) => void;\n\n /**\n * The shape of the checkbox indicator.\n *\n * The `circular` variant is only recommended to be used in a tasks-style UI (checklist),\n * since it otherwise could be confused for a `RadioItem`.\n *\n * @default square\n */\n shape?: 'square' | 'circular';\n\n /**\n * The size of the checkbox indicator.\n *\n * @default medium\n */\n size?: 'medium' | 'large';\n};\n\n/**\n * Data for the onChange event for checkbox.\n */\nexport interface CheckboxOnChangeData {\n checked: 'mixed' | boolean;\n}\n\n/**\n * State used in rendering Checkbox\n */\nexport type CheckboxState = ComponentState<CheckboxSlots> &\n Required<Pick<CheckboxProps, 'checked' | 'disabled' | 'labelPosition' | 'shape' | 'size'>>;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/Checkbox/index.ts"],"sourcesContent":["export * from './Checkbox';\nexport * from './Checkbox.types';\nexport * from './renderCheckbox';\nexport * from './useCheckbox';\nexport * from './useCheckboxStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
|
@@ -5,16 +5,6 @@ export const renderCheckbox_unstable = state => {
|
|
|
5
5
|
slots,
|
|
6
6
|
slotProps
|
|
7
7
|
} = getSlots(state);
|
|
8
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
|
9
|
-
...slotProps.root
|
|
10
|
-
}, /*#__PURE__*/React.createElement(slots.input, {
|
|
11
|
-
...slotProps.input
|
|
12
|
-
}), state.labelPosition === 'before' && slots.label && /*#__PURE__*/React.createElement(slots.label, {
|
|
13
|
-
...slotProps.label
|
|
14
|
-
}), /*#__PURE__*/React.createElement(slots.indicator, {
|
|
15
|
-
...slotProps.indicator
|
|
16
|
-
}), state.labelPosition === 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, {
|
|
17
|
-
...slotProps.label
|
|
18
|
-
}));
|
|
8
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), state.labelPosition === 'before' && slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label), /*#__PURE__*/React.createElement(slots.indicator, slotProps.indicator), state.labelPosition === 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label));
|
|
19
9
|
};
|
|
20
10
|
//# sourceMappingURL=renderCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderCheckbox_unstable","state","slots","slotProps","createElement","root","input","labelPosition","label","indicator"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getSlots","renderCheckbox_unstable","state","slots","slotProps","createElement","root","input","labelPosition","label","indicator"],"sources":["../../../src/components/Checkbox/renderCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { CheckboxState, CheckboxSlots } from './Checkbox.types';\n\nexport const renderCheckbox_unstable = (state: CheckboxState) => {\n const { slots, slotProps } = getSlots<CheckboxSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n {state.labelPosition === 'before' && slots.label && <slots.label {...slotProps.label} />}\n <slots.indicator {...slotProps.indicator} />\n {state.labelPosition === 'after' && slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB,OAAO,MAAMC,uBAAA,GAA2BC,KAAA,IAAyB;EAC/D,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAwBE,KAAA;EAErD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,KAAK,EAAKH,SAAA,CAAUG,KAAK,GAC/BL,KAAA,CAAMM,aAAa,KAAK,YAAYL,KAAA,CAAMM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK,gBACpFV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMO,SAAS,EAAKN,SAAA,CAAUM,SAAS,GACvCR,KAAA,CAAMM,aAAa,KAAK,WAAWL,KAAA,CAAMM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK;AAGzF"}
|
|
@@ -78,10 +78,9 @@ export const useCheckbox_unstable = (props, ref) => {
|
|
|
78
78
|
htmlFor: id,
|
|
79
79
|
disabled,
|
|
80
80
|
required,
|
|
81
|
-
size: 'medium'
|
|
81
|
+
size: 'medium'
|
|
82
82
|
}
|
|
83
83
|
}),
|
|
84
|
-
|
|
85
84
|
indicator: resolveShorthand(props.indicator, {
|
|
86
85
|
required: true,
|
|
87
86
|
defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useId","useIsomorphicLayoutEffect","useMergedRefs","Checkmark12Filled","Checkmark16Filled","Square12Filled","Square16Filled","CircleFilled","Label","useFocusWithin","useCheckbox_unstable","props","ref","disabled","required","shape","size","labelPosition","onChange","checked","setChecked","defaultState","defaultChecked","state","initialState","nativeProps","primarySlotTagName","excludedPropNames","mixed","id","primary","checkmarkIcon","createElement","components","root","input","indicator","label","defaultProps","type","htmlFor","children","ev","val","currentTarget","indeterminate","inputRef","current"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getPartitionedNativeProps","resolveShorthand","useControllableState","useEventCallback","useId","useIsomorphicLayoutEffect","useMergedRefs","Checkmark12Filled","Checkmark16Filled","Square12Filled","Square16Filled","CircleFilled","Label","useFocusWithin","useCheckbox_unstable","props","ref","disabled","required","shape","size","labelPosition","onChange","checked","setChecked","defaultState","defaultChecked","state","initialState","nativeProps","primarySlotTagName","excludedPropNames","mixed","id","primary","checkmarkIcon","createElement","components","root","input","indicator","label","defaultProps","type","htmlFor","children","ev","val","currentTarget","indeterminate","inputRef","current"],"sources":["../../../src/components/Checkbox/useCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n resolveShorthand,\n useControllableState,\n useEventCallback,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { CheckboxProps, CheckboxState } from './Checkbox.types';\nimport {\n Checkmark12Filled,\n Checkmark16Filled,\n Square12Filled,\n Square16Filled,\n CircleFilled,\n} from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Checkbox.\n *\n * The returned state can be modified with hooks such as useCheckboxStyles_unstable,\n * before being passed to renderCheckbox_unstable.\n *\n * @param props - props from this instance of Checkbox\n * @param ref - reference to `<input>` element of Checkbox\n */\nexport const useCheckbox_unstable = (props: CheckboxProps, ref: React.Ref<HTMLInputElement>): CheckboxState => {\n const { disabled = false, required, shape = 'square', size = 'medium', labelPosition = 'after', onChange } = props;\n\n const [checked, setChecked] = useControllableState({\n defaultState: props.defaultChecked,\n state: props.checked,\n initialState: false,\n });\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'size', 'onChange'],\n });\n\n const mixed = checked === 'mixed';\n const id = useId('checkbox-', nativeProps.primary.id);\n\n let checkmarkIcon;\n if (mixed) {\n if (shape === 'circular') {\n checkmarkIcon = <CircleFilled />;\n } else {\n checkmarkIcon = size === 'large' ? <Square16Filled /> : <Square12Filled />;\n }\n } else if (checked) {\n checkmarkIcon = size === 'large' ? <Checkmark16Filled /> : <Checkmark12Filled />;\n }\n\n const state: CheckboxState = {\n shape,\n checked,\n disabled,\n size,\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n indicator: 'div',\n label: Label,\n },\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n }),\n input: resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n type: 'checkbox',\n id,\n ref,\n checked: checked === true,\n ...nativeProps.primary,\n },\n }),\n label: resolveShorthand(props.label, {\n required: false,\n defaultProps: {\n htmlFor: id,\n disabled,\n required,\n size: 'medium', // Even if the checkbox itself is large\n },\n }),\n indicator: resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: checkmarkIcon,\n },\n }),\n };\n\n state.input.onChange = useEventCallback(ev => {\n const val = ev.currentTarget.indeterminate ? 'mixed' : ev.currentTarget.checked;\n onChange?.(ev, { checked: val });\n setChecked(val);\n });\n\n // Create a ref object for the input element so we can use it to set the indeterminate prop.\n // Use useMergedRefs, since the ref might be undefined or a function-ref (no .current)\n const inputRef = useMergedRefs(state.input.ref);\n state.input.ref = inputRef;\n\n // Set the <input> element's checked and indeterminate properties based on our tri-state property.\n // Since indeterminate can only be set via javascript, it has to be done in a layout effect.\n useIsomorphicLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = mixed;\n }\n }, [inputRef, mixed]);\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,EAChBC,KAAK,EACLC,yBAAyB,EACzBC,aAAa,QACR;AAEP,SACEC,iBAA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;EAEA;EACA;EACA,MAAMG,QAAA,GAAW5C,aAAA,CAAcqB,KAAA,CAAMY,KAAK,CAACvB,GAAG;EAC9CW,KAAA,CAAMY,KAAK,CAACvB,GAAG,GAAGkC,QAAA;EAElB;EACA;EACA7C,yBAAA,CAA0B,MAAM;IAC9B,IAAI6C,QAAA,CAASC,OAAO,EAAE;MACpBD,QAAA,CAASC,OAAO,CAACF,aAAa,GAAGjB,KAAA;IACnC;EACF,GAAG,CAACkB,QAAA,EAAUlB,KAAA,CAAM;EAEpB,OAAOL,KAAA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","createFocusOutlineStyle","tokens","checkboxClassNames","root","label","input","indicator","indicatorSizeMedium","indicatorSizeLarge","useRootBaseClassName","useRootStyles","unchecked","Bi91k9c","ns3gzv","n5iecx","Bq2lx2j","Bv7p3up","lj723h","B6u2zzw","Be5wueo","Cgwcxn","Btnvhkj","checked","sj55zd","Bvs3sgl","opw9sb","C5wppx","B32epof","Bphahg7","Jctw66","Bq0zqd5","Bgesukf","mixed","cc1l3s","km5s60","disabled","Bceei9c","Bbusuzp","B7bxudy","h","a","d","m","useInputBaseClassName","useInputStyles","before","j35jbq","after","oyh7mz","large","a9b677","useIndicatorBaseClassName","useIndicatorStyles","Be2twd7","Bqenvij","circular","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","medium","B6of3ja","jrapky","useCheckboxStyles_unstable","state","labelPosition","shape","size","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","labelStyles"],"sources":["../src/packages/react-components/react-checkbox/src/components/Checkbox/useCheckboxStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { CheckboxSlots, CheckboxState } from './Checkbox.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const checkboxClassNames: SlotClassNames<CheckboxSlots> = {\n root: 'fui-Checkbox',\n label: 'fui-Checkbox__label',\n input: 'fui-Checkbox__input',\n indicator: 'fui-Checkbox__indicator',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSizeMedium = '16px';\nconst indicatorSizeLarge = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n position: 'relative',\n display: 'inline-flex',\n cursor: 'pointer',\n color: tokens.colorNeutralForeground3,\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n unchecked: {\n ':hover': {\n color: tokens.colorNeutralForeground2,\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessibleHover),\n },\n },\n\n ':active': {\n color: tokens.colorNeutralForeground1,\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessiblePressed),\n },\n },\n },\n\n checked: {\n color: tokens.colorNeutralForeground1,\n\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackground),\n },\n\n ':hover': {\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundHover),\n },\n },\n\n ':active': {\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundPressed),\n },\n },\n },\n\n mixed: {\n color: tokens.colorNeutralForeground1,\n\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke),\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokeHover),\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':active': {\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokePressed),\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n disabled: {\n cursor: 'default',\n\n color: tokens.colorNeutralForegroundDisabled,\n\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n [`> .${checkboxClassNames.indicator}`]: {\n color: 'GrayText',\n },\n },\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n boxSizing: 'border-box',\n cursor: 'inherit',\n height: '100%',\n margin: 0,\n opacity: 0,\n position: 'absolute',\n top: 0,\n // Calculate the width of the hidden input by taking into account the size of the indicator + the padding around it.\n // This is done so that clicking on that \"empty space\" still toggles the checkbox.\n width: `calc(${indicatorSizeMedium} + 2 * ${tokens.spacingHorizontalS})`,\n});\n\nconst useInputStyles = makeStyles({\n before: {\n right: 0,\n },\n after: {\n left: 0,\n },\n\n large: {\n width: `calc(${indicatorSizeLarge} + 2 * ${tokens.spacingHorizontalS})`,\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n alignSelf: 'flex-start',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid ' + tokens.colorNeutralStrokeAccessible,\n borderRadius: tokens.borderRadiusSmall,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n\n fontSize: '12px',\n height: indicatorSizeMedium,\n width: indicatorSizeMedium,\n});\n\nconst useIndicatorStyles = makeStyles({\n large: {\n fontSize: '16px',\n height: indicatorSizeLarge,\n width: indicatorSizeLarge,\n },\n\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n color: 'inherit',\n cursor: 'inherit',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n },\n\n before: {\n paddingRight: tokens.spacingHorizontalXS,\n },\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\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 marginTop: `calc((${indicatorSizeMedium} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSizeMedium} - ${tokens.lineHeightBase300}) / 2)`,\n },\n large: {\n marginTop: `calc((${indicatorSizeLarge} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSizeLarge} - ${tokens.lineHeightBase300}) / 2)`,\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 { checked, disabled, labelPosition, shape, size } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n checkboxClassNames.root,\n rootBaseClassName,\n disabled\n ? rootStyles.disabled\n : checked === 'mixed'\n ? rootStyles.mixed\n : checked\n ? rootStyles.checked\n : rootStyles.unchecked,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n checkboxClassNames.input,\n inputBaseClassName,\n size === 'large' && inputStyles.large,\n inputStyles[labelPosition],\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n checkboxClassNames.indicator,\n indicatorBaseClassName,\n size === 'large' && indicatorStyles.large,\n 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 checkboxClassNames.label,\n labelStyles.base,\n labelStyles[size],\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,MAAM,QAAQ,uBAAuB;AAI9C,OAAO,MAAMC,kBAAkB,GAAkC;EAC/DC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,qBAAqB;EAC5BC,KAAK,EAAE,qBAAqB;EAC5BC,SAAS,EAAE;CACZ;AAED;AACA,MAAMC,mBAAmB,GAAG,MAAM;AAClC,MAAMC,kBAAkB,GAAG,MAAM;AAEjC,MAAMC,oBAAoB,gBAAGb,aAAA,k0EAM3B;AAEF,MAAMc,aAAa,gBAAGb,QAAA;EAAAc,SAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAjB,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAe,OAAA;IAAAb,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAW,KAAA;IAAAT,MAAA;IAAAG,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAJ,MAAA;IAAAZ,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAiB,MAAA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K,CAACnE,KAAK,EAAE;IACfmE,KAAK,CAACnE,KAAK,CAACyE,SAAS,GAAG/E,YAAY,CAClCI,kBAAkB,CAACE,KAAK,EACxB8E,WAAW,CAACrB,IAAI,EAChBqB,WAAW,CAACR,IAAI,CAAC,EACjBQ,WAAW,CAACV,aAAa,CAAC,EAC1BD,KAAK,CAACnE,KAAK,CAACyE,SAAS,CACtB;;EAGH,OAAON,KAAK;AACd,CAAC"}
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","createFocusOutlineStyle","tokens","checkboxClassNames","root","label","input","indicator","indicatorSizeMedium","indicatorSizeLarge","useRootBaseClassName","useRootStyles","unchecked","Bi91k9c","ns3gzv","n5iecx","Bq2lx2j","Bv7p3up","lj723h","B6u2zzw","Be5wueo","Cgwcxn","Btnvhkj","checked","sj55zd","Bvs3sgl","opw9sb","C5wppx","B32epof","Bphahg7","Jctw66","Bq0zqd5","Bgesukf","mixed","cc1l3s","km5s60","disabled","Bceei9c","Bbusuzp","B7bxudy","h","a","d","m","useInputBaseClassName","useInputStyles","before","j35jbq","after","oyh7mz","large","a9b677","useIndicatorBaseClassName","useIndicatorStyles","Be2twd7","Bqenvij","circular","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","medium","B6of3ja","jrapky","useCheckboxStyles_unstable","state","labelPosition","shape","size","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","labelStyles"],"sources":["../../../src/components/Checkbox/useCheckboxStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { CheckboxSlots, CheckboxState } from './Checkbox.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const checkboxClassNames: SlotClassNames<CheckboxSlots> = {\n root: 'fui-Checkbox',\n label: 'fui-Checkbox__label',\n input: 'fui-Checkbox__input',\n indicator: 'fui-Checkbox__indicator',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSizeMedium = '16px';\nconst indicatorSizeLarge = '20px';\n\nconst useRootBaseClassName = makeResetStyles({\n position: 'relative',\n display: 'inline-flex',\n cursor: 'pointer',\n color: tokens.colorNeutralForeground3,\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n unchecked: {\n ':hover': {\n color: tokens.colorNeutralForeground2,\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessibleHover),\n },\n },\n\n ':active': {\n color: tokens.colorNeutralForeground1,\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessiblePressed),\n },\n },\n },\n\n checked: {\n color: tokens.colorNeutralForeground1,\n\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackground,\n color: tokens.colorNeutralForegroundInverted,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackground),\n },\n\n ':hover': {\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundHover,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundHover),\n },\n },\n\n ':active': {\n [`> .${checkboxClassNames.indicator}`]: {\n backgroundColor: tokens.colorCompoundBrandBackgroundPressed,\n ...shorthands.borderColor(tokens.colorCompoundBrandBackgroundPressed),\n },\n },\n },\n\n mixed: {\n color: tokens.colorNeutralForeground1,\n\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStroke),\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokeHover),\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':active': {\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokePressed),\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n disabled: {\n cursor: 'default',\n\n color: tokens.colorNeutralForegroundDisabled,\n\n [`> .${checkboxClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n [`> .${checkboxClassNames.indicator}`]: {\n color: 'GrayText',\n },\n },\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n boxSizing: 'border-box',\n cursor: 'inherit',\n height: '100%',\n margin: 0,\n opacity: 0,\n position: 'absolute',\n top: 0,\n // Calculate the width of the hidden input by taking into account the size of the indicator + the padding around it.\n // This is done so that clicking on that \"empty space\" still toggles the checkbox.\n width: `calc(${indicatorSizeMedium} + 2 * ${tokens.spacingHorizontalS})`,\n});\n\nconst useInputStyles = makeStyles({\n before: {\n right: 0,\n },\n after: {\n left: 0,\n },\n\n large: {\n width: `calc(${indicatorSizeLarge} + 2 * ${tokens.spacingHorizontalS})`,\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n alignSelf: 'flex-start',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid ' + tokens.colorNeutralStrokeAccessible,\n borderRadius: tokens.borderRadiusSmall,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n\n fontSize: '12px',\n height: indicatorSizeMedium,\n width: indicatorSizeMedium,\n});\n\nconst useIndicatorStyles = makeStyles({\n large: {\n fontSize: '16px',\n height: indicatorSizeLarge,\n width: indicatorSizeLarge,\n },\n\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n color: 'inherit',\n cursor: 'inherit',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n },\n\n before: {\n paddingRight: tokens.spacingHorizontalXS,\n },\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\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 marginTop: `calc((${indicatorSizeMedium} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSizeMedium} - ${tokens.lineHeightBase300}) / 2)`,\n },\n large: {\n marginTop: `calc((${indicatorSizeLarge} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSizeLarge} - ${tokens.lineHeightBase300}) / 2)`,\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 { checked, disabled, labelPosition, shape, size } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n checkboxClassNames.root,\n rootBaseClassName,\n disabled\n ? rootStyles.disabled\n : checked === 'mixed'\n ? rootStyles.mixed\n : checked\n ? rootStyles.checked\n : rootStyles.unchecked,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n checkboxClassNames.input,\n inputBaseClassName,\n size === 'large' && inputStyles.large,\n inputStyles[labelPosition],\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n checkboxClassNames.indicator,\n indicatorBaseClassName,\n size === 'large' && indicatorStyles.large,\n 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 checkboxClassNames.label,\n labelStyles.base,\n labelStyles[size],\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ;AACtE,SAASC,uBAAuB,QAAQ;AACxC,SAASC,MAAM,QAAQ;AAIvB,OAAO,MAAMC,kBAAA,GAAoD;EAC/DC,IAAA,EAAM;EACNC,KAAA,EAAO;EACPC,KAAA,EAAO;EACPC,SAAA,EAAW;AACb;AAEA;AACA,MAAMC,mBAAA,GAAsB;AAC5B,MAAMC,kBAAA,GAAqB;AAE3B,MAAMC,oBAAA,gBAAuBb,aAAA,k0EAM7B;AAEA,MAAMc,aAAA,gBAAgBb,QAAA;EAAAc,SAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAjB,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAe,OAAA;IAAAb,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAW,KAAA;IAAAT,MAAA;IAAAG,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAJ,MAAA;IAAAZ,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAiB,MAAA;IAAAf,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAa,MAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;IAAAb,MAAA;IAAAG,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAJ,MA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B;EAEA,OAAON,KAAA;AACT"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/* eslint-disable deprecation/deprecation */
|
|
2
|
-
import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
|
|
1
|
+
/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
|
|
3
2
|
import { Checkbox, checkboxClassNames } from '../../Checkbox';
|
|
4
3
|
/** @deprecated Use Field with a Checkbox inside: `<Field><Checkbox /></Field>` */
|
|
5
4
|
export const checkboxFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(checkboxClassNames.root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","Checkbox","checkboxClassNames","checkboxFieldClassNames","root","CheckboxField","mapProps","props","label","fieldLabel","required","undefined","control"],"sources":["
|
|
1
|
+
{"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","Checkbox","checkboxClassNames","checkboxFieldClassNames","root","CheckboxField","mapProps","props","label","fieldLabel","required","undefined","control"],"sources":["../../../src/components/CheckboxField/CheckboxField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport {\n DeprecatedFieldProps,\n FieldProps,\n getDeprecatedFieldClassNames,\n makeDeprecatedField,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Checkbox, checkboxClassNames, CheckboxProps } from '../../Checkbox';\n\n/** @deprecated Use Field with a Checkbox inside: `<Field><Checkbox /></Field>` */\nexport type CheckboxFieldProps = Omit<DeprecatedFieldProps<CheckboxProps>, 'label'> & {\n label?: CheckboxProps['label'];\n fieldLabel?: FieldProps['label'];\n};\n\n/** @deprecated Use Field with a Checkbox inside: `<Field><Checkbox /></Field>` */\nexport const checkboxFieldClassNames = getDeprecatedFieldClassNames(checkboxClassNames.root);\n\n/** @deprecated Use Field with a Checkbox inside: `<Field><Checkbox /></Field>` */\nexport const CheckboxField: ForwardRefComponent<CheckboxFieldProps> = makeDeprecatedField(Checkbox, {\n mapProps: (props: CheckboxFieldProps) => ({\n ...props,\n label: props.fieldLabel,\n required: undefined,\n control: { ...props.control, required: props.required, label: props.label },\n }),\n});\n"],"mappings":"AAAA,4CACA,SAGEA,4BAA4B,EAC5BC,mBAAmB,QACd;AAEP,SAASC,QAAQ,EAAEC,kBAAkB,QAAuB;AAQ5D;AACA,OAAO,MAAMC,uBAAA,gBAA0BJ,4BAAA,CAA6BG,kBAAA,CAAmBE,IAAI;AAE3F;AACA,OAAO,MAAMC,aAAA,gBAAyDL,mBAAA,CAAoBC,QAAA,EAAU;EAClGK,QAAA,EAAWC,KAAA,KAA+B;IACxC,GAAGA,KAAK;IACRC,KAAA,EAAOD,KAAA,CAAME,UAAU;IACvBC,QAAA,EAAUC,SAAA;IACVC,OAAA,EAAS;MAAE,GAAGL,KAAA,CAAMK,OAAO;MAAEF,QAAA,EAAUH,KAAA,CAAMG,QAAQ;MAAEF,KAAA,EAAOD,KAAA,CAAMC;IAAM;EAC5E;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/CheckboxField/index.ts"],"sourcesContent":["export * from './CheckboxField';\n"],"mappings":"AAAA,cAAc"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Checkbox","checkboxClassNames","renderCheckbox_unstable","useCheckboxStyles_unstable","useCheckbox_unstable","CheckboxField","CheckboxField_unstable","checkboxFieldClassNames"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["Checkbox","checkboxClassNames","renderCheckbox_unstable","useCheckboxStyles_unstable","useCheckbox_unstable","CheckboxField","CheckboxField_unstable","checkboxFieldClassNames"],"sources":["../src/index.ts"],"sourcesContent":["export {\n Checkbox,\n checkboxClassNames,\n renderCheckbox_unstable,\n useCheckboxStyles_unstable,\n useCheckbox_unstable,\n} from './Checkbox';\nexport type { CheckboxOnChangeData, CheckboxProps, CheckboxSlots, CheckboxState } from './Checkbox';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { CheckboxField as CheckboxField_unstable, checkboxFieldClassNames } from './CheckboxField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { CheckboxFieldProps as CheckboxFieldProps_unstable } from './CheckboxField';\n"],"mappings":"AAAA,SACEA,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,oBAAoB,QACf;AAGP;AACA,SAASC,aAAA,IAAiBC,sBAAsB,EAAEC,uBAAuB,QAAQ"}
|
package/lib-commonjs/Checkbox.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/Checkbox/index"), exports);
|
|
7
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/Checkbox.js"],"sourcesContent":["export * from './components/Checkbox/index';\n//# sourceMappingURL=Checkbox.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,oCAAoC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/CheckboxField/index"), exports);
|
|
7
|
+
//# sourceMappingURL=CheckboxField.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=CheckboxField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/CheckboxField.js"],"sourcesContent":["export * from './components/CheckboxField/index';\n//# sourceMappingURL=CheckboxField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,yCAAyC"}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Checkbox
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
useCheckboxStyles_1.useCheckboxStyles_unstable(state);
|
|
19
|
-
const {
|
|
20
|
-
useAccordionHeaderStyles_unstable: useCustomStyles
|
|
21
|
-
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
|
22
|
-
useCustomStyles(state);
|
|
23
|
-
return renderCheckbox_1.renderCheckbox_unstable(state);
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useCheckbox = require("./useCheckbox");
|
|
12
|
+
const _renderCheckbox = require("./renderCheckbox");
|
|
13
|
+
const _useCheckboxStyles = require("./useCheckboxStyles");
|
|
14
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const Checkbox = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
|
+
const state = (0, _useCheckbox.useCheckbox_unstable)(props, ref);
|
|
17
|
+
(0, _useCheckboxStyles.useCheckboxStyles_unstable)(state);
|
|
18
|
+
const { useAccordionHeaderStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
|
|
19
|
+
useCustomStyles(state);
|
|
20
|
+
return (0, _renderCheckbox.renderCheckbox_unstable)(state);
|
|
24
21
|
});
|
|
25
|
-
|
|
22
|
+
Checkbox.displayName = 'Checkbox'; //# sourceMappingURL=Checkbox.js.map
|
|
23
|
+
|
|
26
24
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Checkbox/Checkbox.js"],"sourcesContent":["import * as React from 'react';\nimport { useCheckbox_unstable } from './useCheckbox';\nimport { renderCheckbox_unstable } from './renderCheckbox';\nimport { useCheckboxStyles_unstable } from './useCheckboxStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Checkboxes give people a way to select one or more items from a group,\n * or switch between two mutually exclusive options (checked or unchecked).\n */\nexport const Checkbox = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useCheckbox_unstable(props, ref);\n useCheckboxStyles_unstable(state);\n const {\n useAccordionHeaderStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderCheckbox_unstable(state);\n});\nCheckbox.displayName = 'Checkbox';\n//# sourceMappingURL=Checkbox.js.map"],"names":["Checkbox","React","forwardRef","props","ref","state","useCheckbox_unstable","useCheckboxStyles_unstable","useAccordionHeaderStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderCheckbox_unstable","displayName"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;6BACc;gCACG;mCACG;qCACE;AAKtC,MAAMA,WAAW,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACpE,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1CG,IAAAA,6CAA0B,EAACF;IAC3B,MAAM,EACJG,mCAAmCC,gBAAe,EACnD,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBJ;IAChB,OAAOM,IAAAA,uCAAuB,EAACN;AACjC;AACAL,SAASY,WAAW,GAAG,YACvB,oCAAoC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
7
|
+
//# sourceMappingURL=Checkbox.types.js.map
|
|
8
|
+
|
|
6
9
|
//# sourceMappingURL=Checkbox.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Checkbox/Checkbox.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Checkbox.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,0CAA0C"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./Checkbox"), exports);
|
|
7
|
+
_exportStar(require("./Checkbox.types"), exports);
|
|
8
|
+
_exportStar(require("./renderCheckbox"), exports);
|
|
9
|
+
_exportStar(require("./useCheckbox"), exports);
|
|
10
|
+
_exportStar(require("./useCheckboxStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
|
|
12
13
|
//# sourceMappingURL=index.js.map
|