@petnow/ui 5.4.0 โ†’ 6.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Breaking
6
+
7
+ - **`Select`** is no longer a native `<select>`. It is built on Radix Select, like the Select in
8
+ petify-admin-console: the trigger keeps the `TextField` look, and the options open in a panel below it
9
+ (portal to `body`, 8px radius, border, shadow) with a check in front of the picked option and the
10
+ picked option in the accent color. Keyboard (arrows, Enter, Escape, typeahead) and ARIA come from Radix.
11
+ - `ref` reaches the trigger `<button>` (`HTMLButtonElement`), and the rest props are button attributes,
12
+ not `<select>` attributes. `name`, `form` and `required` still work: inside a form, Radix renders a
13
+ hidden `<select>`, so the value reaches `FormData` and browser validation.
14
+ - Mobile browsers show this panel instead of the system picker.
15
+ - An option value cannot be `""`; `""` means nothing is picked and shows `placeholder`. Options with
16
+ `""` are left out. Once picked, the user cannot go back to "nothing picked"; the native `<select>`
17
+ let them pick the placeholder again. Set `value` to `""` in code if a form needs that.
18
+ - A form `reset` restores `defaultValue` (or nothing) on screen and in the hidden `<select>`; a
19
+ controlled `Select` gets it through `onChange`.
20
+ - **`TextFieldSelect`** is removed. It was only a button that called `onPress`, without a list. Use
21
+ `Select` (or `Combobox` to search). See [`docs/migration/v5-to-v6.md`](docs/migration/v5-to-v6.md).
22
+
23
+ ### Changes
24
+
25
+ - `Combobox` opens its list in the same panel as `Select`, through a Radix Popover portal, so a parent with
26
+ `overflow: hidden` or a scroll container no longer clips it, and the list flips above the input when
27
+ there is no room below. Its options use the `Select` row (left check slot, accent color for the picked
28
+ option). The list is in the DOM only while it is open, so the input and toggle set `aria-controls` only
29
+ then. Escape on an open list closes only the list, not a surrounding dialog.
30
+ - TextField stories no longer show select-like fields: the `SelectField` and `SelectFieldSmallError`
31
+ stories are removed, and `NormalWithErrorAndCounter` no longer shows a dropdown chevron.
32
+
3
33
  ## 5.4.0
4
34
 
5
35
  ### Added
package/dist/combobox.js CHANGED
@@ -1,201 +1,215 @@
1
1
  "use client";
2
2
  import { t as e } from "./TailwindUtil-DiNvXuNl.js";
3
- import { a as t, n, o as r, t as ee } from "./fieldStyles-DyZu__hI.js";
4
- import { ChevronDownIcon as te } from "./icons/action/chevron-down.js";
5
- import { n as ne, r as re, t as ie } from "./mergeRefs-BHwdBwNQ.js";
3
+ import { a as t, i as n, t as r } from "./fieldStyles-DXyDrzxD.js";
4
+ import { ChevronDownIcon as ee } from "./icons/action/chevron-down.js";
5
+ import { c as te, d as ne, l as re, n as ie, o as ae, t as oe, u as se } from "./mergeRefs-CsNeQOZ6.js";
6
6
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
7
+ import { useCallback as ce, useEffect as o, useId as le, useMemo as ue, useRef as s, useState as c } from "react";
8
+ import { Popover as l } from "radix-ui";
8
9
  //#region src/components/combobox/Combobox.tsx
9
- var d = (e) => e.toLocaleLowerCase().replace(/\s+/g, ""), f = (e, t) => d(e.label).includes(d(t)), p = ({ id: p, label: m, options: ae, value: h, onChange: oe, filter: g = f, emptyText: _, toggleLabel: v, invalidSelectionText: y = "Select an option from the list.", errorText: b, assistiveText: x, size: S = "large", name: C, required: w, disabled: T = !1, placeholder: se, className: ce, autoComplete: le = "off", "aria-describedby": ue, onBlur: de, onKeyDown: fe, onClick: pe, ref: E, ...D }) => {
10
- let me = s(), O = p ?? me, k = `${O}-listbox`, A = `${O}-message`, j = (e) => `${O}-option-${e}`, M = !!b, he = !!(b || x), N = `${O}-label`, P = l(null), F = c(() => ie(P, E), [E]), I = l(null), L = l(!1), R = ae.map((e) => typeof e == "string" ? {
10
+ var u = (e) => e.toLocaleLowerCase().replace(/\s+/g, ""), de = (e, t) => u(e.label).includes(u(t)), d = ({ id: d, label: f, options: fe, value: p, onChange: pe, filter: m = de, emptyText: h, toggleLabel: g, invalidSelectionText: _ = "Select an option from the list.", errorText: v, assistiveText: y, size: b = "large", name: x, required: S, disabled: C = !1, placeholder: me, className: he, autoComplete: ge = "off", "aria-describedby": _e, onBlur: ve, onKeyDown: ye, onClick: w, ref: T, ...E }) => {
11
+ let be = le(), D = d ?? be, O = `${D}-listbox`, k = `${D}-message`, A = (e) => `${D}-option-${e}`, j = !!v, M = !!(v || y), N = `${D}-label`, P = s(null), xe = ue(() => oe(P, T), [T]), F = s(null), I = s(!1), L = fe.map((e) => typeof e == "string" ? {
11
12
  value: e,
12
13
  label: e
13
- } : e), z = R.find((e) => e.value === h), [B, V] = u(null), [H, U] = u(!1), [W, G] = u(-1), K = R.map((e, t) => ({
14
+ } : e), R = L.find((e) => e.value === p), [z, B] = c(null), [V, H] = c(!1), [U, W] = c(-1), G = L.map((e, t) => ({
14
15
  option: e,
15
16
  index: t
16
- })).filter(({ option: e }) => !B || g(e, B)), q = H && !T && (K.length > 0 || _ !== void 0), J = K.filter(({ option: e }) => !e.disabled);
17
+ })).filter(({ option: e }) => !z || m(e, z)), K = V && !C && (G.length > 0 || h !== void 0), q = G.filter(({ option: e }) => !e.disabled), J = s(-1);
17
18
  o(() => {
18
- let e = L.current;
19
- L.current = !1, !(!q || W < 0 || !e) && document.getElementById(j(W))?.scrollIntoView?.({ block: "nearest" });
20
- }, [q, W]), o(() => {
21
- h !== I.current && V(null), I.current = null;
22
- }, [h]), o(() => {
23
- I.current = null;
19
+ let e = I.current;
20
+ if (I.current = !1, !K || U < 0 || !e) return;
21
+ let t = document.getElementById(A(U));
22
+ t ? t.scrollIntoView?.({ block: "nearest" }) : J.current = U;
23
+ }, [K, U]);
24
+ let Se = ce((e) => {
25
+ !e || J.current < 0 || (document.getElementById(`${D}-option-${J.current}`)?.scrollIntoView?.({ block: "nearest" }), J.current = -1);
26
+ }, [D]);
27
+ o(() => {
28
+ p !== F.current && B(null), F.current = null;
29
+ }, [p]), o(() => {
30
+ F.current = null;
24
31
  });
25
- let Y = !!(w && !z && B);
32
+ let Y = !!(S && !R && z);
26
33
  o(() => {
27
- P.current?.setCustomValidity(Y ? y : "");
28
- }, [Y, y]);
34
+ P.current?.setCustomValidity(Y ? _ : "");
35
+ }, [Y, _]);
29
36
  let X = (e) => {
30
- I.current = e, oe(e);
37
+ F.current = e, pe(e);
31
38
  }, Z = () => {
32
- L.current = !0, U(!0), G(z && !z.disabled ? R.indexOf(z) : -1);
39
+ I.current = !0, H(!0), W(R && !R.disabled ? L.indexOf(R) : -1);
33
40
  }, Q = () => {
34
- U(!1), V(null), G(-1);
41
+ H(!1), B(null), W(-1);
35
42
  }, $ = (e) => {
36
43
  e.disabled || (X(e.value), Q());
37
- }, ge = (e) => {
38
- if (J.length === 0) return;
39
- let t = J.findIndex(({ index: e }) => e === W), n = t === -1 ? e === 1 ? 0 : J.length - 1 : (t + e + J.length) % J.length;
40
- L.current = !0, G(J[n].index);
41
- }, _e = (e) => {
42
- if (fe?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.keyCode === 229)) switch (e.key) {
44
+ }, Ce = (e) => {
45
+ if (q.length === 0) return;
46
+ let t = q.findIndex(({ index: e }) => e === U), n = t === -1 ? e === 1 ? 0 : q.length - 1 : (t + e + q.length) % q.length;
47
+ I.current = !0, W(q[n].index);
48
+ }, we = (e) => {
49
+ if (ye?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.keyCode === 229)) switch (e.key) {
43
50
  case "ArrowDown":
44
51
  case "ArrowUp":
45
- if (e.preventDefault(), H && e.altKey && e.key === "ArrowUp") {
52
+ if (e.preventDefault(), V && e.altKey && e.key === "ArrowUp") {
46
53
  Q();
47
54
  return;
48
55
  }
49
- if (!H) {
50
- U(!0);
51
- let t = z && !z.disabled ? R.indexOf(z) : -1, n = e.key === "ArrowDown" ? J[0] : J[J.length - 1];
52
- L.current = !0, G(t >= 0 || e.altKey ? t : n?.index ?? -1);
56
+ if (!V) {
57
+ H(!0);
58
+ let t = R && !R.disabled ? L.indexOf(R) : -1, n = e.key === "ArrowDown" ? q[0] : q[q.length - 1];
59
+ I.current = !0, W(t >= 0 || e.altKey ? t : n?.index ?? -1);
53
60
  return;
54
61
  }
55
- ge(e.key === "ArrowDown" ? 1 : -1);
62
+ Ce(e.key === "ArrowDown" ? 1 : -1);
56
63
  return;
57
64
  case "Enter":
58
- q && W >= 0 && (e.preventDefault(), $(R[W]));
65
+ K && U >= 0 && (e.preventDefault(), $(L[U]));
59
66
  return;
60
67
  case "Escape":
61
- (q || B !== null) && (e.preventDefault(), Q());
68
+ (K || z !== null) && (e.preventDefault(), Q());
62
69
  return;
63
70
  }
64
- }, ve = (e) => {
65
- let t = e.trim() ? R.find((t) => !t.disabled && d(t.label) === d(e)) : void 0;
66
- if (t ? t.value !== h && X(t.value) : h !== "" && X(""), document.activeElement !== P.current) {
67
- V(t ? null : e);
71
+ }, Te = (e) => {
72
+ let t = e.trim() ? L.find((t) => !t.disabled && u(t.label) === u(e)) : void 0;
73
+ if (t ? t.value !== p && X(t.value) : p !== "" && X(""), document.activeElement !== P.current) {
74
+ B(t ? null : e);
68
75
  return;
69
76
  }
70
- V(e), U(!0);
71
- let n = R.findIndex((t) => !t.disabled && (!e || g(t, e)));
72
- L.current = !0, G(t ? R.indexOf(t) : e ? n : -1);
77
+ B(e), H(!0);
78
+ let n = L.findIndex((t) => !t.disabled && (!e || m(t, e)));
79
+ I.current = !0;
80
+ let r = t && m(t, e);
81
+ W(r ? L.indexOf(t) : e ? n : -1);
73
82
  };
74
83
  return /* @__PURE__ */ a("div", {
75
- className: e("flex w-full min-w-0 flex-col gap-2", ce),
84
+ className: e("flex w-full min-w-0 flex-col gap-2", he),
76
85
  children: [
77
- m && /* @__PURE__ */ i(ne, {
86
+ f && /* @__PURE__ */ i(se, {
78
87
  id: N,
79
- htmlFor: O,
80
- size: S,
81
- required: w,
82
- children: m
88
+ htmlFor: D,
89
+ size: b,
90
+ required: S,
91
+ children: f
83
92
  }),
84
- /* @__PURE__ */ a("div", {
85
- className: "relative",
93
+ /* @__PURE__ */ a(l.Root, {
94
+ open: K,
86
95
  children: [
87
- /* @__PURE__ */ a("div", {
88
- className: "relative",
89
- children: [/* @__PURE__ */ i("input", {
90
- ...D,
91
- ref: F,
92
- id: O,
93
- type: "text",
94
- role: "combobox",
95
- "aria-expanded": q,
96
- "aria-controls": k,
97
- "aria-autocomplete": "list",
98
- "aria-activedescendant": q && W >= 0 ? j(W) : void 0,
99
- "aria-invalid": M || void 0,
100
- "aria-describedby": r(ue, he && A),
101
- autoComplete: le,
102
- required: w,
103
- disabled: T,
104
- placeholder: se,
105
- value: B ?? z?.label ?? "",
106
- onChange: (e) => ve(e.target.value),
107
- onKeyDown: _e,
108
- onClick: (e) => {
109
- pe?.(e), !H && !e.defaultPrevented && Z();
110
- },
111
- onBlur: (e) => {
112
- de?.(e), Q();
113
- },
114
- className: e(n({
115
- size: S,
116
- hasError: M,
117
- disabled: T
118
- }), "text-text-base-neutral-5 placeholder:text-text-base-neutral-2 w-full min-w-0 truncate outline-none disabled:cursor-not-allowed", !T && !M && "focus:border-border-base-neutral-4", S === "large" ? "pr-14" : "pr-12", t(S))
119
- }), /* @__PURE__ */ i("button", {
120
- type: "button",
121
- tabIndex: -1,
122
- "aria-label": v ?? m ?? D["aria-label"],
123
- "aria-controls": k,
124
- "aria-expanded": q,
125
- disabled: T,
126
- onMouseDown: (e) => e.preventDefault(),
127
- onClick: () => {
128
- q ? Q() : Z(), P.current?.focus();
129
- },
130
- className: e("absolute inset-y-0 right-0 flex cursor-pointer items-center justify-center disabled:cursor-not-allowed", S === "large" ? "w-14" : "w-12"),
131
- children: /* @__PURE__ */ i(te, {
132
- "aria-hidden": "true",
133
- className: e("size-6 transition-transform duration-200", q ? "text-icon-prominent-accent-1 rotate-180" : "text-icon-base-neutral-3")
134
- })
135
- })]
96
+ /* @__PURE__ */ i(l.Anchor, {
97
+ asChild: !0,
98
+ children: /* @__PURE__ */ a("div", {
99
+ className: "relative",
100
+ children: [/* @__PURE__ */ i("input", {
101
+ ...E,
102
+ ref: xe,
103
+ id: D,
104
+ type: "text",
105
+ role: "combobox",
106
+ "aria-expanded": K,
107
+ "aria-controls": K ? O : void 0,
108
+ "aria-autocomplete": "list",
109
+ "aria-activedescendant": K && U >= 0 ? A(U) : void 0,
110
+ "aria-invalid": j || void 0,
111
+ "aria-describedby": t(_e, M && k),
112
+ autoComplete: ge,
113
+ required: S,
114
+ disabled: C,
115
+ placeholder: me,
116
+ value: z ?? R?.label ?? "",
117
+ onChange: (e) => Te(e.target.value),
118
+ onKeyDown: we,
119
+ onClick: (e) => {
120
+ w?.(e), !V && !e.defaultPrevented && Z();
121
+ },
122
+ onBlur: (e) => {
123
+ ve?.(e), Q();
124
+ },
125
+ className: e(r({
126
+ size: b,
127
+ hasError: j,
128
+ disabled: C
129
+ }), "text-text-base-neutral-5 placeholder:text-text-base-neutral-2 w-full min-w-0 truncate outline-none disabled:cursor-not-allowed", !C && !j && "focus:border-border-base-neutral-4", b === "large" ? "pr-14" : "pr-12", n(b))
130
+ }), /* @__PURE__ */ i("button", {
131
+ type: "button",
132
+ tabIndex: -1,
133
+ "aria-label": g ?? f ?? E["aria-label"],
134
+ "aria-controls": K ? O : void 0,
135
+ "aria-expanded": K,
136
+ disabled: C,
137
+ onMouseDown: (e) => e.preventDefault(),
138
+ onClick: () => {
139
+ K ? Q() : Z(), P.current?.focus();
140
+ },
141
+ className: e("absolute inset-y-0 right-0 flex cursor-pointer items-center justify-center disabled:cursor-not-allowed", b === "large" ? "w-14" : "w-12"),
142
+ children: /* @__PURE__ */ i(ee, {
143
+ "aria-hidden": "true",
144
+ className: e("size-6 transition-transform duration-200", K ? "text-icon-prominent-accent-1 rotate-180" : "text-icon-base-neutral-3")
145
+ })
146
+ })]
147
+ })
136
148
  }),
137
- C && /* @__PURE__ */ i("input", {
149
+ x && /* @__PURE__ */ i("input", {
138
150
  type: "hidden",
139
- name: C,
140
- value: h,
141
- disabled: T,
142
- form: D.form
151
+ name: x,
152
+ value: p,
153
+ disabled: C,
154
+ form: E.form
143
155
  }),
144
- /* @__PURE__ */ a("ul", {
145
- id: k,
146
- role: "listbox",
147
- "aria-labelledby": m ? N : void 0,
148
- "aria-label": m ? void 0 : D["aria-label"],
149
- hidden: !q,
150
- onMouseDown: (e) => e.preventDefault(),
151
- className: e("border-border-base-neutral-2 bg-surface-base-neutral-1 absolute z-20 mt-2 max-h-72 w-full overflow-y-auto border py-1 shadow-lg", ee),
152
- children: [K.map(({ option: t, index: n }) => {
153
- let r = t.value === h;
154
- return /* @__PURE__ */ a("li", {
155
- id: j(n),
156
- role: "option",
157
- "aria-selected": r,
158
- "aria-disabled": t.disabled || void 0,
159
- onMouseMove: () => {
160
- L.current = !1, t.disabled || G(n);
161
- },
162
- onClick: () => $(t),
163
- className: e("text-text-base-neutral-5 flex cursor-pointer items-center gap-3 px-3 py-2.5 select-none", S === "large" ? "text-body-16-regular" : "text-body-14-regular", n === W && "bg-surface-base-neutral-2", r && "font-medium", t.disabled && "cursor-not-allowed opacity-50"),
164
- children: [/* @__PURE__ */ i("span", {
165
- className: "min-w-0 flex-1 truncate",
166
- children: t.label
167
- }), r && /* @__PURE__ */ i("svg", {
168
- "aria-hidden": "true",
169
- viewBox: "0 0 20 20",
170
- fill: "none",
171
- className: "text-icon-prominent-accent-1 size-4 shrink-0",
172
- children: /* @__PURE__ */ i("path", {
173
- d: "m4 10 3.5 3.5L16 5",
174
- stroke: "currentColor",
175
- strokeWidth: "2",
176
- strokeLinecap: "round",
177
- strokeLinejoin: "round"
178
- })
179
- })]
180
- }, t.value);
181
- }), K.length === 0 && _ !== void 0 && /* @__PURE__ */ i("li", {
182
- role: "presentation",
183
- className: "text-text-base-neutral-2 text-body-14-regular px-3 py-2.5",
184
- children: _
185
- })]
186
- })
156
+ /* @__PURE__ */ i(l.Portal, { children: /* @__PURE__ */ i(l.Content, {
157
+ asChild: !0,
158
+ align: "start",
159
+ sideOffset: 8,
160
+ onOpenAutoFocus: (e) => e.preventDefault(),
161
+ onCloseAutoFocus: (e) => e.preventDefault(),
162
+ onInteractOutside: (e) => e.preventDefault(),
163
+ onEscapeKeyDown: (e) => {
164
+ e.isComposing || e.keyCode === 229 || (e.preventDefault(), Q());
165
+ },
166
+ children: /* @__PURE__ */ a("ul", {
167
+ ref: Se,
168
+ id: O,
169
+ role: "listbox",
170
+ "aria-labelledby": f ? N : void 0,
171
+ "aria-label": f ? void 0 : E["aria-label"],
172
+ onMouseDown: (e) => e.preventDefault(),
173
+ className: e(ae, "w-(--radix-popover-trigger-width)"),
174
+ children: [G.map(({ option: t, index: n }) => {
175
+ let r = t.value === p;
176
+ return /* @__PURE__ */ a("li", {
177
+ id: A(n),
178
+ role: "option",
179
+ "aria-selected": r,
180
+ "aria-disabled": t.disabled || void 0,
181
+ onMouseMove: () => {
182
+ I.current = !1, t.disabled || W(n);
183
+ },
184
+ onClick: () => $(t),
185
+ className: e(te(b), n === U && "bg-surface-base-neutral-2", r && "text-text-prominent-accent-1 font-medium", t.disabled && "cursor-not-allowed opacity-50"),
186
+ children: [/* @__PURE__ */ i("span", {
187
+ className: ie,
188
+ children: r && /* @__PURE__ */ i(re, {})
189
+ }), /* @__PURE__ */ i("span", {
190
+ className: "min-w-0 flex-1 truncate",
191
+ children: t.label
192
+ })]
193
+ }, t.value);
194
+ }), G.length === 0 && h !== void 0 && /* @__PURE__ */ i("li", {
195
+ role: "presentation",
196
+ className: "text-text-base-neutral-2 text-body-14-regular px-4 py-3",
197
+ children: h
198
+ })]
199
+ })
200
+ }) })
187
201
  ]
188
202
  }),
189
- /* @__PURE__ */ i(re, {
190
- id: A,
191
- size: S,
192
- errorText: b,
193
- assistiveText: x
203
+ /* @__PURE__ */ i(ne, {
204
+ id: k,
205
+ size: b,
206
+ errorText: v,
207
+ assistiveText: y
194
208
  })
195
209
  ]
196
210
  });
197
211
  };
198
212
  //#endregion
199
- export { p as Combobox };
213
+ export { d as Combobox };
200
214
 
201
215
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":[],"sources":["../src/components/combobox/Combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\n\nimport { ChevronDownIcon } from \"../icons/action/ChevronDownIcon\";\n\nimport type { ComponentPropsWithRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { FieldLabel, FieldMessage } from \"@/components/ui/field\";\nimport {\n FIELD_RADIUS,\n fieldContainerVariants,\n fieldValueFontSize,\n joinIds,\n type FieldSize,\n} from \"@/components/ui/fieldStyles\";\nimport { mergeRefs } from \"@/utils/mergeRefs\";\nimport { cn } from \"@/utils/TailwindUtil\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface ComboboxProps\n extends Omit<\n ComponentPropsWithRef<\"input\">,\n \"size\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"role\" | \"children\"\n > {\n /** ์นธ ์œ„์— ๋ณด์ด๋Š” ์ด๋ฆ„. `<label>`๋กœ ์ž…๋ ฅ์— ์—ฐ๊ฒฐ๋œ๋‹ค. */\n label?: string;\n /** ๋ฌธ์ž์—ด ์˜ต์…˜์€ ๊ฐ’๊ณผ ํ‘œ์‹œ ์ด๋ฆ„์ด ๊ฐ™๋‹ค. */\n options: (string | ComboboxOption)[];\n /** ๊ณ ๋ฅธ ์˜ต์…˜์˜ ๊ฐ’. ๊ณ ๋ฅด์ง€ ์•Š์•˜์œผ๋ฉด `\"\"`. */\n value: string;\n /** ์˜ต์…˜์„ ๊ณ ๋ฅด๋ฉด ๊ทธ ๊ฐ’์œผ๋กœ, ๊ณ ๋ฅธ ๋’ค ๋‹ค์‹œ ์ž…๋ ฅํ•˜๊ธฐ ์‹œ์ž‘ํ•˜๋ฉด `\"\"`๋กœ ํ˜ธ์ถœ๋œ๋‹ค. */\n onChange: (value: string) => void;\n /** ์ž…๋ ฅํ•œ ๊ฒ€์ƒ‰์–ด๋กœ ์˜ต์…˜์„ ๊ฑฐ๋ฅธ๋‹ค. ๊ธฐ๋ณธ์€ ๋Œ€์†Œ๋ฌธ์žยท๊ณต๋ฐฑ์„ ๋ฌด์‹œํ•œ ๋ถ€๋ถ„ ์ผ์น˜. */\n filter?: (option: ComboboxOption, query: string) => boolean;\n /** ๋งž๋Š” ์˜ต์…˜์ด ์—†์„ ๋•Œ ๋ชฉ๋ก์— ๋ณด์ด๋Š” ๋ฌธ๊ตฌ. ์—†์œผ๋ฉด ๋ชฉ๋ก์„ ๋‹ซ๋Š”๋‹ค. */\n emptyText?: ReactNode;\n /** ๋ชฉ๋ก ์—ด๊ธฐ ๋ฒ„ํŠผ์˜ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ ์ด๋ฆ„. ๊ธฐ๋ณธ์€ `label`. */\n toggleLabel?: string;\n /** `required`์ธ๋ฐ ์ž…๋ ฅํ•œ ๊ธ€์ž๊ฐ€ ์˜ต์…˜์œผ๋กœ ๊ณจ๋ผ์ง€์ง€ ์•Š์•˜์„ ๋•Œ ๋ธŒ๋ผ์šฐ์ € ๊ฒ€์ฆ ๋ฉ”์‹œ์ง€. ๋‹ค๊ตญ์–ด ํŽ˜์ด์ง€์—์„œ๋Š” ๋ฒˆ์—ญํ•ด ๋„˜๊ธด๋‹ค. */\n invalidSelectionText?: string;\n errorText?: string;\n assistiveText?: ReactNode;\n size?: FieldSize;\n}\n\nconst normalize = (text: string) => text.toLocaleLowerCase().replace(/\\s+/g, \"\");\n\nconst defaultFilter = (option: ComboboxOption, query: string) => normalize(option.label).includes(normalize(query));\n\n/**\n * ์ž…๋ ฅํ•ด์„œ ๊ฒ€์ƒ‰ํ•˜๊ณ  ๋ชฉ๋ก์—์„œ ํ•˜๋‚˜๋ฅผ ๊ณ ๋ฅด๋Š” ์ž…๋ ฅ(WAI-ARIA combobox, list autocomplete).\n * ํฌ์ปค์Šค๋Š” ์ž…๋ ฅ์— ๋‚จ๊ณ  ๋ชฉ๋ก์˜ ํ˜„์žฌ ํ•ญ๋ชฉ์€ `aria-activedescendant`๋กœ ์•Œ๋ฆฐ๋‹ค.\n * ๊ณ ๋ฅธ ๊ฐ’๋งŒ `value`๊ฐ€ ๋˜๊ณ , ์ž…๋ ฅํ•œ ๊ธ€์ž๋Š” ๊ณ ๋ฅด๊ธฐ ์ „๊นŒ์ง€ ๊ฐ’์ด ์•„๋‹ˆ๋‹ค.\n */\nconst Combobox = ({\n id,\n label,\n options,\n value,\n onChange,\n filter = defaultFilter,\n emptyText,\n toggleLabel,\n invalidSelectionText = \"Select an option from the list.\",\n errorText,\n assistiveText,\n size = \"large\",\n name,\n required,\n disabled = false,\n placeholder,\n className,\n autoComplete = \"off\",\n \"aria-describedby\": ariaDescribedBy,\n onBlur,\n onKeyDown,\n onClick,\n ref,\n ...inputProps\n}: ComboboxProps) => {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const listboxId = `${inputId}-listbox`;\n const messageId = `${inputId}-message`;\n const optionId = (index: number) => `${inputId}-option-${index}`;\n const hasError = Boolean(errorText);\n const hasMessage = Boolean(errorText || assistiveText);\n const labelId = `${inputId}-label`;\n const inputRef = useRef<HTMLInputElement | null>(null);\n const setRef = useMemo(() => mergeRefs(inputRef, ref), [ref]);\n // ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ onChange๋กœ ๋‚ธ ๊ฐ’. ๋ฐ”๊นฅ์—์„œ value๋ฅผ ๋ฐ”๊ฟจ๋Š”์ง€ ๊ตฌ๋ถ„ํ•œ๋‹ค.\n const emittedValue = useRef<string | null>(null);\n // ํ‚ค๋ณด๋“œ๋กœ ์˜ฎ๊ธธ ๋•Œ๋งŒ ํ˜„์žฌ ํ•ญ๋ชฉ์„ ์Šคํฌ๋กคํ•œ๋‹ค. ๋งˆ์šฐ์Šค hover๋กœ ์Šคํฌ๋กคํ•˜๋ฉด ๋ชฉ๋ก์ด ํ”๋“ค๋ฆฐ๋‹ค.\n const scrollOnMove = useRef(false);\n\n const normalized = options.map((option) => (typeof option === \"string\" ? { value: option, label: option } : option));\n const selected = normalized.find((option) => option.value === value);\n // null์ด๋ฉด ๊ฒ€์ƒ‰ ์ค‘์ด ์•„๋‹ˆ๊ณ , ์ž…๋ ฅ์—๋Š” ๊ณ ๋ฅธ ์˜ต์…˜ ์ด๋ฆ„์ด ๋ณด์ธ๋‹ค.\n const [query, setQuery] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(-1);\n\n // ์ธ๋ฑ์Šค๋Š” ์ „์ฒด ์˜ต์…˜ ๊ธฐ์ค€์ด๋ผ ๊ฑฐ๋ฅด๋”๋ผ๋„ id๊ฐ€ ๋‹ค๋ฅธ ์˜ต์…˜์œผ๋กœ ๋„˜์–ด๊ฐ€์ง€ ์•Š๋Š”๋‹ค.\n const matches = normalized\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => (query ? filter(option, query) : true));\n const expanded = open && !disabled && (matches.length > 0 || emptyText !== undefined);\n const enabledMatches = matches.filter(({ option }) => !option.disabled);\n\n useEffect(() => {\n const shouldScroll = scrollOnMove.current;\n scrollOnMove.current = false;\n if (!expanded || activeIndex < 0 || !shouldScroll) return;\n document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: \"nearest\" });\n // optionId๋Š” inputId์—์„œ๋งŒ ๋ฐ”๋€๋‹ค.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [expanded, activeIndex]);\n\n // ๋ฐ”๊นฅ์—์„œ value๊ฐ€ ๋ฐ”๋€Œ๋ฉด(ํผ reset ๋“ฑ) ์ž…๋ ฅ ์ค‘์ธ ๊ฒ€์ƒ‰์–ด๋ฅผ ๋ฒ„๋ฆฌ๊ณ  ์ƒˆ ๊ฐ’์˜ ์ด๋ฆ„์„ ๋ณด์ธ๋‹ค.\n useEffect(() => {\n if (value !== emittedValue.current) setQuery(null);\n emittedValue.current = null;\n }, [value]);\n\n // ๋ถ€๋ชจ๊ฐ€ ๋‚ธ ๊ฐ’์„ ๋ฐ›์•„๋“ค์ด์ง€ ์•Š์•„ value๊ฐ€ ๊ทธ๋Œ€๋กœ๋ฉด, ๋‹ค์Œ ๋ฐ”๊นฅ ๋ณ€๊ฒฝ์„ ์šฐ๋ฆฌ ๊ฐ’์œผ๋กœ ์˜ค์ธํ•˜์ง€ ์•Š๊ฒŒ ๋น„์šด๋‹ค.\n useEffect(() => {\n emittedValue.current = null;\n });\n\n // ๋ธŒ๋ผ์šฐ์ € ๊ฒ€์ฆ์€ ๋ณด์ด๋Š” ๊ธ€์ž๋ฅผ ๋ณธ๋‹ค. ๊ธ€์ž๋Š” ์žˆ๋Š”๋ฐ ๊ณ ๋ฅธ ์˜ต์…˜์ด ์—†์œผ๋ฉด ํ†ต๊ณผํ•˜์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค.\n const selectionMissing = Boolean(required && !selected && query);\n useEffect(() => {\n inputRef.current?.setCustomValidity(selectionMissing ? invalidSelectionText : \"\");\n }, [selectionMissing, invalidSelectionText]);\n\n const emit = (next: string) => {\n emittedValue.current = next;\n onChange(next);\n };\n\n const openList = () => {\n scrollOnMove.current = true;\n setOpen(true);\n setActiveIndex(selected && !selected.disabled ? normalized.indexOf(selected) : -1);\n };\n\n const close = () => {\n setOpen(false);\n setQuery(null);\n setActiveIndex(-1);\n };\n\n const pick = (option: ComboboxOption) => {\n if (option.disabled) return;\n emit(option.value);\n close();\n };\n\n const move = (step: 1 | -1) => {\n if (enabledMatches.length === 0) return;\n const position = enabledMatches.findIndex(({ index }) => index === activeIndex);\n const next =\n position === -1\n ? step === 1\n ? 0\n : enabledMatches.length - 1\n : (position + step + enabledMatches.length) % enabledMatches.length;\n scrollOnMove.current = true;\n setActiveIndex(enabledMatches[next].index);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n // IME ์กฐํ•ฉ(ํ•œ๊ธ€ยท์ผ๋ณธ์–ด) ์ค‘ Enterยท๋ฐฉํ–ฅํ‚ค๋Š” ์กฐํ•ฉ์„ ํ™•์ •ํ•˜๋Š” ํ‚ค๋‹ค. keyCode 229๋Š” Safari์šฉ.\n if (event.defaultPrevented || event.nativeEvent.isComposing || event.keyCode === 229) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n if (open && event.altKey && event.key === \"ArrowUp\") {\n close();\n return;\n }\n if (!open) {\n // ์—ด ๋•Œ๋Š” ๊ณ ๋ฅธ ์˜ต์…˜์„, ๊ณ ๋ฅธ ๊ฒŒ ์—†์œผ๋ฉด ๋ฐฉํ–ฅ์— ๋งž๋Š” ์ฒซ ์˜ต์…˜์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค. Alt๋Š” ์—ด๊ธฐ๋งŒ ํ•œ๋‹ค.\n setOpen(true);\n const selectedIndex = selected && !selected.disabled ? normalized.indexOf(selected) : -1;\n const edge = event.key === \"ArrowDown\" ? enabledMatches[0] : enabledMatches[enabledMatches.length - 1];\n scrollOnMove.current = true;\n setActiveIndex(selectedIndex >= 0 || event.altKey ? selectedIndex : (edge?.index ?? -1));\n return;\n }\n move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n if (expanded && activeIndex >= 0) {\n event.preventDefault();\n pick(normalized[activeIndex]);\n }\n return;\n case \"Escape\":\n if (expanded || query !== null) {\n event.preventDefault();\n close();\n }\n return;\n }\n };\n\n const handleInput = (text: string) => {\n // ๋ธŒ๋ผ์šฐ์ € ์ž๋™์™„์„ฑ์ฒ˜๋Ÿผ ์˜ต์…˜ ์ด๋ฆ„๊ณผ ๋˜‘๊ฐ™์ด ์ž…๋ ฅ๋˜๋ฉด ๊ทธ ์˜ต์…˜์„ ๊ณ ๋ฅธ ๊ฒƒ์œผ๋กœ ๋ณธ๋‹ค.\n const exact = text.trim()\n ? normalized.find((option) => !option.disabled && normalize(option.label) === normalize(text))\n : undefined;\n if (exact) {\n if (exact.value !== value) emit(exact.value);\n } else if (value !== \"\") {\n emit(\"\");\n }\n\n // ํฌ์ปค์Šค๊ฐ€ ์—†์„ ๋•Œ ๋“ค์–ด์˜จ ์ž…๋ ฅ(๋‹ค๋ฅธ ์นธ์—์„œ ์‹œ์ž‘ํ•œ ์ž๋™์™„์„ฑ)์€ ๋ชฉ๋ก์„ ์—ด์ง€ ์•Š๋Š”๋‹ค.\n if (document.activeElement !== inputRef.current) {\n setQuery(exact ? null : text);\n return;\n }\n\n setQuery(text);\n setOpen(true);\n const firstMatch = normalized.findIndex((option) => !option.disabled && (text ? filter(option, text) : true));\n scrollOnMove.current = true;\n setActiveIndex(exact ? normalized.indexOf(exact) : text ? firstMatch : -1);\n };\n\n return (\n <div className={cn(\"flex w-full min-w-0 flex-col gap-2\", className)}>\n {label && (\n <FieldLabel id={labelId} htmlFor={inputId} size={size} required={required}>\n {label}\n </FieldLabel>\n )}\n <div className=\"relative\">\n <div className=\"relative\">\n <input\n {...inputProps}\n ref={setRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={expanded}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={expanded && activeIndex >= 0 ? optionId(activeIndex) : undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={joinIds(ariaDescribedBy, hasMessage && messageId)}\n autoComplete={autoComplete}\n required={required}\n disabled={disabled}\n placeholder={placeholder}\n value={query ?? selected?.label ?? \"\"}\n onChange={(event) => handleInput(event.target.value)}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n onClick?.(event);\n if (!open && !event.defaultPrevented) openList();\n }}\n onBlur={(event) => {\n onBlur?.(event);\n close();\n }}\n className={cn(\n fieldContainerVariants({ size, hasError, disabled }),\n \"text-text-base-neutral-5 placeholder:text-text-base-neutral-2 w-full min-w-0 truncate outline-none disabled:cursor-not-allowed\",\n !disabled && !hasError && \"focus:border-border-base-neutral-4\",\n size === \"large\" ? \"pr-14\" : \"pr-12\",\n fieldValueFontSize(size),\n )}\n />\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={toggleLabel ?? label ?? inputProps[\"aria-label\"]}\n aria-controls={listboxId}\n aria-expanded={expanded}\n disabled={disabled}\n // ์ž…๋ ฅ์˜ ํฌ์ปค์Šค๋ฅผ ์œ ์ง€ํ•ด์•ผ blur๋กœ ๋ชฉ๋ก์ด ๋‹ซํžˆ์ง€ ์•Š๋Š”๋‹ค.\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (expanded) close();\n else openList();\n inputRef.current?.focus();\n }}\n className={cn(\n \"absolute inset-y-0 right-0 flex cursor-pointer items-center justify-center disabled:cursor-not-allowed\",\n size === \"large\" ? \"w-14\" : \"w-12\",\n )}\n >\n <ChevronDownIcon\n aria-hidden=\"true\"\n className={cn(\n \"size-6 transition-transform duration-200\",\n expanded ? \"text-icon-prominent-accent-1 rotate-180\" : \"text-icon-base-neutral-3\",\n )}\n />\n </button>\n </div>\n {name && <input type=\"hidden\" name={name} value={value} disabled={disabled} form={inputProps.form} />}\n <ul\n id={listboxId}\n role=\"listbox\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={label ? undefined : inputProps[\"aria-label\"]}\n hidden={!expanded}\n onMouseDown={(event) => event.preventDefault()}\n className={cn(\n \"border-border-base-neutral-2 bg-surface-base-neutral-1 absolute z-20 mt-2 max-h-72 w-full overflow-y-auto border py-1 shadow-lg\",\n FIELD_RADIUS,\n )}\n >\n {matches.map(({ option, index }) => {\n const isSelected = option.value === value;\n return (\n <li\n key={option.value}\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n onMouseMove={() => {\n scrollOnMove.current = false;\n if (!option.disabled) setActiveIndex(index);\n }}\n onClick={() => pick(option)}\n className={cn(\n \"text-text-base-neutral-5 flex cursor-pointer items-center gap-3 px-3 py-2.5 select-none\",\n size === \"large\" ? \"text-body-16-regular\" : \"text-body-14-regular\",\n index === activeIndex && \"bg-surface-base-neutral-2\",\n isSelected && \"font-medium\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n {isSelected && (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n className=\"text-icon-prominent-accent-1 size-4 shrink-0\"\n >\n <path\n d=\"m4 10 3.5 3.5L16 5\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n </li>\n );\n })}\n {matches.length === 0 && emptyText !== undefined && (\n <li role=\"presentation\" className=\"text-text-base-neutral-2 text-body-14-regular px-3 py-2.5\">\n {emptyText}\n </li>\n )}\n </ul>\n </div>\n <FieldMessage id={messageId} size={size} errorText={errorText} assistiveText={assistiveText} />\n </div>\n );\n};\n\nexport { Combobox };\n"],"mappings":";;;;;;;;AAmDA,IAAM,KAAa,MAAiB,EAAK,kBAAkB,CAAC,CAAC,QAAQ,QAAQ,EAAE,GAEzE,KAAiB,GAAwB,MAAkB,EAAU,EAAO,KAAK,CAAC,CAAC,SAAS,EAAU,CAAK,CAAC,GAO5G,KAAY,EAChB,OACA,UACA,aACA,UACA,cACA,YAAS,GACT,cACA,gBACA,0BAAuB,mCACvB,cACA,kBACA,UAAO,SACP,SACA,aACA,cAAW,IACX,iBACA,eACA,mBAAe,OACf,oBAAoB,IACpB,YACA,eACA,aACA,QACA,GAAG,QACgB;CACnB,IAAM,KAAc,EAAM,GACpB,IAAU,KAAM,IAChB,IAAY,GAAG,EAAQ,WACvB,IAAY,GAAG,EAAQ,WACvB,KAAY,MAAkB,GAAG,EAAQ,UAAU,KACnD,IAAW,EAAQ,GACnB,KAAa,GAAQ,KAAa,IAClC,IAAU,GAAG,EAAQ,SACrB,IAAW,EAAgC,IAAI,GAC/C,IAAS,QAAc,GAAU,GAAU,CAAG,GAAG,CAAC,CAAG,CAAC,GAEtD,IAAe,EAAsB,IAAI,GAEzC,IAAe,EAAO,EAAK,GAE3B,IAAa,GAAQ,KAAK,MAAY,OAAO,KAAW,WAAW;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A,CAEL;UAnCG,EAAO,KAmCV;MAER,CAAC,GACA,EAAQ,WAAW,KAAK,MAAc,KAAA,KACrC,kBAAC,MAAD;OAAI,MAAK;OAAe,WAAU;iBAC/B;MACC,CAAA,CAEJ;;IACD;;GACL,kBAAC,IAAD;IAAc,IAAI;IAAiB;IAAiB;IAA0B;GAAgB,CAAA;EAC3F;;AAET"}
1
+ {"version":3,"file":"combobox.js","names":[],"sources":["../src/components/combobox/Combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\n\nimport { ChevronDownIcon } from \"../icons/action/ChevronDownIcon\";\n\nimport type { ComponentPropsWithRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { FieldLabel, FieldMessage } from \"@/components/ui/field\";\nimport { fieldContainerVariants, fieldValueFontSize, joinIds, type FieldSize } from \"@/components/ui/fieldStyles\";\nimport { ListboxCheckIcon } from \"@/components/ui/listbox\";\nimport {\n LISTBOX_CHECK_SLOT,\n LISTBOX_OPTION_ACTIVE,\n LISTBOX_OPTION_DISABLED,\n LISTBOX_OPTION_SELECTED,\n LISTBOX_PANEL,\n listboxOptionClassName,\n} from \"@/components/ui/listboxStyles\";\nimport { mergeRefs } from \"@/utils/mergeRefs\";\nimport { cn } from \"@/utils/TailwindUtil\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface ComboboxProps\n extends Omit<\n ComponentPropsWithRef<\"input\">,\n \"size\" | \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"role\" | \"children\"\n > {\n /** ์นธ ์œ„์— ๋ณด์ด๋Š” ์ด๋ฆ„. `<label>`๋กœ ์ž…๋ ฅ์— ์—ฐ๊ฒฐ๋œ๋‹ค. */\n label?: string;\n /** ๋ฌธ์ž์—ด ์˜ต์…˜์€ ๊ฐ’๊ณผ ํ‘œ์‹œ ์ด๋ฆ„์ด ๊ฐ™๋‹ค. */\n options: (string | ComboboxOption)[];\n /** ๊ณ ๋ฅธ ์˜ต์…˜์˜ ๊ฐ’. ๊ณ ๋ฅด์ง€ ์•Š์•˜์œผ๋ฉด `\"\"`. */\n value: string;\n /** ์˜ต์…˜์„ ๊ณ ๋ฅด๋ฉด ๊ทธ ๊ฐ’์œผ๋กœ, ๊ณ ๋ฅธ ๋’ค ๋‹ค์‹œ ์ž…๋ ฅํ•˜๊ธฐ ์‹œ์ž‘ํ•˜๋ฉด `\"\"`๋กœ ํ˜ธ์ถœ๋œ๋‹ค. */\n onChange: (value: string) => void;\n /** ์ž…๋ ฅํ•œ ๊ฒ€์ƒ‰์–ด๋กœ ์˜ต์…˜์„ ๊ฑฐ๋ฅธ๋‹ค. ๊ธฐ๋ณธ์€ ๋Œ€์†Œ๋ฌธ์žยท๊ณต๋ฐฑ์„ ๋ฌด์‹œํ•œ ๋ถ€๋ถ„ ์ผ์น˜. */\n filter?: (option: ComboboxOption, query: string) => boolean;\n /** ๋งž๋Š” ์˜ต์…˜์ด ์—†์„ ๋•Œ ๋ชฉ๋ก์— ๋ณด์ด๋Š” ๋ฌธ๊ตฌ. ์—†์œผ๋ฉด ๋ชฉ๋ก์„ ๋‹ซ๋Š”๋‹ค. */\n emptyText?: ReactNode;\n /** ๋ชฉ๋ก ์—ด๊ธฐ ๋ฒ„ํŠผ์˜ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ ์ด๋ฆ„. ๊ธฐ๋ณธ์€ `label`. */\n toggleLabel?: string;\n /** `required`์ธ๋ฐ ์ž…๋ ฅํ•œ ๊ธ€์ž๊ฐ€ ์˜ต์…˜์œผ๋กœ ๊ณจ๋ผ์ง€์ง€ ์•Š์•˜์„ ๋•Œ ๋ธŒ๋ผ์šฐ์ € ๊ฒ€์ฆ ๋ฉ”์‹œ์ง€. ๋‹ค๊ตญ์–ด ํŽ˜์ด์ง€์—์„œ๋Š” ๋ฒˆ์—ญํ•ด ๋„˜๊ธด๋‹ค. */\n invalidSelectionText?: string;\n errorText?: string;\n assistiveText?: ReactNode;\n size?: FieldSize;\n}\n\nconst normalize = (text: string) => text.toLocaleLowerCase().replace(/\\s+/g, \"\");\n\nconst defaultFilter = (option: ComboboxOption, query: string) => normalize(option.label).includes(normalize(query));\n\n/**\n * ์ž…๋ ฅํ•ด์„œ ๊ฒ€์ƒ‰ํ•˜๊ณ  ๋ชฉ๋ก์—์„œ ํ•˜๋‚˜๋ฅผ ๊ณ ๋ฅด๋Š” ์ž…๋ ฅ(WAI-ARIA combobox, list autocomplete).\n * ํฌ์ปค์Šค๋Š” ์ž…๋ ฅ์— ๋‚จ๊ณ  ๋ชฉ๋ก์˜ ํ˜„์žฌ ํ•ญ๋ชฉ์€ `aria-activedescendant`๋กœ ์•Œ๋ฆฐ๋‹ค.\n * ๊ณ ๋ฅธ ๊ฐ’๋งŒ `value`๊ฐ€ ๋˜๊ณ , ์ž…๋ ฅํ•œ ๊ธ€์ž๋Š” ๊ณ ๋ฅด๊ธฐ ์ „๊นŒ์ง€ ๊ฐ’์ด ์•„๋‹ˆ๋‹ค.\n * ๋ชฉ๋ก์€ `Select`์™€ ๊ฐ™์€ ํฌํ„ธ ํŒจ๋„(Radix Popover)์ด๋ผ ์Šคํฌ๋กคยทoverflow ์กฐ์ƒ์— ์ž˜๋ฆฌ์ง€ ์•Š๋Š”๋‹ค.\n */\nconst Combobox = ({\n id,\n label,\n options,\n value,\n onChange,\n filter = defaultFilter,\n emptyText,\n toggleLabel,\n invalidSelectionText = \"Select an option from the list.\",\n errorText,\n assistiveText,\n size = \"large\",\n name,\n required,\n disabled = false,\n placeholder,\n className,\n autoComplete = \"off\",\n \"aria-describedby\": ariaDescribedBy,\n onBlur,\n onKeyDown,\n onClick,\n ref,\n ...inputProps\n}: ComboboxProps) => {\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const listboxId = `${inputId}-listbox`;\n const messageId = `${inputId}-message`;\n const optionId = (index: number) => `${inputId}-option-${index}`;\n const hasError = Boolean(errorText);\n const hasMessage = Boolean(errorText || assistiveText);\n const labelId = `${inputId}-label`;\n const inputRef = useRef<HTMLInputElement | null>(null);\n const setRef = useMemo(() => mergeRefs(inputRef, ref), [ref]);\n // ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ onChange๋กœ ๋‚ธ ๊ฐ’. ๋ฐ”๊นฅ์—์„œ value๋ฅผ ๋ฐ”๊ฟจ๋Š”์ง€ ๊ตฌ๋ถ„ํ•œ๋‹ค.\n const emittedValue = useRef<string | null>(null);\n // ํ‚ค๋ณด๋“œ๋กœ ์˜ฎ๊ธธ ๋•Œ๋งŒ ํ˜„์žฌ ํ•ญ๋ชฉ์„ ์Šคํฌ๋กคํ•œ๋‹ค. ๋งˆ์šฐ์Šค hover๋กœ ์Šคํฌ๋กคํ•˜๋ฉด ๋ชฉ๋ก์ด ํ”๋“ค๋ฆฐ๋‹ค.\n const scrollOnMove = useRef(false);\n\n const normalized = options.map((option) => (typeof option === \"string\" ? { value: option, label: option } : option));\n const selected = normalized.find((option) => option.value === value);\n // null์ด๋ฉด ๊ฒ€์ƒ‰ ์ค‘์ด ์•„๋‹ˆ๊ณ , ์ž…๋ ฅ์—๋Š” ๊ณ ๋ฅธ ์˜ต์…˜ ์ด๋ฆ„์ด ๋ณด์ธ๋‹ค.\n const [query, setQuery] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(-1);\n\n // ์ธ๋ฑ์Šค๋Š” ์ „์ฒด ์˜ต์…˜ ๊ธฐ์ค€์ด๋ผ ๊ฑฐ๋ฅด๋”๋ผ๋„ id๊ฐ€ ๋‹ค๋ฅธ ์˜ต์…˜์œผ๋กœ ๋„˜์–ด๊ฐ€์ง€ ์•Š๋Š”๋‹ค.\n const matches = normalized\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => (query ? filter(option, query) : true));\n const expanded = open && !disabled && (matches.length > 0 || emptyText !== undefined);\n const enabledMatches = matches.filter(({ option }) => !option.disabled);\n\n // ๋ชฉ๋ก์„ ๋ง‰ ์—ด๋ฉด ํฌํ„ธ์ด ๋‹ค์Œ ๋ Œ๋”์— ๋ถ™์œผ๋ฏ€๋กœ, ๊ทธ๋•Œ ๋ชฉ๋ก ref๊ฐ€ ๋Œ€์‹  ์Šคํฌ๋กคํ•œ๋‹ค.\n const pendingScroll = useRef(-1);\n useEffect(() => {\n const shouldScroll = scrollOnMove.current;\n scrollOnMove.current = false;\n if (!expanded || activeIndex < 0 || !shouldScroll) return;\n const option = document.getElementById(optionId(activeIndex));\n if (option) option.scrollIntoView?.({ block: \"nearest\" });\n else pendingScroll.current = activeIndex;\n // optionId๋Š” inputId์—์„œ๋งŒ ๋ฐ”๋€๋‹ค.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [expanded, activeIndex]);\n const scrollPending = useCallback(\n (list: HTMLUListElement | null) => {\n if (!list || pendingScroll.current < 0) return;\n document.getElementById(`${inputId}-option-${pendingScroll.current}`)?.scrollIntoView?.({ block: \"nearest\" });\n pendingScroll.current = -1;\n },\n [inputId],\n );\n\n // ๋ฐ”๊นฅ์—์„œ value๊ฐ€ ๋ฐ”๋€Œ๋ฉด(ํผ reset ๋“ฑ) ์ž…๋ ฅ ์ค‘์ธ ๊ฒ€์ƒ‰์–ด๋ฅผ ๋ฒ„๋ฆฌ๊ณ  ์ƒˆ ๊ฐ’์˜ ์ด๋ฆ„์„ ๋ณด์ธ๋‹ค.\n useEffect(() => {\n if (value !== emittedValue.current) setQuery(null);\n emittedValue.current = null;\n }, [value]);\n\n // ๋ถ€๋ชจ๊ฐ€ ๋‚ธ ๊ฐ’์„ ๋ฐ›์•„๋“ค์ด์ง€ ์•Š์•„ value๊ฐ€ ๊ทธ๋Œ€๋กœ๋ฉด, ๋‹ค์Œ ๋ฐ”๊นฅ ๋ณ€๊ฒฝ์„ ์šฐ๋ฆฌ ๊ฐ’์œผ๋กœ ์˜ค์ธํ•˜์ง€ ์•Š๊ฒŒ ๋น„์šด๋‹ค.\n useEffect(() => {\n emittedValue.current = null;\n });\n\n // ๋ธŒ๋ผ์šฐ์ € ๊ฒ€์ฆ์€ ๋ณด์ด๋Š” ๊ธ€์ž๋ฅผ ๋ณธ๋‹ค. ๊ธ€์ž๋Š” ์žˆ๋Š”๋ฐ ๊ณ ๋ฅธ ์˜ต์…˜์ด ์—†์œผ๋ฉด ํ†ต๊ณผํ•˜์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค.\n const selectionMissing = Boolean(required && !selected && query);\n useEffect(() => {\n inputRef.current?.setCustomValidity(selectionMissing ? invalidSelectionText : \"\");\n }, [selectionMissing, invalidSelectionText]);\n\n const emit = (next: string) => {\n emittedValue.current = next;\n onChange(next);\n };\n\n const openList = () => {\n scrollOnMove.current = true;\n setOpen(true);\n setActiveIndex(selected && !selected.disabled ? normalized.indexOf(selected) : -1);\n };\n\n const close = () => {\n setOpen(false);\n setQuery(null);\n setActiveIndex(-1);\n };\n\n const pick = (option: ComboboxOption) => {\n if (option.disabled) return;\n emit(option.value);\n close();\n };\n\n const move = (step: 1 | -1) => {\n if (enabledMatches.length === 0) return;\n const position = enabledMatches.findIndex(({ index }) => index === activeIndex);\n const next =\n position === -1\n ? step === 1\n ? 0\n : enabledMatches.length - 1\n : (position + step + enabledMatches.length) % enabledMatches.length;\n scrollOnMove.current = true;\n setActiveIndex(enabledMatches[next].index);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n // IME ์กฐํ•ฉ(ํ•œ๊ธ€ยท์ผ๋ณธ์–ด) ์ค‘ Enterยท๋ฐฉํ–ฅํ‚ค๋Š” ์กฐํ•ฉ์„ ํ™•์ •ํ•˜๋Š” ํ‚ค๋‹ค. keyCode 229๋Š” Safari์šฉ.\n if (event.defaultPrevented || event.nativeEvent.isComposing || event.keyCode === 229) return;\n\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n if (open && event.altKey && event.key === \"ArrowUp\") {\n close();\n return;\n }\n if (!open) {\n // ์—ด ๋•Œ๋Š” ๊ณ ๋ฅธ ์˜ต์…˜์„, ๊ณ ๋ฅธ ๊ฒŒ ์—†์œผ๋ฉด ๋ฐฉํ–ฅ์— ๋งž๋Š” ์ฒซ ์˜ต์…˜์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค. Alt๋Š” ์—ด๊ธฐ๋งŒ ํ•œ๋‹ค.\n setOpen(true);\n const selectedIndex = selected && !selected.disabled ? normalized.indexOf(selected) : -1;\n const edge = event.key === \"ArrowDown\" ? enabledMatches[0] : enabledMatches[enabledMatches.length - 1];\n scrollOnMove.current = true;\n setActiveIndex(selectedIndex >= 0 || event.altKey ? selectedIndex : (edge?.index ?? -1));\n return;\n }\n move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n case \"Enter\":\n if (expanded && activeIndex >= 0) {\n event.preventDefault();\n pick(normalized[activeIndex]);\n }\n return;\n case \"Escape\":\n if (expanded || query !== null) {\n event.preventDefault();\n close();\n }\n return;\n }\n };\n\n const handleInput = (text: string) => {\n // ๋ธŒ๋ผ์šฐ์ € ์ž๋™์™„์„ฑ์ฒ˜๋Ÿผ ์˜ต์…˜ ์ด๋ฆ„๊ณผ ๋˜‘๊ฐ™์ด ์ž…๋ ฅ๋˜๋ฉด ๊ทธ ์˜ต์…˜์„ ๊ณ ๋ฅธ ๊ฒƒ์œผ๋กœ ๋ณธ๋‹ค.\n const exact = text.trim()\n ? normalized.find((option) => !option.disabled && normalize(option.label) === normalize(text))\n : undefined;\n if (exact) {\n if (exact.value !== value) emit(exact.value);\n } else if (value !== \"\") {\n emit(\"\");\n }\n\n // ํฌ์ปค์Šค๊ฐ€ ์—†์„ ๋•Œ ๋“ค์–ด์˜จ ์ž…๋ ฅ(๋‹ค๋ฅธ ์นธ์—์„œ ์‹œ์ž‘ํ•œ ์ž๋™์™„์„ฑ)์€ ๋ชฉ๋ก์„ ์—ด์ง€ ์•Š๋Š”๋‹ค.\n if (document.activeElement !== inputRef.current) {\n setQuery(exact ? null : text);\n return;\n }\n\n setQuery(text);\n setOpen(true);\n const firstMatch = normalized.findIndex((option) => !option.disabled && (text ? filter(option, text) : true));\n scrollOnMove.current = true;\n // ์‚ฌ์šฉ์ž filter๊ฐ€ ๊ฑธ๋Ÿฌ๋‚ธ ์˜ต์…˜์€ ๋ชฉ๋ก์— ์—†์œผ๋ฏ€๋กœ ํ˜„์žฌ ํ•ญ๋ชฉ์œผ๋กœ ์‚ผ์ง€ ์•Š๋Š”๋‹ค.\n const exactShown = exact && filter(exact, text);\n setActiveIndex(exactShown ? normalized.indexOf(exact) : text ? firstMatch : -1);\n };\n\n return (\n <div className={cn(\"flex w-full min-w-0 flex-col gap-2\", className)}>\n {label && (\n <FieldLabel id={labelId} htmlFor={inputId} size={size} required={required}>\n {label}\n </FieldLabel>\n )}\n <PopoverPrimitive.Root open={expanded}>\n <PopoverPrimitive.Anchor asChild>\n <div className=\"relative\">\n <input\n {...inputProps}\n ref={setRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={expanded}\n // ๋ชฉ๋ก์€ ์—ด๋ ธ์„ ๋•Œ๋งŒ DOM์— ์žˆ๋‹ค.\n aria-controls={expanded ? listboxId : undefined}\n aria-autocomplete=\"list\"\n aria-activedescendant={expanded && activeIndex >= 0 ? optionId(activeIndex) : undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={joinIds(ariaDescribedBy, hasMessage && messageId)}\n autoComplete={autoComplete}\n required={required}\n disabled={disabled}\n placeholder={placeholder}\n value={query ?? selected?.label ?? \"\"}\n onChange={(event) => handleInput(event.target.value)}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n onClick?.(event);\n if (!open && !event.defaultPrevented) openList();\n }}\n onBlur={(event) => {\n onBlur?.(event);\n close();\n }}\n className={cn(\n fieldContainerVariants({ size, hasError, disabled }),\n \"text-text-base-neutral-5 placeholder:text-text-base-neutral-2 w-full min-w-0 truncate outline-none disabled:cursor-not-allowed\",\n !disabled && !hasError && \"focus:border-border-base-neutral-4\",\n size === \"large\" ? \"pr-14\" : \"pr-12\",\n fieldValueFontSize(size),\n )}\n />\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={toggleLabel ?? label ?? inputProps[\"aria-label\"]}\n aria-controls={expanded ? listboxId : undefined}\n aria-expanded={expanded}\n disabled={disabled}\n // ์ž…๋ ฅ์˜ ํฌ์ปค์Šค๋ฅผ ์œ ์ง€ํ•ด์•ผ blur๋กœ ๋ชฉ๋ก์ด ๋‹ซํžˆ์ง€ ์•Š๋Š”๋‹ค.\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (expanded) close();\n else openList();\n inputRef.current?.focus();\n }}\n className={cn(\n \"absolute inset-y-0 right-0 flex cursor-pointer items-center justify-center disabled:cursor-not-allowed\",\n size === \"large\" ? \"w-14\" : \"w-12\",\n )}\n >\n <ChevronDownIcon\n aria-hidden=\"true\"\n className={cn(\n \"size-6 transition-transform duration-200\",\n expanded ? \"text-icon-prominent-accent-1 rotate-180\" : \"text-icon-base-neutral-3\",\n )}\n />\n </button>\n </div>\n </PopoverPrimitive.Anchor>\n {name && <input type=\"hidden\" name={name} value={value} disabled={disabled} form={inputProps.form} />}\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n asChild\n align=\"start\"\n sideOffset={8}\n // ํฌ์ปค์Šค๋Š” ์ž…๋ ฅ์— ๋‚จ๊ธด๋‹ค. ๋ฐ”๊นฅ ํด๋ฆญ์€ ์ž…๋ ฅ์˜ blur๊ฐ€ ๋‹ซ๋Š”๋‹ค(ํ† ๊ธ€ ๋ฒ„ํŠผ ํด๋ฆญ์ด ๋‹ซ๊ณ  ๋‹ค์‹œ ์—ฌ๋Š” ๊ฒƒ์„ ๋ง‰๋Š”๋‹ค).\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n // ์—ด๋ฆฐ ๋ชฉ๋ก์˜ Esc๋Š” ๋ชฉ๋ก๋งŒ ๋‹ซ๋Š”๋‹ค. ๊ฐ์‹ผ Dialog ๋“ฑ์€ ๋‹ซํžˆ์ง€ ์•Š๋Š”๋‹ค.\n onEscapeKeyDown={(event) => {\n // IME ์กฐํ•ฉ ์ค‘ Esc๋Š” ์กฐํ•ฉ์„ ์ทจ์†Œํ•˜๋Š” ํ‚ค๋‹ค. ์ž…๋ ฅ์˜ keydown๊ณผ ๊ฐ™์€ ๊ธฐ์ค€.\n if (event.isComposing || event.keyCode === 229) return;\n event.preventDefault();\n close();\n }}\n >\n <ul\n ref={scrollPending}\n id={listboxId}\n role=\"listbox\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={label ? undefined : inputProps[\"aria-label\"]}\n onMouseDown={(event) => event.preventDefault()}\n className={cn(LISTBOX_PANEL, \"w-(--radix-popover-trigger-width)\")}\n >\n {matches.map(({ option, index }) => {\n const isSelected = option.value === value;\n return (\n <li\n key={option.value}\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n onMouseMove={() => {\n scrollOnMove.current = false;\n if (!option.disabled) setActiveIndex(index);\n }}\n onClick={() => pick(option)}\n className={cn(\n listboxOptionClassName(size),\n index === activeIndex && LISTBOX_OPTION_ACTIVE,\n isSelected && LISTBOX_OPTION_SELECTED,\n option.disabled && LISTBOX_OPTION_DISABLED,\n )}\n >\n <span className={LISTBOX_CHECK_SLOT}>{isSelected && <ListboxCheckIcon />}</span>\n <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n </li>\n );\n })}\n {matches.length === 0 && emptyText !== undefined && (\n <li role=\"presentation\" className=\"text-text-base-neutral-2 text-body-14-regular px-4 py-3\">\n {emptyText}\n </li>\n )}\n </ul>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n <FieldMessage id={messageId} size={size} errorText={errorText} assistiveText={assistiveText} />\n </div>\n );\n};\n\nexport { Combobox };\n"],"mappings":";;;;;;;;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W;oBAAqB,KAAc,kBAAC,IAAD,CAAmB,CAAA;SAAQ,CAAA,GAC/E,kBAAC,QAAD;UAAM,WAAU;oBAA2B,EAAO;SAAY,CAAA,CAC5D;WAnBG,EAAO,KAmBV;OAER,CAAC,GACA,EAAQ,WAAW,KAAK,MAAc,KAAA,KACrC,kBAAC,MAAD;QAAI,MAAK;QAAe,WAAU;kBAC/B;OACC,CAAA,CAEJ;;KACoB,CAAA,EACH,CAAA;IACJ;;GACvB,kBAAC,IAAD;IAAc,IAAI;IAAiB;IAAiB;IAA0B;GAAgB,CAAA;EAC3F;;AAET"}
@@ -1,6 +1,5 @@
1
1
  import { cva as e } from "class-variance-authority";
2
- //#region src/components/ui/fieldStyles.ts
3
- var t = "rounded-[4px]", n = e(`flex items-center ${t} bg-surface-base-neutral-2 border transition-colors duration-200`, {
2
+ var t = e("flex items-center rounded-[4px] bg-surface-base-neutral-2 border transition-colors duration-200", {
4
3
  variants: {
5
4
  size: {
6
5
  large: "gap-2 p-[15px] min-h-[56px]",
@@ -20,7 +19,7 @@ var t = "rounded-[4px]", n = e(`flex items-center ${t} bg-surface-base-neutral-2
20
19
  disabled: !1,
21
20
  hasError: !1
22
21
  }
23
- }), r = e("", {
22
+ }), n = e("", {
24
23
  variants: {
25
24
  size: {
26
25
  large: "text-body-16-regular",
@@ -35,8 +34,8 @@ var t = "rounded-[4px]", n = e(`flex items-center ${t} bg-surface-base-neutral-2
35
34
  size: "large",
36
35
  hasError: !1
37
36
  }
38
- }), i = (e) => e === "large" ? "text-title-18-bold" : "text-title-14-bold", a = (e) => e === "large" ? "text-title-20-regular" : "text-body-16-regular", o = (...e) => e.filter(Boolean).join(" ") || void 0;
37
+ }), r = (e) => e === "large" ? "text-title-18-bold" : "text-title-14-bold", i = (e) => e === "large" ? "text-title-20-regular" : "text-body-16-regular", a = (...e) => e.filter(Boolean).join(" ") || void 0;
39
38
  //#endregion
40
- export { a, r as i, n, o, i as r, t };
39
+ export { a, i, r as n, n as r, t };
41
40
 
42
- //# sourceMappingURL=fieldStyles-DyZu__hI.js.map
41
+ //# sourceMappingURL=fieldStyles-DXyDrzxD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldStyles-DXyDrzxD.js","names":[],"sources":["../src/components/ui/fieldStyles.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\n// TextField, Select, Combobox๊ฐ€ ํ•จ๊ป˜ ์“ฐ๋Š” ์ž…๋ ฅ ์นธ ์Šคํƒ€์ผ\n// ์ž…๋ ฅ ์นธ ๋ชจ์„œ๋ฆฌ. ์†Œ๋น„ ๋ ˆํฌ์˜ --radius-* ์„ค์ •๊ณผ ๋ฌด๊ด€ํ•˜๊ฒŒ 4px๋กœ ๊ณ ์ •ํ•œ๋‹ค(๋ชฉ๋ก ํŒจ๋„์€ listboxStyles.ts).\nexport const FIELD_RADIUS = \"rounded-[4px]\";\n\nexport const fieldContainerVariants = cva(\n `flex items-center ${FIELD_RADIUS} bg-surface-base-neutral-2 border transition-colors duration-200`,\n {\n variants: {\n size: {\n large: \"gap-2 p-[15px] min-h-[56px]\",\n small: \"gap-3 p-[11px] min-h-[48px]\",\n },\n hasError: {\n true: \"border-border-prominent-error\",\n false: \"border-transparent\",\n },\n disabled: {\n true: \"opacity-50\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"large\",\n disabled: false,\n hasError: false,\n },\n },\n);\n\nexport const fieldMessageVariants = cva(\"\", {\n variants: {\n size: {\n large: \"text-body-16-regular\",\n small: \"text-caption-12-medium\",\n },\n hasError: {\n true: \"text-text-prominent-error\",\n false: \"text-text-base-neutral-2\",\n },\n },\n defaultVariants: {\n size: \"large\",\n hasError: false,\n },\n});\n\nexport type FieldSize = \"large\" | \"small\";\n\nexport const fieldLabelFontSize = (size: FieldSize) => (size === \"large\" ? \"text-title-18-bold\" : \"text-title-14-bold\");\nexport const fieldValueFontSize = (size: FieldSize) =>\n size === \"large\" ? \"text-title-20-regular\" : \"text-body-16-regular\";\n\n// ์†Œ๋น„ ๋ ˆํฌ๊ฐ€ ๋„˜๊ธด aria-describedby์™€ ํ•„๋“œ ๋ฉ”์‹œ์ง€ id๋ฅผ ํ•ฉ์นœ๋‹ค.\nexport const joinIds = (...ids: (string | false | undefined)[]) => ids.filter(Boolean).join(\" \") || undefined;\n"],"mappings":";AAMA,IAAa,IAAyB,EACpC,mGACA;CACE,UAAU;EACR,MAAM;GACJ,OAAO;GACP,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,UAAU;EACV,UAAU;CACZ;AACF,CACF,GAEa,IAAuB,EAAI,IAAI;CAC1C,UAAU;EACR,MAAM;GACJ,OAAO;GACP,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,UAAU;CACZ;AACF,CAAC,GAIY,KAAsB,MAAqB,MAAS,UAAU,uBAAuB,sBACrF,KAAsB,MACjC,MAAS,UAAU,0BAA0B,wBAGlC,KAAW,GAAG,MAAwC,EAAI,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { Badge } from './src/components/badge/Badge';
6
6
  export { Chip } from './src/components/chip/Chip';
7
7
  export { CTAButton } from './src/components/cta-button/CTAButton';
8
8
  export { Popup } from './src/components/popup/Popup';
9
- export { TextFieldNormal, TextFieldSelect, TextFieldWithButton } from './src/components/text-field/TextField';
9
+ export { TextFieldNormal, TextFieldWithButton } from './src/components/text-field/TextField';
10
10
  export { Select, type SelectOption } from './src/components/select/Select';
11
11
  export { Combobox, type ComboboxOption } from './src/components/combobox/Combobox';
12
12
  export { CancelFilledIcon } from './src/components/icons/action/CancelFilledIcon';
package/dist/index.es.js CHANGED
@@ -7,20 +7,20 @@ import { t as a } from "./Chip-Bu5q0mhe.js";
7
7
  import { CTAButton as o } from "./cta-button.js";
8
8
  import { t as s } from "./Popup-DRf-ERpL.js";
9
9
  import { CancelFilledIcon as c } from "./icons/action/cancel-filled.js";
10
- import { ChevronLeftIcon as l } from "./icons/action/chevron-left.js";
11
- import { TextFieldNormal as u, TextFieldSelect as d, TextFieldWithButton as f } from "./text-field.js";
12
- import { ChevronDownIcon as p } from "./icons/action/chevron-down.js";
13
- import { Select as m } from "./select.js";
14
- import { Combobox as h } from "./combobox.js";
15
- import { CancelIcon as g } from "./icons/action/cancel.js";
16
- import { ChevronRightIcon as _ } from "./icons/action/chevron-right.js";
17
- import { ChevronUpIcon as v } from "./icons/action/chevron-up.js";
18
- import { FilterIcon as y } from "./icons/action/filter.js";
19
- import { RetryIcon as b } from "./icons/action/retry.js";
20
- import { SortingIcon as x } from "./icons/action/sorting.js";
21
- import { CloseIcon as S } from "./icons/static/close.js";
22
- import { DeleteIcon as C } from "./icons/static/delete.js";
23
- import { RecentIcon as w } from "./icons/static/recent.js";
24
- import { ReportIcon as T } from "./icons/static/report.js";
25
- import { ShieldDoneIcon as E } from "./icons/static/shield-done.js";
26
- export { i as Badge, o as CTAButton, c as CancelFilledIcon, g as CancelIcon, n as Checkbox, p as ChevronDownIcon, l as ChevronLeftIcon, _ as ChevronRightIcon, v as ChevronUpIcon, a as Chip, S as CloseIcon, h as Combobox, C as DeleteIcon, y as FilterIcon, s as Popup, e as Radio, w as RecentIcon, T as ReportIcon, b as RetryIcon, m as Select, E as ShieldDoneIcon, x as SortingIcon, t as Tabs, u as TextFieldNormal, d as TextFieldSelect, f as TextFieldWithButton, r as Toggle };
10
+ import { TextFieldNormal as l, TextFieldWithButton as u } from "./text-field.js";
11
+ import { ChevronDownIcon as d } from "./icons/action/chevron-down.js";
12
+ import { Select as f } from "./select.js";
13
+ import { Combobox as p } from "./combobox.js";
14
+ import { CancelIcon as m } from "./icons/action/cancel.js";
15
+ import { ChevronLeftIcon as h } from "./icons/action/chevron-left.js";
16
+ import { ChevronRightIcon as g } from "./icons/action/chevron-right.js";
17
+ import { ChevronUpIcon as _ } from "./icons/action/chevron-up.js";
18
+ import { FilterIcon as v } from "./icons/action/filter.js";
19
+ import { RetryIcon as y } from "./icons/action/retry.js";
20
+ import { SortingIcon as b } from "./icons/action/sorting.js";
21
+ import { CloseIcon as x } from "./icons/static/close.js";
22
+ import { DeleteIcon as S } from "./icons/static/delete.js";
23
+ import { RecentIcon as C } from "./icons/static/recent.js";
24
+ import { ReportIcon as w } from "./icons/static/report.js";
25
+ import { ShieldDoneIcon as T } from "./icons/static/shield-done.js";
26
+ export { i as Badge, o as CTAButton, c as CancelFilledIcon, m as CancelIcon, n as Checkbox, d as ChevronDownIcon, h as ChevronLeftIcon, g as ChevronRightIcon, _ as ChevronUpIcon, a as Chip, x as CloseIcon, p as Combobox, S as DeleteIcon, v as FilterIcon, s as Popup, e as Radio, C as RecentIcon, w as ReportIcon, y as RetryIcon, f as Select, T as ShieldDoneIcon, b as SortingIcon, t as Tabs, l as TextFieldNormal, u as TextFieldWithButton, r as Toggle };