@innovaccer/design-system 2.6.0 → 2.7.0-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 (287) hide show
  1. package/.eslintrc.json +10 -9
  2. package/.github/workflows/chromatic.yml +5 -0
  3. package/.github/workflows/pull_request.yml +1 -1
  4. package/.storybook/main.js +4 -0
  5. package/.vscode/settings.json +11 -0
  6. package/CHANGELOG.md +36 -0
  7. package/CONTRIBUTING.md +7 -1
  8. package/core/accessibility/utils/useAccessibilityProps.ts +4 -2
  9. package/core/common.type.tsx +22 -0
  10. package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +9 -9
  11. package/core/components/atoms/_chip/index.tsx +17 -3
  12. package/core/components/atoms/avatar/Avatar.tsx +4 -14
  13. package/core/components/atoms/avatar/__stories__/variants/Appearance.story.tsx +3 -2
  14. package/core/components/atoms/avatar/__tests__/Avatar.test.tsx +14 -9
  15. package/core/components/atoms/avatarGroup/AvatarGroup.tsx +3 -5
  16. package/core/components/atoms/badge/Badge.tsx +2 -12
  17. package/core/components/atoms/badge/__tests__/Badge.test.tsx +22 -7
  18. package/core/components/atoms/badge/_stories_/variants/Appearance.story.tsx +3 -2
  19. package/core/components/atoms/badge/_stories_/variants/Subtle.story.tsx +3 -2
  20. package/core/components/atoms/button/Button.tsx +10 -7
  21. package/core/components/atoms/button/__stories__/index.story.tsx +1 -1
  22. package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +2 -2
  23. package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +2 -2
  24. package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +2 -2
  25. package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +2 -2
  26. package/core/components/atoms/button/__tests__/Button.test.tsx +1 -1
  27. package/core/components/atoms/button/__tests__/__snapshots__/Button.test.tsx.snap +0 -137
  28. package/core/components/atoms/card/__stories__/empty.story.tsx +1 -1
  29. package/core/components/atoms/card/__stories__/nested.story.tsx +1 -1
  30. package/core/components/atoms/card/__stories__/scroll.story.tsx +1 -1
  31. package/core/components/atoms/checkbox/Checkbox.tsx +8 -9
  32. package/core/components/atoms/checkbox/__stories__/variants/Size.story.tsx +2 -2
  33. package/core/components/atoms/chip/Chip.tsx +3 -2
  34. package/core/components/atoms/chip/__stories__/variants/Selection.story.tsx +17 -0
  35. package/core/components/atoms/chip/__stories__/variants/Type.story.tsx +2 -2
  36. package/core/components/atoms/chip/__tests__/Chip.test.tsx +7 -0
  37. package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +5 -5
  38. package/core/components/atoms/chipGroup/__tests__/chipGroup.test.tsx +2 -2
  39. package/core/components/atoms/chipGroup/_stories_/index.story.tsx +2 -2
  40. package/core/components/atoms/dropdown/Dropdown.tsx +18 -17
  41. package/core/components/atoms/dropdown/DropdownButton.tsx +2 -2
  42. package/core/components/atoms/dropdown/DropdownList.tsx +10 -5
  43. package/core/components/atoms/dropdown/Loading.tsx +1 -1
  44. package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.tsx +45 -0
  45. package/core/components/atoms/dropdown/__stories__/_common_/types.tsx +3 -0
  46. package/core/components/atoms/dropdown/__stories__/variants/Size.story.tsx +2 -2
  47. package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.tsx +1 -1
  48. package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +12 -1
  49. package/core/components/atoms/dropdown/__tests__/Loading.test.tsx +0 -1
  50. package/core/components/atoms/dropdown/option/index.tsx +1 -1
  51. package/core/components/atoms/heading/Heading.tsx +4 -4
  52. package/core/components/atoms/heading/__stories__/variants/Appearance.story.tsx +3 -2
  53. package/core/components/atoms/heading/__tests__/Heading.test.tsx +4 -3
  54. package/core/components/atoms/icon/Icon.tsx +3 -3
  55. package/core/components/atoms/input/Input.tsx +3 -3
  56. package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +62 -0
  57. package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +38 -0
  58. package/core/components/atoms/input/__stories__/variants/controlledInput.story.tsx +46 -0
  59. package/core/components/atoms/input/__stories__/variants/types/BasicInput.story.tsx +2 -2
  60. package/core/components/atoms/input/__stories__/variants/types/IconLeft.story.tsx +2 -10
  61. package/core/components/atoms/input/__stories__/variants/types/WithLabel.story.tsx +1 -9
  62. package/core/components/atoms/label/Label.tsx +1 -1
  63. package/core/components/atoms/legend/Legend.tsx +2 -2
  64. package/core/components/atoms/legend/__stories__/variants/labelAppearance.story.tsx +2 -2
  65. package/core/components/atoms/link/Link.tsx +4 -4
  66. package/core/components/atoms/message/Message.tsx +12 -12
  67. package/core/components/atoms/message/__stories__/index.story.tsx +1 -1
  68. package/core/components/atoms/message/__stories__/variants/Appearance.story.tsx +1 -1
  69. package/core/components/atoms/message/__stories__/variants/AppearanceTitle.story.tsx +1 -1
  70. package/core/components/atoms/message/__tests__/Message.test.tsx +1 -6
  71. package/core/components/atoms/message/__tests__/__snapshots__/Message.test.tsx.snap +0 -45
  72. package/core/components/atoms/metaList/__tests__/MetaList.test.tsx +2 -2
  73. package/core/components/atoms/metricInput/MetricInput.tsx +5 -5
  74. package/core/components/atoms/multiSlider/SliderUtils.tsx +1 -4
  75. package/core/components/atoms/multiSlider/index.tsx +3 -4
  76. package/core/components/atoms/outsideClick/OutsideClick.tsx +1 -2
  77. package/core/components/atoms/paragraph/Paragraph.tsx +2 -2
  78. package/core/components/atoms/paragraph/__stories__/variants/Appearance.story.tsx +2 -2
  79. package/core/components/atoms/paragraph/__tests__/Paragraph.test.tsx +2 -2
  80. package/core/components/atoms/pills/Pills.tsx +2 -12
  81. package/core/components/atoms/pills/__stories__/variants/Appearance.story.tsx +3 -2
  82. package/core/components/atoms/pills/__stories__/variants/Subtle.story.tsx +3 -2
  83. package/core/components/atoms/pills/__tests__/Pills.test.tsx +3 -2
  84. package/core/components/atoms/placeholderImage/PlaceholderImage.tsx +2 -2
  85. package/core/components/atoms/placeholderImage/__stories__/variants/Size.story.tsx +2 -2
  86. package/core/components/atoms/placeholderParagraph/PlaceholderParagraph.tsx +2 -2
  87. package/core/components/atoms/placeholderParagraph/__stories__/variants/Size.story.tsx +2 -2
  88. package/core/components/atoms/popperWrapper/PopperWrapper.tsx +2 -6
  89. package/core/components/atoms/progressRing/ProgressRing.tsx +2 -2
  90. package/core/components/atoms/progressRing/__stories__/variants/Size.story.tsx +1 -1
  91. package/core/components/atoms/radio/Radio.tsx +4 -5
  92. package/core/components/atoms/rangeSlider/RangeSlider.tsx +1 -2
  93. package/core/components/atoms/rangeSlider/__stories__/index.story.tsx +1 -2
  94. package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.tsx +1 -2
  95. package/core/components/atoms/rangeSlider/__stories__/variants/CustomLabels.story.tsx +1 -2
  96. package/core/components/atoms/spinner/Spinner.tsx +4 -4
  97. package/core/components/atoms/spinner/__stories__/variants/Appearance.story.tsx +2 -2
  98. package/core/components/atoms/spinner/__stories__/variants/Size.story.tsx +1 -1
  99. package/core/components/atoms/statusHint/StatusHint.tsx +2 -3
  100. package/core/components/atoms/statusHint/__stories__/variants/Appearance.story.tsx +3 -2
  101. package/core/components/atoms/statusHint/__tests__/StatusHint.test.tsx +3 -2
  102. package/core/components/atoms/subheading/Subheading.tsx +2 -2
  103. package/core/components/atoms/subheading/__stories__/variants/Appearance.story.tsx +3 -2
  104. package/core/components/atoms/subheading/__tests__/Subheading.test.tsx +3 -2
  105. package/core/components/atoms/switchInput/Switch.tsx +7 -8
  106. package/core/components/atoms/text/Text.tsx +4 -4
  107. package/core/components/atoms/text/__stories__/variants/Appearance.story.tsx +2 -2
  108. package/core/components/atoms/text/__tests__/Text.test.tsx +2 -3
  109. package/core/components/atoms/toast/ActionButton.tsx +2 -2
  110. package/core/components/atoms/toast/Toast.tsx +11 -6
  111. package/core/components/atoms/toast/__stories__/index.story.tsx +2 -6
  112. package/core/components/atoms/toast/__stories__/variants/Appearance.story.tsx +3 -2
  113. package/core/components/atoms/toast/__stories__/variants/ToastMessage.story.tsx +3 -2
  114. package/core/components/atoms/toast/__stories__/variants/ToastWithAction.story.tsx +3 -2
  115. package/core/components/atoms/toast/__tests__/Toast.test.tsx +1 -1
  116. package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +0 -131
  117. package/core/components/css-utilities/Schema.tsx +1 -1
  118. package/core/components/css-utilities/Spacing/Schema.tsx +1 -1
  119. package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +2 -2
  120. package/core/components/molecules/dropzone/Dropzone.tsx +3 -3
  121. package/core/components/molecules/dropzone/DropzoneBase.tsx +22 -38
  122. package/core/components/molecules/dropzone/__stories__/index.story.tsx +151 -41
  123. package/core/components/molecules/dropzone/__tests__/Dropzone.test.tsx +2 -2
  124. package/core/components/molecules/dropzone/utils.tsx +6 -4
  125. package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +4 -4
  126. package/core/components/molecules/emptyState/EmptyState.tsx +4 -4
  127. package/core/components/molecules/emptyState/__stories__/pageNotLoadedWithSVG.story.tsx +26 -26
  128. package/core/components/molecules/fileList/FileListItem.tsx +1 -2
  129. package/core/components/molecules/fileUploader/FileUploaderItem.tsx +1 -2
  130. package/core/components/molecules/fileUploader/FileUploaderStatus.tsx +1 -1
  131. package/core/components/molecules/fileUploader/__stories__/_common_/types.tsx +3 -0
  132. package/core/components/molecules/fileUploader/__stories__/index.story.tsx +3 -222
  133. package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +5 -7
  134. package/core/components/molecules/inputMask/InputMask.tsx +212 -146
  135. package/core/components/molecules/inputMask/__stories__/index.story.tsx +24 -0
  136. package/core/components/molecules/modal/Modal.tsx +4 -6
  137. package/core/components/molecules/modal/__stories__/Confirmation.story.tsx +1 -1
  138. package/core/components/molecules/placeholder/Placeholder.tsx +2 -2
  139. package/core/components/molecules/popover/Popover.tsx +2 -9
  140. package/core/components/molecules/sidesheet/Sidesheet.tsx +5 -7
  141. package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.tsx +172 -0
  142. package/core/components/molecules/tooltip/Tooltip.tsx +4 -4
  143. package/core/components/organisms/calendar/__stories__/variants/firstDayOfWeek.story.tsx +2 -2
  144. package/core/components/organisms/calendar/utility.ts +3 -3
  145. package/core/components/organisms/choiceList/ChoiceList.tsx +11 -11
  146. package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
  147. package/core/components/organisms/datePicker/Trigger.tsx +1 -5
  148. package/core/components/organisms/dateRangePicker/DateRangePicker.tsx +9 -10
  149. package/core/components/organisms/dateRangePicker/SingleInputTrigger.tsx +0 -1
  150. package/core/components/organisms/dateRangePicker/Trigger.tsx +2 -2
  151. package/core/components/organisms/dateRangePicker/__stories__/variants/monthsInView.story.tsx +2 -2
  152. package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +16 -16
  153. package/core/components/organisms/grid/Cell.tsx +19 -19
  154. package/core/components/organisms/grid/Grid.tsx +3 -4
  155. package/core/components/organisms/grid/GridBody.tsx +0 -1
  156. package/core/components/organisms/grid/GridContext.ts +1 -1
  157. package/core/components/organisms/grid/__stories__/_common_/editableSchema.tsx +1 -3
  158. package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +1 -1
  159. package/core/components/organisms/grid/__stories__/_common_/loaderSchema.ts +0 -2
  160. package/core/components/organisms/grid/__stories__/_common_/schema.tsx +1 -3
  161. package/core/components/organisms/grid/__stories__/_common_/simpleLoaderSchema.ts +0 -2
  162. package/core/components/organisms/grid/__stories__/_common_/statusSchema.ts +0 -2
  163. package/core/components/organisms/inlineMessage/InlineMessage.tsx +2 -2
  164. package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +3 -2
  165. package/core/components/organisms/list/__stories__/_common_/types.tsx +3 -0
  166. package/core/components/organisms/list/__stories__/index.story.tsx +0 -16
  167. package/core/components/organisms/table/Table.tsx +2 -2
  168. package/core/components/organisms/table/__stories__/CompressedTable.story.tsx +1 -1
  169. package/core/components/organisms/table/__stories__/DataTable.story.tsx +1 -1
  170. package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +1 -1
  171. package/core/components/organisms/table/__stories__/PinnedColumn.story.tsx +1 -1
  172. package/core/components/organisms/table/__stories__/ResourceTable.story.tsx +1 -1
  173. package/core/components/organisms/table/__stories__/StandardTable.story.tsx +1 -1
  174. package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +1 -1
  175. package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +1 -1
  176. package/core/components/organisms/table/__stories__/TightStory.story.tsx +1 -1
  177. package/core/components/organisms/table/__stories__/_common_/types.tsx +3 -0
  178. package/core/components/organisms/table/__stories__/variants/showHead.story.tsx +2 -2
  179. package/core/components/organisms/table/__stories__/variants/showMenu.story.tsx +2 -2
  180. package/core/components/organisms/table/__stories__/variants/size.story.tsx +2 -2
  181. package/core/components/organisms/table/__stories__/variants/type.story.tsx +2 -2
  182. package/core/components/organisms/table/__stories__/variants/withCheckbox.story.tsx +2 -2
  183. package/core/components/organisms/table/__stories__/variants/withPagination.story.tsx +2 -2
  184. package/core/components/organisms/timePicker/TimePicker.tsx +3 -7
  185. package/core/components/organisms/verticalNav/__stories__/schema.tsx +0 -2
  186. package/core/components/organisms/verticalNav/__tests__/VerticalNav.test.tsx +1 -2
  187. package/core/global.d.ts +9 -0
  188. package/core/index.tsx +1 -1
  189. package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +18 -5
  190. package/core/utils/docPage/generateImports.tsx +2 -3
  191. package/core/utils/docPage/index.tsx +30 -20
  192. package/core/utils/docPage/sandbox.tsx +14 -7
  193. package/core/utils/overlayHelper.ts +7 -3
  194. package/core/utils/testHelper.ts +1 -1
  195. package/core/utils/types.tsx +1 -1
  196. package/css/dist/index.css +48 -30
  197. package/css/dist/index.css.map +1 -1
  198. package/css/src/components/button.css +5 -5
  199. package/css/src/components/calendar.css +1 -1
  200. package/css/src/components/chip.css +6 -4
  201. package/css/src/components/fullscreenModal.css +4 -3
  202. package/css/src/components/message.css +0 -5
  203. package/css/src/components/switch.css +23 -2
  204. package/css/src/components/toast.css +0 -5
  205. package/css/src/variables/index.css +5 -2
  206. package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +4 -1
  207. package/dist/core/common.type.d.ts +12 -0
  208. package/dist/core/components/atoms/avatar/Avatar.d.ts +4 -4
  209. package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -3
  210. package/dist/core/components/atoms/badge/Badge.d.ts +2 -2
  211. package/dist/core/components/atoms/button/Button.d.ts +6 -6
  212. package/dist/core/components/atoms/checkbox/Checkbox.d.ts +3 -3
  213. package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
  214. package/dist/core/components/atoms/dropdown/Dropdown.d.ts +18 -17
  215. package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
  216. package/dist/core/components/atoms/dropdown/DropdownList.d.ts +4 -3
  217. package/dist/core/components/atoms/dropdown/option/index.d.ts +1 -1
  218. package/dist/core/components/atoms/heading/Heading.d.ts +4 -4
  219. package/dist/core/components/atoms/icon/Icon.d.ts +2 -2
  220. package/dist/core/components/atoms/input/Input.d.ts +3 -3
  221. package/dist/core/components/atoms/legend/Legend.d.ts +2 -2
  222. package/dist/core/components/atoms/link/Link.d.ts +4 -4
  223. package/dist/core/components/atoms/message/Message.d.ts +2 -2
  224. package/dist/core/components/atoms/metricInput/MetricInput.d.ts +3 -3
  225. package/dist/core/components/atoms/multiSlider/SliderUtils.d.ts +1 -1
  226. package/dist/core/components/atoms/multiSlider/index.d.ts +3 -3
  227. package/dist/core/components/atoms/paragraph/Paragraph.d.ts +2 -2
  228. package/dist/core/components/atoms/pills/Pills.d.ts +2 -2
  229. package/dist/core/components/atoms/placeholderImage/PlaceholderImage.d.ts +2 -2
  230. package/dist/core/components/atoms/placeholderParagraph/PlaceholderParagraph.d.ts +2 -2
  231. package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +1 -2
  232. package/dist/core/components/atoms/progressRing/ProgressRing.d.ts +2 -2
  233. package/dist/core/components/atoms/radio/Radio.d.ts +4 -4
  234. package/dist/core/components/atoms/rangeSlider/RangeSlider.d.ts +1 -1
  235. package/dist/core/components/atoms/spinner/Spinner.d.ts +4 -4
  236. package/dist/core/components/atoms/statusHint/StatusHint.d.ts +2 -2
  237. package/dist/core/components/atoms/subheading/Subheading.d.ts +2 -2
  238. package/dist/core/components/atoms/switchInput/Switch.d.ts +6 -6
  239. package/dist/core/components/atoms/text/Text.d.ts +4 -4
  240. package/dist/core/components/atoms/toast/ActionButton.d.ts +2 -2
  241. package/dist/core/components/atoms/toast/Toast.d.ts +2 -2
  242. package/dist/core/components/molecules/dropzone/Dropzone.d.ts +3 -3
  243. package/dist/core/components/molecules/dropzone/DropzoneBase.d.ts +1 -1
  244. package/dist/core/components/molecules/dropzone/utils.d.ts +5 -3
  245. package/dist/core/components/molecules/emptyState/EmptyState.d.ts +4 -4
  246. package/dist/core/components/molecules/fileList/FileListItem.d.ts +1 -1
  247. package/dist/core/components/molecules/fileUploader/FileUploaderItem.d.ts +1 -1
  248. package/dist/core/components/molecules/fileUploader/FileUploaderStatus.d.ts +1 -1
  249. package/dist/core/components/molecules/fullscreenModal/FullscreenModal.d.ts +4 -7
  250. package/dist/core/components/molecules/inputMask/InputMask.d.ts +10 -2
  251. package/dist/core/components/molecules/modal/Modal.d.ts +3 -6
  252. package/dist/core/components/molecules/placeholder/Placeholder.d.ts +2 -2
  253. package/dist/core/components/molecules/popover/Popover.d.ts +0 -1
  254. package/dist/core/components/molecules/sidesheet/Sidesheet.d.ts +3 -6
  255. package/dist/core/components/molecules/tooltip/Tooltip.d.ts +3 -3
  256. package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +5 -6
  257. package/dist/core/components/organisms/dateRangePicker/DateRangePicker.d.ts +24 -0
  258. package/dist/core/components/organisms/grid/Cell.d.ts +1 -1
  259. package/dist/core/components/organisms/grid/Grid.d.ts +3 -3
  260. package/dist/core/components/organisms/grid/GridContext.d.ts +1 -1
  261. package/dist/core/components/organisms/inlineMessage/InlineMessage.d.ts +2 -2
  262. package/dist/core/components/organisms/table/Table.d.ts +2 -2
  263. package/dist/core/components/patterns/dateRangePicker/withCustomPopover.story.d.ts +5 -1
  264. package/dist/core/utils/docPage/generateImports.d.ts +1 -1
  265. package/dist/core/utils/overlayHelper.d.ts +1 -1
  266. package/dist/core/utils/types.d.ts +1 -1
  267. package/dist/index.esm.js +221 -245
  268. package/dist/index.js +225 -233
  269. package/dist/index.js.map +1 -1
  270. package/dist/index.umd.js +1 -1
  271. package/dist/index.umd.js.br +0 -0
  272. package/dist/index.umd.js.gz +0 -0
  273. package/dts.config.js +11 -2
  274. package/package.json +20 -18
  275. package/tsconfig.json +3 -16
  276. package/tsconfig.type.json +2 -1
  277. package/types/index.d.ts +2217 -0
  278. package/types/{innovaccer-design-system/tsconfig.json → tsconfig.json} +1 -1
  279. package/types/{innovaccer-design-system/tslint.json → tslint.json} +0 -0
  280. package/types/types-tests.tsx +936 -0
  281. package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +0 -89
  282. package/core/components/atoms/message/__stories__/default.story.tsx +0 -16
  283. package/core/components/atoms/toast/__stories__/DefaultToast.story.tsx +0 -16
  284. package/core/components/molecules/dropzone/__stories__/variants/DropzoneWithFileList.story.tsx +0 -176
  285. package/core/components/molecules/fileUploader/__stories__/variants/FileUploaderList.story.tsx +0 -80
  286. package/types/innovaccer-design-system/index.d.ts +0 -39
  287. package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
@@ -1,5 +1,3 @@
1
- // @ts-ignore
2
- import image from './image.png';
3
1
  import { GridProps } from '../../Grid';
4
2
 
5
3
  const loaderSchema: GridProps['loaderSchema'] = [
@@ -1,6 +1,4 @@
1
1
  import { Schema } from '../../Grid';
2
- // @ts-ignore
3
- import iconImg from './image.png';
4
2
 
5
3
  const schema: Schema = [
6
4
  {
@@ -2,8 +2,8 @@ import * as React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { Icon, Text } from '@/index';
4
4
  import { BaseProps, extractBaseProps } from '@/utils/types';
5
+ import { MessageAppearance } from '@/common.type';
5
6
 
6
- export type Appearance = 'default' | 'alert' | 'info' | 'success' | 'warning';
7
7
  const IconMapping = {
8
8
  success: 'check_circle',
9
9
  info: 'info',
@@ -15,7 +15,7 @@ export interface InlineMessageProps extends BaseProps {
15
15
  /**
16
16
  * Color of `Inline Message`
17
17
  */
18
- appearance: Appearance;
18
+ appearance: MessageAppearance;
19
19
  /**
20
20
  * Description of `Inline Message`
21
21
  */
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import { testHelper, filterUndefined, valueHelper, testMessageHelper } from '@/utils/testHelper';
4
- import { Appearance, InlineMessage } from '../InlineMessage';
4
+ import { InlineMessage } from '../InlineMessage';
5
5
  import { InlineMessageProps as Props } from '@/index.type';
6
+ import { MessageAppearance } from '@/common.type';
6
7
 
7
- const appearance: Appearance[] = ['default', 'alert', 'info', 'success', 'warning'];
8
+ const appearance: MessageAppearance[] = ['default', 'alert', 'info', 'success', 'warning'];
8
9
 
9
10
  const description = 'Inline Message here.';
10
11
 
@@ -1,4 +1,7 @@
1
1
  import { SyncListProps, AsyncListProps } from '@/components/organisms/list';
2
2
 
3
+ // TODO(eslint): Fix this
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3
5
  export const SyncList = (_props: SyncListProps) => {};
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
7
  export const AsyncList = (_props: AsyncListProps) => {};
@@ -12,22 +12,8 @@ import { SyncList, AsyncList } from './_common_/types';
12
12
  export const all = () => {
13
13
  const async = boolean('async', true);
14
14
 
15
- let loading;
16
- let error;
17
- let applyData;
18
- let applySchema;
19
15
  const applyLoaderSchema = boolean('applyLoaderSchema', true);
20
16
 
21
- if (!async) {
22
- loading = boolean('loading', false);
23
-
24
- error = boolean('error', false);
25
-
26
- applySchema = boolean('applySchema', true);
27
-
28
- applyData = boolean('applyData', true);
29
- }
30
-
31
17
  const type = select('type', ['resource', 'data'], 'resource');
32
18
 
33
19
  const size = select('size', ['comfortable', 'standard', 'compressed', 'tight'], 'comfortable');
@@ -46,8 +32,6 @@ export const all = () => {
46
32
 
47
33
  const multipleSorting = boolean('multipleSorting', false);
48
34
 
49
- const headCellTooltip = boolean('headCellTooltip', false);
50
-
51
35
  const separator = boolean('separator', false);
52
36
 
53
37
  let dataAttr = {};
@@ -23,7 +23,7 @@ export interface ErrorTemplateProps {
23
23
 
24
24
  export type FilterPosition = 'GRID' | 'HEADER';
25
25
 
26
- interface SyncProps {
26
+ interface TableSyncProps {
27
27
  /**
28
28
  * <pre className="DocPage-codeBlock">
29
29
  * Data: RowData[]
@@ -326,7 +326,7 @@ interface SharedTableProps extends BaseProps {
326
326
  filterPosition: FilterPosition;
327
327
  }
328
328
 
329
- export type SyncTableProps = SharedTableProps & SyncProps;
329
+ export type SyncTableProps = SharedTableProps & TableSyncProps;
330
330
  export type AsyncTableProps = SharedTableProps & AsyncProps;
331
331
  export type TableProps = AsyncTableProps & SyncTableProps;
332
332
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table, CardSubdued, Text } from '@/index';
3
3
  import { AsyncTable, SyncTable } from './_common_/types';
4
4
  import { TableProps } from '@/index.type';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -135,7 +135,7 @@ export const resourceTable = () => {
135
135
  <div style={{ width: 'var(--spacing-3)' }} className="ml-6">
136
136
  <Dropdown
137
137
  triggerOptions={{
138
- customTrigger: (_label: string) => <Button icon="more_horiz" appearance="transparent" />,
138
+ customTrigger: () => <Button icon="more_horiz" appearance="transparent" />,
139
139
  }}
140
140
  menu={true}
141
141
  align="left"
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, List, Text, Button } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, List, Text } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Card, Table } from '@/index';
3
3
  import { TableProps } from '@/index.type';
4
4
  import { AsyncTable, SyncTable } from './_common_/types';
@@ -1,4 +1,7 @@
1
1
  import { SyncTableProps, AsyncTableProps } from '@/components/organisms/table';
2
2
 
3
+ // TODO(eslint): Fix this
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3
5
  export const SyncTable = (_props: SyncTableProps) => {};
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
7
  export const AsyncTable = (_props: AsyncTableProps) => {};
@@ -12,10 +12,10 @@ export const showHead = () => {
12
12
  const style = {
13
13
  display: 'flex',
14
14
  flexWrap: 'wrap',
15
- };
15
+ } as const;
16
+ // to freeze the object for typescript
16
17
 
17
18
  return (
18
- // @ts-ignore
19
19
  <div style={style}>
20
20
  {values.map((v, index) => (
21
21
  <div
@@ -12,10 +12,10 @@ export const showMenu = () => {
12
12
  const style = {
13
13
  display: 'flex',
14
14
  flexWrap: 'wrap',
15
- };
15
+ } as const;
16
+ // to freeze the object for typescript
16
17
 
17
18
  return (
18
- // @ts-ignore
19
19
  <div style={style}>
20
20
  {values.map((v, index) => (
21
21
  <div
@@ -12,10 +12,10 @@ export const size = () => {
12
12
  const style = {
13
13
  display: 'flex',
14
14
  flexWrap: 'wrap',
15
- };
15
+ } as const;
16
+ // to freeze the object for typescript
16
17
 
17
18
  return (
18
- // @ts-ignore
19
19
  <div style={style}>
20
20
  {values.map((v, index) => (
21
21
  <div
@@ -13,10 +13,10 @@ export const type = () => {
13
13
  const style = {
14
14
  display: 'flex',
15
15
  flexWrap: 'wrap',
16
- };
16
+ } as const;
17
+ // to freeze the object for typescript
17
18
 
18
19
  return (
19
- // @ts-ignore
20
20
  <div style={style}>
21
21
  {values.map((v, index) => (
22
22
  <div
@@ -13,10 +13,10 @@ export const withCheckbox = () => {
13
13
  const style = {
14
14
  display: 'flex',
15
15
  flexWrap: 'wrap',
16
- };
16
+ } as const;
17
+ // to freeze the object for typescript
17
18
 
18
19
  return (
19
- // @ts-ignore
20
20
  <div style={style}>
21
21
  {values.map((v, index) => (
22
22
  <div
@@ -13,10 +13,10 @@ export const withPagination = () => {
13
13
  const style = {
14
14
  display: 'flex',
15
15
  flexWrap: 'wrap',
16
- };
16
+ } as const;
17
+ // to freeze the object for typescript
17
18
 
18
19
  return (
19
- // @ts-ignore
20
20
  <div style={style}>
21
21
  {values.map((v, index) => (
22
22
  <div
@@ -57,7 +57,7 @@ export const TimePicker = (props: TimePickerProps) => {
57
57
  setTime(updatedTime);
58
58
  }, [timeProp]);
59
59
 
60
- const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>, val: string = '') => {
60
+ const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>, val = '') => {
61
61
  const updatedTime = val?.toUpperCase();
62
62
  setTime(updatedTime);
63
63
 
@@ -66,7 +66,7 @@ export const TimePicker = (props: TimePickerProps) => {
66
66
  }
67
67
  };
68
68
 
69
- const onBlurHandler = (e: React.ChangeEvent<HTMLInputElement>, val: string = '') => {
69
+ const onBlurHandler = (e: React.ChangeEvent<HTMLInputElement>, val = '') => {
70
70
  const updatedTime = translateToTime(inputFormat, time);
71
71
  setInit(true);
72
72
 
@@ -102,11 +102,7 @@ export const TimePicker = (props: TimePickerProps) => {
102
102
  {...inputOptions}
103
103
  mask={mask}
104
104
  value={
105
- time
106
- ? translateToTime(inputFormat, time)
107
- : init // @ts-ignore
108
- ? InputMask.utils.getDefaultValue(mask, placeholderChar)
109
- : ''
105
+ time ? translateToTime(inputFormat, time) : init ? InputMask.utils.getDefaultValue(mask, placeholderChar) : ''
110
106
  }
111
107
  validators={inputValidator}
112
108
  onChange={onChangeHandler}
@@ -1,7 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { Schema } from '@/components/organisms/grid';
3
- // @ts-ignore
4
- import iconImg from './image.png';
5
3
  import { Icon, GridCell } from '@/index';
6
4
 
7
5
  const schema: Schema = [
@@ -240,7 +240,6 @@ describe('Vertical Navigation component prop: onClick', () => {
240
240
  const activeMenu = getAllByTestId('DesignSystem-VerticalNav--Item')[menuClicked];
241
241
  fireEvent.click(activeMenu);
242
242
  expect(onClick).toHaveBeenCalled();
243
- // @ts-ignore
244
- expect(onClick).toHaveBeenCalledWith(menus[menuClicked].subMenu[0]);
243
+ expect(onClick).toHaveBeenCalledWith(menus[menuClicked].subMenu![0]);
245
244
  });
246
245
  });
@@ -0,0 +1,9 @@
1
+ declare module '@' {
2
+ const x: any;
3
+ export = x;
4
+ }
5
+
6
+ declare module '*.json';
7
+ declare module 'react-dynamic-virtual-scroll';
8
+
9
+ declare const __STORYBOOK_STORY_STORE__: any;
package/core/index.tsx CHANGED
@@ -82,5 +82,5 @@ export { VerificationCodeInput } from './components/molecules/verificationCodeIn
82
82
  export { InlineMessage } from './components/organisms/inlineMessage';
83
83
  export { ChoiceList } from './components/organisms/choiceList';
84
84
  export { Divider } from './components/atoms/divider';
85
- // @ts-ignore
85
+
86
86
  export { version } from '../package.json';
@@ -926,12 +926,19 @@ exports[`TS renders children 1`] = `
926
926
  Hello World!
927
927
  </a>
928
928
  <div
929
- class="Message Message--default"
929
+ class="Message Message--info"
930
930
  data-test="DesignSystem-Message"
931
931
  >
932
+ <i
933
+ class="material-icons material-icons-round Icon Icon--info Message-icon Message-icon--info"
934
+ data-test="DesignSystem-Message--Icon"
935
+ style="font-size: 16px; width: 16px;"
936
+ >
937
+ info_round
938
+ </i>
932
939
  <div>
933
940
  <span
934
- class="Text Text--default Text--regular Message-text Message-text--default"
941
+ class="Text Text--default Text--regular Message-text Message-text--info"
935
942
  data-test="DesignSystem-Message--Description"
936
943
  >
937
944
  Hello World!
@@ -1482,8 +1489,14 @@ exports[`TS renders children 1`] = `
1482
1489
  rows="3"
1483
1490
  />
1484
1491
  <div
1485
- class="Toast Toast--default"
1492
+ class="Toast Toast--info"
1486
1493
  >
1494
+ <i
1495
+ class="material-icons material-icons-round Icon Toast-icon Toast-icon--left Toast-icon--info"
1496
+ style="font-size: 16px; width: 16px;"
1497
+ >
1498
+ info_round
1499
+ </i>
1487
1500
  <div
1488
1501
  class="Toast-body"
1489
1502
  >
@@ -1491,13 +1504,13 @@ exports[`TS renders children 1`] = `
1491
1504
  class="Toast-title"
1492
1505
  >
1493
1506
  <h5
1494
- class="Heading Heading--s Heading--white Toast-heading Toast-heading--default"
1507
+ class="Heading Heading--s Heading--white Toast-heading Toast-heading--info"
1495
1508
  data-test="DesignSystem-Heading"
1496
1509
  >
1497
1510
  Hello World!
1498
1511
  </h5>
1499
1512
  <i
1500
- class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--default"
1513
+ class="material-icons material-icons-round Icon Icon--white Toast-icon Toast-icon--right Toast-icon--info"
1501
1514
  role="button"
1502
1515
  style="font-size: 16px; width: 16px;"
1503
1516
  tabindex="0"
@@ -1,7 +1,6 @@
1
- // @ts-nocheck
2
- const generateImports = (str = '', lib = {}, libName: string) => {
1
+ const generateImports = (str = '', lib: Record<string, unknown> = {}, libName: string) => {
3
2
  const regexp = /<[A-Z]\w*/g;
4
- const matchedArray = [...str.matchAll(regexp)];
3
+ const matchedArray = Array.from(str.matchAll(regexp));
5
4
 
6
5
  const componentsMap = matchedArray
7
6
  .flatMap((item) => item[0].replace('<', ''))
@@ -1,5 +1,3 @@
1
- // @ts-nocheck
2
-
3
1
  import * as React from 'react';
4
2
  import { Title, Description, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
5
3
  import { renderToStaticMarkup } from 'react-dom/server';
@@ -7,7 +5,7 @@ import reactElementToJSXString from 'react-element-to-jsx-string';
7
5
  import { html as beautifyHTML } from 'js-beautify';
8
6
  import SyntaxHighlighter from 'react-syntax-highlighter';
9
7
  import { vs2015 } from 'react-syntax-highlighter/dist/esm/styles/hljs';
10
- import * as DS from '@/';
8
+ import * as DS from '@';
11
9
  import { Button, Card, TabsWrapper, Tab, Heading } from '@/index';
12
10
  import vsDark from 'prism-react-renderer/themes/vsDark';
13
11
  import { LiveProvider, LiveEditor, LiveError, LivePreview, withLive } from 'react-live';
@@ -59,7 +57,9 @@ const JSXtoStringOptions = {
59
57
 
60
58
  const copyCode = (val: string) => navigator.clipboard.writeText(val);
61
59
 
62
- const CopyComp = (props) => {
60
+ type OnClickType = (e: React.MouseEvent) => void;
61
+
62
+ const CopyComp = (props: { onClick: OnClickType }) => {
63
63
  const { onClick } = props;
64
64
  return (
65
65
  <div
@@ -88,7 +88,7 @@ const buttonStyles = {
88
88
  background: 'white',
89
89
  };
90
90
 
91
- const ShowMoreLessButton = ({ onClick, text = 'More' }) => (
91
+ const ShowMoreLessButton = ({ onClick, text = 'More' }: { onClick: OnClickType; text: string }) => (
92
92
  <div
93
93
  style={{
94
94
  display: 'grid',
@@ -132,7 +132,7 @@ const getStory = () => {
132
132
  return { storyId, story };
133
133
  };
134
134
 
135
- const getRawPreviewCode = (customCode, comp) => {
135
+ const getRawPreviewCode = (customCode: string, comp: React.ReactNode) => {
136
136
  if (customCode) {
137
137
  return `${generateImports(customCode, componentLib, '@innovaccer/design-system')}
138
138
  ${customCode}
@@ -155,11 +155,17 @@ ${jsx
155
155
  return code;
156
156
  };
157
157
 
158
- const StoryComp = (props) => {
158
+ const StoryComp = (props: {
159
+ noHtml: boolean;
160
+ customCode: string;
161
+ noSandbox: boolean;
162
+ isEmbed: boolean;
163
+ imports: string[];
164
+ }) => {
159
165
  const { customCode, noHtml, noSandbox, isEmbed } = props;
160
166
  const { story } = getStory();
161
167
  // const comp = sp.storySource.source;
162
- const comp = story.getOriginal()();
168
+ const comp = story.originalStoryFn();
163
169
  const html = !noHtml ? beautifyHTML(renderToStaticMarkup(comp), beautifyHTMLOptions) : '';
164
170
 
165
171
  const [activeTab, setActiveTab] = React.useState<number>(0);
@@ -168,7 +174,7 @@ const StoryComp = (props) => {
168
174
  const [isExpanded, setIsExpanded] = React.useState(isEmbed);
169
175
  const [showMore, setShowMore] = React.useState<boolean>(false);
170
176
  const [shouldShowMore, setShouldShowMore] = React.useState<boolean>(false);
171
- const codePanel = React.useRef(null);
177
+ const codePanel = React.useRef<HTMLDivElement>(null);
172
178
 
173
179
  const importScope = props.imports;
174
180
 
@@ -179,11 +185,11 @@ const StoryComp = (props) => {
179
185
  return <></>;
180
186
  };
181
187
 
182
- const TabsWrap = withLive(({ live, currentTab }) => {
188
+ const TabsWrap = withLive<{ live?: any; activeTab: number }>(({ live, activeTab }) => {
183
189
  const { error, element: Element } = live;
184
190
 
185
191
  React.useEffect(() => {
186
- if (!error && currentTab === 1) {
192
+ if (!error && activeTab === 1) {
187
193
  try {
188
194
  const htmlValue = beautifyHTML(renderToStaticMarkup(<Element />), beautifyHTMLOptions);
189
195
  setHtmlCode(htmlValue);
@@ -191,10 +197,10 @@ const StoryComp = (props) => {
191
197
  return;
192
198
  }
193
199
  }
194
- }, [currentTab]);
200
+ }, [activeTab]);
195
201
 
196
202
  React.useEffect(() => {
197
- if (codePanel.current?.clientHeight > '250') {
203
+ if (codePanel.current?.clientHeight && codePanel.current?.clientHeight > 250) {
198
204
  setShouldShowMore(true);
199
205
  }
200
206
  }, [codePanel]);
@@ -209,7 +215,7 @@ const StoryComp = (props) => {
209
215
  const actions = [
210
216
  {
211
217
  title: 'Edit in sandbox',
212
- onClick: (ev) => {
218
+ onClick: (ev: React.MouseEvent) => {
213
219
  ev.preventDefault();
214
220
  openSandbox(jsxCode);
215
221
  },
@@ -223,12 +229,13 @@ const StoryComp = (props) => {
223
229
  onClick: () => {
224
230
  setIsExpanded(!isExpanded);
225
231
  },
232
+ disabled: false,
226
233
  });
227
234
  }
228
235
 
229
236
  const imports = React.useMemo(() => ({ ...DS, ...importScope }), []);
230
237
 
231
- const tabChangeHandler = (tab) => {
238
+ const tabChangeHandler = (tab: number) => {
232
239
  setActiveTab(tab);
233
240
  setShouldShowMore(false);
234
241
  };
@@ -238,9 +245,9 @@ const StoryComp = (props) => {
238
245
  <LiveProvider code={jsxCode} scope={imports}>
239
246
  <Canvas
240
247
  className="my-0"
241
- withSource="none"
242
248
  withToolbar={true}
243
249
  isExpanded={isExpanded}
250
+ withSource={'none' as any}
244
251
  additionalActions={actions}
245
252
  >
246
253
  <LivePreview />
@@ -260,11 +267,13 @@ const StoryComp = (props) => {
260
267
  }}
261
268
  className="DocPage-editorTabs"
262
269
  >
263
- <TabsWrapper activeTab={activeTab} onTabChange={tabChangeHandler}>
270
+ <TabsWrapper active={activeTab} onTabChange={tabChangeHandler}>
264
271
  <Tab label={'React'}>
265
272
  <CopyComp
266
273
  onClick={() => {
267
- const editor = document.querySelector('.npm__react-simple-code-editor__textarea');
274
+ const editor = document.querySelector(
275
+ '.npm__react-simple-code-editor__textarea'
276
+ ) as HTMLTextAreaElement;
268
277
  if (editor) copyCode(editor.value);
269
278
  }}
270
279
  />
@@ -301,17 +310,18 @@ export const docPage = () => {
301
310
  imports,
302
311
  a11yProps,
303
312
  } = sp.docs.docPage || {};
304
- const { component: { displayName } = {} } = sp;
313
+ const { component: { displayName = '' } = {} } = story;
305
314
  const pageClassnames = classNames({
306
315
  DocPage: true,
307
316
  'pt-8 pb-8': !(isEmbed || isEmbedWithProp),
308
317
  });
318
+ const docPageTitle: string = title || displayName;
309
319
 
310
320
  return (
311
321
  <div className={pageClassnames}>
312
322
  {!isEmbed && !isEmbedWithProp && (
313
323
  <>
314
- <Title> {title || displayName} </Title>
324
+ <Title>{docPageTitle}</Title>
315
325
  <Description>{description}</Description>
316
326
  </>
317
327
  )}
@@ -24,14 +24,21 @@ const getParameters = (options: { files: IFiles }) => {
24
24
  return compress(JSON.stringify(options));
25
25
  };
26
26
 
27
+ const replaceAll = function (original: string, matchString: string, replaceString: string) {
28
+ // If a regex pattern
29
+ if (Object.prototype.toString.call(matchString).toLowerCase() === '[object regexp]') {
30
+ return original.replace(matchString, replaceString);
31
+ }
32
+
33
+ // If a string
34
+ return original.replace(new RegExp(matchString, 'g'), replaceString);
35
+ };
36
+
27
37
  export default (jsxStoryCode: string) => {
28
- const structuredCode = jsxStoryCode
29
- .trim()
30
- // @ts-ignore
31
- .replaceAll('// import', 'import')
32
- .replace('() => {', 'const App = () => {')
33
- .replaceAll('<>', '<React.Fragment>')
34
- .replaceAll('</>', '</React.Fragment>');
38
+ let structuredCode = replaceAll(jsxStoryCode.trim(), '// import', 'import').replace('() => {', 'const App = () => {');
39
+ structuredCode = replaceAll(structuredCode, '<>', '<React.Fragment>');
40
+ structuredCode = replaceAll(structuredCode, '</>', '</React.Fragment>');
41
+
35
42
  const code = `
36
43
  import ReactDOM from "react-dom";
37
44
  import React from "react";
@@ -33,12 +33,16 @@ export const getUpdatedZIndex = (ele: elementData): number | undefined => {
33
33
  return zIndex > 0 ? zIndex : undefined;
34
34
  };
35
35
 
36
- export const closeOnEscapeKeypress = (event: KeyboardEvent, isTopOverlay: boolean | undefined, onClose: Function) => {
37
-
36
+ // keyboard event, boolean?, (event: Event) => void
37
+ export const closeOnEscapeKeypress = (
38
+ event: KeyboardEvent,
39
+ isTopOverlay: boolean | undefined,
40
+ onClose: (event: Event) => void
41
+ ) => {
38
42
  if (event.key === 'Escape' && isTopOverlay) {
39
43
  onClose(event);
40
44
 
41
45
  // prevent browser-specific escape key behavior (Safari exits fullscreen)
42
46
  event.preventDefault();
43
47
  }
44
- }
48
+ };
@@ -42,7 +42,7 @@ const getCombinations = (Props: Record<string, any>): Record<string, any>[] => {
42
42
  const combinations: Record<string, any>[] = [];
43
43
  const propNames = Object.keys(Props);
44
44
 
45
- const iterateProps = (curr: Record<string, any> = {}, propIndex: number = 0): void => {
45
+ const iterateProps = (curr: Record<string, any> = {}, propIndex = 0): void => {
46
46
  const iterateValues = (propValues: any[]) => {
47
47
  for (const propValue of propValues) {
48
48
  if (isMapper(propValue)) {
@@ -2,7 +2,7 @@ export type SingleOrArray<T> = T | T[];
2
2
 
3
3
  export type MakeRequired<T> = Exclude<T, null | undefined>;
4
4
 
5
- export type MakeOptional<T extends {}, K extends keyof any> = Omit<T, K> & {
5
+ export type MakeOptional<T extends object, K extends keyof any> = Omit<T, K> & {
6
6
  [OK in keyof T & K]?: T[OK];
7
7
  };
8
8