@codapet/design-system 0.5.2 → 0.5.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.d.mts CHANGED
@@ -112,7 +112,7 @@ declare function Button({ className, variant, size, asChild, ...props }: React$1
112
112
  }): react_jsx_runtime.JSX.Element;
113
113
 
114
114
  declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
115
- buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
115
+ buttonVariant?: React$1.ComponentProps<typeof Button>['variant'];
116
116
  }): react_jsx_runtime.JSX.Element;
117
117
  declare function CalendarDayButton({ className, day, modifiers, ...props }: React$1.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
118
118
 
package/dist/index.mjs CHANGED
@@ -631,13 +631,13 @@ function BreadcrumbEllipsis({
631
631
  }
632
632
 
633
633
  // src/components/ui/calendar.tsx
634
- import * as React10 from "react";
635
634
  import {
636
635
  ChevronDownIcon as ChevronDownIcon2,
637
636
  ChevronLeftIcon,
638
637
  ChevronRightIcon
639
638
  } from "lucide-react";
640
- import { DayPicker, getDefaultClassNames } from "react-day-picker";
639
+ import * as React10 from "react";
640
+ import { DayPicker } from "react-day-picker";
641
641
  import { jsx as jsx11 } from "react/jsx-runtime";
642
642
  function Calendar({
643
643
  className,
@@ -649,13 +649,12 @@ function Calendar({
649
649
  components,
650
650
  ...props
651
651
  }) {
652
- const defaultClassNames = getDefaultClassNames();
653
652
  return /* @__PURE__ */ jsx11(
654
653
  DayPicker,
655
654
  {
656
655
  showOutsideDays,
657
656
  className: cn(
658
- "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
657
+ "bg-background group/calendar p-3 [--cell-size:--spacing(4)] md:[--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
659
658
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
660
659
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
661
660
  className
@@ -666,86 +665,86 @@ function Calendar({
666
665
  ...formatters
667
666
  },
668
667
  classNames: {
669
- root: cn("w-fit", defaultClassNames.root),
668
+ root: cn("w-fit ", classNames?.root),
670
669
  months: cn(
671
670
  "flex gap-4 flex-col md:flex-row relative",
672
- defaultClassNames.months
671
+ classNames?.months
673
672
  ),
674
- month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
673
+ month: cn("flex flex-col w-full gap-4", classNames?.month),
675
674
  nav: cn(
676
675
  "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
677
- defaultClassNames.nav
676
+ classNames?.nav
678
677
  ),
679
678
  button_previous: cn(
680
679
  buttonVariants({ variant: buttonVariant }),
681
680
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
682
- defaultClassNames.button_previous
681
+ classNames?.button_previous
683
682
  ),
684
683
  button_next: cn(
685
684
  buttonVariants({ variant: buttonVariant }),
686
685
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
687
- defaultClassNames.button_next
686
+ classNames?.button_next
688
687
  ),
689
688
  month_caption: cn(
690
689
  "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
691
- defaultClassNames.month_caption
690
+ classNames?.month_caption
692
691
  ),
693
692
  dropdowns: cn(
694
693
  "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
695
- defaultClassNames.dropdowns
694
+ classNames?.dropdowns
696
695
  ),
697
696
  dropdown_root: cn(
698
697
  "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
699
- defaultClassNames.dropdown_root
698
+ classNames?.dropdown_root
700
699
  ),
701
700
  dropdown: cn(
702
701
  "absolute bg-popover inset-0 opacity-0",
703
- defaultClassNames.dropdown
702
+ classNames?.dropdown
704
703
  ),
705
704
  caption_label: cn(
706
705
  "select-none font-medium",
707
706
  captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
708
- defaultClassNames.caption_label
707
+ classNames?.caption_label
708
+ ),
709
+ table: cn("w-full border-collapse", classNames?.table),
710
+ weekdays: cn(
711
+ "flex items-center justify-center w-full gap-2",
712
+ classNames?.weekdays
709
713
  ),
710
- table: "w-full border-collapse",
711
- weekdays: cn("flex", defaultClassNames.weekdays),
712
714
  weekday: cn(
713
- "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
714
- defaultClassNames.weekday
715
+ "text-muted-foreground rounded-full md:flex-1 size-6 mx-1 font-normal text-[0.8rem] select-none ",
716
+ classNames?.weekday
717
+ ),
718
+ week: cn(
719
+ "flex w-full md:mt-2 mt-[2px] items-center justify-center gap-1",
720
+ classNames?.week
715
721
  ),
716
- week: cn("flex w-full mt-2", defaultClassNames.week),
717
722
  week_number_header: cn(
718
- "select-none w-(--cell-size)",
719
- defaultClassNames.week_number_header
723
+ "select-none w-(--cell-size) ",
724
+ "flex items-center justify-center ",
725
+ classNames?.week_number_header
720
726
  ),
721
727
  week_number: cn(
722
728
  "text-[0.8rem] select-none text-muted-foreground",
723
- defaultClassNames.week_number
729
+ classNames?.week_number
724
730
  ),
725
731
  day: cn(
726
- "relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
727
- defaultClassNames.day
728
- ),
729
- range_start: cn(
730
- "rounded-l-md bg-accent",
731
- defaultClassNames.range_start
732
+ "relative flex items-center justify-center md:w-full md:h-full p-0 text-center group/day aspect-square select-none size-7 md:mx-0 mx-1 rounded-full",
733
+ classNames?.day
732
734
  ),
733
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
734
- range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
735
+ range_start: cn(" bg-accent", classNames?.range_start),
736
+ range_middle: cn("rounded-none", classNames?.range_middle),
737
+ range_end: cn(" bg-accent", classNames?.range_end),
735
738
  today: cn(
736
- "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
737
- defaultClassNames.today
739
+ "bg-accent text-accent-foreground rounded-full",
740
+ classNames?.today
738
741
  ),
739
742
  outside: cn(
740
743
  "text-muted-foreground aria-selected:text-muted-foreground",
741
- defaultClassNames.outside
744
+ classNames?.outside
742
745
  ),
743
- disabled: cn(
744
- "text-muted-foreground opacity-50",
745
- defaultClassNames.disabled
746
- ),
747
- hidden: cn("invisible", defaultClassNames.hidden),
748
- ...classNames
746
+ disabled: cn("text-muted-foreground opacity-50", classNames?.disabled),
747
+ hidden: cn("invisible", classNames?.hidden)
749
748
  },
750
749
  components: {
751
750
  Root: ({ className: className2, rootRef, ...props2 }) => {
@@ -790,7 +789,6 @@ function CalendarDayButton({
790
789
  modifiers,
791
790
  ...props
792
791
  }) {
793
- const defaultClassNames = getDefaultClassNames();
794
792
  const ref = React10.useRef(null);
795
793
  React10.useEffect(() => {
796
794
  if (modifiers.focused) ref.current?.focus();
@@ -807,8 +805,7 @@ function CalendarDayButton({
807
805
  "data-range-end": modifiers.range_end,
808
806
  "data-range-middle": modifiers.range_middle,
809
807
  className: cn(
810
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
811
- defaultClassNames.day,
808
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none md:font-normal 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 md:p-0 rounded-full md:text-base text-sm font-medium",
812
809
  className
813
810
  ),
814
811
  ...props
@@ -2274,7 +2271,7 @@ function DateInput({
2274
2271
  onMonthChange: onMonthChange ?? setMonthState,
2275
2272
  showOutsideDays,
2276
2273
  className: cn(
2277
- "w-auto mx-auto h-[350px] overflow-y-auto md:h-auto m-2",
2274
+ "w-auto mx-auto overflow-y-auto h-auto m-2",
2278
2275
  calendarClassName
2279
2276
  ),
2280
2277
  classNames,
@@ -2355,7 +2352,7 @@ function DateInput({
2355
2352
  PopoverContent,
2356
2353
  {
2357
2354
  className: cn(
2358
- "p-0 overflow-y-auto h-[400px] md:h-auto md:w-[350px]",
2355
+ "p-0 w-[var(--radix-popper-anchor-width)] h-auto md:w-[350px]",
2359
2356
  popoverContentClassName
2360
2357
  ),
2361
2358
  ...popoverContentProps,
@@ -2511,10 +2508,7 @@ function DateRangeInput({
2511
2508
  month: effectiveMonth,
2512
2509
  onMonthChange: onMonthChange ?? setMonthState,
2513
2510
  showOutsideDays,
2514
- className: cn(
2515
- "w-auto mx-auto h-fit shrink-0 md:h-auto m-2",
2516
- calendarClassName
2517
- ),
2511
+ className: cn("w-auto shrink-0 h-auto mt-2", calendarClassName),
2518
2512
  classNames,
2519
2513
  components,
2520
2514
  formatters,
@@ -2546,13 +2540,13 @@ function DateRangeInput({
2546
2540
  PopoverContent,
2547
2541
  {
2548
2542
  className: cn(
2549
- "p-0 h-[400px] w-[var(--radix-popper-anchor-width)] md:h-auto md:w-[350px]",
2543
+ "p-0 w-[var(--radix-popper-anchor-width)] h-auto md:w-[350px]",
2550
2544
  popoverContentClassName
2551
2545
  ),
2552
2546
  ...popoverContentProps,
2553
- children: /* @__PURE__ */ jsxs11("div", { className: "border border-blue-500 h-full w-full rounded-md flex flex-col overflow-y-auto", children: [
2547
+ children: /* @__PURE__ */ jsxs11("div", { className: "border border-blue-500 h-full w-full rounded-md flex flex-col overflow-y-auto justify-between", children: [
2554
2548
  /* @__PURE__ */ jsx23(Calendar, { ...resolvedCalendarProps }),
2555
- /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 px-2 py-2 shrink-0", children: [
2549
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 px-2 pb-1 shrink-0", children: [
2556
2550
  /* @__PURE__ */ jsx23(
2557
2551
  Button,
2558
2552
  {