@bestow-ui/react 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -226,19 +226,7 @@ var TextField = (0, import_react5.forwardRef)(function TextField2({ label: label
226
226
 
227
227
  // src/components/Modal/Modal.tsx
228
228
  var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
229
-
230
- // src/icons/index.tsx
231
- var import_jsx_runtime6 = require("react/jsx-runtime");
232
- var base = { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true };
233
- function CloseIcon(props) {
234
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { ...base, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
235
- }
236
- function ChevronDownIcon(props) {
237
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { ...base, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
238
- }
239
- function CheckIcon(props) {
240
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { ...base, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
241
- }
229
+ var import_icons = require("@bestow-ui/icons");
242
230
 
243
231
  // src/components/Modal/Modal.css.ts
244
232
  var import_createRuntimeFn4 = require("@vanilla-extract/recipes/createRuntimeFn");
@@ -253,7 +241,7 @@ var overlay = "_1pdsmv00";
253
241
  var title = "_1pdsmv07";
254
242
 
255
243
  // src/components/Modal/Modal.tsx
256
- var import_jsx_runtime7 = require("react/jsx-runtime");
244
+ var import_jsx_runtime6 = require("react/jsx-runtime");
257
245
  function Modal({
258
246
  open,
259
247
  defaultOpen,
@@ -269,26 +257,26 @@ function Modal({
269
257
  className
270
258
  }) {
271
259
  const portalClassName = usePortalClassName();
272
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
273
- trigger2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog.Trigger, { asChild: true, children: trigger2 }),
274
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Dialog.Portal, { children: [
275
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog.Overlay, { className: cx(portalClassName, overlay) }),
276
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
260
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
261
+ trigger2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Trigger, { asChild: true, children: trigger2 }),
262
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Dialog.Portal, { children: [
263
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Overlay, { className: cx(portalClassName, overlay) }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
277
265
  Dialog.Content,
278
266
  {
279
267
  className: cx(portalClassName, content({ size }), className),
280
268
  onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
281
269
  ...description3 ? {} : { "aria-describedby": void 0 },
282
270
  children: [
283
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: header, children: [
284
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: headings, children: [
285
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog.Title, { className: title, children: title3 }),
286
- description3 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog.Description, { className: description, children: description3 })
271
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: header, children: [
272
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: headings, children: [
273
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Title, { className: title, children: title3 }),
274
+ description3 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Description, { className: description, children: description3 })
287
275
  ] }),
288
- !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CloseIcon, {}) })
276
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons.XIcon, { size: 16 }) })
289
277
  ] }),
290
- children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: body, children }),
291
- footer2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: footer, children: footer2 })
278
+ children && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: body, children }),
279
+ footer2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: footer, children: footer2 })
292
280
  ]
293
281
  }
294
282
  )
@@ -300,6 +288,7 @@ var ModalClose = Dialog.Close;
300
288
  // src/components/Select/Select.tsx
301
289
  var RadixSelect = __toESM(require("@radix-ui/react-select"), 1);
302
290
  var import_react6 = require("react");
291
+ var import_icons2 = require("@bestow-ui/icons");
303
292
 
304
293
  // src/components/Select/Select.css.ts
305
294
  var content2 = "_1kx81e83";
@@ -311,7 +300,7 @@ var value = "_1kx81e81";
311
300
  var viewport = "_1kx81e84";
312
301
 
313
302
  // src/components/Select/Select.tsx
314
- var import_jsx_runtime8 = require("react/jsx-runtime");
303
+ var import_jsx_runtime7 = require("react/jsx-runtime");
315
304
  var Select = (0, import_react6.forwardRef)(function Select2({
316
305
  options,
317
306
  value: value2,
@@ -334,12 +323,12 @@ var Select = (0, import_react6.forwardRef)(function Select2({
334
323
  const triggerId = id ?? generatedId;
335
324
  const helperId = helperText2 ? `${triggerId}-helper` : void 0;
336
325
  const portalClassName = usePortalClassName();
337
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
338
- label2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { htmlFor: triggerId, className: label, children: [
326
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
327
+ label2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: triggerId, className: label, children: [
339
328
  label2,
340
- required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
329
+ required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
341
330
  ] }),
342
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
331
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
343
332
  RadixSelect.Root,
344
333
  {
345
334
  value: value2,
@@ -349,7 +338,7 @@ var Select = (0, import_react6.forwardRef)(function Select2({
349
338
  required,
350
339
  name,
351
340
  children: [
352
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
341
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
353
342
  RadixSelect.Trigger,
354
343
  {
355
344
  ref,
@@ -360,27 +349,27 @@ var Select = (0, import_react6.forwardRef)(function Select2({
360
349
  "data-invalid": error || void 0,
361
350
  className: cx(root3({ size, fullWidth }), trigger, className),
362
351
  children: [
363
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: value, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.Value, { placeholder }) }),
364
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.Icon, { className: icon2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronDownIcon, {}) })
352
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: value, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.Value, { placeholder }) }),
353
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.Icon, { className: icon2, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.ChevronDownIcon, { size: 16 }) })
365
354
  ]
366
355
  }
367
356
  ),
368
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
369
358
  RadixSelect.Content,
370
359
  {
371
360
  position: "popper",
372
361
  sideOffset: 4,
373
362
  collisionPadding: 8,
374
363
  className: cx(portalClassName, content2),
375
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
364
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
376
365
  RadixSelect.Item,
377
366
  {
378
367
  value: option.value,
379
368
  disabled: option.disabled,
380
369
  className: item,
381
370
  children: [
382
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.ItemText, { children: option.label }),
383
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CheckIcon, {}) })
371
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.ItemText, { children: option.label }),
372
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.CheckIcon, { size: 16 }) })
384
373
  ]
385
374
  },
386
375
  option.value
@@ -390,7 +379,7 @@ var Select = (0, import_react6.forwardRef)(function Select2({
390
379
  ]
391
380
  }
392
381
  ),
393
- helperText2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText2 })
382
+ helperText2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText2 })
394
383
  ] });
395
384
  });
396
385
 
@@ -402,9 +391,9 @@ var import_createRuntimeFn5 = require("@vanilla-extract/recipes/createRuntimeFn"
402
391
  var stack = (0, import_createRuntimeFn5.createRuntimeFn)({ 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: [] });
403
392
 
404
393
  // src/components/Stack/Stack.tsx
405
- var import_jsx_runtime9 = require("react/jsx-runtime");
394
+ var import_jsx_runtime8 = require("react/jsx-runtime");
406
395
  var Stack = (0, import_react7.forwardRef)(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
407
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
396
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
408
397
  Component,
409
398
  {
410
399
  ref,
@@ -417,6 +406,7 @@ var Stack = (0, import_react7.forwardRef)(function Stack2({ as: Component = "div
417
406
  // src/components/Toast/Toast.tsx
418
407
  var RadixToast = __toESM(require("@radix-ui/react-toast"), 1);
419
408
  var import_react8 = require("react");
409
+ var import_icons3 = require("@bestow-ui/icons");
420
410
 
421
411
  // src/components/Toast/Toast.css.ts
422
412
  var import_createRuntimeFn6 = require("@vanilla-extract/recipes/createRuntimeFn");
@@ -428,7 +418,7 @@ var toast = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "_1
428
418
  var viewport2 = "_1g11zvx0";
429
419
 
430
420
  // src/components/Toast/Toast.tsx
431
- var import_jsx_runtime10 = require("react/jsx-runtime");
421
+ var import_jsx_runtime9 = require("react/jsx-runtime");
432
422
  var REMOVE_DELAY = 500;
433
423
  var ToastContext = (0, import_react8.createContext)(null);
434
424
  function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
@@ -446,9 +436,9 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
446
436
  setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
447
437
  }, []);
448
438
  const value2 = (0, import_react8.useMemo)(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
449
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
439
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
450
440
  children,
451
- toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
441
+ toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
452
442
  RadixToast.Root,
453
443
  {
454
444
  open,
@@ -458,15 +448,15 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
458
448
  },
459
449
  className: toast({ variant }),
460
450
  children: [
461
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixToast.Title, { className: title2, children: title3 }),
462
- description3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixToast.Description, { className: description2, children: description3 }),
463
- action2 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
464
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon, {}) })
451
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Title, { className: title2, children: title3 }),
452
+ description3 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Description, { className: description2, children: description3 }),
453
+ action2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
454
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons3.XIcon, { size: 16 }) })
465
455
  ]
466
456
  },
467
457
  id
468
458
  )),
469
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixToast.Viewport, { className: cx(portalClassName, viewport2) })
459
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Viewport, { className: cx(portalClassName, viewport2) })
470
460
  ] }) });
471
461
  }
472
462
  function useToast() {
@@ -483,7 +473,7 @@ var arrow = "z7rufs1";
483
473
  var content3 = "z7rufs0";
484
474
 
485
475
  // src/components/Tooltip/Tooltip.tsx
486
- var import_jsx_runtime11 = require("react/jsx-runtime");
476
+ var import_jsx_runtime10 = require("react/jsx-runtime");
487
477
  function Tooltip({
488
478
  content: content4,
489
479
  children,
@@ -498,9 +488,9 @@ function Tooltip({
498
488
  }) {
499
489
  const portalClassName = usePortalClassName();
500
490
  if (disabled || content4 == null || content4 === "") return children;
501
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
502
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
503
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
491
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
492
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
493
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
504
494
  RadixTooltip.Content,
505
495
  {
506
496
  side,
@@ -510,7 +500,7 @@ function Tooltip({
510
500
  className: cx(portalClassName, content3, className),
511
501
  children: [
512
502
  content4,
513
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
503
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
514
504
  ]
515
505
  }
516
506
  ) })
@@ -525,7 +515,7 @@ var import_createRuntimeFn7 = require("@vanilla-extract/recipes/createRuntimeFn"
525
515
  var typography = (0, import_createRuntimeFn7.createRuntimeFn)({ 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: [] });
526
516
 
527
517
  // src/components/Typography/Typography.tsx
528
- var import_jsx_runtime12 = require("react/jsx-runtime");
518
+ var import_jsx_runtime11 = require("react/jsx-runtime");
529
519
  var defaultElement = {
530
520
  display: "h1",
531
521
  h1: "h1",
@@ -539,7 +529,7 @@ var defaultElement = {
539
529
  };
540
530
  var Typography = (0, import_react9.forwardRef)(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
541
531
  const Component = as ?? defaultElement[variant];
542
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
532
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
543
533
  Component,
544
534
  {
545
535
  ref,