@spear-ai/spectral 1.4.18 → 1.4.19
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/ButtonGroup/ButtonGroupButton.js +8 -8
- package/dist/InputGroup.d.ts +1 -1
- package/dist/Toggle.d.ts +2 -1
- package/dist/Toggle.js +25 -18
- package/dist/ToggleGroup.d.ts +3 -1
- package/dist/ToggleGroup.js +32 -32
- package/dist/Tray.js +282 -282
- package/dist/main.js +10 -10
- package/dist/styles/main.css +1 -1
- package/dist/utils/twUtils.js +530 -497
- package/package.json +38 -38
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "../styles/main.css";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { Slot as a } from "../primitives/slot.js";
|
|
4
4
|
import { cn as r } from "../utils/twUtils.js";
|
|
5
|
-
import { c } from "../index-D29mdTf5.js";
|
|
5
|
+
import { c as l } from "../index-D29mdTf5.js";
|
|
6
6
|
import "react";
|
|
7
|
-
const
|
|
7
|
+
const c = l(
|
|
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-visible:outline-accent
|
|
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`,
|
|
10
|
+
aria-invalid:ring-destructive/20 aria-invalid:border-destructive bg-level-one text-text-primary hover:bg-level-two cursor-pointer active:text-text-inverted active:bg-accent`,
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
default: "",
|
|
15
|
-
outline: "border border-level-three
|
|
15
|
+
outline: "border border-level-three"
|
|
16
16
|
},
|
|
17
17
|
size: {
|
|
18
18
|
md: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
@@ -33,10 +33,10 @@ const l = c(
|
|
|
33
33
|
variant: t,
|
|
34
34
|
size: e,
|
|
35
35
|
asChild: o = !1,
|
|
36
|
-
...
|
|
37
|
-
}) => /* @__PURE__ */
|
|
36
|
+
...s
|
|
37
|
+
}) => /* @__PURE__ */ n(o ? a : "button", { "data-slot": "button-group-item", "data-variant": t, "data-size": e, className: r(c({ variant: t, size: e, className: i })), ...s });
|
|
38
38
|
u.displayName = "ButtonGroupButton";
|
|
39
39
|
export {
|
|
40
40
|
u as ButtonGroupButton,
|
|
41
|
-
|
|
41
|
+
c as buttonVariants
|
|
42
42
|
};
|
package/dist/InputGroup.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
4
|
export declare const InputGroup: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
-
align?: "
|
|
6
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
export declare const InputGroupAddon: ({ className, align, ...props }: ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const inputGroupButtonVariants: (props?: ({
|
package/dist/Toggle.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { ToggleBase } from './ToggleBase';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { ComponentProps, CSSProperties } from 'react';
|
|
4
4
|
export type ActiveColor = string;
|
|
5
|
-
export declare function getActiveColorStyle(activeColor: ActiveColor | undefined): CSSProperties | undefined;
|
|
5
|
+
export declare function getActiveColorStyle(activeColor: ActiveColor | undefined, activeTextColor?: ActiveColor): CSSProperties | undefined;
|
|
6
6
|
export type ToggleProps = ComponentProps<typeof ToggleBase> & VariantProps<typeof toggleVariants> & {
|
|
7
7
|
activeColor?: ActiveColor;
|
|
8
|
+
activeTextColor?: ActiveColor;
|
|
8
9
|
};
|
|
9
10
|
export declare const toggleVariants: (props?: ({
|
|
10
11
|
variant?: "default" | "outline" | null | undefined;
|
package/dist/Toggle.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { ToggleBase as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { c as
|
|
7
|
-
import { forwardRef as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
const t = h.test(e) ? e : `var(--color-${e})`;
|
|
12
|
-
return {
|
|
13
|
-
"--color-toggle-bg--active": t,
|
|
14
|
-
"--color-toggle-border--active": t
|
|
15
|
-
};
|
|
3
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
|
+
import { ToggleBase as v } from "./Toggle/ToggleBase.js";
|
|
5
|
+
import { cn as b } from "./utils/twUtils.js";
|
|
6
|
+
import { c as u } from "./index-D29mdTf5.js";
|
|
7
|
+
import { forwardRef as h } from "react";
|
|
8
|
+
const f = /^(#|rgb|hsl|oklch|oklab|lab|lch|color|var\(|transparent|currentcolor)/i, p = /^(success|warning|danger|primary|neutral|secondary)-\d+$/;
|
|
9
|
+
function r(e) {
|
|
10
|
+
return f.test(e) ? e : p.test(e) ? `var(--horizon-color-${e})` : `var(--color-${e})`;
|
|
16
11
|
}
|
|
17
|
-
|
|
12
|
+
function m(e, t) {
|
|
13
|
+
if (!(!e && !t))
|
|
14
|
+
return {
|
|
15
|
+
...e && {
|
|
16
|
+
"--color-toggle-bg--active": r(e),
|
|
17
|
+
"--color-toggle-border--active": r(e)
|
|
18
|
+
},
|
|
19
|
+
...t && {
|
|
20
|
+
"--color-toggle-text--active": r(t)
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const x = u(
|
|
18
25
|
`
|
|
19
26
|
bg-toggle-bg inline-flex items-center justify-center gap-2 border rounded-md text-sm shadow-sm font-medium w-fit text-toggle-text whitespace-nowrap outline-none transition-[colors]
|
|
20
27
|
[&_svg]:pointer-events-none [&_svg]:shrink-0 active:bg-toggle-bg--active hover:cursor-pointer hover:bg-toggle-bg--hover hover:border-toggle-border--hover hover:text-toggle-text--hover
|
|
@@ -44,9 +51,9 @@ const f = b(
|
|
|
44
51
|
layout: "default"
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
|
-
),
|
|
54
|
+
), A = h(({ className: e, variant: t, size: o, layout: a, disabled: i, activeColor: g, activeTextColor: n, style: s, ...l }, d) => /* @__PURE__ */ c(v, { ref: d, disabled: i, "data-slot": "toggle", "data-testid": "spectral-toggle", className: b(x({ variant: t, size: o, layout: a }), e), style: { ...m(g, n), ...s }, ...l }));
|
|
48
55
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
A as Toggle,
|
|
57
|
+
m as getActiveColorStyle,
|
|
58
|
+
x as toggleVariants
|
|
52
59
|
};
|
package/dist/ToggleGroup.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ComponentProps } from 'react';
|
|
5
5
|
export type ToggleGroupItemProps = ComponentProps<typeof ToggleGroupItemBase> & VariantProps<typeof toggleVariants> & {
|
|
6
6
|
activeColor?: ActiveColor;
|
|
7
|
+
activeTextColor?: ActiveColor;
|
|
7
8
|
};
|
|
8
9
|
export type ToggleGroupProps = ComponentProps<typeof ToggleGroupBase> & VariantProps<typeof toggleVariants> & {
|
|
9
10
|
activeColor?: ActiveColor;
|
|
11
|
+
activeTextColor?: ActiveColor;
|
|
10
12
|
};
|
|
11
|
-
export declare const ToggleGroup: ({ className, variant, size, layout, activeColor, children, ...props }: ToggleGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const ToggleGroup: ({ className, variant, size, layout, activeColor, activeTextColor, children, ...props }: ToggleGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export declare const ToggleGroupItem: import('react').ForwardRefExoticComponent<Omit<ToggleGroupItemProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
13
15
|
//# sourceMappingURL=ToggleGroup.d.ts.map
|
package/dist/ToggleGroup.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { ToggleGroupItemBase as
|
|
5
|
-
import { getActiveColorStyle as z, toggleVariants as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { createContext as
|
|
8
|
-
const
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { ToggleGroupItemBase as C, ToggleGroupBase as T } from "./ToggleGroup/ToggleGroupBase.js";
|
|
5
|
+
import { getActiveColorStyle as z, toggleVariants as G } from "./Toggle.js";
|
|
6
|
+
import { cn as c } from "./utils/twUtils.js";
|
|
7
|
+
import { createContext as w, forwardRef as h, useContext as A } from "react";
|
|
8
|
+
const m = w({
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|
|
11
11
|
layout: "default"
|
|
12
|
-
}),
|
|
13
|
-
|
|
12
|
+
}), j = ({ className: r, variant: o, size: e, layout: a, activeColor: l, activeTextColor: d, children: n, ...i }) => /* @__PURE__ */ s(
|
|
13
|
+
T,
|
|
14
14
|
{
|
|
15
15
|
"data-slot": "toggle-group",
|
|
16
16
|
"data-testid": "spectral-toggle-group",
|
|
17
|
-
"data-variant":
|
|
18
|
-
"data-size":
|
|
19
|
-
"data-layout":
|
|
20
|
-
className:
|
|
17
|
+
"data-variant": o,
|
|
18
|
+
"data-size": e,
|
|
19
|
+
"data-layout": a,
|
|
20
|
+
className: c(
|
|
21
21
|
"group/toggle-group [&[data-variant='outline']]:bg-toggle-group-bg flex h-fit w-fit [&[data-layout='expanded']]:w-full items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md [&[data-variant='outline']]:gap-0.25",
|
|
22
22
|
r
|
|
23
23
|
),
|
|
24
|
-
...
|
|
25
|
-
children: /* @__PURE__ */
|
|
24
|
+
...i,
|
|
25
|
+
children: /* @__PURE__ */ s(m.Provider, { value: { variant: o, size: e, layout: a, activeColor: l, activeTextColor: d }, children: n })
|
|
26
26
|
}
|
|
27
|
-
),
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
27
|
+
), I = h(({ className: r, children: o, variant: e, size: a, value: l, layout: d, activeColor: n, activeTextColor: i, style: v, ...f }, y) => {
|
|
28
|
+
const t = A(m), g = t.variant ?? e, u = t.size ?? a, p = t.layout ?? d, x = n ?? t.activeColor, b = i ?? t.activeTextColor;
|
|
29
|
+
return /* @__PURE__ */ s(
|
|
30
|
+
C,
|
|
31
31
|
{
|
|
32
|
-
ref:
|
|
32
|
+
ref: y,
|
|
33
33
|
"data-slot": "toggle-group-item",
|
|
34
34
|
"data-testid": "spectral-toggle-group-item",
|
|
35
|
-
"data-variant":
|
|
36
|
-
"data-size":
|
|
37
|
-
"data-layout":
|
|
35
|
+
"data-variant": g,
|
|
36
|
+
"data-size": u,
|
|
37
|
+
"data-layout": p,
|
|
38
38
|
value: l,
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
variant:
|
|
42
|
-
size:
|
|
43
|
-
layout:
|
|
39
|
+
className: c(
|
|
40
|
+
G({
|
|
41
|
+
variant: g,
|
|
42
|
+
size: u,
|
|
43
|
+
layout: p
|
|
44
44
|
}),
|
|
45
45
|
"group data-[variant=outline]:border-togglegroup-border rounded-none shadow-none focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0",
|
|
46
46
|
r
|
|
47
47
|
),
|
|
48
|
-
style: { ...z(
|
|
48
|
+
style: { ...z(x, b), ...v },
|
|
49
49
|
...f,
|
|
50
|
-
children:
|
|
50
|
+
children: o
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
});
|
|
54
|
-
|
|
54
|
+
I.displayName = "ToggleGroupItem";
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
j as ToggleGroup,
|
|
57
|
+
I as ToggleGroupItem
|
|
58
58
|
};
|