@fluentui/react-switch 9.74.5-experimental.tabster-v9.20260804-bb909442fe.0 → 9.74.7-experimental.cli-api.20261006-ccaa611d58.0
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.md +28 -12
- package/dist/index.d.cts +139 -0
- package/dist/metadata/api/api-root.json +1 -0
- package/dist/metadata/index.json +1 -0
- package/lib/Switch.js +1 -1
- package/lib/Switch.js.map +1 -1
- package/lib/components/Switch/Switch.js +5 -5
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Switch/index.js +4 -4
- package/lib/components/Switch/index.js.map +1 -1
- package/lib/components/Switch/renderSwitch.js +1 -1
- package/lib/components/Switch/useSwitch.js +6 -6
- package/lib/components/Switch/useSwitchStyles.styles.js +3 -3
- package/lib/components/Switch/useSwitchStyles.styles.js.map +1 -1
- package/lib/components/Switch/useSwitchStyles.styles.raw.js +3 -3
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/{Switch.js → Switch.cjs} +1 -1
- package/lib-commonjs/{Switch.js.map → Switch.cjs.map} +1 -1
- package/lib-commonjs/components/Switch/{Switch.js → Switch.cjs} +3 -3
- package/lib-commonjs/components/Switch/{Switch.js.map → Switch.cjs.map} +1 -1
- package/lib-commonjs/components/Switch/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/Switch/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/Switch/useSwitchStyles.styles.cjs.map +1 -0
- package/lib-commonjs/{index.js → index.cjs} +1 -1
- package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
- package/package.json +30 -18
- package/lib-commonjs/components/Switch/useSwitchStyles.styles.js.map +0 -1
- /package/lib-commonjs/components/Switch/{Switch.types.js → Switch.types.cjs} +0 -0
- /package/lib-commonjs/components/Switch/{Switch.types.js.map → Switch.types.cjs.map} +0 -0
- /package/lib-commonjs/components/Switch/{renderSwitch.js → renderSwitch.cjs} +0 -0
- /package/lib-commonjs/components/Switch/{renderSwitch.js.map → renderSwitch.cjs.map} +0 -0
- /package/lib-commonjs/components/Switch/{useSwitch.js → useSwitch.cjs} +0 -0
- /package/lib-commonjs/components/Switch/{useSwitch.js.map → useSwitch.cjs.map} +0 -0
- /package/lib-commonjs/components/Switch/{useSwitchStyles.styles.js → useSwitchStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/Switch/{useSwitchStyles.styles.raw.js → useSwitchStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/Switch/{useSwitchStyles.styles.raw.js.map → useSwitchStyles.styles.raw.cjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
<!-- This log was last generated on Tue, 06 Oct 2026 11:40:34 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.74.
|
|
7
|
+
## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
|
|
8
8
|
|
|
9
|
-
Tue,
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.7.
|
|
9
|
+
Tue, 06 Oct 2026 11:40:34 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.7.5..@fluentui/react-switch_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
|
-
- Release 9.74.
|
|
15
|
-
- Bump @fluentui/react-field to v9.74.
|
|
16
|
-
- Bump @fluentui/react-jsx-runtime to v9.74.
|
|
17
|
-
- Bump @fluentui/react-label to v9.74.
|
|
18
|
-
- Bump @fluentui/react-shared-contexts to v9.74.
|
|
19
|
-
- Bump @fluentui/react-tabster to v9.74.
|
|
20
|
-
- Bump @fluentui/react-theme to v9.74.
|
|
21
|
-
- Bump @fluentui/react-utilities to v9.74.
|
|
14
|
+
- Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/react-field to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-label to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
- Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
|
+
|
|
23
|
+
## [9.7.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.7.5)
|
|
24
|
+
|
|
25
|
+
Tue, 11 Aug 2026 17:20:14 GMT
|
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.7.4..@fluentui/react-switch_v9.7.5)
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake. ([PR #36327](https://github.com/microsoft/fluentui/pull/36327) by martinhochel@microsoft.com)
|
|
31
|
+
- Bump @fluentui/react-field to v9.5.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
32
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
33
|
+
- Bump @fluentui/react-label to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
34
|
+
- Bump @fluentui/react-shared-contexts to v9.26.3 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
35
|
+
- Bump @fluentui/react-tabster to v9.26.17 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
36
|
+
- Bump @fluentui/react-theme to v9.2.2 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
37
|
+
- Bump @fluentui/react-utilities to v9.26.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
38
|
|
|
23
39
|
## [9.7.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.7.4)
|
|
24
40
|
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
|
3
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
4
|
+
import type { JSXElement } from '@fluentui/react-utilities';
|
|
5
|
+
import type { Label } from '@fluentui/react-label';
|
|
6
|
+
import * as React_2 from 'react';
|
|
7
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
8
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Render a Switch component by passing the state defined props to the appropriate slots.
|
|
12
|
+
*/
|
|
13
|
+
export declare const renderSwitch_unstable: (state: SwitchBaseState) => JSXElement;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Switches enable users to trigger an option on or off through pressing the component.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Switch: ForwardRefComponent<SwitchProps>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Switch base props, excluding design-related props like size
|
|
22
|
+
*/
|
|
23
|
+
export declare type SwitchBaseProps = Omit<SwitchProps, 'size'>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Switch base state, excluding design-related state like size
|
|
27
|
+
*/
|
|
28
|
+
export declare type SwitchBaseState = Omit<SwitchState, 'size'>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use `switchClassNames.root` instead.
|
|
32
|
+
*/
|
|
33
|
+
export declare const switchClassName: string;
|
|
34
|
+
|
|
35
|
+
export declare const switchClassNames: SlotClassNames<SwitchSlots>;
|
|
36
|
+
|
|
37
|
+
export declare type SwitchOnChangeData = {
|
|
38
|
+
checked: boolean;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Switch Props
|
|
43
|
+
*/
|
|
44
|
+
export declare type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'checked' | 'defaultChecked' | 'onChange' | 'size'> & {
|
|
45
|
+
/**
|
|
46
|
+
* Defines the controlled checked state of the Switch.
|
|
47
|
+
* If passed, Switch ignores the `defaultChecked` property.
|
|
48
|
+
* This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
|
|
49
|
+
* correct value based on handling `onChange` events and re-rendering.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
checked?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* When set, allows the Switch to be focusable even when it has been disabled. This is used in scenarios where it is
|
|
56
|
+
* important to keep a consistent tab order for screen reader and keyboard users.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
disabledFocusable?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Defines whether the Switch is initially in a checked state or not when rendered.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
defaultChecked?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The position of the label relative to the Switch.
|
|
69
|
+
*
|
|
70
|
+
* @default after
|
|
71
|
+
*/
|
|
72
|
+
labelPosition?: 'above' | 'after' | 'before';
|
|
73
|
+
/**
|
|
74
|
+
* The size of the Switch.
|
|
75
|
+
*
|
|
76
|
+
* @default 'medium'
|
|
77
|
+
*/
|
|
78
|
+
size?: 'small' | 'medium';
|
|
79
|
+
/**
|
|
80
|
+
* Callback to be called when the checked state value changes.
|
|
81
|
+
*/
|
|
82
|
+
onChange?: (ev: React_2.ChangeEvent<HTMLInputElement>, data: SwitchOnChangeData) => void;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export declare type SwitchSlots = {
|
|
86
|
+
/**
|
|
87
|
+
* The root element of the Switch.
|
|
88
|
+
*
|
|
89
|
+
* The root slot receives the `className` and `style` specified directly on the `<Switch>` tag.
|
|
90
|
+
* All other native props will be applied to the primary slot: `input`.
|
|
91
|
+
*/
|
|
92
|
+
root: NonNullable<Slot<'div'>>;
|
|
93
|
+
/**
|
|
94
|
+
* The track and the thumb sliding over it indicating the on and off status of the Switch.
|
|
95
|
+
*/
|
|
96
|
+
indicator: NonNullable<Slot<'div'>>;
|
|
97
|
+
/**
|
|
98
|
+
* Hidden input that handles the Switch's functionality.
|
|
99
|
+
*
|
|
100
|
+
* This is the PRIMARY slot: all native properties specified directly on the `<Switch>` tag will be applied to this
|
|
101
|
+
* slot, except `className` and `style`, which remain on the root slot.
|
|
102
|
+
*/
|
|
103
|
+
input: NonNullable<Slot<'input'>>;
|
|
104
|
+
/**
|
|
105
|
+
* The Switch's label.
|
|
106
|
+
*/
|
|
107
|
+
label?: Slot<typeof Label>;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* State used in rendering Switch
|
|
112
|
+
*/
|
|
113
|
+
export declare type SwitchState = ComponentState<SwitchSlots> & Required<Pick<SwitchProps, 'disabledFocusable' | 'labelPosition' | 'size'>>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Create the state required to render Switch.
|
|
117
|
+
*
|
|
118
|
+
* The returned state can be modified with hooks such as useSwitchStyles_unstable,
|
|
119
|
+
* before being passed to renderSwitch_unstable.
|
|
120
|
+
*
|
|
121
|
+
* @param props - props from this instance of Switch
|
|
122
|
+
* @param ref - reference to `<input>` element of Switch
|
|
123
|
+
*/
|
|
124
|
+
export declare const useSwitch_unstable: (props: SwitchProps, ref: React_2.Ref<HTMLInputElement>) => SwitchState;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Base hook for Switch component, manages state and structure common to all variants of Switch
|
|
128
|
+
*
|
|
129
|
+
* @param props - base props from this instance of Switch
|
|
130
|
+
* @param ref - reference to `<input>` element of Switch
|
|
131
|
+
*/
|
|
132
|
+
export declare const useSwitchBase_unstable: (props: SwitchBaseProps, ref?: React_2.Ref<HTMLInputElement>) => SwitchBaseState;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Apply styling to the Switch slots based on the state
|
|
136
|
+
*/
|
|
137
|
+
export declare const useSwitchStyles_unstable: (state: SwitchState) => SwitchState;
|
|
138
|
+
|
|
139
|
+
export { }
|