es-components 21.11.1 → 21.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-components",
3
- "version": "21.11.1",
3
+ "version": "21.11.2",
4
4
  "description": "React components built for Exchange Solutions products",
5
5
  "author": "Willis Towers Watson - Individual Marketplace",
6
6
  "license": "MIT",
@@ -162,5 +162,5 @@
162
162
  "text-mask-addons": "3.8.0",
163
163
  "tinycolor2": "^1.5.1"
164
164
  },
165
- "gitHead": "f0300cbf202c19d46a7326d208fbb326623e9e8a"
165
+ "gitHead": "a8ea30f099d041879c59940d1510d89f7cf209f6"
166
166
  }
@@ -7,15 +7,13 @@ export interface AnswerButtonVariant extends BGColorButtonVariant {
7
7
  borderColor?: CSS.Property.BorderColor;
8
8
  }
9
9
  export type AnswerButtonProps = Override<HTMLInputProps, {
10
- name?: string;
11
10
  itemWidth?: CSS.Property.Width;
12
11
  styleType?: ButtonVariantStyleType;
13
12
  selectedType?: ButtonVariantStyleType;
14
13
  size?: ButtonSize;
15
14
  isOutline?: boolean;
16
15
  }>;
17
- declare const AnswerButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key">, "ref">, "name" | "size" | "styleType" | "isOutline" | "itemWidth" | "selectedType"> & {
18
- name?: string | undefined;
16
+ declare const AnswerButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key">, "ref">, "size" | "styleType" | "isOutline" | "selectedType" | "itemWidth"> & {
19
17
  itemWidth?: CSS.Property.Width<0 | (string & {})> | undefined;
20
18
  styleType?: "default" | "magenta" | "violet" | "info" | "success" | "warning" | "danger" | "primary" | "darkDefault" | "information" | undefined;
21
19
  selectedType?: "default" | "magenta" | "violet" | "info" | "success" | "warning" | "danger" | "primary" | "darkDefault" | "information" | undefined;
@@ -23,7 +21,6 @@ declare const AnswerButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<React
23
21
  isOutline?: boolean | undefined;
24
22
  } & React.RefAttributes<HTMLInputElement>>;
25
23
  export declare const propTypes: {
26
- name: PropTypes.Requireable<string>;
27
24
  itemWidth: PropTypes.Requireable<string>;
28
25
  styleType: PropTypes.Requireable<"default" | "magenta" | "violet" | "info" | "success" | "warning" | "danger" | "primary" | "darkDefault" | "information">;
29
26
  selectedType: PropTypes.Requireable<"default" | "magenta" | "violet" | "info" | "success" | "warning" | "danger" | "primary" | "darkDefault" | "information">;
@@ -35,6 +32,7 @@ export declare const propTypes: {
35
32
  title: PropTypes.Requireable<string | undefined> | PropTypes.Validator<string | undefined>;
36
33
  pattern: PropTypes.Requireable<string | undefined> | PropTypes.Validator<string | undefined>;
37
34
  type: PropTypes.Requireable<React.HTMLInputTypeAttribute | undefined> | PropTypes.Validator<React.HTMLInputTypeAttribute | undefined>;
35
+ name: PropTypes.Requireable<string | undefined> | PropTypes.Validator<string | undefined>;
38
36
  suppressHydrationWarning: PropTypes.Requireable<boolean | undefined> | PropTypes.Validator<boolean | undefined>;
39
37
  className: PropTypes.Requireable<string | undefined> | PropTypes.Validator<string | undefined>;
40
38
  color: PropTypes.Requireable<string | undefined> | PropTypes.Validator<string | undefined>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from "../radio-buttons/RadioGroup";
3
3
  import { AnswerButtonProps } from "./AnswerButton";
4
- export type AnswerGroupProps = Override<RadioGroupProps, Override<AnswerButtonProps, Pick<RadioGroupProps, 'name' | 'children'>>>;
5
- declare const AnswerGroup: React.ForwardRefExoticComponent<Omit<RadioGroupProps, "form" | "slot" | "style" | "title" | "pattern" | "type" | "name" | "suppressHydrationWarning" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "width" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "list" | "step" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "nonce" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "alt" | "src" | "value" | "accept" | "autoComplete" | "capture" | "checked" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "styleType" | "isOutline" | "itemWidth" | "selectedType"> & Omit<AnswerButtonProps, "name" | "children"> & Pick<RadioGroupProps, "name" | "children"> & React.RefAttributes<HTMLDivElement>>;
4
+ export type AnswerGroupProps = Override<RadioGroupProps<true>, Override<AnswerButtonProps, Pick<RadioGroupProps<true>, 'name' | 'children'>>>;
5
+ declare const AnswerGroup: React.ForwardRefExoticComponent<Omit<RadioGroupProps<true>, "form" | "slot" | "style" | "title" | "pattern" | "type" | "name" | "suppressHydrationWarning" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "width" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "list" | "step" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "nonce" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "alt" | "src" | "value" | "accept" | "autoComplete" | "capture" | "checked" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "styleType" | "isOutline" | "selectedType" | "itemWidth"> & Omit<AnswerButtonProps, "name" | "children"> & Pick<RadioGroupProps<true>, "name" | "children"> & React.RefAttributes<HTMLDivElement>>;
6
6
  export default AnswerGroup;
@@ -12,7 +12,7 @@ export declare const RadioInput: import("styled-components").StyledComponent<"in
12
12
  export type RadioButtonProps = HTMLInputProps & {
13
13
  displayClassName?: string;
14
14
  };
15
- export declare function getCheckedProps(radioProps: RadioButtonProps, contextProps: RadioGroupContextShape): {
15
+ export declare function getCheckedProps(radioProps: RadioButtonProps, contextProps: RadioGroupContextShape<boolean>): {
16
16
  onChange: React.ChangeEventHandler<HTMLInputElement>;
17
17
  checked: boolean;
18
18
  defaultChecked: undefined;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { RadioGroupContextShape } from "./RadioGroupContext";
4
- export type RadioGroupProps = Override<RadioGroupContextShape, {
4
+ export type RadioGroupProps<A extends boolean = false> = Override<RadioGroupContextShape<A>, {
5
5
  children: NonNullable<React.ReactNode>;
6
6
  }>;
7
- declare function RadioGroup<P>({ children, ...props }: RadioGroupProps & P): React.JSX.Element;
7
+ declare function RadioGroup<P, A extends boolean>({ children, ...props }: RadioGroupProps<A> & P): React.JSX.Element;
8
8
  declare namespace RadioGroup {
9
9
  var propTypes: {
10
10
  children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
@@ -1,12 +1,20 @@
1
1
  /// <reference types="react" />
2
+ import * as CSS from 'csstype';
2
3
  import PropTypes from 'prop-types';
3
4
  import { HTMLInputProps } from "../../util/htmlProps";
4
5
  import type { RadioButtonProps } from "./RadioButton";
5
- export type RadioGroupContextShape = Override<Partial<RadioButtonProps>, {
6
+ import type { ButtonSize, ButtonVariantStyleType } from "../../../../../../shared/types/dist/src";
7
+ export type RadioGroupContextShape<A extends boolean = false> = Override<Partial<RadioButtonProps>, {
6
8
  name: string;
7
9
  disableAllOptions?: boolean;
8
10
  selectedValue?: HTMLInputProps['value'];
9
11
  onChange?: HTMLInputProps['onChange'];
12
+ isAnswerGroup?: A;
13
+ size?: A extends true ? ButtonSize : RadioButtonProps['size'];
14
+ isOutline?: A extends true ? boolean : never;
15
+ styleType?: A extends true ? ButtonVariantStyleType : never;
16
+ selectedType?: A extends true ? ButtonVariantStyleType : never;
17
+ itemWidth?: A extends true ? CSS.Property.Width : never;
10
18
  }>;
11
19
  export declare const radioGroupContextPropTypes: {
12
20
  /** The name of the radio group */
@@ -16,5 +24,5 @@ export declare const radioGroupContextPropTypes: {
16
24
  /** Disable all radio buttons */
17
25
  disableAllOptions: PropTypes.Requireable<boolean>;
18
26
  };
19
- export declare const RadioGroupContext: import("react").Context<RadioGroupContextShape>;
20
- export declare const useRadioGroupContext: () => RadioGroupContextShape;
27
+ export declare const RadioGroupContext: import("react").Context<RadioGroupContextShape<boolean>>;
28
+ export declare function useRadioGroupContext<T extends boolean = false>(): RadioGroupContextShape<T>;