@popsure/dirty-swan 0.27.30 → 0.27.31
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/App.d.ts +0 -1
- package/dist/index.js +71 -74
- package/dist/index.js.map +1 -1
- package/dist/lib/components/autocompleteAddress/demo.d.ts +0 -1
- package/dist/lib/components/autocompleteAddress/index.d.ts +0 -1
- package/dist/lib/components/button/index.d.ts +1 -1
- package/dist/lib/components/chip/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/AccordionItem/AccordionItem.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/Chevron.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/Row/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableArrows/Arrow.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableArrows/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableInfoButton/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableRating/StarIcon.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableRating/ZapIcon.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableRating/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +0 -1
- package/dist/lib/components/comparisonTable/components/TableTrueFalse.d.ts +0 -1
- package/dist/lib/components/dateSelector/index.d.ts +0 -1
- package/dist/lib/components/input/autoSuggestInput/index.d.ts +0 -1
- package/dist/lib/components/input/autoSuggestMultiSelect/index.d.ts +0 -1
- package/dist/lib/components/input/currency/index.d.ts +0 -1
- package/dist/lib/components/input/iban/index.d.ts +0 -1
- package/dist/lib/components/input/index.d.ts +1 -1
- package/dist/lib/components/modal/bottomModal/index.d.ts +0 -1
- package/dist/lib/components/modal/bottomOrRegularModal/index.d.ts +0 -1
- package/dist/lib/components/modal/regularModal/index.d.ts +0 -1
- package/dist/lib/components/multiDropzone/index.d.ts +0 -1
- package/dist/lib/components/segmentedControl/index.d.ts +0 -1
- package/dist/lib/scss/private/base/demo.d.ts +0 -1
- package/dist/lib/scss/public/demo.d.ts +0 -1
- package/dist/lib/util/testUtils/customRender.d.ts +7 -0
- package/dist/lib/util/testUtils/index.d.ts +2 -0
- package/package.json +5 -3
- package/src/lib/components/autocompleteAddress/index.test.tsx +22 -21
- package/src/lib/components/input/currency/index.test.tsx +22 -22
- package/src/lib/components/input/index.tsx +3 -6
- package/src/lib/components/modal/regularModal/index.tsx +14 -12
- package/src/lib/components/modal/regularModal/style.module.scss +16 -15
- package/src/lib/components/multiDropzone/index.test.tsx +21 -26
- package/src/lib/components/segmentedControl/index.test.tsx +15 -21
- package/src/lib/util/testUtils/customRender.tsx +15 -0
- package/src/lib/util/testUtils/index.ts +5 -0
|
@@ -9,5 +9,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<{
|
|
|
9
9
|
buttonType?: ButtonType | undefined;
|
|
10
10
|
leftIcon?: Icon | undefined;
|
|
11
11
|
loading?: boolean | undefined;
|
|
12
|
-
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children">, "className" | "form" | "slot" | "style" | "title" | "onClick" | "hidden" | "value" | "onChange" | "dir" | "onBlur" | "onFocus" | "onKeyDown" | "tabIndex" | "leftIcon" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "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" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "
|
|
12
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children">, "className" | "form" | "slot" | "style" | "title" | "onClick" | "hidden" | "type" | "value" | "onChange" | "dir" | "onBlur" | "onFocus" | "onKeyDown" | "tabIndex" | "leftIcon" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "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" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "loading" | "buttonTitle" | "buttonType"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Option } from '../../../models/autoSuggestInput';
|
|
3
2
|
declare const _default: ({ currentOption, suggestions, handleSuggestionSelected, onChange, handleSuggestionFetchRequest, handleSuggestionClearRequest, placeholder, className, wrapText, }: {
|
|
4
3
|
currentOption: string;
|
|
@@ -12,5 +12,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<{
|
|
|
12
12
|
label?: string | undefined;
|
|
13
13
|
id?: string | undefined;
|
|
14
14
|
hideLabel?: boolean | undefined;
|
|
15
|
-
} & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint"> & Partial<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint">>, "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "children" | "onClick" | "error" | "hidden" | "value" | "onChange" | "dir" | "onBlur" | "onFocus" | "onKeyDown" | "tabIndex" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "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" | "
|
|
15
|
+
} & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint"> & Partial<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint">>, "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "children" | "onClick" | "error" | "hidden" | "type" | "list" | "value" | "onChange" | "dir" | "onBlur" | "onFocus" | "onKeyDown" | "tabIndex" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "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" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "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" | "step" | "disabled" | "enterKeyHint" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "readOnly" | "required" | "size" | "src" | "width" | "hideLabel"> & React.RefAttributes<HTMLInputElement>>;
|
|
16
16
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
2
|
+
import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup';
|
|
3
|
+
interface CustomRenderResult extends RenderResult {
|
|
4
|
+
user: UserEvent;
|
|
5
|
+
}
|
|
6
|
+
export declare const customRender: (ui: JSX.Element, options?: RenderOptions) => CustomRenderResult;
|
|
7
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popsure/dirty-swan",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.31",
|
|
4
4
|
"author": "Vincent Audoire <vincent@getpopsure.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -79,8 +79,10 @@
|
|
|
79
79
|
"@storybook/preset-create-react-app": "^3.1.7",
|
|
80
80
|
"@storybook/react": "^6.2.9",
|
|
81
81
|
"@storybook/storybook-deployer": "^2.8.10",
|
|
82
|
-
"@testing-library/jest-dom": "^5.
|
|
83
|
-
"@testing-library/react": "^
|
|
82
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
83
|
+
"@testing-library/react": "^12.1.2",
|
|
84
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
85
|
+
"@testing-library/user-event": "^14.3.0",
|
|
84
86
|
"@types/google.maps": "^3.43.3",
|
|
85
87
|
"@types/jest": "^26.0.23",
|
|
86
88
|
"@types/lodash.debounce": "^4.0.6",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from '@popsure/public-models';
|
|
2
|
-
import { fireEvent, render } from '
|
|
2
|
+
import { fireEvent, render } from '../../util/testUtils';
|
|
3
3
|
|
|
4
4
|
import AutoCompleteAddress from '.';
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ const setup = (
|
|
|
27
27
|
const inputTestId = 'ds-input-input';
|
|
28
28
|
|
|
29
29
|
describe('AutocompleteAddress component', () => {
|
|
30
|
-
it('Should show all address fields once a search is completed', () => {
|
|
30
|
+
it('Should show all address fields once a search is completed', async () => {
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
window.google.maps.places.Autocomplete = class {
|
|
33
33
|
reference: HTMLElement;
|
|
@@ -55,40 +55,41 @@ describe('AutocompleteAddress component', () => {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const { getAllByTestId, getByDisplayValue, getByTestId } = setup();
|
|
59
|
+
|
|
60
|
+
fireEvent.change(getByTestId(inputTestId), {
|
|
60
61
|
target: { value: 'Köpeniker' },
|
|
61
62
|
});
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
expect(
|
|
65
|
-
expect(inputs.length).toEqual(5);
|
|
64
|
+
expect(getAllByTestId(inputTestId).length).toEqual(5);
|
|
65
|
+
expect(getByDisplayValue("Köpeniker Strasse")).toBeVisible();
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('Should enable to enter the address manually', async () => {
|
|
69
69
|
const callback = jest.fn();
|
|
70
|
-
const
|
|
71
|
-
const btn = await
|
|
72
|
-
|
|
70
|
+
const { findByText, getAllByTestId, user } = setup(undefined, callback);
|
|
71
|
+
const btn = await findByText('Enter address manually');
|
|
72
|
+
|
|
73
|
+
await user.click(btn);
|
|
73
74
|
|
|
74
75
|
// fill out all fields
|
|
75
|
-
const inputs =
|
|
76
|
+
const inputs = getAllByTestId(inputTestId);
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
await user.type(inputs[0], 'Köpeniker Strasse');
|
|
79
|
+
await user.type(inputs[1], '4000');
|
|
80
|
+
await user.type(inputs[3], '10179');
|
|
81
|
+
await user.type(inputs[4], 'Berlin');
|
|
81
82
|
|
|
82
83
|
// callback should be called with a complete address
|
|
83
84
|
expect(callback).toHaveBeenCalledWith(address);
|
|
84
85
|
});
|
|
85
86
|
|
|
86
87
|
it('Should prefill fields if an address is provided', async () => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
expect(
|
|
90
|
-
expect(
|
|
91
|
-
expect(
|
|
92
|
-
expect(
|
|
88
|
+
const { getByDisplayValue } = setup(address);
|
|
89
|
+
|
|
90
|
+
expect(getByDisplayValue("Köpeniker Strasse")).toBeVisible();
|
|
91
|
+
expect(getByDisplayValue("4000")).toBeVisible();
|
|
92
|
+
expect(getByDisplayValue("10179")).toBeVisible();
|
|
93
|
+
expect(getByDisplayValue("Berlin")).toBeVisible();
|
|
93
94
|
});
|
|
94
95
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render } from '../../../util/testUtils';
|
|
2
2
|
|
|
3
3
|
import CurrencyInput from '.';
|
|
4
4
|
|
|
@@ -12,45 +12,45 @@ const setup = () => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
describe('Currency input component', () => {
|
|
15
|
-
it('Should correctly space thousands separators', () => {
|
|
16
|
-
const { input } = setup();
|
|
17
|
-
|
|
15
|
+
it('Should correctly space thousands separators', async () => {
|
|
16
|
+
const { input, user } = setup();
|
|
17
|
+
await user.type(input, '1234567');
|
|
18
18
|
expect(input.value).toBe('1 234 567');
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
it('Should remove non numerical values', () => {
|
|
22
|
-
const { input } = setup();
|
|
23
|
-
|
|
21
|
+
it('Should remove non numerical values', async () => {
|
|
22
|
+
const { input, user } = setup();
|
|
23
|
+
await user.type(input, '123asdf4567');
|
|
24
24
|
expect(input.value).toBe('1 234 567');
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
it('Should remove non numerical values', () => {
|
|
28
|
-
const { input } = setup();
|
|
29
|
-
|
|
27
|
+
it('Should remove non numerical values', async () => {
|
|
28
|
+
const { input, user } = setup();
|
|
29
|
+
await user.type(input, '123asdf4567');
|
|
30
30
|
expect(input.value).toBe('1 234 567');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it('Should allow decimal separator', () => {
|
|
34
|
-
const { input } = setup();
|
|
35
|
-
|
|
33
|
+
it('Should allow decimal separator', async () => {
|
|
34
|
+
const { input, user } = setup();
|
|
35
|
+
await user.type(input, '1234567.34');
|
|
36
36
|
expect(input.value).toBe('1 234 567.34');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
it('Should replace comma decimal seprator with a dot', () => {
|
|
40
|
-
const { input } = setup();
|
|
41
|
-
|
|
39
|
+
it('Should replace comma decimal seprator with a dot', async () => {
|
|
40
|
+
const { input, user } = setup();
|
|
41
|
+
await user.type(input, '1234567,34');
|
|
42
42
|
expect(input.value).toBe('1 234 567.34');
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
it('Should only allow one decimal separator', () => {
|
|
46
|
-
const { input } = setup();
|
|
47
|
-
|
|
45
|
+
it('Should only allow one decimal separator', async () => {
|
|
46
|
+
const { input, user } = setup();
|
|
47
|
+
await user.type(input, '1234567..34');
|
|
48
48
|
expect(input.value).toBe('1 234 567.34');
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it('Should only allow one decimal separator after a sequence of number', () => {
|
|
52
|
-
const { input } = setup();
|
|
53
|
-
|
|
51
|
+
it('Should only allow one decimal separator after a sequence of number', async () => {
|
|
52
|
+
const { input, user } = setup();
|
|
53
|
+
await user.type(input, '1234567..34.4');
|
|
54
54
|
expect(input.value).toBe('1 234 567.34');
|
|
55
55
|
});
|
|
56
56
|
});
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
4
|
|
|
4
5
|
import styles from './style.module.scss';
|
|
5
6
|
|
|
6
|
-
const generateUniqueId = () => {
|
|
7
|
-
return `input-id-${Math.floor(Math.random() * 10000000)}`;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
7
|
// Something weird is going on with enterKeyHint that makes it a required field under certain circumstances. The & Omit<…> and & Pick<…> is a hacky way to go around that.
|
|
11
8
|
export type InputProps = {
|
|
12
9
|
error?: string;
|
|
@@ -32,7 +29,7 @@ export default React.forwardRef(
|
|
|
32
29
|
}: InputProps,
|
|
33
30
|
ref?: React.ForwardedRef<HTMLInputElement>
|
|
34
31
|
) => {
|
|
35
|
-
const [uniqueId] = useState(id ??
|
|
32
|
+
const [uniqueId] = useState(id ?? uuidv4());
|
|
36
33
|
return (
|
|
37
34
|
<div className={`${styles.container} ${className ?? ''}`}>
|
|
38
35
|
{label && (
|
|
@@ -40,7 +37,7 @@ export default React.forwardRef(
|
|
|
40
37
|
htmlFor={uniqueId}
|
|
41
38
|
className={classnames('p-p', styles.label, {
|
|
42
39
|
[styles['label--with-error']]: error,
|
|
43
|
-
|
|
40
|
+
'sr-only': hideLabel,
|
|
44
41
|
})}
|
|
45
42
|
>
|
|
46
43
|
{label}
|
|
@@ -36,19 +36,21 @@ export default ({
|
|
|
36
36
|
} ${className}`}
|
|
37
37
|
onClick={handleContainerClick}
|
|
38
38
|
>
|
|
39
|
-
<div className={styles.
|
|
40
|
-
<div className={
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
<div className={styles.body}>
|
|
40
|
+
<div className={styles.header}>
|
|
41
|
+
<div className={`p-h2 ${styles.title}`}>{title}</div>
|
|
42
|
+
{dismissible && (
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
className={styles.close}
|
|
46
|
+
onClick={handleOnClose}
|
|
47
|
+
>
|
|
48
|
+
<img src={imageClose} alt="Close" />
|
|
49
|
+
</button>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
{children}
|
|
50
53
|
</div>
|
|
51
|
-
{children}
|
|
52
54
|
</div>
|
|
53
55
|
</div>
|
|
54
56
|
);
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
|
|
23
23
|
@keyframes appear-in {
|
|
24
24
|
0% {
|
|
25
|
-
transform: translateY(24px)
|
|
25
|
+
transform: translateY(24px);
|
|
26
26
|
opacity: 0;
|
|
27
27
|
visibility: hidden;
|
|
28
28
|
}
|
|
29
29
|
100% {
|
|
30
|
-
transform: translateY(0)
|
|
30
|
+
transform: translateY(0);
|
|
31
31
|
opacity: 1;
|
|
32
32
|
visibility: visible;
|
|
33
33
|
}
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
|
|
36
36
|
@keyframes disappear-out {
|
|
37
37
|
0% {
|
|
38
|
-
transform: translateY(0)
|
|
38
|
+
transform: translateY(0);
|
|
39
39
|
opacity: 1;
|
|
40
40
|
visibility: visible;
|
|
41
41
|
}
|
|
42
42
|
100% {
|
|
43
|
-
transform: translateY(24px)
|
|
43
|
+
transform: translateY(24px);
|
|
44
44
|
opacity: 0;
|
|
45
45
|
visibility: hidden;
|
|
46
46
|
}
|
|
@@ -70,25 +70,20 @@
|
|
|
70
70
|
.container {
|
|
71
71
|
position: relative;
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
border-radius: 8px;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
76
75
|
|
|
77
76
|
max-width: 592px;
|
|
78
|
-
width:
|
|
79
|
-
|
|
77
|
+
width: 100%;
|
|
78
|
+
min-height: 100%;
|
|
79
|
+
|
|
80
|
+
margin: 0 auto;
|
|
80
81
|
|
|
81
82
|
animation-name: appear-in;
|
|
82
83
|
animation-duration: 0.4s;
|
|
83
84
|
animation-fill-mode: both;
|
|
84
85
|
animation-timing-function: ease-out;
|
|
85
86
|
|
|
86
|
-
top: calc(100vh / 2 - 50% / 2);
|
|
87
|
-
left: 50%;
|
|
88
|
-
transform: translateX(-50%);
|
|
89
|
-
|
|
90
|
-
margin-bottom: 80px;
|
|
91
|
-
|
|
92
87
|
&--close {
|
|
93
88
|
@extend .container;
|
|
94
89
|
animation-name: disappear-out;
|
|
@@ -99,6 +94,12 @@
|
|
|
99
94
|
}
|
|
100
95
|
}
|
|
101
96
|
|
|
97
|
+
.body {
|
|
98
|
+
background-color: white;
|
|
99
|
+
border-radius: 8px;
|
|
100
|
+
margin: 32px auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
102
103
|
.header {
|
|
103
104
|
display: flex;
|
|
104
105
|
justify-content: space-between;
|