@refinn/core-ui 0.1.13 → 0.1.15
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 +942 -743
- package/dist/index.d.mts +50 -21
- package/dist/index.d.ts +50 -21
- package/dist/index.js +950 -745
- package/dist/theme.css +5 -5
- 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,10 +1011,10 @@ Checkbox.displayName = "Checkbox";
|
|
|
902
1011
|
|
|
903
1012
|
// src/components/Chip/Chip.tsx
|
|
904
1013
|
import {
|
|
905
|
-
forwardRef as
|
|
1014
|
+
forwardRef as forwardRef10
|
|
906
1015
|
} from "react";
|
|
907
|
-
import { jsx as
|
|
908
|
-
var
|
|
1016
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1017
|
+
var sizeClasses5 = {
|
|
909
1018
|
sm: "h-32 text-label-medium px-12 py-6",
|
|
910
1019
|
md: "h-40 text-label-large px-16 py-10",
|
|
911
1020
|
lg: "h-48 text-label-large px-24 py-14"
|
|
@@ -923,7 +1032,7 @@ var isDarkClasses = {
|
|
|
923
1032
|
true: "!bg-chip-background-black-active !text-chip-text-inverse",
|
|
924
1033
|
false: "!bg-chip-background-active !text-chip-text-inverse"
|
|
925
1034
|
};
|
|
926
|
-
var Chip =
|
|
1035
|
+
var Chip = forwardRef10(
|
|
927
1036
|
(_a, ref) => {
|
|
928
1037
|
var _b = _a, {
|
|
929
1038
|
size = "md",
|
|
@@ -948,7 +1057,7 @@ var Chip = forwardRef9(
|
|
|
948
1057
|
"disabled",
|
|
949
1058
|
"className"
|
|
950
1059
|
]);
|
|
951
|
-
const sz =
|
|
1060
|
+
const sz = sizeClasses5[size];
|
|
952
1061
|
const outlinedClass = isOutlinedClasses[String(isOutlined)];
|
|
953
1062
|
const darkClass = isDarkClasses[String(isDark)];
|
|
954
1063
|
const containerClasses = [
|
|
@@ -966,7 +1075,7 @@ var Chip = forwardRef9(
|
|
|
966
1075
|
className: containerClasses
|
|
967
1076
|
}, rest), {
|
|
968
1077
|
children: [
|
|
969
|
-
icon ? icon : src && /* @__PURE__ */
|
|
1078
|
+
icon ? icon : src && /* @__PURE__ */ jsx10("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
|
|
970
1079
|
label
|
|
971
1080
|
]
|
|
972
1081
|
})
|
|
@@ -975,56 +1084,348 @@ var Chip = forwardRef9(
|
|
|
975
1084
|
);
|
|
976
1085
|
Chip.displayName = "Chip";
|
|
977
1086
|
|
|
978
|
-
// src/components/
|
|
1087
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
979
1088
|
import {
|
|
980
|
-
forwardRef as forwardRef11,
|
|
981
1089
|
useEffect,
|
|
982
|
-
|
|
1090
|
+
useLayoutEffect,
|
|
1091
|
+
useRef as useRef2,
|
|
1092
|
+
useState as useState5,
|
|
1093
|
+
useImperativeHandle as useImperativeHandle2,
|
|
1094
|
+
forwardRef as forwardRef12
|
|
983
1095
|
} from "react";
|
|
984
|
-
import { createPortal } from "react-dom";
|
|
985
1096
|
|
|
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(
|
|
1097
|
+
// src/components/TextField/TextField.tsx
|
|
1098
|
+
import {
|
|
1099
|
+
useState as useState4,
|
|
1100
|
+
useRef,
|
|
1101
|
+
useImperativeHandle,
|
|
1102
|
+
forwardRef as forwardRef11
|
|
1103
|
+
} from "react";
|
|
1104
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1105
|
+
var TextField = forwardRef11(
|
|
1002
1106
|
(_a, ref) => {
|
|
1003
|
-
var _b = _a, {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1107
|
+
var _b = _a, {
|
|
1108
|
+
size = "md",
|
|
1109
|
+
error,
|
|
1110
|
+
label,
|
|
1111
|
+
placeholder,
|
|
1112
|
+
helperText,
|
|
1113
|
+
prefix,
|
|
1114
|
+
suffix,
|
|
1115
|
+
optional = false,
|
|
1116
|
+
success = false,
|
|
1117
|
+
pending = false,
|
|
1118
|
+
clearable = true,
|
|
1119
|
+
disabled = false,
|
|
1120
|
+
type,
|
|
1121
|
+
value,
|
|
1122
|
+
onChange,
|
|
1123
|
+
onFocus,
|
|
1124
|
+
onBlur,
|
|
1009
1125
|
className
|
|
1010
|
-
|
|
1011
|
-
|
|
1126
|
+
} = _b, props = __objRest(_b, [
|
|
1127
|
+
"size",
|
|
1128
|
+
"error",
|
|
1129
|
+
"label",
|
|
1130
|
+
"placeholder",
|
|
1131
|
+
"helperText",
|
|
1132
|
+
"prefix",
|
|
1133
|
+
"suffix",
|
|
1134
|
+
"optional",
|
|
1135
|
+
"success",
|
|
1136
|
+
"pending",
|
|
1137
|
+
"clearable",
|
|
1138
|
+
"disabled",
|
|
1139
|
+
"type",
|
|
1140
|
+
"value",
|
|
1141
|
+
"onChange",
|
|
1142
|
+
"onFocus",
|
|
1143
|
+
"onBlur",
|
|
1144
|
+
"className"
|
|
1145
|
+
]);
|
|
1146
|
+
const [isFocused, setIsFocused] = useState4(false);
|
|
1147
|
+
const isActive = isFocused && !!value;
|
|
1148
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1149
|
+
const inputRef = useRef(null);
|
|
1150
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
1151
|
+
return /* @__PURE__ */ jsxs10("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1152
|
+
label ? /* @__PURE__ */ jsxs10(
|
|
1153
|
+
"p",
|
|
1154
|
+
{
|
|
1155
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
1156
|
+
children: [
|
|
1157
|
+
label,
|
|
1158
|
+
optional && /* @__PURE__ */ jsx11("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
1159
|
+
]
|
|
1160
|
+
}
|
|
1161
|
+
) : /* @__PURE__ */ jsx11(Fragment, {}),
|
|
1162
|
+
/* @__PURE__ */ jsxs10(
|
|
1163
|
+
"div",
|
|
1164
|
+
{
|
|
1165
|
+
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 : ""}`,
|
|
1166
|
+
onMouseDown: (e) => {
|
|
1167
|
+
var _a2;
|
|
1168
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
1169
|
+
e.preventDefault();
|
|
1170
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
children: [
|
|
1174
|
+
prefix && /* @__PURE__ */ jsx11(
|
|
1175
|
+
"span",
|
|
1176
|
+
{
|
|
1177
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1178
|
+
children: prefix
|
|
1179
|
+
}
|
|
1180
|
+
),
|
|
1181
|
+
/* @__PURE__ */ jsx11(
|
|
1182
|
+
"input",
|
|
1183
|
+
__spreadValues({
|
|
1184
|
+
ref: inputRef,
|
|
1185
|
+
type: type || "text",
|
|
1186
|
+
placeholder,
|
|
1187
|
+
disabled: disabled || pending,
|
|
1188
|
+
onFocus: (e) => {
|
|
1189
|
+
setIsFocused(true);
|
|
1190
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
1191
|
+
},
|
|
1192
|
+
onBlur: (e) => {
|
|
1193
|
+
setIsFocused(false);
|
|
1194
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
1195
|
+
},
|
|
1196
|
+
value,
|
|
1197
|
+
onChange,
|
|
1198
|
+
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"}`
|
|
1199
|
+
}, props)
|
|
1200
|
+
),
|
|
1201
|
+
suffix && /* @__PURE__ */ jsx11(
|
|
1202
|
+
"span",
|
|
1203
|
+
{
|
|
1204
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1205
|
+
children: suffix
|
|
1206
|
+
}
|
|
1207
|
+
),
|
|
1208
|
+
(pending || clearable || success || error) && /* @__PURE__ */ jsx11(
|
|
1209
|
+
"span",
|
|
1210
|
+
{
|
|
1211
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
1212
|
+
children: pending ? /* @__PURE__ */ jsx11(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx11(
|
|
1213
|
+
IconButton,
|
|
1214
|
+
{
|
|
1215
|
+
size: iconButtonSize,
|
|
1216
|
+
transparent: true,
|
|
1217
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
1218
|
+
icon: /* @__PURE__ */ jsx11(
|
|
1219
|
+
"svg",
|
|
1220
|
+
{
|
|
1221
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1222
|
+
width: "20",
|
|
1223
|
+
height: "20",
|
|
1224
|
+
viewBox: "0 0 20 20",
|
|
1225
|
+
fill: "none",
|
|
1226
|
+
children: /* @__PURE__ */ jsx11(
|
|
1227
|
+
"path",
|
|
1228
|
+
{
|
|
1229
|
+
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",
|
|
1230
|
+
fill: "currentColor"
|
|
1231
|
+
}
|
|
1232
|
+
)
|
|
1233
|
+
}
|
|
1234
|
+
),
|
|
1235
|
+
onMouseDown: (e) => {
|
|
1236
|
+
e.preventDefault();
|
|
1237
|
+
},
|
|
1238
|
+
onClick: () => {
|
|
1239
|
+
onChange == null ? void 0 : onChange({
|
|
1240
|
+
target: { value: "" }
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
) : success ? /* @__PURE__ */ jsx11(
|
|
1245
|
+
"svg",
|
|
1246
|
+
{
|
|
1247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1248
|
+
width: "20",
|
|
1249
|
+
height: "20",
|
|
1250
|
+
viewBox: "0 0 20 20",
|
|
1251
|
+
fill: "none",
|
|
1252
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
1253
|
+
children: /* @__PURE__ */ jsx11(
|
|
1254
|
+
"path",
|
|
1255
|
+
{
|
|
1256
|
+
fillRule: "evenodd",
|
|
1257
|
+
clipRule: "evenodd",
|
|
1258
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
1259
|
+
fill: "currentColor"
|
|
1260
|
+
}
|
|
1261
|
+
)
|
|
1262
|
+
}
|
|
1263
|
+
) : error ? /* @__PURE__ */ jsx11(
|
|
1264
|
+
"svg",
|
|
1265
|
+
{
|
|
1266
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1267
|
+
width: "20",
|
|
1268
|
+
height: "20",
|
|
1269
|
+
viewBox: "0 0 20 20",
|
|
1270
|
+
fill: "none",
|
|
1271
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
1272
|
+
children: /* @__PURE__ */ jsx11(
|
|
1273
|
+
"path",
|
|
1274
|
+
{
|
|
1275
|
+
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",
|
|
1276
|
+
fill: "currentColor"
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
}
|
|
1280
|
+
) : null
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
),
|
|
1286
|
+
error ? /* @__PURE__ */ jsx11("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx11(
|
|
1287
|
+
"p",
|
|
1288
|
+
{
|
|
1289
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
1290
|
+
children: helperText
|
|
1291
|
+
}
|
|
1292
|
+
) : /* @__PURE__ */ jsx11(Fragment, {})
|
|
1293
|
+
] });
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
TextField.displayName = "TextField";
|
|
1297
|
+
|
|
1298
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
1299
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1300
|
+
function toDigits(value) {
|
|
1301
|
+
if (value === void 0 || Number.isNaN(value)) return "";
|
|
1302
|
+
return String(Math.trunc(value)).replace(/[^\d]/g, "");
|
|
1303
|
+
}
|
|
1304
|
+
function formatDigits(digits) {
|
|
1305
|
+
if (!digits) return "";
|
|
1306
|
+
const normalized = digits.replace(/^0+(?=\d)/, "");
|
|
1307
|
+
return Number(normalized).toLocaleString("en-US");
|
|
1308
|
+
}
|
|
1309
|
+
var CurrencyField = forwardRef12(
|
|
1310
|
+
(_a, ref) => {
|
|
1311
|
+
var _b = _a, {
|
|
1312
|
+
value,
|
|
1313
|
+
onChange,
|
|
1314
|
+
min,
|
|
1315
|
+
minErrorText,
|
|
1316
|
+
max,
|
|
1317
|
+
maxErrorText,
|
|
1318
|
+
currencyIcon,
|
|
1319
|
+
error,
|
|
1320
|
+
onBlur,
|
|
1321
|
+
className
|
|
1322
|
+
} = _b, props = __objRest(_b, [
|
|
1323
|
+
"value",
|
|
1324
|
+
"onChange",
|
|
1325
|
+
"min",
|
|
1326
|
+
"minErrorText",
|
|
1327
|
+
"max",
|
|
1328
|
+
"maxErrorText",
|
|
1329
|
+
"currencyIcon",
|
|
1330
|
+
"error",
|
|
1331
|
+
"onBlur",
|
|
1332
|
+
"className"
|
|
1333
|
+
]);
|
|
1334
|
+
const inputRef = useRef2(null);
|
|
1335
|
+
useImperativeHandle2(ref, () => inputRef.current);
|
|
1336
|
+
const [displayValue, setDisplayValue] = useState5(
|
|
1337
|
+
() => formatDigits(toDigits(value))
|
|
1338
|
+
);
|
|
1339
|
+
const [touched, setTouched] = useState5(false);
|
|
1340
|
+
const pendingCursorRef = useRef2(null);
|
|
1341
|
+
useEffect(() => {
|
|
1342
|
+
const externalDigits = toDigits(value);
|
|
1343
|
+
const currentDigits = displayValue.replace(/[^\d]/g, "");
|
|
1344
|
+
if (externalDigits !== currentDigits) {
|
|
1345
|
+
setDisplayValue(formatDigits(externalDigits));
|
|
1346
|
+
}
|
|
1347
|
+
}, [value]);
|
|
1348
|
+
useLayoutEffect(() => {
|
|
1349
|
+
if (pendingCursorRef.current !== null && inputRef.current) {
|
|
1350
|
+
inputRef.current.setSelectionRange(
|
|
1351
|
+
pendingCursorRef.current,
|
|
1352
|
+
pendingCursorRef.current
|
|
1353
|
+
);
|
|
1354
|
+
pendingCursorRef.current = null;
|
|
1355
|
+
}
|
|
1356
|
+
}, [displayValue]);
|
|
1357
|
+
const handleChange = (event) => {
|
|
1358
|
+
var _a2;
|
|
1359
|
+
const input = event.target;
|
|
1360
|
+
const raw = input.value;
|
|
1361
|
+
const cursorPos = (_a2 = input.selectionStart) != null ? _a2 : raw.length;
|
|
1362
|
+
const digitsBeforeCursor = raw.slice(0, cursorPos).replace(/[^\d]/g, "").length;
|
|
1363
|
+
const digits2 = raw.replace(/[^\d]/g, "");
|
|
1364
|
+
const formatted = formatDigits(digits2);
|
|
1365
|
+
let newCursor = formatted.length;
|
|
1366
|
+
if (digitsBeforeCursor === 0) {
|
|
1367
|
+
newCursor = 0;
|
|
1368
|
+
} else {
|
|
1369
|
+
let count = 0;
|
|
1370
|
+
for (let i = 0; i < formatted.length; i += 1) {
|
|
1371
|
+
if (/\d/.test(formatted[i])) {
|
|
1372
|
+
count += 1;
|
|
1373
|
+
if (count === digitsBeforeCursor) {
|
|
1374
|
+
newCursor = i + 1;
|
|
1375
|
+
break;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
pendingCursorRef.current = newCursor;
|
|
1381
|
+
setDisplayValue(formatted);
|
|
1382
|
+
const normalized = digits2.replace(/^0+(?=\d)/, "");
|
|
1383
|
+
onChange == null ? void 0 : onChange(normalized === "" ? void 0 : Number(normalized));
|
|
1384
|
+
};
|
|
1385
|
+
const digits = displayValue.replace(/[^\d]/g, "");
|
|
1386
|
+
const numericValue = digits === "" ? void 0 : Number(digits);
|
|
1387
|
+
const belowMin = touched && min !== void 0 && numericValue !== void 0 && numericValue < min;
|
|
1388
|
+
const aboveMax = touched && max !== void 0 && numericValue !== void 0 && numericValue > max;
|
|
1389
|
+
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;
|
|
1390
|
+
return /* @__PURE__ */ jsx12(
|
|
1391
|
+
TextField,
|
|
1392
|
+
__spreadValues({
|
|
1393
|
+
ref: inputRef,
|
|
1394
|
+
type: "text",
|
|
1395
|
+
inputMode: "tel",
|
|
1396
|
+
prefix: currencyIcon != null ? currencyIcon : /* @__PURE__ */ jsx12("span", { className: "text-body-small", children: "\u0E3F" }),
|
|
1397
|
+
value: displayValue,
|
|
1398
|
+
onChange: handleChange,
|
|
1399
|
+
onBlur: (event) => {
|
|
1400
|
+
setTouched(true);
|
|
1401
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
1402
|
+
},
|
|
1403
|
+
error: computedError,
|
|
1404
|
+
className: `[&>input]:relative [&>input]:top-1 ${className != null ? className : ""}`
|
|
1405
|
+
}, props)
|
|
1406
|
+
);
|
|
1012
1407
|
}
|
|
1013
1408
|
);
|
|
1014
|
-
|
|
1409
|
+
CurrencyField.displayName = "CurrencyField";
|
|
1015
1410
|
|
|
1016
1411
|
// src/components/Dialog/Dialog.tsx
|
|
1017
|
-
import {
|
|
1412
|
+
import {
|
|
1413
|
+
forwardRef as forwardRef13,
|
|
1414
|
+
useEffect as useEffect2,
|
|
1415
|
+
useState as useState6
|
|
1416
|
+
} from "react";
|
|
1417
|
+
import { createPortal } from "react-dom";
|
|
1418
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1018
1419
|
function CloseIcon2({ className }) {
|
|
1019
|
-
return /* @__PURE__ */
|
|
1420
|
+
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
1421
|
}
|
|
1021
1422
|
function WarningIcon2({ className }) {
|
|
1022
|
-
return /* @__PURE__ */
|
|
1423
|
+
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
1424
|
}
|
|
1024
1425
|
function useMountTransition(open, duration = 300) {
|
|
1025
|
-
const [mounted, setMounted] =
|
|
1026
|
-
const [animate, setAnimate] =
|
|
1027
|
-
|
|
1426
|
+
const [mounted, setMounted] = useState6(open);
|
|
1427
|
+
const [animate, setAnimate] = useState6(open);
|
|
1428
|
+
useEffect2(() => {
|
|
1028
1429
|
if (open) {
|
|
1029
1430
|
setMounted(true);
|
|
1030
1431
|
let raf2 = 0;
|
|
@@ -1049,9 +1450,9 @@ function DialogAction({
|
|
|
1049
1450
|
}) {
|
|
1050
1451
|
if (!action) return null;
|
|
1051
1452
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1052
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsx13(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
|
|
1053
1454
|
}
|
|
1054
|
-
var Dialog =
|
|
1455
|
+
var Dialog = forwardRef13(
|
|
1055
1456
|
(_a, ref) => {
|
|
1056
1457
|
var _b = _a, {
|
|
1057
1458
|
open,
|
|
@@ -1085,7 +1486,7 @@ var Dialog = forwardRef11(
|
|
|
1085
1486
|
"className"
|
|
1086
1487
|
]);
|
|
1087
1488
|
const { mounted, animate } = useMountTransition(open);
|
|
1088
|
-
|
|
1489
|
+
useEffect2(() => {
|
|
1089
1490
|
if (!open || !closable) return;
|
|
1090
1491
|
const handleKeyDown = (e) => {
|
|
1091
1492
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1105,7 +1506,7 @@ var Dialog = forwardRef11(
|
|
|
1105
1506
|
const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
|
|
1106
1507
|
const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
|
|
1107
1508
|
return createPortal(
|
|
1108
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ jsx13(
|
|
1109
1510
|
"div",
|
|
1110
1511
|
{
|
|
1111
1512
|
className: [
|
|
@@ -1120,7 +1521,7 @@ var Dialog = forwardRef11(
|
|
|
1120
1521
|
].filter(Boolean).join(" "),
|
|
1121
1522
|
role: "presentation",
|
|
1122
1523
|
onMouseDown: handleBackdropMouseDown,
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1524
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1124
1525
|
"div",
|
|
1125
1526
|
__spreadProps(__spreadValues({
|
|
1126
1527
|
ref,
|
|
@@ -1140,53 +1541,53 @@ var Dialog = forwardRef11(
|
|
|
1140
1541
|
onMouseDown: (e) => e.stopPropagation()
|
|
1141
1542
|
}, rest), {
|
|
1142
1543
|
children: [
|
|
1143
|
-
artwork ? /* @__PURE__ */
|
|
1144
|
-
closable && /* @__PURE__ */
|
|
1544
|
+
artwork ? /* @__PURE__ */ jsxs11("div", { className: "relative shrink-0 bg-background-tertiary", children: [
|
|
1545
|
+
closable && /* @__PURE__ */ jsx13("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ jsx13(
|
|
1145
1546
|
IconButton,
|
|
1146
1547
|
{
|
|
1147
|
-
icon: /* @__PURE__ */
|
|
1548
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-24 w-24" }),
|
|
1148
1549
|
size: "m",
|
|
1550
|
+
surface: "dark",
|
|
1149
1551
|
"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!"
|
|
1552
|
+
onClick: handleClose
|
|
1152
1553
|
}
|
|
1153
1554
|
) }),
|
|
1154
1555
|
artwork
|
|
1155
1556
|
] }) : null,
|
|
1156
|
-
showHeader && /* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
warning && /* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
title && /* @__PURE__ */
|
|
1161
|
-
subtitle && !artwork && /* @__PURE__ */
|
|
1557
|
+
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: [
|
|
1558
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
|
|
1559
|
+
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" }) }),
|
|
1560
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1561
|
+
title && /* @__PURE__ */ jsx13("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1562
|
+
subtitle && !artwork && /* @__PURE__ */ jsx13("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1162
1563
|
] })
|
|
1163
1564
|
] }),
|
|
1164
|
-
closable && !artwork && /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1565
|
+
closable && !artwork && /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
1566
|
+
/* @__PURE__ */ jsx13(
|
|
1166
1567
|
IconButton,
|
|
1167
1568
|
{
|
|
1168
|
-
icon: /* @__PURE__ */
|
|
1569
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-20 w-20" }),
|
|
1169
1570
|
size: "s",
|
|
1170
1571
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1171
1572
|
onClick: handleClose,
|
|
1172
|
-
className: "
|
|
1573
|
+
className: "lg:hidden!"
|
|
1173
1574
|
}
|
|
1174
1575
|
),
|
|
1175
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ jsx13(
|
|
1176
1577
|
IconButton,
|
|
1177
1578
|
{
|
|
1178
|
-
icon: /* @__PURE__ */
|
|
1579
|
+
icon: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-24 w-24" }),
|
|
1179
1580
|
size: "m",
|
|
1180
1581
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1181
1582
|
onClick: handleClose,
|
|
1182
|
-
className: "hidden!
|
|
1583
|
+
className: "hidden! lg:inline-flex!"
|
|
1183
1584
|
}
|
|
1184
1585
|
)
|
|
1185
1586
|
] })
|
|
1186
1587
|
] }),
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
showFooter && /* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__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 }),
|
|
1589
|
+
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: [
|
|
1590
|
+
/* @__PURE__ */ jsx13(
|
|
1190
1591
|
DialogAction,
|
|
1191
1592
|
{
|
|
1192
1593
|
action: dismiss,
|
|
@@ -1194,8 +1595,8 @@ var Dialog = forwardRef11(
|
|
|
1194
1595
|
orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
|
|
1195
1596
|
}
|
|
1196
1597
|
),
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ jsx13(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1599
|
+
/* @__PURE__ */ jsx13(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
|
|
1199
1600
|
] })
|
|
1200
1601
|
]
|
|
1201
1602
|
})
|
|
@@ -1210,19 +1611,19 @@ Dialog.displayName = "Dialog";
|
|
|
1210
1611
|
|
|
1211
1612
|
// src/components/Drawer/Drawer.tsx
|
|
1212
1613
|
import {
|
|
1213
|
-
forwardRef as
|
|
1214
|
-
useEffect as
|
|
1215
|
-
useState as
|
|
1614
|
+
forwardRef as forwardRef14,
|
|
1615
|
+
useEffect as useEffect3,
|
|
1616
|
+
useState as useState7
|
|
1216
1617
|
} from "react";
|
|
1217
1618
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1218
|
-
import { Fragment as Fragment3, jsx as
|
|
1619
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1219
1620
|
function CloseIcon3({ className }) {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1621
|
+
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
1622
|
}
|
|
1222
1623
|
function useMountTransition2(open, duration = 300) {
|
|
1223
|
-
const [mounted, setMounted] =
|
|
1224
|
-
const [animate, setAnimate] =
|
|
1225
|
-
|
|
1624
|
+
const [mounted, setMounted] = useState7(open);
|
|
1625
|
+
const [animate, setAnimate] = useState7(open);
|
|
1626
|
+
useEffect3(() => {
|
|
1226
1627
|
if (open) {
|
|
1227
1628
|
setMounted(true);
|
|
1228
1629
|
let raf2 = 0;
|
|
@@ -1247,7 +1648,7 @@ function DrawerAction({
|
|
|
1247
1648
|
}) {
|
|
1248
1649
|
if (!action) return null;
|
|
1249
1650
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1250
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsx14(
|
|
1251
1652
|
Button,
|
|
1252
1653
|
__spreadProps(__spreadValues({
|
|
1253
1654
|
variant,
|
|
@@ -1258,7 +1659,7 @@ function DrawerAction({
|
|
|
1258
1659
|
})
|
|
1259
1660
|
);
|
|
1260
1661
|
}
|
|
1261
|
-
var Drawer =
|
|
1662
|
+
var Drawer = forwardRef14(
|
|
1262
1663
|
(_a, ref) => {
|
|
1263
1664
|
var _b = _a, {
|
|
1264
1665
|
open,
|
|
@@ -1292,7 +1693,7 @@ var Drawer = forwardRef12(
|
|
|
1292
1693
|
"className"
|
|
1293
1694
|
]);
|
|
1294
1695
|
const { mounted, animate } = useMountTransition2(open);
|
|
1295
|
-
|
|
1696
|
+
useEffect3(() => {
|
|
1296
1697
|
if (!open || !closable) return;
|
|
1297
1698
|
const handleKeyDown = (e) => {
|
|
1298
1699
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1309,7 +1710,7 @@ var Drawer = forwardRef12(
|
|
|
1309
1710
|
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1310
1711
|
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1311
1712
|
return createPortal2(
|
|
1312
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx14(
|
|
1313
1714
|
"div",
|
|
1314
1715
|
{
|
|
1315
1716
|
className: [
|
|
@@ -1320,7 +1721,7 @@ var Drawer = forwardRef12(
|
|
|
1320
1721
|
].filter(Boolean).join(" "),
|
|
1321
1722
|
role: "presentation",
|
|
1322
1723
|
onMouseDown: handleBackdropMouseDown,
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1724
|
+
children: /* @__PURE__ */ jsxs12(
|
|
1324
1725
|
"div",
|
|
1325
1726
|
__spreadProps(__spreadValues({
|
|
1326
1727
|
ref,
|
|
@@ -1340,7 +1741,7 @@ var Drawer = forwardRef12(
|
|
|
1340
1741
|
onMouseDown: (e) => e.stopPropagation()
|
|
1341
1742
|
}, rest), {
|
|
1342
1743
|
children: [
|
|
1343
|
-
showHeader && /* @__PURE__ */
|
|
1744
|
+
showHeader && /* @__PURE__ */ jsxs12(
|
|
1344
1745
|
"div",
|
|
1345
1746
|
{
|
|
1346
1747
|
className: [
|
|
@@ -1348,36 +1749,36 @@ var Drawer = forwardRef12(
|
|
|
1348
1749
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-16 lg:pt-20"
|
|
1349
1750
|
].join(" "),
|
|
1350
1751
|
children: [
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
title && /* @__PURE__ */
|
|
1353
|
-
subtitle && /* @__PURE__ */
|
|
1752
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1753
|
+
title && /* @__PURE__ */ jsx14("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1754
|
+
subtitle && /* @__PURE__ */ jsx14("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1354
1755
|
] }),
|
|
1355
|
-
closable && /* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1756
|
+
closable && /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1757
|
+
/* @__PURE__ */ jsx14(
|
|
1357
1758
|
IconButton,
|
|
1358
1759
|
{
|
|
1359
|
-
icon: /* @__PURE__ */
|
|
1760
|
+
icon: /* @__PURE__ */ jsx14(CloseIcon3, { className: "h-20 w-20" }),
|
|
1360
1761
|
size: "s",
|
|
1361
1762
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1362
1763
|
onClick: handleClose,
|
|
1363
|
-
className: "
|
|
1764
|
+
className: "lg:hidden!"
|
|
1364
1765
|
}
|
|
1365
1766
|
),
|
|
1366
|
-
/* @__PURE__ */
|
|
1767
|
+
/* @__PURE__ */ jsx14(
|
|
1367
1768
|
IconButton,
|
|
1368
1769
|
{
|
|
1369
|
-
icon: /* @__PURE__ */
|
|
1770
|
+
icon: /* @__PURE__ */ jsx14(CloseIcon3, { className: "h-24 w-24" }),
|
|
1370
1771
|
size: fullScreen ? "l" : "m",
|
|
1371
1772
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1372
1773
|
onClick: handleClose,
|
|
1373
|
-
className: "hidden!
|
|
1774
|
+
className: "hidden! lg:inline-flex!"
|
|
1374
1775
|
}
|
|
1375
1776
|
)
|
|
1376
1777
|
] })
|
|
1377
1778
|
]
|
|
1378
1779
|
}
|
|
1379
1780
|
),
|
|
1380
|
-
/* @__PURE__ */
|
|
1781
|
+
/* @__PURE__ */ jsx14(
|
|
1381
1782
|
"div",
|
|
1382
1783
|
{
|
|
1383
1784
|
className: [
|
|
@@ -1388,23 +1789,23 @@ var Drawer = forwardRef12(
|
|
|
1388
1789
|
children
|
|
1389
1790
|
}
|
|
1390
1791
|
),
|
|
1391
|
-
showFooter && /* @__PURE__ */
|
|
1792
|
+
showFooter && /* @__PURE__ */ jsx14(
|
|
1392
1793
|
"div",
|
|
1393
1794
|
{
|
|
1394
1795
|
className: [
|
|
1395
1796
|
"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
1797
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-24 lg:pt-16"
|
|
1397
1798
|
].join(" "),
|
|
1398
|
-
children: allActions ? /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1799
|
+
children: allActions ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1800
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1801
|
+
/* @__PURE__ */ jsxs12("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1802
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1803
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1403
1804
|
] })
|
|
1404
|
-
] }) : /* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1805
|
+
] }) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1806
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1807
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1808
|
+
/* @__PURE__ */ jsx14(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1408
1809
|
] })
|
|
1409
1810
|
}
|
|
1410
1811
|
)
|
|
@@ -1421,14 +1822,14 @@ Drawer.displayName = "Drawer";
|
|
|
1421
1822
|
|
|
1422
1823
|
// src/components/Dropdown/Dropdown.tsx
|
|
1423
1824
|
import {
|
|
1424
|
-
useEffect as
|
|
1825
|
+
useEffect as useEffect4,
|
|
1425
1826
|
useId as useId3,
|
|
1426
|
-
useRef,
|
|
1427
|
-
useState as
|
|
1428
|
-
forwardRef as
|
|
1827
|
+
useRef as useRef3,
|
|
1828
|
+
useState as useState8,
|
|
1829
|
+
forwardRef as forwardRef15
|
|
1429
1830
|
} from "react";
|
|
1430
|
-
import { Fragment as Fragment4, jsx as
|
|
1431
|
-
var IconDanger = () => /* @__PURE__ */
|
|
1831
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1832
|
+
var IconDanger = () => /* @__PURE__ */ jsx15(
|
|
1432
1833
|
"svg",
|
|
1433
1834
|
{
|
|
1434
1835
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1436,7 +1837,7 @@ var IconDanger = () => /* @__PURE__ */ jsx13(
|
|
|
1436
1837
|
height: "20",
|
|
1437
1838
|
viewBox: "0 0 20 20",
|
|
1438
1839
|
fill: "none",
|
|
1439
|
-
children: /* @__PURE__ */
|
|
1840
|
+
children: /* @__PURE__ */ jsx15(
|
|
1440
1841
|
"path",
|
|
1441
1842
|
{
|
|
1442
1843
|
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 +1847,7 @@ var IconDanger = () => /* @__PURE__ */ jsx13(
|
|
|
1446
1847
|
}
|
|
1447
1848
|
);
|
|
1448
1849
|
function IconCheck({ className }) {
|
|
1449
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ jsx15(
|
|
1450
1851
|
"svg",
|
|
1451
1852
|
{
|
|
1452
1853
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1455,7 +1856,7 @@ function IconCheck({ className }) {
|
|
|
1455
1856
|
viewBox: "0 0 20 20",
|
|
1456
1857
|
fill: "none",
|
|
1457
1858
|
className,
|
|
1458
|
-
children: /* @__PURE__ */
|
|
1859
|
+
children: /* @__PURE__ */ jsx15(
|
|
1459
1860
|
"path",
|
|
1460
1861
|
{
|
|
1461
1862
|
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 +1867,7 @@ function IconCheck({ className }) {
|
|
|
1466
1867
|
);
|
|
1467
1868
|
}
|
|
1468
1869
|
function ChevronDown({ className }) {
|
|
1469
|
-
return /* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ jsx15(
|
|
1470
1871
|
"svg",
|
|
1471
1872
|
{
|
|
1472
1873
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1475,7 +1876,7 @@ function ChevronDown({ className }) {
|
|
|
1475
1876
|
viewBox: "0 0 20 20",
|
|
1476
1877
|
fill: "none",
|
|
1477
1878
|
className,
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1879
|
+
children: /* @__PURE__ */ jsx15(
|
|
1479
1880
|
"path",
|
|
1480
1881
|
{
|
|
1481
1882
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1485,7 +1886,7 @@ function ChevronDown({ className }) {
|
|
|
1485
1886
|
}
|
|
1486
1887
|
);
|
|
1487
1888
|
}
|
|
1488
|
-
var Dropdown =
|
|
1889
|
+
var Dropdown = forwardRef15(
|
|
1489
1890
|
(_a, ref) => {
|
|
1490
1891
|
var _b = _a, {
|
|
1491
1892
|
size = "md",
|
|
@@ -1522,14 +1923,14 @@ var Dropdown = forwardRef13(
|
|
|
1522
1923
|
]);
|
|
1523
1924
|
const isCombobox = variant === "combobox";
|
|
1524
1925
|
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 =
|
|
1926
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
1927
|
+
const [isFocused, setIsFocused] = useState8(false);
|
|
1928
|
+
const [query, setQuery] = useState8(value.label || "");
|
|
1929
|
+
const [filterText, setFilterText] = useState8("");
|
|
1930
|
+
const dropdownRef = useRef3(null);
|
|
1931
|
+
const inputRef = useRef3(null);
|
|
1531
1932
|
const listboxId = useId3();
|
|
1532
|
-
const [prevLabel, setPrevLabel] =
|
|
1933
|
+
const [prevLabel, setPrevLabel] = useState8(value.label);
|
|
1533
1934
|
if (value.label !== prevLabel) {
|
|
1534
1935
|
setPrevLabel(value.label);
|
|
1535
1936
|
setQuery(value.label || "");
|
|
@@ -1537,7 +1938,7 @@ var Dropdown = forwardRef13(
|
|
|
1537
1938
|
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1538
1939
|
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1539
1940
|
) : dropDownItems;
|
|
1540
|
-
|
|
1941
|
+
useEffect4(() => {
|
|
1541
1942
|
function handleClickOutside(event) {
|
|
1542
1943
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1543
1944
|
setIsOpen(false);
|
|
@@ -1554,16 +1955,16 @@ var Dropdown = forwardRef13(
|
|
|
1554
1955
|
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1555
1956
|
${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
1957
|
${className}`;
|
|
1557
|
-
return /* @__PURE__ */
|
|
1558
|
-
label ? /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1959
|
+
label ? /* @__PURE__ */ jsx15(
|
|
1559
1960
|
"p",
|
|
1560
1961
|
{
|
|
1561
1962
|
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1562
1963
|
children: label
|
|
1563
1964
|
}
|
|
1564
|
-
) : /* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
isCombobox ? /* @__PURE__ */
|
|
1965
|
+
) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
1966
|
+
/* @__PURE__ */ jsxs13("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1967
|
+
isCombobox ? /* @__PURE__ */ jsxs13(
|
|
1567
1968
|
"div",
|
|
1568
1969
|
__spreadProps(__spreadValues({
|
|
1569
1970
|
ref
|
|
@@ -1574,7 +1975,7 @@ var Dropdown = forwardRef13(
|
|
|
1574
1975
|
},
|
|
1575
1976
|
className: triggerClassName,
|
|
1576
1977
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ jsx15(
|
|
1578
1979
|
"input",
|
|
1579
1980
|
{
|
|
1580
1981
|
ref: inputRef,
|
|
@@ -1607,16 +2008,17 @@ var Dropdown = forwardRef13(
|
|
|
1607
2008
|
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
2009
|
}
|
|
1609
2010
|
),
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
disabled ? /* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-4", children: [
|
|
2012
|
+
disabled ? /* @__PURE__ */ jsx15(Fragment4, {}) : error ? /* @__PURE__ */ jsx15(IconDanger, {}) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
2013
|
+
/* @__PURE__ */ jsx15(
|
|
1613
2014
|
IconButton,
|
|
1614
2015
|
{
|
|
1615
2016
|
size: iconButtonSize,
|
|
2017
|
+
transparent: true,
|
|
1616
2018
|
disabled,
|
|
1617
2019
|
tabIndex: -1,
|
|
1618
2020
|
"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__ */
|
|
2021
|
+
icon: /* @__PURE__ */ jsx15(
|
|
1620
2022
|
ChevronDown,
|
|
1621
2023
|
{
|
|
1622
2024
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1639,7 +2041,7 @@ var Dropdown = forwardRef13(
|
|
|
1639
2041
|
] })
|
|
1640
2042
|
]
|
|
1641
2043
|
})
|
|
1642
|
-
) : /* @__PURE__ */
|
|
2044
|
+
) : /* @__PURE__ */ jsxs13(
|
|
1643
2045
|
"div",
|
|
1644
2046
|
__spreadProps(__spreadValues({
|
|
1645
2047
|
ref
|
|
@@ -1672,23 +2074,24 @@ var Dropdown = forwardRef13(
|
|
|
1672
2074
|
},
|
|
1673
2075
|
className: `focus:outline-none ${triggerClassName}`,
|
|
1674
2076
|
children: [
|
|
1675
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx15(
|
|
1676
2078
|
"p",
|
|
1677
2079
|
{
|
|
1678
2080
|
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1679
2081
|
children: value.label || placeholder
|
|
1680
2082
|
}
|
|
1681
2083
|
),
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
disabled ? /* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-4", children: [
|
|
2085
|
+
disabled ? /* @__PURE__ */ jsx15(Fragment4, {}) : error ? /* @__PURE__ */ jsx15(IconDanger, {}) : /* @__PURE__ */ jsx15(Fragment4, {}),
|
|
2086
|
+
/* @__PURE__ */ jsx15(
|
|
1685
2087
|
IconButton,
|
|
1686
2088
|
{
|
|
1687
2089
|
size: iconButtonSize,
|
|
2090
|
+
transparent: true,
|
|
1688
2091
|
disabled,
|
|
1689
2092
|
tabIndex: -1,
|
|
1690
2093
|
"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__ */
|
|
2094
|
+
icon: /* @__PURE__ */ jsx15(
|
|
1692
2095
|
ChevronDown,
|
|
1693
2096
|
{
|
|
1694
2097
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1705,17 +2108,17 @@ var Dropdown = forwardRef13(
|
|
|
1705
2108
|
]
|
|
1706
2109
|
})
|
|
1707
2110
|
),
|
|
1708
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ jsx15(
|
|
1709
2112
|
"div",
|
|
1710
2113
|
{
|
|
1711
2114
|
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__ */
|
|
2115
|
+
children: /* @__PURE__ */ jsx15(
|
|
1713
2116
|
"ul",
|
|
1714
2117
|
{
|
|
1715
2118
|
id: isCombobox ? listboxId : void 0,
|
|
1716
2119
|
role: isCombobox ? "listbox" : void 0,
|
|
1717
2120
|
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1718
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */
|
|
2121
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
|
|
1719
2122
|
"div",
|
|
1720
2123
|
{
|
|
1721
2124
|
onClick: () => {
|
|
@@ -1725,46 +2128,46 @@ var Dropdown = forwardRef13(
|
|
|
1725
2128
|
},
|
|
1726
2129
|
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
2130
|
children: [
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
value.value === item.value && /* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ jsx15("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
2132
|
+
value.value === item.value && /* @__PURE__ */ jsx15(IconCheck, { className: "h-20 w-20" })
|
|
1730
2133
|
]
|
|
1731
2134
|
}
|
|
1732
|
-
) }, idx)) : /* @__PURE__ */
|
|
2135
|
+
) }, 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
2136
|
}
|
|
1734
2137
|
)
|
|
1735
2138
|
}
|
|
1736
2139
|
)
|
|
1737
2140
|
] }),
|
|
1738
|
-
error ? /* @__PURE__ */
|
|
2141
|
+
error ? /* @__PURE__ */ jsx15("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx15(
|
|
1739
2142
|
"p",
|
|
1740
2143
|
{
|
|
1741
2144
|
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1742
2145
|
children: helperText
|
|
1743
2146
|
}
|
|
1744
|
-
) : /* @__PURE__ */
|
|
2147
|
+
) : /* @__PURE__ */ jsx15(Fragment4, {})
|
|
1745
2148
|
] });
|
|
1746
2149
|
}
|
|
1747
2150
|
);
|
|
1748
2151
|
Dropdown.displayName = "Dropdown";
|
|
1749
2152
|
|
|
1750
2153
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1751
|
-
import { forwardRef as
|
|
1752
|
-
import { jsx as
|
|
1753
|
-
var
|
|
2154
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
2155
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2156
|
+
var inlineClasses = {
|
|
1754
2157
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1755
2158
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
1756
2159
|
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
1757
2160
|
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
1758
2161
|
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
1759
2162
|
};
|
|
1760
|
-
var
|
|
2163
|
+
var pageClasses = {
|
|
1761
2164
|
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
1762
2165
|
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
1763
2166
|
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
1764
2167
|
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
1765
2168
|
common: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
1766
2169
|
};
|
|
1767
|
-
var
|
|
2170
|
+
var actionsPageClasses = {
|
|
1768
2171
|
info: "text-enabled-inverse",
|
|
1769
2172
|
success: "text-enabled-inverse",
|
|
1770
2173
|
warning: "text-enabled-dark",
|
|
@@ -1779,25 +2182,25 @@ var inlineIconClasses2 = {
|
|
|
1779
2182
|
common: "text-alert-inline-common-icon"
|
|
1780
2183
|
};
|
|
1781
2184
|
function InfoIcon2({ className }) {
|
|
1782
|
-
return /* @__PURE__ */
|
|
2185
|
+
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
2186
|
}
|
|
1784
2187
|
function SuccessIcon2({ className }) {
|
|
1785
|
-
return /* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ jsxs14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2189
|
+
/* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2190
|
+
/* @__PURE__ */ jsx16("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1788
2191
|
] });
|
|
1789
2192
|
}
|
|
1790
2193
|
function WarningIcon3({ className }) {
|
|
1791
|
-
return /* @__PURE__ */
|
|
2194
|
+
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
2195
|
}
|
|
1793
2196
|
function DangerIcon2({ className }) {
|
|
1794
|
-
return /* @__PURE__ */
|
|
2197
|
+
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
2198
|
}
|
|
1796
2199
|
function CommonIcon({ className }) {
|
|
1797
|
-
return /* @__PURE__ */
|
|
2200
|
+
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
2201
|
}
|
|
1799
2202
|
function CloseIcon4({ className }) {
|
|
1800
|
-
return /* @__PURE__ */
|
|
2203
|
+
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
2204
|
}
|
|
1802
2205
|
var defaultIcons2 = {
|
|
1803
2206
|
info: InfoIcon2,
|
|
@@ -1806,7 +2209,7 @@ var defaultIcons2 = {
|
|
|
1806
2209
|
danger: DangerIcon2,
|
|
1807
2210
|
common: CommonIcon
|
|
1808
2211
|
};
|
|
1809
|
-
var FinancialLogo =
|
|
2212
|
+
var FinancialLogo = forwardRef16(
|
|
1810
2213
|
(_a, ref) => {
|
|
1811
2214
|
var _b = _a, {
|
|
1812
2215
|
variant = "info",
|
|
@@ -1830,8 +2233,8 @@ var FinancialLogo = forwardRef14(
|
|
|
1830
2233
|
"children"
|
|
1831
2234
|
]);
|
|
1832
2235
|
const isPage = mode === "page";
|
|
1833
|
-
const variantClass = isPage ?
|
|
1834
|
-
const actionClass = isPage ?
|
|
2236
|
+
const variantClass = isPage ? pageClasses[variant] : inlineClasses[variant];
|
|
2237
|
+
const actionClass = isPage ? actionsPageClasses[variant] : "text-enabled";
|
|
1835
2238
|
const DefaultIcon = defaultIcons2[variant];
|
|
1836
2239
|
const iconColorClass = isPage ? "" : inlineIconClasses2[variant];
|
|
1837
2240
|
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
@@ -1842,22 +2245,22 @@ var FinancialLogo = forwardRef14(
|
|
|
1842
2245
|
variantClass,
|
|
1843
2246
|
className
|
|
1844
2247
|
].filter(Boolean).join(" ");
|
|
1845
|
-
return /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
title && /* @__PURE__ */
|
|
1849
|
-
description && /* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2249
|
+
/* @__PURE__ */ jsx16("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx16(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2250
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
|
|
2251
|
+
title && /* @__PURE__ */ jsx16("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
2252
|
+
description && /* @__PURE__ */ jsx16("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1850
2253
|
children
|
|
1851
2254
|
] }),
|
|
1852
|
-
action && /* @__PURE__ */
|
|
1853
|
-
onClose && /* @__PURE__ */
|
|
2255
|
+
action && /* @__PURE__ */ jsx16("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
2256
|
+
onClose && /* @__PURE__ */ jsx16(
|
|
1854
2257
|
"button",
|
|
1855
2258
|
{
|
|
1856
2259
|
type: "button",
|
|
1857
2260
|
onClick: onClose,
|
|
1858
2261
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1859
2262
|
"aria-label": "Close",
|
|
1860
|
-
children: /* @__PURE__ */
|
|
2263
|
+
children: /* @__PURE__ */ jsx16(CloseIcon4, { className: "h-16 w-16" })
|
|
1861
2264
|
}
|
|
1862
2265
|
)
|
|
1863
2266
|
] }));
|
|
@@ -1866,9 +2269,9 @@ var FinancialLogo = forwardRef14(
|
|
|
1866
2269
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1867
2270
|
|
|
1868
2271
|
// src/components/Icon/Icon.tsx
|
|
1869
|
-
import { forwardRef as
|
|
1870
|
-
import { jsx as
|
|
1871
|
-
var Icon =
|
|
2272
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
2273
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2274
|
+
var Icon = forwardRef17(
|
|
1872
2275
|
(_a, ref) => {
|
|
1873
2276
|
var _b = _a, {
|
|
1874
2277
|
name,
|
|
@@ -1896,7 +2299,7 @@ var Icon = forwardRef15(
|
|
|
1896
2299
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1897
2300
|
className
|
|
1898
2301
|
].filter(Boolean).join(" ");
|
|
1899
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx17(
|
|
1900
2303
|
"span",
|
|
1901
2304
|
__spreadProps(__spreadValues({
|
|
1902
2305
|
ref,
|
|
@@ -1919,8 +2322,8 @@ var Icon = forwardRef15(
|
|
|
1919
2322
|
Icon.displayName = "Icon";
|
|
1920
2323
|
|
|
1921
2324
|
// src/components/Link/Link.tsx
|
|
1922
|
-
import { forwardRef as
|
|
1923
|
-
import { jsx as
|
|
2325
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
2326
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1924
2327
|
var linkStyleClasses = {
|
|
1925
2328
|
brand: "font-sans text-link-text-enabled",
|
|
1926
2329
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1942,12 +2345,12 @@ var iconVariantClasses = {
|
|
|
1942
2345
|
lg: "w-24 h-24"
|
|
1943
2346
|
};
|
|
1944
2347
|
function SuccessIcon3({ className }) {
|
|
1945
|
-
return /* @__PURE__ */
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
2348
|
+
return /* @__PURE__ */ jsxs15("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2349
|
+
/* @__PURE__ */ jsx18("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2350
|
+
/* @__PURE__ */ jsx18("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1948
2351
|
] });
|
|
1949
2352
|
}
|
|
1950
|
-
var Link =
|
|
2353
|
+
var Link = forwardRef18(
|
|
1951
2354
|
(_a, ref) => {
|
|
1952
2355
|
var _b = _a, {
|
|
1953
2356
|
variant = "sm",
|
|
@@ -1978,9 +2381,9 @@ var Link = forwardRef16(
|
|
|
1978
2381
|
variantClass,
|
|
1979
2382
|
className
|
|
1980
2383
|
].filter(Boolean).join(" ");
|
|
1981
|
-
return /* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
icon && !isInline ? /* @__PURE__ */
|
|
2384
|
+
return /* @__PURE__ */ jsxs15("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
2385
|
+
/* @__PURE__ */ jsx18("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
2386
|
+
icon && !isInline ? /* @__PURE__ */ jsx18(SuccessIcon3, { className: iconClass }) : null
|
|
1984
2387
|
] }));
|
|
1985
2388
|
}
|
|
1986
2389
|
);
|
|
@@ -1988,11 +2391,11 @@ Link.displayName = "Link";
|
|
|
1988
2391
|
|
|
1989
2392
|
// src/components/Radio/Radio.tsx
|
|
1990
2393
|
import {
|
|
1991
|
-
forwardRef as
|
|
2394
|
+
forwardRef as forwardRef19,
|
|
1992
2395
|
useId as useId4
|
|
1993
2396
|
} from "react";
|
|
1994
|
-
import { jsx as
|
|
1995
|
-
var Radio =
|
|
2397
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2398
|
+
var Radio = forwardRef19(
|
|
1996
2399
|
(_a, ref) => {
|
|
1997
2400
|
var _b = _a, {
|
|
1998
2401
|
size = "sm",
|
|
@@ -2019,18 +2422,18 @@ var Radio = forwardRef17(
|
|
|
2019
2422
|
]);
|
|
2020
2423
|
const reactId = useId4();
|
|
2021
2424
|
const inputId = id != null ? id : reactId;
|
|
2022
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ jsx19(
|
|
2023
2426
|
"div",
|
|
2024
2427
|
{
|
|
2025
2428
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
2026
|
-
children: /* @__PURE__ */
|
|
2429
|
+
children: /* @__PURE__ */ jsxs16(
|
|
2027
2430
|
"label",
|
|
2028
2431
|
{
|
|
2029
2432
|
htmlFor: inputId,
|
|
2030
2433
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
2031
2434
|
children: [
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2436
|
+
/* @__PURE__ */ jsx19(
|
|
2034
2437
|
"input",
|
|
2035
2438
|
__spreadValues({
|
|
2036
2439
|
ref,
|
|
@@ -2043,14 +2446,14 @@ var Radio = forwardRef17(
|
|
|
2043
2446
|
name
|
|
2044
2447
|
}, rest)
|
|
2045
2448
|
),
|
|
2046
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ jsx19(
|
|
2047
2450
|
"div",
|
|
2048
2451
|
{
|
|
2049
2452
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
2050
2453
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
2051
2454
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
2052
2455
|
`,
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2456
|
+
children: /* @__PURE__ */ jsx19(
|
|
2054
2457
|
"span",
|
|
2055
2458
|
{
|
|
2056
2459
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -2061,12 +2464,12 @@ var Radio = forwardRef17(
|
|
|
2061
2464
|
}
|
|
2062
2465
|
)
|
|
2063
2466
|
] }),
|
|
2064
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsxs16(
|
|
2065
2468
|
"div",
|
|
2066
2469
|
{
|
|
2067
2470
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
2068
2471
|
children: [
|
|
2069
|
-
/* @__PURE__ */
|
|
2472
|
+
/* @__PURE__ */ jsx19(
|
|
2070
2473
|
"p",
|
|
2071
2474
|
{
|
|
2072
2475
|
className: `
|
|
@@ -2076,7 +2479,7 @@ var Radio = forwardRef17(
|
|
|
2076
2479
|
children: label
|
|
2077
2480
|
}
|
|
2078
2481
|
),
|
|
2079
|
-
/* @__PURE__ */
|
|
2482
|
+
/* @__PURE__ */ jsx19(
|
|
2080
2483
|
"p",
|
|
2081
2484
|
{
|
|
2082
2485
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -2097,19 +2500,19 @@ Radio.displayName = "Radio";
|
|
|
2097
2500
|
|
|
2098
2501
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
2099
2502
|
import {
|
|
2100
|
-
forwardRef as
|
|
2503
|
+
forwardRef as forwardRef20
|
|
2101
2504
|
} from "react";
|
|
2102
|
-
import { jsx as
|
|
2103
|
-
var SegmentControl =
|
|
2505
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2506
|
+
var SegmentControl = forwardRef20(
|
|
2104
2507
|
(_a, ref) => {
|
|
2105
2508
|
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
2106
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx20(
|
|
2107
2510
|
"div",
|
|
2108
2511
|
__spreadProps(__spreadValues({
|
|
2109
2512
|
ref,
|
|
2110
2513
|
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
2111
2514
|
}, rest), {
|
|
2112
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2515
|
+
children: items.map((item) => /* @__PURE__ */ jsx20(
|
|
2113
2516
|
"div",
|
|
2114
2517
|
{
|
|
2115
2518
|
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
@@ -2127,12 +2530,12 @@ SegmentControl.displayName = "SegmentControl";
|
|
|
2127
2530
|
|
|
2128
2531
|
// src/components/Slider/Slider.tsx
|
|
2129
2532
|
import {
|
|
2130
|
-
forwardRef as
|
|
2533
|
+
forwardRef as forwardRef21,
|
|
2131
2534
|
useCallback as useCallback2,
|
|
2132
2535
|
useId as useId5,
|
|
2133
|
-
useState as
|
|
2536
|
+
useState as useState10
|
|
2134
2537
|
} from "react";
|
|
2135
|
-
import { jsx as
|
|
2538
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2136
2539
|
var sizeConfig = {
|
|
2137
2540
|
small: {
|
|
2138
2541
|
trackH: "h-4",
|
|
@@ -2163,7 +2566,7 @@ var sizeConfig = {
|
|
|
2163
2566
|
}
|
|
2164
2567
|
};
|
|
2165
2568
|
function ChevronGlyphs({ size, color }) {
|
|
2166
|
-
return /* @__PURE__ */
|
|
2569
|
+
return /* @__PURE__ */ jsxs17(
|
|
2167
2570
|
"svg",
|
|
2168
2571
|
{
|
|
2169
2572
|
width: size,
|
|
@@ -2173,7 +2576,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2173
2576
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2174
2577
|
"aria-hidden": "true",
|
|
2175
2578
|
children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ jsx21(
|
|
2177
2580
|
"path",
|
|
2178
2581
|
{
|
|
2179
2582
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -2183,7 +2586,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2183
2586
|
strokeLinejoin: "round"
|
|
2184
2587
|
}
|
|
2185
2588
|
),
|
|
2186
|
-
/* @__PURE__ */
|
|
2589
|
+
/* @__PURE__ */ jsx21(
|
|
2187
2590
|
"path",
|
|
2188
2591
|
{
|
|
2189
2592
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -2197,7 +2600,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2197
2600
|
}
|
|
2198
2601
|
);
|
|
2199
2602
|
}
|
|
2200
|
-
var Slider =
|
|
2603
|
+
var Slider = forwardRef21(
|
|
2201
2604
|
(_a, ref) => {
|
|
2202
2605
|
var _b = _a, {
|
|
2203
2606
|
size = "medium",
|
|
@@ -2238,7 +2641,7 @@ var Slider = forwardRef19(
|
|
|
2238
2641
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
2239
2642
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
2240
2643
|
const isControlled = controlledValue !== void 0;
|
|
2241
|
-
const [internalValue, setInternalValue] =
|
|
2644
|
+
const [internalValue, setInternalValue] = useState10(defaultValue != null ? defaultValue : min);
|
|
2242
2645
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
2243
2646
|
const handleChange = useCallback2(
|
|
2244
2647
|
(e) => {
|
|
@@ -2260,13 +2663,13 @@ var Slider = forwardRef19(
|
|
|
2260
2663
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
2261
2664
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
2262
2665
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
2263
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ jsxs17(
|
|
2264
2667
|
"div",
|
|
2265
2668
|
{
|
|
2266
2669
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
2267
2670
|
children: [
|
|
2268
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
2269
|
-
label && /* @__PURE__ */
|
|
2671
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between", children: [
|
|
2672
|
+
label && /* @__PURE__ */ jsx21(
|
|
2270
2673
|
"label",
|
|
2271
2674
|
{
|
|
2272
2675
|
htmlFor: inputId,
|
|
@@ -2279,7 +2682,7 @@ var Slider = forwardRef19(
|
|
|
2279
2682
|
children: label
|
|
2280
2683
|
}
|
|
2281
2684
|
),
|
|
2282
|
-
showValue && /* @__PURE__ */
|
|
2685
|
+
showValue && /* @__PURE__ */ jsx21(
|
|
2283
2686
|
"span",
|
|
2284
2687
|
{
|
|
2285
2688
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -2287,7 +2690,7 @@ var Slider = forwardRef19(
|
|
|
2287
2690
|
}
|
|
2288
2691
|
)
|
|
2289
2692
|
] }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ jsxs17(
|
|
2291
2694
|
"div",
|
|
2292
2695
|
{
|
|
2293
2696
|
className: [
|
|
@@ -2296,7 +2699,7 @@ var Slider = forwardRef19(
|
|
|
2296
2699
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2297
2700
|
].join(" "),
|
|
2298
2701
|
children: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsx21(
|
|
2300
2703
|
"div",
|
|
2301
2704
|
{
|
|
2302
2705
|
className: [
|
|
@@ -2306,14 +2709,14 @@ var Slider = forwardRef19(
|
|
|
2306
2709
|
].join(" ")
|
|
2307
2710
|
}
|
|
2308
2711
|
),
|
|
2309
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx21(
|
|
2310
2713
|
"div",
|
|
2311
2714
|
{
|
|
2312
2715
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2313
2716
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2314
2717
|
}
|
|
2315
2718
|
),
|
|
2316
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx21(
|
|
2317
2720
|
"input",
|
|
2318
2721
|
__spreadValues({
|
|
2319
2722
|
ref,
|
|
@@ -2334,7 +2737,7 @@ var Slider = forwardRef19(
|
|
|
2334
2737
|
].join(" ")
|
|
2335
2738
|
}, rest)
|
|
2336
2739
|
),
|
|
2337
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ jsx21(
|
|
2338
2741
|
"div",
|
|
2339
2742
|
{
|
|
2340
2743
|
className: [
|
|
@@ -2347,13 +2750,13 @@ var Slider = forwardRef19(
|
|
|
2347
2750
|
!disabled && "peer-hover:shadow-medium"
|
|
2348
2751
|
].filter(Boolean).join(" "),
|
|
2349
2752
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2350
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ jsx21(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2351
2754
|
}
|
|
2352
2755
|
)
|
|
2353
2756
|
]
|
|
2354
2757
|
}
|
|
2355
2758
|
),
|
|
2356
|
-
description && /* @__PURE__ */
|
|
2759
|
+
description && /* @__PURE__ */ jsx21(
|
|
2357
2760
|
"span",
|
|
2358
2761
|
{
|
|
2359
2762
|
id: ariaDescriptionId,
|
|
@@ -2369,9 +2772,9 @@ var Slider = forwardRef19(
|
|
|
2369
2772
|
Slider.displayName = "Slider";
|
|
2370
2773
|
|
|
2371
2774
|
// src/components/Tab/Tab.tsx
|
|
2372
|
-
import { forwardRef as
|
|
2373
|
-
import { jsx as
|
|
2374
|
-
var Tab =
|
|
2775
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
2776
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2777
|
+
var Tab = forwardRef22(
|
|
2375
2778
|
(_a, ref) => {
|
|
2376
2779
|
var _b = _a, {
|
|
2377
2780
|
size = "md",
|
|
@@ -2390,7 +2793,7 @@ var Tab = forwardRef20(
|
|
|
2390
2793
|
"setSelected",
|
|
2391
2794
|
"className"
|
|
2392
2795
|
]);
|
|
2393
|
-
return /* @__PURE__ */
|
|
2796
|
+
return /* @__PURE__ */ jsx22(
|
|
2394
2797
|
"div",
|
|
2395
2798
|
__spreadProps(__spreadValues({
|
|
2396
2799
|
ref,
|
|
@@ -2409,11 +2812,11 @@ Tab.displayName = "Tab";
|
|
|
2409
2812
|
|
|
2410
2813
|
// src/components/TextArea/TextArea.tsx
|
|
2411
2814
|
import {
|
|
2412
|
-
useState as
|
|
2413
|
-
forwardRef as
|
|
2815
|
+
useState as useState11,
|
|
2816
|
+
forwardRef as forwardRef23
|
|
2414
2817
|
} from "react";
|
|
2415
|
-
import { Fragment as Fragment5, jsx as
|
|
2416
|
-
var TextArea =
|
|
2818
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2819
|
+
var TextArea = forwardRef23(
|
|
2417
2820
|
(_a, ref) => {
|
|
2418
2821
|
var _b = _a, {
|
|
2419
2822
|
error,
|
|
@@ -2453,21 +2856,21 @@ var TextArea = forwardRef21(
|
|
|
2453
2856
|
"className"
|
|
2454
2857
|
]);
|
|
2455
2858
|
var _a2;
|
|
2456
|
-
const [isFocused, setIsFocused] =
|
|
2859
|
+
const [isFocused, setIsFocused] = useState11(false);
|
|
2457
2860
|
const isActive = isFocused && !!value;
|
|
2458
|
-
return /* @__PURE__ */
|
|
2459
|
-
label || showCounter ? /* @__PURE__ */
|
|
2460
|
-
label ? /* @__PURE__ */
|
|
2861
|
+
return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2862
|
+
label || showCounter ? /* @__PURE__ */ jsxs18("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2863
|
+
label ? /* @__PURE__ */ jsxs18(
|
|
2461
2864
|
"p",
|
|
2462
2865
|
{
|
|
2463
2866
|
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2464
2867
|
children: [
|
|
2465
2868
|
label,
|
|
2466
|
-
optional && /* @__PURE__ */
|
|
2869
|
+
optional && /* @__PURE__ */ jsx23("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2467
2870
|
]
|
|
2468
2871
|
}
|
|
2469
|
-
) : /* @__PURE__ */
|
|
2470
|
-
showCounter && /* @__PURE__ */
|
|
2872
|
+
) : /* @__PURE__ */ jsx23("span", {}),
|
|
2873
|
+
showCounter && /* @__PURE__ */ jsxs18(
|
|
2471
2874
|
"p",
|
|
2472
2875
|
{
|
|
2473
2876
|
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
@@ -2478,13 +2881,13 @@ var TextArea = forwardRef21(
|
|
|
2478
2881
|
]
|
|
2479
2882
|
}
|
|
2480
2883
|
)
|
|
2481
|
-
] }) : /* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2884
|
+
] }) : /* @__PURE__ */ jsx23(Fragment5, {}),
|
|
2885
|
+
/* @__PURE__ */ jsxs18(
|
|
2483
2886
|
"div",
|
|
2484
2887
|
{
|
|
2485
2888
|
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
2889
|
children: [
|
|
2487
|
-
/* @__PURE__ */
|
|
2890
|
+
/* @__PURE__ */ jsx23(
|
|
2488
2891
|
"textarea",
|
|
2489
2892
|
__spreadValues({
|
|
2490
2893
|
ref,
|
|
@@ -2505,13 +2908,14 @@ var TextArea = forwardRef21(
|
|
|
2505
2908
|
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
2909
|
}, props)
|
|
2507
2910
|
),
|
|
2508
|
-
pending ? /* @__PURE__ */
|
|
2911
|
+
pending ? /* @__PURE__ */ jsx23(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx23(
|
|
2509
2912
|
IconButton,
|
|
2510
2913
|
{
|
|
2511
2914
|
size: "s",
|
|
2915
|
+
transparent: true,
|
|
2512
2916
|
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2513
2917
|
className: "absolute right-6 top-6",
|
|
2514
|
-
icon: /* @__PURE__ */
|
|
2918
|
+
icon: /* @__PURE__ */ jsx23(
|
|
2515
2919
|
"svg",
|
|
2516
2920
|
{
|
|
2517
2921
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2519,7 +2923,7 @@ var TextArea = forwardRef21(
|
|
|
2519
2923
|
height: "20",
|
|
2520
2924
|
viewBox: "0 0 20 20",
|
|
2521
2925
|
fill: "none",
|
|
2522
|
-
children: /* @__PURE__ */
|
|
2926
|
+
children: /* @__PURE__ */ jsx23(
|
|
2523
2927
|
"path",
|
|
2524
2928
|
{
|
|
2525
2929
|
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 +2941,7 @@ var TextArea = forwardRef21(
|
|
|
2537
2941
|
});
|
|
2538
2942
|
}
|
|
2539
2943
|
}
|
|
2540
|
-
) : success ? /* @__PURE__ */
|
|
2944
|
+
) : success ? /* @__PURE__ */ jsx23(
|
|
2541
2945
|
"svg",
|
|
2542
2946
|
{
|
|
2543
2947
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2546,7 +2950,7 @@ var TextArea = forwardRef21(
|
|
|
2546
2950
|
viewBox: "0 0 20 20",
|
|
2547
2951
|
fill: "none",
|
|
2548
2952
|
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2549
|
-
children: /* @__PURE__ */
|
|
2953
|
+
children: /* @__PURE__ */ jsx23(
|
|
2550
2954
|
"path",
|
|
2551
2955
|
{
|
|
2552
2956
|
fillRule: "evenodd",
|
|
@@ -2556,7 +2960,7 @@ var TextArea = forwardRef21(
|
|
|
2556
2960
|
}
|
|
2557
2961
|
)
|
|
2558
2962
|
}
|
|
2559
|
-
) : error ? /* @__PURE__ */
|
|
2963
|
+
) : error ? /* @__PURE__ */ jsx23(
|
|
2560
2964
|
"svg",
|
|
2561
2965
|
{
|
|
2562
2966
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2565,7 +2969,7 @@ var TextArea = forwardRef21(
|
|
|
2565
2969
|
viewBox: "0 0 20 20",
|
|
2566
2970
|
fill: "none",
|
|
2567
2971
|
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__ */
|
|
2972
|
+
children: /* @__PURE__ */ jsx23(
|
|
2569
2973
|
"path",
|
|
2570
2974
|
{
|
|
2571
2975
|
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 +2977,42 @@ var TextArea = forwardRef21(
|
|
|
2573
2977
|
}
|
|
2574
2978
|
)
|
|
2575
2979
|
}
|
|
2576
|
-
) : /* @__PURE__ */
|
|
2980
|
+
) : /* @__PURE__ */ jsx23(Fragment5, {})
|
|
2577
2981
|
]
|
|
2578
2982
|
}
|
|
2579
2983
|
),
|
|
2580
|
-
error ? /* @__PURE__ */
|
|
2984
|
+
error ? /* @__PURE__ */ jsx23("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx23(
|
|
2581
2985
|
"p",
|
|
2582
2986
|
{
|
|
2583
2987
|
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2584
2988
|
children: helperText
|
|
2585
2989
|
}
|
|
2586
|
-
) : /* @__PURE__ */
|
|
2990
|
+
) : /* @__PURE__ */ jsx23(Fragment5, {})
|
|
2587
2991
|
] });
|
|
2588
2992
|
}
|
|
2589
2993
|
);
|
|
2590
2994
|
TextArea.displayName = "TextArea";
|
|
2591
2995
|
|
|
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
2996
|
// src/components/Toast/Toast.tsx
|
|
2793
|
-
import { forwardRef as
|
|
2794
|
-
import { jsx as
|
|
2997
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
2998
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2795
2999
|
function CheckCircleIcon({ className }) {
|
|
2796
3000
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx24("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3002
|
+
/* @__PURE__ */ jsx24("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2799
3003
|
] });
|
|
2800
3004
|
}
|
|
2801
3005
|
function ProgressIcon({ className }) {
|
|
2802
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx24(Loading, { size: "sm", className });
|
|
2803
3007
|
}
|
|
2804
3008
|
function ErrorIcon({ className }) {
|
|
2805
3009
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx24("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3011
|
+
/* @__PURE__ */ jsx24("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2808
3012
|
] });
|
|
2809
3013
|
}
|
|
2810
3014
|
function CloseIcon5({ className }) {
|
|
2811
|
-
return /* @__PURE__ */
|
|
3015
|
+
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
3016
|
}
|
|
2813
3017
|
var defaultIcons3 = {
|
|
2814
3018
|
default: CheckCircleIcon,
|
|
@@ -2825,7 +3029,7 @@ var iconColorClasses = {
|
|
|
2825
3029
|
progress: "text-toast-progress-icon",
|
|
2826
3030
|
error: "text-toast-error-icon"
|
|
2827
3031
|
};
|
|
2828
|
-
var Toast =
|
|
3032
|
+
var Toast = forwardRef24(
|
|
2829
3033
|
(_a, ref) => {
|
|
2830
3034
|
var _b = _a, {
|
|
2831
3035
|
type = "default",
|
|
@@ -2854,9 +3058,9 @@ var Toast = forwardRef23(
|
|
|
2854
3058
|
className
|
|
2855
3059
|
].filter(Boolean).join(" ");
|
|
2856
3060
|
return /* @__PURE__ */ jsxs19("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2857
|
-
icon && /* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
3061
|
+
icon && /* @__PURE__ */ jsx24("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx24(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
3062
|
+
/* @__PURE__ */ jsx24("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
3063
|
+
actionLabel && onAction && /* @__PURE__ */ jsx24(
|
|
2860
3064
|
"button",
|
|
2861
3065
|
{
|
|
2862
3066
|
type: "button",
|
|
@@ -2865,14 +3069,14 @@ var Toast = forwardRef23(
|
|
|
2865
3069
|
children: actionLabel
|
|
2866
3070
|
}
|
|
2867
3071
|
),
|
|
2868
|
-
onDismiss && /* @__PURE__ */
|
|
3072
|
+
onDismiss && /* @__PURE__ */ jsx24(
|
|
2869
3073
|
"button",
|
|
2870
3074
|
{
|
|
2871
3075
|
type: "button",
|
|
2872
3076
|
onClick: onDismiss,
|
|
2873
3077
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2874
3078
|
"aria-label": "Dismiss",
|
|
2875
|
-
children: /* @__PURE__ */
|
|
3079
|
+
children: /* @__PURE__ */ jsx24(CloseIcon5, { className: "h-16 w-16" })
|
|
2876
3080
|
}
|
|
2877
3081
|
)
|
|
2878
3082
|
] }));
|
|
@@ -2881,9 +3085,9 @@ var Toast = forwardRef23(
|
|
|
2881
3085
|
Toast.displayName = "Toast";
|
|
2882
3086
|
|
|
2883
3087
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2884
|
-
import { forwardRef as
|
|
2885
|
-
import { jsx as
|
|
2886
|
-
var ToggleSwitch =
|
|
3088
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
3089
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3090
|
+
var ToggleSwitch = forwardRef25(
|
|
2887
3091
|
(_a, ref) => {
|
|
2888
3092
|
var _b = _a, {
|
|
2889
3093
|
value,
|
|
@@ -2905,7 +3109,7 @@ var ToggleSwitch = forwardRef24(
|
|
|
2905
3109
|
className: `inline-flex items-center ${className}`
|
|
2906
3110
|
}, rest), {
|
|
2907
3111
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
3112
|
+
/* @__PURE__ */ jsx25(
|
|
2909
3113
|
"input",
|
|
2910
3114
|
{
|
|
2911
3115
|
type: "checkbox",
|
|
@@ -2915,7 +3119,7 @@ var ToggleSwitch = forwardRef24(
|
|
|
2915
3119
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2916
3120
|
}
|
|
2917
3121
|
),
|
|
2918
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsx25(
|
|
2919
3123
|
"div",
|
|
2920
3124
|
{
|
|
2921
3125
|
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 `
|
|
@@ -2930,13 +3134,13 @@ ToggleSwitch.displayName = "ToggleSwitch";
|
|
|
2930
3134
|
|
|
2931
3135
|
// src/components/Tooltip/Tooltip.tsx
|
|
2932
3136
|
import {
|
|
2933
|
-
useState as
|
|
2934
|
-
useEffect as
|
|
2935
|
-
useRef as
|
|
2936
|
-
forwardRef as
|
|
3137
|
+
useState as useState12,
|
|
3138
|
+
useEffect as useEffect5,
|
|
3139
|
+
useRef as useRef4,
|
|
3140
|
+
forwardRef as forwardRef26
|
|
2937
3141
|
} from "react";
|
|
2938
|
-
import { Fragment as
|
|
2939
|
-
var Tooltip =
|
|
3142
|
+
import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3143
|
+
var Tooltip = forwardRef26(
|
|
2940
3144
|
(_a, ref) => {
|
|
2941
3145
|
var _b = _a, {
|
|
2942
3146
|
size = "md",
|
|
@@ -2953,10 +3157,10 @@ var Tooltip = forwardRef25(
|
|
|
2953
3157
|
"position",
|
|
2954
3158
|
"className"
|
|
2955
3159
|
]);
|
|
2956
|
-
const wrapperRef =
|
|
2957
|
-
const [isVisible, setIsVisible] =
|
|
2958
|
-
const [isHovered, setIsHovered] =
|
|
2959
|
-
|
|
3160
|
+
const wrapperRef = useRef4(null);
|
|
3161
|
+
const [isVisible, setIsVisible] = useState12(false);
|
|
3162
|
+
const [isHovered, setIsHovered] = useState12(false);
|
|
3163
|
+
useEffect5(() => {
|
|
2960
3164
|
const handleClickOutside = (event) => {
|
|
2961
3165
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2962
3166
|
setIsVisible(false);
|
|
@@ -2975,7 +3179,7 @@ var Tooltip = forwardRef25(
|
|
|
2975
3179
|
ref
|
|
2976
3180
|
}, rest), {
|
|
2977
3181
|
children: [
|
|
2978
|
-
/* @__PURE__ */
|
|
3182
|
+
/* @__PURE__ */ jsx26(
|
|
2979
3183
|
"div",
|
|
2980
3184
|
{
|
|
2981
3185
|
ref: wrapperRef,
|
|
@@ -2997,20 +3201,20 @@ var Tooltip = forwardRef25(
|
|
|
2997
3201
|
{
|
|
2998
3202
|
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
3203
|
children: [
|
|
3000
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ jsx26(
|
|
3001
3205
|
"span",
|
|
3002
3206
|
{
|
|
3003
3207
|
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
3208
|
}
|
|
3005
3209
|
),
|
|
3006
|
-
headText ? /* @__PURE__ */
|
|
3210
|
+
headText ? /* @__PURE__ */ jsx26(
|
|
3007
3211
|
"p",
|
|
3008
3212
|
{
|
|
3009
3213
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
3010
3214
|
children: headText
|
|
3011
3215
|
}
|
|
3012
|
-
) : /* @__PURE__ */
|
|
3013
|
-
text ? /* @__PURE__ */
|
|
3216
|
+
) : /* @__PURE__ */ jsx26(Fragment6, {}),
|
|
3217
|
+
text ? /* @__PURE__ */ jsx26("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx26(Fragment6, {})
|
|
3014
3218
|
]
|
|
3015
3219
|
}
|
|
3016
3220
|
)
|
|
@@ -3029,6 +3233,7 @@ export {
|
|
|
3029
3233
|
Button,
|
|
3030
3234
|
Checkbox,
|
|
3031
3235
|
Chip,
|
|
3236
|
+
CurrencyField,
|
|
3032
3237
|
Dialog,
|
|
3033
3238
|
Drawer,
|
|
3034
3239
|
Dropdown,
|