@geoinsight/react-components 1.1.3 → 1.1.5

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 (121) hide show
  1. package/dist/cjs/components/button/index.d.ts +9 -0
  2. package/dist/cjs/components/button/index.stories.d.ts +19 -0
  3. package/dist/cjs/components/button/index.types.d.ts +50 -0
  4. package/dist/cjs/components/checkbox/index.d.ts +4 -0
  5. package/dist/cjs/components/checkbox/index.stories.d.ts +10 -0
  6. package/dist/cjs/components/checkbox/index.types.d.ts +48 -0
  7. package/dist/cjs/components/form/form-input.d.ts +4 -0
  8. package/dist/cjs/components/form/form-select.d.ts +4 -0
  9. package/dist/cjs/components/form/form-text-area.d.ts +4 -0
  10. package/dist/cjs/components/form/index.d.ts +4 -0
  11. package/dist/cjs/components/form/index.stories.d.ts +10 -0
  12. package/dist/cjs/components/form/index.types.d.ts +72 -0
  13. package/dist/cjs/components/input/index.d.ts +4 -0
  14. package/dist/cjs/components/input/index.stories.d.ts +13 -0
  15. package/dist/cjs/components/input/index.types.d.ts +56 -0
  16. package/dist/cjs/components/loading/index.d.ts +4 -0
  17. package/dist/cjs/components/loading/index.stories.d.ts +6 -0
  18. package/dist/cjs/components/loading/index.types.d.ts +11 -0
  19. package/dist/cjs/components/menu/index.d.ts +11 -0
  20. package/dist/cjs/components/menu/index.stories.d.ts +8 -0
  21. package/dist/cjs/components/menu/menu-button.d.ts +21 -0
  22. package/dist/cjs/components/menu/menu-content.d.ts +8 -0
  23. package/dist/cjs/components/menu/menu-item.d.ts +10 -0
  24. package/dist/cjs/components/menu/menu-root.d.ts +21 -0
  25. package/dist/cjs/components/menu/menu-utils.d.ts +1 -0
  26. package/dist/cjs/components/menu/menu-wrapper.d.ts +10 -0
  27. package/dist/cjs/components/modal/index.d.ts +4 -0
  28. package/dist/cjs/components/modal/index.stories.d.ts +11 -0
  29. package/dist/cjs/components/modal/index.types.d.ts +39 -0
  30. package/dist/cjs/components/range/hooks.d.ts +34 -0
  31. package/dist/cjs/components/range/index.d.ts +4 -0
  32. package/dist/cjs/components/range/index.stories.d.ts +10 -0
  33. package/dist/cjs/components/range/index.types.d.ts +22 -0
  34. package/dist/cjs/components/range/range-content.d.ts +16 -0
  35. package/dist/cjs/components/range/range-controls.d.ts +13 -0
  36. package/dist/cjs/components/range/range-thumb.d.ts +12 -0
  37. package/dist/cjs/components/range/values.d.ts +1 -0
  38. package/dist/cjs/components/select/index.d.ts +4 -0
  39. package/dist/cjs/components/select/index.stories.d.ts +10 -0
  40. package/dist/cjs/components/select/index.types.d.ts +53 -0
  41. package/dist/cjs/components/text-area/index.d.ts +5 -0
  42. package/dist/cjs/components/text-area/index.stories.d.ts +10 -0
  43. package/dist/cjs/components/text-area/index.types.d.ts +50 -0
  44. package/dist/cjs/context/loading/index.d.ts +24 -0
  45. package/dist/cjs/context/loading/index.stories.d.ts +8 -0
  46. package/dist/cjs/context/map/index.d.ts +20 -0
  47. package/dist/cjs/context/modal/index.d.ts +29 -0
  48. package/dist/cjs/context/modal/index.stories.d.ts +6 -0
  49. package/dist/cjs/context/theme/index.d.ts +18 -0
  50. package/dist/cjs/decorators/withColorScheme.d.ts +7 -0
  51. package/dist/cjs/decorators/withLoading.d.ts +2 -0
  52. package/dist/cjs/decorators/withMap.d.ts +2 -0
  53. package/dist/cjs/decorators/withModal.d.ts +2 -0
  54. package/dist/cjs/decorators/withWrapper.d.ts +2 -0
  55. package/dist/cjs/index.css +1138 -0
  56. package/dist/cjs/index.d.ts +17 -0
  57. package/dist/cjs/index.js +695 -0
  58. package/dist/cjs/index.js.map +1 -0
  59. package/dist/cjs/utils/html.d.ts +10 -0
  60. package/dist/cjs/utils/palette.d.ts +1 -0
  61. package/dist/esm/components/button/index.d.ts +9 -0
  62. package/dist/esm/components/button/index.stories.d.ts +19 -0
  63. package/dist/esm/components/button/index.types.d.ts +50 -0
  64. package/dist/esm/components/checkbox/index.d.ts +4 -0
  65. package/dist/esm/components/checkbox/index.stories.d.ts +10 -0
  66. package/dist/esm/components/checkbox/index.types.d.ts +48 -0
  67. package/dist/esm/components/form/form-input.d.ts +4 -0
  68. package/dist/esm/components/form/form-select.d.ts +4 -0
  69. package/dist/esm/components/form/form-text-area.d.ts +4 -0
  70. package/dist/esm/components/form/index.d.ts +4 -0
  71. package/dist/esm/components/form/index.stories.d.ts +10 -0
  72. package/dist/esm/components/form/index.types.d.ts +72 -0
  73. package/dist/esm/components/input/index.d.ts +4 -0
  74. package/dist/esm/components/input/index.stories.d.ts +13 -0
  75. package/dist/esm/components/input/index.types.d.ts +56 -0
  76. package/dist/esm/components/loading/index.d.ts +4 -0
  77. package/dist/esm/components/loading/index.stories.d.ts +6 -0
  78. package/dist/esm/components/loading/index.types.d.ts +11 -0
  79. package/dist/esm/components/menu/index.d.ts +11 -0
  80. package/dist/esm/components/menu/index.stories.d.ts +8 -0
  81. package/dist/esm/components/menu/menu-button.d.ts +21 -0
  82. package/dist/esm/components/menu/menu-content.d.ts +8 -0
  83. package/dist/esm/components/menu/menu-item.d.ts +10 -0
  84. package/dist/esm/components/menu/menu-root.d.ts +21 -0
  85. package/dist/esm/components/menu/menu-utils.d.ts +1 -0
  86. package/dist/esm/components/menu/menu-wrapper.d.ts +10 -0
  87. package/dist/esm/components/modal/index.d.ts +4 -0
  88. package/dist/esm/components/modal/index.stories.d.ts +11 -0
  89. package/dist/esm/components/modal/index.types.d.ts +39 -0
  90. package/dist/esm/components/range/hooks.d.ts +34 -0
  91. package/dist/esm/components/range/index.d.ts +4 -0
  92. package/dist/esm/components/range/index.stories.d.ts +10 -0
  93. package/dist/esm/components/range/index.types.d.ts +22 -0
  94. package/dist/esm/components/range/range-content.d.ts +16 -0
  95. package/dist/esm/components/range/range-controls.d.ts +13 -0
  96. package/dist/esm/components/range/range-thumb.d.ts +12 -0
  97. package/dist/esm/components/range/values.d.ts +1 -0
  98. package/dist/esm/components/select/index.d.ts +4 -0
  99. package/dist/esm/components/select/index.stories.d.ts +10 -0
  100. package/dist/esm/components/select/index.types.d.ts +53 -0
  101. package/dist/esm/components/text-area/index.d.ts +5 -0
  102. package/dist/esm/components/text-area/index.stories.d.ts +10 -0
  103. package/dist/esm/components/text-area/index.types.d.ts +50 -0
  104. package/dist/esm/context/loading/index.d.ts +24 -0
  105. package/dist/esm/context/loading/index.stories.d.ts +8 -0
  106. package/dist/esm/context/map/index.d.ts +20 -0
  107. package/dist/esm/context/modal/index.d.ts +29 -0
  108. package/dist/esm/context/modal/index.stories.d.ts +6 -0
  109. package/dist/esm/context/theme/index.d.ts +18 -0
  110. package/dist/esm/decorators/withColorScheme.d.ts +7 -0
  111. package/dist/esm/decorators/withLoading.d.ts +2 -0
  112. package/dist/esm/decorators/withMap.d.ts +2 -0
  113. package/dist/esm/decorators/withModal.d.ts +2 -0
  114. package/dist/esm/decorators/withWrapper.d.ts +2 -0
  115. package/dist/esm/index.css +1138 -0
  116. package/dist/esm/index.d.ts +17 -0
  117. package/dist/esm/index.js +672 -0
  118. package/dist/esm/index.js.map +1 -0
  119. package/dist/esm/utils/html.d.ts +10 -0
  120. package/dist/esm/utils/palette.d.ts +1 -0
  121. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { ButtonAsButton, ButtonAsLink } from "./index.types";
2
+ import "./index.css";
3
+ import { ReactNode } from "react";
4
+ export declare const Anchor: ({ Custom, children, ...rest }: {
5
+ Custom?: import("react").ComponentClass<any, any> | undefined;
6
+ children?: ReactNode[] | undefined;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare function Button({ children, className, icon, isNewWindow, mode, size, as, CustomAnchor, ...rest }: ButtonAsButton | ButtonAsLink): JSX.Element;
9
+ export default Button;
@@ -0,0 +1,19 @@
1
+ import { StoryObj, Meta } from "@storybook/react";
2
+ import { Button } from "./index";
3
+ declare const meta: Meta<typeof Button>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Button>;
6
+ export declare const ButtonPrimaryMedium: Story;
7
+ export declare const ButtonPrimaryLarge: Story;
8
+ export declare const ButtonPrimarySmall: Story;
9
+ export declare const ButtonPrimaryDisabled: Story;
10
+ export declare const ButtonPrimaryWithIcon: Story;
11
+ export declare const ButtonSecondary: Story;
12
+ export declare const ButtonSecondaryWithIcon: Story;
13
+ export declare const ButtonSecondaryDisabled: Story;
14
+ export declare const ButtonIcon: Story;
15
+ export declare const LinkPrimary: Story;
16
+ export declare const LinkSecondary: Story;
17
+ export declare const LinkIcon: Story;
18
+ export declare const LinkOutsideButton: Story;
19
+ export declare const LinkOutsideButtonAsPureLink: Story;
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ type Mode = "primary" | "secondary" | "icon";
3
+ type Size = "small" | "medium" | "large";
4
+ export type ButtonAsButton = Base & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof Base> & {
5
+ as?: "button";
6
+ };
7
+ export type ButtonAsLink = Base & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof Base> & {
8
+ as?: "link";
9
+ };
10
+ export interface Base {
11
+ /**
12
+ * What to put inside the button (string or html elements)
13
+ */
14
+ children?: JSX.Element | string;
15
+ /**
16
+ * Custom css class name
17
+ */
18
+ className?: string;
19
+ /**
20
+ * If you want to add an icon image next to the children. Needs to be an react html element.
21
+ */
22
+ icon?: JSX.Element;
23
+ /**
24
+ * If you want to open a new window on the browser when you click the button. Only applies to html anchor elements.
25
+ */
26
+ isNewWindow?: boolean;
27
+ /**
28
+ * Css mode used to style the button.
29
+ */
30
+ mode?: Mode;
31
+ /**
32
+ * Button size.
33
+ */
34
+ size?: Size;
35
+ /**
36
+ * Button type.
37
+ */
38
+ as?: "button" | "link";
39
+ /**
40
+ * Anchor for the button to follow.
41
+ */
42
+ CustomAnchor?: React.ComponentClass<any>;
43
+ /**
44
+ * Custom background color for storybook.
45
+ */
46
+ backgroundColor?: string;
47
+ /** Link to url */
48
+ link?: string;
49
+ }
50
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Checkbox as CheckboxProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Checkbox({ backgroundColor, classNameCheckbox, classNameGroup, classNameLabel, error, inputRef, isRequired, label, placeholder, styleGroup, ...rest }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Checkbox;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Checkbox } from "./index";
3
+ declare const meta: Meta<typeof Checkbox>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Checkbox>;
6
+ export declare const Primary: Story;
7
+ export declare const Error: Story;
8
+ export declare const WithLabel: Story;
9
+ export declare const WithLabelSpecialClass: Story;
10
+ export declare const WithCustomClassName: Story;
@@ -0,0 +1,48 @@
1
+ import { dataTheme } from "data-theme";
2
+ import { CSSProperties, Ref } from "react";
3
+ import { FieldError, FieldErrorsImpl, Merge } from "react-hook-form";
4
+ export interface Checkbox extends React.InputHTMLAttributes<HTMLInputElement> {
5
+ /** Add custom background color for the input */
6
+ backgroundColor?: string;
7
+ /**
8
+ * Custom css class name.
9
+ */
10
+ classNameCheckbox?: string;
11
+ /**
12
+ * Custom css class name for group wrapper.
13
+ */
14
+ classNameGroup?: string;
15
+ /**
16
+ * Custom css class name for label.
17
+ */
18
+ classNameLabel?: string;
19
+ /**
20
+ * Error message to show when input has an error.
21
+ */
22
+ error?: {
23
+ message?: string | false | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
24
+ is?: boolean;
25
+ };
26
+ /**
27
+ * Ref react element to use
28
+ */
29
+ inputRef?: Ref<HTMLInputElement>;
30
+ /**
31
+ * Sets if input is required or not
32
+ */
33
+ isRequired?: boolean;
34
+ /**
35
+ * Add a label to the input
36
+ */
37
+ label?: string;
38
+ /**
39
+ * Data theme for the html. `${themes}`
40
+ */
41
+ paletteTheme?: dataTheme;
42
+ /**Placeholder text for the input */
43
+ placeholder: string;
44
+ /**
45
+ * Style input group wrapper
46
+ */
47
+ styleGroup?: CSSProperties;
48
+ }
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ import { FormInputs } from "./index.types";
3
+ export declare function FormInput({ name, isRequired, error, defaultValue, ...rest }: FormInputs): import("react/jsx-runtime").JSX.Element;
4
+ export default FormInput;
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ import { FormSelect as FormSelectProps } from "./index.types";
3
+ export declare function FormSelect({ name, isRequired, error, fieldsToReset, label, ...rest }: FormSelectProps): import("react/jsx-runtime").JSX.Element;
4
+ export default FormSelect;
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ import { FormInputs } from "./index.types";
3
+ export declare function FormTextArea({ name, isRequired, error, ...rest }: FormInputs): import("react/jsx-runtime").JSX.Element;
4
+ export default FormTextArea;
@@ -0,0 +1,4 @@
1
+ import { Form as FormProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Form({ children, onSubmit, submitButton, initialState, backgroundColor, ...rest }: FormProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Form;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Form } from "./index";
3
+ declare const meta: Meta<typeof Form>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Form>;
6
+ export declare const InsertForm: Story;
7
+ export declare const UpdateFormWithFullInitialState: Story;
8
+ export declare const OnlyInput: Story;
9
+ export declare const OnlyTextArea: Story;
10
+ export declare const OnlySelectDifferentButton: Story;
@@ -0,0 +1,72 @@
1
+ import { Dispatch, JSXElementConstructor, ReactElement, ReactNode, SetStateAction } from "react";
2
+ import { FieldError, FieldErrorsImpl, FieldValues, Merge, UseFormReturn } from "react-hook-form";
3
+ import { Input } from "../input/index.types";
4
+ import { TextArea } from "../text-area/index.types";
5
+ export interface Form {
6
+ /**
7
+ * Custom css class name.
8
+ */
9
+ className?: string;
10
+ /**
11
+ * In case the form has children to pass.
12
+ */
13
+ children?: ReactNode | ReactNode[];
14
+ /**
15
+ * Function that submits the form
16
+ */
17
+ onSubmit: (data: FieldValues, methods: UseFormReturn, setResult: SetResult) => void;
18
+ /**
19
+ * Text that goes on the submit form button.
20
+ */
21
+ submitButton?: {
22
+ label: string;
23
+ };
24
+ /**
25
+ * Initial state of the form, values that are defaults. Ex: name: "Test", type: "Test Type", subject: "Test Subject", [type]: "Test Type II",
26
+ */
27
+ initialState?: {
28
+ defaultValues?: {
29
+ name?: string;
30
+ type?: string;
31
+ subject?: string;
32
+ customValues?: {
33
+ [key: string]: string;
34
+ };
35
+ };
36
+ };
37
+ /**
38
+ * Custom background color if needed.
39
+ */
40
+ backgroundColor?: string;
41
+ }
42
+ export interface ReactNodeControlled extends ReactElement<any, string | JSXElementConstructor<any>> {
43
+ props: ControlledInput;
44
+ }
45
+ export type ControlledInput = Input & TextArea & {
46
+ name: string;
47
+ error: string;
48
+ };
49
+ export type SetResult = Dispatch<SetStateAction<{
50
+ message?: string;
51
+ isSuccess: boolean;
52
+ }>>;
53
+ export interface FormInputs extends Input {
54
+ name: string;
55
+ isRequired?: boolean;
56
+ error?: {
57
+ message?: string | false | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
58
+ is?: boolean;
59
+ };
60
+ }
61
+ export interface FormSelect {
62
+ name: string;
63
+ isRequired?: boolean;
64
+ label: string;
65
+ options: string[];
66
+ error?: {
67
+ message?: string | false | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
68
+ is?: boolean;
69
+ };
70
+ fieldsToReset?: string[];
71
+ handleSelect: Function;
72
+ }
@@ -0,0 +1,4 @@
1
+ import { Input as InputProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Input({ inputClassName, classNameGroup, error, inputRef, styleGroup, placeholder, label, labelClassName, icon, isRequired, backgroundColor, ...rest }: InputProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Input;
@@ -0,0 +1,13 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Input } from "./index";
3
+ declare const meta: Meta<typeof Input>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Input>;
6
+ export declare const Primary: Story;
7
+ export declare const Error: Story;
8
+ export declare const Search: Story;
9
+ export declare const WithLabel: Story;
10
+ export declare const WithLabelSpecialClass: Story;
11
+ export declare const WithCustomClassName: Story;
12
+ export declare const CustomBackgroundColor: Story;
13
+ export declare const Checkbox: Story;
@@ -0,0 +1,56 @@
1
+ import { dataTheme } from "data-theme";
2
+ import { CSSProperties, ReactNode, Ref } from "react";
3
+ import { FieldError, FieldErrorsImpl, Merge } from "react-hook-form";
4
+ export interface Input extends React.InputHTMLAttributes<HTMLInputElement> {
5
+ /**Placeholder text for the input */
6
+ placeholder: string;
7
+ /**
8
+ * Custom css class name.
9
+ */
10
+ inputClassName?: string;
11
+ /**
12
+ * Custom css class name for group wrapper.
13
+ */
14
+ classNameGroup?: string;
15
+ /**
16
+ * Data theme for the html. `${themes}`
17
+ */
18
+ paletteTheme?: dataTheme;
19
+ /**
20
+ * Error message to show when input has an error.
21
+ */
22
+ error?: {
23
+ message?: string | false | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
24
+ is?: boolean;
25
+ };
26
+ /**
27
+ * Ref react element to use
28
+ */
29
+ inputRef?: Ref<HTMLInputElement>;
30
+ /**
31
+ * Style input group wrapper
32
+ */
33
+ styleGroup?: CSSProperties;
34
+ /**
35
+ * Sets if input is required or not
36
+ */
37
+ isRequired?: boolean;
38
+ /**
39
+ * Add a label to the input
40
+ */
41
+ label?: string;
42
+ /**
43
+ * Styles the label of the input
44
+ */
45
+ labelClassName?: string;
46
+ /**
47
+ * Add an icon to the right or the left of the input
48
+ */
49
+ icon?: {
50
+ className?: string;
51
+ element?: ReactNode;
52
+ position?: "right" | "left";
53
+ };
54
+ /** Add custom background color for the input */
55
+ backgroundColor?: string;
56
+ }
@@ -0,0 +1,4 @@
1
+ import { Loading as LoadingProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Loading({ img, children }: LoadingProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Loading;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Loading } from "./index";
3
+ declare const meta: Meta<typeof Loading>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Loading>;
6
+ export declare const Primary: Story;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export interface Loading {
3
+ /**
4
+ * Either pass an image or gif or nothing at all. Passing an empty string will break the component.
5
+ */
6
+ img?: string;
7
+ /**
8
+ * Message that its sent: string or number
9
+ */
10
+ children?: React.ReactNode;
11
+ }
@@ -0,0 +1,11 @@
1
+ import { MenuButton } from "./menu-button";
2
+ import { MenuContent } from "./menu-content";
3
+ import { MenuItem } from "./menu-item";
4
+ import { MenuRoot } from "./menu-root";
5
+ export declare const Menu: {
6
+ Root: typeof MenuRoot;
7
+ Item: typeof MenuItem;
8
+ Button: typeof MenuButton;
9
+ Content: typeof MenuContent;
10
+ };
11
+ export default Menu;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import Menu from ".";
3
+ declare const meta: Meta<typeof Menu>;
4
+ type Story = StoryObj<typeof Menu>;
5
+ export declare const Simple: Story;
6
+ export declare const PrimaryOpenByDefault: Story;
7
+ export declare const SecondaryClosedByDefault: Story;
8
+ export default meta;
@@ -0,0 +1,21 @@
1
+ /** React */
2
+ import React, { HtmlHTMLAttributes, ReactNode } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type Props = HtmlHTMLAttributes<HTMLDivElement> & {
7
+ anchor?: React.AnchorHTMLAttributes<HTMLAnchorElement> & {
8
+ Custom?: React.ComponentClass<any>;
9
+ };
10
+ children: ReactNode;
11
+ buttonClassName?: string;
12
+ nested?: boolean;
13
+ subnested?: boolean;
14
+ dropdown?: boolean;
15
+ isLink?: boolean;
16
+ isSelected?: boolean;
17
+ handleCallbackClick?: () => void;
18
+ "data-menu-id"?: string;
19
+ };
20
+ export declare function MenuButton({ anchor, children, buttonClassName, nested, subnested, dropdown, isLink, isSelected, handleCallbackClick, ...props }: Props): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,8 @@
1
+ /** React */
2
+ import { HTMLAttributes } from "react";
3
+ /** Props */
4
+ type Props = HTMLAttributes<HTMLDivElement> & {
5
+ "data-menu-id"?: string | undefined;
6
+ };
7
+ export declare function MenuContent({ children, ...props }: Props): import("react/jsx-runtime").JSX.Element | undefined;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ /** React */
2
+ import { HtmlHTMLAttributes, ReactNode } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type Props = HtmlHTMLAttributes<HTMLDivElement> & {
7
+ children: ReactNode;
8
+ };
9
+ export declare function MenuItem({ children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,21 @@
1
+ /** React */
2
+ import React, { ReactNode } from "react";
3
+ /** Types */
4
+ type Item = {
5
+ id: string;
6
+ isExpanded: boolean;
7
+ };
8
+ /** Context type */
9
+ type MenuContextType = {
10
+ items: Record<string, Item>;
11
+ addItem: (item: Item) => void;
12
+ toggle: (id: string) => void;
13
+ };
14
+ /** Props */
15
+ type MenuRootProps = {
16
+ children: ReactNode;
17
+ isOpenByDefault?: true;
18
+ };
19
+ export declare function MenuRoot({ children, isOpenByDefault }: MenuRootProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function useMenu(): React.Context<MenuContextType>;
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare const generateId: () => string;
@@ -0,0 +1,10 @@
1
+ /** React */
2
+ import { ReactNode } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type MenuWrapperProps = {
7
+ children: ReactNode;
8
+ };
9
+ export declare function MenuWrapper({ children }: MenuWrapperProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Modal as ModalProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Modal({ className, modalref, children, title, subtitle, footer, hasOverlay, hasCloseButton, handleClose, ...rest }: ModalProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Modal;
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Modal } from "./index";
3
+ declare const meta: Meta<typeof Modal>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Modal>;
6
+ export declare const PrimaryWithOverlay: Story;
7
+ export declare const TitleAndSubtitle: Story;
8
+ export declare const WithoutOverlay: Story;
9
+ export declare const WithFooter: Story;
10
+ export declare const WithFooterAndSubtitle: Story;
11
+ export declare const WithoutCloseButton: Story;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ export interface Modal {
3
+ /**
4
+ * Custom css class name.
5
+ */
6
+ className?: string;
7
+ /**
8
+ * Children
9
+ */
10
+ children?: React.ReactNode;
11
+ /**
12
+ * Modal footer
13
+ */
14
+ footer?: React.ReactNode;
15
+ /**
16
+ * Close click function
17
+ */
18
+ handleClose?: any;
19
+ /**
20
+ * Modal close button
21
+ */
22
+ hasCloseButton?: boolean;
23
+ /**
24
+ * Overlay div
25
+ */
26
+ hasOverlay?: boolean;
27
+ /**
28
+ * Modal body ref
29
+ */
30
+ modalref?: React.LegacyRef<HTMLDivElement>;
31
+ /**
32
+ * Subtitle of the modal
33
+ */
34
+ subtitle?: React.ReactNode;
35
+ /**
36
+ * Title of the modal
37
+ */
38
+ title?: React.ReactNode;
39
+ }
@@ -0,0 +1,34 @@
1
+ import { MutableRefObject } from "react";
2
+ /** Props */
3
+ type Props = {
4
+ allPositions?: number[];
5
+ handlePosition: (pixelPosition: number, thumbPosition: number, index: number, isHandleSelected: boolean) => void;
6
+ handleOverContent: (value: string | number | undefined) => void;
7
+ values: string[] | number[];
8
+ };
9
+ type TimerProps = Props & {
10
+ indexPosition: number;
11
+ };
12
+ type ThumbProps = Props & {
13
+ panelRef: MutableRefObject<null>;
14
+ };
15
+ export declare function usePositions(panelRef: MutableRefObject<null>, initial: number): {
16
+ panelRef: MutableRefObject<null>;
17
+ allPositions: number[] | undefined;
18
+ setAllPositions: import("react").Dispatch<import("react").SetStateAction<number[] | undefined>>;
19
+ pixelPosition: string | undefined;
20
+ setPixelPosition: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
21
+ thumbPosition: string | undefined;
22
+ setThumbPosition: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
23
+ };
24
+ export declare function getThumbBounds(): DOMRect;
25
+ export declare function useTimer({ allPositions, indexPosition, handlePosition, handleOverContent, values, }: TimerProps): {
26
+ isPlay: boolean;
27
+ setIsPlay: import("react").Dispatch<import("react").SetStateAction<boolean>>;
28
+ handlePlay: () => void;
29
+ handleStop: () => void;
30
+ };
31
+ export declare function useThumb({ allPositions, panelRef, handlePosition, handleOverContent, values, }: ThumbProps): {
32
+ handleDownThumb: () => void;
33
+ };
34
+ export {};
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ import { Range as RangeProps } from "./index.types";
3
+ export declare function Range({ initial, period, values, handleSelected }: RangeProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Range;
@@ -0,0 +1,10 @@
1
+ import { StoryObj, Meta } from "@storybook/react";
2
+ import { Range } from "./index";
3
+ declare const meta: Meta<typeof Range>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Range>;
6
+ export declare const RangeMonths: Story;
7
+ export declare const RangeTimestamps: Story;
8
+ export declare const RangeTimestampsPeriod: Story;
9
+ export declare const RangeTimestampsInitialValue: Story;
10
+ export declare const RangeUseCase: Story;
@@ -0,0 +1,22 @@
1
+ export interface Range {
2
+ /**
3
+ * Initial value for range
4
+ */
5
+ initial?: number;
6
+ /**
7
+ * Function that handles any external logic
8
+ */
9
+ handleSelected?: (obj: {
10
+ value?: string | number;
11
+ index: number;
12
+ position: number;
13
+ }) => void;
14
+ /**
15
+ * Period that seperates the ticks
16
+ */
17
+ period?: number;
18
+ /**
19
+ * Values that populate the range
20
+ */
21
+ values: string[] | number[];
22
+ }
@@ -0,0 +1,16 @@
1
+ /** React */
2
+ import { HtmlHTMLAttributes } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type Props = HtmlHTMLAttributes<HTMLDivElement> & {
7
+ period?: number;
8
+ values: string[] | number[];
9
+ allPositions?: number[];
10
+ handlePosition: (pixelPosition: number, thumbPosition: number, index: number, isHandleSelected?: boolean) => void;
11
+ handleOverContent: (value: string | number | undefined) => void;
12
+ handleOutContent: () => void;
13
+ over: string | number | undefined;
14
+ };
15
+ export declare function RangeContent({ period, values, allPositions, handlePosition, handleOverContent, handleOutContent, over, }: Props): import("react/jsx-runtime").JSX.Element[];
16
+ export {};
@@ -0,0 +1,13 @@
1
+ /** React */
2
+ import { HtmlHTMLAttributes } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type Props = HtmlHTMLAttributes<HTMLDivElement> & {
7
+ indexPosition: number;
8
+ isPlay: boolean;
9
+ handlePlay: () => void;
10
+ handleStop: () => void;
11
+ };
12
+ export declare function RangeControls({ indexPosition, isPlay, handlePlay, handleStop, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ /** React */
2
+ import { HtmlHTMLAttributes } from "react";
3
+ /** CSS */
4
+ import "./index.css";
5
+ /** Props */
6
+ type Props = HtmlHTMLAttributes<HTMLDivElement> & {
7
+ thumbPosition?: string;
8
+ handleOverContent: (value: string | number | undefined) => void;
9
+ handleDownThumb: () => void;
10
+ };
11
+ export declare function RangeThumb({ thumbPosition, handleOverContent, handleDownThumb }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare const DATES: string[];
@@ -0,0 +1,4 @@
1
+ import { Select as SelectProps } from "./index.types";
2
+ import "./index.css";
3
+ export declare function Select({ inputClassName, classNameGroup, options, styleGroup, defaultValue, setFormSelected, clearError, resetForm, onFormBlur, handleSelect, label, labelClassName, error, backgroundColor, isRequired, ...rest }: SelectProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Select;