@asgard-js/react 0.0.43-canary.3 → 0.0.43-canary.4
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/dist/components/chatbot/api-key-input/api-key-input.d.ts +2 -1
- package/dist/components/chatbot/api-key-input/api-key-input.d.ts.map +1 -1
- package/dist/index.js +6972 -6962
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/chatbot/api-key-input/api-key-input.module.scss +21 -1
- package/src/components/chatbot/api-key-input/api-key-input.tsx +8 -0
package/package.json
CHANGED
|
@@ -2,10 +2,30 @@
|
|
|
2
2
|
width: 220px;
|
|
3
3
|
background-color: var(--asg-color-bg);
|
|
4
4
|
border-radius: 12px;
|
|
5
|
-
padding: 20px;
|
|
5
|
+
padding: 12px 20px;
|
|
6
6
|
border: 0.5px solid var(--asg-color-border);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
.header {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
margin-bottom: 12px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.icon {
|
|
18
|
+
width: 24px;
|
|
19
|
+
height: 24px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.title {
|
|
23
|
+
margin: 0;
|
|
24
|
+
font-size: 18px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
color: white;
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
.form {
|
|
10
30
|
width: 100%;
|
|
11
31
|
display: flex;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState, FormEvent, ChangeEvent } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import ProfileSvg from '../../../icons/profile.svg?react';
|
|
3
4
|
import { useAsgardThemeContext } from '../../../context/asgard-theme-context';
|
|
4
5
|
import styles from './api-key-input.module.scss';
|
|
5
6
|
|
|
@@ -8,6 +9,7 @@ export interface ApiKeyInputProps {
|
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
error?: string;
|
|
10
11
|
placeholder?: string;
|
|
12
|
+
title?: string;
|
|
11
13
|
showToggle?: boolean;
|
|
12
14
|
className?: string;
|
|
13
15
|
}
|
|
@@ -17,6 +19,7 @@ export function ApiKeyInput({
|
|
|
17
19
|
loading = false,
|
|
18
20
|
error,
|
|
19
21
|
placeholder = 'Enter your key',
|
|
22
|
+
title = 'Preview',
|
|
20
23
|
showToggle = true,
|
|
21
24
|
className,
|
|
22
25
|
}: ApiKeyInputProps): JSX.Element {
|
|
@@ -47,6 +50,11 @@ export function ApiKeyInput({
|
|
|
47
50
|
borderColor: chatbot.borderColor,
|
|
48
51
|
}}
|
|
49
52
|
>
|
|
53
|
+
<div className={styles.header}>
|
|
54
|
+
<ProfileSvg className={styles.icon} />
|
|
55
|
+
<h2 className={styles.title}>{title}</h2>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
50
58
|
<form onSubmit={handleSubmit} className={styles.form}>
|
|
51
59
|
<div className={styles.inputGroup}>
|
|
52
60
|
<label className={styles.label}>Key</label>
|