@thecb/components 9.2.0-beta.1 → 9.2.0-beta.10

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
@@ -99,6 +99,7 @@ declare const COSMOS_RED: Color;
99
99
  declare const BLUSH_RED: Color;
100
100
 
101
101
  declare const ERROR_COLOR: Color;
102
+ declare const ERROR_BACKGROUND_COLOR: Color;
102
103
 
103
104
  declare const ALERT_COLORS: {
104
105
  warn: ColorSet;
@@ -203,6 +204,7 @@ declare const colors_d_FANTASY_RED: typeof FANTASY_RED;
203
204
  declare const colors_d_COSMOS_RED: typeof COSMOS_RED;
204
205
  declare const colors_d_BLUSH_RED: typeof BLUSH_RED;
205
206
  declare const colors_d_ERROR_COLOR: typeof ERROR_COLOR;
207
+ declare const colors_d_ERROR_BACKGROUND_COLOR: typeof ERROR_BACKGROUND_COLOR;
206
208
  declare const colors_d_ALERT_COLORS: typeof ALERT_COLORS;
207
209
  declare const colors_d_PILL_COLORS: typeof PILL_COLORS;
208
210
  declare namespace colors_d {
@@ -282,6 +284,7 @@ declare namespace colors_d {
282
284
  colors_d_COSMOS_RED as COSMOS_RED,
283
285
  colors_d_BLUSH_RED as BLUSH_RED,
284
286
  colors_d_ERROR_COLOR as ERROR_COLOR,
287
+ colors_d_ERROR_BACKGROUND_COLOR as ERROR_BACKGROUND_COLOR,
285
288
  colors_d_ALERT_COLORS as ALERT_COLORS,
286
289
  colors_d_PILL_COLORS as PILL_COLORS,
287
290
  };
@@ -295,6 +298,101 @@ declare namespace index_d {
295
298
  };
296
299
  }
297
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 UseToastOptions {
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
+ options?: UseToastOptions
385
+ ): 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
+
298
396
  type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
299
397
 
300
398
  interface AlertProps {
@@ -379,65 +477,6 @@ interface CardProps {
379
477
  declare const Card: React.FC<Expand<CardProps> &
380
478
  React.HTMLAttributes<HTMLElement>>;
381
479
 
382
- interface Field {
383
- hasErrors: boolean;
384
- dirty: boolean;
385
- rawValue: string;
386
- }
387
-
388
- interface ReduxAction<T = string, P = {}> {
389
- type: T;
390
- payload?: P;
391
- }
392
-
393
- /**
394
- * These types should be moved to and referenced from redux-freeform if it implements TypeScript
395
- */
396
-
397
- type ValidatorFn = (value: string) => boolean;
398
-
399
- interface FieldActionPayload {
400
- fieldName: string;
401
- value?: string;
402
- validator?: ValidatorFn;
403
- }
404
-
405
- type SetAction = ReduxAction<"field/SET", FieldActionPayload>;
406
- type AddValidatorAction = ReduxAction<
407
- "field/ADD_VALIDATOR",
408
- FieldActionPayload
409
- >;
410
- type RemoveValidatorAction = ReduxAction<
411
- "field/REMOVE_VALIDATOR",
412
- FieldActionPayload
413
- >;
414
- type ClearAction = ReduxAction<"field/CLEAR">;
415
-
416
- interface FieldActions {
417
- set?: (fieldName: string) => (value: string) => SetAction;
418
- addValidator?: (
419
- fieldName: string
420
- ) => (validator: ValidatorFn) => AddValidatorAction;
421
- removeValidator?: (
422
- fieldName: string
423
- ) => (validator: ValidatorFn) => RemoveValidatorAction;
424
- clear?: () => ClearAction;
425
- }
426
-
427
- interface FormSelectOption {
428
- text?: string;
429
- value?: string;
430
- }
431
-
432
- interface SearchableSelectOption {
433
- name?: string;
434
- value?: string;
435
- }
436
-
437
- interface ErrorMessageDictionary {
438
- [fieldName: string]: string;
439
- }
440
-
441
480
  interface FormInputProps {
442
481
  extraStyles?: string;
443
482
  field?: Field;
@@ -1062,6 +1101,22 @@ interface RadioGroupProps {
1062
1101
  declare const RadioGroup: React.FC<Expand<RadioGroupProps> &
1063
1102
  React.HTMLAttributes<HTMLElement>>;
1064
1103
 
1104
+ interface ToastNotificationProps {
1105
+ variant?: string;
1106
+ message: string;
1107
+ toastOpen: boolean;
1108
+ closeToastNotification: (event?: React.MouseEvent<HTMLElement>) => void;
1109
+ extraStyles?: string;
1110
+ minWidth?: string;
1111
+ maxWidth?: string;
1112
+ height?: string;
1113
+ childGap?: string;
1114
+ backgroundColor?: string;
1115
+ }
1116
+
1117
+ declare const ToastNotification: React.FC<Expand<ToastNotificationProps> &
1118
+ React.HTMLAttributes<HTMLElement>>;
1119
+
1065
1120
  interface DefaultPageTemplateProps {
1066
1121
  content: JSX.Element;
1067
1122
  header?: JSX.Element;
@@ -1076,5 +1131,5 @@ interface DefaultPageTemplateProps {
1076
1131
  declare const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
1077
1132
  React.HTMLAttributes<HTMLElement>>;
1078
1133
 
1079
- 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, 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 };
1080
1135
  //# sourceMappingURL=index.d.ts.map