@overmap-ai/blocks 1.0.31-tailwind-components.44 → 1.0.31-tailwind-components.45

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.
@@ -1,5 +1,5 @@
1
1
  export declare const buttonCva: (props?: ({
2
- variant?: "solid" | "soft" | "outline" | "surface" | "ghost" | null | undefined;
2
+ variant?: "fill" | "solid" | "soft" | "outline" | "surface" | "ghost" | null | undefined;
3
3
  icon?: boolean | null | undefined;
4
4
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,7 +1,7 @@
1
1
  import type { ComponentRadius } from "../Provider";
2
2
  import type { AccentColorProps } from "../typings";
3
3
  export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
4
- export type ButtonVariant = "solid" | "soft" | "outline" | "surface" | "ghost";
4
+ export type ButtonVariant = "solid" | "soft" | "outline" | "surface" | "ghost" | "fill";
5
5
  export interface ButtonVariantProps extends AccentColorProps {
6
6
  size?: ButtonSize;
7
7
  variant?: ButtonVariant;
@@ -0,0 +1,2 @@
1
+ import type { ChevronProps } from "react-day-picker";
2
+ export declare const Chevron: (props: ChevronProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from "react";
2
+ import { DayPicker as ReactDayPicker } from "react-day-picker";
3
+ import { DayPickerVariantProps } from "./typings";
4
+ export type DayPickerProps = ComponentProps<typeof ReactDayPicker> & DayPickerVariantProps;
5
+ export declare const DayPicker: (props: DayPickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ export declare const rootCva: (props?: ({
2
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
3
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
+ export declare const dayButtonCva: (props?: ({
5
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
6
+ variant?: "solid" | "soft" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export declare const navButtonCva: (props?: ({
9
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ export declare const weekDayCva: (props?: ({
12
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
+ export declare const todayCva: (props?: ({
15
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
16
+ variant?: "solid" | "soft" | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
+ export declare const monthCaptionCva: (props?: ({
19
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
20
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,2 @@
1
+ export * from "./DayPicker";
2
+ export * from "./typings";
@@ -0,0 +1,13 @@
1
+ import { VariantProps } from "class-variance-authority";
2
+ import { ComponentRadius } from "../Provider";
3
+ import { AccentColorProps } from "../typings";
4
+ import { dayButtonCva } from "./cva";
5
+ type DayPickerVariants = VariantProps<typeof dayButtonCva>;
6
+ export type DayPickerSize = NonNullable<DayPickerVariants["size"]>;
7
+ export type DayPickerVariant = NonNullable<DayPickerVariants["variant"]>;
8
+ export interface DayPickerVariantProps extends AccentColorProps {
9
+ size?: DayPickerSize;
10
+ variant?: DayPickerVariant;
11
+ radius?: ComponentRadius;
12
+ }
13
+ export {};
package/dist/blocks.js CHANGED
@@ -7,6 +7,9 @@ import * as RadixAvatar from "@radix-ui/react-avatar";
7
7
  import * as RadixCheckbox from "@radix-ui/react-checkbox";
8
8
  import * as RadixPrimitiveCollapsible from "@radix-ui/react-collapsible";
9
9
  import { useMediaQuery } from "react-responsive";
10
+ import { DayPicker as DayPicker$1 } from "react-day-picker";
11
+ import * as RiIcons from "react-icons/ri";
12
+ import { RiArrowRightSLine, RiArrowLeftSLine, RiArrowDownSLine, RiArrowUpSLine, RiQuestionMark } from "react-icons/ri";
10
13
  import * as RadixDialog from "@radix-ui/react-dialog";
11
14
  import { HiX } from "react-icons/hi";
12
15
  import * as RadixHoverCard from "@radix-ui/react-hover-card";
@@ -16,8 +19,6 @@ import { Slot } from "@radix-ui/react-slot";
16
19
  import { useFloatingNodeId, useFloating, autoUpdate, offset, size, flip, shift, hide, useRole, useDismiss, useClick, useListNavigation, useInteractions, FloatingTree, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList, useHover, safePolygon, useListItem, useMergeRefs } from "@floating-ui/react";
17
20
  import * as RadixSeparator from "@radix-ui/react-separator";
18
21
  import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
19
- import * as RiIcons from "react-icons/ri";
20
- import { RiQuestionMark } from "react-icons/ri";
21
22
  import * as RadixPopover from "@radix-ui/react-popover";
22
23
  import * as RadixRadioGroup from "@radix-ui/react-radio-group";
23
24
  import * as RadixToggleGroup from "@radix-ui/react-toggle-group";
@@ -282,6 +283,16 @@ const buttonCva = cva(
282
283
  "text-(--accent-a11)",
283
284
  "data-[state='open']:inset-ring-(--accent-a8)",
284
285
  "data-[state='open']:bg-(--accent-a3)"
286
+ ],
287
+ fill: [
288
+ "bg-transparent",
289
+ "inset-ring",
290
+ "inset-ring-(--accent-a3)",
291
+ "text-(--accent-a11)",
292
+ "hover:inset-ring-0",
293
+ "hover:bg-(--accent-a3)",
294
+ "hover:text-(--accent-a12)",
295
+ "active:bg-(--accent-a4)"
285
296
  ]
286
297
  },
287
298
  icon: {
@@ -1009,6 +1020,213 @@ const CollapsibleTree = genericMemo(function(props) {
1009
1020
  }
1010
1021
  );
1011
1022
  });
1023
+ const Chevron = (props) => {
1024
+ const { orientation, ...rest } = props;
1025
+ switch (orientation) {
1026
+ case "up":
1027
+ return /* @__PURE__ */ jsx(RiArrowUpSLine, { ...rest });
1028
+ case "down":
1029
+ return /* @__PURE__ */ jsx(RiArrowDownSLine, { ...rest });
1030
+ case "left":
1031
+ return /* @__PURE__ */ jsx(RiArrowLeftSLine, { ...rest });
1032
+ default:
1033
+ return /* @__PURE__ */ jsx(RiArrowRightSLine, { ...rest });
1034
+ }
1035
+ };
1036
+ const rootCva = cva(["relative", "size-max"], {
1037
+ variants: {
1038
+ size: {
1039
+ xs: ["text-xs"],
1040
+ sm: ["text-sm"],
1041
+ md: ["text-base"],
1042
+ lg: ["text-lg"],
1043
+ xl: ["text-xl"]
1044
+ }
1045
+ }
1046
+ });
1047
+ const dayButtonCva = cva(
1048
+ [
1049
+ "relative",
1050
+ "transition-[background,text]",
1051
+ "focus:outline-hidden",
1052
+ "focus-visible:outline-2",
1053
+ "focus-visible:-outline-offset-1",
1054
+ "focus-visible:outline-(--accent-a8)",
1055
+ // range middle
1056
+ "group-[.rdp-range-middle]/day:rounded-none",
1057
+ "group-[.rdp-range-middle]/day:bg-(--accent-a2)",
1058
+ // range start/end
1059
+ "group-[.rdp-range-start:not(.rdp-range-end)]/day:rounded-r-none",
1060
+ "group-[.rdp-range-end:not(.rdp-range-start)]/day:rounded-l-none",
1061
+ // disabled
1062
+ "group-data-[disabled]/day:pointer-events-none",
1063
+ "group-data-[disabled]/day:text-(--base-a9)",
1064
+ "group-data-[disabled]/day:opacity-70",
1065
+ // outside (days shown)
1066
+ "group-data-[outside]/day:pointer-events-none",
1067
+ "group-data-[outside]/day:text-(--base-a9)",
1068
+ "group-data-[outside]/day:opacity-70",
1069
+ "group-data-[outside]/day:!bg-transparent"
1070
+ ],
1071
+ {
1072
+ variants: {
1073
+ size: {
1074
+ xs: ["size-5"],
1075
+ sm: ["size-6"],
1076
+ md: ["size-7"],
1077
+ lg: ["size-8"],
1078
+ xl: ["size-9"]
1079
+ },
1080
+ variant: {
1081
+ soft: [
1082
+ // unselected
1083
+ "group-[:not([data-selected])]/day:hover:bg-(--accent-a3)",
1084
+ "group-[:not([data-selected])]/day:active:bg-(--accent-a4)",
1085
+ // selected
1086
+ "group-[[data-selected='true']:not(.rdp-range-middle)]/day:bg-(--accent-a6)"
1087
+ ],
1088
+ solid: [
1089
+ // unselected
1090
+ "group-[:not([data-selected])]/day:hover:bg-(--accent-a3)",
1091
+ "group-[:not([data-selected])]/day:active:bg-(--accent-a4)",
1092
+ // selected
1093
+ "group-[[data-selected='true']:not(.rdp-range-middle)]/day:bg-(--accent-indicator)",
1094
+ "group-[[data-selected='true']:not(.rdp-range-middle)]/day:text-(--accent-contrast)"
1095
+ ]
1096
+ }
1097
+ }
1098
+ }
1099
+ );
1100
+ const navButtonCva = cva(
1101
+ [
1102
+ "flex",
1103
+ "items-center",
1104
+ "justify-center",
1105
+ "text-(--base-a11)",
1106
+ "hover:bg-(--base-a3)",
1107
+ "active:bg-(--base-a4)",
1108
+ "text-(--base-a11)",
1109
+ "hover:text-(--base-a12)"
1110
+ ],
1111
+ {
1112
+ variants: {
1113
+ size: {
1114
+ xs: ["size-5"],
1115
+ sm: ["size-6"],
1116
+ md: ["size-7"],
1117
+ lg: ["size-8"],
1118
+ xl: ["size-9"]
1119
+ }
1120
+ }
1121
+ }
1122
+ );
1123
+ const weekDayCva = cva(["font-medium", "text-(--base-a11)"], {
1124
+ variants: {
1125
+ size: {
1126
+ xs: ["size-5"],
1127
+ sm: ["size-6"],
1128
+ md: ["size-7"],
1129
+ lg: ["size-8"],
1130
+ xl: ["size-9"]
1131
+ }
1132
+ }
1133
+ });
1134
+ const todayCva = cva(
1135
+ [
1136
+ "*:after:absolute",
1137
+ "*:after:bg-(--base-12)",
1138
+ "*:after:start-1/2",
1139
+ "*:after:-translate-x-1/2",
1140
+ "*:group-data-[disabled]/day:after:bg-(--base-a9)",
1141
+ "*:after:rounded-full",
1142
+ "*:after:bottom-0.5"
1143
+ ],
1144
+ {
1145
+ variants: {
1146
+ size: {
1147
+ xs: ["*:after:size-[2px]"],
1148
+ sm: ["*:after:size-[3px]"],
1149
+ md: ["*:after:size-[3px]"],
1150
+ lg: ["*:after:size-[4px]"],
1151
+ xl: ["*:after:size-[4px]"]
1152
+ },
1153
+ variant: {
1154
+ soft: ["*:after:bg-(--accent-a5)"],
1155
+ solid: ["*:group-[[data-selected='true']:not(.rdp-range-middle)]/day:after:bg-(--accent-contrast)"]
1156
+ }
1157
+ }
1158
+ }
1159
+ );
1160
+ const monthCaptionCva = cva(["font-medium", "w-full", "flex", "justify-center", "items-center"], {
1161
+ variants: {
1162
+ size: {
1163
+ xs: ["h-5"],
1164
+ sm: ["h-6"],
1165
+ md: ["h-7"],
1166
+ lg: ["h-8"],
1167
+ xl: ["h-9"]
1168
+ }
1169
+ }
1170
+ });
1171
+ const DayPicker = (props) => {
1172
+ const providerContext = useProvider();
1173
+ const {
1174
+ components,
1175
+ classNames,
1176
+ accentColor = providerContext.accentColor,
1177
+ size: size2 = "md",
1178
+ variant = "soft",
1179
+ radius = providerContext.radius,
1180
+ showOutsideDays = true,
1181
+ ...rest
1182
+ } = props;
1183
+ const computedClassNames = useMemo(() => {
1184
+ return {
1185
+ ...classNames,
1186
+ root: cx(classNames == null ? void 0 : classNames.root, rootCva({ size: size2 })),
1187
+ nav: cx(classNames == null ? void 0 : classNames.nav, ["absolute", "top-0", "w-full", "flex", "justify-between"]),
1188
+ month: cx(classNames == null ? void 0 : classNames.month, ["flex", "flex-col", "gap-1"]),
1189
+ month_caption: cx(classNames == null ? void 0 : classNames.month_caption, monthCaptionCva({ size: size2 })),
1190
+ button_next: cx(
1191
+ classNames == null ? void 0 : classNames.button_next,
1192
+ navButtonCva({ size: size2 }),
1193
+ radiusCva({ radius, maxLarge: false })
1194
+ ),
1195
+ button_previous: cx(
1196
+ classNames == null ? void 0 : classNames.button_previous,
1197
+ navButtonCva({ size: size2 }),
1198
+ radiusCva({ radius, maxLarge: false })
1199
+ ),
1200
+ weekday: cx(classNames == null ? void 0 : classNames.weekday, weekDayCva({ size: size2 })),
1201
+ today: cx(classNames == null ? void 0 : classNames.today, todayCva({ size: size2, variant })),
1202
+ day: cx(classNames == null ? void 0 : classNames.day, ["group/day"]),
1203
+ day_button: cx(
1204
+ classNames == null ? void 0 : classNames.day_button,
1205
+ dayButtonCva({ size: size2, variant }),
1206
+ radiusCva({ radius, maxLarge: false })
1207
+ ),
1208
+ range_start: cx(classNames == null ? void 0 : classNames.range_start, "rdp-range-start"),
1209
+ range_middle: cx(classNames == null ? void 0 : classNames.range_middle, "rdp-range-middle"),
1210
+ range_end: cx(classNames == null ? void 0 : classNames.range_end, "rdp-range-end")
1211
+ };
1212
+ }, [classNames, radius, size2, variant]);
1213
+ const computedComponents = useMemo(() => {
1214
+ return {
1215
+ ...components,
1216
+ Chevron
1217
+ };
1218
+ }, [components]);
1219
+ return /* @__PURE__ */ jsx(
1220
+ DayPicker$1,
1221
+ {
1222
+ "data-accent-color": accentColor,
1223
+ showOutsideDays,
1224
+ components: computedComponents,
1225
+ classNames: computedClassNames,
1226
+ ...rest
1227
+ }
1228
+ );
1229
+ };
1012
1230
  const CloseDialogContext = createContext({});
1013
1231
  const useCloseDialog = () => {
1014
1232
  const dialogContext = useContext(CloseDialogContext);
@@ -2345,7 +2563,7 @@ MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
2345
2563
  const MenuClickTrigger = memo(
2346
2564
  forwardRef((props, forwardedRef) => {
2347
2565
  const { children, disabled = false } = props;
2348
- const { getReferenceProps, refs, setTriggerType } = useMenuContext();
2566
+ const { getReferenceProps, refs, setTriggerType, open } = useMenuContext();
2349
2567
  const mergedRefs = useMergeRefs([refs.setReference, forwardedRef]);
2350
2568
  useEffect(() => {
2351
2569
  setTriggerType("click");
@@ -2356,6 +2574,7 @@ const MenuClickTrigger = memo(
2356
2574
  ref: mergedRefs,
2357
2575
  "aria-disabled": disabled,
2358
2576
  "data-disabled": disabled ? "" : void 0,
2577
+ "data-state": open ? "open" : "closed",
2359
2578
  ...getReferenceProps({ disabled }),
2360
2579
  children
2361
2580
  }
@@ -4251,6 +4470,7 @@ export {
4251
4470
  CheckboxIndicator,
4252
4471
  CheckboxRoot,
4253
4472
  CollapsibleTree,
4473
+ DayPicker,
4254
4474
  Dialog,
4255
4475
  DialogContent,
4256
4476
  DialogOverlay,