@powerhousedao/design-system 1.7.0 → 1.7.1

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.
@@ -1,23 +1,23 @@
1
1
  import { jsxs as i, jsx as d } from "react/jsx-runtime";
2
- import { schema as n } from "@powerhousedao/scalars/EthereumAddress";
3
- import { useState as c } from "react";
4
- import { FormInput as l } from "../../connect/components/form-input/form-input.js";
2
+ import { useState as u } from "react";
3
+ import { EthereumAddress as n } from "@powerhousedao/scalars";
4
+ import { FormInput as c } from "../../connect/components/form-input/form-input.js";
5
5
  const x = ({
6
6
  onChange: s
7
7
  }) => {
8
8
  var o;
9
- const [r, a] = c(""), t = n.safeParse(r), m = (o = t.error) == null ? void 0 : o.errors.map((e) => e.message).join(", ");
10
- return s && s(r, t.success), /* @__PURE__ */ i("div", { children: [
9
+ const [e, m] = u(""), t = n.schema.safeParse(e), a = (o = t.error) == null ? void 0 : o.errors.map((r) => r.message).join(", ");
10
+ return s && s(e, t.success), /* @__PURE__ */ i("div", { children: [
11
11
  /* @__PURE__ */ d(
12
- l,
12
+ c,
13
13
  {
14
14
  id: "eth-address-input",
15
- value: r,
16
- onChange: (e) => a(e.target.value),
15
+ value: e,
16
+ onChange: (r) => m(r.target.value),
17
17
  placeholder: "0x...."
18
18
  }
19
19
  ),
20
- /* @__PURE__ */ d("label", { htmlFor: "eth-address-input", children: r !== "" && m })
20
+ /* @__PURE__ */ d("label", { htmlFor: "eth-address-input", children: e !== "" && a })
21
21
  ] });
22
22
  };
23
23
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"EthereumAddress.js","sources":["../../../src/scalars/EthereumAddress/EthereumAddress.tsx"],"sourcesContent":["import { FormInput } from \"@/connect\";\nimport { schema } from \"@powerhousedao/scalars/EthereumAddress\";\nimport { useState } from \"react\";\n\nexport interface EthereumAddressProps {\n onChange?: (address: string, isValidAddress: boolean) => void;\n}\n\nexport const EthereumAddress: React.FC<EthereumAddressProps> = ({\n onChange,\n}) => {\n const [address, setAddress] = useState(\"\");\n\n const result = schema.safeParse(address);\n\n const errors = result.error?.errors.map((error) => error.message).join(\", \");\n\n if (onChange) {\n onChange(address, result.success);\n }\n\n return (\n <div>\n <FormInput\n id=\"eth-address-input\"\n value={address}\n onChange={(e) => setAddress(e.target.value)}\n placeholder=\"0x....\"\n />\n <label htmlFor=\"eth-address-input\">{address !== \"\" && errors}</label>\n </div>\n );\n};\n"],"names":["EthereumAddress","onChange","address","setAddress","useState","result","schema","errors","_a","error","jsx","FormInput"],"mappings":";;;;AAQO,MAAMA,IAAkD,CAAC;AAAA,EAC9D,UAAAC;AACF,MAAM;;AACJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAE,GAEnCC,IAASC,EAAO,UAAUJ,CAAO,GAEjCK,KAASC,IAAAH,EAAO,UAAP,gBAAAG,EAAc,OAAO,IAAI,CAACC,MAAUA,EAAM,SAAS,KAAK;AAEvE,SAAIR,KACOA,EAAAC,GAASG,EAAO,OAAO,qBAI/B,OACC,EAAA,UAAA;AAAA,IAAA,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,OAAOT;AAAA,QACP,UAAU,CAAC,MAAMC,EAAW,EAAE,OAAO,KAAK;AAAA,QAC1C,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,sBACC,SAAM,EAAA,SAAQ,qBAAqB,UAAAD,MAAY,MAAMK,EAAO,CAAA;AAAA,EAAA,GAC/D;AAEJ;"}
1
+ {"version":3,"file":"EthereumAddress.js","sources":["../../../src/scalars/EthereumAddress/EthereumAddress.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { FormInput } from \"@/connect\";\nimport { EthereumAddress as EthereumAddressScalar } from \"@powerhousedao/scalars\";\n\nexport interface EthereumAddressProps {\n onChange?: (address: string, isValidAddress: boolean) => void;\n}\n\nexport const EthereumAddress: React.FC<EthereumAddressProps> = ({\n onChange,\n}) => {\n const [address, setAddress] = useState(\"\");\n\n const result = EthereumAddressScalar.schema.safeParse(address);\n\n const errors = result.error?.errors.map((error) => error.message).join(\", \");\n\n if (onChange) {\n onChange(address, result.success);\n }\n\n return (\n <div>\n <FormInput\n id=\"eth-address-input\"\n value={address}\n onChange={(e) => setAddress(e.target.value)}\n placeholder=\"0x....\"\n />\n <label htmlFor=\"eth-address-input\">{address !== \"\" && errors}</label>\n </div>\n );\n};\n"],"names":["EthereumAddress","onChange","address","setAddress","useState","result","EthereumAddressScalar","errors","_a","error","jsx","FormInput","e"],"mappings":";;;;AAQO,MAAMA,IAAkD,CAAC;AAAA,EAC9D,UAAAC;AACF,MAAM;;AACJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAE,GAEnCC,IAASC,EAAsB,OAAO,UAAUJ,CAAO,GAEvDK,KAASC,IAAAH,EAAO,UAAP,gBAAAG,EAAc,OAAO,IAAI,CAACC,MAAUA,EAAM,SAAS,KAAK;AAEvE,SAAIR,KACOA,EAAAC,GAASG,EAAO,OAAO,qBAI/B,OACC,EAAA,UAAA;AAAA,IAAA,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,OAAOT;AAAA,QACP,UAAU,CAACU,MAAMT,EAAWS,EAAE,OAAO,KAAK;AAAA,QAC1C,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,sBACC,SAAM,EAAA,SAAQ,qBAAqB,UAAAV,MAAY,MAAMK,EAAO,CAAA;AAAA,EAAA,GAC/D;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/design-system",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "",
5
5
  "files": [
6
6
  "/dist"
@@ -65,12 +65,14 @@
65
65
  "rollup-plugin-visualizer": "^5.12.0",
66
66
  "storybook": "^8.3.4",
67
67
  "storybook-addon-pseudo-states": "^4.0.2",
68
- "tsx": "^4.19.1"
68
+ "tsx": "^4.19.1",
69
+ "@powerhousedao/scalars": "1.8.0"
69
70
  },
70
71
  "peerDependencies": {
71
72
  "document-model": "^2.3.1",
72
73
  "react": "^18.3.1",
73
- "react-dom": "^18.3.1"
74
+ "react-dom": "^18.3.1",
75
+ "@powerhousedao/scalars": "1.8.0"
74
76
  },
75
77
  "dependencies": {
76
78
  "@internationalized/date": "^3.5.6",
@@ -97,8 +99,7 @@
97
99
  "usehooks-ts": "^3.1.0",
98
100
  "viem": "^2.16.1",
99
101
  "wagmi": "^2.12.17",
100
- "zod": "^3.23.8",
101
- "@powerhousedao/scalars": "1.8.0"
102
+ "zod": "^3.23.8"
102
103
  },
103
104
  "scripts": {
104
105
  "check-types": "tsc --noEmit",