@selectwin/kit 0.1.204 → 0.1.205
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/SelectCollapsible.d.ts +4 -0
- package/dist/SelectCollapsible.js +26 -21
- package/dist/SelectSection.d.ts +4 -0
- package/dist/SelectSection.js +49 -44
- package/package.json +1 -1
|
@@ -3,6 +3,10 @@ type SelectCollapsibleOwnProps = {
|
|
|
3
3
|
title: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
defaultOpen?: boolean;
|
|
6
|
+
/** 0.1.205: o aberto controlado pela tela (com `onOpenChange`). */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** 0.1.205: o cabeçalho pediu para abrir (`true`) ou fechar (`false`). */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
10
|
plain?: boolean;
|
|
7
11
|
};
|
|
8
12
|
export type SelectCollapsibleProps = SelectCollapsibleOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectCollapsibleOwnProps>;
|
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
import { ChevronDownIcon as e } from "./icons.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { inertProps as t } from "./internal/inert.js";
|
|
3
|
+
import { forwardRef as n, useId as r, useState as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
5
|
//#region src/SelectCollapsible.tsx
|
|
5
|
-
var
|
|
6
|
-
let [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var s = n(function({ title: n, children: s, defaultOpen: c = !1, open: l, onOpenChange: u, plain: d = !1, className: f, ...p }, m) {
|
|
7
|
+
let [h, g] = i(c), _ = l ?? h, v = r(), y = () => {
|
|
8
|
+
l === void 0 && g(!_), u == null || u(!_);
|
|
9
|
+
};
|
|
10
|
+
return /* @__PURE__ */ o("div", {
|
|
11
|
+
ref: m,
|
|
12
|
+
...p,
|
|
13
|
+
className: `select-collapsible${d ? " select-collapsible--plain" : ""}${_ ? " is-open" : ""}${f ? " " + f : ""}`,
|
|
14
|
+
children: [/* @__PURE__ */ o("button", {
|
|
12
15
|
type: "button",
|
|
13
16
|
className: "select-collapsible__header",
|
|
14
|
-
onClick:
|
|
15
|
-
"aria-expanded":
|
|
16
|
-
|
|
17
|
+
onClick: y,
|
|
18
|
+
"aria-expanded": _,
|
|
19
|
+
"aria-controls": v,
|
|
20
|
+
children: [/* @__PURE__ */ a("span", {
|
|
17
21
|
className: "select-collapsible__title",
|
|
18
|
-
children:
|
|
19
|
-
}), /* @__PURE__ */
|
|
22
|
+
children: n
|
|
23
|
+
}), /* @__PURE__ */ a("span", {
|
|
20
24
|
className: "select-collapsible__chevron",
|
|
21
25
|
"aria-hidden": "true",
|
|
22
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ a(e, {})
|
|
23
27
|
})]
|
|
24
|
-
}), /* @__PURE__ */
|
|
28
|
+
}), /* @__PURE__ */ a("div", {
|
|
25
29
|
className: "select-collapsible__bodywrap",
|
|
26
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ a("div", {
|
|
31
|
+
id: v,
|
|
27
32
|
className: "select-collapsible__bodyclip",
|
|
28
|
-
|
|
29
|
-
children: /* @__PURE__ */
|
|
33
|
+
...t(!_),
|
|
34
|
+
children: /* @__PURE__ */ a("div", {
|
|
30
35
|
className: "select-collapsible__body",
|
|
31
|
-
children:
|
|
36
|
+
children: s
|
|
32
37
|
})
|
|
33
38
|
})
|
|
34
39
|
})]
|
|
35
40
|
});
|
|
36
41
|
});
|
|
37
42
|
//#endregion
|
|
38
|
-
export {
|
|
43
|
+
export { s as SelectCollapsible };
|
|
39
44
|
|
|
40
45
|
//# sourceMappingURL=SelectCollapsible.js.map
|
package/dist/SelectSection.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ type SelectSectionOwnProps = {
|
|
|
15
15
|
collapsible?: boolean;
|
|
16
16
|
/** Initial open state when collapsible. Default open. */
|
|
17
17
|
defaultOpen?: boolean;
|
|
18
|
+
/** 0.1.205: o aberto controlado pela tela (com `onOpenChange`); sem ele, a seção guarda o estado (`defaultOpen`). */
|
|
19
|
+
open?: boolean;
|
|
20
|
+
/** 0.1.205: o cabeçalho pediu para abrir (`true`) ou fechar (`false`). */
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
22
|
/**
|
|
19
23
|
* Linha de rodapé na moldura cinza, sob o corpo (0.1.135) — a nota que vale para o card inteiro
|
|
20
24
|
* ("A mesma compra não conta duas vezes…"). Fica FORA do corpo para não virar um segundo filho
|
package/dist/SelectSection.js
CHANGED
|
@@ -2,82 +2,87 @@
|
|
|
2
2
|
import { ChevronDownIcon as e } from "./icons.js";
|
|
3
3
|
import { SelectInfoTip as t } from "./SelectInfoTip.js";
|
|
4
4
|
import { FrameBody as n, useInsideFrame as r } from "./internal/frame.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { inertProps as i } from "./internal/inert.js";
|
|
6
|
+
import { forwardRef as a, useId as o, useState as s } from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
8
|
//#region src/SelectSection.tsx
|
|
8
|
-
var
|
|
9
|
-
let [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
var u = a(function({ title: a, help: u, description: d, action: f, collapsible: p = !1, defaultOpen: m = !0, open: h, onOpenChange: g, footer: _, flush: v = !1, children: y, className: b, ...x }, S) {
|
|
10
|
+
let [C, w] = s(m), T = h ?? C, E = o(), D = () => {
|
|
11
|
+
h === void 0 && w(!T), g == null || g(!T);
|
|
12
|
+
}, O = (r() ? " select-section--nested" : "") + (v ? " select-section--flush" : "");
|
|
13
|
+
return p ? /* @__PURE__ */ l("div", {
|
|
14
|
+
ref: S,
|
|
15
|
+
...x,
|
|
16
|
+
className: `select-section select-section--collapsible${O}${T ? " is-open" : ""}${b ? " " + b : ""}`,
|
|
17
|
+
children: [/* @__PURE__ */ l("button", {
|
|
15
18
|
type: "button",
|
|
16
19
|
className: "select-section__head select-section__head--toggle",
|
|
17
|
-
"aria-expanded":
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
"aria-expanded": T,
|
|
21
|
+
"aria-controls": E,
|
|
22
|
+
onClick: D,
|
|
23
|
+
children: [/* @__PURE__ */ l("span", {
|
|
20
24
|
className: "select-section__heading",
|
|
21
|
-
children: [
|
|
25
|
+
children: [a && /* @__PURE__ */ c("span", {
|
|
22
26
|
className: "select-section__title",
|
|
23
|
-
children:
|
|
24
|
-
}),
|
|
27
|
+
children: a
|
|
28
|
+
}), d && /* @__PURE__ */ c("span", {
|
|
25
29
|
className: "select-section__desc",
|
|
26
|
-
children:
|
|
30
|
+
children: d
|
|
27
31
|
})]
|
|
28
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ c("span", {
|
|
29
33
|
className: "select-section__chevron",
|
|
30
34
|
"aria-hidden": "true",
|
|
31
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ c(e, {})
|
|
32
36
|
})]
|
|
33
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ c("div", {
|
|
38
|
+
id: E,
|
|
34
39
|
className: "select-section__collapse",
|
|
35
|
-
"data-open":
|
|
36
|
-
|
|
37
|
-
children: /* @__PURE__ */
|
|
40
|
+
"data-open": T,
|
|
41
|
+
...i(!T),
|
|
42
|
+
children: /* @__PURE__ */ l("div", {
|
|
38
43
|
className: "select-section__collapsewrap",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ c("div", {
|
|
40
45
|
className: "select-section__body",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
}),
|
|
46
|
+
children: /* @__PURE__ */ c(n, { children: y })
|
|
47
|
+
}), _ != null && _ !== "" && /* @__PURE__ */ c("div", {
|
|
43
48
|
className: "select-section__foot",
|
|
44
|
-
children:
|
|
49
|
+
children: _
|
|
45
50
|
})]
|
|
46
51
|
})
|
|
47
52
|
})]
|
|
48
|
-
}) : /* @__PURE__ */
|
|
49
|
-
ref:
|
|
50
|
-
...
|
|
51
|
-
className: `select-section${
|
|
53
|
+
}) : /* @__PURE__ */ l("div", {
|
|
54
|
+
ref: S,
|
|
55
|
+
...x,
|
|
56
|
+
className: `select-section${O}${b ? " " + b : ""}`,
|
|
52
57
|
children: [
|
|
53
|
-
(
|
|
58
|
+
(a || d || f) && /* @__PURE__ */ l("div", {
|
|
54
59
|
className: "select-section__head",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ l("div", {
|
|
56
61
|
className: "select-section__heading",
|
|
57
|
-
children: [
|
|
58
|
-
className: `select-section__title${
|
|
59
|
-
children: [
|
|
60
|
-
}),
|
|
62
|
+
children: [a && /* @__PURE__ */ l("h2", {
|
|
63
|
+
className: `select-section__title${u == null ? "" : " select-section__title--help"}`,
|
|
64
|
+
children: [a, u != null && /* @__PURE__ */ c(t, { content: u })]
|
|
65
|
+
}), d && /* @__PURE__ */ c("p", {
|
|
61
66
|
className: "select-section__desc",
|
|
62
|
-
children:
|
|
67
|
+
children: d
|
|
63
68
|
})]
|
|
64
|
-
}),
|
|
69
|
+
}), f ? /* @__PURE__ */ c("div", {
|
|
65
70
|
className: "select-section__action",
|
|
66
|
-
children:
|
|
71
|
+
children: f
|
|
67
72
|
}) : null]
|
|
68
73
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ c("div", {
|
|
70
75
|
className: "select-section__body",
|
|
71
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ c(n, { children: y })
|
|
72
77
|
}),
|
|
73
|
-
|
|
78
|
+
_ != null && _ !== "" && /* @__PURE__ */ c("div", {
|
|
74
79
|
className: "select-section__foot",
|
|
75
|
-
children:
|
|
80
|
+
children: _
|
|
76
81
|
})
|
|
77
82
|
]
|
|
78
83
|
});
|
|
79
84
|
});
|
|
80
85
|
//#endregion
|
|
81
|
-
export {
|
|
86
|
+
export { u as SelectSection };
|
|
82
87
|
|
|
83
88
|
//# sourceMappingURL=SelectSection.js.map
|
package/package.json
CHANGED