@spear-ai/spectral 1.4.24 → 1.4.25

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.
@@ -17,5 +17,11 @@ export type RadioButtonGroupItemProps = AsChildProp & {
17
17
  onSelect?: (value: string) => void;
18
18
  };
19
19
  export declare const RadioButtonGroupBase: ({ value, onValueChange, children, className, isKeptActive, expanded }: RadioButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
20
- export declare const RadioButtonGroupItem: ({ value, children, className, disabled, asChild, onSelect }: RadioButtonGroupItemProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const RadioButtonGroupItem: import('react').ForwardRefExoticComponent<AsChildProp & {
21
+ value: string;
22
+ children: ReactNode;
23
+ className?: string;
24
+ disabled?: boolean;
25
+ onSelect?: (value: string) => void;
26
+ } & import('react').RefAttributes<HTMLButtonElement>>;
21
27
  //# sourceMappingURL=RadioButtonGroupBase.d.ts.map
@@ -1,37 +1,38 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
3
  import { jsx as a } from "react/jsx-runtime";
4
- import { Slot as x } from "../primitives/slot.js";
5
- import { cn as c } from "../utils/twUtils.js";
6
- import { createContext as h, useContext as w } from "react";
7
- const u = h(null), R = ({ value: t, onValueChange: n, children: i, className: o, isKeptActive: r = !1, expanded: e = !1 }) => /* @__PURE__ */ a(u.Provider, { value: { value: t, onValueChange: n, isKeptActive: r, expanded: e }, children: /* @__PURE__ */ a("div", { role: "radiogroup", "data-testid": "spectral-radio-button-group", "data-expanded": e, className: c("flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md", "data-[expanded=true]:w-full", o), children: i }) }), _ = ({ value: t, children: n, className: i, disabled: o = !1, asChild: r = !1, onSelect: e }) => {
8
- const s = w(u);
4
+ import { Slot as h } from "../primitives/slot.js";
5
+ import { cn as u } from "../utils/twUtils.js";
6
+ import { createContext as w, forwardRef as B, useContext as R } from "react";
7
+ const c = w(null), z = ({ value: t, onValueChange: n, children: i, className: o, isKeptActive: r = !1, expanded: e = !1 }) => /* @__PURE__ */ a(c.Provider, { value: { value: t, onValueChange: n, isKeptActive: r, expanded: e }, children: /* @__PURE__ */ a("div", { role: "radiogroup", "data-testid": "spectral-radio-button-group", "data-expanded": e, className: u("flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md", "data-[expanded=true]:w-full", o), children: i }) }), y = B(({ value: t, children: n, className: i, disabled: o = !1, asChild: r = !1, onSelect: e }, g) => {
8
+ const s = R(c);
9
9
  if (!s)
10
10
  throw new Error("RadioButtonGroupItem must be used within a RadioButtonGroup");
11
- const { value: g, onValueChange: d, isKeptActive: b, expanded: f } = s, l = g === t, p = () => {
11
+ const { value: f, onValueChange: d, isKeptActive: b, expanded: p } = s, l = f === t, v = () => {
12
12
  o || (d && d(t), e && e(t));
13
- }, v = r ? x : "button", m = {
13
+ }, m = r ? h : "button", x = {
14
14
  role: "radio",
15
15
  "aria-checked": l,
16
16
  "data-state": l ? "on" : "off",
17
17
  "data-testid": "spectral-radio-button-group-item",
18
18
  disabled: o,
19
- onClick: p,
20
- className: c(
19
+ onClick: v,
20
+ className: u(
21
21
  `bg-toggle-bg inline-flex items-center justify-center gap-2 border text-sm font-medium disabled:pointer-events-none disabled:opacity-50
22
22
  disabled:cursor-not-allowed hover:cursor-pointer text-toggle-text hover:bg-toggle-bg--hover hover:text-toggle-text--hover transition-[colors]
23
23
  [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus:outline-none
24
24
  outline-none border-toggle-border hover:border-toggle-border--hover h-9 px-3 min-w-9 [&_svg:not([class*='size-']):not([width]):not([height])]:size-4
25
25
  rounded-none shadow-none focus:z-10 focus-visible:z-10 [&:not(:first-child)]:border-l-0 active:bg-toggle-bg--active active:text-toggle-text--active
26
26
  active:border-toggle-border--active`,
27
- f && "w-full",
27
+ p && "w-full",
28
28
  b && "data-[state=on]:bg-toggle-bg--active data-[state=on]:text-toggle-text--active data-[state=on]:border-toggle-border--active",
29
29
  i
30
30
  )
31
31
  };
32
- return /* @__PURE__ */ a(v, { ...!r && { type: "button" }, ...m, children: n });
33
- };
32
+ return /* @__PURE__ */ a(m, { ref: g, ...!r && { type: "button" }, ...x, children: n });
33
+ });
34
+ y.displayName = "RadioButtonGroupItem";
34
35
  export {
35
- R as RadioButtonGroupBase,
36
- _ as RadioButtonGroupItem
36
+ z as RadioButtonGroupBase,
37
+ y as RadioButtonGroupItem
37
38
  };
@@ -3,5 +3,11 @@ import { ComponentProps } from 'react';
3
3
  export type RadioButtonGroupProps = ComponentProps<typeof RadioButtonGroupBase>;
4
4
  export type RadioButtonGroupItemProps = RadioButtonGroupItemPropsBase;
5
5
  export declare const RadioButtonGroup: ({ className, children, ...props }: RadioButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
6
- export declare const RadioButtonGroupItem: ({ value, children, className, disabled, asChild, onSelect }: RadioButtonGroupItemPropsBase) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const RadioButtonGroupItem: import('react').ForwardRefExoticComponent<import('../../primitives/slot').AsChildProp & {
7
+ value: string;
8
+ children: import('react').ReactNode;
9
+ className?: string;
10
+ disabled?: boolean;
11
+ onSelect?: (value: string) => void;
12
+ } & import('react').RefAttributes<HTMLButtonElement>>;
7
13
  //# sourceMappingURL=RadioButtonGroup.d.ts.map
@@ -18,18 +18,18 @@ const m = w({
18
18
  "data-size": e,
19
19
  "data-layout": a,
20
20
  className: c(
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",
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 px-2",
22
22
  r
23
23
  ),
24
24
  ...i,
25
25
  children: /* @__PURE__ */ s(m.Provider, { value: { variant: o, size: e, layout: a, activeColor: l, activeTextColor: d }, children: n })
26
26
  }
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;
27
+ ), I = h(({ className: r, children: o, variant: e, size: a, value: l, layout: d, activeColor: n, activeTextColor: i, style: v, ...f }, x) => {
28
+ const t = A(m), g = t.variant ?? e, u = t.size ?? a, p = t.layout ?? d, y = n ?? t.activeColor, b = i ?? t.activeTextColor;
29
29
  return /* @__PURE__ */ s(
30
30
  C,
31
31
  {
32
- ref: y,
32
+ ref: x,
33
33
  "data-slot": "toggle-group-item",
34
34
  "data-testid": "spectral-toggle-group-item",
35
35
  "data-variant": g,
@@ -45,7 +45,7 @@ const m = w({
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(x, b), ...v },
48
+ style: { ...z(y, b), ...v },
49
49
  ...f,
50
50
  children: o
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spear-ai/spectral",
3
- "version": "1.4.24",
3
+ "version": "1.4.25",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "repository": {
@@ -107,7 +107,7 @@
107
107
  "prettier": "^3.7.4",
108
108
  "prettier-plugin-sort-imports": "^1.8.9",
109
109
  "prettier-plugin-tailwindcss": "^0.7.2",
110
- "storybook": "^10.1.4",
110
+ "storybook": "^10.1.10",
111
111
  "stylelint": "^16.26.1",
112
112
  "stylelint-config-standard": "^39.0.1",
113
113
  "tailwindcss": "^4.1.17",