pentatrion-design 0.0.13 → 0.0.14

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 (53) hide show
  1. package/README.md +1 -1
  2. package/components/autocomplete/Autocomplete.d.ts +1 -1
  3. package/components/badge/Badge.d.ts +1 -1
  4. package/components/button/Button.d.ts +1 -1
  5. package/components/button/Button.js +1 -1
  6. package/components/button/LinkButton.d.ts +1 -1
  7. package/components/button/LinkButton.js +1 -1
  8. package/components/dialog/Dialog.d.ts +1 -1
  9. package/components/dialog/Dialog.js +1 -1
  10. package/components/dropdown-menu/interface.d.ts +10 -0
  11. package/components/dropdown-menu/interface.js +1 -0
  12. package/components/dropdown-menu/useDropdownMenu.d.ts +1 -1
  13. package/components/dropdown-menu/useDropdownMenuContext.d.ts +1 -1
  14. package/components/flash/Flash.d.ts +1 -1
  15. package/components/input/Checkbox.d.ts +1 -1
  16. package/components/input/Color.d.ts +1 -1
  17. package/components/input/Input.d.ts +1 -1
  18. package/components/input/Input.js +2 -2
  19. package/components/input/RadioGroup.d.ts +1 -1
  20. package/components/input/RadioGroup.js +1 -1
  21. package/components/input/Range.d.ts +1 -1
  22. package/components/input/Toggle.d.ts +1 -1
  23. package/components/input-field/InputField.js +1 -1
  24. package/components/loader/Loader.d.ts +1 -1
  25. package/components/loader/Loader.js +1 -1
  26. package/components/modal/interface.d.ts +7 -0
  27. package/components/modal/interface.js +1 -0
  28. package/components/modal/useModal.d.ts +1 -1
  29. package/components/modal/useModalContext.d.ts +1 -1
  30. package/components/notification/NotificationsContext.d.ts +1 -1
  31. package/components/popover/interface.d.ts +10 -0
  32. package/components/popover/interface.js +1 -0
  33. package/components/popover/usePopover.d.ts +1 -1
  34. package/components/popover/usePopoverContext.d.ts +1 -1
  35. package/components/select/interface.d.ts +30 -0
  36. package/components/select/interface.js +1 -0
  37. package/components/snack/Snack.d.ts +1 -1
  38. package/components/sortable/index.d.ts +1 -1
  39. package/components/sortable/interface.d.ts +11 -0
  40. package/components/sortable/interface.js +1 -0
  41. package/components/textarea/Textarea.d.ts +1 -1
  42. package/components/tooltip/interface.d.ts +12 -0
  43. package/components/tooltip/interface.js +1 -0
  44. package/components/tooltip/useTooltip.d.ts +1 -1
  45. package/components/tooltip/useTooltipContext.d.ts +1 -1
  46. package/index.d.ts +1 -1
  47. package/lib/error.d.ts +1 -1
  48. package/lib/tailwindVariants.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/redux/notification/notificationSlice.d.ts +3 -3
  51. package/redux/notification/useReduxNotifications.d.ts +1 -1
  52. package/types.d.ts +10 -0
  53. package/types.js +1 -0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [Pentatrion Design System](https://storybook.lonlat.pentatrion.com)
1
+ # [Pentatrion Design System](https://design.pentatrion.com)
2
2
 
3
3
  <a href="https://design.pentatrion.com">
4
4
  <img src="https://raw.githubusercontent.com/lhapaipai/pentatrion-design/main/screenshot.png" alt="Pentatrion design system" />
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
2
2
  import type { OptionLike, Option } from "../select";
3
3
  import { AutocompleteOptionProps } from "./AutocompleteOption";
4
4
  import { Placement } from "@floating-ui/react";
5
- import { ThemeColor } from "../../types.d";
5
+ import { ThemeColor } from "../../types";
6
6
  export interface AutocompleteProps<O extends OptionLike = Option> {
7
7
  className?: string;
8
8
  icon?: boolean | ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  interface Props {
4
4
  children: ReactNode;
5
5
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  export interface ButtonProps extends ComponentPropsWithRef<"button"> {
4
4
  withRipple?: boolean;
5
5
  variant?: "contained" | "light" | "outlined" | "text" | "ghost";
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useImperativeHandle, useRef, } from "react";
2
+ import { forwardRef, useImperativeHandle, useRef } from "react";
3
3
  import clsx from "clsx";
4
4
  import { Loader } from "../loader";
5
5
  import { useRipple } from "../../hooks";
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  export interface LinkButtonProps extends ComponentPropsWithRef<"a"> {
4
4
  href: string;
5
5
  withRipple?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useImperativeHandle, useRef, } from "react";
2
+ import { forwardRef, useImperativeHandle, useRef } from "react";
3
3
  import clsx from "clsx";
4
4
  import { useRipple } from "../../hooks";
5
5
  import { buttonVariants } from "./Button";
@@ -1,6 +1,6 @@
1
1
  import { Placement } from "@floating-ui/react";
2
2
  import { ComponentProps, ReactNode } from "react";
3
- import type { ThemeColor } from "../../types.d";
3
+ import type { ThemeColor } from "../../types";
4
4
  interface Props extends ComponentProps<"div"> {
5
5
  color?: ThemeColor;
6
6
  placement?: Placement;
@@ -16,5 +16,5 @@ export const dialogVariants = {
16
16
  },
17
17
  };
18
18
  export function Dialog({ placement, color, children, className, ...rest }) {
19
- return (_jsx("div", { className: clsx("rounded-2xl relative shadow dark:shadow-dark", dialogVariants.color(color), className), "data-placement": placement, "data-color": color, ...rest, children: children }));
19
+ return (_jsx("div", { className: clsx("relative rounded-2xl shadow dark:shadow-dark", dialogVariants.color(color), className), "data-placement": placement, "data-color": color, ...rest, children: children }));
20
20
  }
@@ -0,0 +1,10 @@
1
+ import { Placement } from "@floating-ui/react";
2
+ import { ThemeColor } from "../../types";
3
+ export interface DropdownMenuOptions {
4
+ initialOpen?: boolean;
5
+ placement?: Placement;
6
+ open?: boolean;
7
+ onOpen?: (open: boolean) => void;
8
+ color?: ThemeColor | "default";
9
+ modal?: boolean;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,7 @@ import type { DropdownMenuOptions } from "./interface";
2
2
  export declare function useDropdownMenu({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, color, modal, }: DropdownMenuOptions): {
3
3
  elementsRef: import("react").MutableRefObject<(HTMLElement | null)[]>;
4
4
  labelsRef: import("react").MutableRefObject<(string | null)[]>;
5
- color: import("./interface").ThemeColor | "default";
5
+ color: import("../..").ThemeColor | "default";
6
6
  modal: boolean;
7
7
  activeIndex: number | null;
8
8
  handleSelect: () => void;
@@ -4,7 +4,7 @@ export declare const DropdownMenuContext: import("react").Context<ContextType>;
4
4
  export declare function useDropdownMenuContext(): {
5
5
  elementsRef: import("react").MutableRefObject<(HTMLElement | null)[]>;
6
6
  labelsRef: import("react").MutableRefObject<(string | null)[]>;
7
- color: import(".").ThemeColor | "default";
7
+ color: import("../..").ThemeColor | "default";
8
8
  modal: boolean;
9
9
  activeIndex: number | null;
10
10
  handleSelect: () => void;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  interface Props {
4
4
  color?: ThemeColor;
5
5
  children?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { type ThemeColor } from "../../types.d";
2
+ import { type ThemeColor } from "../../types";
3
3
  export interface CheckboxProps extends ComponentPropsWithRef<"input"> {
4
4
  indeterminate?: boolean;
5
5
  disabled?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
- import type { ThemeColor } from "../../types.d";
2
+ import type { ThemeColor } from "../../types";
3
3
  export interface ColorProps extends ComponentProps<"button"> {
4
4
  withRipple?: boolean;
5
5
  value?: string;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from "react";
2
- import type { ThemeColor } from "../../types.d";
2
+ import type { ThemeColor } from "../../types";
3
3
  export interface InputProps extends Omit<ComponentPropsWithRef<"input">, "prefix"> {
4
4
  variant?: "normal" | "ghost";
5
5
  disabled?: boolean;
@@ -7,10 +7,10 @@ export const inputConfig = {
7
7
  };
8
8
  export const Input = forwardRef(({ variant = "normal", color = "yellow", disabled = false, prefix, suffix, className, ...rest }, ref) => {
9
9
  return (_jsxs("div", { "data-color": color, "data-variant": variant, className: clsx(inputConfig.container, disabled && "disabled", className), children: [prefix && (_jsx("div", { className: clsx([
10
- "flex-center relative",
10
+ "relative flex-center",
11
11
  typeof prefix === "string" && "mx-2 select-none text-gray-6",
12
12
  ]), children: prefix })), _jsx("input", { ref: ref, className: clsx(inputConfig.input, !prefix && "pl-4", !suffix && "pr-4"), ...rest, disabled: disabled }), suffix && (_jsx("div", { className: clsx([
13
- "flex-center relative",
13
+ "relative flex-center",
14
14
  typeof suffix === "string" && "mx-2 select-none text-gray-6",
15
15
  ]), children: suffix }))] }));
16
16
  });
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { type ThemeColor } from "../../types.d";
2
+ import { type ThemeColor } from "../../types";
3
3
  interface RadioProps extends ComponentPropsWithRef<"input"> {
4
4
  disabled?: boolean;
5
5
  color?: ThemeColor;
@@ -5,7 +5,7 @@ import clsx from "clsx";
5
5
  export const Radio = forwardRef(({ disabled = false, color = "yellow", checked, children, name, className, ...rest }, ref) => {
6
6
  const inputRef = useRef(null);
7
7
  const combinedRef = useCombinedRefs(inputRef, ref);
8
- return (_jsxs("label", { className: clsx("flex items-center cursor-pointer", disabled && "disabled"), children: [_jsx("input", { "data-color": color, ref: combinedRef, disabled: disabled, type: "radio", className: clsx("p8n-input-radio", "appearance-none p-0 inline-block bg-origin-border select-none shrink-0 cursor-pointer h-5 w-5 bg-gray-0 my-0 mr-1 rounded-full", className), checked: checked, name: name, ...rest }), children] }));
8
+ return (_jsxs("label", { className: clsx("flex cursor-pointer items-center", disabled && "disabled"), children: [_jsx("input", { "data-color": color, ref: combinedRef, disabled: disabled, type: "radio", className: clsx("p8n-input-radio", "my-0 mr-1 inline-block h-5 w-5 shrink-0 cursor-pointer select-none appearance-none rounded-full bg-gray-0 bg-origin-border p-0", className), checked: checked, name: name, ...rest }), children] }));
9
9
  });
10
10
  const placementVariants = {
11
11
  inline: "flex gap-2",
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  export interface RangeProps extends Omit<ComponentPropsWithRef<"input">, "value" | "min" | "max" | "step"> {
4
4
  value: number;
5
5
  min?: number;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef } from "react";
2
- import { type ThemeColor } from "../../types.d";
2
+ import { type ThemeColor } from "../../types";
3
3
  export interface ToggleProps extends ComponentPropsWithRef<"input"> {
4
4
  disabled?: boolean;
5
5
  color?: ThemeColor;
@@ -6,7 +6,7 @@ const InputFieldBase = ({ label, hint, help, error, warning, as, ...rest }, ref)
6
6
  const id = useId();
7
7
  const Element = as || defaultElement;
8
8
  const labelElement = label && _jsx("span", { className: "font-bold", children: label });
9
- const hintElement = hint && (_jsx("span", { className: "ml-auto text-sm text-gray-6", children: hint }));
9
+ const hintElement = hint && _jsx("span", { className: "ml-auto text-sm text-gray-6", children: hint });
10
10
  const errorElement = error && typeof error !== "boolean" && (_jsxs("span", { className: "font-medium text-red-4 dark:text-red-2", children: [_jsx("i", { className: "fe-circle-exclamation" }), _jsx("span", { children: error })] }));
11
11
  const warningElement = warning && typeof warning !== "boolean" && (_jsxs("span", { className: "font-medium text-orange-4 dark:text-orange-2", children: [_jsx("i", { className: "fe-circle-exclamation" }), _jsx("span", { children: warning })] }));
12
12
  const color = error ? "red" : warning ? "orange" : "yellow";
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithoutRef } from "react";
2
- import { ThemeColor } from "../../types.d";
2
+ import { ThemeColor } from "../../types";
3
3
  interface Props extends ComponentPropsWithoutRef<"svg"> {
4
4
  size?: "small" | "medium" | "large";
5
5
  color?: ThemeColor;
@@ -24,5 +24,5 @@ const circleStyle = {
24
24
  };
25
25
  export function Loader({ size = "medium", color = "blue", className, ...rest }) {
26
26
  const id = useId();
27
- return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: clsx("inline-block", sizeConfig[size], colorVariants[color].text, className), viewBox: "0 0 16 16", ...rest, children: [_jsx("defs", { children: _jsx("circle", { id: id, cx: "8", cy: "8", r: "7" }) }), _jsx("use", { href: `#${id}`, className: "opacity-25 fill-none stroke-current", style: trackStyle }), _jsx("use", { href: `#${id}`, className: "fill-none stroke-current animate-loader-stroke", style: circleStyle })] }));
27
+ return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: clsx("inline-block", sizeConfig[size], colorVariants[color].text, className), viewBox: "0 0 16 16", ...rest, children: [_jsx("defs", { children: _jsx("circle", { id: id, cx: "8", cy: "8", r: "7" }) }), _jsx("use", { href: `#${id}`, className: "fill-none stroke-current opacity-25", style: trackStyle }), _jsx("use", { href: `#${id}`, className: "animate-loader-stroke fill-none stroke-current", style: circleStyle })] }));
28
28
  }
@@ -0,0 +1,7 @@
1
+ import { type ThemeColor } from "../../types";
2
+ export interface ModalOptions {
3
+ initialOpen?: boolean;
4
+ open?: boolean;
5
+ onOpen?: (open: boolean) => void;
6
+ color?: ThemeColor | "default";
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { Dispatch, SetStateAction } from "react";
2
2
  import { ModalOptions } from "./interface";
3
3
  export declare function useModal({ initialOpen, open: controlledOpen, onOpen: setControlledOpen, color, }?: ModalOptions): {
4
- color: import("./interface").ThemeColor | "default";
4
+ color: import("../..").ThemeColor | "default";
5
5
  labelId: string | undefined;
6
6
  descriptionId: string | undefined;
7
7
  setLabelId: Dispatch<SetStateAction<string | undefined>>;
@@ -2,7 +2,7 @@ import { useModal } from "./useModal";
2
2
  type ContextType = ReturnType<typeof useModal> | null;
3
3
  export declare const ModalContext: import("react").Context<ContextType>;
4
4
  export declare function useModalContext(): {
5
- color: import("./interface").ThemeColor | "default";
5
+ color: import("../..").ThemeColor | "default";
6
6
  labelId: string | undefined;
7
7
  descriptionId: string | undefined;
8
8
  setLabelId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from "react";
2
- import { Message, MessageOptions } from "../../types.d";
2
+ import { Message, MessageOptions } from "../../types";
3
3
  export declare function createNotificationsManager(setNotifications: Dispatch<SetStateAction<Message[]>>): {
4
4
  addNotification: (content?: string, { expiration, color, canClose, withLoader, }?: MessageOptions) => string;
5
5
  removeNotification: (id: string) => void;
@@ -0,0 +1,10 @@
1
+ import { Placement } from "@floating-ui/react";
2
+ import { ThemeColor } from "../../types";
3
+ export interface PopoverOptions {
4
+ initialOpen?: boolean;
5
+ placement?: Placement;
6
+ open?: boolean;
7
+ onOpen?: (open: boolean) => void;
8
+ color?: ThemeColor;
9
+ modal?: boolean;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { PopoverOptions } from "./interface";
2
2
  export declare function usePopover({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, color, modal, }: PopoverOptions): {
3
3
  arrowRef: import("react").RefObject<HTMLDivElement>;
4
- color: import("./interface").ThemeColor | undefined;
4
+ color: import("../..").ThemeColor | undefined;
5
5
  modal: boolean;
6
6
  labelId: string | undefined;
7
7
  descriptionId: string | undefined;
@@ -3,7 +3,7 @@ type ContextType = ReturnType<typeof usePopover> | null;
3
3
  export declare const PopoverContext: import("react").Context<ContextType>;
4
4
  export declare function usePopoverContext(): {
5
5
  arrowRef: import("react").RefObject<HTMLDivElement>;
6
- color: import("./interface").ThemeColor | undefined;
6
+ color: import("../..").ThemeColor | undefined;
7
7
  modal: boolean;
8
8
  labelId: string | undefined;
9
9
  descriptionId: string | undefined;
@@ -0,0 +1,30 @@
1
+ import { BBox, Geometry } from "geojson";
2
+ export type OptionLike = Option | GeoOption;
3
+ export type Option = {
4
+ type?: "Option";
5
+ value: string | number;
6
+ label: string;
7
+ };
8
+ export type NoDataOption = {
9
+ id: string;
10
+ type: "nodata";
11
+ };
12
+ /** For compatibility with OptionLike. get original types from pentatrion-geo */
13
+ type GeoOption<G extends Geometry | null = Geometry, T extends string = string> = {
14
+ id: string;
15
+ type: "Feature";
16
+ properties: FeatureProperties<T>;
17
+ geometry: G;
18
+ bbox?: BBox | undefined;
19
+ };
20
+ type FeatureProperties<T extends string = string> = {
21
+ id: string;
22
+ /** computed name + short context for input string */
23
+ label: string;
24
+ name: string;
25
+ context: string | null;
26
+ score: number;
27
+ type: T;
28
+ originalProperties?: any;
29
+ };
30
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { Message } from "../../types.d";
1
+ import { Message } from "../../types";
2
2
  export type SnackProps = Partial<Message> & {
3
3
  onRemove?: () => void;
4
4
  };
@@ -1,2 +1,2 @@
1
- export type * from "./types.d";
1
+ export type * from "./interface";
2
2
  export { Sortable } from "./Sortable";
@@ -0,0 +1,11 @@
1
+ export interface SortableItem<I> {
2
+ /** The unique id associated with your item. It's recommended this is the same as the key prop for your list item. */
3
+ id: string | number;
4
+ /** When true, the item is selected using MultiDrag */
5
+ selected?: boolean;
6
+ /** When true, the item is deemed "chosen", which basically just a mousedown event. */
7
+ chosen?: boolean;
8
+ /** When true, it will not be possible to pick this item up in the list. */
9
+ filtered?: boolean;
10
+ data: I;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
- import type { ThemeColor } from "../../types.d";
2
+ import type { ThemeColor } from "../../types";
3
3
  export interface TextareaProps extends ComponentProps<"textarea"> {
4
4
  variant?: "normal" | "ghost";
5
5
  color?: ThemeColor;
@@ -0,0 +1,12 @@
1
+ import { Placement } from "@floating-ui/react";
2
+ import { ThemeColor } from "../../types";
3
+ export interface TooltipOptions {
4
+ initialOpen?: boolean;
5
+ placement?: Placement;
6
+ open?: boolean;
7
+ onOpen?: (open: boolean) => void;
8
+ openDelay?: number;
9
+ closeDelay?: number;
10
+ color?: ThemeColor;
11
+ contentClassName?: string;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { TooltipOptions } from "./interface";
2
2
  export declare function useTooltip({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, openDelay, closeDelay, color, }?: TooltipOptions): {
3
3
  arrowRef: import("react").RefObject<HTMLDivElement>;
4
- color: import("./interface").ThemeColor;
4
+ color: import("../..").ThemeColor;
5
5
  placement: import("@floating-ui/react").Placement;
6
6
  strategy: import("@floating-ui/react").Strategy;
7
7
  middlewareData: import("@floating-ui/react").MiddlewareData;
@@ -3,7 +3,7 @@ type ContextType = ReturnType<typeof useTooltip> | null;
3
3
  export declare const TooltipContext: import("react").Context<ContextType>;
4
4
  export declare function useTooltipContext(): {
5
5
  arrowRef: import("react").RefObject<HTMLDivElement>;
6
- color: import("./interface").ThemeColor;
6
+ color: import("../..").ThemeColor;
7
7
  placement: import("@floating-ui/react-dom").Placement;
8
8
  strategy: import("@floating-ui/react-dom").Strategy;
9
9
  middlewareData: import("@floating-ui/react-dom").MiddlewareData;
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { ThemeColor } from "./types.d";
1
+ export type { ThemeColor } from "./types";
2
2
  export * from "./components/autocomplete";
3
3
  export * from "./components/badge";
4
4
  export * from "./components/button";
package/lib/error.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { MessageOptions } from "../types.d";
1
+ import { MessageOptions } from "../types";
2
2
  export declare function isErrorLike(err: any): err is Error;
3
3
  export declare function parseError(err: any): [string, MessageOptions] | null;
@@ -1,4 +1,4 @@
1
- import { ThemeColor } from "../types.d";
1
+ import { ThemeColor } from "../types";
2
2
  type Variant = {
3
3
  border: string;
4
4
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentatrion-design",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "Hugues Tavernier",
@@ -1,18 +1,18 @@
1
- import { Message } from "../../types.d";
1
+ import { Message } from "../../types";
2
2
  declare const _default: Reducer<State>;
3
3
  export default _default;
4
4
  export declare const messageAdded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[content: string, options?: Partial<Omit<Message, "content" | "id">> | undefined], {
5
5
  id: string;
6
6
  content: string;
7
7
  expiration: number;
8
- color: import("../../types.d").ThemeColor;
8
+ color: import("../../types").ThemeColor;
9
9
  canClose: boolean;
10
10
  withLoader: boolean;
11
11
  }, "notification/messageAdded", never, never>, messageRemoved: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "notification/messageRemoved">, errorAdded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[err: any], {
12
12
  id: string;
13
13
  content: string;
14
14
  expiration: number;
15
- color: import("../../types.d").ThemeColor;
15
+ color: import("../../types").ThemeColor;
16
16
  canClose: boolean;
17
17
  withLoader: boolean;
18
18
  }, "notification/errorAdded", never, never>;
@@ -1,4 +1,4 @@
1
- import { MessageOptions } from "../../types.d";
1
+ import { MessageOptions } from "../../types";
2
2
  export declare function useReduxNotifications(): {
3
3
  notify: (content: string, options?: MessageOptions) => void;
4
4
  notifyError: (err: unknown) => void;
package/types.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export type ThemeColor = "yellow" | "gray" | "red" | "orange" | "green" | "blue";
2
+ export type MessageOptions = Partial<Omit<Message, "content" | "id">>;
3
+ export interface Message {
4
+ id: string;
5
+ content: string;
6
+ expiration: number;
7
+ color: ThemeColor;
8
+ canClose: boolean;
9
+ withLoader: boolean;
10
+ }
package/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};