@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
@@ -14,10 +14,24 @@ import AutoCompleteInput from '@digigov/react-core/AutoCompleteInput';
14
14
  import AutoCompleteInputTypeahead from '@digigov/react-core/AutoCompleteInputTypeahead';
15
15
  import AutoCompleteResultList from '@digigov/react-core/AutoCompleteResultList';
16
16
  import AutoCompleteResultListItem from '@digigov/react-core/AutoCompleteResultListItem';
17
- import AutoCompleteWrapper from '@digigov/react-core/AutoCompleteWrapper';
17
+ import AutoCompleteContainer from '@digigov/react-core/AutoCompleteContainer';
18
+ import AutoCompleteMultipleInputContainer from '@digigov/react-core/AutoCompleteMultipleInputContainer';
19
+ import AutoCompleteMultipleInput from '@digigov/react-core/AutoCompleteMultipleInput';
18
20
  import { CaretIcon } from '@digigov/react-icons/CaretIcon';
19
21
  import Status from '@digigov/ui/form/AutoComplete/Status';
20
22
  import { isIosDevice, keyCodes, isPrintableKeyCode } from '@digigov/ui/form/AutoComplete/utils';
23
+ import Checkbox, { CheckboxItem } from "../Checkbox";
24
+ import { Chip, ChipContainer } from '@digigov/ui/content/Chip';
25
+ import Button from '@digigov/ui/form/Button';
26
+ import { NormalText } from '@digigov/ui/typography/NormalText';
27
+ var _ref2 = /*#__PURE__*/React.createElement(CaretIcon, {
28
+ direction: "down",
29
+ size: "md"
30
+ });
31
+ var _ref3 = /*#__PURE__*/React.createElement(CaretIcon, {
32
+ direction: "down",
33
+ size: "md"
34
+ });
21
35
  var AutoComplete = /*#__PURE__*/function (_Component) {
22
36
  _inherits(AutoComplete, _Component);
23
37
  function AutoComplete(props) {
@@ -25,33 +39,41 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
25
39
  _classCallCheck(this, AutoComplete);
26
40
  _this = _callSuper(this, AutoComplete, [props]);
27
41
  _this.elementReferences = {};
28
- _this.$pollInput = void 0;
29
- _this.state = {
42
+ var customState = {};
43
+ if (Array.isArray(props.defaultValue)) {
44
+ customState.selectedValues = props.defaultValue;
45
+ } else if (props.defaultValue) {
46
+ customState.selectedValues = [props.defaultValue];
47
+ }
48
+ _this.state = _extends({
30
49
  focused: null,
31
50
  hovered: null,
32
51
  menuOpen: false,
33
- options: props.defaultValue ? [props.defaultValue] : [],
34
- query: props.defaultValue,
52
+ options: [],
53
+ query: _this.props.multiple ? '' : props.defaultValue || '',
54
+ selectedValues: [],
35
55
  validChoiceMade: false,
36
56
  selected: null,
37
57
  ariaHint: true
38
- };
58
+ }, customState);
39
59
  _this.handleComponentBlur = _this.handleComponentBlur.bind(_assertThisInitialized(_this));
60
+ _this.handleAutoCompleteBlur = _this.handleAutoCompleteBlur.bind(_assertThisInitialized(_this));
40
61
  _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
41
62
  _this.handleUpArrow = _this.handleUpArrow.bind(_assertThisInitialized(_this));
42
63
  _this.handleDownArrow = _this.handleDownArrow.bind(_assertThisInitialized(_this));
43
64
  _this.handleEnter = _this.handleEnter.bind(_assertThisInitialized(_this));
44
65
  _this.handlePrintableKey = _this.handlePrintableKey.bind(_assertThisInitialized(_this));
45
66
  _this.handleListMouseLeave = _this.handleListMouseLeave.bind(_assertThisInitialized(_this));
46
- _this.handleOptionBlur = _this.handleOptionBlur.bind(_assertThisInitialized(_this));
47
- _this.handleOptionClick = _this.handleOptionClick.bind(_assertThisInitialized(_this));
67
+ if (_this.props.multiple) {
68
+ _this.handleOptionClick = _this.handleOptionClickMultiple.bind(_assertThisInitialized(_this));
69
+ } else {
70
+ _this.handleOptionClick = _this.handleOptionClick.bind(_assertThisInitialized(_this));
71
+ }
48
72
  _this.handleOptionFocus = _this.handleOptionFocus.bind(_assertThisInitialized(_this));
49
73
  _this.handleOptionMouseDown = _this.handleOptionMouseDown.bind(_assertThisInitialized(_this));
50
74
  _this.handleOptionMouseEnter = _this.handleOptionMouseEnter.bind(_assertThisInitialized(_this));
51
- _this.handleInputBlur = _this.handleInputBlur.bind(_assertThisInitialized(_this));
52
75
  _this.handleInputChange = _this.handleInputChange.bind(_assertThisInitialized(_this));
53
76
  _this.handleInputFocus = _this.handleInputFocus.bind(_assertThisInitialized(_this));
54
- _this.pollInputElement = _this.pollInputElement.bind(_assertThisInitialized(_this));
55
77
  _this.getDirectInputChanges = _this.getDirectInputChanges.bind(_assertThisInitialized(_this));
56
78
  return _this;
57
79
  }
@@ -66,32 +88,14 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
66
88
  }, {
67
89
  key: "componentDidMount",
68
90
  value: function componentDidMount() {
69
- this.pollInputElement();
70
- }
71
- }, {
72
- key: "componentWillUnmount",
73
- value: function componentWillUnmount() {
74
- clearTimeout(this.$pollInput);
75
- }
76
-
77
- // Applications like Dragon NaturallySpeaking will modify the
78
- // `input` field by directly changing its `.value`. These events
79
- // don't trigger our JavaScript event listeners, so we need to poll
80
- // to handle when and if they occur.
81
- }, {
82
- key: "pollInputElement",
83
- value: function pollInputElement() {
84
- var _this3 = this;
85
91
  this.getDirectInputChanges();
86
- this.$pollInput = setTimeout(function () {
87
- _this3.pollInputElement();
88
- }, 100);
89
92
  }
90
93
  }, {
91
94
  key: "getDirectInputChanges",
92
95
  value: function getDirectInputChanges() {
96
+ var _this$state$query;
93
97
  var inputReference = this.elementReferences[-1];
94
- var queryHasChanged = inputReference && inputReference.value !== this.state.query;
98
+ var queryHasChanged = inputReference && inputReference.value !== ((_this$state$query = this.state.query) !== null && _this$state$query !== void 0 ? _this$state$query : '');
95
99
  if (queryHasChanged) {
96
100
  this.handleInputChange({
97
101
  target: {
@@ -137,7 +141,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
137
141
  key: "templateSuggestion",
138
142
  value: function templateSuggestion(value) {
139
143
  var suggestionTemplate = this.props.templates && this.props.templates.suggestion;
140
- return suggestionTemplate ? suggestionTemplate(value) : value;
144
+ return suggestionTemplate ? suggestionTemplate(value, this.state.query) : value;
141
145
  }
142
146
  }, {
143
147
  key: "handleComponentBlur",
@@ -149,14 +153,14 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
149
153
  var newQuery;
150
154
  if (this.props.confirmOnBlur) {
151
155
  var _this$props$onConfirm, _this$props;
152
- newQuery = newState.query || query;
156
+ newQuery = (newState === null || newState === void 0 ? void 0 : newState.query) || query;
153
157
  (_this$props$onConfirm = (_this$props = this.props).onConfirm) === null || _this$props$onConfirm === void 0 ? void 0 : _this$props$onConfirm.call(_this$props, options[selected]);
154
158
  } else {
155
159
  newQuery = query;
156
160
  }
157
161
  this.setState({
158
162
  focused: null,
159
- menuOpen: newState.menuOpen || false,
163
+ menuOpen: (newState === null || newState === void 0 ? void 0 : newState.menuOpen) || false,
160
164
  query: newQuery,
161
165
  selected: null,
162
166
  validChoiceMade: this.isQueryAnOption(newQuery, options)
@@ -170,40 +174,33 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
170
174
  });
171
175
  }
172
176
  }, {
173
- key: "handleOptionBlur",
174
- value: function handleOptionBlur(event, index) {
177
+ key: "handleAutoCompleteBlur",
178
+ value: function handleAutoCompleteBlur(event, index) {
175
179
  var _this$state2 = this.state,
176
180
  focused = _this$state2.focused,
177
- menuOpen = _this$state2.menuOpen,
178
181
  options = _this$state2.options,
182
+ query = _this$state2.query,
179
183
  selected = _this$state2.selected;
180
- var focusingOutsideComponent = event.relatedTarget === null;
184
+ var focusingOutsideComponent = false;
185
+ if (event.relatedTarget === null) {
186
+ focusingOutsideComponent = true;
187
+ } else {
188
+ // This affects if we have multiple autocompletes in same page and we click the first button-arrow and then another button-arrow
189
+ focusingOutsideComponent = this.elementReferences['button-arrow'] !== event.relatedTarget;
190
+ }
181
191
  var focusingInput = event.relatedTarget === this.elementReferences[-1];
182
- var focusingAnotherOption = focused !== index && focused !== -1;
183
- var blurComponent = !focusingAnotherOption && focusingOutsideComponent || !(focusingAnotherOption || focusingInput);
184
- if (blurComponent) {
185
- var keepMenuOpen = menuOpen && isIosDevice();
186
- this.handleComponentBlur({
187
- menuOpen: keepMenuOpen,
188
- query: this.templateInputValue(options[selected])
189
- });
192
+ var focusingButtonArrow = this.elementReferences['button-arrow'] === event.relatedTarget || false;
193
+ var focusingAnotherOption = focused !== null && focused !== -1;
194
+ if (index !== undefined) {
195
+ focusingAnotherOption = focused !== index && focused !== -1;
190
196
  }
191
- }
192
- }, {
193
- key: "handleInputBlur",
194
- value: function handleInputBlur() {
195
- var _this$state3 = this.state,
196
- focused = _this$state3.focused,
197
- menuOpen = _this$state3.menuOpen,
198
- options = _this$state3.options,
199
- query = _this$state3.query,
200
- selected = _this$state3.selected;
201
- var focusingAnOption = focused !== -1;
202
- if (!focusingAnOption) {
203
- var keepMenuOpen = menuOpen && isIosDevice();
197
+ // Check if the user clicks outside and not either on option, either on input or on button arrow
198
+ var blurComponent = focusingOutsideComponent && !(focusingAnotherOption || focusingInput || focusingButtonArrow);
199
+ if (blurComponent) {
200
+ // In handleInputBlur:
204
201
  var newQuery = isIosDevice() ? query : this.templateInputValue(options[selected]);
205
202
  this.handleComponentBlur({
206
- menuOpen: keepMenuOpen,
203
+ menuOpen: false,
207
204
  query: newQuery
208
205
  });
209
206
  }
@@ -211,37 +208,27 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
211
208
  }, {
212
209
  key: "handleInputChange",
213
210
  value: function handleInputChange(event) {
214
- var _this4 = this;
211
+ var _this3 = this;
215
212
  var _this$props2 = this.props,
216
- minLength = _this$props2.minLength,
217
213
  source = _this$props2.source,
218
- showAllValues = _this$props2.showAllValues;
214
+ minLength = _this$props2.minLength;
219
215
  var autoselect = this.hasAutoselect();
220
216
  var query = event.target.value;
221
217
  var queryEmpty = query.length === 0;
222
- var queryChanged = this.state.query.length !== query.length;
223
- var queryLongEnough = query.length >= minLength;
224
218
  this.setState({
225
219
  query: query,
226
220
  ariaHint: queryEmpty
227
221
  });
228
- var searchForOptions = showAllValues || !queryEmpty && queryChanged && queryLongEnough;
229
- if (searchForOptions) {
230
- source(query, function (options) {
231
- var optionsAvailable = options.length > 0;
232
- _this4.setState({
233
- menuOpen: optionsAvailable,
234
- options: options,
235
- selected: autoselect && optionsAvailable ? 0 : -1,
236
- validChoiceMade: false
237
- });
222
+ var minLengthQuery = minLength != undefined && minLength > query.length ? '' : query;
223
+ source(minLengthQuery, function (options) {
224
+ var optionsAvailable = options.length > 0;
225
+ _this3.setState({
226
+ menuOpen: optionsAvailable,
227
+ options: options,
228
+ selected: autoselect && optionsAvailable ? 0 : -1,
229
+ validChoiceMade: false
238
230
  });
239
- } else if (queryEmpty || !queryLongEnough) {
240
- this.setState({
241
- menuOpen: false,
242
- options: []
243
- });
244
- }
231
+ });
245
232
  }
246
233
  }, {
247
234
  key: "handleInputClick",
@@ -251,10 +238,12 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
251
238
  }, {
252
239
  key: "handleInputFocus",
253
240
  value: function handleInputFocus() {
254
- var _this$state4 = this.state,
255
- query = _this$state4.query,
256
- validChoiceMade = _this$state4.validChoiceMade,
257
- options = _this$state4.options;
241
+ var _this4 = this;
242
+ var source = this.props.source;
243
+ var _this$state3 = this.state,
244
+ query = _this$state3.query,
245
+ validChoiceMade = _this$state3.validChoiceMade,
246
+ options = _this$state3.options;
258
247
  var minLength = this.props.minLength;
259
248
  var shouldReopenMenu = !validChoiceMade && query.length >= minLength && options.length > 0;
260
249
  if (shouldReopenMenu) {
@@ -267,8 +256,11 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
267
256
  };
268
257
  });
269
258
  } else {
270
- this.setState({
271
- focused: -1
259
+ source(query, function (options) {
260
+ _this4.setState({
261
+ focused: -1,
262
+ options: options
263
+ });
272
264
  });
273
265
  }
274
266
  }
@@ -292,18 +284,43 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
292
284
  });
293
285
  }
294
286
  }
287
+ }, {
288
+ key: "handleOptionClickMultiple",
289
+ value: function handleOptionClickMultiple(index) {
290
+ var _this$props$onConfirm2, _this$props3;
291
+ var selectedOption = this.state.options[index];
292
+ var selectedValues = this.state.selectedValues;
293
+ if (this.state.selectedValues.indexOf(selectedOption) === -1) {
294
+ selectedValues = selectedValues.concat([selectedOption]);
295
+ } else {
296
+ selectedValues.splice(this.state.selectedValues.indexOf(selectedOption), 1);
297
+ }
298
+ (_this$props$onConfirm2 = (_this$props3 = this.props).onConfirm) === null || _this$props$onConfirm2 === void 0 ? void 0 : _this$props$onConfirm2.call(_this$props3, selectedValues);
299
+ this.setState({
300
+ focused: index,
301
+ hovered: null,
302
+ menuOpen: true,
303
+ query: '',
304
+ selectedValues: selectedValues,
305
+ selected: index,
306
+ validChoiceMade: true
307
+ });
308
+ this.forceUpdate();
309
+ }
295
310
  }, {
296
311
  key: "handleOptionClick",
297
312
  value: function handleOptionClick(index) {
298
- var _this$props$onConfirm2, _this$props3;
313
+ var _this$props$onConfirm3, _this$props4;
299
314
  var selectedOption = this.state.options[index];
300
315
  var newQuery = this.templateInputValue(selectedOption);
301
- (_this$props$onConfirm2 = (_this$props3 = this.props).onConfirm) === null || _this$props$onConfirm2 === void 0 ? void 0 : _this$props$onConfirm2.call(_this$props3, selectedOption);
316
+ (_this$props$onConfirm3 = (_this$props4 = this.props).onConfirm) === null || _this$props$onConfirm3 === void 0 ? void 0 : _this$props$onConfirm3.call(_this$props4, selectedOption);
317
+ var selectedValues = this.props.multiple ? this.state.selectedValues.concat(selectedOption) : [selectedOption];
302
318
  this.setState({
303
319
  focused: -1,
304
320
  hovered: null,
305
321
  menuOpen: false,
306
322
  query: newQuery,
323
+ selectedValues: selectedValues,
307
324
  selected: -1,
308
325
  validChoiceMade: true
309
326
  });
@@ -324,9 +341,9 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
324
341
  key: "handleUpArrow",
325
342
  value: function handleUpArrow(event) {
326
343
  event.preventDefault();
327
- var _this$state5 = this.state,
328
- menuOpen = _this$state5.menuOpen,
329
- selected = _this$state5.selected;
344
+ var _this$state4 = this.state,
345
+ menuOpen = _this$state4.menuOpen,
346
+ selected = _this$state4.selected;
330
347
  var isNotAtTop = selected !== -1;
331
348
  var allowMoveUp = isNotAtTop && menuOpen;
332
349
  if (allowMoveUp) {
@@ -339,7 +356,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
339
356
  var _this5 = this;
340
357
  event.preventDefault();
341
358
  // if not open, open
342
- if (this.props.showAllValues && this.state.menuOpen === false) {
359
+ if (this.state.menuOpen === false) {
343
360
  event.preventDefault();
344
361
  this.props.source('', function (options) {
345
362
  _this5.setState({
@@ -351,10 +368,10 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
351
368
  });
352
369
  });
353
370
  } else if (this.state.menuOpen === true) {
354
- var _this$state6 = this.state,
355
- menuOpen = _this$state6.menuOpen,
356
- _options = _this$state6.options,
357
- selected = _this$state6.selected;
371
+ var _this$state5 = this.state,
372
+ menuOpen = _this$state5.menuOpen,
373
+ _options = _this$state5.options,
374
+ selected = _this$state5.selected;
358
375
  var isNotAtBottom = selected !== _options.length - 1;
359
376
  var allowMoveDown = isNotAtBottom && menuOpen;
360
377
  if (allowMoveDown) {
@@ -367,7 +384,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
367
384
  value: function handleSpace(event) {
368
385
  var _this6 = this;
369
386
  // if not open, open
370
- if (this.props.showAllValues && this.state.menuOpen === false && this.state.query === '') {
387
+ if (this.state.menuOpen === false && this.state.query === '') {
371
388
  event.preventDefault();
372
389
  this.props.source('', function (options) {
373
390
  _this6.setState({
@@ -390,6 +407,12 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
390
407
  var hasSelectedOption = this.state.selected >= 0;
391
408
  if (hasSelectedOption) {
392
409
  this.handleOptionClick(this.state.selected);
410
+ if (this.props.multiple) {
411
+ this.setState({
412
+ menuOpen: false,
413
+ focused: -1
414
+ });
415
+ }
393
416
  }
394
417
  }
395
418
  }
@@ -408,6 +431,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
408
431
  }, {
409
432
  key: "handleKeyDown",
410
433
  value: function handleKeyDown(event) {
434
+ var _this7 = this;
411
435
  switch (keyCodes[event.keyCode]) {
412
436
  case 'up':
413
437
  this.handleUpArrow(event);
@@ -426,6 +450,24 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
426
450
  query: this.state.query
427
451
  });
428
452
  break;
453
+ case 'backspace':
454
+ if (this.props.multiple) {
455
+ if (this.state.query.length === 0 && this.state.selectedValues.length > 0) {
456
+ event.preventDefault();
457
+ var updatedSelectedValues = this.state.selectedValues.slice(0, -1);
458
+ this.setState({
459
+ selectedValues: updatedSelectedValues
460
+ }, function () {
461
+ var _this7$props$onConfir, _this7$props;
462
+ (_this7$props$onConfir = (_this7$props = _this7.props).onConfirm) === null || _this7$props$onConfir === void 0 ? void 0 : _this7$props$onConfir.call(_this7$props, updatedSelectedValues);
463
+ });
464
+ break;
465
+ }
466
+ } else {
467
+ var _this$props$onConfirm4, _this$props5;
468
+ (_this$props$onConfirm4 = (_this$props5 = this.props).onConfirm) === null || _this$props$onConfirm4 === void 0 ? void 0 : _this$props$onConfirm4.call(_this$props5, '');
469
+ break;
470
+ }
429
471
  default:
430
472
  if (isPrintableKeyCode(event.keyCode)) {
431
473
  this.handlePrintableKey(event);
@@ -436,40 +478,39 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
436
478
  }, {
437
479
  key: "render",
438
480
  value: function render() {
439
- var _this7 = this;
440
- var _this$props4 = this.props,
441
- id = _this$props4.id,
442
- width = _this$props4.width,
443
- displayMenu = _this$props4.displayMenu,
444
- minLength = _this$props4.minLength,
445
- name = _this$props4.name,
446
- placeholder = _this$props4.placeholder,
447
- required = _this$props4.required,
448
- showAllValues = _this$props4.showAllValues,
449
- tNoResults = _this$props4.tNoResults,
450
- tStatusQueryTooShort = _this$props4.tStatusQueryTooShort,
451
- tStatusNoResults = _this$props4.tStatusNoResults,
452
- tStatusSelectedOption = _this$props4.tStatusSelectedOption,
453
- tStatusResults = _this$props4.tStatusResults,
454
- tAssistiveHint = _this$props4.tAssistiveHint,
455
- DropdownArrow = _this$props4.dropdownArrow;
456
- var _this$state7 = this.state,
457
- focused = _this$state7.focused,
458
- hovered = _this$state7.hovered,
459
- menuOpen = _this$state7.menuOpen,
460
- options = _this$state7.options,
461
- query = _this$state7.query,
462
- selected = _this$state7.selected,
463
- ariaHint = _this$state7.ariaHint,
464
- validChoiceMade = _this$state7.validChoiceMade;
481
+ var _this$state$query2,
482
+ _this8 = this;
483
+ var _this$props6 = this.props,
484
+ id = _this$props6.id,
485
+ width = _this$props6.width,
486
+ minLength = _this$props6.minLength,
487
+ name = _this$props6.name,
488
+ placeholder = _this$props6.placeholder,
489
+ required = _this$props6.required,
490
+ tNoResults = _this$props6.tNoResults,
491
+ tStatusQueryTooShort = _this$props6.tStatusQueryTooShort,
492
+ tStatusNoResults = _this$props6.tStatusNoResults,
493
+ tStatusSelectedOption = _this$props6.tStatusSelectedOption,
494
+ tStatusResults = _this$props6.tStatusResults,
495
+ tAssistiveHint = _this$props6.tAssistiveHint,
496
+ multiple = _this$props6.multiple,
497
+ source = _this$props6.source;
498
+ var _this$state6 = this.state,
499
+ focused = _this$state6.focused,
500
+ hovered = _this$state6.hovered,
501
+ menuOpen = _this$state6.menuOpen,
502
+ options = _this$state6.options,
503
+ selected = _this$state6.selected,
504
+ ariaHint = _this$state6.ariaHint,
505
+ validChoiceMade = _this$state6.validChoiceMade;
465
506
  var autoselect = this.hasAutoselect();
507
+ var query = (_this$state$query2 = this.state.query) !== null && _this$state$query2 !== void 0 ? _this$state$query2 : '';
466
508
  var inputFocused = focused === -1;
467
509
  var noOptionsAvailable = options.length === 0;
468
510
  var queryNotEmpty = query.length !== 0;
469
511
  var queryLongEnough = query.length >= minLength;
470
- var showNoOptionsFound = this.props.showNoOptionsFound && inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;
512
+ var showNoOptionsFound = inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;
471
513
  var componentIsFocused = focused !== null;
472
- var dropdownArrowClassName = "ds-autocomplete__dropdown-arrow-down";
473
514
  var optionFocused = focused !== -1 && focused !== null;
474
515
  var menuIsVisible = menuOpen || showNoOptionsFound;
475
516
  var selectedOptionText = this.templateInputValue(options[selected]);
@@ -479,7 +520,57 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
479
520
  var ariaDescribedProp = ariaHint ? {
480
521
  'aria-describedby': assistiveHintID
481
522
  } : null;
482
- return /*#__PURE__*/React.createElement(AutoCompleteWrapper, {
523
+ var showAutoCompleteResultListItems = function showAutoCompleteResultListItems(options, multiple) {
524
+ {
525
+ return options.map(function (option, index) {
526
+ var showFocused = focused === -1 ? selected === index : focused === index;
527
+ var iosPosinsetHtml = isIosDevice() ? /*#__PURE__*/React.createElement("span", {
528
+ id: "".concat(id, "__option-suffix--").concat(index),
529
+ style: {
530
+ border: '0',
531
+ clip: 'rect(0 0 0 0)',
532
+ height: '1px',
533
+ marginBottom: '-1px',
534
+ marginRight: '-1px',
535
+ overflow: 'hidden',
536
+ padding: '0',
537
+ position: 'absolute',
538
+ whiteSpace: 'nowrap',
539
+ width: '1px'
540
+ }
541
+ }, index + 1, " \u03B1\u03C0\u03CC ", options.length) : '';
542
+ return /*#__PURE__*/React.createElement(AutoCompleteResultListItem, {
543
+ isFocused: showFocused,
544
+ isHovered: hovered,
545
+ index: index,
546
+ "aria-selected": focused === index ? 'true' : 'false',
547
+ key: index,
548
+ onBlur: function onBlur(event) {
549
+ return _this8.handleAutoCompleteBlur(event, index);
550
+ },
551
+ onClick: function onClick() {
552
+ return _this8.handleOptionClick(index);
553
+ },
554
+ onMouseDown: _this8.handleOptionMouseDown,
555
+ onMouseEnter: function onMouseEnter() {
556
+ return _this8.handleOptionMouseEnter(index);
557
+ },
558
+ ref: function ref(optionEl) {
559
+ _this8.elementReferences[index] = optionEl;
560
+ },
561
+ role: "option",
562
+ tabIndex: -1,
563
+ "aria-posinset": index + 1,
564
+ "aria-setsize": options.length
565
+ }, multiple ? /*#__PURE__*/React.createElement(CheckboxItem, {
566
+ value: option,
567
+ checked: _this8.state.selectedValues.includes(option),
568
+ onChange: function onChange() {}
569
+ }, _this8.templateSuggestion(option)) : _this8.templateSuggestion(option), iosPosinsetHtml);
570
+ });
571
+ }
572
+ };
573
+ return /*#__PURE__*/React.createElement(AutoCompleteContainer, {
483
574
  onKeyDown: this.handleKeyDown,
484
575
  width: width
485
576
  }, /*#__PURE__*/React.createElement(Status, {
@@ -495,106 +586,139 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
495
586
  tNoResults: tStatusNoResults,
496
587
  tSelectedOption: tStatusSelectedOption,
497
588
  tResults: tStatusResults
498
- }), hintValue && /*#__PURE__*/React.createElement(AutoCompleteInputTypeahead, {
589
+ }), hintValue && (placeholder === '' || !placeholder) && /*#__PURE__*/React.createElement(AutoCompleteInputTypeahead, {
499
590
  value: hintValue
500
- }), /*#__PURE__*/React.createElement(AutoCompleteInput, _extends({
591
+ }), multiple ? /*#__PURE__*/React.createElement(AutoCompleteMultipleInputContainer, {
592
+ isFocused: componentIsFocused,
593
+ numberOfSelected: this.props.numberOfSelected
594
+ }, /*#__PURE__*/React.createElement(ChipContainer, null, this.state.selectedValues.map(function (value, index) {
595
+ return /*#__PURE__*/React.createElement(Chip, {
596
+ key: index,
597
+ onDelete: function onDelete() {
598
+ _this8.setState(function (prevState) {
599
+ return {
600
+ selectedValues: prevState.selectedValues.filter(function (v) {
601
+ if (typeof v === "string") {
602
+ return v !== value;
603
+ } else {
604
+ return v.value !== value.value;
605
+ }
606
+ })
607
+ };
608
+ }, function () {
609
+ var _this8$props$onConfir, _this8$props;
610
+ (_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);
611
+ });
612
+ }
613
+ }, typeof value === "string" ? value : value.label.primary);
614
+ }), !componentIsFocused && typeof this.props.numberOfSelected === 'number' && this.state.selectedValues.length > this.props.numberOfSelected && /*#__PURE__*/React.createElement(NormalText, {
615
+ fontWeight: "bold",
616
+ margin: 0
617
+ }, "+", this.state.selectedValues.length - this.props.numberOfSelected)), /*#__PURE__*/React.createElement(AutoCompleteMultipleInput, _extends({
501
618
  "aria-expanded": menuOpen ? 'true' : 'false',
502
619
  "aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
503
620
  "aria-owns": "".concat(id, "__listbox"),
504
621
  "aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
505
622
  }, ariaDescribedProp, {
506
- autoComplete: "off",
507
- isFocused: componentIsFocused,
508
- showAllValues: this.props.showAllValues,
623
+ autoComplete: "off"
624
+ // isFocused={componentIsFocused}
625
+ ,
509
626
  id: id,
510
627
  onClick: function onClick(event) {
511
- return _this7.handleInputClick(event);
628
+ return _this8.handleInputClick(event);
629
+ },
630
+ onBlur: function onBlur(event) {
631
+ return _this8.handleAutoCompleteBlur(event);
512
632
  },
513
- onBlur: this.handleInputBlur,
514
633
  onChange: this.handleInputChange,
515
634
  onFocus: this.handleInputFocus,
516
635
  name: name,
517
636
  placeholder: placeholder,
518
637
  ref: function ref(inputElement) {
519
- _this7.elementReferences[-1] = inputElement;
638
+ _this8.elementReferences[-1] = inputElement;
520
639
  },
521
640
  role: "combobox",
522
641
  required: required,
523
642
  value: query
524
- })), showNoOptionsFound || showAllValues && !menuOpen && DropdownArrow && /*#__PURE__*/React.createElement(DropdownArrow, {
525
- type: "button",
643
+ })), /*#__PURE__*/React.createElement(Button, {
644
+ ref: function ref(buttonElement) {
645
+ _this8.elementReferences['button-arrow'] = buttonElement;
646
+ },
647
+ variant: "link",
526
648
  onClick: function onClick() {
527
- _this7.elementReferences[-1].focus();
528
- _this7.handleInputChange({
529
- target: {
530
- value: query
531
- }
532
- });
649
+ if (!_this8.state.menuOpen) {
650
+ source(query, function (options) {
651
+ var optionsAvailable = options.length > 0;
652
+ _this8.setState({
653
+ menuOpen: optionsAvailable,
654
+ options: options,
655
+ selected: autoselect && optionsAvailable ? 0 : -1,
656
+ validChoiceMade: false
657
+ });
658
+ });
659
+ } else {
660
+ _this8.setState({
661
+ menuOpen: false,
662
+ focused: null
663
+ });
664
+ }
533
665
  },
534
- className: dropdownArrowClassName
535
- }), /*#__PURE__*/React.createElement(AutoCompleteResultList, {
536
- displayMenu: displayMenu,
666
+ onBlur: function onBlur(event) {
667
+ return _this8.handleAutoCompleteBlur(event);
668
+ }
669
+ }, _ref2), /*#__PURE__*/React.createElement(AutoCompleteResultList, {
537
670
  isVisible: menuIsVisible,
538
671
  onMouseLeave: function onMouseLeave() {
539
- return _this7.handleListMouseLeave();
672
+ return _this8.handleListMouseLeave();
540
673
  },
541
674
  id: "".concat(id, "__listbox"),
542
675
  role: "listbox"
543
- }, options.map(function (option, index) {
544
- var showFocused = focused === -1 ? selected === index : focused === index;
545
- var iosPosinsetHtml = isIosDevice() ? /*#__PURE__*/React.createElement("span", {
546
- id: "".concat(id, "__option-suffix--").concat(index),
547
- style: {
548
- border: '0',
549
- clip: 'rect(0 0 0 0)',
550
- height: '1px',
551
- marginBottom: '-1px',
552
- marginRight: '-1px',
553
- overflow: 'hidden',
554
- padding: '0',
555
- position: 'absolute',
556
- whiteSpace: 'nowrap',
557
- width: '1px'
558
- }
559
- }, index + 1, " \u03B1\u03C0\u03CC ", options.length) : '';
560
- return /*#__PURE__*/React.createElement(AutoCompleteResultListItem, {
561
- isFocused: showFocused,
562
- isHovered: hovered,
563
- index: index,
564
- "aria-selected": focused === index ? 'true' : 'false',
565
- key: index,
566
- onBlur: function onBlur(event) {
567
- return _this7.handleOptionBlur(event, index);
568
- },
569
- onClick: function onClick() {
570
- return _this7.handleOptionClick(index);
571
- },
572
- onMouseDown: _this7.handleOptionMouseDown,
573
- onMouseEnter: function onMouseEnter() {
574
- return _this7.handleOptionMouseEnter(index);
575
- },
576
- ref: function ref(optionEl) {
577
- _this7.elementReferences[index] = optionEl;
578
- },
579
- role: "option",
580
- tabIndex: -1,
581
- "aria-posinset": index + 1,
582
- "aria-setsize": options.length
583
- }, _this7.templateSuggestion(option), " ", iosPosinsetHtml);
584
- }), showNoOptionsFound && /*#__PURE__*/React.createElement(AutoCompleteResultListItem, {
676
+ }, /*#__PURE__*/React.createElement(Checkbox, null, showAutoCompleteResultListItems(options, multiple)), showNoOptionsFound && /*#__PURE__*/React.createElement(AutoCompleteResultListItem, {
585
677
  empty: true
586
678
  }, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/React.createElement(AutoCompleteAssistiveHint, {
587
679
  id: assistiveHintID
588
- }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint()));
680
+ }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AutoCompleteInput, _extends({
681
+ "aria-expanded": menuOpen ? 'true' : 'false',
682
+ "aria-activedescendant": optionFocused ? "".concat(id, "__option--").concat(focused) : '',
683
+ "aria-owns": "".concat(id, "__listbox"),
684
+ "aria-autocomplete": this.hasAutoselect() ? 'both' : 'list'
685
+ }, ariaDescribedProp, {
686
+ autoComplete: "off",
687
+ isFocused: componentIsFocused,
688
+ id: id,
689
+ onClick: function onClick(event) {
690
+ return _this8.handleInputClick(event);
691
+ },
692
+ onBlur: this.handleAutoCompleteBlur,
693
+ onChange: this.handleInputChange,
694
+ onFocus: this.handleInputFocus,
695
+ name: name,
696
+ placeholder: placeholder,
697
+ ref: function ref(inputElement) {
698
+ _this8.elementReferences[-1] = inputElement;
699
+ },
700
+ role: "combobox",
701
+ required: required,
702
+ value: query
703
+ })), _ref3, /*#__PURE__*/React.createElement(AutoCompleteResultList, {
704
+ isVisible: menuIsVisible,
705
+ onMouseLeave: function onMouseLeave() {
706
+ return _this8.handleListMouseLeave();
707
+ },
708
+ id: "".concat(id, "__listbox"),
709
+ role: "listbox"
710
+ }, showAutoCompleteResultListItems(options, false), showNoOptionsFound && /*#__PURE__*/React.createElement(AutoCompleteResultListItem, {
711
+ empty: true
712
+ }, tNoResults === null || tNoResults === void 0 ? void 0 : tNoResults())), /*#__PURE__*/React.createElement(AutoCompleteAssistiveHint, {
713
+ id: assistiveHintID
714
+ }, tAssistiveHint === null || tAssistiveHint === void 0 ? void 0 : tAssistiveHint())));
589
715
  }
590
716
  }]);
591
717
  return AutoComplete;
592
718
  }(Component);
593
719
  AutoComplete.defaultProps = {
594
- width: '33.3%',
720
+ width: 'full',
595
721
  autoselect: false,
596
- defaultValue: '',
597
- displayMenu: 'overlay',
598
722
  minLength: 0,
599
723
  name: 'ds-input-autocomplete',
600
724
  placeholder: '',
@@ -602,21 +726,13 @@ AutoComplete.defaultProps = {
602
726
  return;
603
727
  },
604
728
  confirmOnBlur: false,
605
- showNoOptionsFound: true,
606
- showAllValues: false,
607
729
  required: false,
608
730
  tNoResults: function tNoResults() {
609
731
  return 'No results found';
610
732
  },
611
733
  tAssistiveHint: function tAssistiveHint() {
612
734
  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.';
613
- },
614
- dropdownArrow: function dropdownArrow(props) {
615
- return /*#__PURE__*/React.createElement(CaretIcon, _extends({
616
- direction: "down",
617
- size: "sm"
618
- }, props));
619
735
  }
620
736
  };
621
737
  export { AutoComplete as default };
622
- export { AutoComplete, AutoCompleteInput, AutoCompleteInputTypeahead, AutoCompleteResultList, AutoCompleteResultListItem, AutoCompleteWrapper, AutoCompleteAssistiveHint };
738
+ export { AutoComplete, AutoCompleteInput, AutoCompleteInputTypeahead, AutoCompleteResultList, AutoCompleteResultListItem, AutoCompleteContainer, AutoCompleteAssistiveHint, AutoCompleteMultipleInputContainer, AutoCompleteMultipleInput };