@geoinsight/react-components 1.0.7 → 1.1.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.
Files changed (218) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/dist/cjs/components/button/index.d.ts +9 -0
  3. package/dist/cjs/components/button/index.stories.d.ts +19 -0
  4. package/dist/cjs/components/button/index.types.d.ts +50 -0
  5. package/dist/cjs/components/form/form-input.d.ts +4 -0
  6. package/dist/cjs/components/form/form-select.d.ts +4 -0
  7. package/dist/cjs/components/form/form-text-area.d.ts +4 -0
  8. package/dist/cjs/components/form/index.d.ts +4 -0
  9. package/dist/cjs/components/form/index.stories.d.ts +10 -0
  10. package/dist/cjs/components/form/index.types.d.ts +72 -0
  11. package/dist/cjs/components/input/index.d.ts +4 -0
  12. package/dist/cjs/components/input/index.stories.d.ts +12 -0
  13. package/dist/cjs/components/input/index.types.d.ts +56 -0
  14. package/dist/cjs/components/loading/index.d.ts +4 -0
  15. package/dist/cjs/components/loading/index.stories.d.ts +6 -0
  16. package/dist/cjs/components/loading/index.types.d.ts +11 -0
  17. package/dist/cjs/components/menu/index.d.ts +11 -0
  18. package/dist/cjs/components/menu/index.stories.d.ts +7 -0
  19. package/dist/cjs/components/menu/menu-button.d.ts +21 -0
  20. package/dist/cjs/components/menu/menu-content.d.ts +8 -0
  21. package/dist/cjs/components/menu/menu-item.d.ts +10 -0
  22. package/dist/cjs/components/menu/menu-root.d.ts +21 -0
  23. package/dist/cjs/components/menu/menu-utils.d.ts +1 -0
  24. package/dist/cjs/components/menu/menu-wrapper.d.ts +10 -0
  25. package/dist/cjs/components/modal/index.d.ts +4 -0
  26. package/dist/cjs/components/modal/index.stories.d.ts +11 -0
  27. package/dist/cjs/components/modal/index.types.d.ts +39 -0
  28. package/dist/cjs/components/range/hooks.d.ts +34 -0
  29. package/dist/cjs/components/range/index.d.ts +4 -0
  30. package/dist/cjs/components/range/index.stories.d.ts +9 -0
  31. package/dist/cjs/components/range/index.types.d.ts +18 -0
  32. package/dist/cjs/components/range/range-content.d.ts +16 -0
  33. package/dist/cjs/components/range/range-controls.d.ts +13 -0
  34. package/dist/cjs/components/range/range-thumb.d.ts +12 -0
  35. package/dist/cjs/components/range/values.d.ts +1 -0
  36. package/dist/cjs/components/select/index.d.ts +4 -0
  37. package/dist/cjs/components/select/index.stories.d.ts +10 -0
  38. package/dist/cjs/components/select/index.types.d.ts +53 -0
  39. package/dist/cjs/components/text-area/index.d.ts +5 -0
  40. package/dist/cjs/components/text-area/index.stories.d.ts +10 -0
  41. package/dist/cjs/components/text-area/index.types.d.ts +50 -0
  42. package/dist/cjs/context/loading/index.d.ts +24 -0
  43. package/dist/cjs/context/loading/index.stories.d.ts +8 -0
  44. package/dist/cjs/context/map/index.d.ts +20 -0
  45. package/dist/cjs/context/modal/index.d.ts +29 -0
  46. package/dist/cjs/context/modal/index.stories.d.ts +6 -0
  47. package/dist/cjs/context/theme/index.d.ts +18 -0
  48. package/dist/cjs/decorators/withColorScheme.d.ts +7 -0
  49. package/dist/cjs/decorators/withLoading.d.ts +2 -0
  50. package/dist/cjs/decorators/withMap.d.ts +2 -0
  51. package/dist/cjs/decorators/withModal.d.ts +2 -0
  52. package/dist/cjs/decorators/withWrapper.d.ts +2 -0
  53. package/dist/cjs/index.css +0 -164
  54. package/dist/cjs/index.d.ts +15 -0
  55. package/dist/cjs/index.js +83 -248
  56. package/dist/cjs/index.js.map +1 -1
  57. package/dist/cjs/utils/html.d.ts +10 -0
  58. package/dist/cjs/utils/palette.d.ts +1 -0
  59. package/dist/esm/components/button/index.d.ts +9 -0
  60. package/dist/esm/components/button/index.stories.d.ts +19 -0
  61. package/dist/esm/components/button/index.types.d.ts +50 -0
  62. package/dist/esm/components/form/form-input.d.ts +4 -0
  63. package/dist/esm/components/form/form-select.d.ts +4 -0
  64. package/dist/esm/components/form/form-text-area.d.ts +4 -0
  65. package/dist/esm/components/form/index.d.ts +4 -0
  66. package/dist/esm/components/form/index.stories.d.ts +10 -0
  67. package/dist/esm/components/form/index.types.d.ts +72 -0
  68. package/dist/esm/components/input/index.d.ts +4 -0
  69. package/dist/esm/components/input/index.stories.d.ts +12 -0
  70. package/dist/esm/components/input/index.types.d.ts +56 -0
  71. package/dist/esm/components/loading/index.d.ts +4 -0
  72. package/dist/esm/components/loading/index.stories.d.ts +6 -0
  73. package/dist/esm/components/loading/index.types.d.ts +11 -0
  74. package/dist/esm/components/menu/index.d.ts +11 -0
  75. package/dist/esm/components/menu/index.stories.d.ts +7 -0
  76. package/dist/esm/components/menu/menu-button.d.ts +21 -0
  77. package/dist/esm/components/menu/menu-content.d.ts +8 -0
  78. package/dist/esm/components/menu/menu-item.d.ts +10 -0
  79. package/dist/esm/components/menu/menu-root.d.ts +21 -0
  80. package/dist/esm/components/menu/menu-utils.d.ts +1 -0
  81. package/dist/esm/components/menu/menu-wrapper.d.ts +10 -0
  82. package/dist/esm/components/modal/index.d.ts +4 -0
  83. package/dist/esm/components/modal/index.stories.d.ts +11 -0
  84. package/dist/esm/components/modal/index.types.d.ts +39 -0
  85. package/dist/esm/components/range/hooks.d.ts +34 -0
  86. package/dist/esm/components/range/index.d.ts +4 -0
  87. package/dist/esm/components/range/index.stories.d.ts +9 -0
  88. package/dist/esm/components/range/index.types.d.ts +18 -0
  89. package/dist/esm/components/range/range-content.d.ts +16 -0
  90. package/dist/esm/components/range/range-controls.d.ts +13 -0
  91. package/dist/esm/components/range/range-thumb.d.ts +12 -0
  92. package/dist/esm/components/range/values.d.ts +1 -0
  93. package/dist/esm/components/select/index.d.ts +4 -0
  94. package/dist/esm/components/select/index.stories.d.ts +10 -0
  95. package/dist/esm/components/select/index.types.d.ts +53 -0
  96. package/dist/esm/components/text-area/index.d.ts +5 -0
  97. package/dist/esm/components/text-area/index.stories.d.ts +10 -0
  98. package/dist/esm/components/text-area/index.types.d.ts +50 -0
  99. package/dist/esm/context/loading/index.d.ts +24 -0
  100. package/dist/esm/context/loading/index.stories.d.ts +8 -0
  101. package/dist/esm/context/map/index.d.ts +20 -0
  102. package/dist/esm/context/modal/index.d.ts +29 -0
  103. package/dist/esm/context/modal/index.stories.d.ts +6 -0
  104. package/dist/esm/context/theme/index.d.ts +18 -0
  105. package/dist/esm/decorators/withColorScheme.d.ts +7 -0
  106. package/dist/esm/decorators/withLoading.d.ts +2 -0
  107. package/dist/esm/decorators/withMap.d.ts +2 -0
  108. package/dist/esm/decorators/withModal.d.ts +2 -0
  109. package/dist/esm/decorators/withWrapper.d.ts +2 -0
  110. package/dist/esm/index.css +0 -164
  111. package/dist/esm/index.d.ts +15 -0
  112. package/dist/esm/index.js +89 -231
  113. package/dist/esm/index.js.map +1 -1
  114. package/dist/esm/utils/html.d.ts +10 -0
  115. package/dist/esm/utils/palette.d.ts +1 -0
  116. package/package.json +1 -5
  117. package/yarn-error.log +12301 -0
  118. package/storybook-static/152.8abc3852.iframe.bundle.js +0 -2
  119. package/storybook-static/152.8abc3852.iframe.bundle.js.LICENSE.txt +0 -1
  120. package/storybook-static/208.291d21a5.iframe.bundle.js +0 -1
  121. package/storybook-static/220.4dc42c27.iframe.bundle.js +0 -2
  122. package/storybook-static/220.4dc42c27.iframe.bundle.js.LICENSE.txt +0 -9
  123. package/storybook-static/264.98d49cd2.iframe.bundle.js +0 -1
  124. package/storybook-static/312.2f98f4ec.iframe.bundle.js +0 -1
  125. package/storybook-static/396.990f5560.iframe.bundle.js +0 -44
  126. package/storybook-static/396.990f5560.iframe.bundle.js.map +0 -1
  127. package/storybook-static/469.cb6076e5.iframe.bundle.js +0 -1
  128. package/storybook-static/552.45824652.iframe.bundle.js +0 -2
  129. package/storybook-static/552.45824652.iframe.bundle.js.LICENSE.txt +0 -9
  130. package/storybook-static/555.3fb6fb46.iframe.bundle.js +0 -1
  131. package/storybook-static/56.9c067d9e.iframe.bundle.js +0 -1
  132. package/storybook-static/640.fb22d04d.iframe.bundle.js +0 -1
  133. package/storybook-static/724.476611a3.iframe.bundle.js +0 -1
  134. package/storybook-static/844.5fbe92f6.iframe.bundle.js +0 -1
  135. package/storybook-static/848.c8cbb771.iframe.bundle.js +0 -1
  136. package/storybook-static/880.b3bec938.iframe.bundle.js +0 -411
  137. package/storybook-static/880.b3bec938.iframe.bundle.js.LICENSE.txt +0 -53
  138. package/storybook-static/880.b3bec938.iframe.bundle.js.map +0 -1
  139. package/storybook-static/896.23340cff.iframe.bundle.js +0 -134
  140. package/storybook-static/896.23340cff.iframe.bundle.js.LICENSE.txt +0 -16
  141. package/storybook-static/896.23340cff.iframe.bundle.js.map +0 -1
  142. package/storybook-static/912.7731826c.iframe.bundle.js +0 -1
  143. package/storybook-static/936.074caa83.iframe.bundle.js +0 -2
  144. package/storybook-static/936.074caa83.iframe.bundle.js.LICENSE.txt +0 -5
  145. package/storybook-static/components-button-index-stories.8947be63.iframe.bundle.js +0 -1
  146. package/storybook-static/components-form-index-stories.539cf993.iframe.bundle.js +0 -1
  147. package/storybook-static/components-input-index-stories.2c44b5fd.iframe.bundle.js +0 -2
  148. package/storybook-static/components-input-index-stories.2c44b5fd.iframe.bundle.js.LICENSE.txt +0 -9
  149. package/storybook-static/components-loading-index-stories.1cd8adfc.iframe.bundle.js +0 -2
  150. package/storybook-static/components-loading-index-stories.1cd8adfc.iframe.bundle.js.LICENSE.txt +0 -9
  151. package/storybook-static/components-map-index-stories.60981082.iframe.bundle.js +0 -1
  152. package/storybook-static/components-menu-index-stories.cf33511f.iframe.bundle.js +0 -1
  153. package/storybook-static/components-modal-index-stories.5e137e54.iframe.bundle.js +0 -2
  154. package/storybook-static/components-modal-index-stories.5e137e54.iframe.bundle.js.LICENSE.txt +0 -9
  155. package/storybook-static/components-select-index-stories.935a9985.iframe.bundle.js +0 -1
  156. package/storybook-static/components-text-area-index-stories.5507a19e.iframe.bundle.js +0 -2
  157. package/storybook-static/components-text-area-index-stories.5507a19e.iframe.bundle.js.LICENSE.txt +0 -9
  158. package/storybook-static/context-loading-index-stories.fa3f7a89.iframe.bundle.js +0 -2
  159. package/storybook-static/context-loading-index-stories.fa3f7a89.iframe.bundle.js.LICENSE.txt +0 -9
  160. package/storybook-static/context-modal-index-stories.9161ad78.iframe.bundle.js +0 -2
  161. package/storybook-static/context-modal-index-stories.9161ad78.iframe.bundle.js.LICENSE.txt +0 -9
  162. package/storybook-static/favicon.svg +0 -7
  163. package/storybook-static/iframe.html +0 -355
  164. package/storybook-static/index.html +0 -127
  165. package/storybook-static/index.json +0 -1
  166. package/storybook-static/main.d84ed3e5.iframe.bundle.js +0 -1
  167. package/storybook-static/project.json +0 -1
  168. package/storybook-static/runtime~main.508d9d16.iframe.bundle.js +0 -1
  169. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
  170. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
  171. package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
  172. package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
  173. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +0 -63
  174. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -18
  175. package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
  176. package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
  177. package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
  178. package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
  179. package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
  180. package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
  181. package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
  182. package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
  183. package/storybook-static/sb-addons/interactions-8/manager-bundle.js +0 -12
  184. package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
  185. package/storybook-static/sb-addons/links-0/manager-bundle.js +0 -3
  186. package/storybook-static/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
  187. package/storybook-static/sb-common-assets/fonts.css +0 -31
  188. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  189. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  190. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  191. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  192. package/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js +0 -1
  193. package/storybook-static/sb-manager/chunk-2IXBUOFS.js +0 -7
  194. package/storybook-static/sb-manager/chunk-INSKDKQB.js +0 -348
  195. package/storybook-static/sb-manager/chunk-NGTUFCUO.js +0 -9
  196. package/storybook-static/sb-manager/chunk-NMB3SATH.js +0 -406
  197. package/storybook-static/sb-manager/chunk-ZEU7PDD3.js +0 -1
  198. package/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +0 -156
  199. package/storybook-static/sb-manager/globals-module-info.js +0 -1
  200. package/storybook-static/sb-manager/globals.js +0 -1
  201. package/storybook-static/sb-manager/index.js +0 -1
  202. package/storybook-static/sb-manager/runtime.js +0 -1
  203. package/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js +0 -1
  204. package/storybook-static/sb-preview/globals.js +0 -1
  205. package/storybook-static/sb-preview/runtime.js +0 -112
  206. package/storybook-static/static/media/code-brackets.2e1112d7.svg +0 -1
  207. package/storybook-static/static/media/colors.a4bd0486.svg +0 -1
  208. package/storybook-static/static/media/comments.a3859089.svg +0 -1
  209. package/storybook-static/static/media/direction.b770f9af.svg +0 -1
  210. package/storybook-static/static/media/flow.edad2ac1.svg +0 -1
  211. package/storybook-static/static/media/loading.cbc96c95.gif +0 -0
  212. package/storybook-static/static/media/plugin.d494b228.svg +0 -1
  213. package/storybook-static/static/media/repo.6d496322.svg +0 -1
  214. package/storybook-static/static/media/spinner_2.6f37ee56.png +0 -0
  215. package/storybook-static/static/media/stackalt.dba9fbb3.svg +0 -1
  216. package/storybook-static/stories-Introduction-stories-mdx.21cb2fa7.iframe.bundle.js +0 -2
  217. package/storybook-static/stories-Introduction-stories-mdx.21cb2fa7.iframe.bundle.js.LICENSE.txt +0 -9
  218. package/storybook-static/stories.json +0 -1
@@ -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,7 @@
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 PrimaryOpenByDefault: Story;
6
+ export declare const SecondaryClosedByDefault: Story;
7
+ 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>): {
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({ period, values, handleSelected }: RangeProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Range;
@@ -0,0 +1,9 @@
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 RangeUseCase: Story;
@@ -0,0 +1,18 @@
1
+ export interface Range {
2
+ /**
3
+ * Function that handles any external logic
4
+ */
5
+ handleSelected?: (obj: {
6
+ value?: string | number;
7
+ index: number;
8
+ position: number;
9
+ }) => void;
10
+ /**
11
+ * Period that seperates the ticks
12
+ */
13
+ period?: number;
14
+ /**
15
+ * Values that populate the range
16
+ */
17
+ values: string[] | number[];
18
+ }
@@ -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;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Select } from "./index";
3
+ declare const meta: Meta<typeof Select>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Select>;
6
+ export declare const Primary: Story;
7
+ export declare const PrimaryLabelAndLabelClass: Story;
8
+ export declare const Error: Story;
9
+ export declare const DifferentDefaultSelectedValue: Story;
10
+ export declare const DifferentClassNameGroup: Story;
@@ -0,0 +1,53 @@
1
+ import { CSSProperties } from "react";
2
+ import { dataTheme } from "data-theme";
3
+ export interface Select extends React.InputHTMLAttributes<HTMLInputElement> {
4
+ /**
5
+ * Custom css class name.
6
+ */
7
+ inputClassName?: string;
8
+ /**
9
+ * Custom css class name for group wrapper.
10
+ */
11
+ classNameGroup?: string;
12
+ /**
13
+ * Data theme for the html. `${themes}`
14
+ */
15
+ paletteTheme?: dataTheme;
16
+ /**
17
+ * Options of the select component.
18
+ */
19
+ options?: string[];
20
+ /**
21
+ * Error message to show when input has an error.
22
+ */
23
+ error: {
24
+ is: boolean;
25
+ message: string;
26
+ };
27
+ /**
28
+ * Style input group wrapper
29
+ */
30
+ styleGroup?: CSSProperties;
31
+ /**Default selected value */
32
+ defaultValue?: string;
33
+ /**
34
+ * Style of the backgroundColor
35
+ */
36
+ backgroundColor?: string;
37
+ /**Pass a custom function to the select */
38
+ handleSelect?: Function;
39
+ /**Pass a custom function to the select */
40
+ setFormSelected?: Function;
41
+ /**Pass a custom function to the select on clear error*/
42
+ clearError?: Function;
43
+ /**Pass a custom function to the select on reset form*/
44
+ resetForm?: Function;
45
+ /**Pass a custom function to the select on form blur, when closing the select*/
46
+ onFormBlur?: Function;
47
+ /**Pass a custom label to the select*/
48
+ label?: string;
49
+ /**Pass a custom class to the label of the select*/
50
+ labelClassName?: string;
51
+ /**Sets if select is required or not*/
52
+ isRequired: boolean;
53
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { TextArea as TextAreaProps } from "./index.types";
3
+ import "./index.css";
4
+ export declare function TextArea({ buttonDisabled, className, disabled, error, hasToggleButton, hideHeight, label, labelClassName, isRequired, placeholder, showHeight, backgroundColor, style, textareaClassName, ...rest }: TextAreaProps): JSX.Element;
5
+ export default TextArea;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { TextArea } from "./index";
3
+ declare const meta: Meta<typeof TextArea>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof TextArea>;
6
+ export declare const Active: Story;
7
+ export declare const Disabled: Story;
8
+ export declare const ActiveWithLabel: Story;
9
+ export declare const ActiveWithConfigurableLabel: Story;
10
+ export declare const NoToggleButton: Story;
@@ -0,0 +1,50 @@
1
+ import { CSSProperties } from "react";
2
+ import { FieldError, FieldErrorsImpl, Merge } from "react-hook-form";
3
+ export interface TextArea {
4
+ /**
5
+ * Custom css class name textarea wrapper.
6
+ */
7
+ className?: string;
8
+ /**
9
+ * Disable prop
10
+ */
11
+ disabled?: boolean;
12
+ /**
13
+ * Error message to show when input has an error.
14
+ */
15
+ error?: {
16
+ message?: string | false | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
17
+ is?: boolean;
18
+ };
19
+ hasToggleButton?: boolean;
20
+ /**
21
+ * Minimum height if toggle button is true
22
+ */
23
+ hideHeight?: string;
24
+ /**
25
+ * Placeholder for textarea html tag
26
+ */
27
+ placeholder?: string;
28
+ /**
29
+ * Maximum height if toggle button is false
30
+ */
31
+ showHeight?: string;
32
+ /**
33
+ * Style textarea group wrapper
34
+ */
35
+ style?: CSSProperties;
36
+ /**
37
+ * Classname of the textarea
38
+ */
39
+ textareaClassName?: string;
40
+ /**Places a text on top of the text-area */
41
+ label?: string;
42
+ /**className of the text on top of the text-area */
43
+ labelClassName?: string;
44
+ /**Shows the full component as disabled */
45
+ buttonDisabled?: boolean;
46
+ /**Changes the background color of the input*/
47
+ backgroundColor?: string;
48
+ /**Makes input text required or not*/
49
+ isRequired: boolean;
50
+ }
@@ -0,0 +1,24 @@
1
+ import React, { ReactNode, RefObject } from "react";
2
+ type State = {
3
+ isLoading: boolean;
4
+ message?: string | React.ReactNode;
5
+ ref?: RefObject<ReactNode>;
6
+ };
7
+ type Context = {
8
+ state: State;
9
+ setRef: (ref: RefObject<ReactNode>) => void;
10
+ setMessage: (message: string) => void;
11
+ startLoading: () => void;
12
+ stopLoading: () => void;
13
+ };
14
+ type LoadingProviderProps = {
15
+ children: React.ReactNode;
16
+ };
17
+ type UseLoadingProps = {
18
+ ref?: RefObject<ReactNode>;
19
+ message?: string;
20
+ };
21
+ declare const LoadingContext: React.Context<Context | undefined>;
22
+ declare function LoadingProvider({ children }: LoadingProviderProps): import("react/jsx-runtime").JSX.Element;
23
+ declare function useLoading({ ref, message }?: UseLoadingProps): Context;
24
+ export { LoadingContext, LoadingProvider, useLoading };
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { LoadingProvider } from ".";
3
+ declare const meta: Meta<typeof LoadingProvider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LoadingProvider>;
6
+ export declare const Basic: Story;
7
+ export declare const CustomMessage: Story;
8
+ export declare const CustomImage: Story;
@@ -0,0 +1,20 @@
1
+ /** React */
2
+ import { Dispatch, ReactNode, SetStateAction } from "react";
3
+ import { Toc } from "../../components/map/index.types";
4
+ /** Context type */
5
+ type MapContextType = {
6
+ state?: {
7
+ currentLayer?: Toc;
8
+ };
9
+ setCurrentLayer: Dispatch<SetStateAction<Toc | undefined>>;
10
+ };
11
+ /** Props */
12
+ type MapProviderProps = {
13
+ children: ReactNode;
14
+ };
15
+ type UseMapProps = {
16
+ defaultLayer?: Toc;
17
+ };
18
+ export declare function MapProvider({ children }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function useMap({ defaultLayer }: UseMapProps): MapContextType;
20
+ export {};
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import Modal from "../../components/modal";
3
+ type Modal = {
4
+ title?: React.ReactNode;
5
+ subtitle?: React.ReactNode;
6
+ content?: React.ReactNode;
7
+ hasCloseButton?: boolean;
8
+ hasOverlay?: boolean;
9
+ hasWindowClose?: boolean;
10
+ footer?: React.ReactNode;
11
+ isCustom?: boolean;
12
+ customRef?: any;
13
+ };
14
+ interface State extends Modal {
15
+ isModal: boolean;
16
+ }
17
+ type Context = {
18
+ state: State;
19
+ openModal: (modal?: Modal) => void;
20
+ closeModal: () => void;
21
+ };
22
+ type ModalProviderProps = {
23
+ children: React.ReactNode;
24
+ };
25
+ type UseModalProps = {};
26
+ declare const ModalContext: React.Context<Context | undefined>;
27
+ declare function ModalProvider({ children }: ModalProviderProps): import("react/jsx-runtime").JSX.Element;
28
+ declare function useModal({}?: UseModalProps): Context;
29
+ export { ModalContext, ModalProvider, useModal };
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { ModalProvider } from ".";
3
+ declare const meta: Meta<typeof ModalProvider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ModalProvider>;
6
+ export declare const Basic: Story;
@@ -0,0 +1,18 @@
1
+ import { DataPalette } from "data-palette";
2
+ import React from "react";
3
+ type DataTheme = "light" | "dark";
4
+ type State = {
5
+ dataTheme?: DataTheme;
6
+ switchDataTheme: (mode: DataTheme) => void;
7
+ dataPalette?: DataPalette;
8
+ switchDataPalette: (mode: DataPalette) => void;
9
+ };
10
+ type ThemeProviderProps = {
11
+ children: React.ReactNode;
12
+ dataTheme?: DataTheme;
13
+ dataPalette?: DataPalette;
14
+ };
15
+ declare const ThemeContext: React.Context<State | undefined>;
16
+ declare function ThemeProvider({ children, dataTheme: dataThemeProp, dataPalette: dataPaletteProp, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
17
+ declare function useTheme(): State;
18
+ export { ThemeContext, ThemeProvider, useTheme };
@@ -0,0 +1,7 @@
1
+ import { StoryContext, StoryFn } from "@storybook/react";
2
+ import "../styles/variables.css";
3
+ export declare const withColorScheme: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Wrapped: ({ Story, context, }: {
5
+ Story: StoryFn;
6
+ context: StoryContext;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { StoryContext, StoryFn } from "@storybook/react";
2
+ export declare const withLoading: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { StoryContext, StoryFn } from "@storybook/react";
2
+ export declare const withMap: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { StoryContext, StoryFn } from "@storybook/react";
2
+ export declare const withModal: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { StoryContext, StoryFn } from "@storybook/react";
2
+ export declare const withWrapper: (Story: StoryFn, context: StoryContext) => import("react/jsx-runtime").JSX.Element;