@nutui/taro-biz 0.0.1-alpha.8 → 0.0.1-alpha.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jdmaterialview.taro-34Y0-ZOh.js"),r=require("../jdmaterialsblurtarget.taro-BbcxTuKJ.js");exports.JDMaterialView=e.JDMaterialView;exports.JDMaterialsBlurTarget=r.JDMaterialsBlurTarget;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jdmaterialview.taro-BocjWSVM.js"),r=require("../jdmaterialsblurtarget.taro-BbcxTuKJ.js");exports.JDMaterialView=e.JDMaterialView;exports.JDMaterialsBlurTarget=r.JDMaterialsBlurTarget;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jdmaterialview.taro-34Y0-ZOh.js");exports.default=e.JDMaterialView;exports.getCornerRadius=e.getCornerRadius;exports.getFrostedPreset=e.getFrostedPreset;exports.getPreset=e.getPreset;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jdmaterialview.taro-BocjWSVM.js");exports.default=e.JDMaterialView;exports.getCornerRadius=e.getCornerRadius;exports.getFrostedPreset=e.getFrostedPreset;exports.getPreset=e.getPreset;
@@ -0,0 +1 @@
1
+ "use strict";const C=require("react/jsx-runtime"),f=require("react"),P=require("classnames"),d=require("@tarojs/taro"),M=require("@tarojs/components"),j=require("@jdtaro/ui"),x=require("./typings-DP_XKs5o.js"),w=26;function F(t,r,e){const s=e>=w;switch(t){case"top-solid":return s?{liquidGlass:{style:"regular",interactive:!0,tintColor:r?"rgba(0, 0, 0, 0.75)":"rgba(255, 255, 255, 0.45)",showTintOverlay:r}}:{fallbackStyle:{backgroundColor:r?"#2A2F36":"#FFFFFF"}};case"top-plain":return s?{liquidGlass:{style:"regular",interactive:!0,tintColor:r?"rgba(0, 0, 0, 0.75)":"rgba(255, 255, 255, 0.45)",showTintOverlay:r}}:{};case"top-bar":return{frostedGlass:{style:r?"thick-dark":"thick-light"}};case"promotion-fair":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"thick-light",alpha:.85}};case"promotion-deep":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"thick-light",alpha:.35}};case"immersive":return s?{liquidGlass:{style:"regular",forceDark:!0,interactive:!0,tintColor:"rgba(0, 0, 0, 0.75)"}}:{frostedGlass:{style:"regular-dark",alpha:.4}};case"bottom-bar":return{gradientBlur:{minBlur:.5,maxBlur:.8,overlayAlpha:.9,overlayColor:r?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"}};default:return{}}}function $(t,r){const e=r>=w;switch(t){case"top-bar":case"bottom-bar":return 0;case"top-plain":return e?12:0;case"top-solid":case"promotion-fair":case"promotion-deep":case"immersive":return e?12:8;default:return 0}}const R="255, 255, 255",S="31, 34, 38";function q(t,r){switch(t){case"top-solid":return{blurRadius:40,borderRadius:12,tintColor:r?"rgba(42, 47, 54, 1)":"rgba(255, 255, 255, 1)"};case"top-plain":return{blurRadius:40,borderRadius:12};case"top-bar":return{blurRadius:40,borderRadius:12,tintColor:r?`rgba(${S}, 0.9)`:`rgba(${R}, 0.9)`};case"promotion-fair":return{blurRadius:40,borderRadius:12,tintColor:`rgba(${R}, 0.85)`};case"promotion-deep":return{blurRadius:40,borderRadius:12,tintColor:`rgba(${R}, 0.2)`};case"immersive":return{blurRadius:40,borderRadius:12,tintColor:`rgba(${S}, 0.4)`};case"bottom-bar":return{blurRadius:50,borderRadius:0,tintColor:r?`rgba(${S}, 0.8)`:`rgba(${R}, 0.8)`};default:return{blurRadius:40,borderRadius:12}}}function N(t,r){const e=r?"dark":"light";switch(t){case"top-solid":return{blurScale:1,borderRadius:8,colorMode:e,overlayColor:r?"#2A2F36":"#FFFFFF"};case"top-plain":return{blurScale:0,borderRadius:8,colorMode:e};case"top-bar":return{blurScale:.9,borderRadius:0,colorMode:e};case"promotion-fair":return{blurScale:.85,borderRadius:8,colorMode:"light"};case"promotion-deep":return{blurScale:.2,borderRadius:8,colorMode:"light"};case"immersive":return{blurScale:.4,borderRadius:8,colorMode:"dark"};case"bottom-bar":return{blurScale:.2,borderRadius:0,colorMode:e};default:return{blurScale:0,borderRadius:0,colorMode:e}}}const V={...x.ComponentDefaults};function B(){return["harmony","harmonyhybrid","jdharmony"].includes(d.getEnv().toLowerCase())}function _(){var t;try{const r=d.getSystemInfoSync(),e=String((r==null?void 0:r.platform)||"").toLowerCase(),s=String((r==null?void 0:r.system)||""),a=e==="ios",i=a?parseInt(((t=s.match(/\d+/))==null?void 0:t[0])||"0",10):0,m=String((r==null?void 0:r.theme)||"").toLowerCase()==="dark";return{isIOS:a,iosMajor:i,dark:m}}catch{return{isIOS:!1,iosMajor:0,dark:!1}}}function E(){try{const t=d.getSystemInfoSync();return String((t==null?void 0:t.theme)||"").toLowerCase()==="dark"}catch{return!1}}function H(t){const{scene:r,dark:e,overlayColor:s,cls:a,style:i,children:m,rest:g}=t,n=r?N(r,e):void 0,o={};n?(o.blurScale=n.blurScale,o.borderRadius=n.borderRadius,o.colorMode=n.colorMode):o.colorMode=e?"dark":"light",(i==null?void 0:i.borderRadius)!==void 0&&(o.borderRadius=parseFloat(String(i.borderRadius)));const u=s??(n==null?void 0:n.overlayColor);return u&&(o.overlayColor=u),C.jsx(M.View,{className:a,style:i,...o,...g,children:m})}function J(t){const{scene:r,dark:e,targetId:s,overlayColor:a,cls:i,style:m,children:g,rest:n}=t,o=r?q(r,e):void 0,u={...m};o&&o.blurRadius>0&&(u.backdropFilter=`blur(${o.blurRadius}px)`),o&&u.borderRadius===void 0&&(u.borderRadius=`${o.borderRadius}px`);const p=a??(o==null?void 0:o.tintColor),b={};return s&&(b.targetId=s),r&&(b.scene=r),p&&(b.overlayColor=p),C.jsx(M.View,{className:i,style:u,...b,...n,children:g})}const k=t=>{const{className:r,style:e,children:s,scene:a,targetId:i,liquidGlass:m,frostedGlass:g,gradientBlur:n,overlayColor:o,...u}={...V,...t},b=P("nut-jdmaterialview",r),{isIOS:I,iosMajor:G}=f.useMemo(()=>_(),[]),[y,L]=f.useState(()=>E()),v=f.useCallback(c=>{const h=typeof c=="string"?c:String((c==null?void 0:c.theme)||"");L(h.toLowerCase()==="dark")},[]);f.useEffect(()=>{var c;try{(c=d.onThemeChange)==null||c.call(d,v)}catch{}return()=>{var h;try{(h=d.offThemeChange)==null||h.call(d,v)}catch{}}},[v]);const l=f.useMemo(()=>a?F(a,y,G):void 0,[a,y,G]),O=m??(l==null?void 0:l.liquidGlass),A=g??(l==null?void 0:l.frostedGlass),D=n??(l==null?void 0:l.gradientBlur);if(I){const c={...l==null?void 0:l.fallbackStyle,...e};return C.jsx(j.JDIOSMaterialView,{className:b,style:c,liquidGlass:O,frostedGlass:A,gradientBlur:D,...u,children:s})}return B()?H({scene:a,dark:y,overlayColor:o,cls:b,style:e,children:s,rest:u}):J({scene:a,dark:y,targetId:i,overlayColor:o,cls:b,style:e,children:s,rest:u})};k.displayName="NutJDMaterialView";exports.JDMaterialView=k;exports.getCornerRadius=$;exports.getFrostedPreset=q;exports.getPreset=F;
@@ -1,4 +1,4 @@
1
- import { J as e } from "../jdmaterialview.taro-DHsrFcZg.mjs";
1
+ import { J as e } from "../jdmaterialview.taro-B3s_ZzgX.mjs";
2
2
  import { J as o } from "../jdmaterialsblurtarget.taro-DCTEjmIC.mjs";
3
3
  export {
4
4
  e as JDMaterialView,
@@ -1,5 +1,5 @@
1
- import { J as r } from "../jdmaterialview.taro-DHsrFcZg.mjs";
2
- import { g as s, a as o, b as g } from "../jdmaterialview.taro-DHsrFcZg.mjs";
1
+ import { J as r } from "../jdmaterialview.taro-B3s_ZzgX.mjs";
2
+ import { g as s, a as o, b as g } from "../jdmaterialview.taro-B3s_ZzgX.mjs";
3
3
  export {
4
4
  r as default,
5
5
  s as getCornerRadius,
@@ -1,14 +1,14 @@
1
- import { jsx as C } from "react/jsx-runtime";
2
- import { useMemo as w, useState as D, useCallback as N, useEffect as P } from "react";
3
- import $ from "classnames";
4
- import h, { getEnv as B } from "@tarojs/taro";
5
- import { View as F } from "@tarojs/components";
6
- import { JDIOSMaterialView as T } from "@jdtaro/ui";
7
- import { C as j } from "./typings-CdeuPEKG.mjs";
1
+ import { jsx as S } from "react/jsx-runtime";
2
+ import { useMemo as F, useState as D, useCallback as $, useEffect as N } from "react";
3
+ import P from "classnames";
4
+ import h, { getEnv as x } from "@tarojs/taro";
5
+ import { View as w } from "@tarojs/components";
6
+ import { JDIOSMaterialView as B } from "@jdtaro/ui";
7
+ import { C as T } from "./typings-CdeuPEKG.mjs";
8
8
  const k = 26;
9
- function x(t, r, e) {
9
+ function j(o, r, e) {
10
10
  const a = e >= k;
11
- switch (t) {
11
+ switch (o) {
12
12
  case "top-solid":
13
13
  return a ? {
14
14
  liquidGlass: {
@@ -61,9 +61,9 @@ function x(t, r, e) {
61
61
  return {};
62
62
  }
63
63
  }
64
- function or(t, r) {
64
+ function tr(o, r) {
65
65
  const e = r >= k;
66
- switch (t) {
66
+ switch (o) {
67
67
  case "top-bar":
68
68
  case "bottom-bar":
69
69
  return 0;
@@ -78,39 +78,42 @@ function or(t, r) {
78
78
  return 0;
79
79
  }
80
80
  }
81
- const y = "255, 255, 255", S = "31, 34, 38";
82
- function V(t, r) {
83
- switch (t) {
81
+ const y = "255, 255, 255", v = "31, 34, 38";
82
+ function V(o, r) {
83
+ switch (o) {
84
84
  case "top-solid":
85
85
  return {
86
86
  blurRadius: 40,
87
+ borderRadius: 12,
87
88
  tintColor: r ? "rgba(42, 47, 54, 1)" : "rgba(255, 255, 255, 1)"
88
89
  };
89
90
  case "top-plain":
90
- return { blurRadius: 40 };
91
+ return { blurRadius: 40, borderRadius: 12 };
91
92
  case "top-bar":
92
93
  return {
93
94
  blurRadius: 40,
94
- tintColor: r ? `rgba(${S}, 0.9)` : `rgba(${y}, 0.9)`
95
+ borderRadius: 12,
96
+ tintColor: r ? `rgba(${v}, 0.9)` : `rgba(${y}, 0.9)`
95
97
  };
96
98
  case "promotion-fair":
97
- return { blurRadius: 40, tintColor: `rgba(${y}, 0.85)` };
99
+ return { blurRadius: 40, borderRadius: 12, tintColor: `rgba(${y}, 0.85)` };
98
100
  case "promotion-deep":
99
- return { blurRadius: 40, tintColor: `rgba(${y}, 0.2)` };
101
+ return { blurRadius: 40, borderRadius: 12, tintColor: `rgba(${y}, 0.2)` };
100
102
  case "immersive":
101
- return { blurRadius: 40, tintColor: `rgba(${S}, 0.4)` };
103
+ return { blurRadius: 40, borderRadius: 12, tintColor: `rgba(${v}, 0.4)` };
102
104
  case "bottom-bar":
103
105
  return {
104
106
  blurRadius: 50,
105
- tintColor: r ? `rgba(${S}, 0.8)` : `rgba(${y}, 0.8)`
107
+ borderRadius: 0,
108
+ tintColor: r ? `rgba(${v}, 0.8)` : `rgba(${y}, 0.8)`
106
109
  };
107
110
  default:
108
- return { blurRadius: 40 };
111
+ return { blurRadius: 40, borderRadius: 12 };
109
112
  }
110
113
  }
111
- function _(t, r) {
114
+ function _(o, r) {
112
115
  const e = r ? "dark" : "light";
113
- switch (t) {
116
+ switch (o) {
114
117
  case "top-solid":
115
118
  return {
116
119
  blurScale: 1,
@@ -135,109 +138,109 @@ function _(t, r) {
135
138
  }
136
139
  }
137
140
  const E = {
138
- ...j
141
+ ...T
139
142
  };
140
143
  function H() {
141
144
  return ["harmony", "harmonyhybrid", "jdharmony"].includes(
142
- B().toLowerCase()
145
+ x().toLowerCase()
143
146
  );
144
147
  }
145
148
  function J() {
146
- var t;
149
+ var o;
147
150
  try {
148
- const r = h.getSystemInfoSync(), e = String((r == null ? void 0 : r.platform) || "").toLowerCase(), a = String((r == null ? void 0 : r.system) || ""), s = e === "ios", d = s ? parseInt(((t = a.match(/\d+/)) == null ? void 0 : t[0]) || "0", 10) : 0, m = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
149
- return { isIOS: s, iosMajor: d, dark: m };
151
+ const r = h.getSystemInfoSync(), e = String((r == null ? void 0 : r.platform) || "").toLowerCase(), a = String((r == null ? void 0 : r.system) || ""), s = e === "ios", i = s ? parseInt(((o = a.match(/\d+/)) == null ? void 0 : o[0]) || "0", 10) : 0, b = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
152
+ return { isIOS: s, iosMajor: i, dark: b };
150
153
  } catch {
151
154
  return { isIOS: !1, iosMajor: 0, dark: !1 };
152
155
  }
153
156
  }
154
157
  function Y() {
155
158
  try {
156
- const t = h.getSystemInfoSync();
157
- return String((t == null ? void 0 : t.theme) || "").toLowerCase() === "dark";
159
+ const o = h.getSystemInfoSync();
160
+ return String((o == null ? void 0 : o.theme) || "").toLowerCase() === "dark";
158
161
  } catch {
159
162
  return !1;
160
163
  }
161
164
  }
162
- function K(t) {
163
- const { scene: r, dark: e, overlayColor: a, cls: s, style: d, children: m, rest: b } = t, i = r ? _(r, e) : void 0, o = {};
164
- i ? (o.blurScale = i.blurScale, o.borderRadius = i.borderRadius, o.colorMode = i.colorMode) : o.colorMode = e ? "dark" : "light";
165
- const c = a ?? (i == null ? void 0 : i.overlayColor);
166
- return c && (o.overlayColor = c), /* @__PURE__ */ C(F, { className: s, style: d, ...o, ...b, children: m });
165
+ function K(o) {
166
+ const { scene: r, dark: e, overlayColor: a, cls: s, style: i, children: b, rest: m } = o, n = r ? _(r, e) : void 0, t = {};
167
+ n ? (t.blurScale = n.blurScale, t.borderRadius = n.borderRadius, t.colorMode = n.colorMode) : t.colorMode = e ? "dark" : "light", (i == null ? void 0 : i.borderRadius) !== void 0 && (t.borderRadius = parseFloat(String(i.borderRadius)));
168
+ const u = a ?? (n == null ? void 0 : n.overlayColor);
169
+ return u && (t.overlayColor = u), /* @__PURE__ */ S(w, { className: s, style: i, ...t, ...m, children: b });
167
170
  }
168
- function Q(t) {
169
- const { scene: r, dark: e, targetId: a, overlayColor: s, cls: d, style: m, children: b, rest: i } = t, o = r ? V(r, e) : void 0, c = { ...m };
170
- o && o.blurRadius > 0 && (c.backdropFilter = `blur(${o.blurRadius}px)`);
171
- const p = s ?? (o == null ? void 0 : o.tintColor), u = {};
172
- return a && (u.targetId = a), r && (u.scene = r), p && (u.overlayColor = p), /* @__PURE__ */ C(F, { className: d, style: c, ...u, ...i, children: b });
171
+ function Q(o) {
172
+ const { scene: r, dark: e, targetId: a, overlayColor: s, cls: i, style: b, children: m, rest: n } = o, t = r ? V(r, e) : void 0, u = { ...b };
173
+ t && t.blurRadius > 0 && (u.backdropFilter = `blur(${t.blurRadius}px)`), t && u.borderRadius === void 0 && (u.borderRadius = `${t.borderRadius}px`);
174
+ const p = s ?? (t == null ? void 0 : t.tintColor), d = {};
175
+ return a && (d.targetId = a), r && (d.scene = r), p && (d.overlayColor = p), /* @__PURE__ */ S(w, { className: i, style: u, ...d, ...n, children: m });
173
176
  }
174
- const U = (t) => {
177
+ const U = (o) => {
175
178
  const {
176
179
  className: r,
177
180
  style: e,
178
181
  children: a,
179
182
  scene: s,
180
- targetId: d,
181
- liquidGlass: m,
182
- frostedGlass: b,
183
- gradientBlur: i,
184
- overlayColor: o,
185
- ...c
186
- } = { ...E, ...t }, u = $("nut-jdmaterialview", r), { isIOS: I, iosMajor: R } = w(() => J(), []), [f, q] = D(() => Y()), v = N(
187
- (n) => {
188
- const g = typeof n == "string" ? n : String((n == null ? void 0 : n.theme) || "");
183
+ targetId: i,
184
+ liquidGlass: b,
185
+ frostedGlass: m,
186
+ gradientBlur: n,
187
+ overlayColor: t,
188
+ ...u
189
+ } = { ...E, ...o }, d = P("nut-jdmaterialview", r), { isIOS: I, iosMajor: C } = F(() => J(), []), [f, q] = D(() => Y()), R = $(
190
+ (c) => {
191
+ const g = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
189
192
  q(g.toLowerCase() === "dark");
190
193
  },
191
194
  []
192
195
  );
193
- P(() => {
194
- var n, g;
196
+ N(() => {
197
+ var c, g;
195
198
  try {
196
- (g = (n = h).onThemeChange) == null || g.call(n, v);
199
+ (g = (c = h).onThemeChange) == null || g.call(c, R);
197
200
  } catch {
198
201
  }
199
202
  return () => {
200
203
  var G, M;
201
204
  try {
202
- (M = (G = h).offThemeChange) == null || M.call(G, v);
205
+ (M = (G = h).offThemeChange) == null || M.call(G, R);
203
206
  } catch {
204
207
  }
205
208
  };
206
- }, [v]);
207
- const l = w(
208
- () => s ? x(s, f, R) : void 0,
209
- [s, f, R]
210
- ), L = m ?? (l == null ? void 0 : l.liquidGlass), O = b ?? (l == null ? void 0 : l.frostedGlass), A = i ?? (l == null ? void 0 : l.gradientBlur);
209
+ }, [R]);
210
+ const l = F(
211
+ () => s ? j(s, f, C) : void 0,
212
+ [s, f, C]
213
+ ), L = b ?? (l == null ? void 0 : l.liquidGlass), O = m ?? (l == null ? void 0 : l.frostedGlass), A = n ?? (l == null ? void 0 : l.gradientBlur);
211
214
  if (I) {
212
- const n = { ...l == null ? void 0 : l.fallbackStyle, ...e };
213
- return /* @__PURE__ */ C(
214
- T,
215
+ const c = { ...l == null ? void 0 : l.fallbackStyle, ...e };
216
+ return /* @__PURE__ */ S(
217
+ B,
215
218
  {
216
- className: u,
217
- style: n,
219
+ className: d,
220
+ style: c,
218
221
  liquidGlass: L,
219
222
  frostedGlass: O,
220
223
  gradientBlur: A,
221
- ...c,
224
+ ...u,
222
225
  children: a
223
226
  }
224
227
  );
225
228
  }
226
- return H() ? K({ scene: s, dark: f, overlayColor: o, cls: u, style: e, children: a, rest: c }) : Q({
229
+ return H() ? K({ scene: s, dark: f, overlayColor: t, cls: d, style: e, children: a, rest: u }) : Q({
227
230
  scene: s,
228
231
  dark: f,
229
- targetId: d,
230
- overlayColor: o,
231
- cls: u,
232
+ targetId: i,
233
+ overlayColor: t,
234
+ cls: d,
232
235
  style: e,
233
236
  children: a,
234
- rest: c
237
+ rest: u
235
238
  });
236
239
  };
237
240
  U.displayName = "NutJDMaterialView";
238
241
  export {
239
242
  U as J,
240
243
  V as a,
241
- x as b,
242
- or as g
244
+ j as b,
245
+ tr as g
243
246
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/taro-biz",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1-alpha.9",
4
4
  "main": "dist/cjs/index/index.js",
5
5
  "module": "dist/es/index/index.js",
6
6
  "sideEffects": [
@@ -1 +0,0 @@
1
- "use strict";const R=require("react/jsx-runtime"),y=require("react"),P=require("classnames"),u=require("@tarojs/taro"),M=require("@tarojs/components"),j=require("@jdtaro/ui"),x=require("./typings-DP_XKs5o.js"),w=26;function q(t,r,e){const s=e>=w;switch(t){case"top-solid":return s?{liquidGlass:{style:"regular",interactive:!0,tintColor:r?"rgba(0, 0, 0, 0.75)":"rgba(255, 255, 255, 0.45)",showTintOverlay:r}}:{fallbackStyle:{backgroundColor:r?"#2A2F36":"#FFFFFF"}};case"top-plain":return s?{liquidGlass:{style:"regular",interactive:!0,tintColor:r?"rgba(0, 0, 0, 0.75)":"rgba(255, 255, 255, 0.45)",showTintOverlay:r}}:{};case"top-bar":return{frostedGlass:{style:r?"thick-dark":"thick-light"}};case"promotion-fair":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"thick-light",alpha:.85}};case"promotion-deep":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"thick-light",alpha:.35}};case"immersive":return s?{liquidGlass:{style:"regular",forceDark:!0,interactive:!0,tintColor:"rgba(0, 0, 0, 0.75)"}}:{frostedGlass:{style:"regular-dark",alpha:.4}};case"bottom-bar":return{gradientBlur:{minBlur:.5,maxBlur:.8,overlayAlpha:.9,overlayColor:r?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"}};default:return{}}}function N(t,r){const e=r>=w;switch(t){case"top-bar":case"bottom-bar":return 0;case"top-plain":return e?12:0;case"top-solid":case"promotion-fair":case"promotion-deep":case"immersive":return e?12:8;default:return 0}}const p="255, 255, 255",C="31, 34, 38";function F(t,r){switch(t){case"top-solid":return{blurRadius:40,tintColor:r?"rgba(42, 47, 54, 1)":"rgba(255, 255, 255, 1)"};case"top-plain":return{blurRadius:40};case"top-bar":return{blurRadius:40,tintColor:r?`rgba(${C}, 0.9)`:`rgba(${p}, 0.9)`};case"promotion-fair":return{blurRadius:40,tintColor:`rgba(${p}, 0.85)`};case"promotion-deep":return{blurRadius:40,tintColor:`rgba(${p}, 0.2)`};case"immersive":return{blurRadius:40,tintColor:`rgba(${C}, 0.4)`};case"bottom-bar":return{blurRadius:50,tintColor:r?`rgba(${C}, 0.8)`:`rgba(${p}, 0.8)`};default:return{blurRadius:40}}}function V(t,r){const e=r?"dark":"light";switch(t){case"top-solid":return{blurScale:1,borderRadius:8,colorMode:e,overlayColor:r?"#2A2F36":"#FFFFFF"};case"top-plain":return{blurScale:0,borderRadius:8,colorMode:e};case"top-bar":return{blurScale:.9,borderRadius:0,colorMode:e};case"promotion-fair":return{blurScale:.85,borderRadius:8,colorMode:"light"};case"promotion-deep":return{blurScale:.2,borderRadius:8,colorMode:"light"};case"immersive":return{blurScale:.4,borderRadius:8,colorMode:"dark"};case"bottom-bar":return{blurScale:.2,borderRadius:0,colorMode:e};default:return{blurScale:0,borderRadius:0,colorMode:e}}}const $={...x.ComponentDefaults};function B(){return["harmony","harmonyhybrid","jdharmony"].includes(u.getEnv().toLowerCase())}function _(){var t;try{const r=u.getSystemInfoSync(),e=String((r==null?void 0:r.platform)||"").toLowerCase(),s=String((r==null?void 0:r.system)||""),a=e==="ios",b=a?parseInt(((t=s.match(/\d+/))==null?void 0:t[0])||"0",10):0,m=String((r==null?void 0:r.theme)||"").toLowerCase()==="dark";return{isIOS:a,iosMajor:b,dark:m}}catch{return{isIOS:!1,iosMajor:0,dark:!1}}}function E(){try{const t=u.getSystemInfoSync();return String((t==null?void 0:t.theme)||"").toLowerCase()==="dark"}catch{return!1}}function H(t){const{scene:r,dark:e,overlayColor:s,cls:a,style:b,children:m,rest:g}=t,i=r?V(r,e):void 0,o={};i?(o.blurScale=i.blurScale,o.borderRadius=i.borderRadius,o.colorMode=i.colorMode):o.colorMode=e?"dark":"light";const c=s??(i==null?void 0:i.overlayColor);return c&&(o.overlayColor=c),R.jsx(M.View,{className:a,style:b,...o,...g,children:m})}function J(t){const{scene:r,dark:e,targetId:s,overlayColor:a,cls:b,style:m,children:g,rest:i}=t,o=r?F(r,e):void 0,c={...m};o&&o.blurRadius>0&&(c.backdropFilter=`blur(${o.blurRadius}px)`);const v=a??(o==null?void 0:o.tintColor),d={};return s&&(d.targetId=s),r&&(d.scene=r),v&&(d.overlayColor=v),R.jsx(M.View,{className:b,style:c,...d,...i,children:g})}const k=t=>{const{className:r,style:e,children:s,scene:a,targetId:b,liquidGlass:m,frostedGlass:g,gradientBlur:i,overlayColor:o,...c}={...$,...t},d=P("nut-jdmaterialview",r),{isIOS:I,iosMajor:G}=y.useMemo(()=>_(),[]),[f,L]=y.useState(()=>E()),S=y.useCallback(n=>{const h=typeof n=="string"?n:String((n==null?void 0:n.theme)||"");L(h.toLowerCase()==="dark")},[]);y.useEffect(()=>{var n;try{(n=u.onThemeChange)==null||n.call(u,S)}catch{}return()=>{var h;try{(h=u.offThemeChange)==null||h.call(u,S)}catch{}}},[S]);const l=y.useMemo(()=>a?q(a,f,G):void 0,[a,f,G]),O=m??(l==null?void 0:l.liquidGlass),A=g??(l==null?void 0:l.frostedGlass),D=i??(l==null?void 0:l.gradientBlur);if(I){const n={...l==null?void 0:l.fallbackStyle,...e};return R.jsx(j.JDIOSMaterialView,{className:d,style:n,liquidGlass:O,frostedGlass:A,gradientBlur:D,...c,children:s})}return B()?H({scene:a,dark:f,overlayColor:o,cls:d,style:e,children:s,rest:c}):J({scene:a,dark:f,targetId:b,overlayColor:o,cls:d,style:e,children:s,rest:c})};k.displayName="NutJDMaterialView";exports.JDMaterialView=k;exports.getCornerRadius=N;exports.getFrostedPreset=F;exports.getPreset=q;