@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.
Files changed (43) hide show
  1. package/dist/App.d.ts +0 -1
  2. package/dist/index.js +71 -74
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/components/autocompleteAddress/demo.d.ts +0 -1
  5. package/dist/lib/components/autocompleteAddress/index.d.ts +0 -1
  6. package/dist/lib/components/button/index.d.ts +1 -1
  7. package/dist/lib/components/chip/index.d.ts +0 -1
  8. package/dist/lib/components/comparisonTable/components/AccordionItem/AccordionItem.d.ts +0 -1
  9. package/dist/lib/components/comparisonTable/components/Chevron.d.ts +0 -1
  10. package/dist/lib/components/comparisonTable/components/Row/index.d.ts +0 -1
  11. package/dist/lib/components/comparisonTable/components/TableArrows/Arrow.d.ts +0 -1
  12. package/dist/lib/components/comparisonTable/components/TableArrows/index.d.ts +0 -1
  13. package/dist/lib/components/comparisonTable/components/TableInfoButton/index.d.ts +0 -1
  14. package/dist/lib/components/comparisonTable/components/TableRating/StarIcon.d.ts +0 -1
  15. package/dist/lib/components/comparisonTable/components/TableRating/ZapIcon.d.ts +0 -1
  16. package/dist/lib/components/comparisonTable/components/TableRating/index.d.ts +0 -1
  17. package/dist/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +0 -1
  18. package/dist/lib/components/comparisonTable/components/TableTrueFalse.d.ts +0 -1
  19. package/dist/lib/components/dateSelector/index.d.ts +0 -1
  20. package/dist/lib/components/input/autoSuggestInput/index.d.ts +0 -1
  21. package/dist/lib/components/input/autoSuggestMultiSelect/index.d.ts +0 -1
  22. package/dist/lib/components/input/currency/index.d.ts +0 -1
  23. package/dist/lib/components/input/iban/index.d.ts +0 -1
  24. package/dist/lib/components/input/index.d.ts +1 -1
  25. package/dist/lib/components/modal/bottomModal/index.d.ts +0 -1
  26. package/dist/lib/components/modal/bottomOrRegularModal/index.d.ts +0 -1
  27. package/dist/lib/components/modal/regularModal/index.d.ts +0 -1
  28. package/dist/lib/components/multiDropzone/index.d.ts +0 -1
  29. package/dist/lib/components/segmentedControl/index.d.ts +0 -1
  30. package/dist/lib/scss/private/base/demo.d.ts +0 -1
  31. package/dist/lib/scss/public/demo.d.ts +0 -1
  32. package/dist/lib/util/testUtils/customRender.d.ts +7 -0
  33. package/dist/lib/util/testUtils/index.d.ts +2 -0
  34. package/package.json +5 -3
  35. package/src/lib/components/autocompleteAddress/index.test.tsx +22 -21
  36. package/src/lib/components/input/currency/index.test.tsx +22 -22
  37. package/src/lib/components/input/index.tsx +3 -6
  38. package/src/lib/components/modal/regularModal/index.tsx +14 -12
  39. package/src/lib/components/modal/regularModal/style.module.scss +16 -15
  40. package/src/lib/components/multiDropzone/index.test.tsx +21 -26
  41. package/src/lib/components/segmentedControl/index.test.tsx +15 -21
  42. package/src/lib/util/testUtils/customRender.tsx +15 -0
  43. package/src/lib/util/testUtils/index.ts +5 -0
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const WithoutAddress: () => JSX.Element;
3
2
  export declare const WithAddress: () => JSX.Element;
4
3
  export declare const WithoutAddressLocalized: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Address } from '@popsure/public-models';
3
2
  declare const AutoCompleteAddress: ({ apiKey, address: initialAddress, onAddressChange, placeholders, manualAddressEntryTexts, }: {
4
3
  apiKey: string;
@@ -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" | "type" | "loading" | "buttonTitle" | "buttonType"> & React.RefAttributes<HTMLButtonElement>>;
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: ({ value, onRemove, }: {
4
3
  value: Option;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const AccordionItem: ({ children, className, headerClassName, isOpen, onOpen, onClose, label, }: {
3
2
  children: React.ReactNode | string;
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Chevron: ({ className }: {
3
2
  className?: string | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Cell } from '../../index';
3
2
  interface RowProps<T> {
4
3
  cell: Cell<T>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ArrowIcon: ({ className }: {
3
2
  className?: string | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare type ArrowValues = 'prev' | 'next';
3
2
  interface TableArrowsProps {
4
3
  onClick: (value: ArrowValues) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const TableInfoButton: ({ onClick, className, }: {
3
2
  onClick: () => void;
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StarIcon: ({ className }: {
3
2
  className: string;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ZapIcon: ({ className }: {
3
2
  className: string;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type RatingTypes = 'star' | 'zap';
3
2
  interface TableRatingProps {
4
3
  type: RatingTypes;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const TableRowHeader: (props: {
3
2
  label: string;
4
3
  icon?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const TableTrueFalse: ({ value, className, }: {
3
2
  value: boolean;
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './datepicker.scss';
3
2
  export declare const fillArray: (from: number, to: number) => number[];
4
3
  export declare const daysInMonthOfYear: ({ month, year, }: {
@@ -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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Option } from '../../../models/autoSuggestInput';
3
2
  declare const _default: ({ options, selectedValues, setValues, placeholder, chipsListClassName, multiSelectClassName, wrapText, }: {
4
3
  options: Option[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from '..';
3
2
  declare const CurrencyInput: ({ value, onChange, type, ...props }: {
4
3
  value?: number | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InputProps } from '..';
3
2
  declare const IbanInput: ({ value, onChange, ...props }: {
4
3
  value?: string | undefined;
@@ -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" | "list" | "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" | "type" | "width" | "hideLabel"> & React.RefAttributes<HTMLInputElement>>;
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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Props } from '..';
3
2
  declare const _default: ({ title, isOpen, children, onClose, className, dismissible, }: Props) => JSX.Element;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Props } from '..';
3
2
  declare const _default: ({ isOpen, ...props }: Props) => JSX.Element;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Props } from '..';
3
2
  declare const _default: ({ title, isOpen, children, onClose, className, dismissible, }: Props) => JSX.Element;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AcceptType, FileType, TextOverrides, UploadedFile, UploadStatus } from './types';
3
2
  interface MultiDropzoneProps {
4
3
  accept?: AcceptType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface TitleWithSubtitle {
3
2
  title: string;
4
3
  subtitle: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Typography: () => JSX.Element;
3
2
  export declare const StaticWidthClasses: () => JSX.Element;
4
3
  export declare const MinWidthClasses: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Colors: () => JSX.Element;
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ export * from '@testing-library/react';
2
+ export { customRender as render } from './customRender';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.27.30",
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.14.1",
83
- "@testing-library/react": "^11.2.7",
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 '@testing-library/react';
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 screen = setup();
59
- fireEvent.change(screen.getByTestId(inputTestId), {
58
+ const { getAllByTestId, getByDisplayValue, getByTestId } = setup();
59
+
60
+ fireEvent.change(getByTestId(inputTestId), {
60
61
  target: { value: 'Köpeniker' },
61
62
  });
62
63
 
63
- const inputs = screen.getAllByTestId(inputTestId);
64
- expect(inputs[0].getAttribute('value')).toBe('Köpeniker Strasse');
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 screen = setup(undefined, callback);
71
- const btn = await screen.findByText('Enter address manually');
72
- fireEvent.click(btn);
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 = screen.getAllByTestId(inputTestId);
76
+ const inputs = getAllByTestId(inputTestId);
76
77
 
77
- fireEvent.change(inputs[0], { target: { value: 'Köpeniker Strasse' } });
78
- fireEvent.change(inputs[1], { target: { value: '4000' } });
79
- fireEvent.change(inputs[3], { target: { value: '10179' } });
80
- fireEvent.change(inputs[4], { target: { value: 'Berlin' } });
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 screen = setup(address);
88
- const inputs = screen.getAllByTestId(inputTestId);
89
- expect(inputs[0].getAttribute('value')).toBe('Köpeniker Strasse');
90
- expect(inputs[1].getAttribute('value')).toBe('4000');
91
- expect(inputs[3].getAttribute('value')).toBe('10179');
92
- expect(inputs[4].getAttribute('value')).toBe('Berlin');
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 { fireEvent, render } from '@testing-library/react';
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
- fireEvent.change(input, { target: { value: '1234567' } });
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
- fireEvent.change(input, { target: { value: '123asdf4567' } });
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
- fireEvent.change(input, { target: { value: '123asdf4567' } });
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
- fireEvent.change(input, { target: { value: '1234567.34' } });
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
- fireEvent.change(input, { target: { value: '1234567,34' } });
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
- fireEvent.change(input, { target: { value: '1234567..34' } });
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
- fireEvent.change(input, { target: { value: '1234567..34.4' } });
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 ?? generateUniqueId());
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
- "sr-only": hideLabel,
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.header}>
40
- <div className={`p-h2 ${styles.title}`}>{title}</div>
41
- {dismissible && (
42
- <button
43
- type="button"
44
- className={styles.close}
45
- onClick={handleOnClose}
46
- >
47
- <img src={imageClose} alt="Close" />
48
- </button>
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) translateX(-50%);
25
+ transform: translateY(24px);
26
26
  opacity: 0;
27
27
  visibility: hidden;
28
28
  }
29
29
  100% {
30
- transform: translateY(0) translateX(-50%);
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) translateX(-50%);
38
+ transform: translateY(0);
39
39
  opacity: 1;
40
40
  visibility: visible;
41
41
  }
42
42
  100% {
43
- transform: translateY(24px) translateX(-50%);
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
- background-color: white;
74
-
75
- border-radius: 8px;
73
+ display: flex;
74
+ align-items: center;
76
75
 
77
76
  max-width: 592px;
78
- width: fit-content;
79
- width: -moz-fit-content;
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;