@fluentui/react-switch 9.0.14 → 9.0.16
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 +101 -1
- package/CHANGELOG.md +28 -2
- package/lib/components/Switch/Switch.js +0 -1
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Switch/renderSwitch.js +10 -6
- package/lib/components/Switch/renderSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitch.js +0 -1
- package/lib/components/Switch/useSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitchStyles.js +180 -189
- package/lib/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib/components/SwitchField/SwitchField.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Switch.js +0 -2
- package/lib-commonjs/Switch.js.map +1 -1
- package/lib-commonjs/SwitchField.js +0 -2
- package/lib-commonjs/SwitchField.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.js +0 -6
- package/lib-commonjs/components/Switch/Switch.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.types.js.map +1 -1
- package/lib-commonjs/components/Switch/index.js +0 -6
- package/lib-commonjs/components/Switch/index.js.map +1 -1
- package/lib-commonjs/components/Switch/renderSwitch.js +10 -10
- package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitch.js +0 -8
- package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchStyles.js +180 -194
- package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/components/SwitchField/SwitchField.js +0 -4
- package/lib-commonjs/components/SwitchField/SwitchField.js.map +1 -1
- package/lib-commonjs/components/SwitchField/index.js +0 -2
- package/lib-commonjs/components/SwitchField/index.js.map +1 -1
- package/lib-commonjs/index.js +2 -6
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,107 @@
|
|
2
2
|
"name": "@fluentui/react-switch",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Wed, 04 Jan 2023 01:35:51 GMT",
|
6
|
+
"tag": "@fluentui/react-switch_v9.0.16",
|
7
|
+
"version": "9.0.16",
|
8
|
+
"comments": {
|
9
|
+
"none": [
|
10
|
+
{
|
11
|
+
"author": "martinhochel@microsoft.com",
|
12
|
+
"package": "@fluentui/react-switch",
|
13
|
+
"commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
|
14
|
+
"comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "martinhochel@microsoft.com",
|
18
|
+
"package": "@fluentui/react-switch",
|
19
|
+
"commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
|
20
|
+
"comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"patch": [
|
24
|
+
{
|
25
|
+
"author": "olfedias@microsoft.com",
|
26
|
+
"package": "@fluentui/react-switch",
|
27
|
+
"commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
|
28
|
+
"comment": "chore: Update Griffel to latest version"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"author": "beachball",
|
32
|
+
"package": "@fluentui/react-switch",
|
33
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.13",
|
34
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"author": "beachball",
|
38
|
+
"package": "@fluentui/react-switch",
|
39
|
+
"comment": "Bump @fluentui/react-label to v9.0.15",
|
40
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"author": "beachball",
|
44
|
+
"package": "@fluentui/react-switch",
|
45
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.5",
|
46
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"author": "beachball",
|
50
|
+
"package": "@fluentui/react-switch",
|
51
|
+
"comment": "Bump @fluentui/react-utilities to v9.3.1",
|
52
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"author": "beachball",
|
56
|
+
"package": "@fluentui/react-switch",
|
57
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
|
58
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"date": "Wed, 21 Dec 2022 10:20:32 GMT",
|
65
|
+
"tag": "@fluentui/react-switch_v9.0.15",
|
66
|
+
"version": "9.0.15",
|
67
|
+
"comments": {
|
68
|
+
"none": [
|
69
|
+
{
|
70
|
+
"author": "behowell@microsoft.com",
|
71
|
+
"package": "@fluentui/react-switch",
|
72
|
+
"commit": "68505ab8eb1b05f45ab09c21b9d66c177d1e50f5",
|
73
|
+
"comment": "chore: Add bundle size tests for Fields"
|
74
|
+
}
|
75
|
+
],
|
76
|
+
"patch": [
|
77
|
+
{
|
78
|
+
"author": "beachball",
|
79
|
+
"package": "@fluentui/react-switch",
|
80
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.12",
|
81
|
+
"commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"author": "beachball",
|
85
|
+
"package": "@fluentui/react-switch",
|
86
|
+
"comment": "Bump @fluentui/react-label to v9.0.14",
|
87
|
+
"commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"author": "beachball",
|
91
|
+
"package": "@fluentui/react-switch",
|
92
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.4",
|
93
|
+
"commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"author": "beachball",
|
97
|
+
"package": "@fluentui/react-switch",
|
98
|
+
"comment": "Bump @fluentui/react-theme to v9.1.5",
|
99
|
+
"commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
|
100
|
+
}
|
101
|
+
]
|
102
|
+
}
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"date": "Tue, 20 Dec 2022 14:59:34 GMT",
|
6
106
|
"tag": "@fluentui/react-switch_v9.0.14",
|
7
107
|
"version": "9.0.14",
|
8
108
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,38 @@
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 04 Jan 2023 01:35:51 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.0.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.16)
|
8
|
+
|
9
|
+
Wed, 04 Jan 2023 01:35:51 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.15..@fluentui/react-switch_v9.0.16)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
|
15
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.13 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
16
|
+
- Bump @fluentui/react-label to v9.0.15 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
17
|
+
- Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
20
|
+
|
21
|
+
## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.15)
|
22
|
+
|
23
|
+
Wed, 21 Dec 2022 10:20:32 GMT
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.14..@fluentui/react-switch_v9.0.15)
|
25
|
+
|
26
|
+
### Patches
|
27
|
+
|
28
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.12 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
|
29
|
+
- Bump @fluentui/react-label to v9.0.14 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
|
30
|
+
- Bump @fluentui/react-tabster to v9.3.4 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
|
31
|
+
- Bump @fluentui/react-theme to v9.1.5 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
|
32
|
+
|
7
33
|
## [9.0.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.14)
|
8
34
|
|
9
|
-
Tue, 20 Dec 2022 14:
|
35
|
+
Tue, 20 Dec 2022 14:59:34 GMT
|
10
36
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.13..@fluentui/react-switch_v9.0.14)
|
11
37
|
|
12
38
|
### Patches
|
@@ -5,7 +5,6 @@ import { useSwitchStyles_unstable } from './useSwitchStyles';
|
|
5
5
|
/**
|
6
6
|
* Switches enable users to trigger an option on or off through pressing the component.
|
7
7
|
*/
|
8
|
-
|
9
8
|
export const Switch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
9
|
const state = useSwitch_unstable(props, ref);
|
11
10
|
useSwitchStyles_unstable(state);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,wBAAwB,QAAQ,mBAAmB;AAI5D;;;AAGA,OAAO,MAAMC,MAAM,gBAAqCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACtF,MAAMC,KAAK,GAAGP,kBAAkB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAE5CJ,wBAAwB,CAACK,KAAK,CAAC;EAE/B,OAAON,qBAAqB,CAACM,KAAK,CAAC;AACrC,CAAC,CAAC;AAEFJ,MAAM,CAACK,WAAW,GAAG,QAAQ","names":["React","useSwitch_unstable","renderSwitch_unstable","useSwitchStyles_unstable","Switch","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-switch/src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSwitch_unstable } from './useSwitch';\nimport { renderSwitch_unstable } from './renderSwitch';\nimport { useSwitchStyles_unstable } from './useSwitchStyles';\nimport type { SwitchProps } from './Switch.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Switches enable users to trigger an option on or off through pressing the component.\n */\nexport const Switch: ForwardRefComponent<SwitchProps> = React.forwardRef((props, ref) => {\n const state = useSwitch_unstable(props, ref);\n\n useSwitchStyles_unstable(state);\n\n return renderSwitch_unstable(state);\n});\n\nSwitch.displayName = 'Switch';\n"]}
|
@@ -3,7 +3,6 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Render a Switch component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
|
-
|
7
6
|
export const renderSwitch_unstable = state => {
|
8
7
|
const {
|
9
8
|
slots,
|
@@ -12,11 +11,16 @@ export const renderSwitch_unstable = state => {
|
|
12
11
|
const {
|
13
12
|
labelPosition
|
14
13
|
} = state;
|
15
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
}), labelPosition
|
14
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
15
|
+
...slotProps.root
|
16
|
+
}, /*#__PURE__*/React.createElement(slots.input, {
|
17
|
+
...slotProps.input
|
18
|
+
}), labelPosition !== 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, {
|
19
|
+
...slotProps.label
|
20
|
+
}), /*#__PURE__*/React.createElement(slots.indicator, {
|
21
|
+
...slotProps.indicator
|
22
|
+
}), labelPosition === 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, {
|
23
|
+
...slotProps.label
|
20
24
|
}));
|
21
25
|
};
|
22
26
|
//# sourceMappingURL=renderSwitch.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,qBAAqB,GAAIC,KAAkB,IAAI;EAC1D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAcE,KAAK,CAAC;EACzD,MAAM;IAAEG;EAAa,CAAE,GAAGH,KAAK;EAE/B,oBACEH,oBAACI,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,gBAC5BP,oBAACI,KAAK,CAACI,KAAK;IAAA,GAAKH,SAAS,CAACG;EAAK,EAAI,EACnCF,aAAa,KAAK,OAAO,IAAIF,KAAK,CAACK,KAAK,iBAAIT,oBAACI,KAAK,CAACK,KAAK;IAAA,GAAKJ,SAAS,CAACI;EAAK,EAAI,eACjFT,oBAACI,KAAK,CAACM,SAAS;IAAA,GAAKL,SAAS,CAACK;EAAS,EAAI,EAC3CJ,aAAa,KAAK,OAAO,IAAIF,KAAK,CAACK,KAAK,iBAAIT,oBAACI,KAAK,CAACK,KAAK;IAAA,GAAKJ,SAAS,CAACI;EAAK,EAAI,CACtE;AAEjB,CAAC","names":["React","getSlots","renderSwitch_unstable","state","slots","slotProps","labelPosition","root","input","label","indicator"],"sourceRoot":"../src/","sources":["packages/react-components/react-switch/src/components/Switch/renderSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\n\n/**\n * Render a Switch component by passing the state defined props to the appropriate slots.\n */\nexport const renderSwitch_unstable = (state: SwitchState) => {\n const { slots, slotProps } = getSlots<SwitchSlots>(state);\n const { labelPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n {labelPosition !== 'after' && slots.label && <slots.label {...slotProps.label} />}\n <slots.indicator {...slotProps.indicator} />\n {labelPosition === 'after' && slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"]}
|
@@ -12,7 +12,6 @@ import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } fr
|
|
12
12
|
* @param props - props from this instance of Switch
|
13
13
|
* @param ref - reference to `<input>` element of Switch
|
14
14
|
*/
|
15
|
-
|
16
15
|
export const useSwitch_unstable = (props, ref) => {
|
17
16
|
const {
|
18
17
|
checked,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,yBAAyB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AAG9G;;;;;;;;;AASA,OAAO,MAAMC,kBAAkB,GAAG,CAACC,KAAkB,EAAEC,GAAgC,KAAiB;EACtG,MAAM;IAAEC,OAAO;IAAEC,cAAc;IAAEC,QAAQ;IAAEC,aAAa,GAAG,OAAO;IAAEC,QAAQ;IAAEC;EAAQ,CAAE,GAAGP,KAAK;EAEhG,MAAMQ,WAAW,GAAGb,yBAAyB,CAAC;IAC5CK,KAAK;IACLS,kBAAkB,EAAE,OAAO;IAC3BC,iBAAiB,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,UAAU;GAC5D,CAAC;EAEF,MAAMC,EAAE,GAAGb,KAAK,CAAC,SAAS,EAAEU,WAAW,CAACI,OAAO,CAACD,EAAE,CAAC;EAEnD,MAAME,IAAI,GAAGhB,gBAAgB,CAACG,KAAK,CAACa,IAAI,EAAE;IACxCC,YAAY,EAAE;MAAEb,GAAG,EAAEP,cAAc,EAAkB;MAAE,GAAGc,WAAW,CAACK;IAAI,CAAE;IAC5EN,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMQ,SAAS,GAAGlB,gBAAgB,CAACG,KAAK,CAACe,SAAS,EAAE;IAClDD,YAAY,EAAE;MACZ,aAAa,EAAE,IAAI;MACnBE,QAAQ,eAAEzB,oBAACC,YAAY;KACxB;IACDe,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMU,KAAK,GAAGpB,gBAAgB,CAACG,KAAK,CAACiB,KAAK,EAAE;IAC1CH,YAAY,EAAE;MACZZ,OAAO;MACPC,cAAc;MACdQ,EAAE;MACFV,GAAG;MACHiB,IAAI,EAAE,QAAQ;MACdC,IAAI,EAAE,UAAU;MAChB,GAAGX,WAAW,CAACI;KAChB;IACDL,QAAQ,EAAE;GACX,CAAC;EACFU,KAAK,CAACX,QAAQ,GAAGV,cAAc,CAACqB,KAAK,CAACX,QAAQ,EAAEc,EAAE,IAAId,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGc,EAAE,EAAE;IAAElB,OAAO,EAAEkB,EAAE,CAACC,aAAa,CAACnB;EAAO,CAAE,CAAC,CAAC;EAE5G,MAAMoB,KAAK,GAAGzB,gBAAgB,CAACG,KAAK,CAACsB,KAAK,EAAE;IAC1CR,YAAY,EAAE;MACZV,QAAQ;MACRmB,OAAO,EAAEZ,EAAE;MACXJ,QAAQ;MACRiB,IAAI,EAAE;;GAET,CAAC;EAEF,OAAO;IACLnB,aAAa;IAEb;IACAoB,UAAU,EAAE;MACVZ,IAAI,EAAE,KAAK;MACXE,SAAS,EAAE,KAAK;MAChBE,KAAK,EAAE,OAAO;MACdK,KAAK,EAAE7B;KACR;IAEDoB,IAAI;IACJE,SAAS;IACTE,KAAK;IACLK;GACD;AACH,CAAC","names":["React","CircleFilled","Label","useFocusWithin","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useSwitch_unstable","props","ref","checked","defaultChecked","disabled","labelPosition","onChange","required","nativeProps","primarySlotTagName","excludedPropNames","id","primary","root","defaultProps","indicator","children","input","role","type","ev","currentTarget","label","htmlFor","size","components"],"sourceRoot":"../src/","sources":["packages/react-components/react-switch/src/components/Switch/useSwitch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { SwitchProps, SwitchState } from './Switch.types';\n\n/**\n * Create the state required to render Switch.\n *\n * The returned state can be modified with hooks such as useSwitchStyles_unstable,\n * before being passed to renderSwitch_unstable.\n *\n * @param props - props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLInputElement>): SwitchState => {\n const { checked, defaultChecked, disabled, labelPosition = 'after', onChange, required } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const id = useId('switch-', nativeProps.primary.id);\n\n const root = resolveShorthand(props.root, {\n defaultProps: { ref: useFocusWithin<HTMLDivElement>(), ...nativeProps.root },\n required: true,\n });\n\n const indicator = resolveShorthand(props.indicator, {\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n required: true,\n });\n\n const input = resolveShorthand(props.input, {\n defaultProps: {\n checked,\n defaultChecked,\n id,\n ref,\n role: 'switch',\n type: 'checkbox',\n ...nativeProps.primary,\n },\n required: true,\n });\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { checked: ev.currentTarget.checked }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n disabled,\n htmlFor: id,\n required,\n size: 'medium',\n },\n });\n\n return {\n labelPosition,\n\n //Slots definition\n components: {\n root: 'div',\n indicator: 'div',\n input: 'input',\n label: Label,\n },\n\n root,\n indicator,\n input,\n label,\n };\n};\n"]}
|