one-ewallet-otc-ui 0.0.2 → 0.0.4

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/README.md CHANGED
@@ -58,7 +58,18 @@ function App() {
58
58
  }
59
59
  ```
60
60
 
61
- ### 2. Using OtcModal Component
61
+ ### 2. Import Styles (Required)
62
+
63
+ **Important:** You must import the component library's styles in your application entry file:
64
+
65
+ ```tsx
66
+ // In your main.tsx or App.tsx
67
+ import 'one-ewallet-otc-ui/style.css'
68
+ // or
69
+ import 'one-ewallet-otc-ui/dist/style.css'
70
+ ```
71
+
72
+ ### 3. Using OtcModal Component
62
73
 
63
74
  `OtcModal` is an OTC trading modal component:
64
75
 
@@ -89,7 +100,7 @@ function MyComponent() {
89
100
  | `userAddress` | `string` | ✅ | - | User Sui wallet address |
90
101
  | `lang` | `'ZH' \| 'EN'` | ❌ | `'EN'` | Interface language |
91
102
 
92
- ### 3. Using Withdraw Component
103
+ ### 4. Using Withdraw Component
93
104
 
94
105
  `Withdraw` is a withdrawal component that requires SuiClient support:
95
106
 
@@ -147,6 +158,8 @@ import { createRoot } from 'react-dom/client'
147
158
  import { SuiClientProvider, createNetworkConfig, useSuiClient } from '@onelabs/dapp-kit'
148
159
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
149
160
  import { OtcModal, Withdraw } from 'one-ewallet-otc-ui'
161
+ // Import styles
162
+ import 'one-ewallet-otc-ui/style.css'
150
163
 
151
164
  // Create Sui network configuration
152
165
  const { networkConfig } = createNetworkConfig({
@@ -212,7 +225,16 @@ createRoot(document.getElementById('root')!).render(<App />)
212
225
 
213
226
  ## 🎨 Styling
214
227
 
215
- The component library includes built-in styles, so no additional CSS imports are needed. Styles are written in SCSS and are automatically bundled.
228
+ **Important:** You must import the component library's styles in your application entry file:
229
+
230
+ ```tsx
231
+ // In your main.tsx or App.tsx
232
+ import 'one-ewallet-otc-ui/style.css'
233
+ // or
234
+ import 'one-ewallet-otc-ui/dist/style.css'
235
+ ```
236
+
237
+ The component library includes built-in styles written in SCSS. The styles are automatically bundled into `dist/style.css` during the build process. Make sure to import this CSS file in your application for the components to display correctly.
216
238
 
217
239
  ## 🔌 API Endpoints
218
240
 
package/dist/index.es.js CHANGED
@@ -25090,7 +25090,7 @@ function hw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25090
25090
  }
25091
25091
  };
25092
25092
  return /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25093
- /* @__PURE__ */ Q.jsx(xt, { open: a, onCancel: L, footer: null, width: 560, centered: !0, destroyOnHidden: !0, children: /* @__PURE__ */ Q.jsxs("div", { className: "cf otc-modal", children: [
25093
+ /* @__PURE__ */ Q.jsx(xt, { open: a, onCancel: L, footer: null, width: 560, centered: !0, destroyOnHidden: !0, children: /* @__PURE__ */ Q.jsxs("div", { className: "cf otc-modal-ui", children: [
25094
25094
  /* @__PURE__ */ Q.jsxs("div", { className: "m-b-16 fz-18 fwb ta", style: { position: "relative" }, children: [
25095
25095
  v !== "deposit" && /* @__PURE__ */ Q.jsx(
25096
25096
  "img",
@@ -25107,7 +25107,7 @@ function hw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25107
25107
  ] }),
25108
25108
  v === "deposit" && /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25109
25109
  /* @__PURE__ */ Q.jsx("div", { className: "m-b-8 cf06", children: i("wallet.deposit.network") }),
25110
- /* @__PURE__ */ Q.jsx("div", { className: "token-select-box flex flex-center m-b-16", children: /* @__PURE__ */ Q.jsx(
25110
+ /* @__PURE__ */ Q.jsx("div", { className: "token-select-box-ui flex flex-center m-b-16", children: /* @__PURE__ */ Q.jsx(
25111
25111
  nt,
25112
25112
  {
25113
25113
  value: u,
@@ -25117,7 +25117,7 @@ function hw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25117
25117
  G && G.currency.length > 0 ? (z(G.currency), c(G.currency[0])) : (z([]), c(""));
25118
25118
  },
25119
25119
  disabled: j || !!g && (u == "HPAY" || u == "Huione"),
25120
- className: "custom-select",
25120
+ className: "custom-select-ui",
25121
25121
  popupClassName: "popup-long",
25122
25122
  suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }),
25123
25123
  style: { border: "none", background: "transparent", width: "100%" },
@@ -25128,13 +25128,13 @@ function hw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25128
25128
  }
25129
25129
  ) }),
25130
25130
  /* @__PURE__ */ Q.jsx("div", { className: "m-b-8 cf06", children: i("wallet.deposit.token") }),
25131
- /* @__PURE__ */ Q.jsx("div", { className: "token-select-box flex flex-center m-b-12", children: /* @__PURE__ */ Q.jsx(
25131
+ /* @__PURE__ */ Q.jsx("div", { className: "token-select-box-ui flex flex-center m-b-12", children: /* @__PURE__ */ Q.jsx(
25132
25132
  nt,
25133
25133
  {
25134
25134
  value: l,
25135
25135
  onChange: (V) => c(V),
25136
25136
  disabled: j || !!g && (u == "HPAY" || u == "Huione"),
25137
- className: "custom-select",
25137
+ className: "custom-select-ui",
25138
25138
  popupClassName: "popup-long",
25139
25139
  suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }),
25140
25140
  style: { border: "none", background: "transparent", width: "100%" },
@@ -25199,7 +25199,7 @@ function hw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25199
25199
  ] }),
25200
25200
  u !== "HPAY" && u !== "Huione" && /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25201
25201
  /* @__PURE__ */ Q.jsx("div", { className: "cf06 m-b-6", children: i("wallet.deposit.address") }),
25202
- /* @__PURE__ */ Q.jsxs("div", { className: "token-select-box flex flex-center w100 p-12 gap-8", children: [
25202
+ /* @__PURE__ */ Q.jsxs("div", { className: "token-select-box-ui flex flex-center w100 p-12 gap-8", children: [
25203
25203
  /* @__PURE__ */ Q.jsx("div", { className: "cf06 flex-1", style: { wordBreak: "break-all" }, children: g || "-" }),
25204
25204
  /* @__PURE__ */ Q.jsx(wo, { title: i("wallet.deposit.copy"), children: /* @__PURE__ */ Q.jsx("img", { src: Ja, alt: "copy", width: 16, height: 16, className: "pointer", onClick: () => g && Qa(g) }) })
25205
25205
  ] })
@@ -25426,7 +25426,7 @@ function pw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25426
25426
  });
25427
25427
  };
25428
25428
  return /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25429
- /* @__PURE__ */ Q.jsx(xt, { open: c, onCancel: B, footer: null, width: 560, centered: !0, destroyOnClose: !0, children: /* @__PURE__ */ Q.jsxs("div", { className: "cf otc-modal withdraw-page", children: [
25429
+ /* @__PURE__ */ Q.jsx(xt, { open: c, onCancel: B, footer: null, width: 560, centered: !0, destroyOnClose: !0, children: /* @__PURE__ */ Q.jsxs("div", { className: "cf otc-modal withdraw-page-ui", children: [
25430
25430
  /* @__PURE__ */ Q.jsxs("div", { className: "m-b-16 fz-18 fwb ta", style: { position: "relative" }, children: [
25431
25431
  x !== "form" && /* @__PURE__ */ Q.jsx(
25432
25432
  "img",
@@ -25442,20 +25442,20 @@ function pw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25442
25442
  ] }),
25443
25443
  x === "form" && /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25444
25444
  /* @__PURE__ */ Q.jsx("div", { className: "m-b-8 cf06", children: f("wallet.withdraw.network") }),
25445
- /* @__PURE__ */ Q.jsx("div", { className: "flex flex-center m-b-16 token-select-box", children: /* @__PURE__ */ Q.jsx(nt, { value: h, onChange: (se) => {
25445
+ /* @__PURE__ */ Q.jsx("div", { className: "flex flex-center m-b-16 token-select-box-ui", children: /* @__PURE__ */ Q.jsx(nt, { value: h, onChange: (se) => {
25446
25446
  y(se);
25447
25447
  const ie = W.find((ge) => ge.chain === se);
25448
25448
  ie && ie.currency.length > 0 ? (ae(ie.currency), b(ie.currency[0])) : (ae([]), b(""));
25449
- }, className: "custom-select", popupClassName: "popup-long", suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }), style: { border: "none", background: "transparent", width: "100%" }, children: W.map((se) => /* @__PURE__ */ Q.jsx(nt.Option, { value: se.chain, children: /* @__PURE__ */ Q.jsxs("div", { className: "flex flex-center gap-4", children: [
25449
+ }, className: "custom-select-ui", popupClassName: "popup-long", suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }), style: { border: "none", background: "transparent", width: "100%" }, children: W.map((se) => /* @__PURE__ */ Q.jsx(nt.Option, { value: se.chain, children: /* @__PURE__ */ Q.jsxs("div", { className: "flex flex-center gap-4", children: [
25450
25450
  Pu[se.chain] && /* @__PURE__ */ Q.jsx("img", { src: Pu[se.chain], alt: se.chain, width: 20 }),
25451
25451
  $u[se.chain] && /* @__PURE__ */ Q.jsx("span", { children: $u[se.chain] })
25452
25452
  ] }) })) }) }),
25453
25453
  /* @__PURE__ */ Q.jsx("div", { className: "m-b-8 cf06", children: f("wallet.withdraw.token") }),
25454
- /* @__PURE__ */ Q.jsx("div", { className: "token-select-box flex flex-center m-b-12", children: /* @__PURE__ */ Q.jsx(
25454
+ /* @__PURE__ */ Q.jsx("div", { className: "token-select-box-ui flex flex-center m-b-12", children: /* @__PURE__ */ Q.jsx(
25455
25455
  nt,
25456
25456
  {
25457
25457
  value: g,
25458
- className: "custom-select",
25458
+ className: "custom-select-ui",
25459
25459
  onChange: (se) => b(se),
25460
25460
  popupClassName: "popup-long",
25461
25461
  suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }),
@@ -25469,7 +25469,7 @@ function pw({ children: e, lang: t = "EN", authToken: n, userAddress: r, baseUrl
25469
25469
  h === "HPAY" ? /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
25470
25470
  /* @__PURE__ */ Q.jsx("div", { className: "m-b-8 cf06", children: f("wallet.withdraw.account") }),
25471
25471
  /* @__PURE__ */ Q.jsxs("div", { className: "m-b-16 flex gap-8", children: [
25472
- /* @__PURE__ */ Q.jsx("div", { className: "token-select-box w-[100px] h-[48px] flex flex-center", children: /* @__PURE__ */ Q.jsx(nt, { value: v, onChange: (se) => P(se), className: "custom-select", popupClassName: "popup-long", suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }), style: { border: "none", background: "transparent", width: "100%" }, children: /* @__PURE__ */ Q.jsx(nt.Option, { value: "+855", children: /* @__PURE__ */ Q.jsx("div", { className: "flex flex-center gap-4 ", children: "+855" }) }) }) }),
25472
+ /* @__PURE__ */ Q.jsx("div", { className: "token-select-box-ui w-[100px] h-[48px] flex flex-center", children: /* @__PURE__ */ Q.jsx(nt, { value: v, onChange: (se) => P(se), className: "custom-select-ui", popupClassName: "popup-long", suffixIcon: /* @__PURE__ */ Q.jsx("img", { src: Jn, alt: "arrow", width: 12, height: 8 }), style: { border: "none", background: "transparent", width: "100%" }, children: /* @__PURE__ */ Q.jsx(nt.Option, { value: "+855", children: /* @__PURE__ */ Q.jsx("div", { className: "flex flex-center gap-4 ", children: "+855" }) }) }) }),
25473
25473
  /* @__PURE__ */ Q.jsx(d2, { className: "input ant-input flex-1 min-w-0", placeholder: f("wallet.withdraw.accountPh"), value: w, onChange: (se) => I(se.target.value) })
25474
25474
  ] })
25475
25475
  ] }) : /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [