@overmap-ai/blocks 0.0.1-alpha.9 → 0.0.1

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.
Files changed (65) hide show
  1. package/README.md +2 -26
  2. package/dist/Badge/Badge.d.ts +6 -0
  3. package/dist/Badge/index.d.ts +2 -0
  4. package/dist/Badge/typings.d.ts +8 -0
  5. package/dist/ButtonGroup/ButtonGroup.d.ts +7 -0
  6. package/dist/ButtonGroup/context.d.ts +5 -0
  7. package/dist/ButtonGroup/index.d.ts +2 -0
  8. package/dist/ButtonGroup/typings.d.ts +33 -0
  9. package/dist/Buttons/Button.d.ts +4 -0
  10. package/dist/Buttons/IconButton.d.ts +8 -0
  11. package/dist/Buttons/constants.d.ts +2 -0
  12. package/dist/Buttons/index.d.ts +3 -0
  13. package/dist/Buttons/typings.d.ts +16 -0
  14. package/dist/Dialogs/AlertDialog/AlertDialog.d.ts +11 -0
  15. package/dist/Dialogs/AlertDialog/AlertDialogContent.d.ts +4 -0
  16. package/dist/Dialogs/AlertDialog/context.d.ts +8 -0
  17. package/dist/Dialogs/AlertDialog/hooks.d.ts +1 -0
  18. package/dist/Dialogs/AlertDialog/index.d.ts +3 -0
  19. package/dist/Dialogs/AlertDialog/typings.d.ts +49 -0
  20. package/dist/Dialogs/Dialog/Dialog.d.ts +7 -0
  21. package/dist/Dialogs/Dialog/DialogContent.d.ts +3 -0
  22. package/dist/Dialogs/Dialog/index.d.ts +1 -0
  23. package/dist/Dialogs/Dialog/typings.d.ts +33 -0
  24. package/dist/Dialogs/index.d.ts +2 -0
  25. package/dist/Dialogs/typings.d.ts +2 -0
  26. package/dist/Input/Input.d.ts +3 -0
  27. package/dist/Input/index.d.ts +2 -0
  28. package/dist/Input/typings.d.ts +13 -0
  29. package/dist/MultiSelect/MultiSelect.d.ts +27 -0
  30. package/dist/MultiSelect/MultiSelectItem.d.ts +14 -0
  31. package/dist/MultiSelect/index.d.ts +1 -0
  32. package/dist/Popover/Popover.d.ts +3 -0
  33. package/dist/Popover/index.d.ts +1 -0
  34. package/dist/Popover/typings.d.ts +17 -0
  35. package/dist/Select/Select.d.ts +3 -0
  36. package/dist/Select/index.d.ts +2 -0
  37. package/dist/Select/typings.d.ts +22 -0
  38. package/dist/Switch/Switch.d.ts +7 -0
  39. package/dist/Switch/index.d.ts +2 -0
  40. package/dist/Switch/typings.d.ts +13 -0
  41. package/dist/Text/Text.d.ts +24 -0
  42. package/dist/Text/index.d.ts +1 -0
  43. package/dist/TextArea/TextArea.d.ts +7 -0
  44. package/dist/TextArea/index.d.ts +2 -0
  45. package/dist/TextArea/typings.d.ts +15 -0
  46. package/dist/Theme/DefaultTheme.d.ts +4 -0
  47. package/dist/Theme/index.d.ts +2 -0
  48. package/dist/Toast/Toast.d.ts +3 -0
  49. package/dist/Toast/ToastContext.d.ts +4 -0
  50. package/dist/Toast/ToastProvider.d.ts +4 -0
  51. package/dist/Toast/index.d.ts +4 -0
  52. package/dist/Toast/typings.d.ts +45 -0
  53. package/dist/ToggleGroup/ToggleGroup.d.ts +7 -0
  54. package/dist/ToggleGroup/index.d.ts +2 -0
  55. package/dist/ToggleGroup/typings.d.ts +7 -0
  56. package/dist/blocks.js +679 -1
  57. package/dist/blocks.js.map +1 -1
  58. package/dist/blocks.umd.cjs +5 -1
  59. package/dist/blocks.umd.cjs.map +1 -1
  60. package/dist/constants.d.ts +2 -0
  61. package/dist/index.d.ts +20 -0
  62. package/dist/style.css +1 -0
  63. package/dist/typings.d.ts +3 -0
  64. package/dist/utils.d.ts +11 -0
  65. package/package.json +81 -67
package/README.md CHANGED
@@ -1,27 +1,3 @@
1
- # React + TypeScript + Vite
1
+ # overmap-ai blocks
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
-
14
- - Configure the top-level `parserOptions` property like this:
15
-
16
- ```js
17
- parserOptions: {
18
- ecmaVersion: 'latest',
19
- sourceType: 'module',
20
- project: ['./tsconfig.json', './tsconfig.node.json'],
21
- tsconfigRootDir: __dirname,
22
- },
23
- ```
24
-
25
- - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
26
- - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
27
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
3
+ Contains basic components used by overmap-ai libraries.
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import { BadgeProps } from "./typings.ts";
3
+ /** The Badge Component is a user interface element that provides visual feedback, typically displaying a small amount
4
+ * of information. It is commonly used to indicate counts, statuses, or labels in a concise and visually appealing
5
+ * manner. This Badge components wraps the Badge component from Radix-ui found here https://www.radix-ui.com/themes/docs/components/badge */
6
+ export declare const Badge: FC<BadgeProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./Badge";
2
+ export * from "./typings.ts";
@@ -0,0 +1,8 @@
1
+ import { ComponentProps } from "react";
2
+ import { Badge as RadixBadge, MarginProps } from "@radix-ui/themes";
3
+ import { Severity } from "../typings.ts";
4
+ export interface BadgeProps extends Omit<ComponentProps<typeof RadixBadge>, keyof MarginProps> {
5
+ /** The severity of the Badge, supports all global severities. Note that specifying a severity will overwrite any
6
+ * color passed into the Badge component. */
7
+ severity?: Severity;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { ButtonGroupProps } from "./typings.ts";
3
+ /** The ButtonGroup Component is a user interface element that groups multiple buttons together for improved user
4
+ * interaction and visual clarity. It is commonly used to present related actions or options in a compact and organized
5
+ * manner. The ButtonGroup supports all props of the RadixUI Flex layout component besides MarginProps,
6
+ * further documentation for the Flex layout component can be found here https://www.radix-ui.com/themes/docs/components/flex */
7
+ export declare const ButtonGroup: FC<ButtonGroupProps>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "../Buttons/typings";
3
+ export type ButtonContextType = Pick<ButtonProps, "variant" | "size" | "severity" | "hoverEffects" | "fluid">;
4
+ export declare const ButtonGroupContext: import("react").Context<ButtonContextType>;
5
+ export declare const useButtonGroupContext: () => ButtonContextType;
@@ -0,0 +1,2 @@
1
+ export * from "./ButtonGroup";
2
+ export * from "./typings.ts";
@@ -0,0 +1,33 @@
1
+ import { Flex, MarginProps, Responsive } from "@radix-ui/themes";
2
+ import { ComponentProps } from "react";
3
+ import { Severity, Size, Variant } from "../typings.ts";
4
+ import { ButtonHoverEffect } from "../Buttons";
5
+ export interface ButtonGroupProps extends Omit<ComponentProps<typeof Flex>, keyof MarginProps | "size" | "direction" | "asChild"> {
6
+ /** The direction in which the Buttons within the ButtonGroup are stacked
7
+ * @default "row"
8
+ * */
9
+ direction?: "column" | "row";
10
+ /** The size of the ButtonGroup, will be applied to all Buttons contained within the ButtonGroup
11
+ * @default "medium"
12
+ * */
13
+ size?: Responsive<Size>;
14
+ /** The variant of the ButtonGroup, will be applied to all Buttons contained within the ButtonGroup
15
+ * @default "solid"
16
+ * */
17
+ variant?: Variant;
18
+ /** The severity of the ButtonGroup, will be applied to all Buttons contained within the ButtonGroup
19
+ * @default "primary"
20
+ * */
21
+ severity?: Severity;
22
+ /** The hover effects of the ButtonGroup, will be applied to all Buttons contained within the ButtonGroup */
23
+ hoverEffects?: ButtonHoverEffect[];
24
+ /** When merged the internal borders of the Buttons within the ButtonGroup will be flush with one another,
25
+ * will overwrite gap prop if one is passed in
26
+ * @default false
27
+ * */
28
+ merged?: boolean;
29
+ /** When set to true, all Buttons will fill as much space as possible within the ButtonGroup
30
+ * @default false
31
+ * */
32
+ fluid: boolean;
33
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ButtonProps } from "./typings.ts";
3
+ declare const Button: FC<ButtonProps>;
4
+ export default Button;
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { ButtonProps } from "./typings.ts";
3
+ interface IconButtonProps extends ButtonProps {
4
+ "aria-label": string;
5
+ }
6
+ /** The `IconButton` is a `Button` variant specifically designed for single icons. */
7
+ declare const IconButton: FC<IconButtonProps>;
8
+ export default IconButton;
@@ -0,0 +1,2 @@
1
+ import { ButtonHoverEffect } from "./typings.ts";
2
+ export declare const hoverEffectClassNameMapping: Record<ButtonHoverEffect, string | undefined>;
@@ -0,0 +1,3 @@
1
+ export { default as Button } from "./Button.tsx";
2
+ export { default as IconButton } from "./IconButton.tsx";
3
+ export type { ButtonHoverEffect } from "./typings.ts";
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { Button as RadixButton, MarginProps, Responsive } from "@radix-ui/themes";
3
+ import { Severity, Size, Variant } from "../typings.ts";
4
+ export type RadixButtonProps = React.ComponentProps<typeof RadixButton>;
5
+ export type ButtonHoverEffect = "spin90Clockwise" | "spin180Clockwise" | "spin360Clockwise";
6
+ export interface ButtonProps extends Omit<RadixButtonProps, "size" | "color" | "variant" | keyof MarginProps> {
7
+ children: RadixButtonProps["children"];
8
+ /** @default false */
9
+ fluid?: boolean;
10
+ /** @default solid */
11
+ variant?: Variant;
12
+ /** @default primary */
13
+ severity?: Severity;
14
+ size?: Responsive<Size>;
15
+ hoverEffects?: ButtonHoverEffect[];
16
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { AlertDialogProps } from "./typings";
3
+ /**
4
+ * The AlertDialog is used to confirm an action or prompt the user for a decision.
5
+ * Unlike the Dialog, the AlertDialog is not dismissible by clicking outside of the dialog, nor can it be nested.
6
+ *
7
+ * To use, place the `AlertDialogProvider` at the root of your app and use the `useAlertDialog` hook to open the dialog.
8
+ *
9
+ * To set the content of the dialog, use the `content` prop or pass values for the `title`, `description`, and `onAction` props.
10
+ */
11
+ export declare const AlertDialog: import("react").NamedExoticComponent<AlertDialogProps>;
@@ -0,0 +1,4 @@
1
+ import { AlertDialog } from "@radix-ui/themes";
2
+ import { AlertDialogStandardContent } from "./typings";
3
+ export declare const Title: typeof AlertDialog.Title;
4
+ export declare const AlertDialogContent: (props: AlertDialogStandardContent) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { AlertDialogContextType } from "./typings";
3
+ interface AlertDialogProviderProps {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const AlertDialogContent: import("react").Context<AlertDialogContextType>;
7
+ export declare const AlertDialogProvider: import("react").NamedExoticComponent<AlertDialogProviderProps>;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useAlertDialog: () => import("./typings").AlertDialogContextType;
@@ -0,0 +1,3 @@
1
+ export * from "./AlertDialog";
2
+ export * from "./hooks";
3
+ export * from "./context";
@@ -0,0 +1,49 @@
1
+ import { AlertDialog } from "@radix-ui/themes";
2
+ import { ReactNode } from "react";
3
+ import { CloseDialog } from "../typings";
4
+ import { Severity } from "../../typings.ts";
5
+ interface AlertDialogBaseProps {
6
+ open: boolean;
7
+ setOpen: (open: boolean) => void;
8
+ children?: ReactNode;
9
+ }
10
+ export interface AlertDialogStandardContent {
11
+ /** The title of the Dialog. Should be only a few words. For example: "Delete users" */
12
+ title: string;
13
+ /** The description of the Dialog. Should be longer than the title and explain the consequences of the action. */
14
+ description: string;
15
+ /** Callback when the action button is clicked */
16
+ onAction: () => void;
17
+ /** Callback when the cancel button is clicked */
18
+ onCancel?: CloseDialog;
19
+ /** Textual content of the action button
20
+ * @default Confirm
21
+ */
22
+ actionText?: string;
23
+ /** Textual content of the cancel button
24
+ * @default Cancel
25
+ */
26
+ cancelText?: string;
27
+ /**
28
+ * The severity (color) of the action button.
29
+ * @default primary
30
+ */
31
+ severity?: Exclude<Severity, "info">;
32
+ }
33
+ export interface AlertDialogContentHelpers {
34
+ /** Closes the dialog */
35
+ close: CloseDialog;
36
+ /** Specify the title of the alert. Required for accessability. */
37
+ Title: typeof AlertDialog.Title;
38
+ /** Specify the description of the alert. Required for accessability. */
39
+ Description: typeof AlertDialog.Description;
40
+ }
41
+ export interface AlertDialogCustomContent {
42
+ /** Custom alert content. Be sure to use the provided `Title` and `Description`
43
+ * components to maintain the dialog accessability support */
44
+ content: (helpers: AlertDialogContentHelpers) => ReactNode;
45
+ }
46
+ export type AlertDialogOptions = AlertDialogStandardContent | AlertDialogCustomContent;
47
+ export type AlertDialogProps = AlertDialogBaseProps & AlertDialogOptions;
48
+ export type AlertDialogContextType = (options: AlertDialogOptions) => void;
49
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { DialogProps } from "./typings";
3
+ /**
4
+ * Display or collect information in a modal. Unlike the `AlertDialog`, the `Dialog`'s can be nested
5
+ * and close when clicking outside of the dialog content.
6
+ */
7
+ export declare const Dialog: import("react").NamedExoticComponent<DialogProps>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { DialogContentProps } from "./typings";
3
+ export declare const DialogContent: import("react").NamedExoticComponent<DialogContentProps>;
@@ -0,0 +1 @@
1
+ export * from "./Dialog";
@@ -0,0 +1,33 @@
1
+ import { DialogTrigger, 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;
9
+ type RadixDialogContentProps = React.ComponentProps<typeof DialogContent>;
10
+ export interface DialogProps {
11
+ /** Use the `Trigger` to open the dialog by wrapping it around a button */
12
+ children: (Trigger: typeof DialogTrigger) => ReactNode;
13
+ /** The content of the dialog, which is rendered below the description.
14
+ * Should include buttons to close the dialog.
15
+ */
16
+ content: (close: CloseDialogWithOptions) => ReactNode;
17
+ /** The title of the Dialog should only be a few words */
18
+ title: string;
19
+ /** The description of the Dialog should explain what is happening and possible ramifications. */
20
+ description: string;
21
+ /** Changes the padding of the dialog content
22
+ * @default 3
23
+ */
24
+ size?: RadixDialogContentProps["size"];
25
+ /** Called with the dialog opens. Unlike `onCloseInterrupt`, it does not interrupt the dialog opening */
26
+ onOpen?: () => void;
27
+ /** Interrupts the close process; use the provided `confirmClose` callback to continue the close process. */
28
+ onCloseInterrupt?: (confirmClose: CloseDialog) => void;
29
+ }
30
+ export interface DialogContentProps extends Pick<DialogProps, "title" | "description" | "content"> {
31
+ closeDialog: CloseDialogWithOptions;
32
+ }
33
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./Dialog/";
2
+ export * from "./AlertDialog/";
@@ -0,0 +1,2 @@
1
+ /** Triggers the dialog to close */
2
+ export type CloseDialog = () => void;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { InputProps } from "./typings.ts";
3
+ export declare const Input: FC<InputProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./Input";
2
+ export * from "./typings.ts";
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Responsive, TextField as RadixTextField } from "@radix-ui/themes";
3
+ import { Severity, Size } from "../typings.ts";
4
+ import { MarginProps } from "@radix-ui/themes";
5
+ type TextFieldInputProps = React.ComponentProps<typeof RadixTextField.Input>;
6
+ export interface InputProps extends Omit<TextFieldInputProps, "size" | "color" | "radius" | keyof MarginProps> {
7
+ leftSlot?: React.ReactNode;
8
+ rightSlot?: React.ReactNode;
9
+ size?: Responsive<Size>;
10
+ severity?: Exclude<Severity, "success" | "info">;
11
+ showInputLength?: boolean;
12
+ }
13
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Select } from "@radix-ui/themes";
2
+ import { ComponentProps, FC } from "react";
3
+ import { Severity, Size } from "../typings";
4
+ import { MultiSelectOption } from "./MultiSelectItem";
5
+ type RadixTriggerProps = ComponentProps<typeof Select.Trigger>;
6
+ export interface MultiSelectProps {
7
+ value: string[];
8
+ onValueChange: (value: string[]) => void;
9
+ options: MultiSelectOption[];
10
+ disabled?: boolean;
11
+ /** @default medium */
12
+ size?: Size;
13
+ name?: string;
14
+ placeholder?: string;
15
+ id?: string;
16
+ /** @default surface */
17
+ variant?: Exclude<RadixTriggerProps["variant"], "classic">;
18
+ radius?: RadixTriggerProps["radius"];
19
+ /** @default primary */
20
+ severity?: Severity;
21
+ }
22
+ /**
23
+ * `MultiSelect` does not support being used as an uncontrolled component,
24
+ * hence `onValueChange` and `value` are required.
25
+ */
26
+ export declare const MultiSelect: FC<MultiSelectProps>;
27
+ export {};
@@ -0,0 +1,14 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { SizeMapping } from "../constants";
3
+ import { Size } from "../typings";
4
+ import { Responsive } from "@radix-ui/themes";
5
+ export interface MultiSelectOption {
6
+ label: ReactNode;
7
+ value: string;
8
+ }
9
+ interface MultiSelectItemProps extends MultiSelectOption {
10
+ checked: boolean;
11
+ size?: Responsive<(typeof SizeMapping)[Size]>;
12
+ }
13
+ export declare const MultiSelectItem: FC<MultiSelectItemProps>;
14
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./MultiSelect";
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { PopoverProps } from "./typings.ts";
3
+ export declare const Popover: FC<PopoverProps>;
@@ -0,0 +1 @@
1
+ export * from "./Popover";
@@ -0,0 +1,17 @@
1
+ import React, { ReactNode } from "react";
2
+ import { Popover as RadixPopover } from "@radix-ui/themes";
3
+ type RadixPopoverRootProps = React.ComponentProps<typeof RadixPopover.Root>;
4
+ type RadixPopoverContentProps = React.ComponentProps<typeof RadixPopover.Content>;
5
+ export interface PopoverProps extends Omit<RadixPopoverContentProps, "children" | "content"> {
6
+ /** children will represent the content contained within the popover,
7
+ it is using the RenderProps pattern to pass a 'Close' tag which
8
+ can be used to wrap any components in to close the popover on click of those said components*/
9
+ content: (Close: typeof RadixPopover.Close) => ReactNode;
10
+ /** The component that will cause the popover to show or hide on click depending on its current open state */
11
+ children: ReactNode;
12
+ /** determines if popover should default to open on render */
13
+ defaultOpen?: RadixPopoverRootProps["defaultOpen"];
14
+ /** if true disables interaction with other elements until popover is closed*/
15
+ modal?: RadixPopoverRootProps["modal"];
16
+ }
17
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { SelectProps } from "./typings.ts";
3
+ export declare const Select: FC<SelectProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./Select";
2
+ export * from "./typings.ts";
@@ -0,0 +1,22 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import { Responsive, Select as RadixSelect } from "@radix-ui/themes";
3
+ import { Severity, Size, Variant } from "../typings.ts";
4
+ type RadixSelectItemProps = ComponentProps<typeof RadixSelect.Item>;
5
+ type RadixSelectContentProps = ComponentProps<typeof RadixSelect.Content>;
6
+ export interface SelectItemProps extends Omit<RadixSelectItemProps, "asChild" | "textValue"> {
7
+ itemContent: ReactNode;
8
+ }
9
+ export interface SelectProps extends Omit<ComponentProps<typeof RadixSelect.Root>, "dir" | "open" | "onOpenChange" | "size"> {
10
+ className?: string;
11
+ size?: Responsive<Size>;
12
+ label?: string;
13
+ placeholder?: string;
14
+ fluid?: boolean;
15
+ id?: string;
16
+ side?: RadixSelectContentProps["side"];
17
+ items?: SelectItemProps[];
18
+ severity?: Severity;
19
+ itemSeverity?: Severity;
20
+ variant?: Extract<Variant, "surface" | "ghost" | "soft">;
21
+ }
22
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { SwitchProps } from "./typings.ts";
3
+ /** The Switch Component is a user interface element that allows users to toggle between two states, typically
4
+ * representing "on" and "off" or "enabled" and "disabled". It is commonly used for settings, preferences, or any
5
+ * binary options. This Switch component is a wrapper around the Radix-ui Switch component found here https://www.radix-ui.com/themes/docs/components/switch
6
+ */
7
+ export declare const Switch: FC<SwitchProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./Switch";
2
+ export * from "./typings.ts";
@@ -0,0 +1,13 @@
1
+ import { ComponentProps, ReactElement, ReactNode } from "react";
2
+ import { MarginProps, Switch as RadixSwitch } from "@radix-ui/themes";
3
+ import { Severity } from "../typings.ts";
4
+ interface SwitchIconProps {
5
+ checked: ReactNode;
6
+ unchecked: ReactNode;
7
+ }
8
+ export interface SwitchProps extends Omit<ComponentProps<typeof RadixSwitch>, "radius" | "color" | "asChild" | keyof MarginProps> {
9
+ severity?: Severity;
10
+ /** an icon or icons to be rendered within the Switch thumb on checked and unchecked states */
11
+ icon?: ReactElement | SwitchIconProps;
12
+ }
13
+ export {};
@@ -0,0 +1,24 @@
1
+ import { FC, ForwardRefExoticComponent } from "react";
2
+ import { MarginProps, Text as RadixText } from "@radix-ui/themes";
3
+ import { Severity } from "../typings";
4
+ type RadixTextProps = typeof RadixText extends ForwardRefExoticComponent<infer P> ? P : never;
5
+ export type TextProps = Omit<RadixTextProps, keyof MarginProps | "ref" | "asChild" | "color"> & {
6
+ /** If true, the text will not wrap, but instead will truncate with a text overflow ellipsis.
7
+ * @default false
8
+ */
9
+ noWrap?: boolean;
10
+ severity?: Severity;
11
+ /** @default span */
12
+ as?: RadixTextProps["as"];
13
+ /** @default 3 */
14
+ size?: RadixTextProps["size"];
15
+ };
16
+ /**
17
+ * A foundational text primitive.
18
+ *
19
+ * Use the `as` prop to render text as a `p`, `label`, `div` or `span`. This prop is purely semantic and does not alter visual appearance.
20
+ *
21
+ * For the complete documentation, refer to https://www.radix-ui.com/themes/docs/components/text.
22
+ */
23
+ export declare const Text: FC<TextProps>;
24
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./Text";
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { TextAreaProps } from "./typings.ts";
3
+ /** The TextArea Component is a user interface element that allows users to input and edit multi-line text.
4
+ It is commonly used in forms, chat applications, and other scenarios where longer text inputs are required.
5
+ This TextArea is a wrapper of the RadixUI TextArea component found here https://www.radix-ui.com/themes/docs/components/text-area.
6
+ */
7
+ export declare const TextArea: FC<TextAreaProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./TextArea";
2
+ export * from "./typings.ts";
@@ -0,0 +1,15 @@
1
+ import { ComponentProps } from "react";
2
+ import { TextArea as RadixTextArea, MarginProps } from "@radix-ui/themes";
3
+ import { Severity } from "../typings.ts";
4
+ export interface TextAreaProps extends Omit<ComponentProps<typeof RadixTextArea>, keyof MarginProps | "color"> {
5
+ /** used to set the severity of the TextArea, supports all 5 global severities
6
+ * @default "primary"
7
+ * */
8
+ severity?: Severity;
9
+ /** Renders text to the bottom right of the TextArea to show the current input length in characters
10
+ * @default false
11
+ * */
12
+ showInputLength?: boolean;
13
+ resize: "vertical" | "horizontal" | "both";
14
+ inputLengthTemplate?: string;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { Theme } from "@radix-ui/themes";
2
+ import { ComponentProps, FC } from "react";
3
+ export type DefaultThemeProps = ComponentProps<typeof Theme>;
4
+ export declare const DefaultTheme: FC<DefaultThemeProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./DefaultTheme";
2
+ export { Theme, type ThemeOptions, useThemeContext, updateThemeAppearanceClass } from "@radix-ui/themes";
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { ToastProps } from "./typings";
3
+ export declare const Toast: FC<ToastProps>;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IToastContext } from "./typings";
3
+ export declare const ToastContext: import("react").Context<IToastContext>;
4
+ export declare const useToast: () => IToastContext;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ToastContextProviderProps } from "./typings";
3
+ /** Toasts will be displayed in the top-right handle corner of the screen */
4
+ export declare const ToastProvider: FC<ToastContextProviderProps>;
@@ -0,0 +1,4 @@
1
+ export * from "./Toast";
2
+ export * from "./ToastContext";
3
+ export * from "./ToastProvider";
4
+ export * from "./typings";
@@ -0,0 +1,45 @@
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import { ToastProps as RadixToastProps, ToastProviderProps, ToastViewportProps } from "@radix-ui/react-toast";
3
+ import { Callout } from "@radix-ui/themes";
4
+ import { Severity } from "../typings.ts";
5
+ export interface ToastProps {
6
+ size?: ComponentProps<typeof Callout.Root>["size"];
7
+ /**
8
+ * to indicate the severity of each Toast
9
+ * @default "primary"
10
+ */
11
+ severity?: Severity;
12
+ /** the title of the Toast*/
13
+ title: string;
14
+ /** description of the Toast located underneath the title*/
15
+ description: string;
16
+ /**
17
+ * the icon located to the left of the Toast
18
+ * @default "an 'i' in a circle"
19
+ */
20
+ icon?: ReactNode;
21
+ /**
22
+ * duration that the specific instance of Toast is visible for (in milliseconds)
23
+ * @default 5000
24
+ */
25
+ duration?: RadixToastProps["duration"];
26
+ /** a callback that will trigger when the Toast is closed */
27
+ onClose?: () => void;
28
+ /**
29
+ * Control the sensitivity of the toast for screen readers.
30
+ * For toasts that are the result of a user action, choose `foreground`.
31
+ * Toasts generated from background tasks (ex: Update available) should use `background`.
32
+ * @default "foreground"
33
+ */
34
+ sensitivity?: RadixToastProps["type"];
35
+ }
36
+ export interface ToastContextProviderProps extends ToastProviderProps, Omit<ToastViewportProps, "label" | "asChild"> {
37
+ }
38
+ export type SimpleToastProps = Omit<ToastProps, "severity">;
39
+ export interface IToastContext {
40
+ showToast: (toastMessage: ToastProps) => void;
41
+ showPrimary: (simpleMessage: SimpleToastProps) => void;
42
+ showSuccess: (simpleMessage: SimpleToastProps) => void;
43
+ showInfo: (simpleMessage: SimpleToastProps) => void;
44
+ showError: (simpleMessage: SimpleToastProps) => void;
45
+ }
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { ToggleGroupSingleProps } from "./typings.ts";
3
+ /** The Toggle Group Component is a user interface element that allows users to select a single option from a set of
4
+ * mutually exclusive choices. It is commonly used in situations where users need to make a single selection from a
5
+ * predefined list of options. This component is built using the ButtonGroup and IconButton components in combination
6
+ * with the Radix Toggle Group primitive found here https://www.radix-ui.com/primitives/docs/components/toggle-group */
7
+ export declare const ToggleGroup: FC<ToggleGroupSingleProps>;
@@ -0,0 +1,2 @@
1
+ export * from "./ToggleGroup";
2
+ export * from "./typings.ts";
@@ -0,0 +1,7 @@
1
+ import { ToggleGroupItemProps as RadixToggleGroupItemProps, ToggleGroupSingleProps as RadixToggleGroupSingleProps } from "@radix-ui/react-toggle-group";
2
+ import { ButtonGroupProps } from "../ButtonGroup";
3
+ export interface ToggleGroupItemProps extends Omit<RadixToggleGroupItemProps, "asChild"> {
4
+ }
5
+ export interface ToggleGroupSingleProps extends Omit<RadixToggleGroupSingleProps, "dir" | "orientation">, Omit<ButtonGroupProps, "children" | "defaultValue" | "variant"> {
6
+ items: ToggleGroupItemProps[];
7
+ }