@fluentui/react-switch 9.1.4 → 9.1.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 (64) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +109 -1
  3. package/CHANGELOG.md +33 -2
  4. package/lib/Switch.js.map +1 -1
  5. package/lib/SwitchField.js.map +1 -1
  6. package/lib/components/Switch/Switch.js.map +1 -1
  7. package/lib/components/Switch/Switch.types.js +1 -1
  8. package/lib/components/Switch/Switch.types.js.map +1 -1
  9. package/lib/components/Switch/index.js.map +1 -1
  10. package/lib/components/Switch/renderSwitch.js +1 -11
  11. package/lib/components/Switch/renderSwitch.js.map +1 -1
  12. package/lib/components/Switch/useSwitch.js +5 -3
  13. package/lib/components/Switch/useSwitch.js.map +1 -1
  14. package/lib/components/Switch/useSwitchStyles.js +1 -1
  15. package/lib/components/Switch/useSwitchStyles.js.map +1 -1
  16. package/lib/components/SwitchField/SwitchField.js +1 -2
  17. package/lib/components/SwitchField/SwitchField.js.map +1 -1
  18. package/lib/components/SwitchField/index.js.map +1 -1
  19. package/lib/index.js.map +1 -1
  20. package/lib-commonjs/Switch.js +5 -4
  21. package/lib-commonjs/Switch.js.map +1 -1
  22. package/lib-commonjs/SwitchField.js +5 -4
  23. package/lib-commonjs/SwitchField.js.map +1 -1
  24. package/lib-commonjs/components/Switch/Switch.js +19 -20
  25. package/lib-commonjs/components/Switch/Switch.js.map +1 -1
  26. package/lib-commonjs/components/Switch/Switch.types.js +5 -2
  27. package/lib-commonjs/components/Switch/Switch.types.js.map +1 -1
  28. package/lib-commonjs/components/Switch/index.js +9 -8
  29. package/lib-commonjs/components/Switch/index.js.map +1 -1
  30. package/lib-commonjs/components/Switch/renderSwitch.js +14 -29
  31. package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
  32. package/lib-commonjs/components/Switch/useSwitch.js +78 -85
  33. package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
  34. package/lib-commonjs/components/Switch/useSwitchStyles.js +176 -89
  35. package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
  36. package/lib-commonjs/components/SwitchField/SwitchField.js +17 -11
  37. package/lib-commonjs/components/SwitchField/SwitchField.js.map +1 -1
  38. package/lib-commonjs/components/SwitchField/index.js +5 -4
  39. package/lib-commonjs/components/SwitchField/index.js.map +1 -1
  40. package/lib-commonjs/index.js +23 -56
  41. package/lib-commonjs/index.js.map +1 -1
  42. package/package.json +12 -11
  43. package/lib-amd/Switch.js +0 -6
  44. package/lib-amd/Switch.js.map +0 -1
  45. package/lib-amd/SwitchField.js +0 -6
  46. package/lib-amd/SwitchField.js.map +0 -1
  47. package/lib-amd/components/Switch/Switch.js +0 -17
  48. package/lib-amd/components/Switch/Switch.js.map +0 -1
  49. package/lib-amd/components/Switch/Switch.types.js +0 -5
  50. package/lib-amd/components/Switch/Switch.types.js.map +0 -1
  51. package/lib-amd/components/Switch/index.js +0 -10
  52. package/lib-amd/components/Switch/index.js.map +0 -1
  53. package/lib-amd/components/Switch/renderSwitch.js +0 -19
  54. package/lib-amd/components/Switch/renderSwitch.js.map +0 -1
  55. package/lib-amd/components/Switch/useSwitch.js +0 -63
  56. package/lib-amd/components/Switch/useSwitch.js.map +0 -1
  57. package/lib-amd/components/Switch/useSwitchStyles.js +0 -211
  58. package/lib-amd/components/Switch/useSwitchStyles.js.map +0 -1
  59. package/lib-amd/components/SwitchField/SwitchField.js +0 -10
  60. package/lib-amd/components/SwitchField/SwitchField.js.map +0 -1
  61. package/lib-amd/components/SwitchField/index.js +0 -6
  62. package/lib-amd/components/SwitchField/index.js.map +0 -1
  63. package/lib-amd/index.js +0 -15
  64. package/lib-amd/index.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Switch"), exports);
8
- tslib_1.__exportStar(require("./Switch.types"), exports);
9
- tslib_1.__exportStar(require("./renderSwitch"), exports);
10
- tslib_1.__exportStar(require("./useSwitch"), exports);
11
- tslib_1.__exportStar(require("./useSwitchStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Switch"), exports);
7
+ _exportStar(require("./Switch.types"), exports);
8
+ _exportStar(require("./renderSwitch"), exports);
9
+ _exportStar(require("./useSwitch"), exports);
10
+ _exportStar(require("./useSwitchStyles"), exports);
11
+ //# sourceMappingURL=index.js.map
12
+
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-switch/src/components/Switch/index.ts"],"sourcesContent":["export * from './Switch';\nexport * from './Switch.types';\nexport * from './renderSwitch';\nexport * from './useSwitch';\nexport * from './useSwitchStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,cAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,iBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,uBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Switch/index.js"],"sourcesContent":["export * from './Switch';\nexport * from './Switch.types';\nexport * from './renderSwitch';\nexport * from './useSwitch';\nexport * from './useSwitchStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,33 +1,18 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderSwitch_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderSwitch_unstable
5
8
  });
6
- exports.renderSwitch_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Render a Switch component by passing the state defined props to the appropriate slots.
11
- */
12
- const renderSwitch_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- const {
18
- labelPosition
19
- } = state;
20
- return React.createElement(slots.root, {
21
- ...slotProps.root
22
- }, React.createElement(slots.input, {
23
- ...slotProps.input
24
- }), labelPosition !== 'after' && slots.label && React.createElement(slots.label, {
25
- ...slotProps.label
26
- }), React.createElement(slots.indicator, {
27
- ...slotProps.indicator
28
- }), labelPosition === 'after' && slots.label && React.createElement(slots.label, {
29
- ...slotProps.label
30
- }));
31
- };
32
- exports.renderSwitch_unstable = renderSwitch_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const renderSwitch_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ const { labelPosition } = state;
15
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, /*#__PURE__*/ _react.createElement(slots.input, slotProps.input), labelPosition !== 'after' && slots.label && /*#__PURE__*/ _react.createElement(slots.label, slotProps.label), /*#__PURE__*/ _react.createElement(slots.indicator, slotProps.indicator), labelPosition === 'after' && slots.label && /*#__PURE__*/ _react.createElement(slots.label, slotProps.label));
16
+ }; //# sourceMappingURL=renderSwitch.js.map
17
+
33
18
  //# sourceMappingURL=renderSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderSwitch_unstable","state","slots","slotProps","getSlots","labelPosition","createElement","root","input","label","indicator","exports"],"sources":["../src/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"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,qBAAqB,GAAIC,KAAkB,IAAI;EAC1D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAcH,KAAK,CAAC;EACzD,MAAM;IAAEI;EAAa,CAAE,GAAGJ,KAAK;EAE/B,OACEJ,KAAA,CAAAS,aAAA,CAACJ,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,GAC5BV,KAAA,CAAAS,aAAA,CAACJ,KAAK,CAACM,KAAK;IAAA,GAAKL,SAAS,CAACK;EAAK,EAAI,EACnCH,aAAa,KAAK,OAAO,IAAIH,KAAK,CAACO,KAAK,IAAIZ,KAAA,CAAAS,aAAA,CAACJ,KAAK,CAACO,KAAK;IAAA,GAAKN,SAAS,CAACM;EAAK,EAAI,EACjFZ,KAAA,CAAAS,aAAA,CAACJ,KAAK,CAACQ,SAAS;IAAA,GAAKP,SAAS,CAACO;EAAS,EAAI,EAC3CL,aAAa,KAAK,OAAO,IAAIH,KAAK,CAACO,KAAK,IAAIZ,KAAA,CAAAS,aAAA,CAACJ,KAAK,CAACO,KAAK;IAAA,GAAKN,SAAS,CAACM;EAAK,EAAI,CACtE;AAEjB,CAAC;AAZYE,OAAA,CAAAX,qBAAqB,GAAAA,qBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Switch/renderSwitch.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render a Switch component by passing the state defined props to the appropriate slots.\n */\nexport const renderSwitch_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n const {\n labelPosition\n } = state;\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), labelPosition !== 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label), /*#__PURE__*/React.createElement(slots.indicator, slotProps.indicator), labelPosition === 'after' && slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label));\n};\n//# sourceMappingURL=renderSwitch.js.map"],"names":["renderSwitch_unstable","state","slots","slotProps","getSlots","labelPosition","React","createElement","root","input","label","indicator"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,wBAAwBC,CAAAA,QAAS;IAC5C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,MAAM,EACJI,cAAa,EACd,GAAGJ;IACJ,OAAO,WAAW,GAAEK,OAAMC,aAAa,CAACL,MAAMM,IAAI,EAAEL,UAAUK,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACL,MAAMO,KAAK,EAAEN,UAAUM,KAAK,GAAGJ,kBAAkB,WAAWH,MAAMQ,KAAK,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACL,MAAMQ,KAAK,EAAEP,UAAUO,KAAK,GAAG,WAAW,GAAEJ,OAAMC,aAAa,CAACL,MAAMS,SAAS,EAAER,UAAUQ,SAAS,GAAGN,kBAAkB,WAAWH,MAAMQ,KAAK,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACL,MAAMQ,KAAK,EAAEP,UAAUO,KAAK;AACna,GACA,wCAAwC"}
@@ -1,89 +1,82 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useSwitch_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useSwitch_unstable
5
8
  });
6
- exports.useSwitch_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
9
- const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
10
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
- /**
13
- * Create the state required to render Switch.
14
- *
15
- * The returned state can be modified with hooks such as useSwitchStyles_unstable,
16
- * before being passed to renderSwitch_unstable.
17
- *
18
- * @param props - props from this instance of Switch
19
- * @param ref - reference to `<input>` element of Switch
20
- */
21
- const useSwitch_unstable = (props, ref) => {
22
- const {
23
- checked,
24
- defaultChecked,
25
- disabled,
26
- labelPosition = 'after',
27
- onChange,
28
- required
29
- } = props;
30
- const nativeProps = react_utilities_1.getPartitionedNativeProps({
31
- props,
32
- primarySlotTagName: 'input',
33
- excludedPropNames: ['checked', 'defaultChecked', 'onChange']
34
- });
35
- const id = react_utilities_1.useId('switch-', nativeProps.primary.id);
36
- const root = react_utilities_1.resolveShorthand(props.root, {
37
- defaultProps: {
38
- ref: react_tabster_1.useFocusWithin(),
39
- ...nativeProps.root
40
- },
41
- required: true
42
- });
43
- const indicator = react_utilities_1.resolveShorthand(props.indicator, {
44
- defaultProps: {
45
- 'aria-hidden': true,
46
- children: React.createElement(react_icons_1.CircleFilled, null)
47
- },
48
- required: true
49
- });
50
- const input = react_utilities_1.resolveShorthand(props.input, {
51
- defaultProps: {
52
- checked,
53
- defaultChecked,
54
- id,
55
- ref,
56
- role: 'switch',
57
- type: 'checkbox',
58
- ...nativeProps.primary
59
- },
60
- required: true
61
- });
62
- input.onChange = react_utilities_1.mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
63
- checked: ev.currentTarget.checked
64
- }));
65
- const label = react_utilities_1.resolveShorthand(props.label, {
66
- defaultProps: {
67
- disabled,
68
- htmlFor: id,
69
- required,
70
- size: 'medium'
71
- }
72
- });
73
- return {
74
- labelPosition,
75
- //Slots definition
76
- components: {
77
- root: 'div',
78
- indicator: 'div',
79
- input: 'input',
80
- label: react_label_1.Label
81
- },
82
- root,
83
- indicator,
84
- input,
85
- label
86
- };
87
- };
88
- exports.useSwitch_unstable = useSwitch_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactIcons = require("@fluentui/react-icons");
12
+ const _reactLabel = require("@fluentui/react-label");
13
+ const _reactTabster = require("@fluentui/react-tabster");
14
+ const _reactUtilities = require("@fluentui/react-utilities");
15
+ const useSwitch_unstable = (props, ref)=>{
16
+ const { checked , defaultChecked , disabled , labelPosition ='after' , onChange , required } = props;
17
+ const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
18
+ props,
19
+ primarySlotTagName: 'input',
20
+ excludedPropNames: [
21
+ 'checked',
22
+ 'defaultChecked',
23
+ 'onChange'
24
+ ]
25
+ });
26
+ const id = (0, _reactUtilities.useId)('switch-', nativeProps.primary.id);
27
+ const root = (0, _reactUtilities.resolveShorthand)(props.root, {
28
+ defaultProps: {
29
+ ref: (0, _reactTabster.useFocusWithin)(),
30
+ ...nativeProps.root
31
+ },
32
+ required: true
33
+ });
34
+ const indicator = (0, _reactUtilities.resolveShorthand)(props.indicator, {
35
+ defaultProps: {
36
+ 'aria-hidden': true,
37
+ children: /*#__PURE__*/ _react.createElement(_reactIcons.CircleFilled, null)
38
+ },
39
+ required: true
40
+ });
41
+ const input = (0, _reactUtilities.resolveShorthand)(props.input, {
42
+ defaultProps: {
43
+ checked,
44
+ defaultChecked,
45
+ id,
46
+ ref,
47
+ role: 'switch',
48
+ type: 'checkbox',
49
+ ...nativeProps.primary
50
+ },
51
+ required: true
52
+ });
53
+ input.onChange = (0, _reactUtilities.mergeCallbacks)(input.onChange, (ev)=>{
54
+ return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
55
+ checked: ev.currentTarget.checked
56
+ });
57
+ });
58
+ const label = (0, _reactUtilities.resolveShorthand)(props.label, {
59
+ defaultProps: {
60
+ disabled,
61
+ htmlFor: id,
62
+ required,
63
+ size: 'medium'
64
+ }
65
+ });
66
+ return {
67
+ labelPosition,
68
+ //Slots definition
69
+ components: {
70
+ root: 'div',
71
+ indicator: 'div',
72
+ input: 'input',
73
+ label: _reactLabel.Label
74
+ },
75
+ root,
76
+ indicator,
77
+ input,
78
+ label
79
+ };
80
+ }; //# sourceMappingURL=useSwitch.js.map
81
+
89
82
  //# sourceMappingURL=useSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_icons_1","react_label_1","react_tabster_1","react_utilities_1","useSwitch_unstable","props","ref","checked","defaultChecked","disabled","labelPosition","onChange","required","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","id","useId","primary","root","resolveShorthand","defaultProps","useFocusWithin","indicator","children","createElement","CircleFilled","input","role","type","mergeCallbacks","ev","currentTarget","label","htmlFor","size","components","Label","exports"],"sources":["../src/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"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,aAAA,gBAAAF,OAAA;AACA,MAAAG,eAAA,gBAAAH,OAAA;AACA,MAAAI,iBAAA,gBAAAJ,OAAA;AAGA;;;;;;;;;AASO,MAAMK,kBAAkB,GAAGA,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,GAAGV,iBAAA,CAAAW,yBAAyB,CAAC;IAC5CT,KAAK;IACLU,kBAAkB,EAAE,OAAO;IAC3BC,iBAAiB,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,UAAU;GAC5D,CAAC;EAEF,MAAMC,EAAE,GAAGd,iBAAA,CAAAe,KAAK,CAAC,SAAS,EAAEL,WAAW,CAACM,OAAO,CAACF,EAAE,CAAC;EAEnD,MAAMG,IAAI,GAAGjB,iBAAA,CAAAkB,gBAAgB,CAAChB,KAAK,CAACe,IAAI,EAAE;IACxCE,YAAY,EAAE;MAAEhB,GAAG,EAAEJ,eAAA,CAAAqB,cAAc,EAAkB;MAAE,GAAGV,WAAW,CAACO;IAAI,CAAE;IAC5ER,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMY,SAAS,GAAGrB,iBAAA,CAAAkB,gBAAgB,CAAChB,KAAK,CAACmB,SAAS,EAAE;IAClDF,YAAY,EAAE;MACZ,aAAa,EAAE,IAAI;MACnBG,QAAQ,EAAE3B,KAAA,CAAA4B,aAAA,CAAC1B,aAAA,CAAA2B,YAAY;KACxB;IACDf,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMgB,KAAK,GAAGzB,iBAAA,CAAAkB,gBAAgB,CAAChB,KAAK,CAACuB,KAAK,EAAE;IAC1CN,YAAY,EAAE;MACZf,OAAO;MACPC,cAAc;MACdS,EAAE;MACFX,GAAG;MACHuB,IAAI,EAAE,QAAQ;MACdC,IAAI,EAAE,UAAU;MAChB,GAAGjB,WAAW,CAACM;KAChB;IACDP,QAAQ,EAAE;GACX,CAAC;EACFgB,KAAK,CAACjB,QAAQ,GAAGR,iBAAA,CAAA4B,cAAc,CAACH,KAAK,CAACjB,QAAQ,EAAEqB,EAAE,IAAIrB,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGqB,EAAE,EAAE;IAAEzB,OAAO,EAAEyB,EAAE,CAACC,aAAa,CAAC1B;EAAO,CAAE,CAAC,CAAC;EAE5G,MAAM2B,KAAK,GAAG/B,iBAAA,CAAAkB,gBAAgB,CAAChB,KAAK,CAAC6B,KAAK,EAAE;IAC1CZ,YAAY,EAAE;MACZb,QAAQ;MACR0B,OAAO,EAAElB,EAAE;MACXL,QAAQ;MACRwB,IAAI,EAAE;;GAET,CAAC;EAEF,OAAO;IACL1B,aAAa;IAEb;IACA2B,UAAU,EAAE;MACVjB,IAAI,EAAE,KAAK;MACXI,SAAS,EAAE,KAAK;MAChBI,KAAK,EAAE,OAAO;MACdM,KAAK,EAAEjC,aAAA,CAAAqC;KACR;IAEDlB,IAAI;IACJI,SAAS;IACTI,KAAK;IACLM;GACD;AACH,CAAC;AA/DYK,OAAA,CAAAnC,kBAAkB,GAAAA,kBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Switch/useSwitch.js"],"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';\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, ref) => {\n const {\n checked,\n defaultChecked,\n disabled,\n labelPosition = 'after',\n onChange,\n required\n } = props;\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange']\n });\n const id = useId('switch-', nativeProps.primary.id);\n const root = resolveShorthand(props.root, {\n defaultProps: {\n ref: useFocusWithin(),\n ...nativeProps.root\n },\n required: true\n });\n const indicator = resolveShorthand(props.indicator, {\n defaultProps: {\n 'aria-hidden': true,\n children: /*#__PURE__*/React.createElement(CircleFilled, null)\n },\n required: true\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 => {\n return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {\n checked: ev.currentTarget.checked\n });\n });\n const label = resolveShorthand(props.label, {\n defaultProps: {\n disabled,\n htmlFor: id,\n required,\n size: 'medium'\n }\n });\n return {\n labelPosition,\n //Slots definition\n components: {\n root: 'div',\n indicator: 'div',\n input: 'input',\n label: Label\n },\n root,\n indicator,\n input,\n label\n };\n};\n//# sourceMappingURL=useSwitch.js.map"],"names":["useSwitch_unstable","props","ref","checked","defaultChecked","disabled","labelPosition","onChange","required","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","id","useId","primary","root","resolveShorthand","defaultProps","useFocusWithin","indicator","children","React","createElement","CircleFilled","input","role","type","mergeCallbacks","ev","currentTarget","label","htmlFor","size","components","Label"],"mappings":";;;;+BAcaA;;aAAAA;;;6DAdU;4BACM;4BACP;8BACS;gCACoD;AAU5E,MAAMA,qBAAqB,CAACC,OAAOC,MAAQ;IAChD,MAAM,EACJC,QAAO,EACPC,eAAc,EACdC,SAAQ,EACRC,eAAgB,QAAO,EACvBC,SAAQ,EACRC,SAAQ,EACT,GAAGP;IACJ,MAAMQ,cAAcC,IAAAA,yCAAyB,EAAC;QAC5CT;QACAU,oBAAoB;QACpBC,mBAAmB;YAAC;YAAW;YAAkB;SAAW;IAC9D;IACA,MAAMC,KAAKC,IAAAA,qBAAK,EAAC,WAAWL,YAAYM,OAAO,CAACF,EAAE;IAClD,MAAMG,OAAOC,IAAAA,gCAAgB,EAAChB,MAAMe,IAAI,EAAE;QACxCE,cAAc;YACZhB,KAAKiB,IAAAA,4BAAc;YACnB,GAAGV,YAAYO,IAAI;QACrB;QACAR,UAAU,IAAI;IAChB;IACA,MAAMY,YAAYH,IAAAA,gCAAgB,EAAChB,MAAMmB,SAAS,EAAE;QAClDF,cAAc;YACZ,eAAe,IAAI;YACnBG,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,wBAAY,EAAE,IAAI;QAC/D;QACAhB,UAAU,IAAI;IAChB;IACA,MAAMiB,QAAQR,IAAAA,gCAAgB,EAAChB,MAAMwB,KAAK,EAAE;QAC1CP,cAAc;YACZf;YACAC;YACAS;YACAX;YACAwB,MAAM;YACNC,MAAM;YACN,GAAGlB,YAAYM,OAAO;QACxB;QACAP,UAAU,IAAI;IAChB;IACAiB,MAAMlB,QAAQ,GAAGqB,IAAAA,8BAAc,EAACH,MAAMlB,QAAQ,EAAEsB,CAAAA,KAAM;QACpD,OAAOtB,aAAa,IAAI,IAAIA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASsB,IAAI;YACtE1B,SAAS0B,GAAGC,aAAa,CAAC3B,OAAO;QACnC,EAAE;IACJ;IACA,MAAM4B,QAAQd,IAAAA,gCAAgB,EAAChB,MAAM8B,KAAK,EAAE;QAC1Cb,cAAc;YACZb;YACA2B,SAASnB;YACTL;YACAyB,MAAM;QACR;IACF;IACA,OAAO;QACL3B;QACA,kBAAkB;QAClB4B,YAAY;YACVlB,MAAM;YACNI,WAAW;YACXK,OAAO;YACPM,OAAOI,iBAAK;QACd;QACAnB;QACAI;QACAK;QACAM;IACF;AACF,GACA,qCAAqC"}
@@ -1,108 +1,195 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ switchClassNames: ()=>switchClassNames,
13
+ switchClassName: ()=>switchClassName,
14
+ useSwitchStyles_unstable: ()=>useSwitchStyles_unstable
5
15
  });
6
- exports.useSwitchStyles_unstable = exports.switchClassName = exports.switchClassNames = void 0;
7
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
- const react_1 = /*#__PURE__*/require("@griffel/react");
10
- exports.switchClassNames = {
11
- root: 'fui-Switch',
12
- indicator: 'fui-Switch__indicator',
13
- input: 'fui-Switch__input',
14
- label: 'fui-Switch__label'
16
+ const _react = require("@griffel/react");
17
+ const switchClassNames = {
18
+ root: 'fui-Switch',
19
+ indicator: 'fui-Switch__indicator',
20
+ input: 'fui-Switch__input',
21
+ label: 'fui-Switch__label'
15
22
  };
16
- /**
17
- * @deprecated Use `switchClassNames.root` instead.
18
- */
19
- exports.switchClassName = exports.switchClassNames.root;
23
+ const switchClassName = switchClassNames.root;
20
24
  // Thumb and track sizes used by the component.
21
25
  const spaceBetweenThumbAndTrack = 2;
22
26
  const trackHeight = 20;
23
27
  const trackWidth = 40;
24
28
  const thumbSize = trackHeight - spaceBetweenThumbAndTrack;
25
- const useRootBaseClassName = /*#__PURE__*/react_1.__resetStyles("r1u7w45w", "rlzel8d", [".r1u7w45w{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".r1u7w45w:focus{outline-style:none;}", ".r1u7w45w:focus-visible{outline-style:none;}", ".r1u7w45w[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}", ".r1u7w45w[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}", ".rlzel8d{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".rlzel8d:focus{outline-style:none;}", ".rlzel8d:focus-visible{outline-style:none;}", ".rlzel8d[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}", ".rlzel8d[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}"]);
26
- const useRootStyles = /*#__PURE__*/react_1.__styles({
27
- vertical: {
28
- Beiy3e4: "f1vx9l62"
29
- }
29
+ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r1u7w45w", "rlzel8d", [
30
+ ".r1u7w45w{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}",
31
+ ".r1u7w45w:focus{outline-style:none;}",
32
+ ".r1u7w45w:focus-visible{outline-style:none;}",
33
+ ".r1u7w45w[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}",
34
+ ".r1u7w45w[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}",
35
+ ".rlzel8d{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}",
36
+ ".rlzel8d:focus{outline-style:none;}",
37
+ ".rlzel8d:focus-visible{outline-style:none;}",
38
+ ".rlzel8d[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}",
39
+ ".rlzel8d[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}"
40
+ ]);
41
+ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
42
+ vertical: {
43
+ Beiy3e4: "f1vx9l62"
44
+ }
30
45
  }, {
31
- d: [".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"]
46
+ d: [
47
+ ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"
48
+ ]
32
49
  });
33
- const useIndicatorBaseClassName = /*#__PURE__*/react_1.__resetStyles("r13wlxb8", null, [".r13wlxb8{border-radius:var(--borderRadiusCircular);border:1px solid;line-height:0;box-sizing:border-box;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:18px;height:20px;margin:var(--spacingVerticalS) var(--spacingHorizontalS);pointer-events:none;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;}", "@media screen and (prefers-reduced-motion: reduce){.r13wlxb8{transition-duration:0.01ms;}}", ".r13wlxb8>*{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}", "@media screen and (prefers-reduced-motion: reduce){.r13wlxb8>*{transition-duration:0.01ms;}}"]);
34
- const useIndicatorStyles = /*#__PURE__*/react_1.__styles({
35
- labelAbove: {
36
- B6of3ja: "f1hu3pq6"
37
- }
50
+ const useIndicatorBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r13wlxb8", null, [
51
+ ".r13wlxb8{border-radius:var(--borderRadiusCircular);border:1px solid;line-height:0;box-sizing:border-box;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:18px;height:20px;margin:var(--spacingVerticalS) var(--spacingHorizontalS);pointer-events:none;transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:background,border,color;width:40px;}",
52
+ "@media screen and (prefers-reduced-motion: reduce){.r13wlxb8{transition-duration:0.01ms;}}",
53
+ ".r13wlxb8>*{transition-duration:var(--durationNormal);transition-timing-function:var(--curveEasyEase);transition-property:transform;}",
54
+ "@media screen and (prefers-reduced-motion: reduce){.r13wlxb8>*{transition-duration:0.01ms;}}"
55
+ ]);
56
+ const useIndicatorStyles = /*#__PURE__*/ (0, _react["__styles"])({
57
+ labelAbove: {
58
+ B6of3ja: "f1hu3pq6"
59
+ }
38
60
  }, {
39
- d: [".f1hu3pq6{margin-top:0;}"]
61
+ d: [
62
+ ".f1hu3pq6{margin-top:0;}"
63
+ ]
40
64
  });
41
- const useInputBaseClassName = /*#__PURE__*/react_1.__resetStyles("r92li9d", "rxjpw57", [".r92li9d{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(40px + 2 * var(--spacingHorizontalS));}", ".r92li9d:checked~.fui-Switch__indicator>*{-webkit-transform:translateX(20px);-moz-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px);}", ".r92li9d:disabled{cursor:default;}", ".r92li9d:disabled~.fui-Switch__indicator{color:var(--colorNeutralForegroundDisabled);}", ".r92li9d:disabled~.fui-Switch__label{cursor:default;color:var(--colorNeutralForegroundDisabled);}", ".r92li9d:enabled:not(:checked)~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessible);border-color:var(--colorNeutralStrokeAccessible);}", ".r92li9d:enabled:not(:checked)~.fui-Switch__label{color:var(--colorNeutralForeground1);}", ".r92li9d:enabled:not(:checked):hover~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}", ".r92li9d:enabled:not(:checked):hover:active~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}", ".r92li9d:enabled:checked~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackground);color:var(--colorNeutralForegroundInverted);border-color:var(--colorTransparentStroke);}", ".r92li9d:enabled:checked:hover~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundHover);border-color:var(--colorTransparentStrokeInteractive);}", ".r92li9d:enabled:checked:hover:active~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundPressed);border-color:var(--colorTransparentStrokeInteractive);}", ".r92li9d:disabled:not(:checked)~.fui-Switch__indicator{border-color:var(--colorNeutralStrokeDisabled);}", ".r92li9d:disabled:checked~.fui-Switch__indicator{background-color:var(--colorNeutralBackgroundDisabled);border-color:var(--colorTransparentStrokeDisabled);}", "@media (forced-colors: active){.r92li9d:disabled~.fui-Switch__indicator{color:GrayText;border-color:GrayText;}.r92li9d:disabled~.fui-Switch__label{color:GrayText;}}", ".rxjpw57{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(40px + 2 * var(--spacingHorizontalS));}", ".rxjpw57:checked~.fui-Switch__indicator>*{-webkit-transform:translateX(-20px);-moz-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px);}", ".rxjpw57:disabled{cursor:default;}", ".rxjpw57:disabled~.fui-Switch__indicator{color:var(--colorNeutralForegroundDisabled);}", ".rxjpw57:disabled~.fui-Switch__label{cursor:default;color:var(--colorNeutralForegroundDisabled);}", ".rxjpw57:enabled:not(:checked)~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessible);border-color:var(--colorNeutralStrokeAccessible);}", ".rxjpw57:enabled:not(:checked)~.fui-Switch__label{color:var(--colorNeutralForeground1);}", ".rxjpw57:enabled:not(:checked):hover~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}", ".rxjpw57:enabled:not(:checked):hover:active~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}", ".rxjpw57:enabled:checked~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackground);color:var(--colorNeutralForegroundInverted);border-color:var(--colorTransparentStroke);}", ".rxjpw57:enabled:checked:hover~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundHover);border-color:var(--colorTransparentStrokeInteractive);}", ".rxjpw57:enabled:checked:hover:active~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundPressed);border-color:var(--colorTransparentStrokeInteractive);}", ".rxjpw57:disabled:not(:checked)~.fui-Switch__indicator{border-color:var(--colorNeutralStrokeDisabled);}", ".rxjpw57:disabled:checked~.fui-Switch__indicator{background-color:var(--colorNeutralBackgroundDisabled);border-color:var(--colorTransparentStrokeDisabled);}", "@media (forced-colors: active){.rxjpw57:disabled~.fui-Switch__indicator{color:GrayText;border-color:GrayText;}.rxjpw57:disabled~.fui-Switch__label{color:GrayText;}}"]);
42
- const useInputStyles = /*#__PURE__*/react_1.__styles({
43
- before: {
44
- j35jbq: ["f1e31b4d", "f1vgc2s3"],
45
- Bhzewxz: "f15twtuk"
46
- },
47
- after: {
48
- oyh7mz: ["f1vgc2s3", "f1e31b4d"],
49
- Bhzewxz: "f15twtuk"
50
- },
51
- above: {
52
- B5kzvoi: "f1yab3r1",
53
- Bqenvij: "f1aar7gd",
54
- a9b677: "fly5x3f"
55
- }
65
+ const useInputBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rw4brat", "r1f4bxyr", [
66
+ ".rw4brat{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(40px + 2 * var(--spacingHorizontalS));}",
67
+ ".rw4brat:checked~.fui-Switch__indicator>*{-webkit-transform:translateX(20px);-moz-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px);}",
68
+ ".rw4brat:disabled{cursor:default;}",
69
+ ".rw4brat:disabled~.fui-Switch__indicator{color:var(--colorNeutralForegroundDisabled);}",
70
+ ".rw4brat:disabled~.fui-Switch__label{cursor:default;color:var(--colorNeutralForegroundDisabled);}",
71
+ ".rw4brat:enabled:not(:checked)~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessible);border-color:var(--colorNeutralStrokeAccessible);}",
72
+ ".rw4brat:enabled:not(:checked)~.fui-Switch__label{color:var(--colorNeutralForeground1);}",
73
+ ".rw4brat:enabled:not(:checked):hover~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
74
+ ".rw4brat:enabled:not(:checked):hover:active~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
75
+ ".rw4brat:enabled:checked~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackground);color:var(--colorNeutralForegroundInverted);border-color:var(--colorTransparentStroke);}",
76
+ ".rw4brat:enabled:checked:hover~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundHover);border-color:var(--colorTransparentStrokeInteractive);}",
77
+ ".rw4brat:enabled:checked:hover:active~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundPressed);border-color:var(--colorTransparentStrokeInteractive);}",
78
+ ".rw4brat:disabled:not(:checked)~.fui-Switch__indicator{border-color:var(--colorNeutralStrokeDisabled);}",
79
+ ".rw4brat:disabled:checked~.fui-Switch__indicator{background-color:var(--colorNeutralBackgroundDisabled);border-color:var(--colorTransparentStrokeDisabled);}",
80
+ "@media (forced-colors: active){.rw4brat:disabled~.fui-Switch__indicator{color:GrayText;border-color:GrayText;}.rw4brat:disabled~.fui-Switch__label{color:GrayText;}.rw4brat:enabled:checked:hover~.fui-Switch__indicator{background-color:Highlight;color:Canvas;}.rw4brat:enabled:checked~.fui-Switch__indicator{background-color:Highlight;color:Canvas;}}",
81
+ ".r1f4bxyr{box-sizing:border-box;cursor:pointer;height:100%;margin:0;opacity:0;position:absolute;width:calc(40px + 2 * var(--spacingHorizontalS));}",
82
+ ".r1f4bxyr:checked~.fui-Switch__indicator>*{-webkit-transform:translateX(-20px);-moz-transform:translateX(-20px);-ms-transform:translateX(-20px);transform:translateX(-20px);}",
83
+ ".r1f4bxyr:disabled{cursor:default;}",
84
+ ".r1f4bxyr:disabled~.fui-Switch__indicator{color:var(--colorNeutralForegroundDisabled);}",
85
+ ".r1f4bxyr:disabled~.fui-Switch__label{cursor:default;color:var(--colorNeutralForegroundDisabled);}",
86
+ ".r1f4bxyr:enabled:not(:checked)~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessible);border-color:var(--colorNeutralStrokeAccessible);}",
87
+ ".r1f4bxyr:enabled:not(:checked)~.fui-Switch__label{color:var(--colorNeutralForeground1);}",
88
+ ".r1f4bxyr:enabled:not(:checked):hover~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessibleHover);border-color:var(--colorNeutralStrokeAccessibleHover);}",
89
+ ".r1f4bxyr:enabled:not(:checked):hover:active~.fui-Switch__indicator{color:var(--colorNeutralStrokeAccessiblePressed);border-color:var(--colorNeutralStrokeAccessiblePressed);}",
90
+ ".r1f4bxyr:enabled:checked~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackground);color:var(--colorNeutralForegroundInverted);border-color:var(--colorTransparentStroke);}",
91
+ ".r1f4bxyr:enabled:checked:hover~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundHover);border-color:var(--colorTransparentStrokeInteractive);}",
92
+ ".r1f4bxyr:enabled:checked:hover:active~.fui-Switch__indicator{background-color:var(--colorCompoundBrandBackgroundPressed);border-color:var(--colorTransparentStrokeInteractive);}",
93
+ ".r1f4bxyr:disabled:not(:checked)~.fui-Switch__indicator{border-color:var(--colorNeutralStrokeDisabled);}",
94
+ ".r1f4bxyr:disabled:checked~.fui-Switch__indicator{background-color:var(--colorNeutralBackgroundDisabled);border-color:var(--colorTransparentStrokeDisabled);}",
95
+ "@media (forced-colors: active){.r1f4bxyr:disabled~.fui-Switch__indicator{color:GrayText;border-color:GrayText;}.r1f4bxyr:disabled~.fui-Switch__label{color:GrayText;}.r1f4bxyr:enabled:checked:hover~.fui-Switch__indicator{background-color:Highlight;color:Canvas;}.r1f4bxyr:enabled:checked~.fui-Switch__indicator{background-color:Highlight;color:Canvas;}}"
96
+ ]);
97
+ const useInputStyles = /*#__PURE__*/ (0, _react["__styles"])({
98
+ before: {
99
+ j35jbq: [
100
+ "f1e31b4d",
101
+ "f1vgc2s3"
102
+ ],
103
+ Bhzewxz: "f15twtuk"
104
+ },
105
+ after: {
106
+ oyh7mz: [
107
+ "f1vgc2s3",
108
+ "f1e31b4d"
109
+ ],
110
+ Bhzewxz: "f15twtuk"
111
+ },
112
+ above: {
113
+ B5kzvoi: "f1yab3r1",
114
+ Bqenvij: "f1aar7gd",
115
+ a9b677: "fly5x3f"
116
+ }
56
117
  }, {
57
- d: [".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".f15twtuk{top:0;}", ".f1yab3r1{bottom:0;}", ".f1aar7gd{height:calc(20px + var(--spacingVerticalS));}", ".fly5x3f{width:100%;}"]
118
+ d: [
119
+ ".f1e31b4d{right:0;}",
120
+ ".f1vgc2s3{left:0;}",
121
+ ".f15twtuk{top:0;}",
122
+ ".f1yab3r1{bottom:0;}",
123
+ ".f1aar7gd{height:calc(20px + var(--spacingVerticalS));}",
124
+ ".fly5x3f{width:100%;}"
125
+ ]
58
126
  });
59
127
  // Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
60
- const useLabelStyles = /*#__PURE__*/react_1.__styles({
61
- base: {
62
- Bceei9c: "f1k6fduh",
63
- jrapky: "f49ad5g",
64
- B6of3ja: "f1xlvstr",
65
- z8tnut: "f1kwiid1",
66
- z189sj: ["f1vdfbxk", "f1f5gg8d"],
67
- Byoj8tv: "f5b47ha",
68
- uwmqm3: ["f1f5gg8d", "f1vdfbxk"]
69
- },
70
- above: {
71
- z8tnut: "f1ywm7hm",
72
- Byoj8tv: "f14wxoun",
73
- a9b677: "fly5x3f"
74
- },
75
- after: {
76
- uwmqm3: ["fruq291", "f7x41pl"]
77
- },
78
- before: {
79
- z189sj: ["f7x41pl", "fruq291"]
80
- }
128
+ const useLabelStyles = /*#__PURE__*/ (0, _react["__styles"])({
129
+ base: {
130
+ Bceei9c: "f1k6fduh",
131
+ jrapky: "f49ad5g",
132
+ B6of3ja: "f1xlvstr",
133
+ z8tnut: "f1kwiid1",
134
+ z189sj: [
135
+ "f1vdfbxk",
136
+ "f1f5gg8d"
137
+ ],
138
+ Byoj8tv: "f5b47ha",
139
+ uwmqm3: [
140
+ "f1f5gg8d",
141
+ "f1vdfbxk"
142
+ ]
143
+ },
144
+ above: {
145
+ z8tnut: "f1ywm7hm",
146
+ Byoj8tv: "f14wxoun",
147
+ a9b677: "fly5x3f"
148
+ },
149
+ after: {
150
+ uwmqm3: [
151
+ "fruq291",
152
+ "f7x41pl"
153
+ ]
154
+ },
155
+ before: {
156
+ z189sj: [
157
+ "f7x41pl",
158
+ "fruq291"
159
+ ]
160
+ }
81
161
  }, {
82
- d: [".f1k6fduh{cursor:pointer;}", ".f49ad5g{margin-bottom:calc((20px - var(--lineHeightBase300)) / 2);}", ".f1xlvstr{margin-top:calc((20px - var(--lineHeightBase300)) / 2);}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}", ".f14wxoun{padding-bottom:var(--spacingVerticalXS);}", ".fly5x3f{width:100%;}", ".fruq291{padding-left:var(--spacingHorizontalXS);}", ".f7x41pl{padding-right:var(--spacingHorizontalXS);}"]
162
+ d: [
163
+ ".f1k6fduh{cursor:pointer;}",
164
+ ".f49ad5g{margin-bottom:calc((20px - var(--lineHeightBase300)) / 2);}",
165
+ ".f1xlvstr{margin-top:calc((20px - var(--lineHeightBase300)) / 2);}",
166
+ ".f1kwiid1{padding-top:var(--spacingVerticalS);}",
167
+ ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
168
+ ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
169
+ ".f5b47ha{padding-bottom:var(--spacingVerticalS);}",
170
+ ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}",
171
+ ".f14wxoun{padding-bottom:var(--spacingVerticalXS);}",
172
+ ".fly5x3f{width:100%;}",
173
+ ".fruq291{padding-left:var(--spacingHorizontalXS);}",
174
+ ".f7x41pl{padding-right:var(--spacingHorizontalXS);}"
175
+ ]
83
176
  });
84
- /**
85
- * Apply styling to the Switch slots based on the state
86
- */
87
- const useSwitchStyles_unstable = state => {
88
- const rootBaseClassName = useRootBaseClassName();
89
- const rootStyles = useRootStyles();
90
- const indicatorBaseClassName = useIndicatorBaseClassName();
91
- const indicatorStyles = useIndicatorStyles();
92
- const inputBaseClassName = useInputBaseClassName();
93
- const inputStyles = useInputStyles();
94
- const labelStyles = useLabelStyles();
95
- const {
96
- label,
97
- labelPosition
98
- } = state;
99
- state.root.className = react_1.mergeClasses(exports.switchClassNames.root, rootBaseClassName, labelPosition === 'above' && rootStyles.vertical, state.root.className);
100
- state.indicator.className = react_1.mergeClasses(exports.switchClassNames.indicator, indicatorBaseClassName, label && labelPosition === 'above' && indicatorStyles.labelAbove, state.indicator.className);
101
- state.input.className = react_1.mergeClasses(exports.switchClassNames.input, inputBaseClassName, label && inputStyles[labelPosition], state.input.className);
102
- if (state.label) {
103
- state.label.className = react_1.mergeClasses(exports.switchClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
104
- }
105
- return state;
106
- };
107
- exports.useSwitchStyles_unstable = useSwitchStyles_unstable;
177
+ const useSwitchStyles_unstable = (state)=>{
178
+ const rootBaseClassName = useRootBaseClassName();
179
+ const rootStyles = useRootStyles();
180
+ const indicatorBaseClassName = useIndicatorBaseClassName();
181
+ const indicatorStyles = useIndicatorStyles();
182
+ const inputBaseClassName = useInputBaseClassName();
183
+ const inputStyles = useInputStyles();
184
+ const labelStyles = useLabelStyles();
185
+ const { label , labelPosition } = state;
186
+ state.root.className = (0, _react.mergeClasses)(switchClassNames.root, rootBaseClassName, labelPosition === 'above' && rootStyles.vertical, state.root.className);
187
+ state.indicator.className = (0, _react.mergeClasses)(switchClassNames.indicator, indicatorBaseClassName, label && labelPosition === 'above' && indicatorStyles.labelAbove, state.indicator.className);
188
+ state.input.className = (0, _react.mergeClasses)(switchClassNames.input, inputBaseClassName, label && inputStyles[labelPosition], state.input.className);
189
+ if (state.label) {
190
+ state.label.className = (0, _react.mergeClasses)(switchClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
191
+ }
192
+ return state;
193
+ }; //# sourceMappingURL=useSwitchStyles.js.map
194
+
108
195
  //# sourceMappingURL=useSwitchStyles.js.map