@indico-data/design-system 2.1.3 → 2.3.0

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 (370) hide show
  1. package/.yarn/sdks/eslint/bin/eslint.js +8 -1
  2. package/.yarn/sdks/eslint/package.json +1 -1
  3. package/.yarn/sdks/prettier/bin/prettier.cjs +8 -1
  4. package/.yarn/sdks/prettier/index.cjs +8 -1
  5. package/.yarn/sdks/typescript/bin/tsc +8 -1
  6. package/.yarn/sdks/typescript/bin/tsserver +8 -1
  7. package/.yarn/sdks/typescript/package.json +1 -1
  8. package/.yarnrc.yml +1 -0
  9. package/lib/build/generated/iconTypes.d.ts +2 -0
  10. package/lib/index.css +142 -101
  11. package/lib/index.d.ts +9 -1371
  12. package/lib/index.esm.css +142 -101
  13. package/lib/index.esm.js +26604 -12492
  14. package/lib/index.esm.js.map +1 -1
  15. package/lib/index.js +26647 -12538
  16. package/lib/index.js.map +1 -1
  17. package/lib/{components → src/components}/button/types.d.ts +1 -2
  18. package/lib/src/components/icons/Icon.d.ts +4 -0
  19. package/lib/src/components/icons/Icon.stories.d.ts +10 -0
  20. package/lib/src/components/icons/index.d.ts +1 -0
  21. package/lib/src/components/icons/types.d.ts +10 -0
  22. package/lib/{components → src/components}/index.d.ts +2 -0
  23. package/lib/src/components/tables/table/LoadingComponent.d.ts +1 -0
  24. package/lib/src/components/tables/table/Table.d.ts +78 -0
  25. package/lib/src/components/tables/table/Table.stories.d.ts +6 -0
  26. package/lib/src/components/tables/table/index.d.ts +1 -0
  27. package/lib/src/components/tables/table/sampleData.d.ts +8 -0
  28. package/lib/src/index.d.ts +8 -0
  29. package/lib/{legacy → src/legacy}/components/Accordion/Accordion.stories.d.ts +9 -9
  30. package/lib/src/legacy/components/Accordion/Accordion.styles.d.ts +1 -0
  31. package/lib/src/legacy/components/ListTable/Header/Header.styles.d.ts +1 -0
  32. package/lib/{legacy → src/legacy}/components/ListTable/ListTable.stories.d.ts +7 -7
  33. package/lib/src/legacy/components/ListTable/ListTable.styles.d.ts +1 -0
  34. package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.stories.d.ts +2 -2
  35. package/lib/src/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +2 -0
  36. package/lib/src/legacy/components/Pagination/Pagination.styles.d.ts +1 -0
  37. package/lib/{legacy → src/legacy}/components/Toggle/Toggle.d.ts +2 -1
  38. package/lib/src/legacy/components/Toggle/Toggle.stories.d.ts +21 -0
  39. package/lib/src/legacy/components/Toggle/Toggle.styles.d.ts +1 -0
  40. package/lib/src/legacy/components/Tooltip/Tooltip.styles.d.ts +1 -0
  41. package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.stories.d.ts +1 -2
  42. package/lib/src/legacy/components/basic-section/Section/Section.styles.d.ts +1 -0
  43. package/lib/src/legacy/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +1 -0
  44. package/lib/src/legacy/components/basic-section/SectionBody/SectionBody.styles.d.ts +1 -0
  45. package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.stories.d.ts +1 -1
  46. package/lib/src/legacy/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +1 -0
  47. package/lib/src/legacy/components/basic-section/SectionTable/SectionTable.styles.d.ts +1 -0
  48. package/lib/{legacy → src/legacy}/components/buttons/Button/Button.stories.d.ts +1 -1
  49. package/lib/src/legacy/components/buttons/Button/Button.styles.d.ts +1 -0
  50. package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.stories.d.ts +3 -3
  51. package/lib/src/legacy/components/buttons/IconButton/IconButton.styles.d.ts +5 -0
  52. package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.stories.d.ts +8 -9
  53. package/lib/src/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +2 -0
  54. package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.d.ts +5 -5
  55. package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.stories.d.ts +7 -7
  56. package/lib/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +4 -0
  57. package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.stories.d.ts +6 -7
  58. package/lib/src/legacy/components/dropdowns/Select/Select.styles.d.ts +1 -0
  59. package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.d.ts +5 -5
  60. package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.stories.d.ts +5 -6
  61. package/lib/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +4 -0
  62. package/lib/{legacy → src/legacy}/components/index.d.ts +0 -2
  63. package/lib/src/legacy/components/inputs/DatePicker/DatePicker.styles.d.ts +1 -0
  64. package/lib/src/legacy/components/inputs/EditableInput/EditableInput.styles.d.ts +1 -0
  65. package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.d.ts +2 -1
  66. package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +1 -0
  67. package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.stories.d.ts +2 -2
  68. package/lib/src/legacy/components/inputs/NumberInput/NumberInput.styles.d.ts +1 -0
  69. package/lib/src/legacy/components/inputs/RadioButtons/RadioButtons.styles.d.ts +13 -0
  70. package/lib/src/legacy/components/inputs/RadioGroup/RadioGroup.styles.d.ts +1 -0
  71. package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.stories.d.ts +8 -9
  72. package/lib/src/legacy/components/inputs/SearchInput/SearchInput.styles.d.ts +1 -0
  73. package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.stories.d.ts +9 -9
  74. package/lib/src/legacy/components/inputs/TextInput/TextInput.styles.d.ts +2 -0
  75. package/lib/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +1 -0
  76. package/lib/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +7 -0
  77. package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +3 -4
  78. package/lib/src/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +7 -0
  79. package/lib/src/legacy/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +1 -0
  80. package/lib/src/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +1 -0
  81. package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.stories.d.ts +5 -5
  82. package/lib/src/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +1 -0
  83. package/lib/src/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +4 -0
  84. package/lib/src/legacy/components/text-truncate/TextTruncate.styles.d.ts +1 -0
  85. package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.stories.d.ts +11 -11
  86. package/lib/src/legacy/components/user-feedback/Shrug/Shrug.styles.d.ts +1 -0
  87. package/lib/{legacy → src/legacy}/styles/globals/buttons.d.ts +0 -1
  88. package/lib/{legacy → src/legacy}/styles/globals/forms.d.ts +0 -1
  89. package/lib/{legacy → src/legacy}/styles/globals/layout.d.ts +0 -1
  90. package/lib/{legacy → src/legacy}/styles/globals/lists.d.ts +0 -1
  91. package/lib/{legacy → src/legacy}/styles/globals/margin-padding.d.ts +0 -1
  92. package/lib/{legacy → src/legacy}/styles/globals/media.d.ts +0 -1
  93. package/lib/{legacy → src/legacy}/styles/globals/tables.d.ts +0 -1
  94. package/lib/{legacy → src/legacy}/styles/globals/typography.d.ts +0 -1
  95. package/lib/{legacy → src/legacy}/styles/globals/utility-classes.d.ts +0 -1
  96. package/lib/src/types.d.ts +10 -0
  97. package/package.json +20 -15
  98. package/rollup.config.mjs +2 -2
  99. package/scripts/generateIconTypes.js +50 -0
  100. package/src/components/button/Button.tsx +1 -2
  101. package/src/components/button/types.ts +2 -1
  102. package/src/components/icons/Icon.mdx +49 -0
  103. package/src/components/icons/Icon.stories.tsx +248 -0
  104. package/src/components/icons/Icon.tsx +45 -0
  105. package/src/components/icons/__tests__/Icon.test.tsx +104 -0
  106. package/src/components/icons/index.ts +1 -0
  107. package/src/{legacy/components/Icon → components/icons}/indicons.tsx +17 -17
  108. package/src/components/icons/styles/Icon.scss +23 -0
  109. package/src/components/icons/types.ts +12 -0
  110. package/src/components/index.ts +2 -0
  111. package/src/components/tables/table/LoadingComponent.tsx +5 -0
  112. package/src/components/tables/table/Table.mdx +15 -0
  113. package/src/components/tables/table/Table.scss +79 -0
  114. package/src/components/tables/table/Table.stories.tsx +547 -0
  115. package/src/components/tables/table/Table.tsx +112 -0
  116. package/src/components/tables/table/_variables.scss +19 -0
  117. package/src/components/tables/table/index.ts +1 -0
  118. package/src/components/tables/table/sampleData.ts +162 -0
  119. package/src/index.ts +1 -4
  120. package/src/legacy/components/Accordion/Accordion.tsx +2 -2
  121. package/src/legacy/components/ListTable/Header/Header.tsx +1 -2
  122. package/src/legacy/components/ListTable/ListTable.stories.tsx +2 -1
  123. package/src/legacy/components/Toggle/Toggle.styles.ts +1 -1
  124. package/src/legacy/components/Toggle/Toggle.tsx +17 -4
  125. package/src/legacy/components/basic-section/SectionTable/SectionTable.tsx +1 -1
  126. package/src/legacy/components/buttons/Button/Button.tsx +1 -1
  127. package/src/legacy/components/buttons/IconButton/IconButton.tsx +2 -2
  128. package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.tsx +1 -1
  129. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +8 -7
  130. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +3 -1
  131. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.tsx +2 -2
  132. package/src/legacy/components/dropdowns/Select/Select.tsx +3 -3
  133. package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.tsx +2 -2
  134. package/src/legacy/components/index.ts +1 -2
  135. package/src/legacy/components/inputs/EditableInput/EditableInput.tsx +1 -1
  136. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.tsx +2 -2
  137. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +5 -4
  138. package/src/legacy/components/inputs/NumberInput/NumberInput.tsx +1 -1
  139. package/src/legacy/components/inputs/SearchInput/SearchInput.tsx +1 -1
  140. package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +8 -8
  141. package/src/legacy/components/user-feedback/Shrug/Shrug.styles.ts +2 -0
  142. package/src/legacy/components/user-feedback/Shrug/Shrug.tsx +4 -4
  143. package/src/styles/index.scss +2 -2
  144. package/src/styles/variables/_icons.scss +7 -0
  145. package/src/styles/variables/index.scss +2 -1
  146. package/src/types.ts +2 -14
  147. package/tsconfig.json +1 -1
  148. package/lib/legacy/components/Accordion/Accordion.styles.d.ts +0 -2
  149. package/lib/legacy/components/Icon/Icon.d.ts +0 -17
  150. package/lib/legacy/components/Icon/Icon.stories.d.ts +0 -42
  151. package/lib/legacy/components/Icon/faIcons.d.ts +0 -76
  152. package/lib/legacy/components/Icon/index.d.ts +0 -3
  153. package/lib/legacy/components/Icon/storyHelpers.d.ts +0 -9
  154. package/lib/legacy/components/ListTable/Header/Header.styles.d.ts +0 -2
  155. package/lib/legacy/components/ListTable/ListTable.styles.d.ts +0 -2
  156. package/lib/legacy/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +0 -3
  157. package/lib/legacy/components/Navigation/Drawer/Drawer.d.ts +0 -16
  158. package/lib/legacy/components/Navigation/Drawer/Drawer.stories.d.ts +0 -6
  159. package/lib/legacy/components/Navigation/Drawer/DrawerLinkList.d.ts +0 -9
  160. package/lib/legacy/components/Navigation/Drawer/DrawerLinkList.styles.d.ts +0 -2
  161. package/lib/legacy/components/Navigation/Drawer/__mocks__/mocks.d.ts +0 -3
  162. package/lib/legacy/components/Navigation/Drawer/index.d.ts +0 -1
  163. package/lib/legacy/components/Navigation/Drawer/types.d.ts +0 -7
  164. package/lib/legacy/components/Navigation/index.d.ts +0 -1
  165. package/lib/legacy/components/Pagination/Pagination.styles.d.ts +0 -2
  166. package/lib/legacy/components/Toggle/Toggle.stories.d.ts +0 -21
  167. package/lib/legacy/components/Toggle/Toggle.styles.d.ts +0 -2
  168. package/lib/legacy/components/Tooltip/Tooltip.styles.d.ts +0 -2
  169. package/lib/legacy/components/basic-section/Section/Section.styles.d.ts +0 -2
  170. package/lib/legacy/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +0 -2
  171. package/lib/legacy/components/basic-section/SectionBody/SectionBody.styles.d.ts +0 -2
  172. package/lib/legacy/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +0 -2
  173. package/lib/legacy/components/basic-section/SectionTable/SectionTable.styles.d.ts +0 -2
  174. package/lib/legacy/components/buttons/Button/Button.styles.d.ts +0 -2
  175. package/lib/legacy/components/buttons/IconButton/IconButton.styles.d.ts +0 -4
  176. package/lib/legacy/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +0 -3
  177. package/lib/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +0 -3
  178. package/lib/legacy/components/dropdowns/Select/Select.styles.d.ts +0 -2
  179. package/lib/legacy/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +0 -3
  180. package/lib/legacy/components/inputs/DatePicker/DatePicker.styles.d.ts +0 -2
  181. package/lib/legacy/components/inputs/EditableInput/EditableInput.styles.d.ts +0 -2
  182. package/lib/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -2
  183. package/lib/legacy/components/inputs/NumberInput/NumberInput.styles.d.ts +0 -2
  184. package/lib/legacy/components/inputs/RadioButtons/RadioButtons.styles.d.ts +0 -14
  185. package/lib/legacy/components/inputs/RadioGroup/RadioGroup.styles.d.ts +0 -2
  186. package/lib/legacy/components/inputs/SearchInput/SearchInput.styles.d.ts +0 -2
  187. package/lib/legacy/components/inputs/TextInput/TextInput.styles.d.ts +0 -3
  188. package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +0 -2
  189. package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +0 -8
  190. package/lib/legacy/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +0 -8
  191. package/lib/legacy/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +0 -2
  192. package/lib/legacy/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +0 -2
  193. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +0 -2
  194. package/lib/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +0 -4
  195. package/lib/legacy/components/text-truncate/TextTruncate.styles.d.ts +0 -2
  196. package/lib/legacy/components/user-feedback/Shrug/Shrug.styles.d.ts +0 -2
  197. package/lib/types.d.ts +0 -231
  198. package/src/legacy/components/Icon/Icon.stories.tsx +0 -61
  199. package/src/legacy/components/Icon/Icon.tsx +0 -76
  200. package/src/legacy/components/Icon/faIcons.tsx +0 -168
  201. package/src/legacy/components/Icon/index.ts +0 -3
  202. package/src/legacy/components/Icon/storyHelpers.tsx +0 -88
  203. package/src/legacy/components/Navigation/Drawer/Drawer.scss +0 -61
  204. package/src/legacy/components/Navigation/Drawer/Drawer.stories.tsx +0 -43
  205. package/src/legacy/components/Navigation/Drawer/Drawer.tsx +0 -107
  206. package/src/legacy/components/Navigation/Drawer/DrawerLinkList.styles.ts +0 -65
  207. package/src/legacy/components/Navigation/Drawer/DrawerLinkList.tsx +0 -64
  208. package/src/legacy/components/Navigation/Drawer/__mocks__/mocks.ts +0 -49
  209. package/src/legacy/components/Navigation/Drawer/__tests__/Drawer.test.tsx +0 -180
  210. package/src/legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.tsx +0 -66
  211. package/src/legacy/components/Navigation/Drawer/index.ts +0 -1
  212. package/src/legacy/components/Navigation/Drawer/types.ts +0 -8
  213. package/src/legacy/components/Navigation/index.ts +0 -1
  214. /package/lib/{components → src/components}/button/Button.d.ts +0 -0
  215. /package/lib/{components → src/components}/button/Button.stories.d.ts +0 -0
  216. /package/lib/{components → src/components}/button/__tests__/Button.test.d.ts +0 -0
  217. /package/lib/{components → src/components}/button/enums.d.ts +0 -0
  218. /package/lib/{components → src/components}/button/index.d.ts +0 -0
  219. /package/lib/{components → src/components}/grid/col/Col.d.ts +0 -0
  220. /package/lib/{components → src/components}/grid/col/Col.stories.d.ts +0 -0
  221. /package/lib/{components → src/components}/grid/container/Container.d.ts +0 -0
  222. /package/lib/{components → src/components}/grid/container/Container.stories.d.ts +0 -0
  223. /package/lib/{components → src/components}/grid/index.d.ts +0 -0
  224. /package/lib/{components → src/components}/grid/row/Row.d.ts +0 -0
  225. /package/lib/{components → src/components}/grid/row/Row.stories.d.ts +0 -0
  226. /package/lib/{legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.d.ts → src/components/icons/__tests__/Icon.test.d.ts} +0 -0
  227. /package/lib/{legacy/components/Icon → src/components/icons}/indicons.d.ts +0 -0
  228. /package/lib/{legacy → src/legacy}/components/Accordion/Accordion.d.ts +0 -0
  229. /package/lib/{legacy → src/legacy}/components/Accordion/index.d.ts +0 -0
  230. /package/lib/{legacy → src/legacy}/components/ListTable/Header/Header.d.ts +0 -0
  231. /package/lib/{legacy → src/legacy}/components/ListTable/Header/index.d.ts +0 -0
  232. /package/lib/{legacy → src/legacy}/components/ListTable/ListTable.d.ts +0 -0
  233. /package/lib/{legacy → src/legacy}/components/ListTable/index.d.ts +0 -0
  234. /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/index.d.ts +0 -0
  235. /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/mock-data.d.ts +0 -0
  236. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.d.ts +0 -0
  237. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/index.d.ts +0 -0
  238. /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.d.ts +0 -0
  239. /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.stories.d.ts +0 -0
  240. /package/lib/{legacy → src/legacy}/components/Pagination/index.d.ts +0 -0
  241. /package/lib/{legacy → src/legacy}/components/Toggle/index.d.ts +0 -0
  242. /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.d.ts +0 -0
  243. /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.stories.d.ts +0 -0
  244. /package/lib/{legacy → src/legacy}/components/Tooltip/index.d.ts +0 -0
  245. /package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.d.ts +0 -0
  246. /package/lib/{legacy → src/legacy}/components/basic-section/Section/index.d.ts +0 -0
  247. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/SectionBlock.d.ts +0 -0
  248. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/index.d.ts +0 -0
  249. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.d.ts +0 -0
  250. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.stories.d.ts +0 -0
  251. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/index.d.ts +0 -0
  252. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.d.ts +0 -0
  253. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/index.d.ts +0 -0
  254. /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/SectionTable.d.ts +0 -0
  255. /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/index.d.ts +0 -0
  256. /package/lib/{legacy → src/legacy}/components/basic-section/index.d.ts +0 -0
  257. /package/lib/{legacy → src/legacy}/components/buttons/Button/Button.d.ts +0 -0
  258. /package/lib/{legacy → src/legacy}/components/buttons/Button/index.d.ts +0 -0
  259. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.d.ts +0 -0
  260. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/index.d.ts +0 -0
  261. /package/lib/{legacy → src/legacy}/components/buttons/commonStyles.d.ts +0 -0
  262. /package/lib/{legacy → src/legacy}/components/buttons/index.d.ts +0 -0
  263. /package/lib/{legacy → src/legacy}/components/buttons/types.d.ts +0 -0
  264. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.d.ts +0 -0
  265. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/index.d.ts +0 -0
  266. /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/index.d.ts +0 -0
  267. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.d.ts +0 -0
  268. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/index.d.ts +0 -0
  269. /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/index.d.ts +0 -0
  270. /package/lib/{legacy → src/legacy}/components/dropdowns/commonStyles.d.ts +0 -0
  271. /package/lib/{legacy → src/legacy}/components/dropdowns/index.d.ts +0 -0
  272. /package/lib/{legacy → src/legacy}/components/dropdowns/types.d.ts +0 -0
  273. /package/lib/{legacy → src/legacy}/components/dropdowns/useCombobox.d.ts +0 -0
  274. /package/lib/{legacy → src/legacy}/components/dropdowns/utils.d.ts +0 -0
  275. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.d.ts +0 -0
  276. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.stories.d.ts +0 -0
  277. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/index.d.ts +0 -0
  278. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.d.ts +0 -0
  279. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.stories.d.ts +0 -0
  280. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/index.d.ts +0 -0
  281. /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.d.ts +0 -0
  282. /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/index.d.ts +0 -0
  283. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.d.ts +0 -0
  284. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/index.d.ts +0 -0
  285. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.d.ts +0 -0
  286. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.stories.d.ts +0 -0
  287. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/index.d.ts +0 -0
  288. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.d.ts +0 -0
  289. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.stories.d.ts +0 -0
  290. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/index.d.ts +0 -0
  291. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.d.ts +0 -0
  292. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/index.d.ts +0 -0
  293. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.d.ts +0 -0
  294. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/index.d.ts +0 -0
  295. /package/lib/{legacy → src/legacy}/components/inputs/index.d.ts +0 -0
  296. /package/lib/{legacy → src/legacy}/components/inputs/inputsCommon.styles.d.ts +0 -0
  297. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.d.ts +0 -0
  298. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +0 -0
  299. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/index.d.ts +0 -0
  300. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.d.ts +0 -0
  301. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +0 -0
  302. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/index.d.ts +0 -0
  303. /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.stories.d.ts +0 -0
  304. /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/index.d.ts +0 -0
  305. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.d.ts +0 -0
  306. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -0
  307. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/index.d.ts +0 -0
  308. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.d.ts +0 -0
  309. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.stories.d.ts +0 -0
  310. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/index.d.ts +0 -0
  311. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.d.ts +0 -0
  312. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.stories.d.ts +0 -0
  313. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/index.d.ts +0 -0
  314. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.d.ts +0 -0
  315. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.d.ts +0 -0
  316. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/index.d.ts +0 -0
  317. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/random-messages.d.ts +0 -0
  318. /package/lib/{legacy → src/legacy}/components/loading-indicators/index.d.ts +0 -0
  319. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.d.ts +0 -0
  320. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/index.d.ts +0 -0
  321. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.d.ts +0 -0
  322. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.stories.d.ts +0 -0
  323. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/index.d.ts +0 -0
  324. /package/lib/{legacy → src/legacy}/components/modals/index.d.ts +0 -0
  325. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.d.ts +0 -0
  326. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.stories.d.ts +0 -0
  327. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.test.d.ts +0 -0
  328. /package/lib/{legacy → src/legacy}/components/text-truncate/index.d.ts +0 -0
  329. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.d.ts +0 -0
  330. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/index.d.ts +0 -0
  331. /package/lib/{legacy → src/legacy}/components/user-feedback/index.d.ts +0 -0
  332. /package/lib/{legacy → src/legacy}/styles/globals/index.d.ts +0 -0
  333. /package/lib/{legacy → src/legacy}/styles/index.d.ts +0 -0
  334. /package/lib/{legacy → src/legacy}/tokens/animation.d.ts +0 -0
  335. /package/lib/{legacy → src/legacy}/tokens/breakpoints.d.ts +0 -0
  336. /package/lib/{legacy → src/legacy}/tokens/colors.d.ts +0 -0
  337. /package/lib/{legacy → src/legacy}/tokens/index.d.ts +0 -0
  338. /package/lib/{legacy → src/legacy}/tokens/margin.d.ts +0 -0
  339. /package/lib/{legacy → src/legacy}/tokens/numbers.d.ts +0 -0
  340. /package/lib/{legacy → src/legacy}/tokens/padding.d.ts +0 -0
  341. /package/lib/{legacy → src/legacy}/tokens/spacings.d.ts +0 -0
  342. /package/lib/{legacy → src/legacy}/tokens/typography.d.ts +0 -0
  343. /package/lib/{legacy → src/legacy}/utils/color.d.ts +0 -0
  344. /package/lib/{legacy → src/legacy}/utils/index.d.ts +0 -0
  345. /package/lib/{legacy → src/legacy}/utils/number.d.ts +0 -0
  346. /package/lib/{legacy → src/legacy}/utils/string.d.ts +0 -0
  347. /package/lib/{setupTests.d.ts → src/setupTests.d.ts} +0 -0
  348. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.d.ts +0 -0
  349. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.stories.d.ts +0 -0
  350. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.d.ts +0 -0
  351. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.stories.d.ts +0 -0
  352. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.d.ts +0 -0
  353. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.stories.d.ts +0 -0
  354. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.d.ts +0 -0
  355. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.stories.d.ts +0 -0
  356. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/index.d.ts +0 -0
  357. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.d.ts +0 -0
  358. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.stories.d.ts +0 -0
  359. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Swatch.d.ts +0 -0
  360. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.d.ts +0 -0
  361. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.stories.d.ts +0 -0
  362. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/constants.d.ts +0 -0
  363. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/hooks.d.ts +0 -0
  364. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/index.d.ts +0 -0
  365. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.d.ts +0 -0
  366. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.stories.d.ts +0 -0
  367. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/index.d.ts +0 -0
  368. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.d.ts +0 -0
  369. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.stories.d.ts +0 -0
  370. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/index.d.ts +0 -0
@@ -1,61 +0,0 @@
1
-
2
- @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
3
-
4
- .pf__drawer__wrapper {
5
- color: #444444;
6
- background-color: white;
7
- box-sizing: border-box;
8
- height: 100vh;
9
- padding: 30px 4px 10px 4px;
10
- transition: width 0.2s ease-in-out;
11
- box-shadow: 5px 0 10px rgba(0, 0, 0, 0.3);
12
- overflow: hidden;
13
- width: 100%;
14
-
15
- .pf__drawer__header__logo-text {
16
- font-family: 'Poppins', sans-serif;
17
- font-weight: 600;
18
- }
19
-
20
- a:link {
21
- color: #444444;
22
- }
23
-
24
- a {
25
- color: #444444;
26
- text-decoration: none;
27
- }
28
-
29
-
30
- .pf__drawer__header {
31
- margin-bottom: 30px;
32
- color: black;
33
- display: flex;
34
- align-items: center;
35
- padding-left: 10px;
36
- white-space: nowrap;
37
-
38
- .pf__drawer__header__text {
39
- overflow: hidden;
40
- transition: opacity 0.2s ease-in-out;
41
- }
42
-
43
- span {
44
- display: flex;
45
- align-items: center;
46
- }
47
-
48
- p {
49
- font-size: 20px;
50
- margin: 0 0 0 12px;
51
- }
52
- }
53
-
54
- .pf__drawer__content {
55
- height: calc(100% - 42px);
56
- display: flex;
57
- flex-direction: column;
58
- justify-content: space-between;
59
- padding-bottom: 10px;
60
- }
61
- }
@@ -1,43 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Drawer } from '@/legacy/components/Navigation/Drawer';
4
- import React from 'react';
5
- import { footerItems, navigationItems } from './__mocks__/mocks';
6
- import { MemoryRouter } from 'react-router-dom';
7
-
8
- const meta: Meta<typeof Drawer> = {
9
- component: Drawer,
10
- tags: ['autodocs'],
11
- title: 'legacy/Navigation/Drawer',
12
- decorators: [
13
- (Story) => (
14
- <MemoryRouter initialEntries={['/']}>
15
- <div style={{ width: '100%', display: 'flex', height: '800px' }}>
16
- <div style={{ width: '50px', position: 'relative' }}>
17
- <div style={{ position: 'absolute' }}>
18
- <Story />
19
- </div>
20
- </div>
21
- <div style={{ width: '100%', height: '60px' }}>
22
- This text is to help illustrate the ability to expand the drawer over content without
23
- shifting it in any way. Simply add a position relative div and place this in a position
24
- absolute div.
25
- </div>
26
- </div>
27
- </MemoryRouter>
28
- ),
29
- ],
30
- };
31
-
32
- export default meta;
33
-
34
- type Story = StoryObj<typeof Drawer>;
35
-
36
- export const Normal: Story = {
37
- args: {
38
- logoText: 'INDICO INSIGHTS',
39
- logoIcon: 'indico-o',
40
- navigationItems: navigationItems,
41
- footerItems: footerItems,
42
- },
43
- };
@@ -1,107 +0,0 @@
1
- /*
2
- ## TODO
3
- -Documentation
4
- -Split header block to its own component.
5
- -Add support for horizontal lines between list items.
6
- -Use variables for styles
7
- -Add toggle options other than mouseover
8
- -Add easy color support
9
- -Add documentation
10
- -Icons should ideally have a size enum
11
- -Combine headerComponent, logoText and logoIcon props into one prop and functionality
12
- */
13
- import React from 'react';
14
- import { IconName, PermafrostComponent } from '@/types';
15
- import { Icon } from '../../Icon';
16
- import { DrawerLinkList } from './DrawerLinkList';
17
- import { ListItem } from './types';
18
- import './Drawer.scss';
19
-
20
- type Props = PermafrostComponent & {
21
- style?: React.CSSProperties;
22
- logoText?: string;
23
- logoIcon?: IconName;
24
- headerComponent?: React.ReactNode;
25
- navigationItems?: ListItem[];
26
- footerItems?: ListItem[];
27
- expandedWidth?: string;
28
- collapsedWidth?: string;
29
- };
30
-
31
- export const Drawer = (props: Props) => {
32
- const {
33
- id,
34
- style = {},
35
- logoText,
36
- logoIcon,
37
- navigationItems,
38
- footerItems,
39
- headerComponent,
40
- expandedWidth = '245px',
41
- collapsedWidth = '50px',
42
- ...restOfProps
43
- } = props;
44
-
45
- const [isOpen, setIsOpen] = React.useState(false);
46
- const handleMouseOver = () => {
47
- setIsOpen(true);
48
- };
49
-
50
- const handleMouseOut = () => {
51
- setIsOpen(false);
52
- };
53
-
54
- const currentWidth = isOpen ? expandedWidth : collapsedWidth;
55
-
56
- return (
57
- <div
58
- id={id}
59
- data-cy={props['data-cy']}
60
- data-testid={props['data-testid']}
61
- style={{
62
- ...style,
63
- }}
64
- {...restOfProps}
65
- onMouseOver={handleMouseOver}
66
- onMouseOut={handleMouseOut}
67
- aria-expanded={isOpen}
68
- >
69
- <div
70
- className={'pf__drawer__wrapper'}
71
- style={{
72
- width: currentWidth,
73
- }}
74
- >
75
- <div className="pf__drawer__header">
76
- {headerComponent ? (
77
- headerComponent
78
- ) : (
79
- <span>
80
- {logoIcon ? <Icon name={logoIcon} size={[24]} data-testid="logo-icon" /> : null}
81
- <p
82
- data-testid="logo-text"
83
- className="pf__drawer__header__logo-text"
84
- aria-hidden={!isOpen}
85
- >
86
- {logoText}
87
- </p>
88
- </span>
89
- )}
90
- </div>
91
- <div className="pf__drawer__content">
92
- {navigationItems?.length ? (
93
- <div className="pf__drawer__navigation" data-testid="drawer-navigation">
94
- <DrawerLinkList isOpen={isOpen} listItems={navigationItems} />
95
- </div>
96
- ) : null}
97
-
98
- {footerItems?.length ? (
99
- <div className="pf__drawer__footer" data-testid="drawer-footer">
100
- <DrawerLinkList isOpen={isOpen} listItems={footerItems} />
101
- </div>
102
- ) : null}
103
- </div>
104
- </div>
105
- </div>
106
- );
107
- };
@@ -1,65 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- export const StyledDrawerLinkList = styled.div`
4
- .drawer__list {
5
- white-space: nowrap;
6
-
7
- .drawer__list__item {
8
- box-sizing: border-box;
9
- margin-bottom: 10px;
10
- font-weight: 500;
11
- font-size: 16px;
12
- display: flex;
13
- align-items: center;
14
- padding-top: 12px;
15
- padding-bottom: 10px;
16
-
17
- &:last-child {
18
- margin-bottom: 0;
19
- }
20
-
21
- &:hover {
22
- color: #6833d0;
23
- background-color: #efebf7;
24
-
25
- a,
26
- &:active {
27
- color: #6833d0;
28
- }
29
- }
30
-
31
- &--active {
32
- color: white;
33
- background-color: #6833d0;
34
- border-radius: 4px;
35
-
36
- a,
37
- &:active {
38
- color: white;
39
- }
40
- }
41
-
42
- .drawer__list__item__link {
43
- font-size: 16px;
44
- display: flex;
45
- align-items: center;
46
-
47
- .drawer__list__item__icon {
48
- width: 22px;
49
- height: 22px;
50
- margin-right: 12px;
51
- margin-left: 10px;
52
- }
53
-
54
- .drawer__list__item__label {
55
- opacity: 1;
56
- }
57
-
58
- .drawer__list__item__label--hidden {
59
- opacity: 0;
60
- transition: all 0.3s ease-out;
61
- }
62
- }
63
- }
64
- }
65
- `;
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import classNames from 'classnames';
3
- import { PermafrostComponent } from '@/types';
4
- import { StyledDrawerLinkList } from './DrawerLinkList.styles';
5
- import { Icon } from '../../Icon';
6
- import { ListItem } from './types';
7
- import { NavLink } from 'react-router-dom';
8
-
9
- type Props = PermafrostComponent & {
10
- style?: object;
11
- listItems?: ListItem[];
12
- isOpen: boolean;
13
- };
14
-
15
- export const DrawerLinkList = (props: Props) => {
16
- const { className, style = {}, id, listItems, isOpen, ...restOfProps } = props;
17
-
18
- return (
19
- <StyledDrawerLinkList
20
- id={id}
21
- data-cy={props['data-cy']}
22
- data-testid={props['data-testid']}
23
- style={style}
24
- {...restOfProps}
25
- className={classNames('drawer__content__list', className)}
26
- >
27
- {listItems && (
28
- <ul className="drawer__list">
29
- {listItems.map((item) => (
30
- <NavLink
31
- key={item.id}
32
- to={item.path}
33
- className={({ isActive, isPending }) => {
34
- return classNames(
35
- 'drawer__list__item',
36
- { 'drawer__list__item--active': isActive },
37
- { 'drawer__list__item--pending': isPending },
38
- );
39
- }}
40
- role="link"
41
- aria-label={item.label}
42
- data-testid={`link-list-item-${item.label}`}
43
- >
44
- <li className="drawer__list__item__link">
45
- <span className={`drawer__list__item__icon`}>
46
- <Icon size={[22]} name={item.icon} ariaLabel={`${item.label} icon`} />
47
- </span>
48
- <span
49
- className={`drawer__list__item__label ${
50
- !isOpen ? 'drawer__list__item__label--hidden' : ''
51
- }`}
52
- aria-hidden={!isOpen}
53
- data-testid="list-item-label"
54
- >
55
- {item.label}
56
- </span>
57
- </li>
58
- </NavLink>
59
- ))}
60
- </ul>
61
- )}
62
- </StyledDrawerLinkList>
63
- );
64
- };
@@ -1,49 +0,0 @@
1
- import { ListItem } from '../types';
2
-
3
- export const navigationItems: ListItem[] = [
4
- {
5
- id: '1',
6
- icon: 'search-thin',
7
- label: 'Search',
8
- path: '/iframe.html',
9
- },
10
- {
11
- id: '4',
12
- icon: 'libraries',
13
- label: 'Libraries',
14
- path: '/',
15
- },
16
- {
17
- id: '2',
18
- icon: 'collection',
19
- label: 'Collections',
20
- path: '/profile',
21
- },
22
- {
23
- id: '3',
24
- icon: 'compare',
25
- label: 'Compare',
26
- path: '/settings',
27
- },
28
- ];
29
-
30
- export const footerItems: ListItem[] = [
31
- {
32
- id: 'foter-1',
33
- icon: 'circle-help',
34
- label: 'Help',
35
- path: '/search',
36
- },
37
- {
38
- id: '4f',
39
- icon: 'cog',
40
- label: 'Settings',
41
- path: '/',
42
- },
43
- {
44
- id: '42',
45
- icon: 'logout',
46
- label: 'Sign Out',
47
- path: '/profile',
48
- },
49
- ];
@@ -1,180 +0,0 @@
1
- it('should render correctly', () => {
2
- // Pending
3
- expect(true).toBe(true);
4
- });
5
-
6
- // import React from 'react';
7
- // import { render, screen } from '@testing-library/react';
8
- // import userEvent from '@testing-library/user-event';
9
- // import { Drawer } from '../Drawer';
10
- // import { navigationItems, footerItems } from '../__mocks__/mocks';
11
- // import { MemoryRouter } from 'react-router-dom';
12
-
13
- // let navDrawer: HTMLElement;
14
-
15
- // describe('Drawer', () => {
16
- // describe('expanded interactions', () => {
17
- // beforeEach(() => {
18
- // render(
19
- // <MemoryRouter>
20
- // <Drawer
21
- // logoIcon={'indico-o'}
22
- // logoText={'INDICO INSIGHTS'}
23
- // navigationItems={navigationItems}
24
- // footerItems={footerItems}
25
- // $expandedWidth="300"
26
- // $collapsedWidth="45"
27
- // data-testid="navigation__drawer"
28
- // />
29
- // ,
30
- // </MemoryRouter>,
31
- // );
32
- // navDrawer = screen.getByTestId('navigation__drawer');
33
- // });
34
-
35
- // it('opens the drawer when the mouse is over the drawer', async () => {
36
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'false');
37
-
38
- // await userEvent.hover(navDrawer);
39
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'true');
40
- // });
41
-
42
- // it('closes the drawer when the mouse is over the drawer and then leaves the drawer', async () => {
43
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'false');
44
- // await userEvent.hover(navDrawer);
45
-
46
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'true');
47
- // await userEvent.unhover(navDrawer);
48
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'false');
49
- // });
50
- // });
51
-
52
- // describe('styling', () => {
53
- // beforeEach(() => {
54
- // render(
55
- // <MemoryRouter>
56
- // <Drawer
57
- // logoIcon={'indico-o'}
58
- // logoText={'INDICO INSIGHTS'}
59
- // navigationItems={navigationItems}
60
- // footerItems={footerItems}
61
- // $expandedWidth="400"
62
- // $collapsedWidth="45"
63
- // data-testid="navigation__drawer"
64
- // />
65
- // ,
66
- // </MemoryRouter>,
67
- // );
68
- // navDrawer = screen.getByTestId('navigation__drawer');
69
- // });
70
-
71
- // it('applies the drawer--open class to the component when the drawer is open', async () => {
72
- // expect(navDrawer).toHaveClass('drawer--closed');
73
- // await userEvent.hover(navDrawer);
74
-
75
- // expect(navDrawer).toHaveAttribute('aria-expanded', 'true');
76
- // expect(navDrawer).toHaveClass('drawer--open');
77
- // });
78
-
79
- // it('applies the drawer--closed class to the component when the drawer is closed', async () => {
80
- // expect(navDrawer).toHaveClass('drawer--closed');
81
- // await userEvent.hover(navDrawer);
82
-
83
- // expect(navDrawer).toHaveClass('drawer--open');
84
- // await userEvent.unhover(navDrawer);
85
- // expect(navDrawer).toHaveClass('drawer--closed');
86
- // });
87
-
88
- // it('sets the drawer width to the min width value passed in as a prop when drawer is closed', () => {
89
- // expect(navDrawer).toHaveClass('drawer--closed');
90
- // expect(navDrawer).toHaveStyle({ width: '45px' });
91
- // });
92
-
93
- // it('sets the drawer width to the max width value passed in as a prop when drawer is open', async () => {
94
- // await userEvent.hover(navDrawer);
95
-
96
- // expect(navDrawer).toHaveClass('drawer--open');
97
- // expect(navDrawer).toHaveStyle({ width: '400px' });
98
- // });
99
- // });
100
-
101
- // describe('Logo and Header Display', () => {
102
- // it('displays the header component when one is provided', () => {
103
- // render(
104
- // <MemoryRouter>
105
- // <Drawer
106
- // navigationItems={navigationItems}
107
- // footerItems={footerItems}
108
- // data-testid="navigation__drawer"
109
- // $expandedWidth="400"
110
- // $collapsedWidth="45"
111
- // headerComponent={<div>Header Component</div>}
112
- // />
113
- // ,
114
- // </MemoryRouter>,
115
- // );
116
-
117
- // navDrawer = screen.getByTestId('navigation__drawer');
118
-
119
- // expect(screen.getByText('Header Component')).toBeInTheDocument();
120
- // });
121
- // it('displays the logo icon and text when no header component is provided', async () => {
122
- // render(
123
- // <MemoryRouter>
124
- // <Drawer
125
- // logoIcon={'indico-o'}
126
- // logoText={'INDICO INSIGHTS'}
127
- // navigationItems={navigationItems}
128
- // footerItems={footerItems}
129
- // data-testid="navigation__drawer"
130
- // />
131
- // ,
132
- // </MemoryRouter>,
133
- // );
134
- // navDrawer = screen.getByTestId('navigation__drawer');
135
-
136
- // await userEvent.hover(navDrawer);
137
- // const logoIcon = screen.getByTestId('logo-icon');
138
- // const logoText = screen.getByText('INDICO INSIGHTS');
139
-
140
- // expect(logoIcon).toBeInTheDocument();
141
- // expect(logoText).toBeInTheDocument();
142
- // expect(logoText).toHaveAttribute('aria-hidden', 'false');
143
- // expect(logoText).toBeVisible();
144
- // expect(logoIcon).toBeVisible();
145
- // });
146
- // });
147
- // describe('Conditional Rendering Of Lists', () => {
148
- // it('does not display nav or footer lists if props are empty', () => {
149
- // render(
150
- // <MemoryRouter>
151
- // <Drawer navigationItems={[]} footerItems={[]} data-testid="navigation__drawer" />,
152
- // </MemoryRouter>,
153
- // );
154
-
155
- // const nav = screen.queryByTestId('drawer-navigation');
156
- // const footer = screen.queryByTestId('drawer-footer');
157
-
158
- // expect(nav).not.toBeInTheDocument();
159
- // expect(footer).not.toBeInTheDocument();
160
- // });
161
- // it('displays nav and footer lists if props are not empty', () => {
162
- // render(
163
- // <MemoryRouter>
164
- // <Drawer
165
- // navigationItems={navigationItems}
166
- // footerItems={footerItems}
167
- // data-testid="navigation__drawer"
168
- // />
169
- // ,
170
- // </MemoryRouter>,
171
- // );
172
-
173
- // const nav = screen.getByTestId('drawer-navigation');
174
- // const footer = screen.getByTestId('drawer-footer');
175
-
176
- // expect(nav).toBeInTheDocument();
177
- // expect(footer).toBeInTheDocument();
178
- // });
179
- // });
180
- // });
@@ -1,66 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { DrawerLinkList } from '../DrawerLinkList';
4
- import { navigationItems } from '../__mocks__/mocks';
5
- import { MemoryRouter } from 'react-router-dom';
6
-
7
- describe('DrawerLinkList', () => {
8
- describe('expanded interactions', () => {
9
- it('it renders the correct number of items in the list', () => {
10
- render(
11
- <MemoryRouter>
12
- <DrawerLinkList isOpen={true} listItems={navigationItems} />
13
- </MemoryRouter>,
14
- );
15
-
16
- const list = screen.getAllByRole('listitem');
17
- expect(list).toHaveLength(navigationItems.length);
18
- });
19
-
20
- // NOTE, the default path for the purpose of this test is `/` which matches the prop value.
21
- it('hides the label when isOpen is false', () => {
22
- render(
23
- <MemoryRouter>
24
- <DrawerLinkList isOpen={false} listItems={navigationItems} />
25
- </MemoryRouter>,
26
- );
27
-
28
- const items = screen.queryAllByTestId('list-item-label');
29
- items.map((item) => {
30
- expect(item).not.toBeVisible();
31
- });
32
- });
33
- it('shows the label when isOpen is true', () => {
34
- render(
35
- <MemoryRouter>
36
- <DrawerLinkList isOpen={true} listItems={navigationItems} />
37
- </MemoryRouter>,
38
- );
39
-
40
- const items = screen.queryAllByTestId('list-item-label');
41
- items.map((item) => {
42
- expect(item).toBeVisible();
43
- });
44
- });
45
- it('sets active class on handleActiveLink match', () => {
46
- render(
47
- <MemoryRouter>
48
- <DrawerLinkList isOpen={true} listItems={navigationItems} />
49
- </MemoryRouter>,
50
- );
51
-
52
- const lineItem = screen.getByTestId('link-list-item-Libraries');
53
- expect(lineItem).toHaveClass('drawer__list__item--active');
54
- });
55
- it('does not render a list when no items are passed to the component', () => {
56
- render(
57
- <MemoryRouter>
58
- <DrawerLinkList isOpen={true} listItems={[]} />
59
- </MemoryRouter>,
60
- );
61
-
62
- const list = screen.queryAllByRole('listitem');
63
- expect(list).toHaveLength(0);
64
- });
65
- });
66
- });
@@ -1 +0,0 @@
1
- export { Drawer } from './Drawer';
@@ -1,8 +0,0 @@
1
- import { IconName } from '@/types';
2
-
3
- export type ListItem = {
4
- id: string;
5
- icon: IconName;
6
- label: string;
7
- path: string;
8
- };
@@ -1 +0,0 @@
1
- export { Drawer } from './Drawer';