diff --git a/packages/design-system/src/components/Alert/Alert.tsx b/packages/design-system/src/components/Alert/Alert.tsx index 0c9fb08e74..6b5c0c6440 100644 --- a/packages/design-system/src/components/Alert/Alert.tsx +++ b/packages/design-system/src/components/Alert/Alert.tsx @@ -1,5 +1,4 @@ import { EVENT_CATEGORY, MAX_LENGTH, sendAnalyticsEvent } from '../analytics/SendAnalytics'; -// import PropTypes from 'prop-types'; import React from 'react'; import { alertSendsAnalytics } from '../flags'; import classNames from 'classnames'; @@ -9,22 +8,28 @@ import uniqueId from 'lodash.uniqueid'; /* eslint-disable camelcase */ // disable linting since prop names must be in snake case for integration with Blast export interface AnalyticsEventShape { - event_name?: string; - event_type?: string; - ga_eventAction?: string; - ga_eventCategory?: string; - ga_eventLabel?: string; + event_name: string; + event_type: string; + ga_eventAction: string; + ga_eventCategory: string; + ga_eventLabel: string; ga_eventType?: string; ga_eventValue?: string; - heading?: string; - type?: string; + heading: string; + type: string; + [additional_props: string]: unknown; } /* eslint-enable camelcase */ -interface AnalyticsObjectShape { +export interface AnalyticsObjectShape { onComponentDidMount?: boolean | AnalyticsEventShape; } +export type AlertHeadingLevel = '1' | '2' | '3' | '4' | '5' | '6'; + +export type AlertRole = 'alert' | 'alertdialog' | 'region' | 'status'; + +export type AlertVariation = 'error' | 'warn' | 'success'; export interface AlertProps { /** * Access a reference to the `alert` `div` element @@ -59,7 +64,7 @@ export interface AlertProps { /** * Heading type to override default `
_types) attribute. If you are using `type=number` please use the numeric prop instead.
*/
diff --git a/packages/design-system/src/components/TextField/TextInput.tsx b/packages/design-system/src/components/TextField/TextInput.tsx
index d582e52e8e..27b2142675 100644
--- a/packages/design-system/src/components/TextField/TextInput.tsx
+++ b/packages/design-system/src/components/TextField/TextInput.tsx
@@ -3,7 +3,11 @@ import Mask from './Mask';
import classNames from 'classnames';
export type TextInputDefaultValue = string | number;
+export type TextInputMask = 'currency' | 'phone' | 'ssn' | 'zip';
+export type TextInputRows = number | string;
+export type TextInputSize = 'small' | 'medium';
export type TextInputValue = string | number;
+export type TextInputErrorPlacement = 'top' | 'bottom';
export interface TextInputProps {
/**
@@ -25,7 +29,7 @@ export interface TextInputProps {
/**
* Location of the error message relative to the field input
*/
- errorPlacement?: 'top' | 'bottom';
+ errorPlacement?: TextInputErrorPlacement;
/**
* Additional classes to be added to the field element
*/
@@ -43,7 +47,7 @@ export interface TextInputProps {
* you expect to be entered. Depending on the mask, the
* field's appearance and functionality may be affected.
*/
- mask?: 'currency' | 'phone' | 'ssn' | 'zip';
+ mask?: TextInputMask;
/**
* Whether or not the text field is a multiline text field
*/
@@ -63,12 +67,12 @@ export interface TextInputProps {
* Optionally specify the number of visible text lines for the field. Only
* applicable if this is a multiline field.
*/
- rows?: number | string;
+ rows?: TextInputRows;
setRef?: (...args: any[]) => any;
/**
* Set the max-width of the input either to `'small'` or `'medium'`.
*/
- size?: 'small' | 'medium';
+ size?: TextInputSize;
/**
* HTML `input` [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#_types) attribute. If you are using `type=number` please use the numeric prop instead.
*/
@@ -80,7 +84,7 @@ export interface TextInputProps {
value?: TextInputValue;
}
-export type OmitProps = 'size' | 'ref';
+type OmitProps = 'size' | 'ref';
/**
*