@webstudio-is/sdk-components-react-remix 0.68.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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -0
  3. package/lib/__generated__/form.props.js +411 -0
  4. package/lib/__generated__/link-block.props.js +432 -0
  5. package/lib/__generated__/link.props.js +432 -0
  6. package/lib/__generated__/rich-text-link.props.js +432 -0
  7. package/lib/cjs/__generated__/form.props.js +431 -0
  8. package/lib/cjs/__generated__/link-block.props.js +452 -0
  9. package/lib/cjs/__generated__/link.props.js +452 -0
  10. package/lib/cjs/__generated__/rich-text-link.props.js +452 -0
  11. package/lib/cjs/components.js +30 -0
  12. package/lib/cjs/form.js +81 -0
  13. package/lib/cjs/form.ws.js +110 -0
  14. package/lib/cjs/link-block.js +26 -0
  15. package/lib/cjs/link.js +26 -0
  16. package/lib/cjs/metas.js +24 -0
  17. package/lib/cjs/package.json +1 -0
  18. package/lib/cjs/props.js +24 -0
  19. package/lib/cjs/rich-text-link.js +26 -0
  20. package/lib/cjs/shared/remix-link.js +42 -0
  21. package/lib/components.js +10 -0
  22. package/lib/form.js +65 -0
  23. package/lib/form.ws.js +90 -0
  24. package/lib/link-block.js +6 -0
  25. package/lib/link.js +6 -0
  26. package/lib/metas.js +4 -0
  27. package/lib/props.js +4 -0
  28. package/lib/rich-text-link.js +6 -0
  29. package/lib/shared/remix-link.js +25 -0
  30. package/lib/types/__generated__/form.props.d.ts +2 -0
  31. package/lib/types/__generated__/link-block.props.d.ts +2 -0
  32. package/lib/types/__generated__/link.props.d.ts +2 -0
  33. package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
  34. package/lib/types/components.d.ts +4 -0
  35. package/lib/types/form.d.ts +5 -0
  36. package/lib/types/form.ws.d.ts +3 -0
  37. package/lib/types/link-block.d.ts +6 -0
  38. package/lib/types/link.d.ts +6 -0
  39. package/lib/types/metas.d.ts +1 -0
  40. package/lib/types/props.d.ts +1 -0
  41. package/lib/types/rich-text-link.d.ts +6 -0
  42. package/lib/types/shared/remix-link.d.ts +10 -0
  43. package/package.json +63 -0
  44. package/src/__generated__/form.props.ts +456 -0
  45. package/src/__generated__/link-block.props.ts +477 -0
  46. package/src/__generated__/link.props.ts +477 -0
  47. package/src/__generated__/rich-text-link.props.ts +477 -0
  48. package/src/components.ts +4 -0
  49. package/src/form.tsx +111 -0
  50. package/src/form.ws.tsx +95 -0
  51. package/src/link-block.tsx +4 -0
  52. package/src/link.tsx +4 -0
  53. package/src/metas.ts +1 -0
  54. package/src/props.ts +1 -0
  55. package/src/rich-text-link.tsx +4 -0
  56. package/src/shared/remix-link.tsx +30 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var link_block_exports = {};
20
+ __export(link_block_exports, {
21
+ LinkBlock: () => LinkBlock
22
+ });
23
+ module.exports = __toCommonJS(link_block_exports);
24
+ var import_react_sdk = require("@webstudio-is/react-sdk");
25
+ var import_remix_link = require("./shared/remix-link");
26
+ const LinkBlock = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.LinkBlock);
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var link_exports = {};
20
+ __export(link_exports, {
21
+ Link: () => Link
22
+ });
23
+ module.exports = __toCommonJS(link_exports);
24
+ var import_react_sdk = require("@webstudio-is/react-sdk");
25
+ var import_remix_link = require("./shared/remix-link");
26
+ const Link = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.Link);
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var metas_exports = {};
20
+ __export(metas_exports, {
21
+ Form: () => import_form.meta
22
+ });
23
+ module.exports = __toCommonJS(metas_exports);
24
+ var import_form = require("./form.ws");
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var props_exports = {};
20
+ __export(props_exports, {
21
+ Form: () => import_form.propsMeta
22
+ });
23
+ module.exports = __toCommonJS(props_exports);
24
+ var import_form = require("./form.ws");
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var rich_text_link_exports = {};
20
+ __export(rich_text_link_exports, {
21
+ RichTextLink: () => RichTextLink
22
+ });
23
+ module.exports = __toCommonJS(rich_text_link_exports);
24
+ var import_react_sdk = require("@webstudio-is/react-sdk");
25
+ var import_remix_link = require("./shared/remix-link");
26
+ const RichTextLink = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.RichTextLink);
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var remix_link_exports = {};
20
+ __export(remix_link_exports, {
21
+ wrapLinkComponent: () => wrapLinkComponent
22
+ });
23
+ module.exports = __toCommonJS(remix_link_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_react = require("react");
26
+ var import_react2 = require("@remix-run/react");
27
+ var import_react_sdk = require("@webstudio-is/react-sdk");
28
+ const wrapLinkComponent = (BaseLink) => {
29
+ const Component = (0, import_react.forwardRef)((props, ref) => {
30
+ const href = (0, import_react_sdk.usePropUrl)((0, import_react_sdk.getInstanceIdFromComponentProps)(props), "href");
31
+ if (href?.type === "page") {
32
+ let to = href.page.path === "" ? "/" : href.page.path;
33
+ if (href.hash !== void 0) {
34
+ to += `#${href.hash}`;
35
+ }
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.NavLink, { ...props, to, ref });
37
+ }
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseLink, { ...props, ref });
39
+ });
40
+ Component.displayName = BaseLink.displayName;
41
+ return Component;
42
+ };
@@ -0,0 +1,10 @@
1
+ import { Link } from "./link";
2
+ import { LinkBlock } from "./link-block";
3
+ import { RichTextLink } from "./rich-text-link";
4
+ import { Form } from "./form";
5
+ export {
6
+ Form,
7
+ Link,
8
+ LinkBlock,
9
+ RichTextLink
10
+ };
package/lib/form.js ADDED
@@ -0,0 +1,65 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ Children,
4
+ cloneElement,
5
+ forwardRef
6
+ } from "react";
7
+ import { useFetcher } from "@remix-run/react";
8
+ import { formIdFieldName } from "@webstudio-is/form-handlers";
9
+ import { getInstanceIdFromComponentProps } from "@webstudio-is/react-sdk";
10
+ const defaultTag = "form";
11
+ const isComponentNode = (component, node) => "props" in node && node.props.instance?.component === component;
12
+ const onlyErrorMessage = (children) => Children.map(children, (child) => {
13
+ if (typeof child !== "object" || child === null) {
14
+ return null;
15
+ }
16
+ if (isComponentNode("ErrorMessage", child)) {
17
+ return child;
18
+ }
19
+ if ("props" in child) {
20
+ const newChildren = onlyErrorMessage(child.props.children);
21
+ return Children.toArray(newChildren).some((child2) => child2 !== null) ? cloneElement(child, { children: newChildren }) : null;
22
+ }
23
+ return onlyErrorMessage(child);
24
+ });
25
+ const onlySuccessMessage = (children) => Children.map(children, (child) => {
26
+ if (typeof child !== "object" || child === null) {
27
+ return null;
28
+ }
29
+ if (isComponentNode("SuccessMessage", child)) {
30
+ return child;
31
+ }
32
+ if ("props" in child) {
33
+ const newChildren = onlySuccessMessage(child.props.children);
34
+ return Children.toArray(newChildren).some((child2) => child2 !== null) ? cloneElement(child, { children: newChildren }) : null;
35
+ }
36
+ return onlySuccessMessage(child);
37
+ });
38
+ const withoutMessages = (children) => Children.map(children, (child) => {
39
+ if (typeof child !== "object" || child === null) {
40
+ return child;
41
+ }
42
+ if (isComponentNode("ErrorMessage", child) || isComponentNode("SuccessMessage", child)) {
43
+ return null;
44
+ }
45
+ if ("props" in child) {
46
+ return cloneElement(child, {
47
+ children: withoutMessages(child.props.children)
48
+ });
49
+ }
50
+ return withoutMessages(child);
51
+ });
52
+ const Form = forwardRef(({ children, initialState = "initial", ...props }, ref) => {
53
+ const fetcher = useFetcher();
54
+ const state = fetcher.type === "done" ? fetcher.data?.success === true ? "success" : "error" : initialState;
55
+ const instanceId = getInstanceIdFromComponentProps(props);
56
+ return /* @__PURE__ */ jsxs(fetcher.Form, { ...props, method: "post", "data-state": state, ref, children: [
57
+ /* @__PURE__ */ jsx("input", { type: "hidden", name: formIdFieldName, value: instanceId }),
58
+ state === "success" ? onlySuccessMessage(children) : state === "error" ? onlyErrorMessage(children) : withoutMessages(children)
59
+ ] });
60
+ });
61
+ Form.displayName = "Form";
62
+ export {
63
+ Form,
64
+ defaultTag
65
+ };
package/lib/form.ws.js ADDED
@@ -0,0 +1,90 @@
1
+ import { FormIcon } from "@webstudio-is/icons/svg";
2
+ import { form } from "@webstudio-is/react-sdk/css-normalize";
3
+ import { props } from "./__generated__/form.props";
4
+ const presetStyle = {
5
+ form: [
6
+ ...form,
7
+ { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
8
+ ]
9
+ };
10
+ const meta = {
11
+ category: "forms",
12
+ type: "container",
13
+ label: "Form",
14
+ icon: FormIcon,
15
+ presetStyle,
16
+ order: 0,
17
+ states: [
18
+ { selector: "[data-state=error]", label: "Error" },
19
+ { selector: "[data-state=success]", label: "Success" }
20
+ ],
21
+ template: [
22
+ {
23
+ type: "instance",
24
+ component: "Form",
25
+ children: [
26
+ {
27
+ type: "instance",
28
+ component: "Label",
29
+ children: [{ type: "text", value: "Name" }]
30
+ },
31
+ {
32
+ type: "instance",
33
+ component: "Input",
34
+ props: [{ type: "string", name: "name", value: "name" }],
35
+ children: []
36
+ },
37
+ {
38
+ type: "instance",
39
+ component: "Label",
40
+ children: [{ type: "text", value: "Email" }]
41
+ },
42
+ {
43
+ type: "instance",
44
+ component: "Input",
45
+ props: [{ type: "string", name: "name", value: "email" }],
46
+ children: []
47
+ },
48
+ {
49
+ type: "instance",
50
+ component: "Button",
51
+ children: [{ type: "text", value: "Submit" }]
52
+ },
53
+ {
54
+ type: "instance",
55
+ component: "SuccessMessage",
56
+ children: [
57
+ {
58
+ type: "instance",
59
+ component: "TextBlock",
60
+ children: [
61
+ { type: "text", value: "Thank you for getting in touch!" }
62
+ ]
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ type: "instance",
68
+ component: "ErrorMessage",
69
+ children: [
70
+ {
71
+ type: "instance",
72
+ component: "TextBlock",
73
+ children: [
74
+ { type: "text", value: "Sorry, something went wrong." }
75
+ ]
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ };
83
+ const propsMeta = {
84
+ props,
85
+ initialProps: ["initialState"]
86
+ };
87
+ export {
88
+ meta,
89
+ propsMeta
90
+ };
@@ -0,0 +1,6 @@
1
+ import { LinkBlock as BaseLink } from "@webstudio-is/react-sdk";
2
+ import { wrapLinkComponent } from "./shared/remix-link";
3
+ const LinkBlock = wrapLinkComponent(BaseLink);
4
+ export {
5
+ LinkBlock
6
+ };
package/lib/link.js ADDED
@@ -0,0 +1,6 @@
1
+ import { Link as BaseLink } from "@webstudio-is/react-sdk";
2
+ import { wrapLinkComponent } from "./shared/remix-link";
3
+ const Link = wrapLinkComponent(BaseLink);
4
+ export {
5
+ Link
6
+ };
package/lib/metas.js ADDED
@@ -0,0 +1,4 @@
1
+ import { meta } from "./form.ws";
2
+ export {
3
+ meta as Form
4
+ };
package/lib/props.js ADDED
@@ -0,0 +1,4 @@
1
+ import { propsMeta } from "./form.ws";
2
+ export {
3
+ propsMeta as Form
4
+ };
@@ -0,0 +1,6 @@
1
+ import { RichTextLink as BaseLink } from "@webstudio-is/react-sdk";
2
+ import { wrapLinkComponent } from "./shared/remix-link";
3
+ const RichTextLink = wrapLinkComponent(BaseLink);
4
+ export {
5
+ RichTextLink
6
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { NavLink as RemixLink } from "@remix-run/react";
4
+ import {
5
+ usePropUrl,
6
+ getInstanceIdFromComponentProps
7
+ } from "@webstudio-is/react-sdk";
8
+ const wrapLinkComponent = (BaseLink) => {
9
+ const Component = forwardRef((props, ref) => {
10
+ const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
11
+ if (href?.type === "page") {
12
+ let to = href.page.path === "" ? "/" : href.page.path;
13
+ if (href.hash !== void 0) {
14
+ to += `#${href.hash}`;
15
+ }
16
+ return /* @__PURE__ */ jsx(RemixLink, { ...props, to, ref });
17
+ }
18
+ return /* @__PURE__ */ jsx(BaseLink, { ...props, ref });
19
+ });
20
+ Component.displayName = BaseLink.displayName;
21
+ return Component;
22
+ };
23
+ export {
24
+ wrapLinkComponent
25
+ };
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/generate-arg-types";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/generate-arg-types";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/generate-arg-types";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/generate-arg-types";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,4 @@
1
+ export { Link } from "./link";
2
+ export { LinkBlock } from "./link-block";
3
+ export { RichTextLink } from "./rich-text-link";
4
+ export { Form } from "./form";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const defaultTag = "form";
3
+ export declare const Form: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "action" | "method"> & {
4
+ initialState?: "error" | "initial" | "success" | undefined;
5
+ }, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
@@ -0,0 +1,3 @@
1
+ import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const LinkBlock: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
+ href?: string | undefined;
4
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
+ prefetch?: "none" | "intent" | "render" | undefined;
6
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
+ href?: string | undefined;
4
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
+ prefetch?: "none" | "intent" | "render" | undefined;
6
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1 @@
1
+ export { meta as Form } from "./form.ws";
@@ -0,0 +1 @@
1
+ export { propsMeta as Form } from "./form.ws";
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
+ href?: string | undefined;
4
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
+ prefetch?: "none" | "intent" | "render" | undefined;
6
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export declare const wrapLinkComponent: (BaseLink: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
+ href?: string | undefined;
4
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
+ prefetch?: "none" | "intent" | "render" | undefined;
6
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>) => import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
7
+ href?: string | undefined;
8
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
9
+ prefetch?: "none" | "intent" | "render" | undefined;
10
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@webstudio-is/sdk-components-react-remix",
3
+ "version": "0.68.0",
4
+ "description": "Webstudio components for Remix",
5
+ "author": "Webstudio <github@webstudio.is>",
6
+ "homepage": "https://webstudio.is",
7
+ "license": "MIT",
8
+ "private": false,
9
+ "type": "module",
10
+ "types": "lib/types/index.d.ts",
11
+ "files": [
12
+ "lib/*",
13
+ "src/*"
14
+ ],
15
+ "sideEffects": false,
16
+ "exports": {
17
+ ".": {
18
+ "source": "./src/components.ts",
19
+ "import": "./lib/components.js",
20
+ "require": "./lib/cjs/components.js"
21
+ },
22
+ "./metas": {
23
+ "source": "./src/metas.ts",
24
+ "import": "./lib/metas.js",
25
+ "require": "./lib/cjs/metas.js"
26
+ },
27
+ "./props": {
28
+ "source": "./src/props.ts",
29
+ "import": "./lib/props.js",
30
+ "require": "./lib/cjs/props.js"
31
+ }
32
+ },
33
+ "peerDependencies": {
34
+ "@remix-run/react": "^1.15.0",
35
+ "react": "^18.2.0",
36
+ "react-dom": "^18.2.0"
37
+ },
38
+ "dependencies": {
39
+ "@webstudio-is/form-handlers": "^0.68.0",
40
+ "@webstudio-is/generate-arg-types": "^0.68.0",
41
+ "@webstudio-is/icons": "^0.68.0",
42
+ "@webstudio-is/react-sdk": "^0.68.0"
43
+ },
44
+ "devDependencies": {
45
+ "@remix-run/react": "^1.15.0",
46
+ "@types/react": "^18.0.35",
47
+ "@types/react-dom": "^18.0.11",
48
+ "react": "^18.2.0",
49
+ "react-dom": "^18.2.0",
50
+ "typescript": "5.0.3",
51
+ "@webstudio-is/scripts": "^0.0.0",
52
+ "@webstudio-is/tsconfig": "^1.0.6"
53
+ },
54
+ "scripts": {
55
+ "dev": "build-package --watch",
56
+ "build": "build-package",
57
+ "build:args": "generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.ts\"",
58
+ "dts": "tsc --declarationDir lib/types",
59
+ "typecheck": "tsc --noEmit --emitDeclarationOnly false",
60
+ "lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",
61
+ "checks": "pnpm typecheck && pnpm lint"
62
+ }
63
+ }