@pcoi/components 0.1.1 → 0.1.2
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.css +1 -1
- package/dist/index.d.ts +45 -7
- package/dist/index.js +2 -2
- package/dist/index.mjs +495 -470
- package/package.json +3 -3
- package/src/Callout/Callout.css +5 -0
- package/src/Callout/Callout.tsx +14 -10
- package/src/ChatInterface/ChatInterface.css +1 -0
- package/src/ChatInterface/ChatInterface.integration.test.tsx +1 -1
- package/src/ChatInterface/ChatInterface.tsx +6 -1
- package/src/ChatMessageList/ChatMessageList.test.tsx +9 -13
- package/src/ChatMessageList/ChatMessageList.tsx +7 -2
- package/src/CitedExcerpt/CitedExcerpt.tsx +2 -0
- package/src/ComparisonTable/ComparisonTable.tsx +6 -0
- package/src/ContactForm/ContactForm.tsx +1 -0
- package/src/DocumentOverlay/DocumentOverlay.tsx +2 -1
- package/src/Footer/Footer.tsx +5 -2
- package/src/LogoMark/LogoMark.tsx +2 -2
- package/src/Modal/Modal.tsx +100 -95
- package/src/Nav/Nav.tsx +6 -2
- package/src/SignalsPanel/SignalsPanel.tsx +2 -0
- package/src/Toast/Toast.tsx +49 -44
- package/src/TypingIndicator/TypingIndicator.tsx +2 -2
- package/src/index.ts +2 -0
- package/src/styles.css +1 -0
- package/src/types.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import _, { useState as
|
|
3
|
-
import { ChevronDownIcon as
|
|
2
|
+
import _, { useState as x, useEffect as y, useRef as w, useCallback as $ } from "react";
|
|
3
|
+
import { ChevronDownIcon as z, CloseIcon as E, ArrowRightIcon as Y } from "@pcoi/icons";
|
|
4
4
|
import { createPortal as F } from "react-dom";
|
|
5
5
|
const I = _.forwardRef(
|
|
6
|
-
({ href:
|
|
7
|
-
/* @__PURE__ */ e("span", { className: "pcoi-logo__mark", children: "P" }),
|
|
6
|
+
({ href: i = "#", className: l = "", ...a }, o) => /* @__PURE__ */ n("a", { ref: o, href: i, className: `pcoi-logo ${l}`, "aria-label": "PCOI home", ...a, children: [
|
|
7
|
+
/* @__PURE__ */ e("span", { className: "pcoi-logo__mark", "aria-hidden": "true", children: "P" }),
|
|
8
8
|
"COI"
|
|
9
9
|
] })
|
|
10
10
|
);
|
|
11
11
|
I.displayName = "LogoMark";
|
|
12
|
-
const
|
|
13
|
-
({ variant:
|
|
12
|
+
const k = _.forwardRef(
|
|
13
|
+
({ variant: i = "primary", size: l = "default", children: a, className: o = "", ...c }, s) => {
|
|
14
14
|
const r = [
|
|
15
15
|
"pcoi-btn",
|
|
16
|
-
`pcoi-btn--${
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
`pcoi-btn--${i}`,
|
|
17
|
+
l !== "default" ? `pcoi-btn--${l}` : "",
|
|
18
|
+
o
|
|
19
19
|
].filter(Boolean).join(" ");
|
|
20
|
-
return /* @__PURE__ */ e("button", { ref: s, className: r, ...
|
|
20
|
+
return /* @__PURE__ */ e("button", { ref: s, className: r, ...c, children: a });
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
|
-
|
|
23
|
+
k.displayName = "Button";
|
|
24
24
|
const g = _.forwardRef(
|
|
25
25
|
({
|
|
26
|
-
label:
|
|
27
|
-
name:
|
|
26
|
+
label: i,
|
|
27
|
+
name: l,
|
|
28
28
|
multiline: a = !1,
|
|
29
|
-
rows:
|
|
30
|
-
error:
|
|
29
|
+
rows: o = 3,
|
|
30
|
+
error: c,
|
|
31
31
|
required: s = !1,
|
|
32
32
|
disabled: r = !1,
|
|
33
|
-
className:
|
|
33
|
+
className: d = "",
|
|
34
34
|
...p
|
|
35
|
-
},
|
|
36
|
-
const h = `pcoi-field-${
|
|
35
|
+
}, t) => {
|
|
36
|
+
const h = `pcoi-field-${l}`, m = c ? `${h}-error` : void 0, N = [
|
|
37
37
|
"pcoi-field",
|
|
38
|
-
|
|
38
|
+
c ? "pcoi-field--error" : "",
|
|
39
39
|
r ? "pcoi-field--disabled" : "",
|
|
40
|
-
|
|
40
|
+
d
|
|
41
41
|
].filter(Boolean).join(" ");
|
|
42
|
-
return /* @__PURE__ */ n("div", { className:
|
|
42
|
+
return /* @__PURE__ */ n("div", { className: N, children: [
|
|
43
43
|
/* @__PURE__ */ n("label", { htmlFor: h, className: "pcoi-field__label", children: [
|
|
44
|
-
|
|
44
|
+
i,
|
|
45
45
|
s && /* @__PURE__ */ e("span", { className: "pcoi-field__required", "aria-hidden": "true", children: "*" })
|
|
46
46
|
] }),
|
|
47
47
|
a ? /* @__PURE__ */ e(
|
|
48
48
|
"textarea",
|
|
49
49
|
{
|
|
50
|
-
ref:
|
|
50
|
+
ref: t,
|
|
51
51
|
id: h,
|
|
52
|
-
name:
|
|
53
|
-
rows:
|
|
52
|
+
name: l,
|
|
53
|
+
rows: o,
|
|
54
54
|
required: s,
|
|
55
55
|
disabled: r,
|
|
56
|
-
"aria-invalid": !!
|
|
56
|
+
"aria-invalid": !!c,
|
|
57
57
|
"aria-describedby": m,
|
|
58
58
|
className: "pcoi-field__textarea",
|
|
59
59
|
...p
|
|
@@ -61,83 +61,83 @@ const g = _.forwardRef(
|
|
|
61
61
|
) : /* @__PURE__ */ e(
|
|
62
62
|
"input",
|
|
63
63
|
{
|
|
64
|
-
ref:
|
|
64
|
+
ref: t,
|
|
65
65
|
id: h,
|
|
66
|
-
name:
|
|
66
|
+
name: l,
|
|
67
67
|
required: s,
|
|
68
68
|
disabled: r,
|
|
69
|
-
"aria-invalid": !!
|
|
69
|
+
"aria-invalid": !!c,
|
|
70
70
|
"aria-describedby": m,
|
|
71
71
|
className: "pcoi-field__input",
|
|
72
72
|
...p
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
|
|
75
|
+
c && /* @__PURE__ */ e("span", { id: m, className: "pcoi-field__error", role: "alert", children: c })
|
|
76
76
|
] });
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
g.displayName = "FormField";
|
|
80
|
-
const
|
|
81
|
-
({ variant:
|
|
82
|
-
const
|
|
80
|
+
const V = _.forwardRef(
|
|
81
|
+
({ variant: i = "problem", title: l, description: a, icon: o, number: c, headingLevel: s = "h3", className: r = "", ...d }, p) => {
|
|
82
|
+
const t = s, h = [
|
|
83
83
|
"pcoi-card",
|
|
84
|
-
`pcoi-card--${
|
|
84
|
+
`pcoi-card--${i}`,
|
|
85
85
|
r
|
|
86
86
|
].filter(Boolean).join(" ");
|
|
87
|
-
return /* @__PURE__ */ n("div", { ref: p, className: h, ...
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/* @__PURE__ */ e(
|
|
87
|
+
return /* @__PURE__ */ n("div", { ref: p, className: h, ...d, children: [
|
|
88
|
+
i === "problem" && o && /* @__PURE__ */ e("div", { className: "pcoi-card__icon", children: o }),
|
|
89
|
+
i === "principle" && c && /* @__PURE__ */ e("div", { className: "pcoi-card__number", children: c }),
|
|
90
|
+
/* @__PURE__ */ e(t, { className: "pcoi-card__title", children: l }),
|
|
91
91
|
/* @__PURE__ */ e("p", { className: "pcoi-card__description", children: a })
|
|
92
92
|
] });
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
|
|
95
|
+
V.displayName = "Card";
|
|
96
96
|
const W = _.forwardRef(
|
|
97
97
|
({
|
|
98
|
-
links:
|
|
98
|
+
links: i = [
|
|
99
99
|
{ label: "Problem", href: "#problem" },
|
|
100
100
|
{ label: "How It Works", href: "#how-it-works" },
|
|
101
101
|
{ label: "Difference", href: "#difference" },
|
|
102
102
|
{ label: "Who It's For", href: "#who" }
|
|
103
103
|
],
|
|
104
|
-
ctaLabel:
|
|
104
|
+
ctaLabel: l = "Start a Conversation",
|
|
105
105
|
ctaHref: a = "#contact",
|
|
106
|
-
onCtaClick:
|
|
107
|
-
className:
|
|
106
|
+
onCtaClick: o,
|
|
107
|
+
className: c = "",
|
|
108
108
|
...s
|
|
109
109
|
}, r) => {
|
|
110
|
-
const [
|
|
110
|
+
const [d, p] = x(!1), [t, h] = x(!1);
|
|
111
111
|
return y(() => {
|
|
112
112
|
const m = () => p(window.scrollY > 40);
|
|
113
113
|
return window.addEventListener("scroll", m, { passive: !0 }), m(), () => window.removeEventListener("scroll", m);
|
|
114
114
|
}, []), y(() => {
|
|
115
|
-
if (!
|
|
116
|
-
const m = (
|
|
117
|
-
|
|
115
|
+
if (!t) return;
|
|
116
|
+
const m = (N) => {
|
|
117
|
+
N.key === "Escape" && h(!1);
|
|
118
118
|
};
|
|
119
119
|
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
120
|
-
}, [
|
|
120
|
+
}, [t]), /* @__PURE__ */ n(
|
|
121
121
|
"nav",
|
|
122
122
|
{
|
|
123
123
|
ref: r,
|
|
124
|
-
className: `pcoi-nav ${
|
|
124
|
+
className: `pcoi-nav ${d ? "pcoi-nav--scrolled" : ""} ${t ? "pcoi-nav--menu-open" : ""} ${c}`,
|
|
125
125
|
"aria-label": "Main",
|
|
126
126
|
...s,
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ n("div", { className: "pcoi-nav__inner", children: [
|
|
129
129
|
/* @__PURE__ */ e(I, {}),
|
|
130
130
|
/* @__PURE__ */ n("div", { className: "pcoi-nav__links", children: [
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */ e("a", { href: a, children: /* @__PURE__ */ e(
|
|
131
|
+
i.map((m) => /* @__PURE__ */ e("a", { href: m.href, "data-track-id": m.trackingId, children: m.label }, m.href)),
|
|
132
|
+
/* @__PURE__ */ e("a", { href: a, children: /* @__PURE__ */ e(k, { variant: "nav-cta", onClick: o, children: l }) })
|
|
133
133
|
] }),
|
|
134
134
|
/* @__PURE__ */ n(
|
|
135
135
|
"button",
|
|
136
136
|
{
|
|
137
|
-
className: `pcoi-nav__hamburger ${
|
|
138
|
-
onClick: () => h(!
|
|
137
|
+
className: `pcoi-nav__hamburger ${t ? "pcoi-nav__hamburger--active" : ""}`,
|
|
138
|
+
onClick: () => h(!t),
|
|
139
139
|
"aria-label": "Toggle menu",
|
|
140
|
-
"aria-expanded":
|
|
140
|
+
"aria-expanded": t,
|
|
141
141
|
"aria-controls": "pcoi-mobile-menu",
|
|
142
142
|
children: [
|
|
143
143
|
/* @__PURE__ */ e("span", {}),
|
|
@@ -147,11 +147,11 @@ const W = _.forwardRef(
|
|
|
147
147
|
}
|
|
148
148
|
)
|
|
149
149
|
] }),
|
|
150
|
-
/* @__PURE__ */ n("div", { className: "pcoi-nav__mobile-menu", id: "pcoi-mobile-menu", children: [
|
|
151
|
-
|
|
152
|
-
/* @__PURE__ */ e("a", { href: a, children: /* @__PURE__ */ e(
|
|
153
|
-
|
|
154
|
-
}, children:
|
|
150
|
+
/* @__PURE__ */ n("div", { className: "pcoi-nav__mobile-menu", id: "pcoi-mobile-menu", role: "menu", "aria-hidden": !t, children: [
|
|
151
|
+
i.map((m) => /* @__PURE__ */ e("a", { href: m.href, "data-track-id": m.trackingId, role: "menuitem", tabIndex: t ? 0 : -1, onClick: () => h(!1), children: m.label }, m.href)),
|
|
152
|
+
/* @__PURE__ */ e("a", { href: a, children: /* @__PURE__ */ e(k, { variant: "nav-cta", onClick: () => {
|
|
153
|
+
o == null || o(), h(!1);
|
|
154
|
+
}, children: l }) })
|
|
155
155
|
] })
|
|
156
156
|
]
|
|
157
157
|
}
|
|
@@ -160,55 +160,55 @@ const W = _.forwardRef(
|
|
|
160
160
|
);
|
|
161
161
|
W.displayName = "Nav";
|
|
162
162
|
const K = _.forwardRef(
|
|
163
|
-
({ label:
|
|
164
|
-
const p =
|
|
165
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
166
|
-
/* @__PURE__ */ e("span", { className: "pcoi-section-header__label", children:
|
|
163
|
+
({ label: i, title: l, titleEmphasis: a, description: o, headingLevel: c = "h2", className: s = "", ...r }, d) => {
|
|
164
|
+
const p = c;
|
|
165
|
+
return /* @__PURE__ */ n("div", { ref: d, className: `pcoi-section-header ${s}`, ...r, children: [
|
|
166
|
+
/* @__PURE__ */ e("span", { className: "pcoi-section-header__label", children: i }),
|
|
167
167
|
/* @__PURE__ */ e(p, { className: "pcoi-section-header__title", children: a ? /* @__PURE__ */ n(j, { children: [
|
|
168
|
-
|
|
168
|
+
l.replace(a, ""),
|
|
169
169
|
/* @__PURE__ */ e("em", { children: a })
|
|
170
|
-
] }) :
|
|
171
|
-
|
|
170
|
+
] }) : l }),
|
|
171
|
+
o && /* @__PURE__ */ e("p", { className: "pcoi-section-header__desc", children: o })
|
|
172
172
|
] });
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
175
|
K.displayName = "SectionHeader";
|
|
176
|
-
const
|
|
177
|
-
({ number:
|
|
178
|
-
const p =
|
|
179
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
180
|
-
/* @__PURE__ */ e("div", { className: "pcoi-how-step__number", children:
|
|
176
|
+
const G = _.forwardRef(
|
|
177
|
+
({ number: i, title: l, description: a, isLast: o = !1, headingLevel: c = "h3", className: s = "", ...r }, d) => {
|
|
178
|
+
const p = c;
|
|
179
|
+
return /* @__PURE__ */ n("div", { ref: d, className: `pcoi-how-step ${o ? "pcoi-how-step--last" : ""} ${s}`, ...r, children: [
|
|
180
|
+
/* @__PURE__ */ e("div", { className: "pcoi-how-step__number", children: i }),
|
|
181
181
|
/* @__PURE__ */ n("div", { className: "pcoi-how-step__content", children: [
|
|
182
|
-
/* @__PURE__ */ e(p, { className: "pcoi-how-step__title", children:
|
|
182
|
+
/* @__PURE__ */ e(p, { className: "pcoi-how-step__title", children: l }),
|
|
183
183
|
/* @__PURE__ */ e("p", { className: "pcoi-how-step__desc", children: a })
|
|
184
184
|
] })
|
|
185
185
|
] });
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
({ competitorName:
|
|
188
|
+
G.displayName = "HowStep";
|
|
189
|
+
const J = _.forwardRef(
|
|
190
|
+
({ competitorName: i = "Typical SaaS AI", pcoiName: l = "PCOI", rows: a, className: o = "", ...c }, s) => /* @__PURE__ */ e("div", { ref: s, className: `pcoi-comparison ${o}`, ...c, children: /* @__PURE__ */ n("table", { className: "pcoi-comparison__table", children: [
|
|
191
191
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "pcoi-comparison__header", children: [
|
|
192
192
|
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col", scope: "col", children: /* @__PURE__ */ e("span", { className: "pcoi-sr-only", children: "Feature" }) }),
|
|
193
|
-
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col", scope: "col", children:
|
|
194
|
-
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col pcoi-comparison__col--highlight", scope: "col", children:
|
|
193
|
+
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col", scope: "col", children: i }),
|
|
194
|
+
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col pcoi-comparison__col--highlight", scope: "col", children: l })
|
|
195
195
|
] }) }),
|
|
196
|
-
/* @__PURE__ */ e("tbody", { children: a.map((r,
|
|
196
|
+
/* @__PURE__ */ e("tbody", { children: a.map((r, d) => /* @__PURE__ */ n("tr", { className: "pcoi-comparison__row", children: [
|
|
197
197
|
/* @__PURE__ */ e("th", { className: "pcoi-comparison__col pcoi-comparison__col--label", scope: "row", children: r.label }),
|
|
198
198
|
/* @__PURE__ */ e("td", { className: "pcoi-comparison__col", children: r.competitor }),
|
|
199
199
|
/* @__PURE__ */ e("td", { className: "pcoi-comparison__col pcoi-comparison__col--highlight", children: r.pcoi })
|
|
200
|
-
] },
|
|
200
|
+
] }, d)) })
|
|
201
201
|
] }) })
|
|
202
202
|
);
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
({ onSubmit:
|
|
206
|
-
const [
|
|
207
|
-
|
|
208
|
-
const p =
|
|
209
|
-
|
|
203
|
+
J.displayName = "ComparisonTable";
|
|
204
|
+
const Q = _.forwardRef(
|
|
205
|
+
({ onSubmit: i, className: l = "", ...a }, o) => {
|
|
206
|
+
const [c, s] = x(!1), r = (d) => {
|
|
207
|
+
d.preventDefault();
|
|
208
|
+
const p = d.currentTarget, t = new FormData(p), h = Object.fromEntries(t.entries());
|
|
209
|
+
i == null || i(h), s(!0), p.reset(), setTimeout(() => s(!1), 3e3);
|
|
210
210
|
};
|
|
211
|
-
return /* @__PURE__ */ n("form", { ref:
|
|
211
|
+
return /* @__PURE__ */ n("form", { ref: o, className: `pcoi-form ${l}`, onSubmit: r, "aria-label": "Contact form", ...a, children: [
|
|
212
212
|
/* @__PURE__ */ n("div", { className: "pcoi-form__row", children: [
|
|
213
213
|
/* @__PURE__ */ e(g, { label: "Name", name: "name", placeholder: "Your name", required: !0 }),
|
|
214
214
|
/* @__PURE__ */ e(g, { label: "Company", name: "company", placeholder: "Company name", required: !0 })
|
|
@@ -228,43 +228,43 @@ const J = _.forwardRef(
|
|
|
228
228
|
className: "pcoi-form__full"
|
|
229
229
|
}
|
|
230
230
|
),
|
|
231
|
-
/* @__PURE__ */ e(
|
|
231
|
+
/* @__PURE__ */ e(k, { type: "submit", variant: "primary", size: "large", disabled: c, children: c ? "Message Received" : "Start the Conversation" }),
|
|
232
232
|
/* @__PURE__ */ e("p", { className: "pcoi-form__note", children: "No sales automation. A real person reads this and responds personally." })
|
|
233
233
|
] });
|
|
234
234
|
}
|
|
235
235
|
);
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
({ quote:
|
|
239
|
-
/* @__PURE__ */ e("div", { className: "pcoi-callout__line" }),
|
|
240
|
-
/* @__PURE__ */ e("
|
|
241
|
-
(
|
|
236
|
+
Q.displayName = "ContactForm";
|
|
237
|
+
const X = _.forwardRef(
|
|
238
|
+
({ quote: i, attribution: l, attributionTitle: a, sourceUrl: o, sourceLabel: c, className: s = "", ...r }, d) => /* @__PURE__ */ n("figure", { ref: d, className: `pcoi-callout ${s}`, ...r, children: [
|
|
239
|
+
/* @__PURE__ */ e("div", { className: "pcoi-callout__line", "aria-hidden": "true" }),
|
|
240
|
+
/* @__PURE__ */ e("blockquote", { className: "pcoi-callout__quote", children: /* @__PURE__ */ e("p", { children: i }) }),
|
|
241
|
+
(l || o) && /* @__PURE__ */ n("figcaption", { className: "pcoi-callout__attribution", children: [
|
|
242
242
|
a && /* @__PURE__ */ n("span", { children: [
|
|
243
243
|
a,
|
|
244
244
|
" ~ "
|
|
245
245
|
] }),
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
l,
|
|
247
|
+
o && /* @__PURE__ */ n(j, { children: [
|
|
248
248
|
" | ",
|
|
249
|
-
/* @__PURE__ */ e("a", { href:
|
|
249
|
+
/* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", children: c || "Source" })
|
|
250
250
|
] })
|
|
251
251
|
] })
|
|
252
252
|
] })
|
|
253
253
|
);
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
({ title:
|
|
254
|
+
X.displayName = "Callout";
|
|
255
|
+
const Z = _.forwardRef(
|
|
256
|
+
({ title: i = "You'll know this is for you if:", signals: l, headingLevel: a = "h3", className: o = "", ...c }, s) => {
|
|
257
257
|
const r = a;
|
|
258
|
-
return /* @__PURE__ */ n("div", { ref: s, className: `pcoi-signals ${
|
|
259
|
-
/* @__PURE__ */ e(r, { className: "pcoi-signals__title", children:
|
|
260
|
-
/* @__PURE__ */ e("ul", { className: "pcoi-signals__list", children:
|
|
258
|
+
return /* @__PURE__ */ n("div", { ref: s, className: `pcoi-signals ${o}`, ...c, children: [
|
|
259
|
+
/* @__PURE__ */ e(r, { className: "pcoi-signals__title", children: i }),
|
|
260
|
+
/* @__PURE__ */ e("ul", { className: "pcoi-signals__list", children: l.map((d, p) => /* @__PURE__ */ e("li", { className: "pcoi-signals__item", children: d }, p)) })
|
|
261
261
|
] });
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
|
-
|
|
265
|
-
const
|
|
264
|
+
Z.displayName = "SignalsPanel";
|
|
265
|
+
const U = _.forwardRef(
|
|
266
266
|
({
|
|
267
|
-
links:
|
|
267
|
+
links: i = [
|
|
268
268
|
{ label: "Problem", href: "#problem" },
|
|
269
269
|
{ label: "How It Works", href: "#how-it-works" },
|
|
270
270
|
{ label: "Difference", href: "#difference" },
|
|
@@ -272,98 +272,98 @@ const Z = _.forwardRef(
|
|
|
272
272
|
{ label: "Who It's For", href: "#who" },
|
|
273
273
|
{ label: "Contact", href: "#contact" }
|
|
274
274
|
],
|
|
275
|
-
tagline:
|
|
275
|
+
tagline: l = `Portable, Company-Owned
|
|
276
276
|
Operational Intelligence`,
|
|
277
277
|
copyright: a = `© ${(/* @__PURE__ */ new Date()).getFullYear()} PCOI. Operational intelligence you own.`,
|
|
278
|
-
className:
|
|
279
|
-
...
|
|
280
|
-
}, s) => /* @__PURE__ */ n("footer", { ref: s, className: `pcoi-footer ${
|
|
278
|
+
className: o = "",
|
|
279
|
+
...c
|
|
280
|
+
}, s) => /* @__PURE__ */ n("footer", { ref: s, className: `pcoi-footer ${o}`, ...c, children: [
|
|
281
281
|
/* @__PURE__ */ n("div", { className: "pcoi-footer__inner", children: [
|
|
282
282
|
/* @__PURE__ */ n("div", { className: "pcoi-footer__brand", children: [
|
|
283
283
|
/* @__PURE__ */ e(I, { className: "pcoi-footer__logo" }),
|
|
284
|
-
/* @__PURE__ */ e("p", { className: "pcoi-footer__tagline", children:
|
|
284
|
+
/* @__PURE__ */ e("p", { className: "pcoi-footer__tagline", children: l })
|
|
285
285
|
] }),
|
|
286
|
-
/* @__PURE__ */ e("
|
|
286
|
+
/* @__PURE__ */ e("nav", { className: "pcoi-footer__links", "aria-label": "Footer", children: i.map((r) => /* @__PURE__ */ e("a", { href: r.href, "data-track-id": r.trackingId, children: r.label }, r.href)) })
|
|
287
287
|
] }),
|
|
288
288
|
/* @__PURE__ */ e("div", { className: "pcoi-footer__bottom", children: /* @__PURE__ */ e("p", { children: a }) })
|
|
289
289
|
] })
|
|
290
290
|
);
|
|
291
|
-
|
|
292
|
-
const
|
|
291
|
+
U.displayName = "Footer";
|
|
292
|
+
const ee = _.forwardRef(
|
|
293
293
|
({
|
|
294
|
-
label:
|
|
295
|
-
name:
|
|
294
|
+
label: i,
|
|
295
|
+
name: l,
|
|
296
296
|
options: a,
|
|
297
|
-
placeholder:
|
|
298
|
-
error:
|
|
297
|
+
placeholder: o,
|
|
298
|
+
error: c,
|
|
299
299
|
required: s = !1,
|
|
300
300
|
disabled: r = !1,
|
|
301
|
-
className:
|
|
301
|
+
className: d = "",
|
|
302
302
|
...p
|
|
303
|
-
},
|
|
304
|
-
const h = `pcoi-field-${
|
|
303
|
+
}, t) => {
|
|
304
|
+
const h = `pcoi-field-${l}`, m = c ? `${h}-error` : void 0, N = [
|
|
305
305
|
"pcoi-select",
|
|
306
|
-
|
|
306
|
+
c ? "pcoi-select--error" : "",
|
|
307
307
|
r ? "pcoi-select--disabled" : "",
|
|
308
|
-
|
|
308
|
+
d
|
|
309
309
|
].filter(Boolean).join(" ");
|
|
310
|
-
return /* @__PURE__ */ n("div", { className:
|
|
310
|
+
return /* @__PURE__ */ n("div", { className: N, children: [
|
|
311
311
|
/* @__PURE__ */ n("label", { htmlFor: h, className: "pcoi-select__label", children: [
|
|
312
|
-
|
|
312
|
+
i,
|
|
313
313
|
s && /* @__PURE__ */ e("span", { className: "pcoi-select__required", "aria-hidden": "true", children: "*" })
|
|
314
314
|
] }),
|
|
315
315
|
/* @__PURE__ */ n("div", { className: "pcoi-select__wrapper", children: [
|
|
316
316
|
/* @__PURE__ */ n(
|
|
317
317
|
"select",
|
|
318
318
|
{
|
|
319
|
-
ref:
|
|
319
|
+
ref: t,
|
|
320
320
|
id: h,
|
|
321
|
-
name:
|
|
321
|
+
name: l,
|
|
322
322
|
required: s,
|
|
323
323
|
disabled: r,
|
|
324
|
-
"aria-invalid": !!
|
|
324
|
+
"aria-invalid": !!c,
|
|
325
325
|
"aria-describedby": m,
|
|
326
326
|
className: "pcoi-select__native",
|
|
327
|
-
defaultValue:
|
|
327
|
+
defaultValue: o ? "" : void 0,
|
|
328
328
|
...p,
|
|
329
329
|
children: [
|
|
330
|
-
|
|
330
|
+
o && /* @__PURE__ */ e("option", { value: "", disabled: !0, hidden: !0, children: o }),
|
|
331
331
|
a.map((f) => /* @__PURE__ */ e("option", { value: f.value, disabled: f.disabled, children: f.label }, f.value))
|
|
332
332
|
]
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
|
-
/* @__PURE__ */ e("span", { className: "pcoi-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
335
|
+
/* @__PURE__ */ e("span", { className: "pcoi-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(z, { size: 16 }) })
|
|
336
336
|
] }),
|
|
337
|
-
|
|
337
|
+
c && /* @__PURE__ */ e("span", { id: m, className: "pcoi-select__error", role: "alert", children: c })
|
|
338
338
|
] });
|
|
339
339
|
}
|
|
340
340
|
);
|
|
341
|
-
|
|
342
|
-
const
|
|
341
|
+
ee.displayName = "Select";
|
|
342
|
+
const ae = _.forwardRef(
|
|
343
343
|
({
|
|
344
|
-
label:
|
|
345
|
-
name:
|
|
344
|
+
label: i,
|
|
345
|
+
name: l,
|
|
346
346
|
error: a,
|
|
347
|
-
disabled:
|
|
348
|
-
className:
|
|
347
|
+
disabled: o = !1,
|
|
348
|
+
className: c = "",
|
|
349
349
|
...s
|
|
350
350
|
}, r) => {
|
|
351
|
-
const
|
|
351
|
+
const d = `pcoi-field-${l}`, p = a ? `${d}-error` : void 0, t = [
|
|
352
352
|
"pcoi-checkbox",
|
|
353
353
|
a ? "pcoi-checkbox--error" : "",
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
o ? "pcoi-checkbox--disabled" : "",
|
|
355
|
+
c
|
|
356
356
|
].filter(Boolean).join(" ");
|
|
357
|
-
return /* @__PURE__ */ n("div", { className:
|
|
358
|
-
/* @__PURE__ */ n("label", { htmlFor:
|
|
357
|
+
return /* @__PURE__ */ n("div", { className: t, children: [
|
|
358
|
+
/* @__PURE__ */ n("label", { htmlFor: d, className: "pcoi-checkbox__control", children: [
|
|
359
359
|
/* @__PURE__ */ e(
|
|
360
360
|
"input",
|
|
361
361
|
{
|
|
362
362
|
ref: r,
|
|
363
363
|
type: "checkbox",
|
|
364
|
-
id:
|
|
365
|
-
name:
|
|
366
|
-
disabled:
|
|
364
|
+
id: d,
|
|
365
|
+
name: l,
|
|
366
|
+
disabled: o,
|
|
367
367
|
"aria-invalid": !!a,
|
|
368
368
|
"aria-describedby": p,
|
|
369
369
|
className: "pcoi-checkbox__input",
|
|
@@ -371,38 +371,38 @@ const ee = _.forwardRef(
|
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
373
|
/* @__PURE__ */ e("span", { className: "pcoi-checkbox__box", "aria-hidden": "true" }),
|
|
374
|
-
/* @__PURE__ */ e("span", { className: "pcoi-checkbox__label", children:
|
|
374
|
+
/* @__PURE__ */ e("span", { className: "pcoi-checkbox__label", children: i })
|
|
375
375
|
] }),
|
|
376
376
|
a && /* @__PURE__ */ e("span", { id: p, className: "pcoi-checkbox__error", role: "alert", children: a })
|
|
377
377
|
] });
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
|
-
|
|
381
|
-
const
|
|
380
|
+
ae.displayName = "Checkbox";
|
|
381
|
+
const ie = _.forwardRef(
|
|
382
382
|
({
|
|
383
|
-
label:
|
|
384
|
-
name:
|
|
383
|
+
label: i,
|
|
384
|
+
name: l,
|
|
385
385
|
error: a,
|
|
386
|
-
disabled:
|
|
387
|
-
className:
|
|
386
|
+
disabled: o = !1,
|
|
387
|
+
className: c = "",
|
|
388
388
|
...s
|
|
389
389
|
}, r) => {
|
|
390
|
-
const
|
|
390
|
+
const d = `pcoi-field-${l}`, p = a ? `${d}-error` : void 0, t = [
|
|
391
391
|
"pcoi-toggle",
|
|
392
392
|
a ? "pcoi-toggle--error" : "",
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
o ? "pcoi-toggle--disabled" : "",
|
|
394
|
+
c
|
|
395
395
|
].filter(Boolean).join(" ");
|
|
396
|
-
return /* @__PURE__ */ n("div", { className:
|
|
397
|
-
/* @__PURE__ */ n("label", { htmlFor:
|
|
396
|
+
return /* @__PURE__ */ n("div", { className: t, children: [
|
|
397
|
+
/* @__PURE__ */ n("label", { htmlFor: d, className: "pcoi-toggle__control", children: [
|
|
398
398
|
/* @__PURE__ */ e(
|
|
399
399
|
"input",
|
|
400
400
|
{
|
|
401
401
|
ref: r,
|
|
402
402
|
type: "checkbox",
|
|
403
|
-
id:
|
|
404
|
-
name:
|
|
405
|
-
disabled:
|
|
403
|
+
id: d,
|
|
404
|
+
name: l,
|
|
405
|
+
disabled: o,
|
|
406
406
|
"aria-invalid": !!a,
|
|
407
407
|
"aria-describedby": p,
|
|
408
408
|
className: "pcoi-toggle__input",
|
|
@@ -411,302 +411,323 @@ const ae = _.forwardRef(
|
|
|
411
411
|
}
|
|
412
412
|
),
|
|
413
413
|
/* @__PURE__ */ e("span", { className: "pcoi-toggle__track", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: "pcoi-toggle__thumb" }) }),
|
|
414
|
-
/* @__PURE__ */ e("span", { className: "pcoi-toggle__label", children:
|
|
414
|
+
/* @__PURE__ */ e("span", { className: "pcoi-toggle__label", children: i })
|
|
415
415
|
] }),
|
|
416
416
|
a && /* @__PURE__ */ e("span", { id: p, className: "pcoi-toggle__error", role: "alert", children: a })
|
|
417
417
|
] });
|
|
418
418
|
}
|
|
419
419
|
);
|
|
420
|
-
|
|
420
|
+
ie.displayName = "Toggle";
|
|
421
421
|
const ce = _.forwardRef(
|
|
422
422
|
({
|
|
423
|
-
label:
|
|
424
|
-
name:
|
|
423
|
+
label: i,
|
|
424
|
+
name: l,
|
|
425
425
|
options: a,
|
|
426
|
-
defaultValue:
|
|
427
|
-
error:
|
|
426
|
+
defaultValue: o,
|
|
427
|
+
error: c,
|
|
428
428
|
required: s = !1,
|
|
429
429
|
disabled: r = !1,
|
|
430
|
-
onChange:
|
|
430
|
+
onChange: d,
|
|
431
431
|
className: p = "",
|
|
432
|
-
...
|
|
432
|
+
...t
|
|
433
433
|
}, h) => {
|
|
434
|
-
const m =
|
|
434
|
+
const m = c ? `pcoi-field-${l}-error` : void 0, N = [
|
|
435
435
|
"pcoi-radio-group",
|
|
436
|
-
|
|
436
|
+
c ? "pcoi-radio-group--error" : "",
|
|
437
437
|
r ? "pcoi-radio-group--disabled" : "",
|
|
438
438
|
p
|
|
439
|
-
].filter(Boolean).join(" "), f = (
|
|
440
|
-
|
|
439
|
+
].filter(Boolean).join(" "), f = (u) => {
|
|
440
|
+
d == null || d(u.target.value);
|
|
441
441
|
};
|
|
442
442
|
return /* @__PURE__ */ n(
|
|
443
443
|
"fieldset",
|
|
444
444
|
{
|
|
445
445
|
ref: h,
|
|
446
|
-
className:
|
|
447
|
-
"aria-invalid": !!
|
|
446
|
+
className: N,
|
|
447
|
+
"aria-invalid": !!c,
|
|
448
448
|
"aria-describedby": m,
|
|
449
|
-
...
|
|
449
|
+
...t,
|
|
450
450
|
children: [
|
|
451
451
|
/* @__PURE__ */ n("legend", { className: "pcoi-radio-group__legend", children: [
|
|
452
|
-
|
|
452
|
+
i,
|
|
453
453
|
s && /* @__PURE__ */ e("span", { className: "pcoi-radio-group__required", "aria-hidden": "true", children: "*" })
|
|
454
454
|
] }),
|
|
455
|
-
/* @__PURE__ */ e("div", { className: "pcoi-radio-group__options", children: a.map((
|
|
456
|
-
const
|
|
455
|
+
/* @__PURE__ */ e("div", { className: "pcoi-radio-group__options", children: a.map((u) => {
|
|
456
|
+
const C = `pcoi-field-${l}-${u.value}`;
|
|
457
457
|
return /* @__PURE__ */ n(
|
|
458
458
|
"label",
|
|
459
459
|
{
|
|
460
|
-
htmlFor:
|
|
460
|
+
htmlFor: C,
|
|
461
461
|
className: "pcoi-radio-group__option",
|
|
462
462
|
children: [
|
|
463
463
|
/* @__PURE__ */ e(
|
|
464
464
|
"input",
|
|
465
465
|
{
|
|
466
466
|
type: "radio",
|
|
467
|
-
id:
|
|
468
|
-
name:
|
|
469
|
-
value:
|
|
470
|
-
defaultChecked:
|
|
467
|
+
id: C,
|
|
468
|
+
name: l,
|
|
469
|
+
value: u.value,
|
|
470
|
+
defaultChecked: o === u.value,
|
|
471
471
|
required: s,
|
|
472
|
-
disabled: r ||
|
|
472
|
+
disabled: r || u.disabled,
|
|
473
473
|
onChange: f,
|
|
474
474
|
className: "pcoi-radio-group__input"
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
477
|
/* @__PURE__ */ e("span", { className: "pcoi-radio-group__circle", "aria-hidden": "true" }),
|
|
478
|
-
/* @__PURE__ */ e("span", { className: "pcoi-radio-group__label", children:
|
|
478
|
+
/* @__PURE__ */ e("span", { className: "pcoi-radio-group__label", children: u.label })
|
|
479
479
|
]
|
|
480
480
|
},
|
|
481
|
-
|
|
481
|
+
u.value
|
|
482
482
|
);
|
|
483
483
|
}) }),
|
|
484
|
-
|
|
484
|
+
c && /* @__PURE__ */ e("span", { id: m, className: "pcoi-radio-group__error", role: "alert", children: c })
|
|
485
485
|
]
|
|
486
486
|
}
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
490
|
ce.displayName = "RadioGroup";
|
|
491
|
-
const
|
|
491
|
+
const le = _.forwardRef(
|
|
492
492
|
({
|
|
493
|
-
title:
|
|
494
|
-
headingLevel:
|
|
493
|
+
title: i,
|
|
494
|
+
headingLevel: l = "h3",
|
|
495
495
|
action: a,
|
|
496
|
-
children:
|
|
497
|
-
flush:
|
|
496
|
+
children: o,
|
|
497
|
+
flush: c = !1,
|
|
498
498
|
className: s = "",
|
|
499
499
|
...r
|
|
500
|
-
},
|
|
501
|
-
const p =
|
|
500
|
+
}, d) => {
|
|
501
|
+
const p = l, t = [
|
|
502
502
|
"pcoi-panel",
|
|
503
|
-
|
|
503
|
+
c ? "pcoi-panel--flush" : "",
|
|
504
504
|
s
|
|
505
505
|
].filter(Boolean).join(" ");
|
|
506
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
507
|
-
(
|
|
508
|
-
|
|
506
|
+
return /* @__PURE__ */ n("div", { ref: d, className: t, ...r, children: [
|
|
507
|
+
(i || a) && /* @__PURE__ */ n("div", { className: "pcoi-panel__header", children: [
|
|
508
|
+
i && /* @__PURE__ */ e(p, { className: "pcoi-panel__title", children: i }),
|
|
509
509
|
a && /* @__PURE__ */ e("div", { className: "pcoi-panel__action", children: a })
|
|
510
510
|
] }),
|
|
511
|
-
/* @__PURE__ */ e("div", { className: "pcoi-panel__body", children:
|
|
511
|
+
/* @__PURE__ */ e("div", { className: "pcoi-panel__body", children: o })
|
|
512
512
|
] });
|
|
513
513
|
}
|
|
514
514
|
);
|
|
515
|
-
|
|
516
|
-
const
|
|
515
|
+
le.displayName = "Panel";
|
|
516
|
+
const oe = _.forwardRef(
|
|
517
517
|
({
|
|
518
|
-
columns:
|
|
519
|
-
rows:
|
|
518
|
+
columns: i,
|
|
519
|
+
rows: l,
|
|
520
520
|
rowKey: a,
|
|
521
|
-
emptyText:
|
|
522
|
-
ariaLabel:
|
|
521
|
+
emptyText: o = "No data available",
|
|
522
|
+
ariaLabel: c,
|
|
523
523
|
className: s = "",
|
|
524
524
|
...r
|
|
525
|
-
},
|
|
526
|
-
const p = (
|
|
527
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
528
|
-
/* @__PURE__ */ e("thead", { className: "pcoi-data-table__head", children: /* @__PURE__ */ e("tr", { className: "pcoi-data-table__head-row", children:
|
|
525
|
+
}, d) => {
|
|
526
|
+
const p = (t, h) => a ? typeof a == "function" ? a(t, h) : String(t[a]) : String(h);
|
|
527
|
+
return /* @__PURE__ */ e("div", { ref: d, className: `pcoi-data-table ${s}`, ...r, children: /* @__PURE__ */ n("table", { className: "pcoi-data-table__table", "aria-label": c, children: [
|
|
528
|
+
/* @__PURE__ */ e("thead", { className: "pcoi-data-table__head", children: /* @__PURE__ */ e("tr", { className: "pcoi-data-table__head-row", children: i.map((t) => /* @__PURE__ */ e(
|
|
529
529
|
"th",
|
|
530
530
|
{
|
|
531
|
-
className: `pcoi-data-table__th${
|
|
532
|
-
children:
|
|
531
|
+
className: `pcoi-data-table__th${t.align ? ` pcoi-data-table__th--${t.align}` : ""}`,
|
|
532
|
+
children: t.header
|
|
533
533
|
},
|
|
534
|
-
|
|
534
|
+
t.key
|
|
535
535
|
)) }) }),
|
|
536
|
-
/* @__PURE__ */ e("tbody", { className: "pcoi-data-table__body", children:
|
|
536
|
+
/* @__PURE__ */ e("tbody", { className: "pcoi-data-table__body", children: l.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
537
537
|
"td",
|
|
538
538
|
{
|
|
539
|
-
colSpan:
|
|
539
|
+
colSpan: i.length,
|
|
540
540
|
className: "pcoi-data-table__empty",
|
|
541
|
-
children:
|
|
541
|
+
children: o
|
|
542
542
|
}
|
|
543
|
-
) }) :
|
|
543
|
+
) }) : l.map((t, h) => /* @__PURE__ */ e(
|
|
544
544
|
"tr",
|
|
545
545
|
{
|
|
546
546
|
className: "pcoi-data-table__row",
|
|
547
|
-
children:
|
|
548
|
-
const
|
|
547
|
+
children: i.map((m) => {
|
|
548
|
+
const N = t[m.key];
|
|
549
549
|
return /* @__PURE__ */ e(
|
|
550
550
|
"td",
|
|
551
551
|
{
|
|
552
552
|
className: `pcoi-data-table__td${m.align ? ` pcoi-data-table__td--${m.align}` : ""}`,
|
|
553
|
-
children: m.render ? m.render(
|
|
553
|
+
children: m.render ? m.render(N, t) : String(N ?? "")
|
|
554
554
|
},
|
|
555
555
|
m.key
|
|
556
556
|
);
|
|
557
557
|
})
|
|
558
558
|
},
|
|
559
|
-
p(
|
|
559
|
+
p(t, h)
|
|
560
560
|
)) })
|
|
561
561
|
] }) });
|
|
562
562
|
}
|
|
563
563
|
);
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
({ children:
|
|
564
|
+
oe.displayName = "DataTable";
|
|
565
|
+
const R = _.forwardRef(
|
|
566
|
+
({ children: i, variant: l = "default", className: a = "", ...o }, c) => {
|
|
567
567
|
const s = [
|
|
568
568
|
"pcoi-badge",
|
|
569
|
-
`pcoi-badge--${
|
|
569
|
+
`pcoi-badge--${l}`,
|
|
570
570
|
a
|
|
571
571
|
].filter(Boolean).join(" ");
|
|
572
|
-
return /* @__PURE__ */ e("span", { ref:
|
|
572
|
+
return /* @__PURE__ */ e("span", { ref: c, className: s, ...o, children: i });
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
|
-
|
|
576
|
-
const T = (
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
(
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
y(() => (c && (h.current = document.activeElement, document.addEventListener("keydown", f), document.body.style.overflow = "hidden", requestAnimationFrame(() => {
|
|
605
|
-
var v;
|
|
606
|
-
const b = (v = d.current) == null ? void 0 : v.querySelector(
|
|
607
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
575
|
+
R.displayName = "Badge";
|
|
576
|
+
const T = _.forwardRef(
|
|
577
|
+
({
|
|
578
|
+
open: i,
|
|
579
|
+
onClose: l,
|
|
580
|
+
title: a,
|
|
581
|
+
headingLevel: o = "h2",
|
|
582
|
+
size: c = "default",
|
|
583
|
+
children: s,
|
|
584
|
+
footer: r,
|
|
585
|
+
className: d = "",
|
|
586
|
+
...p
|
|
587
|
+
}, t) => {
|
|
588
|
+
const h = w(null), m = w(null), N = o, f = a ? "pcoi-modal-title" : void 0, u = $(
|
|
589
|
+
(b) => {
|
|
590
|
+
if (b.key === "Escape") {
|
|
591
|
+
l();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (b.key === "Tab" && h.current) {
|
|
595
|
+
const v = h.current.querySelectorAll(
|
|
596
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
597
|
+
);
|
|
598
|
+
if (v.length === 0) return;
|
|
599
|
+
const B = v[0], S = v[v.length - 1];
|
|
600
|
+
b.shiftKey && document.activeElement === B ? (b.preventDefault(), S.focus()) : !b.shiftKey && document.activeElement === S && (b.preventDefault(), B.focus());
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
[l]
|
|
608
604
|
);
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
"
|
|
627
|
-
"aria-labelledby": u,
|
|
628
|
-
...p,
|
|
629
|
-
children: [
|
|
630
|
-
/* @__PURE__ */ n("div", { className: "pcoi-modal__header", children: [
|
|
631
|
-
a && /* @__PURE__ */ e(m, { id: u, className: "pcoi-modal__title", children: a }),
|
|
632
|
-
/* @__PURE__ */ e(
|
|
633
|
-
"button",
|
|
634
|
-
{
|
|
635
|
-
type: "button",
|
|
636
|
-
className: "pcoi-modal__close",
|
|
637
|
-
onClick: o,
|
|
638
|
-
"aria-label": "Close modal",
|
|
639
|
-
children: /* @__PURE__ */ e(E, { size: 20 })
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
] }),
|
|
643
|
-
/* @__PURE__ */ e("div", { className: "pcoi-modal__body", children: s }),
|
|
644
|
-
r && /* @__PURE__ */ e("div", { className: "pcoi-modal__footer", children: r })
|
|
645
|
-
]
|
|
646
|
-
}
|
|
647
|
-
) }),
|
|
648
|
-
document.body
|
|
649
|
-
);
|
|
650
|
-
};
|
|
651
|
-
T.displayName = "Modal";
|
|
652
|
-
const oe = ({
|
|
653
|
-
message: c,
|
|
654
|
-
variant: o = "info",
|
|
655
|
-
open: a,
|
|
656
|
-
onClose: l,
|
|
657
|
-
duration: i = 5e3,
|
|
658
|
-
className: s = "",
|
|
659
|
-
...r
|
|
660
|
-
}) => {
|
|
661
|
-
const t = x(() => {
|
|
662
|
-
l == null || l();
|
|
663
|
-
}, [l]);
|
|
664
|
-
if (y(() => {
|
|
665
|
-
if (!a || i === 0) return;
|
|
666
|
-
const d = setTimeout(t, i);
|
|
667
|
-
return () => clearTimeout(d);
|
|
668
|
-
}, [a, i, t]), !a) return null;
|
|
669
|
-
const p = [
|
|
670
|
-
"pcoi-toast",
|
|
671
|
-
`pcoi-toast--${o}`,
|
|
672
|
-
s
|
|
673
|
-
].filter(Boolean).join(" ");
|
|
674
|
-
return F(
|
|
675
|
-
/* @__PURE__ */ e("div", { className: p, role: "alert", ...r, children: /* @__PURE__ */ n("div", { className: "pcoi-toast__content", children: [
|
|
676
|
-
/* @__PURE__ */ e("span", { className: "pcoi-toast__message", children: c }),
|
|
677
|
-
l && /* @__PURE__ */ e(
|
|
678
|
-
"button",
|
|
605
|
+
y(() => (i && (m.current = document.activeElement, document.addEventListener("keydown", u), document.body.style.overflow = "hidden", requestAnimationFrame(() => {
|
|
606
|
+
var v;
|
|
607
|
+
const b = (v = h.current) == null ? void 0 : v.querySelector(
|
|
608
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
609
|
+
);
|
|
610
|
+
b == null || b.focus();
|
|
611
|
+
})), () => {
|
|
612
|
+
var b;
|
|
613
|
+
document.removeEventListener("keydown", u), document.body.style.overflow = "", (b = m.current) == null || b.focus();
|
|
614
|
+
}), [i, u]);
|
|
615
|
+
const C = (b) => {
|
|
616
|
+
b.target === b.currentTarget && l();
|
|
617
|
+
};
|
|
618
|
+
if (!i) return null;
|
|
619
|
+
const L = ["pcoi-modal", d].filter(Boolean).join(" ");
|
|
620
|
+
return F(
|
|
621
|
+
/* @__PURE__ */ e("div", { className: L, onClick: C, children: /* @__PURE__ */ n(
|
|
622
|
+
"div",
|
|
679
623
|
{
|
|
680
|
-
|
|
681
|
-
className: "pcoi-
|
|
682
|
-
|
|
683
|
-
"aria-
|
|
684
|
-
|
|
624
|
+
ref: h,
|
|
625
|
+
className: `pcoi-modal__dialog${c === "wide" ? " pcoi-modal__dialog--wide" : ""}`,
|
|
626
|
+
role: "dialog",
|
|
627
|
+
"aria-modal": "true",
|
|
628
|
+
"aria-labelledby": f,
|
|
629
|
+
...p,
|
|
630
|
+
children: [
|
|
631
|
+
/* @__PURE__ */ n("div", { className: "pcoi-modal__header", children: [
|
|
632
|
+
a && /* @__PURE__ */ e(N, { id: f, className: "pcoi-modal__title", children: a }),
|
|
633
|
+
/* @__PURE__ */ e(
|
|
634
|
+
"button",
|
|
635
|
+
{
|
|
636
|
+
type: "button",
|
|
637
|
+
className: "pcoi-modal__close",
|
|
638
|
+
onClick: l,
|
|
639
|
+
"aria-label": "Close modal",
|
|
640
|
+
children: /* @__PURE__ */ e(E, { size: 20 })
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
] }),
|
|
644
|
+
/* @__PURE__ */ e("div", { className: "pcoi-modal__body", children: s }),
|
|
645
|
+
r && /* @__PURE__ */ e("div", { className: "pcoi-modal__footer", children: r })
|
|
646
|
+
]
|
|
685
647
|
}
|
|
686
|
-
)
|
|
687
|
-
|
|
688
|
-
|
|
648
|
+
) }),
|
|
649
|
+
document.body
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
T.displayName = "Modal";
|
|
654
|
+
const re = _.forwardRef(
|
|
655
|
+
({
|
|
656
|
+
message: i,
|
|
657
|
+
variant: l = "info",
|
|
658
|
+
open: a,
|
|
659
|
+
onClose: o,
|
|
660
|
+
duration: c = 5e3,
|
|
661
|
+
className: s = "",
|
|
662
|
+
...r
|
|
663
|
+
}, d) => {
|
|
664
|
+
const p = $(() => {
|
|
665
|
+
o == null || o();
|
|
666
|
+
}, [o]);
|
|
667
|
+
if (y(() => {
|
|
668
|
+
if (!a || c === 0) return;
|
|
669
|
+
const h = setTimeout(p, c);
|
|
670
|
+
return () => clearTimeout(h);
|
|
671
|
+
}, [a, c, p]), !a) return null;
|
|
672
|
+
const t = [
|
|
673
|
+
"pcoi-toast",
|
|
674
|
+
`pcoi-toast--${l}`,
|
|
675
|
+
s
|
|
676
|
+
].filter(Boolean).join(" ");
|
|
677
|
+
return F(
|
|
678
|
+
/* @__PURE__ */ e("div", { ref: d, className: t, role: "alert", ...r, children: /* @__PURE__ */ n("div", { className: "pcoi-toast__content", children: [
|
|
679
|
+
/* @__PURE__ */ e("span", { className: "pcoi-toast__message", children: i }),
|
|
680
|
+
o && /* @__PURE__ */ e(
|
|
681
|
+
"button",
|
|
682
|
+
{
|
|
683
|
+
type: "button",
|
|
684
|
+
className: "pcoi-toast__close",
|
|
685
|
+
onClick: p,
|
|
686
|
+
"aria-label": "Dismiss notification",
|
|
687
|
+
children: /* @__PURE__ */ e(E, { size: 16 })
|
|
688
|
+
}
|
|
689
|
+
)
|
|
690
|
+
] }) }),
|
|
691
|
+
document.body
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
re.displayName = "Toast";
|
|
696
|
+
const se = _.forwardRef(({ index: i, sourceLabel: l, className: a = "", ...o }, c) => {
|
|
697
|
+
const s = ["pcoi-citation-mark", a].filter(Boolean).join(" ");
|
|
698
|
+
return /* @__PURE__ */ e(
|
|
699
|
+
"button",
|
|
700
|
+
{
|
|
701
|
+
ref: c,
|
|
702
|
+
type: "button",
|
|
703
|
+
className: s,
|
|
704
|
+
title: l ?? `Citation ${i}`,
|
|
705
|
+
"aria-label": l ?? `Citation ${i}`,
|
|
706
|
+
...o,
|
|
707
|
+
children: i
|
|
708
|
+
}
|
|
689
709
|
);
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
const
|
|
710
|
+
});
|
|
711
|
+
se.displayName = "CitationMark";
|
|
712
|
+
const O = _.forwardRef(({ label: i, icon: l, className: a = "", ...o }, c) => {
|
|
693
713
|
const s = ["pcoi-suggestion-card", a].filter(Boolean).join(" ");
|
|
694
|
-
return /* @__PURE__ */ n("button", { ref:
|
|
695
|
-
|
|
696
|
-
/* @__PURE__ */ e("span", { className: "pcoi-suggestion-card__label", children:
|
|
714
|
+
return /* @__PURE__ */ n("button", { ref: c, type: "button", className: s, ...o, children: [
|
|
715
|
+
l && /* @__PURE__ */ e("span", { className: "pcoi-suggestion-card__icon", children: l }),
|
|
716
|
+
/* @__PURE__ */ e("span", { className: "pcoi-suggestion-card__label", children: i })
|
|
697
717
|
] });
|
|
698
718
|
});
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
({ index:
|
|
702
|
-
const
|
|
703
|
-
return /* @__PURE__ */ n("div", { ref: r, className:
|
|
719
|
+
O.displayName = "SuggestionCard";
|
|
720
|
+
const D = _.forwardRef(
|
|
721
|
+
({ index: i, excerpt: l, sourceTitle: a, onSourceClick: o, className: c = "", ...s }, r) => {
|
|
722
|
+
const d = ["pcoi-cited-excerpt", c].filter(Boolean).join(" ");
|
|
723
|
+
return /* @__PURE__ */ n("div", { ref: r, className: d, ...s, children: [
|
|
704
724
|
/* @__PURE__ */ e(
|
|
705
725
|
"button",
|
|
706
726
|
{
|
|
707
727
|
type: "button",
|
|
708
728
|
className: "pcoi-cited-excerpt__source",
|
|
709
|
-
onClick:
|
|
729
|
+
onClick: o,
|
|
730
|
+
"aria-label": `View source: ${a}`,
|
|
710
731
|
children: a
|
|
711
732
|
}
|
|
712
733
|
),
|
|
@@ -716,217 +737,220 @@ const O = _.forwardRef(
|
|
|
716
737
|
{
|
|
717
738
|
type: "button",
|
|
718
739
|
className: "pcoi-cited-excerpt__index",
|
|
719
|
-
onClick:
|
|
740
|
+
onClick: o,
|
|
741
|
+
"aria-label": `Citation ${i}, view source: ${a}`,
|
|
720
742
|
children: [
|
|
721
743
|
"[",
|
|
722
|
-
|
|
744
|
+
i,
|
|
723
745
|
"]"
|
|
724
746
|
]
|
|
725
747
|
}
|
|
726
748
|
),
|
|
727
|
-
/* @__PURE__ */ e("p", { className: "pcoi-cited-excerpt__text", children:
|
|
749
|
+
/* @__PURE__ */ e("p", { className: "pcoi-cited-excerpt__text", children: l })
|
|
728
750
|
] })
|
|
729
751
|
] });
|
|
730
752
|
}
|
|
731
753
|
);
|
|
732
|
-
|
|
754
|
+
D.displayName = "CitedExcerpt";
|
|
733
755
|
const P = _.forwardRef(
|
|
734
756
|
({
|
|
735
|
-
value:
|
|
736
|
-
onChange:
|
|
757
|
+
value: i,
|
|
758
|
+
onChange: l,
|
|
737
759
|
onSubmit: a,
|
|
738
|
-
placeholder:
|
|
739
|
-
disabled:
|
|
760
|
+
placeholder: o = "Ask a question…",
|
|
761
|
+
disabled: c = !1,
|
|
740
762
|
loading: s = !1,
|
|
741
763
|
className: r = "",
|
|
742
|
-
...
|
|
764
|
+
...d
|
|
743
765
|
}, p) => {
|
|
744
|
-
const
|
|
766
|
+
const t = w(null), h = $(
|
|
745
767
|
(f) => {
|
|
746
|
-
f.key === "Enter" && !f.shiftKey && (f.preventDefault(),
|
|
768
|
+
f.key === "Enter" && !f.shiftKey && (f.preventDefault(), i.trim() && !c && !s && a(i.trim()));
|
|
747
769
|
},
|
|
748
|
-
[
|
|
749
|
-
), m =
|
|
750
|
-
|
|
751
|
-
}, [
|
|
752
|
-
return /* @__PURE__ */ n("div", { ref: p, className:
|
|
770
|
+
[i, c, s, a]
|
|
771
|
+
), m = $(() => {
|
|
772
|
+
i.trim() && !c && !s && a(i.trim());
|
|
773
|
+
}, [i, c, s, a]), N = ["pcoi-prompt-bar", r].filter(Boolean).join(" ");
|
|
774
|
+
return /* @__PURE__ */ n("div", { ref: p, className: N, ...d, children: [
|
|
753
775
|
/* @__PURE__ */ e(
|
|
754
776
|
"textarea",
|
|
755
777
|
{
|
|
756
|
-
ref:
|
|
778
|
+
ref: t,
|
|
757
779
|
className: "pcoi-prompt-bar__input",
|
|
758
|
-
value:
|
|
759
|
-
onChange: (f) =>
|
|
780
|
+
value: i,
|
|
781
|
+
onChange: (f) => l(f.target.value),
|
|
760
782
|
onKeyDown: h,
|
|
761
|
-
placeholder:
|
|
762
|
-
disabled:
|
|
783
|
+
placeholder: o,
|
|
784
|
+
disabled: c,
|
|
763
785
|
rows: 1,
|
|
764
|
-
"aria-label":
|
|
786
|
+
"aria-label": o
|
|
765
787
|
}
|
|
766
788
|
),
|
|
767
789
|
/* @__PURE__ */ e("div", { className: "pcoi-prompt-bar__actions", children: /* @__PURE__ */ e(
|
|
768
|
-
|
|
790
|
+
k,
|
|
769
791
|
{
|
|
770
792
|
variant: "primary",
|
|
771
793
|
className: "pcoi-prompt-bar__send",
|
|
772
794
|
onClick: m,
|
|
773
|
-
disabled:
|
|
795
|
+
disabled: c || s || !i.trim(),
|
|
774
796
|
"aria-label": "Send message",
|
|
775
|
-
children: /* @__PURE__ */ e("span", { className: "pcoi-prompt-bar__send-icon", children: /* @__PURE__ */ e(
|
|
797
|
+
children: /* @__PURE__ */ e("span", { className: "pcoi-prompt-bar__send-icon", children: /* @__PURE__ */ e(Y, { size: 16 }) })
|
|
776
798
|
}
|
|
777
799
|
) })
|
|
778
800
|
] });
|
|
779
801
|
}
|
|
780
802
|
);
|
|
781
803
|
P.displayName = "PromptBar";
|
|
782
|
-
const
|
|
783
|
-
({ role:
|
|
804
|
+
const M = _.forwardRef(
|
|
805
|
+
({ role: i, children: l, citations: a, timestamp: o, onCitationClick: c, className: s = "", ...r }, d) => {
|
|
784
806
|
const p = [
|
|
785
807
|
"pcoi-chat-message",
|
|
786
|
-
`pcoi-chat-message--${
|
|
808
|
+
`pcoi-chat-message--${i}`,
|
|
787
809
|
s
|
|
788
810
|
].filter(Boolean).join(" ");
|
|
789
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
790
|
-
/* @__PURE__ */ e("div", { className: "pcoi-chat-message__header", children: /* @__PURE__ */ e(
|
|
791
|
-
/* @__PURE__ */ e("div", { className: "pcoi-chat-message__body", children:
|
|
792
|
-
a && a.length > 0 && /* @__PURE__ */ e("div", { className: "pcoi-chat-message__citations", children: a.map((
|
|
793
|
-
|
|
811
|
+
return /* @__PURE__ */ n("div", { ref: d, className: p, ...r, children: [
|
|
812
|
+
/* @__PURE__ */ e("div", { className: "pcoi-chat-message__header", children: /* @__PURE__ */ e(R, { variant: i === "assistant" ? "default" : "info", children: i === "assistant" ? "PCOI" : "You" }) }),
|
|
813
|
+
/* @__PURE__ */ e("div", { className: "pcoi-chat-message__body", children: l }),
|
|
814
|
+
a && a.length > 0 && /* @__PURE__ */ e("div", { className: "pcoi-chat-message__citations", children: a.map((t) => /* @__PURE__ */ e(
|
|
815
|
+
D,
|
|
794
816
|
{
|
|
795
|
-
index:
|
|
796
|
-
excerpt:
|
|
797
|
-
sourceTitle:
|
|
798
|
-
onSourceClick: () =>
|
|
817
|
+
index: t.index,
|
|
818
|
+
excerpt: t.excerpt,
|
|
819
|
+
sourceTitle: t.sourceTitle,
|
|
820
|
+
onSourceClick: () => c == null ? void 0 : c(t)
|
|
799
821
|
},
|
|
800
|
-
|
|
822
|
+
t.index
|
|
801
823
|
)) }),
|
|
802
|
-
|
|
824
|
+
o && /* @__PURE__ */ e("time", { className: "pcoi-chat-message__timestamp", children: o })
|
|
803
825
|
] });
|
|
804
826
|
}
|
|
805
827
|
);
|
|
806
|
-
|
|
807
|
-
const
|
|
828
|
+
M.displayName = "ChatMessage";
|
|
829
|
+
const H = _.forwardRef(({ suggestions: i, onSelect: l, className: a = "", ...o }, c) => {
|
|
808
830
|
const s = ["pcoi-suggestion-cards", a].filter(Boolean).join(" ");
|
|
809
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
810
|
-
|
|
831
|
+
return /* @__PURE__ */ e("div", { ref: c, className: s, ...o, children: i.map((r) => /* @__PURE__ */ e(
|
|
832
|
+
O,
|
|
811
833
|
{
|
|
812
834
|
label: r.label,
|
|
813
835
|
icon: r.icon,
|
|
814
|
-
onClick: () =>
|
|
836
|
+
onClick: () => l(r)
|
|
815
837
|
},
|
|
816
838
|
r.id
|
|
817
839
|
)) });
|
|
818
840
|
});
|
|
819
|
-
|
|
820
|
-
const q = _.forwardRef(({ children:
|
|
821
|
-
const
|
|
841
|
+
H.displayName = "SuggestionCards";
|
|
842
|
+
const q = _.forwardRef(({ children: i, className: l = "", ...a }, o) => {
|
|
843
|
+
const c = w(null);
|
|
822
844
|
y(() => {
|
|
823
|
-
const r =
|
|
845
|
+
const r = c.current;
|
|
824
846
|
if (!r) return;
|
|
825
|
-
const
|
|
847
|
+
const d = () => {
|
|
826
848
|
requestAnimationFrame(() => {
|
|
827
|
-
|
|
849
|
+
const t = r.lastElementChild;
|
|
850
|
+
t ? t.scrollIntoView({ block: "nearest" }) : r.scrollTop = r.scrollHeight;
|
|
828
851
|
});
|
|
829
|
-
}, p = new MutationObserver(
|
|
830
|
-
return p.observe(r, { childList: !0, subtree: !0 }),
|
|
852
|
+
}, p = new MutationObserver(d);
|
|
853
|
+
return p.observe(r, { childList: !0, subtree: !0 }), d(), () => p.disconnect();
|
|
831
854
|
}, []);
|
|
832
|
-
const s = ["pcoi-chat-message-list",
|
|
833
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
855
|
+
const s = ["pcoi-chat-message-list", l].filter(Boolean).join(" ");
|
|
856
|
+
return /* @__PURE__ */ e("div", { ref: o, className: s, role: "log", "aria-label": "Conversation", ...a, children: /* @__PURE__ */ e("div", { ref: c, className: "pcoi-chat-message-list__inner", children: i }) });
|
|
834
857
|
});
|
|
835
858
|
q.displayName = "ChatMessageList";
|
|
836
|
-
const
|
|
837
|
-
({ open:
|
|
859
|
+
const te = _.forwardRef(
|
|
860
|
+
({ open: i, onClose: l, title: a, sourceLabel: o, children: c, highlightId: s, highlightIndex: r, className: d = "", ...p }, t) => {
|
|
838
861
|
const h = w(null);
|
|
839
862
|
y(() => {
|
|
840
|
-
|
|
841
|
-
var
|
|
842
|
-
const f = (
|
|
863
|
+
i && s && h.current && requestAnimationFrame(() => {
|
|
864
|
+
var u;
|
|
865
|
+
const f = (u = h.current) == null ? void 0 : u.querySelector(`#${CSS.escape(s)}`);
|
|
843
866
|
f && (f.scrollIntoView({ behavior: "smooth", block: "center" }), f.classList.add("pcoi-doc-overlay__highlight"), r !== void 0 && f.setAttribute("data-highlight-index", `[${r}]`));
|
|
844
867
|
});
|
|
845
|
-
}, [
|
|
846
|
-
const m = ["pcoi-doc-overlay",
|
|
868
|
+
}, [i, s, r]);
|
|
869
|
+
const m = ["pcoi-doc-overlay", d].filter(Boolean).join(" "), N = o ? _.createElement(
|
|
847
870
|
"div",
|
|
848
871
|
{ className: "pcoi-doc-overlay__source" },
|
|
849
|
-
_.createElement(
|
|
872
|
+
_.createElement(R, null, o)
|
|
850
873
|
) : void 0;
|
|
851
874
|
return _.createElement(
|
|
852
875
|
T,
|
|
853
876
|
{
|
|
854
|
-
|
|
855
|
-
|
|
877
|
+
ref: t,
|
|
878
|
+
open: i,
|
|
879
|
+
onClose: l,
|
|
856
880
|
title: a,
|
|
857
881
|
size: "wide",
|
|
858
|
-
footer:
|
|
882
|
+
footer: N,
|
|
859
883
|
className: m,
|
|
860
884
|
...p
|
|
861
885
|
},
|
|
862
886
|
_.createElement(
|
|
863
887
|
"div",
|
|
864
888
|
{ ref: h, className: "pcoi-doc-overlay__content" },
|
|
865
|
-
|
|
889
|
+
c
|
|
866
890
|
)
|
|
867
891
|
);
|
|
868
892
|
}
|
|
869
893
|
);
|
|
870
|
-
|
|
871
|
-
const
|
|
872
|
-
const
|
|
873
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
874
|
-
/* @__PURE__ */ e("div", { className: "pcoi-typing-indicator__header", children: /* @__PURE__ */ e(
|
|
875
|
-
/* @__PURE__ */ n("div", { className: "pcoi-typing-indicator__dots", "aria-
|
|
894
|
+
te.displayName = "DocumentOverlay";
|
|
895
|
+
const A = _.forwardRef(({ label: i = "PCOI", className: l = "", ...a }, o) => {
|
|
896
|
+
const c = ["pcoi-typing-indicator", l].filter(Boolean).join(" ");
|
|
897
|
+
return /* @__PURE__ */ n("div", { ref: o, className: c, role: "status", "aria-live": "polite", "aria-label": `${i} is typing`, ...a, children: [
|
|
898
|
+
/* @__PURE__ */ e("div", { className: "pcoi-typing-indicator__header", children: /* @__PURE__ */ e(R, { children: i }) }),
|
|
899
|
+
/* @__PURE__ */ n("div", { className: "pcoi-typing-indicator__dots", "aria-hidden": "true", children: [
|
|
876
900
|
/* @__PURE__ */ e("span", { className: "pcoi-typing-indicator__dot" }),
|
|
877
901
|
/* @__PURE__ */ e("span", { className: "pcoi-typing-indicator__dot" }),
|
|
878
902
|
/* @__PURE__ */ e("span", { className: "pcoi-typing-indicator__dot" })
|
|
879
903
|
] })
|
|
880
904
|
] });
|
|
881
905
|
});
|
|
882
|
-
|
|
883
|
-
const
|
|
906
|
+
A.displayName = "TypingIndicator";
|
|
907
|
+
const ne = _.forwardRef(
|
|
884
908
|
({
|
|
885
|
-
messages:
|
|
886
|
-
suggestions:
|
|
909
|
+
messages: i,
|
|
910
|
+
suggestions: l,
|
|
887
911
|
promptValue: a,
|
|
888
|
-
onPromptChange:
|
|
889
|
-
onPromptSubmit:
|
|
912
|
+
onPromptChange: o,
|
|
913
|
+
onPromptSubmit: c,
|
|
890
914
|
onSuggestionSelect: s,
|
|
891
915
|
onCitationClick: r,
|
|
892
|
-
placeholder:
|
|
916
|
+
placeholder: d,
|
|
893
917
|
loading: p = !1,
|
|
894
|
-
className:
|
|
918
|
+
className: t = "",
|
|
895
919
|
...h
|
|
896
920
|
}, m) => {
|
|
897
|
-
const
|
|
921
|
+
const N = i.length === 0, f = [
|
|
898
922
|
"pcoi-chat",
|
|
899
|
-
|
|
900
|
-
|
|
923
|
+
N ? "pcoi-chat--empty" : "",
|
|
924
|
+
t
|
|
901
925
|
].filter(Boolean).join(" ");
|
|
902
926
|
return /* @__PURE__ */ n("div", { ref: m, className: f, ...h, children: [
|
|
903
|
-
|
|
904
|
-
|
|
927
|
+
N ? /* @__PURE__ */ e("div", { className: "pcoi-chat__empty-state", children: l && l.length > 0 && s && /* @__PURE__ */ e("div", { className: "pcoi-chat__suggestions", children: /* @__PURE__ */ e(
|
|
928
|
+
H,
|
|
905
929
|
{
|
|
906
|
-
suggestions:
|
|
930
|
+
suggestions: l,
|
|
907
931
|
onSelect: s
|
|
908
932
|
}
|
|
909
|
-
) }) }) : /* @__PURE__ */ n(q, { className: "pcoi-chat__messages", children: [
|
|
910
|
-
|
|
911
|
-
|
|
933
|
+
) }) }) : /* @__PURE__ */ n(q, { className: "pcoi-chat__messages", "aria-live": "polite", "aria-relevant": "additions", children: [
|
|
934
|
+
i.map((u) => /* @__PURE__ */ e(
|
|
935
|
+
M,
|
|
912
936
|
{
|
|
913
|
-
role:
|
|
914
|
-
citations:
|
|
915
|
-
timestamp:
|
|
937
|
+
role: u.role,
|
|
938
|
+
citations: u.citations,
|
|
939
|
+
timestamp: u.timestamp,
|
|
916
940
|
onCitationClick: r,
|
|
917
|
-
children:
|
|
941
|
+
children: u.content
|
|
918
942
|
},
|
|
919
|
-
|
|
943
|
+
u.id
|
|
920
944
|
)),
|
|
921
|
-
p && /* @__PURE__ */ e(
|
|
945
|
+
p && /* @__PURE__ */ e(A, {})
|
|
922
946
|
] }),
|
|
923
947
|
/* @__PURE__ */ e("div", { className: "pcoi-chat__prompt", children: /* @__PURE__ */ e(
|
|
924
948
|
P,
|
|
925
949
|
{
|
|
926
950
|
value: a,
|
|
927
|
-
onChange:
|
|
928
|
-
onSubmit:
|
|
929
|
-
placeholder:
|
|
951
|
+
onChange: o,
|
|
952
|
+
onSubmit: c,
|
|
953
|
+
placeholder: d,
|
|
930
954
|
loading: p,
|
|
931
955
|
disabled: p
|
|
932
956
|
}
|
|
@@ -934,36 +958,37 @@ const se = _.forwardRef(
|
|
|
934
958
|
] });
|
|
935
959
|
}
|
|
936
960
|
);
|
|
937
|
-
|
|
961
|
+
ne.displayName = "ChatInterface";
|
|
938
962
|
export {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
963
|
+
R as Badge,
|
|
964
|
+
k as Button,
|
|
965
|
+
X as Callout,
|
|
966
|
+
V as Card,
|
|
967
|
+
ne as ChatInterface,
|
|
968
|
+
M as ChatMessage,
|
|
945
969
|
q as ChatMessageList,
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
J as
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
970
|
+
ae as Checkbox,
|
|
971
|
+
se as CitationMark,
|
|
972
|
+
D as CitedExcerpt,
|
|
973
|
+
J as ComparisonTable,
|
|
974
|
+
Q as ContactForm,
|
|
975
|
+
oe as DataTable,
|
|
976
|
+
te as DocumentOverlay,
|
|
977
|
+
U as Footer,
|
|
953
978
|
g as FormField,
|
|
954
|
-
|
|
979
|
+
G as HowStep,
|
|
955
980
|
I as LogoMark,
|
|
956
981
|
T as Modal,
|
|
957
982
|
W as Nav,
|
|
958
|
-
|
|
983
|
+
le as Panel,
|
|
959
984
|
P as PromptBar,
|
|
960
985
|
ce as RadioGroup,
|
|
961
986
|
K as SectionHeader,
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
987
|
+
ee as Select,
|
|
988
|
+
Z as SignalsPanel,
|
|
989
|
+
O as SuggestionCard,
|
|
990
|
+
H as SuggestionCards,
|
|
991
|
+
re as Toast,
|
|
992
|
+
ie as Toggle,
|
|
993
|
+
A as TypingIndicator
|
|
969
994
|
};
|