@memori.ai/memori-react 7.21.1 → 7.23.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.
- package/CHANGELOG.md +56 -0
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.css +33 -23
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js +85 -8
- package/dist/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
- package/dist/components/KnownFacts/KnownFacts.js +1 -1
- package/dist/components/KnownFacts/KnownFacts.js.map +1 -1
- package/dist/components/StartPanel/StartPanel.css +29 -0
- package/dist/components/StartPanel/StartPanel.js +2 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/Typing/Typing.js +49 -47
- package/dist/components/Typing/Typing.js.map +1 -1
- package/dist/components/UploadButton/UploadButton.d.ts +1 -0
- package/dist/components/UploadButton/UploadButton.js +142 -3
- package/dist/components/UploadButton/UploadButton.js.map +1 -1
- package/dist/components/icons/Alert.d.ts +5 -0
- package/dist/components/icons/Alert.js +6 -0
- package/dist/components/icons/Alert.js.map +1 -0
- package/dist/components/icons/Info.d.ts +5 -0
- package/dist/components/icons/Info.js +6 -0
- package/dist/components/icons/Info.js.map +1 -0
- package/dist/components/icons/Warning.js +1 -1
- package/dist/components/icons/Warning.js.map +1 -1
- package/dist/components/ui/ConfirmDialog.css +42 -0
- package/dist/components/ui/ConfirmDialog.d.ts +11 -0
- package/dist/components/ui/ConfirmDialog.js +12 -0
- package/dist/components/ui/ConfirmDialog.js.map +1 -0
- package/dist/components/ui/Drawer.css +121 -96
- package/dist/components/ui/Drawer.d.ts +15 -6
- package/dist/components/ui/Drawer.js +44 -13
- package/dist/components/ui/Drawer.js.map +1 -1
- package/dist/locales/de.json +15 -0
- package/dist/locales/en.json +15 -0
- package/dist/locales/es.json +15 -0
- package/dist/locales/fr.json +7 -0
- package/dist/locales/it.json +15 -0
- package/dist/styles.css +6 -4
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.css +33 -23
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js +85 -8
- package/esm/components/CompletionProviderStatus/CompletionProviderStatus.js.map +1 -1
- package/esm/components/KnownFacts/KnownFacts.js +1 -1
- package/esm/components/KnownFacts/KnownFacts.js.map +1 -1
- package/esm/components/StartPanel/StartPanel.css +29 -0
- package/esm/components/StartPanel/StartPanel.js +2 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/Typing/Typing.js +49 -47
- package/esm/components/Typing/Typing.js.map +1 -1
- package/esm/components/UploadButton/UploadButton.d.ts +1 -0
- package/esm/components/UploadButton/UploadButton.js +142 -3
- package/esm/components/UploadButton/UploadButton.js.map +1 -1
- package/esm/components/icons/Alert.d.ts +5 -0
- package/esm/components/icons/Alert.js +4 -0
- package/esm/components/icons/Alert.js.map +1 -0
- package/esm/components/icons/Info.d.ts +5 -0
- package/esm/components/icons/Info.js +4 -0
- package/esm/components/icons/Info.js.map +1 -0
- package/esm/components/icons/Warning.js +1 -1
- package/esm/components/icons/Warning.js.map +1 -1
- package/esm/components/ui/ConfirmDialog.css +42 -0
- package/esm/components/ui/ConfirmDialog.d.ts +11 -0
- package/esm/components/ui/ConfirmDialog.js +9 -0
- package/esm/components/ui/ConfirmDialog.js.map +1 -0
- package/esm/components/ui/Drawer.css +121 -96
- package/esm/components/ui/Drawer.d.ts +15 -6
- package/esm/components/ui/Drawer.js +45 -14
- package/esm/components/ui/Drawer.js.map +1 -1
- package/esm/locales/de.json +15 -0
- package/esm/locales/en.json +15 -0
- package/esm/locales/es.json +15 -0
- package/esm/locales/fr.json +7 -0
- package/esm/locales/it.json +15 -0
- package/esm/styles.css +6 -4
- package/package.json +1 -1
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +10 -0
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.css +33 -23
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +274 -21
- package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +117 -21
- package/src/components/CompletionProviderStatus/__snapshots__/CompletionProviderStatus.test.tsx.snap +39 -21
- package/src/components/KnownFacts/KnownFacts.tsx +1 -1
- package/src/components/StartPanel/StartPanel.css +29 -0
- package/src/components/StartPanel/StartPanel.tsx +47 -0
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +827 -7
- package/src/components/Typing/Typing.tsx +52 -47
- package/src/components/UploadButton/UploadButton.tsx +206 -5
- package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +1 -1
- package/src/components/icons/Alert.tsx +31 -0
- package/src/components/icons/Info.tsx +31 -0
- package/src/components/icons/Warning.tsx +2 -1
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +74 -0
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +148 -0
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +74 -0
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +74 -0
- package/src/components/ui/ConfirmDialog.css +42 -0
- package/src/components/ui/ConfirmDialog.stories.tsx +216 -0
- package/src/components/ui/ConfirmDialog.test.tsx +124 -0
- package/src/components/ui/ConfirmDialog.tsx +58 -0
- package/src/components/ui/Drawer.css +121 -96
- package/src/components/ui/Drawer.stories.tsx +152 -67
- package/src/components/ui/Drawer.test.tsx +6 -2
- package/src/components/ui/Drawer.tsx +195 -89
- package/src/components/ui/__snapshots__/ConfirmDialog.test.tsx.snap +35 -0
- package/src/locales/de.json +15 -0
- package/src/locales/en.json +15 -0
- package/src/locales/es.json +15 -0
- package/src/locales/fr.json +7 -0
- package/src/locales/it.json +15 -0
- package/src/styles.css +6 -4
package/esm/locales/it.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"nothingFound": "Nessun risultato",
|
|
39
39
|
"venue": "Luogo",
|
|
40
40
|
"searchVenue": "Cerca luogo...",
|
|
41
|
+
"privacyPolicy": "Informativa sulla privacy",
|
|
41
42
|
"memoriBlockedTitle": "Bloccato",
|
|
42
43
|
"memoriBlockedUntil": "Agente bloccato fino al {{date}}",
|
|
43
44
|
"memoriBlockedAnon": "Attualmente \"{{name}}\" non può rispondere, torna qui il {{date}}",
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
"receiverLabel": "Assegnato a",
|
|
50
51
|
"completionsEnabled": "IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette",
|
|
51
52
|
"completionProviderDown": "Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.",
|
|
53
|
+
"completionProviderMajorOutage": "Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Non sarà possibile utilizzare questa funzionalità finché il servizio non viene ripristinato.",
|
|
54
|
+
"completionProviderPartialOutage": "Questo agente è integrato con una IA generativa di {{provider}}, ma sta riscontrando interruzioni parziali. Alcune funzionalità potrebbero non essere disponibili o funzionare in modo non ottimale.",
|
|
55
|
+
"completionProviderDegraded": "Questo agente è integrato con una IA generativa di {{provider}}, ma sta funzionando più lentamente del normale. Le risposte potrebbero richiedere più tempo o essere meno precise.",
|
|
52
56
|
"completionProviderFallbackName": "un provider esterno",
|
|
53
57
|
"completionProviderCheckStatusPage": "Vedi pagina di stato",
|
|
54
58
|
"boardOfExperts": "Gruppo di esperti",
|
|
@@ -69,6 +73,10 @@
|
|
|
69
73
|
"deepThoughtPreDisclaimerUnlogged": "Accedi per abilitare Pensiero Profondo.",
|
|
70
74
|
"deepThoughtPreDisclaimerNotAllowed": "Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.",
|
|
71
75
|
"notEnoughCredits": "L'autore di questo agente non ha abbastanza crediti per rispondere alla tua domanda.",
|
|
76
|
+
"confirmDialog": {
|
|
77
|
+
"title": "Confermi di voler lasciare questa pagina?",
|
|
78
|
+
"message": "Le modifiche non salvate andranno perse."
|
|
79
|
+
},
|
|
72
80
|
"knownFacts": {
|
|
73
81
|
"title": "Fatti noti",
|
|
74
82
|
"description": "Dettagli delle informazioni condivise tra te e {{memoriName}}",
|
|
@@ -110,6 +118,13 @@
|
|
|
110
118
|
"micButtonPopoverListening": "Premi il pulsante per smettere di parlare",
|
|
111
119
|
"pageInstructExplanation": "Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare",
|
|
112
120
|
"pageTryMeExplanation": "Per parlare con me clicca sul pulsante INIZIAMO per cominciare",
|
|
121
|
+
"pagePrivacyExplanation": "Le conversazioni sono visibili all'autore dell'agente",
|
|
122
|
+
"pagePrivacyExplanationList": {
|
|
123
|
+
"allConversations": "Tutte le conversazioni con questo agente sono visibili all'autore dell'agente",
|
|
124
|
+
"anonymousUser": "Per utenti anonimi: l'autore vedrà il contenuto e l'indirizzo IP",
|
|
125
|
+
"registeredUser": "Per utenti registrati: l'autore vedrà il contenuto e il nome utente",
|
|
126
|
+
"authorUsesInfo": "L'autore utilizza queste informazioni per migliorare le funzionalità dell'agente. Continuando, accetti queste condizioni."
|
|
127
|
+
},
|
|
113
128
|
"instructButton": "ISTRUISCIMI",
|
|
114
129
|
"tryMeButton": "INIZIAMO",
|
|
115
130
|
"resumeButton": "RIPRENDI",
|
package/esm/styles.css
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import url('./components/ui/Button.css');
|
|
2
2
|
@import url('./components/ui/Card.css');
|
|
3
3
|
@import url('./components/ui/Checkbox.css');
|
|
4
|
+
@import url('./components/ui/ConfirmDialog.css');
|
|
4
5
|
@import url('./components/ui/Drawer.css');
|
|
5
6
|
@import url('./components/ui/Modal.css');
|
|
6
7
|
@import url('./components/ui/Spin.css');
|
|
@@ -10,8 +11,7 @@
|
|
|
10
11
|
@import url('./components/ui/Details.css');
|
|
11
12
|
@import url('./components/ui/Expandable.css');
|
|
12
13
|
@import url('./components/ui/Slider.css');
|
|
13
|
-
@import url('./components/
|
|
14
|
-
@import url('./components/FilePreview/FilePreview.css');
|
|
14
|
+
@import url('./components/ui/Alert.css');
|
|
15
15
|
|
|
16
16
|
@import url('./components/CompletionProviderStatus/CompletionProviderStatus.css');
|
|
17
17
|
@import url('./components/PoweredBy/PoweredBy.css');
|
|
@@ -49,14 +49,16 @@
|
|
|
49
49
|
@import url('./components/VenueWidget/VenueWidget.css');
|
|
50
50
|
@import url('./components/WhyThisAnswer/WhyThisAnswer.css');
|
|
51
51
|
@import url('./components/MemoriWidget/MemoriWidget.css');
|
|
52
|
-
@import url('./components/
|
|
53
|
-
@import url('
|
|
52
|
+
@import url('./components/UploadButton/UploadButton.css');
|
|
53
|
+
@import url('./components/FilePreview/FilePreview.css');
|
|
54
54
|
|
|
55
55
|
@import url('./components/layouts/hidden-chat.css');
|
|
56
56
|
@import url('./components/layouts/totem.css');
|
|
57
57
|
@import url('./components/layouts/website-assistant.css');
|
|
58
58
|
@import url('./components/layouts/chat.css');
|
|
59
59
|
@import url('./components/layouts/zoomed-full-body.css');
|
|
60
|
+
|
|
61
|
+
@import url('https://fonts.bunny.net/css?family=lexend-deca:200,400,700');
|
|
60
62
|
@import url('https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css');
|
|
61
63
|
|
|
62
64
|
.sr-only {
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ exports[`renders BlockedMemoriBadge for not enough credits unchanged 1`] = `
|
|
|
22
22
|
<svg
|
|
23
23
|
aria-hidden="true"
|
|
24
24
|
class="blocked-memori-badge--icon"
|
|
25
|
+
color="currentColor"
|
|
25
26
|
focusable="false"
|
|
26
27
|
role="img"
|
|
27
28
|
viewBox="0 0 1024 1024"
|
|
@@ -29,6 +30,7 @@ exports[`renders BlockedMemoriBadge for not enough credits unchanged 1`] = `
|
|
|
29
30
|
>
|
|
30
31
|
<path
|
|
31
32
|
d="M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"
|
|
33
|
+
fill="currentColor"
|
|
32
34
|
/>
|
|
33
35
|
</svg>
|
|
34
36
|
</div>
|
|
@@ -60,6 +62,7 @@ exports[`renders BlockedMemoriBadge unchanged 1`] = `
|
|
|
60
62
|
<svg
|
|
61
63
|
aria-hidden="true"
|
|
62
64
|
class="blocked-memori-badge--icon"
|
|
65
|
+
color="currentColor"
|
|
63
66
|
focusable="false"
|
|
64
67
|
role="img"
|
|
65
68
|
viewBox="0 0 1024 1024"
|
|
@@ -67,6 +70,7 @@ exports[`renders BlockedMemoriBadge unchanged 1`] = `
|
|
|
67
70
|
>
|
|
68
71
|
<path
|
|
69
72
|
d="M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"
|
|
73
|
+
fill="currentColor"
|
|
70
74
|
/>
|
|
71
75
|
</svg>
|
|
72
76
|
</div>
|
|
@@ -102,6 +106,7 @@ memoriBlockedGiverHelper
|
|
|
102
106
|
<svg
|
|
103
107
|
aria-hidden="true"
|
|
104
108
|
class="blocked-memori-badge--icon"
|
|
109
|
+
color="currentColor"
|
|
105
110
|
focusable="false"
|
|
106
111
|
role="img"
|
|
107
112
|
viewBox="0 0 1024 1024"
|
|
@@ -109,6 +114,7 @@ memoriBlockedGiverHelper
|
|
|
109
114
|
>
|
|
110
115
|
<path
|
|
111
116
|
d="M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"
|
|
117
|
+
fill="currentColor"
|
|
112
118
|
/>
|
|
113
119
|
</svg>
|
|
114
120
|
</div>
|
|
@@ -140,6 +146,7 @@ exports[`renders BlockedMemoriBadge with margin left unchanged 1`] = `
|
|
|
140
146
|
<svg
|
|
141
147
|
aria-hidden="true"
|
|
142
148
|
class="blocked-memori-badge--icon"
|
|
149
|
+
color="currentColor"
|
|
143
150
|
focusable="false"
|
|
144
151
|
role="img"
|
|
145
152
|
viewBox="0 0 1024 1024"
|
|
@@ -147,6 +154,7 @@ exports[`renders BlockedMemoriBadge with margin left unchanged 1`] = `
|
|
|
147
154
|
>
|
|
148
155
|
<path
|
|
149
156
|
d="M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"
|
|
157
|
+
fill="currentColor"
|
|
150
158
|
/>
|
|
151
159
|
</svg>
|
|
152
160
|
</div>
|
|
@@ -178,6 +186,7 @@ exports[`renders BlockedMemoriBadge with title unchanged 1`] = `
|
|
|
178
186
|
<svg
|
|
179
187
|
aria-hidden="true"
|
|
180
188
|
class="blocked-memori-badge--icon"
|
|
189
|
+
color="currentColor"
|
|
181
190
|
focusable="false"
|
|
182
191
|
role="img"
|
|
183
192
|
viewBox="0 0 1024 1024"
|
|
@@ -185,6 +194,7 @@ exports[`renders BlockedMemoriBadge with title unchanged 1`] = `
|
|
|
185
194
|
>
|
|
186
195
|
<path
|
|
187
196
|
d="M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"
|
|
197
|
+
fill="currentColor"
|
|
188
198
|
/>
|
|
189
199
|
</svg>
|
|
190
200
|
</div>
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
.memori--completion-provider-status--icon {
|
|
2
|
-
width:
|
|
3
|
-
height:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.memori--completion-provider-status--
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.memori--completion-provider-status--tooltip.memori-tooltip .memori-tooltip--content p {
|
|
13
|
-
margin: 0.5em auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.memori--completion-provider-status--tooltip.memori-tooltip .memori-tooltip--content p+p {
|
|
17
|
-
margin-top: 1em;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.memori--completion-provider-status--loading {
|
|
21
|
-
display: flex;
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
2
|
+
width: 24px;
|
|
3
|
+
height: 24px;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
font-size: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.memori--completion-provider-status--loading {
|
|
9
|
+
display: inline-flex;
|
|
24
10
|
align-items: center;
|
|
25
11
|
justify-content: center;
|
|
26
|
-
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.memori--completion-provider-status--icon-error {
|
|
15
|
+
color: #f5222d;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.memori--completion-provider-status--icon-warning {
|
|
19
|
+
color: #faad14;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.memori--completion-provider-status--icon-info {
|
|
23
|
+
color: #1890ff;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.memori--completion-provider-status--tooltip {
|
|
27
|
+
max-width: 300px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.memori--completion-provider-status--tooltip p {
|
|
31
|
+
margin-bottom: 8px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.memori--completion-provider-status--tooltip p:last-child {
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
}
|
|
@@ -1,43 +1,296 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import I18nWrapper from '../../I18nWrapper';
|
|
4
3
|
import CompletionProviderStatus, { Props } from './CompletionProviderStatus';
|
|
5
|
-
|
|
6
4
|
import './CompletionProviderStatus.css';
|
|
7
5
|
|
|
6
|
+
// Import the actual component for the live examples
|
|
7
|
+
import I18nWrapper from '../../I18nWrapper';
|
|
8
|
+
|
|
9
|
+
// Create a mock I18n provider instead of trying to replace useTranslation
|
|
10
|
+
const MockI18nProvider = ({ children }: { children: React.ReactNode }) => {
|
|
11
|
+
// We'll create a wrapper component that provides the translation context
|
|
12
|
+
return <div className="mock-i18n-wrapper">{children}</div>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Mock wrapper that also provides example tooltips
|
|
16
|
+
const MockI18nWrapper = ({ children, status }: { children: React.ReactNode, status?: string }) => {
|
|
17
|
+
return (
|
|
18
|
+
<MockI18nProvider>
|
|
19
|
+
<div className="mock-tooltip">
|
|
20
|
+
{children}
|
|
21
|
+
{status && (
|
|
22
|
+
<div className="mock-tooltip-content" style={{
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
left: '50px',
|
|
25
|
+
top: '0',
|
|
26
|
+
backgroundColor: '#fff',
|
|
27
|
+
border: '1px solid #eee',
|
|
28
|
+
borderRadius: '5px',
|
|
29
|
+
padding: '10px',
|
|
30
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
31
|
+
zIndex: 10,
|
|
32
|
+
width: '300px'
|
|
33
|
+
}}>
|
|
34
|
+
<p>{getStatusMessage(status)}</p>
|
|
35
|
+
<p><a href="#" onClick={(e) => e.preventDefault()}>Check the status page for updates</a></p>
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
</MockI18nProvider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Helper function to get status messages
|
|
44
|
+
const getStatusMessage = (status: string): string => {
|
|
45
|
+
switch (status) {
|
|
46
|
+
case 'major_outage':
|
|
47
|
+
return 'Mistral service is completely down. Please try again later.';
|
|
48
|
+
case 'partial_outage':
|
|
49
|
+
return 'Anthropic service is experiencing significant disruptions.';
|
|
50
|
+
case 'degraded_performance':
|
|
51
|
+
return 'OpenAI service is responding slower than usual.';
|
|
52
|
+
default:
|
|
53
|
+
return 'The service is currently experiencing issues.';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
8
57
|
const meta: Meta = {
|
|
9
58
|
title: 'Completion Provider Status',
|
|
10
59
|
component: CompletionProviderStatus as React.ComponentType<any>,
|
|
11
|
-
argTypes: {},
|
|
12
60
|
parameters: {
|
|
13
61
|
layout: 'centered',
|
|
14
62
|
controls: { expanded: true },
|
|
15
63
|
},
|
|
16
64
|
};
|
|
17
65
|
|
|
18
|
-
|
|
66
|
+
// Add real examples of the component for reference
|
|
67
|
+
export const LiveExample_OpenAI_DegradedPerformance = () => (
|
|
68
|
+
<I18nWrapper>
|
|
69
|
+
<div style={{ padding: '20px' }}>
|
|
70
|
+
<h3>Live Component - OpenAI with Degraded Performance</h3>
|
|
71
|
+
<p>This is how the actual component will appear:</p>
|
|
72
|
+
<CompletionProviderStatus
|
|
73
|
+
forceStatus="degraded_performance"
|
|
74
|
+
provider="OpenAI"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</I18nWrapper>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const LiveExample_Anthropic_PartialOutage = () => (
|
|
81
|
+
<I18nWrapper>
|
|
82
|
+
<div style={{ padding: '20px' }}>
|
|
83
|
+
<h3>Live Component - Anthropic with Partial Outage</h3>
|
|
84
|
+
<p>This is how the actual component will appear:</p>
|
|
85
|
+
<CompletionProviderStatus
|
|
86
|
+
forceStatus="partial_outage"
|
|
87
|
+
provider="Anthropic"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</I18nWrapper>
|
|
91
|
+
);
|
|
19
92
|
|
|
20
|
-
const
|
|
93
|
+
export const LiveExample_Mistral_MajorOutage = () => (
|
|
21
94
|
<I18nWrapper>
|
|
22
|
-
<
|
|
95
|
+
<div style={{ padding: '20px' }}>
|
|
96
|
+
<h3>Live Component - Mistral with Major Outage</h3>
|
|
97
|
+
<p>This is how the actual component will appear:</p>
|
|
98
|
+
<CompletionProviderStatus
|
|
99
|
+
forceStatus="major_outage"
|
|
100
|
+
provider="Mistral"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
23
103
|
</I18nWrapper>
|
|
24
104
|
);
|
|
25
105
|
|
|
26
|
-
export
|
|
27
|
-
Default.args = {};
|
|
106
|
+
export default meta;
|
|
28
107
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
108
|
+
// Status container to add some context around the icon
|
|
109
|
+
const StatusContainer = ({ status, children }: { status: string, children: React.ReactNode }) => (
|
|
110
|
+
<div style={{
|
|
111
|
+
padding: '20px',
|
|
112
|
+
border: '1px solid #eee',
|
|
113
|
+
borderRadius: '5px',
|
|
114
|
+
margin: '10px 0',
|
|
115
|
+
width: '500px'
|
|
116
|
+
}}>
|
|
117
|
+
<h3>{status}</h3>
|
|
118
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
|
119
|
+
<div>{children}</div>
|
|
120
|
+
<div style={{ fontSize: '14px', color: '#888' }}>← Hover to see message</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
33
124
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
125
|
+
// Stories for each status type - we'll create visual examples instead of using the component
|
|
126
|
+
export const AllStatusTypes = () => (
|
|
127
|
+
<div>
|
|
128
|
+
<h2>Status Alert Types</h2>
|
|
129
|
+
<p>Each alert has a different icon and color based on severity.</p>
|
|
130
|
+
|
|
131
|
+
<StatusContainer status="Degraded Performance (Blue Info Icon)">
|
|
132
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
133
|
+
<div style={{
|
|
134
|
+
color: '#1890ff',
|
|
135
|
+
width: '24px',
|
|
136
|
+
height: '24px',
|
|
137
|
+
display: 'flex',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
justifyContent: 'center',
|
|
140
|
+
border: '1px solid #e8e8e8',
|
|
141
|
+
borderRadius: '50%',
|
|
142
|
+
backgroundColor: '#f0f5ff'
|
|
143
|
+
}}>
|
|
144
|
+
i
|
|
145
|
+
</div>
|
|
146
|
+
<div style={{ marginLeft: '10px' }}>
|
|
147
|
+
"OpenAI service is responding slower than usual."
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</StatusContainer>
|
|
151
|
+
|
|
152
|
+
<StatusContainer status="Partial Outage (Yellow Warning Icon)">
|
|
153
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
154
|
+
<div style={{
|
|
155
|
+
color: '#faad14',
|
|
156
|
+
width: '24px',
|
|
157
|
+
height: '24px',
|
|
158
|
+
display: 'flex',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
justifyContent: 'center',
|
|
161
|
+
border: '1px solid #e8e8e8',
|
|
162
|
+
borderRadius: '50%',
|
|
163
|
+
backgroundColor: '#fffbe6'
|
|
164
|
+
}}>
|
|
165
|
+
⚠️
|
|
166
|
+
</div>
|
|
167
|
+
<div style={{ marginLeft: '10px' }}>
|
|
168
|
+
"Anthropic service is experiencing significant disruptions."
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</StatusContainer>
|
|
172
|
+
|
|
173
|
+
<StatusContainer status="Major Outage (Red Alert Icon)">
|
|
174
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
175
|
+
<div style={{
|
|
176
|
+
color: '#f5222d',
|
|
177
|
+
width: '24px',
|
|
178
|
+
height: '24px',
|
|
179
|
+
display: 'flex',
|
|
180
|
+
alignItems: 'center',
|
|
181
|
+
justifyContent: 'center',
|
|
182
|
+
border: '1px solid #e8e8e8',
|
|
183
|
+
borderRadius: '50%',
|
|
184
|
+
backgroundColor: '#fff1f0'
|
|
185
|
+
}}>
|
|
186
|
+
⚠️
|
|
187
|
+
</div>
|
|
188
|
+
<div style={{ marginLeft: '10px' }}>
|
|
189
|
+
"Mistral service is completely down. Please try again later."
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</StatusContainer>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
38
195
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
196
|
+
// Individual stories for each status using visual examples
|
|
197
|
+
export const DegradedPerformance = () => (
|
|
198
|
+
<StatusContainer status="Degraded Performance (Blue Info Icon)">
|
|
199
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
200
|
+
<div style={{
|
|
201
|
+
color: '#1890ff',
|
|
202
|
+
width: '24px',
|
|
203
|
+
height: '24px',
|
|
204
|
+
display: 'flex',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
justifyContent: 'center',
|
|
207
|
+
border: '1px solid #e8e8e8',
|
|
208
|
+
borderRadius: '50%',
|
|
209
|
+
backgroundColor: '#f0f5ff'
|
|
210
|
+
}}>
|
|
211
|
+
i
|
|
212
|
+
</div>
|
|
213
|
+
<div style={{ marginLeft: '10px' }}>
|
|
214
|
+
"OpenAI service is responding slower than usual."
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</StatusContainer>
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
export const PartialOutage = () => (
|
|
221
|
+
<StatusContainer status="Partial Outage (Yellow Warning Icon)">
|
|
222
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
223
|
+
<div style={{
|
|
224
|
+
color: '#faad14',
|
|
225
|
+
width: '24px',
|
|
226
|
+
height: '24px',
|
|
227
|
+
display: 'flex',
|
|
228
|
+
alignItems: 'center',
|
|
229
|
+
justifyContent: 'center',
|
|
230
|
+
border: '1px solid #e8e8e8',
|
|
231
|
+
borderRadius: '50%',
|
|
232
|
+
backgroundColor: '#fffbe6'
|
|
233
|
+
}}>
|
|
234
|
+
⚠️
|
|
235
|
+
</div>
|
|
236
|
+
<div style={{ marginLeft: '10px' }}>
|
|
237
|
+
"Anthropic service is experiencing significant disruptions."
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</StatusContainer>
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
export const MajorOutage = () => (
|
|
244
|
+
<StatusContainer status="Major Outage (Red Alert Icon)">
|
|
245
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
246
|
+
<div style={{
|
|
247
|
+
color: '#f5222d',
|
|
248
|
+
width: '24px',
|
|
249
|
+
height: '24px',
|
|
250
|
+
display: 'flex',
|
|
251
|
+
alignItems: 'center',
|
|
252
|
+
justifyContent: 'center',
|
|
253
|
+
border: '1px solid #e8e8e8',
|
|
254
|
+
borderRadius: '50%',
|
|
255
|
+
backgroundColor: '#fff1f0'
|
|
256
|
+
}}>
|
|
257
|
+
⚠️
|
|
258
|
+
</div>
|
|
259
|
+
<div style={{ marginLeft: '10px' }}>
|
|
260
|
+
"Mistral service is completely down. Please try again later."
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</StatusContainer>
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
// All statuses for each provider
|
|
267
|
+
export const AllProvidersWithDifferentStatuses = () => (
|
|
268
|
+
<I18nWrapper>
|
|
269
|
+
<div>
|
|
270
|
+
<h2>Different Providers with Different Statuses</h2>
|
|
271
|
+
|
|
272
|
+
<div style={{
|
|
273
|
+
display: 'flex',
|
|
274
|
+
flexDirection: 'column',
|
|
275
|
+
gap: '20px',
|
|
276
|
+
padding: '20px',
|
|
277
|
+
border: '1px solid #eee',
|
|
278
|
+
borderRadius: '5px',
|
|
279
|
+
marginBottom: '20px'
|
|
280
|
+
}}>
|
|
281
|
+
<div>
|
|
282
|
+
<h3>OpenAI - Real-time status</h3>
|
|
283
|
+
<CompletionProviderStatus provider="OpenAI" />
|
|
284
|
+
</div>
|
|
285
|
+
<div>
|
|
286
|
+
<h3>Anthropic - Real-time status</h3>
|
|
287
|
+
<CompletionProviderStatus provider="Anthropic" />
|
|
288
|
+
</div>
|
|
289
|
+
<div>
|
|
290
|
+
<h3>Mistral - Real-time status</h3>
|
|
291
|
+
<CompletionProviderStatus provider="Mistral" />
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</I18nWrapper>
|
|
296
|
+
);
|