@geckou/ui-react 0.3.0 → 0.5.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.
@@ -1,64 +1,70 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as c } from "react/jsx-runtime";
3
- import { useId as h } from "react";
4
- import { COLOR as r } from "@geckou/ui-core";
5
- function R({
6
- value: s,
7
- onChange: t,
8
- options: b,
9
- name: f,
10
- isDisabled: o,
11
- isRequired: p,
2
+ import { jsxs as f, jsx as u } from "react/jsx-runtime";
3
+ import { useState as N, useRef as G, useEffect as R, useId as z } from "react";
4
+ import { isEmptyValue as M, MESSAGES as V, COLOR as o } from "@geckou/ui-core";
5
+ import { ErrorMessage as j } from "./ErrorMessage.js";
6
+ function A({
7
+ value: p,
8
+ onChange: s,
9
+ options: m,
10
+ name: _,
11
+ isDisabled: a,
12
+ isRequired: n,
12
13
  cssStyle: e,
13
- isDisableAnimation: m
14
+ isDisableAnimation: v
14
15
  }) {
15
- var d, i;
16
- const _ = s ?? "", x = h(), v = f ?? x, k = o ? e == null ? void 0 : e.disabled : e == null ? void 0 : e.default, l = {
17
- textColor: o ? r.darkGray : r.black,
18
- backgroundColor: o ? r.lightGray : r.white,
16
+ var i, d;
17
+ const r = p ?? "", [g, x] = N(!1), c = G(r);
18
+ R(() => {
19
+ c.current !== r && (c.current = r, x(!0));
20
+ }, [r]);
21
+ const h = g && n && M(r) ? [V.required] : void 0, k = z(), w = _ ?? k, C = a ? e == null ? void 0 : e.disabled : e == null ? void 0 : e.default, l = {
22
+ textColor: a ? o.darkGray : o.black,
23
+ backgroundColor: a ? o.lightGray : o.white,
19
24
  border: {
20
- color: o ? r.darkGray : r.blue,
25
+ color: a ? o.darkGray : o.blue,
21
26
  size: "1px"
22
27
  },
23
- ...k ?? {}
24
- }, g = {
28
+ ...C ?? {}
29
+ }, E = {
25
30
  "--text-color": l.textColor,
26
- "--border-color": (d = l.border) == null ? void 0 : d.color,
27
- "--border-size": (i = l.border) == null ? void 0 : i.size,
31
+ "--border-color": (i = l.border) == null ? void 0 : i.color,
32
+ "--border-size": (d = l.border) == null ? void 0 : d.size,
28
33
  "--background-color": l.backgroundColor,
29
- "--duration": m ? "0s" : ".3s"
34
+ "--duration": v ? "0s" : ".3s"
30
35
  };
31
- return /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-4", children: [
32
- /* @__PURE__ */ c("style", { children: "@keyframes uiRadioPop{0%{scale:1}10%{scale:.8}50%{scale:1.2}100%{scale:1}}" }),
33
- b.map((a) => {
34
- const u = a.value === _;
35
- return /* @__PURE__ */ n(
36
+ return /* @__PURE__ */ f("div", { className: "relative flex flex-wrap items-center gap-4", children: [
37
+ /* @__PURE__ */ u("style", { children: "@keyframes uiRadioPop{0%{scale:1}10%{scale:.8}50%{scale:1.2}100%{scale:1}}" }),
38
+ m.map((t) => {
39
+ const b = t.value === r;
40
+ return /* @__PURE__ */ f(
36
41
  "label",
37
42
  {
38
- style: g,
39
- className: `relative grid cursor-pointer grid-cols-[auto_1fr] items-center gap-2 before:inline-block before:aspect-square before:w-4 before:rounded-full before:transition-all before:duration-(--duration) before:ease-linear before:content-[''] has-[input:disabled]:cursor-not-allowed has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-(--border-color) ${u ? "text-(--text-color) before:animate-[uiRadioPop_var(--duration)_ease-out] before:bg-(--border-color) before:shadow-[0_0_0_2px_var(--background-color)_inset,0_0_0_1px_var(--border-color)]" : "text-(--border-color) before:bg-(--background-color) before:shadow-[0_0_0_1px_var(--border-color)_inset]"}`,
43
+ style: E,
44
+ className: `relative grid cursor-pointer grid-cols-[auto_1fr] items-center gap-2 before:inline-block before:aspect-square before:w-4 before:rounded-full before:transition-all before:duration-(--duration) before:ease-linear before:content-[''] has-[input:disabled]:cursor-not-allowed has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-(--border-color) ${b ? "text-(--text-color) before:animate-[uiRadioPop_var(--duration)_ease-out] before:bg-(--border-color) before:shadow-[0_0_0_2px_var(--background-color)_inset,0_0_0_1px_var(--border-color)]" : "text-(--border-color) before:bg-(--background-color) before:shadow-[0_0_0_1px_var(--border-color)_inset]"}`,
40
45
  children: [
41
- /* @__PURE__ */ c(
46
+ /* @__PURE__ */ u(
42
47
  "input",
43
48
  {
44
49
  type: "radio",
45
- name: v,
46
- value: a.value,
47
- disabled: o,
48
- required: p,
49
- checked: u,
50
- onChange: () => t == null ? void 0 : t(a.value),
50
+ name: w,
51
+ value: t.value,
52
+ disabled: a,
53
+ required: n,
54
+ checked: b,
55
+ onChange: () => s == null ? void 0 : s(t.value),
51
56
  className: "sr-only"
52
57
  }
53
58
  ),
54
- /* @__PURE__ */ c("span", { children: a.label })
59
+ /* @__PURE__ */ u("span", { children: t.label })
55
60
  ]
56
61
  },
57
- a.value
62
+ t.value
58
63
  );
59
- })
64
+ }),
65
+ /* @__PURE__ */ u(j, { errorMessages: h })
60
66
  ] });
61
67
  }
62
68
  export {
63
- R as RadioButtons
69
+ A as RadioButtons
64
70
  };
@@ -9,6 +9,8 @@ type Props = {
9
9
  isDisabled?: boolean;
10
10
  searchTarget?: 'label' | 'value';
11
11
  cssStyle?: InputBoxStyleForEachStatus;
12
+ /** combobox のアクセシブル名。可視ラベルがあるならそちらを ariaLabelledBy で指すこと */
13
+ ariaLabel?: string;
12
14
  };
13
- export declare function SearchableSelectBox({ options, value, onChange, onSelect, name, placeholder, isDisabled, searchTarget, cssStyle, }: Props): import("react").JSX.Element;
15
+ export declare function SearchableSelectBox({ options, value, onChange, onSelect, name, placeholder, isDisabled, searchTarget, cssStyle, ariaLabel, }: Props): import("react").JSX.Element;
14
16
  export {};
@@ -1,61 +1,104 @@
1
1
  "use client";
2
- import { jsxs as N, jsx as n } from "react/jsx-runtime";
3
- import { useState as p, useRef as v, useEffect as w } from "react";
4
- import { TextBox as S } from "./TextBox.js";
5
- function F({
6
- options: i,
7
- value: t,
2
+ import { jsxs as N, jsx as w } from "react/jsx-runtime";
3
+ import { useState as v, useRef as k, useId as _, useEffect as y } from "react";
4
+ import { TextBox as $ } from "./TextBox.js";
5
+ function R({
6
+ options: h,
7
+ value: o,
8
8
  onChange: s,
9
- onSelect: o,
10
- name: x,
11
- placeholder: b = "入力してください",
12
- isDisabled: h,
13
- searchTarget: E = "label",
14
- cssStyle: O
9
+ onSelect: d,
10
+ name: A,
11
+ placeholder: I = "入力してください",
12
+ isDisabled: g,
13
+ searchTarget: B = "label",
14
+ cssStyle: L,
15
+ ariaLabel: O
15
16
  }) {
16
- const [l, a] = p(t), [k, c] = p(!1), u = v(null), d = v(t);
17
- w(() => {
18
- d.current !== t && (d.current = t, a(t));
19
- }, [t]), w(() => {
17
+ const [u, f] = v(o), [p, a] = v(!1), [i, n] = v(-1), x = k(null), m = _(), b = (e) => `${m}-option-${e}`, E = k(o);
18
+ y(() => {
19
+ E.current !== o && (E.current = o, f(o));
20
+ }, [o]), y(() => {
20
21
  const e = (r) => {
21
- const f = u.current;
22
- f && !f.contains(r.target) && c(!1);
22
+ const t = x.current;
23
+ t && !t.contains(r.target) && a(!1);
23
24
  };
24
25
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
25
26
  }, []);
26
- const m = l ? i.filter(
27
- (e) => String(e[E]).toLowerCase().includes(l.toLowerCase())
28
- ) : i, B = (e) => {
27
+ const l = u ? h.filter(
28
+ (e) => String(e[B]).toLowerCase().includes(u.toLowerCase())
29
+ ) : h, F = (e) => {
29
30
  const r = String(e);
30
- a(r), c(!!r), s == null || s(r);
31
- }, L = (e) => {
31
+ f(r), a(!!r), n(-1), s == null || s(r);
32
+ }, D = (e) => {
32
33
  const r = e.value.toString();
33
- a(r), c(!1), s == null || s(r), o == null || o(r);
34
+ f(r), a(!1), n(-1), s == null || s(r), d == null || d(r);
35
+ }, c = p && l.length > 0, S = (e) => {
36
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
37
+ if (e.preventDefault(), !p) {
38
+ a(!0), n(
39
+ e.key === "ArrowDown" ? 0 : l.length - 1
40
+ );
41
+ return;
42
+ }
43
+ if (l.length === 0)
44
+ return;
45
+ n((r) => {
46
+ const t = l.length - 1;
47
+ return e.key === "ArrowDown" ? r >= t ? 0 : r + 1 : r <= 0 ? t : r - 1;
48
+ });
49
+ return;
50
+ }
51
+ if (e.key === "Enter") {
52
+ const r = c ? l[i] : void 0;
53
+ r && (e.preventDefault(), D(r));
54
+ return;
55
+ }
56
+ e.key === "Escape" && p && (e.preventDefault(), a(!1), n(-1));
34
57
  };
35
- return /* @__PURE__ */ N("div", { ref: u, className: "relative", children: [
36
- /* @__PURE__ */ n(
37
- S,
58
+ return /* @__PURE__ */ N("div", { ref: x, className: "relative", children: [
59
+ /* @__PURE__ */ w(
60
+ $,
38
61
  {
39
- name: x,
40
- value: l,
41
- onChange: B,
42
- isDisabled: h,
43
- placeholder: b,
44
- cssStyle: O
62
+ name: A,
63
+ value: u,
64
+ onChange: F,
65
+ isDisabled: g,
66
+ placeholder: I,
67
+ cssStyle: L,
68
+ role: "combobox",
69
+ ariaLabel: O,
70
+ ariaAutocomplete: "list",
71
+ ariaExpanded: c,
72
+ ariaControls: m,
73
+ ariaActivedescendant: c && i >= 0 ? b(i) : void 0,
74
+ onKeyDown: S
45
75
  }
46
76
  ),
47
- k && m.length > 0 && /* @__PURE__ */ n("div", { className: "absolute top-[calc(100%-var(--sp-min,0.1875rem))] left-0 z-[2] max-h-[calc(var(--bv,0.375rem)*56)] min-w-full overflow-auto rounded-[var(--radius-small,0.1875rem)] bg-white py-[var(--sp-small,0.375rem)] shadow-[0_0_6px_#33333333]", children: m.map((e) => /* @__PURE__ */ n(
48
- "button",
77
+ c && /* @__PURE__ */ w(
78
+ "div",
49
79
  {
50
- type: "button",
51
- className: "block w-full cursor-pointer p-[var(--sp-medium,0.75rem)] text-left text-[length:var(--fs-small,0.6875rem)] text-[var(--link-color,#1c4ac9)] hover:bg-[var(--hover-color,#EEF7FB)] hover:transition-all hover:duration-100",
52
- onClick: () => L(e),
53
- children: e.label
54
- },
55
- e.value
56
- )) })
80
+ id: m,
81
+ role: "listbox",
82
+ className: "absolute top-[calc(100%-var(--sp-min,0.1875rem))] left-0 z-[2] max-h-[calc(var(--bv,0.375rem)*56)] min-w-full overflow-auto rounded-[var(--radius-small,0.1875rem)] bg-white py-[var(--sp-small,0.375rem)] shadow-[0_0_6px_#33333333]",
83
+ children: l.map((e, r) => /* @__PURE__ */ w(
84
+ "div",
85
+ {
86
+ id: b(r),
87
+ role: "option",
88
+ "aria-selected": r === i,
89
+ className: `block w-full cursor-pointer p-[var(--sp-medium,0.75rem)] text-left text-[length:var(--fs-small,0.6875rem)] text-[var(--link-color,#1c4ac9)] hover:bg-[var(--hover-color,#EEF7FB)] hover:transition-all hover:duration-100 ${r === i ? "bg-[var(--hover-color,#EEF7FB)]" : ""}`,
90
+ onPointerDown: (t) => {
91
+ t.preventDefault(), D(e);
92
+ },
93
+ onMouseEnter: () => n(r),
94
+ children: e.label
95
+ },
96
+ e.value
97
+ ))
98
+ }
99
+ )
57
100
  ] });
58
101
  }
59
102
  export {
60
- F as SearchableSelectBox
103
+ R as SearchableSelectBox
61
104
  };
@@ -1,70 +1,71 @@
1
1
  "use client";
2
- import { jsxs as I, jsx as k } from "react/jsx-runtime";
3
- import { useState as $, useRef as v, useId as w } from "react";
2
+ import { jsxs as I, jsx as a } from "react/jsx-runtime";
3
+ import { useState as v, useRef as $, useId as w } from "react";
4
4
  import { COLOR as T } from "@geckou/ui-core";
5
5
  function C({
6
- tabs: r,
7
- color: t,
6
+ tabs: t,
7
+ color: r,
8
8
  initialIndex: p = 0,
9
9
  tabSlots: d,
10
10
  panelSlots: y
11
11
  }) {
12
- const [c, o] = $(
12
+ const [i, k] = v(
13
13
  () => {
14
14
  var e, n;
15
- return ((e = r[p]) == null ? void 0 : e.key) ?? ((n = r[0]) == null ? void 0 : n.key) ?? "";
15
+ return ((e = t[p]) == null ? void 0 : e.key) ?? ((n = t[0]) == null ? void 0 : n.key) ?? "";
16
16
  }
17
- ), s = v([]), a = w(), u = (e) => `${a}-tab-${e}`, f = (e) => `${a}-panel-${e}`, m = (e) => o(e), l = (e) => {
17
+ ), s = $([]), u = w(), o = (e) => `${u}-tab-${e}`, f = (e) => `${u}-panel-${e}`, l = (e) => k(e), x = (e) => {
18
18
  var n;
19
- o(r[e].key), (n = s.current[e]) == null || n.focus();
19
+ k(t[e].key), (n = s.current[e]) == null || n.focus();
20
20
  }, h = (e) => {
21
21
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight")
22
22
  return;
23
- const n = r.findIndex((g) => g.key === c);
23
+ const n = t.findIndex((g) => g.key === i);
24
24
  if (n === -1)
25
25
  return;
26
26
  e.preventDefault();
27
- const i = r.length - 1;
28
- e.key === "ArrowLeft" ? l(n > 0 ? n - 1 : i) : l(n < i ? n + 1 : 0);
29
- }, x = {
30
- "--active-color": (t == null ? void 0 : t.active) || T.blue,
31
- "--background-color": (t == null ? void 0 : t.background) || "transparent"
27
+ const c = t.length - 1;
28
+ e.key === "ArrowLeft" ? x(n > 0 ? n - 1 : c) : x(n < c ? n + 1 : 0);
29
+ }, m = {
30
+ "--active-color": (r == null ? void 0 : r.active) || T.blue,
31
+ "--background-color": (r == null ? void 0 : r.background) || "transparent",
32
+ "--text-color": (r == null ? void 0 : r.text) || "inherit"
32
33
  };
33
34
  return /* @__PURE__ */ I("div", { children: [
34
- /* @__PURE__ */ k(
35
+ /* @__PURE__ */ a(
35
36
  "div",
36
37
  {
37
- style: x,
38
+ style: m,
38
39
  className: "flex bg-(--background-color)",
39
40
  role: "tablist",
40
41
  onKeyDown: h,
41
- children: r.map((e, n) => /* @__PURE__ */ k(
42
+ children: t.map((e, n) => /* @__PURE__ */ a(
42
43
  "button",
43
44
  {
44
- id: u(e.key),
45
- ref: (i) => {
46
- s.current[n] = i;
45
+ id: o(e.key),
46
+ ref: (c) => {
47
+ s.current[n] = c;
47
48
  },
48
49
  type: "button",
49
50
  role: "tab",
50
51
  "aria-controls": f(e.key),
51
- "aria-selected": c === e.key,
52
- tabIndex: c === e.key ? 0 : -1,
53
- className: `border-none bg-transparent px-4 py-2 text-base ${c === e.key ? "cursor-auto" : "cursor-pointer"}`,
54
- onClick: () => m(e.key),
52
+ "aria-selected": i === e.key,
53
+ tabIndex: i === e.key ? 0 : -1,
54
+ className: `border-none bg-transparent px-4 py-2 text-base ${i === e.key ? "cursor-auto text-(--active-color)" : "cursor-pointer text-(--text-color)"}`,
55
+ onClick: () => l(e.key),
55
56
  children: (d == null ? void 0 : d[e.key]) ?? e.label
56
57
  },
57
58
  e.key
58
59
  ))
59
60
  }
60
61
  ),
61
- r.map((e) => /* @__PURE__ */ k(
62
+ t.map((e) => /* @__PURE__ */ a(
62
63
  "div",
63
64
  {
64
65
  id: f(e.key),
65
66
  role: "tabpanel",
66
- "aria-labelledby": u(e.key),
67
- hidden: c !== e.key,
67
+ "aria-labelledby": o(e.key),
68
+ hidden: i !== e.key,
68
69
  children: y == null ? void 0 : y[`${e.key}Contents`]
69
70
  },
70
71
  `${e.key}_panel`
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { KeyboardEvent, ReactNode } from 'react';
2
2
  import { InputBoxStyleForEachStatus, Validates } from '../types';
3
3
  type InputValue = string | number;
4
4
  type Props = {
@@ -15,6 +15,19 @@ type Props = {
15
15
  validates?: Validates;
16
16
  before?: ReactNode;
17
17
  after?: ReactNode;
18
+ /** input の id。combobox のように外から参照する必要があるときに渡す */
19
+ id?: string;
20
+ /**
21
+ * input へそのまま渡す ARIA 属性とキー操作。
22
+ * SearchableSelectBox のような複合ウィジェットから使う(通常は指定しない)
23
+ */
24
+ role?: string;
25
+ ariaLabel?: string;
26
+ ariaExpanded?: boolean;
27
+ ariaControls?: string;
28
+ ariaActivedescendant?: string;
29
+ ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both';
30
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
18
31
  };
19
- export declare function TextBox({ name, value, onChange, cssStyle, inputType, placeholder, isDisabled, isRequired, maxLength, autocomplete, validates, before, after, }: Props): import("react").JSX.Element;
32
+ export declare function TextBox({ name, value, onChange, cssStyle, inputType, placeholder, isDisabled, isRequired, maxLength, autocomplete, validates, before, after, id, role, ariaLabel, ariaExpanded, ariaControls, ariaActivedescendant, ariaAutocomplete, onKeyDown, }: Props): import("react").JSX.Element;
20
33
  export {};
@@ -1,83 +1,99 @@
1
1
  "use client";
2
- import { jsxs as W, jsx as c } from "react/jsx-runtime";
3
- import { isEmptyValue as w, convertFullWidthToHalfWidth as x, validateInputValue as C } from "@geckou/ui-core";
4
- import { useState as F, useRef as n, useEffect as H } from "react";
5
- import { InputBox as N } from "./InputBox.js";
6
- import { ErrorMessage as q } from "./ErrorMessage.js";
7
- function L({
2
+ import { jsxs as A, jsx as s } from "react/jsx-runtime";
3
+ import { isEmptyValue as G, convertFullWidthToHalfWidth as x, validateInputValue as J } from "@geckou/ui-core";
4
+ import { useState as K, useRef as n, useEffect as L } from "react";
5
+ import { InputBox as O } from "./InputBox.js";
6
+ import { ErrorMessage as P } from "./ErrorMessage.js";
7
+ function Z({
8
8
  name: v,
9
9
  value: E,
10
10
  onChange: t,
11
11
  cssStyle: r,
12
12
  inputType: V = "text",
13
- placeholder: g = "入力してください",
13
+ placeholder: b = "入力してください",
14
14
  isDisabled: l,
15
15
  isRequired: f,
16
- maxLength: B = 30,
17
- autocomplete: M = "off",
18
- validates: T = [],
19
- before: b,
20
- after: j
16
+ maxLength: g = 30,
17
+ autocomplete: B = "off",
18
+ validates: M = [],
19
+ before: T,
20
+ after: j,
21
+ id: k,
22
+ role: I,
23
+ ariaLabel: W,
24
+ ariaExpanded: w,
25
+ ariaControls: C,
26
+ ariaActivedescendant: F,
27
+ ariaAutocomplete: H,
28
+ onKeyDown: N
21
29
  }) {
22
- var m, s;
23
- const [o, k] = F([]), e = E ?? "", u = () => {
24
- k(C(e, { isRequired: f, validates: T }));
25
- }, I = n(e), p = n(!1);
26
- H(() => {
30
+ var d, c;
31
+ const [o, q] = K([]), e = E ?? "", a = () => {
32
+ q(J(e, { isRequired: f, validates: M }));
33
+ }, z = n(e), p = n(!1);
34
+ L(() => {
27
35
  if (!p.current) {
28
- if (e === I.current) {
29
- w(e) || u();
36
+ if (e === z.current) {
37
+ G(e) || a();
30
38
  return;
31
39
  }
32
40
  p.current = !0;
33
41
  }
34
- u();
42
+ a();
35
43
  }, [e]);
36
44
  const i = n(!1);
37
- return /* @__PURE__ */ W(
38
- N,
45
+ return /* @__PURE__ */ A(
46
+ O,
39
47
  {
40
48
  cssStyle: r,
41
49
  className: "inline-flex [&>input]:flex-auto",
42
50
  isErrored: !!o.length,
43
51
  isDisabled: l,
44
52
  children: [
45
- b,
46
- /* @__PURE__ */ c(
53
+ T,
54
+ /* @__PURE__ */ s(
47
55
  "input",
48
56
  {
49
57
  type: V,
58
+ id: k,
50
59
  name: v,
60
+ role: I,
61
+ "aria-label": W,
62
+ "aria-expanded": w,
63
+ "aria-controls": C,
64
+ "aria-activedescendant": F,
65
+ "aria-autocomplete": H,
66
+ onKeyDown: N,
51
67
  value: e,
52
68
  required: f,
53
- placeholder: g,
69
+ placeholder: b,
54
70
  disabled: l,
55
- autoComplete: M,
56
- maxLength: B,
71
+ autoComplete: B,
72
+ maxLength: g,
57
73
  "aria-invalid": o.length ? "true" : void 0,
58
- onChange: (a) => {
59
- const d = a.target.value;
74
+ onChange: (u) => {
75
+ const m = u.target.value;
60
76
  t == null || t(
61
- i.current ? d : x(d)
77
+ i.current ? m : x(m)
62
78
  );
63
79
  },
64
80
  onCompositionStart: () => {
65
81
  i.current = !0;
66
82
  },
67
- onCompositionEnd: (a) => {
68
- i.current = !1, t == null || t(x(a.currentTarget.value));
83
+ onCompositionEnd: (u) => {
84
+ i.current = !1, t == null || t(x(u.currentTarget.value));
69
85
  },
70
- onBlur: () => u()
86
+ onBlur: () => a()
71
87
  }
72
88
  ),
73
89
  j,
74
- /* @__PURE__ */ c(
75
- q,
90
+ /* @__PURE__ */ s(
91
+ P,
76
92
  {
77
93
  errorMessages: o,
78
94
  cssStyle: {
79
- textColor: (m = r == null ? void 0 : r.error) == null ? void 0 : m.backgroundColor,
80
- backgroundColor: (s = r == null ? void 0 : r.error) == null ? void 0 : s.textColor
95
+ textColor: (d = r == null ? void 0 : r.error) == null ? void 0 : d.backgroundColor,
96
+ backgroundColor: (c = r == null ? void 0 : r.error) == null ? void 0 : c.textColor
81
97
  }
82
98
  }
83
99
  )
@@ -86,5 +102,5 @@ function L({
86
102
  );
87
103
  }
88
104
  export {
89
- L as TextBox
105
+ Z as TextBox
90
106
  };
@@ -10,6 +10,9 @@ type Props = {
10
10
  onChange?: (newValue: boolean) => void;
11
11
  isDisabled?: boolean;
12
12
  cssStyle?: StyleForEachStatus<ToggleStyle>;
13
+ /** アクセシブル名。可視ラベルがあるなら ariaLabelledBy でその要素を指すこと */
14
+ ariaLabel?: string;
15
+ ariaLabelledBy?: string;
13
16
  };
14
- export declare function ToggleButton({ name, label, checked, onChange, isDisabled, cssStyle, }: Props): import("react").JSX.Element;
17
+ export declare function ToggleButton({ name, label, checked, onChange, isDisabled, cssStyle, ariaLabel, ariaLabelledBy, }: Props): import("react").JSX.Element;
15
18
  export {};