@geckou/ui-react 0.6.0 → 0.8.0
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 +40 -0
- package/dist/components/BasicButton.js +50 -35
- package/dist/components/CheckBox.d.ts +7 -1
- package/dist/components/CheckBox.js +28 -19
- package/dist/components/CheckBoxes.js +26 -25
- package/dist/components/DatePicker.js +86 -80
- package/dist/components/DateRangePicker.js +47 -47
- package/dist/components/ErrorMessage.d.ts +3 -1
- package/dist/components/ErrorMessage.js +9 -8
- package/dist/components/LabeledCheckbox.d.ts +3 -1
- package/dist/components/LabeledCheckbox.js +18 -16
- package/dist/components/LoadingSpinner.js +28 -16
- package/dist/components/ModalBox.js +49 -45
- package/dist/components/PopupBox.js +9 -9
- package/dist/components/RadioButtons.d.ts +7 -1
- package/dist/components/RadioButtons.js +66 -53
- package/dist/components/SearchableSelectBox.d.ts +2 -1
- package/dist/components/SearchableSelectBox.js +52 -45
- package/dist/components/SelectBox.js +54 -53
- package/dist/components/SlideDownUi.js +9 -9
- package/dist/components/TextArea.js +51 -43
- package/dist/components/TextBox.d.ts +3 -1
- package/dist/components/TextBox.js +62 -60
- package/package.json +2 -2
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { COLOR as
|
|
4
|
-
import { DatePicker as
|
|
5
|
-
import { ErrorMessage as
|
|
6
|
-
import { useRegisterValidation as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
2
|
+
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { formatDateValue as E, COLOR as x, MESSAGES as p } from "@geckou/ui-core";
|
|
4
|
+
import { DatePicker as v } from "./DatePicker.js";
|
|
5
|
+
import { ErrorMessage as M } from "./ErrorMessage.js";
|
|
6
|
+
import { useRegisterValidation as N } from "../hooks/useFormValidation.js";
|
|
7
|
+
const S = { start: "", end: "" };
|
|
8
|
+
function G({
|
|
9
9
|
name: d,
|
|
10
|
-
value: r =
|
|
10
|
+
value: r = S,
|
|
11
11
|
onChange: e,
|
|
12
|
-
isDisabled:
|
|
13
|
-
isRequired:
|
|
14
|
-
formValidationStore:
|
|
15
|
-
minDate:
|
|
16
|
-
maxDate:
|
|
17
|
-
size:
|
|
18
|
-
type:
|
|
12
|
+
isDisabled: l,
|
|
13
|
+
isRequired: i,
|
|
14
|
+
formValidationStore: n,
|
|
15
|
+
minDate: m = "",
|
|
16
|
+
maxDate: f = "",
|
|
17
|
+
size: b = "medium",
|
|
18
|
+
type: t = "date"
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
"--range-background-color":
|
|
24
|
-
"--range-border-color":
|
|
20
|
+
const s = E(r.start, t), o = E(r.end, t), g = !(s && o && s > o);
|
|
21
|
+
N(n, `${d}Range`, g);
|
|
22
|
+
const h = (c) => e == null ? void 0 : e({ start: c, end: r.end }), R = (c) => e == null ? void 0 : e({ start: r.start, end: c }), k = {
|
|
23
|
+
"--range-background-color": x.white,
|
|
24
|
+
"--range-border-color": x.gray
|
|
25
25
|
};
|
|
26
26
|
return (
|
|
27
27
|
// 角丸・区切り線は :first-child / :last-child で割り当てるため、
|
|
28
28
|
// ErrorMessage を同じ階層に置くとエラー表示時だけ枠の見た目が変わる。
|
|
29
29
|
// 入力群を内側にまとめ、ErrorMessage は外側(relative)に置く
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
30
|
+
/* @__PURE__ */ u("div", { style: k, className: "relative", children: [
|
|
31
|
+
/* @__PURE__ */ u("div", { className: "flex bg-(--range-background-color) [&>*]:flex-auto [&>*]:rounded-none! [&>*:first-child]:rounded-s-[calc(var(--bv,0.375rem)/2)]! [&>*:last-child]:rounded-e-[calc(var(--bv,0.375rem)/2)]! [&>*:not(:last-child)]:border-e [&>*:not(:last-child)]:border-(--range-border-color)", children: [
|
|
32
|
+
/* @__PURE__ */ a(
|
|
33
|
+
v,
|
|
34
34
|
{
|
|
35
35
|
name: `${d}Start`,
|
|
36
36
|
value: r.start,
|
|
37
|
-
isDisabled:
|
|
38
|
-
isRequired:
|
|
39
|
-
formValidationStore:
|
|
40
|
-
minDate:
|
|
41
|
-
maxDate:
|
|
42
|
-
size:
|
|
43
|
-
type:
|
|
44
|
-
onChange:
|
|
37
|
+
isDisabled: l,
|
|
38
|
+
isRequired: i,
|
|
39
|
+
formValidationStore: n,
|
|
40
|
+
minDate: m,
|
|
41
|
+
maxDate: o || f,
|
|
42
|
+
size: b,
|
|
43
|
+
type: t,
|
|
44
|
+
onChange: h
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
47
|
+
/* @__PURE__ */ a("div", { className: "flex flex-none! items-center px-[var(--bv,0.375rem)]", children: "〜" }),
|
|
48
|
+
/* @__PURE__ */ a(
|
|
49
|
+
v,
|
|
50
50
|
{
|
|
51
51
|
name: `${d}End`,
|
|
52
52
|
value: r.end,
|
|
53
|
-
isDisabled:
|
|
54
|
-
isRequired:
|
|
55
|
-
formValidationStore:
|
|
56
|
-
minDate:
|
|
57
|
-
maxDate:
|
|
58
|
-
size:
|
|
59
|
-
type:
|
|
60
|
-
onChange:
|
|
53
|
+
isDisabled: l,
|
|
54
|
+
isRequired: i,
|
|
55
|
+
formValidationStore: n,
|
|
56
|
+
minDate: s || m,
|
|
57
|
+
maxDate: f,
|
|
58
|
+
size: b,
|
|
59
|
+
type: t,
|
|
60
|
+
onChange: R
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
] }),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
64
|
+
/* @__PURE__ */ a(
|
|
65
|
+
M,
|
|
66
66
|
{
|
|
67
|
-
errorMessages:
|
|
67
|
+
errorMessages: g ? void 0 : [p.startAfterEnd]
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
] })
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
G as DateRangePicker
|
|
75
75
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
type Props = {
|
|
2
|
+
/** aria-describedby から参照させたいときに渡す */
|
|
3
|
+
id?: string;
|
|
2
4
|
errorMessages?: string[];
|
|
3
5
|
cssStyle?: {
|
|
4
6
|
textColor?: string;
|
|
5
7
|
backgroundColor?: string;
|
|
6
8
|
};
|
|
7
9
|
};
|
|
8
|
-
export declare function ErrorMessage({ errorMessages, cssStyle }: Props): import("react").JSX.Element | null;
|
|
10
|
+
export declare function ErrorMessage({ id, errorMessages, cssStyle }: Props): import("react").JSX.Element | null;
|
|
9
11
|
export {};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { COLOR as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { COLOR as n } from "@geckou/ui-core";
|
|
3
|
+
function c({ id: t, errorMessages: o, cssStyle: r }) {
|
|
4
4
|
if (!o || !o.length)
|
|
5
5
|
return null;
|
|
6
6
|
const b = {
|
|
7
|
-
"--error-text-color": (r == null ? void 0 : r.textColor) ||
|
|
8
|
-
"--error-background-color": (r == null ? void 0 : r.backgroundColor) ||
|
|
7
|
+
"--error-text-color": (r == null ? void 0 : r.textColor) || n.white,
|
|
8
|
+
"--error-background-color": (r == null ? void 0 : r.backgroundColor) || n.red
|
|
9
9
|
};
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ e(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
+
id: t,
|
|
13
14
|
role: "alert",
|
|
14
15
|
className: "absolute top-[calc(100%+0.25rem)] flex w-max flex-col gap-2 rounded-sm bg-(--error-background-color) px-3 py-2 text-sm leading-none text-(--error-text-color) shadow-[0_0_0.5rem_0.25rem_#33333322] before:absolute before:bottom-[calc(100%-1px)] before:left-[0.85rem] before:block before:h-[0.53rem] before:w-[0.85rem] before:bg-(--error-background-color) before:content-[''] before:[clip-path:polygon(50%_0%,100%_100%,0%_100%)]",
|
|
15
16
|
style: b,
|
|
16
|
-
children: o.map((
|
|
17
|
+
children: o.map((l, a) => /* @__PURE__ */ e("span", { children: l }, a))
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
c as ErrorMessage
|
|
22
23
|
};
|
|
@@ -2,11 +2,13 @@ import { CheckBoxStyleForEachStatus } from '../types';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
/** ネイティブ送信時の値(→ CheckBox の value) */
|
|
6
|
+
value?: string | number;
|
|
5
7
|
checked?: boolean;
|
|
6
8
|
onChange?: (newValue: boolean) => void;
|
|
7
9
|
isDisabled?: boolean;
|
|
8
10
|
cssStyle?: CheckBoxStyleForEachStatus;
|
|
9
11
|
isDisableAnimation?: boolean;
|
|
10
12
|
};
|
|
11
|
-
export declare function LabeledCheckbox({ name, label, checked, onChange, isDisabled, cssStyle, isDisableAnimation, }: Props): import("react").JSX.Element;
|
|
13
|
+
export declare function LabeledCheckbox({ name, label, value, checked, onChange, isDisabled, cssStyle, isDisableAnimation, }: Props): import("react").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { CheckBox as
|
|
2
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useId as p } from "react";
|
|
4
|
+
import { CheckBox as C } from "./CheckBox.js";
|
|
5
5
|
import { COLOR as r } from "@geckou/ui-core";
|
|
6
|
-
function
|
|
6
|
+
function N({
|
|
7
7
|
name: l,
|
|
8
8
|
label: d,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
value: i,
|
|
10
|
+
checked: m,
|
|
11
|
+
onChange: u,
|
|
11
12
|
isDisabled: e,
|
|
12
13
|
cssStyle: o,
|
|
13
|
-
isDisableAnimation:
|
|
14
|
+
isDisableAnimation: x
|
|
14
15
|
}) {
|
|
15
|
-
const a =
|
|
16
|
+
const a = m ?? !1, n = p(), k = e ? o == null ? void 0 : o.disabled : o == null ? void 0 : o.default, c = {
|
|
16
17
|
textColor: e ? r.darkGray : r.black,
|
|
17
18
|
backgroundColor: e ? r.darkGray : r.blue,
|
|
18
|
-
...
|
|
19
|
-
},
|
|
19
|
+
...k ?? {}
|
|
20
|
+
}, b = {
|
|
20
21
|
"--text-color": c.textColor,
|
|
21
22
|
"--checked-color": c.backgroundColor
|
|
22
23
|
};
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ h("label", { className: "inline-flex cursor-pointer items-center gap-[.5em] has-[button:disabled]:cursor-auto", children: [
|
|
24
25
|
/* @__PURE__ */ t("span", { className: "pointer-events-none", children: /* @__PURE__ */ t(
|
|
25
|
-
|
|
26
|
+
C,
|
|
26
27
|
{
|
|
27
28
|
name: l,
|
|
29
|
+
value: i,
|
|
28
30
|
checked: a,
|
|
29
|
-
onChange:
|
|
31
|
+
onChange: u,
|
|
30
32
|
isDisabled: e,
|
|
31
33
|
cssStyle: o,
|
|
32
|
-
isDisableAnimation:
|
|
34
|
+
isDisableAnimation: x,
|
|
33
35
|
ariaLabelledBy: n
|
|
34
36
|
}
|
|
35
37
|
) }),
|
|
@@ -37,7 +39,7 @@ function L({
|
|
|
37
39
|
"span",
|
|
38
40
|
{
|
|
39
41
|
id: n,
|
|
40
|
-
style:
|
|
42
|
+
style: b,
|
|
41
43
|
className: a ? "text-(--text-color)" : "text-(--checked-color)",
|
|
42
44
|
children: d
|
|
43
45
|
}
|
|
@@ -45,5 +47,5 @@ function L({
|
|
|
45
47
|
] });
|
|
46
48
|
}
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
N as LabeledCheckbox
|
|
49
51
|
};
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { jsx as c, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
function i() {
|
|
3
|
-
return
|
|
4
|
-
|
|
5
|
-
/* @__PURE__ */ c("circle", { cx: "16.75", cy: "3.77", r: "1.5", opacity: ".29" }),
|
|
6
|
-
/* @__PURE__ */ c("circle", { cx: "20.23", cy: "7.25", r: "1.5", opacity: ".43" }),
|
|
7
|
-
/* @__PURE__ */ c("circle", { cx: "21.50", cy: "12.00", r: "1.5", opacity: ".57" }),
|
|
8
|
-
/* @__PURE__ */ c("circle", { cx: "20.23", cy: "16.75", r: "1.5", opacity: ".71" }),
|
|
9
|
-
/* @__PURE__ */ c("circle", { cx: "16.75", cy: "20.23", r: "1.5", opacity: ".86" }),
|
|
10
|
-
/* @__PURE__ */ c("circle", { cx: "12", cy: "21.5", r: "1.5" }),
|
|
3
|
+
return (
|
|
4
|
+
// 装飾。読み上げ対象にしない(状態は呼び出し側の aria-busy で伝える)
|
|
11
5
|
/* @__PURE__ */ c(
|
|
12
|
-
"
|
|
6
|
+
"svg",
|
|
13
7
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
children: /* @__PURE__ */ r("g", { children: [
|
|
13
|
+
/* @__PURE__ */ c("circle", { cx: "12", cy: "2.5", r: "1.5", opacity: ".14" }),
|
|
14
|
+
/* @__PURE__ */ c("circle", { cx: "16.75", cy: "3.77", r: "1.5", opacity: ".29" }),
|
|
15
|
+
/* @__PURE__ */ c("circle", { cx: "20.23", cy: "7.25", r: "1.5", opacity: ".43" }),
|
|
16
|
+
/* @__PURE__ */ c("circle", { cx: "21.50", cy: "12.00", r: "1.5", opacity: ".57" }),
|
|
17
|
+
/* @__PURE__ */ c("circle", { cx: "20.23", cy: "16.75", r: "1.5", opacity: ".71" }),
|
|
18
|
+
/* @__PURE__ */ c("circle", { cx: "16.75", cy: "20.23", r: "1.5", opacity: ".86" }),
|
|
19
|
+
/* @__PURE__ */ c("circle", { cx: "12", cy: "21.5", r: "1.5" }),
|
|
20
|
+
/* @__PURE__ */ c(
|
|
21
|
+
"animateTransform",
|
|
22
|
+
{
|
|
23
|
+
attributeName: "transform",
|
|
24
|
+
type: "rotate",
|
|
25
|
+
calcMode: "discrete",
|
|
26
|
+
dur: "0.75s",
|
|
27
|
+
values: "0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12",
|
|
28
|
+
repeatCount: "indefinite"
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] })
|
|
20
32
|
}
|
|
21
33
|
)
|
|
22
|
-
|
|
34
|
+
);
|
|
23
35
|
}
|
|
24
36
|
export {
|
|
25
37
|
i as LoadingSpinner
|
|
@@ -1,71 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { createScrollLock as
|
|
5
|
-
const
|
|
2
|
+
import { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
3
|
+
import { useId as y, useRef as o, useEffect as i } from "react";
|
|
4
|
+
import { createScrollLock as w, createModalLayer as h, handleTabKey as k } from "@geckou/ui-core";
|
|
5
|
+
const E = {
|
|
6
6
|
small: "max-w-[var(--mobile-lower-width,430px)]",
|
|
7
7
|
medium: "max-w-[var(--desktop-lower-width,1025px)]",
|
|
8
8
|
large: "max-w-[var(--contents-max-width,1440px)]"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
function L() {
|
|
11
|
+
return /* @__PURE__ */ a(
|
|
12
12
|
"svg",
|
|
13
13
|
{
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
15
|
viewBox: "0 -960 960 960",
|
|
16
16
|
fill: "currentColor",
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ a("path", { d: "m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" })
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
function _({
|
|
22
22
|
isShown: r,
|
|
23
|
-
size:
|
|
24
|
-
onClose:
|
|
25
|
-
header:
|
|
23
|
+
size: f = "medium",
|
|
24
|
+
onClose: n,
|
|
25
|
+
header: u,
|
|
26
26
|
footer: d,
|
|
27
|
-
children:
|
|
28
|
-
ariaLabel:
|
|
27
|
+
children: v,
|
|
28
|
+
ariaLabel: x
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const e =
|
|
30
|
+
const s = y(), m = o(null), g = o(w());
|
|
31
|
+
i(() => {
|
|
32
|
+
const e = g.current;
|
|
33
33
|
return e.toggle(r), () => e.release();
|
|
34
34
|
}, [r]);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const e =
|
|
35
|
+
const p = o(h());
|
|
36
|
+
i(() => {
|
|
37
|
+
const e = p.current;
|
|
38
38
|
return e.toggle(r, m.current), () => e.release();
|
|
39
39
|
}, [r]);
|
|
40
|
-
const l =
|
|
41
|
-
return
|
|
42
|
-
var e
|
|
43
|
-
if (r)
|
|
44
|
-
l.current ?? (l.current = document.activeElement), (e = m.current) == null || e.focus()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [r]),
|
|
40
|
+
const l = o(null), c = o(!1);
|
|
41
|
+
return i(() => {
|
|
42
|
+
var e;
|
|
43
|
+
if (r)
|
|
44
|
+
return l.current ?? (l.current = document.activeElement), (e = m.current) == null || e.focus(), () => {
|
|
45
|
+
var t;
|
|
46
|
+
(t = l.current) == null || t.focus(), l.current = null;
|
|
47
|
+
};
|
|
48
|
+
}, [r]), i(() => {
|
|
49
49
|
if (!r)
|
|
50
50
|
return;
|
|
51
|
-
const e = (
|
|
52
|
-
if (
|
|
53
|
-
if (
|
|
54
|
-
|
|
51
|
+
const e = (t) => {
|
|
52
|
+
if (p.current.isTopmost() && !t.defaultPrevented) {
|
|
53
|
+
if (t.key === "Escape") {
|
|
54
|
+
t.preventDefault(), n();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
k(m.current, t, document.activeElement);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
61
|
-
}, [r,
|
|
61
|
+
}, [r, n]), /* @__PURE__ */ a(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: `fixed top-0 left-0 z-50 flex h-dvh w-dvw cursor-pointer items-center justify-center overflow-hidden bg-[#33333380] p-[var(--sp-larger,3rem)] backdrop-blur-sm transition-opacity duration-100 max-md:px-[var(--sp-large,1.5rem)] ${r ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"}`,
|
|
65
65
|
"aria-hidden": !r,
|
|
66
66
|
inert: !r,
|
|
67
|
+
onPointerDown: (e) => {
|
|
68
|
+
c.current = e.target === e.currentTarget;
|
|
69
|
+
},
|
|
67
70
|
onClick: (e) => {
|
|
68
|
-
|
|
71
|
+
const t = c.current;
|
|
72
|
+
c.current = !1, t && e.target === e.currentTarget && n();
|
|
69
73
|
},
|
|
70
74
|
children: /* @__PURE__ */ b(
|
|
71
75
|
"div",
|
|
@@ -73,29 +77,29 @@ function _({
|
|
|
73
77
|
ref: m,
|
|
74
78
|
role: "dialog",
|
|
75
79
|
"aria-modal": "true",
|
|
76
|
-
"aria-labelledby":
|
|
77
|
-
"aria-label":
|
|
80
|
+
"aria-labelledby": u ? s : void 0,
|
|
81
|
+
"aria-label": u ? void 0 : x ?? "ダイアログ",
|
|
78
82
|
tabIndex: -1,
|
|
79
|
-
className: `relative flex max-h-full w-full cursor-auto flex-col rounded-[var(--radius-small,0.1875rem)] bg-white drop-shadow-[0_0_6px_#33333355] ${
|
|
83
|
+
className: `relative flex max-h-full w-full cursor-auto flex-col rounded-[var(--radius-small,0.1875rem)] bg-white drop-shadow-[0_0_6px_#33333355] ${E[f]}`,
|
|
80
84
|
children: [
|
|
81
|
-
|
|
85
|
+
u && /* @__PURE__ */ a(
|
|
82
86
|
"header",
|
|
83
87
|
{
|
|
84
|
-
id:
|
|
88
|
+
id: s,
|
|
85
89
|
className: "border-b border-[#eee] px-[var(--sp-large,1.5rem)] py-[var(--sp-medium,0.75rem)] max-md:p-[var(--sp-medium,0.75rem)] [&>h2]:font-bold [&>h2]:text-[var(--fs-large,0.875rem)]",
|
|
86
|
-
children:
|
|
90
|
+
children: u
|
|
87
91
|
}
|
|
88
92
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
d && /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ a("div", { className: "flex-auto overflow-auto p-[var(--sp-large,1.5rem)] max-md:p-[var(--sp-medium,0.75rem)]", children: v }),
|
|
94
|
+
d && /* @__PURE__ */ a("footer", { className: "flex justify-center gap-[var(--sp-large,1.5rem)] border-t border-[#eee] px-[var(--sp-large,1.5rem)] py-[var(--sp-medium,0.75rem)] max-md:gap-[var(--sp-medium,0.75rem)] max-md:p-[var(--sp-medium,0.75rem)] max-md:[&>*]:flex-auto", children: d }),
|
|
95
|
+
/* @__PURE__ */ a(
|
|
92
96
|
"button",
|
|
93
97
|
{
|
|
94
98
|
type: "button",
|
|
95
99
|
"aria-label": "閉じる",
|
|
96
100
|
className: "absolute bottom-full left-full size-[var(--icon-medium,1.125rem)] cursor-pointer leading-none text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white [&>*]:size-full",
|
|
97
|
-
onClick:
|
|
98
|
-
children: /* @__PURE__ */
|
|
101
|
+
onClick: n,
|
|
102
|
+
children: /* @__PURE__ */ a(L, {})
|
|
99
103
|
}
|
|
100
104
|
)
|
|
101
105
|
]
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as n, useRef as c, useEffect as l, useImperativeHandle as f } from "react";
|
|
4
4
|
import { createPortal as p } from "react-dom";
|
|
5
5
|
import { COLOR as d } from "@geckou/ui-core";
|
|
6
6
|
const x = {
|
|
7
7
|
left: "left-[max(calc((100vw-64rem)/2),1rem)]",
|
|
8
8
|
right: "right-[max(calc((100vw-64rem)/2),1rem)]",
|
|
9
9
|
center: "inset-0 m-auto"
|
|
10
|
-
},
|
|
10
|
+
}, h = {
|
|
11
11
|
top: "top-14",
|
|
12
12
|
bottom: "bottom-4",
|
|
13
13
|
center: "inset-0 m-auto"
|
|
14
14
|
};
|
|
15
15
|
function y({
|
|
16
16
|
position: t = { x: "right", y: "top" },
|
|
17
|
-
ref:
|
|
18
|
-
children:
|
|
17
|
+
ref: m,
|
|
18
|
+
children: s
|
|
19
19
|
}) {
|
|
20
|
-
const [
|
|
20
|
+
const [r, o] = n(!1), [u, a] = n(!1), e = c(null);
|
|
21
21
|
return l(() => (a(!0), () => {
|
|
22
22
|
e.current && clearTimeout(e.current);
|
|
23
|
-
}), []), f(
|
|
23
|
+
}), []), f(m, () => ({
|
|
24
24
|
showPopup: () => {
|
|
25
|
-
|
|
25
|
+
o(!0), e.current && clearTimeout(e.current), e.current = setTimeout(() => o(!1), 3e3);
|
|
26
26
|
}
|
|
27
27
|
})), u ? p(
|
|
28
28
|
/* @__PURE__ */ i(
|
|
@@ -30,8 +30,8 @@ function y({
|
|
|
30
30
|
{
|
|
31
31
|
role: "status",
|
|
32
32
|
style: { borderColor: d.blue },
|
|
33
|
-
className: `pointer-events-none fixed z-50 h-max w-max max-w-40 rounded-[var(--radius-small,0.1875rem)] border bg-white p-[var(--sp-medium,0.75rem)] transition-[transform,opacity] duration-300 ${x[t.x]} ${
|
|
34
|
-
children:
|
|
33
|
+
className: `pointer-events-none fixed z-50 h-max w-max max-w-40 rounded-[var(--radius-small,0.1875rem)] border bg-white p-[var(--sp-medium,0.75rem)] transition-[transform,opacity] duration-300 ${x[t.x]} ${h[t.y]} ${r ? "opacity-100" : "opacity-0"}`,
|
|
34
|
+
children: r && s
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
37
|
document.body
|
|
@@ -8,6 +8,12 @@ type Props = {
|
|
|
8
8
|
isRequired?: boolean;
|
|
9
9
|
cssStyle?: RadioButtonStyleForEachStatus;
|
|
10
10
|
isDisableAnimation?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* ラジオグループ自体のアクセシブル名。
|
|
13
|
+
* 可視ラベル(見出し等)があるなら ariaLabelledBy でその要素を指すこと
|
|
14
|
+
*/
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
ariaLabelledBy?: string;
|
|
11
17
|
};
|
|
12
|
-
export declare function RadioButtons({ value, onChange, options, name, isDisabled, isRequired, cssStyle, isDisableAnimation, }: Props): import("react").JSX.Element;
|
|
18
|
+
export declare function RadioButtons({ value, onChange, options, name, isDisabled, isRequired, cssStyle, isDisableAnimation, ariaLabel, ariaLabelledBy, }: Props): import("react").JSX.Element;
|
|
13
19
|
export {};
|