@jbpark/ui-kit 2.2.2 → 2.3.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.
@@ -1,6 +1,7 @@
1
- import { n as renderConditional, t as cn } from "./utils-CssUrKWE.mjs";
2
- import { t as Typography_default } from "./Typography-GMk9208W.mjs";
3
- import { ArrowUp, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronUpIcon, CircleIcon, CircleQuestionMark, CircleX, Info, Loader2, LoaderCircle, OctagonAlert, OctagonX, Search, Square, SquareCheck, X, XIcon } from "lucide-react";
1
+ import { t as __exportAll } from "./chunk-BWyCjowX.mjs";
2
+ import { n as renderConditional, t as cn } from "./utils-1s_37TSX.mjs";
3
+ import { t as Typography_default } from "./Typography-Dznhj8uL.mjs";
4
+ import { ArrowUp, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronUpIcon, Circle, CircleCheck, CircleIcon, CircleQuestionMark, CircleX, Info, Loader2, LoaderCircle, OctagonAlert, OctagonX, Search, Square, SquareCheck, X, XIcon } from "lucide-react";
4
5
  import React, { Children, createElement, useEffect, useId, useMemo, useRef, useState } from "react";
5
6
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
6
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -9,10 +10,9 @@ import { cva } from "class-variance-authority";
9
10
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
10
11
  import * as DialogPrimitive from "@radix-ui/react-dialog";
11
12
  import { Drawer } from "vaul";
12
- import * as LabelPrimitive from "@radix-ui/react-label";
13
+ import { Label, RadioGroup, Select, Separator } from "radix-ui";
13
14
  import * as PopoverPrimitive from "@radix-ui/react-popover";
14
15
  import * as ProgressPrimitive from "@radix-ui/react-progress";
15
- import { RadioGroup, Select } from "radix-ui";
16
16
  import * as SwitchPrimitive from "@radix-ui/react-switch";
17
17
  import { HexColorPicker } from "react-colorful";
18
18
  import { useIntersectionObserver, useThrottle, useWindowScroll } from "@uidotdev/usehooks";
@@ -30,23 +30,6 @@ import "swiper/css/effect-cards";
30
30
  import "swiper/css/navigation";
31
31
  import "swiper/css/scrollbar";
32
32
 
33
- //#region rolldown:runtime
34
- var __defProp = Object.defineProperty;
35
- var __exportAll = (all, symbols) => {
36
- let target = {};
37
- for (var name in all) {
38
- __defProp(target, name, {
39
- get: all[name],
40
- enumerable: true
41
- });
42
- }
43
- if (symbols) {
44
- __defProp(target, Symbol.toStringTag, { value: "Module" });
45
- }
46
- return target;
47
- };
48
-
49
- //#endregion
50
33
  //#region src/core/accordion.tsx
51
34
  var accordion_exports = /* @__PURE__ */ __exportAll({
52
35
  Accordion: () => Accordion$1,
@@ -96,6 +79,10 @@ function AccordionContent$1({ className, children, ...props }) {
96
79
 
97
80
  //#endregion
98
81
  //#region src/core/button.tsx
82
+ var button_exports = /* @__PURE__ */ __exportAll({
83
+ Button: () => Button$2,
84
+ buttonVariants: () => buttonVariants
85
+ });
99
86
  const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
100
87
  variants: {
101
88
  variant: {
@@ -380,6 +367,141 @@ function DrawerDescription$1({ className, ...props }) {
380
367
  });
381
368
  }
382
369
 
370
+ //#endregion
371
+ //#region src/core/field.tsx
372
+ var field_exports = /* @__PURE__ */ __exportAll({
373
+ Field: () => Field$1,
374
+ FieldContent: () => FieldContent,
375
+ FieldDescription: () => FieldDescription,
376
+ FieldError: () => FieldError,
377
+ FieldGroup: () => FieldGroup,
378
+ FieldLabel: () => FieldLabel$1,
379
+ FieldLegend: () => FieldLegend,
380
+ FieldSeparator: () => FieldSeparator,
381
+ FieldSet: () => FieldSet,
382
+ FieldTitle: () => FieldTitle
383
+ });
384
+ const { Label: Label$3 } = label_exports;
385
+ const { Separator: Separator$2 } = separator_exports;
386
+ function FieldSet({ className, ...props }) {
387
+ return /* @__PURE__ */ jsx("fieldset", {
388
+ "data-slot": "field-set",
389
+ className: cn("flex flex-col gap-6", `has-[>[data-slot=checkbox-group]]:gap-3
390
+ has-[>[data-slot=radio-group]]:gap-3`, className),
391
+ ...props
392
+ });
393
+ }
394
+ function FieldLegend({ className, variant = "legend", ...props }) {
395
+ return /* @__PURE__ */ jsx("legend", {
396
+ "data-slot": "field-legend",
397
+ "data-variant": variant,
398
+ className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
399
+ ...props
400
+ });
401
+ }
402
+ function FieldGroup({ className, ...props }) {
403
+ return /* @__PURE__ */ jsx("div", {
404
+ "data-slot": "field-group",
405
+ className: cn(`group/field-group @container/field-group flex w-full flex-col gap-7
406
+ data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`, className),
407
+ ...props
408
+ });
409
+ }
410
+ const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
411
+ variants: { orientation: {
412
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
413
+ horizontal: [
414
+ "flex-row items-center",
415
+ "[&>[data-slot=field-label]]:flex-auto",
416
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
417
+ ],
418
+ responsive: [
419
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
420
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
421
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
422
+ ]
423
+ } },
424
+ defaultVariants: { orientation: "vertical" }
425
+ });
426
+ function Field$1({ className, orientation = "vertical", ...props }) {
427
+ return /* @__PURE__ */ jsx("div", {
428
+ role: "group",
429
+ "data-slot": "field",
430
+ "data-orientation": orientation,
431
+ className: cn(fieldVariants({ orientation }), className),
432
+ ...props
433
+ });
434
+ }
435
+ function FieldContent({ className, ...props }) {
436
+ return /* @__PURE__ */ jsx("div", {
437
+ "data-slot": "field-content",
438
+ className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
439
+ ...props
440
+ });
441
+ }
442
+ function FieldLabel$1({ className, ...props }) {
443
+ return /* @__PURE__ */ jsx(Label$3, {
444
+ "data-slot": "field-label",
445
+ className: cn(`group/field-label peer/field-label flex w-fit gap-2 leading-snug
446
+ group-data-[disabled=true]/field:opacity-50`, `has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col
447
+ has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border
448
+ [&>*]:data-[slot=field]:p-4`, `has-data-[state=checked]:bg-primary/5
449
+ has-data-[state=checked]:border-primary
450
+ dark:has-data-[state=checked]:bg-primary/10`, className),
451
+ ...props
452
+ });
453
+ }
454
+ function FieldTitle({ className, ...props }) {
455
+ return /* @__PURE__ */ jsx("div", {
456
+ "data-slot": "field-label",
457
+ className: cn(`flex w-fit items-center gap-2 text-sm leading-snug font-medium
458
+ group-data-[disabled=true]/field:opacity-50`, className),
459
+ ...props
460
+ });
461
+ }
462
+ function FieldDescription({ className, ...props }) {
463
+ return /* @__PURE__ */ jsx("p", {
464
+ "data-slot": "field-description",
465
+ className: cn(`text-muted-foreground text-sm leading-normal font-normal
466
+ group-has-[[data-orientation=horizontal]]/field:text-balance`, "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className),
467
+ ...props
468
+ });
469
+ }
470
+ function FieldSeparator({ children, className, ...props }) {
471
+ return /* @__PURE__ */ jsxs("div", {
472
+ "data-slot": "field-separator",
473
+ "data-content": !!children,
474
+ className: cn(`relative -my-2 h-5 text-sm
475
+ group-data-[variant=outline]/field-group:-mb-2`, className),
476
+ ...props,
477
+ children: [/* @__PURE__ */ jsx(Separator$2, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
478
+ className: "bg-background text-muted-foreground relative mx-auto block\n w-fit px-2",
479
+ "data-slot": "field-separator-content",
480
+ children
481
+ })]
482
+ });
483
+ }
484
+ function FieldError({ className, children, errors, ...props }) {
485
+ const content = useMemo(() => {
486
+ if (children) return children;
487
+ if (!errors?.length) return null;
488
+ const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
489
+ if (uniqueErrors?.length == 1) return uniqueErrors[0]?.message;
490
+ return /* @__PURE__ */ jsx("ul", {
491
+ className: "ml-4 flex list-disc flex-col gap-1",
492
+ children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index))
493
+ });
494
+ }, [children, errors]);
495
+ if (!content) return null;
496
+ return /* @__PURE__ */ jsx("div", {
497
+ role: "alert",
498
+ "data-slot": "field-error",
499
+ className: cn("text-destructive text-sm font-normal", className),
500
+ ...props,
501
+ children: content
502
+ });
503
+ }
504
+
383
505
  //#endregion
384
506
  //#region src/core/input.tsx
385
507
  var input_exports = /* @__PURE__ */ __exportAll({ Input: () => Input$1 });
@@ -404,7 +526,7 @@ function Input$1({ className, type, ...props }) {
404
526
  //#region src/core/label.tsx
405
527
  var label_exports = /* @__PURE__ */ __exportAll({ Label: () => Label$2 });
406
528
  function Label$2({ className, ...props }) {
407
- return /* @__PURE__ */ jsx(LabelPrimitive.Root, {
529
+ return /* @__PURE__ */ jsx(Label.Root, {
408
530
  "data-slot": "label",
409
531
  className: cn(`flex items-center gap-2 text-sm leading-none font-medium select-none
410
532
  group-data-[disabled=true]:pointer-events-none
@@ -504,10 +626,10 @@ function Progress$1({ className, value, barClassName, barStyle, ...props }) {
504
626
  //#endregion
505
627
  //#region src/core/radio-group.tsx
506
628
  var radio_group_exports = /* @__PURE__ */ __exportAll({
507
- RadioGroup: () => RadioGroup$1,
629
+ RadioGroup: () => RadioGroup$2,
508
630
  RadioGroupItem: () => RadioGroupItem
509
631
  });
510
- function RadioGroup$1({ className, ...props }) {
632
+ function RadioGroup$2({ className, ...props }) {
511
633
  return /* @__PURE__ */ jsx(RadioGroup.Root, {
512
634
  "data-slot": "radio-group",
513
635
  className: cn("grid gap-3", className),
@@ -666,6 +788,21 @@ function SelectScrollDownButton({ className, ...props }) {
666
788
  });
667
789
  }
668
790
 
791
+ //#endregion
792
+ //#region src/core/separator.tsx
793
+ var separator_exports = /* @__PURE__ */ __exportAll({ Separator: () => Separator$1 });
794
+ function Separator$1({ className, orientation = "horizontal", decorative = true, ...props }) {
795
+ return /* @__PURE__ */ jsx(Separator.Root, {
796
+ "data-slot": "separator",
797
+ decorative,
798
+ orientation,
799
+ className: cn(`bg-border shrink-0 data-[orientation=horizontal]:h-px
800
+ data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full
801
+ data-[orientation=vertical]:w-px`, className),
802
+ ...props
803
+ });
804
+ }
805
+
669
806
  //#endregion
670
807
  //#region src/core/skeleton.tsx
671
808
  var skeleton_exports = /* @__PURE__ */ __exportAll({ Skeleton: () => Skeleton$1 });
@@ -737,15 +874,15 @@ const variantClasses = {
737
874
  };
738
875
  const sizesClasses = {
739
876
  small: "h-6 px-3 text-sm",
740
- medium: "h-8 px-4 text-base",
877
+ middle: "h-8 px-4 text-base",
741
878
  large: "h-10 px-5 text-lg"
742
879
  };
743
880
  const iconSizes = {
744
881
  small: "size-6",
745
- medium: "size-8",
882
+ middle: "size-8",
746
883
  large: "size-10"
747
884
  };
748
- const Button$1 = ({ icon, className, variant = "solid", size = "medium", color = "default", block = false, disabled, loading, danger, children, onMouseDown, ...props }) => {
885
+ const Button$1 = ({ icon, className, variant = "solid", size = "middle", color = "default", block = false, disabled, loading, danger, children, onMouseDown, ...props }) => {
749
886
  const iconOnly = icon && !children;
750
887
  const computedColor = danger ? "danger" : color;
751
888
  const colored = computedColor && computedColor !== "default";
@@ -754,7 +891,7 @@ const Button$1 = ({ icon, className, variant = "solid", size = "medium", color =
754
891
  disabled,
755
892
  variant: "default",
756
893
  "data-color": computedColor,
757
- className: cn("inline-flex items-center justify-center gap-x-2", "rounded-lg", "cursor-pointer", "h-auto py-0", "transition-all", variantClasses[variant || "solid"], sizesClasses[size || "medium"], iconOnly && iconSizes[size || "medium"], block && "w-full", colored && (variant === "solid" ? [
894
+ className: cn("inline-flex items-center justify-center gap-x-2", "rounded-lg", "cursor-pointer", "h-auto py-0", "transition-all", variantClasses[variant || "solid"], sizesClasses[size || "middle"], iconOnly && iconSizes[size || "middle"], block && "w-full", colored && (variant === "solid" ? [
758
895
  "bg-(--btn-bg)",
759
896
  "hover:bg-(--btn-bg-hover)",
760
897
  "active:bg-(--btn-bg-active)",
@@ -773,7 +910,7 @@ var Button_default$1 = Button$1;
773
910
 
774
911
  //#endregion
775
912
  //#region src/components/atoms/Checkbox/Group/index.tsx
776
- const Group = ({ direction = "vertical", placement = "left", className, classNames = {}, options: _options = [], defaultValue, value: _value, onChange: _onChange = () => {} }) => {
913
+ const Group = ({ orientation = "vertical", placement = "left", className, classNames = {}, options: _options = [], defaultValue, value: _value, onChange: _onChange = () => {} }) => {
777
914
  const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue || []);
778
915
  const controlled = _value !== void 0;
779
916
  const value = controlled ? _value : uncontrolledValue;
@@ -787,8 +924,8 @@ const Group = ({ direction = "vertical", placement = "left", className, classNam
787
924
  _onChange(nextValue);
788
925
  };
789
926
  return /* @__PURE__ */ jsx("ul", {
790
- className: cn(direction === "vertical" ? "space-y-2" : "flex gap-2", className),
791
- children: options.map((item, i) => {
927
+ className: cn(orientation === "vertical" ? "space-y-2" : "flex gap-2", className),
928
+ children: options.map((item) => {
792
929
  const checked = value.includes(item.value);
793
930
  return /* @__PURE__ */ jsx("li", {
794
931
  className: cn("flex", classNames?.wrapper),
@@ -800,23 +937,25 @@ const Group = ({ direction = "vertical", placement = "left", className, classNam
800
937
  onChange: (checked$1) => onChange(checked$1, item.value),
801
938
  children: item.label
802
939
  })
803
- }, i);
940
+ }, String(item.value));
804
941
  })
805
942
  });
806
943
  };
807
- var Group_default = Group;
944
+ var Group_default$1 = Group;
808
945
 
809
946
  //#endregion
810
947
  //#region src/components/atoms/Checkbox/index.tsx
811
948
  const { Checkbox: CoreCheckbox } = checkbox_exports;
812
949
  const { Label: CoreLabel } = label_exports;
813
- const Checkbox = ({ placement = "left", value = "", children, className, icons, defaultChecked, checked: _checked, onChange: _onChange = () => {}, ...props }) => {
950
+ const Checkbox = ({ placement = "left", value = "", children, className, icons, disabled, defaultChecked, checked: _checked, onChange: _onChange = () => {}, ...props }) => {
814
951
  const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked || false);
815
952
  const reactId = useId();
816
953
  const id = typeof value === "boolean" || !value ? reactId : String(value);
817
954
  const controlled = _checked !== void 0;
818
955
  const checked = controlled ? _checked : uncontrolledChecked;
956
+ const cursorClassName = disabled ? "cursor-not-allowed" : "cursor-pointer";
819
957
  const onChange = (next) => {
958
+ if (disabled) return;
820
959
  if (!controlled) setUncontrolledChecked(next);
821
960
  _onChange(next);
822
961
  };
@@ -831,34 +970,35 @@ const Checkbox = ({ placement = "left", value = "", children, className, icons,
831
970
  }
832
971
  }),
833
972
  /* @__PURE__ */ jsx("span", {
834
- className: "cursor-pointer",
973
+ className: cn(cursorClassName, disabled && "opacity-50"),
835
974
  onClick: () => {
836
975
  document.getElementById(id)?.click();
837
976
  },
838
977
  children: checked ? icons.checked ?? /* @__PURE__ */ jsx(SquareCheck, {}) : icons.unchecked ?? /* @__PURE__ */ jsx(Square, {})
839
978
  }),
840
979
  children && /* @__PURE__ */ jsx("label", {
841
- className: "cursor-pointer",
980
+ className: cn(cursorClassName, disabled && "opacity-50"),
842
981
  htmlFor: id,
843
982
  children
844
983
  })
845
984
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CoreCheckbox, {
846
985
  id,
847
986
  checked,
848
- className: "cursor-pointer",
987
+ disabled,
988
+ className: cn(cursorClassName),
849
989
  onCheckedChange: onChange
850
990
  }), children && /* @__PURE__ */ jsx(CoreLabel, {
851
991
  htmlFor: id,
852
- className: "cursor-pointer text-left",
992
+ className: cn(cursorClassName, "text-left"),
853
993
  children
854
994
  })] });
855
995
  return /* @__PURE__ */ jsx("div", {
856
- className: cn("flex items-center gap-x-2", placement === "right" && "flex-row-reverse", className),
996
+ className: cn("flex items-center gap-x-2", placement === "right" && "flex-row-reverse", cursorClassName, className),
857
997
  ...props,
858
998
  children: renderContent
859
999
  });
860
1000
  };
861
- Checkbox.Group = Group_default;
1001
+ Checkbox.Group = Group_default$1;
862
1002
  var Checkbox_default = Checkbox;
863
1003
 
864
1004
  //#endregion
@@ -1233,23 +1373,104 @@ const Progress = ({ value, className, direction = "horizontal", classNames }) =>
1233
1373
  };
1234
1374
  var Progress_default = Progress;
1235
1375
 
1376
+ //#endregion
1377
+ //#region src/components/atoms/Radio/Group/index.tsx
1378
+ const RadioGroup$1 = ({ orientation = "vertical", placement = "left", className, classNames = {}, options: _options = [], defaultValue, value: _value, onChange: _onChange = () => {} }) => {
1379
+ const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
1380
+ const controlled = _value !== void 0;
1381
+ const value = controlled ? _value : uncontrolledValue;
1382
+ const options = _options.map((item) => typeof item === "object" ? item : {
1383
+ label: `${item}`,
1384
+ value: item
1385
+ });
1386
+ const onChange = (checked, optionValue) => {
1387
+ if (!checked) return;
1388
+ if (!controlled) setUncontrolledValue(optionValue);
1389
+ _onChange(optionValue);
1390
+ };
1391
+ return /* @__PURE__ */ jsx("ul", {
1392
+ className: cn(orientation === "vertical" ? "space-y-2" : "flex gap-2", className),
1393
+ children: options.map((item) => {
1394
+ const checked = value === item.value;
1395
+ return /* @__PURE__ */ jsx("li", {
1396
+ className: cn("flex", classNames?.wrapper),
1397
+ children: /* @__PURE__ */ jsx(Radio_default, {
1398
+ placement,
1399
+ className: cn(classNames?.item),
1400
+ value: item.value,
1401
+ checked,
1402
+ onChange: (checked$1) => onChange(checked$1, item.value),
1403
+ children: item.label
1404
+ })
1405
+ }, String(item.value));
1406
+ })
1407
+ });
1408
+ };
1409
+ var Group_default = RadioGroup$1;
1410
+
1236
1411
  //#endregion
1237
1412
  //#region src/components/atoms/Radio/index.tsx
1238
1413
  const { RadioGroup: Core$3, RadioGroupItem: Item$3 } = radio_group_exports;
1239
- const { Label: Label$1 } = label_exports;
1240
- const Radio = ({ children }) => {
1241
- const id = useId();
1242
- return /* @__PURE__ */ jsx(Core$3, { children: /* @__PURE__ */ jsxs("div", {
1243
- className: "flex items-center gap-3",
1244
- children: [/* @__PURE__ */ jsx(Item$3, {
1245
- value: "default",
1246
- id
1247
- }), /* @__PURE__ */ jsxs(Label$1, {
1414
+ const { Field, FieldLabel } = field_exports;
1415
+ const Radio = ({ placement = "left", value = "", children, className, icons, disabled, defaultChecked, checked: _checked, onChange: _onChange = () => {}, ...props }) => {
1416
+ const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked || false);
1417
+ const reactId = useId();
1418
+ const id = typeof value === "boolean" || !value ? reactId : String(value);
1419
+ const controlled = _checked !== void 0;
1420
+ const checked = controlled ? _checked : uncontrolledChecked;
1421
+ const cursorClassName = disabled ? "cursor-not-allowed" : "cursor-pointer";
1422
+ const onChange = (next) => {
1423
+ if (disabled) return;
1424
+ if (!controlled) setUncontrolledChecked(next);
1425
+ _onChange(next);
1426
+ };
1427
+ const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment, { children: [
1428
+ /* @__PURE__ */ jsx("input", {
1429
+ id,
1430
+ hidden: true,
1431
+ type: "radio",
1432
+ checked,
1433
+ onChange: (e) => {
1434
+ onChange(e.target.checked);
1435
+ }
1436
+ }),
1437
+ /* @__PURE__ */ jsx("span", {
1438
+ className: cn(cursorClassName, disabled && "opacity-50"),
1439
+ onClick: () => {
1440
+ document.getElementById(id)?.click();
1441
+ },
1442
+ children: checked ? icons.checked ?? /* @__PURE__ */ jsx(CircleCheck, {}) : icons.unchecked ?? /* @__PURE__ */ jsx(Circle, {})
1443
+ }),
1444
+ children && /* @__PURE__ */ jsx("label", {
1445
+ className: cn(cursorClassName, disabled && "opacity-50"),
1248
1446
  htmlFor: id,
1249
- children: [" ", children]
1250
- })]
1251
- }) });
1447
+ children
1448
+ })
1449
+ ] }) : /* @__PURE__ */ jsx(Core$3, {
1450
+ value: checked ? id : "",
1451
+ onValueChange: () => onChange(true),
1452
+ children: /* @__PURE__ */ jsxs(Field, {
1453
+ orientation: "horizontal",
1454
+ className: cn("flex", placement === "right" && "flex-row-reverse"),
1455
+ "data-disabled": disabled,
1456
+ children: [/* @__PURE__ */ jsx(Item$3, {
1457
+ value: id,
1458
+ id,
1459
+ checked,
1460
+ disabled
1461
+ }), /* @__PURE__ */ jsx(FieldLabel, {
1462
+ htmlFor: id,
1463
+ children
1464
+ })]
1465
+ })
1466
+ });
1467
+ return /* @__PURE__ */ jsx("div", {
1468
+ className: cn("flex items-center gap-x-2", icons && placement === "right" && "flex-row-reverse", cursorClassName, className),
1469
+ ...props,
1470
+ children: renderContent
1471
+ });
1252
1472
  };
1473
+ Radio.Group = Group_default;
1253
1474
  var Radio_default = Radio;
1254
1475
 
1255
1476
  //#endregion
@@ -1433,7 +1654,7 @@ var Collapse_default = Collapse;
1433
1654
 
1434
1655
  //#endregion
1435
1656
  //#region src/components/molecules/Menu/Item/Label/index.tsx
1436
- const Label = ({ children, className, ...props }) => {
1657
+ const Label$1 = ({ children, className, ...props }) => {
1437
1658
  if (typeof children === "string") return /* @__PURE__ */ jsx(Typography_default.Text, {
1438
1659
  className: cn(className),
1439
1660
  ...props,
@@ -1441,7 +1662,7 @@ const Label = ({ children, className, ...props }) => {
1441
1662
  });
1442
1663
  return children;
1443
1664
  };
1444
- var Label_default = Label;
1665
+ var Label_default = Label$1;
1445
1666
 
1446
1667
  //#endregion
1447
1668
  //#region src/components/molecules/Menu/Item/index.tsx
@@ -5416,10 +5637,11 @@ var Item_default$1 = Item$1;
5416
5637
  //#region src/components/molecules/Marquees/index.tsx
5417
5638
  const Marquees = ({ className, items, speed, pauseOnHover = true, autoFill = true, ...props }) => {
5418
5639
  const [width, setWidth] = useState("100vw");
5640
+ const [padding, setPadding] = useState(0);
5419
5641
  const [pause, setPause] = useState(false);
5420
5642
  const throttledWidth = useThrottle(width, 200);
5421
5643
  const { size } = useResponsiveSize();
5422
- const { size: innerSize, ref: innerRef } = useResponsiveSize();
5644
+ const containerRef = useRef(null);
5423
5645
  const hoverEvents = pauseOnHover ? {
5424
5646
  onMouseEnter: () => {
5425
5647
  setPause(true);
@@ -5428,9 +5650,10 @@ const Marquees = ({ className, items, speed, pauseOnHover = true, autoFill = tru
5428
5650
  setPause(false);
5429
5651
  }
5430
5652
  } : {};
5431
- const maxWidth = typeof throttledWidth === "string" ? "100%" : Math.min(throttledWidth, innerSize.width);
5432
5653
  useEffect(() => {
5433
- if (!size.width) return;
5654
+ if (!size.width || !containerRef.current) return;
5655
+ const computedStyle = getComputedStyle(containerRef.current);
5656
+ setPadding((parseFloat(computedStyle.paddingLeft) || 0) + (parseFloat(computedStyle.paddingRight) || 0));
5434
5657
  setWidth(size.width);
5435
5658
  }, [size]);
5436
5659
  useEffect(() => {
@@ -5443,13 +5666,13 @@ const Marquees = ({ className, items, speed, pauseOnHover = true, autoFill = tru
5443
5666
  };
5444
5667
  }, []);
5445
5668
  return /* @__PURE__ */ jsx("div", {
5446
- ref: innerRef,
5669
+ ref: containerRef,
5447
5670
  className: cn(className),
5448
5671
  ...hoverEvents,
5449
5672
  ...props,
5450
5673
  children: /* @__PURE__ */ jsx("div", {
5451
5674
  className: cn("flex flex-col gap-y-5", "overflow-hidden", "whitespace-nowrap", "bg-inherit"),
5452
- style: { width: maxWidth },
5675
+ style: { width: typeof throttledWidth === "number" ? throttledWidth - padding : throttledWidth },
5453
5676
  children: items?.map(({ children, key: itemKey, ...item }, key) => /* @__PURE__ */ jsx(Item_default$1, {
5454
5677
  width: throttledWidth,
5455
5678
  pause,
@@ -5934,4 +6157,4 @@ Layout.Sider = Sider_default;
5934
6157
  var Layout_default = Layout;
5935
6158
 
5936
6159
  //#endregion
5937
- export { ColorPicker_default as C, Button_default$1 as E, FloatButton_default as S, Checkbox_default as T, Skeleton_default as _, Drawer_default as a, Progress_default as b, Dropdown_default as c, buildSelectionMap as d, findKey as f, Spin_default as g, Switch_default as h, List_default as i, MENU_CLASSNAMES as l, Card_default as m, Swiper_default as n, Space_default as o, Collapse_default as p, Modal_default as r, Marquees_default as s, Layout_default as t, Menu_default as u, Select_default as v, Popover_default as w, Input_default as x, Radio_default as y };
6160
+ export { separator_exports as A, checkbox_exports as B, ColorPicker_default as C, textarea_exports as D, Button_default$1 as E, label_exports as F, accordion_exports as H, input_exports as I, field_exports as L, radio_group_exports as M, progress_exports as N, switch_exports as O, popover_exports as P, drawer_exports as R, FloatButton_default as S, Checkbox_default as T, button_exports as V, Skeleton_default as _, Drawer_default as a, Progress_default as b, Dropdown_default as c, buildSelectionMap as d, findKey as f, Spin_default as g, Switch_default as h, List_default as i, select_exports as j, skeleton_exports as k, MENU_CLASSNAMES as l, Card_default as m, Swiper_default as n, Space_default as o, Collapse_default as p, Modal_default as r, Marquees_default as s, Layout_default as t, Menu_default as u, Select_default as v, Popover_default as w, Input_default as x, Radio_default as y, dialog_exports as z };
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as renderConditional, t as cn } from "./utils-CssUrKWE.mjs";
1
+ import { n as renderConditional, t as cn } from "./utils-1s_37TSX.mjs";
2
2
 
3
3
  export { cn, renderConditional };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbpark/ui-kit",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "Modern React UI component library built with TypeScript, Tailwind CSS, and Radix UI. Featuring atoms, molecules, organisms and layout templates for building beautiful interfaces.",
5
5
  "keywords": [
6
6
  "react",
@@ -65,6 +65,11 @@
65
65
  "import": "./dist/enums.mjs",
66
66
  "default": "./dist/enums.mjs"
67
67
  },
68
+ "./core": {
69
+ "types": "./dist/core.d.mts",
70
+ "import": "./dist/core.mjs",
71
+ "default": "./dist/core.mjs"
72
+ },
68
73
  "./style.css": {
69
74
  "import": "./dist/output.css",
70
75
  "default": "./dist/output.css"
File without changes
File without changes