@selectwin/kit 0.1.126 → 0.1.127
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/SelectChoiceCard.d.ts +6 -0
- package/dist/SelectModal.d.ts +3 -1
- package/dist/index.js +22 -22
- package/dist/style.css +1 -1
- package/package.json +64 -64
|
@@ -33,6 +33,12 @@ type SelectChoiceGridOwnProps = {
|
|
|
33
33
|
loading?: boolean;
|
|
34
34
|
/** Quantos esqueletos — o número de cards que VAI aparecer, para a grade não mudar de forma. */
|
|
35
35
|
skeletonCount?: number;
|
|
36
|
+
/**
|
|
37
|
+
* No celular (≤ 40rem), a grade vira UMA lista numa caixa: cada card é uma linha — ícone, nome,
|
|
38
|
+
* a linha de apoio (o `meta`, ou a descrição quando não há meta), o selo e a chamada à direita
|
|
39
|
+
* (0.1.127). Para os "por onde começar" que no celular empurrariam o conteúdo da tela para baixo.
|
|
40
|
+
*/
|
|
41
|
+
listOnPhone?: boolean;
|
|
36
42
|
};
|
|
37
43
|
export type SelectChoiceGridProps = SelectChoiceGridOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectChoiceGridOwnProps>;
|
|
38
44
|
export declare const SelectChoiceGrid: import('react').ForwardRefExoticComponent<SelectChoiceGridOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectChoiceGridOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/SelectModal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export declare function SelectModal({ open, onClose, title, subtitle, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, }: {
|
|
2
|
+
export declare function SelectModal({ open, onClose, title, subtitle, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, }: {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
title?: ReactNode;
|
|
@@ -17,4 +17,6 @@ export declare function SelectModal({ open, onClose, title, subtitle, children,
|
|
|
17
17
|
* trás (queda do servidor): escurecer só não esconde, o conteúdo segue legível. */
|
|
18
18
|
backdrop?: 'dim' | 'blur';
|
|
19
19
|
theme?: 'light' | 'dark';
|
|
20
|
+
/** `side` = folha lateral à direita, na altura inteira (o detalhe de uma linha da lista). */
|
|
21
|
+
placement?: 'center' | 'side';
|
|
20
22
|
}): import('react').ReactPortal | null;
|
package/dist/index.js
CHANGED
|
@@ -7070,19 +7070,19 @@ var ja = r(function({ title: e, children: t, defaultOpen: n = !1, plain: r = !1,
|
|
|
7070
7070
|
]
|
|
7071
7071
|
});
|
|
7072
7072
|
}), Ia = 220;
|
|
7073
|
-
function La({ open: e, onClose: t, title: n, subtitle: r, children: i, footer: a, aside: s, size: c = "md", showClose: l = !0, noise: u = !0, dividedHeader: f = !1, backdrop: _ = "dim", theme: v = "light" }) {
|
|
7074
|
-
let [
|
|
7073
|
+
function La({ open: e, onClose: t, title: n, subtitle: r, children: i, footer: a, aside: s, size: c = "md", showClose: l = !0, noise: u = !0, dividedHeader: f = !1, backdrop: _ = "dim", theme: v = "light", placement: y = "center" }) {
|
|
7074
|
+
let [b, x] = d(e), [S, C] = d(!1);
|
|
7075
7075
|
if (o(() => {
|
|
7076
|
-
if (e)
|
|
7077
|
-
else if (
|
|
7078
|
-
|
|
7076
|
+
if (e) x(!0), C(!1);
|
|
7077
|
+
else if (b) {
|
|
7078
|
+
C(!0);
|
|
7079
7079
|
let e = setTimeout(() => {
|
|
7080
|
-
|
|
7080
|
+
x(!1), C(!1);
|
|
7081
7081
|
}, Ia);
|
|
7082
7082
|
return () => clearTimeout(e);
|
|
7083
7083
|
}
|
|
7084
|
-
}, [e,
|
|
7085
|
-
if (!
|
|
7084
|
+
}, [e, b]), o(() => {
|
|
7085
|
+
if (!b) return;
|
|
7086
7086
|
let e = (e) => {
|
|
7087
7087
|
e.key === "Escape" && t();
|
|
7088
7088
|
};
|
|
@@ -7091,20 +7091,20 @@ function La({ open: e, onClose: t, title: n, subtitle: r, children: i, footer: a
|
|
|
7091
7091
|
return document.body.style.overflow = "hidden", () => {
|
|
7092
7092
|
document.removeEventListener("keydown", e), document.body.style.overflow = n;
|
|
7093
7093
|
};
|
|
7094
|
-
}, [
|
|
7095
|
-
let
|
|
7094
|
+
}, [b, t]), !b) return null;
|
|
7095
|
+
let w = l && /* @__PURE__ */ m("button", {
|
|
7096
7096
|
type: "button",
|
|
7097
7097
|
className: "select-modal__close",
|
|
7098
7098
|
"aria-label": "Fechar",
|
|
7099
7099
|
onClick: t,
|
|
7100
7100
|
children: /* @__PURE__ */ m(ce, {})
|
|
7101
|
-
}),
|
|
7101
|
+
}), T = `select-modal__header${f ? " select-modal__header--divided" : ""}`;
|
|
7102
7102
|
return g(/* @__PURE__ */ m("div", {
|
|
7103
|
-
className: `select select-modal__overlay${u ? " select-modal__overlay--noise" : ""}${_ === "blur" ? " select-modal__overlay--blur" : ""}${
|
|
7103
|
+
className: `select select-modal__overlay${y === "side" ? " select-modal__overlay--side" : ""}${u ? " select-modal__overlay--noise" : ""}${_ === "blur" ? " select-modal__overlay--blur" : ""}${S ? " select-modal__overlay--closing" : ""}`,
|
|
7104
7104
|
"data-theme": v,
|
|
7105
7105
|
onMouseDown: t,
|
|
7106
7106
|
children: /* @__PURE__ */ m("div", {
|
|
7107
|
-
className: `select-modal select-modal--${c}${s ? " select-modal--split" : ""}${
|
|
7107
|
+
className: `select-modal select-modal--${c}${y === "side" ? " select-modal--side" : ""}${s ? " select-modal--split" : ""}${S ? " select-modal--closing" : ""}`,
|
|
7108
7108
|
role: "dialog",
|
|
7109
7109
|
"aria-modal": "true",
|
|
7110
7110
|
onMouseDown: (e) => e.stopPropagation(),
|
|
@@ -7114,9 +7114,9 @@ function La({ open: e, onClose: t, title: n, subtitle: r, children: i, footer: a
|
|
|
7114
7114
|
}), /* @__PURE__ */ h("div", {
|
|
7115
7115
|
className: "select-modal__content",
|
|
7116
7116
|
children: [
|
|
7117
|
-
|
|
7117
|
+
w,
|
|
7118
7118
|
(n || r) && /* @__PURE__ */ h("div", {
|
|
7119
|
-
className:
|
|
7119
|
+
className: T,
|
|
7120
7120
|
children: [n && /* @__PURE__ */ m("h2", {
|
|
7121
7121
|
className: "select-modal__title",
|
|
7122
7122
|
children: n
|
|
@@ -7131,9 +7131,9 @@ function La({ open: e, onClose: t, title: n, subtitle: r, children: i, footer: a
|
|
|
7131
7131
|
})
|
|
7132
7132
|
]
|
|
7133
7133
|
})] }) : /* @__PURE__ */ h(p, { children: [
|
|
7134
|
-
|
|
7134
|
+
w,
|
|
7135
7135
|
(n || r) && /* @__PURE__ */ h("div", {
|
|
7136
|
-
className:
|
|
7136
|
+
className: T,
|
|
7137
7137
|
children: [n && /* @__PURE__ */ m("h2", {
|
|
7138
7138
|
className: "select-modal__title",
|
|
7139
7139
|
children: n
|
|
@@ -27184,15 +27184,15 @@ function wu({ badge: e = !0 }) {
|
|
|
27184
27184
|
]
|
|
27185
27185
|
});
|
|
27186
27186
|
}
|
|
27187
|
-
var Tu = r(function({ children: e, minCardWidth: t = "15rem", loading: n = !1, skeletonCount: r = 4,
|
|
27187
|
+
var Tu = r(function({ children: e, minCardWidth: t = "15rem", loading: n = !1, skeletonCount: r = 4, listOnPhone: i = !1, className: a, style: o, ...s }, c) {
|
|
27188
27188
|
return /* @__PURE__ */ m("div", {
|
|
27189
|
-
ref:
|
|
27190
|
-
...
|
|
27189
|
+
ref: c,
|
|
27190
|
+
...s,
|
|
27191
27191
|
"aria-busy": n || void 0,
|
|
27192
|
-
className: `select-choicegrid${i ? " " +
|
|
27192
|
+
className: `select-choicegrid${i ? " select-choicegrid--phone-list" : ""}${a ? " " + a : ""}`,
|
|
27193
27193
|
style: {
|
|
27194
27194
|
"--select-choice-min": t,
|
|
27195
|
-
...
|
|
27195
|
+
...o
|
|
27196
27196
|
},
|
|
27197
27197
|
children: n ? Array.from({ length: r }, (e, t) => /* @__PURE__ */ m(wu, {}, t)) : e
|
|
27198
27198
|
});
|