@zesty-io/material 0.11.0 → 0.12.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 (99) hide show
  1. package/es/SSOButton/SSOButton.stories.d.ts +7 -0
  2. package/es/SSOButton/SSOButton.stories.js +22 -0
  3. package/es/SSOButton/index.d.ts +26 -0
  4. package/es/SSOButton/index.js +26 -0
  5. package/{cjs/FieldTypeSort/FieldTypeSort.stories.d.ts → es/SSOButtonGroup/SSOButtonGroup.stories.d.ts} +2 -2
  6. package/es/SSOButtonGroup/SSOButtonGroup.stories.js +21 -0
  7. package/es/SSOButtonGroup/index.d.ts +30 -0
  8. package/es/SSOButtonGroup/index.js +30 -0
  9. package/es/icons/Github.d.ts +3 -0
  10. package/es/icons/Github.js +3 -0
  11. package/es/icons/Google.d.ts +3 -0
  12. package/es/icons/Google.js +3 -0
  13. package/es/icons/ImageSync.d.ts +3 -0
  14. package/es/icons/ImageSync.js +3 -0
  15. package/es/icons/Microsoft.d.ts +3 -0
  16. package/es/icons/Microsoft.js +3 -0
  17. package/es/icons/index.d.ts +4 -0
  18. package/es/icons/index.js +4 -0
  19. package/es/index.d.ts +2 -0
  20. package/es/index.js +2 -0
  21. package/es/theme/index.js +6 -1
  22. package/es/utils/useSSO.d.ts +2 -0
  23. package/es/utils/useSSO.js +33 -0
  24. package/package.json +6 -2
  25. package/cjs/ConfirmDialog/ConfirmDialog.stories.d.ts +0 -6
  26. package/cjs/ConfirmDialog/ConfirmDialog.stories.js +0 -27
  27. package/cjs/ConfirmDialog/index.d.ts +0 -18
  28. package/cjs/ConfirmDialog/index.js +0 -13
  29. package/cjs/CopyButton/CopyButton.stories.d.ts +0 -5
  30. package/cjs/CopyButton/CopyButton.stories.js +0 -17
  31. package/cjs/CopyButton/index.d.ts +0 -10
  32. package/cjs/CopyButton/index.js +0 -28
  33. package/cjs/FieldTypeColor/FieldTypeColor.stories.d.ts +0 -5
  34. package/cjs/FieldTypeColor/FieldTypeColor.stories.js +0 -24
  35. package/cjs/FieldTypeColor/index.d.ts +0 -6
  36. package/cjs/FieldTypeColor/index.js +0 -18
  37. package/cjs/FieldTypeDate/FieldTypeDate.stories.d.ts +0 -5
  38. package/cjs/FieldTypeDate/FieldTypeDate.stories.js +0 -20
  39. package/cjs/FieldTypeDate/index.d.ts +0 -9
  40. package/cjs/FieldTypeDate/index.js +0 -12
  41. package/cjs/FieldTypeDateTime/FieldTypeDateTime.stories.d.ts +0 -5
  42. package/cjs/FieldTypeDateTime/FieldTypeDateTime.stories.js +0 -20
  43. package/cjs/FieldTypeDateTime/index.d.ts +0 -9
  44. package/cjs/FieldTypeDateTime/index.js +0 -12
  45. package/cjs/FieldTypeNumber/FieldTypeNumber.stories.d.ts +0 -5
  46. package/cjs/FieldTypeNumber/FieldTypeNumber.stories.js +0 -24
  47. package/cjs/FieldTypeNumber/index.d.ts +0 -6
  48. package/cjs/FieldTypeNumber/index.js +0 -9
  49. package/cjs/FieldTypeOneToMany/FieldTypeOneToMany.stories.d.ts +0 -5
  50. package/cjs/FieldTypeOneToMany/FieldTypeOneToMany.stories.js +0 -31
  51. package/cjs/FieldTypeOneToMany/index.d.ts +0 -32
  52. package/cjs/FieldTypeOneToMany/index.js +0 -31
  53. package/cjs/FieldTypeOneToOne/FieldTypeOneToOne.stories.d.ts +0 -5
  54. package/cjs/FieldTypeOneToOne/FieldTypeOneToOne.stories.js +0 -31
  55. package/cjs/FieldTypeOneToOne/index.d.ts +0 -34
  56. package/cjs/FieldTypeOneToOne/index.js +0 -35
  57. package/cjs/FieldTypeSort/FieldTypeSort.stories.js +0 -25
  58. package/cjs/FieldTypeSort/index.d.ts +0 -7
  59. package/cjs/FieldTypeSort/index.js +0 -36
  60. package/cjs/FieldTypeText/FieldTypeText.stories.d.ts +0 -6
  61. package/cjs/FieldTypeText/FieldTypeText.stories.js +0 -32
  62. package/cjs/FieldTypeText/index.d.ts +0 -12
  63. package/cjs/FieldTypeText/index.js +0 -9
  64. package/cjs/FieldTypeUrl/FieldTypeUrl.stories.d.ts +0 -5
  65. package/cjs/FieldTypeUrl/FieldTypeUrl.stories.js +0 -24
  66. package/cjs/FieldTypeUrl/index.d.ts +0 -12
  67. package/cjs/FieldTypeUrl/index.js +0 -16
  68. package/cjs/LegacyTheme/index.d.ts +0 -3
  69. package/cjs/LegacyTheme/index.js +0 -83
  70. package/cjs/LegacyTheme/palette.d.ts +0 -3
  71. package/cjs/LegacyTheme/palette.js +0 -25
  72. package/cjs/LegacyTheme/typography.d.ts +0 -3
  73. package/cjs/LegacyTheme/typography.js +0 -6
  74. package/cjs/VitualizedAutocomplete/VirtualizedAutocomplete.stories.d.ts +0 -5
  75. package/cjs/VitualizedAutocomplete/VirtualizedAutocomplete.stories.js +0 -30
  76. package/cjs/VitualizedAutocomplete/index.d.ts +0 -28
  77. package/cjs/VitualizedAutocomplete/index.js +0 -23
  78. package/cjs/index.d.ts +0 -14
  79. package/cjs/index.js +0 -31
  80. package/cjs/theme/Theme.stories.d.ts +0 -4
  81. package/cjs/theme/Theme.stories.js +0 -13
  82. package/cjs/theme/index.d.ts +0 -3
  83. package/cjs/theme/index.js +0 -52
  84. package/cjs/theme/palette.d.ts +0 -15
  85. package/cjs/theme/palette.js +0 -138
  86. package/cjs/theme/typography.d.ts +0 -9
  87. package/cjs/theme/typography.js +0 -59
  88. package/cjs/utils/virtualization.d.ts +0 -2
  89. package/cjs/utils/virtualization.js +0 -66
  90. package/es/ConfirmModal/ConfirmModal.stories.d.ts +0 -6
  91. package/es/ConfirmModal/ConfirmModal.stories.js +0 -24
  92. package/es/ConfirmModal/index.d.ts +0 -18
  93. package/es/ConfirmModal/index.js +0 -11
  94. package/es/FieldTypeDropdown/FieldTypeDropwdon.stories.d.ts +0 -5
  95. package/es/FieldTypeDropdown/FieldTypeDropwdon.stories.js +0 -35
  96. package/es/FieldTypeDropdown/index.d.ts +0 -11
  97. package/es/FieldTypeDropdown/index.js +0 -10
  98. package/es/stories/Theme.stories.d.ts +0 -4
  99. package/es/stories/Theme.stories.js +0 -10
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { DesktopDateTimePickerProps } from '@mui/x-date-pickers';
3
- export interface FieldTypeDateTimeProps extends Omit<DesktopDateTimePickerProps<Date, Date>, 'renderInput'> {
4
- helperText?: string;
5
- error?: boolean;
6
- required?: boolean;
7
- }
8
- declare const FieldTypeDateTime: ({ label, helperText, error, required, ...props }: FieldTypeDateTimeProps) => JSX.Element;
9
- export default FieldTypeDateTime;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const AdapterDateFns_1 = require("@mui/x-date-pickers/AdapterDateFns");
5
- const LocalizationProvider_1 = require("@mui/x-date-pickers/LocalizationProvider");
6
- const x_date_pickers_1 = require("@mui/x-date-pickers");
7
- const material_1 = require("@mui/material");
8
- ;
9
- const FieldTypeDateTime = ({ label, helperText, error, required, ...props }) => {
10
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(LocalizationProvider_1.LocalizationProvider, { dateAdapter: AdapterDateFns_1.AdapterDateFns, children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DesktopDateTimePicker, { "data-testid": "zds-date-time-picker", renderInput: (params) => (0, jsx_runtime_1.jsx)(material_1.TextField, { ...params, helperText: helperText, error: error, size: "small" }), ...props }) })] }));
11
- };
12
- exports.default = FieldTypeDateTime;
@@ -1,5 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { FieldTypeNumberProps } from './';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<FieldTypeNumberProps>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require("./");
7
- exports.default = {
8
- title: 'FieldTypeNumber',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)('0');
14
- const handleOnChange = (e) => {
15
- setValue(e.target.value);
16
- };
17
- return ((0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange }));
18
- };
19
- exports.Default = Template.bind({});
20
- exports.Default.args = {
21
- placeholder: 'Placeholder Text...',
22
- label: 'Number label',
23
- helperText: 'Number helper text',
24
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { OutlinedTextFieldProps } from '@mui/material/TextField';
3
- export interface FieldTypeNumberProps extends Omit<OutlinedTextFieldProps, 'variant'> {
4
- }
5
- declare const FieldTypeText: ({ label, required, ...props }: FieldTypeNumberProps) => JSX.Element;
6
- export default FieldTypeText;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const material_1 = require("@mui/material");
5
- const TextField_1 = require("@mui/material/TextField");
6
- const FieldTypeText = ({ label, required, ...props }) => {
7
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(TextField_1.default, { size: "small", variant: 'outlined', type: 'number', ...props })] }));
8
- };
9
- exports.default = FieldTypeText;
@@ -1,5 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { FieldTypeOneToManyProps } from '.';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<FieldTypeOneToManyProps>;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require(".");
7
- exports.default = {
8
- title: 'FieldTypeOneToMany',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)([]);
14
- const [options, setOptions] = (0, react_1.useState)([]);
15
- const handleOnOpen = async () => {
16
- const largeArr = new Array(1000).fill(null);
17
- await new Promise((resolve) => setTimeout(resolve, 3000));
18
- const data = largeArr.map((_, idx) => ({ component: (0, jsx_runtime_1.jsx)("div", { children: `Test ${idx}` }), value: String(Math.random()), inputLabel: `Test ${idx}` }));
19
- setOptions(data);
20
- };
21
- const handleOnChange = (e, values) => {
22
- setValue(values);
23
- };
24
- return ((0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange, options: options, onOpen: handleOnOpen }));
25
- };
26
- exports.Default = Template.bind({});
27
- exports.Default.args = {
28
- placeholder: 'Placeholder Text...',
29
- label: 'OneToMany label',
30
- helperText: 'OneToMany helperText',
31
- };
@@ -1,32 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { AutocompleteProps } from '@mui/material';
3
- export interface FieldTypeOneToManyProps extends Omit<AutocompleteProps<any, false, false, false>, 'onOpen' | 'renderInput'> {
4
- label?: string;
5
- helperText?: string;
6
- placeholder?: string;
7
- error?: boolean;
8
- required?: boolean;
9
- /**
10
- * Callback to be fired upon opening the dropdown
11
- */
12
- onOpen: () => Promise<any>;
13
- /**
14
- * Structure for option
15
- */
16
- options: {
17
- /**
18
- * Component to be rendered in the dropdown
19
- */
20
- component: ReactNode | string;
21
- /**
22
- * Value of option
23
- */
24
- value: string;
25
- /**
26
- * Label that should display in the input when selected
27
- */
28
- inputLabel: string;
29
- }[];
30
- }
31
- declare const FieldTypeOneToMany: ({ label, helperText, placeholder, error, onOpen, options, required, ...props }: FieldTypeOneToManyProps) => JSX.Element;
32
- export default FieldTypeOneToMany;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const material_1 = require("@mui/material");
6
- const Autocomplete_1 = require("@mui/material/Autocomplete");
7
- const virtualization_1 = require("../utils/virtualization");
8
- const FieldTypeOneToMany = ({ label, helperText, placeholder, error, onOpen, options, required, ...props }) => {
9
- const [loaded, setLoaded] = (0, react_1.useState)(false);
10
- const [loading, setLoading] = (0, react_1.useState)(false);
11
- const handleOpen = () => {
12
- if (!loaded && onOpen) {
13
- onOpen().then(() => {
14
- setLoading(false);
15
- });
16
- setLoading(true);
17
- setLoaded(true);
18
- }
19
- };
20
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { onOpen: handleOpen, loading: loading, fullWidth: true, multiple: true, disableListWrap: true, disableClearable: true, disablePortal: true, size: 'small', PopperComponent: StyledPopper, ListboxComponent: virtualization_1.ListboxComponent, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, { ...params, helperText: helperText, error: error, placeholder: placeholder })), options: loading ? [] : options, getOptionLabel: (option) => option.inputLabel, renderOption: (props, option) => [props, option.component], ...props })] }));
21
- };
22
- exports.default = FieldTypeOneToMany;
23
- const StyledPopper = (0, material_1.styled)(material_1.Popper)({
24
- [`& .${Autocomplete_1.autocompleteClasses.listbox}`]: {
25
- boxSizing: 'border-box',
26
- '& ul': {
27
- padding: 0,
28
- margin: 0,
29
- },
30
- },
31
- });
@@ -1,5 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { FieldTypeOneToOneProps } from './';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<FieldTypeOneToOneProps>;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require("./");
7
- exports.default = {
8
- title: 'FieldTypeOneToOne',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)({ component: '- None -', value: '0', inputLabel: '- None -' });
14
- const [options, setOptions] = (0, react_1.useState)([]);
15
- const handleOnOpen = async () => {
16
- const largeArr = new Array(1000).fill(null);
17
- await new Promise((resolve) => setTimeout(resolve, 3000));
18
- const data = largeArr.map((_, idx) => ({ component: (0, jsx_runtime_1.jsx)("div", { children: `Test ${idx}` }), value: String(Math.random()), inputLabel: `Test ${idx}` }));
19
- setOptions(data);
20
- };
21
- const handleOnChange = (e, option) => {
22
- setValue(option);
23
- };
24
- return ((0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange, options: options, onOpen: handleOnOpen }));
25
- };
26
- exports.Default = Template.bind({});
27
- exports.Default.args = {
28
- label: 'OneToOne label',
29
- helperText: 'OneToOne helperText',
30
- placeholder: 'OneToOne placeholder'
31
- };
@@ -1,34 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { AutocompleteProps } from '@mui/material';
3
- export interface FieldTypeOneToOneProps extends Omit<AutocompleteProps<any, false, false, false>, 'onOpen' | 'renderInput'> {
4
- label?: string;
5
- helperText?: string;
6
- placeholder?: string;
7
- error?: boolean;
8
- required?: boolean;
9
- startAdornment?: ReactNode;
10
- endAdornment?: ReactNode;
11
- /**
12
- * Callback to be fired upon opening the dropdown
13
- */
14
- onOpen?: () => Promise<any>;
15
- /**
16
- * Structure for option
17
- */
18
- options: {
19
- /**
20
- * Component to be rendered in the dropdown
21
- */
22
- component: ReactNode | string;
23
- /**
24
- * Value of option
25
- */
26
- value: string;
27
- /**
28
- * Label that should display in the input when selected
29
- */
30
- inputLabel: string;
31
- }[];
32
- }
33
- declare const FieldTypeOneToOne: ({ label, helperText, placeholder, error, onOpen, options, required, startAdornment, endAdornment, ...props }: FieldTypeOneToOneProps) => JSX.Element;
34
- export default FieldTypeOneToOne;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const material_1 = require("@mui/material");
6
- const Autocomplete_1 = require("@mui/material/Autocomplete");
7
- const virtualization_1 = require("../utils/virtualization");
8
- const FieldTypeOneToOne = ({ label, helperText, placeholder, error, onOpen, options, required, startAdornment, endAdornment, ...props }) => {
9
- const [loaded, setLoaded] = (0, react_1.useState)(false);
10
- const [loading, setLoading] = (0, react_1.useState)(false);
11
- const handleOpen = () => {
12
- if (!loaded && onOpen) {
13
- onOpen().then(() => {
14
- setLoading(false);
15
- });
16
- setLoading(true);
17
- setLoaded(true);
18
- }
19
- };
20
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { onOpen: handleOpen, loading: loading, fullWidth: true, disableListWrap: true, disableClearable: true, disablePortal: true, size: 'small', PopperComponent: StyledPopper, ListboxComponent: virtualization_1.ListboxComponent, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, { ...params, helperText: helperText, error: error, placeholder: placeholder, InputProps: {
21
- ...params.InputProps,
22
- startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: 'end', children: startAdornment }),
23
- endAdornment: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [params.InputProps.endAdornment, (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { sx: { position: 'relative', right: '40px' }, position: 'end', children: endAdornment })] })
24
- } })), options: loading ? [] : options, getOptionLabel: (option) => option.inputLabel, renderOption: (props, option) => [props, option.component], ...props })] }));
25
- };
26
- exports.default = FieldTypeOneToOne;
27
- const StyledPopper = (0, material_1.styled)(material_1.Popper)({
28
- [`& .${Autocomplete_1.autocompleteClasses.listbox}`]: {
29
- boxSizing: 'border-box',
30
- '& ul': {
31
- padding: 0,
32
- margin: 0,
33
- },
34
- },
35
- });
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require("./");
7
- exports.default = {
8
- title: 'FieldTypeSort',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)('3');
14
- const handleOnChange = (e) => {
15
- setValue(e.target.value);
16
- };
17
- return ((0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange }));
18
- };
19
- exports.Default = Template.bind({});
20
- exports.Default.args = {
21
- placeholder: 'Placeholder Text...',
22
- label: 'Sort label',
23
- helperText: 'Sort helper text',
24
- error: false,
25
- };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { OutlinedTextFieldProps } from '@mui/material/TextField';
3
- export interface FieldTypeSortProps extends Omit<OutlinedTextFieldProps, 'variant'> {
4
- value: string;
5
- }
6
- declare const FieldTypeSort: ({ label, value, InputProps, required, onChange, ...props }: FieldTypeSortProps) => JSX.Element;
7
- export default FieldTypeSort;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const TextField_1 = require("@mui/material/TextField");
5
- const material_1 = require("@mui/material");
6
- const Add_1 = require("@mui/icons-material/Add");
7
- const Remove_1 = require("@mui/icons-material/Remove");
8
- const FieldTypeSort = ({ label, value, InputProps, required, onChange, ...props }) => {
9
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(TextField_1.default, { size: "small", variant: 'outlined', type: 'number', value: value, onChange: onChange, InputProps: {
10
- startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", onClick: (e) => {
11
- e.stopPropagation();
12
- // References input via click event in order to obtain its value
13
- const input = e.currentTarget?.parentElement?.parentElement?.childNodes?.[1];
14
- const newValue = String(+input.value - 1);
15
- // Updates internal input value in case component is not controlled
16
- input.value = newValue;
17
- // Mocks an event change
18
- const event = { target: { value: newValue } };
19
- onChange && onChange(event);
20
- }, children: (0, jsx_runtime_1.jsx)(Remove_1.default, { fontSize: 'small' }) }) })),
21
- endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", onClick: (e) => {
22
- e.stopPropagation();
23
- // References input via click event in order to obtain its value
24
- const input = e.currentTarget?.parentElement?.parentElement?.childNodes?.[1];
25
- const newValue = String(+input.value + 1);
26
- // Updates internal input value in case component is not controlled
27
- input.value = newValue;
28
- // Mocks an event change
29
- const event = { target: { value: newValue } };
30
- onChange && onChange(event);
31
- }, children: (0, jsx_runtime_1.jsx)(Add_1.default, { fontSize: 'small' }) }) })),
32
- // Spread props at the end to allow Input prop overrides
33
- ...InputProps,
34
- }, ...props })] }));
35
- };
36
- exports.default = FieldTypeSort;
@@ -1,6 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { FieldTypeTextProps } from './';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<FieldTypeTextProps>;
6
- export declare const TextArea: Story<FieldTypeTextProps>;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextArea = exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require("./");
7
- exports.default = {
8
- title: 'FieldTypeText',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)('');
14
- const handleOnChange = (e) => {
15
- setValue(e.target.value);
16
- };
17
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange }) }));
18
- };
19
- exports.Default = Template.bind({});
20
- exports.Default.args = {
21
- placeholder: 'Placeholder Text...',
22
- label: 'Text label',
23
- helperText: 'Text helper text',
24
- };
25
- exports.TextArea = Template.bind({});
26
- exports.TextArea.args = {
27
- multiline: true,
28
- rows: 4,
29
- placeholder: 'Placeholder Text...',
30
- label: 'Text Label',
31
- helperText: 'Text helper text',
32
- };
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { OutlinedTextFieldProps } from '@mui/material/TextField';
3
- export interface FieldTypeTextProps extends Omit<OutlinedTextFieldProps, 'variant'> {
4
- /**
5
- * Max length of the field
6
- * @default 150
7
- */
8
- maxLength?: number;
9
- value: string;
10
- }
11
- declare const FieldTypeText: ({ label, maxLength, value, helperText, required, ...props }: FieldTypeTextProps) => JSX.Element;
12
- export default FieldTypeText;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const TextField_1 = require("@mui/material/TextField");
5
- const material_1 = require("@mui/material");
6
- const FieldTypeText = ({ label, maxLength = 150, value, helperText, required, ...props }) => {
7
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsxs)(material_1.FormLabel, { sx: { display: 'flex', justifyContent: 'space-between', '& .MuiFormLabel-asterisk': { order: 2 } }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { order: 1 }, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { order: 3, flex: 1, textAlign: 'right' }, children: [value?.length, "/", maxLength] })] }), (0, jsx_runtime_1.jsx)(TextField_1.default, { size: "small", variant: 'outlined', value: value, error: value?.length > maxLength, helperText: value?.length > maxLength ? 'Your input is over the specified limit' : helperText, ...props })] }));
8
- };
9
- exports.default = FieldTypeText;
@@ -1,5 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { FieldTypeUrlProps } from './';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<FieldTypeUrlProps>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Default = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const _1 = require("./");
7
- exports.default = {
8
- title: 'FieldTypeUrl',
9
- component: _1.default,
10
- argType: {},
11
- };
12
- const Template = (args) => {
13
- const [value, setValue] = (0, react_1.useState)('');
14
- const handleOnChange = (e) => {
15
- setValue(e.target.value);
16
- };
17
- return ((0, jsx_runtime_1.jsx)(_1.default, { ...args, value: value, onChange: handleOnChange }));
18
- };
19
- exports.Default = Template.bind({});
20
- exports.Default.args = {
21
- placeholder: 'Placeholder Text...',
22
- label: 'Some label',
23
- fullWidth: true,
24
- };
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { OutlinedTextFieldProps } from '@mui/material/TextField';
3
- export interface FieldTypeUrlProps extends Omit<OutlinedTextFieldProps, 'variant'> {
4
- /**
5
- * Max length of the field
6
- * @default 2000
7
- */
8
- maxLength?: number;
9
- value: string;
10
- }
11
- declare const FieldTypeUrl: ({ label, maxLength, value, helperText, required, inputProps, ...props }: FieldTypeUrlProps) => JSX.Element;
12
- export default FieldTypeUrl;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const TextField_1 = require("@mui/material/TextField");
6
- const material_1 = require("@mui/material");
7
- const FieldTypeUrl = ({ label, maxLength = 2000, value, helperText, required, inputProps, ...props }) => {
8
- // Use state to hold input reference to re-render once ref changes in case error needs to be shown on mount
9
- const [inputRef, setInputRef] = (0, react_1.useState)();
10
- return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, required: required, children: [(0, jsx_runtime_1.jsxs)(material_1.FormLabel, { sx: { display: 'flex', justifyContent: 'space-between', '& .MuiFormLabel-asterisk': { order: 2 } }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { order: 1 }, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { order: 3, flex: 1, textAlign: 'right' }, children: [value?.length, "/", maxLength] })] }), (0, jsx_runtime_1.jsx)(TextField_1.default, { size: "small", type: 'url', variant: 'outlined', value: value, inputProps: {
11
- ref: (inputRef) => setInputRef(inputRef),
12
- // Spread props at the end to allow inputProps prop overrides
13
- ...inputProps,
14
- }, error: (value && !inputRef?.validity.valid) || value?.length > maxLength, helperText: value?.length > maxLength ? 'Your input is over the specified limit' : (value && !inputRef?.validity.valid) ? 'Your input is not a valid url' : helperText, ...props })] }));
15
- };
16
- exports.default = FieldTypeUrl;
@@ -1,3 +0,0 @@
1
- import { Theme } from '@mui/material/styles';
2
- declare let theme: Theme;
3
- export default theme;
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const palette_1 = require("./palette");
4
- const typography_1 = require("./typography");
5
- const styles_1 = require("@mui/material/styles");
6
- let theme = (0, styles_1.createTheme)({
7
- palette: palette_1.default,
8
- typography: typography_1.default,
9
- });
10
- theme = (0, styles_1.createTheme)(theme, {
11
- components: {
12
- MuiAccordionSummary: {
13
- styleOverrides: {
14
- root: {
15
- backgroundColor: '#e4e9f1',
16
- },
17
- },
18
- },
19
- MuiButton: {
20
- styleOverrides: {
21
- root: {
22
- minWidth: 'auto',
23
- },
24
- },
25
- },
26
- MuiTooltip: {
27
- styleOverrides: {
28
- tooltip: {
29
- color: theme.palette.primary.contrastText,
30
- backgroundColor: theme.palette.primary.main,
31
- fontSize: '14px',
32
- lineHeight: '20px',
33
- },
34
- arrow: {
35
- color: theme.palette.primary.main,
36
- },
37
- },
38
- },
39
- MuiInputBase: {
40
- styleOverrides: {
41
- root: {
42
- backgroundColor: theme.palette.primary.contrastText,
43
- },
44
- },
45
- },
46
- MuiFormLabel: {
47
- styleOverrides: {
48
- root: {
49
- color: theme.palette.primary.dark,
50
- },
51
- asterisk: {
52
- color: theme.palette.error.main,
53
- },
54
- },
55
- },
56
- MuiCard: {
57
- styleOverrides: {
58
- root: {
59
- overflow: 'visible',
60
- },
61
- },
62
- },
63
- MuiCardHeader: {
64
- styleOverrides: {
65
- root: {
66
- backgroundColor: '#e4e9f1',
67
- },
68
- },
69
- },
70
- MuiToggleButton: {
71
- styleOverrides: {
72
- root: ({ ownerState, theme }) => ({
73
- backgroundColor: `${theme.palette[ownerState.color].contrastText} !important`,
74
- ...(ownerState.selected && {
75
- color: `${theme.palette[ownerState.color].contrastText} !important`,
76
- backgroundColor: `${theme.palette[ownerState.color].main} !important`,
77
- }),
78
- }),
79
- },
80
- },
81
- },
82
- });
83
- exports.default = theme;
@@ -1,3 +0,0 @@
1
- import { PaletteOptions } from '@mui/material/styles';
2
- declare const palette: PaletteOptions;
3
- export default palette;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const palette = {
4
- primary: {
5
- main: '#404759',
6
- contrastText: '#ffffff',
7
- },
8
- secondary: {
9
- main: '#497edf',
10
- contrastText: '#ffffff',
11
- },
12
- success: {
13
- main: '#75bf25',
14
- contrastText: '#ffffff',
15
- },
16
- warning: {
17
- main: '#f17829',
18
- contrastText: '#ffffff',
19
- },
20
- error: {
21
- main: '#e53c05',
22
- contrastText: '#ffffff',
23
- },
24
- };
25
- exports.default = palette;
@@ -1,3 +0,0 @@
1
- import { TypographyVariantsOptions } from '@mui/material/styles';
2
- declare const typography: TypographyVariantsOptions;
3
- export default typography;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const typography = {
4
- fontFamily: "'Mulish'",
5
- };
6
- exports.default = typography;
@@ -1,5 +0,0 @@
1
- import { Story, Meta } from '@storybook/react/types-6-0';
2
- import { VirtualizedAutocompleteProps } from './';
3
- declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
- export default _default;
5
- export declare const Default: Story<VirtualizedAutocompleteProps>;