@plasmicapp/react-web 0.2.429 → 1.0.0
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 +727 -480
- package/dist/index.cjs.js +48 -42
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +49 -43
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +1 -5
- package/dist/states/helpers.d.ts +0 -2
- package/dist/states/types.d.ts +0 -1
- package/package.json +13 -24
- package/skinny/dist/index.js +46 -40
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +1 -1
- package/skinny/dist/plume/menu/index.js +1 -1
- package/skinny/dist/plume/menu-button/index.js +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +1 -1
- package/skinny/dist/render/ssr.d.ts +1 -5
- package/skinny/dist/{ssr-6d9f9c44.js → ssr-e496f477.js} +4 -4
- package/skinny/dist/ssr-e496f477.js.map +1 -0
- package/skinny/dist/states/helpers.d.ts +0 -2
- package/skinny/dist/states/types.d.ts +0 -1
- package/dist/nextjs-app-router/index.d.ts +0 -1
- package/dist/nextjs-app-router/react-server/index.d.ts +0 -15
- package/lib/nextjs-app-router/index.cjs.js +0 -11
- package/lib/nextjs-app-router/index.cjs.js.map +0 -1
- package/lib/nextjs-app-router/index.d.ts +0 -1
- package/lib/nextjs-app-router/index.js +0 -2
- package/lib/nextjs-app-router/index.js.map +0 -1
- package/lib/nextjs-app-router/react-server/index.cjs.js +0 -143
- package/lib/nextjs-app-router/react-server/index.cjs.js.map +0 -1
- package/lib/nextjs-app-router/react-server/index.d.ts +0 -15
- package/lib/nextjs-app-router/react-server/index.js +0 -130
- package/lib/nextjs-app-router/react-server/index.js.map +0 -1
- package/skinny/dist/nextjs-app-router/index.d.ts +0 -1
- package/skinny/dist/nextjs-app-router/react-server/index.d.ts +0 -15
- package/skinny/dist/ssr-6d9f9c44.js.map +0 -1
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$
|
|
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 {
|
|
@@ -12168,7 +12168,6 @@ interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
|
12168
12168
|
type CustomType<P> = RichCustomType<P> | CustomControl<P>;
|
|
12169
12169
|
interface DynamicType$1<P> extends PropTypeBase<ComponentControlContext<P>>, DynamicCore<ComponentControlContext<P>, PropType$1<P>> {
|
|
12170
12170
|
}
|
|
12171
|
-
type PrimitiveType<P = any> = Extract<StringType$1<P> | BooleanType$1<P> | NumberType$1<P> | JSONLikeType<P>, string>;
|
|
12172
12171
|
type PropType$1<P> = StringType$1<P> | BooleanType$1<P> | GraphQLType$1<P> | NumberType$1<P> | JSONLikeType<P> | DataSourceType<P> | DataPickerType<P> | ExprEditorType<P> | FormValidationRulesType<P> | EventHandlerType<P> | ChoiceType$1<P> | CustomType<P> | DynamicType$1<P> | ImageUrlType<P> | SlotType<P> | DateStringType$1<P> | DateRangeStringsType$1<P>;
|
|
12173
12172
|
type ArgType<P> = Exclude<PropType$1<P>, SlotType<P> | EventHandlerType<P>>;
|
|
12174
12173
|
type StringCompatType<P> = DateStringType$1<P> | StringType$1<P> | ChoiceType$1<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
@@ -12176,45 +12175,6 @@ type BoolCompatType<P> = BooleanType$1<P> | CustomType<P> | DataPickerType<P>;
|
|
|
12176
12175
|
type NumberCompatType<P> = NumberType$1<P> | CustomType<P> | DataPickerType<P>;
|
|
12177
12176
|
type RestrictPropType$1<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType$1<P>;
|
|
12178
12177
|
|
|
12179
|
-
type Fetcher = (...args: any[]) => Promise<any>;
|
|
12180
|
-
interface FetcherMeta {
|
|
12181
|
-
/**
|
|
12182
|
-
* Any unique identifying string for this fetcher.
|
|
12183
|
-
*/
|
|
12184
|
-
name: string;
|
|
12185
|
-
/**
|
|
12186
|
-
* The Studio-user-friendly display name.
|
|
12187
|
-
*/
|
|
12188
|
-
displayName?: string;
|
|
12189
|
-
/**
|
|
12190
|
-
* The symbol to import from the importPath.
|
|
12191
|
-
*/
|
|
12192
|
-
importName?: string;
|
|
12193
|
-
args: {
|
|
12194
|
-
name: string;
|
|
12195
|
-
type: PrimitiveType;
|
|
12196
|
-
}[];
|
|
12197
|
-
returns: PrimitiveType;
|
|
12198
|
-
/**
|
|
12199
|
-
* Either the path to the fetcher relative to `rootDir` or the npm
|
|
12200
|
-
* package name
|
|
12201
|
-
*/
|
|
12202
|
-
importPath: string;
|
|
12203
|
-
/**
|
|
12204
|
-
* Whether it's a default export or named export
|
|
12205
|
-
*/
|
|
12206
|
-
isDefaultExport?: boolean;
|
|
12207
|
-
}
|
|
12208
|
-
interface FetcherRegistration {
|
|
12209
|
-
fetcher: Fetcher;
|
|
12210
|
-
meta: FetcherMeta;
|
|
12211
|
-
}
|
|
12212
|
-
declare global {
|
|
12213
|
-
interface Window {
|
|
12214
|
-
__PlasmicFetcherRegistry: FetcherRegistration[];
|
|
12215
|
-
}
|
|
12216
|
-
}
|
|
12217
|
-
|
|
12218
12178
|
/**
|
|
12219
12179
|
* Control type for building a custom query format.
|
|
12220
12180
|
*
|
|
@@ -13040,10 +13000,6 @@ interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue {
|
|
|
13040
13000
|
platform?: "nextjs" | "gatsby";
|
|
13041
13001
|
children?: React$1.ReactNode;
|
|
13042
13002
|
i18n?: PlasmicI18NContextValue;
|
|
13043
|
-
/**
|
|
13044
|
-
* @deprecated use i18n.translator instead
|
|
13045
|
-
*/
|
|
13046
|
-
translator?: PlasmicTranslator;
|
|
13047
13003
|
Head?: React$1.ComponentType<any>;
|
|
13048
13004
|
Link?: React$1.ComponentType<any>;
|
|
13049
13005
|
disableLoadingBoundary?: boolean;
|
|
@@ -13198,7 +13154,189 @@ declare function Trans({ transKey, children }: TransProps): React__default.React
|
|
|
13198
13154
|
|
|
13199
13155
|
|
|
13200
13156
|
|
|
13201
|
-
|
|
13157
|
+
/** Any focusable element, including both HTML and SVG elements. */
|
|
13158
|
+
interface FocusableElement$1 extends Element, HTMLOrSVGElement {}
|
|
13159
|
+
|
|
13160
|
+
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
13161
|
+
interface DOMAttributes$1<T = FocusableElement$1> extends AriaAttributes, DOMAttributes$2<T> {
|
|
13162
|
+
id?: string | undefined,
|
|
13163
|
+
role?: AriaRole | undefined,
|
|
13164
|
+
tabIndex?: number | undefined,
|
|
13165
|
+
style?: CSSProperties$1 | undefined,
|
|
13166
|
+
className?: string | undefined
|
|
13167
|
+
}
|
|
13168
|
+
|
|
13169
|
+
/*
|
|
13170
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13171
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13172
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13173
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13174
|
+
*
|
|
13175
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13176
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13177
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13178
|
+
* governing permissions and limitations under the License.
|
|
13179
|
+
*/
|
|
13180
|
+
|
|
13181
|
+
|
|
13182
|
+
|
|
13183
|
+
/** Any focusable element, including both HTML and SVG elements. */
|
|
13184
|
+
interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
13185
|
+
|
|
13186
|
+
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
13187
|
+
interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$2<T> {
|
|
13188
|
+
id?: string | undefined,
|
|
13189
|
+
role?: AriaRole | undefined,
|
|
13190
|
+
tabIndex?: number | undefined,
|
|
13191
|
+
style?: CSSProperties$1 | undefined,
|
|
13192
|
+
className?: string | undefined
|
|
13193
|
+
}
|
|
13194
|
+
|
|
13195
|
+
interface PressResult {
|
|
13196
|
+
/** Whether the target is currently pressed. */
|
|
13197
|
+
isPressed: boolean;
|
|
13198
|
+
/** Props to spread on the target element. */
|
|
13199
|
+
pressProps: DOMAttributes;
|
|
13200
|
+
}
|
|
13201
|
+
interface HoverResult {
|
|
13202
|
+
/** Props to spread on the target element. */
|
|
13203
|
+
hoverProps: DOMAttributes;
|
|
13204
|
+
isHovered: boolean;
|
|
13205
|
+
}
|
|
13206
|
+
|
|
13207
|
+
interface FocusRingAria {
|
|
13208
|
+
/** Whether the element is currently focused. */
|
|
13209
|
+
isFocused: boolean;
|
|
13210
|
+
/** Whether keyboard focus should be visible. */
|
|
13211
|
+
isFocusVisible: boolean;
|
|
13212
|
+
/** Props to apply to the container element with the focus ring. */
|
|
13213
|
+
focusProps: DOMAttributes$1;
|
|
13214
|
+
}
|
|
13215
|
+
|
|
13216
|
+
type FocusHookResult = [boolean, FocusRingAria["focusProps"]];
|
|
13217
|
+
type HoverHookResult = [boolean, HoverResult["hoverProps"]];
|
|
13218
|
+
type PressHookResult = [boolean, PressResult["pressProps"]];
|
|
13219
|
+
declare function useFocused(opts: {
|
|
13220
|
+
isTextInput?: boolean;
|
|
13221
|
+
}): FocusHookResult;
|
|
13222
|
+
declare function useFocusVisible(opts: {
|
|
13223
|
+
isTextInput?: boolean;
|
|
13224
|
+
}): FocusHookResult;
|
|
13225
|
+
declare function useFocusedWithin(opts: {
|
|
13226
|
+
isTextInput?: boolean;
|
|
13227
|
+
}): FocusHookResult;
|
|
13228
|
+
declare function useFocusVisibleWithin(opts: {
|
|
13229
|
+
isTextInput?: boolean;
|
|
13230
|
+
}): FocusHookResult;
|
|
13231
|
+
declare function useHover(): HoverHookResult;
|
|
13232
|
+
declare function usePressed(): PressHookResult;
|
|
13233
|
+
declare const TRIGGER_TO_HOOK: {
|
|
13234
|
+
readonly useHover: typeof useHover;
|
|
13235
|
+
readonly useFocused: typeof useFocused;
|
|
13236
|
+
readonly useFocusVisible: typeof useFocusVisible;
|
|
13237
|
+
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
13238
|
+
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
13239
|
+
readonly usePressed: typeof usePressed;
|
|
13240
|
+
};
|
|
13241
|
+
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
13242
|
+
interface TriggerOpts {
|
|
13243
|
+
isTextInput?: boolean;
|
|
13244
|
+
}
|
|
13245
|
+
/**
|
|
13246
|
+
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
13247
|
+
* as it's not valid to install variable React hooks!
|
|
13248
|
+
*/
|
|
13249
|
+
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
|
|
13250
|
+
|
|
13251
|
+
declare const classNames: any;
|
|
13252
|
+
|
|
13253
|
+
declare function setPlumeStrictMode(mode: boolean): void;
|
|
13254
|
+
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
13255
|
+
type VariantArgsChoices<V> = {
|
|
13256
|
+
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
13257
|
+
};
|
|
13258
|
+
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
13259
|
+
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
13260
|
+
[K in keyof V]: [K, V[K]];
|
|
13261
|
+
}>;
|
|
13262
|
+
type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
13263
|
+
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
13264
|
+
group: T1;
|
|
13265
|
+
variant: T2;
|
|
13266
|
+
} : never;
|
|
13267
|
+
type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
13268
|
+
type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
13269
|
+
(props: {
|
|
13270
|
+
variants?: V;
|
|
13271
|
+
args?: A;
|
|
13272
|
+
overrides?: O;
|
|
13273
|
+
}): React$1.ReactNode;
|
|
13274
|
+
internalVariantProps: (keyof V)[];
|
|
13275
|
+
internalArgProps: (keyof A)[];
|
|
13276
|
+
};
|
|
13277
|
+
type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
13278
|
+
type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
13279
|
+
type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
13280
|
+
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
13281
|
+
|
|
13282
|
+
interface PlumeCommonProps {
|
|
13283
|
+
showStartIcon?: boolean;
|
|
13284
|
+
showEndIcon?: boolean;
|
|
13285
|
+
startIcon?: React$1.ReactNode;
|
|
13286
|
+
endIcon?: React$1.ReactNode;
|
|
13287
|
+
children?: React$1.ReactNode;
|
|
13288
|
+
isDisabled?: boolean;
|
|
13289
|
+
}
|
|
13290
|
+
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
13291
|
+
}
|
|
13292
|
+
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
13293
|
+
}
|
|
13294
|
+
interface PlumeActualButtonProps {
|
|
13295
|
+
submitsForm?: boolean;
|
|
13296
|
+
}
|
|
13297
|
+
interface PlumeAnchorProps {
|
|
13298
|
+
link?: string;
|
|
13299
|
+
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
13300
|
+
}
|
|
13301
|
+
type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
|
|
13302
|
+
type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
13303
|
+
type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
|
|
13304
|
+
type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
|
|
13305
|
+
type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
|
|
13306
|
+
type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
|
|
13307
|
+
type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
13308
|
+
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
13309
|
+
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
13310
|
+
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13311
|
+
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13312
|
+
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13313
|
+
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13314
|
+
contentSlot: keyof PlasmicClassArgs<C>;
|
|
13315
|
+
root: keyof PlasmicClassOverrides<C>;
|
|
13316
|
+
}
|
|
13317
|
+
declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
13318
|
+
plasmicProps: {
|
|
13319
|
+
variants: PlasmicClassVariants<C>;
|
|
13320
|
+
args: PlasmicClassArgs<C>;
|
|
13321
|
+
overrides: PlasmicClassOverrides<C>;
|
|
13322
|
+
};
|
|
13323
|
+
};
|
|
13324
|
+
|
|
13325
|
+
/*
|
|
13326
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13327
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13328
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13329
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13330
|
+
*
|
|
13331
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13332
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13333
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13334
|
+
* governing permissions and limitations under the License.
|
|
13335
|
+
*/
|
|
13336
|
+
|
|
13337
|
+
|
|
13338
|
+
|
|
13339
|
+
interface AriaLabelingProps$2 {
|
|
13202
13340
|
/**
|
|
13203
13341
|
* Defines a string value that labels the current element.
|
|
13204
13342
|
*/
|
|
@@ -13230,14 +13368,14 @@ interface AriaValidationProps {
|
|
|
13230
13368
|
|
|
13231
13369
|
// A set of common DOM props that are allowed on any component
|
|
13232
13370
|
// Ensure this is synced with DOMPropNames in filterDOMProps
|
|
13233
|
-
interface DOMProps$
|
|
13371
|
+
interface DOMProps$2 {
|
|
13234
13372
|
/**
|
|
13235
13373
|
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
13236
13374
|
*/
|
|
13237
13375
|
id?: string
|
|
13238
13376
|
}
|
|
13239
13377
|
|
|
13240
|
-
interface FocusableDOMProps$
|
|
13378
|
+
interface FocusableDOMProps$2 extends DOMProps$2 {
|
|
13241
13379
|
/**
|
|
13242
13380
|
* Whether to exclude the element from the sequential tab order. If true,
|
|
13243
13381
|
* the element will not be focusable via the keyboard by tabbing. This should
|
|
@@ -13247,25 +13385,13 @@ interface FocusableDOMProps$1 extends DOMProps$1 {
|
|
|
13247
13385
|
excludeFromTabOrder?: boolean
|
|
13248
13386
|
}
|
|
13249
13387
|
|
|
13250
|
-
interface InputDOMProps {
|
|
13388
|
+
interface InputDOMProps$1 {
|
|
13251
13389
|
/**
|
|
13252
13390
|
* 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).
|
|
13253
13391
|
*/
|
|
13254
13392
|
name?: string
|
|
13255
13393
|
}
|
|
13256
13394
|
|
|
13257
|
-
/** Any focusable element, including both HTML and SVG elements. */
|
|
13258
|
-
interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
13259
|
-
|
|
13260
|
-
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
13261
|
-
interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
|
|
13262
|
-
id?: string | undefined,
|
|
13263
|
-
role?: AriaRole | undefined,
|
|
13264
|
-
tabIndex?: number | undefined,
|
|
13265
|
-
style?: CSSProperties$1 | undefined,
|
|
13266
|
-
className?: string | undefined
|
|
13267
|
-
}
|
|
13268
|
-
|
|
13269
13395
|
/*
|
|
13270
13396
|
* Copyright 2020 Adobe. All rights reserved.
|
|
13271
13397
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -13307,7 +13433,7 @@ interface Validation<T = unknown> {
|
|
|
13307
13433
|
validate?: (value: T) => ValidationError | true | null | undefined
|
|
13308
13434
|
}
|
|
13309
13435
|
|
|
13310
|
-
interface InputBase$
|
|
13436
|
+
interface InputBase$2 {
|
|
13311
13437
|
/** Whether the input is disabled. */
|
|
13312
13438
|
isDisabled?: boolean,
|
|
13313
13439
|
/** Whether the input can be selected but not changed by the user. */
|
|
@@ -13328,12 +13454,38 @@ interface InputBase$1 {
|
|
|
13328
13454
|
|
|
13329
13455
|
|
|
13330
13456
|
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
type
|
|
13457
|
+
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
13458
|
+
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
13459
|
+
type BaseEvent$2<T extends SyntheticEvent> = T & {
|
|
13460
|
+
/**
|
|
13461
|
+
* Use continuePropagation.
|
|
13462
|
+
* @deprecated */
|
|
13463
|
+
stopPropagation(): void,
|
|
13464
|
+
continuePropagation(): void
|
|
13465
|
+
}
|
|
13334
13466
|
|
|
13335
|
-
type
|
|
13336
|
-
|
|
13467
|
+
type KeyboardEvent$2 = BaseEvent$2<KeyboardEvent$3<any>>;
|
|
13468
|
+
|
|
13469
|
+
interface KeyboardEvents$2 {
|
|
13470
|
+
/** Handler that is called when a key is pressed. */
|
|
13471
|
+
onKeyDown?: (e: KeyboardEvent$2) => void,
|
|
13472
|
+
/** Handler that is called when a key is released. */
|
|
13473
|
+
onKeyUp?: (e: KeyboardEvent$2) => void
|
|
13474
|
+
}
|
|
13475
|
+
|
|
13476
|
+
interface FocusEvents$2<Target = Element> {
|
|
13477
|
+
/** Handler that is called when the element receives focus. */
|
|
13478
|
+
onFocus?: (e: FocusEvent<Target>) => void,
|
|
13479
|
+
/** Handler that is called when the element loses focus. */
|
|
13480
|
+
onBlur?: (e: FocusEvent<Target>) => void,
|
|
13481
|
+
/** Handler that is called when the element's focus status changes. */
|
|
13482
|
+
onFocusChange?: (isFocused: boolean) => void
|
|
13483
|
+
}
|
|
13484
|
+
|
|
13485
|
+
interface FocusableProps$2<Target = Element> extends FocusEvents$2<Target>, KeyboardEvents$2 {
|
|
13486
|
+
/** Whether the element should receive focus on render. */
|
|
13487
|
+
autoFocus?: boolean
|
|
13488
|
+
}
|
|
13337
13489
|
|
|
13338
13490
|
/*
|
|
13339
13491
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -13349,349 +13501,7 @@ type DisabledBehavior = 'selection' | 'all';
|
|
|
13349
13501
|
|
|
13350
13502
|
|
|
13351
13503
|
|
|
13352
|
-
interface
|
|
13353
|
-
x: number,
|
|
13354
|
-
y: number,
|
|
13355
|
-
width: number,
|
|
13356
|
-
height: number
|
|
13357
|
-
}
|
|
13358
|
-
|
|
13359
|
-
interface Size {
|
|
13360
|
-
width: number,
|
|
13361
|
-
height: number
|
|
13362
|
-
}
|
|
13363
|
-
|
|
13364
|
-
/** A LayoutDelegate provides layout information for collection items. */
|
|
13365
|
-
interface LayoutDelegate {
|
|
13366
|
-
/** Returns a rectangle for the item with the given key. */
|
|
13367
|
-
getItemRect(key: Key): Rect | null,
|
|
13368
|
-
/** Returns the visible rectangle of the collection. */
|
|
13369
|
-
getVisibleRect(): Rect,
|
|
13370
|
-
/** Returns the size of the scrollable content in the collection. */
|
|
13371
|
-
getContentSize(): Size,
|
|
13372
|
-
/** Returns a list of keys between `from` and `to`. */
|
|
13373
|
-
getKeyRange?(from: Key, to: Key): Key[]
|
|
13374
|
-
}
|
|
13375
|
-
|
|
13376
|
-
/**
|
|
13377
|
-
* A generic interface to access a readonly sequential
|
|
13378
|
-
* collection of unique keyed items.
|
|
13379
|
-
*/
|
|
13380
|
-
interface Collection<T> extends Iterable<T> {
|
|
13381
|
-
/** The number of items in the collection. */
|
|
13382
|
-
readonly size: number,
|
|
13383
|
-
|
|
13384
|
-
/** Iterate over all keys in the collection. */
|
|
13385
|
-
getKeys(): Iterable<Key>,
|
|
13386
|
-
|
|
13387
|
-
/** Get an item by its key. */
|
|
13388
|
-
getItem(key: Key): T | null,
|
|
13389
|
-
|
|
13390
|
-
/** Get an item by the index of its key. */
|
|
13391
|
-
at(idx: number): T | null,
|
|
13392
|
-
|
|
13393
|
-
/** Get the key that comes before the given key in the collection. */
|
|
13394
|
-
getKeyBefore(key: Key): Key | null,
|
|
13395
|
-
|
|
13396
|
-
/** Get the key that comes after the given key in the collection. */
|
|
13397
|
-
getKeyAfter(key: Key): Key | null,
|
|
13398
|
-
|
|
13399
|
-
/** Get the first key in the collection. */
|
|
13400
|
-
getFirstKey(): Key | null,
|
|
13401
|
-
|
|
13402
|
-
/** Get the last key in the collection. */
|
|
13403
|
-
getLastKey(): Key | null,
|
|
13404
|
-
|
|
13405
|
-
/** Iterate over the child items of the given key. */
|
|
13406
|
-
getChildren?(key: Key): Iterable<T>,
|
|
13407
|
-
|
|
13408
|
-
/** Returns a string representation of the item's contents. */
|
|
13409
|
-
getTextValue?(key: Key): string,
|
|
13410
|
-
|
|
13411
|
-
/** Filters the collection using the given function. */
|
|
13412
|
-
UNSTABLE_filter?(filterFn: (nodeValue: string) => boolean): Collection<T>
|
|
13413
|
-
}
|
|
13414
|
-
|
|
13415
|
-
interface Node<T> {
|
|
13416
|
-
/** The type of item this node represents. */
|
|
13417
|
-
type: string,
|
|
13418
|
-
/** A unique key for the node. */
|
|
13419
|
-
key: Key,
|
|
13420
|
-
/** The object value the node was created from. */
|
|
13421
|
-
value: T | null,
|
|
13422
|
-
/** The level of depth this node is at in the hierarchy. */
|
|
13423
|
-
level: number,
|
|
13424
|
-
/** Whether this item has children, even if not loaded yet. */
|
|
13425
|
-
hasChildNodes: boolean,
|
|
13426
|
-
/**
|
|
13427
|
-
* The loaded children of this node.
|
|
13428
|
-
* @deprecated Use `collection.getChildren(node.key)` instead.
|
|
13429
|
-
*/
|
|
13430
|
-
childNodes: Iterable<Node<T>>,
|
|
13431
|
-
/** The rendered contents of this node (e.g. JSX). */
|
|
13432
|
-
rendered: ReactNode,
|
|
13433
|
-
/** A string value for this node, used for features like typeahead. */
|
|
13434
|
-
textValue: string,
|
|
13435
|
-
/** An accessibility label for this node. */
|
|
13436
|
-
'aria-label'?: string,
|
|
13437
|
-
/** The index of this node within its parent. */
|
|
13438
|
-
index: number,
|
|
13439
|
-
/** A function that should be called to wrap the rendered node. */
|
|
13440
|
-
wrapper?: (element: ReactElement) => ReactElement,
|
|
13441
|
-
/** The key of the parent node. */
|
|
13442
|
-
parentKey?: Key | null,
|
|
13443
|
-
/** The key of the node before this node. */
|
|
13444
|
-
prevKey?: Key | null,
|
|
13445
|
-
/** The key of the node after this node. */
|
|
13446
|
-
nextKey?: Key | null,
|
|
13447
|
-
/** Additional properties specific to a particular node type. */
|
|
13448
|
-
props?: any,
|
|
13449
|
-
/** @private */
|
|
13450
|
-
shouldInvalidate?: (context: any) => boolean,
|
|
13451
|
-
/** A function that renders this node to a React Element in the DOM. */
|
|
13452
|
-
render?: (node: Node<any>) => ReactElement
|
|
13453
|
-
}
|
|
13454
|
-
|
|
13455
|
-
/*
|
|
13456
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
13457
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13458
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13459
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13460
|
-
*
|
|
13461
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13462
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13463
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13464
|
-
* governing permissions and limitations under the License.
|
|
13465
|
-
*/
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
13470
|
-
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
13471
|
-
type BaseEvent$1<T extends SyntheticEvent> = T & {
|
|
13472
|
-
/**
|
|
13473
|
-
* Use continuePropagation.
|
|
13474
|
-
* @deprecated */
|
|
13475
|
-
stopPropagation(): void,
|
|
13476
|
-
continuePropagation(): void
|
|
13477
|
-
}
|
|
13478
|
-
|
|
13479
|
-
type KeyboardEvent$1 = BaseEvent$1<KeyboardEvent$2<any>>;
|
|
13480
|
-
|
|
13481
|
-
type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
|
|
13482
|
-
|
|
13483
|
-
interface PressEvent {
|
|
13484
|
-
/** The type of press event being fired. */
|
|
13485
|
-
type: 'pressstart' | 'pressend' | 'pressup' | 'press',
|
|
13486
|
-
/** The pointer type that triggered the press event. */
|
|
13487
|
-
pointerType: PointerType,
|
|
13488
|
-
/** The target element of the press event. */
|
|
13489
|
-
target: Element,
|
|
13490
|
-
/** Whether the shift keyboard modifier was held during the press event. */
|
|
13491
|
-
shiftKey: boolean,
|
|
13492
|
-
/** Whether the ctrl keyboard modifier was held during the press event. */
|
|
13493
|
-
ctrlKey: boolean,
|
|
13494
|
-
/** Whether the meta keyboard modifier was held during the press event. */
|
|
13495
|
-
metaKey: boolean,
|
|
13496
|
-
/** Whether the alt keyboard modifier was held during the press event. */
|
|
13497
|
-
altKey: boolean,
|
|
13498
|
-
/** X position relative to the target. */
|
|
13499
|
-
x: number,
|
|
13500
|
-
/** Y position relative to the target. */
|
|
13501
|
-
y: number,
|
|
13502
|
-
/**
|
|
13503
|
-
* By default, press events stop propagation to parent elements.
|
|
13504
|
-
* In cases where a handler decides not to handle a specific event,
|
|
13505
|
-
* it can call `continuePropagation()` to allow a parent to handle it.
|
|
13506
|
-
*/
|
|
13507
|
-
continuePropagation(): void
|
|
13508
|
-
}
|
|
13509
|
-
|
|
13510
|
-
interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
|
|
13511
|
-
/** The type of long press event being fired. */
|
|
13512
|
-
type: 'longpressstart' | 'longpressend' | 'longpress'
|
|
13513
|
-
}
|
|
13514
|
-
|
|
13515
|
-
interface KeyboardEvents$1 {
|
|
13516
|
-
/** Handler that is called when a key is pressed. */
|
|
13517
|
-
onKeyDown?: (e: KeyboardEvent$1) => void,
|
|
13518
|
-
/** Handler that is called when a key is released. */
|
|
13519
|
-
onKeyUp?: (e: KeyboardEvent$1) => void
|
|
13520
|
-
}
|
|
13521
|
-
|
|
13522
|
-
interface FocusEvents$1<Target = Element> {
|
|
13523
|
-
/** Handler that is called when the element receives focus. */
|
|
13524
|
-
onFocus?: (e: FocusEvent<Target>) => void,
|
|
13525
|
-
/** Handler that is called when the element loses focus. */
|
|
13526
|
-
onBlur?: (e: FocusEvent<Target>) => void,
|
|
13527
|
-
/** Handler that is called when the element's focus status changes. */
|
|
13528
|
-
onFocusChange?: (isFocused: boolean) => void
|
|
13529
|
-
}
|
|
13530
|
-
|
|
13531
|
-
interface FocusableProps$1<Target = Element> extends FocusEvents$1<Target>, KeyboardEvents$1 {
|
|
13532
|
-
/** Whether the element should receive focus on render. */
|
|
13533
|
-
autoFocus?: boolean
|
|
13534
|
-
}
|
|
13535
|
-
|
|
13536
|
-
/*
|
|
13537
|
-
* Copyright 2023 Adobe. All rights reserved.
|
|
13538
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13539
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13540
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13541
|
-
*
|
|
13542
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13543
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13544
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13545
|
-
* governing permissions and limitations under the License.
|
|
13546
|
-
*/
|
|
13547
|
-
|
|
13548
|
-
type Key = string | number;
|
|
13549
|
-
|
|
13550
|
-
interface PressResult {
|
|
13551
|
-
/** Whether the target is currently pressed. */
|
|
13552
|
-
isPressed: boolean;
|
|
13553
|
-
/** Props to spread on the target element. */
|
|
13554
|
-
pressProps: DOMAttributes;
|
|
13555
|
-
}
|
|
13556
|
-
interface HoverResult {
|
|
13557
|
-
/** Props to spread on the target element. */
|
|
13558
|
-
hoverProps: DOMAttributes;
|
|
13559
|
-
isHovered: boolean;
|
|
13560
|
-
}
|
|
13561
|
-
|
|
13562
|
-
interface FocusRingAria {
|
|
13563
|
-
/** Whether the element is currently focused. */
|
|
13564
|
-
isFocused: boolean;
|
|
13565
|
-
/** Whether keyboard focus should be visible. */
|
|
13566
|
-
isFocusVisible: boolean;
|
|
13567
|
-
/** Props to apply to the container element with the focus ring. */
|
|
13568
|
-
focusProps: DOMAttributes;
|
|
13569
|
-
}
|
|
13570
|
-
|
|
13571
|
-
type FocusHookResult = [boolean, FocusRingAria["focusProps"]];
|
|
13572
|
-
type HoverHookResult = [boolean, HoverResult["hoverProps"]];
|
|
13573
|
-
type PressHookResult = [boolean, PressResult["pressProps"]];
|
|
13574
|
-
declare function useFocused(opts: {
|
|
13575
|
-
isTextInput?: boolean;
|
|
13576
|
-
}): FocusHookResult;
|
|
13577
|
-
declare function useFocusVisible(opts: {
|
|
13578
|
-
isTextInput?: boolean;
|
|
13579
|
-
}): FocusHookResult;
|
|
13580
|
-
declare function useFocusedWithin(opts: {
|
|
13581
|
-
isTextInput?: boolean;
|
|
13582
|
-
}): FocusHookResult;
|
|
13583
|
-
declare function useFocusVisibleWithin(opts: {
|
|
13584
|
-
isTextInput?: boolean;
|
|
13585
|
-
}): FocusHookResult;
|
|
13586
|
-
declare function useHover(): HoverHookResult;
|
|
13587
|
-
declare function usePressed(): PressHookResult;
|
|
13588
|
-
declare const TRIGGER_TO_HOOK: {
|
|
13589
|
-
readonly useHover: typeof useHover;
|
|
13590
|
-
readonly useFocused: typeof useFocused;
|
|
13591
|
-
readonly useFocusVisible: typeof useFocusVisible;
|
|
13592
|
-
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
13593
|
-
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
13594
|
-
readonly usePressed: typeof usePressed;
|
|
13595
|
-
};
|
|
13596
|
-
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
13597
|
-
interface TriggerOpts {
|
|
13598
|
-
isTextInput?: boolean;
|
|
13599
|
-
}
|
|
13600
|
-
/**
|
|
13601
|
-
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
13602
|
-
* as it's not valid to install variable React hooks!
|
|
13603
|
-
*/
|
|
13604
|
-
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
|
|
13605
|
-
|
|
13606
|
-
declare const classNames: any;
|
|
13607
|
-
|
|
13608
|
-
declare function setPlumeStrictMode(mode: boolean): void;
|
|
13609
|
-
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
13610
|
-
type VariantArgsChoices<V> = {
|
|
13611
|
-
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
13612
|
-
};
|
|
13613
|
-
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
13614
|
-
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
13615
|
-
[K in keyof V]: [K, V[K]];
|
|
13616
|
-
}>;
|
|
13617
|
-
type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
13618
|
-
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
13619
|
-
group: T1;
|
|
13620
|
-
variant: T2;
|
|
13621
|
-
} : never;
|
|
13622
|
-
type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
13623
|
-
type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
13624
|
-
(props: {
|
|
13625
|
-
variants?: V;
|
|
13626
|
-
args?: A;
|
|
13627
|
-
overrides?: O;
|
|
13628
|
-
}): React$1.ReactNode;
|
|
13629
|
-
internalVariantProps: (keyof V)[];
|
|
13630
|
-
internalArgProps: (keyof A)[];
|
|
13631
|
-
};
|
|
13632
|
-
type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
13633
|
-
type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
13634
|
-
type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
13635
|
-
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
13636
|
-
|
|
13637
|
-
interface PlumeCommonProps {
|
|
13638
|
-
showStartIcon?: boolean;
|
|
13639
|
-
showEndIcon?: boolean;
|
|
13640
|
-
startIcon?: React$1.ReactNode;
|
|
13641
|
-
endIcon?: React$1.ReactNode;
|
|
13642
|
-
children?: React$1.ReactNode;
|
|
13643
|
-
isDisabled?: boolean;
|
|
13644
|
-
}
|
|
13645
|
-
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
13646
|
-
}
|
|
13647
|
-
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
13648
|
-
}
|
|
13649
|
-
interface PlumeActualButtonProps {
|
|
13650
|
-
submitsForm?: boolean;
|
|
13651
|
-
}
|
|
13652
|
-
interface PlumeAnchorProps {
|
|
13653
|
-
link?: string;
|
|
13654
|
-
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
13655
|
-
}
|
|
13656
|
-
type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
|
|
13657
|
-
type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
13658
|
-
type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
|
|
13659
|
-
type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
|
|
13660
|
-
type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
|
|
13661
|
-
type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
|
|
13662
|
-
type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
13663
|
-
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
13664
|
-
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
13665
|
-
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13666
|
-
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13667
|
-
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13668
|
-
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13669
|
-
contentSlot: keyof PlasmicClassArgs<C>;
|
|
13670
|
-
root: keyof PlasmicClassOverrides<C>;
|
|
13671
|
-
}
|
|
13672
|
-
declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
13673
|
-
plasmicProps: {
|
|
13674
|
-
variants: PlasmicClassVariants<C>;
|
|
13675
|
-
args: PlasmicClassArgs<C>;
|
|
13676
|
-
overrides: PlasmicClassOverrides<C>;
|
|
13677
|
-
};
|
|
13678
|
-
};
|
|
13679
|
-
|
|
13680
|
-
/*
|
|
13681
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
13682
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13683
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13684
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13685
|
-
*
|
|
13686
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13687
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13688
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13689
|
-
* governing permissions and limitations under the License.
|
|
13690
|
-
*/
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
interface ToggleStateOptions extends InputBase$1 {
|
|
13504
|
+
interface ToggleStateOptions extends InputBase$2 {
|
|
13695
13505
|
/**
|
|
13696
13506
|
* Whether the element should be selected (uncontrolled).
|
|
13697
13507
|
*/
|
|
@@ -13706,7 +13516,7 @@ interface ToggleStateOptions extends InputBase$1 {
|
|
|
13706
13516
|
onChange?: (isSelected: boolean) => void
|
|
13707
13517
|
}
|
|
13708
13518
|
|
|
13709
|
-
interface ToggleProps extends ToggleStateOptions, Validation<boolean>, FocusableProps$
|
|
13519
|
+
interface ToggleProps extends ToggleStateOptions, Validation<boolean>, FocusableProps$2 {
|
|
13710
13520
|
/**
|
|
13711
13521
|
* The label for the element.
|
|
13712
13522
|
*/
|
|
@@ -13717,7 +13527,7 @@ interface ToggleProps extends ToggleStateOptions, Validation<boolean>, Focusable
|
|
|
13717
13527
|
value?: string
|
|
13718
13528
|
}
|
|
13719
13529
|
|
|
13720
|
-
interface AriaToggleProps extends ToggleProps, FocusableDOMProps$
|
|
13530
|
+
interface AriaToggleProps extends ToggleProps, FocusableDOMProps$2, AriaLabelingProps$2, AriaValidationProps, InputDOMProps$1 {
|
|
13721
13531
|
/**
|
|
13722
13532
|
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
|
13723
13533
|
*/
|
|
@@ -13797,7 +13607,7 @@ declare function useCheckbox<P extends CheckboxProps, C extends AnyPlasmicClass>
|
|
|
13797
13607
|
|
|
13798
13608
|
|
|
13799
13609
|
|
|
13800
|
-
interface AriaLabelingProps {
|
|
13610
|
+
interface AriaLabelingProps$1 {
|
|
13801
13611
|
/**
|
|
13802
13612
|
* Defines a string value that labels the current element.
|
|
13803
13613
|
*/
|
|
@@ -13821,14 +13631,14 @@ interface AriaLabelingProps {
|
|
|
13821
13631
|
|
|
13822
13632
|
// A set of common DOM props that are allowed on any component
|
|
13823
13633
|
// Ensure this is synced with DOMPropNames in filterDOMProps
|
|
13824
|
-
interface DOMProps {
|
|
13634
|
+
interface DOMProps$1 {
|
|
13825
13635
|
/**
|
|
13826
13636
|
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
13827
13637
|
*/
|
|
13828
13638
|
id?: string
|
|
13829
13639
|
}
|
|
13830
13640
|
|
|
13831
|
-
interface FocusableDOMProps extends DOMProps {
|
|
13641
|
+
interface FocusableDOMProps$1 extends DOMProps$1 {
|
|
13832
13642
|
/**
|
|
13833
13643
|
* Whether to exclude the element from the sequential tab order. If true,
|
|
13834
13644
|
* the element will not be focusable via the keyboard by tabbing. This should
|
|
@@ -13852,7 +13662,7 @@ interface FocusableDOMProps extends DOMProps {
|
|
|
13852
13662
|
|
|
13853
13663
|
|
|
13854
13664
|
|
|
13855
|
-
interface InputBase {
|
|
13665
|
+
interface InputBase$1 {
|
|
13856
13666
|
/** Whether the input is disabled. */
|
|
13857
13667
|
isDisabled?: boolean,
|
|
13858
13668
|
/** Whether the input can be selected but not changed by the user. */
|
|
@@ -13873,7 +13683,7 @@ interface InputBase {
|
|
|
13873
13683
|
|
|
13874
13684
|
|
|
13875
13685
|
|
|
13876
|
-
type FocusStrategy = 'first' | 'last';
|
|
13686
|
+
type FocusStrategy$1 = 'first' | 'last';
|
|
13877
13687
|
|
|
13878
13688
|
/*
|
|
13879
13689
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -13891,7 +13701,7 @@ type FocusStrategy = 'first' | 'last';
|
|
|
13891
13701
|
|
|
13892
13702
|
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
13893
13703
|
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
13894
|
-
type BaseEvent<T extends SyntheticEvent> = T & {
|
|
13704
|
+
type BaseEvent$1<T extends SyntheticEvent> = T & {
|
|
13895
13705
|
/**
|
|
13896
13706
|
* Use continuePropagation.
|
|
13897
13707
|
* @deprecated */
|
|
@@ -13899,16 +13709,16 @@ type BaseEvent<T extends SyntheticEvent> = T & {
|
|
|
13899
13709
|
continuePropagation(): void
|
|
13900
13710
|
}
|
|
13901
13711
|
|
|
13902
|
-
type KeyboardEvent = BaseEvent<KeyboardEvent$
|
|
13712
|
+
type KeyboardEvent$1 = BaseEvent$1<KeyboardEvent$3<any>>;
|
|
13903
13713
|
|
|
13904
|
-
interface KeyboardEvents {
|
|
13714
|
+
interface KeyboardEvents$1 {
|
|
13905
13715
|
/** Handler that is called when a key is pressed. */
|
|
13906
|
-
onKeyDown?: (e: KeyboardEvent) => void,
|
|
13716
|
+
onKeyDown?: (e: KeyboardEvent$1) => void,
|
|
13907
13717
|
/** Handler that is called when a key is released. */
|
|
13908
|
-
onKeyUp?: (e: KeyboardEvent) => void
|
|
13718
|
+
onKeyUp?: (e: KeyboardEvent$1) => void
|
|
13909
13719
|
}
|
|
13910
13720
|
|
|
13911
|
-
interface FocusEvents<Target = Element> {
|
|
13721
|
+
interface FocusEvents$1<Target = Element> {
|
|
13912
13722
|
/** Handler that is called when the element receives focus. */
|
|
13913
13723
|
onFocus?: (e: FocusEvent<Target>) => void,
|
|
13914
13724
|
/** Handler that is called when the element loses focus. */
|
|
@@ -13917,12 +13727,12 @@ interface FocusEvents<Target = Element> {
|
|
|
13917
13727
|
onFocusChange?: (isFocused: boolean) => void
|
|
13918
13728
|
}
|
|
13919
13729
|
|
|
13920
|
-
interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
|
|
13730
|
+
interface FocusableProps$1<Target = Element> extends FocusEvents$1<Target>, KeyboardEvents$1 {
|
|
13921
13731
|
/** Whether the element should receive focus on render. */
|
|
13922
13732
|
autoFocus?: boolean
|
|
13923
13733
|
}
|
|
13924
13734
|
|
|
13925
|
-
interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
13735
|
+
interface BaseMenuProps extends DOMProps$1, AriaLabelingProps$1, StyleProps {
|
|
13926
13736
|
/**
|
|
13927
13737
|
* List of `Menu.Item`s or `Menu.Group`s that make up the menu
|
|
13928
13738
|
*/
|
|
@@ -14164,7 +13974,7 @@ interface DropdownMenuProps {
|
|
|
14164
13974
|
}
|
|
14165
13975
|
declare function DropdownMenu(props: DropdownMenuProps): React$1.JSX.Element;
|
|
14166
13976
|
|
|
14167
|
-
interface BaseMenuButtonProps extends DOMProps, FocusableProps, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
|
|
13977
|
+
interface BaseMenuButtonProps extends DOMProps$1, FocusableProps$1, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
|
|
14168
13978
|
/**
|
|
14169
13979
|
* The menu to show; can either be a Menu instance, or a function that returns a Menu
|
|
14170
13980
|
* instance if you want to defer creating the instance till when it's opened.
|
|
@@ -14230,7 +14040,7 @@ declare function useMenuButton<P extends BaseMenuButtonProps, C extends AnyPlasm
|
|
|
14230
14040
|
state: MenuButtonState;
|
|
14231
14041
|
};
|
|
14232
14042
|
|
|
14233
|
-
interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableDOMProps, InputBase, FocusableProps, StyleProps {
|
|
14043
|
+
interface BaseSelectProps extends DOMProps$1, AriaLabelingProps$1, FocusableDOMProps$1, InputBase$1, FocusableProps$1, StyleProps {
|
|
14234
14044
|
/**
|
|
14235
14045
|
* Key of the currently selected value
|
|
14236
14046
|
*/
|
|
@@ -14326,53 +14136,360 @@ interface SelectState {
|
|
|
14326
14136
|
getSelectedValue: () => string | null;
|
|
14327
14137
|
setSelectedValue: (value: string | null) => void;
|
|
14328
14138
|
}
|
|
14329
|
-
declare function useSelect<P extends BaseSelectProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectConfig<C>, ref?: React$1.Ref<SelectRefValue>): {
|
|
14330
|
-
plasmicProps: {
|
|
14331
|
-
variants: PlasmicClassVariants<C>;
|
|
14332
|
-
args: PlasmicClassArgs<C>;
|
|
14333
|
-
overrides: PlasmicClassOverrides<C>;
|
|
14334
|
-
};
|
|
14335
|
-
state: SelectState;
|
|
14336
|
-
};
|
|
14139
|
+
declare function useSelect<P extends BaseSelectProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectConfig<C>, ref?: React$1.Ref<SelectRefValue>): {
|
|
14140
|
+
plasmicProps: {
|
|
14141
|
+
variants: PlasmicClassVariants<C>;
|
|
14142
|
+
args: PlasmicClassArgs<C>;
|
|
14143
|
+
overrides: PlasmicClassOverrides<C>;
|
|
14144
|
+
};
|
|
14145
|
+
state: SelectState;
|
|
14146
|
+
};
|
|
14147
|
+
|
|
14148
|
+
interface BaseSelectOptionProps extends ItemLikeProps, StyleProps {
|
|
14149
|
+
}
|
|
14150
|
+
interface SelectOptionConfig<C extends AnyPlasmicClass> {
|
|
14151
|
+
isSelectedVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
14152
|
+
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
14153
|
+
isHighlightedVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
14154
|
+
labelSlot: keyof PlasmicClassArgs<C>;
|
|
14155
|
+
root: keyof PlasmicClassOverrides<C>;
|
|
14156
|
+
labelContainer: keyof PlasmicClassOverrides<C>;
|
|
14157
|
+
}
|
|
14158
|
+
type SelectOptionRef = React$1.Ref<HTMLElement>;
|
|
14159
|
+
declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
|
|
14160
|
+
plasmicProps: {
|
|
14161
|
+
variants: PlasmicClassVariants<C>;
|
|
14162
|
+
args: PlasmicClassArgs<C>;
|
|
14163
|
+
overrides: PlasmicClassOverrides<C>;
|
|
14164
|
+
};
|
|
14165
|
+
};
|
|
14166
|
+
|
|
14167
|
+
interface BaseSelectOptionGroupProps extends SectionLikeProps, StyleProps {
|
|
14168
|
+
}
|
|
14169
|
+
interface SelectOptionGroupConfig<C extends AnyPlasmicClass> {
|
|
14170
|
+
noTitleVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
14171
|
+
isFirstVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
14172
|
+
optionsSlot: keyof PlasmicClassArgs<C>;
|
|
14173
|
+
titleSlot: keyof PlasmicClassArgs<C>;
|
|
14174
|
+
root: keyof PlasmicClassOverrides<C>;
|
|
14175
|
+
separator: keyof PlasmicClassOverrides<C>;
|
|
14176
|
+
titleContainer: keyof PlasmicClassOverrides<C>;
|
|
14177
|
+
optionsContainer: keyof PlasmicClassOverrides<C>;
|
|
14178
|
+
}
|
|
14179
|
+
declare function useSelectOptionGroup<P extends BaseSelectOptionGroupProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionGroupConfig<C>): {
|
|
14180
|
+
plasmicProps: {
|
|
14181
|
+
variants: PlasmicClassVariants<C>;
|
|
14182
|
+
args: PlasmicClassArgs<C>;
|
|
14183
|
+
overrides: PlasmicClassOverrides<C>;
|
|
14184
|
+
};
|
|
14185
|
+
};
|
|
14186
|
+
|
|
14187
|
+
/*
|
|
14188
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14189
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14190
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14191
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14192
|
+
*
|
|
14193
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14194
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14195
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14196
|
+
* governing permissions and limitations under the License.
|
|
14197
|
+
*/
|
|
14198
|
+
|
|
14199
|
+
|
|
14200
|
+
|
|
14201
|
+
/**
|
|
14202
|
+
* A generic interface to access a readonly sequential
|
|
14203
|
+
* collection of unique keyed items.
|
|
14204
|
+
*/
|
|
14205
|
+
interface Collection$1<T> extends Iterable<T> {
|
|
14206
|
+
/** The number of items in the collection. */
|
|
14207
|
+
readonly size: number,
|
|
14208
|
+
|
|
14209
|
+
/** Iterate over all keys in the collection. */
|
|
14210
|
+
getKeys(): Iterable<Key$1>,
|
|
14211
|
+
|
|
14212
|
+
/** Get an item by its key. */
|
|
14213
|
+
getItem(key: Key$1): T | null,
|
|
14214
|
+
|
|
14215
|
+
/** Get an item by the index of its key. */
|
|
14216
|
+
at(idx: number): T | null,
|
|
14217
|
+
|
|
14218
|
+
/** Get the key that comes before the given key in the collection. */
|
|
14219
|
+
getKeyBefore(key: Key$1): Key$1 | null,
|
|
14220
|
+
|
|
14221
|
+
/** Get the key that comes after the given key in the collection. */
|
|
14222
|
+
getKeyAfter(key: Key$1): Key$1 | null,
|
|
14223
|
+
|
|
14224
|
+
/** Get the first key in the collection. */
|
|
14225
|
+
getFirstKey(): Key$1 | null,
|
|
14226
|
+
|
|
14227
|
+
/** Get the last key in the collection. */
|
|
14228
|
+
getLastKey(): Key$1 | null,
|
|
14229
|
+
|
|
14230
|
+
/** Iterate over the child items of the given key. */
|
|
14231
|
+
getChildren?(key: Key$1): Iterable<T>,
|
|
14232
|
+
|
|
14233
|
+
/** Returns a string representation of the item's contents. */
|
|
14234
|
+
getTextValue?(key: Key$1): string,
|
|
14235
|
+
|
|
14236
|
+
/** Filters the collection using the given function. */
|
|
14237
|
+
UNSTABLE_filter?(filterFn: (nodeValue: string) => boolean): Collection$1<T>
|
|
14238
|
+
}
|
|
14239
|
+
|
|
14240
|
+
interface Node$1<T> {
|
|
14241
|
+
/** The type of item this node represents. */
|
|
14242
|
+
type: string,
|
|
14243
|
+
/** A unique key for the node. */
|
|
14244
|
+
key: Key$1,
|
|
14245
|
+
/** The object value the node was created from. */
|
|
14246
|
+
value: T | null,
|
|
14247
|
+
/** The level of depth this node is at in the hierarchy. */
|
|
14248
|
+
level: number,
|
|
14249
|
+
/** Whether this item has children, even if not loaded yet. */
|
|
14250
|
+
hasChildNodes: boolean,
|
|
14251
|
+
/**
|
|
14252
|
+
* The loaded children of this node.
|
|
14253
|
+
* @deprecated Use `collection.getChildren(node.key)` instead.
|
|
14254
|
+
*/
|
|
14255
|
+
childNodes: Iterable<Node$1<T>>,
|
|
14256
|
+
/** The rendered contents of this node (e.g. JSX). */
|
|
14257
|
+
rendered: ReactNode,
|
|
14258
|
+
/** A string value for this node, used for features like typeahead. */
|
|
14259
|
+
textValue: string,
|
|
14260
|
+
/** An accessibility label for this node. */
|
|
14261
|
+
'aria-label'?: string,
|
|
14262
|
+
/** The index of this node within its parent. */
|
|
14263
|
+
index: number,
|
|
14264
|
+
/** A function that should be called to wrap the rendered node. */
|
|
14265
|
+
wrapper?: (element: ReactElement) => ReactElement,
|
|
14266
|
+
/** The key of the parent node. */
|
|
14267
|
+
parentKey?: Key$1 | null,
|
|
14268
|
+
/** The key of the node before this node. */
|
|
14269
|
+
prevKey?: Key$1 | null,
|
|
14270
|
+
/** The key of the node after this node. */
|
|
14271
|
+
nextKey?: Key$1 | null,
|
|
14272
|
+
/** Additional properties specific to a particular node type. */
|
|
14273
|
+
props?: any,
|
|
14274
|
+
/** @private */
|
|
14275
|
+
shouldInvalidate?: (context: any) => boolean,
|
|
14276
|
+
/** A function that renders this node to a React Element in the DOM. */
|
|
14277
|
+
render?: (node: Node$1<any>) => ReactElement
|
|
14278
|
+
}
|
|
14279
|
+
|
|
14280
|
+
/*
|
|
14281
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
14282
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14283
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14284
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14285
|
+
*
|
|
14286
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14287
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14288
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14289
|
+
* governing permissions and limitations under the License.
|
|
14290
|
+
*/
|
|
14291
|
+
|
|
14292
|
+
type Key$1 = string | number;
|
|
14293
|
+
|
|
14294
|
+
/*
|
|
14295
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14296
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14297
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14298
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14299
|
+
*
|
|
14300
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14301
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14302
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14303
|
+
* governing permissions and limitations under the License.
|
|
14304
|
+
*/
|
|
14305
|
+
|
|
14306
|
+
|
|
14307
|
+
|
|
14308
|
+
type SelectionMode = 'none' | 'single' | 'multiple';
|
|
14309
|
+
type SelectionBehavior = 'toggle' | 'replace';
|
|
14310
|
+
type Selection = 'all' | Set<Key>;
|
|
14311
|
+
|
|
14312
|
+
type FocusStrategy = 'first' | 'last';
|
|
14313
|
+
type DisabledBehavior = 'selection' | 'all';
|
|
14314
|
+
|
|
14315
|
+
/*
|
|
14316
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14317
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14318
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14319
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14320
|
+
*
|
|
14321
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14322
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14323
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14324
|
+
* governing permissions and limitations under the License.
|
|
14325
|
+
*/
|
|
14326
|
+
|
|
14327
|
+
|
|
14328
|
+
|
|
14329
|
+
interface Rect {
|
|
14330
|
+
x: number,
|
|
14331
|
+
y: number,
|
|
14332
|
+
width: number,
|
|
14333
|
+
height: number
|
|
14334
|
+
}
|
|
14335
|
+
|
|
14336
|
+
interface Size {
|
|
14337
|
+
width: number,
|
|
14338
|
+
height: number
|
|
14339
|
+
}
|
|
14340
|
+
|
|
14341
|
+
/** A LayoutDelegate provides layout information for collection items. */
|
|
14342
|
+
interface LayoutDelegate {
|
|
14343
|
+
/** Returns a rectangle for the item with the given key. */
|
|
14344
|
+
getItemRect(key: Key): Rect | null,
|
|
14345
|
+
/** Returns the visible rectangle of the collection. */
|
|
14346
|
+
getVisibleRect(): Rect,
|
|
14347
|
+
/** Returns the size of the scrollable content in the collection. */
|
|
14348
|
+
getContentSize(): Size,
|
|
14349
|
+
/** Returns a list of keys between `from` and `to`. */
|
|
14350
|
+
getKeyRange?(from: Key, to: Key): Key[]
|
|
14351
|
+
}
|
|
14352
|
+
|
|
14353
|
+
/**
|
|
14354
|
+
* A generic interface to access a readonly sequential
|
|
14355
|
+
* collection of unique keyed items.
|
|
14356
|
+
*/
|
|
14357
|
+
interface Collection<T> extends Iterable<T> {
|
|
14358
|
+
/** The number of items in the collection. */
|
|
14359
|
+
readonly size: number,
|
|
14360
|
+
|
|
14361
|
+
/** Iterate over all keys in the collection. */
|
|
14362
|
+
getKeys(): Iterable<Key>,
|
|
14363
|
+
|
|
14364
|
+
/** Get an item by its key. */
|
|
14365
|
+
getItem(key: Key): T | null,
|
|
14366
|
+
|
|
14367
|
+
/** Get an item by the index of its key. */
|
|
14368
|
+
at(idx: number): T | null,
|
|
14369
|
+
|
|
14370
|
+
/** Get the key that comes before the given key in the collection. */
|
|
14371
|
+
getKeyBefore(key: Key): Key | null,
|
|
14372
|
+
|
|
14373
|
+
/** Get the key that comes after the given key in the collection. */
|
|
14374
|
+
getKeyAfter(key: Key): Key | null,
|
|
14375
|
+
|
|
14376
|
+
/** Get the first key in the collection. */
|
|
14377
|
+
getFirstKey(): Key | null,
|
|
14378
|
+
|
|
14379
|
+
/** Get the last key in the collection. */
|
|
14380
|
+
getLastKey(): Key | null,
|
|
14381
|
+
|
|
14382
|
+
/** Iterate over the child items of the given key. */
|
|
14383
|
+
getChildren?(key: Key): Iterable<T>,
|
|
14384
|
+
|
|
14385
|
+
/** Returns a string representation of the item's contents. */
|
|
14386
|
+
getTextValue?(key: Key): string,
|
|
14387
|
+
|
|
14388
|
+
/** Filters the collection using the given function. */
|
|
14389
|
+
UNSTABLE_filter?(filterFn: (nodeValue: string) => boolean): Collection<T>
|
|
14390
|
+
}
|
|
14391
|
+
|
|
14392
|
+
interface Node<T> {
|
|
14393
|
+
/** The type of item this node represents. */
|
|
14394
|
+
type: string,
|
|
14395
|
+
/** A unique key for the node. */
|
|
14396
|
+
key: Key,
|
|
14397
|
+
/** The object value the node was created from. */
|
|
14398
|
+
value: T | null,
|
|
14399
|
+
/** The level of depth this node is at in the hierarchy. */
|
|
14400
|
+
level: number,
|
|
14401
|
+
/** Whether this item has children, even if not loaded yet. */
|
|
14402
|
+
hasChildNodes: boolean,
|
|
14403
|
+
/**
|
|
14404
|
+
* The loaded children of this node.
|
|
14405
|
+
* @deprecated Use `collection.getChildren(node.key)` instead.
|
|
14406
|
+
*/
|
|
14407
|
+
childNodes: Iterable<Node<T>>,
|
|
14408
|
+
/** The rendered contents of this node (e.g. JSX). */
|
|
14409
|
+
rendered: ReactNode,
|
|
14410
|
+
/** A string value for this node, used for features like typeahead. */
|
|
14411
|
+
textValue: string,
|
|
14412
|
+
/** An accessibility label for this node. */
|
|
14413
|
+
'aria-label'?: string,
|
|
14414
|
+
/** The index of this node within its parent. */
|
|
14415
|
+
index: number,
|
|
14416
|
+
/** A function that should be called to wrap the rendered node. */
|
|
14417
|
+
wrapper?: (element: ReactElement) => ReactElement,
|
|
14418
|
+
/** The key of the parent node. */
|
|
14419
|
+
parentKey?: Key | null,
|
|
14420
|
+
/** The key of the node before this node. */
|
|
14421
|
+
prevKey?: Key | null,
|
|
14422
|
+
/** The key of the node after this node. */
|
|
14423
|
+
nextKey?: Key | null,
|
|
14424
|
+
/** Additional properties specific to a particular node type. */
|
|
14425
|
+
props?: any,
|
|
14426
|
+
/** @private */
|
|
14427
|
+
shouldInvalidate?: (context: any) => boolean,
|
|
14428
|
+
/** A function that renders this node to a React Element in the DOM. */
|
|
14429
|
+
render?: (node: Node<any>) => ReactElement
|
|
14430
|
+
}
|
|
14337
14431
|
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
|
|
14350
|
-
plasmicProps: {
|
|
14351
|
-
variants: PlasmicClassVariants<C>;
|
|
14352
|
-
args: PlasmicClassArgs<C>;
|
|
14353
|
-
overrides: PlasmicClassOverrides<C>;
|
|
14354
|
-
};
|
|
14355
|
-
};
|
|
14432
|
+
/*
|
|
14433
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14434
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14435
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14436
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14437
|
+
*
|
|
14438
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14439
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14440
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14441
|
+
* governing permissions and limitations under the License.
|
|
14442
|
+
*/
|
|
14356
14443
|
|
|
14357
|
-
|
|
14444
|
+
|
|
14445
|
+
|
|
14446
|
+
type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
|
|
14447
|
+
|
|
14448
|
+
interface PressEvent {
|
|
14449
|
+
/** The type of press event being fired. */
|
|
14450
|
+
type: 'pressstart' | 'pressend' | 'pressup' | 'press',
|
|
14451
|
+
/** The pointer type that triggered the press event. */
|
|
14452
|
+
pointerType: PointerType,
|
|
14453
|
+
/** The target element of the press event. */
|
|
14454
|
+
target: Element,
|
|
14455
|
+
/** Whether the shift keyboard modifier was held during the press event. */
|
|
14456
|
+
shiftKey: boolean,
|
|
14457
|
+
/** Whether the ctrl keyboard modifier was held during the press event. */
|
|
14458
|
+
ctrlKey: boolean,
|
|
14459
|
+
/** Whether the meta keyboard modifier was held during the press event. */
|
|
14460
|
+
metaKey: boolean,
|
|
14461
|
+
/** Whether the alt keyboard modifier was held during the press event. */
|
|
14462
|
+
altKey: boolean,
|
|
14463
|
+
/** X position relative to the target. */
|
|
14464
|
+
x: number,
|
|
14465
|
+
/** Y position relative to the target. */
|
|
14466
|
+
y: number,
|
|
14467
|
+
/**
|
|
14468
|
+
* By default, press events stop propagation to parent elements.
|
|
14469
|
+
* In cases where a handler decides not to handle a specific event,
|
|
14470
|
+
* it can call `continuePropagation()` to allow a parent to handle it.
|
|
14471
|
+
*/
|
|
14472
|
+
continuePropagation(): void
|
|
14358
14473
|
}
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
titleSlot: keyof PlasmicClassArgs<C>;
|
|
14364
|
-
root: keyof PlasmicClassOverrides<C>;
|
|
14365
|
-
separator: keyof PlasmicClassOverrides<C>;
|
|
14366
|
-
titleContainer: keyof PlasmicClassOverrides<C>;
|
|
14367
|
-
optionsContainer: keyof PlasmicClassOverrides<C>;
|
|
14474
|
+
|
|
14475
|
+
interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
|
|
14476
|
+
/** The type of long press event being fired. */
|
|
14477
|
+
type: 'longpressstart' | 'longpressend' | 'longpress'
|
|
14368
14478
|
}
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14479
|
+
|
|
14480
|
+
/*
|
|
14481
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
14482
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14483
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14484
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14485
|
+
*
|
|
14486
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14487
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14488
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14489
|
+
* governing permissions and limitations under the License.
|
|
14490
|
+
*/
|
|
14491
|
+
|
|
14492
|
+
type Key = string | number;
|
|
14376
14493
|
|
|
14377
14494
|
interface FocusState {
|
|
14378
14495
|
/** Whether the collection is currently focused. */
|
|
@@ -14382,9 +14499,9 @@ interface FocusState {
|
|
|
14382
14499
|
/** The current focused key in the collection. */
|
|
14383
14500
|
readonly focusedKey: Key | null;
|
|
14384
14501
|
/** Whether the first or last child of the focused key should receive focus. */
|
|
14385
|
-
readonly childFocusStrategy: FocusStrategy
|
|
14502
|
+
readonly childFocusStrategy: FocusStrategy | null;
|
|
14386
14503
|
/** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
|
|
14387
|
-
setFocusedKey(key: Key | null, child?: FocusStrategy
|
|
14504
|
+
setFocusedKey(key: Key | null, child?: FocusStrategy): void;
|
|
14388
14505
|
}
|
|
14389
14506
|
interface MultipleSelectionState extends FocusState {
|
|
14390
14507
|
/** The type of selection that is allowed in the collection. */
|
|
@@ -14500,11 +14617,11 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
14500
14617
|
*/
|
|
14501
14618
|
get focusedKey(): Key | null;
|
|
14502
14619
|
/** Whether the first or last child of the focused key should receive focus. */
|
|
14503
|
-
get childFocusStrategy(): FocusStrategy
|
|
14620
|
+
get childFocusStrategy(): FocusStrategy | null;
|
|
14504
14621
|
/**
|
|
14505
14622
|
* Sets the focused key.
|
|
14506
14623
|
*/
|
|
14507
|
-
setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy
|
|
14624
|
+
setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;
|
|
14508
14625
|
/**
|
|
14509
14626
|
* The currently selected keys in the collection.
|
|
14510
14627
|
*/
|
|
@@ -14572,9 +14689,9 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
14572
14689
|
|
|
14573
14690
|
interface ListState<T> {
|
|
14574
14691
|
/** A collection of items in the list. */
|
|
14575
|
-
collection: Collection<Node<T>>;
|
|
14692
|
+
collection: Collection$1<Node$1<T>>;
|
|
14576
14693
|
/** A set of items that are disabled. */
|
|
14577
|
-
disabledKeys: Set<Key>;
|
|
14694
|
+
disabledKeys: Set<Key$1>;
|
|
14578
14695
|
/** A selection manager to read and update multiple selection state. */
|
|
14579
14696
|
selectionManager: SelectionManager;
|
|
14580
14697
|
}
|
|
@@ -14595,7 +14712,137 @@ declare const SelectContext: React$1.Context<ListState<any> | undefined>;
|
|
|
14595
14712
|
|
|
14596
14713
|
|
|
14597
14714
|
|
|
14598
|
-
interface
|
|
14715
|
+
interface AriaLabelingProps {
|
|
14716
|
+
/**
|
|
14717
|
+
* Defines a string value that labels the current element.
|
|
14718
|
+
*/
|
|
14719
|
+
'aria-label'?: string,
|
|
14720
|
+
|
|
14721
|
+
/**
|
|
14722
|
+
* Identifies the element (or elements) that labels the current element.
|
|
14723
|
+
*/
|
|
14724
|
+
'aria-labelledby'?: string,
|
|
14725
|
+
|
|
14726
|
+
/**
|
|
14727
|
+
* Identifies the element (or elements) that describes the object.
|
|
14728
|
+
*/
|
|
14729
|
+
'aria-describedby'?: string,
|
|
14730
|
+
|
|
14731
|
+
/**
|
|
14732
|
+
* Identifies the element (or elements) that provide a detailed, extended description for the object.
|
|
14733
|
+
*/
|
|
14734
|
+
'aria-details'?: string
|
|
14735
|
+
}
|
|
14736
|
+
|
|
14737
|
+
// A set of common DOM props that are allowed on any component
|
|
14738
|
+
// Ensure this is synced with DOMPropNames in filterDOMProps
|
|
14739
|
+
interface DOMProps {
|
|
14740
|
+
/**
|
|
14741
|
+
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
14742
|
+
*/
|
|
14743
|
+
id?: string
|
|
14744
|
+
}
|
|
14745
|
+
|
|
14746
|
+
interface FocusableDOMProps extends DOMProps {
|
|
14747
|
+
/**
|
|
14748
|
+
* Whether to exclude the element from the sequential tab order. If true,
|
|
14749
|
+
* the element will not be focusable via the keyboard by tabbing. This should
|
|
14750
|
+
* be avoided except in rare scenarios where an alternative means of accessing
|
|
14751
|
+
* the element or its functionality via the keyboard is available.
|
|
14752
|
+
*/
|
|
14753
|
+
excludeFromTabOrder?: boolean
|
|
14754
|
+
}
|
|
14755
|
+
|
|
14756
|
+
interface InputDOMProps {
|
|
14757
|
+
/**
|
|
14758
|
+
* 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).
|
|
14759
|
+
*/
|
|
14760
|
+
name?: string
|
|
14761
|
+
}
|
|
14762
|
+
|
|
14763
|
+
/*
|
|
14764
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14765
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14766
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14767
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14768
|
+
*
|
|
14769
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14770
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14771
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14772
|
+
* governing permissions and limitations under the License.
|
|
14773
|
+
*/
|
|
14774
|
+
|
|
14775
|
+
|
|
14776
|
+
|
|
14777
|
+
interface InputBase {
|
|
14778
|
+
/** Whether the input is disabled. */
|
|
14779
|
+
isDisabled?: boolean,
|
|
14780
|
+
/** Whether the input can be selected but not changed by the user. */
|
|
14781
|
+
isReadOnly?: boolean
|
|
14782
|
+
}
|
|
14783
|
+
|
|
14784
|
+
/*
|
|
14785
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14786
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14787
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14788
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14789
|
+
*
|
|
14790
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14791
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14792
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14793
|
+
* governing permissions and limitations under the License.
|
|
14794
|
+
*/
|
|
14795
|
+
|
|
14796
|
+
|
|
14797
|
+
|
|
14798
|
+
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
14799
|
+
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
14800
|
+
type BaseEvent<T extends SyntheticEvent> = T & {
|
|
14801
|
+
/**
|
|
14802
|
+
* Use continuePropagation.
|
|
14803
|
+
* @deprecated */
|
|
14804
|
+
stopPropagation(): void,
|
|
14805
|
+
continuePropagation(): void
|
|
14806
|
+
}
|
|
14807
|
+
|
|
14808
|
+
type KeyboardEvent = BaseEvent<KeyboardEvent$3<any>>;
|
|
14809
|
+
|
|
14810
|
+
interface KeyboardEvents {
|
|
14811
|
+
/** Handler that is called when a key is pressed. */
|
|
14812
|
+
onKeyDown?: (e: KeyboardEvent) => void,
|
|
14813
|
+
/** Handler that is called when a key is released. */
|
|
14814
|
+
onKeyUp?: (e: KeyboardEvent) => void
|
|
14815
|
+
}
|
|
14816
|
+
|
|
14817
|
+
interface FocusEvents<Target = Element> {
|
|
14818
|
+
/** Handler that is called when the element receives focus. */
|
|
14819
|
+
onFocus?: (e: FocusEvent<Target>) => void,
|
|
14820
|
+
/** Handler that is called when the element loses focus. */
|
|
14821
|
+
onBlur?: (e: FocusEvent<Target>) => void,
|
|
14822
|
+
/** Handler that is called when the element's focus status changes. */
|
|
14823
|
+
onFocusChange?: (isFocused: boolean) => void
|
|
14824
|
+
}
|
|
14825
|
+
|
|
14826
|
+
interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
|
|
14827
|
+
/** Whether the element should receive focus on render. */
|
|
14828
|
+
autoFocus?: boolean
|
|
14829
|
+
}
|
|
14830
|
+
|
|
14831
|
+
/*
|
|
14832
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14833
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14834
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14835
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14836
|
+
*
|
|
14837
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
14838
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14839
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14840
|
+
* governing permissions and limitations under the License.
|
|
14841
|
+
*/
|
|
14842
|
+
|
|
14843
|
+
|
|
14844
|
+
|
|
14845
|
+
interface SwitchBase extends InputBase, FocusableProps {
|
|
14599
14846
|
/**
|
|
14600
14847
|
* The content to render as the Switch's label.
|
|
14601
14848
|
*/
|
|
@@ -14618,7 +14865,7 @@ interface SwitchBase extends InputBase$1, FocusableProps$1 {
|
|
|
14618
14865
|
value?: string
|
|
14619
14866
|
}
|
|
14620
14867
|
interface SwitchProps$1 extends SwitchBase {}
|
|
14621
|
-
interface AriaSwitchBase extends SwitchBase, FocusableDOMProps
|
|
14868
|
+
interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, InputDOMProps, AriaLabelingProps {
|
|
14622
14869
|
/**
|
|
14623
14870
|
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
|
14624
14871
|
*/
|
|
@@ -14699,7 +14946,7 @@ declare function useTextInput<P extends PlumeTextInputProps, C extends AnyPlasmi
|
|
|
14699
14946
|
};
|
|
14700
14947
|
};
|
|
14701
14948
|
|
|
14702
|
-
interface BaseTriggeredOverlayProps extends StyleProps, DOMProps {
|
|
14949
|
+
interface BaseTriggeredOverlayProps extends StyleProps, DOMProps$1 {
|
|
14703
14950
|
children?: React$1.ReactNode;
|
|
14704
14951
|
}
|
|
14705
14952
|
interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
|
|
@@ -14735,7 +14982,7 @@ interface OverlayTriggerState {
|
|
|
14735
14982
|
interface TriggeredOverlayContextValue {
|
|
14736
14983
|
triggerRef: React$1.RefObject<HTMLElement>;
|
|
14737
14984
|
state: OverlayTriggerState;
|
|
14738
|
-
autoFocus?: boolean | FocusStrategy;
|
|
14985
|
+
autoFocus?: boolean | FocusStrategy$1;
|
|
14739
14986
|
placement?: Placement;
|
|
14740
14987
|
overlayMatchTriggerWidth?: boolean;
|
|
14741
14988
|
overlayMinTriggerWidth?: boolean;
|