@smart-cloud/ai-kit-ui 1.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.
- package/.gitattributes +8 -0
- package/dist/ai-kit-ui.css +201 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +14 -0
- package/eslint.config.js +18 -0
- package/package.json +75 -0
- package/src/ShadowBoundary.tsx +266 -0
- package/src/ai-feature/AiFeature.tsx +1824 -0
- package/src/ai-feature/AiFeatureBorder.tsx +22 -0
- package/src/ai-feature/ProofreadDiff.tsx +118 -0
- package/src/ai-feature/index.tsx +2 -0
- package/src/ai-feature/utils.tsx +20 -0
- package/src/i18n/ar.ts +156 -0
- package/src/i18n/de.ts +157 -0
- package/src/i18n/en.ts +156 -0
- package/src/i18n/es.ts +157 -0
- package/src/i18n/fr.ts +158 -0
- package/src/i18n/he.ts +156 -0
- package/src/i18n/hi.ts +157 -0
- package/src/i18n/hu.ts +156 -0
- package/src/i18n/id.ts +157 -0
- package/src/i18n/index.ts +47 -0
- package/src/i18n/it.ts +159 -0
- package/src/i18n/ja.ts +157 -0
- package/src/i18n/ko.ts +155 -0
- package/src/i18n/nb.ts +156 -0
- package/src/i18n/nl.ts +157 -0
- package/src/i18n/pl.ts +158 -0
- package/src/i18n/pt.ts +155 -0
- package/src/i18n/ru.ts +157 -0
- package/src/i18n/sv.ts +156 -0
- package/src/i18n/th.ts +154 -0
- package/src/i18n/tr.ts +158 -0
- package/src/i18n/ua.ts +159 -0
- package/src/i18n/zh.ts +151 -0
- package/src/index.tsx +4 -0
- package/src/styles/ai-kit-ui.css +201 -0
- package/src/useAiRun.ts +177 -0
- package/src/withAiKitShell.tsx +208 -0
- package/tsconfig.json +32 -0
- package/tsconfig.node.json +13 -0
- package/tsup.config.ts +21 -0
package/.gitattributes
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--ai-kit-border-width: 1px;
|
|
3
|
+
|
|
4
|
+
--ai-kit-border-color: var(
|
|
5
|
+
--mantine-color-default-border,
|
|
6
|
+
rgba(0, 0, 0, 0.12)
|
|
7
|
+
);
|
|
8
|
+
--ai-kit-text-color: var(
|
|
9
|
+
--mantine-color-text,
|
|
10
|
+
var(--mantine-color-default-color)
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
--ai-kit-background-color: var(--mantine-color-body);
|
|
14
|
+
--ai-kit-options-background-color: rgba(235, 235, 235, 0.15);
|
|
15
|
+
|
|
16
|
+
--ai-kit-border-radius: var(--paper-radius);
|
|
17
|
+
--ai-kit-border-thickness: 2px;
|
|
18
|
+
--ai-kit-border-speed: 1400ms;
|
|
19
|
+
--ai-kit-border-angle: 0deg;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host[data-ai-kit-variation="default"] {
|
|
23
|
+
--ai-kit-background-color: transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ai-feature-root {
|
|
27
|
+
--mb-z-index: var(--ai-kit-z-index, 100000) !important;
|
|
28
|
+
border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
|
|
29
|
+
border-radius: var(--ai-kit-border-radius);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ai-feature-root .Mantine-Paper-root {
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ai-feature-title-icon {
|
|
37
|
+
width: 24px;
|
|
38
|
+
height: 24px;
|
|
39
|
+
fill: none;
|
|
40
|
+
margin-right: 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ai-feature-open-button-no-title {
|
|
44
|
+
padding-inline-start: var(--button-padding-x);
|
|
45
|
+
}
|
|
46
|
+
.ai-feature-open-button-no-title .mantine-Button-section {
|
|
47
|
+
margin-inline-end: unset;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ai-feature-options {
|
|
51
|
+
background-color: var(--ai-kit-options-background-color);
|
|
52
|
+
border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
|
|
53
|
+
border-radius: var(--ai-kit-border-radius);
|
|
54
|
+
font-size: var(--mantine-font-size-xs);
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ai-feature-options[data-options-display="horizontal"] {
|
|
59
|
+
cursor: default;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ai-feature-options[data-options-display="horizontal"] .ai-feature-option {
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
min-width: 120px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ai-feature-options-summary {
|
|
68
|
+
--group-wrap: nowrap !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ai-feature-status-text {
|
|
72
|
+
font-size: var(--mantine-font-size-xs);
|
|
73
|
+
opacity: 0.85;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ai-feature-generated-content {
|
|
77
|
+
border: var(--ai-kit-border-width) solid var(--ai-kit-border-color);
|
|
78
|
+
border-radius: var(--ai-kit-border-radius);
|
|
79
|
+
white-space: normal;
|
|
80
|
+
background-color: var(--ai-kit-options-background-color);
|
|
81
|
+
max-height: 400px;
|
|
82
|
+
overflow: auto;
|
|
83
|
+
padding: var(--mantine-spacing-sm);
|
|
84
|
+
font-size: var(--mantine-font-size-sm);
|
|
85
|
+
line-height: var(--mantine-line-height-sm);
|
|
86
|
+
}
|
|
87
|
+
.ai-feature-generated-content * {
|
|
88
|
+
margin-block-start: auto;
|
|
89
|
+
margin-block-end: auto;
|
|
90
|
+
}
|
|
91
|
+
.ai-feature-generated-content.ai-feature-preview,
|
|
92
|
+
.ai-feature-generated-content.ai-feature-editor {
|
|
93
|
+
max-height: 200px;
|
|
94
|
+
}
|
|
95
|
+
.ai-feature-generated-content.ai-feature-editor textarea {
|
|
96
|
+
border: 0;
|
|
97
|
+
max-height: 198px;
|
|
98
|
+
resize: vertical;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ai-kit-feature-border {
|
|
102
|
+
background-color: var(--ai-kit-background-color);
|
|
103
|
+
position: relative;
|
|
104
|
+
overflow: visible;
|
|
105
|
+
padding: var(--ai-kit-border-thickness);
|
|
106
|
+
border-radius: var(--ai-kit-border-radius);
|
|
107
|
+
width: 100%;
|
|
108
|
+
box-sizing: border-box;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ai-kit-feature-border__content {
|
|
112
|
+
position: relative;
|
|
113
|
+
z-index: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ai-kit-feature-border[data-ai-kit-active="false"]::before {
|
|
117
|
+
content: "";
|
|
118
|
+
position: absolute;
|
|
119
|
+
inset: 0;
|
|
120
|
+
z-index: 0;
|
|
121
|
+
border-radius: var(--ai-kit-border-radius);
|
|
122
|
+
padding: var(--ai-kit-border-thickness);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ai-kit-feature-border[data-ai-kit-active="true"]::before {
|
|
126
|
+
content: "";
|
|
127
|
+
position: absolute;
|
|
128
|
+
inset: 0;
|
|
129
|
+
z-index: 0;
|
|
130
|
+
border-radius: var(--ai-kit-border-radius);
|
|
131
|
+
padding: var(--ai-kit-border-thickness);
|
|
132
|
+
background: var(
|
|
133
|
+
--ai-kit-border-gradient,
|
|
134
|
+
conic-gradient(
|
|
135
|
+
from var(--ai-kit-border-angle, 0deg) at 50% 50%,
|
|
136
|
+
#00c2ff,
|
|
137
|
+
#7c3aed,
|
|
138
|
+
#22c55e,
|
|
139
|
+
#f59e0b,
|
|
140
|
+
#00c2ff
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
animation: ai-kit-border-run var(--ai-kit-border-speed) linear infinite;
|
|
144
|
+
-webkit-mask:
|
|
145
|
+
linear-gradient(#000 0 0) content-box,
|
|
146
|
+
linear-gradient(#000 0 0);
|
|
147
|
+
-webkit-mask-composite: xor;
|
|
148
|
+
mask:
|
|
149
|
+
linear-gradient(#000 0 0) content-box,
|
|
150
|
+
linear-gradient(#000 0 0);
|
|
151
|
+
mask-composite: exclude;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ai-kit-feature-border[data-ai-kit-active="true"][data-ai-kit-variation="modal"] {
|
|
155
|
+
box-shadow:
|
|
156
|
+
0 0 0 0.5px rgba(0, 0, 0, 0.06),
|
|
157
|
+
0 8px 24px rgba(0, 0, 0, 0.14),
|
|
158
|
+
0 0 28px rgba(124, 58, 237, 0.22);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@keyframes ai-kit-border-run {
|
|
162
|
+
from {
|
|
163
|
+
--ai-kit-border-angle: 0deg;
|
|
164
|
+
}
|
|
165
|
+
to {
|
|
166
|
+
--ai-kit-border-angle: 360deg;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
171
|
+
.ai-kit-feature-border[data-ai-kit-active="true"]::before {
|
|
172
|
+
animation: none;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* AiResult inner padding so content doesn't touch the animated border */
|
|
177
|
+
.ai-kit-actions {
|
|
178
|
+
display: flex;
|
|
179
|
+
width: 100%;
|
|
180
|
+
gap: var(--ai-kit-actions-gap, 8px);
|
|
181
|
+
justify-content: flex-end;
|
|
182
|
+
flex-wrap: wrap;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ai-kit-actions .mantine-Button-root {
|
|
186
|
+
flex: var(--ai-kit-actions-button-flex, 1 1 0);
|
|
187
|
+
min-width: var(--ai-kit-actions-button-min-width, 140px);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@media (max-width: var(--ai-kit-actions-breakpoint, 520px)) {
|
|
191
|
+
.ai-kit-actions {
|
|
192
|
+
flex-direction: column;
|
|
193
|
+
align-items: stretch;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ai-kit-actions .mantine-Button-root {
|
|
197
|
+
flex: 1 1 auto;
|
|
198
|
+
width: 100%;
|
|
199
|
+
min-width: 0;
|
|
200
|
+
}
|
|
201
|
+
}
|