@react-stately/toggle
Advanced tools
Comparing version 3.0.0-nightly-fb28ab3b4-241024 to 3.0.0-nightly-fee532d6a-241217
var $d84f98b140466b44$exports = require("./useToggleState.main.js"); | ||
var $40e5a2b1abaa0aa5$exports = require("./useToggleGroupState.main.js"); | ||
@@ -9,2 +10,3 @@ | ||
$parcel$export(module.exports, "useToggleState", () => $d84f98b140466b44$exports.useToggleState); | ||
$parcel$export(module.exports, "useToggleGroupState", () => $40e5a2b1abaa0aa5$exports.useToggleGroupState); | ||
/* | ||
@@ -23,2 +25,3 @@ * Copyright 2020 Adobe. All rights reserved. | ||
//# sourceMappingURL=main.js.map |
import {useToggleState as $3017fa7ffdddec74$export$8042c6c013fd5226} from "./useToggleState.module.js"; | ||
import {useToggleGroupState as $ad999b7f496648d1$export$8deac67f4addf270} from "./useToggleGroupState.module.js"; | ||
@@ -16,3 +17,4 @@ /* | ||
export {$3017fa7ffdddec74$export$8042c6c013fd5226 as useToggleState}; | ||
export {$3017fa7ffdddec74$export$8042c6c013fd5226 as useToggleState, $ad999b7f496648d1$export$8deac67f4addf270 as useToggleGroupState}; | ||
//# sourceMappingURL=module.js.map |
import { ToggleStateOptions } from "@react-types/checkbox"; | ||
import { Key } from "@react-types/shared"; | ||
export { ToggleStateOptions }; | ||
@@ -15,4 +16,37 @@ export interface ToggleState { | ||
export function useToggleState(props?: ToggleStateOptions): ToggleState; | ||
export interface ToggleGroupProps { | ||
/** Whether single or multiple selection is enabled. */ | ||
selectionMode?: 'single' | 'multiple'; | ||
/** Whether the collection allows empty selection. */ | ||
disallowEmptySelection?: boolean; | ||
/** The currently selected keys in the collection (controlled). */ | ||
selectedKeys?: Iterable<Key>; | ||
/** The initial selected keys in the collection (uncontrolled). */ | ||
defaultSelectedKeys?: Iterable<Key>; | ||
/** Handler that is called when the selection changes. */ | ||
onSelectionChange?: (keys: Set<Key>) => void; | ||
/** Whether all items are disabled. */ | ||
isDisabled?: boolean; | ||
} | ||
export interface ToggleGroupState { | ||
/** Whether single or multiple selection is enabled. */ | ||
readonly selectionMode: 'single' | 'multiple'; | ||
/** Whether all items are disabled. */ | ||
readonly isDisabled: boolean; | ||
/** A set of keys for items that are selected. */ | ||
readonly selectedKeys: Set<Key>; | ||
/** Toggles the selected state for an item by its key. */ | ||
toggleKey(key: Key): void; | ||
/** Sets whether the given key is selected. */ | ||
setSelected(key: Key, isSelected: boolean): void; | ||
/** Replaces the set of selected keys. */ | ||
setSelectedKeys(keys: Set<Key>): void; | ||
} | ||
/** | ||
* Manages state for a group of toggles. | ||
* It supports both single and multiple selected items. | ||
*/ | ||
export function useToggleGroupState(props: ToggleGroupProps): ToggleGroupState; | ||
export type { ToggleProps } from '@react-types/checkbox'; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-stately/toggle", | ||
"version": "3.0.0-nightly-fb28ab3b4-241024", | ||
"version": "3.0.0-nightly-fee532d6a-241217", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,13 +25,13 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/utils": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-types/checkbox": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-stately/utils": "3.0.0-nightly-fee532d6a-241217", | ||
"@react-types/checkbox": "3.0.0-nightly-fee532d6a-241217", | ||
"@react-types/shared": "3.0.0-nightly-fee532d6a-241217", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.7.8" | ||
} | ||
} |
@@ -14,4 +14,6 @@ /* | ||
export {useToggleState} from './useToggleState'; | ||
export {useToggleGroupState} from './useToggleGroupState'; | ||
export type {ToggleProps} from '@react-types/checkbox'; | ||
export type {ToggleState, ToggleStateOptions} from './useToggleState'; | ||
export type {ToggleGroupProps, ToggleGroupState} from './useToggleGroupState'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
41730
22
468
5
6
+ Added@react-stately/utils@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/checkbox@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/shared@3.0.0-nightly-fee532d6a-241217(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/checkbox@3.9.0(transitive)
- Removed@react-types/shared@3.26.0(transitive)