@thecb/components 9.2.0-beta.10 → 9.2.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.2.0-beta.10",
3
+ "version": "9.2.0-beta.11",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -4,7 +4,7 @@ import Text from "../../atoms/text";
4
4
  import Paragraph from "../../atoms/paragraph";
5
5
  import { Box } from "../../atoms/layouts";
6
6
  import ButtonWithAction from "../../atoms/button-with-action";
7
- import { useOutsideClick } from "../../../util";
7
+ import { useOutsideClick } from "../../../hooks";
8
8
  import { noop } from "../../../util/general";
9
9
  import { fallbackValues } from "./Popover.theme";
10
10
 
@@ -9,7 +9,7 @@ import {
9
9
  ERROR_COLOR
10
10
  } from "../../../constants/colors";
11
11
  import { generateShadows } from "../../../util/generateShadows";
12
- import useScrollTo from "../../../util/useScrollTo";
12
+ import { useScrollTo } from "../../../hooks";
13
13
 
14
14
  const TermsAndConditionsControlV2 = ({
15
15
  showCheckbox = true,
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from "react";
2
2
  import ToastNotification from "./ToastNotification";
3
3
  import page from "../../../../.storybook/page";
4
- import { useToastNotification } from "../../../util";
4
+ import { useToastNotification } from "../../../hooks";
5
5
  import { ToastVariants } from "../../../types/common";
6
6
 
7
7
  export const toastNotificationSuccess = () => {
@@ -38,13 +38,13 @@ export const toastNotificationError = () => {
38
38
  toastVariant,
39
39
  toastMessage,
40
40
  showToast,
41
- hideToast,
41
+ hideToast
42
42
  } = useToastNotification();
43
43
 
44
44
  useEffect(() => {
45
45
  showToast({
46
46
  message: "An error occurred",
47
- variant: ToastVariants.ERROR,
47
+ variant: ToastVariants.ERROR
48
48
  });
49
49
  }, []);
50
50
 
@@ -61,7 +61,7 @@ toastNotificationError.storyName = "Error Toast";
61
61
 
62
62
  const story = page({
63
63
  title: "Components|Molecules/ToastNotification",
64
- Component: ToastNotification,
64
+ Component: ToastNotification
65
65
  });
66
66
 
67
67
  export default story;
@@ -0,0 +1,3 @@
1
+ export { default as useOutsideClick } from "./use-outside-click";
2
+ export { default as useScrollTo } from "./use-scroll-to";
3
+ export { default as useToastNotification } from "./use-toast-notification";
@@ -1,4 +1,4 @@
1
- import { ToastVariants } from "../../../types/common";
1
+ import { ToastVariants } from "../../types/common";
2
2
 
3
3
  export interface UseToastOptions {
4
4
  timeout?: number;
package/src/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as constants from "./constants";
2
- import * as hooks from "./util/hooks";
2
+ import * as hooks from "./hooks";
3
3
  export * from "./components";
4
4
  export * from "./types/common";
5
5
  export { constants, hooks };
package/src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./components";
2
2
  import * as constants from "./constants";
3
3
  import * as util from "./util";
4
- export { constants, util };
4
+ import * as hooks from "./hooks";
5
+ export { constants, util, hooks };
package/src/util/index.js CHANGED
@@ -2,8 +2,8 @@ import * as formats from "./formats";
2
2
  import * as general from "./general";
3
3
  import * as theme from "./themeUtils";
4
4
  import useFocusInvalidInput from "./focusFirstInvalidInputHook";
5
- import useOutsideClick from "./useOutsideClick";
6
- import useToastNotification from "./hooks/use-toast-notification";
5
+ import useOutsideClick from "../hooks/use-outside-click";
6
+ import useToastNotification from "../hooks/use-toast-notification";
7
7
 
8
8
  export {
9
9
  formats,
@@ -1 +0,0 @@
1
- export { default as useToastNotification } from "./use-toast-notification";