@hex-core/components 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/_tsup-dts-rollup.d.ts +3105 -0
  2. package/dist/accordion.d.ts +4 -13
  3. package/dist/alert-dialog.d.ts +11 -34
  4. package/dist/alert.d.ts +4 -17
  5. package/dist/aspect-ratio.d.ts +1 -7
  6. package/dist/avatar.d.ts +3 -11
  7. package/dist/badge.d.ts +3 -22
  8. package/dist/breadcrumb.d.ts +7 -27
  9. package/dist/button.d.ts +3 -13
  10. package/dist/calendar.d.ts +1 -17
  11. package/dist/card.d.ts +6 -16
  12. package/dist/checkbox.d.ts +2 -11
  13. package/dist/citation.d.ts +2 -0
  14. package/dist/citation.js +70 -0
  15. package/dist/citation.js.map +1 -0
  16. package/dist/cluster.d.ts +3 -34
  17. package/dist/code-block-copy.d.ts +2 -0
  18. package/dist/code-block-copy.js +108 -0
  19. package/dist/code-block-copy.js.map +1 -0
  20. package/dist/code-block.d.ts +3 -0
  21. package/dist/code-block.js +90 -0
  22. package/dist/code-block.js.map +1 -0
  23. package/dist/collapsible.d.ts +3 -11
  24. package/dist/color-picker.d.ts +2 -44
  25. package/dist/combobox.d.ts +3 -45
  26. package/dist/command.d.ts +9 -111
  27. package/dist/composer.d.ts +2 -0
  28. package/dist/composer.js +75 -0
  29. package/dist/composer.js.map +1 -0
  30. package/dist/container.d.ts +3 -41
  31. package/dist/context-menu.d.ts +12 -37
  32. package/dist/data-table.d.ts +2 -33
  33. package/dist/date-picker.d.ts +2 -43
  34. package/dist/dialog.d.ts +11 -46
  35. package/dist/drawer.d.ts +10 -41
  36. package/dist/dropdown-menu.d.ts +13 -39
  37. package/dist/dropzone.d.ts +3 -54
  38. package/dist/file-tree.d.ts +3 -53
  39. package/dist/form.d.ts +8 -45
  40. package/dist/grid.d.ts +3 -50
  41. package/dist/hover-card.d.ts +3 -11
  42. package/dist/index.d.ts +298 -179
  43. package/dist/index.js +674 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/input-otp.d.ts +5 -19
  46. package/dist/input.d.ts +2 -6
  47. package/dist/label.d.ts +2 -11
  48. package/dist/loading-indicator.d.ts +3 -0
  49. package/dist/loading-indicator.js +64 -0
  50. package/dist/loading-indicator.js.map +1 -0
  51. package/dist/markdown.d.ts +2 -0
  52. package/dist/markdown.js +28 -0
  53. package/dist/markdown.js.map +1 -0
  54. package/dist/menubar.d.ts +11 -35
  55. package/dist/message-actions.d.ts +2 -0
  56. package/dist/message-actions.js +28 -0
  57. package/dist/message-actions.js.map +1 -0
  58. package/dist/message-list.d.ts +2 -0
  59. package/dist/message-list.js +49 -0
  60. package/dist/message-list.js.map +1 -0
  61. package/dist/message.d.ts +3 -0
  62. package/dist/message.js +35 -0
  63. package/dist/message.js.map +1 -0
  64. package/dist/multi-combobox.d.ts +3 -51
  65. package/dist/navigation-menu.d.ts +9 -23
  66. package/dist/pagination.d.ts +7 -40
  67. package/dist/popover.d.ts +4 -13
  68. package/dist/progress.d.ts +1 -10
  69. package/dist/radio-group.d.ts +2 -9
  70. package/dist/reasoning.d.ts +2 -0
  71. package/dist/reasoning.js +90 -0
  72. package/dist/reasoning.js.map +1 -0
  73. package/dist/resizable.d.ts +3 -28
  74. package/dist/schemas.d.ts +72 -121
  75. package/dist/schemas.js +849 -1
  76. package/dist/schemas.js.map +1 -1
  77. package/dist/scroll-area.d.ts +3 -18
  78. package/dist/select.d.ts +8 -21
  79. package/dist/separator.d.ts +2 -11
  80. package/dist/sheet.d.ts +10 -39
  81. package/dist/sidebar.d.ts +8 -75
  82. package/dist/skeleton.d.ts +1 -11
  83. package/dist/slider.d.ts +2 -20
  84. package/dist/sonner.d.ts +2 -14
  85. package/dist/spacer.d.ts +3 -38
  86. package/dist/stack.d.ts +3 -34
  87. package/dist/stepper.d.ts +4 -48
  88. package/dist/suggestion.d.ts +2 -0
  89. package/dist/suggestion.js +55 -0
  90. package/dist/suggestion.js.map +1 -0
  91. package/dist/switch.d.ts +2 -11
  92. package/dist/table.d.ts +8 -24
  93. package/dist/tabs.d.ts +4 -13
  94. package/dist/textarea.d.ts +2 -10
  95. package/dist/time-picker.d.ts +2 -34
  96. package/dist/timeline.d.ts +4 -42
  97. package/dist/toggle-group.d.ts +2 -17
  98. package/dist/toggle.d.ts +2 -19
  99. package/dist/tool-call.d.ts +2 -0
  100. package/dist/tool-call.js +133 -0
  101. package/dist/tool-call.js.map +1 -0
  102. package/dist/tooltip.d.ts +4 -13
  103. package/package.json +4 -1
  104. package/dist/button-variants-Bx6gCUFp.d.ts +0 -19
package/dist/schemas.js CHANGED
@@ -4638,6 +4638,854 @@ var sidebarSchema = {
4638
4638
  tags: ["sidebar", "navigation", "app-shell", "layout"]
4639
4639
  };
4640
4640
 
4641
- export { accordionSchema, alertDialogSchema, alertSchema, aspectRatioSchema, avatarSchema, badgeSchema, breadcrumbSchema, buttonSchema, calendarSchema, cardSchema, checkboxSchema, clusterSchema, collapsibleSchema, colorPickerSchema, comboboxSchema, commandSchema, containerSchema, contextMenuSchema, dataTableSchema, datePickerSchema, dialogSchema, drawerSchema, dropdownMenuSchema, dropzoneSchema, fileTreeSchema, formSchema, gridSchema, hoverCardSchema, inputOTPSchema, inputSchema, labelSchema, menubarSchema, multiComboboxSchema, navigationMenuSchema, paginationSchema, popoverSchema, progressSchema, radioGroupSchema, resizableSchema, scrollAreaSchema, selectSchema, separatorSchema, sheetSchema, sidebarSchema, skeletonSchema, sliderSchema, sonnerSchema, spacerSchema, stackSchema, stepperSchema, switchSchema, tableSchema, tabsSchema, textareaSchema, timePickerSchema, timelineSchema, toggleGroupSchema, toggleSchema, tooltipSchema };
4641
+ // src/ai/message/message.schema.ts
4642
+ var messageSchema = {
4643
+ name: "message",
4644
+ displayName: "Message",
4645
+ description: "Single chat-message row scoped to one speaker (user / assistant / system / tool). Headless content slot \u2014 pair with Markdown, CodeBlock, or ToolCall children.",
4646
+ category: "ai",
4647
+ subcategory: "chat",
4648
+ props: [
4649
+ {
4650
+ name: "role",
4651
+ type: "enum",
4652
+ required: true,
4653
+ description: "Speaker. Drives variant styling and the data-role attribute.",
4654
+ enumValues: ["user", "assistant", "system", "tool"]
4655
+ },
4656
+ {
4657
+ name: "children",
4658
+ type: "ReactNode",
4659
+ required: true,
4660
+ description: "Message content. Strings, Markdown, CodeBlock, ToolCall, or any composition."
4661
+ },
4662
+ {
4663
+ name: "className",
4664
+ type: "string",
4665
+ required: false,
4666
+ description: "Additional CSS classes merged onto the row."
4667
+ }
4668
+ ],
4669
+ variants: [
4670
+ {
4671
+ name: "role",
4672
+ description: "Visual treatment per speaker.",
4673
+ values: [
4674
+ { value: "user", description: "Tinted secondary background \u2014 user turns.", useWhen: "The author is the human." },
4675
+ { value: "assistant", description: "Card background \u2014 model output.", useWhen: "The author is the LLM/agent." },
4676
+ { value: "system", description: "Muted, italic \u2014 system instructions.", useWhen: "Rendering a visible system prompt or framing message." },
4677
+ { value: "tool", description: "Accent left-border \u2014 tool messages distinct from assistant text.", useWhen: "Showing raw tool/function output as its own turn." }
4678
+ ],
4679
+ default: "assistant"
4680
+ }
4681
+ ],
4682
+ slots: [
4683
+ {
4684
+ name: "children",
4685
+ description: "Message body. Compose with Markdown, CodeBlock, ToolCall, or plain text.",
4686
+ required: true,
4687
+ acceptedTypes: ["ReactNode"]
4688
+ }
4689
+ ],
4690
+ dependencies: {
4691
+ npm: ["class-variance-authority", "clsx", "tailwind-merge"],
4692
+ internal: ["lib/utils", "ai/types"],
4693
+ peer: ["react", "react-dom"]
4694
+ },
4695
+ tokensUsed: ["secondary", "foreground", "card", "card-foreground", "muted", "muted-foreground", "accent", "accent-foreground"],
4696
+ examples: [
4697
+ {
4698
+ title: "User and assistant turns",
4699
+ description: "Two messages alternating roles.",
4700
+ code: `<>
4701
+ <Message role="user">What's the capital of France?</Message>
4702
+ <Message role="assistant">Paris.</Message>
4703
+ </>`,
4704
+ composition: ["chat", "turns"]
4705
+ },
4706
+ {
4707
+ title: "Composed assistant turn",
4708
+ description: "Markdown + ToolCall inside one assistant message.",
4709
+ code: '<Message role="assistant">\n <Markdown>{response}</Markdown>\n <ToolCall name="search" state="result" result={hits} />\n</Message>',
4710
+ composition: ["chat", "agent", "tool-use"]
4711
+ }
4712
+ ],
4713
+ ai: {
4714
+ whenToUse: "Wrap every conversation turn \u2014 user, assistant, system, or tool. Pair with MessageList for the scrolling viewport. Compose Markdown, CodeBlock, and ToolCall as children for rich assistant turns.",
4715
+ whenNotToUse: "Don't use for non-conversational text (use Card or plain elements). Don't put streaming logic here \u2014 the consumer drives state, Message just renders.",
4716
+ commonMistakes: [
4717
+ "Adding streaming/fetch logic inside Message \u2014 keep it pure",
4718
+ 'Using `role="tool"` for assistant text that mentions a tool \u2014 `tool` is for the actual tool turn',
4719
+ "Hard-coding markdown rendering inside Message \u2014 pass <Markdown>{...}</Markdown> as a child instead"
4720
+ ],
4721
+ relatedComponents: ["message-list", "markdown", "code-block", "tool-call", "message-actions"],
4722
+ accessibilityNotes: 'Renders as a div with `data-role`. For screen-reader chat semantics, wrap MessageList in `role="log"` and consider `aria-live="polite"` on the streaming container.',
4723
+ tokenBudget: 220
4724
+ },
4725
+ tags: ["ai", "chat", "message", "turn", "conversation"]
4726
+ };
4727
+
4728
+ // src/ai/message-list/message-list.schema.ts
4729
+ var messageListSchema = {
4730
+ name: "message-list",
4731
+ displayName: "MessageList",
4732
+ description: "Auto-scrolling viewport for a chat stream. Pins to the bottom during streaming unless the user scrolls up to read history.",
4733
+ category: "ai",
4734
+ subcategory: "chat",
4735
+ props: [
4736
+ {
4737
+ name: "autoScroll",
4738
+ type: "boolean",
4739
+ required: false,
4740
+ default: true,
4741
+ description: "Pin to bottom on content change (when the user is already near the bottom)."
4742
+ },
4743
+ {
4744
+ name: "children",
4745
+ type: "ReactNode",
4746
+ required: true,
4747
+ description: "Sequence of <Message> elements."
4748
+ },
4749
+ {
4750
+ name: "className",
4751
+ type: "string",
4752
+ required: false,
4753
+ description: "Additional CSS classes (e.g. height, padding)."
4754
+ }
4755
+ ],
4756
+ variants: [],
4757
+ slots: [
4758
+ {
4759
+ name: "children",
4760
+ description: "Messages to render in order.",
4761
+ required: true,
4762
+ acceptedTypes: ["ReactNode"]
4763
+ }
4764
+ ],
4765
+ dependencies: {
4766
+ npm: ["clsx", "tailwind-merge"],
4767
+ internal: ["lib/utils"],
4768
+ peer: ["react", "react-dom"]
4769
+ },
4770
+ tokensUsed: [],
4771
+ examples: [
4772
+ {
4773
+ title: "Basic chat",
4774
+ description: "Map messages from useChat into a viewport with bottom-pin behavior.",
4775
+ code: '<MessageList className="h-96">\n {messages.map((m) => (\n <Message key={m.id} role={m.role}>{m.content}</Message>\n ))}\n</MessageList>',
4776
+ composition: ["chat", "scroll"]
4777
+ }
4778
+ ],
4779
+ ai: {
4780
+ whenToUse: "Wrap a list of <Message> components when you want auto-scroll-on-stream behavior. Always set an explicit height (h-*, max-h-*) on the className so the viewport actually scrolls.",
4781
+ whenNotToUse: "Don't use for static FAQs or non-streaming layouts (use a normal Stack). Don't use as a generic scroll container \u2014 its bottom-pin behavior is opinionated.",
4782
+ commonMistakes: [
4783
+ "Forgetting to set a height \u2014 the viewport won't scroll without `h-*` or `max-h-*`",
4784
+ "Disabling autoScroll while still expecting bottom-pin behavior \u2014 they're the same flag",
4785
+ "Putting non-Message children inside \u2014 a divider or banner breaks the role=log semantics"
4786
+ ],
4787
+ relatedComponents: ["message", "composer", "loading-indicator"],
4788
+ accessibilityNotes: 'Renders as `role="log"` with `aria-live="polite"` and `aria-relevant="additions"` so assistive tech announces new turns. If you replace turns wholesale (e.g. on regenerate), pass `aria-relevant="additions removals"` as a prop \u2014 props spread onto the underlying div and override the default.',
4789
+ tokenBudget: 240
4790
+ },
4791
+ tags: ["ai", "chat", "scroll", "viewport", "streaming"]
4792
+ };
4793
+
4794
+ // src/ai/composer/composer.schema.ts
4795
+ var composerSchema = {
4796
+ name: "composer",
4797
+ displayName: "Composer",
4798
+ description: "Multi-line input + submission shell for chat. Submits on Enter (Shift+Enter inserts newline). Trailing slot for attachment + send buttons.",
4799
+ category: "ai",
4800
+ subcategory: "input",
4801
+ props: [
4802
+ {
4803
+ name: "value",
4804
+ type: "string",
4805
+ required: true,
4806
+ description: "Controlled textarea value."
4807
+ },
4808
+ {
4809
+ name: "onValueChange",
4810
+ type: "function",
4811
+ required: true,
4812
+ description: "Called with the new value on each keystroke."
4813
+ },
4814
+ {
4815
+ name: "onSubmit",
4816
+ type: "function",
4817
+ required: true,
4818
+ description: "Called with the trimmed value on Enter or form submit."
4819
+ },
4820
+ {
4821
+ name: "disabled",
4822
+ type: "boolean",
4823
+ required: false,
4824
+ default: false,
4825
+ description: "Lock the input and suppress submission (e.g. during streaming)."
4826
+ },
4827
+ {
4828
+ name: "placeholder",
4829
+ type: "string",
4830
+ required: false,
4831
+ description: "Textarea placeholder copy."
4832
+ },
4833
+ {
4834
+ name: "submitOnEnter",
4835
+ type: "boolean",
4836
+ required: false,
4837
+ default: true,
4838
+ description: "Submit when Enter is pressed without Shift. Disable to require button click."
4839
+ },
4840
+ {
4841
+ name: "children",
4842
+ type: "ReactNode",
4843
+ required: false,
4844
+ description: "Trailing slot \u2014 attachment buttons, voice toggle, send button, etc."
4845
+ },
4846
+ {
4847
+ name: "className",
4848
+ type: "string",
4849
+ required: false,
4850
+ description: "Additional CSS classes on the form wrapper."
4851
+ }
4852
+ ],
4853
+ variants: [],
4854
+ slots: [
4855
+ {
4856
+ name: "children",
4857
+ description: "Trailing action buttons rendered after the textarea.",
4858
+ required: false,
4859
+ acceptedTypes: ["ReactNode"]
4860
+ }
4861
+ ],
4862
+ dependencies: {
4863
+ npm: ["clsx", "tailwind-merge"],
4864
+ internal: ["lib/utils"],
4865
+ peer: ["react", "react-dom"]
4866
+ },
4867
+ tokensUsed: ["background", "ring", "muted-foreground"],
4868
+ examples: [
4869
+ {
4870
+ title: "Basic composer",
4871
+ description: "Controlled input + send button.",
4872
+ code: 'const [value, setValue] = useState("");\n<Composer\n value={value}\n onValueChange={setValue}\n onSubmit={(v) => { send(v); setValue(""); }}\n placeholder="Ask anything\u2026"\n>\n <Button type="submit" disabled={!value.trim()}>Send</Button>\n</Composer>',
4873
+ composition: ["chat", "form"]
4874
+ },
4875
+ {
4876
+ title: "With attachment slot",
4877
+ description: "Attach button on the leading edge of the trailing slot.",
4878
+ code: '<Composer value={v} onValueChange={setV} onSubmit={send}>\n <Button variant="ghost" size="icon" onClick={pickFile}><Paperclip /></Button>\n <Button type="submit">Send</Button>\n</Composer>',
4879
+ composition: ["chat", "form", "attachment"]
4880
+ }
4881
+ ],
4882
+ ai: {
4883
+ whenToUse: "Wrap any user-input surface in an AI app \u2014 chatbots, AI editors, agent prompts. Pair with `useChat` from @ai-sdk/react or any equivalent state hook.",
4884
+ whenNotToUse: "Don't use for non-chat forms (use Form + Textarea). Don't bake fetch/streaming logic into onSubmit \u2014 keep the network call in the consumer.",
4885
+ commonMistakes: [
4886
+ "Calling onSubmit with the raw event instead of the value \u2014 onSubmit receives the trimmed string already",
4887
+ "Forgetting to clear `value` after submit \u2014 Composer is fully controlled",
4888
+ "Wrapping the component in <form> \u2014 Composer renders its own form element"
4889
+ ],
4890
+ relatedComponents: ["message-list", "suggestion", "loading-indicator"],
4891
+ accessibilityNotes: "Renders a real <form> + <textarea>, so Enter submission and screen-reader announcements work without extra ARIA. Pass `aria-label` on the wrapper if there's no visible label.",
4892
+ tokenBudget: 280
4893
+ },
4894
+ tags: ["ai", "input", "chat", "form", "composer", "textarea"]
4895
+ };
4896
+
4897
+ // src/ai/loading-indicator/loading-indicator.schema.ts
4898
+ var loadingIndicatorSchema = {
4899
+ name: "loading-indicator",
4900
+ displayName: "LoadingIndicator",
4901
+ description: "Streaming/typing feedback with three motion variants \u2014 dots, pulse, bar.",
4902
+ category: "ai",
4903
+ subcategory: "feedback",
4904
+ props: [
4905
+ {
4906
+ name: "variant",
4907
+ type: "enum",
4908
+ required: false,
4909
+ default: "dots",
4910
+ description: "Animation style.",
4911
+ enumValues: ["dots", "pulse", "bar"]
4912
+ },
4913
+ {
4914
+ name: "size",
4915
+ type: "enum",
4916
+ required: false,
4917
+ default: "md",
4918
+ description: "Text/icon scale.",
4919
+ enumValues: ["sm", "md"]
4920
+ },
4921
+ {
4922
+ name: "label",
4923
+ type: "string",
4924
+ required: false,
4925
+ description: 'Optional adjacent text label (e.g. "Thinking\u2026").'
4926
+ },
4927
+ {
4928
+ name: "className",
4929
+ type: "string",
4930
+ required: false,
4931
+ description: "Additional CSS classes."
4932
+ }
4933
+ ],
4934
+ variants: [
4935
+ {
4936
+ name: "variant",
4937
+ description: "Motion style.",
4938
+ values: [
4939
+ { value: "dots", description: "Three bouncing dots \u2014 classic typing indicator.", useWhen: "You want a familiar chat-style loading affordance." },
4940
+ { value: "pulse", description: "Single throbbing circle \u2014 minimal.", useWhen: "Tight inline space; one-character signal." },
4941
+ { value: "bar", description: "Horizontal sweep \u2014 implies progress without claiming a percentage.", useWhen: "Longer-running task (search, retrieval) where dots feel too perpetual." }
4942
+ ],
4943
+ default: "dots"
4944
+ }
4945
+ ],
4946
+ slots: [],
4947
+ dependencies: {
4948
+ npm: ["class-variance-authority", "clsx", "tailwind-merge"],
4949
+ internal: ["lib/utils"],
4950
+ peer: ["react", "react-dom"]
4951
+ },
4952
+ tokensUsed: ["muted-foreground"],
4953
+ examples: [
4954
+ {
4955
+ title: "Inline typing dots",
4956
+ description: "Render while waiting for the first token.",
4957
+ code: '{isLoading && <LoadingIndicator label="Thinking\u2026" />}',
4958
+ composition: ["chat", "loading"]
4959
+ }
4960
+ ],
4961
+ ai: {
4962
+ whenToUse: "Show during the gap between submitting a prompt and the first streamed token, or while a long-running tool call is in flight.",
4963
+ whenNotToUse: "Don't use for known-percent progress (use Progress). Don't keep visible after the first token streams in \u2014 stream itself signals activity.",
4964
+ commonMistakes: [
4965
+ "Leaving the indicator visible while content streams \u2014 overlap looks broken",
4966
+ "Using `bar` for sub-second waits \u2014 the sweep can't complete a cycle"
4967
+ ],
4968
+ relatedComponents: ["message", "composer"],
4969
+ accessibilityNotes: 'Renders as `role="status"` with `aria-live="polite"` and an `aria-label`. Pass a meaningful label so screen readers announce "Searching docs" rather than the default "Loading".',
4970
+ tokenBudget: 200
4971
+ },
4972
+ tags: ["ai", "loading", "spinner", "typing", "indicator", "streaming"]
4973
+ };
4974
+
4975
+ // src/ai/suggestion/suggestion.schema.ts
4976
+ var suggestionSchema = {
4977
+ name: "suggestion",
4978
+ displayName: "Suggestion",
4979
+ description: "Clickable prompt pill / quick-action chip. Forwards a payload to onSelect on click.",
4980
+ category: "ai",
4981
+ subcategory: "input",
4982
+ props: [
4983
+ {
4984
+ name: "value",
4985
+ type: "string",
4986
+ required: false,
4987
+ description: "Payload sent to onSelect. Defaults to the rendered children when they are a string."
4988
+ },
4989
+ {
4990
+ name: "onSelect",
4991
+ type: "function",
4992
+ required: true,
4993
+ description: "Called with the payload when the chip is clicked."
4994
+ },
4995
+ {
4996
+ name: "children",
4997
+ type: "ReactNode",
4998
+ required: true,
4999
+ description: "Visible label."
5000
+ },
5001
+ {
5002
+ name: "className",
5003
+ type: "string",
5004
+ required: false,
5005
+ description: "Additional CSS classes."
5006
+ }
5007
+ ],
5008
+ variants: [],
5009
+ slots: [
5010
+ {
5011
+ name: "children",
5012
+ description: "Visible label of the chip.",
5013
+ required: true,
5014
+ acceptedTypes: ["ReactNode"]
5015
+ }
5016
+ ],
5017
+ dependencies: {
5018
+ npm: ["clsx", "tailwind-merge"],
5019
+ internal: ["lib/utils"],
5020
+ peer: ["react", "react-dom"]
5021
+ },
5022
+ tokensUsed: ["background", "secondary", "ring", "foreground"],
5023
+ examples: [
5024
+ {
5025
+ title: "Starter prompts",
5026
+ description: "Render onboarding suggestions and drop into the composer on click.",
5027
+ code: '<Cluster gap="sm">\n {STARTERS.map((s) => (\n <Suggestion key={s} value={s} onSelect={setInput}>{s}</Suggestion>\n ))}\n</Cluster>',
5028
+ composition: ["chat", "onboarding", "prompts"]
5029
+ }
5030
+ ],
5031
+ ai: {
5032
+ whenToUse: "Show 3\u20136 starter prompts before the first turn, or follow-up prompts after an assistant turn. Combine with Cluster for wrap-friendly layout.",
5033
+ whenNotToUse: "Don't use for navigation (use Button or a link). Don't auto-send on click without showing the user what's about to be sent \u2014 set the value into Composer first.",
5034
+ commonMistakes: [
5035
+ "Auto-firing onSelect into useChat.append without populating the input first \u2014 feels surprising",
5036
+ "Long labels \u2014 these are pills, keep under ~40 chars"
5037
+ ],
5038
+ relatedComponents: ["composer", "cluster", "button"],
5039
+ accessibilityNotes: "Real <button>, so keyboard activation and screen-reader announcement work natively. If the label is non-text, set `aria-label`.",
5040
+ tokenBudget: 220
5041
+ },
5042
+ tags: ["ai", "suggestion", "prompt", "pill", "chip", "quick-action"]
5043
+ };
5044
+
5045
+ // src/ai/tool-call/tool-call.schema.ts
5046
+ var toolCallSchema = {
5047
+ name: "tool-call",
5048
+ displayName: "ToolCall",
5049
+ description: "Collapsible card showing a tool/function invocation \u2014 name, lifecycle state badge, expandable args + result body.",
5050
+ category: "ai",
5051
+ subcategory: "agent",
5052
+ props: [
5053
+ {
5054
+ name: "name",
5055
+ type: "string",
5056
+ required: true,
5057
+ description: "Tool / function name (e.g. searchDocs, getWeather)."
5058
+ },
5059
+ {
5060
+ name: "state",
5061
+ type: "enum",
5062
+ required: true,
5063
+ description: "Lifecycle of the invocation.",
5064
+ enumValues: ["pending", "running", "result", "error"]
5065
+ },
5066
+ {
5067
+ name: "args",
5068
+ type: "object",
5069
+ required: false,
5070
+ description: "JSON-stringifiable input passed to the tool."
5071
+ },
5072
+ {
5073
+ name: "result",
5074
+ type: "object",
5075
+ required: false,
5076
+ description: "JSON-stringifiable output returned by the tool. May be a string for plain-text results."
5077
+ },
5078
+ {
5079
+ name: "defaultOpen",
5080
+ type: "boolean",
5081
+ required: false,
5082
+ default: false,
5083
+ description: "Start expanded. Default collapsed to keep the chat clean."
5084
+ },
5085
+ {
5086
+ name: "className",
5087
+ type: "string",
5088
+ required: false,
5089
+ description: "Additional CSS classes on the outer Collapsible root."
5090
+ }
5091
+ ],
5092
+ variants: [],
5093
+ slots: [],
5094
+ dependencies: {
5095
+ npm: ["@radix-ui/react-collapsible", "clsx", "tailwind-merge"],
5096
+ internal: ["lib/utils", "ai/types"],
5097
+ peer: ["react", "react-dom"]
5098
+ },
5099
+ tokensUsed: ["card", "card-foreground", "muted", "muted-foreground", "primary", "accent", "accent-foreground", "destructive", "ring", "background"],
5100
+ examples: [
5101
+ {
5102
+ title: "Done invocation",
5103
+ description: "Map an AI SDK `tool-*` part to a ToolCall.",
5104
+ code: '<ToolCall\n name="searchDocs"\n state="result"\n args={{ query: "auth" }}\n result={{ hits: docs.length }}\n/>',
5105
+ composition: ["agent", "tool-use"]
5106
+ },
5107
+ {
5108
+ title: "Streaming run",
5109
+ description: "While the tool is executing, show running state without args.",
5110
+ code: '<ToolCall name="getWeather" state="running" args={{ city: "NYC" }} />',
5111
+ composition: ["agent", "tool-use", "streaming"]
5112
+ }
5113
+ ],
5114
+ ai: {
5115
+ whenToUse: "Render every tool/function invocation in an agent UI. Map AI SDK v5 `tool-TOOLNAME` parts (state: input-streaming|input-available|output-available|output-error) or LangChain `AIMessage.tool_calls` directly.",
5116
+ whenNotToUse: "Don't use for plain assistant text (use Message). Don't render the tool's actual UI here \u2014 ToolCall is a debug/transparency card; for a rich tool UI, render that as a sibling node inside the Message.",
5117
+ commonMistakes: [
5118
+ "Passing the entire AI SDK part object as `result` \u2014 extract the output payload first",
5119
+ "Setting `defaultOpen` for every call \u2014 quickly clutters the chat",
5120
+ 'Using `state="result"` for an error \u2014 use `error` so the user sees red'
5121
+ ],
5122
+ relatedComponents: ["message", "reasoning", "loading-indicator"],
5123
+ accessibilityNotes: "Built on Radix Collapsible \u2014 keyboard expand/collapse with Enter/Space works natively. Add `aria-label` on the trigger if the tool name is opaque.",
5124
+ tokenBudget: 320
5125
+ },
5126
+ tags: ["ai", "agent", "tool-call", "function-call", "collapsible", "transparency"]
5127
+ };
5128
+
5129
+ // src/ai/reasoning/reasoning.schema.ts
5130
+ var reasoningSchema = {
5131
+ name: "reasoning",
5132
+ displayName: "Reasoning",
5133
+ description: "Collapsible thinking-trace block for Anthropic-style reasoning or chain-of-thought scratchpads. Optional duration in the header.",
5134
+ category: "ai",
5135
+ subcategory: "agent",
5136
+ props: [
5137
+ {
5138
+ name: "children",
5139
+ type: "ReactNode",
5140
+ required: true,
5141
+ description: "Reasoning content. Wrap with Markdown for formatted thinking traces."
5142
+ },
5143
+ {
5144
+ name: "defaultOpen",
5145
+ type: "boolean",
5146
+ required: false,
5147
+ default: false,
5148
+ description: "Start expanded. Default collapsed."
5149
+ },
5150
+ {
5151
+ name: "durationMs",
5152
+ type: "number",
5153
+ required: false,
5154
+ description: 'Time spent thinking in ms \u2014 renders "Thought for 4.2s" in the header.'
5155
+ },
5156
+ {
5157
+ name: "label",
5158
+ type: "string",
5159
+ required: false,
5160
+ description: "Override the default header label."
5161
+ },
5162
+ {
5163
+ name: "className",
5164
+ type: "string",
5165
+ required: false,
5166
+ description: "Additional CSS classes."
5167
+ }
5168
+ ],
5169
+ variants: [],
5170
+ slots: [
5171
+ {
5172
+ name: "children",
5173
+ description: "Reasoning trace body.",
5174
+ required: true,
5175
+ acceptedTypes: ["ReactNode"]
5176
+ }
5177
+ ],
5178
+ dependencies: {
5179
+ npm: ["@radix-ui/react-collapsible", "clsx", "tailwind-merge"],
5180
+ internal: ["lib/utils"],
5181
+ peer: ["react", "react-dom"]
5182
+ },
5183
+ tokensUsed: ["foreground", "muted", "muted-foreground", "ring"],
5184
+ examples: [
5185
+ {
5186
+ title: "Thinking trace with duration",
5187
+ description: 'Header reads "Thought for 4.2s" \u2014 body reveals the full trace on click.',
5188
+ code: "<Reasoning durationMs={4200}>\n <Markdown>{thinkingMarkdown}</Markdown>\n</Reasoning>",
5189
+ composition: ["agent", "reasoning", "anthropic"]
5190
+ }
5191
+ ],
5192
+ ai: {
5193
+ whenToUse: "Render Anthropic `thinking` blocks, chain-of-thought scratchpads, or any model-internal reasoning the user can optionally inspect.",
5194
+ whenNotToUse: "Don't use for the assistant's actual answer (use Message). Don't auto-open for routine turns \u2014 only worth expanding for debug or trust-building UX.",
5195
+ commonMistakes: [
5196
+ "Showing reasoning that wasn't actually produced \u2014 fabricating thinking blocks erodes trust",
5197
+ "`durationMs` measured from request start instead of model thinking time \u2014 use the model's reported duration when available"
5198
+ ],
5199
+ relatedComponents: ["message", "tool-call", "markdown"],
5200
+ accessibilityNotes: "Radix Collapsible \u2014 keyboard expand/collapse via Enter/Space. The italic header is decorative; use the visible label for screen readers.",
5201
+ tokenBudget: 280
5202
+ },
5203
+ tags: ["ai", "agent", "reasoning", "thinking", "chain-of-thought", "collapsible"]
5204
+ };
5205
+
5206
+ // src/ai/message-actions/message-actions.schema.ts
5207
+ var messageActionsSchema = {
5208
+ name: "message-actions",
5209
+ displayName: "MessageActions",
5210
+ description: "Inline action-button row beneath a message \u2014 copy, regenerate, thumbs-up/down. Pure container; consumer supplies the buttons + handlers.",
5211
+ category: "ai",
5212
+ subcategory: "chat",
5213
+ props: [
5214
+ {
5215
+ name: "children",
5216
+ type: "ReactNode",
5217
+ required: true,
5218
+ description: 'Action buttons (typically Button variant="ghost" size="icon").'
5219
+ },
5220
+ {
5221
+ name: "className",
5222
+ type: "string",
5223
+ required: false,
5224
+ description: "Additional CSS classes."
5225
+ }
5226
+ ],
5227
+ variants: [],
5228
+ slots: [
5229
+ {
5230
+ name: "children",
5231
+ description: "Action buttons rendered in a horizontal row.",
5232
+ required: true,
5233
+ acceptedTypes: ["ReactNode"]
5234
+ }
5235
+ ],
5236
+ dependencies: {
5237
+ npm: ["clsx", "tailwind-merge"],
5238
+ internal: ["lib/utils"],
5239
+ peer: ["react", "react-dom"]
5240
+ },
5241
+ tokensUsed: [],
5242
+ examples: [
5243
+ {
5244
+ title: "Copy + regenerate",
5245
+ description: "Two ghost icon buttons under an assistant message.",
5246
+ code: '<MessageActions>\n <Button variant="ghost" size="icon" onClick={() => navigator.clipboard.writeText(text)}><CopyIcon /></Button>\n <Button variant="ghost" size="icon" onClick={onRegenerate}><RetryIcon /></Button>\n</MessageActions>',
5247
+ composition: ["chat", "actions"]
5248
+ }
5249
+ ],
5250
+ ai: {
5251
+ whenToUse: "Render after assistant turns where the user might want to copy, regenerate, or rate the response. Combine with `group/message` on the parent Message to enable hover-reveal.",
5252
+ whenNotToUse: "Don't use under user turns (no actions to take). Don't put primary CTAs here \u2014 actions row is for secondary, optional follow-ups.",
5253
+ commonMistakes: [
5254
+ "Forgetting `group/message` on the parent Message \u2014 hover-reveal won't trigger",
5255
+ "Stacking too many buttons (more than ~4) \u2014 overwhelms the chat"
5256
+ ],
5257
+ relatedComponents: ["message", "button"],
5258
+ accessibilityNotes: "Pure layout container. Each child button must carry its own `aria-label` since icon-only buttons have no accessible text.",
5259
+ tokenBudget: 180
5260
+ },
5261
+ tags: ["ai", "chat", "actions", "row", "container"]
5262
+ };
5263
+
5264
+ // src/ai/citation/citation.schema.ts
5265
+ var citationSchema = {
5266
+ name: "citation",
5267
+ displayName: "Citation",
5268
+ description: "Source attribution chip \u2014 renders a citation for a RAG hit, search result, or any external reference. Becomes a focusable link when url is provided.",
5269
+ category: "ai",
5270
+ subcategory: "rag",
5271
+ props: [
5272
+ {
5273
+ name: "title",
5274
+ type: "string",
5275
+ required: true,
5276
+ description: 'Source title or filename (e.g. "auth-overview.md").'
5277
+ },
5278
+ {
5279
+ name: "url",
5280
+ type: "string",
5281
+ required: false,
5282
+ description: "If provided, the chip becomes an anchor opening in a new tab."
5283
+ },
5284
+ {
5285
+ name: "page",
5286
+ type: "number",
5287
+ required: false,
5288
+ description: 'Optional page number (renders "p.3").'
5289
+ },
5290
+ {
5291
+ name: "index",
5292
+ type: "number",
5293
+ required: false,
5294
+ description: 'Optional inline footnote number (renders "[1]").'
5295
+ },
5296
+ {
5297
+ name: "children",
5298
+ type: "ReactNode",
5299
+ required: false,
5300
+ description: "Trailing slot \u2014 extra metadata (e.g. relevance score)."
5301
+ },
5302
+ {
5303
+ name: "className",
5304
+ type: "string",
5305
+ required: false,
5306
+ description: "Additional CSS classes."
5307
+ }
5308
+ ],
5309
+ variants: [],
5310
+ slots: [
5311
+ {
5312
+ name: "children",
5313
+ description: "Trailing extras \u2014 relevance score, badge, etc.",
5314
+ required: false,
5315
+ acceptedTypes: ["ReactNode"]
5316
+ }
5317
+ ],
5318
+ dependencies: {
5319
+ npm: ["clsx", "tailwind-merge"],
5320
+ internal: ["lib/utils"],
5321
+ peer: ["react", "react-dom"]
5322
+ },
5323
+ tokensUsed: ["card", "secondary", "ring", "foreground", "muted-foreground"],
5324
+ examples: [
5325
+ {
5326
+ title: "Footnote-style citations",
5327
+ description: "Numbered citations after an assistant turn.",
5328
+ code: '<Cluster gap="xs">\n {sources.map((s, i) => (\n <Citation key={s.id} title={s.title} url={s.url} index={i + 1} />\n ))}\n</Cluster>',
5329
+ composition: ["rag", "citations"]
5330
+ }
5331
+ ],
5332
+ ai: {
5333
+ whenToUse: "Surface RAG/search-result sources after an assistant message. Use `index` for footnote-style numbering tied to inline `[1]` markers in the answer.",
5334
+ whenNotToUse: "Don't use for general external links in chat (use Markdown). Don't fabricate sources \u2014 only render Citation for retrievals the model actually used.",
5335
+ commonMistakes: [
5336
+ "Showing the URL twice (in `title` AND `url`) \u2014 pick a human title separately",
5337
+ 'Skipping `target="_blank"` \u2014 handled automatically when url is set; don\'t override'
5338
+ ],
5339
+ relatedComponents: ["message", "cluster"],
5340
+ accessibilityNotes: 'With `url`, renders a real anchor (`rel="noreferrer noopener"`). Without `url`, renders a static span. Add `aria-label` on the wrapper if title alone lacks context.',
5341
+ tokenBudget: 240
5342
+ },
5343
+ tags: ["ai", "rag", "citation", "source", "footnote", "chip"]
5344
+ };
5345
+
5346
+ // src/ai/markdown/markdown.schema.ts
5347
+ var markdownSchema = {
5348
+ name: "markdown",
5349
+ displayName: "Markdown",
5350
+ description: "Streaming-safe markdown renderer wrapping Vercel's streamdown. Handles partial input mid-stream without throwing.",
5351
+ category: "ai",
5352
+ subcategory: "content",
5353
+ props: [
5354
+ {
5355
+ name: "children",
5356
+ type: "string",
5357
+ required: true,
5358
+ description: "Raw markdown. May be a partial chunk during streaming."
5359
+ },
5360
+ {
5361
+ name: "className",
5362
+ type: "string",
5363
+ required: false,
5364
+ description: "Additional CSS classes on the root element."
5365
+ }
5366
+ ],
5367
+ variants: [],
5368
+ slots: [
5369
+ {
5370
+ name: "children",
5371
+ description: "Markdown source as a string.",
5372
+ required: true,
5373
+ acceptedTypes: ["string"]
5374
+ }
5375
+ ],
5376
+ dependencies: {
5377
+ npm: ["streamdown", "clsx", "tailwind-merge"],
5378
+ internal: ["lib/utils"],
5379
+ peer: ["react", "react-dom"]
5380
+ },
5381
+ tokensUsed: ["foreground", "primary"],
5382
+ examples: [
5383
+ {
5384
+ title: "Streaming assistant turn",
5385
+ description: "Render the in-flight assistant message as it arrives.",
5386
+ code: '<Message role="assistant">\n <Markdown>{message.content}</Markdown>\n</Message>',
5387
+ composition: ["chat", "streaming", "markdown"]
5388
+ },
5389
+ {
5390
+ title: "Custom rendering: drop down to Streamdown",
5391
+ description: "For per-element overrides, use streamdown directly with our CodeBlock primitive.",
5392
+ code: 'import { Streamdown } from "streamdown";\nimport { CodeBlock } from "@hex-core/components";\n\n<Streamdown components={{ pre: ({ children }) => <CodeBlock code={extractCode(children)} /> }}>\n {markdown}\n</Streamdown>',
5393
+ composition: ["chat", "code", "override"]
5394
+ }
5395
+ ],
5396
+ ai: {
5397
+ whenToUse: "Render any markdown content from an LLM \u2014 assistant turns, system messages with formatting, RAG citations with inline links. Required for streaming because raw markdown parsers throw on unfinished input.",
5398
+ whenNotToUse: "Don't use for plain text without formatting (just render the string). Don't bypass it for streamed content \u2014 partial input WILL break a non-streaming parser.",
5399
+ commonMistakes: [
5400
+ "Passing JSX children instead of a markdown string \u2014 Markdown only accepts strings",
5401
+ "Trying to override per-element renderers via Markdown \u2014 drop down to `Streamdown` directly for that (we keep our public surface minimal so the DTS bundle doesn't drag in shiki's giant language union)",
5402
+ "Forgetting Tailwind Typography (`prose`) classes are required to style the output"
5403
+ ],
5404
+ relatedComponents: ["message", "code-block", "citation"],
5405
+ accessibilityNotes: "Inherits semantics from streamdown: real headings, lists, links. Verify Tailwind Typography (prose) is enabled in your CSS \u2014 without it, output renders unstyled.",
5406
+ tokenBudget: 280
5407
+ },
5408
+ tags: ["ai", "markdown", "streaming", "content", "renderer"]
5409
+ };
5410
+
5411
+ // src/ai/code-block/code-block.schema.ts
5412
+ var codeBlockSchema = {
5413
+ name: "code-block",
5414
+ displayName: "CodeBlock",
5415
+ description: "Server-rendered, syntax-highlighted code block with a language-label header and a copy button. Dual-theme via Shiki \u2014 same HTML for light + dark.",
5416
+ category: "ai",
5417
+ subcategory: "content",
5418
+ props: [
5419
+ {
5420
+ name: "code",
5421
+ type: "string",
5422
+ required: true,
5423
+ description: "The code to display. Plain text \u2014 no markdown fences."
5424
+ },
5425
+ {
5426
+ name: "label",
5427
+ type: "string",
5428
+ required: false,
5429
+ description: 'Header label (e.g. "pnpm", "tsx"). Inferred from `language` if omitted.'
5430
+ },
5431
+ {
5432
+ name: "language",
5433
+ type: "enum",
5434
+ required: false,
5435
+ description: "Shiki grammar key. Overrides inference from `label`.",
5436
+ enumValues: ["bash", "ts", "tsx", "js", "jsx", "json", "css", "html", "md", "py", "text"]
5437
+ },
5438
+ {
5439
+ name: "themes",
5440
+ type: "object",
5441
+ required: false,
5442
+ default: { light: "github-light", dark: "github-dark" },
5443
+ description: "Override the default theme pair. Keys: `light`, `dark` \u2014 values are Shiki theme IDs."
5444
+ },
5445
+ {
5446
+ name: "className",
5447
+ type: "string",
5448
+ required: false,
5449
+ description: "Additional CSS classes on the outer card."
5450
+ }
5451
+ ],
5452
+ variants: [],
5453
+ slots: [],
5454
+ dependencies: {
5455
+ npm: ["shiki", "clsx", "tailwind-merge"],
5456
+ internal: ["lib/utils", "ai/code-block-copy"],
5457
+ peer: ["react", "react-dom"]
5458
+ },
5459
+ tokensUsed: ["card", "card-foreground", "muted", "muted-foreground", "border"],
5460
+ examples: [
5461
+ {
5462
+ title: "Install command",
5463
+ description: "Header label drives both the visible chip and Shiki grammar inference.",
5464
+ code: '<CodeBlock label="pnpm" code="pnpm add @hex-core/components" />',
5465
+ composition: ["docs", "install"]
5466
+ },
5467
+ {
5468
+ title: "Inline TS sample",
5469
+ description: "Explicit language overrides label inference.",
5470
+ code: '<CodeBlock language="tsx" code={`<Button>Click</Button>`} />',
5471
+ composition: ["docs", "code"]
5472
+ }
5473
+ ],
5474
+ ai: {
5475
+ whenToUse: "Render any code snippet in docs, copy-to-clipboard install commands, or static AI chat output where server rendering is acceptable. Pair with Markdown's `components.pre` override to take over markdown code fences.",
5476
+ whenNotToUse: "Don't use for streaming chat where the code grows mid-render \u2014 async Server Components can't update token-by-token. Use Streamdown's built-in client CodeBlock for that.",
5477
+ commonMistakes: [
5478
+ "Passing markdown-fenced code (with ```) \u2014 strip the fences first",
5479
+ "Forgetting that this is async \u2014 must be awaited or rendered as RSC",
5480
+ "Using a Shiki theme that isn't bundled \u2014 fails with a runtime fetch error"
5481
+ ],
5482
+ relatedComponents: ["markdown", "message"],
5483
+ accessibilityNotes: "Highlighted output is plain text inside a `<pre>` \u2014 screen readers read it normally. The copy button has its own `aria-label`. Add a meaningful `aria-label` on the wrapper if the label alone isn't descriptive.",
5484
+ tokenBudget: 320
5485
+ },
5486
+ tags: ["ai", "code", "shiki", "highlight", "copy", "rsc"]
5487
+ };
5488
+
5489
+ export { accordionSchema, alertDialogSchema, alertSchema, aspectRatioSchema, avatarSchema, badgeSchema, breadcrumbSchema, buttonSchema, calendarSchema, cardSchema, checkboxSchema, citationSchema, clusterSchema, codeBlockSchema, collapsibleSchema, colorPickerSchema, comboboxSchema, commandSchema, composerSchema, containerSchema, contextMenuSchema, dataTableSchema, datePickerSchema, dialogSchema, drawerSchema, dropdownMenuSchema, dropzoneSchema, fileTreeSchema, formSchema, gridSchema, hoverCardSchema, inputOTPSchema, inputSchema, labelSchema, loadingIndicatorSchema, markdownSchema, menubarSchema, messageActionsSchema, messageListSchema, messageSchema, multiComboboxSchema, navigationMenuSchema, paginationSchema, popoverSchema, progressSchema, radioGroupSchema, reasoningSchema, resizableSchema, scrollAreaSchema, selectSchema, separatorSchema, sheetSchema, sidebarSchema, skeletonSchema, sliderSchema, sonnerSchema, spacerSchema, stackSchema, stepperSchema, suggestionSchema, switchSchema, tableSchema, tabsSchema, textareaSchema, timePickerSchema, timelineSchema, toggleGroupSchema, toggleSchema, toolCallSchema, tooltipSchema };
4642
5490
  //# sourceMappingURL=schemas.js.map
4643
5491
  //# sourceMappingURL=schemas.js.map