@marimo-team/islands 0.25.2-dev91 → 0.25.2-dev92
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/{ErrorBoundary-DzYre0XM.js → ErrorBoundary-D34mViAO.js} +1 -1
- package/dist/{code-visibility-BrGBr50V.js → code-visibility-BOSA33DJ.js} +1 -1
- package/dist/{common-Dzc60302.js → common-CtZ-MrLU.js} +1 -1
- package/dist/{data-grid-overlay-editor-BWXtsJqJ.js → data-grid-overlay-editor-CDXX04Sa.js} +1 -1
- package/dist/{feedback-button-DfcvEzG_.js → feedback-button-D-DUxiaq.js} +2 -2
- package/dist/{glide-data-editor-DPRKOYOy.js → glide-data-editor-D9x_3f3L.js} +3 -3
- package/dist/{globals-YaxEeXdo.js → globals-DRPTlerj.js} +1 -1
- package/dist/main.js +117 -118
- package/dist/{number-overlay-editor-CrM5W4xK.js → number-overlay-editor-BO0iCk79.js} +1 -1
- package/dist/{reveal-component-C_8eQYsH.js → reveal-component-6XP1cUF1.js} +2 -2
- package/package.json +1 -1
- package/src/components/data-table/charts/__tests__/slider-field.test.tsx +54 -0
- package/src/components/data-table/charts/components/form-fields.tsx +3 -1
- package/src/components/ui/__tests__/slider.test.tsx +7 -0
- package/src/components/ui/slider.tsx +2 -0
- package/src/plugins/impl/SliderPlugin.tsx +4 -0
- package/src/plugins/impl/__test__/slider-labels.test.tsx +136 -0
|
@@ -135,7 +135,7 @@ function F(e) {
|
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
137
|
//#region src/components/editor/boundary/ErrorBoundary.tsx
|
|
138
|
-
var I = (0, T.lazy)(() => import("./feedback-button-
|
|
138
|
+
var I = (0, T.lazy)(() => import("./feedback-button-D-DUxiaq.js").then((e) => ({ default: e.FeedbackModal }))), L = (e) => {
|
|
139
139
|
let t = (0, w.c)(2), n;
|
|
140
140
|
return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, j.jsx)(O, {
|
|
141
141
|
FallbackComponent: R,
|
|
@@ -18,7 +18,7 @@ function x() {
|
|
|
18
18
|
return e.warn("Failed to get version from mount config"), null;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
var S = x() || "0.25.2-
|
|
21
|
+
var S = x() || "0.25.2-dev92", C = u(S), w = u(!0);
|
|
22
22
|
u(null);
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/core/wasm/state.ts
|
|
@@ -12,7 +12,7 @@ import { t as ct } from "./check-CNP79M3A.js";
|
|
|
12
12
|
import { A as lt, C as ut, M as dt, O as ft, S as pt, _ as mt, b as ht, c as gt, d as _t, g as vt, h as yt, i as bt, l as xt, m as St, n as Ct, p as wt, s as Tt, t as Et, u as Dt, v as Ot, y as kt } from "./select-Bs-nmvm6.js";
|
|
13
13
|
import { $ as At, $t as jt, A as Mt, At as Nt, B as Pt, Bt as Ft, Ct as It, D as Lt, Dt as Rt, E as zt, Et as Bt, F as Vt, Ft as Ht, G as Ut, Gt as Wt, H as Gt, Ht as Kt, I as qt, It as Jt, J as Yt, Jt as Xt, Kt as Zt, L as Qt, Lt as $t, M as en, Mt as tn, N as nn, Nt as rn, O as an, Ot as on, P as sn, Pt as cn, Q as ln, Qt as un, R as dn, Rt as fn, S as pn, St as mn, T as hn, Tt as gn, U as _n, Ut as vn, V as yn, Vt as bn, W as xn, Wt as Sn, X as Cn, Xt as wn, Y as Tn, Yt as En, Z as Dn, Zt as On, _ as kn, _n as An, _t as jn, a as Mn, at as Nn, b as Pn, bt as Fn, cn as In, ct as Ln, d as Rn, dn as zn, dt as Bn, et as Vn, f as Hn, fn as Un, ft as Wn, gn as Gn, gt as Kn, h as qn, hn as Jn, ht as Yn, i as Xn, in as Zn, it as Qn, j as $n, jt as er, k as tr, kt as nr, l as rr, lt as ir, mn as ar, mt as or, n as sr, nn as cr, nt as lr, o as ur, on as dr, ot as fr, pn as pr, pt as mr, qt as hr, rn as gr, rt as _r, s as vr, sn as yr, st as br, t as xr, tn as Sr, tt as Cr, u as wr, un as Tr, vn as Er, vt as Dr, w as Or, wt as kr, x as Ar, xt as jr, y as Mr, yt as Nr, z as Pr, zt as Fr } from "./dropdown-menu-Cz4TdOJh.js";
|
|
14
14
|
import { C as Ir, a as Lr, b as Rr, c as zr, d as Br, i as Vr, n as Hr, o as Ur, p as Wr, r as Gr, s as Kr, t as qr, x as Jr } from "./toDate-vEi5kTfY.js";
|
|
15
|
-
import { n as Yr, t as Xr } from "./ErrorBoundary-
|
|
15
|
+
import { n as Yr, t as Xr } from "./ErrorBoundary-D34mViAO.js";
|
|
16
16
|
import { t as Zr } from "./clsx-CoeGtWvn.js";
|
|
17
17
|
import { t as Qr } from "./react-dom-BUgJ-ab_.js";
|
|
18
18
|
import { t as $r } from "./jsx-runtime-DgDPJV9S.js";
|
|
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
|
2
2
|
import { t } from "./react-ofJbxM4x.js";
|
|
3
3
|
import { t as n } from "./react-dom-BUgJ-ab_.js";
|
|
4
4
|
import { c as r, l as i, u as a } from "./data-grid-types-BucVmDDp.js";
|
|
5
|
-
import { a as o, i as s, n as c, r as l } from "./glide-data-editor-
|
|
5
|
+
import { a as o, i as s, n as c, r as l } from "./glide-data-editor-D9x_3f3L.js";
|
|
6
6
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
|
|
7
7
|
var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
|
|
8
8
|
name: "DataGridOverlayEditorStyle",
|
|
@@ -5,12 +5,12 @@ import { t as i } from "./compiler-runtime-Cj8ZWiNS.js";
|
|
|
5
5
|
import { t as a } from "./copy-icon-BY7jgcaV.js";
|
|
6
6
|
import { Ct as o, Ft as s, H as c, L as l, Lt as u, V as d, d as f, un as p } from "./cells-DZi0ioak.js";
|
|
7
7
|
import { b as m } from "./select-Bs-nmvm6.js";
|
|
8
|
-
import { n as h, t as ee } from "./globals-
|
|
8
|
+
import { n as h, t as ee } from "./globals-DRPTlerj.js";
|
|
9
9
|
import { t as g } from "./jsx-runtime-DgDPJV9S.js";
|
|
10
10
|
import { C as _, _ as te, i as v } from "./useTheme-BwSgeAFb.js";
|
|
11
11
|
import { a as ne, i as re, n as ie, r as ae } from "./dialog-CmExhUDI.js";
|
|
12
12
|
import { t as oe } from "./useAsyncData-rkAlR_vh.js";
|
|
13
|
-
import { t as se } from "./code-visibility-
|
|
13
|
+
import { t as se } from "./code-visibility-BOSA33DJ.js";
|
|
14
14
|
import { i as ce, n as le } from "./error-entries-BovkFYNy.js";
|
|
15
15
|
//#region src/components/ui/skeleton.tsx
|
|
16
16
|
var y = /* @__PURE__ */ e(r(), 1), b = i(), x = g(), ue = (e) => {
|
|
@@ -6,7 +6,7 @@ import { i as s, n as c, r as l } from "./copy-icon-BY7jgcaV.js";
|
|
|
6
6
|
import { C as u, c as d, i as f, n as p, s as m, t as h, x as g } from "./select-Bs-nmvm6.js";
|
|
7
7
|
import { d as _, h as v, i as y, l as b, n as x, o as S, s as C, t as w, u as T } from "./dropdown-menu-Cz4TdOJh.js";
|
|
8
8
|
import { c as E, d as D, l as O, n as k, o as A, s as ee, t as j, u as te } from "./glide-utils-BVJ4fkxX.js";
|
|
9
|
-
import { n as ne, t as re } from "./ErrorBoundary-
|
|
9
|
+
import { n as ne, t as re } from "./ErrorBoundary-D34mViAO.js";
|
|
10
10
|
import { t as M } from "./react-dom-BUgJ-ab_.js";
|
|
11
11
|
import { t as N } from "./jsx-runtime-DgDPJV9S.js";
|
|
12
12
|
import { t as ie } from "./label-DQO1jFjf.js";
|
|
@@ -7062,7 +7062,7 @@ function rs(e, t, n, r, i) {
|
|
|
7062
7062
|
}
|
|
7063
7063
|
//#endregion
|
|
7064
7064
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
|
|
7065
|
-
var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-
|
|
7065
|
+
var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-CDXX04Sa.js")), ss = 0;
|
|
7066
7066
|
function cs(e) {
|
|
7067
7067
|
return (0, is.default)((0, as.default)((0, as.default)(e).filter((e) => e.span !== void 0).map((e) => (0, Za.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
|
|
7068
7068
|
}
|
|
@@ -9293,7 +9293,7 @@ function Vs(e, t, n, r, i) {
|
|
|
9293
9293
|
}
|
|
9294
9294
|
//#endregion
|
|
9295
9295
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
|
|
9296
|
-
var Hs = K.lazy(async () => await import("./number-overlay-editor-
|
|
9296
|
+
var Hs = K.lazy(async () => await import("./number-overlay-editor-BO0iCk79.js")), Us = {
|
|
9297
9297
|
getAccessibilityString: (e) => e.data?.toString() ?? "",
|
|
9298
9298
|
kind: W.Number,
|
|
9299
9299
|
needsHover: (e) => e.hoverEffect === !0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as e } from "./tooltip-CuNWg2ay.js";
|
|
2
2
|
import { _ as t } from "./useTheme-BwSgeAFb.js";
|
|
3
|
-
import { r as n } from "./code-visibility-
|
|
3
|
+
import { r as n } from "./code-visibility-BOSA33DJ.js";
|
|
4
4
|
var r = e("triangle-alert", [
|
|
5
5
|
["path", {
|
|
6
6
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
package/dist/main.js
CHANGED
|
@@ -7,7 +7,7 @@ import { C as w, F as T, G as E, I as D, J as O, K as k, L as A, P as j, R as M,
|
|
|
7
7
|
import { a as oe, d as se, f as ce, h as V, i as le, n as ue, o as de, r as fe, t as pe } from "./tooltip-CuNWg2ay.js";
|
|
8
8
|
import { $ as me, $t as he, B as ge, Bt as _e, C as ve, Ct as ye, D as be, Dt as xe, Et as Se, F as Ce, G as we, Gt as Te, Ht as Ee, I as De, J as Oe, Jt as ke, Kt as Ae, L as je, O as Me, Ot as Ne, P as Pe, Pt as Fe, Q as Ie, Qt as Le, Rt as Re, S as ze, St as Be, T as Ve, Tt as He, U as Ue, W as We, Wt as Ge, bt as Ke, c as qe, cn as Je, ct as Ye, d as Xe, dn as Ze, dt as Qe, en as $e, f as et, fn as tt, ft as nt, g as rt, gt as it, h as at, hn as ot, k as st, l as ct, ln as lt, m as ut, mn as dt, n as ft, o as pt, on as mt, ot as ht, p as gt, q as _t, qt as vt, r as yt, rn as bt, rt as xt, sn as St, st as Ct, tn as wt, u as Tt, v as Et, w as Dt, wt as Ot, zt as kt } from "./cells-DZi0ioak.js";
|
|
9
9
|
import { D as At, E as jt, O as Mt, S as Nt, T as Pt, _ as Ft, a as It, c as Lt, d as Rt, f as zt, g as Bt, h as Vt, i as Ht, l as Ut, m as Wt, n as Gt, o as Kt, p as qt, r as Jt, s as Yt, t as Xt, u as Zt, v as Qt, w as $t, x as en, y as tn } from "./spec-DVsoMvYT.js";
|
|
10
|
-
import { $t as nn, A as rn, At as an, B as on, Bt as sn, C as cn, Ct as ln, D as un, Dt as dn, E as fn, Et as pn, F as mn, Ft as hn, G as gn, Gt as _n, H as vn, Ht as yn, I as bn, It as xn, J as Sn, Jt as Cn, K as wn, Kt as Tn, L as En, Lt as Dn, M as On, Mt as kn, N as An, Nt as jn, O as Mn, Ot as Nn, P as Pn, Pt as Fn, Qt as In, R as Ln, Rt as Rn, S as zn, St as Bn, T as Vn, Tt as Hn, U as Un, Ut as Wn, V as Gn, Vt as Kn, W as qn, Wt as Jn, X as Yn, Xt as Xn, Y as Zn, Yt as Qn, Zt as $n, _ as er, _t as tr, an as nr, at as rr, b as ir, c as ar, cn as or, ct as sr, d as cr, dn as lr, dt as ur, en as dr, et as fr, f as pr, fn as mr, ft as hr, g as gr, gt as _r, h as vr, hn as yr, ht as br, in as xr, it as Sr, j as Cr, jt as wr, k as Tr, kt as Er, ln as Dr, lt as Or, m as kr, mn as Ar, mt as jr, nn as Mr, nt as Nr, ot as Pr, p as Fr, pn as Ir, pt as Lr, q as Rr, qt as zr, r as Br, rn as Vr, rt as Hr, sn as Ur, st as Wr, t as Gr, tn as Kr, tt as qr, u as Jr, un as Yr, ut as Xr, v as Zr, vt as Qr, w as $r, wt as ei, x as ti, y as ni, yt as ri, z as ii, zt as ai } from "./common-
|
|
10
|
+
import { $t as nn, A as rn, At as an, B as on, Bt as sn, C as cn, Ct as ln, D as un, Dt as dn, E as fn, Et as pn, F as mn, Ft as hn, G as gn, Gt as _n, H as vn, Ht as yn, I as bn, It as xn, J as Sn, Jt as Cn, K as wn, Kt as Tn, L as En, Lt as Dn, M as On, Mt as kn, N as An, Nt as jn, O as Mn, Ot as Nn, P as Pn, Pt as Fn, Qt as In, R as Ln, Rt as Rn, S as zn, St as Bn, T as Vn, Tt as Hn, U as Un, Ut as Wn, V as Gn, Vt as Kn, W as qn, Wt as Jn, X as Yn, Xt as Xn, Y as Zn, Yt as Qn, Zt as $n, _ as er, _t as tr, an as nr, at as rr, b as ir, c as ar, cn as or, ct as sr, d as cr, dn as lr, dt as ur, en as dr, et as fr, f as pr, fn as mr, ft as hr, g as gr, gt as _r, h as vr, hn as yr, ht as br, in as xr, it as Sr, j as Cr, jt as wr, k as Tr, kt as Er, ln as Dr, lt as Or, m as kr, mn as Ar, mt as jr, nn as Mr, nt as Nr, ot as Pr, p as Fr, pn as Ir, pt as Lr, q as Rr, qt as zr, r as Br, rn as Vr, rt as Hr, sn as Ur, st as Wr, t as Gr, tn as Kr, tt as qr, u as Jr, un as Yr, ut as Xr, v as Zr, vt as Qr, w as $r, wt as ei, x as ti, y as ni, yt as ri, z as ii, zt as ai } from "./common-CtZ-MrLU.js";
|
|
11
11
|
import { c as oi, i as si, n as ci, o as li, t as ui } from "./useLifecycle-B68iY077.js";
|
|
12
12
|
import { t as di } from "./check-CNP79M3A.js";
|
|
13
13
|
import { A as fi, C as pi, D as mi, E as hi, M as gi, O as _i, S as vi, T as yi, a as bi, b as xi, c as Si, i as Ci, k as wi, l as Ti, n as Ei, o as Di, r as Oi, s as ki, t as Ai, w as ji, x as Mi } from "./select-Bs-nmvm6.js";
|
|
@@ -15,8 +15,8 @@ import { $ as Ni, C as Pi, Et as Fi, J as Ii, K as Li, R as Ri, S as zi, U as Bi
|
|
|
15
15
|
import { C as ua, S as da, T as fa, _ as pa, c as ma, d as ha, f as ga, g as _a, h as va, m as ya, u as ba, x as xa, y as Sa } from "./toDate-vEi5kTfY.js";
|
|
16
16
|
import { a as Ca, c as wa, d as Ta, f as Ea, i as Da, l as Oa, n as ka, o as Aa, r as ja, s as Ma, t as Na } from "./process-output-CUG57KRp.js";
|
|
17
17
|
import { a as Pa, c as Fa, d as Ia, i as La, l as Ra, r as za, u as Ba } from "./glide-utils-BVJ4fkxX.js";
|
|
18
|
-
import { n as Va, t as Ha } from "./ErrorBoundary-
|
|
19
|
-
import { n as Ua, t as Wa } from "./globals-
|
|
18
|
+
import { n as Va, t as Ha } from "./ErrorBoundary-D34mViAO.js";
|
|
19
|
+
import { n as Ua, t as Wa } from "./globals-DRPTlerj.js";
|
|
20
20
|
import { t as Ga } from "./react-dom-BUgJ-ab_.js";
|
|
21
21
|
import { t as Ka } from "./jsx-runtime-DgDPJV9S.js";
|
|
22
22
|
import { B as qa, C as H, Ct as Ja, D as Ya, E as Xa, F as U, G as Za, H as Qa, I as $a, L as eo, M as W, N as to, O as no, P as ro, Q as io, R as ao, S as G, St as oo, Tt as so, U as co, W as lo, Y as uo, Z as fo, _ as po, _t as mo, a as ho, b as go, bt as _o, c as vo, d as yo, f as bo, g as xo, h as So, ht as Co, i as wo, j as K, k as To, l as Eo, m as Do, n as Oo, o as ko, p as Ao, r as jo, s as Mo, u as No, ut as Po, v as Fo, vt as Io, w as Lo, wt as Ro, x as zo, xt as Bo, y as Vo, yt as Ho } from "./use-restore-focus-kmgwrL8q.js";
|
|
@@ -39,7 +39,7 @@ import { t as Ms } from "./useAsyncData-rkAlR_vh.js";
|
|
|
39
39
|
import { i as Ns, n as Ps, r as Fs } from "./formats-DhhbdyAH.js";
|
|
40
40
|
import { M as Is, N as Ls } from "./vega-loader.browser-DNST6uVf.js";
|
|
41
41
|
import { a as Rs, n as zs } from "./loader-Cm-ATtou.js";
|
|
42
|
-
import { c as Bs, d as Vs, i as Hs, l as Us, o as Ws, s as Gs, t as Ks, u as qs } from "./code-visibility-
|
|
42
|
+
import { c as Bs, d as Vs, i as Hs, l as Us, o as Ws, s as Gs, t as Ks, u as qs } from "./code-visibility-BOSA33DJ.js";
|
|
43
43
|
import { t as Js } from "./useDeepCompareMemoize-BlHFBj5_.js";
|
|
44
44
|
import { t as Ys } from "./esm-D2gTsXEV.js";
|
|
45
45
|
//#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
@@ -10514,7 +10514,7 @@ function VC(e, t) {
|
|
|
10514
10514
|
}
|
|
10515
10515
|
//#endregion
|
|
10516
10516
|
//#region src/plugins/impl/DataEditorPlugin.tsx
|
|
10517
|
-
var HC = J.lazy(() => import("./glide-data-editor-
|
|
10517
|
+
var HC = J.lazy(() => import("./glide-data-editor-D9x_3f3L.js").then((e) => e.t)), UC = wS("marimo-data-editor", { cssStyles: [qS] }).withData(W({
|
|
10518
10518
|
initialValue: W({ edits: G(W({
|
|
10519
10519
|
rowIdx: K(),
|
|
10520
10520
|
columnId: U(),
|
|
@@ -10847,50 +10847,42 @@ function dw(e) {
|
|
|
10847
10847
|
//#endregion
|
|
10848
10848
|
//#region src/components/ui/slider.tsx
|
|
10849
10849
|
var fw = J.forwardRef((e, t) => {
|
|
10850
|
-
let n = (0, X.c)(
|
|
10851
|
-
n[0] ===
|
|
10852
|
-
let [o, s] = uw(!1), { locale: l } = Jo(), u;
|
|
10853
|
-
n[4] === r ? u = n[5] : (u = c("relative flex touch-none select-none hover:cursor-pointer", "data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center", "data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center", "data-disabled:cursor-not-allowed", r), n[4] = r, n[5] = u);
|
|
10850
|
+
let n = (0, X.c)(7), { className: r, valueMap: i, ...a } = e, [o, s] = uw(!1), { locale: l } = Jo(), u;
|
|
10851
|
+
n[0] === r ? u = n[1] : (u = c("relative flex touch-none select-none hover:cursor-pointer", "data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center", "data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center", "data-disabled:cursor-not-allowed", r), n[0] = r, n[1] = u);
|
|
10854
10852
|
let d;
|
|
10855
|
-
n[
|
|
10853
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (d = c("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60", "data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full", "data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"), n[2] = d) : d = n[2];
|
|
10856
10854
|
let f;
|
|
10857
|
-
n[
|
|
10855
|
+
n[3] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Y.jsx)(Nf, {
|
|
10858
10856
|
"data-testid": "track",
|
|
10859
10857
|
className: d,
|
|
10860
10858
|
children: /* @__PURE__ */ (0, Y.jsx)(Ff, {
|
|
10861
10859
|
"data-testid": "range",
|
|
10862
10860
|
className: c("absolute bg-blue-500 dark:bg-primary", "data-[orientation=horizontal]:h-full", "data-[orientation=vertical]:w-full", "data-disabled:opacity-50")
|
|
10863
10861
|
})
|
|
10864
|
-
}), n[
|
|
10865
|
-
let p;
|
|
10866
|
-
n[
|
|
10867
|
-
asChild: !0,
|
|
10868
|
-
children: /* @__PURE__ */ (0, Y.jsx)(Hf, {
|
|
10869
|
-
"data-testid": "thumb",
|
|
10870
|
-
className: "block h-4 w-4 rounded-full shadow-xs-solid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
10871
|
-
onFocus: s.setTrue,
|
|
10872
|
-
onBlur: s.setFalse,
|
|
10873
|
-
onMouseEnter: s.setTrue,
|
|
10874
|
-
onMouseLeave: s.setFalse
|
|
10875
|
-
})
|
|
10876
|
-
}), n[8] = s.setFalse, n[9] = s.setTrue, n[10] = p) : p = n[10];
|
|
10877
|
-
let m;
|
|
10878
|
-
n[11] !== l || n[12] !== i.value || n[13] !== a ? (m = i.value != null && i.value.length === 1 && /* @__PURE__ */ (0, Y.jsx)(ue, { children: zi(a(i.value[0]), { locale: l }) }, i.value[0]), n[11] = l, n[12] = i.value, n[13] = a, n[14] = m) : m = n[14];
|
|
10879
|
-
let h;
|
|
10880
|
-
n[15] === m ? h = n[16] : (h = /* @__PURE__ */ (0, Y.jsx)(fe, { children: m }), n[15] = m, n[16] = h);
|
|
10881
|
-
let g;
|
|
10882
|
-
n[17] !== o || n[18] !== p || n[19] !== h ? (g = /* @__PURE__ */ (0, Y.jsx)(le, { children: /* @__PURE__ */ (0, Y.jsxs)(oe, {
|
|
10883
|
-
delayDuration: 0,
|
|
10884
|
-
open: o,
|
|
10885
|
-
children: [p, h]
|
|
10886
|
-
}) }), n[17] = o, n[18] = p, n[19] = h, n[20] = g) : g = n[20];
|
|
10887
|
-
let _;
|
|
10888
|
-
return n[21] !== i || n[22] !== t || n[23] !== u || n[24] !== g ? (_ = /* @__PURE__ */ (0, Y.jsxs)(Ef, {
|
|
10862
|
+
}), n[3] = f) : f = n[3];
|
|
10863
|
+
let p = fe, m = a.value != null && a.value.length === 1 && /* @__PURE__ */ (0, Y.jsx)(ue, { children: zi(i(a.value[0]), { locale: l }) }, a.value[0]), h;
|
|
10864
|
+
return n[4] !== p || n[5] !== m ? (h = /* @__PURE__ */ (0, Y.jsx)(p, { children: m }), n[4] = p, n[5] = m, n[6] = h) : h = n[6], /* @__PURE__ */ (0, Y.jsxs)(Ef, {
|
|
10889
10865
|
ref: t,
|
|
10890
10866
|
className: u,
|
|
10891
|
-
...
|
|
10892
|
-
children: [f,
|
|
10893
|
-
|
|
10867
|
+
...a,
|
|
10868
|
+
children: [f, /* @__PURE__ */ (0, Y.jsx)(le, { children: /* @__PURE__ */ (0, Y.jsxs)(oe, {
|
|
10869
|
+
delayDuration: 0,
|
|
10870
|
+
open: o,
|
|
10871
|
+
children: [/* @__PURE__ */ (0, Y.jsx)(de, {
|
|
10872
|
+
asChild: !0,
|
|
10873
|
+
children: /* @__PURE__ */ (0, Y.jsx)(Hf, {
|
|
10874
|
+
"aria-label": a["aria-label"],
|
|
10875
|
+
"aria-labelledby": a["aria-labelledby"],
|
|
10876
|
+
"data-testid": "thumb",
|
|
10877
|
+
className: "block h-4 w-4 rounded-full shadow-xs-solid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
10878
|
+
onFocus: s.setTrue,
|
|
10879
|
+
onBlur: s.setFalse,
|
|
10880
|
+
onMouseEnter: s.setTrue,
|
|
10881
|
+
onMouseLeave: s.setFalse
|
|
10882
|
+
})
|
|
10883
|
+
}), h]
|
|
10884
|
+
}) })]
|
|
10885
|
+
});
|
|
10894
10886
|
});
|
|
10895
10887
|
fw.displayName = Ef.displayName;
|
|
10896
10888
|
//#endregion
|
|
@@ -12579,39 +12571,43 @@ var kw = (e) => {
|
|
|
12579
12571
|
render: s
|
|
12580
12572
|
}), t[4] = n, t[5] = o.control, t[6] = s, t[7] = l) : l = t[7], l;
|
|
12581
12573
|
}, Ww = (e) => {
|
|
12582
|
-
let t = (0, X.c)(
|
|
12583
|
-
t[0] !== l || t[1] !== i || t[2] !== n || t[3] !== r || t[4] !==
|
|
12584
|
-
let { field: t } = e, u = t.value ?? i,
|
|
12574
|
+
let t = (0, X.c)(13), { fieldName: n, label: r, defaultValue: i, start: a, stop: o, step: s, className: l } = e, u = zp(), d = J.useId(), f;
|
|
12575
|
+
t[0] !== l || t[1] !== i || t[2] !== n || t[3] !== r || t[4] !== d || t[5] !== a || t[6] !== s || t[7] !== o ? (f = (e) => {
|
|
12576
|
+
let { field: t } = e, u = t.value ?? i, f = Number(u), p = (e) => {
|
|
12585
12577
|
typeof e == "string" && (e = Number(e)), t.onChange(e);
|
|
12586
12578
|
};
|
|
12587
12579
|
return /* @__PURE__ */ (0, Y.jsxs)(Sh, {
|
|
12588
12580
|
className: c("flex flex-row items-center gap-2 w-1/2", l),
|
|
12589
|
-
children: [/* @__PURE__ */ (0, Y.jsx)(Ch, {
|
|
12581
|
+
children: [/* @__PURE__ */ (0, Y.jsx)(Ch, {
|
|
12582
|
+
id: d,
|
|
12583
|
+
children: r
|
|
12584
|
+
}), /* @__PURE__ */ (0, Y.jsx)(wh, { children: /* @__PURE__ */ (0, Y.jsx)(fw, {
|
|
12590
12585
|
...t,
|
|
12586
|
+
"aria-labelledby": d,
|
|
12591
12587
|
id: n,
|
|
12592
12588
|
className: "relative flex items-center select-none",
|
|
12593
|
-
value: [
|
|
12589
|
+
value: [f],
|
|
12594
12590
|
min: a,
|
|
12595
12591
|
max: o,
|
|
12596
12592
|
step: s,
|
|
12597
12593
|
onValueChange: (e) => {
|
|
12598
12594
|
let [t] = e;
|
|
12599
|
-
|
|
12595
|
+
p(t);
|
|
12600
12596
|
},
|
|
12601
12597
|
onValueCommit: (e) => {
|
|
12602
12598
|
let [t] = e;
|
|
12603
|
-
|
|
12599
|
+
p(t);
|
|
12604
12600
|
},
|
|
12605
12601
|
valueMap: tT
|
|
12606
12602
|
}) })]
|
|
12607
12603
|
});
|
|
12608
|
-
}, t[0] = l, t[1] = i, t[2] = n, t[3] = r, t[4] =
|
|
12609
|
-
let
|
|
12610
|
-
return t[
|
|
12604
|
+
}, t[0] = l, t[1] = i, t[2] = n, t[3] = r, t[4] = d, t[5] = a, t[6] = s, t[7] = o, t[8] = f) : f = t[8];
|
|
12605
|
+
let p;
|
|
12606
|
+
return t[9] !== n || t[10] !== u.control || t[11] !== f ? (p = /* @__PURE__ */ (0, Y.jsx)(yh, {
|
|
12611
12607
|
control: u.control,
|
|
12612
12608
|
name: n,
|
|
12613
|
-
render:
|
|
12614
|
-
}), t[
|
|
12609
|
+
render: f
|
|
12610
|
+
}), t[9] = n, t[10] = u.control, t[11] = f, t[12] = p) : p = t[12], p;
|
|
12615
12611
|
}, Gw = (e) => {
|
|
12616
12612
|
let t = (0, X.c)(28), { fieldName: n, label: r, className: i } = e, a = zp(), o;
|
|
12617
12613
|
t[0] !== n || t[1] !== a ? (o = a.watch(n), t[0] = n, t[1] = a, t[2] = o) : o = t[2];
|
|
@@ -21353,101 +21349,104 @@ function Vj(e) {
|
|
|
21353
21349
|
};
|
|
21354
21350
|
}
|
|
21355
21351
|
var Hj = (e) => {
|
|
21356
|
-
let t = (0, X.c)(
|
|
21357
|
-
t[0] === i ? (
|
|
21358
|
-
|
|
21359
|
-
},
|
|
21360
|
-
let
|
|
21361
|
-
t[3] === l ?
|
|
21362
|
-
let
|
|
21363
|
-
t[5] !==
|
|
21364
|
-
if (
|
|
21365
|
-
let { steps: t, fractionDigits: n } =
|
|
21352
|
+
let t = (0, X.c)(67), { label: n, setValue: r, value: i, start: a, stop: o, step: s, steps: l, debounce: u, orientation: d, showValue: f, fullWidth: p, valueMap: m, includeInput: h, disabled: g } = e, _ = (0, J.useId)(), v = (0, J.useId)(), { locale: y } = Jo(), [b, x] = (0, J.useState)(i), S, C;
|
|
21353
|
+
t[0] === i ? (S = t[1], C = t[2]) : (S = () => {
|
|
21354
|
+
x(i);
|
|
21355
|
+
}, C = [i], t[0] = i, t[1] = S, t[2] = C), (0, J.useEffect)(S, C);
|
|
21356
|
+
let w;
|
|
21357
|
+
t[3] === l ? w = t[4] : (w = Vj(l), t[3] = l, t[4] = w);
|
|
21358
|
+
let T = w, E;
|
|
21359
|
+
t[5] !== b || t[6] !== r || t[7] !== a || t[8] !== T ? (E = (e) => {
|
|
21360
|
+
if (T) {
|
|
21361
|
+
let { steps: t, fractionDigits: n } = T;
|
|
21366
21362
|
if (e == null || Number.isNaN(e)) {
|
|
21367
|
-
|
|
21363
|
+
x(0), r(0);
|
|
21368
21364
|
return;
|
|
21369
21365
|
}
|
|
21370
|
-
let i = Pi(e, n), a = Bj(t, i), o = Pi(t[
|
|
21371
|
-
a ===
|
|
21366
|
+
let i = Pi(e, n), a = Bj(t, i), o = Pi(t[b] ?? t[0], n);
|
|
21367
|
+
a === b && i !== o && (a = i > o ? Math.min(b + 1, t.length - 1) : Math.max(b - 1, 0)), x(a), r(a);
|
|
21372
21368
|
return;
|
|
21373
21369
|
}
|
|
21374
21370
|
let t = e == null || Number.isNaN(e) ? Number(a) : e;
|
|
21375
|
-
|
|
21376
|
-
}, t[5] =
|
|
21377
|
-
let
|
|
21378
|
-
t[10] !==
|
|
21379
|
-
value: Pi(m(
|
|
21380
|
-
minValue:
|
|
21381
|
-
maxValue:
|
|
21382
|
-
step:
|
|
21383
|
-
formatOptions:
|
|
21371
|
+
x(t), r(t);
|
|
21372
|
+
}, t[5] = b, t[6] = r, t[7] = a, t[8] = T, t[9] = E) : E = t[9];
|
|
21373
|
+
let D = E, O;
|
|
21374
|
+
t[10] !== b || t[11] !== a || t[12] !== s || t[13] !== T || t[14] !== o || t[15] !== m ? (O = T ? {
|
|
21375
|
+
value: Pi(m(b), T.fractionDigits),
|
|
21376
|
+
minValue: T.minValue,
|
|
21377
|
+
maxValue: T.maxValue,
|
|
21378
|
+
step: T.inputStep,
|
|
21379
|
+
formatOptions: T.formatOptions
|
|
21384
21380
|
} : {
|
|
21385
|
-
value: m(
|
|
21381
|
+
value: m(b),
|
|
21386
21382
|
minValue: a,
|
|
21387
21383
|
maxValue: o,
|
|
21388
21384
|
step: s
|
|
21389
|
-
}, t[10] =
|
|
21390
|
-
let
|
|
21391
|
-
t[17] ===
|
|
21392
|
-
let
|
|
21393
|
-
t[19] ===
|
|
21394
|
-
let
|
|
21395
|
-
t[21] ===
|
|
21396
|
-
let
|
|
21397
|
-
t[23] ===
|
|
21398
|
-
let
|
|
21399
|
-
t[25] !== u || t[26] !== r ? (
|
|
21385
|
+
}, t[10] = b, t[11] = a, t[12] = s, t[13] = T, t[14] = o, t[15] = m, t[16] = O) : O = t[16];
|
|
21386
|
+
let k = O, A = d === "horizontal" ? "left" : "top", j = p && "my-1 w-full", M;
|
|
21387
|
+
t[17] === j ? M = t[18] : (M = c(j), t[17] = j, t[18] = M);
|
|
21388
|
+
let N = d === "vertical" && "items-end inline-flex justify-center self-center mx-2", P;
|
|
21389
|
+
t[19] === N ? P = t[20] : (P = c("flex items-center gap-2", N), t[19] = N, t[20] = P);
|
|
21390
|
+
let F = n ? v : void 0, I = n ? void 0 : "Slider", L = !p && "data-[orientation=horizontal]:w-36 ", R;
|
|
21391
|
+
t[21] === L ? R = t[22] : (R = c("relative flex items-center select-none", L, "data-[orientation=vertical]:h-36"), t[21] = L, t[22] = R);
|
|
21392
|
+
let z;
|
|
21393
|
+
t[23] === b ? z = t[24] : (z = [b], t[23] = b, t[24] = z);
|
|
21394
|
+
let B, ee;
|
|
21395
|
+
t[25] !== u || t[26] !== r ? (B = (e) => {
|
|
21400
21396
|
let [t] = e;
|
|
21401
|
-
|
|
21402
|
-
},
|
|
21397
|
+
x(t), u || r(t);
|
|
21398
|
+
}, ee = (e) => {
|
|
21403
21399
|
let [t] = e;
|
|
21404
21400
|
u && r(t);
|
|
21405
|
-
}, t[25] = u, t[26] = r, t[27] =
|
|
21406
|
-
let
|
|
21407
|
-
t[29] !== g || t[30] !== _ || t[31] !== d || t[32] !== a || t[33] !== s || t[34] !== o || t[35] !== F || t[36] !== I || t[37] !==
|
|
21401
|
+
}, t[25] = u, t[26] = r, t[27] = B, t[28] = ee) : (B = t[27], ee = t[28]);
|
|
21402
|
+
let te;
|
|
21403
|
+
t[29] !== g || t[30] !== _ || t[31] !== d || t[32] !== a || t[33] !== s || t[34] !== o || t[35] !== F || t[36] !== I || t[37] !== R || t[38] !== z || t[39] !== B || t[40] !== ee || t[41] !== m ? (te = /* @__PURE__ */ (0, Y.jsx)(fw, {
|
|
21408
21404
|
id: _,
|
|
21409
|
-
|
|
21410
|
-
|
|
21405
|
+
"aria-labelledby": F,
|
|
21406
|
+
"aria-label": I,
|
|
21407
|
+
className: R,
|
|
21408
|
+
value: z,
|
|
21411
21409
|
min: a,
|
|
21412
21410
|
max: o,
|
|
21413
21411
|
step: s,
|
|
21414
21412
|
orientation: d,
|
|
21415
|
-
onValueChange:
|
|
21416
|
-
onValueCommit:
|
|
21413
|
+
onValueChange: B,
|
|
21414
|
+
onValueCommit: ee,
|
|
21417
21415
|
valueMap: m,
|
|
21418
21416
|
disabled: g
|
|
21419
|
-
}), t[29] = g, t[30] = _, t[31] = d, t[32] = a, t[33] = s, t[34] = o, t[35] = F, t[36] = I, t[37] =
|
|
21420
|
-
let
|
|
21421
|
-
t[
|
|
21417
|
+
}), t[29] = g, t[30] = _, t[31] = d, t[32] = a, t[33] = s, t[34] = o, t[35] = F, t[36] = I, t[37] = R, t[38] = z, t[39] = B, t[40] = ee, t[41] = m, t[42] = te) : te = t[42];
|
|
21418
|
+
let ne;
|
|
21419
|
+
t[43] !== b || t[44] !== y || t[45] !== f || t[46] !== m ? (ne = f && /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
21422
21420
|
className: "text-xs text-muted-foreground min-w-[16px]",
|
|
21423
|
-
children: zi(m(
|
|
21424
|
-
}), t[
|
|
21425
|
-
let
|
|
21426
|
-
t[
|
|
21427
|
-
...
|
|
21428
|
-
onChange:
|
|
21421
|
+
children: zi(m(b), { locale: y })
|
|
21422
|
+
}), t[43] = b, t[44] = y, t[45] = f, t[46] = m, t[47] = ne) : ne = t[47];
|
|
21423
|
+
let re;
|
|
21424
|
+
t[48] !== g || t[49] !== D || t[50] !== h || t[51] !== k || t[52] !== n ? (re = h && /* @__PURE__ */ (0, Y.jsx)(Hi, {
|
|
21425
|
+
...k,
|
|
21426
|
+
onChange: D,
|
|
21429
21427
|
className: "w-24",
|
|
21430
21428
|
"aria-label": `${n || "Slider"} value input`,
|
|
21431
21429
|
isDisabled: g
|
|
21432
|
-
}), t[
|
|
21433
|
-
let
|
|
21434
|
-
t[
|
|
21435
|
-
className:
|
|
21430
|
+
}), t[48] = g, t[49] = D, t[50] = h, t[51] = k, t[52] = n, t[53] = re) : re = t[53];
|
|
21431
|
+
let ie;
|
|
21432
|
+
t[54] !== P || t[55] !== te || t[56] !== ne || t[57] !== re ? (ie = /* @__PURE__ */ (0, Y.jsxs)("div", {
|
|
21433
|
+
className: P,
|
|
21436
21434
|
children: [
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
|
|
21435
|
+
te,
|
|
21436
|
+
ne,
|
|
21437
|
+
re
|
|
21440
21438
|
]
|
|
21441
|
-
}), t[
|
|
21442
|
-
let
|
|
21443
|
-
return t[
|
|
21439
|
+
}), t[54] = P, t[55] = te, t[56] = ne, t[57] = re, t[58] = ie) : ie = t[58];
|
|
21440
|
+
let ae;
|
|
21441
|
+
return t[59] !== p || t[60] !== _ || t[61] !== n || t[62] !== v || t[63] !== ie || t[64] !== A || t[65] !== M ? (ae = /* @__PURE__ */ (0, Y.jsx)(LS, {
|
|
21444
21442
|
label: n,
|
|
21445
21443
|
controlId: _,
|
|
21446
|
-
|
|
21444
|
+
labelId: v,
|
|
21445
|
+
align: A,
|
|
21447
21446
|
fullWidth: p,
|
|
21448
|
-
className:
|
|
21449
|
-
children:
|
|
21450
|
-
}), t[
|
|
21447
|
+
className: M,
|
|
21448
|
+
children: ie
|
|
21449
|
+
}), t[59] = p, t[60] = _, t[61] = n, t[62] = v, t[63] = ie, t[64] = A, t[65] = M, t[66] = ae) : ae = t[66], ae;
|
|
21451
21450
|
}, Uj = class {
|
|
21452
21451
|
tagName = "marimo-switch";
|
|
21453
21452
|
validator = W({
|
|
@@ -30080,7 +30079,7 @@ function OR(e) {
|
|
|
30080
30079
|
}
|
|
30081
30080
|
//#endregion
|
|
30082
30081
|
//#region src/components/editor/renderers/slides-layout/slides-layout.tsx
|
|
30083
|
-
var kR = J.lazy(() => import("./reveal-component-
|
|
30082
|
+
var kR = J.lazy(() => import("./reveal-component-6XP1cUF1.js")), AR = (e) => {
|
|
30084
30083
|
let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = ns(Sa), s = a === "read" || o, c = ns(gt) > 1, [l, u] = (0, J.useState)(null), d;
|
|
30085
30084
|
t[0] !== i || t[1] !== n ? (d = EP(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
|
|
30086
30085
|
let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
2
|
import { t } from "./react-ofJbxM4x.js";
|
|
3
|
-
import { a as n } from "./glide-data-editor-
|
|
3
|
+
import { a as n } from "./glide-data-editor-D9x_3f3L.js";
|
|
4
4
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
|
|
5
5
|
var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
|
|
6
6
|
name: "NumberOverlayEditorStyle",
|
|
@@ -4,14 +4,14 @@ import { t as o } from "./react-ofJbxM4x.js";
|
|
|
4
4
|
import { t as s } from "./compiler-runtime-Cj8ZWiNS.js";
|
|
5
5
|
import { h as c, t as l } from "./tooltip-CuNWg2ay.js";
|
|
6
6
|
import { w as u } from "./cells-DZi0ioak.js";
|
|
7
|
-
import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-
|
|
7
|
+
import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-CtZ-MrLU.js";
|
|
8
8
|
import { M as C } from "./select-Bs-nmvm6.js";
|
|
9
9
|
import { q as ee } from "./dropdown-menu-Cz4TdOJh.js";
|
|
10
10
|
import { y as w } from "./toDate-vEi5kTfY.js";
|
|
11
11
|
import { t as T } from "./jsx-runtime-DgDPJV9S.js";
|
|
12
12
|
import { q as te } from "./use-restore-focus-kmgwrL8q.js";
|
|
13
13
|
import { A as E, C as D, b as O } from "./useTheme-BwSgeAFb.js";
|
|
14
|
-
import { a as k, n as ne, t as re } from "./code-visibility-
|
|
14
|
+
import { a as k, n as ne, t as re } from "./code-visibility-BOSA33DJ.js";
|
|
15
15
|
/* empty css */
|
|
16
16
|
var A = c("sticky-note", [["path", {
|
|
17
17
|
d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
|
package/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import { useForm, useWatch } from "react-hook-form";
|
|
4
|
+
import { describe, expect, test } from "vitest";
|
|
5
|
+
import { SetupMocks } from "@/__mocks__/common";
|
|
6
|
+
import { Form } from "@/components/ui/form";
|
|
7
|
+
import { SliderField } from "../components/form-fields";
|
|
8
|
+
|
|
9
|
+
SetupMocks.resizeObserver();
|
|
10
|
+
function Harness({ label = "Opacity" }: { label?: string }) {
|
|
11
|
+
const form = useForm({ defaultValues: { xAxis: { width: 400 } } });
|
|
12
|
+
const value = useWatch({ control: form.control, name: "xAxis.width" });
|
|
13
|
+
return (
|
|
14
|
+
<Form {...form}>
|
|
15
|
+
<SliderField
|
|
16
|
+
fieldName="xAxis.width"
|
|
17
|
+
label={label}
|
|
18
|
+
defaultValue={400}
|
|
19
|
+
start={200}
|
|
20
|
+
stop={800}
|
|
21
|
+
step={10}
|
|
22
|
+
/>
|
|
23
|
+
<output aria-label="Current opacity">{value}</output>
|
|
24
|
+
</Form>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe("SliderField", () => {
|
|
29
|
+
test("names the chart-form thumb and preserves keyboard value updates", () => {
|
|
30
|
+
const { rerender } = render(<Harness />);
|
|
31
|
+
fireEvent.keyDown(screen.getByRole("slider", { name: "Opacity" }), {
|
|
32
|
+
key: "ArrowRight",
|
|
33
|
+
});
|
|
34
|
+
expect(screen.getByLabelText("Current opacity")).toHaveTextContent("410");
|
|
35
|
+
rerender(<Harness label="Updated opacity" />);
|
|
36
|
+
expect(
|
|
37
|
+
screen.getByRole("slider", { name: "Updated opacity" }),
|
|
38
|
+
).toHaveAttribute("aria-valuenow", "410");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("independently associates repeated chart form instances", () => {
|
|
42
|
+
render(
|
|
43
|
+
<>
|
|
44
|
+
<Harness />
|
|
45
|
+
<Harness />
|
|
46
|
+
</>,
|
|
47
|
+
);
|
|
48
|
+
const thumbs = screen.getAllByRole("slider", { name: "Opacity" });
|
|
49
|
+
expect(thumbs).toHaveLength(2);
|
|
50
|
+
expect(thumbs[0].getAttribute("aria-labelledby")).not.toBe(
|
|
51
|
+
thumbs[1].getAttribute("aria-labelledby"),
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -358,6 +358,7 @@ export const SliderField = ({
|
|
|
358
358
|
className,
|
|
359
359
|
}: SliderFieldProps) => {
|
|
360
360
|
const form = useFormContext();
|
|
361
|
+
const labelId = React.useId();
|
|
361
362
|
|
|
362
363
|
return (
|
|
363
364
|
<FormField
|
|
@@ -378,10 +379,11 @@ export const SliderField = ({
|
|
|
378
379
|
<FormItem
|
|
379
380
|
className={cn("flex flex-row items-center gap-2 w-1/2", className)}
|
|
380
381
|
>
|
|
381
|
-
<FormLabel>{label}</FormLabel>
|
|
382
|
+
<FormLabel id={labelId}>{label}</FormLabel>
|
|
382
383
|
<FormControl>
|
|
383
384
|
<Slider
|
|
384
385
|
{...field}
|
|
386
|
+
aria-labelledby={labelId}
|
|
385
387
|
id={fieldName}
|
|
386
388
|
className="relative flex items-center select-none"
|
|
387
389
|
value={[numericValue]}
|
|
@@ -27,4 +27,11 @@ describe("Slider", () => {
|
|
|
27
27
|
|
|
28
28
|
expect(onValueChange).toHaveBeenCalledWith([2 * step]);
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
it("forwards a direct accessible name to the thumb", () => {
|
|
32
|
+
const { getByRole } = render(
|
|
33
|
+
<Slider aria-label="Opacity" value={[50]} valueMap={(v) => v} />,
|
|
34
|
+
);
|
|
35
|
+
expect(getByRole("slider")).toHaveAccessibleName("Opacity");
|
|
36
|
+
});
|
|
30
37
|
});
|
|
@@ -57,6 +57,8 @@ const Slider = React.forwardRef<
|
|
|
57
57
|
<TooltipRoot delayDuration={0} open={open}>
|
|
58
58
|
<TooltipTrigger asChild={true}>
|
|
59
59
|
<SliderPrimitive.Thumb
|
|
60
|
+
aria-label={props["aria-label"]}
|
|
61
|
+
aria-labelledby={props["aria-labelledby"]}
|
|
60
62
|
data-testid="thumb"
|
|
61
63
|
className="block h-4 w-4 rounded-full shadow-xs-solid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50"
|
|
62
64
|
onFocus={openActions.setTrue}
|
|
@@ -152,6 +152,7 @@ const SliderComponent = ({
|
|
|
152
152
|
disabled,
|
|
153
153
|
}: SliderProps): JSX.Element => {
|
|
154
154
|
const id = useId();
|
|
155
|
+
const labelId = useId();
|
|
155
156
|
const { locale } = useLocale();
|
|
156
157
|
|
|
157
158
|
// Hold internal value
|
|
@@ -225,6 +226,7 @@ const SliderComponent = ({
|
|
|
225
226
|
<Labeled
|
|
226
227
|
label={label}
|
|
227
228
|
controlId={id}
|
|
229
|
+
labelId={labelId}
|
|
228
230
|
align={orientation === "horizontal" ? "left" : "top"}
|
|
229
231
|
fullWidth={fullWidth}
|
|
230
232
|
className={cn(fullWidth && "my-1 w-full")}
|
|
@@ -238,6 +240,8 @@ const SliderComponent = ({
|
|
|
238
240
|
>
|
|
239
241
|
<Slider
|
|
240
242
|
id={id}
|
|
243
|
+
aria-labelledby={label ? labelId : undefined}
|
|
244
|
+
aria-label={label ? undefined : "Slider"}
|
|
241
245
|
className={cn(
|
|
242
246
|
"relative flex items-center select-none",
|
|
243
247
|
!fullWidth && "data-[orientation=horizontal]:w-36 ",
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, test, vi } from "vitest";
|
|
4
|
+
import { SetupMocks } from "@/__mocks__/common";
|
|
5
|
+
import { SliderPlugin } from "../SliderPlugin";
|
|
6
|
+
|
|
7
|
+
SetupMocks.resizeObserver();
|
|
8
|
+
const plugin = new SliderPlugin();
|
|
9
|
+
function props(label: string | null) {
|
|
10
|
+
return {
|
|
11
|
+
host: document.createElement("div"),
|
|
12
|
+
value: 5,
|
|
13
|
+
setValue: vi.fn(),
|
|
14
|
+
functions: {},
|
|
15
|
+
data: plugin.validator.parse({
|
|
16
|
+
initialValue: 5,
|
|
17
|
+
start: 0,
|
|
18
|
+
stop: 10,
|
|
19
|
+
step: 1,
|
|
20
|
+
steps: null,
|
|
21
|
+
label,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe("SliderPlugin accessible labels", () => {
|
|
27
|
+
test("names the actual thumb from formatted labels and updates its reference", () => {
|
|
28
|
+
const initial = props("<strong>Price & tax</strong>");
|
|
29
|
+
const { rerender } = render(plugin.render(initial));
|
|
30
|
+
const thumb = screen.getByRole("slider", { name: "Price & tax" });
|
|
31
|
+
const labelId = thumb.getAttribute("aria-labelledby");
|
|
32
|
+
rerender(
|
|
33
|
+
plugin.render({
|
|
34
|
+
...initial,
|
|
35
|
+
data: { ...initial.data, label: "Updated price" },
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
const updatedThumb = screen.getByRole("slider", { name: "Updated price" });
|
|
39
|
+
expect(updatedThumb).toHaveAccessibleName("Updated price");
|
|
40
|
+
expect(updatedThumb).toHaveAttribute("aria-labelledby", labelId);
|
|
41
|
+
rerender(
|
|
42
|
+
plugin.render({ ...initial, data: { ...initial.data, label: null } }),
|
|
43
|
+
);
|
|
44
|
+
expect(screen.getByRole("slider")).toHaveAccessibleName("Slider");
|
|
45
|
+
expect(screen.getByRole("slider")).not.toHaveAttribute("aria-labelledby");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test.each([null, ""])("retains a fallback name for label %s", (label) => {
|
|
49
|
+
render(plugin.render(props(label)));
|
|
50
|
+
expect(screen.getByRole("slider")).toHaveAccessibleName("Slider");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("keeps repeated widget labels independently associated", () => {
|
|
54
|
+
render(
|
|
55
|
+
<>
|
|
56
|
+
{plugin.render(props("Price"))}
|
|
57
|
+
{plugin.render(props("Price"))}
|
|
58
|
+
</>,
|
|
59
|
+
);
|
|
60
|
+
const thumbs = screen.getAllByRole("slider", { name: "Price" });
|
|
61
|
+
expect(thumbs).toHaveLength(2);
|
|
62
|
+
expect(thumbs[0].getAttribute("aria-labelledby")).not.toBe(
|
|
63
|
+
thumbs[1].getAttribute("aria-labelledby"),
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test.each([false, true])(
|
|
68
|
+
"preserves keyboard commits with debounce=%s",
|
|
69
|
+
(debounce) => {
|
|
70
|
+
const initial = props("Price");
|
|
71
|
+
render(
|
|
72
|
+
plugin.render({ ...initial, data: { ...initial.data, debounce } }),
|
|
73
|
+
);
|
|
74
|
+
fireEvent.keyDown(screen.getByRole("slider"), { key: "ArrowRight" });
|
|
75
|
+
expect(initial.setValue).toHaveBeenCalledWith(6);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
test("preserves maximum and minimum keyboard boundaries", () => {
|
|
80
|
+
const initial = props("Price");
|
|
81
|
+
const { rerender } = render(plugin.render({ ...initial, value: 10 }));
|
|
82
|
+
fireEvent.keyDown(screen.getByRole("slider"), { key: "ArrowRight" });
|
|
83
|
+
expect(initial.setValue).not.toHaveBeenCalled();
|
|
84
|
+
rerender(plugin.render({ ...initial, value: 0 }));
|
|
85
|
+
fireEvent.keyDown(screen.getByRole("slider"), { key: "ArrowLeft" });
|
|
86
|
+
expect(initial.setValue).not.toHaveBeenCalled();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("retains the name while disabled and removes keyboard focusability", () => {
|
|
90
|
+
const initial = props("Price");
|
|
91
|
+
render(
|
|
92
|
+
plugin.render({ ...initial, data: { ...initial.data, disabled: true } }),
|
|
93
|
+
);
|
|
94
|
+
const thumb = screen.getByRole("slider", { name: "Price" });
|
|
95
|
+
expect(thumb).not.toHaveAttribute("tabindex");
|
|
96
|
+
expect(thumb).toHaveAttribute("data-disabled");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("preserves vertical keyboard interaction", () => {
|
|
100
|
+
const initial = props("Price");
|
|
101
|
+
render(
|
|
102
|
+
plugin.render({
|
|
103
|
+
...initial,
|
|
104
|
+
data: { ...initial.data, orientation: "vertical" },
|
|
105
|
+
}),
|
|
106
|
+
);
|
|
107
|
+
const thumb = screen.getByRole("slider", { name: "Price" });
|
|
108
|
+
expect(thumb).toHaveAttribute("aria-orientation", "vertical");
|
|
109
|
+
fireEvent.keyDown(thumb, { key: "ArrowUp" });
|
|
110
|
+
expect(initial.setValue).toHaveBeenCalledWith(6);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test("preserves mapped values while naming the index-space thumb", () => {
|
|
114
|
+
const initial = props("Mapped price");
|
|
115
|
+
render(
|
|
116
|
+
plugin.render({
|
|
117
|
+
...initial,
|
|
118
|
+
value: 1,
|
|
119
|
+
data: {
|
|
120
|
+
...initial.data,
|
|
121
|
+
start: 0,
|
|
122
|
+
stop: 2,
|
|
123
|
+
steps: [10, 20, 50],
|
|
124
|
+
showValue: true,
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
expect(screen.getByText("20")).toBeInTheDocument();
|
|
129
|
+
fireEvent.keyDown(screen.getByRole("slider", { name: "Mapped price" }), {
|
|
130
|
+
key: "ArrowRight",
|
|
131
|
+
});
|
|
132
|
+
expect(initial.setValue).toHaveBeenCalledWith(2);
|
|
133
|
+
expect(screen.getByRole("slider")).toHaveAttribute("aria-valuenow", "2");
|
|
134
|
+
expect(screen.getByRole("tooltip")).toHaveTextContent("50");
|
|
135
|
+
});
|
|
136
|
+
});
|