@algolia/satellite 2.3.0-rc.1 → 2.3.0-rc.11

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 (210) hide show
  1. package/dist/cjs/Actions/Button/PolymorphicButton.js +5 -5
  2. package/dist/cjs/Actions/Button/PolymorphicIconButton.js +2 -2
  3. package/dist/cjs/Actions/Button/styles.d.ts +1 -0
  4. package/dist/cjs/Actions/Button/styles.js +15 -10
  5. package/dist/cjs/Actions/ButtonLink/ButtonLink.d.ts +2 -0
  6. package/dist/cjs/Actions/ButtonLink/ButtonLink.js +4 -2
  7. package/dist/cjs/Actions/SegmentedControl/SegmentedControl.js +3 -2
  8. package/dist/cjs/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
  9. package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.js +3 -3
  10. package/dist/cjs/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
  11. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  12. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
  13. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +20 -1
  14. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
  15. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
  16. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
  17. package/dist/{esm/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → cjs/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
  18. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +20 -14
  19. package/dist/{esm/Layout → cjs}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
  20. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +9 -4
  21. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  22. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
  23. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
  24. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
  25. package/dist/{esm/Layout → cjs}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
  26. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +3 -3
  27. package/dist/cjs/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  28. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +64 -23
  29. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
  30. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
  31. package/dist/cjs/Chat/ChatMessages/useLastMessageHeight.d.ts +14 -0
  32. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +21 -14
  33. package/dist/{esm/Layout → cjs}/Chat/ChatPrompt/ChatPrompt.d.ts +34 -12
  34. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +46 -19
  35. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  36. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +11 -4
  37. package/dist/cjs/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  38. package/dist/cjs/Chat/ChatPrompt/useFocusTyping.js +65 -0
  39. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
  40. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
  41. package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +2 -2
  42. package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
  43. package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
  44. package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
  45. package/dist/cjs/Fields/Input/Input.js +10 -13
  46. package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
  47. package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  48. package/dist/cjs/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
  49. package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
  50. package/dist/cjs/Fields/Select/Select.tailwind.js +4 -3
  51. package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  52. package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
  53. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  54. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
  55. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  56. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
  57. package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
  58. package/dist/cjs/Fields/SelectableCard/index.js +27 -0
  59. package/dist/cjs/Fields/Switch/Switch.js +1 -1
  60. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  61. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  62. package/dist/cjs/Fields/index.d.ts +1 -0
  63. package/dist/cjs/Fields/index.js +11 -0
  64. package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.d.ts +15 -0
  65. package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.js +29 -0
  66. package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.tailwind.d.ts +5 -0
  67. package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.tailwind.js +138 -0
  68. package/dist/cjs/Helpers/MarkdownContent/index.d.ts +1 -0
  69. package/dist/cjs/Helpers/MarkdownContent/index.js +16 -0
  70. package/dist/cjs/Helpers/ShimmerText/ShimmerText.tailwind.js +1 -1
  71. package/dist/cjs/Helpers/index.d.ts +1 -0
  72. package/dist/cjs/Helpers/index.js +11 -0
  73. package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
  74. package/dist/cjs/Layout/index.d.ts +0 -1
  75. package/dist/cjs/Layout/index.js +0 -11
  76. package/dist/cjs/Navigation/Link/Link.d.ts +10 -0
  77. package/dist/cjs/Navigation/Link/Link.js +4 -2
  78. package/dist/cjs/Satellite/locale.d.ts +3 -3
  79. package/dist/cjs/index.d.ts +1 -0
  80. package/dist/cjs/index.js +12 -0
  81. package/dist/cjs/styles/helpers/tv.d.ts +5 -1
  82. package/dist/cjs/styles/tailwind.config.js +1 -1
  83. package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
  84. package/dist/esm/Actions/Button/PolymorphicButton.js +6 -6
  85. package/dist/esm/Actions/Button/PolymorphicIconButton.js +2 -2
  86. package/dist/esm/Actions/Button/styles.d.ts +1 -0
  87. package/dist/esm/Actions/Button/styles.js +14 -9
  88. package/dist/esm/Actions/ButtonLink/ButtonLink.d.ts +2 -0
  89. package/dist/esm/Actions/ButtonLink/ButtonLink.js +4 -2
  90. package/dist/esm/Actions/SegmentedControl/SegmentedControl.js +3 -2
  91. package/dist/esm/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
  92. package/dist/esm/Actions/ToggleButton/ToggleButtonBase.js +4 -4
  93. package/dist/esm/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
  94. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  95. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
  96. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +20 -1
  97. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
  98. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
  99. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
  100. package/dist/{cjs/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → esm/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
  101. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +20 -14
  102. package/dist/{cjs/Layout → esm}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
  103. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
  104. package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  105. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
  106. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
  107. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
  108. package/dist/{cjs/Layout → esm}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
  109. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +3 -3
  110. package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  111. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +64 -25
  112. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
  113. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
  114. package/dist/esm/Chat/ChatMessages/useLastMessageHeight.d.ts +14 -0
  115. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +22 -15
  116. package/dist/{cjs/Layout → esm}/Chat/ChatPrompt/ChatPrompt.d.ts +34 -12
  117. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +47 -19
  118. package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  119. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +11 -4
  120. package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  121. package/dist/esm/Chat/ChatPrompt/useFocusTyping.js +59 -0
  122. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
  123. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
  124. package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
  125. package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
  126. package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
  127. package/dist/esm/Fields/Form/stories/Complex.js +123 -50
  128. package/dist/esm/Fields/Input/Input.js +10 -13
  129. package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
  130. package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  131. package/dist/esm/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
  132. package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
  133. package/dist/esm/Fields/Select/Select.tailwind.js +4 -3
  134. package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  135. package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
  136. package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  137. package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
  138. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  139. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
  140. package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
  141. package/dist/esm/Fields/SelectableCard/index.js +2 -0
  142. package/dist/esm/Fields/Switch/Switch.js +1 -1
  143. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  144. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  145. package/dist/esm/Fields/index.d.ts +1 -0
  146. package/dist/esm/Fields/index.js +1 -0
  147. package/dist/esm/Helpers/MarkdownContent/MarkdownContent.d.ts +15 -0
  148. package/dist/esm/Helpers/MarkdownContent/MarkdownContent.js +22 -0
  149. package/dist/esm/Helpers/MarkdownContent/MarkdownContent.tailwind.d.ts +5 -0
  150. package/dist/esm/Helpers/MarkdownContent/MarkdownContent.tailwind.js +138 -0
  151. package/dist/esm/Helpers/MarkdownContent/index.d.ts +1 -0
  152. package/dist/esm/Helpers/MarkdownContent/index.js +1 -0
  153. package/dist/esm/Helpers/ShimmerText/ShimmerText.tailwind.js +1 -1
  154. package/dist/esm/Helpers/index.d.ts +1 -0
  155. package/dist/esm/Helpers/index.js +2 -1
  156. package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
  157. package/dist/esm/Layout/index.d.ts +0 -1
  158. package/dist/esm/Layout/index.js +0 -1
  159. package/dist/esm/Navigation/Link/Link.d.ts +10 -0
  160. package/dist/esm/Navigation/Link/Link.js +4 -2
  161. package/dist/esm/Satellite/locale.d.ts +3 -3
  162. package/dist/esm/index.d.ts +1 -0
  163. package/dist/esm/index.js +1 -0
  164. package/dist/esm/styles/helpers/tv.d.ts +5 -1
  165. package/dist/esm/styles/tailwind.config.js +1 -1
  166. package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
  167. package/dist/satellite.min.css +1 -1
  168. package/package.json +5 -4
  169. package/dist/cjs/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  170. package/dist/cjs/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  171. package/dist/cjs/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -42
  172. package/dist/cjs/Layout/Chat/ChatMessages/useLastMessageHeight.d.ts +0 -10
  173. package/dist/cjs/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  174. package/dist/esm/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  175. package/dist/esm/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  176. package/dist/esm/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -42
  177. package/dist/esm/Layout/Chat/ChatMessages/useLastMessageHeight.d.ts +0 -10
  178. package/dist/esm/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  179. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  180. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  181. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  182. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  183. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  184. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  185. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  186. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  187. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  188. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  189. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  190. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  191. /package/dist/cjs/{Layout/Chat → Chat}/index.d.ts +0 -0
  192. /package/dist/cjs/{Layout/Chat → Chat}/index.js +0 -0
  193. /package/dist/cjs/{Layout/Chat → Chat}/types.d.ts +0 -0
  194. /package/dist/cjs/{Layout/Chat → Chat}/types.js +0 -0
  195. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  196. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  197. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  198. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  199. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  200. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  201. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  202. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  203. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  204. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  205. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  206. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  207. /package/dist/esm/{Layout/Chat → Chat}/index.d.ts +0 -0
  208. /package/dist/esm/{Layout/Chat → Chat}/index.js +0 -0
  209. /package/dist/esm/{Layout/Chat → Chat}/types.d.ts +0 -0
  210. /package/dist/esm/{Layout/Chat → Chat}/types.js +0 -0
@@ -1,13 +1,14 @@
1
1
  import type { FormEvent, KeyboardEvent, ReactNode } from "react";
2
- import type { TextAreaProps } from "../../../Fields";
3
- import type { ChatStatus } from "../../../Layout/Chat/types";
2
+ import type { ChatStatus } from "../../Chat/types";
3
+ import type { TextAreaAutoSizeProps } from "../../Fields/TextAreaAutoSize/TextAreaAutoSize";
4
4
  export declare type ChatPromptLocale = {
5
5
  textareaLabel?: string;
6
6
  emptyMessageTooltip?: string;
7
7
  stopResponseTooltip?: string;
8
8
  sendMessageTooltip?: string;
9
+ disabledTooltip?: string;
9
10
  };
10
- export declare type ChatPromptProps = Omit<TextAreaProps, "onSubmit"> & {
11
+ export declare type ChatPromptProps = Omit<TextAreaAutoSizeProps, "onSubmit"> & {
11
12
  /**
12
13
  * Content to render above the textarea (e.g., a title or instructions).
13
14
  */
@@ -30,6 +31,18 @@ export declare type ChatPromptProps = Omit<TextAreaProps, "onSubmit"> & {
30
31
  * - "error": An error occurred during the API request, preventing successful completion.
31
32
  */
32
33
  status?: ChatStatus;
34
+ /**
35
+ * Whether to automatically focus the textarea when the user starts typing.
36
+ */
37
+ autoFocusOnTyping?: boolean;
38
+ /**
39
+ * Whether to enable right-to-left (RTL) layout support.
40
+ */
41
+ rtl?: boolean;
42
+ /**
43
+ * Optional locale.
44
+ */
45
+ locale?: ChatPromptLocale;
33
46
  /**
34
47
  * Callback invoked when the user submits the form, either by clicking
35
48
  * the submit button or pressing Enter (without Shift) inside the textarea.
@@ -39,12 +52,13 @@ export declare type ChatPromptProps = Omit<TextAreaProps, "onSubmit"> & {
39
52
  * Callback invoked when the user requests to stop the current chat response stream.
40
53
  */
41
54
  onStop?: () => void;
42
- /**
43
- * Optional locale.
44
- */
45
- locale?: ChatPromptLocale;
46
55
  };
47
- export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<TextAreaProps, "onSubmit"> & {
56
+ /**
57
+ * The `ChatPrompt` component provides a textarea for users to type messages and a button to submit them.
58
+ *
59
+ * See the [ChatPrompt documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-prompt) for more information.
60
+ */
61
+ export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<TextAreaAutoSizeProps, "onSubmit"> & {
48
62
  /**
49
63
  * Content to render above the textarea (e.g., a title or instructions).
50
64
  */
@@ -67,6 +81,18 @@ export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<
67
81
  * - "error": An error occurred during the API request, preventing successful completion.
68
82
  */
69
83
  status?: ChatStatus | undefined;
84
+ /**
85
+ * Whether to automatically focus the textarea when the user starts typing.
86
+ */
87
+ autoFocusOnTyping?: boolean | undefined;
88
+ /**
89
+ * Whether to enable right-to-left (RTL) layout support.
90
+ */
91
+ rtl?: boolean | undefined;
92
+ /**
93
+ * Optional locale.
94
+ */
95
+ locale?: ChatPromptLocale | undefined;
70
96
  /**
71
97
  * Callback invoked when the user submits the form, either by clicking
72
98
  * the submit button or pressing Enter (without Shift) inside the textarea.
@@ -76,8 +102,4 @@ export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<
76
102
  * Callback invoked when the user requests to stop the current chat response stream.
77
103
  */
78
104
  onStop?: (() => void) | undefined;
79
- /**
80
- * Optional locale.
81
- */
82
- locale?: ChatPromptLocale | undefined;
83
105
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -8,24 +8,32 @@ exports.ChatPrompt = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _lucideReact = require("lucide-react");
12
11
  var _react = require("react");
13
12
  var _ChatPrompt = require("./ChatPrompt.styles");
13
+ var _useFocusTyping = require("./useFocusTyping");
14
14
  var _useTypewriter = require("./useTypewriter");
15
- var _Actions = require("./../../../Actions");
16
- var _TextAreaAutoSize = require("./../../../Fields/TextAreaAutoSize/TextAreaAutoSize");
17
- var _Satellite = require("./../../../Satellite");
18
- var _mergeRefs = require("./../../../utils/mergeRefs");
15
+ var _Actions = require("./../../Actions");
16
+ var _TextAreaAutoSize = require("./../../Fields/TextAreaAutoSize/TextAreaAutoSize");
17
+ var _Icons = require("./../../Icons");
18
+ var _Satellite = require("./../../Satellite");
19
+ var _utils = require("./../../utils");
20
+ var _mergeRefs = require("./../../utils/mergeRefs");
19
21
  var _jsxRuntime = require("react/jsx-runtime");
20
- var _excluded = ["className", "renderHeader", "children", "renderFooter", "onSubmit", "onStop", "placeholder", "placeholders", "status", "defaultValue", "value", "locale"];
22
+ var _excluded = ["className", "renderHeader", "children", "renderFooter", "onSubmit", "onStop", "placeholder", "placeholders", "status", "autoFocusOnTyping", "rtl", "defaultValue", "value", "locale", "id"];
21
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
25
  var DEFAULT_CHAT_PROMPT_LOCALE = {
24
26
  textareaLabel: "Type your message...",
25
27
  emptyMessageTooltip: "Message is empty",
26
28
  stopResponseTooltip: "Stop response",
27
- sendMessageTooltip: "Send message"
29
+ sendMessageTooltip: "Send message",
30
+ disabledTooltip: "Chat prompt is disabled"
28
31
  };
32
+ /**
33
+ * The `ChatPrompt` component provides a textarea for users to type messages and a button to submit them.
34
+ *
35
+ * See the [ChatPrompt documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-prompt) for more information.
36
+ */
29
37
  var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, forwardedRef) {
30
38
  var _ref2;
31
39
  var className = _ref.className,
@@ -39,14 +47,27 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
39
47
  placeholders = _ref$placeholders === void 0 ? [] : _ref$placeholders,
40
48
  _ref$status = _ref.status,
41
49
  status = _ref$status === void 0 ? "ready" : _ref$status,
50
+ _ref$autoFocusOnTypin = _ref.autoFocusOnTyping,
51
+ autoFocusOnTyping = _ref$autoFocusOnTypin === void 0 ? false : _ref$autoFocusOnTypin,
52
+ _ref$rtl = _ref.rtl,
53
+ rtl = _ref$rtl === void 0 ? false : _ref$rtl,
42
54
  defaultValue = _ref.defaultValue,
43
55
  valueProp = _ref.value,
44
56
  propsLocale = _ref.locale,
57
+ propId = _ref.id,
45
58
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
46
59
  var contextLocale = (0, _Satellite.useLocale)("chatPrompt");
47
60
  var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CHAT_PROMPT_LOCALE), contextLocale), propsLocale);
61
+
62
+ // eslint-disable-next-line @algolia/stl/prefer-stl-helper
63
+ var generatedId = (0, _react.useMemo)(function () {
64
+ return (0, _utils.uniqueId)("stl-chat-prompt-");
65
+ }, []);
66
+ var textareaId = propId !== null && propId !== void 0 ? propId : generatedId;
48
67
  var internalRef = (0, _react.useRef)(null);
49
- var styles = (0, _ChatPrompt.chatPromptStyles)();
68
+ var styles = (0, _ChatPrompt.chatPromptStyles)({
69
+ disabled: props.disabled
70
+ });
50
71
  var _useState = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : ""),
51
72
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
52
73
  internalValue = _useState2[0],
@@ -58,9 +79,17 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
58
79
  var buttonDisabled = !hasValue && !canStop;
59
80
  var dynamicPlaceholder = (0, _useTypewriter.useTypewriter)(placeholders, !hasValue);
60
81
  var computedPlaceholder = placeholders.length > 0 ? dynamicPlaceholder : staticPlaceholder;
82
+ (0, _useFocusTyping.useFocusOnTyping)(internalRef, {
83
+ enabled: autoFocusOnTyping,
84
+ strictChars: true
85
+ });
61
86
  var submit = function submit(e) {
62
87
  e.preventDefault();
63
- if (!hasValue || canStop) {
88
+ if (canStop) {
89
+ onStop === null || onStop === void 0 || onStop();
90
+ return;
91
+ }
92
+ if (!hasValue) {
64
93
  return;
65
94
  }
66
95
  onSubmit === null || onSubmit === void 0 || onSubmit(e);
@@ -68,6 +97,7 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
68
97
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
69
98
  className: styles.base(),
70
99
  onSubmit: submit,
100
+ dir: rtl ? "rtl" : "ltr",
71
101
  children: [!!renderHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
102
  className: styles.header(),
73
103
  children: renderHeader
@@ -79,6 +109,7 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
79
109
  (_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 || _internalRef$current.focus();
80
110
  },
81
111
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextAreaAutoSize.TextAreaAutoSize, _objectSpread(_objectSpread({
112
+ id: textareaId,
82
113
  ref: (0, _mergeRefs.mergeRefs)([forwardedRef, internalRef]),
83
114
  rows: 2,
84
115
  maxRows: 8,
@@ -86,6 +117,7 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
86
117
  value: value,
87
118
  "aria-label": (_ref2 = placeholders[0] ? placeholders[0] : staticPlaceholder) !== null && _ref2 !== void 0 ? _ref2 : locale.textareaLabel,
88
119
  translate: "no",
120
+ autoComplete: "off",
89
121
  onInput: function onInput(e) {
90
122
  var _props$onInput;
91
123
  if (!isControlled) {
@@ -110,20 +142,15 @@ var ChatPrompt = exports.ChatPrompt = /*#__PURE__*/(0, _react.forwardRef)(functi
110
142
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
111
143
  className: styles.actions(),
112
144
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Actions.IconButton, {
113
- type: status === "ready" ? "submit" : undefined,
114
- onClick: function onClick(e) {
115
- if (canStop) {
116
- e.preventDefault();
117
- onStop === null || onStop === void 0 || onStop();
118
- }
119
- },
120
- icon: canStop ? _lucideReact.CircleStopIcon : _lucideReact.ArrowUpIcon,
145
+ type: "submit",
146
+ icon: canStop ? _Icons.StopCircleIcon : _Icons.ArrowUpIcon,
121
147
  variant: canStop ? "neutral" : "primary",
122
148
  size: "small",
123
- title: buttonDisabled ? locale.emptyMessageTooltip : canStop ? locale.stopResponseTooltip : locale.sendMessageTooltip,
149
+ title: props.disabled ? locale.disabledTooltip : buttonDisabled ? locale.emptyMessageTooltip : canStop ? locale.stopResponseTooltip : locale.sendMessageTooltip,
124
150
  tooltipSide: "top",
125
151
  disabled: buttonDisabled,
126
- className: styles.submit()
152
+ className: styles.submit(),
153
+ "data-status": status
127
154
  })
128
155
  })
129
156
  }))
@@ -0,0 +1,63 @@
1
+ export declare const chatPromptStyles: import("tailwind-variants").TVReturnType<{
2
+ disabled: {
3
+ true: {
4
+ actions: string;
5
+ };
6
+ };
7
+ }, {
8
+ base: string;
9
+ header: string;
10
+ body: string;
11
+ textarea: string;
12
+ actions: string;
13
+ submit: string;
14
+ footer: string;
15
+ }, undefined, {
16
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
17
+ disabled?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
18
+ } | undefined;
19
+ } & import("tailwind-variants/dist/config").TWMConfig & {
20
+ twMergeConfig: {
21
+ prefix: string;
22
+ };
23
+ }, {
24
+ disabled: {
25
+ true: {
26
+ actions: string;
27
+ };
28
+ };
29
+ }, {
30
+ base: string;
31
+ header: string;
32
+ body: string;
33
+ textarea: string;
34
+ actions: string;
35
+ submit: string;
36
+ footer: string;
37
+ }, import("tailwind-variants").TVReturnType<{
38
+ disabled: {
39
+ true: {
40
+ actions: string;
41
+ };
42
+ };
43
+ }, {
44
+ base: string;
45
+ header: string;
46
+ body: string;
47
+ textarea: string;
48
+ actions: string;
49
+ submit: string;
50
+ footer: string;
51
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
52
+ disabled: {
53
+ true: {
54
+ actions: string;
55
+ };
56
+ };
57
+ }, {
58
+ disabled: {
59
+ true: {
60
+ actions: string;
61
+ };
62
+ };
63
+ }>, unknown, unknown, undefined>>;
@@ -6,17 +6,24 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.chatPromptStyles = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _satellitePrefixer = _interopRequireDefault(require("./../../../styles/helpers/satellitePrefixer"));
10
- var _tv = require("./../../../styles/helpers/tv");
11
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
9
+ var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
10
+ var _tv = require("./../../styles/helpers/tv");
11
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
12
12
  var chatPromptStyles = exports.chatPromptStyles = (0, _tv.tv)({
13
13
  slots: {
14
14
  base: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["relative flex flex-col items-stretch gap-2 w-full"]))),
15
15
  header: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-1.5"]))),
16
16
  body: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""]))),
17
17
  textarea: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["[&>textarea]:p-3 [&>textarea]:pb-0 [&>textarea]:thin-scrollbar"]))),
18
- actions: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["flex flex-row p-3 pt-2 justify-end"]))),
18
+ actions: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["flex flex-row p-3 pt-2 justify-end cursor-text"]))),
19
19
  submit: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])([""]))),
20
20
  footer: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["flex items-center justify-between gap-1.5"])))
21
+ },
22
+ variants: {
23
+ disabled: {
24
+ "true": {
25
+ actions: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100 cursor-not-allowed"])))
26
+ }
27
+ }
21
28
  }
22
29
  });
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Check if the element is a textual element.
4
+ * @param el - The element to check.
5
+ * @returns True if the element is a textual element, false otherwise.
6
+ */
7
+ export declare const isTextualElement: (el: HTMLElement) => boolean;
8
+ declare type Editable = HTMLTextAreaElement | HTMLInputElement | HTMLElement;
9
+ export interface UseFocusOnTypingOptions {
10
+ /**
11
+ * Whether the hook is enabled.
12
+ * @default true
13
+ */
14
+ enabled?: boolean;
15
+ /**
16
+ * Whether to allow punctuation, diacritics, etc.
17
+ * @default false
18
+ */
19
+ strictChars?: boolean;
20
+ }
21
+ /**
22
+ * Focus `editableRef` the moment the user types anywhere on the page,
23
+ * *unless* their cursor is already inside an editable control.
24
+ * @param editableRef - The ref to the editable element.
25
+ * @param options - The options for the hook.
26
+ * @param options.enabled - Whether the hook is enabled.
27
+ * @param options.strictChars - Whether to allow punctuation, diacritics, etc.
28
+ */
29
+ export declare function useFocusOnTyping<E extends Editable = Editable>(editableRef: React.RefObject<E>, options?: UseFocusOnTypingOptions): void;
30
+ export {};
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isTextualElement = void 0;
7
+ exports.useFocusOnTyping = useFocusOnTyping;
8
+ var _react = require("react");
9
+ /**
10
+ * Check if the element is a textual element.
11
+ * @param el - The element to check.
12
+ * @returns True if the element is a textual element, false otherwise.
13
+ */
14
+ var isTextualElement = exports.isTextualElement = function isTextualElement(el) {
15
+ if (el.isContentEditable) return true;
16
+ var tag = el.tagName.toUpperCase();
17
+ if (tag === "TEXTAREA") return true;
18
+ if (tag === "INPUT") {
19
+ var t = el.type.toLowerCase();
20
+ return ["text", "search", "url", "email", "tel", "password", "number", "date", "datetime-local", "month", "week", "time"].includes(t);
21
+ }
22
+ return false;
23
+ };
24
+
25
+ // e.g. <div contentEditable>
26
+
27
+ /**
28
+ * Focus `editableRef` the moment the user types anywhere on the page,
29
+ * *unless* their cursor is already inside an editable control.
30
+ * @param editableRef - The ref to the editable element.
31
+ * @param options - The options for the hook.
32
+ * @param options.enabled - Whether the hook is enabled.
33
+ * @param options.strictChars - Whether to allow punctuation, diacritics, etc.
34
+ */
35
+ function useFocusOnTyping(editableRef) {
36
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
+ var _options$enabled = options.enabled,
38
+ enabled = _options$enabled === void 0 ? true : _options$enabled,
39
+ _options$strictChars = options.strictChars,
40
+ strictChars = _options$strictChars === void 0 ? false : _options$strictChars;
41
+ var handleKeyDown = (0, _react.useCallback)(function (e) {
42
+ if (!enabled || e.ctrlKey || e.altKey || e.metaKey || e.isComposing || e.repeat || (
43
+ // Printable-character test
44
+ strictChars ? !/^[A-Za-z0-9]$/.test(e.key) : e.key.length !== 1)) {
45
+ return;
46
+ }
47
+ var node = editableRef.current;
48
+ if (!node) return;
49
+ if (node.contains(document.activeElement)) return;
50
+ var el = e.target;
51
+ if (!el || !isTextualElement(el)) {
52
+ node.focus();
53
+ }
54
+ }, [enabled, strictChars, editableRef]);
55
+ (0, _react.useEffect)(function () {
56
+ if (typeof window === "undefined") return; // SSR/test guard
57
+
58
+ window.addEventListener("keydown", handleKeyDown, {
59
+ passive: true
60
+ });
61
+ return function () {
62
+ return window.removeEventListener("keydown", handleKeyDown);
63
+ };
64
+ }, [handleKeyDown]);
65
+ }
@@ -15,4 +15,13 @@ export interface UseTypewriterOptions {
15
15
  */
16
16
  pauseDuration?: number;
17
17
  }
18
+ /**
19
+ * A hook that types out a list of texts character by character.
20
+ * @param texts - The list of texts to type out.
21
+ * @param enabled - Whether the hook is enabled.
22
+ * @param options - The options for the hook.
23
+ * @param options.typingSpeed - The speed at which to type out the text.
24
+ * @param options.deletingSpeed - The speed at which to delete the text.
25
+ * @param options.pauseDuration - The duration to pause after typing a full word before deleting.
26
+ */
18
27
  export declare function useTypewriter(texts: string[], enabled?: boolean, options?: UseTypewriterOptions): string;
@@ -7,6 +7,15 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.useTypewriter = useTypewriter;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = require("react");
10
+ /**
11
+ * A hook that types out a list of texts character by character.
12
+ * @param texts - The list of texts to type out.
13
+ * @param enabled - Whether the hook is enabled.
14
+ * @param options - The options for the hook.
15
+ * @param options.typingSpeed - The speed at which to type out the text.
16
+ * @param options.deletingSpeed - The speed at which to delete the text.
17
+ * @param options.pauseDuration - The duration to pause after typing a full word before deleting.
18
+ */
10
19
  function useTypewriter(texts) {
11
20
  var enabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12
21
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -15,12 +15,12 @@ declare type CheckboxCustomProps = {
15
15
  */
16
16
  checkedColor?: string;
17
17
  };
18
- declare type CheckboxInputProps = Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "required" | "autoFocus" | "disabled" | "checked" | "defaultChecked">;
18
+ declare type CheckboxInputProps = Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "required" | "autoFocus" | "disabled" | "checked" | "defaultChecked" | "name">;
19
19
  export declare type CheckboxProps = CheckboxInputProps & CheckboxCustomProps;
20
20
  /**
21
21
  * The `Checkbox` component is a control that allows single or multiple selections from a set of options.
22
22
  *
23
23
  * See the [Checkbox documentation page](https://satellite.algolia.com/8261d6576/p/023233-checkbox) for more information.
24
24
  */
25
- export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultChecked" | "autoFocus" | "disabled" | "checked" | "required"> & CheckboxCustomProps & import("react").RefAttributes<HTMLInputElement>>;
25
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLInputElement>, "onChange"> & Pick<InputHTMLAttributes<HTMLInputElement>, "name" | "onChange" | "defaultChecked" | "autoFocus" | "disabled" | "checked" | "required"> & CheckboxCustomProps & import("react").RefAttributes<HTMLInputElement>>;
26
26
  export {};
@@ -73,7 +73,7 @@ var Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (
73
73
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
74
74
  className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["group/checkbox inline-flex items-center ", ""])), textPosition === "left" && "flex-row-reverse"), className),
75
75
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
76
- className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n checkbox focusable-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
76
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n checkbox focusable-visible-within\n ", "\n ", "\n ", "\n "])), indeterminate && "checkbox-indeterminate", isChecked && "checkbox-checked", disabled && "checkbox-disabled"), STATUS_CLASSNAMES[status]),
77
77
  style: {
78
78
  color: checkedColor
79
79
  },
@@ -83,7 +83,7 @@ var Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (
83
83
  "aria-labelledby": labelId,
84
84
  "aria-describedby": descriptionId
85
85
  }, checkboxProps), {}, {
86
- id: id !== null && id !== void 0 ? id : inputId,
86
+ id: id,
87
87
  required: required,
88
88
  "aria-invalid": status === "invalid",
89
89
  "aria-checked": indeterminate ? "mixed" : isChecked,
@@ -142,7 +142,7 @@ var Dropzone = exports.Dropzone = /*#__PURE__*/(0, _react.forwardRef)(function (
142
142
  "aria-labelledby": labelId,
143
143
  "aria-describedby": descriptionId,
144
144
  "aria-invalid": isInvalid,
145
- className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n relative flex items-center group/dropzone bg-white\n border border-dashed rounded\n overflow-hidden transition-colors\n focusable focus-visible:border-transparent\n min-h-16 p-4\n ", "\n ", "\n ", ""])), disabled ? "cursor-not-allowed border-grey-200" : "cursor-pointer border-grey-500", isDragReject && !disabled ? "border-red-200 cursor-not-allowed" : isDragActive ? "border-accent-500 cursor-pointer" : null, !disabled && (isInvalid ? "bg-red-100 border-red-700 hover:bg-red-50" : "bg-white hover:bg-grey-100")), className),
145
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n relative flex items-center group/dropzone bg-white\n border border-dashed rounded\n overflow-hidden transition-colors\n focusable-visible focus-visible:border-transparent\n min-h-16 p-4\n ", "\n ", "\n ", ""])), disabled ? "cursor-not-allowed border-grey-200" : "cursor-pointer border-grey-500", isDragReject && !disabled ? "border-red-200 cursor-not-allowed" : isDragActive ? "border-accent-500 cursor-pointer" : null, !disabled && (isInvalid ? "bg-red-100 border-red-700 hover:bg-red-50" : "bg-white hover:bg-grey-100")), className),
146
146
  onClick: function onClick(evt) {
147
147
  // Helps with https://github.com/react-dropzone/react-dropzone/issues/182
148
148
  if (evt.target.closest("label")) {