@indico-data/design-system 2.1.2 → 2.2.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 (307) hide show
  1. package/README.md +10 -1
  2. package/lib/build/generated/iconTypes.d.ts +2 -0
  3. package/lib/index.css +37 -0
  4. package/lib/index.d.ts +11 -1364
  5. package/lib/index.esm.css +37 -0
  6. package/lib/index.esm.js +28288 -12273
  7. package/lib/index.esm.js.map +1 -1
  8. package/lib/index.js +28289 -12276
  9. package/lib/index.js.map +1 -1
  10. package/lib/{components → src/components}/button/types.d.ts +1 -1
  11. package/lib/src/components/icons/Icon.d.ts +4 -0
  12. package/lib/src/components/icons/Icon.stories.d.ts +10 -0
  13. package/lib/src/components/icons/index.d.ts +1 -0
  14. package/lib/src/components/icons/types.d.ts +10 -0
  15. package/lib/{components → src/components}/index.d.ts +1 -0
  16. package/lib/src/index.d.ts +8 -0
  17. package/lib/{legacy → src/legacy}/components/Toggle/Toggle.d.ts +2 -1
  18. package/lib/src/legacy/components/Toggle/Toggle.stories.d.ts +21 -0
  19. package/lib/{legacy → src/legacy}/components/index.d.ts +0 -1
  20. package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.d.ts +2 -1
  21. package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +3 -4
  22. package/lib/src/legacy/components/text-truncate/TextTruncate.test.d.ts +1 -0
  23. package/lib/src/types.d.ts +12 -0
  24. package/package.json +17 -14
  25. package/rollup.config.mjs +2 -2
  26. package/scripts/generateIconTypes.js +50 -0
  27. package/src/components/button/Button.tsx +1 -2
  28. package/src/components/button/types.ts +2 -1
  29. package/src/components/icons/Icon.mdx +49 -0
  30. package/src/components/icons/Icon.stories.tsx +248 -0
  31. package/src/components/icons/Icon.tsx +45 -0
  32. package/src/components/icons/__tests__/Icon.test.tsx +104 -0
  33. package/src/components/icons/index.ts +1 -0
  34. package/src/{legacy/components/Icon → components/icons}/indicons.tsx +17 -17
  35. package/src/components/icons/styles/Icon.scss +23 -0
  36. package/src/components/icons/types.ts +12 -0
  37. package/src/components/index.ts +1 -0
  38. package/src/index.ts +1 -3
  39. package/src/legacy/components/Accordion/Accordion.tsx +2 -2
  40. package/src/legacy/components/ListTable/Header/Header.tsx +1 -2
  41. package/src/legacy/components/ListTable/ListTable.stories.tsx +2 -1
  42. package/src/legacy/components/Navigation/Drawer/Drawer.tsx +2 -2
  43. package/src/legacy/components/Navigation/Drawer/DrawerLinkList.tsx +2 -2
  44. package/src/legacy/components/Toggle/Toggle.styles.ts +1 -1
  45. package/src/legacy/components/Toggle/Toggle.tsx +17 -4
  46. package/src/legacy/components/basic-section/SectionTable/SectionTable.tsx +1 -1
  47. package/src/legacy/components/buttons/Button/Button.tsx +1 -1
  48. package/src/legacy/components/buttons/IconButton/IconButton.tsx +2 -2
  49. package/src/legacy/components/dropdowns/BorderSelect/BorderSelect.tsx +1 -1
  50. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +8 -7
  51. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +3 -1
  52. package/src/legacy/components/dropdowns/MultiCombobox/MultiCombobox.tsx +2 -2
  53. package/src/legacy/components/dropdowns/Select/Select.tsx +3 -3
  54. package/src/legacy/components/dropdowns/SingleCombobox/SingleCombobox.tsx +2 -2
  55. package/src/legacy/components/index.ts +1 -1
  56. package/src/legacy/components/inputs/EditableInput/EditableInput.tsx +1 -1
  57. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.tsx +2 -2
  58. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +5 -4
  59. package/src/legacy/components/inputs/NumberInput/NumberInput.tsx +1 -1
  60. package/src/legacy/components/inputs/SearchInput/SearchInput.tsx +1 -1
  61. package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +8 -8
  62. package/src/legacy/components/user-feedback/Shrug/Shrug.styles.ts +2 -0
  63. package/src/legacy/components/user-feedback/Shrug/Shrug.tsx +4 -4
  64. package/src/styles/index.scss +1 -0
  65. package/src/styles/variables/_icons.scss +7 -0
  66. package/src/styles/variables/index.scss +2 -1
  67. package/src/types.ts +3 -10
  68. package/tsconfig.json +1 -1
  69. package/lib/legacy/components/Icon/Icon.d.ts +0 -17
  70. package/lib/legacy/components/Icon/Icon.stories.d.ts +0 -42
  71. package/lib/legacy/components/Icon/faIcons.d.ts +0 -76
  72. package/lib/legacy/components/Icon/index.d.ts +0 -3
  73. package/lib/legacy/components/Icon/storyHelpers.d.ts +0 -9
  74. package/lib/legacy/components/Toggle/Toggle.stories.d.ts +0 -21
  75. package/lib/types.d.ts +0 -231
  76. package/src/legacy/components/Icon/Icon.stories.tsx +0 -61
  77. package/src/legacy/components/Icon/Icon.tsx +0 -76
  78. package/src/legacy/components/Icon/faIcons.tsx +0 -168
  79. package/src/legacy/components/Icon/index.ts +0 -3
  80. package/src/legacy/components/Icon/storyHelpers.tsx +0 -88
  81. /package/lib/{components → src/components}/button/Button.d.ts +0 -0
  82. /package/lib/{components → src/components}/button/Button.stories.d.ts +0 -0
  83. /package/lib/{components → src/components}/button/__tests__/Button.test.d.ts +0 -0
  84. /package/lib/{components → src/components}/button/enums.d.ts +0 -0
  85. /package/lib/{components → src/components}/button/index.d.ts +0 -0
  86. /package/lib/{components → src/components}/grid/col/Col.d.ts +0 -0
  87. /package/lib/{components → src/components}/grid/col/Col.stories.d.ts +0 -0
  88. /package/lib/{components → src/components}/grid/container/Container.d.ts +0 -0
  89. /package/lib/{components → src/components}/grid/container/Container.stories.d.ts +0 -0
  90. /package/lib/{components → src/components}/grid/index.d.ts +0 -0
  91. /package/lib/{components → src/components}/grid/row/Row.d.ts +0 -0
  92. /package/lib/{components → src/components}/grid/row/Row.stories.d.ts +0 -0
  93. /package/lib/{legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.d.ts → src/components/icons/__tests__/Icon.test.d.ts} +0 -0
  94. /package/lib/{legacy/components/Icon → src/components/icons}/indicons.d.ts +0 -0
  95. /package/lib/{legacy → src/legacy}/components/Accordion/Accordion.d.ts +0 -0
  96. /package/lib/{legacy → src/legacy}/components/Accordion/Accordion.stories.d.ts +0 -0
  97. /package/lib/{legacy → src/legacy}/components/Accordion/Accordion.styles.d.ts +0 -0
  98. /package/lib/{legacy → src/legacy}/components/Accordion/index.d.ts +0 -0
  99. /package/lib/{legacy → src/legacy}/components/ListTable/Header/Header.d.ts +0 -0
  100. /package/lib/{legacy → src/legacy}/components/ListTable/Header/Header.styles.d.ts +0 -0
  101. /package/lib/{legacy → src/legacy}/components/ListTable/Header/index.d.ts +0 -0
  102. /package/lib/{legacy → src/legacy}/components/ListTable/ListTable.d.ts +0 -0
  103. /package/lib/{legacy → src/legacy}/components/ListTable/ListTable.stories.d.ts +0 -0
  104. /package/lib/{legacy → src/legacy}/components/ListTable/ListTable.styles.d.ts +0 -0
  105. /package/lib/{legacy → src/legacy}/components/ListTable/index.d.ts +0 -0
  106. /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/index.d.ts +0 -0
  107. /package/lib/{legacy → src/legacy}/components/ListTable/mock-data/mock-data.d.ts +0 -0
  108. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.d.ts +0 -0
  109. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.stories.d.ts +0 -0
  110. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/LoadingAwareContainer.styles.d.ts +0 -0
  111. /package/lib/{legacy → src/legacy}/components/LoadingAwareContainer/index.d.ts +0 -0
  112. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/Drawer.d.ts +0 -0
  113. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/Drawer.stories.d.ts +0 -0
  114. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/DrawerLinkList.d.ts +0 -0
  115. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/DrawerLinkList.styles.d.ts +0 -0
  116. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/__mocks__/mocks.d.ts +0 -0
  117. /package/lib/{legacy/components/text-truncate/TextTruncate.test.d.ts → src/legacy/components/Navigation/Drawer/__tests__/DrawerLinkList.test.d.ts} +0 -0
  118. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/index.d.ts +0 -0
  119. /package/lib/{legacy → src/legacy}/components/Navigation/Drawer/types.d.ts +0 -0
  120. /package/lib/{legacy → src/legacy}/components/Navigation/index.d.ts +0 -0
  121. /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.d.ts +0 -0
  122. /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.stories.d.ts +0 -0
  123. /package/lib/{legacy → src/legacy}/components/Pagination/Pagination.styles.d.ts +0 -0
  124. /package/lib/{legacy → src/legacy}/components/Pagination/index.d.ts +0 -0
  125. /package/lib/{legacy → src/legacy}/components/Toggle/Toggle.styles.d.ts +0 -0
  126. /package/lib/{legacy → src/legacy}/components/Toggle/index.d.ts +0 -0
  127. /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.d.ts +0 -0
  128. /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.stories.d.ts +0 -0
  129. /package/lib/{legacy → src/legacy}/components/Tooltip/Tooltip.styles.d.ts +0 -0
  130. /package/lib/{legacy → src/legacy}/components/Tooltip/index.d.ts +0 -0
  131. /package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.d.ts +0 -0
  132. /package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.stories.d.ts +0 -0
  133. /package/lib/{legacy → src/legacy}/components/basic-section/Section/Section.styles.d.ts +0 -0
  134. /package/lib/{legacy → src/legacy}/components/basic-section/Section/index.d.ts +0 -0
  135. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/SectionBlock.d.ts +0 -0
  136. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/SectionBlock.styles.d.ts +0 -0
  137. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBlock/index.d.ts +0 -0
  138. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.d.ts +0 -0
  139. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.stories.d.ts +0 -0
  140. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/SectionBody.styles.d.ts +0 -0
  141. /package/lib/{legacy → src/legacy}/components/basic-section/SectionBody/index.d.ts +0 -0
  142. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.d.ts +0 -0
  143. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.stories.d.ts +0 -0
  144. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/SectionHeader.styles.d.ts +0 -0
  145. /package/lib/{legacy → src/legacy}/components/basic-section/SectionHeader/index.d.ts +0 -0
  146. /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/SectionTable.d.ts +0 -0
  147. /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/SectionTable.styles.d.ts +0 -0
  148. /package/lib/{legacy → src/legacy}/components/basic-section/SectionTable/index.d.ts +0 -0
  149. /package/lib/{legacy → src/legacy}/components/basic-section/index.d.ts +0 -0
  150. /package/lib/{legacy → src/legacy}/components/buttons/Button/Button.d.ts +0 -0
  151. /package/lib/{legacy → src/legacy}/components/buttons/Button/Button.stories.d.ts +0 -0
  152. /package/lib/{legacy → src/legacy}/components/buttons/Button/Button.styles.d.ts +0 -0
  153. /package/lib/{legacy → src/legacy}/components/buttons/Button/index.d.ts +0 -0
  154. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.d.ts +0 -0
  155. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.stories.d.ts +0 -0
  156. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/IconButton.styles.d.ts +0 -0
  157. /package/lib/{legacy → src/legacy}/components/buttons/IconButton/index.d.ts +0 -0
  158. /package/lib/{legacy → src/legacy}/components/buttons/commonStyles.d.ts +0 -0
  159. /package/lib/{legacy → src/legacy}/components/buttons/index.d.ts +0 -0
  160. /package/lib/{legacy → src/legacy}/components/buttons/types.d.ts +0 -0
  161. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.d.ts +0 -0
  162. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.stories.d.ts +0 -0
  163. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/BorderSelect.styles.d.ts +0 -0
  164. /package/lib/{legacy → src/legacy}/components/dropdowns/BorderSelect/index.d.ts +0 -0
  165. /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.d.ts +0 -0
  166. /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.stories.d.ts +0 -0
  167. /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/MultiCombobox.styles.d.ts +0 -0
  168. /package/lib/{legacy → src/legacy}/components/dropdowns/MultiCombobox/index.d.ts +0 -0
  169. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.d.ts +0 -0
  170. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.stories.d.ts +0 -0
  171. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/Select.styles.d.ts +0 -0
  172. /package/lib/{legacy → src/legacy}/components/dropdowns/Select/index.d.ts +0 -0
  173. /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.d.ts +0 -0
  174. /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.stories.d.ts +0 -0
  175. /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/SingleCombobox.styles.d.ts +0 -0
  176. /package/lib/{legacy → src/legacy}/components/dropdowns/SingleCombobox/index.d.ts +0 -0
  177. /package/lib/{legacy → src/legacy}/components/dropdowns/commonStyles.d.ts +0 -0
  178. /package/lib/{legacy → src/legacy}/components/dropdowns/index.d.ts +0 -0
  179. /package/lib/{legacy → src/legacy}/components/dropdowns/types.d.ts +0 -0
  180. /package/lib/{legacy → src/legacy}/components/dropdowns/useCombobox.d.ts +0 -0
  181. /package/lib/{legacy → src/legacy}/components/dropdowns/utils.d.ts +0 -0
  182. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.d.ts +0 -0
  183. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.stories.d.ts +0 -0
  184. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/DatePicker.styles.d.ts +0 -0
  185. /package/lib/{legacy → src/legacy}/components/inputs/DatePicker/index.d.ts +0 -0
  186. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.d.ts +0 -0
  187. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.stories.d.ts +0 -0
  188. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/EditableInput.styles.d.ts +0 -0
  189. /package/lib/{legacy → src/legacy}/components/inputs/EditableInput/index.d.ts +0 -0
  190. /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.d.ts +0 -0
  191. /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -0
  192. /package/lib/{legacy → src/legacy}/components/inputs/NoInputDatePicker/index.d.ts +0 -0
  193. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.d.ts +0 -0
  194. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.stories.d.ts +0 -0
  195. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/NumberInput.styles.d.ts +0 -0
  196. /package/lib/{legacy → src/legacy}/components/inputs/NumberInput/index.d.ts +0 -0
  197. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.d.ts +0 -0
  198. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.stories.d.ts +0 -0
  199. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/RadioButtons.styles.d.ts +0 -0
  200. /package/lib/{legacy → src/legacy}/components/inputs/RadioButtons/index.d.ts +0 -0
  201. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.d.ts +0 -0
  202. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.stories.d.ts +0 -0
  203. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/RadioGroup.styles.d.ts +0 -0
  204. /package/lib/{legacy → src/legacy}/components/inputs/RadioGroup/index.d.ts +0 -0
  205. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.d.ts +0 -0
  206. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.stories.d.ts +0 -0
  207. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/SearchInput.styles.d.ts +0 -0
  208. /package/lib/{legacy → src/legacy}/components/inputs/SearchInput/index.d.ts +0 -0
  209. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.d.ts +0 -0
  210. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.stories.d.ts +0 -0
  211. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/TextInput.styles.d.ts +0 -0
  212. /package/lib/{legacy → src/legacy}/components/inputs/TextInput/index.d.ts +0 -0
  213. /package/lib/{legacy → src/legacy}/components/inputs/index.d.ts +0 -0
  214. /package/lib/{legacy → src/legacy}/components/inputs/inputsCommon.styles.d.ts +0 -0
  215. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.d.ts +0 -0
  216. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +0 -0
  217. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +0 -0
  218. /package/lib/{legacy → src/legacy}/components/loading-indicators/BarSpinner/index.d.ts +0 -0
  219. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.d.ts +0 -0
  220. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +0 -0
  221. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +0 -0
  222. /package/lib/{legacy → src/legacy}/components/loading-indicators/CirclePulse/index.d.ts +0 -0
  223. /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/CircleSpinner.stories.d.ts +0 -0
  224. /package/lib/{legacy → src/legacy}/components/loading-indicators/CircleSpinner/index.d.ts +0 -0
  225. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.d.ts +0 -0
  226. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -0
  227. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/LoadingIndicator.styles.d.ts +0 -0
  228. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingIndicator/index.d.ts +0 -0
  229. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.d.ts +0 -0
  230. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.stories.d.ts +0 -0
  231. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/LoadingList.styles.d.ts +0 -0
  232. /package/lib/{legacy → src/legacy}/components/loading-indicators/LoadingList/index.d.ts +0 -0
  233. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.d.ts +0 -0
  234. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.stories.d.ts +0 -0
  235. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/PercentageRing.styles.d.ts +0 -0
  236. /package/lib/{legacy → src/legacy}/components/loading-indicators/PercentageRing/index.d.ts +0 -0
  237. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.d.ts +0 -0
  238. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.d.ts +0 -0
  239. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/index.d.ts +0 -0
  240. /package/lib/{legacy → src/legacy}/components/loading-indicators/RandomLoadingMessage/random-messages.d.ts +0 -0
  241. /package/lib/{legacy → src/legacy}/components/loading-indicators/index.d.ts +0 -0
  242. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.d.ts +0 -0
  243. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.stories.d.ts +0 -0
  244. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +0 -0
  245. /package/lib/{legacy → src/legacy}/components/modals/ConfirmModal/index.d.ts +0 -0
  246. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.d.ts +0 -0
  247. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.stories.d.ts +0 -0
  248. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/ModalBase.styles.d.ts +0 -0
  249. /package/lib/{legacy → src/legacy}/components/modals/ModalBase/index.d.ts +0 -0
  250. /package/lib/{legacy → src/legacy}/components/modals/index.d.ts +0 -0
  251. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.d.ts +0 -0
  252. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.stories.d.ts +0 -0
  253. /package/lib/{legacy → src/legacy}/components/text-truncate/TextTruncate.styles.d.ts +0 -0
  254. /package/lib/{legacy → src/legacy}/components/text-truncate/index.d.ts +0 -0
  255. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.d.ts +0 -0
  256. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.stories.d.ts +0 -0
  257. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/Shrug.styles.d.ts +0 -0
  258. /package/lib/{legacy → src/legacy}/components/user-feedback/Shrug/index.d.ts +0 -0
  259. /package/lib/{legacy → src/legacy}/components/user-feedback/index.d.ts +0 -0
  260. /package/lib/{legacy → src/legacy}/styles/globals/buttons.d.ts +0 -0
  261. /package/lib/{legacy → src/legacy}/styles/globals/forms.d.ts +0 -0
  262. /package/lib/{legacy → src/legacy}/styles/globals/index.d.ts +0 -0
  263. /package/lib/{legacy → src/legacy}/styles/globals/layout.d.ts +0 -0
  264. /package/lib/{legacy → src/legacy}/styles/globals/lists.d.ts +0 -0
  265. /package/lib/{legacy → src/legacy}/styles/globals/margin-padding.d.ts +0 -0
  266. /package/lib/{legacy → src/legacy}/styles/globals/media.d.ts +0 -0
  267. /package/lib/{legacy → src/legacy}/styles/globals/tables.d.ts +0 -0
  268. /package/lib/{legacy → src/legacy}/styles/globals/typography.d.ts +0 -0
  269. /package/lib/{legacy → src/legacy}/styles/globals/utility-classes.d.ts +0 -0
  270. /package/lib/{legacy → src/legacy}/styles/index.d.ts +0 -0
  271. /package/lib/{legacy → src/legacy}/tokens/animation.d.ts +0 -0
  272. /package/lib/{legacy → src/legacy}/tokens/breakpoints.d.ts +0 -0
  273. /package/lib/{legacy → src/legacy}/tokens/colors.d.ts +0 -0
  274. /package/lib/{legacy → src/legacy}/tokens/index.d.ts +0 -0
  275. /package/lib/{legacy → src/legacy}/tokens/margin.d.ts +0 -0
  276. /package/lib/{legacy → src/legacy}/tokens/numbers.d.ts +0 -0
  277. /package/lib/{legacy → src/legacy}/tokens/padding.d.ts +0 -0
  278. /package/lib/{legacy → src/legacy}/tokens/spacings.d.ts +0 -0
  279. /package/lib/{legacy → src/legacy}/tokens/typography.d.ts +0 -0
  280. /package/lib/{legacy → src/legacy}/utils/color.d.ts +0 -0
  281. /package/lib/{legacy → src/legacy}/utils/index.d.ts +0 -0
  282. /package/lib/{legacy → src/legacy}/utils/number.d.ts +0 -0
  283. /package/lib/{legacy → src/legacy}/utils/string.d.ts +0 -0
  284. /package/lib/{setupTests.d.ts → src/setupTests.d.ts} +0 -0
  285. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.d.ts +0 -0
  286. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderColor.stories.d.ts +0 -0
  287. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.d.ts +0 -0
  288. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderRadius.stories.d.ts +0 -0
  289. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.d.ts +0 -0
  290. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderStyles.stories.d.ts +0 -0
  291. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.d.ts +0 -0
  292. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/BorderThickness.stories.d.ts +0 -0
  293. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/borders/index.d.ts +0 -0
  294. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.d.ts +0 -0
  295. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Colors.stories.d.ts +0 -0
  296. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/Swatch.d.ts +0 -0
  297. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.d.ts +0 -0
  298. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/UtilityClasses.stories.d.ts +0 -0
  299. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/constants.d.ts +0 -0
  300. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/hooks.d.ts +0 -0
  301. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/colors/index.d.ts +0 -0
  302. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.d.ts +0 -0
  303. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/Sizing.stories.d.ts +0 -0
  304. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/sizing/index.d.ts +0 -0
  305. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.d.ts +0 -0
  306. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/Typography.stories.d.ts +0 -0
  307. /package/lib/{stylesAndAnimations → src/stylesAndAnimations}/typography/index.d.ts +0 -0
@@ -0,0 +1,49 @@
1
+ import { Meta, Canvas, Controls, Story } from '@storybook/blocks';
2
+ import * as IconStories from './Icon.stories';
3
+ import { Col, Row } from '../grid/';
4
+
5
+ <Meta title="Components/Icon" name="Icon" of={IconStories} />
6
+
7
+ # Icon
8
+
9
+ The `Icon` component provides unified rendering of both custom SVG icons (Indicons) and FontAwesome icons.
10
+
11
+ <Canvas
12
+ of={IconStories.DefaultIcon}
13
+ source={{
14
+ code: `<Icon name="indico-o" />`,
15
+ }}
16
+ />
17
+
18
+ ## Props
19
+
20
+ <Controls of={IconStories.DefaultIcon} />
21
+
22
+ ## Sizes
23
+
24
+ The `Icon` component supports five predefined sizes:
25
+
26
+ <Story of={IconStories.IconStates} />
27
+
28
+ ## Custom Styling
29
+
30
+ You can use the `className` prop to apply custom styles to the icons.
31
+
32
+ <Story of={IconStories.CustomStyledIcon} />
33
+ ```tsx // .tsx
34
+ <Icon name="fa-mountain-sun" className="color-primary-600" />
35
+ ```
36
+
37
+ ## Indicons (Custom Icons)
38
+
39
+ Indicons are custom SVG icons created specifically for our design system. Below is a list of all available custom icons.
40
+
41
+ <Story of={IconStories.Indicons} />
42
+ ## Font Awesome Icons
43
+
44
+ Font Awesome provides a wide range of icons for various purposes. Below is a list
45
+ of FontAwesome icons available in our design system. Use the search bar to find specific icons, and navigate
46
+ through the pages to explore all icons.
47
+
48
+ <Story of={IconStories.FontAwesomeIcons} />
49
+ ```
@@ -0,0 +1,248 @@
1
+ import React, { useState } from 'react';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import Icon from './Icon';
4
+ import { IconProps, IconSizes } from './types';
5
+
6
+ import { Row, Col } from '../grid/';
7
+ import { Button } from '../button';
8
+ import { iconNames } from 'build/generated/iconTypes';
9
+
10
+ const meta: Meta = {
11
+ title: 'Components/Icon',
12
+ component: Icon,
13
+ argTypes: {
14
+ id: {
15
+ control: 'text',
16
+ description: 'Unique identifier for the icon',
17
+ table: {
18
+ type: { summary: 'string' },
19
+ },
20
+ },
21
+ name: {
22
+ control: 'select',
23
+ options: iconNames,
24
+ description: 'The name of the icon',
25
+ table: {
26
+ type: { summary: 'string' },
27
+ },
28
+ },
29
+ ariaLabel: {
30
+ control: 'text',
31
+ description: 'Accessible label for the icon',
32
+ table: {
33
+ type: { summary: 'string' },
34
+ category: 'accessibility',
35
+ },
36
+ },
37
+ className: {
38
+ control: 'text',
39
+ description: 'Additional custom class names',
40
+ table: {
41
+ type: { summary: 'string' },
42
+ category: 'styling',
43
+ },
44
+ },
45
+ size: {
46
+ control: 'select',
47
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
48
+ description: 'Size of the icon',
49
+ table: {
50
+ type: { summary: 'xs | sm | md | lg | xl' },
51
+ category: 'styling',
52
+ },
53
+ },
54
+ style: {
55
+ control: 'object',
56
+ description: 'Inline styles for the icon',
57
+ table: {
58
+ type: { summary: 'React.CSSProperties' },
59
+ category: 'styling',
60
+ },
61
+ },
62
+ onClick: {
63
+ action: 'clicked',
64
+ description: 'Click event handler',
65
+ table: {
66
+ type: { summary: 'MouseEventHandler<SVGElement>' },
67
+ category: 'callbacks',
68
+ },
69
+ },
70
+ },
71
+ };
72
+ export default meta;
73
+
74
+ type Story = StoryObj<IconProps>;
75
+
76
+ export const DefaultIcon: Story = {
77
+ args: {
78
+ name: 'indico-o',
79
+ size: 'md',
80
+ },
81
+ };
82
+
83
+ export const IconStates: Story = {
84
+ render: (args) => {
85
+ const sizes: IconSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];
86
+ const rems = ['0.6rem', '0.75rem', '1rem', '1.5rem', '2rem'];
87
+ return (
88
+ <Row>
89
+ {sizes.map((size, idx) => (
90
+ <Col xs={2} key={`${args.name}-${size}`}>
91
+ <div style={{ height: 32 }}>
92
+ <Icon name={args.name} size={size} />
93
+ </div>
94
+ <div className="mt-2 text-body-2">{`${size} (${rems[idx]})`}</div>
95
+ </Col>
96
+ ))}
97
+ </Row>
98
+ );
99
+ },
100
+ args: {
101
+ name: 'fa-rocket',
102
+ },
103
+ };
104
+
105
+ export const CustomStyledIcon: Story = {
106
+ render: () => {
107
+ return <Icon name="fa-mountain-sun" className="color-primary-600" />;
108
+ },
109
+ };
110
+
111
+ export const Indicons: Story = {
112
+ render: (args) => {
113
+ const [searchQuery, setSearchQuery] = useState('');
114
+
115
+ // Filter custom icons based on the search query
116
+ const filteredIcons = iconNames.filter(
117
+ (iconName) =>
118
+ !iconName.startsWith('fa') && iconName.toLowerCase().includes(searchQuery.toLowerCase()),
119
+ );
120
+
121
+ const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
122
+ setSearchQuery(event.target.value);
123
+ };
124
+
125
+ return (
126
+ <div>
127
+ <Row className="mb-5 text-align--center">
128
+ <Col xs={12}>
129
+ <input
130
+ type="text"
131
+ placeholder="Search Indicons..."
132
+ value={searchQuery}
133
+ onChange={handleSearchChange}
134
+ className="border-primary rounded pa-2"
135
+ style={{
136
+ width: '80%',
137
+ maxWidth: '400px',
138
+ }}
139
+ />
140
+ </Col>
141
+ </Row>
142
+ <Row>
143
+ {filteredIcons.map((iconName) => (
144
+ <Col xs={6} sm={4} md={3} lg={2} key={iconName} className="text-align--center">
145
+ <div className="pa-3">
146
+ <Icon name={iconName} size={args.size} />
147
+ <div className="mt-2 text-body-2">{iconName}</div>
148
+ </div>
149
+ </Col>
150
+ ))}
151
+ </Row>
152
+ </div>
153
+ );
154
+ },
155
+ args: {
156
+ size: 'md',
157
+ },
158
+ };
159
+
160
+ export const FontAwesomeIcons: Story = {
161
+ render: (args) => {
162
+ const [currentPage, setCurrentPage] = useState(1);
163
+ const [searchQuery, setSearchQuery] = useState('');
164
+ const iconsPerPage = 60;
165
+
166
+ // Filter FontAwesome icons based on the search query
167
+ const filteredIcons = iconNames.filter(
168
+ (iconName) =>
169
+ iconName.startsWith('fa') && iconName.toLowerCase().includes(searchQuery.toLowerCase()),
170
+ );
171
+
172
+ // Calculate the indexes of the icons to display
173
+ const indexOfLastIcon = currentPage * iconsPerPage;
174
+ const indexOfFirstIcon = indexOfLastIcon - iconsPerPage;
175
+
176
+ const currentIcons = filteredIcons.slice(indexOfFirstIcon, indexOfLastIcon);
177
+ const totalPages = Math.ceil(filteredIcons.length / iconsPerPage);
178
+
179
+ const handlePageChange = (direction: 'next' | 'prev') => {
180
+ if (direction === 'next' && currentPage < totalPages) {
181
+ setCurrentPage(currentPage + 1);
182
+ } else if (direction === 'prev' && currentPage > 1) {
183
+ setCurrentPage(currentPage - 1);
184
+ }
185
+ };
186
+
187
+ const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
188
+ setSearchQuery(event.target.value);
189
+ setCurrentPage(1);
190
+ };
191
+
192
+ return (
193
+ <div>
194
+ <Row className="mb-5 text-align--center">
195
+ <Col xs={12}>
196
+ <input
197
+ type="text"
198
+ placeholder="Search Font Awesome Icons..."
199
+ value={searchQuery}
200
+ onChange={handleSearchChange}
201
+ className="border-primary rounded pa-2"
202
+ style={{
203
+ width: '80%',
204
+ maxWidth: '400px',
205
+ }}
206
+ />
207
+ </Col>
208
+ </Row>
209
+ <Row>
210
+ {currentIcons.map((iconName) => (
211
+ <Col xs={6} sm={4} md={3} lg={2} key={iconName} className="mb-5 text-align--center">
212
+ <div className="pa-3">
213
+ <Icon name={iconName} size={args.size} />
214
+ <div className="mt-2 text-body-2">{iconName}</div>
215
+ </div>
216
+ </Col>
217
+ ))}
218
+ </Row>
219
+ <Row className="mb-5 text-align--center">
220
+ <Col xs={12}>
221
+ Page {currentPage} of {totalPages} ({filteredIcons.length} icons)
222
+ </Col>
223
+ <Col xs={12} className="text-align--center">
224
+ <Button
225
+ onClick={() => handlePageChange('prev')}
226
+ isDisabled={currentPage === 1}
227
+ ariaLabel="Previous Page"
228
+ className="mt-1 mr-1"
229
+ >
230
+ Previous
231
+ </Button>
232
+ <Button
233
+ onClick={() => handlePageChange('next')}
234
+ isDisabled={currentPage === totalPages}
235
+ ariaLabel="Next Page"
236
+ className="mt-1 ml-1"
237
+ >
238
+ Next
239
+ </Button>
240
+ </Col>
241
+ </Row>
242
+ </div>
243
+ );
244
+ },
245
+ args: {
246
+ size: 'md',
247
+ },
248
+ };
@@ -0,0 +1,45 @@
1
+ import React, { ReactElement, cloneElement } from 'react';
2
+ import classNames from 'classnames';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
5
+ import * as solidIcons from '@fortawesome/free-solid-svg-icons';
6
+ import { IconProps } from './types';
7
+ import { indicons } from './indicons';
8
+
9
+ const kebabToCamel = (str?: string) => {
10
+ if (!str) return str;
11
+
12
+ return str.replace(/-./g, (match) => match.charAt(1).toUpperCase());
13
+ };
14
+
15
+ const Icon: React.FC<IconProps> = ({ name, size = 'md', className, ariaLabel, ...props }) => {
16
+ const camelCaseName = kebabToCamel(name);
17
+ const faIcon = solidIcons[camelCaseName as keyof typeof solidIcons] as IconDefinition | undefined;
18
+ const customIcon = indicons[name as keyof typeof indicons];
19
+
20
+ const label = ariaLabel || `${name} Icon`;
21
+ if (!faIcon && !customIcon) {
22
+ console.error(`Icon "${name}" not found`);
23
+ return null;
24
+ }
25
+
26
+ const iconClasses = classNames(
27
+ 'icon',
28
+ {
29
+ [`icon--${size}`]: size,
30
+ },
31
+ className,
32
+ );
33
+
34
+ return faIcon ? (
35
+ <FontAwesomeIcon icon={faIcon} className={iconClasses} aria-label={label} {...props} />
36
+ ) : (
37
+ cloneElement(customIcon as ReactElement, {
38
+ className: iconClasses,
39
+ 'aria-label': label,
40
+ ...props,
41
+ })
42
+ );
43
+ };
44
+
45
+ export default Icon;
@@ -0,0 +1,104 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
+ import Icon from '../Icon';
4
+
5
+ describe('Icon Component', () => {
6
+ describe('FontAwesome Icons', () => {
7
+ const faIconName = 'fa-arrow-down';
8
+ const labelText = `${faIconName} Icon`;
9
+
10
+ test('renders FontAwesome icon', () => {
11
+ render(<Icon name={faIconName} />);
12
+ const icon = screen.getByLabelText(labelText);
13
+ expect(icon).toBeInTheDocument();
14
+ expect(icon).toHaveClass(faIconName);
15
+ });
16
+
17
+ test('applies size class to FontAwesome icon', () => {
18
+ render(<Icon name={faIconName} size="lg" />);
19
+ const icon = screen.getByLabelText(labelText);
20
+ expect(icon).toHaveClass('icon--lg');
21
+ });
22
+
23
+ test('applies custom className to FontAwesome icon', () => {
24
+ render(<Icon name={faIconName} className="custom-class" />);
25
+ const icon = screen.getByLabelText(labelText);
26
+ expect(icon).toHaveClass('custom-class');
27
+ });
28
+
29
+ test('applies style to FontAwesome icon', () => {
30
+ render(<Icon name={faIconName} style={{ color: 'red' }} />);
31
+ const icon = screen.getByLabelText(labelText);
32
+ expect(icon).toHaveStyle('color: red');
33
+ });
34
+
35
+ test('uses ariaLabel prop for FontAwesome icon', () => {
36
+ render(<Icon name={faIconName} ariaLabel="custom label" />);
37
+ const icon = screen.getByLabelText('custom label');
38
+ expect(icon).toBeInTheDocument();
39
+ });
40
+
41
+ test('applies id to FontAwesome icon', () => {
42
+ render(<Icon name={faIconName} id="test-id" />);
43
+ const icon = screen.getByLabelText(labelText);
44
+ expect(icon).toHaveAttribute('id', 'test-id');
45
+ });
46
+
47
+ test('handles onClick event for FontAwesome icon', async () => {
48
+ const handleClick = jest.fn();
49
+ render(<Icon name={faIconName} onClick={handleClick} />);
50
+ const icon = screen.getByLabelText(labelText);
51
+ await userEvent.click(icon);
52
+ expect(handleClick).toHaveBeenCalledTimes(1);
53
+ });
54
+ });
55
+
56
+ describe('Custom Icons (Indicons)', () => {
57
+ const customIconName = 'indico-o';
58
+ const labelText = `${customIconName} Icon`;
59
+
60
+ test('renders custom icon', () => {
61
+ render(<Icon name={customIconName} />);
62
+ const icon = screen.getByLabelText(labelText);
63
+ expect(icon).toBeInTheDocument();
64
+ });
65
+
66
+ test('applies size class to custom icon', () => {
67
+ render(<Icon name={customIconName} size="lg" />);
68
+ const icon = screen.getByLabelText(labelText);
69
+ expect(icon).toHaveClass('icon--lg');
70
+ });
71
+
72
+ test('applies custom className to custom icon', () => {
73
+ render(<Icon name={customIconName} className="custom-class" />);
74
+ const icon = screen.getByLabelText(labelText);
75
+ expect(icon).toHaveClass('custom-class');
76
+ });
77
+
78
+ test('applies style to custom icon', () => {
79
+ render(<Icon name={customIconName} style={{ color: 'blue' }} />);
80
+ const icon = screen.getByLabelText(labelText);
81
+ expect(icon).toHaveStyle('color: blue');
82
+ });
83
+
84
+ test('uses ariaLabel prop for custom icon', () => {
85
+ render(<Icon name={customIconName} ariaLabel="custom label" />);
86
+ const icon = screen.getByLabelText('custom label');
87
+ expect(icon).toBeInTheDocument();
88
+ });
89
+
90
+ test('applies id to custom icon', () => {
91
+ render(<Icon name={customIconName} id="test-id" />);
92
+ const icon = screen.getByLabelText(labelText);
93
+ expect(icon).toHaveAttribute('id', 'test-id');
94
+ });
95
+
96
+ test('handles onClick event for custom icon', async () => {
97
+ const handleClick = jest.fn();
98
+ render(<Icon name={customIconName} onClick={handleClick} />);
99
+ const icon = screen.getByLabelText(labelText);
100
+ await userEvent.click(icon);
101
+ expect(handleClick).toHaveBeenCalledTimes(1);
102
+ });
103
+ });
104
+ });
@@ -0,0 +1 @@
1
+ export { default as Icon } from './Icon';
@@ -48,22 +48,22 @@ const indicons = {
48
48
  </svg>
49
49
  ),
50
50
  bookmark: (
51
- <svg viewBox="0 0 24 24">
51
+ <svg viewBox="0 0 24 24" fill="currentColor">
52
52
  <path d="M20.5 1C20 .5 19.3.2 18.6.2H5.4C4.7.2 4 .5 3.5 1s-.8 1.2-.8 1.8v20.9l9.3-4 9.3 4V2.8c0-.6-.3-1.3-.8-1.8m-1.6 19L12 17l-6.9 3V2.7h13.8z" />
53
53
  </svg>
54
54
  ),
55
55
  bookmarks: (
56
- <svg viewBox="0 0 24 24">
56
+ <svg viewBox="0 0 24 24" fill="currentColor">
57
57
  <path d="M15.4 6.5c.1 0 .1 0 .1.1v14l-4.8-2.2-.9-.4-.9.4-4.8 2.2v-14c0-.1 0-.1.1-.1zm0-2.2H4.2C3 4.3 2 5.4 2 6.6V24l7.9-3.6 7.9 3.6V6.6c-.1-1.2-1.1-2.3-2.4-2.3m4.5-2v18.3H22V2.3C22 1 21 0 19.8 0H5.5v2.2h14.3s.1 0 .1.1" />
58
58
  </svg>
59
59
  ),
60
60
  'bookmark-saved': (
61
- <svg viewBox="0 0 24 24">
61
+ <svg viewBox="0 0 24 24" fill="currentColor">
62
62
  <path d="m16.8 7.9-3.6-3.6 1.5-1.5 2 2 5-4.8 1.5 1.5zm.2 3.5v8.8l-6.9-2.9-6.9 2.9V2.9h6.7V.5H3.5c-.7 0-1.4.3-1.9.8S.8 2.4.8 3.1V24l9.3-4 9.3 4V11.4z" />
63
63
  </svg>
64
64
  ),
65
65
  branch: (
66
- <svg viewBox="0 0 642 514">
66
+ <svg viewBox="0 0 642 514" fill="currentColor">
67
67
  <path
68
68
  d="M385 321H257c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V353c0-17.67-14.33-32-32-32zM193 33c0-17.67-14.33-32-32-32H33C15.33 1 1 15.33 1 33v128c0 17.67 14.33 32 32 32h95.72l73.16 128.04C212.98 301.98 233.4 289 257 289h.28L193 176.51V129h224V65H193V33zM609 1H481c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V33c0-17.67-14.33-32-32-32z"
69
69
  fill="currentColor"
@@ -71,7 +71,7 @@ const indicons = {
71
71
  </svg>
72
72
  ),
73
73
  calendar: (
74
- <svg viewBox="0 0 24 24">
74
+ <svg viewBox="0 0 24 24" fill="currentColor">
75
75
  <path d="M12 12c-.6 0-1 .5-1 1 0 .6.5 1 1 1s1-.5 1-1-.4-1-1-1M12 17c-.6 0-1 .5-1 1 0 .6.5 1 1 1s1-.5 1-1-.4-1-1-1M7.1 12c-.6 0-1 .5-1 1 0 .6.5 1 1 1 .6 0 1-.5 1-1 .1-.5-.4-1-1-1M7.1 17c-.6 0-1 .5-1 1 0 .6.5 1 1 1 .6 0 1-.5 1-1 .1-.5-.4-1-1-1M16.9 17c-.6 0-1 .5-1 1 0 .6.5 1 1 1 .6 0 1-.5 1-1s-.5-1-1-1M16.9 12c-.6 0-1 .5-1 1 0 .6.5 1 1 1 .6 0 1-.5 1-1s-.5-1-1-1" />
76
76
  <path d="M19.1 2.4h-1.2V1c0-.6-.4-1-1-1s-1 .4-1 1v1.4H8.1V1c0-.6-.4-1-1-1s-1 .4-1 1v1.4H4.9c-2.1 0-3.7 1.7-3.7 3.7v14.1c0 2.1 1.7 3.7 3.7 3.7h14.3c2.1 0 3.7-1.7 3.7-3.7V6.1c0-2-1.7-3.7-3.8-3.7m-14.2 2h14.3c1 0 1.7.8 1.7 1.7v1.3H3.1V6.1c0-.9.8-1.7 1.8-1.7M19.1 22H4.9c-1 0-1.7-.8-1.7-1.7V9.4h17.7v10.9c0 .9-.8 1.7-1.8 1.7" />
77
77
  </svg>
@@ -173,17 +173,17 @@ const indicons = {
173
173
  </svg>
174
174
  ),
175
175
  cog: (
176
- <svg viewBox="0 0 24 24">
176
+ <svg viewBox="0 0 24 24" fill="currentColor">
177
177
  <path d="M15.4 23.4c-.5 0-.9-.1-1.3-.3l-1.6-.8q-.45-.15-.9 0l-1.6.8c-1 .5-2 .4-2.9-.1l-2.2-1.3c-.9-.5-1.4-1.4-1.5-2.4l-.1-1.8c0-.3-.2-.6-.4-.8l-1.5-1C.5 15.2 0 14.3 0 13.3v-2.5c0-1 .5-1.9 1.3-2.5l1.5-1c.3-.2.4-.5.4-.8l.1-1.8c.1-1 .6-1.9 1.5-2.4L7.1 1C8 .5 9 .4 9.9.9l1.6.8q.45.15.9 0L14 .9c1-.5 2-.4 2.9.1l2.2 1.3c.9.5 1.4 1.4 1.5 2.4l.1 1.8c0 .3.2.6.4.8l1.5 1c.8.6 1.3 1.5 1.3 2.5v2.5c0 1-.5 1.9-1.3 2.5l-1.5 1c-.3.2-.4.5-.4.8l-.1 1.8c-.1 1-.6 1.9-1.5 2.4L16.9 23c-.5.3-1 .4-1.5.4M12 20.2c.5 0 .9.1 1.3.3l1.6.8q.45.15.9 0L18 20c.3-.2.5-.5.5-.8l.1-1.8c.1-.9.6-1.8 1.3-2.3l1.5-1c.3-.2.4-.5.4-.8v-2.5c0-.3-.2-.6-.4-.8l-1.5-1c-.8-.5-1.3-1.4-1.3-2.3l-.1-1.8c0-.3-.2-.6-.5-.8l-2.2-1.3q-.45-.3-.9 0l-1.6.8c-.8.4-1.8.4-2.7 0L9 2.7c-.3-.2-.6-.1-.9 0L5.9 4c-.3.1-.5.4-.5.8l-.1 1.8c0 .9-.5 1.8-1.3 2.3l-1.5 1c-.3.2-.5.5-.5.8v2.5c0 .3.2.6.4.8l1.5 1c.8.5 1.3 1.4 1.3 2.3l.1 1.8c0 .3.2.6.5.8L8 21.2q.45.3.9 0l1.6-.8c.6-.1 1-.2 1.5-.2m0-2.8c-2.9 0-5.3-2.4-5.3-5.3S9.1 6.8 12 6.8s5.3 2.4 5.3 5.3-2.4 5.3-5.3 5.3m0-8.7c-1.8 0-3.3 1.5-3.3 3.3s1.5 3.3 3.3 3.3 3.3-1.5 3.3-3.3-1.5-3.3-3.3-3.3" />
178
178
  </svg>
179
179
  ),
180
180
  collection: (
181
- <svg viewBox="0 0 24 24">
181
+ <svg viewBox="0 0 24 24" fill="currentColor">
182
182
  <path d="M21 24H3c-1.7 0-3-1.4-3-3V11c0-1.7 1.4-3 3-3h18c1.7 0 3 1.4 3 3v10c0 1.6-1.4 3-3 3M3 9.9c-.6 0-1 .5-1 1v10c0 .6.5 1 1 1h18c.6 0 1-.5 1-1v-10c0-.6-.5-1-1-1zM21.6 5c0-.6-.5-1-1-1H3.3c-.6 0-1 .5-1 1s.5 1 1 1h17.3c.5 0 1-.5 1-1m-2.5-4c0-.6-.5-1-1-1H5.9c-.6 0-1 .5-1 1s.5 1 1 1h12.2c.5 0 1-.4 1-1" />
183
183
  </svg>
184
184
  ),
185
185
  compare: (
186
- <svg viewBox="0 0 24 24">
186
+ <svg viewBox="0 0 24 24" fill="currentColor">
187
187
  <path d="M24 5.5c0 .6-.4 1-1 1H3.4l2.8 2.8c.4.4.4 1 0 1.4-.2.2-.4.3-.7.3s-.5-.1-.7-.3L.3 6.2c-.4-.4-.4-1 0-1.4L4.8.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4L3.4 4.5H23c.6 0 1 .4 1 1m-23 14h19.6l-2.8 2.8c-.4.4-.4 1 0 1.4s1 .4 1.4 0l4.5-4.5c.4-.4.4-1 0-1.4l-4.5-4.5c-.2-.2-.4-.3-.7-.3s-.5.1-.7.3c-.4.4-.4 1 0 1.4l2.8 2.8H1c-.6 0-1 .4-1 1s.4 1 1 1" />
188
188
  </svg>
189
189
  ),
@@ -261,7 +261,7 @@ const indicons = {
261
261
  </svg>
262
262
  ),
263
263
  document: (
264
- <svg viewBox="0 0 24 24">
264
+ <svg viewBox="0 0 24 24" fill="currentColor">
265
265
  <path d="M15.6.3q-.45-.3-.9-.3H3.9c-.8 0-1.5.9-1.5 1.7v20.6c0 .8.7 1.7 1.5 1.7H20c.8 0 1.5-.9 1.5-1.7V6.8c0-.3-.1-.6-.3-.8zm4.1 21.8H4.3V1.9h10.1V6c0 .7.5 1.2 1.2 1.2h4.1z" />
266
266
  </svg>
267
267
  ),
@@ -434,7 +434,7 @@ const indicons = {
434
434
  </svg>
435
435
  ),
436
436
  'indico-o': (
437
- <svg viewBox="0 0 24 24">
437
+ <svg viewBox="0 0 24 24" fill="currentColor">
438
438
  <path d="M13.8 10.2h-3.6v3.6h3.6zm-8.9 0c.9-3.1 3.7-5.4 7.1-5.4s6.2 2.3 7.1 5.5H24C23.1 4.5 18 0 12 0S.9 4.5.1 10.2zM19 13.8c-.8 3.1-3.6 5.4-7 5.4s-6.2-2.3-7-5.4H.1C1 19.6 6 24 12 24s11-4.4 11.9-10.2z" />
439
439
  </svg>
440
440
  ),
@@ -455,7 +455,7 @@ const indicons = {
455
455
  </svg>
456
456
  ),
457
457
  key: (
458
- <svg viewBox="0 0 24 24">
458
+ <svg viewBox="0 0 24 24" fill="currentColor">
459
459
  <path d="M19.5 7c-.7.7-1.9.7-2.7 0-.8-.8-.8-2 0-2.8.7-.7 1.9-.7 2.7 0 .8.8.8 2 0 2.8m2.8-4.6c-2.7-3-7.4-3.2-10.2-.3-2 1.9-2.5 4.5-1.9 6.9L.6 18.7c-.3.3-.4.6-.4 1l-.2 3c0 .5.4.8.8.8l3.7-.3c.3 0 .6-.2.9-.4v-3.3h3.1v-3.1h3.7c1.6-1.5 2.7-2.6 2.7-2.6 2.5.7 5.4 0 7.2-2.1 2.5-2.6 2.5-6.7.2-9.3" />
460
460
  </svg>
461
461
  ),
@@ -490,7 +490,7 @@ const indicons = {
490
490
  </svg>
491
491
  ),
492
492
  logout: (
493
- <svg viewBox="0 0 24 24">
493
+ <svg viewBox="0 0 24 24" fill="currentColor">
494
494
  <path d="M13.8 24h-10C1.7 24 0 22.3 0 20.2V3.8C0 1.8 1.6.1 3.7 0h10.1c2.1 0 3.8 1.7 3.8 3.8v1.5c0 .6-.4 1-1 1s-1-.4-1-1V3.8c0-1-.8-1.8-1.8-1.8h-10c-1 .1-1.8.9-1.8 1.8v16.4c0 1 .8 1.8 1.8 1.8h10c1 0 1.8-.8 1.8-1.8v-1.5c0-.6.4-1 1-1s1 .4 1 1v1.5c0 2.1-1.7 3.8-3.8 3.8m9.9-12.7-3.9-3.9c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l2.2 2.2H8.2c-.6 0-1 .4-1 1s.4 1 1 1h12.4l-2.2 2.3c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3l3.9-4c.4-.4.4-1 0-1.4" />
495
495
  </svg>
496
496
  ),
@@ -567,7 +567,7 @@ const indicons = {
567
567
  </svg>
568
568
  ),
569
569
  'object-detection': (
570
- <svg viewBox="0 0 100 100">
570
+ <svg viewBox="0 0 100 100" fill="currentColor">
571
571
  <g>
572
572
  <path d="M0,91V66h10v24h24v10H9C4,100,0,96,0,91z" />
573
573
  <path d="M90,90H66v10h25c5,0,9-4,9-9V66H90V90z" />
@@ -672,7 +672,7 @@ const indicons = {
672
672
  </svg>
673
673
  ),
674
674
  reset: (
675
- <svg viewBox="0 0 24 24">
675
+ <svg viewBox="0 0 24 24" fill="currentColor">
676
676
  <path d="M23 7.3c-.6-1.4-1.5-2.7-2.6-3.8S18 1.5 16.6.9 13.6 0 12 0c-1.8 0-3.4.4-5 1.1-1.5.7-2.8 1.6-3.9 2.8V.1H.8v8h8V5.7H4.6c.9-1 1.9-1.8 3.1-2.4 1.3-.7 2.7-1 4.2-1 2.7 0 5 .9 6.9 2.8s2.8 4.2 2.8 6.9-.9 5-2.8 6.8c-1.9 1.9-4.2 2.8-6.9 2.8q-3.6 0-6.3-2.4c-2.7-2.4-2.9-3.6-3.2-5.9v-.1H0v.2C.4 16.5 1.7 19 4 21s4.9 3 8 3c1.7 0 3.2-.3 4.7-.9 1.4-.6 2.7-1.5 3.8-2.6s2-2.4 2.6-3.8.9-3 .9-4.7-.3-3.2-1-4.7" />
677
677
  </svg>
678
678
  ),
@@ -692,7 +692,7 @@ const indicons = {
692
692
  </svg>
693
693
  ),
694
694
  'search-thin': (
695
- <svg viewBox="0 0 24 24">
695
+ <svg viewBox="0 0 24 24" fill="currentColor">
696
696
  <path d="M23.7 22.3 17 15.6c1.4-1.7 2.2-3.8 2.2-6.1 0-5.3-4.3-9.6-9.6-9.6C4.3 0 0 4.3 0 9.6s4.3 9.6 9.6 9.6c2.3 0 4.3-.8 6-2.1l6.7 6.7c.2.2.5.3.7.3.3 0 .5-.1.7-.3.4-.5.4-1.1 0-1.5M9.6 17.1C5.4 17.1 2 13.7 2 9.6S5.4 2 9.6 2s7.6 3.4 7.6 7.6-3.4 7.5-7.6 7.5" />
697
697
  </svg>
698
698
  ),
@@ -710,7 +710,7 @@ const indicons = {
710
710
  </svg>
711
711
  ),
712
712
  'sort-down': (
713
- <svg viewBox="0 0 24 24">
713
+ <svg viewBox="0 0 24 24" fill="currentColor">
714
714
  <path d="M13.9 17.8h-3.1c-.4 0-.8.3-.8.8v.8c0 .4.3.8.8.8h3.1c.4 0 .8-.3.8-.8v-.8c0-.5-.3-.8-.8-.8m-6.7.4H5V1.9c0-.4-.3-.8-.8-.8h-.7c-.4 0-.8.3-.8.8v16.2H.6c-.3 0-.6.3-.6.6 0 .1 0 .3.2.4l3.3 3.5c.2.2.6.2.8 0l3.3-3.5c.2-.2.2-.6 0-.8-.2-.1-.3-.1-.4-.1m12.9-9.7h-9.3c-.4 0-.8.3-.8.8v.7c0 .4.3.8.8.8h9.3c.4 0 .8-.3.8-.8v-.7c0-.5-.3-.8-.8-.8m3.1-4.7H10.8c-.4 0-.8.3-.8.8v.8c0 .4.3.8.8.8h12.4c.4 0 .8-.3.8-.8v-.8c0-.4-.3-.8-.8-.8M17 13.1h-6.2c-.4 0-.8.3-.8.8v.8c0 .4.3.8.8.8H17c.4 0 .8-.3.8-.8v-.8c0-.4-.4-.8-.8-.8" />
715
715
  </svg>
716
716
  ),
@@ -749,7 +749,7 @@ const indicons = {
749
749
  </svg>
750
750
  ),
751
751
  text: (
752
- <svg viewBox="0 0 24 24">
752
+ <svg viewBox="0 0 24 24" fill="currentColor">
753
753
  <path d="M16 4V2H0v2h7v18h2V4zM24.2 9h-10v2h4v11h2V11h4z" />
754
754
  </svg>
755
755
  ),
@@ -0,0 +1,23 @@
1
+ $sizes: (
2
+ xs: var(--pf-icon-size-xs),
3
+ sm: var(--pf-icon-size-sm),
4
+ md: var(--pf-icon-size-md),
5
+ lg: var(--pf-icon-size-lg),
6
+ xl: var(--pf-icon-size-xl),
7
+ );
8
+
9
+ @mixin icon-size($name, $value) {
10
+ &--#{$name} {
11
+ width: $value;
12
+ height: $value;
13
+ font-size: $value;
14
+ }
15
+ }
16
+
17
+ .icon {
18
+ display: inline-block;
19
+
20
+ @each $name, $value in $sizes {
21
+ @include icon-size($name, $value);
22
+ }
23
+ }
@@ -0,0 +1,12 @@
1
+ import { MouseEventHandler } from 'react';
2
+ import { IconName, PermafrostComponent } from '@/types';
3
+
4
+ export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+
6
+ export type IconProps = PermafrostComponent & {
7
+ name: IconName;
8
+ ariaLabel?: string;
9
+ size?: IconSizes;
10
+ style?: React.CSSProperties;
11
+ onClick?: MouseEventHandler<SVGElement>;
12
+ };
@@ -1,2 +1,3 @@
1
1
  export { Container, Col, Row } from './grid';
2
2
  export { Button } from './button';
3
+ export { Icon } from './icons';
package/src/index.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import './styles/index.scss';
2
2
 
3
3
  export { GlobalStyles } from './legacy/styles/globals/index';
4
- export { faIcons } from './legacy/components/Icon/faIcons';
5
- export { indicons } from './legacy/components/Icon/indicons';
6
4
 
7
5
  export {
8
6
  ANIMATION,
@@ -29,7 +27,6 @@ export {
29
27
  Drawer,
30
28
  DatePicker,
31
29
  EditableInput,
32
- Icon,
33
30
  IconButton,
34
31
  ListTable,
35
32
  LoadingAwareContainer,
@@ -63,3 +60,4 @@ export { numberUtils, stringUtils, colorUtils } from './legacy/utils';
63
60
  // New Components
64
61
  export { Container, Row, Col } from './components/grid';
65
62
  export { Button } from './components/button';
63
+ export { Icon } from './components/icons';
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
 
5
- import { Icon } from '@/legacy/components/Icon';
5
+ import { Icon } from '@/components/icons';
6
6
  import { PermafrostComponent } from '@/types';
7
7
 
8
8
  import { StyledAccordion } from './Accordion.styles';
@@ -20,7 +20,7 @@ export const Accordion = (props: Props) => {
20
20
  <StyledAccordion className={className} id={id} open={open} data-cy={props['data-cy']}>
21
21
  <summary>
22
22
  <div className="header-container">
23
- <Icon className="toggle-icon" name="chevron-up" size={[14]} />
23
+ <Icon className="toggle-icon" name="chevron-up" />
24
24
  {header ? <h2>{header}</h2> : null}
25
25
  </div>
26
26
  </summary>