@overmap-ai/blocks 1.0.40-alpha.4 → 1.0.40-icon-fix.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.
@@ -1,8 +1,6 @@
1
- import { DynamicIcon } from 'lucide-react/dynamic';
2
- import { ComponentPropsWithRef } from 'react';
3
- import { IconType } from './typings';
4
- interface LuIconProps extends Omit<ComponentPropsWithRef<typeof DynamicIcon>, "name"> {
5
- icon: IconType;
1
+ import { LucideProps } from 'lucide-react';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface LuIconProps extends Omit<LucideProps, "ref">, RefAttributes<SVGSVGElement> {
4
+ icon: ForwardRefExoticComponent<Omit<LucideProps, "ref"> & RefAttributes<SVGSVGElement>>;
6
5
  }
7
6
  export declare const LuIcon: import('react').NamedExoticComponent<LuIconProps>;
8
- export {};
@@ -1,2 +1,2 @@
1
1
  export * from './LuIcon';
2
- export * from './typings';
2
+ export type * from './typings';
@@ -1,3 +1,3 @@
1
- import { DynamicIcon } from 'lucide-react/dynamic';
2
1
  import { ComponentProps } from 'react';
3
- export type IconType = ComponentProps<typeof DynamicIcon>["name"];
2
+ import { LuIcon } from './LuIcon';
3
+ export type IconComponent = ComponentProps<typeof LuIcon>["icon"];
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayCloseProps extends ComponentPropsWithRef<typeof RadixDialog.Close> {
4
+ }
5
+ export declare const OverlayClose: import('react').NamedExoticComponent<OverlayCloseProps>;
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayContentProps extends ComponentPropsWithRef<typeof RadixDialog.Content> {
4
+ container?: RadixDialog.DialogPortalProps["container"];
5
+ }
6
+ export declare const OverlayContent: import('react').NamedExoticComponent<OverlayContentProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayDescriptionProps extends ComponentPropsWithRef<typeof RadixDialog.Description> {
4
+ }
5
+ export declare const OverlayDescription: import('react').NamedExoticComponent<OverlayDescriptionProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayRootProps extends ComponentProps<typeof RadixDialog.Root> {
4
+ }
5
+ export declare const OverlayRoot: import('react').NamedExoticComponent<OverlayRootProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayTitleProps extends ComponentPropsWithRef<typeof RadixDialog.Title> {
4
+ }
5
+ export declare const OverlayTitle: import('react').NamedExoticComponent<OverlayTitleProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixDialog from "@radix-ui/react-dialog";
3
+ export interface OverlayTriggerProps extends ComponentPropsWithRef<typeof RadixDialog.Trigger> {
4
+ }
5
+ export declare const OverlayTrigger: import('react').NamedExoticComponent<OverlayTriggerProps>;
@@ -0,0 +1 @@
1
+ export declare const overlayContentCva: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ export * from './Close';
3
+ export * from './Content';
4
+ export * from './Description';
5
+ export * from './Root';
6
+ export * from './Title';
7
+ export * from './Trigger';
8
+ export declare const Overlay: {
9
+ Root: import('react').NamedExoticComponent<import('./Root').OverlayRootProps>;
10
+ Content: import('react').NamedExoticComponent<import('./Content').OverlayContentProps>;
11
+ Title: import('react').NamedExoticComponent<import('./Title').OverlayTitleProps>;
12
+ Description: import('react').NamedExoticComponent<import('./Description').OverlayDescriptionProps>;
13
+ Trigger: import('react').NamedExoticComponent<import('./Trigger').OverlayTriggerProps>;
14
+ Close: import('react').NamedExoticComponent<import('./Close').OverlayCloseProps>;
15
+ };
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
3
+ export interface RatingItemProps extends Omit<ComponentPropsWithRef<typeof RadixRadioGroup.Item>, "value"> {
4
+ value: number;
5
+ }
6
+ export declare const RatingItem: import('react').NamedExoticComponent<RatingItemProps>;
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
3
+ export interface RatingItemIndicatorProps extends ComponentPropsWithRef<typeof RadixRadioGroup.Indicator> {
4
+ }
5
+ export declare const RatingItemIndicator: import('react').NamedExoticComponent<RatingItemIndicatorProps>;
@@ -0,0 +1,8 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
3
+ export interface RatingRootProps extends Omit<ComponentPropsWithRef<typeof RadixRadioGroup.Root>, "defaultValue" | "value" | "onValueChange"> {
4
+ defaultValue?: number;
5
+ value?: number | null;
6
+ onValueChange?: (value: number) => void;
7
+ }
8
+ export declare const RatingRoot: import('react').NamedExoticComponent<RatingRootProps>;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export interface IRatingRootContext {
3
+ value: number | null;
4
+ }
5
+ export declare const RatingRootContext: import('react').Context<IRatingRootContext>;
6
+ export interface IRatingItemContext {
7
+ value: number;
8
+ }
9
+ export declare const RatingItemContext: import('react').Context<IRatingItemContext>;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export * from './Item';
3
+ export * from './ItemIndicator';
4
+ export * from './Root';
5
+ export declare const Rating: {
6
+ Item: import('react').NamedExoticComponent<import('./Item').RatingItemProps>;
7
+ ItemIndicator: import('react').NamedExoticComponent<import('./ItemIndicator').RatingItemIndicatorProps>;
8
+ Root: import('react').NamedExoticComponent<import('./Root').RatingRootProps>;
9
+ };
package/dist/blocks.js CHANGED
@@ -9,7 +9,7 @@ import { CommandItem, CommandRoot, CommandEmpty, CommandGroup, CommandInput, use
9
9
  import * as RadixDialog from "@radix-ui/react-dialog";
10
10
  import { DialogPortal, DialogContent as DialogContent$1, DialogTitle, DialogDescription, DialogOverlay as DialogOverlay$1, DialogTrigger } from "@radix-ui/react-dialog";
11
11
  import { DayPicker as DayPicker$1 } from "react-day-picker";
12
- import { DynamicIcon } from "lucide-react/dynamic";
12
+ import { ChevronRight, ChevronLeft, ChevronDown, ChevronUp, AlertTriangle, RotateCcw, X } from "lucide-react";
13
13
  import * as RadixHoverCard from "@radix-ui/react-hover-card";
14
14
  import { CSSTransition } from "react-transition-group";
15
15
  import ReactDOM from "react-dom";
@@ -1649,21 +1649,21 @@ const CommandMenu = {
1649
1649
  PageTriggerItem: CommandMenuPageTriggerItem
1650
1650
  };
1651
1651
  const LuIcon = memo((props) => {
1652
- const { ref, icon, className, size: size2 = "1em", ...rest } = props;
1653
- return /* @__PURE__ */ jsx(DynamicIcon, { ref, className: cx("shrink-0", className), size: size2, name: icon, ...rest });
1652
+ const { ref, icon: Icon, className, size: size2 = "1em", ...rest } = props;
1653
+ return /* @__PURE__ */ jsx(Icon, { ref, className: cx("shrink-0", className), size: size2, ...rest });
1654
1654
  });
1655
1655
  LuIcon.displayName = "LuIcon";
1656
1656
  const Chevron = (props) => {
1657
1657
  const { orientation, ...rest } = props;
1658
1658
  switch (orientation) {
1659
1659
  case "up":
1660
- return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-up", ...rest });
1660
+ return /* @__PURE__ */ jsx(LuIcon, { icon: ChevronUp, ...rest });
1661
1661
  case "down":
1662
- return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-down", ...rest });
1662
+ return /* @__PURE__ */ jsx(LuIcon, { icon: ChevronDown, ...rest });
1663
1663
  case "left":
1664
- return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-left", ...rest });
1664
+ return /* @__PURE__ */ jsx(LuIcon, { icon: ChevronLeft, ...rest });
1665
1665
  default:
1666
- return /* @__PURE__ */ jsx(LuIcon, { icon: "chevron-right", ...rest });
1666
+ return /* @__PURE__ */ jsx(LuIcon, { icon: ChevronRight, ...rest });
1667
1667
  }
1668
1668
  };
1669
1669
  const rootCva = cva(["relative", "size-max"], {
@@ -4085,8 +4085,10 @@ const MenuV2Root = memo((props) => {
4085
4085
  [getActiveItem, getFirstGroup, getFirstItem, getLastGroup, getLastItem, getNextGroup, getNextItem, onKeyDown]
4086
4086
  );
4087
4087
  useEffect(() => {
4088
+ var _a;
4088
4089
  const firstItem = getFirstItem(internalRef.current);
4089
4090
  if (!firstItem) return;
4091
+ (_a = internalRef.current) == null ? void 0 : _a.focus();
4090
4092
  setActiveItemId(firstItem.getAttribute(ITEM_SELECTOR));
4091
4093
  }, [getFirstItem]);
4092
4094
  const contextValue = useMemo(
@@ -4281,6 +4283,62 @@ const OneTimePasswordField = {
4281
4283
  Input: OneTimePasswordFieldInput,
4282
4284
  Root: OneTimePasswordFieldRoot
4283
4285
  };
4286
+ const OverlayClose = memo((props) => {
4287
+ const { ref, ...rest } = props;
4288
+ return /* @__PURE__ */ jsx(RadixDialog.Close, { ref, ...rest });
4289
+ });
4290
+ OverlayClose.displayName = "OverlayClose";
4291
+ const overlayContentCva = cva([
4292
+ "fixed",
4293
+ "inset-0",
4294
+ "bg-(--color-background)",
4295
+ "data-[state='closed']:animate-out",
4296
+ "data-[state='closed']:fade-out-0",
4297
+ "data-[state='closed']:zoom-out-95",
4298
+ "data-[state='open']:animate-in",
4299
+ "data-[state='open']:fade-in-0",
4300
+ "data-[state='open']:zoom-in-95"
4301
+ ]);
4302
+ const OverlayContent = memo((props) => {
4303
+ const { ref, container, className, ...rest } = props;
4304
+ return /* @__PURE__ */ jsx(RadixDialog.Portal, { container, children: /* @__PURE__ */ jsx(
4305
+ RadixDialog.Content,
4306
+ {
4307
+ className: cx(overlayContentCva(), className),
4308
+ ref,
4309
+ "data-floating-content": "",
4310
+ ...rest
4311
+ }
4312
+ ) });
4313
+ });
4314
+ OverlayContent.displayName = "OverlayContent";
4315
+ const OverlayDescription = memo((props) => {
4316
+ const { ref, ...rest } = props;
4317
+ return /* @__PURE__ */ jsx(RadixDialog.Description, { ref, ...rest });
4318
+ });
4319
+ OverlayDescription.displayName = "OverlayDescription";
4320
+ const OverlayRoot = memo((props) => {
4321
+ return /* @__PURE__ */ jsx(RadixDialog.Root, { ...props });
4322
+ });
4323
+ OverlayRoot.displayName = "OverlayRoot";
4324
+ const OverlayTitle = memo((props) => {
4325
+ const { ref, ...rest } = props;
4326
+ return /* @__PURE__ */ jsx(RadixDialog.Title, { ref, ...rest });
4327
+ });
4328
+ OverlayTitle.displayName = "OverlayTitle";
4329
+ const OverlayTrigger = memo((props) => {
4330
+ const { ref, ...rest } = props;
4331
+ return /* @__PURE__ */ jsx(RadixDialog.Trigger, { ref, ...rest });
4332
+ });
4333
+ OverlayTrigger.displayName = "OverlayTrigger";
4334
+ const Overlay = {
4335
+ Root: OverlayRoot,
4336
+ Content: OverlayContent,
4337
+ Title: OverlayTitle,
4338
+ Description: OverlayDescription,
4339
+ Trigger: OverlayTrigger,
4340
+ Close: OverlayClose
4341
+ };
4284
4342
  const centerStyles = { placeSelf: "center" };
4285
4343
  const ErrorFallback = memo((props) => {
4286
4344
  const { absoluteCentering, message = "Something went wrong", onRetry } = props;
@@ -4293,9 +4351,9 @@ const ErrorFallback = memo((props) => {
4293
4351
  }, [onRetry, resetBoundary]);
4294
4352
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full gap-2", style: outerFlexStyles, children: [
4295
4353
  /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } }),
4296
- /* @__PURE__ */ jsx(LuIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
4354
+ /* @__PURE__ */ jsx(LuIcon, { icon: AlertTriangle, size: height, style: centerStyles }),
4297
4355
  /* @__PURE__ */ jsx("span", { style: { lineHeight: height, ...centerStyles }, children: message }),
4298
- /* @__PURE__ */ jsx(IconButton, { "aria-label": "Try again", variant: "soft", onClick: handleRetry, style: centerStyles, children: /* @__PURE__ */ jsx(LuIcon, { icon: "rotate-ccw", size: height }) }),
4356
+ /* @__PURE__ */ jsx(IconButton, { "aria-label": "Try again", variant: "soft", onClick: handleRetry, style: centerStyles, children: /* @__PURE__ */ jsx(LuIcon, { icon: RotateCcw, size: height }) }),
4299
4357
  /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } })
4300
4358
  ] });
4301
4359
  });
@@ -4644,6 +4702,65 @@ const RadioGroup = {
4644
4702
  Item: RadioGroupItem,
4645
4703
  Root: RadioGroupRoot
4646
4704
  };
4705
+ const RatingRootContext = createContext({});
4706
+ const RatingItemContext = createContext({});
4707
+ const RatingItem = memo((props) => {
4708
+ const { ref, children, value, ...rest } = props;
4709
+ const { value: activeValue } = use(RatingRootContext);
4710
+ const active = !!activeValue && value <= activeValue;
4711
+ const contextValue = useMemo(() => ({ value }), [value]);
4712
+ return /* @__PURE__ */ jsx(RadixRadioGroup.Item, { ref, value: value.toString(), "data-active": active, ...rest, children: /* @__PURE__ */ jsx(RatingItemContext, { value: contextValue, children }) });
4713
+ });
4714
+ RatingItem.displayName = "RatingItem";
4715
+ const RatingItemIndicator = memo((props) => {
4716
+ const { ref, children, forceMount, ...rest } = props;
4717
+ const { value: activeValue } = use(RatingRootContext);
4718
+ const { value } = use(RatingItemContext);
4719
+ const active = !!activeValue && value <= activeValue;
4720
+ return /* @__PURE__ */ jsx(
4721
+ RadixRadioGroup.Indicator,
4722
+ {
4723
+ ref,
4724
+ forceMount: forceMount ?? (active || void 0),
4725
+ "data-active": active,
4726
+ ...rest,
4727
+ children
4728
+ }
4729
+ );
4730
+ });
4731
+ RatingItemIndicator.displayName = "RatingItemIndicator";
4732
+ const RatingRoot = memo((props) => {
4733
+ const { ref, children, defaultValue, value: controlledValue, onValueChange, ...rest } = props;
4734
+ const [value, setValue] = useControlledState(defaultValue ?? null, controlledValue, onValueChange);
4735
+ const handleValueChange = useCallback(
4736
+ (value2) => {
4737
+ setValue(parseInt(value2));
4738
+ },
4739
+ [setValue]
4740
+ );
4741
+ const contextValue = useMemo(
4742
+ () => ({
4743
+ value
4744
+ }),
4745
+ [value]
4746
+ );
4747
+ return /* @__PURE__ */ jsx(
4748
+ RadixRadioGroup.Root,
4749
+ {
4750
+ ref,
4751
+ value: value ? value.toString() : null,
4752
+ onValueChange: handleValueChange,
4753
+ ...rest,
4754
+ children: /* @__PURE__ */ jsx(RatingRootContext, { value: contextValue, children })
4755
+ }
4756
+ );
4757
+ });
4758
+ RatingRoot.displayName = "RatingRoot";
4759
+ const Rating = {
4760
+ Item: RatingItem,
4761
+ ItemIndicator: RatingItemIndicator,
4762
+ Root: RatingRoot
4763
+ };
4647
4764
  const segmentedControlRootCva = cva(
4648
4765
  ["shrink-0", "transition-colors", "inline-flex", "box-border", "min-w-max", "text-center"],
4649
4766
  {
@@ -5912,7 +6029,7 @@ const _Toast = function Toast2(props) {
5912
6029
  action && /* @__PURE__ */ jsx(RadixToast.Action, { className: "w-max", altText: action.altText, asChild: true, children: action.content })
5913
6030
  ] })
5914
6031
  ] }),
5915
- /* @__PURE__ */ jsx(RadixToast.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: size2, "aria-label": "Close", variant: "ghost", accentColor, children: /* @__PURE__ */ jsx(LuIcon, { icon: "x" }) }) })
6032
+ /* @__PURE__ */ jsx(RadixToast.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: size2, "aria-label": "Close", variant: "ghost", accentColor, children: /* @__PURE__ */ jsx(LuIcon, { icon: X }) }) })
5916
6033
  ]
5917
6034
  }
5918
6035
  );
@@ -6517,6 +6634,13 @@ export {
6517
6634
  OneTimePasswordFieldHiddenInput,
6518
6635
  OneTimePasswordFieldInput,
6519
6636
  OneTimePasswordFieldRoot,
6637
+ Overlay,
6638
+ OverlayClose,
6639
+ OverlayContent,
6640
+ OverlayDescription,
6641
+ OverlayRoot,
6642
+ OverlayTitle,
6643
+ OverlayTrigger,
6520
6644
  OvermapErrorBoundary,
6521
6645
  Popover,
6522
6646
  PopoverArrow,
@@ -6530,6 +6654,10 @@ export {
6530
6654
  RadioGroupIndicator,
6531
6655
  RadioGroupItem,
6532
6656
  RadioGroupRoot,
6657
+ Rating,
6658
+ RatingItem,
6659
+ RatingItemIndicator,
6660
+ RatingRoot,
6533
6661
  SegmentedControl,
6534
6662
  SegmentedControlItem,
6535
6663
  SegmentedControlRoot,