@salla.sa/ui-ai-kit-core 1.1.0 → 2.0.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 (147) hide show
  1. package/dist/cjs/ai-card.cjs.entry.js +2 -2
  2. package/dist/cjs/ai-chat-container.cjs.entry.js +84 -57
  3. package/dist/cjs/ai-chat-header.cjs.entry.js +29 -19
  4. package/dist/cjs/ai-chat-message.cjs.entry.js +1456 -21
  5. package/dist/cjs/ai-conversation-list.cjs.entry.js +80 -0
  6. package/dist/cjs/ai-conversation-summary.cjs.entry.js +33 -0
  7. package/dist/cjs/ai-icon.cjs.entry.js +2 -2
  8. package/dist/cjs/ai-link.cjs.entry.js +4 -4
  9. package/dist/cjs/ai-loading.cjs.entry.js +35 -22
  10. package/dist/cjs/ai-message-input.cjs.entry.js +48 -15
  11. package/dist/cjs/ai-rating.cjs.entry.js +2 -2
  12. package/dist/cjs/ai-route-decision.cjs.entry.js +48 -0
  13. package/dist/cjs/ai-suggestion.cjs.entry.js +4 -4
  14. package/dist/cjs/ai-voice-input.cjs.entry.js +75 -21
  15. package/dist/cjs/{icon-registry-dmfLA-Dj.js → icon-registry-BKb9-2Nt.js} +24 -0
  16. package/dist/cjs/{index-DLJcLHFH.js → index-BkNg07SW.js} +1 -1
  17. package/dist/cjs/loader.cjs.js +2 -2
  18. package/dist/cjs/ui-ai-kit.cjs.js +2 -2
  19. package/dist/collection/collection-manifest.json +3 -0
  20. package/dist/collection/components/ai-card/ai-card.css +5 -8
  21. package/dist/collection/components/ai-chat-container/ai-chat-container.css +17 -14
  22. package/dist/collection/components/ai-chat-container/ai-chat-container.js +125 -53
  23. package/dist/collection/components/ai-chat-header/ai-chat-header.css +50 -17
  24. package/dist/collection/components/ai-chat-header/ai-chat-header.js +53 -18
  25. package/dist/collection/components/ai-chat-message/ai-chat-message.css +47 -38
  26. package/dist/collection/components/ai-chat-message/ai-chat-message.js +68 -18
  27. package/dist/collection/components/ai-conversation-list/ai-conversation-list.css +196 -0
  28. package/dist/collection/components/ai-conversation-list/ai-conversation-list.js +176 -0
  29. package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.css +103 -0
  30. package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.js +118 -0
  31. package/dist/collection/components/ai-icon/ai-icon.js +1 -1
  32. package/dist/collection/components/ai-link/ai-link.css +3 -7
  33. package/dist/collection/components/ai-link/ai-link.js +1 -1
  34. package/dist/collection/components/ai-loading/ai-loading.css +149 -20
  35. package/dist/collection/components/ai-loading/ai-loading.js +100 -23
  36. package/dist/collection/components/ai-message-input/ai-message-input.css +41 -37
  37. package/dist/collection/components/ai-message-input/ai-message-input.js +100 -19
  38. package/dist/collection/components/ai-rating/ai-rating.css +8 -14
  39. package/dist/collection/components/ai-route-decision/ai-route-decision.css +132 -0
  40. package/dist/collection/components/ai-route-decision/ai-route-decision.js +195 -0
  41. package/dist/collection/components/ai-suggestion/ai-suggestion.css +5 -11
  42. package/dist/collection/components/ai-suggestion/ai-suggestion.js +2 -2
  43. package/dist/collection/components/ai-voice-input/ai-voice-input.css +27 -22
  44. package/dist/collection/components/ai-voice-input/ai-voice-input.js +116 -20
  45. package/dist/collection/utils/icon-registry.js +24 -0
  46. package/dist/components/ai-card.js +1 -1
  47. package/dist/components/ai-chat-container.js +1 -1
  48. package/dist/components/ai-chat-header.js +1 -1
  49. package/dist/components/ai-chat-message.js +2 -1
  50. package/dist/components/ai-conversation-list.d.ts +11 -0
  51. package/dist/components/ai-conversation-list.js +1 -0
  52. package/dist/components/ai-conversation-summary.d.ts +11 -0
  53. package/dist/components/ai-conversation-summary.js +1 -0
  54. package/dist/components/ai-icon.js +1 -1
  55. package/dist/components/ai-link.js +1 -1
  56. package/dist/components/ai-loading.js +1 -1
  57. package/dist/components/ai-message-input.js +1 -1
  58. package/dist/components/ai-rating.js +1 -1
  59. package/dist/components/ai-route-decision.d.ts +11 -0
  60. package/dist/components/ai-route-decision.js +1 -0
  61. package/dist/components/ai-suggestion.js +1 -1
  62. package/dist/components/ai-voice-input.js +1 -1
  63. package/dist/components/index.js +1 -1
  64. package/dist/components/p-CX1Yp79q.js +1 -0
  65. package/dist/components/p-DnO4dikr.js +1 -0
  66. package/dist/components/{p-CY6emva2.js → p-Dr2tAPV7.js} +1 -1
  67. package/dist/{ui-ai-kit/p-DYv5ef4M.js → components/p-SJZ6Ujn9.js} +1 -1
  68. package/dist/esm/ai-card.entry.js +2 -2
  69. package/dist/esm/ai-chat-container.entry.js +84 -57
  70. package/dist/esm/ai-chat-header.entry.js +29 -19
  71. package/dist/esm/ai-chat-message.entry.js +1456 -21
  72. package/dist/esm/ai-conversation-list.entry.js +78 -0
  73. package/dist/esm/ai-conversation-summary.entry.js +31 -0
  74. package/dist/esm/ai-icon.entry.js +2 -2
  75. package/dist/esm/ai-link.entry.js +4 -4
  76. package/dist/esm/ai-loading.entry.js +35 -22
  77. package/dist/esm/ai-message-input.entry.js +48 -15
  78. package/dist/esm/ai-rating.entry.js +2 -2
  79. package/dist/esm/ai-route-decision.entry.js +46 -0
  80. package/dist/esm/ai-suggestion.entry.js +4 -4
  81. package/dist/esm/ai-voice-input.entry.js +75 -21
  82. package/dist/esm/{icon-registry-DYv5ef4M.js → icon-registry-SJZ6Ujn9.js} +24 -0
  83. package/dist/esm/{index-7hrZ8FOQ.js → index-B0yIzgh4.js} +1 -1
  84. package/dist/esm/loader.js +3 -3
  85. package/dist/esm/ui-ai-kit.js +3 -3
  86. package/dist/types/components/ai-chat-container/ai-chat-container.d.ts +11 -1
  87. package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +7 -2
  88. package/dist/types/components/ai-conversation-list/ai-conversation-list.d.ts +24 -0
  89. package/dist/types/components/ai-conversation-summary/ai-conversation-summary.d.ts +12 -0
  90. package/dist/types/components/ai-loading/ai-loading.d.ts +12 -6
  91. package/dist/types/components/ai-message-input/ai-message-input.d.ts +17 -3
  92. package/dist/types/components/ai-route-decision/ai-route-decision.d.ts +21 -0
  93. package/dist/types/components/ai-voice-input/ai-voice-input.d.ts +7 -0
  94. package/dist/types/components.d.ts +335 -11
  95. package/dist/types/index.d.ts +2 -0
  96. package/dist/types/utils/icon-registry.d.ts +1 -1
  97. package/dist/ui-ai-kit/p-2955439f.entry.js +1 -0
  98. package/dist/ui-ai-kit/p-5c9e9822.entry.js +1 -0
  99. package/dist/ui-ai-kit/p-5caf1c38.entry.js +1 -0
  100. package/dist/ui-ai-kit/p-74c5c83f.entry.js +1 -0
  101. package/dist/ui-ai-kit/p-76195745.entry.js +1 -0
  102. package/dist/ui-ai-kit/p-79c78d8e.entry.js +1 -0
  103. package/dist/ui-ai-kit/p-87e9739b.entry.js +1 -0
  104. package/dist/ui-ai-kit/p-9c4c6c01.entry.js +1 -0
  105. package/dist/ui-ai-kit/p-B0yIzgh4.js +2 -0
  106. package/dist/{components/p-DYv5ef4M.js → ui-ai-kit/p-SJZ6Ujn9.js} +1 -1
  107. package/dist/ui-ai-kit/p-a099fcfb.entry.js +1 -0
  108. package/dist/ui-ai-kit/p-b28af13a.entry.js +1 -0
  109. package/dist/ui-ai-kit/p-d1bb1ad0.entry.js +1 -0
  110. package/dist/ui-ai-kit/p-eb0c7e7a.entry.js +1 -0
  111. package/dist/ui-ai-kit/{p-455daa17.entry.js → p-eec6f083.entry.js} +1 -1
  112. package/dist/ui-ai-kit/p-ef07638f.entry.js +2 -0
  113. package/dist/ui-ai-kit/ui-ai-kit.css +1 -1
  114. package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -1
  115. package/package.json +5 -13
  116. package/dist/collection/components/ai-card/ai-card.stories.js +0 -52
  117. package/dist/collection/components/ai-chat-container/ai-chat-container.stories.js +0 -160
  118. package/dist/collection/components/ai-chat-header/ai-chat-header.stories.js +0 -138
  119. package/dist/collection/components/ai-chat-message/ai-chat-message.stories.js +0 -164
  120. package/dist/collection/components/ai-link/ai-link.stories.js +0 -79
  121. package/dist/collection/components/ai-loading/ai-loading.stories.js +0 -145
  122. package/dist/collection/components/ai-message-input/ai-message-input.stories.js +0 -125
  123. package/dist/collection/components/ai-rating/ai-rating.stories.js +0 -78
  124. package/dist/collection/components/ai-suggestion/ai-suggestion.stories.js +0 -62
  125. package/dist/collection/components/ai-voice-input/ai-voice-input.stories.js +0 -118
  126. package/dist/components/p-CWjXxYJI.js +0 -1
  127. package/dist/types/components/ai-card/ai-card.stories.d.ts +0 -7
  128. package/dist/types/components/ai-chat-container/ai-chat-container.stories.d.ts +0 -7
  129. package/dist/types/components/ai-chat-header/ai-chat-header.stories.d.ts +0 -8
  130. package/dist/types/components/ai-chat-message/ai-chat-message.stories.d.ts +0 -10
  131. package/dist/types/components/ai-link/ai-link.stories.d.ts +0 -8
  132. package/dist/types/components/ai-loading/ai-loading.stories.d.ts +0 -10
  133. package/dist/types/components/ai-message-input/ai-message-input.stories.d.ts +0 -13
  134. package/dist/types/components/ai-rating/ai-rating.stories.d.ts +0 -8
  135. package/dist/types/components/ai-suggestion/ai-suggestion.stories.d.ts +0 -8
  136. package/dist/types/components/ai-voice-input/ai-voice-input.stories.d.ts +0 -9
  137. package/dist/ui-ai-kit/p-11facfad.entry.js +0 -1
  138. package/dist/ui-ai-kit/p-128a2ed4.entry.js +0 -1
  139. package/dist/ui-ai-kit/p-227bdb8f.entry.js +0 -1
  140. package/dist/ui-ai-kit/p-56163e8c.entry.js +0 -1
  141. package/dist/ui-ai-kit/p-6d21d0fd.entry.js +0 -1
  142. package/dist/ui-ai-kit/p-6ddcd77b.entry.js +0 -1
  143. package/dist/ui-ai-kit/p-7hrZ8FOQ.js +0 -2
  144. package/dist/ui-ai-kit/p-8e90143e.entry.js +0 -1
  145. package/dist/ui-ai-kit/p-9938c277.entry.js +0 -1
  146. package/dist/ui-ai-kit/p-dc5b4a7f.entry.js +0 -1
  147. package/dist/ui-ai-kit/p-fb1702de.entry.js +0 -1
@@ -1,145 +0,0 @@
1
- import { html } from "lit";
2
- const meta = {
3
- title: 'Chat/Loading',
4
- component: 'ai-loading',
5
- tags: ['autodocs'],
6
- argTypes: {
7
- mode: {
8
- control: { type: 'select' },
9
- options: ['thinking', 'steps'],
10
- description: 'Main mode switch',
11
- },
12
- statusText: {
13
- control: 'text',
14
- description: 'Thinking mode status text',
15
- },
16
- steps: {
17
- control: 'text',
18
- description: 'Steps as JSON string array',
19
- },
20
- headerTitle: {
21
- control: 'text',
22
- description: 'Steps card title',
23
- },
24
- expanded: {
25
- control: 'boolean',
26
- description: 'Steps card expand state',
27
- },
28
- collapsible: {
29
- control: 'boolean',
30
- description: 'Allow collapsing the steps card',
31
- },
32
- },
33
- };
34
- export default meta;
35
- const stepsInProgress = JSON.stringify([
36
- { id: '1', title: 'البحث عن المعلومات المطلوبة', status: 'completed' },
37
- { id: '2', title: 'تحليل البيانات وإعداد التقرير', status: 'executing' },
38
- { id: '3', title: 'مراجعة النتائج والتحقق منها', status: 'pending' },
39
- { id: '4', title: 'إرسال التقرير النهائي', status: 'pending' },
40
- ]);
41
- const stepsAllCompleted = JSON.stringify([
42
- { id: '1', title: 'البحث عن المعلومات المطلوبة', status: 'completed' },
43
- { id: '2', title: 'تحليل البيانات وإعداد التقرير', status: 'completed' },
44
- { id: '3', title: 'مراجعة النتائج والتحقق منها', status: 'completed' },
45
- ]);
46
- export const Thinking = {
47
- render: args => html `
48
- <ai-loading
49
- mode="${args.mode}"
50
- status-text="${args.statusText}"
51
- ></ai-loading>
52
- `,
53
- args: {
54
- mode: 'thinking',
55
- statusText: 'جاري التفكير...',
56
- },
57
- };
58
- export const ThinkingCustomText = {
59
- render: args => html `
60
- <ai-loading
61
- mode="${args.mode}"
62
- status-text="${args.statusText}"
63
- ></ai-loading>
64
- `,
65
- args: {
66
- mode: 'thinking',
67
- statusText: 'جاري معالجة طلبك...',
68
- },
69
- };
70
- export const StepsInProgress = {
71
- render: args => html `
72
- <div style="min-width: 360px;">
73
- <ai-loading
74
- mode="${args.mode}"
75
- .steps="${args.steps}"
76
- ?expanded="${args.expanded}"
77
- ?collapsible="${args.collapsible}"
78
- @toggleExpand="${(e) => console.log('expand:', e.detail)}"
79
- @stepClick="${(e) => console.log('step:', e.detail)}"
80
- ></ai-loading>
81
- </div>
82
- `,
83
- args: {
84
- mode: 'steps',
85
- steps: stepsInProgress,
86
- expanded: true,
87
- collapsible: true,
88
- },
89
- };
90
- export const StepsAllCompleted = {
91
- render: args => html `
92
- <div style="min-width: 360px;">
93
- <ai-loading
94
- mode="${args.mode}"
95
- .steps="${args.steps}"
96
- ?expanded="${args.expanded}"
97
- ?collapsible="${args.collapsible}"
98
- ></ai-loading>
99
- </div>
100
- `,
101
- args: {
102
- mode: 'steps',
103
- steps: stepsAllCompleted,
104
- expanded: true,
105
- collapsible: true,
106
- },
107
- };
108
- export const StepsCollapsed = {
109
- render: args => html `
110
- <div style="min-width: 360px;">
111
- <ai-loading
112
- mode="${args.mode}"
113
- .steps="${args.steps}"
114
- ?expanded="${args.expanded}"
115
- ?collapsible="${args.collapsible}"
116
- ></ai-loading>
117
- </div>
118
- `,
119
- args: {
120
- mode: 'steps',
121
- steps: stepsInProgress,
122
- expanded: false,
123
- collapsible: true,
124
- },
125
- };
126
- export const StepsCustomTitle = {
127
- render: args => html `
128
- <div style="min-width: 360px;">
129
- <ai-loading
130
- mode="${args.mode}"
131
- .steps="${args.steps}"
132
- header-title="${args.headerTitle}"
133
- ?expanded="${args.expanded}"
134
- ?collapsible="${args.collapsible}"
135
- ></ai-loading>
136
- </div>
137
- `,
138
- args: {
139
- mode: 'steps',
140
- steps: stepsInProgress,
141
- headerTitle: 'خطوات المهمة',
142
- expanded: true,
143
- collapsible: true,
144
- },
145
- };
@@ -1,125 +0,0 @@
1
- import { html } from "lit";
2
- const meta = {
3
- title: 'Chat/Message Input',
4
- component: 'ai-message-input',
5
- tags: ['autodocs'],
6
- argTypes: {
7
- placeholder: {
8
- control: 'text',
9
- description: 'Placeholder text for the textarea',
10
- },
11
- disabled: {
12
- control: 'boolean',
13
- description: 'Whether the input is disabled',
14
- },
15
- showVoiceButton: {
16
- control: 'boolean',
17
- description: 'Show the mic button — emits voiceButtonClick when pressed so the caller can render ai-voice-input',
18
- },
19
- },
20
- parameters: {
21
- docs: {
22
- description: {
23
- component: `
24
- A pill-shaped chat input component.
25
-
26
- ## Events
27
- - \`sendMessage\` — emitted with the trimmed message string when the user sends
28
- - \`voiceButtonClick\` — emitted when the mic button is pressed; the caller is responsible for showing \`ai-voice-input\`
29
-
30
- ## Methods
31
- - \`setInputValue(text: string)\` — populates the textarea programmatically (e.g. after speech-to-text transcription)
32
- `,
33
- },
34
- },
35
- },
36
- };
37
- export default meta;
38
- export const Default = {
39
- render: args => html `
40
- <ai-message-input
41
- placeholder=${args.placeholder || 'ايش في بالك؟'}
42
- ?disabled=${args.disabled}
43
- ?show-voice-button=${args.showVoiceButton !== false}
44
- @sendMessage=${(e) => console.log('sendMessage:', e.detail)}
45
- @voiceButtonClick=${() => console.log('voiceButtonClick')}
46
- ></ai-message-input>
47
- `,
48
- args: {
49
- placeholder: 'ايش في بالك؟',
50
- disabled: false,
51
- showVoiceButton: true,
52
- },
53
- };
54
- export const Disabled = {
55
- render: () => html `<ai-message-input placeholder="ايش في بالك؟" disabled></ai-message-input>`,
56
- };
57
- /**
58
- * Demonstrates the full voice toggle pattern:
59
- * clicking the mic button hides the message input and shows ai-voice-input.
60
- * After recording (or cancel) the voice input is hidden and message input is restored.
61
- * When audio is recorded, setInputValue() pre-fills the textarea for review.
62
- */
63
- export const WithVoiceToggle = {
64
- render: () => html `
65
- <div id="voice-toggle-demo" style="max-width: 600px;">
66
- <ai-message-input
67
- id="msg-input"
68
- placeholder="اكتب رسالة أو اضغط على الميكروفون"
69
- @sendMessage=${(e) => {
70
- const log = document.getElementById('toggle-log');
71
- if (log)
72
- log.innerHTML += `<div style="color:#10b981;">✓ Message sent: "${e.detail}"</div>`;
73
- }}
74
- @voiceButtonClick=${() => {
75
- const msg = document.getElementById('msg-input');
76
- const voice = document.getElementById('voice-recorder');
77
- if (msg)
78
- msg.style.display = 'none';
79
- if (voice) {
80
- voice.style.display = 'block';
81
- voice.autoStart = true;
82
- }
83
- }}
84
- ></ai-message-input>
85
-
86
- <ai-voice-input
87
- id="voice-recorder"
88
- auto-start
89
- style="display:none;"
90
- @audioRecorded=${(e) => {
91
- const msg = document.getElementById('msg-input');
92
- const voice = document.getElementById('voice-recorder');
93
- if (voice)
94
- voice.style.display = 'none';
95
- if (msg) {
96
- msg.style.display = 'block';
97
- // In a real app: send e.detail.blob to Whisper, then call setInputValue()
98
- msg.setInputValue(`[Audio ${e.detail.duration}s — paste transcription here]`);
99
- }
100
- const log = document.getElementById('toggle-log');
101
- if (log)
102
- log.innerHTML += `<div style="color:#8b5cf6;">🎤 Audio recorded (${e.detail.duration}s, ${(e.detail.blob.size / 1024).toFixed(1)} KB)</div>`;
103
- }}
104
- @recordingCancel=${() => {
105
- const msg = document.getElementById('msg-input');
106
- const voice = document.getElementById('voice-recorder');
107
- if (voice)
108
- voice.style.display = 'none';
109
- if (msg)
110
- msg.style.display = 'block';
111
- const log = document.getElementById('toggle-log');
112
- if (log)
113
- log.innerHTML += `<div style="color:#737373;">✕ Recording cancelled</div>`;
114
- }}
115
- ></ai-voice-input>
116
-
117
- <div
118
- id="toggle-log"
119
- style="margin-top:1rem;padding:1rem;background:#f5f5f5;border-radius:8px;font-family:monospace;font-size:13px;min-height:80px;max-height:200px;overflow-y:auto;"
120
- >
121
- <div style="color:#666;font-weight:bold;margin-bottom:4px;">Event log:</div>
122
- </div>
123
- </div>
124
- `,
125
- };
@@ -1,78 +0,0 @@
1
- import { html } from "lit";
2
- const meta = {
3
- title: 'UI/Rating',
4
- component: 'ai-rating',
5
- tags: ['autodocs'],
6
- argTypes: {
7
- question: { control: 'text' },
8
- subtitle: { control: 'text' },
9
- value: {
10
- control: { type: 'select' },
11
- options: [null, 1, 2, 3, 4, 5],
12
- },
13
- disabled: { control: 'boolean' },
14
- },
15
- };
16
- export default meta;
17
- const wrapStyle = 'padding: 24px; background: #f3f4f6; direction: rtl; max-width: 420px;';
18
- /* ─── Standalone ─────────────────────────────────────────────────────────── */
19
- export const Standalone = {
20
- render: args => html `
21
- <div style="${wrapStyle}">
22
- <ai-rating
23
- question="${args.question}"
24
- subtitle="${args.subtitle}"
25
- value="${args.value}"
26
- ?disabled="${args.disabled}"
27
- ></ai-rating>
28
- </div>
29
- `,
30
- args: {
31
- question: 'كيف كانت تجربتك؟',
32
- subtitle: 'رأيك يساعدنا نحسن الخدمة',
33
- value: null,
34
- disabled: false,
35
- },
36
- };
37
- /* ─── Inside Card (matches Figma node 1532-65078) ───────────────────────── */
38
- export const InsideCard = {
39
- render: () => html `
40
- <div style="${wrapStyle}">
41
- <ai-card>
42
- <ai-rating
43
- question="كيف كانت تجربتك؟"
44
- subtitle="رأيك يساعدنا نحسن الخدمة"
45
- ></ai-rating>
46
- </ai-card>
47
- </div>
48
- `,
49
- };
50
- /* ─── With Pre-selected Value ────────────────────────────────────────────── */
51
- export const PreSelected = {
52
- render: () => html `
53
- <div style="${wrapStyle}">
54
- <ai-card>
55
- <ai-rating
56
- question="كيف كانت تجربتك؟"
57
- subtitle="رأيك يساعدنا نحسن الخدمة"
58
- value="5"
59
- ></ai-rating>
60
- </ai-card>
61
- </div>
62
- `,
63
- };
64
- /* ─── Disabled ───────────────────────────────────────────────────────────── */
65
- export const Disabled = {
66
- render: () => html `
67
- <div style="${wrapStyle}">
68
- <ai-card>
69
- <ai-rating
70
- question="كيف كانت تجربتك؟"
71
- subtitle="تم إرسال تقييمك"
72
- value="4"
73
- disabled
74
- ></ai-rating>
75
- </ai-card>
76
- </div>
77
- `,
78
- };
@@ -1,62 +0,0 @@
1
- import { html } from "lit";
2
- const meta = {
3
- title: 'UI/Suggestion',
4
- component: 'ai-suggestion',
5
- tags: ['autodocs'],
6
- argTypes: {
7
- label: { control: 'text' },
8
- disabled: { control: 'boolean' },
9
- },
10
- };
11
- export default meta;
12
- const wrapStyle = 'padding: 24px; background: #f3f4f6; direction: rtl; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start;';
13
- /* ─── Playground ─────────────────────────────────────────────────────────── */
14
- export const Playground = {
15
- render: args => html `
16
- <div style="${wrapStyle}">
17
- <ai-suggestion
18
- label="${args.label}"
19
- ?disabled="${args.disabled}"
20
- ></ai-suggestion>
21
- </div>
22
- `,
23
- args: {
24
- label: 'وش الفرق بين باقة بلس وبرو',
25
- disabled: false,
26
- },
27
- };
28
- /* ─── Multiple suggestions (typical usage in chat) ──────────────────────── */
29
- export const SuggestionGroup = {
30
- render: () => html `
31
- <div style="${wrapStyle}">
32
- <ai-suggestion label="وش الفرق بين باقة بلس وبرو"></ai-suggestion>
33
- <ai-suggestion label="كيف أضيف منتج جديد؟"></ai-suggestion>
34
- <ai-suggestion label="أظهر لي العملاء اللي ما اشتروا هذا الشهر"></ai-suggestion>
35
- <ai-suggestion label="ما هي أفضل وقت لإرسال حملة تسويقية؟"></ai-suggestion>
36
- </div>
37
- `,
38
- };
39
- /* ─── Disabled ───────────────────────────────────────────────────────────── */
40
- export const Disabled = {
41
- render: () => html `
42
- <div style="${wrapStyle}">
43
- <ai-suggestion label="وش الفرق بين باقة بلس وبرو" disabled></ai-suggestion>
44
- <ai-suggestion label="كيف أضيف منتج جديد؟" disabled></ai-suggestion>
45
- </div>
46
- `,
47
- };
48
- /* ─── Inside chat (realistic usage) ─────────────────────────────────────── */
49
- export const InChatContext = {
50
- render: () => html `
51
- <div style="padding: 24px; background: #f3f4f6; direction: rtl; max-width: 480px; display: flex; flex-direction: column; gap: 16px;">
52
- <ai-card>
53
- <p style="margin:0; font-size:14px; font-weight:500; color:#333;">أهلاً! كيف يمكنني مساعدتك اليوم؟</p>
54
- </ai-card>
55
- <div style="display: flex; gap: 8px; flex-wrap: wrap;">
56
- <ai-suggestion label="وش الفرق بين باقة بلس وبرو"></ai-suggestion>
57
- <ai-suggestion label="أظهر لي أفضل المنتجات مبيعاً"></ai-suggestion>
58
- <ai-suggestion label="كيف أحسن معدل التحويل؟"></ai-suggestion>
59
- </div>
60
- </div>
61
- `,
62
- };
@@ -1,118 +0,0 @@
1
- import { html } from "lit";
2
- const meta = {
3
- title: 'Chat/Voice Input',
4
- component: 'ai-voice-input',
5
- tags: ['autodocs'],
6
- argTypes: {
7
- disabled: {
8
- control: 'boolean',
9
- description: 'Whether the component is disabled',
10
- },
11
- showWaveform: {
12
- control: 'boolean',
13
- description: 'Show the waveform visualization while recording',
14
- },
15
- autoStart: {
16
- control: 'boolean',
17
- description: 'Start recording immediately on mount',
18
- },
19
- },
20
- parameters: {
21
- docs: {
22
- description: {
23
- component: `
24
- A standalone voice recorder designed to visually replace \`ai-message-input\` while the user records.
25
- It shares the same pill shape, glow, colors, and sizing as the message input.
26
-
27
- ## Events
28
- - \`audioRecorded\` — emitted with \`{ blob: Blob, duration: number }\` when the user submits the recording
29
- - \`recordingCancel\` — emitted when the user cancels
30
-
31
- ## Props
32
- - \`autoStart\` — start recording immediately on mount (use this when swapping in from the message input)
33
- - \`showWaveform\` — toggle the frequency bar visualization
34
- - \`disabled\` — disable the start button
35
-
36
- ## Typical usage with \`ai-message-input\`
37
- \`\`\`html
38
- <ai-message-input id="msg" @voiceButtonClick=\${showVoice}></ai-message-input>
39
- <ai-voice-input id="voice" auto-start style="display:none"
40
- @audioRecorded=\${onAudio} @recordingCancel=\${hideVoice}></ai-voice-input>
41
- \`\`\`
42
- `,
43
- },
44
- },
45
- },
46
- };
47
- export default meta;
48
- export const Default = {
49
- render: args => html `
50
- <ai-voice-input
51
- ?disabled=${args.disabled}
52
- ?show-waveform=${args.showWaveform !== false}
53
- ?auto-start=${args.autoStart}
54
- @audioRecorded=${(e) => console.log('audioRecorded:', e.detail)}
55
- @recordingCancel=${() => console.log('recordingCancel')}
56
- ></ai-voice-input>
57
- `,
58
- args: {
59
- disabled: false,
60
- showWaveform: true,
61
- autoStart: false,
62
- },
63
- };
64
- export const AutoStart = {
65
- name: 'Auto Start',
66
- render: () => html `
67
- <ai-voice-input
68
- auto-start
69
- @audioRecorded=${(e) => console.log('audioRecorded:', e.detail)}
70
- @recordingCancel=${() => console.log('recordingCancel')}
71
- ></ai-voice-input>
72
- `,
73
- parameters: {
74
- docs: {
75
- description: { story: 'Starts recording immediately on mount — the typical mode when toggled from `ai-message-input`.' },
76
- },
77
- },
78
- };
79
- export const WithoutWaveform = {
80
- name: 'Without Waveform',
81
- render: () => html `
82
- <ai-voice-input
83
- auto-start
84
- ?show-waveform=${false}
85
- @audioRecorded=${(e) => console.log('audioRecorded:', e.detail)}
86
- @recordingCancel=${() => console.log('recordingCancel')}
87
- ></ai-voice-input>
88
- `,
89
- };
90
- export const Disabled = {
91
- render: () => html `<ai-voice-input disabled></ai-voice-input>`,
92
- };
93
- export const WithEventHandlers = {
94
- name: 'With Event Handlers',
95
- render: () => html `
96
- <div style="max-width:600px;">
97
- <ai-voice-input
98
- auto-start
99
- @audioRecorded=${(e) => {
100
- const log = document.getElementById('voice-log');
101
- if (log)
102
- log.innerHTML += `<div style="color:#8b5cf6;">🎤 Audio recorded — ${e.detail.duration}s / ${(e.detail.blob.size / 1024).toFixed(1)} KB</div>`;
103
- }}
104
- @recordingCancel=${() => {
105
- const log = document.getElementById('voice-log');
106
- if (log)
107
- log.innerHTML += `<div style="color:#737373;">✕ Cancelled</div>`;
108
- }}
109
- ></ai-voice-input>
110
- <div
111
- id="voice-log"
112
- style="margin-top:1rem;padding:1rem;background:#f5f5f5;border-radius:8px;font-family:monospace;font-size:13px;min-height:80px;max-height:200px;overflow-y:auto;"
113
- >
114
- <div style="color:#666;font-weight:bold;margin-bottom:4px;">Event log:</div>
115
- </div>
116
- </div>
117
- `,
118
- };
@@ -1 +0,0 @@
1
- const e='@import url("https://cdn.salla.network/fonts/pingarlt.css");:root{--ai-font-family:"PingARLT", sans-serif;font-family:var(--ai-font-family);--ai-bg-card:hsl(var(--white));--ai-bg-surface:hsl(var(--gray-300));--ai-bg-input:hsl(var(--white));--ai-text-primary:hsl(var(--dark));--ai-text-secondary:hsl(var(--dark-100));--ai-text-muted:hsl(var(--gray));--ai-border-default:hsl(var(--gray-400));--ai-border-light:hsl(var(--gray-300));--ai-accent:hsl(var(--secondary));--ai-accent-dark:hsl(var(--primary));--ai-accent-text:hsl(var(--dark));--ai-user-bubble-bg:hsl(var(--gray-300));--ai-agent-bubble-bg:hsl(var(--white));--ai-warning-bg:hsl(var(--warning-100));--ai-warning-border:hsl(var(--warning));--ai-success:hsl(var(--success));--ai-success-text:hsl(var(--success));--ai-success-bg:hsl(var(--success-100));--ai-danger-text:hsl(var(--danger));--ai-danger-bg:hsl(var(--danger-100));--ai-danger-border:hsl(var(--danger-200));--ai-accent-bg:hsl(var(--secondary-100));--ai-focus-ring:hsl(var(--info));--ai-amber:hsl(var(--warning));--ai-scrollbar-thumb:rgba(0, 0, 0, 0.15);--ai-glow-gradient:linear-gradient(90deg, hsl(var(--dark-100)) 0%, hsl(var(--gray)) 50%, hsl(var(--dark-100)) 100%);--ai-input-glow:linear-gradient(to right, hsl(var(--secondary-400)), hsl(var(--secondary-100)) 10%, hsl(var(--secondary)))}.dark{--ai-bg-card:hsl(var(--gray-100));--ai-bg-surface:hsl(var(--white-300));--ai-bg-input:hsl(var(--gray-100));--ai-text-primary:hsl(var(--dark));--ai-text-secondary:hsl(var(--dark-200));--ai-text-muted:hsl(var(--gray));--ai-border-default:hsl(var(--gray-400));--ai-border-light:hsl(var(--gray-300));--ai-accent:hsl(var(--secondary));--ai-accent-dark:hsl(var(--primary-500));--ai-accent-text:hsl(var(--primary-force));--ai-user-bubble-bg:hsl(var(--gray-400));--ai-agent-bubble-bg:hsl(var(--gray-100));--ai-warning-bg:hsl(var(--warning-100));--ai-warning-border:hsl(var(--warning));--ai-success:hsl(var(--success));--ai-success-text:hsl(var(--success));--ai-success-bg:hsl(var(--success-100));--ai-danger-text:hsl(var(--danger));--ai-danger-bg:hsl(var(--danger-100));--ai-danger-border:hsl(var(--danger-200));--ai-accent-bg:hsl(var(--secondary-100));--ai-focus-ring:hsl(var(--info));--ai-amber:hsl(var(--warning));--ai-scrollbar-thumb:rgba(255, 255, 255, 0.2);--ai-glow-gradient:linear-gradient(90deg, hsl(var(--gray)) 0%, hsl(var(--dark-300)) 50%, hsl(var(--gray)) 100%);--ai-input-glow:linear-gradient(to right, hsl(var(--secondary-400)), hsl(var(--secondary-100)) 10%, hsl(var(--secondary)))}';function t(e,t,n){const r="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;e&&e!==r;){const r=Object.getOwnPropertyDescriptor(e,t);if(r&&(!n||r.get))return r;e=Object.getPrototypeOf(e)}}var n,r=(e,n)=>{var r;Object.entries(null!=(r=n.l.t)?r:{}).map((([r,[s]])=>{if(31&s||32&s){const s=e[r],l=t(Object.getPrototypeOf(e),r,!0)||Object.getOwnPropertyDescriptor(e,r);l&&Object.defineProperty(e,r,{get(){return l.get.call(this)},set(e){l.set.call(this,e)},configurable:!0,enumerable:!0}),n.i.has(r)?e[r]=n.i.get(r):void 0!==s&&(e[r]=s)}}))},s=e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},l=(e,t)=>t in e,a=(e,t)=>(0,console.error)(e,t),i=new Map,o="undefined"!=typeof window?window:{},c=o.HTMLElement||class{},u={o:0,u:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},f=(()=>{try{return!!o.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(e){}return!1})(),h=!!f&&(()=>!!o.document&&Object.getOwnPropertyDescriptor(o.document.adoptedStyleSheets,"length").writable)(),d=!1,g=[],v=[],b=(e,t)=>n=>{e.push(n),d||(d=!0,t&&4&u.o?m(p):u.raf(p))},y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){a(e)}e.length=0},p=()=>{y(g),y(v),(d=g.length>0)&&u.raf(p)},m=e=>Promise.resolve(undefined).then(e),w=b(v,!0),$=e=>{const t=new URL(e,u.u);return t.origin!==o.location.origin?t.href:t.pathname},j=e=>u.u=e;function O(){var t;const r=this.attachShadow({mode:"open"});if(void 0===n&&(n=null!=(t=function(e){if(!f)return;const t=new CSSStyleSheet;return t.replaceSync(e),t}(e))?t:null),n)h?r.adoptedStyleSheets.push(n):r.adoptedStyleSheets=[...r.adoptedStyleSheets,n];else if(!f){const t=document.createElement("style");t.innerHTML=e,r.prepend(t)}}var S,k=new WeakMap,x=e=>"sc-"+e.h,M=e=>"object"==(e=typeof e)||"function"===e,E=(e,t,...n)=>{let r=null,s=null,l=!1,a=!1;const i=[],o=t=>{for(let n=0;n<t.length;n++)r=t[n],Array.isArray(r)?o(r):null!=r&&"boolean"!=typeof r&&((l="function"!=typeof e&&!M(r))&&(r=String(r)),l&&a?i[i.length-1].v+=r:i.push(l?A(null,r):r),a=l)};if(o(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const c=A(e,null);return c.p=t,i.length>0&&(c.m=i),c.$=s,c},A=(e,t)=>({o:0,j:e,v:null!=t?t:null,O:null,m:null,p:null,$:null}),C={},L=(e,t)=>null==e||M(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?"string"==typeof e?parseFloat(e):"number"==typeof e?e:NaN:1&t?String(e):e,N=(e,t)=>{const n=e;return{emit:e=>P(n,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},P=(e,t,n)=>{const r=u.ce(t,n);return e.dispatchEvent(r),r},R=(e,t,n,r,a,i)=>{if(n===r)return;let c=l(e,t),f=t.toLowerCase();if("class"===t){const t=e.classList,s=D(n);let l=D(r);t.remove(...s.filter((e=>e&&!l.includes(e)))),t.add(...l.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if("key"===t);else if("ref"===t)r&&K(r,e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){if("a"===t[0]&&t.startsWith("attr:")){const n=t.slice(5);let l;{const t=s(e);if(t&&t.l&&t.l.t){const e=t.l.t[n];e&&e[1]&&(l=e[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==r||!1===r?!1===r&&""!==e.getAttribute(l)||e.removeAttribute(l):e.setAttribute(l,!0===r?"":r))}if("p"===t[0]&&t.startsWith("prop:")){const n=t.slice(5);try{e[n]=r}catch(e){}return}{const s=M(r);if((c||s&&null!==r)&&!a)try{if(e.tagName.includes("-"))e[t]!==r&&(e[t]=r);else{const s=null==r?"":r;"list"===t?c=!1:null!=n&&e[t]===s||("function"==typeof e.__lookupSetter__(t)?e[t]=s:e.setAttribute(t,s))}}catch(e){}null==r||!1===r?!1===r&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||a)&&!s&&1===e.nodeType&&e.setAttribute(t,r=!0===r?"":r)}}else if(t="-"===t[2]?t.slice(3):l(o,f)?f.slice(2):f[2]+t.slice(3),n||r){const s=t.endsWith(H);t=t.replace(U,""),n&&u.rel(e,t,n,s),r&&u.ael(e,t,r,s)}},_=/\s/,D=e=>("object"==typeof e&&e&&"baseVal"in e&&(e=e.baseVal),e&&"string"==typeof e?e.split(_):[]),H="Capture",U=new RegExp(H+"$"),W=(e,t,n)=>{const r=11===t.O.nodeType&&t.O.host?t.O.host:t.O,s=e&&e.p||{},l=t.p||{};for(const e of F(Object.keys(s)))e in l||R(r,e,s[e],void 0,n,t.o);for(const e of F(Object.keys(l)))R(r,e,s[e],l[e],n,t.o)};function F(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var T=!1,V=!1,q=[],z=[],Y=(e,t,n)=>{const r=t.m[n];let s,l,a=0;if(null!=r.v)s=r.O=o.document.createTextNode(r.v);else{if(V||(V="svg"===r.j),!o.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=r.O=o.document.createElementNS(V?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",r.j),V&&"foreignObject"===r.j&&(V=!1),W(null,r,V),r.m){const t="template"===r.j?s.content:s;for(a=0;a<r.m.length;++a)l=Y(e,r,a),l&&t.appendChild(l)}"svg"===r.j?V=!1:"foreignObject"===s.tagName&&(V=!0)}return s["s-hn"]=S,s},Z=(e,t,n,r,s,l)=>{let a,i=e;for(i.shadowRoot&&i.tagName===S&&(i=i.shadowRoot),"template"===n.j&&(i=i.content);s<=l;++s)r[s]&&(a=Y(null,n,s),a&&(r[s].O=a,Q(i,a,t)))},B=(e,t,n)=>{for(let r=t;r<=n;++r){const t=e[r];if(t){const e=t.O;J(t),e&&e.remove()}}},G=(e,t,n=!1)=>e.j===t.j&&(n?(n&&!e.$&&t.$&&(e.$=t.$),!0):e.$===t.$),I=(e,t,n=!1)=>{const r=t.O=e.O,s=e.m,l=t.m,a=t.j,i=t.v;null==i?(V="svg"===a||"foreignObject"!==a&&V,"slot"!==a||T||e.S!==t.S&&(t.O["s-sn"]=t.S||"",(e=>{u.o|=1;const t=e.closest(S.toLowerCase());if(null!=t){const n=Array.from(t.__childNodes||t.childNodes).find((e=>e["s-cr"])),r=Array.from(e.__childNodes||e.childNodes);for(const e of n?r.reverse():r)null!=e["s-sh"]&&(Q(t,e,null!=n?n:null),e["s-sh"]=void 0)}u.o&=-2})(t.O.parentElement)),W(e,t,V),null!==s&&null!==l?((e,t,n,r,s=!1)=>{let l,a,i=0,o=0,c=0,u=0,f=t.length-1,h=t[0],d=t[f],g=r.length-1,v=r[0],b=r[g];const y="template"===n.j?e.content:e;for(;i<=f&&o<=g;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==v)v=r[++o];else if(null==b)b=r[--g];else if(G(h,v,s))I(h,v,s),h=t[++i],v=r[++o];else if(G(d,b,s))I(d,b,s),d=t[--f],b=r[--g];else if(G(h,b,s))I(h,b,s),Q(y,h.O,d.O.nextSibling),h=t[++i],b=r[--g];else if(G(d,v,s))I(d,v,s),Q(y,d.O,h.O),d=t[--f],v=r[++o];else{for(c=-1,u=i;u<=f;++u)if(t[u]&&null!==t[u].$&&t[u].$===v.$){c=u;break}c>=0?(a=t[c],a.j!==v.j?l=Y(t&&t[o],n,c):(I(a,v,s),t[c]=void 0,l=a.O),v=r[++o]):(l=Y(t&&t[o],n,o),v=r[++o]),l&&Q(h.O.parentNode,l,h.O)}i>f?Z(e,null==r[g+1]?null:r[g+1].O,n,r,o,g):o>g&&B(t,i,f)})(r,s,t,l,n):null!==l?(null!==e.v&&(r.textContent=""),Z(r,null,t,l,0,l.length-1)):!n&&null!==s&&B(s,0,s.length-1),V&&"svg"===a&&(V=!1)):e.v!==i&&(r.data=i)},J=e=>{e.p&&e.p.ref&&q.push((()=>e.p.ref(null))),e.m&&e.m.map(J)},K=(e,t)=>{z.push((()=>e(t)))},Q=(e,t,n)=>e.__insertBefore?e.__insertBefore(t,n):null==e?void 0:e.insertBefore(t,n),X=(e,t,n=!1)=>{const r=e.$hostElement$,s=e.l,l=e.k||A(null,null);var a;const i=(a=t)&&a.j===C?t:E(null,null,t);if(S=r.tagName,n&&i.p)for(const e of Object.keys(i.p))r.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(i.p[e]=r[e]);i.j=null,i.o|=4,e.k=i,i.O=l.O=r.shadowRoot||r,T=!(!(1&s.o)||128&s.o),I(l,i,n),q.forEach((e=>e())),q.length=0,z.forEach((e=>e())),z.length=0},ee=(e,t)=>{if(t&&!e.M&&t["s-p"]){const n=t["s-p"].push(new Promise((r=>e.M=()=>{t["s-p"].splice(n-1,1),r()})))}},te=(e,t)=>{if(e.o|=16,4&e.o)return void(e.o|=512);ee(e,e.A);const n=()=>ne(e,t);if(!t)return w(n);queueMicrotask((()=>{n()}))},ne=(e,t)=>{const n=e.$hostElement$,r=n;if(!r)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return s=ce(r,t?"componentWillLoad":"componentWillUpdate",void 0,n),s=re(s,(()=>ce(r,"componentWillRender",void 0,n))),re(s,(()=>le(e,r,t)))},re=(e,t)=>se(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),se=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,le=async(e,t,n)=>{var r;const s=e.$hostElement$,l=s["s-rc"];n&&(e=>{const t=e.l,n=e.$hostElement$,r=t.o,s=((e,t)=>{var n,r,s;const l=x(t),a=i.get(l);if(!o.document)return l;if(e=11===e.nodeType?e:o.document,a)if("string"==typeof a){let s,i=k.get(e=e.head||e);if(i||k.set(e,i=new Set),!i.has(l)){s=o.document.createElement("style"),s.textContent=a;const c=null!=(n=u.C)?n:function(){var e,t,n;return null!=(n=null==(t=null==(e=o.document.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:t.getAttribute("content"))?n:void 0}();if(null!=c&&s.setAttribute("nonce",c),!(1&t.o))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(s,(null==n?void 0:n.parentNode)===e?n:null)}else if("host"in e)if(f){const t=new(null!=(r=e.defaultView)?r:e.ownerDocument.defaultView).CSSStyleSheet;t.replaceSync(a),h?e.adoptedStyleSheets.unshift(t):e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.textContent=a+t.textContent:e.prepend(s)}else e.append(s);1&t.o&&e.insertBefore(s,null),4&t.o&&(s.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(l)}}else{let t=k.get(e);if(t||k.set(e,t=new Set),!t.has(l)){const n=null!=(s=e.defaultView)?s:e.ownerDocument.defaultView;let r;if(a.constructor===n.CSSStyleSheet)r=a;else{r=new n.CSSStyleSheet;for(let e=0;e<a.cssRules.length;e++)r.insertRule(a.cssRules[e].cssText,e)}h?e.adoptedStyleSheets.push(r):e.adoptedStyleSheets=[...e.adoptedStyleSheets,r],t.add(l)}}return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);ae(e,t,s,n),l&&(l.map((e=>e())),s["s-rc"]=void 0);{const t=null!=(r=s["s-p"])?r:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n).catch(n),e.o|=4,t.length=0)}},ae=(e,t,n,r)=>{try{t=t.render(),e.o&=-17,e.o|=2,X(e,t,r)}catch(t){a(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=t,r=e.A;ce(n,"componentDidRender",void 0,t),64&e.o?ce(n,"componentDidUpdate",void 0,t):(e.o|=64,ue(t),ce(n,"componentDidLoad",void 0,t),e.L(t),r||oe()),e.M&&(e.M(),e.M=void 0),512&e.o&&m((()=>te(e,!1))),e.o&=-517},oe=()=>{m((()=>P(o,"appload",{detail:{namespace:"ui-ai-kit"}})))},ce=(e,t,n,r)=>{if(e&&e[t])try{return e[t](n)}catch(e){a(e,r)}},ue=e=>e.classList.add("hydrated"),fe=(e,t,n,r)=>{const l=s(e);if(!l)return;const i=e,o=l.i.get(t),c=l.o,u=i;n=L(n,r.t[t][0]);const f=Number.isNaN(o)&&Number.isNaN(n);if(n!==o&&!f){if(l.i.set(t,n),r.N){const e=r.N[t];e&&e.map((e=>{try{const[[r,s]]=Object.entries(e);(128&c||1&s)&&(u?u[r](n,o,t):l.P.push((()=>{l.R[r](n,o,t)})))}catch(e){a(e,i)}}))}if(2&c){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,o,t)&&!(16&c))return;16&c||te(l,!1)}}},he=(e,n)=>{var r,l;const a=e.prototype;{e.watchers&&!n.N&&(n.N=e.watchers),e.deserializers&&!n._&&(n._=e.deserializers),e.serializers&&!n.D&&(n.D=e.serializers);const i=Object.entries(null!=(r=n.t)?r:{});i.map((([e,[r]])=>{if(31&r||32&r){const{get:l,set:i}=t(a,e)||{};l&&(n.t[e][0]|=2048),i&&(n.t[e][0]|=4096),Object.defineProperty(a,e,{get(){return l?l.apply(this):(t=e,s(this).i.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(a,e,{set(t){const l=s(this);if(l){if(i)return void 0===(32&r?this[e]:l.$hostElement$[e])&&l.i.get(e)&&(t=l.i.get(e)),i.apply(this,[L(t,r)]),void fe(this,e,t=32&r?this[e]:l.$hostElement$[e],n);fe(this,e,t,n)}}})}}));{const t=new Map;a.attributeChangedCallback=function(e,r,l){u.jmp((()=>{var o;const c=t.get(e),u=s(this);if(this.hasOwnProperty(c),a.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==l)return;if(null==c){const t=null==u?void 0:u.o;if(u&&t&&!(8&t)&&l!==r){const s=this,a=null==(o=n.N)?void 0:o[e];null==a||a.forEach((n=>{const[[a,i]]=Object.entries(n);null!=s[a]&&(128&t||1&i)&&s[a].call(s,l,r,e)}))}return}const f=i.find((([e])=>e===c));f&&4&f[1][0]&&(l=null!==l&&"false"!==l);const h=Object.getOwnPropertyDescriptor(a,c);l==this[c]||h.get&&!h.set||(this[c]=l)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(l=n.N)?l:{}),...i.filter((([e,t])=>31&t[0])).map((([e,n])=>{const r=n[1]||e;return t.set(r,e),r}))]))}}return e},de=(e,t)=>{const n={o:t[0],h:t[1]};try{n.t=t[2],n.N=e.N,n._=e._,n.D=e.D;const l=e.prototype.connectedCallback,o=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__hasHostListenerAttached:!1,__registerHost(){((e,t)=>{const n={o:0,$hostElement$:e,l:t,i:new Map,H:new Map};n.U=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[];const s=n;e.__stencil__getHostRef=()=>s,512&t.o&&r(e,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!s(this))return;this.__hasHostListenerAttached=!0}(e=>{if(!(1&u.o)){const t=s(e);if(!t)return;const n=t.l,r=()=>{};if(1&t.o)(null==t?void 0:t.R)||(null==t?void 0:t.U)&&t.U.then((()=>{}));else{t.o|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.A=n);break}}n.t&&Object.entries(n.t).map((([t,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let r;try{if(!(32&t.o)&&(t.o|=32,r=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128)),r&&r.style)){let e;"string"==typeof r.style&&(e=r.style);const t=x(n);if(!i.has(t)){const r=()=>{};((e,t,n)=>{let r=i.get(e);f&&n?(r=r||new CSSStyleSheet,"string"==typeof r?r=t:r.replaceSync(t)):r=t,i.set(e,r)})(t,e,!!(1&n.o)),r()}}const s=t.A,l=()=>te(t,!0);s&&s["s-rc"]?s["s-rc"].push(l):l()}catch(n){a(n,e),t.M&&(t.M(),t.M=void 0),t.L&&t.L(e)}})(e,t,n)}r()}})(this),l&&l.call(this)},disconnectedCallback(){(async e=>{1&u.o||s(e),k.has(e)&&k.delete(e),e.shadowRoot&&k.has(e.shadowRoot)&&k.delete(e.shadowRoot)})(this),o&&o.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${n.h}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,n)}}),Object.defineProperty(e,"is",{value:n.h,configurable:!0}),he(e,n)}catch(t){return a(t),e}},ge=e=>u.C=e,ve=e=>Object.assign(u,e);function be(e,t){X({l:{o:0,h:t.tagName},$hostElement$:t},e)}function ye(e){return e}export{c as H,ge as a,ve as b,C as c,N as d,$ as g,E as h,de as p,be as r,j as s,ye as t}
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const AiReply: Story;
6
- export declare const WithRating: Story;
7
- export declare const NoPadding: Story;
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const StickyRight: Story;
6
- export declare const FloatMode: Story;
7
- export declare const ShowcaseConversation: Story;
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const AgentMode: Story;
6
- export declare const HumanMode: Story;
7
- export declare const HumanWithoutBack: Story;
8
- export declare const InChatContainer: Story;
@@ -1,10 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const UserMessage: Story;
6
- export declare const AgentMessageSimple: Story;
7
- export declare const AgentMessageMarkdown: Story;
8
- export declare const FeedbackSelected: Story;
9
- export declare const WithSlottedContent: Story;
10
- export declare const ConversationThread: Story;
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const Playground: Story;
6
- export declare const MultipleLinks: Story;
7
- export declare const InsideCard: Story;
8
- export declare const FullMessageContext: Story;
@@ -1,10 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const Thinking: Story;
6
- export declare const ThinkingCustomText: Story;
7
- export declare const StepsInProgress: Story;
8
- export declare const StepsAllCompleted: Story;
9
- export declare const StepsCollapsed: Story;
10
- export declare const StepsCustomTitle: Story;
@@ -1,13 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const Default: Story;
6
- export declare const Disabled: Story;
7
- /**
8
- * Demonstrates the full voice toggle pattern:
9
- * clicking the mic button hides the message input and shows ai-voice-input.
10
- * After recording (or cancel) the voice input is hidden and message input is restored.
11
- * When audio is recorded, setInputValue() pre-fills the textarea for review.
12
- */
13
- export declare const WithVoiceToggle: Story;
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const Standalone: Story;
6
- export declare const InsideCard: Story;
7
- export declare const PreSelected: Story;
8
- export declare const Disabled: Story;
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- declare const meta: Meta;
3
- export default meta;
4
- type Story = StoryObj;
5
- export declare const Playground: Story;
6
- export declare const SuggestionGroup: Story;
7
- export declare const Disabled: Story;
8
- export declare const InChatContext: Story;