@yuva-devlab/ui 1.4.2 → 1.4.4

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
@@ -760,19 +760,14 @@ function Calendar({
760
760
  import_react_day_picker.DayPicker,
761
761
  {
762
762
  showOutsideDays,
763
- className: cn(
764
- "group/calendar p-3 [--cell-size:2rem] in-data-[slot=card-content]:bg-transparent",
765
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
766
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
767
- className
768
- ),
763
+ className: cn("dl-calendar group/calendar", className),
769
764
  captionLayout,
770
765
  formatters: {
771
766
  formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
772
767
  ...formatters
773
768
  },
774
769
  classNames: {
775
- root: cn("w-fit", defaultClassNames.root),
770
+ root: cn("dl-calendar w-fit", defaultClassNames.root),
776
771
  months: cn(
777
772
  "relative flex flex-col gap-4 md:flex-row",
778
773
  defaultClassNames.months
@@ -783,25 +778,25 @@ function Calendar({
783
778
  defaultClassNames.nav
784
779
  ),
785
780
  button_previous: cn(
786
- buttonVariants({ variant: buttonVariant }),
787
- "select-none p-0 aria-disabled:opacity-50 size-(--cell-size)",
781
+ buttonVariants({ variant: buttonVariant, size: "icon" }),
782
+ "select-none p-0 aria-disabled:opacity-50",
788
783
  defaultClassNames.button_previous
789
784
  ),
790
785
  button_next: cn(
791
- buttonVariants({ variant: buttonVariant }),
792
- "select-none p-0 aria-disabled:opacity-50 size-(--cell-size)",
786
+ buttonVariants({ variant: buttonVariant, size: "icon" }),
787
+ "select-none p-0 aria-disabled:opacity-50",
793
788
  defaultClassNames.button_next
794
789
  ),
795
790
  month_caption: cn(
796
- "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
791
+ "flex w-full items-center justify-center",
797
792
  defaultClassNames.month_caption
798
793
  ),
799
794
  dropdowns: cn(
800
- "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
795
+ "flex w-full items-center justify-center gap-1.5 text-sm font-medium",
801
796
  defaultClassNames.dropdowns
802
797
  ),
803
798
  dropdown_root: cn(
804
- "has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
799
+ "relative rounded-md border border-input shadow-xs",
805
800
  defaultClassNames.dropdown_root
806
801
  ),
807
802
  dropdown: cn(
@@ -809,81 +804,68 @@ function Calendar({
809
804
  defaultClassNames.dropdown
810
805
  ),
811
806
  caption_label: cn(
812
- "select-none font-medium",
813
- captionLayout === "label" ? "text-sm" : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
807
+ "select-none font-medium text-sm",
808
+ captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm",
814
809
  defaultClassNames.caption_label
815
810
  ),
816
- table: "w-full border-collapse",
817
- weekdays: cn("flex", defaultClassNames.weekdays),
818
- weekday: cn(
819
- "text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
820
- defaultClassNames.weekday
821
- ),
822
- week: cn("mt-2 flex w-full", defaultClassNames.week),
823
- week_number_header: cn(
824
- "w-(--cell-size) select-none",
825
- defaultClassNames.week_number_header
826
- ),
827
- week_number: cn(
828
- "text-muted-foreground select-none text-[0.8rem]",
829
- defaultClassNames.week_number
830
- ),
831
- day: cn(
832
- "group/day relative aspect-square select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md size-full",
833
- defaultClassNames.day
834
- ),
835
- range_start: cn(
836
- "bg-accent rounded-l-md",
837
- defaultClassNames.range_start
838
- ),
839
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
840
- range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
841
- today: cn(
842
- "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
843
- defaultClassNames.today
844
- ),
845
- outside: cn(
846
- "text-muted-foreground aria-selected:text-muted-foreground",
847
- defaultClassNames.outside
848
- ),
849
- disabled: cn(
850
- "text-muted-foreground opacity-50",
851
- defaultClassNames.disabled
852
- ),
853
- hidden: cn("invisible", defaultClassNames.hidden),
811
+ table: cn("w-full border-collapse", defaultClassNames.month_grid),
812
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
813
+ weekdays: defaultClassNames.weekdays,
814
+ weekday: defaultClassNames.weekday,
815
+ week: defaultClassNames.week,
816
+ day: defaultClassNames.day,
817
+ range_start: defaultClassNames.range_start,
818
+ range_middle: defaultClassNames.range_middle,
819
+ range_end: defaultClassNames.range_end,
820
+ today: defaultClassNames.today,
821
+ outside: defaultClassNames.outside,
822
+ disabled: defaultClassNames.disabled,
823
+ hidden: defaultClassNames.hidden,
854
824
  ...classNames
855
825
  },
856
826
  components: {
857
- Root: ({ className: className2, rootRef, ...props2 }) => {
858
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
859
- "div",
860
- {
861
- "data-slot": "calendar",
862
- ref: rootRef,
863
- className: cn(className2),
864
- ...props2
865
- }
866
- );
867
- },
868
- Chevron: ({ className: className2, orientation, ...props2 }) => {
827
+ Root: ({ className: rootClassName, rootRef, ...rootProps }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
828
+ "div",
829
+ {
830
+ "data-slot": "calendar",
831
+ ref: rootRef,
832
+ className: cn("dl-calendar", rootClassName),
833
+ ...rootProps
834
+ }
835
+ ),
836
+ Chevron: ({
837
+ className: chevronClassName,
838
+ orientation,
839
+ ...chevronProps
840
+ }) => {
869
841
  if (orientation === "left") {
870
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
842
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
843
+ import_lucide_react3.ChevronLeftIcon,
844
+ {
845
+ className: cn("size-4", chevronClassName),
846
+ ...chevronProps
847
+ }
848
+ );
871
849
  }
872
850
  if (orientation === "right") {
873
851
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
874
852
  import_lucide_react3.ChevronRightIcon,
875
853
  {
876
- className: cn("size-4", className2),
877
- ...props2
854
+ className: cn("size-4", chevronClassName),
855
+ ...chevronProps
878
856
  }
879
857
  );
880
858
  }
881
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
859
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
860
+ import_lucide_react3.ChevronDownIcon,
861
+ {
862
+ className: cn("size-4", chevronClassName),
863
+ ...chevronProps
864
+ }
865
+ );
882
866
  },
883
867
  DayButton: CalendarDayButton,
884
- WeekNumber: ({ children, ...props2 }) => {
885
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
886
- },
868
+ WeekNumber: ({ children, ...weekProps }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { ...weekProps, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }),
887
869
  ...components
888
870
  },
889
871
  ...props
@@ -905,16 +887,17 @@ function CalendarDayButton({
905
887
  Button,
906
888
  {
907
889
  ref,
908
- variant: "ghost",
890
+ variant: modifiers["selected"] ? "default" : "ghost",
909
891
  size: "icon",
910
892
  "data-day": day.date.toLocaleDateString(),
893
+ "data-selected": modifiers["selected"] ? "true" : void 0,
911
894
  "data-selected-single": modifiers["selected"] && !modifiers["range_start"] && !modifiers["range_end"] && !modifiers["range_middle"],
912
895
  "data-range-start": modifiers["range_start"],
913
896
  "data-range-end": modifiers["range_end"],
914
897
  "data-range-middle": modifiers["range_middle"],
915
898
  className: cn(
916
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
917
- defaultClassNames.day,
899
+ "dl-calendar__day-button flex aspect-square items-center justify-center font-normal leading-none",
900
+ defaultClassNames.day_button,
918
901
  className
919
902
  ),
920
903
  ...props
@@ -1727,7 +1710,7 @@ function DatePicker({
1727
1710
  mode: "single",
1728
1711
  selected: date,
1729
1712
  onSelect: (selectedDate) => onChange?.(selectedDate ? (0, import_date_fns.format)(selectedDate, "yyyy-MM-dd") : ""),
1730
- initialFocus: true
1713
+ autoFocus: true
1731
1714
  }
1732
1715
  ) })
1733
1716
  ] });
@@ -2819,12 +2802,7 @@ var SelectTrigger = React34.forwardRef(({ className, children, ...props }, ref)
2819
2802
  ...props,
2820
2803
  children: [
2821
2804
  children,
2822
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2823
- import_lucide_react18.ChevronDown,
2824
- {
2825
- style: { opacity: 0.5, width: "0.75rem", height: "0.75rem" }
2826
- }
2827
- ) })
2805
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.ChevronDown, { style: { opacity: 0.5, width: "1rem", height: "1rem" } }) })
2828
2806
  ]
2829
2807
  }
2830
2808
  ));