@kemu-io/hs-react 0.3.0 → 0.3.1

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.
@@ -47,12 +47,17 @@ export interface BaseWidgetProps {
47
47
  onOpenSettings?: () => void;
48
48
  width?: number;
49
49
  height?: number;
50
+ iconWidth?: number;
51
+ iconHeight?: number;
50
52
  showIcon?: boolean;
51
53
  customIcon?: ReactNode;
52
54
  settingsIconColor?: string;
53
55
  customTheme?: Theme;
56
+ svgContainerClassName?: string;
57
+ widgetContainerClassName?: string;
58
+ widgetBodyClassName?: string;
54
59
  }
55
- declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, showIcon, customIcon, settingsIconColor, customTheme, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
60
+ declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, iconWidth, iconHeight, showIcon, customIcon, settingsIconColor, customTheme, svgContainerClassName, widgetContainerClassName, widgetBodyClassName, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
56
61
 
57
62
  export {
58
63
  BaseWidget as default,
@@ -1,6 +1,6 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("@emotion/react"),WidgetContainer_js_1=__importDefault(require("./WidgetContainer.js")),SettingsBar_js_1=__importDefault(require("./SettingsBar.js")),WidgetBody_js_1=__importDefault(require("./WidgetBody.js")),SvgContainer_js_1=__importDefault(require("./SvgContainer.js")),KemuThemeWrapper_js_1=__importDefault(require("./KemuThemeWrapper.js")),BaseWidget=({children:e,showSettings:t=!0,onOpenSettings:i,width:r=84,height:s=134,showIcon:_=!0,customIcon:n,settingsIconColor:o="white",customTheme:u})=>(0,jsx_runtime_1.jsx)(KemuThemeWrapper_js_1.default,{theme:u,children:(0,jsx_runtime_1.jsxs)(WidgetContainer_js_1.default,{width:r,height:s,css:react_1.css`
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("@emotion/react"),WidgetContainer_js_1=__importDefault(require("./WidgetContainer.js")),SettingsBar_js_1=__importDefault(require("./SettingsBar.js")),WidgetBody_js_1=__importDefault(require("./WidgetBody.js")),SvgContainer_js_1=__importDefault(require("./SvgContainer.js")),KemuThemeWrapper_js_1=__importDefault(require("./KemuThemeWrapper.js")),BaseWidget=({children:e,showSettings:t=!0,onOpenSettings:i,width:s=84,height:r=134,iconWidth:n=38,iconHeight:_=38,showIcon:a=!0,customIcon:o,settingsIconColor:u="white",customTheme:l,svgContainerClassName:d,widgetContainerClassName:m,widgetBodyClassName:c})=>(0,jsx_runtime_1.jsx)(KemuThemeWrapper_js_1.default,{theme:l,children:(0,jsx_runtime_1.jsxs)(WidgetContainer_js_1.default,{className:m,width:s,height:r,css:react_1.css`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  justify-content: center;
6
- `,children:[t&&i&&(0,jsx_runtime_1.jsx)(SettingsBar_js_1.default,{iconColor:o,onSettingsClick:i}),(0,jsx_runtime_1.jsxs)(WidgetBody_js_1.default,{children:[_&&n&&(0,jsx_runtime_1.jsx)(SvgContainer_js_1.default,{children:n}),e]})]})});exports.default=BaseWidget;
6
+ `,children:[t&&i&&(0,jsx_runtime_1.jsx)(SettingsBar_js_1.default,{iconColor:u,onSettingsClick:i}),(0,jsx_runtime_1.jsxs)(WidgetBody_js_1.default,{className:c,children:[a&&o&&(0,jsx_runtime_1.jsx)(SvgContainer_js_1.default,{width:n,height:_,className:d,children:o}),e]})]})});exports.default=BaseWidget;
@@ -8,7 +8,7 @@
8
8
  height: 100%;
9
9
  overflow-y: unset;
10
10
  padding: unset;
11
- padding-top: 40px;
11
+ padding-top: 20px;
12
12
  `,Header=styled_1.default.div`
13
13
  line-height: 30px;
14
14
  align-self: center;
@@ -13,8 +13,11 @@ import { ReactNode } from 'react';
13
13
  export interface SvgContainerProps {
14
14
  fill?: string;
15
15
  children?: ReactNode;
16
+ width?: number;
17
+ height?: number;
18
+ className?: string;
16
19
  }
17
- declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
18
21
 
19
22
  export {
20
23
  SvgContainer as default,
@@ -3,7 +3,7 @@
3
3
  margin-top: 10px;
4
4
 
5
5
  svg {
6
- width: 38px;
7
- height: 38px;
6
+ width: ${e=>e.width||38}px;
7
+ height: ${e=>e.height||38}px;
8
8
  }
9
- `,SvgContainer=({fill:e,children:t})=>(0,jsx_runtime_1.jsx)(StyledSvgContainer,{fill:e,children:t});exports.default=SvgContainer;
9
+ `,SvgContainer=({fill:e,children:t,width:i,height:l,className:r})=>(0,jsx_runtime_1.jsx)(StyledSvgContainer,{fill:e,width:i,height:l,className:r,children:t});exports.default=SvgContainer;
@@ -82,12 +82,17 @@ export interface BaseWidgetProps {
82
82
  onOpenSettings?: () => void;
83
83
  width?: number;
84
84
  height?: number;
85
+ iconWidth?: number;
86
+ iconHeight?: number;
85
87
  showIcon?: boolean;
86
88
  customIcon?: React$1.ReactNode;
87
89
  settingsIconColor?: string;
88
90
  customTheme?: Theme;
91
+ svgContainerClassName?: string;
92
+ widgetContainerClassName?: string;
93
+ widgetBodyClassName?: string;
89
94
  }
90
- export declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, showIcon, customIcon, settingsIconColor, customTheme, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
95
+ export declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, iconWidth, iconHeight, showIcon, customIcon, settingsIconColor, customTheme, svgContainerClassName, widgetContainerClassName, widgetBodyClassName, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
91
96
  /**
92
97
  * A checkbox field component with label, wrapped in a horizontal field layout.
93
98
  *
@@ -364,8 +369,11 @@ export declare const SettingsDialog: ({ title, open, noHeader, onClose, onSave,
364
369
  export interface SvgContainerProps {
365
370
  fill?: string;
366
371
  children?: React$1.ReactNode;
372
+ width?: number;
373
+ height?: number;
374
+ className?: string;
367
375
  }
368
- export declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
376
+ export declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
369
377
  /**
370
378
  * A container for widget body content. Provides centered flexbox layout with padding.
371
379
  *
@@ -47,12 +47,17 @@ export interface BaseWidgetProps {
47
47
  onOpenSettings?: () => void;
48
48
  width?: number;
49
49
  height?: number;
50
+ iconWidth?: number;
51
+ iconHeight?: number;
50
52
  showIcon?: boolean;
51
53
  customIcon?: ReactNode;
52
54
  settingsIconColor?: string;
53
55
  customTheme?: Theme;
56
+ svgContainerClassName?: string;
57
+ widgetContainerClassName?: string;
58
+ widgetBodyClassName?: string;
54
59
  }
55
- declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, showIcon, customIcon, settingsIconColor, customTheme, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
60
+ declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, iconWidth, iconHeight, showIcon, customIcon, settingsIconColor, customTheme, svgContainerClassName, widgetContainerClassName, widgetBodyClassName, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
56
61
 
57
62
  export {
58
63
  BaseWidget as default,
@@ -1,6 +1,6 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{css}from"@emotion/react";import WidgetContainer from"./WidgetContainer.js";import SettingsBar from"./SettingsBar.js";import WidgetBody from"./WidgetBody.js";import SvgContainer from"./SvgContainer.js";import KemuThemeWrapper from"./KemuThemeWrapper.js";const BaseWidget=({children:e,showSettings:t=!0,onOpenSettings:i,width:s=84,height:o=134,showIcon:r=!0,customIcon:n,settingsIconColor:m="white",customTheme:c})=>_jsx(KemuThemeWrapper,{theme:c,children:_jsxs(WidgetContainer,{width:s,height:o,css:css`
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{css}from"@emotion/react";import WidgetContainer from"./WidgetContainer.js";import SettingsBar from"./SettingsBar.js";import WidgetBody from"./WidgetBody.js";import SvgContainer from"./SvgContainer.js";import KemuThemeWrapper from"./KemuThemeWrapper.js";const BaseWidget=({children:e,showSettings:t=!0,onOpenSettings:i,width:s=84,height:o=134,iconWidth:n=38,iconHeight:r=38,showIcon:a=!0,customIcon:m,settingsIconColor:c="white",customTheme:d,svgContainerClassName:g,widgetContainerClassName:h,widgetBodyClassName:l})=>_jsx(KemuThemeWrapper,{theme:d,children:_jsxs(WidgetContainer,{className:h,width:s,height:o,css:css`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  justify-content: center;
6
- `,children:[t&&i&&_jsx(SettingsBar,{iconColor:m,onSettingsClick:i}),_jsxs(WidgetBody,{children:[r&&n&&_jsx(SvgContainer,{children:n}),e]})]})});export default BaseWidget;
6
+ `,children:[t&&i&&_jsx(SettingsBar,{iconColor:c,onSettingsClick:i}),_jsxs(WidgetBody,{className:l,children:[a&&m&&_jsx(SvgContainer,{width:n,height:r,className:g,children:m}),e]})]})});export default BaseWidget;
@@ -8,7 +8,7 @@ import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";i
8
8
  height: 100%;
9
9
  overflow-y: unset;
10
10
  padding: unset;
11
- padding-top: 40px;
11
+ padding-top: 20px;
12
12
  `,Header=styled.div`
13
13
  line-height: 30px;
14
14
  align-self: center;
@@ -13,8 +13,11 @@ import { ReactNode } from 'react';
13
13
  export interface SvgContainerProps {
14
14
  fill?: string;
15
15
  children?: ReactNode;
16
+ width?: number;
17
+ height?: number;
18
+ className?: string;
16
19
  }
17
- declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
18
21
 
19
22
  export {
20
23
  SvgContainer as default,
@@ -3,7 +3,7 @@ import{jsx as _jsx}from"react/jsx-runtime";import styled from"@emotion/styled";c
3
3
  margin-top: 10px;
4
4
 
5
5
  svg {
6
- width: 38px;
7
- height: 38px;
6
+ width: ${t=>t.width||38}px;
7
+ height: ${t=>t.height||38}px;
8
8
  }
9
- `,SvgContainer=({fill:t,children:i})=>_jsx(StyledSvgContainer,{fill:t,children:i});export default SvgContainer;
9
+ `,SvgContainer=({fill:t,children:i,width:e,height:l,className:h})=>_jsx(StyledSvgContainer,{fill:t,width:e,height:l,className:h,children:i});export default SvgContainer;
@@ -82,12 +82,17 @@ export interface BaseWidgetProps {
82
82
  onOpenSettings?: () => void;
83
83
  width?: number;
84
84
  height?: number;
85
+ iconWidth?: number;
86
+ iconHeight?: number;
85
87
  showIcon?: boolean;
86
88
  customIcon?: React$1.ReactNode;
87
89
  settingsIconColor?: string;
88
90
  customTheme?: Theme;
91
+ svgContainerClassName?: string;
92
+ widgetContainerClassName?: string;
93
+ widgetBodyClassName?: string;
89
94
  }
90
- export declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, showIcon, customIcon, settingsIconColor, customTheme, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
95
+ export declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, iconWidth, iconHeight, showIcon, customIcon, settingsIconColor, customTheme, svgContainerClassName, widgetContainerClassName, widgetBodyClassName, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
91
96
  /**
92
97
  * A checkbox field component with label, wrapped in a horizontal field layout.
93
98
  *
@@ -364,8 +369,11 @@ export declare const SettingsDialog: ({ title, open, noHeader, onClose, onSave,
364
369
  export interface SvgContainerProps {
365
370
  fill?: string;
366
371
  children?: React$1.ReactNode;
372
+ width?: number;
373
+ height?: number;
374
+ className?: string;
367
375
  }
368
- export declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
376
+ export declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
369
377
  /**
370
378
  * A container for widget body content. Provides centered flexbox layout with padding.
371
379
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kemu-io/hs-react",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "Kemu Hub Service library for React",
6
6
  "author": "Kemu Pty Ltd",
7
7
  "main": "cjs/WidgetWrapper.js",