@asgard-js/react 0.0.43-canary.6 → 0.0.43-canary.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"api-key-input.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/api-key-input/api-key-input.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAe,EACf,KAAK,EACL,WAA8B,EAC9B,KAAiB,EACjB,UAAiB,EACjB,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAmGhC"}
1
+ {"version":3,"file":"api-key-input.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/api-key-input/api-key-input.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAe,EACf,KAAK,EACL,WAA8B,EAC9B,KAAiB,EACjB,UAAiB,EACjB,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAoGhC"}
package/dist/index.js CHANGED
@@ -36179,11 +36179,12 @@ function Xoe({
36179
36179
  showToggle: a = !0,
36180
36180
  className: o
36181
36181
  }) {
36182
- const [s, l] = gn(""), [u, c] = gn(!1), { chatbot: f } = pr(), { avatar: d } = Ci(), h = (g) => {
36183
- g.preventDefault(), s.trim() && !t && e(s.trim());
36184
- }, p = (g) => {
36185
- l(g.target.value);
36186
- }, m = () => {
36182
+ var y, b, v, w;
36183
+ const [s, l] = gn(""), [u, c] = gn(!1), { chatbot: f, template: d } = pr(), { avatar: h } = Ci(), p = (E) => {
36184
+ E.preventDefault(), s.trim() && !t && e(s.trim());
36185
+ }, m = (E) => {
36186
+ l(E.target.value);
36187
+ }, g = () => {
36187
36188
  c(!u);
36188
36189
  };
36189
36190
  return /* @__PURE__ */ ot(
@@ -36196,10 +36197,10 @@ function Xoe({
36196
36197
  },
36197
36198
  children: [
36198
36199
  /* @__PURE__ */ ot("div", { className: yr.header, children: [
36199
- /* @__PURE__ */ Q(zF, { avatar: d }),
36200
- /* @__PURE__ */ Q("h2", { className: yr.title, children: i })
36200
+ /* @__PURE__ */ Q(zF, { avatar: h }),
36201
+ /* @__PURE__ */ Q("h2", { className: yr.title, style: (b = (y = f == null ? void 0 : f.header) == null ? void 0 : y.title) == null ? void 0 : b.style, children: i })
36201
36202
  ] }),
36202
- /* @__PURE__ */ ot("form", { onSubmit: h, className: yr.form, children: [
36203
+ /* @__PURE__ */ ot("form", { onSubmit: p, className: yr.form, children: [
36203
36204
  /* @__PURE__ */ ot("div", { className: yr.inputGroup, children: [
36204
36205
  /* @__PURE__ */ Q("label", { className: yr.label, children: "Key" }),
36205
36206
  /* @__PURE__ */ ot("div", { className: yr.inputWrapper, children: [
@@ -36208,7 +36209,7 @@ function Xoe({
36208
36209
  {
36209
36210
  type: u ? "text" : "password",
36210
36211
  value: s,
36211
- onChange: p,
36212
+ onChange: m,
36212
36213
  placeholder: r,
36213
36214
  className: qt(yr.input, {
36214
36215
  [yr.error]: n,
@@ -36222,7 +36223,7 @@ function Xoe({
36222
36223
  "button",
36223
36224
  {
36224
36225
  type: "button",
36225
- onClick: m,
36226
+ onClick: g,
36226
36227
  className: yr.toggleButton,
36227
36228
  disabled: t,
36228
36229
  "aria-label": u ? "Hide password" : "Show password",
@@ -36260,6 +36261,7 @@ function Xoe({
36260
36261
  className: qt(yr.submitButton, {
36261
36262
  [yr.loading]: t
36262
36263
  }),
36264
+ style: ((w = (v = d == null ? void 0 : d.ButtonMessageTemplate) == null ? void 0 : v.button) == null ? void 0 : w.style) ?? {},
36263
36265
  children: t ? "Loading..." : "Continue"
36264
36266
  }
36265
36267
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgard-js/react",
3
- "version": "0.0.43-canary.6",
3
+ "version": "0.0.43-canary.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,7 +26,7 @@ export function ApiKeyInput({
26
26
  }: ApiKeyInputProps): JSX.Element {
27
27
  const [apiKey, setApiKey] = useState('');
28
28
  const [showPassword, setShowPassword] = useState(false);
29
- const { chatbot } = useAsgardThemeContext();
29
+ const { chatbot, template: themeTemplate } = useAsgardThemeContext();
30
30
  const { avatar } = useAsgardContext();
31
31
 
32
32
  const handleSubmit = (e: FormEvent): void => {
@@ -54,7 +54,7 @@ export function ApiKeyInput({
54
54
  >
55
55
  <div className={styles.header}>
56
56
  <ProfileIcon avatar={avatar} />
57
- <h2 className={styles.title}>{title}</h2>
57
+ <h2 className={styles.title} style={chatbot?.header?.title?.style}>{title}</h2>
58
58
  </div>
59
59
 
60
60
  <form onSubmit={handleSubmit} className={styles.form}>
@@ -116,6 +116,7 @@ export function ApiKeyInput({
116
116
  className={clsx(styles.submitButton, {
117
117
  [styles.loading]: loading,
118
118
  })}
119
+ style={themeTemplate?.ButtonMessageTemplate?.button?.style ?? {}}
119
120
  >
120
121
  {loading ? 'Loading...' : 'Continue'}
121
122
  </button>