@strapi/ui-primitives 1.7.0-alpha.0 → 1.7.0-alpha.1
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/dist/components/Collection/Collection.d.ts +34 -0
- package/dist/components/Collection/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +96 -0
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +163 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/hooks/useCollator.d.ts +9 -0
- package/dist/hooks/useFilter.d.ts +16 -0
- package/dist/hooks/usePrev.d.ts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1449 -0
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An internal fork of Radix UI's `Collection` component.
|
|
3
|
+
*
|
|
4
|
+
* We've added a subscription API to allow us to subscribe to changes in the collection via the useCollection hook.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import type * as Radix from '@radix-ui/react-primitive';
|
|
8
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
9
|
+
type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
|
|
10
|
+
interface CollectionProps extends SlotProps {
|
|
11
|
+
scope: any;
|
|
12
|
+
}
|
|
13
|
+
declare function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
|
|
14
|
+
readonly Provider: React.FC<{
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
scope: any;
|
|
17
|
+
}>;
|
|
18
|
+
readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
scope: any;
|
|
22
|
+
}> & React.RefAttributes<ItemElement>>;
|
|
23
|
+
}, (scope: any) => {
|
|
24
|
+
getItems: () => ({
|
|
25
|
+
ref: React.RefObject<ItemElement>;
|
|
26
|
+
} & ItemData)[];
|
|
27
|
+
subscribe: (listener: (newState: ({
|
|
28
|
+
ref: React.RefObject<ItemElement>;
|
|
29
|
+
} & ItemData)[], prevState: ({
|
|
30
|
+
ref: React.RefObject<ItemElement>;
|
|
31
|
+
} & ItemData)[]) => void) => () => boolean;
|
|
32
|
+
}, import("@radix-ui/react-context").CreateScope];
|
|
33
|
+
export { createCollection };
|
|
34
|
+
export type { CollectionProps };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
3
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
4
|
+
import { Portal as PortalPrimitive } from '@radix-ui/react-portal';
|
|
5
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
+
import type { ComponentPropsWithoutRef } from '@radix-ui/react-primitive';
|
|
7
|
+
interface RootProps {
|
|
8
|
+
allowCustomValue?: boolean;
|
|
9
|
+
autocomplete?: 'none' | 'list' | 'both';
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
defaultTextValue?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
locale?: string;
|
|
16
|
+
onOpenChange?(open: boolean): void;
|
|
17
|
+
onValueChange?(value: string): void;
|
|
18
|
+
onTextValueChange?(textValue: string): void;
|
|
19
|
+
textValue?: string;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
value?: string;
|
|
23
|
+
defaultFilterValue?: string;
|
|
24
|
+
filterValue?: string;
|
|
25
|
+
onFilterValueChange?(value: string): void;
|
|
26
|
+
}
|
|
27
|
+
type TriggerProps = PrimitiveDivProps;
|
|
28
|
+
interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
29
|
+
}
|
|
30
|
+
type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
31
|
+
interface IconProps extends PrimitiveButtonProps {
|
|
32
|
+
}
|
|
33
|
+
type IPortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;
|
|
34
|
+
interface PortalProps extends Omit<IPortalProps, 'asChild'> {
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
type ContentProps = ComboboxContentImplProps;
|
|
38
|
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
39
|
+
type ComboboxPopperPrivateProps = {
|
|
40
|
+
onPlaced?: PopperContentProps['onPlaced'];
|
|
41
|
+
};
|
|
42
|
+
interface ComboboxContentImplProps extends Omit<ComboboxPopperPositionProps, keyof ComboboxPopperPrivateProps> {
|
|
43
|
+
/**
|
|
44
|
+
* Event handler called when the escape key is down.
|
|
45
|
+
* Can be prevented.
|
|
46
|
+
*/
|
|
47
|
+
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
|
48
|
+
/**
|
|
49
|
+
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
|
50
|
+
* Can be prevented.
|
|
51
|
+
*/
|
|
52
|
+
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
|
53
|
+
}
|
|
54
|
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
55
|
+
interface ComboboxPopperPositionProps extends PopperContentProps, ComboboxPopperPrivateProps {
|
|
56
|
+
}
|
|
57
|
+
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
58
|
+
interface ViewportProps extends PrimitiveDivProps {
|
|
59
|
+
}
|
|
60
|
+
interface ItemProps extends PrimitiveDivProps {
|
|
61
|
+
value: string;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
textValue?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const ComboboxItem: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
type PrimitiveSpanProps = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
67
|
+
type ItemTextProps = PrimitiveSpanProps;
|
|
68
|
+
interface ItemIndicatorProps extends PrimitiveSpanProps {
|
|
69
|
+
}
|
|
70
|
+
interface NoValueFoundProps extends PrimitiveDivProps {
|
|
71
|
+
}
|
|
72
|
+
interface CreateItemProps extends PrimitiveDivProps {
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
}
|
|
75
|
+
declare const Root: React.FC<RootProps>;
|
|
76
|
+
declare const Trigger: React.ForwardRefExoticComponent<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
77
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
78
|
+
} & {
|
|
79
|
+
asChild?: boolean | undefined;
|
|
80
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
82
|
+
declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLButtonElement>>;
|
|
83
|
+
declare const Portal: React.FC<PortalProps>;
|
|
84
|
+
declare const Content: React.ForwardRefExoticComponent<ComboboxContentImplProps & React.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
declare const Viewport: React.ForwardRefExoticComponent<ViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
86
|
+
declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
87
|
+
declare const ItemText: React.ForwardRefExoticComponent<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
88
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
89
|
+
} & {
|
|
90
|
+
asChild?: boolean | undefined;
|
|
91
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLSpanElement>> & React.RefAttributes<HTMLSpanElement>>;
|
|
92
|
+
declare const ItemIndicator: React.ForwardRefExoticComponent<ItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
93
|
+
declare const NoValueFound: React.ForwardRefExoticComponent<NoValueFoundProps & React.RefAttributes<HTMLDivElement>>;
|
|
94
|
+
declare const CreateItem: React.ForwardRefExoticComponent<CreateItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
95
|
+
export { Root, Trigger, TextInput, Icon, Portal, Content, Viewport, Item, ItemText, ItemIndicator, NoValueFound, CreateItem, };
|
|
96
|
+
export type { RootProps, TriggerProps, TextInputProps, IconProps, PortalProps, ContentProps, ViewportProps, ItemProps, ItemTextProps, ItemIndicatorProps, NoValueFoundProps, CreateItemProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Combobox from './Combobox';
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We've forked this from RadixUI to add primarily support for multi-select.
|
|
3
|
+
* This is on their roadmap – https://github.com/radix-ui/primitives/issues/1193
|
|
4
|
+
*
|
|
5
|
+
* The changes are dotted around the codebase but all linked to a primary objective:
|
|
6
|
+
* 1. The Select `value` can now be a string or an array of strings
|
|
7
|
+
* 2. The Select `onValueChange` callback now receives a string or an array of strings
|
|
8
|
+
*
|
|
9
|
+
* Therefore, anywhere you see code handling values. It will accept and manage `string | string[]`,
|
|
10
|
+
* thankfully Typescript is very helpful with this.
|
|
11
|
+
*
|
|
12
|
+
* Hopefully in the future we can remove this fork ✌🏼
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
16
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
17
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
18
|
+
import { Portal as PortalPrimitive } from '@radix-ui/react-portal';
|
|
19
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
20
|
+
import type * as Radix from '@radix-ui/react-primitive';
|
|
21
|
+
type Direction = 'ltr' | 'rtl';
|
|
22
|
+
declare const createSelectScope: import("@radix-ui/react-context").CreateScope;
|
|
23
|
+
interface SharedSelectProps {
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
open?: boolean;
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
onOpenChange?(open: boolean): void;
|
|
28
|
+
dir?: Direction;
|
|
29
|
+
name?: string;
|
|
30
|
+
autoComplete?: string;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
required?: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface SingleSelectProps extends SharedSelectProps {
|
|
35
|
+
onValueChange?(value: string): void;
|
|
36
|
+
value?: string;
|
|
37
|
+
defaultValue?: string;
|
|
38
|
+
multi?: false;
|
|
39
|
+
}
|
|
40
|
+
interface MultiSelectProps extends SharedSelectProps {
|
|
41
|
+
onValueChange?(value: string[]): void;
|
|
42
|
+
value?: string[];
|
|
43
|
+
defaultValue?: string[];
|
|
44
|
+
multi: true;
|
|
45
|
+
}
|
|
46
|
+
type SelectProps = SingleSelectProps | MultiSelectProps;
|
|
47
|
+
declare const Select: React.FC<SelectProps>;
|
|
48
|
+
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
49
|
+
interface SelectTriggerProps extends PrimitiveButtonProps {
|
|
50
|
+
}
|
|
51
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
53
|
+
type SelectValueRenderFn = {
|
|
54
|
+
({ value, textValue }: {
|
|
55
|
+
value?: string;
|
|
56
|
+
textValue?: string;
|
|
57
|
+
}): React.ReactNode;
|
|
58
|
+
(value?: string): React.ReactNode;
|
|
59
|
+
};
|
|
60
|
+
interface SelectValueProps extends Omit<PrimitiveSpanProps, 'placeholder' | 'children'> {
|
|
61
|
+
placeholder?: React.ReactNode;
|
|
62
|
+
children?: React.ReactNode | SelectValueRenderFn;
|
|
63
|
+
}
|
|
64
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
65
|
+
interface SelectIconProps extends PrimitiveSpanProps {
|
|
66
|
+
}
|
|
67
|
+
declare const SelectIcon: React.ForwardRefExoticComponent<SelectIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
68
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;
|
|
69
|
+
interface SelectPortalProps extends Omit<PortalProps, 'asChild'> {
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
}
|
|
72
|
+
declare const SelectPortal: React.FC<SelectPortalProps>;
|
|
73
|
+
interface SelectContentProps extends SelectContentImplProps {
|
|
74
|
+
}
|
|
75
|
+
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
77
|
+
type FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
78
|
+
type SelectPopperPrivateProps = {
|
|
79
|
+
onPlaced?: PopperContentProps['onPlaced'];
|
|
80
|
+
};
|
|
81
|
+
interface SelectContentImplProps extends Omit<SelectPopperPositionProps, keyof SelectPopperPrivateProps>, Omit<SelectItemAlignedPositionProps, keyof SelectPopperPrivateProps> {
|
|
82
|
+
/**
|
|
83
|
+
* Event handler called when auto-focusing on close.
|
|
84
|
+
* Can be prevented.
|
|
85
|
+
*/
|
|
86
|
+
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
87
|
+
/**
|
|
88
|
+
* Event handler called when the escape key is down.
|
|
89
|
+
* Can be prevented.
|
|
90
|
+
*/
|
|
91
|
+
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
|
|
92
|
+
/**
|
|
93
|
+
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
|
94
|
+
* Can be prevented.
|
|
95
|
+
*/
|
|
96
|
+
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
|
|
97
|
+
position?: 'item-aligned' | 'popper';
|
|
98
|
+
}
|
|
99
|
+
interface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps {
|
|
100
|
+
}
|
|
101
|
+
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
102
|
+
interface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps {
|
|
103
|
+
}
|
|
104
|
+
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
105
|
+
interface SelectViewportProps extends PrimitiveDivProps {
|
|
106
|
+
}
|
|
107
|
+
declare const SelectViewport: React.ForwardRefExoticComponent<SelectViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
interface SelectGroupProps extends PrimitiveDivProps {
|
|
109
|
+
}
|
|
110
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
111
|
+
interface SelectLabelProps extends PrimitiveDivProps {
|
|
112
|
+
}
|
|
113
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<SelectLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
114
|
+
interface SelectItemProps extends PrimitiveDivProps {
|
|
115
|
+
value: string | string[];
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
textValue?: string;
|
|
118
|
+
}
|
|
119
|
+
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
120
|
+
interface SelectItemTextProps extends PrimitiveSpanProps {
|
|
121
|
+
}
|
|
122
|
+
declare const SelectItemText: React.ForwardRefExoticComponent<SelectItemTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
123
|
+
interface SelectItemIndicatorProps extends Omit<PrimitiveSpanProps, 'children'> {
|
|
124
|
+
children?: React.ReactNode | ((state: {
|
|
125
|
+
isSelected: boolean;
|
|
126
|
+
isIntermediate: boolean;
|
|
127
|
+
}) => React.ReactNode);
|
|
128
|
+
}
|
|
129
|
+
declare const SelectItemIndicator: React.ForwardRefExoticComponent<SelectItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
130
|
+
interface SelectScrollUpButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {
|
|
131
|
+
}
|
|
132
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
133
|
+
interface SelectScrollDownButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {
|
|
134
|
+
}
|
|
135
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
136
|
+
interface SelectScrollButtonImplProps extends PrimitiveDivProps {
|
|
137
|
+
onAutoScroll(): void;
|
|
138
|
+
}
|
|
139
|
+
interface SelectSeparatorProps extends PrimitiveDivProps {
|
|
140
|
+
}
|
|
141
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<SelectSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
+
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
143
|
+
interface SelectArrowProps extends PopperArrowProps {
|
|
144
|
+
}
|
|
145
|
+
declare const SelectArrow: React.ForwardRefExoticComponent<SelectArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
146
|
+
declare const Root: React.FC<SelectProps>;
|
|
147
|
+
declare const Trigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
148
|
+
declare const Value: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
149
|
+
declare const Icon: React.ForwardRefExoticComponent<SelectIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
150
|
+
declare const Portal: React.FC<SelectPortalProps>;
|
|
151
|
+
declare const Content: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
152
|
+
declare const Viewport: React.ForwardRefExoticComponent<SelectViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
153
|
+
declare const Group: React.ForwardRefExoticComponent<SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
154
|
+
declare const Label: React.ForwardRefExoticComponent<SelectLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
declare const Item: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
156
|
+
declare const ItemText: React.ForwardRefExoticComponent<SelectItemTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
157
|
+
declare const ItemIndicator: React.ForwardRefExoticComponent<SelectItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
158
|
+
declare const ScrollUpButton: React.ForwardRefExoticComponent<SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
159
|
+
declare const ScrollDownButton: React.ForwardRefExoticComponent<SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
160
|
+
declare const Separator: React.ForwardRefExoticComponent<SelectSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
161
|
+
declare const Arrow: React.ForwardRefExoticComponent<SelectArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
162
|
+
export { createSelectScope, Select, SelectTrigger, SelectValue, SelectIcon, SelectPortal, SelectContent, SelectViewport, SelectGroup, SelectLabel, SelectItem, SelectItemText, SelectItemIndicator, SelectScrollUpButton, SelectScrollDownButton, SelectSeparator, SelectArrow, Root, Trigger, Value, Icon, Portal, Content, Viewport, Group, Label, Item, ItemText, ItemIndicator, ScrollUpButton, ScrollDownButton, Separator, Arrow, };
|
|
163
|
+
export type { SingleSelectProps, MultiSelectProps, SelectProps, SelectTriggerProps, SelectValueProps, SelectValueRenderFn, SelectIconProps, SelectPortalProps, SelectContentProps, SelectViewportProps, SelectGroupProps, SelectLabelProps, SelectItemProps, SelectItemTextProps, SelectItemIndicatorProps, SelectScrollUpButtonProps, SelectScrollDownButtonProps, SelectSeparatorProps, SelectArrowProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Select from './Select';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stolen from @react-aria/i18n
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Provides localized string collation for the current locale. Automatically updates when the locale changes,
|
|
6
|
+
* and handles caching of the collator for performance.
|
|
7
|
+
* @param options - Collator options.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCollator(locale: string, options?: Intl.CollatorOptions): Intl.Collator;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stolen from @react-aria/i18n
|
|
3
|
+
*/
|
|
4
|
+
export interface Filter {
|
|
5
|
+
/** Returns whether a string starts with a given substring. */
|
|
6
|
+
startsWith(string: string, substring: string): boolean;
|
|
7
|
+
/** Returns whether a string ends with a given substring. */
|
|
8
|
+
endsWith(string: string, substring: string): boolean;
|
|
9
|
+
/** Returns whether a string contains a given substring. */
|
|
10
|
+
contains(string: string, substring: string): boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Provides localized string search functionality that is useful for filtering or matching items
|
|
14
|
+
* in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useFilter(locale: string, options?: Intl.CollatorOptions): Filter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePrev: <T>(value: T) => T | undefined;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Tt=require("react"),E=require("@radix-ui/primitive"),M=require("@radix-ui/react-compose-refs"),ge=require("@radix-ui/react-context"),et=require("@radix-ui/react-dismissable-layer"),oe=require("@radix-ui/react-id"),Ne=require("@radix-ui/react-popper"),tt=require("@radix-ui/react-portal"),N=require("@radix-ui/react-primitive"),ie=require("@radix-ui/react-use-controllable-state"),ot=require("aria-hidden"),Pt=require("react-dom"),nt=require("react-remove-scroll"),u=require("react/jsx-runtime"),Ee=require("@radix-ui/react-slot"),Je=require("@radix-ui/number"),Rt=require("@radix-ui/react-collection"),Vt=require("@radix-ui/react-direction"),_t=require("@radix-ui/react-focus-guards"),Nt=require("@radix-ui/react-focus-scope"),At=require("@radix-ui/react-use-callback-ref"),Z=require("@radix-ui/react-use-layout-effect"),Mt=require("@radix-ui/react-use-previous"),Ot=require("@radix-ui/react-visually-hidden");function Ae(o){if(o&&o.__esModule)return o;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>o[e]})}}return s.default=o,Object.freeze(s)}const r=Ae(Tt),re=Ae(Ne),Me=Ae(Pt);let Ie=new Map;function jt(o,s){let e=o+(s?Object.entries(s).sort((n,l)=>n[0]<l[0]?-1:1).join():"");if(Ie.has(e))return Ie.get(e);let t=new Intl.Collator(o,s);return Ie.set(e,t),t}function Oe(o,s){let e=jt(o,{usage:"search",...s});return{startsWith(t,n){return n.length===0?!0:(t=t.normalize("NFC"),n=n.normalize("NFC"),e.compare(t.slice(0,n.length),n)===0)},endsWith(t,n){return n.length===0?!0:(t=t.normalize("NFC"),n=n.normalize("NFC"),e.compare(t.slice(-n.length),n)===0)},contains(t,n){if(n.length===0)return!0;t=t.normalize("NFC"),n=n.normalize("NFC");let l=0,i=n.length;for(;l+i<=t.length;l++){let c=t.slice(l,l+i);if(e.compare(n,c)===0)return!0}return!1}}}const Dt=o=>{const s=r.useRef();return r.useEffect(()=>{s.current=o}),s.current};function Lt(o){const s=`${o}CollectionProvider`,[e,t]=ge.createContextScope(s),[n,l]=e(s,{collectionRef:{current:null},itemMap:new Map,listeners:new Set}),i=d=>{const{scope:f,children:C}=d,g=r.useRef(null),v=r.useRef(new Map).current,h=r.useRef(new Set).current;return u.jsx(n,{scope:f,itemMap:v,collectionRef:g,listeners:h,children:C})};i.displayName=s;const c=`${o}CollectionSlot`,a=r.forwardRef((d,f)=>{const{scope:C,children:g}=d,v=l(c,C),h=M.useComposedRefs(f,v.collectionRef);return u.jsx(Ee.Slot,{ref:h,children:g})});a.displayName=c;const x=`${o}CollectionItemSlot`,p="data-radix-collection-item",b=r.forwardRef((d,f)=>{const{scope:C,children:g,...v}=d,h=r.useRef(null),y=M.useComposedRefs(f,h),A=l(x,C);return r.useEffect(()=>{const T=Array.from(A.itemMap.values());return A.itemMap.set(h,{ref:h,...v}),A.listeners.forEach(O=>O(Array.from(A.itemMap.values()),T)),()=>{const O=Array.from(A.itemMap.values());A.itemMap.delete(h),A.listeners.forEach(P=>P(Array.from(A.itemMap.values()),O))}}),u.jsx(Ee.Slot,{[p]:"",ref:y,children:g})});b.displayName=x;function m(d){const f=l(`${o}CollectionConsumer`,d),C=r.useCallback(()=>{const v=f.collectionRef.current;if(!v)return[];const h=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(f.itemMap.values()).sort((T,O)=>h.indexOf(T.ref.current)-h.indexOf(O.ref.current))},[f.collectionRef,f.itemMap]),g=r.useCallback(v=>(f.listeners.add(v),()=>f.listeners.delete(v)),[f.listeners]);return{getItems:C,subscribe:g}}return[{Provider:i,Slot:a,ItemSlot:b},m,t]}const kt=[" ","Enter","ArrowUp","ArrowDown"],Ft=["Enter"],Qe=o=>Boolean(o.length===1&&o.match(/\S| /)),rt="Combobox",[fe,ve]=Lt(rt),[Ht,G]=ge.createContext(rt),Bt=({children:o})=>u.jsx(re.Root,{children:u.jsx(fe.Provider,{scope:void 0,children:o})}),Ut=o=>{const{allowCustomValue:s=!1,autocomplete:e="none",children:t,open:n,defaultOpen:l,onOpenChange:i,value:c,defaultValue:a,onValueChange:x,disabled:p,required:b=!1,locale:m="en-EN",onTextValueChange:d,textValue:f,defaultTextValue:C,filterValue:g,defaultFilterValue:v,onFilterValueChange:h}=o,[y,A]=r.useState(null),[T,O]=r.useState(null),[P,D]=r.useState(null),[L,H]=r.useState(null),[W=!1,B]=ie.useControllableState({prop:n,defaultProp:l,onChange:i}),[q,U]=ie.useControllableState({prop:c,defaultProp:a,onChange:x}),[k,R]=ie.useControllableState({prop:f,defaultProp:C,onChange:d}),[F,$]=ie.useControllableState({prop:g,defaultProp:v,onChange:h}),K=oe.useId(),ue=r.useCallback((se,le)=>{const de=le.map(w=>w.ref.current),[X,...ce]=de,[Q]=ce.slice(-1),S=L;for(const w of se){if(w===S)return;if(w?.scrollIntoView({block:"nearest"}),w===X&&T&&(T.scrollTop=0),w===Q&&T&&(T.scrollTop=T.scrollHeight),H(w),e==="both"){const j=le.find(I=>I.ref.current===w);j&&R(j.textValue)}if(w!==S)return}},[e,R,T,L]);return r.useEffect(()=>{e!=="both"&&H(null)},[k,e]),r.useEffect(()=>{if(P&&y)return ot.hideOthers([P,y])},[P,y]),u.jsx(Bt,{children:u.jsx(Ht,{allowCustomValue:s,autocomplete:e,required:b,trigger:y,onTriggerChange:A,contentId:K,value:q,onValueChange:U,open:W,onOpenChange:B,disabled:p,locale:m,focusFirst:ue,textValue:k,onTextValueChange:R,onViewportChange:O,onContentChange:D,visuallyFocussedItem:L,filterValue:F,onFilterValueChange:$,onVisuallyFocussedItemChange:H,children:t})})},$t="ComboboxTrigger",qt=r.forwardRef((o,s)=>{const{...e}=o,t=G($t);return u.jsx(re.Anchor,{asChild:!0,children:u.jsx("div",{ref:s,"data-disabled":t.disabled?"":void 0,...e})})}),st="ComboboxInput",Kt=r.forwardRef((o,s)=>{const e=G(st),t=r.useRef(null),{getItems:n}=ve(void 0),{startsWith:l}=Oe(e.locale,{sensitivity:"base"}),i=e.disabled,c=M.useComposedRefs(t,s,e.onTriggerChange),a=()=>{i||e.onOpenChange(!0)},x=Dt(e.filterValue);return r.useLayoutEffect(()=>{setTimeout(()=>{if(e.textValue===""||e.textValue===void 0||e.filterValue===""||e.filterValue===void 0)return;const p=n().find(m=>m.type==="option"&&l(m.textValue,e.textValue)),b=So(x??"",e.filterValue);p&&!e.visuallyFocussedItem&&b===e.filterValue.length&&t.current.setSelectionRange(e.filterValue.length,e.textValue.length)})},[e.textValue,e.filterValue,l,e.visuallyFocussedItem,n,x]),u.jsx("input",{type:"text",role:"combobox","aria-controls":e.contentId,"aria-expanded":e.open,"aria-required":e.required,"aria-autocomplete":e.autocomplete,"data-state":e.open?"open":"closed","aria-disabled":i,"aria-activedescendant":e.visuallyFocussedItem?.id,disabled:i,"data-disabled":i?"":void 0,"data-placeholder":e.textValue===void 0?"":void 0,value:e.textValue??"",...o,ref:c,onClick:E.composeEventHandlers(o.onClick,p=>{p.currentTarget.focus()}),onPointerDown:E.composeEventHandlers(o.onPointerDown,p=>{p.button===0&&p.ctrlKey===!1&&(a(),p.currentTarget.focus())}),onKeyDown:E.composeEventHandlers(o.onKeyDown,p=>{if(["ArrowUp","ArrowDown","Home","End"].includes(p.key))setTimeout(()=>{let m=n().filter(d=>!d.disabled).map(d=>d.ref.current);if(["ArrowUp","End"].includes(p.key)&&(m=m.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const d=e.visuallyFocussedItem??p.target;let f=m.indexOf(d);f===m.length-1&&(f=-1),m=m.slice(f+1)}if(["ArrowDown"].includes(p.key)&&e.autocomplete==="both"&&m.length>1){const[d,...f]=m,C=n().find(g=>g.ref.current===d).textValue;e.textValue===C&&(m=f)}e.focusFirst(m,n())}),p.preventDefault();else if(["Escape"].includes(p.key))e.open?e.onOpenChange(!1):(e.onValueChange(void 0),e.onTextValueChange("")),p.preventDefault();else if(Ft.includes(p.key)){if(e.visuallyFocussedItem){const b=n().find(m=>m.ref.current===e.visuallyFocussedItem);b&&(e.onValueChange(b.value),e.onTextValueChange(b.textValue),e.autocomplete==="both"&&e.onFilterValueChange(b.textValue),b.ref.current?.click())}e.onOpenChange(!1),p.preventDefault()}else e.onVisuallyFocussedItemChange(null)}),onChange:E.composeEventHandlers(o.onChange,p=>{e.onTextValueChange(p.currentTarget.value),e.autocomplete==="both"&&e.onFilterValueChange(p.currentTarget.value)}),onKeyUp:E.composeEventHandlers(o.onKeyUp,p=>{if(!e.open&&(Qe(p.key)||["ArrowUp","ArrowDown","Home","End","Backspace"].includes(p.key))&&a(),e.autocomplete==="both"&&Qe(p.key)&&e.filterValue!==void 0){const b=e.filterValue,m=n().find(d=>l(d.textValue,b));m&&e.onTextValueChange(m.textValue)}}),onBlur:E.composeEventHandlers(o.onBlur,p=>{e.onVisuallyFocussedItemChange(null);const[b]=n().filter(d=>d.textValue===e.textValue&&d.type==="option");if(e.allowCustomValue){b&&(e.onValueChange(b.value),e.autocomplete==="both"&&e.onFilterValueChange(b.textValue));return}const[m]=n().filter(d=>d.value===e.value&&d.type==="option");b?e.onValueChange(b.value):m&&p.currentTarget.value!==""?(e.onTextValueChange(m.textValue),e.autocomplete==="both"&&e.onFilterValueChange(m.textValue)):(e.onValueChange(void 0),e.onTextValueChange(""))})})}),Wt=r.forwardRef((o,s)=>{const{children:e,...t}=o,n=G(st),l=n.disabled,i=()=>{l||(n.onOpenChange(!0),n.trigger?.focus())};return u.jsx(N.Primitive.button,{"aria-hidden":!0,type:"button","aria-disabled":l,"aria-controls":n.contentId,"aria-expanded":n.open,disabled:l,"data-disabled":l?"":void 0,...t,tabIndex:-1,ref:s,onClick:E.composeEventHandlers(t.onClick,()=>{n.trigger?.focus()}),onPointerDown:E.composeEventHandlers(t.onPointerDown,c=>{c.button===0&&c.ctrlKey===!1&&(i(),c.preventDefault())}),onKeyDown:E.composeEventHandlers(t.onKeyDown,c=>{kt.includes(c.key)&&(i(),c.preventDefault())}),children:e||"\u25BC"})}),zt="ComboboxPortal",lt=o=>u.jsx(tt.Portal,{asChild:!0,...o});lt.displayName=zt;const ct="ComboboxContent",Gt=r.forwardRef((o,s)=>{const e=G(ct),[t,n]=r.useState();if(r.useLayoutEffect(()=>{n(new DocumentFragment)},[]),!e.open){const l=t;return l?Me.createPortal(u.jsx(fe.Slot,{scope:void 0,children:u.jsx("div",{children:o.children})}),l):null}return u.jsx(Xt,{...o,ref:s})}),Yt=10,Xt=r.forwardRef((o,s)=>{const{onEscapeKeyDown:e,onPointerDownOutside:t,...n}=o,l=G(ct),i=M.useComposedRefs(s,a=>l.onContentChange(a)),{onOpenChange:c}=l;return r.useEffect(()=>{const a=()=>c(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[c]),u.jsx(nt.RemoveScroll,{allowPinchZoom:!0,children:u.jsx(et.DismissableLayer,{asChild:!0,onEscapeKeyDown:e,onPointerDownOutside:t,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>{l.onOpenChange(!1),l.trigger?.focus({preventScroll:!0})},children:u.jsx(Zt,{role:"listbox",id:l.contentId,"data-state":l.open?"open":"closed",onContextMenu:a=>a.preventDefault(),...n,ref:i,style:{display:"flex",flexDirection:"column",outline:"none",...n.style}})})})}),Zt=r.forwardRef((o,s)=>{const{align:e="start",collisionPadding:t=Yt,...n}=o;return u.jsx(re.Content,{...n,ref:s,align:e,collisionPadding:t,style:{boxSizing:"border-box",...n.style,"--radix-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-combobox-content-available-width":"var(--radix-popper-available-width)","--radix-combobox-content-available-height":"var(--radix-popper-available-height)","--radix-combobox-trigger-width":"var(--radix-popper-anchor-width)","--radix-combobox-trigger-height":"var(--radix-popper-anchor-height)"}})}),Jt="ComboboxViewport",Qt=r.forwardRef((o,s)=>{const e=G(Jt),t=M.useComposedRefs(s,e.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-combobox-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-combobox-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(fe.Slot,{scope:void 0,children:u.jsx(N.Primitive.div,{"data-radix-combobox-viewport":"",role:"presentation",...o,ref:t,style:{position:"relative",flex:1,overflow:"auto",...o.style}})})]})}),it="ComboboxItem",[eo,at]=ge.createContext(it),ut=r.forwardRef((o,s)=>{const{value:e,disabled:t=!1,textValue:n,...l}=o,i=r.useRef(null),c=M.useComposedRefs(s,i),{getItems:a}=ve(void 0),{onTextValueChange:x,textValue:p,visuallyFocussedItem:b,...m}=G(it),d=oe.useId(),[f,C]=r.useState(n??""),g=r.useMemo(()=>b===a().find(O=>O.ref.current===i.current)?.ref.current,[a,b]),v=m.value===e,h=()=>{t||(m.onValueChange(e),x(f),m.onOpenChange(!1),m.autocomplete==="both"&&m.onFilterValueChange(f),m.trigger?.focus({preventScroll:!0}))},{startsWith:y}=Oe(m.locale,{sensitivity:"base"}),A=r.useCallback(O=>{C(P=>P||(O?.textContent??"").trim())},[]);r.useEffect(()=>{v&&p===void 0&&f!==""&&x(f)},[f,v,p,x]);const T=oe.useId();return m.autocomplete==="list"&&f&&p&&!y(f,p)||m.autocomplete==="both"&&f&&m.filterValue&&!y(f,m.filterValue)?null:u.jsx(eo,{textId:d,onTextValueChange:A,isSelected:v,children:u.jsx(fe.ItemSlot,{scope:void 0,value:e,textValue:f,disabled:t,type:"option",children:u.jsx(N.Primitive.div,{role:"option","aria-labelledby":d,"data-highlighted":g?"":void 0,"aria-selected":v&&g,"data-state":v?"checked":"unchecked","aria-disabled":t||void 0,"data-disabled":t?"":void 0,tabIndex:t?void 0:-1,...l,id:T,ref:c,onPointerUp:E.composeEventHandlers(l.onPointerUp,h)})})})}),to="ComboboxItemText",oo=r.forwardRef((o,s)=>{const{className:e,style:t,...n}=o,l=at(to),i=M.useComposedRefs(s,l.onTextValueChange);return u.jsx(N.Primitive.span,{id:l.textId,...n,ref:i})}),no="ComboboxItemIndicator",ro=r.forwardRef((o,s)=>{const{isSelected:e}=at(no);return e?u.jsx(N.Primitive.span,{"aria-hidden":!0,...o,ref:s}):null}),dt="ComboboxNoValueFound",so=r.forwardRef((o,s)=>{const{textValue:e="",locale:t}=G(dt),[n,l]=r.useState([]),{subscribe:i}=ve(void 0),{startsWith:c}=Oe(t,{sensitivity:"base"});return r.useEffect(()=>{const a=i(x=>{l(x)});return()=>{a()}},[i]),n.some(a=>c(a.textValue,e))?null:u.jsx(N.Primitive.div,{...o,ref:s})}),lo=r.forwardRef((o,s)=>{const{disabled:e=!1,...t}=o,n=G(dt),{textValue:l,visuallyFocussedItem:i}=n,{getItems:c,subscribe:a}=ve(void 0),x=r.useRef(null),[p,b]=r.useState(!1),m=M.useComposedRefs(s,x),d=r.useMemo(()=>i===c().find(g=>g.ref.current===x.current)?.ref.current,[c,i]),f=oe.useId(),C=()=>{!e&&l&&(n.onValueChange(l),n.onTextValueChange(l),n.onOpenChange(!1),n.autocomplete==="both"&&n.onFilterValueChange(l),n.trigger?.focus({preventScroll:!0}))};return r.useLayoutEffect(()=>{const g=a(v=>{b(!v.some(h=>h.textValue===l&&h.type!=="create"))});return()=>{g()}},[l,a]),!l||!p?null:u.jsx(fe.ItemSlot,{scope:void 0,value:l??"",textValue:l??"",disabled:e,type:"create",children:u.jsx(N.Primitive.div,{role:"option",tabIndex:e?void 0:-1,"aria-disabled":e||void 0,"data-disabled":e?"":void 0,"data-highlighted":d?"":void 0,...t,id:f,ref:m,onPointerUp:E.composeEventHandlers(t.onPointerUp,C)})})}),co=Ut,io=qt,ao=Kt,uo=Wt,po=lt,fo=Gt,mo=Qt,ho=ut,xo=oo,go=ro,vo=so,Co=lo;function So(o,s){const e=Math.min(o.length,s.length);for(let t=0;t<e;t++)if(o[t]!==s[t])return t;return e}const bo=Object.freeze(Object.defineProperty({__proto__:null,ComboboxItem:ut,Root:co,Trigger:io,TextInput:ao,Icon:uo,Portal:po,Content:fo,Viewport:mo,Item:ho,ItemText:xo,ItemIndicator:go,NoValueFound:vo,CreateItem:Co},Symbol.toStringTag,{value:"Module"})),yo=[" ","Enter","ArrowUp","ArrowDown"],wo=[" ","Enter"],me="Select",[Ce,he,Io]=Rt.createCollection(me),[ae,Eo]=ge.createContextScope(me,[Io,Ne.createPopperScope]),Se=Ne.createPopperScope(),[To,Y]=ae(me),[Po,Ro]=ae(me),je=o=>{const{__scopeSelect:s,children:e,open:t,defaultOpen:n,onOpenChange:l,value:i,defaultValue:c,onValueChange:a,dir:x,name:p,autoComplete:b,disabled:m,required:d,multi:f=!1}=o,C=Se(s),[g,v]=r.useState(null),[h,y]=r.useState(null),[A,T]=r.useState(!1),O=Vt.useDirection(x),[P=!1,D]=ie.useControllableState({prop:t,defaultProp:n,onChange:l}),[L,H]=ie.useControllableState({prop:i,defaultProp:c,onChange(R){a&&(Array.isArray(R),a(R))}}),W=r.useRef(null),B=g?Boolean(g.closest("form")):!0,[q,U]=r.useState(new Set),k=Array.from(q).map(R=>R.props.value).join(";");return u.jsx(re.Root,{...C,children:u.jsxs(To,{required:d,scope:s,trigger:g,onTriggerChange:v,valueNode:h,onValueNodeChange:y,valueNodeHasChildren:A,onValueNodeHasChildrenChange:T,contentId:oe.useId(),value:L,onValueChange:H,open:P,onOpenChange:D,dir:O,triggerPointerDownPosRef:W,disabled:m,multi:f,children:[u.jsx(Ce.Provider,{scope:s,children:u.jsx(Po,{scope:o.__scopeSelect,onNativeOptionAdd:r.useCallback(R=>{U(F=>new Set(F).add(R))},[]),onNativeOptionRemove:r.useCallback(R=>{U(F=>{const $=new Set(F);return $.delete(R),$})},[]),children:e})}),B?u.jsxs(yt,{"aria-hidden":!0,required:d,tabIndex:-1,name:p,autoComplete:b,value:L,onChange:R=>H(R.target.value),disabled:m,children:[L===void 0?u.jsx("option",{value:""}):null,Array.from(q)]},k):null]})})};je.displayName=me;const pt="SelectTrigger",De=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=Se(e),l=Y(pt,e),i=l.disabled,c=M.useComposedRefs(s,l.onTriggerChange),a=he(e),[x,p,b]=wt(d=>{const f=a().filter(v=>!v.disabled),C=f.find(v=>v.value===l.value),g=It(f,d,C);if(g!==void 0&&!Array.isArray(g.value)){const v=l.multi?[g.value]:g.value;l.onValueChange(v)}}),m=()=>{i||(l.onOpenChange(!0),b())};return u.jsx(re.Anchor,{asChild:!0,...n,children:u.jsx(N.Primitive.div,{role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,"data-placeholder":l.value===void 0?"":void 0,tabIndex:i?void 0:0,...t,ref:c,onClick:E.composeEventHandlers(t.onClick,d=>{d.currentTarget.focus()}),onPointerDown:E.composeEventHandlers(t.onPointerDown,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&f.releasePointerCapture(d.pointerId),(f.closest("button")??f.closest("div"))===d.currentTarget&&d.button===0&&d.ctrlKey===!1&&(m(),l.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)},d.preventDefault())}),onKeyDown:E.composeEventHandlers(t.onKeyDown,d=>{const f=x.current!=="",C=d.ctrlKey||d.altKey||d.metaKey,g=d.target;(g.closest("button")??g.closest("div"))===d.currentTarget&&(!C&&d.key.length===1&&p(d.key),!(f&&d.key===" ")&&yo.includes(d.key)&&(m(),d.preventDefault()))})})})});De.displayName=pt;const ft="SelectValue",Le=r.forwardRef((o,s)=>{const{__scopeSelect:e,children:t,placeholder:n,...l}=o,i=Y(ft,e),{onValueNodeHasChildrenChange:c}=i,a=t!==void 0,x=M.useComposedRefs(s,i.onValueNodeChange),[p,b]=r.useState([]),m=he(e);Z.useLayoutEffect(()=>{c(a)},[c,a]),r.useLayoutEffect(()=>{if(Array.isArray(i.value)&&p.length!==i.value.length){const f=setTimeout(()=>{const C=m().filter(g=>Array.isArray(g.value)?!1:i.value?.includes(g.value));b(C)});return()=>{clearTimeout(f)}}},[i.value,m,p]);let d=t;if((i.value===void 0||i.value.length===0)&&n!==void 0)d=n;else if(typeof t=="function")if(Array.isArray(i.value)){const f=i.value.map(C=>{const g=p.find(v=>v.value===C);return g?t({value:C,textValue:g?.textValue}):null});d=f.every(C=>C===null)?n:f}else d=t(i.value);return u.jsx(N.Primitive.span,{...l,ref:x,children:d})});Le.displayName=ft;const Vo="SelectIcon",ke=r.forwardRef((o,s)=>{const{__scopeSelect:e,children:t,...n}=o;return u.jsx(N.Primitive.span,{"aria-hidden":!0,...n,ref:s,children:t||"\u25BC"})});ke.displayName=Vo;const _o="SelectPortal",Fe=o=>u.jsx(tt.Portal,{asChild:!0,...o});Fe.displayName=_o;const ne="SelectContent",He=r.forwardRef((o,s)=>{const e=Y(ne,o.__scopeSelect),[t,n]=r.useState();if(Z.useLayoutEffect(()=>{n(new DocumentFragment)},[]),!e.open){const l=t;return l?Me.createPortal(u.jsx(mt,{scope:o.__scopeSelect,children:u.jsx(Ce.Slot,{scope:o.__scopeSelect,children:u.jsx("div",{children:o.children})})}),l):null}return u.jsx(ht,{...o,ref:s})});He.displayName=ne;const z=10,[mt,J]=ae(ne),No="SelectContentImpl",ht=r.forwardRef((o,s)=>{const{__scopeSelect:e,position:t="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:i,side:c,sideOffset:a,align:x,alignOffset:p,arrowPadding:b,collisionBoundary:m,collisionPadding:d,sticky:f,hideWhenDetached:C,avoidCollisions:g,...v}=o,h=Y(ne,e),[y,A]=r.useState(null),[T,O]=r.useState(null),P=M.useComposedRefs(s,S=>A(S)),[D,L]=r.useState(null),[H,W]=r.useState(null),B=he(e),[q,U]=r.useState(!1),k=r.useRef(!1);r.useEffect(()=>{if(y)return ot.hideOthers(y)},[y]),_t.useFocusGuards();const R=r.useCallback(S=>{const[w,...j]=B().map(_=>_.ref.current),[I]=j.slice(-1),V=document.activeElement;for(const _ of S)if(_===V||(_?.scrollIntoView({block:"nearest"}),_===w&&T&&(T.scrollTop=0),_===I&&T&&(T.scrollTop=T.scrollHeight),_?.focus(),document.activeElement!==V))return},[B,T]),F=r.useCallback(()=>R([D,y]),[R,D,y]);r.useEffect(()=>{q&&F()},[q,F]);const{onOpenChange:$,triggerPointerDownPosRef:K}=h;r.useEffect(()=>{if(y){let S={x:0,y:0};const w=I=>{S={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},j=I=>{S.x<=10&&S.y<=10?I.preventDefault():y.contains(I.target)||$(!1),document.removeEventListener("pointermove",w),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",w),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",j,{capture:!0})}}},[y,$,K]),r.useEffect(()=>{const S=()=>$(!1);return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[$]);const[ue,se]=wt(S=>{const w=B().filter(V=>!V.disabled),j=w.find(V=>V.ref.current===document.activeElement),I=It(w,S,j);I&&setTimeout(()=>I.ref.current.focus())}),le=r.useCallback((S,w,j)=>{const I=!k.current&&!j;(h.value!==void 0&&h.value===w||I)&&(L(S),I&&(k.current=!0))},[h.value]),de=r.useCallback(()=>y?.focus(),[y]),X=r.useCallback((S,w,j)=>{const I=!k.current&&!j;(h.value!==void 0&&(Array.isArray(w)?w.every(_=>h.value?.includes(_)):h.value===w)||I)&&W(S)},[h.value]),ce=t==="popper"?Te:xt,Q=ce===Te?{side:c,sideOffset:a,align:x,alignOffset:p,arrowPadding:b,collisionBoundary:m,collisionPadding:d,sticky:f,hideWhenDetached:C,avoidCollisions:g}:{};return u.jsx(mt,{scope:e,content:y,viewport:T,onViewportChange:O,itemRefCallback:le,selectedItem:D,onItemLeave:de,itemTextRefCallback:X,focusSelectedItem:F,selectedItemText:H,position:t,isPositioned:q,searchRef:ue,children:u.jsx(nt.RemoveScroll,{as:Ee.Slot,allowPinchZoom:!0,children:u.jsx(Nt.FocusScope,{asChild:!0,trapped:h.open,onMountAutoFocus:S=>{S.preventDefault()},onUnmountAutoFocus:E.composeEventHandlers(n,S=>{h.trigger?.focus({preventScroll:!0}),S.preventDefault()}),children:u.jsx(et.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:S=>S.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:u.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed","aria-multiselectable":h.multi?"true":void 0,dir:h.dir,onContextMenu:S=>S.preventDefault(),...v,...Q,onPlaced:()=>U(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:E.composeEventHandlers(v.onKeyDown,S=>{const w=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!w&&S.key.length===1&&se(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let I=B().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(S.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const V=S.target,_=I.indexOf(V);I=I.slice(_+1)}setTimeout(()=>R(I)),S.preventDefault()}})})})})})})});ht.displayName=No;const Ao="SelectItemAlignedPosition",xt=r.forwardRef((o,s)=>{const{__scopeSelect:e,onPlaced:t,...n}=o,l=Y(ne,e),i=J(ne,e),[c,a]=r.useState(null),[x,p]=r.useState(null),b=M.useComposedRefs(s,P=>p(P)),m=he(e),d=r.useRef(!1),f=r.useRef(!0),{viewport:C,selectedItem:g,selectedItemText:v,focusSelectedItem:h}=i,y=r.useCallback(()=>{if(l.trigger&&l.valueNode&&c&&x&&C&&g&&v){const P=l.trigger.getBoundingClientRect(),D=x.getBoundingClientRect(),L=l.valueNode.getBoundingClientRect(),H=v.getBoundingClientRect();if(l.dir!=="rtl"){const V=H.left-D.left,_=L.left-V,ee=P.left-_,te=P.width+ee,be=Math.max(te,D.width),ye=window.innerWidth-z,we=Je.clamp(_,[z,ye-be]);c.style.minWidth=`${te}px`,c.style.left=`${we}px`}else{const V=D.right-H.right,_=window.innerWidth-L.right-V,ee=window.innerWidth-P.right-_,te=P.width+ee,be=Math.max(te,D.width),ye=window.innerWidth-z,we=Je.clamp(_,[z,ye-be]);c.style.minWidth=`${te}px`,c.style.right=`${we}px`}const W=m(),B=window.innerHeight-z*2,q=C.scrollHeight,U=window.getComputedStyle(x),k=parseInt(U.borderTopWidth,10),R=parseInt(U.paddingTop,10),F=parseInt(U.borderBottomWidth,10),$=parseInt(U.paddingBottom,10),K=k+R+q+$+F,ue=Math.min(g.offsetHeight*5,K),se=window.getComputedStyle(C),le=parseInt(se.paddingTop,10),de=parseInt(se.paddingBottom,10),X=P.top+P.height/2-z,ce=B-X,Q=g.offsetHeight/2,S=g.offsetTop+Q,w=k+R+S,j=K-w;if(w<=X){const V=g===W[W.length-1].ref.current;c.style.bottom=`${0}px`;const _=x.clientHeight-C.offsetTop-C.offsetHeight,ee=Math.max(ce,Q+(V?de:0)+_+F),te=w+ee;c.style.height=`${te}px`}else{const V=g===W[0].ref.current;c.style.top=`${0}px`;const ee=Math.max(X,k+C.offsetTop+(V?le:0)+Q)+j;c.style.height=`${ee}px`,C.scrollTop=w-X+C.offsetTop}c.style.margin=`${z}px 0`,c.style.minHeight=`${ue}px`,c.style.maxHeight=`${B}px`,t?.(),requestAnimationFrame(()=>d.current=!0)}},[m,l.trigger,l.valueNode,c,x,C,g,v,l.dir,t]);Z.useLayoutEffect(()=>y(),[y]);const[A,T]=r.useState();Z.useLayoutEffect(()=>{x&&T(window.getComputedStyle(x).zIndex)},[x]);const O=r.useCallback(P=>{P&&f.current===!0&&(y(),h?.(),f.current=!1)},[y,h]);return u.jsx(Oo,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:d,onScrollButtonChange:O,children:u.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:u.jsx(N.Primitive.div,{...n,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});xt.displayName=Ao;const Mo="SelectPopperPosition",Te=r.forwardRef((o,s)=>{const{__scopeSelect:e,align:t="start",collisionPadding:n=z,...l}=o,i=Se(e);return u.jsx(re.Content,{...i,...l,ref:s,align:t,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Te.displayName=Mo;const[Oo,Be]=ae(ne,{}),Pe="SelectViewport",Ue=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=J(Pe,e),l=Be(Pe,e),i=M.useComposedRefs(s,n.onViewportChange),c=r.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Ce.Slot,{scope:e,children:u.jsx(N.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...t,ref:i,style:{position:"relative",flex:1,overflow:"auto",...t.style},onScroll:E.composeEventHandlers(t.onScroll,a=>{const x=a.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=l;if(b?.current&&p){const m=Math.abs(c.current-x.scrollTop);if(m>0){const d=window.innerHeight-z*2,f=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),g=Math.max(f,C);if(g<d){const v=g+m,h=Math.min(d,v),y=v-h;p.style.height=`${h}px`,p.style.bottom==="0px"&&(x.scrollTop=y>0?y:0,p.style.justifyContent="flex-end")}}}c.current=x.scrollTop})})})]})});Ue.displayName=Pe;const gt="SelectGroup",[jo,Do]=ae(gt),$e=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=oe.useId();return u.jsx(jo,{scope:e,id:n,children:u.jsx(N.Primitive.div,{role:"group","aria-labelledby":n,...t,ref:s})})});$e.displayName=gt;const vt="SelectLabel",qe=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=Do(vt,e);return u.jsx(N.Primitive.div,{id:n.id,...t,ref:s})});qe.displayName=vt;const xe="SelectItem",[Lo,Ct]=ae(xe),Ke=r.forwardRef((o,s)=>{const{__scopeSelect:e,value:t,disabled:n=!1,textValue:l,...i}=o,c=Y(xe,e),a=J(xe,e),x=typeof t=="string"?Array.isArray(c.value)?c.value.includes(t):c.value===t:t.every(h=>c.value?.includes(h)),p=Array.isArray(c.value)&&Array.isArray(t)&&t.some(h=>c.value?.includes(h)),[b,m]=r.useState(l??""),[d,f]=r.useState(!1),C=M.useComposedRefs(s,h=>a.itemRefCallback?.(h,t,n)),g=oe.useId(),v=()=>{if(!n){let h=c.multi&&typeof t=="string"?[t]:t;p&&!x?c.onValueChange(h):Array.isArray(c.value)&&(h=Et(t,c.value)),c.onValueChange(h),c.multi||c.onOpenChange(!1)}};if(!c.multi&&Array.isArray(t))throw new Error("You can only pass an array of values in multi selects");return u.jsx(Lo,{scope:e,value:t,disabled:n,textId:g,isSelected:x,isIntermediate:p,onItemTextChange:r.useCallback(h=>{m(y=>y||(h?.textContent??"").trim())},[]),children:u.jsx(Ce.ItemSlot,{scope:e,value:t,disabled:n,textValue:b,children:u.jsx(N.Primitive.div,{role:"option","aria-labelledby":g,"data-highlighted":d?"":void 0,"aria-selected":c.multi?void 0:x&&d,"aria-checked":c.multi?x:void 0,"data-state":x?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...i,ref:C,onFocus:E.composeEventHandlers(i.onFocus,()=>f(!0)),onBlur:E.composeEventHandlers(i.onBlur,()=>f(!1)),onPointerUp:E.composeEventHandlers(i.onPointerUp,v),onPointerMove:E.composeEventHandlers(i.onPointerMove,h=>{n?a.onItemLeave?.():h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E.composeEventHandlers(i.onPointerLeave,h=>{h.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:E.composeEventHandlers(i.onKeyDown,h=>{a.searchRef?.current!==""&&h.key===" "||(wo.includes(h.key)&&v(),h.key===" "&&h.preventDefault())})})})})});Ke.displayName=xe;const pe="SelectItemText",We=r.forwardRef((o,s)=>{const{__scopeSelect:e,className:t,style:n,...l}=o,i=Y(pe,e),c=J(pe,e),a=Ct(pe,e),x=Ro(pe,e),[p,b]=r.useState(null),m=M.useComposedRefs(s,v=>b(v),a.onItemTextChange,v=>c.itemTextRefCallback?.(v,a.value,a.disabled)),d=p?.textContent,f=r.useMemo(()=>u.jsx("option",{value:a.value,disabled:a.disabled,children:d},Array.isArray(a.value)?a.value.join(";"):a.value),[a.disabled,a.value,d]),{onNativeOptionAdd:C,onNativeOptionRemove:g}=x;return Z.useLayoutEffect(()=>(C(f),()=>g(f)),[C,g,f]),u.jsxs(u.Fragment,{children:[u.jsx(N.Primitive.span,{id:a.textId,...l,ref:m}),a.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Me.createPortal(l.children,i.valueNode):null]})});We.displayName=pe;const St="SelectItemIndicator",ze=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=Ct(St,e);return typeof o.children=="function"?u.jsx(N.Primitive.span,{"aria-hidden":!0,...t,ref:s,children:o.children({isSelected:n.isSelected,isIntermediate:n.isIntermediate})}):n.isSelected?u.jsx(N.Primitive.span,{"aria-hidden":!0,...t,ref:s}):null});ze.displayName=St;const Re="SelectScrollUpButton",Ge=r.forwardRef((o,s)=>{const e=J(Re,o.__scopeSelect),t=Be(Re,o.__scopeSelect),[n,l]=r.useState(!1),i=M.useComposedRefs(s,t.onScrollButtonChange);return Z.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){const c=e.viewport,a=()=>{const x=c.scrollTop>0;l(x)};return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),n?u.jsx(bt,{...o,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:a}=e;c&&a&&(c.scrollTop-=a.offsetHeight)}}):null});Ge.displayName=Re;const Ve="SelectScrollDownButton",Ye=r.forwardRef((o,s)=>{const e=J(Ve,o.__scopeSelect),t=Be(Ve,o.__scopeSelect),[n,l]=r.useState(!1),i=M.useComposedRefs(s,t.onScrollButtonChange);return Z.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){const c=e.viewport,a=()=>{const x=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<x;l(p)};return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),n?u.jsx(bt,{...o,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:a}=e;c&&a&&(c.scrollTop+=a.offsetHeight)}}):null});Ye.displayName=Ve;const bt=r.forwardRef((o,s)=>{const{__scopeSelect:e,onAutoScroll:t,...n}=o,l=J("SelectScrollButton",e),i=r.useRef(null),c=he(e),a=r.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return r.useEffect(()=>()=>a(),[a]),Z.useLayoutEffect(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),u.jsx(N.Primitive.div,{"aria-hidden":!0,...n,ref:s,style:{flexShrink:0,...n.style},onPointerMove:E.composeEventHandlers(n.onPointerMove,()=>{l.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(t,50))}),onPointerLeave:E.composeEventHandlers(n.onPointerLeave,()=>{a()})})}),ko="SelectSeparator",Xe=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o;return u.jsx(N.Primitive.div,{"aria-hidden":!0,...t,ref:s})});Xe.displayName=ko;const _e="SelectArrow",Ze=r.forwardRef((o,s)=>{const{__scopeSelect:e,...t}=o,n=Se(e),l=Y(_e,e),i=J(_e,e);return l.open&&i.position==="popper"?u.jsx(re.Arrow,{...n,...t,ref:s}):null});Ze.displayName=_e;const Fo="BubbleSelect",yt=r.forwardRef((o,s)=>{const{value:e,...t}=o,n=r.useRef(null),l=M.useComposedRefs(s,n),i=Mt.usePrevious(e),c=Y(Fo,void 0);r.useEffect(()=>{const x=n.current,p=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(p,"value").set;if(i!==e&&m){const d=new Event("change",{bubbles:!0});m.call(x,e),x.dispatchEvent(d)}},[i,e]);let a=e;return c.multi&&!Array.isArray(e)&&(a=[]),u.jsx(Ot.VisuallyHidden,{asChild:!0,children:u.jsx("select",{...t,multiple:c.multi?!0:void 0,ref:l,defaultValue:a})})});yt.displayName="BubbleSelect";function wt(o){const s=At.useCallbackRef(o),e=r.useRef(""),t=r.useRef(0),n=r.useCallback(i=>{const c=e.current+i;s(c),function a(x){e.current=x,window.clearTimeout(t.current),x!==""&&(t.current=window.setTimeout(()=>a(""),1e3))}(c)},[s]),l=r.useCallback(()=>{e.current="",window.clearTimeout(t.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(t.current),[]),[e,n,l]}function It(o,s,e){const n=s.length>1&&Array.from(s).every(x=>x===s[0])?s[0]:s,l=e?o.indexOf(e):-1;let i=Ho(o,Math.max(l,0));n.length===1&&(i=i.filter(x=>x!==e));const a=i.find(x=>x.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==e?a:void 0}function Ho(o,s){return o.map((e,t)=>o[(s+t)%o.length])}const Et=(o,s=[])=>{if(Array.isArray(o))return o.reduce((t,n)=>Et(n,t),s);const e=s.indexOf(o);return e===-1?[...s,o]:[...s.slice(0,e),...s.slice(e+1)]},Bo=je,Uo=De,$o=Le,qo=ke,Ko=Fe,Wo=He,zo=Ue,Go=$e,Yo=qe,Xo=Ke,Zo=We,Jo=ze,Qo=Ge,en=Ye,tn=Xe,on=Ze,nn=Object.freeze(Object.defineProperty({__proto__:null,createSelectScope:Eo,Select:je,SelectTrigger:De,SelectValue:Le,SelectIcon:ke,SelectPortal:Fe,SelectContent:He,SelectViewport:Ue,SelectGroup:$e,SelectLabel:qe,SelectItem:Ke,SelectItemText:We,SelectItemIndicator:ze,SelectScrollUpButton:Ge,SelectScrollDownButton:Ye,SelectSeparator:Xe,SelectArrow:Ze,Root:Bo,Trigger:Uo,Value:$o,Icon:qo,Portal:Ko,Content:Wo,Viewport:zo,Group:Go,Label:Yo,Item:Xo,ItemText:Zo,ItemIndicator:Jo,ScrollUpButton:Qo,ScrollDownButton:en,Separator:tn,Arrow:on},Symbol.toStringTag,{value:"Module"}));exports.Combobox=bo;exports.Select=nn;
|
package/dist/index.d.ts
CHANGED