@skdx/web-components-blocks 0.34.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 (166) hide show
  1. package/custom-elements.json +5067 -285
  2. package/dist/chat-composer/ChatComposer.cjs +41 -0
  3. package/dist/chat-composer/ChatComposer.d.cts +125 -0
  4. package/dist/chat-composer/ChatComposer.d.ts +125 -0
  5. package/dist/chat-composer/ChatComposer.js +41 -0
  6. package/dist/chat-composer/index.cjs +1 -0
  7. package/dist/chat-composer/index.d.cts +1 -0
  8. package/dist/chat-composer/index.d.ts +1 -0
  9. package/dist/chat-composer/index.js +1 -0
  10. package/dist/chat-message/ChatMessage.cjs +26 -0
  11. package/dist/chat-message/ChatMessage.d.cts +74 -0
  12. package/dist/chat-message/ChatMessage.d.ts +74 -0
  13. package/dist/chat-message/ChatMessage.js +26 -0
  14. package/dist/chat-message/index.cjs +1 -0
  15. package/dist/chat-message/index.d.cts +1 -0
  16. package/dist/chat-message/index.d.ts +1 -0
  17. package/dist/chat-message/index.js +1 -0
  18. package/dist/comment/Comment.cjs +26 -0
  19. package/dist/comment/Comment.d.cts +66 -0
  20. package/dist/comment/Comment.d.ts +66 -0
  21. package/dist/comment/Comment.js +26 -0
  22. package/dist/comment/index.cjs +1 -0
  23. package/dist/comment/index.d.cts +1 -0
  24. package/dist/comment/index.d.ts +1 -0
  25. package/dist/comment/index.js +1 -0
  26. package/dist/comment-thread/CommentThread.cjs +27 -0
  27. package/dist/comment-thread/CommentThread.d.cts +67 -0
  28. package/dist/comment-thread/CommentThread.d.ts +67 -0
  29. package/dist/comment-thread/CommentThread.js +27 -0
  30. package/dist/comment-thread/index.cjs +1 -0
  31. package/dist/comment-thread/index.d.cts +1 -0
  32. package/dist/comment-thread/index.d.ts +1 -0
  33. package/dist/comment-thread/index.js +1 -0
  34. package/dist/confirm-dialog/ConfirmDialog.cjs +38 -0
  35. package/dist/confirm-dialog/ConfirmDialog.d.cts +101 -0
  36. package/dist/confirm-dialog/ConfirmDialog.d.ts +101 -0
  37. package/dist/confirm-dialog/ConfirmDialog.js +38 -0
  38. package/dist/confirm-dialog/index.cjs +1 -0
  39. package/dist/confirm-dialog/index.d.cts +1 -0
  40. package/dist/confirm-dialog/index.d.ts +1 -0
  41. package/dist/confirm-dialog/index.js +1 -0
  42. package/dist/conversation-list/ConversationList.cjs +52 -0
  43. package/dist/conversation-list/ConversationList.d.cts +124 -0
  44. package/dist/conversation-list/ConversationList.d.ts +124 -0
  45. package/dist/conversation-list/ConversationList.js +52 -0
  46. package/dist/conversation-list/index.cjs +1 -0
  47. package/dist/conversation-list/index.d.cts +1 -0
  48. package/dist/conversation-list/index.d.ts +1 -0
  49. package/dist/conversation-list/index.js +1 -0
  50. package/dist/empty-state/EmptyState.cjs +29 -0
  51. package/dist/empty-state/EmptyState.d.cts +69 -0
  52. package/dist/empty-state/EmptyState.d.ts +69 -0
  53. package/dist/empty-state/EmptyState.js +29 -0
  54. package/dist/empty-state/index.cjs +1 -0
  55. package/dist/empty-state/index.d.cts +1 -0
  56. package/dist/empty-state/index.d.ts +1 -0
  57. package/dist/empty-state/index.js +1 -0
  58. package/dist/filter-bar/FilterBar.cjs +44 -0
  59. package/dist/filter-bar/FilterBar.d.cts +110 -0
  60. package/dist/filter-bar/FilterBar.d.ts +110 -0
  61. package/dist/filter-bar/FilterBar.js +44 -0
  62. package/dist/filter-bar/index.cjs +1 -0
  63. package/dist/filter-bar/index.d.cts +1 -0
  64. package/dist/filter-bar/index.d.ts +1 -0
  65. package/dist/filter-bar/index.js +1 -0
  66. package/dist/forgot-password-page/ForgotPasswordPage.cjs +57 -0
  67. package/dist/forgot-password-page/ForgotPasswordPage.d.cts +95 -0
  68. package/dist/forgot-password-page/ForgotPasswordPage.d.ts +95 -0
  69. package/dist/forgot-password-page/ForgotPasswordPage.js +57 -0
  70. package/dist/forgot-password-page/index.cjs +1 -0
  71. package/dist/forgot-password-page/index.d.cts +1 -0
  72. package/dist/forgot-password-page/index.d.ts +1 -0
  73. package/dist/forgot-password-page/index.js +1 -0
  74. package/dist/form-section/FormSection.cjs +28 -0
  75. package/dist/form-section/FormSection.d.cts +63 -0
  76. package/dist/form-section/FormSection.d.ts +63 -0
  77. package/dist/form-section/FormSection.js +28 -0
  78. package/dist/form-section/index.cjs +1 -0
  79. package/dist/form-section/index.d.cts +1 -0
  80. package/dist/form-section/index.d.ts +1 -0
  81. package/dist/form-section/index.js +1 -0
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.d.cts +19 -0
  84. package/dist/index.d.ts +19 -0
  85. package/dist/index.js +1 -1
  86. package/dist/internal/slots.cjs +1 -1
  87. package/dist/internal/slots.d.cts +2 -0
  88. package/dist/internal/slots.d.ts +2 -0
  89. package/dist/internal/slots.js +1 -1
  90. package/dist/notification-center/NotificationCenter.cjs +74 -0
  91. package/dist/notification-center/NotificationCenter.d.cts +147 -0
  92. package/dist/notification-center/NotificationCenter.d.ts +147 -0
  93. package/dist/notification-center/NotificationCenter.js +74 -0
  94. package/dist/notification-center/index.cjs +1 -0
  95. package/dist/notification-center/index.d.cts +1 -0
  96. package/dist/notification-center/index.d.ts +1 -0
  97. package/dist/notification-center/index.js +1 -0
  98. package/dist/onboarding-checklist/OnboardingChecklist.cjs +55 -0
  99. package/dist/onboarding-checklist/OnboardingChecklist.d.cts +89 -0
  100. package/dist/onboarding-checklist/OnboardingChecklist.d.ts +89 -0
  101. package/dist/onboarding-checklist/OnboardingChecklist.js +55 -0
  102. package/dist/onboarding-checklist/index.cjs +1 -0
  103. package/dist/onboarding-checklist/index.d.cts +1 -0
  104. package/dist/onboarding-checklist/index.d.ts +1 -0
  105. package/dist/onboarding-checklist/index.js +1 -0
  106. package/dist/reset-password-page/ResetPasswordPage.cjs +59 -0
  107. package/dist/reset-password-page/ResetPasswordPage.d.cts +104 -0
  108. package/dist/reset-password-page/ResetPasswordPage.d.ts +104 -0
  109. package/dist/reset-password-page/ResetPasswordPage.js +59 -0
  110. package/dist/reset-password-page/index.cjs +1 -0
  111. package/dist/reset-password-page/index.d.cts +1 -0
  112. package/dist/reset-password-page/index.d.ts +1 -0
  113. package/dist/reset-password-page/index.js +1 -0
  114. package/dist/sign-up-page/SignUpPage.cjs +97 -0
  115. package/dist/sign-up-page/SignUpPage.d.cts +133 -0
  116. package/dist/sign-up-page/SignUpPage.d.ts +133 -0
  117. package/dist/sign-up-page/SignUpPage.js +97 -0
  118. package/dist/sign-up-page/index.cjs +1 -0
  119. package/dist/sign-up-page/index.d.cts +1 -0
  120. package/dist/sign-up-page/index.d.ts +1 -0
  121. package/dist/sign-up-page/index.js +1 -0
  122. package/dist/stat-card/StatCard.cjs +61 -0
  123. package/dist/stat-card/StatCard.d.cts +90 -0
  124. package/dist/stat-card/StatCard.d.ts +90 -0
  125. package/dist/stat-card/StatCard.js +61 -0
  126. package/dist/stat-card/index.cjs +1 -0
  127. package/dist/stat-card/index.d.cts +1 -0
  128. package/dist/stat-card/index.d.ts +1 -0
  129. package/dist/stat-card/index.js +1 -0
  130. package/dist/usage-card/UsageCard.cjs +42 -0
  131. package/dist/usage-card/UsageCard.d.cts +81 -0
  132. package/dist/usage-card/UsageCard.d.ts +81 -0
  133. package/dist/usage-card/UsageCard.js +42 -0
  134. package/dist/usage-card/index.cjs +1 -0
  135. package/dist/usage-card/index.d.cts +1 -0
  136. package/dist/usage-card/index.d.ts +1 -0
  137. package/dist/usage-card/index.js +1 -0
  138. package/dist/usage-card/usage.cjs +1 -0
  139. package/dist/usage-card/usage.d.cts +18 -0
  140. package/dist/usage-card/usage.d.ts +18 -0
  141. package/dist/usage-card/usage.js +1 -0
  142. package/dist/user-menu/UserMenu.cjs +30 -0
  143. package/dist/user-menu/UserMenu.d.cts +84 -0
  144. package/dist/user-menu/UserMenu.d.ts +84 -0
  145. package/dist/user-menu/UserMenu.js +30 -0
  146. package/dist/user-menu/index.cjs +1 -0
  147. package/dist/user-menu/index.d.cts +1 -0
  148. package/dist/user-menu/index.d.ts +1 -0
  149. package/dist/user-menu/index.js +1 -0
  150. package/dist/verification-page/VerificationPage.cjs +63 -0
  151. package/dist/verification-page/VerificationPage.d.cts +149 -0
  152. package/dist/verification-page/VerificationPage.d.ts +149 -0
  153. package/dist/verification-page/VerificationPage.js +63 -0
  154. package/dist/verification-page/index.cjs +1 -0
  155. package/dist/verification-page/index.d.cts +1 -0
  156. package/dist/verification-page/index.d.ts +1 -0
  157. package/dist/verification-page/index.js +1 -0
  158. package/dist/workspace-switcher/WorkspaceSwitcher.cjs +69 -0
  159. package/dist/workspace-switcher/WorkspaceSwitcher.d.cts +165 -0
  160. package/dist/workspace-switcher/WorkspaceSwitcher.d.ts +165 -0
  161. package/dist/workspace-switcher/WorkspaceSwitcher.js +69 -0
  162. package/dist/workspace-switcher/index.cjs +1 -0
  163. package/dist/workspace-switcher/index.d.cts +1 -0
  164. package/dist/workspace-switcher/index.d.ts +1 -0
  165. package/dist/workspace-switcher/index.js +1 -0
  166. package/package.json +272 -6
@@ -0,0 +1,41 @@
1
+ "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(l,a)=>{for(var e in a)d(l,e,{get:a[e],enumerable:!0})},x=(l,a,e,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of v(a))!b.call(l,i)&&i!==e&&d(l,i,{get:()=>a[i],enumerable:!(r=p(a,i))||r.enumerable});return l};var f=l=>x(d({},"__esModule",{value:!0}),l),n=(l,a,e,r)=>{for(var i=r>1?void 0:r?p(a,e):a,u=l.length-1,h;u>=0;u--)(h=l[u])&&(i=(r?h(a,e,i):h(i))||i);return r&&i&&d(a,e,i),i};var V={};y(V,{SkdxChatComposer:()=>s});module.exports=f(V);var t=require("lit"),o=require("lit/decorators.js"),m=require("../internal/define.cjs"),c=require("../internal/events.cjs"),g=require("../internal/slots.cjs"),S=require("@skdx/web-components/button"),_=require("@skdx/web-components/textarea");var k="data-skdx-chat-composer-generated",s=class extends t.LitElement{constructor(){super(...arguments);this.defaultValue="";this.label="Message";this.sendLabel="Send";this.submitKey="enter";this.maxRows=8;this.disabled=!1;this.pending=!1;this.handleValueChange=e=>{e.stopPropagation(),this.setValue(e.detail,"keyboard")};this.send=()=>{let e=this.currentValue;this.disabled||this.pending||e.trim().length===0||((0,c.emit)(this,"send",{value:e}),this.value===void 0&&this.setValue("","programmatic"))};this.handleKeyDown=e=>{this.submitKey==="none"||e.key!=="Enter"||e.isComposing||!(this.submitKey==="enter"?!e.shiftKey:e.metaKey||e.ctrlKey)||(e.preventDefault(),this.send())}}createRenderRoot(){return this}get currentValue(){return this.value??this.uncontrolledValue??this.defaultValue}get canSend(){return this.currentValue.trim().length>0}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this.requestUpdate())}hasSlotted(e){return this.querySelector(`[slot="${e}"]`)!==null}region(e){return this.querySelector(`.skdx-chat-composer__${e}`)}setValue(e,r){let i=this.currentValue;this.uncontrolledValue=e,this.requestUpdate(),(0,c.emit)(this,"value-change",{value:e,previousValue:i,reason:r})}updated(){this.pending?this.setAttribute("data-state","pending"):this.removeAttribute("data-state");let e=this.querySelector(".skdx-chat-composer__textarea");e&&(e.value=this.currentValue),(0,g.placeSlotted)(this,k,{attachments:this.region("attachments"),leading:this.region("leading"),trailing:this.region("trailing"),footer:this.region("footer"),"send-icon":this.region("send")},null)}render(){let e=this.currentValue,r=this.hasSlotted("send-icon");return t.html`
2
+ ${this.hasSlotted("attachments")?t.html`<div
3
+ class="skdx-chat-composer__attachments"
4
+ data-skdx-chat-composer-generated
5
+ ></div>`:t.nothing}
6
+ <div
7
+ class="skdx-chat-composer__field"
8
+ data-skdx-chat-composer-generated
9
+ >
10
+ ${this.hasSlotted("leading")?t.html`<div class="skdx-chat-composer__leading"></div>`:t.nothing}
11
+ <skdx-textarea
12
+ class="skdx-chat-composer__textarea"
13
+ aria-label=${this.label}
14
+ placeholder=${this.placeholder??t.nothing}
15
+ .value=${e}
16
+ auto-resize
17
+ min-rows="1"
18
+ max-rows=${this.maxRows}
19
+ maxlength=${this.maxLength??t.nothing}
20
+ ?disabled=${this.disabled}
21
+ @value-change=${this.handleValueChange}
22
+ @keydown=${this.handleKeyDown}
23
+ ></skdx-textarea>
24
+ ${this.hasSlotted("trailing")?t.html`<div class="skdx-chat-composer__trailing"></div>`:t.nothing}
25
+ <skdx-button
26
+ class="skdx-chat-composer__send"
27
+ type="button"
28
+ .variant=${"primary"}
29
+ .iconOnly=${r}
30
+ aria-label=${r?this.sendLabel:t.nothing}
31
+ ?loading=${this.pending}
32
+ ?disabled=${this.disabled||this.pending||!this.canSend}
33
+ @click=${this.send}
34
+ >${r?t.nothing:this.sendLabel}</skdx-button
35
+ >
36
+ </div>
37
+ ${this.hasSlotted("footer")?t.html`<div
38
+ class="skdx-chat-composer__footer"
39
+ data-skdx-chat-composer-generated
40
+ ></div>`:t.nothing}
41
+ `}};n([(0,o.property)({type:String})],s.prototype,"value",2),n([(0,o.property)({type:String,attribute:"default-value"})],s.prototype,"defaultValue",2),n([(0,o.property)({type:String})],s.prototype,"placeholder",2),n([(0,o.property)({type:String})],s.prototype,"label",2),n([(0,o.property)({type:String,attribute:"send-label"})],s.prototype,"sendLabel",2),n([(0,o.property)({type:String,attribute:"submit-key"})],s.prototype,"submitKey",2),n([(0,o.property)({type:Number,attribute:"max-rows"})],s.prototype,"maxRows",2),n([(0,o.property)({type:Number,attribute:"max-length"})],s.prototype,"maxLength",2),n([(0,o.property)({type:Boolean})],s.prototype,"disabled",2),n([(0,o.property)({type:Boolean})],s.prototype,"pending",2),s=n([(0,m.customElement)("skdx-chat-composer","chat-composer","root")],s);0&&(module.exports={SkdxChatComposer});
@@ -0,0 +1,125 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import '@skdx/web-components/button';
3
+ import '@skdx/web-components/textarea';
4
+ /** Which key combination sends the message from inside the textarea. */
5
+ export type SkdxChatComposerSubmitKey = 'enter' | 'mod-enter' | 'none';
6
+ /** What a `send` event carries: the composed message as it stood when the send was triggered. */
7
+ export interface SkdxChatComposerSendDetail {
8
+ /** The composed message text as it stood when the send was triggered. */
9
+ value: string;
10
+ }
11
+ /** What a `value-change` event carries: the new text, the text it replaced, and what drove the edit. */
12
+ export interface SkdxChatComposerValueChangeDetail {
13
+ /** The message text as it stands after the edit. */
14
+ value: string;
15
+ /** The text held immediately before, or `null` when nothing was. */
16
+ previousValue: string | null;
17
+ /** What drove the change: a key press, a pointer, or the application. */
18
+ reason: 'keyboard' | 'pointer' | 'programmatic';
19
+ }
20
+ /**
21
+ * Message composer block: an auto-growing Textarea and a send Button inside a
22
+ * field, with consumer-supplied attachment, leading, trailing and footer
23
+ * regions and configurable Enter-to-send behaviour.
24
+ *
25
+ * Renders light DOM, so its parts are classes rather than shadow `::part()`
26
+ * targets: `.skdx-chat-composer` on the host, then `__attachments`, `__field`,
27
+ * `__leading`, `__textarea`, `__trailing`, `__send` and `__footer`.
28
+ * `data-state` on the host reads `pending` while a send is in flight.
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <skdx-chat-composer
33
+ * id="composer"
34
+ * placeholder="Send a message…"
35
+ * ></skdx-chat-composer>
36
+ * <script>
37
+ * document
38
+ * .getElementById('composer')
39
+ * .addEventListener('send', (event) => post(event.detail.value));
40
+ * </script>
41
+ * ```
42
+ *
43
+ * @slot leading - Controls rendered inside the field before the textarea, such as an attach button.
44
+ * @slot trailing - Controls rendered inside the field after the textarea, such as a model picker.
45
+ * @slot attachments - Attached files or chips rendered in a row above the field.
46
+ * @slot footer - Usage counters or hints rendered in a row below the field.
47
+ * @slot send-icon - Glyph rendered inside the send button in place of its text, making it icon-only.
48
+ * @fires value-change - Fires with the new text on every edit, including the clear that follows an uncontrolled send.
49
+ * @fires send - Fires with the message text when the send button is activated or the configured submit key is pressed.
50
+ */
51
+ export declare class SkdxChatComposer extends LitElement {
52
+ /** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
53
+ createRenderRoot(): HTMLElement | DocumentFragment;
54
+ /**
55
+ * Current message text, for controlled usage paired with `value-change`.
56
+ * @default undefined — uncontrolled, seeded from `defaultValue`.
57
+ */
58
+ value?: string | undefined;
59
+ /**
60
+ * Initial message text for uncontrolled usage, read only on mount.
61
+ * @default ''
62
+ */
63
+ defaultValue: string;
64
+ /**
65
+ * Hint text shown in the empty textarea, rendered as the native placeholder.
66
+ * @default undefined — no placeholder text renders.
67
+ */
68
+ placeholder?: string | undefined;
69
+ /**
70
+ * Accessible name of the message textarea, read by assistive technology.
71
+ * @default 'Message'
72
+ */
73
+ label: string;
74
+ /**
75
+ * Text of the send button, and its accessible name when the `send-icon` slot is filled.
76
+ * @default 'Send'
77
+ */
78
+ sendLabel: string;
79
+ /**
80
+ * Which key sends from the textarea; the other Enter presses insert a newline.
81
+ * @default 'enter'
82
+ */
83
+ submitKey: SkdxChatComposerSubmitKey;
84
+ /**
85
+ * Caps how far the auto-growing textarea grows, in rows, before it scrolls.
86
+ * @default 8
87
+ */
88
+ maxRows: number;
89
+ /**
90
+ * Native `maxlength` of the textarea — the longest message it accepts.
91
+ * @default undefined — no upper bound on the message length.
92
+ */
93
+ maxLength?: number | undefined;
94
+ /**
95
+ * Disables the textarea and the send button, blocking every send path.
96
+ * @default false
97
+ */
98
+ disabled: boolean;
99
+ /**
100
+ * Marks a send in flight: the button is busy and inert, the textarea stays editable.
101
+ * @default false
102
+ */
103
+ pending: boolean;
104
+ /** What the textarea last held; outranked by `value` whenever the consumer controls it. */
105
+ private uncontrolledValue?;
106
+ /** The message text right now, controlled or not. */
107
+ private get currentValue();
108
+ /** Whether there is non-whitespace text to send. */
109
+ private get canSend();
110
+ connectedCallback(): void;
111
+ /** Whether the consumer supplied content for `name` — still true once it has been moved in. */
112
+ private hasSlotted;
113
+ private region;
114
+ private setValue;
115
+ private readonly handleValueChange;
116
+ private readonly send;
117
+ private readonly handleKeyDown;
118
+ protected updated(): void;
119
+ render(): TemplateResult;
120
+ }
121
+ declare global {
122
+ interface HTMLElementTagNameMap {
123
+ 'skdx-chat-composer': SkdxChatComposer;
124
+ }
125
+ }
@@ -0,0 +1,125 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import '@skdx/web-components/button';
3
+ import '@skdx/web-components/textarea';
4
+ /** Which key combination sends the message from inside the textarea. */
5
+ export type SkdxChatComposerSubmitKey = 'enter' | 'mod-enter' | 'none';
6
+ /** What a `send` event carries: the composed message as it stood when the send was triggered. */
7
+ export interface SkdxChatComposerSendDetail {
8
+ /** The composed message text as it stood when the send was triggered. */
9
+ value: string;
10
+ }
11
+ /** What a `value-change` event carries: the new text, the text it replaced, and what drove the edit. */
12
+ export interface SkdxChatComposerValueChangeDetail {
13
+ /** The message text as it stands after the edit. */
14
+ value: string;
15
+ /** The text held immediately before, or `null` when nothing was. */
16
+ previousValue: string | null;
17
+ /** What drove the change: a key press, a pointer, or the application. */
18
+ reason: 'keyboard' | 'pointer' | 'programmatic';
19
+ }
20
+ /**
21
+ * Message composer block: an auto-growing Textarea and a send Button inside a
22
+ * field, with consumer-supplied attachment, leading, trailing and footer
23
+ * regions and configurable Enter-to-send behaviour.
24
+ *
25
+ * Renders light DOM, so its parts are classes rather than shadow `::part()`
26
+ * targets: `.skdx-chat-composer` on the host, then `__attachments`, `__field`,
27
+ * `__leading`, `__textarea`, `__trailing`, `__send` and `__footer`.
28
+ * `data-state` on the host reads `pending` while a send is in flight.
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <skdx-chat-composer
33
+ * id="composer"
34
+ * placeholder="Send a message…"
35
+ * ></skdx-chat-composer>
36
+ * <script>
37
+ * document
38
+ * .getElementById('composer')
39
+ * .addEventListener('send', (event) => post(event.detail.value));
40
+ * </script>
41
+ * ```
42
+ *
43
+ * @slot leading - Controls rendered inside the field before the textarea, such as an attach button.
44
+ * @slot trailing - Controls rendered inside the field after the textarea, such as a model picker.
45
+ * @slot attachments - Attached files or chips rendered in a row above the field.
46
+ * @slot footer - Usage counters or hints rendered in a row below the field.
47
+ * @slot send-icon - Glyph rendered inside the send button in place of its text, making it icon-only.
48
+ * @fires value-change - Fires with the new text on every edit, including the clear that follows an uncontrolled send.
49
+ * @fires send - Fires with the message text when the send button is activated or the configured submit key is pressed.
50
+ */
51
+ export declare class SkdxChatComposer extends LitElement {
52
+ /** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
53
+ createRenderRoot(): HTMLElement | DocumentFragment;
54
+ /**
55
+ * Current message text, for controlled usage paired with `value-change`.
56
+ * @default undefined — uncontrolled, seeded from `defaultValue`.
57
+ */
58
+ value?: string | undefined;
59
+ /**
60
+ * Initial message text for uncontrolled usage, read only on mount.
61
+ * @default ''
62
+ */
63
+ defaultValue: string;
64
+ /**
65
+ * Hint text shown in the empty textarea, rendered as the native placeholder.
66
+ * @default undefined — no placeholder text renders.
67
+ */
68
+ placeholder?: string | undefined;
69
+ /**
70
+ * Accessible name of the message textarea, read by assistive technology.
71
+ * @default 'Message'
72
+ */
73
+ label: string;
74
+ /**
75
+ * Text of the send button, and its accessible name when the `send-icon` slot is filled.
76
+ * @default 'Send'
77
+ */
78
+ sendLabel: string;
79
+ /**
80
+ * Which key sends from the textarea; the other Enter presses insert a newline.
81
+ * @default 'enter'
82
+ */
83
+ submitKey: SkdxChatComposerSubmitKey;
84
+ /**
85
+ * Caps how far the auto-growing textarea grows, in rows, before it scrolls.
86
+ * @default 8
87
+ */
88
+ maxRows: number;
89
+ /**
90
+ * Native `maxlength` of the textarea — the longest message it accepts.
91
+ * @default undefined — no upper bound on the message length.
92
+ */
93
+ maxLength?: number | undefined;
94
+ /**
95
+ * Disables the textarea and the send button, blocking every send path.
96
+ * @default false
97
+ */
98
+ disabled: boolean;
99
+ /**
100
+ * Marks a send in flight: the button is busy and inert, the textarea stays editable.
101
+ * @default false
102
+ */
103
+ pending: boolean;
104
+ /** What the textarea last held; outranked by `value` whenever the consumer controls it. */
105
+ private uncontrolledValue?;
106
+ /** The message text right now, controlled or not. */
107
+ private get currentValue();
108
+ /** Whether there is non-whitespace text to send. */
109
+ private get canSend();
110
+ connectedCallback(): void;
111
+ /** Whether the consumer supplied content for `name` — still true once it has been moved in. */
112
+ private hasSlotted;
113
+ private region;
114
+ private setValue;
115
+ private readonly handleValueChange;
116
+ private readonly send;
117
+ private readonly handleKeyDown;
118
+ protected updated(): void;
119
+ render(): TemplateResult;
120
+ }
121
+ declare global {
122
+ interface HTMLElementTagNameMap {
123
+ 'skdx-chat-composer': SkdxChatComposer;
124
+ }
125
+ }
@@ -0,0 +1,41 @@
1
+ var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var a=(d,l,e,i)=>{for(var r=i>1?void 0:i?m(l,e):l,u=d.length-1,h;u>=0;u--)(h=d[u])&&(r=(i?h(l,e,r):h(r))||r);return i&&r&&p(l,e,r),r};import{html as o,LitElement as g,nothing as n}from"lit";import{property as s}from"lit/decorators.js";import{customElement as v}from"../internal/define.js";import{emit as c}from"../internal/events.js";import{placeSlotted as b}from"../internal/slots.js";import"@skdx/web-components/button";import"@skdx/web-components/textarea";var y="data-skdx-chat-composer-generated",t=class extends g{constructor(){super(...arguments);this.defaultValue="";this.label="Message";this.sendLabel="Send";this.submitKey="enter";this.maxRows=8;this.disabled=!1;this.pending=!1;this.handleValueChange=e=>{e.stopPropagation(),this.setValue(e.detail,"keyboard")};this.send=()=>{let e=this.currentValue;this.disabled||this.pending||e.trim().length===0||(c(this,"send",{value:e}),this.value===void 0&&this.setValue("","programmatic"))};this.handleKeyDown=e=>{this.submitKey==="none"||e.key!=="Enter"||e.isComposing||!(this.submitKey==="enter"?!e.shiftKey:e.metaKey||e.ctrlKey)||(e.preventDefault(),this.send())}}createRenderRoot(){return this}get currentValue(){return this.value??this.uncontrolledValue??this.defaultValue}get canSend(){return this.currentValue.trim().length>0}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this.requestUpdate())}hasSlotted(e){return this.querySelector(`[slot="${e}"]`)!==null}region(e){return this.querySelector(`.skdx-chat-composer__${e}`)}setValue(e,i){let r=this.currentValue;this.uncontrolledValue=e,this.requestUpdate(),c(this,"value-change",{value:e,previousValue:r,reason:i})}updated(){this.pending?this.setAttribute("data-state","pending"):this.removeAttribute("data-state");let e=this.querySelector(".skdx-chat-composer__textarea");e&&(e.value=this.currentValue),b(this,y,{attachments:this.region("attachments"),leading:this.region("leading"),trailing:this.region("trailing"),footer:this.region("footer"),"send-icon":this.region("send")},null)}render(){let e=this.currentValue,i=this.hasSlotted("send-icon");return o`
2
+ ${this.hasSlotted("attachments")?o`<div
3
+ class="skdx-chat-composer__attachments"
4
+ data-skdx-chat-composer-generated
5
+ ></div>`:n}
6
+ <div
7
+ class="skdx-chat-composer__field"
8
+ data-skdx-chat-composer-generated
9
+ >
10
+ ${this.hasSlotted("leading")?o`<div class="skdx-chat-composer__leading"></div>`:n}
11
+ <skdx-textarea
12
+ class="skdx-chat-composer__textarea"
13
+ aria-label=${this.label}
14
+ placeholder=${this.placeholder??n}
15
+ .value=${e}
16
+ auto-resize
17
+ min-rows="1"
18
+ max-rows=${this.maxRows}
19
+ maxlength=${this.maxLength??n}
20
+ ?disabled=${this.disabled}
21
+ @value-change=${this.handleValueChange}
22
+ @keydown=${this.handleKeyDown}
23
+ ></skdx-textarea>
24
+ ${this.hasSlotted("trailing")?o`<div class="skdx-chat-composer__trailing"></div>`:n}
25
+ <skdx-button
26
+ class="skdx-chat-composer__send"
27
+ type="button"
28
+ .variant=${"primary"}
29
+ .iconOnly=${i}
30
+ aria-label=${i?this.sendLabel:n}
31
+ ?loading=${this.pending}
32
+ ?disabled=${this.disabled||this.pending||!this.canSend}
33
+ @click=${this.send}
34
+ >${i?n:this.sendLabel}</skdx-button
35
+ >
36
+ </div>
37
+ ${this.hasSlotted("footer")?o`<div
38
+ class="skdx-chat-composer__footer"
39
+ data-skdx-chat-composer-generated
40
+ ></div>`:n}
41
+ `}};a([s({type:String})],t.prototype,"value",2),a([s({type:String,attribute:"default-value"})],t.prototype,"defaultValue",2),a([s({type:String})],t.prototype,"placeholder",2),a([s({type:String})],t.prototype,"label",2),a([s({type:String,attribute:"send-label"})],t.prototype,"sendLabel",2),a([s({type:String,attribute:"submit-key"})],t.prototype,"submitKey",2),a([s({type:Number,attribute:"max-rows"})],t.prototype,"maxRows",2),a([s({type:Number,attribute:"max-length"})],t.prototype,"maxLength",2),a([s({type:Boolean})],t.prototype,"disabled",2),a([s({type:Boolean})],t.prototype,"pending",2),t=a([v("skdx-chat-composer","chat-composer","root")],t);export{t as SkdxChatComposer};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var C in e)a(t,C,{get:e[C],enumerable:!0})},x=(t,e,C,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of S(e))!d.call(t,o)&&o!==C&&a(t,o,{get:()=>e[o],enumerable:!(p=r(e,o))||p.enumerable});return t};var k=t=>x(a({},"__esModule",{value:!0}),t);var s={};h(s,{SkdxChatComposer:()=>m.SkdxChatComposer});module.exports=k(s);var m=require("./ChatComposer.cjs");0&&(module.exports={SkdxChatComposer});
@@ -0,0 +1 @@
1
+ export { SkdxChatComposer, type SkdxChatComposerSendDetail, type SkdxChatComposerSubmitKey, type SkdxChatComposerValueChangeDetail, } from './ChatComposer.cjs';
@@ -0,0 +1 @@
1
+ export { SkdxChatComposer, type SkdxChatComposerSendDetail, type SkdxChatComposerSubmitKey, type SkdxChatComposerValueChangeDetail, } from './ChatComposer.js';
@@ -0,0 +1 @@
1
+ import{SkdxChatComposer as o}from"./ChatComposer.js";export{o as SkdxChatComposer};
@@ -0,0 +1,26 @@
1
+ "use strict";var h=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var f=(a,e)=>{for(var r in e)h(a,r,{get:e[r],enumerable:!0})},_=(a,e,r,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of p(e))!v.call(a,s)&&s!==r&&h(a,s,{get:()=>e[s],enumerable:!(d=c(e,s))||d.enumerable});return a};var b=a=>_(h({},"__esModule",{value:!0}),a),n=(a,e,r,d)=>{for(var s=d>1?void 0:d?c(e,r):e,u=a.length-1,m;u>=0;u--)(m=a[u])&&(s=(d?m(e,r,s):m(s))||s);return d&&s&&h(e,r,s),s};var k={};f(k,{SkdxChatMessage:()=>i});module.exports=b(k);var t=require("lit"),o=require("lit/decorators.js"),l=require("../internal/define.cjs"),g=require("../internal/slots.cjs"),y=require("@skdx/web-components/time");var $="data-skdx-chat-message-generated",i=class extends t.LitElement{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","article"),queueMicrotask(()=>this.requestUpdate())}region(e){return this.querySelector(`.skdx-chat-message__${e}`)}hasSlotted(e){return this.querySelector(`[slot="${e}"]`)!==null}updated(){this.setAttribute("data-sender",this.sender??""),this.status===void 0?this.removeAttribute("data-status"):this.setAttribute("data-status",this.status),this.status==="pending"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),(0,g.placeSlotted)(this,$,{avatar:this.region("avatar"),attachments:this.region("attachments"),footer:this.region("footer"),actions:this.region("actions")},this.region("content"))}render(){let e=this.author!==void 0||this.timestamp!==void 0||this.statusLabel!==void 0;return t.html`
2
+ ${this.hasSlotted("avatar")?t.html`<div
3
+ class="skdx-chat-message__avatar"
4
+ aria-hidden="true"
5
+ data-skdx-chat-message-generated
6
+ ></div>`:t.nothing}
7
+ <div
8
+ class="skdx-chat-message__main"
9
+ data-skdx-chat-message-generated
10
+ >
11
+ ${e?t.html`<div class="skdx-chat-message__header">
12
+ ${this.author===void 0?t.nothing:t.html`<span class="skdx-chat-message__author">${this.author}</span>`}
13
+ ${this.timestamp===void 0?t.nothing:t.html`<skdx-time
14
+ class="skdx-chat-message__time"
15
+ relative
16
+ .value=${this.timestamp}
17
+ .now=${this.now}
18
+ ></skdx-time>`}
19
+ ${this.statusLabel===void 0?t.nothing:t.html`<span class="skdx-chat-message__status">${this.statusLabel}</span>`}
20
+ </div>`:t.nothing}
21
+ <div class="skdx-chat-message__content"></div>
22
+ ${this.hasSlotted("attachments")?t.html`<div class="skdx-chat-message__attachments"></div>`:t.nothing}
23
+ ${this.hasSlotted("footer")?t.html`<div class="skdx-chat-message__footer"></div>`:t.nothing}
24
+ ${this.hasSlotted("actions")?t.html`<div class="skdx-chat-message__actions"></div>`:t.nothing}
25
+ </div>
26
+ `}};n([(0,o.property)({type:String})],i.prototype,"sender",2),n([(0,o.property)({type:String})],i.prototype,"author",2),n([(0,o.property)({type:String})],i.prototype,"timestamp",2),n([(0,o.property)({attribute:!1})],i.prototype,"now",2),n([(0,o.property)({type:String})],i.prototype,"status",2),n([(0,o.property)({type:String,attribute:"status-label"})],i.prototype,"statusLabel",2),i=n([(0,l.customElement)("skdx-chat-message","chat-message","root")],i);0&&(module.exports={SkdxChatMessage});
@@ -0,0 +1,74 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import '@skdx/web-components/time';
3
+ /**
4
+ * One message in a conversation — assistant, support agent, human or system —
5
+ * with an author, avatar, timestamp, delivery status, content, attachments,
6
+ * actions and a footer, composing Time; the block parses nothing.
7
+ *
8
+ * Renders light DOM, so its parts are classes rather than shadow `::part()`
9
+ * targets: `.skdx-chat-message` on the host, then `__avatar`, `__main`,
10
+ * `__header`, `__author`, `__time`, `__status`, `__content`, `__attachments`,
11
+ * `__footer` and `__actions`. `data-sender` and `data-status` sit on the host
12
+ * for the skin to read.
13
+ *
14
+ * @example
15
+ * ```html
16
+ * <skdx-chat-message
17
+ * sender="assistant"
18
+ * author="Assistant"
19
+ * timestamp="2026-08-10T09:00:00Z"
20
+ * >
21
+ * <skdx-avatar slot="avatar" name="Assistant"></skdx-avatar>
22
+ * Here is the summary you asked for.
23
+ * <skdx-button slot="actions">Copy</skdx-button>
24
+ * </skdx-chat-message>
25
+ * ```
26
+ *
27
+ * @slot - The message content: markdown output, code, citations or tool results.
28
+ * @slot avatar - Decorative avatar rendered beside the message, always `aria-hidden`.
29
+ * @slot attachments - Files, links or previews attached to the message, below the content.
30
+ * @slot actions - Controls such as copy, regenerate or react, below the footer.
31
+ * @slot footer - Citations, token counts or other metadata, below the content.
32
+ */
33
+ export declare class SkdxChatMessage extends LitElement {
34
+ /** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
35
+ createRenderRoot(): HTMLElement | DocumentFragment;
36
+ /** Who sent the message, written to `data-sender`; the skin aligns a user message to the end. */
37
+ sender: 'user' | 'assistant' | 'system' | (string & {});
38
+ /**
39
+ * Name of the person, model or system that sent the message, rendered as visible text.
40
+ * @default undefined — no author region renders.
41
+ */
42
+ author?: string | undefined;
43
+ /**
44
+ * Instant the message was sent, rendered through a composed Time.
45
+ * @default undefined — no time region renders.
46
+ */
47
+ timestamp?: Date | string | undefined;
48
+ /**
49
+ * Reference instant the timestamp's relative label renders against, forwarded to Time.
50
+ * @default undefined — read once at render, since this block starts no timer.
51
+ */
52
+ now?: Date | number | undefined;
53
+ /**
54
+ * Delivery state, written to `data-status`; `'pending'` also sets `aria-busy` on the host.
55
+ * @default undefined — no delivery state is written.
56
+ */
57
+ status?: 'pending' | 'sent' | 'error' | (string & {}) | undefined;
58
+ /**
59
+ * Visible text for the delivery state, in the app's own wording such as "Sending…".
60
+ * @default undefined — no status region renders.
61
+ */
62
+ statusLabel?: string | undefined;
63
+ connectedCallback(): void;
64
+ private region;
65
+ /** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
66
+ private hasSlotted;
67
+ protected updated(): void;
68
+ render(): TemplateResult;
69
+ }
70
+ declare global {
71
+ interface HTMLElementTagNameMap {
72
+ 'skdx-chat-message': SkdxChatMessage;
73
+ }
74
+ }
@@ -0,0 +1,74 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import '@skdx/web-components/time';
3
+ /**
4
+ * One message in a conversation — assistant, support agent, human or system —
5
+ * with an author, avatar, timestamp, delivery status, content, attachments,
6
+ * actions and a footer, composing Time; the block parses nothing.
7
+ *
8
+ * Renders light DOM, so its parts are classes rather than shadow `::part()`
9
+ * targets: `.skdx-chat-message` on the host, then `__avatar`, `__main`,
10
+ * `__header`, `__author`, `__time`, `__status`, `__content`, `__attachments`,
11
+ * `__footer` and `__actions`. `data-sender` and `data-status` sit on the host
12
+ * for the skin to read.
13
+ *
14
+ * @example
15
+ * ```html
16
+ * <skdx-chat-message
17
+ * sender="assistant"
18
+ * author="Assistant"
19
+ * timestamp="2026-08-10T09:00:00Z"
20
+ * >
21
+ * <skdx-avatar slot="avatar" name="Assistant"></skdx-avatar>
22
+ * Here is the summary you asked for.
23
+ * <skdx-button slot="actions">Copy</skdx-button>
24
+ * </skdx-chat-message>
25
+ * ```
26
+ *
27
+ * @slot - The message content: markdown output, code, citations or tool results.
28
+ * @slot avatar - Decorative avatar rendered beside the message, always `aria-hidden`.
29
+ * @slot attachments - Files, links or previews attached to the message, below the content.
30
+ * @slot actions - Controls such as copy, regenerate or react, below the footer.
31
+ * @slot footer - Citations, token counts or other metadata, below the content.
32
+ */
33
+ export declare class SkdxChatMessage extends LitElement {
34
+ /** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
35
+ createRenderRoot(): HTMLElement | DocumentFragment;
36
+ /** Who sent the message, written to `data-sender`; the skin aligns a user message to the end. */
37
+ sender: 'user' | 'assistant' | 'system' | (string & {});
38
+ /**
39
+ * Name of the person, model or system that sent the message, rendered as visible text.
40
+ * @default undefined — no author region renders.
41
+ */
42
+ author?: string | undefined;
43
+ /**
44
+ * Instant the message was sent, rendered through a composed Time.
45
+ * @default undefined — no time region renders.
46
+ */
47
+ timestamp?: Date | string | undefined;
48
+ /**
49
+ * Reference instant the timestamp's relative label renders against, forwarded to Time.
50
+ * @default undefined — read once at render, since this block starts no timer.
51
+ */
52
+ now?: Date | number | undefined;
53
+ /**
54
+ * Delivery state, written to `data-status`; `'pending'` also sets `aria-busy` on the host.
55
+ * @default undefined — no delivery state is written.
56
+ */
57
+ status?: 'pending' | 'sent' | 'error' | (string & {}) | undefined;
58
+ /**
59
+ * Visible text for the delivery state, in the app's own wording such as "Sending…".
60
+ * @default undefined — no status region renders.
61
+ */
62
+ statusLabel?: string | undefined;
63
+ connectedCallback(): void;
64
+ private region;
65
+ /** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
66
+ private hasSlotted;
67
+ protected updated(): void;
68
+ render(): TemplateResult;
69
+ }
70
+ declare global {
71
+ interface HTMLElementTagNameMap {
72
+ 'skdx-chat-message': SkdxChatMessage;
73
+ }
74
+ }
@@ -0,0 +1,26 @@
1
+ var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var a=(o,t,h,d)=>{for(var r=d>1?void 0:d?l(t,h):t,u=o.length-1,m;u>=0;u--)(m=o[u])&&(r=(d?m(t,h,r):m(r))||r);return d&&r&&c(t,h,r),r};import{html as s,LitElement as g,nothing as i}from"lit";import{property as n}from"lit/decorators.js";import{customElement as p}from"../internal/define.js";import{placeSlotted as v}from"../internal/slots.js";import"@skdx/web-components/time";var f="data-skdx-chat-message-generated",e=class extends g{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","article"),queueMicrotask(()=>this.requestUpdate())}region(t){return this.querySelector(`.skdx-chat-message__${t}`)}hasSlotted(t){return this.querySelector(`[slot="${t}"]`)!==null}updated(){this.setAttribute("data-sender",this.sender??""),this.status===void 0?this.removeAttribute("data-status"):this.setAttribute("data-status",this.status),this.status==="pending"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),v(this,f,{avatar:this.region("avatar"),attachments:this.region("attachments"),footer:this.region("footer"),actions:this.region("actions")},this.region("content"))}render(){let t=this.author!==void 0||this.timestamp!==void 0||this.statusLabel!==void 0;return s`
2
+ ${this.hasSlotted("avatar")?s`<div
3
+ class="skdx-chat-message__avatar"
4
+ aria-hidden="true"
5
+ data-skdx-chat-message-generated
6
+ ></div>`:i}
7
+ <div
8
+ class="skdx-chat-message__main"
9
+ data-skdx-chat-message-generated
10
+ >
11
+ ${t?s`<div class="skdx-chat-message__header">
12
+ ${this.author===void 0?i:s`<span class="skdx-chat-message__author">${this.author}</span>`}
13
+ ${this.timestamp===void 0?i:s`<skdx-time
14
+ class="skdx-chat-message__time"
15
+ relative
16
+ .value=${this.timestamp}
17
+ .now=${this.now}
18
+ ></skdx-time>`}
19
+ ${this.statusLabel===void 0?i:s`<span class="skdx-chat-message__status">${this.statusLabel}</span>`}
20
+ </div>`:i}
21
+ <div class="skdx-chat-message__content"></div>
22
+ ${this.hasSlotted("attachments")?s`<div class="skdx-chat-message__attachments"></div>`:i}
23
+ ${this.hasSlotted("footer")?s`<div class="skdx-chat-message__footer"></div>`:i}
24
+ ${this.hasSlotted("actions")?s`<div class="skdx-chat-message__actions"></div>`:i}
25
+ </div>
26
+ `}};a([n({type:String})],e.prototype,"sender",2),a([n({type:String})],e.prototype,"author",2),a([n({type:String})],e.prototype,"timestamp",2),a([n({attribute:!1})],e.prototype,"now",2),a([n({type:String})],e.prototype,"status",2),a([n({type:String,attribute:"status-label"})],e.prototype,"statusLabel",2),e=a([p("skdx-chat-message","chat-message","root")],e);export{e as SkdxChatMessage};
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(a,e)=>{for(var r in e)s(a,r,{get:e[r],enumerable:!0})},k=(a,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!g.call(a,o)&&o!==r&&s(a,o,{get:()=>e[o],enumerable:!(t=d(e,o))||t.enumerable});return a};var m=a=>k(s({},"__esModule",{value:!0}),a);var p={};h(p,{SkdxChatMessage:()=>x.SkdxChatMessage});module.exports=m(p);var x=require("./ChatMessage.cjs");0&&(module.exports={SkdxChatMessage});
@@ -0,0 +1 @@
1
+ export { SkdxChatMessage } from './ChatMessage.cjs';
@@ -0,0 +1 @@
1
+ export { SkdxChatMessage } from './ChatMessage.js';
@@ -0,0 +1 @@
1
+ import{SkdxChatMessage as o}from"./ChatMessage.js";export{o as SkdxChatMessage};
@@ -0,0 +1,26 @@
1
+ "use strict";var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var g=(i,e)=>{for(var s in e)m(i,s,{get:e[s],enumerable:!0})},k=(i,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!_.call(i,a)&&a!==s&&m(i,a,{get:()=>e[a],enumerable:!(r=h(e,a))||r.enumerable});return i};var x=i=>k(m({},"__esModule",{value:!0}),i),d=(i,e,s,r)=>{for(var a=r>1?void 0:r?h(e,s):e,c=i.length-1,l;c>=0;c--)(l=i[c])&&(a=(r?l(e,s,a):l(a))||a);return r&&a&&m(e,s,a),a};var b={};g(b,{SkdxComment:()=>n});module.exports=x(b);var t=require("lit"),o=require("lit/decorators.js"),p=require("../internal/define.cjs"),u=require("../internal/slots.cjs"),E=require("@skdx/web-components/time");var $="data-skdx-comment-generated",n=class extends t.LitElement{constructor(){super(...arguments);this.edited=!1;this.editedLabel="Edited"}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","article"),queueMicrotask(()=>this.requestUpdate())}region(s){return this.querySelector(`.skdx-comment__${s}`)}hasSlotted(s){return this.querySelector(`[slot="${s}"]`)!==null}updated(){(0,u.placeSlotted)(this,$,{avatar:this.region("avatar"),metadata:this.region("metadata"),attachments:this.region("attachments"),actions:this.region("actions")},this.region("content"))}render(){return t.html`
2
+ ${this.hasSlotted("avatar")?t.html`<div
3
+ class="skdx-comment__avatar"
4
+ aria-hidden="true"
5
+ data-skdx-comment-generated
6
+ ></div>`:t.nothing}
7
+ <div
8
+ class="skdx-comment__main"
9
+ data-skdx-comment-generated
10
+ >
11
+ <div class="skdx-comment__header">
12
+ <span class="skdx-comment__author">${this.author??""}</span>
13
+ ${this.hasSlotted("metadata")?t.html`<span class="skdx-comment__metadata"></span>`:t.nothing}
14
+ ${this.timestamp===void 0?t.nothing:t.html`<skdx-time
15
+ class="skdx-comment__time"
16
+ relative
17
+ .value=${this.timestamp}
18
+ .now=${this.now}
19
+ ></skdx-time>`}
20
+ ${this.edited?t.html`<span class="skdx-comment__edited">${this.editedLabel}</span>`:t.nothing}
21
+ </div>
22
+ <div class="skdx-comment__content"></div>
23
+ ${this.hasSlotted("attachments")?t.html`<div class="skdx-comment__attachments"></div>`:t.nothing}
24
+ ${this.hasSlotted("actions")?t.html`<div class="skdx-comment__actions"></div>`:t.nothing}
25
+ </div>
26
+ `}};d([(0,o.property)({type:String})],n.prototype,"author",2),d([(0,o.property)({type:String})],n.prototype,"timestamp",2),d([(0,o.property)({attribute:!1})],n.prototype,"now",2),d([(0,o.property)({type:Boolean})],n.prototype,"edited",2),d([(0,o.property)({type:String,attribute:"edited-label"})],n.prototype,"editedLabel",2),n=d([(0,p.customElement)("skdx-comment","comment","root")],n);0&&(module.exports={SkdxComment});