@ahmetilhn/hanui 1.0.1
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/LICENSE +21 -0
- package/README.md +276 -0
- package/build/index.cjs +18 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.ts +2576 -0
- package/build/index.js +2875 -0
- package/build/index.js.map +1 -0
- package/build/styles.css +1 -0
- package/package.json +103 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,2875 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a, jsxs as _, Fragment as Je } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as Za, createContext as Ja, useMemo as aa, useEffect as R, useState as G, useCallback as Z, memo as h, forwardRef as ge, useId as te, useRef as Y, Children as Va } from "react";
|
|
4
|
+
import { isClient as Ce, isDefined as Pe, normalize as ha, isNumber as pa } from "@ahmetilhn/handy-utils";
|
|
5
|
+
import { createPortal as Qa } from "react-dom";
|
|
6
|
+
const g = {
|
|
7
|
+
n0: "#ffffff",
|
|
8
|
+
n25: "#fafbfc",
|
|
9
|
+
n50: "#f6f7f9",
|
|
10
|
+
n100: "#eef0f4",
|
|
11
|
+
n150: "#e7eaef",
|
|
12
|
+
n200: "#e2e6ec",
|
|
13
|
+
/** Kart/girdi kenarı — `n200` sayfadan ayrılmıyordu. */
|
|
14
|
+
n250: "#d6dce4",
|
|
15
|
+
n300: "#c9d0da",
|
|
16
|
+
n500: "#8a94a3",
|
|
17
|
+
/**
|
|
18
|
+
* İkincil metnin okunur tabanı.
|
|
19
|
+
*
|
|
20
|
+
* ÖLÇÜLDÜ: `text-3` `n500`'dü ve beyaz üzerinde 3,2:1 veriyor; üstü çizili
|
|
21
|
+
* fiyat, yer tutucu ve yardım metni gövde metni sayıldığı için WCAG
|
|
22
|
+
* 1.4.3'ün 4,5:1 eşiğini GEÇMİYORDU. Aynı ton açısında aydınlık
|
|
23
|
+
* düşürüldü: 4,67:1. Bir kademe daha koyulaştırmak `n600` ile ayrımı yok
|
|
24
|
+
* ediyordu.
|
|
25
|
+
*/
|
|
26
|
+
n550: "#6b7583",
|
|
27
|
+
n600: "#5a6472",
|
|
28
|
+
n900: "#11151b"
|
|
29
|
+
}, W = {
|
|
30
|
+
base: "#1f2937",
|
|
31
|
+
two: "#2b3646",
|
|
32
|
+
three: "#3a4658",
|
|
33
|
+
/** Koyu temada üst bant; sayfadan koyu kalmalı. */
|
|
34
|
+
ink: "#12161d",
|
|
35
|
+
inkTwo: "#1c222b"
|
|
36
|
+
}, ae = {
|
|
37
|
+
base: "#f59e0b",
|
|
38
|
+
hover: "#d98706",
|
|
39
|
+
active: "#b87205",
|
|
40
|
+
/** Pasif dönüşüm düğmesi; saydamlık değil KENDİ dolgusu. */
|
|
41
|
+
soft: "#f8cd80",
|
|
42
|
+
dark: "#fbbf24",
|
|
43
|
+
darkHover: "#f0af12",
|
|
44
|
+
/** Amber üzerinde metin — beyaz 2,3:1'de kalıyor, okunmuyor. */
|
|
45
|
+
on: "#291500"
|
|
46
|
+
}, B = {
|
|
47
|
+
base: "#2f6fed",
|
|
48
|
+
hover: "#1d54c4",
|
|
49
|
+
active: "#17439c",
|
|
50
|
+
/** Gövde metni içi bağlantı — `base` 16px'te 4,55:1. */
|
|
51
|
+
text: "#1d54c4",
|
|
52
|
+
tint: "#eaf1fe",
|
|
53
|
+
line: "#bcd2fb",
|
|
54
|
+
dark: "#5b93ff",
|
|
55
|
+
darkHover: "#7aa8ff",
|
|
56
|
+
darkTint: "#16243c",
|
|
57
|
+
darkLine: "#2a3f63"
|
|
58
|
+
}, w = {
|
|
59
|
+
/* Yeşil ailesi `ANCHOR.green`den türetildi (L +44 / S −24, L +33 / S −14). */
|
|
60
|
+
okBg: "#e8f4eb",
|
|
61
|
+
/** 5,58:1 tint üzerinde — metin katmanı. */
|
|
62
|
+
okFg: "#1d6e31",
|
|
63
|
+
okLine: "#a8dcb7",
|
|
64
|
+
okBgDark: "#122817",
|
|
65
|
+
/** Koyu zeminde ankorun kendisi okunuyor (7,05:1). */
|
|
66
|
+
okFgDark: "#34c759",
|
|
67
|
+
okLineDark: "#22542f",
|
|
68
|
+
warnBg: "#fdf0dd",
|
|
69
|
+
warnFg: "#7a3e02",
|
|
70
|
+
warnLine: "#ebc687",
|
|
71
|
+
warnBgDark: "#2c2008",
|
|
72
|
+
warnFgDark: "#f5c86b",
|
|
73
|
+
warnLineDark: "#55401a",
|
|
74
|
+
offBg: "#f1f2f5",
|
|
75
|
+
offFg: "#3a424f",
|
|
76
|
+
offLine: "#ccd2db",
|
|
77
|
+
offBgDark: "#212630",
|
|
78
|
+
offFgDark: "#a3adbb",
|
|
79
|
+
offLineDark: "#333b47",
|
|
80
|
+
/*
|
|
81
|
+
* Kırmızı ailesi `ANCHOR.red`den türetildi. Önceki `badFg` (#7f1d1d) bir
|
|
82
|
+
* bordoydu: favori kalbi ve olumsuz rozet ekranda kirli/kahverengi
|
|
83
|
+
* okunuyordu. Aynı ton açısında kalıp aydınlığı açmak rengi hem canlı hem
|
|
84
|
+
* okunur yapıyor.
|
|
85
|
+
*/
|
|
86
|
+
badBg: "#f8ebeb",
|
|
87
|
+
/** 5,45:1 tint üzerinde. */
|
|
88
|
+
badFg: "#bb1e1e",
|
|
89
|
+
badLine: "#e6a6a6",
|
|
90
|
+
badBgDark: "#310f0f",
|
|
91
|
+
/** 6,03:1 koyu tint üzerinde. */
|
|
92
|
+
badFgDark: "#e97575",
|
|
93
|
+
badLineDark: "#621b1b",
|
|
94
|
+
/** Birincil / orijinal sınıflandırma tonu. */
|
|
95
|
+
oemBg: "#eaf1fe",
|
|
96
|
+
oemFg: "#16305c",
|
|
97
|
+
oemLine: "#a9c6f9",
|
|
98
|
+
oemBgDark: "#152139",
|
|
99
|
+
oemFgDark: "#9dc0ff",
|
|
100
|
+
oemLineDark: "#27395c",
|
|
101
|
+
/** İkincil / muadil sınıflandırma tonu. */
|
|
102
|
+
altBg: "#eeebfa",
|
|
103
|
+
altFg: "#2e2661",
|
|
104
|
+
altLine: "#c0b6ea",
|
|
105
|
+
altBgDark: "#1d1a33",
|
|
106
|
+
altFgDark: "#bfb3f5",
|
|
107
|
+
altLineDark: "#332d56"
|
|
108
|
+
}, $e = {
|
|
109
|
+
base: "#dc2626",
|
|
110
|
+
hover: "#bb1e1e",
|
|
111
|
+
dark: "#e45b5b",
|
|
112
|
+
darkHover: "#ef7a72",
|
|
113
|
+
onDark: "#1a0b0a"
|
|
114
|
+
}, me = {
|
|
115
|
+
red: "#dc2626",
|
|
116
|
+
redDark: "#e35252",
|
|
117
|
+
green: "#34c759",
|
|
118
|
+
greenDark: "#4cd76c",
|
|
119
|
+
greenHover: "#2aae4b",
|
|
120
|
+
greenHoverDark: "#63e084",
|
|
121
|
+
/** Yeşil dolgu üzerindeki metin. BEYAZ DEĞİL: #34c759 üzerinde 2,22:1. */
|
|
122
|
+
onGreen: "#06280f"
|
|
123
|
+
}, na = {
|
|
124
|
+
bg: "#e8f4eb",
|
|
125
|
+
fg: "#1d6e31",
|
|
126
|
+
bgDark: "#122817",
|
|
127
|
+
fgDark: "#34c759"
|
|
128
|
+
}, ka = {
|
|
129
|
+
/** 5,23:1 beyaz üzerinde. */
|
|
130
|
+
light: "#9a5f04",
|
|
131
|
+
/** 9,82:1 koyu zemin üzerinde. */
|
|
132
|
+
dark: "#f0b429"
|
|
133
|
+
}, x = (e, n) => {
|
|
134
|
+
const t = e.replace("#", ""), o = t.length === 3 ? t.split("").map((l) => l + l).join("") : t, r = parseInt(o.slice(0, 2), 16), i = parseInt(o.slice(2, 4), 16), s = parseInt(o.slice(4, 6), 16);
|
|
135
|
+
return `rgba(${r}, ${i}, ${s}, ${n})`;
|
|
136
|
+
}, J = "#000000", Wa = {
|
|
137
|
+
// --- Yüzey ---
|
|
138
|
+
page: g.n50,
|
|
139
|
+
surface: g.n0,
|
|
140
|
+
"surface-2": g.n100,
|
|
141
|
+
"surface-3": g.n150,
|
|
142
|
+
"surface-inset": g.n25,
|
|
143
|
+
// --- Kenarlık ---
|
|
144
|
+
border: g.n250,
|
|
145
|
+
"border-strong": g.n300,
|
|
146
|
+
// --- Metin ---
|
|
147
|
+
text: g.n900,
|
|
148
|
+
"text-2": g.n600,
|
|
149
|
+
"text-3": g.n550,
|
|
150
|
+
// --- Grafit: bant, alt bilgi, tablo başlığı, teknik blok ---
|
|
151
|
+
graphite: W.base,
|
|
152
|
+
"graphite-2": W.two,
|
|
153
|
+
"graphite-3": W.three,
|
|
154
|
+
/*
|
|
155
|
+
* BİRİNCİL EYLEM (dolgulu, nötr).
|
|
156
|
+
*
|
|
157
|
+
* `action` grafittir, amber DEĞİL. Amber tek bir dönüşüm noktasına
|
|
158
|
+
* ayrılmıştır; her dolu düğmeyi amber yapmak o tekilliği yok eder ve
|
|
159
|
+
* kullanıcı hangi turuncunun dönüşüm olduğunu bilemez.
|
|
160
|
+
*/
|
|
161
|
+
action: W.base,
|
|
162
|
+
"action-hover": W.two,
|
|
163
|
+
"action-active": W.three,
|
|
164
|
+
"on-action": g.n0,
|
|
165
|
+
/** Pasif dolgu; saydamlık DEĞİL kendi rengi (bkz. Button `:disabled`). */
|
|
166
|
+
"action-soft": g.n300,
|
|
167
|
+
// --- Dönüşüm eylemi: ekrandaki tek doygun turuncu ---
|
|
168
|
+
amber: ae.base,
|
|
169
|
+
"amber-hover": ae.hover,
|
|
170
|
+
"amber-active": ae.active,
|
|
171
|
+
"amber-soft": ae.soft,
|
|
172
|
+
"on-amber": ae.on,
|
|
173
|
+
// --- Mavi: gezinme ve keşif ---
|
|
174
|
+
blue: B.base,
|
|
175
|
+
"blue-hover": B.hover,
|
|
176
|
+
"blue-active": B.active,
|
|
177
|
+
"blue-text": B.text,
|
|
178
|
+
"blue-tint": B.tint,
|
|
179
|
+
"blue-line": B.line,
|
|
180
|
+
// --- Durum: tint zemin + koyu metin + eşleşen hairline ---
|
|
181
|
+
"ok-bg": w.okBg,
|
|
182
|
+
"ok-fg": w.okFg,
|
|
183
|
+
"ok-line": w.okLine,
|
|
184
|
+
"warn-bg": w.warnBg,
|
|
185
|
+
"warn-fg": w.warnFg,
|
|
186
|
+
"warn-line": w.warnLine,
|
|
187
|
+
"off-bg": w.offBg,
|
|
188
|
+
"off-fg": w.offFg,
|
|
189
|
+
"off-line": w.offLine,
|
|
190
|
+
"bad-bg": w.badBg,
|
|
191
|
+
"bad-fg": w.badFg,
|
|
192
|
+
"bad-line": w.badLine,
|
|
193
|
+
"oem-bg": w.oemBg,
|
|
194
|
+
"oem-fg": w.oemFg,
|
|
195
|
+
"oem-line": w.oemLine,
|
|
196
|
+
"alt-bg": w.altBg,
|
|
197
|
+
"alt-fg": w.altFg,
|
|
198
|
+
"alt-line": w.altLine,
|
|
199
|
+
"sale-bg": na.bg,
|
|
200
|
+
"sale-fg": na.fg,
|
|
201
|
+
// --- İkon vurguları: METİN DEĞİL (WCAG grafik eşiği 3:1) ---
|
|
202
|
+
"red-accent": me.red,
|
|
203
|
+
"green-accent": me.green,
|
|
204
|
+
"green-accent-hover": me.greenHover,
|
|
205
|
+
"on-green": me.onGreen,
|
|
206
|
+
star: ka.light,
|
|
207
|
+
// --- Yıkıcı eylem: durum tinti DEĞİL, gerçek bir dolgu ---
|
|
208
|
+
"danger-solid": $e.base,
|
|
209
|
+
"danger-solid-hover": $e.hover,
|
|
210
|
+
"on-danger": g.n0,
|
|
211
|
+
/*
|
|
212
|
+
* ÜST BANT / ALT BİLGİ / KAHRAMAN BÖLÜMÜ.
|
|
213
|
+
*
|
|
214
|
+
* BU TOKEN'LAR TEMAYI İZLER: açık temada her yer açık, koyu temada her yer
|
|
215
|
+
* koyu. Ayrı bir ad kümesi olarak kalıyorlar çünkü bantların KENDİ yüzey
|
|
216
|
+
* merdiveni var: üst bant sayfadan bir kademe yükselir (beyaz zemin, gri
|
|
217
|
+
* sayfa üzerinde), alt bilgi bir kademe çöker. Bunu `surface` ile yazmak
|
|
218
|
+
* iki bandı sayfayla aynı tonda bırakıyordu.
|
|
219
|
+
*/
|
|
220
|
+
"nav-bg": g.n0,
|
|
221
|
+
"nav-bg-2": g.n100,
|
|
222
|
+
"nav-fg": g.n900,
|
|
223
|
+
"nav-fg-2": g.n600,
|
|
224
|
+
"nav-fg-3": g.n500,
|
|
225
|
+
"nav-line": g.n200,
|
|
226
|
+
"nav-line-strong": g.n300,
|
|
227
|
+
"nav-hover": g.n100,
|
|
228
|
+
"footer-bg": g.n100,
|
|
229
|
+
// --- Gölge: nötr-serin (sıcak gölge serin gri zeminde kirli durur) ---
|
|
230
|
+
"shadow-xs": `0 1px 2px ${x(g.n900, 0.05)}`,
|
|
231
|
+
"shadow-sm": `0 1px 2px ${x(g.n900, 0.05)}, 0 1px 3px ${x(g.n900, 0.04)}`,
|
|
232
|
+
"shadow-md": `0 2px 4px ${x(g.n900, 0.04)}, 0 6px 16px ${x(g.n900, 0.07)}`,
|
|
233
|
+
"shadow-lg": `0 4px 8px ${x(g.n900, 0.05)}, 0 16px 32px ${x(g.n900, 0.1)}`,
|
|
234
|
+
"shadow-xl": `0 8px 16px ${x(g.n900, 0.06)}, 0 28px 56px ${x(g.n900, 0.13)}`,
|
|
235
|
+
/** Yapışkan alt bar; gölge YUKARI düşer. */
|
|
236
|
+
"shadow-up": `0 -2px 4px ${x(g.n900, 0.03)}, 0 -8px 24px ${x(g.n900, 0.08)}`,
|
|
237
|
+
/** Odak halkası MAVİ: odak bir gezinme olayıdır, bir dönüşüm değil. */
|
|
238
|
+
ring: `0 0 0 3px ${x(B.base, 0.28)}`,
|
|
239
|
+
"ring-color": B.base,
|
|
240
|
+
"ring-danger": `0 0 0 3px ${x($e.base, 0.24)}`,
|
|
241
|
+
"ring-ok": `0 0 0 4px ${x(w.okFg, 0.16)}`,
|
|
242
|
+
// --- Örtü ve cam: görsel üzerine binen yüzeyler ---
|
|
243
|
+
scrim: x(g.n900, 0.55),
|
|
244
|
+
"scrim-soft": x(g.n900, 0.32),
|
|
245
|
+
glass: x(g.n0, 0.92),
|
|
246
|
+
"glass-solid": g.n0,
|
|
247
|
+
"on-scrim": g.n0,
|
|
248
|
+
// --- İskelet ve dönen gösterge ---
|
|
249
|
+
"skeleton-a": g.n100,
|
|
250
|
+
"skeleton-b": g.n25,
|
|
251
|
+
track: x(g.n900, 0.12),
|
|
252
|
+
/** Görsel yer tutucu (medya yoksa). */
|
|
253
|
+
"media-bg": g.n100,
|
|
254
|
+
/*
|
|
255
|
+
* Vurgu bloğundaki ışık lekeleri. Açık temada ZEMİN DE AÇIK olduğu için
|
|
256
|
+
* lekeler çok daha hafif: koyu bant için ayarlanmış %22 opaklık açık
|
|
257
|
+
* zeminde lekeyi kirli bir dasa çeviriyordu.
|
|
258
|
+
*/
|
|
259
|
+
"glow-1": x(B.base, 0.1),
|
|
260
|
+
"glow-2": x(B.base, 0.06),
|
|
261
|
+
"glow-amber": x(ae.base, 0.09)
|
|
262
|
+
}, en = {
|
|
263
|
+
page: "#0e1116",
|
|
264
|
+
surface: "#171b22",
|
|
265
|
+
"surface-2": "#1f242d",
|
|
266
|
+
"surface-3": "#262c36",
|
|
267
|
+
"surface-inset": "#13171d",
|
|
268
|
+
border: "#262c36",
|
|
269
|
+
"border-strong": "#363e4a",
|
|
270
|
+
text: "#e7eaee",
|
|
271
|
+
"text-2": "#9aa4b2",
|
|
272
|
+
"text-3": "#6b7583",
|
|
273
|
+
graphite: W.ink,
|
|
274
|
+
"graphite-2": W.inkTwo,
|
|
275
|
+
"graphite-3": W.two,
|
|
276
|
+
/*
|
|
277
|
+
* Koyu temada grafit dolgu sayfadan ayırt edilemez. Birincil eylem AÇIK bir
|
|
278
|
+
* nötr yüzeye döner — koyu zeminde en yüksek vurgu budur.
|
|
279
|
+
*/
|
|
280
|
+
action: g.n150,
|
|
281
|
+
"action-hover": g.n0,
|
|
282
|
+
"action-active": g.n300,
|
|
283
|
+
"on-action": g.n900,
|
|
284
|
+
"action-soft": "#414a58",
|
|
285
|
+
amber: ae.dark,
|
|
286
|
+
"amber-hover": ae.darkHover,
|
|
287
|
+
"amber-active": ae.base,
|
|
288
|
+
"amber-soft": "#6d5316",
|
|
289
|
+
"on-amber": ae.on,
|
|
290
|
+
blue: B.dark,
|
|
291
|
+
"blue-hover": B.darkHover,
|
|
292
|
+
"blue-active": B.base,
|
|
293
|
+
"blue-text": B.dark,
|
|
294
|
+
"blue-tint": B.darkTint,
|
|
295
|
+
"blue-line": B.darkLine,
|
|
296
|
+
"ok-bg": w.okBgDark,
|
|
297
|
+
"ok-fg": w.okFgDark,
|
|
298
|
+
"ok-line": w.okLineDark,
|
|
299
|
+
"warn-bg": w.warnBgDark,
|
|
300
|
+
"warn-fg": w.warnFgDark,
|
|
301
|
+
"warn-line": w.warnLineDark,
|
|
302
|
+
"off-bg": w.offBgDark,
|
|
303
|
+
"off-fg": w.offFgDark,
|
|
304
|
+
"off-line": w.offLineDark,
|
|
305
|
+
"bad-bg": w.badBgDark,
|
|
306
|
+
"bad-fg": w.badFgDark,
|
|
307
|
+
"bad-line": w.badLineDark,
|
|
308
|
+
"oem-bg": w.oemBgDark,
|
|
309
|
+
"oem-fg": w.oemFgDark,
|
|
310
|
+
"oem-line": w.oemLineDark,
|
|
311
|
+
"alt-bg": w.altBgDark,
|
|
312
|
+
"alt-fg": w.altFgDark,
|
|
313
|
+
"alt-line": w.altLineDark,
|
|
314
|
+
"sale-bg": na.bgDark,
|
|
315
|
+
"sale-fg": na.fgDark,
|
|
316
|
+
"red-accent": me.redDark,
|
|
317
|
+
"green-accent": me.greenDark,
|
|
318
|
+
"green-accent-hover": me.greenHoverDark,
|
|
319
|
+
"on-green": me.onGreen,
|
|
320
|
+
star: ka.dark,
|
|
321
|
+
"danger-solid": $e.dark,
|
|
322
|
+
"danger-solid-hover": $e.darkHover,
|
|
323
|
+
"on-danger": $e.onDark,
|
|
324
|
+
/* Koyu temada bant sayfadan daha KOYU: aynı tonda olsa yüzüyor görünüyor. */
|
|
325
|
+
"nav-bg": W.ink,
|
|
326
|
+
"nav-bg-2": W.inkTwo,
|
|
327
|
+
"nav-fg": "#e7eaee",
|
|
328
|
+
"nav-fg-2": "#9aa4b2",
|
|
329
|
+
"nav-fg-3": "#6b7583",
|
|
330
|
+
"nav-line": "#262c36",
|
|
331
|
+
"nav-line-strong": "#363e4a",
|
|
332
|
+
"nav-hover": x(g.n0, 0.07),
|
|
333
|
+
"footer-bg": W.ink,
|
|
334
|
+
/*
|
|
335
|
+
* Koyu zeminde gölge okunmaz; derinlik daha çok kenarlıkla kurulur.
|
|
336
|
+
* Gölgeler yine de KORUNUR ama daha derin: modal ve açılır liste yüzeyin
|
|
337
|
+
* üzerinde durmalı.
|
|
338
|
+
*/
|
|
339
|
+
"shadow-xs": `0 1px 2px ${x(J, 0.4)}`,
|
|
340
|
+
"shadow-sm": `0 1px 2px ${x(J, 0.4)}, 0 1px 3px ${x(J, 0.3)}`,
|
|
341
|
+
"shadow-md": `0 2px 4px ${x(J, 0.35)}, 0 6px 16px ${x(J, 0.45)}`,
|
|
342
|
+
"shadow-lg": `0 4px 8px ${x(J, 0.4)}, 0 16px 32px ${x(J, 0.55)}`,
|
|
343
|
+
"shadow-xl": `0 8px 16px ${x(J, 0.45)}, 0 28px 56px ${x(J, 0.6)}`,
|
|
344
|
+
"shadow-up": `0 -2px 4px ${x(J, 0.3)}, 0 -8px 24px ${x(J, 0.45)}`,
|
|
345
|
+
ring: `0 0 0 3px ${x(B.dark, 0.36)}`,
|
|
346
|
+
"ring-color": B.dark,
|
|
347
|
+
"ring-danger": `0 0 0 3px ${x($e.dark, 0.32)}`,
|
|
348
|
+
"ring-ok": `0 0 0 4px ${x(w.okFgDark, 0.2)}`,
|
|
349
|
+
scrim: x(J, 0.68),
|
|
350
|
+
"scrim-soft": x(J, 0.45),
|
|
351
|
+
glass: x("#1f242d", 0.92),
|
|
352
|
+
"glass-solid": "#1f242d",
|
|
353
|
+
"on-scrim": g.n0,
|
|
354
|
+
"skeleton-a": "#1f242d",
|
|
355
|
+
"skeleton-b": "#262c36",
|
|
356
|
+
track: x(g.n0, 0.14),
|
|
357
|
+
"media-bg": "#1f242d",
|
|
358
|
+
"glow-1": x(B.base, 0.2),
|
|
359
|
+
"glow-2": x(B.dark, 0.1),
|
|
360
|
+
"glow-amber": x(ae.dark, 0.12)
|
|
361
|
+
}, Ss = {
|
|
362
|
+
heading: "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
|
|
363
|
+
body: "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
|
|
364
|
+
mono: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace"
|
|
365
|
+
}, ba = "--hanui-", ma = "hanui-theme-overrides", De = "data-hanui-theme", ga = "hanui-theme-switching", Fs = (e, n) => {
|
|
366
|
+
const t = e === "dark" ? en : Wa, o = (e === "dark" ? n == null ? void 0 : n.dark : n == null ? void 0 : n.light) ?? {};
|
|
367
|
+
return { ...t, ...o };
|
|
368
|
+
}, an = (e) => {
|
|
369
|
+
const n = [], t = (i, s = " ") => Object.entries(i).map(([l, u]) => `${s}${ba}${l}: ${u};`).join(`
|
|
370
|
+
`), o = e.fonts ?? {}, r = Object.entries(o).filter(([, i]) => !!i);
|
|
371
|
+
if (r.length > 0 && n.push(
|
|
372
|
+
`:root {
|
|
373
|
+
${r.map(([i, s]) => ` ${ba}font-${i}: ${s};`).join(`
|
|
374
|
+
`)}
|
|
375
|
+
}`
|
|
376
|
+
), e.light && Object.keys(e.light).length > 0) {
|
|
377
|
+
const i = t(e.light);
|
|
378
|
+
n.push(`:root {
|
|
379
|
+
${i}
|
|
380
|
+
}`), n.push(`:root[${De}='light'] {
|
|
381
|
+
${i}
|
|
382
|
+
}`);
|
|
383
|
+
}
|
|
384
|
+
if (e.dark && Object.keys(e.dark).length > 0) {
|
|
385
|
+
const i = t(e.dark);
|
|
386
|
+
n.push(`:root[${De}='dark'] {
|
|
387
|
+
${i}
|
|
388
|
+
}`), n.push(
|
|
389
|
+
`@media (prefers-color-scheme: dark) {
|
|
390
|
+
:root:not([${De}]) {
|
|
391
|
+
${t(
|
|
392
|
+
e.dark,
|
|
393
|
+
" "
|
|
394
|
+
)}
|
|
395
|
+
}
|
|
396
|
+
}`
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
return n.join(`
|
|
400
|
+
|
|
401
|
+
`);
|
|
402
|
+
}, Na = (e) => {
|
|
403
|
+
if (!Ce()) return;
|
|
404
|
+
const n = e ? an(e) : "", t = document.getElementById(ma);
|
|
405
|
+
if (n === "") {
|
|
406
|
+
t == null || t.remove();
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const o = t ?? document.createElement("style");
|
|
410
|
+
o.id = ma, o.textContent = n, t || document.head.appendChild(o);
|
|
411
|
+
}, wa = Ja({}), nn = () => Za(wa), Os = ({ children: e, theme: n, linkComponent: t }) => {
|
|
412
|
+
const o = aa(() => n ? JSON.stringify(n) : "", [n]);
|
|
413
|
+
R(() => {
|
|
414
|
+
Na(n);
|
|
415
|
+
}, [o]);
|
|
416
|
+
const r = aa(() => ({ theme: n, linkComponent: t }), [o, t]);
|
|
417
|
+
return /* @__PURE__ */ a(wa.Provider, { value: r, children: e });
|
|
418
|
+
}, Hs = (e = {}) => {
|
|
419
|
+
Na(e.theme), !(!Ce() || !e.colorScheme) && document.documentElement.setAttribute(De, e.colorScheme);
|
|
420
|
+
}, $a = () => {
|
|
421
|
+
var e;
|
|
422
|
+
return Ce() && ((e = window.matchMedia) != null && e.call(window, "(prefers-color-scheme: dark)").matches) ? "dark" : "light";
|
|
423
|
+
}, tn = () => {
|
|
424
|
+
if (!Ce()) return "light";
|
|
425
|
+
const e = document.documentElement.getAttribute(De);
|
|
426
|
+
return e === "dark" || e === "light" ? e : $a();
|
|
427
|
+
}, Ps = () => {
|
|
428
|
+
const [e, n] = G("light"), [t, o] = G(!1);
|
|
429
|
+
R(() => {
|
|
430
|
+
n(tn()), o(!0);
|
|
431
|
+
}, []), R(() => {
|
|
432
|
+
if (!Ce() || !window.matchMedia) return;
|
|
433
|
+
const s = window.matchMedia("(prefers-color-scheme: dark)"), l = () => {
|
|
434
|
+
document.documentElement.hasAttribute(De) || n($a());
|
|
435
|
+
};
|
|
436
|
+
return s.addEventListener("change", l), () => s.removeEventListener("change", l);
|
|
437
|
+
}, []);
|
|
438
|
+
const r = Z((s) => {
|
|
439
|
+
if (!Ce()) return;
|
|
440
|
+
const l = document.documentElement;
|
|
441
|
+
l.classList.add(ga), l.setAttribute(De, s), n(s), window.requestAnimationFrame(() => {
|
|
442
|
+
window.requestAnimationFrame(() => l.classList.remove(ga));
|
|
443
|
+
});
|
|
444
|
+
}, []), i = Z(
|
|
445
|
+
() => r(e === "dark" ? "light" : "dark"),
|
|
446
|
+
[e, r]
|
|
447
|
+
);
|
|
448
|
+
return { scheme: e, setScheme: r, toggle: i, isReady: t };
|
|
449
|
+
}, Da = "--hanui-sheet-height", Ca = "--hanui-sheet-inset-bottom";
|
|
450
|
+
let Ve = 0, ze = 0;
|
|
451
|
+
const Ia = () => {
|
|
452
|
+
const e = window.visualViewport;
|
|
453
|
+
if (!e) return;
|
|
454
|
+
const n = window.innerHeight - e.height - e.offsetTop, t = document.documentElement;
|
|
455
|
+
t.style.setProperty(Ca, `${Math.max(0, Math.round(n))}px`), t.style.setProperty(Da, `${Math.round(e.height)}px`);
|
|
456
|
+
}, Me = () => {
|
|
457
|
+
ze || (ze = window.requestAnimationFrame(() => {
|
|
458
|
+
ze = 0, Ia();
|
|
459
|
+
}));
|
|
460
|
+
}, on = (e = !0) => {
|
|
461
|
+
R(() => {
|
|
462
|
+
if (!e) return;
|
|
463
|
+
const n = window.visualViewport;
|
|
464
|
+
if (n)
|
|
465
|
+
return Ve += 1, Ve === 1 && (n.addEventListener("resize", Me), n.addEventListener("scroll", Me), window.addEventListener("orientationchange", Me)), Ia(), () => {
|
|
466
|
+
Ve -= 1, !(Ve > 0) && (n.removeEventListener("resize", Me), n.removeEventListener("scroll", Me), window.removeEventListener("orientationchange", Me), ze && (window.cancelAnimationFrame(ze), ze = 0), document.documentElement.style.removeProperty(Ca), document.documentElement.style.removeProperty(Da));
|
|
467
|
+
};
|
|
468
|
+
}, [e]);
|
|
469
|
+
};
|
|
470
|
+
var ue = /* @__PURE__ */ ((e) => (e.PRIMARY = "PRIMARY", e.CART = "CART", e.SECONDARY = "SECONDARY", e.OUTLINE = "OUTLINE", e.DARK = "DARK", e.LIGHT = "LIGHT", e.GHOST = "GHOST", e.DANGER = "DANGER", e))(ue || {}), Ie = /* @__PURE__ */ ((e) => (e.SMALL = "SMALL", e.MEDIUM = "MEDIUM", e.LARGE = "LARGE", e))(Ie || {});
|
|
471
|
+
const rn = 640, zs = 768, sn = 1024, Ks = `(min-width: ${sn + 1}px)`, ca = `(min-width: ${rn + 1}px)`, fa = (e) => e.replace(/İ/g, "i").replace(/I/g, "i").replace(/ı/g, "i").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ç/g, "c").replace(/ø/g, "o").replace(/æ/g, "ae").replace(/ß/g, "ss").replace(/đ/g, "d").replace(/ł/g, "l").replace(/\s+/g, " ").trim(), va = (e, n) => fa(e).includes(fa(n)), cn = /* @__PURE__ */ new Set([
|
|
472
|
+
"button",
|
|
473
|
+
"checkbox",
|
|
474
|
+
"color",
|
|
475
|
+
"file",
|
|
476
|
+
"hidden",
|
|
477
|
+
"image",
|
|
478
|
+
"radio",
|
|
479
|
+
"range",
|
|
480
|
+
"reset",
|
|
481
|
+
"submit"
|
|
482
|
+
]), ln = (e) => {
|
|
483
|
+
if (!(e instanceof HTMLElement)) return !1;
|
|
484
|
+
if (e.isContentEditable) return !0;
|
|
485
|
+
const n = e.getAttribute("contenteditable");
|
|
486
|
+
if (n === "" || n === "true" || n === "plaintext-only") return !0;
|
|
487
|
+
const t = e.tagName;
|
|
488
|
+
return t === "TEXTAREA" ? !0 : t !== "INPUT" ? !1 : !cn.has(e.type);
|
|
489
|
+
}, La = (e) => {
|
|
490
|
+
const n = e.ownerDocument.activeElement;
|
|
491
|
+
!e.contains(n) || !ln(n) || (n.blur(), e.tabIndex = -1, e.focus({ preventScroll: !0 }));
|
|
492
|
+
}, d = (...e) => {
|
|
493
|
+
let n = "";
|
|
494
|
+
for (const t of e)
|
|
495
|
+
t && (n = n === "" ? t : `${n} ${t}`);
|
|
496
|
+
return n;
|
|
497
|
+
}, oe = ({ children: e, ...n }) => {
|
|
498
|
+
const { linkComponent: t } = nn();
|
|
499
|
+
return t ? /* @__PURE__ */ a(t, { ...n, children: e }) : /* @__PURE__ */ a("a", { ...n, children: e });
|
|
500
|
+
}, dn = "hanui-spinner-7pXwf", _n = "hanui-spinner__label-sZvSq", ia = {
|
|
501
|
+
spinner: dn,
|
|
502
|
+
"hanui-spin": "hanui-hanui-spin-wTV0a",
|
|
503
|
+
spinner__label: _n,
|
|
504
|
+
"spinner--sm": "hanui-spinner--sm-uI0wH",
|
|
505
|
+
"spinner--md": "hanui-spinner--md--VmFK",
|
|
506
|
+
"spinner--lg": "hanui-spinner--lg-K9k-Z"
|
|
507
|
+
}, un = ({ size: e = "md", label: n, className: t }) => /* @__PURE__ */ a("span", { className: d(ia.spinner, ia[`spinner--${e}`], t), role: "status", children: /* @__PURE__ */ a("span", { className: ia.spinner__label, children: n }) }), Ea = h(un), hn = "hanui-button-SRu4R", pn = "hanui-button__icon-giom6", bn = "hanui-button__spinner-vexVG", mn = "hanui-button__label-qiMHm", ce = {
|
|
508
|
+
button: hn,
|
|
509
|
+
button__icon: pn,
|
|
510
|
+
button__spinner: bn,
|
|
511
|
+
button__label: mn,
|
|
512
|
+
"button--full": "hanui-button--full-CwPHR",
|
|
513
|
+
"button--loading": "hanui-button--loading-O-naJ",
|
|
514
|
+
"button--small": "hanui-button--small-TF9Hz",
|
|
515
|
+
"button--medium": "hanui-button--medium-JDjkH",
|
|
516
|
+
"button--large": "hanui-button--large-btadu",
|
|
517
|
+
"button--primary": "hanui-button--primary-ym7RJ",
|
|
518
|
+
"button--cart": "hanui-button--cart-5DVmR",
|
|
519
|
+
"button--secondary": "hanui-button--secondary-56m1d",
|
|
520
|
+
"button--outline": "hanui-button--outline-ZI8sw",
|
|
521
|
+
"button--dark": "hanui-button--dark-FGZgn",
|
|
522
|
+
"button--light": "hanui-button--light-YzEPs",
|
|
523
|
+
"button--ghost": "hanui-button--ghost-rijnZ",
|
|
524
|
+
"button--danger": "hanui-button--danger-TNGd2"
|
|
525
|
+
}, Ma = ge(
|
|
526
|
+
({
|
|
527
|
+
variant: e = ue.PRIMARY,
|
|
528
|
+
size: n = Ie.MEDIUM,
|
|
529
|
+
isLoading: t,
|
|
530
|
+
isFullWidth: o,
|
|
531
|
+
startIcon: r,
|
|
532
|
+
endIcon: i,
|
|
533
|
+
className: s,
|
|
534
|
+
children: l,
|
|
535
|
+
disabled: u,
|
|
536
|
+
href: p,
|
|
537
|
+
isExternal: m,
|
|
538
|
+
linkProps: b,
|
|
539
|
+
testId: c,
|
|
540
|
+
...v
|
|
541
|
+
}, f) => {
|
|
542
|
+
const C = d(
|
|
543
|
+
ce.button,
|
|
544
|
+
ce[`button--${e.toLowerCase()}`],
|
|
545
|
+
ce[`button--${n.toLowerCase()}`],
|
|
546
|
+
o && ce["button--full"],
|
|
547
|
+
t && ce["button--loading"],
|
|
548
|
+
s
|
|
549
|
+
), D = /* @__PURE__ */ _(Je, { children: [
|
|
550
|
+
t && /* @__PURE__ */ a(Ea, { size: "sm", className: ce.button__spinner, label: "" }),
|
|
551
|
+
!t && r && /* @__PURE__ */ a("span", { className: ce.button__icon, children: r }),
|
|
552
|
+
/* @__PURE__ */ a("span", { className: ce.button__label, children: l }),
|
|
553
|
+
i && /* @__PURE__ */ a("span", { className: ce.button__icon, children: i })
|
|
554
|
+
] });
|
|
555
|
+
return p && m ? /* @__PURE__ */ a(
|
|
556
|
+
"a",
|
|
557
|
+
{
|
|
558
|
+
href: p,
|
|
559
|
+
className: C,
|
|
560
|
+
target: "_blank",
|
|
561
|
+
rel: "noopener noreferrer",
|
|
562
|
+
"aria-label": v["aria-label"],
|
|
563
|
+
"data-testid": c,
|
|
564
|
+
children: D
|
|
565
|
+
}
|
|
566
|
+
) : p ? /* @__PURE__ */ a(oe, { href: p, className: C, "data-testid": c, ...b, children: D }) : /* @__PURE__ */ a(
|
|
567
|
+
"button",
|
|
568
|
+
{
|
|
569
|
+
ref: f,
|
|
570
|
+
className: C,
|
|
571
|
+
disabled: u || t,
|
|
572
|
+
"aria-busy": t,
|
|
573
|
+
"data-testid": c,
|
|
574
|
+
...v,
|
|
575
|
+
children: D
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
Ma.displayName = "Button";
|
|
581
|
+
const Ze = h(Ma), gn = "hanui-iconButton-JdtwM", ra = {
|
|
582
|
+
iconButton: gn,
|
|
583
|
+
"iconButton--sm": "hanui-iconButton--sm-wE6zE",
|
|
584
|
+
"iconButton--md": "hanui-iconButton--md-iTNNS",
|
|
585
|
+
"iconButton--ghost": "hanui-iconButton--ghost-w-8K3",
|
|
586
|
+
"iconButton--outline": "hanui-iconButton--outline-vEhcY",
|
|
587
|
+
"iconButton--solid": "hanui-iconButton--solid-NUszP",
|
|
588
|
+
"iconButton--cart": "hanui-iconButton--cart-nVsH-",
|
|
589
|
+
"iconButton--danger": "hanui-iconButton--danger-xKkEA"
|
|
590
|
+
}, Aa = ge(
|
|
591
|
+
({
|
|
592
|
+
icon: e,
|
|
593
|
+
label: n,
|
|
594
|
+
variant: t = "ghost",
|
|
595
|
+
size: o = "md",
|
|
596
|
+
className: r,
|
|
597
|
+
type: i = "button",
|
|
598
|
+
href: s,
|
|
599
|
+
linkProps: l,
|
|
600
|
+
testId: u,
|
|
601
|
+
...p
|
|
602
|
+
}, m) => {
|
|
603
|
+
const b = d(
|
|
604
|
+
ra.iconButton,
|
|
605
|
+
ra[`iconButton--${t}`],
|
|
606
|
+
ra[`iconButton--${o}`],
|
|
607
|
+
r
|
|
608
|
+
);
|
|
609
|
+
return s ? /* @__PURE__ */ a(
|
|
610
|
+
oe,
|
|
611
|
+
{
|
|
612
|
+
href: s,
|
|
613
|
+
className: b,
|
|
614
|
+
"aria-label": n,
|
|
615
|
+
title: p.title ?? n,
|
|
616
|
+
"data-testid": u,
|
|
617
|
+
...l,
|
|
618
|
+
children: e
|
|
619
|
+
}
|
|
620
|
+
) : /* @__PURE__ */ a(
|
|
621
|
+
"button",
|
|
622
|
+
{
|
|
623
|
+
ref: m,
|
|
624
|
+
type: i,
|
|
625
|
+
className: b,
|
|
626
|
+
"aria-label": n,
|
|
627
|
+
title: n,
|
|
628
|
+
"data-testid": u,
|
|
629
|
+
...p,
|
|
630
|
+
children: e
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
Aa.displayName = "IconButton";
|
|
636
|
+
const ta = h(Aa), T = ({ children: e, ...n }) => /* @__PURE__ */ a(
|
|
637
|
+
"svg",
|
|
638
|
+
{
|
|
639
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
640
|
+
width: "1em",
|
|
641
|
+
height: "1em",
|
|
642
|
+
viewBox: "0 0 16 16",
|
|
643
|
+
fill: "currentColor",
|
|
644
|
+
"aria-hidden": !0,
|
|
645
|
+
focusable: "false",
|
|
646
|
+
...n,
|
|
647
|
+
children: e
|
|
648
|
+
}
|
|
649
|
+
), la = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M1.293 1.293a1 1 0 0 1 1.414 0L8 6.586l5.293-5.293a1 1 0 1 1 1.414 1.414L9.414 8l5.293 5.293a1 1 0 0 1-1.414 1.414L8 9.414l-5.293 5.293a1 1 0 0 1-1.414-1.414L6.586 8 1.293 2.707a1 1 0 0 1 0-1.414" }) }), Ra = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z" }) }), fn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0" }) }), Ta = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a(
|
|
650
|
+
"path",
|
|
651
|
+
{
|
|
652
|
+
fillRule: "evenodd",
|
|
653
|
+
d: "M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"
|
|
654
|
+
}
|
|
655
|
+
) }), vn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a(
|
|
656
|
+
"path",
|
|
657
|
+
{
|
|
658
|
+
fillRule: "evenodd",
|
|
659
|
+
d: "M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"
|
|
660
|
+
}
|
|
661
|
+
) }), Ba = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a(
|
|
662
|
+
"path",
|
|
663
|
+
{
|
|
664
|
+
fillRule: "evenodd",
|
|
665
|
+
d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"
|
|
666
|
+
}
|
|
667
|
+
) }), yn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a(
|
|
668
|
+
"path",
|
|
669
|
+
{
|
|
670
|
+
fillRule: "evenodd",
|
|
671
|
+
d: "M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"
|
|
672
|
+
}
|
|
673
|
+
) }), xn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.44.31.98.85l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.85-.98zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0" }) }), kn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2" }) }), Nn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M2 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11A.5.5 0 0 1 2 8" }) }), wn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a(
|
|
674
|
+
"path",
|
|
675
|
+
{
|
|
676
|
+
fillRule: "evenodd",
|
|
677
|
+
d: "M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"
|
|
678
|
+
}
|
|
679
|
+
) }), $n = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2" }) }), Dn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }) }), Sa = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }) }), Cn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z" }) }), Fa = (e) => /* @__PURE__ */ _(T, { ...e, children: [
|
|
680
|
+
/* @__PURE__ */ a("path", { d: "M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" }),
|
|
681
|
+
/* @__PURE__ */ a("path", { d: "M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z" })
|
|
682
|
+
] }), In = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.03-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927" }) }), Ln = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5M8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5m3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0" }) }), En = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M2.866 14.85c-.078.444.36.791.746.593l4.39-2.256 4.389 2.256c.386.198.824-.149.746-.592l-.83-4.73 3.522-3.356c.33-.314.16-.888-.282-.95l-4.898-.696L8.465.792a.513.513 0 0 0-.927 0L5.354 5.12l-4.898.696c-.441.062-.612.636-.283.95l3.523 3.356-.83 4.73zm4.905-2.767-3.686 1.894.694-3.957a.56.56 0 0 0-.163-.505L1.71 6.745l4.052-.576a.53.53 0 0 0 .393-.288L8 2.223l1.847 3.658a.53.53 0 0 0 .393.288l4.052.575-2.906 2.77a.56.56 0 0 0-.163.506l.694 3.957-3.686-1.894a.5.5 0 0 0-.461 0z" }) }), Oa = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.283.95l-3.523 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" }) }), Mn = (e) => /* @__PURE__ */ a(T, { ...e, children: /* @__PURE__ */ a("path", { d: "M5.354 5.119 7.538.792A.52.52 0 0 1 8 .5c.183 0 .366.097.465.292l2.184 4.327 4.898.696A.54.54 0 0 1 16 6.32a.55.55 0 0 1-.17.445l-3.523 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256a.5.5 0 0 1-.146.05c-.342.06-.668-.254-.6-.642l.83-4.73L.173 6.765a.55.55 0 0 1-.171-.443.5.5 0 0 1 .084-.302.5.5 0 0 1 .37-.245zM8 12.027a.5.5 0 0 1 .232.056l3.686 1.894-.694-3.957a.56.56 0 0 1 .162-.505l2.907-2.77-4.052-.576a.53.53 0 0 1-.393-.288L8.001 2.223 8 2.226z" }) }), An = "hanui-link-WBmXY", Rn = "hanui-link__label--OEu-", Tn = "hanui-link__arrow-JKXm-", Ke = {
|
|
683
|
+
link: An,
|
|
684
|
+
link__label: Rn,
|
|
685
|
+
link__arrow: Tn,
|
|
686
|
+
"link--sm": "hanui-link--sm-a-3Dz",
|
|
687
|
+
"link--md": "hanui-link--md-lZdYP",
|
|
688
|
+
"link--brand": "hanui-link--brand-vr8sW",
|
|
689
|
+
"link--muted": "hanui-link--muted-EeN6l"
|
|
690
|
+
}, Bn = ({
|
|
691
|
+
href: e,
|
|
692
|
+
children: n,
|
|
693
|
+
hasArrow: t,
|
|
694
|
+
tone: o = "brand",
|
|
695
|
+
size: r = "md",
|
|
696
|
+
className: i,
|
|
697
|
+
linkProps: s,
|
|
698
|
+
...l
|
|
699
|
+
}) => /* @__PURE__ */ _(
|
|
700
|
+
oe,
|
|
701
|
+
{
|
|
702
|
+
href: e,
|
|
703
|
+
className: d(Ke.link, Ke[`link--${o}`], Ke[`link--${r}`], i),
|
|
704
|
+
...s,
|
|
705
|
+
...l,
|
|
706
|
+
children: [
|
|
707
|
+
/* @__PURE__ */ a("span", { className: Ke.link__label, children: n }),
|
|
708
|
+
t && /* @__PURE__ */ a(yn, { className: Ke.link__arrow })
|
|
709
|
+
]
|
|
710
|
+
}
|
|
711
|
+
), js = h(Bn), Sn = "hanui-tooltip-RG1g1", Fn = "hanui-tooltip__trigger-nWZtO", On = "hanui-bubble-bcBNk", Qe = {
|
|
712
|
+
tooltip: Sn,
|
|
713
|
+
tooltip__trigger: Fn,
|
|
714
|
+
bubble: On,
|
|
715
|
+
"hanui-fade-in-up": "hanui-hanui-fade-in-up-Fwj3A",
|
|
716
|
+
"bubble--top": "hanui-bubble--top-uWSZy",
|
|
717
|
+
"bubble--bottom": "hanui-bubble--bottom-jKokL"
|
|
718
|
+
}, Hn = ({ content: e, children: n, position: t = "top", className: o }) => {
|
|
719
|
+
const [r, i] = G(!1), s = te();
|
|
720
|
+
return /* @__PURE__ */ _(
|
|
721
|
+
"span",
|
|
722
|
+
{
|
|
723
|
+
className: d(Qe.tooltip, o),
|
|
724
|
+
onMouseEnter: () => i(!0),
|
|
725
|
+
onMouseLeave: () => i(!1),
|
|
726
|
+
onFocus: () => i(!0),
|
|
727
|
+
onBlur: () => i(!1),
|
|
728
|
+
onKeyDown: (l) => {
|
|
729
|
+
l.key === "Escape" && i(!1);
|
|
730
|
+
},
|
|
731
|
+
children: [
|
|
732
|
+
/* @__PURE__ */ a("span", { "aria-describedby": r ? s : void 0, className: Qe.tooltip__trigger, children: n }),
|
|
733
|
+
r && /* @__PURE__ */ a("span", { id: s, role: "tooltip", className: d(Qe.bubble, Qe[`bubble--${t}`]), children: e })
|
|
734
|
+
]
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
}, Gs = h(Hn), Pn = "hanui-chip--NLgU", zn = "hanui-chip__icon-IjjSb", Kn = "hanui-chip__label-cT4hw", jn = "hanui-chip__count-MBGO3", be = {
|
|
738
|
+
chip: Pn,
|
|
739
|
+
chip__icon: zn,
|
|
740
|
+
chip__label: Kn,
|
|
741
|
+
chip__count: jn,
|
|
742
|
+
"chip--sm": "hanui-chip--sm-60H-S",
|
|
743
|
+
"chip--md": "hanui-chip--md--yAlm",
|
|
744
|
+
"chip--iconOnly": "hanui-chip--iconOnly-5LT1h",
|
|
745
|
+
"chip--selected": "hanui-chip--selected-FdpCr"
|
|
746
|
+
}, Ha = ge(
|
|
747
|
+
({
|
|
748
|
+
children: e,
|
|
749
|
+
icon: n,
|
|
750
|
+
endIcon: t,
|
|
751
|
+
count: o,
|
|
752
|
+
isSelected: r,
|
|
753
|
+
size: i = "md",
|
|
754
|
+
label: s,
|
|
755
|
+
href: l,
|
|
756
|
+
linkProps: u,
|
|
757
|
+
className: p,
|
|
758
|
+
type: m = "button",
|
|
759
|
+
role: b,
|
|
760
|
+
testId: c,
|
|
761
|
+
...v
|
|
762
|
+
}, f) => {
|
|
763
|
+
const C = d(
|
|
764
|
+
be.chip,
|
|
765
|
+
be[`chip--${i}`],
|
|
766
|
+
r && be["chip--selected"],
|
|
767
|
+
!e && be["chip--iconOnly"],
|
|
768
|
+
p
|
|
769
|
+
), D = /* @__PURE__ */ _(Je, { children: [
|
|
770
|
+
n && /* @__PURE__ */ a("span", { className: be.chip__icon, "aria-hidden": !0, children: n }),
|
|
771
|
+
e && /* @__PURE__ */ a("span", { className: be.chip__label, children: e }),
|
|
772
|
+
Pe(o) && /* @__PURE__ */ a("span", { className: be.chip__count, children: o }),
|
|
773
|
+
t && /* @__PURE__ */ a("span", { className: be.chip__icon, "aria-hidden": !0, children: t })
|
|
774
|
+
] });
|
|
775
|
+
return l ? /* @__PURE__ */ a(
|
|
776
|
+
oe,
|
|
777
|
+
{
|
|
778
|
+
href: l,
|
|
779
|
+
className: C,
|
|
780
|
+
"aria-label": e ? void 0 : s,
|
|
781
|
+
"aria-current": r ? "page" : void 0,
|
|
782
|
+
title: e ? void 0 : s,
|
|
783
|
+
"data-testid": c,
|
|
784
|
+
...u,
|
|
785
|
+
children: D
|
|
786
|
+
}
|
|
787
|
+
) : /* @__PURE__ */ a(
|
|
788
|
+
"button",
|
|
789
|
+
{
|
|
790
|
+
ref: f,
|
|
791
|
+
type: m,
|
|
792
|
+
role: b,
|
|
793
|
+
className: C,
|
|
794
|
+
"aria-label": e ? void 0 : s,
|
|
795
|
+
title: e ? void 0 : s,
|
|
796
|
+
"data-testid": c,
|
|
797
|
+
...b === "radio" ? { "aria-checked": !!r } : { "aria-pressed": !!r },
|
|
798
|
+
...v,
|
|
799
|
+
children: D
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
Ha.displayName = "Chip";
|
|
805
|
+
const Gn = h(Ha), Un = "hanui-group-0tnVf", ya = {
|
|
806
|
+
group: Un,
|
|
807
|
+
"group--scrollable": "hanui-group--scrollable-PMu6V"
|
|
808
|
+
}, qn = ({
|
|
809
|
+
options: e,
|
|
810
|
+
label: n,
|
|
811
|
+
size: t = "md",
|
|
812
|
+
isScrollable: o,
|
|
813
|
+
className: r,
|
|
814
|
+
...i
|
|
815
|
+
}) => {
|
|
816
|
+
var b;
|
|
817
|
+
const s = Y(null), l = (c) => i.isMultiple ? i.value.includes(c) : i.value === c, u = (c) => {
|
|
818
|
+
if (i.isMultiple) {
|
|
819
|
+
const v = i.value.includes(c) ? i.value.filter((f) => f !== c) : [...i.value, c];
|
|
820
|
+
i.onChange(v);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
i.onChange(i.value === c ? null : c);
|
|
824
|
+
}, p = (c) => {
|
|
825
|
+
var $, N;
|
|
826
|
+
if (i.isMultiple) return;
|
|
827
|
+
const v = c.key === "ArrowRight" || c.key === "ArrowDown" ? 1 : c.key === "ArrowLeft" || c.key === "ArrowUp" ? -1 : 0;
|
|
828
|
+
if (v === 0) return;
|
|
829
|
+
c.preventDefault();
|
|
830
|
+
const f = e.filter((E) => !E.isDisabled);
|
|
831
|
+
if (f.length === 0) return;
|
|
832
|
+
const C = f.findIndex((E) => E.value === i.value), D = f[(C + v + f.length) % f.length];
|
|
833
|
+
i.onChange(D.value), (N = ($ = s.current) == null ? void 0 : $.querySelector(`[data-chip-value="${D.value}"]`)) == null || N.focus();
|
|
834
|
+
}, m = i.isMultiple ? null : i.value ?? ((b = e.find((c) => !c.isDisabled)) == null ? void 0 : b.value) ?? null;
|
|
835
|
+
return /* @__PURE__ */ a(
|
|
836
|
+
"div",
|
|
837
|
+
{
|
|
838
|
+
ref: s,
|
|
839
|
+
className: d(ya.group, o && ya["group--scrollable"], r),
|
|
840
|
+
role: i.isMultiple ? "group" : "radiogroup",
|
|
841
|
+
"aria-label": n,
|
|
842
|
+
onKeyDown: p,
|
|
843
|
+
children: e.map((c) => /* @__PURE__ */ a(
|
|
844
|
+
Gn,
|
|
845
|
+
{
|
|
846
|
+
size: t,
|
|
847
|
+
icon: c.icon,
|
|
848
|
+
count: c.count,
|
|
849
|
+
isSelected: l(c.value),
|
|
850
|
+
disabled: c.isDisabled,
|
|
851
|
+
role: i.isMultiple ? void 0 : "radio",
|
|
852
|
+
tabIndex: i.isMultiple || c.value === m ? 0 : -1,
|
|
853
|
+
"data-chip-value": c.value,
|
|
854
|
+
onClick: () => u(c.value),
|
|
855
|
+
children: c.label
|
|
856
|
+
},
|
|
857
|
+
c.value
|
|
858
|
+
))
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
}, Us = h(qn), Xn = "hanui-sheet-GEvdE", Yn = "hanui-sheet__header-NJgw-", Zn = "hanui-sheet__title-f-b07", Jn = "hanui-sheet__toolbar-eyhmW", Vn = "hanui-sheet__body-eJ2KB", Qn = "hanui-sheet__footer-NpsY5", Ae = {
|
|
862
|
+
sheet: Xn,
|
|
863
|
+
sheet__header: Yn,
|
|
864
|
+
sheet__title: Zn,
|
|
865
|
+
sheet__toolbar: Jn,
|
|
866
|
+
sheet__body: Vn,
|
|
867
|
+
sheet__footer: Qn
|
|
868
|
+
}, Wn = ({
|
|
869
|
+
title: e,
|
|
870
|
+
closeLabel: n,
|
|
871
|
+
onClose: t,
|
|
872
|
+
children: o,
|
|
873
|
+
toolbar: r,
|
|
874
|
+
footer: i,
|
|
875
|
+
closeAbove: s = ca,
|
|
876
|
+
className: l,
|
|
877
|
+
testId: u
|
|
878
|
+
}) => {
|
|
879
|
+
const p = te();
|
|
880
|
+
on(), R(() => {
|
|
881
|
+
const c = document.body.style.overflow;
|
|
882
|
+
return document.body.style.overflow = "hidden", () => {
|
|
883
|
+
document.body.style.overflow = c;
|
|
884
|
+
};
|
|
885
|
+
}, []), R(() => {
|
|
886
|
+
const c = window.matchMedia(s);
|
|
887
|
+
return c.addEventListener("change", t), () => c.removeEventListener("change", t);
|
|
888
|
+
}, [s, t]);
|
|
889
|
+
const m = Z((c) => {
|
|
890
|
+
!c || c.open || (c.showModal(), La(c));
|
|
891
|
+
}, []), b = Z(
|
|
892
|
+
(c) => {
|
|
893
|
+
c.target === c.currentTarget && t();
|
|
894
|
+
},
|
|
895
|
+
[t]
|
|
896
|
+
);
|
|
897
|
+
return Ce() ? Qa(
|
|
898
|
+
/* @__PURE__ */ _(
|
|
899
|
+
"dialog",
|
|
900
|
+
{
|
|
901
|
+
ref: m,
|
|
902
|
+
className: d(Ae.sheet, l),
|
|
903
|
+
"aria-labelledby": p,
|
|
904
|
+
"data-testid": u,
|
|
905
|
+
onCancel: (c) => {
|
|
906
|
+
c.preventDefault(), t();
|
|
907
|
+
},
|
|
908
|
+
onClick: b,
|
|
909
|
+
children: [
|
|
910
|
+
/* @__PURE__ */ _("header", { className: Ae.sheet__header, children: [
|
|
911
|
+
/* @__PURE__ */ a("h2", { id: p, className: Ae.sheet__title, children: e }),
|
|
912
|
+
/* @__PURE__ */ a(
|
|
913
|
+
ta,
|
|
914
|
+
{
|
|
915
|
+
icon: /* @__PURE__ */ a(la, {}),
|
|
916
|
+
label: n,
|
|
917
|
+
variant: "ghost",
|
|
918
|
+
size: "sm",
|
|
919
|
+
onClick: t
|
|
920
|
+
}
|
|
921
|
+
)
|
|
922
|
+
] }),
|
|
923
|
+
r && /* @__PURE__ */ a("div", { className: Ae.sheet__toolbar, children: r }),
|
|
924
|
+
/* @__PURE__ */ a("div", { className: Ae.sheet__body, children: o }),
|
|
925
|
+
i && /* @__PURE__ */ a("div", { className: Ae.sheet__footer, children: i })
|
|
926
|
+
]
|
|
927
|
+
}
|
|
928
|
+
),
|
|
929
|
+
document.body
|
|
930
|
+
) : null;
|
|
931
|
+
}, Pa = h(Wn), et = "hanui-combobox-NtZoV", at = "hanui-combobox__trigger-2riRR", nt = "hanui-combobox__leadingIcon-it2xz", tt = "hanui-combobox__value-acDlr", ot = "hanui-combobox__clear-EXOsc", it = "hanui-combobox__chevron-g-QzQ", rt = "hanui-combobox__panel-srBxl", st = "hanui-combobox__search-THjer", ct = "hanui-combobox__searchIcon-vr4Bg", lt = "hanui-combobox__searchInput-JPp5h", dt = "hanui-combobox__list-p-eCs", _t = "hanui-combobox__option-CLWh-", ut = "hanui-combobox__optionText-Zm0D6", ht = "hanui-combobox__optionLabel-WvT4W", pt = "hanui-combobox__optionDescription-8OEzi", bt = "hanui-combobox__check-MKlLz", mt = "hanui-combobox__empty-mZwBq", M = {
|
|
932
|
+
combobox: et,
|
|
933
|
+
combobox__trigger: at,
|
|
934
|
+
"combobox__trigger--empty": "hanui-combobox__trigger--empty-RxwCq",
|
|
935
|
+
"combobox__trigger--open": "hanui-combobox__trigger--open-rw1ZS",
|
|
936
|
+
"combobox__trigger--invalid": "hanui-combobox__trigger--invalid-iZgiN",
|
|
937
|
+
combobox__leadingIcon: nt,
|
|
938
|
+
combobox__value: tt,
|
|
939
|
+
combobox__clear: ot,
|
|
940
|
+
combobox__chevron: it,
|
|
941
|
+
"combobox__chevron--open": "hanui-combobox__chevron--open-9kj1j",
|
|
942
|
+
combobox__panel: rt,
|
|
943
|
+
combobox__search: st,
|
|
944
|
+
combobox__searchIcon: ct,
|
|
945
|
+
combobox__searchInput: lt,
|
|
946
|
+
combobox__list: dt,
|
|
947
|
+
"combobox__list--sheet": "hanui-combobox__list--sheet-r3MzB",
|
|
948
|
+
combobox__option: _t,
|
|
949
|
+
"combobox__option--active": "hanui-combobox__option--active--75Vq",
|
|
950
|
+
"combobox__option--selected": "hanui-combobox__option--selected-DVFGy",
|
|
951
|
+
"combobox__option--disabled": "hanui-combobox__option--disabled-e6VjI",
|
|
952
|
+
combobox__optionText: ut,
|
|
953
|
+
combobox__optionLabel: ht,
|
|
954
|
+
combobox__optionDescription: pt,
|
|
955
|
+
combobox__check: bt,
|
|
956
|
+
combobox__empty: mt
|
|
957
|
+
}, gt = ({
|
|
958
|
+
options: e,
|
|
959
|
+
value: n,
|
|
960
|
+
onChange: t,
|
|
961
|
+
labels: o,
|
|
962
|
+
isSearchHidden: r,
|
|
963
|
+
onSearch: i,
|
|
964
|
+
isLoading: s,
|
|
965
|
+
isDisabled: l,
|
|
966
|
+
isClearable: u,
|
|
967
|
+
icon: p,
|
|
968
|
+
id: m,
|
|
969
|
+
className: b,
|
|
970
|
+
testId: c,
|
|
971
|
+
"aria-describedby": v,
|
|
972
|
+
"aria-invalid": f
|
|
973
|
+
}) => {
|
|
974
|
+
const C = te(), D = m ?? C, $ = `${D}-listbox`, N = Y(null), E = Y(null), U = Y(null), q = Y(null), [I, he] = G(null), A = I !== null, [z, O] = G(""), [H, K] = G(0), [ie, fe] = G(null), re = aa(() => {
|
|
975
|
+
if (i || z.trim() === "") return e;
|
|
976
|
+
const y = z.trim();
|
|
977
|
+
return e.filter(
|
|
978
|
+
(L) => va(L.label, y) || (L.description ? va(L.description, y) : !1)
|
|
979
|
+
);
|
|
980
|
+
}, [e, z, i]), se = e.find((y) => y.value === n) ?? null;
|
|
981
|
+
R(() => {
|
|
982
|
+
se ? fe(se.label) : n === null && fe(null);
|
|
983
|
+
}, [se, n]);
|
|
984
|
+
const Le = (se == null ? void 0 : se.label) ?? ie, pe = Y(i);
|
|
985
|
+
pe.current = i, R(() => {
|
|
986
|
+
if (!A || !pe.current) return;
|
|
987
|
+
const y = window.setTimeout(() => {
|
|
988
|
+
var L;
|
|
989
|
+
return (L = pe.current) == null ? void 0 : L.call(pe, z.trim());
|
|
990
|
+
}, 300);
|
|
991
|
+
return () => window.clearTimeout(y);
|
|
992
|
+
}, [z, A]);
|
|
993
|
+
const k = Z(() => {
|
|
994
|
+
he(null), O("");
|
|
995
|
+
}, []), P = Z(() => {
|
|
996
|
+
if (l) return;
|
|
997
|
+
he(window.matchMedia(ca).matches ? "popover" : "sheet"), O("");
|
|
998
|
+
const y = e.findIndex((L) => L.value === n);
|
|
999
|
+
K(y >= 0 ? y : 0);
|
|
1000
|
+
}, [l, e, n]);
|
|
1001
|
+
R(() => {
|
|
1002
|
+
if (I !== "popover") return;
|
|
1003
|
+
const y = (L) => {
|
|
1004
|
+
var j;
|
|
1005
|
+
(j = N.current) != null && j.contains(L.target) || k();
|
|
1006
|
+
};
|
|
1007
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
1008
|
+
}, [I, k]), R(() => {
|
|
1009
|
+
var y;
|
|
1010
|
+
I === "popover" && ((y = U.current) == null || y.focus({ preventScroll: !0 }));
|
|
1011
|
+
}, [I]), R(() => {
|
|
1012
|
+
var y, L;
|
|
1013
|
+
A && ((L = (y = q.current) == null ? void 0 : y.querySelector(`[data-index="${H}"]`)) == null || L.scrollIntoView({ block: "nearest" }));
|
|
1014
|
+
}, [H, A, re.length]);
|
|
1015
|
+
const S = (y) => {
|
|
1016
|
+
y.isDisabled || (fe(y.label), t(y.value), k());
|
|
1017
|
+
}, Ee = Y(!1);
|
|
1018
|
+
R(() => {
|
|
1019
|
+
var y;
|
|
1020
|
+
Ee.current && !A && ((y = E.current) == null || y.focus()), Ee.current = A;
|
|
1021
|
+
}, [A]);
|
|
1022
|
+
const Xa = (y) => {
|
|
1023
|
+
const L = re.length - 1;
|
|
1024
|
+
switch (y.key) {
|
|
1025
|
+
case "ArrowDown":
|
|
1026
|
+
y.preventDefault(), K((j) => j >= L ? 0 : j + 1);
|
|
1027
|
+
break;
|
|
1028
|
+
case "ArrowUp":
|
|
1029
|
+
y.preventDefault(), K((j) => j <= 0 ? L : j - 1);
|
|
1030
|
+
break;
|
|
1031
|
+
case "Home":
|
|
1032
|
+
y.preventDefault(), K(0);
|
|
1033
|
+
break;
|
|
1034
|
+
case "End":
|
|
1035
|
+
y.preventDefault(), K(L);
|
|
1036
|
+
break;
|
|
1037
|
+
case "Enter": {
|
|
1038
|
+
y.preventDefault();
|
|
1039
|
+
const j = re[H];
|
|
1040
|
+
j && S(j);
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
case "Escape":
|
|
1044
|
+
y.preventDefault(), k();
|
|
1045
|
+
break;
|
|
1046
|
+
case "Tab":
|
|
1047
|
+
k();
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
1050
|
+
}, da = () => {
|
|
1051
|
+
t(null), fe(null);
|
|
1052
|
+
}, _a = r ? null : /* @__PURE__ */ _("div", { className: M.combobox__search, children: [
|
|
1053
|
+
/* @__PURE__ */ a(xn, { className: M.combobox__searchIcon }),
|
|
1054
|
+
/* @__PURE__ */ a(
|
|
1055
|
+
"input",
|
|
1056
|
+
{
|
|
1057
|
+
ref: U,
|
|
1058
|
+
type: "text",
|
|
1059
|
+
role: "combobox",
|
|
1060
|
+
className: M.combobox__searchInput,
|
|
1061
|
+
value: z,
|
|
1062
|
+
placeholder: o.searchPlaceholder,
|
|
1063
|
+
autoComplete: "off",
|
|
1064
|
+
"aria-autocomplete": "list",
|
|
1065
|
+
"aria-expanded": !0,
|
|
1066
|
+
"aria-controls": $,
|
|
1067
|
+
"aria-activedescendant": re[H] ? `${D}-option-${H}` : void 0,
|
|
1068
|
+
"aria-label": o.searchPlaceholder,
|
|
1069
|
+
onChange: (y) => {
|
|
1070
|
+
O(y.target.value), K(0);
|
|
1071
|
+
},
|
|
1072
|
+
onKeyDown: Xa
|
|
1073
|
+
}
|
|
1074
|
+
),
|
|
1075
|
+
s && /* @__PURE__ */ a(Ea, { size: "sm", label: "" })
|
|
1076
|
+
] }), ua = (y) => /* @__PURE__ */ _(
|
|
1077
|
+
"ul",
|
|
1078
|
+
{
|
|
1079
|
+
ref: q,
|
|
1080
|
+
id: $,
|
|
1081
|
+
role: "listbox",
|
|
1082
|
+
className: d(M.combobox__list, y && M["combobox__list--sheet"]),
|
|
1083
|
+
children: [
|
|
1084
|
+
re.map((L, j) => {
|
|
1085
|
+
const Ya = j === H, oa = L.value === n;
|
|
1086
|
+
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ _(
|
|
1087
|
+
"div",
|
|
1088
|
+
{
|
|
1089
|
+
id: `${D}-option-${j}`,
|
|
1090
|
+
role: "option",
|
|
1091
|
+
"data-index": j,
|
|
1092
|
+
"aria-selected": oa,
|
|
1093
|
+
"aria-disabled": L.isDisabled,
|
|
1094
|
+
className: d(
|
|
1095
|
+
M.combobox__option,
|
|
1096
|
+
Ya && M["combobox__option--active"],
|
|
1097
|
+
oa && M["combobox__option--selected"],
|
|
1098
|
+
L.isDisabled && M["combobox__option--disabled"]
|
|
1099
|
+
),
|
|
1100
|
+
onMouseEnter: () => K(j),
|
|
1101
|
+
onClick: () => S(L),
|
|
1102
|
+
children: [
|
|
1103
|
+
/* @__PURE__ */ _("span", { className: M.combobox__optionText, children: [
|
|
1104
|
+
/* @__PURE__ */ a("span", { className: M.combobox__optionLabel, children: L.label }),
|
|
1105
|
+
L.description && /* @__PURE__ */ a("span", { className: M.combobox__optionDescription, children: L.description })
|
|
1106
|
+
] }),
|
|
1107
|
+
oa && /* @__PURE__ */ a(Ra, { className: M.combobox__check })
|
|
1108
|
+
]
|
|
1109
|
+
}
|
|
1110
|
+
) }, L.value);
|
|
1111
|
+
}),
|
|
1112
|
+
re.length === 0 && /* @__PURE__ */ a("li", { className: M.combobox__empty, children: s ? o.loadingMessage : o.emptyMessage })
|
|
1113
|
+
]
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
return /* @__PURE__ */ _("div", { ref: N, className: d(M.combobox, b), "data-testid": c, children: [
|
|
1117
|
+
/* @__PURE__ */ _(
|
|
1118
|
+
"button",
|
|
1119
|
+
{
|
|
1120
|
+
ref: E,
|
|
1121
|
+
id: D,
|
|
1122
|
+
type: "button",
|
|
1123
|
+
className: d(
|
|
1124
|
+
M.combobox__trigger,
|
|
1125
|
+
!Le && M["combobox__trigger--empty"],
|
|
1126
|
+
A && M["combobox__trigger--open"],
|
|
1127
|
+
f && M["combobox__trigger--invalid"]
|
|
1128
|
+
),
|
|
1129
|
+
disabled: l,
|
|
1130
|
+
"aria-haspopup": "listbox",
|
|
1131
|
+
"aria-expanded": A,
|
|
1132
|
+
"aria-controls": A ? $ : void 0,
|
|
1133
|
+
"aria-label": o.placeholder,
|
|
1134
|
+
"aria-describedby": v,
|
|
1135
|
+
onClick: () => A ? k() : P(),
|
|
1136
|
+
children: [
|
|
1137
|
+
p && /* @__PURE__ */ a("span", { className: M.combobox__leadingIcon, "aria-hidden": !0, children: p }),
|
|
1138
|
+
/* @__PURE__ */ a("span", { className: M.combobox__value, children: Le ?? o.placeholder }),
|
|
1139
|
+
u && Le && !l && /*
|
|
1140
|
+
Temizleme, tetikleyicinin İÇİNDE ayrı bir düğme olamaz (iç içe
|
|
1141
|
+
düğme geçersiz HTML). Görsel olarak içeride duran, DOM'da kardeş
|
|
1142
|
+
olan bir düğme kullanılır.
|
|
1143
|
+
*/
|
|
1144
|
+
/* @__PURE__ */ a(
|
|
1145
|
+
"span",
|
|
1146
|
+
{
|
|
1147
|
+
role: "button",
|
|
1148
|
+
tabIndex: 0,
|
|
1149
|
+
className: M.combobox__clear,
|
|
1150
|
+
"aria-label": o.clearLabel,
|
|
1151
|
+
onClick: (y) => {
|
|
1152
|
+
y.stopPropagation(), da();
|
|
1153
|
+
},
|
|
1154
|
+
onKeyDown: (y) => {
|
|
1155
|
+
y.key !== "Enter" && y.key !== " " || (y.preventDefault(), y.stopPropagation(), da());
|
|
1156
|
+
},
|
|
1157
|
+
children: /* @__PURE__ */ a(la, {})
|
|
1158
|
+
}
|
|
1159
|
+
),
|
|
1160
|
+
/* @__PURE__ */ a(
|
|
1161
|
+
Ta,
|
|
1162
|
+
{
|
|
1163
|
+
className: d(M.combobox__chevron, A && M["combobox__chevron--open"])
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
]
|
|
1167
|
+
}
|
|
1168
|
+
),
|
|
1169
|
+
I === "popover" && /* @__PURE__ */ _("div", { className: M.combobox__panel, children: [
|
|
1170
|
+
_a,
|
|
1171
|
+
ua(!1)
|
|
1172
|
+
] }),
|
|
1173
|
+
I === "sheet" && /* @__PURE__ */ a(
|
|
1174
|
+
Pa,
|
|
1175
|
+
{
|
|
1176
|
+
title: o.placeholder,
|
|
1177
|
+
closeLabel: o.closeLabel,
|
|
1178
|
+
onClose: k,
|
|
1179
|
+
toolbar: _a ?? void 0,
|
|
1180
|
+
children: ua(!0)
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
] });
|
|
1184
|
+
}, qs = h(gt), ft = "hanui-select-tiiPL", vt = "hanui-trigger-rHQJz", yt = "hanui-trigger__icon-apCcx", xt = "hanui-trigger__value-ioH7K", kt = "hanui-trigger__chevron-FtsIZ", Nt = "hanui-panel-rGOOd", wt = "hanui-list-SOKf8", $t = "hanui-option-ZDPef", Dt = "hanui-option__label-SsoYB", Ct = "hanui-option__check-8CPSG", F = {
|
|
1185
|
+
select: ft,
|
|
1186
|
+
trigger: vt,
|
|
1187
|
+
"trigger--empty": "hanui-trigger--empty-cuinb",
|
|
1188
|
+
"trigger--open": "hanui-trigger--open-1nsvu",
|
|
1189
|
+
"trigger--sm": "hanui-trigger--sm-Xnu1C",
|
|
1190
|
+
trigger__icon: yt,
|
|
1191
|
+
trigger__value: xt,
|
|
1192
|
+
trigger__chevron: kt,
|
|
1193
|
+
"trigger__chevron--open": "hanui-trigger__chevron--open-1P2P-",
|
|
1194
|
+
panel: Nt,
|
|
1195
|
+
"hanui-fade-in-up": "hanui-hanui-fade-in-up-Lt0Bt",
|
|
1196
|
+
"panel--start": "hanui-panel--start-Fotwa",
|
|
1197
|
+
"panel--end": "hanui-panel--end-ClVl2",
|
|
1198
|
+
list: wt,
|
|
1199
|
+
"list--sheet": "hanui-list--sheet-BIjCb",
|
|
1200
|
+
option: $t,
|
|
1201
|
+
"option--active": "hanui-option--active-R4lLF",
|
|
1202
|
+
"option--selected": "hanui-option--selected-glQMj",
|
|
1203
|
+
"option--disabled": "hanui-option--disabled-h4rdd",
|
|
1204
|
+
option__label: Dt,
|
|
1205
|
+
option__check: Ct
|
|
1206
|
+
}, It = ({
|
|
1207
|
+
options: e,
|
|
1208
|
+
value: n,
|
|
1209
|
+
onChange: t,
|
|
1210
|
+
label: o,
|
|
1211
|
+
placeholder: r,
|
|
1212
|
+
closeLabel: i,
|
|
1213
|
+
icon: s,
|
|
1214
|
+
size: l = "md",
|
|
1215
|
+
align: u = "start",
|
|
1216
|
+
isDisabled: p,
|
|
1217
|
+
id: m,
|
|
1218
|
+
className: b,
|
|
1219
|
+
testId: c,
|
|
1220
|
+
"aria-describedby": v,
|
|
1221
|
+
"aria-invalid": f
|
|
1222
|
+
}) => {
|
|
1223
|
+
const C = te(), D = m ?? C, $ = `${D}-listbox`, N = (k) => `${D}-option-${k}`, E = Y(null), U = Y(null), q = Y(null), [I, he] = G(null), [A, z] = G(0), O = I !== null, H = e.findIndex((k) => k.value === n), K = H >= 0 ? e[H] : null, ie = Z(() => he(null), []), fe = Z(() => {
|
|
1224
|
+
p || e.length === 0 || (he(window.matchMedia(ca).matches ? "popover" : "sheet"), z(H >= 0 ? H : 0));
|
|
1225
|
+
}, [p, e.length, H]), re = (k) => {
|
|
1226
|
+
k.isDisabled || (t(k.value), ie());
|
|
1227
|
+
}, se = Y(!1);
|
|
1228
|
+
R(() => {
|
|
1229
|
+
var k;
|
|
1230
|
+
se.current && !O && ((k = U.current) == null || k.focus()), se.current = O;
|
|
1231
|
+
}, [O]), R(() => {
|
|
1232
|
+
if (I !== "popover") return;
|
|
1233
|
+
const k = (P) => {
|
|
1234
|
+
var S;
|
|
1235
|
+
(S = E.current) != null && S.contains(P.target) || ie();
|
|
1236
|
+
};
|
|
1237
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
1238
|
+
}, [I, ie]), R(() => {
|
|
1239
|
+
var k;
|
|
1240
|
+
I === "sheet" && ((k = q.current) == null || k.focus({ preventScroll: !0 }));
|
|
1241
|
+
}, [I]), R(() => {
|
|
1242
|
+
var k, P;
|
|
1243
|
+
O && ((P = (k = q.current) == null ? void 0 : k.querySelector(`[data-index="${A}"]`)) == null || P.scrollIntoView({ block: "nearest" }));
|
|
1244
|
+
}, [A, O]);
|
|
1245
|
+
const Le = (k) => {
|
|
1246
|
+
const P = e.length - 1;
|
|
1247
|
+
if (!O) {
|
|
1248
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(k.key) && (k.preventDefault(), fe());
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
switch (k.key) {
|
|
1252
|
+
case "ArrowDown":
|
|
1253
|
+
k.preventDefault(), z((S) => S >= P ? 0 : S + 1);
|
|
1254
|
+
break;
|
|
1255
|
+
case "ArrowUp":
|
|
1256
|
+
k.preventDefault(), z((S) => S <= 0 ? P : S - 1);
|
|
1257
|
+
break;
|
|
1258
|
+
case "Home":
|
|
1259
|
+
k.preventDefault(), z(0);
|
|
1260
|
+
break;
|
|
1261
|
+
case "End":
|
|
1262
|
+
k.preventDefault(), z(P);
|
|
1263
|
+
break;
|
|
1264
|
+
case "Enter":
|
|
1265
|
+
case " ": {
|
|
1266
|
+
k.preventDefault();
|
|
1267
|
+
const S = e[A];
|
|
1268
|
+
S && re(S);
|
|
1269
|
+
break;
|
|
1270
|
+
}
|
|
1271
|
+
case "Escape":
|
|
1272
|
+
k.preventDefault(), ie();
|
|
1273
|
+
break;
|
|
1274
|
+
case "Tab":
|
|
1275
|
+
ie();
|
|
1276
|
+
break;
|
|
1277
|
+
}
|
|
1278
|
+
}, pe = (k) => /* @__PURE__ */ a(
|
|
1279
|
+
"ul",
|
|
1280
|
+
{
|
|
1281
|
+
ref: q,
|
|
1282
|
+
id: $,
|
|
1283
|
+
role: "listbox",
|
|
1284
|
+
"aria-label": o,
|
|
1285
|
+
"aria-activedescendant": k && e[A] ? N(A) : void 0,
|
|
1286
|
+
tabIndex: k ? 0 : -1,
|
|
1287
|
+
className: d(F.list, k && F["list--sheet"]),
|
|
1288
|
+
onKeyDown: k ? Le : void 0,
|
|
1289
|
+
children: e.map((P, S) => {
|
|
1290
|
+
const Ee = P.value === n;
|
|
1291
|
+
return /* @__PURE__ */ _(
|
|
1292
|
+
"li",
|
|
1293
|
+
{
|
|
1294
|
+
id: N(S),
|
|
1295
|
+
role: "option",
|
|
1296
|
+
"data-index": S,
|
|
1297
|
+
"aria-selected": Ee,
|
|
1298
|
+
"aria-disabled": P.isDisabled,
|
|
1299
|
+
className: d(
|
|
1300
|
+
F.option,
|
|
1301
|
+
S === A && F["option--active"],
|
|
1302
|
+
Ee && F["option--selected"],
|
|
1303
|
+
P.isDisabled && F["option--disabled"]
|
|
1304
|
+
),
|
|
1305
|
+
onMouseEnter: () => z(S),
|
|
1306
|
+
onClick: () => re(P),
|
|
1307
|
+
children: [
|
|
1308
|
+
/* @__PURE__ */ a("span", { className: F.option__label, children: P.label }),
|
|
1309
|
+
Ee && /* @__PURE__ */ a(Ra, { className: F.option__check })
|
|
1310
|
+
]
|
|
1311
|
+
},
|
|
1312
|
+
P.value
|
|
1313
|
+
);
|
|
1314
|
+
})
|
|
1315
|
+
}
|
|
1316
|
+
);
|
|
1317
|
+
return /* @__PURE__ */ _("span", { ref: E, className: d(F.select, b), "data-testid": c, children: [
|
|
1318
|
+
/* @__PURE__ */ _(
|
|
1319
|
+
"button",
|
|
1320
|
+
{
|
|
1321
|
+
ref: U,
|
|
1322
|
+
id: D,
|
|
1323
|
+
type: "button",
|
|
1324
|
+
role: "combobox",
|
|
1325
|
+
className: d(
|
|
1326
|
+
F.trigger,
|
|
1327
|
+
F[`trigger--${l}`],
|
|
1328
|
+
!K && F["trigger--empty"],
|
|
1329
|
+
O && F["trigger--open"]
|
|
1330
|
+
),
|
|
1331
|
+
disabled: p,
|
|
1332
|
+
"aria-haspopup": "listbox",
|
|
1333
|
+
"aria-expanded": O,
|
|
1334
|
+
"aria-controls": O ? $ : void 0,
|
|
1335
|
+
"aria-activedescendant": I === "popover" && e[A] ? N(A) : void 0,
|
|
1336
|
+
"aria-label": o,
|
|
1337
|
+
"aria-describedby": v,
|
|
1338
|
+
"aria-invalid": f,
|
|
1339
|
+
onClick: () => O ? ie() : fe(),
|
|
1340
|
+
onKeyDown: Le,
|
|
1341
|
+
children: [
|
|
1342
|
+
s && /* @__PURE__ */ a("span", { className: F.trigger__icon, "aria-hidden": !0, children: s }),
|
|
1343
|
+
/* @__PURE__ */ a("span", { className: F.trigger__value, children: (K == null ? void 0 : K.label) ?? r }),
|
|
1344
|
+
/* @__PURE__ */ a(
|
|
1345
|
+
Ta,
|
|
1346
|
+
{
|
|
1347
|
+
className: d(F.trigger__chevron, O && F["trigger__chevron--open"])
|
|
1348
|
+
}
|
|
1349
|
+
)
|
|
1350
|
+
]
|
|
1351
|
+
}
|
|
1352
|
+
),
|
|
1353
|
+
I === "popover" && /* @__PURE__ */ a("div", { className: d(F.panel, F[`panel--${u}`]), children: pe(!1) }),
|
|
1354
|
+
I === "sheet" && /* @__PURE__ */ a(Pa, { title: o, closeLabel: i, onClose: ie, children: pe(!0) })
|
|
1355
|
+
] });
|
|
1356
|
+
}, Xs = h(It), Lt = "hanui-checkbox-FaFCj", Et = "hanui-checkbox__input-nTHne", Mt = "hanui-checkbox__body-VAEW2", At = "hanui-checkbox__label-sSNZY", Rt = "hanui-checkbox__hint-ish-J", je = {
|
|
1357
|
+
checkbox: Lt,
|
|
1358
|
+
checkbox__input: Et,
|
|
1359
|
+
checkbox__body: Mt,
|
|
1360
|
+
checkbox__label: At,
|
|
1361
|
+
checkbox__hint: Rt
|
|
1362
|
+
}, za = ge(
|
|
1363
|
+
({ label: e, hint: n, className: t, testId: o, ...r }, i) => /* @__PURE__ */ _("label", { className: d(je.checkbox, t), "data-testid": o, children: [
|
|
1364
|
+
/* @__PURE__ */ a("input", { ref: i, type: "checkbox", className: je.checkbox__input, ...r }),
|
|
1365
|
+
/* @__PURE__ */ _("span", { className: je.checkbox__body, children: [
|
|
1366
|
+
/* @__PURE__ */ a("span", { className: je.checkbox__label, children: e }),
|
|
1367
|
+
n && /* @__PURE__ */ a("span", { className: je.checkbox__hint, children: n })
|
|
1368
|
+
] })
|
|
1369
|
+
] })
|
|
1370
|
+
);
|
|
1371
|
+
za.displayName = "Checkbox";
|
|
1372
|
+
const Ys = h(za), Tt = "hanui-radio-KoZak", Bt = "hanui-radio__input-gVMgh", St = "hanui-radio__body-oZWg6", Ft = "hanui-radio__label-d-5ce", Ot = "hanui-radio__hint-baVbs", Ht = "hanui-radio__count-OtkUM", Re = {
|
|
1373
|
+
radio: Tt,
|
|
1374
|
+
radio__input: Bt,
|
|
1375
|
+
radio__body: St,
|
|
1376
|
+
radio__label: Ft,
|
|
1377
|
+
radio__hint: Ot,
|
|
1378
|
+
radio__count: Ht
|
|
1379
|
+
}, Ka = ge(
|
|
1380
|
+
({ label: e, hint: n, count: t, className: o, testId: r, ...i }, s) => /* @__PURE__ */ _("label", { className: d(Re.radio, o), "data-testid": r, children: [
|
|
1381
|
+
/* @__PURE__ */ a("input", { ref: s, type: "radio", className: Re.radio__input, ...i }),
|
|
1382
|
+
/* @__PURE__ */ _("span", { className: Re.radio__body, children: [
|
|
1383
|
+
/* @__PURE__ */ a("span", { className: Re.radio__label, children: e }),
|
|
1384
|
+
n && /* @__PURE__ */ a("span", { className: Re.radio__hint, children: n })
|
|
1385
|
+
] }),
|
|
1386
|
+
Pe(t) && /* @__PURE__ */ a("span", { className: Re.radio__count, children: t })
|
|
1387
|
+
] })
|
|
1388
|
+
);
|
|
1389
|
+
Ka.displayName = "Radio";
|
|
1390
|
+
const Zs = h(Ka), Pt = "hanui-radioCard-sndiC", zt = "hanui-radioCard__input-6vuoD", Kt = "hanui-radioCard__indicator--x9LT", jt = "hanui-radioCard__body-CFqoi", Te = {
|
|
1391
|
+
radioCard: Pt,
|
|
1392
|
+
radioCard__input: zt,
|
|
1393
|
+
"radioCard--selected": "hanui-radioCard--selected-Mi7ee",
|
|
1394
|
+
radioCard__indicator: Kt,
|
|
1395
|
+
"radioCard--disabled": "hanui-radioCard--disabled-YlYee",
|
|
1396
|
+
radioCard__body: jt
|
|
1397
|
+
}, Gt = ({
|
|
1398
|
+
name: e,
|
|
1399
|
+
value: n,
|
|
1400
|
+
isSelected: t,
|
|
1401
|
+
isDisabled: o,
|
|
1402
|
+
onChange: r,
|
|
1403
|
+
children: i,
|
|
1404
|
+
className: s,
|
|
1405
|
+
id: l,
|
|
1406
|
+
testId: u
|
|
1407
|
+
}) => /* @__PURE__ */ _(
|
|
1408
|
+
"label",
|
|
1409
|
+
{
|
|
1410
|
+
className: d(
|
|
1411
|
+
Te.radioCard,
|
|
1412
|
+
t && Te["radioCard--selected"],
|
|
1413
|
+
o && Te["radioCard--disabled"],
|
|
1414
|
+
s
|
|
1415
|
+
),
|
|
1416
|
+
"data-testid": u,
|
|
1417
|
+
children: [
|
|
1418
|
+
/* @__PURE__ */ a(
|
|
1419
|
+
"input",
|
|
1420
|
+
{
|
|
1421
|
+
type: "radio",
|
|
1422
|
+
id: l,
|
|
1423
|
+
name: e,
|
|
1424
|
+
value: n,
|
|
1425
|
+
checked: t,
|
|
1426
|
+
disabled: o,
|
|
1427
|
+
onChange: () => r(n),
|
|
1428
|
+
className: Te.radioCard__input
|
|
1429
|
+
}
|
|
1430
|
+
),
|
|
1431
|
+
/* @__PURE__ */ a("span", { className: Te.radioCard__indicator, "aria-hidden": !0 }),
|
|
1432
|
+
/* @__PURE__ */ a("span", { className: Te.radioCard__body, children: i })
|
|
1433
|
+
]
|
|
1434
|
+
}
|
|
1435
|
+
), Js = h(Gt), Ut = "hanui-range-RpDPh", qt = "hanui-range__readout-itDMd", Xt = "hanui-range__separator-u-ZJX", Yt = "hanui-range__track-bCh5Y", Zt = "hanui-range__fill-VXMCE", Jt = "hanui-range__input-TAN2I", Vt = "hanui-range__bounds-GIhFd", ee = {
|
|
1436
|
+
range: Ut,
|
|
1437
|
+
"range--disabled": "hanui-range--disabled-13hlc",
|
|
1438
|
+
range__readout: qt,
|
|
1439
|
+
range__separator: Xt,
|
|
1440
|
+
range__track: Yt,
|
|
1441
|
+
range__fill: Zt,
|
|
1442
|
+
range__input: Jt,
|
|
1443
|
+
range__bounds: Vt
|
|
1444
|
+
}, Qt = ({
|
|
1445
|
+
min: e,
|
|
1446
|
+
max: n,
|
|
1447
|
+
step: t = 1,
|
|
1448
|
+
value: o,
|
|
1449
|
+
onChange: r,
|
|
1450
|
+
onCommit: i,
|
|
1451
|
+
formatValue: s = String,
|
|
1452
|
+
label: l,
|
|
1453
|
+
minLabel: u,
|
|
1454
|
+
maxLabel: p,
|
|
1455
|
+
isDisabled: m,
|
|
1456
|
+
className: b,
|
|
1457
|
+
testId: c
|
|
1458
|
+
}) => {
|
|
1459
|
+
const [v, f] = o, C = Z(
|
|
1460
|
+
(I) => r([Math.min(I, f), f]),
|
|
1461
|
+
[f, r]
|
|
1462
|
+
), D = Z(
|
|
1463
|
+
(I) => r([v, Math.max(I, v)]),
|
|
1464
|
+
[v, r]
|
|
1465
|
+
), $ = Z(() => i == null ? void 0 : i([v, f]), [v, f, i]), N = n - e, E = N === 0 ? 0 : ha(v - e, N), U = N === 0 ? 0 : ha(f - e, N), q = E > 50;
|
|
1466
|
+
return /* @__PURE__ */ _(
|
|
1467
|
+
"div",
|
|
1468
|
+
{
|
|
1469
|
+
className: d(ee.range, m && ee["range--disabled"], b),
|
|
1470
|
+
role: "group",
|
|
1471
|
+
"aria-label": l,
|
|
1472
|
+
"data-testid": c,
|
|
1473
|
+
children: [
|
|
1474
|
+
/* @__PURE__ */ _("div", { className: ee.range__readout, children: [
|
|
1475
|
+
/* @__PURE__ */ a("span", { className: ee.range__value, children: s(v) }),
|
|
1476
|
+
/* @__PURE__ */ a("span", { className: ee.range__separator, "aria-hidden": !0, children: "—" }),
|
|
1477
|
+
/* @__PURE__ */ a("span", { className: ee.range__value, children: s(f) })
|
|
1478
|
+
] }),
|
|
1479
|
+
/* @__PURE__ */ _("div", { className: ee.range__track, children: [
|
|
1480
|
+
/* @__PURE__ */ a(
|
|
1481
|
+
"span",
|
|
1482
|
+
{
|
|
1483
|
+
className: ee.range__fill,
|
|
1484
|
+
style: { left: `${E}%`, right: `${100 - U}%` },
|
|
1485
|
+
"aria-hidden": !0
|
|
1486
|
+
}
|
|
1487
|
+
),
|
|
1488
|
+
/* @__PURE__ */ a(
|
|
1489
|
+
"input",
|
|
1490
|
+
{
|
|
1491
|
+
type: "range",
|
|
1492
|
+
className: ee.range__input,
|
|
1493
|
+
style: { zIndex: q ? 4 : 3 },
|
|
1494
|
+
min: e,
|
|
1495
|
+
max: n,
|
|
1496
|
+
step: t,
|
|
1497
|
+
value: v,
|
|
1498
|
+
disabled: m,
|
|
1499
|
+
"aria-label": `${l} — ${u}`,
|
|
1500
|
+
"aria-valuetext": s(v),
|
|
1501
|
+
onChange: (I) => C(Number(I.target.value)),
|
|
1502
|
+
onPointerUp: $,
|
|
1503
|
+
onKeyUp: $
|
|
1504
|
+
}
|
|
1505
|
+
),
|
|
1506
|
+
/* @__PURE__ */ a(
|
|
1507
|
+
"input",
|
|
1508
|
+
{
|
|
1509
|
+
type: "range",
|
|
1510
|
+
className: ee.range__input,
|
|
1511
|
+
style: { zIndex: q ? 3 : 4 },
|
|
1512
|
+
min: e,
|
|
1513
|
+
max: n,
|
|
1514
|
+
step: t,
|
|
1515
|
+
value: f,
|
|
1516
|
+
disabled: m,
|
|
1517
|
+
"aria-label": `${l} — ${p}`,
|
|
1518
|
+
"aria-valuetext": s(f),
|
|
1519
|
+
onChange: (I) => D(Number(I.target.value)),
|
|
1520
|
+
onPointerUp: $,
|
|
1521
|
+
onKeyUp: $
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }),
|
|
1525
|
+
/* @__PURE__ */ _("div", { className: ee.range__bounds, "aria-hidden": !0, children: [
|
|
1526
|
+
/* @__PURE__ */ a("span", { children: s(e) }),
|
|
1527
|
+
/* @__PURE__ */ a("span", { children: s(n) })
|
|
1528
|
+
] })
|
|
1529
|
+
]
|
|
1530
|
+
}
|
|
1531
|
+
);
|
|
1532
|
+
}, Vs = h(Qt), Wt = "hanui-rating-neNnF", eo = "hanui-rating__legend-uYvFS", ao = "hanui-rating__stars-vJFLk", no = "hanui-rating__star-BANFJ", to = "hanui-rating__input-s2iiO", oo = "hanui-rating__srOnly-iSCoz", io = "hanui-rating__caption-13KFX", le = {
|
|
1533
|
+
rating: Wt,
|
|
1534
|
+
"rating--disabled": "hanui-rating--disabled-ZKjHa",
|
|
1535
|
+
rating__legend: eo,
|
|
1536
|
+
rating__stars: ao,
|
|
1537
|
+
rating__star: no,
|
|
1538
|
+
"rating__star--filled": "hanui-rating__star--filled-L3AkT",
|
|
1539
|
+
rating__input: to,
|
|
1540
|
+
rating__srOnly: oo,
|
|
1541
|
+
rating__caption: io
|
|
1542
|
+
}, ro = [1, 2, 3, 4, 5], so = ({
|
|
1543
|
+
value: e,
|
|
1544
|
+
onChange: n,
|
|
1545
|
+
label: t,
|
|
1546
|
+
ratingLabels: o,
|
|
1547
|
+
formatStarCount: r,
|
|
1548
|
+
isDisabled: i,
|
|
1549
|
+
className: s,
|
|
1550
|
+
testId: l
|
|
1551
|
+
}) => {
|
|
1552
|
+
const u = te(), [p, m] = G(null), b = p ?? e;
|
|
1553
|
+
return /* @__PURE__ */ _(
|
|
1554
|
+
"fieldset",
|
|
1555
|
+
{
|
|
1556
|
+
className: d(le.rating, i && le["rating--disabled"], s),
|
|
1557
|
+
disabled: i,
|
|
1558
|
+
"data-testid": l,
|
|
1559
|
+
children: [
|
|
1560
|
+
/* @__PURE__ */ a("legend", { className: le.rating__legend, children: t }),
|
|
1561
|
+
/* @__PURE__ */ a("div", { className: le.rating__stars, onMouseLeave: () => m(null), children: ro.map((c) => /* @__PURE__ */ _(
|
|
1562
|
+
"label",
|
|
1563
|
+
{
|
|
1564
|
+
className: d(
|
|
1565
|
+
le.rating__star,
|
|
1566
|
+
b !== null && c <= b && le["rating__star--filled"]
|
|
1567
|
+
),
|
|
1568
|
+
onMouseEnter: () => m(c),
|
|
1569
|
+
children: [
|
|
1570
|
+
/* @__PURE__ */ a(
|
|
1571
|
+
"input",
|
|
1572
|
+
{
|
|
1573
|
+
type: "radio",
|
|
1574
|
+
name: u,
|
|
1575
|
+
value: c,
|
|
1576
|
+
checked: e === c,
|
|
1577
|
+
onChange: () => n(c),
|
|
1578
|
+
className: le.rating__input
|
|
1579
|
+
}
|
|
1580
|
+
),
|
|
1581
|
+
/* @__PURE__ */ a(Oa, {}),
|
|
1582
|
+
/* @__PURE__ */ _("span", { className: le.rating__srOnly, children: [
|
|
1583
|
+
r(c),
|
|
1584
|
+
" — ",
|
|
1585
|
+
o[c]
|
|
1586
|
+
] })
|
|
1587
|
+
]
|
|
1588
|
+
},
|
|
1589
|
+
c
|
|
1590
|
+
)) }),
|
|
1591
|
+
b !== null && /* @__PURE__ */ a("span", { className: le.rating__caption, "aria-hidden": !0, children: o[b] })
|
|
1592
|
+
]
|
|
1593
|
+
}
|
|
1594
|
+
);
|
|
1595
|
+
}, Qs = h(so), co = "hanui-stepper-8s5Ih", lo = "hanui-stepper__button-h6g7d", _o = "hanui-stepper__input-OQh5v", Ge = {
|
|
1596
|
+
stepper: co,
|
|
1597
|
+
stepper__button: lo,
|
|
1598
|
+
stepper__input: _o,
|
|
1599
|
+
"stepper--sm": "hanui-stepper--sm-RvrBP",
|
|
1600
|
+
"stepper--md": "hanui-stepper--md-Cnjei"
|
|
1601
|
+
}, uo = ({
|
|
1602
|
+
value: e,
|
|
1603
|
+
onChange: n,
|
|
1604
|
+
label: t,
|
|
1605
|
+
decreaseLabel: o,
|
|
1606
|
+
increaseLabel: r,
|
|
1607
|
+
min: i = 1,
|
|
1608
|
+
max: s = 99,
|
|
1609
|
+
isDisabled: l,
|
|
1610
|
+
size: u = "md",
|
|
1611
|
+
className: p,
|
|
1612
|
+
testId: m
|
|
1613
|
+
}) => {
|
|
1614
|
+
const [b, c] = G(null), v = (f) => {
|
|
1615
|
+
c(null);
|
|
1616
|
+
const C = Number(f.replace(/\D/g, ""));
|
|
1617
|
+
C && n(Math.min(Math.max(C, i), s));
|
|
1618
|
+
};
|
|
1619
|
+
return /* @__PURE__ */ _(
|
|
1620
|
+
"div",
|
|
1621
|
+
{
|
|
1622
|
+
className: d(Ge.stepper, Ge[`stepper--${u}`], p),
|
|
1623
|
+
role: "group",
|
|
1624
|
+
"aria-label": t,
|
|
1625
|
+
"data-testid": m,
|
|
1626
|
+
children: [
|
|
1627
|
+
/* @__PURE__ */ a(
|
|
1628
|
+
"button",
|
|
1629
|
+
{
|
|
1630
|
+
type: "button",
|
|
1631
|
+
className: Ge.stepper__button,
|
|
1632
|
+
onClick: () => n(Math.max(e - 1, i)),
|
|
1633
|
+
disabled: l || e <= i,
|
|
1634
|
+
"aria-label": o,
|
|
1635
|
+
children: /* @__PURE__ */ a(Nn, {})
|
|
1636
|
+
}
|
|
1637
|
+
),
|
|
1638
|
+
/* @__PURE__ */ a(
|
|
1639
|
+
"input",
|
|
1640
|
+
{
|
|
1641
|
+
className: Ge.stepper__input,
|
|
1642
|
+
value: b ?? String(e),
|
|
1643
|
+
onChange: (f) => c(f.target.value.replace(/\D/g, "").slice(0, 2)),
|
|
1644
|
+
onBlur: (f) => v(f.target.value),
|
|
1645
|
+
onKeyDown: (f) => {
|
|
1646
|
+
f.key === "Enter" && (f.preventDefault(), v(f.target.value));
|
|
1647
|
+
},
|
|
1648
|
+
inputMode: "numeric",
|
|
1649
|
+
disabled: l,
|
|
1650
|
+
"aria-label": `${t} (${i}-${s})`
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
/* @__PURE__ */ a(
|
|
1654
|
+
"button",
|
|
1655
|
+
{
|
|
1656
|
+
type: "button",
|
|
1657
|
+
className: Ge.stepper__button,
|
|
1658
|
+
onClick: () => n(Math.min(e + 1, s)),
|
|
1659
|
+
disabled: l || e >= s,
|
|
1660
|
+
"aria-label": r,
|
|
1661
|
+
children: /* @__PURE__ */ a(kn, {})
|
|
1662
|
+
}
|
|
1663
|
+
)
|
|
1664
|
+
]
|
|
1665
|
+
}
|
|
1666
|
+
);
|
|
1667
|
+
}, Ws = h(uo), ho = "hanui-checkbox--dvpB", po = {
|
|
1668
|
+
checkbox: ho
|
|
1669
|
+
}, ja = ge(
|
|
1670
|
+
({ label: e, className: n, testId: t, ...o }, r) => /* @__PURE__ */ a(
|
|
1671
|
+
"input",
|
|
1672
|
+
{
|
|
1673
|
+
ref: r,
|
|
1674
|
+
type: "checkbox",
|
|
1675
|
+
"aria-label": e,
|
|
1676
|
+
className: d(po.checkbox, n),
|
|
1677
|
+
"data-testid": t,
|
|
1678
|
+
...o
|
|
1679
|
+
}
|
|
1680
|
+
)
|
|
1681
|
+
);
|
|
1682
|
+
ja.displayName = "TableCheckbox";
|
|
1683
|
+
const ec = h(ja), bo = "hanui-wrapper-IAI4E", mo = "hanui-wrapper__prefix-XKDlV", go = "hanui-wrapper__suffix-lT35q", fo = "hanui-input-pIS2u", ve = {
|
|
1684
|
+
wrapper: bo,
|
|
1685
|
+
wrapper__prefix: mo,
|
|
1686
|
+
wrapper__suffix: go,
|
|
1687
|
+
input: fo,
|
|
1688
|
+
"input--hasPrefix": "hanui-input--hasPrefix-nsrWh",
|
|
1689
|
+
"input--hasSuffix": "hanui-input--hasSuffix-OrE5A",
|
|
1690
|
+
"input--technical": "hanui-input--technical---DCD"
|
|
1691
|
+
}, Ga = ge(
|
|
1692
|
+
({ prefix: e, suffix: n, isTechnical: t, className: o, testId: r, ...i }, s) => /* @__PURE__ */ _("span", { className: d(ve.wrapper, o), children: [
|
|
1693
|
+
e && /* @__PURE__ */ a("span", { className: ve.wrapper__prefix, "aria-hidden": !0, children: e }),
|
|
1694
|
+
/* @__PURE__ */ a(
|
|
1695
|
+
"input",
|
|
1696
|
+
{
|
|
1697
|
+
ref: s,
|
|
1698
|
+
className: d(
|
|
1699
|
+
ve.input,
|
|
1700
|
+
/* `Boolean(...)`: `prefix` bir `ReactNode` ve `0` da gecerli bir
|
|
1701
|
+
deger — `prefix &&` ifadesi o durumda dize degil sayi donuyordu. */
|
|
1702
|
+
!!e && ve["input--hasPrefix"],
|
|
1703
|
+
!!n && ve["input--hasSuffix"],
|
|
1704
|
+
t && ve["input--technical"]
|
|
1705
|
+
),
|
|
1706
|
+
"data-testid": r,
|
|
1707
|
+
...i
|
|
1708
|
+
}
|
|
1709
|
+
),
|
|
1710
|
+
n && /* @__PURE__ */ a("span", { className: ve.wrapper__suffix, "aria-hidden": !0, children: n })
|
|
1711
|
+
] })
|
|
1712
|
+
);
|
|
1713
|
+
Ga.displayName = "Input";
|
|
1714
|
+
const vo = h(Ga), yo = "hanui-textarea-zwJcB", xo = {
|
|
1715
|
+
textarea: yo
|
|
1716
|
+
}, Ua = ge(
|
|
1717
|
+
({ className: e, rows: n = 4, testId: t, ...o }, r) => /* @__PURE__ */ a(
|
|
1718
|
+
"textarea",
|
|
1719
|
+
{
|
|
1720
|
+
ref: r,
|
|
1721
|
+
rows: n,
|
|
1722
|
+
className: d(xo.textarea, e),
|
|
1723
|
+
"data-testid": t,
|
|
1724
|
+
...o
|
|
1725
|
+
}
|
|
1726
|
+
)
|
|
1727
|
+
);
|
|
1728
|
+
Ua.displayName = "Textarea";
|
|
1729
|
+
const ko = h(Ua), No = "hanui-field-KKvre", wo = "hanui-field__label-9dlYd", $o = "hanui-field__required-hbDJk", Do = "hanui-field__srOnly-2WQFH", Co = "hanui-field__hint-SQPiL", Io = "hanui-field__error-gLlZ-", ye = {
|
|
1730
|
+
field: No,
|
|
1731
|
+
field__label: wo,
|
|
1732
|
+
"field__label--hidden": "hanui-field__label--hidden-ufuVt",
|
|
1733
|
+
field__required: $o,
|
|
1734
|
+
field__srOnly: Do,
|
|
1735
|
+
field__hint: Co,
|
|
1736
|
+
field__error: Io
|
|
1737
|
+
}, Lo = ({
|
|
1738
|
+
label: e,
|
|
1739
|
+
children: n,
|
|
1740
|
+
hint: t,
|
|
1741
|
+
error: o,
|
|
1742
|
+
isRequired: r,
|
|
1743
|
+
requiredLabel: i,
|
|
1744
|
+
isLabelHidden: s,
|
|
1745
|
+
className: l
|
|
1746
|
+
}) => {
|
|
1747
|
+
const u = te(), p = `${u}-error`, m = `${u}-hint`;
|
|
1748
|
+
return /* @__PURE__ */ _("div", { className: d(ye.field, l), children: [
|
|
1749
|
+
/* @__PURE__ */ _(
|
|
1750
|
+
"label",
|
|
1751
|
+
{
|
|
1752
|
+
htmlFor: u,
|
|
1753
|
+
className: d(ye.field__label, s && ye["field__label--hidden"]),
|
|
1754
|
+
children: [
|
|
1755
|
+
e,
|
|
1756
|
+
r && /* @__PURE__ */ _(Je, { children: [
|
|
1757
|
+
/* @__PURE__ */ a("span", { className: ye.field__required, "aria-hidden": !0, children: "*" }),
|
|
1758
|
+
/* @__PURE__ */ a("span", { className: ye.field__srOnly, children: i })
|
|
1759
|
+
] })
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
),
|
|
1763
|
+
n({
|
|
1764
|
+
id: u,
|
|
1765
|
+
required: r || void 0,
|
|
1766
|
+
"aria-invalid": o ? !0 : void 0,
|
|
1767
|
+
"aria-describedby": o ? p : t ? m : void 0
|
|
1768
|
+
}),
|
|
1769
|
+
o ? /* @__PURE__ */ _("p", { id: p, className: ye.field__error, role: "alert", children: [
|
|
1770
|
+
/* @__PURE__ */ a(Fa, {}),
|
|
1771
|
+
o
|
|
1772
|
+
] }) : t && /* @__PURE__ */ a("p", { id: m, className: ye.field__hint, children: t })
|
|
1773
|
+
] });
|
|
1774
|
+
}, xa = h(Lo), Eo = "hanui-alert-gHI-9", Mo = "hanui-alert__icon-DhiCT", Ao = "hanui-alert__body-52-z2", Ro = "hanui-alert__title-I8BAh", To = "hanui-alert__content-lhBEo", Bo = "hanui-alert__action-1mTje", xe = {
|
|
1775
|
+
alert: Eo,
|
|
1776
|
+
alert__icon: Mo,
|
|
1777
|
+
alert__body: Ao,
|
|
1778
|
+
alert__title: Ro,
|
|
1779
|
+
alert__content: To,
|
|
1780
|
+
alert__action: Bo,
|
|
1781
|
+
"alert--info": "hanui-alert--info-lsAVw",
|
|
1782
|
+
"alert--success": "hanui-alert--success-RMJR6",
|
|
1783
|
+
"alert--warning": "hanui-alert--warning-Rkgln",
|
|
1784
|
+
"alert--danger": "hanui-alert--danger-9ei0Y"
|
|
1785
|
+
}, So = {
|
|
1786
|
+
info: /* @__PURE__ */ a($n, {}),
|
|
1787
|
+
success: /* @__PURE__ */ a(Dn, {}),
|
|
1788
|
+
warning: /* @__PURE__ */ a(Sa, {}),
|
|
1789
|
+
danger: /* @__PURE__ */ a(Cn, {})
|
|
1790
|
+
}, Fo = ({ children: e, tone: n = "info", title: t, action: o, className: r, testId: i }) => /* @__PURE__ */ _(
|
|
1791
|
+
"div",
|
|
1792
|
+
{
|
|
1793
|
+
className: d(xe.alert, xe[`alert--${n}`], r),
|
|
1794
|
+
role: n === "danger" || n === "warning" ? "alert" : void 0,
|
|
1795
|
+
"data-testid": i,
|
|
1796
|
+
children: [
|
|
1797
|
+
/* @__PURE__ */ a("span", { className: xe.alert__icon, children: So[n] }),
|
|
1798
|
+
/* @__PURE__ */ _("div", { className: xe.alert__body, children: [
|
|
1799
|
+
t && /* @__PURE__ */ a("strong", { className: xe.alert__title, children: t }),
|
|
1800
|
+
/* @__PURE__ */ a("div", { className: xe.alert__content, children: e })
|
|
1801
|
+
] }),
|
|
1802
|
+
o && /* @__PURE__ */ a("div", { className: xe.alert__action, children: o })
|
|
1803
|
+
]
|
|
1804
|
+
}
|
|
1805
|
+
), ac = h(Fo), Oo = "hanui-avatar-qoh3P", Ho = "hanui-avatar__image-uAyAX", sa = {
|
|
1806
|
+
avatar: Oo,
|
|
1807
|
+
avatar__image: Ho,
|
|
1808
|
+
"avatar--sm": "hanui-avatar--sm-GGjU4",
|
|
1809
|
+
"avatar--md": "hanui-avatar--md-xhXnK",
|
|
1810
|
+
"avatar--lg": "hanui-avatar--lg-ULP-r"
|
|
1811
|
+
}, Po = (e, n) => {
|
|
1812
|
+
const t = e.trim().split(/\s+/).filter(Boolean);
|
|
1813
|
+
if (t.length === 0) return "?";
|
|
1814
|
+
const o = t.length === 1 ? t[0].slice(0, 2) : `${t[0][0]}${t[t.length - 1][0]}`;
|
|
1815
|
+
return n ? o.toLocaleUpperCase(n) : o.toLocaleUpperCase();
|
|
1816
|
+
}, zo = ({ name: e, imageUrl: n, locale: t, size: o = "md", className: r, testId: i }) => /* @__PURE__ */ a(
|
|
1817
|
+
"span",
|
|
1818
|
+
{
|
|
1819
|
+
className: d(sa.avatar, sa[`avatar--${o}`], r),
|
|
1820
|
+
"aria-hidden": !0,
|
|
1821
|
+
"data-testid": i,
|
|
1822
|
+
children: n ? /* @__PURE__ */ a("img", { className: sa.avatar__image, src: n, alt: "" }) : Po(e, t)
|
|
1823
|
+
}
|
|
1824
|
+
), nc = h(zo), Ko = "hanui-badge-uLAaI", jo = "hanui-badge__icon-R2goZ", We = {
|
|
1825
|
+
badge: Ko,
|
|
1826
|
+
badge__icon: jo,
|
|
1827
|
+
"badge--neutral": "hanui-badge--neutral-6kddt",
|
|
1828
|
+
"badge--soft": "hanui-badge--soft-gFeRF",
|
|
1829
|
+
"badge--solid": "hanui-badge--solid-rtdHI",
|
|
1830
|
+
"badge--outline": "hanui-badge--outline-QiAAz",
|
|
1831
|
+
"badge--success": "hanui-badge--success-Oj11F",
|
|
1832
|
+
"badge--danger": "hanui-badge--danger-X3nV0",
|
|
1833
|
+
"badge--warning": "hanui-badge--warning-vAsx2",
|
|
1834
|
+
"badge--info": "hanui-badge--info-mHOwk",
|
|
1835
|
+
"badge--oem": "hanui-badge--oem-Nl-VX",
|
|
1836
|
+
"badge--alt": "hanui-badge--alt-gQkww",
|
|
1837
|
+
"badge--sale": "hanui-badge--sale-Li1tG",
|
|
1838
|
+
"badge--action": "hanui-badge--action-7pUio",
|
|
1839
|
+
"badge--link": "hanui-badge--link-zcNJZ"
|
|
1840
|
+
}, Go = ({
|
|
1841
|
+
children: e,
|
|
1842
|
+
tone: n = "neutral",
|
|
1843
|
+
variant: t = "soft",
|
|
1844
|
+
icon: o,
|
|
1845
|
+
className: r,
|
|
1846
|
+
testId: i
|
|
1847
|
+
}) => /* @__PURE__ */ _(
|
|
1848
|
+
"span",
|
|
1849
|
+
{
|
|
1850
|
+
className: d(We.badge, We[`badge--${n}`], We[`badge--${t}`], r),
|
|
1851
|
+
"data-testid": i,
|
|
1852
|
+
children: [
|
|
1853
|
+
o && /* @__PURE__ */ a("span", { className: We.badge__icon, children: o }),
|
|
1854
|
+
e
|
|
1855
|
+
]
|
|
1856
|
+
}
|
|
1857
|
+
), tc = h(Go), Uo = "hanui-breadcrumb-amB9n", qo = "hanui-breadcrumb__item-Icv1S", Xo = "hanui-breadcrumb__link-eVkPq", Yo = "hanui-breadcrumb__current-8XjhU", Zo = "hanui-breadcrumb__separator-vvaUi", Ue = {
|
|
1858
|
+
breadcrumb: Uo,
|
|
1859
|
+
breadcrumb__item: qo,
|
|
1860
|
+
breadcrumb__link: Xo,
|
|
1861
|
+
breadcrumb__current: Yo,
|
|
1862
|
+
breadcrumb__separator: Zo
|
|
1863
|
+
}, Jo = ({ items: e, label: n, linkProps: t, className: o, testId: r }) => /* @__PURE__ */ a("nav", { className: o, "aria-label": n, "data-testid": r, children: /* @__PURE__ */ a("ol", { className: d(Ue.breadcrumb), children: e.map((i, s) => {
|
|
1864
|
+
const l = s === e.length - 1;
|
|
1865
|
+
return /* @__PURE__ */ _("li", { className: Ue.breadcrumb__item, children: [
|
|
1866
|
+
i.href && !l ? /* @__PURE__ */ a(oe, { href: i.href, className: Ue.breadcrumb__link, ...t, children: i.label }) : /* @__PURE__ */ a("span", { className: Ue.breadcrumb__current, "aria-current": "page", children: i.label }),
|
|
1867
|
+
!l && /* @__PURE__ */ a(Ba, { className: Ue.breadcrumb__separator })
|
|
1868
|
+
] }, `${i.label}-${s}`);
|
|
1869
|
+
}) }) }), oc = h(Jo), Vo = "hanui-card-CaHUG", Qo = "hanui-media__frame-eBv-s", Wo = "hanui-media-eggk5", ei = "hanui-media__link-ujyVV", ai = "hanui-overlay-AVMTX", ni = "hanui-body-DyI-6", ti = "hanui-footer-2WNCZ", ne = {
|
|
1870
|
+
card: Vo,
|
|
1871
|
+
"card--interactive": "hanui-card--interactive-C1pXZ",
|
|
1872
|
+
media__frame: Qo,
|
|
1873
|
+
media: Wo,
|
|
1874
|
+
media__link: ei,
|
|
1875
|
+
"media__frame--contained": "hanui-media__frame--contained-Nv9gh",
|
|
1876
|
+
overlay: ai,
|
|
1877
|
+
"overlay--top-left": "hanui-overlay--top-left-td1xA",
|
|
1878
|
+
"overlay--top-right": "hanui-overlay--top-right-GqD9H",
|
|
1879
|
+
"overlay--bottom-left": "hanui-overlay--bottom-left-T5Quw",
|
|
1880
|
+
"overlay--bottom-right": "hanui-overlay--bottom-right-za3z3",
|
|
1881
|
+
body: ni,
|
|
1882
|
+
footer: ti
|
|
1883
|
+
}, oi = ({ children: e, isInteractive: n, as: t = "div", className: o, testId: r }) => /* @__PURE__ */ a(
|
|
1884
|
+
t,
|
|
1885
|
+
{
|
|
1886
|
+
className: d(ne.card, n && ne["card--interactive"], o),
|
|
1887
|
+
"data-testid": r,
|
|
1888
|
+
children: e
|
|
1889
|
+
}
|
|
1890
|
+
), ii = h(
|
|
1891
|
+
({ children: e, ratio: n = 1, href: t, linkProps: o, isContained: r = !0, className: i }) => {
|
|
1892
|
+
const s = /* @__PURE__ */ a(
|
|
1893
|
+
"span",
|
|
1894
|
+
{
|
|
1895
|
+
className: d(ne.media__frame, r && ne["media__frame--contained"]),
|
|
1896
|
+
style: { aspectRatio: n },
|
|
1897
|
+
children: e
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
return /* @__PURE__ */ a("div", { className: d(ne.media, i), children: t ? (
|
|
1901
|
+
// `tabIndex={-1}` + `aria-hidden`: aynı hedefe giden başlık bağlantısı
|
|
1902
|
+
// zaten sekme sırasında. Görseli ikinci bir durak yapmak klavye
|
|
1903
|
+
// gezinmesini iki katına çıkarıyor, ekran okuyucuda da aynı kayıt
|
|
1904
|
+
// arka arkaya iki kez duyuruluyordu.
|
|
1905
|
+
/* @__PURE__ */ a(
|
|
1906
|
+
oe,
|
|
1907
|
+
{
|
|
1908
|
+
href: t,
|
|
1909
|
+
className: ne.media__link,
|
|
1910
|
+
tabIndex: -1,
|
|
1911
|
+
"aria-hidden": !0,
|
|
1912
|
+
...o,
|
|
1913
|
+
children: s
|
|
1914
|
+
}
|
|
1915
|
+
)
|
|
1916
|
+
) : s });
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
1919
|
+
ii.displayName = "CardMedia";
|
|
1920
|
+
const ri = h(
|
|
1921
|
+
({ children: e, position: n = "top-left", className: t }) => /* @__PURE__ */ a("div", { className: d(ne.overlay, ne[`overlay--${n}`], t), children: e })
|
|
1922
|
+
);
|
|
1923
|
+
ri.displayName = "CardOverlay";
|
|
1924
|
+
const si = h(({ children: e, className: n }) => /* @__PURE__ */ a("div", { className: d(ne.body, n), children: e }));
|
|
1925
|
+
si.displayName = "CardBody";
|
|
1926
|
+
const ci = h(({ children: e, className: n }) => /* @__PURE__ */ a("div", { className: d(ne.footer, n), children: e }));
|
|
1927
|
+
ci.displayName = "CardFooter";
|
|
1928
|
+
const ic = h(oi), li = "hanui-copy-Yht5s", di = "hanui-copy__code-CYlCA", _i = "hanui-copy__button-GDdH6", ui = "hanui-copy__srOnly-WMTNN", Be = {
|
|
1929
|
+
copy: li,
|
|
1930
|
+
"copy--sm": "hanui-copy--sm-Tjqws",
|
|
1931
|
+
copy__code: di,
|
|
1932
|
+
"copy--md": "hanui-copy--md-00rhU",
|
|
1933
|
+
copy__button: _i,
|
|
1934
|
+
"copy__button--done": "hanui-copy__button--done-MujUR",
|
|
1935
|
+
copy__srOnly: ui
|
|
1936
|
+
}, hi = 1600, pi = ({
|
|
1937
|
+
value: e,
|
|
1938
|
+
copyLabel: n,
|
|
1939
|
+
copiedLabel: t,
|
|
1940
|
+
copiedAnnouncement: o,
|
|
1941
|
+
size: r = "sm",
|
|
1942
|
+
isReadOnly: i,
|
|
1943
|
+
className: s,
|
|
1944
|
+
testId: l
|
|
1945
|
+
}) => {
|
|
1946
|
+
const [u, p] = G(!1), m = Y(null), b = Y(void 0);
|
|
1947
|
+
R(() => () => window.clearTimeout(b.current), []);
|
|
1948
|
+
const c = Z(() => {
|
|
1949
|
+
const f = m.current;
|
|
1950
|
+
if (!f) return;
|
|
1951
|
+
const C = document.createRange();
|
|
1952
|
+
C.selectNodeContents(f);
|
|
1953
|
+
const D = window.getSelection();
|
|
1954
|
+
D == null || D.removeAllRanges(), D == null || D.addRange(C);
|
|
1955
|
+
}, []), v = Z(async () => {
|
|
1956
|
+
try {
|
|
1957
|
+
await navigator.clipboard.writeText(e), p(!0), b.current = window.setTimeout(() => p(!1), hi);
|
|
1958
|
+
} catch {
|
|
1959
|
+
c();
|
|
1960
|
+
}
|
|
1961
|
+
}, [e, c]);
|
|
1962
|
+
return /* @__PURE__ */ _("span", { className: d(Be.copy, Be[`copy--${r}`], s), "data-testid": l, children: [
|
|
1963
|
+
/* @__PURE__ */ a("span", { className: Be.copy__code, ref: m, children: e }),
|
|
1964
|
+
!i && /* @__PURE__ */ a(
|
|
1965
|
+
"button",
|
|
1966
|
+
{
|
|
1967
|
+
type: "button",
|
|
1968
|
+
className: d(Be.copy__button, u && Be["copy__button--done"]),
|
|
1969
|
+
onClick: v,
|
|
1970
|
+
"aria-label": u ? t : n,
|
|
1971
|
+
title: u ? t : n,
|
|
1972
|
+
children: u ? /* @__PURE__ */ a(fn, {}) : /* @__PURE__ */ a(wn, {})
|
|
1973
|
+
}
|
|
1974
|
+
),
|
|
1975
|
+
/* @__PURE__ */ a("span", { "aria-live": "polite", className: Be.copy__srOnly, children: u ? o : "" })
|
|
1976
|
+
] });
|
|
1977
|
+
}, rc = h(pi), bi = "hanui-divider-RJqCw", mi = "hanui-divider__label-M8sBA", ea = {
|
|
1978
|
+
divider: bi,
|
|
1979
|
+
"divider--labelled": "hanui-divider--labelled-jZH1-",
|
|
1980
|
+
divider__label: mi
|
|
1981
|
+
}, gi = ({ label: e, className: n }) => e ? /* @__PURE__ */ a("div", { className: d(ea.divider, ea["divider--labelled"], n), children: /* @__PURE__ */ a("span", { className: ea.divider__label, children: e }) }) : /* @__PURE__ */ a("hr", { className: d(ea.divider, n) }), sc = h(gi), fi = "hanui-directory-badEd", vi = "hanui-group-i6An9", yi = "hanui-group__header-rc19c", xi = "hanui-group__label-vQTcs", ki = "hanui-group__link-es5V7", Ni = "hanui-group__meta-LtC-u", wi = "hanui-group__list-YxBCG", $i = "hanui-row-3LH7X", Di = "hanui-row__name-75Wbq", Ci = "hanui-row__media-AxZEh", Ii = "hanui-row__marker-RYHb-", Li = "hanui-jump-vpGwB", Ei = "hanui-jump__link-rRnT6", V = {
|
|
1982
|
+
directory: fi,
|
|
1983
|
+
group: vi,
|
|
1984
|
+
group__header: yi,
|
|
1985
|
+
group__label: xi,
|
|
1986
|
+
group__link: ki,
|
|
1987
|
+
group__meta: Ni,
|
|
1988
|
+
group__list: wi,
|
|
1989
|
+
row: $i,
|
|
1990
|
+
row__name: Di,
|
|
1991
|
+
row__media: Ci,
|
|
1992
|
+
row__marker: Ii,
|
|
1993
|
+
jump: Li,
|
|
1994
|
+
jump__link: Ei
|
|
1995
|
+
}, Mi = ({ children: e, className: n }) => /* @__PURE__ */ a("div", { className: d(V.directory, n), children: e }), Ai = h(
|
|
1996
|
+
({ label: e, href: n, linkProps: t, meta: o, children: r, id: i }) => /* @__PURE__ */ _("section", { className: V.group, id: i, children: [
|
|
1997
|
+
/* @__PURE__ */ _("header", { className: V.group__header, children: [
|
|
1998
|
+
/* @__PURE__ */ a("h2", { className: V.group__label, children: n ? /* @__PURE__ */ a(oe, { href: n, className: V.group__link, ...t, children: e }) : e }),
|
|
1999
|
+
o && /* @__PURE__ */ a("span", { className: V.group__meta, children: o })
|
|
2000
|
+
] }),
|
|
2001
|
+
/* @__PURE__ */ a("ul", { className: V.group__list, children: r })
|
|
2002
|
+
] })
|
|
2003
|
+
);
|
|
2004
|
+
Ai.displayName = "DirectoryGroup";
|
|
2005
|
+
const Ri = h(
|
|
2006
|
+
({ href: e, name: n, media: t, marker: o, linkProps: r, className: i }) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ _(oe, { href: e, className: d(V.row, i), ...r, children: [
|
|
2007
|
+
t && /* @__PURE__ */ a("span", { className: V.row__media, children: t }),
|
|
2008
|
+
/* @__PURE__ */ a("span", { className: V.row__name, children: n }),
|
|
2009
|
+
o && /* @__PURE__ */ a("span", { className: V.row__marker, children: o })
|
|
2010
|
+
] }) })
|
|
2011
|
+
);
|
|
2012
|
+
Ri.displayName = "DirectoryRow";
|
|
2013
|
+
const Ti = h(({ labels: e, toId: n, label: t }) => /* @__PURE__ */ a("nav", { className: V.jump, "aria-label": t, children: e.map((o) => /* @__PURE__ */ a("a", { href: `#${n(o)}`, className: V.jump__link, children: o }, o)) }));
|
|
2014
|
+
Ti.displayName = "DirectoryJump";
|
|
2015
|
+
const cc = h(Mi), Bi = "hanui-empty-47qZR", Si = "hanui-empty__icon-okfEc", Fi = "hanui-empty__title-Z7Dzd", Oi = "hanui-empty__description-6BoCk", Hi = "hanui-empty__actions-ARk-k", Se = {
|
|
2016
|
+
empty: Bi,
|
|
2017
|
+
empty__icon: Si,
|
|
2018
|
+
empty__title: Fi,
|
|
2019
|
+
empty__description: Oi,
|
|
2020
|
+
empty__actions: Hi,
|
|
2021
|
+
"empty--sm": "hanui-empty--sm-QXaXx"
|
|
2022
|
+
}, Pi = ({
|
|
2023
|
+
title: e,
|
|
2024
|
+
description: n,
|
|
2025
|
+
icon: t,
|
|
2026
|
+
action: o,
|
|
2027
|
+
secondaryAction: r,
|
|
2028
|
+
size: i = "md",
|
|
2029
|
+
className: s,
|
|
2030
|
+
testId: l
|
|
2031
|
+
}) => /* @__PURE__ */ _("div", { className: d(Se.empty, Se[`empty--${i}`], s), "data-testid": l, children: [
|
|
2032
|
+
t && /* @__PURE__ */ a("span", { className: Se.empty__icon, children: t }),
|
|
2033
|
+
/* @__PURE__ */ a("h3", { className: Se.empty__title, children: e }),
|
|
2034
|
+
n && /* @__PURE__ */ a("p", { className: Se.empty__description, children: n }),
|
|
2035
|
+
(o || r) && /* @__PURE__ */ _("div", { className: Se.empty__actions, children: [
|
|
2036
|
+
o,
|
|
2037
|
+
r
|
|
2038
|
+
] })
|
|
2039
|
+
] }), lc = h(Pi), zi = "hanui-header-yJwus", Ki = "hanui-header__top-UK4si", ji = "hanui-header__text-HIo8U", Gi = "hanui-header__eyebrow-dZ9Zc", Ui = "hanui-header__titleRow-KgDZj", qi = "hanui-header__title-s1giF", Xi = "hanui-header__meta-UxuaD", Yi = "hanui-header__description-NXbbC", Zi = "hanui-header__actions-aShpt", de = {
|
|
2040
|
+
header: zi,
|
|
2041
|
+
header__top: Ki,
|
|
2042
|
+
header__text: ji,
|
|
2043
|
+
header__eyebrow: Gi,
|
|
2044
|
+
header__titleRow: Ui,
|
|
2045
|
+
header__title: qi,
|
|
2046
|
+
header__meta: Xi,
|
|
2047
|
+
header__description: Yi,
|
|
2048
|
+
header__actions: Zi
|
|
2049
|
+
}, Ji = ({
|
|
2050
|
+
title: e,
|
|
2051
|
+
eyebrow: n,
|
|
2052
|
+
description: t,
|
|
2053
|
+
actions: o,
|
|
2054
|
+
breadcrumb: r,
|
|
2055
|
+
meta: i,
|
|
2056
|
+
children: s,
|
|
2057
|
+
as: l = "h1",
|
|
2058
|
+
className: u,
|
|
2059
|
+
testId: p
|
|
2060
|
+
}) => /* @__PURE__ */ _("header", { className: d(de.header, u), "data-testid": p, children: [
|
|
2061
|
+
r,
|
|
2062
|
+
/* @__PURE__ */ _("div", { className: de.header__top, children: [
|
|
2063
|
+
/* @__PURE__ */ _("div", { className: de.header__text, children: [
|
|
2064
|
+
n && /* @__PURE__ */ a("span", { className: de.header__eyebrow, children: n }),
|
|
2065
|
+
/* @__PURE__ */ _("div", { className: de.header__titleRow, children: [
|
|
2066
|
+
/* @__PURE__ */ a(l, { className: de.header__title, children: e }),
|
|
2067
|
+
i && /* @__PURE__ */ a("span", { className: de.header__meta, children: i })
|
|
2068
|
+
] }),
|
|
2069
|
+
t && /* @__PURE__ */ a("p", { className: de.header__description, children: t })
|
|
2070
|
+
] }),
|
|
2071
|
+
o && /* @__PURE__ */ a("div", { className: de.header__actions, children: o })
|
|
2072
|
+
] }),
|
|
2073
|
+
s
|
|
2074
|
+
] }), dc = h(Ji), Vi = "hanui-panel-Sv-1m", Qi = "hanui-panel__header-ysexh", Wi = "hanui-panel__heading-xLCsB", er = "hanui-panel__icon--yPQT", ar = "hanui-panel__headingText--XqxW", nr = "hanui-panel__title-6-6uC", tr = "hanui-panel__description-qXTSM", or = "hanui-panel__actions-Ra-zy", ir = "hanui-panel__body-lo5aX", rr = "hanui-panel__footer-qLpR1", sr = "hanui-form-o9UqJ", cr = "hanui-row-vUGpa", X = {
|
|
2075
|
+
panel: Vi,
|
|
2076
|
+
panel__header: Qi,
|
|
2077
|
+
panel__heading: Wi,
|
|
2078
|
+
panel__icon: er,
|
|
2079
|
+
panel__headingText: ar,
|
|
2080
|
+
panel__title: nr,
|
|
2081
|
+
panel__description: tr,
|
|
2082
|
+
panel__actions: or,
|
|
2083
|
+
panel__body: ir,
|
|
2084
|
+
"panel__body--sm": "hanui-panel__body--sm-6XP6W",
|
|
2085
|
+
"panel__body--lg": "hanui-panel__body--lg-RTK5B",
|
|
2086
|
+
"panel__body--flush": "hanui-panel__body--flush-iK75R",
|
|
2087
|
+
panel__footer: rr,
|
|
2088
|
+
form: sr,
|
|
2089
|
+
"form--2": "hanui-form--2-HdwDc",
|
|
2090
|
+
row: cr
|
|
2091
|
+
}, lr = ({
|
|
2092
|
+
children: e,
|
|
2093
|
+
title: n,
|
|
2094
|
+
description: t,
|
|
2095
|
+
actions: o,
|
|
2096
|
+
icon: r,
|
|
2097
|
+
isFlush: i,
|
|
2098
|
+
gap: s = "md",
|
|
2099
|
+
footer: l,
|
|
2100
|
+
as: u = "section",
|
|
2101
|
+
className: p,
|
|
2102
|
+
bodyClassName: m,
|
|
2103
|
+
testId: b
|
|
2104
|
+
}) => /* @__PURE__ */ _(u, { className: d(X.panel, p), "data-testid": b, children: [
|
|
2105
|
+
(n || o) && /* @__PURE__ */ _("div", { className: X.panel__header, children: [
|
|
2106
|
+
/* @__PURE__ */ _("div", { className: X.panel__heading, children: [
|
|
2107
|
+
r && /* @__PURE__ */ a("span", { className: X.panel__icon, children: r }),
|
|
2108
|
+
/* @__PURE__ */ _("div", { className: X.panel__headingText, children: [
|
|
2109
|
+
n && /* @__PURE__ */ a("h2", { className: X.panel__title, children: n }),
|
|
2110
|
+
t && /* @__PURE__ */ a("p", { className: X.panel__description, children: t })
|
|
2111
|
+
] })
|
|
2112
|
+
] }),
|
|
2113
|
+
o && /* @__PURE__ */ a("div", { className: X.panel__actions, children: o })
|
|
2114
|
+
] }),
|
|
2115
|
+
/* @__PURE__ */ a(
|
|
2116
|
+
"div",
|
|
2117
|
+
{
|
|
2118
|
+
className: d(
|
|
2119
|
+
X.panel__body,
|
|
2120
|
+
X[`panel__body--${s}`],
|
|
2121
|
+
i && X["panel__body--flush"],
|
|
2122
|
+
m
|
|
2123
|
+
),
|
|
2124
|
+
children: e
|
|
2125
|
+
}
|
|
2126
|
+
),
|
|
2127
|
+
l && /* @__PURE__ */ a("div", { className: X.panel__footer, children: l })
|
|
2128
|
+
] }), dr = h(({ children: e, columns: n = 1, className: t }) => /* @__PURE__ */ a("div", { className: d(X.form, X[`form--${n}`], t), children: e }));
|
|
2129
|
+
dr.displayName = "PanelForm";
|
|
2130
|
+
const _r = h(({ children: e, className: n }) => /* @__PURE__ */ a("div", { className: d(X.row, n), children: e }));
|
|
2131
|
+
_r.displayName = "PanelRow";
|
|
2132
|
+
const _c = h(lr), ur = "hanui-price-Oc5Nr", hr = "hanui-price__current-2Xup2", pr = "hanui-price__currency-32NLN", br = "hanui-price__list-MlQgT", mr = "hanui-price__discount-5Yc6W", ke = {
|
|
2133
|
+
price: ur,
|
|
2134
|
+
price__current: hr,
|
|
2135
|
+
price__currency: pr,
|
|
2136
|
+
price__list: br,
|
|
2137
|
+
price__discount: mr,
|
|
2138
|
+
"price--sm": "hanui-price--sm-Hd8Oe",
|
|
2139
|
+
"price--md": "hanui-price--md-JMxlK",
|
|
2140
|
+
"price--lg": "hanui-price--lg-TFqIF",
|
|
2141
|
+
"price--xl": "hanui-price--xl-EJBYq"
|
|
2142
|
+
}, gr = ({
|
|
2143
|
+
value: e,
|
|
2144
|
+
currency: n,
|
|
2145
|
+
listValue: t,
|
|
2146
|
+
discountPercent: o,
|
|
2147
|
+
formatDiscount: r = (u) => `%${u}`,
|
|
2148
|
+
size: i = "md",
|
|
2149
|
+
className: s,
|
|
2150
|
+
testId: l
|
|
2151
|
+
}) => /* @__PURE__ */ _("span", { className: d(ke.price, ke[`price--${i}`], s), "data-testid": l, children: [
|
|
2152
|
+
/* @__PURE__ */ _("span", { className: ke.price__current, children: [
|
|
2153
|
+
e,
|
|
2154
|
+
/* @__PURE__ */ a("span", { className: ke.price__currency, children: n })
|
|
2155
|
+
] }),
|
|
2156
|
+
t && /* @__PURE__ */ _("s", { className: ke.price__list, children: [
|
|
2157
|
+
t,
|
|
2158
|
+
/* @__PURE__ */ a("span", { className: ke.price__currency, children: n })
|
|
2159
|
+
] }),
|
|
2160
|
+
o !== void 0 && o > 0 && /* @__PURE__ */ a("span", { className: ke.price__discount, children: r(o) })
|
|
2161
|
+
] }), uc = h(gr), fr = "hanui-rating-94dke", vr = "hanui-rating__stars-QkpVU", yr = "hanui-rating__empty-Wf6-K", xr = "hanui-rating__count-pIoEs", kr = "hanui-rating__srOnly-E9h0d", Fe = {
|
|
2162
|
+
rating: fr,
|
|
2163
|
+
rating__stars: vr,
|
|
2164
|
+
rating__empty: yr,
|
|
2165
|
+
rating__count: xr,
|
|
2166
|
+
rating__srOnly: kr,
|
|
2167
|
+
"rating--sm": "hanui-rating--sm-AtY7U",
|
|
2168
|
+
"rating--md": "hanui-rating--md-Q0nxN"
|
|
2169
|
+
}, Nr = ({ value: e, count: n, srLabel: t, size: o = "sm", className: r, testId: i }) => {
|
|
2170
|
+
const s = Math.round(e * 2) / 2;
|
|
2171
|
+
return /* @__PURE__ */ _("span", { className: d(Fe.rating, Fe[`rating--${o}`], r), "data-testid": i, children: [
|
|
2172
|
+
/* @__PURE__ */ a("span", { className: Fe.rating__stars, "aria-hidden": !0, children: Array.from({ length: 5 }, (l, u) => {
|
|
2173
|
+
const p = u + 1;
|
|
2174
|
+
return s >= p ? /* @__PURE__ */ a(Oa, {}, u) : s >= p - 0.5 ? /* @__PURE__ */ a(Mn, {}, u) : /* @__PURE__ */ a(En, { className: Fe.rating__empty }, u);
|
|
2175
|
+
}) }),
|
|
2176
|
+
/* @__PURE__ */ a("span", { className: Fe.rating__srOnly, children: t }),
|
|
2177
|
+
Pe(n) && /* @__PURE__ */ _("span", { className: Fe.rating__count, "aria-hidden": !0, children: [
|
|
2178
|
+
"(",
|
|
2179
|
+
n,
|
|
2180
|
+
")"
|
|
2181
|
+
] })
|
|
2182
|
+
] });
|
|
2183
|
+
}, hc = h(Nr), wr = "hanui-header-a08Jh", $r = "hanui-header__text-ArJkA", Dr = "hanui-header__overline-X5Epo", Cr = "hanui-header__title-nQQQJ", Ir = "hanui-header__description-08oCr", Lr = "hanui-header__action-xsxQF", Ne = {
|
|
2184
|
+
header: wr,
|
|
2185
|
+
header__text: $r,
|
|
2186
|
+
header__overline: Dr,
|
|
2187
|
+
header__title: Cr,
|
|
2188
|
+
header__description: Ir,
|
|
2189
|
+
header__action: Lr,
|
|
2190
|
+
"header--sm": "hanui-header--sm-mIJWZ",
|
|
2191
|
+
"header--lg": "hanui-header--lg-QBLIz"
|
|
2192
|
+
}, Er = ({
|
|
2193
|
+
title: e,
|
|
2194
|
+
description: n,
|
|
2195
|
+
overline: t,
|
|
2196
|
+
action: o,
|
|
2197
|
+
as: r = "h2",
|
|
2198
|
+
size: i = "md",
|
|
2199
|
+
className: s,
|
|
2200
|
+
testId: l
|
|
2201
|
+
}) => /* @__PURE__ */ _("header", { className: d(Ne.header, Ne[`header--${i}`], s), "data-testid": l, children: [
|
|
2202
|
+
/* @__PURE__ */ _("div", { className: Ne.header__text, children: [
|
|
2203
|
+
t && /* @__PURE__ */ a("span", { className: Ne.header__overline, children: t }),
|
|
2204
|
+
/* @__PURE__ */ a(r, { className: Ne.header__title, children: e }),
|
|
2205
|
+
n && /* @__PURE__ */ a("p", { className: Ne.header__description, children: n })
|
|
2206
|
+
] }),
|
|
2207
|
+
o && /* @__PURE__ */ a("div", { className: Ne.header__action, children: o })
|
|
2208
|
+
] }), pc = h(Er), Mr = "hanui-skeleton-n92if", Ar = "hanui-group-YMfwa", qe = {
|
|
2209
|
+
skeleton: Mr,
|
|
2210
|
+
"hanui-shimmer": "hanui-hanui-shimmer-6yd48",
|
|
2211
|
+
"skeleton--block": "hanui-skeleton--block-tOZ-a",
|
|
2212
|
+
"skeleton--text": "hanui-skeleton--text-k-ROi",
|
|
2213
|
+
"skeleton--circle": "hanui-skeleton--circle-x-mX3",
|
|
2214
|
+
group: Ar
|
|
2215
|
+
}, Rr = ({ width: e, height: n, variant: t = "block", lines: o = 1, className: r }) => {
|
|
2216
|
+
const i = {
|
|
2217
|
+
width: pa(e) ? `${e}px` : e,
|
|
2218
|
+
height: pa(n) ? `${n}px` : n
|
|
2219
|
+
};
|
|
2220
|
+
return t === "text" && o > 1 ? /* @__PURE__ */ a("span", { className: d(qe.group, r), "aria-hidden": !0, children: Array.from({ length: o }, (s, l) => /* @__PURE__ */ a(
|
|
2221
|
+
"span",
|
|
2222
|
+
{
|
|
2223
|
+
className: d(qe.skeleton, qe["skeleton--text"]),
|
|
2224
|
+
style: l === o - 1 ? { width: "60%" } : void 0
|
|
2225
|
+
},
|
|
2226
|
+
l
|
|
2227
|
+
)) }) : /* @__PURE__ */ a(
|
|
2228
|
+
"span",
|
|
2229
|
+
{
|
|
2230
|
+
className: d(qe.skeleton, qe[`skeleton--${t}`], r),
|
|
2231
|
+
style: i,
|
|
2232
|
+
"aria-hidden": !0
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2235
|
+
}, bc = h(Rr), Tr = "hanui-tabs-l4dFE", Br = "hanui-tabs__list-HJvR8", Sr = "hanui-tabs__tab-7gDW7", Fr = "hanui-tabs__count-8JX8s", Or = "hanui-tabs__panel-CPklY", Oe = {
|
|
2236
|
+
tabs: Tr,
|
|
2237
|
+
tabs__list: Br,
|
|
2238
|
+
tabs__tab: Sr,
|
|
2239
|
+
"tabs__tab--active": "hanui-tabs__tab--active-riqNp",
|
|
2240
|
+
tabs__count: Fr,
|
|
2241
|
+
tabs__panel: Or
|
|
2242
|
+
}, Hr = ({
|
|
2243
|
+
items: e,
|
|
2244
|
+
defaultTabId: n,
|
|
2245
|
+
activeId: t,
|
|
2246
|
+
onChange: o,
|
|
2247
|
+
ariaLabel: r,
|
|
2248
|
+
className: i,
|
|
2249
|
+
testId: s
|
|
2250
|
+
}) => {
|
|
2251
|
+
var $;
|
|
2252
|
+
const l = te(), [u, p] = G(n ?? (($ = e[0]) == null ? void 0 : $.id)), m = Pe(t), b = m ? t : u, c = e.findIndex((N) => N.id === b), v = e[c] ?? e[0], f = (N) => {
|
|
2253
|
+
m || p(N), o == null || o(N);
|
|
2254
|
+
}, C = (N) => {
|
|
2255
|
+
var q;
|
|
2256
|
+
const E = N.key === "ArrowRight" ? 1 : N.key === "ArrowLeft" ? -1 : 0;
|
|
2257
|
+
if (E === 0) return;
|
|
2258
|
+
N.preventDefault();
|
|
2259
|
+
const U = (c + E + e.length) % e.length;
|
|
2260
|
+
f(e[U].id), (q = document.getElementById(`${l}-tab-${e[U].id}`)) == null || q.focus();
|
|
2261
|
+
};
|
|
2262
|
+
if (e.length === 0) return null;
|
|
2263
|
+
const D = Pe(v == null ? void 0 : v.content);
|
|
2264
|
+
return /* @__PURE__ */ _("div", { className: d(Oe.tabs, i), "data-testid": s, children: [
|
|
2265
|
+
/* @__PURE__ */ a(
|
|
2266
|
+
"div",
|
|
2267
|
+
{
|
|
2268
|
+
className: Oe.tabs__list,
|
|
2269
|
+
role: "tablist",
|
|
2270
|
+
"aria-label": r,
|
|
2271
|
+
onKeyDown: C,
|
|
2272
|
+
children: e.map((N) => {
|
|
2273
|
+
const E = N.id === v.id;
|
|
2274
|
+
return /* @__PURE__ */ _(
|
|
2275
|
+
"button",
|
|
2276
|
+
{
|
|
2277
|
+
id: `${l}-tab-${N.id}`,
|
|
2278
|
+
type: "button",
|
|
2279
|
+
role: "tab",
|
|
2280
|
+
"aria-selected": E,
|
|
2281
|
+
"aria-controls": D ? `${l}-panel-${N.id}` : void 0,
|
|
2282
|
+
tabIndex: E ? 0 : -1,
|
|
2283
|
+
className: d(Oe.tabs__tab, E && Oe["tabs__tab--active"]),
|
|
2284
|
+
onClick: () => f(N.id),
|
|
2285
|
+
children: [
|
|
2286
|
+
N.label,
|
|
2287
|
+
Pe(N.count) && /* @__PURE__ */ a("span", { className: Oe.tabs__count, children: N.count })
|
|
2288
|
+
]
|
|
2289
|
+
},
|
|
2290
|
+
N.id
|
|
2291
|
+
);
|
|
2292
|
+
})
|
|
2293
|
+
}
|
|
2294
|
+
),
|
|
2295
|
+
D && /* @__PURE__ */ a(
|
|
2296
|
+
"div",
|
|
2297
|
+
{
|
|
2298
|
+
id: `${l}-panel-${v.id}`,
|
|
2299
|
+
role: "tabpanel",
|
|
2300
|
+
"aria-labelledby": `${l}-tab-${v.id}`,
|
|
2301
|
+
className: Oe.tabs__panel,
|
|
2302
|
+
tabIndex: 0,
|
|
2303
|
+
children: v.content
|
|
2304
|
+
}
|
|
2305
|
+
)
|
|
2306
|
+
] });
|
|
2307
|
+
}, mc = h(Hr), Pr = "hanui-tile-TGur-", zr = "hanui-tile__medallion--Y0pz", Kr = "hanui-tile__label-mI1OQ", jr = "hanui-tile__meta-22qnR", Xe = {
|
|
2308
|
+
tile: Pr,
|
|
2309
|
+
tile__medallion: zr,
|
|
2310
|
+
tile__label: Kr,
|
|
2311
|
+
tile__meta: jr,
|
|
2312
|
+
"tile--active": "hanui-tile--active-z0F2M"
|
|
2313
|
+
}, Gr = ({ label: e, icon: n, href: t, meta: o, isActive: r, linkProps: i, className: s, testId: l }) => /* @__PURE__ */ _(
|
|
2314
|
+
oe,
|
|
2315
|
+
{
|
|
2316
|
+
href: t,
|
|
2317
|
+
className: d(Xe.tile, r && Xe["tile--active"], s),
|
|
2318
|
+
"aria-current": r ? "page" : void 0,
|
|
2319
|
+
"data-testid": l,
|
|
2320
|
+
...i,
|
|
2321
|
+
children: [
|
|
2322
|
+
/* @__PURE__ */ a("span", { className: Xe.tile__medallion, "aria-hidden": !0, children: n }),
|
|
2323
|
+
/* @__PURE__ */ a("span", { className: Xe.tile__label, children: e }),
|
|
2324
|
+
o && /* @__PURE__ */ a("span", { className: Xe.tile__meta, children: o })
|
|
2325
|
+
]
|
|
2326
|
+
}
|
|
2327
|
+
), gc = h(Gr), Ur = "hanui-modal-3IDi9", qr = "hanui-modal__panel--qLSz", Xr = "hanui-modal__header-meWm6", Yr = "hanui-modal__icon-df2dd", Zr = "hanui-modal__heading-PwDS8", Jr = "hanui-modal__title-80Sh6", Vr = "hanui-modal__description-fsCHI", Qr = "hanui-modal__close-vFPbw", Wr = "hanui-modal__body-PDF12", es = "hanui-modal__footer-CCCkx", Q = {
|
|
2328
|
+
modal: Ur,
|
|
2329
|
+
"modal--sm": "hanui-modal--sm-A7WsS",
|
|
2330
|
+
"modal--lg": "hanui-modal--lg-z99Em",
|
|
2331
|
+
"hanui-fade-in": "hanui-hanui-fade-in-oHUfh",
|
|
2332
|
+
"hanui-fade-in-up": "hanui-hanui-fade-in-up-RF4Hl",
|
|
2333
|
+
"hanui-slide-up": "hanui-hanui-slide-up-ibKAg",
|
|
2334
|
+
modal__panel: qr,
|
|
2335
|
+
modal__header: Xr,
|
|
2336
|
+
modal__icon: Yr,
|
|
2337
|
+
"modal__icon--neutral": "hanui-modal__icon--neutral-QSL7c",
|
|
2338
|
+
"modal__icon--danger": "hanui-modal__icon--danger-6V90a",
|
|
2339
|
+
"modal__icon--warning": "hanui-modal__icon--warning-a--FX",
|
|
2340
|
+
"modal__icon--success": "hanui-modal__icon--success-YWxZs",
|
|
2341
|
+
"modal__icon--info": "hanui-modal__icon--info-WRLah",
|
|
2342
|
+
modal__heading: Zr,
|
|
2343
|
+
modal__title: Jr,
|
|
2344
|
+
modal__description: Vr,
|
|
2345
|
+
modal__close: Qr,
|
|
2346
|
+
modal__body: Wr,
|
|
2347
|
+
modal__footer: es
|
|
2348
|
+
}, as = ({
|
|
2349
|
+
isOpen: e,
|
|
2350
|
+
onClose: n,
|
|
2351
|
+
title: t,
|
|
2352
|
+
closeLabel: o,
|
|
2353
|
+
children: r,
|
|
2354
|
+
description: i,
|
|
2355
|
+
footer: s,
|
|
2356
|
+
icon: l,
|
|
2357
|
+
tone: u = "neutral",
|
|
2358
|
+
size: p = "md",
|
|
2359
|
+
isDismissable: m = !0,
|
|
2360
|
+
className: b,
|
|
2361
|
+
testId: c
|
|
2362
|
+
}) => {
|
|
2363
|
+
const v = Y(null), f = te(), C = te();
|
|
2364
|
+
R(() => {
|
|
2365
|
+
const $ = v.current;
|
|
2366
|
+
$ && (e && !$.open && ($.showModal(), La($)), !e && $.open && $.close());
|
|
2367
|
+
}, [e]), R(() => {
|
|
2368
|
+
if (!e) return;
|
|
2369
|
+
const $ = document.body.style.overflow;
|
|
2370
|
+
return document.body.style.overflow = "hidden", () => {
|
|
2371
|
+
document.body.style.overflow = $;
|
|
2372
|
+
};
|
|
2373
|
+
}, [e]), R(() => {
|
|
2374
|
+
const $ = v.current;
|
|
2375
|
+
if (!$) return;
|
|
2376
|
+
const N = (E) => {
|
|
2377
|
+
E.preventDefault(), m && n();
|
|
2378
|
+
};
|
|
2379
|
+
return $.addEventListener("cancel", N), () => $.removeEventListener("cancel", N);
|
|
2380
|
+
}, [n, m]);
|
|
2381
|
+
const D = Z(
|
|
2382
|
+
($) => {
|
|
2383
|
+
m && $.target === v.current && n();
|
|
2384
|
+
},
|
|
2385
|
+
[m, n]
|
|
2386
|
+
);
|
|
2387
|
+
return /* @__PURE__ */ a(
|
|
2388
|
+
"dialog",
|
|
2389
|
+
{
|
|
2390
|
+
ref: v,
|
|
2391
|
+
className: d(Q.modal, Q[`modal--${p}`], b),
|
|
2392
|
+
"aria-labelledby": f,
|
|
2393
|
+
"aria-describedby": i ? C : void 0,
|
|
2394
|
+
"data-testid": c,
|
|
2395
|
+
onClick: D,
|
|
2396
|
+
children: /* @__PURE__ */ _("div", { className: Q.modal__panel, children: [
|
|
2397
|
+
/* @__PURE__ */ _("header", { className: Q.modal__header, children: [
|
|
2398
|
+
l && /* @__PURE__ */ a("span", { className: d(Q.modal__icon, Q[`modal__icon--${u}`]), children: l }),
|
|
2399
|
+
/* @__PURE__ */ _("div", { className: Q.modal__heading, children: [
|
|
2400
|
+
/* @__PURE__ */ a("h2", { id: f, className: Q.modal__title, children: t }),
|
|
2401
|
+
i && /* @__PURE__ */ a("p", { id: C, className: Q.modal__description, children: i })
|
|
2402
|
+
] }),
|
|
2403
|
+
m && /* @__PURE__ */ a(
|
|
2404
|
+
ta,
|
|
2405
|
+
{
|
|
2406
|
+
icon: /* @__PURE__ */ a(la, {}),
|
|
2407
|
+
label: o,
|
|
2408
|
+
variant: "ghost",
|
|
2409
|
+
size: "sm",
|
|
2410
|
+
className: Q.modal__close,
|
|
2411
|
+
onClick: n
|
|
2412
|
+
}
|
|
2413
|
+
)
|
|
2414
|
+
] }),
|
|
2415
|
+
r && /* @__PURE__ */ a("div", { className: Q.modal__body, children: r }),
|
|
2416
|
+
s && /* @__PURE__ */ a("footer", { className: Q.modal__footer, children: s })
|
|
2417
|
+
] })
|
|
2418
|
+
}
|
|
2419
|
+
);
|
|
2420
|
+
}, qa = h(as), ns = {
|
|
2421
|
+
destructive: /* @__PURE__ */ a(Ln, {}),
|
|
2422
|
+
warning: /* @__PURE__ */ a(Sa, {}),
|
|
2423
|
+
neutral: /* @__PURE__ */ a(In, {})
|
|
2424
|
+
}, ts = {
|
|
2425
|
+
destructive: "danger",
|
|
2426
|
+
warning: "warning",
|
|
2427
|
+
neutral: "info"
|
|
2428
|
+
}, os = {
|
|
2429
|
+
destructive: ue.DANGER,
|
|
2430
|
+
warning: ue.PRIMARY,
|
|
2431
|
+
neutral: ue.PRIMARY
|
|
2432
|
+
}, is = ({
|
|
2433
|
+
isOpen: e,
|
|
2434
|
+
onClose: n,
|
|
2435
|
+
onConfirm: t,
|
|
2436
|
+
title: o,
|
|
2437
|
+
description: r,
|
|
2438
|
+
confirmLabel: i,
|
|
2439
|
+
cancelLabel: s,
|
|
2440
|
+
closeLabel: l,
|
|
2441
|
+
kind: u = "neutral",
|
|
2442
|
+
children: p
|
|
2443
|
+
}) => {
|
|
2444
|
+
const [m, b] = G(!1), c = async () => {
|
|
2445
|
+
b(!0);
|
|
2446
|
+
try {
|
|
2447
|
+
await t();
|
|
2448
|
+
} finally {
|
|
2449
|
+
b(!1);
|
|
2450
|
+
}
|
|
2451
|
+
};
|
|
2452
|
+
return /* @__PURE__ */ a(
|
|
2453
|
+
qa,
|
|
2454
|
+
{
|
|
2455
|
+
isOpen: e,
|
|
2456
|
+
onClose: n,
|
|
2457
|
+
title: o,
|
|
2458
|
+
closeLabel: l,
|
|
2459
|
+
description: r,
|
|
2460
|
+
icon: ns[u],
|
|
2461
|
+
tone: ts[u],
|
|
2462
|
+
size: "sm",
|
|
2463
|
+
isDismissable: !m,
|
|
2464
|
+
footer: /* @__PURE__ */ _(Je, { children: [
|
|
2465
|
+
/* @__PURE__ */ a(
|
|
2466
|
+
Ze,
|
|
2467
|
+
{
|
|
2468
|
+
variant: ue.SECONDARY,
|
|
2469
|
+
size: Ie.MEDIUM,
|
|
2470
|
+
onClick: n,
|
|
2471
|
+
disabled: m,
|
|
2472
|
+
children: s
|
|
2473
|
+
}
|
|
2474
|
+
),
|
|
2475
|
+
/* @__PURE__ */ a(
|
|
2476
|
+
Ze,
|
|
2477
|
+
{
|
|
2478
|
+
variant: os[u],
|
|
2479
|
+
size: Ie.MEDIUM,
|
|
2480
|
+
onClick: c,
|
|
2481
|
+
isLoading: m,
|
|
2482
|
+
children: i
|
|
2483
|
+
}
|
|
2484
|
+
)
|
|
2485
|
+
] }),
|
|
2486
|
+
children: p
|
|
2487
|
+
}
|
|
2488
|
+
);
|
|
2489
|
+
}, fc = h(is), rs = "hanui-form-zpZn4", ss = {
|
|
2490
|
+
form: rs
|
|
2491
|
+
}, cs = ({
|
|
2492
|
+
isOpen: e,
|
|
2493
|
+
onClose: n,
|
|
2494
|
+
onSubmit: t,
|
|
2495
|
+
title: o,
|
|
2496
|
+
label: r,
|
|
2497
|
+
submitLabel: i,
|
|
2498
|
+
cancelLabel: s,
|
|
2499
|
+
closeLabel: l,
|
|
2500
|
+
description: u,
|
|
2501
|
+
hint: p,
|
|
2502
|
+
placeholder: m,
|
|
2503
|
+
defaultValue: b = "",
|
|
2504
|
+
isRequired: c,
|
|
2505
|
+
requiredLabel: v,
|
|
2506
|
+
inputMode: f = "text",
|
|
2507
|
+
maxLength: C,
|
|
2508
|
+
rows: D = 4
|
|
2509
|
+
}) => {
|
|
2510
|
+
const $ = te(), [N, E] = G(b), [U, q] = G(!1), I = Y(!1);
|
|
2511
|
+
R(() => {
|
|
2512
|
+
e && !I.current && E(b), I.current = e;
|
|
2513
|
+
}, [e, b]);
|
|
2514
|
+
const he = N.trim(), A = !!c && he === "", z = (H) => f === "multiline" ? /* @__PURE__ */ a(
|
|
2515
|
+
ko,
|
|
2516
|
+
{
|
|
2517
|
+
...H,
|
|
2518
|
+
value: N,
|
|
2519
|
+
onChange: (K) => E(K.target.value),
|
|
2520
|
+
placeholder: m,
|
|
2521
|
+
maxLength: C,
|
|
2522
|
+
rows: D
|
|
2523
|
+
}
|
|
2524
|
+
) : /* @__PURE__ */ a(
|
|
2525
|
+
vo,
|
|
2526
|
+
{
|
|
2527
|
+
...H,
|
|
2528
|
+
type: f === "number" ? "number" : "text",
|
|
2529
|
+
value: N,
|
|
2530
|
+
onChange: (K) => E(K.target.value),
|
|
2531
|
+
placeholder: m,
|
|
2532
|
+
maxLength: C
|
|
2533
|
+
}
|
|
2534
|
+
), O = async () => {
|
|
2535
|
+
if (!(A || U)) {
|
|
2536
|
+
q(!0);
|
|
2537
|
+
try {
|
|
2538
|
+
await t(he), n();
|
|
2539
|
+
} catch {
|
|
2540
|
+
} finally {
|
|
2541
|
+
q(!1);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
return /* @__PURE__ */ a(
|
|
2546
|
+
qa,
|
|
2547
|
+
{
|
|
2548
|
+
isOpen: e,
|
|
2549
|
+
onClose: n,
|
|
2550
|
+
title: o,
|
|
2551
|
+
closeLabel: l,
|
|
2552
|
+
description: u,
|
|
2553
|
+
size: "sm",
|
|
2554
|
+
isDismissable: !U,
|
|
2555
|
+
footer: /* @__PURE__ */ _(Je, { children: [
|
|
2556
|
+
/* @__PURE__ */ a(
|
|
2557
|
+
Ze,
|
|
2558
|
+
{
|
|
2559
|
+
variant: ue.SECONDARY,
|
|
2560
|
+
size: Ie.MEDIUM,
|
|
2561
|
+
onClick: n,
|
|
2562
|
+
disabled: U,
|
|
2563
|
+
children: s
|
|
2564
|
+
}
|
|
2565
|
+
),
|
|
2566
|
+
/* @__PURE__ */ a(
|
|
2567
|
+
Ze,
|
|
2568
|
+
{
|
|
2569
|
+
type: "submit",
|
|
2570
|
+
form: $,
|
|
2571
|
+
variant: ue.PRIMARY,
|
|
2572
|
+
size: Ie.MEDIUM,
|
|
2573
|
+
disabled: A,
|
|
2574
|
+
isLoading: U,
|
|
2575
|
+
children: i
|
|
2576
|
+
}
|
|
2577
|
+
)
|
|
2578
|
+
] }),
|
|
2579
|
+
children: /* @__PURE__ */ a(
|
|
2580
|
+
"form",
|
|
2581
|
+
{
|
|
2582
|
+
id: $,
|
|
2583
|
+
className: ss.form,
|
|
2584
|
+
onSubmit: (H) => {
|
|
2585
|
+
H.preventDefault(), O();
|
|
2586
|
+
},
|
|
2587
|
+
children: c ? /* @__PURE__ */ a(xa, { label: r, hint: p, isRequired: !0, requiredLabel: v, children: z }) : /* @__PURE__ */ a(xa, { label: r, hint: p, children: z })
|
|
2588
|
+
}
|
|
2589
|
+
)
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
}, vc = h(cs), ls = "hanui-scroller-EtDmS", ds = "hanui-table-uCv4q", He = {
|
|
2593
|
+
scroller: ls,
|
|
2594
|
+
"scroller--frame": "hanui-scroller--frame-84zz6",
|
|
2595
|
+
table: ds,
|
|
2596
|
+
"table--compact": "hanui-table--compact-4KCVl",
|
|
2597
|
+
"table--regular": "hanui-table--regular-hsA3-",
|
|
2598
|
+
"table--spacious": "hanui-table--spacious-BBUX-",
|
|
2599
|
+
"table--sticky-head": "hanui-table--sticky-head-FO2L4",
|
|
2600
|
+
"table--row-hover": "hanui-table--row-hover--MAoe"
|
|
2601
|
+
}, _s = h(
|
|
2602
|
+
({ hasFrame: e = !0, className: n, children: t, ...o }) => /* @__PURE__ */ a(
|
|
2603
|
+
"div",
|
|
2604
|
+
{
|
|
2605
|
+
className: d(He.scroller, e && He["scroller--frame"], n),
|
|
2606
|
+
...o,
|
|
2607
|
+
children: t
|
|
2608
|
+
}
|
|
2609
|
+
)
|
|
2610
|
+
);
|
|
2611
|
+
_s.displayName = "TableScroller";
|
|
2612
|
+
const us = ({
|
|
2613
|
+
density: e = "regular",
|
|
2614
|
+
hasStickyHead: n,
|
|
2615
|
+
hasRowHover: t,
|
|
2616
|
+
className: o,
|
|
2617
|
+
children: r,
|
|
2618
|
+
...i
|
|
2619
|
+
}) => /* @__PURE__ */ a(
|
|
2620
|
+
"table",
|
|
2621
|
+
{
|
|
2622
|
+
className: d(
|
|
2623
|
+
He.table,
|
|
2624
|
+
He[`table--${e}`],
|
|
2625
|
+
n && He["table--sticky-head"],
|
|
2626
|
+
t && He["table--row-hover"],
|
|
2627
|
+
o
|
|
2628
|
+
),
|
|
2629
|
+
...i,
|
|
2630
|
+
children: r
|
|
2631
|
+
}
|
|
2632
|
+
), yc = h(us), hs = "hanui-wrapper-KXCZg", ps = "hanui-table-LF5Ow", bs = "hanui-state-YPPb0", ms = "hanui-state__message-wwbIW", we = {
|
|
2633
|
+
wrapper: hs,
|
|
2634
|
+
"wrapper--capped": "hanui-wrapper--capped-M2QUJ",
|
|
2635
|
+
table: ps,
|
|
2636
|
+
state: bs,
|
|
2637
|
+
"state--error": "hanui-state--error-A492d",
|
|
2638
|
+
state__message: ms,
|
|
2639
|
+
"row--warning": "hanui-row--warning-BAUN2"
|
|
2640
|
+
}, gs = ({
|
|
2641
|
+
columns: e,
|
|
2642
|
+
children: n,
|
|
2643
|
+
isLoading: t,
|
|
2644
|
+
error: o,
|
|
2645
|
+
emptyMessage: r,
|
|
2646
|
+
loadingMessage: i,
|
|
2647
|
+
hasViewportCap: s,
|
|
2648
|
+
className: l,
|
|
2649
|
+
testId: u
|
|
2650
|
+
}) => {
|
|
2651
|
+
const p = Va.count(n), m = (b, c) => /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
2652
|
+
"td",
|
|
2653
|
+
{
|
|
2654
|
+
colSpan: e.length,
|
|
2655
|
+
className: d(we.state, c && we[`state--${c}`]),
|
|
2656
|
+
children: b
|
|
2657
|
+
}
|
|
2658
|
+
) });
|
|
2659
|
+
return /* @__PURE__ */ a(
|
|
2660
|
+
"div",
|
|
2661
|
+
{
|
|
2662
|
+
className: d(we.wrapper, s && we["wrapper--capped"], l),
|
|
2663
|
+
"data-testid": u,
|
|
2664
|
+
children: /* @__PURE__ */ _("table", { className: we.table, children: [
|
|
2665
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.map((b) => /* @__PURE__ */ a(
|
|
2666
|
+
"th",
|
|
2667
|
+
{
|
|
2668
|
+
scope: "col",
|
|
2669
|
+
"aria-label": b.srLabel,
|
|
2670
|
+
"aria-sort": b.ariaSort,
|
|
2671
|
+
className: b.className,
|
|
2672
|
+
children: b.label
|
|
2673
|
+
},
|
|
2674
|
+
b.key
|
|
2675
|
+
)) }) }),
|
|
2676
|
+
/* @__PURE__ */ a("tbody", { children: o ? m(
|
|
2677
|
+
/* @__PURE__ */ _("span", { role: "alert", className: we.state__message, children: [
|
|
2678
|
+
/* @__PURE__ */ a(Fa, {}),
|
|
2679
|
+
o
|
|
2680
|
+
] }),
|
|
2681
|
+
"error"
|
|
2682
|
+
) : t ? m(i) : p === 0 ? m(r) : n })
|
|
2683
|
+
] })
|
|
2684
|
+
}
|
|
2685
|
+
);
|
|
2686
|
+
}, fs = h(({ isWarning: e, className: n, children: t, ...o }) => /* @__PURE__ */ a("tr", { className: d(e && we["row--warning"], n), ...o, children: t }));
|
|
2687
|
+
fs.displayName = "DataTableRow";
|
|
2688
|
+
const xc = h(gs), vs = "hanui-bar-b4PP4", ys = "hanui-bar__hiddenSubmit-jeCyX", xs = "hanui-bar__actions-rG69L", ks = "hanui-field-f-rvu", Ye = {
|
|
2689
|
+
bar: vs,
|
|
2690
|
+
bar__hiddenSubmit: ys,
|
|
2691
|
+
bar__actions: xs,
|
|
2692
|
+
field: ks,
|
|
2693
|
+
"field--wide": "hanui-field--wide-FA5gf"
|
|
2694
|
+
}, Ns = ({ onSubmit: e, children: n, actions: t, label: o, className: r, testId: i }) => /* @__PURE__ */ _(
|
|
2695
|
+
"form",
|
|
2696
|
+
{
|
|
2697
|
+
className: d(Ye.bar, r),
|
|
2698
|
+
"aria-label": o,
|
|
2699
|
+
"data-testid": i,
|
|
2700
|
+
onSubmit: (s) => {
|
|
2701
|
+
s.preventDefault(), e();
|
|
2702
|
+
},
|
|
2703
|
+
children: [
|
|
2704
|
+
n,
|
|
2705
|
+
/* @__PURE__ */ a("button", { type: "submit", className: Ye.bar__hiddenSubmit, tabIndex: -1, "aria-hidden": !0 }),
|
|
2706
|
+
t && /* @__PURE__ */ a("div", { className: Ye.bar__actions, children: t })
|
|
2707
|
+
]
|
|
2708
|
+
}
|
|
2709
|
+
), ws = h(({ children: e, isWide: n, className: t }) => /* @__PURE__ */ a("div", { className: d(Ye.field, n && Ye["field--wide"], t), children: e }));
|
|
2710
|
+
ws.displayName = "FilterBarField";
|
|
2711
|
+
const kc = h(Ns), $s = "hanui-pagination-K-L20", Ds = "hanui-pagination__list--9HqC", Cs = "hanui-pagination__arrow-XIgoX", Is = "hanui-pagination__page-TpoJM", Ls = "hanui-pagination__gap-qoDyI", _e = {
|
|
2712
|
+
pagination: $s,
|
|
2713
|
+
pagination__list: Ds,
|
|
2714
|
+
pagination__arrow: Cs,
|
|
2715
|
+
pagination__page: Is,
|
|
2716
|
+
"pagination__page--active": "hanui-pagination__page--active-XHeaz",
|
|
2717
|
+
pagination__gap: Ls
|
|
2718
|
+
}, Es = (e, n) => {
|
|
2719
|
+
if (n <= 7) return Array.from({ length: n }, (i, s) => s + 1);
|
|
2720
|
+
const t = /* @__PURE__ */ new Set([1, n, e]);
|
|
2721
|
+
e - 1 > 1 && t.add(e - 1), e + 1 < n && t.add(e + 1);
|
|
2722
|
+
const o = [...t].sort((i, s) => i - s), r = [];
|
|
2723
|
+
return o.forEach((i, s) => {
|
|
2724
|
+
s > 0 && i - o[s - 1] > 1 && r.push("gap"), r.push(i);
|
|
2725
|
+
}), r;
|
|
2726
|
+
}, Ms = ({
|
|
2727
|
+
page: e,
|
|
2728
|
+
totalPages: n,
|
|
2729
|
+
label: t,
|
|
2730
|
+
previousLabel: o,
|
|
2731
|
+
nextLabel: r,
|
|
2732
|
+
buildHref: i,
|
|
2733
|
+
onPageChange: s,
|
|
2734
|
+
linkProps: l,
|
|
2735
|
+
className: u,
|
|
2736
|
+
testId: p
|
|
2737
|
+
}) => {
|
|
2738
|
+
const m = aa(() => Es(e, n), [e, n]);
|
|
2739
|
+
if (n <= 1) return null;
|
|
2740
|
+
const b = (c) => {
|
|
2741
|
+
s && s(c);
|
|
2742
|
+
};
|
|
2743
|
+
return /* @__PURE__ */ _("nav", { className: d(_e.pagination, u), "aria-label": t, "data-testid": p, children: [
|
|
2744
|
+
/* @__PURE__ */ a(
|
|
2745
|
+
ta,
|
|
2746
|
+
{
|
|
2747
|
+
className: _e.pagination__arrow,
|
|
2748
|
+
icon: /* @__PURE__ */ a(vn, {}),
|
|
2749
|
+
label: o,
|
|
2750
|
+
variant: "outline",
|
|
2751
|
+
disabled: e <= 1,
|
|
2752
|
+
onClick: () => b(e - 1)
|
|
2753
|
+
}
|
|
2754
|
+
),
|
|
2755
|
+
/* @__PURE__ */ a("ul", { className: _e.pagination__list, children: m.map(
|
|
2756
|
+
(c, v) => c === "gap" ? /* @__PURE__ */ a("li", { className: _e.pagination__gap, "aria-hidden": !0, children: "…" }, `gap-${v}`) : /* @__PURE__ */ a("li", { children: i ? /* @__PURE__ */ a(
|
|
2757
|
+
oe,
|
|
2758
|
+
{
|
|
2759
|
+
href: i(c),
|
|
2760
|
+
className: d(
|
|
2761
|
+
_e.pagination__page,
|
|
2762
|
+
c === e && _e["pagination__page--active"]
|
|
2763
|
+
),
|
|
2764
|
+
"aria-current": c === e ? "page" : void 0,
|
|
2765
|
+
...l,
|
|
2766
|
+
children: c
|
|
2767
|
+
}
|
|
2768
|
+
) : /* @__PURE__ */ a(
|
|
2769
|
+
Ze,
|
|
2770
|
+
{
|
|
2771
|
+
variant: ue.SECONDARY,
|
|
2772
|
+
size: Ie.SMALL,
|
|
2773
|
+
className: d(
|
|
2774
|
+
_e.pagination__page,
|
|
2775
|
+
c === e && _e["pagination__page--active"]
|
|
2776
|
+
),
|
|
2777
|
+
"aria-current": c === e ? "page" : void 0,
|
|
2778
|
+
onClick: () => b(c),
|
|
2779
|
+
children: c
|
|
2780
|
+
}
|
|
2781
|
+
) }, c)
|
|
2782
|
+
) }),
|
|
2783
|
+
/* @__PURE__ */ a(
|
|
2784
|
+
ta,
|
|
2785
|
+
{
|
|
2786
|
+
className: _e.pagination__arrow,
|
|
2787
|
+
icon: /* @__PURE__ */ a(Ba, {}),
|
|
2788
|
+
label: r,
|
|
2789
|
+
variant: "outline",
|
|
2790
|
+
disabled: e >= n,
|
|
2791
|
+
onClick: () => b(e + 1)
|
|
2792
|
+
}
|
|
2793
|
+
)
|
|
2794
|
+
] });
|
|
2795
|
+
}, Nc = h(Ms);
|
|
2796
|
+
export {
|
|
2797
|
+
ca as ABOVE_MOBILE_MEDIA_QUERY,
|
|
2798
|
+
Ks as ABOVE_TABLET_MEDIA_QUERY,
|
|
2799
|
+
ac as Alert,
|
|
2800
|
+
nc as Avatar,
|
|
2801
|
+
tc as Badge,
|
|
2802
|
+
Pa as BottomSheet,
|
|
2803
|
+
oc as Breadcrumb,
|
|
2804
|
+
Ze as Button,
|
|
2805
|
+
ic as Card,
|
|
2806
|
+
si as CardBody,
|
|
2807
|
+
ci as CardFooter,
|
|
2808
|
+
ii as CardMedia,
|
|
2809
|
+
ri as CardOverlay,
|
|
2810
|
+
Ys as Checkbox,
|
|
2811
|
+
Gn as Chip,
|
|
2812
|
+
Us as ChipGroup,
|
|
2813
|
+
qs as Combobox,
|
|
2814
|
+
fc as ConfirmDialog,
|
|
2815
|
+
rc as CopyField,
|
|
2816
|
+
en as DARK_THEME,
|
|
2817
|
+
Ss as DEFAULT_FONTS,
|
|
2818
|
+
xc as DataTable,
|
|
2819
|
+
fs as DataTableRow,
|
|
2820
|
+
cc as Directory,
|
|
2821
|
+
Ai as DirectoryGroup,
|
|
2822
|
+
Ti as DirectoryJump,
|
|
2823
|
+
Ri as DirectoryRow,
|
|
2824
|
+
sc as Divider,
|
|
2825
|
+
lc as EmptyState,
|
|
2826
|
+
xa as Field,
|
|
2827
|
+
kc as FilterBar,
|
|
2828
|
+
ws as FilterBarField,
|
|
2829
|
+
Os as HanuiProvider,
|
|
2830
|
+
ta as IconButton,
|
|
2831
|
+
vo as Input,
|
|
2832
|
+
Wa as LIGHT_THEME,
|
|
2833
|
+
rn as MOBILE_BREAKPOINT,
|
|
2834
|
+
qa as Modal,
|
|
2835
|
+
dc as PageHeader,
|
|
2836
|
+
Nc as Pagination,
|
|
2837
|
+
_c as Panel,
|
|
2838
|
+
dr as PanelForm,
|
|
2839
|
+
_r as PanelRow,
|
|
2840
|
+
uc as Price,
|
|
2841
|
+
vc as PromptDialog,
|
|
2842
|
+
Ws as QuantityStepper,
|
|
2843
|
+
Zs as Radio,
|
|
2844
|
+
Js as RadioCard,
|
|
2845
|
+
Vs as RangeSlider,
|
|
2846
|
+
hc as Rating,
|
|
2847
|
+
Qs as RatingInput,
|
|
2848
|
+
pc as SectionHeader,
|
|
2849
|
+
Xs as Select,
|
|
2850
|
+
bc as Skeleton,
|
|
2851
|
+
Ea as Spinner,
|
|
2852
|
+
sn as TABLET_BREAKPOINT,
|
|
2853
|
+
zs as TABLET_PORTRAIT_BREAKPOINT,
|
|
2854
|
+
yc as Table,
|
|
2855
|
+
ec as TableCheckbox,
|
|
2856
|
+
_s as TableScroller,
|
|
2857
|
+
mc as Tabs,
|
|
2858
|
+
js as TextLink,
|
|
2859
|
+
ko as Textarea,
|
|
2860
|
+
gc as Tile,
|
|
2861
|
+
Gs as Tooltip,
|
|
2862
|
+
Ie as UISize,
|
|
2863
|
+
ue as UIVariant,
|
|
2864
|
+
an as buildThemeCss,
|
|
2865
|
+
Hs as initHanui,
|
|
2866
|
+
ln as isKeyboardOpeningElement,
|
|
2867
|
+
va as matchesSearch,
|
|
2868
|
+
fa as normalizeSearchTerm,
|
|
2869
|
+
La as preventAutoKeyboard,
|
|
2870
|
+
Fs as resolveTokens,
|
|
2871
|
+
nn as useHanui,
|
|
2872
|
+
Ps as useHanuiTheme,
|
|
2873
|
+
on as useSheetViewport
|
|
2874
|
+
};
|
|
2875
|
+
//# sourceMappingURL=index.js.map
|