@overmap-ai/blocks 1.0.39 → 1.0.40-alpha.0

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.
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixOneTimePasswordField from "@radix-ui/react-one-time-password-field";
3
+ export interface OneTimePasswordFieldHiddenInputProps extends ComponentPropsWithRef<typeof RadixOneTimePasswordField.HiddenInput> {
4
+ }
5
+ export declare const OneTimePasswordFieldHiddenInput: import('react').NamedExoticComponent<OneTimePasswordFieldHiddenInputProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixOneTimePasswordField from "@radix-ui/react-one-time-password-field";
3
+ export interface OneTimePasswordFieldInputProps extends ComponentPropsWithRef<typeof RadixOneTimePasswordField.Input> {
4
+ }
5
+ export declare const OneTimePasswordFieldInput: import('react').NamedExoticComponent<OneTimePasswordFieldInputProps>;
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import { OneTimePasswordFieldVariantProps } from './typings';
3
+ import * as RadixOneTimePasswordField from "@radix-ui/react-one-time-password-field";
4
+ export interface OneTimePasswordFieldRootProps extends ComponentPropsWithRef<typeof RadixOneTimePasswordField.Root>, OneTimePasswordFieldVariantProps {
5
+ }
6
+ export declare const OneTimePasswordFieldRoot: import('react').NamedExoticComponent<OneTimePasswordFieldRootProps>;
@@ -0,0 +1,9 @@
1
+ import { ComponentRadius } from '../Provider';
2
+ import { OneTimePasswordFieldSize, OneTimePasswordFieldVariant } from './typings';
3
+ export interface IOneTimePasswordFieldContext {
4
+ variant: OneTimePasswordFieldVariant;
5
+ size: OneTimePasswordFieldSize;
6
+ radius: ComponentRadius;
7
+ accentColor: string;
8
+ }
9
+ export declare const OneTimePasswordFieldContext: import('react').Context<IOneTimePasswordFieldContext>;
@@ -0,0 +1,4 @@
1
+ export declare const onetimePasswordFieldInput: (props?: ({
2
+ variant?: "soft" | "outline" | "surface" | "ghost" | null | undefined;
3
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export * from './HiddenInput';
3
+ export * from './Input';
4
+ export * from './Root';
5
+ export * from './typings';
6
+ export declare const OneTimePasswordField: {
7
+ HiddenInput: import('react').NamedExoticComponent<import('./HiddenInput').OneTimePasswordFieldHiddenInputProps>;
8
+ Input: import('react').NamedExoticComponent<import('./Input').OneTimePasswordFieldInputProps>;
9
+ Root: import('react').NamedExoticComponent<import('./Root').OneTimePasswordFieldRootProps>;
10
+ };
@@ -0,0 +1,9 @@
1
+ import { ComponentRadius } from '../Provider';
2
+ import { AccentColorProps } from '../typings';
3
+ export type OneTimePasswordFieldSize = "xs" | "sm" | "md" | "lg" | "xl";
4
+ export type OneTimePasswordFieldVariant = "surface" | "soft" | "outline" | "ghost";
5
+ export interface OneTimePasswordFieldVariantProps extends AccentColorProps {
6
+ variant?: OneTimePasswordFieldVariant;
7
+ size?: OneTimePasswordFieldSize;
8
+ radius?: ComponentRadius;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { DynamicIcon } from 'lucide-react/dynamic';
2
+ import { ComponentProps, ComponentPropsWithRef } from 'react';
3
+ interface LuIconProps extends Omit<ComponentPropsWithRef<typeof DynamicIcon>, "name"> {
4
+ icon: ComponentProps<typeof DynamicIcon>["name"];
5
+ }
6
+ export declare const LuIcon: import('react').NamedExoticComponent<LuIconProps>;
7
+ export {};
@@ -1 +1 @@
1
- export * from './RiIcon';
1
+ export * from './LuIcon';
package/dist/blocks.js CHANGED
@@ -11,14 +11,14 @@ import { CommandItem, CommandRoot, CommandEmpty, CommandGroup, CommandInput, use
11
11
  import * as RadixDialog from "@radix-ui/react-dialog";
12
12
  import { DialogPortal, DialogContent as DialogContent$1, DialogTitle, DialogDescription, DialogOverlay as DialogOverlay$1, DialogTrigger } from "@radix-ui/react-dialog";
13
13
  import { DayPicker as DayPicker$1 } from "react-day-picker";
14
- import * as RiIcons from "react-icons/ri";
15
- import { RiArrowRightSLine, RiArrowLeftSLine, RiArrowDownSLine, RiArrowUpSLine, RiQuestionMark } from "react-icons/ri";
14
+ import { DynamicIcon } from "lucide-react/dynamic";
16
15
  import * as RadixHoverCard from "@radix-ui/react-hover-card";
17
16
  import { CSSTransition } from "react-transition-group";
18
17
  import ReactDOM from "react-dom";
19
18
  import { Slot } from "@radix-ui/react-slot";
20
19
  import { useFloatingNodeId, useFloating, offset, size, flip, shift, hide, autoUpdate, useRole, useDismiss, useClick, useListNavigation, useInteractions, FloatingTree, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList, useHover, safePolygon, useListItem, useMergeRefs } from "@floating-ui/react";
21
20
  import * as RadixSeparator from "@radix-ui/react-separator";
21
+ import * as RadixOneTimePasswordField from "@radix-ui/react-one-time-password-field";
22
22
  import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
23
23
  import * as RadixPopover from "@radix-ui/react-popover";
24
24
  import * as RadixProgress from "@radix-ui/react-progress";
@@ -29,7 +29,6 @@ import * as RadixSlider from "@radix-ui/react-slider";
29
29
  import * as RadixSwitch from "@radix-ui/react-switch";
30
30
  import * as RadixToast from "@radix-ui/react-toast";
31
31
  import { ToastProvider as ToastProvider$1, ToastViewport } from "@radix-ui/react-toast";
32
- import { HiX } from "react-icons/hi";
33
32
  import * as Toggle from "@radix-ui/react-toggle";
34
33
  import * as RadixTooltip from "@radix-ui/react-tooltip";
35
34
  const floating = cva(
@@ -1817,17 +1816,22 @@ const CommandMenu = {
1817
1816
  Page: CommandMenuPage,
1818
1817
  PageTriggerItem: CommandMenuPageTriggerItem
1819
1818
  };
1819
+ const LuIcon = memo((props) => {
1820
+ const { ref, icon, className, size: size2 = "1em", ...rest } = props;
1821
+ return /* @__PURE__ */ jsx(DynamicIcon, { ref, className: cx("shrink-0", className), size: size2, name: icon, ...rest });
1822
+ });
1823
+ LuIcon.displayName = "RiIcon";
1820
1824
  const Chevron = (props) => {
1821
1825
  const { orientation, ...rest } = props;
1822
1826
  switch (orientation) {
1823
1827
  case "up":
1824
- return /* @__PURE__ */ jsx(RiArrowUpSLine, { ...rest });
1828
+ return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-up", ...rest });
1825
1829
  case "down":
1826
- return /* @__PURE__ */ jsx(RiArrowDownSLine, { ...rest });
1830
+ return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down", ...rest });
1827
1831
  case "left":
1828
- return /* @__PURE__ */ jsx(RiArrowLeftSLine, { ...rest });
1832
+ return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-left", ...rest });
1829
1833
  default:
1830
- return /* @__PURE__ */ jsx(RiArrowRightSLine, { ...rest });
1834
+ return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-right", ...rest });
1831
1835
  }
1832
1836
  };
1833
1837
  const rootCva = cva(["relative", "size-max"], {
@@ -2881,6 +2885,7 @@ const CheckedIndicator = (props) => {
2881
2885
  {
2882
2886
  ref,
2883
2887
  className: cx(
2888
+ "flex size-max items-center",
2884
2889
  {
2885
2890
  invisible: checked === false
2886
2891
  },
@@ -2901,16 +2906,17 @@ const menuItem = cva(
2901
2906
  "rounded",
2902
2907
  "outline-none",
2903
2908
  "data-[disabled=true]:text-(--base-a8)",
2904
- "shrink-0"
2909
+ "shrink-0",
2910
+ "py-1"
2905
2911
  ],
2906
2912
  {
2907
2913
  variants: {
2908
2914
  size: {
2909
- xs: ["h-6", "gap-1.5", "px-3"],
2910
- sm: ["h-7", "gap-1.75", "px-3.5"],
2911
- md: ["h-8", "gap-2", "px-4"],
2912
- lg: ["h-9", "gap-2.25", "px-4.5"],
2913
- xl: ["h-10", "gap-2.5", "px-5"]
2915
+ xs: ["gap-1.5", "px-3"],
2916
+ sm: ["gap-1.75", "px-3.5"],
2917
+ md: ["gap-2", "px-4"],
2918
+ lg: ["gap-2.25", "px-4.5"],
2919
+ xl: ["gap-2.5", "px-5"]
2914
2920
  },
2915
2921
  variant: {
2916
2922
  solid: [
@@ -2932,14 +2938,14 @@ const menuItem = cva(
2932
2938
  }
2933
2939
  }
2934
2940
  );
2935
- const menuLabelCva = cva(["text-(--base-a10)", "flex", "items-center", "select-none"], {
2941
+ const menuLabelCva = cva(["text-(--base-a10)", "flex", "items-center", "select-none", "py-1"], {
2936
2942
  variants: {
2937
2943
  size: {
2938
- xs: ["h-6", "gap-1.5", "px-3", "text-xs"],
2939
- sm: ["h-7", "gap-1.75", "px-3.5", "text-xs"],
2940
- md: ["h-8", "gap-2", "px-4", "text-sm"],
2941
- lg: ["h-9", "gap-2.25", "px-4.5", "text-base"],
2942
- xl: ["h-10", "gap-2.5", "px-5", "text-lg"]
2944
+ xs: ["gap-1.5", "px-3", "text-xs"],
2945
+ sm: ["gap-1.75", "px-3.5", "text-xs"],
2946
+ md: ["gap-2", "px-4", "text-sm"],
2947
+ lg: ["gap-2.25", "px-4.5", "text-base"],
2948
+ xl: ["gap-2.5", "px-5", "text-lg"]
2943
2949
  }
2944
2950
  },
2945
2951
  defaultVariants: {
@@ -3552,6 +3558,7 @@ const MenuSelectedIndicator = memo((props) => {
3552
3558
  {
3553
3559
  ref,
3554
3560
  className: cx(
3561
+ "flex size-max items-center",
3555
3562
  {
3556
3563
  invisible: !isSelected
3557
3564
  },
@@ -3848,27 +3855,105 @@ const Menu = {
3848
3855
  Separator: MenuSeparator,
3849
3856
  Scroll: MenuScroll
3850
3857
  };
3851
- const RiIcon = memo((props) => {
3852
- const { ref, icon, size: size2, title, color, className, ...rest } = props;
3853
- const Icon = RiIcons[icon];
3854
- if (!Icon) console.error(`Icon ${icon} not found`);
3855
- return Icon ? (
3856
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3857
- // @ts-ignore
3858
- /* @__PURE__ */ jsx(Icon, { className: cx("shrink-0", className), ref, title, size: size2, color, ...rest })
3859
- ) : /* @__PURE__ */ jsx(
3860
- RiQuestionMark,
3858
+ const OneTimePasswordFieldHiddenInput = memo((props) => {
3859
+ return /* @__PURE__ */ jsx(RadixOneTimePasswordField.HiddenInput, { ...props });
3860
+ });
3861
+ OneTimePasswordFieldHiddenInput.displayName = "OneTimePasswordFieldHiddenInput";
3862
+ const OneTimePasswordFieldContext = createContext({});
3863
+ const onetimePasswordFieldInput = cva(
3864
+ [
3865
+ "flex",
3866
+ "items-center",
3867
+ "justify-center",
3868
+ "text-center",
3869
+ "focus-visible:outline-2",
3870
+ "focus-visible:outline-(--accent-8)",
3871
+ "focus-visible:-outline-offset-1",
3872
+ "disabled:opacity-50",
3873
+ "disabled:pointer-events-none",
3874
+ "transition-[background,color,box-shadow]"
3875
+ ],
3876
+ {
3877
+ variants: {
3878
+ variant: {
3879
+ surface: [
3880
+ "inset-ring",
3881
+ "inset-ring-(--accent-a7)",
3882
+ "bg-(--accent-surface)",
3883
+ "text-(--accent-a12)",
3884
+ "placeholder-(--accent-12)",
3885
+ "placeholder:opacity-60",
3886
+ "selection:bg-(--accent-a5)"
3887
+ ],
3888
+ soft: [
3889
+ "bg-(--accent-a3)",
3890
+ "text-(--accent-12)",
3891
+ "placeholder-(--accent-12)",
3892
+ "placeholder:opacity-60",
3893
+ "selection:bg-(--accent-a5)"
3894
+ ],
3895
+ outline: [
3896
+ "inset-ring",
3897
+ "inset-ring-(--base-a7)",
3898
+ "bg-transparent",
3899
+ "text-(--base-12)",
3900
+ "placeholder-(--base-a9)",
3901
+ "selection:bg-(--accent-a5)"
3902
+ ],
3903
+ ghost: ["bg-transparent", "text-(--base-12)", 'placeholder-(--base-a9)", "selection:bg-(--accent-a5)']
3904
+ },
3905
+ size: {
3906
+ xs: ["size-6 w-6", "text-xs"],
3907
+ sm: ["size-7 w-7", "text-sm"],
3908
+ md: ["size-8 w-8", "text-base"],
3909
+ lg: ["size-9 w-9", "text-lg"],
3910
+ xl: ["size-10 w-10", "text-xl"]
3911
+ }
3912
+ },
3913
+ defaultVariants: {
3914
+ size: "md",
3915
+ variant: "surface"
3916
+ }
3917
+ }
3918
+ );
3919
+ const OneTimePasswordFieldInput = memo((props) => {
3920
+ const { ref, className, ...rest } = props;
3921
+ const { variant, size: size2, radius, accentColor } = use(OneTimePasswordFieldContext);
3922
+ return /* @__PURE__ */ jsx(
3923
+ RadixOneTimePasswordField.Input,
3861
3924
  {
3862
- className: cx("shrink-0", className),
3863
3925
  ref,
3864
- title,
3865
- size: size2,
3866
- color,
3926
+ className: cx(
3927
+ onetimePasswordFieldInput({ variant, size: size2 }),
3928
+ radiusCva({ radius, maxLarge: true }),
3929
+ className
3930
+ ),
3931
+ "data-accent-color": accentColor,
3867
3932
  ...rest
3868
3933
  }
3869
3934
  );
3870
3935
  });
3871
- RiIcon.displayName = "RiIcon";
3936
+ OneTimePasswordFieldInput.displayName = "OneTimePasswordFieldInput";
3937
+ const OneTimePasswordFieldRoot = memo((props) => {
3938
+ const providerContext = useProvider();
3939
+ const {
3940
+ ref,
3941
+ children,
3942
+ variant = "surface",
3943
+ size: size2 = "md",
3944
+ radius = providerContext.radius,
3945
+ accentColor = providerContext.accentColor,
3946
+ ...rest
3947
+ } = props;
3948
+ const contextValue = useMemo(() => ({ variant, size: size2, radius, accentColor }), [accentColor, radius, size2, variant]);
3949
+ return /* @__PURE__ */ jsx(RadixOneTimePasswordField.Root, { ref, "data-accent-color": accentColor, ...rest, children: /* @__PURE__ */ jsx(OneTimePasswordFieldContext, { value: contextValue, children }) });
3950
+ });
3951
+ OneTimePasswordFieldRoot.displayName = "OneTimePasswordFieldRoot";
3952
+ const OneTimePasswordField = {
3953
+ HiddenInput: OneTimePasswordFieldHiddenInput,
3954
+ Input: OneTimePasswordFieldInput,
3955
+ Root: OneTimePasswordFieldRoot
3956
+ };
3872
3957
  const centerStyles = { placeSelf: "center" };
3873
3958
  const ErrorFallback = memo((props) => {
3874
3959
  const { absoluteCentering, message = "Something went wrong", onRetry } = props;
@@ -3881,9 +3966,9 @@ const ErrorFallback = memo((props) => {
3881
3966
  }, [onRetry, resetBoundary]);
3882
3967
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full gap-2", style: outerFlexStyles, children: [
3883
3968
  /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } }),
3884
- /* @__PURE__ */ jsx(RiIcon, { icon: "RiAlertLine", size: height, style: centerStyles }),
3969
+ /* @__PURE__ */ jsx(LuIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
3885
3970
  /* @__PURE__ */ jsx("span", { style: { lineHeight: height, ...centerStyles }, children: message }),
3886
- /* @__PURE__ */ jsx(IconButton, { "aria-label": "Try again", variant: "soft", onClick: handleRetry, style: centerStyles, children: /* @__PURE__ */ jsx(RiIcon, { icon: "RiLoopLeftLine", size: height }) }),
3971
+ /* @__PURE__ */ jsx(IconButton, { "aria-label": "Try again", variant: "soft", onClick: handleRetry, style: centerStyles, children: /* @__PURE__ */ jsx(LuIcon, { icon: "rotate-ccw", size: height }) }),
3887
3972
  /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } })
3888
3973
  ] });
3889
3974
  });
@@ -5500,7 +5585,7 @@ const _Toast = function Toast2(props) {
5500
5585
  action && /* @__PURE__ */ jsx(RadixToast.Action, { className: "w-max", altText: action.altText, asChild: true, children: action.content })
5501
5586
  ] })
5502
5587
  ] }),
5503
- /* @__PURE__ */ jsx(RadixToast.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: size2, "aria-label": "Close", variant: "ghost", accentColor, children: /* @__PURE__ */ jsx(HiX, {}) }) })
5588
+ /* @__PURE__ */ jsx(RadixToast.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: size2, "aria-label": "Close", variant: "ghost", accentColor, children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" }) }) })
5504
5589
  ]
5505
5590
  }
5506
5591
  );
@@ -6056,6 +6141,7 @@ export {
6056
6141
  LayoutSlideOutOverlay,
6057
6142
  LayoutSlideOutTrigger,
6058
6143
  Link,
6144
+ LuIcon,
6059
6145
  Menu,
6060
6146
  MenuCheckboxItem,
6061
6147
  MenuCheckboxItemIndicator,
@@ -6084,6 +6170,10 @@ export {
6084
6170
  MenuSubContent,
6085
6171
  MenuSubTrigger,
6086
6172
  MenuVirtualTrigger,
6173
+ OneTimePasswordField,
6174
+ OneTimePasswordFieldHiddenInput,
6175
+ OneTimePasswordFieldInput,
6176
+ OneTimePasswordFieldRoot,
6087
6177
  OvermapErrorBoundary,
6088
6178
  Popover,
6089
6179
  PopoverArrow,
@@ -6097,7 +6187,6 @@ export {
6097
6187
  RadioGroupIndicator,
6098
6188
  RadioGroupItem,
6099
6189
  RadioGroupRoot,
6100
- RiIcon,
6101
6190
  SegmentedControl,
6102
6191
  SegmentedControlItem,
6103
6192
  SegmentedControlRoot,