@thewhatmatters/wmds 0.4.0 → 0.4.2

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 (250) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/CONSUMING.md +9 -4
  3. package/dist/collapse.css +9 -1
  4. package/dist/colors.css +7 -0
  5. package/dist/components/atoms/Badge/Badge.d.ts +16 -4
  6. package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
  7. package/dist/components/atoms/Badge/Badge.js +54 -42
  8. package/dist/components/atoms/Badge/badgeStyles.d.ts +12 -2
  9. package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
  10. package/dist/components/atoms/Badge/badgeStyles.js +24 -13
  11. package/dist/components/atoms/Button/Button.d.ts +11 -3
  12. package/dist/components/atoms/Button/Button.d.ts.map +1 -1
  13. package/dist/components/atoms/Button/Button.js +118 -98
  14. package/dist/components/atoms/Button/ButtonStatusButton.d.ts +3 -1
  15. package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
  16. package/dist/components/atoms/Button/ButtonStatusButton.js +19 -18
  17. package/dist/components/atoms/Button/ButtonStatusContent.d.ts +7 -1
  18. package/dist/components/atoms/Button/ButtonStatusContent.d.ts.map +1 -1
  19. package/dist/components/atoms/Button/ButtonStatusContent.js +9 -6
  20. package/dist/components/atoms/Button/buttonStatusStyles.d.ts +5 -0
  21. package/dist/components/atoms/Button/buttonStatusStyles.d.ts.map +1 -1
  22. package/dist/components/atoms/Button/buttonStatusStyles.js +10 -10
  23. package/dist/components/atoms/Button/buttonStyles.d.ts +2 -0
  24. package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
  25. package/dist/components/atoms/Button/buttonStyles.js +12 -12
  26. package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -0
  27. package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
  28. package/dist/components/atoms/Checkbox/Checkbox.js +86 -69
  29. package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +6 -0
  30. package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
  31. package/dist/components/atoms/Checkbox/checkboxStyles.js +11 -11
  32. package/dist/components/atoms/IconButton/IconButton.d.ts +5 -0
  33. package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
  34. package/dist/components/atoms/IconButton/IconButton.js +73 -68
  35. package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +5 -0
  36. package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
  37. package/dist/components/atoms/IconButton/iconButtonStyles.js +4 -4
  38. package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts +13 -4
  39. package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts.map +1 -1
  40. package/dist/components/atoms/Kbd/useKbdChoiceKeys.js +32 -13
  41. package/dist/components/atoms/Prose/Prose.d.ts +23 -0
  42. package/dist/components/atoms/Prose/Prose.d.ts.map +1 -0
  43. package/dist/components/atoms/Prose/Prose.js +15 -0
  44. package/dist/components/atoms/Prose/proseStyles.d.ts +17 -0
  45. package/dist/components/atoms/Prose/proseStyles.d.ts.map +1 -0
  46. package/dist/components/atoms/Prose/proseStyles.js +16 -0
  47. package/dist/components/atoms/SectionCaption/SectionCaption.d.ts +26 -0
  48. package/dist/components/atoms/SectionCaption/SectionCaption.d.ts.map +1 -0
  49. package/dist/components/atoms/SectionCaption/SectionCaption.js +25 -0
  50. package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts +11 -0
  51. package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts.map +1 -0
  52. package/dist/components/atoms/SectionCaption/sectionCaptionStyles.js +12 -0
  53. package/dist/components/atoms/TextLink/TextLink.d.ts +10 -2
  54. package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
  55. package/dist/components/atoms/TextLink/TextLink.js +15 -15
  56. package/dist/components/atoms/TextLink/textLinkStyles.d.ts +13 -0
  57. package/dist/components/atoms/TextLink/textLinkStyles.d.ts.map +1 -1
  58. package/dist/components/atoms/TextLink/textLinkStyles.js +7 -3
  59. package/dist/components/molecules/Accordion/Accordion.d.ts +6 -1
  60. package/dist/components/molecules/Accordion/Accordion.d.ts.map +1 -1
  61. package/dist/components/molecules/Accordion/Accordion.js +57 -50
  62. package/dist/components/molecules/Accordion/accordionStyles.d.ts +9 -0
  63. package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
  64. package/dist/components/molecules/Accordion/accordionStyles.js +2 -2
  65. package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts +59 -0
  66. package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  67. package/dist/components/molecules/Breadcrumb/Breadcrumb.js +188 -0
  68. package/dist/components/molecules/Breadcrumb/breadcrumbStyles.d.ts +21 -0
  69. package/dist/components/molecules/Breadcrumb/breadcrumbStyles.d.ts.map +1 -0
  70. package/dist/components/molecules/Breadcrumb/breadcrumbStyles.js +11 -0
  71. package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts +5 -1
  72. package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts.map +1 -1
  73. package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.js +12 -10
  74. package/dist/components/molecules/DescriptionList/DescriptionList.d.ts +37 -0
  75. package/dist/components/molecules/DescriptionList/DescriptionList.d.ts.map +1 -0
  76. package/dist/components/molecules/DescriptionList/DescriptionList.js +50 -0
  77. package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts +21 -0
  78. package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts.map +1 -0
  79. package/dist/components/molecules/DescriptionList/descriptionListStyles.js +27 -0
  80. package/dist/components/molecules/Dropdown/DropdownItem.d.ts +7 -2
  81. package/dist/components/molecules/Dropdown/DropdownItem.d.ts.map +1 -1
  82. package/dist/components/molecules/Dropdown/DropdownItem.js +40 -24
  83. package/dist/components/molecules/IndexList/IndexList.d.ts +58 -0
  84. package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -0
  85. package/dist/components/molecules/IndexList/IndexList.js +96 -0
  86. package/dist/components/molecules/IndexList/indexListStyles.d.ts +29 -0
  87. package/dist/components/molecules/IndexList/indexListStyles.d.ts.map +1 -0
  88. package/dist/components/molecules/IndexList/indexListStyles.js +24 -0
  89. package/dist/components/molecules/PromptBar/promptBarStyles.d.ts +3 -2
  90. package/dist/components/molecules/PromptBar/promptBarStyles.d.ts.map +1 -1
  91. package/dist/components/molecules/PromptBar/promptBarStyles.js +1 -1
  92. package/dist/components/organisms/ChatDock/ChatDock.d.ts +120 -10
  93. package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
  94. package/dist/components/organisms/ChatDock/ChatDock.js +654 -212
  95. package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +52 -0
  96. package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -0
  97. package/dist/components/organisms/ChatDock/ChatDockGate.js +161 -0
  98. package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +16 -0
  99. package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -0
  100. package/dist/components/organisms/ChatDock/chatDockGateStyles.js +8 -0
  101. package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +60 -10
  102. package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
  103. package/dist/components/organisms/ChatDock/chatDockStyles.js +15 -9
  104. package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +21 -0
  105. package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -0
  106. package/dist/components/organisms/ChatDock/chatDockViewport.js +46 -0
  107. package/dist/components/organisms/SiteNav/SiteNav.js +86 -86
  108. package/dist/components/organisms/Toast/Toast.js +5 -5
  109. package/dist/index.d.ts +8 -3
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +124 -112
  112. package/dist/lib/compositionAudit.d.ts.map +1 -1
  113. package/dist/lib/typography.d.ts +2 -2
  114. package/dist/lib/typography.d.ts.map +1 -1
  115. package/dist/lib/typography.js +27 -1
  116. package/dist/styles.css +1 -1
  117. package/dist/theme.css +1 -0
  118. package/dist/typography.css +34 -0
  119. package/docs/README.md +1 -1
  120. package/docs/component-contracts.md +15 -0
  121. package/docs/components.md +17 -12
  122. package/docs/exports.json +85 -4
  123. package/docs/patterns/components-accordion--flush.tsx +29 -0
  124. package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
  125. package/docs/patterns/components-badge--outline-tags.tsx +25 -0
  126. package/docs/patterns/components-badge--with-avatar.tsx +1 -1
  127. package/docs/patterns/components-breadcrumb--editorial.tsx +9 -0
  128. package/docs/patterns/components-breadcrumb--long-path.tsx +9 -0
  129. package/docs/patterns/components-breadcrumb--path.tsx +9 -0
  130. package/docs/patterns/components-breadcrumb--router-links.tsx +10 -0
  131. package/docs/patterns/components-button-button--copy-button.tsx +39 -0
  132. package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
  133. package/docs/patterns/components-button-button--external-link.tsx +30 -0
  134. package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
  135. package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
  136. package/docs/patterns/components-button-button--link-render.tsx +1 -1
  137. package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
  138. package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
  139. package/docs/patterns/components-button-button--primary-action.tsx +1 -1
  140. package/docs/patterns/components-button-button--row-hug.tsx +1 -1
  141. package/docs/patterns/components-button-button--row-layout.tsx +1 -1
  142. package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
  143. package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
  144. package/docs/patterns/components-button-button--with-count.tsx +1 -1
  145. package/docs/patterns/components-button-button--with-icon.tsx +1 -1
  146. package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
  147. package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
  148. package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
  149. package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
  150. package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
  151. package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
  152. package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
  153. package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
  154. package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
  155. package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
  156. package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
  157. package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
  158. package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
  159. package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
  160. package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +101 -11
  161. package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +180 -0
  162. package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
  163. package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
  164. package/docs/patterns/components-checkbox-checkbox--with-count.tsx +19 -0
  165. package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
  166. package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
  167. package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +17 -0
  168. package/docs/patterns/components-descriptionlist--details.tsx +21 -0
  169. package/docs/patterns/components-descriptionlist--post-metadata.tsx +52 -0
  170. package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
  171. package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
  172. package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
  173. package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
  174. package/docs/patterns/components-field--horizontal-input.tsx +1 -1
  175. package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
  176. package/docs/patterns/components-field--multi-control.tsx +1 -1
  177. package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
  178. package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
  179. package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
  180. package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
  181. package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
  182. package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
  183. package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
  184. package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
  185. package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
  186. package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
  187. package/docs/patterns/components-indexlist--post-index.tsx +36 -0
  188. package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
  189. package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
  190. package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
  191. package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
  192. package/docs/patterns/components-kbd--command-row.tsx +1 -1
  193. package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
  194. package/docs/patterns/components-kbd--shortcut.tsx +1 -1
  195. package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
  196. package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
  197. package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
  198. package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
  199. package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
  200. package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
  201. package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
  202. package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
  203. package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
  204. package/docs/patterns/components-prose--article-body.tsx +11 -0
  205. package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
  206. package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
  207. package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
  208. package/docs/patterns/components-sectioncaption--column-caption.tsx +16 -0
  209. package/docs/patterns/components-sectioncaption--with-action.tsx +19 -0
  210. package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
  211. package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
  212. package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
  213. package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
  214. package/docs/patterns/components-sitenav--compact.tsx +1 -1
  215. package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
  216. package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
  217. package/docs/patterns/components-stat--insights-row.tsx +1 -1
  218. package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
  219. package/docs/patterns/components-switch--default.tsx +1 -1
  220. package/docs/patterns/components-switch--settings-row.tsx +1 -1
  221. package/docs/patterns/components-tab--settings-pages.tsx +1 -1
  222. package/docs/patterns/components-taskrows--action-details.tsx +1 -1
  223. package/docs/patterns/components-taskrows--capsules.tsx +1 -1
  224. package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
  225. package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
  226. package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
  227. package/docs/patterns/components-taskrows--status-list.tsx +1 -1
  228. package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
  229. package/docs/patterns/components-textlink--external-destination.tsx +1 -1
  230. package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
  231. package/docs/patterns/components-textlink--quiet-title.tsx +15 -0
  232. package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
  233. package/docs/patterns/components-textsequence--default.tsx +1 -1
  234. package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
  235. package/docs/patterns/components-textsequence--shapes.tsx +1 -1
  236. package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
  237. package/docs/patterns/components-tooltip--controlled.tsx +1 -1
  238. package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
  239. package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
  240. package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
  241. package/docs/patterns/components-tooltip--placement.tsx +1 -1
  242. package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
  243. package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
  244. package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
  245. package/docs/patterns/guides-filter-panel--filtered-index.tsx +174 -0
  246. package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
  247. package/docs/patterns/guides-post-page--post-page.tsx +148 -0
  248. package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
  249. package/docs/patterns/index.json +161 -1
  250. package/package.json +1 -1
@@ -1,255 +1,697 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/cn.js";
3
- import { motionBeatSeconds as t, motionTransitionProp as n, readMotionDurationSeconds as ee } from "../../../lib/motion.js";
4
- import { ButtonIcon as r } from "../../atoms/Button/ButtonIcon.js";
5
- import { Button as i } from "../../atoms/Button/Button.js";
6
- import { Status as te } from "../../atoms/Status/Status.js";
7
- import { PromptBar as a } from "../../molecules/PromptBar/PromptBar.js";
3
+ import { motionBeatSeconds as t, motionStaggerSeconds as n, motionTransitionProp as r, readMotionDurationSeconds as i } from "../../../lib/motion.js";
4
+ import { ButtonIcon as a } from "../../atoms/Button/ButtonIcon.js";
5
+ import { Button as o } from "../../atoms/Button/Button.js";
6
+ import { IconButton as s } from "../../atoms/IconButton/IconButton.js";
7
+ import { Status as ee } from "../../atoms/Status/Status.js";
8
+ import { PromptBar as te } from "../../molecules/PromptBar/PromptBar.js";
8
9
  import { OverlayPanelHeader as ne } from "../Dialog/OverlayPanelHeader.js";
9
- import { chatDockAssistantMessageClasses as o, chatDockComposerClasses as re, chatDockDisclaimerClasses as ie, chatDockDockClasses as ae, chatDockGridClasses as oe, chatDockPillClasses as se, chatDockPillsClasses as ce, chatDockPlacements as s, chatDockRootClasses as le, chatDockSuggestionLabelClasses as ue, chatDockSuggestionListClasses as de, chatDockSuggestionRowContentClasses as fe, chatDockThinkingClasses as pe, chatDockThreadClasses as me, chatDockUserMessageClasses as he, chatDockWindowClasses as ge } from "./chatDockStyles.js";
10
- import { useEffect as _e, useId as c, useLayoutEffect as ve, useRef as l, useState as u } from "react";
11
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
- import { AnimatePresence as p, motion as m, useReducedMotion as ye } from "motion/react";
10
+ import { subscribeChatDockViewport as re, useChatDockVisibleArea as ie, useChatDockWide as ae } from "./chatDockViewport.js";
11
+ import { ChatDockGate as c, chatDockGateDefaultLabels as l } from "./ChatDockGate.js";
12
+ import { chatDockAssistantMessageClasses as u, chatDockComposerAreaClasses as oe, chatDockComposerClasses as se, chatDockComposerFootSpacerClasses as ce, chatDockComposerLayerClasses as le, chatDockDisclaimerClasses as ue, chatDockDockClasses as de, chatDockDockHoverClasses as fe, chatDockFollowUpRowClasses as pe, chatDockFollowUpsComposerClasses as me, chatDockFollowUpsInlineClasses as he, chatDockGridClasses as ge, chatDockMarkClasses as _e, chatDockPillClasses as ve, chatDockPillsClasses as ye, chatDockPlacements as d, chatDockReplyActionsClasses as be, chatDockReplyActionsPendingClasses as xe, chatDockReplyButtonsClasses as Se, chatDockReplyClasses as Ce, chatDockReplyMetaClasses as we, chatDockRootClasses as Te, chatDockRootRaisedClasses as Ee, chatDockSuggestionLabelClasses as De, chatDockSuggestionListClasses as Oe, chatDockSuggestionRowContentClasses as ke, chatDockThinkingClasses as Ae, chatDockThreadClasses as je, chatDockUserMessageClasses as Me, chatDockWindowClasses as Ne, chatDockWindowContentClasses as Pe } from "./chatDockStyles.js";
13
+ import { useContext as Fe, useEffect as f, useId as Ie, useLayoutEffect as p, useRef as m, useState as h, useSyncExternalStore as Le } from "react";
14
+ import { Check as Re, Copy as ze, CornerDownRight as Be, ThumbsDown as Ve, ThumbsUp as He } from "lucide-react";
15
+ import { Fragment as Ue, jsx as g, jsxs as _ } from "react/jsx-runtime";
16
+ import { AnimatePresence as v, MotionConfigContext as We, motion as y, useReducedMotion as Ge } from "motion/react";
13
17
  //#region src/components/organisms/ChatDock/ChatDock.tsx
14
- var h = {
18
+ var Ke = {
15
19
  close: "Close chat",
16
20
  thinking: "Thinking…",
17
21
  conversation: "Conversation",
18
22
  suggestions: "Suggested questions",
23
+ followUps: "Suggested follow-ups",
19
24
  field: "Ask anything",
20
- send: "Send"
21
- };
22
- function g(e) {
25
+ send: "Send",
26
+ copy: "Copy reply",
27
+ copied: "Copied",
28
+ helpful: "Mark this reply helpful",
29
+ notHelpful: "Mark this reply not helpful"
30
+ }, b = ["inline", "composer"];
31
+ function qe(e) {
23
32
  return e.filter((e) => e.prompt != null && e.prompt.trim() !== "");
24
33
  }
25
- function _(e, t) {
34
+ function Je(e, t) {
26
35
  return e.length > 0 && t.length === 0;
27
36
  }
28
- var v = 48, y = "inset(calc(100% - 3.25rem) 0rem 0rem 0rem round 1.625rem)", b = "inset(calc(0% - 0rem) 0rem 0rem 0rem round 1rem)";
29
- function x({ title: s, subtitle: x, mark: S, greeting: C, messages: w = [], thinking: be = !1, suggestions: T = [], onSend: xe, onSuggestionSelect: Se, open: E, defaultOpen: D = !1, onOpenChange: Ce, placeholder: O, disclaimer: k, labels: A, placement: j = "fixed", className: we }) {
30
- let M = {
31
- ...h,
32
- ...A
33
- }, N = c(), P = c(), F = ye(), I = E !== void 0, [Te, Ee] = u(D), L = I ? E : Te, [R, z] = u(""), B = l(null), V = l(null), H = l(null), U = l(!0), W = l(!1), G = l(L), K = l(L);
34
- function q(e) {
35
- e !== L && (I || Ee(e), Ce?.(e));
37
+ function Ye({ followUps: e, messages: t, thinking: n, sentAfterId: r }) {
38
+ let i = t[t.length - 1];
39
+ return e.length > 0 && !n && i?.role === "assistant" && i.id !== r;
40
+ }
41
+ function Xe({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
42
+ if (e.role !== "assistant") return null;
43
+ let i = {
44
+ copy: e.copyText != null,
45
+ vote: r && e.feedback !== void 0,
46
+ meta: e.meta != null
47
+ };
48
+ return !i.copy && !i.vote && !i.meta ? null : {
49
+ ...i,
50
+ ready: !(t && n)
51
+ };
52
+ }
53
+ var Ze = 2e3, Qe = 48;
54
+ function $e() {
55
+ return window.innerHeight;
56
+ }
57
+ function et() {
58
+ return Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
59
+ }
60
+ function x(e, t, n) {
61
+ return e === "inline" ? 32 * n : Math.max(0, Math.min(40 * n, t - 7 * n));
62
+ }
63
+ var S = 7, C = 12;
64
+ function tt({ windowHeight: e, headerHeight: t, bottomInset: n, remPx: r }) {
65
+ let i = r + t + .75 * r + S * r + .75 * r + n;
66
+ return Math.round(Math.max(C * r, e - i));
67
+ }
68
+ function w({ title: c, subtitle: l, mark: d, greeting: b, messages: S = [], thinking: C = !1, suggestions: w = [], onSend: nt, onSuggestionSelect: rt, followUps: T = [], followUpsPlacement: it = "inline", onMessageFeedback: at, gate: ot, open: st, defaultOpen: ct = !1, onOpenChange: lt, placeholder: ut, disclaimer: E, labels: dt, placement: D = "fixed", className: ft }) {
69
+ let O = {
70
+ ...Ke,
71
+ ...dt
72
+ }, pt = Ie(), mt = Ie(), { reducedMotion: ht } = Fe(We), k = Ge() === !0 || ht === "always", A = ae(), gt = Le(re, $e, () => 800), j = Le(re, et, () => 16), _t = st !== void 0, [vt, yt] = h(ct), M = _t ? st : vt, [bt, xt] = h(""), [St, Ct] = h(null), [N, wt] = h(null), [Tt, Et] = h(!M);
73
+ M && Tt && Et(!1);
74
+ let P = !M && Tt, F = ot != null, I = F && M, [Dt, Ot] = h(I), [L, R] = h(!1);
75
+ Dt !== I && (Ot(I), R(!0));
76
+ let [kt, At] = h(null), [jt, Mt] = h(!I);
77
+ I && jt && Mt(!1);
78
+ let [Nt, Pt] = h(I);
79
+ !I && Nt && Pt(!1);
80
+ let z = ie(D === "fixed" && !A && !P), B = m(null), Ft = m(null), It = m(null), Lt = m(null), Rt = m(null), V = m(null), zt = m(null), Bt = m(F), H = m(I), U = m(null), Vt = m(null), Ht = m(!0), W = m(!1), Ut = m(M), Wt = m(M);
81
+ function G(e) {
82
+ e !== M && (_t || yt(e), lt?.(e));
36
83
  }
37
- function J(e) {
84
+ function Gt(e) {
38
85
  let t = e.trim();
39
- t !== "" && (q(!0), U.current = !0, z(""), xe(t));
86
+ t !== "" && (G(!0), Ht.current = !0, xt(""), Ct(S[S.length - 1]?.id ?? null), nt(t));
87
+ }
88
+ function Kt(e) {
89
+ rt?.(e), e.prompt != null && Gt(e.prompt);
40
90
  }
41
- function Y(e) {
42
- Se?.(e), e.prompt != null && J(e.prompt);
91
+ function qt(e) {
92
+ let t = e.copyText, n = typeof navigator > "u" ? void 0 : navigator.clipboard;
93
+ t != null && n != null && n.writeText(t).then(() => wt({
94
+ id: e.id,
95
+ at: Date.now()
96
+ }), () => void 0);
43
97
  }
44
- _e(() => {
45
- L && !G.current ? V.current?.focus() : !L && G.current && (K.current = !1, W.current = !0, B.current?.focus(), W.current = !1), G.current = L;
46
- }, [L]), ve(() => {
47
- let e = H.current;
48
- e != null && U.current && (e.scrollTop = e.scrollHeight);
98
+ f(() => {
99
+ if (N == null) return;
100
+ let e = window.setTimeout(() => wt(null), Ze);
101
+ return () => window.clearTimeout(e);
102
+ }, [N]);
103
+ function Jt(e) {
104
+ Kt(e), U.current?.focus();
105
+ }
106
+ function Yt(e) {
107
+ Kt(e), e.prompt != null && U.current?.focus();
108
+ }
109
+ f(() => {
110
+ Wt.current = M;
111
+ let e = U.current;
112
+ if (e != null && M && !Ut.current) document.activeElement !== e && e.focus();
113
+ else if (e != null && !M && Ut.current) {
114
+ let t = document.activeElement, n = t == null || t === document.body || B.current?.contains(t) === !0;
115
+ t !== e && n && (W.current = !0, e.focus(), W.current = !1);
116
+ }
117
+ Ut.current = M;
118
+ }, [M]), f(() => {
119
+ F && !Bt.current && !Wt.current && G(!0), Bt.current = F;
120
+ }), f(() => {
121
+ if (I && !H.current) {
122
+ let e = zt.current;
123
+ (e?.querySelector("[data-chat-dock-gate-focus]") ?? e)?.focus({ preventScroll: !0 });
124
+ } else if (!I && H.current && M) {
125
+ let e = U.current, t = document.activeElement, n = t == null || t === document.body || B.current?.contains(t) === !0;
126
+ e != null && n && (W.current = !0, e.focus({ preventScroll: !0 }), W.current = !1);
127
+ }
128
+ H.current = I;
129
+ }, [I, M]), f(() => {
130
+ if (!L) return;
131
+ let e = (i("fast") + i("medium")) * 1e3 + 100, t = window.setTimeout(() => R(!1), e);
132
+ return () => window.clearTimeout(t);
133
+ }, [L]), p(() => {
134
+ let e = Rt.current;
135
+ if (e == null || typeof ResizeObserver > "u") return;
136
+ let t = new ResizeObserver(() => At(e.offsetHeight));
137
+ return t.observe(e), () => {
138
+ t.disconnect();
139
+ };
140
+ }, []);
141
+ let Xt = E != null, K = D === "fixed" && !A ? "rise" : "grow";
142
+ p(() => {
143
+ let e = B.current, t = It.current, n = Lt.current;
144
+ if (e == null || t == null || n == null) return;
145
+ let r = () => {
146
+ let r = K === "rise" ? Math.max(0, window.innerHeight - z.bottom - e.getBoundingClientRect().bottom) : 0;
147
+ Ft.current?.style.setProperty("--chat-dock-composer", `${t.offsetHeight + n.offsetHeight + r}px`);
148
+ let i = tt({
149
+ windowHeight: K === "rise" ? window.innerHeight - z.top - z.bottom : x(D, window.innerHeight, j),
150
+ headerHeight: V.current?.offsetHeight || 4 * j,
151
+ bottomInset: n.offsetHeight + r,
152
+ remPx: j
153
+ });
154
+ e.style.setProperty("--chat-dock-gate-max", `${i}px`);
155
+ };
156
+ if (r(), typeof ResizeObserver > "u") return;
157
+ let i = new ResizeObserver(r);
158
+ return i.observe(t), i.observe(n), V.current != null && i.observe(V.current), () => {
159
+ i.disconnect();
160
+ };
161
+ }, [
162
+ Xt,
163
+ K,
164
+ gt,
165
+ z.top,
166
+ z.bottom,
167
+ D,
168
+ j,
169
+ I
170
+ ]), p(() => {
171
+ let e = Vt.current;
172
+ e != null && Ht.current && (e.scrollTop = e.scrollHeight);
49
173
  });
50
- function De(e) {
51
- e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), q(!1));
174
+ function Zt(e) {
175
+ !M || I || e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), G(!1));
52
176
  }
53
- let X = g(T), Oe = _(T, w), ke = n("medium"), Z = n("fast"), Q = F ? {
54
- initial: { opacity: 0 },
55
- animate: { opacity: 1 },
56
- exit: { opacity: 0 }
177
+ let Qt = qe(w), $t = !I && Je(w, S), en = !I && Ye({
178
+ followUps: T,
179
+ messages: S,
180
+ thinking: C,
181
+ sentAfterId: St
182
+ }), q = M ? "open" : "closed", J = r("medium"), Y = r("fast"), tn = n(), nn = t(1), X = tn, Z = { duration: 0 }, Q = {
183
+ default: Z,
184
+ opacity: Y
185
+ }, rn = 3.25 * j, an = {
186
+ height: rn,
187
+ left: 0,
188
+ right: 0,
189
+ borderRadius: rn / 2
190
+ }, on = {
191
+ height: x(D, gt, j),
192
+ left: -j,
193
+ right: -j,
194
+ borderRadius: j
195
+ }, sn = k ? {
196
+ open: {
197
+ ...K === "grow" ? on : { y: 0 },
198
+ opacity: 1,
199
+ transition: Q
200
+ },
201
+ closed: {
202
+ ...K === "grow" ? on : { y: 0 },
203
+ opacity: 0,
204
+ transition: Q
205
+ }
206
+ } : K === "grow" ? {
207
+ open: {
208
+ ...on,
209
+ opacity: 1,
210
+ transition: J
211
+ },
212
+ closed: {
213
+ ...an,
214
+ opacity: 1,
215
+ transition: {
216
+ ...J,
217
+ delay: X
218
+ }
219
+ }
57
220
  } : {
58
- initial: {
59
- clipPath: y,
60
- opacity: .6
221
+ open: {
222
+ y: 0,
223
+ opacity: 1,
224
+ transition: J
225
+ },
226
+ closed: {
227
+ y: "100%",
228
+ opacity: 1,
229
+ transition: {
230
+ ...J,
231
+ delay: X
232
+ }
233
+ }
234
+ }, cn = {
235
+ variants: k ? {
236
+ open: {},
237
+ closed: {}
238
+ } : {
239
+ open: (e) => ({
240
+ opacity: 1,
241
+ y: 0,
242
+ transition: {
243
+ ...Y,
244
+ delay: nn + e * tn
245
+ }
246
+ }),
247
+ closed: {
248
+ opacity: 0,
249
+ y: 8,
250
+ transition: Y
251
+ }
252
+ },
253
+ initial: !1,
254
+ animate: q
255
+ }, ln = {
256
+ open: {
257
+ width: 0,
258
+ opacity: 0,
259
+ transition: k ? Q : {
260
+ width: J,
261
+ opacity: Y
262
+ }
61
263
  },
62
- animate: {
63
- clipPath: b,
264
+ closed: {
265
+ width: "auto",
64
266
  opacity: 1,
65
- transitionEnd: { clipPath: "none" }
267
+ transition: k ? Q : {
268
+ width: {
269
+ ...J,
270
+ delay: X
271
+ },
272
+ opacity: {
273
+ ...Y,
274
+ delay: nn
275
+ }
276
+ }
277
+ }
278
+ }, un = {
279
+ open: {
280
+ height: "auto",
281
+ opacity: 1,
282
+ transition: k ? Q : {
283
+ height: J,
284
+ opacity: {
285
+ ...Y,
286
+ delay: nn
287
+ }
288
+ }
66
289
  },
290
+ closed: {
291
+ height: 0,
292
+ opacity: 0,
293
+ transition: k ? Q : {
294
+ height: {
295
+ ...J,
296
+ delay: X
297
+ },
298
+ opacity: Y
299
+ }
300
+ }
301
+ }, dn = {
302
+ initial: !k && "hidden",
303
+ animate: M ? "visible" : "folded",
67
304
  exit: {
68
- clipPath: [b, y],
69
- opacity: [1, .6]
305
+ opacity: 0,
306
+ transition: Z
307
+ },
308
+ variants: {
309
+ hidden: {},
310
+ visible: {
311
+ opacity: 1,
312
+ transition: {
313
+ ...Y,
314
+ staggerChildren: tn
315
+ }
316
+ },
317
+ folded: {
318
+ opacity: 0,
319
+ transition: k ? Z : Y
320
+ }
70
321
  }
71
- }, $ = F || K.current ? {} : {
72
- initial: {
322
+ }, fn = {
323
+ hidden: {
73
324
  opacity: 0,
74
- y: 8
325
+ y: 6
75
326
  },
76
- animate: {
327
+ visible: {
77
328
  opacity: 1,
78
- y: 0
79
- },
80
- transition: {
81
- ...Z,
82
- delay: t(1)
329
+ y: 0,
330
+ transition: Y
83
331
  }
84
- }, Ae = F ? 0 : ee("medium") * .6;
85
- return /* @__PURE__ */ d("div", {
86
- className: e(le[j], we),
87
- "data-open": L ? "" : void 0,
88
- children: /* @__PURE__ */ d("div", {
89
- className: oe,
90
- children: /* @__PURE__ */ d("div", {
332
+ }, $ = (e) => e.preventDefault(), pn = A ? "sm" : "md";
333
+ function mn(t, n) {
334
+ let r = N?.id === t.id, i = t.feedback ?? null, a = (e) => at?.(t, i === e ? null : e);
335
+ return /* @__PURE__ */ _("div", {
336
+ className: e(be, n.ready ? void 0 : xe),
337
+ "data-reply-actions": n.ready ? "ready" : "pending",
338
+ children: [n.copy || n.vote ? /* @__PURE__ */ _("div", {
339
+ className: Se,
340
+ children: [n.copy ? /* @__PURE__ */ g(s, {
341
+ size: pn,
342
+ icon: g(r ? Re : ze, {}),
343
+ "aria-label": r ? O.copied : O.copy,
344
+ onClick: () => qt(t)
345
+ }) : null, n.vote ? /* @__PURE__ */ _(Ue, { children: [/* @__PURE__ */ g(s, {
346
+ size: pn,
347
+ icon: /* @__PURE__ */ g(He, {}),
348
+ "aria-label": O.helpful,
349
+ pressed: i === "up",
350
+ onClick: () => a("up")
351
+ }), /* @__PURE__ */ g(s, {
352
+ size: pn,
353
+ icon: /* @__PURE__ */ g(Ve, {}),
354
+ "aria-label": O.notHelpful,
355
+ pressed: i === "down",
356
+ onClick: () => a("down")
357
+ })] }) : null]
358
+ }) : null, t.meta == null ? null : /* @__PURE__ */ _("p", {
359
+ className: we,
360
+ children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */ _("span", {
361
+ className: "sr-only",
362
+ children: [". ", t.meta.description]
363
+ })]
364
+ })]
365
+ });
366
+ }
367
+ return /* @__PURE__ */ g("div", {
368
+ className: e(Te[D], D === "fixed" && !P ? Ee : void 0, ft),
369
+ "data-open": M ? "" : void 0,
370
+ "data-gate": I ? "" : void 0,
371
+ style: z.top > 0 || z.bottom > 0 ? {
372
+ "--chat-dock-vv-top": `${z.top}px`,
373
+ "--chat-dock-vv-bottom": `${z.bottom}px`
374
+ } : void 0,
375
+ children: /* @__PURE__ */ g("div", {
376
+ className: ge,
377
+ children: /* @__PURE__ */ g("div", {
91
378
  className: "band",
92
- children: /* @__PURE__ */ d(p, {
93
- initial: !1,
94
- mode: "popLayout",
95
- children: L ? /* @__PURE__ */ f(m.section, {
96
- role: "dialog",
97
- "aria-modal": "false",
98
- "aria-labelledby": N,
99
- "aria-describedby": x == null ? void 0 : P,
100
- className: ge[j],
101
- initial: Q.initial,
102
- animate: Q.animate,
103
- exit: Q.exit,
104
- transition: ke,
105
- onKeyDown: De,
106
- children: [
107
- /* @__PURE__ */ d(ne, {
108
- titleId: N,
109
- descriptionId: P,
110
- title: s,
111
- description: x,
112
- headerStart: S,
113
- closeLabel: M.close,
114
- onClose: () => q(!1),
115
- delineated: !0
116
- }),
117
- /* @__PURE__ */ f("div", {
118
- ref: H,
119
- className: me,
120
- role: "log",
121
- "aria-label": M.conversation,
122
- onScroll: (e) => {
123
- let t = e.currentTarget;
124
- U.current = t.scrollHeight - t.scrollTop - t.clientHeight <= v;
379
+ children: /* @__PURE__ */ _("div", {
380
+ ref: B,
381
+ className: e(de, P ? fe : void 0),
382
+ role: M ? "dialog" : void 0,
383
+ "aria-modal": M ? "false" : void 0,
384
+ "aria-labelledby": M ? pt : void 0,
385
+ "aria-describedby": M && l != null ? mt : void 0,
386
+ onKeyDown: Zt,
387
+ children: [
388
+ /* @__PURE__ */ g(v, {
389
+ initial: !1,
390
+ children: !M && Qt.length > 0 ? /* @__PURE__ */ g(y.div, {
391
+ className: ye,
392
+ role: "group",
393
+ "aria-label": O.suggestions,
394
+ exit: {
395
+ opacity: 0,
396
+ transition: k ? Z : Y
125
397
  },
126
- children: [C == null ? null : /* @__PURE__ */ d(m.div, {
127
- className: o,
128
- ...$,
129
- children: C
130
- }), /* @__PURE__ */ f(p, {
131
- initial: !1,
132
- children: [w.map((e) => /* @__PURE__ */ d(m.div, {
133
- "data-role": e.role,
134
- className: e.role === "user" ? he : o,
135
- initial: !F && {
136
- opacity: 0,
137
- y: 8
398
+ children: Qt.map((e, t) => /* @__PURE__ */ g("span", {
399
+ className: ve,
400
+ style: { "--chat-dock-pill-index": t },
401
+ children: /* @__PURE__ */ g(o, {
402
+ type: "button",
403
+ role: "secondary",
404
+ size: "md",
405
+ icon: e.icon,
406
+ onClick: () => Kt(e),
407
+ children: e.label
408
+ })
409
+ }, e.id))
410
+ }, "pills") : null
411
+ }),
412
+ /* @__PURE__ */ g(y.div, {
413
+ ref: Ft,
414
+ className: Ne[D],
415
+ "data-chat-dock-window": q,
416
+ hidden: P,
417
+ variants: sn,
418
+ initial: !1,
419
+ animate: q,
420
+ onAnimationComplete: (e) => {
421
+ e === "closed" && !Wt.current && Et(!0);
422
+ },
423
+ children: /* @__PURE__ */ _("div", {
424
+ className: Pe,
425
+ children: [
426
+ /* @__PURE__ */ g(y.div, {
427
+ ref: V,
428
+ className: "shrink-0",
429
+ custom: 0,
430
+ ...cn,
431
+ children: /* @__PURE__ */ g(ne, {
432
+ titleId: pt,
433
+ descriptionId: mt,
434
+ title: c,
435
+ description: l,
436
+ headerStart: d,
437
+ closeLabel: O.close,
438
+ onClose: () => G(!1),
439
+ delineated: !0
440
+ })
441
+ }),
442
+ /* @__PURE__ */ _(y.div, {
443
+ ref: Vt,
444
+ className: je,
445
+ role: "log",
446
+ "aria-label": O.conversation,
447
+ tabIndex: 0,
448
+ custom: 1,
449
+ ...cn,
450
+ onScroll: (e) => {
451
+ let t = e.currentTarget;
452
+ Ht.current = t.scrollHeight - t.scrollTop - t.clientHeight <= Qe;
138
453
  },
139
- animate: {
454
+ children: [b == null ? null : /* @__PURE__ */ g("div", {
455
+ className: u,
456
+ children: b
457
+ }), /* @__PURE__ */ _(v, {
458
+ initial: !1,
459
+ children: [
460
+ S.map((e, t) => {
461
+ let n = Xe({
462
+ message: e,
463
+ isLatest: t === S.length - 1,
464
+ thinking: C,
465
+ takesVotes: at != null
466
+ });
467
+ return /* @__PURE__ */ g(y.div, {
468
+ "data-role": e.role,
469
+ className: e.role === "user" ? Me : n == null ? u : Ce,
470
+ initial: !k && {
471
+ opacity: 0,
472
+ y: 8
473
+ },
474
+ animate: {
475
+ opacity: 1,
476
+ y: 0
477
+ },
478
+ transition: Y,
479
+ children: n == null ? e.content : /* @__PURE__ */ _(Ue, { children: [/* @__PURE__ */ g("div", {
480
+ className: u,
481
+ children: e.content
482
+ }), mn(e, n)] })
483
+ }, e.id);
484
+ }),
485
+ en && it === "inline" ? /* @__PURE__ */ g(y.div, {
486
+ role: "group",
487
+ "aria-label": O.followUps,
488
+ "data-follow-ups": "inline",
489
+ className: he,
490
+ ...dn,
491
+ animate: "visible",
492
+ children: T.map((e) => /* @__PURE__ */ g(y.div, {
493
+ className: pe,
494
+ variants: fn,
495
+ children: /* @__PURE__ */ g(o, {
496
+ type: "button",
497
+ role: "ghost",
498
+ layout: "row",
499
+ onMouseDown: $,
500
+ onClick: () => Jt(e),
501
+ children: /* @__PURE__ */ _("span", {
502
+ className: ke,
503
+ children: [/* @__PURE__ */ g(a, {
504
+ size: "md",
505
+ children: /* @__PURE__ */ g(Be, {})
506
+ }), /* @__PURE__ */ g("span", {
507
+ className: De,
508
+ children: e.label
509
+ })]
510
+ })
511
+ })
512
+ }, e.id))
513
+ }, "follow-ups") : null,
514
+ C ? /* @__PURE__ */ _(y.div, {
515
+ className: Ae,
516
+ initial: !k && { opacity: 0 },
517
+ animate: { opacity: 1 },
518
+ exit: {
519
+ opacity: 0,
520
+ transition: Z
521
+ },
522
+ transition: Y,
523
+ children: [/* @__PURE__ */ g(ee, {
524
+ variant: "dot",
525
+ tone: "neutral",
526
+ pulsing: !0,
527
+ besideLabel: !0
528
+ }), /* @__PURE__ */ g("span", { children: O.thinking })]
529
+ }, "thinking") : null
530
+ ]
531
+ })]
532
+ }),
533
+ $t ? /* @__PURE__ */ g(y.div, {
534
+ className: Oe,
535
+ role: "group",
536
+ "aria-label": O.suggestions,
537
+ custom: 2,
538
+ ...cn,
539
+ children: w.map((e) => /* @__PURE__ */ g(o, {
540
+ type: "button",
541
+ role: "ghost",
542
+ layout: "row",
543
+ onMouseDown: e.prompt == null ? void 0 : $,
544
+ onClick: () => Yt(e),
545
+ children: /* @__PURE__ */ _("span", {
546
+ className: ke,
547
+ children: [e.icon == null ? null : /* @__PURE__ */ g(a, {
548
+ size: "md",
549
+ children: e.icon
550
+ }), /* @__PURE__ */ g("span", {
551
+ className: De,
552
+ children: e.label
553
+ })]
554
+ })
555
+ }, e.id))
556
+ }) : null,
557
+ /* @__PURE__ */ g(v, {
558
+ initial: !1,
559
+ children: en && it === "composer" ? /* @__PURE__ */ g(y.div, {
560
+ role: "group",
561
+ "aria-label": O.followUps,
562
+ "data-follow-ups": "composer",
563
+ className: me,
564
+ ...dn,
565
+ children: T.map((e) => /* @__PURE__ */ g(y.span, {
566
+ className: "inline-flex",
567
+ variants: fn,
568
+ children: /* @__PURE__ */ g(o, {
569
+ type: "button",
570
+ role: "secondary",
571
+ size: "md",
572
+ onMouseDown: $,
573
+ onClick: () => Jt(e),
574
+ children: e.label
575
+ })
576
+ }, e.id))
577
+ }, "follow-ups") : null
578
+ })
579
+ ]
580
+ })
581
+ }, K),
582
+ /* @__PURE__ */ g("span", {
583
+ className: "sr-only",
584
+ role: "status",
585
+ children: N == null ? "" : O.copied
586
+ }),
587
+ /* @__PURE__ */ _("div", {
588
+ className: se,
589
+ children: [/* @__PURE__ */ g(y.div, {
590
+ ref: It,
591
+ initial: !1,
592
+ animate: { height: kt ?? "auto" },
593
+ transition: L && !k ? J : Z,
594
+ style: L ? { overflow: "hidden" } : void 0,
595
+ onAnimationComplete: () => R(!1),
596
+ children: /* @__PURE__ */ _("div", {
597
+ ref: Rt,
598
+ className: oe,
599
+ children: [/* @__PURE__ */ g(v, {
600
+ initial: !1,
601
+ children: F ? /* @__PURE__ */ g(y.div, {
602
+ ref: zt,
603
+ className: e(le, I ? void 0 : "pointer-events-none"),
604
+ "data-chat-dock-gate": "",
605
+ hidden: jt,
606
+ initial: {
607
+ opacity: 0,
608
+ y: 12
609
+ },
610
+ animate: I ? {
611
+ opacity: 1,
612
+ y: 0,
613
+ transition: {
614
+ ...Y,
615
+ delay: k ? 0 : Y.duration
616
+ }
617
+ } : {
618
+ opacity: 0,
619
+ y: 12,
620
+ transition: Y
621
+ },
622
+ exit: {
623
+ opacity: 0,
624
+ y: 12,
625
+ transition: Y
626
+ },
627
+ onAnimationComplete: () => {
628
+ I || Mt(!0);
629
+ },
630
+ children: ot
631
+ }, "gate") : null
632
+ }), /* @__PURE__ */ g(y.div, {
633
+ className: e(le, I ? "pointer-events-none" : void 0),
634
+ hidden: Nt,
635
+ initial: !1,
636
+ animate: I ? {
637
+ opacity: 0,
638
+ transition: Y
639
+ } : {
140
640
  opacity: 1,
141
- y: 0
641
+ transition: {
642
+ ...Y,
643
+ delay: L && !k ? Y.duration : 0
644
+ }
142
645
  },
143
- transition: Z,
144
- children: e.content
145
- }, e.id)), be ? /* @__PURE__ */ f(m.div, {
146
- className: pe,
147
- initial: !F && { opacity: 0 },
148
- animate: { opacity: 1 },
149
- exit: {
150
- opacity: 0,
151
- transition: { duration: 0 }
646
+ onAnimationComplete: () => {
647
+ I && Pt(!0);
152
648
  },
153
- transition: Z,
154
- children: [/* @__PURE__ */ d(te, {
155
- variant: "dot",
156
- tone: "neutral",
157
- pulsing: !0,
158
- besideLabel: !0
159
- }), /* @__PURE__ */ d("span", { children: M.thinking })]
160
- }, "thinking") : null]
161
- })]
162
- }),
163
- Oe ? /* @__PURE__ */ d(m.div, {
164
- className: de,
165
- role: "group",
166
- "aria-label": M.suggestions,
167
- ...$,
168
- children: T.map((e) => /* @__PURE__ */ d(i, {
169
- type: "button",
170
- role: "ghost",
171
- layout: "row",
172
- onClick: () => Y(e),
173
- children: /* @__PURE__ */ f("span", {
174
- className: fe,
175
- children: [e.icon == null ? null : /* @__PURE__ */ d(r, {
176
- size: "md",
177
- children: e.icon
178
- }), /* @__PURE__ */ d("span", {
179
- className: ue,
180
- children: e.label
181
- })]
182
- })
183
- }, e.id))
184
- }) : null,
185
- /* @__PURE__ */ d("div", {
186
- className: re,
187
- children: /* @__PURE__ */ d(a, {
188
- ref: V,
189
- value: R,
190
- onValueChange: z,
191
- onSend: J,
192
- placeholder: O,
193
- "aria-label": M.field,
194
- sendLabel: M.send
649
+ children: /* @__PURE__ */ g(te, {
650
+ ref: U,
651
+ value: bt,
652
+ onValueChange: (e) => {
653
+ xt(e), G(!0);
654
+ },
655
+ onSend: Gt,
656
+ onFocus: () => {
657
+ W.current || G(!0);
658
+ },
659
+ onClick: () => G(!0),
660
+ start: d == null ? void 0 : /* @__PURE__ */ g(y.span, {
661
+ className: _e,
662
+ "aria-hidden": M ? !0 : void 0,
663
+ variants: ln,
664
+ initial: !1,
665
+ animate: q,
666
+ children: d
667
+ }),
668
+ placeholder: ut,
669
+ "aria-label": O.field,
670
+ sendLabel: O.send
671
+ })
672
+ })]
195
673
  })
196
- }),
197
- k == null ? null : /* @__PURE__ */ d("p", {
198
- className: ie,
199
- children: k
200
- })
201
- ]
202
- }, "window") : /* @__PURE__ */ f(m.div, {
203
- className: ae,
204
- initial: { opacity: 0 },
205
- animate: {
206
- opacity: 1,
207
- transition: {
208
- ...Z,
209
- delay: Ae
210
- }
211
- },
212
- exit: {
213
- opacity: 0,
214
- transition: { duration: 0 }
215
- },
216
- children: [X.length > 0 ? /* @__PURE__ */ d("div", {
217
- className: ce,
218
- role: "group",
219
- "aria-label": M.suggestions,
220
- children: X.map((e, t) => /* @__PURE__ */ d("span", {
221
- className: se,
222
- style: { "--chat-dock-pill-index": t },
223
- children: /* @__PURE__ */ d(i, {
224
- type: "button",
225
- role: "secondary",
226
- size: "md",
227
- icon: e.icon,
228
- onClick: () => Y(e),
229
- children: e.label
674
+ }), /* @__PURE__ */ g(y.div, {
675
+ className: "overflow-hidden",
676
+ "aria-hidden": !M || void 0,
677
+ variants: un,
678
+ initial: !1,
679
+ animate: q,
680
+ children: /* @__PURE__ */ g("div", {
681
+ ref: Lt,
682
+ children: E != null && !I ? /* @__PURE__ */ g("p", {
683
+ className: ue[D],
684
+ children: E
685
+ }) : /* @__PURE__ */ g("div", { className: ce[D] })
230
686
  })
231
- }, e.id))
232
- }) : null, /* @__PURE__ */ d(a, {
233
- ref: B,
234
- value: R,
235
- onValueChange: (e) => {
236
- z(e), q(!0);
237
- },
238
- onSend: J,
239
- onFocus: () => {
240
- W.current || q(!0);
241
- },
242
- onClick: () => q(!0),
243
- start: S,
244
- placeholder: O,
245
- "aria-label": M.field,
246
- sendLabel: M.send
247
- })]
248
- }, "rest")
687
+ })]
688
+ })
689
+ ]
249
690
  })
250
691
  })
251
692
  })
252
693
  });
253
694
  }
695
+ var nt = Object.assign(w, { Gate: c });
254
696
  //#endregion
255
- export { x as ChatDock, y as chatDockClosedClip, h as chatDockDefaultLabels, b as chatDockOpenClip, g as chatDockPillSuggestions, s as chatDockPlacements, _ as chatDockShowsSuggestionRows };
697
+ export { nt as ChatDock, c as ChatDockGate, Ke as chatDockDefaultLabels, b as chatDockFollowUpsPlacements, l as chatDockGateDefaultLabels, tt as chatDockGateMaxHeight, x as chatDockOpenHeight, qe as chatDockPillSuggestions, d as chatDockPlacements, Xe as chatDockReplyRow, Ye as chatDockShowsFollowUps, Je as chatDockShowsSuggestionRows };