@spear-ai/spectral 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
- declare const titleIconColors: {
3
+ declare const variantColors: {
4
4
  success: string;
5
5
  warning: string;
6
6
  danger: string;
@@ -11,9 +11,11 @@ export declare const AlertBase: import('react').ForwardRefExoticComponent<HTMLAt
11
11
  variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
12
12
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLDivElement>>;
13
13
  export declare const AlertTitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
14
- variant: keyof typeof titleIconColors;
14
+ variant: keyof typeof variantColors;
15
+ } & import('react').RefAttributes<HTMLParagraphElement>>;
16
+ export declare const AlertDescription: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & {
17
+ variant: keyof typeof variantColors;
15
18
  } & import('react').RefAttributes<HTMLParagraphElement>>;
16
- export declare const AlertDescription: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
17
19
  type AlertPortalProps = {
18
20
  children: ReactNode;
19
21
  container?: Element | DocumentFragment;
@@ -1,46 +1,46 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { jsx as l } from "react/jsx-runtime";
4
- import { cn as s } from "../utils/twUtils.js";
5
- import { c as n } from "../index-D29mdTf5.js";
6
- import { forwardRef as i, useState as o, useEffect as d } from "react";
7
- import { createPortal as c } from "react-dom";
8
- const g = n(
9
- `fixed top-2 left-1/2 -translate-x-1/2 z-50 w-full max-w-md rounded-md border px-4 py-3 text-sm flex has-[>svg]:grid-cols-[6_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-2 gap-y-0.5
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ import { cn as l } from "../utils/twUtils.js";
5
+ import { c as o } from "../index-D29mdTf5.js";
6
+ import { forwardRef as i, useState as d, useEffect as c } from "react";
7
+ import { createPortal as f } from "react-dom";
8
+ const g = o(
9
+ `fixed top-2 left-1/2 -translate-x-1/2 z-50 w-full max-w-md rounded-md border px-4 py-3 text-sm flex has-[>svg]:grid-cols-[6_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-2 [&>svg]items-start gap-y-0.5
10
10
  items-start [&>svg]:size-6 [&>svg]:translate-y-0.5 transform transition-all duration-300 ease-in-out translate-y-0 opacity-100 scale-100 animate-in slide-in-from-top-full fade-in duration-300`,
11
11
  {
12
12
  variants: {
13
13
  variant: {
14
- default: "bg-alert-bg text-alert-text border-alert-border",
15
- success: "bg-alert-success-bg border-alert-success-border [&>svg]:!text-alert-success-text [&>svg]items-start",
16
- warning: "bg-alert-warning-bg border-alert-warning-border [&>svg]:!text-alert-warning-text [&_[data-slot='alert-title']]:!text-alert-warning-text",
17
- danger: "bg-alert-danger-bg border-alert-danger-border [&>svg]:!text-alert-danger-text [&_[data-slot='alert-title']]:!text-alert-danger-text",
18
- info: "bg-alert-info-bg border-alert-info-border [&>svg]:!text-alert-info-text [&_[data-slot='alert-title']]:!text-alert-info-text"
14
+ default: "bg-alert-bg border-alert-border",
15
+ success: "bg-alert-success-bg border-alert-success-border",
16
+ warning: "bg-alert-warning-bg border-alert-warning-border",
17
+ danger: "bg-alert-danger-bg border-alert-danger-border",
18
+ info: "bg-alert-info-bg border-alert-info-border"
19
19
  }
20
20
  },
21
21
  defaultVariants: {
22
22
  variant: "default"
23
23
  }
24
24
  }
25
- ), x = {
26
- success: "text-alert-success-text",
27
- warning: "text-alert-warning-text",
28
- danger: "text-alert-danger-text",
29
- info: "text-alert-info-text",
30
- default: "text-alert-text"
31
- }, f = i(({ className: t, variant: e, ...a }, r) => /* @__PURE__ */ l("div", { className: s(g({ variant: e }), t), "data-slot": "alert", "data-testid": "spectral-alert", ref: r, role: "alert", ...a }));
32
- f.displayName = "AlertBase";
33
- const m = i(({ className: t, variant: e, ...a }, r) => /* @__PURE__ */ l("div", { className: s(x[e], "col-start-2 line-clamp-1 min-h-4 font-semibold text-base tracking-tight h-6 flex items-center", t), "data-slot": "alert-title", "data-testid": "spectral-alert-title", ref: r, ...a }));
34
- m.displayName = "AlertTitle";
35
- const u = i(({ className: t, ...e }, a) => /* @__PURE__ */ l("div", { className: s("text-primary-inverse col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", t), "data-slot": "alert-description", "data-testid": "spectral-alert-description", ref: a, ...e }));
36
- u.displayName = "AlertDescription";
37
- function A({ children: t, container: e }) {
38
- const [a, r] = o(!1);
39
- return d(() => (r(!0), () => r(!1)), []), a ? c(t, e ?? document.body) : null;
25
+ ), n = {
26
+ success: "text-alert-success-text [&_p]:!text-alert-success-text",
27
+ warning: "text-alert-warning-text [&_p]:!text-alert-warning-text",
28
+ danger: "text-alert-danger-text [&_p]:!text-alert-danger-text",
29
+ info: "text-alert-info-text [&_p]:!text-alert-info-text",
30
+ default: "text-alert-text [&_p]:!text-alert-text"
31
+ }, m = i(({ className: e, variant: r, ...a }, t) => /* @__PURE__ */ s("div", { className: l(g({ variant: r }), e), "data-slot": "alert", "data-testid": "spectral-alert", ref: t, role: "alert", ...a }));
32
+ m.displayName = "AlertBase";
33
+ const x = i(({ className: e, variant: r, ...a }, t) => /* @__PURE__ */ s("div", { className: l(n[r], "col-start-2 line-clamp-1 min-h-4 font-semibold text-base tracking-tight h-6 flex items-center", e), "data-slot": "alert-title", "data-testid": "spectral-alert-title", ref: t, ...a }));
34
+ x.displayName = "AlertTitle";
35
+ const p = i(({ className: e, variant: r, ...a }, t) => /* @__PURE__ */ s("div", { className: l(n[r], "col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", e), "data-slot": "alert-description", "data-testid": "spectral-alert-description", ref: t, ...a }));
36
+ p.displayName = "AlertDescription";
37
+ function _({ children: e, container: r }) {
38
+ const [a, t] = d(!1);
39
+ return c(() => (t(!0), () => t(!1)), []), a ? f(e, r ?? document.body) : null;
40
40
  }
41
41
  export {
42
- f as AlertBase,
43
- u as AlertDescription,
44
- A as AlertPortal,
45
- m as AlertTitle
42
+ m as AlertBase,
43
+ p as AlertDescription,
44
+ _ as AlertPortal,
45
+ x as AlertTitle
46
46
  };
package/dist/Alert.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
3
  import { jsx as t, jsxs as m } from "react/jsx-runtime";
4
- import { AlertPortal as y, AlertBase as h, AlertTitle as v, AlertDescription as A } from "./Alert/AlertBase.js";
4
+ import { AlertPortal as y, AlertBase as h, AlertTitle as A, AlertDescription as v } from "./Alert/AlertBase.js";
5
5
  import "./Icons/AnalyzeIcon.js";
6
6
  import "./Icons/AnnotationsIcon.js";
7
7
  import "./Icons/ApprovedIcon.js";
@@ -61,34 +61,34 @@ import "./Icons/ZoomXIcon.js";
61
61
  import "./Icons/ZoomYIcon.js";
62
62
  import { cn as g } from "./utils/twUtils.js";
63
63
  import { useRef as R, useEffect as T } from "react";
64
- const Vt = ({ id: n, description: a, onClose: s, icon: l, title: c, className: d, variant: o = "default" }) => {
65
- const r = R(null), u = l || {
64
+ const Vt = ({ id: n, description: s, onClose: a, icon: l, title: c, className: d, variant: r = "default" }) => {
65
+ const o = R(null), u = l || {
66
66
  info: /* @__PURE__ */ t(E, {}),
67
67
  success: /* @__PURE__ */ t(w, {}),
68
68
  warning: /* @__PURE__ */ t(N, {}),
69
69
  danger: /* @__PURE__ */ t(b, {}),
70
70
  default: null
71
- }[o];
71
+ }[r];
72
72
  T(() => {
73
73
  const e = (p) => {
74
- p.key === "Escape" && r.current && (p.preventDefault(), i());
74
+ p.key === "Escape" && o.current && (p.preventDefault(), i());
75
75
  };
76
76
  return document.addEventListener("keydown", e), () => {
77
77
  document.removeEventListener("keydown", e);
78
78
  };
79
79
  }, []);
80
80
  const i = () => {
81
- r.current && (r.current.style.opacity = "0", setTimeout(() => {
82
- r.current && (r.current.style.display = "none"), s?.();
81
+ o.current && (o.current.style.opacity = "0", setTimeout(() => {
82
+ o.current && (o.current.style.display = "none"), a?.();
83
83
  }, 300));
84
84
  }, f = () => {
85
85
  i();
86
- }, I = (/* @__PURE__ */ new Set(["danger", "warning"])).has(o) ? "assertive" : "polite";
87
- return /* @__PURE__ */ t(y, { children: /* @__PURE__ */ m(h, { "aria-live": I, className: g("alert-wrapper transition-opacity duration-300", d), "data-slot": "alert", "data-variant": o, id: n, ref: r, variant: o, children: [
86
+ }, I = (/* @__PURE__ */ new Set(["danger", "warning"])).has(r) ? "assertive" : "polite";
87
+ return /* @__PURE__ */ t(y, { children: /* @__PURE__ */ m(h, { "aria-live": I, className: g("alert-wrapper transition-opacity duration-300", d), "data-slot": "alert", "data-variant": r, id: n, ref: o, variant: r, children: [
88
88
  u,
89
89
  /* @__PURE__ */ m("div", { className: "content-wrapper", children: [
90
- /* @__PURE__ */ t(v, { "data-slot": "alert-title", variant: o, children: c }),
91
- /* @__PURE__ */ t(A, { "data-slot": "alert-description", children: a })
90
+ /* @__PURE__ */ t(A, { "data-slot": "alert-title", variant: r, children: c }),
91
+ /* @__PURE__ */ t(v, { "data-slot": "alert-description", variant: r, children: s })
92
92
  ] }),
93
93
  /* @__PURE__ */ t(
94
94
  C,
package/dist/Avatar.js CHANGED
@@ -2,26 +2,26 @@
2
2
  import "./styles/main.css";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  import { cn as s } from "./utils/twUtils.js";
5
- import { useState as x, useEffect as v, isValidElement as w, cloneElement as p } from "react";
5
+ import { useState as g, useEffect as v, isValidElement as w, cloneElement as p } from "react";
6
6
  const y = {
7
7
  sm: "h-8 w-8",
8
8
  md: "h-10 w-10",
9
9
  lg: "h-12 w-12"
10
10
  }, f = {
11
- sm: "text-sm",
12
- md: "text-lg",
13
- lg: "text-2xl"
11
+ sm: "text-xs",
12
+ md: "text-base",
13
+ lg: "text-xl"
14
14
  }, b = {
15
15
  sm: 24,
16
16
  md: 32,
17
17
  lg: 40
18
18
  }, j = (l) => {
19
- const i = l.trim();
20
- if (!i) return "?";
21
- const t = i.split(/\s+/).filter(Boolean);
19
+ const o = l.trim();
20
+ if (!o) return "?";
21
+ const t = o.split(/\s+/).filter(Boolean);
22
22
  return t.length === 0 ? "?" : t.length === 1 ? t[0].charAt(0).toUpperCase() : (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase();
23
- }, k = ({ alt: l, className: i, icon: t, imageSource: a, fallback: o, size: n = "md", userFullName: c }) => {
24
- const [m, d] = x("loading");
23
+ }, k = ({ alt: l, className: o, icon: t, imageSource: a, fallback: i, size: n = "md", userFullName: c }) => {
24
+ const [m, d] = g("loading");
25
25
  v(() => {
26
26
  if (!a) return;
27
27
  d("loading");
@@ -32,7 +32,7 @@ const y = {
32
32
  }, [a]);
33
33
  const h = () => {
34
34
  if (c)
35
- return /* @__PURE__ */ r("span", { "aria-label": `${c} avatar`, className: s("flex items-center justify-center w-full h-full font-bold text-text-primary tracking-tighter", f[n]), "data-testid": "spectral-avatar-initials", children: j(c) });
35
+ return /* @__PURE__ */ r("span", { "aria-label": `${c} avatar`, className: s("flex items-center justify-center w-full h-full font-bold text-text-primary tracking-tighter font-stretch-condensed", f[n]), "data-testid": "spectral-avatar-initials", children: j(c) });
36
36
  if (t) {
37
37
  const e = b[n];
38
38
  return /* @__PURE__ */ r("span", { className: "flex items-center justify-center w-full h-full", children: w(t) ? (() => {
@@ -41,18 +41,18 @@ const y = {
41
41
  "aria-hidden": "true"
42
42
  };
43
43
  if (t.type.displayName?.includes("Icon") ?? !1) {
44
- const g = {
44
+ const x = {
45
45
  ...u,
46
46
  size: e
47
47
  };
48
- return p(t, g);
48
+ return p(t, x);
49
49
  }
50
50
  return p(t, u);
51
51
  })() : t });
52
52
  }
53
- return a && m === "loaded" ? /* @__PURE__ */ r("img", { alt: l || "Avatar", "aria-label": l || "Avatar", className: "absolute inset-0 w-full h-full object-cover rounded-full", "data-testid": "spectral-avatar-image", role: "img", src: a }) : a && m === "error" && o ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center w-full h-full", "data-testid": "spectral-avatar-img-error-fallback", children: o }) : o ? /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full text-text-primary", f[n]), "data-testid": "spectral-avatar-fallback", children: o }) : /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full font-bold border-2 border-danger-400 text-danger-400 rounded-full font-bold", f[n]), "data-testid": "spectral-avatar-last-resort", children: "?" });
53
+ return a && m === "loaded" ? /* @__PURE__ */ r("img", { alt: l || "Avatar", "aria-label": l || "Avatar", className: "absolute inset-0 w-full h-full object-cover rounded-full", "data-testid": "spectral-avatar-image", role: "img", src: a }) : a && m === "error" && i ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center w-full h-full", "data-testid": "spectral-avatar-img-error-fallback", children: i }) : i ? /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full text-text-primary", f[n]), "data-testid": "spectral-avatar-fallback", children: i }) : /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full font-bold border-2 border-danger-400 text-danger-400 rounded-full font-bold", f[n]), "data-testid": "spectral-avatar-last-resort", children: "?" });
54
54
  };
55
- return /* @__PURE__ */ r("div", { className: s("relative inline-flex items-center justify-center overflow-hidden rounded-full shrink-0 bg-level-two", y[n], i), "data-slot": "avatar", "data-testid": "spectral-avatar", children: h() });
55
+ return /* @__PURE__ */ r("div", { className: s("relative inline-flex items-center justify-center overflow-hidden rounded-full shrink-0 bg-level-two", y[n], o), "data-slot": "avatar", "data-testid": "spectral-avatar", children: h() });
56
56
  };
57
57
  export {
58
58
  k as Avatar
package/dist/Button.js CHANGED
@@ -5,13 +5,7 @@ import { ErrorMessage as y } from "./utils/formFieldUtils.js";
5
5
  import { cn as u } from "./utils/twUtils.js";
6
6
  import { c as h } from "./index-D29mdTf5.js";
7
7
  import { forwardRef as f } from "react";
8
- import { c as N } from "./createLucideIcon-B_8CJpcQ.js";
9
- /**
10
- * @license lucide-react v0.546.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
8
+ import { c as N } from "./createLucideIcon-D4r5Phnh.js";
15
9
  const w = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = N("loader-circle", w), j = h(
16
10
  `
17
11
  !font-sans flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer rounded-lg border font-semibold focus:outline-none focus:outline-none
@@ -6,7 +6,7 @@ import { c } from "../index-D29mdTf5.js";
6
6
  import "react";
7
7
  const l = c(
8
8
  `inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius,0.375rem)] text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none
9
- [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-accent focus-visible:outline-offset-2 focus-visible:outline-2 focus-visitble:outline-accent
9
+ [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-accent focus-visible:outline-offset-2 focus-visible:outline-2 focus-visible:outline-accent
10
10
  aria-invalid:ring-destructive/20 aria-invalid:border-destructive bg-level-one text-text-primary hover:bg-level-two cursor-pointer active:text-accent`,
11
11
  {
12
12
  variants: {
package/dist/Dialog.js CHANGED
@@ -3,19 +3,19 @@ import { jsx as o, Fragment as n } from "react/jsx-runtime";
3
3
  import { DialogBase as g, DialogCloseBase as c, DialogContentBase as f, DialogDescriptionBase as u, DialogFooterBase as m, DialogHeaderBase as p, DialogOverlayBase as D, DialogPortalBase as x, DialogTitleBase as T, DialogTriggerBase as B } from "./Dialog/DialogBase.js";
4
4
  import { cn as l } from "./utils/twUtils.js";
5
5
  import "react";
6
- function h({ ...a }) {
6
+ function v({ ...a }) {
7
7
  return /* @__PURE__ */ o(g, { "data-slot": "dialog", "data-testid": "spectral-dialog", ...a });
8
8
  }
9
- function v({ dataTestId: a, ...t }) {
10
- return /* @__PURE__ */ o(B, { asChild: !0, "data-slot": "dialog-trigger", dataTestId: a || "dialog-trigger", ...t });
9
+ function w({ dataTestId: a, ...t }) {
10
+ return /* @__PURE__ */ o(B, { "data-slot": "dialog-trigger", dataTestId: a || "dialog-trigger", ...t });
11
11
  }
12
- function w({ ...a }) {
12
+ function h({ ...a }) {
13
13
  return /* @__PURE__ */ o(x, { "data-slot": "dialog-portal", "data-testid": "dialog-portal", ...a });
14
14
  }
15
- function C({ dataTestId: a, ...t }) {
15
+ function z({ dataTestId: a, ...t }) {
16
16
  return /* @__PURE__ */ o(c, { "data-slot": "dialog-close", dataTestId: a || "dialog-close", ...t });
17
17
  }
18
- function z({ className: a, dataTestId: t, ...e }) {
18
+ function C({ className: a, dataTestId: t, ...e }) {
19
19
  return /* @__PURE__ */ o(
20
20
  D,
21
21
  {
@@ -65,14 +65,14 @@ function P({ className: a, dataTestId: t, ...e }) {
65
65
  return /* @__PURE__ */ o(u, { className: l("text-muted-foreground text-sm", a), "data-slot": "dialog-description", dataTestId: t || "dialog-description", ...e });
66
66
  }
67
67
  export {
68
- h as Dialog,
69
- C as DialogClose,
68
+ v as Dialog,
69
+ z as DialogClose,
70
70
  F as DialogContent,
71
71
  P as DialogDescription,
72
72
  H as DialogFooter,
73
73
  j as DialogHeader,
74
- z as DialogOverlay,
75
- w as DialogPortal,
74
+ C as DialogOverlay,
75
+ h as DialogPortal,
76
76
  O as DialogTitle,
77
- v as DialogTrigger
77
+ w as DialogTrigger
78
78
  };
package/dist/Drawer.d.ts CHANGED
@@ -1,13 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type DrawerProps = {
3
3
  children?: ReactNode;
4
+ defaultOpen?: boolean;
4
5
  description?: string;
5
6
  direction?: 'left' | 'right' | 'top' | 'bottom';
7
+ dismissible?: boolean;
8
+ modal?: boolean;
9
+ onOpenChange?: (open: boolean) => void;
10
+ open?: boolean;
6
11
  size?: string;
7
12
  title?: string;
8
13
  trigger: ReactNode;
9
- open?: boolean;
10
- onOpenChange?: (open: boolean) => void;
11
14
  };
12
- export declare const Drawer: ({ trigger, title, description, children, direction, size }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const Drawer: ({ children, defaultOpen, description, direction, dismissible, modal, onOpenChange, open, size, title, trigger }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
13
16
  //# sourceMappingURL=Drawer.d.ts.map
package/dist/Drawer.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./styles/main.css";
2
2
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
3
- import { SpectralProvider as x } from "./SpectralProvider.js";
3
+ import { SpectralProvider as f } from "./SpectralProvider.js";
4
4
  import { D as e } from "./index-CAKA12cC.js";
5
- const b = ({ trigger: d, title: o, description: i, children: c, direction: l = "right", size: r = "380px" }) => {
6
- const a = "!font-sans fixed", p = {
5
+ const u = ({ children: d, defaultOpen: o = !1, description: i, direction: l = "right", dismissible: c = !0, modal: p = !0, onOpenChange: n, open: m, size: r = "380px", title: x, trigger: h }) => {
6
+ const a = "!font-sans fixed", w = {
7
7
  left: {
8
8
  className: `${a} top-0 bottom-0 left-0 shadow-[20px_0_20px_rgba(0,0,0,0.4)]`,
9
9
  style: { width: r }
@@ -20,20 +20,20 @@ const b = ({ trigger: d, title: o, description: i, children: c, direction: l = "
20
20
  className: `${a} bottom-0 left-0 right-0 shadow-[0_-20px_20px_rgba(0,0,0,0.4)]`,
21
21
  style: { height: r }
22
22
  }
23
- }, { className: n, style: m } = p[l];
24
- return /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(e.Root, { direction: l, "data-testid": "spectral-drawer", children: [
25
- /* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children: d }),
23
+ }, { className: g, style: b } = w[l];
24
+ return /* @__PURE__ */ t(f, { children: /* @__PURE__ */ s(e.Root, { defaultOpen: o, dismissible: c, open: m, onOpenChange: n, direction: l, modal: p, "data-testid": "spectral-drawer", children: [
25
+ /* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children: h }),
26
26
  /* @__PURE__ */ s(e.Portal, { children: [
27
27
  /* @__PURE__ */ t(e.Overlay, { className: "fixed inset-0 bg-transparent", "data-testid": "spectral-drawer-overlay" }),
28
- /* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col outline-none [&_*]:box-border ${n}`, style: m, "data-testid": "spectral-drawer-content", children: /* @__PURE__ */ s("div", { children: [
28
+ /* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col outline-none [&_*]:box-border ${g}`, style: b, "data-testid": "spectral-drawer-content", children: /* @__PURE__ */ s("div", { children: [
29
29
  /* @__PURE__ */ t(e.Close, {}),
30
- /* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", "data-testid": "spectral-drawer-title", children: o }),
30
+ /* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", "data-testid": "spectral-drawer-title", children: x }),
31
31
  /* @__PURE__ */ t(e.Description, { className: "!text-text-secondary mb-2 px-3 !text-xs uppercase", "data-testid": "spectral-drawer-description", children: i }),
32
- /* @__PURE__ */ t("div", { className: "py-2 px-3 min-w-0 w-auto overflow-hidden [&>*]:min-w-0 [&_*]:min-w-0", "data-testid": "spectral-drawer-body", children: c })
32
+ /* @__PURE__ */ t("div", { className: "py-2 px-3 min-w-0 w-auto overflow-hidden [&>*]:min-w-0 [&_*]:min-w-0", "data-testid": "spectral-drawer-body", children: d })
33
33
  ] }) })
34
34
  ] })
35
35
  ] }) });
36
36
  };
37
37
  export {
38
- b as Drawer
38
+ u as Drawer
39
39
  };
package/dist/InputOTP.js CHANGED
@@ -280,6 +280,7 @@ const St = ht({}), Pt = ht(null), Ct = () => {
280
280
  onChange: E,
281
281
  onComplete: A,
282
282
  onPaste: I,
283
+ pasteTransformer: (l) => l.replaceAll("-", ""),
283
284
  pushPasswordManagerStrategy: "none",
284
285
  ref: g,
285
286
  role: "textbox",
@@ -61,13 +61,7 @@ import "../Icons/ZoomYIcon.js";
61
61
  import { ErrorMessage as me } from "../utils/formFieldUtils.js";
62
62
  import { cn as f } from "../utils/twUtils.js";
63
63
  import { forwardRef as be, useId as fe, useState as L, useRef as _, useMemo as T, useCallback as b, useEffect as ge } from "react";
64
- import { c as he } from "../createLucideIcon-B_8CJpcQ.js";
65
- /**
66
- * @license lucide-react v0.546.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */
64
+ import { c as he } from "../createLucideIcon-D4r5Phnh.js";
71
65
  const xe = [
72
66
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
73
67
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
@@ -432,7 +432,7 @@ const B = he(
432
432
  "data-testid": "spectral-radio-group-item",
433
433
  className: F(
434
434
  "relative aspect-square h-4.5 w-4.5 rounded-full border-2 border-border-subtle bg-radio-bg ring-black transition-colors cursor-pointer",
435
- "hover:border-radio-border--hover focus-visible:ring-1 focus-visible:ring-offset-2",
435
+ "hover:border-radio-border--hover focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-accent",
436
436
  "[&[data-state=checked]]:border-radio-border--selected [&[data-state=checked]]:bg-radio-bg",
437
437
  o && A,
438
438
  r
package/dist/Select.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
3
  type SelectOption = BaseOption;
4
4
  type Align = 'start' | 'center' | 'end';
5
5
  type Side = 'top' | 'bottom' | 'left' | 'right';
6
- export interface SelectProps extends Omit<ComponentPropsWithoutRef<'button'>, 'value' | 'onChange'>, BaseFormFieldProps {
6
+ export interface SelectProps extends Omit<ComponentPropsWithoutRef<'button'>, 'value' | 'onChange' | 'aria-disabled' | 'aria-invalid' | 'aria-required' | 'aria-describedby' | 'aria-label'>, BaseFormFieldProps {
7
7
  defaultValue?: string;
8
8
  emptyMessage?: ReactNode;
9
9
  id?: string;
package/dist/Select.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsxs as r, jsx as e, Fragment as v } from "react/jsx-runtime";
3
+ import { jsxs as r, jsx as t, Fragment as S } from "react/jsx-runtime";
4
4
  import "./Icons/AnalyzeIcon.js";
5
5
  import "./Icons/AnnotationsIcon.js";
6
6
  import "./Icons/ApprovedIcon.js";
@@ -8,7 +8,7 @@ import "./Icons/CalendarIcon.js";
8
8
  import "./Icons/CheckCircleIcon.js";
9
9
  import "./Icons/CheckSquareIcon.js";
10
10
  import { CheckmarkIcon as Q } from "./Icons/CheckmarkIcon.js";
11
- import { ChevronDownIcon as n } from "./Icons/ChevronDownIcon.js";
11
+ import { ChevronDownIcon as c } from "./Icons/ChevronDownIcon.js";
12
12
  import "./Icons/ChevronUpIcon.js";
13
13
  import "./Icons/ClockIcon.js";
14
14
  import "./Icons/CloseCircleIcon.js";
@@ -59,11 +59,11 @@ import "./Icons/ZoomAllIcon.js";
59
59
  import "./Icons/ZoomXIcon.js";
60
60
  import "./Icons/ZoomYIcon.js";
61
61
  import { Label as C } from "./Label.js";
62
- import { R as X, T as Y, f as Z, e as _, C as $, c as ee, V as te, S as re, d as I, G as ae, I as ie, b as oe, a as se } from "./index-CevVJ05e.js";
63
- import { useFormFieldId as le, useFormFieldState as de, getAriaProps as me, getErrorMessageId as ne, groupOptions as pe, getFormFieldCSSProperties as ce, getStateClasses as ue, getTriggerClasses as he, ErrorMessage as ge, LoadingState as fe, EmptyState as be, getOptionClasses as xe } from "./utils/formFieldUtils.js";
64
- import { cn as o } from "./utils/twUtils.js";
65
- import { forwardRef as ye, useState as Ne } from "react";
66
- const Se = ye(
62
+ import { R as X, T as Y, f as Z, e as _, C as $, c as tt, V as et, S as rt, d as I, G as at, I as st, b as it, a as ot } from "./index-CevVJ05e.js";
63
+ import { useFormFieldId as lt, useFormFieldState as dt, getAriaProps as mt, getErrorMessageId as ct, groupOptions as pt, getFormFieldCSSProperties as nt, getStateClasses as ut, getTriggerClasses as ht, ErrorMessage as gt, LoadingState as bt, EmptyState as ft, getOptionClasses as xt } from "./utils/formFieldUtils.js";
64
+ import { cn as i } from "./utils/twUtils.js";
65
+ import { forwardRef as yt, useState as Nt } from "react";
66
+ const vt = yt(
67
67
  ({
68
68
  align: w = "start",
69
69
  alignOffset: z = 0,
@@ -73,76 +73,76 @@ const Se = ye(
73
73
  emptyMessage: k = "No options found",
74
74
  errorMessage: p,
75
75
  id: L,
76
- label: s,
77
- labelClassName: c,
76
+ label: l,
77
+ labelClassName: n,
78
78
  loadingMessage: T = "Loading…",
79
79
  name: u,
80
80
  onChange: V,
81
81
  options: h = [],
82
- placeholder: D = "Select an option",
83
- position: E = "popper",
84
- side: P = "bottom",
85
- sideOffset: R = 4,
82
+ placeholder: q = "Select an option",
83
+ position: D = "popper",
84
+ side: E = "bottom",
85
+ sideOffset: P = 4,
86
86
  state: a = "default",
87
87
  value: g,
88
- "aria-label": q,
88
+ "aria-label": R,
89
89
  "aria-describedby": B,
90
- ...l
90
+ ...o
91
91
  }, G) => {
92
- const [f, M] = Ne(!1), i = le(L, u), b = ne(i), { isDisabled: d, isLoading: x, isInvalid: A } = de(l.disabled, a), H = me(a, b, B), { groups: y, ungrouped: N } = pe(h), U = () => {
92
+ const [b, M] = Nt(!1), s = lt(L, u), f = ct(s), { isDisabled: d, isLoading: x, isInvalid: A } = dt(o.disabled, a), H = mt(a, B, o.required, f), { groups: y, ungrouped: N } = pt(h), U = () => {
93
93
  if (x)
94
- return /* @__PURE__ */ e(fe, { message: T });
94
+ return /* @__PURE__ */ t(bt, { "data-testid": "spectral-select-loading", message: T });
95
95
  if (h.length === 0)
96
- return /* @__PURE__ */ e(be, { message: k });
97
- const S = (t) => {
98
- const m = g === t.value;
99
- return /* @__PURE__ */ r(ie, { className: o(xe(!!t.disabled, !1, m), "relative flex w-full cursor-pointer items-center"), disabled: t.disabled, value: t.value, children: [
100
- /* @__PURE__ */ e(oe, { className: "block truncate", children: t.label }),
101
- /* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "absolute right-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ e(Q, { size: 16 }) }) })
102
- ] }, t.value);
96
+ return /* @__PURE__ */ t(ft, { "data-testid": "spectral-select-empty", message: k });
97
+ const v = (e) => {
98
+ const m = g === e.value;
99
+ return /* @__PURE__ */ r(st, { className: i(xt(!!e.disabled, !1, m), "relative flex w-full cursor-pointer items-center"), "data-testid": "spectral-select-item", disabled: e.disabled, value: e.value, children: [
100
+ /* @__PURE__ */ t(it, { "data-testid": "spectral-select-item-text", className: "block truncate", children: e.label }),
101
+ /* @__PURE__ */ t(ot, { "data-testid": "spectral-select-item-selected-indicator", asChild: !0, children: /* @__PURE__ */ t("span", { className: "absolute right-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ t(Q, { size: 16 }) }) })
102
+ ] }, e.value);
103
103
  };
104
- return /* @__PURE__ */ r(v, { children: [
105
- N.length > 0 && /* @__PURE__ */ r(v, { children: [
106
- N.map(S),
107
- Object.keys(y).length > 0 && /* @__PURE__ */ e(I, { className: "-mx-1 my-1 h-px bg-border-secondary" })
104
+ return /* @__PURE__ */ r(S, { children: [
105
+ N.length > 0 && /* @__PURE__ */ r(S, { children: [
106
+ N.map(v),
107
+ Object.keys(y).length > 0 && /* @__PURE__ */ t(I, { className: "-mx-1 my-1 h-px bg-border-secondary", "data-testid": "spectral-select-separator" })
108
108
  ] }),
109
- Object.entries(y).map(([t, m], J) => /* @__PURE__ */ r(ae, { children: [
110
- J > 0 && /* @__PURE__ */ e(I, { className: "-mx-1 my-1 h-px bg-border-secondary" }),
111
- /* @__PURE__ */ e(C, { htmlFor: i, className: o("px-2 py-1.5 text-base font-semibold text-text-primary", c), children: t }),
112
- m.map((K) => S(K))
113
- ] }, t))
109
+ Object.entries(y).map(([e, m], J) => /* @__PURE__ */ r(at, { "data-testid": "spectral-select-group", children: [
110
+ J > 0 && /* @__PURE__ */ t(I, { className: "-mx-1 my-1 h-px bg-border-secondary", "data-testid": "spectral-select-group-separator" }),
111
+ /* @__PURE__ */ t(C, { "data-testid": "spectral-select-group-label", htmlFor: s, className: i("px-2 py-1.5 text-base font-semibold text-text-primary", n), children: e }),
112
+ m.map((K) => v(K))
113
+ ] }, e))
114
114
  ] });
115
115
  };
116
- return /* @__PURE__ */ r("div", { className: "w-full", "data-testid": "spectral-select-wrapper", children: [
117
- s && /* @__PURE__ */ e(C, { "data-testid": "spectral-select-label", htmlFor: i, className: o("block mb-4 text-text-primary", c, d && "text-text-secondary"), children: s }),
118
- /* @__PURE__ */ r(X, { "data-testid": "spectral-select", defaultValue: j, disabled: d, name: u, onOpenChange: M, onValueChange: V, open: f, required: l.required, value: g, children: [
119
- /* @__PURE__ */ e(
116
+ return /* @__PURE__ */ r("div", { className: "w-full", children: [
117
+ l && /* @__PURE__ */ t(C, { "data-testid": "spectral-select-label", htmlFor: s, className: i("block mb-4 text-text-primary", n, d && "text-text-secondary"), children: l }),
118
+ /* @__PURE__ */ r(X, { "data-testid": "spectral-select", defaultValue: j, disabled: d, name: u, onOpenChange: M, onValueChange: V, open: b, required: o.required, value: g, children: [
119
+ /* @__PURE__ */ t(
120
120
  Y,
121
121
  {
122
- "aria-controls": i,
123
- "aria-expanded": f,
124
- "aria-label": q || s,
122
+ "aria-controls": s,
123
+ "aria-expanded": b,
124
+ "aria-label": R || l,
125
125
  asChild: !0,
126
- className: o(he(!1, a), ue(a), F),
126
+ className: i(ht(!1, a), ut(a), F),
127
127
  "data-slot": "select-trigger",
128
128
  "data-state": a,
129
129
  "data-testid": "spectral-select-trigger",
130
- id: i,
130
+ id: s,
131
131
  ref: G,
132
132
  role: "combobox",
133
- style: ce(),
133
+ style: nt(),
134
134
  ...H,
135
- ...l,
135
+ ...o,
136
136
  children: /* @__PURE__ */ r("button", { type: "button", disabled: d, children: [
137
- /* @__PURE__ */ e(Z, { placeholder: D, className: "block truncate" }),
138
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex items-center", children: x ? /* @__PURE__ */ e(W, { size: 20 }) : /* @__PURE__ */ e(n, { className: "transition-transform duration-200 data-[state=open]:rotate-180", size: 20 }) }) })
137
+ /* @__PURE__ */ t(Z, { placeholder: q, className: "block truncate", "data-testid": "spectral-select-value" }),
138
+ /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ t("div", { className: "flex items-center", children: x ? /* @__PURE__ */ t(W, { size: 20 }) : /* @__PURE__ */ t(c, { className: "transition-transform duration-200 data-[state=open]:rotate-180", size: 20 }) }) })
139
139
  ] })
140
140
  }
141
141
  ),
142
- /* @__PURE__ */ e($, { align: w, alignOffset: z, "data-slot": "select-content", "data-testid": "spectral-select-content", asChild: !0, collisionPadding: O, position: E, side: P, sideOffset: R, children: /* @__PURE__ */ r(
142
+ /* @__PURE__ */ t($, { align: w, alignOffset: z, "data-slot": "select-content", "data-testid": "spectral-select-content", asChild: !0, collisionPadding: O, position: D, side: E, sideOffset: P, children: /* @__PURE__ */ r(
143
143
  "div",
144
144
  {
145
- className: o(
145
+ className: i(
146
146
  "z-50 rounded-lg border border-input-border bg-input-bg shadow-md",
147
147
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
148
148
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -159,18 +159,18 @@ const Se = ye(
159
159
  width: "var(--radix-select-trigger-width)"
160
160
  },
161
161
  children: [
162
- /* @__PURE__ */ e(ee, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ e(n, { className: "rotate-180", size: 18 }) }),
163
- /* @__PURE__ */ e(te, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "p-1 max-h-96", style: { position: "relative", overflow: "hidden auto" }, children: U() }) }),
164
- /* @__PURE__ */ e(re, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ e(n, { size: 18 }) })
162
+ /* @__PURE__ */ t(tt, { className: "flex cursor-default items-center justify-center py-1", "data-testid": "spectral-select-scroll-up-button", children: /* @__PURE__ */ t(c, { className: "rotate-180", size: 18 }) }),
163
+ /* @__PURE__ */ t(et, { asChild: !0, children: /* @__PURE__ */ t("div", { className: "p-1 max-h-96", "data-testid": "spectral-select-items", style: { position: "relative", overflow: "hidden auto" }, children: U() }) }),
164
+ /* @__PURE__ */ t(rt, { className: "flex cursor-default items-center justify-center py-1", "data-testid": "spectral-select-scroll-down-button", children: /* @__PURE__ */ t(c, { size: 18 }) })
165
165
  ]
166
166
  }
167
167
  ) })
168
168
  ] }),
169
- A && p && /* @__PURE__ */ e(ge, { "data-testid": "spectral-select-error-message", id: b, message: p })
169
+ A && p && /* @__PURE__ */ t(gt, { "data-testid": "spectral-select-error-message", id: f, message: p })
170
170
  ] });
171
171
  }
172
172
  );
173
- Se.displayName = "Select";
173
+ vt.displayName = "Select";
174
174
  export {
175
- Se as Select
175
+ vt as Select
176
176
  };