@carbon/react 1.19.0 → 1.21.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 (231) hide show
  1. package/es/_virtual/_commonjsHelpers.js +15 -2
  2. package/es/_virtual/index.js +6 -2
  3. package/es/_virtual/rangePlugin.js +6 -2
  4. package/es/components/Accordion/Accordion.Skeleton.js +1 -1
  5. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +1 -1
  6. package/es/components/Button/Button.Skeleton.js +1 -1
  7. package/es/components/Button/Button.js +1 -0
  8. package/es/components/{Checkbox → Button}/index.js +3 -3
  9. package/es/components/{Pagination → ButtonSet}/index.js +2 -3
  10. package/es/components/Checkbox/Checkbox.Skeleton.js +1 -1
  11. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +1 -1
  12. package/es/components/CodeSnippet/CodeSnippet.js +1 -1
  13. package/es/components/{RadioButtonGroup → ComboBox}/index.js +2 -2
  14. package/es/components/ComposedModal/ModalFooter.js +1 -1
  15. package/es/components/ContainedList/ContainedList.js +8 -1
  16. package/es/components/ContainedList/ContainedListItem/index.js +9 -0
  17. package/es/components/ContainedList/index.js +1 -1
  18. package/es/components/ContentSwitcher/index.js +3 -3
  19. package/es/components/{ModalWrapper → Copy}/index.js +2 -2
  20. package/es/components/CopyButton/index.js +9 -0
  21. package/es/components/DangerButton/DangerButton.js +1 -1
  22. package/es/components/DataTable/TableBatchAction.js +1 -1
  23. package/es/components/DataTable/TableBatchActions.js +1 -1
  24. package/es/components/DataTable/TableHeader.js +1 -3
  25. package/es/components/DataTable/index.js +1 -1
  26. package/es/components/DatePicker/DatePicker.Skeleton.js +1 -1
  27. package/es/components/DatePicker/DatePicker.js +30 -8
  28. package/es/components/DatePicker/index.js +10 -0
  29. package/es/components/DatePickerInput/index.js +9 -0
  30. package/es/components/Dropdown/Dropdown.Skeleton.js +1 -1
  31. package/es/components/Dropdown/index.js +10 -0
  32. package/es/components/FileUploader/FileUploader.Skeleton.js +1 -1
  33. package/es/components/FluidDatePicker/FluidDatePicker.js +1 -1
  34. package/es/components/FluidDropdown/FluidDropdown.js +1 -1
  35. package/es/components/FluidSelect/FluidSelect.js +1 -1
  36. package/es/components/FluidSelect/index.js +10 -0
  37. package/es/components/FluidTextArea/FluidTextArea.js +1 -1
  38. package/es/components/FluidTextInput/index.js +10 -0
  39. package/es/components/{ExpandableSearch → Form}/index.js +2 -2
  40. package/es/components/Icon/Icon.Skeleton.js +1 -1
  41. package/es/components/IconButton/index.js +1 -1
  42. package/es/components/InlineCheckbox/index.js +9 -0
  43. package/es/components/Link/index.js +9 -0
  44. package/es/components/Loading/index.js +9 -0
  45. package/es/components/Menu/index.js +1 -1
  46. package/es/components/Modal/Modal.js +1 -1
  47. package/es/components/Modal/index.js +1 -1
  48. package/es/components/ModalWrapper/ModalWrapper.js +1 -1
  49. package/es/components/MultiSelect/index.js +1 -1
  50. package/es/components/Notification/Notification.js +1 -1
  51. package/es/components/NumberInput/NumberInput.js +38 -20
  52. package/es/components/OverflowMenu/index.js +1 -1
  53. package/es/components/OverflowMenuItem/OverflowMenuItem.js +86 -125
  54. package/es/components/OverflowMenuItem/index.js +1 -1
  55. package/es/components/Pagination/Pagination.Skeleton.js +1 -1
  56. package/es/components/Pagination/Pagination.js +1 -1
  57. package/es/components/Pagination/experimental/PageSelector.js +1 -1
  58. package/es/components/Pagination/experimental/Pagination.js +2 -2
  59. package/es/components/PaginationNav/PaginationNav.js +1 -1
  60. package/es/components/PrimaryButton/PrimaryButton.js +1 -1
  61. package/es/components/ProgressBar/ProgressBar.js +11 -4
  62. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +1 -1
  63. package/es/components/RadioButton/RadioButton.Skeleton.js +1 -1
  64. package/es/components/RadioButton/index.js +1 -1
  65. package/es/components/RadioTile/index.js +9 -0
  66. package/es/components/Search/Search.Skeleton.js +1 -1
  67. package/es/components/Search/Search.js +8 -2
  68. package/es/components/Search/index.js +1 -1
  69. package/es/components/SecondaryButton/SecondaryButton.js +1 -1
  70. package/es/components/Select/Select.Skeleton.js +1 -1
  71. package/es/components/Select/index.js +10 -0
  72. package/es/components/SelectItem/index.js +9 -0
  73. package/es/components/SkeletonText/SkeletonText.js +40 -39
  74. package/es/components/SkeletonText/index.js +9 -0
  75. package/es/components/Slider/Slider.Skeleton.js +1 -1
  76. package/es/components/Slider/Slider.js +16 -26
  77. package/es/components/Slider/index.js +3 -3
  78. package/es/components/Tab/index.js +1 -1
  79. package/es/components/Tabs/Tabs.Skeleton.js +1 -1
  80. package/es/components/Tag/Tag.Skeleton.js +1 -1
  81. package/es/components/Tag/Tag.js +2 -1
  82. package/es/components/TextArea/TextArea.Skeleton.js +1 -1
  83. package/es/components/TextArea/TextArea.js +11 -4
  84. package/es/components/TextArea/index.js +10 -0
  85. package/es/components/TextInput/TextInput.Skeleton.js +1 -1
  86. package/es/components/TextInput/index.js +1 -1
  87. package/es/components/Tile/Tile.js +7 -5
  88. package/es/components/TileGroup/index.js +3 -3
  89. package/es/components/TimePickerSelect/TimePickerSelect.js +57 -69
  90. package/es/components/TimePickerSelect/index.js +3 -4
  91. package/es/components/Toggle/Toggle.Skeleton.js +1 -1
  92. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +1 -1
  93. package/es/components/TreeView/index.js +1 -1
  94. package/es/components/UIShell/HeaderGlobalAction.js +1 -1
  95. package/es/components/UIShell/HeaderNavigation.js +1 -1
  96. package/es/components/UIShell/SideNavLink.js +5 -0
  97. package/es/components/UIShell/SideNavMenu.js +1 -1
  98. package/es/es/components/Checkbox/Checkbox.Skeleton.d.ts +1 -0
  99. package/es/es/components/Checkbox/Checkbox.d.ts +1 -1
  100. package/es/es/components/Checkbox/index.d.ts +3 -2
  101. package/es/es/components/Text/Text.d.ts +1 -1
  102. package/es/es/components/Text/TextDirection.d.ts +2 -2
  103. package/es/es/index.d.ts +119 -0
  104. package/es/index.js +24 -24
  105. package/es/node_modules/flatpickr/dist/l10n/index.js +3 -3
  106. package/es/node_modules/flatpickr/dist/plugins/rangePlugin.js +2 -2
  107. package/es/node_modules/use-resize-observer/polyfilled.js +0 -1
  108. package/lib/_virtual/_commonjsHelpers.js +15 -2
  109. package/lib/_virtual/index.js +6 -2
  110. package/lib/_virtual/rangePlugin.js +6 -2
  111. package/lib/components/Accordion/Accordion.Skeleton.js +1 -0
  112. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +1 -0
  113. package/lib/components/Button/Button.Skeleton.js +1 -0
  114. package/lib/components/Button/Button.js +1 -0
  115. package/lib/components/{Checkbox → Button}/index.js +5 -4
  116. package/lib/components/ButtonSet/index.js +17 -0
  117. package/lib/components/Checkbox/Checkbox.Skeleton.js +1 -0
  118. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +1 -0
  119. package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
  120. package/lib/components/{Pagination → ComboBox}/index.js +3 -3
  121. package/lib/components/ComposedModal/ModalFooter.js +1 -1
  122. package/lib/components/ContainedList/ContainedList.js +8 -1
  123. package/lib/components/ContainedList/ContainedListItem/index.js +17 -0
  124. package/lib/components/ContainedList/index.js +1 -0
  125. package/lib/components/ContentSwitcher/index.js +4 -3
  126. package/lib/components/{ModalWrapper → Copy}/index.js +3 -2
  127. package/lib/components/CopyButton/index.js +17 -0
  128. package/lib/components/DangerButton/DangerButton.js +1 -1
  129. package/lib/components/DataTable/TableBatchAction.js +1 -1
  130. package/lib/components/DataTable/TableBatchActions.js +1 -1
  131. package/lib/components/DataTable/TableHeader.js +1 -3
  132. package/lib/components/DataTable/index.js +1 -0
  133. package/lib/components/DatePicker/DatePicker.Skeleton.js +1 -0
  134. package/lib/components/DatePicker/DatePicker.js +28 -6
  135. package/lib/components/DatePicker/index.js +19 -0
  136. package/lib/components/DatePickerInput/index.js +17 -0
  137. package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -0
  138. package/lib/components/Dropdown/index.js +19 -0
  139. package/lib/components/FileUploader/FileUploader.Skeleton.js +1 -0
  140. package/lib/components/FluidDatePicker/FluidDatePicker.js +1 -1
  141. package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
  142. package/lib/components/FluidSelect/FluidSelect.js +1 -1
  143. package/lib/components/FluidSelect/index.js +19 -0
  144. package/lib/components/FluidTextArea/FluidTextArea.js +1 -1
  145. package/lib/components/FluidTextInput/index.js +19 -0
  146. package/lib/components/{RadioButtonGroup → Form}/index.js +3 -2
  147. package/lib/components/Icon/Icon.Skeleton.js +1 -0
  148. package/lib/components/IconButton/index.js +1 -1
  149. package/lib/components/InlineCheckbox/index.js +17 -0
  150. package/lib/components/{ExpandableSearch → Link}/index.js +3 -2
  151. package/lib/components/Loading/index.js +17 -0
  152. package/lib/components/Menu/index.js +1 -0
  153. package/lib/components/Modal/Modal.js +1 -1
  154. package/lib/components/Modal/index.js +1 -0
  155. package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
  156. package/lib/components/MultiSelect/index.js +1 -0
  157. package/lib/components/Notification/Notification.js +1 -1
  158. package/lib/components/NumberInput/NumberInput.js +37 -19
  159. package/lib/components/OverflowMenu/index.js +1 -0
  160. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +83 -141
  161. package/lib/components/OverflowMenuItem/index.js +1 -0
  162. package/lib/components/Pagination/Pagination.Skeleton.js +1 -0
  163. package/lib/components/Pagination/Pagination.js +1 -1
  164. package/lib/components/Pagination/experimental/PageSelector.js +1 -1
  165. package/lib/components/Pagination/experimental/Pagination.js +2 -2
  166. package/lib/components/PaginationNav/PaginationNav.js +1 -1
  167. package/lib/components/PrimaryButton/PrimaryButton.js +1 -1
  168. package/lib/components/ProgressBar/ProgressBar.js +10 -3
  169. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +1 -0
  170. package/lib/components/RadioButton/RadioButton.Skeleton.js +1 -0
  171. package/lib/components/RadioButton/index.js +1 -0
  172. package/lib/components/RadioTile/index.js +17 -0
  173. package/lib/components/Search/Search.Skeleton.js +1 -0
  174. package/lib/components/Search/Search.js +7 -1
  175. package/lib/components/Search/index.js +1 -0
  176. package/lib/components/SecondaryButton/SecondaryButton.js +1 -1
  177. package/lib/components/Select/Select.Skeleton.js +1 -0
  178. package/lib/components/Select/index.js +19 -0
  179. package/lib/components/SelectItem/index.js +17 -0
  180. package/lib/components/SkeletonText/SkeletonText.js +38 -37
  181. package/lib/components/SkeletonText/index.js +17 -0
  182. package/lib/components/Slider/Slider.Skeleton.js +1 -0
  183. package/lib/components/Slider/Slider.js +16 -26
  184. package/lib/components/Slider/index.js +4 -3
  185. package/lib/components/Tab/index.js +1 -0
  186. package/lib/components/Tabs/Tabs.Skeleton.js +1 -0
  187. package/lib/components/Tag/Tag.Skeleton.js +1 -0
  188. package/lib/components/Tag/Tag.js +2 -0
  189. package/lib/components/TextArea/TextArea.Skeleton.js +1 -0
  190. package/lib/components/TextArea/TextArea.js +10 -3
  191. package/lib/components/TextArea/index.js +19 -0
  192. package/lib/components/TextInput/TextInput.Skeleton.js +1 -0
  193. package/lib/components/TextInput/index.js +1 -0
  194. package/lib/components/Tile/Tile.js +7 -5
  195. package/lib/components/TileGroup/index.js +4 -3
  196. package/lib/components/TimePickerSelect/TimePickerSelect.js +53 -65
  197. package/lib/components/TimePickerSelect/index.js +3 -3
  198. package/lib/components/Toggle/Toggle.Skeleton.js +1 -0
  199. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +1 -0
  200. package/lib/components/TreeView/index.js +1 -0
  201. package/lib/components/UIShell/HeaderGlobalAction.js +1 -1
  202. package/lib/components/UIShell/HeaderNavigation.js +1 -0
  203. package/lib/components/UIShell/SideNavLink.js +5 -0
  204. package/lib/components/UIShell/SideNavMenu.js +1 -0
  205. package/lib/index.js +85 -81
  206. package/lib/lib/components/Checkbox/Checkbox.Skeleton.d.ts +1 -0
  207. package/lib/lib/components/Checkbox/Checkbox.d.ts +1 -1
  208. package/lib/lib/components/Checkbox/index.d.ts +3 -2
  209. package/lib/lib/components/Text/Text.d.ts +1 -1
  210. package/lib/lib/components/Text/TextDirection.d.ts +2 -2
  211. package/lib/lib/index.d.ts +119 -0
  212. package/lib/node_modules/flatpickr/dist/l10n/index.js +2 -2
  213. package/lib/node_modules/flatpickr/dist/plugins/rangePlugin.js +2 -2
  214. package/lib/node_modules/use-resize-observer/polyfilled.js +0 -1
  215. package/package.json +7 -7
  216. package/scss/components/fluid-combo-box/_fluid-combo-box.scss +9 -0
  217. package/scss/components/fluid-combo-box/_index.scss +9 -0
  218. package/scss/components/fluid-multiselect/_fluid-multiselect.scss +9 -0
  219. package/scss/components/fluid-multiselect/_index.scss +9 -0
  220. package/scss/components/fluid-number-input/_fluid-number-input.scss +9 -0
  221. package/scss/components/fluid-number-input/_index.scss +9 -0
  222. package/scss/components/fluid-search/_fluid-search.scss +9 -0
  223. package/scss/components/fluid-search/_index.scss +9 -0
  224. package/es/components/Accordion/index.js +0 -11
  225. package/es/components/AccordionItem/index.js +0 -13
  226. package/es/components/Tabs/index.js +0 -10
  227. package/es/components/TimePickerSelect/next/TimePickerSelect.js +0 -70
  228. package/lib/components/Accordion/index.js +0 -20
  229. package/lib/components/AccordionItem/index.js +0 -18
  230. package/lib/components/Tabs/index.js +0 -23
  231. package/lib/components/TimePickerSelect/next/TimePickerSelect.js +0 -80
@@ -9,12 +9,13 @@ import { defineProperty as _defineProperty, objectWithoutProperties as _objectWi
9
9
  import { Subtract, Add } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
- import React__default, { useState, useRef } from 'react';
13
- import { useFeatureFlag } from '../FeatureFlags/index.js';
12
+ import React__default, { useContext, useState, useRef } from 'react';
14
13
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
15
14
  import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
16
15
  import { usePrefix } from '../../internal/usePrefix.js';
17
16
  import deprecate from '../../prop-types/deprecate.js';
17
+ import '../FluidForm/FluidForm.js';
18
+ import { FormContext } from '../FluidForm/FormContext.js';
18
19
 
19
20
  var _excluded = ["allowEmpty", "className", "disabled", "disableWheel", "defaultValue", "helperText", "hideLabel", "hideSteppers", "iconDescription", "id", "label", "invalid", "invalidText", "light", "max", "min", "onChange", "onClick", "onKeyUp", "readOnly", "size", "step", "translateWithId", "warn", "warnText", "value"];
20
21
 
@@ -25,9 +26,7 @@ var translationIds = {
25
26
  };
26
27
  var defaultTranslations = (_defaultTranslations = {}, _defineProperty(_defaultTranslations, translationIds['increment.number'], 'Increment number'), _defineProperty(_defaultTranslations, translationIds['decrement.number'], 'Decrement number'), _defaultTranslations);
27
28
  var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(props, forwardRef) {
28
- var _cx, _cx3;
29
-
30
- var enabled = useFeatureFlag('enable-v11-release');
29
+ var _cx, _cx3, _cx4;
31
30
 
32
31
  var _props$allowEmpty = props.allowEmpty,
33
32
  allowEmpty = _props$allowEmpty === void 0 ? false : _props$allowEmpty,
@@ -42,14 +41,12 @@ var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(pr
42
41
  _props$hideLabel = props.hideLabel,
43
42
  hideLabel = _props$hideLabel === void 0 ? false : _props$hideLabel,
44
43
  hideSteppers = props.hideSteppers,
45
- _props$iconDescriptio = props.iconDescription,
46
- iconDescription = _props$iconDescriptio === void 0 ? enabled ? undefined : 'choose a number' : _props$iconDescriptio,
44
+ iconDescription = props.iconDescription,
47
45
  id = props.id,
48
46
  label = props.label,
49
47
  _props$invalid = props.invalid,
50
48
  invalid = _props$invalid === void 0 ? false : _props$invalid,
51
- _props$invalidText = props.invalidText,
52
- invalidText = _props$invalidText === void 0 ? enabled ? undefined : 'Provide invalidText' : _props$invalidText,
49
+ invalidText = props.invalidText,
53
50
  light = props.light,
54
51
  _props$max = props.max,
55
52
  max = _props$max === void 0 ? 100 : _props$max,
@@ -76,7 +73,15 @@ var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(pr
76
73
 
77
74
  var prefix = usePrefix();
78
75
 
79
- var _useState = useState(function () {
76
+ var _useContext = useContext(FormContext),
77
+ isFluid = _useContext.isFluid;
78
+
79
+ var _useState = useState(false),
80
+ _useState2 = _slicedToArray(_useState, 2),
81
+ isFocused = _useState2[0],
82
+ setIsFocused = _useState2[1];
83
+
84
+ var _useState3 = useState(function () {
80
85
  if (controlledValue !== undefined) {
81
86
  return controlledValue;
82
87
  }
@@ -87,18 +92,18 @@ var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(pr
87
92
 
88
93
  return 0;
89
94
  }),
90
- _useState2 = _slicedToArray(_useState, 2),
91
- value = _useState2[0],
92
- setValue = _useState2[1];
93
-
94
- var _useState3 = useState(controlledValue),
95
95
  _useState4 = _slicedToArray(_useState3, 2),
96
- prevControlledValue = _useState4[0],
97
- setPrevControlledValue = _useState4[1];
96
+ value = _useState4[0],
97
+ setValue = _useState4[1];
98
+
99
+ var _useState5 = useState(controlledValue),
100
+ _useState6 = _slicedToArray(_useState5, 2),
101
+ prevControlledValue = _useState6[0],
102
+ setPrevControlledValue = _useState6[1];
98
103
 
99
104
  var inputRef = useRef(null);
100
105
  var ref = useMergedRefs([forwardRef, inputRef]);
101
- var numberInputClasses = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--number"), true), _defineProperty(_cx, "".concat(prefix, "--number--helpertext"), true), _defineProperty(_cx, "".concat(prefix, "--number--readonly"), readOnly), _defineProperty(_cx, "".concat(prefix, "--number--light"), light), _defineProperty(_cx, "".concat(prefix, "--number--nolabel"), hideLabel), _defineProperty(_cx, "".concat(prefix, "--number--nosteppers"), hideSteppers), _defineProperty(_cx, "".concat(prefix, "--number--").concat(size), size), _defineProperty(_cx, customClassName, !enabled), _cx));
106
+ var numberInputClasses = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--number"), true), _defineProperty(_cx, "".concat(prefix, "--number--helpertext"), true), _defineProperty(_cx, "".concat(prefix, "--number--readonly"), readOnly), _defineProperty(_cx, "".concat(prefix, "--number--light"), light), _defineProperty(_cx, "".concat(prefix, "--number--nolabel"), hideLabel), _defineProperty(_cx, "".concat(prefix, "--number--nosteppers"), hideSteppers), _defineProperty(_cx, "".concat(prefix, "--number--").concat(size), size), _cx));
102
107
  var isInputValid = getInputValidity({
103
108
  allowEmpty: allowEmpty,
104
109
  invalid: invalid,
@@ -152,8 +157,19 @@ var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(pr
152
157
  }
153
158
  }
154
159
 
160
+ var handleFocus = function handleFocus(evt) {
161
+ if (evt.target.type === 'button') {
162
+ setIsFocused(false);
163
+ } else {
164
+ setIsFocused(evt.type === 'focus' ? true : false);
165
+ }
166
+ };
167
+
168
+ var outerElementClasses = cx("".concat(prefix, "--form-item"), (_cx4 = {}, _defineProperty(_cx4, customClassName, !!customClassName), _defineProperty(_cx4, "".concat(prefix, "--number-input--fluid--invalid"), isFluid && normalizedProps.invalid), _defineProperty(_cx4, "".concat(prefix, "--number-input--fluid--focus"), isFluid && isFocused), _defineProperty(_cx4, "".concat(prefix, "--number-input--fluid--disabled"), isFluid && disabled), _cx4));
155
169
  return /*#__PURE__*/React__default.createElement("div", {
156
- className: cx("".concat(prefix, "--form-item"), _defineProperty({}, customClassName, enabled))
170
+ className: outerElementClasses,
171
+ onFocus: isFluid ? handleFocus : null,
172
+ onBlur: isFluid ? handleFocus : null
157
173
  }, /*#__PURE__*/React__default.createElement("div", {
158
174
  className: numberInputClasses,
159
175
  "data-invalid": normalizedProps.invalid ? true : undefined
@@ -255,7 +271,9 @@ var NumberInput = /*#__PURE__*/React__default.forwardRef(function NumberInput(pr
255
271
  className: "up-icon"
256
272
  }))), /*#__PURE__*/React__default.createElement("div", {
257
273
  className: "".concat(prefix, "--number__rule-divider")
258
- }))), normalizedProps.validation ? normalizedProps.validation : /*#__PURE__*/React__default.createElement(HelperText, {
274
+ }))), isFluid && /*#__PURE__*/React__default.createElement("hr", {
275
+ className: "".concat(prefix, "--number-input__divider")
276
+ }), normalizedProps.validation ? normalizedProps.validation : /*#__PURE__*/React__default.createElement(HelperText, {
259
277
  disabled: disabled,
260
278
  description: helperText
261
279
  })));
@@ -10,4 +10,4 @@ import { createClassWrapper } from '../../internal/createClassWrapper.js';
10
10
 
11
11
  var OverflowMenu = createClassWrapper(OverflowMenu$1);
12
12
 
13
- export { OverflowMenu as default };
13
+ export { OverflowMenu, OverflowMenu as default };
@@ -5,136 +5,106 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default from 'react';
12
12
  import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
13
13
  import { match } from '../../internal/keyboard/match.js';
14
14
  import { warning } from '../../internal/warning.js';
15
- import * as FeatureFlags from '@carbon/feature-flags';
16
- import { PrefixContext } from '../../internal/usePrefix.js';
17
-
18
- var _excluded = ["href", "className", "itemText", "hasDivider", "isDelete", "disabled", "closeMenu", "onClick", "handleOverflowMenuItemFocus", "onKeyDown", "wrapperClassName", "requireTitle", "index", "title"];
19
-
20
- var OverflowMenuItem = /*#__PURE__*/function (_React$Component) {
21
- _inherits(OverflowMenuItem, _React$Component);
22
-
23
- var _super = _createSuper(OverflowMenuItem);
15
+ import { usePrefix } from '../../internal/usePrefix.js';
16
+
17
+ var _excluded = ["className", "closeMenu", "disabled", "handleOverflowMenuItemFocus", "hasDivider", "href", "isDelete", "index", "itemText", "onClick", "onKeyDown", "requireTitle", "title", "wrapperClassName"];
18
+ var OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function OverflowMenuItem(_ref, ref) {
19
+ var _cx;
20
+
21
+ var className = _ref.className,
22
+ closeMenu = _ref.closeMenu,
23
+ _ref$disabled = _ref.disabled,
24
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
25
+ handleOverflowMenuItemFocus = _ref.handleOverflowMenuItemFocus,
26
+ _ref$hasDivider = _ref.hasDivider,
27
+ hasDivider = _ref$hasDivider === void 0 ? false : _ref$hasDivider,
28
+ href = _ref.href,
29
+ _ref$isDelete = _ref.isDelete,
30
+ isDelete = _ref$isDelete === void 0 ? false : _ref$isDelete,
31
+ index = _ref.index,
32
+ _ref$itemText = _ref.itemText,
33
+ itemText = _ref$itemText === void 0 ? 'Provide itemText' : _ref$itemText,
34
+ _ref$onClick = _ref.onClick,
35
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
36
+ _ref$onKeyDown = _ref.onKeyDown,
37
+ _onKeyDown = _ref$onKeyDown === void 0 ? function () {} : _ref$onKeyDown,
38
+ requireTitle = _ref.requireTitle,
39
+ title = _ref.title,
40
+ wrapperClassName = _ref.wrapperClassName,
41
+ rest = _objectWithoutProperties(_ref, _excluded);
42
+
43
+ var prefix = usePrefix();
44
+
45
+ function setTabFocus(evt) {
46
+ if (match(evt, ArrowDown)) {
47
+ handleOverflowMenuItemFocus({
48
+ currentIndex: index,
49
+ direction: 1
50
+ });
51
+ }
24
52
 
25
- function OverflowMenuItem() {
26
- var _this;
53
+ if (match(evt, ArrowUp)) {
54
+ handleOverflowMenuItemFocus({
55
+ currentIndex: index,
56
+ direction: -1
57
+ });
58
+ }
59
+ }
27
60
 
28
- _classCallCheck(this, OverflowMenuItem);
61
+ function handleClick(evt) {
62
+ onClick(evt);
29
63
 
30
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
64
+ if (closeMenu) {
65
+ closeMenu();
32
66
  }
67
+ }
33
68
 
34
- _this = _super.call.apply(_super, [this].concat(args));
35
-
36
- _defineProperty(_assertThisInitialized(_this), "overflowMenuItem", /*#__PURE__*/React__default.createRef());
37
-
38
- _defineProperty(_assertThisInitialized(_this), "setTabFocus", function (evt) {
39
- if (match(evt, ArrowDown)) {
40
- _this.props.handleOverflowMenuItemFocus({
41
- currentIndex: _this.props.index,
42
- direction: 1
43
- });
44
- }
45
-
46
- if (match(evt, ArrowUp)) {
47
- _this.props.handleOverflowMenuItemFocus({
48
- currentIndex: _this.props.index,
49
- direction: -1
50
- });
51
- }
52
- });
53
-
54
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (evt) {
55
- var _this$props = _this.props,
56
- onClick = _this$props.onClick,
57
- closeMenu = _this$props.closeMenu;
58
- onClick(evt);
59
-
60
- if (closeMenu) {
61
- closeMenu();
62
- }
63
- });
64
-
65
- return _this;
69
+ if (process.env.NODE_ENV !== "production") {
70
+ process.env.NODE_ENV !== "production" ? warning(closeMenu, '`<OverflowMenuItem>` detected missing `closeMenu` prop. ' + '`closeMenu` is required to let `<OverflowMenu>` close the menu upon actions on `<OverflowMenuItem>`. ' + 'Please make sure `<OverflowMenuItem>` is a direct child of `<OverflowMenu>.') : void 0;
66
71
  }
67
72
 
68
- _createClass(OverflowMenuItem, [{
69
- key: "render",
70
- value: function render() {
71
- var _this2 = this;
72
-
73
- var _this$props2 = this.props,
74
- href = _this$props2.href,
75
- className = _this$props2.className,
76
- itemText = _this$props2.itemText,
77
- hasDivider = _this$props2.hasDivider,
78
- isDelete = _this$props2.isDelete,
79
- disabled = _this$props2.disabled,
80
- closeMenu = _this$props2.closeMenu;
81
- _this$props2.onClick;
82
- _this$props2.handleOverflowMenuItemFocus;
83
- var _onKeyDown = _this$props2.onKeyDown,
84
- wrapperClassName = _this$props2.wrapperClassName,
85
- requireTitle = _this$props2.requireTitle,
86
- index = _this$props2.index,
87
- title = _this$props2.title,
88
- other = _objectWithoutProperties(_this$props2, _excluded);
89
-
90
- if (process.env.NODE_ENV !== "production") {
91
- process.env.NODE_ENV !== "production" ? warning(closeMenu, '`<OverflowMenuItem>` detected missing `closeMenu` prop. ' + '`closeMenu` is required to let `<OverflowMenu>` close the menu upon actions on `<OverflowMenuItem>`. ' + 'Please make sure `<OverflowMenuItem>` is a direct child of `<OverflowMenu>.') : void 0;
92
- }
93
-
94
- return /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, function (prefix) {
95
- var _classNames;
96
-
97
- var overflowMenuBtnClasses = cx("".concat(prefix, "--overflow-menu-options__btn"), className);
98
- var overflowMenuItemClasses = cx("".concat(prefix, "--overflow-menu-options__option"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--overflow-menu--divider"), hasDivider), _defineProperty(_classNames, "".concat(prefix, "--overflow-menu-options__option--danger"), isDelete), _defineProperty(_classNames, "".concat(prefix, "--overflow-menu-options__option--disabled"), disabled), _classNames), wrapperClassName);
99
- var TagToUse = href ? 'a' : 'button';
100
-
101
- var OverflowMenuItemContent = function () {
102
- if (typeof itemText !== 'string') {
103
- return itemText;
104
- }
105
-
106
- return /*#__PURE__*/React__default.createElement("div", {
107
- className: "".concat(prefix, "--overflow-menu-options__option-content")
108
- }, itemText);
109
- }();
110
-
111
- return /*#__PURE__*/React__default.createElement("li", {
112
- className: overflowMenuItemClasses,
113
- role: "none"
114
- }, /*#__PURE__*/React__default.createElement(TagToUse, _extends({}, other, {
115
- role: "menuitem",
116
- href: href,
117
- className: overflowMenuBtnClasses,
118
- disabled: disabled,
119
- onClick: _this2.handleClick,
120
- onKeyDown: function onKeyDown(evt) {
121
- _this2.setTabFocus(evt);
122
-
123
- _onKeyDown(evt);
124
- },
125
- ref: _this2.overflowMenuItem,
126
- title: requireTitle ? title || itemText : null,
127
- tabIndex: "-1",
128
- index: index
129
- }), OverflowMenuItemContent));
130
- });
131
- }
132
- }]);
73
+ var overflowMenuBtnClasses = cx("".concat(prefix, "--overflow-menu-options__btn"), className);
74
+ var overflowMenuItemClasses = cx("".concat(prefix, "--overflow-menu-options__option"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--overflow-menu--divider"), hasDivider), _defineProperty(_cx, "".concat(prefix, "--overflow-menu-options__option--danger"), isDelete), _defineProperty(_cx, "".concat(prefix, "--overflow-menu-options__option--disabled"), disabled), _cx), wrapperClassName);
75
+ var TagToUse = href ? 'a' : 'button';
133
76
 
134
- return OverflowMenuItem;
135
- }(React__default.Component);
77
+ var OverflowMenuItemContent = function () {
78
+ if (typeof itemText !== 'string') {
79
+ return itemText;
80
+ }
136
81
 
137
- _defineProperty(OverflowMenuItem, "propTypes", {
82
+ return /*#__PURE__*/React__default.createElement("div", {
83
+ className: "".concat(prefix, "--overflow-menu-options__option-content")
84
+ }, itemText);
85
+ }();
86
+
87
+ return /*#__PURE__*/React__default.createElement("li", {
88
+ className: overflowMenuItemClasses,
89
+ role: "none"
90
+ }, /*#__PURE__*/React__default.createElement(TagToUse, _extends({
91
+ className: overflowMenuBtnClasses,
92
+ disabled: disabled,
93
+ href: href,
94
+ index: index,
95
+ onClick: handleClick,
96
+ onKeyDown: function onKeyDown(evt) {
97
+ setTabFocus(evt);
98
+
99
+ _onKeyDown(evt);
100
+ },
101
+ role: "menuitem",
102
+ ref: ref,
103
+ tabIndex: "-1",
104
+ title: requireTitle ? title || itemText : null
105
+ }, rest), OverflowMenuItemContent));
106
+ });
107
+ OverflowMenuItem.propTypes = {
138
108
  /**
139
109
  * The CSS class name to be placed on the button element
140
110
  */
@@ -199,15 +169,6 @@ _defineProperty(OverflowMenuItem, "propTypes", {
199
169
  * The CSS class name to be placed on the wrapper list item element
200
170
  */
201
171
  wrapperClassName: PropTypes.string
202
- });
203
-
204
- _defineProperty(OverflowMenuItem, "defaultProps", {
205
- hasDivider: false,
206
- isDelete: false,
207
- disabled: false,
208
- itemText: FeatureFlags.enabled('enable-v11-release') ? null : 'Provide itemText',
209
- onClick: function onClick() {},
210
- onKeyDown: function onKeyDown() {}
211
- });
172
+ };
212
173
 
213
174
  export { OverflowMenuItem as default };
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  import OverflowMenuItem from './OverflowMenuItem.js';
9
- export { default } from './OverflowMenuItem.js';
9
+ export { default as OverflowMenuItem, default } from './OverflowMenuItem.js';
@@ -45,4 +45,4 @@ PaginationSkeleton.propTypes = {
45
45
  className: PropTypes.string
46
46
  };
47
47
 
48
- export { PaginationSkeleton as default };
48
+ export { PaginationSkeleton, PaginationSkeleton as default };
@@ -10,8 +10,8 @@ import { CaretLeft, CaretRight } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import React__default, { useRef, useState } from 'react';
13
- import '../Select/Select.Skeleton.js';
14
13
  import Select from '../Select/Select.js';
14
+ import '../Select/Select.Skeleton.js';
15
15
  import SelectItem from '../SelectItem/SelectItem.js';
16
16
  import { equals } from '../../tools/array.js';
17
17
  import { useFallbackId } from '../../internal/useId.js';
@@ -10,8 +10,8 @@ import React__default from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import setupGetInstanceId from '../../../tools/setupGetInstanceId.js';
13
- import '../../Select/Select.Skeleton.js';
14
13
  import Select from '../../Select/Select.js';
14
+ import '../../Select/Select.Skeleton.js';
15
15
  import SelectItem from '../../SelectItem/SelectItem.js';
16
16
  import { usePrefix } from '../../../internal/usePrefix.js';
17
17
 
@@ -10,10 +10,10 @@ import React__default, { useState } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { CaretLeft, CaretRight } from '@carbon/icons-react';
13
- import '../../Button/Button.Skeleton.js';
14
13
  import Button from '../../Button/Button.js';
15
- import '../../Select/Select.Skeleton.js';
14
+ import '../../Button/Button.Skeleton.js';
16
15
  import Select from '../../Select/Select.js';
16
+ import '../../Select/Select.Skeleton.js';
17
17
  import SelectItem from '../../SelectItem/SelectItem.js';
18
18
  import { IconButton } from '../../IconButton/index.js';
19
19
  import * as FeatureFlags from '@carbon/feature-flags';
@@ -10,8 +10,8 @@ import PropTypes from 'prop-types';
10
10
  import React__default, { useState, useEffect, useRef } from 'react';
11
11
  import cx from 'classnames';
12
12
  import { CaretRight, CaretLeft, OverflowMenuHorizontal } from '@carbon/icons-react';
13
- import '../Button/Button.Skeleton.js';
14
13
  import Button from '../Button/Button.js';
14
+ import '../Button/Button.Skeleton.js';
15
15
  import { IconButton } from '../IconButton/index.js';
16
16
  import * as FeatureFlags from '@carbon/feature-flags';
17
17
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -7,8 +7,8 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
- import '../Button/Button.Skeleton.js';
11
10
  import Button from '../Button/Button.js';
11
+ import '../Button/Button.Skeleton.js';
12
12
 
13
13
  var PrimaryButton = function PrimaryButton(props) {
14
14
  return /*#__PURE__*/React__default.createElement(Button, _extends({
@@ -6,12 +6,13 @@
6
6
  */
7
7
 
8
8
  import { defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default from 'react';
9
+ import React__default, { useRef } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { ErrorFilled, CheckmarkFilled } from '@carbon/icons-react';
13
13
  import { useId } from '../../internal/useId.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
+ import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
15
16
 
16
17
  function ProgressBar(_ref) {
17
18
  var _classNames;
@@ -72,6 +73,14 @@ function ProgressBar(_ref) {
72
73
  });
73
74
  }
74
75
 
76
+ var ref = useRef();
77
+ useIsomorphicEffect(function () {
78
+ if (!isFinished && !isError) {
79
+ ref.current.style.transform = "scaleX(".concat(percentage, ")");
80
+ } else {
81
+ ref.current.style.transform = null;
82
+ }
83
+ }, [percentage, isFinished, isError]);
75
84
  return /*#__PURE__*/React__default.createElement("div", {
76
85
  className: wrapperClasses
77
86
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -92,9 +101,7 @@ function ProgressBar(_ref) {
92
101
  "aria-valuenow": !indeterminate ? cappedValue : null
93
102
  }, /*#__PURE__*/React__default.createElement("div", {
94
103
  className: "".concat(prefix, "--progress-bar__bar"),
95
- style: !isFinished && !isError ? {
96
- transform: "scaleX(".concat(percentage, ")")
97
- } : null
104
+ ref: ref
98
105
  })), helperText && /*#__PURE__*/React__default.createElement("div", {
99
106
  className: "".concat(prefix, "--progress-bar__helper-text")
100
107
  }, helperText, /*#__PURE__*/React__default.createElement("div", {
@@ -52,4 +52,4 @@ ProgressIndicatorSkeleton.propTypes = {
52
52
  vertical: PropTypes.bool
53
53
  };
54
54
 
55
- export { ProgressIndicatorSkeleton as default };
55
+ export { ProgressIndicatorSkeleton, ProgressIndicatorSkeleton as default };
@@ -34,4 +34,4 @@ RadioButtonSkeleton.propTypes = {
34
34
  className: PropTypes.string
35
35
  };
36
36
 
37
- export { RadioButtonSkeleton as default };
37
+ export { RadioButtonSkeleton, RadioButtonSkeleton as default };
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  import RadioButton from './RadioButton.js';
9
- export { default } from './RadioButton.js';
9
+ export { default as RadioButton, default } from './RadioButton.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2022
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 RadioTile from './RadioTile.js';
9
+ export { default as RadioTile, default } from './RadioTile.js';
@@ -46,4 +46,4 @@ SearchSkeleton.defaultProps = {
46
46
  small: false
47
47
  };
48
48
 
49
- export { SearchSkeleton as default };
49
+ export { SearchSkeleton, SearchSkeleton as default };
@@ -9,7 +9,7 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
9
9
  import { Close, Search as Search$1 } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
- import React__default, { useRef, useState } from 'react';
12
+ import React__default, { useContext, useRef, useState } from 'react';
13
13
  import { focus } from '../../internal/focus/index.js';
14
14
  import { Escape } from '../../internal/keyboard/keys.js';
15
15
  import { match } from '../../internal/keyboard/match.js';
@@ -18,6 +18,8 @@ import { usePrefix } from '../../internal/usePrefix.js';
18
18
  import { composeEventHandlers } from '../../tools/events.js';
19
19
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
20
20
  import deprecate from '../../prop-types/deprecate.js';
21
+ import '../FluidForm/FluidForm.js';
22
+ import { FormContext } from '../FluidForm/FormContext.js';
21
23
 
22
24
  var _Close;
23
25
 
@@ -54,6 +56,10 @@ var Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forwar
54
56
  rest = _objectWithoutProperties(_ref, _excluded);
55
57
 
56
58
  var prefix = usePrefix();
59
+
60
+ var _useContext = useContext(FormContext),
61
+ isFluid = _useContext.isFluid;
62
+
57
63
  var inputRef = useRef(null);
58
64
  var ref = useMergedRefs([forwardRef, inputRef]);
59
65
  var inputId = useId('search-input');
@@ -70,7 +76,7 @@ var Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forwar
70
76
  prevValue = _useState4[0],
71
77
  setPrevValue = _useState4[1];
72
78
 
73
- var searchClasses = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--search"), true), _defineProperty(_cx, "".concat(prefix, "--search--sm"), size === 'sm'), _defineProperty(_cx, "".concat(prefix, "--search--md"), size === 'md'), _defineProperty(_cx, "".concat(prefix, "--search--lg"), size === 'lg'), _defineProperty(_cx, "".concat(prefix, "--search--light"), light), _defineProperty(_cx, "".concat(prefix, "--search--disabled"), disabled), _defineProperty(_cx, className, className), _cx));
79
+ var searchClasses = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--search"), true), _defineProperty(_cx, "".concat(prefix, "--search--sm"), size === 'sm'), _defineProperty(_cx, "".concat(prefix, "--search--md"), size === 'md'), _defineProperty(_cx, "".concat(prefix, "--search--lg"), size === 'lg'), _defineProperty(_cx, "".concat(prefix, "--search--light"), light), _defineProperty(_cx, "".concat(prefix, "--search--disabled"), disabled), _defineProperty(_cx, "".concat(prefix, "--search--fluid"), isFluid), _defineProperty(_cx, className, className), _cx));
74
80
  var clearClasses = cx((_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--search-close"), true), _defineProperty(_cx2, "".concat(prefix, "--search-close--hidden"), !hasContent), _cx2));
75
81
 
76
82
  if (value !== prevValue) {
@@ -6,5 +6,5 @@
6
6
  */
7
7
 
8
8
  import Search from './Search.js';
9
- export { default } from './Search.js';
9
+ export { default as Search, default } from './Search.js';
10
10
  export { default as SearchSkeleton } from './Search.Skeleton.js';
@@ -7,8 +7,8 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
- import '../Button/Button.Skeleton.js';
11
10
  import Button from '../Button/Button.js';
11
+ import '../Button/Button.Skeleton.js';
12
12
 
13
13
  var SecondaryButton = function SecondaryButton(props) {
14
14
  return /*#__PURE__*/React__default.createElement(Button, _extends({
@@ -42,4 +42,4 @@ SelectSkeleton.propTypes = {
42
42
  hideLabel: PropTypes.bool
43
43
  };
44
44
 
45
- export { SelectSkeleton as default };
45
+ export { SelectSkeleton, SelectSkeleton as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2022
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 Select from './Select.js';
9
+ export { default as Select, default } from './Select.js';
10
+ export { default as SelectSkeleton } from './Select.Skeleton.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2022
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 SelectItem from './SelectItem.js';
9
+ export { default as SelectItem, default } from './SelectItem.js';