@weaverse/react 0.7.8 → 0.7.9

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.d.ts CHANGED
@@ -26,10 +26,11 @@ interface PlaceholderProps {
26
26
  style?: CSSProperties;
27
27
  }
28
28
  interface ButtonElementProps extends WeaverseElementProps {
29
- value: string;
30
- openInNewTab: boolean;
31
- target: string;
32
29
  type: 'button' | 'submit' | 'reset';
30
+ text: string;
31
+ clickAction: 'none' | 'openLink';
32
+ linkTo: string;
33
+ openInNewTab: boolean;
33
34
  }
34
35
  interface ContainerElementProps extends WeaverseElementProps {
35
36
  [key: string]: any;
package/dist/index.js CHANGED
@@ -42,26 +42,27 @@ var import_react20 = require("react");
42
42
  // src/elements/button.tsx
43
43
  var React = __toESM(require("react"));
44
44
  var Button = React.forwardRef((props, ref) => {
45
- let { openInNewTab, target, value, ...rest } = props;
46
- if (target) {
45
+ let { text, clickAction, linkTo, openInNewTab, ...rest } = props;
46
+ if (clickAction && linkTo) {
47
47
  return /* @__PURE__ */ React.createElement("a", {
48
- href: target,
48
+ href: linkTo,
49
49
  target: openInNewTab ? "_blank" : "_self",
50
50
  rel: "noreferrer",
51
51
  ...rest,
52
52
  ref
53
- }, value);
53
+ }, text);
54
54
  }
55
55
  return /* @__PURE__ */ React.createElement("button", {
56
56
  ref,
57
57
  ...rest
58
- }, value);
58
+ }, text);
59
59
  });
60
60
  Button.defaultProps = {
61
- value: "Shop now",
62
- openInNewTab: false,
63
- target: "",
64
61
  type: "button",
62
+ text: "Shop now",
63
+ clickAction: "none",
64
+ linkTo: "",
65
+ openInNewTab: false,
65
66
  css: {
66
67
  "@desktop": {
67
68
  borderRadius: "72px",
@@ -367,10 +368,7 @@ Text.defaultProps = {
367
368
  value: "The quick brown fox jumps over the lazy dog",
368
369
  css: {
369
370
  "@desktop": {
370
- width: "100%",
371
- height: "fit-content",
372
- padding: "20px",
373
- outline: "none",
371
+ padding: "10px",
374
372
  wordBreak: "break-word",
375
373
  overflowWrap: "break-word",
376
374
  whiteSpace: "break-spaces"
@@ -468,7 +466,7 @@ var Instagram = (0, import_react9.forwardRef)(
468
466
  ...rest
469
467
  }, /* @__PURE__ */ import_react9.default.createElement(Placeholder_default, {
470
468
  element: "Instagram"
471
- }, !token ? "Connect your Instagram account to display photos on your site." : "Invalid or expired token!"));
469
+ }, !token ? "Connect to Instagram to display photos on your site." : "Invalid or expired token!"));
472
470
  }
473
471
  let style = {
474
472
  "--wv-ig-images-per-row": imagesPerRow,
@@ -703,7 +701,7 @@ var AccordionContent = (0, import_react13.forwardRef)(
703
701
  style
704
702
  }, import_react13.default.Children.count(children) > 0 ? children : /* @__PURE__ */ import_react13.default.createElement(Placeholder_default, {
705
703
  element: "Accordion Content"
706
- }, "Please drag and drop an element here"));
704
+ }, "Drag and drop an element here."));
707
705
  }
708
706
  );
709
707
  AccordionContent.defaultProps = {
@@ -840,7 +838,7 @@ var TabContent = (0, import_react16.forwardRef)(
840
838
  style
841
839
  }, import_react16.default.Children.count(children) > 0 ? children : /* @__PURE__ */ import_react16.default.createElement(Placeholder_default, {
842
840
  element: "Tab Content"
843
- }, "Please drag and drop an element here"));
841
+ }, "Drag and drop an element here."));
844
842
  }
845
843
  );
846
844
  TabContent.defaultProps = {
@@ -968,7 +966,7 @@ var SliderContent = (0, import_react18.forwardRef)(
968
966
  onClick: handleClick
969
967
  }, import_react18.default.Children.count(children) > 0 ? children : /* @__PURE__ */ import_react18.default.createElement(Placeholder_default, {
970
968
  element: "Slider Content"
971
- }, "Please drag and drop an element here"));
969
+ }, "Drag and drop an element here."));
972
970
  }
973
971
  );
974
972
  SliderContent.defaultProps = {
@@ -1010,7 +1008,7 @@ var CustomHTML = (0, import_react19.forwardRef)(
1010
1008
  ...rest
1011
1009
  }, /* @__PURE__ */ import_react19.default.createElement(Placeholder_default, {
1012
1010
  element: "Custom HTML"
1013
- }, "Please add your custom HTML codes."));
1011
+ }, "Add your custom HTML code."));
1014
1012
  return /* @__PURE__ */ import_react19.default.createElement("div", {
1015
1013
  ref,
1016
1014
  ...rest,
package/dist/index.mjs CHANGED
@@ -5,26 +5,27 @@ import { createContext as createContext3 } from "react";
5
5
  // src/elements/button.tsx
6
6
  import * as React from "react";
7
7
  var Button = React.forwardRef((props, ref) => {
8
- let { openInNewTab, target, value, ...rest } = props;
9
- if (target) {
8
+ let { text, clickAction, linkTo, openInNewTab, ...rest } = props;
9
+ if (clickAction && linkTo) {
10
10
  return /* @__PURE__ */ React.createElement("a", {
11
- href: target,
11
+ href: linkTo,
12
12
  target: openInNewTab ? "_blank" : "_self",
13
13
  rel: "noreferrer",
14
14
  ...rest,
15
15
  ref
16
- }, value);
16
+ }, text);
17
17
  }
18
18
  return /* @__PURE__ */ React.createElement("button", {
19
19
  ref,
20
20
  ...rest
21
- }, value);
21
+ }, text);
22
22
  });
23
23
  Button.defaultProps = {
24
- value: "Shop now",
25
- openInNewTab: false,
26
- target: "",
27
24
  type: "button",
25
+ text: "Shop now",
26
+ clickAction: "none",
27
+ linkTo: "",
28
+ openInNewTab: false,
28
29
  css: {
29
30
  "@desktop": {
30
31
  borderRadius: "72px",
@@ -330,10 +331,7 @@ Text.defaultProps = {
330
331
  value: "The quick brown fox jumps over the lazy dog",
331
332
  css: {
332
333
  "@desktop": {
333
- width: "100%",
334
- height: "fit-content",
335
- padding: "20px",
336
- outline: "none",
334
+ padding: "10px",
337
335
  wordBreak: "break-word",
338
336
  overflowWrap: "break-word",
339
337
  whiteSpace: "break-spaces"
@@ -431,7 +429,7 @@ var Instagram = forwardRef9(
431
429
  ...rest
432
430
  }, /* @__PURE__ */ React11.createElement(Placeholder_default, {
433
431
  element: "Instagram"
434
- }, !token ? "Connect your Instagram account to display photos on your site." : "Invalid or expired token!"));
432
+ }, !token ? "Connect to Instagram to display photos on your site." : "Invalid or expired token!"));
435
433
  }
436
434
  let style = {
437
435
  "--wv-ig-images-per-row": imagesPerRow,
@@ -666,7 +664,7 @@ var AccordionContent = forwardRef12(
666
664
  style
667
665
  }, React15.Children.count(children) > 0 ? children : /* @__PURE__ */ React15.createElement(Placeholder_default, {
668
666
  element: "Accordion Content"
669
- }, "Please drag and drop an element here"));
667
+ }, "Drag and drop an element here."));
670
668
  }
671
669
  );
672
670
  AccordionContent.defaultProps = {
@@ -803,7 +801,7 @@ var TabContent = forwardRef14(
803
801
  style
804
802
  }, React18.Children.count(children) > 0 ? children : /* @__PURE__ */ React18.createElement(Placeholder_default, {
805
803
  element: "Tab Content"
806
- }, "Please drag and drop an element here"));
804
+ }, "Drag and drop an element here."));
807
805
  }
808
806
  );
809
807
  TabContent.defaultProps = {
@@ -931,7 +929,7 @@ var SliderContent = forwardRef16(
931
929
  onClick: handleClick
932
930
  }, React20.Children.count(children) > 0 ? children : /* @__PURE__ */ React20.createElement(Placeholder_default, {
933
931
  element: "Slider Content"
934
- }, "Please drag and drop an element here"));
932
+ }, "Drag and drop an element here."));
935
933
  }
936
934
  );
937
935
  SliderContent.defaultProps = {
@@ -973,7 +971,7 @@ var CustomHTML = forwardRef17(
973
971
  ...rest
974
972
  }, /* @__PURE__ */ React21.createElement(Placeholder_default, {
975
973
  element: "Custom HTML"
976
- }, "Please add your custom HTML codes."));
974
+ }, "Add your custom HTML code."));
977
975
  return /* @__PURE__ */ React21.createElement("div", {
978
976
  ref,
979
977
  ...rest,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.8",
2
+ "version": "0.7.9",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "name": "@weaverse/react",
32
32
  "author": "Weaverse Team",
33
33
  "dependencies": {
34
- "@weaverse/core": "0.7.8",
34
+ "@weaverse/core": "0.7.9",
35
35
  "nuka-carousel": "^5.3.0"
36
36
  }
37
37
  }