@lucian-seo/lucian-ui 0.1.4 → 0.2.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 +35 -2
- package/dist/lib/{Menu-B3G64GV4.js → Pagination-AWL5k5zG.js} +177 -48
- package/dist/lib/{Menu-B3G64GV4.js.map → Pagination-AWL5k5zG.js.map} +1 -1
- package/dist/lib/{Toolbar-DpCq_HXG.js → Toolbar-DDOaxG3B.js} +65 -194
- package/dist/lib/Toolbar-DDOaxG3B.js.map +1 -0
- package/dist/lib/{VoiceControlBar-CZL-k7ym.js → VoiceControlBar-lMPuJMcF.js} +1767 -404
- package/dist/lib/VoiceControlBar-lMPuJMcF.js.map +1 -0
- package/dist/lib/components/composed/index.js +3 -3
- package/dist/lib/components/extended/DataGrid/DataGrid.d.ts +30 -45
- package/dist/lib/components/extended/DataGrid/DataGrid.features.d.ts +155 -0
- package/dist/lib/components/extended/DataGrid/DataGridComplete.d.ts +4 -0
- package/dist/lib/components/extended/DataGrid/index.d.ts +2 -0
- package/dist/lib/components/extended/index.js +2 -2
- package/dist/lib/index.js +4 -4
- package/dist/lib/styles.css +1 -1
- package/docs/DATAGRID.md +127 -0
- package/docs/README.md +37 -0
- package/package.json +6 -2
- package/dist/lib/Toolbar-DpCq_HXG.js.map +0 -1
- package/dist/lib/VoiceControlBar-CZL-k7ym.js.map +0 -1
package/README.md
CHANGED
|
@@ -30,8 +30,8 @@ GitHub Actions는 브라우저 실행 없이 타입, Gallery/library build와
|
|
|
30
30
|
위 React·화면 조작 검증은 과거 기록이며 현재 CI가 매번 수행하는 검사는 아닙니다.
|
|
31
31
|
UI 검증은 지정한 Windows Chrome runner에서 별도로 진행합니다.
|
|
32
32
|
|
|
33
|
-
`@lucian-seo/lucian-ui`는 npmjs.com에 MIT 라이선스로 공개되어 있습니다.
|
|
34
|
-
별도 token이나 private registry 설정 없이 설치할 수 있습니다. 기존 프로젝트에 GitHub/GitLab
|
|
33
|
+
`@lucian-seo/lucian-ui`는 npmjs.com에 MIT 라이선스로 공개되어 있습니다. 누구나
|
|
34
|
+
별도 token이나 private registry 설정 없이 설치할 수 있습니다. 최신 공개 버전은 npm registry에서 확인합니다. 기존 프로젝트에 GitHub/GitLab
|
|
35
35
|
scope registry 설정이 있다면 제거하거나 npmjs.com으로 바꾸세요.
|
|
36
36
|
|
|
37
37
|
```bash
|
|
@@ -66,6 +66,39 @@ package는 `dist/lib`의 JavaScript, 타입, CSS, 폰트와 README를 배포합
|
|
|
66
66
|
Gallery registry, `DEMO.tsx`, blocks, samples는 넣지 않습니다. JavaScript source map에는
|
|
67
67
|
컴포넌트 구현 소스가 포함되므로 npm 공개 배포 후 누구나 구현을 읽을 수 있습니다.
|
|
68
68
|
|
|
69
|
+
### DataGrid 전체 기능
|
|
70
|
+
|
|
71
|
+
0.2.0부터 `features="all"`로 TanStack Table v9의 정식 기능 17개와 행·열 가상 스크롤을 사용합니다.
|
|
72
|
+
검색·열 필터·후보 값·다중 정렬·페이지·그룹·집계·트리/상세 펼치기·행/셀 선택·셀 병합,
|
|
73
|
+
열 표시·순서·크기 조절·좌우 복수 열 고정·위아래 행 고정을 제공합니다.
|
|
74
|
+
셀 편집·저장 중·실패한 초안 복구·TSV 복사와 키보드 조작도 포함합니다.
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
const rows = [{ id: "a", name: "주문 A", amount: 10000 }];
|
|
78
|
+
<DataGrid
|
|
79
|
+
features="all"
|
|
80
|
+
label="주문"
|
|
81
|
+
rows={rows}
|
|
82
|
+
rowKey={row => row.id}
|
|
83
|
+
columns={[
|
|
84
|
+
{ id: "name", header: "주문", cell: row => row.name, hideable: false },
|
|
85
|
+
{ id: "amount", header: "금액", cell: row => row.amount, numeric: true,
|
|
86
|
+
filter: "number", aggregation: ["sum", "mean"] },
|
|
87
|
+
]}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
기본 client 모드는 전달한 전체 데이터에서 처리합니다. 서버 페이지를 받는 경우에는
|
|
92
|
+
`features={{ processing: "server", rowCount, state, onStateChange }}`를 사용하고 호출자가 조회를 처리합니다.
|
|
93
|
+
`features`를 생략하면 기존 controlled API를 유지합니다.
|
|
94
|
+
전체 상태 초기값은 `createDataGridViewState(seed)`로 만들 수 있습니다.
|
|
95
|
+
`DataGridFeatures`, `DataGridViewState`, `DataGridColumn`은 `/extended`와 루트에서 import할 수 있습니다.
|
|
96
|
+
|
|
97
|
+
[실제 기능 프리뷰](https://interaction-assets.vercel.app/?c=extended/DataGrid)에서 기능을 조작할 수 있습니다.
|
|
98
|
+
전체 설정·키보드·서버 계약은 설치한 package의 `docs/DATAGRID.md`에 포함되어 있습니다.
|
|
99
|
+
가상화한 화면 밖 행·열은 브라우저 찾기에 포함되지 않습니다. 전체 검색을 사용하거나
|
|
100
|
+
`virtualize={false}`와 `features.columnVirtualization=false`로 가상화를 끕니다.
|
|
101
|
+
|
|
69
102
|
### 바꿀 수 있는 디자인 값
|
|
70
103
|
|
|
71
104
|
공통 디자인 값은 CSS custom property로 바꿉니다. theme, brand, density, radius variation도 같은
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { s as e, t } from "./VisuallyHidden-DcE0EFpo.js";
|
|
2
2
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import { cloneElement as i, forwardRef as a, useId as o, useLayoutEffect as s,
|
|
4
|
-
import { Check as
|
|
5
|
-
import * as
|
|
3
|
+
import { cloneElement as i, forwardRef as a, useId as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
4
|
+
import { Check as u, ChevronDown as d, ChevronLeft as f, ChevronRight as p, Circle as m } from "lucide-react";
|
|
5
|
+
import * as h from "@radix-ui/react-dropdown-menu";
|
|
6
6
|
//#region src/foundation/focus.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
return [...document.querySelectorAll(
|
|
7
|
+
var g = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
8
|
+
function _() {
|
|
9
|
+
return [...document.querySelectorAll(g)].filter((e) => !e.closest("[aria-hidden=\"true\"]") && e.offsetParent !== null);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function v(e) {
|
|
12
12
|
if (!e) return () => {};
|
|
13
|
-
let t =
|
|
13
|
+
let t = _(), n = (t) => e.contains(t), r = t.find((t) => !n(t) && e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING), i = [...t].reverse().find((t) => !n(t) && e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_PRECEDING), a = r ?? i ?? null;
|
|
14
14
|
return () => {
|
|
15
15
|
a && requestAnimationFrame(() => {
|
|
16
16
|
let e = document.activeElement;
|
|
@@ -20,12 +20,12 @@ function g(e) {
|
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/components/composed/Disclosure/Disclosure.tsx
|
|
23
|
-
function
|
|
23
|
+
function y({ summary: t, children: i, defaultOpen: a, open: o, onOpenChange: s, icon: c, aside: l, plain: u, className: f, ...p }) {
|
|
24
24
|
let m = o !== void 0;
|
|
25
25
|
return /* @__PURE__ */ r("details", {
|
|
26
26
|
...p,
|
|
27
27
|
className: `disclosure ${f ?? ""}`.trim(),
|
|
28
|
-
"data-plain":
|
|
28
|
+
"data-plain": u ? "" : void 0,
|
|
29
29
|
open: o ?? a,
|
|
30
30
|
onToggle: (e) => {
|
|
31
31
|
let t = e.currentTarget.open;
|
|
@@ -38,7 +38,7 @@ function _({ summary: t, children: i, defaultOpen: a, open: o, onOpenChange: s,
|
|
|
38
38
|
} : void 0,
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ n(e, {
|
|
41
|
-
icon:
|
|
41
|
+
icon: d,
|
|
42
42
|
size: "sm",
|
|
43
43
|
className: "disclosure__chevron"
|
|
44
44
|
}),
|
|
@@ -62,7 +62,7 @@ function _({ summary: t, children: i, defaultOpen: a, open: o, onOpenChange: s,
|
|
|
62
62
|
})]
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function b({ children: e, className: t, ...r }) {
|
|
66
66
|
return /* @__PURE__ */ n("div", {
|
|
67
67
|
...r,
|
|
68
68
|
className: `accordion ${t ?? ""}`.trim(),
|
|
@@ -71,7 +71,7 @@ function v({ children: e, className: t, ...r }) {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/components/composed/Field/Field.tsx
|
|
74
|
-
function
|
|
74
|
+
function x({ label: e, children: i, hint: a, error: s, required: c, optional: l, size: u = "md", layout: d = "stacked", labelHidden: f, id: p, className: m, ...h }) {
|
|
75
75
|
let g = o(), _ = p ?? g, v = `${_}-label`, y = `${_}-hint`, b = `${_}-error`, x = !!s, S = [x ? b : null, a ? y : null].filter(Boolean).join(" ");
|
|
76
76
|
return /* @__PURE__ */ r("div", {
|
|
77
77
|
...h,
|
|
@@ -133,15 +133,15 @@ function y({ label: e, children: i, hint: a, error: s, required: c, optional: l,
|
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region src/components/composed/Menu/scope.tsx
|
|
136
|
-
var
|
|
136
|
+
var S = [
|
|
137
137
|
"data-theme",
|
|
138
138
|
"data-brand",
|
|
139
139
|
"data-density",
|
|
140
140
|
"data-radius",
|
|
141
141
|
"data-look"
|
|
142
142
|
];
|
|
143
|
-
function
|
|
144
|
-
let [e, t] =
|
|
143
|
+
function C() {
|
|
144
|
+
let [e, t] = l(null), [n, r] = l([]);
|
|
145
145
|
return s(() => {
|
|
146
146
|
if (!e) return;
|
|
147
147
|
let t = [];
|
|
@@ -157,7 +157,7 @@ function x() {
|
|
|
157
157
|
let i = new MutationObserver(n);
|
|
158
158
|
for (let e of t) i.observe(e, {
|
|
159
159
|
attributes: !0,
|
|
160
|
-
attributeFilter: [...
|
|
160
|
+
attributeFilter: [...S]
|
|
161
161
|
});
|
|
162
162
|
return () => i.disconnect();
|
|
163
163
|
}, [e]), {
|
|
@@ -165,7 +165,7 @@ function x() {
|
|
|
165
165
|
setTrigger: t
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
var
|
|
168
|
+
var w = a(function({ scopes: e, children: t }, r) {
|
|
169
169
|
return e.reduceRight((e, t, r) => /* @__PURE__ */ n("div", {
|
|
170
170
|
className: "menu__scope",
|
|
171
171
|
"data-theme": t["data-theme"],
|
|
@@ -178,19 +178,19 @@ var S = a(function({ scopes: e, children: t }, r) {
|
|
|
178
178
|
});
|
|
179
179
|
//#endregion
|
|
180
180
|
//#region src/components/composed/Menu/Menu.tsx
|
|
181
|
-
function
|
|
182
|
-
let { scopes: d, setTrigger: f } =
|
|
183
|
-
return /* @__PURE__ */ r(
|
|
181
|
+
function T({ children: e, items: t, side: i = "bottom", align: a = "start", open: o, onOpenChange: s, disabled: c, id: l, className: u }) {
|
|
182
|
+
let { scopes: d, setTrigger: f } = C();
|
|
183
|
+
return /* @__PURE__ */ r(h.Root, {
|
|
184
184
|
open: o,
|
|
185
185
|
onOpenChange: s,
|
|
186
|
-
children: [/* @__PURE__ */ n(
|
|
186
|
+
children: [/* @__PURE__ */ n(h.Trigger, {
|
|
187
187
|
ref: f,
|
|
188
188
|
asChild: !0,
|
|
189
189
|
disabled: c,
|
|
190
190
|
children: e
|
|
191
|
-
}), /* @__PURE__ */ n(
|
|
191
|
+
}), /* @__PURE__ */ n(h.Portal, { children: /* @__PURE__ */ n(w, {
|
|
192
192
|
scopes: d,
|
|
193
|
-
children: /* @__PURE__ */ n(
|
|
193
|
+
children: /* @__PURE__ */ n(h.Content, {
|
|
194
194
|
...l ? { id: l } : null,
|
|
195
195
|
className: `menu ${u ?? ""}`.trim(),
|
|
196
196
|
side: i,
|
|
@@ -202,8 +202,8 @@ function C({ children: e, items: t, side: i = "bottom", align: a = "start", open
|
|
|
202
202
|
}) })]
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return /* @__PURE__ */ r(
|
|
205
|
+
function E({ children: t, icon: i, shortcut: a, destructive: o, disabled: s, onSelect: c, className: l, ...u }) {
|
|
206
|
+
return /* @__PURE__ */ r(h.Item, {
|
|
207
207
|
...u,
|
|
208
208
|
className: `menu__item ${l ?? ""}`.trim(),
|
|
209
209
|
"data-destructive": o ? "" : void 0,
|
|
@@ -226,8 +226,8 @@ function w({ children: t, icon: i, shortcut: a, destructive: o, disabled: s, onS
|
|
|
226
226
|
]
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return /* @__PURE__ */ r(
|
|
229
|
+
function D({ children: t, checked: i, onCheckedChange: a, disabled: o, className: s, ...c }) {
|
|
230
|
+
return /* @__PURE__ */ r(h.CheckboxItem, {
|
|
231
231
|
...c,
|
|
232
232
|
className: `menu__item ${s ?? ""}`.trim(),
|
|
233
233
|
checked: i,
|
|
@@ -236,8 +236,8 @@ function T({ children: t, checked: i, onCheckedChange: a, disabled: o, className
|
|
|
236
236
|
children: [/* @__PURE__ */ n("span", {
|
|
237
237
|
className: "menu__mark",
|
|
238
238
|
"aria-hidden": "true",
|
|
239
|
-
children: /* @__PURE__ */ n(
|
|
240
|
-
icon:
|
|
239
|
+
children: /* @__PURE__ */ n(h.ItemIndicator, { children: /* @__PURE__ */ n(e, {
|
|
240
|
+
icon: u,
|
|
241
241
|
size: "xs"
|
|
242
242
|
}) })
|
|
243
243
|
}), /* @__PURE__ */ n("span", {
|
|
@@ -246,15 +246,15 @@ function T({ children: t, checked: i, onCheckedChange: a, disabled: o, className
|
|
|
246
246
|
})]
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
return /* @__PURE__ */ n(
|
|
249
|
+
function O({ children: e, value: t, onValueChange: r }) {
|
|
250
|
+
return /* @__PURE__ */ n(h.RadioGroup, {
|
|
251
251
|
value: t,
|
|
252
252
|
onValueChange: r,
|
|
253
253
|
children: e
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return /* @__PURE__ */ r(
|
|
256
|
+
function k({ children: t, value: i, disabled: a, className: o, ...s }) {
|
|
257
|
+
return /* @__PURE__ */ r(h.RadioItem, {
|
|
258
258
|
...s,
|
|
259
259
|
className: `menu__item ${o ?? ""}`.trim(),
|
|
260
260
|
value: i,
|
|
@@ -262,8 +262,8 @@ function D({ children: t, value: i, disabled: a, className: o, ...s }) {
|
|
|
262
262
|
children: [/* @__PURE__ */ n("span", {
|
|
263
263
|
className: "menu__mark",
|
|
264
264
|
"aria-hidden": "true",
|
|
265
|
-
children: /* @__PURE__ */ n(
|
|
266
|
-
icon:
|
|
265
|
+
children: /* @__PURE__ */ n(h.ItemIndicator, { children: /* @__PURE__ */ n(e, {
|
|
266
|
+
icon: m,
|
|
267
267
|
size: "xs",
|
|
268
268
|
className: "menu__dot"
|
|
269
269
|
}) })
|
|
@@ -273,18 +273,18 @@ function D({ children: t, value: i, disabled: a, className: o, ...s }) {
|
|
|
273
273
|
})]
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
return /* @__PURE__ */ r(
|
|
276
|
+
function A({ children: e, label: t }) {
|
|
277
|
+
return /* @__PURE__ */ r(h.Group, { children: [t ? /* @__PURE__ */ n(h.Label, {
|
|
278
278
|
className: "menu__group-label",
|
|
279
279
|
children: t
|
|
280
280
|
}) : null, e] });
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
return /* @__PURE__ */ n(
|
|
282
|
+
function j() {
|
|
283
|
+
return /* @__PURE__ */ n(h.Separator, { className: "menu__separator" });
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
let { scopes: s, setTrigger: c } =
|
|
287
|
-
return /* @__PURE__ */ r(
|
|
285
|
+
function M({ children: t, label: i, icon: a, disabled: o }) {
|
|
286
|
+
let { scopes: s, setTrigger: c } = C();
|
|
287
|
+
return /* @__PURE__ */ r(h.Sub, { children: [/* @__PURE__ */ r(h.SubTrigger, {
|
|
288
288
|
ref: c,
|
|
289
289
|
className: "menu__item",
|
|
290
290
|
disabled: o,
|
|
@@ -299,14 +299,14 @@ function A({ children: t, label: i, icon: a, disabled: o }) {
|
|
|
299
299
|
children: i
|
|
300
300
|
}),
|
|
301
301
|
/* @__PURE__ */ n(e, {
|
|
302
|
-
icon:
|
|
302
|
+
icon: p,
|
|
303
303
|
size: "xs",
|
|
304
304
|
className: "menu__chevron"
|
|
305
305
|
})
|
|
306
306
|
]
|
|
307
|
-
}), /* @__PURE__ */ n(
|
|
307
|
+
}), /* @__PURE__ */ n(h.Portal, { children: /* @__PURE__ */ n(w, {
|
|
308
308
|
scopes: s,
|
|
309
|
-
children: /* @__PURE__ */ n(
|
|
309
|
+
children: /* @__PURE__ */ n(h.SubContent, {
|
|
310
310
|
className: "menu",
|
|
311
311
|
sideOffset: 4,
|
|
312
312
|
alignOffset: -4,
|
|
@@ -316,6 +316,135 @@ function A({ children: t, label: i, icon: a, disabled: o }) {
|
|
|
316
316
|
}) })] });
|
|
317
317
|
}
|
|
318
318
|
//#endregion
|
|
319
|
-
|
|
319
|
+
//#region src/components/composed/Pagination/Pagination.tsx
|
|
320
|
+
var N = (e, t) => Array.from({ length: Math.max(0, t - e + 1) }, (t, n) => e + n), P = (e) => Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0, F = (e, t) => Math.max(1, Math.min(t || 1, Number.isFinite(e) ? Math.floor(e) : 1));
|
|
321
|
+
function I(e, t, n = 1) {
|
|
322
|
+
t = P(t), e = F(e, t), n = Number.isFinite(n) ? Math.max(0, Math.min(t, Math.floor(n))) : 1;
|
|
323
|
+
let r = n * 2 + 5;
|
|
324
|
+
if (t <= r) return N(1, t);
|
|
325
|
+
let i = t, a = e - n > 2, o = e + n < i - 1, s = r - 2 - !!a - !!o;
|
|
326
|
+
return a ? o ? [
|
|
327
|
+
1,
|
|
328
|
+
"gap",
|
|
329
|
+
...N(e - n, e + n),
|
|
330
|
+
"gap",
|
|
331
|
+
i
|
|
332
|
+
] : [
|
|
333
|
+
1,
|
|
334
|
+
"gap",
|
|
335
|
+
...N(i - s, i)
|
|
336
|
+
] : [
|
|
337
|
+
...N(1, 1 + s),
|
|
338
|
+
"gap",
|
|
339
|
+
i
|
|
340
|
+
];
|
|
341
|
+
}
|
|
342
|
+
function L({ page: i, pageCount: a, onPageChange: o, label: u, siblings: d = 1, summary: m, size: h = "md", responsive: g = !0, className: _, ...v }) {
|
|
343
|
+
let y = P(a), b = F(i, y), x = c(null), S = c(null), [C, w] = l(null);
|
|
344
|
+
s(() => {
|
|
345
|
+
if (!g || !x.current || !S.current) return;
|
|
346
|
+
let e = 0, t = 0, n = () => {
|
|
347
|
+
let n = S.current;
|
|
348
|
+
if (!n || !x.current) return;
|
|
349
|
+
let r = getComputedStyle(n), i = parseFloat(r.columnGap) || 0, a = [...n.querySelectorAll("button, .pagination__gap")].map((e) => e.getBoundingClientRect().width), o = n.querySelector(".pagination__step")?.getBoundingClientRect().width ?? 0;
|
|
350
|
+
o !== t && (e = 0), t = o, e = Math.max(e, ...a, 1);
|
|
351
|
+
let s = e;
|
|
352
|
+
w(Math.max(3, Math.floor((x.current.clientWidth + i) / (s + i))));
|
|
353
|
+
};
|
|
354
|
+
n();
|
|
355
|
+
let r = new ResizeObserver(n);
|
|
356
|
+
r.observe(x.current);
|
|
357
|
+
for (let e of S.current.querySelectorAll("button")) r.observe(e);
|
|
358
|
+
return () => r.disconnect();
|
|
359
|
+
}, [
|
|
360
|
+
g,
|
|
361
|
+
h,
|
|
362
|
+
b,
|
|
363
|
+
y,
|
|
364
|
+
d
|
|
365
|
+
]);
|
|
366
|
+
let T = I(b, y, d);
|
|
367
|
+
g && C !== null && T.length + 2 > C && (T = I(b, y, 0), T.length + 2 > C && (T = y ? [b] : []));
|
|
368
|
+
let E = b <= 1 || y <= 0, D = b >= y || y <= 0;
|
|
369
|
+
return /* @__PURE__ */ r("nav", {
|
|
370
|
+
...v,
|
|
371
|
+
ref: x,
|
|
372
|
+
className: `pagination ${_ ?? ""}`.trim(),
|
|
373
|
+
"aria-label": u,
|
|
374
|
+
"data-size": h,
|
|
375
|
+
children: [m ? /* @__PURE__ */ r("p", {
|
|
376
|
+
className: "pagination__summary",
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ r("span", {
|
|
379
|
+
className: "pagination__figures",
|
|
380
|
+
children: [
|
|
381
|
+
m.from.toLocaleString("ko-KR"),
|
|
382
|
+
"–",
|
|
383
|
+
m.to.toLocaleString("ko-KR")
|
|
384
|
+
]
|
|
385
|
+
}),
|
|
386
|
+
" / ",
|
|
387
|
+
/* @__PURE__ */ n("span", {
|
|
388
|
+
className: "pagination__figures",
|
|
389
|
+
children: m.total.toLocaleString("ko-KR")
|
|
390
|
+
})
|
|
391
|
+
]
|
|
392
|
+
}) : null, /* @__PURE__ */ r("ul", {
|
|
393
|
+
className: "pagination__list",
|
|
394
|
+
ref: S,
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ r("button", {
|
|
397
|
+
type: "button",
|
|
398
|
+
className: "pagination__step",
|
|
399
|
+
onClick: () => {
|
|
400
|
+
E || o(b - 1);
|
|
401
|
+
},
|
|
402
|
+
"aria-disabled": E || void 0,
|
|
403
|
+
"data-part": "previous",
|
|
404
|
+
children: [/* @__PURE__ */ n(e, {
|
|
405
|
+
icon: f,
|
|
406
|
+
size: "sm"
|
|
407
|
+
}), /* @__PURE__ */ n(t, { children: "이전 페이지" })]
|
|
408
|
+
}) }),
|
|
409
|
+
T.map((e, i) => e === "gap" ? /* @__PURE__ */ n("li", {
|
|
410
|
+
className: "pagination__gap",
|
|
411
|
+
"aria-hidden": "true",
|
|
412
|
+
children: "…"
|
|
413
|
+
}, `gap-${i}`) : /* @__PURE__ */ n("li", { children: e === b ? /* @__PURE__ */ r("button", {
|
|
414
|
+
type: "button",
|
|
415
|
+
className: "pagination__page",
|
|
416
|
+
"aria-current": "page",
|
|
417
|
+
onClick: () => void 0,
|
|
418
|
+
"data-part": "current",
|
|
419
|
+
children: [/* @__PURE__ */ n(t, { children: `${y}페이지 중 ` }), e]
|
|
420
|
+
}) : /* @__PURE__ */ r("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
className: "pagination__page",
|
|
423
|
+
onClick: () => o(e),
|
|
424
|
+
"data-part": `page-${e}`,
|
|
425
|
+
children: [/* @__PURE__ */ n(t, { children: `${e}페이지로` }), /* @__PURE__ */ n("span", {
|
|
426
|
+
"aria-hidden": "true",
|
|
427
|
+
children: e
|
|
428
|
+
})]
|
|
429
|
+
}) }, e)),
|
|
430
|
+
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ r("button", {
|
|
431
|
+
type: "button",
|
|
432
|
+
className: "pagination__step",
|
|
433
|
+
onClick: () => {
|
|
434
|
+
D || o(b + 1);
|
|
435
|
+
},
|
|
436
|
+
"aria-disabled": D || void 0,
|
|
437
|
+
"data-part": "next",
|
|
438
|
+
children: [/* @__PURE__ */ n(e, {
|
|
439
|
+
icon: p,
|
|
440
|
+
size: "sm"
|
|
441
|
+
}), /* @__PURE__ */ n(t, { children: "다음 페이지" })]
|
|
442
|
+
}) })
|
|
443
|
+
]
|
|
444
|
+
})]
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
//#endregion
|
|
448
|
+
export { A as a, k as c, x as d, b as f, D as i, j as l, v as m, I as n, E as o, y as p, T as r, O as s, L as t, M as u };
|
|
320
449
|
|
|
321
|
-
//# sourceMappingURL=
|
|
450
|
+
//# sourceMappingURL=Pagination-AWL5k5zG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu-B3G64GV4.js","names":[],"sources":["../../src/foundation/focus.ts","../../src/components/composed/Disclosure/Disclosure.tsx","../../src/components/composed/Field/Field.tsx","../../src/components/composed/Menu/scope.tsx","../../src/components/composed/Menu/Menu.tsx"],"sourcesContent":["/*\n * 스스로를 지우는 컨트롤이 초점을 데려가지 않게 합니다.\n *\n * 닫기 버튼은 자기가 닫는 것 안에 있습니다. 눌러서 그것이 사라지면 눌린 버튼도 함께\n * 사라지고 초점은 `<body>`로 떨어집니다 — 다음 Tab이 문서 처음부터 다시 시작한다는\n * 뜻이고, 키보드로 읽던 사람은 있던 자리를 통째로 잃습니다.\n *\n * `FilterBar`와 `BulkActionBar`는 자기가 살아남으므로 사라진 뒤에 효과를 돌려 해결했지만,\n * `Callout`이나 `QuantityStepper`처럼 자기가 통째로 사라지는 것은 그 방법을 쓸 수 없습니다.\n * 그래서 아직 붙어 있는 동안 갈 곳을 찾아 두고, 한 프레임 뒤에 **정말 사라졌는지** 보고\n * 옮깁니다.\n *\n * 「정말 사라졌는지」가 핵심입니다. 호출부가 콜백을 무시해 아직 화면에 있으면 초점은\n * 눌린 버튼에 그대로 있고, 그때 초점을 옮기는 것은 무례한 짓입니다. `<body>`에 있을\n * 때만 옮깁니다 — `FilterBar`가 같은 이유로 같은 검사를 합니다.\n */\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nfunction focusables(): HTMLElement[] {\n return [...document.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (node) => !node.closest('[aria-hidden=\"true\"]') && node.offsetParent !== null,\n );\n}\n\n/**\n * `leaving`이 사라진 뒤 초점이 갈 자리를 지금 정해 두고, 옮기는 일을 돌려줍니다.\n *\n * 문서 순서에서 그 요소 **뒤**의 첫 초점 가능한 것, 없으면 **앞**의 마지막 것입니다.\n * 뒤를 먼저 보는 이유는 목록에서 한 줄을 지우면 읽던 자리가 다음 줄로 이어지기\n * 때문이고, 마지막 줄을 지웠을 때만 앞으로 돌아갑니다.\n *\n * 돌려받은 것을 `onDismiss`·`onRemove`를 부른 **뒤에** 호출합니다.\n */\nexport function handOffFocus(leaving: HTMLElement | null): () => void {\n if (!leaving) return () => {};\n\n const all = focusables();\n const inside = (node: HTMLElement) => leaving.contains(node);\n const after = all.find((node) => !inside(node) && leaving.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING);\n const before = [...all].reverse().find((node) => !inside(node) && leaving.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_PRECEDING);\n const target = after ?? before ?? null;\n\n return () => {\n if (!target) return;\n /* 한 프레임 뒤. 그 사이에 호출부가 지웠는지 아닌지가 정해집니다. */\n requestAnimationFrame(() => {\n const now = document.activeElement;\n if (now && now !== document.body) return;\n if (!target.isConnected) return;\n target.focus();\n });\n };\n}\n","import type { ReactNode } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport \"./Disclosure.css\";\n\nexport type DisclosureProps = {\n summary: ReactNode;\n children: ReactNode;\n /** Open to begin with. Uncontrolled — the element keeps its own state. */\n defaultOpen?: boolean;\n /** Controlled, for an accordion that allows only one open at a time. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n icon?: LucideIcon;\n /** The end of the summary row — a count, a badge, a status. Never a control. */\n aside?: ReactNode;\n /** No border and no ground, for a run of them inside something that already has both. */\n plain?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A heading that opens.\n *\n * A real `<details>` and `<summary>`, which is the whole point. The element gives the\n * expanded state to assistive technology without an `aria-expanded` to keep in sync, works\n * with the keyboard on its own, and — the part that is hard to rebuild — lets the browser's\n * find-in-page open it to show a match that is inside it. A `<div>` with a click handler\n * hides that text from Ctrl+F entirely.\n */\nexport function Disclosure({\n summary,\n children,\n defaultOpen,\n open,\n onOpenChange,\n icon,\n aside,\n plain,\n className,\n ...rest\n}: DisclosureProps) {\n /*\n * Controlled means the element does not toggle itself.\n *\n * `<details>` is not an input: React cannot hold its `open` attribute, so the browser flips\n * it on click and React puts it back on the next render. Left to `onToggle`, that reset\n * fires a *second* toggle — and in a one-open-at-a-time accordion the section being closed\n * reports \"closed\" and clears the state for the one that was just opened, so everything\n * ends up shut. Intercepting the click is what makes `open` mean what it says.\n */\n const controlled = open !== undefined;\n\n return (\n <details\n {...rest}\n className={`disclosure ${className ?? \"\"}`.trim()}\n data-plain={plain ? \"\" : undefined}\n open={open ?? defaultOpen}\n /*\n * Controlled or not, what the element ends up doing is reported.\n *\n * The click is intercepted below, but that is not the only way this opens: find-in-page\n * opens a closed `<details>` to show the match, and nothing tells React. State stayed\n * closed while the DOM stayed open, and the next click — computing `!open` from the\n * stale state — asked for the state it already had, so the section could not be closed\n * again. Reporting the element's own `open` back keeps the two in step.\n */\n onToggle={(event) => {\n const now = (event.currentTarget as HTMLDetailsElement).open;\n if (controlled && now === open) return;\n onOpenChange?.(now);\n }}\n >\n <summary\n className=\"disclosure__summary\"\n onClick={\n controlled\n ? (event) => {\n event.preventDefault();\n onOpenChange?.(!open);\n }\n : undefined\n }\n >\n <Icon icon={ChevronDown} size=\"sm\" className=\"disclosure__chevron\" />\n {icon ? <Icon icon={icon} size=\"sm\" className=\"disclosure__icon\" /> : null}\n <span className=\"disclosure__label\">{summary}</span>\n {aside ? <span className=\"disclosure__aside\">{aside}</span> : null}\n </summary>\n <div className=\"disclosure__body\">{children}</div>\n </details>\n );\n}\n\nexport type AccordionProps = {\n children: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A run of disclosures.\n *\n * It does not enforce \"one open at a time\", and that is deliberate: closing a section a\n * reader opened, because they opened another one, is the behaviour people complain about\n * most in an accordion. An adopter who wants it holds the state and passes `open` to each —\n * `Disclosure` takes it — and then it is their decision rather than one this component made\n * for every use of it.\n */\nexport function Accordion({ children, className, ...rest }: AccordionProps) {\n return (\n <div {...rest} className={`accordion ${className ?? \"\"}`.trim()}>\n {children}\n </div>\n );\n}\n","import { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./Field.css\";\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\nexport type FieldLayout = \"stacked\" | \"inline\";\n\n/**\n * What a control needs in order to be part of a field.\n *\n * Handed to `children` rather than pushed onto them. The alternative — cloning the child and\n * writing these in — works until the child is wrapped in anything at all, and then it fails\n * silently: the label points at nothing and nobody notices, because the field still looks\n * right.\n */\nexport type FieldControl = {\n id: string;\n /** The visible label, said a second way — see where this is handed over below. */\n \"aria-labelledby\": string;\n /** The hint, the error, or both, in the order a reader should hear them. */\n \"aria-describedby\": string | undefined;\n \"aria-invalid\": true | undefined;\n required: boolean | undefined;\n invalid: boolean;\n};\n\ntype FieldBase = {\n label: ReactNode;\n children: (field: FieldControl) => ReactNode;\n /** How to fill it in. Said before the reader starts, not after they get it wrong. */\n hint?: ReactNode;\n /** What is wrong with it. Announced when it appears, because it appears after a submit. */\n error?: ReactNode;\n size?: FieldSize;\n layout?: FieldLayout;\n /** The label leaves the screen and stays in the accessibility tree. */\n labelHidden?: boolean;\n id?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Required or optional, never both.\n *\n * A field wearing an asterisk *and* the word \"선택\" tells the reader two opposite things at\n * once, and nothing stopped it: the two flags are answers to the same question, so the type\n * makes them exclusive.\n *\n * `optional` says \"선택\" instead of marking the required ones — the right choice when most of\n * a form is required, because marking eleven fields and leaving one unmarked makes the\n * exception the thing that is hard to find.\n */\nexport type FieldProps = FieldBase &\n ({ required?: boolean; optional?: never } | { required?: never; optional?: boolean });\n\n/**\n * A control, and everything a reader needs in order to answer it.\n *\n * The wiring is handed to `children` as a function rather than cloned onto them, because a\n * label that points at nothing looks exactly like a label that works.\n */\nexport function Field({\n label,\n children,\n hint,\n error,\n required,\n optional,\n size = \"md\",\n layout = \"stacked\",\n labelHidden,\n id,\n className,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const fieldId = id ?? generated;\n const labelId = `${fieldId}-label`;\n const hintId = `${fieldId}-hint`;\n const errorId = `${fieldId}-error`;\n const invalid = Boolean(error);\n\n /*\n * The error first. `aria-describedby` is read in the order the ids are listed, not in\n * document order, and a reader who has just failed to submit needs the problem before the\n * instructions they already read once.\n */\n const describedBy = [invalid ? errorId : null, hint ? hintId : null].filter(Boolean).join(\" \");\n\n return (\n <div\n {...rest}\n className={`field ${className ?? \"\"}`.trim()}\n data-size={size}\n data-layout={layout}\n data-invalid={invalid ? \"\" : undefined}\n data-label-hidden={labelHidden ? \"\" : undefined}\n >\n <div className=\"field__head\">\n <label className=\"field__label\" id={labelId} htmlFor={fieldId}>\n {labelHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n {/* An asterisk is a punctuation mark to a screen reader, and some skip it entirely.\n * The word is there for them and the mark is there for everyone else; `required`\n * on the control is what actually carries the state. */}\n {required && !labelHidden ? (\n <span className=\"field__required\" aria-hidden=\"true\">*</span>\n ) : null}\n {required ? <VisuallyHidden> (필수)</VisuallyHidden> : null}\n </label>\n {optional && !labelHidden ? <span className=\"field__optional\">선택</span> : null}\n {/* Same trade as `required` above: the visible word has nowhere to sit when the label\n * is hidden, so the spoken one carries it alone. Without this the fact that a field\n * is optional simply disappeared for anyone not looking at the screen. */}\n {optional && labelHidden ? <VisuallyHidden>(선택)</VisuallyHidden> : null}\n </div>\n\n {hint ? (\n <p className=\"field__hint\" id={hintId}>\n {hint}\n </p>\n ) : null}\n\n <div className=\"field__control\">\n {children({\n id: fieldId,\n /*\n * The `<label for>` above already names the control, and this says the same thing a\n * second way. It is here for the controls that carry a name of their own — `Combobox`\n * and `DatePicker` write an `aria-label`, which outranks a `<label>` and would leave\n * the visible words and the spoken ones free to disagree. They stand down when this\n * arrives.\n */\n \"aria-labelledby\": labelId,\n \"aria-describedby\": describedBy || undefined,\n \"aria-invalid\": invalid || undefined,\n required: required || undefined,\n invalid,\n })}\n </div>\n\n {/*\n * Mounted whether or not there is an error, and empty when there is not.\n *\n * A live region that appears at the same moment as its text announces nothing in\n * several screen readers — the region has to be there first for the change to be a\n * change. This is why an error that arrives after a failed submit is heard at all.\n */}\n <p className=\"field__error\" id={errorId} aria-live=\"polite\" data-part=\"error\">\n {error}\n </p>\n </div>\n );\n}\n","import { cloneElement, forwardRef, useLayoutEffect, useState, type ReactElement, type ReactNode, type Ref } from \"react\";\n\nconst ATTRIBUTES = [\"data-theme\", \"data-brand\", \"data-density\", \"data-radius\", \"data-look\"] as const;\ntype Scope = Record<(typeof ATTRIBUTES)[number], string | undefined>;\n\n/** Preserve built-in variation scopes without copying computed paint or moving the portal. */\nexport function useMenuScopes() {\n const [trigger, setTrigger] = useState<HTMLElement | null>(null);\n const [scopes, setScopes] = useState<Scope[]>([]);\n useLayoutEffect(() => {\n if (!trigger) return;\n const ancestors: HTMLElement[] = [];\n // body and html already contain the portal. Keep empty levels so attribute changes do\n // not change the wrapper tree and remount a focused menu.\n for (let node: HTMLElement | null = trigger; node && node !== trigger.ownerDocument.body; node = node.parentElement) {\n ancestors.unshift(node);\n }\n const read = () => setScopes(ancestors.map((node) => ({\n \"data-theme\": node.getAttribute(\"data-theme\") ?? undefined,\n \"data-brand\": node.getAttribute(\"data-brand\") ?? undefined,\n \"data-density\": node.getAttribute(\"data-density\") ?? undefined,\n \"data-radius\": node.getAttribute(\"data-radius\") ?? undefined,\n \"data-look\": node.getAttribute(\"data-look\") ?? undefined,\n })));\n read();\n const observer = new MutationObserver(read);\n for (const node of ancestors) observer.observe(node, { attributes: true, attributeFilter: [...ATTRIBUTES] });\n return () => observer.disconnect();\n }, [trigger]);\n return { scopes, setTrigger };\n}\n\nexport const MenuPortalScope = forwardRef<HTMLDivElement, {\n scopes: Scope[];\n children: ReactElement<{ ref?: Ref<HTMLDivElement> }>;\n}>(function MenuPortalScope({ scopes, children }, ref) {\n return scopes.reduceRight<ReactNode>((content, scope, index) => (\n <div key={index} className=\"menu__scope\"\n data-theme={scope[\"data-theme\"]}\n data-brand={scope[\"data-brand\"]}\n data-density={scope[\"data-density\"]}\n data-radius={scope[\"data-radius\"]}\n data-look={scope[\"data-look\"]}\n >{content}</div>\n // Radix Presence must observe the animated panel, not a display:contents wrapper.\n ), cloneElement(children, { ref }));\n});\n","import type { ReactElement, ReactNode } from \"react\";\nimport * as RadixMenu from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { MenuPortalScope, useMenuScopes } from \"./scope\";\nimport \"./Menu.css\";\n\nexport type MenuSide = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type MenuAlign = \"start\" | \"center\" | \"end\";\n\nexport type MenuProps = {\n /** The control that opens it. One element, and it must be able to take focus. */\n children: ReactElement;\n /** `MenuItem`, `MenuGroup`, `MenuSeparator` and friends. */\n items: ReactNode;\n side?: MenuSide;\n align?: MenuAlign;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Locks the trigger.\n *\n * `Button` and `IconButton` mark themselves `aria-disabled` and stop their own `onClick`,\n * and Radix opens on `pointerdown` and `keydown` — so a disabled-looking trigger still\n * opened the menu. Passed here, Radix refuses both.\n */\n disabled?: boolean;\n /** The panel's `id`, for a trigger that points at it with `aria-controls`. */\n id?: string;\n className?: string;\n};\n\n/**\n * A list of actions, opened from a control.\n *\n * Radix rather than hand-rolled. A menu is the control with the most keyboard behaviour of\n * anything in this library: type-ahead, arrow keys that stop at either end, Home and End, submenus that\n * open on hover behind a safe triangle and on ArrowRight, ArrowLeft closing one level and\n * Escape closing all of them, focus returned to the trigger, and the whole page made inert\n * while it is up. Rebuilt by hand, one of those is always missing.\n *\n * Not a `<select>`. A menu performs actions; a select chooses a value and submits it with a\n * form. If the thing being pointed at is a value, it is `Select` or `SegmentedControl`.\n *\n * There is no `label` prop, and there was one until it turned out not to work. The menu is\n * named by its trigger — `aria-labelledby` pointing at the button, which takes precedence\n * over any `aria-label` written beside it — and that is the right name anyway: a reader who\n * opened \"보기 설정\" is in the 보기 설정 menu. What it means is that the trigger has to be\n * named well, which for an icon-only one `IconButton` already requires.\n */\nexport function Menu({\n children,\n items,\n side = \"bottom\",\n align = \"start\",\n open,\n onOpenChange,\n disabled,\n id,\n className,\n}: MenuProps) {\n const { scopes, setTrigger } = useMenuScopes();\n return (\n <RadixMenu.Root open={open} onOpenChange={onOpenChange}>\n <RadixMenu.Trigger ref={setTrigger} asChild disabled={disabled}>{children}</RadixMenu.Trigger>\n <RadixMenu.Portal>\n <MenuPortalScope scopes={scopes}>\n {/*\n * The id is spread conditionally rather than written as `id={id}`. Radix sets its own\n * content id first and ours lands after it, so passing `undefined` deleted the id the\n * trigger's `aria-controls` was already pointing at.\n */}\n <RadixMenu.Content\n {...(id ? { id } : null)}\n className={`menu ${className ?? \"\"}`.trim()}\n side={side}\n align={align}\n sideOffset={6}\n collisionPadding={12}\n >\n {items}\n </RadixMenu.Content>\n </MenuPortalScope>\n </RadixMenu.Portal>\n </RadixMenu.Root>\n );\n}\n\nexport type MenuItemProps = {\n children: ReactNode;\n icon?: LucideIcon;\n /** The keystroke that does the same thing. Announced with the item, not instead of it. */\n shortcut?: string;\n /**\n * The item that cannot be undone.\n *\n * Tone is never the only carrier — the label has to say what it deletes — but a destructive\n * item that looks like the five above it is one a reader picks by accident.\n */\n destructive?: boolean;\n disabled?: boolean;\n onSelect?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nexport function MenuItem({\n children,\n icon,\n shortcut,\n destructive,\n disabled,\n onSelect,\n className,\n ...rest\n}: MenuItemProps) {\n return (\n <RadixMenu.Item\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n data-destructive={destructive ? \"\" : undefined}\n disabled={disabled}\n onSelect={onSelect}\n >\n {icon ? <Icon icon={icon} size=\"sm\" className=\"menu__icon\" /> : null}\n <span className=\"menu__label\">{children}</span>\n {shortcut ? <kbd className=\"menu__shortcut\">{shortcut}</kbd> : null}\n </RadixMenu.Item>\n );\n}\n\nexport type MenuCheckboxItemProps = {\n children: ReactNode;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/** A setting that stays on. Announced as checked, which a plain item is not. */\nexport function MenuCheckboxItem({\n children,\n checked,\n onCheckedChange,\n disabled,\n className,\n ...rest\n}: MenuCheckboxItemProps) {\n return (\n <RadixMenu.CheckboxItem\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={disabled}\n >\n <span className=\"menu__mark\" aria-hidden=\"true\">\n <RadixMenu.ItemIndicator>\n <Icon icon={Check} size=\"xs\" />\n </RadixMenu.ItemIndicator>\n </span>\n <span className=\"menu__label\">{children}</span>\n </RadixMenu.CheckboxItem>\n );\n}\n\nexport type MenuRadioGroupProps = {\n children: ReactNode;\n value: string;\n onValueChange: (value: string) => void;\n};\n\nexport function MenuRadioGroup({ children, value, onValueChange }: MenuRadioGroupProps) {\n return (\n <RadixMenu.RadioGroup value={value} onValueChange={onValueChange}>\n {children}\n </RadixMenu.RadioGroup>\n );\n}\n\nexport type MenuRadioItemProps = {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nexport function MenuRadioItem({ children, value, disabled, className, ...rest }: MenuRadioItemProps) {\n return (\n <RadixMenu.RadioItem\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n value={value}\n disabled={disabled}\n >\n <span className=\"menu__mark\" aria-hidden=\"true\">\n <RadixMenu.ItemIndicator>\n <Icon icon={Circle} size=\"xs\" className=\"menu__dot\" />\n </RadixMenu.ItemIndicator>\n </span>\n <span className=\"menu__label\">{children}</span>\n </RadixMenu.RadioItem>\n );\n}\n\nexport type MenuGroupProps = {\n children: ReactNode;\n /** A heading for the group. Announced when the reader enters it. */\n label?: string;\n};\n\nexport function MenuGroup({ children, label }: MenuGroupProps) {\n return (\n <RadixMenu.Group>\n {label ? <RadixMenu.Label className=\"menu__group-label\">{label}</RadixMenu.Label> : null}\n {children}\n </RadixMenu.Group>\n );\n}\n\nexport function MenuSeparator() {\n return <RadixMenu.Separator className=\"menu__separator\" />;\n}\n\nexport type MenuSubProps = {\n children: ReactNode;\n label: ReactNode;\n icon?: LucideIcon;\n disabled?: boolean;\n};\n\n/** A menu inside a menu. Opens on ArrowRight and on hover; ArrowLeft closes this level, Escape closes the lot. */\nexport function MenuSub({ children, label, icon, disabled }: MenuSubProps) {\n const { scopes, setTrigger } = useMenuScopes();\n return (\n <RadixMenu.Sub>\n <RadixMenu.SubTrigger ref={setTrigger} className=\"menu__item\" disabled={disabled}>\n {icon ? <Icon icon={icon} size=\"sm\" className=\"menu__icon\" /> : null}\n <span className=\"menu__label\">{label}</span>\n <Icon icon={ChevronRight} size=\"xs\" className=\"menu__chevron\" />\n </RadixMenu.SubTrigger>\n <RadixMenu.Portal>\n <MenuPortalScope scopes={scopes}>\n <RadixMenu.SubContent className=\"menu\" sideOffset={4} alignOffset={-4} collisionPadding={12}>\n {children}\n </RadixMenu.SubContent>\n </MenuPortalScope>\n </RadixMenu.Portal>\n </RadixMenu.Sub>\n );\n}\n"],"mappings":";;;;;;AAiBA,IAAM,IACJ;AAEF,SAAS,IAA4B;CACnC,OAAO,CAAC,GAAG,SAAS,iBAA8B,CAAS,CAAC,CAAC,CAAC,QAC3D,MAAS,CAAC,EAAK,QAAQ,wBAAsB,KAAK,EAAK,iBAAiB,IAC3E;AACF;AAWA,SAAgB,EAAa,GAAyC;CACpE,IAAI,CAAC,GAAS,aAAa,CAAC;CAE5B,IAAM,IAAM,EAAW,GACjB,KAAU,MAAsB,EAAQ,SAAS,CAAI,GACrD,IAAQ,EAAI,MAAM,MAAS,CAAC,EAAO,CAAI,KAAK,EAAQ,wBAAwB,CAAI,IAAI,KAAK,2BAA2B,GACpH,IAAS,CAAC,GAAG,CAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,MAAS,CAAC,EAAO,CAAI,KAAK,EAAQ,wBAAwB,CAAI,IAAI,KAAK,2BAA2B,GACpI,IAAS,KAAS,KAAU;CAElC,aAAa;EACN,KAEL,4BAA4B;GAC1B,IAAM,I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AAyB;EACzB,UAAA,kBAAC,EAAU,YAAX;GAAsB,WAAU;GAAO,YAAY;GAAG,aAAa;GAAI,kBAAkB;GACtF;EACmB,CAAA;CACL,CAAA,EACD,CAAA,CACL,EAAA,CAAA;AAEnB"}
|
|
1
|
+
{"version":3,"file":"Pagination-AWL5k5zG.js","names":[],"sources":["../../src/foundation/focus.ts","../../src/components/composed/Disclosure/Disclosure.tsx","../../src/components/composed/Field/Field.tsx","../../src/components/composed/Menu/scope.tsx","../../src/components/composed/Menu/Menu.tsx","../../src/components/composed/Pagination/Pagination.tsx"],"sourcesContent":["/*\n * 스스로를 지우는 컨트롤이 초점을 데려가지 않게 합니다.\n *\n * 닫기 버튼은 자기가 닫는 것 안에 있습니다. 눌러서 그것이 사라지면 눌린 버튼도 함께\n * 사라지고 초점은 `<body>`로 떨어집니다 — 다음 Tab이 문서 처음부터 다시 시작한다는\n * 뜻이고, 키보드로 읽던 사람은 있던 자리를 통째로 잃습니다.\n *\n * `FilterBar`와 `BulkActionBar`는 자기가 살아남으므로 사라진 뒤에 효과를 돌려 해결했지만,\n * `Callout`이나 `QuantityStepper`처럼 자기가 통째로 사라지는 것은 그 방법을 쓸 수 없습니다.\n * 그래서 아직 붙어 있는 동안 갈 곳을 찾아 두고, 한 프레임 뒤에 **정말 사라졌는지** 보고\n * 옮깁니다.\n *\n * 「정말 사라졌는지」가 핵심입니다. 호출부가 콜백을 무시해 아직 화면에 있으면 초점은\n * 눌린 버튼에 그대로 있고, 그때 초점을 옮기는 것은 무례한 짓입니다. `<body>`에 있을\n * 때만 옮깁니다 — `FilterBar`가 같은 이유로 같은 검사를 합니다.\n */\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nfunction focusables(): HTMLElement[] {\n return [...document.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (node) => !node.closest('[aria-hidden=\"true\"]') && node.offsetParent !== null,\n );\n}\n\n/**\n * `leaving`이 사라진 뒤 초점이 갈 자리를 지금 정해 두고, 옮기는 일을 돌려줍니다.\n *\n * 문서 순서에서 그 요소 **뒤**의 첫 초점 가능한 것, 없으면 **앞**의 마지막 것입니다.\n * 뒤를 먼저 보는 이유는 목록에서 한 줄을 지우면 읽던 자리가 다음 줄로 이어지기\n * 때문이고, 마지막 줄을 지웠을 때만 앞으로 돌아갑니다.\n *\n * 돌려받은 것을 `onDismiss`·`onRemove`를 부른 **뒤에** 호출합니다.\n */\nexport function handOffFocus(leaving: HTMLElement | null): () => void {\n if (!leaving) return () => {};\n\n const all = focusables();\n const inside = (node: HTMLElement) => leaving.contains(node);\n const after = all.find((node) => !inside(node) && leaving.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING);\n const before = [...all].reverse().find((node) => !inside(node) && leaving.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_PRECEDING);\n const target = after ?? before ?? null;\n\n return () => {\n if (!target) return;\n /* 한 프레임 뒤. 그 사이에 호출부가 지웠는지 아닌지가 정해집니다. */\n requestAnimationFrame(() => {\n const now = document.activeElement;\n if (now && now !== document.body) return;\n if (!target.isConnected) return;\n target.focus();\n });\n };\n}\n","import type { ReactNode } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport \"./Disclosure.css\";\n\nexport type DisclosureProps = {\n summary: ReactNode;\n children: ReactNode;\n /** Open to begin with. Uncontrolled — the element keeps its own state. */\n defaultOpen?: boolean;\n /** Controlled, for an accordion that allows only one open at a time. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n icon?: LucideIcon;\n /** The end of the summary row — a count, a badge, a status. Never a control. */\n aside?: ReactNode;\n /** No border and no ground, for a run of them inside something that already has both. */\n plain?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A heading that opens.\n *\n * A real `<details>` and `<summary>`, which is the whole point. The element gives the\n * expanded state to assistive technology without an `aria-expanded` to keep in sync, works\n * with the keyboard on its own, and — the part that is hard to rebuild — lets the browser's\n * find-in-page open it to show a match that is inside it. A `<div>` with a click handler\n * hides that text from Ctrl+F entirely.\n */\nexport function Disclosure({\n summary,\n children,\n defaultOpen,\n open,\n onOpenChange,\n icon,\n aside,\n plain,\n className,\n ...rest\n}: DisclosureProps) {\n /*\n * Controlled means the element does not toggle itself.\n *\n * `<details>` is not an input: React cannot hold its `open` attribute, so the browser flips\n * it on click and React puts it back on the next render. Left to `onToggle`, that reset\n * fires a *second* toggle — and in a one-open-at-a-time accordion the section being closed\n * reports \"closed\" and clears the state for the one that was just opened, so everything\n * ends up shut. Intercepting the click is what makes `open` mean what it says.\n */\n const controlled = open !== undefined;\n\n return (\n <details\n {...rest}\n className={`disclosure ${className ?? \"\"}`.trim()}\n data-plain={plain ? \"\" : undefined}\n open={open ?? defaultOpen}\n /*\n * Controlled or not, what the element ends up doing is reported.\n *\n * The click is intercepted below, but that is not the only way this opens: find-in-page\n * opens a closed `<details>` to show the match, and nothing tells React. State stayed\n * closed while the DOM stayed open, and the next click — computing `!open` from the\n * stale state — asked for the state it already had, so the section could not be closed\n * again. Reporting the element's own `open` back keeps the two in step.\n */\n onToggle={(event) => {\n const now = (event.currentTarget as HTMLDetailsElement).open;\n if (controlled && now === open) return;\n onOpenChange?.(now);\n }}\n >\n <summary\n className=\"disclosure__summary\"\n onClick={\n controlled\n ? (event) => {\n event.preventDefault();\n onOpenChange?.(!open);\n }\n : undefined\n }\n >\n <Icon icon={ChevronDown} size=\"sm\" className=\"disclosure__chevron\" />\n {icon ? <Icon icon={icon} size=\"sm\" className=\"disclosure__icon\" /> : null}\n <span className=\"disclosure__label\">{summary}</span>\n {aside ? <span className=\"disclosure__aside\">{aside}</span> : null}\n </summary>\n <div className=\"disclosure__body\">{children}</div>\n </details>\n );\n}\n\nexport type AccordionProps = {\n children: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A run of disclosures.\n *\n * It does not enforce \"one open at a time\", and that is deliberate: closing a section a\n * reader opened, because they opened another one, is the behaviour people complain about\n * most in an accordion. An adopter who wants it holds the state and passes `open` to each —\n * `Disclosure` takes it — and then it is their decision rather than one this component made\n * for every use of it.\n */\nexport function Accordion({ children, className, ...rest }: AccordionProps) {\n return (\n <div {...rest} className={`accordion ${className ?? \"\"}`.trim()}>\n {children}\n </div>\n );\n}\n","import { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./Field.css\";\n\nexport type FieldSize = \"sm\" | \"md\" | \"lg\";\nexport type FieldLayout = \"stacked\" | \"inline\";\n\n/**\n * What a control needs in order to be part of a field.\n *\n * Handed to `children` rather than pushed onto them. The alternative — cloning the child and\n * writing these in — works until the child is wrapped in anything at all, and then it fails\n * silently: the label points at nothing and nobody notices, because the field still looks\n * right.\n */\nexport type FieldControl = {\n id: string;\n /** The visible label, said a second way — see where this is handed over below. */\n \"aria-labelledby\": string;\n /** The hint, the error, or both, in the order a reader should hear them. */\n \"aria-describedby\": string | undefined;\n \"aria-invalid\": true | undefined;\n required: boolean | undefined;\n invalid: boolean;\n};\n\ntype FieldBase = {\n label: ReactNode;\n children: (field: FieldControl) => ReactNode;\n /** How to fill it in. Said before the reader starts, not after they get it wrong. */\n hint?: ReactNode;\n /** What is wrong with it. Announced when it appears, because it appears after a submit. */\n error?: ReactNode;\n size?: FieldSize;\n layout?: FieldLayout;\n /** The label leaves the screen and stays in the accessibility tree. */\n labelHidden?: boolean;\n id?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Required or optional, never both.\n *\n * A field wearing an asterisk *and* the word \"선택\" tells the reader two opposite things at\n * once, and nothing stopped it: the two flags are answers to the same question, so the type\n * makes them exclusive.\n *\n * `optional` says \"선택\" instead of marking the required ones — the right choice when most of\n * a form is required, because marking eleven fields and leaving one unmarked makes the\n * exception the thing that is hard to find.\n */\nexport type FieldProps = FieldBase &\n ({ required?: boolean; optional?: never } | { required?: never; optional?: boolean });\n\n/**\n * A control, and everything a reader needs in order to answer it.\n *\n * The wiring is handed to `children` as a function rather than cloned onto them, because a\n * label that points at nothing looks exactly like a label that works.\n */\nexport function Field({\n label,\n children,\n hint,\n error,\n required,\n optional,\n size = \"md\",\n layout = \"stacked\",\n labelHidden,\n id,\n className,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const fieldId = id ?? generated;\n const labelId = `${fieldId}-label`;\n const hintId = `${fieldId}-hint`;\n const errorId = `${fieldId}-error`;\n const invalid = Boolean(error);\n\n /*\n * The error first. `aria-describedby` is read in the order the ids are listed, not in\n * document order, and a reader who has just failed to submit needs the problem before the\n * instructions they already read once.\n */\n const describedBy = [invalid ? errorId : null, hint ? hintId : null].filter(Boolean).join(\" \");\n\n return (\n <div\n {...rest}\n className={`field ${className ?? \"\"}`.trim()}\n data-size={size}\n data-layout={layout}\n data-invalid={invalid ? \"\" : undefined}\n data-label-hidden={labelHidden ? \"\" : undefined}\n >\n <div className=\"field__head\">\n <label className=\"field__label\" id={labelId} htmlFor={fieldId}>\n {labelHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n {/* An asterisk is a punctuation mark to a screen reader, and some skip it entirely.\n * The word is there for them and the mark is there for everyone else; `required`\n * on the control is what actually carries the state. */}\n {required && !labelHidden ? (\n <span className=\"field__required\" aria-hidden=\"true\">*</span>\n ) : null}\n {required ? <VisuallyHidden> (필수)</VisuallyHidden> : null}\n </label>\n {optional && !labelHidden ? <span className=\"field__optional\">선택</span> : null}\n {/* Same trade as `required` above: the visible word has nowhere to sit when the label\n * is hidden, so the spoken one carries it alone. Without this the fact that a field\n * is optional simply disappeared for anyone not looking at the screen. */}\n {optional && labelHidden ? <VisuallyHidden>(선택)</VisuallyHidden> : null}\n </div>\n\n {hint ? (\n <p className=\"field__hint\" id={hintId}>\n {hint}\n </p>\n ) : null}\n\n <div className=\"field__control\">\n {children({\n id: fieldId,\n /*\n * The `<label for>` above already names the control, and this says the same thing a\n * second way. It is here for the controls that carry a name of their own — `Combobox`\n * and `DatePicker` write an `aria-label`, which outranks a `<label>` and would leave\n * the visible words and the spoken ones free to disagree. They stand down when this\n * arrives.\n */\n \"aria-labelledby\": labelId,\n \"aria-describedby\": describedBy || undefined,\n \"aria-invalid\": invalid || undefined,\n required: required || undefined,\n invalid,\n })}\n </div>\n\n {/*\n * Mounted whether or not there is an error, and empty when there is not.\n *\n * A live region that appears at the same moment as its text announces nothing in\n * several screen readers — the region has to be there first for the change to be a\n * change. This is why an error that arrives after a failed submit is heard at all.\n */}\n <p className=\"field__error\" id={errorId} aria-live=\"polite\" data-part=\"error\">\n {error}\n </p>\n </div>\n );\n}\n","import { cloneElement, forwardRef, useLayoutEffect, useState, type ReactElement, type ReactNode, type Ref } from \"react\";\n\nconst ATTRIBUTES = [\"data-theme\", \"data-brand\", \"data-density\", \"data-radius\", \"data-look\"] as const;\ntype Scope = Record<(typeof ATTRIBUTES)[number], string | undefined>;\n\n/** Preserve built-in variation scopes without copying computed paint or moving the portal. */\nexport function useMenuScopes() {\n const [trigger, setTrigger] = useState<HTMLElement | null>(null);\n const [scopes, setScopes] = useState<Scope[]>([]);\n useLayoutEffect(() => {\n if (!trigger) return;\n const ancestors: HTMLElement[] = [];\n // body and html already contain the portal. Keep empty levels so attribute changes do\n // not change the wrapper tree and remount a focused menu.\n for (let node: HTMLElement | null = trigger; node && node !== trigger.ownerDocument.body; node = node.parentElement) {\n ancestors.unshift(node);\n }\n const read = () => setScopes(ancestors.map((node) => ({\n \"data-theme\": node.getAttribute(\"data-theme\") ?? undefined,\n \"data-brand\": node.getAttribute(\"data-brand\") ?? undefined,\n \"data-density\": node.getAttribute(\"data-density\") ?? undefined,\n \"data-radius\": node.getAttribute(\"data-radius\") ?? undefined,\n \"data-look\": node.getAttribute(\"data-look\") ?? undefined,\n })));\n read();\n const observer = new MutationObserver(read);\n for (const node of ancestors) observer.observe(node, { attributes: true, attributeFilter: [...ATTRIBUTES] });\n return () => observer.disconnect();\n }, [trigger]);\n return { scopes, setTrigger };\n}\n\nexport const MenuPortalScope = forwardRef<HTMLDivElement, {\n scopes: Scope[];\n children: ReactElement<{ ref?: Ref<HTMLDivElement> }>;\n}>(function MenuPortalScope({ scopes, children }, ref) {\n return scopes.reduceRight<ReactNode>((content, scope, index) => (\n <div key={index} className=\"menu__scope\"\n data-theme={scope[\"data-theme\"]}\n data-brand={scope[\"data-brand\"]}\n data-density={scope[\"data-density\"]}\n data-radius={scope[\"data-radius\"]}\n data-look={scope[\"data-look\"]}\n >{content}</div>\n // Radix Presence must observe the animated panel, not a display:contents wrapper.\n ), cloneElement(children, { ref }));\n});\n","import type { ReactElement, ReactNode } from \"react\";\nimport * as RadixMenu from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { MenuPortalScope, useMenuScopes } from \"./scope\";\nimport \"./Menu.css\";\n\nexport type MenuSide = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type MenuAlign = \"start\" | \"center\" | \"end\";\n\nexport type MenuProps = {\n /** The control that opens it. One element, and it must be able to take focus. */\n children: ReactElement;\n /** `MenuItem`, `MenuGroup`, `MenuSeparator` and friends. */\n items: ReactNode;\n side?: MenuSide;\n align?: MenuAlign;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Locks the trigger.\n *\n * `Button` and `IconButton` mark themselves `aria-disabled` and stop their own `onClick`,\n * and Radix opens on `pointerdown` and `keydown` — so a disabled-looking trigger still\n * opened the menu. Passed here, Radix refuses both.\n */\n disabled?: boolean;\n /** The panel's `id`, for a trigger that points at it with `aria-controls`. */\n id?: string;\n className?: string;\n};\n\n/**\n * A list of actions, opened from a control.\n *\n * Radix rather than hand-rolled. A menu is the control with the most keyboard behaviour of\n * anything in this library: type-ahead, arrow keys that stop at either end, Home and End, submenus that\n * open on hover behind a safe triangle and on ArrowRight, ArrowLeft closing one level and\n * Escape closing all of them, focus returned to the trigger, and the whole page made inert\n * while it is up. Rebuilt by hand, one of those is always missing.\n *\n * Not a `<select>`. A menu performs actions; a select chooses a value and submits it with a\n * form. If the thing being pointed at is a value, it is `Select` or `SegmentedControl`.\n *\n * There is no `label` prop, and there was one until it turned out not to work. The menu is\n * named by its trigger — `aria-labelledby` pointing at the button, which takes precedence\n * over any `aria-label` written beside it — and that is the right name anyway: a reader who\n * opened \"보기 설정\" is in the 보기 설정 menu. What it means is that the trigger has to be\n * named well, which for an icon-only one `IconButton` already requires.\n */\nexport function Menu({\n children,\n items,\n side = \"bottom\",\n align = \"start\",\n open,\n onOpenChange,\n disabled,\n id,\n className,\n}: MenuProps) {\n const { scopes, setTrigger } = useMenuScopes();\n return (\n <RadixMenu.Root open={open} onOpenChange={onOpenChange}>\n <RadixMenu.Trigger ref={setTrigger} asChild disabled={disabled}>{children}</RadixMenu.Trigger>\n <RadixMenu.Portal>\n <MenuPortalScope scopes={scopes}>\n {/*\n * The id is spread conditionally rather than written as `id={id}`. Radix sets its own\n * content id first and ours lands after it, so passing `undefined` deleted the id the\n * trigger's `aria-controls` was already pointing at.\n */}\n <RadixMenu.Content\n {...(id ? { id } : null)}\n className={`menu ${className ?? \"\"}`.trim()}\n side={side}\n align={align}\n sideOffset={6}\n collisionPadding={12}\n >\n {items}\n </RadixMenu.Content>\n </MenuPortalScope>\n </RadixMenu.Portal>\n </RadixMenu.Root>\n );\n}\n\nexport type MenuItemProps = {\n children: ReactNode;\n icon?: LucideIcon;\n /** The keystroke that does the same thing. Announced with the item, not instead of it. */\n shortcut?: string;\n /**\n * The item that cannot be undone.\n *\n * Tone is never the only carrier — the label has to say what it deletes — but a destructive\n * item that looks like the five above it is one a reader picks by accident.\n */\n destructive?: boolean;\n disabled?: boolean;\n onSelect?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nexport function MenuItem({\n children,\n icon,\n shortcut,\n destructive,\n disabled,\n onSelect,\n className,\n ...rest\n}: MenuItemProps) {\n return (\n <RadixMenu.Item\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n data-destructive={destructive ? \"\" : undefined}\n disabled={disabled}\n onSelect={onSelect}\n >\n {icon ? <Icon icon={icon} size=\"sm\" className=\"menu__icon\" /> : null}\n <span className=\"menu__label\">{children}</span>\n {shortcut ? <kbd className=\"menu__shortcut\">{shortcut}</kbd> : null}\n </RadixMenu.Item>\n );\n}\n\nexport type MenuCheckboxItemProps = {\n children: ReactNode;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/** A setting that stays on. Announced as checked, which a plain item is not. */\nexport function MenuCheckboxItem({\n children,\n checked,\n onCheckedChange,\n disabled,\n className,\n ...rest\n}: MenuCheckboxItemProps) {\n return (\n <RadixMenu.CheckboxItem\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={disabled}\n >\n <span className=\"menu__mark\" aria-hidden=\"true\">\n <RadixMenu.ItemIndicator>\n <Icon icon={Check} size=\"xs\" />\n </RadixMenu.ItemIndicator>\n </span>\n <span className=\"menu__label\">{children}</span>\n </RadixMenu.CheckboxItem>\n );\n}\n\nexport type MenuRadioGroupProps = {\n children: ReactNode;\n value: string;\n onValueChange: (value: string) => void;\n};\n\nexport function MenuRadioGroup({ children, value, onValueChange }: MenuRadioGroupProps) {\n return (\n <RadixMenu.RadioGroup value={value} onValueChange={onValueChange}>\n {children}\n </RadixMenu.RadioGroup>\n );\n}\n\nexport type MenuRadioItemProps = {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nexport function MenuRadioItem({ children, value, disabled, className, ...rest }: MenuRadioItemProps) {\n return (\n <RadixMenu.RadioItem\n {...rest}\n className={`menu__item ${className ?? \"\"}`.trim()}\n value={value}\n disabled={disabled}\n >\n <span className=\"menu__mark\" aria-hidden=\"true\">\n <RadixMenu.ItemIndicator>\n <Icon icon={Circle} size=\"xs\" className=\"menu__dot\" />\n </RadixMenu.ItemIndicator>\n </span>\n <span className=\"menu__label\">{children}</span>\n </RadixMenu.RadioItem>\n );\n}\n\nexport type MenuGroupProps = {\n children: ReactNode;\n /** A heading for the group. Announced when the reader enters it. */\n label?: string;\n};\n\nexport function MenuGroup({ children, label }: MenuGroupProps) {\n return (\n <RadixMenu.Group>\n {label ? <RadixMenu.Label className=\"menu__group-label\">{label}</RadixMenu.Label> : null}\n {children}\n </RadixMenu.Group>\n );\n}\n\nexport function MenuSeparator() {\n return <RadixMenu.Separator className=\"menu__separator\" />;\n}\n\nexport type MenuSubProps = {\n children: ReactNode;\n label: ReactNode;\n icon?: LucideIcon;\n disabled?: boolean;\n};\n\n/** A menu inside a menu. Opens on ArrowRight and on hover; ArrowLeft closes this level, Escape closes the lot. */\nexport function MenuSub({ children, label, icon, disabled }: MenuSubProps) {\n const { scopes, setTrigger } = useMenuScopes();\n return (\n <RadixMenu.Sub>\n <RadixMenu.SubTrigger ref={setTrigger} className=\"menu__item\" disabled={disabled}>\n {icon ? <Icon icon={icon} size=\"sm\" className=\"menu__icon\" /> : null}\n <span className=\"menu__label\">{label}</span>\n <Icon icon={ChevronRight} size=\"xs\" className=\"menu__chevron\" />\n </RadixMenu.SubTrigger>\n <RadixMenu.Portal>\n <MenuPortalScope scopes={scopes}>\n <RadixMenu.SubContent className=\"menu\" sideOffset={4} alignOffset={-4} collisionPadding={12}>\n {children}\n </RadixMenu.SubContent>\n </MenuPortalScope>\n </RadixMenu.Portal>\n </RadixMenu.Sub>\n );\n}\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport { useLayoutEffect, useRef, useState } from \"react\";\nimport \"./Pagination.css\";\n\nexport type PaginationProps = {\n page: number;\n pageCount: number;\n onPageChange: (page: number) => void;\n /** What is being paged. \"주문 목록\", \"검색 결과\". Names the navigation. */\n label: string;\n /** How many page numbers to show either side of the current one. */\n siblings?: number;\n /** \"1–20 / 137\" above the numbers, for a reader who wants to know how far in they are. */\n summary?: { from: number; to: number; total: number };\n size?: \"sm\" | \"md\";\n /** Reduce visible numbers to fit the actual container, keeping both arrows together. */\n responsive?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nconst range = (from: number, to: number): number[] =>\n Array.from({ length: Math.max(0, to - from + 1) }, (_, index) => from + index);\n\nconst countPages = (value: number) => Number.isFinite(value) ? Math.max(0, Math.floor(value)) : 0;\nconst currentPage = (page: number, count: number) => Math.max(1, Math.min(count || 1, Number.isFinite(page) ? Math.floor(page) : 1));\n\n/**\n * The page list, with gaps where the numbers were left out.\n *\n * Always the first and the last, always the current one and its neighbours, and an ellipsis\n * standing in for the rest. Returned as data rather than rendered here so the gaps can be\n * counted in a test.\n *\n * Always the same number of items, too — `siblings * 2 + 5`, or every page when there are\n * fewer than that. The count used to depend on where the reader was standing: four items on\n * page 1, five on page 2, seven in the middle. The list is centred in its row, so every one\n * of those changes moved the whole row sideways, and the button a reader was aiming at was\n * somewhere else by the time they reached it. Near an end the window widens instead — that\n * is where the pages the reader can use are.\n */\nexport function pageItems(page: number, pageCount: number, siblings = 1): (number | \"gap\")[] {\n pageCount = countPages(pageCount);\n page = currentPage(page, pageCount);\n siblings = Number.isFinite(siblings) ? Math.max(0, Math.min(pageCount, Math.floor(siblings))) : 1;\n const slots = siblings * 2 + 5;\n if (pageCount <= slots) return range(1, pageCount);\n\n const first = 1;\n const last = pageCount;\n /* A gap is only worth drawing when it stands for more than the one page it replaces: with\n * page 2 hidden behind an ellipsis the list is longer than the numbers it left out. */\n const gapBefore = page - siblings > first + 1;\n const gapAfter = page + siblings < last - 1;\n\n /* One `first`, one `last`, and one slot for each ellipsis actually drawn; the numbers in\n * between take whatever is left, which is what keeps the total fixed. */\n const window = slots - 2 - (gapBefore ? 1 : 0) - (gapAfter ? 1 : 0);\n\n if (!gapBefore) return [...range(first, first + window), \"gap\", last];\n if (!gapAfter) return [first, \"gap\", ...range(last - window, last)];\n return [first, \"gap\", ...range(page - siblings, page + siblings), \"gap\", last];\n}\n\n/**\n * Which page of how many.\n *\n * A `<nav>` with a name, because a page of results usually has two of these — one above the\n * table and one below — and \"navigation\" twice tells a reader nothing about either.\n *\n * Every page in the list is a button, the current one included, and `aria-current=\"page\"` is\n * what says which. Pressing the current page does nothing — there is nowhere to go — but it\n * stays a button so that pressing it is possible: as a `<span>` it left the tab order the\n * instant it was clicked, which took the focus of the reader who had just clicked it with\n * them. Their next Tab started at the top of the document, four pages from the list they\n * were walking.\n */\nexport function Pagination({\n page,\n pageCount,\n onPageChange,\n label,\n siblings = 1,\n summary,\n size = \"md\",\n responsive = true,\n className,\n ...rest\n}: PaginationProps) {\n const count = countPages(pageCount);\n const now = currentPage(page, count);\n const root = useRef<HTMLElement>(null);\n const list = useRef<HTMLUListElement>(null);\n const [capacity, setCapacity] = useState<number | null>(null);\n useLayoutEffect(() => {\n if (!responsive || !root.current || !list.current) return;\n let widest = 0;\n let stepWidth = 0;\n const measure = () => {\n const node = list.current;\n if (!node || !root.current) return;\n const style = getComputedStyle(node);\n const gap = parseFloat(style.columnGap) || 0;\n const widths = [...node.querySelectorAll<HTMLElement>(\"button, .pagination__gap\")].map(item => item.getBoundingClientRect().width);\n const nextStepWidth = node.querySelector(\".pagination__step\")?.getBoundingClientRect().width ?? 0;\n if (nextStepWidth !== stepWidth) widest = 0;\n stepWidth = nextStepWidth;\n // Collapsing the list must not shrink its estimate and expand it again.\n widest = Math.max(widest, ...widths, 1);\n const width = widest;\n setCapacity(Math.max(3, Math.floor((root.current.clientWidth + gap) / (width + gap))));\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(root.current);\n for (const button of list.current.querySelectorAll(\"button\")) observer.observe(button);\n return () => observer.disconnect();\n }, [responsive, size, now, count, siblings]);\n let items = pageItems(now, count, siblings);\n if (responsive && capacity !== null && items.length + 2 > capacity) {\n items = pageItems(now, count, 0);\n if (items.length + 2 > capacity) items = count ? [now] : [];\n }\n /*\n * Nought pages is nowhere to go in either direction.\n *\n * A search that came back with no results draws no page numbers at all, and \"이전\" stayed\n * lit beside them because it only ever asked whether `page` was above 1 — a live button\n * pointing at a page that does not exist.\n */\n const nowhereBack = now <= 1 || count <= 0;\n const nowhereOn = now >= count || count <= 0;\n\n return (\n <nav\n {...rest}\n ref={root}\n className={`pagination ${className ?? \"\"}`.trim()}\n aria-label={label}\n data-size={size}\n >\n {summary ? (\n <p className=\"pagination__summary\">\n <span className=\"pagination__figures\">\n {summary.from.toLocaleString(\"ko-KR\")}–{summary.to.toLocaleString(\"ko-KR\")}\n </span>\n {\" / \"}\n <span className=\"pagination__figures\">{summary.total.toLocaleString(\"ko-KR\")}</span>\n </p>\n ) : null}\n\n <ul className=\"pagination__list\" ref={list}>\n <li>\n <button\n type=\"button\"\n className=\"pagination__step\"\n onClick={() => {\n if (nowhereBack) return;\n onPageChange(now - 1);\n }}\n /* `aria-disabled` and a refused click, the rule Button set: a control that leaves\n * the tab order takes any reader standing on it with it — and on the first page\n * that is exactly where a reader who just paged back to it is standing. */\n aria-disabled={nowhereBack || undefined}\n data-part=\"previous\"\n >\n <Icon icon={ChevronLeft} size=\"sm\" />\n <VisuallyHidden>이전 페이지</VisuallyHidden>\n </button>\n </li>\n\n {items.map((item, index) =>\n item === \"gap\" ? (\n <li key={`gap-${index}`} className=\"pagination__gap\" aria-hidden=\"true\">\n …\n </li>\n ) : (\n <li key={item}>\n {item === now ? (\n <button\n type=\"button\"\n className=\"pagination__page\"\n /* No `aria-disabled`: the page a reader is on is not a control switched\n * off, and announcing it as unavailable says the opposite of \"you are\n * here\". `aria-current` is the whole message. */\n aria-current=\"page\"\n onClick={() => undefined}\n data-part=\"current\"\n >\n <VisuallyHidden>{`${count}페이지 중 `}</VisuallyHidden>\n {item}\n </button>\n ) : (\n <button\n type=\"button\"\n className=\"pagination__page\"\n onClick={() => onPageChange(item)}\n data-part={`page-${item}`}\n >\n <VisuallyHidden>{`${item}페이지로`}</VisuallyHidden>\n <span aria-hidden=\"true\">{item}</span>\n </button>\n )}\n </li>\n ),\n )}\n\n <li>\n <button\n type=\"button\"\n className=\"pagination__step\"\n onClick={() => {\n if (nowhereOn) return;\n onPageChange(now + 1);\n }}\n aria-disabled={nowhereOn || undefined}\n data-part=\"next\"\n >\n <Icon icon={ChevronRight} size=\"sm\" />\n <VisuallyHidden>다음 페이지</VisuallyHidden>\n </button>\n </li>\n </ul>\n </nav>\n );\n}\n"],"mappings":";;;;;;AAiBA,IAAM,IACJ;AAEF,SAAS,IAA4B;CACnC,OAAO,CAAC,GAAG,SAAS,iBAA8B,CAAS,CAAC,CAAC,CAAC,QAC3D,MAAS,CAAC,EAAK,QAAQ,wBAAsB,KAAK,EAAK,iBAAiB,IAC3E;AACF;AAWA,SAAgB,EAAa,GAAyC;CACpE,IAAI,CAAC,GAAS,aAAa,CAAC;CAE5B,IAAM,IAAM,EAAW,GACjB,KAAU,MAAsB,EAAQ,SAAS,CAAI,GACrD,IAAQ,EAAI,MAAM,MAAS,CAAC,EAAO,CAAI,KAAK,EAAQ,wBAAwB,CAAI,IAAI,KAAK,2BAA2B,GACpH,IAAS,CAAC,GAAG,CAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,MAAS,CAAC,EAAO,CAAI,KAAK,EAAQ,wBAAwB,CAAI,IAAI,KAAK,2BAA2B,GACpI,IAAS,KAAS,KAAU;CAElC,aAAa;EACN,KAEL,4BAA4B;GAC1B,IAAM,IAAM,SAAS;GACjB,KAAO,MAAQ,SAAS,QACvB,EAAO,eACZ,EAAO,MAAM;EACf,CAAC;CACH;AACF;;;ACtBA,SAAgB,EAAW,EACzB,YACA,aACA,gBACA,SACA,iBACA,SACA,UACA,UACA,cACA,GAAG,KACe;CAUlB,IAAM,IAAa,MAAS,KAAA;CAE5B,OACE,kBAAC,WAAD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