@plasmicapp/react-web 0.2.346 → 0.2.348
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 +150 -280
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +1 -1
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +5 -5
- package/skinny/dist/index.js +2 -2
- 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/{ssr-f37a883d.js → ssr-64c8ab20.js} +2 -2
- package/skinny/dist/ssr-64c8ab20.js.map +1 -0
- package/skinny/dist/ssr-f37a883d.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$1, AriaRole, CSSProperties as CSSProperties$1, FocusEvent, KeyboardEvent as KeyboardEvent$
|
|
3
|
+
import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties as CSSProperties$1, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$1, SyntheticEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
interface PlasmicPageGuardProps {
|
|
6
6
|
appId: string;
|
|
@@ -11442,16 +11442,10 @@ interface ActionProps<P> {
|
|
|
11442
11442
|
* calls `setControlContextData`)
|
|
11443
11443
|
*/
|
|
11444
11444
|
contextData: InferDataType<P> | null;
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
refreshQueryData: () => void;
|
|
11450
|
-
appendToSlot: (element: PlasmicElement, slotName: string) => void;
|
|
11451
|
-
removeFromSlotAt: (pos: number, slotName: string) => void;
|
|
11452
|
-
updateProps: (newValues: any) => void;
|
|
11453
|
-
updateStates: (newValues: any) => void;
|
|
11454
|
-
};
|
|
11445
|
+
/**
|
|
11446
|
+
* Operations available to the editor that allow modifying the entire component.
|
|
11447
|
+
*/
|
|
11448
|
+
studioOps: StudioOps;
|
|
11455
11449
|
/**
|
|
11456
11450
|
* The document that the component will be rendered into; instead of using
|
|
11457
11451
|
* `document` directly (for, say, `document.querySelector()` etc.), you
|
|
@@ -12128,6 +12122,16 @@ interface ModalProps {
|
|
|
12128
12122
|
onClose: () => void;
|
|
12129
12123
|
style?: CSSProperties;
|
|
12130
12124
|
}
|
|
12125
|
+
interface StudioOps {
|
|
12126
|
+
showModal: (modalProps: Omit<ModalProps, "onClose"> & {
|
|
12127
|
+
onClose?: () => void;
|
|
12128
|
+
}) => void;
|
|
12129
|
+
refreshQueryData: () => void;
|
|
12130
|
+
appendToSlot: (element: PlasmicElement, slotName: string) => void;
|
|
12131
|
+
removeFromSlotAt: (pos: number, slotName: string) => void;
|
|
12132
|
+
updateProps: (newValues: any) => void;
|
|
12133
|
+
updateStates: (newValues: any) => void;
|
|
12134
|
+
}
|
|
12131
12135
|
interface CustomControlProps<P> {
|
|
12132
12136
|
componentProps: P;
|
|
12133
12137
|
/**
|
|
@@ -12136,6 +12140,11 @@ interface CustomControlProps<P> {
|
|
|
12136
12140
|
* calls `setControlContextData`)
|
|
12137
12141
|
*/
|
|
12138
12142
|
contextData: InferDataType<P> | null;
|
|
12143
|
+
/**
|
|
12144
|
+
* Operations available to the editor that allow modifying the entire component.
|
|
12145
|
+
* Can be null if the custom prop is used in a global context.
|
|
12146
|
+
*/
|
|
12147
|
+
studioOps: StudioOps | null;
|
|
12139
12148
|
value: any;
|
|
12140
12149
|
/**
|
|
12141
12150
|
* Sets the value to be passed to the prop. Expects a JSON-compatible value.
|
|
@@ -12817,269 +12826,6 @@ declare const Stack: (<T extends keyof JSX.IntrinsicElements = "div">(props: {
|
|
|
12817
12826
|
|
|
12818
12827
|
|
|
12819
12828
|
|
|
12820
|
-
interface AriaLabelingProps$1 {
|
|
12821
|
-
/**
|
|
12822
|
-
* Defines a string value that labels the current element.
|
|
12823
|
-
*/
|
|
12824
|
-
'aria-label'?: string,
|
|
12825
|
-
|
|
12826
|
-
/**
|
|
12827
|
-
* Identifies the element (or elements) that labels the current element.
|
|
12828
|
-
*/
|
|
12829
|
-
'aria-labelledby'?: string,
|
|
12830
|
-
|
|
12831
|
-
/**
|
|
12832
|
-
* Identifies the element (or elements) that describes the object.
|
|
12833
|
-
*/
|
|
12834
|
-
'aria-describedby'?: string,
|
|
12835
|
-
|
|
12836
|
-
/**
|
|
12837
|
-
* Identifies the element (or elements) that provide a detailed, extended description for the object.
|
|
12838
|
-
*/
|
|
12839
|
-
'aria-details'?: string
|
|
12840
|
-
}
|
|
12841
|
-
|
|
12842
|
-
// A set of common DOM props that are allowed on any component
|
|
12843
|
-
// Ensure this is synced with DOMPropNames in filterDOMProps
|
|
12844
|
-
interface DOMProps$1 {
|
|
12845
|
-
/**
|
|
12846
|
-
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
12847
|
-
*/
|
|
12848
|
-
id?: string
|
|
12849
|
-
}
|
|
12850
|
-
|
|
12851
|
-
interface FocusableDOMProps$1 extends DOMProps$1 {
|
|
12852
|
-
/**
|
|
12853
|
-
* Whether to exclude the element from the sequential tab order. If true,
|
|
12854
|
-
* the element will not be focusable via the keyboard by tabbing. This should
|
|
12855
|
-
* be avoided except in rare scenarios where an alternative means of accessing
|
|
12856
|
-
* the element or its functionality via the keyboard is available.
|
|
12857
|
-
*/
|
|
12858
|
-
excludeFromTabOrder?: boolean
|
|
12859
|
-
}
|
|
12860
|
-
|
|
12861
|
-
/** Any focusable element, including both HTML and SVG elements. */
|
|
12862
|
-
interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
12863
|
-
|
|
12864
|
-
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
12865
|
-
interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
|
|
12866
|
-
id?: string | undefined,
|
|
12867
|
-
role?: AriaRole | undefined,
|
|
12868
|
-
tabIndex?: number | undefined,
|
|
12869
|
-
style?: CSSProperties$1 | undefined,
|
|
12870
|
-
className?: string | undefined
|
|
12871
|
-
}
|
|
12872
|
-
|
|
12873
|
-
/*
|
|
12874
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
12875
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12876
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12877
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12878
|
-
*
|
|
12879
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12880
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12881
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12882
|
-
* governing permissions and limitations under the License.
|
|
12883
|
-
*/
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
interface InputBase$1 {
|
|
12888
|
-
/** Whether the input is disabled. */
|
|
12889
|
-
isDisabled?: boolean,
|
|
12890
|
-
/** Whether the input can be selected but not changed by the user. */
|
|
12891
|
-
isReadOnly?: boolean
|
|
12892
|
-
}
|
|
12893
|
-
|
|
12894
|
-
/*
|
|
12895
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
12896
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12897
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12898
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12899
|
-
*
|
|
12900
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12901
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12902
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12903
|
-
* governing permissions and limitations under the License.
|
|
12904
|
-
*/
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
type FocusStrategy$1 = 'first' | 'last';
|
|
12909
|
-
|
|
12910
|
-
/*
|
|
12911
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
12912
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12913
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12914
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12915
|
-
*
|
|
12916
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12917
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12918
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12919
|
-
* governing permissions and limitations under the License.
|
|
12920
|
-
*/
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
12925
|
-
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
12926
|
-
type BaseEvent$1<T extends SyntheticEvent> = T & {
|
|
12927
|
-
/**
|
|
12928
|
-
* Use continuePropagation.
|
|
12929
|
-
* @deprecated */
|
|
12930
|
-
stopPropagation(): void,
|
|
12931
|
-
continuePropagation(): void
|
|
12932
|
-
}
|
|
12933
|
-
|
|
12934
|
-
type KeyboardEvent$1 = BaseEvent$1<KeyboardEvent$2<any>>;
|
|
12935
|
-
|
|
12936
|
-
interface KeyboardEvents$1 {
|
|
12937
|
-
/** Handler that is called when a key is pressed. */
|
|
12938
|
-
onKeyDown?: (e: KeyboardEvent$1) => void,
|
|
12939
|
-
/** Handler that is called when a key is released. */
|
|
12940
|
-
onKeyUp?: (e: KeyboardEvent$1) => void
|
|
12941
|
-
}
|
|
12942
|
-
|
|
12943
|
-
interface FocusEvents$1<Target = Element> {
|
|
12944
|
-
/** Handler that is called when the element receives focus. */
|
|
12945
|
-
onFocus?: (e: FocusEvent<Target>) => void,
|
|
12946
|
-
/** Handler that is called when the element loses focus. */
|
|
12947
|
-
onBlur?: (e: FocusEvent<Target>) => void,
|
|
12948
|
-
/** Handler that is called when the element's focus status changes. */
|
|
12949
|
-
onFocusChange?: (isFocused: boolean) => void
|
|
12950
|
-
}
|
|
12951
|
-
|
|
12952
|
-
interface FocusableProps$1<Target = Element> extends FocusEvents$1<Target>, KeyboardEvents$1 {
|
|
12953
|
-
/** Whether the element should receive focus on render. */
|
|
12954
|
-
autoFocus?: boolean
|
|
12955
|
-
}
|
|
12956
|
-
|
|
12957
|
-
declare function useFocused(opts: {
|
|
12958
|
-
isTextInput?: boolean;
|
|
12959
|
-
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
12960
|
-
declare function useFocusVisible(opts: {
|
|
12961
|
-
isTextInput?: boolean;
|
|
12962
|
-
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
12963
|
-
declare function useFocusedWithin(opts: {
|
|
12964
|
-
isTextInput?: boolean;
|
|
12965
|
-
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
12966
|
-
declare function useFocusVisibleWithin(opts: {
|
|
12967
|
-
isTextInput?: boolean;
|
|
12968
|
-
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
12969
|
-
declare function useHover(): (boolean | {
|
|
12970
|
-
onMouseEnter: () => void;
|
|
12971
|
-
onMouseLeave: () => void;
|
|
12972
|
-
})[];
|
|
12973
|
-
declare function usePressed(): (boolean | {
|
|
12974
|
-
onMouseDown: () => void;
|
|
12975
|
-
onMouseUp: () => void;
|
|
12976
|
-
})[];
|
|
12977
|
-
declare const TRIGGER_TO_HOOK: {
|
|
12978
|
-
readonly useHover: typeof useHover;
|
|
12979
|
-
readonly useFocused: typeof useFocused;
|
|
12980
|
-
readonly useFocusVisible: typeof useFocusVisible;
|
|
12981
|
-
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
12982
|
-
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
12983
|
-
readonly usePressed: typeof usePressed;
|
|
12984
|
-
};
|
|
12985
|
-
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
12986
|
-
interface TriggerOpts {
|
|
12987
|
-
isTextInput?: boolean;
|
|
12988
|
-
}
|
|
12989
|
-
/**
|
|
12990
|
-
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
12991
|
-
* as it's not valid to install variable React hooks!
|
|
12992
|
-
*/
|
|
12993
|
-
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
|
|
12994
|
-
|
|
12995
|
-
declare const classNames: any;
|
|
12996
|
-
|
|
12997
|
-
declare function setPlumeStrictMode(mode: boolean): void;
|
|
12998
|
-
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
12999
|
-
type VariantArgsChoices<V> = {
|
|
13000
|
-
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
13001
|
-
};
|
|
13002
|
-
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
13003
|
-
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
13004
|
-
[K in keyof V]: [K, V[K]];
|
|
13005
|
-
}>;
|
|
13006
|
-
type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
13007
|
-
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
13008
|
-
group: T1;
|
|
13009
|
-
variant: T2;
|
|
13010
|
-
} : never;
|
|
13011
|
-
type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
13012
|
-
type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
13013
|
-
(props: {
|
|
13014
|
-
variants?: V;
|
|
13015
|
-
args?: A;
|
|
13016
|
-
overrides?: O;
|
|
13017
|
-
}): React$1.ReactElement | null;
|
|
13018
|
-
internalVariantProps: (keyof V)[];
|
|
13019
|
-
internalArgProps: (keyof A)[];
|
|
13020
|
-
};
|
|
13021
|
-
type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
13022
|
-
type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
13023
|
-
type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
13024
|
-
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
13025
|
-
|
|
13026
|
-
interface PlumeCommonProps {
|
|
13027
|
-
showStartIcon?: boolean;
|
|
13028
|
-
showEndIcon?: boolean;
|
|
13029
|
-
startIcon?: React$1.ReactNode;
|
|
13030
|
-
endIcon?: React$1.ReactNode;
|
|
13031
|
-
children?: React$1.ReactNode;
|
|
13032
|
-
isDisabled?: boolean;
|
|
13033
|
-
}
|
|
13034
|
-
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
13035
|
-
}
|
|
13036
|
-
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
13037
|
-
}
|
|
13038
|
-
interface PlumeActualButtonProps {
|
|
13039
|
-
submitsForm?: boolean;
|
|
13040
|
-
}
|
|
13041
|
-
interface PlumeAnchorProps {
|
|
13042
|
-
link?: string;
|
|
13043
|
-
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
13044
|
-
}
|
|
13045
|
-
type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
|
|
13046
|
-
type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
13047
|
-
type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
|
|
13048
|
-
type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
|
|
13049
|
-
type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
|
|
13050
|
-
type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
|
|
13051
|
-
type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
13052
|
-
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
13053
|
-
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
13054
|
-
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13055
|
-
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13056
|
-
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13057
|
-
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13058
|
-
contentSlot: keyof PlasmicClassArgs<C>;
|
|
13059
|
-
root: keyof PlasmicClassOverrides<C>;
|
|
13060
|
-
}
|
|
13061
|
-
declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
13062
|
-
plasmicProps: {
|
|
13063
|
-
variants: PlasmicClassVariants<C>;
|
|
13064
|
-
args: PlasmicClassArgs<C>;
|
|
13065
|
-
overrides: PlasmicClassOverrides<C>;
|
|
13066
|
-
};
|
|
13067
|
-
};
|
|
13068
|
-
|
|
13069
|
-
/*
|
|
13070
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
13071
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13072
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13073
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13074
|
-
*
|
|
13075
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13076
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13077
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13078
|
-
* governing permissions and limitations under the License.
|
|
13079
|
-
*/
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
12829
|
interface AriaLabelingProps {
|
|
13084
12830
|
/**
|
|
13085
12831
|
* Defines a string value that labels the current element.
|
|
@@ -13136,6 +12882,18 @@ interface InputDOMProps {
|
|
|
13136
12882
|
name?: string
|
|
13137
12883
|
}
|
|
13138
12884
|
|
|
12885
|
+
/** Any focusable element, including both HTML and SVG elements. */
|
|
12886
|
+
interface FocusableElement extends Element, HTMLOrSVGElement {}
|
|
12887
|
+
|
|
12888
|
+
/** All DOM attributes supported across both HTML and SVG elements. */
|
|
12889
|
+
interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttributes$1<T> {
|
|
12890
|
+
id?: string | undefined,
|
|
12891
|
+
role?: AriaRole | undefined,
|
|
12892
|
+
tabIndex?: number | undefined,
|
|
12893
|
+
style?: CSSProperties$1 | undefined,
|
|
12894
|
+
className?: string | undefined
|
|
12895
|
+
}
|
|
12896
|
+
|
|
13139
12897
|
/*
|
|
13140
12898
|
* Copyright 2020 Adobe. All rights reserved.
|
|
13141
12899
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -13317,7 +13075,7 @@ type BaseEvent<T extends SyntheticEvent> = T & {
|
|
|
13317
13075
|
continuePropagation(): void
|
|
13318
13076
|
}
|
|
13319
13077
|
|
|
13320
|
-
type KeyboardEvent = BaseEvent<KeyboardEvent$
|
|
13078
|
+
type KeyboardEvent = BaseEvent<KeyboardEvent$1<any>>;
|
|
13321
13079
|
|
|
13322
13080
|
type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
|
|
13323
13081
|
|
|
@@ -13384,6 +13142,118 @@ interface FocusableProps<Target = Element> extends FocusEvents<Target>, Keyboard
|
|
|
13384
13142
|
|
|
13385
13143
|
type Key = string | number;
|
|
13386
13144
|
|
|
13145
|
+
declare function useFocused(opts: {
|
|
13146
|
+
isTextInput?: boolean;
|
|
13147
|
+
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
13148
|
+
declare function useFocusVisible(opts: {
|
|
13149
|
+
isTextInput?: boolean;
|
|
13150
|
+
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
13151
|
+
declare function useFocusedWithin(opts: {
|
|
13152
|
+
isTextInput?: boolean;
|
|
13153
|
+
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
13154
|
+
declare function useFocusVisibleWithin(opts: {
|
|
13155
|
+
isTextInput?: boolean;
|
|
13156
|
+
}): (boolean | DOMAttributes<FocusableElement>)[];
|
|
13157
|
+
declare function useHover(): (boolean | {
|
|
13158
|
+
onMouseEnter: () => void;
|
|
13159
|
+
onMouseLeave: () => void;
|
|
13160
|
+
})[];
|
|
13161
|
+
declare function usePressed(): (boolean | {
|
|
13162
|
+
onMouseDown: () => void;
|
|
13163
|
+
onMouseUp: () => void;
|
|
13164
|
+
})[];
|
|
13165
|
+
declare const TRIGGER_TO_HOOK: {
|
|
13166
|
+
readonly useHover: typeof useHover;
|
|
13167
|
+
readonly useFocused: typeof useFocused;
|
|
13168
|
+
readonly useFocusVisible: typeof useFocusVisible;
|
|
13169
|
+
readonly useFocusedWithin: typeof useFocusedWithin;
|
|
13170
|
+
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
13171
|
+
readonly usePressed: typeof usePressed;
|
|
13172
|
+
};
|
|
13173
|
+
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
13174
|
+
interface TriggerOpts {
|
|
13175
|
+
isTextInput?: boolean;
|
|
13176
|
+
}
|
|
13177
|
+
/**
|
|
13178
|
+
* Installs argment trigger. All the useTrigger calls must use hardcoded `trigger` arg,
|
|
13179
|
+
* as it's not valid to install variable React hooks!
|
|
13180
|
+
*/
|
|
13181
|
+
declare function useTrigger(trigger: TriggerType, opts: TriggerOpts): [boolean, React$1.HTMLAttributes<HTMLElement>];
|
|
13182
|
+
|
|
13183
|
+
declare const classNames: any;
|
|
13184
|
+
|
|
13185
|
+
declare function setPlumeStrictMode(mode: boolean): void;
|
|
13186
|
+
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
13187
|
+
type VariantArgsChoices<V> = {
|
|
13188
|
+
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
13189
|
+
};
|
|
13190
|
+
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
13191
|
+
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
13192
|
+
[K in keyof V]: [K, V[K]];
|
|
13193
|
+
}>;
|
|
13194
|
+
type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
13195
|
+
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
13196
|
+
group: T1;
|
|
13197
|
+
variant: T2;
|
|
13198
|
+
} : never;
|
|
13199
|
+
type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
13200
|
+
type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
13201
|
+
(props: {
|
|
13202
|
+
variants?: V;
|
|
13203
|
+
args?: A;
|
|
13204
|
+
overrides?: O;
|
|
13205
|
+
}): React$1.ReactElement | null;
|
|
13206
|
+
internalVariantProps: (keyof V)[];
|
|
13207
|
+
internalArgProps: (keyof A)[];
|
|
13208
|
+
};
|
|
13209
|
+
type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
13210
|
+
type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
13211
|
+
type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
13212
|
+
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
13213
|
+
|
|
13214
|
+
interface PlumeCommonProps {
|
|
13215
|
+
showStartIcon?: boolean;
|
|
13216
|
+
showEndIcon?: boolean;
|
|
13217
|
+
startIcon?: React$1.ReactNode;
|
|
13218
|
+
endIcon?: React$1.ReactNode;
|
|
13219
|
+
children?: React$1.ReactNode;
|
|
13220
|
+
isDisabled?: boolean;
|
|
13221
|
+
}
|
|
13222
|
+
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
13223
|
+
}
|
|
13224
|
+
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
13225
|
+
}
|
|
13226
|
+
interface PlumeActualButtonProps {
|
|
13227
|
+
submitsForm?: boolean;
|
|
13228
|
+
}
|
|
13229
|
+
interface PlumeAnchorProps {
|
|
13230
|
+
link?: string;
|
|
13231
|
+
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
13232
|
+
}
|
|
13233
|
+
type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
|
|
13234
|
+
type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
13235
|
+
type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
|
|
13236
|
+
type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
|
|
13237
|
+
type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
|
|
13238
|
+
type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
|
|
13239
|
+
type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
13240
|
+
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
13241
|
+
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
13242
|
+
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13243
|
+
isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
13244
|
+
startIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13245
|
+
endIconSlot?: keyof PlasmicClassArgs<C>;
|
|
13246
|
+
contentSlot: keyof PlasmicClassArgs<C>;
|
|
13247
|
+
root: keyof PlasmicClassOverrides<C>;
|
|
13248
|
+
}
|
|
13249
|
+
declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
13250
|
+
plasmicProps: {
|
|
13251
|
+
variants: PlasmicClassVariants<C>;
|
|
13252
|
+
args: PlasmicClassArgs<C>;
|
|
13253
|
+
overrides: PlasmicClassOverrides<C>;
|
|
13254
|
+
};
|
|
13255
|
+
};
|
|
13256
|
+
|
|
13387
13257
|
/*
|
|
13388
13258
|
* Copyright 2020 Adobe. All rights reserved.
|
|
13389
13259
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -13487,7 +13357,7 @@ declare function useCheckbox<P extends CheckboxProps, C extends AnyPlasmicClass>
|
|
|
13487
13357
|
state: CheckboxState;
|
|
13488
13358
|
};
|
|
13489
13359
|
|
|
13490
|
-
interface BaseMenuProps extends DOMProps
|
|
13360
|
+
interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
13491
13361
|
/**
|
|
13492
13362
|
* List of `Menu.Item`s or `Menu.Group`s that make up the menu
|
|
13493
13363
|
*/
|
|
@@ -13729,7 +13599,7 @@ interface DropdownMenuProps {
|
|
|
13729
13599
|
}
|
|
13730
13600
|
declare function DropdownMenu(props: DropdownMenuProps): React$1.JSX.Element;
|
|
13731
13601
|
|
|
13732
|
-
interface BaseMenuButtonProps extends DOMProps
|
|
13602
|
+
interface BaseMenuButtonProps extends DOMProps, FocusableProps, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
|
|
13733
13603
|
/**
|
|
13734
13604
|
* The menu to show; can either be a Menu instance, or a function that returns a Menu
|
|
13735
13605
|
* instance if you want to defer creating the instance till when it's opened.
|
|
@@ -13795,7 +13665,7 @@ declare function useMenuButton<P extends BaseMenuButtonProps, C extends AnyPlasm
|
|
|
13795
13665
|
state: MenuButtonState;
|
|
13796
13666
|
};
|
|
13797
13667
|
|
|
13798
|
-
interface BaseSelectProps extends DOMProps
|
|
13668
|
+
interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableDOMProps, InputBase, FocusableProps, StyleProps {
|
|
13799
13669
|
/**
|
|
13800
13670
|
* Key of the currently selected value
|
|
13801
13671
|
*/
|
|
@@ -14259,7 +14129,7 @@ declare function useTextInput<P extends PlumeTextInputProps, C extends AnyPlasmi
|
|
|
14259
14129
|
};
|
|
14260
14130
|
};
|
|
14261
14131
|
|
|
14262
|
-
interface BaseTriggeredOverlayProps extends StyleProps, DOMProps
|
|
14132
|
+
interface BaseTriggeredOverlayProps extends StyleProps, DOMProps {
|
|
14263
14133
|
children?: React$1.ReactNode;
|
|
14264
14134
|
}
|
|
14265
14135
|
interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
|
|
@@ -14295,7 +14165,7 @@ interface OverlayTriggerState {
|
|
|
14295
14165
|
interface TriggeredOverlayContextValue {
|
|
14296
14166
|
triggerRef: React$1.RefObject<HTMLElement>;
|
|
14297
14167
|
state: OverlayTriggerState;
|
|
14298
|
-
autoFocus?: boolean | FocusStrategy
|
|
14168
|
+
autoFocus?: boolean | FocusStrategy;
|
|
14299
14169
|
placement?: Placement;
|
|
14300
14170
|
overlayMatchTriggerWidth?: boolean;
|
|
14301
14171
|
overlayMinTriggerWidth?: boolean;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1741,7 +1741,7 @@ function PlasmicRootProvider(props) {
|
|
|
1741
1741
|
return (React__namespace.createElement(MaybeWrap, { cond: !disableLoadingBoundary && reactMajorVersion >= 18, wrapper: function (children) { return (React__namespace.createElement(host.DataProvider, { name: "plasmicInternalEnableLoadingBoundary", hidden: true, data: true },
|
|
1742
1742
|
React__namespace.createElement(React__namespace.Suspense, { fallback: suspenseFallback !== null && suspenseFallback !== void 0 ? suspenseFallback : "Loading..." }, children))); } },
|
|
1743
1743
|
React__namespace.createElement(PlasmicRootContext.Provider, { value: context },
|
|
1744
|
-
React__namespace.createElement(ssr.SSRProvider, null,
|
|
1744
|
+
React__namespace.createElement(MaybeWrap, { cond: reactMajorVersion < 18, wrapper: function (children) { return React__namespace.createElement(ssr.SSRProvider, null, children); } },
|
|
1745
1745
|
React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
|
|
1746
1746
|
React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
|
|
1747
1747
|
React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head },
|