@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/README.md +96 -136
- package/dist/components/button/button.css +5 -5
- package/dist/components/calendar/calendar.css +238 -0
- package/dist/components/copy-button/copy-button.css +2 -0
- package/dist/components/date-picker/date-picker.css +9 -3
- package/dist/components/input/input.css +1 -1
- package/dist/components/input-otp/input-otp.css +2 -2
- package/dist/components/popover/popover.css +5 -0
- package/dist/components/secret-reveal-card/secret-reveal-card.css +3 -0
- package/dist/components/select/select.css +33 -10
- package/dist/components.css +300 -21
- package/dist/index.cjs +61 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +61 -83
- package/dist/index.js.map +1 -1
- package/dist/styles/components.css +300 -21
- package/package.json +21 -2
package/dist/index.d.cts
CHANGED
|
@@ -399,6 +399,7 @@ type CalendarProps = React$1.ComponentProps<typeof DayPicker> & {
|
|
|
399
399
|
/**
|
|
400
400
|
* Calendar component built on top of react-day-picker, supporting single,
|
|
401
401
|
* multiple, and date-range selection modes.
|
|
402
|
+
* Pure CSS with scoped `.dl-calendar` design tokens.
|
|
402
403
|
*
|
|
403
404
|
* @example
|
|
404
405
|
* ```tsx
|
|
@@ -408,11 +409,14 @@ type CalendarProps = React$1.ComponentProps<typeof DayPicker> & {
|
|
|
408
409
|
* mode="single"
|
|
409
410
|
* selected={date}
|
|
410
411
|
* onSelect={setDate}
|
|
411
|
-
* className="rounded-md border"
|
|
412
412
|
* />
|
|
413
413
|
* ```
|
|
414
414
|
*/
|
|
415
415
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
416
|
+
/**
|
|
417
|
+
* Custom day button for Calendar, properly forwarding DayButton props
|
|
418
|
+
* with theme-compliant border radius and active states.
|
|
419
|
+
*/
|
|
416
420
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React$1.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
|
|
417
421
|
|
|
418
422
|
type CardProps = React$1.HTMLAttributes<HTMLDivElement>;
|
package/dist/index.d.ts
CHANGED
|
@@ -399,6 +399,7 @@ type CalendarProps = React$1.ComponentProps<typeof DayPicker> & {
|
|
|
399
399
|
/**
|
|
400
400
|
* Calendar component built on top of react-day-picker, supporting single,
|
|
401
401
|
* multiple, and date-range selection modes.
|
|
402
|
+
* Pure CSS with scoped `.dl-calendar` design tokens.
|
|
402
403
|
*
|
|
403
404
|
* @example
|
|
404
405
|
* ```tsx
|
|
@@ -408,11 +409,14 @@ type CalendarProps = React$1.ComponentProps<typeof DayPicker> & {
|
|
|
408
409
|
* mode="single"
|
|
409
410
|
* selected={date}
|
|
410
411
|
* onSelect={setDate}
|
|
411
|
-
* className="rounded-md border"
|
|
412
412
|
* />
|
|
413
413
|
* ```
|
|
414
414
|
*/
|
|
415
415
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
416
|
+
/**
|
|
417
|
+
* Custom day button for Calendar, properly forwarding DayButton props
|
|
418
|
+
* with theme-compliant border radius and active states.
|
|
419
|
+
*/
|
|
416
420
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React$1.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
|
|
417
421
|
|
|
418
422
|
type CardProps = React$1.HTMLAttributes<HTMLDivElement>;
|
package/dist/index.js
CHANGED
|
@@ -461,19 +461,14 @@ function Calendar({
|
|
|
461
461
|
DayPicker,
|
|
462
462
|
{
|
|
463
463
|
showOutsideDays,
|
|
464
|
-
className: cn(
|
|
465
|
-
"group/calendar p-3 [--cell-size:2rem] in-data-[slot=card-content]:bg-transparent",
|
|
466
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
467
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
468
|
-
className
|
|
469
|
-
),
|
|
464
|
+
className: cn("dl-calendar group/calendar", className),
|
|
470
465
|
captionLayout,
|
|
471
466
|
formatters: {
|
|
472
467
|
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
473
468
|
...formatters
|
|
474
469
|
},
|
|
475
470
|
classNames: {
|
|
476
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
471
|
+
root: cn("dl-calendar w-fit", defaultClassNames.root),
|
|
477
472
|
months: cn(
|
|
478
473
|
"relative flex flex-col gap-4 md:flex-row",
|
|
479
474
|
defaultClassNames.months
|
|
@@ -484,25 +479,25 @@ function Calendar({
|
|
|
484
479
|
defaultClassNames.nav
|
|
485
480
|
),
|
|
486
481
|
button_previous: cn(
|
|
487
|
-
buttonVariants({ variant: buttonVariant }),
|
|
488
|
-
"select-none p-0 aria-disabled:opacity-50
|
|
482
|
+
buttonVariants({ variant: buttonVariant, size: "icon" }),
|
|
483
|
+
"select-none p-0 aria-disabled:opacity-50",
|
|
489
484
|
defaultClassNames.button_previous
|
|
490
485
|
),
|
|
491
486
|
button_next: cn(
|
|
492
|
-
buttonVariants({ variant: buttonVariant }),
|
|
493
|
-
"select-none p-0 aria-disabled:opacity-50
|
|
487
|
+
buttonVariants({ variant: buttonVariant, size: "icon" }),
|
|
488
|
+
"select-none p-0 aria-disabled:opacity-50",
|
|
494
489
|
defaultClassNames.button_next
|
|
495
490
|
),
|
|
496
491
|
month_caption: cn(
|
|
497
|
-
"flex
|
|
492
|
+
"flex w-full items-center justify-center",
|
|
498
493
|
defaultClassNames.month_caption
|
|
499
494
|
),
|
|
500
495
|
dropdowns: cn(
|
|
501
|
-
"flex
|
|
496
|
+
"flex w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
502
497
|
defaultClassNames.dropdowns
|
|
503
498
|
),
|
|
504
499
|
dropdown_root: cn(
|
|
505
|
-
"
|
|
500
|
+
"relative rounded-md border border-input shadow-xs",
|
|
506
501
|
defaultClassNames.dropdown_root
|
|
507
502
|
),
|
|
508
503
|
dropdown: cn(
|
|
@@ -510,81 +505,68 @@ function Calendar({
|
|
|
510
505
|
defaultClassNames.dropdown
|
|
511
506
|
),
|
|
512
507
|
caption_label: cn(
|
|
513
|
-
"select-none font-medium",
|
|
514
|
-
captionLayout === "label" ? "text-sm" : "
|
|
508
|
+
"select-none font-medium text-sm",
|
|
509
|
+
captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm",
|
|
515
510
|
defaultClassNames.caption_label
|
|
516
511
|
),
|
|
517
|
-
table: "w-full border-collapse",
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
defaultClassNames.week_number
|
|
531
|
-
),
|
|
532
|
-
day: cn(
|
|
533
|
-
"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",
|
|
534
|
-
defaultClassNames.day
|
|
535
|
-
),
|
|
536
|
-
range_start: cn(
|
|
537
|
-
"bg-accent rounded-l-md",
|
|
538
|
-
defaultClassNames.range_start
|
|
539
|
-
),
|
|
540
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
541
|
-
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
|
542
|
-
today: cn(
|
|
543
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
544
|
-
defaultClassNames.today
|
|
545
|
-
),
|
|
546
|
-
outside: cn(
|
|
547
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
548
|
-
defaultClassNames.outside
|
|
549
|
-
),
|
|
550
|
-
disabled: cn(
|
|
551
|
-
"text-muted-foreground opacity-50",
|
|
552
|
-
defaultClassNames.disabled
|
|
553
|
-
),
|
|
554
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
512
|
+
table: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
513
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
514
|
+
weekdays: defaultClassNames.weekdays,
|
|
515
|
+
weekday: defaultClassNames.weekday,
|
|
516
|
+
week: defaultClassNames.week,
|
|
517
|
+
day: defaultClassNames.day,
|
|
518
|
+
range_start: defaultClassNames.range_start,
|
|
519
|
+
range_middle: defaultClassNames.range_middle,
|
|
520
|
+
range_end: defaultClassNames.range_end,
|
|
521
|
+
today: defaultClassNames.today,
|
|
522
|
+
outside: defaultClassNames.outside,
|
|
523
|
+
disabled: defaultClassNames.disabled,
|
|
524
|
+
hidden: defaultClassNames.hidden,
|
|
555
525
|
...classNames
|
|
556
526
|
},
|
|
557
527
|
components: {
|
|
558
|
-
Root: ({ className:
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
528
|
+
Root: ({ className: rootClassName, rootRef, ...rootProps }) => /* @__PURE__ */ jsx9(
|
|
529
|
+
"div",
|
|
530
|
+
{
|
|
531
|
+
"data-slot": "calendar",
|
|
532
|
+
ref: rootRef,
|
|
533
|
+
className: cn("dl-calendar", rootClassName),
|
|
534
|
+
...rootProps
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
Chevron: ({
|
|
538
|
+
className: chevronClassName,
|
|
539
|
+
orientation,
|
|
540
|
+
...chevronProps
|
|
541
|
+
}) => {
|
|
570
542
|
if (orientation === "left") {
|
|
571
|
-
return /* @__PURE__ */ jsx9(
|
|
543
|
+
return /* @__PURE__ */ jsx9(
|
|
544
|
+
ChevronLeftIcon,
|
|
545
|
+
{
|
|
546
|
+
className: cn("size-4", chevronClassName),
|
|
547
|
+
...chevronProps
|
|
548
|
+
}
|
|
549
|
+
);
|
|
572
550
|
}
|
|
573
551
|
if (orientation === "right") {
|
|
574
552
|
return /* @__PURE__ */ jsx9(
|
|
575
553
|
ChevronRightIcon,
|
|
576
554
|
{
|
|
577
|
-
className: cn("size-4",
|
|
578
|
-
...
|
|
555
|
+
className: cn("size-4", chevronClassName),
|
|
556
|
+
...chevronProps
|
|
579
557
|
}
|
|
580
558
|
);
|
|
581
559
|
}
|
|
582
|
-
return /* @__PURE__ */ jsx9(
|
|
560
|
+
return /* @__PURE__ */ jsx9(
|
|
561
|
+
ChevronDownIcon,
|
|
562
|
+
{
|
|
563
|
+
className: cn("size-4", chevronClassName),
|
|
564
|
+
...chevronProps
|
|
565
|
+
}
|
|
566
|
+
);
|
|
583
567
|
},
|
|
584
568
|
DayButton: CalendarDayButton,
|
|
585
|
-
WeekNumber: ({ children, ...
|
|
586
|
-
return /* @__PURE__ */ jsx9("td", { ...props2, children: /* @__PURE__ */ jsx9("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
587
|
-
},
|
|
569
|
+
WeekNumber: ({ children, ...weekProps }) => /* @__PURE__ */ jsx9("td", { ...weekProps, children: /* @__PURE__ */ jsx9("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }),
|
|
588
570
|
...components
|
|
589
571
|
},
|
|
590
572
|
...props
|
|
@@ -606,16 +588,17 @@ function CalendarDayButton({
|
|
|
606
588
|
Button,
|
|
607
589
|
{
|
|
608
590
|
ref,
|
|
609
|
-
variant: "ghost",
|
|
591
|
+
variant: modifiers["selected"] ? "default" : "ghost",
|
|
610
592
|
size: "icon",
|
|
611
593
|
"data-day": day.date.toLocaleDateString(),
|
|
594
|
+
"data-selected": modifiers["selected"] ? "true" : void 0,
|
|
612
595
|
"data-selected-single": modifiers["selected"] && !modifiers["range_start"] && !modifiers["range_end"] && !modifiers["range_middle"],
|
|
613
596
|
"data-range-start": modifiers["range_start"],
|
|
614
597
|
"data-range-end": modifiers["range_end"],
|
|
615
598
|
"data-range-middle": modifiers["range_middle"],
|
|
616
599
|
className: cn(
|
|
617
|
-
"
|
|
618
|
-
defaultClassNames.
|
|
600
|
+
"dl-calendar__day-button flex aspect-square items-center justify-center font-normal leading-none",
|
|
601
|
+
defaultClassNames.day_button,
|
|
619
602
|
className
|
|
620
603
|
),
|
|
621
604
|
...props
|
|
@@ -1428,7 +1411,7 @@ function DatePicker({
|
|
|
1428
1411
|
mode: "single",
|
|
1429
1412
|
selected: date,
|
|
1430
1413
|
onSelect: (selectedDate) => onChange?.(selectedDate ? format(selectedDate, "yyyy-MM-dd") : ""),
|
|
1431
|
-
|
|
1414
|
+
autoFocus: true
|
|
1432
1415
|
}
|
|
1433
1416
|
) })
|
|
1434
1417
|
] });
|
|
@@ -2524,12 +2507,7 @@ var SelectTrigger = React34.forwardRef(({ className, children, ...props }, ref)
|
|
|
2524
2507
|
...props,
|
|
2525
2508
|
children: [
|
|
2526
2509
|
children,
|
|
2527
|
-
/* @__PURE__ */ jsx38(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
2528
|
-
ChevronDown4,
|
|
2529
|
-
{
|
|
2530
|
-
style: { opacity: 0.5, width: "0.75rem", height: "0.75rem" }
|
|
2531
|
-
}
|
|
2532
|
-
) })
|
|
2510
|
+
/* @__PURE__ */ jsx38(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx38(ChevronDown4, { style: { opacity: 0.5, width: "1rem", height: "1rem" } }) })
|
|
2533
2511
|
]
|
|
2534
2512
|
}
|
|
2535
2513
|
));
|