highsoft-ui 1.0.10 → 1.0.12
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/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +23 -23
- package/dist/components/GPTInput/index.d.ts +2 -2
- package/dist/components/GPTInput/index.js +15 -15
- package/dist/components/Header/index.d.ts +10 -9
- package/dist/components/Header/index.js +135 -136
- package/dist/components/Logo/index.js +7 -9
- package/dist/components/Notification/index.d.ts +2 -2
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/PrefPanel/index.js +385 -386
- package/dist/highsoft-ui.css +1 -1
- package/dist/{index-CYCXI8lK.js → index-CcO3hfIY.js} +11 -11
- package/dist/main.js +1 -1
- package/dist/scss/variables.scss +9 -13
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +17 -10
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ElementType, ReactNode } from 'react';
|
|
2
|
-
export type ButtonVariant =
|
|
2
|
+
export type ButtonVariant = 'neutral' | 'white' | 'transparent' | 'plain' | 'brand' | 'success' | 'attention' | 'danger';
|
|
3
3
|
export type ButtonSize = 50 | 100 | 200 | 300 | 400 | 500;
|
|
4
4
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
children?: ReactNode;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
button:
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
const u = "_button_1we8s_285", z = "_neutral_1we8s_327", f = "_white_1we8s_351", p = "_transparent_1we8s_375", b = "_plain_1we8s_399", d = "_brand_1we8s_423", m = "_success_1we8s_447", g = "_attention_1we8s_471", h = "_danger_1we8s_495", x = "_full_1we8s_621", s = {
|
|
5
|
+
button: u,
|
|
6
6
|
neutral: z,
|
|
7
7
|
white: f,
|
|
8
8
|
transparent: p,
|
|
9
9
|
plain: b,
|
|
10
10
|
brand: d,
|
|
11
11
|
success: m,
|
|
12
|
-
attention:
|
|
13
|
-
danger:
|
|
14
|
-
"size-50": "_size-
|
|
15
|
-
"size-100": "_size-
|
|
16
|
-
"size-200": "_size-
|
|
17
|
-
"size-300": "_size-
|
|
18
|
-
"size-400": "_size-
|
|
19
|
-
"size-500": "_size-
|
|
20
|
-
full:
|
|
21
|
-
}, N =
|
|
12
|
+
attention: g,
|
|
13
|
+
danger: h,
|
|
14
|
+
"size-50": "_size-50_1we8s_519",
|
|
15
|
+
"size-100": "_size-100_1we8s_536",
|
|
16
|
+
"size-200": "_size-200_1we8s_553",
|
|
17
|
+
"size-300": "_size-300_1we8s_570",
|
|
18
|
+
"size-400": "_size-400_1we8s_587",
|
|
19
|
+
"size-500": "_size-500_1we8s_604",
|
|
20
|
+
full: x
|
|
21
|
+
}, N = w(
|
|
22
22
|
({
|
|
23
|
-
children:
|
|
24
|
-
variant:
|
|
25
|
-
size:
|
|
26
|
-
fullWidth:
|
|
23
|
+
children: e,
|
|
24
|
+
variant: t = "neutral",
|
|
25
|
+
size: _ = 200,
|
|
26
|
+
fullWidth: n = !1,
|
|
27
27
|
as: o = "button",
|
|
28
28
|
className: a,
|
|
29
29
|
...r
|
|
30
30
|
}, i) => /* @__PURE__ */ c(
|
|
31
31
|
o,
|
|
32
32
|
{
|
|
33
|
-
className:
|
|
33
|
+
className: l(
|
|
34
34
|
a,
|
|
35
35
|
s.button,
|
|
36
|
-
s[
|
|
37
|
-
s[`size-${
|
|
36
|
+
s[t],
|
|
37
|
+
s[`size-${_}`],
|
|
38
38
|
{
|
|
39
|
-
[s.full]:
|
|
39
|
+
[s.full]: n
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
42
|
ref: i,
|
|
43
43
|
...r,
|
|
44
|
-
children:
|
|
44
|
+
children: e
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
interface GPTButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?:
|
|
3
|
+
variant?: 'primary' | 'secondary';
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export default function GPTButton({ variant, className, children, ...props }: GPTButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function GPTInput({ autoFocus, onSubmit
|
|
7
|
+
export declare function GPTInput({ autoFocus, onSubmit }: {
|
|
8
8
|
autoFocus?: boolean;
|
|
9
9
|
onSubmit: (prompt: string) => void;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as y, useState as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
2
|
+
import { useRef as y, useState as b, useLayoutEffect as x } from "react";
|
|
3
|
+
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import g from "../icons/Bubble.js";
|
|
5
5
|
import C from "../icons/Plane.js";
|
|
6
|
-
const v = "
|
|
6
|
+
const v = "_inputContainer_h08to_285", S = "_bottomFade_h08to_288", K = "_inputWrap_h08to_291", P = "_textarea_h08to_294", N = "_button_h08to_360", W = "_primary_h08to_395", k = "_secondary_h08to_404", D = "_disclaimer_h08to_410", o = {
|
|
7
7
|
inputContainer: v,
|
|
8
8
|
bottomFade: S,
|
|
9
9
|
inputWrap: K,
|
|
@@ -22,7 +22,7 @@ function F({
|
|
|
22
22
|
return /* @__PURE__ */ n(
|
|
23
23
|
"button",
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
25
|
+
className: h(o.button, o[r], s),
|
|
26
26
|
...a,
|
|
27
27
|
children: /* @__PURE__ */ n("span", { children: e })
|
|
28
28
|
}
|
|
@@ -32,46 +32,46 @@ function I({
|
|
|
32
32
|
autoFocus: r,
|
|
33
33
|
onSubmit: s
|
|
34
34
|
}) {
|
|
35
|
-
const e = y(null), [a, i] =
|
|
36
|
-
|
|
35
|
+
const e = y(null), [a, i] = b(""), c = a.trim(), u = !!c;
|
|
36
|
+
x(() => {
|
|
37
37
|
var t;
|
|
38
38
|
r && ((t = e.current) == null || t.focus());
|
|
39
39
|
}, [r]);
|
|
40
40
|
const p = () => {
|
|
41
41
|
const t = e.current;
|
|
42
42
|
t && (t.style.height = "64px", t.style.height = `${t.scrollHeight + 4}px`);
|
|
43
|
-
},
|
|
43
|
+
}, _ = (t) => {
|
|
44
44
|
i(t.target.value), p();
|
|
45
45
|
}, m = (t) => {
|
|
46
46
|
t.preventDefault(), s(c), i(""), requestAnimationFrame(p);
|
|
47
|
-
},
|
|
47
|
+
}, d = (t) => {
|
|
48
48
|
t.key === "Enter" && !t.shiftKey && !t.ctrlKey && !t.metaKey && m(t);
|
|
49
|
-
},
|
|
49
|
+
}, f = () => {
|
|
50
50
|
var t;
|
|
51
51
|
(t = e.current) == null || t.focus();
|
|
52
52
|
};
|
|
53
53
|
return /* @__PURE__ */ l(
|
|
54
54
|
"form",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
onKeyDown:
|
|
56
|
+
className: h(o.inputWrap, { [o.active]: u }),
|
|
57
|
+
onKeyDown: d,
|
|
58
58
|
onSubmit: m,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */ n(
|
|
60
|
+
/* @__PURE__ */ n(g, {}),
|
|
61
61
|
/* @__PURE__ */ n(
|
|
62
62
|
"textarea",
|
|
63
63
|
{
|
|
64
64
|
className: o.textarea,
|
|
65
65
|
ref: e,
|
|
66
66
|
value: a,
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: _
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ l(
|
|
71
71
|
F,
|
|
72
72
|
{
|
|
73
73
|
variant: u ? "primary" : "secondary",
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: f,
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ n(C, {}),
|
|
77
77
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "Send message" })
|
|
@@ -5,22 +5,23 @@ export interface SubHeaderItem {
|
|
|
5
5
|
url: string;
|
|
6
6
|
icon?: ReactNode;
|
|
7
7
|
tag?: ReactNode;
|
|
8
|
-
tagVariant?:
|
|
8
|
+
tagVariant?: 'success' | 'brand';
|
|
9
9
|
link?: ElementType;
|
|
10
10
|
}
|
|
11
11
|
export declare function SubHeader({ items }: {
|
|
12
12
|
items: Array<SubHeaderItem>;
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export interface Notification {
|
|
15
|
+
id?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
variant?: NotificationVariant;
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
}
|
|
14
21
|
export declare function Header({ subItems, children, notifications: initialNotifications, // TODO: Fetch these from the internets
|
|
15
|
-
link: Link
|
|
22
|
+
link: Link }: {
|
|
16
23
|
subItems?: Array<SubHeaderItem>;
|
|
17
24
|
children?: ReactNode;
|
|
18
|
-
notifications?: Array<
|
|
19
|
-
id?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
variant?: NotificationVariant;
|
|
23
|
-
closable?: boolean;
|
|
24
|
-
}>;
|
|
25
|
+
notifications?: Array<Notification>;
|
|
25
26
|
link?: ElementType;
|
|
26
27
|
}): import("react/jsx-runtime").JSX.Element;
|