@transferwise/components 46.165.4 → 46.165.5

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 (50) hide show
  1. package/build/Typeahead/TypeaheadInput/TypeaheadInput.js +5 -5
  2. package/build/Typeahead/TypeaheadInput/TypeaheadInput.js.map +1 -1
  3. package/build/Typeahead/TypeaheadInput/TypeaheadInput.mjs +5 -5
  4. package/build/Typeahead/TypeaheadInput/TypeaheadInput.mjs.map +1 -1
  5. package/build/main.css +8 -27
  6. package/build/styles/Typeahead/Typeahead.css +8 -27
  7. package/build/styles/main.css +8 -27
  8. package/build/types/Body/Body.d.ts +2 -2
  9. package/build/types/IconButton/IconButton.d.ts +1 -1
  10. package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
  11. package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
  12. package/build/types/Title/Title.d.ts +2 -2
  13. package/build/types/Typeahead/TypeaheadInput/TypeaheadInput.d.ts.map +1 -1
  14. package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
  15. package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
  16. package/package.json +2 -2
  17. package/src/Button/_stories/Button.test.story.tsx +1 -0
  18. package/src/Calendar/_stories/Calendar.test.story.tsx +1 -0
  19. package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +1 -0
  20. package/src/DateInput/_stories/DateInput.story.tsx +1 -0
  21. package/src/Decision/_stories/Decision.test.story.tsx +1 -0
  22. package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +1 -1
  23. package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +1 -0
  24. package/src/Field/_stories/Field.test.story.tsx +1 -0
  25. package/src/Header/_stories/Header.test.story.tsx +1 -1
  26. package/src/InputWithDisplayFormat/_stories/InputWithDisplayFormat.test.story.tsx +1 -0
  27. package/src/Inputs/InputGroup/_stories/InputGroup.test.story.tsx +1 -0
  28. package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +1 -0
  29. package/src/Inputs/TextArea/_stories/TextArea.test.story.tsx +1 -0
  30. package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +2 -1
  31. package/src/Label/_stories/Label.test.story.tsx +1 -0
  32. package/src/ListItem/_stories/ListItem.rtl.test.story.tsx +1 -6
  33. package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +3 -1
  34. package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +1 -1
  35. package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +1 -0
  36. package/src/Prompt/ActionPrompt/_stories/ActionPrompt.test.story.tsx +1 -0
  37. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +1 -0
  38. package/src/Prompt/InfoPrompt/_stories/InfoPrompt.test.story.tsx +1 -0
  39. package/src/Prompt/InlinePrompt/_stories/InlinePrompt.test.story.tsx +1 -0
  40. package/src/Table/_stories/Table.test.story.tsx +24 -13
  41. package/src/Tabs/_stories/Tabs.test.story.tsx +1 -1
  42. package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.test.story.tsx +1 -0
  43. package/src/Typeahead/Typeahead.css +8 -27
  44. package/src/Typeahead/Typeahead.less +9 -32
  45. package/src/Typeahead/TypeaheadInput/TypeaheadInput.tsx +5 -5
  46. package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +1 -1
  47. package/src/Typeahead/_stories/Typeahead.test.story.tsx +65 -0
  48. package/src/Upload/_stories/Upload.rtl.test.story.tsx +1 -0
  49. package/src/UploadInput/_stories/UploadInput.test.story.tsx +1 -0
  50. package/src/main.css +8 -27
@@ -62,10 +62,8 @@ class TypeaheadInput extends React.Component {
62
62
  }
63
63
  }
64
64
  recalculateWidth = () => {
65
- requestAnimationFrame(() => {
66
- this.setState({
67
- inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.current?.scrollWidth ?? 0 + 10)
68
- });
65
+ this.setState({
66
+ inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, (this.sizerRef.current?.scrollWidth ?? 0) + 10)
69
67
  });
70
68
  };
71
69
  renderInput = isRTL => {
@@ -129,7 +127,9 @@ class TypeaheadInput extends React.Component {
129
127
  children: direction$1 => {
130
128
  const isRTL = direction$1 === direction.Direction.RTL;
131
129
  return multiple ? /*#__PURE__*/jsxRuntime.jsxs("div", {
132
- className: "form-control typeahead__input-container",
130
+ className: clsx.clsx('form-control typeahead__input-container', {
131
+ 'typeahead__input-container--scrollable': maxHeight != null
132
+ }),
133
133
  style: {
134
134
  maxHeight
135
135
  },
@@ -1 +1 @@
1
- {"version":3,"file":"TypeaheadInput.js","sources":["../../../src/Typeahead/TypeaheadInput/TypeaheadInput.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { clsx } from 'clsx';\nimport { Component, createRef, ReactNode } from 'react';\n\nimport { Input } from '../../Inputs/Input/Input';\nimport { TypeaheadOption, TypeaheadProps } from '../Typeahead';\nimport { Direction } from '../../common';\nimport { DirectionContext } from '../../Provider/Direction';\n\nconst DEFAULT_INPUT_MIN_WIDTH = 10;\n\nexport type TypeaheadInputProps<T> = {\n typeaheadId: string;\n value: string;\n selected: readonly TypeaheadOption<T>[];\n dropdownOpen?: boolean;\n autoComplete: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n onFocus: () => void;\n onPaste: React.ClipboardEventHandler<HTMLInputElement>;\n renderChip: (chip: TypeaheadOption<T>, index: number) => ReactNode;\n ariaActivedescendant?: string;\n} & Pick<\n TypeaheadProps<T>,\n 'id' | 'name' | 'autoFocus' | 'disabled' | 'multiple' | 'placeholder' | 'maxHeight'\n>;\n\ntype TypeaheadInputState = {\n inputWidth: number;\n keyboardFocusedOptionIndex: number | null;\n};\n\nexport default class TypeaheadInput<T> extends Component<\n TypeaheadInputProps<T>,\n TypeaheadInputState\n> {\n inputRef = createRef<HTMLInputElement>();\n sizerRef = createRef<HTMLDivElement>();\n\n constructor(props: TypeaheadInputProps<T>) {\n super(props);\n this.state = {\n inputWidth: DEFAULT_INPUT_MIN_WIDTH,\n keyboardFocusedOptionIndex: null,\n };\n }\n\n componentDidMount() {\n const { autoFocus } = this.props;\n if (autoFocus) {\n // Autofocus after context code executions (e.g open Modal) is completed\n setTimeout(() => {\n this.inputRef.current?.focus();\n });\n }\n }\n\n componentDidUpdate(previousProps: TypeaheadInputProps<T>) {\n if (previousProps.value !== this.props.value && this.props.multiple) {\n this.recalculateWidth();\n }\n }\n\n recalculateWidth = () => {\n requestAnimationFrame(() => {\n this.setState({\n inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.current?.scrollWidth ?? 0 + 10),\n });\n });\n };\n\n renderInput = (isRTL: boolean) => {\n const {\n typeaheadId,\n autoFocus,\n disabled,\n multiple,\n name,\n dropdownOpen,\n placeholder,\n selected,\n value,\n onChange,\n onKeyDown,\n onFocus,\n onPaste,\n autoComplete,\n ariaActivedescendant,\n } = this.props;\n const { inputWidth } = this.state;\n\n const hasPlaceholder = !multiple || selected.length === 0;\n return (\n <Input\n ref={this.inputRef}\n dir={isRTL ? 'rtl' : 'auto'}\n className={clsx(multiple && 'typeahead__input')}\n name={name}\n id={`input-${typeaheadId}`}\n aria-activedescendant={ariaActivedescendant}\n autoFocus={autoFocus}\n disabled={disabled}\n placeholder={hasPlaceholder ? placeholder : ''}\n aria-autocomplete=\"list\"\n aria-expanded={dropdownOpen}\n aria-haspopup=\"listbox\"\n aria-controls={dropdownOpen ? `menu-${typeaheadId}` : undefined}\n autoComplete={autoComplete}\n role=\"combobox\"\n value={value}\n style={multiple && selected.length > 0 ? { width: inputWidth } : {}}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onClick={onFocus}\n onFocus={onFocus}\n onPaste={onPaste}\n />\n );\n };\n\n render() {\n const { multiple, selected, value, maxHeight, renderChip } = this.props;\n\n return (\n <DirectionContext.Consumer>\n {(direction) => {\n const isRTL = direction === Direction.RTL;\n\n return multiple ? (\n <div\n className=\"form-control typeahead__input-container\"\n style={{ maxHeight }}\n onClick={() => {\n this.inputRef.current?.focus();\n }}\n >\n <div className=\"typeahead__input-wrapper\">\n {selected && selected.map((chip, idx) => renderChip(chip, idx))}\n\n {this.renderInput(isRTL)}\n <div className=\"typeahead__input-aligner\" />\n </div>\n <div ref={this.sizerRef} className=\"sizer form-control typeahead__input\">\n {value}\n </div>\n </div>\n ) : (\n this.renderInput(isRTL)\n );\n }}\n </DirectionContext.Consumer>\n );\n }\n}\n"],"names":["DEFAULT_INPUT_MIN_WIDTH","TypeaheadInput","Component","inputRef","createRef","sizerRef","constructor","props","state","inputWidth","keyboardFocusedOptionIndex","componentDidMount","autoFocus","setTimeout","current","focus","componentDidUpdate","previousProps","value","multiple","recalculateWidth","requestAnimationFrame","setState","Math","max","scrollWidth","renderInput","isRTL","typeaheadId","disabled","name","dropdownOpen","placeholder","selected","onChange","onKeyDown","onFocus","onPaste","autoComplete","ariaActivedescendant","hasPlaceholder","length","_jsx","Input","ref","dir","className","clsx","id","undefined","role","style","width","onClick","render","maxHeight","renderChip","DirectionContext","Consumer","children","direction","Direction","RTL","_jsxs","map","chip","idx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AASA,MAAMA,uBAAuB,GAAG,EAAE;AAwBpB,MAAOC,cAAkB,SAAQC,eAG9C,CAAA;EACCC,QAAQ,gBAAGC,eAAS,EAAoB;EACxCC,QAAQ,gBAAGD,eAAS,EAAkB;EAEtCE,WAAAA,CAAYC,KAA6B,EAAA;IACvC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,UAAU,EAAET,uBAAuB;AACnCU,MAAAA,0BAA0B,EAAE;KAC7B;AACH,EA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AS,IAAI;AACb,QAAA,MAAMjC,KAAK,GAAGiC,WAAS,KAAKC,mBAAS,CAACC,GAAG;QAEzC,OAAO3C,QAAQ,gBACb4C,eAAA,CAAA,KAAA,EAAA;AACEjB,UAAAA,SAAS,EAAC,yCAAyC;AACnDK,UAAAA,KAAK,EAAE;AAAEI,YAAAA;WAAY;UACrBF,OAAO,EAAEA,MAAK;AACZ,YAAA,IAAI,CAAClD,QAAQ,CAACW,OAAO,EAAEC,KAAK,EAAE;UAChC,CAAE;AAAA4C,UAAAA,QAAA,gBAEFI,eAAA,CAAA,KAAA,EAAA;AAAKjB,YAAAA,SAAS,EAAC,0BAA0B;YAAAa,QAAA,EAAA,CACtC1B,QAAQ,IAAIA,QAAQ,CAAC+B,GAAG,CAAC,CAACC,IAAI,EAAEC,GAAG,KAAKV,UAAU,CAACS,IAAI,EAAEC,GAAG,CAAC,CAAC,EAE9D,IAAI,CAACxC,WAAW,CAACC,KAAK,CAAC,eACxBe,cAAA,CAAA,KAAA,EAAA;AAAKI,cAAAA,SAAS,EAAC;AAA0B,aAAA,CAC3C;WAAK,CACL,eAAAJ,cAAA,CAAA,KAAA,EAAA;YAAKE,GAAG,EAAE,IAAI,CAACvC,QAAS;AAACyC,YAAAA,SAAS,EAAC,qCAAqC;AAAAa,YAAAA,QAAA,EACrEzC;AAAK,WACH,CACP;AAAA,SAAK,CAAC,GAEN,IAAI,CAACQ,WAAW,CAACC,KAAK,CACvB;AACH,MAAA;AAAC,KACwB,CAAC;AAEhC,EAAA;AACD;;"}
1
+ {"version":3,"file":"TypeaheadInput.js","sources":["../../../src/Typeahead/TypeaheadInput/TypeaheadInput.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { clsx } from 'clsx';\nimport { Component, createRef, ReactNode } from 'react';\n\nimport { Input } from '../../Inputs/Input/Input';\nimport { TypeaheadOption, TypeaheadProps } from '../Typeahead';\nimport { Direction } from '../../common';\nimport { DirectionContext } from '../../Provider/Direction';\n\nconst DEFAULT_INPUT_MIN_WIDTH = 10;\n\nexport type TypeaheadInputProps<T> = {\n typeaheadId: string;\n value: string;\n selected: readonly TypeaheadOption<T>[];\n dropdownOpen?: boolean;\n autoComplete: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n onFocus: () => void;\n onPaste: React.ClipboardEventHandler<HTMLInputElement>;\n renderChip: (chip: TypeaheadOption<T>, index: number) => ReactNode;\n ariaActivedescendant?: string;\n} & Pick<\n TypeaheadProps<T>,\n 'id' | 'name' | 'autoFocus' | 'disabled' | 'multiple' | 'placeholder' | 'maxHeight'\n>;\n\ntype TypeaheadInputState = {\n inputWidth: number;\n keyboardFocusedOptionIndex: number | null;\n};\n\nexport default class TypeaheadInput<T> extends Component<\n TypeaheadInputProps<T>,\n TypeaheadInputState\n> {\n inputRef = createRef<HTMLInputElement>();\n sizerRef = createRef<HTMLDivElement>();\n\n constructor(props: TypeaheadInputProps<T>) {\n super(props);\n this.state = {\n inputWidth: DEFAULT_INPUT_MIN_WIDTH,\n keyboardFocusedOptionIndex: null,\n };\n }\n\n componentDidMount() {\n const { autoFocus } = this.props;\n if (autoFocus) {\n // Autofocus after context code executions (e.g open Modal) is completed\n setTimeout(() => {\n this.inputRef.current?.focus();\n });\n }\n }\n\n componentDidUpdate(previousProps: TypeaheadInputProps<T>) {\n if (previousProps.value !== this.props.value && this.props.multiple) {\n this.recalculateWidth();\n }\n }\n\n recalculateWidth = () => {\n this.setState({\n inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, (this.sizerRef.current?.scrollWidth ?? 0) + 10),\n });\n };\n\n renderInput = (isRTL: boolean) => {\n const {\n typeaheadId,\n autoFocus,\n disabled,\n multiple,\n name,\n dropdownOpen,\n placeholder,\n selected,\n value,\n onChange,\n onKeyDown,\n onFocus,\n onPaste,\n autoComplete,\n ariaActivedescendant,\n } = this.props;\n const { inputWidth } = this.state;\n\n const hasPlaceholder = !multiple || selected.length === 0;\n return (\n <Input\n ref={this.inputRef}\n dir={isRTL ? 'rtl' : 'auto'}\n className={clsx(multiple && 'typeahead__input')}\n name={name}\n id={`input-${typeaheadId}`}\n aria-activedescendant={ariaActivedescendant}\n autoFocus={autoFocus}\n disabled={disabled}\n placeholder={hasPlaceholder ? placeholder : ''}\n aria-autocomplete=\"list\"\n aria-expanded={dropdownOpen}\n aria-haspopup=\"listbox\"\n aria-controls={dropdownOpen ? `menu-${typeaheadId}` : undefined}\n autoComplete={autoComplete}\n role=\"combobox\"\n value={value}\n style={multiple && selected.length > 0 ? { width: inputWidth } : {}}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onClick={onFocus}\n onFocus={onFocus}\n onPaste={onPaste}\n />\n );\n };\n\n render() {\n const { multiple, selected, value, maxHeight, renderChip } = this.props;\n\n return (\n <DirectionContext.Consumer>\n {(direction) => {\n const isRTL = direction === Direction.RTL;\n\n return multiple ? (\n <div\n className={clsx('form-control typeahead__input-container', {\n 'typeahead__input-container--scrollable': maxHeight != null,\n })}\n style={{ maxHeight }}\n onClick={() => {\n this.inputRef.current?.focus();\n }}\n >\n <div className=\"typeahead__input-wrapper\">\n {selected && selected.map((chip, idx) => renderChip(chip, idx))}\n\n {this.renderInput(isRTL)}\n <div className=\"typeahead__input-aligner\" />\n </div>\n <div ref={this.sizerRef} className=\"sizer form-control typeahead__input\">\n {value}\n </div>\n </div>\n ) : (\n this.renderInput(isRTL)\n );\n }}\n </DirectionContext.Consumer>\n );\n }\n}\n"],"names":["DEFAULT_INPUT_MIN_WIDTH","TypeaheadInput","Component","inputRef","createRef","sizerRef","constructor","props","state","inputWidth","keyboardFocusedOptionIndex","componentDidMount","autoFocus","setTimeout","current","focus","componentDidUpdate","previousProps","value","multiple","recalculateWidth","setState","Math","max","scrollWidth","renderInput","isRTL","typeaheadId","disabled","name","dropdownOpen","placeholder","selected","onChange","onKeyDown","onFocus","onPaste","autoComplete","ariaActivedescendant","hasPlaceholder","length","_jsx","Input","ref","dir","className","clsx","id","undefined","role","style","width","onClick","render","maxHeight","renderChip","DirectionContext","Consumer","children","direction","Direction","RTL","_jsxs","map","chip","idx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AASA,MAAMA,uBAAuB,GAAG,EAAE;AAwBpB,MAAOC,cAAkB,SAAQC,eAG9C,CAAA;EACCC,QAAQ,gBAAGC,eAAS,EAAoB;EACxCC,QAAQ,gBAAGD,eAAS,EAAkB;EAEtCE,WAAAA,CAAYC,KAA6B,EAAA;IACvC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,UAAU,EAAET,uBAAuB;AACnCU,MAAAA,0BAA0B,EAAE;KAC7B;AACH,EAAA;AAEAC,EAAAA,iBAAiBA,GAAA;IACf,MAAM;AAAEC,MAAAA;KAAW,GAAG,IAAI,CAACL,KAAK;AAChC,IAAA,IAAIK,SAAS,EAAE;AACb;AACAC,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAI,CAACV,QAAQ,CAACW,OAAO,EAAEC,KAAK,EAAE;AAChC,MAAA,CAAC,CAAC;AACJ,IAAA;AACF,EAAA;EAEAC,kBAAkBA,CAACC,aAAqC,EAAA;AACtD,IAAA,IAAIA,aAAa,CAACC,KAAK,KAAK,IAAI,CAACX,KAAK,CAACW,KAAK,IAAI,IAAI,CAACX,KAAK,CAACY,QAAQ,EAAE;MACnE,IAAI,CAACC,gBAAgB,EAAE;AACzB,IAAA;AACF,EAAA;EAEAA,gBAAgB,GAAGA,MAAK;IACtB,IAAI,CAACC,QAAQ,CAAC;AACZZ,MAAAA,UAAU,EAAEa,IAAI,CAACC,GAAG,CAACvB,uBAAuB,EAAE,CAAC,IAAI,CAACK,QAAQ,CAACS,OAAO,EAAEU,WAAW,IAAI,CAAC,IAAI,EAAE;AAC7F,KAAA,CAA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AAK,CACL,eAAAJ,cAAA,CAAA,KAAA,EAAA;YAAKE,GAAG,EAAE,IAAI,CAACtC,QAAS;AAACwC,YAAAA,SAAS,EAAC,qCAAqC;AAAAa,YAAAA,QAAA,EACrExC;AAAK,WACH,CACP;AAAA,SAAK,CAAC,GAEN,IAAI,CAACO,WAAW,CAACC,KAAK,CACvB;AACH,MAAA;AAAC,KACwB,CAAC;AAEhC,EAAA;AACD;;"}
@@ -58,10 +58,8 @@ class TypeaheadInput extends Component {
58
58
  }
59
59
  }
60
60
  recalculateWidth = () => {
61
- requestAnimationFrame(() => {
62
- this.setState({
63
- inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.current?.scrollWidth ?? 0 + 10)
64
- });
61
+ this.setState({
62
+ inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, (this.sizerRef.current?.scrollWidth ?? 0) + 10)
65
63
  });
66
64
  };
67
65
  renderInput = isRTL => {
@@ -125,7 +123,9 @@ class TypeaheadInput extends Component {
125
123
  children: direction => {
126
124
  const isRTL = direction === Direction.RTL;
127
125
  return multiple ? /*#__PURE__*/jsxs("div", {
128
- className: "form-control typeahead__input-container",
126
+ className: clsx('form-control typeahead__input-container', {
127
+ 'typeahead__input-container--scrollable': maxHeight != null
128
+ }),
129
129
  style: {
130
130
  maxHeight
131
131
  },
@@ -1 +1 @@
1
- {"version":3,"file":"TypeaheadInput.mjs","sources":["../../../src/Typeahead/TypeaheadInput/TypeaheadInput.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { clsx } from 'clsx';\nimport { Component, createRef, ReactNode } from 'react';\n\nimport { Input } from '../../Inputs/Input/Input';\nimport { TypeaheadOption, TypeaheadProps } from '../Typeahead';\nimport { Direction } from '../../common';\nimport { DirectionContext } from '../../Provider/Direction';\n\nconst DEFAULT_INPUT_MIN_WIDTH = 10;\n\nexport type TypeaheadInputProps<T> = {\n typeaheadId: string;\n value: string;\n selected: readonly TypeaheadOption<T>[];\n dropdownOpen?: boolean;\n autoComplete: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n onFocus: () => void;\n onPaste: React.ClipboardEventHandler<HTMLInputElement>;\n renderChip: (chip: TypeaheadOption<T>, index: number) => ReactNode;\n ariaActivedescendant?: string;\n} & Pick<\n TypeaheadProps<T>,\n 'id' | 'name' | 'autoFocus' | 'disabled' | 'multiple' | 'placeholder' | 'maxHeight'\n>;\n\ntype TypeaheadInputState = {\n inputWidth: number;\n keyboardFocusedOptionIndex: number | null;\n};\n\nexport default class TypeaheadInput<T> extends Component<\n TypeaheadInputProps<T>,\n TypeaheadInputState\n> {\n inputRef = createRef<HTMLInputElement>();\n sizerRef = createRef<HTMLDivElement>();\n\n constructor(props: TypeaheadInputProps<T>) {\n super(props);\n this.state = {\n inputWidth: DEFAULT_INPUT_MIN_WIDTH,\n keyboardFocusedOptionIndex: null,\n };\n }\n\n componentDidMount() {\n const { autoFocus } = this.props;\n if (autoFocus) {\n // Autofocus after context code executions (e.g open Modal) is completed\n setTimeout(() => {\n this.inputRef.current?.focus();\n });\n }\n }\n\n componentDidUpdate(previousProps: TypeaheadInputProps<T>) {\n if (previousProps.value !== this.props.value && this.props.multiple) {\n this.recalculateWidth();\n }\n }\n\n recalculateWidth = () => {\n requestAnimationFrame(() => {\n this.setState({\n inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.current?.scrollWidth ?? 0 + 10),\n });\n });\n };\n\n renderInput = (isRTL: boolean) => {\n const {\n typeaheadId,\n autoFocus,\n disabled,\n multiple,\n name,\n dropdownOpen,\n placeholder,\n selected,\n value,\n onChange,\n onKeyDown,\n onFocus,\n onPaste,\n autoComplete,\n ariaActivedescendant,\n } = this.props;\n const { inputWidth } = this.state;\n\n const hasPlaceholder = !multiple || selected.length === 0;\n return (\n <Input\n ref={this.inputRef}\n dir={isRTL ? 'rtl' : 'auto'}\n className={clsx(multiple && 'typeahead__input')}\n name={name}\n id={`input-${typeaheadId}`}\n aria-activedescendant={ariaActivedescendant}\n autoFocus={autoFocus}\n disabled={disabled}\n placeholder={hasPlaceholder ? placeholder : ''}\n aria-autocomplete=\"list\"\n aria-expanded={dropdownOpen}\n aria-haspopup=\"listbox\"\n aria-controls={dropdownOpen ? `menu-${typeaheadId}` : undefined}\n autoComplete={autoComplete}\n role=\"combobox\"\n value={value}\n style={multiple && selected.length > 0 ? { width: inputWidth } : {}}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onClick={onFocus}\n onFocus={onFocus}\n onPaste={onPaste}\n />\n );\n };\n\n render() {\n const { multiple, selected, value, maxHeight, renderChip } = this.props;\n\n return (\n <DirectionContext.Consumer>\n {(direction) => {\n const isRTL = direction === Direction.RTL;\n\n return multiple ? (\n <div\n className=\"form-control typeahead__input-container\"\n style={{ maxHeight }}\n onClick={() => {\n this.inputRef.current?.focus();\n }}\n >\n <div className=\"typeahead__input-wrapper\">\n {selected && selected.map((chip, idx) => renderChip(chip, idx))}\n\n {this.renderInput(isRTL)}\n <div className=\"typeahead__input-aligner\" />\n </div>\n <div ref={this.sizerRef} className=\"sizer form-control typeahead__input\">\n {value}\n </div>\n </div>\n ) : (\n this.renderInput(isRTL)\n );\n }}\n </DirectionContext.Consumer>\n );\n }\n}\n"],"names":["DEFAULT_INPUT_MIN_WIDTH","TypeaheadInput","Component","inputRef","createRef","sizerRef","constructor","props","state","inputWidth","keyboardFocusedOptionIndex","componentDidMount","autoFocus","setTimeout","current","focus","componentDidUpdate","previousProps","value","multiple","recalculateWidth","requestAnimationFrame","setState","Math","max","scrollWidth","renderInput","isRTL","typeaheadId","disabled","name","dropdownOpen","placeholder","selected","onChange","onKeyDown","onFocus","onPaste","autoComplete","ariaActivedescendant","hasPlaceholder","length","_jsx","Input","ref","dir","className","clsx","id","undefined","role","style","width","onClick","render","maxHeight","renderChip","DirectionContext","Consumer","children","direction","Direction","RTL","_jsxs","map","chip","idx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AASA,MAAMA,uBAAuB,GAAG,EAAE;AAwBpB,MAAOC,cAAkB,SAAQC,SAG9C,CAAA;EACCC,QAAQ,gBAAGC,SAAS,EAAoB;EACxCC,QAAQ,gBAAGD,SAAS,EAAkB;EAEtCE,WAAAA,CAAYC,KAA6B,EAAA;IACvC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,UAAU,EAAET,uBAAuB;AACnCU,MAAAA,0BAA0B,EAAE;KAC7B;AACH,EAAA;AAEAC,EAAAA,iBAAiBA,GAAA;IACf,MAAM;AAAEC,MAAAA;KAAW,GAAG,IAAI,CAACL,KAAK;AAChC,IAAA,IAAIK,SAAS,EAAE;AACb;AACAC,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAI,CAACV,QAAQ,CAACW,OAAO,EAAEC,KAAK,EAAE;AAChC,MAAA,CAAC,CAAC;AACJ,IAAA;AACF,EAAA;EAEAC,kBAAkBA,CAACC,aAAqC,EAAA;AACtD,IAAA,IAAIA,aAAa,CAACC,KAAK,KAAK,IAAI,CAACX,KAAK,CAACW,KAAK,IAAI,IAAI,CAACX,KAAK,CAACY,QAAQ,EAAE;MACnE,IAAI,CAACC,gBAAgB,EAAE;AACzB,IAAA;AACF,EAAA;EAEAA,gBAAgB,GAAGA,MAAK;AACtBC,IAAAA,qBAAqB,CAAC,MAAK;MACzB,IAAI,CAACC,QAAQ,CAAC;AACZb,QAAAA,UAAU,EAAEc,IAAI,CAACC,GAAG,CAACxB,uBAAuB,EAAE,IAAI,CAACK,QAAQ,CAACS,OAAO,EAAEW,WAAW,IAAI,CAAC,GAAG,EAAE;AAC3F,OAAA,CAAC;AACJ,IAAA,CAAC,CAAC;EACJ,CAAC;EAEDC,WAAW,GAAIC,KAAc,IAAI;IAC/B,MAAM;M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AAA,EACrEzC;AAAK,WACH,CACP;AAAA,SAAK,CAAC,GAEN,IAAI,CAACQ,WAAW,CAACC,KAAK,CACvB;AACH,MAAA;AAAC,KACwB,CAAC;AAEhC,EAAA;AACD;;"}
1
+ {"version":3,"file":"TypeaheadInput.mjs","sources":["../../../src/Typeahead/TypeaheadInput/TypeaheadInput.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { clsx } from 'clsx';\nimport { Component, createRef, ReactNode } from 'react';\n\nimport { Input } from '../../Inputs/Input/Input';\nimport { TypeaheadOption, TypeaheadProps } from '../Typeahead';\nimport { Direction } from '../../common';\nimport { DirectionContext } from '../../Provider/Direction';\n\nconst DEFAULT_INPUT_MIN_WIDTH = 10;\n\nexport type TypeaheadInputProps<T> = {\n typeaheadId: string;\n value: string;\n selected: readonly TypeaheadOption<T>[];\n dropdownOpen?: boolean;\n autoComplete: string;\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n onFocus: () => void;\n onPaste: React.ClipboardEventHandler<HTMLInputElement>;\n renderChip: (chip: TypeaheadOption<T>, index: number) => ReactNode;\n ariaActivedescendant?: string;\n} & Pick<\n TypeaheadProps<T>,\n 'id' | 'name' | 'autoFocus' | 'disabled' | 'multiple' | 'placeholder' | 'maxHeight'\n>;\n\ntype TypeaheadInputState = {\n inputWidth: number;\n keyboardFocusedOptionIndex: number | null;\n};\n\nexport default class TypeaheadInput<T> extends Component<\n TypeaheadInputProps<T>,\n TypeaheadInputState\n> {\n inputRef = createRef<HTMLInputElement>();\n sizerRef = createRef<HTMLDivElement>();\n\n constructor(props: TypeaheadInputProps<T>) {\n super(props);\n this.state = {\n inputWidth: DEFAULT_INPUT_MIN_WIDTH,\n keyboardFocusedOptionIndex: null,\n };\n }\n\n componentDidMount() {\n const { autoFocus } = this.props;\n if (autoFocus) {\n // Autofocus after context code executions (e.g open Modal) is completed\n setTimeout(() => {\n this.inputRef.current?.focus();\n });\n }\n }\n\n componentDidUpdate(previousProps: TypeaheadInputProps<T>) {\n if (previousProps.value !== this.props.value && this.props.multiple) {\n this.recalculateWidth();\n }\n }\n\n recalculateWidth = () => {\n this.setState({\n inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, (this.sizerRef.current?.scrollWidth ?? 0) + 10),\n });\n };\n\n renderInput = (isRTL: boolean) => {\n const {\n typeaheadId,\n autoFocus,\n disabled,\n multiple,\n name,\n dropdownOpen,\n placeholder,\n selected,\n value,\n onChange,\n onKeyDown,\n onFocus,\n onPaste,\n autoComplete,\n ariaActivedescendant,\n } = this.props;\n const { inputWidth } = this.state;\n\n const hasPlaceholder = !multiple || selected.length === 0;\n return (\n <Input\n ref={this.inputRef}\n dir={isRTL ? 'rtl' : 'auto'}\n className={clsx(multiple && 'typeahead__input')}\n name={name}\n id={`input-${typeaheadId}`}\n aria-activedescendant={ariaActivedescendant}\n autoFocus={autoFocus}\n disabled={disabled}\n placeholder={hasPlaceholder ? placeholder : ''}\n aria-autocomplete=\"list\"\n aria-expanded={dropdownOpen}\n aria-haspopup=\"listbox\"\n aria-controls={dropdownOpen ? `menu-${typeaheadId}` : undefined}\n autoComplete={autoComplete}\n role=\"combobox\"\n value={value}\n style={multiple && selected.length > 0 ? { width: inputWidth } : {}}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onClick={onFocus}\n onFocus={onFocus}\n onPaste={onPaste}\n />\n );\n };\n\n render() {\n const { multiple, selected, value, maxHeight, renderChip } = this.props;\n\n return (\n <DirectionContext.Consumer>\n {(direction) => {\n const isRTL = direction === Direction.RTL;\n\n return multiple ? (\n <div\n className={clsx('form-control typeahead__input-container', {\n 'typeahead__input-container--scrollable': maxHeight != null,\n })}\n style={{ maxHeight }}\n onClick={() => {\n this.inputRef.current?.focus();\n }}\n >\n <div className=\"typeahead__input-wrapper\">\n {selected && selected.map((chip, idx) => renderChip(chip, idx))}\n\n {this.renderInput(isRTL)}\n <div className=\"typeahead__input-aligner\" />\n </div>\n <div ref={this.sizerRef} className=\"sizer form-control typeahead__input\">\n {value}\n </div>\n </div>\n ) : (\n this.renderInput(isRTL)\n );\n }}\n </DirectionContext.Consumer>\n );\n }\n}\n"],"names":["DEFAULT_INPUT_MIN_WIDTH","TypeaheadInput","Component","inputRef","createRef","sizerRef","constructor","props","state","inputWidth","keyboardFocusedOptionIndex","componentDidMount","autoFocus","setTimeout","current","focus","componentDidUpdate","previousProps","value","multiple","recalculateWidth","setState","Math","max","scrollWidth","renderInput","isRTL","typeaheadId","disabled","name","dropdownOpen","placeholder","selected","onChange","onKeyDown","onFocus","onPaste","autoComplete","ariaActivedescendant","hasPlaceholder","length","_jsx","Input","ref","dir","className","clsx","id","undefined","role","style","width","onClick","render","maxHeight","renderChip","DirectionContext","Consumer","children","direction","Direction","RTL","_jsxs","map","chip","idx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AASA,MAAMA,uBAAuB,GAAG,EAAE;AAwBpB,MAAOC,cAAkB,SAAQC,SAG9C,CAAA;EACCC,QAAQ,gBAAGC,SAAS,EAAoB;EACxCC,QAAQ,gBAAGD,SAAS,EAAkB;EAEtCE,WAAAA,CAAYC,KAA6B,EAAA;IACvC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,UAAU,EAAET,uBAAuB;AACnCU,MAAAA,0BAA0B,EAAE;KAC7B;AACH,EAAA;AAEAC,EAAAA,iBAAiBA,GAAA;IACf,MAAM;AAAEC,MAAAA;KAAW,GAAG,IAAI,CAACL,KAAK;AAChC,IAAA,IAAIK,SAAS,EAAE;AACb;AACAC,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAI,CAACV,QAAQ,CAACW,OAAO,EAAEC,KAAK,EAAE;AAChC,MAAA,CAAC,CAAC;AACJ,IAAA;AACF,EAAA;EAE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AAI,CAACjD,QAAQ,CAACW,OAAO,EAAEC,KAAK,EAAE;UAChC,CAAE;AAAA2C,UAAAA,QAAA,gBAEFI,IAAA,CAAA,KAAA,EAAA;AAAKjB,YAAAA,SAAS,EAAC,0BAA0B;YAAAa,QAAA,EAAA,CACtC1B,QAAQ,IAAIA,QAAQ,CAAC+B,GAAG,CAAC,CAACC,IAAI,EAAEC,GAAG,KAAKV,UAAU,CAACS,IAAI,EAAEC,GAAG,CAAC,CAAC,EAE9D,IAAI,CAACxC,WAAW,CAACC,KAAK,CAAC,eACxBe,GAAA,CAAA,KAAA,EAAA;AAAKI,cAAAA,SAAS,EAAC;AAA0B,aAAA,CAC3C;WAAK,CACL,eAAAJ,GAAA,CAAA,KAAA,EAAA;YAAKE,GAAG,EAAE,IAAI,CAACtC,QAAS;AAACwC,YAAAA,SAAS,EAAC,qCAAqC;AAAAa,YAAAA,QAAA,EACrExC;AAAK,WACH,CACP;AAAA,SAAK,CAAC,GAEN,IAAI,CAACO,WAAW,CAACC,KAAK,CACvB;AACH,MAAA;AAAC,KACwB,CAAC;AAEhC,EAAA;AACD;;"}
package/build/main.css CHANGED
@@ -25409,12 +25409,6 @@ button.np-link {
25409
25409
  }
25410
25410
  .typeahead--multiple .np-chip {
25411
25411
  margin-block-end: auto;
25412
- animation-name: slide;
25413
- animation-duration: 0.03s;
25414
- animation-timing-function: ease-in-out;
25415
- }
25416
- .typeahead--multiple .np-chip:first-child {
25417
- animation-name: slideFirst;
25418
25412
  }
25419
25413
  .typeahead--multiple .np-chip-remove {
25420
25414
  animation-name: fadeIn;
@@ -25426,7 +25420,10 @@ button.np-link {
25426
25420
  min-block-size: auto;
25427
25421
  padding-block-start: 0;
25428
25422
  padding-block-end: 0;
25429
- overflow: auto;
25423
+ overflow: visible;
25424
+ }
25425
+ .typeahead--multiple .typeahead__input-container--scrollable {
25426
+ overflow-y: auto;
25430
25427
  }
25431
25428
  .typeahead--multiple .typeahead__input {
25432
25429
  border: none;
@@ -25460,12 +25457,12 @@ button.np-link {
25460
25457
  padding-inline-start: 0;
25461
25458
  }
25462
25459
  .typeahead--multiple.typeahead--has-value .typeahead__input {
25463
- margin-block-end: calc(-1 * var(--size-8) + 1px);
25460
+ margin-block-end: calc(-1 * var(--size-8));
25464
25461
  margin-inline-start: var(--size-4);
25465
25462
  }
25466
25463
  .typeahead--multiple.typeahead--has-value .typeahead__input-wrapper::after {
25467
25464
  content: "";
25468
- block-size: calc(var(--size-8) - 1);
25465
+ block-size: var(--size-8);
25469
25466
  inline-size: 100%;
25470
25467
  }
25471
25468
  .typeahead__input-wrapper {
@@ -25499,7 +25496,7 @@ button.np-link {
25499
25496
  min-block-size: var(--input-height-large);
25500
25497
  }
25501
25498
  .typeahead-lg.typeahead--multiple .typeahead__input {
25502
- padding-block-start: calc(var(--size-8) - 1);
25499
+ padding-block-start: var(--size-8);
25503
25500
  }
25504
25501
  .typeahead-lg.typeahead--multiple .typeahead__input-wrapper {
25505
25502
  padding-block-end: var(--size-8);
@@ -25511,22 +25508,6 @@ button.np-link {
25511
25508
  .typeahead-lg.typeahead--multiple .np-chip {
25512
25509
  margin-block-end: 0;
25513
25510
  }
25514
- @keyframes slide {
25515
- from {
25516
- transform: translateX(-12px);
25517
- }
25518
- to {
25519
- transform: none;
25520
- }
25521
- }
25522
- @keyframes slideFirst {
25523
- from {
25524
- transform: translateX(-4px);
25525
- }
25526
- to {
25527
- transform: none;
25528
- }
25529
- }
25530
25511
  @keyframes fadeIn {
25531
25512
  from {
25532
25513
  opacity: 0;
@@ -25549,7 +25530,7 @@ button.np-link {
25549
25530
  color: var(--color-interactive-secondary);
25550
25531
  }
25551
25532
  .np-theme-personal .typeahead .np-chip {
25552
- margin-block-start: 9px !important;
25533
+ margin-block-start: var(--size-8);
25553
25534
  }
25554
25535
  .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
25555
25536
  padding-inline-end: var(--size-16);
@@ -26,12 +26,6 @@
26
26
  }
27
27
  .typeahead--multiple .np-chip {
28
28
  margin-block-end: auto;
29
- animation-name: slide;
30
- animation-duration: 0.03s;
31
- animation-timing-function: ease-in-out;
32
- }
33
- .typeahead--multiple .np-chip:first-child {
34
- animation-name: slideFirst;
35
29
  }
36
30
  .typeahead--multiple .np-chip-remove {
37
31
  animation-name: fadeIn;
@@ -43,7 +37,10 @@
43
37
  min-block-size: auto;
44
38
  padding-block-start: 0;
45
39
  padding-block-end: 0;
46
- overflow: auto;
40
+ overflow: visible;
41
+ }
42
+ .typeahead--multiple .typeahead__input-container--scrollable {
43
+ overflow-y: auto;
47
44
  }
48
45
  .typeahead--multiple .typeahead__input {
49
46
  border: none;
@@ -77,12 +74,12 @@
77
74
  padding-inline-start: 0;
78
75
  }
79
76
  .typeahead--multiple.typeahead--has-value .typeahead__input {
80
- margin-block-end: calc(-1 * var(--size-8) + 1px);
77
+ margin-block-end: calc(-1 * var(--size-8));
81
78
  margin-inline-start: var(--size-4);
82
79
  }
83
80
  .typeahead--multiple.typeahead--has-value .typeahead__input-wrapper::after {
84
81
  content: "";
85
- block-size: calc(var(--size-8) - 1);
82
+ block-size: var(--size-8);
86
83
  inline-size: 100%;
87
84
  }
88
85
  .typeahead__input-wrapper {
@@ -116,7 +113,7 @@
116
113
  min-block-size: var(--input-height-large);
117
114
  }
118
115
  .typeahead-lg.typeahead--multiple .typeahead__input {
119
- padding-block-start: calc(var(--size-8) - 1);
116
+ padding-block-start: var(--size-8);
120
117
  }
121
118
  .typeahead-lg.typeahead--multiple .typeahead__input-wrapper {
122
119
  padding-block-end: var(--size-8);
@@ -128,22 +125,6 @@
128
125
  .typeahead-lg.typeahead--multiple .np-chip {
129
126
  margin-block-end: 0;
130
127
  }
131
- @keyframes slide {
132
- from {
133
- transform: translateX(-12px);
134
- }
135
- to {
136
- transform: none;
137
- }
138
- }
139
- @keyframes slideFirst {
140
- from {
141
- transform: translateX(-4px);
142
- }
143
- to {
144
- transform: none;
145
- }
146
- }
147
128
  @keyframes fadeIn {
148
129
  from {
149
130
  opacity: 0;
@@ -166,7 +147,7 @@
166
147
  color: var(--color-interactive-secondary);
167
148
  }
168
149
  .np-theme-personal .typeahead .np-chip {
169
- margin-block-start: 9px !important;
150
+ margin-block-start: var(--size-8);
170
151
  }
171
152
  .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
172
153
  padding-inline-end: var(--size-16);
@@ -25409,12 +25409,6 @@ button.np-link {
25409
25409
  }
25410
25410
  .typeahead--multiple .np-chip {
25411
25411
  margin-block-end: auto;
25412
- animation-name: slide;
25413
- animation-duration: 0.03s;
25414
- animation-timing-function: ease-in-out;
25415
- }
25416
- .typeahead--multiple .np-chip:first-child {
25417
- animation-name: slideFirst;
25418
25412
  }
25419
25413
  .typeahead--multiple .np-chip-remove {
25420
25414
  animation-name: fadeIn;
@@ -25426,7 +25420,10 @@ button.np-link {
25426
25420
  min-block-size: auto;
25427
25421
  padding-block-start: 0;
25428
25422
  padding-block-end: 0;
25429
- overflow: auto;
25423
+ overflow: visible;
25424
+ }
25425
+ .typeahead--multiple .typeahead__input-container--scrollable {
25426
+ overflow-y: auto;
25430
25427
  }
25431
25428
  .typeahead--multiple .typeahead__input {
25432
25429
  border: none;
@@ -25460,12 +25457,12 @@ button.np-link {
25460
25457
  padding-inline-start: 0;
25461
25458
  }
25462
25459
  .typeahead--multiple.typeahead--has-value .typeahead__input {
25463
- margin-block-end: calc(-1 * var(--size-8) + 1px);
25460
+ margin-block-end: calc(-1 * var(--size-8));
25464
25461
  margin-inline-start: var(--size-4);
25465
25462
  }
25466
25463
  .typeahead--multiple.typeahead--has-value .typeahead__input-wrapper::after {
25467
25464
  content: "";
25468
- block-size: calc(var(--size-8) - 1);
25465
+ block-size: var(--size-8);
25469
25466
  inline-size: 100%;
25470
25467
  }
25471
25468
  .typeahead__input-wrapper {
@@ -25499,7 +25496,7 @@ button.np-link {
25499
25496
  min-block-size: var(--input-height-large);
25500
25497
  }
25501
25498
  .typeahead-lg.typeahead--multiple .typeahead__input {
25502
- padding-block-start: calc(var(--size-8) - 1);
25499
+ padding-block-start: var(--size-8);
25503
25500
  }
25504
25501
  .typeahead-lg.typeahead--multiple .typeahead__input-wrapper {
25505
25502
  padding-block-end: var(--size-8);
@@ -25511,22 +25508,6 @@ button.np-link {
25511
25508
  .typeahead-lg.typeahead--multiple .np-chip {
25512
25509
  margin-block-end: 0;
25513
25510
  }
25514
- @keyframes slide {
25515
- from {
25516
- transform: translateX(-12px);
25517
- }
25518
- to {
25519
- transform: none;
25520
- }
25521
- }
25522
- @keyframes slideFirst {
25523
- from {
25524
- transform: translateX(-4px);
25525
- }
25526
- to {
25527
- transform: none;
25528
- }
25529
- }
25530
25511
  @keyframes fadeIn {
25531
25512
  from {
25532
25513
  opacity: 0;
@@ -25549,7 +25530,7 @@ button.np-link {
25549
25530
  color: var(--color-interactive-secondary);
25550
25531
  }
25551
25532
  .np-theme-personal .typeahead .np-chip {
25552
- margin-block-start: 9px !important;
25533
+ margin-block-start: var(--size-8);
25553
25534
  }
25554
25535
  .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
25555
25536
  padding-inline-end: var(--size-16);
@@ -11,7 +11,7 @@ export type BodyProps = HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> &
11
11
  */
12
12
  preserveNewlines?: boolean;
13
13
  };
14
- declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> & {
14
+ declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement | HTMLSpanElement> & {
15
15
  /** @default 'body-default' */
16
16
  type?: BodyTypes;
17
17
  /** @default 'div' */
@@ -21,6 +21,6 @@ declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTM
21
21
  * @default false
22
22
  */
23
23
  preserveNewlines?: boolean;
24
- } & import("react").RefAttributes<HTMLDivElement | HTMLSpanElement | HTMLParagraphElement | null>>;
24
+ } & import("react").RefAttributes<HTMLDivElement | HTMLParagraphElement | HTMLSpanElement | null>>;
25
25
  export default Body;
26
26
  //# sourceMappingURL=Body.d.ts.map
@@ -16,6 +16,6 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
16
16
  /** @default 'default' */
17
17
  type?: "default" | "negative";
18
18
  'data-testid'?: string;
19
- } & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "children" | "className" | "id" | "tabIndex" | "role" | "aria-label"> & import("react").RefAttributes<unknown>>;
19
+ } & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "id" | "className" | "tabIndex" | "role" | "aria-label" | "children"> & import("react").RefAttributes<unknown>>;
20
20
  export default IconButton;
21
21
  //# sourceMappingURL=IconButton.d.ts.map
@@ -55,6 +55,7 @@ declare const _default: import("react").FC<{
55
55
  selectProps?: Partial<SelectInputProps<CurrencyOptionItem>> | undefined;
56
56
  amount: number | null;
57
57
  searchPlaceholder?: string | undefined;
58
+ decimals?: number | undefined;
58
59
  currencies: readonly CurrencyItem[];
59
60
  selectedCurrency: CurrencyOptionItem;
60
61
  onCurrencyChange?: ((value: CurrencyOptionItem) => void) | undefined;
@@ -66,7 +67,6 @@ declare const _default: import("react").FC<{
66
67
  }) => void) | undefined;
67
68
  customActionLabel?: import("react").ReactNode;
68
69
  onCustomAction?: (() => void) | undefined;
69
- decimals?: number | undefined;
70
70
  }>;
71
71
  export default _default;
72
72
  //# sourceMappingURL=MoneyInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/MoneyInput/MoneyInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAGL,SAAS,EACT,UAAU,EACV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AAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kCAAkC,GAAG,eAAe,GAC9D,OAAO,CAAC,wBAAwB,CAAC,CAAC;;SA5B7B,MAAM;wBACS,MAAM;YAMnB,SAAS,GAAG,UAAU,GAAG,SAAS;kBAF3B,MAAM;iBAYP,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;kBACrB,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAZnD,MAAM,GAAG,IAAI;wBAID,MAAM;eAcf,MAAM;gBAtBL,SAAS,YAAY,EAAE;sBACjB,kBAAkB;wBACjB,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI;sBAIrC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;;sBAM9B,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,YAAY,EAAE,CAAA;KAAE,KAAK,IAAI;;sBAEzE,MAAM,IAAI;;AAkb7B,wBAA2F"}
@@ -10,7 +10,7 @@ export type TitleProps = LabelHTMLAttributes<HTMLHeadingElement | HTMLSpanElemen
10
10
  */
11
11
  type?: TitleTypes;
12
12
  };
13
- declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement> & React.LiHTMLAttributes<HTMLLIElement> & {
13
+ declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLHeadingElement | HTMLLabelElement | HTMLSpanElement> & React.LiHTMLAttributes<HTMLLIElement> & {
14
14
  /**
15
15
  * Default value will based one `type` prop
16
16
  */
@@ -19,6 +19,6 @@ declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<H
19
19
  * Default value: {@link DEFAULT_TYPE}
20
20
  */
21
21
  type?: TitleTypes;
22
- } & React.RefAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement>>;
22
+ } & React.RefAttributes<HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLSpanElement>>;
23
23
  export default Title;
24
24
  //# sourceMappingURL=Title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeaheadInput.d.ts","sourceRoot":"","sources":["../../../../src/Typeahead/TypeaheadInput/TypeaheadInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM/D,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACrD,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACxD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACvD,UAAU,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACnE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,IAAI,CACN,cAAc,CAAC,CAAC,CAAC,EACjB,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,CACpF,CAA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AC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACnE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,IAAI,CACN,cAAc,CAAC,CAAC,CAAC,EACjB,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,CACpF,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,CAAC,CAAE,SAAQ,SAAS,CACtD,mBAAmB,CAAC,CAAC,CAAC,EACtB,mBAAmB,CACpB;IACC,QAAQ,8CAAiC;IACzC,QAAQ,4CAA+B;gBAE3B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAQzC,iBAAiB;IAUjB,kBAAkB,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAMxD,gBAAgB,aAId;IAEF,WAAW,GAAI,OAAO,OAAO,iCA+C3B;IAEF,MAAM;CAmCP"}
@@ -15,7 +15,7 @@ export default class UploadImageStep extends PureComponent<UploadImageStepProps>
15
15
  uploadInputRef: import("react").RefObject<HTMLInputElement>;
16
16
  onManualUpload: () => void;
17
17
  onKeyDown: (event: React.KeyboardEvent<HTMLLabelElement>) => void;
18
- getImage: () => number | true | import("react").JSX.Element | Iterable<import("react").ReactNode>;
18
+ getImage: () => number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element;
19
19
  render(): import("react").JSX.Element;
20
20
  }
21
21
  //# sourceMappingURL=UploadImageStep.d.ts.map
@@ -5,5 +5,5 @@ export declare const UploadItemLink: import("react").ForwardRefExoticComponent<{
5
5
  singleFileUpload: boolean;
6
6
  } & {
7
7
  children?: import("react").ReactNode | undefined;
8
- } & import("react").RefAttributes<HTMLDivElement | HTMLAnchorElement>>;
8
+ } & import("react").RefAttributes<HTMLAnchorElement | HTMLDivElement>>;
9
9
  //# sourceMappingURL=UploadItemLink.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.165.4",
3
+ "version": "46.165.5",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -121,7 +121,7 @@
121
121
  "lodash.debounce": "^4.0.8",
122
122
  "merge-props": "^6.0.0",
123
123
  "react-transition-group": "^4.4.5",
124
- "virtua": "^0.52.1"
124
+ "virtua": "^0.53.3"
125
125
  },
126
126
  "publishConfig": {
127
127
  "access": "public",
@@ -250,6 +250,7 @@ export const RTLDiff: Story = {
250
250
  );
251
251
  },
252
252
  ...withRTLDiff({
253
+ fixedRows: { heights: 'auto' },
253
254
  i18n: {
254
255
  startIcon: { en: 'Start icon', ar: 'أيقونة البداية' },
255
256
  endIcon: { en: 'End icon', ar: 'أيقونة النهاية' },
@@ -166,6 +166,7 @@ export const RTLDiff: Story = {
166
166
  });
167
167
  },
168
168
  ...withRTLDiff({
169
+ fixedRows: { heights: 'auto' },
169
170
  i18n: {
170
171
  disabledReason: {
171
172
  en: 'Weekends and specific dates are unavailable.',
@@ -49,6 +49,7 @@ export const Sizes: Story = {
49
49
  },
50
50
  ...withRTLDiff({
51
51
  renderAs: 'iframe',
52
+ fixedRows: { heights: [6, 7, 9] },
52
53
  i18n: {
53
54
  dayLabel: { en: 'Day', ar: 'اليوم' },
54
55
  monthLabel: { en: 'Month', ar: 'الشهر' },
@@ -37,5 +37,6 @@ export const Basic: Story = {
37
37
  onChange: fn(),
38
38
  onBlur: fn(),
39
39
  onFocus: fn(),
40
+ size: 'lg',
40
41
  },
41
42
  } satisfies Story;
@@ -84,6 +84,7 @@ export const RTLDiff: Story = {
84
84
  );
85
85
  },
86
86
  ...withRTLDiff({
87
+ fixedRows: { heights: 'auto' },
87
88
  i18n: {
88
89
  sendTitle: { en: 'Send money', ar: 'إرسال الأموال' },
89
90
  sendDescription: { en: 'Fast international transfers.', ar: 'تحويلات دولية سريعة.' },
@@ -222,7 +222,7 @@ export const RTLDiff: Story = {
222
222
  );
223
223
  },
224
224
  ...withRTLDiff({
225
- fixedRows: { heights: [8, 11, 8, 8, 8, 10, 12, 8, 8, 8] },
225
+ fixedRows: { heights: 'auto' },
226
226
  i18n: {
227
227
  fullName: { en: 'Full name', ar: 'الاسم الكامل' },
228
228
  customerName: { en: 'Alice Smith', ar: 'أليس سميث' },
@@ -94,6 +94,7 @@ export const TriggerVariants: Story = {
94
94
  );
95
95
  },
96
96
  ...withRTLDiff({
97
+ fixedRows: { heights: [8, 8, 10, 8] },
97
98
  renderAs: 'iframe',
98
99
  width: 'stretch',
99
100
  i18n: {
@@ -111,6 +111,7 @@ export const RTLDiff: Story = {
111
111
  );
112
112
  },
113
113
  ...withRTLDiff({
114
+ fixedRows: { heights: 'auto' },
114
115
  width: 'stretch',
115
116
  i18n: {
116
117
  placeholder_en: { en: 'LTR placeholder...', ar: 'LTR placeholder...' },
@@ -151,7 +151,7 @@ export const RTLDiff: Story = {
151
151
  );
152
152
  },
153
153
  ...withRTLDiff({
154
- fixedRows: { heights: [4, 4, 5, 5], hideSeparators: true },
154
+ fixedRows: { heights: 'auto', hideSeparators: true },
155
155
  i18n: {
156
156
  groupWithoutAction: { en: 'Group level without action', ar: 'مستوى المجموعة بدون إجراء' },
157
157
  groupWithAction: { en: 'Group level with action', ar: 'مستوى المجموعة مع إجراء' },
@@ -70,6 +70,7 @@ export const RTLDiff: StoryObj<typeof InputWithDisplayFormat> = {
70
70
  );
71
71
  },
72
72
  ...withRTLDiff({
73
+ fixedRows: { heights: 'auto' },
73
74
  width: 'stretch',
74
75
  i18n: {
75
76
  value: {
@@ -78,6 +78,7 @@ export const RTLDiff: Story = {
78
78
  );
79
79
  },
80
80
  ...withRTLDiff({
81
+ fixedRows: { heights: 'auto' },
81
82
  i18n: {
82
83
  placeholder_both: { en: 'addonStart and addonEnd', ar: 'البادئة والنهاية' },
83
84
  placeholder_start: { en: 'addonStart only', ar: 'البادئة فقط' },
@@ -88,6 +88,7 @@ export const TriggerVariants: Story = {
88
88
  );
89
89
  },
90
90
  ...withRTLDiff({
91
+ fixedRows: { heights: 'auto' },
91
92
  i18n: {
92
93
  ...currencyNames,
93
94
  selectCurrency: { en: 'Select currency', ar: 'اختر العملة' },
@@ -168,6 +168,7 @@ export const RTLDiff: Story = {
168
168
  );
169
169
  },
170
170
  ...withRTLDiff({
171
+ fixedRows: { heights: 'auto' },
171
172
  width: 'stretch',
172
173
  i18n: {
173
174
  placeholder: { en: 'Translated placeholder...', ar: 'نص بديل مترجم...' },
@@ -15,7 +15,7 @@ export const RTLDiff: Story = {
15
15
  render: () => {
16
16
  const i18n = useRtlDiffI18n();
17
17
  return (
18
- <div style={{ display: 'grid', width: '100%', gridTemplateRows: '8lh auto' }}>
18
+ <div>
19
19
  <InstructionsList
20
20
  dos={[i18n.initialTransfer, i18n.inviteFriends]}
21
21
  donts={[i18n.hiddenFees, i18n.badExchangeRate]}
@@ -30,6 +30,7 @@ export const RTLDiff: Story = {
30
30
  );
31
31
  },
32
32
  ...withRTLDiff({
33
+ fixedRows: { heights: 'auto' },
33
34
  i18n: {
34
35
  initialTransfer: {
35
36
  en: 'Do an initial money transfer',
@@ -34,6 +34,7 @@ export const RTLDiff: Story = {
34
34
  );
35
35
  },
36
36
  ...withRTLDiff({
37
+ fixedRows: { heights: 'auto' },
37
38
  i18n: {
38
39
  plain: { en: 'Plain label text', ar: 'نص التسمية العادي' },
39
40
  optional: { en: 'Label with optional marker', ar: 'تسمية مع علامة اختيارية' },
@@ -128,12 +128,7 @@ export default {
128
128
  ...withRTLDiff({
129
129
  width: 'stretch',
130
130
  i18n: i18nMap,
131
- fixedRows: {
132
- heights: [
133
- 4, 6, 4, 6, 7, 5, 7, 5, 5, 7, 5, 5, 5, 5, 13, 5, 5, 8, 4, 7, 7, 6, 7, 5, 9, 5, 5, 5, 5, 5,
134
- 5, 5, 6, 6, 6, 14, 8, 8, 8, 8, 8, 8,
135
- ],
136
- },
131
+ fixedRows: { heights: 'auto' },
137
132
  }),
138
133
  } satisfies Meta<ListItemProps>;
139
134
 
@@ -75,7 +75,9 @@ export const TriggerVariants: Story = {
75
75
  </Field>
76
76
  </>
77
77
  ),
78
- ...withRTLDiff(),
78
+ ...withRTLDiff({
79
+ fixedRows: { heights: 'auto' },
80
+ }),
79
81
  };
80
82
 
81
83
  export const OpenDropdown: Story = {
@@ -33,7 +33,7 @@ export const Sizes: Story = {
33
33
  </Field>
34
34
  </>
35
35
  ),
36
- ...withRTLDiff({ renderAs: 'iframe' }),
36
+ ...withRTLDiff({ renderAs: 'iframe', fixedRows: { heights: [7, 6, 8] } }),
37
37
  };
38
38
 
39
39
  export const DropdownOpen: Story = {
@@ -33,6 +33,7 @@ export const RTLDiff: Story = {
33
33
  );
34
34
  },
35
35
  ...withRTLDiff({
36
+ fixedRows: { heights: 'auto' },
36
37
  i18n: {
37
38
  title1: { en: 'Send 5,550 GBP', ar: 'أرسل ٥٬٥٥٠ جنيه إسترليني' },
38
39
  description: {
@@ -315,6 +315,7 @@ export const RTLDiff: Story = {
315
315
  );
316
316
  },
317
317
  ...withRTLDiff({
318
+ fixedRows: { heights: 'auto' },
318
319
  i18n: {
319
320
  defaultIconTitle: { en: 'Default status icon', ar: 'أيقونة الحالة الافتراضية' },
320
321
  defaultIconDescription: {
@@ -515,6 +515,7 @@ export const RTLDiff: Story = {
515
515
  );
516
516
  },
517
517
  ...withRTLDiff({
518
+ fixedRows: { heights: [10, 12, 12, 13, 13] },
518
519
  renderAs: 'iframe',
519
520
  i18n: {
520
521
  titleOnly: { en: 'Title only', ar: 'العنوان فقط' },
@@ -583,6 +583,7 @@ export const RTLDiff: Story = {
583
583
  );
584
584
  },
585
585
  ...withRTLDiff({
586
+ fixedRows: { heights: 'auto' },
586
587
  i18n: {
587
588
  basicDescription: { en: 'Basic description only.', ar: 'الوصف الأساسي فقط.' },
588
589
  withTitleHeading: { en: 'With Title', ar: 'مع عنوان' },
@@ -47,6 +47,7 @@ export const RTLDiff: Story = {
47
47
  );
48
48
  },
49
49
  ...withRTLDiff({
50
+ fixedRows: { heights: 'auto' },
50
51
  i18n: {
51
52
  defaultIcon: {
52
53
  en: 'Short content with default icon.',
@@ -88,23 +88,34 @@ export const RTLDiff: Story = {
88
88
 
89
89
  return (
90
90
  <>
91
- <Table data={{ headers, rows }} />
92
- <Table
93
- data={{
94
- headers,
95
- rows,
96
- onRowClick: (rowData: TableRowType | TableRowClickableType) => {
97
- void rowData;
98
- },
99
- }}
100
- />
101
- <Table data={{ headers, rows }} fullWidth={false} />
102
- <Table data={{ headers, rows: [] }} />
103
- <Table data={{ headers, rows }} loading />
91
+ <div>
92
+ <Table data={{ headers, rows }} />
93
+ </div>
94
+ <div>
95
+ <Table
96
+ data={{
97
+ headers,
98
+ rows,
99
+ onRowClick: (rowData: TableRowType | TableRowClickableType) => {
100
+ void rowData;
101
+ },
102
+ }}
103
+ />
104
+ </div>
105
+ <div>
106
+ <Table data={{ headers, rows }} fullWidth={false} />
107
+ </div>
108
+ <div>
109
+ <Table data={{ headers, rows: [] }} />
110
+ </div>
111
+ <div>
112
+ <Table data={{ headers, rows }} loading />
113
+ </div>
104
114
  </>
105
115
  );
106
116
  },
107
117
  ...withRTLDiff({
118
+ fixedRows: { heights: 'auto' },
108
119
  i18n: {
109
120
  employeeHeader: { en: 'Employee', ar: 'الموظف' },
110
121
  locationHeader: { en: 'Location', ar: 'الموقع' },
@@ -84,7 +84,7 @@ export const RTLDiff: Story = {
84
84
  );
85
85
  },
86
86
  ...withRTLDiff({
87
- fixedRows: { heights: [8, 8, 8, 8] },
87
+ fixedRows: { heights: 'auto' },
88
88
  i18n: {
89
89
  firstTab: { en: 'First tab', ar: 'التبويب الأول' },
90
90
  secondTab: { en: 'Second tab', ar: 'التبويب الثاني' },
@@ -49,6 +49,7 @@ export const RTLDiff: Story = {
49
49
  );
50
50
  },
51
51
  ...withRTLDiff({
52
+ fixedRows: { heights: 'auto' },
52
53
  i18n: {
53
54
  value: {
54
55
  en: 'XKQMRTBWJNFL',
@@ -26,12 +26,6 @@
26
26
  }
27
27
  .typeahead--multiple .np-chip {
28
28
  margin-block-end: auto;
29
- animation-name: slide;
30
- animation-duration: 0.03s;
31
- animation-timing-function: ease-in-out;
32
- }
33
- .typeahead--multiple .np-chip:first-child {
34
- animation-name: slideFirst;
35
29
  }
36
30
  .typeahead--multiple .np-chip-remove {
37
31
  animation-name: fadeIn;
@@ -43,7 +37,10 @@
43
37
  min-block-size: auto;
44
38
  padding-block-start: 0;
45
39
  padding-block-end: 0;
46
- overflow: auto;
40
+ overflow: visible;
41
+ }
42
+ .typeahead--multiple .typeahead__input-container--scrollable {
43
+ overflow-y: auto;
47
44
  }
48
45
  .typeahead--multiple .typeahead__input {
49
46
  border: none;
@@ -77,12 +74,12 @@
77
74
  padding-inline-start: 0;
78
75
  }
79
76
  .typeahead--multiple.typeahead--has-value .typeahead__input {
80
- margin-block-end: calc(-1 * var(--size-8) + 1px);
77
+ margin-block-end: calc(-1 * var(--size-8));
81
78
  margin-inline-start: var(--size-4);
82
79
  }
83
80
  .typeahead--multiple.typeahead--has-value .typeahead__input-wrapper::after {
84
81
  content: "";
85
- block-size: calc(var(--size-8) - 1);
82
+ block-size: var(--size-8);
86
83
  inline-size: 100%;
87
84
  }
88
85
  .typeahead__input-wrapper {
@@ -116,7 +113,7 @@
116
113
  min-block-size: var(--input-height-large);
117
114
  }
118
115
  .typeahead-lg.typeahead--multiple .typeahead__input {
119
- padding-block-start: calc(var(--size-8) - 1);
116
+ padding-block-start: var(--size-8);
120
117
  }
121
118
  .typeahead-lg.typeahead--multiple .typeahead__input-wrapper {
122
119
  padding-block-end: var(--size-8);
@@ -128,22 +125,6 @@
128
125
  .typeahead-lg.typeahead--multiple .np-chip {
129
126
  margin-block-end: 0;
130
127
  }
131
- @keyframes slide {
132
- from {
133
- transform: translateX(-12px);
134
- }
135
- to {
136
- transform: none;
137
- }
138
- }
139
- @keyframes slideFirst {
140
- from {
141
- transform: translateX(-4px);
142
- }
143
- to {
144
- transform: none;
145
- }
146
- }
147
128
  @keyframes fadeIn {
148
129
  from {
149
130
  opacity: 0;
@@ -166,7 +147,7 @@
166
147
  color: var(--color-interactive-secondary);
167
148
  }
168
149
  .np-theme-personal .typeahead .np-chip {
169
- margin-block-start: 9px !important;
150
+ margin-block-start: var(--size-8);
170
151
  }
171
152
  .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
172
153
  padding-inline-end: var(--size-16);
@@ -35,13 +35,6 @@
35
35
  &--multiple {
36
36
  .np-chip {
37
37
  margin-bottom: auto;
38
- animation-name: slide;
39
- animation-duration: @animation-duration;
40
- animation-timing-function: @animation-timing-function;
41
-
42
- &:first-child {
43
- animation-name: slideFirst;
44
- }
45
38
 
46
39
  &-remove {
47
40
  animation-name: fadeIn;
@@ -55,7 +48,11 @@
55
48
  min-height: auto;
56
49
  padding-top: 0;
57
50
  padding-bottom: 0;
58
- overflow: auto;
51
+ overflow: visible;
52
+ }
53
+
54
+ .typeahead__input-container--scrollable {
55
+ overflow-y: auto;
59
56
  }
60
57
 
61
58
  .typeahead__input {
@@ -98,14 +95,14 @@
98
95
  }
99
96
 
100
97
  .typeahead__input {
101
- margin-bottom: calc(-1 * var(--size-8) + 1px);
98
+ margin-bottom: calc(-1 * var(--size-8));
102
99
  margin-left: var(--size-4);
103
100
  }
104
101
 
105
102
  .typeahead__input-wrapper {
106
103
  &::after {
107
104
  content: "";
108
- height: calc(var(--size-8) - 1);
105
+ height: var(--size-8);
109
106
  width: 100%;
110
107
  }
111
108
  }
@@ -165,7 +162,7 @@
165
162
  }
166
163
 
167
164
  .typeahead__input {
168
- padding-top: calc(var(--size-8) - 1);
165
+ padding-top: var(--size-8);
169
166
  }
170
167
 
171
168
  .typeahead__input-wrapper {
@@ -183,26 +180,6 @@
183
180
  }
184
181
  }
185
182
 
186
- @keyframes slide {
187
- from {
188
- transform: translateX(-12px);
189
- }
190
-
191
- to {
192
- transform: none;
193
- }
194
- }
195
-
196
- @keyframes slideFirst {
197
- from {
198
- transform: translateX(-4px);
199
- }
200
-
201
- to {
202
- transform: none;
203
- }
204
- }
205
-
206
183
  @keyframes fadeIn {
207
184
  from {
208
185
  opacity: 0;
@@ -229,7 +206,7 @@
229
206
  color: var(--color-interactive-secondary);
230
207
  }
231
208
  .np-chip {
232
- margin-top: 9px !important;
209
+ margin-top: var(--size-8);
233
210
  }
234
211
  .np-chip--removable {
235
212
  .np-text-body-default-bold {
@@ -65,10 +65,8 @@ export default class TypeaheadInput<T> extends Component<
65
65
  }
66
66
 
67
67
  recalculateWidth = () => {
68
- requestAnimationFrame(() => {
69
- this.setState({
70
- inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, this.sizerRef.current?.scrollWidth ?? 0 + 10),
71
- });
68
+ this.setState({
69
+ inputWidth: Math.max(DEFAULT_INPUT_MIN_WIDTH, (this.sizerRef.current?.scrollWidth ?? 0) + 10),
72
70
  });
73
71
  };
74
72
 
@@ -131,7 +129,9 @@ export default class TypeaheadInput<T> extends Component<
131
129
 
132
130
  return multiple ? (
133
131
  <div
134
- className="form-control typeahead__input-container"
132
+ className={clsx('form-control typeahead__input-container', {
133
+ 'typeahead__input-container--scrollable': maxHeight != null,
134
+ })}
135
135
  style={{ maxHeight }}
136
136
  onClick={() => {
137
137
  this.inputRef.current?.focus();
@@ -87,7 +87,7 @@ export const TriggerVariants: Story = {
87
87
  </>
88
88
  );
89
89
  },
90
- ...withRTLDiff({ width: '80%', i18n: localisedStrings }),
90
+ ...withRTLDiff({ fixedRows: { heights: 'auto' }, width: '80%', i18n: localisedStrings }),
91
91
  };
92
92
 
93
93
  export const OpenDropdown: Story = {
@@ -112,3 +112,68 @@ export const AutoFocusInModal: Story = {
112
112
  );
113
113
  },
114
114
  };
115
+
116
+ const testEmails = [
117
+ { label: 'alex@example.com' },
118
+ { label: 'bruno.silva@example.com' },
119
+ { label: 'chen@example.com' },
120
+ { label: 'dana.khan@example.com' },
121
+ { label: 'emeka@example.com' },
122
+ ];
123
+
124
+ export const Chips: Story = {
125
+ render: () => (
126
+ <div className="d-flex flex-column">
127
+ <Field id="typeahead-chips-one-row" label="One row">
128
+ <Typeahead
129
+ id="typeahead-chips-one-row"
130
+ name="typeahead-chips-one-row"
131
+ multiple
132
+ allowNew
133
+ showSuggestions={false}
134
+ initialValue={testEmails.slice(0, 2)}
135
+ options={[]}
136
+ onChange={() => {}}
137
+ />
138
+ </Field>
139
+ <Field id="typeahead-chips-wrapped" label="Wrapped over several rows">
140
+ <Typeahead
141
+ id="typeahead-chips-wrapped"
142
+ name="typeahead-chips-wrapped"
143
+ multiple
144
+ allowNew
145
+ showSuggestions={false}
146
+ initialValue={testEmails}
147
+ options={[]}
148
+ onChange={() => {}}
149
+ />
150
+ </Field>
151
+ <Field id="typeahead-chips-capped" label="Capped with maxHeight">
152
+ <Typeahead
153
+ id="typeahead-chips-capped"
154
+ name="typeahead-chips-capped"
155
+ multiple
156
+ allowNew
157
+ showSuggestions={false}
158
+ maxHeight={100}
159
+ initialValue={testEmails}
160
+ options={[]}
161
+ onChange={() => {}}
162
+ />
163
+ </Field>
164
+ <Field id="typeahead-chips-large" label="Large">
165
+ <Typeahead
166
+ id="typeahead-chips-large"
167
+ name="typeahead-chips-large"
168
+ size="lg"
169
+ multiple
170
+ allowNew
171
+ showSuggestions={false}
172
+ initialValue={testEmails.slice(0, 2)}
173
+ options={[]}
174
+ onChange={() => {}}
175
+ />
176
+ </Field>
177
+ </div>
178
+ ),
179
+ };
@@ -34,6 +34,7 @@ export const Sizes: Story = {
34
34
  );
35
35
  },
36
36
  ...withRTLDiff({
37
+ fixedRows: { heights: 'auto' },
37
38
  i18n: {
38
39
  smallUpload: { en: 'Small upload', ar: 'منطقة رفع صغيرة' },
39
40
  mediumUpload: { en: 'Medium upload', ar: 'منطقة رفع متوسطة' },
@@ -344,6 +344,7 @@ export const RTLDiff: Story = {
344
344
  );
345
345
  },
346
346
  ...withRTLDiff({
347
+ fixedRows: { heights: [8, 8, 46] },
347
348
  renderAs: 'iframe',
348
349
  i18n: {
349
350
  singleUpload: { en: 'single-upload.pdf', ar: 'تحميل-واحد.pdf' },
package/src/main.css CHANGED
@@ -25409,12 +25409,6 @@ button.np-link {
25409
25409
  }
25410
25410
  .typeahead--multiple .np-chip {
25411
25411
  margin-block-end: auto;
25412
- animation-name: slide;
25413
- animation-duration: 0.03s;
25414
- animation-timing-function: ease-in-out;
25415
- }
25416
- .typeahead--multiple .np-chip:first-child {
25417
- animation-name: slideFirst;
25418
25412
  }
25419
25413
  .typeahead--multiple .np-chip-remove {
25420
25414
  animation-name: fadeIn;
@@ -25426,7 +25420,10 @@ button.np-link {
25426
25420
  min-block-size: auto;
25427
25421
  padding-block-start: 0;
25428
25422
  padding-block-end: 0;
25429
- overflow: auto;
25423
+ overflow: visible;
25424
+ }
25425
+ .typeahead--multiple .typeahead__input-container--scrollable {
25426
+ overflow-y: auto;
25430
25427
  }
25431
25428
  .typeahead--multiple .typeahead__input {
25432
25429
  border: none;
@@ -25460,12 +25457,12 @@ button.np-link {
25460
25457
  padding-inline-start: 0;
25461
25458
  }
25462
25459
  .typeahead--multiple.typeahead--has-value .typeahead__input {
25463
- margin-block-end: calc(-1 * var(--size-8) + 1px);
25460
+ margin-block-end: calc(-1 * var(--size-8));
25464
25461
  margin-inline-start: var(--size-4);
25465
25462
  }
25466
25463
  .typeahead--multiple.typeahead--has-value .typeahead__input-wrapper::after {
25467
25464
  content: "";
25468
- block-size: calc(var(--size-8) - 1);
25465
+ block-size: var(--size-8);
25469
25466
  inline-size: 100%;
25470
25467
  }
25471
25468
  .typeahead__input-wrapper {
@@ -25499,7 +25496,7 @@ button.np-link {
25499
25496
  min-block-size: var(--input-height-large);
25500
25497
  }
25501
25498
  .typeahead-lg.typeahead--multiple .typeahead__input {
25502
- padding-block-start: calc(var(--size-8) - 1);
25499
+ padding-block-start: var(--size-8);
25503
25500
  }
25504
25501
  .typeahead-lg.typeahead--multiple .typeahead__input-wrapper {
25505
25502
  padding-block-end: var(--size-8);
@@ -25511,22 +25508,6 @@ button.np-link {
25511
25508
  .typeahead-lg.typeahead--multiple .np-chip {
25512
25509
  margin-block-end: 0;
25513
25510
  }
25514
- @keyframes slide {
25515
- from {
25516
- transform: translateX(-12px);
25517
- }
25518
- to {
25519
- transform: none;
25520
- }
25521
- }
25522
- @keyframes slideFirst {
25523
- from {
25524
- transform: translateX(-4px);
25525
- }
25526
- to {
25527
- transform: none;
25528
- }
25529
- }
25530
25511
  @keyframes fadeIn {
25531
25512
  from {
25532
25513
  opacity: 0;
@@ -25549,7 +25530,7 @@ button.np-link {
25549
25530
  color: var(--color-interactive-secondary);
25550
25531
  }
25551
25532
  .np-theme-personal .typeahead .np-chip {
25552
- margin-block-start: 9px !important;
25533
+ margin-block-start: var(--size-8);
25553
25534
  }
25554
25535
  .np-theme-personal .typeahead .np-chip--removable .np-text-body-default-bold {
25555
25536
  padding-inline-end: var(--size-16);