@idea-fragments/react-components-zendesk 0.1.73 → 0.1.74
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/types/accordions.d.ts +15 -0
- package/dist/types/alert.d.ts +28 -0
- package/dist/types/chats.d.ts +38 -0
- package/dist/types/forms.d.ts +369 -0
- package/dist/types/hooks.d.ts +198 -0
- package/dist/types/icon.d.ts +18 -0
- package/dist/types/layouts.d.ts +336 -0
- package/dist/types/loaders.d.ts +47 -0
- package/dist/types/media.d.ts +142 -0
- package/dist/types/modals.d.ts +149 -0
- package/dist/types/navigation.d.ts +97 -0
- package/dist/types/notifications.d.ts +73 -0
- package/dist/types/styles.d.ts +313 -0
- package/dist/types/tables.d.ts +179 -0
- package/dist/types/tags.d.ts +261 -0
- package/dist/types/text.d.ts +152 -0
- package/dist/types/tooltips.d.ts +67 -0
- package/dist/types/types.d.ts +168 -0
- package/package.json +5 -9
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode, FC } from 'react';
|
|
2
|
+
|
|
3
|
+
type TimeLineItem = {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
dateTime?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
key: string | number;
|
|
8
|
+
};
|
|
9
|
+
type TimelineProps = {
|
|
10
|
+
isAlternate?: boolean;
|
|
11
|
+
data: TimeLineItem[];
|
|
12
|
+
};
|
|
13
|
+
declare const Timeline: FC<TimelineProps>;
|
|
14
|
+
|
|
15
|
+
export { TimeLineItem, Timeline, TimelineProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Nullable } from 'global';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
type StyledComponentProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
declare const ALERT_TYPES: {
|
|
9
|
+
readonly INFO: "info";
|
|
10
|
+
readonly SUCCESS: "success";
|
|
11
|
+
readonly ERROR: "error";
|
|
12
|
+
readonly WARNING: "warning";
|
|
13
|
+
};
|
|
14
|
+
type AlertType = (typeof ALERT_TYPES)[keyof typeof ALERT_TYPES];
|
|
15
|
+
type AlertContent = {
|
|
16
|
+
title?: string;
|
|
17
|
+
body: any;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
type?: AlertType;
|
|
20
|
+
};
|
|
21
|
+
type Props = {
|
|
22
|
+
isVisible: boolean;
|
|
23
|
+
closeAlert: () => void;
|
|
24
|
+
alertContent: Nullable<AlertContent>;
|
|
25
|
+
} & StyledComponentProps;
|
|
26
|
+
declare let Alert: FC<Props>;
|
|
27
|
+
|
|
28
|
+
export { ALERT_TYPES, Alert, AlertContent, AlertType };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as styled_components from 'styled-components';
|
|
2
|
+
import { FlattenSimpleInterpolation } from 'styled-components';
|
|
3
|
+
import { ReactNode, ChangeEvent, FC } from 'react';
|
|
4
|
+
import { Nullable } from 'global';
|
|
5
|
+
|
|
6
|
+
type CSS<T = any> = FlattenSimpleInterpolation | string | T;
|
|
7
|
+
type CSSProp<T = any> = {
|
|
8
|
+
_css?: CSS<T>;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ChatProps = {
|
|
13
|
+
chatBody: ReactNode;
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
header?: ReactNode;
|
|
16
|
+
hideSendButton?: boolean;
|
|
17
|
+
onChange: (text: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
18
|
+
onSaveClicked?: () => void;
|
|
19
|
+
userInputValue?: string;
|
|
20
|
+
} & CSSProp;
|
|
21
|
+
declare const Chat: styled_components.StyledComponent<FC<ChatProps>, styled_components.DefaultTheme, {}, never>;
|
|
22
|
+
|
|
23
|
+
type OverflowMenuItem = {
|
|
24
|
+
label: string;
|
|
25
|
+
action: () => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type ChatMessageProps = {
|
|
29
|
+
actions?: Nullable<OverflowMenuItem[]>;
|
|
30
|
+
dateTime: string;
|
|
31
|
+
icon: ReactNode;
|
|
32
|
+
iconBgColor?: string;
|
|
33
|
+
isUserMessage?: boolean;
|
|
34
|
+
message: string;
|
|
35
|
+
} & CSSProp;
|
|
36
|
+
declare const ChatMessage: styled_components.StyledComponent<FC<ChatMessageProps>, styled_components.DefaultTheme, {}, never>;
|
|
37
|
+
|
|
38
|
+
export { Chat, ChatMessage, ChatMessageProps, ChatProps };
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/// <reference types="trusted-types" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import react, { ReactNode, ChangeEvent, ComponentType, PropsWithChildren, FC, Ref } from 'react';
|
|
5
|
+
import { ValueOf } from 'utils/types';
|
|
6
|
+
import * as styled_components from 'styled-components';
|
|
7
|
+
import { FlattenSimpleInterpolation, FlattenInterpolation, ThemeProps } from 'styled-components';
|
|
8
|
+
import { Moment } from 'moment';
|
|
9
|
+
import { IItemProps } from '@zendeskgarden/react-dropdowns/dist/typings/types';
|
|
10
|
+
import { StateChangeOptions } from 'downshift';
|
|
11
|
+
import { Nullable } from 'global';
|
|
12
|
+
|
|
13
|
+
declare const VALIDATION_STATES: {
|
|
14
|
+
readonly ERROR: "error";
|
|
15
|
+
readonly WARNING: "warning";
|
|
16
|
+
readonly SUCCESS: "success";
|
|
17
|
+
readonly NONE: undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type ValidationState = ValueOf<typeof VALIDATION_STATES>;
|
|
21
|
+
type Validation = {
|
|
22
|
+
validation: ValidationState;
|
|
23
|
+
message?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type ColorProps = {
|
|
27
|
+
accent?: boolean;
|
|
28
|
+
color?: string;
|
|
29
|
+
danger?: boolean;
|
|
30
|
+
neutral?: boolean;
|
|
31
|
+
primary?: boolean;
|
|
32
|
+
secondary?: boolean;
|
|
33
|
+
success?: boolean;
|
|
34
|
+
warning?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type ContainerProps = {
|
|
37
|
+
_css?: CSS;
|
|
38
|
+
color?: string;
|
|
39
|
+
compact?: boolean;
|
|
40
|
+
fluid?: boolean;
|
|
41
|
+
className?: any;
|
|
42
|
+
};
|
|
43
|
+
type CSS<T = any> = FlattenSimpleInterpolation | string | T;
|
|
44
|
+
type CSSProp<T = any> = {
|
|
45
|
+
_css?: CSS<T>;
|
|
46
|
+
className?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type FormFieldProps = {
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
emptyState?: ReactNode;
|
|
52
|
+
hint?: ReactNode;
|
|
53
|
+
label?: ReactNode;
|
|
54
|
+
message?: ReactNode;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
validation?: Validation | undefined;
|
|
57
|
+
} & ContainerProps;
|
|
58
|
+
type TextFieldProps<V = string> = {
|
|
59
|
+
autoComplete?: string;
|
|
60
|
+
faux?: boolean;
|
|
61
|
+
small?: boolean;
|
|
62
|
+
type?: string;
|
|
63
|
+
value?: V;
|
|
64
|
+
onChange: (value: V, event: ChangeEvent<HTMLInputElement>) => void;
|
|
65
|
+
} & FormFieldProps;
|
|
66
|
+
|
|
67
|
+
type Props$7 = {
|
|
68
|
+
minimumDate?: Moment;
|
|
69
|
+
disabledDates: Array<Moment>;
|
|
70
|
+
onChange: (d: Moment) => void;
|
|
71
|
+
} & Omit<TextFieldProps, "onChange">;
|
|
72
|
+
declare const DatePickerSelector: {
|
|
73
|
+
(props: Props$7): react_jsx_runtime.JSX.Element;
|
|
74
|
+
COMPONENT_NAME: string;
|
|
75
|
+
defaultProps: {
|
|
76
|
+
onChange: (...args: any) => void;
|
|
77
|
+
emptyState: string;
|
|
78
|
+
disabledDates: never[];
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type ItemProps = Omit<IItemProps, "onClick"> & {
|
|
84
|
+
danger?: boolean;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
} & CSSProp;
|
|
87
|
+
|
|
88
|
+
type SelectorItemKey = string | number | null | undefined;
|
|
89
|
+
type SelectorOptionOptionalAttrs = {
|
|
90
|
+
Component?: ComponentType<PropsWithChildren<Record<string, any>>>;
|
|
91
|
+
componentProps?: Record<string, any>;
|
|
92
|
+
isClearingItem?: boolean;
|
|
93
|
+
isNextItem?: boolean;
|
|
94
|
+
isBackItem?: boolean;
|
|
95
|
+
isAddItem?: boolean;
|
|
96
|
+
isHeaderItem?: boolean;
|
|
97
|
+
itemProps?: Partial<ItemProps>;
|
|
98
|
+
};
|
|
99
|
+
type SelectorOption = {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
} & SelectorOptionOptionalAttrs;
|
|
102
|
+
type OnItemSelectedFunc = ((k: SelectorItemKey) => void) | ((o: SelectorOption | null | undefined) => void);
|
|
103
|
+
type OnItemsSelectedFunc = ((ks: SelectorItemKey[]) => void) | ((o: SelectorOption[] | null | undefined) => void);
|
|
104
|
+
type StateChange = StateChangeOptions<SelectorOption>;
|
|
105
|
+
type Common = FormFieldProps & {
|
|
106
|
+
appendMenuToNode?: HTMLElement;
|
|
107
|
+
clearable?: boolean;
|
|
108
|
+
options: Array<SelectorOption>;
|
|
109
|
+
optionsKeyMap?: {
|
|
110
|
+
[key: string]: SelectorOption;
|
|
111
|
+
};
|
|
112
|
+
keyField: string;
|
|
113
|
+
labelField: string;
|
|
114
|
+
valueField?: string;
|
|
115
|
+
maxMenuHeight?: string;
|
|
116
|
+
menuPopperModifiers?: Record<string, any>[] | undefined;
|
|
117
|
+
placement?: MenuPlacement;
|
|
118
|
+
onStateChange?: (s: StateChange) => void;
|
|
119
|
+
invalidOnNoSelection?: boolean;
|
|
120
|
+
flat?: boolean;
|
|
121
|
+
open?: boolean;
|
|
122
|
+
small?: boolean;
|
|
123
|
+
};
|
|
124
|
+
type SelectorProps = {
|
|
125
|
+
selectedKey?: SelectorItemKey;
|
|
126
|
+
onChange?: OnItemSelectedFunc;
|
|
127
|
+
} & Common;
|
|
128
|
+
type MultiSelectorProps = {
|
|
129
|
+
selectedKeys?: SelectorItemKey[];
|
|
130
|
+
onChange?: OnItemsSelectedFunc;
|
|
131
|
+
} & Common;
|
|
132
|
+
|
|
133
|
+
type MenuPlacement = "start" | "auto" | "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "end" | "end-top" | "end-bottom" | "start-top" | "start-bottom";
|
|
134
|
+
type OptionalSelectorProps = {
|
|
135
|
+
keyField?: string;
|
|
136
|
+
labelField?: string;
|
|
137
|
+
};
|
|
138
|
+
type CommonProps = {
|
|
139
|
+
_css?: CSS;
|
|
140
|
+
appendMenuToNode?: HTMLElement;
|
|
141
|
+
async?: boolean;
|
|
142
|
+
isOpen?: boolean;
|
|
143
|
+
maxMenuHeight?: string;
|
|
144
|
+
menuCSS?: string | FlattenInterpolation<ThemeProps<any>>;
|
|
145
|
+
menuItemComponent?: ComponentType<any>;
|
|
146
|
+
placement?: MenuPlacement;
|
|
147
|
+
returnItemOnChange?: boolean;
|
|
148
|
+
shouldFilterOptions?: boolean;
|
|
149
|
+
small?: boolean;
|
|
150
|
+
trigger?: ReactNode;
|
|
151
|
+
useRawOptions?: boolean;
|
|
152
|
+
};
|
|
153
|
+
type SelectorsProps = (CommonProps & SelectorProps) | (CommonProps & MultiSelectorProps);
|
|
154
|
+
type Props$6 = Omit<SelectorsProps, "keyField" | "labelField"> & OptionalSelectorProps;
|
|
155
|
+
declare let Dropdown: FC<PropsWithChildren<Props$6>>;
|
|
156
|
+
declare const Autocomplete: react.ComponentType<any>;
|
|
157
|
+
declare const Select: react.ComponentType<any>;
|
|
158
|
+
declare const MultiSelect: styled_components.StyledComponent<react.ComponentType<any>, styled_components.DefaultTheme, {}, never>;
|
|
159
|
+
|
|
160
|
+
declare let Selector: ({ disabled, ...props }: SelectorProps) => react_jsx_runtime.JSX.Element;
|
|
161
|
+
|
|
162
|
+
type Props$5 = {
|
|
163
|
+
maxItems?: number;
|
|
164
|
+
selectedKeys: Array<SelectorItemKey>;
|
|
165
|
+
} & MultiSelectorProps;
|
|
166
|
+
declare let MultiSelector: ({ maxItems, ...props }: Props$5) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
|
|
168
|
+
type Props$4 = {
|
|
169
|
+
children?: (o: SelectorOption) => void | ReactNode;
|
|
170
|
+
onSearchTextChange?: (s: string) => void;
|
|
171
|
+
} & SelectorProps;
|
|
172
|
+
declare let SearchableSelector: FC<Props$4>;
|
|
173
|
+
|
|
174
|
+
type Props$3 = {
|
|
175
|
+
minimumDate?: Moment;
|
|
176
|
+
} & TextFieldProps;
|
|
177
|
+
declare const MonthYearSelector: (props: Props$3) => react_jsx_runtime.JSX.Element;
|
|
178
|
+
|
|
179
|
+
type SelectorOptionKeyMapParams = Pick<SelectorProps, "keyField" | "options" | "optionsKeyMap">;
|
|
180
|
+
declare class SelectorOptionKeyMap {
|
|
181
|
+
static call({ keyField, options, optionsKeyMap, }: SelectorOptionKeyMapParams): {
|
|
182
|
+
[key: string]: SelectorOption;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
declare class ArrayToSelectorOptionsConverter {
|
|
187
|
+
static call(list: SelectorItemKey[]): SelectorOption[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare const EmailTextField: (props: TextFieldProps<any>) => react_jsx_runtime.JSX.Element;
|
|
191
|
+
|
|
192
|
+
declare let NumberTextField: ({ onChange, value: numberValue, ...props }: TextFieldProps<number>) => react_jsx_runtime.JSX.Element;
|
|
193
|
+
|
|
194
|
+
type Props$2 = TextFieldProps<any> & {
|
|
195
|
+
newPassword?: boolean;
|
|
196
|
+
};
|
|
197
|
+
declare const PasswordTextField: ({ newPassword, ...props }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
198
|
+
|
|
199
|
+
declare let TextField: react.ForwardRefExoticComponent<{
|
|
200
|
+
autoComplete?: string | undefined;
|
|
201
|
+
faux?: boolean | undefined;
|
|
202
|
+
small?: boolean | undefined;
|
|
203
|
+
type?: string | undefined;
|
|
204
|
+
value?: string | undefined;
|
|
205
|
+
onChange: (value: string, event: react.ChangeEvent<HTMLInputElement>) => void;
|
|
206
|
+
} & {
|
|
207
|
+
disabled?: boolean | undefined;
|
|
208
|
+
emptyState?: react.ReactNode;
|
|
209
|
+
hint?: react.ReactNode;
|
|
210
|
+
label?: react.ReactNode;
|
|
211
|
+
message?: react.ReactNode;
|
|
212
|
+
required?: boolean | undefined;
|
|
213
|
+
validation?: Validation | undefined;
|
|
214
|
+
} & ContainerProps & react.RefAttributes<unknown>>;
|
|
215
|
+
|
|
216
|
+
type TextAreaProps = FormFieldProps & {
|
|
217
|
+
autoExpand?: boolean;
|
|
218
|
+
characterLimit?: number;
|
|
219
|
+
resizable?: boolean;
|
|
220
|
+
value?: string;
|
|
221
|
+
onChange: (text: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
222
|
+
};
|
|
223
|
+
declare const TextArea: FC<TextAreaProps>;
|
|
224
|
+
|
|
225
|
+
type FieldProps = TextFieldProps | TextAreaProps;
|
|
226
|
+
type Props$1 = PropsWithChildren<{
|
|
227
|
+
WrappedComponent: ComponentType<Omit<FieldProps, "onChange" | "validation"> & {
|
|
228
|
+
onChange: ((e: ChangeEvent<HTMLInputElement>) => void) | ((e: ChangeEvent<HTMLTextAreaElement>) => void);
|
|
229
|
+
validation?: string;
|
|
230
|
+
}>;
|
|
231
|
+
compact?: boolean;
|
|
232
|
+
}> & FieldProps;
|
|
233
|
+
declare let TextFieldWrapper: react.ForwardRefExoticComponent<Props$1 & react.RefAttributes<unknown>>;
|
|
234
|
+
|
|
235
|
+
declare const ALIGNMENTS: {
|
|
236
|
+
readonly start: "flex-start";
|
|
237
|
+
readonly center: "center";
|
|
238
|
+
readonly end: "flex-end";
|
|
239
|
+
};
|
|
240
|
+
type Alignment = ValueOf<typeof ALIGNMENTS>;
|
|
241
|
+
|
|
242
|
+
type PromiseFunc<T = any, Rtn = any> = (...o: T[]) => Promise<Rtn>;
|
|
243
|
+
|
|
244
|
+
declare const BUTTON_SIZES: {
|
|
245
|
+
readonly SMALL: "small";
|
|
246
|
+
readonly LARGE: "large";
|
|
247
|
+
};
|
|
248
|
+
type ButtonSize = (typeof BUTTON_SIZES)[keyof typeof BUTTON_SIZES];
|
|
249
|
+
type AutoLoadable = {
|
|
250
|
+
autoLoadable: true;
|
|
251
|
+
onClick: PromiseFunc;
|
|
252
|
+
};
|
|
253
|
+
type ButtonBaseProps = PropsWithChildren<{
|
|
254
|
+
alignItems?: string;
|
|
255
|
+
alignSelf?: Alignment;
|
|
256
|
+
autoLoadable?: boolean;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
flat?: boolean;
|
|
259
|
+
groupKey?: string;
|
|
260
|
+
icon?: Nullable<string | ComponentType>;
|
|
261
|
+
iconPosition?: "left" | "right";
|
|
262
|
+
iconSize?: string;
|
|
263
|
+
inline?: boolean;
|
|
264
|
+
innerAs?: string;
|
|
265
|
+
innerRef?: Ref<HTMLButtonElement>;
|
|
266
|
+
loading?: boolean;
|
|
267
|
+
pill?: boolean;
|
|
268
|
+
primary?: boolean;
|
|
269
|
+
size?: ButtonSize;
|
|
270
|
+
wrapInlineText?: boolean;
|
|
271
|
+
onClick: () => void;
|
|
272
|
+
}> & CSSProp & ColorProps & ContainerProps;
|
|
273
|
+
type ControlledLoadable = {
|
|
274
|
+
loading?: boolean;
|
|
275
|
+
onClick: () => void;
|
|
276
|
+
};
|
|
277
|
+
type ButtonProps = (ButtonBaseProps & ControlledLoadable) | (ButtonBaseProps & AutoLoadable);
|
|
278
|
+
declare const Button: ComponentType<ButtonProps>;
|
|
279
|
+
|
|
280
|
+
type Option = {
|
|
281
|
+
label: string;
|
|
282
|
+
value: string;
|
|
283
|
+
};
|
|
284
|
+
type CycleButtonProps = Omit<ButtonProps, "onClick"> & {
|
|
285
|
+
options: Array<Option>;
|
|
286
|
+
selectedOption: string;
|
|
287
|
+
onCycleChanged: (value: string) => void;
|
|
288
|
+
};
|
|
289
|
+
declare const CycleButton: ({ options, selectedOption, onCycleChanged, ...buttonProps }: CycleButtonProps) => react_jsx_runtime.JSX.Element;
|
|
290
|
+
|
|
291
|
+
type FileChangeHandler = {
|
|
292
|
+
multiple?: false;
|
|
293
|
+
onFileChange: (f: File) => void;
|
|
294
|
+
onFilesChange?: (files: File[]) => void;
|
|
295
|
+
} | {
|
|
296
|
+
multiple: true;
|
|
297
|
+
onFileChange?: (f: File) => void;
|
|
298
|
+
onFilesChange: (files: File[]) => void;
|
|
299
|
+
};
|
|
300
|
+
type FileButtonProps = Omit<ButtonProps, "onClick"> & FileChangeHandler;
|
|
301
|
+
declare const FileButton: FC<FileButtonProps>;
|
|
302
|
+
|
|
303
|
+
type IconButtonProps = Omit<ButtonProps, "children">;
|
|
304
|
+
declare const IconButton: styled_components.StyledComponent<({ primary, flat, pill, ...props }: IconButtonProps) => JSX.Element, styled_components.DefaultTheme, IconButtonProps, never>;
|
|
305
|
+
|
|
306
|
+
type CheckboxProps = FormFieldProps & {
|
|
307
|
+
checked?: boolean;
|
|
308
|
+
indeterminate?: boolean;
|
|
309
|
+
onChange: (checked: boolean) => void;
|
|
310
|
+
};
|
|
311
|
+
declare let Checkbox: ({ checked: checkedProp, compact, emptyState, fluid, hint, indeterminate, label, message, validation, onChange, ...props }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
type MediaQuery = (styles: CSS) => CSS;
|
|
314
|
+
|
|
315
|
+
type ResponsiveProps<P> = {
|
|
316
|
+
mediaQueryFunc: MediaQuery;
|
|
317
|
+
props: P;
|
|
318
|
+
};
|
|
319
|
+
type FlexBoxProps = {
|
|
320
|
+
alignItems?: string;
|
|
321
|
+
gap?: string | null | "unset";
|
|
322
|
+
fluid?: boolean;
|
|
323
|
+
inline?: boolean;
|
|
324
|
+
justifyContent?: string;
|
|
325
|
+
responsivePropsList?: ResponsiveProps<FlexBoxProps>[];
|
|
326
|
+
withRows?: boolean;
|
|
327
|
+
wrapped?: boolean;
|
|
328
|
+
} & CSSProp;
|
|
329
|
+
|
|
330
|
+
type FormProps = PropsWithChildren<{
|
|
331
|
+
onSubmit: PromiseFunc;
|
|
332
|
+
}> & ContainerProps & FlexBoxProps;
|
|
333
|
+
declare let Form: FC<FormProps>;
|
|
334
|
+
|
|
335
|
+
type NPSScore = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
336
|
+
type NPSQuestionProps = {
|
|
337
|
+
label: ReactNode;
|
|
338
|
+
onChange: (n: NPSScore) => void;
|
|
339
|
+
value: Nullable<NPSScore>;
|
|
340
|
+
};
|
|
341
|
+
declare const NPSQuestion: FC<NPSQuestionProps>;
|
|
342
|
+
|
|
343
|
+
type Props = {
|
|
344
|
+
checked?: boolean;
|
|
345
|
+
color?: string;
|
|
346
|
+
disabled?: boolean;
|
|
347
|
+
hint?: ReactNode;
|
|
348
|
+
label?: string;
|
|
349
|
+
onChange: (checked: boolean) => void;
|
|
350
|
+
success?: boolean;
|
|
351
|
+
};
|
|
352
|
+
type ToggleProps = Props;
|
|
353
|
+
declare let Toggle: FC<Props>;
|
|
354
|
+
|
|
355
|
+
type TaggedToggleProps = ToggleProps & {
|
|
356
|
+
active?: boolean;
|
|
357
|
+
activeText?: string;
|
|
358
|
+
inactiveText?: string;
|
|
359
|
+
toggleColor?: string;
|
|
360
|
+
};
|
|
361
|
+
declare const TaggedToggle: ({ active, checked, color, activeText, label, inactiveText, onChange, success, toggleColor, ...props }: TaggedToggleProps) => react_jsx_runtime.JSX.Element;
|
|
362
|
+
|
|
363
|
+
type ValidatedFormProps = {
|
|
364
|
+
invalidFields: {
|
|
365
|
+
[key: string]: Array<string>;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export { ArrayToSelectorOptionsConverter, Autocomplete, BUTTON_SIZES, Button, ButtonProps, ButtonSize, Checkbox, CheckboxProps, CycleButton, DatePickerSelector, Dropdown, EmailTextField, FileButton, FileButtonProps, Form, FormFieldProps, FormProps, IconButton, IconButtonProps, MenuPlacement, MonthYearSelector, MultiSelect, MultiSelector, MultiSelectorProps, NPSQuestion, NPSQuestionProps, NPSScore, NumberTextField, OnItemSelectedFunc, OnItemsSelectedFunc, PasswordTextField, SearchableSelector, Select, Selector, SelectorItemKey, SelectorOption, SelectorOptionKeyMap, SelectorOptionKeyMapParams, SelectorOptionOptionalAttrs, SelectorProps, StateChange, TaggedToggle, TaggedToggleProps, TextArea, TextAreaProps, TextField, TextFieldProps, TextFieldWrapper, Toggle, ToggleProps, VALIDATION_STATES, ValidatedFormProps, Validation, ValidationState };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ComponentType } from 'react';
|
|
2
|
+
import { FlattenSimpleInterpolation, ThemedStyledProps } from 'styled-components';
|
|
3
|
+
import { Nullable } from 'global';
|
|
4
|
+
|
|
5
|
+
type CSS<T = any> = FlattenSimpleInterpolation | string | T;
|
|
6
|
+
type CSSProp<T = any> = {
|
|
7
|
+
_css?: CSS<T>;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type LoadingFunc = <T>(p: Promise<T>) => Promise<T>;
|
|
12
|
+
type LoaderProps = PropsWithChildren<{
|
|
13
|
+
as?: ComponentType;
|
|
14
|
+
}> & CSSProp;
|
|
15
|
+
type Return = {
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
Loader: FC<LoaderProps>;
|
|
18
|
+
withLoading: LoadingFunc;
|
|
19
|
+
};
|
|
20
|
+
declare const useLoaderV2: () => Return;
|
|
21
|
+
|
|
22
|
+
type StyledProps<Props = {}> = ThemedStyledProps<Props, Theme>;
|
|
23
|
+
|
|
24
|
+
type FullSpectrumColors = {
|
|
25
|
+
100: string;
|
|
26
|
+
200: string;
|
|
27
|
+
300: string;
|
|
28
|
+
400: string;
|
|
29
|
+
500: string;
|
|
30
|
+
600: string;
|
|
31
|
+
700: string;
|
|
32
|
+
800: string;
|
|
33
|
+
};
|
|
34
|
+
type PartialSpectrumColors = {
|
|
35
|
+
400: string;
|
|
36
|
+
M400: string;
|
|
37
|
+
600: string;
|
|
38
|
+
M600: string;
|
|
39
|
+
};
|
|
40
|
+
type ContainerStyles = {
|
|
41
|
+
background?: string;
|
|
42
|
+
borderRadius?: string;
|
|
43
|
+
height?: string;
|
|
44
|
+
margin?: string;
|
|
45
|
+
padding?: string;
|
|
46
|
+
shadow?: string;
|
|
47
|
+
zIndex?: number;
|
|
48
|
+
};
|
|
49
|
+
type Styles = {
|
|
50
|
+
appBar: Required<Pick<ContainerStyles, "background" | "height" | "shadow" | "zIndex">> & {
|
|
51
|
+
screenPosition: "top" | "bottom";
|
|
52
|
+
};
|
|
53
|
+
border: {
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
buttons: {
|
|
57
|
+
textTransform: Nullable<string>;
|
|
58
|
+
};
|
|
59
|
+
chat: {
|
|
60
|
+
message: {
|
|
61
|
+
currentUser: {
|
|
62
|
+
icon: {
|
|
63
|
+
background: string;
|
|
64
|
+
};
|
|
65
|
+
text: {
|
|
66
|
+
background: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
other: {
|
|
70
|
+
icon: {
|
|
71
|
+
background: string;
|
|
72
|
+
};
|
|
73
|
+
text: {
|
|
74
|
+
background: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
colorAccent: string;
|
|
80
|
+
colorDanger: string;
|
|
81
|
+
colorPrimary: string;
|
|
82
|
+
colorPrimaryDark: string;
|
|
83
|
+
colorSuccess: string;
|
|
84
|
+
colorTertiary: string;
|
|
85
|
+
colorWarning: string;
|
|
86
|
+
colors: {
|
|
87
|
+
black: string;
|
|
88
|
+
white: string;
|
|
89
|
+
product: {};
|
|
90
|
+
grey: FullSpectrumColors;
|
|
91
|
+
blue: FullSpectrumColors;
|
|
92
|
+
red: FullSpectrumColors;
|
|
93
|
+
yellow: FullSpectrumColors;
|
|
94
|
+
green: FullSpectrumColors;
|
|
95
|
+
kale: FullSpectrumColors;
|
|
96
|
+
fuschia: PartialSpectrumColors;
|
|
97
|
+
pink: PartialSpectrumColors;
|
|
98
|
+
crimson: PartialSpectrumColors;
|
|
99
|
+
orange: PartialSpectrumColors;
|
|
100
|
+
lemon: PartialSpectrumColors;
|
|
101
|
+
lime: PartialSpectrumColors;
|
|
102
|
+
mint: PartialSpectrumColors;
|
|
103
|
+
teal: PartialSpectrumColors;
|
|
104
|
+
azure: PartialSpectrumColors;
|
|
105
|
+
royal: PartialSpectrumColors;
|
|
106
|
+
purple: PartialSpectrumColors;
|
|
107
|
+
};
|
|
108
|
+
container: {
|
|
109
|
+
horizontalPadding: string;
|
|
110
|
+
};
|
|
111
|
+
drawer: {
|
|
112
|
+
width: string;
|
|
113
|
+
};
|
|
114
|
+
font: {
|
|
115
|
+
size: string;
|
|
116
|
+
};
|
|
117
|
+
footer: {
|
|
118
|
+
background: string;
|
|
119
|
+
};
|
|
120
|
+
infoPanel: {
|
|
121
|
+
background: string;
|
|
122
|
+
};
|
|
123
|
+
modal: {
|
|
124
|
+
backdrop: {
|
|
125
|
+
background: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
nav: {
|
|
129
|
+
linkColor: string;
|
|
130
|
+
};
|
|
131
|
+
notifications: {
|
|
132
|
+
zIndex: number;
|
|
133
|
+
};
|
|
134
|
+
overlayBackground: string;
|
|
135
|
+
pageBackground: string;
|
|
136
|
+
scrollbar: {
|
|
137
|
+
thumbColor: string;
|
|
138
|
+
trackColor: string;
|
|
139
|
+
};
|
|
140
|
+
scrollbarColor: string;
|
|
141
|
+
section: ContainerStyles & {
|
|
142
|
+
body: {
|
|
143
|
+
padding: string;
|
|
144
|
+
};
|
|
145
|
+
header: {
|
|
146
|
+
padding: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
sidebar: {
|
|
150
|
+
actionButton: {
|
|
151
|
+
borderRadius: string;
|
|
152
|
+
color: string;
|
|
153
|
+
};
|
|
154
|
+
background: string;
|
|
155
|
+
boxShadow: string;
|
|
156
|
+
padding: string;
|
|
157
|
+
width: string;
|
|
158
|
+
zIndex: number;
|
|
159
|
+
};
|
|
160
|
+
table: {
|
|
161
|
+
borderColor: string;
|
|
162
|
+
borderSize: string;
|
|
163
|
+
filterButtonIcon: Nullable<string>;
|
|
164
|
+
};
|
|
165
|
+
textColorDark: string;
|
|
166
|
+
textColorLight: string;
|
|
167
|
+
textColorOverPrimaryBg: string;
|
|
168
|
+
textColorPrimary: string;
|
|
169
|
+
textColorSecondary: string;
|
|
170
|
+
tooltip: {
|
|
171
|
+
darkBackground: string;
|
|
172
|
+
};
|
|
173
|
+
getTextColorForBackground: (p: StyledProps<{
|
|
174
|
+
color: string;
|
|
175
|
+
}>) => string;
|
|
176
|
+
};
|
|
177
|
+
type Theme = {
|
|
178
|
+
isDark: boolean;
|
|
179
|
+
styles: Styles;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
declare const useTheme: () => Theme;
|
|
183
|
+
|
|
184
|
+
declare const useIsMounted: () => () => boolean;
|
|
185
|
+
|
|
186
|
+
type Measurements = {
|
|
187
|
+
isLargeComputer: boolean;
|
|
188
|
+
isLargeTablet: boolean;
|
|
189
|
+
isLargeTabletOrLarger: boolean;
|
|
190
|
+
isLargeTabletOrSmaller: boolean;
|
|
191
|
+
isPhone: boolean;
|
|
192
|
+
isSmallComputer: boolean;
|
|
193
|
+
isSmallComputerOrLarger: boolean;
|
|
194
|
+
isTablet: boolean;
|
|
195
|
+
};
|
|
196
|
+
declare const useDeviceSizeWatcher: () => Measurements;
|
|
197
|
+
|
|
198
|
+
export { Measurements, useDeviceSizeWatcher, useIsMounted, useLoaderV2, useTheme };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentType, SVGAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type SVGComponent = ComponentType<SVGAttributes<any>>;
|
|
5
|
+
type Props = {
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: number | string;
|
|
8
|
+
svg: string | Array<string> | SVGComponent;
|
|
9
|
+
title?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
};
|
|
12
|
+
type IconProps = Props;
|
|
13
|
+
declare const Icon: {
|
|
14
|
+
({ color, size, svg, title, onClick, }: Props): react_jsx_runtime.JSX.Element;
|
|
15
|
+
COMPONENT_NAME: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Icon, IconProps };
|