@plasmicapp/react-web 0.2.385 → 0.2.388

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/all.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as React$1 from 'react';
3
- import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties as CSSProperties$1, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$1, SyntheticEvent } from 'react';
3
+ import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$2, AriaRole, CSSProperties as CSSProperties$1, FocusEvent, KeyboardEvent as KeyboardEvent$3, SyntheticEvent, ReactNode, ReactElement } from 'react';
4
4
 
5
5
  declare global {
6
6
  interface Window {
@@ -12183,7 +12183,7 @@ type ControlContext<P> = [
12183
12183
  /**
12184
12184
  * props
12185
12185
  */
12186
- P,
12186
+ Partial<P>,
12187
12187
  /**
12188
12188
  * context data
12189
12189
  */
@@ -12271,9 +12271,9 @@ interface PlainVoidType extends BaseParam {
12271
12271
  }
12272
12272
  type VoidType = PlainVoidType | AnyType;
12273
12273
  type IsAny<T> = 0 extends 1 & T ? true : false;
12274
- type CommonType<T> = T extends GraphQLValue ? GraphQLType<T> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType : T extends object ? ObjectType : AnyType;
12275
- type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<T>;
12276
- type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [T] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : CommonType<T>;
12274
+ type CommonType<P, T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType : T extends object ? ObjectType : AnyType;
12275
+ type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
12276
+ type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [T] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : CommonType<P, T>;
12277
12277
  type ParamType<P, T> = RestrictedType<P, T>;
12278
12278
  type RequiredParam<P, T> = ParamType<P, T> & {
12279
12279
  isOptional?: false;
@@ -12950,7 +12950,189 @@ declare function Trans({ transKey, children }: TransProps): React__default.React
12950
12950
 
12951
12951
 
12952
12952
 
12953
- interface AriaLabelingProps {
12953
+ /** Any focusable element, including both HTML and SVG elements. */
12954
+ interface FocusableElement$1 extends Element, HTMLOrSVGElement {}
12955
+
12956
+ /** All DOM attributes supported across both HTML and SVG elements. */
12957
+ interface DOMAttributes$1<T = FocusableElement$1> extends AriaAttributes, DOMAttributes$2<T> {
12958
+ id?: string | undefined,
12959
+ role?: AriaRole | undefined,
12960
+ tabIndex?: number | undefined,
12961
+ style?: CSSProperties$1 | undefined,
12962
+ className?: string | undefined
12963
+ }
12964
+
12965
+ /*
12966
+ * Copyright 2020 Adobe. All rights reserved.
12967
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12968
+ * you may not use this file except in compliance with the License. You may obtain a copy
12969
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12970
+ *
12971
+ * Unless required by applicable law or agreed to in writing, software distributed under
12972
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12973
+ * OF ANY KIND, either express or implied. See the License for the specific language
12974
+ * governing permissions and limitations under the License.
12975
+ */
12976
+
12977
+
12978
+
12979
+ /** Any focusable element, including both HTML and SVG elements. */
12980
+ interface FocusableElement extends Element, HTMLOrSVGElement {}
12981
+
12982
+ /** All DOM attributes supported across both HTML and SVG elements. */
12983
+ interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$2<T> {
12984
+ id?: string | undefined,
12985
+ role?: AriaRole | undefined,
12986
+ tabIndex?: number | undefined,
12987
+ style?: CSSProperties$1 | undefined,
12988
+ className?: string | undefined
12989
+ }
12990
+
12991
+ interface PressResult {
12992
+ /** Whether the target is currently pressed. */
12993
+ isPressed: boolean;
12994
+ /** Props to spread on the target element. */
12995
+ pressProps: DOMAttributes;
12996
+ }
12997
+ interface HoverResult {
12998
+ /** Props to spread on the target element. */
12999
+ hoverProps: DOMAttributes;
13000
+ isHovered: boolean;
13001
+ }
13002
+
13003
+ interface FocusRingAria {
13004
+ /** Whether the element is currently focused. */
13005
+ isFocused: boolean;
13006
+ /** Whether keyboard focus should be visible. */
13007
+ isFocusVisible: boolean;
13008
+ /** Props to apply to the container element with the focus ring. */
13009
+ focusProps: DOMAttributes$1;
13010
+ }
13011
+
13012
+ type FocusHookResult = [boolean, FocusRingAria["focusProps"]];
13013
+ type HoverHookResult = [boolean, HoverResult["hoverProps"]];
13014
+ type PressHookResult = [boolean, PressResult["pressProps"]];
13015
+ declare function useFocused(opts: {
13016
+ isTextInput?: boolean;
13017
+ }): FocusHookResult;
13018
+ declare function useFocusVisible(opts: {
13019
+ isTextInput?: boolean;
13020
+ }): FocusHookResult;
13021
+ declare function useFocusedWithin(opts: {
13022
+ isTextInput?: boolean;
13023
+ }): FocusHookResult;
13024
+ declare function useFocusVisibleWithin(opts: {
13025
+ isTextInput?: boolean;
13026
+ }): FocusHookResult;
13027
+ declare function useHover(): HoverHookResult;
13028
+ declare function usePressed(): PressHookResult;
13029
+ declare const TRIGGER_TO_HOOK: {
13030
+ readonly useHover: typeof useHover;
13031
+ readonly useFocused: typeof useFocused;
13032
+ readonly useFocusVisible: typeof useFocusVisible;
13033
+ readonly useFocusedWithin: typeof useFocusedWithin;
13034
+ readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
13035
+ readonly usePressed: typeof usePressed;
13036
+ };
13037
+ type TriggerType = keyof typeof TRIGGER_TO_HOOK;
13038
+ interface TriggerOpts {
13039
+ isTextInput?: boolean;
13040
+ }
13041
+ /**
13042
+ * Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
13043
+ * as it's not valid to install variable React hooks!
13044
+ */
13045
+ declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
13046
+
13047
+ declare const classNames: any;
13048
+
13049
+ declare function setPlumeStrictMode(mode: boolean): void;
13050
+ type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
13051
+ type VariantArgsChoices<V> = {
13052
+ [k in keyof V]-?: VariantArgChoices<V[k]>;
13053
+ };
13054
+ type DictValues<V extends Record<string, any>> = V[keyof V];
13055
+ type DictTuples<V extends Record<string, any>> = DictValues<{
13056
+ [K in keyof V]: [K, V[K]];
13057
+ }>;
13058
+ type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
13059
+ type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
13060
+ group: T1;
13061
+ variant: T2;
13062
+ } : never;
13063
+ type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
13064
+ type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
13065
+ (props: {
13066
+ variants?: V;
13067
+ args?: A;
13068
+ overrides?: O;
13069
+ }): React$1.ReactNode;
13070
+ internalVariantProps: (keyof V)[];
13071
+ internalArgProps: (keyof A)[];
13072
+ };
13073
+ type AnyPlasmicClass = PlasmicClass<any, any, any>;
13074
+ type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
13075
+ type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
13076
+ type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
13077
+
13078
+ interface PlumeCommonProps {
13079
+ showStartIcon?: boolean;
13080
+ showEndIcon?: boolean;
13081
+ startIcon?: React$1.ReactNode;
13082
+ endIcon?: React$1.ReactNode;
13083
+ children?: React$1.ReactNode;
13084
+ isDisabled?: boolean;
13085
+ }
13086
+ interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
13087
+ }
13088
+ interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
13089
+ }
13090
+ interface PlumeActualButtonProps {
13091
+ submitsForm?: boolean;
13092
+ }
13093
+ interface PlumeAnchorProps {
13094
+ link?: string;
13095
+ target?: React$1.ComponentProps<"a">["target"] | boolean;
13096
+ }
13097
+ type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
13098
+ type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
13099
+ type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
13100
+ type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
13101
+ type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
13102
+ type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
13103
+ type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
13104
+ interface ButtonConfig<C extends AnyPlasmicClass> {
13105
+ showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
13106
+ showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
13107
+ isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13108
+ startIconSlot?: keyof PlasmicClassArgs<C>;
13109
+ endIconSlot?: keyof PlasmicClassArgs<C>;
13110
+ contentSlot: keyof PlasmicClassArgs<C>;
13111
+ root: keyof PlasmicClassOverrides<C>;
13112
+ }
13113
+ declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
13114
+ plasmicProps: {
13115
+ variants: PlasmicClassVariants<C>;
13116
+ args: PlasmicClassArgs<C>;
13117
+ overrides: PlasmicClassOverrides<C>;
13118
+ };
13119
+ };
13120
+
13121
+ /*
13122
+ * Copyright 2020 Adobe. All rights reserved.
13123
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13124
+ * you may not use this file except in compliance with the License. You may obtain a copy
13125
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13126
+ *
13127
+ * Unless required by applicable law or agreed to in writing, software distributed under
13128
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13129
+ * OF ANY KIND, either express or implied. See the License for the specific language
13130
+ * governing permissions and limitations under the License.
13131
+ */
13132
+
13133
+
13134
+
13135
+ interface AriaLabelingProps$2 {
12954
13136
  /**
12955
13137
  * Defines a string value that labels the current element.
12956
13138
  */
@@ -12982,14 +13164,14 @@ interface AriaValidationProps {
12982
13164
 
12983
13165
  // A set of common DOM props that are allowed on any component
12984
13166
  // Ensure this is synced with DOMPropNames in filterDOMProps
12985
- interface DOMProps {
13167
+ interface DOMProps$2 {
12986
13168
  /**
12987
13169
  * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
12988
13170
  */
12989
13171
  id?: string
12990
13172
  }
12991
13173
 
12992
- interface FocusableDOMProps extends DOMProps {
13174
+ interface FocusableDOMProps$2 extends DOMProps$2 {
12993
13175
  /**
12994
13176
  * Whether to exclude the element from the sequential tab order. If true,
12995
13177
  * the element will not be focusable via the keyboard by tabbing. This should
@@ -12999,25 +13181,13 @@ interface FocusableDOMProps extends DOMProps {
12999
13181
  excludeFromTabOrder?: boolean
13000
13182
  }
13001
13183
 
13002
- interface InputDOMProps {
13184
+ interface InputDOMProps$1 {
13003
13185
  /**
13004
13186
  * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
13005
13187
  */
13006
13188
  name?: string
13007
13189
  }
13008
13190
 
13009
- /** Any focusable element, including both HTML and SVG elements. */
13010
- interface FocusableElement extends Element, HTMLOrSVGElement {}
13011
-
13012
- /** All DOM attributes supported across both HTML and SVG elements. */
13013
- interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
13014
- id?: string | undefined,
13015
- role?: AriaRole | undefined,
13016
- tabIndex?: number | undefined,
13017
- style?: CSSProperties$1 | undefined,
13018
- className?: string | undefined
13019
- }
13020
-
13021
13191
  /*
13022
13192
  * Copyright 2020 Adobe. All rights reserved.
13023
13193
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -13059,7 +13229,7 @@ interface Validation<T = unknown> {
13059
13229
  validate?: (value: T) => ValidationError | true | null | undefined
13060
13230
  }
13061
13231
 
13062
- interface InputBase {
13232
+ interface InputBase$2 {
13063
13233
  /** Whether the input is disabled. */
13064
13234
  isDisabled?: boolean,
13065
13235
  /** Whether the input can be selected but not changed by the user. */
@@ -13080,12 +13250,38 @@ interface InputBase {
13080
13250
 
13081
13251
 
13082
13252
 
13083
- type SelectionMode = 'none' | 'single' | 'multiple';
13084
- type SelectionBehavior = 'toggle' | 'replace';
13085
- type Selection = 'all' | Set<Key>;
13253
+ // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
13254
+ // is not to propagate. This can be overridden by calling continuePropagation() on the event.
13255
+ type BaseEvent$2<T extends SyntheticEvent> = T & {
13256
+ /**
13257
+ * Use continuePropagation.
13258
+ * @deprecated */
13259
+ stopPropagation(): void,
13260
+ continuePropagation(): void
13261
+ }
13086
13262
 
13087
- type FocusStrategy = 'first' | 'last';
13088
- type DisabledBehavior = 'selection' | 'all';
13263
+ type KeyboardEvent$2 = BaseEvent$2<KeyboardEvent$3<any>>;
13264
+
13265
+ interface KeyboardEvents$2 {
13266
+ /** Handler that is called when a key is pressed. */
13267
+ onKeyDown?: (e: KeyboardEvent$2) => void,
13268
+ /** Handler that is called when a key is released. */
13269
+ onKeyUp?: (e: KeyboardEvent$2) => void
13270
+ }
13271
+
13272
+ interface FocusEvents$2<Target = Element> {
13273
+ /** Handler that is called when the element receives focus. */
13274
+ onFocus?: (e: FocusEvent<Target>) => void,
13275
+ /** Handler that is called when the element loses focus. */
13276
+ onBlur?: (e: FocusEvent<Target>) => void,
13277
+ /** Handler that is called when the element's focus status changes. */
13278
+ onFocusChange?: (isFocused: boolean) => void
13279
+ }
13280
+
13281
+ interface FocusableProps$2<Target = Element> extends FocusEvents$2<Target>, KeyboardEvents$2 {
13282
+ /** Whether the element should receive focus on render. */
13283
+ autoFocus?: boolean
13284
+ }
13089
13285
 
13090
13286
  /*
13091
13287
  * Copyright 2020 Adobe. All rights reserved.
@@ -13101,79 +13297,97 @@ type DisabledBehavior = 'selection' | 'all';
13101
13297
 
13102
13298
 
13103
13299
 
13104
- /**
13105
- * A generic interface to access a readonly sequential
13106
- * collection of unique keyed items.
13107
- */
13108
- interface Collection<T> extends Iterable<T> {
13109
- /** The number of items in the collection. */
13110
- readonly size: number,
13300
+ interface ToggleStateOptions extends InputBase$2 {
13301
+ /**
13302
+ * Whether the element should be selected (uncontrolled).
13303
+ */
13304
+ defaultSelected?: boolean,
13305
+ /**
13306
+ * Whether the element should be selected (controlled).
13307
+ */
13308
+ isSelected?: boolean,
13309
+ /**
13310
+ * Handler that is called when the element's selection state changes.
13311
+ */
13312
+ onChange?: (isSelected: boolean) => void
13313
+ }
13111
13314
 
13112
- /** Iterate over all keys in the collection. */
13113
- getKeys(): Iterable<Key>,
13315
+ interface ToggleProps extends ToggleStateOptions, Validation<boolean>, FocusableProps$2 {
13316
+ /**
13317
+ * The label for the element.
13318
+ */
13319
+ children?: ReactNode,
13320
+ /**
13321
+ * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
13322
+ */
13323
+ value?: string
13324
+ }
13114
13325
 
13115
- /** Get an item by its key. */
13116
- getItem(key: Key): T | null,
13326
+ interface AriaToggleProps extends ToggleProps, FocusableDOMProps$2, AriaLabelingProps$2, AriaValidationProps, InputDOMProps$1 {
13327
+ /**
13328
+ * Identifies the element (or elements) whose contents or presence are controlled by the current element.
13329
+ */
13330
+ 'aria-controls'?: string
13331
+ }
13117
13332
 
13118
- /** Get an item by the index of its key. */
13119
- at(idx: number): T | null,
13333
+ interface CheckboxProps$1 extends ToggleProps {
13334
+ /**
13335
+ * Indeterminism is presentational only.
13336
+ * The indeterminate visual representation remains regardless of user interaction.
13337
+ */
13338
+ isIndeterminate?: boolean
13339
+ }
13120
13340
 
13121
- /** Get the key that comes before the given key in the collection. */
13122
- getKeyBefore(key: Key): Key | null,
13341
+ interface AriaCheckboxProps extends CheckboxProps$1, AriaToggleProps {}
13123
13342
 
13124
- /** Get the key that comes after the given key in the collection. */
13125
- getKeyAfter(key: Key): Key | null,
13343
+ interface StyleProps {
13344
+ className?: string;
13345
+ style?: React$1.CSSProperties;
13346
+ }
13347
+ declare function getDataProps(props: Record<string, any>): Partial<Record<string, any>>;
13126
13348
 
13127
- /** Get the first key in the collection. */
13128
- getFirstKey(): Key | null,
13129
-
13130
- /** Get the last key in the collection. */
13131
- getLastKey(): Key | null,
13132
-
13133
- /** Iterate over the child items of the given key. */
13134
- getChildren?(key: Key): Iterable<T>,
13135
-
13136
- /** Returns a string representation of the item's contents. */
13137
- getTextValue?(key: Key): string
13349
+ type CheckboxRef = React$1.Ref<CheckboxRefValue>;
13350
+ interface CheckboxRefValue extends CheckboxState {
13351
+ getRoot: () => HTMLElement | null;
13352
+ focus: () => void;
13353
+ blur: () => void;
13138
13354
  }
13139
-
13140
- interface Node<T> {
13141
- /** The type of item this node represents. */
13142
- type: string,
13143
- /** A unique key for the node. */
13144
- key: Key,
13145
- /** The object value the node was created from. */
13146
- value: T | null,
13147
- /** The level of depth this node is at in the hierarchy. */
13148
- level: number,
13149
- /** Whether this item has children, even if not loaded yet. */
13150
- hasChildNodes: boolean,
13151
- /**
13152
- * The loaded children of this node.
13153
- * @deprecated Use `collection.getChildren(node.key)` instead.
13154
- */
13155
- childNodes: Iterable<Node<T>>,
13156
- /** The rendered contents of this node (e.g. JSX). */
13157
- rendered: ReactNode,
13158
- /** A string value for this node, used for features like typeahead. */
13159
- textValue: string,
13160
- /** An accessibility label for this node. */
13161
- 'aria-label'?: string,
13162
- /** The index of this node within its parent. */
13163
- index?: number,
13164
- /** A function that should be called to wrap the rendered node. */
13165
- wrapper?: (element: ReactElement) => ReactElement,
13166
- /** The key of the parent node. */
13167
- parentKey?: Key | null,
13168
- /** The key of the node before this node. */
13169
- prevKey?: Key | null,
13170
- /** The key of the node after this node. */
13171
- nextKey?: Key | null,
13172
- /** Additional properties specific to a particular node type. */
13173
- props?: any,
13174
- /** @private */
13175
- shouldInvalidate?: (context: unknown) => boolean
13355
+ interface CheckboxState {
13356
+ setChecked: (checked: boolean) => void;
13176
13357
  }
13358
+ interface CheckboxProps extends Omit<AriaCheckboxProps, "isSelected" | "defaultSelected">, StyleProps {
13359
+ /**
13360
+ * Whether the Checkbox is checked or not; controlled
13361
+ */
13362
+ isChecked?: boolean;
13363
+ /**
13364
+ * Whether the Checkbox is checked by default; uncontrolled
13365
+ */
13366
+ defaultChecked?: boolean;
13367
+ /**
13368
+ * Whether the Checkbox is in an "indeterminate" state; this usually
13369
+ * refers to a "check all" that is used to check / uncheck many other
13370
+ * checkboxes, and is visually indeterminate if some of its controlled
13371
+ * checkboxes are checked and some are not.
13372
+ */
13373
+ isIndeterminate?: boolean;
13374
+ }
13375
+ interface CheckboxConfig<C extends AnyPlasmicClass> {
13376
+ isCheckedVariant: VariantDef<PlasmicClassVariants<C>>;
13377
+ isIndeterminateVariant?: VariantDef<PlasmicClassVariants<C>>;
13378
+ isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13379
+ noLabelVariant?: VariantDef<PlasmicClassVariants<C>>;
13380
+ labelSlot?: keyof PlasmicClassArgs<C>;
13381
+ root: keyof PlasmicClassOverrides<C>;
13382
+ }
13383
+ declare function useCheckbox<P extends CheckboxProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: CheckboxConfig<C>, ref?: CheckboxRef): {
13384
+ plasmicProps: {
13385
+ variants: PlasmicClassVariants<C>;
13386
+ overrides: PlasmicClassOverrides<C>;
13387
+ args: PlasmicClassArgs<C>;
13388
+ };
13389
+ state: CheckboxState;
13390
+ };
13177
13391
 
13178
13392
  /*
13179
13393
  * Copyright 2020 Adobe. All rights reserved.
@@ -13189,71 +13403,49 @@ interface Node<T> {
13189
13403
 
13190
13404
 
13191
13405
 
13192
- // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
13193
- // is not to propagate. This can be overridden by calling continuePropagation() on the event.
13194
- type BaseEvent<T extends SyntheticEvent> = T & {
13406
+ interface AriaLabelingProps$1 {
13195
13407
  /**
13196
- * Use continuePropagation.
13197
- * @deprecated */
13198
- stopPropagation(): void,
13199
- continuePropagation(): void
13200
- }
13201
-
13202
- type KeyboardEvent = BaseEvent<KeyboardEvent$1<any>>;
13203
-
13204
- type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
13408
+ * Defines a string value that labels the current element.
13409
+ */
13410
+ 'aria-label'?: string,
13205
13411
 
13206
- interface PressEvent {
13207
- /** The type of press event being fired. */
13208
- type: 'pressstart' | 'pressend' | 'pressup' | 'press',
13209
- /** The pointer type that triggered the press event. */
13210
- pointerType: PointerType,
13211
- /** The target element of the press event. */
13212
- target: Element,
13213
- /** Whether the shift keyboard modifier was held during the press event. */
13214
- shiftKey: boolean,
13215
- /** Whether the ctrl keyboard modifier was held during the press event. */
13216
- ctrlKey: boolean,
13217
- /** Whether the meta keyboard modifier was held during the press event. */
13218
- metaKey: boolean,
13219
- /** Whether the alt keyboard modifier was held during the press event. */
13220
- altKey: boolean,
13221
13412
  /**
13222
- * By default, press events stop propagation to parent elements.
13223
- * In cases where a handler decides not to handle a specific event,
13224
- * it can call `continuePropagation()` to allow a parent to handle it.
13413
+ * Identifies the element (or elements) that labels the current element.
13225
13414
  */
13226
- continuePropagation(): void
13227
- }
13415
+ 'aria-labelledby'?: string,
13228
13416
 
13229
- interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
13230
- /** The type of long press event being fired. */
13231
- type: 'longpressstart' | 'longpressend' | 'longpress'
13232
- }
13417
+ /**
13418
+ * Identifies the element (or elements) that describes the object.
13419
+ */
13420
+ 'aria-describedby'?: string,
13233
13421
 
13234
- interface KeyboardEvents {
13235
- /** Handler that is called when a key is pressed. */
13236
- onKeyDown?: (e: KeyboardEvent) => void,
13237
- /** Handler that is called when a key is released. */
13238
- onKeyUp?: (e: KeyboardEvent) => void
13422
+ /**
13423
+ * Identifies the element (or elements) that provide a detailed, extended description for the object.
13424
+ */
13425
+ 'aria-details'?: string
13239
13426
  }
13240
13427
 
13241
- interface FocusEvents<Target = Element> {
13242
- /** Handler that is called when the element receives focus. */
13243
- onFocus?: (e: FocusEvent<Target>) => void,
13244
- /** Handler that is called when the element loses focus. */
13245
- onBlur?: (e: FocusEvent<Target>) => void,
13246
- /** Handler that is called when the element's focus status changes. */
13247
- onFocusChange?: (isFocused: boolean) => void
13428
+ // A set of common DOM props that are allowed on any component
13429
+ // Ensure this is synced with DOMPropNames in filterDOMProps
13430
+ interface DOMProps$1 {
13431
+ /**
13432
+ * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
13433
+ */
13434
+ id?: string
13248
13435
  }
13249
13436
 
13250
- interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
13251
- /** Whether the element should receive focus on render. */
13252
- autoFocus?: boolean
13437
+ interface FocusableDOMProps$1 extends DOMProps$1 {
13438
+ /**
13439
+ * Whether to exclude the element from the sequential tab order. If true,
13440
+ * the element will not be focusable via the keyboard by tabbing. This should
13441
+ * be avoided except in rare scenarios where an alternative means of accessing
13442
+ * the element or its functionality via the keyboard is available.
13443
+ */
13444
+ excludeFromTabOrder?: boolean
13253
13445
  }
13254
13446
 
13255
13447
  /*
13256
- * Copyright 2023 Adobe. All rights reserved.
13448
+ * Copyright 2020 Adobe. All rights reserved.
13257
13449
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13258
13450
  * you may not use this file except in compliance with the License. You may obtain a copy
13259
13451
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -13264,119 +13456,30 @@ interface FocusableProps<Target = Element> extends FocusEvents<Target>, Keyboard
13264
13456
  * governing permissions and limitations under the License.
13265
13457
  */
13266
13458
 
13267
- type Key = string | number;
13268
13459
 
13269
- declare function useFocused(opts: {
13270
- isTextInput?: boolean;
13271
- }): (boolean | DOMAttributes<FocusableElement>)[];
13272
- declare function useFocusVisible(opts: {
13273
- isTextInput?: boolean;
13274
- }): (boolean | DOMAttributes<FocusableElement>)[];
13275
- declare function useFocusedWithin(opts: {
13276
- isTextInput?: boolean;
13277
- }): (boolean | DOMAttributes<FocusableElement>)[];
13278
- declare function useFocusVisibleWithin(opts: {
13279
- isTextInput?: boolean;
13280
- }): (boolean | DOMAttributes<FocusableElement>)[];
13281
- declare function useHover(): (boolean | {
13282
- onMouseEnter: () => void;
13283
- onMouseLeave: () => void;
13284
- })[];
13285
- declare function usePressed(): (boolean | {
13286
- onMouseDown: () => void;
13287
- onMouseUp: () => void;
13288
- })[];
13289
- declare const TRIGGER_TO_HOOK: {
13290
- readonly useHover: typeof useHover;
13291
- readonly useFocused: typeof useFocused;
13292
- readonly useFocusVisible: typeof useFocusVisible;
13293
- readonly useFocusedWithin: typeof useFocusedWithin;
13294
- readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
13295
- readonly usePressed: typeof usePressed;
13296
- };
13297
- type TriggerType = keyof typeof TRIGGER_TO_HOOK;
13298
- interface TriggerOpts {
13299
- isTextInput?: boolean;
13460
+
13461
+ interface InputBase$1 {
13462
+ /** Whether the input is disabled. */
13463
+ isDisabled?: boolean,
13464
+ /** Whether the input can be selected but not changed by the user. */
13465
+ isReadOnly?: boolean
13300
13466
  }
13301
- /**
13302
- * Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
13303
- * as it's not valid to install variable React hooks!
13467
+
13468
+ /*
13469
+ * Copyright 2020 Adobe. All rights reserved.
13470
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13471
+ * you may not use this file except in compliance with the License. You may obtain a copy
13472
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13473
+ *
13474
+ * Unless required by applicable law or agreed to in writing, software distributed under
13475
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13476
+ * OF ANY KIND, either express or implied. See the License for the specific language
13477
+ * governing permissions and limitations under the License.
13304
13478
  */
13305
- declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
13306
13479
 
13307
- declare const classNames: any;
13308
13480
 
13309
- declare function setPlumeStrictMode(mode: boolean): void;
13310
- type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
13311
- type VariantArgsChoices<V> = {
13312
- [k in keyof V]-?: VariantArgChoices<V[k]>;
13313
- };
13314
- type DictValues<V extends Record<string, any>> = V[keyof V];
13315
- type DictTuples<V extends Record<string, any>> = DictValues<{
13316
- [K in keyof V]: [K, V[K]];
13317
- }>;
13318
- type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
13319
- type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
13320
- group: T1;
13321
- variant: T2;
13322
- } : never;
13323
- type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
13324
- type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
13325
- (props: {
13326
- variants?: V;
13327
- args?: A;
13328
- overrides?: O;
13329
- }): React$1.ReactNode;
13330
- internalVariantProps: (keyof V)[];
13331
- internalArgProps: (keyof A)[];
13332
- };
13333
- type AnyPlasmicClass = PlasmicClass<any, any, any>;
13334
- type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
13335
- type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
13336
- type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
13337
13481
 
13338
- interface PlumeCommonProps {
13339
- showStartIcon?: boolean;
13340
- showEndIcon?: boolean;
13341
- startIcon?: React$1.ReactNode;
13342
- endIcon?: React$1.ReactNode;
13343
- children?: React$1.ReactNode;
13344
- isDisabled?: boolean;
13345
- }
13346
- interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
13347
- }
13348
- interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
13349
- }
13350
- interface PlumeActualButtonProps {
13351
- submitsForm?: boolean;
13352
- }
13353
- interface PlumeAnchorProps {
13354
- link?: string;
13355
- target?: React$1.ComponentProps<"a">["target"] | boolean;
13356
- }
13357
- type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
13358
- type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
13359
- type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
13360
- type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
13361
- type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
13362
- type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
13363
- type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
13364
- interface ButtonConfig<C extends AnyPlasmicClass> {
13365
- showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
13366
- showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
13367
- isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13368
- startIconSlot?: keyof PlasmicClassArgs<C>;
13369
- endIconSlot?: keyof PlasmicClassArgs<C>;
13370
- contentSlot: keyof PlasmicClassArgs<C>;
13371
- root: keyof PlasmicClassOverrides<C>;
13372
- }
13373
- declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
13374
- plasmicProps: {
13375
- variants: PlasmicClassVariants<C>;
13376
- args: PlasmicClassArgs<C>;
13377
- overrides: PlasmicClassOverrides<C>;
13378
- };
13379
- };
13482
+ type FocusStrategy$1 = 'first' | 'last';
13380
13483
 
13381
13484
  /*
13382
13485
  * Copyright 2020 Adobe. All rights reserved.
@@ -13392,96 +13495,40 @@ declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass
13392
13495
 
13393
13496
 
13394
13497
 
13395
- interface ToggleProps extends InputBase, Validation<boolean>, FocusableProps {
13396
- /**
13397
- * The label for the element.
13398
- */
13399
- children?: ReactNode,
13400
- /**
13401
- * Whether the element should be selected (uncontrolled).
13402
- */
13403
- defaultSelected?: boolean,
13404
- /**
13405
- * Whether the element should be selected (controlled).
13406
- */
13407
- isSelected?: boolean,
13408
- /**
13409
- * Handler that is called when the element's selection state changes.
13410
- */
13411
- onChange?: (isSelected: boolean) => void,
13412
- /**
13413
- * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
13414
- */
13415
- value?: string
13416
- }
13417
-
13418
- interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps, AriaValidationProps, InputDOMProps {
13419
- /**
13420
- * Identifies the element (or elements) whose contents or presence are controlled by the current element.
13421
- */
13422
- 'aria-controls'?: string
13423
- }
13424
-
13425
- interface CheckboxProps$1 extends ToggleProps {
13426
- /**
13427
- * Indeterminism is presentational only.
13428
- * The indeterminate visual representation remains regardless of user interaction.
13429
- */
13430
- isIndeterminate?: boolean
13498
+ // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
13499
+ // is not to propagate. This can be overridden by calling continuePropagation() on the event.
13500
+ type BaseEvent$1<T extends SyntheticEvent> = T & {
13501
+ /**
13502
+ * Use continuePropagation.
13503
+ * @deprecated */
13504
+ stopPropagation(): void,
13505
+ continuePropagation(): void
13431
13506
  }
13432
13507
 
13433
- interface AriaCheckboxProps extends CheckboxProps$1, AriaToggleProps {}
13508
+ type KeyboardEvent$1 = BaseEvent$1<KeyboardEvent$3<any>>;
13434
13509
 
13435
- interface StyleProps {
13436
- className?: string;
13437
- style?: React$1.CSSProperties;
13510
+ interface KeyboardEvents$1 {
13511
+ /** Handler that is called when a key is pressed. */
13512
+ onKeyDown?: (e: KeyboardEvent$1) => void,
13513
+ /** Handler that is called when a key is released. */
13514
+ onKeyUp?: (e: KeyboardEvent$1) => void
13438
13515
  }
13439
- declare function getDataProps(props: Record<string, any>): Partial<Record<string, any>>;
13440
13516
 
13441
- type CheckboxRef = React$1.Ref<CheckboxRefValue>;
13442
- interface CheckboxRefValue extends CheckboxState {
13443
- getRoot: () => HTMLElement | null;
13444
- focus: () => void;
13445
- blur: () => void;
13446
- }
13447
- interface CheckboxState {
13448
- setChecked: (checked: boolean) => void;
13449
- }
13450
- interface CheckboxProps extends Omit<AriaCheckboxProps, "isSelected" | "defaultSelected">, StyleProps {
13451
- /**
13452
- * Whether the Checkbox is checked or not; controlled
13453
- */
13454
- isChecked?: boolean;
13455
- /**
13456
- * Whether the Checkbox is checked by default; uncontrolled
13457
- */
13458
- defaultChecked?: boolean;
13459
- /**
13460
- * Whether the Checkbox is in an "indeterminate" state; this usually
13461
- * refers to a "check all" that is used to check / uncheck many other
13462
- * checkboxes, and is visually indeterminate if some of its controlled
13463
- * checkboxes are checked and some are not.
13464
- */
13465
- isIndeterminate?: boolean;
13517
+ interface FocusEvents$1<Target = Element> {
13518
+ /** Handler that is called when the element receives focus. */
13519
+ onFocus?: (e: FocusEvent<Target>) => void,
13520
+ /** Handler that is called when the element loses focus. */
13521
+ onBlur?: (e: FocusEvent<Target>) => void,
13522
+ /** Handler that is called when the element's focus status changes. */
13523
+ onFocusChange?: (isFocused: boolean) => void
13466
13524
  }
13467
- interface CheckboxConfig<C extends AnyPlasmicClass> {
13468
- isCheckedVariant: VariantDef<PlasmicClassVariants<C>>;
13469
- isIndeterminateVariant?: VariantDef<PlasmicClassVariants<C>>;
13470
- isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13471
- noLabelVariant?: VariantDef<PlasmicClassVariants<C>>;
13472
- labelSlot?: keyof PlasmicClassArgs<C>;
13473
- root: keyof PlasmicClassOverrides<C>;
13525
+
13526
+ interface FocusableProps$1<Target = Element> extends FocusEvents$1<Target>, KeyboardEvents$1 {
13527
+ /** Whether the element should receive focus on render. */
13528
+ autoFocus?: boolean
13474
13529
  }
13475
- declare function useCheckbox<P extends CheckboxProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: CheckboxConfig<C>, ref?: CheckboxRef): {
13476
- plasmicProps: {
13477
- variants: PlasmicClassVariants<C>;
13478
- overrides: PlasmicClassOverrides<C>;
13479
- args: PlasmicClassArgs<C>;
13480
- };
13481
- state: CheckboxState;
13482
- };
13483
13530
 
13484
- interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
13531
+ interface BaseMenuProps extends DOMProps$1, AriaLabelingProps$1, StyleProps {
13485
13532
  /**
13486
13533
  * List of `Menu.Item`s or `Menu.Group`s that make up the menu
13487
13534
  */
@@ -13723,7 +13770,7 @@ interface DropdownMenuProps {
13723
13770
  }
13724
13771
  declare function DropdownMenu(props: DropdownMenuProps): React$1.JSX.Element;
13725
13772
 
13726
- interface BaseMenuButtonProps extends DOMProps, FocusableProps, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
13773
+ interface BaseMenuButtonProps extends DOMProps$1, FocusableProps$1, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
13727
13774
  /**
13728
13775
  * The menu to show; can either be a Menu instance, or a function that returns a Menu
13729
13776
  * instance if you want to defer creating the instance till when it's opened.
@@ -13789,7 +13836,7 @@ declare function useMenuButton<P extends BaseMenuButtonProps, C extends AnyPlasm
13789
13836
  state: MenuButtonState;
13790
13837
  };
13791
13838
 
13792
- interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableDOMProps, InputBase, FocusableProps, StyleProps {
13839
+ interface BaseSelectProps extends DOMProps$1, AriaLabelingProps$1, FocusableDOMProps$1, InputBase$1, FocusableProps$1, StyleProps {
13793
13840
  /**
13794
13841
  * Key of the currently selected value
13795
13842
  */
@@ -13894,44 +13941,351 @@ declare function useSelect<P extends BaseSelectProps, C extends AnyPlasmicClass>
13894
13941
  state: SelectState;
13895
13942
  };
13896
13943
 
13897
- interface BaseSelectOptionProps extends ItemLikeProps, StyleProps {
13944
+ interface BaseSelectOptionProps extends ItemLikeProps, StyleProps {
13945
+ }
13946
+ interface SelectOptionConfig<C extends AnyPlasmicClass> {
13947
+ isSelectedVariant: VariantDef<PlasmicClassVariants<C>>;
13948
+ isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13949
+ isHighlightedVariant?: VariantDef<PlasmicClassVariants<C>>;
13950
+ labelSlot: keyof PlasmicClassArgs<C>;
13951
+ root: keyof PlasmicClassOverrides<C>;
13952
+ labelContainer: keyof PlasmicClassOverrides<C>;
13953
+ }
13954
+ type SelectOptionRef = React$1.Ref<HTMLElement>;
13955
+ declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
13956
+ plasmicProps: {
13957
+ variants: PlasmicClassVariants<C>;
13958
+ args: PlasmicClassArgs<C>;
13959
+ overrides: PlasmicClassOverrides<C>;
13960
+ };
13961
+ };
13962
+
13963
+ interface BaseSelectOptionGroupProps extends SectionLikeProps, StyleProps {
13964
+ }
13965
+ interface SelectOptionGroupConfig<C extends AnyPlasmicClass> {
13966
+ noTitleVariant: VariantDef<PlasmicClassVariants<C>>;
13967
+ isFirstVariant: VariantDef<PlasmicClassVariants<C>>;
13968
+ optionsSlot: keyof PlasmicClassArgs<C>;
13969
+ titleSlot: keyof PlasmicClassArgs<C>;
13970
+ root: keyof PlasmicClassOverrides<C>;
13971
+ separator: keyof PlasmicClassOverrides<C>;
13972
+ titleContainer: keyof PlasmicClassOverrides<C>;
13973
+ optionsContainer: keyof PlasmicClassOverrides<C>;
13974
+ }
13975
+ declare function useSelectOptionGroup<P extends BaseSelectOptionGroupProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionGroupConfig<C>): {
13976
+ plasmicProps: {
13977
+ variants: PlasmicClassVariants<C>;
13978
+ args: PlasmicClassArgs<C>;
13979
+ overrides: PlasmicClassOverrides<C>;
13980
+ };
13981
+ };
13982
+
13983
+ /*
13984
+ * Copyright 2020 Adobe. All rights reserved.
13985
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13986
+ * you may not use this file except in compliance with the License. You may obtain a copy
13987
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13988
+ *
13989
+ * Unless required by applicable law or agreed to in writing, software distributed under
13990
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13991
+ * OF ANY KIND, either express or implied. See the License for the specific language
13992
+ * governing permissions and limitations under the License.
13993
+ */
13994
+
13995
+
13996
+
13997
+ /**
13998
+ * A generic interface to access a readonly sequential
13999
+ * collection of unique keyed items.
14000
+ */
14001
+ interface Collection$1<T> extends Iterable<T> {
14002
+ /** The number of items in the collection. */
14003
+ readonly size: number,
14004
+
14005
+ /** Iterate over all keys in the collection. */
14006
+ getKeys(): Iterable<Key$1>,
14007
+
14008
+ /** Get an item by its key. */
14009
+ getItem(key: Key$1): T | null,
14010
+
14011
+ /** Get an item by the index of its key. */
14012
+ at(idx: number): T | null,
14013
+
14014
+ /** Get the key that comes before the given key in the collection. */
14015
+ getKeyBefore(key: Key$1): Key$1 | null,
14016
+
14017
+ /** Get the key that comes after the given key in the collection. */
14018
+ getKeyAfter(key: Key$1): Key$1 | null,
14019
+
14020
+ /** Get the first key in the collection. */
14021
+ getFirstKey(): Key$1 | null,
14022
+
14023
+ /** Get the last key in the collection. */
14024
+ getLastKey(): Key$1 | null,
14025
+
14026
+ /** Iterate over the child items of the given key. */
14027
+ getChildren?(key: Key$1): Iterable<T>,
14028
+
14029
+ /** Returns a string representation of the item's contents. */
14030
+ getTextValue?(key: Key$1): string,
14031
+
14032
+ /** Filters the collection using the given function. */
14033
+ UNSTABLE_filter?(filterFn: (nodeValue: string) => boolean): Collection$1<T>
14034
+ }
14035
+
14036
+ interface Node$1<T> {
14037
+ /** The type of item this node represents. */
14038
+ type: string,
14039
+ /** A unique key for the node. */
14040
+ key: Key$1,
14041
+ /** The object value the node was created from. */
14042
+ value: T | null,
14043
+ /** The level of depth this node is at in the hierarchy. */
14044
+ level: number,
14045
+ /** Whether this item has children, even if not loaded yet. */
14046
+ hasChildNodes: boolean,
14047
+ /**
14048
+ * The loaded children of this node.
14049
+ * @deprecated Use `collection.getChildren(node.key)` instead.
14050
+ */
14051
+ childNodes: Iterable<Node$1<T>>,
14052
+ /** The rendered contents of this node (e.g. JSX). */
14053
+ rendered: ReactNode,
14054
+ /** A string value for this node, used for features like typeahead. */
14055
+ textValue: string,
14056
+ /** An accessibility label for this node. */
14057
+ 'aria-label'?: string,
14058
+ /** The index of this node within its parent. */
14059
+ index: number,
14060
+ /** A function that should be called to wrap the rendered node. */
14061
+ wrapper?: (element: ReactElement) => ReactElement,
14062
+ /** The key of the parent node. */
14063
+ parentKey?: Key$1 | null,
14064
+ /** The key of the node before this node. */
14065
+ prevKey?: Key$1 | null,
14066
+ /** The key of the node after this node. */
14067
+ nextKey?: Key$1 | null,
14068
+ /** Additional properties specific to a particular node type. */
14069
+ props?: any,
14070
+ /** @private */
14071
+ shouldInvalidate?: (context: any) => boolean,
14072
+ /** A function that renders this node to a React Element in the DOM. */
14073
+ render?: (node: Node$1<any>) => ReactElement
14074
+ }
14075
+
14076
+ /*
14077
+ * Copyright 2023 Adobe. All rights reserved.
14078
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14079
+ * you may not use this file except in compliance with the License. You may obtain a copy
14080
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14081
+ *
14082
+ * Unless required by applicable law or agreed to in writing, software distributed under
14083
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14084
+ * OF ANY KIND, either express or implied. See the License for the specific language
14085
+ * governing permissions and limitations under the License.
14086
+ */
14087
+
14088
+ type Key$1 = string | number;
14089
+
14090
+ /*
14091
+ * Copyright 2020 Adobe. All rights reserved.
14092
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14093
+ * you may not use this file except in compliance with the License. You may obtain a copy
14094
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14095
+ *
14096
+ * Unless required by applicable law or agreed to in writing, software distributed under
14097
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14098
+ * OF ANY KIND, either express or implied. See the License for the specific language
14099
+ * governing permissions and limitations under the License.
14100
+ */
14101
+
14102
+
14103
+
14104
+ type SelectionMode = 'none' | 'single' | 'multiple';
14105
+ type SelectionBehavior = 'toggle' | 'replace';
14106
+ type Selection = 'all' | Set<Key>;
14107
+
14108
+ type FocusStrategy = 'first' | 'last';
14109
+ type DisabledBehavior = 'selection' | 'all';
14110
+
14111
+ /*
14112
+ * Copyright 2020 Adobe. All rights reserved.
14113
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14114
+ * you may not use this file except in compliance with the License. You may obtain a copy
14115
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14116
+ *
14117
+ * Unless required by applicable law or agreed to in writing, software distributed under
14118
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14119
+ * OF ANY KIND, either express or implied. See the License for the specific language
14120
+ * governing permissions and limitations under the License.
14121
+ */
14122
+
14123
+
14124
+
14125
+ interface Rect {
14126
+ x: number,
14127
+ y: number,
14128
+ width: number,
14129
+ height: number
14130
+ }
14131
+
14132
+ interface Size {
14133
+ width: number,
14134
+ height: number
14135
+ }
14136
+
14137
+ /** A LayoutDelegate provides layout information for collection items. */
14138
+ interface LayoutDelegate {
14139
+ /** Returns a rectangle for the item with the given key. */
14140
+ getItemRect(key: Key): Rect | null,
14141
+ /** Returns the visible rectangle of the collection. */
14142
+ getVisibleRect(): Rect,
14143
+ /** Returns the size of the scrollable content in the collection. */
14144
+ getContentSize(): Size,
14145
+ /** Returns a list of keys between `from` and `to`. */
14146
+ getKeyRange?(from: Key, to: Key): Key[]
14147
+ }
14148
+
14149
+ /**
14150
+ * A generic interface to access a readonly sequential
14151
+ * collection of unique keyed items.
14152
+ */
14153
+ interface Collection<T> extends Iterable<T> {
14154
+ /** The number of items in the collection. */
14155
+ readonly size: number,
14156
+
14157
+ /** Iterate over all keys in the collection. */
14158
+ getKeys(): Iterable<Key>,
14159
+
14160
+ /** Get an item by its key. */
14161
+ getItem(key: Key): T | null,
14162
+
14163
+ /** Get an item by the index of its key. */
14164
+ at(idx: number): T | null,
14165
+
14166
+ /** Get the key that comes before the given key in the collection. */
14167
+ getKeyBefore(key: Key): Key | null,
14168
+
14169
+ /** Get the key that comes after the given key in the collection. */
14170
+ getKeyAfter(key: Key): Key | null,
14171
+
14172
+ /** Get the first key in the collection. */
14173
+ getFirstKey(): Key | null,
14174
+
14175
+ /** Get the last key in the collection. */
14176
+ getLastKey(): Key | null,
14177
+
14178
+ /** Iterate over the child items of the given key. */
14179
+ getChildren?(key: Key): Iterable<T>,
14180
+
14181
+ /** Returns a string representation of the item's contents. */
14182
+ getTextValue?(key: Key): string,
14183
+
14184
+ /** Filters the collection using the given function. */
14185
+ UNSTABLE_filter?(filterFn: (nodeValue: string) => boolean): Collection<T>
13898
14186
  }
13899
- interface SelectOptionConfig<C extends AnyPlasmicClass> {
13900
- isSelectedVariant: VariantDef<PlasmicClassVariants<C>>;
13901
- isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
13902
- isHighlightedVariant?: VariantDef<PlasmicClassVariants<C>>;
13903
- labelSlot: keyof PlasmicClassArgs<C>;
13904
- root: keyof PlasmicClassOverrides<C>;
13905
- labelContainer: keyof PlasmicClassOverrides<C>;
14187
+
14188
+ interface Node<T> {
14189
+ /** The type of item this node represents. */
14190
+ type: string,
14191
+ /** A unique key for the node. */
14192
+ key: Key,
14193
+ /** The object value the node was created from. */
14194
+ value: T | null,
14195
+ /** The level of depth this node is at in the hierarchy. */
14196
+ level: number,
14197
+ /** Whether this item has children, even if not loaded yet. */
14198
+ hasChildNodes: boolean,
14199
+ /**
14200
+ * The loaded children of this node.
14201
+ * @deprecated Use `collection.getChildren(node.key)` instead.
14202
+ */
14203
+ childNodes: Iterable<Node<T>>,
14204
+ /** The rendered contents of this node (e.g. JSX). */
14205
+ rendered: ReactNode,
14206
+ /** A string value for this node, used for features like typeahead. */
14207
+ textValue: string,
14208
+ /** An accessibility label for this node. */
14209
+ 'aria-label'?: string,
14210
+ /** The index of this node within its parent. */
14211
+ index: number,
14212
+ /** A function that should be called to wrap the rendered node. */
14213
+ wrapper?: (element: ReactElement) => ReactElement,
14214
+ /** The key of the parent node. */
14215
+ parentKey?: Key | null,
14216
+ /** The key of the node before this node. */
14217
+ prevKey?: Key | null,
14218
+ /** The key of the node after this node. */
14219
+ nextKey?: Key | null,
14220
+ /** Additional properties specific to a particular node type. */
14221
+ props?: any,
14222
+ /** @private */
14223
+ shouldInvalidate?: (context: any) => boolean,
14224
+ /** A function that renders this node to a React Element in the DOM. */
14225
+ render?: (node: Node<any>) => ReactElement
13906
14226
  }
13907
- type SelectOptionRef = React$1.Ref<HTMLElement>;
13908
- declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
13909
- plasmicProps: {
13910
- variants: PlasmicClassVariants<C>;
13911
- args: PlasmicClassArgs<C>;
13912
- overrides: PlasmicClassOverrides<C>;
13913
- };
13914
- };
13915
14227
 
13916
- interface BaseSelectOptionGroupProps extends SectionLikeProps, StyleProps {
14228
+ /*
14229
+ * Copyright 2020 Adobe. All rights reserved.
14230
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14231
+ * you may not use this file except in compliance with the License. You may obtain a copy
14232
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14233
+ *
14234
+ * Unless required by applicable law or agreed to in writing, software distributed under
14235
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14236
+ * OF ANY KIND, either express or implied. See the License for the specific language
14237
+ * governing permissions and limitations under the License.
14238
+ */
14239
+
14240
+
14241
+
14242
+ type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
14243
+
14244
+ interface PressEvent {
14245
+ /** The type of press event being fired. */
14246
+ type: 'pressstart' | 'pressend' | 'pressup' | 'press',
14247
+ /** The pointer type that triggered the press event. */
14248
+ pointerType: PointerType,
14249
+ /** The target element of the press event. */
14250
+ target: Element,
14251
+ /** Whether the shift keyboard modifier was held during the press event. */
14252
+ shiftKey: boolean,
14253
+ /** Whether the ctrl keyboard modifier was held during the press event. */
14254
+ ctrlKey: boolean,
14255
+ /** Whether the meta keyboard modifier was held during the press event. */
14256
+ metaKey: boolean,
14257
+ /** Whether the alt keyboard modifier was held during the press event. */
14258
+ altKey: boolean,
14259
+ /** X position relative to the target. */
14260
+ x: number,
14261
+ /** Y position relative to the target. */
14262
+ y: number,
14263
+ /**
14264
+ * By default, press events stop propagation to parent elements.
14265
+ * In cases where a handler decides not to handle a specific event,
14266
+ * it can call `continuePropagation()` to allow a parent to handle it.
14267
+ */
14268
+ continuePropagation(): void
13917
14269
  }
13918
- interface SelectOptionGroupConfig<C extends AnyPlasmicClass> {
13919
- noTitleVariant: VariantDef<PlasmicClassVariants<C>>;
13920
- isFirstVariant: VariantDef<PlasmicClassVariants<C>>;
13921
- optionsSlot: keyof PlasmicClassArgs<C>;
13922
- titleSlot: keyof PlasmicClassArgs<C>;
13923
- root: keyof PlasmicClassOverrides<C>;
13924
- separator: keyof PlasmicClassOverrides<C>;
13925
- titleContainer: keyof PlasmicClassOverrides<C>;
13926
- optionsContainer: keyof PlasmicClassOverrides<C>;
14270
+
14271
+ interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
14272
+ /** The type of long press event being fired. */
14273
+ type: 'longpressstart' | 'longpressend' | 'longpress'
13927
14274
  }
13928
- declare function useSelectOptionGroup<P extends BaseSelectOptionGroupProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionGroupConfig<C>): {
13929
- plasmicProps: {
13930
- variants: PlasmicClassVariants<C>;
13931
- args: PlasmicClassArgs<C>;
13932
- overrides: PlasmicClassOverrides<C>;
13933
- };
13934
- };
14275
+
14276
+ /*
14277
+ * Copyright 2023 Adobe. All rights reserved.
14278
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14279
+ * you may not use this file except in compliance with the License. You may obtain a copy
14280
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14281
+ *
14282
+ * Unless required by applicable law or agreed to in writing, software distributed under
14283
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14284
+ * OF ANY KIND, either express or implied. See the License for the specific language
14285
+ * governing permissions and limitations under the License.
14286
+ */
14287
+
14288
+ type Key = string | number;
13935
14289
 
13936
14290
  interface FocusState {
13937
14291
  /** Whether the collection is currently focused. */
@@ -13939,11 +14293,11 @@ interface FocusState {
13939
14293
  /** Sets whether the collection is focused. */
13940
14294
  setFocused(isFocused: boolean): void;
13941
14295
  /** The current focused key in the collection. */
13942
- readonly focusedKey: Key;
14296
+ readonly focusedKey: Key | null;
13943
14297
  /** Whether the first or last child of the focused key should receive focus. */
13944
- readonly childFocusStrategy: FocusStrategy;
14298
+ readonly childFocusStrategy: FocusStrategy | null;
13945
14299
  /** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
13946
- setFocusedKey(key: Key, child?: FocusStrategy): void;
14300
+ setFocusedKey(key: Key | null, child?: FocusStrategy): void;
13947
14301
  }
13948
14302
  interface MultipleSelectionState extends FocusState {
13949
14303
  /** The type of selection that is allowed in the collection. */
@@ -14017,14 +14371,18 @@ interface MultipleSelectionManager extends FocusState {
14017
14371
  isLink(key: Key): boolean;
14018
14372
  /** Returns the props for the given item. */
14019
14373
  getItemProps(key: Key): any;
14374
+ /** The collection of nodes that the selection manager handles. */
14375
+ collection: Collection<Node<unknown>>;
14020
14376
  }
14021
14377
  interface SelectionManagerOptions {
14022
14378
  allowsCellSelection?: boolean;
14379
+ layoutDelegate?: LayoutDelegate;
14023
14380
  }
14024
14381
  /**
14025
14382
  * An interface for reading and updating multiple selection state.
14026
14383
  */
14027
14384
  declare class SelectionManager implements MultipleSelectionManager {
14385
+ collection: Collection<Node<unknown>>;
14028
14386
  constructor(collection: Collection<Node<unknown>>, state: MultipleSelectionState, options?: SelectionManagerOptions);
14029
14387
  /**
14030
14388
  * The type of selection that is allowed in the collection.
@@ -14053,9 +14411,9 @@ declare class SelectionManager implements MultipleSelectionManager {
14053
14411
  /**
14054
14412
  * The current focused key in the collection.
14055
14413
  */
14056
- get focusedKey(): Key;
14414
+ get focusedKey(): Key | null;
14057
14415
  /** Whether the first or last child of the focused key should receive focus. */
14058
- get childFocusStrategy(): FocusStrategy;
14416
+ get childFocusStrategy(): FocusStrategy | null;
14059
14417
  /**
14060
14418
  * Sets the focused key.
14061
14419
  */
@@ -14122,13 +14480,14 @@ declare class SelectionManager implements MultipleSelectionManager {
14122
14480
  isDisabled(key: Key): boolean;
14123
14481
  isLink(key: Key): boolean;
14124
14482
  getItemProps(key: Key): any;
14483
+ withCollection(collection: Collection<Node<unknown>>): SelectionManager;
14125
14484
  }
14126
14485
 
14127
14486
  interface ListState<T> {
14128
14487
  /** A collection of items in the list. */
14129
- collection: Collection<Node<T>>;
14488
+ collection: Collection$1<Node$1<T>>;
14130
14489
  /** A set of items that are disabled. */
14131
- disabledKeys: Set<Key>;
14490
+ disabledKeys: Set<Key$1>;
14132
14491
  /** A selection manager to read and update multiple selection state. */
14133
14492
  selectionManager: SelectionManager;
14134
14493
  }
@@ -14149,6 +14508,136 @@ declare const SelectContext: React$1.Context<ListState<any> | undefined>;
14149
14508
 
14150
14509
 
14151
14510
 
14511
+ interface AriaLabelingProps {
14512
+ /**
14513
+ * Defines a string value that labels the current element.
14514
+ */
14515
+ 'aria-label'?: string,
14516
+
14517
+ /**
14518
+ * Identifies the element (or elements) that labels the current element.
14519
+ */
14520
+ 'aria-labelledby'?: string,
14521
+
14522
+ /**
14523
+ * Identifies the element (or elements) that describes the object.
14524
+ */
14525
+ 'aria-describedby'?: string,
14526
+
14527
+ /**
14528
+ * Identifies the element (or elements) that provide a detailed, extended description for the object.
14529
+ */
14530
+ 'aria-details'?: string
14531
+ }
14532
+
14533
+ // A set of common DOM props that are allowed on any component
14534
+ // Ensure this is synced with DOMPropNames in filterDOMProps
14535
+ interface DOMProps {
14536
+ /**
14537
+ * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
14538
+ */
14539
+ id?: string
14540
+ }
14541
+
14542
+ interface FocusableDOMProps extends DOMProps {
14543
+ /**
14544
+ * Whether to exclude the element from the sequential tab order. If true,
14545
+ * the element will not be focusable via the keyboard by tabbing. This should
14546
+ * be avoided except in rare scenarios where an alternative means of accessing
14547
+ * the element or its functionality via the keyboard is available.
14548
+ */
14549
+ excludeFromTabOrder?: boolean
14550
+ }
14551
+
14552
+ interface InputDOMProps {
14553
+ /**
14554
+ * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
14555
+ */
14556
+ name?: string
14557
+ }
14558
+
14559
+ /*
14560
+ * Copyright 2020 Adobe. All rights reserved.
14561
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14562
+ * you may not use this file except in compliance with the License. You may obtain a copy
14563
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14564
+ *
14565
+ * Unless required by applicable law or agreed to in writing, software distributed under
14566
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14567
+ * OF ANY KIND, either express or implied. See the License for the specific language
14568
+ * governing permissions and limitations under the License.
14569
+ */
14570
+
14571
+
14572
+
14573
+ interface InputBase {
14574
+ /** Whether the input is disabled. */
14575
+ isDisabled?: boolean,
14576
+ /** Whether the input can be selected but not changed by the user. */
14577
+ isReadOnly?: boolean
14578
+ }
14579
+
14580
+ /*
14581
+ * Copyright 2020 Adobe. All rights reserved.
14582
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14583
+ * you may not use this file except in compliance with the License. You may obtain a copy
14584
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14585
+ *
14586
+ * Unless required by applicable law or agreed to in writing, software distributed under
14587
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14588
+ * OF ANY KIND, either express or implied. See the License for the specific language
14589
+ * governing permissions and limitations under the License.
14590
+ */
14591
+
14592
+
14593
+
14594
+ // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
14595
+ // is not to propagate. This can be overridden by calling continuePropagation() on the event.
14596
+ type BaseEvent<T extends SyntheticEvent> = T & {
14597
+ /**
14598
+ * Use continuePropagation.
14599
+ * @deprecated */
14600
+ stopPropagation(): void,
14601
+ continuePropagation(): void
14602
+ }
14603
+
14604
+ type KeyboardEvent = BaseEvent<KeyboardEvent$3<any>>;
14605
+
14606
+ interface KeyboardEvents {
14607
+ /** Handler that is called when a key is pressed. */
14608
+ onKeyDown?: (e: KeyboardEvent) => void,
14609
+ /** Handler that is called when a key is released. */
14610
+ onKeyUp?: (e: KeyboardEvent) => void
14611
+ }
14612
+
14613
+ interface FocusEvents<Target = Element> {
14614
+ /** Handler that is called when the element receives focus. */
14615
+ onFocus?: (e: FocusEvent<Target>) => void,
14616
+ /** Handler that is called when the element loses focus. */
14617
+ onBlur?: (e: FocusEvent<Target>) => void,
14618
+ /** Handler that is called when the element's focus status changes. */
14619
+ onFocusChange?: (isFocused: boolean) => void
14620
+ }
14621
+
14622
+ interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
14623
+ /** Whether the element should receive focus on render. */
14624
+ autoFocus?: boolean
14625
+ }
14626
+
14627
+ /*
14628
+ * Copyright 2020 Adobe. All rights reserved.
14629
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14630
+ * you may not use this file except in compliance with the License. You may obtain a copy
14631
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14632
+ *
14633
+ * Unless required by applicable law or agreed to in writing, software distributed under
14634
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14635
+ * OF ANY KIND, either express or implied. See the License for the specific language
14636
+ * governing permissions and limitations under the License.
14637
+ */
14638
+
14639
+
14640
+
14152
14641
  interface SwitchBase extends InputBase, FocusableProps {
14153
14642
  /**
14154
14643
  * The content to render as the Switch's label.
@@ -14253,7 +14742,7 @@ declare function useTextInput<P extends PlumeTextInputProps, C extends AnyPlasmi
14253
14742
  };
14254
14743
  };
14255
14744
 
14256
- interface BaseTriggeredOverlayProps extends StyleProps, DOMProps {
14745
+ interface BaseTriggeredOverlayProps extends StyleProps, DOMProps$1 {
14257
14746
  children?: React$1.ReactNode;
14258
14747
  }
14259
14748
  interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
@@ -14289,7 +14778,7 @@ interface OverlayTriggerState {
14289
14778
  interface TriggeredOverlayContextValue {
14290
14779
  triggerRef: React$1.RefObject<HTMLElement>;
14291
14780
  state: OverlayTriggerState;
14292
- autoFocus?: boolean | FocusStrategy;
14781
+ autoFocus?: boolean | FocusStrategy$1;
14293
14782
  placement?: Placement;
14294
14783
  overlayMatchTriggerWidth?: boolean;
14295
14784
  overlayMinTriggerWidth?: boolean;