@nearform/quantum 1.4.3 → 1.4.5

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.mjs CHANGED
@@ -468,13 +468,38 @@ import { jsx as jsx5 } from "react/jsx-runtime";
468
468
  var calendarVariants = cva4([], {
469
469
  variants: {
470
470
  component: {
471
- months: ["flex", "flex-col", "gap-2"],
472
- month: ["flex", "flex-col", "gap-2"],
473
- caption: ["flex justify-center py-0.5 relative items-center"],
471
+ months: ["relative", "flex", "flex-row", "gap-4"],
472
+ month: ["flex", "w-full", "flex-col", "gap-2"],
473
+ month_caption: ["flex", "h-7", "items-center", "justify-center"],
474
474
  caption_label: ["text-sm", "font-medium"],
475
- nav: ["h-7", "bg-transparent", "dark:text-foreground-muted-dark"],
476
- nav_button: ["h-7", "w-7", "bg-transparent", "p-0"],
477
- head_cell: [
475
+ // v9 renders `nav` as a sibling of the months rather than inside the
476
+ // caption, so it is positioned over the caption row of `months` here.
477
+ nav: [
478
+ "absolute",
479
+ "inset-x-0",
480
+ "top-0",
481
+ "z-10",
482
+ "flex",
483
+ "h-7",
484
+ "items-center",
485
+ "justify-between",
486
+ "bg-transparent",
487
+ "dark:text-foreground-muted-dark"
488
+ ],
489
+ nav_button: [
490
+ "flex",
491
+ "h-7",
492
+ "w-7",
493
+ "items-center",
494
+ "justify-center",
495
+ "rounded-lg",
496
+ "bg-transparent",
497
+ "p-0",
498
+ "outline-hidden",
499
+ "focus-visible:shadow-blue",
500
+ "aria-disabled:opacity-50"
501
+ ],
502
+ weekday: [
478
503
  "text-foreground-muted",
479
504
  "dark:text-foreground-muted-dark",
480
505
  "px-1",
@@ -484,9 +509,8 @@ var calendarVariants = cva4([], {
484
509
  "text-xs",
485
510
  "h-[34px]"
486
511
  ],
487
- cell: [
512
+ day: [
488
513
  [
489
- "overflow-none",
490
514
  "w-9",
491
515
  "p-0",
492
516
  "flex",
@@ -495,41 +519,49 @@ var calendarVariants = cva4([], {
495
519
  "text-center",
496
520
  "gap-1",
497
521
  "text-sm",
498
- "relative"
522
+ "relative",
523
+ "rounded-lg"
499
524
  ],
500
- [
501
- "focus-within:relative",
502
- "focus-within:z-20",
503
- "focus-visible:shadow-blue"
504
- ]
525
+ ["focus-within:relative", "focus-within:z-20"]
505
526
  ],
506
- day: cn([
507
- "aria-selected:bg-accent",
527
+ day_button: [
508
528
  "rounded-lg",
509
- "dark:aria-selected:bg-brandGreen-100",
510
529
  "px-1",
511
530
  "w-full",
512
531
  "py-2",
513
532
  "h-[34px]",
514
533
  "flex",
515
534
  "flex-col",
535
+ "justify-center",
516
536
  "text-sm",
517
537
  "font-bold",
518
- "aria-selected:opacity-100",
519
538
  "items-center",
520
539
  "shrink-0",
521
540
  "focus-visible:shadow-blue",
522
- "outline-hidden"
523
- ]),
524
- day_selected: ["text-foreground-inverse"],
525
- day_outside: [
526
- "day-outside",
527
- "text-muted-foreground",
528
- "opacity-50 aria-selected:bg-accent-alt"
541
+ "outline-hidden",
542
+ "disabled:cursor-not-allowed"
543
+ ],
544
+ selected: [
545
+ "bg-accent",
546
+ "text-foreground-inverse",
547
+ "dark:bg-brandGreen-100",
548
+ "dark:text-foreground-inverse-dark"
549
+ ],
550
+ outside: ["text-foreground-muted", "dark:text-foreground-muted-dark"],
551
+ disabled: [
552
+ "text-foreground-muted",
553
+ "dark:text-foreground-muted-dark",
554
+ "opacity-50"
529
555
  ]
530
556
  }
531
557
  }
532
558
  });
559
+ var rangeEdge = [
560
+ "bg-accent!",
561
+ "text-foreground-inverse!",
562
+ "dark:bg-blue-400!",
563
+ "dark:text-foreground-inverse-dark!"
564
+ ];
533
565
  function Calendar(_a) {
534
566
  var _b = _a, {
535
567
  className,
@@ -545,31 +577,30 @@ function Calendar(_a) {
545
577
  __spreadValues({
546
578
  showOutsideDays,
547
579
  className: cn(
548
- "p-4 rounded-lg bg-background-alt dark:bg-background-alt-dark dark:text-foreground-inverse shadow-[0_4px_6px_0px_rgba(0,0,0,0.08)] flex [&>*]:flex-row",
580
+ "p-4 rounded-lg bg-background-alt dark:bg-background-alt-dark dark:text-foreground-inverse shadow-[0_4px_6px_0px_rgba(0,0,0,0.08)] flex w-fit",
549
581
  className
550
582
  ),
551
583
  classNames: __spreadValues({
552
584
  months: calendarVariants({ component: "months" }),
553
- month: calendarVariants({ component: "months" }),
554
- caption: calendarVariants({ component: "caption" }),
585
+ month: calendarVariants({ component: "month" }),
586
+ month_caption: calendarVariants({ component: "month_caption" }),
555
587
  caption_label: calendarVariants({ component: "caption_label" }),
556
588
  nav: calendarVariants({ component: "nav" }),
557
- nav_button: calendarVariants({ component: "nav_button" }),
558
- nav_button_previous: "absolute left-1",
559
- nav_button_next: "absolute right-0",
560
- table: "w-full border-collapse space-y-0",
561
- head_row: "flex",
562
- head_cell: calendarVariants({ component: "head_cell" }),
563
- row: "flex w-full",
564
- cell: calendarVariants({ component: "cell" }),
589
+ button_previous: calendarVariants({ component: "nav_button" }),
590
+ button_next: calendarVariants({ component: "nav_button" }),
591
+ month_grid: "w-full border-collapse",
592
+ weekdays: "flex",
593
+ weekday: calendarVariants({ component: "weekday" }),
594
+ week: "flex w-full",
565
595
  day: calendarVariants({ component: "day" }),
566
- day_range_end: "day-range-end bg-accent dark:bg-blue-[400] rounded-r-full",
567
- day_range_start: "day-range-start rounded-l-full bg-accent dark:bg-blue-[400] text-foreground-inverse",
568
- day_selected: calendarVariants({ component: "day_selected" }),
569
- day_outside: calendarVariants({ component: "day_outside" }),
570
- day_disabled: "text-muted-foreground opacity-50",
571
- day_range_middle: "day-range-middle aria-selected:bg-accent-hover-dark dark:aria-selected:bg-accent-alt rounded-none bg-grey-400 text-grey-900",
572
- day_hidden: "invisible"
596
+ day_button: calendarVariants({ component: "day_button" }),
597
+ selected: calendarVariants({ component: "selected" }),
598
+ range_start: cn(rangeEdge, "rounded-l-full! rounded-r-none!"),
599
+ range_end: cn(rangeEdge, "rounded-r-full! rounded-l-none!"),
600
+ range_middle: "rounded-none! bg-grey-400! text-grey-900! dark:bg-accent-alt! dark:text-foreground-inverse!",
601
+ outside: calendarVariants({ component: "outside" }),
602
+ disabled: calendarVariants({ component: "disabled" }),
603
+ hidden: "invisible"
573
604
  }, classNames),
574
605
  components: {
575
606
  Chevron: (props2) => {