@selectwin/kit 0.1.257 → 0.1.259
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/README.md +75 -0
- package/dist/SelectActionBar.d.ts +29 -0
- package/dist/SelectActionBar.js +101 -0
- package/dist/SelectActionList.d.ts +5 -0
- package/dist/SelectActionList.js +55 -39
- package/dist/SelectAppFrame.d.ts +8 -2
- package/dist/SelectAppFrame.js +124 -119
- package/dist/SelectAvatarGroup.d.ts +31 -0
- package/dist/SelectAvatarGroup.js +39 -0
- package/dist/SelectBadge.d.ts +10 -1
- package/dist/SelectBadge.js +26 -12
- package/dist/SelectBulkBar.d.ts +21 -0
- package/dist/SelectBulkBar.js +40 -0
- package/dist/SelectChannelPreview.d.ts +35 -5
- package/dist/SelectChannelPreview.js +127 -60
- package/dist/SelectColorField.d.ts +1 -5
- package/dist/SelectColorField.js +83 -101
- package/dist/SelectCombobox.d.ts +5 -0
- package/dist/SelectCombobox.js +52 -49
- package/dist/SelectDataTable.d.ts +17 -1
- package/dist/SelectDataTable.js +100 -90
- package/dist/SelectDeadlineBadge.d.ts +32 -0
- package/dist/SelectDeadlineBadge.js +73 -0
- package/dist/SelectFieldset.d.ts +14 -0
- package/dist/SelectFieldset.js +27 -0
- package/dist/SelectFilterBar.d.ts +6 -1
- package/dist/SelectFilterBar.js +155 -125
- package/dist/SelectImageUploadField.d.ts +5 -3
- package/dist/SelectImageUploadField.js +26 -26
- package/dist/SelectKanban.d.ts +13 -1
- package/dist/SelectKanban.js +72 -50
- package/dist/SelectListCard.d.ts +27 -1
- package/dist/SelectListCard.js +47 -22
- package/dist/SelectLocale.d.ts +96 -0
- package/dist/SelectLocale.js +733 -521
- package/dist/SelectMail.d.ts +9 -1
- package/dist/SelectMail.js +234 -207
- package/dist/SelectModal.d.ts +10 -4
- package/dist/SelectModal.js +158 -137
- package/dist/SelectSection.d.ts +4 -4
- package/dist/SelectSection.js +77 -8
- package/dist/SelectSegmented.d.ts +7 -0
- package/dist/SelectSegmented.js +51 -43
- package/dist/SelectSideNav.d.ts +2 -1
- package/dist/SelectSideNav.js +156 -135
- package/dist/SelectSortable.d.ts +47 -1
- package/dist/SelectSortable.js +138 -19
- package/dist/SelectSteps.d.ts +3 -0
- package/dist/SelectSteps.js +42 -31
- package/dist/SelectTable.d.ts +13 -1
- package/dist/SelectTable.js +88 -79
- package/dist/SelectTabs.d.ts +10 -0
- package/dist/SelectTabs.js +68 -30
- package/dist/SelectTimeline.d.ts +4 -0
- package/dist/SelectTimeline.js +20 -9
- package/dist/SelectWeekHours.d.ts +64 -0
- package/dist/SelectWeekHours.js +338 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.js +191 -184
- package/dist/internal/color.d.ts +15 -0
- package/dist/internal/color.js +40 -0
- package/dist/internal/navCount.d.ts +21 -0
- package/dist/internal/navCount.js +27 -0
- package/dist/internal/safeHref.d.ts +7 -0
- package/dist/internal/safeHref.js +12 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectModal.d.ts
CHANGED
|
@@ -20,8 +20,9 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
|
|
|
20
20
|
subtitle?: ReactNode;
|
|
21
21
|
/**
|
|
22
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
|
|
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
|
|
24
|
-
* `badge` + `subtitle`, e a explicação vai no `help`.
|
|
23
|
+
* dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa. Na folha lateral ela não vale: lá a linha de
|
|
24
|
+
* apoio é o `badge` + `subtitle`, e a explicação vai no `help`. Na folha de baixo (`sheet`, 0.1.258), ela abre o corpo,
|
|
25
|
+
* como no centro, também no celular.
|
|
25
26
|
*/
|
|
26
27
|
description?: ReactNode;
|
|
27
28
|
/** 0.1.184: o selo da situação (`SelectBadge`), na linha do subtítulo, antes dele ("Aberto · Chamado · Estorno"). */
|
|
@@ -49,8 +50,13 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
|
|
|
49
50
|
* `<html>`, lido ao abrir (antes o padrão era `light`, também num app escuro).
|
|
50
51
|
*/
|
|
51
52
|
theme?: 'light' | 'dark';
|
|
52
|
-
/**
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* `side` = folha lateral à direita, na altura inteira (o detalhe de uma linha da lista).
|
|
55
|
+
* `sheet` (0.1.258) = o diálogo de formulário que o dedo preenche: no computador, o modal do centro (igual ao `center`);
|
|
56
|
+
* no celular (até 40rem, o corte do CSS do kit), a folha de baixo — a alça, o título e o ✕, a `description`, o corpo
|
|
57
|
+
* que rola e o pé fixo com os botões dividindo a largura. Com `aside`, segue o modal da conta.
|
|
58
|
+
*/
|
|
59
|
+
placement?: 'center' | 'side' | 'sheet';
|
|
54
60
|
/**
|
|
55
61
|
* 0.1.181: um controle na LINHA do título, à direita (a busca do modal de Apps do painel). Numa tela
|
|
56
62
|
* estreita ele desce para baixo do título, na largura toda. Só no layout padrão (sem `aside`). Na folha (0.1.246) ele
|
package/dist/SelectModal.js
CHANGED
|
@@ -9,13 +9,14 @@ import { LayerProvider as re, isTopLayer as ie, openLayer as ae, useParentLayer
|
|
|
9
9
|
import { detectSelectTheme as se } from "./detectSelectTheme.js";
|
|
10
10
|
import { sheetBands as ce } from "./internal/sheetBands.js";
|
|
11
11
|
import { FrameBody as i } from "./internal/frame.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { SelectScrollArea as le } from "./SelectScrollArea.js";
|
|
13
|
+
import { HeadingScope as ue } from "./internal/headingLevel.js";
|
|
14
|
+
import { isDevBuild as de } from "./internal/dev.js";
|
|
14
15
|
import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
15
16
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
16
|
-
import { createPortal as
|
|
17
|
+
import { createPortal as fe } from "react-dom";
|
|
17
18
|
//#region src/SelectModal.tsx
|
|
18
|
-
var
|
|
19
|
+
var pe = 220, f = "(max-width: 40rem)", me = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, he = 64, ge = 120;
|
|
19
20
|
function p({ children: e, className: t, destructive: n }) {
|
|
20
21
|
return /* @__PURE__ */ d("div", {
|
|
21
22
|
className: `select-modal__actions${t ? " " + t : ""}`,
|
|
@@ -25,45 +26,45 @@ function p({ children: e, className: t, destructive: n }) {
|
|
|
25
26
|
}), e]
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help:
|
|
29
|
-
let
|
|
29
|
+
function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: _e, children: y, footer: ve, aside: b, size: ye = "md", showClose: be = !0, noise: xe = !0, dividedHeader: Se = !1, backdrop: Ce = "dim", theme: we, placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: Te, loading: Ee = !1, error: T, onRetry: De, flush: Oe = !1, dismissible: E = !0 }) {
|
|
30
|
+
let D = r(), [O, ke] = c(f), [k, A] = c(!1), j = s(null), M = s(null), N = s(null), P = o(), F = o(), Ae = o(), [I] = c(() => ({})), je = oe(), L = s({
|
|
30
31
|
onClose: p,
|
|
31
|
-
dismissible:
|
|
32
|
+
dismissible: E
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
+
L.current = {
|
|
34
35
|
onClose: p,
|
|
35
|
-
dismissible:
|
|
36
|
+
dismissible: E
|
|
36
37
|
};
|
|
37
|
-
let [
|
|
38
|
+
let [R] = c(() => f && typeof document < "u" ? document.activeElement : null), z = s(null), [Me, Ne] = c(() => f && typeof document < "u" ? se(R) : "light"), B = x === "side" && !b, V = x === "sheet" && !b, H = Ee ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = B && w != null;
|
|
38
39
|
a(() => {
|
|
39
40
|
if (f) {
|
|
40
41
|
var e;
|
|
41
|
-
if (!
|
|
42
|
+
if (!z.current) {
|
|
42
43
|
var t;
|
|
43
|
-
let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t =
|
|
44
|
-
|
|
44
|
+
let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = j.current) != null && t.contains(e));
|
|
45
|
+
z.current = n ? e : R instanceof HTMLElement && R !== document.body ? R : null, Ne(se(z.current));
|
|
45
46
|
}
|
|
46
|
-
(e =
|
|
47
|
-
} else if (
|
|
47
|
+
(e = j.current) == null || e.style.removeProperty("transform"), ke(!0), A(!1);
|
|
48
|
+
} else if (O) {
|
|
48
49
|
var n;
|
|
49
|
-
|
|
50
|
-
let e =
|
|
51
|
-
|
|
50
|
+
A(!0);
|
|
51
|
+
let e = z.current;
|
|
52
|
+
z.current = null;
|
|
52
53
|
let t = document.activeElement;
|
|
53
|
-
e != null && e.isConnected && (!t || t === document.body || (n =
|
|
54
|
+
e != null && e.isConnected && (!t || t === document.body || (n = j.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
|
|
54
55
|
let r = setTimeout(() => {
|
|
55
|
-
|
|
56
|
-
},
|
|
56
|
+
ke(!1), A(!1);
|
|
57
|
+
}, pe);
|
|
57
58
|
return () => clearTimeout(r);
|
|
58
59
|
}
|
|
59
60
|
}, [
|
|
60
61
|
f,
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
O,
|
|
63
|
+
R
|
|
63
64
|
]), a(() => {
|
|
64
|
-
if (!
|
|
65
|
-
let e = ae(
|
|
66
|
-
e.key === "Escape" && !e.defaultPrevented && ie(
|
|
65
|
+
if (!O) return;
|
|
66
|
+
let e = ae(I, je), t = (e) => {
|
|
67
|
+
e.key === "Escape" && !e.defaultPrevented && ie(I) && L.current.dismissible && L.current.onClose();
|
|
67
68
|
};
|
|
68
69
|
document.addEventListener("keydown", t);
|
|
69
70
|
let n = document.body.style.overflow;
|
|
@@ -71,31 +72,31 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
71
72
|
e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
|
|
72
73
|
};
|
|
73
74
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
O,
|
|
76
|
+
I,
|
|
77
|
+
je
|
|
77
78
|
]);
|
|
78
|
-
let W =
|
|
79
|
+
let W = O && !k;
|
|
79
80
|
a(() => {
|
|
80
81
|
if (!W) return;
|
|
81
|
-
let e =
|
|
82
|
+
let e = j.current;
|
|
82
83
|
e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
|
|
83
|
-
}, [W]), ne(W,
|
|
84
|
-
let
|
|
84
|
+
}, [W]), ne(W, j, { initialFocus: !1 });
|
|
85
|
+
let Pe = s(U);
|
|
85
86
|
a(() => {
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
let e =
|
|
87
|
+
if (Pe.current === U) return;
|
|
88
|
+
Pe.current = U, M.current && (M.current.scrollTop = 0);
|
|
89
|
+
let e = j.current, t = document.activeElement;
|
|
89
90
|
e && (!t || t === document.body || !e.contains(t)) && e.focus({ preventScroll: !0 });
|
|
90
91
|
}, [U]);
|
|
91
|
-
let
|
|
92
|
+
let Fe = s(!1);
|
|
92
93
|
a(() => {
|
|
93
|
-
if (!
|
|
94
|
-
let e =
|
|
95
|
-
e > 1 && (
|
|
94
|
+
if (!B || Fe.current || !N.current || !de()) return;
|
|
95
|
+
let e = N.current.querySelectorAll(".select-btn--primary").length;
|
|
96
|
+
e > 1 && (Fe.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).`));
|
|
96
97
|
});
|
|
97
|
-
let G = s(null),
|
|
98
|
-
if (
|
|
98
|
+
let G = s(null), Ie = (e) => {
|
|
99
|
+
if (E && e.button === 0 && me() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
|
|
99
100
|
G.current = {
|
|
100
101
|
id: e.pointerId,
|
|
101
102
|
y: e.clientY,
|
|
@@ -106,57 +107,57 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
106
107
|
(t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId);
|
|
107
108
|
} catch {}
|
|
108
109
|
}
|
|
109
|
-
},
|
|
110
|
-
let t = G.current, n =
|
|
110
|
+
}, Le = (e) => {
|
|
111
|
+
let t = G.current, n = j.current;
|
|
111
112
|
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"));
|
|
112
|
-
},
|
|
113
|
+
}, K = (e) => {
|
|
113
114
|
let t = G.current;
|
|
114
115
|
if (!t || e.pointerId !== t.id) return;
|
|
115
116
|
G.current = null;
|
|
116
|
-
let n =
|
|
117
|
+
let n = j.current;
|
|
117
118
|
if (!n) return;
|
|
118
119
|
delete n.dataset.dragging;
|
|
119
|
-
let r = Math.max(
|
|
120
|
-
e.type === "pointerup" && t.dy > r &&
|
|
120
|
+
let r = Math.max(he, Math.min(ge, n.offsetHeight * .25));
|
|
121
|
+
e.type === "pointerup" && t.dy > r && L.current.dismissible ? L.current.onClose() : n.style.removeProperty("transform");
|
|
121
122
|
};
|
|
122
|
-
if (!
|
|
123
|
-
let
|
|
124
|
-
id:
|
|
123
|
+
if (!O) return null;
|
|
124
|
+
let q = h && (_e == null ? /* @__PURE__ */ u("h2", {
|
|
125
|
+
id: P,
|
|
125
126
|
className: "select-modal__title",
|
|
126
127
|
children: h
|
|
127
128
|
}) : /* @__PURE__ */ d("div", {
|
|
128
129
|
className: "select-modal__titlerow",
|
|
129
130
|
children: [/* @__PURE__ */ u("h2", {
|
|
130
|
-
id:
|
|
131
|
+
id: P,
|
|
131
132
|
className: "select-modal__title",
|
|
132
133
|
children: h
|
|
133
|
-
}), /* @__PURE__ */ u(ee, { content:
|
|
134
|
-
})),
|
|
135
|
-
id:
|
|
134
|
+
}), /* @__PURE__ */ u(ee, { content: _e })]
|
|
135
|
+
})), J = v ? /* @__PURE__ */ d("p", {
|
|
136
|
+
id: F,
|
|
136
137
|
className: "select-modal__subtitle select-modal__subtitle--badge",
|
|
137
138
|
children: [v, g ? /* @__PURE__ */ u("span", { children: g }) : null]
|
|
138
139
|
}) : g && /* @__PURE__ */ u("p", {
|
|
139
|
-
id:
|
|
140
|
+
id: F,
|
|
140
141
|
className: "select-modal__subtitle",
|
|
141
142
|
children: g
|
|
142
|
-
}),
|
|
143
|
-
id:
|
|
143
|
+
}), Y = _ != null && _ !== !1 && _ !== "", X = Y && /* @__PURE__ */ u("p", {
|
|
144
|
+
id: Ae,
|
|
144
145
|
className: "select-modal__description",
|
|
145
146
|
children: _
|
|
146
|
-
}),
|
|
147
|
+
}), Re = [g || v ? F : null, Y ? Ae : null].filter(Boolean).join(" ") || void 0, Z = be && E && /* @__PURE__ */ u("button", {
|
|
147
148
|
type: "button",
|
|
148
|
-
className: `select-modal__close${
|
|
149
|
-
"aria-label":
|
|
149
|
+
className: `select-modal__close${B ? " select-modal__tool" : ""}`,
|
|
150
|
+
"aria-label": D.common.close,
|
|
150
151
|
onClick: p,
|
|
151
152
|
children: /* @__PURE__ */ u(n, {})
|
|
152
|
-
}),
|
|
153
|
+
}), Q = `select-modal__header${Se ? " select-modal__header--divided" : ""}`, ze = (e) => [
|
|
153
154
|
0,
|
|
154
155
|
1,
|
|
155
156
|
2
|
|
156
157
|
].map((t) => /* @__PURE__ */ d("span", {
|
|
157
158
|
className: "select-modal__skelrow",
|
|
158
159
|
children: [/* @__PURE__ */ u("span", { className: `select-skeleton${e ? " select-modal__skeldot" : ""}` }), /* @__PURE__ */ u("span", { className: "select-skeleton" })]
|
|
159
|
-
}, t)),
|
|
160
|
+
}, t)), $ = H === "loading" ? [/* @__PURE__ */ d("div", {
|
|
160
161
|
className: "select-modal__skel",
|
|
161
162
|
children: [
|
|
162
163
|
/* @__PURE__ */ u("span", {
|
|
@@ -166,12 +167,12 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
166
167
|
/* @__PURE__ */ u("span", {
|
|
167
168
|
className: "select-modal__skelrows",
|
|
168
169
|
"aria-hidden": "true",
|
|
169
|
-
children:
|
|
170
|
+
children: ze(!1)
|
|
170
171
|
}),
|
|
171
172
|
/* @__PURE__ */ u("span", {
|
|
172
173
|
className: "select-visually-hidden",
|
|
173
174
|
role: "status",
|
|
174
|
-
children:
|
|
175
|
+
children: D.common.loading
|
|
175
176
|
})
|
|
176
177
|
]
|
|
177
178
|
}, "skel-facts"), /* @__PURE__ */ d("div", {
|
|
@@ -179,47 +180,47 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
179
180
|
"aria-hidden": "true",
|
|
180
181
|
children: [/* @__PURE__ */ u("span", { className: "select-skeleton select-modal__skelhead" }), /* @__PURE__ */ u("span", {
|
|
181
182
|
className: "select-modal__skelrows",
|
|
182
|
-
children:
|
|
183
|
+
children: ze(!0)
|
|
183
184
|
})]
|
|
184
185
|
}, "skel-steps")] : H === "error" ? [/* @__PURE__ */ u(te, {
|
|
185
186
|
tone: "critical",
|
|
186
|
-
action:
|
|
187
|
+
action: De ? /* @__PURE__ */ u(e, {
|
|
187
188
|
variant: "secondary",
|
|
188
189
|
size: "sm",
|
|
189
190
|
inline: !0,
|
|
190
|
-
onClick:
|
|
191
|
-
children:
|
|
191
|
+
onClick: De,
|
|
192
|
+
children: D.modal.retry
|
|
192
193
|
}) : void 0,
|
|
193
|
-
children: T === !0 ?
|
|
194
|
-
}, "error")] : null,
|
|
194
|
+
children: T === !0 ? D.modal.loadFailed : T
|
|
195
|
+
}, "error")] : null, Be = !!y || Y || H !== "ready", Ve = !!ve && H === "ready", He = B && !Oe ? $ ? $.map((e, t) => ({
|
|
195
196
|
key: `state-${t}`,
|
|
196
197
|
node: e
|
|
197
|
-
})) : ce(y) : null,
|
|
198
|
+
})) : ce(y) : null, Ue = He ? /* @__PURE__ */ d(l, { children: [X && /* @__PURE__ */ u("div", {
|
|
199
|
+
className: "select-modal__band",
|
|
200
|
+
children: X
|
|
201
|
+
}), /* @__PURE__ */ u(i, { children: He.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
|
|
202
|
+
className: "select-modal__band",
|
|
203
|
+
children: t
|
|
204
|
+
}, e)) })] }) : /* @__PURE__ */ d(l, { children: [X, /* @__PURE__ */ u(i, { children: $ ?? y })] }), We = Be && u(V ? le : "div", {
|
|
198
205
|
className: "select-modal__body",
|
|
199
|
-
ref:
|
|
200
|
-
children:
|
|
201
|
-
|
|
202
|
-
children: Y
|
|
203
|
-
}), /* @__PURE__ */ u(i, { children: Ve.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
|
|
204
|
-
className: "select-modal__band",
|
|
205
|
-
children: t
|
|
206
|
-
}, e)) })] }) : /* @__PURE__ */ d(l, { children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })] })
|
|
207
|
-
}), Ue = Be && /* @__PURE__ */ u("div", {
|
|
206
|
+
ref: M,
|
|
207
|
+
children: Ue
|
|
208
|
+
}), Ge = Ve && /* @__PURE__ */ u("div", {
|
|
208
209
|
className: "select-modal__footer",
|
|
209
|
-
ref:
|
|
210
|
-
children:
|
|
211
|
-
}),
|
|
210
|
+
ref: N,
|
|
211
|
+
children: ve
|
|
212
|
+
}), Ke = B && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
|
|
212
213
|
className: "select-modal__menu",
|
|
213
214
|
children: C
|
|
214
|
-
}) : null,
|
|
215
|
+
}) : null, qe = J || (H === "loading" ? /* @__PURE__ */ u("span", {
|
|
215
216
|
className: "select-skeleton select-modal__subskel",
|
|
216
217
|
"aria-hidden": "true"
|
|
217
|
-
}) : null),
|
|
218
|
+
}) : null), Je = /* @__PURE__ */ d("div", {
|
|
218
219
|
className: "select-modal__header select-modal__header--sheet",
|
|
219
|
-
onPointerDown:
|
|
220
|
-
onPointerMove:
|
|
221
|
-
onPointerUp:
|
|
222
|
-
onPointerCancel:
|
|
220
|
+
onPointerDown: Ie,
|
|
221
|
+
onPointerMove: Le,
|
|
222
|
+
onPointerUp: K,
|
|
223
|
+
onPointerCancel: K,
|
|
223
224
|
children: [
|
|
224
225
|
/* @__PURE__ */ u("span", {
|
|
225
226
|
className: "select-modal__grip",
|
|
@@ -231,7 +232,7 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
231
232
|
w && /* @__PURE__ */ u("button", {
|
|
232
233
|
type: "button",
|
|
233
234
|
className: "select-modal__tool select-modal__back",
|
|
234
|
-
"aria-label":
|
|
235
|
+
"aria-label": Te ?? D.common.back,
|
|
235
236
|
onClick: w,
|
|
236
237
|
children: /* @__PURE__ */ u(t, {})
|
|
237
238
|
}),
|
|
@@ -242,13 +243,13 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
242
243
|
className: "select-modal__eyebrow",
|
|
243
244
|
children: m
|
|
244
245
|
}),
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
q,
|
|
247
|
+
qe
|
|
247
248
|
]
|
|
248
249
|
}),
|
|
249
|
-
(
|
|
250
|
+
(Ke || Z) && /* @__PURE__ */ d("div", {
|
|
250
251
|
className: "select-modal__tools",
|
|
251
|
-
children: [
|
|
252
|
+
children: [Ke, Z]
|
|
252
253
|
})
|
|
253
254
|
]
|
|
254
255
|
}),
|
|
@@ -257,17 +258,29 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
257
258
|
children: S
|
|
258
259
|
})
|
|
259
260
|
]
|
|
260
|
-
}),
|
|
261
|
-
className:
|
|
262
|
-
"
|
|
263
|
-
|
|
261
|
+
}), Ye = V ? /* @__PURE__ */ u("span", {
|
|
262
|
+
className: "select-modal__grip",
|
|
263
|
+
"aria-hidden": "true"
|
|
264
|
+
}) : null, Xe = V ? {
|
|
265
|
+
onPointerDown: Ie,
|
|
266
|
+
onPointerMove: Le,
|
|
267
|
+
onPointerUp: K,
|
|
268
|
+
onPointerCancel: K
|
|
269
|
+
} : null, Ze = V && !(m || h || g || v) ? /* @__PURE__ */ u("div", {
|
|
270
|
+
className: `${Q} select-modal__header--grip`,
|
|
271
|
+
...Xe,
|
|
272
|
+
children: Ye
|
|
273
|
+
}) : null, Qe = /* @__PURE__ */ u("div", {
|
|
274
|
+
className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${V ? " select-modal__overlay--sheet" : ""}${xe ? " select-modal__overlay--noise" : ""}${Ce === "blur" ? " select-modal__overlay--blur" : ""}${k ? " select-modal__overlay--closing" : ""}`,
|
|
275
|
+
"data-theme": we ?? Me,
|
|
276
|
+
onMouseDown: E ? p : void 0,
|
|
264
277
|
children: /* @__PURE__ */ u("div", {
|
|
265
|
-
className: `select-modal select-modal--${
|
|
266
|
-
ref:
|
|
278
|
+
className: `select-modal select-modal--${ye}${x === "side" ? " select-modal--side" : ""}${V ? " select-modal--sheet" : ""}${Oe ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${k ? " select-modal--closing" : ""}`,
|
|
279
|
+
ref: j,
|
|
267
280
|
role: "dialog",
|
|
268
281
|
"aria-modal": "true",
|
|
269
|
-
"aria-labelledby": h ?
|
|
270
|
-
"aria-describedby":
|
|
282
|
+
"aria-labelledby": h ? P : void 0,
|
|
283
|
+
"aria-describedby": Re,
|
|
271
284
|
"aria-busy": H === "loading" || void 0,
|
|
272
285
|
tabIndex: -1,
|
|
273
286
|
onMouseDown: (e) => e.stopPropagation(),
|
|
@@ -277,66 +290,74 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
|
|
|
277
290
|
}), /* @__PURE__ */ d("div", {
|
|
278
291
|
className: "select-modal__content",
|
|
279
292
|
children: [
|
|
280
|
-
|
|
293
|
+
Z,
|
|
281
294
|
(m || h || g || v) && /* @__PURE__ */ d("div", {
|
|
282
|
-
className:
|
|
295
|
+
className: Q,
|
|
283
296
|
children: [
|
|
284
297
|
m && /* @__PURE__ */ u("span", {
|
|
285
298
|
className: "select-modal__eyebrow",
|
|
286
299
|
children: m
|
|
287
300
|
}),
|
|
288
|
-
|
|
289
|
-
|
|
301
|
+
q,
|
|
302
|
+
J
|
|
290
303
|
]
|
|
291
304
|
}),
|
|
292
305
|
/* @__PURE__ */ d("div", {
|
|
293
306
|
className: "select-modal__body",
|
|
294
|
-
children: [
|
|
307
|
+
children: [X, /* @__PURE__ */ u(i, { children: $ ?? y })]
|
|
295
308
|
})
|
|
296
309
|
]
|
|
297
|
-
})] }) :
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
})] }) : B ? /* @__PURE__ */ d(l, { children: [
|
|
311
|
+
Je,
|
|
312
|
+
We,
|
|
313
|
+
Ge
|
|
301
314
|
] }) : /* @__PURE__ */ d(l, { children: [
|
|
302
|
-
|
|
315
|
+
Z,
|
|
303
316
|
(m || h || g || v) && (S ? /* @__PURE__ */ d("div", {
|
|
304
|
-
className: `${
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
className: `${Q} select-modal__header--action`,
|
|
318
|
+
...Xe,
|
|
319
|
+
children: [
|
|
320
|
+
Ye,
|
|
321
|
+
/* @__PURE__ */ d("div", {
|
|
322
|
+
className: "select-modal__headtext",
|
|
323
|
+
children: [
|
|
324
|
+
m && /* @__PURE__ */ u("span", {
|
|
325
|
+
className: "select-modal__eyebrow",
|
|
326
|
+
children: m
|
|
327
|
+
}),
|
|
328
|
+
q,
|
|
329
|
+
J
|
|
330
|
+
]
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ u("div", {
|
|
333
|
+
className: "select-modal__headaction",
|
|
334
|
+
children: S
|
|
335
|
+
})
|
|
336
|
+
]
|
|
319
337
|
}) : /* @__PURE__ */ d("div", {
|
|
320
|
-
className:
|
|
338
|
+
className: Q,
|
|
339
|
+
...Xe,
|
|
321
340
|
children: [
|
|
341
|
+
Ye,
|
|
322
342
|
m && /* @__PURE__ */ u("span", {
|
|
323
343
|
className: "select-modal__eyebrow",
|
|
324
344
|
children: m
|
|
325
345
|
}),
|
|
326
|
-
|
|
327
|
-
|
|
346
|
+
q,
|
|
347
|
+
J
|
|
328
348
|
]
|
|
329
349
|
})),
|
|
330
|
-
|
|
331
|
-
|
|
350
|
+
Ze,
|
|
351
|
+
We,
|
|
352
|
+
Ge
|
|
332
353
|
] })
|
|
333
354
|
})
|
|
334
355
|
});
|
|
335
|
-
return
|
|
336
|
-
value:
|
|
337
|
-
children: /* @__PURE__ */ u(
|
|
356
|
+
return fe(/* @__PURE__ */ u(re, {
|
|
357
|
+
value: I,
|
|
358
|
+
children: /* @__PURE__ */ u(ue, {
|
|
338
359
|
level: h ? 3 : 2,
|
|
339
|
-
children:
|
|
360
|
+
children: Qe
|
|
340
361
|
})
|
|
341
362
|
}), document.body);
|
|
342
363
|
}
|
package/dist/SelectSection.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
import { SelectHeadingLevel } from './internal/headingLevel';
|
|
3
3
|
type SelectSectionOwnProps = {
|
|
4
4
|
title?: ReactNode;
|
|
5
|
-
/** Ajuda contextual: vira o "!" ao lado do título (SelectInfoTip).
|
|
6
|
-
*
|
|
7
|
-
* inválido. */
|
|
5
|
+
/** Ajuda contextual: vira o "!" ao lado do título (SelectInfoTip). 0.1.259: também na que recolhe — o cabeçalho dela
|
|
6
|
+
* passa a ser um título com o botão que abre e fecha dentro (botão dentro de botão é DOM inválido). */
|
|
8
7
|
help?: ReactNode;
|
|
9
8
|
/** Subdued line under the title (e.g. the step subtitle of a wizard card). Collapsible too:
|
|
10
9
|
* there it is the SUMMARY of what is inside ("Liberação imediata · conclui com 90%"), so the
|
|
11
10
|
* closed card still says what it holds. */
|
|
12
11
|
description?: ReactNode;
|
|
13
|
-
/** Right-aligned action in the head (e.g. an "Editar" link).
|
|
12
|
+
/** Right-aligned action in the head (e.g. an "Editar" link). 0.1.259: também na que recolhe ("Mudar"), à direita, antes
|
|
13
|
+
* da seta; o clique nela é dela (não abre nem fecha). */
|
|
14
14
|
action?: ReactNode;
|
|
15
15
|
/** Make the head a button that expands/collapses the body. */
|
|
16
16
|
collapsible?: boolean;
|
package/dist/SelectSection.js
CHANGED
|
@@ -3,15 +3,84 @@ import { ChevronDownIcon as e } from "./icons.js";
|
|
|
3
3
|
import { SelectInfoTip as t } from "./SelectInfoTip.js";
|
|
4
4
|
import { registerSheetFrame as n } from "./internal/sheetBands.js";
|
|
5
5
|
import { FrameBody as r, useInsideFrame as i } from "./internal/frame.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { inertProps as a } from "./internal/inert.js";
|
|
7
|
+
import { HeadingScope as o, SelectHeading as s, nextHeadingLevel as c, useHeadingLevel as l } from "./internal/headingLevel.js";
|
|
8
8
|
import { forwardRef as u, useId as d, useState as f } from "react";
|
|
9
9
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
//#region src/SelectSection.tsx
|
|
11
11
|
var h = u(function({ title: n, help: u, description: h, action: g, collapsible: _ = !1, defaultOpen: v = !0, open: y, onOpenChange: b, footer: x, flush: S = !1, list: C = !1, headingLevel: w, children: T, className: E, ...D }, O) {
|
|
12
|
-
let k =
|
|
12
|
+
let k = l(w), [A, j] = f(v), M = y ?? A, N = d(), P = () => {
|
|
13
13
|
y === void 0 && j(!M), b == null || b(!M);
|
|
14
14
|
}, F = (i() ? " select-section--nested" : "") + (S ? " select-section--flush" : "") + (C ? " select-section--list" : ""), I = C ? "list" : "body";
|
|
15
|
+
if (_ && (u != null && u !== "" || g != null && g !== !1)) {
|
|
16
|
+
let i = (e) => {
|
|
17
|
+
let t = e.currentTarget, n = e.target;
|
|
18
|
+
if (!(n instanceof Element) || !t.contains(n)) return;
|
|
19
|
+
let r = n.closest("button, a[href], input, select, textarea, label, summary, [role=\"button\"], [tabindex]");
|
|
20
|
+
r && r !== t && t.contains(r) || P();
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ m("div", {
|
|
23
|
+
ref: O,
|
|
24
|
+
...D,
|
|
25
|
+
className: `select-section select-section--collapsible select-section--split${F}${M ? " is-open" : ""}${E ? " " + E : ""}`,
|
|
26
|
+
children: [/* @__PURE__ */ m("div", {
|
|
27
|
+
className: "select-section__head select-section__head--split",
|
|
28
|
+
onClick: i,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ m("div", {
|
|
31
|
+
className: "select-section__heading",
|
|
32
|
+
children: [/* @__PURE__ */ m(s, {
|
|
33
|
+
level: k,
|
|
34
|
+
className: `select-section__title${u != null && u !== "" ? " select-section__title--help" : ""}`,
|
|
35
|
+
children: [/* @__PURE__ */ p("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
className: "select-section__toggle",
|
|
38
|
+
"aria-expanded": M,
|
|
39
|
+
"aria-controls": N,
|
|
40
|
+
"aria-describedby": h ? `${N}-desc` : void 0,
|
|
41
|
+
onClick: P,
|
|
42
|
+
children: n
|
|
43
|
+
}), u != null && u !== "" && /* @__PURE__ */ p(t, { content: u })]
|
|
44
|
+
}), h && /* @__PURE__ */ p("p", {
|
|
45
|
+
id: `${N}-desc`,
|
|
46
|
+
className: "select-section__desc",
|
|
47
|
+
children: h
|
|
48
|
+
})]
|
|
49
|
+
}),
|
|
50
|
+
g != null && g !== !1 ? /* @__PURE__ */ p("div", {
|
|
51
|
+
className: "select-section__action",
|
|
52
|
+
children: g
|
|
53
|
+
}) : null,
|
|
54
|
+
/* @__PURE__ */ p("span", {
|
|
55
|
+
className: "select-section__chevron",
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
children: /* @__PURE__ */ p(e, {})
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}), /* @__PURE__ */ p("div", {
|
|
61
|
+
id: N,
|
|
62
|
+
className: "select-section__collapse",
|
|
63
|
+
"data-open": M,
|
|
64
|
+
...a(!M),
|
|
65
|
+
children: /* @__PURE__ */ m("div", {
|
|
66
|
+
className: "select-section__collapsewrap",
|
|
67
|
+
children: [/* @__PURE__ */ p("div", {
|
|
68
|
+
className: "select-section__body",
|
|
69
|
+
children: /* @__PURE__ */ p(o, {
|
|
70
|
+
level: c(k),
|
|
71
|
+
children: /* @__PURE__ */ p(r, {
|
|
72
|
+
kind: I,
|
|
73
|
+
children: T
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
}), x != null && x !== "" && /* @__PURE__ */ p("div", {
|
|
77
|
+
className: "select-section__foot",
|
|
78
|
+
children: x
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
15
84
|
return _ ? /* @__PURE__ */ m("div", {
|
|
16
85
|
ref: O,
|
|
17
86
|
...D,
|
|
@@ -40,12 +109,12 @@ var h = u(function({ title: n, help: u, description: h, action: g, collapsible:
|
|
|
40
109
|
id: N,
|
|
41
110
|
className: "select-section__collapse",
|
|
42
111
|
"data-open": M,
|
|
43
|
-
...
|
|
112
|
+
...a(!M),
|
|
44
113
|
children: /* @__PURE__ */ m("div", {
|
|
45
114
|
className: "select-section__collapsewrap",
|
|
46
115
|
children: [/* @__PURE__ */ p("div", {
|
|
47
116
|
className: "select-section__body",
|
|
48
|
-
children: /* @__PURE__ */ p(
|
|
117
|
+
children: /* @__PURE__ */ p(o, {
|
|
49
118
|
level: k,
|
|
50
119
|
children: /* @__PURE__ */ p(r, {
|
|
51
120
|
kind: I,
|
|
@@ -67,7 +136,7 @@ var h = u(function({ title: n, help: u, description: h, action: g, collapsible:
|
|
|
67
136
|
className: "select-section__head",
|
|
68
137
|
children: [/* @__PURE__ */ m("div", {
|
|
69
138
|
className: "select-section__heading",
|
|
70
|
-
children: [n && /* @__PURE__ */ m(
|
|
139
|
+
children: [n && /* @__PURE__ */ m(s, {
|
|
71
140
|
level: k,
|
|
72
141
|
className: `select-section__title${u == null ? "" : " select-section__title--help"}`,
|
|
73
142
|
children: [n, u != null && /* @__PURE__ */ p(t, { content: u })]
|
|
@@ -82,8 +151,8 @@ var h = u(function({ title: n, help: u, description: h, action: g, collapsible:
|
|
|
82
151
|
}),
|
|
83
152
|
/* @__PURE__ */ p("div", {
|
|
84
153
|
className: "select-section__body",
|
|
85
|
-
children: /* @__PURE__ */ p(
|
|
86
|
-
level: n ?
|
|
154
|
+
children: /* @__PURE__ */ p(o, {
|
|
155
|
+
level: n ? c(k) : k,
|
|
87
156
|
children: /* @__PURE__ */ p(r, {
|
|
88
157
|
kind: I,
|
|
89
158
|
children: T
|