@kemu-io/hs-react 0.2.39 → 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.
Files changed (75) hide show
  1. package/cjs/WidgetWrapper.d.ts +64 -4
  2. package/cjs/components/BaseWidget.d.ts +66 -0
  3. package/cjs/components/BaseWidget.js +6 -0
  4. package/cjs/components/CheckboxField.d.ts +27 -0
  5. package/cjs/components/CheckboxField.js +3 -0
  6. package/cjs/components/CommonElements.d.ts +9 -0
  7. package/cjs/components/CommonElements.js +1 -0
  8. package/cjs/components/Field.d.ts +25 -0
  9. package/cjs/components/Field.js +9 -0
  10. package/cjs/components/FieldWithLabel.d.ts +35 -0
  11. package/cjs/components/FieldWithLabel.js +1 -0
  12. package/cjs/components/HorizontalField.d.ts +24 -0
  13. package/cjs/components/HorizontalField.js +9 -0
  14. package/cjs/components/KemuLightButton.d.ts +16 -0
  15. package/cjs/components/KemuLightButton.js +43 -0
  16. package/cjs/components/KemuPrimaryButton.d.ts +16 -0
  17. package/cjs/components/KemuPrimaryButton.js +43 -0
  18. package/cjs/components/KemuThemeWrapper.d.ts +44 -0
  19. package/cjs/components/KemuThemeWrapper.js +1 -0
  20. package/cjs/components/SettingsBar.d.ts +36 -0
  21. package/cjs/components/SettingsBar.js +8 -0
  22. package/cjs/components/SettingsDialog.d.ts +81 -0
  23. package/cjs/components/SettingsDialog.js +74 -0
  24. package/cjs/components/SvgContainer.d.ts +26 -0
  25. package/cjs/components/SvgContainer.js +9 -0
  26. package/cjs/components/WidgetBody.d.ts +20 -0
  27. package/cjs/components/WidgetBody.js +9 -0
  28. package/cjs/components/index.d.ts +326 -1
  29. package/cjs/components/index.js +1 -1
  30. package/cjs/hooks/index.d.ts +64 -4
  31. package/cjs/hooks/useOnBroadcastEvent.d.ts +64 -4
  32. package/cjs/hooks/useOnParentEvent.d.ts +64 -4
  33. package/cjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
  34. package/cjs/lib/InstanceContext.d.ts +64 -4
  35. package/cjs/lib/globalContext.d.ts +64 -4
  36. package/cjs/types/context_t.d.ts +64 -4
  37. package/cjs/types/widgetUI_t.d.ts +64 -4
  38. package/mjs/WidgetWrapper.d.ts +64 -4
  39. package/mjs/components/BaseWidget.d.ts +66 -0
  40. package/mjs/components/BaseWidget.js +6 -0
  41. package/mjs/components/CheckboxField.d.ts +27 -0
  42. package/mjs/components/CheckboxField.js +3 -0
  43. package/mjs/components/CommonElements.d.ts +9 -0
  44. package/mjs/components/CommonElements.js +1 -0
  45. package/mjs/components/Field.d.ts +25 -0
  46. package/mjs/components/Field.js +9 -0
  47. package/mjs/components/FieldWithLabel.d.ts +35 -0
  48. package/mjs/components/FieldWithLabel.js +1 -0
  49. package/mjs/components/HorizontalField.d.ts +24 -0
  50. package/mjs/components/HorizontalField.js +9 -0
  51. package/mjs/components/KemuLightButton.d.ts +16 -0
  52. package/mjs/components/KemuLightButton.js +43 -0
  53. package/mjs/components/KemuPrimaryButton.d.ts +16 -0
  54. package/mjs/components/KemuPrimaryButton.js +43 -0
  55. package/mjs/components/KemuThemeWrapper.d.ts +44 -0
  56. package/mjs/components/KemuThemeWrapper.js +1 -0
  57. package/mjs/components/SettingsBar.d.ts +36 -0
  58. package/mjs/components/SettingsBar.js +8 -0
  59. package/mjs/components/SettingsDialog.d.ts +81 -0
  60. package/mjs/components/SettingsDialog.js +74 -0
  61. package/mjs/components/SvgContainer.d.ts +26 -0
  62. package/mjs/components/SvgContainer.js +9 -0
  63. package/mjs/components/WidgetBody.d.ts +20 -0
  64. package/mjs/components/WidgetBody.js +9 -0
  65. package/mjs/components/index.d.ts +326 -1
  66. package/mjs/components/index.js +1 -1
  67. package/mjs/hooks/index.d.ts +64 -4
  68. package/mjs/hooks/useOnBroadcastEvent.d.ts +64 -4
  69. package/mjs/hooks/useOnParentEvent.d.ts +64 -4
  70. package/mjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
  71. package/mjs/lib/InstanceContext.d.ts +64 -4
  72. package/mjs/lib/globalContext.d.ts +64 -4
  73. package/mjs/types/context_t.d.ts +64 -4
  74. package/mjs/types/widgetUI_t.d.ts +64 -4
  75. package/package.json +3 -1
@@ -0,0 +1,74 @@
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("react"),styled_1=__importDefault(require("@emotion/styled")),Dialog_1=__importDefault(require("@mui/material/Dialog")),DialogContent_1=__importDefault(require("@mui/material/DialogContent")),DialogActions_1=__importDefault(require("@mui/material/DialogActions")),IconButton_1=__importDefault(require("@mui/material/IconButton")),re_resizable_1=require("re-resizable"),Fullscreen_1=__importDefault(require("@mui/icons-material/Fullscreen")),FullscreenExit_1=__importDefault(require("@mui/icons-material/FullscreenExit")),KemuThemeWrapper_js_1=__importDefault(require("./KemuThemeWrapper.js")),KemuPrimaryButton_js_1=__importDefault(require("./KemuPrimaryButton.js")),KemuLightButton_js_1=__importDefault(require("./KemuLightButton.js")),ScrollableContainer=styled_1.default.div`
2
+ height: 100%;
3
+ overflow-y: auto;
4
+ padding: 0px 25px;
5
+ // Add extra pixels for the dialog actions
6
+ padding-bottom: 54px;
7
+ `,StyledDialogContent=(0,styled_1.default)(DialogContent_1.default)`
8
+ height: 100%;
9
+ overflow-y: unset;
10
+ padding: unset;
11
+ padding-top: 20px;
12
+ `,Header=styled_1.default.div`
13
+ line-height: 30px;
14
+ align-self: center;
15
+ width: 100%;
16
+ padding: 10px 25px;
17
+ display: flex;
18
+ align-items: center;
19
+ box-sizing: border-box;
20
+ margin-bottom: 0px;
21
+ border-bottom: 1px solid rgba(0, 0, 0, 0.04);
22
+ `,Title=styled_1.default.h4`
23
+ font-size: 16px;
24
+ line-height: 28px;
25
+ padding-right: 10px;
26
+ margin-bottom: 0;
27
+ font-weight: 700;
28
+ font-family: 'Nunito', 'Segoe UI', arial;
29
+ color: #6c757d;
30
+ `,ResizableDialog=(0,styled_1.default)(Dialog_1.default)`
31
+ & .MuiDialog-paper {
32
+ margin: 0;
33
+ position: absolute;
34
+ top: 50%;
35
+ left: 50%;
36
+ transform: translate(-50%, -50%);
37
+ max-width: unset;
38
+ overflow: hidden;
39
+
40
+ /* Kemu modal style */
41
+ border-top-color: var(--kemu-color-primary);
42
+ border-top-style: solid;
43
+ border-top-width: 3px;
44
+ box-shadow: 0 4px 12px 0px rgb(0 0 0 / 28%);
45
+ border-radius: 10px;
46
+ background-clip: border-box;
47
+ }
48
+
49
+ & .MuiModal-backdrop {
50
+ background-color: rgba(0, 0, 0, 0.35);
51
+ }
52
+ `,StyledDialogActions=(0,styled_1.default)(DialogActions_1.default)`
53
+ position: absolute;
54
+ margin-top: 20px;
55
+ width: 100%;
56
+ padding: 0 25px 20px;
57
+ bottom: 0;
58
+ right: 0;
59
+ background-color: white;
60
+ z-index: 2;
61
+ display: flex;
62
+ gap: 20px;
63
+ `,ExpandButton=(0,styled_1.default)(IconButton_1.default)`
64
+ position: absolute;
65
+ top: 8px;
66
+ right: 8px;
67
+ z-index: 2;
68
+ background-color: rgba(255, 255, 255, 0.9);
69
+ backdrop-filter: blur(4px);
70
+
71
+ &:hover {
72
+ background-color: rgba(255, 255, 255, 1);
73
+ }
74
+ `,SettingsDialog=({title:e="Settings",open:t,noHeader:i=!1,onClose:o,onSave:a,children:r,serviceOnline:l=!0,saveDisabled:n=!1,minHeight:s=400,minWidth:d=500,maxWidth:u,maxHeight:_,cancelButtonText:m="Cancel",saveButtonText:p="Save",disableResizing:c=!1,disableExpansion:x=!1,dialogClassName:h,resizableClassName:g,dialogContentClassName:b,dialogActionsClassName:f})=>{const[j,D]=(0,react_1.useState)({width:d,height:s}),[y,C]=(0,react_1.useState)(!1),[w,S]=(0,react_1.useState)({width:d,height:s}),k=(0,react_1.useCallback)(((e,t,i,o)=>{if(c)return;const a={width:i.offsetWidth,height:i.offsetHeight};D(a)}),[c]),v=(0,react_1.useCallback)(((e,t)=>{"backdropClick"!==t&&"escapeKeyDown"!==t&&o()}),[o]),z=(0,react_1.useCallback)((()=>{if(y)D(w),C(!1);else{S(j);const e=window.innerWidth-180,t=window.innerHeight-120-60;D({width:Math.max(d,e),height:Math.max(s,t)}),C(!0)}}),[y,j,w,d,s]),q={pointerEvents:"none"},B=!x,K=!c&&!y,N=(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[!i&&(0,jsx_runtime_1.jsx)(Header,{children:(0,jsx_runtime_1.jsx)(Title,{children:e})}),B&&(0,jsx_runtime_1.jsx)(ExpandButton,{onClick:z,size:"small",children:y?(0,jsx_runtime_1.jsx)(FullscreenExit_1.default,{}):(0,jsx_runtime_1.jsx)(Fullscreen_1.default,{})}),(0,jsx_runtime_1.jsx)(StyledDialogContent,{className:b,children:(0,jsx_runtime_1.jsx)(ScrollableContainer,{children:r})}),(0,jsx_runtime_1.jsxs)(StyledDialogActions,{className:f,children:[(0,jsx_runtime_1.jsx)(KemuLightButton_js_1.default,{onClick:o,children:m}),(0,jsx_runtime_1.jsx)(KemuPrimaryButton_js_1.default,{disabled:!l||n,onClick:a,children:p})]})]});return(0,jsx_runtime_1.jsx)(ResizableDialog,{onClose:v,open:t,className:h,children:(0,jsx_runtime_1.jsx)(KemuThemeWrapper_js_1.default,{children:c?(0,jsx_runtime_1.jsx)("div",{className:g,style:{width:j.width,height:j.height},children:N}):(0,jsx_runtime_1.jsx)(re_resizable_1.Resizable,{enable:{top:K,right:K,bottom:K,left:K,topRight:K,bottomRight:K,bottomLeft:K,topLeft:K},handleStyles:{bottomLeft:q,bottomRight:{zIndex:2},bottom:q,top:q,topLeft:q,topRight:q},minHeight:s,minWidth:d,maxWidth:u,maxHeight:_,size:j,onResizeStop:k,className:g,children:N})})})};exports.default=SettingsDialog;
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ /**
4
+ * Container for SVG icons with customizable fill color.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <SvgContainer fill="blue">
9
+ * <svg>...</svg>
10
+ * </SvgContainer>
11
+ * ```
12
+ */
13
+ export interface SvgContainerProps {
14
+ fill?: string;
15
+ children?: ReactNode;
16
+ width?: number;
17
+ height?: number;
18
+ className?: string;
19
+ }
20
+ declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
21
+
22
+ export {
23
+ SvgContainer as default,
24
+ };
25
+
26
+ export {};
@@ -0,0 +1,9 @@
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"),styled_1=__importDefault(require("@emotion/styled")),StyledSvgContainer=styled_1.default.div`
2
+ fill: ${e=>e.fill||"white"};
3
+ margin-top: 10px;
4
+
5
+ svg {
6
+ width: ${e=>e.width||38}px;
7
+ height: ${e=>e.height||38}px;
8
+ }
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;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A container for widget body content. Provides centered flexbox layout with padding.
3
+ *
4
+ * @example
5
+ * ```tsx
6
+ * <WidgetBody>
7
+ * <div>Widget content</div>
8
+ * </WidgetBody>
9
+ * ```
10
+ */
11
+ declare const WidgetBody: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme;
13
+ as?: React.ElementType;
14
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
+
16
+ export {
17
+ WidgetBody as default,
18
+ };
19
+
20
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const styled_1=__importDefault(require("@emotion/styled")),WidgetBody=styled_1.default.div`
2
+ padding: 10px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ justify-content: center;
7
+ width: 100%;
8
+ height: 100%;
9
+ `;exports.default=WidgetBody;
@@ -1,7 +1,199 @@
1
1
  import { CSSObject } from '@emotion/styled';
2
+ import { Theme } from '@mui/material';
2
3
  import React$1 from 'react';
3
- import { CSSProperties } from 'react';
4
+ import { CSSProperties, ReactNode } from 'react';
4
5
 
6
+ /**
7
+ * A theme wrapper component that provides Kemu's default Material-UI theme.
8
+ * Can be overridden with a custom theme.
9
+ *
10
+ * @example
11
+ * Using default theme:
12
+ * ```tsx
13
+ * <KemuThemeWrapper>
14
+ * <MyComponent />
15
+ * </KemuThemeWrapper>
16
+ * ```
17
+ *
18
+ * @example
19
+ * With custom theme override:
20
+ * ```tsx
21
+ * const customTheme = createTheme({
22
+ * palette: {
23
+ * primary: {
24
+ * main: '#ff0000',
25
+ * },
26
+ * },
27
+ * });
28
+ *
29
+ * <KemuThemeWrapper theme={customTheme}>
30
+ * <MyComponent />
31
+ * </KemuThemeWrapper>
32
+ * ```
33
+ */
34
+ export interface KemuThemeWrapperProps {
35
+ children: React$1.ReactNode;
36
+ theme?: Theme;
37
+ }
38
+ export declare const KemuThemeWrapper: ({ children, theme }: KemuThemeWrapperProps) => import("react/jsx-runtime").JSX.Element;
39
+ /**
40
+ * A base widget component with settings bar, icon support, and customizable layout.
41
+ *
42
+ * @example
43
+ * Basic usage with custom icon:
44
+ * ```tsx
45
+ * const MyIcon = () => <svg>...</svg>;
46
+ *
47
+ * <BaseWidget
48
+ * onOpenSettings={() => setSettingsOpen(true)}
49
+ * customIcon={<MyIcon />}
50
+ * >
51
+ * <div>Widget Content</div>
52
+ * </BaseWidget>
53
+ * ```
54
+ *
55
+ * @example
56
+ * Without settings:
57
+ * ```tsx
58
+ * <BaseWidget
59
+ * showSettings={false}
60
+ * width={100}
61
+ * height={150}
62
+ * >
63
+ * <div>My Widget</div>
64
+ * </BaseWidget>
65
+ * ```
66
+ *
67
+ * @example
68
+ * With custom icon color:
69
+ * ```tsx
70
+ * <BaseWidget
71
+ * onOpenSettings={handleSettings}
72
+ * settingsIconColor="#333"
73
+ * customIcon={<CustomIcon />}
74
+ * >
75
+ * <div>Content</div>
76
+ * </BaseWidget>
77
+ * ```
78
+ */
79
+ export interface BaseWidgetProps {
80
+ children?: React$1.ReactNode;
81
+ showSettings?: boolean;
82
+ onOpenSettings?: () => void;
83
+ width?: number;
84
+ height?: number;
85
+ iconWidth?: number;
86
+ iconHeight?: number;
87
+ showIcon?: boolean;
88
+ customIcon?: React$1.ReactNode;
89
+ settingsIconColor?: string;
90
+ customTheme?: Theme;
91
+ svgContainerClassName?: string;
92
+ widgetContainerClassName?: string;
93
+ widgetBodyClassName?: string;
94
+ }
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;
96
+ /**
97
+ * A checkbox field component with label, wrapped in a horizontal field layout.
98
+ *
99
+ * @example
100
+ * ```tsx
101
+ * const [enabled, setEnabled] = useState(false);
102
+ *
103
+ * <CheckboxField
104
+ * label="Enable feature"
105
+ * checked={enabled}
106
+ * onChange={(checked) => setEnabled(checked)}
107
+ * />
108
+ * ```
109
+ */
110
+ export type CheckboxFieldProps = {
111
+ onChange?: (checked: boolean) => void;
112
+ checked: boolean;
113
+ label: string;
114
+ disabled?: boolean;
115
+ };
116
+ export declare const CheckboxField: (props: CheckboxFieldProps) => import("react/jsx-runtime.js").JSX.Element;
117
+ /**
118
+ * A vertical field container for form elements. Use for stacking form fields vertically.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * <Field mb={20}>
123
+ * <label>Name</label>
124
+ * <input type="text" />
125
+ * </Field>
126
+ * ```
127
+ */
128
+ export interface FieldProps {
129
+ mb?: number;
130
+ mt?: number;
131
+ }
132
+ export declare const Field: import("@emotion/styled").StyledComponent<{
133
+ theme?: import("@emotion/react").Theme;
134
+ as?: React$1.ElementType;
135
+ } & FieldProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
136
+ /**
137
+ * A field component with a built-in label. Use this for simple form fields.
138
+ *
139
+ * @example
140
+ * ```tsx
141
+ * <FieldWithLabel label="Username">
142
+ * <input type="text" />
143
+ * </FieldWithLabel>
144
+ * ```
145
+ *
146
+ * @example
147
+ * With Material-UI components:
148
+ * ```tsx
149
+ * <FieldWithLabel label="Select Option">
150
+ * <Select>
151
+ * <MenuItem value="1">Option 1</MenuItem>
152
+ * </Select>
153
+ * </FieldWithLabel>
154
+ * ```
155
+ */
156
+ export interface FieldWithLabelProps {
157
+ label: string;
158
+ children?: React$1.ReactNode;
159
+ mb?: number;
160
+ mt?: number;
161
+ }
162
+ export declare const FieldWithLabel: ({ label, children, mb, mt }: FieldWithLabelProps) => import("react/jsx-runtime.js").JSX.Element;
163
+ /**
164
+ * A horizontal field container for form elements. Use for placing form fields side by side.
165
+ *
166
+ * @example
167
+ * ```tsx
168
+ * <HorizontalField alignItems="center">
169
+ * <label>Option:</label>
170
+ * <input type="checkbox" />
171
+ * </HorizontalField>
172
+ * ```
173
+ */
174
+ export interface HorizontalFieldProps {
175
+ alignItems?: string;
176
+ }
177
+ export declare const HorizontalField: import("@emotion/styled").StyledComponent<{
178
+ theme?: import("@emotion/react").Theme;
179
+ as?: React$1.ElementType;
180
+ } & HorizontalFieldProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
181
+ export interface KemuLightButtonProps {
182
+ noShadow?: boolean;
183
+ }
184
+ export declare const KemuLightButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent/index.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
185
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
186
+ }, "color" | "disabled" | "children" | "style" | "className" | "size" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loading" | "loadingIndicator" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "href" | "loadingPosition" | "variant"> & {
187
+ theme?: import("@emotion/react").Theme;
188
+ } & KemuLightButtonProps, {}, {}>;
189
+ export interface KemuPrimaryButtonProps {
190
+ noShadow?: boolean;
191
+ }
192
+ export declare const KemuPrimaryButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button/Button.js").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent/index.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
193
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
194
+ }, "color" | "disabled" | "children" | "style" | "className" | "size" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loading" | "loadingIndicator" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "href" | "loadingPosition" | "variant"> & {
195
+ theme?: import("@emotion/react").Theme;
196
+ } & KemuPrimaryButtonProps, {}, {}>;
5
197
  export type ResizableContainerProps = {
6
198
  css?: CSSObject;
7
199
  minWidth?: number;
@@ -63,6 +255,139 @@ export type WrapperProps = {
63
255
  * ```
64
256
  */
65
257
  export declare const ResizableContainer: (props: ResizableContainerProps & WrapperProps) => import("react/jsx-runtime.js").JSX.Element;
258
+ /**
259
+ * A settings bar component with default settings icon. Renders in the top-right corner.
260
+ *
261
+ * @example
262
+ * With default settings icon:
263
+ * ```tsx
264
+ * <SettingsBar
265
+ * iconColor="white"
266
+ * onSettingsClick={() => console.log('Settings clicked')}
267
+ * />
268
+ * ```
269
+ *
270
+ * @example
271
+ * With custom content:
272
+ * ```tsx
273
+ * <SettingsBar iconColor="#333">
274
+ * <IconButton onClick={handleClick}>
275
+ * <CustomIcon />
276
+ * </IconButton>
277
+ * </SettingsBar>
278
+ * ```
279
+ */
280
+ export interface SettingsBarProps {
281
+ iconColor?: string;
282
+ onSettingsClick?: () => void;
283
+ children?: React$1.ReactNode;
284
+ }
285
+ export declare const SettingsBar: ({ iconColor, onSettingsClick, children }: SettingsBarProps) => import("react/jsx-runtime").JSX.Element;
286
+ /**
287
+ * A resizable and expandable settings dialog with customizable buttons and styling.
288
+ *
289
+ * @example
290
+ * Basic usage:
291
+ * ```tsx
292
+ * const [open, setOpen] = useState(false);
293
+ *
294
+ * <SettingsDialog
295
+ * open={open}
296
+ * onClose={() => setOpen(false)}
297
+ * onSave={() => {
298
+ * // Save settings
299
+ * setOpen(false);
300
+ * }}
301
+ * >
302
+ * <FieldWithLabel label="Setting 1">
303
+ * <input type="text" />
304
+ * </FieldWithLabel>
305
+ * </SettingsDialog>
306
+ * ```
307
+ *
308
+ * @example
309
+ * Disable resizing and expansion:
310
+ * ```tsx
311
+ * <SettingsDialog
312
+ * open={open}
313
+ * onClose={() => setOpen(false)}
314
+ * onSave={handleSave}
315
+ * disableResizing={true}
316
+ * disableExpansion={true}
317
+ * >
318
+ * {children}
319
+ * </SettingsDialog>
320
+ * ```
321
+ *
322
+ * @example
323
+ * Custom button text:
324
+ * ```tsx
325
+ * <SettingsDialog
326
+ * open={open}
327
+ * onClose={handleClose}
328
+ * onSave={handleSave}
329
+ * cancelButtonText="Discard"
330
+ * saveButtonText="Apply Changes"
331
+ * >
332
+ * {children}
333
+ * </SettingsDialog>
334
+ * ```
335
+ */
336
+ export interface SettingsDialogProps {
337
+ title?: string;
338
+ open: boolean;
339
+ noHeader?: boolean;
340
+ onClose: () => void;
341
+ onSave: () => void;
342
+ children: React$1.ReactNode;
343
+ serviceOnline?: boolean;
344
+ saveDisabled?: boolean;
345
+ minHeight?: number;
346
+ minWidth?: number;
347
+ maxWidth?: number;
348
+ maxHeight?: number;
349
+ cancelButtonText?: string;
350
+ saveButtonText?: string;
351
+ disableResizing?: boolean;
352
+ disableExpansion?: boolean;
353
+ dialogClassName?: string;
354
+ resizableClassName?: string;
355
+ dialogContentClassName?: string;
356
+ dialogActionsClassName?: string;
357
+ }
358
+ export declare const SettingsDialog: ({ title, open, noHeader, onClose, onSave, children, serviceOnline, saveDisabled, minHeight, minWidth, maxWidth, maxHeight, cancelButtonText, saveButtonText, disableResizing, disableExpansion, dialogClassName, resizableClassName, dialogContentClassName, dialogActionsClassName, }: SettingsDialogProps) => import("react/jsx-runtime.js").JSX.Element;
359
+ /**
360
+ * Container for SVG icons with customizable fill color.
361
+ *
362
+ * @example
363
+ * ```tsx
364
+ * <SvgContainer fill="blue">
365
+ * <svg>...</svg>
366
+ * </SvgContainer>
367
+ * ```
368
+ */
369
+ export interface SvgContainerProps {
370
+ fill?: string;
371
+ children?: React$1.ReactNode;
372
+ width?: number;
373
+ height?: number;
374
+ className?: string;
375
+ }
376
+ export declare const SvgContainer: ({ fill, children, width, height, className }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
377
+ /**
378
+ * A container for widget body content. Provides centered flexbox layout with padding.
379
+ *
380
+ * @example
381
+ * ```tsx
382
+ * <WidgetBody>
383
+ * <div>Widget content</div>
384
+ * </WidgetBody>
385
+ * ```
386
+ */
387
+ export declare const WidgetBody: import("@emotion/styled").StyledComponent<{
388
+ theme?: import("@emotion/react").Theme;
389
+ as?: React$1.ElementType;
390
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
66
391
  type WrapperProps$1 = {
67
392
  cWidth?: number | string;
68
393
  cHeight?: number | string;
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResizableContainer=exports.WidgetContainer=void 0;const WidgetContainer_js_1=__importDefault(require("./WidgetContainer.js"));exports.WidgetContainer=WidgetContainer_js_1.default;const ResizableContainer_js_1=__importDefault(require("./ResizableContainer.js"));exports.ResizableContainer=ResizableContainer_js_1.default;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.KemuLightButton=exports.KemuPrimaryButton=exports.KemuThemeWrapper=exports.BaseWidget=exports.WidgetBody=exports.FieldWithLabel=exports.CheckboxField=exports.HorizontalField=exports.Field=exports.SettingsBar=exports.SvgContainer=exports.SettingsDialog=exports.ResizableContainer=exports.WidgetContainer=void 0;const WidgetContainer_js_1=__importDefault(require("./WidgetContainer.js"));exports.WidgetContainer=WidgetContainer_js_1.default;const ResizableContainer_js_1=__importDefault(require("./ResizableContainer.js"));exports.ResizableContainer=ResizableContainer_js_1.default;const SettingsDialog_js_1=__importDefault(require("./SettingsDialog.js"));exports.SettingsDialog=SettingsDialog_js_1.default;const SvgContainer_js_1=__importDefault(require("./SvgContainer.js"));exports.SvgContainer=SvgContainer_js_1.default;const SettingsBar_js_1=__importDefault(require("./SettingsBar.js"));exports.SettingsBar=SettingsBar_js_1.default;const Field_js_1=__importDefault(require("./Field.js"));exports.Field=Field_js_1.default;const HorizontalField_js_1=__importDefault(require("./HorizontalField.js"));exports.HorizontalField=HorizontalField_js_1.default;const CheckboxField_js_1=__importDefault(require("./CheckboxField.js"));exports.CheckboxField=CheckboxField_js_1.default;const FieldWithLabel_js_1=__importDefault(require("./FieldWithLabel.js"));exports.FieldWithLabel=FieldWithLabel_js_1.default;const WidgetBody_js_1=__importDefault(require("./WidgetBody.js"));exports.WidgetBody=WidgetBody_js_1.default;const BaseWidget_js_1=__importDefault(require("./BaseWidget.js"));exports.BaseWidget=BaseWidget_js_1.default;const KemuThemeWrapper_js_1=__importDefault(require("./KemuThemeWrapper.js"));exports.KemuThemeWrapper=KemuThemeWrapper_js_1.default;const KemuPrimaryButton_js_1=__importDefault(require("./KemuPrimaryButton.js"));exports.KemuPrimaryButton=KemuPrimaryButton_js_1.default;const KemuLightButton_js_1=__importDefault(require("./KemuLightButton.js"));exports.KemuLightButton=KemuLightButton_js_1.default;
@@ -124,6 +124,17 @@ export type WidgetPort = {
124
124
  * processor execution.
125
125
  */
126
126
  triggerPort?: boolean;
127
+ /**
128
+ * A path to a markdown file that will be rendered as the ports documentation.
129
+ * If provided it will override the default 'description' property. Useful if the documentation of this port requires more than a simple text.
130
+ *
131
+ * The path can be relative to the service's `docs` folder. For example:
132
+ *
133
+ * ```
134
+ * docs/ports/inputA.md
135
+ * ```
136
+ */
137
+ mdHelp?: string;
127
138
  };
128
139
  export type WidgetState<T extends Record<string, any> = Record<string, unknown>> = T;
129
140
  export type TargetOutput = {
@@ -148,6 +159,9 @@ export type TargetOutput = {
148
159
  /** id of the variant that defined the output */
149
160
  variantId?: string;
150
161
  };
162
+ export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
163
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
164
+ }[Keys];
151
165
  export type WidgetPortStr = Omit<WidgetPort, "type"> & {
152
166
  type: string;
153
167
  };
@@ -177,7 +191,20 @@ export type ServiceWidgetVariant<P extends WidgetPort | WidgetPortStr> = {
177
191
  inputs?: P[];
178
192
  outputs?: P[];
179
193
  };
180
- export type ValidPlatformArch = "win-x64" | "win-x86" | "win-arm" | "win-arm64" | "osx-x64" | "osx-arm64";
194
+ /**
195
+ * A list of supported Linux distributions. This can be extended in the future.
196
+ * Use 'generic' for distribution-agnostic services.
197
+ */
198
+ export type LinuxDistribution =
199
+ /** For distribution-agnostic services that run on most Linux systems. */
200
+ "generic"
201
+ /** Includes Debian, Ubuntu, Linux Mint, etc. (uses APT) */
202
+ | "debian"
203
+ /** Includes RHEL, Fedora, CentOS, etc. (uses YUM/DNF) */
204
+ | "rhel"
205
+ /** Includes Arch Linux, Manjaro, etc. (uses Pacman) */
206
+ | "arch";
207
+ export type ValidPlatformArch = "win-x64" | "win-x86" | "win-arm" | "win-arm64" | "osx-x64" | "osx-arm64" | `linux-${LinuxDistribution}-x64` | `linux-${LinuxDistribution}-arm64`;
181
208
  export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
182
209
  /** the unique name defined by the service */
183
210
  name: string;
@@ -187,7 +214,17 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
187
214
  title?: string;
188
215
  /** a shorten title to be used in the canvas */
189
216
  shortTitle?: string;
217
+ /** generic description shown when a service is selected from the Hub Services Grid */
190
218
  description: string;
219
+ /**
220
+ * Relative to the markdown file that will be rendered when the user clicks on the 'help' icon for this service.
221
+ * The description is meant to be short and include video/sample images or a link to the description page. Eg:
222
+ *
223
+ * ```
224
+ * docs/help.md
225
+ * ```
226
+ **/
227
+ mdHelp?: string;
191
228
  processor: ProcessorType;
192
229
  /** Id of the user that published the service */
193
230
  author: string;
@@ -269,6 +306,32 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
269
306
  * and be visually distinct.
270
307
  */
271
308
  variants?: ServiceWidgetVariant<P>[];
309
+ /**
310
+ * The default variant info. If provided, it allows overriding the default info
311
+ * of the service. Useful when the default variant behaviour does not match the service description.
312
+ */
313
+ defaultVariantInfo?: {
314
+ /**
315
+ * The title of the default variant. If provided, it will override the `title` property.
316
+ */
317
+ title?: string;
318
+ /**
319
+ * The short title of the default variant. If provided, it will override the `shortTitle` property.
320
+ */
321
+ shortTitle?: string;
322
+ /**
323
+ * The description of the default variant. If provided, it will override the `description` property.
324
+ */
325
+ description?: string;
326
+ /**
327
+ * The color of the default variant. If provided, it will override the `color` property.
328
+ */
329
+ color?: string;
330
+ /**
331
+ * The SVG icon of the default variant. If provided, it will override the `svgIcon` property.
332
+ */
333
+ svgIcon?: string;
334
+ };
272
335
  /**
273
336
  * A list of relative paths to folders containing extra services that are part of this service. Eg:
274
337
  * ```json
@@ -341,9 +404,6 @@ export type ProcessedManifest<B extends Buffer | ArrayBuffer = Buffer> = Omit<Pa
341
404
  version: string;
342
405
  };
343
406
  };
344
- export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
345
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
346
- }[Keys];
347
407
  export type DefineDynamicPortsArgs = RequireAtLeastOne<{
348
408
  /**
349
409
  * Set to null to remove any previously defined ports or