@hopper-ui/components 1.1.0 → 1.2.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 (198) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/Avatar/src/AnonymousAvatar.css +10 -10
  4. package/dist/Avatar/src/AnonymousAvatar.js +2 -2
  5. package/dist/Avatar/src/Avatar.css +37 -37
  6. package/dist/Avatar/src/Avatar.js +3 -3
  7. package/dist/Avatar/src/AvatarContext.d.ts +1 -1
  8. package/dist/Avatar/src/DeletedAvatar.css +10 -10
  9. package/dist/Avatar/src/DeletedAvatar.js +2 -2
  10. package/dist/Avatar/src/RichIconAvatarImage.css +10 -10
  11. package/dist/Avatar/src/RichIconAvatarImage.js +1 -1
  12. package/dist/Avatar/src/index.css +37 -37
  13. package/dist/Avatar/src/index.js +5 -5
  14. package/dist/Badge/src/Badge.css +10 -10
  15. package/dist/Badge/src/Badge.js +2 -2
  16. package/dist/Badge/src/index.css +10 -10
  17. package/dist/Badge/src/index.js +2 -2
  18. package/dist/Divider/src/Divider.css +2 -2
  19. package/dist/Divider/src/Divider.js +1 -1
  20. package/dist/Divider/src/index.css +2 -2
  21. package/dist/Divider/src/index.js +1 -1
  22. package/dist/ErrorMessage/src/ErrorMessage.css +11 -11
  23. package/dist/ErrorMessage/src/ErrorMessage.js +2 -2
  24. package/dist/ErrorMessage/src/index.css +11 -11
  25. package/dist/ErrorMessage/src/index.js +2 -2
  26. package/dist/Form/src/Form.css +4111 -0
  27. package/dist/Form/src/Form.d.ts +28 -0
  28. package/dist/Form/src/Form.js +114 -0
  29. package/dist/Form/src/FormContext.d.ts +8 -0
  30. package/dist/Form/src/FormContext.js +2 -0
  31. package/dist/Form/src/index.css +4111 -0
  32. package/dist/Form/src/index.d.ts +5 -0
  33. package/dist/Form/src/index.js +114 -0
  34. package/dist/HelperMessage/src/HelperMessage.css +11 -11
  35. package/dist/HelperMessage/src/HelperMessage.js +2 -2
  36. package/dist/HelperMessage/src/index.css +11 -11
  37. package/dist/HelperMessage/src/index.js +2 -2
  38. package/dist/IconList/src/IconList.css +1 -1
  39. package/dist/IconList/src/IconList.js +1 -1
  40. package/dist/IconList/src/index.css +1 -1
  41. package/dist/IconList/src/index.js +1 -1
  42. package/dist/Link/src/Link.css +31 -31
  43. package/dist/Link/src/Link.js +3 -3
  44. package/dist/Link/src/index.css +31 -31
  45. package/dist/Link/src/index.js +3 -3
  46. package/dist/ListBox/src/ListBox.css +369 -169
  47. package/dist/ListBox/src/ListBox.js +12 -11
  48. package/dist/ListBox/src/ListBoxItem.css +425 -225
  49. package/dist/ListBox/src/ListBoxItem.js +10 -9
  50. package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
  51. package/dist/ListBox/src/ListBoxItemSkeleton.js +1 -1
  52. package/dist/ListBox/src/index.css +369 -169
  53. package/dist/ListBox/src/index.js +12 -11
  54. package/dist/Spinner/src/Spinner.css +19 -19
  55. package/dist/Spinner/src/Spinner.js +2 -2
  56. package/dist/Spinner/src/index.css +19 -19
  57. package/dist/Spinner/src/index.js +2 -2
  58. package/dist/buttons/src/Button.css +94 -94
  59. package/dist/buttons/src/Button.js +6 -6
  60. package/dist/buttons/src/ButtonGroup.css +11 -11
  61. package/dist/buttons/src/ButtonGroup.js +1 -1
  62. package/dist/buttons/src/ClearButton.css +375 -28
  63. package/dist/buttons/src/ClearButton.js +3 -3
  64. package/dist/buttons/src/EmbeddedButton.css +375 -28
  65. package/dist/buttons/src/EmbeddedButton.d.ts +9 -0
  66. package/dist/buttons/src/EmbeddedButton.js +1 -1
  67. package/dist/buttons/src/index.css +480 -133
  68. package/dist/buttons/src/index.js +9 -9
  69. package/dist/checkbox/src/Checkbox.css +31 -31
  70. package/dist/checkbox/src/Checkbox.js +3 -3
  71. package/dist/checkbox/src/CheckboxField.css +15 -15
  72. package/dist/checkbox/src/CheckboxField.js +1 -1
  73. package/dist/checkbox/src/CheckboxGroup.css +62 -59
  74. package/dist/checkbox/src/CheckboxGroup.js +1 -1
  75. package/dist/checkbox/src/index.css +62 -59
  76. package/dist/checkbox/src/index.js +6 -6
  77. package/dist/{chunk-SR3GAXY5.js → chunk-2XO5CZBO.js} +2 -2
  78. package/dist/{chunk-VFYGHX3N.js → chunk-354H4FNA.js} +1 -1
  79. package/dist/{chunk-TGXZJJJA.js → chunk-5IB23E3O.js} +6 -2
  80. package/dist/{chunk-UMD6RDUS.js → chunk-BKCMCC7V.js} +1 -1
  81. package/dist/{chunk-YE7RARJB.js → chunk-CEUQHDEQ.js} +1 -1
  82. package/dist/{chunk-WAUGFWZA.js → chunk-CKKLDA5J.js} +2 -2
  83. package/dist/{chunk-PQV24MM4.js → chunk-COIGQP33.js} +3 -3
  84. package/dist/{chunk-VVY3ONWS.js → chunk-EJUIYBAC.js} +1 -1
  85. package/dist/chunk-EURJK4ZT.js +7 -0
  86. package/dist/{chunk-YEYNRBMQ.js → chunk-F4H76S4H.js} +6 -2
  87. package/dist/{chunk-A7HLXFSP.js → chunk-FA4IXLWZ.js} +9 -7
  88. package/dist/chunk-FOD7XUSJ.js +150 -0
  89. package/dist/{chunk-ZNGSZW7M.js → chunk-FOKTHCFK.js} +3 -3
  90. package/dist/{chunk-XGI4LDIF.js → chunk-HCRWIU7V.js} +4 -4
  91. package/dist/{chunk-BGRKDTCG.js → chunk-IUOLKHYQ.js} +1 -1
  92. package/dist/{chunk-FQO2QRSC.js → chunk-IXWYHDGU.js} +1 -1
  93. package/dist/{chunk-TMWNNF4J.js → chunk-J44DIB5J.js} +3 -3
  94. package/dist/{chunk-TVV4RMFR.js → chunk-JJ4EFTES.js} +1 -1
  95. package/dist/{chunk-P7UUQGGF.js → chunk-L5KI4ZCL.js} +2 -2
  96. package/dist/{chunk-6PH4IIEW.js → chunk-M3K4IYX6.js} +1 -1
  97. package/dist/{chunk-TKB5Q2WX.js → chunk-MJHMFANK.js} +1 -1
  98. package/dist/{chunk-BLQ72S4U.js → chunk-PFABSIDM.js} +1 -1
  99. package/dist/{chunk-GXFFLWNF.js → chunk-PQXVL3YJ.js} +1 -1
  100. package/dist/{chunk-YRUBXLBX.js → chunk-Q63YLWI6.js} +6 -3
  101. package/dist/{chunk-BQZQTNI6.js → chunk-RQKU3XDG.js} +1 -1
  102. package/dist/chunk-RWAVMW7T.js +70 -0
  103. package/dist/{chunk-6K6W32Q7.js → chunk-S5CK32KM.js} +6 -4
  104. package/dist/{chunk-I6OII2RA.js → chunk-SZSQZ4C7.js} +3 -3
  105. package/dist/{chunk-Q52NUBN7.js → chunk-T6MAOVLH.js} +2 -2
  106. package/dist/{chunk-BXPZ6HPC.js → chunk-TCOZUCPD.js} +142 -159
  107. package/dist/{chunk-GCJT5PQ4.js → chunk-TG623HPA.js} +7 -5
  108. package/dist/{chunk-6CDXS774.js → chunk-U56LEEEA.js} +6 -6
  109. package/dist/{chunk-AT7ZY6GA.js → chunk-UT4CSUUM.js} +1 -1
  110. package/dist/{chunk-CXCOSGTO.js → chunk-V5Q245NH.js} +4 -2
  111. package/dist/chunk-VISBUD2K.js +172 -0
  112. package/dist/{chunk-KA6KVIVV.js → chunk-VYKPDMP3.js} +3 -3
  113. package/dist/{chunk-XHZ4R2MB.js → chunk-W2BQZEW6.js} +4 -4
  114. package/dist/{chunk-RD6VCI72.js → chunk-W474WFOP.js} +20 -8
  115. package/dist/{chunk-QY6U3R3W.js → chunk-X253QCYD.js} +3 -2
  116. package/dist/{chunk-6MSRPPI6.js → chunk-XT2MZWEV.js} +1 -1
  117. package/dist/{chunk-ICDMJUNE.js → chunk-XUJNQNB3.js} +1 -1
  118. package/dist/i18n/src/index.js +1 -1
  119. package/dist/i18n/src/useLocalizedString.js +1 -1
  120. package/dist/index.css +1521 -694
  121. package/dist/index.d.ts +5 -3
  122. package/dist/index.js +46 -44
  123. package/dist/inputs/src/InputGroup.css +14 -14
  124. package/dist/inputs/src/InputGroup.d.ts +2 -1
  125. package/dist/inputs/src/InputGroup.js +1 -1
  126. package/dist/inputs/src/NumberField.css +65 -62
  127. package/dist/inputs/src/NumberField.d.ts +1 -0
  128. package/dist/inputs/src/NumberField.js +18 -173
  129. package/dist/inputs/src/PasswordField.css +524 -174
  130. package/dist/inputs/src/PasswordField.d.ts +1 -0
  131. package/dist/inputs/src/PasswordField.js +9 -9
  132. package/dist/inputs/src/SearchField.css +530 -180
  133. package/dist/inputs/src/SearchField.d.ts +1 -0
  134. package/dist/inputs/src/SearchField.js +10 -10
  135. package/dist/inputs/src/TextArea.css +59 -56
  136. package/dist/inputs/src/TextArea.js +8 -8
  137. package/dist/inputs/src/TextField.css +525 -175
  138. package/dist/inputs/src/TextField.d.ts +2 -0
  139. package/dist/inputs/src/TextField.js +11 -11
  140. package/dist/inputs/src/index.css +694 -205
  141. package/dist/inputs/src/index.d.ts +2 -0
  142. package/dist/inputs/src/index.js +17 -14
  143. package/dist/overlays/Popover/src/Popover.css +1521 -694
  144. package/dist/overlays/Popover/src/Popover.js +46 -44
  145. package/dist/overlays/Popover/src/index.css +1521 -694
  146. package/dist/overlays/Popover/src/index.js +46 -44
  147. package/dist/radio/src/Radio.css +31 -31
  148. package/dist/radio/src/Radio.js +3 -3
  149. package/dist/radio/src/RadioField.css +15 -15
  150. package/dist/radio/src/RadioField.js +1 -1
  151. package/dist/radio/src/RadioGroup.css +62 -59
  152. package/dist/radio/src/RadioGroup.js +1 -1
  153. package/dist/radio/src/index.css +62 -59
  154. package/dist/radio/src/index.js +6 -6
  155. package/dist/switch/src/Switch.css +25 -25
  156. package/dist/switch/src/Switch.js +3 -3
  157. package/dist/switch/src/SwitchField.css +15 -15
  158. package/dist/switch/src/SwitchField.js +1 -1
  159. package/dist/switch/src/index.css +31 -31
  160. package/dist/switch/src/index.js +4 -4
  161. package/dist/tag/src/Tag.css +1041 -2332
  162. package/dist/tag/src/Tag.d.ts +6 -1
  163. package/dist/tag/src/Tag.js +7 -99
  164. package/dist/tag/src/TagGroup.css +24 -21
  165. package/dist/tag/src/TagGroup.d.ts +7 -2
  166. package/dist/tag/src/TagGroup.js +1 -1
  167. package/dist/tag/src/index.css +1104 -2296
  168. package/dist/tag/src/index.js +9 -94
  169. package/dist/typography/Heading/src/Heading.css +9 -9
  170. package/dist/typography/Heading/src/Heading.js +1 -1
  171. package/dist/typography/Heading/src/index.css +9 -9
  172. package/dist/typography/Heading/src/index.js +1 -1
  173. package/dist/typography/Label/src/Label.css +5 -2
  174. package/dist/typography/Label/src/Label.d.ts +8 -0
  175. package/dist/typography/Label/src/Label.js +2 -1
  176. package/dist/typography/Label/src/index.css +5 -2
  177. package/dist/typography/Label/src/index.js +2 -1
  178. package/dist/typography/OverlineText/src/OverlineText.css +6 -6
  179. package/dist/typography/OverlineText/src/OverlineText.js +1 -1
  180. package/dist/typography/OverlineText/src/index.css +6 -6
  181. package/dist/typography/OverlineText/src/index.js +1 -1
  182. package/dist/typography/Text/src/Text.css +9 -9
  183. package/dist/typography/Text/src/Text.js +1 -1
  184. package/dist/typography/Text/src/index.css +9 -9
  185. package/dist/typography/Text/src/index.js +1 -1
  186. package/dist/utils/src/index.js +1 -1
  187. package/package.json +3 -3
  188. package/dist/Chip/src/Chip.css +0 -261
  189. package/dist/Chip/src/Chip.d.ts +0 -27
  190. package/dist/Chip/src/Chip.js +0 -10
  191. package/dist/Chip/src/ChipContext.d.ts +0 -10
  192. package/dist/Chip/src/ChipContext.js +0 -2
  193. package/dist/Chip/src/index.css +0 -261
  194. package/dist/Chip/src/index.d.ts +0 -7
  195. package/dist/Chip/src/index.js +0 -10
  196. package/dist/chunk-632B5YBQ.js +0 -7
  197. package/dist/chunk-7VS566A2.js +0 -43
  198. package/dist/chunk-OETAIO6N.js +0 -105
@@ -1,142 +1,107 @@
1
1
  import { PopoverContext } from './chunk-SC6ZK5ON.js';
2
- import { TagContext } from './chunk-EWMWQ2MC.js';
3
2
  import { ContentContext } from './chunk-IXB2WK56.js';
4
3
  import { FooterContext } from './chunk-I67NHYK4.js';
4
+ import { PasswordFieldContext } from './chunk-QW45G6K4.js';
5
+ import { SearchFieldContext } from './chunk-3NKF5TPD.js';
6
+ import { TextAreaContext } from './chunk-MHQZXLKW.js';
7
+ import { TextFieldContext } from './chunk-O4XPUINW.js';
8
+ import { NumberFieldContext } from './chunk-ZQ3AWYRR.js';
5
9
  import { HeadingContext } from './chunk-TXZ6BMFR.js';
10
+ import { CheckboxFieldContext } from './chunk-ZGNK4GWA.js';
11
+ import { CheckboxGroupContext } from './chunk-N7YDPVZL.js';
6
12
  import { ButtonContext } from './chunk-WMTWFKKP.js';
7
13
  import { ButtonGroupContext } from './chunk-VJQ7M2BK.js';
8
- import { _ClearButton } from './chunk-SR3GAXY5.js';
9
- import { _Spinner } from './chunk-WAUGFWZA.js';
10
14
  import { LinkContext } from './chunk-4VVNSXIB.js';
11
15
  import { isFunction, isNil } from './chunk-TIPN4VYD.js';
12
- import { useLocalizedString } from './chunk-YEYNRBMQ.js';
16
+ import { RadioGroupContext } from './chunk-5MBJWRZD.js';
17
+ import { CheckboxContext } from './chunk-2EAZPH3M.js';
13
18
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
14
19
  import { _HopperProvider } from './chunk-NMKBUGSO.js';
15
- import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
16
- import { IconListContext } from './chunk-DHVVYSLB.js';
17
- import { BadgeContext } from './chunk-CQDLZ42T.js';
18
- import { _Text } from './chunk-6MSRPPI6.js';
19
- import { TextContext } from './chunk-X6SER3TZ.js';
20
- import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
20
+ import { FormContext } from './chunk-EURJK4ZT.js';
21
21
  import { SlotProvider } from './chunk-M36KANKC.js';
22
22
  import { cssModule } from './chunk-KVDXQMWI.js';
23
- import { IconContext } from '@hopper-ui/icons';
24
- import { useStyledSystem, useResponsiveValue, useColorSchemeContext } from '@hopper-ui/styled-system';
23
+ import { useStyledSystem, useColorSchemeContext, useResponsiveValue } from '@hopper-ui/styled-system';
25
24
  export * from '@hopper-ui/styled-system';
25
+ import clsx from 'clsx';
26
26
  import { forwardRef, useReducer, useRef, useEffect } from 'react';
27
- import { useContextProps, composeRenderProps, Tag as Tag$1, Popover as Popover$1, Dialog } from 'react-aria-components';
27
+ import { useContextProps, Popover as Popover$1, Dialog, Form as Form$1 } from 'react-aria-components';
28
28
  export { Collection } from 'react-aria-components';
29
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
30
- import clsx from 'clsx';
29
+ import { jsx } from 'react/jsx-runtime';
31
30
 
32
- // css-module:./Tag.module.css#css-module
33
- var Tag_module_default = { "hop-Tag": "Tag-module__hop-Tag___k---H", "hop-Tag--md": "Tag-module__hop-Tag--md___wMJTU", "hop-Tag__icon": "Tag-module__hop-Tag__icon___DvajY", "hop-Tag__icon-list": "Tag-module__hop-Tag__icon-list___x4CpF", "hop-Tag__badge": "Tag-module__hop-Tag__badge___3b9Gq", "hop-Tag__remove-btn": "Tag-module__hop-Tag__remove-btn___KIdVL", "hop-Tag__Spinner": "Tag-module__hop-Tag__Spinner___BOJ61", "hop-Tag--lg": "Tag-module__hop-Tag--lg___VTvaj", "hop-Tag__text": "Tag-module__hop-Tag__text___nkMOg", "hop-Badge--secondary": "Tag-module__hop-Badge--secondary___sb6Pa" };
34
- var GlobalTagCssSelector = "hop-Tag";
35
- var TagToTextSizeAdapter = {
36
- md: "xs",
37
- lg: "sm"
38
- };
39
- function Tag(props, ref) {
40
- var _a;
41
- [props, ref] = useContextProps(props, ref, TagContext);
31
+ // css-module:./Popover.module.css#css-module
32
+ var Popover_module_default = { "hop-Popover": "Popover-module__hop-Popover___nKZak", "hop-Popover__dialog": "Popover-module__hop-Popover__dialog___vnp7r", "hop-Popover__title": "Popover-module__hop-Popover__title___NazSs", "hop-Popover__actions": "Popover-module__hop-Popover__actions___VImV7", "hop-Popover__action": "Popover-module__hop-Popover__action___fsXDT", "hop-Popover__content": "Popover-module__hop-Popover__content___fZfhh", "hop-Popover__footer": "Popover-module__hop-Popover__footer___GPaEX" };
33
+ var GlobalPopoverCssSelector = "hop-Popover";
34
+ function Popover(props, ref) {
35
+ [props, ref] = useContextProps(props, ref, PopoverContext);
42
36
  const { stylingProps, ...ownProps } = useStyledSystem(props);
43
37
  const {
38
+ children,
44
39
  className,
45
- children: childrenProp,
46
- isInvalid,
47
- isLoading,
48
- size: sizeProp = "md",
49
- style: styleProp,
50
- textValue: textValueProp,
40
+ offset = 4,
41
+ boundaryOffset,
51
42
  ...otherProps
52
43
  } = ownProps;
53
- const stringFormatter = useLocalizedString();
54
- const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
55
- const textValue = textValueProp != null ? textValueProp : typeof childrenProp === "string" ? childrenProp : void 0;
56
- const classNames = composeClassnameRenderProps(
44
+ const { colorScheme } = useColorSchemeContext();
45
+ const popoverClassNames = composeClassnameRenderProps(
57
46
  className,
58
- GlobalTagCssSelector,
47
+ GlobalPopoverCssSelector,
59
48
  cssModule(
60
- Tag_module_default,
61
- "hop-Tag",
62
- size
63
- ),
64
- stylingProps.className
49
+ Popover_module_default,
50
+ "hop-Popover"
51
+ )
65
52
  );
66
- const style = composeRenderProps(styleProp, (prev) => {
67
- return {
68
- ...stylingProps.style,
69
- ...prev
70
- };
71
- });
72
- const children = composeRenderProps(childrenProp, (prev) => {
73
- if (prev && isTextOnlyChildren(prev)) {
74
- return /* @__PURE__ */ jsx(_Text, { children: prev });
75
- }
76
- return prev;
77
- });
78
53
  return /* @__PURE__ */ jsx(
79
- Tag$1,
54
+ Popover$1,
80
55
  {
81
56
  ...otherProps,
57
+ offset,
82
58
  ref,
83
- className: classNames,
84
- style,
85
- textValue,
86
- "data-invalid": isInvalid || void 0,
87
- "data-loading": isLoading || void 0,
88
- children: (tagProps) => {
89
- const { allowsRemoving, isDisabled } = tagProps;
90
- return /* @__PURE__ */ jsxs(Fragment, { children: [
91
- /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
59
+ className: popoverClassNames,
60
+ arrowBoundaryOffset: boundaryOffset,
61
+ children: (state) => /* @__PURE__ */ jsx(_HopperProvider, { colorScheme, children: /* @__PURE__ */ jsx(
62
+ Dialog,
63
+ {
64
+ className: clsx(stylingProps.className, Popover_module_default["hop-Popover__dialog"]),
65
+ style: stylingProps.style,
66
+ children: /* @__PURE__ */ jsx(
92
67
  SlotProvider,
93
68
  {
94
69
  values: [
95
- [TextContext, {
96
- className: Tag_module_default["hop-Tag__text"],
97
- size: TagToTextSizeAdapter[size]
70
+ [HeadingContext, {
71
+ className: Popover_module_default["hop-Popover__title"],
72
+ size: "xs"
73
+ }],
74
+ [ButtonContext, {
75
+ size: "sm",
76
+ className: Popover_module_default["hop-Popover__action"]
77
+ }],
78
+ [ButtonGroupContext, {
79
+ size: "sm",
80
+ align: "end",
81
+ className: Popover_module_default["hop-Popover__actions"]
98
82
  }],
99
- [IconListContext, {
100
- className: Tag_module_default["hop-Tag__icon-list"],
101
- size: "sm"
83
+ [ContentContext, {
84
+ className: Popover_module_default["hop-Popover__content"]
102
85
  }],
103
- [IconContext, {
104
- className: Tag_module_default["hop-Tag__icon"],
105
- size: "sm"
86
+ [FooterContext, {
87
+ className: Popover_module_default["hop-Popover__footer"]
106
88
  }],
107
- [BadgeContext, {
108
- className: Tag_module_default["hop-Tag__badge"],
109
- isDisabled
89
+ [LinkContext, {
90
+ size: "sm",
91
+ variant: "primary",
92
+ isQuiet: true
110
93
  }]
111
94
  ],
112
- children: children(tagProps)
113
- }
114
- ) }),
115
- allowsRemoving && !isLoading && /* @__PURE__ */ jsx(
116
- _ClearButton,
117
- {
118
- slot: "remove",
119
- isDisabled,
120
- className: Tag_module_default["hop-Tag__remove-btn"],
121
- "aria-label": stringFormatter.format("Tag.removeAriaLabel"),
122
- size
123
- }
124
- ),
125
- isLoading && /* @__PURE__ */ jsx(
126
- _Spinner,
127
- {
128
- "aria-label": stringFormatter.format("Tag.spinnerAriaLabel"),
129
- size: "sm",
130
- className: Tag_module_default["hop-Tag__Spinner"]
95
+ children: isFunction(children) && !isNil(children) ? children(state) : children
131
96
  }
132
97
  )
133
- ] });
134
- }
98
+ }
99
+ ) })
135
100
  }
136
101
  );
137
102
  }
138
- var _Tag = forwardRef(Tag);
139
- _Tag.displayName = "Tag";
103
+ var _Popover = forwardRef(Popover);
104
+ _Popover.displayName = "Popover";
140
105
  function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
141
106
  let { cursor, getKey } = opts;
142
107
  return {
@@ -547,79 +512,97 @@ function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
547
512
  };
548
513
  }
549
514
 
550
- // css-module:./Popover.module.css#css-module
551
- var Popover_module_default = { "hop-Popover": "Popover-module__hop-Popover___1SG-H", "hop-Popover__dialog": "Popover-module__hop-Popover__dialog___Smzz-", "hop-Popover__title": "Popover-module__hop-Popover__title___ZwhJ9", "hop-Popover__actions": "Popover-module__hop-Popover__actions___YGimS", "hop-Popover__action": "Popover-module__hop-Popover__action___G3Beb", "hop-Popover__content": "Popover-module__hop-Popover__content___Agt74", "hop-Popover__footer": "Popover-module__hop-Popover__footer___S49O3" };
552
- var GlobalPopoverCssSelector = "hop-Popover";
553
- function Popover(props, ref) {
554
- [props, ref] = useContextProps(props, ref, PopoverContext);
515
+ // css-module:./Form.module.css#css-module
516
+ var Form_module_default = { "hop-Form": "Form-module__hop-Form___WWA27" };
517
+ var GlobalFormCssSelector = "hop-Form";
518
+ function Form(props, ref) {
519
+ var _a;
520
+ [props, ref] = useContextProps(props, ref, FormContext);
555
521
  const { stylingProps, ...ownProps } = useStyledSystem(props);
556
522
  const {
557
- children,
558
523
  className,
559
- offset = 4,
560
- boundaryOffset,
524
+ children,
525
+ style,
526
+ isFluid,
527
+ isDisabled,
528
+ size: sizeProp,
561
529
  ...otherProps
562
530
  } = ownProps;
563
- const { colorScheme } = useColorSchemeContext();
564
- const popoverClassNames = composeClassnameRenderProps(
565
- className,
566
- GlobalPopoverCssSelector,
531
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
532
+ const classNames = clsx(
533
+ GlobalFormCssSelector,
567
534
  cssModule(
568
- Popover_module_default,
569
- "hop-Popover"
570
- )
535
+ Form_module_default,
536
+ "hop-Form"
537
+ ),
538
+ stylingProps.className,
539
+ className
571
540
  );
541
+ const mergedStyles = {
542
+ ...stylingProps.style,
543
+ ...style
544
+ };
572
545
  return /* @__PURE__ */ jsx(
573
- Popover$1,
546
+ SlotProvider,
574
547
  {
575
- ...otherProps,
576
- offset,
577
- ref,
578
- className: popoverClassNames,
579
- arrowBoundaryOffset: boundaryOffset,
580
- children: (state) => /* @__PURE__ */ jsx(_HopperProvider, { colorScheme, children: /* @__PURE__ */ jsx(
581
- Dialog,
548
+ values: [
549
+ [TextFieldContext, {
550
+ isDisabled,
551
+ isFluid,
552
+ size
553
+ }],
554
+ [PasswordFieldContext, {
555
+ isDisabled,
556
+ isFluid,
557
+ size
558
+ }],
559
+ [SearchFieldContext, {
560
+ isDisabled,
561
+ isFluid,
562
+ size
563
+ }],
564
+ [NumberFieldContext, {
565
+ isDisabled,
566
+ size,
567
+ isFluid
568
+ }],
569
+ [TextAreaContext, {
570
+ isDisabled,
571
+ size,
572
+ isFluid
573
+ }],
574
+ [RadioGroupContext, {
575
+ isDisabled,
576
+ size
577
+ }],
578
+ [CheckboxContext, {
579
+ isDisabled,
580
+ size
581
+ }],
582
+ [CheckboxFieldContext, {
583
+ isDisabled,
584
+ size
585
+ }],
586
+ [CheckboxGroupContext, {
587
+ isDisabled,
588
+ size
589
+ }],
590
+ [ButtonContext, { isDisabled, size }]
591
+ ],
592
+ children: /* @__PURE__ */ jsx(
593
+ Form$1,
582
594
  {
583
- className: clsx(stylingProps.className, Popover_module_default["hop-Popover__dialog"]),
584
- style: stylingProps.style,
585
- children: /* @__PURE__ */ jsx(
586
- SlotProvider,
587
- {
588
- values: [
589
- [HeadingContext, {
590
- className: Popover_module_default["hop-Popover__title"],
591
- size: "xs"
592
- }],
593
- [ButtonContext, {
594
- size: "sm",
595
- className: Popover_module_default["hop-Popover__action"]
596
- }],
597
- [ButtonGroupContext, {
598
- size: "sm",
599
- align: "end",
600
- className: Popover_module_default["hop-Popover__actions"]
601
- }],
602
- [ContentContext, {
603
- className: Popover_module_default["hop-Popover__content"]
604
- }],
605
- [FooterContext, {
606
- className: Popover_module_default["hop-Popover__footer"]
607
- }],
608
- [LinkContext, {
609
- size: "sm",
610
- variant: "primary",
611
- isQuiet: true
612
- }]
613
- ],
614
- children: isFunction(children) && !isNil(children) ? children(state) : children
615
- }
616
- )
595
+ ...otherProps,
596
+ ref,
597
+ className: classNames,
598
+ style: mergedStyles,
599
+ children
617
600
  }
618
- ) })
601
+ )
619
602
  }
620
603
  );
621
604
  }
622
- var _Popover = forwardRef(Popover);
623
- _Popover.displayName = "Popover";
605
+ var _Form = forwardRef(Form);
606
+ _Form.displayName = "Form";
624
607
 
625
- export { $f86e6c1ec7da6ebb$export$bc3384a35de93d66, GlobalPopoverCssSelector, GlobalTagCssSelector, _Popover, _Tag };
608
+ export { $f86e6c1ec7da6ebb$export$bc3384a35de93d66, GlobalFormCssSelector, GlobalPopoverCssSelector, _Form, _Popover };
@@ -1,8 +1,8 @@
1
1
  import { PasswordFieldContext } from './chunk-QW45G6K4.js';
2
- import { _InputGroup } from './chunk-YRUBXLBX.js';
3
- import { _EmbeddedButton } from './chunk-TGXZJJJA.js';
2
+ import { _InputGroup } from './chunk-Q63YLWI6.js';
3
+ import { _EmbeddedButton } from './chunk-5IB23E3O.js';
4
4
  import { LabelContext } from './chunk-QCA3ZR56.js';
5
- import { useLocalizedString } from './chunk-YEYNRBMQ.js';
5
+ import { useLocalizedString } from './chunk-F4H76S4H.js';
6
6
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
7
7
  import { HelperMessageContext } from './chunk-HZKFQ33E.js';
8
8
  import { ErrorMessageContext } from './chunk-FAE27DLF.js';
@@ -18,7 +18,7 @@ import { useContextProps, composeRenderProps, Input, TextField } from 'react-ari
18
18
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
19
 
20
20
  // css-module:./PasswordField.module.css#css-module
21
- var PasswordField_module_default = { "hop-PasswordField": "PasswordField-module__hop-PasswordField___K1Viz", "hop-PasswordField--fluid": "PasswordField-module__hop-PasswordField--fluid___A9xrf", "hop-PasswordField__Label": "PasswordField-module__hop-PasswordField__Label___PEh-V", "hop-PasswordField__InputGroup": "PasswordField-module__hop-PasswordField__InputGroup___-KMzA", "hop-PasswordField__ErrorMessage": "PasswordField-module__hop-PasswordField__ErrorMessage___hiN1T", "hop-PasswordField__HelperMessage": "PasswordField-module__hop-PasswordField__HelperMessage___Dc3vM" };
21
+ var PasswordField_module_default = { "hop-PasswordField": "PasswordField-module__hop-PasswordField___BZw2q", "hop-PasswordField--fluid": "PasswordField-module__hop-PasswordField--fluid___Vy6O6", "hop-PasswordField__Label": "PasswordField-module__hop-PasswordField__Label___3feE7", "hop-PasswordField__InputGroup": "PasswordField-module__hop-PasswordField__InputGroup___6fO8H", "hop-PasswordField__ErrorMessage": "PasswordField-module__hop-PasswordField__ErrorMessage___ACyog", "hop-PasswordField__HelperMessage": "PasswordField-module__hop-PasswordField__HelperMessage___xp9kN" };
22
22
  var GlobalPasswordFieldCssSelector = "hop-PasswordField";
23
23
  function PasswordField(props, ref) {
24
24
  var _a;
@@ -39,6 +39,7 @@ function PasswordField(props, ref) {
39
39
  isFluid: isFluidProp,
40
40
  isDisabled,
41
41
  isInvalid,
42
+ isRequired,
42
43
  ...otherProps
43
44
  } = ownProps;
44
45
  const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
@@ -90,7 +91,7 @@ function PasswordField(props, ref) {
90
91
  SlotProvider,
91
92
  {
92
93
  values: [
93
- [LabelContext, { className: PasswordField_module_default["hop-PasswordField__Label"] }],
94
+ [LabelContext, { className: PasswordField_module_default["hop-PasswordField__Label"], isRequired }],
94
95
  [HelperMessageContext, { className: PasswordField_module_default["hop-PasswordField__HelperMessage"] }],
95
96
  [ErrorMessageContext, { className: PasswordField_module_default["hop-PasswordField__ErrorMessage"] }]
96
97
  ],
@@ -108,6 +109,7 @@ function PasswordField(props, ref) {
108
109
  className: classNames,
109
110
  isDisabled,
110
111
  isInvalid,
112
+ isRequired,
111
113
  ...otherProps,
112
114
  children: childrenMarkup
113
115
  }
@@ -1,12 +1,12 @@
1
1
  import { useSlot } from './chunk-H5YTU3U7.js';
2
2
  import { ButtonContext } from './chunk-WMTWFKKP.js';
3
- import { _Spinner } from './chunk-WAUGFWZA.js';
4
- import { useLocalizedString } from './chunk-YEYNRBMQ.js';
5
- import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
6
- import { useRenderProps } from './chunk-NH3IVMXB.js';
3
+ import { _Spinner } from './chunk-CKKLDA5J.js';
4
+ import { useLocalizedString } from './chunk-F4H76S4H.js';
7
5
  import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
6
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
8
7
  import { IconListContext } from './chunk-DHVVYSLB.js';
9
- import { _Text } from './chunk-6MSRPPI6.js';
8
+ import { useRenderProps } from './chunk-NH3IVMXB.js';
9
+ import { _Text } from './chunk-XT2MZWEV.js';
10
10
  import { TextContext } from './chunk-X6SER3TZ.js';
11
11
  import { SlotProvider } from './chunk-M36KANKC.js';
12
12
  import { cssModule } from './chunk-KVDXQMWI.js';
@@ -19,7 +19,7 @@ import { useContextProps, ButtonContext as ButtonContext$1, composeRenderProps,
19
19
  import { jsx, jsxs } from 'react/jsx-runtime';
20
20
 
21
21
  // css-module:./Button.module.css#css-module
22
- var Button_module_default = { "hop-Button": "Button-module__hop-Button___hVNkV", "hop-Button--icon-only": "Button-module__hop-Button--icon-only___UP8Ng", "hop-Button--fluid": "Button-module__hop-Button--fluid___i-q6U", "hop-Button--sm": "Button-module__hop-Button--sm___TSOaw", "hop-Button--primary": "Button-module__hop-Button--primary___bK7ig", "hop-Button--md": "Button-module__hop-Button--md___bw44A", "hop-Button--secondary": "Button-module__hop-Button--secondary___iQ-Xg", "hop-Button--upsell": "Button-module__hop-Button--upsell___MaRoN", "hop-Button--danger": "Button-module__hop-Button--danger___vlH3V", "hop-Button--ghost-danger": "Button-module__hop-Button--ghost-danger___JaoY-", "hop-Button--ghost-secondary": "Button-module__hop-Button--ghost-secondary___JeWkk", "hop-Button--ghost-primary": "Button-module__hop-Button--ghost-primary___HBhCX", "hop-Button__Spinner": "Button-module__hop-Button__Spinner___qhpjO", "hop-Button__icon": "Button-module__hop-Button__icon___lufK8", "hop-Button__icon-list": "Button-module__hop-Button__icon-list___QNRCt", "hop-Button__text": "Button-module__hop-Button__text___MfT24", "hop-Button__end-icon": "Button-module__hop-Button__end-icon___Wx11c", "hop-Button__end-icon-list": "Button-module__hop-Button__end-icon-list___7VMeu" };
22
+ var Button_module_default = { "hop-Button": "Button-module__hop-Button___ot9lw", "hop-Button--icon-only": "Button-module__hop-Button--icon-only___i5ahP", "hop-Button--fluid": "Button-module__hop-Button--fluid___7p5MN", "hop-Button--sm": "Button-module__hop-Button--sm___8f5C7", "hop-Button--primary": "Button-module__hop-Button--primary___eGhk1", "hop-Button--md": "Button-module__hop-Button--md___Nq4Ho", "hop-Button--secondary": "Button-module__hop-Button--secondary___EK4MQ", "hop-Button--upsell": "Button-module__hop-Button--upsell___tKts9", "hop-Button--danger": "Button-module__hop-Button--danger___kCc82", "hop-Button--ghost-danger": "Button-module__hop-Button--ghost-danger___p0AWu", "hop-Button--ghost-secondary": "Button-module__hop-Button--ghost-secondary___Mh--L", "hop-Button--ghost-primary": "Button-module__hop-Button--ghost-primary___bHqEG", "hop-Button__Spinner": "Button-module__hop-Button__Spinner___pYUr5", "hop-Button__icon": "Button-module__hop-Button__icon___8a7Yy", "hop-Button__icon-list": "Button-module__hop-Button__icon-list___7KNrU", "hop-Button__text": "Button-module__hop-Button__text___a4lmJ", "hop-Button__end-icon": "Button-module__hop-Button__end-icon___oJS-s", "hop-Button__end-icon-list": "Button-module__hop-Button__end-icon-list___iyDSw" };
23
23
  var GlobalButtonCssSelector = "hop-Button";
24
24
  var additionalButtonHTMLAttributes = /* @__PURE__ */ new Set(["form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "name", "value"]);
25
25
  function useSimulatedRACButton(props, ref) {
@@ -7,7 +7,7 @@ import { useContextProps } from 'react-aria-components';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  // css-module:./ListBoxItemSkeleton.module.css#css-module
10
- var ListBoxItemSkeleton_module_default = { "hop-ListBoxItemSkeleton": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton___F7Sqr", "placeholder-shimmer": "ListBoxItemSkeleton-module__placeholder-shimmer___OFdvy", "hop-ListBoxItemSkeleton--xs": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--xs___EV-BP", "hop-ListBoxItemSkeleton--sm": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--sm___0syeJ", "hop-ListBoxItemSkeleton--md": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--md___IEB0s", "hop-ListBoxItemSkeleton--lg": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--lg___8RrK4" };
10
+ var ListBoxItemSkeleton_module_default = { "hop-ListBoxItemSkeleton": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton___wrIL3", "placeholder-shimmer": "ListBoxItemSkeleton-module__placeholder-shimmer___kPWk2", "hop-ListBoxItemSkeleton--xs": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--xs___cHo6m", "hop-ListBoxItemSkeleton--sm": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--sm___Kyk8k", "hop-ListBoxItemSkeleton--md": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--md___a5cds", "hop-ListBoxItemSkeleton--lg": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--lg___dn0c2" };
11
11
  var GlobalListBoxItemSkeletonCssSelector = "hop-ListBoxItemSkeleton";
12
12
  function ListBoxItemSkeleton(props, ref) {
13
13
  var _a;
@@ -13,7 +13,7 @@ import { useContextProps, FieldErrorContext, TagGroup as TagGroup$1 } from 'reac
13
13
  import { jsx } from 'react/jsx-runtime';
14
14
 
15
15
  // css-module:./TagGroup.module.css#css-module
16
- var TagGroup_module_default = { "hop-TagGroup": "TagGroup-module__hop-TagGroup___8bpFk", "hop-TagGroup__label": "TagGroup-module__hop-TagGroup__label___OoqBw", "hop-TagGroup__list": "TagGroup-module__hop-TagGroup__list___o5U5A", "hop-TagGroup__error-message": "TagGroup-module__hop-TagGroup__error-message___-Vy2o", "hop-TagGroup__helper-message": "TagGroup-module__hop-TagGroup__helper-message___Ys-Hl" };
16
+ var TagGroup_module_default = { "hop-TagGroup": "TagGroup-module__hop-TagGroup___nGYNE", "hop-TagGroup__label": "TagGroup-module__hop-TagGroup__label___sR56G", "hop-TagGroup__list": "TagGroup-module__hop-TagGroup__list___8M4Dw", "hop-TagGroup__error-message": "TagGroup-module__hop-TagGroup__error-message___Wzu9G", "hop-TagGroup__helper-message": "TagGroup-module__hop-TagGroup__helper-message___VOUZz" };
17
17
  var GlobalTagGroupCssSelector = "hop-TagGroup";
18
18
  function TagGroup(props, ref) {
19
19
  var _a;
@@ -25,6 +25,7 @@ function TagGroup(props, ref) {
25
25
  isInvalid = false,
26
26
  style: styleProp,
27
27
  size: sizeProp,
28
+ variant,
28
29
  ...otherProps
29
30
  } = ownProps;
30
31
  const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
@@ -55,7 +56,8 @@ function TagGroup(props, ref) {
55
56
  [TagContext, {
56
57
  className: TagGroup_module_default["hop-TagGroup__tag"],
57
58
  isInvalid,
58
- size
59
+ size,
60
+ variant
59
61
  }],
60
62
  [ErrorMessageContext, {
61
63
  className: TagGroup_module_default["hop-TagGroup__error-message"],
@@ -0,0 +1,172 @@
1
+ import { useScale } from './chunk-MTDFS4CZ.js';
2
+ import { NumberFieldContext } from './chunk-ZQ3AWYRR.js';
3
+ import { _InputGroup } from './chunk-Q63YLWI6.js';
4
+ import { LabelContext } from './chunk-QCA3ZR56.js';
5
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
6
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
7
+ import { HelperMessageContext } from './chunk-HZKFQ33E.js';
8
+ import { ErrorMessageContext } from './chunk-FAE27DLF.js';
9
+ import { _Text } from './chunk-XT2MZWEV.js';
10
+ import { TextContext } from './chunk-X6SER3TZ.js';
11
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
12
+ import { SlotProvider } from './chunk-M36KANKC.js';
13
+ import { cssModule } from './chunk-KVDXQMWI.js';
14
+ import { IconContext, AngleUpIcon, AngleDownIcon } from '@hopper-ui/icons';
15
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
16
+ import { mergeRefs } from '@react-aria/utils';
17
+ import { useControlledState } from '@react-stately/utils';
18
+ import { forwardRef, useCallback } from 'react';
19
+ import { useObjectRef } from 'react-aria';
20
+ import { useContextProps, composeRenderProps, Input, NumberField as NumberField$1, Button } from 'react-aria-components';
21
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
22
+
23
+ // css-module:./NumberField.module.css#css-module
24
+ var NumberField_module_default = { "hop-NumberField": "NumberField-module__hop-NumberField___IQHRz", "hop-NumberField--fluid": "NumberField-module__hop-NumberField--fluid___cBL6Z", "hop-NumberField--mobile": "NumberField-module__hop-NumberField--mobile___83Tka", "hop-NumberField__Label": "NumberField-module__hop-NumberField__Label___QqEtX", "hop-NumberField__prefix": "NumberField-module__hop-NumberField__prefix___zfJ4v", "hop-NumberField__InputGroup": "NumberField-module__hop-NumberField__InputGroup___rpkuJ", "hop-NumberField__ErrorMessage": "NumberField-module__hop-NumberField__ErrorMessage___isGtg", "hop-NumberField__HelperMessage": "NumberField-module__hop-NumberField__HelperMessage___7p6WZ", "hop-NumberField__stepper-button": "NumberField-module__hop-NumberField__stepper-button___ofNwv", "hop-NumberField__stepper-button--increment": "NumberField-module__hop-NumberField__stepper-button--increment___BXGLT", "hop-NumberField__stepper-button--decrement": "NumberField-module__hop-NumberField__stepper-button--decrement___vWXrK", "hop-NumberField__stepper-button--mobile": "NumberField-module__hop-NumberField__stepper-button--mobile___lZj4N", "hop-NumberField__stepper-button__icon": "NumberField-module__hop-NumberField__stepper-button__icon___-KSsu", "hop-NumberField__input": "NumberField-module__hop-NumberField__input___lQVE0" };
25
+ var GlobalNumberFieldCssSelector = "hop-NumberField";
26
+ var StepperButton = ({ direction }) => {
27
+ const scale = useScale();
28
+ const isMobile = scale === "large";
29
+ const StepperIcon = direction === "increment" ? AngleUpIcon : AngleDownIcon;
30
+ const stepperClasses = cssModule(
31
+ NumberField_module_default,
32
+ "hop-NumberField__stepper-button",
33
+ direction,
34
+ isMobile && "mobile"
35
+ );
36
+ return /* @__PURE__ */ jsx(
37
+ Button,
38
+ {
39
+ className: stepperClasses,
40
+ slot: direction,
41
+ children: /* @__PURE__ */ jsx(
42
+ StepperIcon,
43
+ {
44
+ className: NumberField_module_default["hop-NumberField__stepper-button__icon"],
45
+ size: {
46
+ base: "md",
47
+ xs: "sm"
48
+ }
49
+ }
50
+ )
51
+ }
52
+ );
53
+ };
54
+ function NumberField(props, ref) {
55
+ var _a;
56
+ const {
57
+ inputRef: userProvidedInputRef = null,
58
+ ...propsWithoutRef
59
+ } = props;
60
+ [props, ref] = useContextProps(propsWithoutRef, ref, NumberFieldContext);
61
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
62
+ const {
63
+ className,
64
+ style: styleProp,
65
+ size,
66
+ prefix,
67
+ placeholder,
68
+ onChange: onChangeProp,
69
+ children,
70
+ defaultValue,
71
+ value: valueProp,
72
+ isFluid: isFluidProp,
73
+ isDisabled,
74
+ isInvalid,
75
+ isRequired,
76
+ ...otherProps
77
+ } = ownProps;
78
+ const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
79
+ const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
80
+ const scale = useScale();
81
+ const isMobile = scale === "large";
82
+ const classNames = composeClassnameRenderProps(
83
+ className,
84
+ GlobalNumberFieldCssSelector,
85
+ cssModule(
86
+ NumberField_module_default,
87
+ "hop-NumberField",
88
+ isFluid && "fluid",
89
+ isMobile && "mobile"
90
+ ),
91
+ stylingProps.className
92
+ );
93
+ const style = composeRenderProps(styleProp, (prev) => {
94
+ return {
95
+ ...stylingProps.style,
96
+ ...prev
97
+ };
98
+ });
99
+ const handleTextChanged = useCallback((value2) => {
100
+ onChangeProp == null ? void 0 : onChangeProp(value2);
101
+ }, [onChangeProp]);
102
+ const [value, onChange] = useControlledState(valueProp, defaultValue || 0, handleTextChanged);
103
+ const prefixMarkup = prefix ? /* @__PURE__ */ jsx(
104
+ SlotProvider,
105
+ {
106
+ values: [
107
+ [TextContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }],
108
+ [IconContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }]
109
+ ],
110
+ children: isTextOnlyChildren(prefix) ? /* @__PURE__ */ jsx(_Text, { children: prefix }) : prefix
111
+ }
112
+ ) : null;
113
+ const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
114
+ _InputGroup,
115
+ {
116
+ isFluid,
117
+ size,
118
+ className: NumberField_module_default["hop-NumberField__InputGroup"],
119
+ isDisabled,
120
+ isInvalid,
121
+ inputClassName: NumberField_module_default["hop-NumberField__input"],
122
+ inputType: "number",
123
+ children: [
124
+ prefixMarkup,
125
+ /* @__PURE__ */ jsx(
126
+ Input,
127
+ {
128
+ ref: inputRef,
129
+ placeholder
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsx(StepperButton, { direction: "increment" }),
133
+ /* @__PURE__ */ jsx(StepperButton, { direction: "decrement" })
134
+ ]
135
+ }
136
+ ) });
137
+ const childrenMarkup = composeRenderProps(children, (prev) => {
138
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
139
+ /* @__PURE__ */ jsx(
140
+ SlotProvider,
141
+ {
142
+ values: [
143
+ [LabelContext, { className: NumberField_module_default["hop-NumberField__Label"], isRequired }],
144
+ [HelperMessageContext, { className: NumberField_module_default["hop-NumberField__HelperMessage"] }],
145
+ [ErrorMessageContext, { className: NumberField_module_default["hop-NumberField__ErrorMessage"] }]
146
+ ],
147
+ children: prev
148
+ }
149
+ ),
150
+ inputMarkup
151
+ ] });
152
+ });
153
+ return /* @__PURE__ */ jsx(
154
+ NumberField$1,
155
+ {
156
+ ref,
157
+ value,
158
+ style,
159
+ className: classNames,
160
+ onChange,
161
+ isDisabled,
162
+ isInvalid,
163
+ isRequired,
164
+ ...otherProps,
165
+ children: childrenMarkup
166
+ }
167
+ );
168
+ }
169
+ var _NumberField = forwardRef(NumberField);
170
+ _NumberField.displayName = "NumberField";
171
+
172
+ export { GlobalNumberFieldCssSelector, _NumberField };