sesame-components-testing 2.0.10 → 2.0.12

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.
@@ -0,0 +1 @@
1
+ export declare const Basic: import("react/jsx-runtime").JSX.Element;
package/dist/Basic.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Basic = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ exports.Basic = (0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: 'green' }, children: "Basic" });
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './SesameComponent';
2
2
  export * from './Button/Button';
3
3
  export * from './Icon';
4
4
  export * from './theme';
5
+ export * from './Basic';
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ __exportStar(require("./SesameComponent"), exports);
18
18
  __exportStar(require("./Button/Button"), exports);
19
19
  __exportStar(require("./Icon"), exports);
20
20
  __exportStar(require("./theme"), exports);
21
+ __exportStar(require("./Basic"), exports);
@@ -7,9 +7,9 @@ const react_2 = require("react");
7
7
  const getSizedTheme_1 = require("./sizes/getSizedTheme");
8
8
  const useBreakpointSize_1 = require("./useBreakpointSize");
9
9
  const useSizedTheme = (theme, defaultSize) => {
10
- const size = (0, useBreakpointSize_1.useBreakpointSize)();
10
+ const size = (0, useBreakpointSize_1.useBreakpointSize)(defaultSize);
11
11
  return (0, react_2.useMemo)(() => {
12
- return (0, getSizedTheme_1.getSizedTheme)(theme, size, defaultSize);
12
+ return (0, getSizedTheme_1.getSizedTheme)(theme, size);
13
13
  }, [size, theme, defaultSize]);
14
14
  };
15
15
  const ThemeProvider = ({ theme, defaultSize, children }) => {
@@ -1,3 +1,3 @@
1
1
  import type { Breakpoint, BreakpointSize, Theme } from '../types';
2
2
  export type UnsizedTheme = Omit<Theme, keyof Breakpoint>;
3
- export declare const getSizedTheme: (theme: Theme | UnsizedTheme, size?: BreakpointSize, defaultSize?: BreakpointSize) => Theme;
3
+ export declare const getSizedTheme: (theme: Theme | UnsizedTheme, size: BreakpointSize) => Theme;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSizedTheme = void 0;
4
- const getSizedTheme = (theme, size, defaultSize = 'large') => {
5
- const breakpoint = theme.breakpoints[size !== null && size !== void 0 ? size : defaultSize];
4
+ const getSizedTheme = (theme, size) => {
5
+ const breakpoint = theme.breakpoints[size];
6
6
  return Object.assign(Object.assign({}, theme), breakpoint);
7
7
  };
8
8
  exports.getSizedTheme = getSizedTheme;
@@ -1,3 +1,3 @@
1
1
  type BreakpointSize = 'small' | 'medium' | 'large';
2
- export declare const useBreakpointSize: () => BreakpointSize;
2
+ export declare const useBreakpointSize: (defaultSize?: BreakpointSize) => BreakpointSize;
3
3
  export {};
@@ -9,12 +9,12 @@ const getBreakpointSize = (width) => {
9
9
  return 'medium';
10
10
  return 'small';
11
11
  };
12
- const useBreakpointSize = () => {
12
+ const useBreakpointSize = (defaultSize = 'large') => {
13
13
  const [breakpointSize, setBreakpointSize] = (0, react_1.useState)(() => {
14
14
  if (typeof window !== 'undefined') {
15
15
  return getBreakpointSize(window.innerWidth);
16
16
  }
17
- return 'large';
17
+ return defaultSize;
18
18
  });
19
19
  (0, react_1.useEffect)(() => {
20
20
  const handleResize = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sesame-components-testing",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "A reusable npm component package.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",