vxui-react 1.3.2 → 1.3.3

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.
package/dist/index.js CHANGED
@@ -2029,36 +2029,38 @@ function tl({
2029
2029
  placement: d = "center",
2030
2030
  scrollable: c = !0,
2031
2031
  closable: u = !0,
2032
- ...v
2032
+ fullscreen: v = !1,
2033
+ ...x
2033
2034
  }) {
2034
- const x = B(null);
2035
- return /* @__PURE__ */ N(At, { ...v, children: [
2035
+ const k = B(null);
2036
+ return /* @__PURE__ */ N(At, { ...x, children: [
2036
2037
  /* @__PURE__ */ a(Pt, { asChild: !0, children: e }),
2037
2038
  /* @__PURE__ */ N(Rt, { children: [
2038
2039
  /* @__PURE__ */ a(Dt, { className: "vx-dialog__overlay" }),
2039
2040
  /* @__PURE__ */ N(
2040
2041
  Lt,
2041
2042
  {
2042
- ref: x,
2043
+ ref: k,
2043
2044
  className: T(
2044
2045
  "vx-dialog__content",
2046
+ v && "vx-dialog__content--fullscreen",
2045
2047
  l !== "md" && `vx-dialog__content--${l}`,
2046
2048
  d !== "center" && `vx-dialog__content--${d}`,
2047
2049
  i && `vx-dialog__content--pad-${i}`,
2048
2050
  c && "vx-dialog__content--scrollable",
2049
2051
  s
2050
2052
  ),
2051
- onEscapeKeyDown: (k) => {
2052
- const S = x.current;
2053
- if (!S) return;
2054
- const g = !!S.querySelector(
2053
+ onEscapeKeyDown: (S) => {
2054
+ const g = k.current;
2055
+ if (!g) return;
2056
+ const h = !!g.querySelector(
2055
2057
  ".vx-select__dropdown, .vx-multiselect__dropdown, .vx-datepicker__popover, .vx-timepicker__popover, .vx-colorpicker__panel"
2056
- ), h = S.dataset.hasOpenPortal === "1";
2057
- (g || h) && k.preventDefault();
2058
+ ), _ = g.dataset.hasOpenPortal === "1";
2059
+ (h || _) && S.preventDefault();
2058
2060
  },
2059
- onPointerDownOutside: (k) => {
2060
- const S = x.current;
2061
- (S == null ? void 0 : S.dataset.hasOpenPortal) === "1" && k.preventDefault();
2061
+ onPointerDownOutside: (S) => {
2062
+ const g = k.current;
2063
+ (g == null ? void 0 : g.dataset.hasOpenPortal) === "1" && S.preventDefault();
2062
2064
  },
2063
2065
  children: [
2064
2066
  /* @__PURE__ */ N("div", { className: "vx-dialog__header", children: [
@@ -3461,40 +3463,40 @@ const pi = {
3461
3463
  warning: /* @__PURE__ */ a(ba, { size: 15 }),
3462
3464
  danger: /* @__PURE__ */ a(aa, { size: 15 })
3463
3465
  };
3464
- function pl({ children: e, placement: t = "bottom-right" }) {
3465
- const [n, r] = I([]), o = Se(
3466
+ function pl({ children: e }) {
3467
+ const [t, n] = I([]), r = Se(
3466
3468
  () => ({
3467
- push: (s) => {
3468
- r((l) => [...l, { id: ui += 1, tone: "info", ...s }]);
3469
+ push: (o) => {
3470
+ n((s) => [...s, { id: ui += 1, tone: "info", ...o }]);
3469
3471
  }
3470
3472
  }),
3471
3473
  []
3472
3474
  );
3473
- return /* @__PURE__ */ a(zr.Provider, { value: o, children: /* @__PURE__ */ N(oi, { swipeDirection: "right", children: [
3475
+ return /* @__PURE__ */ a(zr.Provider, { value: r, children: /* @__PURE__ */ N(oi, { swipeDirection: "right", children: [
3474
3476
  e,
3475
- n.map((s) => /* @__PURE__ */ N(
3477
+ t.map((o) => /* @__PURE__ */ N(
3476
3478
  ii,
3477
3479
  {
3478
- className: T("vx-toast", `vx-toast--${s.tone ?? "info"}`, !s.description && "vx-toast--no-desc"),
3479
- duration: s.duration ?? 4500,
3480
+ className: T("vx-toast", `vx-toast--${o.tone ?? "info"}`),
3481
+ duration: 4500,
3480
3482
  open: !0,
3481
- onOpenChange: (l) => {
3482
- l || r((i) => i.filter((d) => d.id !== s.id));
3483
+ onOpenChange: (s) => {
3484
+ s || n((l) => l.filter((i) => i.id !== o.id));
3483
3485
  },
3484
3486
  children: [
3485
3487
  /* @__PURE__ */ N("div", { className: "vx-toast__content", children: [
3486
3488
  /* @__PURE__ */ N("div", { className: "vx-toast__header", children: [
3487
- /* @__PURE__ */ a("span", { className: "vx-toast__icon", "aria-hidden": "true", children: pi[s.tone ?? "info"] }),
3488
- /* @__PURE__ */ a(li, { className: "vx-toast__title", children: s.title })
3489
+ /* @__PURE__ */ a("span", { className: "vx-toast__icon", "aria-hidden": "true", children: pi[o.tone ?? "info"] }),
3490
+ /* @__PURE__ */ a(li, { className: "vx-toast__title", children: o.title })
3489
3491
  ] }),
3490
- s.description ? /* @__PURE__ */ a(ci, { className: "vx-toast__description", children: s.description }) : null
3492
+ o.description ? /* @__PURE__ */ a(ci, { className: "vx-toast__description", children: o.description }) : null
3491
3493
  ] }),
3492
- s.closable !== !1 && /* @__PURE__ */ a(di, { className: "vx-toast__close", "aria-label": "Dismiss notification", children: /* @__PURE__ */ a(le, { size: 14 }) })
3494
+ /* @__PURE__ */ a(di, { className: "vx-toast__close", "aria-label": "Dismiss notification", children: /* @__PURE__ */ a(le, { size: 14 }) })
3493
3495
  ]
3494
3496
  },
3495
- s.id
3497
+ o.id
3496
3498
  )),
3497
- /* @__PURE__ */ a(si, { className: T("vx-toast__viewport", `vx-toast__viewport--${t}`) })
3499
+ /* @__PURE__ */ a(si, { className: "vx-toast__viewport" })
3498
3500
  ] }) });
3499
3501
  }
3500
3502
  function vl() {
@@ -4093,9 +4095,7 @@ function Al({
4093
4095
  u && S(r);
4094
4096
  }, [u, r]), xe(() => {
4095
4097
  if (!u || !x.current) return;
4096
- const p = x.current.getBoundingClientRect();
4097
- if (p.width === 0 && p.height === 0) return;
4098
- const m = 8;
4098
+ const p = x.current.getBoundingClientRect(), m = 8;
4099
4099
  k === "left" && p.right > window.innerWidth - m ? S("right") : k === "right" && p.left < m && S("left");
4100
4100
  }, [u, k]);
4101
4101
  const g = Y((p) => {
@@ -6196,7 +6196,7 @@ function Hr({ node: e, depth: t, selected: n, expanded: r, onSelect: o, onToggle
6196
6196
  ] });
6197
6197
  }
6198
6198
  function xc({
6199
- nodes: e = [],
6199
+ nodes: e,
6200
6200
  selected: t,
6201
6201
  defaultSelected: n,
6202
6202
  onSelect: r,
@@ -8636,7 +8636,7 @@ function Ec({
8636
8636
  ) })
8637
8637
  ] });
8638
8638
  }
8639
- const Oi = "1.3.2", $i = {
8639
+ const Oi = "1.3.3", $i = {
8640
8640
  version: Oi
8641
8641
  }, Ve = `v${$i.version}`, Wr = {
8642
8642
  locale: "en",
@@ -8967,8 +8967,7 @@ const Oi = "1.3.2", $i = {
8967
8967
  guidance: [
8968
8968
  "Use success and info to confirm background actions.",
8969
8969
  "Escalate blocking or destructive states to dialogs instead of stacking toasts.",
8970
- "Avoid repeating the same message on every page transition.",
8971
- "Provide only a title when possible for a clean, compact layout."
8970
+ "Avoid repeating the same message on every page transition."
8972
8971
  ]
8973
8972
  },
8974
8973
  feedback: {
@@ -9452,8 +9451,7 @@ const Oi = "1.3.2", $i = {
9452
9451
  guidance: [
9453
9452
  "使用 success 和 info 确认后台操作。",
9454
9453
  "将阻塞性或破坏性状态升级为对话框,而非堆叠 Toast。",
9455
- "避免在每次页面切换时重复相同消息。",
9456
- "在可用的情况下尽量只提供标题,享受更为紧凑、极简的纯标题排版。"
9454
+ "避免在每次页面切换时重复相同消息。"
9457
9455
  ]
9458
9456
  },
9459
9457
  feedback: {
@@ -20,8 +20,10 @@ export interface DialogProps extends Pick<DialogPrimitive.DialogProps, 'defaultO
20
20
  scrollable?: boolean;
21
21
  /** Show the close (×) button. Default: true */
22
22
  closable?: boolean;
23
+ /** When true, the dialog will be displayed in fullscreen mode. Default: false */
24
+ fullscreen?: boolean;
23
25
  }
24
- export declare function Dialog({ trigger, title, description, children, footer, className, size, padding, placement, scrollable, closable, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Dialog({ trigger, title, description, children, footer, className, size, padding, placement, scrollable, closable, fullscreen, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
25
27
  /**
26
28
  * Wraps any child element so that clicking it closes the parent Dialog.
27
29
  * Usage: <DialogClose asChild><Button>Cancel</Button></DialogClose>
@@ -1,20 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
2
  type ToastTone = 'info' | 'success' | 'warning' | 'danger';
3
- export type ToastPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
4
3
  interface ToastInput {
5
4
  title: string;
6
5
  description?: string;
7
6
  tone?: ToastTone;
8
- duration?: number;
9
- closable?: boolean;
10
7
  }
11
8
  interface ToastContextValue {
12
9
  push: (toast: ToastInput) => void;
13
10
  }
14
- export interface ToastProviderProps {
11
+ export declare function ToastProvider({ children }: {
15
12
  children: ReactNode;
16
- placement?: ToastPlacement;
17
- }
18
- export declare function ToastProvider({ children, placement }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ }): import("react/jsx-runtime").JSX.Element;
19
14
  export declare function useToast(): ToastContextValue;
20
15
  export {};