@selectwin/kit 0.1.244 → 0.1.246
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/SelectDetail.js +20 -18
- package/dist/SelectFlowCanvas.d.ts +7 -1
- package/dist/SelectFlowCanvas.js +138 -91
- package/dist/SelectJsonViewer.js +99 -97
- package/dist/SelectLayout.js +33 -31
- package/dist/SelectListCard.js +30 -28
- package/dist/SelectLocale.d.ts +5 -0
- package/dist/SelectLocale.js +8 -0
- package/dist/SelectModal.d.ts +45 -6
- package/dist/SelectModal.js +281 -127
- package/dist/SelectSection.js +35 -33
- package/dist/internal/dev.d.ts +1 -0
- package/dist/internal/dev.js +12 -0
- package/dist/internal/sheetBands.d.ts +11 -0
- package/dist/internal/sheetBands.js +44 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectLocale.js
CHANGED
|
@@ -177,6 +177,10 @@ var r = {
|
|
|
177
177
|
move: "Mover a barra",
|
|
178
178
|
moveHint: "Arraste para levar a barra a outro lugar, ou use as setas. Home ou dois cliques a devolvem ao centro de baixo."
|
|
179
179
|
}
|
|
180
|
+
},
|
|
181
|
+
modal: {
|
|
182
|
+
loadFailed: "Não foi possível abrir.",
|
|
183
|
+
retry: "Tentar de novo"
|
|
180
184
|
}
|
|
181
185
|
},
|
|
182
186
|
en: {
|
|
@@ -355,6 +359,10 @@ var r = {
|
|
|
355
359
|
move: "Move the bar",
|
|
356
360
|
moveHint: "Drag to move the bar, or use the arrow keys. Home or a double click puts it back at the bottom centre."
|
|
357
361
|
}
|
|
362
|
+
},
|
|
363
|
+
modal: {
|
|
364
|
+
loadFailed: "Couldn't open it.",
|
|
365
|
+
retry: "Try again"
|
|
358
366
|
}
|
|
359
367
|
}
|
|
360
368
|
}, i = e(null);
|
package/dist/SelectModal.d.ts
CHANGED
|
@@ -2,12 +2,16 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* 0.1.229: a fileira de botões do rodapé do modal — ocupa o rodapé e alinha os botões à direita, com o vão do kit. É a
|
|
4
4
|
* que o SelectConfirmModal e o SelectFormModal usam; vai no `footer` do SelectModal quando a tela monta o próprio rodapé.
|
|
5
|
+
*
|
|
6
|
+
* 0.1.246: `destructive` é o lugar da ação destrutiva, no canto ESQUERDO (o "Bloquear", o "Cancelar a exportação"); os
|
|
7
|
+
* filhos seguem na direita — o secundário e, na ponta, o primário.
|
|
5
8
|
*/
|
|
6
|
-
export declare function SelectModalActions({ children, className }: {
|
|
7
|
-
children
|
|
9
|
+
export declare function SelectModalActions({ children, className, destructive }: {
|
|
10
|
+
children?: ReactNode;
|
|
8
11
|
className?: string;
|
|
12
|
+
destructive?: ReactNode;
|
|
9
13
|
}): import("react").JSX.Element;
|
|
10
|
-
export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, description, badge, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, headerAction, flush, dismissible, }: {
|
|
14
|
+
export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, description, badge, help, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, headerAction, menu, onBack, backLabel, loading, error, onRetry, flush, dismissible, }: {
|
|
11
15
|
open: boolean;
|
|
12
16
|
onClose: () => void;
|
|
13
17
|
/** Uma linha de contexto acima do título ("Passo a passo · ponto 1 de 5"). */
|
|
@@ -16,15 +20,22 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
|
|
|
16
20
|
subtitle?: ReactNode;
|
|
17
21
|
/**
|
|
18
22
|
* 0.1.230: a descrição do diálogo no COMEÇO do corpo, em texto secundário (o cabeçalho fica só com o título). É o lugar
|
|
19
|
-
* dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa.
|
|
23
|
+
* dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa. Na folha ela não vale: lá a linha de apoio é o
|
|
24
|
+
* `badge` + `subtitle`, e a explicação vai no `help`.
|
|
20
25
|
*/
|
|
21
26
|
description?: ReactNode;
|
|
22
27
|
/** 0.1.184: o selo da situação (`SelectBadge`), na linha do subtítulo, antes dele ("Aberto · Chamado · Estorno"). */
|
|
23
28
|
badge?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* 0.1.246: o "i" ao lado do título (`SelectInfoTip`) — a explicação do diálogo mora aqui, não numa linha do corpo
|
|
31
|
+
* nem na linha de apoio. Fica fora do nome do diálogo (o leitor de tela não lê "Mais informações" no título).
|
|
32
|
+
*/
|
|
33
|
+
help?: ReactNode;
|
|
24
34
|
children?: ReactNode;
|
|
25
35
|
footer?: ReactNode;
|
|
26
36
|
/** Left rail content — switches the modal to the wide split layout. */
|
|
27
37
|
aside?: ReactNode;
|
|
38
|
+
/** Na folha (0.1.246): `md` 30rem (480px, a de quase todas) e `lg` 40rem (640px, para comparar lado a lado). */
|
|
28
39
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
29
40
|
showClose?: boolean;
|
|
30
41
|
noise?: boolean;
|
|
@@ -38,13 +49,41 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
|
|
|
38
49
|
placement?: 'center' | 'side';
|
|
39
50
|
/**
|
|
40
51
|
* 0.1.181: um controle na LINHA do título, à direita (a busca do modal de Apps do painel). Numa tela
|
|
41
|
-
* estreita ele desce para baixo do título, na largura toda. Só no layout padrão (sem `aside`).
|
|
52
|
+
* estreita ele desce para baixo do título, na largura toda. Só no layout padrão (sem `aside`). Na folha (0.1.246) ele
|
|
53
|
+
* fica numa linha própria sob o título — mas o controle que recorta o conteúdo (Mensal | Anual) é da faixa que ele
|
|
54
|
+
* recorta, não do cabeçalho.
|
|
42
55
|
*/
|
|
43
56
|
headerAction?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* 0.1.246, só na folha: o menu das AÇÕES RARAS ("Copiar o código", "Pedir ajuda"), na linha do título, antes do ✕.
|
|
59
|
+
* Passe um `SelectRowActions` (o ícone de ajuste); a folha o desenha como o ✕. Some enquanto carrega e no erro.
|
|
60
|
+
*/
|
|
61
|
+
menu?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* 0.1.246, só na folha: o SEGUNDO NÍVEL — a seta de voltar à esquerda do título. A tela troca o título, o corpo e o pé
|
|
64
|
+
* (ver a mensagem, reenviar, confirmar a troca de plano), sem um modal por cima da folha. Ao trocar de nível o corpo
|
|
65
|
+
* volta ao topo, e o foco que se perdeu (o botão que sumiu) volta para a folha.
|
|
66
|
+
*/
|
|
67
|
+
onBack?: () => void;
|
|
68
|
+
/** O nome da seta de voltar ("Voltar ao envio"). Padrão: "Voltar". */
|
|
69
|
+
backLabel?: string;
|
|
70
|
+
/**
|
|
71
|
+
* 0.1.246: o registro ainda não chegou — o cabeçalho fica (o título que veio da linha da lista), o corpo vira o
|
|
72
|
+
* esqueleto em faixas e o pé (e o menu) só aparecem com o dado. Sem spinner nem "Carregando…" visível.
|
|
73
|
+
*/
|
|
74
|
+
loading?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 0.1.246: o registro não abriu — a frase (`true` = "Não foi possível abrir.") no corpo, com o "Tentar de novo" do
|
|
77
|
+
* `onRetry`; o pé e o menu somem. Queda geral (5xx, 429) fica no aviso global da tela, não aqui.
|
|
78
|
+
*/
|
|
79
|
+
error?: ReactNode;
|
|
80
|
+
/** 0.1.246: o "Tentar de novo" do `error`. */
|
|
81
|
+
onRetry?: () => void;
|
|
44
82
|
/**
|
|
45
83
|
* O corpo sem respiro (0.1.184): cada filho é uma FAIXA de ponta a ponta, separada da seguinte por um traço — a
|
|
46
84
|
* faixa de fatos, a conversa, a caixa de responder. Cada faixa traz o próprio respiro (`SelectBox padding`); a
|
|
47
|
-
* `SelectFactStrip` já vem com o dela.
|
|
85
|
+
* `SelectFactStrip` já vem com o dela. Na folha (0.1.246) as faixas já são o padrão: com `flush`, os filhos seguem
|
|
86
|
+
* trazendo o próprio respiro, como antes.
|
|
48
87
|
*/
|
|
49
88
|
flush?: boolean;
|
|
50
89
|
/**
|
package/dist/SelectModal.js
CHANGED
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { SelectButton as e } from "./SelectButton.js";
|
|
3
|
+
import { ArrowLeftIcon as t, CloseIcon as n } from "./icons.js";
|
|
4
|
+
import { useSelectMessages as r } from "./SelectLocale.js";
|
|
5
|
+
import { SelectInfoTip as ee } from "./SelectInfoTip.js";
|
|
6
|
+
import { SelectAlert as te } from "./SelectAlert.js";
|
|
7
|
+
import { useFocusTrap as ne } from "./internal/useFocusTrap.js";
|
|
8
|
+
import { LayerProvider as re, isTopLayer as ie, openLayer as ae, useParentLayer as oe } from "./internal/layers.js";
|
|
9
|
+
import { sheetBands as se } from "./internal/sheetBands.js";
|
|
10
|
+
import { FrameBody as i } from "./internal/frame.js";
|
|
11
|
+
import { isDevBuild as ce } from "./internal/dev.js";
|
|
12
|
+
import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
13
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
|
+
import { createPortal as le } from "react-dom";
|
|
10
15
|
//#region src/SelectModal.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */
|
|
16
|
+
var ue = 220, f = "(max-width: 40rem)", de = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, fe = 64, pe = 120;
|
|
17
|
+
function p({ children: e, className: t, destructive: n }) {
|
|
18
|
+
return /* @__PURE__ */ d("div", {
|
|
14
19
|
className: `select-modal__actions${t ? " " + t : ""}`,
|
|
15
|
-
children:
|
|
20
|
+
children: [n != null && n !== !1 && /* @__PURE__ */ u("div", {
|
|
21
|
+
className: "select-modal__destructive",
|
|
22
|
+
children: n
|
|
23
|
+
}), e]
|
|
16
24
|
});
|
|
17
25
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
onClose:
|
|
21
|
-
dismissible:
|
|
26
|
+
function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: me, children: y, footer: he, aside: b, size: ge = "md", showClose: _e = !0, noise: ve = !0, dividedHeader: ye = !1, backdrop: be = "dim", theme: xe = "light", placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: Se, loading: Ce = !1, error: T, onRetry: we, flush: Te = !1, dismissible: E = !0 }) {
|
|
27
|
+
let D = r(), [O, k] = c(f), [A, j] = c(!1), M = s(null), N = s(null), P = s(null), F = o(), I = o(), Ee = o(), [L] = c(() => ({})), De = oe(), R = s({
|
|
28
|
+
onClose: p,
|
|
29
|
+
dismissible: E
|
|
22
30
|
});
|
|
23
|
-
|
|
24
|
-
onClose:
|
|
25
|
-
dismissible:
|
|
31
|
+
R.current = {
|
|
32
|
+
onClose: p,
|
|
33
|
+
dismissible: E
|
|
26
34
|
};
|
|
27
|
-
let [
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
let [z] = c(() => f && typeof document < "u" ? document.activeElement : null), B = s(null), V = x === "side" && !b, H = Ce ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = V && w != null;
|
|
36
|
+
a(() => {
|
|
37
|
+
if (f) {
|
|
38
|
+
var e;
|
|
39
|
+
if (!B.current) {
|
|
40
|
+
var t;
|
|
41
|
+
let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = M.current) != null && t.contains(e));
|
|
42
|
+
B.current = n ? e : z instanceof HTMLElement && z !== document.body ? z : null;
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
} else if (
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
let e =
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
e != null && e.isConnected && (!
|
|
44
|
+
(e = M.current) == null || e.style.removeProperty("transform"), k(!0), j(!1);
|
|
45
|
+
} else if (O) {
|
|
46
|
+
var n;
|
|
47
|
+
j(!0);
|
|
48
|
+
let e = B.current;
|
|
49
|
+
B.current = null;
|
|
50
|
+
let t = document.activeElement;
|
|
51
|
+
e != null && e.isConnected && (!t || t === document.body || (n = M.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
|
|
43
52
|
let r = setTimeout(() => {
|
|
44
|
-
|
|
45
|
-
},
|
|
53
|
+
k(!1), j(!1);
|
|
54
|
+
}, ue);
|
|
46
55
|
return () => clearTimeout(r);
|
|
47
56
|
}
|
|
48
57
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]),
|
|
53
|
-
if (!
|
|
54
|
-
let e =
|
|
55
|
-
e.key === "Escape" && !e.defaultPrevented &&
|
|
58
|
+
f,
|
|
59
|
+
O,
|
|
60
|
+
z
|
|
61
|
+
]), a(() => {
|
|
62
|
+
if (!O) return;
|
|
63
|
+
let e = ae(L, De), t = (e) => {
|
|
64
|
+
e.key === "Escape" && !e.defaultPrevented && ie(L) && R.current.dismissible && R.current.onClose();
|
|
56
65
|
};
|
|
57
66
|
document.addEventListener("keydown", t);
|
|
58
67
|
let n = document.body.style.overflow;
|
|
@@ -60,128 +69,273 @@ function _({ open: g, onClose: _, eyebrow: v, title: y, subtitle: b, description
|
|
|
60
69
|
e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
|
|
61
70
|
};
|
|
62
71
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
O,
|
|
73
|
+
L,
|
|
74
|
+
De
|
|
66
75
|
]);
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
if (!
|
|
70
|
-
let e =
|
|
76
|
+
let W = O && !A;
|
|
77
|
+
a(() => {
|
|
78
|
+
if (!W) return;
|
|
79
|
+
let e = M.current;
|
|
71
80
|
e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
|
|
72
|
-
}, [
|
|
73
|
-
let
|
|
74
|
-
|
|
81
|
+
}, [W]), ne(W, M, { initialFocus: !1 });
|
|
82
|
+
let Oe = s(U);
|
|
83
|
+
a(() => {
|
|
84
|
+
if (Oe.current === U) return;
|
|
85
|
+
Oe.current = U, N.current && (N.current.scrollTop = 0);
|
|
86
|
+
let e = M.current, t = document.activeElement;
|
|
87
|
+
e && (!t || t === document.body || !e.contains(t)) && e.focus({ preventScroll: !0 });
|
|
88
|
+
}, [U]);
|
|
89
|
+
let ke = s(!1);
|
|
90
|
+
a(() => {
|
|
91
|
+
if (!V || ke.current || !P.current || !ce()) return;
|
|
92
|
+
let e = P.current.querySelectorAll(".select-btn--primary").length;
|
|
93
|
+
e > 1 && (ke.current = !0, console.warn(`[SelectModal] A folha tem ${e} botões primários no pé: no máximo um, na ponta direita (o secundário à esquerda dele).`));
|
|
94
|
+
});
|
|
95
|
+
let G = s(null), Ae = (e) => {
|
|
96
|
+
if (E && e.button === 0 && de() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
|
|
97
|
+
G.current = {
|
|
98
|
+
id: e.pointerId,
|
|
99
|
+
y: e.clientY,
|
|
100
|
+
dy: 0
|
|
101
|
+
};
|
|
102
|
+
try {
|
|
103
|
+
var t, n;
|
|
104
|
+
(t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId);
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
}, je = (e) => {
|
|
108
|
+
let t = G.current, n = M.current;
|
|
109
|
+
t && e.pointerId === t.id && n && (t.dy = Math.max(0, e.clientY - t.y), n.dataset.dragging = "", t.dy > 0 ? n.style.transform = `translateY(${t.dy}px)` : n.style.removeProperty("transform"));
|
|
110
|
+
}, Me = (e) => {
|
|
111
|
+
let t = G.current;
|
|
112
|
+
if (!t || e.pointerId !== t.id) return;
|
|
113
|
+
G.current = null;
|
|
114
|
+
let n = M.current;
|
|
115
|
+
if (!n) return;
|
|
116
|
+
delete n.dataset.dragging;
|
|
117
|
+
let r = Math.max(fe, Math.min(pe, n.offsetHeight * .25));
|
|
118
|
+
e.type === "pointerup" && t.dy > r && R.current.dismissible ? R.current.onClose() : n.style.removeProperty("transform");
|
|
119
|
+
};
|
|
120
|
+
if (!O) return null;
|
|
121
|
+
let K = h && (me == null ? /* @__PURE__ */ u("h2", {
|
|
122
|
+
id: F,
|
|
123
|
+
className: "select-modal__title",
|
|
124
|
+
children: h
|
|
125
|
+
}) : /* @__PURE__ */ d("div", {
|
|
126
|
+
className: "select-modal__titlerow",
|
|
127
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
128
|
+
id: F,
|
|
129
|
+
className: "select-modal__title",
|
|
130
|
+
children: h
|
|
131
|
+
}), /* @__PURE__ */ u(ee, { content: me })]
|
|
132
|
+
})), q = v ? /* @__PURE__ */ d("p", {
|
|
133
|
+
id: I,
|
|
75
134
|
className: "select-modal__subtitle select-modal__subtitle--badge",
|
|
76
|
-
children: [
|
|
77
|
-
}) :
|
|
78
|
-
id:
|
|
135
|
+
children: [v, g ? /* @__PURE__ */ u("span", { children: g }) : null]
|
|
136
|
+
}) : g && /* @__PURE__ */ u("p", {
|
|
137
|
+
id: I,
|
|
79
138
|
className: "select-modal__subtitle",
|
|
80
|
-
children:
|
|
81
|
-
}),
|
|
82
|
-
id:
|
|
139
|
+
children: g
|
|
140
|
+
}), J = _ != null && _ !== !1 && _ !== "", Y = J && /* @__PURE__ */ u("p", {
|
|
141
|
+
id: Ee,
|
|
83
142
|
className: "select-modal__description",
|
|
84
|
-
children:
|
|
85
|
-
}),
|
|
143
|
+
children: _
|
|
144
|
+
}), Ne = [g || v ? I : null, J ? Ee : null].filter(Boolean).join(" ") || void 0, X = _e && E && /* @__PURE__ */ u("button", {
|
|
86
145
|
type: "button",
|
|
87
|
-
className:
|
|
88
|
-
"aria-label":
|
|
89
|
-
onClick:
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
146
|
+
className: `select-modal__close${V ? " select-modal__tool" : ""}`,
|
|
147
|
+
"aria-label": D.common.close,
|
|
148
|
+
onClick: p,
|
|
149
|
+
children: /* @__PURE__ */ u(n, {})
|
|
150
|
+
}), Z = `select-modal__header${ye ? " select-modal__header--divided" : ""}`, Pe = (e) => [
|
|
151
|
+
0,
|
|
152
|
+
1,
|
|
153
|
+
2
|
|
154
|
+
].map((t) => /* @__PURE__ */ d("span", {
|
|
155
|
+
className: "select-modal__skelrow",
|
|
156
|
+
children: [/* @__PURE__ */ u("span", { className: `select-skeleton${e ? " select-modal__skeldot" : ""}` }), /* @__PURE__ */ u("span", { className: "select-skeleton" })]
|
|
157
|
+
}, t)), Q = H === "loading" ? [/* @__PURE__ */ d("div", {
|
|
158
|
+
className: "select-modal__skel",
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ u("span", {
|
|
161
|
+
className: "select-skeleton select-modal__skelhead",
|
|
162
|
+
"aria-hidden": "true"
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ u("span", {
|
|
165
|
+
className: "select-modal__skelrows",
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
children: Pe(!1)
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ u("span", {
|
|
170
|
+
className: "select-visually-hidden",
|
|
171
|
+
role: "status",
|
|
172
|
+
children: D.common.loading
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
}, "skel-facts"), /* @__PURE__ */ d("div", {
|
|
176
|
+
className: "select-modal__skel select-modal__skel--steps",
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
children: [/* @__PURE__ */ u("span", { className: "select-skeleton select-modal__skelhead" }), /* @__PURE__ */ u("span", {
|
|
179
|
+
className: "select-modal__skelrows",
|
|
180
|
+
children: Pe(!0)
|
|
181
|
+
})]
|
|
182
|
+
}, "skel-steps")] : H === "error" ? [/* @__PURE__ */ u(te, {
|
|
183
|
+
tone: "critical",
|
|
184
|
+
action: we ? /* @__PURE__ */ u(e, {
|
|
185
|
+
variant: "secondary",
|
|
186
|
+
size: "sm",
|
|
187
|
+
inline: !0,
|
|
188
|
+
onClick: we,
|
|
189
|
+
children: D.modal.retry
|
|
190
|
+
}) : void 0,
|
|
191
|
+
children: T === !0 ? D.modal.loadFailed : T
|
|
192
|
+
}, "error")] : null, Fe = !!y || J || H !== "ready", Ie = !!he && H === "ready", Le = V && !Te ? Q ? Q.map((e, t) => ({
|
|
193
|
+
key: `state-${t}`,
|
|
194
|
+
node: e
|
|
195
|
+
})) : se(y) : null, Re = Fe && /* @__PURE__ */ u("div", {
|
|
196
|
+
className: "select-modal__body",
|
|
197
|
+
ref: N,
|
|
198
|
+
children: Le ? /* @__PURE__ */ d(l, { children: [Y && /* @__PURE__ */ u("div", {
|
|
199
|
+
className: "select-modal__band",
|
|
200
|
+
children: Y
|
|
201
|
+
}), /* @__PURE__ */ u(i, { children: Le.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
|
|
202
|
+
className: "select-modal__band",
|
|
203
|
+
children: t
|
|
204
|
+
}, e)) })] }) : /* @__PURE__ */ d(l, { children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })] })
|
|
205
|
+
}), ze = Ie && /* @__PURE__ */ u("div", {
|
|
206
|
+
className: "select-modal__footer",
|
|
207
|
+
ref: P,
|
|
208
|
+
children: he
|
|
209
|
+
}), $ = V && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
|
|
210
|
+
className: "select-modal__menu",
|
|
211
|
+
children: C
|
|
212
|
+
}) : null, Be = q || (H === "loading" ? /* @__PURE__ */ u("span", {
|
|
213
|
+
className: "select-skeleton select-modal__subskel",
|
|
214
|
+
"aria-hidden": "true"
|
|
215
|
+
}) : null), Ve = /* @__PURE__ */ d("div", {
|
|
216
|
+
className: "select-modal__header select-modal__header--sheet",
|
|
217
|
+
onPointerDown: Ae,
|
|
218
|
+
onPointerMove: je,
|
|
219
|
+
onPointerUp: Me,
|
|
220
|
+
onPointerCancel: Me,
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ u("span", {
|
|
223
|
+
className: "select-modal__grip",
|
|
224
|
+
"aria-hidden": "true"
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ d("div", {
|
|
227
|
+
className: "select-modal__sheetrow",
|
|
228
|
+
children: [
|
|
229
|
+
w && /* @__PURE__ */ u("button", {
|
|
230
|
+
type: "button",
|
|
231
|
+
className: "select-modal__tool select-modal__back",
|
|
232
|
+
"aria-label": Se ?? D.common.back,
|
|
233
|
+
onClick: w,
|
|
234
|
+
children: /* @__PURE__ */ u(t, {})
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ d("div", {
|
|
237
|
+
className: "select-modal__headtext",
|
|
238
|
+
children: [
|
|
239
|
+
m && /* @__PURE__ */ u("span", {
|
|
240
|
+
className: "select-modal__eyebrow",
|
|
241
|
+
children: m
|
|
242
|
+
}),
|
|
243
|
+
K,
|
|
244
|
+
Be
|
|
245
|
+
]
|
|
246
|
+
}),
|
|
247
|
+
($ || X) && /* @__PURE__ */ d("div", {
|
|
248
|
+
className: "select-modal__tools",
|
|
249
|
+
children: [$, X]
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
S && /* @__PURE__ */ u("div", {
|
|
254
|
+
className: "select-modal__headaction",
|
|
255
|
+
children: S
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}), He = /* @__PURE__ */ u("div", {
|
|
259
|
+
className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${ve ? " select-modal__overlay--noise" : ""}${be === "blur" ? " select-modal__overlay--blur" : ""}${A ? " select-modal__overlay--closing" : ""}`,
|
|
260
|
+
"data-theme": xe,
|
|
261
|
+
onMouseDown: E ? p : void 0,
|
|
262
|
+
children: /* @__PURE__ */ u("div", {
|
|
263
|
+
className: `select-modal select-modal--${ge}${x === "side" ? " select-modal--side" : ""}${Te ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${A ? " select-modal--closing" : ""}`,
|
|
264
|
+
ref: M,
|
|
98
265
|
role: "dialog",
|
|
99
266
|
"aria-modal": "true",
|
|
100
|
-
"aria-labelledby":
|
|
101
|
-
"aria-describedby":
|
|
267
|
+
"aria-labelledby": h ? F : void 0,
|
|
268
|
+
"aria-describedby": Ne,
|
|
269
|
+
"aria-busy": H === "loading" || void 0,
|
|
102
270
|
tabIndex: -1,
|
|
103
271
|
onMouseDown: (e) => e.stopPropagation(),
|
|
104
|
-
children:
|
|
272
|
+
children: b ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("aside", {
|
|
105
273
|
className: "select-modal__aside",
|
|
106
|
-
children:
|
|
107
|
-
}), /* @__PURE__ */
|
|
274
|
+
children: b
|
|
275
|
+
}), /* @__PURE__ */ d("div", {
|
|
108
276
|
className: "select-modal__content",
|
|
109
277
|
children: [
|
|
110
|
-
|
|
111
|
-
(
|
|
112
|
-
className:
|
|
278
|
+
X,
|
|
279
|
+
(m || h || g || v) && /* @__PURE__ */ d("div", {
|
|
280
|
+
className: Z,
|
|
113
281
|
children: [
|
|
114
|
-
|
|
282
|
+
m && /* @__PURE__ */ u("span", {
|
|
115
283
|
className: "select-modal__eyebrow",
|
|
116
|
-
children:
|
|
117
|
-
}),
|
|
118
|
-
y && /* @__PURE__ */ f("h2", {
|
|
119
|
-
id: B,
|
|
120
|
-
className: "select-modal__title",
|
|
121
|
-
children: y
|
|
284
|
+
children: m
|
|
122
285
|
}),
|
|
123
|
-
|
|
286
|
+
K,
|
|
287
|
+
q
|
|
124
288
|
]
|
|
125
289
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ d("div", {
|
|
127
291
|
className: "select-modal__body",
|
|
128
|
-
children: [
|
|
292
|
+
children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })]
|
|
129
293
|
})
|
|
130
294
|
]
|
|
131
|
-
})] }) : /* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
295
|
+
})] }) : V ? /* @__PURE__ */ d(l, { children: [
|
|
296
|
+
Ve,
|
|
297
|
+
Re,
|
|
298
|
+
ze
|
|
299
|
+
] }) : /* @__PURE__ */ d(l, { children: [
|
|
300
|
+
X,
|
|
301
|
+
(m || h || g || v) && (S ? /* @__PURE__ */ d("div", {
|
|
302
|
+
className: `${Z} select-modal__header--action`,
|
|
303
|
+
children: [/* @__PURE__ */ d("div", {
|
|
136
304
|
className: "select-modal__headtext",
|
|
137
305
|
children: [
|
|
138
|
-
|
|
306
|
+
m && /* @__PURE__ */ u("span", {
|
|
139
307
|
className: "select-modal__eyebrow",
|
|
140
|
-
children:
|
|
308
|
+
children: m
|
|
141
309
|
}),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
className: "select-modal__title",
|
|
145
|
-
children: y
|
|
146
|
-
}),
|
|
147
|
-
Y
|
|
310
|
+
K,
|
|
311
|
+
q
|
|
148
312
|
]
|
|
149
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ u("div", {
|
|
150
314
|
className: "select-modal__headaction",
|
|
151
|
-
children:
|
|
315
|
+
children: S
|
|
152
316
|
})]
|
|
153
|
-
}) : /* @__PURE__ */
|
|
154
|
-
className:
|
|
317
|
+
}) : /* @__PURE__ */ d("div", {
|
|
318
|
+
className: Z,
|
|
155
319
|
children: [
|
|
156
|
-
|
|
320
|
+
m && /* @__PURE__ */ u("span", {
|
|
157
321
|
className: "select-modal__eyebrow",
|
|
158
|
-
children:
|
|
159
|
-
}),
|
|
160
|
-
y && /* @__PURE__ */ f("h2", {
|
|
161
|
-
id: B,
|
|
162
|
-
className: "select-modal__title",
|
|
163
|
-
children: y
|
|
322
|
+
children: m
|
|
164
323
|
}),
|
|
165
|
-
|
|
324
|
+
K,
|
|
325
|
+
q
|
|
166
326
|
]
|
|
167
327
|
})),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
children: [Z, /* @__PURE__ */ f(o, { children: C })]
|
|
171
|
-
}),
|
|
172
|
-
w && /* @__PURE__ */ f("div", {
|
|
173
|
-
className: "select-modal__footer",
|
|
174
|
-
children: w
|
|
175
|
-
})
|
|
328
|
+
Re,
|
|
329
|
+
ze
|
|
176
330
|
] })
|
|
177
331
|
})
|
|
178
332
|
});
|
|
179
|
-
return
|
|
180
|
-
value:
|
|
181
|
-
children:
|
|
333
|
+
return le(/* @__PURE__ */ u(re, {
|
|
334
|
+
value: L,
|
|
335
|
+
children: He
|
|
182
336
|
}), document.body);
|
|
183
337
|
}
|
|
184
338
|
//#endregion
|
|
185
|
-
export {
|
|
339
|
+
export { m as SelectModal, p as SelectModalActions };
|
|
186
340
|
|
|
187
341
|
//# sourceMappingURL=SelectModal.js.map
|