@nutui/taro-biz 0.0.1-alpha.20 → 0.0.1-alpha.21

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,4 +1,4 @@
1
- import { J as e } from "../jdmaterialview.taro-CfsBG1ft.mjs";
1
+ import { J as e } from "../jdmaterialview.taro-CGPzrol_.mjs";
2
2
  import { J as o } from "../jdmaterialsblurtarget.taro-CuU6ZagQ.mjs";
3
3
  export {
4
4
  e as JDMaterialView,
@@ -1,5 +1,5 @@
1
- import { J as r } from "../jdmaterialview.taro-CfsBG1ft.mjs";
2
- import { g as s, a as o, b as g } from "../jdmaterialview.taro-CfsBG1ft.mjs";
1
+ import { J as r } from "../jdmaterialview.taro-CGPzrol_.mjs";
2
+ import { g as s, a as o, b as g } from "../jdmaterialview.taro-CGPzrol_.mjs";
3
3
  export {
4
4
  r as default,
5
5
  s as getCornerRadius,
@@ -1,12 +1,12 @@
1
1
  import { jsx as k } from "react/jsx-runtime";
2
- import { useMemo as F, useState as N, useCallback as P, useEffect as j } from "react";
2
+ import { useMemo as $, useState as N, useCallback as P, useEffect as j } from "react";
3
3
  import V from "classnames";
4
4
  import h, { getEnv as T } from "@tarojs/taro";
5
- import { JDIOSMaterialView as _, View as I } from "@jdtaro/ui";
5
+ import { JDIOSMaterialView as _, View as x } from "@jdtaro/ui";
6
6
  import { C as E } from "./typings-CdeuPEKG.mjs";
7
- const $ = 26;
7
+ const F = 26;
8
8
  function H(e, r, o) {
9
- const t = o >= $;
9
+ const t = o >= F;
10
10
  switch (e) {
11
11
  case "top-solid":
12
12
  return t ? {
@@ -61,7 +61,7 @@ function H(e, r, o) {
61
61
  }
62
62
  }
63
63
  function J(e, r) {
64
- const o = r >= $;
64
+ const o = r >= F;
65
65
  switch (e) {
66
66
  case "top-bar":
67
67
  case "bottom-bar":
@@ -77,7 +77,7 @@ function J(e, r) {
77
77
  return 0;
78
78
  }
79
79
  }
80
- function x(e) {
80
+ function I(e) {
81
81
  switch (e) {
82
82
  case "top-bar":
83
83
  case "bottom-bar":
@@ -92,9 +92,9 @@ function x(e) {
92
92
  return 0;
93
93
  }
94
94
  }
95
- const p = "255, 255, 255", G = "31, 34, 38";
95
+ const p = "255, 255, 255", R = "31, 34, 38";
96
96
  function Y(e, r) {
97
- const o = x(e);
97
+ const o = I(e);
98
98
  switch (e) {
99
99
  case "top-solid":
100
100
  return {
@@ -108,19 +108,19 @@ function Y(e, r) {
108
108
  return {
109
109
  blurRadius: 40,
110
110
  borderRadius: o,
111
- tintColor: r ? `rgba(${G}, 0.9)` : `rgba(${p}, 0.9)`
111
+ tintColor: r ? `rgba(${R}, 0.9)` : `rgba(${p}, 0.9)`
112
112
  };
113
113
  case "promotion-fair":
114
114
  return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.85)` };
115
115
  case "promotion-deep":
116
116
  return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.2)` };
117
117
  case "immersive":
118
- return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${G}, 0.4)` };
118
+ return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${R}, 0.4)` };
119
119
  case "bottom-bar":
120
120
  return {
121
121
  blurRadius: 50,
122
122
  borderRadius: o,
123
- tintColor: r ? `rgba(${G}, 0.8)` : `rgba(${p}, 0.8)`
123
+ tintColor: r ? `rgba(${R}, 0.8)` : `rgba(${p}, 0.8)`
124
124
  };
125
125
  default:
126
126
  return { blurRadius: 40, borderRadius: o };
@@ -131,7 +131,7 @@ function K(e) {
131
131
  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%)`;
132
132
  }
133
133
  function Q(e, r) {
134
- const o = r ? "dark" : "light", t = x(e);
134
+ const o = r ? "dark" : "light", t = I(e);
135
135
  switch (e) {
136
136
  case "top-solid":
137
137
  return {
@@ -193,16 +193,18 @@ function X() {
193
193
  }
194
194
  }
195
195
  function Z(e) {
196
- const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: m } = e, a = r ? Q(r, o) : void 0, s = {};
197
- 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)));
198
- const l = { ...u }, d = t ?? (a == null ? void 0 : a.overlayColor);
199
- return d && l.backgroundColor === void 0 && (l.backgroundColor = d), 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__ */ k(I, { className: i, style: l, ...s, ...m, children: b });
196
+ const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: m } = e, a = r ? Q(r, o) : void 0, l = {};
197
+ a ? (l.blurScale = a.blurScale, l.colorMode = a.colorMode) : l.colorMode = o ? "dark" : "light";
198
+ const s = { ...u };
199
+ (u == null ? void 0 : u.borderRadius) === void 0 && a && (s.borderRadius = `${a.borderRadius}px`);
200
+ const d = t ?? (a == null ? void 0 : a.overlayColor);
201
+ return d && s.backgroundColor === void 0 && (s.backgroundColor = d), a != null && a.backgroundGradient && s.background === void 0 && (s.background = a.backgroundGradient), a != null && a.boxShadow && s.boxShadow === void 0 && (s.boxShadow = a.boxShadow), /* @__PURE__ */ k(x, { className: i, style: s, ...l, ...m, children: b });
200
202
  }
201
203
  function rr(e) {
202
- const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: m, rest: a } = e, s = r ? Y(r, o) : void 0, l = { ...b };
203
- s && s.blurRadius > 0 && (l.backdropFilter = `blur(${s.blurRadius}px)`), s && l.borderRadius === void 0 && (l.borderRadius = `${s.borderRadius}px`);
204
- const d = i ?? (s == null ? void 0 : s.tintColor), g = {};
205
- return t && (g.targetId = t), r && (g.scene = r), d && (g.overlayColor = d), /* @__PURE__ */ k(I, { className: u, style: l, ...g, ...a, children: m });
204
+ const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: m, rest: a } = e, l = r ? Y(r, o) : void 0, s = { ...b };
205
+ l && l.blurRadius > 0 && (s.backdropFilter = `blur(${l.blurRadius}px)`), l && s.borderRadius === void 0 && (s.borderRadius = `${l.borderRadius}px`);
206
+ const d = i ?? (l == null ? void 0 : l.tintColor), g = {};
207
+ return t && (g.targetId = t), r && (g.scene = r), d && (g.overlayColor = d), /* @__PURE__ */ k(x, { className: u, style: s, ...g, ...a, children: m });
206
208
  }
207
209
  const or = (e) => {
208
210
  const {
@@ -214,10 +216,10 @@ const or = (e) => {
214
216
  theme: b = "auto",
215
217
  liquidGlass: m,
216
218
  frostedGlass: a,
217
- gradientBlur: s,
218
- overlayColor: l,
219
+ gradientBlur: l,
220
+ overlayColor: s,
219
221
  ...d
220
- } = { ...U, ...e }, S = V("nut-jdmaterialview", r), { isIOS: q, iosMajor: v } = F(() => W(), []), C = b === "auto", [L, A] = N(() => X()), R = P(
222
+ } = { ...U, ...e }, S = V("nut-jdmaterialview", r), { isIOS: q, iosMajor: v } = $(() => W(), []), C = b === "auto", [L, A] = N(() => X()), G = P(
221
223
  (c) => {
222
224
  const y = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
223
225
  A(y.toLowerCase() === "dark");
@@ -228,22 +230,22 @@ const or = (e) => {
228
230
  var c, y;
229
231
  if (C) {
230
232
  try {
231
- (y = (c = h).onThemeChange) == null || y.call(c, R);
233
+ (y = (c = h).onThemeChange) == null || y.call(c, G);
232
234
  } catch {
233
235
  }
234
236
  return () => {
235
237
  var w, M;
236
238
  try {
237
- (M = (w = h).offThemeChange) == null || M.call(w, R);
239
+ (M = (w = h).offThemeChange) == null || M.call(w, G);
238
240
  } catch {
239
241
  }
240
242
  };
241
243
  }
242
- }, [C, R]);
243
- const f = C ? L : b === "dark", n = F(
244
+ }, [C, G]);
245
+ const f = C ? L : b === "dark", n = $(
244
246
  () => i ? H(i, f, v) : void 0,
245
247
  [i, f, v]
246
- ), O = m ?? (n == null ? void 0 : n.liquidGlass), B = a ?? (n == null ? void 0 : n.frostedGlass), D = s ?? (n == null ? void 0 : n.gradientBlur);
248
+ ), O = m ?? (n == null ? void 0 : n.liquidGlass), B = a ?? (n == null ? void 0 : n.frostedGlass), D = l ?? (n == null ? void 0 : n.gradientBlur);
247
249
  if (q) {
248
250
  const c = { ...n == null ? void 0 : n.fallbackStyle, ...o };
249
251
  return i && c.borderRadius === void 0 && (c.borderRadius = `${J(i, v)}px`), /* @__PURE__ */ k(
@@ -259,11 +261,11 @@ const or = (e) => {
259
261
  }
260
262
  );
261
263
  }
262
- return z() ? Z({ scene: i, dark: f, overlayColor: l, cls: S, style: o, children: t, rest: d }) : rr({
264
+ return z() ? Z({ scene: i, dark: f, overlayColor: s, cls: S, style: o, children: t, rest: d }) : rr({
263
265
  scene: i,
264
266
  dark: f,
265
267
  targetId: u,
266
- overlayColor: l,
268
+ overlayColor: s,
267
269
  cls: S,
268
270
  style: o,
269
271
  children: t,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/taro-biz",
3
- "version": "0.0.1-alpha.20",
3
+ "version": "0.0.1-alpha.21",
4
4
  "main": "dist/es/index/index.js",
5
5
  "module": "dist/es/index/index.js",
6
6
  "types": "dist/es/index/index.d.ts",