@cagatayfdn/flora-components 0.0.6 → 0.0.9

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.
@@ -0,0 +1,542 @@
1
+ /// <reference types="react" />
2
+
3
+ import { AxiosError } from 'axios';
4
+ import { CustomLocale } from 'flatpickr/dist/types/locale';
5
+ import { Dispatch as Dispatch_2 } from 'react';
6
+ import { FC } from 'react';
7
+ import i18n from 'i18next';
8
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
9
+ import { LinkProps } from 'react-router-dom';
10
+ import { MouseEvent as MouseEvent_2 } from 'react';
11
+ import NiceModal from '@ebay/nice-modal-react';
12
+ import { NiceModalHocProps } from '@ebay/nice-modal-react';
13
+ import { default as React_2 } from 'react';
14
+ import { ReactNode } from 'react';
15
+ import { SetStateAction } from 'react';
16
+ import { TFunction } from 'i18next';
17
+
18
+ declare type Actiontype = {
19
+ type: 'login_pending';
20
+ } | {
21
+ type: 'active_user_success';
22
+ payload: UserEntity;
23
+ } | {
24
+ type: 'login_failure';
25
+ payload: any;
26
+ } | {
27
+ type: 'active_user_failure';
28
+ payload: any;
29
+ } | {
30
+ type: 'register_pending';
31
+ } | {
32
+ type: 'register_failure';
33
+ payload: any;
34
+ } | {
35
+ type: 'no_active_user';
36
+ } | {
37
+ type: 'signout';
38
+ };
39
+
40
+ export declare enum AppAndServicesStatusApperenceType {
41
+ ADDONS_INITIALIZING = "addons_initializing",
42
+ ADDONS_ADDONS_INITILIZATION_FAILED = "addons_initialization_failed",
43
+ DEPLOYING = "deploying",
44
+ FAILED = "failed",
45
+ DEPLOYED = "deployed",
46
+ INITIALIZING = "initializing",
47
+ INITIALIZING_FAILED = "initialization_failed",
48
+ QUEUEING = "queueing",
49
+ QUEUED = "queued"
50
+ }
51
+
52
+ export declare enum AppearanceAlertCard {
53
+ DANGER = "danger",
54
+ WARNING = "warning"
55
+ }
56
+
57
+ export declare enum AppearanceButton {
58
+ LINK = "link",
59
+ DEFAULT = "default",
60
+ PRIMARY = "primary",
61
+ DANGER = "danger",
62
+ SUCCESS = "success",
63
+ WARNING = "warning",
64
+ DARK = "dark"
65
+ }
66
+
67
+ export declare enum AppearanceDirection {
68
+ TOP = "top",
69
+ RIGHT = "right",
70
+ BOTTOM = "bottom",
71
+ LEFT = "left"
72
+ }
73
+
74
+ export declare enum AppearanceSpinner {
75
+ LIGHT = "light",
76
+ DARK = "dark",
77
+ LIGHT_FULL = "light_full",
78
+ DARK_FULL = "darkFull"
79
+ }
80
+
81
+ export declare enum AppearanceTag {
82
+ DANGER = "danger",
83
+ SUCCESS = "success",
84
+ WARNING = "warning"
85
+ }
86
+
87
+ export declare enum ApplicationTypeSlug {
88
+ COMMERCE = "commerce",
89
+ ZERO = "zero",
90
+ DEMO_AKINON_ZERO = "demo-akinon-zero",
91
+ INSTORE = "instore",
92
+ SALES_CHANNEL = "sales-channel",
93
+ BI_TOOL = "bi-tool",
94
+ OMNITRON_FRONTEND = "omnitron-frontend",
95
+ OMS = "oms",
96
+ EXTENSION = "extension",
97
+ SELLER_CENTER_FRONTEND = "seller_center_fe",
98
+ SELLER_CENTER_BACKEND = "seller_center_be",
99
+ OMNITRON = "omnitron"
100
+ }
101
+
102
+ export declare enum AppTypeEnum {
103
+ SERVICE = "service",
104
+ APPLICATION = "application"
105
+ }
106
+
107
+ declare type AuthContextType = [state: State & {
108
+ token?: string;
109
+ }, dispatch: Dispatch];
110
+
111
+ export declare const AuthProvider: (props: {
112
+ children: React_2.ReactNode;
113
+ }) => JSX_2.Element;
114
+
115
+ export declare const Button: ({ children, size, isLoading, isDisabled, isBlock, noBorder, isSolid, type, className, prefixIcon, appearance, onClick, }: ButtonProps) => JSX.Element;
116
+
117
+ declare type ButtonProps = {
118
+ children: ReactNode;
119
+ appearance?: AppearanceButton;
120
+ size?: Size;
121
+ type?: 'submit' | 'button';
122
+ className?: string;
123
+ autoFocus?: boolean;
124
+ isBlock?: boolean;
125
+ isLoading?: boolean;
126
+ isDisabled?: boolean;
127
+ noBorder?: boolean;
128
+ isSolid?: boolean;
129
+ prefixIcon?: Icons;
130
+ } & Omit<EventProps<HTMLButtonElement>, 'onKeyPress' | 'onKeyUp' | 'onKeydown' | 'onChange'>;
131
+
132
+ export declare const changeLanguage: (user: any, t: TFunction) => void;
133
+
134
+ export declare const Column: ({ children, auto, size, sm, md, lg, xl, className, }: ColumnProps) => JSX.Element;
135
+
136
+ declare type ColumnProps = {
137
+ children: ReactNode;
138
+ auto?: boolean;
139
+ size?: number;
140
+ sm?: number;
141
+ md?: number;
142
+ lg?: number;
143
+ xl?: number;
144
+ className?: string;
145
+ };
146
+
147
+ export declare const Confirm: FC<ConfirmProps & NiceModalHocProps>;
148
+
149
+ declare type ConfirmProps = {
150
+ id: string;
151
+ onClose?: () => void;
152
+ okBtnCallback: () => void;
153
+ description: ReactNode;
154
+ descriptionClassName?: string;
155
+ isLoading?: boolean;
156
+ appearence?: ThemeAppearance;
157
+ title?: string;
158
+ okBtnText?: string;
159
+ cancelBtnText?: string;
160
+ };
161
+
162
+ export declare enum CopyTextStatusEnum {
163
+ SUCCESS = "success",
164
+ ERROR = "error"
165
+ }
166
+
167
+ declare type Dispatch = React_2.Dispatch<Actiontype>;
168
+
169
+ export declare enum DividerAppearance {
170
+ LIGHT = "light",
171
+ GREY = "grey"
172
+ }
173
+
174
+ declare interface EventProps<T = HTMLElement> {
175
+ onClick?: (e: React.MouseEvent<T>) => void;
176
+ onFocus?: (e: React.FocusEvent<T>) => void;
177
+ onBlur?: (e: React.FocusEvent<T>) => void;
178
+ onChange?: (e: React.ChangeEvent<T>) => void;
179
+ onKeyPress?: (e: React.KeyboardEvent<T>) => void;
180
+ onKeyUp?: (e: React.KeyboardEvent<T>) => void;
181
+ onKeyDown?: (e: React.KeyboardEvent<T>) => void;
182
+ onMouseDown?: (e: React.MouseEventHandler<T>) => void;
183
+ onMouseUp?: (e: React.MouseEventHandler<T>) => void;
184
+ onMouseEnter?: (e: React.MouseEventHandler<T>) => void;
185
+ onMouseLeave?: (e: React.MouseEventHandler<T>) => void;
186
+ onInvalid?: (e: React.FormEvent<T>) => void;
187
+ }
188
+
189
+ export declare enum FormFieldAppearance {
190
+ LIGHT = "light",
191
+ DARK = "dark",
192
+ MORE_DARK = "more_dark"
193
+ }
194
+
195
+ export declare function getCurrentLanguage(): string;
196
+
197
+ export declare function getDatepickerLocale(): "en" | CustomLocale;
198
+
199
+ declare type HashMap<K extends string | number, V> = {
200
+ [key in K]: V
201
+ }
202
+
203
+ export { i18n }
204
+
205
+ export declare const Icon: (props: IconProps) => JSX.Element;
206
+
207
+ declare type IconProps = {
208
+ id?: string;
209
+ name: IconsId;
210
+ isDisabled?: boolean;
211
+ onClick?: (e: MouseEvent_2<HTMLElement>) => void;
212
+ style?: any;
213
+ className?: string;
214
+ };
215
+
216
+ declare enum Icons {
217
+ Applications = "applications",
218
+ Attach = "attach",
219
+ Attachment = "attachment",
220
+ Billing = "billing",
221
+ Box = "box",
222
+ Calendar = "calendar",
223
+ Cart = "cart",
224
+ Certificate = "certificate",
225
+ Check = "check",
226
+ ChevronLeft = "chevron-left",
227
+ ChevronRight = "chevron-right",
228
+ CircleMinus = "circle-minus",
229
+ CirclePlus = "circle-plus",
230
+ Clock = "clock",
231
+ Close = "close",
232
+ Copy = "copy",
233
+ CreditCard = "credit-card",
234
+ Document = "document",
235
+ DomainRegistration = "domain-registration",
236
+ Domains = "domains",
237
+ DownArrow = "down-arrow",
238
+ DownSquare = "down-square",
239
+ Down = "down",
240
+ Download = "download",
241
+ EditOutline = "edit-outline",
242
+ Edit = "edit",
243
+ Email = "email",
244
+ Environment = "environment",
245
+ ErrorFill = "error-fill",
246
+ Error = "error",
247
+ FileTextOutlined = "fileTextOutlined",
248
+ Info = "info",
249
+ Install = "install",
250
+ Link = "link",
251
+ Log = "log",
252
+ MenuClose = "menu-close",
253
+ MenuOpen = "menu-open",
254
+ Monitoring = "monitoring",
255
+ Network = "network",
256
+ NoResults = "no-results",
257
+ NotEdit = "not-edit",
258
+ Path = "path",
259
+ Plus = "plus",
260
+ Preview = "preview",
261
+ Profile = "profile",
262
+ ProjectList = "project-list",
263
+ Projects = "projects",
264
+ Reload = "reload",
265
+ Retry = "retry",
266
+ Search = "search",
267
+ Settings = "settings",
268
+ Support = "support",
269
+ Trash = "trash",
270
+ Users = "users",
271
+ Warning = "warning"
272
+ }
273
+
274
+ declare type IconsId = 'applications' | 'attach' | 'attachment' | 'billing' | 'box' | 'calendar' | 'cart' | 'certificate' | 'check' | 'chevron-left' | 'chevron-right' | 'circle-minus' | 'circle-plus' | 'clock' | 'close' | 'copy' | 'credit-card' | 'document' | 'domain-registration' | 'domains' | 'down-arrow' | 'down-square' | 'down' | 'download' | 'edit-outline' | 'edit' | 'email' | 'environment' | 'error-fill' | 'error' | 'fileTextOutlined' | 'info' | 'install' | 'link' | 'log' | 'menu-close' | 'menu-open' | 'monitoring' | 'network' | 'no-results' | 'not-edit' | 'path' | 'plus' | 'preview' | 'profile' | 'project-list' | 'projects' | 'reload' | 'retry' | 'search' | 'settings' | 'support' | 'trash' | 'users' | 'warning';
275
+
276
+ export declare enum isActiveColor {
277
+ inActive = "#4482ff",
278
+ active = "#3f4b5c"
279
+ }
280
+
281
+ export declare const Loading: ({ className, appearance, layer, wrapperClass, }: LoadingProps) => JSX.Element;
282
+
283
+ declare type LoadingProps = {
284
+ className?: string;
285
+ wrapperClass?: string;
286
+ appearance?: AppearanceSpinner;
287
+ layer?: boolean;
288
+ };
289
+
290
+ declare type MappedObjectPermission = HashMap<PermissionsType, number[]>
291
+
292
+ export declare const Modal: (props: ModalProps) => JSX.Element;
293
+
294
+ export declare enum ModalAppearanceType {
295
+ DEFAULT = "default",
296
+ SUCCESS = "success"
297
+ }
298
+
299
+ declare type ModalEvents = {
300
+ onClose: () => void;
301
+ };
302
+
303
+ declare type ModalProps = {
304
+ children: ReactNode;
305
+ visible?: boolean;
306
+ title?: string;
307
+ header?: ReactNode;
308
+ headerClass?: any;
309
+ descriptionClass?: any;
310
+ description?: string;
311
+ className?: string;
312
+ appearance?: ThemeAppearance;
313
+ } & ModalEvents;
314
+
315
+ export { NiceModal }
316
+
317
+ export declare function NoResult(): JSX_2.Element;
318
+
319
+ export declare enum NotificationAppearanceType {
320
+ INFO = "info",
321
+ SUCCESS = "success",
322
+ ERROR = "error",
323
+ WARNING = "warning",
324
+ LOADING = "loading"
325
+ }
326
+
327
+ declare interface Permissions_2 {
328
+ default: boolean
329
+ depends_on: PermissionsType[] | null
330
+ description: string
331
+ name: string
332
+ slug: PermItem
333
+ }
334
+
335
+ declare enum PermissionsSlug {
336
+ Read = 'read',
337
+ Write = 'write',
338
+ Edit = 'edit',
339
+ Delete = 'delete',
340
+ Build = 'build',
341
+ Deploy = 'deploy',
342
+ EditPermissions = 'edit_permissions',
343
+ ViewAddonInfo = 'view_addon_info',
344
+ SetStableVersion = 'set_stable_version',
345
+ AttachCertificate = 'attach_certificate',
346
+ ManageEnvironments = 'manage_environments',
347
+ ManageSecretEnvironments = 'manage_secret_environments',
348
+ Monitor = 'monitor',
349
+ Resend = 'resend',
350
+ ExportZonefile = 'export_zonefile',
351
+ }
352
+
353
+ declare type PermissionsType = `${PermItem}::${PermissionsSlug}`
354
+
355
+ declare interface PermissionTree {
356
+ users: PermissionTreeItem
357
+ roles: PermissionTreeItem
358
+ public_key: PermissionTreeItem
359
+ apps: PermissionTreeItem
360
+ app_versions: PermissionTreeItem
361
+ quality_assurance_report: PermissionTreeItem
362
+ addon_types: PermissionTreeItem
363
+ related_app: PermissionTreeItem
364
+ public_apps: PermissionTreeItem
365
+ public_services: PermissionTreeItem
366
+ projects: PermissionTreeItem
367
+ project_apps: PermissionTreeItem
368
+ export_project_app_log: PermissionTreeItem
369
+ project_app_deployments: PermissionTreeItem
370
+ related_project_app: PermissionTreeItem
371
+ project_app_email: PermissionTreeItem
372
+ addons: PermissionTreeItem
373
+ accounts: PermissionTreeItem
374
+ domain: PermissionTreeItem
375
+ certificate: PermissionTreeItem
376
+ email: PermissionTreeItem
377
+ mail_identity_domain: PermissionTreeItem
378
+ remote_group: PermissionTreeItem
379
+ remote_group_user: PermissionTreeItem
380
+ remote_group_application: PermissionTreeItem
381
+ app_bundle: PermissionTreeItem
382
+ app_bundle_app: PermissionTreeItem
383
+ app_bundle_base_app: PermissionTreeItem
384
+ monitoring: PermissionTreeItem
385
+ kubernetes: PermissionTreeItem
386
+ app_user: PermissionTreeItem
387
+ }
388
+
389
+ declare interface PermissionTreeItem {
390
+ depends_on: PermissionsType[] | null
391
+ description: string
392
+ name: string
393
+ permissions: Permissions_2[]
394
+ slug: PermItem
395
+ }
396
+
397
+ declare type PermItem = keyof PermissionTree
398
+
399
+ export declare enum PodStatusEnum {
400
+ TERMINATED = "Terminated",
401
+ TERMINATING = "Terminating",
402
+ FAILED = "Failed",
403
+ PENDING = "Pending",
404
+ RUNNING = "Running",
405
+ SUCCEEDED = "Succeeded",
406
+ EVICTED = "Evicted"
407
+ }
408
+
409
+ export declare enum ReportStatus {
410
+ PENDING = "pending",
411
+ FAILED = "failed",
412
+ IN_PROGRESS = "analyzing",
413
+ SUCCESS = "completed"
414
+ }
415
+
416
+ declare interface Role {
417
+ pk: number
418
+ name: string
419
+ account: number
420
+ description: string | null
421
+ permission_tree: PermissionTree
422
+ permissions: PermissionsType[]
423
+ }
424
+
425
+ export declare const Row: ({ children, className }: RowProps) => JSX.Element;
426
+
427
+ declare type RowProps = {
428
+ children: ReactNode;
429
+ className?: string;
430
+ };
431
+
432
+ export declare const ScrollContainer: ({ children, maxHeight, height, className, }: ScrollContainerProps) => JSX.Element;
433
+
434
+ declare type ScrollContainerProps = {
435
+ children: ReactNode;
436
+ maxHeight?: number;
437
+ height?: string | number;
438
+ className?: string;
439
+ };
440
+
441
+ export declare enum Size {
442
+ XS = "xsmall",
443
+ SM = "small",
444
+ MD = "normal",
445
+ LG = "large",
446
+ XL = "xlarge"
447
+ }
448
+
449
+ declare interface State {
450
+ user: UserEntity | null;
451
+ status: Status;
452
+ error: AxiosError | null;
453
+ }
454
+
455
+ declare type Status = 'idle' | 'pending' | 'success' | 'rejected';
456
+
457
+ export declare enum StatusEnum {
458
+ addons_initializing = "initializing",
459
+ addons_initialization_failed = "failed",
460
+ deploying = "warning",
461
+ failed = "failed",
462
+ deployed = "success",
463
+ completed = "success",
464
+ initializing = "initializing",
465
+ initialization_failed = "failed",
466
+ queueing = "warning",
467
+ queued = "queued",
468
+ pending = "pending"
469
+ }
470
+
471
+ export declare enum StatusType {
472
+ IDLE = "idle",
473
+ PENDING = "pending",
474
+ FULFILLED = "fulfilled",
475
+ REJECTED = "rejected"
476
+ }
477
+
478
+ export declare const Stepper: ({ items, selected, selectAll, renderAnchor, onChange, wrapperClass, }: StepperProps) => JSX.Element;
479
+
480
+ declare type StepperItemProps = {
481
+ title: string | any;
482
+ customIndexItem?: any;
483
+ activeClass?: any;
484
+ completeClass?: any;
485
+ to?: LinkProps['to'];
486
+ };
487
+
488
+ declare type StepperProps = {
489
+ items: StepperItemProps[];
490
+ selected?: number;
491
+ selectAll?: boolean;
492
+ renderAnchor?: boolean;
493
+ className?: string;
494
+ wrapperClass?: string;
495
+ onChange?: (index: number, event?: any) => void;
496
+ };
497
+
498
+ export declare const t: TFunction;
499
+
500
+ export declare enum ThemeAppearance {
501
+ LIGHT = "light",
502
+ DARK = "dark",
503
+ DARK_BLUE = "dark_blue"
504
+ }
505
+
506
+ export declare const useAuth: () => AuthContextType;
507
+
508
+ export declare function useDisclosure(isOpenInit?: boolean): {
509
+ isOpen: boolean;
510
+ setIsOpen: Dispatch_2<SetStateAction<boolean>>;
511
+ onOpen: () => void;
512
+ onClose: () => void;
513
+ onToggle: () => void;
514
+ };
515
+
516
+ declare type UseNiceModal = [() => void, () => void, string];
517
+
518
+ export declare function useNiceModal(modalId?: string): UseNiceModal;
519
+
520
+ declare interface UserEntity {
521
+ pk: number
522
+ email?: string
523
+ first_name?: string
524
+ last_name?: string
525
+ language?: string
526
+ account?: number
527
+ last_login?: string | null
528
+ permission_tree?: PermissionTree
529
+ is_active?: boolean
530
+ avatar?: string
531
+ role?: Role
532
+ object_permissions: MappedObjectPermission
533
+ permissions: PermissionsType[]
534
+ }
535
+
536
+ export declare const ValidationError: ({ message }: ValidationErrorProps) => JSX.Element;
537
+
538
+ declare type ValidationErrorProps = {
539
+ message: string;
540
+ };
541
+
542
+ export { }