@ringcentral/juno 1.12.1-beta.5746-a8a4867a → 1.12.3-beta.5828-dc41552f

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 (173) hide show
  1. package/components/Buttons/Button/Button.d.ts +3 -3
  2. package/components/Buttons/Button/styles/StyledButton.js +4 -2
  3. package/components/Buttons/IconButton/IconButton.d.ts +1 -1
  4. package/components/Buttons/ToggleButton/ToggleButton.d.ts +1 -1
  5. package/components/Card/Card/Card.d.ts +2 -2
  6. package/components/Chip/Chip.d.ts +10 -3
  7. package/components/Chip/Chip.js +5 -3
  8. package/components/Chip/styles/ChipStyle.js +5 -4
  9. package/components/Chip/utils/ChipUtils.d.ts +1 -1
  10. package/components/Chip/utils/ChipUtils.js +1 -1
  11. package/components/Dialer/DialPad/index.d.ts +2 -0
  12. package/components/Dialer/DialPad/index.js +2 -0
  13. package/components/Dialer/DialTextField/DialTextField.d.ts +1 -1
  14. package/components/Dialog/Dialog.js +1 -1
  15. package/components/Downshift/Downshift.d.ts +21 -10
  16. package/components/Downshift/Downshift.js +15 -5
  17. package/components/Downshift/SuggestionList/SuggestionList.d.ts +2 -2
  18. package/components/Downshift/SuggestionList/SuggestionList.js +12 -6
  19. package/components/Downshift/SuggestionList/utils/index.d.ts +1 -0
  20. package/components/Downshift/SuggestionList/utils/index.js +1 -0
  21. package/components/Downshift/SuggestionList/utils/useSuggestionList.d.ts +298 -0
  22. package/components/Downshift/SuggestionList/utils/useSuggestionList.js +239 -0
  23. package/components/Downshift/styles/DownshiftStyle.d.ts +1 -1
  24. package/components/Downshift/styles/StyledTextField.d.ts +1 -1
  25. package/components/Downshift/utils/DownshiftUtils.d.ts +12 -0
  26. package/components/Downshift/utils/DownshiftUtils.js +19 -1
  27. package/components/Downshift/utils/SelectItem.d.ts +19 -0
  28. package/components/Downshift/utils/useDownshift.d.ts +5 -2
  29. package/components/Downshift/utils/useDownshift.interface.d.ts +5 -0
  30. package/components/Downshift/utils/useDownshift.js +31 -13
  31. package/components/Downshift/utils/useDownshiftGroup.d.ts +7 -7
  32. package/components/Downshift/utils/useDownshiftGroup.js +45 -19
  33. package/components/Forms/Checkbox/Checkbox.d.ts +1 -1
  34. package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +1 -1
  35. package/components/Forms/Picker/TimePicker/NumberPicker.js +1 -3
  36. package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +1 -1
  37. package/components/Forms/Picker/styles/StyledPickerTextField.d.ts +1 -1
  38. package/components/Forms/Radio/Radio.d.ts +1 -1
  39. package/components/Forms/Select/PlainSelect/PlainSelect.d.ts +1 -1
  40. package/components/Forms/Select/PlainSelect/PlainSelect.js +5 -4
  41. package/components/Forms/Select/PlainSelect/styles/StyledSelect.js +4 -3
  42. package/components/Forms/Select/Select.d.ts +2 -2
  43. package/components/Forms/Select/Select.js +2 -2
  44. package/components/Forms/Select/styles/StyledSelect.js +22 -18
  45. package/components/Forms/Select/utils/SelectInput/SelectInput.d.ts +1 -1
  46. package/components/Forms/TextField/TextField.d.ts +5 -3
  47. package/components/Forms/TextField/TextField.js +2 -2
  48. package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
  49. package/components/Forms/TextField/styles/OutlineTextFieldStyle.js +4 -2
  50. package/components/Forms/TextField/styles/TextFieldStyle.js +8 -4
  51. package/components/Forms/Textarea/Textarea.d.ts +1 -1
  52. package/components/Forms/Textarea/Textarea.js +8 -3
  53. package/components/Icon/assets/icon-Description.svg +5 -0
  54. package/components/Icon/assets/icon-poll.svg +5 -0
  55. package/components/Icon/assets/icon-poll_border.svg +5 -0
  56. package/components/Icon/icon-symbol.d.ts +1 -1
  57. package/components/Icon/icon-symbol.js +1 -1
  58. package/components/List/ListItem/ListItem.d.ts +1 -1
  59. package/components/Menu/MenuItem/MenuItem.d.ts +13 -5
  60. package/components/Menu/SubMenu/SubMenu.js +1 -1
  61. package/components/PopupBox/PopupBox.js +11 -3
  62. package/components/PortalHost/PortalManager/PortalManager.d.ts +2 -2
  63. package/components/PortalHost/PortalManager/PortalManager.js +9 -3
  64. package/components/PortalHost/PortalManager/types.d.ts +2 -1
  65. package/components/Snackbar/Snackbar.js +1 -1
  66. package/components/TablePagination/styles/TablePaginationStyle.d.ts +13 -5
  67. package/components/Tooltip/withTooltip/withTooltip.d.ts +6 -4
  68. package/components/Typography/Typography.d.ts +1 -1
  69. package/components/Virtuoso/react-virtuoso/Grid.d.ts +1 -1
  70. package/components/Virtuoso/react-virtuoso/List.d.ts +1 -1
  71. package/components/Virtuoso/utils/useHighlightScroll.d.ts +1 -1
  72. package/es6/components/Buttons/Button/styles/StyledButton.js +4 -2
  73. package/es6/components/Chip/Chip.js +6 -4
  74. package/es6/components/Chip/styles/ChipStyle.js +6 -5
  75. package/es6/components/Chip/utils/ChipUtils.js +1 -1
  76. package/es6/components/Dialer/DialPad/index.js +2 -0
  77. package/es6/components/Dialog/Dialog.js +2 -2
  78. package/es6/components/Downshift/Downshift.js +16 -7
  79. package/es6/components/Downshift/SuggestionList/SuggestionList.js +13 -7
  80. package/es6/components/Downshift/SuggestionList/utils/index.js +1 -0
  81. package/es6/components/Downshift/SuggestionList/utils/useSuggestionList.js +237 -0
  82. package/es6/components/Downshift/utils/DownshiftUtils.js +19 -1
  83. package/es6/components/Downshift/utils/useDownshift.js +31 -13
  84. package/es6/components/Downshift/utils/useDownshiftGroup.js +46 -20
  85. package/es6/components/Forms/Picker/TimePicker/NumberPicker.js +1 -3
  86. package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +1 -1
  87. package/es6/components/Forms/Select/PlainSelect/PlainSelect.js +5 -4
  88. package/es6/components/Forms/Select/PlainSelect/styles/StyledSelect.js +4 -3
  89. package/es6/components/Forms/Select/Select.js +2 -2
  90. package/es6/components/Forms/Select/styles/StyledSelect.js +24 -20
  91. package/es6/components/Forms/TextField/TextField.js +2 -2
  92. package/es6/components/Forms/TextField/styles/OutlineTextFieldStyle.js +5 -3
  93. package/es6/components/Forms/TextField/styles/TextFieldStyle.js +9 -5
  94. package/es6/components/Forms/Textarea/Textarea.js +8 -3
  95. package/es6/components/Icon/assets/icon-Description.svg +5 -0
  96. package/es6/components/Icon/assets/icon-poll.svg +5 -0
  97. package/es6/components/Icon/assets/icon-poll_border.svg +5 -0
  98. package/es6/components/Icon/icon-symbol.js +1 -1
  99. package/es6/components/Menu/SubMenu/SubMenu.js +1 -1
  100. package/es6/components/PopupBox/PopupBox.js +13 -5
  101. package/es6/components/PortalHost/PortalManager/PortalManager.js +9 -3
  102. package/es6/components/Snackbar/Snackbar.js +2 -2
  103. package/es6/foundation/hooks/index.js +1 -0
  104. package/es6/foundation/hooks/useAnnouncer/useAnnouncer.js +7 -0
  105. package/es6/foundation/hooks/useInterval/index.js +1 -0
  106. package/es6/foundation/hooks/useInterval/useInterval.js +86 -0
  107. package/es6/foundation/hooks/useKeyboardMoveFocus/useKeyboardMoveFocus.js +2 -1
  108. package/es6/icon/DefaultFile.js +1 -1
  109. package/es6/icon/DefaultGdrive.js +1 -1
  110. package/es6/icon/DefaultMusic.js +1 -1
  111. package/es6/icon/DefaultVideo.js +1 -1
  112. package/es6/icon/DeletedFile.js +1 -1
  113. package/es6/icon/Description.js +7 -0
  114. package/es6/icon/Doc.js +1 -1
  115. package/es6/icon/Excel.js +1 -1
  116. package/es6/icon/GifFile.js +1 -1
  117. package/es6/icon/GoogleDoc.js +1 -1
  118. package/es6/icon/GoogleSheet.js +1 -1
  119. package/es6/icon/GoogleSlide.js +1 -1
  120. package/es6/icon/ImageBroken.js +1 -1
  121. package/es6/icon/ImagePreview.js +1 -1
  122. package/es6/icon/MacKeynote.js +1 -1
  123. package/es6/icon/MacNumbers.js +1 -1
  124. package/es6/icon/MacPages.js +1 -1
  125. package/es6/icon/Pdf.js +1 -1
  126. package/es6/icon/Poll.js +7 -0
  127. package/es6/icon/PollBorder.js +7 -0
  128. package/es6/icon/Ppt.js +1 -1
  129. package/es6/icon/Zip.js +1 -1
  130. package/es6/icon/index.js +3 -0
  131. package/es6/icons/icon-Description.svg +5 -0
  132. package/es6/icons/icon-poll.svg +5 -0
  133. package/es6/icons/icon-poll_border.svg +5 -0
  134. package/foundation/hooks/index.d.ts +1 -0
  135. package/foundation/hooks/index.js +1 -0
  136. package/foundation/hooks/useAnnouncer/useAnnouncer.d.ts +7 -0
  137. package/foundation/hooks/useAnnouncer/useAnnouncer.js +7 -0
  138. package/foundation/hooks/useInterval/index.d.ts +1 -0
  139. package/foundation/hooks/useInterval/index.js +4 -0
  140. package/foundation/hooks/useInterval/useInterval.d.ts +43 -0
  141. package/foundation/hooks/useInterval/useInterval.js +88 -0
  142. package/foundation/hooks/useKeyboardMoveFocus/useKeyboardMoveFocus.js +2 -1
  143. package/icon/DefaultFile.js +1 -1
  144. package/icon/DefaultGdrive.js +1 -1
  145. package/icon/DefaultMusic.js +1 -1
  146. package/icon/DefaultVideo.js +1 -1
  147. package/icon/DeletedFile.js +1 -1
  148. package/icon/Description.d.ts +3 -0
  149. package/icon/Description.js +9 -0
  150. package/icon/Doc.js +1 -1
  151. package/icon/Excel.js +1 -1
  152. package/icon/GifFile.js +1 -1
  153. package/icon/GoogleDoc.js +1 -1
  154. package/icon/GoogleSheet.js +1 -1
  155. package/icon/GoogleSlide.js +1 -1
  156. package/icon/ImageBroken.js +1 -1
  157. package/icon/ImagePreview.js +1 -1
  158. package/icon/MacKeynote.js +1 -1
  159. package/icon/MacNumbers.js +1 -1
  160. package/icon/MacPages.js +1 -1
  161. package/icon/Pdf.js +1 -1
  162. package/icon/Poll.d.ts +3 -0
  163. package/icon/Poll.js +9 -0
  164. package/icon/PollBorder.d.ts +3 -0
  165. package/icon/PollBorder.js +9 -0
  166. package/icon/Ppt.js +1 -1
  167. package/icon/Zip.js +1 -1
  168. package/icon/index.d.ts +3 -0
  169. package/icon/index.js +6 -0
  170. package/icons/icon-Description.svg +5 -0
  171. package/icons/icon-poll.svg +5 -0
  172. package/icons/icon-poll_border.svg +5 -0
  173. package/package.json +3 -3
@@ -15,32 +15,38 @@ function stringArrToRegExp(keyToTags) {
15
15
  }
16
16
  var componentName = 'RcDownshift';
17
17
  export var useDownshift = function (_a) {
18
- var multipleProp = _a.multiple, variant = _a.variant, labelProp = _a.label, inputValueProp = _a.inputValue, _b = _a.getOptionLabel, getOptionLabel = _b === void 0 ? DEFAULT_GET_OPTION_LABEL : _b, _c = _a.keyToTags, keyToTags = _c === void 0 ? DEFAULT_KEY_TO_CHIPS : _c, filterOptions = _a.filterOptions, disabledItemsHighlightable = _a.disabledItemsHighlightable, options = _a.options, freeSolo = _a.freeSolo, onInputChangeProp = _a.onInputChange, maxFreeSolo = _a.maxFreeSolo, onMaxFreeSolo = _a.onMaxFreeSolo, openOnFocus = _a.openOnFocus, disableCloseOnSelect = _a.disableCloseOnSelect, initialIsOpen = _a.initialIsOpen, autoSelect = _a.autoSelect, inputContainerRef = _a.inputContainerRef, inputRef = _a.inputRef, wrapperRef = _a.wrapperRef, onKeyDownProp = _a.onKeyDown, onSelectChange = _a.onChange, _d = _a.value, selectedItemsProp = _d === void 0 ? [] : _d, disabled = _a.disabled, renderNoOptions = _a.renderNoOptions, onClear = _a.onClear, autoHighlight = _a.autoHighlight, getOptionDisabled = _a.getOptionDisabled, addNoOptionItem = _a.addNoOptionItem, groupBy = _a.groupBy, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, groupExpanded = _a.groupExpanded, getExpandIconProps = _a.getExpandIconProps, required = _a.required, openProp = _a.open, onOpen = _a.onOpen, onClose = _a.onClose;
18
+ var multipleProp = _a.multiple, variant = _a.variant, labelProp = _a.label, inputValueProp = _a.inputValue, _b = _a.getOptionLabel, getOptionLabel = _b === void 0 ? DEFAULT_GET_OPTION_LABEL : _b, _c = _a.keyToTags, keyToTags = _c === void 0 ? DEFAULT_KEY_TO_CHIPS : _c, filterOptions = _a.filterOptions, disabledItemsHighlightable = _a.disabledItemsHighlightable, options = _a.options, freeSolo = _a.freeSolo, onInputChangeProp = _a.onInputChange, maxFreeSolo = _a.maxFreeSolo, onMaxFreeSolo = _a.onMaxFreeSolo, openOnFocus = _a.openOnFocus, disableCloseOnSelect = _a.disableCloseOnSelect, initialIsOpen = _a.initialIsOpen, autoSelect = _a.autoSelect, inputContainerRef = _a.inputContainerRef, inputRef = _a.inputRef, wrapperRef = _a.wrapperRef, onKeyDownProp = _a.onKeyDown, onSelectChange = _a.onChange, _d = _a.value, selectedItemsProp = _d === void 0 ? [] : _d, disabled = _a.disabled, renderNoOptions = _a.renderNoOptions, onClear = _a.onClear, autoHighlight = _a.autoHighlight, getOptionDisabled = _a.getOptionDisabled, addNoOptionItem = _a.addNoOptionItem, groupBy = _a.groupBy, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, groupExpanded = _a.groupExpanded, groupDefaultExpanded = _a.groupDefaultExpanded, getExpandIconProps = _a.getExpandIconProps, required = _a.required, openProp = _a.open, onOpen = _a.onOpen, onClose = _a.onClose, focusedProp = _a.focused;
19
19
  var isAutocomplete = variant === 'autocomplete';
20
20
  // * when that is autocomplete, that will never be multiple
21
21
  var multiple = isAutocomplete ? false : multipleProp;
22
22
  var isSelectedFromAutocompleteRef = useRef(false);
23
+ var isInputValueChangedRef = useRef(false);
23
24
  var _e = __read(useControlled({
25
+ controlled: focusedProp,
26
+ default: false,
27
+ name: componentName,
28
+ }), 2), isFocused = _e[0], setIsFocused = _e[1];
29
+ var _f = __read(useControlled({
24
30
  controlled: openProp,
25
31
  default: initialIsOpen || false,
26
32
  name: componentName,
27
- }), 2), isOpen = _e[0], setIsOpen = _e[1];
28
- var _f = __read(useState(false), 2), isTagsFocus = _f[0], setIsTagsFocus = _f[1];
29
- var _g = __read(useState(0), 2), activeIndex = _g[0], setActiveIndex = _g[1];
30
- var _h = __read(useControlled({
33
+ }), 2), isOpen = _f[0], setIsOpen = _f[1];
34
+ var _g = __read(useState(false), 2), isTagsFocus = _g[0], setIsTagsFocus = _g[1];
35
+ var _h = __read(useState(0), 2), activeIndex = _h[0], setActiveIndex = _h[1];
36
+ var _j = __read(useControlled({
31
37
  controlled: inputValueProp,
32
38
  default: '',
33
39
  name: componentName,
34
- }), 2), inputValue = _h[0], setInputValue = _h[1];
40
+ }), 2), inputValue = _j[0], setInputValue = _j[1];
35
41
  var updateInputValue = function (newValue) {
36
42
  onInputChangeProp === null || onInputChangeProp === void 0 ? void 0 : onInputChangeProp(newValue);
37
43
  setInputValue(newValue);
38
44
  };
39
- var _j = __read(useControlled({
45
+ var _k = __read(useControlled({
40
46
  controlled: selectedItemsProp,
41
47
  default: [],
42
48
  name: componentName,
43
- }), 2), selectedItems = _j[0], setSelectedItems = _j[1];
49
+ }), 2), selectedItems = _k[0], setSelectedItems = _k[1];
44
50
  var focusInput = function () { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
45
51
  var downshiftId = useResultRef(function () { return uniqueId("downshift-"); }).current;
46
52
  // * use -2 for us know that is init state, for recalculate defaultHighlightedIndex
@@ -55,7 +61,7 @@ export var useDownshift = function (_a) {
55
61
  ? true
56
62
  : undefined;
57
63
  var forceUpdate = useForceUpdate();
58
- var _k = useSleep(), sleep = _k.sleep, getSleeping = _k.getSleeping;
64
+ var _l = useSleep(), sleep = _l.sleep, getSleeping = _l.getSleeping;
59
65
  var filteredResult = useMemo(function () {
60
66
  var getInputValueAsItem = function () {
61
67
  var label = inputValue.trim() || '';
@@ -74,6 +80,7 @@ export var useDownshift = function (_a) {
74
80
  if (filterOptions) {
75
81
  return filterOptions(items, {
76
82
  inputValue: inputValue,
83
+ inputChanged: isInputValueChangedRef.current,
77
84
  getOptionLabel: getOptionLabel,
78
85
  selectedItems: selectedItems,
79
86
  });
@@ -117,16 +124,19 @@ export var useDownshift = function (_a) {
117
124
  renderNoOptions,
118
125
  selectedItems,
119
126
  ]);
120
- var _l = useDownshiftGroup({
127
+ var _m = useDownshiftGroup({
121
128
  groupBy: groupBy,
122
129
  options: options,
123
130
  filteredResult: filteredResult,
124
131
  getExpandIconProps: getExpandIconProps,
125
132
  groupExpanded: groupExpanded,
133
+ groupDefaultExpanded: groupDefaultExpanded,
126
134
  onGroupExpanded: onGroupExpanded,
135
+ // TODO: single release for that breaking change
136
+ // getOptionDisabled,
127
137
  groupVariant: groupVariant,
128
138
  id: downshiftId,
129
- }), groupedResult = _l.groupedResult, handleGroupExpandedChange = _l.handleGroupExpandedChange, optionsGroupList = _l.optionsGroupList;
139
+ }), groupedResult = _m.groupedResult, handleGroupExpandedChange = _m.handleGroupExpandedChange, optionsGroupList = _m.optionsGroupList;
130
140
  var optionItems = groupBy ? groupedResult : filteredResult;
131
141
  var freeSoloCount = useMemo(function () { return selectedItems.filter(function (x) { return x.freeSolo; }).length; }, [selectedItems]);
132
142
  var handleSelectedItems = function (_selectedItems) {
@@ -168,6 +178,7 @@ export var useDownshift = function (_a) {
168
178
  });
169
179
  var closeMenu = function (e, reason) {
170
180
  keepHighlightedIndexRef.current = false;
181
+ isInputValueChangedRef.current = false;
171
182
  // * set to default highlighted
172
183
  setHighlightedIndex(DEFAULT_HIGHLIGHTED_INDEX, { reason: 'auto' });
173
184
  if (isOpen) {
@@ -318,6 +329,7 @@ export var useDownshift = function (_a) {
318
329
  updateInputValue('');
319
330
  }
320
331
  isSelectedFromAutocompleteRef.current = false;
332
+ isInputValueChangedRef.current = false;
321
333
  setActiveIndex(-1);
322
334
  if (!disableCloseOnSelect) {
323
335
  closeMenu(e, 'select-option');
@@ -342,7 +354,7 @@ export var useDownshift = function (_a) {
342
354
  event === null || event === void 0 ? void 0 : event.preventDefault();
343
355
  },
344
356
  }).onKeyFocusedIndexHandle;
345
- var _m = useKeyboardMoveFocus({
357
+ var _o = useKeyboardMoveFocus({
346
358
  options: optionItems,
347
359
  focusedIndexRef: highlightedIndexRef,
348
360
  infinite: true,
@@ -355,7 +367,7 @@ export var useDownshift = function (_a) {
355
367
  : function (child) {
356
368
  return !getIsItemCanSelected(child);
357
369
  },
358
- }), onKeyFocusedIndexHandle = _m.onKeyFocusedIndexHandle, getNextFocusableOption = _m.getNextFocusableOption;
370
+ }), onKeyFocusedIndexHandle = _o.onKeyFocusedIndexHandle, getNextFocusableOption = _o.getNextFocusableOption;
359
371
  var keepHighlightedIndex = function () {
360
372
  keepHighlightedIndexRef.current = true;
361
373
  };
@@ -530,9 +542,11 @@ export var useDownshift = function (_a) {
530
542
  handleSelectedItems([]);
531
543
  }
532
544
  fromPasteString.current = '';
545
+ isInputValueChangedRef.current = true;
533
546
  },
534
547
  onFocus: function (e) {
535
548
  var _a;
549
+ setIsFocused(true);
536
550
  if (openOnFocus)
537
551
  openMenu(e);
538
552
  // * when autocomplete mode, always select all text when focus
@@ -546,6 +560,7 @@ export var useDownshift = function (_a) {
546
560
  }
547
561
  },
548
562
  onBlur: function (e) {
563
+ setIsFocused(false);
549
564
  if (autoSelect && !stopAutoSelectRef.current) {
550
565
  if (!freeSolo)
551
566
  selectItemFn(optionItems[highlightedIndexRef.current], e);
@@ -796,6 +811,9 @@ export var useDownshift = function (_a) {
796
811
  reset: reset,
797
812
  forceUpdate: forceUpdate,
798
813
  optionsGroupList: optionsGroupList,
814
+ isFocused: isFocused,
815
+ id: downshiftId,
816
+ inputChanged: isInputValueChangedRef.current,
799
817
  };
800
818
  changeHighlightedIndexReason.current = undefined;
801
819
  return resultObj;
@@ -1,33 +1,28 @@
1
1
  import { __assign, __read, __spread } from "tslib";
2
2
  import { useMemo } from 'react';
3
- import { combineProps, logInDev, omit, useChange, useEventCallback, useRefState, } from '../../../foundation';
3
+ import { combineProps, logInDev, omit, useDepsChange, useEventCallback, useRefState, } from '../../../foundation';
4
4
  export var useDownshiftGroup = function (_a) {
5
- var groupBy = _a.groupBy, options = _a.options, filteredResult = _a.filteredResult, getExpandIconProps = _a.getExpandIconProps, groupExpanded = _a.groupExpanded, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, id = _a.id;
5
+ var groupBy = _a.groupBy, options = _a.options, filteredResult = _a.filteredResult, getExpandIconProps = _a.getExpandIconProps, groupExpanded = _a.groupExpanded, groupDefaultExpanded = _a.groupDefaultExpanded, onGroupExpanded = _a.onGroupExpanded, groupVariant = _a.groupVariant, getOptionDisabled = _a.getOptionDisabled, id = _a.id;
6
6
  var _b = __read(useRefState({}), 2), groupExpandedMapRef = _b[0], setGroupExpandedMap = _b[1];
7
7
  var isTitleGroup = groupVariant === 'normal';
8
- useChange(function () {
9
- if (typeof groupExpanded === 'object') {
10
- setGroupExpandedMap(groupExpanded, false);
11
- }
12
- }, function () { return groupExpanded; });
13
- var handleGroupExpandedChange = function (key) {
8
+ var handleGroupExpandedChange = function (groupName) {
14
9
  var _a;
15
10
  var groupExpandedMap = groupExpandedMapRef.current;
16
11
  if (typeof groupExpanded === 'boolean') {
17
12
  return;
18
13
  }
19
- var toExpandedState = !groupExpandedMap[key];
20
- var newExpandedMap = __assign(__assign({}, groupExpandedMap), (_a = {}, _a[key] = toExpandedState, _a));
14
+ var toExpandedState = !groupExpandedMap[groupName];
15
+ var newExpandedMap = __assign(__assign({}, groupExpandedMap), (_a = {}, _a[groupName] = toExpandedState, _a));
21
16
  setGroupExpandedMap(newExpandedMap);
22
17
  if (onGroupExpanded) {
23
- var group = optionsGroupList.find(function (x) { return x.group === key; });
18
+ var group = optionsGroupList.find(function (x) { return x.group === groupName; });
24
19
  if (group) {
25
20
  onGroupExpanded(__assign(__assign({}, omit(group, ['getExpandIconProps'])), { expanded: toExpandedState }), newExpandedMap);
26
21
  }
27
22
  }
28
23
  };
29
- var handleExpandIconClick = useEventCallback(function (e, key) {
30
- handleGroupExpandedChange(key);
24
+ var handleExpandIconClick = useEventCallback(function (e, groupName) {
25
+ handleGroupExpandedChange(groupName);
31
26
  e.preventDefault();
32
27
  e.stopPropagation();
33
28
  });
@@ -37,7 +32,8 @@ export var useDownshiftGroup = function (_a) {
37
32
  // used to keep track of key and indexes in the result array
38
33
  var indexBy_1 = new Map();
39
34
  var warn_1 = false;
40
- return filteredResult.reduce(function (acc, option, index) {
35
+ var afterGroupFn_1 = [];
36
+ var result = filteredResult.reduce(function (acc, option, index) {
41
37
  var group = groupBy(option);
42
38
  if (acc.length > 0 && acc[acc.length - 1].group === group) {
43
39
  acc[acc.length - 1].options.push(__assign(__assign({}, option), { group: acc[acc.length - 1] }));
@@ -76,41 +72,71 @@ export var useDownshiftGroup = function (_a) {
76
72
  };
77
73
  newGroup_1.options[0].group = newGroup_1;
78
74
  if (isTitleGroup) {
79
- newGroup_1.options.unshift({
75
+ var groupTitleOption_1 = {
80
76
  id: id + "-" + group,
81
77
  label: group,
82
78
  disabled: true,
79
+ // * here cause by self Type reference
83
80
  group: newGroup_1,
84
- });
81
+ };
82
+ // push fn to array, do that after all options be add into group
83
+ if (getOptionDisabled) {
84
+ afterGroupFn_1.push(function () {
85
+ groupTitleOption_1.disabled =
86
+ getOptionDisabled(groupTitleOption_1);
87
+ });
88
+ }
89
+ newGroup_1.options.unshift(groupTitleOption_1);
85
90
  }
86
91
  acc.push(newGroup_1);
87
92
  }
88
93
  return acc;
89
94
  }, []);
95
+ afterGroupFn_1.forEach(function (fn) {
96
+ fn();
97
+ });
98
+ return result;
90
99
  }
91
100
  return [];
92
101
  }, [
93
102
  filteredResult,
94
103
  getExpandIconProps,
104
+ getOptionDisabled,
95
105
  groupBy,
96
106
  handleExpandIconClick,
97
107
  id,
98
108
  isTitleGroup,
99
109
  options,
100
110
  ]);
111
+ var initGroupExpandedState = function (expandedState) {
112
+ if (typeof expandedState === 'object') {
113
+ setGroupExpandedMap(expandedState, false);
114
+ }
115
+ else if (typeof expandedState === 'boolean') {
116
+ setGroupExpandedMap(optionsGroupList.reduce(function (prev, curr) {
117
+ prev[curr.group] = expandedState;
118
+ return prev;
119
+ }, {}), false);
120
+ }
121
+ };
122
+ useDepsChange(function () {
123
+ initGroupExpandedState(groupDefaultExpanded);
124
+ }, []);
125
+ useDepsChange(function () {
126
+ initGroupExpandedState(groupExpanded);
127
+ }, [groupExpanded]);
101
128
  var groupExpandedMap = groupExpandedMapRef.current;
102
129
  // * speared logic with group, prevent calculate every time.
103
130
  var groupedResult = useMemo(function () {
104
131
  var addExpandedResult = Object.entries(groupExpandedMap).reduce(function (prev, _a) {
105
132
  var _b = __read(_a, 2), key = _b[0], expended = _b[1];
106
133
  var group = prev.find(function (x) { return x.group === key; });
107
- if (group) {
134
+ if (group)
108
135
  group.expanded = expended;
109
- }
110
136
  return prev;
111
137
  }, __spread(optionsGroupList));
112
138
  return addExpandedResult.reduce(function (prev, curr) {
113
- if (typeof groupExpanded === 'boolean' ? groupExpanded : curr.expanded) {
139
+ if (curr.expanded) {
114
140
  prev.push.apply(prev, __spread(curr.options));
115
141
  }
116
142
  else {
@@ -118,7 +144,7 @@ export var useDownshiftGroup = function (_a) {
118
144
  }
119
145
  return prev;
120
146
  }, []);
121
- }, [groupExpandedMap, optionsGroupList, groupExpanded]);
147
+ }, [groupExpandedMap, optionsGroupList]);
122
148
  return {
123
149
  optionsGroupList: optionsGroupList,
124
150
  groupedResult: groupedResult,
@@ -105,9 +105,7 @@ var _NumberPicker = forwardRef(function (props, ref) {
105
105
  React.createElement(StyledTimeIconButton, { tabIndex: -1, size: iconSize, color: "neutral.f04", wrapperSize: size, disabled: increaseDisabled, onClick: function () {
106
106
  onUpdateValue(increaseValue);
107
107
  }, symbol: ArrowUpIcon, "data-test-automation-id": automationId && automationId + "-prev-pagination", "aria-label": "Arrow Up" }),
108
- React.createElement(StyledTimeIconButton, { wrapperSize: size, tabIndex: -1, onClick: onClick,
109
- // * when both disabled that icon can't click into selection view
110
- disabled: increaseDisabled && decreaseDisabled, "data-test-automation-id": automationId && automationId + "-text" },
108
+ React.createElement(StyledTimeIconButton, { wrapperSize: size, tabIndex: -1, onClick: onClick, "data-test-automation-id": automationId && automationId + "-text" },
111
109
  React.createElement(React.Fragment, null,
112
110
  // TODO: that <></> will fix when `RcIconButton` ready
113
111
  showValue)),
@@ -59,7 +59,7 @@ var getHourAndMinute = function (times) {
59
59
  var hour = (times - minute) / ONE_HOUR;
60
60
  return {
61
61
  hour: hour,
62
- minute: minute / ONE_MINUTE,
62
+ minute: Math.floor(minute / ONE_MINUTE),
63
63
  };
64
64
  };
65
65
  var timestampToDate = function (times) {
@@ -17,9 +17,9 @@ var plainAnchorOrigin = {
17
17
  vertical: 'bottom',
18
18
  };
19
19
  var _RcPlainSelect = forwardRef(function (_a, ref) {
20
- var children = _a.children, className = _a.className, classes = _a.classes, value = _a.value, renderValue = _a.renderValue, variant = _a.variant, ButtonProps = _a.ButtonProps, innerRef = _a.innerRef, SelectInputProps = _a.SelectInputProps, InputProps = _a.InputProps, disabled = _a.disabled, autoFocus = _a.autoFocus, size = _a.size, virtualize = _a.virtualize, fullWidth = _a.fullWidth,
20
+ var children = _a.children, className = _a.className, classes = _a.classes, value = _a.value, renderValue = _a.renderValue, variant = _a.variant, ButtonProps = _a.ButtonProps, innerRef = _a.innerRef, SelectInputProps = _a.SelectInputProps, InputProps = _a.InputProps, disabled = _a.disabled, autoFocus = _a.autoFocus, size = _a.size, virtualize = _a.virtualize, fullWidth = _a.fullWidth, color = _a.color,
21
21
  //
22
- IconComponent = _a.IconComponent, onOpenProp = _a.onOpen, onCloseProp = _a.onClose, rest = __rest(_a, ["children", "className", "classes", "value", "renderValue", "variant", "ButtonProps", "innerRef", "SelectInputProps", "InputProps", "disabled", "autoFocus", "size", "virtualize", "fullWidth", "IconComponent", "onOpen", "onClose"]);
22
+ IconComponent = _a.IconComponent, onOpenProp = _a.onOpen, onCloseProp = _a.onClose, rest = __rest(_a, ["children", "className", "classes", "value", "renderValue", "variant", "ButtonProps", "innerRef", "SelectInputProps", "InputProps", "disabled", "autoFocus", "size", "virtualize", "fullWidth", "color", "IconComponent", "onOpen", "onClose"]);
23
23
  var _b = __read(useState(false), 2), open = _b[0], setOpen = _b[1];
24
24
  var display = useMemo(function () {
25
25
  var item = children.find(function (child) {
@@ -29,7 +29,7 @@ var _RcPlainSelect = forwardRef(function (_a, ref) {
29
29
  }, [children, value]);
30
30
  var _renderValue = useCallback(function (value) {
31
31
  var _variant = switchVariantToButtonVariant(variant);
32
- return (React.createElement(RcButton, __assign({ ref: ref, innerRef: innerRef, disabled: disabled, size: size, fullWidth: fullWidth, autoFocus: autoFocus, variant: _variant, "aria-label": "open menu", "aria-haspopup": "listbox" }, combineProps(defaultButtonProps, ButtonProps)),
32
+ return (React.createElement(RcButton, __assign({ ref: ref, innerRef: innerRef, disabled: disabled, size: size, color: color, fullWidth: fullWidth, autoFocus: autoFocus, variant: _variant, "aria-label": "open menu", "aria-haspopup": "listbox" }, combineProps(defaultButtonProps, ButtonProps)),
33
33
  renderValue ? renderValue(value) : display,
34
34
  (IconComponent && React.createElement(IconComponent, { open: open })) || (React.createElement(SelectArrowDownIcon
35
35
  // * reset default color
@@ -42,6 +42,7 @@ var _RcPlainSelect = forwardRef(function (_a, ref) {
42
42
  ButtonProps,
43
43
  IconComponent,
44
44
  autoFocus,
45
+ color,
45
46
  disabled,
46
47
  display,
47
48
  fullWidth,
@@ -81,7 +82,7 @@ var _RcPlainSelect = forwardRef(function (_a, ref) {
81
82
  }, onClose: function (e) {
82
83
  setOpen(false);
83
84
  onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp(e);
84
- }, SelectInputProps: _SelectInputProps, InputProps: _InputProps, renderValue: _renderValue, fullWidth: fullWidth }, rest), children));
85
+ }, SelectInputProps: _SelectInputProps, InputProps: _InputProps, renderValue: _renderValue, fullWidth: fullWidth, color: color }, rest), children));
85
86
  });
86
87
  /** @release */
87
88
  var RcPlainSelect = styled(_RcPlainSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), plainSelectStyle);
@@ -11,9 +11,10 @@ export var plainSelectStyle = function (_a) {
11
11
  var variant = _a.variant, disabled = _a.disabled;
12
12
  var isText = variant === 'text';
13
13
  var isRound = roundVariant.includes(variant);
14
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: auto;\n\n ", " {\n ", " {\n margin-right: 0;\n }\n }\n\n ", " {\n margin-right: 0;\n }\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n width: auto;\n pointer-events: none;\n }\n\n .", " {\n padding: 0;\n height: auto;\n }\n\n ", " {\n pointer-events: ", ";\n min-width: unset;\n padding-left: ", ";\n padding-right: ", ";\n border-radius: ", ";\n\n ", " {\n margin: ", ";\n }\n\n ", "\n }\n "], ["\n width: auto;\n\n ",
15
+ " {\n ", " {\n margin-right: 0;\n }\n }\n\n ", " {\n margin-right: 0;\n }\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n width: auto;\n pointer-events: none;\n }\n\n .", " {\n padding: 0;\n height: auto;\n }\n\n ", " {\n pointer-events: ", ";\n min-width: unset;\n padding-left: ", ";\n padding-right: ", ";\n border-radius: ", ";\n\n ", " {\n margin: ", ";\n }\n\n ",
16
+ "\n }\n "])), RcButton /**
14
17
  // TODO: cancel button bellow icon margin issue,
15
- // TODO: wait RCUI-234 merge below overwrite can be remove
16
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", " {\n ", " {\n margin-right: 0;\n }\n }\n\n ", " {\n margin-right: 0;\n }\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n width: auto;\n pointer-events: none;\n }\n\n .", " {\n padding: 0;\n height: auto;\n }\n\n ", " {\n pointer-events: ", ";\n min-width: unset;\n padding-left: ", ";\n padding-right: ", ";\n border-radius: ", ";\n\n ", " {\n margin: ", ";\n }\n\n ", "\n }\n "], ["\n ", " {\n ", " {\n margin-right: 0;\n }\n }\n\n ", " {\n margin-right: 0;\n }\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n width: auto;\n pointer-events: none;\n }\n\n .", " {\n padding: 0;\n height: auto;\n }\n\n ", " {\n pointer-events: ", ";\n min-width: unset;\n padding-left: ", ";\n padding-right: ", ";\n border-radius: ", ";\n\n ", " {\n margin: ", ";\n }\n\n ",
17
- "\n }\n "])), RcButton, RcIcon, RcListItemText, RcTextFieldClasses.root, RcPlainSelectInputClasses.root, RcPlainSelectInputClasses.input, RcButton, !disabled && 'auto', spacing(isText ? 4 : 1), spacing(isText ? 1 : 0), isRound && radius('xxl'), SelectArrowDownIcon, spacing(0, 0, 0, isRound ? 0 : 1), isRound && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n\n ", ", &.Mui-focusVisible {\n .", " {\n background-color: currentColor;\n opacity: ", ";\n }\n .", " {\n display: none;\n }\n }\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n\n ", ", &.Mui-focusVisible {\n .", " {\n background-color: currentColor;\n opacity: ", ";\n }\n .", " {\n display: none;\n }\n }\n "])), spacing(1.5), spacing(1.5), focusVisible, RcPlainSelectTouchRippleClasses.root, opacity('32'), RcPlainSelectTouchRippleClasses.child));
18
+ */, RcIcon, RcListItemText, RcTextFieldClasses.root, RcPlainSelectInputClasses.root, RcPlainSelectInputClasses.input, RcButton, !disabled && 'auto', spacing(isText ? 4 : 1), spacing(isText ? 1 : 0), isRound && radius('xxl'), SelectArrowDownIcon, spacing(0, 0, 0, isRound ? 0 : 1), isRound && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n\n ", ", &.Mui-focusVisible {\n .", " {\n background-color: currentColor;\n opacity: ", ";\n }\n .", " {\n display: none;\n }\n }\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n\n ", ", &.Mui-focusVisible {\n .", " {\n background-color: currentColor;\n opacity: ", ";\n }\n .", " {\n display: none;\n }\n }\n "])), spacing(1.5), spacing(1.5), focusVisible, RcPlainSelectTouchRippleClasses.root, opacity('32'), RcPlainSelectTouchRippleClasses.child));
18
19
  };
19
20
  var templateObject_1, templateObject_2;
@@ -14,7 +14,7 @@ var _RcSelect = forwardRef(function (inProps, ref) {
14
14
  var props = useThemeProps({ props: inProps, name: 'RcSelect' });
15
15
  var children = props.children, onChange = props.onChange, SelectInputPropsProp = props.SelectInputProps, textVariant = props.textVariant, placeholder = props.placeholder, renderValue = props.renderValue, displayEmpty = props.displayEmpty, variant = props.variant, size = props.size, value = props.value, virtualize = props.virtualize,
16
16
  // * below is should pick into TextField props
17
- focused = props.focused, gutterBottom = props.gutterBottom, helperText = props.helperText, label = props.label, id = props.id, className = props.className, validate = props.validate, InputProps = props.InputProps, required = props.required, fullWidth = props.fullWidth, disabled = props.disabled, error = props.error, rest = __rest(props, ["children", "onChange", "SelectInputProps", "textVariant", "placeholder", "renderValue", "displayEmpty", "variant", "size", "value", "virtualize", "focused", "gutterBottom", "helperText", "label", "id", "className", "validate", "InputProps", "required", "fullWidth", "disabled", "error"]);
17
+ focused = props.focused, gutterBottom = props.gutterBottom, helperText = props.helperText, color = props.color, label = props.label, id = props.id, className = props.className, validate = props.validate, InputProps = props.InputProps, required = props.required, fullWidth = props.fullWidth, disabled = props.disabled, error = props.error, rest = __rest(props, ["children", "onChange", "SelectInputProps", "textVariant", "placeholder", "renderValue", "displayEmpty", "variant", "size", "value", "virtualize", "focused", "gutterBottom", "helperText", "color", "label", "id", "className", "validate", "InputProps", "required", "fullWidth", "disabled", "error"]);
18
18
  var nonValue = value === undefined ||
19
19
  value === null ||
20
20
  // * if that can't displayEmpty, and that value === '', same as no value
@@ -62,7 +62,7 @@ var _RcSelect = forwardRef(function (inProps, ref) {
62
62
  var valueIsNumber = typeof value === 'number';
63
63
  return (React.createElement(RcSelectTextField, { ref: ref, id: id, className: className,
64
64
  // for when that is select type that type will be select onChange, just any for ignore that
65
- onChange: onChange, select: true, focused: focused, gutterBottom: gutterBottom, helperText: helperText, label: label, value: valueIsNumber ? value : value || '', validate: validate, required: required, fullWidth: fullWidth, disabled: disabled, error: error, InputProps: _InputProps, clearBtn: false, placeholder: placeholder, SelectProps: _SelectProps }, children));
65
+ onChange: onChange, color: color, select: true, focused: focused, gutterBottom: gutterBottom, helperText: helperText, label: label, value: valueIsNumber ? value : value || '', validate: validate, required: required, fullWidth: fullWidth, disabled: disabled, error: error, InputProps: _InputProps, clearBtn: false, placeholder: placeholder, SelectProps: _SelectProps }, children));
66
66
  });
67
67
  var RcSelect = styled(_RcSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), selectStyle);
68
68
  RcSelect.displayName = 'RcSelect';
@@ -1,5 +1,5 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import { css, fakeBorder, palette2, px, radius, setOpacity, spacing, typography, } from '../../../../foundation';
1
+ import { __assign, __makeTemplateObject } from "tslib";
2
+ import { css, fakeBorder, getParsePaletteColor, palette2, px, radius, setOpacity, spacing, typography, } from '../../../../foundation';
3
3
  import { disabledColor, placeholderColor } from '../../TextField/styles';
4
4
  import { RcBoxSelectInputClasses, RcBoxSelectInputHeights, RcLineSelectInputClasses, RcSelectClasses, RcSelectInputClasses, RcSelectInputWhenPlaceholderClasses, } from '../utils';
5
5
  var boxBackgroundColor = palette2('neutral', 'b03');
@@ -8,23 +8,27 @@ var lineSelectStyle = css(templateObject_1 || (templateObject_1 = __makeTemplate
8
8
  var textVariant = _a.textVariant;
9
9
  return typography(textVariant || 'subheading1');
10
10
  }, setOpacity(palette2('action', 'grayDark'), '08'));
11
- var boxSelectStyle = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n > .", " {\n margin-top: ", ";\n box-sizing: border-box;\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n\n &:not(.", "):hover {\n background-color: ", ";\n }\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:after {\n display: none;\n }\n }\n\n > .", " {\n background-color: ", ";\n\n &:before {\n ", ";\n }\n }\n\n > .", " {\n &:before {\n ", ";\n }\n }\n\n > .", " {\n background-color: ", ";\n &:before {\n ", ";\n }\n }\n\n .", " {\n padding: ", ";\n ", ";\n line-height: ", ";\n\n &:focus {\n background: transparent;\n }\n }\n"], ["\n > .", " {\n margin-top: ", ";\n box-sizing: border-box;\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n\n &:not(.", "):hover {\n background-color: ", ";\n }\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:after {\n display: none;\n }\n }\n\n > .", " {\n background-color: ", ";\n\n &:before {\n ", ";\n }\n }\n\n > .", " {\n &:before {\n ", ";\n }\n }\n\n > .", " {\n background-color: ", ";\n &:before {\n ", ";\n }\n }\n\n .", " {\n padding: ", ";\n ", ";\n line-height: ",
12
- ";\n\n &:focus {\n background: transparent;\n }\n }\n"])), RcBoxSelectInputClasses.root, function (_a) {
13
- var label = _a.label;
14
- return label && spacing(5);
15
- }, function (_a) {
16
- var size = _a.size;
17
- return px(RcBoxSelectInputHeights[size]);
18
- }, radius('lg'), boxBackgroundColor, RcBoxSelectInputClasses.disabled, setOpacity(boxActionBackgroundColor, '12'), radius('lg'), fakeBorder({ color: palette2('highContrast') }), RcBoxSelectInputClasses.focused, setOpacity(boxActionBackgroundColor, '16'), fakeBorder({ color: palette2('interactive', 'f01') }), RcBoxSelectInputClasses.error, fakeBorder({ color: palette2('danger', 'f02') }), RcBoxSelectInputClasses.disabled, setOpacity(palette2('action', 'grayLight'), '12'), fakeBorder({ color: 'transparent', allowTransparent: true }), RcBoxSelectInputClasses.input, spacing(1.5, 6, 1.5, 2), function (_a) {
19
- var textVariant = _a.textVariant;
20
- return typography(textVariant || 'body1');
21
- }, function (_a) {
22
- var size = _a.size;
23
- // here -12 for make this input height same as container
24
- return px(RcBoxSelectInputHeights[size] - 12);
25
- });
26
- export var selectStyle = function (_a) {
27
- var variant = _a.variant, placeholder = _a.placeholder;
28
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n &:before {\n content: ", ";\n border: none;\n }\n }\n\n .", " {\n color: ", ";\n .", " {\n color: ", ";\n }\n }\n\n ", ";\n ", ";\n"], ["\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n &:before {\n content: ", ";\n border: none;\n }\n }\n\n .", " {\n color: ", ";\n .", " {\n color: ", ";\n }\n }\n\n ", ";\n ", ";\n"])), RcSelectClasses.icon, palette2('neutral', 'f04'), RcSelectInputClasses.focused, RcSelectClasses.icon, palette2('interactive', 'f01'), RcSelectInputClasses.error, RcSelectClasses.icon, palette2('danger', 'f02'), RcSelectInputWhenPlaceholderClasses.input, placeholderColor, "'" + placeholder + "'", RcSelectInputClasses.disabled, disabledColor, RcSelectClasses.icon, disabledColor, variant === 'line' && lineSelectStyle, variant === 'box' && boxSelectStyle);
11
+ var boxSelectStyle = function (_a) {
12
+ var color = _a.color;
13
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n > .", " {\n margin-top: ", ";\n box-sizing: border-box;\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n\n &:not(.", "):hover {\n background-color: ", ";\n }\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:after {\n display: none;\n }\n }\n\n > .", " {\n background-color: ", ";\n\n &:before {\n ", ";\n }\n }\n\n > .", " {\n &:before {\n ", ";\n }\n }\n\n > .", " {\n background-color: ", ";\n &:before {\n ", ";\n }\n }\n\n .", " {\n padding: ", ";\n ", ";\n line-height: ", ";\n\n &:focus {\n background: transparent;\n }\n }\n"], ["\n > .", " {\n margin-top: ", ";\n box-sizing: border-box;\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n\n &:not(.", "):hover {\n background-color: ", ";\n }\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:after {\n display: none;\n }\n }\n\n > .", " {\n background-color: ", ";\n\n &:before {\n ", ";\n }\n }\n\n > .", " {\n &:before {\n ", ";\n }\n }\n\n > .", " {\n background-color: ", ";\n &:before {\n ", ";\n }\n }\n\n .", " {\n padding: ", ";\n ", ";\n line-height: ",
14
+ ";\n\n &:focus {\n background: transparent;\n }\n }\n"])), RcBoxSelectInputClasses.root, function (_a) {
15
+ var label = _a.label;
16
+ return label && spacing(5);
17
+ }, function (_a) {
18
+ var size = _a.size;
19
+ return px(RcBoxSelectInputHeights[size]);
20
+ }, radius('lg'), boxBackgroundColor, RcBoxSelectInputClasses.disabled, setOpacity(boxActionBackgroundColor, '12'), radius('lg'), fakeBorder({ color: palette2('highContrast') }), RcBoxSelectInputClasses.focused, setOpacity(boxActionBackgroundColor, '16'), fakeBorder({ color: color }), RcBoxSelectInputClasses.error, fakeBorder({ color: palette2('danger', 'f02') }), RcBoxSelectInputClasses.disabled, setOpacity(palette2('action', 'grayLight'), '12'), fakeBorder({ color: 'transparent', allowTransparent: true }), RcBoxSelectInputClasses.input, spacing(1.5, 6, 1.5, 2), function (_a) {
21
+ var textVariant = _a.textVariant;
22
+ return typography(textVariant || 'body1');
23
+ }, function (_a) {
24
+ var size = _a.size;
25
+ // here -12 for make this input height same as container
26
+ return px(RcBoxSelectInputHeights[size] - 12);
27
+ });
28
+ };
29
+ export var selectStyle = function (props) {
30
+ var variant = props.variant, placeholder = props.placeholder, colorProp = props.color;
31
+ var color = getParsePaletteColor(colorProp, palette2('interactive', 'f01'));
32
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n &:before {\n content: ", ";\n border: none;\n }\n }\n\n .", " {\n color: ", ";\n .", " {\n color: ", ";\n }\n }\n\n ", ";\n ", ";\n "], ["\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n .", " {\n color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n &:before {\n content: ", ";\n border: none;\n }\n }\n\n .", " {\n color: ", ";\n .", " {\n color: ", ";\n }\n }\n\n ", ";\n ", ";\n "])), RcSelectClasses.icon, palette2('neutral', 'f04'), RcSelectInputClasses.focused, RcSelectClasses.icon, color, RcSelectInputClasses.error, RcSelectClasses.icon, palette2('danger', 'f02'), RcSelectInputWhenPlaceholderClasses.input, placeholderColor, "'" + placeholder + "'", RcSelectInputClasses.disabled, disabledColor, RcSelectClasses.icon, disabledColor, variant === 'line' && lineSelectStyle, variant === 'box' && boxSelectStyle(__assign(__assign({}, props), { color: color })));
29
33
  };
30
34
  var templateObject_1, templateObject_2, templateObject_3;
@@ -15,9 +15,9 @@ var _RcTextField = forwardRef(function (inProps, ref) {
15
15
  // TODO: remove when remove focusOnMount
16
16
  autoFocusProp = _a === void 0 ? focusOnMount : _a, InputPropsProp = props.InputProps, error = props.error, helperText = props.helperText, defaultValue = props.defaultValue, inputRefProp = props.inputRef, _b = props.autoSelect, autoSelect = _b === void 0 ? selectOnMount : _b, autoFocusDelay = props.autoFocusDelay, clearLabel = props.clearLabel, clearButtonProps = props.clearButtonProps, clearBtn = props.clearBtn, validate = props.validate, onChange = props.onChange, onBlur = props.onBlur, onFocus = props.onFocus, onClear = props.onClear, id = props.id,
17
17
  // #region outline pick props
18
- variant = props.variant, radius = props.radius, size = props.size, align = props.align, textVariant = props.textVariant, gutterBottom = props.gutterBottom,
18
+ variant = props.variant, radius = props.radius, size = props.size, align = props.align, textVariant = props.textVariant, gutterBottom = props.gutterBottom, color = props.color,
19
19
  // #endregion
20
- rest = __rest(props, ["classes", "InputLabelProps", "FormHelperTextProps", "value", "focusOnMount", "selectOnMount", "clearAriaLabel", "autoFocus", "InputProps", "error", "helperText", "defaultValue", "inputRef", "autoSelect", "autoFocusDelay", "clearLabel", "clearButtonProps", "clearBtn", "validate", "onChange", "onBlur", "onFocus", "onClear", "id", "variant", "radius", "size", "align", "textVariant", "gutterBottom"]);
20
+ rest = __rest(props, ["classes", "InputLabelProps", "FormHelperTextProps", "value", "focusOnMount", "selectOnMount", "clearAriaLabel", "autoFocus", "InputProps", "error", "helperText", "defaultValue", "inputRef", "autoSelect", "autoFocusDelay", "clearLabel", "clearButtonProps", "clearBtn", "validate", "onChange", "onBlur", "onFocus", "onClear", "id", "variant", "radius", "size", "align", "textVariant", "gutterBottom", "color"]);
21
21
  var formContext = useRcFormContext();
22
22
  var innerRef = useRef();
23
23
  var inputRef = useForkRef(inputRefProp, innerRef);
@@ -1,14 +1,16 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
- import { css, fakeBorder, palette2, px, radius as radiusFn, spacing, typography, } from '../../../../foundation';
2
+ import { css, fakeBorder, getParsePaletteColor, palette2, px, radius as radiusFn, spacing, typography, } from '../../../../foundation';
3
3
  import { belowIconButtonSpacing, RcOutlineTextFieldFontStyles, RcOutlineTextFieldHeights, RcOutlineTextFieldInputClasses, RcOutlineTextFieldLabelMargins, RcOutlineTextFieldSpaces, RcTextFieldClasses, } from '../utils';
4
4
  export var OutlineTextFieldStyle = function (_a) {
5
- var radius = _a.radius, size = _a.size;
5
+ var radius = _a.radius, size = _a.size, colorProp = _a.color;
6
6
  var height = px(RcOutlineTextFieldHeights[size]);
7
7
  var _b = RcOutlineTextFieldSpaces[size], inside = _b.inside, outside = _b.outside, insideLeft = _b.insideLeft;
8
8
  var labelMargin = RcOutlineTextFieldLabelMargins[size];
9
9
  var typographyToken = RcOutlineTextFieldFontStyles[size];
10
10
  var currRadius = radiusFn(radius);
11
+ var borderColor = getParsePaletteColor(colorProp, palette2('neutral', 'l03'));
12
+ var focusBorderColor = getParsePaletteColor(colorProp, palette2('interactive', 'f01'));
11
13
  // `-webkit-tap-highlight-color` for cover background color, prevent color be cover by browser
12
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n ", ";\n }\n\n ", ";\n\n * + .", " {\n margin-left: ", ";\n }\n\n &.", " {\n label + .", " {\n margin-top: ", ";\n }\n }\n\n .", " {\n -webkit-tap-highlight-color: transparent;\n height: ", ";\n min-height: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:not(.", "):not(.", "):hover {\n background: ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n background: ", ";\n &:before {\n ", ";\n }\n }\n "], ["\n .", " {\n ", ";\n }\n\n ", ";\n\n * + .", " {\n margin-left: ", ";\n }\n\n &.", " {\n label + .", " {\n margin-top: ", ";\n }\n }\n\n .", " {\n -webkit-tap-highlight-color: transparent;\n height: ", ";\n min-height: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:not(.", "):not(.", "):hover {\n background: ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n background: ", ";\n &:before {\n ", ";\n }\n }\n "])), RcOutlineTextFieldInputClasses.input, typography(typographyToken), belowIconButtonSpacing(spacing(inside)), RcOutlineTextFieldInputClasses.input, spacing(insideLeft || inside), RcTextFieldClasses.root, RcOutlineTextFieldInputClasses.root, spacing(labelMargin), RcOutlineTextFieldInputClasses.root, height, height, palette2('neutral', 'b01'), spacing(outside), currRadius, currRadius, fakeBorder({ color: palette2('neutral', 'l03') }), RcOutlineTextFieldInputClasses.focused, RcOutlineTextFieldInputClasses.disabled, palette2('neutral', 'b02'), RcOutlineTextFieldInputClasses.focused, fakeBorder({ color: palette2('interactive', 'f01') }), RcOutlineTextFieldInputClasses.error, fakeBorder({ color: palette2('danger', 'f02') }), RcOutlineTextFieldInputClasses.disabled, palette2('neutral', 'b03'), fakeBorder({ color: palette2('disabled', 'f02') }));
14
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n ", ";\n }\n\n ", ";\n\n * + .", " {\n margin-left: ", ";\n }\n\n &.", " {\n label + .", " {\n margin-top: ", ";\n }\n }\n\n .", " {\n -webkit-tap-highlight-color: transparent;\n height: ", ";\n min-height: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:not(.", "):not(.", "):hover {\n background: ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n background: ", ";\n &:before {\n ", ";\n }\n }\n "], ["\n .", " {\n ", ";\n }\n\n ", ";\n\n * + .", " {\n margin-left: ", ";\n }\n\n &.", " {\n label + .", " {\n margin-top: ", ";\n }\n }\n\n .", " {\n -webkit-tap-highlight-color: transparent;\n height: ", ";\n min-height: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: ", ";\n transition: none;\n border-bottom: none !important;\n pointer-events: none;\n ", ";\n }\n\n &:not(.", "):not(.", "):hover {\n background: ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n &:before {\n ", ";\n }\n }\n\n .", " {\n background: ", ";\n &:before {\n ", ";\n }\n }\n "])), RcOutlineTextFieldInputClasses.input, typography(typographyToken), belowIconButtonSpacing(spacing(inside)), RcOutlineTextFieldInputClasses.input, spacing(insideLeft || inside), RcTextFieldClasses.root, RcOutlineTextFieldInputClasses.root, spacing(labelMargin), RcOutlineTextFieldInputClasses.root, height, height, palette2('neutral', 'b01'), spacing(outside), currRadius, currRadius, fakeBorder({ color: borderColor }), RcOutlineTextFieldInputClasses.focused, RcOutlineTextFieldInputClasses.disabled, palette2('neutral', 'b02'), RcOutlineTextFieldInputClasses.focused, fakeBorder({ color: focusBorderColor }), RcOutlineTextFieldInputClasses.error, fakeBorder({ color: palette2('danger', 'f02') }), RcOutlineTextFieldInputClasses.disabled, palette2('neutral', 'b03'), fakeBorder({ color: palette2('disabled', 'f02') }));
13
15
  };
14
16
  var templateObject_1;
@@ -1,5 +1,5 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
- import { css, isFilled, nonTouchHoverMedia, palette2, px, spacing, typography, } from '../../../../foundation';
2
+ import { css, getParsePaletteColor, isFilled, nonTouchHoverMedia, palette2, px, spacing, typography, } from '../../../../foundation';
3
3
  import { RcIconButtonSizes } from '../../../Buttons/IconButton/utils';
4
4
  import { belowIconButtonSpacing, RcTextFieldClasses, RcTextFieldFormHelperTextClasses, RcTextFieldInputClasses, RcTextFieldInputLabelClasses, } from '../utils';
5
5
  import { ClearIconButton } from './ClearIconButton';
@@ -14,13 +14,17 @@ export var RcDefaultTextFieldWidth = '168px';
14
14
  var focusWithNotDisabled = "." + RcTextFieldInputClasses.root + ":hover:not(." + RcTextFieldInputClasses.disabled + ")";
15
15
  var TextFieldInputHoverFocusStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n display: inline-flex;\n }\n"], ["\n ", " {\n display: inline-flex;\n }\n"])), ClearIconButton);
16
16
  export var clearBtnInactiveStyle = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", " {\n ", " {\n ", "\n }\n }\n\n .", " {\n ", "\n }\n"], ["\n ", " {\n ", " {\n ", "\n }\n }\n\n .", " {\n ", "\n }\n"])), nonTouchHoverMedia, focusWithNotDisabled, TextFieldInputHoverFocusStyle, RcTextFieldInputClasses.focused, TextFieldInputHoverFocusStyle);
17
- export var TextFieldStyle = function (_a) {
18
- var value = _a.value, variant = _a.variant, fullWidth = _a.fullWidth, clearBtn = _a.clearBtn, size = _a.size, textVariant = _a.textVariant, gutterBottom = _a.gutterBottom, align = _a.align;
17
+ export var TextFieldStyle = function (props) {
18
+ var value = props.value, variant = props.variant, fullWidth = props.fullWidth, clearBtn = props.clearBtn, size = props.size, textVariant = props.textVariant, gutterBottom = props.gutterBottom, align = props.align, colorProp = props.color;
19
19
  var showClean = isFilled({ value: value });
20
+ var color = getParsePaletteColor(colorProp, palette2('interactive', 'f01'));
21
+ var labelRootColor = getParsePaletteColor(colorProp, idleColor);
22
+ var underlineColor = getParsePaletteColor(colorProp, palette2('neutral', 'f02'));
23
+ var underlineFocusColor = getParsePaletteColor(colorProp, palette2('neutral', 'f06'));
20
24
  return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n\n width: ", ";\n\n ", ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ", ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "], ["\n ", ";\n\n width: ", ";\n\n ",
21
25
  ";\n\n .", " {\n ", ";\n color: ", ";\n transform: scale(1);\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n color: ", ";\n\n ", " {\n display: none;\n }\n }\n\n ", ";\n\n .", " {\n ", ";\n text-align: ", ";\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n ",
22
- ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), belowIconButtonSpacing(spacing(3)), !fullWidth && RcDefaultTextFieldWidth, gutterBottom && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), RcTextFieldClasses.root, spacing(4)), RcTextFieldInputLabelClasses.root, typography('caption2'), idleColor, RcTextFieldInputLabelClasses.focused, palette2('interactive', 'f01'), RcTextFieldInputClasses.root, textColor, ClearIconButton, showClean && clearBtnInactiveStyle, RcTextFieldInputClasses.input, typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, placeholderColor, clearBtn &&
26
+ ";\n }\n\n .", " {\n &:before {\n border-bottom-color: ", ";\n }\n\n ", " {\n &:hover:not(.", ") {\n &:before {\n border-bottom-color: ", ";\n }\n }\n }\n\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n &:after {\n border-bottom-color: ", ";\n }\n }\n\n .", " {\n color: ", ";\n // * safari need that in disabled input\n -webkit-text-fill-color: ", ";\n ::placeholder {\n color: ", ";\n }\n &:before {\n border-bottom-style: solid;\n border-bottom-color: ", ";\n }\n &:after {\n border-bottom-style: none;\n }\n }\n\n .", " {\n ", ";\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n .", ",\n .", " {\n color: ", ";\n }\n\n /* clears the 'X' from Internet Explorer */\n input[type='search']::-ms-clear,\n input[type='search']::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n /* clears the 'X' from Chrome */\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n\n ", "\n "])), belowIconButtonSpacing(spacing(3)), !fullWidth && RcDefaultTextFieldWidth, gutterBottom && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "], ["\n &.", " {\n margin: 0 0 ", " 0;\n }\n "])), RcTextFieldClasses.root, spacing(4)), RcTextFieldInputLabelClasses.root, typography('caption2'), labelRootColor, RcTextFieldInputLabelClasses.focused, color, RcTextFieldInputClasses.root, textColor, ClearIconButton, showClean && clearBtnInactiveStyle, RcTextFieldInputClasses.input, typography(variant === 'borderLess' ? textVariant : 'subheading1'), align, placeholderColor, clearBtn &&
23
27
  align &&
24
- align !== 'left' && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: calc(100% - ", ");\n "], ["\n width: calc(100% - ", ");\n "])), px(RcIconButtonSizes[size])), RcTextFieldInputClasses.underline, palette2('neutral', 'f02'), nonTouchHoverMedia, RcTextFieldInputClasses.disabled, palette2('neutral', 'f06'), palette2('interactive', 'f01'), RcTextFieldInputClasses.error, errorColor, RcTextFieldInputClasses.disabled, disabledColor, disabledColor, disabledColor, disabledColor, RcTextFieldFormHelperTextClasses.root, typography('caption1'), idleColor, RcTextFieldFormHelperTextClasses.error, RcTextFieldInputLabelClasses.error, errorTextColor, RcTextFieldFormHelperTextClasses.disabled, RcTextFieldInputLabelClasses.disabled, disabledColor, variant === 'outline' && OutlineTextFieldStyle);
28
+ align !== 'left' && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: calc(100% - ", ");\n "], ["\n width: calc(100% - ", ");\n "])), px(RcIconButtonSizes[size])), RcTextFieldInputClasses.underline, underlineColor, nonTouchHoverMedia, RcTextFieldInputClasses.disabled, underlineFocusColor, color, RcTextFieldInputClasses.error, errorColor, RcTextFieldInputClasses.disabled, disabledColor, disabledColor, disabledColor, disabledColor, RcTextFieldFormHelperTextClasses.root, typography('caption1'), idleColor, RcTextFieldFormHelperTextClasses.error, RcTextFieldInputLabelClasses.error, errorTextColor, RcTextFieldFormHelperTextClasses.disabled, RcTextFieldInputLabelClasses.disabled, disabledColor, variant === 'outline' && OutlineTextFieldStyle);
25
29
  };
26
30
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -6,18 +6,23 @@ import { TextareaStyle } from './styles';
6
6
  import { RcTextareaInputClasses } from './utils';
7
7
  var _RcTextarea = forwardRef(function (inProps, ref) {
8
8
  var props = useThemeProps({ props: inProps, name: 'RcTextarea' });
9
- var classes = props.classes, InputPropsProp = props.InputProps, rest = __rest(props, ["classes", "InputProps"]);
9
+ var classes = props.classes, InputPropsProp = props.InputProps, rowsProp = props.rows, minRows = props.minRows, maxRows = props.maxRows, rest = __rest(props, ["classes", "InputProps", "rows", "minRows", "maxRows"]);
10
10
  var InputProps = useMemo(function () {
11
11
  return combineProps({
12
12
  classes: RcTextareaInputClasses,
13
13
  }, InputPropsProp);
14
14
  }, [InputPropsProp]);
15
- return (React.createElement(RcTextField, __assign({}, rest, { multiline: true, InputProps: InputProps, clearBtn: false, ref: ref })));
15
+ var rows = rowsProp;
16
+ // when have minRows and maxRows, not set rows to Mui
17
+ if (minRows || maxRows) {
18
+ rows = undefined;
19
+ }
20
+ return (React.createElement(RcTextField, __assign({}, rest, { rows: rows, minRows: minRows, maxRows: maxRows, multiline: true, InputProps: InputProps, clearBtn: false, ref: ref })));
16
21
  });
17
22
  /** @release */
18
23
  var RcTextarea = styled(_RcTextarea)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TextareaStyle);
19
24
  RcTextarea.defaultProps = {
20
- minRows: 3,
25
+ rows: 3,
21
26
  };
22
27
  RcTextarea.displayName = 'RcTextarea';
23
28
  export { RcTextarea };
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Description</title>
4
+ <path d="M19.25 24c0.414 0 0.75 0.448 0.75 1s-0.336 1-0.75 1h-16.5c-0.414 0-0.75-0.448-0.75-1s0.336-1 0.75-1h16.5zM28.833 15c0.644 0 1.167 0.448 1.167 1s-0.522 1-1.167 1h-25.667c-0.644 0-1.167-0.448-1.167-1s0.522-1 1.167-1h25.667zM28.833 6c0.644 0 1.167 0.448 1.167 1s-0.522 1-1.167 1h-25.667c-0.644 0-1.167-0.448-1.167-1s0.522-1 1.167-1h25.667z"></path>
5
+ </svg>