@blakesteve/roster 5.2.0 → 5.2.1

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.
@@ -1,30 +1,31 @@
1
1
  "use client";
2
2
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
3
- import B, { Fragment as M } 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 { Listbox as Y, ListboxButton as C, ListboxOptions as K, ListboxOption as X } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
- import { Transition as Z } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
- import { FontAwesomeIcon as S } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
- import { faChevronDown as q, faXmark as G } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
+ import H, { Fragment as V } from "react";
4
+ import { Description as W } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
+ import { Field as Y } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
+ import { Label as C } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
+ import { Listbox as K, ListboxButton as X, ListboxOptions as Z, ListboxOption as q } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
+ import { Transition as G } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
+ import { FontAwesomeIcon as _ } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
+ import { faChevronDown as J, faXmark as Q } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
11
11
  import { cn as s } from "../../../lib/utils.js";
12
- import { selectTriggerVariants as J } from "../Select/select-variants.js";
13
- import { Chip as _ } from "../Chip/Chip.js";
14
- import { PopupOption as Q } from "../../../internal/PopupOption.js";
15
- import { useDarkScope as z, POPUP_ANCHOR as tt, POPUP_WIDTH_OF_BUTTON as rt, POPUP_PANEL as et, popupInDarkPalette as st } from "../../../internal/popup.js";
16
- const bt = ({
12
+ import { isFieldInvalid as z, withoutInvalidProps as tt } from "../../../internal/field-invalid.js";
13
+ import { selectTriggerVariants as rt } from "../Select/select-variants.js";
14
+ import { Chip as T } from "../Chip/Chip.js";
15
+ import { PopupOption as et } from "../../../internal/PopupOption.js";
16
+ import { useDarkScope as st, POPUP_ANCHOR as nt, POPUP_WIDTH_OF_BUTTON as ot, POPUP_PANEL as it, popupInDarkPalette as at } from "../../../internal/popup.js";
17
+ const It = ({
17
18
  options: u,
18
19
  value: n,
19
20
  onChange: p,
20
21
  placeholder: f = "Select options",
21
- disabled: i = !1,
22
+ disabled: a = !1,
22
23
  variant: v,
23
24
  size: o,
24
- error: T,
25
- className: F,
26
- triggerClassName: L,
27
- optionsClassName: R,
25
+ error: F,
26
+ className: L,
27
+ triggerClassName: R,
28
+ optionsClassName: D,
28
29
  helperText: x,
29
30
  errorMessage: h,
30
31
  label: b,
@@ -33,52 +34,52 @@ const bt = ({
33
34
  clearable: N = !1,
34
35
  chipColorScheme: k = "neutral",
35
36
  chipVariant: w = "outline",
36
- clearLabel: D = "Clear selection",
37
- removeLabel: j = (l) => `Remove ${l}`,
38
- ...E
37
+ clearLabel: j = "Clear selection",
38
+ removeLabel: E = (l) => `Remove ${l}`,
39
+ ...I
39
40
  }) => {
40
- const l = !!h || T, a = n.length > 0, y = new Map(u.map((t, e) => [t.value, e])), d = n.map((t) => ({
41
+ const l = !!h || F, U = z(l, I), $ = tt(I), i = n.length > 0, P = new Map(u.map((t, e) => [t.value, e])), d = n.map((t) => ({
41
42
  value: t,
42
43
  label: u.find((e) => e.value === t)?.label ?? String(t)
43
44
  })).sort(
44
- (t, e) => (y.get(t.value) ?? Number.POSITIVE_INFINITY) - (y.get(e.value) ?? Number.POSITIVE_INFINITY)
45
- ), I = g === void 0 ? d : d.slice(0, g), P = d.length - I.length, { ref: U, inDarkScope: $ } = z(), O = B.useRef(null);
45
+ (t, e) => (P.get(t.value) ?? Number.POSITIVE_INFINITY) - (P.get(e.value) ?? Number.POSITIVE_INFINITY)
46
+ ), y = g === void 0 ? d : d.slice(0, g), O = d.length - y.length, { ref: A, inDarkScope: B } = st(), S = H.useRef(null);
46
47
  return /* @__PURE__ */ c(
47
- V,
48
+ Y,
48
49
  {
49
- disabled: i,
50
- className: s("rst:flex rst:flex-col rst:gap-1.5", F),
51
- ...E,
50
+ disabled: a,
51
+ className: s("rst:flex rst:flex-col rst:gap-1.5", L),
52
+ ...$,
52
53
  children: [
53
- b && /* @__PURE__ */ r(W, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: b }),
54
- /* @__PURE__ */ r(Y, { value: n, onChange: p, disabled: i, multiple: !0, children: /* @__PURE__ */ c("div", { ref: U, className: "rst:relative", children: [
54
+ b && /* @__PURE__ */ r(C, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: b }),
55
+ /* @__PURE__ */ r(K, { value: n, onChange: p, disabled: a, multiple: !0, children: /* @__PURE__ */ c("div", { ref: A, className: "rst:relative", children: [
55
56
  /* @__PURE__ */ c(
56
57
  "div",
57
58
  {
58
59
  className: s(
59
- J({ variant: v, size: o, error: l }),
60
+ rt({ variant: v, size: o, error: l }),
60
61
  "rst:h-auto rst:flex-wrap rst:items-center rst:gap-1.5 rst:py-1.5",
61
62
  o === "sm" ? "rst:min-h-9" : o === "lg" ? "rst:min-h-11" : "rst:min-h-10",
62
- N && a && "rst:pr-16",
63
+ N && i && "rst:pr-16",
63
64
  /* The ring is on the shell and fires from `focus-within`, because
64
65
  the element that actually takes focus is the invisible button
65
66
  stretched across it — and, deliberately, from a dismiss
66
67
  control too: those are inside the field and should light it. */
67
68
  "rst:focus-within:ring-2 rst:focus-within:ring-ring",
68
- i && "rst:opacity-50 rst:cursor-not-allowed",
69
- L
69
+ a && "rst:opacity-50 rst:cursor-not-allowed",
70
+ R
70
71
  ),
71
72
  children: [
72
73
  /* @__PURE__ */ r(
73
- C,
74
+ X,
74
75
  {
75
- ref: O,
76
- "aria-invalid": l || void 0,
76
+ ref: S,
77
+ "aria-invalid": U || void 0,
77
78
  className: "rst:absolute rst:inset-0 rst:h-full rst:w-full rst:cursor-pointer rst:rounded-md rst:focus:outline-hidden rst:disabled:cursor-not-allowed",
78
- children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children: a ? m === "count" ? `${n.length} selected` : d.map((t) => t.label).join(", ") : f })
79
+ children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children: i ? m === "count" ? `${n.length} selected` : d.map((t) => t.label).join(", ") : f })
79
80
  }
80
81
  ),
81
- !a && /* @__PURE__ */ r(
82
+ !i && /* @__PURE__ */ r(
82
83
  "span",
83
84
  {
84
85
  "aria-hidden": "true",
@@ -86,7 +87,7 @@ const bt = ({
86
87
  children: f
87
88
  }
88
89
  ),
89
- a && m === "count" && /* @__PURE__ */ c(
90
+ i && m === "count" && /* @__PURE__ */ c(
90
91
  "span",
91
92
  {
92
93
  "aria-hidden": "true",
@@ -97,15 +98,15 @@ const bt = ({
97
98
  ]
98
99
  }
99
100
  ),
100
- a && m === "chips" && I.map((t, e) => /* @__PURE__ */ r(
101
- _,
101
+ i && m === "chips" && y.map((t, e) => /* @__PURE__ */ r(
102
+ T,
102
103
  {
103
104
  size: "sm",
104
105
  variant: w,
105
106
  colorScheme: k,
106
- disabled: i,
107
- onRemove: () => p(n.filter((A) => A !== t.value)),
108
- removeLabel: j(t.label),
107
+ disabled: a,
108
+ onRemove: () => p(n.filter((M) => M !== t.value)),
109
+ removeLabel: E(t.label),
109
110
  className: s(
110
111
  "rst:relative rst:max-w-[12rem] rst:pointer-events-none",
111
112
  "rst:[&_button]:pointer-events-auto",
@@ -115,8 +116,8 @@ const bt = ({
115
116
  },
116
117
  `${e}-${String(t.value)}`
117
118
  )),
118
- P > 0 && m === "chips" && /* @__PURE__ */ c(
119
- _,
119
+ O > 0 && m === "chips" && /* @__PURE__ */ c(
120
+ T,
120
121
  {
121
122
  size: "sm",
122
123
  variant: w,
@@ -125,7 +126,7 @@ const bt = ({
125
126
  className: "rst:pointer-events-none rst:relative rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70",
126
127
  children: [
127
128
  "+",
128
- P
129
+ O
129
130
  ]
130
131
  }
131
132
  ),
@@ -137,24 +138,24 @@ const bt = ({
137
138
  o === "sm" ? "rst:pr-2.5" : "rst:pr-3"
138
139
  ),
139
140
  children: /* @__PURE__ */ r(
140
- S,
141
+ _,
141
142
  {
142
- icon: q,
143
+ icon: J,
143
144
  className: "rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500",
144
145
  "aria-hidden": "true"
145
146
  }
146
147
  )
147
148
  }
148
149
  ),
149
- N && a && /* @__PURE__ */ r(
150
+ N && i && /* @__PURE__ */ r(
150
151
  "button",
151
152
  {
152
153
  type: "button",
153
- disabled: i,
154
+ disabled: a,
154
155
  onClick: () => {
155
- p([]), O.current?.focus();
156
+ p([]), S.current?.focus();
156
157
  },
157
- "aria-label": D,
158
+ "aria-label": j,
158
159
  className: s(
159
160
  /* `w-6` is not decoration: WCAG 2.5.8 asks 24x24 CSS px and
160
161
  a bare 14px icon measured 20px wide. The spacing exception
@@ -167,9 +168,9 @@ const bt = ({
167
168
  o === "sm" ? "rst:right-7" : "rst:right-8"
168
169
  ),
169
170
  children: /* @__PURE__ */ r(
170
- S,
171
+ _,
171
172
  {
172
- icon: G,
173
+ icon: Q,
173
174
  className: "rst:h-3.5 rst:w-3.5",
174
175
  "aria-hidden": "true"
175
176
  }
@@ -180,26 +181,26 @@ const bt = ({
180
181
  }
181
182
  ),
182
183
  /* @__PURE__ */ r(
183
- Z,
184
+ G,
184
185
  {
185
- as: M,
186
+ as: V,
186
187
  leave: "rst:transition rst:ease-in rst:duration-100",
187
188
  leaveFrom: "rst:opacity-100",
188
189
  leaveTo: "rst:opacity-0",
189
190
  children: /* @__PURE__ */ r(
190
- K,
191
+ Z,
191
192
  {
192
- anchor: tt,
193
+ anchor: nt,
193
194
  className: s(
194
- st($, v) && "dark",
195
- et,
196
- rt,
197
- R
195
+ at(B, v) && "dark",
196
+ it,
197
+ ot,
198
+ D
198
199
  ),
199
200
  children: u.map((t) => /* @__PURE__ */ r(
200
- Q,
201
+ et,
201
202
  {
202
- as: X,
203
+ as: q,
203
204
  value: t.value,
204
205
  disabled: t.disabled,
205
206
  size: o,
@@ -213,7 +214,7 @@ const bt = ({
213
214
  )
214
215
  ] }) }),
215
216
  (x || h) && /* @__PURE__ */ r(
216
- H,
217
+ W,
217
218
  {
218
219
  className: s(
219
220
  "rst:text-xs rst:text-left",
@@ -227,5 +228,5 @@ const bt = ({
227
228
  );
228
229
  };
229
230
  export {
230
- bt as MultiSelect
231
+ It as MultiSelect
231
232
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),y=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),k=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),S=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),n=require("../../../node_modules/@headlessui/react/dist/components/listbox/listbox.cjs"),D=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),L=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),T=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),r=require("../../../lib/utils.cjs"),F=require("./select-variants.cjs"),_=require("../../../internal/PopupOption.cjs"),s=require("../../../internal/popup.cjs"),R=({options:l,value:d,onChange:f,placeholder:h="Select an option",disabled:x=!1,variant:u,size:a,error:b,className:v,triggerClassName:j,optionsClassName:P,helperText:p,errorMessage:i,label:m,...q})=>{const c=l.find(e=>e.value===d),o=!!i||b,{ref:N,inDarkScope:O}=s.useDarkScope();return t.jsxs(k.Field,{disabled:x,className:r.cn("rst:flex rst:flex-col rst:gap-1.5",v),...q,children:[m&&t.jsx(S.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:m}),t.jsx(n.Listbox,{value:d??void 0,onChange:f,disabled:x,children:t.jsxs("div",{ref:N,className:"rst:relative",children:[t.jsxs(n.ListboxButton,{"aria-invalid":o||void 0,className:r.cn(F.selectTriggerVariants({variant:u,size:a,error:o}),j),children:[t.jsx("span",{className:r.cn("rst:block rst:truncate",!c&&"rst:text-gray-500 rst:dark:text-gray-400"),children:c?c.label:h}),t.jsx("span",{className:r.cn("rst:pointer-events-none rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:items-center",a==="sm"?"rst:pr-2.5":"rst:pr-3"),children:t.jsx(L.FontAwesomeIcon,{icon:T.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500","aria-hidden":"true"})})]}),t.jsx(D.Transition,{as:g.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:t.jsx(n.ListboxOptions,{anchor:s.POPUP_ANCHOR,className:r.cn(s.popupInDarkPalette(O,u)&&"dark",s.POPUP_PANEL,s.POPUP_WIDTH_OF_BUTTON,P),children:l.map(e=>t.jsx(_.PopupOption,{as:n.ListboxOption,value:e.value,disabled:e.disabled,size:a,children:e.label},e.value))})})]})}),(p||i)&&t.jsx(y.Description,{className:r.cn("rst:text-xs rst:text-left",o?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:i||p})]})};exports.Select=R;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("react"),D=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),F=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),I=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),n=require("../../../node_modules/@headlessui/react/dist/components/listbox/listbox.cjs"),L=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),T=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),_=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),r=require("../../../lib/utils.cjs"),f=require("../../../internal/field-invalid.cjs"),w=require("./select-variants.cjs"),R=require("../../../internal/PopupOption.cjs"),s=require("../../../internal/popup.cjs"),U=({options:o,value:d,onChange:h,placeholder:P="Select an option",disabled:u=!1,variant:x,size:i,error:b,className:j,triggerClassName:q,optionsClassName:N,helperText:p,errorMessage:a,label:m,...v})=>{const c=o.find(e=>e.value===d),l=!!a||b,O=f.isFieldInvalid(l,v),g=f.withoutInvalidProps(v),{ref:y,inDarkScope:k}=s.useDarkScope();return t.jsxs(F.Field,{disabled:u,className:r.cn("rst:flex rst:flex-col rst:gap-1.5",j),...g,children:[m&&t.jsx(I.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:m}),t.jsx(n.Listbox,{value:d??void 0,onChange:h,disabled:u,children:t.jsxs("div",{ref:y,className:"rst:relative",children:[t.jsxs(n.ListboxButton,{"aria-invalid":O||void 0,className:r.cn(w.selectTriggerVariants({variant:x,size:i,error:l}),q),children:[t.jsx("span",{className:r.cn("rst:block rst:truncate",!c&&"rst:text-gray-500 rst:dark:text-gray-400"),children:c?c.label:P}),t.jsx("span",{className:r.cn("rst:pointer-events-none rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:items-center",i==="sm"?"rst:pr-2.5":"rst:pr-3"),children:t.jsx(T.FontAwesomeIcon,{icon:_.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500","aria-hidden":"true"})})]}),t.jsx(L.Transition,{as:S.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:t.jsx(n.ListboxOptions,{anchor:s.POPUP_ANCHOR,className:r.cn(s.popupInDarkPalette(k,x)&&"dark",s.POPUP_PANEL,s.POPUP_WIDTH_OF_BUTTON,N),children:o.map(e=>t.jsx(R.PopupOption,{as:n.ListboxOption,value:e.value,disabled:e.disabled,size:i,children:e.label},e.value))})})]})}),(p||a)&&t.jsx(D.Description,{className:r.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"),children:a||p})]})};exports.Select=U;
@@ -1,35 +1,36 @@
1
1
  "use client";
2
2
  import { jsxs as n, jsx as t } from "react/jsx-runtime";
3
- import { Fragment as g } from "react";
4
- import { Description as y } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Field as D } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
3
+ import { Fragment as D } from "react";
4
+ import { Description as F } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
+ import { Field as I } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
6
  import { Label as L } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
7
- import { Listbox as F, ListboxButton as T, ListboxOptions as _, ListboxOption as I } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
- import { Transition as S } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
- import { FontAwesomeIcon as U } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
- import { faChevronDown as w } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
11
- import { cn as e } from "../../../lib/utils.js";
12
- import { selectTriggerVariants as A } from "./select-variants.js";
13
- import { PopupOption as B } from "../../../internal/PopupOption.js";
14
- import { useDarkScope as j, POPUP_ANCHOR as C, POPUP_WIDTH_OF_BUTTON as E, POPUP_PANEL as H, popupInDarkPalette as R } from "../../../internal/popup.js";
15
- const tt = ({
7
+ import { Listbox as T, ListboxButton as _, ListboxOptions as w, ListboxOption as S } from "../../../node_modules/@headlessui/react/dist/components/listbox/listbox.js";
8
+ import { Transition as U } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
+ import { FontAwesomeIcon as A } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
10
+ import { faChevronDown as B } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
11
+ import { cn as s } from "../../../lib/utils.js";
12
+ import { isFieldInvalid as j, withoutInvalidProps as C } from "../../../internal/field-invalid.js";
13
+ import { selectTriggerVariants as E } from "./select-variants.js";
14
+ import { PopupOption as H } from "../../../internal/PopupOption.js";
15
+ import { useDarkScope as R, POPUP_ANCHOR as W, POPUP_WIDTH_OF_BUTTON as K, POPUP_PANEL as M, popupInDarkPalette as V } from "../../../internal/popup.js";
16
+ const ot = ({
16
17
  options: l,
17
18
  value: m,
18
- onChange: x,
19
- placeholder: h = "Select an option",
19
+ onChange: h,
20
+ placeholder: u = "Select an option",
20
21
  disabled: c = !1,
21
22
  variant: d,
22
- size: s,
23
- error: u,
24
- className: v,
23
+ size: e,
24
+ error: v,
25
+ className: P,
25
26
  triggerClassName: N,
26
- optionsClassName: P,
27
+ optionsClassName: b,
27
28
  helperText: p,
28
29
  errorMessage: a,
29
30
  label: f,
30
- ...b
31
+ ...x
31
32
  }) => {
32
- const o = l.find((r) => r.value === m), i = !!a || u, { ref: k, inDarkScope: O } = j();
33
+ const o = l.find((r) => r.value === m), i = !!a || v, k = j(i, x), O = C(x), { ref: g, inDarkScope: y } = R();
33
34
  return (
34
35
  /* `...props` is spread here, and was not before. The prop type has always
35
36
  extended `HTMLAttributes<HTMLDivElement>`, so `id`, `data-*` and the
@@ -42,52 +43,52 @@ const tt = ({
42
43
  which is the one path assistive tech actually follows. Before those
43
44
  existed there was no way to describe this trigger at all. */
44
45
  /* @__PURE__ */ n(
45
- D,
46
+ I,
46
47
  {
47
48
  disabled: c,
48
- className: e("rst:flex rst:flex-col rst:gap-1.5", v),
49
- ...b,
49
+ className: s("rst:flex rst:flex-col rst:gap-1.5", P),
50
+ ...O,
50
51
  children: [
51
52
  f && /* @__PURE__ */ t(L, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: f }),
52
53
  /* @__PURE__ */ t(
53
- F,
54
+ T,
54
55
  {
55
56
  value: m ?? void 0,
56
- onChange: x,
57
+ onChange: h,
57
58
  disabled: c,
58
- children: /* @__PURE__ */ n("div", { ref: k, className: "rst:relative", children: [
59
+ children: /* @__PURE__ */ n("div", { ref: g, className: "rst:relative", children: [
59
60
  /* @__PURE__ */ n(
60
- T,
61
+ _,
61
62
  {
62
- "aria-invalid": i || void 0,
63
- className: e(
64
- A({ variant: d, size: s, error: i }),
63
+ "aria-invalid": k || void 0,
64
+ className: s(
65
+ E({ variant: d, size: e, error: i }),
65
66
  N
66
67
  ),
67
68
  children: [
68
69
  /* @__PURE__ */ t(
69
70
  "span",
70
71
  {
71
- className: e(
72
+ className: s(
72
73
  "rst:block rst:truncate",
73
74
  !o && "rst:text-gray-500 rst:dark:text-gray-400"
74
75
  ),
75
- children: o ? o.label : h
76
+ children: o ? o.label : u
76
77
  }
77
78
  ),
78
79
  /* @__PURE__ */ t(
79
80
  "span",
80
81
  {
81
- className: e(
82
+ className: s(
82
83
  "rst:pointer-events-none rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:items-center",
83
84
  /* Clearance tracks the size's own right padding, the way
84
85
  Input's icon inset tracks its horizontal padding. */
85
- s === "sm" ? "rst:pr-2.5" : "rst:pr-3"
86
+ e === "sm" ? "rst:pr-2.5" : "rst:pr-3"
86
87
  ),
87
88
  children: /* @__PURE__ */ t(
88
- U,
89
+ A,
89
90
  {
90
- icon: w,
91
+ icon: B,
91
92
  className: "rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500",
92
93
  "aria-hidden": "true"
93
94
  }
@@ -98,29 +99,29 @@ const tt = ({
98
99
  }
99
100
  ),
100
101
  /* @__PURE__ */ t(
101
- S,
102
+ U,
102
103
  {
103
- as: g,
104
+ as: D,
104
105
  leave: "rst:transition rst:ease-in rst:duration-100",
105
106
  leaveFrom: "rst:opacity-100",
106
107
  leaveTo: "rst:opacity-0",
107
108
  children: /* @__PURE__ */ t(
108
- _,
109
+ w,
109
110
  {
110
- anchor: C,
111
- className: e(
112
- R(O, d) && "dark",
113
- H,
114
- E,
115
- P
111
+ anchor: W,
112
+ className: s(
113
+ V(y, d) && "dark",
114
+ M,
115
+ K,
116
+ b
116
117
  ),
117
118
  children: l.map((r) => /* @__PURE__ */ t(
118
- B,
119
+ H,
119
120
  {
120
- as: I,
121
+ as: S,
121
122
  value: r.value,
122
123
  disabled: r.disabled,
123
- size: s,
124
+ size: e,
124
125
  children: r.label
125
126
  },
126
127
  r.value
@@ -133,9 +134,9 @@ const tt = ({
133
134
  }
134
135
  ),
135
136
  (p || a) && /* @__PURE__ */ t(
136
- y,
137
+ F,
137
138
  {
138
- className: e(
139
+ className: s(
139
140
  "rst:text-xs rst:text-left",
140
141
  i ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
141
142
  ),
@@ -148,5 +149,5 @@ const tt = ({
148
149
  );
149
150
  };
150
151
  export {
151
- tt as Select
152
+ ot as Select
152
153
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),b=require("react"),q=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),j=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),p=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/textarea/textarea.cjs"),r=require("../../../lib/utils.cjs"),N=require("./textarea-variants.cjs"),n=b.forwardRef(({className:c,label:s,helperText:a,errorMessage:e,variant:o,error:l,resize:x,disabled:d,textareaClassName:u,...m},f)=>{const i=!!e||l;return t.jsxs(j.Field,{className:r.cn("rst:w-full",c),children:[s&&t.jsx(p.Label,{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}),t.jsx(y.Textarea,{ref:f,disabled:d,className:r.cn(N.textareaVariants({variant:o,resize:x,error:i}),u),...m}),(a||e)&&t.jsx(q.Description,{className:r.cn("rst:text-xs rst:text-left rst:mt-1.5",i?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:e||a})]})});n.displayName="Textarea";exports.Textarea=n;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("react"),v=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),N=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),h=require("../../../node_modules/@headlessui/react/dist/components/textarea/textarea.cjs"),s=require("../../../lib/utils.cjs"),w=require("./textarea-variants.cjs"),o=require("../../../internal/field-invalid.cjs"),l=p.forwardRef(({className:c,label:a,helperText:i,errorMessage:e,variant:d,error:x,resize:u,disabled:m,textareaClassName:f,...n},q)=>{const r=!!e||x,b=o.isFieldInvalid(r,n),j=o.withoutInvalidProps(n);return t.jsxs(y.Field,{className:s.cn("rst:w-full",c),children:[a&&t.jsx(N.Label,{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}),t.jsx(h.Textarea,{ref:q,disabled:m,className:s.cn(w.textareaVariants({variant:d,resize:u,error:r}),f),...j,invalid:b}),(i||e)&&t.jsx(v.Description,{className:s.cn("rst:text-xs rst:text-left rst:mt-1.5",r?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:e||i})]})});l.displayName="Textarea";exports.Textarea=l;
@@ -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 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:c,onChange:k,label:u,helperText:o,errorMessage:i,maxHeight:b,disabled:n=!1,variant:q,size:a="md",columns:N,colorScheme:w,className:I,optionsClassName:G,panelClassName:C,"aria-describedby":E,"aria-invalid":L,...m})=>{const l=!!i,f=p.isFieldInvalid(l,{...m,"aria-invalid":L}),F=p.withoutInvalidProps(m),d=b!==void 0,v=B.useId(),O=[E,o||i?v:void 0].filter(Boolean).join(" ")||void 0,P=(r,x)=>{k(x?[...c,r]:c.filter(A=>A!==r))},S=r=>s.jsxs(R.Field,{disabled:n||r.disabled,className:"rst:flex rst:items-start rst:gap-2",children:[s.jsx(Z.Checkbox,{size:a??"md",colorScheme:w,checked:c.includes(r.value),onChange:x=>P(r.value,x),"aria-invalid":f||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:n,className:e.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",I),...F,"aria-invalid":f||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: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",C,G),style:d?{maxHeight:b}:void 0,tabIndex:d?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)}),(o||i)&&s.jsx("p",{id:v,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=Q;