@refinn/core-ui 0.1.14 → 0.1.16
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/dist/index.cjs +1048 -794
- package/dist/index.d.mts +66 -30
- package/dist/index.d.ts +66 -30
- package/dist/index.js +1054 -795
- package/dist/theme.css +12 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -173,35 +173,271 @@ var Accordion = forwardRef(
|
|
|
173
173
|
Accordion.displayName = "Accordion";
|
|
174
174
|
|
|
175
175
|
// src/components/AlertBanner/AlertBanner.tsx
|
|
176
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
177
|
+
|
|
178
|
+
// src/components/Button/Button.tsx
|
|
179
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
180
|
+
|
|
181
|
+
// src/components/Loading/Loading.tsx
|
|
176
182
|
import { forwardRef as forwardRef2 } from "react";
|
|
177
|
-
import {
|
|
178
|
-
var
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
184
|
+
var Loading = forwardRef2(
|
|
185
|
+
(_a, ref) => {
|
|
186
|
+
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
187
|
+
const containerClasses = [
|
|
188
|
+
isDark ? "text-white-100" : "text-blue-600",
|
|
189
|
+
className
|
|
190
|
+
].filter(Boolean).join(" ");
|
|
191
|
+
return size === "sm" && !isDark ? /* @__PURE__ */ jsx2("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs2(
|
|
192
|
+
"svg",
|
|
193
|
+
{
|
|
194
|
+
className: "animate-spin",
|
|
195
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
196
|
+
width: "18",
|
|
197
|
+
height: "18",
|
|
198
|
+
viewBox: "0 0 18 18",
|
|
199
|
+
fill: "none",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ jsx2(
|
|
202
|
+
"path",
|
|
203
|
+
{
|
|
204
|
+
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
205
|
+
stroke: "#F3F4F6",
|
|
206
|
+
strokeWidth: "2"
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ jsx2(
|
|
210
|
+
"path",
|
|
211
|
+
{
|
|
212
|
+
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
213
|
+
stroke: "#0193D7",
|
|
214
|
+
strokeWidth: "2"
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
) })) : /* @__PURE__ */ jsx2("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsx2(
|
|
220
|
+
"svg",
|
|
221
|
+
{
|
|
222
|
+
className: "animate-spin",
|
|
223
|
+
width: size === "sm" ? 18 : 88,
|
|
224
|
+
height: size === "sm" ? 18 : 88,
|
|
225
|
+
viewBox: "0 0 20 20",
|
|
226
|
+
fill: "none",
|
|
227
|
+
children: /* @__PURE__ */ jsx2(
|
|
228
|
+
"path",
|
|
229
|
+
{
|
|
230
|
+
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
231
|
+
stroke: "currentColor",
|
|
232
|
+
strokeWidth: size === "sm" ? 2 : 1,
|
|
233
|
+
strokeLinecap: "round"
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
) }));
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
Loading.displayName = "Loading";
|
|
241
|
+
|
|
242
|
+
// src/components/Button/Button.tsx
|
|
243
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
244
|
+
var variantClasses = {
|
|
245
|
+
primary: [
|
|
246
|
+
"bg-blue-600 text-white-100",
|
|
247
|
+
"hover:bg-blue-700",
|
|
248
|
+
"active:bg-blue-800",
|
|
249
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
250
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
251
|
+
].join(" "),
|
|
252
|
+
secondary: [
|
|
253
|
+
"bg-gray-100 text-gray-900",
|
|
254
|
+
"hover:bg-gray-200",
|
|
255
|
+
"active:bg-gray-300",
|
|
256
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
257
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
258
|
+
].join(" "),
|
|
259
|
+
tertiary: [
|
|
260
|
+
"bg-black-0 text-gray-900",
|
|
261
|
+
"hover:bg-gray-200",
|
|
262
|
+
"active:bg-gray-300",
|
|
263
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
264
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
265
|
+
].join(" "),
|
|
266
|
+
contrast: [
|
|
267
|
+
"bg-white-100 text-blue-600",
|
|
268
|
+
"hover:bg-white-90",
|
|
269
|
+
"active:bg-white-80",
|
|
270
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
271
|
+
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
272
|
+
].join(" "),
|
|
273
|
+
transparent: [
|
|
274
|
+
"bg-black-0 text-white-100",
|
|
275
|
+
"hover:bg-white-20",
|
|
276
|
+
"active:bg-white-30",
|
|
277
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
278
|
+
"disabled:bg-black-0 disabled:text-white-40"
|
|
279
|
+
].join(" ")
|
|
184
280
|
};
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
none: "bg-alert-banner-background-common-subtle text-alert-text-primary"
|
|
281
|
+
var sizeClasses = {
|
|
282
|
+
sm: "px-16 py-6 text-label-medium",
|
|
283
|
+
md: "px-20 py-8 text-label-large",
|
|
284
|
+
lg: "px-24 py-12 text-label-large",
|
|
285
|
+
xl: "px-32 py-16 text-label-large"
|
|
191
286
|
};
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
287
|
+
var Button = forwardRef3(
|
|
288
|
+
(_a, ref) => {
|
|
289
|
+
var _b = _a, {
|
|
290
|
+
variant = "primary",
|
|
291
|
+
size = "md",
|
|
292
|
+
rounded = false,
|
|
293
|
+
loading = false,
|
|
294
|
+
disabled = false,
|
|
295
|
+
startIcon,
|
|
296
|
+
endIcon,
|
|
297
|
+
children,
|
|
298
|
+
className = ""
|
|
299
|
+
} = _b, rest = __objRest(_b, [
|
|
300
|
+
"variant",
|
|
301
|
+
"size",
|
|
302
|
+
"rounded",
|
|
303
|
+
"loading",
|
|
304
|
+
"disabled",
|
|
305
|
+
"startIcon",
|
|
306
|
+
"endIcon",
|
|
307
|
+
"children",
|
|
308
|
+
"className"
|
|
309
|
+
]);
|
|
310
|
+
const isDisabled = disabled;
|
|
311
|
+
const classes = [
|
|
312
|
+
"inline-flex items-center justify-center gap-8",
|
|
313
|
+
"transition-colors duration-150",
|
|
314
|
+
"outline-none",
|
|
315
|
+
"disabled:cursor-not-allowed",
|
|
316
|
+
loading ? "pointer-events-none" : "cursor-pointer",
|
|
317
|
+
sizeClasses[size],
|
|
318
|
+
variantClasses[variant],
|
|
319
|
+
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
320
|
+
className
|
|
321
|
+
].filter(Boolean).join(" ");
|
|
322
|
+
return /* @__PURE__ */ jsxs3("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
323
|
+
loading ? /* @__PURE__ */ jsx3(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
324
|
+
children,
|
|
325
|
+
!loading && endIcon
|
|
326
|
+
] }));
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
Button.displayName = "Button";
|
|
330
|
+
|
|
331
|
+
// src/components/IconButton/IconButton.tsx
|
|
332
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
333
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
334
|
+
var sizeClasses2 = {
|
|
335
|
+
xs: "h-24 w-24",
|
|
336
|
+
s: "h-32 w-32",
|
|
337
|
+
m: "h-40 w-40",
|
|
338
|
+
l: "h-48 w-48"
|
|
198
339
|
};
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
340
|
+
var iconSizeClasses = {
|
|
341
|
+
xs: "h-16 w-16",
|
|
342
|
+
s: "h-20 w-20",
|
|
343
|
+
m: "h-24 w-24",
|
|
344
|
+
l: "h-24 w-24"
|
|
345
|
+
};
|
|
346
|
+
var surfaceBackgroundClasses = {
|
|
347
|
+
default: {
|
|
348
|
+
enabled: "bg-icon-button-background-enabled",
|
|
349
|
+
hover: "hover:bg-icon-button-background-hover",
|
|
350
|
+
active: "active:bg-icon-button-background-active"
|
|
351
|
+
},
|
|
352
|
+
dark: {
|
|
353
|
+
enabled: "bg-icon-button-background-dark-transparent-enabled",
|
|
354
|
+
hover: "hover:bg-icon-button-background-dark-transparent-hover",
|
|
355
|
+
active: "active:bg-icon-button-background-dark-transparent-active"
|
|
356
|
+
},
|
|
357
|
+
light: {
|
|
358
|
+
enabled: "bg-icon-button-background-light-transparent-enabled",
|
|
359
|
+
hover: "hover:bg-icon-button-background-light-transparent-hover",
|
|
360
|
+
active: "active:bg-icon-button-background-light-transparent-active"
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
var surfaceIconClasses = {
|
|
364
|
+
default: {
|
|
365
|
+
primary: "text-icon-button-icon-primary",
|
|
366
|
+
danger: "text-icon-button-icon-danger",
|
|
367
|
+
disabled: "text-icon-button-icon-disabled"
|
|
368
|
+
},
|
|
369
|
+
dark: {
|
|
370
|
+
primary: "text-icon-button-icon-inverse",
|
|
371
|
+
danger: "text-icon-button-icon-inverse-danger",
|
|
372
|
+
disabled: "text-icon-button-icon-inverse-disabled"
|
|
373
|
+
},
|
|
374
|
+
light: {
|
|
375
|
+
primary: "text-icon-button-icon-inverse",
|
|
376
|
+
danger: "text-icon-button-icon-inverse-danger",
|
|
377
|
+
disabled: "text-icon-button-icon-inverse-disabled"
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
var IconButton = forwardRef4(
|
|
381
|
+
(_a, ref) => {
|
|
382
|
+
var _b = _a, {
|
|
383
|
+
icon,
|
|
384
|
+
size = "s",
|
|
385
|
+
surface = "default",
|
|
386
|
+
transparent = false,
|
|
387
|
+
danger = false,
|
|
388
|
+
disabled = false,
|
|
389
|
+
className = ""
|
|
390
|
+
} = _b, rest = __objRest(_b, [
|
|
391
|
+
"icon",
|
|
392
|
+
"size",
|
|
393
|
+
"surface",
|
|
394
|
+
"transparent",
|
|
395
|
+
"danger",
|
|
396
|
+
"disabled",
|
|
397
|
+
"className"
|
|
398
|
+
]);
|
|
399
|
+
const background = surfaceBackgroundClasses[surface];
|
|
400
|
+
const iconColor = surfaceIconClasses[surface];
|
|
401
|
+
const classes = [
|
|
402
|
+
"inline-flex shrink-0 items-center justify-center rounded-full transition-colors",
|
|
403
|
+
"focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-icon-button-border-focus",
|
|
404
|
+
sizeClasses2[size],
|
|
405
|
+
transparent ? "bg-icon-button-background-transparent" : background.enabled,
|
|
406
|
+
disabled ? `cursor-not-allowed ${iconColor.disabled}` : [
|
|
407
|
+
"cursor-pointer",
|
|
408
|
+
background.hover,
|
|
409
|
+
background.active,
|
|
410
|
+
danger ? iconColor.danger : iconColor.primary
|
|
411
|
+
].join(" "),
|
|
412
|
+
className
|
|
413
|
+
].filter(Boolean).join(" ");
|
|
414
|
+
return /* @__PURE__ */ jsx4("button", __spreadProps(__spreadValues({ ref, type: "button", disabled, className: classes }, rest), { children: /* @__PURE__ */ jsx4("span", { className: `shrink-0 flex items-center justify-center ${iconSizeClasses[size]}`, children: icon }) }));
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
IconButton.displayName = "IconButton";
|
|
418
|
+
|
|
419
|
+
// src/components/AlertBanner/AlertBanner.tsx
|
|
420
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
421
|
+
var pageBgClasses = {
|
|
422
|
+
info: "bg-alert-page-info-bg",
|
|
423
|
+
success: "bg-alert-page-success-bg",
|
|
424
|
+
warning: "bg-alert-page-warning-bg",
|
|
425
|
+
danger: "bg-alert-page-danger-bg",
|
|
426
|
+
none: "bg-alert-page-common-bg"
|
|
427
|
+
};
|
|
428
|
+
var pageTextIsDark = {
|
|
429
|
+
info: false,
|
|
430
|
+
success: false,
|
|
431
|
+
warning: true,
|
|
432
|
+
danger: false,
|
|
433
|
+
none: false
|
|
434
|
+
};
|
|
435
|
+
var sectionBgClasses = {
|
|
436
|
+
info: "bg-alert-banner-background-info-subtle",
|
|
437
|
+
success: "bg-alert-banner-background-success-subtle",
|
|
438
|
+
warning: "bg-alert-banner-background-warning-subtle",
|
|
439
|
+
danger: "bg-alert-banner-background-danger-subtle",
|
|
440
|
+
none: "bg-alert-banner-background-common-subtle"
|
|
205
441
|
};
|
|
206
442
|
var inlineIconClasses = {
|
|
207
443
|
info: "text-alert-inline-info-icon",
|
|
@@ -211,25 +447,25 @@ var inlineIconClasses = {
|
|
|
211
447
|
none: "text-alert-inline-common-icon"
|
|
212
448
|
};
|
|
213
449
|
function InfoIcon({ className }) {
|
|
214
|
-
return /* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM9 8.5h2V14H9V8.5ZM9 6h2v1.5H9V6Z" }) });
|
|
215
451
|
}
|
|
216
452
|
function SuccessIcon({ className }) {
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */ jsx2("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
219
|
-
/* @__PURE__ */ jsx2("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
220
|
-
] });
|
|
453
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.8 13.2 6.3 10.7 7.4 9.6 8.8 11 12.9 6.9 14 8 8.8 13.2Z" }) });
|
|
221
454
|
}
|
|
222
455
|
function WarningIcon({ className }) {
|
|
223
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.87 3.2a1 1 0 0 0-1.74 0L1.6 16.5A1 1 0 0 0 2.47 18h15.06a1 1 0 0 0 .87-1.5L10.87 3.2ZM9.1 8h1.8v4.2H9.1V8ZM9.1 13.3h1.8V15H9.1v-1.7Z" }) });
|
|
224
457
|
}
|
|
225
458
|
function DangerIcon({ className }) {
|
|
226
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM9 5.5h2V11H9V5.5ZM9 13h2v1.5H9V13Z" }) });
|
|
227
460
|
}
|
|
228
|
-
function NoneIcon(
|
|
229
|
-
return
|
|
461
|
+
function NoneIcon() {
|
|
462
|
+
return null;
|
|
230
463
|
}
|
|
231
464
|
function CloseIcon({ className }) {
|
|
232
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
466
|
+
}
|
|
467
|
+
function ArrowRightIcon({ className }) {
|
|
468
|
+
return /* @__PURE__ */ jsx5("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M4 10h12M11 5l5 5-5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
233
469
|
}
|
|
234
470
|
var defaultIcons = {
|
|
235
471
|
info: InfoIcon,
|
|
@@ -238,14 +474,15 @@ var defaultIcons = {
|
|
|
238
474
|
danger: DangerIcon,
|
|
239
475
|
none: NoneIcon
|
|
240
476
|
};
|
|
241
|
-
var AlertBanner =
|
|
477
|
+
var AlertBanner = forwardRef5(
|
|
242
478
|
(_a, ref) => {
|
|
243
479
|
var _b = _a, {
|
|
244
480
|
variant = "info",
|
|
245
481
|
mode = "inline",
|
|
246
482
|
title,
|
|
247
483
|
description,
|
|
248
|
-
|
|
484
|
+
buttonAction,
|
|
485
|
+
buttonLink,
|
|
249
486
|
icon,
|
|
250
487
|
onClose,
|
|
251
488
|
className = "",
|
|
@@ -255,7 +492,8 @@ var AlertBanner = forwardRef2(
|
|
|
255
492
|
"mode",
|
|
256
493
|
"title",
|
|
257
494
|
"description",
|
|
258
|
-
"
|
|
495
|
+
"buttonAction",
|
|
496
|
+
"buttonLink",
|
|
259
497
|
"icon",
|
|
260
498
|
"onClose",
|
|
261
499
|
"className",
|
|
@@ -263,49 +501,73 @@ var AlertBanner = forwardRef2(
|
|
|
263
501
|
]);
|
|
264
502
|
const isPage = mode === "page";
|
|
265
503
|
const isSection = mode === "section";
|
|
266
|
-
const
|
|
267
|
-
const
|
|
504
|
+
const isStacked = Boolean(buttonAction);
|
|
505
|
+
const pageIsDark = isPage && pageTextIsDark[variant];
|
|
506
|
+
const bgClass = isPage ? pageBgClasses[variant] : isSection ? sectionBgClasses[variant] : "bg-alert-banner-background-transparent";
|
|
268
507
|
const DefaultIcon = defaultIcons[variant];
|
|
269
|
-
const iconColorClass = isPage ? "" : inlineIconClasses[variant];
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
|
|
508
|
+
const iconColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-white-100" : inlineIconClasses[variant];
|
|
509
|
+
const titleColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-alert-text-primary-inverse" : "text-alert-text-primary";
|
|
510
|
+
const descColorClass = isPage ? pageIsDark ? "text-alert-text-secondary" : "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
511
|
+
const linkColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-white-100" : "text-enabled";
|
|
512
|
+
const closeButtonSurface = isPage ? "dark" : "default";
|
|
513
|
+
const containerClasses = [
|
|
514
|
+
"flex font-sans",
|
|
515
|
+
isStacked ? "flex-col items-start gap-8" : "items-center gap-24",
|
|
274
516
|
isPage ? "p-12" : isSection ? "p-12 rounded-md" : "p-0",
|
|
275
|
-
|
|
517
|
+
bgClass,
|
|
276
518
|
className
|
|
277
519
|
].filter(Boolean).join(" ");
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
icon != null ? icon : /* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
title && /* @__PURE__ */
|
|
283
|
-
description && /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ jsxs4("div", __spreadProps(__spreadValues({ ref, role: "alert", className: containerClasses }, rest), { children: [
|
|
521
|
+
/* @__PURE__ */ jsxs4("div", { className: `flex w-full items-start gap-8 ${isStacked ? "" : "flex-1 min-w-0"}`, children: [
|
|
522
|
+
icon != null ? icon : /* @__PURE__ */ jsx5(DefaultIcon, { className: `h-20 w-20 shrink-0 ${iconColorClass}` }),
|
|
523
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-1 min-w-0 flex flex-col gap-2", children: [
|
|
524
|
+
title && /* @__PURE__ */ jsx5("p", { className: `text-label-medium ${titleColorClass}`, children: title }),
|
|
525
|
+
description && /* @__PURE__ */ jsx5("p", { className: `text-body-small ${descColorClass}`, children: description }),
|
|
284
526
|
children
|
|
285
|
-
] })
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
527
|
+
] }),
|
|
528
|
+
!isStacked && buttonLink && /* @__PURE__ */ jsx5(
|
|
529
|
+
"a",
|
|
530
|
+
{
|
|
531
|
+
href: buttonLink.href,
|
|
532
|
+
onClick: buttonLink.onClick,
|
|
533
|
+
className: `shrink-0 self-center text-link-small font-medium underline ${linkColorClass}`,
|
|
534
|
+
children: buttonLink.label
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
onClose && /* @__PURE__ */ jsx5(
|
|
538
|
+
IconButton,
|
|
291
539
|
{
|
|
292
|
-
|
|
540
|
+
size: "s",
|
|
541
|
+
surface: closeButtonSurface,
|
|
542
|
+
transparent: true,
|
|
293
543
|
onClick: onClose,
|
|
294
|
-
className:
|
|
295
|
-
"aria-label": "
|
|
296
|
-
|
|
544
|
+
className: "shrink-0",
|
|
545
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
546
|
+
icon: /* @__PURE__ */ jsx5(CloseIcon, { className: "h-16 w-16" })
|
|
297
547
|
}
|
|
298
548
|
)
|
|
299
|
-
] })
|
|
549
|
+
] }),
|
|
550
|
+
isStacked && buttonAction && /* @__PURE__ */ jsx5("div", { className: "flex w-full items-start gap-12 pl-28", children: isPage ? /* @__PURE__ */ jsx5(Button, { variant: "secondary", size: "sm", onClick: buttonAction.onClick, children: buttonAction.label }) : /* @__PURE__ */ jsxs4(
|
|
551
|
+
"a",
|
|
552
|
+
{
|
|
553
|
+
href: buttonAction.href,
|
|
554
|
+
onClick: buttonAction.onClick,
|
|
555
|
+
className: "flex items-center gap-2 text-link-small font-medium text-enabled",
|
|
556
|
+
children: [
|
|
557
|
+
buttonAction.label,
|
|
558
|
+
/* @__PURE__ */ jsx5(ArrowRightIcon, { className: "h-20 w-20" })
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
) })
|
|
300
562
|
] }));
|
|
301
563
|
}
|
|
302
564
|
);
|
|
303
565
|
AlertBanner.displayName = "AlertBanner";
|
|
304
566
|
|
|
305
567
|
// src/components/Avatar/Avatar.tsx
|
|
306
|
-
import { forwardRef as
|
|
307
|
-
import { jsx as
|
|
308
|
-
var
|
|
568
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
569
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
570
|
+
var sizeClasses3 = {
|
|
309
571
|
sm: { container: "h-24 w-24", text: "text-sm", status: "h-6 w-6", statusRing: "ring-1" },
|
|
310
572
|
md: { container: "h-32 w-32", text: "text-base", status: "h-8 w-8", statusRing: "ring-[1.5px]" },
|
|
311
573
|
lg: { container: "h-40 w-40", text: "text-lg", status: "h-10 w-10", statusRing: "ring-2" },
|
|
@@ -323,9 +585,9 @@ function getInitials(name) {
|
|
|
323
585
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
324
586
|
}
|
|
325
587
|
function PersonIcon({ className }) {
|
|
326
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsx6("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx6("path", { d: "M10 10a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5ZM3.75 17.5a6.25 6.25 0 0 1 12.5 0" }) });
|
|
327
589
|
}
|
|
328
|
-
var Avatar =
|
|
590
|
+
var Avatar = forwardRef6(
|
|
329
591
|
(_a, ref) => {
|
|
330
592
|
var _b = _a, {
|
|
331
593
|
size = "md",
|
|
@@ -344,7 +606,7 @@ var Avatar = forwardRef3(
|
|
|
344
606
|
"status",
|
|
345
607
|
"className"
|
|
346
608
|
]);
|
|
347
|
-
const sz =
|
|
609
|
+
const sz = sizeClasses3[size];
|
|
348
610
|
const containerClasses = [
|
|
349
611
|
"relative inline-flex items-center justify-center shrink-0 rounded-full",
|
|
350
612
|
"bg-avatar-bg text-avatar-text font-medium font-sans",
|
|
@@ -355,7 +617,7 @@ var Avatar = forwardRef3(
|
|
|
355
617
|
].filter(Boolean).join(" ");
|
|
356
618
|
let content;
|
|
357
619
|
if (src) {
|
|
358
|
-
content = /* @__PURE__ */
|
|
620
|
+
content = /* @__PURE__ */ jsx6(
|
|
359
621
|
"img",
|
|
360
622
|
{
|
|
361
623
|
src,
|
|
@@ -366,13 +628,13 @@ var Avatar = forwardRef3(
|
|
|
366
628
|
} else if (icon) {
|
|
367
629
|
content = icon;
|
|
368
630
|
} else if (name) {
|
|
369
|
-
content = /* @__PURE__ */
|
|
631
|
+
content = /* @__PURE__ */ jsx6("span", { className: sz.text, children: getInitials(name) });
|
|
370
632
|
} else {
|
|
371
|
-
content = /* @__PURE__ */
|
|
633
|
+
content = /* @__PURE__ */ jsx6(PersonIcon, { className: `${sz.text} h-[60%] w-[60%]` });
|
|
372
634
|
}
|
|
373
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ jsxs5("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: [
|
|
374
636
|
content,
|
|
375
|
-
status && /* @__PURE__ */
|
|
637
|
+
status && /* @__PURE__ */ jsx6(
|
|
376
638
|
"span",
|
|
377
639
|
{
|
|
378
640
|
className: [
|
|
@@ -390,14 +652,14 @@ var Avatar = forwardRef3(
|
|
|
390
652
|
Avatar.displayName = "Avatar";
|
|
391
653
|
|
|
392
654
|
// src/components/Badge/Badge.tsx
|
|
393
|
-
import { forwardRef as
|
|
394
|
-
import { jsx as
|
|
395
|
-
var
|
|
655
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
656
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
657
|
+
var sizeClasses4 = {
|
|
396
658
|
sm: "h-20 px-8 py-2 text-label-small gap-4",
|
|
397
659
|
md: "h-28 px-10 py-4 text-label-medium gap-4",
|
|
398
660
|
lg: "h-32 px-14 py-6 text-label-large gap-6"
|
|
399
661
|
};
|
|
400
|
-
var
|
|
662
|
+
var iconSizeClasses2 = {
|
|
401
663
|
sm: "h-16 w-16",
|
|
402
664
|
md: "h-20 w-20",
|
|
403
665
|
lg: "h-24 w-24"
|
|
@@ -431,7 +693,7 @@ var styleMap = {
|
|
|
431
693
|
subtle: subtleClasses,
|
|
432
694
|
bold: boldClasses
|
|
433
695
|
};
|
|
434
|
-
var Badge =
|
|
696
|
+
var Badge = forwardRef7(
|
|
435
697
|
(_a, ref) => {
|
|
436
698
|
var _b = _a, {
|
|
437
699
|
status = "common",
|
|
@@ -453,13 +715,13 @@ var Badge = forwardRef4(
|
|
|
453
715
|
const classes = [
|
|
454
716
|
"inline-flex items-center justify-center font-medium font-sans",
|
|
455
717
|
"whitespace-nowrap select-none",
|
|
456
|
-
|
|
718
|
+
sizeClasses4[size],
|
|
457
719
|
shape === "round" ? "rounded-full" : `rounded-${size}`,
|
|
458
720
|
styleMap[badgeStyle][status],
|
|
459
721
|
className
|
|
460
722
|
].filter(Boolean).join(" ");
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
icon && /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsxs6("span", __spreadProps(__spreadValues({ ref, className: classes }, rest), { children: [
|
|
724
|
+
icon && /* @__PURE__ */ jsx7("span", { className: `shrink-0 ${iconSizeClasses2[size]}`, children: icon }),
|
|
463
725
|
children
|
|
464
726
|
] }));
|
|
465
727
|
}
|
|
@@ -468,19 +730,19 @@ Badge.displayName = "Badge";
|
|
|
468
730
|
|
|
469
731
|
// src/components/Branding/Branding.tsx
|
|
470
732
|
import {
|
|
471
|
-
forwardRef as
|
|
733
|
+
forwardRef as forwardRef8
|
|
472
734
|
} from "react";
|
|
473
|
-
import { jsx as
|
|
474
|
-
var Branding =
|
|
735
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
736
|
+
var Branding = forwardRef8(
|
|
475
737
|
(_a, ref) => {
|
|
476
738
|
var _b = _a, { type = "brand", className = "" } = _b, rest = __objRest(_b, ["type", "className"]);
|
|
477
|
-
return /* @__PURE__ */
|
|
739
|
+
return /* @__PURE__ */ jsx8(
|
|
478
740
|
"div",
|
|
479
741
|
__spreadProps(__spreadValues({
|
|
480
742
|
ref,
|
|
481
743
|
className: `${type === "black" ? "text-gray-900" : type === "white" ? "text-white-100" : "text-blue-600"} ${className}`
|
|
482
744
|
}, rest), {
|
|
483
|
-
children: /* @__PURE__ */
|
|
745
|
+
children: /* @__PURE__ */ jsxs7(
|
|
484
746
|
"svg",
|
|
485
747
|
{
|
|
486
748
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -489,8 +751,8 @@ var Branding = forwardRef5(
|
|
|
489
751
|
viewBox: "0 0 89 20",
|
|
490
752
|
fill: "currentColor",
|
|
491
753
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsxs7("g", { clipPath: "url(#clip0_828_998)", children: [
|
|
755
|
+
/* @__PURE__ */ jsx8(
|
|
494
756
|
"path",
|
|
495
757
|
{
|
|
496
758
|
fillRule: "evenodd",
|
|
@@ -499,14 +761,14 @@ var Branding = forwardRef5(
|
|
|
499
761
|
fill: "currentColor"
|
|
500
762
|
}
|
|
501
763
|
),
|
|
502
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx8(
|
|
503
765
|
"path",
|
|
504
766
|
{
|
|
505
767
|
d: "M30.3851 15.1575C31.5816 13.5 34.0989 15.2805 32.9023 16.9379C31.9828 18.1966 30.3241 19.854 27.2241 19.823C23.6241 19.823 20.5575 16.7195 20.4736 12.6379C20.4671 12.5169 20.4671 12.3957 20.4736 12.2747C20.5621 8.18966 23.6241 5.08966 27.1931 5.08966H27.2241C30.815 5.08966 33.977 8.28162 33.977 12.4563C33.979 12.6584 33.9407 12.8588 33.8643 13.0459C33.7879 13.233 33.6749 13.4029 33.532 13.5458C33.3891 13.6887 33.2192 13.8017 33.0321 13.8781C32.845 13.9545 32.6446 13.9928 32.4425 13.9908H23.7851C24.3046 15.5667 25.6023 16.7494 27.223 16.7494H27.254C28.9736 16.7816 29.8943 15.8621 30.3851 15.1575ZM23.7851 10.9195H30.9115C30.9115 10.1828 29.346 8.16093 27.2333 8.16093C25.6023 8.16093 24.3046 9.34598 23.7851 10.9195Z",
|
|
506
768
|
fill: "currentColor"
|
|
507
769
|
}
|
|
508
770
|
),
|
|
509
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ jsx8(
|
|
510
772
|
"path",
|
|
511
773
|
{
|
|
512
774
|
fillRule: "evenodd",
|
|
@@ -515,7 +777,7 @@ var Branding = forwardRef5(
|
|
|
515
777
|
fill: "currentColor"
|
|
516
778
|
}
|
|
517
779
|
),
|
|
518
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ jsx8(
|
|
519
781
|
"path",
|
|
520
782
|
{
|
|
521
783
|
fillRule: "evenodd",
|
|
@@ -524,7 +786,7 @@ var Branding = forwardRef5(
|
|
|
524
786
|
fill: "currentColor"
|
|
525
787
|
}
|
|
526
788
|
),
|
|
527
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ jsx8(
|
|
528
790
|
"path",
|
|
529
791
|
{
|
|
530
792
|
fillRule: "evenodd",
|
|
@@ -533,7 +795,7 @@ var Branding = forwardRef5(
|
|
|
533
795
|
fill: "currentColor"
|
|
534
796
|
}
|
|
535
797
|
),
|
|
536
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ jsx8(
|
|
537
799
|
"path",
|
|
538
800
|
{
|
|
539
801
|
fillRule: "evenodd",
|
|
@@ -542,7 +804,7 @@ var Branding = forwardRef5(
|
|
|
542
804
|
fill: "currentColor"
|
|
543
805
|
}
|
|
544
806
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ jsx8(
|
|
546
808
|
"path",
|
|
547
809
|
{
|
|
548
810
|
fillRule: "evenodd",
|
|
@@ -552,7 +814,7 @@ var Branding = forwardRef5(
|
|
|
552
814
|
}
|
|
553
815
|
)
|
|
554
816
|
] }),
|
|
555
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ jsx8("defs", { children: /* @__PURE__ */ jsx8("clipPath", { id: "clip0_828_998", children: /* @__PURE__ */ jsx8("rect", { width: "88.892", height: "20", fill: "currentColor" }) }) })
|
|
556
818
|
]
|
|
557
819
|
}
|
|
558
820
|
)
|
|
@@ -562,175 +824,22 @@ var Branding = forwardRef5(
|
|
|
562
824
|
);
|
|
563
825
|
Branding.displayName = "Branding";
|
|
564
826
|
|
|
565
|
-
// src/components/Button/Button.tsx
|
|
566
|
-
import { forwardRef as forwardRef7 } from "react";
|
|
567
|
-
|
|
568
|
-
// src/components/Loading/Loading.tsx
|
|
569
|
-
import { forwardRef as forwardRef6 } from "react";
|
|
570
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
571
|
-
var Loading = forwardRef6(
|
|
572
|
-
(_a, ref) => {
|
|
573
|
-
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
574
|
-
const containerClasses = [
|
|
575
|
-
isDark ? "text-white-100" : "text-blue-600",
|
|
576
|
-
className
|
|
577
|
-
].filter(Boolean).join(" ");
|
|
578
|
-
return size === "sm" && !isDark ? /* @__PURE__ */ jsx6("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs6(
|
|
579
|
-
"svg",
|
|
580
|
-
{
|
|
581
|
-
className: "animate-spin",
|
|
582
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
583
|
-
width: "18",
|
|
584
|
-
height: "18",
|
|
585
|
-
viewBox: "0 0 18 18",
|
|
586
|
-
fill: "none",
|
|
587
|
-
children: [
|
|
588
|
-
/* @__PURE__ */ jsx6(
|
|
589
|
-
"path",
|
|
590
|
-
{
|
|
591
|
-
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
592
|
-
stroke: "#F3F4F6",
|
|
593
|
-
strokeWidth: "2"
|
|
594
|
-
}
|
|
595
|
-
),
|
|
596
|
-
/* @__PURE__ */ jsx6(
|
|
597
|
-
"path",
|
|
598
|
-
{
|
|
599
|
-
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
600
|
-
stroke: "#0193D7",
|
|
601
|
-
strokeWidth: "2"
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
]
|
|
605
|
-
}
|
|
606
|
-
) })) : /* @__PURE__ */ jsx6("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsx6(
|
|
607
|
-
"svg",
|
|
608
|
-
{
|
|
609
|
-
className: "animate-spin",
|
|
610
|
-
width: size === "sm" ? 18 : 88,
|
|
611
|
-
height: size === "sm" ? 18 : 88,
|
|
612
|
-
viewBox: "0 0 20 20",
|
|
613
|
-
fill: "none",
|
|
614
|
-
children: /* @__PURE__ */ jsx6(
|
|
615
|
-
"path",
|
|
616
|
-
{
|
|
617
|
-
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
618
|
-
stroke: "currentColor",
|
|
619
|
-
strokeWidth: size === "sm" ? 2 : 1,
|
|
620
|
-
strokeLinecap: "round"
|
|
621
|
-
}
|
|
622
|
-
)
|
|
623
|
-
}
|
|
624
|
-
) }));
|
|
625
|
-
}
|
|
626
|
-
);
|
|
627
|
-
Loading.displayName = "Loading";
|
|
628
|
-
|
|
629
|
-
// src/components/Button/Button.tsx
|
|
630
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
631
|
-
var variantClasses = {
|
|
632
|
-
primary: [
|
|
633
|
-
"bg-blue-600 text-white-100",
|
|
634
|
-
"hover:bg-blue-700",
|
|
635
|
-
"active:bg-blue-800",
|
|
636
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
637
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
638
|
-
].join(" "),
|
|
639
|
-
secondary: [
|
|
640
|
-
"bg-gray-100 text-gray-900",
|
|
641
|
-
"hover:bg-gray-200",
|
|
642
|
-
"active:bg-gray-300",
|
|
643
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
644
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
645
|
-
].join(" "),
|
|
646
|
-
tertiary: [
|
|
647
|
-
"bg-black-0 text-gray-900",
|
|
648
|
-
"hover:bg-gray-200",
|
|
649
|
-
"active:bg-gray-300",
|
|
650
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
651
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
652
|
-
].join(" "),
|
|
653
|
-
contrast: [
|
|
654
|
-
"bg-white-100 text-blue-600",
|
|
655
|
-
"hover:bg-white-90",
|
|
656
|
-
"active:bg-white-80",
|
|
657
|
-
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
658
|
-
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
659
|
-
].join(" "),
|
|
660
|
-
transparent: [
|
|
661
|
-
"bg-black-0 text-white-100",
|
|
662
|
-
"hover:bg-white-20",
|
|
663
|
-
"active:bg-white-30",
|
|
664
|
-
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
665
|
-
"disabled:bg-black-0 disabled:text-white-40"
|
|
666
|
-
].join(" ")
|
|
667
|
-
};
|
|
668
|
-
var sizeClasses3 = {
|
|
669
|
-
sm: "px-16 py-6 text-label-medium",
|
|
670
|
-
md: "px-20 py-8 text-label-large",
|
|
671
|
-
lg: "px-24 py-12 text-label-large",
|
|
672
|
-
xl: "px-32 py-16 text-label-large"
|
|
673
|
-
};
|
|
674
|
-
var Button = forwardRef7(
|
|
675
|
-
(_a, ref) => {
|
|
676
|
-
var _b = _a, {
|
|
677
|
-
variant = "primary",
|
|
678
|
-
size = "md",
|
|
679
|
-
rounded = false,
|
|
680
|
-
loading = false,
|
|
681
|
-
disabled = false,
|
|
682
|
-
startIcon,
|
|
683
|
-
endIcon,
|
|
684
|
-
children,
|
|
685
|
-
className = ""
|
|
686
|
-
} = _b, rest = __objRest(_b, [
|
|
687
|
-
"variant",
|
|
688
|
-
"size",
|
|
689
|
-
"rounded",
|
|
690
|
-
"loading",
|
|
691
|
-
"disabled",
|
|
692
|
-
"startIcon",
|
|
693
|
-
"endIcon",
|
|
694
|
-
"children",
|
|
695
|
-
"className"
|
|
696
|
-
]);
|
|
697
|
-
const isDisabled = disabled;
|
|
698
|
-
const classes = [
|
|
699
|
-
"inline-flex items-center justify-center gap-8",
|
|
700
|
-
"transition-colors duration-150",
|
|
701
|
-
"outline-none",
|
|
702
|
-
"disabled:cursor-not-allowed",
|
|
703
|
-
loading ? "pointer-events-none" : "cursor-pointer",
|
|
704
|
-
sizeClasses3[size],
|
|
705
|
-
variantClasses[variant],
|
|
706
|
-
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
707
|
-
className
|
|
708
|
-
].filter(Boolean).join(" ");
|
|
709
|
-
return /* @__PURE__ */ jsxs7("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
710
|
-
loading ? /* @__PURE__ */ jsx7(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
711
|
-
children,
|
|
712
|
-
!loading && endIcon
|
|
713
|
-
] }));
|
|
714
|
-
}
|
|
715
|
-
);
|
|
716
|
-
Button.displayName = "Button";
|
|
717
|
-
|
|
718
827
|
// src/components/Checkbox/Checkbox.tsx
|
|
719
828
|
import {
|
|
720
|
-
forwardRef as
|
|
829
|
+
forwardRef as forwardRef9,
|
|
721
830
|
useId as useId2,
|
|
722
831
|
useState as useState2
|
|
723
832
|
} from "react";
|
|
724
|
-
import { jsx as
|
|
833
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
725
834
|
function CheckIcon({ className }) {
|
|
726
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ jsx9(
|
|
727
836
|
"svg",
|
|
728
837
|
{
|
|
729
838
|
className,
|
|
730
839
|
viewBox: "0 0 16 16",
|
|
731
840
|
fill: "none",
|
|
732
841
|
"aria-hidden": "true",
|
|
733
|
-
children: /* @__PURE__ */
|
|
842
|
+
children: /* @__PURE__ */ jsx9(
|
|
734
843
|
"path",
|
|
735
844
|
{
|
|
736
845
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -744,14 +853,14 @@ function CheckIcon({ className }) {
|
|
|
744
853
|
);
|
|
745
854
|
}
|
|
746
855
|
function IndeterminateIcon({ className }) {
|
|
747
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ jsx9(
|
|
748
857
|
"svg",
|
|
749
858
|
{
|
|
750
859
|
className,
|
|
751
860
|
viewBox: "0 0 16 16",
|
|
752
861
|
fill: "none",
|
|
753
862
|
"aria-hidden": "true",
|
|
754
|
-
children: /* @__PURE__ */
|
|
863
|
+
children: /* @__PURE__ */ jsx9(
|
|
755
864
|
"path",
|
|
756
865
|
{
|
|
757
866
|
d: "M3.333 8h9.334",
|
|
@@ -775,7 +884,7 @@ var descriptionPaddingClasses = {
|
|
|
775
884
|
s: "pl-24",
|
|
776
885
|
m: "pl-28"
|
|
777
886
|
};
|
|
778
|
-
var Checkbox =
|
|
887
|
+
var Checkbox = forwardRef9(
|
|
779
888
|
(_a, ref) => {
|
|
780
889
|
var _b = _a, {
|
|
781
890
|
size = "s",
|
|
@@ -849,7 +958,7 @@ var Checkbox = forwardRef8(
|
|
|
849
958
|
children: [
|
|
850
959
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
|
|
851
960
|
/* @__PURE__ */ jsxs8("div", { className: "relative shrink-0", children: [
|
|
852
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ jsx9(
|
|
853
962
|
"input",
|
|
854
963
|
__spreadValues({
|
|
855
964
|
ref,
|
|
@@ -866,16 +975,16 @@ var Checkbox = forwardRef8(
|
|
|
866
975
|
className: "peer sr-only"
|
|
867
976
|
}, rest)
|
|
868
977
|
),
|
|
869
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsx9(
|
|
870
979
|
"div",
|
|
871
980
|
{
|
|
872
981
|
className: `flex items-center justify-center rounded-md border transition-colors ${boxSizeClasses[size]} ${bgClass} ${borderClass} ${hoverClass} ${ringClass} peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2`,
|
|
873
|
-
children: isChecked ? /* @__PURE__ */
|
|
982
|
+
children: isChecked ? /* @__PURE__ */ jsx9(
|
|
874
983
|
CheckIcon,
|
|
875
984
|
{
|
|
876
985
|
className: `${boxSizeClasses[size]} ${iconColorClass}`
|
|
877
986
|
}
|
|
878
|
-
) : indeterminate ? /* @__PURE__ */
|
|
987
|
+
) : indeterminate ? /* @__PURE__ */ jsx9(
|
|
879
988
|
IndeterminateIcon,
|
|
880
989
|
{
|
|
881
990
|
className: `${boxSizeClasses[size]} ${iconColorClass}`
|
|
@@ -884,9 +993,9 @@ var Checkbox = forwardRef8(
|
|
|
884
993
|
}
|
|
885
994
|
)
|
|
886
995
|
] }),
|
|
887
|
-
label && /* @__PURE__ */
|
|
996
|
+
label && /* @__PURE__ */ jsx9("span", { className: `${labelTextClasses[size]} ${labelColorClass}`, children: label })
|
|
888
997
|
] }),
|
|
889
|
-
description && /* @__PURE__ */
|
|
998
|
+
description && /* @__PURE__ */ jsx9(
|
|
890
999
|
"span",
|
|
891
1000
|
{
|
|
892
1001
|
className: `text-body-small ${descriptionPaddingClasses[size]} ${descriptionColorClass}`,
|
|
@@ -902,129 +1011,459 @@ Checkbox.displayName = "Checkbox";
|
|
|
902
1011
|
|
|
903
1012
|
// src/components/Chip/Chip.tsx
|
|
904
1013
|
import {
|
|
905
|
-
forwardRef as
|
|
1014
|
+
forwardRef as forwardRef10,
|
|
1015
|
+
useState as useState3
|
|
906
1016
|
} from "react";
|
|
907
|
-
import { jsx as
|
|
908
|
-
var
|
|
909
|
-
sm: "h-32
|
|
910
|
-
md: "h-40
|
|
911
|
-
lg: "h-48
|
|
912
|
-
};
|
|
913
|
-
var marginImgClasses = {
|
|
914
|
-
sm: "-ml-10 -my-4 h-28 w-28",
|
|
915
|
-
md: "-ml-12 -my-6 h-32 w-32",
|
|
916
|
-
lg: "-ml-18 -my-8 h-32 w-32"
|
|
1017
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1018
|
+
var sizeBaseClasses = {
|
|
1019
|
+
sm: "min-h-32 min-w-56 gap-4 py-2 text-label-medium",
|
|
1020
|
+
md: "min-h-40 min-w-56 gap-8 py-4 text-label-large",
|
|
1021
|
+
lg: "min-h-48 min-w-96 gap-8 py-8 text-label-large"
|
|
917
1022
|
};
|
|
918
|
-
var
|
|
919
|
-
|
|
920
|
-
|
|
1023
|
+
var paddingXClasses = {
|
|
1024
|
+
sm: "px-12",
|
|
1025
|
+
md: "px-16",
|
|
1026
|
+
lg: "px-24"
|
|
921
1027
|
};
|
|
922
|
-
var
|
|
923
|
-
|
|
924
|
-
|
|
1028
|
+
var bankLogoPaddingXClasses = {
|
|
1029
|
+
md: "pl-4 pr-16",
|
|
1030
|
+
lg: "pl-8 pr-16"
|
|
925
1031
|
};
|
|
926
|
-
|
|
1032
|
+
function toneClasses(selected, outline, variant) {
|
|
1033
|
+
if (selected) {
|
|
1034
|
+
return variant === "dark" ? "bg-chip-background-black-active text-chip-text-inverse hover:bg-chip-background-black-active-hover group-disabled:bg-chip-background-active-disabled group-disabled:text-chip-text-inverse-disabled" : "bg-chip-background-active text-chip-text-inverse hover:bg-chip-background-active-hover group-disabled:bg-chip-background-active-disabled group-disabled:text-chip-text-inverse-disabled";
|
|
1035
|
+
}
|
|
1036
|
+
if (outline) {
|
|
1037
|
+
return "bg-chip-background-inverse text-chip-text-enabled border border-chip-border-enabled hover:bg-chip-background-hover hover:border-chip-border-hover group-disabled:text-chip-text-disabled";
|
|
1038
|
+
}
|
|
1039
|
+
return "bg-chip-background-enabled text-chip-text-enabled hover:bg-chip-background-hover group-disabled:bg-chip-background-disabled group-disabled:text-chip-text-disabled";
|
|
1040
|
+
}
|
|
1041
|
+
var Chip = forwardRef10(
|
|
927
1042
|
(_a, ref) => {
|
|
928
1043
|
var _b = _a, {
|
|
929
1044
|
size = "md",
|
|
930
|
-
src,
|
|
931
|
-
alt = "",
|
|
932
1045
|
label,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1046
|
+
variant = "brand",
|
|
1047
|
+
outline = false,
|
|
1048
|
+
selected,
|
|
1049
|
+
defaultSelected = false,
|
|
1050
|
+
onSelectedChange,
|
|
1051
|
+
startIcon,
|
|
1052
|
+
endIcon,
|
|
1053
|
+
bankLogoSrc,
|
|
1054
|
+
bankLogoAlt = "",
|
|
937
1055
|
disabled = false,
|
|
1056
|
+
onClick,
|
|
938
1057
|
className = ""
|
|
939
1058
|
} = _b, rest = __objRest(_b, [
|
|
940
1059
|
"size",
|
|
941
|
-
"src",
|
|
942
|
-
"alt",
|
|
943
1060
|
"label",
|
|
944
|
-
"
|
|
945
|
-
"
|
|
946
|
-
"
|
|
947
|
-
"
|
|
1061
|
+
"variant",
|
|
1062
|
+
"outline",
|
|
1063
|
+
"selected",
|
|
1064
|
+
"defaultSelected",
|
|
1065
|
+
"onSelectedChange",
|
|
1066
|
+
"startIcon",
|
|
1067
|
+
"endIcon",
|
|
1068
|
+
"bankLogoSrc",
|
|
1069
|
+
"bankLogoAlt",
|
|
948
1070
|
"disabled",
|
|
1071
|
+
"onClick",
|
|
949
1072
|
"className"
|
|
950
1073
|
]);
|
|
951
|
-
const
|
|
952
|
-
const
|
|
953
|
-
const
|
|
954
|
-
const
|
|
955
|
-
|
|
1074
|
+
const [uncontrolledSelected, setUncontrolledSelected] = useState3(defaultSelected);
|
|
1075
|
+
const isSelected = selected != null ? selected : uncontrolledSelected;
|
|
1076
|
+
const showBankLogo = Boolean(bankLogoSrc) && size !== "sm";
|
|
1077
|
+
const handleClick = (event) => {
|
|
1078
|
+
onClick == null ? void 0 : onClick(event);
|
|
1079
|
+
if (event.defaultPrevented) return;
|
|
1080
|
+
const next = !isSelected;
|
|
1081
|
+
if (selected === void 0) setUncontrolledSelected(next);
|
|
1082
|
+
onSelectedChange == null ? void 0 : onSelectedChange(next);
|
|
1083
|
+
};
|
|
1084
|
+
const wrapperClasses = [
|
|
1085
|
+
"group rounded-full border-2 border-transparent p-2 outline-none",
|
|
1086
|
+
"transition-colors",
|
|
956
1087
|
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
className,
|
|
960
|
-
isSelected ? darkClass : ""
|
|
1088
|
+
"focus-visible:border-chip-border-focus",
|
|
1089
|
+
className
|
|
961
1090
|
].filter(Boolean).join(" ");
|
|
962
|
-
|
|
963
|
-
"
|
|
1091
|
+
const baseClasses = [
|
|
1092
|
+
"flex items-center justify-center rounded-full transition-colors",
|
|
1093
|
+
sizeBaseClasses[size],
|
|
1094
|
+
showBankLogo ? bankLogoPaddingXClasses[size] : paddingXClasses[size],
|
|
1095
|
+
toneClasses(isSelected, outline && !isSelected, variant)
|
|
1096
|
+
].filter(Boolean).join(" ");
|
|
1097
|
+
return /* @__PURE__ */ jsx10(
|
|
1098
|
+
"button",
|
|
964
1099
|
__spreadProps(__spreadValues({
|
|
965
1100
|
ref,
|
|
966
|
-
|
|
1101
|
+
type: "button",
|
|
1102
|
+
disabled,
|
|
1103
|
+
"aria-pressed": isSelected,
|
|
1104
|
+
onClick: handleClick,
|
|
1105
|
+
className: wrapperClasses
|
|
967
1106
|
}, rest), {
|
|
968
|
-
children: [
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1107
|
+
children: /* @__PURE__ */ jsxs9("span", { className: baseClasses, children: [
|
|
1108
|
+
showBankLogo ? /* @__PURE__ */ jsx10(
|
|
1109
|
+
"img",
|
|
1110
|
+
{
|
|
1111
|
+
src: bankLogoSrc,
|
|
1112
|
+
alt: bankLogoAlt,
|
|
1113
|
+
className: "size-32 shrink-0 rounded-full object-contain"
|
|
1114
|
+
}
|
|
1115
|
+
) : startIcon,
|
|
1116
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 truncate", children: label }),
|
|
1117
|
+
!showBankLogo && endIcon
|
|
1118
|
+
] })
|
|
972
1119
|
})
|
|
973
1120
|
);
|
|
974
1121
|
}
|
|
975
1122
|
);
|
|
976
1123
|
Chip.displayName = "Chip";
|
|
977
1124
|
|
|
978
|
-
// src/components/
|
|
1125
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
979
1126
|
import {
|
|
980
|
-
forwardRef as forwardRef11,
|
|
981
1127
|
useEffect,
|
|
982
|
-
|
|
1128
|
+
useLayoutEffect,
|
|
1129
|
+
useRef as useRef2,
|
|
1130
|
+
useState as useState5,
|
|
1131
|
+
useImperativeHandle as useImperativeHandle2,
|
|
1132
|
+
forwardRef as forwardRef12
|
|
983
1133
|
} from "react";
|
|
984
|
-
import { createPortal } from "react-dom";
|
|
985
1134
|
|
|
986
|
-
// src/components/
|
|
987
|
-
import {
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
var iconSizeClasses2 = {
|
|
996
|
-
xs: "h-16 w-16",
|
|
997
|
-
s: "h-20 w-20",
|
|
998
|
-
m: "h-20 w-20",
|
|
999
|
-
l: "h-24 w-24"
|
|
1000
|
-
};
|
|
1001
|
-
var IconButton = forwardRef10(
|
|
1135
|
+
// src/components/TextField/TextField.tsx
|
|
1136
|
+
import {
|
|
1137
|
+
useState as useState4,
|
|
1138
|
+
useRef,
|
|
1139
|
+
useImperativeHandle,
|
|
1140
|
+
forwardRef as forwardRef11
|
|
1141
|
+
} from "react";
|
|
1142
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1143
|
+
var TextField = forwardRef11(
|
|
1002
1144
|
(_a, ref) => {
|
|
1003
|
-
var _b = _a, {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1145
|
+
var _b = _a, {
|
|
1146
|
+
size = "md",
|
|
1147
|
+
error,
|
|
1148
|
+
label,
|
|
1149
|
+
placeholder,
|
|
1150
|
+
helperText,
|
|
1151
|
+
prefix,
|
|
1152
|
+
suffix,
|
|
1153
|
+
optional = false,
|
|
1154
|
+
success = false,
|
|
1155
|
+
pending = false,
|
|
1156
|
+
clearable = true,
|
|
1157
|
+
disabled = false,
|
|
1158
|
+
type,
|
|
1159
|
+
value,
|
|
1160
|
+
onChange,
|
|
1161
|
+
onFocus,
|
|
1162
|
+
onBlur,
|
|
1009
1163
|
className
|
|
1010
|
-
|
|
1011
|
-
|
|
1164
|
+
} = _b, props = __objRest(_b, [
|
|
1165
|
+
"size",
|
|
1166
|
+
"error",
|
|
1167
|
+
"label",
|
|
1168
|
+
"placeholder",
|
|
1169
|
+
"helperText",
|
|
1170
|
+
"prefix",
|
|
1171
|
+
"suffix",
|
|
1172
|
+
"optional",
|
|
1173
|
+
"success",
|
|
1174
|
+
"pending",
|
|
1175
|
+
"clearable",
|
|
1176
|
+
"disabled",
|
|
1177
|
+
"type",
|
|
1178
|
+
"value",
|
|
1179
|
+
"onChange",
|
|
1180
|
+
"onFocus",
|
|
1181
|
+
"onBlur",
|
|
1182
|
+
"className"
|
|
1183
|
+
]);
|
|
1184
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
1185
|
+
const isActive = isFocused && !!value;
|
|
1186
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1187
|
+
const inputRef = useRef(null);
|
|
1188
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
1189
|
+
return /* @__PURE__ */ jsxs10("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1190
|
+
label ? /* @__PURE__ */ jsxs10(
|
|
1191
|
+
"p",
|
|
1192
|
+
{
|
|
1193
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
1194
|
+
children: [
|
|
1195
|
+
label,
|
|
1196
|
+
optional && /* @__PURE__ */ jsx11("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
1197
|
+
]
|
|
1198
|
+
}
|
|
1199
|
+
) : /* @__PURE__ */ jsx11(Fragment, {}),
|
|
1200
|
+
/* @__PURE__ */ jsxs10(
|
|
1201
|
+
"div",
|
|
1202
|
+
{
|
|
1203
|
+
className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
|
|
1204
|
+
onMouseDown: (e) => {
|
|
1205
|
+
var _a2;
|
|
1206
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
1207
|
+
e.preventDefault();
|
|
1208
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
children: [
|
|
1212
|
+
prefix && /* @__PURE__ */ jsx11(
|
|
1213
|
+
"span",
|
|
1214
|
+
{
|
|
1215
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1216
|
+
children: prefix
|
|
1217
|
+
}
|
|
1218
|
+
),
|
|
1219
|
+
/* @__PURE__ */ jsx11(
|
|
1220
|
+
"input",
|
|
1221
|
+
__spreadValues({
|
|
1222
|
+
ref: inputRef,
|
|
1223
|
+
type: type || "text",
|
|
1224
|
+
placeholder,
|
|
1225
|
+
disabled: disabled || pending,
|
|
1226
|
+
onFocus: (e) => {
|
|
1227
|
+
setIsFocused(true);
|
|
1228
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
1229
|
+
},
|
|
1230
|
+
onBlur: (e) => {
|
|
1231
|
+
setIsFocused(false);
|
|
1232
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
1233
|
+
},
|
|
1234
|
+
value,
|
|
1235
|
+
onChange,
|
|
1236
|
+
className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
|
|
1237
|
+
}, props)
|
|
1238
|
+
),
|
|
1239
|
+
suffix && /* @__PURE__ */ jsx11(
|
|
1240
|
+
"span",
|
|
1241
|
+
{
|
|
1242
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1243
|
+
children: suffix
|
|
1244
|
+
}
|
|
1245
|
+
),
|
|
1246
|
+
(pending || clearable || success || error) && /* @__PURE__ */ jsx11(
|
|
1247
|
+
"span",
|
|
1248
|
+
{
|
|
1249
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
1250
|
+
children: pending ? /* @__PURE__ */ jsx11(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx11(
|
|
1251
|
+
IconButton,
|
|
1252
|
+
{
|
|
1253
|
+
size: iconButtonSize,
|
|
1254
|
+
transparent: true,
|
|
1255
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
1256
|
+
icon: /* @__PURE__ */ jsx11(
|
|
1257
|
+
"svg",
|
|
1258
|
+
{
|
|
1259
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1260
|
+
width: "20",
|
|
1261
|
+
height: "20",
|
|
1262
|
+
viewBox: "0 0 20 20",
|
|
1263
|
+
fill: "none",
|
|
1264
|
+
children: /* @__PURE__ */ jsx11(
|
|
1265
|
+
"path",
|
|
1266
|
+
{
|
|
1267
|
+
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
1268
|
+
fill: "currentColor"
|
|
1269
|
+
}
|
|
1270
|
+
)
|
|
1271
|
+
}
|
|
1272
|
+
),
|
|
1273
|
+
onMouseDown: (e) => {
|
|
1274
|
+
e.preventDefault();
|
|
1275
|
+
},
|
|
1276
|
+
onClick: () => {
|
|
1277
|
+
onChange == null ? void 0 : onChange({
|
|
1278
|
+
target: { value: "" }
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
) : success ? /* @__PURE__ */ jsx11(
|
|
1283
|
+
"svg",
|
|
1284
|
+
{
|
|
1285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1286
|
+
width: "20",
|
|
1287
|
+
height: "20",
|
|
1288
|
+
viewBox: "0 0 20 20",
|
|
1289
|
+
fill: "none",
|
|
1290
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
1291
|
+
children: /* @__PURE__ */ jsx11(
|
|
1292
|
+
"path",
|
|
1293
|
+
{
|
|
1294
|
+
fillRule: "evenodd",
|
|
1295
|
+
clipRule: "evenodd",
|
|
1296
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
1297
|
+
fill: "currentColor"
|
|
1298
|
+
}
|
|
1299
|
+
)
|
|
1300
|
+
}
|
|
1301
|
+
) : error ? /* @__PURE__ */ jsx11(
|
|
1302
|
+
"svg",
|
|
1303
|
+
{
|
|
1304
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1305
|
+
width: "20",
|
|
1306
|
+
height: "20",
|
|
1307
|
+
viewBox: "0 0 20 20",
|
|
1308
|
+
fill: "none",
|
|
1309
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
1310
|
+
children: /* @__PURE__ */ jsx11(
|
|
1311
|
+
"path",
|
|
1312
|
+
{
|
|
1313
|
+
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
1314
|
+
fill: "currentColor"
|
|
1315
|
+
}
|
|
1316
|
+
)
|
|
1317
|
+
}
|
|
1318
|
+
) : null
|
|
1319
|
+
}
|
|
1320
|
+
)
|
|
1321
|
+
]
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
error ? /* @__PURE__ */ jsx11("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx11(
|
|
1325
|
+
"p",
|
|
1326
|
+
{
|
|
1327
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
1328
|
+
children: helperText
|
|
1329
|
+
}
|
|
1330
|
+
) : /* @__PURE__ */ jsx11(Fragment, {})
|
|
1331
|
+
] });
|
|
1012
1332
|
}
|
|
1013
1333
|
);
|
|
1014
|
-
|
|
1334
|
+
TextField.displayName = "TextField";
|
|
1335
|
+
|
|
1336
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
1337
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1338
|
+
function toDigits(value) {
|
|
1339
|
+
if (value === void 0 || Number.isNaN(value)) return "";
|
|
1340
|
+
return String(Math.trunc(value)).replace(/[^\d]/g, "");
|
|
1341
|
+
}
|
|
1342
|
+
function formatDigits(digits) {
|
|
1343
|
+
if (!digits) return "";
|
|
1344
|
+
const normalized = digits.replace(/^0+(?=\d)/, "");
|
|
1345
|
+
return Number(normalized).toLocaleString("en-US");
|
|
1346
|
+
}
|
|
1347
|
+
var CurrencyField = forwardRef12(
|
|
1348
|
+
(_a, ref) => {
|
|
1349
|
+
var _b = _a, {
|
|
1350
|
+
value,
|
|
1351
|
+
onChange,
|
|
1352
|
+
min,
|
|
1353
|
+
minErrorText,
|
|
1354
|
+
max,
|
|
1355
|
+
maxErrorText,
|
|
1356
|
+
currencyIcon,
|
|
1357
|
+
error,
|
|
1358
|
+
onBlur,
|
|
1359
|
+
className
|
|
1360
|
+
} = _b, props = __objRest(_b, [
|
|
1361
|
+
"value",
|
|
1362
|
+
"onChange",
|
|
1363
|
+
"min",
|
|
1364
|
+
"minErrorText",
|
|
1365
|
+
"max",
|
|
1366
|
+
"maxErrorText",
|
|
1367
|
+
"currencyIcon",
|
|
1368
|
+
"error",
|
|
1369
|
+
"onBlur",
|
|
1370
|
+
"className"
|
|
1371
|
+
]);
|
|
1372
|
+
const inputRef = useRef2(null);
|
|
1373
|
+
useImperativeHandle2(ref, () => inputRef.current);
|
|
1374
|
+
const [displayValue, setDisplayValue] = useState5(
|
|
1375
|
+
() => formatDigits(toDigits(value))
|
|
1376
|
+
);
|
|
1377
|
+
const [touched, setTouched] = useState5(false);
|
|
1378
|
+
const pendingCursorRef = useRef2(null);
|
|
1379
|
+
useEffect(() => {
|
|
1380
|
+
const externalDigits = toDigits(value);
|
|
1381
|
+
const currentDigits = displayValue.replace(/[^\d]/g, "");
|
|
1382
|
+
if (externalDigits !== currentDigits) {
|
|
1383
|
+
setDisplayValue(formatDigits(externalDigits));
|
|
1384
|
+
}
|
|
1385
|
+
}, [value]);
|
|
1386
|
+
useLayoutEffect(() => {
|
|
1387
|
+
if (pendingCursorRef.current !== null && inputRef.current) {
|
|
1388
|
+
inputRef.current.setSelectionRange(
|
|
1389
|
+
pendingCursorRef.current,
|
|
1390
|
+
pendingCursorRef.current
|
|
1391
|
+
);
|
|
1392
|
+
pendingCursorRef.current = null;
|
|
1393
|
+
}
|
|
1394
|
+
}, [displayValue]);
|
|
1395
|
+
const handleChange = (event) => {
|
|
1396
|
+
var _a2;
|
|
1397
|
+
const input = event.target;
|
|
1398
|
+
const raw = input.value;
|
|
1399
|
+
const cursorPos = (_a2 = input.selectionStart) != null ? _a2 : raw.length;
|
|
1400
|
+
const digitsBeforeCursor = raw.slice(0, cursorPos).replace(/[^\d]/g, "").length;
|
|
1401
|
+
const digits2 = raw.replace(/[^\d]/g, "");
|
|
1402
|
+
const formatted = formatDigits(digits2);
|
|
1403
|
+
let newCursor = formatted.length;
|
|
1404
|
+
if (digitsBeforeCursor === 0) {
|
|
1405
|
+
newCursor = 0;
|
|
1406
|
+
} else {
|
|
1407
|
+
let count = 0;
|
|
1408
|
+
for (let i = 0; i < formatted.length; i += 1) {
|
|
1409
|
+
if (/\d/.test(formatted[i])) {
|
|
1410
|
+
count += 1;
|
|
1411
|
+
if (count === digitsBeforeCursor) {
|
|
1412
|
+
newCursor = i + 1;
|
|
1413
|
+
break;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
pendingCursorRef.current = newCursor;
|
|
1419
|
+
setDisplayValue(formatted);
|
|
1420
|
+
const normalized = digits2.replace(/^0+(?=\d)/, "");
|
|
1421
|
+
onChange == null ? void 0 : onChange(normalized === "" ? void 0 : Number(normalized));
|
|
1422
|
+
};
|
|
1423
|
+
const digits = displayValue.replace(/[^\d]/g, "");
|
|
1424
|
+
const numericValue = digits === "" ? void 0 : Number(digits);
|
|
1425
|
+
const belowMin = touched && min !== void 0 && numericValue !== void 0 && numericValue < min;
|
|
1426
|
+
const aboveMax = touched && max !== void 0 && numericValue !== void 0 && numericValue > max;
|
|
1427
|
+
const computedError = error != null ? error : belowMin ? minErrorText != null ? minErrorText : `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E07\u0E34\u0E19\u0E02\u0E31\u0E49\u0E19\u0E15\u0E48\u0E33\u0E04\u0E37\u0E2D ${min.toLocaleString("en-US")} \u0E1A\u0E32\u0E17` : aboveMax ? maxErrorText != null ? maxErrorText : `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E07\u0E34\u0E19\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14\u0E04\u0E37\u0E2D ${max.toLocaleString("en-US")} \u0E1A\u0E32\u0E17` : void 0;
|
|
1428
|
+
return /* @__PURE__ */ jsx12(
|
|
1429
|
+
TextField,
|
|
1430
|
+
__spreadValues({
|
|
1431
|
+
ref: inputRef,
|
|
1432
|
+
type: "text",
|
|
1433
|
+
inputMode: "tel",
|
|
1434
|
+
prefix: currencyIcon != null ? currencyIcon : /* @__PURE__ */ jsx12("span", { className: "text-body-small", children: "\u0E3F" }),
|
|
1435
|
+
value: displayValue,
|
|
1436
|
+
onChange: handleChange,
|
|
1437
|
+
onBlur: (event) => {
|
|
1438
|
+
setTouched(true);
|
|
1439
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
1440
|
+
},
|
|
1441
|
+
error: computedError,
|
|
1442
|
+
className: `[&>input]:relative [&>input]:top-1 ${className != null ? className : ""}`
|
|
1443
|
+
}, props)
|
|
1444
|
+
);
|
|
1445
|
+
}
|
|
1446
|
+
);
|
|
1447
|
+
CurrencyField.displayName = "CurrencyField";
|
|
1015
1448
|
|
|
1016
1449
|
// src/components/Dialog/Dialog.tsx
|
|
1017
|
-
import {
|
|
1450
|
+
import {
|
|
1451
|
+
forwardRef as forwardRef13,
|
|
1452
|
+
useEffect as useEffect2,
|
|
1453
|
+
useState as useState6
|
|
1454
|
+
} from "react";
|
|
1455
|
+
import { createPortal } from "react-dom";
|
|
1456
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1018
1457
|
function CloseIcon2({ className }) {
|
|
1019
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1020
1459
|
}
|
|
1021
1460
|
function WarningIcon2({ className }) {
|
|
1022
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z" }) });
|
|
1023
1462
|
}
|
|
1024
1463
|
function useMountTransition(open, duration = 300) {
|
|
1025
|
-
const [mounted, setMounted] =
|
|
1026
|
-
const [animate, setAnimate] =
|
|
1027
|
-
|
|
1464
|
+
const [mounted, setMounted] = useState6(open);
|
|
1465
|
+
const [animate, setAnimate] = useState6(open);
|
|
1466
|
+
useEffect2(() => {
|
|
1028
1467
|
if (open) {
|
|
1029
1468
|
setMounted(true);
|
|
1030
1469
|
let raf2 = 0;
|
|
@@ -1049,9 +1488,9 @@ function DialogAction({
|
|
|
1049
1488
|
}) {
|
|
1050
1489
|
if (!action) return null;
|
|
1051
1490
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1052
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsx13(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
|
|
1053
1492
|
}
|
|
1054
|
-
var Dialog =
|
|
1493
|
+
var Dialog = forwardRef13(
|
|
1055
1494
|
(_a, ref) => {
|
|
1056
1495
|
var _b = _a, {
|
|
1057
1496
|
open,
|
|
@@ -1085,7 +1524,7 @@ var Dialog = forwardRef11(
|
|
|
1085
1524
|
"className"
|
|
1086
1525
|
]);
|
|
1087
1526
|
const { mounted, animate } = useMountTransition(open);
|
|
1088
|
-
|
|
1527
|
+
useEffect2(() => {
|
|
1089
1528
|
if (!open || !closable) return;
|
|
1090
1529
|
const handleKeyDown = (e) => {
|
|
1091
1530
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1105,7 +1544,7 @@ var Dialog = forwardRef11(
|
|
|
1105
1544
|
const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
|
|
1106
1545
|
const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
|
|
1107
1546
|
return createPortal(
|
|
1108
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx13(
|
|
1109
1548
|
"div",
|
|
1110
1549
|
{
|
|
1111
1550
|
className: [
|
|
@@ -1120,7 +1559,7 @@ var Dialog = forwardRef11(
|
|
|
1120
1559
|
].filter(Boolean).join(" "),
|
|
1121
1560
|
role: "presentation",
|
|
1122
1561
|
onMouseDown: handleBackdropMouseDown,
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1562
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1124
1563
|
"div",
|
|
1125
1564
|
__spreadProps(__spreadValues({
|
|
1126
1565
|
ref,
|
|
@@ -1140,53 +1579,53 @@ var Dialog = forwardRef11(
|
|
|
1140
1579
|
onMouseDown: (e) => e.stopPropagation()
|
|
1141
1580
|
}, rest), {
|
|
1142
1581
|
children: [
|
|
1143
|
-
artwork ? /* @__PURE__ */
|
|
1144
|
-
closable && /* @__PURE__ */
|
|
1582
|
+
artwork ? /* @__PURE__ */ jsxs11("div", { className: "relative shrink-0 bg-background-tertiary", children: [
|
|
1583
|
+
closable && /* @__PURE__ */ jsx13("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ jsx13(
|
|
1145
1584
|
IconButton,
|
|
1146
1585
|
{
|
|
1147
|
-
icon: /* @__PURE__ */
|
|
1586
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-24 w-24" }),
|
|
1148
1587
|
size: "m",
|
|
1588
|
+
surface: "dark",
|
|
1149
1589
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1150
|
-
onClick: handleClose
|
|
1151
|
-
className: "bg-icon-button-background-dark-transparent-enabled hover:bg-icon-button-background-dark-transparent-hover active:bg-icon-button-background-dark-transparent-active text-icon-button-icon-inverse!"
|
|
1590
|
+
onClick: handleClose
|
|
1152
1591
|
}
|
|
1153
1592
|
) }),
|
|
1154
1593
|
artwork
|
|
1155
1594
|
] }) : null,
|
|
1156
|
-
showHeader && /* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
warning && /* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
title && /* @__PURE__ */
|
|
1161
|
-
subtitle && !artwork && /* @__PURE__ */
|
|
1595
|
+
showHeader && /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center gap-8 bg-dialog-background-primary px-16 pb-12 pt-16 lg:px-24 lg:pb-12 lg:pt-20", children: [
|
|
1596
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
|
|
1597
|
+
warning && /* @__PURE__ */ jsx13("span", { className: "flex shrink-0 items-center pt-2", children: /* @__PURE__ */ jsx13(WarningIcon2, { className: "h-20 w-20 text-dialog-icon-warning lg:h-24 lg:w-24" }) }),
|
|
1598
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1599
|
+
title && /* @__PURE__ */ jsx13("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1600
|
+
subtitle && !artwork && /* @__PURE__ */ jsx13("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1162
1601
|
] })
|
|
1163
1602
|
] }),
|
|
1164
|
-
closable && !artwork && /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1603
|
+
closable && !artwork && /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
1604
|
+
/* @__PURE__ */ jsx13(
|
|
1166
1605
|
IconButton,
|
|
1167
1606
|
{
|
|
1168
|
-
icon: /* @__PURE__ */
|
|
1607
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-20 w-20" }),
|
|
1169
1608
|
size: "s",
|
|
1170
1609
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1171
1610
|
onClick: handleClose,
|
|
1172
|
-
className: "
|
|
1611
|
+
className: "lg:hidden!"
|
|
1173
1612
|
}
|
|
1174
1613
|
),
|
|
1175
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx13(
|
|
1176
1615
|
IconButton,
|
|
1177
1616
|
{
|
|
1178
|
-
icon: /* @__PURE__ */
|
|
1617
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-24 w-24" }),
|
|
1179
1618
|
size: "m",
|
|
1180
1619
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1181
1620
|
onClick: handleClose,
|
|
1182
|
-
className: "hidden!
|
|
1621
|
+
className: "hidden! lg:inline-flex!"
|
|
1183
1622
|
}
|
|
1184
1623
|
)
|
|
1185
1624
|
] })
|
|
1186
1625
|
] }),
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
showFooter && /* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsx13("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary px-16 py-12 text-body-small text-dialog-text-primary lg:px-24 lg:text-body-regular", children }),
|
|
1627
|
+
showFooter && /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 flex-col gap-8 bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end lg:px-24 lg:pb-24", children: [
|
|
1628
|
+
/* @__PURE__ */ jsx13(
|
|
1190
1629
|
DialogAction,
|
|
1191
1630
|
{
|
|
1192
1631
|
action: dismiss,
|
|
@@ -1194,8 +1633,8 @@ var Dialog = forwardRef11(
|
|
|
1194
1633
|
orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
|
|
1195
1634
|
}
|
|
1196
1635
|
),
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ jsx13(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1637
|
+
/* @__PURE__ */ jsx13(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
|
|
1199
1638
|
] })
|
|
1200
1639
|
]
|
|
1201
1640
|
})
|
|
@@ -1210,19 +1649,19 @@ Dialog.displayName = "Dialog";
|
|
|
1210
1649
|
|
|
1211
1650
|
// src/components/Drawer/Drawer.tsx
|
|
1212
1651
|
import {
|
|
1213
|
-
forwardRef as
|
|
1214
|
-
useEffect as
|
|
1215
|
-
useState as
|
|
1652
|
+
forwardRef as forwardRef14,
|
|
1653
|
+
useEffect as useEffect3,
|
|
1654
|
+
useState as useState7
|
|
1216
1655
|
} from "react";
|
|
1217
1656
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1218
|
-
import { Fragment as Fragment3, jsx as
|
|
1657
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1219
1658
|
function CloseIcon3({ className }) {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1221
1660
|
}
|
|
1222
1661
|
function useMountTransition2(open, duration = 300) {
|
|
1223
|
-
const [mounted, setMounted] =
|
|
1224
|
-
const [animate, setAnimate] =
|
|
1225
|
-
|
|
1662
|
+
const [mounted, setMounted] = useState7(open);
|
|
1663
|
+
const [animate, setAnimate] = useState7(open);
|
|
1664
|
+
useEffect3(() => {
|
|
1226
1665
|
if (open) {
|
|
1227
1666
|
setMounted(true);
|
|
1228
1667
|
let raf2 = 0;
|
|
@@ -1247,7 +1686,7 @@ function DrawerAction({
|
|
|
1247
1686
|
}) {
|
|
1248
1687
|
if (!action) return null;
|
|
1249
1688
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1250
|
-
return /* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ jsx14(
|
|
1251
1690
|
Button,
|
|
1252
1691
|
__spreadProps(__spreadValues({
|
|
1253
1692
|
variant,
|
|
@@ -1258,7 +1697,7 @@ function DrawerAction({
|
|
|
1258
1697
|
})
|
|
1259
1698
|
);
|
|
1260
1699
|
}
|
|
1261
|
-
var Drawer =
|
|
1700
|
+
var Drawer = forwardRef14(
|
|
1262
1701
|
(_a, ref) => {
|
|
1263
1702
|
var _b = _a, {
|
|
1264
1703
|
open,
|
|
@@ -1292,7 +1731,7 @@ var Drawer = forwardRef12(
|
|
|
1292
1731
|
"className"
|
|
1293
1732
|
]);
|
|
1294
1733
|
const { mounted, animate } = useMountTransition2(open);
|
|
1295
|
-
|
|
1734
|
+
useEffect3(() => {
|
|
1296
1735
|
if (!open || !closable) return;
|
|
1297
1736
|
const handleKeyDown = (e) => {
|
|
1298
1737
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1309,7 +1748,7 @@ var Drawer = forwardRef12(
|
|
|
1309
1748
|
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1310
1749
|
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1311
1750
|
return createPortal2(
|
|
1312
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx14(
|
|
1313
1752
|
"div",
|
|
1314
1753
|
{
|
|
1315
1754
|
className: [
|
|
@@ -1320,7 +1759,7 @@ var Drawer = forwardRef12(
|
|
|
1320
1759
|
].filter(Boolean).join(" "),
|
|
1321
1760
|
role: "presentation",
|
|
1322
1761
|
onMouseDown: handleBackdropMouseDown,
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1762
|
+
children: /* @__PURE__ */ jsxs12(
|
|
1324
1763
|
"div",
|
|
1325
1764
|
__spreadProps(__spreadValues({
|
|
1326
1765
|
ref,
|
|
@@ -1340,7 +1779,7 @@ var Drawer = forwardRef12(
|
|
|
1340
1779
|
onMouseDown: (e) => e.stopPropagation()
|
|
1341
1780
|
}, rest), {
|
|
1342
1781
|
children: [
|
|
1343
|
-
showHeader && /* @__PURE__ */
|
|
1782
|
+
showHeader && /* @__PURE__ */ jsxs12(
|
|
1344
1783
|
"div",
|
|
1345
1784
|
{
|
|
1346
1785
|
className: [
|
|
@@ -1348,36 +1787,36 @@ var Drawer = forwardRef12(
|
|
|
1348
1787
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-16 lg:pt-20"
|
|
1349
1788
|
].join(" "),
|
|
1350
1789
|
children: [
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
title && /* @__PURE__ */
|
|
1353
|
-
subtitle && /* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1791
|
+
title && /* @__PURE__ */ jsx14("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1792
|
+
subtitle && /* @__PURE__ */ jsx14("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1354
1793
|
] }),
|
|
1355
|
-
closable && /* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1794
|
+
closable && /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1795
|
+
/* @__PURE__ */ jsx14(
|
|
1357
1796
|
IconButton,
|
|
1358
1797
|
{
|
|
1359
|
-
icon: /* @__PURE__ */
|
|
1798
|
+
icon: /* @__PURE__ */ jsx14(CloseIcon3, { className: "h-20 w-20" }),
|
|
1360
1799
|
size: "s",
|
|
1361
1800
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1362
1801
|
onClick: handleClose,
|
|
1363
|
-
className: "
|
|
1802
|
+
className: "lg:hidden!"
|
|
1364
1803
|
}
|
|
1365
1804
|
),
|
|
1366
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ jsx14(
|
|
1367
1806
|
IconButton,
|
|
1368
1807
|
{
|
|
1369
|
-
icon: /* @__PURE__ */
|
|
1808
|
+
icon: /* @__PURE__ */ jsx14(CloseIcon3, { className: "h-24 w-24" }),
|
|
1370
1809
|
size: fullScreen ? "l" : "m",
|
|
1371
1810
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1372
1811
|
onClick: handleClose,
|
|
1373
|
-
className: "hidden!
|
|
1812
|
+
className: "hidden! lg:inline-flex!"
|
|
1374
1813
|
}
|
|
1375
1814
|
)
|
|
1376
1815
|
] })
|
|
1377
1816
|
]
|
|
1378
1817
|
}
|
|
1379
1818
|
),
|
|
1380
|
-
/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ jsx14(
|
|
1381
1820
|
"div",
|
|
1382
1821
|
{
|
|
1383
1822
|
className: [
|
|
@@ -1388,23 +1827,23 @@ var Drawer = forwardRef12(
|
|
|
1388
1827
|
children
|
|
1389
1828
|
}
|
|
1390
1829
|
),
|
|
1391
|
-
showFooter && /* @__PURE__ */
|
|
1830
|
+
showFooter && /* @__PURE__ */ jsx14(
|
|
1392
1831
|
"div",
|
|
1393
1832
|
{
|
|
1394
1833
|
className: [
|
|
1395
1834
|
"flex shrink-0 flex-col gap-8 border-t border-border-subtle bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end",
|
|
1396
1835
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-24 lg:pt-16"
|
|
1397
1836
|
].join(" "),
|
|
1398
|
-
children: allActions ? /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1837
|
+
children: allActions ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1838
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1839
|
+
/* @__PURE__ */ jsxs12("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1840
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1841
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1403
1842
|
] })
|
|
1404
|
-
] }) : /* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1843
|
+
] }) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1844
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1845
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1846
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1408
1847
|
] })
|
|
1409
1848
|
}
|
|
1410
1849
|
)
|
|
@@ -1421,14 +1860,14 @@ Drawer.displayName = "Drawer";
|
|
|
1421
1860
|
|
|
1422
1861
|
// src/components/Dropdown/Dropdown.tsx
|
|
1423
1862
|
import {
|
|
1424
|
-
useEffect as
|
|
1863
|
+
useEffect as useEffect4,
|
|
1425
1864
|
useId as useId3,
|
|
1426
|
-
useRef,
|
|
1427
|
-
useState as
|
|
1428
|
-
forwardRef as
|
|
1865
|
+
useRef as useRef3,
|
|
1866
|
+
useState as useState8,
|
|
1867
|
+
forwardRef as forwardRef15
|
|
1429
1868
|
} from "react";
|
|
1430
|
-
import { Fragment as Fragment4, jsx as
|
|
1431
|
-
var IconDanger = () => /* @__PURE__ */
|
|
1869
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1870
|
+
var IconDanger = () => /* @__PURE__ */ jsx15(
|
|
1432
1871
|
"svg",
|
|
1433
1872
|
{
|
|
1434
1873
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1436,7 +1875,7 @@ var IconDanger = () => /* @__PURE__ */ jsx13(
|
|
|
1436
1875
|
height: "20",
|
|
1437
1876
|
viewBox: "0 0 20 20",
|
|
1438
1877
|
fill: "none",
|
|
1439
|
-
children: /* @__PURE__ */
|
|
1878
|
+
children: /* @__PURE__ */ jsx15(
|
|
1440
1879
|
"path",
|
|
1441
1880
|
{
|
|
1442
1881
|
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
@@ -1446,7 +1885,7 @@ var IconDanger = () => /* @__PURE__ */ jsx13(
|
|
|
1446
1885
|
}
|
|
1447
1886
|
);
|
|
1448
1887
|
function IconCheck({ className }) {
|
|
1449
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsx15(
|
|
1450
1889
|
"svg",
|
|
1451
1890
|
{
|
|
1452
1891
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1455,7 +1894,7 @@ function IconCheck({ className }) {
|
|
|
1455
1894
|
viewBox: "0 0 20 20",
|
|
1456
1895
|
fill: "none",
|
|
1457
1896
|
className,
|
|
1458
|
-
children: /* @__PURE__ */
|
|
1897
|
+
children: /* @__PURE__ */ jsx15(
|
|
1459
1898
|
"path",
|
|
1460
1899
|
{
|
|
1461
1900
|
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
@@ -1466,7 +1905,7 @@ function IconCheck({ className }) {
|
|
|
1466
1905
|
);
|
|
1467
1906
|
}
|
|
1468
1907
|
function ChevronDown({ className }) {
|
|
1469
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsx15(
|
|
1470
1909
|
"svg",
|
|
1471
1910
|
{
|
|
1472
1911
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1475,7 +1914,7 @@ function ChevronDown({ className }) {
|
|
|
1475
1914
|
viewBox: "0 0 20 20",
|
|
1476
1915
|
fill: "none",
|
|
1477
1916
|
className,
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1917
|
+
children: /* @__PURE__ */ jsx15(
|
|
1479
1918
|
"path",
|
|
1480
1919
|
{
|
|
1481
1920
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1485,7 +1924,7 @@ function ChevronDown({ className }) {
|
|
|
1485
1924
|
}
|
|
1486
1925
|
);
|
|
1487
1926
|
}
|
|
1488
|
-
var Dropdown =
|
|
1927
|
+
var Dropdown = forwardRef15(
|
|
1489
1928
|
(_a, ref) => {
|
|
1490
1929
|
var _b = _a, {
|
|
1491
1930
|
size = "md",
|
|
@@ -1522,14 +1961,14 @@ var Dropdown = forwardRef13(
|
|
|
1522
1961
|
]);
|
|
1523
1962
|
const isCombobox = variant === "combobox";
|
|
1524
1963
|
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1525
|
-
const [isOpen, setIsOpen] =
|
|
1526
|
-
const [isFocused, setIsFocused] =
|
|
1527
|
-
const [query, setQuery] =
|
|
1528
|
-
const [filterText, setFilterText] =
|
|
1529
|
-
const dropdownRef =
|
|
1530
|
-
const inputRef =
|
|
1964
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
1965
|
+
const [isFocused, setIsFocused] = useState8(false);
|
|
1966
|
+
const [query, setQuery] = useState8(value.label || "");
|
|
1967
|
+
const [filterText, setFilterText] = useState8("");
|
|
1968
|
+
const dropdownRef = useRef3(null);
|
|
1969
|
+
const inputRef = useRef3(null);
|
|
1531
1970
|
const listboxId = useId3();
|
|
1532
|
-
const [prevLabel, setPrevLabel] =
|
|
1971
|
+
const [prevLabel, setPrevLabel] = useState8(value.label);
|
|
1533
1972
|
if (value.label !== prevLabel) {
|
|
1534
1973
|
setPrevLabel(value.label);
|
|
1535
1974
|
setQuery(value.label || "");
|
|
@@ -1537,7 +1976,7 @@ var Dropdown = forwardRef13(
|
|
|
1537
1976
|
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1538
1977
|
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1539
1978
|
) : dropDownItems;
|
|
1540
|
-
|
|
1979
|
+
useEffect4(() => {
|
|
1541
1980
|
function handleClickOutside(event) {
|
|
1542
1981
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1543
1982
|
setIsOpen(false);
|
|
@@ -1554,16 +1993,16 @@ var Dropdown = forwardRef13(
|
|
|
1554
1993
|
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1555
1994
|
${disabled ? "pointer-events-none bg-dropdown-background-disabled border-dropdown-border-disabled" : error ? `bg-dropdown-background-enabled border-dropdown-border-danger ${isOpen ? "ring-1 ring-inset ring-dropdown-border-danger" : ""}` : isOpen ? "bg-dropdown-background-enabled border-dropdown-border-active ring-1 ring-inset ring-dropdown-border-active" : isFocused ? "bg-dropdown-background-enabled border-dropdown-border-focus ring-1 ring-inset ring-dropdown-border-focus" : "bg-dropdown-background-enabled border-dropdown-border-enabled hover:border-dropdown-border-hover"}
|
|
1556
1995
|
${className}`;
|
|
1557
|
-
return /* @__PURE__ */
|
|
1558
|
-
label ? /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1997
|
+
label ? /* @__PURE__ */ jsx15(
|
|
1559
1998
|
"p",
|
|
1560
1999
|
{
|
|
1561
2000
|
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1562
2001
|
children: label
|
|
1563
2002
|
}
|
|
1564
|
-
) : /* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
isCombobox ? /* @__PURE__ */
|
|
2003
|
+
) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
2004
|
+
/* @__PURE__ */ jsxs13("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
2005
|
+
isCombobox ? /* @__PURE__ */ jsxs13(
|
|
1567
2006
|
"div",
|
|
1568
2007
|
__spreadProps(__spreadValues({
|
|
1569
2008
|
ref
|
|
@@ -1574,7 +2013,7 @@ var Dropdown = forwardRef13(
|
|
|
1574
2013
|
},
|
|
1575
2014
|
className: triggerClassName,
|
|
1576
2015
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx15(
|
|
1578
2017
|
"input",
|
|
1579
2018
|
{
|
|
1580
2019
|
ref: inputRef,
|
|
@@ -1607,16 +2046,17 @@ var Dropdown = forwardRef13(
|
|
|
1607
2046
|
className: `grow w-full min-w-0 bg-transparent focus:outline-none ${disabled ? "text-dropdown-text-disabled cursor-not-allowed" : "text-dropdown-text-primary cursor-text"}`
|
|
1608
2047
|
}
|
|
1609
2048
|
),
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
disabled ? /* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-4", children: [
|
|
2050
|
+
disabled ? /* @__PURE__ */ jsx15(Fragment4, {}) : error ? /* @__PURE__ */ jsx15(IconDanger, {}) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
2051
|
+
/* @__PURE__ */ jsx15(
|
|
1613
2052
|
IconButton,
|
|
1614
2053
|
{
|
|
1615
2054
|
size: iconButtonSize,
|
|
2055
|
+
transparent: true,
|
|
1616
2056
|
disabled,
|
|
1617
2057
|
tabIndex: -1,
|
|
1618
2058
|
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1619
|
-
icon: /* @__PURE__ */
|
|
2059
|
+
icon: /* @__PURE__ */ jsx15(
|
|
1620
2060
|
ChevronDown,
|
|
1621
2061
|
{
|
|
1622
2062
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1639,7 +2079,7 @@ var Dropdown = forwardRef13(
|
|
|
1639
2079
|
] })
|
|
1640
2080
|
]
|
|
1641
2081
|
})
|
|
1642
|
-
) : /* @__PURE__ */
|
|
2082
|
+
) : /* @__PURE__ */ jsxs13(
|
|
1643
2083
|
"div",
|
|
1644
2084
|
__spreadProps(__spreadValues({
|
|
1645
2085
|
ref
|
|
@@ -1672,23 +2112,24 @@ var Dropdown = forwardRef13(
|
|
|
1672
2112
|
},
|
|
1673
2113
|
className: `focus:outline-none ${triggerClassName}`,
|
|
1674
2114
|
children: [
|
|
1675
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx15(
|
|
1676
2116
|
"p",
|
|
1677
2117
|
{
|
|
1678
2118
|
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1679
2119
|
children: value.label || placeholder
|
|
1680
2120
|
}
|
|
1681
2121
|
),
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
disabled ? /* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-4", children: [
|
|
2123
|
+
disabled ? /* @__PURE__ */ jsx15(Fragment4, {}) : error ? /* @__PURE__ */ jsx15(IconDanger, {}) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
2124
|
+
/* @__PURE__ */ jsx15(
|
|
1685
2125
|
IconButton,
|
|
1686
2126
|
{
|
|
1687
2127
|
size: iconButtonSize,
|
|
2128
|
+
transparent: true,
|
|
1688
2129
|
disabled,
|
|
1689
2130
|
tabIndex: -1,
|
|
1690
2131
|
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1691
|
-
icon: /* @__PURE__ */
|
|
2132
|
+
icon: /* @__PURE__ */ jsx15(
|
|
1692
2133
|
ChevronDown,
|
|
1693
2134
|
{
|
|
1694
2135
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1705,17 +2146,17 @@ var Dropdown = forwardRef13(
|
|
|
1705
2146
|
]
|
|
1706
2147
|
})
|
|
1707
2148
|
),
|
|
1708
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ jsx15(
|
|
1709
2150
|
"div",
|
|
1710
2151
|
{
|
|
1711
2152
|
className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-0 absolute z-10000 bg-dropdown-background-enabled rounded-6 shadow-base w-full flex-col pt-4 overflow-hidden`,
|
|
1712
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ jsx15(
|
|
1713
2154
|
"ul",
|
|
1714
2155
|
{
|
|
1715
2156
|
id: isCombobox ? listboxId : void 0,
|
|
1716
2157
|
role: isCombobox ? "listbox" : void 0,
|
|
1717
2158
|
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1718
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */
|
|
2159
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
|
|
1719
2160
|
"div",
|
|
1720
2161
|
{
|
|
1721
2162
|
onClick: () => {
|
|
@@ -1725,46 +2166,46 @@ var Dropdown = forwardRef13(
|
|
|
1725
2166
|
},
|
|
1726
2167
|
className: "relative h-48 py-8 px-16 border-t border-gray-50 text-label-medium hover:bg-dropdown-background-hover active:bg-dropdown-background-active flex items-center justify-between gap-12",
|
|
1727
2168
|
children: [
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
value.value === item.value && /* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ jsx15("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
2170
|
+
value.value === item.value && /* @__PURE__ */ jsx15(IconCheck, { className: "h-20 w-20" })
|
|
1730
2171
|
]
|
|
1731
2172
|
}
|
|
1732
|
-
) }, idx)) : /* @__PURE__ */
|
|
2173
|
+
) }, idx)) : /* @__PURE__ */ jsx15("li", { className: "px-16 py-8 text-label-medium text-dropdown-text-secondary", children: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23" })
|
|
1733
2174
|
}
|
|
1734
2175
|
)
|
|
1735
2176
|
}
|
|
1736
2177
|
)
|
|
1737
2178
|
] }),
|
|
1738
|
-
error ? /* @__PURE__ */
|
|
2179
|
+
error ? /* @__PURE__ */ jsx15("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx15(
|
|
1739
2180
|
"p",
|
|
1740
2181
|
{
|
|
1741
2182
|
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1742
2183
|
children: helperText
|
|
1743
2184
|
}
|
|
1744
|
-
) : /* @__PURE__ */
|
|
2185
|
+
) : /* @__PURE__ */ jsx15(Fragment4, {})
|
|
1745
2186
|
] });
|
|
1746
2187
|
}
|
|
1747
2188
|
);
|
|
1748
2189
|
Dropdown.displayName = "Dropdown";
|
|
1749
2190
|
|
|
1750
2191
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1751
|
-
import { forwardRef as
|
|
1752
|
-
import { jsx as
|
|
1753
|
-
var
|
|
2192
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
2193
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2194
|
+
var inlineClasses = {
|
|
1754
2195
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1755
2196
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
1756
2197
|
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
1757
2198
|
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
1758
2199
|
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
1759
2200
|
};
|
|
1760
|
-
var
|
|
2201
|
+
var pageClasses = {
|
|
1761
2202
|
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
1762
2203
|
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
1763
2204
|
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
1764
2205
|
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
1765
2206
|
common: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
1766
2207
|
};
|
|
1767
|
-
var
|
|
2208
|
+
var actionsPageClasses = {
|
|
1768
2209
|
info: "text-enabled-inverse",
|
|
1769
2210
|
success: "text-enabled-inverse",
|
|
1770
2211
|
warning: "text-enabled-dark",
|
|
@@ -1779,25 +2220,25 @@ var inlineIconClasses2 = {
|
|
|
1779
2220
|
common: "text-alert-inline-common-icon"
|
|
1780
2221
|
};
|
|
1781
2222
|
function InfoIcon2({ className }) {
|
|
1782
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsx16("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6h.01M9 10h1v4h1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1783
2224
|
}
|
|
1784
2225
|
function SuccessIcon2({ className }) {
|
|
1785
|
-
return /* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsxs14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2227
|
+
/* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2228
|
+
/* @__PURE__ */ jsx16("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1788
2229
|
] });
|
|
1789
2230
|
}
|
|
1790
2231
|
function WarningIcon3({ className }) {
|
|
1791
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsx16("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M8.57 3.22 1.53 15.5a1.67 1.67 0 0 0 1.43 2.5h14.08a1.67 1.67 0 0 0 1.43-2.5L11.43 3.22a1.67 1.67 0 0 0-2.86 0ZM10 7.5v3.33M10 14.17h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1792
2233
|
}
|
|
1793
2234
|
function DangerIcon2({ className }) {
|
|
1794
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ jsx16("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12.5 7.5l-5 5M7.5 7.5l5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1795
2236
|
}
|
|
1796
2237
|
function CommonIcon({ className }) {
|
|
1797
|
-
return /* @__PURE__ */
|
|
2238
|
+
return /* @__PURE__ */ jsx16("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6v4M10 14h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1798
2239
|
}
|
|
1799
2240
|
function CloseIcon4({ className }) {
|
|
1800
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ jsx16("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1801
2242
|
}
|
|
1802
2243
|
var defaultIcons2 = {
|
|
1803
2244
|
info: InfoIcon2,
|
|
@@ -1806,7 +2247,7 @@ var defaultIcons2 = {
|
|
|
1806
2247
|
danger: DangerIcon2,
|
|
1807
2248
|
common: CommonIcon
|
|
1808
2249
|
};
|
|
1809
|
-
var FinancialLogo =
|
|
2250
|
+
var FinancialLogo = forwardRef16(
|
|
1810
2251
|
(_a, ref) => {
|
|
1811
2252
|
var _b = _a, {
|
|
1812
2253
|
variant = "info",
|
|
@@ -1830,8 +2271,8 @@ var FinancialLogo = forwardRef14(
|
|
|
1830
2271
|
"children"
|
|
1831
2272
|
]);
|
|
1832
2273
|
const isPage = mode === "page";
|
|
1833
|
-
const variantClass = isPage ?
|
|
1834
|
-
const actionClass = isPage ?
|
|
2274
|
+
const variantClass = isPage ? pageClasses[variant] : inlineClasses[variant];
|
|
2275
|
+
const actionClass = isPage ? actionsPageClasses[variant] : "text-enabled";
|
|
1835
2276
|
const DefaultIcon = defaultIcons2[variant];
|
|
1836
2277
|
const iconColorClass = isPage ? "" : inlineIconClasses2[variant];
|
|
1837
2278
|
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
@@ -1842,22 +2283,22 @@ var FinancialLogo = forwardRef14(
|
|
|
1842
2283
|
variantClass,
|
|
1843
2284
|
className
|
|
1844
2285
|
].filter(Boolean).join(" ");
|
|
1845
|
-
return /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
title && /* @__PURE__ */
|
|
1849
|
-
description && /* @__PURE__ */
|
|
2286
|
+
return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2287
|
+
/* @__PURE__ */ jsx16("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx16(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2288
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
|
|
2289
|
+
title && /* @__PURE__ */ jsx16("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
2290
|
+
description && /* @__PURE__ */ jsx16("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1850
2291
|
children
|
|
1851
2292
|
] }),
|
|
1852
|
-
action && /* @__PURE__ */
|
|
1853
|
-
onClose && /* @__PURE__ */
|
|
2293
|
+
action && /* @__PURE__ */ jsx16("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
2294
|
+
onClose && /* @__PURE__ */ jsx16(
|
|
1854
2295
|
"button",
|
|
1855
2296
|
{
|
|
1856
2297
|
type: "button",
|
|
1857
2298
|
onClick: onClose,
|
|
1858
2299
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1859
2300
|
"aria-label": "Close",
|
|
1860
|
-
children: /* @__PURE__ */
|
|
2301
|
+
children: /* @__PURE__ */ jsx16(CloseIcon4, { className: "h-16 w-16" })
|
|
1861
2302
|
}
|
|
1862
2303
|
)
|
|
1863
2304
|
] }));
|
|
@@ -1866,9 +2307,9 @@ var FinancialLogo = forwardRef14(
|
|
|
1866
2307
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1867
2308
|
|
|
1868
2309
|
// src/components/Icon/Icon.tsx
|
|
1869
|
-
import { forwardRef as
|
|
1870
|
-
import { jsx as
|
|
1871
|
-
var Icon =
|
|
2310
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
2311
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2312
|
+
var Icon = forwardRef17(
|
|
1872
2313
|
(_a, ref) => {
|
|
1873
2314
|
var _b = _a, {
|
|
1874
2315
|
name,
|
|
@@ -1896,7 +2337,7 @@ var Icon = forwardRef15(
|
|
|
1896
2337
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1897
2338
|
className
|
|
1898
2339
|
].filter(Boolean).join(" ");
|
|
1899
|
-
return /* @__PURE__ */
|
|
2340
|
+
return /* @__PURE__ */ jsx17(
|
|
1900
2341
|
"span",
|
|
1901
2342
|
__spreadProps(__spreadValues({
|
|
1902
2343
|
ref,
|
|
@@ -1919,8 +2360,8 @@ var Icon = forwardRef15(
|
|
|
1919
2360
|
Icon.displayName = "Icon";
|
|
1920
2361
|
|
|
1921
2362
|
// src/components/Link/Link.tsx
|
|
1922
|
-
import { forwardRef as
|
|
1923
|
-
import { jsx as
|
|
2363
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
2364
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1924
2365
|
var linkStyleClasses = {
|
|
1925
2366
|
brand: "font-sans text-link-text-enabled",
|
|
1926
2367
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1942,12 +2383,12 @@ var iconVariantClasses = {
|
|
|
1942
2383
|
lg: "w-24 h-24"
|
|
1943
2384
|
};
|
|
1944
2385
|
function SuccessIcon3({ className }) {
|
|
1945
|
-
return /* @__PURE__ */
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
2386
|
+
return /* @__PURE__ */ jsxs15("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2387
|
+
/* @__PURE__ */ jsx18("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2388
|
+
/* @__PURE__ */ jsx18("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1948
2389
|
] });
|
|
1949
2390
|
}
|
|
1950
|
-
var Link =
|
|
2391
|
+
var Link = forwardRef18(
|
|
1951
2392
|
(_a, ref) => {
|
|
1952
2393
|
var _b = _a, {
|
|
1953
2394
|
variant = "sm",
|
|
@@ -1978,9 +2419,9 @@ var Link = forwardRef16(
|
|
|
1978
2419
|
variantClass,
|
|
1979
2420
|
className
|
|
1980
2421
|
].filter(Boolean).join(" ");
|
|
1981
|
-
return /* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
icon && !isInline ? /* @__PURE__ */
|
|
2422
|
+
return /* @__PURE__ */ jsxs15("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
2423
|
+
/* @__PURE__ */ jsx18("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
2424
|
+
icon && !isInline ? /* @__PURE__ */ jsx18(SuccessIcon3, { className: iconClass }) : null
|
|
1984
2425
|
] }));
|
|
1985
2426
|
}
|
|
1986
2427
|
);
|
|
@@ -1988,11 +2429,11 @@ Link.displayName = "Link";
|
|
|
1988
2429
|
|
|
1989
2430
|
// src/components/Radio/Radio.tsx
|
|
1990
2431
|
import {
|
|
1991
|
-
forwardRef as
|
|
2432
|
+
forwardRef as forwardRef19,
|
|
1992
2433
|
useId as useId4
|
|
1993
2434
|
} from "react";
|
|
1994
|
-
import { jsx as
|
|
1995
|
-
var Radio =
|
|
2435
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2436
|
+
var Radio = forwardRef19(
|
|
1996
2437
|
(_a, ref) => {
|
|
1997
2438
|
var _b = _a, {
|
|
1998
2439
|
size = "sm",
|
|
@@ -2019,18 +2460,18 @@ var Radio = forwardRef17(
|
|
|
2019
2460
|
]);
|
|
2020
2461
|
const reactId = useId4();
|
|
2021
2462
|
const inputId = id != null ? id : reactId;
|
|
2022
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsx19(
|
|
2023
2464
|
"div",
|
|
2024
2465
|
{
|
|
2025
2466
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
2026
|
-
children: /* @__PURE__ */
|
|
2467
|
+
children: /* @__PURE__ */ jsxs16(
|
|
2027
2468
|
"label",
|
|
2028
2469
|
{
|
|
2029
2470
|
htmlFor: inputId,
|
|
2030
2471
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
2031
2472
|
children: [
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2474
|
+
/* @__PURE__ */ jsx19(
|
|
2034
2475
|
"input",
|
|
2035
2476
|
__spreadValues({
|
|
2036
2477
|
ref,
|
|
@@ -2043,14 +2484,14 @@ var Radio = forwardRef17(
|
|
|
2043
2484
|
name
|
|
2044
2485
|
}, rest)
|
|
2045
2486
|
),
|
|
2046
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx19(
|
|
2047
2488
|
"div",
|
|
2048
2489
|
{
|
|
2049
2490
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
2050
2491
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
2051
2492
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
2052
2493
|
`,
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2494
|
+
children: /* @__PURE__ */ jsx19(
|
|
2054
2495
|
"span",
|
|
2055
2496
|
{
|
|
2056
2497
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -2061,12 +2502,12 @@ var Radio = forwardRef17(
|
|
|
2061
2502
|
}
|
|
2062
2503
|
)
|
|
2063
2504
|
] }),
|
|
2064
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ jsxs16(
|
|
2065
2506
|
"div",
|
|
2066
2507
|
{
|
|
2067
2508
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
2068
2509
|
children: [
|
|
2069
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsx19(
|
|
2070
2511
|
"p",
|
|
2071
2512
|
{
|
|
2072
2513
|
className: `
|
|
@@ -2076,7 +2517,7 @@ var Radio = forwardRef17(
|
|
|
2076
2517
|
children: label
|
|
2077
2518
|
}
|
|
2078
2519
|
),
|
|
2079
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx19(
|
|
2080
2521
|
"p",
|
|
2081
2522
|
{
|
|
2082
2523
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -2096,29 +2537,45 @@ var Radio = forwardRef17(
|
|
|
2096
2537
|
Radio.displayName = "Radio";
|
|
2097
2538
|
|
|
2098
2539
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
2099
|
-
import {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2540
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
2541
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2542
|
+
var itemSizeClasses = {
|
|
2543
|
+
sm: "min-h-32 px-8 py-6 text-label-medium",
|
|
2544
|
+
md: "min-h-40 px-12 py-8 text-label-large",
|
|
2545
|
+
lg: "min-h-48 px-16 py-8 text-label-large"
|
|
2546
|
+
};
|
|
2547
|
+
var SegmentControl = forwardRef20(
|
|
2104
2548
|
(_a, ref) => {
|
|
2105
|
-
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
2106
|
-
return /* @__PURE__ */
|
|
2549
|
+
var _b = _a, { size = "md", items, selected, setSelected, onChange, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "onChange", "className"]);
|
|
2550
|
+
return /* @__PURE__ */ jsx20(
|
|
2107
2551
|
"div",
|
|
2108
2552
|
__spreadProps(__spreadValues({
|
|
2109
2553
|
ref,
|
|
2110
|
-
className: `bg-background-tertiary rounded-full flex flex-row items-center
|
|
2554
|
+
className: `bg-background-tertiary rounded-full flex flex-row items-center p-4 gap-4 ${className}`
|
|
2111
2555
|
}, rest), {
|
|
2112
|
-
children: items.map((item) =>
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2556
|
+
children: items.map((item) => {
|
|
2557
|
+
const isSelected = selected === item.value;
|
|
2558
|
+
return /* @__PURE__ */ jsx20(
|
|
2559
|
+
"button",
|
|
2560
|
+
{
|
|
2561
|
+
type: "button",
|
|
2562
|
+
"aria-pressed": isSelected,
|
|
2563
|
+
onClick: () => {
|
|
2564
|
+
setSelected == null ? void 0 : setSelected(item.value);
|
|
2565
|
+
onChange == null ? void 0 : onChange(item.value);
|
|
2566
|
+
},
|
|
2567
|
+
className: "group flex-1 min-w-0 rounded-full border-2 border-transparent p-2 outline-none cursor-pointer transition-colors focus-visible:border-segmented-control-border-focus",
|
|
2568
|
+
children: /* @__PURE__ */ jsx20(
|
|
2569
|
+
"span",
|
|
2570
|
+
{
|
|
2571
|
+
className: `flex w-full items-center justify-center rounded-full text-center transition-colors ${itemSizeClasses[size]} ${isSelected ? "bg-segmented-control-background-active text-segmented-control-text-inverse shadow-small group-focus-visible:bg-segmented-control-background-active-focus group-focus-visible:text-segmented-control-text-primary" : "text-segmented-control-text-primary hover:bg-segmented-control-background-hover"}`,
|
|
2572
|
+
children: item.label
|
|
2573
|
+
}
|
|
2574
|
+
)
|
|
2575
|
+
},
|
|
2576
|
+
item.value
|
|
2577
|
+
);
|
|
2578
|
+
})
|
|
2122
2579
|
})
|
|
2123
2580
|
);
|
|
2124
2581
|
}
|
|
@@ -2127,12 +2584,12 @@ SegmentControl.displayName = "SegmentControl";
|
|
|
2127
2584
|
|
|
2128
2585
|
// src/components/Slider/Slider.tsx
|
|
2129
2586
|
import {
|
|
2130
|
-
forwardRef as
|
|
2587
|
+
forwardRef as forwardRef21,
|
|
2131
2588
|
useCallback as useCallback2,
|
|
2132
2589
|
useId as useId5,
|
|
2133
|
-
useState as
|
|
2590
|
+
useState as useState9
|
|
2134
2591
|
} from "react";
|
|
2135
|
-
import { jsx as
|
|
2592
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2136
2593
|
var sizeConfig = {
|
|
2137
2594
|
small: {
|
|
2138
2595
|
trackH: "h-4",
|
|
@@ -2163,7 +2620,7 @@ var sizeConfig = {
|
|
|
2163
2620
|
}
|
|
2164
2621
|
};
|
|
2165
2622
|
function ChevronGlyphs({ size, color }) {
|
|
2166
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ jsxs17(
|
|
2167
2624
|
"svg",
|
|
2168
2625
|
{
|
|
2169
2626
|
width: size,
|
|
@@ -2173,7 +2630,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2173
2630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2174
2631
|
"aria-hidden": "true",
|
|
2175
2632
|
children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsx21(
|
|
2177
2634
|
"path",
|
|
2178
2635
|
{
|
|
2179
2636
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -2183,7 +2640,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2183
2640
|
strokeLinejoin: "round"
|
|
2184
2641
|
}
|
|
2185
2642
|
),
|
|
2186
|
-
/* @__PURE__ */
|
|
2643
|
+
/* @__PURE__ */ jsx21(
|
|
2187
2644
|
"path",
|
|
2188
2645
|
{
|
|
2189
2646
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -2197,7 +2654,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2197
2654
|
}
|
|
2198
2655
|
);
|
|
2199
2656
|
}
|
|
2200
|
-
var Slider =
|
|
2657
|
+
var Slider = forwardRef21(
|
|
2201
2658
|
(_a, ref) => {
|
|
2202
2659
|
var _b = _a, {
|
|
2203
2660
|
size = "medium",
|
|
@@ -2238,7 +2695,7 @@ var Slider = forwardRef19(
|
|
|
2238
2695
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
2239
2696
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
2240
2697
|
const isControlled = controlledValue !== void 0;
|
|
2241
|
-
const [internalValue, setInternalValue] =
|
|
2698
|
+
const [internalValue, setInternalValue] = useState9(defaultValue != null ? defaultValue : min);
|
|
2242
2699
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
2243
2700
|
const handleChange = useCallback2(
|
|
2244
2701
|
(e) => {
|
|
@@ -2260,13 +2717,13 @@ var Slider = forwardRef19(
|
|
|
2260
2717
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
2261
2718
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
2262
2719
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
2263
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsxs17(
|
|
2264
2721
|
"div",
|
|
2265
2722
|
{
|
|
2266
2723
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
2267
2724
|
children: [
|
|
2268
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
2269
|
-
label && /* @__PURE__ */
|
|
2725
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between", children: [
|
|
2726
|
+
label && /* @__PURE__ */ jsx21(
|
|
2270
2727
|
"label",
|
|
2271
2728
|
{
|
|
2272
2729
|
htmlFor: inputId,
|
|
@@ -2279,7 +2736,7 @@ var Slider = forwardRef19(
|
|
|
2279
2736
|
children: label
|
|
2280
2737
|
}
|
|
2281
2738
|
),
|
|
2282
|
-
showValue && /* @__PURE__ */
|
|
2739
|
+
showValue && /* @__PURE__ */ jsx21(
|
|
2283
2740
|
"span",
|
|
2284
2741
|
{
|
|
2285
2742
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -2287,7 +2744,7 @@ var Slider = forwardRef19(
|
|
|
2287
2744
|
}
|
|
2288
2745
|
)
|
|
2289
2746
|
] }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsxs17(
|
|
2291
2748
|
"div",
|
|
2292
2749
|
{
|
|
2293
2750
|
className: [
|
|
@@ -2296,7 +2753,7 @@ var Slider = forwardRef19(
|
|
|
2296
2753
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2297
2754
|
].join(" "),
|
|
2298
2755
|
children: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx21(
|
|
2300
2757
|
"div",
|
|
2301
2758
|
{
|
|
2302
2759
|
className: [
|
|
@@ -2306,14 +2763,14 @@ var Slider = forwardRef19(
|
|
|
2306
2763
|
].join(" ")
|
|
2307
2764
|
}
|
|
2308
2765
|
),
|
|
2309
|
-
/* @__PURE__ */
|
|
2766
|
+
/* @__PURE__ */ jsx21(
|
|
2310
2767
|
"div",
|
|
2311
2768
|
{
|
|
2312
2769
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2313
2770
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2314
2771
|
}
|
|
2315
2772
|
),
|
|
2316
|
-
/* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ jsx21(
|
|
2317
2774
|
"input",
|
|
2318
2775
|
__spreadValues({
|
|
2319
2776
|
ref,
|
|
@@ -2334,7 +2791,7 @@ var Slider = forwardRef19(
|
|
|
2334
2791
|
].join(" ")
|
|
2335
2792
|
}, rest)
|
|
2336
2793
|
),
|
|
2337
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ jsx21(
|
|
2338
2795
|
"div",
|
|
2339
2796
|
{
|
|
2340
2797
|
className: [
|
|
@@ -2347,13 +2804,13 @@ var Slider = forwardRef19(
|
|
|
2347
2804
|
!disabled && "peer-hover:shadow-medium"
|
|
2348
2805
|
].filter(Boolean).join(" "),
|
|
2349
2806
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2350
|
-
children: /* @__PURE__ */
|
|
2807
|
+
children: /* @__PURE__ */ jsx21(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2351
2808
|
}
|
|
2352
2809
|
)
|
|
2353
2810
|
]
|
|
2354
2811
|
}
|
|
2355
2812
|
),
|
|
2356
|
-
description && /* @__PURE__ */
|
|
2813
|
+
description && /* @__PURE__ */ jsx21(
|
|
2357
2814
|
"span",
|
|
2358
2815
|
{
|
|
2359
2816
|
id: ariaDescriptionId,
|
|
@@ -2369,9 +2826,9 @@ var Slider = forwardRef19(
|
|
|
2369
2826
|
Slider.displayName = "Slider";
|
|
2370
2827
|
|
|
2371
2828
|
// src/components/Tab/Tab.tsx
|
|
2372
|
-
import { forwardRef as
|
|
2373
|
-
import { jsx as
|
|
2374
|
-
var Tab =
|
|
2829
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
2830
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2831
|
+
var Tab = forwardRef22(
|
|
2375
2832
|
(_a, ref) => {
|
|
2376
2833
|
var _b = _a, {
|
|
2377
2834
|
size = "md",
|
|
@@ -2390,7 +2847,7 @@ var Tab = forwardRef20(
|
|
|
2390
2847
|
"setSelected",
|
|
2391
2848
|
"className"
|
|
2392
2849
|
]);
|
|
2393
|
-
return /* @__PURE__ */
|
|
2850
|
+
return /* @__PURE__ */ jsx22(
|
|
2394
2851
|
"div",
|
|
2395
2852
|
__spreadProps(__spreadValues({
|
|
2396
2853
|
ref,
|
|
@@ -2409,11 +2866,11 @@ Tab.displayName = "Tab";
|
|
|
2409
2866
|
|
|
2410
2867
|
// src/components/TextArea/TextArea.tsx
|
|
2411
2868
|
import {
|
|
2412
|
-
useState as
|
|
2413
|
-
forwardRef as
|
|
2869
|
+
useState as useState10,
|
|
2870
|
+
forwardRef as forwardRef23
|
|
2414
2871
|
} from "react";
|
|
2415
|
-
import { Fragment as Fragment5, jsx as
|
|
2416
|
-
var TextArea =
|
|
2872
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2873
|
+
var TextArea = forwardRef23(
|
|
2417
2874
|
(_a, ref) => {
|
|
2418
2875
|
var _b = _a, {
|
|
2419
2876
|
error,
|
|
@@ -2453,21 +2910,21 @@ var TextArea = forwardRef21(
|
|
|
2453
2910
|
"className"
|
|
2454
2911
|
]);
|
|
2455
2912
|
var _a2;
|
|
2456
|
-
const [isFocused, setIsFocused] =
|
|
2913
|
+
const [isFocused, setIsFocused] = useState10(false);
|
|
2457
2914
|
const isActive = isFocused && !!value;
|
|
2458
|
-
return /* @__PURE__ */
|
|
2459
|
-
label || showCounter ? /* @__PURE__ */
|
|
2460
|
-
label ? /* @__PURE__ */
|
|
2915
|
+
return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2916
|
+
label || showCounter ? /* @__PURE__ */ jsxs18("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2917
|
+
label ? /* @__PURE__ */ jsxs18(
|
|
2461
2918
|
"p",
|
|
2462
2919
|
{
|
|
2463
2920
|
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2464
2921
|
children: [
|
|
2465
2922
|
label,
|
|
2466
|
-
optional && /* @__PURE__ */
|
|
2923
|
+
optional && /* @__PURE__ */ jsx23("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2467
2924
|
]
|
|
2468
2925
|
}
|
|
2469
|
-
) : /* @__PURE__ */
|
|
2470
|
-
showCounter && /* @__PURE__ */
|
|
2926
|
+
) : /* @__PURE__ */ jsx23("span", {}),
|
|
2927
|
+
showCounter && /* @__PURE__ */ jsxs18(
|
|
2471
2928
|
"p",
|
|
2472
2929
|
{
|
|
2473
2930
|
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
@@ -2478,13 +2935,13 @@ var TextArea = forwardRef21(
|
|
|
2478
2935
|
]
|
|
2479
2936
|
}
|
|
2480
2937
|
)
|
|
2481
|
-
] }) : /* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2938
|
+
] }) : /* @__PURE__ */ jsx23(Fragment5, {}),
|
|
2939
|
+
/* @__PURE__ */ jsxs18(
|
|
2483
2940
|
"div",
|
|
2484
2941
|
{
|
|
2485
2942
|
className: `relative w-full rounded-6 border ${disabled ? "bg-text-area-background-disabled border-text-area-border-disabled" : error ? `bg-text-area-background-enabled border-text-area-border-danger ${isFocused ? "ring-1 ring-inset ring-text-area-border-danger" : ""}` : isActive ? "bg-text-area-background-enabled border-text-area-border-active ring-1 ring-inset ring-text-area-border-active" : isFocused ? "bg-text-area-background-enabled border-text-area-border-focus ring-1 ring-inset ring-text-area-border-focus" : "bg-text-area-background-enabled border-text-area-border-enabled hover:border-text-area-border-hover"} ${className != null ? className : ""}`,
|
|
2486
2943
|
children: [
|
|
2487
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ jsx23(
|
|
2488
2945
|
"textarea",
|
|
2489
2946
|
__spreadValues({
|
|
2490
2947
|
ref,
|
|
@@ -2505,13 +2962,14 @@ var TextArea = forwardRef21(
|
|
|
2505
2962
|
className: `block w-full min-w-0 pt-12 pb-8 pl-16 pr-48 text-body-small bg-transparent focus:outline-none placeholder:text-text-area-text-tertiary ${disabled ? "resize-none text-text-area-text-disabled" : "resize-y text-text-area-text-primary"}`
|
|
2506
2963
|
}, props)
|
|
2507
2964
|
),
|
|
2508
|
-
pending ? /* @__PURE__ */
|
|
2965
|
+
pending ? /* @__PURE__ */ jsx23(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx23(
|
|
2509
2966
|
IconButton,
|
|
2510
2967
|
{
|
|
2511
2968
|
size: "s",
|
|
2969
|
+
transparent: true,
|
|
2512
2970
|
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2513
2971
|
className: "absolute right-6 top-6",
|
|
2514
|
-
icon: /* @__PURE__ */
|
|
2972
|
+
icon: /* @__PURE__ */ jsx23(
|
|
2515
2973
|
"svg",
|
|
2516
2974
|
{
|
|
2517
2975
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2519,7 +2977,7 @@ var TextArea = forwardRef21(
|
|
|
2519
2977
|
height: "20",
|
|
2520
2978
|
viewBox: "0 0 20 20",
|
|
2521
2979
|
fill: "none",
|
|
2522
|
-
children: /* @__PURE__ */
|
|
2980
|
+
children: /* @__PURE__ */ jsx23(
|
|
2523
2981
|
"path",
|
|
2524
2982
|
{
|
|
2525
2983
|
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
@@ -2537,7 +2995,7 @@ var TextArea = forwardRef21(
|
|
|
2537
2995
|
});
|
|
2538
2996
|
}
|
|
2539
2997
|
}
|
|
2540
|
-
) : success ? /* @__PURE__ */
|
|
2998
|
+
) : success ? /* @__PURE__ */ jsx23(
|
|
2541
2999
|
"svg",
|
|
2542
3000
|
{
|
|
2543
3001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2546,7 +3004,7 @@ var TextArea = forwardRef21(
|
|
|
2546
3004
|
viewBox: "0 0 20 20",
|
|
2547
3005
|
fill: "none",
|
|
2548
3006
|
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2549
|
-
children: /* @__PURE__ */
|
|
3007
|
+
children: /* @__PURE__ */ jsx23(
|
|
2550
3008
|
"path",
|
|
2551
3009
|
{
|
|
2552
3010
|
fillRule: "evenodd",
|
|
@@ -2556,7 +3014,7 @@ var TextArea = forwardRef21(
|
|
|
2556
3014
|
}
|
|
2557
3015
|
)
|
|
2558
3016
|
}
|
|
2559
|
-
) : error ? /* @__PURE__ */
|
|
3017
|
+
) : error ? /* @__PURE__ */ jsx23(
|
|
2560
3018
|
"svg",
|
|
2561
3019
|
{
|
|
2562
3020
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2565,7 +3023,7 @@ var TextArea = forwardRef21(
|
|
|
2565
3023
|
viewBox: "0 0 20 20",
|
|
2566
3024
|
fill: "none",
|
|
2567
3025
|
className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2568
|
-
children: /* @__PURE__ */
|
|
3026
|
+
children: /* @__PURE__ */ jsx23(
|
|
2569
3027
|
"path",
|
|
2570
3028
|
{
|
|
2571
3029
|
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
@@ -2573,242 +3031,42 @@ var TextArea = forwardRef21(
|
|
|
2573
3031
|
}
|
|
2574
3032
|
)
|
|
2575
3033
|
}
|
|
2576
|
-
) : /* @__PURE__ */
|
|
3034
|
+
) : /* @__PURE__ */ jsx23(Fragment5, {})
|
|
2577
3035
|
]
|
|
2578
3036
|
}
|
|
2579
3037
|
),
|
|
2580
|
-
error ? /* @__PURE__ */
|
|
3038
|
+
error ? /* @__PURE__ */ jsx23("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx23(
|
|
2581
3039
|
"p",
|
|
2582
3040
|
{
|
|
2583
3041
|
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2584
3042
|
children: helperText
|
|
2585
3043
|
}
|
|
2586
|
-
) : /* @__PURE__ */
|
|
3044
|
+
) : /* @__PURE__ */ jsx23(Fragment5, {})
|
|
2587
3045
|
] });
|
|
2588
3046
|
}
|
|
2589
3047
|
);
|
|
2590
3048
|
TextArea.displayName = "TextArea";
|
|
2591
3049
|
|
|
2592
|
-
// src/components/TextField/TextField.tsx
|
|
2593
|
-
import {
|
|
2594
|
-
useState as useState10,
|
|
2595
|
-
useRef as useRef2,
|
|
2596
|
-
useImperativeHandle,
|
|
2597
|
-
forwardRef as forwardRef22
|
|
2598
|
-
} from "react";
|
|
2599
|
-
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2600
|
-
var TextField = forwardRef22(
|
|
2601
|
-
(_a, ref) => {
|
|
2602
|
-
var _b = _a, {
|
|
2603
|
-
size = "md",
|
|
2604
|
-
error,
|
|
2605
|
-
label,
|
|
2606
|
-
placeholder,
|
|
2607
|
-
helperText,
|
|
2608
|
-
prefix,
|
|
2609
|
-
suffix,
|
|
2610
|
-
optional = false,
|
|
2611
|
-
success = false,
|
|
2612
|
-
pending = false,
|
|
2613
|
-
clearable = true,
|
|
2614
|
-
disabled = false,
|
|
2615
|
-
type,
|
|
2616
|
-
value,
|
|
2617
|
-
onChange,
|
|
2618
|
-
onFocus,
|
|
2619
|
-
onBlur,
|
|
2620
|
-
className
|
|
2621
|
-
} = _b, props = __objRest(_b, [
|
|
2622
|
-
"size",
|
|
2623
|
-
"error",
|
|
2624
|
-
"label",
|
|
2625
|
-
"placeholder",
|
|
2626
|
-
"helperText",
|
|
2627
|
-
"prefix",
|
|
2628
|
-
"suffix",
|
|
2629
|
-
"optional",
|
|
2630
|
-
"success",
|
|
2631
|
-
"pending",
|
|
2632
|
-
"clearable",
|
|
2633
|
-
"disabled",
|
|
2634
|
-
"type",
|
|
2635
|
-
"value",
|
|
2636
|
-
"onChange",
|
|
2637
|
-
"onFocus",
|
|
2638
|
-
"onBlur",
|
|
2639
|
-
"className"
|
|
2640
|
-
]);
|
|
2641
|
-
const [isFocused, setIsFocused] = useState10(false);
|
|
2642
|
-
const isActive = isFocused && !!value;
|
|
2643
|
-
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
2644
|
-
const inputRef = useRef2(null);
|
|
2645
|
-
useImperativeHandle(ref, () => inputRef.current);
|
|
2646
|
-
return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2647
|
-
label ? /* @__PURE__ */ jsxs18(
|
|
2648
|
-
"p",
|
|
2649
|
-
{
|
|
2650
|
-
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
2651
|
-
children: [
|
|
2652
|
-
label,
|
|
2653
|
-
optional && /* @__PURE__ */ jsx22("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2654
|
-
]
|
|
2655
|
-
}
|
|
2656
|
-
) : /* @__PURE__ */ jsx22(Fragment6, {}),
|
|
2657
|
-
/* @__PURE__ */ jsxs18(
|
|
2658
|
-
"div",
|
|
2659
|
-
{
|
|
2660
|
-
className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
|
|
2661
|
-
onMouseDown: (e) => {
|
|
2662
|
-
var _a2;
|
|
2663
|
-
if (e.target !== inputRef.current && !disabled) {
|
|
2664
|
-
e.preventDefault();
|
|
2665
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2666
|
-
}
|
|
2667
|
-
},
|
|
2668
|
-
children: [
|
|
2669
|
-
prefix && /* @__PURE__ */ jsx22(
|
|
2670
|
-
"span",
|
|
2671
|
-
{
|
|
2672
|
-
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2673
|
-
children: prefix
|
|
2674
|
-
}
|
|
2675
|
-
),
|
|
2676
|
-
/* @__PURE__ */ jsx22(
|
|
2677
|
-
"input",
|
|
2678
|
-
__spreadValues({
|
|
2679
|
-
ref: inputRef,
|
|
2680
|
-
type: type || "text",
|
|
2681
|
-
placeholder,
|
|
2682
|
-
disabled: disabled || pending,
|
|
2683
|
-
onFocus: (e) => {
|
|
2684
|
-
setIsFocused(true);
|
|
2685
|
-
onFocus == null ? void 0 : onFocus(e);
|
|
2686
|
-
},
|
|
2687
|
-
onBlur: (e) => {
|
|
2688
|
-
setIsFocused(false);
|
|
2689
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
2690
|
-
},
|
|
2691
|
-
value,
|
|
2692
|
-
onChange,
|
|
2693
|
-
className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
|
|
2694
|
-
}, props)
|
|
2695
|
-
),
|
|
2696
|
-
suffix && /* @__PURE__ */ jsx22(
|
|
2697
|
-
"span",
|
|
2698
|
-
{
|
|
2699
|
-
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2700
|
-
children: suffix
|
|
2701
|
-
}
|
|
2702
|
-
),
|
|
2703
|
-
(pending || clearable || success || error) && /* @__PURE__ */ jsx22(
|
|
2704
|
-
"span",
|
|
2705
|
-
{
|
|
2706
|
-
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
2707
|
-
children: pending ? /* @__PURE__ */ jsx22(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx22(
|
|
2708
|
-
IconButton,
|
|
2709
|
-
{
|
|
2710
|
-
size: iconButtonSize,
|
|
2711
|
-
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2712
|
-
icon: /* @__PURE__ */ jsx22(
|
|
2713
|
-
"svg",
|
|
2714
|
-
{
|
|
2715
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2716
|
-
width: "20",
|
|
2717
|
-
height: "20",
|
|
2718
|
-
viewBox: "0 0 20 20",
|
|
2719
|
-
fill: "none",
|
|
2720
|
-
children: /* @__PURE__ */ jsx22(
|
|
2721
|
-
"path",
|
|
2722
|
-
{
|
|
2723
|
-
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
2724
|
-
fill: "currentColor"
|
|
2725
|
-
}
|
|
2726
|
-
)
|
|
2727
|
-
}
|
|
2728
|
-
),
|
|
2729
|
-
onMouseDown: (e) => {
|
|
2730
|
-
e.preventDefault();
|
|
2731
|
-
},
|
|
2732
|
-
onClick: () => {
|
|
2733
|
-
onChange == null ? void 0 : onChange({
|
|
2734
|
-
target: { value: "" }
|
|
2735
|
-
});
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
) : success ? /* @__PURE__ */ jsx22(
|
|
2739
|
-
"svg",
|
|
2740
|
-
{
|
|
2741
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2742
|
-
width: "20",
|
|
2743
|
-
height: "20",
|
|
2744
|
-
viewBox: "0 0 20 20",
|
|
2745
|
-
fill: "none",
|
|
2746
|
-
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
2747
|
-
children: /* @__PURE__ */ jsx22(
|
|
2748
|
-
"path",
|
|
2749
|
-
{
|
|
2750
|
-
fillRule: "evenodd",
|
|
2751
|
-
clipRule: "evenodd",
|
|
2752
|
-
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2753
|
-
fill: "currentColor"
|
|
2754
|
-
}
|
|
2755
|
-
)
|
|
2756
|
-
}
|
|
2757
|
-
) : error ? /* @__PURE__ */ jsx22(
|
|
2758
|
-
"svg",
|
|
2759
|
-
{
|
|
2760
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2761
|
-
width: "20",
|
|
2762
|
-
height: "20",
|
|
2763
|
-
viewBox: "0 0 20 20",
|
|
2764
|
-
fill: "none",
|
|
2765
|
-
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
2766
|
-
children: /* @__PURE__ */ jsx22(
|
|
2767
|
-
"path",
|
|
2768
|
-
{
|
|
2769
|
-
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
2770
|
-
fill: "currentColor"
|
|
2771
|
-
}
|
|
2772
|
-
)
|
|
2773
|
-
}
|
|
2774
|
-
) : null
|
|
2775
|
-
}
|
|
2776
|
-
)
|
|
2777
|
-
]
|
|
2778
|
-
}
|
|
2779
|
-
),
|
|
2780
|
-
error ? /* @__PURE__ */ jsx22("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx22(
|
|
2781
|
-
"p",
|
|
2782
|
-
{
|
|
2783
|
-
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
2784
|
-
children: helperText
|
|
2785
|
-
}
|
|
2786
|
-
) : /* @__PURE__ */ jsx22(Fragment6, {})
|
|
2787
|
-
] });
|
|
2788
|
-
}
|
|
2789
|
-
);
|
|
2790
|
-
TextField.displayName = "TextField";
|
|
2791
|
-
|
|
2792
3050
|
// src/components/Toast/Toast.tsx
|
|
2793
|
-
import { forwardRef as
|
|
2794
|
-
import { jsx as
|
|
3051
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
3052
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2795
3053
|
function CheckCircleIcon({ className }) {
|
|
2796
3054
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsx24("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3056
|
+
/* @__PURE__ */ jsx24("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2799
3057
|
] });
|
|
2800
3058
|
}
|
|
2801
3059
|
function ProgressIcon({ className }) {
|
|
2802
|
-
return /* @__PURE__ */
|
|
3060
|
+
return /* @__PURE__ */ jsx24(Loading, { size: "sm", className });
|
|
2803
3061
|
}
|
|
2804
3062
|
function ErrorIcon({ className }) {
|
|
2805
3063
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
3064
|
+
/* @__PURE__ */ jsx24("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3065
|
+
/* @__PURE__ */ jsx24("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2808
3066
|
] });
|
|
2809
3067
|
}
|
|
2810
3068
|
function CloseIcon5({ className }) {
|
|
2811
|
-
return /* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ jsx24("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx24("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2812
3070
|
}
|
|
2813
3071
|
var defaultIcons3 = {
|
|
2814
3072
|
default: CheckCircleIcon,
|
|
@@ -2825,7 +3083,7 @@ var iconColorClasses = {
|
|
|
2825
3083
|
progress: "text-toast-progress-icon",
|
|
2826
3084
|
error: "text-toast-error-icon"
|
|
2827
3085
|
};
|
|
2828
|
-
var Toast =
|
|
3086
|
+
var Toast = forwardRef24(
|
|
2829
3087
|
(_a, ref) => {
|
|
2830
3088
|
var _b = _a, {
|
|
2831
3089
|
type = "default",
|
|
@@ -2854,9 +3112,9 @@ var Toast = forwardRef23(
|
|
|
2854
3112
|
className
|
|
2855
3113
|
].filter(Boolean).join(" ");
|
|
2856
3114
|
return /* @__PURE__ */ jsxs19("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2857
|
-
icon && /* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
3115
|
+
icon && /* @__PURE__ */ jsx24("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx24(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
3116
|
+
/* @__PURE__ */ jsx24("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
3117
|
+
actionLabel && onAction && /* @__PURE__ */ jsx24(
|
|
2860
3118
|
"button",
|
|
2861
3119
|
{
|
|
2862
3120
|
type: "button",
|
|
@@ -2865,14 +3123,14 @@ var Toast = forwardRef23(
|
|
|
2865
3123
|
children: actionLabel
|
|
2866
3124
|
}
|
|
2867
3125
|
),
|
|
2868
|
-
onDismiss && /* @__PURE__ */
|
|
3126
|
+
onDismiss && /* @__PURE__ */ jsx24(
|
|
2869
3127
|
"button",
|
|
2870
3128
|
{
|
|
2871
3129
|
type: "button",
|
|
2872
3130
|
onClick: onDismiss,
|
|
2873
3131
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2874
3132
|
"aria-label": "Dismiss",
|
|
2875
|
-
children: /* @__PURE__ */
|
|
3133
|
+
children: /* @__PURE__ */ jsx24(CloseIcon5, { className: "h-16 w-16" })
|
|
2876
3134
|
}
|
|
2877
3135
|
)
|
|
2878
3136
|
] }));
|
|
@@ -2881,9 +3139,9 @@ var Toast = forwardRef23(
|
|
|
2881
3139
|
Toast.displayName = "Toast";
|
|
2882
3140
|
|
|
2883
3141
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2884
|
-
import { forwardRef as
|
|
2885
|
-
import { jsx as
|
|
2886
|
-
var ToggleSwitch =
|
|
3142
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
3143
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3144
|
+
var ToggleSwitch = forwardRef25(
|
|
2887
3145
|
(_a, ref) => {
|
|
2888
3146
|
var _b = _a, {
|
|
2889
3147
|
value,
|
|
@@ -2905,7 +3163,7 @@ var ToggleSwitch = forwardRef24(
|
|
|
2905
3163
|
className: `inline-flex items-center ${className}`
|
|
2906
3164
|
}, rest), {
|
|
2907
3165
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
3166
|
+
/* @__PURE__ */ jsx25(
|
|
2909
3167
|
"input",
|
|
2910
3168
|
{
|
|
2911
3169
|
type: "checkbox",
|
|
@@ -2915,7 +3173,7 @@ var ToggleSwitch = forwardRef24(
|
|
|
2915
3173
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2916
3174
|
}
|
|
2917
3175
|
),
|
|
2918
|
-
/* @__PURE__ */
|
|
3176
|
+
/* @__PURE__ */ jsx25(
|
|
2919
3177
|
"div",
|
|
2920
3178
|
{
|
|
2921
3179
|
className: `${isDisabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer hover:bg-gray-300 hover:peer-checked:bg-green-700"} relative w-48 h-26 bg-gray-200 rounded-full peer-checked:after:translate-x-22 rtl:peer-checked:after:-translate-x-22 peer-checked:after:border-white after:content-[''] after:absolute after:top-4 after:left-4 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-18 after:w-18 after:transition-all peer-checked:bg-green-600 `
|
|
@@ -2931,12 +3189,12 @@ ToggleSwitch.displayName = "ToggleSwitch";
|
|
|
2931
3189
|
// src/components/Tooltip/Tooltip.tsx
|
|
2932
3190
|
import {
|
|
2933
3191
|
useState as useState11,
|
|
2934
|
-
useEffect as
|
|
2935
|
-
useRef as
|
|
2936
|
-
forwardRef as
|
|
3192
|
+
useEffect as useEffect5,
|
|
3193
|
+
useRef as useRef4,
|
|
3194
|
+
forwardRef as forwardRef26
|
|
2937
3195
|
} from "react";
|
|
2938
|
-
import { Fragment as
|
|
2939
|
-
var Tooltip =
|
|
3196
|
+
import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3197
|
+
var Tooltip = forwardRef26(
|
|
2940
3198
|
(_a, ref) => {
|
|
2941
3199
|
var _b = _a, {
|
|
2942
3200
|
size = "md",
|
|
@@ -2953,10 +3211,10 @@ var Tooltip = forwardRef25(
|
|
|
2953
3211
|
"position",
|
|
2954
3212
|
"className"
|
|
2955
3213
|
]);
|
|
2956
|
-
const wrapperRef =
|
|
3214
|
+
const wrapperRef = useRef4(null);
|
|
2957
3215
|
const [isVisible, setIsVisible] = useState11(false);
|
|
2958
3216
|
const [isHovered, setIsHovered] = useState11(false);
|
|
2959
|
-
|
|
3217
|
+
useEffect5(() => {
|
|
2960
3218
|
const handleClickOutside = (event) => {
|
|
2961
3219
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2962
3220
|
setIsVisible(false);
|
|
@@ -2975,7 +3233,7 @@ var Tooltip = forwardRef25(
|
|
|
2975
3233
|
ref
|
|
2976
3234
|
}, rest), {
|
|
2977
3235
|
children: [
|
|
2978
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsx26(
|
|
2979
3237
|
"div",
|
|
2980
3238
|
{
|
|
2981
3239
|
ref: wrapperRef,
|
|
@@ -2997,20 +3255,20 @@ var Tooltip = forwardRef25(
|
|
|
2997
3255
|
{
|
|
2998
3256
|
className: `min-w-100 max-w-300 whitespace-nowrap rounded bg-gray-900 text-white ${size === "lg" ? "text-body-regular py-12 px-16" : size === "md" ? "text-body-small px-12 pt-10 pb-8" : "text-body-small px-8 pt-6 pb-4"} ${position === "right" && `absolute left-full top-1/2 z-20 ml-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "top" && `absolute bottom-full left-1/2 z-20 mb-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "left" && `absolute right-full top-1/2 z-20 mr-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "bottom" && `absolute left-1/2 top-full z-20 mt-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}`}`,
|
|
2999
3257
|
children: [
|
|
3000
|
-
/* @__PURE__ */
|
|
3258
|
+
/* @__PURE__ */ jsx26(
|
|
3001
3259
|
"span",
|
|
3002
3260
|
{
|
|
3003
3261
|
className: ` ${position === "right" && `absolute -left-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "top" && `absolute -bottom-3 left-1/2 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black` || position === "left" && `absolute -right-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "bottom" && `absolute left-1/2 -top-3 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black`} `
|
|
3004
3262
|
}
|
|
3005
3263
|
),
|
|
3006
|
-
headText ? /* @__PURE__ */
|
|
3264
|
+
headText ? /* @__PURE__ */ jsx26(
|
|
3007
3265
|
"p",
|
|
3008
3266
|
{
|
|
3009
3267
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
3010
3268
|
children: headText
|
|
3011
3269
|
}
|
|
3012
|
-
) : /* @__PURE__ */
|
|
3013
|
-
text ? /* @__PURE__ */
|
|
3270
|
+
) : /* @__PURE__ */ jsx26(Fragment6, {}),
|
|
3271
|
+
text ? /* @__PURE__ */ jsx26("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx26(Fragment6, {})
|
|
3014
3272
|
]
|
|
3015
3273
|
}
|
|
3016
3274
|
)
|
|
@@ -3029,6 +3287,7 @@ export {
|
|
|
3029
3287
|
Button,
|
|
3030
3288
|
Checkbox,
|
|
3031
3289
|
Chip,
|
|
3290
|
+
CurrencyField,
|
|
3032
3291
|
Dialog,
|
|
3033
3292
|
Drawer,
|
|
3034
3293
|
Dropdown,
|