@plasmicapp/react-web 0.2.91 → 0.2.93
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 +1 -1
- package/dist/plume/text-input/index.d.ts +1 -1
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js.map +1 -1
- package/lib/plasmic.css +1 -1
- package/package.json +3 -3
- package/skinny/dist/plume/text-input/index.d.ts +1 -1
- package/skinny/dist/plume/text-input/index.js.map +1 -1
package/lib/plasmic.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.93",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@storybook/addon-links": "^6.3.4",
|
|
57
57
|
"@storybook/react": "^6.3.4",
|
|
58
58
|
"@types/classnames": "^2.2.9",
|
|
59
|
-
"@types/react": "^
|
|
60
|
-
"@types/react-dom": "^
|
|
59
|
+
"@types/react": "^17.0.39",
|
|
60
|
+
"@types/react-dom": "^17.0.11",
|
|
61
61
|
"babel-jest": "^27.0.6",
|
|
62
62
|
"babel-loader": "^8.2.2",
|
|
63
63
|
"eslint": "^7.26.0",
|
|
@@ -6,7 +6,7 @@ export interface BaseTextInputProps extends Omit<React.ComponentProps<"input">,
|
|
|
6
6
|
startIcon?: React.ReactNode;
|
|
7
7
|
endIcon?: React.ReactNode;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
|
-
type?: "text" | "password" | "email" | "url";
|
|
9
|
+
type?: "text" | "password" | "email" | "url" | string;
|
|
10
10
|
inputClassName?: string;
|
|
11
11
|
inputStyle?: React.CSSProperties;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/plume/text-input/index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { omit, pick } from \"../../common\";\nimport { Overrides } from \"../../render/elements\";\nimport {\n AnyPlasmicClass,\n mergeVariantToggles,\n PlasmicClassArgs,\n PlasmicClassOverrides,\n PlasmicClassVariants,\n VariantDef,\n} from \"../plume-utils\";\n\nexport interface BaseTextInputProps\n extends Omit<React.ComponentProps<\"input\">, \"type\" | \"disabled\"> {\n showStartIcon?: boolean;\n showEndIcon?: boolean;\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n isDisabled?: boolean;\n type?: \"text\" | \"password\" | \"email\" | \"url\";\n inputClassName?: string;\n inputStyle?: React.CSSProperties;\n}\n\nexport interface TextInputRefValue {\n focus: () => void;\n blur: () => void;\n getRoot: () => HTMLElement | null;\n getInput: () => HTMLInputElement | null;\n}\n\nexport type TextInputRef = React.Ref<TextInputRefValue>;\n\ninterface TextInputConfig<C extends AnyPlasmicClass> {\n showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;\n showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;\n isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;\n startIconSlot?: keyof PlasmicClassArgs<C>;\n endIconSlot?: keyof PlasmicClassArgs<C>;\n root: keyof PlasmicClassOverrides<C>;\n input: keyof PlasmicClassOverrides<C>;\n}\n\nexport function useTextInput<\n P extends BaseTextInputProps,\n C extends AnyPlasmicClass\n>(\n plasmicClass: C,\n props: P,\n config: TextInputConfig<C>,\n ref: TextInputRef = null\n) {\n const {\n isDisabled,\n startIcon,\n endIcon,\n showStartIcon,\n showEndIcon,\n className,\n style,\n inputClassName,\n inputStyle,\n ...rest\n } = props;\n const rootRef = React.useRef<HTMLElement>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => ({\n focus() {\n inputRef.current?.focus();\n },\n blur() {\n inputRef.current?.blur();\n },\n getRoot() {\n return rootRef.current;\n },\n getInput() {\n return inputRef.current;\n },\n }),\n [rootRef, inputRef]\n );\n\n const variants = {\n ...pick(props, ...plasmicClass.internalVariantProps),\n ...mergeVariantToggles(\n { def: config.showStartIconVariant, active: showStartIcon },\n { def: config.showEndIconVariant, active: showEndIcon },\n { def: config.isDisabledVariant, active: isDisabled }\n ),\n };\n\n const args = {\n ...pick(props, ...plasmicClass.internalArgProps),\n ...(config.startIconSlot && { [config.startIconSlot]: startIcon }),\n ...(config.endIconSlot && { [config.endIconSlot]: endIcon }),\n };\n\n const overrides: Overrides = {\n [config.root]: {\n props: {\n ref: rootRef,\n className,\n style,\n },\n },\n [config.input]: {\n props: {\n ...omit(\n rest as any,\n ...plasmicClass.internalArgProps,\n ...plasmicClass.internalVariantProps\n ),\n disabled: isDisabled,\n ref: inputRef,\n className: inputClassName,\n style: inputStyle,\n },\n },\n };\n\n return {\n plasmicProps: {\n variants: variants as PlasmicClassVariants<C>,\n args: args as PlasmicClassArgs<C>,\n overrides: overrides as PlasmicClassOverrides<C>,\n },\n };\n}\n"],"names":[],"mappings":";;;;SA2CgB,YAAY,CAI1B,YAAe,EACf,KAAQ,EACR,MAA0B,EAC1B,GAAwB;;IAAxB,oBAAA,EAAA,UAAwB;IAGtB,IAAA,UAAU,GAUR,KAAK,WAVG,EACV,SAAS,GASP,KAAK,UATE,EACT,OAAO,GAQL,KAAK,QARA,EACP,aAAa,GAOX,KAAK,cAPM,EACb,WAAW,GAMT,KAAK,YANI,EACX,SAAS,GAKP,KAAK,UALE,EACT,KAAK,GAIH,KAAK,MAJF,EACL,cAAc,GAGZ,KAAK,eAHO,EACd,UAAU,GAER,KAAK,WAFG,EACP,IAAI,UACL,KAAK,EAXH,4HAWL,CADQ,CACC;IACV,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;IAChD,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,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pB,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,UAAU,GAClB;SACF;WACF,CAAC;IAEF,OAAO;QACL,YAAY,EAAE;YACZ,QAAQ,EAAE,QAAmC;YAC7C,IAAI,EAAE,IAA2B;YACjC,SAAS,EAAE,SAAqC;SACjD;KACF,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/plume/text-input/index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { omit, pick } from \"../../common\";\nimport { Overrides } from \"../../render/elements\";\nimport {\n AnyPlasmicClass,\n mergeVariantToggles,\n PlasmicClassArgs,\n PlasmicClassOverrides,\n PlasmicClassVariants,\n VariantDef,\n} from \"../plume-utils\";\n\nexport interface BaseTextInputProps\n extends Omit<React.ComponentProps<\"input\">, \"type\" | \"disabled\"> {\n showStartIcon?: boolean;\n showEndIcon?: boolean;\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n isDisabled?: boolean;\n type?: \"text\" | \"password\" | \"email\" | \"url\" | string;\n inputClassName?: string;\n inputStyle?: React.CSSProperties;\n}\n\nexport interface TextInputRefValue {\n focus: () => void;\n blur: () => void;\n getRoot: () => HTMLElement | null;\n getInput: () => HTMLInputElement | null;\n}\n\nexport type TextInputRef = React.Ref<TextInputRefValue>;\n\ninterface TextInputConfig<C extends AnyPlasmicClass> {\n showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;\n showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;\n isDisabledVariant?: VariantDef<PlasmicClassVariants<C>>;\n startIconSlot?: keyof PlasmicClassArgs<C>;\n endIconSlot?: keyof PlasmicClassArgs<C>;\n root: keyof PlasmicClassOverrides<C>;\n input: keyof PlasmicClassOverrides<C>;\n}\n\nexport function useTextInput<\n P extends BaseTextInputProps,\n C extends AnyPlasmicClass\n>(\n plasmicClass: C,\n props: P,\n config: TextInputConfig<C>,\n ref: TextInputRef = null\n) {\n const {\n isDisabled,\n startIcon,\n endIcon,\n showStartIcon,\n showEndIcon,\n className,\n style,\n inputClassName,\n inputStyle,\n ...rest\n } = props;\n const rootRef = React.useRef<HTMLElement>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => ({\n focus() {\n inputRef.current?.focus();\n },\n blur() {\n inputRef.current?.blur();\n },\n getRoot() {\n return rootRef.current;\n },\n getInput() {\n return inputRef.current;\n },\n }),\n [rootRef, inputRef]\n );\n\n const variants = {\n ...pick(props, ...plasmicClass.internalVariantProps),\n ...mergeVariantToggles(\n { def: config.showStartIconVariant, active: showStartIcon },\n { def: config.showEndIconVariant, active: showEndIcon },\n { def: config.isDisabledVariant, active: isDisabled }\n ),\n };\n\n const args = {\n ...pick(props, ...plasmicClass.internalArgProps),\n ...(config.startIconSlot && { [config.startIconSlot]: startIcon }),\n ...(config.endIconSlot && { [config.endIconSlot]: endIcon }),\n };\n\n const overrides: Overrides = {\n [config.root]: {\n props: {\n ref: rootRef,\n className,\n style,\n },\n },\n [config.input]: {\n props: {\n ...omit(\n rest as any,\n ...plasmicClass.internalArgProps,\n ...plasmicClass.internalVariantProps\n ),\n disabled: isDisabled,\n ref: inputRef,\n className: inputClassName,\n style: inputStyle,\n },\n },\n };\n\n return {\n plasmicProps: {\n variants: variants as PlasmicClassVariants<C>,\n args: args as PlasmicClassArgs<C>,\n overrides: overrides as PlasmicClassOverrides<C>,\n },\n };\n}\n"],"names":[],"mappings":";;;;SA2CgB,YAAY,CAI1B,YAAe,EACf,KAAQ,EACR,MAA0B,EAC1B,GAAwB;;IAAxB,oBAAA,EAAA,UAAwB;IAGtB,IAAA,UAAU,GAUR,KAAK,WAVG,EACV,SAAS,GASP,KAAK,UATE,EACT,OAAO,GAQL,KAAK,QARA,EACP,aAAa,GAOX,KAAK,cAPM,EACb,WAAW,GAMT,KAAK,YANI,EACX,SAAS,GAKP,KAAK,UALE,EACT,KAAK,GAIH,KAAK,MAJF,EACL,cAAc,GAGZ,K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