@algolia/satellite 2.2.3 → 2.3.0-rc.10

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 (220) hide show
  1. package/dist/cjs/Actions/Accordion/Accordion.d.ts +8 -0
  2. package/dist/cjs/Actions/Accordion/Accordion.js +5 -3
  3. package/dist/cjs/Actions/Button/PolymorphicButton.js +5 -5
  4. package/dist/cjs/Actions/Button/PolymorphicIconButton.js +2 -2
  5. package/dist/cjs/Actions/Button/styles.d.ts +1 -0
  6. package/dist/cjs/Actions/Button/styles.js +15 -10
  7. package/dist/cjs/Actions/ButtonLink/ButtonLink.d.ts +2 -0
  8. package/dist/cjs/Actions/ButtonLink/ButtonLink.js +4 -2
  9. package/dist/cjs/Actions/SegmentedControl/SegmentedControl.js +3 -2
  10. package/dist/cjs/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
  11. package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.js +3 -3
  12. package/dist/cjs/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
  13. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  14. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.js +51 -0
  15. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +86 -0
  16. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.styles.js +23 -0
  17. package/dist/cjs/Chat/ChatContextAccordion/index.d.ts +1 -0
  18. package/dist/cjs/Chat/ChatContextAccordion/index.js +16 -0
  19. package/dist/cjs/Chat/ChatMessage/ChatMessage.d.ts +117 -0
  20. package/dist/cjs/Chat/ChatMessage/ChatMessage.js +92 -0
  21. package/dist/cjs/Chat/ChatMessage/ChatMessage.styles.d.ts +167 -0
  22. package/dist/cjs/Chat/ChatMessage/ChatMessage.styles.js +77 -0
  23. package/dist/cjs/Chat/ChatMessage/index.d.ts +1 -0
  24. package/dist/cjs/Chat/ChatMessage/index.js +16 -0
  25. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.d.ts +62 -0
  26. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.js +73 -0
  27. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  28. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.js +18 -0
  29. package/dist/cjs/Chat/ChatMessageError/index.d.ts +1 -0
  30. package/dist/cjs/Chat/ChatMessageError/index.js +16 -0
  31. package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.d.ts +21 -0
  32. package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.js +68 -0
  33. package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +280 -0
  34. package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.styles.js +21 -0
  35. package/dist/cjs/Chat/ChatMessageLoader/index.d.ts +1 -0
  36. package/dist/cjs/Chat/ChatMessageLoader/index.js +16 -0
  37. package/dist/cjs/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  38. package/dist/cjs/Chat/ChatMessages/ChatMessages.js +165 -0
  39. package/dist/cjs/Chat/ChatMessages/ChatMessages.styles.d.ts +69 -0
  40. package/dist/cjs/Chat/ChatMessages/ChatMessages.styles.js +29 -0
  41. package/dist/cjs/Chat/ChatMessages/index.d.ts +1 -0
  42. package/dist/cjs/Chat/ChatMessages/index.js +16 -0
  43. package/dist/cjs/Chat/ChatMessages/useLastMessageHeight.d.ts +14 -0
  44. package/dist/cjs/Chat/ChatMessages/useLastMessageHeight.js +54 -0
  45. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.d.ts +105 -0
  46. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.js +163 -0
  47. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  48. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.js +29 -0
  49. package/dist/cjs/Chat/ChatPrompt/index.d.ts +1 -0
  50. package/dist/cjs/Chat/ChatPrompt/index.js +16 -0
  51. package/dist/cjs/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  52. package/dist/cjs/Chat/ChatPrompt/useFocusTyping.js +65 -0
  53. package/dist/cjs/Chat/ChatPrompt/useTypewriter.d.ts +27 -0
  54. package/dist/cjs/Chat/ChatPrompt/useTypewriter.js +87 -0
  55. package/dist/cjs/Chat/index.d.ts +15 -0
  56. package/dist/cjs/Chat/index.js +47 -0
  57. package/dist/cjs/Chat/types.d.ts +7 -0
  58. package/dist/cjs/Chat/types.js +5 -0
  59. package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +2 -2
  60. package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
  61. package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
  62. package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
  63. package/dist/cjs/Fields/Input/Input.js +10 -13
  64. package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
  65. package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  66. package/dist/cjs/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
  67. package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
  68. package/dist/cjs/Fields/Select/Select.tailwind.js +4 -3
  69. package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  70. package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
  71. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  72. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
  73. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  74. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
  75. package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
  76. package/dist/cjs/Fields/SelectableCard/index.js +27 -0
  77. package/dist/cjs/Fields/Switch/Switch.js +1 -1
  78. package/dist/cjs/Fields/TextArea/TextArea.d.ts +5 -1
  79. package/dist/cjs/Fields/TextArea/TextArea.js +3 -2
  80. package/dist/cjs/Fields/TextArea/TextArea.tailwind.js +1 -1
  81. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +26 -0
  82. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.js +82 -0
  83. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +37 -0
  84. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.js +16 -0
  85. package/dist/cjs/Fields/TextAreaAutoSize/index.d.ts +2 -0
  86. package/dist/cjs/Fields/TextAreaAutoSize/index.js +12 -0
  87. package/dist/cjs/Fields/index.d.ts +3 -1
  88. package/dist/cjs/Fields/index.js +26 -4
  89. package/dist/cjs/Helpers/ShimmerText/ShimmerText.d.ts +3 -0
  90. package/dist/cjs/Helpers/ShimmerText/ShimmerText.js +28 -0
  91. package/dist/cjs/Helpers/ShimmerText/ShimmerText.tailwind.d.ts +5 -0
  92. package/dist/cjs/Helpers/ShimmerText/ShimmerText.tailwind.js +37 -0
  93. package/dist/cjs/Helpers/ShimmerText/index.d.ts +2 -0
  94. package/dist/cjs/Helpers/ShimmerText/index.js +12 -0
  95. package/dist/cjs/Helpers/index.d.ts +1 -0
  96. package/dist/cjs/Helpers/index.js +11 -0
  97. package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
  98. package/dist/cjs/Helpers/utilities/utilities.tailwind.js +6 -1
  99. package/dist/cjs/Indicators/Skeleton/Skeleton.d.ts +2 -2
  100. package/dist/cjs/Navigation/Link/Link.d.ts +10 -0
  101. package/dist/cjs/Navigation/Link/Link.js +4 -2
  102. package/dist/cjs/Satellite/locale.d.ts +7 -1
  103. package/dist/cjs/index.d.ts +1 -0
  104. package/dist/cjs/index.js +12 -0
  105. package/dist/cjs/styles/helpers/tv.d.ts +5 -0
  106. package/dist/cjs/styles/helpers/tv.js +13 -0
  107. package/dist/cjs/styles/tailwind.config.js +1 -1
  108. package/dist/cjs/utils/getTextFromReactNode.d.ts +2 -1
  109. package/dist/cjs/utils/getTextFromReactNode.js +12 -7
  110. package/dist/esm/Actions/Accordion/Accordion.d.ts +8 -0
  111. package/dist/esm/Actions/Accordion/Accordion.js +5 -3
  112. package/dist/esm/Actions/Button/PolymorphicButton.js +6 -6
  113. package/dist/esm/Actions/Button/PolymorphicIconButton.js +2 -2
  114. package/dist/esm/Actions/Button/styles.d.ts +1 -0
  115. package/dist/esm/Actions/Button/styles.js +14 -9
  116. package/dist/esm/Actions/ButtonLink/ButtonLink.d.ts +2 -0
  117. package/dist/esm/Actions/ButtonLink/ButtonLink.js +4 -2
  118. package/dist/esm/Actions/SegmentedControl/SegmentedControl.js +3 -2
  119. package/dist/esm/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
  120. package/dist/esm/Actions/ToggleButton/ToggleButtonBase.js +4 -4
  121. package/dist/esm/Actions/ToggleGroup/ToggleGroup.d.ts +13 -14
  122. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  123. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.js +44 -0
  124. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +86 -0
  125. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.styles.js +16 -0
  126. package/dist/esm/Chat/ChatContextAccordion/index.d.ts +1 -0
  127. package/dist/esm/Chat/ChatContextAccordion/index.js +1 -0
  128. package/dist/esm/Chat/ChatMessage/ChatMessage.d.ts +117 -0
  129. package/dist/esm/Chat/ChatMessage/ChatMessage.js +86 -0
  130. package/dist/esm/Chat/ChatMessage/ChatMessage.styles.d.ts +167 -0
  131. package/dist/esm/Chat/ChatMessage/ChatMessage.styles.js +70 -0
  132. package/dist/esm/Chat/ChatMessage/index.d.ts +1 -0
  133. package/dist/esm/Chat/ChatMessage/index.js +1 -0
  134. package/dist/esm/Chat/ChatMessageError/ChatMessageError.d.ts +62 -0
  135. package/dist/esm/Chat/ChatMessageError/ChatMessageError.js +66 -0
  136. package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  137. package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.js +11 -0
  138. package/dist/esm/Chat/ChatMessageError/index.d.ts +1 -0
  139. package/dist/esm/Chat/ChatMessageError/index.js +1 -0
  140. package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.d.ts +21 -0
  141. package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.js +61 -0
  142. package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +280 -0
  143. package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.styles.js +14 -0
  144. package/dist/esm/Chat/ChatMessageLoader/index.d.ts +1 -0
  145. package/dist/esm/Chat/ChatMessageLoader/index.js +1 -0
  146. package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  147. package/dist/esm/Chat/ChatMessages/ChatMessages.js +158 -0
  148. package/dist/esm/Chat/ChatMessages/ChatMessages.styles.d.ts +69 -0
  149. package/dist/esm/Chat/ChatMessages/ChatMessages.styles.js +22 -0
  150. package/dist/esm/Chat/ChatMessages/index.d.ts +1 -0
  151. package/dist/esm/Chat/ChatMessages/index.js +1 -0
  152. package/dist/esm/Chat/ChatMessages/useLastMessageHeight.d.ts +14 -0
  153. package/dist/esm/Chat/ChatMessages/useLastMessageHeight.js +48 -0
  154. package/dist/esm/Chat/ChatPrompt/ChatPrompt.d.ts +105 -0
  155. package/dist/esm/Chat/ChatPrompt/ChatPrompt.js +159 -0
  156. package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  157. package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.js +22 -0
  158. package/dist/esm/Chat/ChatPrompt/index.d.ts +1 -0
  159. package/dist/esm/Chat/ChatPrompt/index.js +1 -0
  160. package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  161. package/dist/esm/Chat/ChatPrompt/useFocusTyping.js +59 -0
  162. package/dist/esm/Chat/ChatPrompt/useTypewriter.d.ts +27 -0
  163. package/dist/esm/Chat/ChatPrompt/useTypewriter.js +80 -0
  164. package/dist/esm/Chat/index.d.ts +15 -0
  165. package/dist/esm/Chat/index.js +6 -0
  166. package/dist/esm/Chat/types.d.ts +7 -0
  167. package/dist/esm/Chat/types.js +1 -0
  168. package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
  169. package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
  170. package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
  171. package/dist/esm/Fields/Form/stories/Complex.js +123 -50
  172. package/dist/esm/Fields/Input/Input.js +10 -13
  173. package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
  174. package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  175. package/dist/esm/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
  176. package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
  177. package/dist/esm/Fields/Select/Select.tailwind.js +4 -3
  178. package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  179. package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
  180. package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  181. package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
  182. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  183. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
  184. package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
  185. package/dist/esm/Fields/SelectableCard/index.js +2 -0
  186. package/dist/esm/Fields/Switch/Switch.js +1 -1
  187. package/dist/esm/Fields/TextArea/TextArea.d.ts +5 -1
  188. package/dist/esm/Fields/TextArea/TextArea.js +3 -2
  189. package/dist/esm/Fields/TextArea/TextArea.tailwind.js +1 -1
  190. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +26 -0
  191. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.js +75 -0
  192. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +37 -0
  193. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.js +9 -0
  194. package/dist/esm/Fields/TextAreaAutoSize/index.d.ts +2 -0
  195. package/dist/esm/Fields/TextAreaAutoSize/index.js +1 -0
  196. package/dist/esm/Fields/index.d.ts +3 -1
  197. package/dist/esm/Fields/index.js +3 -1
  198. package/dist/esm/Helpers/ShimmerText/ShimmerText.d.ts +3 -0
  199. package/dist/esm/Helpers/ShimmerText/ShimmerText.js +21 -0
  200. package/dist/esm/Helpers/ShimmerText/ShimmerText.tailwind.d.ts +5 -0
  201. package/dist/esm/Helpers/ShimmerText/ShimmerText.tailwind.js +36 -0
  202. package/dist/esm/Helpers/ShimmerText/index.d.ts +2 -0
  203. package/dist/esm/Helpers/ShimmerText/index.js +1 -0
  204. package/dist/esm/Helpers/index.d.ts +1 -0
  205. package/dist/esm/Helpers/index.js +2 -1
  206. package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
  207. package/dist/esm/Helpers/utilities/utilities.tailwind.js +6 -1
  208. package/dist/esm/Indicators/Skeleton/Skeleton.d.ts +2 -2
  209. package/dist/esm/Navigation/Link/Link.d.ts +10 -0
  210. package/dist/esm/Navigation/Link/Link.js +4 -2
  211. package/dist/esm/Satellite/locale.d.ts +7 -1
  212. package/dist/esm/index.d.ts +1 -0
  213. package/dist/esm/index.js +1 -0
  214. package/dist/esm/styles/helpers/tv.d.ts +5 -0
  215. package/dist/esm/styles/helpers/tv.js +7 -0
  216. package/dist/esm/styles/tailwind.config.js +1 -1
  217. package/dist/esm/utils/getTextFromReactNode.d.ts +2 -1
  218. package/dist/esm/utils/getTextFromReactNode.js +13 -8
  219. package/dist/satellite.min.css +1 -1
  220. package/package.json +12 -3
@@ -1,4 +1,3 @@
1
- import type { ToggleGroupItemProps as RadixToggleGroupItemProps, ToggleGroupMultipleProps as RadixToggleGroupMultipleProps, ToggleGroupSingleProps as RadixToggleGroupSingleProps } from "@radix-ui/react-toggle-group";
2
1
  import type { FC, PropsWithChildren } from "react";
3
2
  import type { ToggleButtonBaseProps } from "../../Actions/ToggleButton/ToggleButtonBase";
4
3
  declare type ToggleGroupSharedProps = {
@@ -12,7 +11,7 @@ declare type ToggleGroupSharedProps = {
12
11
  */
13
12
  disabled?: boolean;
14
13
  };
15
- declare type ToggleGroupSingleProps = {
14
+ declare type ToggleGroupSingleProps<T extends string = string> = {
16
15
  /**
17
16
  * Defines whether a single or multiple items can be pressed at a time.
18
17
  */
@@ -21,18 +20,18 @@ declare type ToggleGroupSingleProps = {
21
20
  * Defines the controlled value of the pressed item.
22
21
  * Must be used in conjunction with `onChange`.
23
22
  */
24
- value?: RadixToggleGroupSingleProps["value"];
23
+ value?: T;
25
24
  /**
26
25
  * Defines the value of the item to show as pressed when initially rendered.
27
26
  * Use when you do not need to control the state of the items.
28
27
  */
29
- defaultValue?: RadixToggleGroupSingleProps["defaultValue"];
28
+ defaultValue?: T;
30
29
  /**
31
30
  * Defines the event handler called when the pressed state of an item changes.
32
31
  */
33
- onChange?: RadixToggleGroupSingleProps["onValueChange"];
32
+ onChange?: (value: T) => void;
34
33
  };
35
- declare type ToggleGroupMultipleProps = {
34
+ declare type ToggleGroupMultipleProps<T extends string = string> = {
36
35
  /**
37
36
  * Defines whether a single or multiple items can be pressed at a time.
38
37
  */
@@ -41,24 +40,24 @@ declare type ToggleGroupMultipleProps = {
41
40
  * Defines the controlled value of the pressed items.
42
41
  * Must be used in conjunction with `onChange`.
43
42
  */
44
- value?: RadixToggleGroupMultipleProps["value"];
43
+ value?: T[];
45
44
  /**
46
45
  * Defines the values of the items to show as pressed when initially rendered.
47
46
  * Use when you do not need to control the state of the items.
48
47
  */
49
- defaultValue?: RadixToggleGroupMultipleProps["defaultValue"];
48
+ defaultValue?: T[];
50
49
  /**
51
50
  * Defines the event handler called when the pressed state of an item changes.
52
51
  */
53
- onChange?: RadixToggleGroupMultipleProps["onValueChange"];
52
+ onChange?: (value: T[]) => void;
54
53
  };
55
- export declare type ToggleGroupProps = ToggleGroupSharedProps & (ToggleGroupSingleProps | ToggleGroupMultipleProps);
56
- declare type ToggleGroupComponent = FC<PropsWithChildren<ToggleGroupProps>> & {
57
- Item: FC<PropsWithChildren<ToggleGroupItemProps>>;
54
+ export declare type ToggleGroupProps<T extends string = string> = ToggleGroupSharedProps & (ToggleGroupSingleProps<T> | ToggleGroupMultipleProps<T>);
55
+ export declare type ToggleGroupComponent<T extends string = string> = FC<PropsWithChildren<ToggleGroupProps<T>>> & {
56
+ Item: FC<PropsWithChildren<ToggleGroupItemProps<T>>>;
58
57
  };
59
- export declare type ToggleGroupItemProps = PropsWithChildren<ToggleButtonBaseProps & {
58
+ export declare type ToggleGroupItemProps<T extends string = string> = PropsWithChildren<ToggleButtonBaseProps & {
60
59
  /** Defines a unique value for the item. */
61
- value: RadixToggleGroupItemProps["value"];
60
+ value: T;
62
61
  }>;
63
62
  /**
64
63
  * The `ToggleGroup` component is a toggle group that allows users to select one or more options.
@@ -0,0 +1,23 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import type { AccordionProps } from "../../Actions";
3
+ import type { IconComponentType } from "../../Icons";
4
+ export declare type ChatContextAccordionProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & Omit<AccordionProps, "multiple" | "defaultValue" | "value" | "onChange"> & {
5
+ /**
6
+ * The header of the accordion.
7
+ */
8
+ header: ReactNode;
9
+ /**
10
+ * The icon of the accordion.
11
+ */
12
+ icon?: IconComponentType;
13
+ /**
14
+ * Whether the accordion is open by default.
15
+ */
16
+ defaultOpen?: boolean;
17
+ };
18
+ /**
19
+ * The `ChatContextAccordion` component provides a context menu for the chat.
20
+ *
21
+ * See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
22
+ */
23
+ export declare const ChatContextAccordion: ({ header, icon, children, className, defaultOpen, ...props }: ChatContextAccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["header", "icon", "children", "className", "defaultOpen"];
4
+ 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; }
5
+ 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) { _defineProperty(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; }
6
+ import { chatContextAccordionStyles } from "./ChatContextAccordion.styles";
7
+ import { Accordion } from "./../../Actions";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ /**
10
+ * The `ChatContextAccordion` component provides a context menu for the chat.
11
+ *
12
+ * See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
13
+ */
14
+ export var ChatContextAccordion = function ChatContextAccordion(_ref) {
15
+ var header = _ref.header,
16
+ icon = _ref.icon,
17
+ children = _ref.children,
18
+ className = _ref.className,
19
+ defaultOpen = _ref.defaultOpen,
20
+ props = _objectWithoutProperties(_ref, _excluded);
21
+ var styles = chatContextAccordionStyles();
22
+ return /*#__PURE__*/_jsx(Accordion, _objectSpread(_objectSpread({}, props), {}, {
23
+ defaultValue: defaultOpen ? "default" : undefined,
24
+ className: styles.base({
25
+ className: className
26
+ }),
27
+ children: /*#__PURE__*/_jsxs(Accordion.Item, {
28
+ value: "default",
29
+ className: styles.item(),
30
+ children: [/*#__PURE__*/_jsx(Accordion.Header, {
31
+ className: styles.header(),
32
+ triggerClassName: styles.trigger(),
33
+ titleWrapperClassName: styles.titleWrapper(),
34
+ titleClassName: styles.title(),
35
+ icon: icon,
36
+ iconBgClassName: styles.iconBg(),
37
+ children: header
38
+ }), /*#__PURE__*/_jsx(Accordion.Content, {
39
+ className: styles.content(),
40
+ children: children
41
+ })]
42
+ })
43
+ }));
44
+ };
@@ -0,0 +1,86 @@
1
+ export declare const chatContextAccordionStyles: import("tailwind-variants").TVReturnType<{
2
+ [key: string]: {
3
+ [key: string]: import("tailwind-merge").ClassNameValue | {
4
+ base?: import("tailwind-merge").ClassNameValue;
5
+ header?: import("tailwind-merge").ClassNameValue;
6
+ title?: import("tailwind-merge").ClassNameValue;
7
+ content?: import("tailwind-merge").ClassNameValue;
8
+ item?: import("tailwind-merge").ClassNameValue;
9
+ trigger?: import("tailwind-merge").ClassNameValue;
10
+ iconBg?: import("tailwind-merge").ClassNameValue;
11
+ titleWrapper?: import("tailwind-merge").ClassNameValue;
12
+ };
13
+ };
14
+ } | {
15
+ [x: string]: {
16
+ [x: string]: import("tailwind-merge").ClassNameValue | {
17
+ base?: import("tailwind-merge").ClassNameValue;
18
+ header?: import("tailwind-merge").ClassNameValue;
19
+ title?: import("tailwind-merge").ClassNameValue;
20
+ content?: import("tailwind-merge").ClassNameValue;
21
+ item?: import("tailwind-merge").ClassNameValue;
22
+ trigger?: import("tailwind-merge").ClassNameValue;
23
+ iconBg?: import("tailwind-merge").ClassNameValue;
24
+ titleWrapper?: import("tailwind-merge").ClassNameValue;
25
+ };
26
+ };
27
+ } | {}, {
28
+ base: string;
29
+ item: string;
30
+ header: string;
31
+ iconBg: string;
32
+ trigger: string;
33
+ titleWrapper: string;
34
+ title: string;
35
+ content: string;
36
+ }, undefined, {
37
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {} | undefined;
38
+ } & import("tailwind-variants/dist/config").TWMConfig & {
39
+ twMergeConfig: {
40
+ prefix: string;
41
+ };
42
+ }, {
43
+ [key: string]: {
44
+ [key: string]: import("tailwind-merge").ClassNameValue | {
45
+ base?: import("tailwind-merge").ClassNameValue;
46
+ header?: import("tailwind-merge").ClassNameValue;
47
+ title?: import("tailwind-merge").ClassNameValue;
48
+ content?: import("tailwind-merge").ClassNameValue;
49
+ item?: import("tailwind-merge").ClassNameValue;
50
+ trigger?: import("tailwind-merge").ClassNameValue;
51
+ iconBg?: import("tailwind-merge").ClassNameValue;
52
+ titleWrapper?: import("tailwind-merge").ClassNameValue;
53
+ };
54
+ };
55
+ } | {}, {
56
+ base: string;
57
+ item: string;
58
+ header: string;
59
+ iconBg: string;
60
+ trigger: string;
61
+ titleWrapper: string;
62
+ title: string;
63
+ content: string;
64
+ }, import("tailwind-variants").TVReturnType<unknown, {
65
+ base: string;
66
+ item: string;
67
+ header: string;
68
+ iconBg: string;
69
+ trigger: string;
70
+ titleWrapper: string;
71
+ title: string;
72
+ content: string;
73
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
74
+ [key: string]: {
75
+ [key: string]: import("tailwind-merge").ClassNameValue | {
76
+ base?: import("tailwind-merge").ClassNameValue;
77
+ header?: import("tailwind-merge").ClassNameValue;
78
+ title?: import("tailwind-merge").ClassNameValue;
79
+ content?: import("tailwind-merge").ClassNameValue;
80
+ item?: import("tailwind-merge").ClassNameValue;
81
+ trigger?: import("tailwind-merge").ClassNameValue;
82
+ iconBg?: import("tailwind-merge").ClassNameValue;
83
+ titleWrapper?: import("tailwind-merge").ClassNameValue;
84
+ };
85
+ };
86
+ } | {}>, unknown, unknown, undefined>>;
@@ -0,0 +1,16 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
3
+ import stl from "./../../styles/helpers/satellitePrefixer";
4
+ import { tv } from "./../../styles/helpers/tv";
5
+ export var chatContextAccordionStyles = tv({
6
+ slots: {
7
+ base: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full"]))),
8
+ item: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["border border-grey-200 rounded-[4px] overflow-hidden"]))),
9
+ header: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["border-b border-grey-200 transition-colors duration-500 data-[state=closed]:border-b-transparent [&>div]:px-2"]))),
10
+ iconBg: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-none !size-auto"]))),
11
+ trigger: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["!px-2 !py-0.5"]))),
12
+ titleWrapper: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["gap-x-1"]))),
13
+ title: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["typo-subdued typo-display-caption"]))),
14
+ content: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["bg-grey-100 [&>div]:px-3 [&>div]:py-2 overflow-y-auto max-h-36 data-[state=closed]:overflow-y-hidden"])))
15
+ }
16
+ });
@@ -0,0 +1 @@
1
+ export * from "./ChatContextAccordion";
@@ -0,0 +1 @@
1
+ export * from "./ChatContextAccordion";
@@ -0,0 +1,117 @@
1
+ import type { HTMLAttributes, MouseEvent, ReactElement, ReactNode, Ref } from "react";
2
+ import type { VariantProps } from "tailwind-variants";
3
+ import { chatMessageStyles } from "./ChatMessage.styles";
4
+ import type { IconButtonWithFeedbackProps } from "../../Actions";
5
+ import type { UserAvatarProps } from "../../Indicators";
6
+ declare type ChatMessageVariants = VariantProps<typeof chatMessageStyles>;
7
+ declare type Actions<ActionsExtraData extends Record<string, any> = Record<string, any>> = Array<Omit<IconButtonWithFeedbackProps, "onClick" | "tooltipDelay" | "tooltipHideDelay"> & {
8
+ onClick?: (e: MouseEvent<HTMLButtonElement>, actionsExtraData?: ActionsExtraData) => Promise<void> | void;
9
+ }>;
10
+ export declare type ChatMessageProps<ActionsExtraData extends Record<string, any> = Record<string, any>> = Omit<HTMLAttributes<HTMLElement>, "children" | "content"> & {
11
+ /**
12
+ * The content of the message.
13
+ */
14
+ content: ReactNode;
15
+ /**
16
+ * The avatar of the message.
17
+ */
18
+ avatar?: UserAvatarProps["user"];
19
+ /**
20
+ * The size of the avatar.
21
+ */
22
+ avatarSize?: UserAvatarProps["size"];
23
+ /**
24
+ * The side of the message.
25
+ */
26
+ side?: ChatMessageVariants["side"];
27
+ /**
28
+ * The variant of the message.
29
+ */
30
+ variant?: ChatMessageVariants["variant"];
31
+ /**
32
+ * The actions of the message.
33
+ */
34
+ actions?: Actions<ActionsExtraData>;
35
+ /**
36
+ * Whether to automatically hide the actions.
37
+ */
38
+ autoHideActions?: boolean;
39
+ /**
40
+ * The leading content of the message.
41
+ */
42
+ renderLeading?: ReactNode;
43
+ /**
44
+ * The actions content of the message.
45
+ */
46
+ renderActions?: (actions?: Actions<ActionsExtraData>) => ReactNode;
47
+ /**
48
+ * The footer content of the message.
49
+ */
50
+ renderFooter?: ReactNode;
51
+ /**
52
+ * The extra data of the actions.
53
+ */
54
+ actionsExtraData?: ActionsExtraData;
55
+ /**
56
+ * Whether to render the message in RTL.
57
+ */
58
+ rtl?: boolean;
59
+ };
60
+ /**
61
+ * The `ChatMessage` component provides a message to display in the chat.
62
+ *
63
+ * See the [ChatMessage documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message) for more information.
64
+ */
65
+ export declare const ChatMessage: <ActionsExtraData extends Record<string, any> = Record<string, any>>(props: Omit<HTMLAttributes<HTMLElement>, "children" | "content"> & {
66
+ /**
67
+ * The content of the message.
68
+ */
69
+ content: ReactNode;
70
+ /**
71
+ * The avatar of the message.
72
+ */
73
+ avatar?: import("../../Indicators/Avatars/types").MinimalUser | undefined;
74
+ /**
75
+ * The size of the avatar.
76
+ */
77
+ avatarSize?: UserAvatarProps["size"];
78
+ /**
79
+ * The side of the message.
80
+ */
81
+ side?: ChatMessageVariants["side"];
82
+ /**
83
+ * The variant of the message.
84
+ */
85
+ variant?: ChatMessageVariants["variant"];
86
+ /**
87
+ * The actions of the message.
88
+ */
89
+ actions?: Actions<ActionsExtraData> | undefined;
90
+ /**
91
+ * Whether to automatically hide the actions.
92
+ */
93
+ autoHideActions?: boolean | undefined;
94
+ /**
95
+ * The leading content of the message.
96
+ */
97
+ renderLeading?: ReactNode;
98
+ /**
99
+ * The actions content of the message.
100
+ */
101
+ renderActions?: ((actions?: Actions<ActionsExtraData> | undefined) => ReactNode) | undefined;
102
+ /**
103
+ * The footer content of the message.
104
+ */
105
+ renderFooter?: ReactNode;
106
+ /**
107
+ * The extra data of the actions.
108
+ */
109
+ actionsExtraData?: ActionsExtraData | undefined;
110
+ /**
111
+ * Whether to render the message in RTL.
112
+ */
113
+ rtl?: boolean | undefined;
114
+ } & {
115
+ ref?: Ref<HTMLDivElement> | undefined;
116
+ }) => ReactElement | null;
117
+ export {};
@@ -0,0 +1,86 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["content", "avatar", "avatarSize", "side", "variant", "actions", "autoHideActions", "renderLeading", "renderActions", "renderFooter", "actionsExtraData", "rtl", "className"];
4
+ 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; }
5
+ 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) { _defineProperty(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; }
6
+ import { memo } from "react";
7
+ import { forwardRef } from "react";
8
+ import { chatMessageStyles } from "./ChatMessage.styles";
9
+ import { IconButtonWithFeedback } from "./../../Actions";
10
+ import { UserAvatar } from "./../../Indicators";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ var ChatMessageBase = function ChatMessageBase(_ref, ref) {
13
+ var content = _ref.content,
14
+ avatar = _ref.avatar,
15
+ _ref$avatarSize = _ref.avatarSize,
16
+ avatarSize = _ref$avatarSize === void 0 ? "medium" : _ref$avatarSize,
17
+ side = _ref.side,
18
+ variant = _ref.variant,
19
+ actions = _ref.actions,
20
+ _ref$autoHideActions = _ref.autoHideActions,
21
+ autoHideActions = _ref$autoHideActions === void 0 ? false : _ref$autoHideActions,
22
+ renderLeading = _ref.renderLeading,
23
+ renderActions = _ref.renderActions,
24
+ renderFooter = _ref.renderFooter,
25
+ actionsExtraData = _ref.actionsExtraData,
26
+ _ref$rtl = _ref.rtl,
27
+ rtl = _ref$rtl === void 0 ? false : _ref$rtl,
28
+ className = _ref.className,
29
+ props = _objectWithoutProperties(_ref, _excluded);
30
+ var styles = chatMessageStyles({
31
+ side: side,
32
+ variant: variant,
33
+ leading: !!avatar,
34
+ actions: !!actions,
35
+ autoHideActions: autoHideActions
36
+ });
37
+ return /*#__PURE__*/_jsx("article", _objectSpread(_objectSpread({}, props), {}, {
38
+ ref: ref,
39
+ className: styles.base({
40
+ className: className
41
+ }),
42
+ dir: rtl ? "rtl" : "ltr",
43
+ children: /*#__PURE__*/_jsxs("div", {
44
+ className: styles.container(),
45
+ children: [(!!avatar || !!renderLeading) && /*#__PURE__*/_jsx("div", {
46
+ className: styles.leading(),
47
+ children: renderLeading || avatar && /*#__PURE__*/_jsx(UserAvatar, {
48
+ user: avatar,
49
+ size: avatarSize
50
+ })
51
+ }), /*#__PURE__*/_jsxs("div", {
52
+ className: styles.content(),
53
+ children: [/*#__PURE__*/_jsx("div", {
54
+ className: styles.message(),
55
+ children: content
56
+ }), (!!actions || !!renderActions) && /*#__PURE__*/_jsx("div", {
57
+ className: styles.actions(),
58
+ children: (renderActions === null || renderActions === void 0 ? void 0 : renderActions(actions)) || (actions === null || actions === void 0 ? void 0 : actions.map(function (actionProps, index) {
59
+ return /*#__PURE__*/_jsx(IconButtonWithFeedback, _objectSpread(_objectSpread({
60
+ size: "small",
61
+ variant: "subtle",
62
+ tooltipSide: "bottom"
63
+ }, actionProps), {}, {
64
+ onClick: function onClick(e) {
65
+ var _actionProps$onClick;
66
+ return (_actionProps$onClick = actionProps.onClick) === null || _actionProps$onClick === void 0 ? void 0 : _actionProps$onClick.call(actionProps, e, actionsExtraData);
67
+ },
68
+ tooltipDelay: 0,
69
+ tooltipHideDelay: 0
70
+ }), index);
71
+ }))
72
+ }), !!renderFooter && /*#__PURE__*/_jsx("div", {
73
+ className: styles.footer(),
74
+ children: renderFooter
75
+ })]
76
+ })]
77
+ })
78
+ }));
79
+ };
80
+
81
+ /**
82
+ * The `ChatMessage` component provides a message to display in the chat.
83
+ *
84
+ * See the [ChatMessage documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message) for more information.
85
+ */
86
+ export var ChatMessage = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(ChatMessageBase));
@@ -0,0 +1,167 @@
1
+ export declare const chatMessageStyles: import("tailwind-variants").TVReturnType<{
2
+ variant: {
3
+ neutral: {
4
+ message: string;
5
+ };
6
+ subtle: {
7
+ message: string;
8
+ };
9
+ };
10
+ side: {
11
+ left: {
12
+ container: string;
13
+ };
14
+ right: {
15
+ container: string;
16
+ };
17
+ };
18
+ leading: {
19
+ true: string;
20
+ };
21
+ actions: {
22
+ true: string;
23
+ };
24
+ autoHideActions: {
25
+ true: string;
26
+ };
27
+ }, {
28
+ base: string;
29
+ container: string;
30
+ leading: string;
31
+ content: string;
32
+ message: string;
33
+ actions: string;
34
+ footer: string;
35
+ }, undefined, {
36
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
37
+ variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
38
+ leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
39
+ side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
40
+ actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
41
+ autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
42
+ } | undefined;
43
+ } & import("tailwind-variants/dist/config").TWMConfig & {
44
+ twMergeConfig: {
45
+ prefix: string;
46
+ };
47
+ }, {
48
+ variant: {
49
+ neutral: {
50
+ message: string;
51
+ };
52
+ subtle: {
53
+ message: string;
54
+ };
55
+ };
56
+ side: {
57
+ left: {
58
+ container: string;
59
+ };
60
+ right: {
61
+ container: string;
62
+ };
63
+ };
64
+ leading: {
65
+ true: string;
66
+ };
67
+ actions: {
68
+ true: string;
69
+ };
70
+ autoHideActions: {
71
+ true: string;
72
+ };
73
+ }, {
74
+ base: string;
75
+ container: string;
76
+ leading: string;
77
+ content: string;
78
+ message: string;
79
+ actions: string;
80
+ footer: string;
81
+ }, import("tailwind-variants").TVReturnType<{
82
+ variant: {
83
+ neutral: {
84
+ message: string;
85
+ };
86
+ subtle: {
87
+ message: string;
88
+ };
89
+ };
90
+ side: {
91
+ left: {
92
+ container: string;
93
+ };
94
+ right: {
95
+ container: string;
96
+ };
97
+ };
98
+ leading: {
99
+ true: string;
100
+ };
101
+ actions: {
102
+ true: string;
103
+ };
104
+ autoHideActions: {
105
+ true: string;
106
+ };
107
+ }, {
108
+ base: string;
109
+ container: string;
110
+ leading: string;
111
+ content: string;
112
+ message: string;
113
+ actions: string;
114
+ footer: string;
115
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
116
+ variant: {
117
+ neutral: {
118
+ message: string;
119
+ };
120
+ subtle: {
121
+ message: string;
122
+ };
123
+ };
124
+ side: {
125
+ left: {
126
+ container: string;
127
+ };
128
+ right: {
129
+ container: string;
130
+ };
131
+ };
132
+ leading: {
133
+ true: string;
134
+ };
135
+ actions: {
136
+ true: string;
137
+ };
138
+ autoHideActions: {
139
+ true: string;
140
+ };
141
+ }, {
142
+ variant: {
143
+ neutral: {
144
+ message: string;
145
+ };
146
+ subtle: {
147
+ message: string;
148
+ };
149
+ };
150
+ side: {
151
+ left: {
152
+ container: string;
153
+ };
154
+ right: {
155
+ container: string;
156
+ };
157
+ };
158
+ leading: {
159
+ true: string;
160
+ };
161
+ actions: {
162
+ true: string;
163
+ };
164
+ autoHideActions: {
165
+ true: string;
166
+ };
167
+ }>, unknown, unknown, undefined>>;