@lumiastream/ui 0.2.4 → 0.2.6

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 (3) hide show
  1. package/dist/index.d.ts +67 -21
  2. package/dist/index.js +1151 -260
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TextFieldProps } from '@mui/material/TextField';
2
+ import { ButtonProps } from '@mui/material/Button';
3
3
  import * as React from 'react';
4
- import { JSX, ReactNode, HTMLAttributes } from 'react';
4
+ import { ReactNode, CSSProperties, JSX, HTMLAttributes } from 'react';
5
+ import { TextFieldProps } from '@mui/material/TextField';
5
6
  import { SelectProps } from '@mui/material/Select';
6
7
  import { CheckboxProps } from '@mui/material/Checkbox';
7
8
  import { FieldValues, Path } from 'react-hook-form';
@@ -10,20 +11,32 @@ import { RadioGroupProps } from '@mui/material/RadioGroup';
10
11
  import { AutocompleteRenderOptionState } from '@mui/material/Autocomplete';
11
12
  import { CompletionContext } from '@codemirror/autocomplete';
12
13
 
13
- interface LSButtonProps {
14
- /** Is this the principal call to action on the page? */
14
+ type LSButtonColor = 'inherit' | 'primary' | 'secondary' | 'error' | 'neutral';
15
+ type LSButtonVariant = 'text' | 'outlined' | 'contained';
16
+ type LSButtonProps = Omit<ButtonProps, 'children' | 'color' | 'variant' | 'size'> & {
17
+ /** Compatibility alias for color="primary". */
15
18
  primary?: boolean;
16
- /** What background color to use */
19
+ /** Compatibility style override for the button background. */
17
20
  backgroundColor?: string;
21
+ /** Loading state. */
22
+ loading?: boolean;
23
+ /** Color of the button. */
24
+ color?: LSButtonColor;
18
25
  /** How large should the button be? */
19
26
  size?: 'small' | 'medium' | 'large';
20
- /** Button contents */
21
- label: string;
22
- /** Optional click handler */
23
- onClick?: () => void;
24
- }
25
- /** Primary UI component for user interaction */
26
- declare const LSButton: ({ primary, size, backgroundColor, label, ...props }: LSButtonProps) => react_jsx_runtime.JSX.Element;
27
+ /** Element placed before the children. */
28
+ startIcon?: ReactNode;
29
+ /** Element placed after the children. */
30
+ endIcon?: ReactNode;
31
+ /** The variant to use. */
32
+ variant?: LSButtonVariant;
33
+ /** Button contents. */
34
+ label?: ReactNode;
35
+ /** Adds wider horizontal padding. */
36
+ extended?: number;
37
+ style?: CSSProperties;
38
+ };
39
+ declare const LSButton: ({ label, disabled, loading, variant, extended, color, primary, backgroundColor, className, sx, style, ...props }: LSButtonProps) => react_jsx_runtime.JSX.Element;
27
40
 
28
41
  interface LSInputPropsChild$1 {
29
42
  id?: string;
@@ -173,35 +186,56 @@ declare const LSTextField: React.ForwardRefExoticComponent<Omit<LSTextFieldProps
173
186
  interface IVariables {
174
187
  name: string;
175
188
  system: boolean;
189
+ isFunction?: boolean;
176
190
  locked?: boolean;
177
191
  origin: string;
192
+ pluginId?: string;
178
193
  allowedPlaces?: string[];
179
194
  description: string;
180
195
  counter?: boolean;
181
- value: string | number;
196
+ example?: string;
197
+ value: string | number | boolean | null | Record<string, unknown> | unknown[];
198
+ hidden?: boolean;
182
199
  }
200
+ type LSVariableDefinition = {
201
+ name: string;
202
+ description?: string;
203
+ origin?: string;
204
+ example?: unknown;
205
+ };
183
206
  type LSVariableInputTranslate = (key: string, fallback?: string, options?: Record<string, unknown>) => string;
184
207
  type LSVariableInputContextValue = {
185
208
  systemVariables?: Record<string, unknown>;
186
209
  functionVariables?: string[];
187
210
  translate?: LSVariableInputTranslate;
188
211
  onVariableTranslationsNeeded?: () => void;
212
+ isOriginConnected?: (origin: string) => boolean;
213
+ translationKeyExists?: (key: string, namespace?: string) => boolean;
189
214
  };
190
- declare const LSVariableInputProvider: ({ children, value }: {
215
+ declare const LSVariableInputProvider: ({ children, value, }: {
191
216
  children: ReactNode;
192
217
  value: LSVariableInputContextValue;
193
218
  }) => react_jsx_runtime.JSX.Element;
219
+ type LSAutoCompleteOption = {
220
+ label?: string | number | boolean;
221
+ value?: unknown;
222
+ helperText?: string;
223
+ imageUrl?: string;
224
+ searchText?: string;
225
+ thumb?: string;
226
+ iconUrl?: string;
227
+ previewImageUrl?: string;
228
+ [key: string]: unknown;
229
+ };
194
230
  type LSVariableInputFieldProps = {
195
231
  name?: string;
196
232
  label?: ReactNode;
197
233
  type?: string;
198
234
  isAutoComplete?: boolean;
199
- autoCompleteOptions?: Array<{
200
- label: string;
201
- value: any;
202
- }>;
235
+ autoCompleteOptions?: LSAutoCompleteOption[];
236
+ autoCompleteGroupBy?: (option: any) => string;
203
237
  hideVariables?: boolean;
204
- allowedVariables?: IVariables[] | string[] | any;
238
+ allowedVariables?: IVariables[] | string[] | LSVariableDefinition[] | unknown[];
205
239
  disabled?: boolean;
206
240
  autoFocus?: boolean;
207
241
  inputProps?: any;
@@ -211,7 +245,7 @@ type LSVariableInputFieldProps = {
211
245
  value?: string | number | any[];
212
246
  placeholder?: string;
213
247
  renderOption?: (props: HTMLAttributes<HTMLLIElement>, option: any, state: AutocompleteRenderOptionState) => ReactNode;
214
- variant?: 'standard' | 'filled' | 'outlined';
248
+ variant?: "standard" | "filled" | "outlined";
215
249
  ListboxComponent?: any;
216
250
  onScrollListBox?: (e: any) => void;
217
251
  onHighlightChange?: (e: any, value: any) => void;
@@ -219,11 +253,23 @@ type LSVariableInputFieldProps = {
219
253
  onPopupOpen?: (e: any) => void;
220
254
  onAutocompleteKeyUp?: (e: any, value: any) => void;
221
255
  afterFilter?: (filtered: any[]) => void;
222
- onChange?: (value: string) => void;
256
+ onChange?: (value: any) => void;
257
+ loading?: boolean;
258
+ getOptionLabel?: (option: any) => string;
259
+ isOptionEqualToValue?: (option: any, value: any) => boolean;
260
+ $disableInputChange?: boolean;
261
+ $getFullValueObject?: boolean;
262
+ $multiple?: boolean;
263
+ $disableCloseOnSelect?: boolean;
264
+ $freeSolo?: boolean;
265
+ $renderOption?: any;
266
+ allowedVariableOrigin?: string;
223
267
  systemVariables?: Record<string, unknown>;
224
268
  functionVariables?: string[];
225
269
  translate?: LSVariableInputTranslate;
226
270
  onVariableTranslationsNeeded?: () => void;
271
+ isOriginConnected?: (origin: string) => boolean;
272
+ translationKeyExists?: (key: string, namespace?: string) => boolean;
227
273
  };
228
274
  declare const LSVariableInputField: React.ForwardRefExoticComponent<LSVariableInputFieldProps & React.RefAttributes<HTMLInputElement>>;
229
275