@hopper-ui/components 1.0.13 → 1.1.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 (179) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Avatar/src/AnonymousAvatar.css +10 -10
  3. package/dist/Avatar/src/AnonymousAvatar.js +2 -2
  4. package/dist/Avatar/src/Avatar.css +37 -37
  5. package/dist/Avatar/src/Avatar.js +3 -3
  6. package/dist/Avatar/src/DeletedAvatar.css +10 -10
  7. package/dist/Avatar/src/DeletedAvatar.js +2 -2
  8. package/dist/Avatar/src/RichIconAvatarImage.css +10 -10
  9. package/dist/Avatar/src/RichIconAvatarImage.js +1 -1
  10. package/dist/Avatar/src/index.css +37 -37
  11. package/dist/Avatar/src/index.js +5 -5
  12. package/dist/Badge/src/Badge.css +10 -10
  13. package/dist/Badge/src/Badge.js +2 -2
  14. package/dist/Badge/src/index.css +10 -10
  15. package/dist/Badge/src/index.js +2 -2
  16. package/dist/Chip/src/Chip.css +33 -33
  17. package/dist/Chip/src/Chip.js +2 -2
  18. package/dist/Chip/src/index.css +33 -33
  19. package/dist/Chip/src/index.js +2 -2
  20. package/dist/Divider/src/Divider.css +2 -2
  21. package/dist/Divider/src/Divider.js +1 -1
  22. package/dist/Divider/src/index.css +2 -2
  23. package/dist/Divider/src/index.js +1 -1
  24. package/dist/ErrorMessage/src/ErrorMessage.css +11 -11
  25. package/dist/ErrorMessage/src/ErrorMessage.js +2 -2
  26. package/dist/ErrorMessage/src/index.css +11 -11
  27. package/dist/ErrorMessage/src/index.js +2 -2
  28. package/dist/HelperMessage/src/HelperMessage.css +11 -11
  29. package/dist/HelperMessage/src/HelperMessage.js +2 -2
  30. package/dist/HelperMessage/src/index.css +11 -11
  31. package/dist/HelperMessage/src/index.js +2 -2
  32. package/dist/IconList/src/IconList.css +1 -1
  33. package/dist/IconList/src/IconList.js +1 -1
  34. package/dist/IconList/src/index.css +1 -1
  35. package/dist/IconList/src/index.js +1 -1
  36. package/dist/Link/src/Link.css +31 -31
  37. package/dist/Link/src/Link.js +2 -2
  38. package/dist/Link/src/index.css +31 -31
  39. package/dist/Link/src/index.js +2 -2
  40. package/dist/ListBox/src/ListBox.css +168 -168
  41. package/dist/ListBox/src/ListBox.js +11 -11
  42. package/dist/ListBox/src/ListBoxItem.css +153 -153
  43. package/dist/ListBox/src/ListBoxItem.js +10 -10
  44. package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
  45. package/dist/ListBox/src/ListBoxItemSkeleton.js +1 -1
  46. package/dist/ListBox/src/index.css +168 -168
  47. package/dist/ListBox/src/index.js +11 -11
  48. package/dist/Spinner/src/Spinner.css +19 -19
  49. package/dist/Spinner/src/Spinner.js +2 -2
  50. package/dist/Spinner/src/index.css +19 -19
  51. package/dist/Spinner/src/index.js +2 -2
  52. package/dist/buttons/src/Button.css +94 -94
  53. package/dist/buttons/src/Button.js +3 -3
  54. package/dist/buttons/src/ButtonGroup.css +11 -11
  55. package/dist/buttons/src/ButtonGroup.js +1 -1
  56. package/dist/buttons/src/ClearButton.css +12 -12
  57. package/dist/buttons/src/ClearButton.js +2 -2
  58. package/dist/buttons/src/EmbeddedButton.css +12 -12
  59. package/dist/buttons/src/EmbeddedButton.js +1 -1
  60. package/dist/buttons/src/index.css +117 -117
  61. package/dist/buttons/src/index.js +6 -6
  62. package/dist/checkbox/src/Checkbox.css +31 -31
  63. package/dist/checkbox/src/Checkbox.js +2 -2
  64. package/dist/checkbox/src/CheckboxField.css +15 -15
  65. package/dist/checkbox/src/CheckboxField.js +1 -1
  66. package/dist/checkbox/src/CheckboxGroup.css +59 -59
  67. package/dist/checkbox/src/CheckboxGroup.js +1 -1
  68. package/dist/checkbox/src/index.css +59 -59
  69. package/dist/checkbox/src/index.js +4 -4
  70. package/dist/{chunk-723W7LGB.js → chunk-6CDXS774.js} +3 -3
  71. package/dist/{chunk-TNVYVDLF.js → chunk-6K6W32Q7.js} +3 -3
  72. package/dist/{chunk-PAYZGXTT.js → chunk-6MSRPPI6.js} +1 -1
  73. package/dist/{chunk-AYPCLDGU.js → chunk-6PH4IIEW.js} +1 -1
  74. package/dist/{chunk-I2YZLGRE.js → chunk-7VS566A2.js} +1 -1
  75. package/dist/{chunk-44KY7MFF.js → chunk-A7HLXFSP.js} +14 -5
  76. package/dist/{chunk-THQZBL4T.js → chunk-AT7ZY6GA.js} +1 -1
  77. package/dist/{chunk-JN2FF2IX.js → chunk-BGRKDTCG.js} +1 -1
  78. package/dist/{chunk-CXIH6I5X.js → chunk-BLQ72S4U.js} +1 -1
  79. package/dist/{chunk-JLUFMLGV.js → chunk-BQZQTNI6.js} +1 -1
  80. package/dist/{chunk-B42AJF74.js → chunk-BXPZ6HPC.js} +6 -6
  81. package/dist/{chunk-MVWQVBTK.js → chunk-CXCOSGTO.js} +1 -1
  82. package/dist/{chunk-2MUGMKNO.js → chunk-FQO2QRSC.js} +1 -1
  83. package/dist/{chunk-M4IVTAHY.js → chunk-GCJT5PQ4.js} +3 -3
  84. package/dist/{chunk-ERE2XRQA.js → chunk-GXFFLWNF.js} +1 -1
  85. package/dist/{chunk-LDORNYHF.js → chunk-I6OII2RA.js} +2 -2
  86. package/dist/{chunk-SNWJJ3FF.js → chunk-ICDMJUNE.js} +1 -1
  87. package/dist/chunk-IU6XMS2X.js +21 -0
  88. package/dist/{chunk-QTV45NTY.js → chunk-KA6KVIVV.js} +2 -2
  89. package/dist/chunk-MHQZXLKW.js +7 -0
  90. package/dist/{chunk-RXZQB35O.js → chunk-OETAIO6N.js} +2 -2
  91. package/dist/{chunk-RGGVZKNN.js → chunk-P7UUQGGF.js} +2 -2
  92. package/dist/{chunk-UGHMX7QX.js → chunk-PQV24MM4.js} +3 -3
  93. package/dist/{chunk-UPR32DV5.js → chunk-Q52NUBN7.js} +2 -2
  94. package/dist/{chunk-ESRYOELK.js → chunk-QY6U3R3W.js} +2 -2
  95. package/dist/{chunk-SW7LHIQ2.js → chunk-RD6VCI72.js} +7 -7
  96. package/dist/{chunk-KARK64JC.js → chunk-SR3GAXY5.js} +1 -1
  97. package/dist/{chunk-ZXDN2IRM.js → chunk-TGXZJJJA.js} +1 -1
  98. package/dist/{chunk-IEE2HHGR.js → chunk-TKB5Q2WX.js} +1 -1
  99. package/dist/{chunk-SSMGKQ27.js → chunk-TMWNNF4J.js} +2 -2
  100. package/dist/{chunk-GH5LAOQU.js → chunk-TVV4RMFR.js} +1 -1
  101. package/dist/{chunk-WCLGYVXV.js → chunk-UMD6RDUS.js} +1 -1
  102. package/dist/{chunk-DZHRELLA.js → chunk-VFYGHX3N.js} +1 -1
  103. package/dist/{chunk-NHM3MQI3.js → chunk-VVY3ONWS.js} +3 -3
  104. package/dist/{chunk-AMXRADUV.js → chunk-WAUGFWZA.js} +2 -2
  105. package/dist/chunk-XGI4LDIF.js +276 -0
  106. package/dist/{chunk-CS2RAWQB.js → chunk-XHZ4R2MB.js} +3 -3
  107. package/dist/{chunk-5WWMVQI4.js → chunk-YE7RARJB.js} +1 -1
  108. package/dist/{chunk-CCIVRIKG.js → chunk-YRUBXLBX.js} +12 -2
  109. package/dist/chunk-Z57VHYOF.js +22 -0
  110. package/dist/{chunk-W34MMJ2L.js → chunk-ZNGSZW7M.js} +2 -2
  111. package/dist/index.css +568 -477
  112. package/dist/index.d.ts +4 -0
  113. package/dist/index.js +50 -46
  114. package/dist/inputs/src/InputGroup.css +78 -39
  115. package/dist/inputs/src/InputGroup.d.ts +8 -0
  116. package/dist/inputs/src/InputGroup.js +1 -1
  117. package/dist/inputs/src/NumberField.css +126 -90
  118. package/dist/inputs/src/NumberField.js +8 -7
  119. package/dist/inputs/src/PasswordField.css +222 -183
  120. package/dist/inputs/src/PasswordField.js +7 -7
  121. package/dist/inputs/src/SearchField.css +228 -189
  122. package/dist/inputs/src/SearchField.js +8 -8
  123. package/dist/inputs/src/TextArea.css +466 -0
  124. package/dist/inputs/src/TextArea.d.ts +62 -0
  125. package/dist/inputs/src/TextArea.js +23 -0
  126. package/dist/inputs/src/TextAreaContext.d.ts +8 -0
  127. package/dist/inputs/src/TextAreaContext.js +2 -0
  128. package/dist/inputs/src/TextField.css +223 -184
  129. package/dist/inputs/src/TextField.js +9 -9
  130. package/dist/inputs/src/index.css +462 -371
  131. package/dist/inputs/src/index.d.ts +2 -0
  132. package/dist/inputs/src/index.js +15 -11
  133. package/dist/overlays/Popover/src/Popover.css +568 -477
  134. package/dist/overlays/Popover/src/Popover.js +50 -46
  135. package/dist/overlays/Popover/src/index.css +568 -477
  136. package/dist/overlays/Popover/src/index.js +50 -46
  137. package/dist/radio/src/Radio.css +31 -31
  138. package/dist/radio/src/Radio.js +2 -2
  139. package/dist/radio/src/RadioField.css +15 -15
  140. package/dist/radio/src/RadioField.js +1 -1
  141. package/dist/radio/src/RadioGroup.css +59 -59
  142. package/dist/radio/src/RadioGroup.js +3 -3
  143. package/dist/radio/src/index.css +59 -59
  144. package/dist/radio/src/index.js +7 -7
  145. package/dist/switch/src/Switch.css +25 -25
  146. package/dist/switch/src/Switch.js +2 -2
  147. package/dist/switch/src/SwitchField.css +15 -15
  148. package/dist/switch/src/SwitchField.js +1 -1
  149. package/dist/switch/src/index.css +31 -31
  150. package/dist/switch/src/index.js +3 -3
  151. package/dist/tag/src/Tag.css +568 -477
  152. package/dist/tag/src/Tag.js +50 -46
  153. package/dist/tag/src/TagGroup.css +21 -21
  154. package/dist/tag/src/TagGroup.js +1 -1
  155. package/dist/tag/src/index.css +568 -477
  156. package/dist/tag/src/index.js +50 -46
  157. package/dist/typography/Heading/src/Heading.css +9 -9
  158. package/dist/typography/Heading/src/Heading.js +1 -1
  159. package/dist/typography/Heading/src/index.css +9 -9
  160. package/dist/typography/Heading/src/index.js +1 -1
  161. package/dist/typography/Label/src/Label.css +2 -2
  162. package/dist/typography/Label/src/Label.js +1 -1
  163. package/dist/typography/Label/src/index.css +2 -2
  164. package/dist/typography/Label/src/index.js +1 -1
  165. package/dist/typography/OverlineText/src/OverlineText.css +6 -6
  166. package/dist/typography/OverlineText/src/OverlineText.js +1 -1
  167. package/dist/typography/OverlineText/src/index.css +6 -6
  168. package/dist/typography/OverlineText/src/index.js +1 -1
  169. package/dist/typography/Text/src/Text.css +9 -9
  170. package/dist/typography/Text/src/Text.js +1 -1
  171. package/dist/typography/Text/src/index.css +9 -9
  172. package/dist/typography/Text/src/index.js +1 -1
  173. package/dist/utils/src/index.d.ts +2 -0
  174. package/dist/utils/src/index.js +3 -1
  175. package/dist/utils/src/useFontFaceReady.d.ts +3 -0
  176. package/dist/utils/src/useFontFaceReady.js +2 -0
  177. package/dist/utils/src/useTruncatedText.d.ts +3 -0
  178. package/dist/utils/src/useTruncatedText.js +2 -0
  179. package/package.json +1 -1
@@ -0,0 +1,276 @@
1
+ import { useFontFaceReady } from './chunk-IU6XMS2X.js';
2
+ import { useTruncatedText } from './chunk-Z57VHYOF.js';
3
+ import { TextAreaContext } from './chunk-MHQZXLKW.js';
4
+ import { _InputGroup } from './chunk-YRUBXLBX.js';
5
+ import { LabelContext } from './chunk-QCA3ZR56.js';
6
+ import { useLocalizedString } from './chunk-YEYNRBMQ.js';
7
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
8
+ import { HelperMessageContext } from './chunk-HZKFQ33E.js';
9
+ import { ErrorMessageContext } from './chunk-FAE27DLF.js';
10
+ import { _Text } from './chunk-6MSRPPI6.js';
11
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
12
+ import { SlotProvider } from './chunk-M36KANKC.js';
13
+ import { cssModule } from './chunk-KVDXQMWI.js';
14
+ import { useStyledSystem, useResponsiveValue, useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
15
+ import $670gB$react, { forwardRef, useContext, useState, useCallback, useRef, useMemo } from 'react';
16
+ import { mergeRefs } from '@react-aria/utils';
17
+ import { useControlledState } from '@react-stately/utils';
18
+ import { useObjectRef } from 'react-aria';
19
+ import { useContextProps, composeRenderProps, TextArea as TextArea$1, TextField } from 'react-aria-components';
20
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
21
+
22
+ var $b5e257d569688ac6$var$defaultContext = {
23
+ prefix: String(Math.round(Math.random() * 1e10)),
24
+ current: 0
25
+ };
26
+ var $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ ($670gB$react).createContext($b5e257d569688ac6$var$defaultContext);
27
+ var $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ ($670gB$react).createContext(false);
28
+ var $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
29
+ var $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
30
+ function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
31
+ let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
32
+ let ref = (useRef)(null);
33
+ if (ref.current === null && !isDisabled) {
34
+ var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
35
+ let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ($670gB$react).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
36
+ if (currentOwner) {
37
+ let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
38
+ if (prevComponentValue == null)
39
+ $b5e257d569688ac6$var$componentIds.set(currentOwner, {
40
+ id: ctx.current,
41
+ state: currentOwner.memoizedState
42
+ });
43
+ else if (currentOwner.memoizedState !== prevComponentValue.state) {
44
+ ctx.current = prevComponentValue.id;
45
+ $b5e257d569688ac6$var$componentIds.delete(currentOwner);
46
+ }
47
+ }
48
+ ref.current = ++ctx.current;
49
+ }
50
+ return ref.current;
51
+ }
52
+ function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
53
+ let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
54
+ if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
55
+ let counter = $b5e257d569688ac6$var$useCounter(!!defaultId);
56
+ let prefix = ctx === $b5e257d569688ac6$var$defaultContext && false ? "react-aria" : `react-aria${ctx.prefix}`;
57
+ return defaultId || `${prefix}-${counter}`;
58
+ }
59
+ function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
60
+ let id = ($670gB$react).useId();
61
+ let [didSSR] = (useState)($b5e257d569688ac6$export$535bd6ca7f90a273());
62
+ let prefix = didSSR || false ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
63
+ return defaultId || `${prefix}-${id}`;
64
+ }
65
+ typeof ($670gB$react)["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
66
+ function $b5e257d569688ac6$var$getSnapshot() {
67
+ return false;
68
+ }
69
+ function $b5e257d569688ac6$var$getServerSnapshot() {
70
+ return true;
71
+ }
72
+ function $b5e257d569688ac6$var$subscribe(onStoreChange) {
73
+ return () => {
74
+ };
75
+ }
76
+ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
77
+ if (typeof ($670gB$react)["useSyncExternalStore"] === "function") return ($670gB$react)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
78
+ return (useContext)($b5e257d569688ac6$var$IsSSRContext);
79
+ }
80
+
81
+ // css-module:./TextArea.module.css#css-module
82
+ var TextArea_module_default = { "hop-TextArea": "TextArea-module__hop-TextArea___uQGKH", "hop-TextArea--fluid": "TextArea-module__hop-TextArea--fluid___sNZwX", "hop-TextArea__Label": "TextArea-module__hop-TextArea__Label___x0-91", "hop-TextArea__prefix": "TextArea-module__hop-TextArea__prefix___ozMT-", "hop-TextArea__InputGroup": "TextArea-module__hop-TextArea__InputGroup___1hWlx", "hop-TextArea__textarea": "TextArea-module__hop-TextArea__textarea___r0SC4", "hop-TextArea__char-count": "TextArea-module__hop-TextArea__char-count___TBxZb", "hop-TextArea__ErrorMessage": "TextArea-module__hop-TextArea__ErrorMessage___F5Ho0", "hop-TextArea__HelperMessage": "TextArea-module__hop-TextArea__HelperMessage___EXkDT" };
83
+ var GlobalTextAreaCssSelector = "hop-TextArea";
84
+ var DefaultMinimumTextAreaRows = 3;
85
+ var pxToInt = (value) => {
86
+ return value ? parseInt(value.replace("px", ""), 10) : 0;
87
+ };
88
+ function getBodyElement(isSSR) {
89
+ return !isSSR ? document.body : void 0;
90
+ }
91
+ function useCalculateRowHeight(input) {
92
+ const isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
93
+ const fontsLoaded = useFontFaceReady();
94
+ return useMemo(() => {
95
+ var _a, _b;
96
+ if (!input || !fontsLoaded) {
97
+ return 0;
98
+ }
99
+ const { font, lineHeight } = window.getComputedStyle(input);
100
+ if (lineHeight !== "normal") {
101
+ return pxToInt(lineHeight);
102
+ }
103
+ const element = document.createElement("span");
104
+ element.style.visibility = "hidden";
105
+ element.style.position = "absolute";
106
+ element.style.font = font;
107
+ element.innerText = "LineHeightHelper";
108
+ (_a = getBodyElement(isSSR)) == null ? void 0 : _a.appendChild(element);
109
+ const height = element.getBoundingClientRect().height;
110
+ (_b = getBodyElement(isSSR)) == null ? void 0 : _b.removeChild(element);
111
+ return height;
112
+ }, [input, fontsLoaded, isSSR]);
113
+ }
114
+ function TextArea(props, ref) {
115
+ var _a, _b;
116
+ const {
117
+ inputRef: userProvidedInputRef = null,
118
+ ...propsWithoutRef
119
+ } = props;
120
+ [props, ref] = useContextProps(propsWithoutRef, ref, TextAreaContext);
121
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
122
+ const [characterCount, setCharacterCount] = useState(() => {
123
+ var _a2, _b2, _c, _d;
124
+ return (_d = (_c = (_a2 = props.value) == null ? void 0 : _a2.length) != null ? _c : (_b2 = props.defaultValue) == null ? void 0 : _b2.length) != null ? _d : 0;
125
+ });
126
+ const {
127
+ className,
128
+ style: styleProp,
129
+ size,
130
+ showCharacterCount,
131
+ maxLength,
132
+ placeholder,
133
+ onChange: onChangeProp,
134
+ children,
135
+ defaultValue,
136
+ maxRows,
137
+ cols,
138
+ rows: rowsProp,
139
+ value: valueProp,
140
+ resizeMode: resizeModeProp,
141
+ isFluid: isFluidProp,
142
+ isDisabled,
143
+ isInvalid,
144
+ restrictMaxLength = true,
145
+ ...otherProps
146
+ } = ownProps;
147
+ const mergedTextAreaRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
148
+ const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
149
+ const resizeMode = (_b = useResponsiveValue(resizeModeProp)) != null ? _b : "none";
150
+ const overMaxLength = !!maxLength && characterCount > maxLength;
151
+ const classNames = composeClassnameRenderProps(
152
+ className,
153
+ GlobalTextAreaCssSelector,
154
+ cssModule(
155
+ TextArea_module_default,
156
+ "hop-TextArea",
157
+ isFluid && "fluid"
158
+ ),
159
+ stylingProps.className
160
+ );
161
+ const style = composeRenderProps(styleProp, (prev) => {
162
+ return {
163
+ ...stylingProps.style,
164
+ ...prev
165
+ };
166
+ });
167
+ const handleTextChanged = useCallback((value2) => {
168
+ setCharacterCount(value2.length);
169
+ onChangeProp == null ? void 0 : onChangeProp(value2);
170
+ }, [onChangeProp]);
171
+ if (showCharacterCount && !maxLength) {
172
+ console.warn("If showCharacterCount is true, maxLength must be set to the maximum number of characters allowed in the TextArea.");
173
+ }
174
+ const rowHeight = useCalculateRowHeight(mergedTextAreaRef.current);
175
+ const defaultNumberOfRows = maxRows && maxRows < DefaultMinimumTextAreaRows ? maxRows : DefaultMinimumTextAreaRows;
176
+ const [rows, setRows] = useState(rowsProp != null ? rowsProp : defaultNumberOfRows);
177
+ const truncateText = useTruncatedText();
178
+ const [value, onChange] = useControlledState(valueProp, defaultValue || "", handleTextChanged);
179
+ const adjustRows = useCallback(() => {
180
+ const input = mergedTextAreaRef.current;
181
+ if (rowHeight === 0 || !input) {
182
+ return;
183
+ }
184
+ const { paddingBottom, paddingTop } = window.getComputedStyle(input);
185
+ const originalRows = input.rows;
186
+ const originalOverflow = input.style.overflow;
187
+ input.rows = 1;
188
+ input.style.overflow = "hidden";
189
+ const padding = pxToInt(paddingTop) + pxToInt(paddingBottom);
190
+ const currentRowsWithText = Math.floor((input.scrollHeight - padding) / rowHeight);
191
+ input.rows = originalRows;
192
+ input.style.overflow = originalOverflow;
193
+ if (rowsProp) {
194
+ setRows(rowsProp);
195
+ } else if (maxRows && currentRowsWithText >= maxRows) {
196
+ setRows(maxRows);
197
+ } else {
198
+ setRows(Math.max(currentRowsWithText, DefaultMinimumTextAreaRows));
199
+ }
200
+ }, [mergedTextAreaRef, rowHeight, maxRows, rowsProp]);
201
+ useIsomorphicLayoutEffect(() => {
202
+ if (restrictMaxLength) {
203
+ const newValue = truncateText(value, maxLength);
204
+ onChange(newValue);
205
+ }
206
+ adjustRows();
207
+ }, [value, adjustRows]);
208
+ const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
209
+ _InputGroup,
210
+ {
211
+ isFluid: true,
212
+ size,
213
+ className: TextArea_module_default["hop-TextArea__InputGroup"],
214
+ isDisabled,
215
+ isInvalid,
216
+ inputClassName: TextArea_module_default["hop-TextArea__textarea"],
217
+ inputType: "textarea",
218
+ children: [
219
+ /* @__PURE__ */ jsx(TextArea$1, { ref: mergedTextAreaRef, placeholder, cols, rows }),
220
+ showCharacterCount && maxLength && /* @__PURE__ */ jsx(CharacterCount, { charactersLeft: maxLength - characterCount, isInvalid: overMaxLength })
221
+ ]
222
+ }
223
+ ) });
224
+ const childrenMarkup = composeRenderProps(children, (prev) => {
225
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
226
+ /* @__PURE__ */ jsx(
227
+ SlotProvider,
228
+ {
229
+ values: [
230
+ [LabelContext, { className: TextArea_module_default["hop-TextArea__Label"] }],
231
+ [HelperMessageContext, { className: TextArea_module_default["hop-TextArea__HelperMessage"] }],
232
+ [ErrorMessageContext, { className: TextArea_module_default["hop-TextArea__ErrorMessage"] }]
233
+ ],
234
+ children: prev
235
+ }
236
+ ),
237
+ inputMarkup
238
+ ] });
239
+ });
240
+ return /* @__PURE__ */ jsx(
241
+ TextField,
242
+ {
243
+ ref,
244
+ value,
245
+ style,
246
+ className: classNames,
247
+ maxLength: restrictMaxLength ? maxLength : void 0,
248
+ onChange,
249
+ isDisabled,
250
+ isInvalid,
251
+ "data-resize-mode": resizeMode,
252
+ "data-over-max-length": overMaxLength || void 0,
253
+ ...otherProps,
254
+ children: childrenMarkup
255
+ }
256
+ );
257
+ }
258
+ function CharacterCount({ charactersLeft, isInvalid }) {
259
+ const stringFormatter = useLocalizedString();
260
+ const accessibilityString = stringFormatter.format("Input.charactersLeft", { charLeft: charactersLeft });
261
+ return /* @__PURE__ */ jsx(
262
+ _Text,
263
+ {
264
+ "aria-label": accessibilityString,
265
+ role: "status",
266
+ size: "xs",
267
+ className: TextArea_module_default["hop-TextArea__char-count"],
268
+ "data-invalid": isInvalid || void 0,
269
+ children: charactersLeft
270
+ }
271
+ );
272
+ }
273
+ var _TextArea = forwardRef(TextArea);
274
+ _TextArea.displayName = "TextArea";
275
+
276
+ export { GlobalTextAreaCssSelector, _TextArea };
@@ -2,13 +2,13 @@ import { isFunction } from './chunk-TIPN4VYD.js';
2
2
  import { useLoadOnScroll } from './chunk-JTNMFPM4.js';
3
3
  import { SectionContext } from './chunk-5H5AZJPQ.js';
4
4
  import { ListBoxContext } from './chunk-UIEP5BA5.js';
5
- import { _ListBoxItem } from './chunk-SW7LHIQ2.js';
5
+ import { _ListBoxItem } from './chunk-RD6VCI72.js';
6
6
  import { useLocalizedString } from './chunk-YEYNRBMQ.js';
7
7
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
8
8
  import { ListBoxItemContext } from './chunk-Y2POLIXK.js';
9
9
  import { HeaderContext } from './chunk-7JOGKC3W.js';
10
10
  import { DividerContext } from './chunk-FYIHMKHI.js';
11
- import { _Text } from './chunk-PAYZGXTT.js';
11
+ import { _Text } from './chunk-6MSRPPI6.js';
12
12
  import { SlotProvider } from './chunk-M36KANKC.js';
13
13
  import { cssModule } from './chunk-KVDXQMWI.js';
14
14
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
@@ -18,7 +18,7 @@ import { useContextProps, composeRenderProps, ListBox as ListBox$1, Collection }
18
18
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
19
 
20
20
  // css-module:./ListBox.module.css#css-module
21
- var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-ListBox___XQDch", "hop-ListBox--fluid": "ListBox-module__hop-ListBox--fluid___3Im73", "hop-ListBox__section": "ListBox-module__hop-ListBox__section___65r5k", "hop-ListBox__item": "ListBox-module__hop-ListBox__item___XEwSd", "hop-ListBox__section-header": "ListBox-module__hop-ListBox__section-header___GjNW9", "hop-ListBox__divider": "ListBox-module__hop-ListBox__divider___KcKrr" };
21
+ var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-ListBox___cyQ8m", "hop-ListBox--fluid": "ListBox-module__hop-ListBox--fluid___TImf9", "hop-ListBox__section": "ListBox-module__hop-ListBox__section___nULeu", "hop-ListBox__item": "ListBox-module__hop-ListBox__item___r3RgS", "hop-ListBox__section-header": "ListBox-module__hop-ListBox__section-header___DWGXa", "hop-ListBox__divider": "ListBox-module__hop-ListBox__divider___ncxbm" };
22
22
  var GlobalListBoxCssSelector = "hop-ListBox";
23
23
  var GlobalListBoxEmptyItemCssSelector = "hop-ListBox__empty-item";
24
24
  var ListBoxToTextSizeAdapter = {
@@ -7,7 +7,7 @@ import { useContextProps, Text } from 'react-aria-components';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  // css-module:./OverlineText.module.css#css-module
10
- var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-OverlineText___1BZid", "hop-OverlineText__text": "OverlineText-module__hop-OverlineText__text___RuqQo" };
10
+ var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-OverlineText___OCaWy", "hop-OverlineText__text": "OverlineText-module__hop-OverlineText__text___C3XIa" };
11
11
  var GlobalOverlineTextCssSelector = "hop-OverlineText";
12
12
  function OverlineText(props, ref) {
13
13
  [props, ref] = useContextProps(props, ref, OverlineTextContext);
@@ -5,11 +5,11 @@ import { cssModule } from './chunk-KVDXQMWI.js';
5
5
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
6
6
  import { mergeRefs } from '@react-aria/utils';
7
7
  import { forwardRef, useRef, useCallback } from 'react';
8
- import { useContextProps, useSlottedContext, InputContext, composeRenderProps, Group } from 'react-aria-components';
8
+ import { useContextProps, useSlottedContext, InputContext, TextAreaContext, composeRenderProps, Group } from 'react-aria-components';
9
9
  import { jsx } from 'react/jsx-runtime';
10
10
 
11
11
  // css-module:./InputGroup.module.css#css-module
12
- var InputGroup_module_default = { "hop-InputGroup": "InputGroup-module__hop-InputGroup___yPMIO", "hop-InputGroup--fluid": "InputGroup-module__hop-InputGroup--fluid___SDrjN", "hop-InputGroup--sm": "InputGroup-module__hop-InputGroup--sm___uk-A0", "hop-InputGroup__input": "InputGroup-module__hop-InputGroup__input___aerYh" };
12
+ var InputGroup_module_default = { "hop-InputGroup": "InputGroup-module__hop-InputGroup___MpyEZ", "hop-InputGroup--fluid": "InputGroup-module__hop-InputGroup--fluid___nXqi6", "hop-InputGroup--sm": "InputGroup-module__hop-InputGroup--sm___tvLAO", "hop-InputGroup__input": "InputGroup-module__hop-InputGroup__input___lecEl", "hop-InputGroup__textarea": "InputGroup-module__hop-InputGroup__textarea___e89Dj" };
13
13
  var GlobalInputGroupCssSelector = "hop-InputGroup";
14
14
  function InputGroup(props, ref) {
15
15
  var _a, _b;
@@ -17,6 +17,9 @@ function InputGroup(props, ref) {
17
17
  const inputRef = useRef(null);
18
18
  const inputContext = useSlottedContext(InputContext);
19
19
  const mergedRefs = (inputContext == null ? void 0 : inputContext.ref) ? mergeRefs(inputRef, inputContext == null ? void 0 : inputContext.ref) : inputRef;
20
+ const textAreaRef = useRef(null);
21
+ const textAreaContext = useSlottedContext(TextAreaContext);
22
+ const mergedTextAreaRefs = (textAreaContext == null ? void 0 : textAreaContext.ref) ? mergeRefs(textAreaRef, textAreaContext == null ? void 0 : textAreaContext.ref) : textAreaRef;
20
23
  const { stylingProps, ...ownProps } = useStyledSystem(props);
21
24
  const {
22
25
  className,
@@ -25,6 +28,7 @@ function InputGroup(props, ref) {
25
28
  size: sizeProp,
26
29
  isFluid: isFluidProp,
27
30
  inputClassName,
31
+ inputType = "text",
28
32
  onMouseDown,
29
33
  ...otherProps
30
34
  } = ownProps;
@@ -62,6 +66,11 @@ function InputGroup(props, ref) {
62
66
  ...inputContext,
63
67
  ref: mergedRefs,
64
68
  className: composeClassnameRenderProps(inputContext == null ? void 0 : inputContext.className, inputClassName, InputGroup_module_default["hop-InputGroup__input"])
69
+ }],
70
+ [TextAreaContext, {
71
+ ...textAreaContext,
72
+ ref: mergedTextAreaRefs,
73
+ className: composeClassnameRenderProps(textAreaContext == null ? void 0 : textAreaContext.className, inputClassName, InputGroup_module_default["hop-InputGroup__textarea"])
65
74
  }]
66
75
  ],
67
76
  children: /* @__PURE__ */ jsx(
@@ -72,6 +81,7 @@ function InputGroup(props, ref) {
72
81
  ref,
73
82
  className: classNames,
74
83
  style,
84
+ "data-input-type": inputType,
75
85
  children
76
86
  }
77
87
  )
@@ -0,0 +1,22 @@
1
+ import { useCallback } from 'react';
2
+
3
+ // src/utils/src/useTruncatedText.ts
4
+ var useTruncatedText = () => {
5
+ const truncateText = useCallback((inputText, limit) => {
6
+ const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
7
+ const segments = segmenter.segment(inputText);
8
+ let truncatedText = "";
9
+ let count = 0;
10
+ for (const segment of segments) {
11
+ if (limit && count + segment.segment.length > limit) {
12
+ break;
13
+ }
14
+ truncatedText += segment.segment;
15
+ count += segment.segment.length;
16
+ }
17
+ return truncatedText;
18
+ }, []);
19
+ return truncateText;
20
+ };
21
+
22
+ export { useTruncatedText };
@@ -2,7 +2,7 @@ import { CheckboxContext } from './chunk-2EAZPH3M.js';
2
2
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
3
3
  import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
4
4
  import { IconListContext } from './chunk-DHVVYSLB.js';
5
- import { _Text } from './chunk-PAYZGXTT.js';
5
+ import { _Text } from './chunk-6MSRPPI6.js';
6
6
  import { TextContext } from './chunk-X6SER3TZ.js';
7
7
  import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
8
8
  import { SlotProvider } from './chunk-M36KANKC.js';
@@ -14,7 +14,7 @@ import { useContextProps, composeRenderProps, Checkbox as Checkbox$1 } from 'rea
14
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
15
 
16
16
  // css-module:./Checkbox.module.css#css-module
17
- var Checkbox_module_default = { "hop-Checkbox": "Checkbox-module__hop-Checkbox___2SBYs", "hop-Checkbox--focused": "Checkbox-module__hop-Checkbox--focused___GUWfq", "hop-Checkbox--hovered": "Checkbox-module__hop-Checkbox--hovered___-rDr8", "hop-Checkbox--pressed": "Checkbox-module__hop-Checkbox--pressed___kLFm-", "hop-Checkbox--sm": "Checkbox-module__hop-Checkbox--sm___ku6Fh", "hop-Checkbox--md": "Checkbox-module__hop-Checkbox--md___m1kW9", "hop-Checkbox__icon": "Checkbox-module__hop-Checkbox__icon___9T-B2", "hop-Checkbox__icon-list": "Checkbox-module__hop-Checkbox__icon-list___Xzo43", "hop-Checkbox__box": "Checkbox-module__hop-Checkbox__box___tSdwv", "hop-Checkbox__check": "Checkbox-module__hop-Checkbox__check___nWURg", "hop-Checkbox__text": "Checkbox-module__hop-Checkbox__text___G2FeR" };
17
+ var Checkbox_module_default = { "hop-Checkbox": "Checkbox-module__hop-Checkbox___uSRQR", "hop-Checkbox--focused": "Checkbox-module__hop-Checkbox--focused___l2Kcq", "hop-Checkbox--hovered": "Checkbox-module__hop-Checkbox--hovered___KKr7X", "hop-Checkbox--pressed": "Checkbox-module__hop-Checkbox--pressed___vlnLv", "hop-Checkbox--sm": "Checkbox-module__hop-Checkbox--sm___FNsCG", "hop-Checkbox--md": "Checkbox-module__hop-Checkbox--md___NSNfJ", "hop-Checkbox__icon": "Checkbox-module__hop-Checkbox__icon___RWn1y", "hop-Checkbox__icon-list": "Checkbox-module__hop-Checkbox__icon-list___FaUCo", "hop-Checkbox__box": "Checkbox-module__hop-Checkbox__box___zmD2H", "hop-Checkbox__check": "Checkbox-module__hop-Checkbox__check___NpzB3", "hop-Checkbox__text": "Checkbox-module__hop-Checkbox__text___mh-4B" };
18
18
  var GlobalCheckboxCssSelector = "hop-Checkbox";
19
19
  function Checkbox(props, ref) {
20
20
  var _a;