@mt-gloss/ui 0.1.88 → 0.1.90
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/{COMMITS-CoGFzpf4.js → COMMITS-qn5rIipN.js} +101 -68
- package/{Expandable-D4ZdxEEQ.js → Expandable-BcmIxWR8.js} +125 -101
- package/catalog.js +2 -2
- package/composites-panels.js +68 -62
- package/index.js +3 -3
- package/lib/composites/panels/PanelChrome.d.ts +5 -1
- package/lib/composites/panels/PanelMount.d.ts +7 -0
- package/lib/composites/panels/hooks/useReducedMotionPanel.d.ts +6 -0
- package/lib/composites/panels/index.d.ts +4 -0
- package/lib/composites/panels/utils/positionKey.d.ts +2 -0
- package/package.json +1 -1
- package/ui.css +1 -1
package/composites-panels.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { C as
|
|
3
|
-
import { jsxs as c, jsx as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */ c("div", { "data-shell": "settings", "aria-hidden": !
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
1
|
+
import { a as r, u, f as p, c as f } from "./COMMITS-qn5rIipN.js";
|
|
2
|
+
import { C as H, b as N, P as O, e as w, i as A, r as z, d as M, g as D } from "./COMMITS-qn5rIipN.js";
|
|
3
|
+
import { jsxs as c, jsx as a, Fragment as m } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as i, useRef as P, useLayoutEffect as h, useCallback as v } from "react";
|
|
5
|
+
function _({ isOpen: e }) {
|
|
6
|
+
const t = r()?.state.activeTrigger, o = t?.kind === "card-overflow" ? t.cardId : null;
|
|
7
|
+
return /* @__PURE__ */ c("div", { "data-shell": "settings", "aria-hidden": !e, children: [
|
|
8
|
+
/* @__PURE__ */ a("p", { style: { margin: 0, fontSize: 14, color: "#495057" }, children: o ? `Settings for card: ${o}` : "Settings" }),
|
|
9
|
+
/* @__PURE__ */ a("p", { style: { margin: "8px 0 0", fontSize: 12, color: "#adb5bd" }, children: "Configuration options coming soon." })
|
|
10
10
|
] });
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const y = {
|
|
13
13
|
position: "fixed",
|
|
14
14
|
inset: 0,
|
|
15
15
|
pointerEvents: "none",
|
|
16
16
|
zIndex: 55
|
|
17
|
-
},
|
|
17
|
+
}, g = {
|
|
18
18
|
position: "absolute",
|
|
19
19
|
inset: 0,
|
|
20
20
|
zIndex: 1,
|
|
@@ -23,54 +23,54 @@ const g = {
|
|
|
23
23
|
pointerEvents: "none",
|
|
24
24
|
background: "rgba(0, 0, 0, 0.04)"
|
|
25
25
|
};
|
|
26
|
-
function
|
|
27
|
-
const { state:
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
function
|
|
31
|
-
d.key === "Escape" &&
|
|
26
|
+
function b() {
|
|
27
|
+
const { state: e, dispatch: n, getCloseLog: t } = u();
|
|
28
|
+
i(() => {
|
|
29
|
+
if (e.activePanelId == null) return;
|
|
30
|
+
function l(d) {
|
|
31
|
+
d.key === "Escape" && n({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
32
32
|
}
|
|
33
|
-
return document.addEventListener("keydown",
|
|
34
|
-
}, [
|
|
35
|
-
const o =
|
|
33
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
34
|
+
}, [e.activePanelId, n]);
|
|
35
|
+
const o = P(e);
|
|
36
36
|
h(() => {
|
|
37
|
-
o.current =
|
|
38
|
-
}),
|
|
37
|
+
o.current = e;
|
|
38
|
+
}), i(() => {
|
|
39
39
|
if (process.env.NODE_ENV === "production") return;
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
dispatch:
|
|
40
|
+
const l = window;
|
|
41
|
+
return l.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), l.__panelsHostHandle = {
|
|
42
|
+
dispatch: n,
|
|
43
43
|
getState: () => o.current,
|
|
44
|
-
getCloseLog:
|
|
44
|
+
getCloseLog: t
|
|
45
45
|
}, () => {
|
|
46
|
-
|
|
46
|
+
l.__panelsHostHandle?.dispatch === n && delete window.__panelsHostHandle;
|
|
47
47
|
};
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
return /* @__PURE__ */
|
|
48
|
+
}, [n, t]);
|
|
49
|
+
const s = v(() => {
|
|
50
|
+
n({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
51
|
+
}, [n]);
|
|
52
|
+
return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: y, children: e.activePanelId != null && /* @__PURE__ */ a(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
"data-panel-scrim": "true",
|
|
56
|
-
style:
|
|
57
|
-
onClick:
|
|
56
|
+
style: g,
|
|
57
|
+
onClick: s
|
|
58
58
|
}
|
|
59
59
|
) });
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const { state:
|
|
65
|
-
if (
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
61
|
+
function x({ panelComponents: e }) {
|
|
62
|
+
const n = r();
|
|
63
|
+
if (n == null) return null;
|
|
64
|
+
const { state: t, dispatch: o } = n;
|
|
65
|
+
if (t.activePanelId == null) return null;
|
|
66
|
+
const s = e[t.activePanelId];
|
|
67
|
+
if (s == null)
|
|
68
68
|
return process.env.NODE_ENV !== "production" && console.error(
|
|
69
69
|
"[panels] No panel component registered for activePanelId:",
|
|
70
|
-
|
|
70
|
+
t.activePanelId
|
|
71
71
|
), null;
|
|
72
|
-
const
|
|
73
|
-
/* @__PURE__ */
|
|
72
|
+
const l = t.activePanelId === "settings" ? /* @__PURE__ */ c(m, { children: [
|
|
73
|
+
/* @__PURE__ */ a(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
76
76
|
id: "settings-cancel",
|
|
@@ -80,7 +80,7 @@ function b({ panelComponents: t }) {
|
|
|
80
80
|
children: "Cancel"
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ a(
|
|
84
84
|
"button",
|
|
85
85
|
{
|
|
86
86
|
id: "settings-apply",
|
|
@@ -91,28 +91,34 @@ function b({ panelComponents: t }) {
|
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
] }) : null;
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
return /* @__PURE__ */ a(p, { isOpen: !0, children: /* @__PURE__ */ a(
|
|
95
|
+
f,
|
|
96
96
|
{
|
|
97
97
|
isOpen: !0,
|
|
98
98
|
onClose: () => o({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
99
|
-
footer:
|
|
100
|
-
children: /* @__PURE__ */ s
|
|
99
|
+
footer: l,
|
|
100
|
+
children: /* @__PURE__ */ a(s, { isOpen: !0 })
|
|
101
101
|
}
|
|
102
|
-
);
|
|
102
|
+
) });
|
|
103
|
+
}
|
|
104
|
+
function k(e) {
|
|
105
|
+
return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
|
|
103
106
|
}
|
|
104
107
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
H as COMMITS,
|
|
109
|
+
f as PanelChrome,
|
|
110
|
+
N as PanelHost,
|
|
111
|
+
b as PanelHostShell,
|
|
112
|
+
p as PanelMount,
|
|
113
|
+
O as PanelProvider,
|
|
114
|
+
x as PanelSlot,
|
|
115
|
+
_ as SettingsShell,
|
|
116
|
+
w as deriveSurfaceState,
|
|
117
|
+
A as initialState,
|
|
118
|
+
k as positionKey,
|
|
119
|
+
z as reducer,
|
|
115
120
|
u as usePanelContext,
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
r as usePanelContextOptional,
|
|
122
|
+
M as usePanelCoordinator,
|
|
123
|
+
D as useReducedMotionPanel
|
|
118
124
|
};
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { u as Ze, C as qe } from "./Expandable-
|
|
2
|
-
import { Q as Sr, V as kr, T as Dr, U as xr, a5 as Tr, b8 as Rr, aB as Mr, aj as Pr, $ as Ir, ap as Er, N as Ar, aa as Fr, bo as Or, P as Lr, B as $r, a as zr, A as Br, K as Kr, bj as Gr, J as Hr, L as Wr, E as Vr, D as jr, H as Ur, F as Yr, by as Zr, b as qr, c as Qr, O as Xr, q as Jr, af as es, aP as ts, A as as, K as ns, J as rs, L as ss, E as is, D as os, H as ls, F as cs, b1 as ds, b4 as us, b3 as ms, b2 as gs, b5 as ps, aE as hs, a7 as fs, a6 as bs, as as vs, m as ys, o as ws, aH as _s, ad as Cs, ba as Ns, ab as Ss, bp as ks, _ as Ds, bI as xs, bH as Ts, bJ as Rs, ar as Ms, aS as Ps, bc as Is, bN as Es, bw as As, p as Fs, ao as Os, bC as Ls, bt as $s, a2 as zs, at as Bs, a4 as Ks, bB as Gs, bS as Hs, G as Ws, f as Vs, ac as js, bK as Us, aV as Ys, t as Zs, x as qs, I as Qs, i as Xs, ay as Js, bO as ei, M as ti, y as ai, W as ni, Z as ri, X as si, Y as ii, au as oi, bi as li, bQ as ci, bM as di, aq as ui, w as mi, bq as gi, aU as pi, al as hi, aM as fi, ai as bi, an as vi, aw as yi, aT as wi, ae as _i, av as Ci, e as Ni, R as Si, l as ki, r as Di, aJ as xi, bz as Ti, bA as Ri, ak as Mi, ag as Pi, j as Ii, z as Ei, b9 as Ai, ah as Fi, bP as Oi, be as Li, bh as $i, bf as zi, bg as Bi, k as Ki, bb as Gi, bn as Hi, S as Wi, bl as Vi, bm as ji, ax as Ui, bd as Yi, bR as Zi, am as qi, v as Qi, bL as Xi, n as Ji, h as eo, s as to, a0 as ao, a1 as no, a9 as ro, bk as so, bx as io, bE as oo, aC as lo, aD as co, a8 as uo, aQ as mo, aR as go, aF as po, aG as ho, aI as fo, aX as bo, aY as vo, br as yo, bG as wo, bF as _o, a_ as Co, a$ as No, az as So, aA as ko, b7 as Do, b6 as xo, b0 as To, aN as Ro, aO as Mo, aZ as Po, aK as Io, aL as Eo, d as Ao, bD as Fo, bs as Oo, bu as Lo, bv as $o, aW as zo, a3 as Bo, bT as Ko, g as Go } from "./Expandable-
|
|
1
|
+
import { u as Ze, C as qe } from "./Expandable-BcmIxWR8.js";
|
|
2
|
+
import { Q as Sr, V as kr, T as Dr, U as xr, a5 as Tr, b8 as Rr, aB as Mr, aj as Pr, $ as Ir, ap as Er, N as Ar, aa as Fr, bo as Or, P as Lr, B as $r, a as zr, A as Br, K as Kr, bj as Gr, J as Hr, L as Wr, E as Vr, D as jr, H as Ur, F as Yr, by as Zr, b as qr, c as Qr, O as Xr, q as Jr, af as es, aP as ts, A as as, K as ns, J as rs, L as ss, E as is, D as os, H as ls, F as cs, b1 as ds, b4 as us, b3 as ms, b2 as gs, b5 as ps, aE as hs, a7 as fs, a6 as bs, as as vs, m as ys, o as ws, aH as _s, ad as Cs, ba as Ns, ab as Ss, bp as ks, _ as Ds, bI as xs, bH as Ts, bJ as Rs, ar as Ms, aS as Ps, bc as Is, bN as Es, bw as As, p as Fs, ao as Os, bC as Ls, bt as $s, a2 as zs, at as Bs, a4 as Ks, bB as Gs, bS as Hs, G as Ws, f as Vs, ac as js, bK as Us, aV as Ys, t as Zs, x as qs, I as Qs, i as Xs, ay as Js, bO as ei, M as ti, y as ai, W as ni, Z as ri, X as si, Y as ii, au as oi, bi as li, bQ as ci, bM as di, aq as ui, w as mi, bq as gi, aU as pi, al as hi, aM as fi, ai as bi, an as vi, aw as yi, aT as wi, ae as _i, av as Ci, e as Ni, R as Si, l as ki, r as Di, aJ as xi, bz as Ti, bA as Ri, ak as Mi, ag as Pi, j as Ii, z as Ei, b9 as Ai, ah as Fi, bP as Oi, be as Li, bh as $i, bf as zi, bg as Bi, k as Ki, bb as Gi, bn as Hi, S as Wi, bl as Vi, bm as ji, ax as Ui, bd as Yi, bR as Zi, am as qi, v as Qi, bL as Xi, n as Ji, h as eo, s as to, a0 as ao, a1 as no, a9 as ro, bk as so, bx as io, bE as oo, aC as lo, aD as co, a8 as uo, aQ as mo, aR as go, aF as po, aG as ho, aI as fo, aX as bo, aY as vo, br as yo, bG as wo, bF as _o, a_ as Co, a$ as No, az as So, aA as ko, b7 as Do, b6 as xo, b0 as To, aN as Ro, aO as Mo, aZ as Po, aK as Io, aL as Eo, d as Ao, bD as Fo, bs as Oo, bu as Lo, bv as $o, aW as zo, a3 as Bo, bT as Ko, g as Go } from "./Expandable-BcmIxWR8.js";
|
|
3
3
|
import { jsxs as w, jsx as r, Fragment as $ } from "react/jsx-runtime";
|
|
4
4
|
import * as B from "react";
|
|
5
5
|
import F, { useRef as P, useEffect as A, useState as E, useCallback as C, useId as Qe, forwardRef as Xe, useMemo as re, createContext as Je, useContext as et } from "react";
|
|
6
6
|
import { motion as G, useMotionValue as tt, AnimatePresence as at, useDragControls as nt } from "framer-motion";
|
|
7
7
|
import { B as rt, a as X, b as ce, U as fe } from "./UIContext-DP6JGCto.js";
|
|
8
8
|
import { c as Wo, u as Vo } from "./UIContext-DP6JGCto.js";
|
|
9
|
-
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-
|
|
9
|
+
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-qn5rIipN.js";
|
|
10
10
|
import { createPortal as st } from "react-dom";
|
|
11
11
|
import { DEFAULT_MARKET_PRESETS as rl, DEFAULT_PINNED as sl, PERIOD_OPTIONS as il, ROLLING_OPTIONS as ol, TODAY_PRESET as ll, findPreset as cl, formatDateRange as dl, formatMarketDates as ul, formatTrend as ml, formatValue as gl, generateMarketId as pl, getAllPresets as hl, getDateRangeForPreset as fl, getPresetLabel as bl, isInRange as vl, isMarketActive as yl, isSameDay as wl, normalizePresetId as _l, toUppercasePresetId as Cl } from "@mt-gloss/utils";
|
|
12
12
|
import it from "@mui/icons-material/AccessTime";
|
|
@@ -2,8 +2,12 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface PanelChromeProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
onClose: () => void;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated No-op since Phase 11.5 P3a. PanelMount owns all enter/exit motion.
|
|
7
|
+
* Kept for back-compat with P1/P2 call sites; has no rendering effect.
|
|
8
|
+
*/
|
|
5
9
|
isOpen?: boolean;
|
|
6
10
|
/** P2 — optional footer slot. Notification-center keeps null (no footer). */
|
|
7
11
|
footer?: ReactNode;
|
|
8
12
|
}
|
|
9
|
-
export declare function PanelChrome({ children, onClose,
|
|
13
|
+
export declare function PanelChrome({ children, onClose, footer }: PanelChromeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PanelMountProps {
|
|
3
|
+
/** Whether the panel is open. Maps to .has-panel class toggle. */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function PanelMount({ isOpen, children }: PanelMountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `true` when the user's system preference is `prefers-reduced-motion: reduce`.
|
|
3
|
+
* SSR-safe (returns false during server render).
|
|
4
|
+
* Reactive — re-renders the host component when the system pref changes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useReducedMotionPanel(): boolean;
|
|
@@ -17,6 +17,10 @@ export type { PanelHostProps, PanelShellProps } from './PanelHost';
|
|
|
17
17
|
export type { PanelSlotProps } from './PanelSlot';
|
|
18
18
|
export type { PanelProviderProps } from './PanelProvider';
|
|
19
19
|
export type { PanelChromeProps } from './PanelChrome';
|
|
20
|
+
export { positionKey } from './utils/positionKey';
|
|
21
|
+
export { useReducedMotionPanel } from './hooks/useReducedMotionPanel';
|
|
22
|
+
export { PanelMount } from './PanelMount';
|
|
23
|
+
export type { PanelMountProps } from './PanelMount';
|
|
20
24
|
export { usePanelCoordinator } from './hooks/usePanelCoordinator';
|
|
21
25
|
export type { UsePanelCoordinatorReturn } from './hooks/usePanelCoordinator';
|
|
22
26
|
export { reducer, initialState } from './coordinator/coordinator';
|