@plasmicapp/react-web 0.2.196 → 0.2.198
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/index.cjs.js +3715 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/plume/button/index.d.ts +4 -4
- package/dist/plume/checkbox/index.d.ts +1 -1
- package/dist/plume/collection-utils.d.ts +7 -7
- package/dist/plume/collection-utils.spec.d.ts +1 -0
- package/dist/plume/menu/menu.d.ts +1 -1
- package/dist/plume/menu-button/menu-button.d.ts +1 -1
- package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/dist/plume/plume-utils.d.ts +13 -13
- package/dist/plume/select/select-option.d.ts +1 -1
- package/dist/plume/select/select.d.ts +1 -1
- package/dist/plume/switch/index.d.ts +1 -1
- package/dist/plume/text-input/index.d.ts +1 -1
- package/dist/plume/triggered-overlay/triggered-overlay.d.ts +1 -1
- package/dist/react-utils.d.ts +3 -3
- package/dist/react-utils.spec.d.ts +1 -0
- package/dist/react-web.esm.js +3485 -4538
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicHead/index.d.ts +2 -2
- package/dist/render/PlasmicImg/index.d.ts +1 -1
- package/dist/render/Stack.d.ts +1 -1
- package/dist/render/elements.d.ts +12 -12
- package/dist/render/screen-variants.d.ts +1 -1
- package/dist/render/translation.d.ts +2 -2
- package/dist/render/triggers.d.ts +1 -1
- package/dist/states/helpers.d.ts +1 -1
- package/dist/states/types.d.ts +6 -6
- package/dist/stories/PlasmicImg.stories.d.ts +3 -2
- package/dist/stories/UseDollarState.stories.d.ts +23 -22
- package/package.json +17 -44
- package/skinny/dist/{collection-utils-0967eaf0.js → collection-utils-33d43bc0.js} +5 -4
- package/skinny/dist/{collection-utils-0967eaf0.js.map → collection-utils-33d43bc0.js.map} +1 -1
- package/skinny/dist/common-dc5a84e8.js +135 -0
- package/skinny/dist/common-dc5a84e8.js.map +1 -0
- package/skinny/dist/index.js +4 -3
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/button/index.js +3 -2
- package/skinny/dist/plume/button/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +5 -4
- package/skinny/dist/plume/checkbox/index.js.map +1 -1
- package/skinny/dist/plume/menu/index.js +6 -5
- package/skinny/dist/plume/menu/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/index.js +5 -4
- package/skinny/dist/plume/menu-button/index.js.map +1 -1
- package/skinny/dist/plume/select/index.js +6 -5
- package/skinny/dist/plume/select/index.js.map +1 -1
- package/skinny/dist/plume/switch/index.js +5 -4
- package/skinny/dist/plume/switch/index.js.map +1 -1
- package/skinny/dist/plume/text-input/index.js +3 -2
- package/skinny/dist/plume/text-input/index.js.map +1 -1
- package/skinny/dist/plume/triggered-overlay/index.js +5 -4
- package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
- package/skinny/dist/{plume-utils-7d68bcc0.js → plume-utils-83879d02.js} +2 -2
- package/skinny/dist/{plume-utils-7d68bcc0.js.map → plume-utils-83879d02.js.map} +1 -1
- package/skinny/dist/props-utils-1c39261f.js +9 -0
- package/skinny/dist/{props-utils-9f9c761a.js.map → props-utils-1c39261f.js.map} +1 -1
- package/skinny/dist/{react-utils-ee4e03ba.js → react-utils-898d19d0.js} +2 -2
- package/skinny/dist/{react-utils-ee4e03ba.js.map → react-utils-898d19d0.js.map} +1 -1
- package/skinny/dist/render/PlasmicImg/index.js +3 -2
- package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
- package/dist/all.d.ts +0 -13357
- package/dist/index.js +0 -8
- package/dist/react-web.cjs.development.js +0 -4737
- package/dist/react-web.cjs.development.js.map +0 -1
- package/dist/react-web.cjs.production.min.js +0 -2
- package/dist/react-web.cjs.production.min.js.map +0 -1
- package/skinny/dist/common-9d6d348d.js +0 -264
- package/skinny/dist/common-9d6d348d.js.map +0 -1
- package/skinny/dist/props-utils-9f9c761a.js +0 -8
|
@@ -13,10 +13,10 @@ interface HtmlButtonProps extends Omit<React.ComponentProps<"button">, "ref" | "
|
|
|
13
13
|
interface HtmlAnchorProps extends Omit<React.ComponentProps<"a">, "ref" | "href"> {
|
|
14
14
|
link?: string;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
16
|
+
export type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
17
|
+
export type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
|
18
|
+
export type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
|
|
19
|
+
export type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
20
20
|
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
21
21
|
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
22
22
|
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
@@ -2,7 +2,7 @@ import { AriaCheckboxProps } from "@react-types/checkbox";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AnyPlasmicClass, PlasmicClassArgs, PlasmicClassOverrides, PlasmicClassVariants, VariantDef } from "../plume-utils";
|
|
4
4
|
import { StyleProps } from "../props-utils";
|
|
5
|
-
export
|
|
5
|
+
export type CheckboxRef = React.Ref<CheckboxRefValue>;
|
|
6
6
|
export interface CheckboxRefValue extends CheckboxState {
|
|
7
7
|
getRoot: () => HTMLElement | null;
|
|
8
8
|
focus: () => void;
|
|
@@ -88,7 +88,7 @@ export interface ItemLikeProps {
|
|
|
88
88
|
*/
|
|
89
89
|
isDisabled?: boolean;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
type LoaderAwareItemLikeProps = ItemLikeProps | PlasmicLoaderProps<ItemLikeProps>;
|
|
92
92
|
/**
|
|
93
93
|
* Props for a Plume component that corresponds to a Section
|
|
94
94
|
*/
|
|
@@ -106,9 +106,9 @@ export interface SectionLikeProps {
|
|
|
106
106
|
*/
|
|
107
107
|
children?: React.ReactNode;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
export
|
|
111
|
-
export
|
|
109
|
+
type LoaderAwareSectionLikeProps = SectionLikeProps | PlasmicLoaderProps<SectionLikeProps>;
|
|
110
|
+
export type ItemJson = LeafItemJson | SectionJson;
|
|
111
|
+
export type LeafItemJson = string | {
|
|
112
112
|
value: string;
|
|
113
113
|
label?: string;
|
|
114
114
|
textValue?: string;
|
|
@@ -130,7 +130,7 @@ export declare function deriveItemsFromProps(props: any, opts: {
|
|
|
130
130
|
items: JSX.Element[];
|
|
131
131
|
disabledKeys: string[];
|
|
132
132
|
} | {
|
|
133
|
-
items: React.ReactElement<any, string |
|
|
133
|
+
items: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
134
134
|
disabledKeys: React.Key[];
|
|
135
135
|
};
|
|
136
136
|
/**
|
|
@@ -162,7 +162,7 @@ export declare function useDerivedItems(props: any, opts: {
|
|
|
162
162
|
items: JSX.Element[];
|
|
163
163
|
disabledKeys: string[];
|
|
164
164
|
} | {
|
|
165
|
-
items: React.ReactElement<any, string |
|
|
165
|
+
items: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
166
166
|
disabledKeys: React.Key[];
|
|
167
167
|
};
|
|
168
168
|
export declare function useDerivedItemsFromChildren<T extends React.ReactElement>(children: React.ReactNode, opts: {
|
|
@@ -178,7 +178,7 @@ export declare function useDerivedItemsFromChildren<T extends React.ReactElement
|
|
|
178
178
|
* Given a Collection node, create the React element that we should use
|
|
179
179
|
* to render it.
|
|
180
180
|
*/
|
|
181
|
-
export declare function renderCollectionNode(node: Node<any>): React.ReactElement<any, string |
|
|
181
|
+
export declare function renderCollectionNode(node: Node<any>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
182
182
|
/**
|
|
183
183
|
* Renders a item-like or section-like Plume component element into an
|
|
184
184
|
* Item or a Section element.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,7 +12,7 @@ export interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
|
12
12
|
*/
|
|
13
13
|
onAction?: (value: string) => void;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type MenuRef = React.Ref<MenuRefValue>;
|
|
16
16
|
export interface MenuRefValue extends MenuState {
|
|
17
17
|
getRoot: () => HTMLElement | null;
|
|
18
18
|
}
|
|
@@ -54,7 +54,7 @@ interface MenuButtonState {
|
|
|
54
54
|
close: () => void;
|
|
55
55
|
isOpen: () => boolean;
|
|
56
56
|
}
|
|
57
|
-
export
|
|
57
|
+
export type MenuButtonRef = React.Ref<MenuButtonRefValue>;
|
|
58
58
|
export interface MenuButtonRefValue extends MenuButtonState {
|
|
59
59
|
getRoot: () => HTMLElement | null;
|
|
60
60
|
getTrigger: () => HTMLElement | null;
|
|
@@ -16,6 +16,6 @@ export declare function useMenuTrigger(opts: {
|
|
|
16
16
|
menu: React.ReactElement<BaseMenuProps> | (() => React.ReactElement<BaseMenuProps>);
|
|
17
17
|
}, state: MenuTriggerState): {
|
|
18
18
|
triggerProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
19
|
-
makeMenu: () => React.ReactElement<BaseMenuProps, string |
|
|
19
|
+
makeMenu: () => React.ReactElement<BaseMenuProps, string | React.JSXElementConstructor<any>> | null;
|
|
20
20
|
triggerContext: TriggeredOverlayContextValue;
|
|
21
21
|
};
|
|
@@ -2,21 +2,21 @@ import * as React from "react";
|
|
|
2
2
|
import { SingleChoiceArg } from "../render/elements";
|
|
3
3
|
export declare let PLUME_STRICT_MODE: boolean;
|
|
4
4
|
export declare function setPlumeStrictMode(mode: boolean): void;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
6
|
+
type VariantArgsChoices<V> = {
|
|
7
7
|
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
10
|
+
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
11
11
|
[K in keyof V]: [K, V[K]];
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
14
|
-
|
|
13
|
+
export type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
14
|
+
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
15
15
|
group: T1;
|
|
16
16
|
variant: T2;
|
|
17
17
|
} : never;
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
19
|
+
export type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
20
20
|
(props: {
|
|
21
21
|
variants?: V;
|
|
22
22
|
args?: A;
|
|
@@ -25,11 +25,11 @@ export declare type PlasmicClass<V extends Record<string, any>, A extends Record
|
|
|
25
25
|
internalVariantProps: (keyof V)[];
|
|
26
26
|
internalArgProps: (keyof A)[];
|
|
27
27
|
};
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
|
|
28
|
+
export type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
29
|
+
export type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
30
|
+
export type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
31
|
+
export type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
32
|
+
type BooleanLike = boolean | undefined | null;
|
|
33
33
|
export declare function mergeVariantToggles<V>(...toggles: {
|
|
34
34
|
def?: VariantDef<V>;
|
|
35
35
|
active: BooleanLike;
|
|
@@ -12,7 +12,7 @@ interface SelectOptionConfig<C extends AnyPlasmicClass> {
|
|
|
12
12
|
root: keyof PlasmicClassOverrides<C>;
|
|
13
13
|
labelContainer: keyof PlasmicClassOverrides<C>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type SelectOptionRef = React.Ref<HTMLElement>;
|
|
16
16
|
export declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
|
|
17
17
|
plasmicProps: {
|
|
18
18
|
variants: PlasmicClassVariants<C>;
|
|
@@ -72,7 +72,7 @@ export interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableD
|
|
|
72
72
|
*/
|
|
73
73
|
placeholder?: React.ReactNode;
|
|
74
74
|
}
|
|
75
|
-
export
|
|
75
|
+
export type SelectRef = React.Ref<SelectRefValue>;
|
|
76
76
|
export interface SelectRefValue extends SelectState {
|
|
77
77
|
getTrigger: () => HTMLElement | null;
|
|
78
78
|
getRoot: () => HTMLElement | null;
|
|
@@ -2,7 +2,7 @@ import { AriaSwitchProps } from "@react-types/switch";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AnyPlasmicClass, PlasmicClassArgs, PlasmicClassOverrides, PlasmicClassVariants, VariantDef } from "../plume-utils";
|
|
4
4
|
import { StyleProps } from "../props-utils";
|
|
5
|
-
export
|
|
5
|
+
export type SwitchRef = React.Ref<SwitchRefValue>;
|
|
6
6
|
export interface SwitchRefValue extends SwitchState {
|
|
7
7
|
getRoot: () => HTMLElement | null;
|
|
8
8
|
focus: () => void;
|
|
@@ -16,7 +16,7 @@ export interface TextInputRefValue {
|
|
|
16
16
|
getRoot: () => HTMLElement | null;
|
|
17
17
|
getInput: () => HTMLInputElement | null;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type TextInputRef = React.Ref<TextInputRefValue>;
|
|
20
20
|
interface TextInputConfig<C extends AnyPlasmicClass> {
|
|
21
21
|
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
22
22
|
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
@@ -14,7 +14,7 @@ export interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
|
|
|
14
14
|
root: keyof PlasmicClassOverrides<C>;
|
|
15
15
|
contentContainer: keyof PlasmicClassOverrides<C>;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type TriggeredOverlayRef = React.Ref<HTMLElement>;
|
|
18
18
|
export declare function useTriggeredOverlay<P extends BaseTriggeredOverlayProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: TriggeredOverlayConfig<C>, outerRef?: TriggeredOverlayRef, isDismissable?: boolean): {
|
|
19
19
|
plasmicProps: {
|
|
20
20
|
variants: PlasmicClassVariants<C>;
|
package/dist/react-utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
export declare const isBrowser: boolean;
|
|
3
3
|
export declare const NONE: unique symbol;
|
|
4
4
|
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
|
|
5
|
-
export declare function createElementWithChildren(elementType: any, props: any, children: React.ReactNode): React.ReactElement<any, string |
|
|
5
|
+
export declare function createElementWithChildren(elementType: any, props: any, children: React.ReactNode): React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.CElement<any, React.Component<any, any, any>>;
|
|
6
6
|
export declare function ensureNotArray(children: React.ReactNode): any;
|
|
7
7
|
/**
|
|
8
8
|
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
@@ -13,8 +13,8 @@ export declare function isReactText(child: React.ReactNode): child is React.Reac
|
|
|
13
13
|
export declare function isReactChild(child: React.ReactNode): child is React.ReactChild;
|
|
14
14
|
export declare function isReactFragment(child: React.ReactNode): child is React.ReactElement;
|
|
15
15
|
export declare function isReactNode(x: any): boolean;
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type StrictProps<T, TExpected> = Exclude<keyof T, keyof TExpected> extends never ? {} : Partial<"Unexpected extraneous props">;
|
|
17
|
+
export type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<React.ComponentProps<T>["ref"], string>;
|
|
18
18
|
export declare function mergeProps(props: Record<string, any>, ...restProps: Record<string, any>[]): Record<string, any>;
|
|
19
19
|
export declare function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): (value: T) => void;
|
|
20
20
|
export declare function mergePropVals(name: string, val1: any, val2: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|