@kemu-io/hs-react 0.2.38 → 0.3.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 (79) hide show
  1. package/cjs/WidgetWrapper.d.ts +64 -4
  2. package/cjs/components/BaseWidget.d.ts +61 -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 +23 -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/WidgetContainer.d.ts +5 -0
  29. package/cjs/components/WidgetContainer.js +4 -3
  30. package/cjs/components/index.d.ts +323 -1
  31. package/cjs/components/index.js +1 -1
  32. package/cjs/hooks/index.d.ts +64 -4
  33. package/cjs/hooks/useOnBroadcastEvent.d.ts +64 -4
  34. package/cjs/hooks/useOnParentEvent.d.ts +64 -4
  35. package/cjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
  36. package/cjs/lib/InstanceContext.d.ts +64 -4
  37. package/cjs/lib/globalContext.d.ts +64 -4
  38. package/cjs/types/context_t.d.ts +64 -4
  39. package/cjs/types/widgetUI_t.d.ts +64 -4
  40. package/mjs/WidgetWrapper.d.ts +64 -4
  41. package/mjs/components/BaseWidget.d.ts +61 -0
  42. package/mjs/components/BaseWidget.js +6 -0
  43. package/mjs/components/CheckboxField.d.ts +27 -0
  44. package/mjs/components/CheckboxField.js +3 -0
  45. package/mjs/components/CommonElements.d.ts +9 -0
  46. package/mjs/components/CommonElements.js +1 -0
  47. package/mjs/components/Field.d.ts +25 -0
  48. package/mjs/components/Field.js +9 -0
  49. package/mjs/components/FieldWithLabel.d.ts +35 -0
  50. package/mjs/components/FieldWithLabel.js +1 -0
  51. package/mjs/components/HorizontalField.d.ts +24 -0
  52. package/mjs/components/HorizontalField.js +9 -0
  53. package/mjs/components/KemuLightButton.d.ts +16 -0
  54. package/mjs/components/KemuLightButton.js +43 -0
  55. package/mjs/components/KemuPrimaryButton.d.ts +16 -0
  56. package/mjs/components/KemuPrimaryButton.js +43 -0
  57. package/mjs/components/KemuThemeWrapper.d.ts +44 -0
  58. package/mjs/components/KemuThemeWrapper.js +1 -0
  59. package/mjs/components/SettingsBar.d.ts +36 -0
  60. package/mjs/components/SettingsBar.js +8 -0
  61. package/mjs/components/SettingsDialog.d.ts +81 -0
  62. package/mjs/components/SettingsDialog.js +74 -0
  63. package/mjs/components/SvgContainer.d.ts +23 -0
  64. package/mjs/components/SvgContainer.js +9 -0
  65. package/mjs/components/WidgetBody.d.ts +20 -0
  66. package/mjs/components/WidgetBody.js +9 -0
  67. package/mjs/components/WidgetContainer.d.ts +5 -0
  68. package/mjs/components/WidgetContainer.js +4 -3
  69. package/mjs/components/index.d.ts +323 -1
  70. package/mjs/components/index.js +1 -1
  71. package/mjs/hooks/index.d.ts +64 -4
  72. package/mjs/hooks/useOnBroadcastEvent.d.ts +64 -4
  73. package/mjs/hooks/useOnParentEvent.d.ts +64 -4
  74. package/mjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
  75. package/mjs/lib/InstanceContext.d.ts +64 -4
  76. package/mjs/lib/globalContext.d.ts +64 -4
  77. package/mjs/types/context_t.d.ts +64 -4
  78. package/mjs/types/widgetUI_t.d.ts +64 -4
  79. 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: 40px;
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,23 @@
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
+ }
17
+ declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
18
+
19
+ export {
20
+ SvgContainer as default,
21
+ };
22
+
23
+ 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: 38px;
7
+ height: 38px;
8
+ }
9
+ `,SvgContainer=({fill:e,children:t})=>(0,jsx_runtime_1.jsx)(StyledSvgContainer,{fill:e,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;
@@ -3,6 +3,11 @@ export type WrapperProps = {
3
3
  cHeight?: number | string;
4
4
  noPadding?: boolean;
5
5
  noBorderRadius?: boolean;
6
+ /**
7
+ * Overrides the default widget color from the manifest.
8
+ * If not set, the widget will use the color defined in its manifest file.
9
+ */
10
+ overrideColor?: string;
6
11
  };
7
12
  export type WidthLessProps = Omit<WrapperProps, "cWidth" | "cHeight"> & {
8
13
  width?: number | string;
@@ -1,12 +1,13 @@
1
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")),constants_js_1=require("../constants.js"),react_1=require("react"),InstanceContext_js_1=require("../lib/InstanceContext.js"),WidgetContainer=styled_1.default.div`
2
2
  width: ${({cWidth:e})=>"number"==typeof e?`${e}px`:e||"64px"};
3
3
  height: ${({cHeight:e})=>"number"==typeof e?`${e}px`:e||"64px"};
4
- background-color: ${({manifest:e,disabled:t,serviceOnline:s})=>t||!s?"#bbb":e.color};
4
+ background-color: ${({manifest:e,disabled:t,serviceOnline:r,overrideColor:i})=>t||!r?"#bbb":i||e.color};
5
5
  ${({noBorderRadius:e})=>e?"":"border-radius: 8px;"}
6
6
  ${({noPadding:e})=>e?"":"padding: 6px;"}
7
7
 
8
8
  /* Add a shadow when the widget is selected */
9
9
  .${constants_js_1.WIDGET_SELECTED_CLS} & {
10
- box-shadow: 0px 0px 7px 1px ${({manifest:e,disabled:t,serviceOnline:s})=>t||!s?"#bbb":e.color};
10
+ box-shadow: 0px 0px 7px 1px
11
+ ${({manifest:e,disabled:t,serviceOnline:r,overrideColor:i})=>t||!r?"#bbb":i||e.color};
11
12
  }
12
- `,Wrap=e=>{const t=(0,react_1.useContext)(InstanceContext_js_1.WidgetInstanceContext).getWidgetProps(),{className:s,width:r,height:n,...i}=e;return(0,jsx_runtime_1.jsx)(WidgetContainer,{cWidth:r,cHeight:n,...i,...t,className:`k-hs-wrap ${s||""}`,children:e.children})};exports.default=Wrap;
13
+ `,Wrap=e=>{const t=(0,react_1.useContext)(InstanceContext_js_1.WidgetInstanceContext).getWidgetProps(),{className:r,width:i,height:n,...o}=e,s=t.variantId?t.manifest.variants?.find((e=>e.id===t.variantId)):null,a=s?s.color||t.manifest.color:void 0;return(0,jsx_runtime_1.jsx)(WidgetContainer,{cWidth:i,cHeight:n,...o,...t,className:`k-hs-wrap ${r||""}`,overrideColor:e.overrideColor||a,children:e.children})};exports.default=Wrap;
@@ -1,7 +1,194 @@
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
+ showIcon?: boolean;
86
+ customIcon?: React$1.ReactNode;
87
+ settingsIconColor?: string;
88
+ customTheme?: Theme;
89
+ }
90
+ export declare const BaseWidget: ({ children, showSettings, onOpenSettings, width, height, showIcon, customIcon, settingsIconColor, customTheme, }: BaseWidgetProps) => import("react/jsx-runtime.js").JSX.Element;
91
+ /**
92
+ * A checkbox field component with label, wrapped in a horizontal field layout.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * const [enabled, setEnabled] = useState(false);
97
+ *
98
+ * <CheckboxField
99
+ * label="Enable feature"
100
+ * checked={enabled}
101
+ * onChange={(checked) => setEnabled(checked)}
102
+ * />
103
+ * ```
104
+ */
105
+ export type CheckboxFieldProps = {
106
+ onChange?: (checked: boolean) => void;
107
+ checked: boolean;
108
+ label: string;
109
+ disabled?: boolean;
110
+ };
111
+ export declare const CheckboxField: (props: CheckboxFieldProps) => import("react/jsx-runtime.js").JSX.Element;
112
+ /**
113
+ * A vertical field container for form elements. Use for stacking form fields vertically.
114
+ *
115
+ * @example
116
+ * ```tsx
117
+ * <Field mb={20}>
118
+ * <label>Name</label>
119
+ * <input type="text" />
120
+ * </Field>
121
+ * ```
122
+ */
123
+ export interface FieldProps {
124
+ mb?: number;
125
+ mt?: number;
126
+ }
127
+ export declare const Field: import("@emotion/styled").StyledComponent<{
128
+ theme?: import("@emotion/react").Theme;
129
+ as?: React$1.ElementType;
130
+ } & FieldProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
131
+ /**
132
+ * A field component with a built-in label. Use this for simple form fields.
133
+ *
134
+ * @example
135
+ * ```tsx
136
+ * <FieldWithLabel label="Username">
137
+ * <input type="text" />
138
+ * </FieldWithLabel>
139
+ * ```
140
+ *
141
+ * @example
142
+ * With Material-UI components:
143
+ * ```tsx
144
+ * <FieldWithLabel label="Select Option">
145
+ * <Select>
146
+ * <MenuItem value="1">Option 1</MenuItem>
147
+ * </Select>
148
+ * </FieldWithLabel>
149
+ * ```
150
+ */
151
+ export interface FieldWithLabelProps {
152
+ label: string;
153
+ children?: React$1.ReactNode;
154
+ mb?: number;
155
+ mt?: number;
156
+ }
157
+ export declare const FieldWithLabel: ({ label, children, mb, mt }: FieldWithLabelProps) => import("react/jsx-runtime.js").JSX.Element;
158
+ /**
159
+ * A horizontal field container for form elements. Use for placing form fields side by side.
160
+ *
161
+ * @example
162
+ * ```tsx
163
+ * <HorizontalField alignItems="center">
164
+ * <label>Option:</label>
165
+ * <input type="checkbox" />
166
+ * </HorizontalField>
167
+ * ```
168
+ */
169
+ export interface HorizontalFieldProps {
170
+ alignItems?: string;
171
+ }
172
+ export declare const HorizontalField: import("@emotion/styled").StyledComponent<{
173
+ theme?: import("@emotion/react").Theme;
174
+ as?: React$1.ElementType;
175
+ } & HorizontalFieldProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
176
+ export interface KemuLightButtonProps {
177
+ noShadow?: boolean;
178
+ }
179
+ 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"> & {
180
+ 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;
181
+ }, "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"> & {
182
+ theme?: import("@emotion/react").Theme;
183
+ } & KemuLightButtonProps, {}, {}>;
184
+ export interface KemuPrimaryButtonProps {
185
+ noShadow?: boolean;
186
+ }
187
+ 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"> & {
188
+ 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;
189
+ }, "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"> & {
190
+ theme?: import("@emotion/react").Theme;
191
+ } & KemuPrimaryButtonProps, {}, {}>;
5
192
  export type ResizableContainerProps = {
6
193
  css?: CSSObject;
7
194
  minWidth?: number;
@@ -63,11 +250,146 @@ export type WrapperProps = {
63
250
  * ```
64
251
  */
65
252
  export declare const ResizableContainer: (props: ResizableContainerProps & WrapperProps) => import("react/jsx-runtime.js").JSX.Element;
253
+ /**
254
+ * A settings bar component with default settings icon. Renders in the top-right corner.
255
+ *
256
+ * @example
257
+ * With default settings icon:
258
+ * ```tsx
259
+ * <SettingsBar
260
+ * iconColor="white"
261
+ * onSettingsClick={() => console.log('Settings clicked')}
262
+ * />
263
+ * ```
264
+ *
265
+ * @example
266
+ * With custom content:
267
+ * ```tsx
268
+ * <SettingsBar iconColor="#333">
269
+ * <IconButton onClick={handleClick}>
270
+ * <CustomIcon />
271
+ * </IconButton>
272
+ * </SettingsBar>
273
+ * ```
274
+ */
275
+ export interface SettingsBarProps {
276
+ iconColor?: string;
277
+ onSettingsClick?: () => void;
278
+ children?: React$1.ReactNode;
279
+ }
280
+ export declare const SettingsBar: ({ iconColor, onSettingsClick, children }: SettingsBarProps) => import("react/jsx-runtime").JSX.Element;
281
+ /**
282
+ * A resizable and expandable settings dialog with customizable buttons and styling.
283
+ *
284
+ * @example
285
+ * Basic usage:
286
+ * ```tsx
287
+ * const [open, setOpen] = useState(false);
288
+ *
289
+ * <SettingsDialog
290
+ * open={open}
291
+ * onClose={() => setOpen(false)}
292
+ * onSave={() => {
293
+ * // Save settings
294
+ * setOpen(false);
295
+ * }}
296
+ * >
297
+ * <FieldWithLabel label="Setting 1">
298
+ * <input type="text" />
299
+ * </FieldWithLabel>
300
+ * </SettingsDialog>
301
+ * ```
302
+ *
303
+ * @example
304
+ * Disable resizing and expansion:
305
+ * ```tsx
306
+ * <SettingsDialog
307
+ * open={open}
308
+ * onClose={() => setOpen(false)}
309
+ * onSave={handleSave}
310
+ * disableResizing={true}
311
+ * disableExpansion={true}
312
+ * >
313
+ * {children}
314
+ * </SettingsDialog>
315
+ * ```
316
+ *
317
+ * @example
318
+ * Custom button text:
319
+ * ```tsx
320
+ * <SettingsDialog
321
+ * open={open}
322
+ * onClose={handleClose}
323
+ * onSave={handleSave}
324
+ * cancelButtonText="Discard"
325
+ * saveButtonText="Apply Changes"
326
+ * >
327
+ * {children}
328
+ * </SettingsDialog>
329
+ * ```
330
+ */
331
+ export interface SettingsDialogProps {
332
+ title?: string;
333
+ open: boolean;
334
+ noHeader?: boolean;
335
+ onClose: () => void;
336
+ onSave: () => void;
337
+ children: React$1.ReactNode;
338
+ serviceOnline?: boolean;
339
+ saveDisabled?: boolean;
340
+ minHeight?: number;
341
+ minWidth?: number;
342
+ maxWidth?: number;
343
+ maxHeight?: number;
344
+ cancelButtonText?: string;
345
+ saveButtonText?: string;
346
+ disableResizing?: boolean;
347
+ disableExpansion?: boolean;
348
+ dialogClassName?: string;
349
+ resizableClassName?: string;
350
+ dialogContentClassName?: string;
351
+ dialogActionsClassName?: string;
352
+ }
353
+ 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;
354
+ /**
355
+ * Container for SVG icons with customizable fill color.
356
+ *
357
+ * @example
358
+ * ```tsx
359
+ * <SvgContainer fill="blue">
360
+ * <svg>...</svg>
361
+ * </SvgContainer>
362
+ * ```
363
+ */
364
+ export interface SvgContainerProps {
365
+ fill?: string;
366
+ children?: React$1.ReactNode;
367
+ }
368
+ export declare const SvgContainer: ({ fill, children }: SvgContainerProps) => import("react/jsx-runtime").JSX.Element;
369
+ /**
370
+ * A container for widget body content. Provides centered flexbox layout with padding.
371
+ *
372
+ * @example
373
+ * ```tsx
374
+ * <WidgetBody>
375
+ * <div>Widget content</div>
376
+ * </WidgetBody>
377
+ * ```
378
+ */
379
+ export declare const WidgetBody: import("@emotion/styled").StyledComponent<{
380
+ theme?: import("@emotion/react").Theme;
381
+ as?: React$1.ElementType;
382
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
66
383
  type WrapperProps$1 = {
67
384
  cWidth?: number | string;
68
385
  cHeight?: number | string;
69
386
  noPadding?: boolean;
70
387
  noBorderRadius?: boolean;
388
+ /**
389
+ * Overrides the default widget color from the manifest.
390
+ * If not set, the widget will use the color defined in its manifest file.
391
+ */
392
+ overrideColor?: string;
71
393
  };
72
394
  export type WidthLessProps = Omit<WrapperProps$1, "cWidth" | "cHeight"> & {
73
395
  width?: 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