@skdx/react-blocks 0.1.0 → 0.35.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 (172) hide show
  1. package/README.md +1 -1
  2. package/dist/chat-composer/ChatComposer.cjs +2 -0
  3. package/dist/chat-composer/ChatComposer.d.cts +20 -0
  4. package/dist/chat-composer/ChatComposer.d.ts +20 -0
  5. package/dist/chat-composer/ChatComposer.js +2 -0
  6. package/dist/chat-composer/index.d.cts +2 -0
  7. package/dist/chat-composer/index.d.ts +2 -0
  8. package/dist/chat-composer/types.d.cts +96 -0
  9. package/dist/chat-composer/types.d.ts +96 -0
  10. package/dist/chat-message/ChatMessage.cjs +2 -0
  11. package/dist/chat-message/ChatMessage.d.cts +23 -0
  12. package/dist/chat-message/ChatMessage.d.ts +23 -0
  13. package/dist/chat-message/ChatMessage.js +2 -0
  14. package/dist/chat-message/index.d.cts +2 -0
  15. package/dist/chat-message/index.d.ts +2 -0
  16. package/dist/chat-message/types.d.cts +57 -0
  17. package/dist/chat-message/types.d.ts +57 -0
  18. package/dist/comment/Comment.cjs +2 -0
  19. package/dist/comment/Comment.d.cts +22 -0
  20. package/dist/comment/Comment.d.ts +22 -0
  21. package/dist/comment/Comment.js +2 -0
  22. package/dist/comment/index.d.cts +2 -0
  23. package/dist/comment/index.d.ts +2 -0
  24. package/dist/comment/types.d.cts +47 -0
  25. package/dist/comment/types.d.ts +47 -0
  26. package/dist/comment-thread/CommentThread.cjs +2 -0
  27. package/dist/comment-thread/CommentThread.d.cts +21 -0
  28. package/dist/comment-thread/CommentThread.d.ts +21 -0
  29. package/dist/comment-thread/CommentThread.js +2 -0
  30. package/dist/comment-thread/index.d.cts +2 -0
  31. package/dist/comment-thread/index.d.ts +2 -0
  32. package/dist/comment-thread/types.d.cts +46 -0
  33. package/dist/comment-thread/types.d.ts +46 -0
  34. package/dist/confirm-dialog/ConfirmDialog.cjs +2 -0
  35. package/dist/confirm-dialog/ConfirmDialog.d.cts +31 -0
  36. package/dist/confirm-dialog/ConfirmDialog.d.ts +31 -0
  37. package/dist/confirm-dialog/ConfirmDialog.js +2 -0
  38. package/dist/confirm-dialog/index.d.cts +2 -0
  39. package/dist/confirm-dialog/index.d.ts +2 -0
  40. package/dist/confirm-dialog/types.d.cts +114 -0
  41. package/dist/confirm-dialog/types.d.ts +114 -0
  42. package/dist/conversation-list/ConversationList.cjs +2 -0
  43. package/dist/conversation-list/ConversationList.d.cts +20 -0
  44. package/dist/conversation-list/ConversationList.d.ts +20 -0
  45. package/dist/conversation-list/ConversationList.js +2 -0
  46. package/dist/conversation-list/index.d.cts +2 -0
  47. package/dist/conversation-list/index.d.ts +2 -0
  48. package/dist/conversation-list/types.d.cts +94 -0
  49. package/dist/conversation-list/types.d.ts +94 -0
  50. package/dist/dashboard-layout/DashboardLayout.cjs +1 -1
  51. package/dist/dashboard-layout/DashboardLayout.js +1 -1
  52. package/dist/empty-state/EmptyState.cjs +2 -0
  53. package/dist/empty-state/EmptyState.d.cts +21 -0
  54. package/dist/empty-state/EmptyState.d.ts +21 -0
  55. package/dist/empty-state/EmptyState.js +2 -0
  56. package/dist/empty-state/index.d.cts +2 -0
  57. package/dist/empty-state/index.d.ts +2 -0
  58. package/dist/empty-state/types.d.cts +36 -0
  59. package/dist/empty-state/types.d.ts +36 -0
  60. package/dist/filter-bar/FilterBar.cjs +2 -0
  61. package/dist/filter-bar/FilterBar.d.cts +23 -0
  62. package/dist/filter-bar/FilterBar.d.ts +23 -0
  63. package/dist/filter-bar/FilterBar.js +2 -0
  64. package/dist/filter-bar/index.d.cts +2 -0
  65. package/dist/filter-bar/index.d.ts +2 -0
  66. package/dist/filter-bar/types.d.cts +81 -0
  67. package/dist/filter-bar/types.d.ts +81 -0
  68. package/dist/forgot-password-page/ForgotPasswordPage.cjs +2 -0
  69. package/dist/forgot-password-page/ForgotPasswordPage.d.cts +20 -0
  70. package/dist/forgot-password-page/ForgotPasswordPage.d.ts +20 -0
  71. package/dist/forgot-password-page/ForgotPasswordPage.js +2 -0
  72. package/dist/forgot-password-page/index.d.cts +2 -0
  73. package/dist/forgot-password-page/index.d.ts +2 -0
  74. package/dist/forgot-password-page/types.d.cts +54 -0
  75. package/dist/forgot-password-page/types.d.ts +54 -0
  76. package/dist/form-section/FormSection.cjs +2 -0
  77. package/dist/form-section/FormSection.d.cts +22 -0
  78. package/dist/form-section/FormSection.d.ts +22 -0
  79. package/dist/form-section/FormSection.js +2 -0
  80. package/dist/form-section/index.d.cts +2 -0
  81. package/dist/form-section/index.d.ts +2 -0
  82. package/dist/form-section/types.d.cts +27 -0
  83. package/dist/form-section/types.d.ts +27 -0
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.d.cts +19 -0
  86. package/dist/index.d.ts +19 -0
  87. package/dist/index.js +1 -1
  88. package/dist/internal/AuthPanel.d.cts +54 -0
  89. package/dist/internal/AuthPanel.d.ts +54 -0
  90. package/dist/internal/Region.d.cts +17 -0
  91. package/dist/internal/Region.d.ts +17 -0
  92. package/dist/internal/formValue.d.cts +6 -0
  93. package/dist/internal/formValue.d.ts +6 -0
  94. package/dist/notification-center/NotificationCenter.cjs +2 -0
  95. package/dist/notification-center/NotificationCenter.d.cts +21 -0
  96. package/dist/notification-center/NotificationCenter.d.ts +21 -0
  97. package/dist/notification-center/NotificationCenter.js +2 -0
  98. package/dist/notification-center/index.d.cts +2 -0
  99. package/dist/notification-center/index.d.ts +2 -0
  100. package/dist/notification-center/types.d.cts +104 -0
  101. package/dist/notification-center/types.d.ts +104 -0
  102. package/dist/onboarding-checklist/OnboardingChecklist.cjs +2 -0
  103. package/dist/onboarding-checklist/OnboardingChecklist.d.cts +25 -0
  104. package/dist/onboarding-checklist/OnboardingChecklist.d.ts +25 -0
  105. package/dist/onboarding-checklist/OnboardingChecklist.js +2 -0
  106. package/dist/onboarding-checklist/index.d.cts +2 -0
  107. package/dist/onboarding-checklist/index.d.ts +2 -0
  108. package/dist/onboarding-checklist/types.d.cts +67 -0
  109. package/dist/onboarding-checklist/types.d.ts +67 -0
  110. package/dist/reset-password-page/ResetPasswordPage.cjs +2 -0
  111. package/dist/reset-password-page/ResetPasswordPage.d.cts +20 -0
  112. package/dist/reset-password-page/ResetPasswordPage.d.ts +20 -0
  113. package/dist/reset-password-page/ResetPasswordPage.js +2 -0
  114. package/dist/reset-password-page/index.d.cts +2 -0
  115. package/dist/reset-password-page/index.d.ts +2 -0
  116. package/dist/reset-password-page/types.d.cts +64 -0
  117. package/dist/reset-password-page/types.d.ts +64 -0
  118. package/dist/sign-in-page/SignInPage.cjs +1 -1
  119. package/dist/sign-in-page/SignInPage.d.cts +1 -1
  120. package/dist/sign-in-page/SignInPage.d.ts +1 -1
  121. package/dist/sign-in-page/SignInPage.js +1 -1
  122. package/dist/sign-up-page/SignUpPage.cjs +2 -0
  123. package/dist/sign-up-page/SignUpPage.d.cts +21 -0
  124. package/dist/sign-up-page/SignUpPage.d.ts +21 -0
  125. package/dist/sign-up-page/SignUpPage.js +2 -0
  126. package/dist/sign-up-page/index.d.cts +2 -0
  127. package/dist/sign-up-page/index.d.ts +2 -0
  128. package/dist/sign-up-page/types.d.cts +100 -0
  129. package/dist/sign-up-page/types.d.ts +100 -0
  130. package/dist/stat-card/StatCard.cjs +2 -0
  131. package/dist/stat-card/StatCard.d.cts +22 -0
  132. package/dist/stat-card/StatCard.d.ts +22 -0
  133. package/dist/stat-card/StatCard.js +2 -0
  134. package/dist/stat-card/index.d.cts +2 -0
  135. package/dist/stat-card/index.d.ts +2 -0
  136. package/dist/stat-card/types.d.cts +71 -0
  137. package/dist/stat-card/types.d.ts +71 -0
  138. package/dist/usage-card/UsageCard.cjs +2 -0
  139. package/dist/usage-card/UsageCard.d.cts +17 -0
  140. package/dist/usage-card/UsageCard.d.ts +17 -0
  141. package/dist/usage-card/UsageCard.js +2 -0
  142. package/dist/usage-card/index.d.cts +2 -0
  143. package/dist/usage-card/index.d.ts +2 -0
  144. package/dist/usage-card/types.d.cts +50 -0
  145. package/dist/usage-card/types.d.ts +50 -0
  146. package/dist/usage-card/usage.d.cts +18 -0
  147. package/dist/usage-card/usage.d.ts +18 -0
  148. package/dist/user-menu/UserMenu.cjs +2 -0
  149. package/dist/user-menu/UserMenu.d.cts +19 -0
  150. package/dist/user-menu/UserMenu.d.ts +19 -0
  151. package/dist/user-menu/UserMenu.js +2 -0
  152. package/dist/user-menu/index.d.cts +2 -0
  153. package/dist/user-menu/index.d.ts +2 -0
  154. package/dist/user-menu/types.d.cts +89 -0
  155. package/dist/user-menu/types.d.ts +89 -0
  156. package/dist/verification-page/VerificationPage.cjs +2 -0
  157. package/dist/verification-page/VerificationPage.d.cts +20 -0
  158. package/dist/verification-page/VerificationPage.d.ts +20 -0
  159. package/dist/verification-page/VerificationPage.js +2 -0
  160. package/dist/verification-page/index.d.cts +2 -0
  161. package/dist/verification-page/index.d.ts +2 -0
  162. package/dist/verification-page/types.d.cts +89 -0
  163. package/dist/verification-page/types.d.ts +89 -0
  164. package/dist/workspace-switcher/WorkspaceSwitcher.cjs +2 -0
  165. package/dist/workspace-switcher/WorkspaceSwitcher.d.cts +25 -0
  166. package/dist/workspace-switcher/WorkspaceSwitcher.d.ts +25 -0
  167. package/dist/workspace-switcher/WorkspaceSwitcher.js +2 -0
  168. package/dist/workspace-switcher/index.d.cts +2 -0
  169. package/dist/workspace-switcher/index.d.ts +2 -0
  170. package/dist/workspace-switcher/types.d.cts +151 -0
  171. package/dist/workspace-switcher/types.d.ts +151 -0
  172. package/package.json +197 -6
package/README.md CHANGED
@@ -6,4 +6,4 @@ React blocks for the SkandaDX design system — page-level compositions of `@skd
6
6
  pnpm add @skdx/react-blocks @skdx/react
7
7
  ```
8
8
 
9
- Documentation: <https://github.com/SkandaDX/ui.skdx/tree/main/packages/react-blocks#readme>
9
+ Documentation: <https://github.com/SkandaDX/ui.skdx/tree/main/packages/blocks/react#readme>
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var B=Object.create;var u=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var H=(t,e)=>{for(var o in e)u(t,o,{get:e[o],enumerable:!0})},S=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of M(e))!z.call(t,a)&&a!==o&&u(t,a,{get:()=>e[a],enumerable:!(s=V(e,a))||s.enumerable});return t};var L=(t,e,o)=>(o=t!=null?B(_(t)):{},S(e||!t||!t.__esModule?u(o,"default",{value:t,enumerable:!0}):o,t)),O=t=>S(u({},"__esModule",{value:!0}),t);var q={};H(q,{ChatComposer:()=>h});module.exports=O(q);var f=require("@skdx/react");function U(...t){let e="";for(let o of t)o&&(e=e?`${e} ${o}`:o);return e}function i(t,e,o){let s=e==="root",a=s?`skdx-${t}`:`skdx-${t}__${e}`,c={className:U(a,o),"data-part":e};return s&&(c["data-skdx-component"]=t),c}var k=require("react/jsx-runtime"),d=({part:t,children:e})=>e?(0,k.jsx)("div",{...t,children:e}):null;d.displayName="Region";var P=L(require("react"),1);function T(t,e,o){let[s,a]=P.useState(e),c=t!==void 0;return[c?t:s,p=>{c||a(p),o?.(p)}]}var n=require("react/jsx-runtime"),h=({value:t,defaultValue:e="",onValueChange:o,placeholder:s,label:a="Message",sendLabel:c="Send",sendIcon:l,submitKey:g="enter",maxRows:p=8,maxLength:N,disabled:x=!1,pending:m=!1,leading:A,trailing:K,attachments:D,footer:$,onSend:w,...y})=>{let[R,C]=T(t,e,o),v=R.trim().length>0,b=()=>{x||m||!v||(w?.({value:R}),t===void 0&&C(""))},E=r=>{g==="none"||r.key!=="Enter"||r.nativeEvent.isComposing||!(g==="enter"?!r.shiftKey:r.metaKey||r.ctrlKey)||(r.preventDefault(),b())};return(0,n.jsxs)("form",{"data-state":m?"pending":void 0,...y,...i("chat-composer","root",y.className),onSubmit:r=>{r.preventDefault(),b()},children:[(0,n.jsx)(d,{part:i("chat-composer","attachments"),children:D}),(0,n.jsxs)("div",{...i("chat-composer","field"),children:[(0,n.jsx)(d,{part:i("chat-composer","leading"),children:A}),(0,n.jsx)(f.Textarea,{"aria-label":a,placeholder:s,value:R,autoResize:!0,minRows:1,maxRows:p,maxLength:N,disabled:x,onChange:r=>{C(r.target.value)},onKeyDown:E,...i("chat-composer","textarea")}),(0,n.jsx)(d,{part:i("chat-composer","trailing"),children:K}),(0,n.jsx)(f.Button,{type:"submit",variant:"primary",iconOnly:!!l,"aria-label":l?c:void 0,loading:m,disabled:x||m||!v,...i("chat-composer","send"),children:l??c})]}),(0,n.jsx)(d,{part:i("chat-composer","footer"),children:$})]})};h.displayName="ChatComposer";0&&(module.exports={ChatComposer});
@@ -0,0 +1,20 @@
1
+ import type * as React from 'react';
2
+ import type { ChatComposerProps } from './types.cjs';
3
+ /**
4
+ * Message composer block: an auto-growing Textarea and a submit Button inside a
5
+ * field, with consumer-supplied attachment, leading, trailing and footer
6
+ * regions and configurable Enter-to-send behaviour.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ChatComposer
11
+ * placeholder="Send a message…"
12
+ * pending={isSending}
13
+ * onSend={(detail) => void send(detail.value)}
14
+ * />
15
+ * ```
16
+ */
17
+ export declare const ChatComposer: {
18
+ ({ value: valueProp, defaultValue, onValueChange, placeholder, label, sendLabel, sendIcon, submitKey, maxRows, maxLength, disabled, pending, leading, trailing, attachments, footer, onSend, ...props }: ChatComposerProps): React.ReactNode;
19
+ displayName: string;
20
+ };
@@ -0,0 +1,20 @@
1
+ import type * as React from 'react';
2
+ import type { ChatComposerProps } from './types.js';
3
+ /**
4
+ * Message composer block: an auto-growing Textarea and a submit Button inside a
5
+ * field, with consumer-supplied attachment, leading, trailing and footer
6
+ * regions and configurable Enter-to-send behaviour.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ChatComposer
11
+ * placeholder="Send a message…"
12
+ * pending={isSending}
13
+ * onSend={(detail) => void send(detail.value)}
14
+ * />
15
+ * ```
16
+ */
17
+ export declare const ChatComposer: {
18
+ ({ value: valueProp, defaultValue, onValueChange, placeholder, label, sendLabel, sendIcon, submitKey, maxRows, maxLength, disabled, pending, leading, trailing, attachments, footer, onSend, ...props }: ChatComposerProps): React.ReactNode;
19
+ displayName: string;
20
+ };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{Button as E,Textarea as B}from"@skdx/react";function $(...e){let t="";for(let a of e)a&&(t=t?`${t} ${a}`:a);return t}function r(e,t,a){let s=t==="root",d=s?`skdx-${e}`:`skdx-${e}__${t}`,n={className:$(d,a),"data-part":t};return s&&(n["data-skdx-component"]=e),n}import{jsx as w}from"react/jsx-runtime";var i=({part:e,children:t})=>t?w("div",{...e,children:t}):null;i.displayName="Region";import*as C from"react";function v(e,t,a){let[s,d]=C.useState(t),n=e!==void 0;return[n?e:s,p=>{n||d(p),a?.(p)}]}import{jsx as c,jsxs as b}from"react/jsx-runtime";var S=({value:e,defaultValue:t="",onValueChange:a,placeholder:s,label:d="Message",sendLabel:n="Send",sendIcon:l,submitKey:u="enter",maxRows:p=8,maxLength:k,disabled:f=!1,pending:m=!1,leading:P,trailing:T,attachments:N,footer:A,onSend:K,...x})=>{let[g,R]=v(e,t,a),h=g.trim().length>0,y=()=>{f||m||!h||(K?.({value:g}),e===void 0&&R(""))},D=o=>{u==="none"||o.key!=="Enter"||o.nativeEvent.isComposing||!(u==="enter"?!o.shiftKey:o.metaKey||o.ctrlKey)||(o.preventDefault(),y())};return b("form",{"data-state":m?"pending":void 0,...x,...r("chat-composer","root",x.className),onSubmit:o=>{o.preventDefault(),y()},children:[c(i,{part:r("chat-composer","attachments"),children:N}),b("div",{...r("chat-composer","field"),children:[c(i,{part:r("chat-composer","leading"),children:P}),c(B,{"aria-label":d,placeholder:s,value:g,autoResize:!0,minRows:1,maxRows:p,maxLength:k,disabled:f,onChange:o=>{R(o.target.value)},onKeyDown:D,...r("chat-composer","textarea")}),c(i,{part:r("chat-composer","trailing"),children:T}),c(E,{type:"submit",variant:"primary",iconOnly:!!l,"aria-label":l?n:void 0,loading:m,disabled:f||m||!h,...r("chat-composer","send"),children:l??n})]}),c(i,{part:r("chat-composer","footer"),children:A})]})};S.displayName="ChatComposer";export{S as ChatComposer};
@@ -0,0 +1,2 @@
1
+ export { ChatComposer } from './ChatComposer.cjs';
2
+ export type { ChatComposerProps, ChatComposerSendDetail, ChatComposerSubmitKey } from './types.cjs';
@@ -0,0 +1,2 @@
1
+ export { ChatComposer } from './ChatComposer.js';
2
+ export type { ChatComposerProps, ChatComposerSendDetail, ChatComposerSubmitKey } from './types.js';
@@ -0,0 +1,96 @@
1
+ import type * as React from 'react';
2
+ /** Which key combination sends the message from inside the textarea. */
3
+ export type ChatComposerSubmitKey = 'enter' | 'mod-enter' | 'none';
4
+ /** What {@link ChatComposerProps.onSend} is called with when a message is sent. */
5
+ export interface ChatComposerSendDetail {
6
+ /** The composed message text as it stood when the send was triggered. */
7
+ value: string;
8
+ }
9
+ /** Props for the {@link ChatComposer} block. */
10
+ export interface ChatComposerProps extends Omit<React.ComponentPropsWithRef<'form'>, 'onSubmit' | 'children'> {
11
+ /**
12
+ * Current message text, for controlled usage; pair it with `onValueChange`.
13
+ * @default undefined — uncontrolled, seeded from `defaultValue`.
14
+ */
15
+ value?: string | undefined;
16
+ /**
17
+ * Initial message text for uncontrolled usage, read only on mount.
18
+ * @default ''
19
+ */
20
+ defaultValue?: string | undefined;
21
+ /**
22
+ * Fires with the new text on every edit, including the clear that follows a send.
23
+ * @default undefined — no-op if omitted.
24
+ */
25
+ onValueChange?: ((value: string) => void) | undefined;
26
+ /**
27
+ * Hint text shown in the empty textarea, rendered as the native placeholder.
28
+ * @default undefined — no placeholder text renders.
29
+ */
30
+ placeholder?: string | undefined;
31
+ /**
32
+ * Accessible name of the message textarea, read by assistive technology.
33
+ * @default 'Message'
34
+ */
35
+ label?: string | undefined;
36
+ /**
37
+ * Text of the send button, and its accessible name when `sendIcon` is given.
38
+ * @default 'Send'
39
+ */
40
+ sendLabel?: string | undefined;
41
+ /**
42
+ * Glyph rendered inside the send button in place of its text, making it icon-only.
43
+ * @default undefined — the button renders `sendLabel` as its text.
44
+ */
45
+ sendIcon?: React.ReactNode | undefined;
46
+ /**
47
+ * Which key sends from the textarea; the other Enter presses insert a newline.
48
+ * @default 'enter'
49
+ */
50
+ submitKey?: ChatComposerSubmitKey | undefined;
51
+ /**
52
+ * Caps how far the auto-growing textarea grows, in rows, before it scrolls.
53
+ * @default 8
54
+ */
55
+ maxRows?: number | undefined;
56
+ /**
57
+ * Native `maxlength` of the textarea — the longest message it accepts.
58
+ * @default undefined — no upper bound on the message length.
59
+ */
60
+ maxLength?: number | undefined;
61
+ /**
62
+ * Disables the textarea and the send button, blocking every send path.
63
+ * @default false
64
+ */
65
+ disabled?: boolean | undefined;
66
+ /**
67
+ * Marks a send in flight: the button is busy and inert, the textarea stays editable.
68
+ * @default false
69
+ */
70
+ pending?: boolean | undefined;
71
+ /**
72
+ * Controls rendered inside the field before the textarea, such as an attach button.
73
+ * @default undefined — no leading region renders.
74
+ */
75
+ leading?: React.ReactNode | undefined;
76
+ /**
77
+ * Controls rendered inside the field after the textarea, such as a model picker.
78
+ * @default undefined — no trailing region renders.
79
+ */
80
+ trailing?: React.ReactNode | undefined;
81
+ /**
82
+ * Attached files or chips rendered in a row above the field.
83
+ * @default undefined — no attachments region renders.
84
+ */
85
+ attachments?: React.ReactNode | undefined;
86
+ /**
87
+ * Usage counters or hints rendered in a row below the field.
88
+ * @default undefined — no footer region renders.
89
+ */
90
+ footer?: React.ReactNode | undefined;
91
+ /**
92
+ * Fires with the message text when a send is triggered by the button or the keyboard.
93
+ * @default undefined — no-op if omitted.
94
+ */
95
+ onSend?: ((detail: ChatComposerSendDetail) => void) | undefined;
96
+ }
@@ -0,0 +1,96 @@
1
+ import type * as React from 'react';
2
+ /** Which key combination sends the message from inside the textarea. */
3
+ export type ChatComposerSubmitKey = 'enter' | 'mod-enter' | 'none';
4
+ /** What {@link ChatComposerProps.onSend} is called with when a message is sent. */
5
+ export interface ChatComposerSendDetail {
6
+ /** The composed message text as it stood when the send was triggered. */
7
+ value: string;
8
+ }
9
+ /** Props for the {@link ChatComposer} block. */
10
+ export interface ChatComposerProps extends Omit<React.ComponentPropsWithRef<'form'>, 'onSubmit' | 'children'> {
11
+ /**
12
+ * Current message text, for controlled usage; pair it with `onValueChange`.
13
+ * @default undefined — uncontrolled, seeded from `defaultValue`.
14
+ */
15
+ value?: string | undefined;
16
+ /**
17
+ * Initial message text for uncontrolled usage, read only on mount.
18
+ * @default ''
19
+ */
20
+ defaultValue?: string | undefined;
21
+ /**
22
+ * Fires with the new text on every edit, including the clear that follows a send.
23
+ * @default undefined — no-op if omitted.
24
+ */
25
+ onValueChange?: ((value: string) => void) | undefined;
26
+ /**
27
+ * Hint text shown in the empty textarea, rendered as the native placeholder.
28
+ * @default undefined — no placeholder text renders.
29
+ */
30
+ placeholder?: string | undefined;
31
+ /**
32
+ * Accessible name of the message textarea, read by assistive technology.
33
+ * @default 'Message'
34
+ */
35
+ label?: string | undefined;
36
+ /**
37
+ * Text of the send button, and its accessible name when `sendIcon` is given.
38
+ * @default 'Send'
39
+ */
40
+ sendLabel?: string | undefined;
41
+ /**
42
+ * Glyph rendered inside the send button in place of its text, making it icon-only.
43
+ * @default undefined — the button renders `sendLabel` as its text.
44
+ */
45
+ sendIcon?: React.ReactNode | undefined;
46
+ /**
47
+ * Which key sends from the textarea; the other Enter presses insert a newline.
48
+ * @default 'enter'
49
+ */
50
+ submitKey?: ChatComposerSubmitKey | undefined;
51
+ /**
52
+ * Caps how far the auto-growing textarea grows, in rows, before it scrolls.
53
+ * @default 8
54
+ */
55
+ maxRows?: number | undefined;
56
+ /**
57
+ * Native `maxlength` of the textarea — the longest message it accepts.
58
+ * @default undefined — no upper bound on the message length.
59
+ */
60
+ maxLength?: number | undefined;
61
+ /**
62
+ * Disables the textarea and the send button, blocking every send path.
63
+ * @default false
64
+ */
65
+ disabled?: boolean | undefined;
66
+ /**
67
+ * Marks a send in flight: the button is busy and inert, the textarea stays editable.
68
+ * @default false
69
+ */
70
+ pending?: boolean | undefined;
71
+ /**
72
+ * Controls rendered inside the field before the textarea, such as an attach button.
73
+ * @default undefined — no leading region renders.
74
+ */
75
+ leading?: React.ReactNode | undefined;
76
+ /**
77
+ * Controls rendered inside the field after the textarea, such as a model picker.
78
+ * @default undefined — no trailing region renders.
79
+ */
80
+ trailing?: React.ReactNode | undefined;
81
+ /**
82
+ * Attached files or chips rendered in a row above the field.
83
+ * @default undefined — no attachments region renders.
84
+ */
85
+ attachments?: React.ReactNode | undefined;
86
+ /**
87
+ * Usage counters or hints rendered in a row below the field.
88
+ * @default undefined — no footer region renders.
89
+ */
90
+ footer?: React.ReactNode | undefined;
91
+ /**
92
+ * Fires with the message text when a send is triggered by the button or the keyboard.
93
+ * @default undefined — no-op if omitted.
94
+ */
95
+ onSend?: ((detail: ChatComposerSendDetail) => void) | undefined;
96
+ }
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var c=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var a in e)c(t,a,{get:e[a],enumerable:!0})},C=(t,e,a,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!y.call(t,r)&&r!==a&&c(t,r,{get:()=>e[r],enumerable:!(d=x(e,r))||d.enumerable});return t};var M=t=>C(c({},"__esModule",{value:!0}),t);var $={};P($,{ChatMessage:()=>u});module.exports=M($);var p=require("@skdx/react");function N(...t){let e="";for(let a of t)a&&(e=e?`${e} ${a}`:a);return e}function n(t,e,a){let d=e==="root",r=d?`skdx-${t}`:`skdx-${t}__${e}`,i={className:N(r,a),"data-part":e};return d&&(i["data-skdx-component"]=t),i}var s=require("react/jsx-runtime"),u=({sender:t,author:e,avatar:a,timestamp:d,now:r,status:i,statusLabel:o,attachments:l,actions:g,footer:f,children:h,...m})=>{let v=e!==void 0||d!==void 0||o!==void 0;return(0,s.jsxs)("article",{"data-sender":t,"data-status":i,"aria-busy":i==="pending"?!0:void 0,...m,...n("chat-message","root",m.className),children:[a?(0,s.jsx)("div",{"aria-hidden":"true",...n("chat-message","avatar"),children:a}):null,(0,s.jsxs)("div",{...n("chat-message","main"),children:[v?(0,s.jsxs)("div",{...n("chat-message","header"),children:[e!==void 0?(0,s.jsx)("span",{...n("chat-message","author"),children:e}):null,d!==void 0?(0,s.jsx)(p.Time,{value:d,relative:!0,now:r,...n("chat-message","time")}):null,o!==void 0?(0,s.jsx)("span",{...n("chat-message","status"),children:o}):null]}):null,(0,s.jsx)("div",{...n("chat-message","content"),children:h}),l?(0,s.jsx)("div",{...n("chat-message","attachments"),children:l}):null,f?(0,s.jsx)("div",{...n("chat-message","footer"),children:f}):null,g?(0,s.jsx)("div",{...n("chat-message","actions"),children:g}):null]})]})};u.displayName="ChatMessage";0&&(module.exports={ChatMessage});
@@ -0,0 +1,23 @@
1
+ import type * as React from 'react';
2
+ import type { ChatMessageProps } from './types.cjs';
3
+ /**
4
+ * One message in a conversation: author, avatar, timestamp, delivery status,
5
+ * arbitrary content, attachments, actions and a footer, composing Time; the
6
+ * sender decides the alignment and the skin, never the wording.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ChatMessage
11
+ * sender="assistant"
12
+ * author="Assistant"
13
+ * timestamp={message.sentAt}
14
+ * status={message.status}
15
+ * >
16
+ * {message.text}
17
+ * </ChatMessage>
18
+ * ```
19
+ */
20
+ export declare const ChatMessage: {
21
+ ({ sender, author, avatar, timestamp, now, status, statusLabel, attachments, actions, footer, children, ...props }: ChatMessageProps): React.ReactNode;
22
+ displayName: string;
23
+ };
@@ -0,0 +1,23 @@
1
+ import type * as React from 'react';
2
+ import type { ChatMessageProps } from './types.js';
3
+ /**
4
+ * One message in a conversation: author, avatar, timestamp, delivery status,
5
+ * arbitrary content, attachments, actions and a footer, composing Time; the
6
+ * sender decides the alignment and the skin, never the wording.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ChatMessage
11
+ * sender="assistant"
12
+ * author="Assistant"
13
+ * timestamp={message.sentAt}
14
+ * status={message.status}
15
+ * >
16
+ * {message.text}
17
+ * </ChatMessage>
18
+ * ```
19
+ */
20
+ export declare const ChatMessage: {
21
+ ({ sender, author, avatar, timestamp, now, status, statusLabel, attachments, actions, footer, children, ...props }: ChatMessageProps): React.ReactNode;
22
+ displayName: string;
23
+ };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{Time as x}from"@skdx/react";function v(...n){let e="";for(let a of n)a&&(e=e?`${e} ${a}`:a);return e}function t(n,e,a){let d=e==="root",i=d?`skdx-${n}`:`skdx-${n}__${e}`,r={className:v(i,a),"data-part":e};return d&&(r["data-skdx-component"]=n),r}import{jsx as s,jsxs as c}from"react/jsx-runtime";var m=({sender:n,author:e,avatar:a,timestamp:d,now:i,status:r,statusLabel:o,attachments:u,actions:l,footer:g,children:p,...f})=>{let h=e!==void 0||d!==void 0||o!==void 0;return c("article",{"data-sender":n,"data-status":r,"aria-busy":r==="pending"?!0:void 0,...f,...t("chat-message","root",f.className),children:[a?s("div",{"aria-hidden":"true",...t("chat-message","avatar"),children:a}):null,c("div",{...t("chat-message","main"),children:[h?c("div",{...t("chat-message","header"),children:[e!==void 0?s("span",{...t("chat-message","author"),children:e}):null,d!==void 0?s(x,{value:d,relative:!0,now:i,...t("chat-message","time")}):null,o!==void 0?s("span",{...t("chat-message","status"),children:o}):null]}):null,s("div",{...t("chat-message","content"),children:p}),u?s("div",{...t("chat-message","attachments"),children:u}):null,g?s("div",{...t("chat-message","footer"),children:g}):null,l?s("div",{...t("chat-message","actions"),children:l}):null]})]})};m.displayName="ChatMessage";export{m as ChatMessage};
@@ -0,0 +1,2 @@
1
+ export { ChatMessage } from './ChatMessage.cjs';
2
+ export type { ChatMessageProps } from './types.cjs';
@@ -0,0 +1,2 @@
1
+ export { ChatMessage } from './ChatMessage.js';
2
+ export type { ChatMessageProps } from './types.js';
@@ -0,0 +1,57 @@
1
+ import type * as React from 'react';
2
+ import type { DateInput } from '@skdx/react';
3
+ /** Props for the {@link ChatMessage} block. */
4
+ export interface ChatMessageProps extends React.ComponentPropsWithRef<'article'> {
5
+ /**
6
+ * Who sent the message, written to data-sender; the skin aligns user messages to
7
+ * the end and styles system messages as a centred note.
8
+ */
9
+ sender: 'user' | 'assistant' | 'system' | (string & {});
10
+ /**
11
+ * Name of the person, model or system that sent the message, rendered as visible text.
12
+ * @default undefined — no author region renders.
13
+ */
14
+ author?: string | undefined;
15
+ /**
16
+ * Decorative avatar rendered beside the message, always `aria-hidden`.
17
+ * @default undefined — no avatar region renders.
18
+ */
19
+ avatar?: React.ReactNode | undefined;
20
+ /**
21
+ * Instant the message was sent, rendered through a composed Time.
22
+ * @default undefined — no time region renders.
23
+ */
24
+ timestamp?: DateInput | undefined;
25
+ /**
26
+ * Reference instant the timestamp's relative label renders against.
27
+ * @default undefined — read once at render
28
+ */
29
+ now?: Date | number | undefined;
30
+ /**
31
+ * Delivery state, written to data-status; `'pending'` also sets aria-busy on the root.
32
+ * @default undefined — no delivery state is written.
33
+ */
34
+ status?: 'pending' | 'sent' | 'error' | (string & {}) | undefined;
35
+ /**
36
+ * Visible text for the delivery state, in the app's own wording (e.g. "Sending…").
37
+ * @default undefined — no status region renders.
38
+ */
39
+ statusLabel?: string | undefined;
40
+ /**
41
+ * Files, links or previews attached to the message, rendered below the content.
42
+ * @default undefined — no attachments region renders.
43
+ */
44
+ attachments?: React.ReactNode | undefined;
45
+ /**
46
+ * Controls such as copy, regenerate or react, rendered below the footer.
47
+ * @default undefined — no actions region renders.
48
+ */
49
+ actions?: React.ReactNode | undefined;
50
+ /**
51
+ * Citations, token counts or other metadata, rendered below the content.
52
+ * @default undefined — no footer region renders.
53
+ */
54
+ footer?: React.ReactNode | undefined;
55
+ /** The message content: markdown output, code, citations or tool results. */
56
+ children: React.ReactNode;
57
+ }
@@ -0,0 +1,57 @@
1
+ import type * as React from 'react';
2
+ import type { DateInput } from '@skdx/react';
3
+ /** Props for the {@link ChatMessage} block. */
4
+ export interface ChatMessageProps extends React.ComponentPropsWithRef<'article'> {
5
+ /**
6
+ * Who sent the message, written to data-sender; the skin aligns user messages to
7
+ * the end and styles system messages as a centred note.
8
+ */
9
+ sender: 'user' | 'assistant' | 'system' | (string & {});
10
+ /**
11
+ * Name of the person, model or system that sent the message, rendered as visible text.
12
+ * @default undefined — no author region renders.
13
+ */
14
+ author?: string | undefined;
15
+ /**
16
+ * Decorative avatar rendered beside the message, always `aria-hidden`.
17
+ * @default undefined — no avatar region renders.
18
+ */
19
+ avatar?: React.ReactNode | undefined;
20
+ /**
21
+ * Instant the message was sent, rendered through a composed Time.
22
+ * @default undefined — no time region renders.
23
+ */
24
+ timestamp?: DateInput | undefined;
25
+ /**
26
+ * Reference instant the timestamp's relative label renders against.
27
+ * @default undefined — read once at render
28
+ */
29
+ now?: Date | number | undefined;
30
+ /**
31
+ * Delivery state, written to data-status; `'pending'` also sets aria-busy on the root.
32
+ * @default undefined — no delivery state is written.
33
+ */
34
+ status?: 'pending' | 'sent' | 'error' | (string & {}) | undefined;
35
+ /**
36
+ * Visible text for the delivery state, in the app's own wording (e.g. "Sending…").
37
+ * @default undefined — no status region renders.
38
+ */
39
+ statusLabel?: string | undefined;
40
+ /**
41
+ * Files, links or previews attached to the message, rendered below the content.
42
+ * @default undefined — no attachments region renders.
43
+ */
44
+ attachments?: React.ReactNode | undefined;
45
+ /**
46
+ * Controls such as copy, regenerate or react, rendered below the footer.
47
+ * @default undefined — no actions region renders.
48
+ */
49
+ actions?: React.ReactNode | undefined;
50
+ /**
51
+ * Citations, token counts or other metadata, rendered below the content.
52
+ * @default undefined — no footer region renders.
53
+ */
54
+ footer?: React.ReactNode | undefined;
55
+ /** The message content: markdown output, code, citations or tool results. */
56
+ children: React.ReactNode;
57
+ }
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var s=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of k(t))!g.call(e,m)&&m!==n&&s(e,m,{get:()=>t[m],enumerable:!(i=x(t,m))||i.enumerable});return e};var C=e=>y(s({},"__esModule",{value:!0}),e);var N={};P(N,{Comment:()=>d});module.exports=C(N);var f=require("@skdx/react");function b(...e){let t="";for(let n of e)n&&(t=t?`${t} ${n}`:n);return t}function r(e,t,n){let i=t==="root",m=i?`skdx-${e}`:`skdx-${e}__${t}`,a={className:b(m,n),"data-part":t};return i&&(a["data-skdx-component"]=e),a}var o=require("react/jsx-runtime"),d=({author:e,avatar:t,timestamp:n,now:i,edited:m=!1,editedLabel:a="Edited",metadata:c,attachments:l,actions:u,children:v,...p})=>(0,o.jsxs)("article",{...p,...r("comment","root",p.className),children:[t?(0,o.jsx)("div",{"aria-hidden":"true",...r("comment","avatar"),children:t}):null,(0,o.jsxs)("div",{...r("comment","main"),children:[(0,o.jsxs)("div",{...r("comment","header"),children:[(0,o.jsx)("span",{...r("comment","author"),children:e}),c?(0,o.jsx)("span",{...r("comment","metadata"),children:c}):null,n!==void 0?(0,o.jsx)(f.Time,{value:n,relative:!0,now:i,...r("comment","time")}):null,m?(0,o.jsx)("span",{...r("comment","edited"),children:a}):null]}),(0,o.jsx)("div",{...r("comment","content"),children:v}),l?(0,o.jsx)("div",{...r("comment","attachments"),children:l}):null,u?(0,o.jsx)("div",{...r("comment","actions"),children:u}):null]})]});d.displayName="Comment";0&&(module.exports={Comment});
@@ -0,0 +1,22 @@
1
+ import type * as React from 'react';
2
+ import type { CommentProps } from './types.cjs';
3
+ /**
4
+ * One collaboration comment: author, avatar, timestamp, edited indicator,
5
+ * arbitrary content, attachments and actions such as reply, edit and react.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <Comment
10
+ * author="Priya Shah"
11
+ * avatar={<Avatar name="Priya Shah" />}
12
+ * timestamp={comment.postedAt}
13
+ * actions={<Button size="sm">Reply</Button>}
14
+ * >
15
+ * Looks good to me.
16
+ * </Comment>
17
+ * ```
18
+ */
19
+ export declare const Comment: {
20
+ ({ author, avatar, timestamp, now, edited, editedLabel, metadata, attachments, actions, children, ...props }: CommentProps): React.ReactNode;
21
+ displayName: string;
22
+ };
@@ -0,0 +1,22 @@
1
+ import type * as React from 'react';
2
+ import type { CommentProps } from './types.js';
3
+ /**
4
+ * One collaboration comment: author, avatar, timestamp, edited indicator,
5
+ * arbitrary content, attachments and actions such as reply, edit and react.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <Comment
10
+ * author="Priya Shah"
11
+ * avatar={<Avatar name="Priya Shah" />}
12
+ * timestamp={comment.postedAt}
13
+ * actions={<Button size="sm">Reply</Button>}
14
+ * >
15
+ * Looks good to me.
16
+ * </Comment>
17
+ * ```
18
+ */
19
+ export declare const Comment: {
20
+ ({ author, avatar, timestamp, now, edited, editedLabel, metadata, attachments, actions, children, ...props }: CommentProps): React.ReactNode;
21
+ displayName: string;
22
+ };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{Time as x}from"@skdx/react";function v(...r){let e="";for(let n of r)n&&(e=e?`${e} ${n}`:n);return e}function t(r,e,n){let m=e==="root",a=m?`skdx-${r}`:`skdx-${r}__${e}`,i={className:v(a,n),"data-part":e};return m&&(i["data-skdx-component"]=r),i}import{jsx as o,jsxs as s}from"react/jsx-runtime";var p=({author:r,avatar:e,timestamp:n,now:m,edited:a=!1,editedLabel:i="Edited",metadata:d,attachments:c,actions:l,children:f,...u})=>s("article",{...u,...t("comment","root",u.className),children:[e?o("div",{"aria-hidden":"true",...t("comment","avatar"),children:e}):null,s("div",{...t("comment","main"),children:[s("div",{...t("comment","header"),children:[o("span",{...t("comment","author"),children:r}),d?o("span",{...t("comment","metadata"),children:d}):null,n!==void 0?o(x,{value:n,relative:!0,now:m,...t("comment","time")}):null,a?o("span",{...t("comment","edited"),children:i}):null]}),o("div",{...t("comment","content"),children:f}),c?o("div",{...t("comment","attachments"),children:c}):null,l?o("div",{...t("comment","actions"),children:l}):null]})]});p.displayName="Comment";export{p as Comment};
@@ -0,0 +1,2 @@
1
+ export { Comment } from './Comment.cjs';
2
+ export type { CommentProps } from './types.cjs';
@@ -0,0 +1,2 @@
1
+ export { Comment } from './Comment.js';
2
+ export type { CommentProps } from './types.js';
@@ -0,0 +1,47 @@
1
+ import type * as React from 'react';
2
+ import type { DateInput } from '@skdx/react';
3
+ /** Props for the {@link Comment} block. */
4
+ export interface CommentProps extends React.ComponentPropsWithRef<'article'> {
5
+ /** Name of the person or system that wrote the comment, rendered as visible text. */
6
+ author: string;
7
+ /**
8
+ * Decorative avatar rendered beside the author, always `aria-hidden`.
9
+ * @default undefined — no avatar region renders.
10
+ */
11
+ avatar?: React.ReactNode | undefined;
12
+ /**
13
+ * Instant the comment was posted, rendered through a composed Time.
14
+ * @default undefined — no time region renders.
15
+ */
16
+ timestamp?: DateInput | undefined;
17
+ /**
18
+ * Reference instant `timestamp` renders relative to, forwarded to Time.
19
+ * @default undefined — read once at render
20
+ */
21
+ now?: Date | number | undefined;
22
+ /**
23
+ * Marks the comment as edited since it was first posted.
24
+ * @default false
25
+ */
26
+ edited?: boolean | undefined;
27
+ /**
28
+ * Text of the edited indicator, shown only when `edited` is set.
29
+ * @default 'Edited'
30
+ */
31
+ editedLabel?: string | undefined;
32
+ /**
33
+ * Badges or supplementary text rendered beside the author, such as an "Author" badge.
34
+ * @default undefined — no metadata region renders.
35
+ */
36
+ metadata?: React.ReactNode | undefined;
37
+ /**
38
+ * Files or links attached to the comment, rendered below the content.
39
+ * @default undefined — no attachments region renders.
40
+ */
41
+ attachments?: React.ReactNode | undefined;
42
+ /**
43
+ * Controls such as reply, edit and react, rendered below the attachments.
44
+ * @default undefined — no actions region renders.
45
+ */
46
+ actions?: React.ReactNode | undefined;
47
+ }
@@ -0,0 +1,47 @@
1
+ import type * as React from 'react';
2
+ import type { DateInput } from '@skdx/react';
3
+ /** Props for the {@link Comment} block. */
4
+ export interface CommentProps extends React.ComponentPropsWithRef<'article'> {
5
+ /** Name of the person or system that wrote the comment, rendered as visible text. */
6
+ author: string;
7
+ /**
8
+ * Decorative avatar rendered beside the author, always `aria-hidden`.
9
+ * @default undefined — no avatar region renders.
10
+ */
11
+ avatar?: React.ReactNode | undefined;
12
+ /**
13
+ * Instant the comment was posted, rendered through a composed Time.
14
+ * @default undefined — no time region renders.
15
+ */
16
+ timestamp?: DateInput | undefined;
17
+ /**
18
+ * Reference instant `timestamp` renders relative to, forwarded to Time.
19
+ * @default undefined — read once at render
20
+ */
21
+ now?: Date | number | undefined;
22
+ /**
23
+ * Marks the comment as edited since it was first posted.
24
+ * @default false
25
+ */
26
+ edited?: boolean | undefined;
27
+ /**
28
+ * Text of the edited indicator, shown only when `edited` is set.
29
+ * @default 'Edited'
30
+ */
31
+ editedLabel?: string | undefined;
32
+ /**
33
+ * Badges or supplementary text rendered beside the author, such as an "Author" badge.
34
+ * @default undefined — no metadata region renders.
35
+ */
36
+ metadata?: React.ReactNode | undefined;
37
+ /**
38
+ * Files or links attached to the comment, rendered below the content.
39
+ * @default undefined — no attachments region renders.
40
+ */
41
+ attachments?: React.ReactNode | undefined;
42
+ /**
43
+ * Controls such as reply, edit and react, rendered below the attachments.
44
+ * @default undefined — no actions region renders.
45
+ */
46
+ actions?: React.ReactNode | undefined;
47
+ }
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var b=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)m(e,o,{get:t[o],enumerable:!0})},v=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!R.call(e,n)&&n!==o&&m(e,n,{get:()=>t[n],enumerable:!(a=k(t,n))||a.enumerable});return e};var N=(e,t,o)=>(o=e!=null?b(P(e)):{},v(t||!e||!e.__esModule?m(o,"default",{value:e,enumerable:!0}):o,e)),$=e=>v(m({},"__esModule",{value:!0}),e);var V={};S(V,{CommentThread:()=>p});module.exports=$(V);var i=require("@skdx/react/primitives/collapsible");function A(...e){let t="";for(let o of e)o&&(t=t?`${t} ${o}`:o);return t}function s(e,t,o){let a=t==="root",n=a?`skdx-${e}`:`skdx-${e}__${t}`,d={className:A(n,o),"data-part":t};return a&&(d["data-skdx-component"]=e),d}var C=N(require("react"),1);function g(e,t,o){let[a,n]=C.useState(t),d=e!==void 0;return[d?e:a,l=>{d||n(l),o?.(l)}]}var r=require("react/jsx-runtime"),p=({children:e,replies:t,expanded:o,defaultExpanded:a=!0,onExpandedChange:n,showRepliesLabel:d,hideRepliesLabel:f,loadMore:c,composer:l,...x})=>{let[u,T]=g(o,a,n),h=d?(0,r.jsxs)(i.CollapsibleRoot,{open:u,onOpenChange:T,children:[(0,r.jsx)(i.CollapsibleTrigger,{...s("comment-thread","toggle"),children:u?f??d:d}),(0,r.jsx)(i.CollapsibleContent,{...s("comment-thread","replies"),children:t})]}):(0,r.jsx)("div",{...s("comment-thread","replies"),children:t});return(0,r.jsxs)("div",{"data-state":u?"expanded":"collapsed",...x,...s("comment-thread","root",x.className),children:[(0,r.jsx)("div",{...s("comment-thread","comment"),children:e}),t?h:null,c?(0,r.jsx)("div",{...s("comment-thread","load-more"),children:c}):null,l?(0,r.jsx)("div",{...s("comment-thread","composer"),children:l}):null]})};p.displayName="CommentThread";0&&(module.exports={CommentThread});
@@ -0,0 +1,21 @@
1
+ import type * as React from 'react';
2
+ import type { CommentThreadProps } from './types.cjs';
3
+ /**
4
+ * A root comment with its replies, indented one level, collapsible with the
5
+ * consumer's own labels, plus slots for a load-more control and a composer.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <CommentThread
10
+ * replies={<Comment author="Alex">Agreed.</Comment>}
11
+ * showRepliesLabel="Show 1 reply"
12
+ * hideRepliesLabel="Hide replies"
13
+ * >
14
+ * <Comment author="Priya Shah">Looks good to me.</Comment>
15
+ * </CommentThread>
16
+ * ```
17
+ */
18
+ export declare const CommentThread: {
19
+ ({ children, replies, expanded: expandedProp, defaultExpanded, onExpandedChange, showRepliesLabel, hideRepliesLabel, loadMore, composer, ...props }: CommentThreadProps): React.ReactNode;
20
+ displayName: string;
21
+ };