Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-stately/toggle

Package Overview
Dependencies
Maintainers
2
Versions
802
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-stately/toggle - npm Package Compare versions

Comparing version 3.0.0-nightly-69109f003-241018 to 3.0.0-nightly-694fc853e-241108

dist/useToggleGroupState.main.js

3

dist/main.js
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

4

dist/module.js
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-69109f003-241018",
"version": "3.0.0-nightly-694fc853e-241108",
"description": "Spectrum UI components in React",

@@ -25,4 +25,5 @@ "license": "Apache-2.0",

"dependencies": {
"@react-stately/utils": "^3.0.0-nightly-69109f003-241018",
"@react-types/checkbox": "^3.0.0-nightly-69109f003-241018",
"@react-stately/utils": "^3.0.0-nightly-694fc853e-241108",
"@react-types/checkbox": "^3.0.0-nightly-694fc853e-241108",
"@react-types/shared": "^3.0.0-nightly-694fc853e-241108",
"@swc/helpers": "^0.5.0"

@@ -29,0 +30,0 @@ },

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc