@innovaccer/design-system 2.13.3 → 2.13.4-2

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 (349) hide show
  1. package/core/components/atoms/button/__stories__/SplitButton.story.jsx +1 -2
  2. package/core/components/atoms/checkbox/__stories__/Alignment.story.jsx +28 -26
  3. package/core/components/atoms/checkbox/__stories__/variants/Controlled.story.jsx +2 -2
  4. package/core/components/atoms/chip/__stories__/index.story.jsx +2 -2
  5. package/core/components/atoms/chip/__stories__/variants/Action.story.jsx +2 -2
  6. package/core/components/atoms/chip/__stories__/variants/Input.story.jsx +2 -2
  7. package/core/components/atoms/chip/__stories__/variants/Selection.story.jsx +6 -6
  8. package/core/components/atoms/chip/__stories__/variants/Type.story.jsx +2 -2
  9. package/core/components/atoms/chipGroup/_stories_/index.story.jsx +1 -1
  10. package/core/components/atoms/collapsible/__stories__/CustomTrigger.story.jsx +5 -71
  11. package/core/components/atoms/dropdown/Dropdown.tsx +18 -2
  12. package/core/components/atoms/dropdown/DropdownList.tsx +47 -57
  13. package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.jsx +4 -4
  14. package/core/components/atoms/dropdown/__stories__/DropdownItemsWithCheckbox.story.jsx +1 -3
  15. package/core/components/atoms/dropdown/__stories__/DropdownItemsWithIcon.story.jsx +2 -4
  16. package/core/components/atoms/dropdown/__stories__/DropdownItemsWithInfo.story.jsx +2 -5
  17. package/core/components/atoms/dropdown/__stories__/DropdownWIthIcon.story.jsx +3 -4
  18. package/core/components/atoms/dropdown/__stories__/DropdownWithActionButtons.story.jsx +9 -9
  19. package/core/components/atoms/dropdown/__stories__/DropdownWithCaption.story.jsx +7 -7
  20. package/core/components/atoms/dropdown/__stories__/Gender.story.jsx +6 -6
  21. package/core/components/atoms/dropdown/__stories__/LabelInline.story.jsx +58 -0
  22. package/core/components/atoms/dropdown/__stories__/{LabelPositionInDropdown.story.jsx → LabelOnTop.story.jsx} +8 -9
  23. package/core/components/atoms/dropdown/__stories__/Languages.story.jsx +6 -6
  24. package/core/components/atoms/dropdown/__stories__/Menu.story.jsx +5 -6
  25. package/core/components/atoms/dropdown/__stories__/OptionsLessThan50.story.jsx +3 -7
  26. package/core/components/atoms/dropdown/__stories__/OptionsMoreThan50.story.jsx +2 -2
  27. package/core/components/atoms/dropdown/__stories__/SearchInDropdown.story.jsx +3 -5
  28. package/core/components/atoms/dropdown/__stories__/StandardDropdown.story.jsx +2 -2
  29. package/core/components/atoms/dropdown/__stories__/StatusWithoutLabel.story.jsx +3 -3
  30. package/core/components/atoms/dropdown/__stories__/WithCheckboxAndSubInfo.story.jsx +2 -4
  31. package/core/components/atoms/dropdown/__stories__/index.story.jsx +2 -2
  32. package/core/components/atoms/dropdown/__stories__/variants/LoadingType.story.jsx +0 -1
  33. package/core/components/atoms/dropdown/__stories__/variants/PreSelection.story.jsx +2 -2
  34. package/core/components/atoms/dropdown/__stories__/variants/StaticLimit.story.jsx +2 -2
  35. package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/BulkMultiSelectWithApply.story.jsx +2 -2
  36. package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.jsx +2 -2
  37. package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/SingleSelect.story.jsx +4 -4
  38. package/core/components/atoms/dropdown/option/DefaultOption.tsx +1 -1
  39. package/core/components/atoms/dropdown/utility.tsx +6 -0
  40. package/core/components/atoms/icon/__stories__/variants/Image.story.jsx +1 -6
  41. package/core/components/atoms/input/__stories__/variants/Size.story.jsx +9 -9
  42. package/core/components/atoms/input/__stories__/variants/controlledInput.story.jsx +3 -3
  43. package/core/components/atoms/metaList/_stories_/index.story.jsx +0 -1
  44. package/core/components/atoms/rangeSlider/__stories__/index.story.jsx +2 -2
  45. package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.jsx +2 -2
  46. package/core/components/atoms/slider/__stories__/variants/Controlled.story.jsx +2 -2
  47. package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +4 -0
  48. package/core/components/molecules/dropzone/FileSelectorUtils.tsx +3 -0
  49. package/core/components/molecules/editableDropdown/__stories__/index.story.jsx +2 -2
  50. package/core/components/molecules/fullscreenModal/__stories__/DefaultWidth.story.jsx +4 -2
  51. package/core/components/molecules/fullscreenModal/__stories__/LargeWidth.story.jsx +4 -2
  52. package/core/components/molecules/fullscreenModal/__stories__/Layering.story.jsx +3 -1
  53. package/core/components/molecules/fullscreenModal/__stories__/Scrolling.story.jsx +4 -2
  54. package/core/components/molecules/fullscreenModal/__stories__/TwoStepWorkflow.story.jsx +1 -2
  55. package/core/components/molecules/fullscreenModal/__stories__/twoSteps.story.jsx +0 -1
  56. package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Large.story.jsx +0 -1
  57. package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Medium.story.jsx +0 -1
  58. package/core/components/molecules/modal/__stories__/Alert.story.jsx +3 -1
  59. package/core/components/molecules/modal/__stories__/Confirmation.story.jsx +3 -1
  60. package/core/components/molecules/modal/__stories__/Dialog.story.jsx +3 -1
  61. package/core/components/molecules/modal/__stories__/Input.story.jsx +3 -1
  62. package/core/components/molecules/modal/__stories__/Layering.story.jsx +3 -1
  63. package/core/components/molecules/modal/__stories__/NoFooter.story.jsx +3 -1
  64. package/core/components/molecules/modal/__stories__/Scrolling.story.jsx +4 -2
  65. package/core/components/molecules/modal/__stories__/index.story.jsx +3 -1
  66. package/core/components/molecules/modal/__stories__/old.story.jsx +3 -1
  67. package/core/components/molecules/modal/__stories__/variants/dimension/Large.story.jsx +3 -1
  68. package/core/components/molecules/modal/__stories__/variants/dimension/Medium.story.jsx +3 -1
  69. package/core/components/molecules/modal/__stories__/variants/dimension/Small.story.jsx +3 -1
  70. package/core/components/molecules/popover/__stories__/Actions.story.jsx +1 -6
  71. package/core/components/molecules/popover/__stories__/Inputs.story.jsx +1 -6
  72. package/core/components/molecules/popover/__stories__/Light.story.jsx +1 -6
  73. package/core/components/molecules/popover/__stories__/variants/boundaryElement.story.jsx +1 -1
  74. package/core/components/molecules/sidesheet/__stories__/index.story.jsx +3 -1
  75. package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.jsx +3 -1
  76. package/core/components/molecules/sidesheet/__stories__/variants/Layering.story.jsx +3 -1
  77. package/core/components/molecules/sidesheet/__stories__/variants/LayeringWithModal.story.jsx +3 -1
  78. package/core/components/molecules/sidesheet/__stories__/variants/dimension/Large.story.jsx +3 -1
  79. package/core/components/molecules/sidesheet/__stories__/variants/dimension/Regular.story.jsx +4 -2
  80. package/core/components/molecules/sidesheet/__stories__/variants/stickyFooter.story.jsx +3 -1
  81. package/core/components/molecules/sidesheet/__stories__/variants/twoSteps.story.jsx +6 -4
  82. package/core/components/molecules/tabs/__stories__/DismissibleTab.story.jsx +1 -0
  83. package/core/components/molecules/tooltip/__stories__/variants/Position.story.jsx +2 -13
  84. package/core/components/organisms/calendar/__stories__/index.story.jsx +40 -7
  85. package/core/components/organisms/calendar/__stories__/variants/size.story.jsx +2 -3
  86. package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
  87. package/core/components/organisms/dateRangePicker/__stories__/variants/withSingleInput.story.jsx +3 -0
  88. package/core/components/organisms/horizontalNav/__stories__/leftAlign.story.jsx +35 -19
  89. package/core/components/organisms/inlineMessage/__stories__/variants/Default.story.jsx +1 -3
  90. package/core/components/organisms/inlineMessage/__stories__/variants/Error.story.jsx +1 -3
  91. package/core/components/organisms/inlineMessage/__stories__/variants/Info.story.jsx +1 -3
  92. package/core/components/organisms/inlineMessage/__stories__/variants/Success.story.jsx +1 -3
  93. package/core/components/organisms/inlineMessage/__stories__/variants/Warning.story.jsx +1 -3
  94. package/core/components/organisms/pageHeader/__stories__/Responsiveness.story.jsx +2 -2
  95. package/core/components/organisms/pageHeader/__stories__/variants/withNavigation.story.jsx +2 -2
  96. package/core/components/organisms/pageHeader/__stories__/variants/withNavigationL1.story.jsx +2 -2
  97. package/core/components/organisms/pageHeader/__stories__/variants/withStepper.story.jsx +2 -2
  98. package/core/components/organisms/pageHeader/__stories__/variants/withStepperL1.story.jsx +2 -2
  99. package/core/components/organisms/pageHeader/__stories__/variants/withTabs.story.jsx +2 -2
  100. package/core/components/organisms/pageHeader/__stories__/variants/withTabsL1.story.jsx +2 -2
  101. package/core/components/organisms/pageHeader/__stories__/withFilter.story.jsx +2 -2
  102. package/core/components/organisms/pageHeader/__stories__/withFilterL1.story.jsx +2 -2
  103. package/core/components/organisms/pageHeader/__stories__/withNavigation.story.jsx +2 -2
  104. package/core/components/organisms/pageHeader/__stories__/withNavigationL1.story.jsx +9 -3
  105. package/core/components/organisms/pageHeader/__stories__/withStepperL1.story.jsx +4 -4
  106. package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.jsx +4 -4
  107. package/core/components/organisms/timePicker/TimePicker.tsx +6 -113
  108. package/core/components/organisms/timePicker/TimePickerWithInput.tsx +124 -0
  109. package/core/components/organisms/timePicker/TimePickerWithSearch.tsx +198 -0
  110. package/core/components/organisms/timePicker/__stories__/TimeIntervals.story.jsx +52 -0
  111. package/core/components/organisms/timePicker/__stories__/disabledOption.story.jsx +52 -0
  112. package/core/components/organisms/timePicker/__stories__/fromTo.story.jsx +72 -0
  113. package/core/components/organisms/timePicker/__stories__/showDuration.story.jsx +52 -0
  114. package/core/components/organisms/timePicker/__stories__/withDatePicker.story.jsx +88 -0
  115. package/core/components/organisms/timePicker/__stories__/{index.story.jsx → withInput.story.jsx} +6 -3
  116. package/core/components/organisms/timePicker/__stories__/withSearch.story.jsx +89 -0
  117. package/core/components/organisms/timePicker/__tests__/TimePickerWithSearch.test.tsx +464 -0
  118. package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePickerWithSearch.test.tsx.snap +169 -0
  119. package/core/components/organisms/timePicker/index.tsx +2 -0
  120. package/core/components/organisms/timePicker/utility/searchUtils.tsx +295 -0
  121. package/core/components/organisms/timePicker/utility/timePickerUtility.tsx +219 -0
  122. package/core/components/organisms/timePicker/utils.tsx +1 -1
  123. package/core/components/organisms/verticalNav/MenuItem.tsx +11 -6
  124. package/core/components/organisms/verticalNav/__stories__/CustomOptionsRenderer.story.jsx +10 -9
  125. package/core/components/organisms/verticalNav/__stories__/CustomTrigger.story.jsx +14 -12
  126. package/core/components/organisms/verticalNav/__stories__/FlatEdgedVerticalNav.story.jsx +5 -5
  127. package/core/components/organisms/verticalNav/__stories__/LabelOverflowBehaviour.story.jsx +9 -15
  128. package/core/components/organisms/verticalNav/__tests__/__snapshots__/VerticalNav.test.tsx.snap +26 -24
  129. package/core/index.tsx +1 -0
  130. package/css/dist/index.css +9 -8
  131. package/css/dist/index.css.map +1 -1
  132. package/css/src/components/dropdown.css +6 -6
  133. package/css/src/components/metricInput.css +1 -0
  134. package/css/src/components/verticalNav.css +2 -0
  135. package/dist/core/components/atoms/dropdown/Dropdown.d.ts +2 -0
  136. package/dist/core/components/atoms/dropdown/DropdownList.d.ts +1 -0
  137. package/dist/core/components/atoms/dropdown/utility.d.ts +1 -0
  138. package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +22 -22
  139. package/dist/core/components/organisms/datePicker/DatePicker.d.ts +1 -1
  140. package/dist/core/components/organisms/timePicker/TimePicker.d.ts +5 -13
  141. package/dist/core/components/organisms/timePicker/TimePickerWithInput.d.ts +24 -0
  142. package/dist/core/components/organisms/timePicker/TimePickerWithSearch.d.ts +32 -0
  143. package/dist/core/components/organisms/timePicker/index.d.ts +2 -0
  144. package/dist/core/components/organisms/timePicker/utility/searchUtils.d.ts +7 -0
  145. package/dist/core/components/organisms/timePicker/utility/timePickerUtility.d.ts +19 -0
  146. package/dist/core/index.d.ts +1 -0
  147. package/dist/index.esm.js +719 -52
  148. package/dist/index.js +648 -74
  149. package/dist/index.js.map +1 -1
  150. package/dist/index.umd.js +1 -1
  151. package/dist/index.umd.js.br +0 -0
  152. package/dist/index.umd.js.gz +0 -0
  153. package/docs/.eslintrc.json +32 -1
  154. package/docs/.prettierrc +6 -0
  155. package/docs/README.md +14 -0
  156. package/docs/cypress/e2e/main.cy.js +35 -0
  157. package/docs/cypress/fixtures/example.json +5 -0
  158. package/docs/cypress/support/commands.ts +37 -0
  159. package/docs/cypress/support/e2e.ts +20 -0
  160. package/docs/cypress.config.js +9 -0
  161. package/docs/package.json +16 -3
  162. package/docs/src/components/Colors/Colors.css +4 -0
  163. package/docs/src/components/Colors/Colors.js +56 -61
  164. package/docs/src/components/Container/ComponentsContainer.js +10 -30
  165. package/docs/src/components/Container/Container.js +10 -41
  166. package/docs/src/components/ErrorBoundary.js +9 -3
  167. package/docs/src/components/Footer/Footer.js +11 -10
  168. package/docs/src/components/GlobalSearch/index.js +47 -44
  169. package/docs/src/components/Header/Header.css +4 -0
  170. package/docs/src/components/Header/Header.js +25 -19
  171. package/docs/src/components/Layout.js +59 -303
  172. package/docs/src/components/LeftNav/LeftNav.js +12 -28
  173. package/docs/src/components/Logos/Logos.js +12 -26
  174. package/docs/src/components/MDXComponents.js +213 -0
  175. package/docs/src/components/MDXHeading.js +12 -18
  176. package/docs/src/components/Meta.js +9 -9
  177. package/docs/src/components/PropsTable/ArgJsDoc.tsx +2 -6
  178. package/docs/src/components/PropsTable/ArgRow.tsx +19 -47
  179. package/docs/src/components/PropsTable/ArgValue.tsx +50 -93
  180. package/docs/src/components/PropsTable/EmptyBlock.tsx +2 -5
  181. package/docs/src/components/PropsTable/SectionRow.tsx +7 -18
  182. package/docs/src/components/PropsTable/Table.tsx +43 -130
  183. package/docs/src/components/PropsTable/generateImports.tsx +1 -3
  184. package/docs/src/components/PropsTable/index.js +94 -140
  185. package/docs/src/components/PropsTable/prism.css +19 -20
  186. package/docs/src/components/Rules/DONTs.js +1 -6
  187. package/docs/src/components/Rules/DOs.js +1 -6
  188. package/docs/src/components/Rules/IconWrapper.js +6 -7
  189. package/docs/src/components/Rules/InlineMessage.js +1 -5
  190. package/docs/src/components/Rules/Rules.js +18 -28
  191. package/docs/src/components/TableOfContent/TableOfContent.css +8 -1
  192. package/docs/src/components/TableOfContent/TableOfContent.js +67 -58
  193. package/docs/src/components/css/global.css +1 -1
  194. package/docs/src/components/css/prism.css +1 -1
  195. package/docs/src/components/css/style.css +13 -5
  196. package/docs/src/components/templates/Default.js +1 -1
  197. package/docs/src/components/templates/Homepage.js +4 -6
  198. package/docs/src/data/components/Overview.js +49 -56
  199. package/docs/src/data/components/images/Calendar.png +0 -0
  200. package/docs/src/data/components/images/MetaList.png +0 -0
  201. package/docs/src/data/components/images/PageHeader.png +0 -0
  202. package/docs/src/data/components/images/TimePicker.png +0 -0
  203. package/docs/src/data/components/images/mobile/Badge.png +0 -0
  204. package/docs/src/data/components/images/mobile/Dropdown.png +0 -0
  205. package/docs/src/data/components/images/mobile/Message.png +0 -0
  206. package/docs/src/data/components/images/mobile/MetaList.png +0 -0
  207. package/docs/src/data/components/images/mobile/Slider.png +0 -0
  208. package/docs/src/data/components/images/mobile/StatusHint.png +0 -0
  209. package/docs/src/data/components/images/mobile/Stepper.png +0 -0
  210. package/docs/src/data/components/index.js +168 -321
  211. package/docs/src/data/components/mobile.js +85 -125
  212. package/docs/src/data/components/overview.css +4 -2
  213. package/docs/src/data/components/patterns.js +25 -59
  214. package/docs/src/data/header-items.yaml +1 -0
  215. package/docs/src/data/nav/components.yaml +2 -8
  216. package/docs/src/pages/404.js +7 -17
  217. package/docs/src/pages/components/avatar/usage.mdx +23 -19
  218. package/docs/src/pages/components/calendar/usage.mdx +3 -3
  219. package/docs/src/pages/components/checkbox/usage.mdx +1 -1
  220. package/docs/src/pages/components/chips/images/actionchip-state.png +0 -0
  221. package/docs/src/pages/components/chips/images/inputchips-state.png +0 -0
  222. package/docs/src/pages/components/chips/images/selectionchip-state.png +0 -0
  223. package/docs/src/pages/components/chips/usage.mdx +24 -2
  224. package/docs/src/pages/components/datePicker/images/datePicker-3.png +0 -0
  225. package/docs/src/pages/components/datePicker/images/datePicker-6.png +0 -0
  226. package/docs/src/pages/components/datePicker/usage.mdx +9 -2
  227. package/docs/src/pages/components/dropdowns/usage.mdx +1 -1
  228. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-2.png +0 -0
  229. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-3.png +0 -0
  230. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-1.png +0 -0
  231. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-4.png +0 -0
  232. package/docs/src/pages/components/inlineEditableFields/usage.mdx +4 -4
  233. package/docs/src/pages/components/inputs/usage.mdx +7 -7
  234. package/docs/src/pages/components/tabs/images/tabs-1.png +0 -0
  235. package/docs/src/pages/content/button-guidelines/tabs/button-glossary.mdx +1776 -1
  236. package/docs/src/pages/content/button-guidelines/tabs/confusing-buttons.mdx +479 -8
  237. package/docs/src/pages/content/email-guidelines.mdx +3 -3
  238. package/docs/src/pages/content/house-rules/tabs/date,-time-&-numbers.mdx +24 -0
  239. package/docs/src/pages/content/house-rules/tabs/grammer.mdx +42 -2
  240. package/docs/src/pages/content/house-rules/tabs/punctuations.mdx +32 -0
  241. package/docs/src/pages/foundations/colors.mdx +338 -24
  242. package/docs/src/pages/foundations/layout/index.mdx +57 -82
  243. package/docs/src/pages/foundations/response-time.mdx +32 -77
  244. package/docs/src/pages/foundations/typography.mdx +166 -0
  245. package/docs/src/pages/index.js +92 -121
  246. package/docs/src/pages/introduction/get-started/designers.mdx +28 -188
  247. package/docs/src/pages/introduction/get-started/images/designers-1.png +0 -0
  248. package/docs/src/pages/introduction/get-started/images/designers-2.png +0 -0
  249. package/docs/src/pages/introduction/what's-new.mdx +322 -15
  250. package/docs/src/pages/mobile/components/badges/images/badge-1.png +0 -0
  251. package/docs/src/pages/mobile/components/badges/images/badge-2.png +0 -0
  252. package/docs/src/pages/mobile/components/badges/images/badge-3.png +0 -0
  253. package/docs/src/pages/mobile/components/badges/images/badge-4.png +0 -0
  254. package/docs/src/pages/mobile/components/badges/images/badge-5.png +0 -0
  255. package/docs/src/pages/mobile/components/badges/usage.mdx +100 -0
  256. package/docs/src/pages/mobile/components/card/images/mcard-1.png +0 -0
  257. package/docs/src/pages/mobile/components/card/images/mcard-2.png +0 -0
  258. package/docs/src/pages/mobile/components/card/images/mcard-3.png +0 -0
  259. package/docs/src/pages/mobile/components/card/images/mcard-4.png +0 -0
  260. package/docs/src/pages/mobile/components/card/images/mcard-5.png +0 -0
  261. package/docs/src/pages/mobile/components/card/images/mcard-6.png +0 -0
  262. package/docs/src/pages/mobile/components/card/usage.mdx +54 -67
  263. package/docs/src/pages/mobile/components/checkbox/images/checkbox-1.png +0 -0
  264. package/docs/src/pages/mobile/components/checkbox/usage.mdx +26 -2
  265. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-1.png +0 -0
  266. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-10.png +0 -0
  267. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-11.png +0 -0
  268. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-2.png +0 -0
  269. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-3.png +0 -0
  270. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-4.png +0 -0
  271. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-5.png +0 -0
  272. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-6.png +0 -0
  273. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-7.png +0 -0
  274. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-8.png +0 -0
  275. package/docs/src/pages/mobile/components/dropdowns/images/dropdown-9.png +0 -0
  276. package/docs/src/pages/mobile/components/dropdowns/usage.mdx +88 -0
  277. package/docs/src/pages/mobile/components/message/images/messages-1.png +0 -0
  278. package/docs/src/pages/mobile/components/message/images/messages-10.png +0 -0
  279. package/docs/src/pages/mobile/components/message/images/messages-11.png +0 -0
  280. package/docs/src/pages/mobile/components/message/images/messages-12.png +0 -0
  281. package/docs/src/pages/mobile/components/message/images/messages-2.png +0 -0
  282. package/docs/src/pages/mobile/components/message/images/messages-3.png +0 -0
  283. package/docs/src/pages/mobile/components/message/images/messages-4.png +0 -0
  284. package/docs/src/pages/mobile/components/message/images/messages-5.png +0 -0
  285. package/docs/src/pages/mobile/components/message/images/messages-6.png +0 -0
  286. package/docs/src/pages/mobile/components/message/images/messages-7.png +0 -0
  287. package/docs/src/pages/mobile/components/message/images/messages-8.png +0 -0
  288. package/docs/src/pages/mobile/components/message/images/messages-9.png +0 -0
  289. package/docs/src/pages/mobile/components/message/usage.mdx +170 -0
  290. package/docs/src/pages/mobile/components/metaList/images/metaList-1.png +0 -0
  291. package/docs/src/pages/mobile/components/metaList/images/metaList-2.png +0 -0
  292. package/docs/src/pages/mobile/components/metaList/images/metaList-3.png +0 -0
  293. package/docs/src/pages/mobile/components/metaList/images/metaList-4.png +0 -0
  294. package/docs/src/pages/mobile/components/metaList/usage.mdx +71 -0
  295. package/docs/src/pages/mobile/components/slider/images/slider-1.png +0 -0
  296. package/docs/src/pages/mobile/components/slider/images/slider-2.png +0 -0
  297. package/docs/src/pages/mobile/components/slider/images/slider-3.png +0 -0
  298. package/docs/src/pages/mobile/components/slider/images/slider-4.png +0 -0
  299. package/docs/src/pages/mobile/components/slider/images/slider-5.png +0 -0
  300. package/docs/src/pages/mobile/components/slider/usage.mdx +83 -0
  301. package/docs/src/pages/mobile/components/statusHint/images/statushint-1.png +0 -0
  302. package/docs/src/pages/mobile/components/statusHint/images/statushint-2.png +0 -0
  303. package/docs/src/pages/mobile/components/statusHint/images/statushint-3.png +0 -0
  304. package/docs/src/pages/mobile/components/statusHint/images/statushint-4.png +0 -0
  305. package/docs/src/pages/mobile/components/statusHint/images/statushint-5.png +0 -0
  306. package/docs/src/pages/mobile/components/statusHint/images/statushint-6.png +0 -0
  307. package/docs/src/pages/mobile/components/statusHint/images/statushint-7.png +0 -0
  308. package/docs/src/pages/mobile/components/statusHint/usage.mdx +108 -0
  309. package/docs/src/pages/mobile/components/steppers/images/stepper-1.png +0 -0
  310. package/docs/src/pages/mobile/components/steppers/images/stepper-2.png +0 -0
  311. package/docs/src/pages/mobile/components/steppers/images/stepper-3.png +0 -0
  312. package/docs/src/pages/mobile/components/steppers/images/stepper-4.png +0 -0
  313. package/docs/src/pages/mobile/components/steppers/images/stepper-5.png +0 -0
  314. package/docs/src/pages/mobile/components/steppers/images/stepper-6.png +0 -0
  315. package/docs/src/pages/mobile/components/steppers/usage.mdx +111 -0
  316. package/docs/src/pages/mobile/foundations/layout/images/layout-2.png +0 -0
  317. package/docs/src/pages/mobile/foundations/layout/index.mdx +3 -1
  318. package/docs/src/pages/mobile/foundations/page-types/index.mdx +0 -214
  319. package/docs/src/pages/mobile/foundations/spacing/index.mdx +5 -0
  320. package/docs/src/pages/mobile/foundations/typography.mdx +1 -1
  321. package/docs/src/pages/patterns/uiStates/usage.mdx +92 -0
  322. package/docs/src/util/Frontmatter.js +4 -4
  323. package/docs/src/util/HeaderItems.js +2 -1
  324. package/docs/src/util/Helpers.js +3 -3
  325. package/docs/src/util/HomeIcons.js +91 -53
  326. package/docs/src/util/InPageNavItems.js +2 -6
  327. package/docs/src/util/Logos.js +2 -2
  328. package/docs/src/util/MdsChangelog.js +5 -10
  329. package/docs/src/util/MediumBlogs.js +13 -13
  330. package/docs/src/util/NavItems.js +14 -17
  331. package/docs/src/util/Search.js +2 -2
  332. package/docs/src/util/StorybookData.js +2 -4
  333. package/docs/src/util/constants.js +1 -5
  334. package/docs/src/util/context/NavContext.js +1 -4
  335. package/docs/src/util/hooks/useMetadata.js +1 -1
  336. package/docs/tools/build.sh +1 -0
  337. package/docs/tools/changelog.sh +1 -1
  338. package/package.json +3 -3
  339. package/docs/src/pages/components/index.mdx +0 -11
  340. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-2.png +0 -0
  341. package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-3.png +0 -0
  342. package/docs/src/pages/content/button-guidelines/index.mdx +0 -7
  343. package/docs/src/pages/content/voice-and-tone-guidelines/index.mdx +0 -7
  344. package/docs/src/pages/introduction/get-started/images/designers-3.png +0 -0
  345. package/docs/src/pages/introduction/get-started/images/designers-4.png +0 -0
  346. package/docs/src/pages/introduction/get-started/images/designers-5.png +0 -0
  347. package/docs/src/pages/introduction/get-started/images/designers-6.png +0 -0
  348. package/docs/src/pages/introduction/get-started/images/designers-7.png +0 -0
  349. package/docs/src/pages/introduction/get-started/images/designers-8.png +0 -0
@@ -0,0 +1,124 @@
1
+ import * as React from 'react';
2
+ import { InputMask, Utils } from '@/index';
3
+ import { InputMaskProps } from '@/index.type';
4
+ import { Validators } from '@/utils/types';
5
+
6
+ import { translateToTime, getOutputTimeString, placeholders, isPlaceholderPresent } from './utils';
7
+
8
+ export type AMPMType = 'AM' | 'PM';
9
+ export type InputFormat = 'hh:mm AM' | 'hh:mm';
10
+ export type TimeType = number | string;
11
+
12
+ export interface TimePickerInputProps {
13
+ /**
14
+ * Selected time
15
+ *
16
+ * `number` - number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC
17
+ *
18
+ * **`string` - Time string value as per `inputFormat`**
19
+ */
20
+ time?: TimeType;
21
+ /**
22
+ * Props to be used for `InputMask`
23
+ */
24
+ inputOptions: Omit<InputMaskProps, 'mask' | 'value' | 'validators'>;
25
+ /**
26
+ * Should be used if `time` is of type `string`
27
+ *
28
+ * Also determines mask format
29
+ */
30
+ inputFormat: InputFormat;
31
+ /**
32
+ * Should be used to translate `time` to desired format for `onTimeChange` callback
33
+ */
34
+ outputFormat: InputFormat;
35
+ /**
36
+ * custom Validator for `TimePicker`
37
+ * `boolean | ((val?: string) => boolean)`
38
+ */
39
+ validators: Validators;
40
+ /**
41
+ * Callback function called when input field is blurred
42
+ */
43
+ onTimeChange?: (timeVal?: string) => void;
44
+ }
45
+
46
+ export const TimePickerWithInput = (props: TimePickerInputProps) => {
47
+ const { validators, inputOptions, inputFormat, outputFormat, onTimeChange, time: timeProp } = props;
48
+
49
+ const [time, setTime] = React.useState(timeProp);
50
+ const [init, setInit] = React.useState(false);
51
+ const { placeholderChar = '_' } = inputOptions;
52
+
53
+ React.useEffect(() => {
54
+ const timeStr = translateToTime(inputFormat, time);
55
+ const updatedTime = timeProp === undefined && timeStr.includes(placeholderChar) ? time : timeProp;
56
+
57
+ setTime(updatedTime);
58
+ }, [timeProp]);
59
+
60
+ const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>, val = '') => {
61
+ const updatedTime = val?.toUpperCase();
62
+ setTime(updatedTime);
63
+
64
+ if (inputOptions.onChange) {
65
+ inputOptions.onChange(e, val);
66
+ }
67
+ };
68
+
69
+ const onBlurHandler = (e: React.ChangeEvent<HTMLInputElement>, val = '') => {
70
+ const updatedTime = translateToTime(inputFormat, time);
71
+ setInit(true);
72
+
73
+ if (onTimeChange) {
74
+ const outputTimeStr =
75
+ updatedTime && !isPlaceholderPresent(placeholderChar, updatedTime)
76
+ ? getOutputTimeString(inputFormat, outputFormat, updatedTime)
77
+ : undefined;
78
+
79
+ onTimeChange(outputTimeStr);
80
+ }
81
+
82
+ if (inputOptions.onBlur) inputOptions.onBlur(e, val);
83
+ };
84
+
85
+ const onClearHandler = (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => {
86
+ const updatedTime = '';
87
+ setInit(true);
88
+
89
+ if (onTimeChange) onTimeChange(updatedTime);
90
+ if (inputOptions.onClear) inputOptions.onClear(e);
91
+ };
92
+
93
+ const inputValidator = (val: string): boolean => {
94
+ return Utils.validators.isValid(validators, val, inputFormat);
95
+ };
96
+
97
+ const mask = Utils.masks.time[inputFormat];
98
+ return (
99
+ <InputMask
100
+ placeholder={placeholders[inputFormat]}
101
+ placeholderChar={placeholderChar}
102
+ {...inputOptions}
103
+ mask={mask}
104
+ value={
105
+ time ? translateToTime(inputFormat, time) : init ? InputMask.utils.getDefaultValue(mask, placeholderChar) : ''
106
+ }
107
+ validators={inputValidator}
108
+ onChange={onChangeHandler}
109
+ onClear={onClearHandler}
110
+ onBlur={onBlurHandler}
111
+ id="parent-TimePicker"
112
+ />
113
+ );
114
+ };
115
+
116
+ TimePickerWithInput.defaultProps = {
117
+ inputFormat: 'hh:mm AM',
118
+ outputFormat: 'hh:mm AM',
119
+ inputOptions: {},
120
+ validators: [Utils.validators.time],
121
+ };
122
+
123
+ TimePickerWithInput.displayName = 'TimePickerWithInput';
124
+ export default TimePickerWithInput;
@@ -0,0 +1,198 @@
1
+ import * as React from 'react';
2
+ import { Dropdown } from '@/index';
3
+ import { BaseProps } from '@/utils/types';
4
+ import { getScrollIndex } from './utility/searchUtils';
5
+ import { OptionSchema } from '@/components/atoms/dropdown/option';
6
+ import { scrollToOptionIndex } from '@/components/atoms/dropdown/utility';
7
+ import { getDropdownOptionList, isFormat12Hour, convert24To12HourFormat } from './utility/timePickerUtility';
8
+
9
+ type fetchOptionsFunction = (searchTerm: string) => Promise<{
10
+ count: number;
11
+ searchTerm?: string;
12
+ scrollToIndex?: number;
13
+ options: OptionSchema[];
14
+ }>;
15
+
16
+ export type TimeFormat = '12-Hour' | '24-Hour';
17
+
18
+ export interface TimePickerDropdownProps extends BaseProps {
19
+ /**
20
+ * Set as `true` to show timePicker with search
21
+ */
22
+ withSearch?: boolean;
23
+ /**
24
+ * Indicates the start time for the options in particular time format `hh:mm [AM | PM]` or `hh:mm`
25
+ */
26
+ startTime?: string;
27
+ /**
28
+ * Indicates the end time for the options in particular time format `hh:mm [AM | PM]` or `hh:mm`
29
+ */
30
+ endTime?: string;
31
+ /**
32
+ * Depicts the time interval in `minutes` between options
33
+ */
34
+ interval: number;
35
+ /**
36
+ * Indicates time format for options list
37
+ */
38
+ timeFormat: TimeFormat;
39
+ /**
40
+ * Determines if the `TimePicker Popover` is open
41
+ */
42
+ open?: boolean;
43
+ /**
44
+ * Display message when there is no result
45
+ */
46
+ noResultMessage?: string;
47
+ /**
48
+ * Set as `true` to display time difference in option label w.r.t start time
49
+ */
50
+ showDuration?: boolean;
51
+ /**
52
+ * Specify list of options in `hh:mm [AM | PM]` or `hh:mm` time format which need to be set as disabled
53
+ */
54
+ disabledSlotList?: string[];
55
+ /**
56
+ * Callback function which is called when options are selected from dropdown.
57
+ */
58
+ onChange?: (selected: any[] | any, name?: string | number) => void;
59
+ /**
60
+ * Callback function to fetch options list from API based on search term
61
+ *
62
+ * <pre className="DocPage-codeBlock p-4">
63
+ * fetchOptionsFunction: (searchTerm: string) => Promise<{
64
+ * searchTerm?: string;
65
+ * count: number,
66
+ * options: OptionSchema[];
67
+ * scrollToIndex?: number;
68
+ * }>;
69
+ * <br/> <br/>
70
+ *
71
+ * OptionSchema: {
72
+ * label: string;
73
+ * value: React.ReactText;
74
+ * icon?: string;
75
+ * subInfo?: string | [MetaListProps]
76
+ * optionType?: OptionType;
77
+ * selected?: boolean;
78
+ * disabled?: boolean;
79
+ * group?: string;
80
+ * }
81
+ * </pre>
82
+ *
83
+ */
84
+ fetchTimeOptions?: fetchOptionsFunction;
85
+ /**
86
+ * Provide unique ID in case of using multiple timePicker together
87
+ */
88
+ id?: string;
89
+ }
90
+
91
+ export const TimePickerWithSearch = (props: TimePickerDropdownProps) => {
92
+ const {
93
+ open,
94
+ endTime,
95
+ interval,
96
+ onChange,
97
+ startTime,
98
+ timeFormat,
99
+ showDuration,
100
+ noResultMessage,
101
+ disabledSlotList,
102
+ fetchTimeOptions,
103
+ } = props;
104
+
105
+ const [tabIndex, setTabIndex] = React.useState(0);
106
+ const [openPopover, setOpenPopover] = React.useState(false);
107
+ const [selectedIndex, setSelectedIndex] = React.useState(-1);
108
+ const [counter, setCounter] = React.useState(0);
109
+
110
+ const dropdownOptionList = getDropdownOptionList(props);
111
+
112
+ React.useEffect(() => {
113
+ open !== undefined && setOpenPopover(open);
114
+ }, [open]);
115
+
116
+ React.useEffect(() => {
117
+ let timer: any;
118
+
119
+ if (openPopover && selectedIndex != -1) {
120
+ setTabIndex(selectedIndex);
121
+
122
+ timer = setTimeout(() => {
123
+ scrollToOptionIndex(selectedIndex, dropdownOptionList);
124
+ }, 100);
125
+ }
126
+ return () => {
127
+ clearTimeout(timer);
128
+ };
129
+ }, [openPopover]);
130
+
131
+ // Required to re-render dropdown forcefully whenever props changes
132
+ React.useEffect(() => {
133
+ setCounter(counter + 1);
134
+ }, [startTime, endTime, interval, showDuration, disabledSlotList]);
135
+
136
+ const onChangeHandler = (props: string) => {
137
+ let time = props;
138
+
139
+ if (isFormat12Hour(timeFormat)) {
140
+ time = convert24To12HourFormat(time);
141
+ }
142
+
143
+ const selectIndex = dropdownOptionList.findIndex((option) => option.value === props);
144
+ setSelectedIndex(selectIndex);
145
+ onChange && onChange(time);
146
+ };
147
+
148
+ const getOptionList = (searchTerm: string) => {
149
+ let scrollIndex;
150
+ const indexValue = getScrollIndex(dropdownOptionList, searchTerm);
151
+
152
+ if (searchTerm === '' && selectedIndex != -1) {
153
+ scrollIndex = selectedIndex;
154
+ setTabIndex(selectedIndex);
155
+ } else {
156
+ scrollIndex = indexValue;
157
+ setTabIndex(indexValue);
158
+ }
159
+
160
+ return Promise.resolve({
161
+ options: indexValue === -1 ? [] : dropdownOptionList,
162
+ count: dropdownOptionList.length,
163
+ scrollToIndex: scrollIndex === 0 ? scrollIndex + 1 : scrollIndex,
164
+ searchTerm,
165
+ });
166
+ };
167
+
168
+ const fetchOptionList = () => {
169
+ return fetchTimeOptions ? fetchTimeOptions : getOptionList;
170
+ };
171
+
172
+ return (
173
+ <Dropdown
174
+ key={counter}
175
+ maxHeight={160}
176
+ loadersCount={0}
177
+ withSearch={true}
178
+ open={openPopover}
179
+ tabIndex={tabIndex}
180
+ searchPlaceholder="Search"
181
+ onChange={onChangeHandler}
182
+ fetchOptions={fetchOptionList()}
183
+ noResultMessage={noResultMessage}
184
+ staticLimit={dropdownOptionList.length}
185
+ onPopperToggle={() => {
186
+ setOpenPopover(!openPopover);
187
+ }}
188
+ />
189
+ );
190
+ };
191
+
192
+ TimePickerWithSearch.defaultProps = {
193
+ timeFormat: '12-Hour',
194
+ interval: 15,
195
+ };
196
+
197
+ TimePickerWithSearch.displayName = 'TimePickerWithSearch';
198
+ export default TimePickerWithSearch;
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import { TimePicker, Label, Row } from '@/index';
3
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
4
+ import { TimePickerWithInput } from '../TimePickerWithInput';
5
+
6
+ // CSF format story
7
+ export const TimeIntervals = () => {
8
+ return (
9
+ <Row>
10
+ <div className="w-25">
11
+ <Label>12 Hour Format (1 hour Interval)</Label>
12
+ <TimePicker withSearch={true} interval={60} id="12-hour" />
13
+ </div>
14
+
15
+ <div className="w-25 ml-7">
16
+ <Label>24 Hour Format (1 hour Interval)</Label>
17
+ <TimePicker timeFormat="24-Hour" withSearch={true} interval={60} id="24-hour" />
18
+ </div>
19
+ </Row>
20
+ );
21
+ };
22
+
23
+ const customCode = `() => {
24
+
25
+ return (
26
+ <Row>
27
+ <div className="w-25">
28
+ <Label>12 Hour Format (1 hour Interval)</Label>
29
+ <TimePicker withSearch={true} interval={60} id="12-hour" />
30
+ </div>
31
+
32
+ <div className="w-25 ml-7">
33
+ <Label>24 Hour Format (1 hour Interval)</Label>
34
+ <TimePicker timeFormat="24-Hour" withSearch={true} interval={60} id="24-hour" />
35
+ </div>
36
+ </Row>
37
+ );
38
+ }`;
39
+
40
+ export default {
41
+ title: 'Components/TimePicker/Time Intervals',
42
+ component: TimePickerWithInput,
43
+ subcomponents: { TimePickerWithSearch },
44
+ parameters: {
45
+ docs: {
46
+ docPage: {
47
+ customCode,
48
+ title: 'TimePicker',
49
+ },
50
+ },
51
+ },
52
+ };
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import { TimePicker, Label, Row } from '@/index';
3
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
4
+ import { TimePickerWithInput } from '../TimePickerWithInput';
5
+
6
+ // CSF format story
7
+ export const disabledOption = () => {
8
+ return (
9
+ <Row>
10
+ <div className="w-25">
11
+ <Label>12 Hour Format</Label>
12
+ <TimePicker withSearch={true} disabledSlotList={['12:45 AM', '01:00 AM']} id="12-hour" />
13
+ </div>
14
+
15
+ <div className="w-25 ml-7">
16
+ <Label>24 Hour Format</Label>
17
+ <TimePicker timeFormat="24-Hour" withSearch={true} disabledSlotList={['00:45', '01:00']} id="24-hour" />
18
+ </div>
19
+ </Row>
20
+ );
21
+ };
22
+
23
+ const customCode = `() => {
24
+
25
+ return (
26
+ <Row>
27
+ <div className="w-25">
28
+ <Label>12 Hour Format</Label>
29
+ <TimePicker withSearch={true} disabledSlotList={['12:45 AM', '01:00 AM']} id="12-hour" />
30
+ </div>
31
+
32
+ <div className="w-25 ml-7">
33
+ <Label>24 Hour Format</Label>
34
+ <TimePicker timeFormat="24-Hour" withSearch={true} disabledSlotList={['00:45', '01:00']} id="24-hour" />
35
+ </div>
36
+ </Row>
37
+ );
38
+ }`;
39
+
40
+ export default {
41
+ title: 'Components/TimePicker/Disabled Option',
42
+ component: TimePickerWithInput,
43
+ subcomponents: { TimePickerWithSearch },
44
+ parameters: {
45
+ docs: {
46
+ docPage: {
47
+ customCode,
48
+ title: 'TimePicker',
49
+ },
50
+ },
51
+ },
52
+ };
@@ -0,0 +1,72 @@
1
+ import * as React from 'react';
2
+ import { TimePicker, Label } from '@/index';
3
+ import { TimePickerWithInput } from '../TimePickerWithInput';
4
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
5
+
6
+ // CSF format story
7
+ export const FromTo = () => {
8
+ const [startTime, setStartTime] = React.useState('00:00');
9
+
10
+ const onFromChangeHandler = (props) => {
11
+ setStartTime(props);
12
+ };
13
+
14
+ return (
15
+ <div className="d-flex">
16
+ <div className="w-25 mr-5">
17
+ <Label withInput={true}>From</Label>
18
+ <TimePicker
19
+ withSearch={true}
20
+ startTime="00:15 AM"
21
+ endTime="11:45 PM"
22
+ onChange={onFromChangeHandler}
23
+ id="From"
24
+ />
25
+ </div>
26
+
27
+ <div className="w-25">
28
+ <Label withInput={true}>To</Label>
29
+ <TimePicker withSearch={true} startTime={startTime} endTime="11:45 PM" showDuration={true} id="To" />
30
+ </div>
31
+ </div>
32
+ );
33
+ };
34
+
35
+ const customCode = `() => {
36
+
37
+ const [startTime, setStartTime] = React.useState('00:00');
38
+
39
+ const onFromChangeHandler = (props) => {
40
+ setStartTime(props);
41
+ };
42
+
43
+ return (
44
+ <div className="d-flex">
45
+ <div className="w-25 mr-5">
46
+ <Label withInput={true}>From</Label>
47
+ <TimePicker withSearch={true} startTime="00:15 AM" endTime="11:45 PM" onChange={onFromChangeHandler} id="From" />
48
+ </div>
49
+
50
+ <div className="w-25">
51
+ <Label withInput={true}>To</Label>
52
+ <TimePicker withSearch={true} startTime={startTime} endTime="11:45 PM" showDuration={true} id="To" />
53
+ </div>
54
+ </div>
55
+ );
56
+ }`;
57
+
58
+ export default {
59
+ title: 'Components/TimePicker/From To',
60
+ component: TimePicker,
61
+ parameters: {
62
+ docs: {
63
+ docPage: {
64
+ customCode,
65
+ title: 'TimePicker',
66
+ props: {
67
+ components: { TimePickerWithInput, TimePickerWithSearch },
68
+ },
69
+ },
70
+ },
71
+ },
72
+ };
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import { TimePicker, Label, Row } from '@/index';
3
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
4
+ import { TimePickerWithInput } from '../TimePickerWithInput';
5
+
6
+ // CSF format story
7
+ export const timeDuration = () => {
8
+ return (
9
+ <Row>
10
+ <div className="w-25">
11
+ <Label>12 Hour Format</Label>
12
+ <TimePicker startTime="05:00" withSearch={true} showDuration={true} id="12-hour" />
13
+ </div>
14
+
15
+ <div className="w-25 ml-7">
16
+ <Label>24 Hour Format</Label>
17
+ <TimePicker startTime="05:00" timeFormat="24-Hour" withSearch={true} showDuration={true} id="24-hour" />
18
+ </div>
19
+ </Row>
20
+ );
21
+ };
22
+
23
+ const customCode = `() => {
24
+
25
+ return (
26
+ <Row>
27
+ <div className="w-25">
28
+ <Label>12 Hour Format</Label>
29
+ <TimePicker startTime="05:00" withSearch={true} showDuration={true} id="12-hour" />
30
+ </div>
31
+
32
+ <div className="w-25 ml-7">
33
+ <Label>24 Hour Format</Label>
34
+ <TimePicker startTime="05:00" timeFormat="24-Hour" withSearch={true} showDuration={true} id="24-hour" />
35
+ </div>
36
+ </Row>
37
+ );
38
+ }`;
39
+
40
+ export default {
41
+ title: 'Components/TimePicker/Time Duration',
42
+ component: TimePickerWithInput,
43
+ subcomponents: { TimePickerWithSearch },
44
+ parameters: {
45
+ docs: {
46
+ docPage: {
47
+ customCode,
48
+ title: 'TimePicker',
49
+ },
50
+ },
51
+ },
52
+ };
@@ -0,0 +1,88 @@
1
+ import * as React from 'react';
2
+ import { TimePicker, DatePicker, Row, Label } from '@/index';
3
+ import { TimePickerWithInput } from '../TimePickerWithInput';
4
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
5
+
6
+ // CSF format story
7
+ export const withDatePicker = () => {
8
+ const [open, setOpen] = React.useState(false);
9
+
10
+ const handleDateChange = (date) => {
11
+ if (date) {
12
+ setOpen(false);
13
+ this.window.setTimeout(() => {
14
+ setOpen(true);
15
+ }, 0);
16
+ }
17
+ };
18
+
19
+ return (
20
+ <Row>
21
+ <div className="w-25">
22
+ <Label>Date</Label>
23
+ <DatePicker
24
+ firstDayOfWeek="saturday"
25
+ onDateChange={handleDateChange}
26
+ outputFormat="yyyy/mm/dd"
27
+ withInput={true}
28
+ inputOptions={{
29
+ required: true,
30
+ }}
31
+ />
32
+ </div>
33
+ <div className="w-25 ml-7">
34
+ <Label>Time</Label>
35
+ <TimePicker withSearch={true} open={open} />
36
+ </div>
37
+ </Row>
38
+ );
39
+ };
40
+
41
+ const customCode = `() => {
42
+
43
+ const [open, setOpen] = React.useState(false);
44
+
45
+ const handleDateChange = (date) => {
46
+ if(date) {
47
+ setOpen(false);
48
+ setTimeout(() => {
49
+ setOpen(true);
50
+ }, 0);
51
+ }
52
+ };
53
+
54
+ return (
55
+ <Row>
56
+ <div className="w-25">
57
+ <Label>Date</Label>
58
+ <DatePicker
59
+ firstDayOfWeek="saturday"
60
+ onDateChange={handleDateChange}
61
+ outputFormat="yyyy/mm/dd"
62
+ withInput={true}
63
+ inputOptions={{
64
+ required: true,
65
+ }}
66
+ />
67
+ </div>
68
+ <div className="w-25 ml-7">
69
+ <Label>Time</Label>
70
+ <TimePicker withSearch={true} open={open} />
71
+ </div>
72
+ </Row>
73
+ );
74
+ }`;
75
+
76
+ export default {
77
+ title: 'Components/TimePicker/With Date Picker',
78
+ component: TimePickerWithInput,
79
+ subcomponents: { TimePickerWithSearch },
80
+ parameters: {
81
+ docs: {
82
+ docPage: {
83
+ customCode,
84
+ title: 'TimePicker',
85
+ },
86
+ },
87
+ },
88
+ };
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { TimePicker } from '@/index';
3
3
  import { action } from '@/utils/action';
4
+ import { TimePickerWithSearch } from '../TimePickerWithSearch';
5
+ import { TimePickerWithInput } from '../TimePickerWithInput';
4
6
 
5
7
  // CSF format story
6
- export const all = () => {
8
+ export const withInput = () => {
7
9
  const inputFormat = 'hh:mm AM';
8
10
 
9
11
  const outputFormat = 'hh:mm';
@@ -41,8 +43,9 @@ const customCode = `() => {
41
43
  }`;
42
44
 
43
45
  export default {
44
- title: 'Components/TimePicker/All',
45
- component: TimePicker,
46
+ title: 'Components/TimePicker/With Input',
47
+ component: TimePickerWithInput,
48
+ subcomponents: { TimePickerWithSearch },
46
49
  parameters: {
47
50
  docs: {
48
51
  docPage: {