@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.
- package/dist/Accordion.d.ts +7 -7
- package/dist/Accordion.js +53 -51
- package/dist/Alert/AlertBase.js +6 -6
- package/dist/Alert.js +1 -1
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +46 -46
- package/dist/Badge.js +3 -3
- package/dist/Button.js +19 -12
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +10 -10
- package/dist/ButtonGroup.d.ts +8 -5
- package/dist/ButtonGroup.js +22 -14
- package/dist/ButtonIcon.d.ts +1 -1
- package/dist/ButtonIcon.js +5 -5
- package/dist/Card.d.ts +1 -1
- package/dist/Card.js +10 -10
- package/dist/Checkbox/CheckboxBase.d.ts +6 -6
- package/dist/Checkbox/CheckboxBase.js +65 -63
- package/dist/Checkbox.js +16 -14
- package/dist/Dialog/DialogBase.d.ts +37 -25
- package/dist/Dialog/DialogBase.js +130 -104
- package/dist/Dialog.d.ts +8 -8
- package/dist/Dialog.js +46 -36
- package/dist/Drawer.js +17 -17
- package/dist/HoverCard.d.ts +4 -4
- package/dist/HoverCard.js +34 -33
- package/dist/Input.js +58 -58
- package/dist/InputOTP.d.ts +1 -1
- package/dist/InputOTP.js +113 -112
- package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
- package/dist/MultiSelect/MultiSelectBase.js +236 -177
- package/dist/MultiSelect/MutiSelect.d.ts +6 -4
- package/dist/MultiSelect/MutiSelect.js +13 -12
- package/dist/Popover.js +2 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
- package/dist/RadioGroup.js +5 -3
- package/dist/Select.js +70 -51
- package/dist/Slider.js +8 -4
- package/dist/Switch/SwitchBase.d.ts +6 -6
- package/dist/Switch/SwitchBase.js +39 -38
- package/dist/Switch.js +17 -16
- package/dist/Tabs/TabsBase.js +40 -25
- package/dist/Tabs.js +18 -21
- package/dist/Textarea.d.ts +1 -0
- package/dist/Textarea.js +33 -33
- package/dist/Toggle.js +4 -4
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
- package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
- package/dist/ToggleGroup.js +19 -17
- package/dist/Tooltip/TooltipBase.d.ts +8 -8
- package/dist/Tooltip/TooltipBase.js +76 -74
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +12 -11
- package/dist/Tray.d.ts +1 -1
- package/dist/Tray.js +4910 -117
- package/dist/primitives/input.js +4 -4
- package/dist/primitives/select.d.ts +11 -11
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +28 -21
- package/dist/styles/main.css +1 -1
- package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
- package/dist/utils/createForwardRef.d.ts.map +1 -0
- package/dist/utils/formFieldUtils.d.ts +22 -18
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +46 -46
- package/package.json +9 -3
- package/dist/analyzer/list.yml.webp +0 -0
- package/dist/analyzer/network.webp +0 -0
- package/dist/analyzer/sunburst.webp +0 -0
- package/dist/analyzer/visual.webp +0 -0
- package/dist/auth-background.json +0 -90
- package/dist/favicon-invert.svg +0 -5
- package/dist/favicon.svg +0 -5
- package/dist/features/AuthCard/AuthCard.d.ts +0 -3
- package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
- package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.js +0 -20
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
- package/dist/features/AuthCard/OTPInput.d.ts +0 -12
- package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
- package/dist/features/AuthCard/OTPInput.js +0 -12
- package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
- package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
- package/dist/features/AuthCard/PasswordInput.js +0 -93
- package/dist/features/AuthCard/SignInForm.d.ts +0 -9
- package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignInForm.js +0 -86
- package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
- package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignUpForm.js +0 -100
- package/dist/features/AuthCard.js +0 -202
- package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
- package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
- package/dist/features/ClearDialog.js +0 -31
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
- package/dist/features/LabelingToolbar.js +0 -13
- package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
- package/dist/features/LabelingTools.js +0 -134
- package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
- package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
- package/dist/features/SensorMetadata.js +0 -117
- package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
- package/dist/features/SettingsPopover.js +0 -204
- package/dist/index-BIpuW_o8.js +0 -146
- package/dist/linear-cursor-small.png +0 -0
- package/dist/loader-circle-CdRVlFhN.js +0 -11
- package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
- package/dist/logo/wordmark-light-side-by-side.svg +0 -6
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/proxy-C9AqCss6.js +0 -4670
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/themes/grayscale-theme.webp +0 -0
- package/dist/themes/green-black-theme.webp +0 -0
- package/dist/themes/reverse-grayscale-theme.webp +0 -0
- package/dist/themes/viridis-theme.webp +0 -0
- package/dist/utils/refs.d.ts.map +0 -1
- package/dist/x-Dl66o_vF.js +0 -14
- /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Slot as
|
|
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
|
|
5
|
+
import { c } from "../index-D29mdTf5.js";
|
|
6
6
|
import "react";
|
|
7
|
-
const
|
|
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
|
-
|
|
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: "
|
|
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
|
-
...
|
|
37
|
-
}) => /* @__PURE__ */
|
|
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
|
-
|
|
41
|
+
l as buttonVariants
|
|
42
42
|
};
|
package/dist/ButtonGroup.d.ts
CHANGED
|
@@ -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> &
|
|
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<
|
|
15
|
-
size?:
|
|
16
|
-
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
|
};
|
package/dist/ButtonGroup.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { ButtonGroupButton as
|
|
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
|
|
7
|
+
import { cn as i } from "./utils/twUtils.js";
|
|
8
8
|
import { c } from "./index-D29mdTf5.js";
|
|
9
|
-
import { Children as f, isValidElement as
|
|
10
|
-
const
|
|
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 = ({
|
|
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
|
|
36
|
+
const d = ({
|
|
30
37
|
children: o,
|
|
31
38
|
className: t,
|
|
32
39
|
size: r,
|
|
33
40
|
variant: a,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
u
|
|
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__ */
|
|
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__ */
|
|
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
|
-
|
|
57
|
+
d as ButtonGroupItem,
|
|
50
58
|
x as ButtonGroupSeparator,
|
|
51
59
|
C as ButtonGroupText,
|
|
52
|
-
|
|
60
|
+
v as buttonGroupVariants
|
|
53
61
|
};
|
package/dist/ButtonIcon.d.ts
CHANGED
|
@@ -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?: '
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
11
|
}
|
|
12
12
|
export declare const ButtonIcon: import('react').ForwardRefExoticComponent<ButtonIconProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
export {};
|
package/dist/ButtonIcon.js
CHANGED
|
@@ -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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, C = g(({ className: u, disabled: s, icon: r, isLoading: o = !1, label: c, onClick: f, shape: d = "square", size: i = "
|
|
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?: "
|
|
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
|
|
3
|
-
import { Slot as
|
|
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 =
|
|
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
|
-
|
|
11
|
+
sm: "data-card gap-2 rounded-lg"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: {
|
|
15
15
|
variant: "default"
|
|
16
16
|
}
|
|
17
|
-
}), v = ({ ...
|
|
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
|
-
|
|
19
|
+
h as Card,
|
|
20
20
|
v as CardBase,
|
|
21
|
-
|
|
21
|
+
g as CardContent,
|
|
22
22
|
x as CardHeader,
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
8
|
+
form?: string;
|
|
9
9
|
name?: string;
|
|
10
|
-
|
|
10
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
11
11
|
required?: boolean;
|
|
12
|
-
|
|
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
|
-
|
|
17
|
+
form?: string;
|
|
18
18
|
name?: string;
|
|
19
|
-
|
|
19
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
20
20
|
required?: boolean;
|
|
21
|
-
|
|
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
|
|
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
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
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(
|
|
13
|
-
return
|
|
12
|
+
function z(n) {
|
|
13
|
+
return n === "indeterminate" ? !0 : !n;
|
|
14
14
|
}
|
|
15
15
|
const A = E(
|
|
16
16
|
({
|
|
17
|
-
asChild:
|
|
18
|
-
className: d,
|
|
17
|
+
asChild: n,
|
|
19
18
|
checked: l,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
40
|
+
a.current && (a.current.indeterminate = t === "indeterminate");
|
|
41
41
|
}, [t]), y(() => {
|
|
42
|
-
const e =
|
|
42
|
+
const e = a.current?.form ?? null;
|
|
43
43
|
if (!e) return;
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const u = () => {
|
|
45
|
+
s(o);
|
|
46
46
|
};
|
|
47
|
-
return e.addEventListener("reset",
|
|
48
|
-
}, [
|
|
49
|
-
const g =
|
|
50
|
-
const e =
|
|
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
|
|
54
|
-
e.dispatchEvent(
|
|
55
|
-
}, [t]),
|
|
56
|
-
if (
|
|
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
|
-
|
|
59
|
-
}, [
|
|
58
|
+
s(e), queueMicrotask(() => g());
|
|
59
|
+
}, [r, g, s, t]), D = d(
|
|
60
60
|
(e) => {
|
|
61
|
-
v?.(e), !e.defaultPrevented &&
|
|
61
|
+
v?.(e), !e.defaultPrevented && c();
|
|
62
62
|
},
|
|
63
|
-
[
|
|
64
|
-
), L =
|
|
63
|
+
[c, v]
|
|
64
|
+
), L = d(
|
|
65
65
|
(e) => {
|
|
66
|
-
x?.(e), !e.defaultPrevented && e.key === " " && (e.preventDefault(),
|
|
66
|
+
x?.(e), !e.defaultPrevented && e.key === " " && (e.preventDefault(), c());
|
|
67
67
|
},
|
|
68
|
-
[
|
|
69
|
-
), q =
|
|
70
|
-
return /* @__PURE__ */
|
|
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":
|
|
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
|
-
|
|
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__ */
|
|
94
|
+
/* @__PURE__ */ b(
|
|
95
95
|
"input",
|
|
96
96
|
{
|
|
97
|
-
|
|
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
|
-
|
|
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:
|
|
125
|
-
const
|
|
126
|
-
|
|
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
|
|
4
|
-
import { CheckboxBase as l, CheckboxIndicator as
|
|
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
|
|
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
|
|
62
|
+
import { cn as i } from "./utils/twUtils.js";
|
|
63
63
|
import { forwardRef as x } from "react";
|
|
64
|
-
const k = x(({ className:
|
|
65
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
-
|
|
77
|
+
e
|
|
75
78
|
),
|
|
76
|
-
"data-
|
|
79
|
+
"data-state": o === !0 ? "checked" : o === "indeterminate" ? "indeterminate" : "unchecked",
|
|
80
|
+
"data-testid": "spectral-checkbox",
|
|
77
81
|
id: r,
|
|
78
|
-
|
|
79
|
-
"aria-required": c,
|
|
80
|
-
onCheckedChange: m,
|
|
82
|
+
onCheckedChange: p,
|
|
81
83
|
ref: s,
|
|
82
84
|
...a,
|
|
83
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
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({
|
|
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" | "
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
66
|
-
children
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|