@thecb/components 9.2.0-beta.7 → 9.2.0-beta.8

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/index.d.ts CHANGED
@@ -298,6 +298,101 @@ declare namespace index_d {
298
298
  };
299
299
  }
300
300
 
301
+ interface Field {
302
+ hasErrors: boolean;
303
+ dirty: boolean;
304
+ rawValue: string;
305
+ }
306
+
307
+ interface ReduxAction<T = string, P = {}> {
308
+ type: T;
309
+ payload?: P;
310
+ }
311
+
312
+ /**
313
+ * These types should be moved to and referenced from redux-freeform if it implements TypeScript
314
+ */
315
+
316
+ type ValidatorFn = (value: string) => boolean;
317
+
318
+ interface FieldActionPayload {
319
+ fieldName: string;
320
+ value?: string;
321
+ validator?: ValidatorFn;
322
+ }
323
+
324
+ type SetAction = ReduxAction<"field/SET", FieldActionPayload>;
325
+ type AddValidatorAction = ReduxAction<
326
+ "field/ADD_VALIDATOR",
327
+ FieldActionPayload
328
+ >;
329
+ type RemoveValidatorAction = ReduxAction<
330
+ "field/REMOVE_VALIDATOR",
331
+ FieldActionPayload
332
+ >;
333
+ type ClearAction = ReduxAction<"field/CLEAR">;
334
+
335
+ interface FieldActions {
336
+ set?: (fieldName: string) => (value: string) => SetAction;
337
+ addValidator?: (
338
+ fieldName: string
339
+ ) => (validator: ValidatorFn) => AddValidatorAction;
340
+ removeValidator?: (
341
+ fieldName: string
342
+ ) => (validator: ValidatorFn) => RemoveValidatorAction;
343
+ clear?: () => ClearAction;
344
+ }
345
+
346
+ interface FormSelectOption {
347
+ text?: string;
348
+ value?: string;
349
+ }
350
+
351
+ interface SearchableSelectOption {
352
+ name?: string;
353
+ value?: string;
354
+ }
355
+
356
+ interface ErrorMessageDictionary {
357
+ [fieldName: string]: string;
358
+ }
359
+
360
+ enum ToastVariants {
361
+ ERROR = "error",
362
+ SUCCESS = "success",
363
+ }
364
+
365
+ interface UseToastProps {
366
+ timeout?: number;
367
+ }
368
+
369
+ interface UseToastResult {
370
+ isToastOpen: boolean;
371
+ toastVariant: "" | ToastVariants;
372
+ toastMessage: string;
373
+ showToast: ({
374
+ message,
375
+ variant,
376
+ }: {
377
+ message: string;
378
+ variant: ToastVariants;
379
+ }) => void;
380
+ hideToast: () => void;
381
+ }
382
+
383
+ declare function useToastNotification({
384
+ timeout,
385
+ }: UseToastProps): UseToastResult;
386
+
387
+
388
+
389
+ declare const index_useToastNotification: typeof useToastNotification;
390
+ declare namespace index {
391
+ export {
392
+ index_useToastNotification as useToastNotification,
393
+ };
394
+ }
395
+
301
396
  type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
302
397
 
303
398
  interface AlertProps {
@@ -382,70 +477,6 @@ interface CardProps {
382
477
  declare const Card: React.FC<Expand<CardProps> &
383
478
  React.HTMLAttributes<HTMLElement>>;
384
479
 
385
- interface Field {
386
- hasErrors: boolean;
387
- dirty: boolean;
388
- rawValue: string;
389
- }
390
-
391
- interface ReduxAction<T = string, P = {}> {
392
- type: T;
393
- payload?: P;
394
- }
395
-
396
- /**
397
- * These types should be moved to and referenced from redux-freeform if it implements TypeScript
398
- */
399
-
400
- type ValidatorFn = (value: string) => boolean;
401
-
402
- interface FieldActionPayload {
403
- fieldName: string;
404
- value?: string;
405
- validator?: ValidatorFn;
406
- }
407
-
408
- type SetAction = ReduxAction<"field/SET", FieldActionPayload>;
409
- type AddValidatorAction = ReduxAction<
410
- "field/ADD_VALIDATOR",
411
- FieldActionPayload
412
- >;
413
- type RemoveValidatorAction = ReduxAction<
414
- "field/REMOVE_VALIDATOR",
415
- FieldActionPayload
416
- >;
417
- type ClearAction = ReduxAction<"field/CLEAR">;
418
-
419
- interface FieldActions {
420
- set?: (fieldName: string) => (value: string) => SetAction;
421
- addValidator?: (
422
- fieldName: string
423
- ) => (validator: ValidatorFn) => AddValidatorAction;
424
- removeValidator?: (
425
- fieldName: string
426
- ) => (validator: ValidatorFn) => RemoveValidatorAction;
427
- clear?: () => ClearAction;
428
- }
429
-
430
- interface FormSelectOption {
431
- text?: string;
432
- value?: string;
433
- }
434
-
435
- interface SearchableSelectOption {
436
- name?: string;
437
- value?: string;
438
- }
439
-
440
- interface ErrorMessageDictionary {
441
- [fieldName: string]: string;
442
- }
443
-
444
- enum ToastVariants {
445
- ERROR = "error",
446
- SUCCESS = "success",
447
- }
448
-
449
480
  interface FormInputProps {
450
481
  extraStyles?: string;
451
482
  field?: Field;
@@ -1100,5 +1131,5 @@ interface DefaultPageTemplateProps {
1100
1131
  declare const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
1101
1132
  React.HTMLAttributes<HTMLElement>>;
1102
1133
 
1103
- export { AddValidatorAction, Alert, AlertProps, ArrowDownCircleIconSmall, ArrowDownCircleIconSmallProps, ArrowLeftCircleIconMedium, ArrowLeftCircleIconMediumProps, ArrowLeftCircleIconSmall, ArrowLeftCircleIconSmallProps, ArrowRightCircleIconSmall, ArrowRightCircleIconSmallProps, ArrowUpCircleIconSmall, ArrowUpCircleIconSmallProps, BankIconLarge, BankIconLargeProps, Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, Center, CenterProps, ChargebackIconMedium, ChargebackIconMediumProps, ChargebackIconSmall, ChargebackIconSmallProps, ChargebackReversalIconMedium, ChargebackReversalIconMediumProps, ChargebackReversalIconSmall, ChargebackReversalIconSmallProps, ClearAction, Cluster, ClusterProps, CollapsibleSection, CollapsibleSectionProps, Copyable, CopyableProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, EditableTable, EditableTableProps, ErrorMessageDictionary, ExternalLink, ExternalLinkProps, Field, FieldActionPayload, FieldActions, FooterWithSubfooter, FooterWithSubfooterProps, FormInput, FormInputProps, FormSelect, FormSelectOption, FormSelectProps, GuidedCheckoutImage, HistoryIconSmall, InternalLink, InternalLinkProps, KioskImage, Loading, LoadingProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, PointOfSaleImage, Popover, PopoverProps, ProfileImage, RadioGroup, RadioGroupProps, ReduxAction, RefundIconMedium, RefundIconMediumProps, RefundIconSmall, RefundIconSmallProps, RemoveValidatorAction, RevenueManagementImage, SearchableSelect, SearchableSelectOption, SearchableSelectProps, SetAction, Spinner, SpinnerProps, Stack, StackProps, StandardCheckoutImage, SuccessfulIconMedium, SuccessfulIconMediumProps, SuccessfulIconSmall, SuccessfulIconSmallProps, Switcher, SwitcherProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeading, TableHeadingProps, TableListItem, TableListItemProps, TableProps, TableRow, TableRowProps, Text, TextProps, Title, TitleProps, ToastNotification, ToastNotificationProps, ToastVariants, ValidatorFn, XCircleIconMedium, XCircleIconMediumProps, XCircleIconSmall, XCircleIconSmallProps, index_d as constants };
1134
+ export { AddValidatorAction, Alert, AlertProps, ArrowDownCircleIconSmall, ArrowDownCircleIconSmallProps, ArrowLeftCircleIconMedium, ArrowLeftCircleIconMediumProps, ArrowLeftCircleIconSmall, ArrowLeftCircleIconSmallProps, ArrowRightCircleIconSmall, ArrowRightCircleIconSmallProps, ArrowUpCircleIconSmall, ArrowUpCircleIconSmallProps, BankIconLarge, BankIconLargeProps, Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, Center, CenterProps, ChargebackIconMedium, ChargebackIconMediumProps, ChargebackIconSmall, ChargebackIconSmallProps, ChargebackReversalIconMedium, ChargebackReversalIconMediumProps, ChargebackReversalIconSmall, ChargebackReversalIconSmallProps, ClearAction, Cluster, ClusterProps, CollapsibleSection, CollapsibleSectionProps, Copyable, CopyableProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, EditableTable, EditableTableProps, ErrorMessageDictionary, ExternalLink, ExternalLinkProps, Field, FieldActionPayload, FieldActions, FooterWithSubfooter, FooterWithSubfooterProps, FormInput, FormInputProps, FormSelect, FormSelectOption, FormSelectProps, GuidedCheckoutImage, HistoryIconSmall, InternalLink, InternalLinkProps, KioskImage, Loading, LoadingProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, PointOfSaleImage, Popover, PopoverProps, ProfileImage, RadioGroup, RadioGroupProps, ReduxAction, RefundIconMedium, RefundIconMediumProps, RefundIconSmall, RefundIconSmallProps, RemoveValidatorAction, RevenueManagementImage, SearchableSelect, SearchableSelectOption, SearchableSelectProps, SetAction, Spinner, SpinnerProps, Stack, StackProps, StandardCheckoutImage, SuccessfulIconMedium, SuccessfulIconMediumProps, SuccessfulIconSmall, SuccessfulIconSmallProps, Switcher, SwitcherProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeading, TableHeadingProps, TableListItem, TableListItemProps, TableProps, TableRow, TableRowProps, Text, TextProps, Title, TitleProps, ToastNotification, ToastNotificationProps, ToastVariants, ValidatorFn, XCircleIconMedium, XCircleIconMediumProps, XCircleIconSmall, XCircleIconSmallProps, index_d as constants, index as hooks };
1104
1135
  //# sourceMappingURL=index.d.ts.map