@nearform/quantum 1.4.4 → 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.js CHANGED
@@ -860,13 +860,38 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
860
860
  var calendarVariants = (0, import_class_variance_authority4.cva)([], {
861
861
  variants: {
862
862
  component: {
863
- months: ["flex", "flex-col", "gap-2"],
864
- month: ["flex", "flex-col", "gap-2"],
865
- caption: ["flex justify-center py-0.5 relative items-center"],
863
+ months: ["relative", "flex", "flex-row", "gap-4"],
864
+ month: ["flex", "w-full", "flex-col", "gap-2"],
865
+ month_caption: ["flex", "h-7", "items-center", "justify-center"],
866
866
  caption_label: ["text-sm", "font-medium"],
867
- nav: ["h-7", "bg-transparent", "dark:text-foreground-muted-dark"],
868
- nav_button: ["h-7", "w-7", "bg-transparent", "p-0"],
869
- head_cell: [
867
+ // v9 renders `nav` as a sibling of the months rather than inside the
868
+ // caption, so it is positioned over the caption row of `months` here.
869
+ nav: [
870
+ "absolute",
871
+ "inset-x-0",
872
+ "top-0",
873
+ "z-10",
874
+ "flex",
875
+ "h-7",
876
+ "items-center",
877
+ "justify-between",
878
+ "bg-transparent",
879
+ "dark:text-foreground-muted-dark"
880
+ ],
881
+ nav_button: [
882
+ "flex",
883
+ "h-7",
884
+ "w-7",
885
+ "items-center",
886
+ "justify-center",
887
+ "rounded-lg",
888
+ "bg-transparent",
889
+ "p-0",
890
+ "outline-hidden",
891
+ "focus-visible:shadow-blue",
892
+ "aria-disabled:opacity-50"
893
+ ],
894
+ weekday: [
870
895
  "text-foreground-muted",
871
896
  "dark:text-foreground-muted-dark",
872
897
  "px-1",
@@ -876,9 +901,8 @@ var calendarVariants = (0, import_class_variance_authority4.cva)([], {
876
901
  "text-xs",
877
902
  "h-[34px]"
878
903
  ],
879
- cell: [
904
+ day: [
880
905
  [
881
- "overflow-none",
882
906
  "w-9",
883
907
  "p-0",
884
908
  "flex",
@@ -887,41 +911,49 @@ var calendarVariants = (0, import_class_variance_authority4.cva)([], {
887
911
  "text-center",
888
912
  "gap-1",
889
913
  "text-sm",
890
- "relative"
914
+ "relative",
915
+ "rounded-lg"
891
916
  ],
892
- [
893
- "focus-within:relative",
894
- "focus-within:z-20",
895
- "focus-visible:shadow-blue"
896
- ]
917
+ ["focus-within:relative", "focus-within:z-20"]
897
918
  ],
898
- day: cn([
899
- "aria-selected:bg-accent",
919
+ day_button: [
900
920
  "rounded-lg",
901
- "dark:aria-selected:bg-brandGreen-100",
902
921
  "px-1",
903
922
  "w-full",
904
923
  "py-2",
905
924
  "h-[34px]",
906
925
  "flex",
907
926
  "flex-col",
927
+ "justify-center",
908
928
  "text-sm",
909
929
  "font-bold",
910
- "aria-selected:opacity-100",
911
930
  "items-center",
912
931
  "shrink-0",
913
932
  "focus-visible:shadow-blue",
914
- "outline-hidden"
915
- ]),
916
- day_selected: ["text-foreground-inverse"],
917
- day_outside: [
918
- "day-outside",
919
- "text-muted-foreground",
920
- "opacity-50 aria-selected:bg-accent-alt"
933
+ "outline-hidden",
934
+ "disabled:cursor-not-allowed"
935
+ ],
936
+ selected: [
937
+ "bg-accent",
938
+ "text-foreground-inverse",
939
+ "dark:bg-brandGreen-100",
940
+ "dark:text-foreground-inverse-dark"
941
+ ],
942
+ outside: ["text-foreground-muted", "dark:text-foreground-muted-dark"],
943
+ disabled: [
944
+ "text-foreground-muted",
945
+ "dark:text-foreground-muted-dark",
946
+ "opacity-50"
921
947
  ]
922
948
  }
923
949
  }
924
950
  });
951
+ var rangeEdge = [
952
+ "bg-accent!",
953
+ "text-foreground-inverse!",
954
+ "dark:bg-blue-400!",
955
+ "dark:text-foreground-inverse-dark!"
956
+ ];
925
957
  function Calendar(_a) {
926
958
  var _b = _a, {
927
959
  className,
@@ -937,31 +969,30 @@ function Calendar(_a) {
937
969
  __spreadValues({
938
970
  showOutsideDays,
939
971
  className: cn(
940
- "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",
972
+ "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",
941
973
  className
942
974
  ),
943
975
  classNames: __spreadValues({
944
976
  months: calendarVariants({ component: "months" }),
945
- month: calendarVariants({ component: "months" }),
946
- caption: calendarVariants({ component: "caption" }),
977
+ month: calendarVariants({ component: "month" }),
978
+ month_caption: calendarVariants({ component: "month_caption" }),
947
979
  caption_label: calendarVariants({ component: "caption_label" }),
948
980
  nav: calendarVariants({ component: "nav" }),
949
- nav_button: calendarVariants({ component: "nav_button" }),
950
- nav_button_previous: "absolute left-1",
951
- nav_button_next: "absolute right-0",
952
- table: "w-full border-collapse space-y-0",
953
- head_row: "flex",
954
- head_cell: calendarVariants({ component: "head_cell" }),
955
- row: "flex w-full",
956
- cell: calendarVariants({ component: "cell" }),
981
+ button_previous: calendarVariants({ component: "nav_button" }),
982
+ button_next: calendarVariants({ component: "nav_button" }),
983
+ month_grid: "w-full border-collapse",
984
+ weekdays: "flex",
985
+ weekday: calendarVariants({ component: "weekday" }),
986
+ week: "flex w-full",
957
987
  day: calendarVariants({ component: "day" }),
958
- day_range_end: "day-range-end bg-accent dark:bg-blue-[400] rounded-r-full",
959
- day_range_start: "day-range-start rounded-l-full bg-accent dark:bg-blue-[400] text-foreground-inverse",
960
- day_selected: calendarVariants({ component: "day_selected" }),
961
- day_outside: calendarVariants({ component: "day_outside" }),
962
- day_disabled: "text-muted-foreground opacity-50",
963
- 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",
964
- day_hidden: "invisible"
988
+ day_button: calendarVariants({ component: "day_button" }),
989
+ selected: calendarVariants({ component: "selected" }),
990
+ range_start: cn(rangeEdge, "rounded-l-full! rounded-r-none!"),
991
+ range_end: cn(rangeEdge, "rounded-r-full! rounded-l-none!"),
992
+ range_middle: "rounded-none! bg-grey-400! text-grey-900! dark:bg-accent-alt! dark:text-foreground-inverse!",
993
+ outside: calendarVariants({ component: "outside" }),
994
+ disabled: calendarVariants({ component: "disabled" }),
995
+ hidden: "invisible"
965
996
  }, classNames),
966
997
  components: {
967
998
  Chevron: (props2) => {