@spear-ai/spectral 1.4.2 → 1.4.4
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 +7 -7
- 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 +22 -15
- 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 +23 -15
- package/dist/ButtonIcon.d.ts +1 -1
- package/dist/ButtonIcon.js +5 -5
- package/dist/Card.d.ts +2 -7
- package/dist/Card.js +9 -20
- package/dist/Checkbox/CheckboxBase.d.ts +6 -6
- package/dist/Checkbox/CheckboxBase.js +65 -63
- package/dist/Checkbox.js +16 -14
- package/dist/DataCard.d.ts +11 -0
- package/dist/DataCard.js +18 -0
- 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/base-colors.css +12 -12
- 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
|
|
5
|
-
import { Separator as
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { ButtonGroupButton as u } from "./ButtonGroup/ButtonGroupButton.js";
|
|
5
|
+
import { Separator as d } 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 === p || 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 p = ({
|
|
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
|
+
p.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(d, { "data-slot": "button-group-separator", "data-testid": "spectral-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
|
+
p 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
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import { ComponentProps } from 'react';
|
|
3
|
-
export type CardProps = ComponentProps<'div'> &
|
|
2
|
+
export type CardProps = ComponentProps<'div'> & {
|
|
4
3
|
asChild?: boolean;
|
|
5
4
|
};
|
|
6
|
-
declare const cardVariants: (props?: ({
|
|
7
|
-
variant?: "small" | "default" | null | undefined;
|
|
8
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
5
|
export declare const CardBase: ({ ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
6
|
export declare const CardHeader: ({ className, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
7
|
export declare const CardTitle: ({ className, asChild, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
8
|
export declare const CardHeaderEndSlot: ({ className, asChild, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
9
|
export declare const CardContent: ({ className, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const Card: ({ className,
|
|
15
|
-
export {};
|
|
10
|
+
export declare const Card: ({ className, asChild, children, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
11
|
//# sourceMappingURL=Card.d.ts.map
|
package/dist/Card.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
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";
|
|
6
5
|
import "react";
|
|
7
|
-
const
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: "gap-6 rounded-xl content-card",
|
|
11
|
-
small: "data-card gap-2 rounded-lg"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: "default"
|
|
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 });
|
|
6
|
+
const o = "text-text-primary flex flex-col w-full card-effects p-3 gap-6 rounded-xl", f = ({ ...t }) => /* @__PURE__ */ e("div", { "data-slot": "card", "data-testid": "spectral-card", ...t }), C = ({ 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 }), u = ({ 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 }), x = ({ 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 }), v = ({ className: t, ...a }) => /* @__PURE__ */ e("div", { "data-slot": "card-content", "data-testid": "spectral-card-content", className: t, ...a }), N = ({ className: t, asChild: a = !1, children: r, ...s }) => /* @__PURE__ */ e(a ? c : "div", { "data-slot": "card", "data-testid": "spectral-card", className: d(o, t), ...s, children: r });
|
|
18
7
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
N as Card,
|
|
9
|
+
f as CardBase,
|
|
10
|
+
v as CardContent,
|
|
11
|
+
C as CardHeader,
|
|
12
|
+
x as CardHeaderEndSlot,
|
|
13
|
+
u as CardTitle
|
|
25
14
|
};
|
|
@@ -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 {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CardProps } from '../Card/Card';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type DataCardProps = CardProps & {
|
|
4
|
+
accentColor: string;
|
|
5
|
+
cardHeaderEndSlot: ReactNode;
|
|
6
|
+
dataDescription: string;
|
|
7
|
+
dataValue: string | number;
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const DataCard: ({ accentColor, cardHeaderEndSlot, className, dataDescription, dataValue, title, ...props }: DataCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=DataCard.d.ts.map
|
package/dist/DataCard.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "./styles/main.css";
|
|
2
|
+
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { Card as o, CardHeader as p, CardTitle as n, CardContent as m } from "./Card.js";
|
|
4
|
+
import { cn as x } from "./utils/twUtils.js";
|
|
5
|
+
import "react";
|
|
6
|
+
const C = ({ accentColor: d, cardHeaderEndSlot: e, className: r, dataDescription: s, dataValue: c, title: l, ...i }) => /* @__PURE__ */ t(o, { className: x("gap-4 card-effects", r), ...i, "data-testid": "spectral-datacard", children: [
|
|
7
|
+
/* @__PURE__ */ t(p, { className: "pb-0", "data-testid": "spectral-datacard-header", children: [
|
|
8
|
+
/* @__PURE__ */ a(n, { className: "uppercase text-sm font-bold", "data-testid": "spectral-datacard-title", children: l }),
|
|
9
|
+
/* @__PURE__ */ a("div", { style: { color: d }, "data-testid": "spectral-datacard-end-slot", children: e })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ a(m, { children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-4", children: [
|
|
12
|
+
/* @__PURE__ */ a("div", { className: "text-4xl font-bold", style: { color: d }, "data-testid": "spectral-datacard-data-value", children: c }),
|
|
13
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-data-card-description", "data-testid": "spectral-datacard-data-description", children: s })
|
|
14
|
+
] }) })
|
|
15
|
+
] });
|
|
16
|
+
export {
|
|
17
|
+
C as DataCard
|
|
18
|
+
};
|