@yuva-devlab/ui 1.4.3 → 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.
@@ -486,6 +486,246 @@
486
486
  text-decoration: underline;
487
487
  }
488
488
 
489
+ /* ── calendar ── */
490
+ .dl-calendar {
491
+ --cell-size: 2rem;
492
+ display: inline-block;
493
+ width: fit-content;
494
+ max-width: 100%;
495
+ padding: 0.75rem;
496
+ box-sizing: border-box;
497
+ color: var(--foreground);
498
+ }
499
+
500
+ .dl-calendar .rdp-root {
501
+ width: fit-content;
502
+ margin: 0 auto;
503
+ }
504
+
505
+ .dl-calendar .rdp-months {
506
+ position: relative;
507
+ display: flex;
508
+ flex-direction: column;
509
+ gap: 1rem;
510
+ width: calc(var(--cell-size, 2rem) * 7);
511
+ box-sizing: border-box;
512
+ }
513
+
514
+ .dl-calendar .rdp-month {
515
+ display: flex;
516
+ flex-direction: column;
517
+ gap: 0.75rem;
518
+ width: 100%;
519
+ }
520
+
521
+ .dl-calendar .rdp-month_caption {
522
+ position: relative;
523
+ display: flex;
524
+ height: var(--cell-size, 2rem);
525
+ width: 100%;
526
+ align-items: center;
527
+ justify-content: center;
528
+ padding: 0 var(--cell-size, 2rem);
529
+ font-size: 0.875rem;
530
+ font-weight: 600;
531
+ color: var(--foreground);
532
+ box-sizing: border-box;
533
+ }
534
+
535
+ .dl-calendar .rdp-caption_label {
536
+ font-size: 0.875rem;
537
+ font-weight: 600;
538
+ color: var(--foreground);
539
+ line-height: 1;
540
+ }
541
+
542
+ /* Navigation prev / next arrows */
543
+ .dl-calendar .rdp-nav {
544
+ position: absolute;
545
+ top: 0;
546
+ left: 0;
547
+ right: 0;
548
+ display: flex;
549
+ align-items: center;
550
+ justify-content: space-between;
551
+ width: 100%;
552
+ height: var(--cell-size, 2rem);
553
+ pointer-events: none;
554
+ }
555
+
556
+ .dl-calendar .rdp-button_previous,
557
+ .dl-calendar .rdp-button_next {
558
+ pointer-events: auto;
559
+ width: var(--cell-size, 2rem) !important;
560
+ height: var(--cell-size, 2rem) !important;
561
+ min-width: var(--cell-size, 2rem) !important;
562
+ padding: 0 !important;
563
+ display: inline-flex !important;
564
+ align-items: center;
565
+ justify-content: center;
566
+ border-radius: var(--radius-md, 0.375rem) !important;
567
+ border: 1px solid var(--border);
568
+ background: var(--background);
569
+ color: var(--muted-foreground);
570
+ cursor: pointer;
571
+ transition: all 0.15s ease;
572
+ }
573
+
574
+ .dl-calendar .rdp-button_previous:hover,
575
+ .dl-calendar .rdp-button_next:hover {
576
+ background-color: var(--accent);
577
+ color: var(--accent-foreground);
578
+ }
579
+
580
+ .dl-calendar .rdp-button_previous svg,
581
+ .dl-calendar .rdp-button_next svg {
582
+ width: 1rem;
583
+ height: 1rem;
584
+ flex-shrink: 0;
585
+ }
586
+
587
+ /* Grid Table */
588
+ .dl-calendar table.rdp-month_grid,
589
+ .dl-calendar table {
590
+ width: 100%;
591
+ border-collapse: collapse;
592
+ table-layout: fixed;
593
+ margin: 0;
594
+ }
595
+
596
+ /* Weekday header cells */
597
+ .dl-calendar th.rdp-weekday,
598
+ .dl-calendar th {
599
+ width: calc(100% / 7);
600
+ height: var(--cell-size, 2rem);
601
+ text-align: center;
602
+ vertical-align: middle;
603
+ font-size: 0.75rem;
604
+ font-weight: 500;
605
+ color: var(--muted-foreground);
606
+ padding: 0;
607
+ margin: 0;
608
+ box-sizing: border-box;
609
+ }
610
+
611
+ /* Day table cells */
612
+ .dl-calendar td.rdp-day,
613
+ .dl-calendar td {
614
+ width: calc(100% / 7);
615
+ height: var(--cell-size, 2rem);
616
+ padding: 2px !important;
617
+ margin: 0;
618
+ text-align: center;
619
+ vertical-align: middle;
620
+ background: transparent !important;
621
+ background-color: transparent !important;
622
+ border: none !important;
623
+ box-sizing: border-box;
624
+ }
625
+
626
+ /* Day Button inside td */
627
+ .dl-calendar button.rdp-day_button,
628
+ .dl-calendar .dl-calendar__day-button {
629
+ width: 100% !important;
630
+ height: 100% !important;
631
+ min-width: 0 !important;
632
+ min-height: 0 !important;
633
+ margin: 0 auto !important;
634
+ padding: 0 !important;
635
+ display: inline-flex !important;
636
+ align-items: center;
637
+ justify-content: center;
638
+ border-radius: var(--radius-md, 0.375rem) !important;
639
+ border: none !important;
640
+ font-size: 0.875rem;
641
+ font-weight: 400;
642
+ color: var(--foreground);
643
+ background: transparent;
644
+ cursor: pointer;
645
+ box-sizing: border-box;
646
+ transition: all 0.15s ease;
647
+ }
648
+
649
+ .dl-calendar button.rdp-day_button:hover:not(:disabled) {
650
+ background-color: var(--accent) !important;
651
+ color: var(--accent-foreground) !important;
652
+ }
653
+
654
+ /* Selected Date Highlight */
655
+ .dl-calendar td[aria-selected="true"] button.rdp-day_button,
656
+ .dl-calendar td.rdp-selected button.rdp-day_button,
657
+ .dl-calendar button.rdp-day_button[data-selected="true"],
658
+ .dl-calendar button.rdp-day_button[data-selected-single="true"] {
659
+ background-color: var(--primary) !important;
660
+ color: var(--primary-foreground) !important;
661
+ border-radius: var(--radius-md, 0.375rem) !important;
662
+ font-weight: 600;
663
+ box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
664
+ }
665
+
666
+ .dl-calendar td[aria-selected="true"] button.rdp-day_button:hover,
667
+ .dl-calendar td.rdp-selected button.rdp-day_button:hover,
668
+ .dl-calendar button.rdp-day_button[data-selected="true"]:hover,
669
+ .dl-calendar button.rdp-day_button[data-selected-single="true"]:hover {
670
+ background-color: color-mix(in oklch, var(--primary) 88%, black) !important;
671
+ color: var(--primary-foreground) !important;
672
+ }
673
+
674
+ /* Today indicator (when not selected) */
675
+ .dl-calendar
676
+ td.rdp-today:not([aria-selected="true"]):not(.rdp-selected)
677
+ button.rdp-day_button {
678
+ background-color: color-mix(
679
+ in oklch,
680
+ var(--secondary) 60%,
681
+ transparent
682
+ ) !important;
683
+ color: var(--foreground) !important;
684
+ font-weight: 600;
685
+ border: 1px solid var(--border) !important;
686
+ }
687
+
688
+ /* Range selection styles */
689
+ .dl-calendar td.rdp-range_start {
690
+ background-color: var(--accent) !important;
691
+ border-top-left-radius: var(--radius-md, 0.375rem) !important;
692
+ border-bottom-left-radius: var(--radius-md, 0.375rem) !important;
693
+ }
694
+
695
+ .dl-calendar td.rdp-range_middle {
696
+ background-color: var(--accent) !important;
697
+ border-radius: 0 !important;
698
+ }
699
+
700
+ .dl-calendar td.rdp-range_middle button.rdp-day_button {
701
+ background: transparent !important;
702
+ color: var(--accent-foreground) !important;
703
+ border-radius: 0 !important;
704
+ }
705
+
706
+ .dl-calendar td.rdp-range_end {
707
+ background-color: var(--accent) !important;
708
+ border-top-right-radius: var(--radius-md, 0.375rem) !important;
709
+ border-bottom-right-radius: var(--radius-md, 0.375rem) !important;
710
+ }
711
+
712
+ .dl-calendar td.rdp-outside button.rdp-day_button {
713
+ color: var(--muted-foreground) !important;
714
+ opacity: 0.35;
715
+ }
716
+
717
+ .dl-calendar button.rdp-day_button:disabled {
718
+ color: var(--muted-foreground) !important;
719
+ opacity: 0.25;
720
+ cursor: not-allowed;
721
+ pointer-events: none;
722
+ }
723
+
724
+ .dl-calendar td.rdp-hidden {
725
+ visibility: hidden;
726
+ pointer-events: none;
727
+ }
728
+
489
729
  /* ── card ── */
490
730
  .dl-card {
491
731
  border-radius: var(--radius-lg, 0.5rem);
@@ -820,6 +1060,8 @@
820
1060
  cursor: pointer;
821
1061
  transition: all 0.15s ease;
822
1062
  user-select: none;
1063
+ white-space: nowrap;
1064
+ flex-shrink: 0;
823
1065
  }
824
1066
 
825
1067
  .dl-copy-button:hover {
@@ -865,9 +1107,15 @@
865
1107
  flex-shrink: 0;
866
1108
  }
867
1109
 
868
- .dl-date-picker-content {
869
- width: auto;
870
- padding: 0;
1110
+ .dl-date-picker-content,
1111
+ .dl-popover.dl-date-picker-content {
1112
+ width: fit-content !important;
1113
+ max-width: fit-content !important;
1114
+ padding: 0 !important;
1115
+ box-shadow: 0 4px 20px rgb(0 0 0 / 0.15);
1116
+ border-radius: var(--radius-lg, 0.5rem);
1117
+ border: 1px solid var(--border);
1118
+ background-color: var(--popover);
871
1119
  }
872
1120
 
873
1121
  /* ── dialog ── */
@@ -1755,6 +2003,11 @@
1755
2003
  animation: dl-fade-out 150ms ease;
1756
2004
  }
1757
2005
 
2006
+ .dl-popover.dl-date-picker-content {
2007
+ width: auto;
2008
+ padding: 0;
2009
+ }
2010
+
1758
2011
  /* ── progress ── */
1759
2012
  .dl-progress {
1760
2013
  position: relative;
@@ -2073,6 +2326,7 @@
2073
2326
  border: 1px solid var(--border);
2074
2327
  border-radius: calc(var(--radius, 0.5rem) - 2px);
2075
2328
  padding: 0.5rem 0.75rem;
2329
+ flex-wrap: nowrap;
2076
2330
  }
2077
2331
 
2078
2332
  .dl-secret-reveal__code {
@@ -2081,6 +2335,8 @@
2081
2335
  color: var(--primary);
2082
2336
  word-break: break-all;
2083
2337
  user-select: all;
2338
+ min-width: 0;
2339
+ flex: 1;
2084
2340
  }
2085
2341
 
2086
2342
  /* ── select ── */
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
  ] });