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

@headless-react/select

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headless-react/select - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

2

lib/context.d.ts

@@ -5,4 +5,4 @@ import { MutableRefObject } from 'react';

import { SelectState } from '@react-stately/select';
import { MultiSelectState } from './hooks/useMultiSelectState';
import { Item } from '@headless-react/shared';
import { MultiSelectState } from './types';
export declare type SingleState = SelectState<Item>;

@@ -9,0 +9,0 @@ export declare type MultiState = MultiSelectState<Item>;

@@ -1,8 +0,3 @@

import { AriaHiddenSelectProps } from '@react-aria/select';
import { ChangeEvent, RefObject } from 'react';
import { MultiSelectState } from './useMultiSelectState';
export interface MultiHiddenSelectProps<T> extends AriaHiddenSelectProps {
state: MultiSelectState<T>;
triggerRef: RefObject<HTMLElement>;
}
import { MultiHiddenSelectProps, MultiSelectState } from '../types';
export declare function useMultiHiddenSelect<T>(props: MultiHiddenSelectProps<T>, state: MultiSelectState<T>, triggerRef: RefObject<HTMLElement>): {

@@ -9,0 +4,0 @@ containerProps: {

import { RefObject } from 'react';
import { SingleSelection, MultipleSelection } from '@react-types/shared';
import { MultiSelectState } from './useMultiSelectState';
import { AriaSelectOptions, SelectAria } from '@react-aria/select';
export interface AriaMultiSelectOptions<T> extends Omit<AriaSelectOptions<T>, keyof SingleSelection>, MultipleSelection {
}
import { SelectAria } from '@react-aria/select';
import { AriaMultiSelectOptions, MultiSelectState } from '../types';
export declare function useMultiSelect<T>(props: AriaMultiSelectOptions<T>, state: MultiSelectState<T>, ref: RefObject<HTMLElement>): SelectAria<T>;

@@ -1,15 +0,2 @@

import { Node, MultipleSelection, Selection, SingleSelection } from '@react-types/shared';
import { SelectProps } from '@react-types/select';
import { MenuTriggerState } from '@react-stately/menu';
import { ListState } from '@react-stately/list';
export interface MultiSelectProps<T> extends Omit<SelectProps<T>, keyof SingleSelection>, Omit<MultipleSelection, 'disallowEmptySelection'> {
closeOnSelect?: boolean;
}
export interface MultiSelectState<T> extends ListState<T>, MenuTriggerState {
readonly isFocused: boolean;
setFocused(isFocused: boolean): void;
readonly selectedKeys: Selection;
setSelectedKeys(keys: Selection): void;
readonly selectedItems: Node<T>[];
}
import { MultiSelectProps, MultiSelectState } from '../types';
export declare function useMultiSelectState<T extends object>(props: MultiSelectProps<T>): MultiSelectState<T>;
import { SelectPopoverTriggerProps } from './types';
import { MultiState, SingleState } from './context';
export declare const Select: ((props: import("./types").SelectProps) => JSX.Element) & {
export declare const Select: ((props: import("./types").SelectRootProps) => JSX.Element) & {
Label: (props: import("./types").SelectLabelProps) => JSX.Element;

@@ -14,3 +14,3 @@ Popover: (props: import("./types").SelectMenuProps) => JSX.Element | null;

};
export declare const MultiSelect: ((props: import("./types").MultiSelectProps) => JSX.Element) & {
export declare const MultiSelect: ((props: import("./types").MultiSelectRootProps) => JSX.Element) & {
Label: (props: import("./types").SelectLabelProps) => JSX.Element;

@@ -17,0 +17,0 @@ Popover: (props: import("./types").SelectMenuProps) => JSX.Element | null;

@@ -1,2 +0,2 @@

import { MultiSelectProps } from './types';
export declare const MultiSelect: (props: MultiSelectProps) => JSX.Element;
import { MultiSelectRootProps } from './types';
export declare const MultiSelect: (props: MultiSelectRootProps) => JSX.Element;

@@ -1,2 +0,2 @@

import { SelectProps } from './types';
export declare const Select: (props: SelectProps) => JSX.Element;
import { SelectRootProps } from './types';
export declare const Select: (props: SelectRootProps) => JSX.Element;
declare const _default: {
title: string;
component: ((props: import("../types").SelectProps) => JSX.Element) & {
component: ((props: import("../types").SelectRootProps) => JSX.Element) & {
Label: (props: import("../types").SelectLabelProps) => JSX.Element;

@@ -5,0 +5,0 @@ Popover: (props: import("../types").SelectMenuProps) => JSX.Element | null;

@@ -1,9 +0,27 @@

import { ReactNode, HTMLAttributes } from 'react';
import { AriaSelectProps } from '@react-types/select';
import { ReactNode, HTMLAttributes, RefObject } from 'react';
import { AriaSelectProps, SelectProps } from '@react-types/select';
import { AriaButtonProps } from '@react-types/button';
import { Node } from '@react-types/shared';
import { Node, SingleSelection, MultipleSelection, Selection } from '@react-types/shared';
import { Item } from '@headless-react/shared';
import { AriaMultiSelectOptions } from './hooks/useMultiSelect';
import { MultiState, SingleState } from './context';
export interface MultiSelectProps extends Omit<AriaMultiSelectOptions<Item>, 'children'> {
import { AriaHiddenSelectProps, AriaSelectOptions } from '@react-aria/select';
import { MenuTriggerState } from '@react-stately/menu';
import { ListState } from '@react-stately/list';
export interface MultiSelectProps<T> extends Omit<SelectProps<T>, keyof SingleSelection>, Omit<MultipleSelection, 'disallowEmptySelection'> {
closeOnSelect?: boolean;
}
export interface MultiSelectState<T> extends ListState<T>, MenuTriggerState {
readonly isFocused: boolean;
setFocused(isFocused: boolean): void;
readonly selectedKeys: Selection;
setSelectedKeys(keys: Selection): void;
readonly selectedItems: Node<T>[];
}
export interface AriaMultiSelectOptions<T> extends Omit<AriaSelectOptions<T>, keyof SingleSelection>, MultipleSelection {
}
export interface MultiHiddenSelectProps<T> extends AriaHiddenSelectProps {
state: MultiSelectState<T>;
triggerRef: RefObject<HTMLElement>;
}
export interface MultiSelectRootProps extends Omit<AriaMultiSelectOptions<Item>, 'children'> {
children?: ReactNode;

@@ -15,3 +33,3 @@ label?: string;

}
export interface SelectProps extends Omit<AriaSelectProps<Item>, 'children'> {
export interface SelectRootProps extends Omit<AriaSelectProps<Item>, 'children'> {
children?: ReactNode;

@@ -18,0 +36,0 @@ label?: string;

{
"name": "@headless-react/select",
"description": "Headless React components using react-stately and react-aria",
"version": "0.0.11",
"version": "0.0.12",
"source": "src/index.ts",

@@ -40,3 +40,3 @@ "main": "lib/index.cjs.js",

"dependencies": {
"@headless-react/shared": "^0.0.11",
"@headless-react/shared": "^0.0.12",
"@react-aria/button": "^3.5.1",

@@ -56,3 +56,3 @@ "@react-aria/focus": "^3.6.1",

},
"gitHead": "b14f15489c830ac9d64b7be8261e3f812c159783"
"gitHead": "74a538946681214797db529c96e2270d653981a3"
}

@@ -35,2 +35,3 @@ /* eslint-disable no-undef */

})
export * from './types'

@@ -1,10 +0,44 @@

import { ReactNode, HTMLAttributes } from 'react'
import { AriaSelectProps } from '@react-types/select'
import { ReactNode, HTMLAttributes, RefObject } from 'react'
import { AriaSelectProps, SelectProps } from '@react-types/select'
import { AriaButtonProps } from '@react-types/button'
import { Node } from '@react-types/shared'
import { Node, SingleSelection, MultipleSelection, Selection } from '@react-types/shared'
import { Item } from '@headless-react/shared'
import { AriaMultiSelectOptions } from './hooks/useMultiSelect'
import { MultiState, SingleState } from './context'
import { AriaHiddenSelectProps, AriaSelectOptions } from '@react-aria/select'
import { MenuTriggerState } from '@react-stately/menu'
import { ListState } from '@react-stately/list'
export interface MultiSelectProps extends Omit<AriaMultiSelectOptions<Item>, 'children'> {
export interface MultiSelectProps<T>
extends Omit<SelectProps<T>, keyof SingleSelection>, Omit<MultipleSelection, 'disallowEmptySelection'> {
/**
* Whether the menu should be closed on select.
* @default false
*/
closeOnSelect?: boolean
}
export interface MultiSelectState<T> extends ListState<T>, MenuTriggerState {
/** Whether the select is currently focused. */
readonly isFocused: boolean
/** Sets whether the select is focused. */
setFocused(isFocused: boolean): void
/** The key for the currently selected item. */
readonly selectedKeys: Selection
/** Sets the selected keys. */
setSelectedKeys(keys: Selection): void
/** The value of the currently selected item. */
readonly selectedItems: Node<T>[]
}
export interface AriaMultiSelectOptions<T> extends Omit<AriaSelectOptions<T>, keyof SingleSelection>, MultipleSelection {}
export interface MultiHiddenSelectProps<T> extends AriaHiddenSelectProps {
/** State for the select. */
state: MultiSelectState<T>,
/** A ref to the trigger element. */
triggerRef: RefObject<HTMLElement>
}
export interface MultiSelectRootProps extends Omit<AriaMultiSelectOptions<Item>, 'children'> {
children?: ReactNode

@@ -16,3 +50,3 @@ label?: string

}
export interface SelectProps extends Omit<AriaSelectProps<Item>, 'children'> {
export interface SelectRootProps extends Omit<AriaSelectProps<Item>, 'children'> {
children?: ReactNode

@@ -19,0 +53,0 @@ label?: string

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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

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