@blakesteve/roster 5.2.0 → 5.3.0

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 (68) hide show
  1. package/README.md +121 -20
  2. package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
  3. package/dist/components/atoms/Avatar/Avatar.js +1 -1
  4. package/dist/components/atoms/Avatar/avatar-variants.cjs +1 -1
  5. package/dist/components/atoms/Avatar/avatar-variants.js +1 -1
  6. package/dist/components/atoms/Button/button-variants.cjs +1 -1
  7. package/dist/components/atoms/Button/button-variants.js +3 -3
  8. package/dist/components/atoms/Card/card-variants.cjs +1 -1
  9. package/dist/components/atoms/Card/card-variants.js +3 -2
  10. package/dist/components/atoms/Checkbox/Checkbox.cjs +1 -1
  11. package/dist/components/atoms/Checkbox/Checkbox.d.ts +5 -0
  12. package/dist/components/atoms/Checkbox/Checkbox.js +54 -40
  13. package/dist/components/atoms/Checkbox/checkbox-variants.cjs +1 -1
  14. package/dist/components/atoms/Checkbox/checkbox-variants.js +1 -1
  15. package/dist/components/atoms/Combobox/Combobox.cjs +1 -1
  16. package/dist/components/atoms/Combobox/Combobox.js +63 -62
  17. package/dist/components/atoms/InlineCode/inline-code-variants.cjs +1 -1
  18. package/dist/components/atoms/InlineCode/inline-code-variants.js +1 -1
  19. package/dist/components/atoms/Input/Input.cjs +1 -1
  20. package/dist/components/atoms/Input/Input.js +49 -52
  21. package/dist/components/atoms/Input/input-variants.cjs +1 -1
  22. package/dist/components/atoms/Input/input-variants.js +17 -7
  23. package/dist/components/atoms/LabeledDivider/LabeledDivider.cjs +1 -1
  24. package/dist/components/atoms/LabeledDivider/LabeledDivider.js +6 -6
  25. package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
  26. package/dist/components/atoms/MultiSelect/MultiSelect.js +62 -60
  27. package/dist/components/atoms/PasswordInput/PasswordInput.cjs +1 -1
  28. package/dist/components/atoms/PasswordInput/PasswordInput.js +1 -1
  29. package/dist/components/atoms/Select/Select.cjs +1 -1
  30. package/dist/components/atoms/Select/Select.js +52 -51
  31. package/dist/components/atoms/Select/select-variants.cjs +1 -1
  32. package/dist/components/atoms/Select/select-variants.js +9 -2
  33. package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
  34. package/dist/components/atoms/Switch/switch-variants.js +1 -1
  35. package/dist/components/atoms/Textarea/Textarea.cjs +1 -1
  36. package/dist/components/atoms/Textarea/Textarea.js +36 -34
  37. package/dist/components/atoms/Textarea/textarea-variants.cjs +1 -1
  38. package/dist/components/atoms/Textarea/textarea-variants.js +17 -11
  39. package/dist/components/atoms/Tooltip/Tooltip.cjs +1 -1
  40. package/dist/components/atoms/Tooltip/Tooltip.js +1 -1
  41. package/dist/components/molecules/Accordion/Accordion.cjs +1 -1
  42. package/dist/components/molecules/Accordion/Accordion.js +19 -19
  43. package/dist/components/molecules/Alert/Alert.cjs +1 -1
  44. package/dist/components/molecules/Alert/Alert.js +1 -1
  45. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.cjs +1 -1
  46. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts +5 -3
  47. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.js +68 -65
  48. package/dist/components/molecules/RadioGroup/RadioGroup.cjs +1 -1
  49. package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +4 -3
  50. package/dist/components/molecules/RadioGroup/RadioGroup.js +48 -47
  51. package/dist/components/molecules/Toast/Toast.cjs +1 -1
  52. package/dist/components/molecules/Toast/Toast.js +1 -1
  53. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  54. package/dist/components/organisms/Dialog/Dialog.js +28 -24
  55. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  56. package/dist/components/organisms/Navbar/Navbar.js +2 -2
  57. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  58. package/dist/components/organisms/Sheet/Sheet.js +1 -1
  59. package/dist/internal/field-invalid.cjs +1 -0
  60. package/dist/internal/field-invalid.d.ts +37 -0
  61. package/dist/internal/field-invalid.js +13 -0
  62. package/dist/internal/popup.cjs +1 -1
  63. package/dist/internal/popup.js +1 -1
  64. package/dist/lib/utils.cjs +1 -1
  65. package/dist/lib/utils.js +16 -11
  66. package/dist/meta.json +3 -3
  67. package/dist/roster.css +1 -1
  68. package/package.json +1 -1
@@ -1,26 +1,27 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
3
- import u from "react";
4
- import { Description as N } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Field as b } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
- import { Label as y } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
- import { Textarea as h } from "../../../node_modules/@headlessui/react/dist/components/textarea/textarea.js";
8
- import { cn as e } from "../../../lib/utils.js";
2
+ import { jsxs as N, jsx as e } from "react/jsx-runtime";
3
+ import b from "react";
4
+ import { Description as h } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
+ import { Field as v } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
+ import { Label as w } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
+ import { Textarea as y } from "../../../node_modules/@headlessui/react/dist/components/textarea/textarea.js";
8
+ import { cn as s } from "../../../lib/utils.js";
9
9
  import { textareaVariants as k } from "./textarea-variants.js";
10
- const w = u.forwardRef(
10
+ import { isFieldInvalid as j, withoutInvalidProps as F } from "../../../internal/field-invalid.js";
11
+ const I = b.forwardRef(
11
12
  ({
12
13
  className: m,
13
- label: s,
14
- helperText: a,
14
+ label: a,
15
+ helperText: o,
15
16
  errorMessage: t,
16
- variant: i,
17
- error: l,
18
- resize: c,
19
- disabled: d,
20
- textareaClassName: n,
21
- ...x
17
+ variant: l,
18
+ error: n,
19
+ resize: d,
20
+ disabled: c,
21
+ textareaClassName: x,
22
+ ...i
22
23
  }, f) => {
23
- const o = !!t || l;
24
+ const r = !!t || n, p = j(r, i), u = F(i);
24
25
  return (
25
26
  /* No `space-y-*` here, for the reason documented on Input: Headless UI's
26
27
  Field always renders a trailing hidden element, and Tailwind v4
@@ -30,37 +31,38 @@ const w = u.forwardRef(
30
31
  the label and description instead. Select is immune to the same trap
31
32
  only because it spaces with `gap`, and the hidden element is
32
33
  `display: none` so it is not a flex item. */
33
- /* @__PURE__ */ p(b, { className: e("rst:w-full", m), children: [
34
- s && /* `--roster-control-text`, matching Input's label — see the comment
34
+ /* @__PURE__ */ N(v, { className: s("rst:w-full", m), children: [
35
+ a && /* `--roster-control-text`, matching Input's label — see the comment
35
36
  there for why not `text-inherit`. */
36
- /* @__PURE__ */ r(y, { className: "rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-[var(--roster-control-text)] rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70 rst:text-left rst:mb-1.5", children: s }),
37
- /* @__PURE__ */ r(
38
- h,
37
+ /* @__PURE__ */ e(w, { className: "rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-[var(--roster-control-text)] rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70 rst:text-left rst:mb-1.5", children: a }),
38
+ /* @__PURE__ */ e(
39
+ y,
39
40
  {
40
41
  ref: f,
41
- disabled: d,
42
- className: e(
43
- k({ variant: i, resize: c, error: o }),
44
- n
42
+ disabled: c,
43
+ className: s(
44
+ k({ variant: l, resize: d, error: r }),
45
+ x
45
46
  ),
46
- ...x
47
+ ...u,
48
+ invalid: p
47
49
  }
48
50
  ),
49
- (a || t) && /* @__PURE__ */ r(
50
- N,
51
+ (o || t) && /* @__PURE__ */ e(
52
+ h,
51
53
  {
52
- className: e(
54
+ className: s(
53
55
  "rst:text-xs rst:text-left rst:mt-1.5",
54
- o ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
56
+ r ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
55
57
  ),
56
- children: t || a
58
+ children: t || o
57
59
  }
58
60
  )
59
61
  ] })
60
62
  );
61
63
  }
62
64
  );
63
- w.displayName = "Textarea";
65
+ I.displayName = "Textarea";
64
66
  export {
65
- w as Textarea
67
+ I as Textarea
66
68
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:placeholder:text-gray-400 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",{variants:{variant:{outline:"rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:focus-visible:border-[var(--roster-control-border-focus)]",soft:"rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",ghost:"rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",white:"rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"},error:{true:"rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:placeholder:text-error-300 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100 rst:dark:placeholder:text-error-400/50",false:""},resize:{none:"rst:resize-none",vertical:"rst:resize-y",horizontal:"rst:resize-x",both:"rst:resize"}},defaultVariants:{variant:"outline",error:!1,resize:"vertical"}});exports.textareaVariants=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",{variants:{variant:{outline:"rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:placeholder:text-[color-mix(in_srgb,var(--roster-control-text)_65%,transparent)] rst:focus-visible:border-[var(--roster-control-border-focus)]",soft:"rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",ghost:"rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",white:"rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"},error:{true:"rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100",false:""},resize:{none:"rst:resize-none",vertical:"rst:resize-y",horizontal:"rst:resize-x",both:"rst:resize"}},defaultVariants:{variant:"outline",error:!1,resize:"vertical"}});exports.textareaVariants=t;
@@ -1,6 +1,6 @@
1
1
  import { cva as r } from "../../../node_modules/class-variance-authority/dist/index.js";
2
2
  const s = /* @__PURE__ */ r(
3
- "rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:placeholder:text-gray-400 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",
3
+ "rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",
4
4
  {
5
5
  variants: {
6
6
  variant: {
@@ -12,11 +12,17 @@ const s = /* @__PURE__ */ r(
12
12
  gray-950, a near-black box on a gray-800 dialog. Both were reported
13
13
  by eye before anyone read the variants.
14
14
 
15
- No `dark:placeholder:text-gray-500` here even though Input's
16
- `outline` carries one: Input has no placeholder rule in its base, so
17
- its variant supplies both scopes. This base already sets gray-400,
18
- and copying Input's line across darkened it to gray-500 — 3.30:1 on
19
- the page, under the 4.5:1 placeholder text needs.
15
+ The placeholder is the field's own text color at 65%, the same rule
16
+ Input's `outline` uses, so it reaches 4.5:1 on whatever surface the
17
+ text token was chosen for: 5.46:1 on a white page, 7.76 on the dark
18
+ one, 5.02 inside the `slate` Dialog, measured rendered. The base used to set gray-400
19
+ for every variant and scheme, which is 2.52:1 on white, and
20
+ Input's old dark gray-500 is 3.30:1 on the dark page; neither is a
21
+ step that passes in both. The other variants name their surface, so
22
+ they name a step for each scheme instead: gray-500 light, gray-400
23
+ dark. An error no longer recolors the placeholder: red at a
24
+ readable contrast is too close to the typed text's own red to tell
25
+ apart, and the border and message already say what's wrong.
20
26
 
21
27
  The border and text defaults are the values this variant already
22
28
  used. The fill does change,
@@ -25,7 +31,7 @@ const s = /* @__PURE__ */ r(
25
31
  is the entire point everywhere else: a field drawn inside a Dialog
26
32
  now takes the Dialog's surface instead of punching a white or
27
33
  near-black hole in it. */
28
- outline: "rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:focus-visible:border-[var(--roster-control-border-focus)]",
34
+ outline: "rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:placeholder:text-[color-mix(in_srgb,var(--roster-control-text)_65%,transparent)] rst:focus-visible:border-[var(--roster-control-border-focus)]",
29
35
  /* A boundary that does not depend on what is behind it. `soft` used
30
36
  `border-transparent` and leaned on its fill alone, which fails the
31
37
  moment the fill matches the surface — exactly 1.00:1 inside a
@@ -33,12 +39,12 @@ const s = /* @__PURE__ */ r(
33
39
  vanished until focus. Reported twice in one app before anyone read
34
40
  the variant. The border is the same token `outline` reads, so a
35
41
  consumer repaints both at once. */
36
- soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",
37
- ghost: "rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",
38
- white: "rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"
42
+ soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",
43
+ ghost: "rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",
44
+ white: "rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"
39
45
  },
40
46
  error: {
41
- true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:placeholder:text-error-300 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100 rst:dark:placeholder:text-error-400/50",
47
+ true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100",
42
48
  false: ""
43
49
  },
44
50
  resize: {
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),r=require("../../../node_modules/@radix-ui/react-tooltip/dist/index.cjs"),h=require("../../../lib/utils.cjs");function x({content:o,children:n,placement:d="top",variant:e="dark",delayDuration:l=300,defaultOpen:a=!1,className:c}){const[g,s]=i.useState(a),p=i.useCallback(()=>s(u=>!u),[]);return t.jsx(r.Provider,{delayDuration:l,children:t.jsxs(r.Root,{open:g,onOpenChange:s,children:[t.jsx(r.Trigger,{asChild:!0,onClick:p,children:t.jsx("span",{className:"rst:inline-flex rst:items-center rst:cursor-default",tabIndex:0,"data-testid":"tooltip-trigger",children:n})}),t.jsx(r.Portal,{children:t.jsxs(r.Content,{side:d,sideOffset:8,collisionPadding:8,"data-testid":"tooltip-content",className:h.cn("rst:font-ui rst:z-50 rst:max-w-60 rst:rounded-lg rst:px-3 rst:py-2 rst:text-xs rst:leading-snug rst:elevation-anchored","rst:animate-in rst:fade-in-0 rst:zoom-in-95","rst:data-[side=bottom]:slide-in-from-top-2","rst:data-[side=top]:slide-in-from-bottom-2","rst:data-[side=left]:slide-in-from-right-2","rst:data-[side=right]:slide-in-from-left-2",e==="themed"?"rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring-1 rst:ring-[var(--roster-popover-border)]":e==="dark"?"rst:bg-zinc-900 rst:text-zinc-100 rst:ring-1 rst:ring-white/10":"rst:bg-white rst:text-zinc-900 rst:ring-1 rst:ring-zinc-200",c),children:[o,t.jsx(r.Arrow,{className:e==="themed"?"rst:fill-[var(--roster-popover-bg)]":e==="dark"?"rst:fill-zinc-900":"rst:fill-white",width:12,height:6})]})})]})})}exports.Tooltip=x;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),r=require("../../../node_modules/@radix-ui/react-tooltip/dist/index.cjs"),h=require("../../../lib/utils.cjs");function x({content:o,children:n,placement:d="top",variant:e="dark",delayDuration:l=300,defaultOpen:a=!1,className:c}){const[g,s]=i.useState(a),p=i.useCallback(()=>s(u=>!u),[]);return t.jsx(r.Provider,{delayDuration:l,children:t.jsxs(r.Root,{open:g,onOpenChange:s,children:[t.jsx(r.Trigger,{asChild:!0,onClick:p,children:t.jsx("span",{className:"rst:inline-flex rst:items-center rst:cursor-default",tabIndex:0,"data-testid":"tooltip-trigger",children:n})}),t.jsx(r.Portal,{children:t.jsxs(r.Content,{side:d,sideOffset:8,collisionPadding:8,"data-testid":"tooltip-content",className:h.cn("rst:font-ui rst:z-50 rst:max-w-60 rst:rounded-lg rst:px-3 rst:py-2 rst:text-xs rst:leading-snug rst:elevation-anchored","rst:animate-in rst:fade-in-0 rst:zoom-in-95","rst:data-[side=bottom]:slide-in-from-top-2","rst:data-[side=top]:slide-in-from-bottom-2","rst:data-[side=left]:slide-in-from-right-2","rst:data-[side=right]:slide-in-from-left-2",e==="themed"?"rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring rst:ring-[var(--roster-popover-border)]":e==="dark"?"rst:bg-zinc-900 rst:text-zinc-100 rst:ring rst:ring-white/10":"rst:bg-white rst:text-zinc-900 rst:ring rst:ring-zinc-200",c),children:[o,t.jsx(r.Arrow,{className:e==="themed"?"rst:fill-[var(--roster-popover-bg)]":e==="dark"?"rst:fill-zinc-900":"rst:fill-white",width:12,height:6})]})})]})})}exports.Tooltip=x;
@@ -37,7 +37,7 @@ function P({
37
37
  "rst:data-[side=top]:slide-in-from-bottom-2",
38
38
  "rst:data-[side=left]:slide-in-from-right-2",
39
39
  "rst:data-[side=right]:slide-in-from-left-2",
40
- r === "themed" ? "rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring-1 rst:ring-[var(--roster-popover-border)]" : r === "dark" ? "rst:bg-zinc-900 rst:text-zinc-100 rst:ring-1 rst:ring-white/10" : "rst:bg-white rst:text-zinc-900 rst:ring-1 rst:ring-zinc-200",
40
+ r === "themed" ? "rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring rst:ring-[var(--roster-popover-border)]" : r === "dark" ? "rst:bg-zinc-900 rst:text-zinc-100 rst:ring rst:ring-white/10" : "rst:bg-white rst:text-zinc-900 rst:ring rst:ring-zinc-200",
41
41
  l
42
42
  ),
43
43
  children: [
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("react"),x=require("../../../lib/utils.cjs"),h=require("../../atoms/Disclosure/Disclosure.cjs"),j=({items:c,allowMultiple:l=!1,variant:o="soft",className:i,showDividers:a=!1,defaultOpenIds:u=[]})=>{const[d,g]=p.useState(new Set(u)),f=e=>{g(r=>{const s=new Set(r),n=s.has(e);return l?n?s.delete(e):s.add(e):(s.clear(),n||s.add(e)),s})};return t.jsx("div",{className:x.cn("rst:font-ui rst:w-full rst:space-y-1",i),children:c.map((e,r)=>t.jsxs("div",{className:"rst:relative",children:[a&&r>0&&t.jsx("div",{className:"rst:mx-4 rst:h-px rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1"}),t.jsx(h.Disclosure,{title:e.title,variant:o,isOpen:d.has(e.id),onToggle:()=>f(e.id),children:e.content})]},e.id))})};exports.Accordion=j;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("react"),p=require("../../../lib/utils.cjs"),x=require("../../atoms/Disclosure/Disclosure.cjs"),b=({items:o,allowMultiple:c=!1,variant:l="soft",className:i,showDividers:a=!1,defaultOpenIds:d=[]})=>{const[u,g]=h.useState(new Set(d)),f=e=>{g(r=>{const s=new Set(r),n=s.has(e);return c?n?s.delete(e):s.add(e):(s.clear(),n||s.add(e)),s})};return t.jsx("div",{className:p.cn("rst:font-ui rst:w-full rst:space-y-1",i),children:o.map((e,r)=>t.jsxs("div",{className:"rst:relative",children:[a&&r>0&&t.jsx("div",{className:"rst:mx-4 rst:h-[var(--roster-border-width,1px)] rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1"}),t.jsx(x.Disclosure,{title:e.title,variant:l,isOpen:u.has(e.id),onToggle:()=>f(e.id),children:e.content})]},e.id))})};exports.Accordion=b;
@@ -1,37 +1,37 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as g } from "react/jsx-runtime";
3
- import { useState as u } from "react";
4
- import { cn as h } from "../../../lib/utils.js";
2
+ import { jsx as t, jsxs as g } from "react/jsx-runtime";
3
+ import { useState as h } from "react";
4
+ import { cn as u } from "../../../lib/utils.js";
5
5
  import { Disclosure as x } from "../../atoms/Disclosure/Disclosure.js";
6
6
  const N = ({
7
- items: o,
7
+ items: n,
8
8
  allowMultiple: l = !1,
9
9
  variant: a = "soft",
10
- className: c,
11
- showDividers: i = !1,
10
+ className: i,
11
+ showDividers: c = !1,
12
12
  defaultOpenIds: d = []
13
13
  }) => {
14
- const [f, m] = u(
14
+ const [f, m] = h(
15
15
  new Set(d)
16
- ), p = (s) => {
17
- m((t) => {
18
- const e = new Set(t), n = e.has(s);
19
- return l ? n ? e.delete(s) : e.add(s) : (e.clear(), n || e.add(s)), e;
16
+ ), p = (e) => {
17
+ m((r) => {
18
+ const s = new Set(r), o = s.has(e);
19
+ return l ? o ? s.delete(e) : s.add(e) : (s.clear(), o || s.add(e)), s;
20
20
  });
21
21
  };
22
- return /* @__PURE__ */ r("div", { className: h("rst:font-ui rst:w-full rst:space-y-1", c), children: o.map((s, t) => /* @__PURE__ */ g("div", { className: "rst:relative", children: [
23
- i && t > 0 && /* @__PURE__ */ r("div", { className: "rst:mx-4 rst:h-px rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1" }),
24
- /* @__PURE__ */ r(
22
+ return /* @__PURE__ */ t("div", { className: u("rst:font-ui rst:w-full rst:space-y-1", i), children: n.map((e, r) => /* @__PURE__ */ g("div", { className: "rst:relative", children: [
23
+ c && r > 0 && /* @__PURE__ */ t("div", { className: "rst:mx-4 rst:h-[var(--roster-border-width,1px)] rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1" }),
24
+ /* @__PURE__ */ t(
25
25
  x,
26
26
  {
27
- title: s.title,
27
+ title: e.title,
28
28
  variant: a,
29
- isOpen: f.has(s.id),
30
- onToggle: () => p(s.id),
31
- children: s.content
29
+ isOpen: f.has(e.id),
30
+ onToggle: () => p(e.id),
31
+ children: e.content
32
32
  }
33
33
  )
34
- ] }, s.id)) });
34
+ ] }, e.id)) });
35
35
  };
36
36
  export {
37
37
  N as Accordion
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),o=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),r=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),c=require("../../../lib/utils.cjs"),v=require("./alert-variants.cjs"),b={error:r.faCircleExclamation,success:r.faCircleCheck,amber:r.faTriangleExclamation,info:r.faCircleInfo,primary:r.faCircleInfo,neutral:r.faCircleInfo,current:r.faCircleInfo},l=p.forwardRef(({colorScheme:e="error",surface:u,title:t,children:d,icon:i,onDismiss:a,dismissLabel:f="Dismiss",className:m,...x},h)=>{const n=e==="error";return s.jsxs("div",{ref:h,role:n?"alert":"status","aria-live":n?"assertive":"polite",className:c.cn(v.alertVariants({colorScheme:e,surface:u}),m),...x,children:[i===void 0?s.jsx(o.FontAwesomeIcon,{icon:b[e??"error"],className:"rst:mt-0.5 rst:h-4 rst:w-4 rst:shrink-0","aria-hidden":"true"}):i,s.jsxs("div",{className:"rst:min-w-0 rst:flex-1",children:[t&&s.jsx("p",{className:"rst:font-semibold",children:t}),s.jsx("div",{className:c.cn("rst:min-w-0",t&&"rst:mt-0.5 rst:opacity-90"),children:d})]}),a&&s.jsx("button",{type:"button",onClick:a,"aria-label":f,className:"rst:-m-1 rst:shrink-0 rst:rounded rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:s.jsx(o.FontAwesomeIcon,{icon:r.faXmark,className:"rst:h-3.5 rst:w-3.5","aria-hidden":"true"})})]})});l.displayName="Alert";exports.Alert=l;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),o=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),r=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),c=require("../../../lib/utils.cjs"),v=require("./alert-variants.cjs"),b={error:r.faCircleExclamation,success:r.faCircleCheck,amber:r.faTriangleExclamation,info:r.faCircleInfo,primary:r.faCircleInfo,neutral:r.faCircleInfo,current:r.faCircleInfo},l=p.forwardRef(({colorScheme:e="error",surface:u,title:t,children:d,icon:i,onDismiss:a,dismissLabel:m="Dismiss",className:f,...x},h)=>{const n=e==="error";return s.jsxs("div",{ref:h,role:n?"alert":"status","aria-live":n?"assertive":"polite",className:c.cn(v.alertVariants({colorScheme:e,surface:u}),f),...x,children:[i===void 0?s.jsx(o.FontAwesomeIcon,{icon:b[e??"error"],className:"rst:mt-0.5 rst:h-4 rst:w-4 rst:shrink-0","aria-hidden":"true"}):i,s.jsxs("div",{className:"rst:min-w-0 rst:flex-1",children:[t&&s.jsx("p",{className:"rst:font-semibold",children:t}),s.jsx("div",{className:c.cn("rst:min-w-0",t&&"rst:mt-0.5 rst:opacity-90"),children:d})]}),a&&s.jsx("button",{type:"button",onClick:a,"aria-label":m,className:"rst:-m-1 rst:shrink-0 rst:rounded-sm rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:s.jsx(o.FontAwesomeIcon,{icon:r.faXmark,className:"rst:h-3.5 rst:w-3.5","aria-hidden":"true"})})]})});l.displayName="Alert";exports.Alert=l;
@@ -53,7 +53,7 @@ const C = {
53
53
  type: "button",
54
54
  onClick: e,
55
55
  "aria-label": d,
56
- className: "rst:-m-1 rst:shrink-0 rst:rounded rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
56
+ className: "rst:-m-1 rst:shrink-0 rst:rounded-sm rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
57
57
  children: /* @__PURE__ */ r(c, { icon: w, className: "rst:h-3.5 rst:w-3.5", "aria-hidden": "true" })
58
58
  }
59
59
  )
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),A=require("react"),B=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),D=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.cjs"),F=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/legend/legend.cjs"),e=require("../../../lib/utils.cjs"),P=require("../../atoms/Checkbox/Checkbox.cjs"),R=require("../../atoms/Eyebrow/Eyebrow.cjs"),h=require("./checkbox-group-variants.cjs"),V=t=>t.length>0&&Array.isArray(t[0].options),Z={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},_=({options:t,value:a,onChange:p,label:b,helperText:o,errorMessage:i,maxHeight:u,disabled:n=!1,variant:v,size:c="md",columns:j,colorScheme:k,className:N,optionsClassName:q,panelClassName:w,"aria-describedby":G,"aria-invalid":C,...E})=>{const l=!!i,d=u!==void 0,m=A.useId(),L=[G,o||i?m:void 0].filter(Boolean).join(" ")||void 0,I=(s,x)=>{p(x?[...a,s]:a.filter(S=>S!==s))},O=s=>r.jsxs(D.Field,{disabled:n||s.disabled,className:"rst:flex rst:items-start rst:gap-2",children:[r.jsx(P.Checkbox,{size:c??"md",colorScheme:k,checked:a.includes(s.value),onChange:x=>I(s.value,x),className:"rst:mt-0.5 rst:shrink-0"}),r.jsxs("div",{className:"rst:flex rst:min-w-0 rst:flex-col",children:[r.jsx(F.Label,{className:e.cn("rst:cursor-pointer rst:select-none rst:px-1 rst:py-0.5","rst:text-[var(--roster-control-text)]","rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",Z[c??"md"]),children:s.label}),s.description&&r.jsx(B.Description,{className:"rst:px-1 rst:text-xs rst:text-gray-500 rst:dark:text-gray-400 rst:data-disabled:opacity-50",children:s.description})]})]},s.value),f=s=>r.jsx("div",{className:e.cn(h.checkboxGroupOptionsVariants({columns:j,size:c})),children:s.map(O)});return r.jsxs(y.Fieldset,{disabled:n,className:e.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",N),...E,"aria-invalid":l||C||void 0,"aria-describedby":L,children:[b&&r.jsx(g.Legend,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50",children:b}),r.jsx("div",{className:e.cn(h.checkboxGroupPanelVariants({variant:v,size:c,error:l}),d&&"rst:overflow-y-auto rst:custom-scrollbar rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",w,q),style:d?{maxHeight:u}:void 0,tabIndex:d?0:void 0,children:V(t)?t.map(s=>r.jsxs(y.Fieldset,{className:"rst:flex rst:flex-col rst:gap-2",children:[r.jsx(g.Legend,{as:R.Eyebrow,weight:"semibold",tone:"default",className:"rst:border-b rst:border-gray-200 rst:pb-1 rst:dark:border-gray-800",children:s.category}),f(s.options)]},s.category)):f(t)}),(o||i)&&r.jsx("p",{id:m,className:e.cn("rst:text-xs rst:text-left",l?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400",n&&"rst:opacity-50"),children:i||o})]})};exports.CheckboxGroup=_;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),D=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),R=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.cjs"),V=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),h=require("../../../node_modules/@headlessui/react/dist/components/legend/legend.cjs"),e=require("../../../lib/utils.cjs"),p=require("../../../internal/field-invalid.cjs"),Z=require("../../atoms/Checkbox/Checkbox.cjs"),_=require("../../atoms/Eyebrow/Eyebrow.cjs"),j=require("./checkbox-group-variants.cjs"),J=t=>t.length>0&&Array.isArray(t[0].options),K={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},Q=({options:t,value:o,onChange:k,label:u,helperText:n,errorMessage:i,maxHeight:m,disabled:d=!1,variant:q,size:a="md",columns:N,colorScheme:w,className:I,optionsClassName:G,panelClassName:C,"aria-describedby":E,"aria-invalid":L,...f})=>{const c=!!i,v=p.isFieldInvalid(c,{...f,"aria-invalid":L}),F=p.withoutInvalidProps(f),l=m!==void 0,x=B.useId(),O=[E,n||i?x:void 0].filter(Boolean).join(" ")||void 0,P=(r,b)=>{k(b?[...o,r]:o.filter(A=>A!==r))},S=r=>s.jsxs(R.Field,{disabled:d||r.disabled,className:"rst:flex rst:items-start rst:gap-2",children:[s.jsx(Z.Checkbox,{size:a??"md",colorScheme:w,checked:o.includes(r.value),onChange:b=>P(r.value,b),"aria-invalid":v||void 0,"aria-describedby":c?x:void 0,className:"rst:mt-0.5 rst:shrink-0"}),s.jsxs("div",{className:"rst:flex rst:min-w-0 rst:flex-col",children:[s.jsx(V.Label,{className:e.cn("rst:cursor-pointer rst:select-none rst:px-1 rst:py-0.5","rst:text-[var(--roster-control-text)]","rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",K[a??"md"]),children:r.label}),r.description&&s.jsx(D.Description,{className:"rst:px-1 rst:text-xs rst:text-gray-500 rst:dark:text-gray-400 rst:data-disabled:opacity-50",children:r.description})]})]},r.value),y=r=>s.jsx("div",{className:e.cn(j.checkboxGroupOptionsVariants({columns:N,size:a})),children:r.map(S)});return s.jsxs(g.Fieldset,{disabled:d,className:e.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",I),...F,"aria-invalid":v||void 0,"aria-describedby":O,children:[u&&s.jsx(h.Legend,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50",children:u}),s.jsx("div",{className:e.cn(j.checkboxGroupPanelVariants({variant:q,size:a,error:c}),l&&"rst:overflow-y-auto rst:custom-scrollbar rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",C,G),style:l?{maxHeight:m}:void 0,tabIndex:l?0:void 0,children:J(t)?t.map(r=>s.jsxs(g.Fieldset,{className:"rst:flex rst:flex-col rst:gap-2",children:[s.jsx(h.Legend,{as:_.Eyebrow,weight:"semibold",tone:"default",className:"rst:border-b rst:border-gray-200 rst:pb-1 rst:dark:border-gray-800",children:r.category}),y(r.options)]},r.category)):y(t)}),(n||i)&&s.jsx("p",{id:x,className:e.cn("rst:text-xs rst:text-left",c?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400",d&&"rst:opacity-50"),children:i||n})]})};exports.CheckboxGroup=Q;
@@ -30,13 +30,15 @@ export interface CheckboxGroupProps extends Omit<React.HTMLAttributes<HTMLFieldS
30
30
  helperText?: string;
31
31
  /**
32
32
  * The message for an invalid selection. Implies the error state, so a caller
33
- * cannot color the text red and forget to say why.
33
+ * can not color the text red and forget to say why.
34
34
  *
35
35
  * What it repaints depends on `variant`, and the difference is worth
36
36
  * knowing: `panel` gets an error border, `plain` has no boundary to repaint
37
37
  * and so the message *is* the whole error state. Narrower than `Input`'s or
38
- * `Select`'s, which both ring the control itself — a checkbox is not the
39
- * thing that is invalid here, the selection is.
38
+ * `Select`'s, which both ring the control itself: what is invalid here is
39
+ * the selection. Each checkbox is still announced as invalid, though, since
40
+ * a checkbox is what a screen reader focuses
41
+ * (`src/internal/field-invalid.ts`).
40
42
  */
41
43
  errorMessage?: string;
42
44
  /**
@@ -1,68 +1,71 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
3
- import O from "react";
2
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
3
+ import P from "react";
4
4
  import { Description as _ } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Field as F } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
- import { Fieldset as y } from "../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.js";
7
- import { Label as S } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
8
- import { Legend as h } from "../../../node_modules/@headlessui/react/dist/components/legend/legend.js";
5
+ import { Field as S } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
+ import { Fieldset as h } from "../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.js";
7
+ import { Label as Z } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
8
+ import { Legend as g } from "../../../node_modules/@headlessui/react/dist/components/legend/legend.js";
9
9
  import { cn as e } from "../../../lib/utils.js";
10
- import { Checkbox as Z } from "../../atoms/Checkbox/Checkbox.js";
11
- import { Eyebrow as P } from "../../atoms/Eyebrow/Eyebrow.js";
12
- import { checkboxGroupPanelVariants as R, checkboxGroupOptionsVariants as V } from "./checkbox-group-variants.js";
13
- const W = (s) => s.length > 0 && Array.isArray(s[0].options), q = {
10
+ import { isFieldInvalid as R, withoutInvalidProps as V } from "../../../internal/field-invalid.js";
11
+ import { Checkbox as W } from "../../atoms/Checkbox/Checkbox.js";
12
+ import { Eyebrow as q } from "../../atoms/Eyebrow/Eyebrow.js";
13
+ import { checkboxGroupPanelVariants as J, checkboxGroupOptionsVariants as K } from "./checkbox-group-variants.js";
14
+ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
14
15
  sm: "rst:text-xs",
15
16
  md: "rst:text-sm",
16
17
  lg: "rst:text-base"
17
- }, tr = ({
18
+ }, or = ({
18
19
  options: s,
19
20
  value: c,
20
- onChange: v,
21
- label: x,
22
- helperText: d,
23
- errorMessage: a,
24
- maxHeight: b,
25
- disabled: l = !1,
26
- variant: g,
27
- size: o = "md",
28
- columns: k,
29
- colorScheme: N,
30
- className: w,
31
- optionsClassName: I,
32
- panelClassName: E,
33
- "aria-describedby": G,
34
- "aria-invalid": L,
35
- ...j
21
+ onChange: k,
22
+ label: b,
23
+ helperText: l,
24
+ errorMessage: i,
25
+ maxHeight: p,
26
+ disabled: n = !1,
27
+ variant: N,
28
+ size: a = "md",
29
+ columns: w,
30
+ colorScheme: I,
31
+ className: E,
32
+ optionsClassName: G,
33
+ panelClassName: L,
34
+ "aria-describedby": j,
35
+ "aria-invalid": A,
36
+ ...v
36
37
  }) => {
37
- const n = !!a, m = b !== void 0, p = O.useId(), A = [G, d || a ? p : void 0].filter(Boolean).join(" ") || void 0, B = (r, f) => {
38
- v(
39
- f ? [...c, r] : c.filter((D) => D !== r)
38
+ const o = !!i, u = R(o, { ...v, "aria-invalid": A }), B = V(v), m = p !== void 0, f = P.useId(), C = [j, l || i ? f : void 0].filter(Boolean).join(" ") || void 0, D = (r, x) => {
39
+ k(
40
+ x ? [...c, r] : c.filter((O) => O !== r)
40
41
  );
41
- }, C = (r) => /* @__PURE__ */ i(
42
- F,
42
+ }, F = (r) => /* @__PURE__ */ d(
43
+ S,
43
44
  {
44
- disabled: l || r.disabled,
45
+ disabled: n || r.disabled,
45
46
  className: "rst:flex rst:items-start rst:gap-2",
46
47
  children: [
47
48
  /* @__PURE__ */ t(
48
- Z,
49
+ W,
49
50
  {
50
- size: o ?? "md",
51
- colorScheme: N,
51
+ size: a ?? "md",
52
+ colorScheme: I,
52
53
  checked: c.includes(r.value),
53
- onChange: (f) => B(r.value, f),
54
+ onChange: (x) => D(r.value, x),
55
+ "aria-invalid": u || void 0,
56
+ "aria-describedby": o ? f : void 0,
54
57
  className: "rst:mt-0.5 rst:shrink-0"
55
58
  }
56
59
  ),
57
- /* @__PURE__ */ i("div", { className: "rst:flex rst:min-w-0 rst:flex-col", children: [
60
+ /* @__PURE__ */ d("div", { className: "rst:flex rst:min-w-0 rst:flex-col", children: [
58
61
  /* @__PURE__ */ t(
59
- S,
62
+ Z,
60
63
  {
61
64
  className: e(
62
65
  "rst:cursor-pointer rst:select-none rst:px-1 rst:py-0.5",
63
66
  "rst:text-[var(--roster-control-text)]",
64
67
  "rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",
65
- q[o ?? "md"]
68
+ U[a ?? "md"]
66
69
  ),
67
70
  children: r.label
68
71
  }
@@ -72,33 +75,33 @@ const W = (s) => s.length > 0 && Array.isArray(s[0].options), q = {
72
75
  ]
73
76
  },
74
77
  r.value
75
- ), u = (r) => /* @__PURE__ */ t("div", { className: e(V({ columns: k, size: o })), children: r.map(C) });
76
- return /* @__PURE__ */ i(
77
- y,
78
+ ), y = (r) => /* @__PURE__ */ t("div", { className: e(K({ columns: w, size: a })), children: r.map(F) });
79
+ return /* @__PURE__ */ d(
80
+ h,
78
81
  {
79
- disabled: l,
82
+ disabled: n,
80
83
  className: e(
81
84
  "rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",
82
- w
85
+ E
83
86
  ),
84
- ...j,
85
- "aria-invalid": n || L || void 0,
86
- "aria-describedby": A,
87
+ ...B,
88
+ "aria-invalid": u || void 0,
89
+ "aria-describedby": C,
87
90
  children: [
88
- x && /* @__PURE__ */ t(h, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50", children: x }),
91
+ b && /* @__PURE__ */ t(g, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50", children: b }),
89
92
  /* @__PURE__ */ t(
90
93
  "div",
91
94
  {
92
95
  className: e(
93
- R({ variant: g, size: o, error: n }),
96
+ J({ variant: N, size: a, error: o }),
94
97
  m && "rst:overflow-y-auto rst:custom-scrollbar rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",
95
98
  /* Deprecated name first, so the current one wins when both are set. */
96
- E,
97
- I
99
+ L,
100
+ G
98
101
  ),
99
- style: m ? { maxHeight: b } : void 0,
102
+ style: m ? { maxHeight: p } : void 0,
100
103
  tabIndex: m ? 0 : void 0,
101
- children: W(s) ? s.map((r) => (
104
+ children: Q(s) ? s.map((r) => (
102
105
  /* Nested fieldset per category, so the heading is the group's
103
106
  accessible name rather than decoration a screen reader walks
104
107
  straight past. Nesting is valid HTML, the inner
@@ -109,32 +112,32 @@ const W = (s) => s.length > 0 && Array.isArray(s[0].options), q = {
109
112
  `as={Eyebrow}` overrides Legend's own `as="div"` — it is
110
113
  spread after — so these render as <span>. The registration is
111
114
  what matters and it is unchanged. */
112
- /* @__PURE__ */ i(y, { className: "rst:flex rst:flex-col rst:gap-2", children: [
115
+ /* @__PURE__ */ d(h, { className: "rst:flex rst:flex-col rst:gap-2", children: [
113
116
  /* @__PURE__ */ t(
114
- h,
117
+ g,
115
118
  {
116
- as: P,
119
+ as: q,
117
120
  weight: "semibold",
118
121
  tone: "default",
119
122
  className: "rst:border-b rst:border-gray-200 rst:pb-1 rst:dark:border-gray-800",
120
123
  children: r.category
121
124
  }
122
125
  ),
123
- u(r.options)
126
+ y(r.options)
124
127
  ] }, r.category)
125
- )) : u(s)
128
+ )) : y(s)
126
129
  }
127
130
  ),
128
- (d || a) && /* @__PURE__ */ t(
131
+ (l || i) && /* @__PURE__ */ t(
129
132
  "p",
130
133
  {
131
- id: p,
134
+ id: f,
132
135
  className: e(
133
136
  "rst:text-xs rst:text-left",
134
- n ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400",
135
- l && "rst:opacity-50"
137
+ o ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400",
138
+ n && "rst:opacity-50"
136
139
  ),
137
- children: a || d
140
+ children: i || l
138
141
  }
139
142
  )
140
143
  ]
@@ -142,5 +145,5 @@ const W = (s) => s.length > 0 && Array.isArray(s[0].options), q = {
142
145
  );
143
146
  };
144
147
  export {
145
- tr as CheckboxGroup
148
+ or as CheckboxGroup
146
149
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const u=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),w=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),m=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),p=require("../../../node_modules/@headlessui/react/dist/components/radio-group/radio-group.cjs"),r=require("../../../lib/utils.cjs"),c=require("./radio-group-variants.cjs"),L={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},D=({options:f,value:v,onChange:y,label:n,helperText:d,errorMessage:l,disabled:e=!1,size:j="md",orientation:i="vertical",colorScheme:b,className:N,optionsClassName:h,optionClassName:q,radioClassName:g,labelClassName:G,optionLabelClassName:z,descriptionClassName:R,messageClassName:S,"aria-invalid":V,...k})=>{const x=!!l,a=j??"md";return t.jsxs(p.RadioGroup,{value:v,onChange:y,disabled:e,className:r.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",N),...k,"aria-invalid":x||V||void 0,"aria-orientation":i,children:[n&&t.jsx(m.Label,{className:r.cn("rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",e&&"rst:opacity-50",G),children:n}),t.jsx("div",{className:r.cn(c.radioGroupOptionsVariants({size:a,orientation:i}),h),children:f.map(s=>t.jsxs(w.Field,{disabled:e||s.disabled,className:r.cn(c.radioOptionVariants({orientation:i,size:a}),q),children:[t.jsx(p.Radio,{value:s.value,className:({checked:o})=>r.cn(c.radioVariants({colorScheme:b,size:a,checked:o}),"rst:self-start",e||s.disabled?"rst:opacity-50 rst:cursor-not-allowed":"rst:cursor-pointer",g),children:({checked:o})=>t.jsx("span",{className:r.cn(c.radioDotVariants({size:a}),o?"rst:opacity-100":"rst:opacity-0")})}),t.jsxs("div",{className:r.cn("rst:flex rst:min-w-0 rst:flex-col",i==="vertical"&&"rst:flex-1"),children:[t.jsx(m.Label,{className:r.cn("rst:cursor-pointer rst:select-none","rst:text-[var(--roster-control-text)]","rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",L[a],z),children:s.label}),s.description&&t.jsx(u.Description,{className:r.cn("rst:text-xs rst:text-gray-500 rst:dark:text-gray-400 rst:data-disabled:opacity-50",R),children:s.description})]})]},s.value))}),(d||l)&&t.jsx(u.Description,{as:"p",className:r.cn("rst:text-xs rst:text-left",x?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400",e&&"rst:opacity-50",S),children:l||d})]})};exports.RadioGroup=D;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const m=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),D=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),p=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),v=require("../../../node_modules/@headlessui/react/dist/components/radio-group/radio-group.cjs"),r=require("../../../lib/utils.cjs"),f=require("../../../internal/field-invalid.cjs"),c=require("./radio-group-variants.cjs"),E={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},O=({options:y,value:j,onChange:b,label:n,helperText:d,errorMessage:l,disabled:e=!1,size:h="md",orientation:i="vertical",colorScheme:N,className:q,optionsClassName:g,optionClassName:G,radioClassName:w,labelClassName:z,optionLabelClassName:R,descriptionClassName:S,messageClassName:V,"aria-invalid":k,...x})=>{const u=!!l,I=f.isFieldInvalid(u,{...x,"aria-invalid":k}),L=f.withoutInvalidProps(x),a=h??"md";return t.jsxs(v.RadioGroup,{value:j,onChange:b,disabled:e,className:r.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",q),...L,"aria-invalid":I||void 0,"aria-orientation":i,children:[n&&t.jsx(p.Label,{className:r.cn("rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",e&&"rst:opacity-50",z),children:n}),t.jsx("div",{className:r.cn(c.radioGroupOptionsVariants({size:a,orientation:i}),g),children:y.map(s=>t.jsxs(D.Field,{disabled:e||s.disabled,className:r.cn(c.radioOptionVariants({orientation:i,size:a}),G),children:[t.jsx(v.Radio,{value:s.value,className:({checked:o})=>r.cn(c.radioVariants({colorScheme:N,size:a,checked:o}),"rst:self-start",e||s.disabled?"rst:opacity-50 rst:cursor-not-allowed":"rst:cursor-pointer",w),children:({checked:o})=>t.jsx("span",{className:r.cn(c.radioDotVariants({size:a}),o?"rst:opacity-100":"rst:opacity-0")})}),t.jsxs("div",{className:r.cn("rst:flex rst:min-w-0 rst:flex-col",i==="vertical"&&"rst:flex-1"),children:[t.jsx(p.Label,{className:r.cn("rst:cursor-pointer rst:select-none","rst:text-[var(--roster-control-text)]","rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",E[a],R),children:s.label}),s.description&&t.jsx(m.Description,{className:r.cn("rst:text-xs rst:text-gray-500 rst:dark:text-gray-400 rst:data-disabled:opacity-50",S),children:s.description})]})]},s.value))}),(d||l)&&t.jsx(m.Description,{as:"p",className:r.cn("rst:text-xs rst:text-left",u?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400",e&&"rst:opacity-50",V),children:l||d})]})};exports.RadioGroup=O;
@@ -45,9 +45,10 @@ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElemen
45
45
  * `aria-describedby` is one of the props Headless UI controls on a
46
46
  * `RadioGroup`, and a controlled prop is spread last. Passing one is
47
47
  * therefore a no-op rather than an addition. `aria-invalid` is not one of
48
- * Headless UI's, so a caller's survives its spread — and is then outranked
49
- * by this component's own error state, which is a different thing from the
50
- * token-list merge `CheckboxGroup` does for `aria-describedby`.
48
+ * Headless UI's: a caller's is read by the rule every Roster field follows
49
+ * (`src/internal/field-invalid.ts`), so any value but "false" marks the
50
+ * group invalid, as `"true"`, and an error message marks it invalid whatever
51
+ * the caller passed.
51
52
  */
52
53
  errorMessage?: string;
53
54
  /** Disables every option, and dims the label and helper text with them. */