@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.
Files changed (70) hide show
  1. package/dist/index.cjs.js +3715 -0
  2. package/dist/index.cjs.js.map +1 -0
  3. package/dist/plume/button/index.d.ts +4 -4
  4. package/dist/plume/checkbox/index.d.ts +1 -1
  5. package/dist/plume/collection-utils.d.ts +7 -7
  6. package/dist/plume/collection-utils.spec.d.ts +1 -0
  7. package/dist/plume/menu/menu.d.ts +1 -1
  8. package/dist/plume/menu-button/menu-button.d.ts +1 -1
  9. package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
  10. package/dist/plume/plume-utils.d.ts +13 -13
  11. package/dist/plume/select/select-option.d.ts +1 -1
  12. package/dist/plume/select/select.d.ts +1 -1
  13. package/dist/plume/switch/index.d.ts +1 -1
  14. package/dist/plume/text-input/index.d.ts +1 -1
  15. package/dist/plume/triggered-overlay/triggered-overlay.d.ts +1 -1
  16. package/dist/react-utils.d.ts +3 -3
  17. package/dist/react-utils.spec.d.ts +1 -0
  18. package/dist/react-web.esm.js +3485 -4538
  19. package/dist/react-web.esm.js.map +1 -1
  20. package/dist/render/PlasmicHead/index.d.ts +2 -2
  21. package/dist/render/PlasmicImg/index.d.ts +1 -1
  22. package/dist/render/Stack.d.ts +1 -1
  23. package/dist/render/elements.d.ts +12 -12
  24. package/dist/render/screen-variants.d.ts +1 -1
  25. package/dist/render/translation.d.ts +2 -2
  26. package/dist/render/triggers.d.ts +1 -1
  27. package/dist/states/helpers.d.ts +1 -1
  28. package/dist/states/types.d.ts +6 -6
  29. package/dist/stories/PlasmicImg.stories.d.ts +3 -2
  30. package/dist/stories/UseDollarState.stories.d.ts +23 -22
  31. package/package.json +17 -44
  32. package/skinny/dist/{collection-utils-0967eaf0.js → collection-utils-33d43bc0.js} +5 -4
  33. package/skinny/dist/{collection-utils-0967eaf0.js.map → collection-utils-33d43bc0.js.map} +1 -1
  34. package/skinny/dist/common-dc5a84e8.js +135 -0
  35. package/skinny/dist/common-dc5a84e8.js.map +1 -0
  36. package/skinny/dist/index.js +4 -3
  37. package/skinny/dist/index.js.map +1 -1
  38. package/skinny/dist/plume/button/index.js +3 -2
  39. package/skinny/dist/plume/button/index.js.map +1 -1
  40. package/skinny/dist/plume/checkbox/index.js +5 -4
  41. package/skinny/dist/plume/checkbox/index.js.map +1 -1
  42. package/skinny/dist/plume/menu/index.js +6 -5
  43. package/skinny/dist/plume/menu/index.js.map +1 -1
  44. package/skinny/dist/plume/menu-button/index.js +5 -4
  45. package/skinny/dist/plume/menu-button/index.js.map +1 -1
  46. package/skinny/dist/plume/select/index.js +6 -5
  47. package/skinny/dist/plume/select/index.js.map +1 -1
  48. package/skinny/dist/plume/switch/index.js +5 -4
  49. package/skinny/dist/plume/switch/index.js.map +1 -1
  50. package/skinny/dist/plume/text-input/index.js +3 -2
  51. package/skinny/dist/plume/text-input/index.js.map +1 -1
  52. package/skinny/dist/plume/triggered-overlay/index.js +5 -4
  53. package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
  54. package/skinny/dist/{plume-utils-7d68bcc0.js → plume-utils-83879d02.js} +2 -2
  55. package/skinny/dist/{plume-utils-7d68bcc0.js.map → plume-utils-83879d02.js.map} +1 -1
  56. package/skinny/dist/props-utils-1c39261f.js +9 -0
  57. package/skinny/dist/{props-utils-9f9c761a.js.map → props-utils-1c39261f.js.map} +1 -1
  58. package/skinny/dist/{react-utils-ee4e03ba.js → react-utils-898d19d0.js} +2 -2
  59. package/skinny/dist/{react-utils-ee4e03ba.js.map → react-utils-898d19d0.js.map} +1 -1
  60. package/skinny/dist/render/PlasmicImg/index.js +3 -2
  61. package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
  62. package/dist/all.d.ts +0 -13357
  63. package/dist/index.js +0 -8
  64. package/dist/react-web.cjs.development.js +0 -4737
  65. package/dist/react-web.cjs.development.js.map +0 -1
  66. package/dist/react-web.cjs.production.min.js +0 -2
  67. package/dist/react-web.cjs.production.min.js.map +0 -1
  68. package/skinny/dist/common-9d6d348d.js +0 -264
  69. package/skinny/dist/common-9d6d348d.js.map +0 -1
  70. 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 declare type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
17
- export declare type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
18
- export declare type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
19
- export declare type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
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 declare type CheckboxRef = React.Ref<CheckboxRefValue>;
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
- declare type LoaderAwareItemLikeProps = ItemLikeProps | PlasmicLoaderProps<ItemLikeProps>;
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
- declare type LoaderAwareSectionLikeProps = SectionLikeProps | PlasmicLoaderProps<SectionLikeProps>;
110
- export declare type ItemJson = LeafItemJson | SectionJson;
111
- export declare type LeafItemJson = string | {
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 | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[];
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 | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[];
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 | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
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 declare type MenuRef = React.Ref<MenuRefValue>;
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 declare type MenuButtonRef = React.Ref<MenuButtonRefValue>;
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 | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
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
- declare type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
6
- declare type VariantArgsChoices<V> = {
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
- declare type DictValues<V extends Record<string, any>> = V[keyof V];
10
- declare type DictTuples<V extends Record<string, any>> = DictValues<{
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 declare type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
14
- declare type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
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 declare type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
19
- export declare type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
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 declare type AnyPlasmicClass = PlasmicClass<any, any, any>;
29
- export declare type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
30
- export declare type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
31
- export declare type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
32
- declare type BooleanLike = boolean | undefined | null;
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 declare type SelectOptionRef = React.Ref<HTMLElement>;
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 declare type SelectRef = React.Ref<SelectRefValue>;
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 declare type SwitchRef = React.Ref<SwitchRefValue>;
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 declare type TextInputRef = React.Ref<TextInputRefValue>;
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 declare type TriggeredOverlayRef = React.Ref<HTMLElement>;
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>;
@@ -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 | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.CElement<any, React.Component<any, any, any>>;
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 declare type StrictProps<T, TExpected> = Exclude<keyof T, keyof TExpected> extends never ? {} : Partial<"Unexpected extraneous props">;
17
- export declare type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<React.ComponentProps<T>["ref"], string>;
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 {};