@nutui/taro-biz 0.0.1-alpha.14 → 0.0.1-alpha.15

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-CF5tEG5Z.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-CDNHFSRA.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-CF5tEG5Z.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-CDNHFSRA.js");exports.default=e.JDMaterialView;exports.getCornerRadius=e.getCornerRadius;exports.getFrostedPreset=e.getFrostedPreset;exports.getPreset=e.getPreset;
@@ -0,0 +1 @@
1
+ "use strict";const G=require("react/jsx-runtime"),y=require("react"),P=require("classnames"),d=require("@tarojs/taro"),w=require("@tarojs/components"),j=require("@jdtaro/ui"),B=require("./typings-DP_XKs5o.js"),M=26;function k(t,r,e){const o=e>=M;switch(t){case"top-solid":return o?{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 o?{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:1}};case"promotion-deep":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"ultra-thin-light",alpha:1}};case"immersive":return o?{liquidGlass:{style:"regular",forceDark:!0,interactive:!0,tintColor:"rgba(0, 0, 0, 0.75)"}}:{frostedGlass:{style:"regular-dark",alpha:1}};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 F(t,r){const e=r>=M;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}}function q(t){switch(t){case"top-bar":case"bottom-bar":return 0;case"top-solid":case"top-plain":case"promotion-fair":case"promotion-deep":case"immersive":return 8;default:return 0}}const v="255, 255, 255",R="31, 34, 38";function x(t,r){const e=q(t);switch(t){case"top-solid":return{blurRadius:40,borderRadius:e,tintColor:r?"rgba(42, 47, 54, 1)":"rgba(255, 255, 255, 1)"};case"top-plain":return{blurRadius:0,borderRadius:e};case"top-bar":return{blurRadius:40,borderRadius:e,tintColor:r?`rgba(${R}, 0.9)`:`rgba(${v}, 0.9)`};case"promotion-fair":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${v}, 0.85)`};case"promotion-deep":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${v}, 0.2)`};case"immersive":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${R}, 0.4)`};case"bottom-bar":return{blurRadius:50,borderRadius:e,tintColor:r?`rgba(${R}, 0.8)`:`rgba(${v}, 0.8)`};default:return{blurRadius:40,borderRadius:e}}}function N(t){const r=t?"0, 0, 0":"255, 255, 255";return`linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`}function V(t,r){const e=r?"dark":"light",o=q(t);switch(t){case"top-solid":return{blurScale:1,borderRadius:o,colorMode:e,overlayColor:r?"#2A2F36":"#FFFFFF"};case"top-plain":return{blurScale:0,borderRadius:o,colorMode:e};case"top-bar":return{blurScale:.9,borderRadius:o,colorMode:e,overlayColor:r?"rgba(0, 0, 0, 0.3)":"rgba(255, 255, 255, 0.8)"};case"promotion-fair":return{blurScale:.85,borderRadius:o,colorMode:"light"};case"promotion-deep":return{blurScale:.2,borderRadius:o,colorMode:"light"};case"immersive":return{blurScale:.4,borderRadius:o,colorMode:"dark"};case"bottom-bar":return{blurScale:.2,borderRadius:o,colorMode:e,backgroundGradient:N(r),boxShadow:"0 8px 40px rgba(0, 0, 0, 0.12)"};default:return{blurScale:0,borderRadius:o,colorMode:e}}}const _={...B.ComponentDefaults};function E(){return["harmony","harmonyhybrid","jdharmony"].includes(d.getEnv().toLowerCase())}function H(){var t;try{const r=d.getSystemInfoSync(),e=String((r==null?void 0:r.platform)||"").toLowerCase(),o=String((r==null?void 0:r.system)||""),i=e==="ios",u=i?parseInt(((t=o.match(/\d+/))==null?void 0:t[0])||"0",10):0,g=String((r==null?void 0:r.theme)||"").toLowerCase()==="dark";return{isIOS:i,iosMajor:u,dark:g}}catch{return{isIOS:!1,iosMajor:0,dark:!1}}}function J(){try{const t=d.getSystemInfoSync();return String((t==null?void 0:t.theme)||"").toLowerCase()==="dark"}catch{return!1}}function T(t){const{scene:r,dark:e,overlayColor:o,cls:i,style:u,children:g,rest:f}=t,a=r?V(r,e):void 0,s={};a?(s.blurScale=a.blurScale,s.borderRadius=a.borderRadius,s.colorMode=a.colorMode):s.colorMode=e?"dark":"light",(u==null?void 0:u.borderRadius)!==void 0&&(s.borderRadius=parseFloat(String(u.borderRadius)));const l={...u},m=o??(a==null?void 0:a.overlayColor);return m&&l.backgroundColor===void 0&&(l.backgroundColor=m),a!=null&&a.backgroundGradient&&l.background===void 0&&(l.background=a.backgroundGradient),a!=null&&a.boxShadow&&l.boxShadow===void 0&&(l.boxShadow=a.boxShadow),G.jsx(w.View,{className:i,style:l,...s,...f,children:g})}function Y(t){const{scene:r,dark:e,targetId:o,overlayColor:i,cls:u,style:g,children:f,rest:a}=t,s=r?x(r,e):void 0,l={...g};s&&s.blurRadius>0&&(l.backdropFilter=`blur(${s.blurRadius}px)`),s&&l.borderRadius===void 0&&(l.borderRadius=`${s.borderRadius}px`);const m=i??(s==null?void 0:s.tintColor),b={};return o&&(b.targetId=o),r&&(b.scene=r),m&&(b.overlayColor=m),G.jsx(w.View,{className:u,style:l,...b,...a,children:f})}const I=t=>{const{className:r,style:e,children:o,scene:i,targetId:u,liquidGlass:g,frostedGlass:f,gradientBlur:a,overlayColor:s,...l}={..._,...t},b=P("nut-jdmaterialview",r),{isIOS:$,iosMajor:S}=y.useMemo(()=>H(),[]),[h,O]=y.useState(()=>J()),C=y.useCallback(c=>{const p=typeof c=="string"?c:String((c==null?void 0:c.theme)||"");O(p.toLowerCase()==="dark")},[]);y.useEffect(()=>{var c;try{(c=d.onThemeChange)==null||c.call(d,C)}catch{}return()=>{var p;try{(p=d.offThemeChange)==null||p.call(d,C)}catch{}}},[C]);const n=y.useMemo(()=>i?k(i,h,S):void 0,[i,h,S]),L=g??(n==null?void 0:n.liquidGlass),A=f??(n==null?void 0:n.frostedGlass),D=a??(n==null?void 0:n.gradientBlur);if($){const c={...n==null?void 0:n.fallbackStyle,...e};return i&&c.borderRadius===void 0&&(c.borderRadius=`${F(i,S)}px`),G.jsx(j.JDIOSMaterialView,{className:b,style:c,liquidGlass:L,frostedGlass:A,gradientBlur:D,...l,children:o})}return E()?T({scene:i,dark:h,overlayColor:s,cls:b,style:e,children:o,rest:l}):Y({scene:i,dark:h,targetId:u,overlayColor:s,cls:b,style:e,children:o,rest:l})};I.displayName="NutJDMaterialView";exports.JDMaterialView=I;exports.getCornerRadius=F;exports.getFrostedPreset=x;exports.getPreset=k;
@@ -1,4 +1,4 @@
1
- import { J as e } from "../jdmaterialview.taro-Be0_ro5-.mjs";
1
+ import { J as e } from "../jdmaterialview.taro-BjknHTmz.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-Be0_ro5-.mjs";
2
- import { g as s, a as o, b as g } from "../jdmaterialview.taro-Be0_ro5-.mjs";
1
+ import { J as r } from "../jdmaterialview.taro-BjknHTmz.mjs";
2
+ import { g as s, a as o, b as g } from "../jdmaterialview.taro-BjknHTmz.mjs";
3
3
  export {
4
4
  r as default,
5
5
  s as getCornerRadius,
@@ -1,14 +1,14 @@
1
1
  import { jsx as R } from "react/jsx-runtime";
2
- import { useMemo as M, useState as B, useCallback as D, useEffect as N } from "react";
3
- import x from "classnames";
2
+ import { useMemo as k, useState as A, useCallback as B, useEffect as D } from "react";
3
+ import N from "classnames";
4
4
  import h, { getEnv as P } from "@tarojs/taro";
5
- import { View as w } from "@tarojs/components";
5
+ import { View as M } from "@tarojs/components";
6
6
  import { JDIOSMaterialView as T } from "@jdtaro/ui";
7
7
  import { C as j } from "./typings-CdeuPEKG.mjs";
8
8
  const F = 26;
9
- function V(o, r, e) {
10
- const t = e >= F;
11
- switch (o) {
9
+ function V(e, r, o) {
10
+ const t = o >= F;
11
+ switch (e) {
12
12
  case "top-solid":
13
13
  return t ? {
14
14
  liquidGlass: {
@@ -61,25 +61,25 @@ function V(o, r, e) {
61
61
  return {};
62
62
  }
63
63
  }
64
- function _(o, r) {
65
- const e = r >= F;
66
- switch (o) {
64
+ function _(e, r) {
65
+ const o = r >= F;
66
+ switch (e) {
67
67
  case "top-bar":
68
68
  case "bottom-bar":
69
69
  return 0;
70
70
  case "top-plain":
71
- return e ? 12 : 0;
71
+ return o ? 12 : 0;
72
72
  case "top-solid":
73
73
  case "promotion-fair":
74
74
  case "promotion-deep":
75
75
  case "immersive":
76
- return e ? 12 : 8;
76
+ return o ? 12 : 8;
77
77
  default:
78
78
  return 0;
79
79
  }
80
80
  }
81
- function I(o) {
82
- switch (o) {
81
+ function I(e) {
82
+ switch (e) {
83
83
  case "top-bar":
84
84
  case "bottom-bar":
85
85
  return 0;
@@ -94,61 +94,61 @@ function I(o) {
94
94
  }
95
95
  }
96
96
  const p = "255, 255, 255", C = "31, 34, 38";
97
- function E(o, r) {
98
- const e = I(o);
99
- switch (o) {
97
+ function E(e, r) {
98
+ const o = I(e);
99
+ switch (e) {
100
100
  case "top-solid":
101
101
  return {
102
102
  blurRadius: 40,
103
- borderRadius: e,
103
+ borderRadius: o,
104
104
  tintColor: r ? "rgba(42, 47, 54, 1)" : "rgba(255, 255, 255, 1)"
105
105
  };
106
106
  case "top-plain":
107
- return { blurRadius: 0, borderRadius: e };
107
+ return { blurRadius: 0, borderRadius: o };
108
108
  case "top-bar":
109
109
  return {
110
110
  blurRadius: 40,
111
- borderRadius: e,
111
+ borderRadius: o,
112
112
  tintColor: r ? `rgba(${C}, 0.9)` : `rgba(${p}, 0.9)`
113
113
  };
114
114
  case "promotion-fair":
115
- return { blurRadius: 40, borderRadius: e, tintColor: `rgba(${p}, 0.85)` };
115
+ return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.85)` };
116
116
  case "promotion-deep":
117
- return { blurRadius: 40, borderRadius: e, tintColor: `rgba(${p}, 0.2)` };
117
+ return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.2)` };
118
118
  case "immersive":
119
- return { blurRadius: 40, borderRadius: e, tintColor: `rgba(${C}, 0.4)` };
119
+ return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${C}, 0.4)` };
120
120
  case "bottom-bar":
121
121
  return {
122
122
  blurRadius: 50,
123
- borderRadius: e,
123
+ borderRadius: o,
124
124
  tintColor: r ? `rgba(${C}, 0.8)` : `rgba(${p}, 0.8)`
125
125
  };
126
126
  default:
127
- return { blurRadius: 40, borderRadius: e };
127
+ return { blurRadius: 40, borderRadius: o };
128
128
  }
129
129
  }
130
- function H(o) {
131
- const r = o ? "0, 0, 0" : "255, 255, 255";
130
+ function H(e) {
131
+ const r = e ? "0, 0, 0" : "255, 255, 255";
132
132
  return `linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`;
133
133
  }
134
- function J(o, r) {
135
- const e = r ? "dark" : "light", t = I(o);
136
- switch (o) {
134
+ function J(e, r) {
135
+ const o = r ? "dark" : "light", t = I(e);
136
+ switch (e) {
137
137
  case "top-solid":
138
138
  return {
139
139
  blurScale: 1,
140
140
  borderRadius: t,
141
- colorMode: e,
141
+ colorMode: o,
142
142
  overlayColor: r ? "#2A2F36" : "#FFFFFF"
143
143
  };
144
144
  case "top-plain":
145
- return { blurScale: 0, borderRadius: t, colorMode: e };
145
+ return { blurScale: 0, borderRadius: t, colorMode: o };
146
146
  case "top-bar":
147
147
  return {
148
148
  blurScale: 0.9,
149
149
  borderRadius: t,
150
- colorMode: e,
151
- overlayColor: r ? "rgba(0, 0, 0, 0.8)" : "rgba(255, 255, 255, 0.8)"
150
+ colorMode: o,
151
+ overlayColor: r ? "rgba(0, 0, 0, 0.3)" : "rgba(255, 255, 255, 0.8)"
152
152
  };
153
153
  case "promotion-fair":
154
154
  return { blurScale: 0.85, borderRadius: t, colorMode: "light" };
@@ -160,11 +160,12 @@ function J(o, r) {
160
160
  return {
161
161
  blurScale: 0.2,
162
162
  borderRadius: t,
163
- colorMode: e,
164
- backgroundGradient: H(r)
163
+ colorMode: o,
164
+ backgroundGradient: H(r),
165
+ boxShadow: "0 8px 40px rgba(0, 0, 0, 0.12)"
165
166
  };
166
167
  default:
167
- return { blurScale: 0, borderRadius: t, colorMode: e };
168
+ return { blurScale: 0, borderRadius: t, colorMode: o };
168
169
  }
169
170
  }
170
171
  const Y = {
@@ -176,95 +177,95 @@ function K() {
176
177
  );
177
178
  }
178
179
  function Q() {
179
- var o;
180
+ var e;
180
181
  try {
181
- const r = h.getSystemInfoSync(), e = String((r == null ? void 0 : r.platform) || "").toLowerCase(), t = String((r == null ? void 0 : r.system) || ""), l = e === "ios", u = l ? parseInt(((o = t.match(/\d+/)) == null ? void 0 : o[0]) || "0", 10) : 0, b = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
182
- return { isIOS: l, iosMajor: u, dark: b };
182
+ const r = h.getSystemInfoSync(), o = String((r == null ? void 0 : r.platform) || "").toLowerCase(), t = String((r == null ? void 0 : r.system) || ""), i = o === "ios", u = i ? parseInt(((e = t.match(/\d+/)) == null ? void 0 : e[0]) || "0", 10) : 0, b = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
183
+ return { isIOS: i, iosMajor: u, dark: b };
183
184
  } catch {
184
185
  return { isIOS: !1, iosMajor: 0, dark: !1 };
185
186
  }
186
187
  }
187
188
  function U() {
188
189
  try {
189
- const o = h.getSystemInfoSync();
190
- return String((o == null ? void 0 : o.theme) || "").toLowerCase() === "dark";
190
+ const e = h.getSystemInfoSync();
191
+ return String((e == null ? void 0 : e.theme) || "").toLowerCase() === "dark";
191
192
  } catch {
192
193
  return !1;
193
194
  }
194
195
  }
195
- function z(o) {
196
- const { scene: r, dark: e, overlayColor: t, cls: l, style: u, children: b, rest: g } = o, s = r ? J(r, e) : void 0, a = {};
197
- s ? (a.blurScale = s.blurScale, a.borderRadius = s.borderRadius, a.colorMode = s.colorMode) : a.colorMode = e ? "dark" : "light", (u == null ? void 0 : u.borderRadius) !== void 0 && (a.borderRadius = parseFloat(String(u.borderRadius)));
198
- const i = { ...u }, m = t ?? (s == null ? void 0 : s.overlayColor);
199
- return m && i.backgroundColor === void 0 && (i.backgroundColor = m), s != null && s.backgroundGradient && i.background === void 0 && (i.background = s.backgroundGradient), /* @__PURE__ */ R(w, { className: l, style: i, ...a, ...g, children: b });
196
+ function z(e) {
197
+ const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: g } = e, a = r ? J(r, o) : void 0, s = {};
198
+ a ? (s.blurScale = a.blurScale, s.borderRadius = a.borderRadius, s.colorMode = a.colorMode) : s.colorMode = o ? "dark" : "light", (u == null ? void 0 : u.borderRadius) !== void 0 && (s.borderRadius = parseFloat(String(u.borderRadius)));
199
+ const l = { ...u }, m = t ?? (a == null ? void 0 : a.overlayColor);
200
+ return m && l.backgroundColor === void 0 && (l.backgroundColor = m), a != null && a.backgroundGradient && l.background === void 0 && (l.background = a.backgroundGradient), a != null && a.boxShadow && l.boxShadow === void 0 && (l.boxShadow = a.boxShadow), /* @__PURE__ */ R(M, { className: i, style: l, ...s, ...g, children: b });
200
201
  }
201
- function W(o) {
202
- const { scene: r, dark: e, targetId: t, overlayColor: l, cls: u, style: b, children: g, rest: s } = o, a = r ? E(r, e) : void 0, i = { ...b };
203
- a && a.blurRadius > 0 && (i.backdropFilter = `blur(${a.blurRadius}px)`), a && i.borderRadius === void 0 && (i.borderRadius = `${a.borderRadius}px`);
204
- const m = l ?? (a == null ? void 0 : a.tintColor), d = {};
205
- return t && (d.targetId = t), r && (d.scene = r), m && (d.overlayColor = m), /* @__PURE__ */ R(w, { className: u, style: i, ...d, ...s, children: g });
202
+ function W(e) {
203
+ const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: g, rest: a } = e, s = r ? E(r, o) : void 0, l = { ...b };
204
+ s && s.blurRadius > 0 && (l.backdropFilter = `blur(${s.blurRadius}px)`), s && l.borderRadius === void 0 && (l.borderRadius = `${s.borderRadius}px`);
205
+ const m = i ?? (s == null ? void 0 : s.tintColor), d = {};
206
+ return t && (d.targetId = t), r && (d.scene = r), m && (d.overlayColor = m), /* @__PURE__ */ R(M, { className: u, style: l, ...d, ...a, children: g });
206
207
  }
207
- const X = (o) => {
208
+ const X = (e) => {
208
209
  const {
209
210
  className: r,
210
- style: e,
211
+ style: o,
211
212
  children: t,
212
- scene: l,
213
+ scene: i,
213
214
  targetId: u,
214
215
  liquidGlass: b,
215
216
  frostedGlass: g,
216
- gradientBlur: s,
217
- overlayColor: a,
218
- ...i
219
- } = { ...Y, ...o }, d = x("nut-jdmaterialview", r), { isIOS: $, iosMajor: v } = M(() => Q(), []), [f, O] = B(() => U()), S = D(
217
+ gradientBlur: a,
218
+ overlayColor: s,
219
+ ...l
220
+ } = { ...Y, ...e }, d = N("nut-jdmaterialview", r), { isIOS: $, iosMajor: v } = k(() => Q(), []), [f, x] = A(() => U()), S = B(
220
221
  (c) => {
221
222
  const y = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
222
- O(y.toLowerCase() === "dark");
223
+ x(y.toLowerCase() === "dark");
223
224
  },
224
225
  []
225
226
  );
226
- N(() => {
227
+ D(() => {
227
228
  var c, y;
228
229
  try {
229
230
  (y = (c = h).onThemeChange) == null || y.call(c, S);
230
231
  } catch {
231
232
  }
232
233
  return () => {
233
- var G, k;
234
+ var G, w;
234
235
  try {
235
- (k = (G = h).offThemeChange) == null || k.call(G, S);
236
+ (w = (G = h).offThemeChange) == null || w.call(G, S);
236
237
  } catch {
237
238
  }
238
239
  };
239
240
  }, [S]);
240
- const n = M(
241
- () => l ? V(l, f, v) : void 0,
242
- [l, f, v]
243
- ), q = b ?? (n == null ? void 0 : n.liquidGlass), L = g ?? (n == null ? void 0 : n.frostedGlass), A = s ?? (n == null ? void 0 : n.gradientBlur);
241
+ const n = k(
242
+ () => i ? V(i, f, v) : void 0,
243
+ [i, f, v]
244
+ ), O = b ?? (n == null ? void 0 : n.liquidGlass), q = g ?? (n == null ? void 0 : n.frostedGlass), L = a ?? (n == null ? void 0 : n.gradientBlur);
244
245
  if ($) {
245
- const c = { ...n == null ? void 0 : n.fallbackStyle, ...e };
246
- return l && c.borderRadius === void 0 && (c.borderRadius = `${_(l, v)}px`), /* @__PURE__ */ R(
246
+ const c = { ...n == null ? void 0 : n.fallbackStyle, ...o };
247
+ return i && c.borderRadius === void 0 && (c.borderRadius = `${_(i, v)}px`), /* @__PURE__ */ R(
247
248
  T,
248
249
  {
249
250
  className: d,
250
251
  style: c,
251
- liquidGlass: q,
252
- frostedGlass: L,
253
- gradientBlur: A,
254
- ...i,
252
+ liquidGlass: O,
253
+ frostedGlass: q,
254
+ gradientBlur: L,
255
+ ...l,
255
256
  children: t
256
257
  }
257
258
  );
258
259
  }
259
- return K() ? z({ scene: l, dark: f, overlayColor: a, cls: d, style: e, children: t, rest: i }) : W({
260
- scene: l,
260
+ return K() ? z({ scene: i, dark: f, overlayColor: s, cls: d, style: o, children: t, rest: l }) : W({
261
+ scene: i,
261
262
  dark: f,
262
263
  targetId: u,
263
- overlayColor: a,
264
+ overlayColor: s,
264
265
  cls: d,
265
- style: e,
266
+ style: o,
266
267
  children: t,
267
- rest: i
268
+ rest: l
268
269
  });
269
270
  };
270
271
  X.displayName = "NutJDMaterialView";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/taro-biz",
3
- "version": "0.0.1-alpha.14",
3
+ "version": "0.0.1-alpha.15",
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 G=require("react/jsx-runtime"),y=require("react"),P=require("classnames"),d=require("@tarojs/taro"),M=require("@tarojs/components"),j=require("@jdtaro/ui"),B=require("./typings-DP_XKs5o.js"),k=26;function w(t,r,e){const o=e>=k;switch(t){case"top-solid":return o?{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 o?{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:1}};case"promotion-deep":return{liquidGlass:{style:"clear",interactive:!1},frostedGlass:{style:"ultra-thin-light",alpha:1}};case"immersive":return o?{liquidGlass:{style:"regular",forceDark:!0,interactive:!0,tintColor:"rgba(0, 0, 0, 0.75)"}}:{frostedGlass:{style:"regular-dark",alpha:1}};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 F(t,r){const e=r>=k;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}}function q(t){switch(t){case"top-bar":case"bottom-bar":return 0;case"top-solid":case"top-plain":case"promotion-fair":case"promotion-deep":case"immersive":return 8;default:return 0}}const v="255, 255, 255",R="31, 34, 38";function I(t,r){const e=q(t);switch(t){case"top-solid":return{blurRadius:40,borderRadius:e,tintColor:r?"rgba(42, 47, 54, 1)":"rgba(255, 255, 255, 1)"};case"top-plain":return{blurRadius:0,borderRadius:e};case"top-bar":return{blurRadius:40,borderRadius:e,tintColor:r?`rgba(${R}, 0.9)`:`rgba(${v}, 0.9)`};case"promotion-fair":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${v}, 0.85)`};case"promotion-deep":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${v}, 0.2)`};case"immersive":return{blurRadius:40,borderRadius:e,tintColor:`rgba(${R}, 0.4)`};case"bottom-bar":return{blurRadius:50,borderRadius:e,tintColor:r?`rgba(${R}, 0.8)`:`rgba(${v}, 0.8)`};default:return{blurRadius:40,borderRadius:e}}}function N(t){const r=t?"0, 0, 0":"255, 255, 255";return`linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`}function V(t,r){const e=r?"dark":"light",o=q(t);switch(t){case"top-solid":return{blurScale:1,borderRadius:o,colorMode:e,overlayColor:r?"#2A2F36":"#FFFFFF"};case"top-plain":return{blurScale:0,borderRadius:o,colorMode:e};case"top-bar":return{blurScale:.9,borderRadius:o,colorMode:e,overlayColor:r?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.8)"};case"promotion-fair":return{blurScale:.85,borderRadius:o,colorMode:"light"};case"promotion-deep":return{blurScale:.2,borderRadius:o,colorMode:"light"};case"immersive":return{blurScale:.4,borderRadius:o,colorMode:"dark"};case"bottom-bar":return{blurScale:.2,borderRadius:o,colorMode:e,backgroundGradient:N(r)};default:return{blurScale:0,borderRadius:o,colorMode:e}}}const _={...B.ComponentDefaults};function E(){return["harmony","harmonyhybrid","jdharmony"].includes(d.getEnv().toLowerCase())}function H(){var t;try{const r=d.getSystemInfoSync(),e=String((r==null?void 0:r.platform)||"").toLowerCase(),o=String((r==null?void 0:r.system)||""),l=e==="ios",u=l?parseInt(((t=o.match(/\d+/))==null?void 0:t[0])||"0",10):0,g=String((r==null?void 0:r.theme)||"").toLowerCase()==="dark";return{isIOS:l,iosMajor:u,dark:g}}catch{return{isIOS:!1,iosMajor:0,dark:!1}}}function J(){try{const t=d.getSystemInfoSync();return String((t==null?void 0:t.theme)||"").toLowerCase()==="dark"}catch{return!1}}function T(t){const{scene:r,dark:e,overlayColor:o,cls:l,style:u,children:g,rest:f}=t,s=r?V(r,e):void 0,a={};s?(a.blurScale=s.blurScale,a.borderRadius=s.borderRadius,a.colorMode=s.colorMode):a.colorMode=e?"dark":"light",(u==null?void 0:u.borderRadius)!==void 0&&(a.borderRadius=parseFloat(String(u.borderRadius)));const i={...u},m=o??(s==null?void 0:s.overlayColor);return m&&i.backgroundColor===void 0&&(i.backgroundColor=m),s!=null&&s.backgroundGradient&&i.background===void 0&&(i.background=s.backgroundGradient),G.jsx(M.View,{className:l,style:i,...a,...f,children:g})}function Y(t){const{scene:r,dark:e,targetId:o,overlayColor:l,cls:u,style:g,children:f,rest:s}=t,a=r?I(r,e):void 0,i={...g};a&&a.blurRadius>0&&(i.backdropFilter=`blur(${a.blurRadius}px)`),a&&i.borderRadius===void 0&&(i.borderRadius=`${a.borderRadius}px`);const m=l??(a==null?void 0:a.tintColor),b={};return o&&(b.targetId=o),r&&(b.scene=r),m&&(b.overlayColor=m),G.jsx(M.View,{className:u,style:i,...b,...s,children:f})}const $=t=>{const{className:r,style:e,children:o,scene:l,targetId:u,liquidGlass:g,frostedGlass:f,gradientBlur:s,overlayColor:a,...i}={..._,...t},b=P("nut-jdmaterialview",r),{isIOS:O,iosMajor:S}=y.useMemo(()=>H(),[]),[h,L]=y.useState(()=>J()),C=y.useCallback(c=>{const p=typeof c=="string"?c:String((c==null?void 0:c.theme)||"");L(p.toLowerCase()==="dark")},[]);y.useEffect(()=>{var c;try{(c=d.onThemeChange)==null||c.call(d,C)}catch{}return()=>{var p;try{(p=d.offThemeChange)==null||p.call(d,C)}catch{}}},[C]);const n=y.useMemo(()=>l?w(l,h,S):void 0,[l,h,S]),x=g??(n==null?void 0:n.liquidGlass),A=f??(n==null?void 0:n.frostedGlass),D=s??(n==null?void 0:n.gradientBlur);if(O){const c={...n==null?void 0:n.fallbackStyle,...e};return l&&c.borderRadius===void 0&&(c.borderRadius=`${F(l,S)}px`),G.jsx(j.JDIOSMaterialView,{className:b,style:c,liquidGlass:x,frostedGlass:A,gradientBlur:D,...i,children:o})}return E()?T({scene:l,dark:h,overlayColor:a,cls:b,style:e,children:o,rest:i}):Y({scene:l,dark:h,targetId:u,overlayColor:a,cls:b,style:e,children:o,rest:i})};$.displayName="NutJDMaterialView";exports.JDMaterialView=$;exports.getCornerRadius=F;exports.getFrostedPreset=I;exports.getPreset=w;