@overmap-ai/blocks 1.0.26 → 1.0.27-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.
- package/README.md +3 -3
- package/dist/Buttons/typings.d.ts +6 -5
- package/dist/Dialogs/Dialog/typings.d.ts +2 -7
- package/dist/Dialogs/Dialog/utils.d.ts +1 -1
- package/dist/Dialogs/Overlay/Overlay.d.ts +34 -0
- package/dist/Dialogs/Overlay/index.d.ts +1 -0
- package/dist/Dialogs/index.d.ts +2 -0
- package/dist/Dialogs/typings.d.ts +5 -0
- package/dist/DownloadButtonUtility/DownloadButtonUtility.d.ts +7 -0
- package/dist/DownloadButtonUtility/index.d.ts +1 -0
- package/dist/Layout/SlideOutOverlay.d.ts +2 -2
- package/dist/Layout/index.d.ts +1 -1
- package/dist/OvermapItem/OvermapItem.d.ts +5 -0
- package/dist/OvermapItem/constants.d.ts +2 -0
- package/dist/OvermapItem/index.d.ts +2 -0
- package/dist/OvermapItem/typings.d.ts +20 -0
- package/dist/ToggleButton/ToggleButton.d.ts +8 -0
- package/dist/ToggleButton/index.d.ts +1 -0
- package/dist/blocks.js +298 -90
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +296 -89
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/style.css +37 -16
- package/dist/typings.d.ts +4 -0
- package/dist/utils.d.ts +10 -4
- package/package.json +106 -104
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# overmap-ai blocks
|
|
2
|
-
|
|
3
|
-
Contains basic components used by overmap-ai libraries.
|
|
1
|
+
# overmap-ai blocks
|
|
2
|
+
|
|
3
|
+
Contains basic components used by overmap-ai libraries.
|
|
@@ -6,11 +6,7 @@ export interface Shortcut {
|
|
|
6
6
|
action: () => void;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
export type ButtonHoverEffect = "spin90Clockwise" | "spin180Clockwise" | "spin360Clockwise";
|
|
11
|
-
export interface ButtonProps extends Omit<RadixButtonProps, "size" | "variant" | "loading" | keyof MarginProps> {
|
|
12
|
-
children: RadixButtonProps["children"];
|
|
13
|
-
/** @default false */
|
|
9
|
+
export interface ButtonStyleProps {
|
|
14
10
|
fluid?: boolean;
|
|
15
11
|
/** @default solid */
|
|
16
12
|
variant?: Variant;
|
|
@@ -18,6 +14,11 @@ export interface ButtonProps extends Omit<RadixButtonProps, "size" | "variant" |
|
|
|
18
14
|
severity?: Severity;
|
|
19
15
|
size?: Responsive<Size>;
|
|
20
16
|
hoverEffects?: ButtonHoverEffect[];
|
|
17
|
+
}
|
|
18
|
+
export type RadixButtonProps = React.ComponentProps<typeof RadixButton>;
|
|
19
|
+
export type ButtonHoverEffect = "spin90Clockwise" | "spin180Clockwise" | "spin360Clockwise";
|
|
20
|
+
export interface ButtonProps extends Omit<RadixButtonProps, "size" | "variant" | "loading" | keyof MarginProps>, ButtonStyleProps {
|
|
21
|
+
children: RadixButtonProps["children"];
|
|
21
22
|
shortcut?: Shortcut;
|
|
22
23
|
loading?: boolean;
|
|
23
24
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
1
2
|
import { DialogContent } from "@radix-ui/themes";
|
|
2
|
-
import { CloseDialog } from "../typings";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
export interface CloseDialogOptions {
|
|
5
|
-
/** Bypass the `onCloseInterrupt` and force the dialog to close */
|
|
6
|
-
force?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type CloseDialogWithOptions = (options?: CloseDialogOptions) => void;
|
|
3
|
+
import { CloseDialog, CloseDialogWithOptions } from "../typings";
|
|
9
4
|
type RadixDialogContentProps = React.ComponentProps<typeof DialogContent>;
|
|
10
5
|
export interface DialogProps extends Omit<RadixDialogContentProps, "content" | "children"> {
|
|
11
6
|
/** The content of the dialog, which is rendered below the description.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CloseDialogOptions, CloseDialogWithOptions } from "
|
|
1
|
+
import { CloseDialogOptions, CloseDialogWithOptions } from "../typings";
|
|
2
2
|
/** This custom hook is used as a utility for wrapping a general callback in callback that accepts a close function for the
|
|
3
3
|
* Blocks dialog component. Sometimes a side effect callback needs to be run upon the closure of a Dialog. This provides
|
|
4
4
|
* a hook to wrap a callback with the returned close function passed to the Dialog Content. This allows the closure of
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CSSProperties, ReactElement, ReactNode } from "react";
|
|
2
|
+
import * as RadixDialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
import { CloseDialog, CloseDialogWithOptions } from "../typings";
|
|
4
|
+
export interface OverlayProps {
|
|
5
|
+
/** The content to be displayed within the Overlay. A prop pattern with a passed close function that can be used to
|
|
6
|
+
* close the Overlay from the components rendering the content. pass {force: true} to the close function to avoid
|
|
7
|
+
* the onInterruptClose process when using in an uncontrolled state. NOTE: when controlling the open state of the overlay,
|
|
8
|
+
* the close function will have no effect on the open state of the Overlay */
|
|
9
|
+
content: (close: CloseDialogWithOptions) => ReactNode;
|
|
10
|
+
/** the element that should act as a trigger for opening the Overlay */
|
|
11
|
+
children?: ReactElement;
|
|
12
|
+
/** the initial open state of the Overlay */
|
|
13
|
+
defaultOpen?: RadixDialogPrimitive.DialogProps["defaultOpen"];
|
|
14
|
+
/** callback that is fired upon closing of the Overlay calls the close function to continue the closing process.
|
|
15
|
+
* If the close function is not called, the Overlay will not be closed */
|
|
16
|
+
onInterruptClose?: (close: CloseDialog) => void;
|
|
17
|
+
/** callback fired when the Overlay is being closed, if onInterruptClose is specified, it fires if the closing process
|
|
18
|
+
* is continued by calling the close function within the callback passed to onInterruptClose.
|
|
19
|
+
* */
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
open?: boolean;
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
/** when true, renders an unstyled overlay filling the Overlays parent container */
|
|
26
|
+
overlay?: boolean;
|
|
27
|
+
/** className to be applied to the overlay component */
|
|
28
|
+
overlayClass?: string;
|
|
29
|
+
/** style object to be applied to the overlay component */
|
|
30
|
+
overlayStyle?: CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
/** The Overlay component is a versatile UI element designed to provide a layer above the existing content.
|
|
33
|
+
* It serves various purposes such as modals, popovers, tooltips, or any other temporary or context-based UI overlay.*/
|
|
34
|
+
export declare const Overlay: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<OverlayProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Overlay";
|
package/dist/Dialogs/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Triggers the dialog to close */
|
|
2
2
|
export type CloseDialog = () => void;
|
|
3
|
+
export interface CloseDialogOptions {
|
|
4
|
+
/** Bypass the `onCloseInterrupt` and force the dialog to close */
|
|
5
|
+
force?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type CloseDialogWithOptions = (options?: CloseDialogOptions) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
interface DownloadButtonUtilityProps {
|
|
3
|
+
children: ReactElement;
|
|
4
|
+
file: File;
|
|
5
|
+
}
|
|
6
|
+
export declare const DownloadButtonUtility: import("react").MemoExoticComponent<(props: DownloadButtonUtilityProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DownloadButtonUtility";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropsWithClassNameAndStyle } from "../typings";
|
|
3
3
|
import { SlideOutV3Props } from "../SlideOutV3";
|
|
4
|
-
export interface
|
|
4
|
+
export interface LayoutOverlayProps extends PropsWithClassNameAndStyle {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
side: SlideOutV3Props["side"];
|
|
7
7
|
smallModeOnly?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const SlideOutOverlay: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<
|
|
9
|
+
export declare const SlideOutOverlay: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<LayoutOverlayProps & import("react").RefAttributes<HTMLDivElement>>>;
|
package/dist/Layout/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const Layout: {
|
|
3
3
|
Root: import("react").MemoExoticComponent<(props: import("./Root").RootProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
Container: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("./Container").ContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
5
|
-
SlideOutOverlay: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./SlideOutOverlay").
|
|
5
|
+
SlideOutOverlay: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./SlideOutOverlay").LayoutOverlayProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
6
6
|
LeftSlideOut: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./SlideOut").LayoutSlideOutProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
7
7
|
RightSlideOut: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./SlideOut").LayoutSlideOutProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
8
8
|
SlideOutTrigger: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./SlideOutTrigger").SlideOutTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OvermapItemProps } from "./typings";
|
|
3
|
+
/** The OvermapItem component is supposed to be used as a Base Component to layout content in an item-like format. It
|
|
4
|
+
* supports responsive sizing and slot props to insert content to the left and right of its children. */
|
|
5
|
+
export declare const OvermapItem: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<OvermapItemProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode, ComponentProps } from "react";
|
|
2
|
+
import { Flex } from "@radix-ui/themes";
|
|
3
|
+
import { OvermapResponsive } from "../typings";
|
|
4
|
+
type FlexProps = ComponentProps<typeof Flex>;
|
|
5
|
+
export interface SizeDependableProps {
|
|
6
|
+
gap: FlexProps["gap"];
|
|
7
|
+
px: FlexProps["px"];
|
|
8
|
+
height: FlexProps["height"];
|
|
9
|
+
fontSize: string;
|
|
10
|
+
}
|
|
11
|
+
export type OvermapItemSizes = "1" | "2" | "3" | "4" | "5";
|
|
12
|
+
export interface OvermapItemProps extends Omit<HTMLProps<HTMLDivElement>, "ref" | "width" | "height" | "wrap" | "size"> {
|
|
13
|
+
/** content to be rendered on the left of any children */
|
|
14
|
+
leftSlot?: ReactNode;
|
|
15
|
+
/** content to be rendered on the right of any children */
|
|
16
|
+
rightSlot?: ReactNode;
|
|
17
|
+
/** supports five different sizes, changing the overall proportions of the OvermapItem including font size. */
|
|
18
|
+
size?: OvermapResponsive<OvermapItemSizes>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as Toggle from "@radix-ui/react-toggle";
|
|
3
|
+
import { ButtonStyleProps } from "../Buttons/typings";
|
|
4
|
+
interface ToggleButtonProps extends Toggle.ToggleProps, ButtonStyleProps {
|
|
5
|
+
"aria-label": string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ToggleButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ToggleButtonProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ToggleButton";
|