@spear-ai/spectral 1.4.2 → 1.4.3

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.
Files changed (127) hide show
  1. package/dist/Accordion.d.ts +7 -7
  2. package/dist/Accordion.js +53 -51
  3. package/dist/Alert/AlertBase.js +6 -6
  4. package/dist/Alert.js +1 -1
  5. package/dist/Avatar.d.ts +2 -2
  6. package/dist/Avatar.js +46 -46
  7. package/dist/Badge.js +3 -3
  8. package/dist/Button.js +19 -12
  9. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  10. package/dist/ButtonGroup/ButtonGroupButton.js +10 -10
  11. package/dist/ButtonGroup.d.ts +8 -5
  12. package/dist/ButtonGroup.js +22 -14
  13. package/dist/ButtonIcon.d.ts +1 -1
  14. package/dist/ButtonIcon.js +5 -5
  15. package/dist/Card.d.ts +1 -1
  16. package/dist/Card.js +10 -10
  17. package/dist/Checkbox/CheckboxBase.d.ts +6 -6
  18. package/dist/Checkbox/CheckboxBase.js +65 -63
  19. package/dist/Checkbox.js +16 -14
  20. package/dist/Dialog/DialogBase.d.ts +37 -25
  21. package/dist/Dialog/DialogBase.js +130 -104
  22. package/dist/Dialog.d.ts +8 -8
  23. package/dist/Dialog.js +46 -36
  24. package/dist/Drawer.js +17 -17
  25. package/dist/HoverCard.d.ts +4 -4
  26. package/dist/HoverCard.js +34 -33
  27. package/dist/Input.js +58 -58
  28. package/dist/InputOTP.d.ts +1 -1
  29. package/dist/InputOTP.js +113 -112
  30. package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
  31. package/dist/MultiSelect/MultiSelectBase.js +236 -177
  32. package/dist/MultiSelect/MutiSelect.d.ts +6 -4
  33. package/dist/MultiSelect/MutiSelect.js +13 -12
  34. package/dist/Popover.js +2 -1
  35. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
  36. package/dist/RadioGroup.js +5 -3
  37. package/dist/Select.js +70 -51
  38. package/dist/Slider.js +8 -4
  39. package/dist/Switch/SwitchBase.d.ts +6 -6
  40. package/dist/Switch/SwitchBase.js +39 -38
  41. package/dist/Switch.js +17 -16
  42. package/dist/Tabs/TabsBase.js +40 -25
  43. package/dist/Tabs.js +18 -21
  44. package/dist/Textarea.d.ts +1 -0
  45. package/dist/Textarea.js +33 -33
  46. package/dist/Toggle.js +4 -4
  47. package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
  48. package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
  49. package/dist/ToggleGroup.js +19 -17
  50. package/dist/Tooltip/TooltipBase.d.ts +8 -8
  51. package/dist/Tooltip/TooltipBase.js +76 -74
  52. package/dist/Tooltip.d.ts +1 -1
  53. package/dist/Tooltip.js +12 -11
  54. package/dist/Tray.d.ts +1 -1
  55. package/dist/Tray.js +4910 -117
  56. package/dist/primitives/input.js +4 -4
  57. package/dist/primitives/select.d.ts +11 -11
  58. package/dist/primitives/select.d.ts.map +1 -1
  59. package/dist/primitives/select.js +28 -21
  60. package/dist/styles/main.css +1 -1
  61. package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
  62. package/dist/utils/createForwardRef.d.ts.map +1 -0
  63. package/dist/utils/formFieldUtils.d.ts +22 -18
  64. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  65. package/dist/utils/formFieldUtils.js +46 -46
  66. package/package.json +9 -3
  67. package/dist/analyzer/list.yml.webp +0 -0
  68. package/dist/analyzer/network.webp +0 -0
  69. package/dist/analyzer/sunburst.webp +0 -0
  70. package/dist/analyzer/visual.webp +0 -0
  71. package/dist/auth-background.json +0 -90
  72. package/dist/favicon-invert.svg +0 -5
  73. package/dist/favicon.svg +0 -5
  74. package/dist/features/AuthCard/AuthCard.d.ts +0 -3
  75. package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
  76. package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
  77. package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
  78. package/dist/features/AuthCard/AuthToggle.js +0 -20
  79. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
  80. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
  81. package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
  82. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
  83. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
  84. package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
  85. package/dist/features/AuthCard/OTPInput.d.ts +0 -12
  86. package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
  87. package/dist/features/AuthCard/OTPInput.js +0 -12
  88. package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
  89. package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
  90. package/dist/features/AuthCard/PasswordInput.js +0 -93
  91. package/dist/features/AuthCard/SignInForm.d.ts +0 -9
  92. package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
  93. package/dist/features/AuthCard/SignInForm.js +0 -86
  94. package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
  95. package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
  96. package/dist/features/AuthCard/SignUpForm.js +0 -100
  97. package/dist/features/AuthCard.js +0 -202
  98. package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
  99. package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
  100. package/dist/features/ClearDialog.js +0 -31
  101. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
  102. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
  103. package/dist/features/LabelingToolbar.js +0 -13
  104. package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
  105. package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
  106. package/dist/features/LabelingTools.js +0 -134
  107. package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
  108. package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
  109. package/dist/features/SensorMetadata.js +0 -117
  110. package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
  111. package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
  112. package/dist/features/SettingsPopover.js +0 -204
  113. package/dist/index-BIpuW_o8.js +0 -146
  114. package/dist/linear-cursor-small.png +0 -0
  115. package/dist/loader-circle-CdRVlFhN.js +0 -11
  116. package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
  117. package/dist/logo/wordmark-light-side-by-side.svg +0 -6
  118. package/dist/message-alert-matte-glass-gradient.webp +0 -0
  119. package/dist/proxy-C9AqCss6.js +0 -4670
  120. package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
  121. package/dist/themes/grayscale-theme.webp +0 -0
  122. package/dist/themes/green-black-theme.webp +0 -0
  123. package/dist/themes/reverse-grayscale-theme.webp +0 -0
  124. package/dist/themes/viridis-theme.webp +0 -0
  125. package/dist/utils/refs.d.ts.map +0 -1
  126. package/dist/x-Dl66o_vF.js +0 -14
  127. /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
@@ -1,10 +1,10 @@
1
1
  import "../styles/main.css";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import { Slot as s } from "../primitives/slot.js";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import { Slot as a } from "../primitives/slot.js";
4
4
  import { cn as r } from "../utils/twUtils.js";
5
- import { c as l } from "../index-D29mdTf5.js";
5
+ import { c } from "../index-D29mdTf5.js";
6
6
  import "react";
7
- const c = l(
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
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
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`,
@@ -15,17 +15,17 @@ const c = l(
15
15
  outline: "border border-level-three active:text-accent active:border-accent"
16
16
  },
17
17
  size: {
18
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
18
+ md: "h-9 px-4 py-2 has-[>svg]:px-3",
19
19
  sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
20
20
  lg: "h-10 px-6 has-[>svg]:px-4",
21
- icon: "size-9",
21
+ "icon-md": "size-9",
22
22
  "icon-sm": "size-8",
23
23
  "icon-lg": "size-10"
24
24
  }
25
25
  },
26
26
  defaultVariants: {
27
27
  variant: "default",
28
- size: "default"
28
+ size: "md"
29
29
  }
30
30
  }
31
31
  ), u = ({
@@ -33,10 +33,10 @@ const c = l(
33
33
  variant: t,
34
34
  size: e,
35
35
  asChild: o = !1,
36
- ...a
37
- }) => /* @__PURE__ */ n(o ? s : "button", { "data-slot": "button-group-item", "data-variant": t, "data-size": e, className: r(c({ variant: t, size: e, className: i })), ...a });
36
+ ...n
37
+ }) => /* @__PURE__ */ s(o ? a : "button", { "data-slot": "button-group-item", "data-variant": t, "data-size": e, className: r(l({ variant: t, size: e, className: i })), ...n });
38
38
  u.displayName = "ButtonGroupButton";
39
39
  export {
40
40
  u as ButtonGroupButton,
41
- c as buttonVariants
41
+ l as buttonVariants
42
42
  };
@@ -1,4 +1,3 @@
1
- import { ButtonGroupButton, buttonVariants } from './ButtonGroupButton';
2
1
  import { Separator } from '../Separator/Separator';
3
2
  import { VariantProps } from 'class-variance-authority';
4
3
  import { ComponentProps } from 'react';
@@ -7,13 +6,17 @@ export declare const buttonGroupVariants: (props?: ({
7
6
  orientation?: "horizontal" | "vertical" | null | undefined;
8
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
8
  export declare const ButtonGroup: {
10
- ({ className, orientation, variant, size, children, ...props }: ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants> & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
9
+ ({ className, orientation, variant, size, children, ...props }: ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants> & {
10
+ variant?: "default" | "outline";
11
+ size?: "md" | "sm" | "lg" | "icon-md" | "icon-sm" | "icon-lg";
12
+ }): import("react/jsx-runtime").JSX.Element;
11
13
  displayName: string;
12
14
  };
13
15
  export declare const ButtonGroupItem: {
14
- ({ children, className, size, variant, ...props }: ComponentProps<typeof ButtonGroupButton> & {
15
- size?: VariantProps<typeof buttonVariants>["size"];
16
- variant?: VariantProps<typeof buttonVariants>["variant"];
16
+ ({ children, className, size, variant, asChild, ...props }: ComponentProps<"button"> & {
17
+ size?: "sm" | "md" | "lg" | "icon-sm" | "icon-md" | "icon-lg";
18
+ variant?: "default" | "outline";
19
+ asChild?: boolean;
17
20
  }): import("react/jsx-runtime").JSX.Element;
18
21
  displayName: string;
19
22
  };
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { ButtonGroupButton as d } from "./ButtonGroup/ButtonGroupButton.js";
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ import { ButtonGroupButton as u } from "./ButtonGroup/ButtonGroupButton.js";
5
5
  import { Separator as p } from "./Separator.js";
6
6
  import { Slot as m } from "./primitives/slot.js";
7
- import { cn as s } from "./utils/twUtils.js";
7
+ import { cn as i } from "./utils/twUtils.js";
8
8
  import { c } from "./index-D29mdTf5.js";
9
- import { Children as f, isValidElement as v, cloneElement as b } from "react";
10
- const g = c(
9
+ import { Children as f, isValidElement as b, cloneElement as g } from "react";
10
+ const v = c(
11
11
  `flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1
12
12
  has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2`,
13
13
  {
@@ -21,33 +21,41 @@ const g = c(
21
21
  orientation: "horizontal"
22
22
  }
23
23
  }
24
- ), h = ({ className: o, orientation: t, variant: r, size: a, children: i, ...l }) => /* @__PURE__ */ n("div", { role: "group", "data-slot": "button-group", "aria-label": l["aria-label"], "data-orientation": t, className: s(g({ orientation: t }), o), ...l, children: f.map(i, (e) => v(e) && e.type === u ? b(e, {
24
+ ), h = ({
25
+ className: o,
26
+ orientation: t = "horizontal",
27
+ variant: r = "default",
28
+ size: a = "md",
29
+ children: l,
30
+ ...n
31
+ }) => /* @__PURE__ */ s("div", { role: "group", "data-slot": "button-group", "data-testid": "spectral-button-group", "aria-label": n["aria-label"], "data-orientation": t, className: i(v({ orientation: t }), o), ...n, children: f.map(l, (e) => b(e) && (e.type === d || e.type === u) ? g(e, {
25
32
  variant: e.props.variant ?? r,
26
33
  size: e.props.size ?? a
27
34
  }) : e) });
28
35
  h.displayName = "ButtonGroup";
29
- const u = ({
36
+ const d = ({
30
37
  children: o,
31
38
  className: t,
32
39
  size: r,
33
40
  variant: a,
34
- ...i
35
- }) => /* @__PURE__ */ n(d, { "data-slot": "button-group-item", size: r, variant: a, className: s(t), ...i, children: o });
36
- u.displayName = "ButtonGroupItem";
41
+ asChild: l,
42
+ ...n
43
+ }) => /* @__PURE__ */ s(u, { "data-slot": "button-group-item", "data-testid": "spectral-button-group-item", "data-variant": a, size: r, variant: a, asChild: l, className: i(t), ...n, children: o });
44
+ d.displayName = "ButtonGroupItem";
37
45
  const C = ({
38
46
  className: o,
39
47
  asChild: t = !1,
40
48
  ...r
41
- }) => /* @__PURE__ */ n(t ? m : "div", { "data-slot": "button-group-text", className: s("bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", o), ...r }), x = ({
49
+ }) => /* @__PURE__ */ s(t ? m : "div", { "data-slot": "button-group-text", "data-testid": "spectral-button-group-text", className: i("bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", o), ...r }), x = ({
42
50
  className: o,
43
51
  orientation: t = "vertical",
44
52
  ...r
45
- }) => /* @__PURE__ */ n(p, { "data-slot": "button-group-separator", orientation: t, className: s("bg-level-three relative !m-0 self-stretch data-[orientation=vertical]:h-auto", o), ...r });
53
+ }) => /* @__PURE__ */ s(p, { "data-slot": "button-group-separator", orientation: t, className: i("bg-input-primitive-border relative !m-0 self-stretch data-[orientation=vertical]:h-auto", o), ...r });
46
54
  x.displayName = "ButtonGroupSeparator";
47
55
  export {
48
56
  h as ButtonGroup,
49
- u as ButtonGroupItem,
57
+ d as ButtonGroupItem,
50
58
  x as ButtonGroupSeparator,
51
59
  C as ButtonGroupText,
52
- g as buttonGroupVariants
60
+ v as buttonGroupVariants
53
61
  };
@@ -7,7 +7,7 @@ export interface ButtonIconProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
7
7
  label: string;
8
8
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
9
9
  shape?: 'circle' | 'square';
10
- size?: 'small' | 'default' | 'large';
10
+ size?: 'sm' | 'md' | 'lg';
11
11
  }
12
12
  export declare const ButtonIcon: import('react').ForwardRefExoticComponent<ButtonIconProps & import('react').RefAttributes<HTMLButtonElement>>;
13
13
  export {};
@@ -62,10 +62,10 @@ import { cn as n } from "./utils/twUtils.js";
62
62
  import { forwardRef as g, isValidElement as k, cloneElement as p } from "react";
63
63
  const x = `bg-transparent hover:bg-level-one text-text-primary inline-flex items-center justify-center whitespace-nowrap transition-colors focus:outline-none focus-visible:outline-2
64
64
  focus-visible:outline-offset-2 focus-visible:outline-level-two cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0`, m = {
65
- small: { button: "h-8 w-8", icon: 16 },
66
- default: { button: "h-10 w-10", icon: 24 },
67
- large: { button: "h-12 w-12", icon: 32 }
68
- }, C = g(({ className: u, disabled: s, icon: r, isLoading: o = !1, label: c, onClick: f, shape: d = "square", size: i = "default", ...h }, b) => {
65
+ sm: { button: "h-8 w-8", icon: 16 },
66
+ md: { button: "h-10 w-10", icon: 24 },
67
+ lg: { button: "h-12 w-12", icon: 32 }
68
+ }, C = g(({ className: u, disabled: s, icon: r, isLoading: o = !1, label: c, onClick: f, shape: d = "square", size: i = "md", ...h }, b) => {
69
69
  const v = (t) => {
70
70
  f?.(t);
71
71
  }, y = o ? `${c} - Loading` : c, w = () => {
@@ -103,7 +103,7 @@ const x = `bg-transparent hover:bg-level-one text-text-primary inline-flex items
103
103
  {
104
104
  "aria-label": y,
105
105
  className: n(x, d === "circle" ? "rounded-full" : "rounded-[0.75rem]", m[i].button, o && "cursor-wait", s && "opacity-50 cursor-not-allowed", u),
106
- "data-testid": "button-icon",
106
+ "data-testid": "spectral-button-icon",
107
107
  disabled: s || o,
108
108
  onClick: v,
109
109
  ref: b,
package/dist/Card.d.ts CHANGED
@@ -4,7 +4,7 @@ export type CardProps = ComponentProps<'div'> & VariantProps<typeof cardVariants
4
4
  asChild?: boolean;
5
5
  };
6
6
  declare const cardVariants: (props?: ({
7
- variant?: "small" | "default" | null | undefined;
7
+ variant?: "default" | "sm" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  export declare const CardBase: ({ ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export declare const CardHeader: ({ className, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
package/dist/Card.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import "./styles/main.css";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { Slot as n } from "./primitives/slot.js";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { Slot as c } from "./primitives/slot.js";
4
4
  import { cn as d } from "./utils/twUtils.js";
5
- import { c } from "./index-D29mdTf5.js";
5
+ import { c as n } from "./index-D29mdTf5.js";
6
6
  import "react";
7
- const l = c("text-text-primary flex flex-col w-full card-effects p-3", {
7
+ const l = n("text-text-primary flex flex-col w-full card-effects p-3", {
8
8
  variants: {
9
9
  variant: {
10
10
  default: "gap-6 rounded-xl content-card",
11
- small: "data-card gap-2 rounded-lg"
11
+ sm: "data-card gap-2 rounded-lg"
12
12
  }
13
13
  },
14
14
  defaultVariants: {
15
15
  variant: "default"
16
16
  }
17
- }), v = ({ ...a }) => /* @__PURE__ */ r("div", { "data-slot": "card", ...a }), x = ({ className: a, ...t }) => /* @__PURE__ */ r("div", { "data-slot": "card-header", className: d("@container/card-header pb-4 flex justify-between items-center", a), ...t }), g = ({ className: a, asChild: t = !1, ...e }) => /* @__PURE__ */ r(t ? n : "div", { "data-slot": "card-title", className: d("leading-none font-semibold text-xl", a), ...e }), N = ({ className: a, asChild: t = !1, ...e }) => /* @__PURE__ */ r(t ? n : "div", { "data-slot": "card-action", className: d("justify-self-end", a), ...e }), b = ({ className: a, ...t }) => /* @__PURE__ */ r("div", { "data-slot": "card-content", className: a, ...t }), j = ({ className: a, variant: t, asChild: e = !1, children: o, ...s }) => /* @__PURE__ */ r(e ? n : "div", { "data-slot": "card", className: d(l({ variant: t }), a), ...s, children: o });
17
+ }), v = ({ ...t }) => /* @__PURE__ */ e("div", { "data-slot": "card", "data-testid": "spectral-card", ...t }), x = ({ className: t, ...a }) => /* @__PURE__ */ e("div", { "data-slot": "card-header", "data-testid": "spectral-card-header", className: d("@container/card-header pb-4 flex justify-between items-center", t), ...a }), N = ({ className: t, asChild: a = !1, ...r }) => /* @__PURE__ */ e(a ? c : "div", { "data-slot": "card-title", "data-testid": "spectral-card-title", className: d("font-semibold text-xl", t), ...r }), b = ({ className: t, asChild: a = !1, ...r }) => /* @__PURE__ */ e(a ? c : "div", { "data-slot": "card-action", "data-testid": "spectral-card-action", className: d("justify-self-end", t), ...r }), g = ({ className: t, ...a }) => /* @__PURE__ */ e("div", { "data-slot": "card-content", "data-testid": "spectral-card-content", className: t, ...a }), h = ({ className: t, variant: a, asChild: r = !1, children: s, ...o }) => /* @__PURE__ */ e(r ? c : "div", { "data-slot": "card", "data-testid": "spectral-card", className: d(l({ variant: a }), t), ...o, children: s });
18
18
  export {
19
- j as Card,
19
+ h as Card,
20
20
  v as CardBase,
21
- b as CardContent,
21
+ g as CardContent,
22
22
  x as CardHeader,
23
- N as CardHeaderEndSlot,
24
- g as CardTitle
23
+ b as CardHeaderEndSlot,
24
+ N as CardTitle
25
25
  };
@@ -5,20 +5,20 @@ type BaseButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'
5
5
  export type CheckboxBaseProps = BaseButtonProps & AsChildProp & {
6
6
  checked?: CheckedState;
7
7
  defaultChecked?: CheckedState;
8
- onCheckedChange?: (checked: CheckedState) => void;
8
+ form?: string;
9
9
  name?: string;
10
- value?: string;
10
+ onCheckedChange?: (checked: CheckedState) => void;
11
11
  required?: boolean;
12
- form?: string;
12
+ value?: string;
13
13
  };
14
14
  export declare const CheckboxBase: import('react').ForwardRefExoticComponent<BaseButtonProps & AsChildProp & {
15
15
  checked?: CheckedState;
16
16
  defaultChecked?: CheckedState;
17
- onCheckedChange?: (checked: CheckedState) => void;
17
+ form?: string;
18
18
  name?: string;
19
- value?: string;
19
+ onCheckedChange?: (checked: CheckedState) => void;
20
20
  required?: boolean;
21
- form?: string;
21
+ value?: string;
22
22
  } & import('react').RefAttributes<HTMLButtonElement>>;
23
23
  export type CheckboxIndicatorProps = HTMLAttributes<HTMLSpanElement> & AsChildProp & {
24
24
  forceMount?: boolean;
@@ -1,110 +1,110 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { jsx as m, jsxs as K } from "react/jsx-runtime";
3
+ import { jsx as b, jsxs as K } from "react/jsx-runtime";
4
4
  import { useControllableState as M } from "../hooks/useControllableState.js";
5
5
  import { Slot as C } from "../primitives/slot.js";
6
6
  import { cn as w } from "../utils/twUtils.js";
7
- import { createContext as O, forwardRef as E, useRef as T, useId as V, useEffect as y, useCallback as u, useContext as $ } from "react";
8
- const R = O(null);
9
- function I(r) {
10
- return r === "indeterminate" ? "indeterminate" : r ? "checked" : "unchecked";
7
+ import { createContext as O, forwardRef as E, useRef as T, useId as V, useEffect as y, useCallback as d, useContext as $ } from "react";
8
+ const I = O(null);
9
+ function R(n) {
10
+ return n === "indeterminate" ? "indeterminate" : n ? "checked" : "unchecked";
11
11
  }
12
- function z(r) {
13
- return r === "indeterminate" ? !0 : !r;
12
+ function z(n) {
13
+ return n === "indeterminate" ? !0 : !n;
14
14
  }
15
15
  const A = E(
16
16
  ({
17
- asChild: r,
18
- className: d,
17
+ asChild: n,
19
18
  checked: l,
20
- defaultChecked: i = !1,
21
- onCheckedChange: f,
22
- disabled: n,
23
- required: h,
24
- name: p,
25
- value: b = "on",
26
- form: N,
27
- id: j,
19
+ className: f,
20
+ disabled: r,
21
+ defaultChecked: o = !1,
22
+ form: i,
23
+ id: p,
24
+ name: m,
25
+ onCheckedChange: h,
28
26
  onClick: v,
29
27
  onKeyDown: x,
28
+ required: N,
30
29
  type: H,
31
30
  // oxlint-disable-line no-unused-vars
31
+ value: j = "on",
32
32
  ...k
33
33
  }, S) => {
34
- const o = T(null), P = V(), B = j ?? `chk-${P}`, [t, a] = M({
35
- value: l,
36
- defaultValue: i,
37
- onChange: f
34
+ const a = T(null), P = V(), B = p ?? `chk-${P}`, [t, s] = M({
35
+ defaultValue: o,
36
+ onChange: h,
37
+ value: l
38
38
  });
39
39
  y(() => {
40
- o.current && (o.current.indeterminate = t === "indeterminate");
40
+ a.current && (a.current.indeterminate = t === "indeterminate");
41
41
  }, [t]), y(() => {
42
- const e = o.current?.form ?? null;
42
+ const e = a.current?.form ?? null;
43
43
  if (!e) return;
44
- const c = () => {
45
- a(i);
44
+ const u = () => {
45
+ s(o);
46
46
  };
47
- return e.addEventListener("reset", c), () => e.removeEventListener("reset", c);
48
- }, [i, a]);
49
- const g = u(() => {
50
- const e = o.current;
47
+ return e.addEventListener("reset", u), () => e.removeEventListener("reset", u);
48
+ }, [o, s]);
49
+ const g = d(() => {
50
+ const e = a.current;
51
51
  if (!e) return;
52
52
  e.checked = t === !0, e.indeterminate = t === "indeterminate";
53
- const c = new Event("change", { bubbles: !0 });
54
- e.dispatchEvent(c);
55
- }, [t]), s = u(() => {
56
- if (n) return;
53
+ const u = new Event("change", { bubbles: !0 });
54
+ e.dispatchEvent(u);
55
+ }, [t]), c = d(() => {
56
+ if (r) return;
57
57
  const e = z(t);
58
- a(e), queueMicrotask(() => g());
59
- }, [n, g, a, t]), D = u(
58
+ s(e), queueMicrotask(() => g());
59
+ }, [r, g, s, t]), D = d(
60
60
  (e) => {
61
- v?.(e), !e.defaultPrevented && s();
61
+ v?.(e), !e.defaultPrevented && c();
62
62
  },
63
- [s, v]
64
- ), L = u(
63
+ [c, v]
64
+ ), L = d(
65
65
  (e) => {
66
- x?.(e), !e.defaultPrevented && e.key === " " && (e.preventDefault(), s());
66
+ x?.(e), !e.defaultPrevented && e.key === " " && (e.preventDefault(), c());
67
67
  },
68
- [s, x]
69
- ), q = r ? C : "button", F = S;
70
- return /* @__PURE__ */ m(R.Provider, { value: { state: t, disabled: n }, children: /* @__PURE__ */ K(
68
+ [c, x]
69
+ ), q = n ? C : "button", F = S;
70
+ return /* @__PURE__ */ b(I.Provider, { value: { state: t, disabled: r }, children: /* @__PURE__ */ K(
71
71
  q,
72
72
  {
73
- id: B,
74
- ref: F,
75
- type: "button",
76
- role: "checkbox",
77
73
  "aria-checked": t === "indeterminate" ? "mixed" : t,
78
- "aria-disabled": n || void 0,
79
- "data-state": I(t),
80
- "data-indeterminate": t === "indeterminate" ? "" : void 0,
74
+ "aria-disabled": r || void 0,
81
75
  className: w(
82
76
  "inline-flex h-4 w-4 shrink-0 items-center justify-center",
83
77
  "border-input bg-background rounded-sm border",
84
78
  "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
85
79
  "disabled:cursor-not-allowed disabled:opacity-50",
86
80
  "data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
87
- d
81
+ f
88
82
  ),
83
+ "data-indeterminate": t === "indeterminate" ? "" : void 0,
84
+ "data-state": R(t),
85
+ disabled: r,
86
+ id: B,
87
+ ref: F,
88
+ role: "checkbox",
89
+ type: "button",
89
90
  onClick: D,
90
91
  onKeyDown: L,
91
- disabled: n,
92
92
  ...k,
93
93
  children: [
94
- /* @__PURE__ */ m(
94
+ /* @__PURE__ */ b(
95
95
  "input",
96
96
  {
97
- ref: o,
98
- type: "checkbox",
99
- name: p,
100
- value: b,
101
- required: h,
102
- disabled: n,
103
- form: N,
97
+ "aria-hidden": "true",
104
98
  checked: t === !0,
99
+ disabled: r,
100
+ form: i,
101
+ name: m,
102
+ ref: a,
105
103
  readOnly: !0,
104
+ required: N,
106
105
  tabIndex: -1,
107
- "aria-hidden": "true",
106
+ type: "checkbox",
107
+ value: j,
108
108
  style: {
109
109
  position: "absolute",
110
110
  opacity: 0,
@@ -121,9 +121,11 @@ const A = E(
121
121
  }
122
122
  );
123
123
  A.displayName = "CheckboxBase";
124
- const G = E(({ asChild: r, className: d, forceMount: l, ...i }, f) => {
125
- const n = $(R);
126
- return !n || !(n.state === !0 || n.state === "indeterminate") && !l ? null : /* @__PURE__ */ m(r ? C : "span", { ref: f, "data-state": I(n.state), "data-indeterminate": n.state === "indeterminate" ? "" : void 0, className: w("flex items-center justify-center text-current", d), ...i });
124
+ const G = E(({ asChild: n, className: l, forceMount: f, ...r }, o) => {
125
+ const i = $(I);
126
+ if (!i || !(i.state === !0 || i.state === "indeterminate") && !f) return null;
127
+ const m = n ? C : "span", h = o;
128
+ return /* @__PURE__ */ b(m, { className: w("flex items-center justify-center text-current", l), "data-indeterminate": i.state === "indeterminate" ? "" : void 0, "data-state": R(i.state), ref: h, ...r });
127
129
  });
128
130
  G.displayName = "CheckboxIndicator";
129
131
  export {
package/dist/Checkbox.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
4
- import { CheckboxBase as l, CheckboxIndicator as b } from "./Checkbox/CheckboxBase.js";
3
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
4
+ import { CheckboxBase as l, CheckboxIndicator as n } from "./Checkbox/CheckboxBase.js";
5
5
  import "./Icons/AnalyzeIcon.js";
6
6
  import "./Icons/AnnotationsIcon.js";
7
7
  import "./Icons/ApprovedIcon.js";
8
8
  import "./Icons/CalendarIcon.js";
9
9
  import "./Icons/CheckCircleIcon.js";
10
10
  import "./Icons/CheckSquareIcon.js";
11
- import { CheckmarkIcon as n } from "./Icons/CheckmarkIcon.js";
11
+ import { CheckmarkIcon as b } from "./Icons/CheckmarkIcon.js";
12
12
  import "./Icons/ChevronDownIcon.js";
13
13
  import "./Icons/ChevronUpIcon.js";
14
14
  import "./Icons/ClockIcon.js";
@@ -59,31 +59,33 @@ import "./Icons/WarningIcon.js";
59
59
  import "./Icons/ZoomAllIcon.js";
60
60
  import "./Icons/ZoomXIcon.js";
61
61
  import "./Icons/ZoomYIcon.js";
62
- import { cn as t } from "./utils/twUtils.js";
62
+ import { cn as i } from "./utils/twUtils.js";
63
63
  import { forwardRef as x } from "react";
64
- const k = x(({ className: i, id: r, labelText: e, onCheckedChange: m, checked: p, required: c, ...a }, s) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
65
- /* @__PURE__ */ o(
64
+ const k = x(({ className: e, id: r, labelText: m, onCheckedChange: p, checked: o, required: c, ...a }, s) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
65
+ /* @__PURE__ */ t(
66
66
  l,
67
67
  {
68
- className: t(
68
+ "aria-labelledby": `${r}-label`,
69
+ "aria-required": c,
70
+ checked: o,
71
+ className: i(
69
72
  [
70
73
  "checkbox peer h-5 w-5 shrink-0 rounded-sm border border-checkbox-border hover:opacity-80",
71
74
  "focus:outline-none focus-visible:outline-1 focus-visible:outline-checkbox-border--focus focus-visible:outline-offset-2 disabled:cursor-not-allowed",
72
75
  "disabled:opacity-50 data-[state=checked]:border-checkbox-border--checked"
73
76
  ].join(" "),
74
- i
77
+ e
75
78
  ),
76
- "data-testid": "checkbox",
79
+ "data-state": o === !0 ? "checked" : o === "indeterminate" ? "indeterminate" : "unchecked",
80
+ "data-testid": "spectral-checkbox",
77
81
  id: r,
78
- "aria-labelledby": `${r}-label`,
79
- "aria-required": c,
80
- onCheckedChange: m,
82
+ onCheckedChange: p,
81
83
  ref: s,
82
84
  ...a,
83
- children: /* @__PURE__ */ o(b, { className: t("checkbox-indicator flex items-center justify-center text-checkbox-indicator--checked"), children: p === "indeterminate" ? /* @__PURE__ */ o(h, { className: "checkbox-indeterminate", size: 16, strokeWidth: 4 }) : /* @__PURE__ */ o(n, { className: "checkbox-check", size: 16, strokeWidth: 4 }) })
85
+ children: /* @__PURE__ */ t(n, { "data-testid": "spectral-checkbox-indicator", className: i("checkbox-indicator flex items-center justify-center text-checkbox-indicator--checked"), children: o === "indeterminate" ? /* @__PURE__ */ t(h, { className: "checkbox-indeterminate", size: 16, strokeWidth: 4 }) : /* @__PURE__ */ t(b, { className: "checkbox-check", size: 16, strokeWidth: 4 }) })
84
86
  }
85
87
  ),
86
- /* @__PURE__ */ o("label", { htmlFor: r, className: "text-md text-text-primary peer-disabled:text-neutral-400", "data-testid": "checkbox-label", children: e })
88
+ /* @__PURE__ */ t("label", { className: "text-md text-text-primary peer-disabled:text-neutral-400", "data-testid": "spectral-checkbox-label", htmlFor: r, children: m })
87
89
  ] }));
88
90
  k.displayName = "Checkbox";
89
91
  export {
@@ -1,35 +1,39 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { ReactElement, ReactNode } from 'react';
3
3
  export type DialogBaseProps = {
4
- isOpen?: boolean;
5
- defaultOpen?: boolean;
6
- onOpenChange?: (isOpen: boolean) => void;
7
4
  children: ReactNode;
5
+ dataTestId?: string;
6
+ defaultOpen?: boolean;
7
+ open?: boolean;
8
8
  modal?: boolean;
9
+ onOpenChange?: (open: boolean) => void;
9
10
  };
10
11
  export type DialogContextValue = {
11
- isOpen: boolean;
12
- setIsOpen: (isOpen: boolean) => void;
13
12
  contentId: string;
14
- titleId: string;
13
+ dataTestId?: string;
15
14
  descriptionId: string;
16
15
  modal: boolean;
16
+ open: boolean;
17
+ setOpen: (open: boolean) => void;
18
+ titleId: string;
17
19
  };
18
20
  export type TriggerableElement = ReactElement<{
19
21
  onClick?: (...args: unknown[]) => void;
20
22
  }>;
21
23
  export declare function useDialogContext(): DialogContextValue;
22
- export declare function DialogBase({ isOpen: controlledOpen, defaultOpen, onOpenChange, children, modal }: DialogBaseProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function DialogBase({ open: controlledOpen, defaultOpen, onOpenChange, children, modal }: DialogBaseProps): import("react/jsx-runtime").JSX.Element;
23
25
  type DialogTriggerProps = {
24
- children: ReactNode;
25
26
  asChild?: boolean;
27
+ children: ReactNode;
28
+ dataTestId?: string;
26
29
  };
27
- export declare function DialogTriggerBase({ children, asChild }: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function DialogTriggerBase({ children, asChild, dataTestId }: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
28
31
  type DialogCloseProps = {
29
- children: ReactNode;
30
32
  asChild?: boolean;
33
+ children: ReactNode;
34
+ dataTestId?: string;
31
35
  };
32
- export declare function DialogCloseBase({ children, asChild }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function DialogCloseBase({ children, asChild, dataTestId }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
33
37
  type DialogPortalProps = {
34
38
  children: ReactNode;
35
39
  container?: Element | DocumentFragment;
@@ -37,38 +41,46 @@ type DialogPortalProps = {
37
41
  export declare function DialogPortalBase({ children, container }: DialogPortalProps): import('react').ReactPortal | null;
38
42
  type DialogOverlayProps = {
39
43
  className?: string;
44
+ dataTestId?: string;
40
45
  };
41
- export declare function DialogOverlayBase({ className }: DialogOverlayProps): import("react/jsx-runtime").JSX.Element | null;
46
+ export declare function DialogOverlayBase({ className, dataTestId }: DialogOverlayProps): import("react/jsx-runtime").JSX.Element | null;
42
47
  declare const contentVariants: (props?: ({
43
- size?: "sm" | "lg" | "md" | "xl" | "2xl" | null | undefined;
48
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
44
49
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
45
50
  export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
46
51
  export type DialogContentProps = {
47
52
  children: ReactNode;
48
53
  className?: string;
49
- size?: DialogSize;
50
- onPointerDownOutside?: (event: PointerEvent) => void;
51
- onInteractOutside?: (event: PointerEvent | KeyboardEvent) => void;
54
+ dataTestId?: string;
52
55
  onEscapeKeyDown?: (event: KeyboardEvent) => void;
56
+ onInteractOutside?: (event: PointerEvent | KeyboardEvent) => void;
57
+ onPointerDownOutside?: (event: PointerEvent) => void;
58
+ size?: DialogSize;
53
59
  } & VariantProps<typeof contentVariants>;
54
- export declare function DialogContentBase({ children, className, size, onPointerDownOutside, onInteractOutside, onEscapeKeyDown }: DialogContentProps): import("react/jsx-runtime").JSX.Element | null;
60
+ export declare function DialogContentBase({ children, className, dataTestId, onEscapeKeyDown, onInteractOutside, onPointerDownOutside, size }: DialogContentProps): import("react/jsx-runtime").JSX.Element | null;
55
61
  type DialogTitleProps = {
56
62
  children: ReactNode;
57
63
  className?: string;
64
+ dataTestId?: string;
58
65
  };
59
- export declare function DialogTitleBase({ children, className }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function DialogTitleBase({ children, className, dataTestId }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
60
67
  type DialogDescriptionProps = {
61
68
  children?: ReactNode;
62
69
  className?: string;
70
+ dataTestId?: string;
63
71
  };
64
- export declare function DialogDescriptionBase({ children, className }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
65
- export declare function DialogHeaderBase({ children, className }: {
66
- children: ReactNode;
72
+ export declare function DialogDescriptionBase({ children, className, dataTestId }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
73
+ type DialogHeaderProps = {
74
+ children?: ReactNode;
67
75
  className?: string;
68
- }): import("react/jsx-runtime").JSX.Element;
69
- export declare function DialogFooterBase({ children, className }: {
70
- children: ReactNode;
76
+ dataTestId?: string;
77
+ };
78
+ export declare function DialogHeaderBase({ children, className, dataTestId }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
79
+ type DialogFooterProps = {
80
+ children?: ReactNode;
71
81
  className?: string;
72
- }): import("react/jsx-runtime").JSX.Element;
82
+ dataTestId?: string;
83
+ };
84
+ export declare function DialogFooterBase({ children, className, dataTestId }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
73
85
  export {};
74
86
  //# sourceMappingURL=DialogBase.d.ts.map