@arcblock/ux 3.0.8 → 3.0.10

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 (66) hide show
  1. package/lib/Address/did-address.js +47 -49
  2. package/lib/Address/responsive-did-address.js +53 -57
  3. package/lib/Avatar/index.js +16 -16
  4. package/lib/BlockletV2/blocklet.js +64 -64
  5. package/lib/BlockletV2/components/tooltip-icon.js +26 -27
  6. package/lib/CardSelector/index.js +1 -2
  7. package/lib/ClickToCopy/hook.js +10 -11
  8. package/lib/ClickToCopy/index.js +16 -16
  9. package/lib/Config/theme-mode-toggle.js +7 -8
  10. package/lib/DID/index.js +131 -133
  11. package/lib/DIDConnect/app-info-item.js +18 -18
  12. package/lib/DIDConnect/auth-apps/index.js +83 -84
  13. package/lib/DIDConnect/did-connect-container.js +89 -90
  14. package/lib/DIDConnect/did-connect-footer.js +25 -25
  15. package/lib/DIDConnect/landing-page.js +17 -17
  16. package/lib/DIDConnect/powered-by.js +11 -11
  17. package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
  18. package/lib/DIDConnect/with-container.js +66 -68
  19. package/lib/Dialog/use-confirm.js +40 -43
  20. package/lib/Earth/index.js +21 -22
  21. package/lib/Footer/index.js +15 -16
  22. package/lib/Header/responsive-header.js +23 -24
  23. package/lib/Layout/dashboard/index.js +63 -72
  24. package/lib/Layout/dashboard/sidebar.js +20 -21
  25. package/lib/Layout/dashboard-legacy/index.js +52 -52
  26. package/lib/Locale/context.js +36 -37
  27. package/lib/Locale/selector.js +40 -42
  28. package/lib/NFTDisplay/index.js +114 -118
  29. package/lib/NFTDisplay/render-svg.js +12 -12
  30. package/lib/NavMenu/nav-menu.js +159 -161
  31. package/lib/NavMenu/sub-container.js +25 -26
  32. package/lib/PageScroller/index.js +28 -32
  33. package/lib/Passport/passport.js +11 -11
  34. package/lib/PhoneInput/country-select.js +38 -38
  35. package/lib/PhoneInput/index.js +65 -66
  36. package/lib/Screenshot/index.js +26 -27
  37. package/lib/SessionBlocklet/index.js +87 -93
  38. package/lib/SessionPermission/index.js +5 -9
  39. package/lib/SessionUser/components/did-space.js +24 -25
  40. package/lib/SessionUser/components/logged-in.js +122 -127
  41. package/lib/SessionUser/components/quick-login-item.js +41 -42
  42. package/lib/SessionUser/components/session-user-item.js +35 -36
  43. package/lib/SessionUser/components/session-user-switch.js +81 -85
  44. package/lib/SessionUser/components/un-login.js +41 -41
  45. package/lib/SessionUser/components/user-info.js +43 -47
  46. package/lib/SessionUser/index.js +1 -1
  47. package/lib/SessionUser/libs/utils.js +24 -30
  48. package/lib/SharedBridge/index.js +35 -35
  49. package/lib/Theme/index.js +16 -16
  50. package/lib/Theme/theme.js +42 -43
  51. package/lib/Toast/index.js +24 -25
  52. package/lib/Typography/index.js +42 -42
  53. package/lib/UserCard/Content/basic.js +91 -93
  54. package/lib/UserCard/Content/shorten-label.js +9 -9
  55. package/lib/UserCard/components.js +15 -15
  56. package/lib/Util/deprecate.js +1 -1
  57. package/lib/Util/federated.js +28 -32
  58. package/lib/Util/iframe.js +9 -10
  59. package/lib/Util/index.js +134 -135
  60. package/lib/Util/security.js +9 -10
  61. package/lib/Util/wallet.js +6 -9
  62. package/lib/VerificationCode/index.js +26 -28
  63. package/lib/hooks/use-blocklet-logo.js +11 -14
  64. package/lib/ux.css +1 -1
  65. package/lib/withTracker/index.js +13 -14
  66. package/package.json +9 -10
@@ -6,24 +6,24 @@ import u from "../NFTDisplay/index.js";
6
6
  import { useLocaleContext as y } from "../Locale/context.js";
7
7
  function b({
8
8
  passport: e,
9
- user: m,
9
+ user: a,
10
10
  color: n,
11
11
  width: t = 150,
12
- icon: o = null,
13
- createPassportSvg: s,
12
+ icon: s = null,
13
+ createPassportSvg: o,
14
14
  // inherit props
15
15
  children: d,
16
- ...a
16
+ ...m
17
17
  }) {
18
18
  const { t: c } = y();
19
19
  return /* @__PURE__ */ r(
20
20
  i,
21
21
  {
22
- ...a,
22
+ ...m,
23
23
  sx: {
24
24
  display: "flex",
25
25
  alignItems: "center",
26
- ...a == null ? void 0 : a.sx
26
+ ...m?.sx
27
27
  },
28
28
  children: [
29
29
  !!e.display && /* @__PURE__ */ l(i, { className: "passport-item__display", sx: { width: t }, children: /* @__PURE__ */ l(
@@ -39,13 +39,13 @@ function b({
39
39
  {
40
40
  className: "passport-item__display",
41
41
  dangerouslySetInnerHTML: {
42
- __html: s({
42
+ __html: o({
43
43
  title: e.scope === "kyc" ? e.name : e.title,
44
44
  issuer: e.issuer && e.issuer.name,
45
45
  issuerDid: e.issuer && e.issuer.id,
46
- ownerName: m.fullName,
47
- ownerDid: m.did,
48
- ownerAvatarUrl: m.avatar,
46
+ ownerName: a.fullName,
47
+ ownerDid: a.did,
48
+ ownerAvatarUrl: a.avatar,
49
49
  revoked: e.revoked,
50
50
  scope: e.scope,
51
51
  role: e.role,
@@ -92,7 +92,7 @@ function b({
92
92
  }
93
93
  },
94
94
  children: [
95
- o,
95
+ s,
96
96
  e.revoked && /* @__PURE__ */ l(x, {})
97
97
  ]
98
98
  }
@@ -1,30 +1,30 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import { useState as O, useMemo as x } from "react";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useState as O, useMemo as g } from "react";
3
3
  import { Box as C, Typography as a, Select as z, TextField as j, MenuItem as k } from "@mui/material";
4
- import { defaultCountries as u, parseCountry as c, FlagEmoji as y } from "react-international-phone";
5
- import P from "@arcblock/icons/lib/ArrowDown";
6
- import { mergeSx as F } from "../Util/style.js";
7
- function L({
8
- ref: w = void 0,
9
- value: i,
10
- onChange: s = void 0,
4
+ import { defaultCountries as s, parseCountry as d, FlagEmoji as y } from "react-international-phone";
5
+ import D from "@arcblock/icons/lib/ArrowDown";
6
+ import { mergeSx as P } from "../Util/style.js";
7
+ function F({
8
+ ref: x = void 0,
9
+ value: r,
10
+ onChange: w = void 0,
11
11
  sx: I = {},
12
12
  selectCountryProps: M = void 0,
13
- preview: p = !1,
13
+ preview: u = !1,
14
14
  valueField: v = "iso2",
15
- ...m
15
+ ...c
16
16
  }) {
17
- const { hideFlag: h = !0, hideDialCode: f = !1 } = M || {}, [n, S] = O(""), r = x(() => {
18
- const e = u.find((o) => o[1] === i);
19
- return i && e ? c(e) : { name: "", iso2: "", dialCode: "" };
20
- }, [i]), b = x(() => {
21
- if (!n) return u;
17
+ const { hideFlag: p = !0, hideDialCode: h = !1 } = M || {}, [n, S] = O(""), m = g(() => {
18
+ const e = s.find((o) => o[1] === r);
19
+ return r && e ? d(e) : { name: "", iso2: "", dialCode: "" };
20
+ }, [r]), b = g(() => {
21
+ if (!n) return s;
22
22
  const e = n.toLowerCase();
23
- return u.filter((o) => {
24
- const d = c(o);
25
- return d.name.toLowerCase().includes(e) || d.iso2.toLowerCase().includes(e) || d.dialCode.includes(e);
23
+ return s.filter((o) => {
24
+ const l = d(o);
25
+ return l.name.toLowerCase().includes(e) || l.iso2.toLowerCase().includes(e) || l.dialCode.includes(e);
26
26
  });
27
- }, [n]), g = /* @__PURE__ */ l(
27
+ }, [n]), f = /* @__PURE__ */ i(
28
28
  C,
29
29
  {
30
30
  sx: {
@@ -32,27 +32,27 @@ function L({
32
32
  alignItems: "center",
33
33
  flexWrap: "nowrap",
34
34
  gap: 0.5,
35
- cursor: p ? "default" : "pointer"
35
+ cursor: u ? "default" : "pointer"
36
36
  },
37
37
  children: [
38
- h ? null : /* @__PURE__ */ t(y, { iso2: i, style: { display: "flex", width: 24, color: "inherit" } }),
39
- /* @__PURE__ */ t(a, { component: "span", sx: { lineHeight: 1.5 }, children: f ? r == null ? void 0 : r.name : `+${r == null ? void 0 : r.dialCode}` })
38
+ p ? null : /* @__PURE__ */ t(y, { iso2: r, style: { display: "flex", width: 24, color: "inherit" } }),
39
+ /* @__PURE__ */ t(a, { component: "span", sx: { lineHeight: 1.5 }, children: h ? m?.name : `+${m?.dialCode}` })
40
40
  ]
41
41
  }
42
42
  );
43
- return p ? g : /* @__PURE__ */ l(
43
+ return u ? f : /* @__PURE__ */ i(
44
44
  z,
45
45
  {
46
- ...m,
47
- ref: w,
46
+ ...c,
47
+ ref: x,
48
48
  MenuProps: {
49
49
  style: { maxHeight: 400, top: 2, zIndex: 9999 },
50
50
  // 默认 zIndex 为 1300, 但是在 SwipeableDrawer 中需要设置为 9999
51
51
  anchorOrigin: { vertical: "bottom", horizontal: "left" },
52
52
  transformOrigin: { vertical: "top", horizontal: "left" },
53
- ...m.MenuProps ?? {}
53
+ ...c.MenuProps ?? {}
54
54
  },
55
- sx: F(
55
+ sx: P(
56
56
  {
57
57
  '&.Mui-focused:has(div[aria-expanded="false"])': { fieldset: { display: "block" } },
58
58
  ".MuiSelect-select": { padding: 1, paddingRight: "24px !important" },
@@ -69,10 +69,10 @@ function L({
69
69
  },
70
70
  I
71
71
  ),
72
- value: i,
73
- onChange: (e) => s == null ? void 0 : s(e.target.value),
74
- IconComponent: (e) => /* @__PURE__ */ t(P, { ...e, width: 20, height: 20 }),
75
- renderValue: () => g,
72
+ value: r,
73
+ onChange: (e) => w?.(e.target.value),
74
+ IconComponent: (e) => /* @__PURE__ */ t(D, { ...e, width: 20, height: 20 }),
75
+ renderValue: () => f,
76
76
  children: [
77
77
  /* @__PURE__ */ t(C, { sx: { p: 1, position: "sticky", top: 0, bgcolor: "background.paper", zIndex: 1 }, children: /* @__PURE__ */ t(
78
78
  j,
@@ -87,9 +87,9 @@ function L({
87
87
  }
88
88
  ) }),
89
89
  b.map((e) => {
90
- const o = c(e);
91
- return /* @__PURE__ */ l(k, { value: o[v], children: [
92
- h ? null : /* @__PURE__ */ t(y, { iso2: o.iso2, style: { marginRight: 8, width: 24 } }),
90
+ const o = d(e);
91
+ return /* @__PURE__ */ i(k, { value: o[v], children: [
92
+ p ? null : /* @__PURE__ */ t(y, { iso2: o.iso2, style: { marginRight: 8, width: 24 } }),
93
93
  /* @__PURE__ */ t(
94
94
  a,
95
95
  {
@@ -99,7 +99,7 @@ function L({
99
99
  children: o.name
100
100
  }
101
101
  ),
102
- f ? null : /* @__PURE__ */ l(a, { color: "gray", children: [
102
+ h ? null : /* @__PURE__ */ i(a, { color: "gray", children: [
103
103
  "(+",
104
104
  o.dialCode,
105
105
  ")"
@@ -110,7 +110,7 @@ function L({
110
110
  }
111
111
  );
112
112
  }
113
- const A = L;
113
+ const q = F;
114
114
  export {
115
- A as default
115
+ q as default
116
116
  };
@@ -1,55 +1,54 @@
1
- import { jsxs as $, jsx as m } from "react/jsx-runtime";
2
- import { useMemo as P, useState as F, useCallback as k } from "react";
3
- import { Box as I, Typography as A, TextField as L } from "@mui/material";
4
- import { parsePhoneNumber as v } from "awesome-phonenumber";
5
- import { defaultCountries as f, parseCountry as p, usePhoneInput as R } from "react-international-phone";
6
- import V from "./country-select.js";
1
+ import { jsxs as D, jsx as y } from "react/jsx-runtime";
2
+ import { useMemo as g, useState as F, useCallback as k } from "react";
3
+ import { Box as $, Typography as A, TextField as L } from "@mui/material";
4
+ import { parsePhoneNumber as b } from "awesome-phonenumber";
5
+ import { defaultCountries as d, parseCountry as f, usePhoneInput as R } from "react-international-phone";
6
+ import I from "./country-select.js";
7
7
  import { mergeSx as q } from "../Util/style.js";
8
- function W(e, t, n = "") {
9
- var c, h;
8
+ function x(e, t, n = "") {
10
9
  if (!e) return !1;
11
- const r = e.replace(/[\s\-()]+/g, ""), u = n || B(t);
12
- if (g(u) === g(r))
10
+ const r = e.replace(/[\s\-()]+/g, ""), u = n || w(t);
11
+ if (m(u) === m(r))
13
12
  return !0;
14
- const a = v(e, { regionCode: t }), d = (c = a.number) == null ? void 0 : c.input.replace(/[\s\-()]+/g, "");
15
- return a.valid && (a.type === "mobile" || a.type === "fixed-line-or-mobile") && d === ((h = a.number) == null ? void 0 : h.e164);
13
+ const a = b(e, { regionCode: t }), l = a.number?.input.replace(/[\s\-()]+/g, "");
14
+ return a.valid && (a.type === "mobile" || a.type === "fixed-line-or-mobile") && l === a.number?.e164;
16
15
  }
17
- function x(e, t) {
16
+ function P(e, t) {
18
17
  return e ? e.replace(new RegExp(`^\\+${t}`), "") : "";
19
18
  }
20
- function b(e, t) {
19
+ function V(e, t) {
21
20
  return e ? e.startsWith("+") ? e : `+${t}${e}` : `+${t}`;
22
21
  }
23
- function g(e) {
22
+ function m(e) {
24
23
  return e.replace(/^\+/, "");
25
24
  }
26
- function w(e, t) {
27
- const n = f.find((r) => p(r).iso2 === e);
25
+ function v(e, t) {
26
+ const n = d.find((r) => f(r).iso2 === e);
28
27
  if (n)
29
- return p(n)[t];
28
+ return f(n)[t];
30
29
  }
31
- function B(e) {
32
- return w(e, "dialCode") || "";
30
+ function w(e) {
31
+ return v(e, "dialCode") || "";
33
32
  }
34
33
  function U(e) {
35
- return w(e, "name") || "";
34
+ return v(e, "name") || "";
36
35
  }
37
36
  function X(e) {
38
37
  try {
39
38
  if (!e) return;
40
39
  if (e.startsWith("+")) {
41
- const t = v(e);
40
+ const t = b(e);
42
41
  if (t.valid)
43
42
  return t.regionCode.toLowerCase();
44
- for (const n of f) {
45
- const r = p(n);
46
- if (e.startsWith(`+${r.dialCode}`) && W(e, r.dialCode, r.iso2))
43
+ for (const n of d) {
44
+ const r = f(n);
45
+ if (e.startsWith(`+${r.dialCode}`) && x(e, r.dialCode, r.iso2))
47
46
  return r.iso2;
48
47
  }
49
48
  } else
50
- for (const t of f) {
51
- const n = p(t), r = `+${n.dialCode}${e}`;
52
- if (W(r, n.dialCode, n.iso2))
49
+ for (const t of d) {
50
+ const n = f(t), r = `+${n.dialCode}${e}`;
51
+ if (x(r, n.dialCode, n.iso2))
53
52
  return n.iso2;
54
53
  }
55
54
  return;
@@ -64,56 +63,56 @@ function Y({
64
63
  countryDisplayOptions: r = {},
65
64
  preview: u = !1,
66
65
  allowDial: a = !0,
67
- ...d
66
+ ...l
68
67
  }) {
69
- const c = P(() => {
68
+ const p = g(() => {
70
69
  const o = /* @__PURE__ */ new Map();
71
- return f.forEach((i) => {
72
- const s = p(i);
70
+ return d.forEach((i) => {
71
+ const s = f(i);
73
72
  o.set(s.iso2, s);
74
73
  }), o;
75
- }, []), [h, M] = F(e), E = k(
74
+ }, []), [B, M] = F(e), E = k(
76
75
  (o) => {
77
76
  if (!u && t) {
78
77
  const i = {
79
78
  ...e,
80
79
  ...o
81
- }, s = c.get(i.country);
82
- s && (i.phone = b(i.phone, g(s.dialCode))), t(i);
80
+ }, s = p.get(i.country);
81
+ s && (i.phone = V(i.phone, m(s.dialCode))), t(i);
83
82
  }
84
83
  },
85
- [t, u, e, c]
86
- ), C = P(() => {
87
- const o = c.get(e.country);
88
- return o ? g(o.dialCode) : "";
89
- }, [e.country, c]), { phone: l, country: y, handlePhoneValueChange: S, setCountry: T } = R({
84
+ [t, u, e, p]
85
+ ), h = g(() => {
86
+ const o = p.get(e.country);
87
+ return o ? m(o.dialCode) : "";
88
+ }, [e.country, p]), { phone: c, country: C, handlePhoneValueChange: S, setCountry: T } = R({
90
89
  defaultCountry: e.country,
91
- value: x(e.phone, C),
92
- countries: f,
90
+ value: P(e.phone, h),
91
+ countries: d,
93
92
  disableDialCodeAndPrefix: !0,
94
93
  onChange: (o) => {
95
94
  const i = {
96
95
  ...o,
97
- phone: h.country !== o.country && !o.phone ? x(e.phone, C) : o.phone
96
+ phone: B.country !== o.country && !o.phone ? P(e.phone, h) : o.phone
98
97
  };
99
98
  M(i), E(i);
100
99
  }
101
- }), D = P(
102
- () => l || x(e.phone, C),
103
- [l, e.phone, C]
100
+ }), W = g(
101
+ () => c || P(e.phone, h),
102
+ [c, e.phone, h]
104
103
  ), j = (o) => {
105
104
  u || T(o);
106
105
  };
107
106
  if (u) {
108
- const o = b(l, B(y)), i = l && W(o, y), s = a && i;
109
- return /* @__PURE__ */ $(
110
- I,
107
+ const o = V(c, w(C)), i = c && x(o, C), s = a && i;
108
+ return /* @__PURE__ */ D(
109
+ $,
111
110
  {
112
111
  component: s ? "a" : "div",
113
- href: s ? `tel:${l}` : void 0,
112
+ href: s ? `tel:${c}` : void 0,
114
113
  ...s ? {
115
- "aria-label": `Call ${l}`,
116
- title: `Call ${l}`,
114
+ "aria-label": `Call ${c}`,
115
+ title: `Call ${c}`,
117
116
  rel: "nofollow",
118
117
  itemProp: "telephone"
119
118
  } : {},
@@ -128,14 +127,14 @@ function Y({
128
127
  }
129
128
  },
130
129
  children: [
131
- /* @__PURE__ */ m(V, { value: y, preview: u }),
132
- /* @__PURE__ */ m(A, { sx: { ml: 0.5 }, children: D })
130
+ /* @__PURE__ */ y(I, { value: C, preview: u }),
131
+ /* @__PURE__ */ y(A, { sx: { ml: 0.5 }, children: W })
133
132
  ]
134
133
  }
135
134
  );
136
135
  }
137
- return /* @__PURE__ */ $(
138
- I,
136
+ return /* @__PURE__ */ D(
137
+ $,
139
138
  {
140
139
  sx: {
141
140
  display: "flex",
@@ -143,20 +142,20 @@ function Y({
143
142
  gap: 0.5
144
143
  },
145
144
  children: [
146
- /* @__PURE__ */ m(
147
- V,
145
+ /* @__PURE__ */ y(
146
+ I,
148
147
  {
149
- value: y,
148
+ value: C,
150
149
  onChange: j,
151
150
  preview: !1,
152
151
  selectCountryProps: r
153
152
  }
154
153
  ),
155
- /* @__PURE__ */ m(
154
+ /* @__PURE__ */ y(
156
155
  L,
157
156
  {
158
- ...d,
159
- value: D,
157
+ ...l,
158
+ value: W,
160
159
  onChange: S,
161
160
  placeholder: n,
162
161
  className: "phone-input",
@@ -166,11 +165,11 @@ function Y({
166
165
  padding: 1
167
166
  }
168
167
  },
169
- d.sx
168
+ l.sx
170
169
  // 这里传入的可能是一个数组或一个对象
171
170
  ),
172
171
  slotProps: {
173
- input: d.InputProps ?? {}
172
+ input: l.InputProps ?? {}
174
173
  }
175
174
  }
176
175
  )
@@ -182,6 +181,6 @@ export {
182
181
  Y as default,
183
182
  X as detectCountryFromPhone,
184
183
  U as getCountryNameByCountry,
185
- B as getDialCodeByCountry,
186
- W as validatePhoneNumber
184
+ w as getDialCodeByCountry,
185
+ x as validatePhoneNumber
187
186
  };
@@ -1,9 +1,9 @@
1
- import { jsx as s, jsxs as N } from "react/jsx-runtime";
2
- import { useRef as k, useState as v, useEffect as S, Children as g, cloneElement as $, createElement as z } from "react";
1
+ import { jsx as s, jsxs as x } from "react/jsx-runtime";
2
+ import { useRef as N, useState as f, useEffect as k, Children as v, cloneElement as S, createElement as $ } from "react";
3
3
  import a from "lodash/isUndefined";
4
- import { mergeProps as C } from "../Util/index.js";
5
- import { styled as b } from "../Theme/index.js";
6
- import j from "./BaseScreenshot/index.js";
4
+ import { mergeProps as z } from "../Util/index.js";
5
+ import { styled as g } from "../Theme/index.js";
6
+ import C from "./BaseScreenshot/index.js";
7
7
  /* empty css */
8
8
  const u = {
9
9
  "iphone-x": {
@@ -71,34 +71,33 @@ const u = {
71
71
  width: 200,
72
72
  scale: 1
73
73
  }
74
- }, E = {
74
+ }, j = {
75
75
  img: ["alt", "title", "src", "srcSet", "sizes", "loading", "key", "children"],
76
76
  video: ["alt", "title", "muted", "autoplay", "loop", "key", "children"]
77
- }, O = (t) => [
78
- z(
77
+ }, E = (t) => [
78
+ $(
79
79
  t.type,
80
- E[t.type].reduce((e, i) => (e[i] = t.props[i], e), {})
80
+ j[t.type].reduce((e, i) => (e[i] = t.props[i], e), {})
81
81
  )
82
- ], w = (t, e = !0) => {
82
+ ], b = (t, e = !0) => {
83
83
  for (let i = 0; i < t.length; i++) {
84
84
  const r = t[i];
85
85
  if (["img", "video"].includes(r.type))
86
- return O(r);
86
+ return E(r);
87
87
  if (r.props && r.props.children) {
88
- const n = g.toArray(r.props.children), o = w(n, !1);
88
+ const n = v.toArray(r.props.children), o = b(n, !1);
89
89
  if (o)
90
90
  return o;
91
91
  }
92
92
  }
93
93
  return e ? t : null;
94
94
  };
95
- function y(t) {
96
- var f;
95
+ function w(t) {
97
96
  const e = Object.assign({}, t);
98
97
  a(e.type) && (e.type = "iphone-x"), a(e.className) && (e.className = ""), a(e.style) && (e.style = {}), a(e.width) && (e.width = 0), a(e.height) && (e.height = 0);
99
- const i = C(e, y, ["style", "width", "height"]), { type: r, children: n, style: o, className: c, width: p, height: m, ...l } = i, { zIndex: h = 0, borderRadius: d = 0 } = u[r] || {};
100
- return /* @__PURE__ */ N(
101
- H,
98
+ const i = z(e, w, ["style", "width", "height"]), { type: r, children: n, style: o, className: c, width: p, height: m, ...l } = i, { zIndex: h = 0, borderRadius: d = 0 } = u[r] || {};
99
+ return /* @__PURE__ */ x(
100
+ O,
102
101
  {
103
102
  ...l,
104
103
  type: r,
@@ -107,7 +106,7 @@ function y(t) {
107
106
  contentRadius: d,
108
107
  contentZIndex: h,
109
108
  children: [
110
- /* @__PURE__ */ s("div", { className: "device-frame", children: /* @__PURE__ */ s("div", { className: "device-content", children: (f = w(g.toArray(n))) == null ? void 0 : f.map((R, x) => $(R, { key: x })) }) }),
109
+ /* @__PURE__ */ s("div", { className: "device-frame", children: /* @__PURE__ */ s("div", { className: "device-content", children: b(v.toArray(n))?.map((y, R) => S(y, { key: R })) }) }),
111
110
  /* @__PURE__ */ s("div", { className: "device-stripe" }),
112
111
  /* @__PURE__ */ s("div", { className: "device-header" }),
113
112
  /* @__PURE__ */ s("div", { className: "device-sensors" }),
@@ -117,7 +116,7 @@ function y(t) {
117
116
  }
118
117
  );
119
118
  }
120
- const H = b("div")`
119
+ const O = g("div")`
121
120
  @media (max-width: ${(t) => u[t.type].width}px) {
122
121
  transform-origin: 0 0;
123
122
  transform: scale(${(t) => u[t.type].scale});
@@ -136,9 +135,9 @@ const H = b("div")`
136
135
  height: 100.1%;
137
136
  }
138
137
  `;
139
- function P({ ...t }) {
140
- const e = k(null), [i, r] = v(), [n, o] = v(null);
141
- return S(() => {
138
+ function H({ ...t }) {
139
+ const e = N(null), [i, r] = f(), [n, o] = f(null);
140
+ return k(() => {
142
141
  let c = null;
143
142
  const p = () => {
144
143
  const { clientWidth: m } = e.current, { clientWidth: l, clientHeight: h } = e.current.children[0], d = m / l;
@@ -147,18 +146,18 @@ function P({ ...t }) {
147
146
  return e.current && (c = new ResizeObserver(p), c.observe(e.current)), () => {
148
147
  c && c.disconnect();
149
148
  };
150
- }, [e.current]), /* @__PURE__ */ s(W, { ref: e, style: { height: i }, children: /* @__PURE__ */ s(y, { ...t, style: { transform: n ? `scale(${n})` : void 0 } }) });
149
+ }, [e.current]), /* @__PURE__ */ s(P, { ref: e, style: { height: i }, children: /* @__PURE__ */ s(w, { ...t, style: { transform: n ? `scale(${n})` : void 0 } }) });
151
150
  }
152
- const W = b("div")`
151
+ const P = g("div")`
153
152
  div[type] {
154
153
  transform: scale(1);
155
154
  transform-origin: 0 0;
156
155
  }
157
156
  `;
158
- function _({ type: t, src: e = "", children: i, sx: r = {}, ...n }) {
157
+ function Z({ type: t, src: e = "", children: i, sx: r = {}, ...n }) {
159
158
  const o = t.toLowerCase();
160
- return ["phone", "macbook"].includes(o) ? /* @__PURE__ */ s(j, { type: o, sx: r, ...n, children: i || (e ? /* @__PURE__ */ s("img", { src: e, alt: "screenshot" }) : null) }) : /* @__PURE__ */ s(P, { type: t, sx: { ...r, margin: "auto" }, ...n, children: i || (e ? /* @__PURE__ */ s("img", { src: e, alt: "screenshot" }) : null) });
159
+ return ["phone", "macbook"].includes(o) ? /* @__PURE__ */ s(C, { type: o, sx: r, ...n, children: i || (e ? /* @__PURE__ */ s("img", { src: e, alt: "screenshot" }) : null) }) : /* @__PURE__ */ s(H, { type: t, sx: { ...r, margin: "auto" }, ...n, children: i || (e ? /* @__PURE__ */ s("img", { src: e, alt: "screenshot" }) : null) });
161
160
  }
162
161
  export {
163
- _ as default
162
+ Z as default
164
163
  };