wz-h5-design 1.0.7 → 1.0.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.
Files changed (92) hide show
  1. package/dist/Button/style/index.css +1 -1
  2. package/dist/Button/style.css +1 -1
  3. package/dist/Cell/iconfont-qKgLSSmj.js +35 -0
  4. package/dist/Cell/index.js +1 -1
  5. package/dist/Cell/index.umd.cjs +1 -1
  6. package/dist/Cell/style/index.css +1 -1
  7. package/dist/Cell/style.css +1 -1
  8. package/dist/CheckList/iconfont-qKgLSSmj.js +35 -0
  9. package/dist/CheckList/index.js +1 -1
  10. package/dist/CheckList/index.umd.cjs +1 -1
  11. package/dist/Checkbox/iconfont-qKgLSSmj.js +35 -0
  12. package/dist/Checkbox/index.js +1 -1
  13. package/dist/Checkbox/index.umd.cjs +1 -1
  14. package/dist/DatePicker/index.js +42 -6
  15. package/dist/DatePicker/index.umd.cjs +1 -1
  16. package/dist/DateRangePicker/iconfont-qKgLSSmj.js +35 -0
  17. package/dist/DateRangePicker/index.js +43 -7
  18. package/dist/DateRangePicker/index.umd.cjs +1 -1
  19. package/dist/Dialog/style.css +1 -1
  20. package/dist/DropDownMenu/iconfont-qKgLSSmj.js +35 -0
  21. package/dist/DropDownMenu/index.js +1 -1
  22. package/dist/DropDownMenu/index.umd.cjs +1 -1
  23. package/dist/Icon/iconfont-qKgLSSmj.js +35 -0
  24. package/dist/Icon/index.js +1 -1
  25. package/dist/Icon/index.umd.cjs +1 -1
  26. package/dist/Input/iconfont-qKgLSSmj.js +35 -0
  27. package/dist/Input/index.js +17 -8
  28. package/dist/Input/index.umd.cjs +1 -1
  29. package/dist/Input/style/index.css +1 -1
  30. package/dist/Input/style.css +1 -1
  31. package/dist/NavBar/iconfont-qKgLSSmj.js +35 -0
  32. package/dist/NavBar/index.js +1 -1
  33. package/dist/NavBar/index.umd.cjs +1 -1
  34. package/dist/Radio/iconfont-qKgLSSmj.js +35 -0
  35. package/dist/Radio/index.js +1 -1
  36. package/dist/Radio/index.umd.cjs +1 -1
  37. package/dist/Search/iconfont-qKgLSSmj.js +35 -0
  38. package/dist/Search/index.js +1 -1
  39. package/dist/Search/index.umd.cjs +1 -1
  40. package/dist/Stepper/iconfont-qKgLSSmj.js +35 -0
  41. package/dist/Stepper/index.js +1 -1
  42. package/dist/Stepper/index.umd.cjs +1 -1
  43. package/dist/Stepper/style/index.css +1 -1
  44. package/dist/Stepper/style.css +1 -1
  45. package/dist/Tabbar/iconfont-qKgLSSmj.js +35 -0
  46. package/dist/Tabbar/index.js +1 -1
  47. package/dist/Tabbar/index.umd.cjs +1 -1
  48. package/dist/Tag/index.js +16 -3
  49. package/dist/Tag/index.umd.cjs +2 -2
  50. package/dist/Tag/style/index.css +1 -1
  51. package/dist/Tag/style.css +1 -1
  52. package/dist/TimePicker/index.js +24 -12
  53. package/dist/TimePicker/index.umd.cjs +1 -1
  54. package/dist/Tip/iconfont-qKgLSSmj.js +35 -0
  55. package/dist/Tip/index.js +8 -16
  56. package/dist/Tip/index.umd.cjs +1 -1
  57. package/dist/Tip/style/index.css +1 -1
  58. package/dist/Tip/style.css +1 -1
  59. package/dist/Toast/iconfont-qKgLSSmj.js +35 -0
  60. package/dist/Toast/index.js +3 -6
  61. package/dist/Toast/index.umd.cjs +1 -1
  62. package/dist/Tooltip/iconfont-qKgLSSmj.js +35 -0
  63. package/dist/Tooltip/index.js +1 -1
  64. package/dist/Tooltip/index.umd.cjs +1 -1
  65. package/dist/assets/fonts/yunying/iconfont.css +19 -15
  66. package/dist/assets/fonts/yunying/iconfont.ttf +0 -0
  67. package/dist/assets/fonts/yunying/iconfont.woff +0 -0
  68. package/dist/assets/fonts/yunying/iconfont.woff2 +0 -0
  69. package/dist/iconfont-qKgLSSmj.js +35 -0
  70. package/dist/style.css +1 -1
  71. package/dist/types/components/Input/Input.d.ts +6 -0
  72. package/dist/types/components/Tag/Tag.d.ts +8 -0
  73. package/dist/types/components/Tip/Tip.d.ts +7 -2
  74. package/dist/wz-h5-design.es.js +106 -47
  75. package/dist/wz-h5-design.umd.js +2 -2
  76. package/package.json +1 -1
  77. package/dist/Cell/iconfont-B9h4iRmM.js +0 -35
  78. package/dist/CheckList/iconfont-B9h4iRmM.js +0 -35
  79. package/dist/Checkbox/iconfont-B9h4iRmM.js +0 -35
  80. package/dist/DateRangePicker/iconfont-B9h4iRmM.js +0 -35
  81. package/dist/DropDownMenu/iconfont-B9h4iRmM.js +0 -35
  82. package/dist/Icon/iconfont-B9h4iRmM.js +0 -35
  83. package/dist/Input/iconfont-B9h4iRmM.js +0 -35
  84. package/dist/NavBar/iconfont-B9h4iRmM.js +0 -35
  85. package/dist/Radio/iconfont-B9h4iRmM.js +0 -35
  86. package/dist/Search/iconfont-B9h4iRmM.js +0 -35
  87. package/dist/Stepper/iconfont-B9h4iRmM.js +0 -35
  88. package/dist/Tabbar/iconfont-B9h4iRmM.js +0 -35
  89. package/dist/Tip/iconfont-B9h4iRmM.js +0 -35
  90. package/dist/Toast/iconfont-B9h4iRmM.js +0 -35
  91. package/dist/Tooltip/iconfont-B9h4iRmM.js +0 -35
  92. package/dist/iconfont-B9h4iRmM.js +0 -35
@@ -12,6 +12,12 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
12
12
  borderRadius?: string;
13
13
  backgroundColor?: string;
14
14
  bordered?: true;
15
+ /** 变体:plain 用于 Cell 内,underline 底部边框样式,filled 灰色填充背景,filled-rounded 圆角填充背景 */
16
+ variant?: "default" | "plain" | "underline" | "filled" | "filled-rounded";
17
+ /** 错误状态 */
18
+ error?: boolean;
19
+ /** 错误提示信息 */
20
+ errorMessage?: string;
15
21
  /** 验证码倒计时秒数,默认60秒 */
16
22
  codeCountdown?: number;
17
23
  /** 点击获取验证码回调 */
@@ -19,6 +19,14 @@ export interface TagProps {
19
19
  * @description 背景颜色,type='solid' 时生效
20
20
  */
21
21
  bgColor?: string;
22
+ /**
23
+ * @description 边框颜色,type='line' 时生效
24
+ */
25
+ borderColor?: string;
26
+ /**
27
+ * @description 圆角大小
28
+ */
29
+ borderRadius?: number | string;
22
30
  /**
23
31
  * @description 字体粗细
24
32
  */
@@ -29,9 +29,9 @@ export interface TipProps {
29
29
  */
30
30
  bold?: boolean;
31
31
  /**
32
- * @description 左侧图标名称
32
+ * @description 自定义左侧图标
33
33
  */
34
- icon?: string;
34
+ icon?: ReactNode;
35
35
  /**
36
36
  * @description 是否显示操作按钮
37
37
  * @default false
@@ -46,6 +46,11 @@ export interface TipProps {
46
46
  * @description 操作按钮点击事件
47
47
  */
48
48
  onAction?: () => void;
49
+ /**
50
+ * @description 文字对齐方式
51
+ * @default 'center'
52
+ */
53
+ align?: 'left' | 'center';
49
54
  }
50
55
  export declare const Tip: FC<TipProps>;
51
56
  export default Tip;
@@ -168,7 +168,7 @@ const loadIconSymbol = (type) => {
168
168
  try {
169
169
  switch (type) {
170
170
  case "yunying":
171
- import("./iconfont-B9h4iRmM.js");
171
+ import("./iconfont-qKgLSSmj.js");
172
172
  break;
173
173
  case "qitu":
174
174
  import("./iconfont-CXxMq4G2.js");
@@ -1163,6 +1163,9 @@ const Input = forwardRef(
1163
1163
  borderRadius,
1164
1164
  backgroundColor,
1165
1165
  bordered,
1166
+ variant = "default",
1167
+ error = false,
1168
+ errorMessage,
1166
1169
  codeCountdown = 60,
1167
1170
  onGetCode,
1168
1171
  codeText = "获取验证码",
@@ -1231,7 +1234,8 @@ const Input = forwardRef(
1231
1234
  borderRadius,
1232
1235
  backgroundColor,
1233
1236
  border: bordered !== void 0 ? void 0 : "none",
1234
- ...suffixWidth > 0 && (suffix || type === "code") ? { paddingRight: suffixWidth + 22 + 12 } : {}
1237
+ // plain filled 变体不使用动态 paddingRight
1238
+ ...suffixWidth > 0 && (suffix || type === "code") && variant === "default" ? { paddingRight: suffixWidth + 14 } : {}
1235
1239
  };
1236
1240
  const currentValue = isControlled ? value : innerValue;
1237
1241
  const count = (currentValue == null ? void 0 : currentValue.toString().length) || 0;
@@ -1283,20 +1287,25 @@ const Input = forwardRef(
1283
1287
  return /* @__PURE__ */ jsxs(
1284
1288
  "div",
1285
1289
  {
1286
- className: `wz-input-affix-wrapper ${type === "textarea" ? "wz-input-affix-wrapper-textarea" : ""} ${suffix || type === "code" ? "wz-input-has-suffix" : ""} ${bordered === void 0 ? "wz-input-no-border" : ""} ${clearable ? "wz-input-has-clear" : ""} ${type === "password" ? "wz-input-has-password" : ""}`,
1290
+ className: `wz-input-affix-wrapper ${type === "textarea" ? "wz-input-affix-wrapper-textarea" : ""} ${suffix || type === "code" ? "wz-input-has-suffix" : ""} ${bordered === void 0 ? "wz-input-no-border" : ""} ${clearable ? "wz-input-has-clear" : ""} ${type === "password" ? "wz-input-has-password" : ""} ${variant === "plain" ? "wz-input-plain" : ""} ${variant === "underline" ? "wz-input-underline" : ""} ${variant === "filled" || variant === "filled-rounded" ? "wz-input-filled" : ""} ${variant === "filled-rounded" ? "wz-input-filled-rounded" : ""} ${error ? "wz-input-error" : ""}`,
1287
1291
  style: wrapperStyle,
1288
1292
  children: [
1289
1293
  renderInput(),
1290
- showClear && !props.disabled && type !== "textarea" && !suffix && /* @__PURE__ */ jsx("span", { className: "wz-input-clear", onClick: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 22 }) }),
1291
- type === "password" && !suffix && /* @__PURE__ */ jsx("span", { className: "wz-input-password", onClick: handlePasswordVisible, children: /* @__PURE__ */ jsx(Icon, { name: passwordVisible ? "eyes-close" : "eyes-open", size: 22 }) }),
1294
+ showClear && !props.disabled && type !== "textarea" && !suffix && type !== "code" && /* @__PURE__ */ jsx("span", { className: "wz-input-clear", onClick: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 22 }) }),
1295
+ type === "password" && !suffix && /* @__PURE__ */ jsx("span", { className: "wz-input-password", onClick: handlePasswordVisible, children: /* @__PURE__ */ jsx(Icon, { type: "wzdaili", name: passwordVisible ? "kekan" : "bukekan", size: 22 }) }),
1292
1296
  suffix && /* @__PURE__ */ jsxs("div", { className: "wz-input-suffix", ref: suffixRef, children: [
1293
1297
  /* @__PURE__ */ jsx("span", { className: "wz-input-suffix-divider" }),
1294
1298
  suffix
1295
1299
  ] }),
1296
- type === "code" && /* @__PURE__ */ jsxs("div", { className: "wz-input-suffix", ref: !suffix ? suffixRef : void 0, children: [
1297
- /* @__PURE__ */ jsx("span", { className: "wz-input-suffix-divider" }),
1300
+ type === "code" && /* @__PURE__ */ jsxs("div", { className: "wz-input-suffix wz-input-code-suffix", ref: !suffix ? suffixRef : void 0, children: [
1301
+ showClear && !props.disabled && /* @__PURE__ */ jsxs(Fragment, { children: [
1302
+ /* @__PURE__ */ jsx("span", { className: "wz-input-clear", onClick: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 22 }) }),
1303
+ /* @__PURE__ */ jsx("span", { className: "wz-input-suffix-divider" })
1304
+ ] }),
1305
+ !showClear && /* @__PURE__ */ jsx("span", { className: "wz-input-suffix-divider" }),
1298
1306
  counting ? /* @__PURE__ */ jsx("span", { className: "wz-input-code-btn wz-input-code-btn--disabled", children: codeCountingText.replace("{s}", String(countdown)) }) : /* @__PURE__ */ jsx("span", { className: "wz-input-code-btn", onClick: handleGetCode, children: hasSent ? codeResendText : codeText })
1299
- ] })
1307
+ ] }),
1308
+ errorMessage && error && /* @__PURE__ */ jsx("div", { className: "wz-input-error-message", children: errorMessage })
1300
1309
  ]
1301
1310
  }
1302
1311
  );
@@ -1531,10 +1540,14 @@ const TimePicker = ({
1531
1540
  }, [value, pickerOptions]);
1532
1541
  useEffect(() => {
1533
1542
  if (wrapperRef.current) {
1534
- wrapperRef.current.scrollTo({
1535
- top: current * itemHeight,
1536
- behavior: "smooth"
1537
- });
1543
+ if (wrapperRef.current.scrollTo) {
1544
+ wrapperRef.current.scrollTo({
1545
+ top: current * itemHeight,
1546
+ behavior: "smooth"
1547
+ });
1548
+ } else {
1549
+ wrapperRef.current.scrollTop = current * itemHeight;
1550
+ }
1538
1551
  }
1539
1552
  }, [current, itemHeight]);
1540
1553
  const handleTouchStart2 = (e) => {
@@ -1607,18 +1620,26 @@ const TimePicker = ({
1607
1620
  const dragType = useRef(null);
1608
1621
  useEffect(() => {
1609
1622
  if (hourRef.current) {
1610
- hourRef.current.scrollTo({
1611
- top: currentHour * itemHeight,
1612
- behavior: "smooth"
1613
- });
1623
+ if (hourRef.current.scrollTo) {
1624
+ hourRef.current.scrollTo({
1625
+ top: currentHour * itemHeight,
1626
+ behavior: "smooth"
1627
+ });
1628
+ } else {
1629
+ hourRef.current.scrollTop = currentHour * itemHeight;
1630
+ }
1614
1631
  }
1615
1632
  }, [currentHour, itemHeight]);
1616
1633
  useEffect(() => {
1617
1634
  if (minuteRef.current) {
1618
- minuteRef.current.scrollTo({
1619
- top: currentMinute * itemHeight,
1620
- behavior: "smooth"
1621
- });
1635
+ if (minuteRef.current.scrollTo) {
1636
+ minuteRef.current.scrollTo({
1637
+ top: currentMinute * itemHeight,
1638
+ behavior: "smooth"
1639
+ });
1640
+ } else {
1641
+ minuteRef.current.scrollTop = currentMinute * itemHeight;
1642
+ }
1622
1643
  }
1623
1644
  }, [currentMinute, itemHeight]);
1624
1645
  const handleTouchStart = (type2) => (e) => {
@@ -1736,13 +1757,31 @@ const DatePicker = ({
1736
1757
  const isDragging = useRef(false);
1737
1758
  const dragType = useRef(null);
1738
1759
  useLayoutEffect(() => {
1739
- if (yearRef.current) yearRef.current.scrollTo({ top: (year - minYear) * itemHeight, behavior: "auto" });
1760
+ if (yearRef.current) {
1761
+ if (yearRef.current.scrollTo) {
1762
+ yearRef.current.scrollTo({ top: (year - minYear) * itemHeight, behavior: "auto" });
1763
+ } else {
1764
+ yearRef.current.scrollTop = (year - minYear) * itemHeight;
1765
+ }
1766
+ }
1740
1767
  }, [year, itemHeight, minYear]);
1741
1768
  useLayoutEffect(() => {
1742
- if (monthRef.current) monthRef.current.scrollTo({ top: (month - 1) * itemHeight, behavior: "auto" });
1769
+ if (monthRef.current) {
1770
+ if (monthRef.current.scrollTo) {
1771
+ monthRef.current.scrollTo({ top: (month - 1) * itemHeight, behavior: "auto" });
1772
+ } else {
1773
+ monthRef.current.scrollTop = (month - 1) * itemHeight;
1774
+ }
1775
+ }
1743
1776
  }, [month, itemHeight]);
1744
1777
  useLayoutEffect(() => {
1745
- if (dayRef.current) dayRef.current.scrollTo({ top: (day - 1) * itemHeight, behavior: "auto" });
1778
+ if (dayRef.current) {
1779
+ if (dayRef.current.scrollTo) {
1780
+ dayRef.current.scrollTo({ top: (day - 1) * itemHeight, behavior: "auto" });
1781
+ } else {
1782
+ dayRef.current.scrollTop = (day - 1) * itemHeight;
1783
+ }
1784
+ }
1746
1785
  }, [day, itemHeight]);
1747
1786
  const handleTouchStart = (type) => (e) => {
1748
1787
  var _a, _b, _c;
@@ -1806,9 +1845,27 @@ const DatePicker = ({
1806
1845
  setYear(y);
1807
1846
  setMonth(m);
1808
1847
  setDay(d);
1809
- if (yearRef.current) yearRef.current.scrollTo({ top: (y - minYear) * itemHeight, behavior: "auto" });
1810
- if (monthRef.current) monthRef.current.scrollTo({ top: (m - 1) * itemHeight, behavior: "auto" });
1811
- if (dayRef.current) dayRef.current.scrollTo({ top: (d - 1) * itemHeight, behavior: "auto" });
1848
+ if (yearRef.current) {
1849
+ if (yearRef.current.scrollTo) {
1850
+ yearRef.current.scrollTo({ top: (y - minYear) * itemHeight, behavior: "auto" });
1851
+ } else {
1852
+ yearRef.current.scrollTop = (y - minYear) * itemHeight;
1853
+ }
1854
+ }
1855
+ if (monthRef.current) {
1856
+ if (monthRef.current.scrollTo) {
1857
+ monthRef.current.scrollTo({ top: (m - 1) * itemHeight, behavior: "auto" });
1858
+ } else {
1859
+ monthRef.current.scrollTop = (m - 1) * itemHeight;
1860
+ }
1861
+ }
1862
+ if (dayRef.current) {
1863
+ if (dayRef.current.scrollTo) {
1864
+ dayRef.current.scrollTo({ top: (d - 1) * itemHeight, behavior: "auto" });
1865
+ } else {
1866
+ dayRef.current.scrollTop = (d - 1) * itemHeight;
1867
+ }
1868
+ }
1812
1869
  }
1813
1870
  }, [value]);
1814
1871
  const renderColumn = (options, current, ref, type) => /* @__PURE__ */ jsxs(
@@ -2198,28 +2255,41 @@ const Tag = (props) => {
2198
2255
  size = "large",
2199
2256
  color,
2200
2257
  bgColor,
2258
+ borderColor,
2259
+ borderRadius,
2201
2260
  fontWeight,
2202
2261
  className,
2203
2262
  style,
2204
2263
  children
2205
2264
  } = props;
2206
- const classes = classNames("wz-tag", `wz-tag-${type}`, `wz-tag-${size}`, className);
2265
+ const classes = classNames(
2266
+ "wz-tag",
2267
+ `wz-tag-${type}`,
2268
+ `wz-tag-${size}`,
2269
+ className
2270
+ );
2207
2271
  const tagStyle = useMemo(() => {
2208
2272
  const newStyle = { ...style };
2209
2273
  if (color) {
2210
2274
  newStyle.color = color;
2211
- if (type === "line") {
2275
+ if (type === "line" && !borderColor) {
2212
2276
  newStyle.borderColor = hexToRgba(color, 0.5);
2213
2277
  }
2214
2278
  }
2279
+ if (borderColor && type === "line") {
2280
+ newStyle.borderColor = borderColor;
2281
+ }
2215
2282
  if (bgColor && type === "solid") {
2216
2283
  newStyle.backgroundColor = bgColor;
2217
2284
  }
2285
+ if (borderRadius !== void 0) {
2286
+ newStyle.borderRadius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
2287
+ }
2218
2288
  if (fontWeight) {
2219
2289
  newStyle.fontWeight = fontWeight;
2220
2290
  }
2221
2291
  return newStyle;
2222
- }, [type, color, bgColor, fontWeight, style]);
2292
+ }, [type, color, bgColor, borderColor, borderRadius, fontWeight, style]);
2223
2293
  return /* @__PURE__ */ jsx("div", { className: classes, style: tagStyle, children });
2224
2294
  };
2225
2295
  const Tip = ({
@@ -2232,17 +2302,9 @@ const Tip = ({
2232
2302
  icon,
2233
2303
  showAction = false,
2234
2304
  actionText = "查看",
2235
- onAction
2305
+ onAction,
2306
+ align = "center"
2236
2307
  }) => {
2237
- const contentRef = useRef(null);
2238
- const [isMultiLine, setIsMultiLine] = useState(false);
2239
- useEffect(() => {
2240
- if (contentRef.current && !marquee) {
2241
- const el = contentRef.current;
2242
- const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;
2243
- setIsMultiLine(el.scrollHeight > lineHeight * 1.5);
2244
- }
2245
- }, [content, marquee]);
2246
2308
  if (!visible) {
2247
2309
  return null;
2248
2310
  }
@@ -2251,15 +2313,15 @@ const Tip = ({
2251
2313
  const tipClass = classNames(baseClass, className, {
2252
2314
  [`${baseClass}--marquee`]: marquee,
2253
2315
  [`${baseClass}--bold`]: bold,
2254
- [`${baseClass}--center`]: !marquee && !isMultiLine,
2255
- [`${baseClass}--left`]: !marquee && isMultiLine,
2316
+ [`${baseClass}--left`]: align === "left",
2317
+ [`${baseClass}--center`]: align === "center",
2256
2318
  [`${baseClass}--has-icon`]: !!icon,
2257
2319
  [`${baseClass}--has-right`]: hasRightArea
2258
2320
  });
2259
2321
  const contentNode = marquee ? /* @__PURE__ */ jsx("div", { className: `${baseClass}-marquee-box`, children: /* @__PURE__ */ jsx("span", { children: content }) }) : content;
2260
2322
  return /* @__PURE__ */ jsxs("div", { className: tipClass, children: [
2261
- /* @__PURE__ */ jsxs("div", { className: `${baseClass}-content`, ref: contentRef, children: [
2262
- icon && /* @__PURE__ */ jsx("span", { className: `${baseClass}-icon`, children: /* @__PURE__ */ jsx(Icon, { name: icon, size: 16 }) }),
2323
+ /* @__PURE__ */ jsxs("div", { className: `${baseClass}-content`, children: [
2324
+ icon && /* @__PURE__ */ jsx("span", { className: `${baseClass}-icon`, children: icon }),
2263
2325
  /* @__PURE__ */ jsx("span", { className: `${baseClass}-text`, children: contentNode })
2264
2326
  ] }),
2265
2327
  showAction && /* @__PURE__ */ jsx("div", { className: `${baseClass}-action`, onClick: onAction, children: actionText }),
@@ -2444,13 +2506,10 @@ const Toast$1 = ({
2444
2506
  visible = false,
2445
2507
  onClose
2446
2508
  }) => {
2447
- const [show2, setShow] = useState(visible);
2448
2509
  useEffect(() => {
2449
- setShow(visible);
2450
2510
  let timer;
2451
2511
  if (visible && duration > 0) {
2452
2512
  timer = setTimeout(() => {
2453
- setShow(false);
2454
2513
  onClose == null ? void 0 : onClose();
2455
2514
  }, duration);
2456
2515
  }
@@ -2458,7 +2517,7 @@ const Toast$1 = ({
2458
2517
  clearTimeout(timer);
2459
2518
  };
2460
2519
  }, [visible, duration, onClose]);
2461
- const toastClass = classNames("wz-toast", { "wz-toast-visible": show2 });
2520
+ const toastClass = classNames("wz-toast", { "wz-toast-visible": visible });
2462
2521
  const iconClass = classNames("wz-toast-icon");
2463
2522
  return /* @__PURE__ */ jsx("div", { className: toastClass, children: /* @__PURE__ */ jsxs("div", { className: "wz-toast-content", children: [
2464
2523
  icon && /* @__PURE__ */ jsx("div", { className: iconClass, children: icon }),