@digigov/ui 1.2.0-a7ffb5dc → 2.0.0-462194bf

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 (445) hide show
  1. package/app/Footer/index.mdx +18 -5
  2. package/app/Header/index.mdx +7 -5
  3. package/app/Masthead/index.mdx +9 -4
  4. package/app/Modal/Modal.stories/index.js +2 -1
  5. package/app/Modal/Modal.stories.d.ts +1 -0
  6. package/app/Modal/__stories__/WithoutModalGaps/index.js +36 -0
  7. package/app/Modal/__stories__/WithoutModalGaps/package.json +6 -0
  8. package/app/Modal/__stories__/WithoutModalGaps.d.ts +3 -0
  9. package/app/Modal/auto.d.ts +2 -2
  10. package/app/Modal/index.d.ts +2 -2
  11. package/app/Modal/index.js +1 -1
  12. package/app/Modal/index.mdx +11 -4
  13. package/app/NotFound/index.mdx +2 -0
  14. package/app/Panel/index.mdx +9 -4
  15. package/app/PhaseBannerHeader/index.mdx +4 -4
  16. package/app/QrCodeViewer/QRCode.stories.d.ts +1 -0
  17. package/app/QrCodeViewer/index.d.ts +1 -0
  18. package/app/QrCodeViewer/index.js +2 -1
  19. package/app/QrCodeViewer/index.mdx +4 -4
  20. package/app/Skeleton/Skeleton.stories/index.js +17 -0
  21. package/{utils/Kitchensink/AllComponents → app/Skeleton/Skeleton.stories}/package.json +1 -1
  22. package/app/Skeleton/Skeleton.stories.d.ts +18 -0
  23. package/app/Skeleton/__stories__/Button/index.js +9 -0
  24. package/{utils/Kitchensink/KitchensinkComponent → app/Skeleton/__stories__/Button}/package.json +1 -1
  25. package/app/Skeleton/__stories__/Button.d.ts +3 -0
  26. package/app/Skeleton/__stories__/Circular/index.js +11 -0
  27. package/app/Skeleton/__stories__/Circular/package.json +6 -0
  28. package/app/Skeleton/__stories__/Circular.d.ts +3 -0
  29. package/app/Skeleton/__stories__/Default/index.js +7 -0
  30. package/app/Skeleton/__stories__/Default/package.json +6 -0
  31. package/app/Skeleton/__stories__/Default.d.ts +3 -0
  32. package/app/Skeleton/__stories__/NoAnimation/index.js +9 -0
  33. package/{utils/Kitchensink/KitchensinkByCategory → app/Skeleton/__stories__/NoAnimation}/package.json +1 -1
  34. package/app/Skeleton/__stories__/NoAnimation.d.ts +3 -0
  35. package/app/Skeleton/__stories__/Rectangular/index.js +10 -0
  36. package/app/Skeleton/__stories__/Rectangular/package.json +6 -0
  37. package/app/Skeleton/__stories__/Rectangular.d.ts +3 -0
  38. package/app/Skeleton/__stories__/SpecificWidthAndHeight/index.js +10 -0
  39. package/app/Skeleton/__stories__/SpecificWidthAndHeight/package.json +6 -0
  40. package/app/Skeleton/__stories__/SpecificWidthAndHeight.d.ts +3 -0
  41. package/app/Skeleton/__stories__/TextSizes/index.js +26 -0
  42. package/{utils/Kitchensink/KitchensinkByLetter → app/Skeleton/__stories__/TextSizes}/package.json +1 -1
  43. package/app/Skeleton/__stories__/TextSizes.d.ts +3 -0
  44. package/app/Skeleton/__stories__/UnderTypography/index.js +10 -0
  45. package/{form/AutoComplete/__stories__/WithInLine → app/Skeleton/__stories__/UnderTypography}/package.json +1 -1
  46. package/app/Skeleton/__stories__/UnderTypography.d.ts +3 -0
  47. package/app/Skeleton/__stories__/WithChildren/index.js +8 -0
  48. package/app/Skeleton/__stories__/WithChildren/package.json +6 -0
  49. package/app/Skeleton/__stories__/WithChildren.d.ts +3 -0
  50. package/app/Skeleton/index.d.ts +3 -0
  51. package/app/Skeleton/index.js +3 -0
  52. package/{misc/KitchenSink → app/Skeleton}/package.json +1 -1
  53. package/app/ThemeOptions/index.d.ts +2 -2
  54. package/cjs/app/Footer/index.mdx +18 -5
  55. package/cjs/app/Header/index.mdx +7 -5
  56. package/cjs/app/Masthead/index.mdx +9 -4
  57. package/cjs/app/Modal/Modal.stories/index.js +12 -0
  58. package/cjs/app/Modal/__stories__/WithoutModalGaps/index.js +46 -0
  59. package/cjs/app/Modal/index.js +1 -1
  60. package/cjs/app/Modal/index.mdx +11 -4
  61. package/cjs/app/NotFound/index.mdx +2 -0
  62. package/cjs/app/Panel/index.mdx +9 -4
  63. package/cjs/app/PhaseBannerHeader/index.mdx +4 -4
  64. package/cjs/app/QrCodeViewer/index.js +3 -2
  65. package/cjs/app/QrCodeViewer/index.mdx +4 -4
  66. package/cjs/app/Skeleton/Skeleton.stories/index.js +123 -0
  67. package/cjs/app/Skeleton/__stories__/Button/index.js +16 -0
  68. package/cjs/app/Skeleton/__stories__/Circular/index.js +18 -0
  69. package/cjs/app/Skeleton/__stories__/Default/index.js +14 -0
  70. package/cjs/app/Skeleton/__stories__/NoAnimation/index.js +16 -0
  71. package/cjs/app/Skeleton/__stories__/Rectangular/index.js +17 -0
  72. package/cjs/app/Skeleton/__stories__/SpecificWidthAndHeight/index.js +17 -0
  73. package/cjs/app/Skeleton/__stories__/TextSizes/index.js +33 -0
  74. package/cjs/app/Skeleton/__stories__/UnderTypography/index.js +17 -0
  75. package/cjs/app/Skeleton/__stories__/WithChildren/index.js +15 -0
  76. package/cjs/app/Skeleton/index.js +23 -0
  77. package/cjs/content/Accordion/__stories__/Auto/index.js +2 -3
  78. package/cjs/content/Accordion/hooks/index.js +0 -1
  79. package/cjs/content/Accordion/index.mdx +9 -5
  80. package/cjs/content/Blockquote/index.mdx +3 -5
  81. package/cjs/content/Card/index.mdx +3 -5
  82. package/cjs/content/Chip/index.mdx +4 -5
  83. package/cjs/content/Details/index.mdx +3 -5
  84. package/cjs/content/List/__stories__/Default/index.js +1 -2
  85. package/cjs/content/List/index.mdx +3 -5
  86. package/cjs/content/SafeHTML/index.js +5 -8
  87. package/cjs/content/StepNav/index.mdx +28 -5
  88. package/cjs/content/SummaryList/index.mdx +10 -5
  89. package/cjs/content/Table/index.js +2 -2
  90. package/cjs/content/Table/index.mdx +13 -14
  91. package/cjs/content/TaskList/index.mdx +9 -5
  92. package/cjs/content/Timeline/index.mdx +10 -5
  93. package/cjs/feedback/CopyToClipboard/index.mdx +3 -5
  94. package/cjs/feedback/ErrorSummary/index.mdx +3 -5
  95. package/cjs/feedback/NotificationBanner/index.mdx +14 -5
  96. package/cjs/feedback/PhaseBanner/index.mdx +8 -5
  97. package/cjs/feedback/WarningText/index.mdx +5 -5
  98. package/cjs/form/AutoComplete/AutoComplete.stories/index.js +44 -8
  99. package/cjs/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
  100. package/cjs/form/AutoComplete/Status/index.js +12 -5
  101. package/cjs/form/AutoComplete/__stories__/Multiple/index.js +24 -0
  102. package/cjs/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +7 -6
  103. package/cjs/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +23 -0
  104. package/cjs/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +26 -0
  105. package/cjs/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
  106. package/cjs/form/AutoComplete/index.js +334 -206
  107. package/cjs/form/AutoComplete/index.mdx +13 -20
  108. package/cjs/form/AutoComplete/utils/index.js +2 -1
  109. package/cjs/form/Button/index.mdx +3 -5
  110. package/cjs/form/Checkbox/index.mdx +3 -5
  111. package/cjs/form/DateInputContainer/index.mdx +3 -5
  112. package/cjs/form/ErrorMessage/index.mdx +3 -5
  113. package/cjs/form/FileUpload/index.mdx +3 -5
  114. package/cjs/form/RadioContainer/index.mdx +2 -14
  115. package/cjs/form/SelectContainer/index.mdx +3 -1
  116. package/cjs/form/SingleCharacterInputs/index.mdx +3 -5
  117. package/cjs/form/TextArea/index.mdx +3 -5
  118. package/cjs/form/TextInput/TextInput.stories/index.js +12 -0
  119. package/cjs/form/TextInput/__stories__/DisabledInputWithValue/index.js +31 -0
  120. package/cjs/form/TextInput/index.mdx +3 -5
  121. package/cjs/govgr/Footer/index.mdx +1 -1
  122. package/cjs/i18n/locales/el/index.js +2 -2
  123. package/cjs/i18n/locales/en/index.js +2 -2
  124. package/cjs/layouts/Basic/Bottom/__stories__/Default/index.js +22 -0
  125. package/cjs/layouts/Basic/Bottom/index.mdx +9 -28
  126. package/cjs/layouts/Basic/Container/__stories__/Default/index.js +20 -0
  127. package/cjs/layouts/Basic/Container/index.mdx +23 -0
  128. package/cjs/layouts/Basic/Main/__stories__/Default/index.js +20 -0
  129. package/cjs/layouts/Basic/Main/index.mdx +10 -47
  130. package/cjs/layouts/Basic/Top/__stories__/Default/index.js +20 -0
  131. package/cjs/layouts/Basic/Top/index.mdx +10 -55
  132. package/cjs/layouts/Basic/index.mdx +27 -25
  133. package/cjs/layouts/Grid/index.mdx +39 -0
  134. package/cjs/lazy/index.js +152 -134
  135. package/cjs/navigation/BackLink/index.mdx +4 -5
  136. package/cjs/navigation/Breadcrumbs/index.mdx +6 -5
  137. package/cjs/navigation/Drawer/index.mdx +4 -10
  138. package/cjs/navigation/Dropdown/Dropdown.stories/index.js +12 -0
  139. package/cjs/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
  140. package/cjs/navigation/Dropdown/__stories__/ScrollableContent/index.js +68 -0
  141. package/cjs/navigation/Dropdown/index.mdx +3 -5
  142. package/cjs/navigation/Link/index.mdx +5 -15
  143. package/cjs/navigation/NavList/__stories__/Default/index.js +14 -2
  144. package/cjs/navigation/NavList/__stories__/HorizontalWithDrawer/index.js +35 -2
  145. package/cjs/navigation/NavList/__stories__/HorizontalWithoutDrawer/index.js +35 -2
  146. package/cjs/navigation/NavList/__stories__/NavListWithoutNav/index.js +14 -2
  147. package/cjs/navigation/NavList/__stories__/UsingNavListAuto/index.js +37 -4
  148. package/cjs/navigation/NavList/__stories__/Vertical/index.js +14 -2
  149. package/cjs/navigation/NavList/__stories__/VerticalWithoutDrawer/index.js +35 -2
  150. package/cjs/navigation/NavList/index.mdx +23 -7
  151. package/cjs/navigation/Pagination/__stories__/PaginationWithSmallFont/index.js +2 -2
  152. package/cjs/navigation/Pagination/__stories__/WithResultsPerPage/index.js +2 -2
  153. package/cjs/navigation/Pagination/index.mdx +9 -5
  154. package/cjs/navigation/Tabs/index.mdx +9 -5
  155. package/cjs/registry/index.js +6 -12
  156. package/cjs/typography/Heading/index.mdx +3 -5
  157. package/cjs/typography/HeadingCaption/index.mdx +3 -5
  158. package/cjs/typography/Hint/index.mdx +3 -5
  159. package/cjs/typography/NormalText/index.mdx +3 -5
  160. package/cjs/typography/Paragraph/index.mdx +9 -30
  161. package/cjs/typography/Typography/index.js +23 -0
  162. package/cjs/typography/Typography/index.mdx +12 -0
  163. package/cjs/typography/index.js +11 -0
  164. package/cjs/utils/Base/index.mdx +13 -0
  165. package/cjs/utils/VisuallyHidden/index.mdx +10 -5
  166. package/content/Accordion/__stories__/Auto/index.js +2 -3
  167. package/content/Accordion/auto.d.ts +3 -3
  168. package/content/Accordion/hooks/index.js +0 -1
  169. package/content/Accordion/index.mdx +9 -5
  170. package/content/Blockquote/index.mdx +3 -5
  171. package/content/Card/index.mdx +3 -5
  172. package/content/Chip/index.mdx +4 -5
  173. package/content/Details/index.mdx +3 -5
  174. package/content/List/__stories__/Default/index.js +1 -2
  175. package/content/List/index.mdx +3 -5
  176. package/content/SafeHTML/index.d.ts +1 -1
  177. package/content/SafeHTML/index.js +5 -8
  178. package/content/StepNav/auto.d.ts +3 -3
  179. package/content/StepNav/index.mdx +28 -5
  180. package/content/SummaryList/index.mdx +10 -5
  181. package/content/Table/index.d.ts +1 -1
  182. package/content/Table/index.js +2 -2
  183. package/content/Table/index.mdx +13 -14
  184. package/content/TaskList/index.mdx +9 -5
  185. package/content/Timeline/index.mdx +10 -5
  186. package/feedback/CopyToClipboard/index.d.ts +1 -1
  187. package/feedback/CopyToClipboard/index.mdx +3 -5
  188. package/feedback/ErrorSummary/index.mdx +3 -5
  189. package/feedback/NotificationBanner/index.mdx +14 -5
  190. package/feedback/PhaseBanner/index.mdx +8 -5
  191. package/feedback/WarningText/index.mdx +5 -5
  192. package/form/AutoComplete/AutoComplete.stories/index.js +4 -1
  193. package/form/AutoComplete/AutoComplete.stories.d.ts +4 -1
  194. package/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
  195. package/form/AutoComplete/Status/index.d.ts +4 -2
  196. package/form/AutoComplete/Status/index.js +11 -4
  197. package/form/AutoComplete/__stories__/Multiple/index.js +17 -0
  198. package/form/AutoComplete/__stories__/Multiple/package.json +6 -0
  199. package/form/AutoComplete/__stories__/Multiple.d.ts +3 -0
  200. package/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +6 -5
  201. package/form/AutoComplete/__stories__/MultipleShowingTwoSelected/package.json +6 -0
  202. package/form/AutoComplete/__stories__/MultipleShowingTwoSelected.d.ts +3 -0
  203. package/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +16 -0
  204. package/form/AutoComplete/__stories__/MultipleWithDefaultValues/package.json +6 -0
  205. package/form/AutoComplete/__stories__/MultipleWithDefaultValues.d.ts +3 -0
  206. package/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +19 -0
  207. package/form/AutoComplete/__stories__/MultipleWithMinLength/package.json +6 -0
  208. package/form/AutoComplete/__stories__/MultipleWithMinLength.d.ts +3 -0
  209. package/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
  210. package/form/AutoComplete/index.d.ts +13 -20
  211. package/form/AutoComplete/index.js +317 -201
  212. package/form/AutoComplete/index.mdx +13 -20
  213. package/form/AutoComplete/utils/index.js +2 -1
  214. package/form/AutoComplete/utils.d.ts +1 -0
  215. package/form/Button/index.mdx +3 -5
  216. package/form/Checkbox/index.mdx +3 -5
  217. package/form/DateInputContainer/index.mdx +3 -5
  218. package/form/ErrorMessage/index.mdx +3 -5
  219. package/form/FileUpload/index.mdx +3 -5
  220. package/form/RadioContainer/index.mdx +2 -14
  221. package/form/SelectContainer/index.mdx +3 -1
  222. package/form/SingleCharacterInputs/index.mdx +3 -5
  223. package/form/TextArea/index.mdx +3 -5
  224. package/form/TextInput/TextInput.stories/index.js +1 -0
  225. package/form/TextInput/TextInput.stories.d.ts +1 -0
  226. package/form/TextInput/__stories__/DisabledInputWithValue/index.js +25 -0
  227. package/form/TextInput/__stories__/DisabledInputWithValue/package.json +6 -0
  228. package/form/TextInput/__stories__/DisabledInputWithValue.d.ts +3 -0
  229. package/form/TextInput/index.mdx +3 -5
  230. package/govgr/Footer/index.mdx +1 -1
  231. package/i18n/locales/el/index.js +2 -2
  232. package/i18n/locales/en/index.js +2 -2
  233. package/index.js +1 -1
  234. package/layouts/Basic/Bottom/__stories__/Default/index.js +15 -0
  235. package/layouts/Basic/Bottom/__stories__/Default/package.json +6 -0
  236. package/layouts/Basic/Bottom/__stories__/Default.d.ts +3 -0
  237. package/layouts/Basic/Bottom/index.mdx +9 -28
  238. package/layouts/Basic/Container/__stories__/Default/index.js +13 -0
  239. package/layouts/Basic/Container/__stories__/Default/package.json +6 -0
  240. package/layouts/Basic/Container/__stories__/Default.d.ts +3 -0
  241. package/layouts/Basic/Container/index.mdx +23 -0
  242. package/layouts/Basic/Main/__stories__/Default/index.js +13 -0
  243. package/layouts/Basic/Main/__stories__/Default/package.json +6 -0
  244. package/layouts/Basic/Main/__stories__/Default.d.ts +3 -0
  245. package/layouts/Basic/Main/index.mdx +10 -47
  246. package/layouts/Basic/Top/__stories__/Default/index.js +13 -0
  247. package/layouts/Basic/Top/__stories__/Default/package.json +6 -0
  248. package/layouts/Basic/Top/__stories__/Default.d.ts +3 -0
  249. package/layouts/Basic/Top/index.mdx +10 -55
  250. package/layouts/Basic/index.mdx +27 -25
  251. package/layouts/Grid/index.mdx +39 -0
  252. package/lazy/index.js +120 -106
  253. package/lazy.d.ts +269 -267
  254. package/navigation/BackLink/index.mdx +4 -5
  255. package/navigation/Breadcrumbs/index.mdx +6 -5
  256. package/navigation/Drawer/auto.d.ts +3 -3
  257. package/navigation/Drawer/index.mdx +4 -10
  258. package/navigation/Dropdown/Dropdown.stories/index.js +1 -0
  259. package/navigation/Dropdown/Dropdown.stories.d.ts +1 -0
  260. package/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
  261. package/navigation/Dropdown/__stories__/ScrollableContent/index.js +61 -0
  262. package/navigation/Dropdown/__stories__/ScrollableContent/package.json +6 -0
  263. package/navigation/Dropdown/__stories__/ScrollableContent.d.ts +3 -0
  264. package/navigation/Dropdown/index.d.ts +1 -1
  265. package/navigation/Dropdown/index.mdx +3 -5
  266. package/navigation/Link/index.mdx +5 -15
  267. package/navigation/NavList/__stories__/Default/index.js +13 -1
  268. package/navigation/NavList/__stories__/HorizontalWithDrawer/index.js +34 -1
  269. package/navigation/NavList/__stories__/HorizontalWithoutDrawer/index.js +34 -1
  270. package/navigation/NavList/__stories__/NavListWithoutNav/index.js +13 -1
  271. package/navigation/NavList/__stories__/UsingNavListAuto/index.js +35 -2
  272. package/navigation/NavList/__stories__/Vertical/index.js +13 -1
  273. package/navigation/NavList/__stories__/VerticalWithoutDrawer/index.js +34 -1
  274. package/navigation/NavList/index.mdx +23 -7
  275. package/navigation/NavList/types.d.ts +1 -2
  276. package/navigation/Pagination/__stories__/PaginationWithSmallFont/index.js +1 -1
  277. package/navigation/Pagination/__stories__/WithResultsPerPage/index.js +1 -1
  278. package/navigation/Pagination/auto.d.ts +4 -4
  279. package/navigation/Pagination/index.d.ts +2 -2
  280. package/navigation/Pagination/index.mdx +9 -5
  281. package/navigation/Tabs/auto.d.ts +2 -2
  282. package/navigation/Tabs/index.mdx +9 -5
  283. package/package.json +4 -6
  284. package/registry/index.js +6 -12
  285. package/registry.d.ts +4 -6
  286. package/src/app/Footer/index.mdx +18 -5
  287. package/src/app/Header/index.mdx +7 -5
  288. package/src/app/Masthead/index.mdx +9 -4
  289. package/src/app/Modal/Modal.stories.js +1 -0
  290. package/src/app/Modal/__stories__/WithoutModalGaps.tsx +52 -0
  291. package/src/app/Modal/index.mdx +11 -4
  292. package/src/app/Modal/index.tsx +1 -1
  293. package/src/app/NotFound/index.mdx +2 -0
  294. package/src/app/Panel/index.mdx +9 -4
  295. package/src/app/PhaseBannerHeader/index.mdx +4 -4
  296. package/src/app/QrCodeViewer/index.mdx +4 -4
  297. package/src/app/QrCodeViewer/index.tsx +2 -0
  298. package/src/app/Skeleton/Skeleton.stories.js +19 -0
  299. package/src/app/Skeleton/__stories__/Button.tsx +6 -0
  300. package/src/app/Skeleton/__stories__/Circular.tsx +8 -0
  301. package/src/app/Skeleton/__stories__/Default.tsx +6 -0
  302. package/src/app/Skeleton/__stories__/NoAnimation.tsx +6 -0
  303. package/src/app/Skeleton/__stories__/Rectangular.tsx +8 -0
  304. package/src/app/Skeleton/__stories__/SpecificWidthAndHeight.tsx +8 -0
  305. package/src/app/Skeleton/__stories__/TextSizes.tsx +14 -0
  306. package/src/app/Skeleton/__stories__/UnderTypography.tsx +17 -0
  307. package/src/app/Skeleton/__stories__/WithChildren.tsx +11 -0
  308. package/src/app/Skeleton/index.tsx +4 -0
  309. package/src/app/ThemeOptions/index.tsx +1 -1
  310. package/src/content/Accordion/__stories__/Auto.tsx +2 -2
  311. package/src/content/Accordion/auto.tsx +1 -1
  312. package/src/content/Accordion/hooks.ts +0 -1
  313. package/src/content/Accordion/index.mdx +9 -5
  314. package/src/content/Blockquote/index.mdx +3 -5
  315. package/src/content/Card/index.mdx +3 -5
  316. package/src/content/Chip/index.mdx +4 -5
  317. package/src/content/Details/index.mdx +3 -5
  318. package/src/content/List/__stories__/Default.tsx +3 -4
  319. package/src/content/List/index.mdx +3 -5
  320. package/src/content/SafeHTML/index.tsx +3 -4
  321. package/src/content/StepNav/index.mdx +28 -5
  322. package/src/content/SummaryList/index.mdx +10 -5
  323. package/src/content/Table/index.mdx +13 -14
  324. package/src/content/Table/index.tsx +2 -2
  325. package/src/content/TaskList/index.mdx +9 -5
  326. package/src/content/Timeline/index.mdx +10 -5
  327. package/src/feedback/CopyToClipboard/index.mdx +3 -5
  328. package/src/feedback/ErrorSummary/index.mdx +3 -5
  329. package/src/feedback/NotificationBanner/index.mdx +14 -5
  330. package/src/feedback/PhaseBanner/index.mdx +8 -5
  331. package/src/feedback/WarningText/index.mdx +5 -5
  332. package/src/form/AutoComplete/AutoComplete.stories.js +4 -1
  333. package/src/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
  334. package/src/form/AutoComplete/Status/index.tsx +10 -6
  335. package/src/form/AutoComplete/__stories__/Multiple.tsx +18 -0
  336. package/src/form/AutoComplete/__stories__/{WithInLine.tsx → MultipleShowingTwoSelected.tsx} +3 -8
  337. package/src/form/AutoComplete/__stories__/MultipleWithDefaultValues.tsx +16 -0
  338. package/src/form/AutoComplete/__stories__/MultipleWithMinLength.tsx +29 -0
  339. package/src/form/AutoComplete/__stories__/WithShowAllValues.tsx +0 -1
  340. package/src/form/AutoComplete/index.mdx +13 -20
  341. package/src/form/AutoComplete/index.tsx +367 -215
  342. package/src/form/AutoComplete/utils.ts +3 -2
  343. package/src/form/Button/index.mdx +3 -5
  344. package/src/form/Checkbox/index.mdx +3 -5
  345. package/src/form/DateInputContainer/index.mdx +3 -5
  346. package/src/form/ErrorMessage/index.mdx +3 -5
  347. package/src/form/FileUpload/index.mdx +3 -5
  348. package/src/form/RadioContainer/index.mdx +2 -14
  349. package/src/form/SelectContainer/index.mdx +3 -1
  350. package/src/form/SingleCharacterInputs/index.mdx +3 -5
  351. package/src/form/TextArea/index.mdx +3 -5
  352. package/src/form/TextInput/TextInput.stories.js +1 -0
  353. package/src/form/TextInput/__stories__/DisabledInputWithValue.tsx +27 -0
  354. package/src/form/TextInput/index.mdx +3 -5
  355. package/src/govgr/Footer/index.mdx +1 -1
  356. package/src/i18n/locales/el.ts +2 -2
  357. package/src/i18n/locales/en.ts +2 -2
  358. package/src/layouts/Basic/Bottom/__stories__/Default.tsx +35 -0
  359. package/src/layouts/Basic/Bottom/index.mdx +9 -28
  360. package/src/layouts/Basic/Container/__stories__/Default.tsx +30 -0
  361. package/src/layouts/Basic/Container/index.mdx +23 -0
  362. package/src/layouts/Basic/Main/__stories__/Default.tsx +30 -0
  363. package/src/layouts/Basic/Main/index.mdx +10 -47
  364. package/src/layouts/Basic/Top/__stories__/Default.tsx +28 -0
  365. package/src/layouts/Basic/Top/index.mdx +10 -55
  366. package/src/layouts/Basic/index.mdx +27 -25
  367. package/src/layouts/Grid/index.mdx +39 -0
  368. package/src/lazy.js +18 -16
  369. package/src/navigation/BackLink/index.mdx +4 -5
  370. package/src/navigation/Breadcrumbs/index.mdx +6 -5
  371. package/src/navigation/Drawer/index.mdx +4 -10
  372. package/src/navigation/Dropdown/Dropdown.stories.js +1 -0
  373. package/src/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
  374. package/src/navigation/Dropdown/__stories__/ScrollableContent.tsx +82 -0
  375. package/src/navigation/Dropdown/index.mdx +3 -5
  376. package/src/navigation/Link/index.mdx +5 -15
  377. package/src/navigation/NavList/__stories__/Default.tsx +18 -1
  378. package/src/navigation/NavList/__stories__/HorizontalWithDrawer.tsx +37 -1
  379. package/src/navigation/NavList/__stories__/HorizontalWithoutDrawer.tsx +37 -1
  380. package/src/navigation/NavList/__stories__/NavListWithoutNav.tsx +18 -1
  381. package/src/navigation/NavList/__stories__/UsingNavListAuto.tsx +39 -2
  382. package/src/navigation/NavList/__stories__/Vertical.tsx +18 -1
  383. package/src/navigation/NavList/__stories__/VerticalWithoutDrawer.tsx +37 -1
  384. package/src/navigation/NavList/index.mdx +23 -7
  385. package/src/navigation/NavList/types.tsx +1 -2
  386. package/src/navigation/Pagination/__stories__/PaginationWithSmallFont.tsx +1 -1
  387. package/src/navigation/Pagination/__stories__/WithResultsPerPage.tsx +1 -1
  388. package/src/navigation/Pagination/index.mdx +9 -5
  389. package/src/navigation/Tabs/index.mdx +9 -5
  390. package/src/registry.js +6 -12
  391. package/src/typography/Heading/index.mdx +3 -5
  392. package/src/typography/HeadingCaption/index.mdx +3 -5
  393. package/src/typography/Hint/index.mdx +3 -5
  394. package/src/typography/NormalText/index.mdx +3 -5
  395. package/src/typography/Paragraph/index.mdx +9 -30
  396. package/src/typography/Typography/index.mdx +12 -0
  397. package/src/typography/Typography/index.tsx +4 -0
  398. package/src/typography/index.ts +1 -0
  399. package/src/utils/Base/index.mdx +13 -0
  400. package/src/utils/VisuallyHidden/index.mdx +10 -5
  401. package/typography/Heading/index.mdx +3 -5
  402. package/typography/HeadingCaption/index.mdx +3 -5
  403. package/typography/Hint/index.mdx +3 -5
  404. package/typography/NormalText/index.mdx +3 -5
  405. package/typography/Paragraph/index.mdx +9 -30
  406. package/typography/Typography/index.d.ts +3 -0
  407. package/typography/Typography/index.js +3 -0
  408. package/typography/Typography/index.mdx +12 -0
  409. package/typography/Typography/package.json +6 -0
  410. package/typography/index.d.ts +1 -0
  411. package/typography/index.js +2 -1
  412. package/utils/Base/index.mdx +13 -0
  413. package/utils/VisuallyHidden/index.mdx +10 -5
  414. package/cjs/content/List/List.stories.playwright.json +0 -27
  415. package/cjs/layouts/Basic/Masthead/index.mdx +0 -65
  416. package/cjs/misc/KitchenSink/index.js +0 -93
  417. package/cjs/utils/Kitchensink/AllComponents/index.js +0 -16
  418. package/cjs/utils/Kitchensink/KitchensinkByCategory/index.js +0 -39
  419. package/cjs/utils/Kitchensink/KitchensinkByLetter/index.js +0 -26
  420. package/cjs/utils/Kitchensink/KitchensinkComponent/index.js +0 -55
  421. package/cjs/utils/Kitchensink/KitchensinkDashboard/index.js +0 -47
  422. package/content/List/List.stories.playwright.json +0 -27
  423. package/form/AutoComplete/__stories__/WithInLine.d.ts +0 -3
  424. package/layouts/Basic/Masthead/index.mdx +0 -65
  425. package/misc/KitchenSink/index.d.ts +0 -8
  426. package/misc/KitchenSink/index.js +0 -8
  427. package/src/content/List/List.stories.playwright.json +0 -27
  428. package/src/layouts/Basic/Masthead/index.mdx +0 -65
  429. package/src/misc/KitchenSink/index.tsx +0 -8
  430. package/src/utils/Kitchensink/AllComponents.tsx +0 -6
  431. package/src/utils/Kitchensink/KitchensinkByCategory.tsx +0 -56
  432. package/src/utils/Kitchensink/KitchensinkByLetter.tsx +0 -35
  433. package/src/utils/Kitchensink/KitchensinkComponent.tsx +0 -70
  434. package/src/utils/Kitchensink/KitchensinkDashboard.tsx +0 -56
  435. package/utils/Kitchensink/AllComponents/index.js +0 -9
  436. package/utils/Kitchensink/AllComponents.d.ts +0 -2
  437. package/utils/Kitchensink/KitchensinkByCategory/index.js +0 -32
  438. package/utils/Kitchensink/KitchensinkByCategory.d.ts +0 -6
  439. package/utils/Kitchensink/KitchensinkByLetter/index.js +0 -19
  440. package/utils/Kitchensink/KitchensinkByLetter.d.ts +0 -6
  441. package/utils/Kitchensink/KitchensinkComponent/index.js +0 -45
  442. package/utils/Kitchensink/KitchensinkComponent.d.ts +0 -10
  443. package/utils/Kitchensink/KitchensinkDashboard/index.js +0 -40
  444. package/utils/Kitchensink/KitchensinkDashboard/package.json +0 -6
  445. package/utils/Kitchensink/KitchensinkDashboard.d.ts +0 -5
@@ -12,6 +12,12 @@ Object.defineProperty(exports, "AutoCompleteAssistiveHint", {
12
12
  return _AutoCompleteAssistiveHint["default"];
13
13
  }
14
14
  });
15
+ Object.defineProperty(exports, "AutoCompleteContainer", {
16
+ enumerable: true,
17
+ get: function get() {
18
+ return _AutoCompleteContainer["default"];
19
+ }
20
+ });
15
21
  Object.defineProperty(exports, "AutoCompleteInput", {
16
22
  enumerable: true,
17
23
  get: function get() {
@@ -24,22 +30,28 @@ Object.defineProperty(exports, "AutoCompleteInputTypeahead", {
24
30
  return _AutoCompleteInputTypeahead["default"];
25
31
  }
26
32
  });
27
- Object.defineProperty(exports, "AutoCompleteResultList", {
33
+ Object.defineProperty(exports, "AutoCompleteMultipleInput", {
28
34
  enumerable: true,
29
35
  get: function get() {
30
- return _AutoCompleteResultList["default"];
36
+ return _AutoCompleteMultipleInput["default"];
31
37
  }
32
38
  });
33
- Object.defineProperty(exports, "AutoCompleteResultListItem", {
39
+ Object.defineProperty(exports, "AutoCompleteMultipleInputContainer", {
34
40
  enumerable: true,
35
41
  get: function get() {
36
- return _AutoCompleteResultListItem["default"];
42
+ return _AutoCompleteMultipleInputContainer["default"];
37
43
  }
38
44
  });
39
- Object.defineProperty(exports, "AutoCompleteWrapper", {
45
+ Object.defineProperty(exports, "AutoCompleteResultList", {
46
+ enumerable: true,
47
+ get: function get() {
48
+ return _AutoCompleteResultList["default"];
49
+ }
50
+ });
51
+ Object.defineProperty(exports, "AutoCompleteResultListItem", {
40
52
  enumerable: true,
41
53
  get: function get() {
42
- return _AutoCompleteWrapper["default"];
54
+ return _AutoCompleteResultListItem["default"];
43
55
  }
44
56
  });
45
57
  exports["default"] = void 0;
@@ -56,14 +68,28 @@ var _AutoCompleteInput = _interopRequireDefault(require("@digigov/react-core/cjs
56
68
  var _AutoCompleteInputTypeahead = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteInputTypeahead"));
57
69
  var _AutoCompleteResultList = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteResultList"));
58
70
  var _AutoCompleteResultListItem = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteResultListItem"));
59
- var _AutoCompleteWrapper = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteWrapper"));
71
+ var _AutoCompleteContainer = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteContainer"));
72
+ var _AutoCompleteMultipleInputContainer = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteMultipleInputContainer"));
73
+ var _AutoCompleteMultipleInput = _interopRequireDefault(require("@digigov/react-core/cjs/AutoCompleteMultipleInput"));
60
74
  var _CaretIcon = require("@digigov/react-icons/cjs/CaretIcon");
61
75
  var _Status = _interopRequireDefault(require("@digigov/ui/form/AutoComplete/Status"));
62
76
  var _utils = require("@digigov/ui/form/AutoComplete/utils");
77
+ var _Checkbox = _interopRequireWildcard(require("../Checkbox"));
78
+ var _Chip = require("@digigov/ui/content/Chip");
79
+ var _Button = _interopRequireDefault(require("@digigov/ui/form/Button"));
80
+ var _NormalText = require("@digigov/ui/typography/NormalText");
63
81
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
64
82
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
65
83
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
66
84
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
85
+ var _ref2 = /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, {
86
+ direction: "down",
87
+ size: "md"
88
+ });
89
+ var _ref3 = /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, {
90
+ direction: "down",
91
+ size: "md"
92
+ });
67
93
  var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/function (_Component) {
68
94
  (0, _inherits2["default"])(AutoComplete, _Component);
69
95
  function AutoComplete(props) {
@@ -71,33 +97,41 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
71
97
  (0, _classCallCheck2["default"])(this, AutoComplete);
72
98
  _this = _callSuper(this, AutoComplete, [props]);
73
99
  _this.elementReferences = {};
74
- _this.$pollInput = void 0;
75
- _this.state = {
100
+ var customState = {};
101
+ if (Array.isArray(props.defaultValue)) {
102
+ customState.selectedValues = props.defaultValue;
103
+ } else if (props.defaultValue) {
104
+ customState.selectedValues = [props.defaultValue];
105
+ }
106
+ _this.state = (0, _extends2["default"])({
76
107
  focused: null,
77
108
  hovered: null,
78
109
  menuOpen: false,
79
- options: props.defaultValue ? [props.defaultValue] : [],
80
- query: props.defaultValue,
110
+ options: [],
111
+ query: _this.props.multiple ? '' : props.defaultValue || '',
112
+ selectedValues: [],
81
113
  validChoiceMade: false,
82
114
  selected: null,
83
115
  ariaHint: true
84
- };
116
+ }, customState);
85
117
  _this.handleComponentBlur = _this.handleComponentBlur.bind((0, _assertThisInitialized2["default"])(_this));
118
+ _this.handleAutoCompleteBlur = _this.handleAutoCompleteBlur.bind((0, _assertThisInitialized2["default"])(_this));
86
119
  _this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2["default"])(_this));
87
120
  _this.handleUpArrow = _this.handleUpArrow.bind((0, _assertThisInitialized2["default"])(_this));
88
121
  _this.handleDownArrow = _this.handleDownArrow.bind((0, _assertThisInitialized2["default"])(_this));
89
122
  _this.handleEnter = _this.handleEnter.bind((0, _assertThisInitialized2["default"])(_this));
90
123
  _this.handlePrintableKey = _this.handlePrintableKey.bind((0, _assertThisInitialized2["default"])(_this));
91
124
  _this.handleListMouseLeave = _this.handleListMouseLeave.bind((0, _assertThisInitialized2["default"])(_this));
92
- _this.handleOptionBlur = _this.handleOptionBlur.bind((0, _assertThisInitialized2["default"])(_this));
93
- _this.handleOptionClick = _this.handleOptionClick.bind((0, _assertThisInitialized2["default"])(_this));
125
+ if (_this.props.multiple) {
126
+ _this.handleOptionClick = _this.handleOptionClickMultiple.bind((0, _assertThisInitialized2["default"])(_this));
127
+ } else {
128
+ _this.handleOptionClick = _this.handleOptionClick.bind((0, _assertThisInitialized2["default"])(_this));
129
+ }
94
130
  _this.handleOptionFocus = _this.handleOptionFocus.bind((0, _assertThisInitialized2["default"])(_this));
95
131
  _this.handleOptionMouseDown = _this.handleOptionMouseDown.bind((0, _assertThisInitialized2["default"])(_this));
96
132
  _this.handleOptionMouseEnter = _this.handleOptionMouseEnter.bind((0, _assertThisInitialized2["default"])(_this));
97
- _this.handleInputBlur = _this.handleInputBlur.bind((0, _assertThisInitialized2["default"])(_this));
98
133
  _this.handleInputChange = _this.handleInputChange.bind((0, _assertThisInitialized2["default"])(_this));
99
134
  _this.handleInputFocus = _this.handleInputFocus.bind((0, _assertThisInitialized2["default"])(_this));
100
- _this.pollInputElement = _this.pollInputElement.bind((0, _assertThisInitialized2["default"])(_this));
101
135
  _this.getDirectInputChanges = _this.getDirectInputChanges.bind((0, _assertThisInitialized2["default"])(_this));
102
136
  return _this;
103
137
  }
@@ -112,32 +146,14 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
112
146
  }, {
113
147
  key: "componentDidMount",
114
148
  value: function componentDidMount() {
115
- this.pollInputElement();
116
- }
117
- }, {
118
- key: "componentWillUnmount",
119
- value: function componentWillUnmount() {
120
- clearTimeout(this.$pollInput);
121
- }
122
-
123
- // Applications like Dragon NaturallySpeaking will modify the
124
- // `input` field by directly changing its `.value`. These events
125
- // don't trigger our JavaScript event listeners, so we need to poll
126
- // to handle when and if they occur.
127
- }, {
128
- key: "pollInputElement",
129
- value: function pollInputElement() {
130
- var _this3 = this;
131
149
  this.getDirectInputChanges();
132
- this.$pollInput = setTimeout(function () {
133
- _this3.pollInputElement();
134
- }, 100);
135
150
  }
136
151
  }, {
137
152
  key: "getDirectInputChanges",
138
153
  value: function getDirectInputChanges() {
154
+ var _this$state$query;
139
155
  var inputReference = this.elementReferences[-1];
140
- var queryHasChanged = inputReference && inputReference.value !== this.state.query;
156
+ var queryHasChanged = inputReference && inputReference.value !== ((_this$state$query = this.state.query) !== null && _this$state$query !== void 0 ? _this$state$query : '');
141
157
  if (queryHasChanged) {
142
158
  this.handleInputChange({
143
159
  target: {
@@ -183,7 +199,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
183
199
  key: "templateSuggestion",
184
200
  value: function templateSuggestion(value) {
185
201
  var suggestionTemplate = this.props.templates && this.props.templates.suggestion;
186
- return suggestionTemplate ? suggestionTemplate(value) : value;
202
+ return suggestionTemplate ? suggestionTemplate(value, this.state.query) : value;
187
203
  }
188
204
  }, {
189
205
  key: "handleComponentBlur",
@@ -195,14 +211,14 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
195
211
  var newQuery;
196
212
  if (this.props.confirmOnBlur) {
197
213
  var _this$props$onConfirm, _this$props;
198
- newQuery = newState.query || query;
214
+ newQuery = (newState === null || newState === void 0 ? void 0 : newState.query) || query;
199
215
  (_this$props$onConfirm = (_this$props = this.props).onConfirm) === null || _this$props$onConfirm === void 0 ? void 0 : _this$props$onConfirm.call(_this$props, options[selected]);
200
216
  } else {
201
217
  newQuery = query;
202
218
  }
203
219
  this.setState({
204
220
  focused: null,
205
- menuOpen: newState.menuOpen || false,
221
+ menuOpen: (newState === null || newState === void 0 ? void 0 : newState.menuOpen) || false,
206
222
  query: newQuery,
207
223
  selected: null,
208
224
  validChoiceMade: this.isQueryAnOption(newQuery, options)
@@ -216,40 +232,33 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
216
232
  });
217
233
  }
218
234
  }, {
219
- key: "handleOptionBlur",
220
- value: function handleOptionBlur(event, index) {
235
+ key: "handleAutoCompleteBlur",
236
+ value: function handleAutoCompleteBlur(event, index) {
221
237
  var _this$state2 = this.state,
222
238
  focused = _this$state2.focused,
223
- menuOpen = _this$state2.menuOpen,
224
239
  options = _this$state2.options,
240
+ query = _this$state2.query,
225
241
  selected = _this$state2.selected;
226
- var focusingOutsideComponent = event.relatedTarget === null;
242
+ var focusingOutsideComponent = false;
243
+ if (event.relatedTarget === null) {
244
+ focusingOutsideComponent = true;
245
+ } else {
246
+ // This affects if we have multiple autocompletes in same page and we click the first button-arrow and then another button-arrow
247
+ focusingOutsideComponent = this.elementReferences['button-arrow'] !== event.relatedTarget;
248
+ }
227
249
  var focusingInput = event.relatedTarget === this.elementReferences[-1];
228
- var focusingAnotherOption = focused !== index && focused !== -1;
229
- var blurComponent = !focusingAnotherOption && focusingOutsideComponent || !(focusingAnotherOption || focusingInput);
230
- if (blurComponent) {
231
- var keepMenuOpen = menuOpen && (0, _utils.isIosDevice)();
232
- this.handleComponentBlur({
233
- menuOpen: keepMenuOpen,
234
- query: this.templateInputValue(options[selected])
235
- });
250
+ var focusingButtonArrow = this.elementReferences['button-arrow'] === event.relatedTarget || false;
251
+ var focusingAnotherOption = focused !== null && focused !== -1;
252
+ if (index !== undefined) {
253
+ focusingAnotherOption = focused !== index && focused !== -1;
236
254
  }
237
- }
238
- }, {
239
- key: "handleInputBlur",
240
- value: function handleInputBlur() {
241
- var _this$state3 = this.state,
242
- focused = _this$state3.focused,
243
- menuOpen = _this$state3.menuOpen,
244
- options = _this$state3.options,
245
- query = _this$state3.query,
246
- selected = _this$state3.selected;
247
- var focusingAnOption = focused !== -1;
248
- if (!focusingAnOption) {
249
- var keepMenuOpen = menuOpen && (0, _utils.isIosDevice)();
255
+ // Check if the user clicks outside and not either on option, either on input or on button arrow
256
+ var blurComponent = focusingOutsideComponent && !(focusingAnotherOption || focusingInput || focusingButtonArrow);
257
+ if (blurComponent) {
258
+ // In handleInputBlur:
250
259
  var newQuery = (0, _utils.isIosDevice)() ? query : this.templateInputValue(options[selected]);
251
260
  this.handleComponentBlur({
252
- menuOpen: keepMenuOpen,
261
+ menuOpen: false,
253
262
  query: newQuery
254
263
  });
255
264
  }
@@ -257,37 +266,27 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
257
266
  }, {
258
267
  key: "handleInputChange",
259
268
  value: function handleInputChange(event) {
260
- var _this4 = this;
269
+ var _this3 = this;
261
270
  var _this$props2 = this.props,
262
- minLength = _this$props2.minLength,
263
271
  source = _this$props2.source,
264
- showAllValues = _this$props2.showAllValues;
272
+ minLength = _this$props2.minLength;
265
273
  var autoselect = this.hasAutoselect();
266
274
  var query = event.target.value;
267
275
  var queryEmpty = query.length === 0;
268
- var queryChanged = this.state.query.length !== query.length;
269
- var queryLongEnough = query.length >= minLength;
270
276
  this.setState({
271
277
  query: query,
272
278
  ariaHint: queryEmpty
273
279
  });
274
- var searchForOptions = showAllValues || !queryEmpty && queryChanged && queryLongEnough;
275
- if (searchForOptions) {
276
- source(query, function (options) {
277
- var optionsAvailable = options.length > 0;
278
- _this4.setState({
279
- menuOpen: optionsAvailable,
280
- options: options,
281
- selected: autoselect && optionsAvailable ? 0 : -1,
282
- validChoiceMade: false
283
- });
284
- });
285
- } else if (queryEmpty || !queryLongEnough) {
286
- this.setState({
287
- menuOpen: false,
288
- options: []
280
+ var minLengthQuery = minLength != undefined && minLength > query.length ? '' : query;
281
+ source(minLengthQuery, function (options) {
282
+ var optionsAvailable = options.length > 0;
283
+ _this3.setState({
284
+ menuOpen: optionsAvailable,
285
+ options: options,
286
+ selected: autoselect && optionsAvailable ? 0 : -1,
287
+ validChoiceMade: false
289
288
  });
290
- }
289
+ });
291
290
  }
292
291
  }, {
293
292
  key: "handleInputClick",
@@ -297,10 +296,12 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
297
296
  }, {
298
297
  key: "handleInputFocus",
299
298
  value: function handleInputFocus() {
300
- var _this$state4 = this.state,
301
- query = _this$state4.query,
302
- validChoiceMade = _this$state4.validChoiceMade,
303
- options = _this$state4.options;
299
+ var _this4 = this;
300
+ var source = this.props.source;
301
+ var _this$state3 = this.state,
302
+ query = _this$state3.query,
303
+ validChoiceMade = _this$state3.validChoiceMade,
304
+ options = _this$state3.options;
304
305
  var minLength = this.props.minLength;
305
306
  var shouldReopenMenu = !validChoiceMade && query.length >= minLength && options.length > 0;
306
307
  if (shouldReopenMenu) {
@@ -313,8 +314,11 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
313
314
  };
314
315
  });
315
316
  } else {
316
- this.setState({
317
- focused: -1
317
+ source(query, function (options) {
318
+ _this4.setState({
319
+ focused: -1,
320
+ options: options
321
+ });
318
322
  });
319
323
  }
320
324
  }
@@ -338,18 +342,43 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
338
342
  });
339
343
  }
340
344
  }
345
+ }, {
346
+ key: "handleOptionClickMultiple",
347
+ value: function handleOptionClickMultiple(index) {
348
+ var _this$props$onConfirm2, _this$props3;
349
+ var selectedOption = this.state.options[index];
350
+ var selectedValues = this.state.selectedValues;
351
+ if (this.state.selectedValues.indexOf(selectedOption) === -1) {
352
+ selectedValues = selectedValues.concat([selectedOption]);
353
+ } else {
354
+ selectedValues.splice(this.state.selectedValues.indexOf(selectedOption), 1);
355
+ }
356
+ (_this$props$onConfirm2 = (_this$props3 = this.props).onConfirm) === null || _this$props$onConfirm2 === void 0 ? void 0 : _this$props$onConfirm2.call(_this$props3, selectedValues);
357
+ this.setState({
358
+ focused: index,
359
+ hovered: null,
360
+ menuOpen: true,
361
+ query: '',
362
+ selectedValues: selectedValues,
363
+ selected: index,
364
+ validChoiceMade: true
365
+ });
366
+ this.forceUpdate();
367
+ }
341
368
  }, {
342
369
  key: "handleOptionClick",
343
370
  value: function handleOptionClick(index) {
344
- var _this$props$onConfirm2, _this$props3;
371
+ var _this$props$onConfirm3, _this$props4;
345
372
  var selectedOption = this.state.options[index];
346
373
  var newQuery = this.templateInputValue(selectedOption);
347
- (_this$props$onConfirm2 = (_this$props3 = this.props).onConfirm) === null || _this$props$onConfirm2 === void 0 ? void 0 : _this$props$onConfirm2.call(_this$props3, selectedOption);
374
+ (_this$props$onConfirm3 = (_this$props4 = this.props).onConfirm) === null || _this$props$onConfirm3 === void 0 ? void 0 : _this$props$onConfirm3.call(_this$props4, selectedOption);
375
+ var selectedValues = this.props.multiple ? this.state.selectedValues.concat(selectedOption) : [selectedOption];
348
376
  this.setState({
349
377
  focused: -1,
350
378
  hovered: null,
351
379
  menuOpen: false,
352
380
  query: newQuery,
381
+ selectedValues: selectedValues,
353
382
  selected: -1,
354
383
  validChoiceMade: true
355
384
  });
@@ -370,9 +399,9 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
370
399
  key: "handleUpArrow",
371
400
  value: function handleUpArrow(event) {
372
401
  event.preventDefault();
373
- var _this$state5 = this.state,
374
- menuOpen = _this$state5.menuOpen,
375
- selected = _this$state5.selected;
402
+ var _this$state4 = this.state,
403
+ menuOpen = _this$state4.menuOpen,
404
+ selected = _this$state4.selected;
376
405
  var isNotAtTop = selected !== -1;
377
406
  var allowMoveUp = isNotAtTop && menuOpen;
378
407
  if (allowMoveUp) {
@@ -385,7 +414,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
385
414
  var _this5 = this;
386
415
  event.preventDefault();
387
416
  // if not open, open
388
- if (this.props.showAllValues && this.state.menuOpen === false) {
417
+ if (this.state.menuOpen === false) {
389
418
  event.preventDefault();
390
419
  this.props.source('', function (options) {
391
420
  _this5.setState({
@@ -397,10 +426,10 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
397
426
  });
398
427
  });
399
428
  } else if (this.state.menuOpen === true) {
400
- var _this$state6 = this.state,
401
- menuOpen = _this$state6.menuOpen,
402
- _options = _this$state6.options,
403
- selected = _this$state6.selected;
429
+ var _this$state5 = this.state,
430
+ menuOpen = _this$state5.menuOpen,
431
+ _options = _this$state5.options,
432
+ selected = _this$state5.selected;
404
433
  var isNotAtBottom = selected !== _options.length - 1;
405
434
  var allowMoveDown = isNotAtBottom && menuOpen;
406
435
  if (allowMoveDown) {
@@ -413,7 +442,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
413
442
  value: function handleSpace(event) {
414
443
  var _this6 = this;
415
444
  // if not open, open
416
- if (this.props.showAllValues && this.state.menuOpen === false && this.state.query === '') {
445
+ if (this.state.menuOpen === false && this.state.query === '') {
417
446
  event.preventDefault();
418
447
  this.props.source('', function (options) {
419
448
  _this6.setState({
@@ -436,6 +465,12 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
436
465
  var hasSelectedOption = this.state.selected >= 0;
437
466
  if (hasSelectedOption) {
438
467
  this.handleOptionClick(this.state.selected);
468
+ if (this.props.multiple) {
469
+ this.setState({
470
+ menuOpen: false,
471
+ focused: -1
472
+ });
473
+ }
439
474
  }
440
475
  }
441
476
  }
@@ -454,6 +489,7 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
454
489
  }, {
455
490
  key: "handleKeyDown",
456
491
  value: function handleKeyDown(event) {
492
+ var _this7 = this;
457
493
  switch (_utils.keyCodes[event.keyCode]) {
458
494
  case 'up':
459
495
  this.handleUpArrow(event);
@@ -472,6 +508,24 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
472
508
  query: this.state.query
473
509
  });
474
510
  break;
511
+ case 'backspace':
512
+ if (this.props.multiple) {
513
+ if (this.state.query.length === 0 && this.state.selectedValues.length > 0) {
514
+ event.preventDefault();
515
+ var updatedSelectedValues = this.state.selectedValues.slice(0, -1);
516
+ this.setState({
517
+ selectedValues: updatedSelectedValues
518
+ }, function () {
519
+ var _this7$props$onConfir, _this7$props;
520
+ (_this7$props$onConfir = (_this7$props = _this7.props).onConfirm) === null || _this7$props$onConfir === void 0 ? void 0 : _this7$props$onConfir.call(_this7$props, updatedSelectedValues);
521
+ });
522
+ break;
523
+ }
524
+ } else {
525
+ var _this$props$onConfirm4, _this$props5;
526
+ (_this$props$onConfirm4 = (_this$props5 = this.props).onConfirm) === null || _this$props$onConfirm4 === void 0 ? void 0 : _this$props$onConfirm4.call(_this$props5, '');
527
+ break;
528
+ }
475
529
  default:
476
530
  if ((0, _utils.isPrintableKeyCode)(event.keyCode)) {
477
531
  this.handlePrintableKey(event);
@@ -482,40 +536,39 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
482
536
  }, {
483
537
  key: "render",
484
538
  value: function render() {
485
- var _this7 = this;
486
- var _this$props4 = this.props,
487
- id = _this$props4.id,
488
- width = _this$props4.width,
489
- displayMenu = _this$props4.displayMenu,
490
- minLength = _this$props4.minLength,
491
- name = _this$props4.name,
492
- placeholder = _this$props4.placeholder,
493
- required = _this$props4.required,
494
- showAllValues = _this$props4.showAllValues,
495
- tNoResults = _this$props4.tNoResults,
496
- tStatusQueryTooShort = _this$props4.tStatusQueryTooShort,
497
- tStatusNoResults = _this$props4.tStatusNoResults,
498
- tStatusSelectedOption = _this$props4.tStatusSelectedOption,
499
- tStatusResults = _this$props4.tStatusResults,
500
- tAssistiveHint = _this$props4.tAssistiveHint,
501
- DropdownArrow = _this$props4.dropdownArrow;
502
- var _this$state7 = this.state,
503
- focused = _this$state7.focused,
504
- hovered = _this$state7.hovered,
505
- menuOpen = _this$state7.menuOpen,
506
- options = _this$state7.options,
507
- query = _this$state7.query,
508
- selected = _this$state7.selected,
509
- ariaHint = _this$state7.ariaHint,
510
- validChoiceMade = _this$state7.validChoiceMade;
539
+ var _this$state$query2,
540
+ _this8 = this;
541
+ var _this$props6 = this.props,
542
+ id = _this$props6.id,
543
+ width = _this$props6.width,
544
+ minLength = _this$props6.minLength,
545
+ name = _this$props6.name,
546
+ placeholder = _this$props6.placeholder,
547
+ required = _this$props6.required,
548
+ tNoResults = _this$props6.tNoResults,
549
+ tStatusQueryTooShort = _this$props6.tStatusQueryTooShort,
550
+ tStatusNoResults = _this$props6.tStatusNoResults,
551
+ tStatusSelectedOption = _this$props6.tStatusSelectedOption,
552
+ tStatusResults = _this$props6.tStatusResults,
553
+ tAssistiveHint = _this$props6.tAssistiveHint,
554
+ multiple = _this$props6.multiple,
555
+ source = _this$props6.source;
556
+ var _this$state6 = this.state,
557
+ focused = _this$state6.focused,
558
+ hovered = _this$state6.hovered,
559
+ menuOpen = _this$state6.menuOpen,
560
+ options = _this$state6.options,
561
+ selected = _this$state6.selected,
562
+ ariaHint = _this$state6.ariaHint,
563
+ validChoiceMade = _this$state6.validChoiceMade;
511
564
  var autoselect = this.hasAutoselect();
565
+ var query = (_this$state$query2 = this.state.query) !== null && _this$state$query2 !== void 0 ? _this$state$query2 : '';
512
566
  var inputFocused = focused === -1;
513
567
  var noOptionsAvailable = options.length === 0;
514
568
  var queryNotEmpty = query.length !== 0;
515
569
  var queryLongEnough = query.length >= minLength;
516
- var showNoOptionsFound = this.props.showNoOptionsFound && inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;
570
+ var showNoOptionsFound = inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;
517
571
  var componentIsFocused = focused !== null;
518
- var dropdownArrowClassName = "ds-autocomplete__dropdown-arrow-down";
519
572
  var optionFocused = focused !== -1 && focused !== null;
520
573
  var menuIsVisible = menuOpen || showNoOptionsFound;
521
574
  var selectedOptionText = this.templateInputValue(options[selected]);
@@ -525,7 +578,57 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
525
578
  var ariaDescribedProp = ariaHint ? {
526
579
  'aria-describedby': assistiveHintID
527
580
  } : null;
528
- return /*#__PURE__*/_react["default"].createElement(_AutoCompleteWrapper["default"], {
581
+ var showAutoCompleteResultListItems = function showAutoCompleteResultListItems(options, multiple) {
582
+ {
583
+ return options.map(function (option, index) {
584
+ var showFocused = focused === -1 ? selected === index : focused === index;
585
+ var iosPosinsetHtml = (0, _utils.isIosDevice)() ? /*#__PURE__*/_react["default"].createElement("span", {
586
+ id: "".concat(id, "__option-suffix--").concat(index),
587
+ style: {
588
+ border: '0',
589
+ clip: 'rect(0 0 0 0)',
590
+ height: '1px',
591
+ marginBottom: '-1px',
592
+ marginRight: '-1px',
593
+ overflow: 'hidden',
594
+ padding: '0',
595
+ position: 'absolute',
596
+ whiteSpace: 'nowrap',
597
+ width: '1px'
598
+ }
599
+ }, index + 1, " \u03B1\u03C0\u03CC ", options.length) : '';
600
+ return /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
601
+ isFocused: showFocused,
602
+ isHovered: hovered,
603
+ index: index,
604
+ "aria-selected": focused === index ? 'true' : 'false',
605
+ key: index,
606
+ onBlur: function onBlur(event) {
607
+ return _this8.handleAutoCompleteBlur(event, index);
608
+ },
609
+ onClick: function onClick() {
610
+ return _this8.handleOptionClick(index);
611
+ },
612
+ onMouseDown: _this8.handleOptionMouseDown,
613
+ onMouseEnter: function onMouseEnter() {
614
+ return _this8.handleOptionMouseEnter(index);
615
+ },
616
+ ref: function ref(optionEl) {
617
+ _this8.elementReferences[index] = optionEl;
618
+ },
619
+ role: "option",
620
+ tabIndex: -1,
621
+ "aria-posinset": index + 1,
622
+ "aria-setsize": options.length
623
+ }, multiple ? /*#__PURE__*/_react["default"].createElement(_Checkbox.CheckboxItem, {
624
+ value: option,
625
+ checked: _this8.state.selectedValues.includes(option),
626
+ onChange: function onChange() {}
627
+ }, _this8.templateSuggestion(option)) : _this8.templateSuggestion(option), iosPosinsetHtml);
628
+ });
629
+ }
630
+ };
631
+ return /*#__PURE__*/_react["default"].createElement(_AutoCompleteContainer["default"], {
529
632
  onKeyDown: this.handleKeyDown,
530
633
  width: width
531
634
  }, /*#__PURE__*/_react["default"].createElement(_Status["default"], {
@@ -541,106 +644,139 @@ var AutoComplete = exports.AutoComplete = exports["default"] = /*#__PURE__*/func
541
644
  tNoResults: tStatusNoResults,
542
645
  tSelectedOption: tStatusSelectedOption,
543
646
  tResults: tStatusResults
544
- }), hintValue && /*#__PURE__*/_react["default"].createElement(_AutoCompleteInputTypeahead["default"], {
647
+ }), hintValue && (placeholder === '' || !placeholder) && /*#__PURE__*/_react["default"].createElement(_AutoCompleteInputTypeahead["default"], {
545
648
  value: hintValue
546
- }), /*#__PURE__*/_react["default"].createElement(_AutoCompleteInput["default"], (0, _extends2["default"])({
649
+ }), multiple ? /*#__PURE__*/_react["default"].createElement(_AutoCompleteMultipleInputContainer["default"], {
650
+ isFocused: componentIsFocused,
651
+ numberOfSelected: this.props.numberOfSelected
652
+ }, /*#__PURE__*/_react["default"].createElement(_Chip.ChipContainer, null, this.state.selectedValues.map(function (value, index) {
653
+ return /*#__PURE__*/_react["default"].createElement(_Chip.Chip, {
654
+ key: index,
655
+ onDelete: function onDelete() {
656
+ _this8.setState(function (prevState) {
657
+ return {
658
+ selectedValues: prevState.selectedValues.filter(function (v) {
659
+ if (typeof v === "string") {
660
+ return v !== value;
661
+ } else {
662
+ return v.value !== value.value;
663
+ }
664
+ })
665
+ };
666
+ }, function () {
667
+ var _this8$props$onConfir, _this8$props;
668
+ (_this8$props$onConfir = (_this8$props = _this8.props).onConfirm) === null || _this8$props$onConfir === void 0 ? void 0 : _this8$props$onConfir.call(_this8$props, _this8.state.selectedValues);
669
+ });
670
+ }
671
+ }, typeof value === "string" ? value : value.label.primary);
672
+ }), !componentIsFocused && typeof this.props.numberOfSelected === 'number' && this.state.selectedValues.length > this.props.numberOfSelected && /*#__PURE__*/_react["default"].createElement(_NormalText.NormalText, {
673
+ fontWeight: "bold",
674
+ margin: 0
675
+ }, "+", this.state.selectedValues.length - this.props.numberOfSelected)), /*#__PURE__*/_react["default"].createElement(_AutoCompleteMultipleInput["default"], (0, _extends2["default"])({
547
676
  "aria-expanded": menuOpen ? 'true' : 'false',
548
677
  "aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
549
678
  "aria-owns": "".concat(id, "__listbox"),
550
679
  "aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
551
680
  }, ariaDescribedProp, {
552
- autoComplete: "off",
553
- isFocused: componentIsFocused,
554
- showAllValues: this.props.showAllValues,
681
+ autoComplete: "off"
682
+ // isFocused={componentIsFocused}
683
+ ,
555
684
  id: id,
556
685
  onClick: function onClick(event) {
557
- return _this7.handleInputClick(event);
686
+ return _this8.handleInputClick(event);
687
+ },
688
+ onBlur: function onBlur(event) {
689
+ return _this8.handleAutoCompleteBlur(event);
558
690
  },
559
- onBlur: this.handleInputBlur,
560
691
  onChange: this.handleInputChange,
561
692
  onFocus: this.handleInputFocus,
562
693
  name: name,
563
694
  placeholder: placeholder,
564
695
  ref: function ref(inputElement) {
565
- _this7.elementReferences[-1] = inputElement;
696
+ _this8.elementReferences[-1] = inputElement;
566
697
  },
567
698
  role: "combobox",
568
699
  required: required,
569
700
  value: query
570
- })), showNoOptionsFound || showAllValues && !menuOpen && DropdownArrow && /*#__PURE__*/_react["default"].createElement(DropdownArrow, {
571
- type: "button",
701
+ })), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
702
+ ref: function ref(buttonElement) {
703
+ _this8.elementReferences['button-arrow'] = buttonElement;
704
+ },
705
+ variant: "link",
572
706
  onClick: function onClick() {
573
- _this7.elementReferences[-1].focus();
574
- _this7.handleInputChange({
575
- target: {
576
- value: query
577
- }
578
- });
707
+ if (!_this8.state.menuOpen) {
708
+ source(query, function (options) {
709
+ var optionsAvailable = options.length > 0;
710
+ _this8.setState({
711
+ menuOpen: optionsAvailable,
712
+ options: options,
713
+ selected: autoselect && optionsAvailable ? 0 : -1,
714
+ validChoiceMade: false
715
+ });
716
+ });
717
+ } else {
718
+ _this8.setState({
719
+ menuOpen: false,
720
+ focused: null
721
+ });
722
+ }
723
+ },
724
+ onBlur: function onBlur(event) {
725
+ return _this8.handleAutoCompleteBlur(event);
726
+ }
727
+ }, _ref2), /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultList["default"], {
728
+ isVisible: menuIsVisible,
729
+ onMouseLeave: function onMouseLeave() {
730
+ return _this8.handleListMouseLeave();
731
+ },
732
+ id: "".concat(id, "__listbox"),
733
+ role: "listbox"
734
+ }, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], null, showAutoCompleteResultListItems(options, multiple)), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
735
+ empty: true
736
+ }, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/_react["default"].createElement(_AutoCompleteAssistiveHint["default"], {
737
+ id: assistiveHintID
738
+ }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_AutoCompleteInput["default"], (0, _extends2["default"])({
739
+ "aria-expanded": menuOpen ? 'true' : 'false',
740
+ "aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
741
+ "aria-owns": "".concat(id, "__listbox"),
742
+ "aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
743
+ }, ariaDescribedProp, {
744
+ autoComplete: "off",
745
+ isFocused: componentIsFocused,
746
+ id: id,
747
+ onClick: function onClick(event) {
748
+ return _this8.handleInputClick(event);
579
749
  },
580
- className: dropdownArrowClassName
581
- }), /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultList["default"], {
582
- displayMenu: displayMenu,
750
+ onBlur: this.handleAutoCompleteBlur,
751
+ onChange: this.handleInputChange,
752
+ onFocus: this.handleInputFocus,
753
+ name: name,
754
+ placeholder: placeholder,
755
+ ref: function ref(inputElement) {
756
+ _this8.elementReferences[-1] = inputElement;
757
+ },
758
+ role: "combobox",
759
+ required: required,
760
+ value: query
761
+ })), _ref3, /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultList["default"], {
583
762
  isVisible: menuIsVisible,
584
763
  onMouseLeave: function onMouseLeave() {
585
- return _this7.handleListMouseLeave();
764
+ return _this8.handleListMouseLeave();
586
765
  },
587
766
  id: "".concat(id, "__listbox"),
588
767
  role: "listbox"
589
- }, options.map(function (option, index) {
590
- var showFocused = focused === -1 ? selected === index : focused === index;
591
- var iosPosinsetHtml = (0, _utils.isIosDevice)() ? /*#__PURE__*/_react["default"].createElement("span", {
592
- id: "".concat(id, "__option-suffix--").concat(index),
593
- style: {
594
- border: '0',
595
- clip: 'rect(0 0 0 0)',
596
- height: '1px',
597
- marginBottom: '-1px',
598
- marginRight: '-1px',
599
- overflow: 'hidden',
600
- padding: '0',
601
- position: 'absolute',
602
- whiteSpace: 'nowrap',
603
- width: '1px'
604
- }
605
- }, index + 1, " \u03B1\u03C0\u03CC ", options.length) : '';
606
- return /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
607
- isFocused: showFocused,
608
- isHovered: hovered,
609
- index: index,
610
- "aria-selected": focused === index ? 'true' : 'false',
611
- key: index,
612
- onBlur: function onBlur(event) {
613
- return _this7.handleOptionBlur(event, index);
614
- },
615
- onClick: function onClick() {
616
- return _this7.handleOptionClick(index);
617
- },
618
- onMouseDown: _this7.handleOptionMouseDown,
619
- onMouseEnter: function onMouseEnter() {
620
- return _this7.handleOptionMouseEnter(index);
621
- },
622
- ref: function ref(optionEl) {
623
- _this7.elementReferences[index] = optionEl;
624
- },
625
- role: "option",
626
- tabIndex: -1,
627
- "aria-posinset": index + 1,
628
- "aria-setsize": options.length
629
- }, _this7.templateSuggestion(option), " ", iosPosinsetHtml);
630
- }), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
768
+ }, showAutoCompleteResultListItems(options, false), showNoOptionsFound && /*#__PURE__*/_react["default"].createElement(_AutoCompleteResultListItem["default"], {
631
769
  empty: true
632
770
  }, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/_react["default"].createElement(_AutoCompleteAssistiveHint["default"], {
633
771
  id: assistiveHintID
634
- }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint()));
772
+ }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())));
635
773
  }
636
774
  }]);
637
775
  return AutoComplete;
638
776
  }(_react.Component);
639
777
  AutoComplete.defaultProps = {
640
- width: '33.3%',
778
+ width: 'full',
641
779
  autoselect: false,
642
- defaultValue: '',
643
- displayMenu: 'overlay',
644
780
  minLength: 0,
645
781
  name: 'ds-input-autocomplete',
646
782
  placeholder: '',
@@ -648,19 +784,11 @@ AutoComplete.defaultProps = {
648
784
  return;
649
785
  },
650
786
  confirmOnBlur: false,
651
- showNoOptionsFound: true,
652
- showAllValues: false,
653
787
  required: false,
654
788
  tNoResults: function tNoResults() {
655
789
  return 'No results found';
656
790
  },
657
791
  tAssistiveHint: function tAssistiveHint() {
658
792
  return 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.';
659
- },
660
- dropdownArrow: function dropdownArrow(props) {
661
- return /*#__PURE__*/_react["default"].createElement(_CaretIcon.CaretIcon, (0, _extends2["default"])({
662
- direction: "down",
663
- size: "sm"
664
- }, props));
665
793
  }
666
794
  };