@evoke-platform/ui-components 1.0.0-dev.201 → 1.0.0-dev.203

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.
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { AutocompleteProps as MUIAutocompleteProps } from '@mui/material';
2
+ import * as React from 'react';
3
3
  export declare type AutocompleteOption = {
4
4
  label: string;
5
5
  value: unknown;
@@ -11,9 +11,10 @@ export declare type AutocompleteProps = MUIAutocompleteProps<AutocompleteOption
11
11
  label?: string;
12
12
  labelPlacement?: string;
13
13
  required?: boolean;
14
- instructionText?: string;
14
+ instructionText?: string | React.ReactNode;
15
15
  error?: boolean;
16
16
  errorMessage?: string;
17
+ tooltip?: string;
17
18
  };
18
19
  declare const Autocomplete: (props: AutocompleteProps) => JSX.Element;
19
20
  export default Autocomplete;
@@ -1,9 +1,10 @@
1
- import { ExpandMore } from '@mui/icons-material';
1
+ import { ExpandMore, InfoRounded } from '@mui/icons-material';
2
2
  import { InputLabel, Autocomplete as MUIAutocomplete } from '@mui/material';
3
3
  import * as React from 'react';
4
4
  import UIThemeProvider from '../../../theme';
5
5
  import FieldError from '../FieldError';
6
6
  import Typography from '../Typography';
7
+ import Tooltip from '../Tooltip';
7
8
  const Autocomplete = (props) => {
8
9
  var _a, _b, _c, _d;
9
10
  const sortedOptions = props.sortBy !== 'NONE'
@@ -26,12 +27,26 @@ const Autocomplete = (props) => {
26
27
  sortedOptions === null || sortedOptions === void 0 ? void 0 : sortedOptions.sort((a, b) => a.label.localeCompare(b.label));
27
28
  break;
28
29
  }
30
+ const renderInstructionText = () => {
31
+ if (typeof props.instructionText === 'string') {
32
+ return (React.createElement(Typography, { fontSize: '12px', lineHeight: '14px' }, props.instructionText));
33
+ }
34
+ else {
35
+ return props.instructionText;
36
+ }
37
+ };
29
38
  if (!!props.label && props.labelPlacement === 'outside-top') {
30
39
  return (React.createElement(UIThemeProvider, null,
31
- React.createElement(InputLabel, { htmlFor: (_a = props.id) !== null && _a !== void 0 ? _a : '', sx: { paddingBottom: '0px', fontSize: '14px' } }, (_b = props.label) !== null && _b !== void 0 ? _b : '',
40
+ React.createElement(InputLabel, { htmlFor: (_a = props.id) !== null && _a !== void 0 ? _a : '', sx: { display: 'flex', paddingBottom: '0px', fontSize: '14px' } }, (_b = props.label) !== null && _b !== void 0 ? _b : '',
32
41
  ' ',
33
- props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null),
34
- props.instructionText && (React.createElement(Typography, { fontSize: '10px', lineHeight: '14px' }, props.instructionText)),
42
+ props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null,
43
+ props.tooltip && (React.createElement(Tooltip, { title: props.tooltip, placement: "right" },
44
+ React.createElement(InfoRounded, { sx: {
45
+ fontSize: '14px',
46
+ margin: '2px 4px 0 8px',
47
+ color: (theme) => theme.palette.text.secondary,
48
+ } })))),
49
+ renderInstructionText(),
35
50
  React.createElement(MUIAutocomplete, Object.assign({}, props, { sx: Object.assign({ '& fieldset': { borderRadius: '8px', borderColor: props.error ? 'red' : undefined }, '& .MuiOutlinedInput-notchedOutline': {
36
51
  border: props.readOnly ? 'none' : 'auto',
37
52
  }, '& .MuiInputBase-input.Mui-disabled': {
@@ -36,6 +36,10 @@ export declare type RichTextTemplate = {
36
36
  view_permission?: 'Private' | 'Portal' | 'Public';
37
37
  };
38
38
  additionalDatasources?: string[];
39
+ sort?: {
40
+ sortBy: string;
41
+ direction: 'asc' | 'desc' | 'ASC' | 'DESC';
42
+ };
39
43
  };
40
44
  export declare type App = {
41
45
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.201",
3
+ "version": "1.0.0-dev.203",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",