@bestow-ui/react 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +530 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +464 -72
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +144 -2
- package/dist/index.d.ts +144 -2
- package/dist/index.js +503 -220
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -206,36 +206,67 @@ function usePortalClassName() {
|
|
|
206
206
|
return usePortalProps().className;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
// src/components/Accordion/Accordion.tsx
|
|
210
|
+
import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
211
|
+
import { ChevronDownIcon } from "@bestow-ui/icons";
|
|
212
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
213
|
+
|
|
214
|
+
// src/components/Accordion/Accordion.css.ts
|
|
215
|
+
var chevron = "v58j0l4";
|
|
216
|
+
var content = "v58j0l5";
|
|
217
|
+
var contentInner = "v58j0l6";
|
|
218
|
+
var header = "v58j0l2";
|
|
219
|
+
var item = "v58j0l1";
|
|
220
|
+
var root2 = "v58j0l0";
|
|
221
|
+
var trigger = "v58j0l3";
|
|
222
|
+
|
|
223
|
+
// src/components/Accordion/Accordion.tsx
|
|
224
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
225
|
+
var Accordion = forwardRef2(function Accordion2({ className, ...props }, ref) {
|
|
226
|
+
const rootProps = "value" in props ? { ...props, value: props.value ?? (props.type === "multiple" ? [] : "") } : props;
|
|
227
|
+
return /* @__PURE__ */ jsx2(RadixAccordion.Root, { ref, className: cx(root2, className), ...rootProps });
|
|
228
|
+
});
|
|
229
|
+
var AccordionItem = forwardRef2(function AccordionItem2({ title: title4, headingLevel = 3, className, children, ...rest }, ref) {
|
|
230
|
+
const Heading = `h${headingLevel}`;
|
|
231
|
+
return /* @__PURE__ */ jsxs(RadixAccordion.Item, { ref, className: cx(item, className), ...rest, children: [
|
|
232
|
+
/* @__PURE__ */ jsx2(RadixAccordion.Header, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { className: header, children: /* @__PURE__ */ jsxs(RadixAccordion.Trigger, { className: trigger, children: [
|
|
233
|
+
title4,
|
|
234
|
+
/* @__PURE__ */ jsx2(ChevronDownIcon, { size: 18, className: chevron })
|
|
235
|
+
] }) }) }),
|
|
236
|
+
/* @__PURE__ */ jsx2(RadixAccordion.Content, { className: content, children: /* @__PURE__ */ jsx2("div", { className: contentInner, children }) })
|
|
237
|
+
] });
|
|
238
|
+
});
|
|
239
|
+
|
|
209
240
|
// src/components/Avatar/Avatar.tsx
|
|
210
241
|
import * as RadixAvatar from "@radix-ui/react-avatar";
|
|
211
242
|
import { UserIcon } from "@bestow-ui/icons";
|
|
212
|
-
import { forwardRef as
|
|
243
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
213
244
|
|
|
214
245
|
// src/components/Avatar/Avatar.css.ts
|
|
215
246
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
216
247
|
var fallback = "_1fd2kp27";
|
|
217
248
|
var image = "_1fd2kp26";
|
|
218
|
-
var
|
|
249
|
+
var root3 = _7a468({ defaultClassName: "_1fd2kp20", variantClassNames: { size: { sm: "_1fd2kp21", md: "_1fd2kp22", lg: "_1fd2kp23" }, shape: { circle: "_1fd2kp24", square: "_1fd2kp25" } }, defaultVariants: { size: "md", shape: "circle" }, compoundVariants: [] });
|
|
219
250
|
|
|
220
251
|
// src/components/Avatar/Avatar.tsx
|
|
221
|
-
import { jsx as
|
|
252
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
222
253
|
function getInitials(name) {
|
|
223
254
|
const [a = "", b = ""] = name.trim().split(/\s+/);
|
|
224
255
|
const first = (word) => Array.from(word)[0] ?? "";
|
|
225
256
|
return (first(a) + first(b)).toUpperCase();
|
|
226
257
|
}
|
|
227
|
-
var Avatar =
|
|
228
|
-
const
|
|
229
|
-
const a11y =
|
|
258
|
+
var Avatar = forwardRef3(function Avatar2({ src, alt, name, fallback: fallback2, size, shape, className, ...rest }, ref) {
|
|
259
|
+
const label4 = alt ?? name;
|
|
260
|
+
const a11y = label4 ? { role: "img", "aria-label": label4 } : { "aria-hidden": true };
|
|
230
261
|
const initials = name ? getInitials(name) : "";
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
src && /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ jsxs2(RadixAvatar.Root, { ref, className: cx(root3({ size, shape }), className), ...a11y, ...rest, children: [
|
|
263
|
+
src && /* @__PURE__ */ jsx3(RadixAvatar.Image, { src, alt: "", className: image }),
|
|
264
|
+
/* @__PURE__ */ jsx3(RadixAvatar.Fallback, { className: fallback, children: fallback2 ?? (initials || /* @__PURE__ */ jsx3(UserIcon, { size: "60%" })) })
|
|
234
265
|
] });
|
|
235
266
|
});
|
|
236
267
|
|
|
237
268
|
// src/components/Badge/Badge.tsx
|
|
238
|
-
import { forwardRef as
|
|
269
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
239
270
|
|
|
240
271
|
// src/components/Badge/Badge.css.ts
|
|
241
272
|
import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -243,20 +274,20 @@ var badge = _7a4682({ defaultClassName: "_1295cfn4", variantClassNames: { varian
|
|
|
243
274
|
var icon = "_1295cfnf";
|
|
244
275
|
|
|
245
276
|
// src/components/Badge/Badge.tsx
|
|
246
|
-
import { jsx as
|
|
247
|
-
var Badge =
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
startIcon && /* @__PURE__ */
|
|
277
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
278
|
+
var Badge = forwardRef4(function Badge2({ variant, color, size, startIcon, className, children, ...rest }, ref) {
|
|
279
|
+
return /* @__PURE__ */ jsxs3("span", { ref, className: cx(badge({ variant, color, size }), className), ...rest, children: [
|
|
280
|
+
startIcon && /* @__PURE__ */ jsx4("span", { className: icon, children: startIcon }),
|
|
250
281
|
children
|
|
251
282
|
] });
|
|
252
283
|
});
|
|
253
284
|
|
|
254
285
|
// src/components/Button/Button.tsx
|
|
255
|
-
import { forwardRef as
|
|
286
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
256
287
|
|
|
257
288
|
// src/components/Spinner/Spinner.tsx
|
|
258
289
|
import { LoaderIcon } from "@bestow-ui/icons";
|
|
259
|
-
import { forwardRef as
|
|
290
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
260
291
|
|
|
261
292
|
// src/styles/visuallyHidden.css.ts
|
|
262
293
|
var visuallyHidden = "_1kdtbw10";
|
|
@@ -266,12 +297,12 @@ import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRunti
|
|
|
266
297
|
var spinner = _7a4683({ defaultClassName: "_4b5tg40", variantClassNames: { color: { current: "_4b5tg41", primary: "_4b5tg42", neutral: "_4b5tg43", danger: "_4b5tg44" }, size: { sm: "_4b5tg45", md: "_4b5tg46", lg: "_4b5tg47" } }, defaultVariants: { color: "current", size: "md" }, compoundVariants: [] });
|
|
267
298
|
|
|
268
299
|
// src/components/Spinner/Spinner.tsx
|
|
269
|
-
import { jsx as
|
|
270
|
-
var Spinner =
|
|
271
|
-
const a11y =
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
300
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
301
|
+
var Spinner = forwardRef5(function Spinner2({ size, color, label: label4 = "\uB85C\uB529 \uC911", className, ...rest }, ref) {
|
|
302
|
+
const a11y = label4 ? { role: "status" } : { "aria-hidden": true };
|
|
303
|
+
return /* @__PURE__ */ jsxs4("span", { ref, className: cx(spinner({ size, color }), className), ...a11y, ...rest, children: [
|
|
304
|
+
/* @__PURE__ */ jsx5(LoaderIcon, { size: "100%" }),
|
|
305
|
+
label4 && /* @__PURE__ */ jsx5("span", { className: visuallyHidden, children: label4 })
|
|
275
306
|
] });
|
|
276
307
|
});
|
|
277
308
|
|
|
@@ -281,8 +312,8 @@ var button = _7a4684({ defaultClassName: "xcekda6", variantClassNames: { variant
|
|
|
281
312
|
var icon2 = "xcekdai";
|
|
282
313
|
|
|
283
314
|
// src/components/Button/Button.tsx
|
|
284
|
-
import { jsx as
|
|
285
|
-
var Button =
|
|
315
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
316
|
+
var Button = forwardRef6(function Button2({ variant, color, size, fullWidth, startIcon, endIcon, loading, className, type = "button", onClick, children, ...rest }, ref) {
|
|
286
317
|
const handleClick = (event) => {
|
|
287
318
|
if (loading) {
|
|
288
319
|
event.preventDefault();
|
|
@@ -290,8 +321,8 @@ var Button = forwardRef5(function Button2({ variant, color, size, fullWidth, sta
|
|
|
290
321
|
}
|
|
291
322
|
onClick?.(event);
|
|
292
323
|
};
|
|
293
|
-
const leading = loading ? /* @__PURE__ */
|
|
294
|
-
return /* @__PURE__ */
|
|
324
|
+
const leading = loading ? /* @__PURE__ */ jsx6(Spinner, { size: "sm", label: "" }) : startIcon;
|
|
325
|
+
return /* @__PURE__ */ jsxs5(
|
|
295
326
|
"button",
|
|
296
327
|
{
|
|
297
328
|
ref,
|
|
@@ -302,41 +333,41 @@ var Button = forwardRef5(function Button2({ variant, color, size, fullWidth, sta
|
|
|
302
333
|
onClick: handleClick,
|
|
303
334
|
...rest,
|
|
304
335
|
children: [
|
|
305
|
-
leading && /* @__PURE__ */
|
|
336
|
+
leading && /* @__PURE__ */ jsx6("span", { className: icon2, children: leading }),
|
|
306
337
|
children,
|
|
307
|
-
endIcon && /* @__PURE__ */
|
|
338
|
+
endIcon && /* @__PURE__ */ jsx6("span", { className: icon2, children: endIcon })
|
|
308
339
|
]
|
|
309
340
|
}
|
|
310
341
|
);
|
|
311
342
|
});
|
|
312
343
|
|
|
313
344
|
// src/components/Card/Card.tsx
|
|
314
|
-
import { forwardRef as
|
|
345
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
315
346
|
|
|
316
347
|
// src/components/Card/Card.css.ts
|
|
317
348
|
import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
318
349
|
var body = "dnuf1u9";
|
|
319
350
|
var card = _7a4685({ defaultClassName: "dnuf1u0", variantClassNames: { variant: { outline: "dnuf1u1", elevated: "dnuf1u2", soft: "dnuf1u3" }, padding: { none: "dnuf1u4", sm: "dnuf1u5", md: "dnuf1u6", lg: "dnuf1u7" } }, defaultVariants: { variant: "outline", padding: "md" }, compoundVariants: [] });
|
|
320
351
|
var footer = "dnuf1ua";
|
|
321
|
-
var
|
|
352
|
+
var header2 = "dnuf1u8";
|
|
322
353
|
|
|
323
354
|
// src/components/Card/Card.tsx
|
|
324
|
-
import { jsx as
|
|
325
|
-
var Card =
|
|
326
|
-
return /* @__PURE__ */
|
|
355
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
356
|
+
var Card = forwardRef7(function Card2({ variant, padding, as: Component = "div", className, ...rest }, ref) {
|
|
357
|
+
return /* @__PURE__ */ jsx7(Component, { ref, className: cx(card({ variant, padding }), className), ...rest });
|
|
327
358
|
});
|
|
328
|
-
var CardHeader =
|
|
329
|
-
return /* @__PURE__ */
|
|
359
|
+
var CardHeader = forwardRef7(function CardHeader2({ className, ...rest }, ref) {
|
|
360
|
+
return /* @__PURE__ */ jsx7("div", { ref, className: cx(header2, className), ...rest });
|
|
330
361
|
});
|
|
331
|
-
var CardBody =
|
|
332
|
-
return /* @__PURE__ */
|
|
362
|
+
var CardBody = forwardRef7(function CardBody2({ className, ...rest }, ref) {
|
|
363
|
+
return /* @__PURE__ */ jsx7("div", { ref, className: cx(body, className), ...rest });
|
|
333
364
|
});
|
|
334
|
-
var CardFooter =
|
|
335
|
-
return /* @__PURE__ */
|
|
365
|
+
var CardFooter = forwardRef7(function CardFooter2({ className, ...rest }, ref) {
|
|
366
|
+
return /* @__PURE__ */ jsx7("div", { ref, className: cx(footer, className), ...rest });
|
|
336
367
|
});
|
|
337
368
|
|
|
338
369
|
// src/components/Checkbox/Checkbox.tsx
|
|
339
|
-
import { forwardRef as
|
|
370
|
+
import { forwardRef as forwardRef8, useEffect, useRef } from "react";
|
|
340
371
|
|
|
341
372
|
// src/utils/mergeRefs.ts
|
|
342
373
|
function mergeRefs(...refs) {
|
|
@@ -354,18 +385,18 @@ var checkIcon = "_1y7mzsn8 _1y7mzsn7";
|
|
|
354
385
|
var control = _7a4686({ defaultClassName: "_1y7mzsn3", variantClassNames: { size: { sm: "_1y7mzsn4", md: "_1y7mzsn5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
355
386
|
var indeterminateIcon = "_1y7mzsn9 _1y7mzsn7";
|
|
356
387
|
var input = "_1y7mzsn6";
|
|
357
|
-
var
|
|
388
|
+
var root4 = _7a4686({ defaultClassName: "_1y7mzsn0", variantClassNames: { size: { sm: "_1y7mzsn1", md: "_1y7mzsn2" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
358
389
|
|
|
359
390
|
// src/components/Checkbox/Checkbox.tsx
|
|
360
|
-
import { jsx as
|
|
361
|
-
var Checkbox =
|
|
391
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
392
|
+
var Checkbox = forwardRef8(function Checkbox2({ label: label4, size, indeterminate = false, invalid, disabled, className, ...rest }, ref) {
|
|
362
393
|
const innerRef = useRef(null);
|
|
363
394
|
useEffect(() => {
|
|
364
395
|
if (innerRef.current) innerRef.current.indeterminate = indeterminate;
|
|
365
396
|
}, [indeterminate]);
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsxs6("label", { className: cx(root4({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
398
|
+
/* @__PURE__ */ jsxs6("span", { className: control({ size }), children: [
|
|
399
|
+
/* @__PURE__ */ jsx8(
|
|
369
400
|
"input",
|
|
370
401
|
{
|
|
371
402
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -376,15 +407,15 @@ var Checkbox = forwardRef7(function Checkbox2({ label: label3, size, indetermina
|
|
|
376
407
|
...rest
|
|
377
408
|
}
|
|
378
409
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsx8("svg", { className: checkIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx8("path", { d: "M5 10.5l3.2 3L15 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
411
|
+
/* @__PURE__ */ jsx8("svg", { className: indeterminateIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx8("path", { d: "M6 10h8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
381
412
|
] }),
|
|
382
|
-
|
|
413
|
+
label4
|
|
383
414
|
] });
|
|
384
415
|
});
|
|
385
416
|
|
|
386
417
|
// src/components/Divider/Divider.tsx
|
|
387
|
-
import { forwardRef as
|
|
418
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
388
419
|
|
|
389
420
|
// src/components/Divider/Divider.css.ts
|
|
390
421
|
import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -393,21 +424,71 @@ var labeled = "_1t3gq8v3";
|
|
|
393
424
|
var line = "_1t3gq8v4";
|
|
394
425
|
|
|
395
426
|
// src/components/Divider/Divider.tsx
|
|
396
|
-
import { jsx as
|
|
397
|
-
var Divider =
|
|
427
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
428
|
+
var Divider = forwardRef9(function Divider2({ orientation = "horizontal", decorative, className, children, ...rest }, ref) {
|
|
398
429
|
if (children && orientation === "horizontal") {
|
|
399
|
-
return /* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ jsxs7("div", { ref, className: cx(labeled, className), ...rest, children: [
|
|
431
|
+
/* @__PURE__ */ jsx9("span", { className: line, "aria-hidden": true }),
|
|
401
432
|
children,
|
|
402
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ jsx9("span", { className: line, "aria-hidden": true })
|
|
403
434
|
] });
|
|
404
435
|
}
|
|
405
436
|
const a11y = decorative ? { role: "none" } : { role: "separator", "aria-orientation": orientation === "vertical" ? "vertical" : void 0 };
|
|
406
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ jsx9("div", { ref, className: cx(divider({ orientation }), className), ...a11y, ...rest });
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
441
|
+
import * as RadixMenu from "@radix-ui/react-dropdown-menu";
|
|
442
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
443
|
+
|
|
444
|
+
// src/components/DropdownMenu/DropdownMenu.css.ts
|
|
445
|
+
var content2 = "_1d7ahux0";
|
|
446
|
+
var danger = "_1d7ahux2";
|
|
447
|
+
var icon3 = "_1d7ahux3";
|
|
448
|
+
var item2 = "_1d7ahux1";
|
|
449
|
+
var label = "_1d7ahux5";
|
|
450
|
+
var separator = "_1d7ahux6";
|
|
451
|
+
var shortcut = "_1d7ahux4";
|
|
452
|
+
|
|
453
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
454
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
455
|
+
var DropdownMenu = RadixMenu.Root;
|
|
456
|
+
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
457
|
+
var DropdownMenuGroup = RadixMenu.Group;
|
|
458
|
+
var DropdownMenuContent = forwardRef10(function DropdownMenuContent2({ className, style, side = "bottom", align = "start", sideOffset = 4, collisionPadding = 8, ...rest }, ref) {
|
|
459
|
+
const portal2 = usePortalProps();
|
|
460
|
+
return /* @__PURE__ */ jsx10(RadixMenu.Portal, { children: /* @__PURE__ */ jsx10(
|
|
461
|
+
RadixMenu.Content,
|
|
462
|
+
{
|
|
463
|
+
ref,
|
|
464
|
+
side,
|
|
465
|
+
align,
|
|
466
|
+
sideOffset,
|
|
467
|
+
collisionPadding,
|
|
468
|
+
className: cx(portal2.className, content2, className),
|
|
469
|
+
style: { ...portal2.style, ...style },
|
|
470
|
+
...rest
|
|
471
|
+
}
|
|
472
|
+
) });
|
|
473
|
+
});
|
|
474
|
+
var DropdownMenuItem = forwardRef10(function DropdownMenuItem2({ icon: icon5, shortcut: shortcut2, color = "default", className, children, ...rest }, ref) {
|
|
475
|
+
return /* @__PURE__ */ jsxs8(RadixMenu.Item, { ref, className: cx(item2, color === "danger" && danger, className), ...rest, children: [
|
|
476
|
+
icon5 && /* @__PURE__ */ jsx10("span", { className: icon3, "aria-hidden": true, children: icon5 }),
|
|
477
|
+
children,
|
|
478
|
+
shortcut2 && /* @__PURE__ */ jsx10("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
479
|
+
] });
|
|
480
|
+
});
|
|
481
|
+
var DropdownMenuLabel = forwardRef10(function DropdownMenuLabel2({ className, ...rest }, ref) {
|
|
482
|
+
return /* @__PURE__ */ jsx10(RadixMenu.Label, { ref, className: cx(label, className), ...rest });
|
|
407
483
|
});
|
|
484
|
+
var DropdownMenuSeparator = forwardRef10(
|
|
485
|
+
function DropdownMenuSeparator2({ className, ...rest }, ref) {
|
|
486
|
+
return /* @__PURE__ */ jsx10(RadixMenu.Separator, { ref, className: cx(separator, className), ...rest });
|
|
487
|
+
}
|
|
488
|
+
);
|
|
408
489
|
|
|
409
490
|
// src/components/Input/Input.tsx
|
|
410
|
-
import { forwardRef as
|
|
491
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
411
492
|
|
|
412
493
|
// src/components/Input/Input.css.ts
|
|
413
494
|
import { createRuntimeFn as _7a4688 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -416,22 +497,22 @@ var field = "_19p5zvh7";
|
|
|
416
497
|
var fieldFullWidth = "_19p5zvh8";
|
|
417
498
|
var helperText = _7a4688({ defaultClassName: "_19p5zvhb", variantClassNames: { error: { true: "_19p5zvhc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
418
499
|
var input2 = "_19p5zvh5";
|
|
419
|
-
var
|
|
500
|
+
var label2 = "_19p5zvh9";
|
|
420
501
|
var requiredMark = "_19p5zvha";
|
|
421
|
-
var
|
|
502
|
+
var root5 = _7a4688({ defaultClassName: "_19p5zvh0", variantClassNames: { size: { sm: "_19p5zvh1", md: "_19p5zvh2", lg: "_19p5zvh3" }, fullWidth: { true: "_19p5zvh4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
422
503
|
|
|
423
504
|
// src/components/Input/Input.tsx
|
|
424
|
-
import { jsx as
|
|
425
|
-
var Input =
|
|
426
|
-
return /* @__PURE__ */
|
|
505
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
506
|
+
var Input = forwardRef11(function Input2({ size, invalid, fullWidth, startAdornment, endAdornment, rootClassName, className, disabled, ...rest }, ref) {
|
|
507
|
+
return /* @__PURE__ */ jsxs9(
|
|
427
508
|
"div",
|
|
428
509
|
{
|
|
429
|
-
className: cx(
|
|
510
|
+
className: cx(root5({ size, fullWidth }), rootClassName),
|
|
430
511
|
"data-invalid": invalid || void 0,
|
|
431
512
|
"data-disabled": disabled || void 0,
|
|
432
513
|
children: [
|
|
433
|
-
startAdornment && /* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
514
|
+
startAdornment && /* @__PURE__ */ jsx11("span", { className: adornment, children: startAdornment }),
|
|
515
|
+
/* @__PURE__ */ jsx11(
|
|
435
516
|
"input",
|
|
436
517
|
{
|
|
437
518
|
ref,
|
|
@@ -441,25 +522,25 @@ var Input = forwardRef9(function Input2({ size, invalid, fullWidth, startAdornme
|
|
|
441
522
|
...rest
|
|
442
523
|
}
|
|
443
524
|
),
|
|
444
|
-
endAdornment && /* @__PURE__ */
|
|
525
|
+
endAdornment && /* @__PURE__ */ jsx11("span", { className: adornment, children: endAdornment })
|
|
445
526
|
]
|
|
446
527
|
}
|
|
447
528
|
);
|
|
448
529
|
});
|
|
449
530
|
|
|
450
531
|
// src/components/Input/TextField.tsx
|
|
451
|
-
import { forwardRef as
|
|
452
|
-
import { jsx as
|
|
453
|
-
var TextField =
|
|
532
|
+
import { forwardRef as forwardRef12, useId } from "react";
|
|
533
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
534
|
+
var TextField = forwardRef12(function TextField2({ label: label4, helperText: helperText2, error, required, fullWidth, id, "aria-describedby": ariaDescribedBy, ...rest }, ref) {
|
|
454
535
|
const generatedId = useId();
|
|
455
536
|
const inputId = id ?? generatedId;
|
|
456
537
|
const helperId = helperText2 ? `${inputId}-helper` : void 0;
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
required && /* @__PURE__ */
|
|
538
|
+
return /* @__PURE__ */ jsxs10("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
539
|
+
label4 && /* @__PURE__ */ jsxs10("label", { htmlFor: inputId, className: label2, children: [
|
|
540
|
+
label4,
|
|
541
|
+
required && /* @__PURE__ */ jsx12("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
461
542
|
] }),
|
|
462
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ jsx12(
|
|
463
544
|
Input,
|
|
464
545
|
{
|
|
465
546
|
ref,
|
|
@@ -471,7 +552,7 @@ var TextField = forwardRef10(function TextField2({ label: label3, helperText: he
|
|
|
471
552
|
...rest
|
|
472
553
|
}
|
|
473
554
|
),
|
|
474
|
-
helperText2 && /* @__PURE__ */
|
|
555
|
+
helperText2 && /* @__PURE__ */ jsx12("p", { id: helperId, className: helperText({ error }), children: helperText2 })
|
|
475
556
|
] });
|
|
476
557
|
});
|
|
477
558
|
|
|
@@ -483,22 +564,22 @@ import { XIcon } from "@bestow-ui/icons";
|
|
|
483
564
|
import { createRuntimeFn as _7a4689 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
484
565
|
var body2 = "_1pdsmv0a";
|
|
485
566
|
var closeButton = "_1pdsmv09";
|
|
486
|
-
var
|
|
567
|
+
var content3 = _7a4689({ defaultClassName: "_1pdsmv01", variantClassNames: { size: { sm: "_1pdsmv02", md: "_1pdsmv03", lg: "_1pdsmv04" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
487
568
|
var description = "_1pdsmv08";
|
|
488
569
|
var footer2 = "_1pdsmv0b";
|
|
489
|
-
var
|
|
570
|
+
var header3 = "_1pdsmv05";
|
|
490
571
|
var headings = "_1pdsmv06";
|
|
491
572
|
var overlay = "_1pdsmv00";
|
|
492
573
|
var title = "_1pdsmv07";
|
|
493
574
|
|
|
494
575
|
// src/components/Modal/Modal.tsx
|
|
495
|
-
import { jsx as
|
|
576
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
496
577
|
function Modal({
|
|
497
578
|
open,
|
|
498
579
|
defaultOpen,
|
|
499
580
|
onOpenChange,
|
|
500
|
-
trigger:
|
|
501
|
-
title:
|
|
581
|
+
trigger: trigger4,
|
|
582
|
+
title: title4,
|
|
502
583
|
description: description4,
|
|
503
584
|
children,
|
|
504
585
|
footer: footer4,
|
|
@@ -508,27 +589,27 @@ function Modal({
|
|
|
508
589
|
className
|
|
509
590
|
}) {
|
|
510
591
|
const portal2 = usePortalProps();
|
|
511
|
-
return /* @__PURE__ */
|
|
512
|
-
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ jsxs11(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
593
|
+
trigger4 && /* @__PURE__ */ jsx13(Dialog.Trigger, { asChild: true, children: trigger4 }),
|
|
594
|
+
/* @__PURE__ */ jsxs11(Dialog.Portal, { children: [
|
|
595
|
+
/* @__PURE__ */ jsx13(Dialog.Overlay, { className: cx(portal2.className, overlay), style: portal2.style }),
|
|
596
|
+
/* @__PURE__ */ jsxs11(
|
|
516
597
|
Dialog.Content,
|
|
517
598
|
{
|
|
518
|
-
className: cx(portal2.className,
|
|
599
|
+
className: cx(portal2.className, content3({ size }), className),
|
|
519
600
|
style: portal2.style,
|
|
520
601
|
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
521
602
|
...description4 ? {} : { "aria-describedby": void 0 },
|
|
522
603
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
description4 && /* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsxs11("div", { className: header3, children: [
|
|
605
|
+
/* @__PURE__ */ jsxs11("div", { className: headings, children: [
|
|
606
|
+
/* @__PURE__ */ jsx13(Dialog.Title, { className: title, children: title4 }),
|
|
607
|
+
description4 && /* @__PURE__ */ jsx13(Dialog.Description, { className: description, children: description4 })
|
|
527
608
|
] }),
|
|
528
|
-
!hideCloseButton && /* @__PURE__ */
|
|
609
|
+
!hideCloseButton && /* @__PURE__ */ jsx13(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx13(XIcon, { size: 16 }) })
|
|
529
610
|
] }),
|
|
530
|
-
children && /* @__PURE__ */
|
|
531
|
-
footer4 && /* @__PURE__ */
|
|
611
|
+
children && /* @__PURE__ */ jsx13("div", { className: body2, children }),
|
|
612
|
+
footer4 && /* @__PURE__ */ jsx13("div", { className: footer2, children: footer4 })
|
|
532
613
|
]
|
|
533
614
|
}
|
|
534
615
|
)
|
|
@@ -537,30 +618,187 @@ function Modal({
|
|
|
537
618
|
}
|
|
538
619
|
var ModalClose = Dialog.Close;
|
|
539
620
|
|
|
621
|
+
// src/components/Pagination/Pagination.tsx
|
|
622
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "@bestow-ui/icons";
|
|
623
|
+
import { forwardRef as forwardRef13, useState } from "react";
|
|
624
|
+
|
|
625
|
+
// src/components/Pagination/getPaginationItems.ts
|
|
626
|
+
var range = (start, end) => end < start ? [] : Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
627
|
+
function getPaginationItems(page, totalPages, siblingCount = 1, boundaryCount = 1) {
|
|
628
|
+
if (totalPages < 1) return [];
|
|
629
|
+
const startPages = range(1, Math.min(boundaryCount, totalPages));
|
|
630
|
+
const endPages = range(Math.max(totalPages - boundaryCount + 1, boundaryCount + 1), totalPages);
|
|
631
|
+
const siblingsStart = Math.max(
|
|
632
|
+
Math.min(page - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
|
|
633
|
+
boundaryCount + 2
|
|
634
|
+
);
|
|
635
|
+
const siblingsEnd = Math.min(
|
|
636
|
+
Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
637
|
+
endPages.length > 0 ? endPages[0] - 2 : totalPages - 1
|
|
638
|
+
);
|
|
639
|
+
const items2 = [...startPages];
|
|
640
|
+
if (siblingsStart > boundaryCount + 2) items2.push("ellipsis-start");
|
|
641
|
+
else if (boundaryCount + 1 < totalPages - boundaryCount) items2.push(boundaryCount + 1);
|
|
642
|
+
items2.push(...range(siblingsStart, siblingsEnd));
|
|
643
|
+
if (siblingsEnd < totalPages - boundaryCount - 1) items2.push("ellipsis-end");
|
|
644
|
+
else if (totalPages - boundaryCount > boundaryCount) items2.push(totalPages - boundaryCount);
|
|
645
|
+
items2.push(...endPages);
|
|
646
|
+
return items2;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// src/components/Pagination/Pagination.css.ts
|
|
650
|
+
import { createRuntimeFn as _7a46810 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
651
|
+
var ellipsis = "_1iraoak4";
|
|
652
|
+
var item3 = _7a46810({ defaultClassName: "_1iraoak1", variantClassNames: { size: { sm: "_1iraoak2", md: "_1iraoak3" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
653
|
+
var list = "_1iraoak0";
|
|
654
|
+
|
|
655
|
+
// src/components/Pagination/Pagination.tsx
|
|
656
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
657
|
+
var defaultItemLabel = (type, page) => type === "previous" ? "\uC774\uC804 \uD398\uC774\uC9C0" : type === "next" ? "\uB2E4\uC74C \uD398\uC774\uC9C0" : `${page} \uD398\uC774\uC9C0`;
|
|
658
|
+
var Pagination = forwardRef13(function Pagination2({
|
|
659
|
+
totalPages,
|
|
660
|
+
page: pageProp,
|
|
661
|
+
defaultPage = 1,
|
|
662
|
+
onPageChange,
|
|
663
|
+
siblingCount = 1,
|
|
664
|
+
boundaryCount = 1,
|
|
665
|
+
size,
|
|
666
|
+
getItemLabel = defaultItemLabel,
|
|
667
|
+
className,
|
|
668
|
+
"aria-label": ariaLabel = "\uD398\uC774\uC9C0 \uD0D0\uC0C9",
|
|
669
|
+
...rest
|
|
670
|
+
}, ref) {
|
|
671
|
+
const [uncontrolledPage, setUncontrolledPage] = useState(defaultPage);
|
|
672
|
+
if (totalPages < 1) return null;
|
|
673
|
+
const page = Math.min(Math.max(pageProp ?? uncontrolledPage, 1), totalPages);
|
|
674
|
+
const goTo = (next) => {
|
|
675
|
+
if (next === page || next < 1 || next > totalPages) return;
|
|
676
|
+
if (pageProp === void 0) setUncontrolledPage(next);
|
|
677
|
+
onPageChange?.(next);
|
|
678
|
+
};
|
|
679
|
+
const itemClass = item3({ size });
|
|
680
|
+
return /* @__PURE__ */ jsx14("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsxs12("ul", { className: list, children: [
|
|
681
|
+
/* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
|
|
682
|
+
"button",
|
|
683
|
+
{
|
|
684
|
+
type: "button",
|
|
685
|
+
className: itemClass,
|
|
686
|
+
"aria-label": getItemLabel("previous", page - 1),
|
|
687
|
+
disabled: page <= 1,
|
|
688
|
+
onClick: () => goTo(page - 1),
|
|
689
|
+
children: /* @__PURE__ */ jsx14(ChevronLeftIcon, { size: 16 })
|
|
690
|
+
}
|
|
691
|
+
) }),
|
|
692
|
+
getPaginationItems(page, totalPages, siblingCount, boundaryCount).map(
|
|
693
|
+
(item5) => typeof item5 === "number" ? /* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
type: "button",
|
|
697
|
+
className: itemClass,
|
|
698
|
+
"aria-label": getItemLabel("page", item5),
|
|
699
|
+
"aria-current": item5 === page ? "page" : void 0,
|
|
700
|
+
onClick: () => goTo(item5),
|
|
701
|
+
children: item5
|
|
702
|
+
}
|
|
703
|
+
) }, item5) : /* @__PURE__ */ jsx14("li", { "aria-hidden": true, className: cx(itemClass, ellipsis), children: "\u2026" }, item5)
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
|
|
706
|
+
"button",
|
|
707
|
+
{
|
|
708
|
+
type: "button",
|
|
709
|
+
className: itemClass,
|
|
710
|
+
"aria-label": getItemLabel("next", page + 1),
|
|
711
|
+
disabled: page >= totalPages,
|
|
712
|
+
onClick: () => goTo(page + 1),
|
|
713
|
+
children: /* @__PURE__ */ jsx14(ChevronRightIcon, { size: 16 })
|
|
714
|
+
}
|
|
715
|
+
) })
|
|
716
|
+
] }) });
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// src/components/Popover/Popover.tsx
|
|
720
|
+
import * as RadixPopover from "@radix-ui/react-popover";
|
|
721
|
+
import { XIcon as XIcon2 } from "@bestow-ui/icons";
|
|
722
|
+
import { useId as useId2 } from "react";
|
|
723
|
+
|
|
724
|
+
// src/components/Popover/Popover.css.ts
|
|
725
|
+
var arrow = "_1j99p8x4";
|
|
726
|
+
var closeButton2 = "_1j99p8x3";
|
|
727
|
+
var content4 = "_1j99p8x0";
|
|
728
|
+
var header4 = "_1j99p8x1";
|
|
729
|
+
var title2 = "_1j99p8x2";
|
|
730
|
+
|
|
731
|
+
// src/components/Popover/Popover.tsx
|
|
732
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
733
|
+
function Popover({
|
|
734
|
+
content: content8,
|
|
735
|
+
children,
|
|
736
|
+
title: title4,
|
|
737
|
+
"aria-label": ariaLabel,
|
|
738
|
+
showClose = false,
|
|
739
|
+
showArrow = false,
|
|
740
|
+
side = "bottom",
|
|
741
|
+
align = "center",
|
|
742
|
+
open,
|
|
743
|
+
defaultOpen,
|
|
744
|
+
onOpenChange,
|
|
745
|
+
modal,
|
|
746
|
+
className,
|
|
747
|
+
style
|
|
748
|
+
}) {
|
|
749
|
+
const portal2 = usePortalProps();
|
|
750
|
+
const titleId = useId2();
|
|
751
|
+
return /* @__PURE__ */ jsxs13(RadixPopover.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
752
|
+
/* @__PURE__ */ jsx15(RadixPopover.Trigger, { asChild: true, children }),
|
|
753
|
+
/* @__PURE__ */ jsx15(RadixPopover.Portal, { children: /* @__PURE__ */ jsxs13(
|
|
754
|
+
RadixPopover.Content,
|
|
755
|
+
{
|
|
756
|
+
side,
|
|
757
|
+
align,
|
|
758
|
+
sideOffset: 6,
|
|
759
|
+
collisionPadding: 8,
|
|
760
|
+
"aria-labelledby": title4 ? titleId : void 0,
|
|
761
|
+
"aria-label": title4 ? void 0 : ariaLabel,
|
|
762
|
+
className: cx(portal2.className, content4, className),
|
|
763
|
+
style: { ...portal2.style, ...style },
|
|
764
|
+
children: [
|
|
765
|
+
(title4 || showClose) && /* @__PURE__ */ jsxs13("div", { className: header4, children: [
|
|
766
|
+
title4 && /* @__PURE__ */ jsx15("h2", { id: titleId, className: title2, children: title4 }),
|
|
767
|
+
showClose && /* @__PURE__ */ jsx15(RadixPopover.Close, { className: closeButton2, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx15(XIcon2, { size: 16 }) })
|
|
768
|
+
] }),
|
|
769
|
+
content8,
|
|
770
|
+
showArrow && /* @__PURE__ */ jsx15(RadixPopover.Arrow, { className: arrow, width: 12, height: 6 })
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
) })
|
|
774
|
+
] });
|
|
775
|
+
}
|
|
776
|
+
var PopoverClose = RadixPopover.Close;
|
|
777
|
+
|
|
540
778
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
541
779
|
import * as RadixRadioGroup from "@radix-ui/react-radio-group";
|
|
542
|
-
import { forwardRef as
|
|
780
|
+
import { forwardRef as forwardRef14, useId as useId3 } from "react";
|
|
543
781
|
|
|
544
782
|
// src/components/RadioGroup/RadioGroup.css.ts
|
|
545
|
-
import { createRuntimeFn as
|
|
783
|
+
import { createRuntimeFn as _7a46811 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
546
784
|
var description2 = "_1w9iwjmd";
|
|
547
785
|
var groupLabel = "_1w9iwjme";
|
|
548
786
|
var indicator = "_1w9iwjma";
|
|
549
|
-
var items =
|
|
787
|
+
var items = _7a46811({ defaultClassName: "_1w9iwjm0", variantClassNames: { orientation: { vertical: "_1w9iwjm1", horizontal: "_1w9iwjm2" } }, defaultVariants: { orientation: "vertical" }, compoundVariants: [] });
|
|
550
788
|
var labelText = "_1w9iwjmc";
|
|
551
|
-
var option =
|
|
552
|
-
var radio =
|
|
789
|
+
var option = _7a46811({ defaultClassName: "_1w9iwjm3", variantClassNames: { size: { sm: "_1w9iwjm4", md: "_1w9iwjm5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
790
|
+
var radio = _7a46811({ defaultClassName: "_1w9iwjm7", variantClassNames: { size: { sm: "_1w9iwjm8", md: "_1w9iwjm9" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
553
791
|
var text = "_1w9iwjmb";
|
|
554
792
|
|
|
555
793
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
556
|
-
import { jsx as
|
|
557
|
-
var RadioGroup =
|
|
794
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
795
|
+
var RadioGroup = forwardRef14(function RadioGroup2(props, ref) {
|
|
558
796
|
const {
|
|
559
797
|
options,
|
|
560
798
|
value: value2,
|
|
561
799
|
defaultValue,
|
|
562
800
|
onValueChange,
|
|
563
|
-
label:
|
|
801
|
+
label: label4,
|
|
564
802
|
helperText: helperText2,
|
|
565
803
|
error,
|
|
566
804
|
orientation = "vertical",
|
|
@@ -573,16 +811,16 @@ var RadioGroup = forwardRef11(function RadioGroup2(props, ref) {
|
|
|
573
811
|
className
|
|
574
812
|
} = props;
|
|
575
813
|
const isControlled = "value" in props;
|
|
576
|
-
const generatedId =
|
|
814
|
+
const generatedId = useId3();
|
|
577
815
|
const baseId = id ?? generatedId;
|
|
578
|
-
const labelId =
|
|
816
|
+
const labelId = label4 ? `${baseId}-label` : void 0;
|
|
579
817
|
const helperId = helperText2 ? `${baseId}-helper` : void 0;
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
required && /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ jsxs14("div", { className: cx(field, className), children: [
|
|
819
|
+
label4 && /* @__PURE__ */ jsxs14("span", { id: labelId, className: cx(label2, groupLabel), children: [
|
|
820
|
+
label4,
|
|
821
|
+
required && /* @__PURE__ */ jsx16("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
584
822
|
] }),
|
|
585
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ jsx16(
|
|
586
824
|
RadixRadioGroup.Root,
|
|
587
825
|
{
|
|
588
826
|
ref,
|
|
@@ -603,8 +841,8 @@ var RadioGroup = forwardRef11(function RadioGroup2(props, ref) {
|
|
|
603
841
|
const itemId = `${baseId}-${option2.value}`;
|
|
604
842
|
const descriptionId = option2.description ? `${itemId}-description` : void 0;
|
|
605
843
|
const itemDisabled = disabled || option2.disabled;
|
|
606
|
-
return /* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ jsxs14("div", { className: option({ size }), "data-disabled": itemDisabled || void 0, children: [
|
|
845
|
+
/* @__PURE__ */ jsx16(
|
|
608
846
|
RadixRadioGroup.Item,
|
|
609
847
|
{
|
|
610
848
|
id: itemId,
|
|
@@ -612,45 +850,45 @@ var RadioGroup = forwardRef11(function RadioGroup2(props, ref) {
|
|
|
612
850
|
disabled: option2.disabled,
|
|
613
851
|
"aria-describedby": descriptionId,
|
|
614
852
|
className: radio({ size }),
|
|
615
|
-
children: /* @__PURE__ */
|
|
853
|
+
children: /* @__PURE__ */ jsx16(RadixRadioGroup.Indicator, { className: indicator })
|
|
616
854
|
}
|
|
617
855
|
),
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
option2.description && /* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ jsxs14("span", { className: text, children: [
|
|
857
|
+
/* @__PURE__ */ jsx16("label", { htmlFor: itemId, className: labelText, children: option2.label }),
|
|
858
|
+
option2.description && /* @__PURE__ */ jsx16("span", { id: descriptionId, className: description2, children: option2.description })
|
|
621
859
|
] })
|
|
622
860
|
] }, option2.value);
|
|
623
861
|
})
|
|
624
862
|
}
|
|
625
863
|
),
|
|
626
|
-
helperText2 && /* @__PURE__ */
|
|
864
|
+
helperText2 && /* @__PURE__ */ jsx16("p", { id: helperId, className: helperText({ error }), children: helperText2 })
|
|
627
865
|
] });
|
|
628
866
|
});
|
|
629
867
|
|
|
630
868
|
// src/components/Select/Select.tsx
|
|
631
869
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
632
|
-
import { forwardRef as
|
|
633
|
-
import { CheckIcon, ChevronDownIcon } from "@bestow-ui/icons";
|
|
870
|
+
import { forwardRef as forwardRef15, useId as useId4 } from "react";
|
|
871
|
+
import { CheckIcon, ChevronDownIcon as ChevronDownIcon2 } from "@bestow-ui/icons";
|
|
634
872
|
|
|
635
873
|
// src/components/Select/Select.css.ts
|
|
636
|
-
var
|
|
637
|
-
var
|
|
638
|
-
var
|
|
874
|
+
var content5 = "_1kx81e83";
|
|
875
|
+
var icon4 = "_1kx81e82";
|
|
876
|
+
var item4 = "_1kx81e85";
|
|
639
877
|
var itemIndicator = "_1kx81e86";
|
|
640
|
-
var
|
|
878
|
+
var trigger2 = "_1kx81e80";
|
|
641
879
|
var value = "_1kx81e81";
|
|
642
880
|
var viewport = "_1kx81e84";
|
|
643
881
|
|
|
644
882
|
// src/components/Select/Select.tsx
|
|
645
|
-
import { jsx as
|
|
646
|
-
var Select =
|
|
883
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
884
|
+
var Select = forwardRef15(function Select2(props, ref) {
|
|
647
885
|
const {
|
|
648
886
|
options,
|
|
649
887
|
value: value2,
|
|
650
888
|
defaultValue,
|
|
651
889
|
onValueChange,
|
|
652
890
|
placeholder,
|
|
653
|
-
label:
|
|
891
|
+
label: label4,
|
|
654
892
|
helperText: helperText2,
|
|
655
893
|
error,
|
|
656
894
|
size,
|
|
@@ -663,16 +901,16 @@ var Select = forwardRef12(function Select2(props, ref) {
|
|
|
663
901
|
className
|
|
664
902
|
} = props;
|
|
665
903
|
const isControlled = "value" in props;
|
|
666
|
-
const generatedId =
|
|
904
|
+
const generatedId = useId4();
|
|
667
905
|
const triggerId = id ?? generatedId;
|
|
668
906
|
const helperId = helperText2 ? `${triggerId}-helper` : void 0;
|
|
669
907
|
const portal2 = usePortalProps();
|
|
670
|
-
return /* @__PURE__ */
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
required && /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ jsxs15("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
909
|
+
label4 && /* @__PURE__ */ jsxs15("label", { htmlFor: triggerId, className: label2, children: [
|
|
910
|
+
label4,
|
|
911
|
+
required && /* @__PURE__ */ jsx17("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
674
912
|
] }),
|
|
675
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ jsxs15(
|
|
676
914
|
RadixSelect.Root,
|
|
677
915
|
{
|
|
678
916
|
value: isControlled ? value2 ?? "" : void 0,
|
|
@@ -682,7 +920,7 @@ var Select = forwardRef12(function Select2(props, ref) {
|
|
|
682
920
|
required,
|
|
683
921
|
name,
|
|
684
922
|
children: [
|
|
685
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ jsxs15(
|
|
686
924
|
RadixSelect.Trigger,
|
|
687
925
|
{
|
|
688
926
|
ref,
|
|
@@ -691,30 +929,30 @@ var Select = forwardRef12(function Select2(props, ref) {
|
|
|
691
929
|
"aria-invalid": error || void 0,
|
|
692
930
|
"aria-describedby": helperId,
|
|
693
931
|
"data-invalid": error || void 0,
|
|
694
|
-
className: cx(
|
|
932
|
+
className: cx(root5({ size, fullWidth }), trigger2, className),
|
|
695
933
|
children: [
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ jsx17("span", { className: value, children: /* @__PURE__ */ jsx17(RadixSelect.Value, { placeholder }) }),
|
|
935
|
+
/* @__PURE__ */ jsx17(RadixSelect.Icon, { className: icon4, children: /* @__PURE__ */ jsx17(ChevronDownIcon2, { size: 16 }) })
|
|
698
936
|
]
|
|
699
937
|
}
|
|
700
938
|
),
|
|
701
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ jsx17(RadixSelect.Portal, { children: /* @__PURE__ */ jsx17(
|
|
702
940
|
RadixSelect.Content,
|
|
703
941
|
{
|
|
704
942
|
position: "popper",
|
|
705
943
|
sideOffset: 4,
|
|
706
944
|
collisionPadding: 8,
|
|
707
|
-
className: cx(portal2.className,
|
|
945
|
+
className: cx(portal2.className, content5),
|
|
708
946
|
style: portal2.style,
|
|
709
|
-
children: /* @__PURE__ */
|
|
947
|
+
children: /* @__PURE__ */ jsx17(RadixSelect.Viewport, { className: viewport, children: options.map((option2) => /* @__PURE__ */ jsxs15(
|
|
710
948
|
RadixSelect.Item,
|
|
711
949
|
{
|
|
712
950
|
value: option2.value,
|
|
713
951
|
disabled: option2.disabled,
|
|
714
|
-
className:
|
|
952
|
+
className: item4,
|
|
715
953
|
children: [
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ jsx17(RadixSelect.ItemText, { children: option2.label }),
|
|
955
|
+
/* @__PURE__ */ jsx17(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx17(CheckIcon, { size: 16 }) })
|
|
718
956
|
]
|
|
719
957
|
},
|
|
720
958
|
option2.value
|
|
@@ -724,29 +962,29 @@ var Select = forwardRef12(function Select2(props, ref) {
|
|
|
724
962
|
]
|
|
725
963
|
}
|
|
726
964
|
),
|
|
727
|
-
helperText2 && /* @__PURE__ */
|
|
965
|
+
helperText2 && /* @__PURE__ */ jsx17("p", { id: helperId, className: helperText({ error }), children: helperText2 })
|
|
728
966
|
] });
|
|
729
967
|
});
|
|
730
968
|
|
|
731
969
|
// src/components/Skeleton/Skeleton.tsx
|
|
732
970
|
import { assignInlineVars as assignInlineVars2 } from "@vanilla-extract/dynamic";
|
|
733
|
-
import { forwardRef as
|
|
971
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
734
972
|
|
|
735
973
|
// src/components/Skeleton/Skeleton.css.ts
|
|
736
|
-
import { createRuntimeFn as
|
|
974
|
+
import { createRuntimeFn as _7a46812 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
737
975
|
var height = "var(--_1s8datd1)";
|
|
738
976
|
var lines = "_1s8datd6";
|
|
739
|
-
var skeleton =
|
|
977
|
+
var skeleton = _7a46812({ defaultClassName: "_1s8datd2", variantClassNames: { variant: { text: "_1s8datd3", rect: "_1s8datd4", circle: "_1s8datd5" } }, defaultVariants: { variant: "text" }, compoundVariants: [] });
|
|
740
978
|
var width = "var(--_1s8datd0)";
|
|
741
979
|
|
|
742
980
|
// src/components/Skeleton/Skeleton.tsx
|
|
743
|
-
import { jsx as
|
|
981
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
744
982
|
var toCss = (value2) => typeof value2 === "number" ? `${value2}px` : value2;
|
|
745
|
-
var Skeleton =
|
|
983
|
+
var Skeleton = forwardRef16(function Skeleton2({ variant = "text", width: width2, height: height2, lines: lines2 = 1, className, style, ...rest }, ref) {
|
|
746
984
|
const w = toCss(width2 ?? (variant === "circle" ? 40 : "100%"));
|
|
747
985
|
const h = toCss(height2 ?? (variant === "circle" ? w : variant === "rect" ? 100 : "1em"));
|
|
748
986
|
if (variant === "text" && lines2 > 1) {
|
|
749
|
-
return /* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ jsx18(
|
|
750
988
|
"span",
|
|
751
989
|
{
|
|
752
990
|
ref,
|
|
@@ -754,7 +992,7 @@ var Skeleton = forwardRef13(function Skeleton2({ variant = "text", width: width2
|
|
|
754
992
|
className: cx(lines, className),
|
|
755
993
|
style: { ...assignInlineVars2({ [width]: w }), ...style },
|
|
756
994
|
...rest,
|
|
757
|
-
children: Array.from({ length: lines2 }, (_, i) => /* @__PURE__ */
|
|
995
|
+
children: Array.from({ length: lines2 }, (_, i) => /* @__PURE__ */ jsx18(
|
|
758
996
|
"span",
|
|
759
997
|
{
|
|
760
998
|
className: skeleton({ variant }),
|
|
@@ -765,7 +1003,7 @@ var Skeleton = forwardRef13(function Skeleton2({ variant = "text", width: width2
|
|
|
765
1003
|
}
|
|
766
1004
|
);
|
|
767
1005
|
}
|
|
768
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ jsx18(
|
|
769
1007
|
"span",
|
|
770
1008
|
{
|
|
771
1009
|
ref,
|
|
@@ -778,16 +1016,16 @@ var Skeleton = forwardRef13(function Skeleton2({ variant = "text", width: width2
|
|
|
778
1016
|
});
|
|
779
1017
|
|
|
780
1018
|
// src/components/Stack/Stack.tsx
|
|
781
|
-
import { forwardRef as
|
|
1019
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
782
1020
|
|
|
783
1021
|
// src/components/Stack/Stack.css.ts
|
|
784
|
-
import { createRuntimeFn as
|
|
785
|
-
var stack =
|
|
1022
|
+
import { createRuntimeFn as _7a46813 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1023
|
+
var stack = _7a46813({ defaultClassName: "_1jz9hj90", variantClassNames: { direction: { row: "_1jz9hj91", column: "_1jz9hj92", "row-reverse": "_1jz9hj93", "column-reverse": "_1jz9hj94" }, gap: { "0": "_1jz9hj95", "1": "_1jz9hj96", "2": "_1jz9hj97", "3": "_1jz9hj98", "4": "_1jz9hj99", "5": "_1jz9hj9a", "6": "_1jz9hj9b", "8": "_1jz9hj9c", "10": "_1jz9hj9d", "12": "_1jz9hj9e", "16": "_1jz9hj9f" }, align: { start: "_1jz9hj9g", center: "_1jz9hj9h", end: "_1jz9hj9i", stretch: "_1jz9hj9j", baseline: "_1jz9hj9k" }, justify: { start: "_1jz9hj9l", center: "_1jz9hj9m", end: "_1jz9hj9n", between: "_1jz9hj9o", around: "_1jz9hj9p", evenly: "_1jz9hj9q" }, wrap: { true: "_1jz9hj9r" } }, defaultVariants: { direction: "column" }, compoundVariants: [] });
|
|
786
1024
|
|
|
787
1025
|
// src/components/Stack/Stack.tsx
|
|
788
|
-
import { jsx as
|
|
789
|
-
var Stack =
|
|
790
|
-
return /* @__PURE__ */
|
|
1026
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1027
|
+
var Stack = forwardRef17(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
|
|
1028
|
+
return /* @__PURE__ */ jsx19(
|
|
791
1029
|
Component,
|
|
792
1030
|
{
|
|
793
1031
|
ref,
|
|
@@ -799,22 +1037,22 @@ var Stack = forwardRef14(function Stack2({ as: Component = "div", direction, gap
|
|
|
799
1037
|
|
|
800
1038
|
// src/components/Switch/Switch.tsx
|
|
801
1039
|
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
802
|
-
import { forwardRef as
|
|
1040
|
+
import { forwardRef as forwardRef18, useId as useId5 } from "react";
|
|
803
1041
|
|
|
804
1042
|
// src/components/Switch/Switch.css.ts
|
|
805
|
-
import { createRuntimeFn as
|
|
806
|
-
var
|
|
807
|
-
var
|
|
808
|
-
var thumb =
|
|
809
|
-
var track =
|
|
1043
|
+
import { createRuntimeFn as _7a46814 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1044
|
+
var label3 = "o33ul29";
|
|
1045
|
+
var root6 = _7a46814({ defaultClassName: "o33ul20", variantClassNames: { size: { sm: "o33ul21", md: "o33ul22" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
1046
|
+
var thumb = _7a46814({ defaultClassName: "o33ul26", variantClassNames: { size: { sm: "o33ul27", md: "o33ul28" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
1047
|
+
var track = _7a46814({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
810
1048
|
|
|
811
1049
|
// src/components/Switch/Switch.tsx
|
|
812
|
-
import { jsx as
|
|
813
|
-
var Switch =
|
|
814
|
-
const generatedId =
|
|
1050
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1051
|
+
var Switch = forwardRef18(function Switch2({ label: label4, size, id, className, disabled, "aria-label": ariaLabel, ...rest }, ref) {
|
|
1052
|
+
const generatedId = useId5();
|
|
815
1053
|
const switchId = id ?? generatedId;
|
|
816
|
-
return /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ jsxs16("span", { className: cx(root6({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
1055
|
+
/* @__PURE__ */ jsx20(
|
|
818
1056
|
RadixSwitch.Root,
|
|
819
1057
|
{
|
|
820
1058
|
ref,
|
|
@@ -823,37 +1061,66 @@ var Switch = forwardRef15(function Switch2({ label: label3, size, id, className,
|
|
|
823
1061
|
"aria-label": ariaLabel,
|
|
824
1062
|
className: track({ size }),
|
|
825
1063
|
...rest,
|
|
826
|
-
children: /* @__PURE__ */
|
|
1064
|
+
children: /* @__PURE__ */ jsx20(RadixSwitch.Thumb, { className: thumb({ size }) })
|
|
827
1065
|
}
|
|
828
1066
|
),
|
|
829
|
-
|
|
1067
|
+
label4 && /* @__PURE__ */ jsx20("label", { htmlFor: switchId, className: label3, children: label4 })
|
|
830
1068
|
] });
|
|
831
1069
|
});
|
|
832
1070
|
|
|
1071
|
+
// src/components/Tabs/Tabs.tsx
|
|
1072
|
+
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
1073
|
+
import { createContext as createContext2, forwardRef as forwardRef19, useContext as useContext2 } from "react";
|
|
1074
|
+
|
|
1075
|
+
// src/components/Tabs/Tabs.css.ts
|
|
1076
|
+
import { createRuntimeFn as _7a46815 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1077
|
+
var content6 = "fvhbtda";
|
|
1078
|
+
var list2 = _7a46815({ defaultClassName: "fvhbtd0", variantClassNames: { variant: { line: "fvhbtd1", soft: "fvhbtd2" } }, defaultVariants: { variant: "line" }, compoundVariants: [] });
|
|
1079
|
+
var trigger3 = _7a46815({ defaultClassName: "fvhbtd3", variantClassNames: { variant: { line: "fvhbtd4", soft: "fvhbtd5" }, size: { sm: "fvhbtd6", md: "fvhbtd7" } }, defaultVariants: { variant: "line", size: "md" }, compoundVariants: [[{ variant: "soft", size: "sm" }, "fvhbtd8"], [{ variant: "soft", size: "md" }, "fvhbtd9"]] });
|
|
1080
|
+
|
|
1081
|
+
// src/components/Tabs/Tabs.tsx
|
|
1082
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1083
|
+
var TabsStyleContext = createContext2({ variant: "line", size: "md" });
|
|
1084
|
+
var Tabs = forwardRef19(function Tabs2({ variant = "line", size = "md", ...props }, ref) {
|
|
1085
|
+
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
1086
|
+
return /* @__PURE__ */ jsx21(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx21(RadixTabs.Root, { ref, ...props, ...controlled }) });
|
|
1087
|
+
});
|
|
1088
|
+
var TabsList = forwardRef19(function TabsList2({ className, ...rest }, ref) {
|
|
1089
|
+
const { variant } = useContext2(TabsStyleContext);
|
|
1090
|
+
return /* @__PURE__ */ jsx21(RadixTabs.List, { ref, className: cx(list2({ variant }), className), ...rest });
|
|
1091
|
+
});
|
|
1092
|
+
var TabsTrigger = forwardRef19(function TabsTrigger2({ className, ...rest }, ref) {
|
|
1093
|
+
const { variant, size } = useContext2(TabsStyleContext);
|
|
1094
|
+
return /* @__PURE__ */ jsx21(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
|
|
1095
|
+
});
|
|
1096
|
+
var TabsContent = forwardRef19(function TabsContent2({ className, ...rest }, ref) {
|
|
1097
|
+
return /* @__PURE__ */ jsx21(RadixTabs.Content, { ref, className: cx(content6, className), ...rest });
|
|
1098
|
+
});
|
|
1099
|
+
|
|
833
1100
|
// src/components/Textarea/Textarea.tsx
|
|
834
1101
|
import {
|
|
835
|
-
forwardRef as
|
|
1102
|
+
forwardRef as forwardRef20,
|
|
836
1103
|
useCallback,
|
|
837
1104
|
useEffect as useEffect2,
|
|
838
|
-
useId as
|
|
1105
|
+
useId as useId6,
|
|
839
1106
|
useLayoutEffect,
|
|
840
1107
|
useRef as useRef2,
|
|
841
|
-
useState
|
|
1108
|
+
useState as useState2
|
|
842
1109
|
} from "react";
|
|
843
1110
|
|
|
844
1111
|
// src/components/Textarea/Textarea.css.ts
|
|
845
|
-
import { createRuntimeFn as
|
|
1112
|
+
import { createRuntimeFn as _7a46816 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
846
1113
|
var count = "_1koawa9";
|
|
847
1114
|
var countOver = "_1koawaa";
|
|
848
1115
|
var defaultWidth = "_1koawa7";
|
|
849
1116
|
var footer3 = "_1koawa8";
|
|
850
|
-
var textarea =
|
|
1117
|
+
var textarea = _7a46816({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
|
|
851
1118
|
|
|
852
1119
|
// src/components/Textarea/Textarea.tsx
|
|
853
|
-
import { jsx as
|
|
1120
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
854
1121
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect2;
|
|
855
|
-
var Textarea =
|
|
856
|
-
label:
|
|
1122
|
+
var Textarea = forwardRef20(function Textarea2({
|
|
1123
|
+
label: label4,
|
|
857
1124
|
helperText: helperText2,
|
|
858
1125
|
error,
|
|
859
1126
|
size,
|
|
@@ -873,11 +1140,11 @@ var Textarea = forwardRef16(function Textarea2({
|
|
|
873
1140
|
"aria-describedby": ariaDescribedBy,
|
|
874
1141
|
...rest
|
|
875
1142
|
}, ref) {
|
|
876
|
-
const generatedId =
|
|
1143
|
+
const generatedId = useId6();
|
|
877
1144
|
const textareaId = id ?? generatedId;
|
|
878
1145
|
const helperId = helperText2 ? `${textareaId}-helper` : void 0;
|
|
879
1146
|
const innerRef = useRef2(null);
|
|
880
|
-
const [uncontrolledLength, setUncontrolledLength] =
|
|
1147
|
+
const [uncontrolledLength, setUncontrolledLength] = useState2(() => String(defaultValue ?? "").length);
|
|
881
1148
|
const length = value2 !== void 0 ? String(value2).length : uncontrolledLength;
|
|
882
1149
|
const fitHeight = useCallback(() => {
|
|
883
1150
|
const el = innerRef.current;
|
|
@@ -892,12 +1159,12 @@ var Textarea = forwardRef16(function Textarea2({
|
|
|
892
1159
|
fitHeight();
|
|
893
1160
|
onChange?.(event);
|
|
894
1161
|
};
|
|
895
|
-
return /* @__PURE__ */
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
required && /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ jsxs17("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
1163
|
+
label4 && /* @__PURE__ */ jsxs17("label", { htmlFor: textareaId, className: label2, children: [
|
|
1164
|
+
label4,
|
|
1165
|
+
required && /* @__PURE__ */ jsx22("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
899
1166
|
] }),
|
|
900
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ jsx22(
|
|
901
1168
|
"textarea",
|
|
902
1169
|
{
|
|
903
1170
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -919,33 +1186,33 @@ var Textarea = forwardRef16(function Textarea2({
|
|
|
919
1186
|
...rest
|
|
920
1187
|
}
|
|
921
1188
|
),
|
|
922
|
-
(helperText2 || showCount) && /* @__PURE__ */
|
|
923
|
-
helperText2 && /* @__PURE__ */
|
|
924
|
-
showCount && /* @__PURE__ */
|
|
1189
|
+
(helperText2 || showCount) && /* @__PURE__ */ jsxs17("div", { className: footer3, children: [
|
|
1190
|
+
helperText2 && /* @__PURE__ */ jsx22("p", { id: helperId, className: helperText({ error }), children: helperText2 }),
|
|
1191
|
+
showCount && /* @__PURE__ */ jsx22("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
|
|
925
1192
|
] })
|
|
926
1193
|
] });
|
|
927
1194
|
});
|
|
928
1195
|
|
|
929
1196
|
// src/components/Toast/Toast.tsx
|
|
930
1197
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
931
|
-
import { createContext as
|
|
932
|
-
import { XIcon as
|
|
1198
|
+
import { createContext as createContext3, useCallback as useCallback2, useContext as useContext3, useMemo as useMemo2, useRef as useRef3, useState as useState3 } from "react";
|
|
1199
|
+
import { XIcon as XIcon3 } from "@bestow-ui/icons";
|
|
933
1200
|
|
|
934
1201
|
// src/components/Toast/Toast.css.ts
|
|
935
|
-
import { createRuntimeFn as
|
|
1202
|
+
import { createRuntimeFn as _7a46817 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
936
1203
|
var action = "_1g11zvx7";
|
|
937
1204
|
var close = "_1g11zvx8";
|
|
938
1205
|
var description3 = "_1g11zvx6";
|
|
939
|
-
var
|
|
940
|
-
var toast =
|
|
1206
|
+
var title3 = "_1g11zvx5";
|
|
1207
|
+
var toast = _7a46817({ defaultClassName: "_1g11zvx1", variantClassNames: { variant: { "default": "_1g11zvx2", success: "_1g11zvx3", danger: "_1g11zvx4" } }, defaultVariants: { variant: "default" }, compoundVariants: [] });
|
|
941
1208
|
var viewport2 = "_1g11zvx0";
|
|
942
1209
|
|
|
943
1210
|
// src/components/Toast/Toast.tsx
|
|
944
|
-
import { jsx as
|
|
1211
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
945
1212
|
var REMOVE_DELAY = 500;
|
|
946
|
-
var ToastContext =
|
|
947
|
-
function ToastProvider({ children, duration = 5e3, label:
|
|
948
|
-
const [toasts, setToasts] =
|
|
1213
|
+
var ToastContext = createContext3(null);
|
|
1214
|
+
function ToastProvider({ children, duration = 5e3, label: label4 = "\uC54C\uB9BC" }) {
|
|
1215
|
+
const [toasts, setToasts] = useState3([]);
|
|
949
1216
|
const nextId = useRef3(0);
|
|
950
1217
|
const portal2 = usePortalProps();
|
|
951
1218
|
const toast2 = useCallback2((options) => {
|
|
@@ -959,9 +1226,9 @@ function ToastProvider({ children, duration = 5e3, label: label3 = "\uC54C\uB9BC
|
|
|
959
1226
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
960
1227
|
}, []);
|
|
961
1228
|
const value2 = useMemo2(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
962
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsx23(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ jsxs18(RadixToast.Provider, { duration, label: label4, swipeDirection: "right", children: [
|
|
963
1230
|
children,
|
|
964
|
-
toasts.map(({ id, open, title:
|
|
1231
|
+
toasts.map(({ id, open, title: title4, description: description4, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ jsxs18(
|
|
965
1232
|
RadixToast.Root,
|
|
966
1233
|
{
|
|
967
1234
|
open,
|
|
@@ -971,19 +1238,19 @@ function ToastProvider({ children, duration = 5e3, label: label3 = "\uC54C\uB9BC
|
|
|
971
1238
|
},
|
|
972
1239
|
className: toast({ variant }),
|
|
973
1240
|
children: [
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
description4 && /* @__PURE__ */
|
|
976
|
-
action2 && /* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ jsx23(RadixToast.Title, { className: title3, children: title4 }),
|
|
1242
|
+
description4 && /* @__PURE__ */ jsx23(RadixToast.Description, { className: description3, children: description4 }),
|
|
1243
|
+
action2 && /* @__PURE__ */ jsx23(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ jsx23(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
|
|
1244
|
+
/* @__PURE__ */ jsx23(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx23(XIcon3, { size: 16 }) })
|
|
978
1245
|
]
|
|
979
1246
|
},
|
|
980
1247
|
id
|
|
981
1248
|
)),
|
|
982
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx23(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
983
1250
|
] }) });
|
|
984
1251
|
}
|
|
985
1252
|
function useToast() {
|
|
986
|
-
const context =
|
|
1253
|
+
const context = useContext3(ToastContext);
|
|
987
1254
|
if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
988
1255
|
return context;
|
|
989
1256
|
}
|
|
@@ -992,13 +1259,13 @@ function useToast() {
|
|
|
992
1259
|
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
993
1260
|
|
|
994
1261
|
// src/components/Tooltip/Tooltip.css.ts
|
|
995
|
-
var
|
|
996
|
-
var
|
|
1262
|
+
var arrow2 = "z7rufs1";
|
|
1263
|
+
var content7 = "z7rufs0";
|
|
997
1264
|
|
|
998
1265
|
// src/components/Tooltip/Tooltip.tsx
|
|
999
|
-
import { jsx as
|
|
1266
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1000
1267
|
function Tooltip({
|
|
1001
|
-
content:
|
|
1268
|
+
content: content8,
|
|
1002
1269
|
children,
|
|
1003
1270
|
side = "top",
|
|
1004
1271
|
align = "center",
|
|
@@ -1010,21 +1277,21 @@ function Tooltip({
|
|
|
1010
1277
|
className
|
|
1011
1278
|
}) {
|
|
1012
1279
|
const portal2 = usePortalProps();
|
|
1013
|
-
if (disabled ||
|
|
1014
|
-
return /* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1280
|
+
if (disabled || content8 == null || content8 === "") return children;
|
|
1281
|
+
return /* @__PURE__ */ jsx24(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs19(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
1282
|
+
/* @__PURE__ */ jsx24(RadixTooltip.Trigger, { asChild: true, children }),
|
|
1283
|
+
/* @__PURE__ */ jsx24(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs19(
|
|
1017
1284
|
RadixTooltip.Content,
|
|
1018
1285
|
{
|
|
1019
1286
|
side,
|
|
1020
1287
|
align,
|
|
1021
1288
|
sideOffset: 6,
|
|
1022
1289
|
collisionPadding: 8,
|
|
1023
|
-
className: cx(portal2.className,
|
|
1290
|
+
className: cx(portal2.className, content7, className),
|
|
1024
1291
|
style: portal2.style,
|
|
1025
1292
|
children: [
|
|
1026
|
-
|
|
1027
|
-
/* @__PURE__ */
|
|
1293
|
+
content8,
|
|
1294
|
+
/* @__PURE__ */ jsx24(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
1028
1295
|
]
|
|
1029
1296
|
}
|
|
1030
1297
|
) })
|
|
@@ -1032,14 +1299,14 @@ function Tooltip({
|
|
|
1032
1299
|
}
|
|
1033
1300
|
|
|
1034
1301
|
// src/components/Typography/Typography.tsx
|
|
1035
|
-
import { forwardRef as
|
|
1302
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
1036
1303
|
|
|
1037
1304
|
// src/components/Typography/Typography.css.ts
|
|
1038
|
-
import { createRuntimeFn as
|
|
1039
|
-
var typography =
|
|
1305
|
+
import { createRuntimeFn as _7a46818 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1306
|
+
var typography = _7a46818({ defaultClassName: "kiolio0", variantClassNames: { variant: { display: "kiolio1", h1: "kiolio2", h2: "kiolio3", h3: "kiolio4", h4: "kiolio5", "body-lg": "kiolio6", body: "kiolio7", "body-sm": "kiolio8", caption: "kiolio9" }, color: { "default": "kiolioa", muted: "kioliob", subtle: "kiolioc", primary: "kioliod", danger: "kiolioe", success: "kioliof", inherit: "kioliog" }, weight: { regular: "kiolioh", medium: "kiolioi", semibold: "kiolioj", bold: "kioliok" }, align: { start: "kioliol", center: "kioliom", end: "kiolion" }, truncate: { true: "kiolioo" } }, defaultVariants: { variant: "body", color: "default" }, compoundVariants: [] });
|
|
1040
1307
|
|
|
1041
1308
|
// src/components/Typography/Typography.tsx
|
|
1042
|
-
import { jsx as
|
|
1309
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1043
1310
|
var defaultElement = {
|
|
1044
1311
|
display: "h1",
|
|
1045
1312
|
h1: "h1",
|
|
@@ -1051,9 +1318,9 @@ var defaultElement = {
|
|
|
1051
1318
|
"body-sm": "p",
|
|
1052
1319
|
caption: "span"
|
|
1053
1320
|
};
|
|
1054
|
-
var Typography =
|
|
1321
|
+
var Typography = forwardRef21(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
|
|
1055
1322
|
const Component = as ?? defaultElement[variant];
|
|
1056
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ jsx25(
|
|
1057
1324
|
Component,
|
|
1058
1325
|
{
|
|
1059
1326
|
ref,
|
|
@@ -1063,6 +1330,8 @@ var Typography = forwardRef17(function Typography2({ variant = "body", as, color
|
|
|
1063
1330
|
);
|
|
1064
1331
|
});
|
|
1065
1332
|
export {
|
|
1333
|
+
Accordion,
|
|
1334
|
+
AccordionItem,
|
|
1066
1335
|
Avatar,
|
|
1067
1336
|
Badge,
|
|
1068
1337
|
Button,
|
|
@@ -1072,15 +1341,29 @@ export {
|
|
|
1072
1341
|
CardHeader,
|
|
1073
1342
|
Checkbox,
|
|
1074
1343
|
Divider,
|
|
1344
|
+
DropdownMenu,
|
|
1345
|
+
DropdownMenuContent,
|
|
1346
|
+
DropdownMenuGroup,
|
|
1347
|
+
DropdownMenuItem,
|
|
1348
|
+
DropdownMenuLabel,
|
|
1349
|
+
DropdownMenuSeparator,
|
|
1350
|
+
DropdownMenuTrigger,
|
|
1075
1351
|
Input,
|
|
1076
1352
|
Modal,
|
|
1077
1353
|
ModalClose,
|
|
1354
|
+
Pagination,
|
|
1355
|
+
Popover,
|
|
1356
|
+
PopoverClose,
|
|
1078
1357
|
RadioGroup,
|
|
1079
1358
|
Select,
|
|
1080
1359
|
Skeleton,
|
|
1081
1360
|
Spinner,
|
|
1082
1361
|
Stack,
|
|
1083
1362
|
Switch,
|
|
1363
|
+
Tabs,
|
|
1364
|
+
TabsContent,
|
|
1365
|
+
TabsList,
|
|
1366
|
+
TabsTrigger,
|
|
1084
1367
|
TextField,
|
|
1085
1368
|
Textarea,
|
|
1086
1369
|
ThemeProvider,
|