@up42/up-components 0.2.5 → 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.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/components/Box/Box.stories.d.ts +2 -2
- package/dist/cjs/types/components/Button/Button.stories.d.ts +1 -0
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/cjs/types/components/Chip/Chip.stories.d.ts +1 -1
- package/dist/cjs/types/components/EmptyState/EmptyState.d.ts +3 -3
- package/dist/cjs/types/components/EmptyState/EmptyState.stories.d.ts +3 -3
- package/dist/cjs/types/components/Form/Form.stories.d.ts +5 -0
- package/dist/cjs/types/components/FormCheckbox/FormCheckbox.d.ts +5 -8
- package/dist/cjs/types/components/FormCheckbox/FormCheckbox.stories.d.ts +3 -3
- package/dist/cjs/types/components/FormControl/FormControl.overrides.d.ts +3 -0
- package/dist/cjs/types/components/FormInput/FormInput.d.ts +4 -8
- package/dist/cjs/types/components/FormInput/FormInput.stories.d.ts +6 -3
- package/dist/cjs/types/components/FormLabel/FormLabel.d.ts +8 -0
- package/dist/cjs/types/components/FormLabel/FormLabel.test.d.ts +1 -0
- package/dist/cjs/types/components/FormRadio/FormRadio.d.ts +6 -9
- package/dist/cjs/types/components/FormRadio/FormRadio.stories.d.ts +4 -3
- package/dist/cjs/types/components/FormSelect/FormSelect.d.ts +5 -8
- package/dist/cjs/types/components/FormSelect/FormSelect.stories.d.ts +4 -3
- package/dist/cjs/types/components/FormSwitch/FormSwitch.d.ts +4 -7
- package/dist/cjs/types/components/FormSwitch/FormSwitch.stories.d.ts +1 -1
- package/dist/cjs/types/components/Input/Input.d.ts +3 -6
- package/dist/cjs/types/components/Input/Input.overrides.d.ts +1 -0
- package/dist/cjs/types/components/Radio/Radio.stories.d.ts +1 -1
- package/dist/cjs/types/components/Select/Select.stories.d.ts +3 -3
- package/dist/cjs/types/components/Switch/Switch.d.ts +2 -4
- package/dist/cjs/types/components/Switch/Switch.stories.d.ts +1 -2
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +1 -1
- package/dist/cjs/types/components/Typography/Typography.d.ts +3 -4
- package/dist/cjs/types/components/Typography/Typography.stories.d.ts +1 -1
- package/dist/cjs/types/global/utils/types.d.ts +4 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/types/components/Box/Box.stories.d.ts +2 -2
- package/dist/esm/types/components/Button/Button.stories.d.ts +1 -0
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/esm/types/components/Chip/Chip.stories.d.ts +1 -1
- package/dist/esm/types/components/EmptyState/EmptyState.d.ts +3 -3
- package/dist/esm/types/components/EmptyState/EmptyState.stories.d.ts +3 -3
- package/dist/esm/types/components/Form/Form.stories.d.ts +5 -0
- package/dist/esm/types/components/FormCheckbox/FormCheckbox.d.ts +5 -8
- package/dist/esm/types/components/FormCheckbox/FormCheckbox.stories.d.ts +3 -3
- package/dist/esm/types/components/FormControl/FormControl.overrides.d.ts +3 -0
- package/dist/esm/types/components/FormInput/FormInput.d.ts +4 -8
- package/dist/esm/types/components/FormInput/FormInput.stories.d.ts +6 -3
- package/dist/esm/types/components/FormLabel/FormLabel.d.ts +8 -0
- package/dist/esm/types/components/FormLabel/FormLabel.test.d.ts +1 -0
- package/dist/esm/types/components/FormRadio/FormRadio.d.ts +6 -9
- package/dist/esm/types/components/FormRadio/FormRadio.stories.d.ts +4 -3
- package/dist/esm/types/components/FormSelect/FormSelect.d.ts +5 -8
- package/dist/esm/types/components/FormSelect/FormSelect.stories.d.ts +4 -3
- package/dist/esm/types/components/FormSwitch/FormSwitch.d.ts +4 -7
- package/dist/esm/types/components/FormSwitch/FormSwitch.stories.d.ts +1 -1
- package/dist/esm/types/components/Input/Input.d.ts +3 -6
- package/dist/esm/types/components/Input/Input.overrides.d.ts +1 -0
- package/dist/esm/types/components/Radio/Radio.stories.d.ts +1 -1
- package/dist/esm/types/components/Select/Select.stories.d.ts +3 -3
- package/dist/esm/types/components/Switch/Switch.d.ts +2 -4
- package/dist/esm/types/components/Switch/Switch.stories.d.ts +1 -2
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +1 -1
- package/dist/esm/types/components/Typography/Typography.d.ts +3 -4
- package/dist/esm/types/components/Typography/Typography.stories.d.ts +1 -1
- package/dist/esm/types/global/utils/types.d.ts +4 -6
- package/dist/index.d.ts +31 -49
- package/package.json +1 -1
- package/dist/cjs/types/components/Select/Select.overrides.d.ts +0 -2
- package/dist/esm/types/components/Select/Select.overrides.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export { default as tokens } from '@up42/design-system-tokens/dist/json/tokens.json';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
|
-
import {
|
|
4
|
+
import { BoxProps as BoxProps$1, TextFieldProps, ChipProps as ChipProps$1, AvatarProps as AvatarProps$1, ContainerProps as ContainerProps$1, CheckboxProps as CheckboxProps$1, RadioProps as RadioProps$1, RadioGroupProps, SwitchProps as SwitchProps$1, SelectProps as SelectProps$1, LinkProps as LinkProps$1, TabsProps as TabsProps$1, TabProps as TabProps$1 } from '@mui/material';
|
|
5
5
|
export * from '@mui/material';
|
|
6
6
|
import { ThemeProviderProps } from '@mui/material/styles/ThemeProvider';
|
|
7
7
|
import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { ReactNode, ElementType } from 'react';
|
|
9
9
|
import { TypographyProps as TypographyProps$1 } from '@mui/material/Typography';
|
|
10
10
|
import { TableProps as TableProps$1 } from '@mui/material/Table';
|
|
11
11
|
import { TableBodyProps as TableBodyProps$1 } from '@mui/material/TableBody';
|
|
@@ -36,22 +36,25 @@ type MUIGlobalOmit<MuiProps, ComponentProps = unknown> = ComponentProps &
|
|
|
36
36
|
| 'focusVisibleClassName'
|
|
37
37
|
| 'LinkComponent'
|
|
38
38
|
| 'TouchRippleProps'
|
|
39
|
+
| 'touchRippleRef'
|
|
39
40
|
>
|
|
40
41
|
|
|
41
|
-
type BaseProps<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
type BaseProps<D extends React.ElementType = 'div', P = Record<string, unknown>> = BoxProps$1<D, P>
|
|
43
|
+
|
|
44
|
+
type FormBaseProps<C extends React.ElementType> = BaseProps<
|
|
45
|
+
C,
|
|
46
|
+
Pick<TextFieldProps, 'id' | 'label' | 'required' | 'error' | 'disabled' | 'focused' | 'helperText'>
|
|
47
|
+
>
|
|
45
48
|
|
|
46
49
|
declare type ButtonProps = MUIGlobalOmit<ButtonProps$1, {
|
|
47
50
|
loading?: boolean;
|
|
48
51
|
}>;
|
|
49
52
|
declare const Button: ({ color, variant, size, loading, children, ...props }: ButtonProps) => JSX.Element;
|
|
50
53
|
|
|
51
|
-
declare type TypographyProps =
|
|
52
|
-
component?:
|
|
54
|
+
declare type TypographyProps<C extends React.ElementType = 'p'> = TypographyProps$1<C, {
|
|
55
|
+
component?: C;
|
|
53
56
|
}>;
|
|
54
|
-
declare const Typography: ({ children, ...props }: TypographyProps) => JSX.Element;
|
|
57
|
+
declare const Typography: <C extends React.ElementType<any>>({ children, ...props }: TypographyProps<C>) => JSX.Element;
|
|
55
58
|
|
|
56
59
|
declare type ChipProps = MUIGlobalOmit<Omit<ChipProps$1, 'size'>>;
|
|
57
60
|
declare const Chip: ({ label, ...props }: ChipProps) => JSX.Element;
|
|
@@ -94,69 +97,48 @@ declare const Box: ({ children, ...props }: BoxProps) => JSX.Element;
|
|
|
94
97
|
declare type CheckboxProps = MUIGlobalOmit<CheckboxProps$1>;
|
|
95
98
|
declare const Checkbox: ({ ...props }: CheckboxProps) => JSX.Element;
|
|
96
99
|
|
|
97
|
-
declare type FormCheckboxProps =
|
|
100
|
+
declare type FormCheckboxProps<C extends React.ElementType = 'div'> = CheckboxProps & FormBaseProps<C> & {
|
|
98
101
|
data: {
|
|
99
102
|
value: string | number;
|
|
100
103
|
label?: string;
|
|
101
104
|
}[];
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
helperText?: string;
|
|
105
|
-
}>;
|
|
106
|
-
declare const FormCheckbox: ({ id, required, data, label, error, helperText }: FormCheckboxProps) => JSX.Element;
|
|
105
|
+
};
|
|
106
|
+
declare const FormCheckbox: <C extends React.ElementType<any>>({ id, label, required, component, disabled, data, error, helperText, sx, ...props }: FormCheckboxProps<C>) => JSX.Element;
|
|
107
107
|
|
|
108
108
|
declare type RadioProps = MUIGlobalOmit<RadioProps$1>;
|
|
109
109
|
declare const Radio: (props: RadioProps) => JSX.Element;
|
|
110
110
|
|
|
111
|
-
declare type FormRadioProps =
|
|
111
|
+
declare type FormRadioProps<C extends React.ElementType = 'div'> = RadioGroupProps & FormBaseProps<C> & {
|
|
112
112
|
data: {
|
|
113
113
|
value: string | number;
|
|
114
114
|
label?: string;
|
|
115
|
+
message?: string;
|
|
115
116
|
}[];
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
error?: boolean;
|
|
119
|
-
required?: boolean;
|
|
120
|
-
}>;
|
|
121
|
-
declare const FormRadio: ({ id, helperText, label, error, required, name, data }: FormRadioProps) => JSX.Element;
|
|
117
|
+
};
|
|
118
|
+
declare const FormRadio: ({ id, required, component, disabled, data, label, error, helperText, sx, ...props }: FormRadioProps) => JSX.Element;
|
|
122
119
|
|
|
123
|
-
declare type SwitchProps = MUIGlobalOmit<SwitchProps$1
|
|
124
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
125
|
-
}>;
|
|
120
|
+
declare type SwitchProps = MUIGlobalOmit<SwitchProps$1>;
|
|
126
121
|
declare const Switch: (props: SwitchProps) => JSX.Element;
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
id?: string;
|
|
131
|
-
checked?: boolean;
|
|
132
|
-
}
|
|
133
|
-
declare const FormSwitch: ({ id, label, checked }: FormSwitchProps) => JSX.Element;
|
|
123
|
+
declare type FormSwitchProps<C extends React.ElementType = 'div'> = SwitchProps & FormBaseProps<C>;
|
|
124
|
+
declare const FormSwitch: <C extends React.ElementType<any>>({ component, disabled, label, error, sx, ...props }: FormSwitchProps<C>) => JSX.Element;
|
|
134
125
|
|
|
135
126
|
declare type SelectProps = MUIGlobalOmit<Omit<SelectProps$1, 'variant' | 'label'>>;
|
|
136
127
|
declare const Select: (props: SelectProps) => JSX.Element;
|
|
137
128
|
|
|
138
|
-
declare type FormSelectProps =
|
|
129
|
+
declare type FormSelectProps<C extends React.ElementType = 'div'> = SelectProps & FormBaseProps<C> & {
|
|
139
130
|
options: {
|
|
140
131
|
value: string | number;
|
|
141
132
|
text: string;
|
|
142
133
|
}[];
|
|
143
|
-
label?: string;
|
|
144
|
-
error?: boolean;
|
|
145
|
-
helperText?: string;
|
|
146
|
-
}>;
|
|
147
|
-
declare const FormSelect: ({ id, required, options, label, error, placeholder, helperText, value, }: FormSelectProps) => JSX.Element;
|
|
148
|
-
|
|
149
|
-
declare type InputProps = MUIGlobalOmit<TextFieldProps> & {
|
|
150
|
-
type?: HTMLInputTypeAttribute;
|
|
151
134
|
};
|
|
152
|
-
declare const
|
|
135
|
+
declare const FormSelect: ({ id, required, component, disabled, label, error, helperText, sx, options, ...props }: FormSelectProps) => JSX.Element;
|
|
153
136
|
|
|
154
|
-
declare type
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
declare const FormInput: ({ id, required, label, error, helperText, ...props }: FormInputProps) => JSX.Element;
|
|
137
|
+
declare type InputProps = Omit<TextFieldProps, 'maxRows' | 'minRows' | 'multiline' | 'rows' | 'size' | 'variant'>;
|
|
138
|
+
declare const Input: ({ type, ...props }: InputProps) => JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare type FormInputProps<C extends React.ElementType = 'div'> = InputProps & FormBaseProps<C>;
|
|
141
|
+
declare const FormInput: <C extends React.ElementType<any>>({ id, component, required, disabled, label, error, helperText, sx, ...props }: FormInputProps<C>) => JSX.Element;
|
|
160
142
|
|
|
161
143
|
declare type LinkProps<C extends React.ElementType> = LinkProps$1<C, {
|
|
162
144
|
component?: C;
|
|
@@ -209,7 +191,7 @@ declare type TabGroupProps = {
|
|
|
209
191
|
};
|
|
210
192
|
declare const TabGroup: ({ tabs, nameSpace: _nameSpace, tabContentProps, tabsProps }: TabGroupProps) => JSX.Element;
|
|
211
193
|
|
|
212
|
-
declare type EmptyStateProps = BaseProps<{
|
|
194
|
+
declare type EmptyStateProps<C extends React.ElementType = 'div'> = BaseProps<C, {
|
|
213
195
|
/**
|
|
214
196
|
* Helpful message that conveys the purpose of the screen and the next action to populate the space
|
|
215
197
|
*/
|
|
@@ -227,7 +209,7 @@ declare type EmptyStateProps = BaseProps<{
|
|
|
227
209
|
*/
|
|
228
210
|
action?: ReactNode;
|
|
229
211
|
}>;
|
|
230
|
-
declare const EmptyState: ({ icon: Icon, title, subTitle, action, ...props }: EmptyStateProps
|
|
212
|
+
declare const EmptyState: <C extends React.ElementType<any>>({ icon: Icon, title, subTitle, action, ...props }: EmptyStateProps<C>) => JSX.Element;
|
|
231
213
|
|
|
232
214
|
declare type TableProps = MUIGlobalOmit<TableProps$1>;
|
|
233
215
|
declare const Table: ({ children, ...props }: TableProps) => JSX.Element;
|
package/package.json
CHANGED