@skiddph/prui 0.10.2 → 0.11.0

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,93 +1,76 @@
1
- import { jsx as t, jsxs as Y } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { X as k } from "lucide-react";
4
- import { cn as P } from "./cn.js";
5
- import { useReducedMotion as j, useOverlay as A, Portal as E } from "./overlay.js";
6
- import { usePruiI18n as F } from "../i18n.js";
7
- const L = {
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { X as M } from "lucide-react";
4
+ import { cn as R } from "./cn.js";
5
+ import { useMountTransition as T, useOverlay as Y, Portal as k } from "./overlay.js";
6
+ import { usePruiI18n as P } from "../i18n.js";
7
+ const j = {
8
8
  left: "left-0 top-0 h-full prui-drawer-panel",
9
9
  right: "right-0 top-0 h-full prui-drawer-panel",
10
10
  top: "left-0 top-0 w-full prui-drawer-panel",
11
11
  bottom: "left-0 bottom-0 w-full prui-drawer-panel"
12
- }, $ = {
12
+ }, L = {
13
13
  left: "translateX(0)",
14
14
  right: "translateX(0)",
15
15
  top: "translateY(0)",
16
16
  bottom: "translateY(0)"
17
- }, q = {
17
+ }, $ = {
18
18
  left: "translateX(-100%)",
19
19
  right: "translateX(100%)",
20
20
  top: "translateY(-100%)",
21
21
  bottom: "translateY(100%)"
22
- }, h = a.forwardRef(function({ open: n, defaultOpen: i = !1, onOpenChange: s, side: r = "right", size: o, children: v, ariaLabel: w, hideClose: y, className: g, style: x }, S) {
23
- const [N, D] = a.useState(i), m = n !== void 0, l = m ? n : N, [M, u] = a.useState(l), [p, d] = a.useState(!1), f = j(), { t: R } = F(), c = (e) => {
24
- m || D(e), s == null || s(e);
25
- };
26
- a.useEffect(() => {
27
- if (l) {
28
- if (u(!0), f) {
29
- d(!0);
30
- return;
31
- }
32
- const C = requestAnimationFrame(() => d(!0));
33
- return () => cancelAnimationFrame(C);
34
- }
35
- if (d(!1), f) {
36
- u(!1);
37
- return;
38
- }
39
- const e = setTimeout(() => u(!1), 300);
40
- return () => clearTimeout(e);
41
- }, [l, f]);
42
- const { ref: T } = A({
43
- open: l,
44
- onEscape: () => c(!1)
22
+ }, f = u.forwardRef(function({ open: a, defaultOpen: n = !1, onOpenChange: l, side: e = "right", size: r, children: c, ariaLabel: h, hideClose: b, className: v, style: y }, g) {
23
+ const [w, x] = u.useState(n), p = a !== void 0, d = p ? a : w, { mounted: S, shown: i } = T(d), { t: N } = P(), s = (o) => {
24
+ p || x(o), l == null || l(o);
25
+ }, { ref: D } = Y({
26
+ open: d,
27
+ onEscape: () => s(!1)
45
28
  });
46
- if (!M) return null;
29
+ if (!S) return null;
47
30
  const X = {
48
- transform: p ? $[r] : q[r],
31
+ transform: i ? L[e] : $[e],
49
32
  transition: "transform var(--prui-duration-slow) var(--prui-ease-out)",
50
- ...r === "left" || r === "right" ? { width: typeof o == "number" ? `${o}px` : o ?? "400px" } : { maxHeight: typeof o == "number" ? `${o}px` : o ?? "80vh" },
51
- ...x
33
+ ...e === "left" || e === "right" ? { width: typeof r == "number" ? `${r}px` : r ?? "400px" } : { maxHeight: typeof r == "number" ? `${r}px` : r ?? "80vh" },
34
+ ...y
52
35
  };
53
- return /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t("div", { ref: T, children: /* @__PURE__ */ t(
36
+ return /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t("div", { ref: D, children: /* @__PURE__ */ t(
54
37
  "div",
55
38
  {
56
39
  className: "prui-drawer-overlay fixed inset-0 z-[var(--prui-z-modal)]",
57
40
  style: {
58
41
  backgroundColor: "var(--prui-scrim)",
59
- opacity: p ? 1 : 0,
42
+ opacity: i ? 1 : 0,
60
43
  transition: "opacity var(--prui-duration-slow) var(--prui-ease-out)"
61
44
  },
62
- onMouseDown: (e) => {
63
- e.target === e.currentTarget && c(!1);
45
+ onMouseDown: (o) => {
46
+ o.target === o.currentTarget && s(!1);
64
47
  },
65
- children: /* @__PURE__ */ Y(
48
+ children: /* @__PURE__ */ C(
66
49
  "div",
67
50
  {
68
- ref: S,
51
+ ref: g,
69
52
  role: "dialog",
70
53
  "aria-modal": "true",
71
- "aria-label": w,
72
- "data-state": p ? "open" : "closed",
73
- className: P(
54
+ "aria-label": h,
55
+ "data-state": i ? "open" : "closed",
56
+ className: R(
74
57
  "absolute flex flex-col overflow-y-auto border border-[var(--prui-line)] bg-[var(--prui-surface)]",
75
58
  "text-[var(--prui-fg)] shadow-[var(--prui-shadow-modal)] outline-none",
76
- L[r],
77
- g
59
+ j[e],
60
+ v
78
61
  ),
79
62
  style: X,
80
63
  children: [
81
- r === "bottom" ? /* @__PURE__ */ t("div", { "aria-hidden": !0, className: "mx-auto mt-2 mb-1 h-1 w-10 shrink-0 rounded-[var(--prui-radius-full)] bg-[var(--prui-line)]" }) : null,
82
- v,
83
- y ? null : /* @__PURE__ */ t(
64
+ e === "bottom" ? /* @__PURE__ */ t("div", { "aria-hidden": !0, className: "mx-auto mt-2 mb-1 h-1 w-10 shrink-0 rounded-[var(--prui-radius-full)] bg-[var(--prui-line)]" }) : null,
65
+ c,
66
+ b ? null : /* @__PURE__ */ t(
84
67
  "button",
85
68
  {
86
69
  type: "button",
87
- "aria-label": R.close,
88
- onClick: () => c(!1),
70
+ "aria-label": N.close,
71
+ onClick: () => s(!1),
89
72
  className: "absolute right-3 top-3 rounded-[var(--prui-radius-1)] p-1 text-[var(--prui-dim)] transition-colors hover:bg-[var(--prui-raise)] hover:text-[var(--prui-fg)] cursor-pointer",
90
- children: /* @__PURE__ */ t(k, { className: "h-4 w-4", "aria-hidden": !0 })
73
+ children: /* @__PURE__ */ t(M, { className: "h-4 w-4", "aria-hidden": !0 })
91
74
  }
92
75
  )
93
76
  ]
@@ -96,12 +79,12 @@ const L = {
96
79
  }
97
80
  ) }) });
98
81
  });
99
- h.displayName = "Drawer";
100
- const H = a.forwardRef(function(n, i) {
101
- return /* @__PURE__ */ t(h, { ref: i, side: "bottom", ...n });
82
+ f.displayName = "Drawer";
83
+ const E = u.forwardRef(function(a, n) {
84
+ return /* @__PURE__ */ t(f, { ref: n, side: "bottom", ...a });
102
85
  });
103
- H.displayName = "Sheet";
104
- const J = {
86
+ E.displayName = "Sheet";
87
+ const A = {
105
88
  name: "Drawer",
106
89
  props: [
107
90
  { name: "open", type: "boolean", default: "undefined", control: "boolean" },
@@ -112,7 +95,7 @@ const J = {
112
95
  { name: "ariaLabel", type: "string", default: null, control: "text" },
113
96
  { name: "hideClose", type: "boolean", default: "false", control: "boolean" }
114
97
  ]
115
- }, K = {
98
+ }, B = {
116
99
  name: "Sheet",
117
100
  props: [
118
101
  { name: "open", type: "boolean", default: "undefined", control: "boolean" },
@@ -122,8 +105,8 @@ const J = {
122
105
  ]
123
106
  };
124
107
  export {
125
- h as Drawer,
126
- H as Sheet,
127
- J as drawerPropsMeta,
128
- K as sheetPropsMeta
108
+ f as Drawer,
109
+ E as Sheet,
110
+ A as drawerPropsMeta,
111
+ B as sheetPropsMeta
129
112
  };
@@ -25,6 +25,18 @@ export declare function Portal({ children, container, }: {
25
25
  }): React.ReactPortal | null;
26
26
  /** True when the user asked the OS for reduced motion. */
27
27
  export declare function useReducedMotion(): boolean;
28
+ /**
29
+ * Mount/unmount lifecycle for enter/exit animations. Mounts immediately when
30
+ * `open` turns true; flips `shown` a frame later so the enter state (the
31
+ * "from" transform) paints first — a single rAF can merge into that first
32
+ * paint under discrete-event flushes and skip the animation entirely, so this
33
+ * waits two frames. On close, `shown` drops at once and unmounting waits
34
+ * `exitMs` for the exit animation. Reduced motion skips both directions.
35
+ */
36
+ export declare function useMountTransition(open: boolean, exitMs?: number): {
37
+ mounted: boolean;
38
+ shown: boolean;
39
+ };
28
40
  /** All focusable elements inside root, in DOM order. */
29
41
  export declare function getFocusable(root: HTMLElement | null): HTMLElement[];
30
42
  /** Register an overlay; returns its stack id. */
@@ -1,23 +1,47 @@
1
- import * as s from "react";
1
+ import * as c from "react";
2
2
  import { createPortal as E } from "react-dom";
3
- function P({
3
+ function x({
4
4
  children: t,
5
5
  container: e
6
6
  }) {
7
- const [r, c] = s.useState(null);
8
- return s.useEffect(() => {
9
- c(e ?? (typeof document < "u" ? document.body : null));
10
- }, [e]), r == null ? null : E(t, r);
11
- }
12
- function x() {
13
- const [t, e] = s.useState(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
14
- return s.useEffect(() => {
7
+ const [n, s] = c.useState(null);
8
+ return c.useEffect(() => {
9
+ s(e ?? (typeof document < "u" ? document.body : null));
10
+ }, [e]), n == null ? null : E(t, n);
11
+ }
12
+ function v() {
13
+ const [t, e] = c.useState(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
14
+ return c.useEffect(() => {
15
15
  if (typeof window > "u" || !window.matchMedia) return;
16
- const r = window.matchMedia("(prefers-reduced-motion: reduce)"), c = () => e(r.matches);
17
- return r.addEventListener("change", c), () => r.removeEventListener("change", c);
16
+ const n = window.matchMedia("(prefers-reduced-motion: reduce)"), s = () => e(n.matches);
17
+ return n.addEventListener("change", s), () => n.removeEventListener("change", s);
18
18
  }, []), t;
19
19
  }
20
- const v = [
20
+ function I(t, e = 300) {
21
+ const n = v(), [s, o] = c.useState(t), [r, u] = c.useState(!1);
22
+ return c.useEffect(() => {
23
+ if (t) {
24
+ if (o(!0), n) {
25
+ u(!0);
26
+ return;
27
+ }
28
+ let f = 0;
29
+ const a = requestAnimationFrame(() => {
30
+ f = requestAnimationFrame(() => u(!0));
31
+ });
32
+ return () => {
33
+ cancelAnimationFrame(a), cancelAnimationFrame(f);
34
+ };
35
+ }
36
+ if (u(!1), n) {
37
+ o(!1);
38
+ return;
39
+ }
40
+ const i = setTimeout(() => o(!1), e);
41
+ return () => clearTimeout(i);
42
+ }, [t, n, e]), { mounted: s, shown: r };
43
+ }
44
+ const g = [
21
45
  "a[href]",
22
46
  "button:not([disabled])",
23
47
  "input:not([disabled])",
@@ -30,138 +54,138 @@ const v = [
30
54
  "[contenteditable]:not([contenteditable='false'])"
31
55
  ].join(",");
32
56
  function y(t) {
33
- return t ? Array.from(t.querySelectorAll(v)).filter(
57
+ return t ? Array.from(t.querySelectorAll(g)).filter(
34
58
  (e) => !e.closest("[inert], [aria-hidden='true']") && !e.hasAttribute("hidden")
35
59
  ) : [];
36
60
  }
37
- const f = [];
38
- function g(t) {
61
+ const l = [];
62
+ function T(t) {
39
63
  const e = Symbol("prui-overlay");
40
- return f.push({ id: e, element: t }), e;
64
+ return l.push({ id: e, element: t }), e;
41
65
  }
42
- function T(t) {
43
- const e = f.findIndex((r) => r.id === t);
44
- e >= 0 && f.splice(e, 1);
66
+ function w(t) {
67
+ const e = l.findIndex((n) => n.id === t);
68
+ e >= 0 && l.splice(e, 1);
45
69
  }
46
70
  function k(t) {
47
- const e = f[f.length - 1];
71
+ const e = l[l.length - 1];
48
72
  return e != null && e.id === t;
49
73
  }
50
- function I() {
51
- return f.length;
74
+ function B() {
75
+ return l.length;
52
76
  }
53
- function w(t) {
54
- const e = s.useRef(null), r = s.useRef(null), [c, o] = s.useReducer((i) => i + 1, 0);
55
- s.useEffect(() => {
77
+ function A(t) {
78
+ const e = c.useRef(null), n = c.useRef(null), [s, o] = c.useReducer((i) => i + 1, 0);
79
+ c.useEffect(() => {
56
80
  if (!t) return;
57
- const i = g(null);
58
- return e.current = i, r.current = f[f.length - 1] ?? null, o(), () => {
59
- T(i), e.current === i && (e.current = null, r.current = null);
81
+ const i = T(null);
82
+ return e.current = i, n.current = l[l.length - 1] ?? null, o(), () => {
83
+ w(i), e.current === i && (e.current = null, n.current = null);
60
84
  };
61
85
  }, [t]);
62
- const n = s.useCallback((i) => {
63
- r.current && (r.current.element = i);
64
- }, []), u = s.useCallback(() => e.current != null ? k(e.current) : !1, []);
65
- return { setElement: n, isTop: u };
66
- }
67
- function R(t, e, r) {
68
- const c = s.useRef(r);
69
- c.current = r, s.useEffect(() => {
86
+ const r = c.useCallback((i) => {
87
+ n.current && (n.current.element = i);
88
+ }, []), u = c.useCallback(() => e.current != null ? k(e.current) : !1, []);
89
+ return { setElement: r, isTop: u };
90
+ }
91
+ function R(t, e, n) {
92
+ const s = c.useRef(n);
93
+ s.current = n, c.useEffect(() => {
70
94
  if (!t) return;
71
- const o = (n) => {
72
- if (n.key !== "Escape" || !e()) return;
73
- c.current() === !1 && n.stopPropagation();
95
+ const o = (r) => {
96
+ if (r.key !== "Escape" || !e()) return;
97
+ s.current() === !1 && r.stopPropagation();
74
98
  };
75
99
  return document.addEventListener("keydown", o, !0), () => document.removeEventListener("keydown", o, !0);
76
100
  }, [t, e]);
77
101
  }
78
- let a = 0, h = "", p = "";
79
- function L() {
80
- typeof document > "u" || (a++, !(a > 1) && (h = document.body.style.overflow, p = document.body.style.paddingRight, document.body.style.overflow = "hidden", document.body.classList.add("modal-open")));
102
+ let m = 0, h = "", p = "";
103
+ function S() {
104
+ typeof document > "u" || (m++, !(m > 1) && (h = document.body.style.overflow, p = document.body.style.paddingRight, document.body.style.overflow = "hidden", document.body.classList.add("modal-open")));
81
105
  }
82
- function A() {
83
- typeof document > "u" || (a = Math.max(0, a - 1), !(a > 0) && (document.body.style.overflow = h, document.body.style.paddingRight = p, document.body.classList.remove("modal-open")));
106
+ function L() {
107
+ typeof document > "u" || (m = Math.max(0, m - 1), !(m > 0) && (document.body.style.overflow = h, document.body.style.paddingRight = p, document.body.classList.remove("modal-open")));
84
108
  }
85
- function S(t) {
86
- s.useEffect(() => {
109
+ function C(t) {
110
+ c.useEffect(() => {
87
111
  if (t)
88
- return L(), A;
112
+ return S(), L;
89
113
  }, [t]);
90
114
  }
91
115
  const b = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
92
- function C(t, e) {
93
- const r = t.ownerDocument, c = [];
94
- for (const o of Array.from(r.body.childNodes)) {
116
+ function M(t, e) {
117
+ const n = t.ownerDocument, s = [];
118
+ for (const o of Array.from(n.body.childNodes)) {
95
119
  if (!(o instanceof HTMLElement)) continue;
96
- const n = o.tagName;
97
- n === "SCRIPT" || n === "STYLE" || n === "LINK" || n === "NOSCRIPT" || n === "META" || n === "TITLE" || n === "TEMPLATE" || o === t || o.contains(t) || t.contains(o) || e.has(o) || o.getAttribute("aria-hidden") !== "true" && (c.push({ el: o, ariaHidden: o.getAttribute("aria-hidden") }), o.setAttribute("aria-hidden", "true"), b && o.setAttribute("inert", ""));
120
+ const r = o.tagName;
121
+ r === "SCRIPT" || r === "STYLE" || r === "LINK" || r === "NOSCRIPT" || r === "META" || r === "TITLE" || r === "TEMPLATE" || o === t || o.contains(t) || t.contains(o) || e.has(o) || o.getAttribute("aria-hidden") !== "true" && (s.push({ el: o, ariaHidden: o.getAttribute("aria-hidden") }), o.setAttribute("aria-hidden", "true"), b && o.setAttribute("inert", ""));
98
122
  }
99
123
  return () => {
100
- for (const { el: o, ariaHidden: n } of c)
101
- n === null ? o.removeAttribute("aria-hidden") : o.setAttribute("aria-hidden", n), b && o.removeAttribute("inert");
124
+ for (const { el: o, ariaHidden: r } of s)
125
+ r === null ? o.removeAttribute("aria-hidden") : o.setAttribute("aria-hidden", r), b && o.removeAttribute("inert");
102
126
  };
103
127
  }
104
- function M(t, e) {
105
- s.useEffect(() => {
128
+ function O(t, e) {
129
+ c.useEffect(() => {
106
130
  if (!t || !e || typeof document > "u") return;
107
- const r = /* @__PURE__ */ new Set();
108
- for (const c of f)
109
- c.element && r.add(c.element);
110
- return C(e, r);
131
+ const n = /* @__PURE__ */ new Set();
132
+ for (const s of l)
133
+ s.element && n.add(s.element);
134
+ return M(e, n);
111
135
  }, [t, e]);
112
136
  }
113
- function O({ active: t, container: e, initialFocus: r = "first", restoreFocus: c = !0 }) {
114
- const o = s.useRef(null);
115
- s.useEffect(() => {
137
+ function N({ active: t, container: e, initialFocus: n = "first", restoreFocus: s = !0 }) {
138
+ const o = c.useRef(null);
139
+ c.useEffect(() => {
116
140
  if (!t) return;
117
141
  o.current = document.activeElement ?? null;
118
- const u = (r === !1 ? null : r === "container" ? e : r === "first" ? y(e)[0] ?? e : r.current ?? null) ?? e;
142
+ const u = (n === !1 ? null : n === "container" ? e : n === "first" ? y(e)[0] ?? e : n.current ?? null) ?? e;
119
143
  u && u.isConnected && !u.contains(document.activeElement) && (!u.hasAttribute("tabindex") && u.tagName !== "INPUT" && u.tagName !== "BUTTON" && u.tagName !== "TEXTAREA" && u.tagName !== "SELECT" && u.tagName !== "A" && !u.isContentEditable && u.setAttribute("tabindex", "-1"), u.focus());
120
- }, [t, e, r]), s.useEffect(() => {
144
+ }, [t, e, n]), c.useEffect(() => {
121
145
  if (t) return;
122
- const n = o.current;
123
- !n || !c || (o.current = null, n.isConnected && n.focus());
124
- }, [t, c]), s.useEffect(
146
+ const r = o.current;
147
+ !r || !s || (o.current = null, r.isConnected && r.focus());
148
+ }, [t, s]), c.useEffect(
125
149
  () => () => {
126
- const n = o.current;
127
- n && c && n.isConnected && n.focus();
150
+ const r = o.current;
151
+ r && s && r.isConnected && r.focus();
128
152
  },
129
- [c]
130
- ), s.useEffect(() => {
153
+ [s]
154
+ ), c.useEffect(() => {
131
155
  if (!t) return;
132
- const n = (u) => {
156
+ const r = (u) => {
133
157
  if (u.key !== "Tab") return;
134
158
  const i = y(e);
135
159
  if (i.length === 0) {
136
160
  e && !e.contains(document.activeElement) && (u.preventDefault(), e.focus());
137
161
  return;
138
162
  }
139
- const l = i[0], m = i[i.length - 1], d = document.activeElement;
163
+ const f = i[0], a = i[i.length - 1], d = document.activeElement;
140
164
  if (!d || !(e != null && e.contains(d))) {
141
- u.preventDefault(), l.focus();
165
+ u.preventDefault(), f.focus();
142
166
  return;
143
167
  }
144
- u.shiftKey && d === l ? (u.preventDefault(), m.focus()) : !u.shiftKey && d === m && (u.preventDefault(), l.focus());
168
+ u.shiftKey && d === f ? (u.preventDefault(), a.focus()) : !u.shiftKey && d === a && (u.preventDefault(), f.focus());
145
169
  };
146
- return document.addEventListener("keydown", n, !0), () => document.removeEventListener("keydown", n, !0);
170
+ return document.addEventListener("keydown", r, !0), () => document.removeEventListener("keydown", r, !0);
147
171
  }, [t, e]);
148
172
  }
149
- function B({
173
+ function D({
150
174
  open: t,
151
175
  onEscape: e,
152
- modal: r = !0,
153
- initialFocus: c = "first",
176
+ modal: n = !0,
177
+ initialFocus: s = "first",
154
178
  restoreFocus: o = !0
155
179
  }) {
156
- const [n, u] = s.useState(null), { setElement: i, isTop: l } = w(t);
157
- return R(t, l, () => e == null ? void 0 : e()), S(t && r), M(t && r && n != null, n), O({ active: t && r, container: n, initialFocus: c, restoreFocus: o }), { ref: s.useCallback(
180
+ const [r, u] = c.useState(null), { setElement: i, isTop: f } = A(t);
181
+ return R(t, f, () => e == null ? void 0 : e()), C(t && n), O(t && n && r != null, r), N({ active: t && n, container: r, initialFocus: s, restoreFocus: o }), { ref: c.useCallback(
158
182
  (d) => {
159
183
  u(d), i(d);
160
184
  },
161
185
  [i]
162
- ), element: n, top: l };
186
+ ), element: r, top: f };
163
187
  }
164
- const D = {
188
+ const K = {
165
189
  name: "useOverlay",
166
190
  props: [
167
191
  { name: "open", type: "boolean", default: null, control: "boolean" },
@@ -172,18 +196,19 @@ const D = {
172
196
  ]
173
197
  };
174
198
  export {
175
- P as Portal,
199
+ x as Portal,
176
200
  y as getFocusable,
177
201
  k as isTopOverlay,
178
- I as overlayCount,
179
- D as overlayPropsMeta,
180
- g as pushOverlay,
181
- T as removeOverlay,
202
+ B as overlayCount,
203
+ K as overlayPropsMeta,
204
+ T as pushOverlay,
205
+ w as removeOverlay,
182
206
  R as useEscapeKey,
183
- O as useFocusTrap,
184
- M as useInertBackground,
185
- B as useOverlay,
186
- w as useOverlayStack,
187
- x as useReducedMotion,
188
- S as useScrollLock
207
+ N as useFocusTrap,
208
+ O as useInertBackground,
209
+ I as useMountTransition,
210
+ D as useOverlay,
211
+ A as useOverlayStack,
212
+ v as useReducedMotion,
213
+ C as useScrollLock
189
214
  };
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ import { TimePanel as Wo, TimePicker as Xo, TimeRangePicker as Yo, timePickerPro
35
35
  import { FileUpload as or, fileUploadPropsMeta as rr } from "./core/file-upload.js";
36
36
  import { D as tr, a as sr, b as pr, c as ir, d as Pr, F as mr, N as lr, P as nr, T as dr, e as Mr, f as gr, g as cr } from "./chunks/data-table-toolbar-B-5J2Ozl.js";
37
37
  import { Link as fr, NavLink as xr, Navigate as Tr, Outlet as Sr, Route as br, Routes as hr } from "react-router-dom";
38
- import { A as Fr, a as Rr, b as kr, c as yr, C as Ar, F as vr, R as Ir, S as Cr, d as wr, e as Br, f as Nr, g as Er, h as Or, i as Lr, r as Kr, s as Ur, j as Gr, k as _r, u as Hr } from "./chunks/auth-shell-BudxZ4__.js";
38
+ import { A as Fr, a as Rr, b as kr, c as yr, C as Ar, F as vr, R as Ir, S as Cr, d as wr, e as Br, f as Nr, g as Er, h as Or, i as Lr, r as Kr, s as Ur, j as Gr, k as _r, u as Hr } from "./chunks/auth-shell-DBKlNZtl.js";
39
39
  import { AdminSetup as jr, EmptyState as qr, ErrorPage as zr, ForgotPasswordPage as Jr, LoginPage as Qr, LogoutPage as Wr, NotFoundPage as Xr, OtpPage as Yr, PagesRegistry as Zr, ProfilePage as $r, RegisterPage as ea, ResetPasswordPage as oa, SettingsPage as ra, adminSetupPropsMeta as aa, emptyStatePropsMeta as ta, errorPagePropsMeta as sa, forgotPasswordPagePropsMeta as pa, loginPagePropsMeta as ia, logoutPagePropsMeta as Pa, notFoundPagePropsMeta as ma, otpPagePropsMeta as la, profilePagePropsMeta as na, registerPagePropsMeta as da, resetPasswordPagePropsMeta as Ma, settingsPagePropsMeta as ga } from "./pages.js";
40
40
  import { PRUI_BREAKPOINTS as ua, PRUI_DESIGN_TOKENS as fa, PRUI_THEMES as xa, PRUI_TOKENS as Ta, applyTheme as Sa, applyThemeTokens as ba, clearAppliedTokens as ha, defineTheme as Da, isDarkTheme as Fa, isLightTheme as Ra, listThemes as ka, nextTheme as ya, readPersistedTheme as Aa, resolveThemeName as va, restoreAppliedTokens as Ia, themeMeta as Ca, themeMode as wa, useBreakpointAtLeast as Ba } from "./theme.js";
41
41
  import { PruiProvider as Ea, defaultDictionary as Oa, getPruiDictionary as La, resetPruiDictionary as Ka, setPruiDictionary as Ua, usePruiI18n as Ga } from "./i18n.js";
package/dist/prui.css CHANGED
@@ -172,6 +172,7 @@ body.modal-open { overflow: hidden; }
172
172
  .prui-toast,
173
173
  .prui-skeleton,
174
174
  .prui-progress-indeterminate,
175
+ .prui-shell,
175
176
  .prui-anim-fade,
176
177
  .prui-anim-scale,
177
178
  .prui-anim-slide {
@@ -236,6 +237,8 @@ body.modal-open { overflow: hidden; }
236
237
  display: grid;
237
238
  height: 100dvh;
238
239
  overflow: hidden;
240
+ /* the rail width eases between full and collapsed (kill switch below) */
241
+ transition: grid-template-columns var(--prui-duration-base) var(--prui-ease-out);
239
242
  grid-template-columns: var(--prui-rail-width, 64px) minmax(0, 1fr);
240
243
  grid-template-areas:
241
244
  "header header"
@@ -256,6 +259,8 @@ body.modal-open { overflow: hidden; }
256
259
  display: grid;
257
260
  height: 100dvh;
258
261
  overflow: hidden;
262
+ /* sidebar <-> rail width eases on collapse (kill switch above disables) */
263
+ transition: grid-template-columns var(--prui-duration-base) var(--prui-ease-out);
259
264
  grid-template-columns: var(--prui-shell-sidebar, var(--prui-sidebar-width, 260px)) minmax(0, 1fr);
260
265
  grid-template-rows: auto minmax(0, 1fr);
261
266
  grid-template-areas:
@@ -157,6 +157,7 @@ body.modal-open { overflow: hidden; }
157
157
  .prui-toast,
158
158
  .prui-skeleton,
159
159
  .prui-progress-indeterminate,
160
+ .prui-shell,
160
161
  .prui-anim-fade,
161
162
  .prui-anim-scale,
162
163
  .prui-anim-slide {
@@ -221,6 +222,8 @@ body.modal-open { overflow: hidden; }
221
222
  display: grid;
222
223
  height: 100dvh;
223
224
  overflow: hidden;
225
+ /* the rail width eases between full and collapsed (kill switch below) */
226
+ transition: grid-template-columns var(--prui-duration-base) var(--prui-ease-out);
224
227
  grid-template-columns: var(--prui-rail-width, 64px) minmax(0, 1fr);
225
228
  grid-template-areas:
226
229
  "header header"
@@ -241,6 +244,8 @@ body.modal-open { overflow: hidden; }
241
244
  display: grid;
242
245
  height: 100dvh;
243
246
  overflow: hidden;
247
+ /* sidebar <-> rail width eases on collapse (kill switch above disables) */
248
+ transition: grid-template-columns var(--prui-duration-base) var(--prui-ease-out);
244
249
  grid-template-columns: var(--prui-shell-sidebar, var(--prui-sidebar-width, 260px)) minmax(0, 1fr);
245
250
  grid-template-rows: auto minmax(0, 1fr);
246
251
  grid-template-areas:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skiddph/prui",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "description": "PRUI component system: primitives, app-layer super-components, pages, and themes",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",