@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/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 C, useEffect as y, useRef as w, useCallback as x } from "react";
3
- import { ChevronDownIcon as A, CloseIcon as E, ArrowRightIcon as z } from "@pcoi/icons";
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: c = "#", className: o = "", ...a }, l) => /* @__PURE__ */ n("a", { ref: l, href: c, className: `pcoi-logo ${o}`, ...a, children: [
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 R = _.forwardRef(
13
- ({ variant: c = "primary", size: o = "default", children: a, className: l = "", ...i }, s) => {
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--${c}`,
17
- o !== "default" ? `pcoi-btn--${o}` : "",
18
- l
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, ...i, children: a });
20
+ return /* @__PURE__ */ e("button", { ref: s, className: r, ...c, children: a });
21
21
  }
22
22
  );
23
- R.displayName = "Button";
23
+ k.displayName = "Button";
24
24
  const g = _.forwardRef(
25
25
  ({
26
- label: c,
27
- name: o,
26
+ label: i,
27
+ name: l,
28
28
  multiline: a = !1,
29
- rows: l = 3,
30
- error: i,
29
+ rows: o = 3,
30
+ error: c,
31
31
  required: s = !1,
32
32
  disabled: r = !1,
33
- className: t = "",
33
+ className: d = "",
34
34
  ...p
35
- }, d) => {
36
- const h = `pcoi-field-${o}`, m = i ? `${h}-error` : void 0, u = [
35
+ }, t) => {
36
+ const h = `pcoi-field-${l}`, m = c ? `${h}-error` : void 0, N = [
37
37
  "pcoi-field",
38
- i ? "pcoi-field--error" : "",
38
+ c ? "pcoi-field--error" : "",
39
39
  r ? "pcoi-field--disabled" : "",
40
- t
40
+ d
41
41
  ].filter(Boolean).join(" ");
42
- return /* @__PURE__ */ n("div", { className: u, children: [
42
+ return /* @__PURE__ */ n("div", { className: N, children: [
43
43
  /* @__PURE__ */ n("label", { htmlFor: h, className: "pcoi-field__label", children: [
44
- c,
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: d,
50
+ ref: t,
51
51
  id: h,
52
- name: o,
53
- rows: l,
52
+ name: l,
53
+ rows: o,
54
54
  required: s,
55
55
  disabled: r,
56
- "aria-invalid": !!i,
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: d,
64
+ ref: t,
65
65
  id: h,
66
- name: o,
66
+ name: l,
67
67
  required: s,
68
68
  disabled: r,
69
- "aria-invalid": !!i,
69
+ "aria-invalid": !!c,
70
70
  "aria-describedby": m,
71
71
  className: "pcoi-field__input",
72
72
  ...p
73
73
  }
74
74
  ),
75
- i && /* @__PURE__ */ e("span", { id: m, className: "pcoi-field__error", role: "alert", children: i })
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 Y = _.forwardRef(
81
- ({ variant: c = "problem", title: o, description: a, icon: l, number: i, headingLevel: s = "h3", className: r = "", ...t }, p) => {
82
- const d = s, h = [
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--${c}`,
84
+ `pcoi-card--${i}`,
85
85
  r
86
86
  ].filter(Boolean).join(" ");
87
- return /* @__PURE__ */ n("div", { ref: p, className: h, ...t, children: [
88
- c === "problem" && l && /* @__PURE__ */ e("div", { className: "pcoi-card__icon", children: l }),
89
- c === "principle" && i && /* @__PURE__ */ e("div", { className: "pcoi-card__number", children: i }),
90
- /* @__PURE__ */ e(d, { className: "pcoi-card__title", children: o }),
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
- Y.displayName = "Card";
95
+ V.displayName = "Card";
96
96
  const W = _.forwardRef(
97
97
  ({
98
- links: c = [
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: o = "Start a Conversation",
104
+ ctaLabel: l = "Start a Conversation",
105
105
  ctaHref: a = "#contact",
106
- onCtaClick: l,
107
- className: i = "",
106
+ onCtaClick: o,
107
+ className: c = "",
108
108
  ...s
109
109
  }, r) => {
110
- const [t, p] = C(!1), [d, h] = C(!1);
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 (!d) return;
116
- const m = (u) => {
117
- u.key === "Escape" && h(!1);
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
- }, [d]), /* @__PURE__ */ n(
120
+ }, [t]), /* @__PURE__ */ n(
121
121
  "nav",
122
122
  {
123
123
  ref: r,
124
- className: `pcoi-nav ${t ? "pcoi-nav--scrolled" : ""} ${d ? "pcoi-nav--menu-open" : ""} ${i}`,
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
- c.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(R, { variant: "nav-cta", onClick: l, children: o }) })
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 ${d ? "pcoi-nav__hamburger--active" : ""}`,
138
- onClick: () => h(!d),
137
+ className: `pcoi-nav__hamburger ${t ? "pcoi-nav__hamburger--active" : ""}`,
138
+ onClick: () => h(!t),
139
139
  "aria-label": "Toggle menu",
140
- "aria-expanded": d,
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
- c.map((m) => /* @__PURE__ */ e("a", { href: m.href, "data-track-id": m.trackingId, onClick: () => h(!1), children: m.label }, m.href)),
152
- /* @__PURE__ */ e("a", { href: a, children: /* @__PURE__ */ e(R, { variant: "nav-cta", onClick: () => {
153
- l == null || l(), h(!1);
154
- }, children: o }) })
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: c, title: o, titleEmphasis: a, description: l, headingLevel: i = "h2", className: s = "", ...r }, t) => {
164
- const p = i;
165
- return /* @__PURE__ */ n("div", { ref: t, className: `pcoi-section-header ${s}`, ...r, children: [
166
- /* @__PURE__ */ e("span", { className: "pcoi-section-header__label", children: c }),
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
- o.replace(a, ""),
168
+ l.replace(a, ""),
169
169
  /* @__PURE__ */ e("em", { children: a })
170
- ] }) : o }),
171
- l && /* @__PURE__ */ e("p", { className: "pcoi-section-header__desc", children: l })
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 V = _.forwardRef(
177
- ({ number: c, title: o, description: a, isLast: l = !1, headingLevel: i = "h3", className: s = "", ...r }, t) => {
178
- const p = i;
179
- return /* @__PURE__ */ n("div", { ref: t, className: `pcoi-how-step ${l ? "pcoi-how-step--last" : ""} ${s}`, ...r, children: [
180
- /* @__PURE__ */ e("div", { className: "pcoi-how-step__number", children: c }),
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: o }),
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
- V.displayName = "HowStep";
189
- const G = _.forwardRef(
190
- ({ competitorName: c = "Typical SaaS AI", pcoiName: o = "PCOI", rows: a, className: l = "", ...i }, s) => /* @__PURE__ */ e("div", { ref: s, className: `pcoi-comparison ${l}`, ...i, children: /* @__PURE__ */ n("table", { className: "pcoi-comparison__table", children: [
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: c }),
194
- /* @__PURE__ */ e("th", { className: "pcoi-comparison__col pcoi-comparison__col--highlight", scope: "col", children: o })
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, t) => /* @__PURE__ */ n("tr", { className: "pcoi-comparison__row", children: [
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
- ] }, t)) })
200
+ ] }, d)) })
201
201
  ] }) })
202
202
  );
203
- G.displayName = "ComparisonTable";
204
- const J = _.forwardRef(
205
- ({ onSubmit: c, className: o = "", ...a }, l) => {
206
- const [i, s] = C(!1), r = (t) => {
207
- t.preventDefault();
208
- const p = t.currentTarget, d = new FormData(p), h = Object.fromEntries(d.entries());
209
- c == null || c(h), s(!0), p.reset(), setTimeout(() => s(!1), 3e3);
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: l, className: `pcoi-form ${o}`, onSubmit: r, "aria-label": "Contact form", ...a, children: [
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(R, { type: "submit", variant: "primary", size: "large", disabled: i, children: i ? "Message Received" : "Start the Conversation" }),
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
- J.displayName = "ContactForm";
237
- const Q = _.forwardRef(
238
- ({ quote: c, attribution: o, attributionTitle: a, sourceUrl: l, sourceLabel: i, className: s = "", ...r }, t) => /* @__PURE__ */ n("div", { ref: t, className: `pcoi-callout ${s}`, ...r, children: [
239
- /* @__PURE__ */ e("div", { className: "pcoi-callout__line" }),
240
- /* @__PURE__ */ e("p", { className: "pcoi-callout__quote", children: c }),
241
- (o || l) && /* @__PURE__ */ n("p", { className: "pcoi-callout__attribution", children: [
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
- o,
247
- l && /* @__PURE__ */ n(j, { children: [
246
+ l,
247
+ o && /* @__PURE__ */ n(j, { children: [
248
248
  "  |  ",
249
- /* @__PURE__ */ e("a", { href: l, target: "_blank", rel: "noopener noreferrer", children: i || "Source" })
249
+ /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", children: c || "Source" })
250
250
  ] })
251
251
  ] })
252
252
  ] })
253
253
  );
254
- Q.displayName = "Callout";
255
- const X = _.forwardRef(
256
- ({ title: c = "You'll know this is for you if:", signals: o, headingLevel: a = "h3", className: l = "", ...i }, s) => {
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 ${l}`, ...i, children: [
259
- /* @__PURE__ */ e(r, { className: "pcoi-signals__title", children: c }),
260
- /* @__PURE__ */ e("ul", { className: "pcoi-signals__list", children: o.map((t, p) => /* @__PURE__ */ e("li", { className: "pcoi-signals__item", children: t }, p)) })
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
- X.displayName = "SignalsPanel";
265
- const Z = _.forwardRef(
264
+ Z.displayName = "SignalsPanel";
265
+ const U = _.forwardRef(
266
266
  ({
267
- links: c = [
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: o = `Portable, Company-Owned
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: l = "",
279
- ...i
280
- }, s) => /* @__PURE__ */ n("footer", { ref: s, className: `pcoi-footer ${l}`, ...i, children: [
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: o })
284
+ /* @__PURE__ */ e("p", { className: "pcoi-footer__tagline", children: l })
285
285
  ] }),
286
- /* @__PURE__ */ e("div", { className: "pcoi-footer__links", children: c.map((r) => /* @__PURE__ */ e("a", { href: r.href, "data-track-id": r.trackingId, children: r.label }, r.href)) })
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
- Z.displayName = "Footer";
292
- const U = _.forwardRef(
291
+ U.displayName = "Footer";
292
+ const ee = _.forwardRef(
293
293
  ({
294
- label: c,
295
- name: o,
294
+ label: i,
295
+ name: l,
296
296
  options: a,
297
- placeholder: l,
298
- error: i,
297
+ placeholder: o,
298
+ error: c,
299
299
  required: s = !1,
300
300
  disabled: r = !1,
301
- className: t = "",
301
+ className: d = "",
302
302
  ...p
303
- }, d) => {
304
- const h = `pcoi-field-${o}`, m = i ? `${h}-error` : void 0, u = [
303
+ }, t) => {
304
+ const h = `pcoi-field-${l}`, m = c ? `${h}-error` : void 0, N = [
305
305
  "pcoi-select",
306
- i ? "pcoi-select--error" : "",
306
+ c ? "pcoi-select--error" : "",
307
307
  r ? "pcoi-select--disabled" : "",
308
- t
308
+ d
309
309
  ].filter(Boolean).join(" ");
310
- return /* @__PURE__ */ n("div", { className: u, children: [
310
+ return /* @__PURE__ */ n("div", { className: N, children: [
311
311
  /* @__PURE__ */ n("label", { htmlFor: h, className: "pcoi-select__label", children: [
312
- c,
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: d,
319
+ ref: t,
320
320
  id: h,
321
- name: o,
321
+ name: l,
322
322
  required: s,
323
323
  disabled: r,
324
- "aria-invalid": !!i,
324
+ "aria-invalid": !!c,
325
325
  "aria-describedby": m,
326
326
  className: "pcoi-select__native",
327
- defaultValue: l ? "" : void 0,
327
+ defaultValue: o ? "" : void 0,
328
328
  ...p,
329
329
  children: [
330
- l && /* @__PURE__ */ e("option", { value: "", disabled: !0, hidden: !0, children: l }),
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(A, { size: 16 }) })
335
+ /* @__PURE__ */ e("span", { className: "pcoi-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(z, { size: 16 }) })
336
336
  ] }),
337
- i && /* @__PURE__ */ e("span", { id: m, className: "pcoi-select__error", role: "alert", children: i })
337
+ c && /* @__PURE__ */ e("span", { id: m, className: "pcoi-select__error", role: "alert", children: c })
338
338
  ] });
339
339
  }
340
340
  );
341
- U.displayName = "Select";
342
- const ee = _.forwardRef(
341
+ ee.displayName = "Select";
342
+ const ae = _.forwardRef(
343
343
  ({
344
- label: c,
345
- name: o,
344
+ label: i,
345
+ name: l,
346
346
  error: a,
347
- disabled: l = !1,
348
- className: i = "",
347
+ disabled: o = !1,
348
+ className: c = "",
349
349
  ...s
350
350
  }, r) => {
351
- const t = `pcoi-field-${o}`, p = a ? `${t}-error` : void 0, d = [
351
+ const d = `pcoi-field-${l}`, p = a ? `${d}-error` : void 0, t = [
352
352
  "pcoi-checkbox",
353
353
  a ? "pcoi-checkbox--error" : "",
354
- l ? "pcoi-checkbox--disabled" : "",
355
- i
354
+ o ? "pcoi-checkbox--disabled" : "",
355
+ c
356
356
  ].filter(Boolean).join(" ");
357
- return /* @__PURE__ */ n("div", { className: d, children: [
358
- /* @__PURE__ */ n("label", { htmlFor: t, className: "pcoi-checkbox__control", children: [
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: t,
365
- name: o,
366
- disabled: l,
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: c })
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
- ee.displayName = "Checkbox";
381
- const ae = _.forwardRef(
380
+ ae.displayName = "Checkbox";
381
+ const ie = _.forwardRef(
382
382
  ({
383
- label: c,
384
- name: o,
383
+ label: i,
384
+ name: l,
385
385
  error: a,
386
- disabled: l = !1,
387
- className: i = "",
386
+ disabled: o = !1,
387
+ className: c = "",
388
388
  ...s
389
389
  }, r) => {
390
- const t = `pcoi-field-${o}`, p = a ? `${t}-error` : void 0, d = [
390
+ const d = `pcoi-field-${l}`, p = a ? `${d}-error` : void 0, t = [
391
391
  "pcoi-toggle",
392
392
  a ? "pcoi-toggle--error" : "",
393
- l ? "pcoi-toggle--disabled" : "",
394
- i
393
+ o ? "pcoi-toggle--disabled" : "",
394
+ c
395
395
  ].filter(Boolean).join(" ");
396
- return /* @__PURE__ */ n("div", { className: d, children: [
397
- /* @__PURE__ */ n("label", { htmlFor: t, className: "pcoi-toggle__control", children: [
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: t,
404
- name: o,
405
- disabled: l,
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: c })
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
- ae.displayName = "Toggle";
420
+ ie.displayName = "Toggle";
421
421
  const ce = _.forwardRef(
422
422
  ({
423
- label: c,
424
- name: o,
423
+ label: i,
424
+ name: l,
425
425
  options: a,
426
- defaultValue: l,
427
- error: i,
426
+ defaultValue: o,
427
+ error: c,
428
428
  required: s = !1,
429
429
  disabled: r = !1,
430
- onChange: t,
430
+ onChange: d,
431
431
  className: p = "",
432
- ...d
432
+ ...t
433
433
  }, h) => {
434
- const m = i ? `pcoi-field-${o}-error` : void 0, u = [
434
+ const m = c ? `pcoi-field-${l}-error` : void 0, N = [
435
435
  "pcoi-radio-group",
436
- i ? "pcoi-radio-group--error" : "",
436
+ c ? "pcoi-radio-group--error" : "",
437
437
  r ? "pcoi-radio-group--disabled" : "",
438
438
  p
439
- ].filter(Boolean).join(" "), f = (N) => {
440
- t == null || t(N.target.value);
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: u,
447
- "aria-invalid": !!i,
446
+ className: N,
447
+ "aria-invalid": !!c,
448
448
  "aria-describedby": m,
449
- ...d,
449
+ ...t,
450
450
  children: [
451
451
  /* @__PURE__ */ n("legend", { className: "pcoi-radio-group__legend", children: [
452
- c,
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((N) => {
456
- const k = `pcoi-field-${o}-${N.value}`;
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: k,
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: k,
468
- name: o,
469
- value: N.value,
470
- defaultChecked: l === N.value,
467
+ id: C,
468
+ name: l,
469
+ value: u.value,
470
+ defaultChecked: o === u.value,
471
471
  required: s,
472
- disabled: r || N.disabled,
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: N.label })
478
+ /* @__PURE__ */ e("span", { className: "pcoi-radio-group__label", children: u.label })
479
479
  ]
480
480
  },
481
- N.value
481
+ u.value
482
482
  );
483
483
  }) }),
484
- i && /* @__PURE__ */ e("span", { id: m, className: "pcoi-radio-group__error", role: "alert", children: i })
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 ie = _.forwardRef(
491
+ const le = _.forwardRef(
492
492
  ({
493
- title: c,
494
- headingLevel: o = "h3",
493
+ title: i,
494
+ headingLevel: l = "h3",
495
495
  action: a,
496
- children: l,
497
- flush: i = !1,
496
+ children: o,
497
+ flush: c = !1,
498
498
  className: s = "",
499
499
  ...r
500
- }, t) => {
501
- const p = o, d = [
500
+ }, d) => {
501
+ const p = l, t = [
502
502
  "pcoi-panel",
503
- i ? "pcoi-panel--flush" : "",
503
+ c ? "pcoi-panel--flush" : "",
504
504
  s
505
505
  ].filter(Boolean).join(" ");
506
- return /* @__PURE__ */ n("div", { ref: t, className: d, ...r, children: [
507
- (c || a) && /* @__PURE__ */ n("div", { className: "pcoi-panel__header", children: [
508
- c && /* @__PURE__ */ e(p, { className: "pcoi-panel__title", children: c }),
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: l })
511
+ /* @__PURE__ */ e("div", { className: "pcoi-panel__body", children: o })
512
512
  ] });
513
513
  }
514
514
  );
515
- ie.displayName = "Panel";
516
- const le = _.forwardRef(
515
+ le.displayName = "Panel";
516
+ const oe = _.forwardRef(
517
517
  ({
518
- columns: c,
519
- rows: o,
518
+ columns: i,
519
+ rows: l,
520
520
  rowKey: a,
521
- emptyText: l = "No data available",
522
- ariaLabel: i,
521
+ emptyText: o = "No data available",
522
+ ariaLabel: c,
523
523
  className: s = "",
524
524
  ...r
525
- }, t) => {
526
- const p = (d, h) => a ? typeof a == "function" ? a(d, h) : String(d[a]) : String(h);
527
- return /* @__PURE__ */ e("div", { ref: t, className: `pcoi-data-table ${s}`, ...r, children: /* @__PURE__ */ n("table", { className: "pcoi-data-table__table", "aria-label": i, children: [
528
- /* @__PURE__ */ e("thead", { className: "pcoi-data-table__head", children: /* @__PURE__ */ e("tr", { className: "pcoi-data-table__head-row", children: c.map((d) => /* @__PURE__ */ e(
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${d.align ? ` pcoi-data-table__th--${d.align}` : ""}`,
532
- children: d.header
531
+ className: `pcoi-data-table__th${t.align ? ` pcoi-data-table__th--${t.align}` : ""}`,
532
+ children: t.header
533
533
  },
534
- d.key
534
+ t.key
535
535
  )) }) }),
536
- /* @__PURE__ */ e("tbody", { className: "pcoi-data-table__body", children: o.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
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: c.length,
539
+ colSpan: i.length,
540
540
  className: "pcoi-data-table__empty",
541
- children: l
541
+ children: o
542
542
  }
543
- ) }) : o.map((d, h) => /* @__PURE__ */ e(
543
+ ) }) : l.map((t, h) => /* @__PURE__ */ e(
544
544
  "tr",
545
545
  {
546
546
  className: "pcoi-data-table__row",
547
- children: c.map((m) => {
548
- const u = d[m.key];
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(u, d) : String(u ?? "")
553
+ children: m.render ? m.render(N, t) : String(N ?? "")
554
554
  },
555
555
  m.key
556
556
  );
557
557
  })
558
558
  },
559
- p(d, h)
559
+ p(t, h)
560
560
  )) })
561
561
  ] }) });
562
562
  }
563
563
  );
564
- le.displayName = "DataTable";
565
- const $ = _.forwardRef(
566
- ({ children: c, variant: o = "default", className: a = "", ...l }, i) => {
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--${o}`,
569
+ `pcoi-badge--${l}`,
570
570
  a
571
571
  ].filter(Boolean).join(" ");
572
- return /* @__PURE__ */ e("span", { ref: i, className: s, ...l, children: c });
572
+ return /* @__PURE__ */ e("span", { ref: c, className: s, ...o, children: i });
573
573
  }
574
574
  );
575
- $.displayName = "Badge";
576
- const T = ({
577
- open: c,
578
- onClose: o,
579
- title: a,
580
- headingLevel: l = "h2",
581
- size: i = "default",
582
- children: s,
583
- footer: r,
584
- className: t = "",
585
- ...p
586
- }) => {
587
- const d = w(null), h = w(null), m = l, u = a ? "pcoi-modal-title" : void 0, f = x(
588
- (b) => {
589
- if (b.key === "Escape") {
590
- o();
591
- return;
592
- }
593
- if (b.key === "Tab" && d.current) {
594
- const v = d.current.querySelectorAll(
595
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
596
- );
597
- if (v.length === 0) return;
598
- const B = v[0], S = v[v.length - 1];
599
- b.shiftKey && document.activeElement === B ? (b.preventDefault(), S.focus()) : !b.shiftKey && document.activeElement === S && (b.preventDefault(), B.focus());
600
- }
601
- },
602
- [o]
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
- b == null || b.focus();
610
- })), () => {
611
- var b;
612
- document.removeEventListener("keydown", f), document.body.style.overflow = "", (b = h.current) == null || b.focus();
613
- }), [c, f]);
614
- const N = (b) => {
615
- b.target === b.currentTarget && o();
616
- };
617
- if (!c) return null;
618
- const k = ["pcoi-modal", t].filter(Boolean).join(" ");
619
- return F(
620
- /* @__PURE__ */ e("div", { className: k, onClick: N, children: /* @__PURE__ */ n(
621
- "div",
622
- {
623
- ref: d,
624
- className: `pcoi-modal__dialog${i === "wide" ? " pcoi-modal__dialog--wide" : ""}`,
625
- role: "dialog",
626
- "aria-modal": "true",
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
- type: "button",
681
- className: "pcoi-toast__close",
682
- onClick: t,
683
- "aria-label": "Dismiss notification",
684
- children: /* @__PURE__ */ e(E, { size: 16 })
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
- document.body
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
- oe.displayName = "Toast";
692
- const D = _.forwardRef(({ label: c, icon: o, className: a = "", ...l }, i) => {
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: i, type: "button", className: s, ...l, children: [
695
- o && /* @__PURE__ */ e("span", { className: "pcoi-suggestion-card__icon", children: o }),
696
- /* @__PURE__ */ e("span", { className: "pcoi-suggestion-card__label", children: c })
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
- D.displayName = "SuggestionCard";
700
- const O = _.forwardRef(
701
- ({ index: c, excerpt: o, sourceTitle: a, onSourceClick: l, className: i = "", ...s }, r) => {
702
- const t = ["pcoi-cited-excerpt", i].filter(Boolean).join(" ");
703
- return /* @__PURE__ */ n("div", { ref: r, className: t, ...s, children: [
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: l,
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: l,
740
+ onClick: o,
741
+ "aria-label": `Citation ${i}, view source: ${a}`,
720
742
  children: [
721
743
  "[",
722
- c,
744
+ i,
723
745
  "]"
724
746
  ]
725
747
  }
726
748
  ),
727
- /* @__PURE__ */ e("p", { className: "pcoi-cited-excerpt__text", children: o })
749
+ /* @__PURE__ */ e("p", { className: "pcoi-cited-excerpt__text", children: l })
728
750
  ] })
729
751
  ] });
730
752
  }
731
753
  );
732
- O.displayName = "CitedExcerpt";
754
+ D.displayName = "CitedExcerpt";
733
755
  const P = _.forwardRef(
734
756
  ({
735
- value: c,
736
- onChange: o,
757
+ value: i,
758
+ onChange: l,
737
759
  onSubmit: a,
738
- placeholder: l = "Ask a question…",
739
- disabled: i = !1,
760
+ placeholder: o = "Ask a question…",
761
+ disabled: c = !1,
740
762
  loading: s = !1,
741
763
  className: r = "",
742
- ...t
764
+ ...d
743
765
  }, p) => {
744
- const d = w(null), h = x(
766
+ const t = w(null), h = $(
745
767
  (f) => {
746
- f.key === "Enter" && !f.shiftKey && (f.preventDefault(), c.trim() && !i && !s && a(c.trim()));
768
+ f.key === "Enter" && !f.shiftKey && (f.preventDefault(), i.trim() && !c && !s && a(i.trim()));
747
769
  },
748
- [c, i, s, a]
749
- ), m = x(() => {
750
- c.trim() && !i && !s && a(c.trim());
751
- }, [c, i, s, a]), u = ["pcoi-prompt-bar", r].filter(Boolean).join(" ");
752
- return /* @__PURE__ */ n("div", { ref: p, className: u, ...t, children: [
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: d,
778
+ ref: t,
757
779
  className: "pcoi-prompt-bar__input",
758
- value: c,
759
- onChange: (f) => o(f.target.value),
780
+ value: i,
781
+ onChange: (f) => l(f.target.value),
760
782
  onKeyDown: h,
761
- placeholder: l,
762
- disabled: i,
783
+ placeholder: o,
784
+ disabled: c,
763
785
  rows: 1,
764
- "aria-label": l
786
+ "aria-label": o
765
787
  }
766
788
  ),
767
789
  /* @__PURE__ */ e("div", { className: "pcoi-prompt-bar__actions", children: /* @__PURE__ */ e(
768
- R,
790
+ k,
769
791
  {
770
792
  variant: "primary",
771
793
  className: "pcoi-prompt-bar__send",
772
794
  onClick: m,
773
- disabled: i || s || !c.trim(),
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(z, { size: 16 }) })
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 H = _.forwardRef(
783
- ({ role: c, children: o, citations: a, timestamp: l, onCitationClick: i, className: s = "", ...r }, t) => {
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--${c}`,
808
+ `pcoi-chat-message--${i}`,
787
809
  s
788
810
  ].filter(Boolean).join(" ");
789
- return /* @__PURE__ */ n("div", { ref: t, className: p, ...r, children: [
790
- /* @__PURE__ */ e("div", { className: "pcoi-chat-message__header", children: /* @__PURE__ */ e($, { variant: c === "assistant" ? "default" : "info", children: c === "assistant" ? "PCOI" : "You" }) }),
791
- /* @__PURE__ */ e("div", { className: "pcoi-chat-message__body", children: o }),
792
- a && a.length > 0 && /* @__PURE__ */ e("div", { className: "pcoi-chat-message__citations", children: a.map((d) => /* @__PURE__ */ e(
793
- O,
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: d.index,
796
- excerpt: d.excerpt,
797
- sourceTitle: d.sourceTitle,
798
- onSourceClick: () => i == null ? void 0 : i(d)
817
+ index: t.index,
818
+ excerpt: t.excerpt,
819
+ sourceTitle: t.sourceTitle,
820
+ onSourceClick: () => c == null ? void 0 : c(t)
799
821
  },
800
- d.index
822
+ t.index
801
823
  )) }),
802
- l && /* @__PURE__ */ e("time", { className: "pcoi-chat-message__timestamp", children: l })
824
+ o && /* @__PURE__ */ e("time", { className: "pcoi-chat-message__timestamp", children: o })
803
825
  ] });
804
826
  }
805
827
  );
806
- H.displayName = "ChatMessage";
807
- const M = _.forwardRef(({ suggestions: c, onSelect: o, className: a = "", ...l }, i) => {
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: i, className: s, ...l, children: c.map((r) => /* @__PURE__ */ e(
810
- D,
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: () => o(r)
836
+ onClick: () => l(r)
815
837
  },
816
838
  r.id
817
839
  )) });
818
840
  });
819
- M.displayName = "SuggestionCards";
820
- const q = _.forwardRef(({ children: c, className: o = "", ...a }, l) => {
821
- const i = w(null);
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 = i.current;
845
+ const r = c.current;
824
846
  if (!r) return;
825
- const t = () => {
847
+ const d = () => {
826
848
  requestAnimationFrame(() => {
827
- r.scrollTop = r.scrollHeight;
849
+ const t = r.lastElementChild;
850
+ t ? t.scrollIntoView({ block: "nearest" }) : r.scrollTop = r.scrollHeight;
828
851
  });
829
- }, p = new MutationObserver(t);
830
- return p.observe(r, { childList: !0, subtree: !0 }), t(), () => p.disconnect();
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", o].filter(Boolean).join(" ");
833
- return /* @__PURE__ */ e("div", { ref: l, className: s, ...a, children: /* @__PURE__ */ e("div", { ref: i, className: "pcoi-chat-message-list__inner", children: c }) });
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 re = _.forwardRef(
837
- ({ open: c, onClose: o, title: a, sourceLabel: l, children: i, highlightId: s, highlightIndex: r, className: t = "", ...p }, d) => {
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
- c && s && h.current && requestAnimationFrame(() => {
841
- var N;
842
- const f = (N = h.current) == null ? void 0 : N.querySelector(`#${CSS.escape(s)}`);
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
- }, [c, s, r]);
846
- const m = ["pcoi-doc-overlay", t].filter(Boolean).join(" "), u = l ? _.createElement(
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($, null, l)
872
+ _.createElement(R, null, o)
850
873
  ) : void 0;
851
874
  return _.createElement(
852
875
  T,
853
876
  {
854
- open: c,
855
- onClose: o,
877
+ ref: t,
878
+ open: i,
879
+ onClose: l,
856
880
  title: a,
857
881
  size: "wide",
858
- footer: u,
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
- i
889
+ c
866
890
  )
867
891
  );
868
892
  }
869
893
  );
870
- re.displayName = "DocumentOverlay";
871
- const L = _.forwardRef(({ label: c = "PCOI", className: o = "", ...a }, l) => {
872
- const i = ["pcoi-typing-indicator", o].filter(Boolean).join(" ");
873
- return /* @__PURE__ */ n("div", { ref: l, className: i, ...a, children: [
874
- /* @__PURE__ */ e("div", { className: "pcoi-typing-indicator__header", children: /* @__PURE__ */ e($, { children: c }) }),
875
- /* @__PURE__ */ n("div", { className: "pcoi-typing-indicator__dots", "aria-label": "Typing", children: [
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
- L.displayName = "TypingIndicator";
883
- const se = _.forwardRef(
906
+ A.displayName = "TypingIndicator";
907
+ const ne = _.forwardRef(
884
908
  ({
885
- messages: c,
886
- suggestions: o,
909
+ messages: i,
910
+ suggestions: l,
887
911
  promptValue: a,
888
- onPromptChange: l,
889
- onPromptSubmit: i,
912
+ onPromptChange: o,
913
+ onPromptSubmit: c,
890
914
  onSuggestionSelect: s,
891
915
  onCitationClick: r,
892
- placeholder: t,
916
+ placeholder: d,
893
917
  loading: p = !1,
894
- className: d = "",
918
+ className: t = "",
895
919
  ...h
896
920
  }, m) => {
897
- const u = c.length === 0, f = [
921
+ const N = i.length === 0, f = [
898
922
  "pcoi-chat",
899
- u ? "pcoi-chat--empty" : "",
900
- d
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
- u ? /* @__PURE__ */ e("div", { className: "pcoi-chat__empty-state", children: o && o.length > 0 && s && /* @__PURE__ */ e("div", { className: "pcoi-chat__suggestions", children: /* @__PURE__ */ e(
904
- M,
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: o,
930
+ suggestions: l,
907
931
  onSelect: s
908
932
  }
909
- ) }) }) : /* @__PURE__ */ n(q, { className: "pcoi-chat__messages", children: [
910
- c.map((N) => /* @__PURE__ */ e(
911
- H,
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: N.role,
914
- citations: N.citations,
915
- timestamp: N.timestamp,
937
+ role: u.role,
938
+ citations: u.citations,
939
+ timestamp: u.timestamp,
916
940
  onCitationClick: r,
917
- children: N.content
941
+ children: u.content
918
942
  },
919
- N.id
943
+ u.id
920
944
  )),
921
- p && /* @__PURE__ */ e(L, {})
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: l,
928
- onSubmit: i,
929
- placeholder: t,
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
- se.displayName = "ChatInterface";
961
+ ne.displayName = "ChatInterface";
938
962
  export {
939
- $ as Badge,
940
- R as Button,
941
- Q as Callout,
942
- Y as Card,
943
- se as ChatInterface,
944
- H as ChatMessage,
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
- ee as Checkbox,
947
- O as CitedExcerpt,
948
- G as ComparisonTable,
949
- J as ContactForm,
950
- le as DataTable,
951
- re as DocumentOverlay,
952
- Z as Footer,
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
- V as HowStep,
979
+ G as HowStep,
955
980
  I as LogoMark,
956
981
  T as Modal,
957
982
  W as Nav,
958
- ie as Panel,
983
+ le as Panel,
959
984
  P as PromptBar,
960
985
  ce as RadioGroup,
961
986
  K as SectionHeader,
962
- U as Select,
963
- X as SignalsPanel,
964
- D as SuggestionCard,
965
- M as SuggestionCards,
966
- oe as Toast,
967
- ae as Toggle,
968
- L as TypingIndicator
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
  };