@carbon/react 0.16.2 → 1.0.0-rc.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 (668) hide show
  1. package/README.md +1 -1
  2. package/es/_virtual/ResizeObserver.es.js +13 -0
  3. package/es/_virtual/_commonjsHelpers.js +29 -0
  4. package/es/_virtual/_rollupPluginBabelHelpers.js +354 -0
  5. package/es/{prefix.js → _virtual/index.js} +2 -2
  6. package/es/_virtual/rangePlugin.js +10 -0
  7. package/es/components/Accordion/Accordion.Skeleton.js +103 -0
  8. package/es/components/Accordion/Accordion.js +68 -0
  9. package/es/components/Accordion/AccordionItem.js +181 -0
  10. package/es/components/Accordion/index.js +9 -0
  11. package/es/components/AccordionItem/index.js +11 -0
  12. package/es/components/AspectRatio/AspectRatio.js +67 -0
  13. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +45 -0
  14. package/es/components/Breadcrumb/Breadcrumb.js +58 -0
  15. package/es/components/Breadcrumb/BreadcrumbItem.js +94 -0
  16. package/es/components/Button/Button.Skeleton.js +71 -0
  17. package/es/components/Button/Button.js +351 -0
  18. package/es/components/ButtonSet/ButtonSet.js +48 -0
  19. package/es/components/Checkbox/Checkbox.Skeleton.js +36 -0
  20. package/es/components/Checkbox/Checkbox.js +136 -0
  21. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +58 -0
  22. package/es/components/CodeSnippet/CodeSnippet.js +372 -0
  23. package/es/components/ComboBox/ComboBox.js +532 -0
  24. package/es/components/ComboBox/tools/filter.js +20 -0
  25. package/es/components/ComposedModal/ComposedModal.js +630 -0
  26. package/es/components/ComposedModal/index.js +19 -0
  27. package/es/components/ComposedModal/next/ComposedModal.js +223 -0
  28. package/es/components/ComposedModal/next/ModalFooter.js +213 -0
  29. package/es/components/ComposedModal/next/ModalHeader.js +127 -0
  30. package/es/components/ContentSwitcher/ContentSwitcher.js +185 -0
  31. package/es/components/ContextMenu/useContextMenu.js +57 -0
  32. package/es/components/Copy/Copy.js +124 -0
  33. package/es/components/CopyButton/CopyButton.js +67 -0
  34. package/es/components/DangerButton/DangerButton.js +20 -0
  35. package/es/components/DataTable/DataTable.js +638 -0
  36. package/es/components/DataTable/Table.js +90 -0
  37. package/es/components/DataTable/TableActionList.js +17 -0
  38. package/es/components/DataTable/TableBatchAction.js +45 -0
  39. package/es/components/DataTable/TableBatchActions.js +110 -0
  40. package/es/components/DataTable/TableBody.js +37 -0
  41. package/es/components/DataTable/TableCell.js +16 -0
  42. package/es/components/DataTable/TableContainer.js +66 -0
  43. package/es/components/DataTable/TableExpandHeader.js +86 -0
  44. package/es/components/DataTable/TableExpandRow.js +93 -0
  45. package/es/components/DataTable/TableExpandedRow.js +75 -0
  46. package/es/components/DataTable/TableHead.js +16 -0
  47. package/es/components/DataTable/TableHeader.js +187 -0
  48. package/es/components/DataTable/TableRow.js +41 -0
  49. package/es/components/DataTable/TableSelectAll.js +84 -0
  50. package/es/components/DataTable/TableSelectRow.js +97 -0
  51. package/es/components/DataTable/TableToolbar.js +48 -0
  52. package/es/components/DataTable/TableToolbarAction.js +31 -0
  53. package/es/components/DataTable/TableToolbarContent.js +17 -0
  54. package/es/components/DataTable/TableToolbarMenu.js +61 -0
  55. package/es/components/DataTable/TableToolbarSearch.js +242 -0
  56. package/es/components/DataTable/index.js +72 -0
  57. package/es/components/DataTable/state/getDerivedStateFromProps.js +52 -0
  58. package/es/components/DataTable/state/sortStates.js +19 -0
  59. package/es/components/DataTable/state/sorting.js +93 -0
  60. package/es/components/DataTable/tools/cells.js +21 -0
  61. package/es/components/DataTable/tools/denormalize.js +43 -0
  62. package/es/components/DataTable/tools/filter.js +42 -0
  63. package/es/components/DataTable/tools/instanceId.js +21 -0
  64. package/es/components/DataTable/tools/normalize.js +78 -0
  65. package/es/components/DataTable/tools/sorting.js +110 -0
  66. package/es/components/DataTableSkeleton/DataTableSkeleton.js +133 -0
  67. package/es/components/DatePicker/DatePicker.Skeleton.js +69 -0
  68. package/es/components/DatePicker/DatePicker.js +622 -0
  69. package/es/components/DatePicker/index.js +15 -0
  70. package/es/components/DatePicker/next/DatePicker.js +558 -0
  71. package/es/components/DatePicker/plugins/appendToPlugin.js +58 -0
  72. package/es/components/DatePicker/plugins/fixEventsPlugin.js +89 -0
  73. package/es/components/DatePicker/plugins/rangePlugin.js +51 -0
  74. package/es/components/DatePickerInput/DatePickerInput.js +271 -0
  75. package/es/components/DatePickerInput/index.js +15 -0
  76. package/es/components/DatePickerInput/next/DatePickerInput.js +269 -0
  77. package/es/components/Dropdown/Dropdown.Skeleton.js +55 -0
  78. package/es/components/Dropdown/Dropdown.js +327 -0
  79. package/es/components/ErrorBoundary/ErrorBoundary.js +96 -0
  80. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +16 -0
  81. package/es/components/ExpandableSearch/ExpandableSearch.js +67 -0
  82. package/es/components/ExpandableSearch/index.js +9 -0
  83. package/es/components/FeatureFlags/index.js +169 -0
  84. package/es/components/FileUploader/FileUploader.Skeleton.js +43 -0
  85. package/es/components/FileUploader/FileUploader.js +284 -0
  86. package/es/components/FileUploader/FileUploaderButton.js +198 -0
  87. package/es/components/FileUploader/FileUploaderDropContainer.js +223 -0
  88. package/es/components/FileUploader/FileUploaderItem.js +130 -0
  89. package/es/components/FileUploader/Filename.js +82 -0
  90. package/es/components/FileUploader/index.js +14 -0
  91. package/es/components/FluidForm/FluidForm.js +46 -0
  92. package/es/components/FluidForm/FormContext.js +14 -0
  93. package/es/components/Form/Form.js +41 -0
  94. package/es/components/FormGroup/FormGroup.js +97 -0
  95. package/es/components/FormItem/FormItem.js +41 -0
  96. package/es/components/FormLabel/FormLabel.js +48 -0
  97. package/es/components/Grid/CSSGrid.js +139 -0
  98. package/es/components/Grid/Column.js +363 -0
  99. package/es/components/Grid/ColumnHang.js +51 -0
  100. package/es/components/Grid/FlexGrid.js +76 -0
  101. package/es/components/Grid/Grid.js +63 -0
  102. package/es/components/Grid/GridContext.js +60 -0
  103. package/es/components/Grid/Row.js +65 -0
  104. package/es/components/Heading/index.js +62 -0
  105. package/es/components/Icon/Icon.Skeleton.js +45 -0
  106. package/es/components/IconButton/index.js +89 -0
  107. package/es/components/InlineCheckbox/InlineCheckbox.js +122 -0
  108. package/es/components/InlineLoading/InlineLoading.js +118 -0
  109. package/es/components/Layer/LayerContext.js +12 -0
  110. package/es/components/Layer/index.js +62 -0
  111. package/es/components/Link/Link.js +95 -0
  112. package/es/components/ListBox/ListBox.js +129 -0
  113. package/es/components/ListBox/ListBoxField.js +62 -0
  114. package/es/components/ListBox/ListBoxMenu.js +56 -0
  115. package/es/components/ListBox/ListBoxMenuIcon.js +61 -0
  116. package/es/components/ListBox/ListBoxMenuItem.js +87 -0
  117. package/es/components/ListBox/ListBoxPropTypes.js +14 -0
  118. package/es/components/ListBox/ListBoxSelection.js +148 -0
  119. package/es/components/ListBox/index.js +20 -0
  120. package/es/components/ListBox/next/ListBoxSelection.js +155 -0
  121. package/es/components/ListBox/next/ListBoxTrigger.js +68 -0
  122. package/es/components/ListItem/ListItem.js +41 -0
  123. package/es/components/Loading/Loading.js +102 -0
  124. package/es/components/Menu/Menu.js +328 -0
  125. package/es/components/Menu/MenuDivider.js +19 -0
  126. package/es/components/Menu/MenuGroup.js +34 -0
  127. package/es/components/Menu/MenuItem.js +58 -0
  128. package/es/components/Menu/MenuOption.js +250 -0
  129. package/es/components/Menu/MenuRadioGroup.js +50 -0
  130. package/es/components/Menu/MenuRadioGroupOptions.js +64 -0
  131. package/es/components/Menu/MenuSelectableItem.js +57 -0
  132. package/es/components/Menu/_utils.js +177 -0
  133. package/es/components/Menu/index.js +25 -0
  134. package/es/components/Modal/Modal.js +343 -0
  135. package/es/components/Modal/index.js +15 -0
  136. package/es/components/Modal/next/Modal.js +277 -0
  137. package/es/components/ModalWrapper/ModalWrapper.js +164 -0
  138. package/es/components/MultiSelect/FilterableMultiSelect.js +576 -0
  139. package/es/components/MultiSelect/MultiSelect.js +468 -0
  140. package/es/components/MultiSelect/MultiSelectPropTypes.js +41 -0
  141. package/es/components/MultiSelect/index.js +23 -0
  142. package/es/components/MultiSelect/next/FilterableMultiSelect.js +532 -0
  143. package/es/components/MultiSelect/tools/itemToString.js +24 -0
  144. package/es/components/MultiSelect/tools/sorting.js +53 -0
  145. package/es/components/Notification/Notification.js +530 -0
  146. package/es/components/Notification/index.js +42 -0
  147. package/es/components/Notification/next/Notification.js +684 -0
  148. package/es/components/NumberInput/NumberInput.Skeleton.js +44 -0
  149. package/es/components/NumberInput/NumberInput.js +515 -0
  150. package/es/components/OrderedList/OrderedList.js +66 -0
  151. package/es/components/OverflowMenu/OverflowMenu.js +516 -0
  152. package/es/components/OverflowMenu/index.js +14 -0
  153. package/es/components/OverflowMenuItem/OverflowMenuItem.js +221 -0
  154. package/es/components/OverflowMenuItem/index.js +12 -0
  155. package/es/components/OverflowMenuV2/index.js +137 -0
  156. package/es/components/Pagination/Pagination.Skeleton.js +48 -0
  157. package/es/components/Pagination/Pagination.js +420 -0
  158. package/es/components/Pagination/experimental/PageSelector.js +81 -0
  159. package/es/components/Pagination/experimental/Pagination.js +281 -0
  160. package/es/components/Pagination/index.js +14 -0
  161. package/es/components/Pagination/next/Pagination.js +401 -0
  162. package/es/components/PaginationNav/PaginationNav.js +436 -0
  163. package/es/components/Popover/index.js +118 -0
  164. package/es/components/PrimaryButton/PrimaryButton.js +20 -0
  165. package/es/components/ProgressBar/ProgressBar.js +110 -0
  166. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +50 -0
  167. package/es/components/ProgressIndicator/ProgressIndicator.js +323 -0
  168. package/es/components/ProgressIndicator/index.js +15 -0
  169. package/es/components/ProgressIndicator/next/ProgressIndicator.js +117 -0
  170. package/es/components/RadioButton/RadioButton.Skeleton.js +37 -0
  171. package/es/components/RadioButton/RadioButton.js +172 -0
  172. package/es/components/RadioButton/index.js +15 -0
  173. package/es/components/RadioButton/next/RadioButton.js +128 -0
  174. package/es/components/RadioButtonGroup/RadioButtonGroup.js +190 -0
  175. package/es/components/RadioButtonGroup/index.js +15 -0
  176. package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +141 -0
  177. package/es/components/RadioTile/RadioTile.js +147 -0
  178. package/es/components/Search/Search.Skeleton.js +50 -0
  179. package/es/components/Search/Search.js +289 -0
  180. package/es/components/Search/index.js +15 -0
  181. package/es/components/Search/next/Search.js +263 -0
  182. package/es/components/SearchFilterButton/SearchFilterButton.js +61 -0
  183. package/es/components/SearchLayoutButton/SearchLayoutButton.js +151 -0
  184. package/es/components/SecondaryButton/SecondaryButton.js +20 -0
  185. package/es/components/Select/Select.Skeleton.js +46 -0
  186. package/es/components/Select/Select.js +211 -0
  187. package/es/components/SelectItem/SelectItem.js +70 -0
  188. package/es/components/SelectItemGroup/SelectItemGroup.js +60 -0
  189. package/es/components/SkeletonIcon/SkeletonIcon.js +42 -0
  190. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +37 -0
  191. package/es/components/SkeletonText/SkeletonText.js +114 -0
  192. package/es/components/Slider/Slider.Skeleton.js +56 -0
  193. package/es/components/Slider/Slider.js +649 -0
  194. package/es/components/Slider/index.js +14 -0
  195. package/es/components/Stack/Stack.js +102 -0
  196. package/es/components/Stack/index.js +26 -0
  197. package/es/components/StructuredList/StructuredList.Skeleton.js +82 -0
  198. package/es/components/StructuredList/StructuredList.js +307 -0
  199. package/es/components/StructuredList/index.js +43 -0
  200. package/es/components/StructuredList/next/StructuredList.js +330 -0
  201. package/es/components/Switch/Switch.js +124 -0
  202. package/es/components/Tab/Tab.js +191 -0
  203. package/es/components/Tab/index.js +15 -0
  204. package/es/components/TabContent/TabContent.js +77 -0
  205. package/es/components/Tabs/Tabs.Skeleton.js +53 -0
  206. package/es/components/Tabs/Tabs.js +618 -0
  207. package/es/components/Tabs/index.js +19 -0
  208. package/es/components/Tabs/next/Tabs.Skeleton.js +53 -0
  209. package/es/components/Tabs/next/Tabs.js +648 -0
  210. package/es/components/Tabs/next/usePressable.js +145 -0
  211. package/es/components/Tag/Tag.Skeleton.js +40 -0
  212. package/es/components/Tag/Tag.js +146 -0
  213. package/es/components/Text/Text.js +98 -0
  214. package/es/components/Text/TextDirectionContext.js +12 -0
  215. package/es/components/Text/createTextComponent.js +33 -0
  216. package/es/components/Text/index.js +13 -0
  217. package/es/components/TextArea/TextArea.Skeleton.js +44 -0
  218. package/es/components/TextArea/TextArea.js +220 -0
  219. package/es/components/TextInput/ControlledPasswordInput.js +234 -0
  220. package/es/components/TextInput/PasswordInput.js +286 -0
  221. package/es/components/TextInput/TextInput.Skeleton.js +44 -0
  222. package/es/components/TextInput/TextInput.js +239 -0
  223. package/es/components/TextInput/index.js +20 -0
  224. package/es/components/TextInput/util.js +33 -0
  225. package/es/components/Theme/index.js +103 -0
  226. package/es/components/Tile/Tile.js +767 -0
  227. package/es/components/Tile/index.js +19 -0
  228. package/es/components/Tile/next/Tile.js +647 -0
  229. package/es/components/TileGroup/TileGroup.js +164 -0
  230. package/es/components/TimePicker/TimePicker.js +256 -0
  231. package/es/components/TimePicker/index.js +15 -0
  232. package/es/components/TimePicker/next/TimePicker.js +218 -0
  233. package/es/components/TimePickerSelect/TimePickerSelect.js +82 -0
  234. package/es/components/TimePickerSelect/index.js +15 -0
  235. package/es/components/TimePickerSelect/next/TimePickerSelect.js +77 -0
  236. package/es/components/Toggle/Toggle.Skeleton.js +74 -0
  237. package/es/components/Toggle/Toggle.js +120 -0
  238. package/es/components/Toggle/index.js +19 -0
  239. package/es/components/Toggle/next/Toggle.js +158 -0
  240. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +71 -0
  241. package/es/components/ToggleSmall/ToggleSmall.js +104 -0
  242. package/es/components/Toolbar/Toolbar.js +121 -0
  243. package/es/components/ToolbarSearch/ToolbarSearch.js +168 -0
  244. package/es/components/Tooltip/next/DefinitionTooltip.js +122 -0
  245. package/es/components/Tooltip/next/Tooltip.js +154 -0
  246. package/es/components/TooltipDefinition/TooltipDefinition.js +167 -0
  247. package/es/components/TooltipIcon/TooltipIcon.js +235 -0
  248. package/es/components/TreeView/TreeNode.js +325 -0
  249. package/es/components/TreeView/TreeView.js +252 -0
  250. package/es/components/TreeView/index.js +13 -0
  251. package/es/components/UIShell/Content.js +50 -0
  252. package/es/components/UIShell/Header.js +37 -0
  253. package/es/components/UIShell/HeaderContainer.js +44 -0
  254. package/es/components/UIShell/HeaderGlobalAction.js +87 -0
  255. package/es/components/UIShell/HeaderGlobalBar.js +20 -0
  256. package/es/components/UIShell/HeaderMenu.js +240 -0
  257. package/es/components/UIShell/HeaderMenuButton.js +69 -0
  258. package/es/components/UIShell/HeaderMenuItem.js +73 -0
  259. package/es/components/UIShell/HeaderName.js +62 -0
  260. package/es/components/UIShell/HeaderNavigation.js +100 -0
  261. package/es/components/UIShell/HeaderPanel.js +52 -0
  262. package/es/components/UIShell/HeaderSideNavItems.js +50 -0
  263. package/es/components/UIShell/Link.js +49 -0
  264. package/es/components/UIShell/SideNav.js +227 -0
  265. package/es/components/UIShell/SideNavDetails.js +46 -0
  266. package/es/components/UIShell/SideNavDivider.js +30 -0
  267. package/es/components/UIShell/SideNavFooter.js +78 -0
  268. package/es/components/UIShell/SideNavHeader.js +50 -0
  269. package/es/components/UIShell/SideNavIcon.js +49 -0
  270. package/es/components/UIShell/SideNavItem.js +47 -0
  271. package/es/components/UIShell/SideNavItems.js +56 -0
  272. package/es/components/UIShell/SideNavLink.js +74 -0
  273. package/es/components/UIShell/SideNavLinkText.js +41 -0
  274. package/es/components/UIShell/SideNavMenu.js +198 -0
  275. package/es/components/UIShell/SideNavMenuItem.js +57 -0
  276. package/es/components/UIShell/SideNavSwitcher.js +80 -0
  277. package/es/components/UIShell/SkipToContent.js +57 -0
  278. package/es/components/UIShell/Switcher.js +45 -0
  279. package/es/components/UIShell/SwitcherDivider.js +35 -0
  280. package/es/components/UIShell/SwitcherItem.js +62 -0
  281. package/es/components/UIShell/_utils.js +10 -0
  282. package/es/components/UIShell/index.js +17 -0
  283. package/es/components/UIShell/next/HeaderNavigation.js +52 -0
  284. package/es/components/UIShell/next/SideNavMenu.js +160 -0
  285. package/es/components/UnorderedList/UnorderedList.js +59 -0
  286. package/es/index.js +190 -2
  287. package/es/internal/ClickListener.js +101 -0
  288. package/es/internal/ComponentToggle.js +42 -0
  289. package/es/internal/FeatureFlags.js +52 -0
  290. package/es/internal/FloatingMenu.js +483 -0
  291. package/es/internal/OptimizedResize.js +65 -0
  292. package/es/internal/Selection.js +243 -0
  293. package/es/internal/createClassWrapper.js +31 -0
  294. package/es/internal/deprecateFieldOnObject.js +26 -0
  295. package/es/internal/environment.js +15 -0
  296. package/es/internal/focus/index.js +16 -0
  297. package/es/internal/keyboard/keys.js +65 -0
  298. package/es/internal/keyboard/match.js +82 -0
  299. package/es/internal/keyboard/navigation.js +61 -0
  300. package/es/internal/useControllableState.js +86 -0
  301. package/es/internal/useDelayedState.js +54 -0
  302. package/es/internal/useEffectOnce.js +31 -0
  303. package/es/internal/useId.js +59 -0
  304. package/es/internal/useIsomorphicEffect.js +13 -0
  305. package/es/internal/useMatchMedia.js +51 -0
  306. package/es/internal/useMergedRefs.js +31 -0
  307. package/es/internal/useNoInteractiveChildren.js +92 -0
  308. package/es/internal/useNormalizedInputProps.js +88 -0
  309. package/es/internal/usePrefix.js +15 -0
  310. package/es/internal/useSavedCallback.js +32 -0
  311. package/es/internal/warning.js +28 -0
  312. package/es/internal/wrapFocus.js +75 -0
  313. package/es/node_modules/flatpickr/dist/l10n/index.js +1423 -0
  314. package/es/node_modules/flatpickr/dist/plugins/rangePlugin.js +196 -0
  315. package/es/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +1112 -0
  316. package/es/node_modules/use-resize-observer/polyfilled.js +112 -0
  317. package/es/prop-types/AriaPropTypes.js +16 -0
  318. package/es/prop-types/deprecate.js +33 -0
  319. package/es/prop-types/isRequiredOneOf.js +47 -0
  320. package/es/prop-types/requiredIfGivenPropIsTruthy.js +29 -0
  321. package/es/prop-types/requiredIfValueExists.js +32 -0
  322. package/es/prop-types/types.js +10 -0
  323. package/es/tools/array.js +32 -0
  324. package/es/tools/createPropAdapter.js +63 -0
  325. package/es/tools/events.js +35 -0
  326. package/es/tools/mergeRefs.js +31 -0
  327. package/es/tools/setupGetInstanceId.js +19 -0
  328. package/es/tools/toggleClass.js +14 -0
  329. package/es/tools/uniqueId.js +15 -0
  330. package/es/tools/wrapComponent.js +42 -0
  331. package/icons/es/index.js +1 -1
  332. package/icons/lib/index.js +7 -1952
  333. package/lib/_virtual/ResizeObserver.es.js +17 -0
  334. package/lib/_virtual/_commonjsHelpers.js +35 -0
  335. package/lib/_virtual/_rollupPluginBabelHelpers.js +383 -0
  336. package/lib/{prefix.js → _virtual/index.js} +4 -2
  337. package/lib/_virtual/rangePlugin.js +14 -0
  338. package/lib/components/Accordion/Accordion.Skeleton.js +113 -0
  339. package/lib/components/Accordion/Accordion.js +97 -0
  340. package/lib/components/Accordion/AccordionItem.js +191 -0
  341. package/lib/components/Accordion/index.js +16 -0
  342. package/lib/components/AccordionItem/index.js +16 -0
  343. package/lib/components/AspectRatio/AspectRatio.js +77 -0
  344. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +55 -0
  345. package/lib/components/Breadcrumb/Breadcrumb.js +68 -0
  346. package/lib/components/Breadcrumb/BreadcrumbItem.js +104 -0
  347. package/lib/components/Button/Button.Skeleton.js +100 -0
  348. package/lib/components/Button/Button.js +380 -0
  349. package/lib/components/ButtonSet/ButtonSet.js +58 -0
  350. package/lib/components/Checkbox/Checkbox.Skeleton.js +46 -0
  351. package/lib/components/Checkbox/Checkbox.js +146 -0
  352. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +68 -0
  353. package/lib/components/CodeSnippet/CodeSnippet.js +383 -0
  354. package/lib/components/ComboBox/ComboBox.js +543 -0
  355. package/lib/components/ComboBox/tools/filter.js +24 -0
  356. package/lib/components/ComposedModal/ComposedModal.js +643 -0
  357. package/lib/components/ComposedModal/index.js +45 -0
  358. package/lib/components/ComposedModal/next/ComposedModal.js +234 -0
  359. package/lib/components/ComposedModal/next/ModalFooter.js +223 -0
  360. package/lib/components/ComposedModal/next/ModalHeader.js +137 -0
  361. package/lib/components/ContentSwitcher/ContentSwitcher.js +195 -0
  362. package/lib/components/ContextMenu/useContextMenu.js +61 -0
  363. package/lib/components/Copy/Copy.js +154 -0
  364. package/lib/components/CopyButton/CopyButton.js +77 -0
  365. package/lib/components/DangerButton/DangerButton.js +28 -0
  366. package/lib/components/DataTable/DataTable.js +667 -0
  367. package/lib/components/DataTable/Table.js +120 -0
  368. package/lib/components/DataTable/TableActionList.js +21 -0
  369. package/lib/components/DataTable/TableBatchAction.js +54 -0
  370. package/lib/components/DataTable/TableBatchActions.js +120 -0
  371. package/lib/components/DataTable/TableBody.js +46 -0
  372. package/lib/components/DataTable/TableCell.js +20 -0
  373. package/lib/components/DataTable/TableContainer.js +76 -0
  374. package/lib/components/DataTable/TableExpandHeader.js +96 -0
  375. package/lib/components/DataTable/TableExpandRow.js +103 -0
  376. package/lib/components/DataTable/TableExpandedRow.js +85 -0
  377. package/lib/components/DataTable/TableHead.js +20 -0
  378. package/lib/components/DataTable/TableHeader.js +197 -0
  379. package/lib/components/DataTable/TableRow.js +52 -0
  380. package/lib/components/DataTable/TableSelectAll.js +94 -0
  381. package/lib/components/DataTable/TableSelectRow.js +107 -0
  382. package/lib/components/DataTable/TableToolbar.js +77 -0
  383. package/lib/components/DataTable/TableToolbarAction.js +40 -0
  384. package/lib/components/DataTable/TableToolbarContent.js +21 -0
  385. package/lib/components/DataTable/TableToolbarMenu.js +71 -0
  386. package/lib/components/DataTable/TableToolbarSearch.js +252 -0
  387. package/lib/components/DataTable/index.js +76 -0
  388. package/lib/components/DataTable/state/getDerivedStateFromProps.js +56 -0
  389. package/lib/components/DataTable/state/sortStates.js +23 -0
  390. package/lib/components/DataTable/state/sorting.js +100 -0
  391. package/lib/components/DataTable/tools/cells.js +25 -0
  392. package/lib/components/DataTable/tools/denormalize.js +47 -0
  393. package/lib/components/DataTable/tools/filter.js +46 -0
  394. package/lib/components/DataTable/tools/instanceId.js +25 -0
  395. package/lib/components/DataTable/tools/normalize.js +82 -0
  396. package/lib/components/DataTable/tools/sorting.js +117 -0
  397. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +143 -0
  398. package/lib/components/DatePicker/DatePicker.Skeleton.js +79 -0
  399. package/lib/components/DatePicker/DatePicker.js +633 -0
  400. package/lib/components/DatePicker/index.js +39 -0
  401. package/lib/components/DatePicker/next/DatePicker.js +569 -0
  402. package/lib/components/DatePicker/plugins/appendToPlugin.js +62 -0
  403. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +93 -0
  404. package/lib/components/DatePicker/plugins/rangePlugin.js +55 -0
  405. package/lib/components/DatePickerInput/DatePickerInput.js +281 -0
  406. package/lib/components/DatePickerInput/index.js +39 -0
  407. package/lib/components/DatePickerInput/next/DatePickerInput.js +279 -0
  408. package/lib/components/Dropdown/Dropdown.Skeleton.js +65 -0
  409. package/lib/components/Dropdown/Dropdown.js +337 -0
  410. package/lib/components/ErrorBoundary/ErrorBoundary.js +105 -0
  411. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +20 -0
  412. package/lib/components/ExpandableSearch/ExpandableSearch.js +76 -0
  413. package/lib/components/ExpandableSearch/index.js +16 -0
  414. package/lib/components/FeatureFlags/index.js +181 -0
  415. package/lib/components/FileUploader/FileUploader.Skeleton.js +53 -0
  416. package/lib/components/FileUploader/FileUploader.js +313 -0
  417. package/lib/components/FileUploader/FileUploaderButton.js +227 -0
  418. package/lib/components/FileUploader/FileUploaderDropContainer.js +233 -0
  419. package/lib/components/FileUploader/FileUploaderItem.js +159 -0
  420. package/lib/components/FileUploader/Filename.js +91 -0
  421. package/lib/components/FileUploader/index.js +38 -0
  422. package/lib/components/FluidForm/FluidForm.js +56 -0
  423. package/lib/components/FluidForm/FormContext.js +18 -0
  424. package/lib/components/Form/Form.js +51 -0
  425. package/lib/components/FormGroup/FormGroup.js +107 -0
  426. package/lib/components/FormItem/FormItem.js +51 -0
  427. package/lib/components/FormLabel/FormLabel.js +77 -0
  428. package/lib/components/Grid/CSSGrid.js +149 -0
  429. package/lib/components/Grid/Column.js +392 -0
  430. package/lib/components/Grid/ColumnHang.js +61 -0
  431. package/lib/components/Grid/FlexGrid.js +86 -0
  432. package/lib/components/Grid/Grid.js +72 -0
  433. package/lib/components/Grid/GridContext.js +88 -0
  434. package/lib/components/Grid/Row.js +75 -0
  435. package/lib/components/Heading/index.js +72 -0
  436. package/lib/components/Icon/Icon.Skeleton.js +55 -0
  437. package/lib/components/IconButton/index.js +98 -0
  438. package/lib/components/InlineCheckbox/InlineCheckbox.js +131 -0
  439. package/lib/components/InlineLoading/InlineLoading.js +128 -0
  440. package/lib/components/Layer/LayerContext.js +20 -0
  441. package/lib/components/Layer/index.js +72 -0
  442. package/lib/components/Link/Link.js +105 -0
  443. package/lib/components/ListBox/ListBox.js +139 -0
  444. package/lib/components/ListBox/ListBoxField.js +71 -0
  445. package/lib/components/ListBox/ListBoxMenu.js +65 -0
  446. package/lib/components/ListBox/ListBoxMenuIcon.js +72 -0
  447. package/lib/components/ListBox/ListBoxMenuItem.js +97 -0
  448. package/lib/components/ListBox/ListBoxPropTypes.js +42 -0
  449. package/lib/components/ListBox/ListBoxSelection.js +159 -0
  450. package/lib/components/ListBox/index.js +25 -0
  451. package/lib/components/ListBox/next/ListBoxSelection.js +166 -0
  452. package/lib/components/ListBox/next/ListBoxTrigger.js +79 -0
  453. package/lib/components/ListItem/ListItem.js +51 -0
  454. package/lib/components/Loading/Loading.js +112 -0
  455. package/lib/components/Menu/Menu.js +339 -0
  456. package/lib/components/Menu/MenuDivider.js +27 -0
  457. package/lib/components/Menu/MenuGroup.js +43 -0
  458. package/lib/components/Menu/MenuItem.js +67 -0
  459. package/lib/components/Menu/MenuOption.js +260 -0
  460. package/lib/components/Menu/MenuRadioGroup.js +59 -0
  461. package/lib/components/Menu/MenuRadioGroupOptions.js +73 -0
  462. package/lib/components/Menu/MenuSelectableItem.js +66 -0
  463. package/lib/components/Menu/_utils.js +191 -0
  464. package/lib/components/Menu/index.js +30 -0
  465. package/lib/components/Modal/Modal.js +353 -0
  466. package/lib/components/Modal/index.js +39 -0
  467. package/lib/components/Modal/next/Modal.js +287 -0
  468. package/lib/components/ModalWrapper/ModalWrapper.js +173 -0
  469. package/lib/components/MultiSelect/FilterableMultiSelect.js +588 -0
  470. package/lib/components/MultiSelect/MultiSelect.js +480 -0
  471. package/lib/components/MultiSelect/MultiSelectPropTypes.js +49 -0
  472. package/lib/components/MultiSelect/index.js +47 -0
  473. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +544 -0
  474. package/lib/components/MultiSelect/tools/itemToString.js +32 -0
  475. package/lib/components/MultiSelect/tools/sorting.js +58 -0
  476. package/lib/components/Notification/Notification.js +544 -0
  477. package/lib/components/Notification/index.js +51 -0
  478. package/lib/components/Notification/next/Notification.js +698 -0
  479. package/lib/components/NumberInput/NumberInput.Skeleton.js +54 -0
  480. package/lib/components/NumberInput/NumberInput.js +546 -0
  481. package/lib/components/OrderedList/OrderedList.js +76 -0
  482. package/lib/components/OverflowMenu/OverflowMenu.js +547 -0
  483. package/lib/components/OverflowMenu/index.js +38 -0
  484. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +250 -0
  485. package/lib/components/OverflowMenuItem/index.js +16 -0
  486. package/lib/components/OverflowMenuV2/index.js +147 -0
  487. package/lib/components/Pagination/Pagination.Skeleton.js +58 -0
  488. package/lib/components/Pagination/Pagination.js +430 -0
  489. package/lib/components/Pagination/experimental/PageSelector.js +91 -0
  490. package/lib/components/Pagination/experimental/Pagination.js +310 -0
  491. package/lib/components/Pagination/index.js +38 -0
  492. package/lib/components/Pagination/next/Pagination.js +411 -0
  493. package/lib/components/PaginationNav/PaginationNav.js +465 -0
  494. package/lib/components/Popover/index.js +129 -0
  495. package/lib/components/PrimaryButton/PrimaryButton.js +28 -0
  496. package/lib/components/ProgressBar/ProgressBar.js +120 -0
  497. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +60 -0
  498. package/lib/components/ProgressIndicator/ProgressIndicator.js +334 -0
  499. package/lib/components/ProgressIndicator/index.js +39 -0
  500. package/lib/components/ProgressIndicator/next/ProgressIndicator.js +127 -0
  501. package/lib/components/RadioButton/RadioButton.Skeleton.js +47 -0
  502. package/lib/components/RadioButton/RadioButton.js +183 -0
  503. package/lib/components/RadioButton/index.js +39 -0
  504. package/lib/components/RadioButton/next/RadioButton.js +138 -0
  505. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +200 -0
  506. package/lib/components/RadioButtonGroup/index.js +39 -0
  507. package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +151 -0
  508. package/lib/components/RadioTile/RadioTile.js +157 -0
  509. package/lib/components/Search/Search.Skeleton.js +60 -0
  510. package/lib/components/Search/Search.js +299 -0
  511. package/lib/components/Search/index.js +39 -0
  512. package/lib/components/Search/next/Search.js +273 -0
  513. package/lib/components/SearchFilterButton/SearchFilterButton.js +70 -0
  514. package/lib/components/SearchLayoutButton/SearchLayoutButton.js +160 -0
  515. package/lib/components/SecondaryButton/SecondaryButton.js +28 -0
  516. package/lib/components/Select/Select.Skeleton.js +56 -0
  517. package/lib/components/Select/Select.js +240 -0
  518. package/lib/components/SelectItem/SelectItem.js +80 -0
  519. package/lib/components/SelectItemGroup/SelectItemGroup.js +89 -0
  520. package/lib/components/SkeletonIcon/SkeletonIcon.js +52 -0
  521. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +47 -0
  522. package/lib/components/SkeletonText/SkeletonText.js +124 -0
  523. package/lib/components/Slider/Slider.Skeleton.js +66 -0
  524. package/lib/components/Slider/Slider.js +679 -0
  525. package/lib/components/Slider/index.js +38 -0
  526. package/lib/components/Stack/Stack.js +112 -0
  527. package/lib/components/Stack/index.js +35 -0
  528. package/lib/components/StructuredList/StructuredList.Skeleton.js +92 -0
  529. package/lib/components/StructuredList/StructuredList.js +322 -0
  530. package/lib/components/StructuredList/index.js +52 -0
  531. package/lib/components/StructuredList/next/StructuredList.js +345 -0
  532. package/lib/components/Switch/Switch.js +134 -0
  533. package/lib/components/Tab/Tab.js +220 -0
  534. package/lib/components/Tab/index.js +39 -0
  535. package/lib/components/TabContent/TabContent.js +87 -0
  536. package/lib/components/Tabs/Tabs.Skeleton.js +63 -0
  537. package/lib/components/Tabs/Tabs.js +629 -0
  538. package/lib/components/Tabs/index.js +47 -0
  539. package/lib/components/Tabs/next/Tabs.Skeleton.js +63 -0
  540. package/lib/components/Tabs/next/Tabs.js +664 -0
  541. package/lib/components/Tabs/next/usePressable.js +149 -0
  542. package/lib/components/Tag/Tag.Skeleton.js +50 -0
  543. package/lib/components/Tag/Tag.js +156 -0
  544. package/lib/components/Text/Text.js +107 -0
  545. package/lib/components/Text/TextDirectionContext.js +16 -0
  546. package/lib/components/Text/createTextComponent.js +41 -0
  547. package/lib/components/Text/index.js +17 -0
  548. package/lib/components/TextArea/TextArea.Skeleton.js +54 -0
  549. package/lib/components/TextArea/TextArea.js +230 -0
  550. package/lib/components/TextInput/ControlledPasswordInput.js +244 -0
  551. package/lib/components/TextInput/PasswordInput.js +315 -0
  552. package/lib/components/TextInput/TextInput.Skeleton.js +54 -0
  553. package/lib/components/TextInput/TextInput.js +268 -0
  554. package/lib/components/TextInput/index.js +25 -0
  555. package/lib/components/TextInput/util.js +37 -0
  556. package/lib/components/Theme/index.js +116 -0
  557. package/lib/components/Tile/Tile.js +782 -0
  558. package/lib/components/Tile/index.js +48 -0
  559. package/lib/components/Tile/next/Tile.js +662 -0
  560. package/lib/components/TileGroup/TileGroup.js +173 -0
  561. package/lib/components/TimePicker/TimePicker.js +266 -0
  562. package/lib/components/TimePicker/index.js +39 -0
  563. package/lib/components/TimePicker/next/TimePicker.js +228 -0
  564. package/lib/components/TimePickerSelect/TimePickerSelect.js +92 -0
  565. package/lib/components/TimePickerSelect/index.js +39 -0
  566. package/lib/components/TimePickerSelect/next/TimePickerSelect.js +87 -0
  567. package/lib/components/Toggle/Toggle.Skeleton.js +84 -0
  568. package/lib/components/Toggle/Toggle.js +130 -0
  569. package/lib/components/Toggle/index.js +23 -0
  570. package/lib/components/Toggle/next/Toggle.js +169 -0
  571. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +81 -0
  572. package/lib/components/ToggleSmall/ToggleSmall.js +114 -0
  573. package/lib/components/Toolbar/Toolbar.js +135 -0
  574. package/lib/components/ToolbarSearch/ToolbarSearch.js +178 -0
  575. package/lib/components/Tooltip/next/DefinitionTooltip.js +132 -0
  576. package/lib/components/Tooltip/next/Tooltip.js +164 -0
  577. package/lib/components/TooltipDefinition/TooltipDefinition.js +178 -0
  578. package/lib/components/TooltipIcon/TooltipIcon.js +245 -0
  579. package/lib/components/TreeView/TreeNode.js +335 -0
  580. package/lib/components/TreeView/TreeView.js +281 -0
  581. package/lib/components/TreeView/index.js +18 -0
  582. package/lib/components/UIShell/Content.js +60 -0
  583. package/lib/components/UIShell/Header.js +47 -0
  584. package/lib/components/UIShell/HeaderContainer.js +53 -0
  585. package/lib/components/UIShell/HeaderGlobalAction.js +97 -0
  586. package/lib/components/UIShell/HeaderGlobalBar.js +24 -0
  587. package/lib/components/UIShell/HeaderMenu.js +250 -0
  588. package/lib/components/UIShell/HeaderMenuButton.js +79 -0
  589. package/lib/components/UIShell/HeaderMenuItem.js +83 -0
  590. package/lib/components/UIShell/HeaderName.js +72 -0
  591. package/lib/components/UIShell/HeaderNavigation.js +110 -0
  592. package/lib/components/UIShell/HeaderPanel.js +62 -0
  593. package/lib/components/UIShell/HeaderSideNavItems.js +60 -0
  594. package/lib/components/UIShell/Link.js +59 -0
  595. package/lib/components/UIShell/SideNav.js +237 -0
  596. package/lib/components/UIShell/SideNavDetails.js +56 -0
  597. package/lib/components/UIShell/SideNavDivider.js +40 -0
  598. package/lib/components/UIShell/SideNavFooter.js +88 -0
  599. package/lib/components/UIShell/SideNavHeader.js +60 -0
  600. package/lib/components/UIShell/SideNavIcon.js +59 -0
  601. package/lib/components/UIShell/SideNavItem.js +57 -0
  602. package/lib/components/UIShell/SideNavItems.js +66 -0
  603. package/lib/components/UIShell/SideNavLink.js +84 -0
  604. package/lib/components/UIShell/SideNavLinkText.js +51 -0
  605. package/lib/components/UIShell/SideNavMenu.js +209 -0
  606. package/lib/components/UIShell/SideNavMenuItem.js +67 -0
  607. package/lib/components/UIShell/SideNavSwitcher.js +90 -0
  608. package/lib/components/UIShell/SkipToContent.js +67 -0
  609. package/lib/components/UIShell/Switcher.js +55 -0
  610. package/lib/components/UIShell/SwitcherDivider.js +45 -0
  611. package/lib/components/UIShell/SwitcherItem.js +72 -0
  612. package/lib/components/UIShell/_utils.js +14 -0
  613. package/lib/components/UIShell/index.js +42 -0
  614. package/lib/components/UIShell/next/HeaderNavigation.js +62 -0
  615. package/lib/components/UIShell/next/SideNavMenu.js +170 -0
  616. package/lib/components/UnorderedList/UnorderedList.js +69 -0
  617. package/lib/index.js +409 -858
  618. package/lib/internal/ClickListener.js +110 -0
  619. package/lib/internal/ComponentToggle.js +50 -0
  620. package/lib/internal/FeatureFlags.js +56 -0
  621. package/lib/internal/FloatingMenu.js +498 -0
  622. package/lib/internal/OptimizedResize.js +73 -0
  623. package/lib/internal/Selection.js +254 -0
  624. package/lib/internal/createClassWrapper.js +39 -0
  625. package/lib/internal/deprecateFieldOnObject.js +30 -0
  626. package/lib/internal/environment.js +19 -0
  627. package/lib/internal/focus/index.js +20 -0
  628. package/lib/internal/keyboard/keys.js +79 -0
  629. package/lib/internal/keyboard/match.js +87 -0
  630. package/lib/internal/keyboard/navigation.js +69 -0
  631. package/lib/internal/useControllableState.js +90 -0
  632. package/lib/internal/useDelayedState.js +58 -0
  633. package/lib/internal/useEffectOnce.js +35 -0
  634. package/lib/internal/useId.js +64 -0
  635. package/lib/internal/useIsomorphicEffect.js +17 -0
  636. package/lib/internal/useMatchMedia.js +55 -0
  637. package/lib/internal/useMergedRefs.js +35 -0
  638. package/lib/internal/useNoInteractiveChildren.js +97 -0
  639. package/lib/internal/useNormalizedInputProps.js +96 -0
  640. package/lib/internal/usePrefix.js +24 -0
  641. package/lib/internal/useSavedCallback.js +36 -0
  642. package/lib/internal/warning.js +32 -0
  643. package/lib/internal/wrapFocus.js +84 -0
  644. package/lib/node_modules/flatpickr/dist/l10n/index.js +1427 -0
  645. package/lib/node_modules/flatpickr/dist/plugins/rangePlugin.js +200 -0
  646. package/lib/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +1116 -0
  647. package/lib/node_modules/use-resize-observer/polyfilled.js +120 -0
  648. package/lib/prop-types/AriaPropTypes.js +24 -0
  649. package/lib/prop-types/deprecate.js +37 -0
  650. package/lib/prop-types/isRequiredOneOf.js +51 -0
  651. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +33 -0
  652. package/lib/prop-types/requiredIfValueExists.js +36 -0
  653. package/lib/prop-types/types.js +14 -0
  654. package/lib/tools/array.js +36 -0
  655. package/lib/tools/createPropAdapter.js +67 -0
  656. package/lib/tools/events.js +39 -0
  657. package/lib/tools/mergeRefs.js +35 -0
  658. package/lib/tools/setupGetInstanceId.js +23 -0
  659. package/lib/tools/toggleClass.js +18 -0
  660. package/lib/tools/uniqueId.js +19 -0
  661. package/lib/tools/wrapComponent.js +52 -0
  662. package/package.json +50 -20
  663. package/scss/grid/_css-grid.scss +9 -0
  664. package/scss/grid/{_config.scss → _mixins.scss} +1 -1
  665. package/icons/es/icon-helpers/es/index.js +0 -141
  666. package/icons/es/icons-react/next/index.esm.js +0 -14
  667. package/icons/lib/icon-helpers/es/index.js +0 -146
  668. package/icons/lib/icons-react/next/index.esm.js +0 -1973
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import PropTypes from 'prop-types';
10
+ import React__default from 'react';
11
+ import cx from 'classnames';
12
+ import { usePrefix } from '../../internal/usePrefix.js';
13
+
14
+ var _excluded = ["hideLabel", "className"];
15
+
16
+ var NumberInputSkeleton = function NumberInputSkeleton(_ref) {
17
+ var hideLabel = _ref.hideLabel,
18
+ className = _ref.className,
19
+ rest = _objectWithoutProperties(_ref, _excluded);
20
+
21
+ var prefix = usePrefix();
22
+ return /*#__PURE__*/React__default.createElement("div", _extends({
23
+ className: cx("".concat(prefix, "--form-item"), className)
24
+ }, rest), !hideLabel && /*#__PURE__*/React__default.createElement("span", {
25
+ className: "".concat(prefix, "--label ").concat(prefix, "--skeleton")
26
+ }), /*#__PURE__*/React__default.createElement("div", {
27
+ className: "".concat(prefix, "--number ").concat(prefix, "--skeleton")
28
+ }));
29
+ };
30
+
31
+ NumberInputSkeleton.propTypes = {
32
+ /**
33
+ * Specify an optional className to add to the form item wrapper.
34
+ */
35
+ className: PropTypes.string,
36
+
37
+ /**
38
+ * Specify whether the label should be hidden, or not
39
+ */
40
+ hideLabel: PropTypes.bool
41
+ };
42
+ var NumberInputSkeleton$1 = NumberInputSkeleton;
43
+
44
+ export { NumberInputSkeleton$1 as default };
@@ -0,0 +1,515 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { defineProperty as _defineProperty, extends as _extends, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, possibleConstructorReturn as _possibleConstructorReturn, createClass as _createClass, objectWithoutProperties as _objectWithoutProperties } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import PropTypes from 'prop-types';
10
+ import React__default, { Component } from 'react';
11
+ import cx from 'classnames';
12
+ import { Subtract, Add } from '@carbon/icons-react';
13
+ import * as FeatureFlags from '@carbon/feature-flags';
14
+ import mergeRefs from '../../tools/mergeRefs.js';
15
+ import requiredIfValueExists from '../../prop-types/requiredIfValueExists.js';
16
+ import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
17
+ import { useControlledStateWithValue } from '../../internal/FeatureFlags.js';
18
+ import { PrefixContext } from '../../internal/usePrefix.js';
19
+ import deprecate from '../../prop-types/deprecate.js';
20
+ import { FeatureFlagContext } from '../FeatureFlags/index.js';
21
+
22
+ var _excluded = ["className", "disabled", "iconDescription", "id", "hideLabel", "hideSteppers", "label", "max", "min", "step", "value", "readOnly", "invalid", "invalidText", "warn", "warnText", "helperText", "ariaLabel", "light", "allowEmpty", "innerRef", "translateWithId", "isMobile", "size", "defaultValue"];
23
+
24
+ var _defaultTranslations, _Subtract, _Add;
25
+ var translationIds = {
26
+ 'increment.number': 'increment.number',
27
+ 'decrement.number': 'decrement.number'
28
+ };
29
+ var defaultTranslations = (_defaultTranslations = {}, _defineProperty(_defaultTranslations, translationIds['increment.number'], 'Increment number'), _defineProperty(_defaultTranslations, translationIds['decrement.number'], 'Decrement number'), _defaultTranslations);
30
+
31
+ var capMin = function capMin(min, value) {
32
+ return isNaN(min) || !min && min !== 0 || isNaN(value) || !value && value !== 0 ? value : Math.max(min, value);
33
+ };
34
+
35
+ var capMax = function capMax(max, value) {
36
+ return isNaN(max) || !max && max !== 0 || isNaN(value) || !value && value !== 0 ? value : Math.min(max, value);
37
+ };
38
+
39
+ var NumberInput = /*#__PURE__*/function (_Component) {
40
+ _inherits(NumberInput, _Component);
41
+
42
+ var _super = _createSuper(NumberInput);
43
+
44
+ function NumberInput(props) {
45
+ var _this;
46
+
47
+ _classCallCheck(this, NumberInput);
48
+
49
+ _this = _super.call(this, props);
50
+
51
+ _defineProperty(_assertThisInitialized(_this), "_inputRef", null);
52
+
53
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function (evt) {
54
+ var _this$props = _this.props,
55
+ disabled = _this$props.disabled,
56
+ onChange = _this$props.onChange;
57
+
58
+ if (!disabled) {
59
+ evt.persist();
60
+ evt.imaginaryTarget = _this._inputRef;
61
+ var prevValue = _this.state.value;
62
+ var value = evt.target.value;
63
+ var direction = prevValue < value ? 'up' : 'down';
64
+
65
+ _this.setState({
66
+ value: value
67
+ }, function () {
68
+ if (useControlledStateWithValue) {
69
+ onChange(evt, {
70
+ value: value,
71
+ direction: direction
72
+ });
73
+ } else if (onChange) {
74
+ onChange(evt, {
75
+ value: value,
76
+ direction: direction
77
+ });
78
+ }
79
+ });
80
+ }
81
+ });
82
+
83
+ _defineProperty(_assertThisInitialized(_this), "handleArrowClick", function (evt, direction) {
84
+ var value = typeof _this.state.value === 'string' ? Number(_this.state.value) : _this.state.value;
85
+ var _this$props2 = _this.props,
86
+ disabled = _this$props2.disabled,
87
+ min = _this$props2.min,
88
+ max = _this$props2.max,
89
+ step = _this$props2.step,
90
+ onChange = _this$props2.onChange,
91
+ onClick = _this$props2.onClick;
92
+ var conditional = direction === 'down' ? min !== undefined && value > min || min === undefined : max !== undefined && value < max || max === undefined;
93
+
94
+ if (!disabled && conditional) {
95
+ value = direction === 'down' ? value - step : value + step;
96
+ value = capMax(max, capMin(min, value));
97
+ evt.persist();
98
+ evt.imaginaryTarget = _this._inputRef;
99
+
100
+ _this.setState({
101
+ value: value
102
+ }, function () {
103
+ //TO-DO v11: update these events to return the same things --> evt, {value, direction}
104
+ if (useControlledStateWithValue) {
105
+ onClick && onClick(evt, {
106
+ value: value,
107
+ direction: direction
108
+ });
109
+ onChange && onChange(evt, {
110
+ value: value,
111
+ direction: direction
112
+ });
113
+ } else {
114
+ // value added as a 3rd argument rather than in same obj so it doesn't break in v10
115
+ onClick && onClick(evt, direction, value);
116
+ onChange && onChange(evt, direction, value);
117
+ }
118
+ });
119
+ }
120
+ });
121
+
122
+ _defineProperty(_assertThisInitialized(_this), "_handleInputRef", function (ref) {
123
+ _this._inputRef = ref;
124
+ });
125
+
126
+ _this.isControlled = props.value !== undefined;
127
+
128
+ if (useControlledStateWithValue && _this.isControlled) {
129
+ // Skips the logic of setting initial state if this component is controlled
130
+ _this.state = {};
131
+ return _possibleConstructorReturn(_this);
132
+ }
133
+
134
+ var _value = useControlledStateWithValue || typeof props.defaultValue !== 'undefined' ? props.defaultValue : props.value;
135
+
136
+ _value = _value === undefined ? 0 : _value;
137
+
138
+ if (props.min || props.min === 0) {
139
+ _value = Math.max(props.min, _value);
140
+ }
141
+
142
+ _this.state = {
143
+ value: _value
144
+ };
145
+ return _this;
146
+ }
147
+
148
+ _createClass(NumberInput, [{
149
+ key: "render",
150
+ value: function render() {
151
+ var _this2 = this;
152
+
153
+ var _this$props3 = this.props,
154
+ className = _this$props3.className,
155
+ disabled = _this$props3.disabled,
156
+ iconDescription = _this$props3.iconDescription,
157
+ id = _this$props3.id,
158
+ hideLabel = _this$props3.hideLabel,
159
+ hideSteppers = _this$props3.hideSteppers,
160
+ label = _this$props3.label,
161
+ max = _this$props3.max,
162
+ min = _this$props3.min,
163
+ step = _this$props3.step,
164
+ value = _this$props3.value,
165
+ readOnly = _this$props3.readOnly,
166
+ invalid = _this$props3.invalid,
167
+ invalidText = _this$props3.invalidText,
168
+ warn = _this$props3.warn,
169
+ warnText = _this$props3.warnText,
170
+ helperText = _this$props3.helperText,
171
+ ariaLabel = _this$props3.ariaLabel,
172
+ light = _this$props3.light,
173
+ allowEmpty = _this$props3.allowEmpty,
174
+ ref = _this$props3.innerRef,
175
+ t = _this$props3.translateWithId,
176
+ isMobile = _this$props3.isMobile,
177
+ size = _this$props3.size;
178
+ _this$props3.defaultValue;
179
+ var other = _objectWithoutProperties(_this$props3, _excluded);
180
+
181
+ var scope = this.context;
182
+ var enabled;
183
+
184
+ if (scope.enabled) {
185
+ enabled = scope.enabled('enable-v11-release');
186
+ }
187
+
188
+ return /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, function (prefix) {
189
+ var _classNames, _classNames3, _classNames5, _normalizedProps$icon;
190
+
191
+ var numberInputClasses = cx("".concat(prefix, "--number ").concat(prefix, "--number--helpertext"), [enabled ? null : className], (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--number--readonly"), readOnly), _defineProperty(_classNames, "".concat(prefix, "--number--light"), light), _defineProperty(_classNames, "".concat(prefix, "--number--nolabel"), hideLabel), _defineProperty(_classNames, "".concat(prefix, "--number--nosteppers"), hideSteppers), _defineProperty(_classNames, "".concat(prefix, "--number--mobile"), isMobile), _defineProperty(_classNames, "".concat(prefix, "--number--").concat(size), size), _classNames));
192
+ var isInputInvalid; // If the user supplied `invalid` through props, we'll defer to the passed in value
193
+
194
+ if (invalid) {
195
+ isInputInvalid = true;
196
+ } else {
197
+ // Otherwise, if we don't allow an empty value then we check to see
198
+ // if the value is empty, or if it is out of range
199
+ if (!allowEmpty && _this2.state.value === '') {
200
+ isInputInvalid = true;
201
+ } else {
202
+ if (_this2.state.value !== '' && (_this2.state.value > max || _this2.state.value < min)) {
203
+ isInputInvalid = true;
204
+ }
205
+ }
206
+ }
207
+
208
+ var normalizedProps = useNormalizedInputProps({
209
+ id: id,
210
+ readOnly: readOnly,
211
+ disabled: disabled,
212
+ invalid: isInputInvalid,
213
+ invalidText: invalidText,
214
+ warn: warn,
215
+ warnText: warnText
216
+ });
217
+ var props = {
218
+ disabled: normalizedProps.disabled,
219
+ id: id,
220
+ max: max,
221
+ min: min,
222
+ step: step,
223
+ onChange: _this2.handleChange,
224
+ value: useControlledStateWithValue && _this2.isControlled ? value : _this2.state.value,
225
+ readOnly: readOnly,
226
+ 'aria-label': label ? null : ariaLabel
227
+ };
228
+ var buttonProps = {
229
+ disabled: disabled
230
+ };
231
+ var inputWrapperProps = {};
232
+
233
+ if (normalizedProps.invalid) {
234
+ inputWrapperProps['data-invalid'] = true;
235
+ }
236
+
237
+ var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), _defineProperty({}, "".concat(prefix, "--form__helper-text--disabled"), normalizedProps.disabled));
238
+ var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
239
+ className: helperTextClasses
240
+ }, helperText) : null;
241
+ var labelClasses = cx("".concat(prefix, "--label"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefix, "--label--disabled"), normalizedProps.disabled), _defineProperty(_classNames3, "".concat(prefix, "--visually-hidden"), hideLabel), _classNames3));
242
+ var labelText = label ? /*#__PURE__*/React__default.createElement("label", {
243
+ htmlFor: id,
244
+ className: labelClasses
245
+ }, label) : null;
246
+ var _ref = [t('increment.number'), t('decrement.number')],
247
+ incrementNumLabel = _ref[0],
248
+ decrementNumLabel = _ref[1];
249
+ var wrapperClasses = cx("".concat(prefix, "--number__input-wrapper"), _defineProperty({}, "".concat(prefix, "--number__input-wrapper--warning"), normalizedProps.warn));
250
+ var iconClasses = cx((_classNames5 = {}, _defineProperty(_classNames5, "".concat(prefix, "--number__invalid"), normalizedProps.invalid || normalizedProps.warn), _defineProperty(_classNames5, "".concat(prefix, "--number__invalid--warning"), normalizedProps.warn), _defineProperty(_classNames5, "".concat(prefix, "--number__readonly-icon"), readOnly), _classNames5));
251
+ var ariaDescribedBy = null;
252
+
253
+ if (normalizedProps.invalid) {
254
+ ariaDescribedBy = normalizedProps.invalidId;
255
+ }
256
+
257
+ if (normalizedProps.warn) {
258
+ ariaDescribedBy = normalizedProps.warnId;
259
+ }
260
+
261
+ return /*#__PURE__*/React__default.createElement("div", {
262
+ className: enabled ? cx("".concat(prefix, "--form-item"), className) : "".concat(prefix, "--form-item")
263
+ }, /*#__PURE__*/React__default.createElement("div", _extends({
264
+ className: numberInputClasses
265
+ }, inputWrapperProps), function () {
266
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, labelText, /*#__PURE__*/React__default.createElement("div", {
267
+ className: wrapperClasses
268
+ }, /*#__PURE__*/React__default.createElement("input", _extends({
269
+ "data-invalid": normalizedProps.invalid,
270
+ "aria-invalid": normalizedProps.invalid,
271
+ "aria-describedby": ariaDescribedBy,
272
+ type: "number",
273
+ pattern: "[0-9]*"
274
+ }, other, props, {
275
+ ref: mergeRefs(ref, _this2._handleInputRef)
276
+ })), normalizedProps.icon && (_normalizedProps$icon || (_normalizedProps$icon = /*#__PURE__*/React__default.createElement(normalizedProps.icon, {
277
+ className: iconClasses
278
+ }))), !hideSteppers && /*#__PURE__*/React__default.createElement("div", {
279
+ className: "".concat(prefix, "--number__controls")
280
+ }, /*#__PURE__*/React__default.createElement("button", _extends({
281
+ type: "button",
282
+ className: "".concat(prefix, "--number__control-btn down-icon")
283
+ }, buttonProps, {
284
+ onClick: function onClick(evt) {
285
+ return _this2.handleArrowClick(evt, 'down');
286
+ },
287
+ title: decrementNumLabel || iconDescription,
288
+ "aria-label": decrementNumLabel || iconDescription,
289
+ tabIndex: "-1"
290
+ }), _Subtract || (_Subtract = /*#__PURE__*/React__default.createElement(Subtract, {
291
+ className: "down-icon"
292
+ }))), /*#__PURE__*/React__default.createElement("div", {
293
+ className: "".concat(prefix, "--number__rule-divider")
294
+ }), /*#__PURE__*/React__default.createElement("button", _extends({
295
+ type: "button",
296
+ className: "".concat(prefix, "--number__control-btn up-icon")
297
+ }, buttonProps, {
298
+ onClick: function onClick(evt) {
299
+ return _this2.handleArrowClick(evt, 'up');
300
+ },
301
+ title: incrementNumLabel || iconDescription,
302
+ "aria-label": incrementNumLabel || iconDescription,
303
+ tabIndex: "-1"
304
+ }), _Add || (_Add = /*#__PURE__*/React__default.createElement(Add, {
305
+ className: "up-icon"
306
+ }))), /*#__PURE__*/React__default.createElement("div", {
307
+ className: "".concat(prefix, "--number__rule-divider")
308
+ }))), normalizedProps.validation ? null : helper);
309
+ }(), normalizedProps.validation));
310
+ });
311
+ }
312
+ }], [{
313
+ key: "getDerivedStateFromProps",
314
+ value: function getDerivedStateFromProps(_ref2, state) {
315
+ var value = _ref2.value;
316
+ var prevValue = state.prevValue;
317
+
318
+ if (useControlledStateWithValue && value === '' && prevValue !== '') {
319
+ return {
320
+ value: '',
321
+ prevValue: ''
322
+ };
323
+ } // If `useControlledStateWithValue` feature flag is on, do nothing here.
324
+ // Otherwise, do prop -> state sync with "value capping".
325
+ //// Value capping removed in #8965
326
+ //// value: capMax(max, capMin(min, value)), (L223)
327
+
328
+
329
+ return useControlledStateWithValue || prevValue === value ? null : {
330
+ value: value,
331
+ prevValue: value
332
+ };
333
+ }
334
+ /**
335
+ * The DOM node reference to the `<input>`.
336
+ * @type {HTMLInputElement}
337
+ */
338
+
339
+ }]);
340
+
341
+ return NumberInput;
342
+ }(Component);
343
+
344
+ _defineProperty(NumberInput, "propTypes", {
345
+ /**
346
+ * `true` to allow empty string.
347
+ */
348
+ allowEmpty: PropTypes.bool,
349
+
350
+ /**
351
+ * Provide a description that would be used to best describe the use case of the NumberInput component
352
+ */
353
+ ariaLabel: PropTypes.string,
354
+
355
+ /**
356
+ * Specify an optional className to be applied to the wrapper node
357
+ */
358
+ className: PropTypes.string,
359
+
360
+ /**
361
+ * Optional starting value for uncontrolled state
362
+ */
363
+ defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
364
+
365
+ /**
366
+ * Specify if the control should be disabled, or not
367
+ */
368
+ disabled: PropTypes.bool,
369
+
370
+ /**
371
+ * Provide text that is used alongside the control label for additional help
372
+ */
373
+ helperText: PropTypes.node,
374
+
375
+ /**
376
+ * Specify whether you want the underlying label to be visually hidden
377
+ */
378
+ hideLabel: PropTypes.bool,
379
+
380
+ /**
381
+ * Specify whether you want the steppers to be hidden
382
+ */
383
+ hideSteppers: PropTypes.bool,
384
+
385
+ /**
386
+ * Provide a description for up/down icons that can be read by screen readers
387
+ */
388
+ iconDescription: PropTypes.string.isRequired,
389
+
390
+ /**
391
+ * Specify a custom `id` for the input
392
+ */
393
+ id: PropTypes.string.isRequired,
394
+
395
+ /**
396
+ * Specify if the currently value is invalid.
397
+ */
398
+ invalid: PropTypes.bool,
399
+
400
+ /**
401
+ * Message which is displayed if the value is invalid.
402
+ */
403
+ invalidText: PropTypes.node,
404
+
405
+ /**
406
+ * `true` to use the mobile variant.
407
+ */
408
+ isMobile: deprecate(PropTypes.bool, "The `isMobile` prop no longer needed as the default NumberInput styles are now identical to the mobile variant styles. This prop will be removed in the next major version of `carbon-components-react`"),
409
+
410
+ /**
411
+ * Generic `label` that will be used as the textual representation of what
412
+ * this field is for
413
+ */
414
+ label: PropTypes.node,
415
+
416
+ /**
417
+ * `true` to use the light version.
418
+ */
419
+ light: PropTypes.bool,
420
+
421
+ /**
422
+ * The maximum value.
423
+ */
424
+ max: PropTypes.number,
425
+
426
+ /**
427
+ * The minimum value.
428
+ */
429
+ min: PropTypes.number,
430
+
431
+ /**
432
+ * The new value is available in 'imaginaryTarget.value'
433
+ * i.e. to get the value: evt.imaginaryTarget.value
434
+ *
435
+ * * _With_ `useControlledStateWithValue` feature flag, the signature of the event handler will be altered to provide additional context in the second parameter: `onChange(event, { value, direction })` where:
436
+ * * `event` is the (React) raw event
437
+ * * `value` is the new value
438
+ * * `direction` tells you the button you hit is up button or down button
439
+ * * _Without_ this feature flag the event handler has `onChange(event, direction)` signature.
440
+ */
441
+ onChange: !useControlledStateWithValue ? PropTypes.func : requiredIfValueExists(PropTypes.func),
442
+
443
+ /**
444
+ * Provide an optional function to be called when the up/down button is clicked
445
+ */
446
+ onClick: PropTypes.func,
447
+
448
+ /**
449
+ * Specify if the component should be read-only
450
+ */
451
+ readOnly: PropTypes.bool,
452
+
453
+ /**
454
+ * Specify the size of the Number Input. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
455
+ * TODO V11: remove `xl` (replaced with lg)
456
+ */
457
+ size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
458
+
459
+ /**
460
+ * Specify how much the values should increase/decrease upon clicking on up/down button
461
+ */
462
+ step: PropTypes.number,
463
+
464
+ /**
465
+ * Provide custom text for the component for each translation id
466
+ */
467
+ translateWithId: PropTypes.func.isRequired,
468
+
469
+ /**
470
+ * Specify the value of the input
471
+ */
472
+ value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
473
+
474
+ /**
475
+ * Specify whether the control is currently in warning state
476
+ */
477
+ warn: PropTypes.bool,
478
+
479
+ /**
480
+ * Provide the text that is displayed when the control is in warning state
481
+ */
482
+ warnText: PropTypes.node
483
+ });
484
+
485
+ _defineProperty(NumberInput, "defaultProps", {
486
+ disabled: false,
487
+ hideLabel: false,
488
+ iconDescription: FeatureFlags.enabled('enable-v11-release') ? undefined : 'choose a number',
489
+ step: 1,
490
+ invalid: false,
491
+ invalidText: FeatureFlags.enabled('enable-v11-release') ? undefined : 'Provide invalidText',
492
+ warn: false,
493
+ warnText: '',
494
+ ariaLabel: 'Numeric input field with increment and decrement buttons',
495
+ helperText: '',
496
+ light: false,
497
+ allowEmpty: false,
498
+ translateWithId: function translateWithId(id) {
499
+ return defaultTranslations[id];
500
+ }
501
+ });
502
+
503
+ _defineProperty(NumberInput, "contextType", FeatureFlagContext);
504
+ var NumberInput$1 = (function () {
505
+ var forwardRef = function forwardRef(props, ref) {
506
+ return /*#__PURE__*/React__default.createElement(NumberInput, _extends({}, props, {
507
+ innerRef: ref
508
+ }));
509
+ };
510
+
511
+ forwardRef.displayName = 'NumberInput';
512
+ return /*#__PURE__*/React__default.forwardRef(forwardRef);
513
+ })();
514
+
515
+ export { NumberInput, NumberInput$1 as default, translationIds };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import PropTypes from 'prop-types';
10
+ import React__default from 'react';
11
+ import cx from 'classnames';
12
+ import { usePrefix } from '../../internal/usePrefix.js';
13
+
14
+ var _excluded = ["children", "className", "nested", "native", "isExpressive"];
15
+
16
+ var OrderedList = function OrderedList(_ref) {
17
+ var _classnames;
18
+
19
+ var children = _ref.children,
20
+ className = _ref.className,
21
+ nested = _ref.nested,
22
+ native = _ref.native,
23
+ isExpressive = _ref.isExpressive,
24
+ other = _objectWithoutProperties(_ref, _excluded);
25
+
26
+ var prefix = usePrefix();
27
+ var classNames = cx((_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "--list--ordered"), !native), _defineProperty(_classnames, "".concat(prefix, "--list--ordered--native"), native), _defineProperty(_classnames, "".concat(prefix, "--list--nested"), nested), _defineProperty(_classnames, "".concat(prefix, "--list--expressive"), isExpressive), _classnames), className);
28
+ return /*#__PURE__*/React__default.createElement("ol", _extends({
29
+ className: classNames
30
+ }, other), children);
31
+ };
32
+
33
+ OrderedList.propTypes = {
34
+ /**
35
+ * Provide list items to be rendered in the ordered list
36
+ */
37
+ children: PropTypes.node,
38
+
39
+ /**
40
+ * Provide an optional className to be applied to the containing <ol> node
41
+ */
42
+ className: PropTypes.string,
43
+
44
+ /**
45
+ * Specify whether this ordered list expressive or not
46
+ */
47
+ isExpressive: PropTypes.bool,
48
+
49
+ /**
50
+ * Specify whether this ordered list should use native list styles instead of custom counter
51
+ */
52
+ native: PropTypes.bool,
53
+
54
+ /**
55
+ * Specify whether this ordered list is nested inside of another nested list
56
+ */
57
+ nested: PropTypes.bool
58
+ };
59
+ OrderedList.defaultProps = {
60
+ nested: false,
61
+ native: false,
62
+ isExpressive: false
63
+ };
64
+ var OrderedList$1 = OrderedList;
65
+
66
+ export { OrderedList$1 as default };