@blakesteve/roster 5.1.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.
Files changed (47) hide show
  1. package/README.md +57 -3
  2. package/dist/components/atoms/Combobox/Combobox.cjs +1 -1
  3. package/dist/components/atoms/Combobox/Combobox.js +63 -62
  4. package/dist/components/atoms/Input/Input.cjs +1 -1
  5. package/dist/components/atoms/Input/Input.js +41 -39
  6. package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
  7. package/dist/components/atoms/MultiSelect/MultiSelect.js +69 -68
  8. package/dist/components/atoms/Select/Select.cjs +1 -1
  9. package/dist/components/atoms/Select/Select.js +52 -51
  10. package/dist/components/atoms/Spinner/Spinner.cjs +1 -1
  11. package/dist/components/atoms/Spinner/Spinner.d.ts +6 -1
  12. package/dist/components/atoms/Spinner/Spinner.js +9 -8
  13. package/dist/components/atoms/Textarea/Textarea.cjs +1 -1
  14. package/dist/components/atoms/Textarea/Textarea.js +36 -34
  15. package/dist/components/molecules/Carousel/Carousel.cjs +1 -0
  16. package/dist/components/molecules/Carousel/Carousel.d.ts +146 -0
  17. package/dist/components/molecules/Carousel/Carousel.js +363 -0
  18. package/dist/components/molecules/Carousel/carousel-layout.cjs +1 -0
  19. package/dist/components/molecules/Carousel/carousel-layout.d.ts +23 -0
  20. package/dist/components/molecules/Carousel/carousel-layout.js +22 -0
  21. package/dist/components/molecules/Carousel/carousel-math.cjs +1 -0
  22. package/dist/components/molecules/Carousel/carousel-math.d.ts +60 -0
  23. package/dist/components/molecules/Carousel/carousel-math.js +58 -0
  24. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.cjs +1 -1
  25. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts +5 -3
  26. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.js +61 -59
  27. package/dist/components/molecules/EmptyState/EmptyState.cjs +1 -1
  28. package/dist/components/molecules/EmptyState/EmptyState.d.ts +7 -1
  29. package/dist/components/molecules/EmptyState/EmptyState.js +18 -14
  30. package/dist/components/molecules/RadioGroup/RadioGroup.cjs +1 -1
  31. package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +4 -3
  32. package/dist/components/molecules/RadioGroup/RadioGroup.js +48 -47
  33. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  34. package/dist/components/organisms/Sheet/Sheet.d.ts +8 -5
  35. package/dist/components/organisms/Sheet/Sheet.js +122 -121
  36. package/dist/components/organisms/Sheet/sheet-title.cjs +1 -0
  37. package/dist/components/organisms/Sheet/sheet-title.d.ts +10 -0
  38. package/dist/components/organisms/Sheet/sheet-title.js +17 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/internal/field-invalid.cjs +1 -0
  41. package/dist/internal/field-invalid.d.ts +37 -0
  42. package/dist/internal/field-invalid.js +13 -0
  43. package/dist/meta.json +3 -3
  44. package/dist/roster.cjs +1 -1
  45. package/dist/roster.css +1 -1
  46. package/dist/roster.js +55 -53
  47. package/package.json +1 -1
package/README.md CHANGED
@@ -491,6 +491,9 @@ the sweep stops and the highlight parks off-frame. The highlight is deliberately
491
491
  exempt from that bar: it is a specular pass on screen for a fraction of a second
492
492
  per glyph, and holding it to 3:1 would flatten the effect.
493
493
 
494
+ `Spinner` holds still under reduced motion: the arc still reads as loading, and
495
+ its `label` (default "loading") says so.
496
+
494
497
  ### Scrollbars
495
498
 
496
499
  `custom-scrollbar` gives any scrollable surface a slim themed scrollbar.
@@ -1104,6 +1107,47 @@ escape the box. Lay the options out across with `orientation` rather than
1104
1107
  through `optionsClassName`, for the same reason: the horizontal spacing that
1105
1108
  keeps two radios 44px apart rides on that prop.
1106
1109
 
1110
+ ### Carousel
1111
+
1112
+ A sideways row: a row of cards, a selection strip, or a gallery of one per
1113
+ view. It is a real scroll container with CSS scroll snap, so touch, trackpad,
1114
+ Shift with the wheel and keyboard focus all scroll it without script, and every
1115
+ item is in the server render. No clones, no virtualization, no loop, and
1116
+ nothing moves on its own.
1117
+
1118
+ ```tsx
1119
+ <Carousel aria-label="Songs" itemWidth={240} gap={12} gutter={16}>
1120
+ {songs.map((song) => <SongCard key={song.id} song={song} />)}
1121
+ </Carousel>
1122
+ ```
1123
+
1124
+ Each child is one item, wrapped in the `li` the row snaps to. Size the items
1125
+ with `itemWidth` (fixed) or `perView` (fluid: `{ base: 1.3, md: 2.5 }`, where
1126
+ the fraction is the peek of the next item). `gutter` is both the inline padding
1127
+ and the scroll padding, so a snapped item lines up with the text above it, and
1128
+ `bleed` pulls the row out by one gutter to run edge to edge.
1129
+
1130
+ Script adds what a mouse is missing:
1131
+
1132
+ - **Drag.** A mouse drags the row one to one and it settles on the nearest
1133
+ item. A drag past 6px drops the one click that ends it, and nothing else.
1134
+ Touch and pen keep native scrolling.
1135
+ - **Arrows.** Previous and next page by as many items as are wholly in view,
1136
+ measured each time, and land on an item's edge. At an end the arrow is
1137
+ `disabled`, out of the tab order. They show where a pointer can hover, on a
1138
+ line above the row by default (`arrowPlacement="overlay"` floats them over
1139
+ the ends; `renderArrows` puts them anywhere, such as a heading line). They
1140
+ are 44px, drawn with inline SVG, and named "Next" plus the row's label.
1141
+ - **Keyboard focus** snaps its item into place at once. If no item can take
1142
+ focus, the list itself is the tab stop.
1143
+
1144
+ A vertical wheel over the row scrolls the page, and sideways overscroll is
1145
+ contained. Under reduced motion every scroll the component makes is instant.
1146
+ `ref` gives `scrollToIndex(i)`, `scrollPrev()` and `scrollNext()`;
1147
+ `onIndexChange` reports the first item wholly in view. For a gallery,
1148
+ `showPosition` shows "2 of 5", which is also each item's name and is announced
1149
+ politely when it changes.
1150
+
1107
1151
  ### Components that render links
1108
1152
 
1109
1153
  `Breadcrumbs` renders a plain `<a>` by default, which is right for a static
@@ -1171,7 +1215,7 @@ function App() {
1171
1215
  | `Disclosure` | Show/hide toggle using HeadlessUI |
1172
1216
  | `Eyebrow` | Small tracked-out uppercase label above a heading or beside a rule; polymorphic via `as` |
1173
1217
  | `InlineCode` | Inline `<code>` for identifiers in running prose |
1174
- | `Input` | Text input with label, error state, icon slots, and a size scale matching `Button` |
1218
+ | `Input` | Text input with label, error state, icon slots, and a size scale matching `Button`; keeps a passed `aria-invalid` |
1175
1219
  | `LabeledDivider` | Horizontal rule carrying a label, with an optional trailing count |
1176
1220
  | `Link` | Styled anchor with variant support |
1177
1221
  | `MultiSelect` | A `Select` that holds more than one value: dismissible chips, same panel |
@@ -1197,8 +1241,9 @@ function App() {
1197
1241
  | `Breadcrumbs` | Navigation trail; pass `linkComponent` to keep navigation client-side |
1198
1242
  | `CheckboxGroup` | Checkbox set reporting one `string[]`; groups, columns, scroll, error |
1199
1243
  | `CallToAction` | Prominent hero-style CTA block |
1244
+ | `Carousel` | Sideways row of items on native scroll snap; mouse drag, paging arrows, no autoplay |
1200
1245
  | `DescriptionList` | Label and value pairs as a real `<dl>`: inline, stacked, or split |
1201
- | `EmptyState` | Zero-data placeholder with icon and action slot |
1246
+ | `EmptyState` | Zero-data placeholder with icon and action slot; `headingLevel` sets its title's `h1` to `h6` |
1202
1247
  | `ErrorState` | Error display with retry action |
1203
1248
  | `LiquidNav` | `LiquidTabs`' strip as a `nav` of links; takes a router's link component |
1204
1249
  | `LiquidTabs` | Tab strip with a sliding pill; arrow keys, roving focus, 44px `lg` size |
@@ -1217,7 +1262,7 @@ function App() {
1217
1262
  | `Dialog` | Modal dialog |
1218
1263
  | `Footer` | Site footer |
1219
1264
  | `Navbar` | Responsive navigation bar with mobile slide-out |
1220
- | `Sheet` | Bottom sheet: drag, Escape or backdrop to dismiss; only its content scrolls; returns focus, even from a deep link |
1265
+ | `Sheet` | Bottom sheet: drag, Escape or backdrop to dismiss; only its content scrolls; returns focus, even from a deep link; the title may be a node |
1221
1266
  | `Table` | Static data table |
1222
1267
 
1223
1268
  ### DataTable columns
@@ -1370,6 +1415,15 @@ reason and the build goes green on the state it inherited while still failing on
1370
1415
  anything new. It also fails when a listed class starts emitting, so a fix cannot
1371
1416
  leave a stale entry behind. Run it with `--verbose` to print the list.
1372
1417
 
1418
+ Story tests that need the user's own input, a wheel or a mouse drag, get it
1419
+ from `.storybook/real-input.ts`: Vitest browser commands that drive
1420
+ Playwright's mouse, whose events are trusted. A synthetic wheel or pointer
1421
+ event never scrolls anything, so "a vertical wheel scrolls the page, not the
1422
+ row" can't be tested without them. The commands fail loudly when the pointer
1423
+ isn't over their target, rather than letting a wheel land on the page and a
1424
+ test pass for the wrong reason. Storybook's own UI has no such input, so those
1425
+ steps are skipped there.
1426
+
1373
1427
  `src/lib/utils.test.ts` pins `cn`. `tailwind-merge` has to be configured with the
1374
1428
  prefix or it stops recognising Roster's classes as utilities and silently
1375
1429
  degrades to concatenation: conflicting classes both survive and the winner falls
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),a=require("../../../node_modules/@headlessui/react/dist/components/combobox/combobox.cjs"),_=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),w=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),F=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),I=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),L=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"),T=require("../Input/input-variants.cjs"),U=require("../../../internal/PopupOption.cjs"),i=require("../../../internal/popup.cjs");function A(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const V=A(j),E=(t,s)=>{const r=s.trim().toLowerCase();return r?t.filter(n=>n.label.toLowerCase().includes(r)):t},H=({options:t,value:s,onChange:r,placeholder:n="Search...",disabled:x=!1,variant:m,size:l,error:y,label:p,helperText:b,errorMessage:u,className:v,inputClassName:P,optionsClassName:O,emptyMessage:g="No matches",filter:q=E,...N})=>{const[C,f]=V.useState(""),{ref:k,inDarkScope:D}=i.useDarkScope(),d=!!u||y,h=q(t,C),S=t.find(o=>o.value===s)??null;return e.jsxs(w.Field,{disabled:x,className:c.cn("rst:flex rst:flex-col rst:gap-1.5",v),...N,children:[p&&e.jsx(F.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:p}),e.jsx(a.Combobox,{value:s??null,onChange:r,disabled:x,children:e.jsxs("div",{ref:k,className:"rst:relative",children:[e.jsx(a.ComboboxInput,{"aria-invalid":d||void 0,className:c.cn(T.inputVariants({variant:m,size:l,error:d}),P,"rst:pr-9"),placeholder:n,displayValue:()=>S?.label??"",onChange:o=>f(o.target.value)}),e.jsx(a.ComboboxButton,{className:c.cn("rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:w-11 rst:cursor-pointer rst:items-center rst:justify-end",l==="sm"?"rst:pr-2.5":"rst:pr-3"),children:e.jsx(L.FontAwesomeIcon,{icon:R.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500","aria-hidden":"true"})}),e.jsx(I.Transition,{as:j.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",afterLeave:()=>f(""),children:e.jsx(a.ComboboxOptions,{anchor:i.POPUP_ANCHOR,className:c.cn(i.popupInDarkPalette(D,m)&&"dark",i.POPUP_PANEL,i.POPUP_WIDTH_OF_INPUT,O),children:h.length===0?e.jsx(a.ComboboxOption,{value:"",disabled:!0,className:c.cn("rst:px-4 rst:py-2.5 rst:text-sm rst:opacity-70",l==="sm"&&"rst:px-3 rst:py-2"),children:g}):h.map(o=>e.jsx(U.PopupOption,{as:a.ComboboxOption,value:o.value,disabled:o.disabled,size:l,children:o.label},o.value))})})]})}),(b||u)&&e.jsx(_.Description,{className:c.cn("rst:text-xs rst:text-left",d?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:u||b})]})};exports.Combobox=H;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react"),a=require("../../../node_modules/@headlessui/react/dist/components/combobox/combobox.cjs"),F=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),L=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),R=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),T=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),U=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),A=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),i=require("../../../lib/utils.cjs"),j=require("../../../internal/field-invalid.cjs"),V=require("../Input/input-variants.cjs"),E=require("../../../internal/PopupOption.cjs"),l=require("../../../internal/popup.cjs");function H(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const B=H(y),Q=(t,s)=>{const r=s.trim().toLowerCase();return r?t.filter(o=>o.label.toLowerCase().includes(r)):t},W=({options:t,value:s,onChange:r,placeholder:o="Search...",disabled:x=!1,variant:m,size:c,error:P,label:p,helperText:b,errorMessage:u,className:q,inputClassName:O,optionsClassName:g,emptyMessage:N="No matches",filter:C=Q,...f})=>{const[k,v]=B.useState(""),{ref:w,inDarkScope:D}=l.useDarkScope(),d=!!u||P,I=j.isFieldInvalid(d,f),S=j.withoutInvalidProps(f),h=C(t,k),_=t.find(n=>n.value===s)??null;return e.jsxs(L.Field,{disabled:x,className:i.cn("rst:flex rst:flex-col rst:gap-1.5",q),...S,children:[p&&e.jsx(R.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:p}),e.jsx(a.Combobox,{value:s??null,onChange:r,disabled:x,children:e.jsxs("div",{ref:w,className:"rst:relative",children:[e.jsx(a.ComboboxInput,{"aria-invalid":I||void 0,className:i.cn(V.inputVariants({variant:m,size:c,error:d}),O,"rst:pr-9"),placeholder:o,displayValue:()=>_?.label??"",onChange:n=>v(n.target.value)}),e.jsx(a.ComboboxButton,{className:i.cn("rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:w-11 rst:cursor-pointer rst:items-center rst:justify-end",c==="sm"?"rst:pr-2.5":"rst:pr-3"),children:e.jsx(U.FontAwesomeIcon,{icon:A.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500","aria-hidden":"true"})}),e.jsx(T.Transition,{as:y.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",afterLeave:()=>v(""),children:e.jsx(a.ComboboxOptions,{anchor:l.POPUP_ANCHOR,className:i.cn(l.popupInDarkPalette(D,m)&&"dark",l.POPUP_PANEL,l.POPUP_WIDTH_OF_INPUT,g),children:h.length===0?e.jsx(a.ComboboxOption,{value:"",disabled:!0,className:i.cn("rst:px-4 rst:py-2.5 rst:text-sm rst:opacity-70",c==="sm"&&"rst:px-3 rst:py-2"),children:N}):h.map(n=>e.jsx(E.PopupOption,{as:a.ComboboxOption,value:n.value,disabled:n.disabled,size:c,children:n.label},n.value))})})]})}),(b||u)&&e.jsx(F.Description,{className:i.cn("rst:text-xs rst:text-left",d?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:u||b})]})};exports.Combobox=W;
@@ -1,81 +1,82 @@
1
1
  "use client";
2
2
  import { jsxs as b, jsx as t } from "react/jsx-runtime";
3
- import * as I from "react";
4
- import { Fragment as L } from "react";
5
- import { Combobox as U, ComboboxInput as _, ComboboxButton as H, ComboboxOptions as S, ComboboxOption as h } from "../../../node_modules/@headlessui/react/dist/components/combobox/combobox.js";
6
- import { Description as j } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
7
- import { Field as A } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
8
- import { Label as R } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
9
- import { Transition as T } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
10
- import { FontAwesomeIcon as q } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
11
- import { faChevronDown as B } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
+ import * as U from "react";
4
+ import { Fragment as _ } from "react";
5
+ import { Combobox as H, ComboboxInput as S, ComboboxButton as j, ComboboxOptions as A, ComboboxOption as v } from "../../../node_modules/@headlessui/react/dist/components/combobox/combobox.js";
6
+ import { Description as R } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
7
+ import { Field as T } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
8
+ import { Label as q } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
9
+ import { Transition as B } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
10
+ import { FontAwesomeIcon as E } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
11
+ import { faChevronDown as V } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
12
12
  import { cn as e } from "../../../lib/utils.js";
13
- import { inputVariants as E } from "../Input/input-variants.js";
14
- import { PopupOption as V } from "../../../internal/PopupOption.js";
15
- import { useDarkScope as W, POPUP_ANCHOR as K, POPUP_WIDTH_OF_INPUT as Q, POPUP_PANEL as Z, popupInDarkPalette as G } from "../../../internal/popup.js";
16
- const J = (s, o) => {
13
+ import { isFieldInvalid as W, withoutInvalidProps as K } from "../../../internal/field-invalid.js";
14
+ import { inputVariants as Q } from "../Input/input-variants.js";
15
+ import { PopupOption as Z } from "../../../internal/PopupOption.js";
16
+ import { useDarkScope as G, POPUP_ANCHOR as J, POPUP_WIDTH_OF_INPUT as X, POPUP_PANEL as Y, popupInDarkPalette as $ } from "../../../internal/popup.js";
17
+ const M = (s, o) => {
17
18
  const a = o.trim().toLowerCase();
18
- return a ? s.filter((i) => i.label.toLowerCase().includes(a)) : s;
19
- }, mt = ({
19
+ return a ? s.filter((l) => l.label.toLowerCase().includes(a)) : s;
20
+ }, ft = ({
20
21
  options: s,
21
22
  value: o,
22
23
  onChange: a,
23
- placeholder: i = "Search...",
24
+ placeholder: l = "Search...",
24
25
  disabled: c = !1,
25
- variant: p,
26
- size: l,
27
- error: v,
28
- label: d,
26
+ variant: d,
27
+ size: i,
28
+ error: P,
29
+ label: p,
29
30
  helperText: f,
30
- errorMessage: m,
31
+ errorMessage: n,
31
32
  className: y,
32
33
  inputClassName: N,
33
- optionsClassName: P,
34
- emptyMessage: C = "No matches",
35
- filter: k = J,
36
- ...g
34
+ optionsClassName: C,
35
+ emptyMessage: k = "No matches",
36
+ filter: g = M,
37
+ ...u
37
38
  }) => {
38
- const [O, u] = I.useState(""), { ref: w, inDarkScope: D } = W(), n = !!m || v, x = k(s, O), F = s.find((r) => r.value === o) ?? null;
39
+ const [O, x] = U.useState(""), { ref: w, inDarkScope: F } = G(), m = !!n || P, I = W(m, u), D = K(u), h = g(s, O), L = s.find((r) => r.value === o) ?? null;
39
40
  return /* @__PURE__ */ b(
40
- A,
41
+ T,
41
42
  {
42
43
  disabled: c,
43
44
  className: e("rst:flex rst:flex-col rst:gap-1.5", y),
44
- ...g,
45
+ ...D,
45
46
  children: [
46
- d && /* @__PURE__ */ t(R, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: d }),
47
+ p && /* @__PURE__ */ t(q, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: p }),
47
48
  /* @__PURE__ */ t(
48
- U,
49
+ H,
49
50
  {
50
51
  value: o ?? null,
51
52
  onChange: a,
52
53
  disabled: c,
53
54
  children: /* @__PURE__ */ b("div", { ref: w, className: "rst:relative", children: [
54
55
  /* @__PURE__ */ t(
55
- _,
56
+ S,
56
57
  {
57
- "aria-invalid": n || void 0,
58
+ "aria-invalid": I || void 0,
58
59
  className: e(
59
- E({ variant: p, size: l, error: n }),
60
+ Q({ variant: d, size: i, error: m }),
60
61
  N,
61
62
  "rst:pr-9"
62
63
  ),
63
- placeholder: i,
64
- displayValue: () => F?.label ?? "",
65
- onChange: (r) => u(r.target.value)
64
+ placeholder: l,
65
+ displayValue: () => L?.label ?? "",
66
+ onChange: (r) => x(r.target.value)
66
67
  }
67
68
  ),
68
69
  /* @__PURE__ */ t(
69
- H,
70
+ j,
70
71
  {
71
72
  className: e(
72
73
  "rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:w-11 rst:cursor-pointer rst:items-center rst:justify-end",
73
- l === "sm" ? "rst:pr-2.5" : "rst:pr-3"
74
+ i === "sm" ? "rst:pr-2.5" : "rst:pr-3"
74
75
  ),
75
76
  children: /* @__PURE__ */ t(
76
- q,
77
+ E,
77
78
  {
78
- icon: B,
79
+ icon: V,
79
80
  className: "rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500",
80
81
  "aria-hidden": "true"
81
82
  }
@@ -83,43 +84,43 @@ const J = (s, o) => {
83
84
  }
84
85
  ),
85
86
  /* @__PURE__ */ t(
86
- T,
87
+ B,
87
88
  {
88
- as: L,
89
+ as: _,
89
90
  leave: "rst:transition rst:ease-in rst:duration-100",
90
91
  leaveFrom: "rst:opacity-100",
91
92
  leaveTo: "rst:opacity-0",
92
- afterLeave: () => u(""),
93
+ afterLeave: () => x(""),
93
94
  children: /* @__PURE__ */ t(
94
- S,
95
+ A,
95
96
  {
96
- anchor: K,
97
+ anchor: J,
97
98
  className: e(
98
- G(D, p) && "dark",
99
- Z,
99
+ $(F, d) && "dark",
100
+ Y,
100
101
  /* `--input-width`, not `--button-width`: the button here is
101
102
  the chevron, so matching it renders a 20px sliver. */
102
- Q,
103
- P
103
+ X,
104
+ C
104
105
  ),
105
- children: x.length === 0 ? /* @__PURE__ */ t(
106
- h,
106
+ children: h.length === 0 ? /* @__PURE__ */ t(
107
+ v,
107
108
  {
108
109
  value: "",
109
110
  disabled: !0,
110
111
  className: e(
111
112
  "rst:px-4 rst:py-2.5 rst:text-sm rst:opacity-70",
112
- l === "sm" && "rst:px-3 rst:py-2"
113
+ i === "sm" && "rst:px-3 rst:py-2"
113
114
  ),
114
- children: C
115
+ children: k
115
116
  }
116
- ) : x.map((r) => /* @__PURE__ */ t(
117
- V,
117
+ ) : h.map((r) => /* @__PURE__ */ t(
118
+ Z,
118
119
  {
119
- as: h,
120
+ as: v,
120
121
  value: r.value,
121
122
  disabled: r.disabled,
122
- size: l,
123
+ size: i,
123
124
  children: r.label
124
125
  },
125
126
  r.value
@@ -131,14 +132,14 @@ const J = (s, o) => {
131
132
  ] })
132
133
  }
133
134
  ),
134
- (f || m) && /* @__PURE__ */ t(
135
- j,
135
+ (f || n) && /* @__PURE__ */ t(
136
+ R,
136
137
  {
137
138
  className: e(
138
139
  "rst:text-xs rst:text-left",
139
- n ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
140
+ m ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
140
141
  ),
141
- children: m || f
142
+ children: n || f
142
143
  }
143
144
  )
144
145
  ]
@@ -146,5 +147,5 @@ const J = (s, o) => {
146
147
  );
147
148
  };
148
149
  export {
149
- mt as Combobox
150
+ ft as Combobox
150
151
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),h=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/input/input.cjs"),v=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),t=require("../../../lib/utils.cjs"),a=require("./input-variants.cjs"),m=b.forwardRef(({className:x,type:p,label:o,helperText:u,errorMessage:e,variant:i,size:n,error:f,startIcon:c,endIcon:l,disabled:d,inputClassName:j,...q},N)=>{const s=!!e||f;return r.jsxs(y.Field,{disabled:d,className:t.cn("rst:w-full",x),children:[o&&r.jsx(v.Label,{className:t.cn("rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors","rst:text-[var(--roster-control-text)]","rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70"),children:o}),r.jsxs("div",{className:"rst:relative",children:[c&&r.jsx("div",{className:t.cn(a.iconVariants({variant:i,error:s}),"rst:left-3"),children:c}),r.jsx(g.Input,{ref:N,type:p,disabled:d,className:t.cn(a.inputVariants({variant:i,size:n,error:s}),c&&(n==="sm"?"rst:pl-9":"rst:pl-10"),l&&(n==="sm"?"rst:pr-9":"rst:pr-10"),j),...q}),l&&r.jsx("div",{className:t.cn(a.iconVariants({variant:i,error:s}),"rst:right-3"),children:l})]}),(u||e)&&r.jsx(h.Description,{className:t.cn("rst:text-xs rst:text-left rst:mt-1.5",s?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:e||u})]})});m.displayName="Input";exports.Input=m;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),y=require("react"),g=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),w=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),V=require("../../../node_modules/@headlessui/react/dist/components/input/input.cjs"),k=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),r=require("../../../lib/utils.cjs"),a=require("./input-variants.cjs"),p=require("../../../internal/field-invalid.cjs"),x=y.forwardRef(({className:f,type:j,label:o,helperText:u,errorMessage:e,variant:i,size:n,error:q,startIcon:l,endIcon:c,disabled:d,inputClassName:h,...m},v)=>{const s=!!e||q,N=p.isFieldInvalid(s,m),b=p.withoutInvalidProps(m);return t.jsxs(w.Field,{disabled:d,className:r.cn("rst:w-full",f),children:[o&&t.jsx(k.Label,{className:r.cn("rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors","rst:text-[var(--roster-control-text)]","rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70"),children:o}),t.jsxs("div",{className:"rst:relative",children:[l&&t.jsx("div",{className:r.cn(a.iconVariants({variant:i,error:s}),"rst:left-3"),children:l}),t.jsx(V.Input,{ref:v,type:j,disabled:d,className:r.cn(a.inputVariants({variant:i,size:n,error:s}),l&&(n==="sm"?"rst:pl-9":"rst:pl-10"),c&&(n==="sm"?"rst:pr-9":"rst:pr-10"),h),...b,invalid:N}),c&&t.jsx("div",{className:r.cn(a.iconVariants({variant:i,error:s}),"rst:right-3"),children:c})]}),(u||e)&&t.jsx(g.Description,{className:r.cn("rst:text-xs rst:text-left rst:mt-1.5",s?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:e||u})]})});x.displayName="Input";exports.Input=x;
@@ -1,29 +1,30 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { jsxs as p, jsx as s } from "react/jsx-runtime";
3
3
  import b from "react";
4
4
  import { Description as k } 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 { Input as w } from "../../../node_modules/@headlessui/react/dist/components/input/input.js";
7
- import { Label as g } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
5
+ import { Field as g } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
6
+ import { Input as j } from "../../../node_modules/@headlessui/react/dist/components/input/input.js";
7
+ import { Label as F } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
8
8
  import { cn as r } from "../../../lib/utils.js";
9
- import { iconVariants as d, inputVariants as j } from "./input-variants.js";
10
- const R = b.forwardRef(
9
+ import { iconVariants as f, inputVariants as P } from "./input-variants.js";
10
+ import { isFieldInvalid as R, withoutInvalidProps as V } from "../../../internal/field-invalid.js";
11
+ const _ = b.forwardRef(
11
12
  ({
12
- className: f,
13
+ className: u,
13
14
  type: x,
14
15
  label: l,
15
- helperText: c,
16
+ helperText: n,
16
17
  errorMessage: e,
17
18
  variant: o,
18
- size: m,
19
- error: u,
20
- startIcon: a,
21
- endIcon: i,
22
- disabled: p,
19
+ size: i,
20
+ error: h,
21
+ startIcon: m,
22
+ endIcon: a,
23
+ disabled: c,
23
24
  inputClassName: N,
24
- ...h
25
- }, y) => {
26
- const s = !!e || u;
25
+ ...d
26
+ }, v) => {
27
+ const t = !!e || h, w = R(t, d), y = V(d);
27
28
  return (
28
29
  /* No `space-y-*` here, deliberately. Headless UI's Field appends a
29
30
  hidden zero-height <span> after the control, and Tailwind v4 applies
@@ -38,9 +39,9 @@ const R = b.forwardRef(
38
39
  DisabledProvider stays false and the Label and Description never dim.
39
40
  Fixed in both rather than one, because a form with a disabled Input
40
41
  and a disabled Select that grey differently is worse than neither. */
41
- /* @__PURE__ */ n(v, { disabled: p, className: r("rst:w-full", f), children: [
42
- l && /* @__PURE__ */ t(
43
- g,
42
+ /* @__PURE__ */ p(g, { disabled: c, className: r("rst:w-full", u), children: [
43
+ l && /* @__PURE__ */ s(
44
+ F,
44
45
  {
45
46
  className: r(
46
47
  "rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors",
@@ -50,60 +51,61 @@ const R = b.forwardRef(
50
51
  children: l
51
52
  }
52
53
  ),
53
- /* @__PURE__ */ n("div", { className: "rst:relative", children: [
54
- a && /* @__PURE__ */ t(
54
+ /* @__PURE__ */ p("div", { className: "rst:relative", children: [
55
+ m && /* @__PURE__ */ s(
55
56
  "div",
56
57
  {
57
58
  className: r(
58
- d({ variant: o, error: s }),
59
+ f({ variant: o, error: t }),
59
60
  "rst:left-3"
60
61
  ),
61
- children: a
62
+ children: m
62
63
  }
63
64
  ),
64
- /* @__PURE__ */ t(
65
- w,
65
+ /* @__PURE__ */ s(
66
+ j,
66
67
  {
67
- ref: y,
68
+ ref: v,
68
69
  type: x,
69
- disabled: p,
70
+ disabled: c,
70
71
  className: r(
71
- j({ variant: o, size: m, error: s }),
72
+ P({ variant: o, size: i, error: t }),
72
73
  /* Icon inset tracks the size's own padding: sm is px-3, so it
73
74
  needs one step less clearance than the 16px sizes. */
74
- a && (m === "sm" ? "rst:pl-9" : "rst:pl-10"),
75
- i && (m === "sm" ? "rst:pr-9" : "rst:pr-10"),
75
+ m && (i === "sm" ? "rst:pl-9" : "rst:pl-10"),
76
+ a && (i === "sm" ? "rst:pr-9" : "rst:pr-10"),
76
77
  N
77
78
  ),
78
- ...h
79
+ ...y,
80
+ invalid: w
79
81
  }
80
82
  ),
81
- i && /* @__PURE__ */ t(
83
+ a && /* @__PURE__ */ s(
82
84
  "div",
83
85
  {
84
86
  className: r(
85
- d({ variant: o, error: s }),
87
+ f({ variant: o, error: t }),
86
88
  "rst:right-3"
87
89
  ),
88
- children: i
90
+ children: a
89
91
  }
90
92
  )
91
93
  ] }),
92
- (c || e) && /* @__PURE__ */ t(
94
+ (n || e) && /* @__PURE__ */ s(
93
95
  k,
94
96
  {
95
97
  className: r(
96
98
  "rst:text-xs rst:text-left rst:mt-1.5",
97
- s ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
99
+ t ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
98
100
  ),
99
- children: e || c
101
+ children: e || n
100
102
  }
101
103
  )
102
104
  ] })
103
105
  );
104
106
  }
105
107
  );
106
- R.displayName = "Input";
108
+ _.displayName = "Input";
107
109
  export {
108
- R as Input
110
+ _ as Input
109
111
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),O=require("react"),B=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),H=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),M=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),x=require("../../../node_modules/@headlessui/react/dist/components/listbox/listbox.cjs"),Y=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),S=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),T=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),s=require("../../../lib/utils.cjs"),W=require("../Select/select-variants.cjs"),F=require("../Chip/Chip.cjs"),X=require("../../../internal/PopupOption.cjs"),c=require("../../../internal/popup.cjs"),G=({options:h,value:n,onChange:m,placeholder:b="Select options",disabled:o=!1,variant:f,size:i,error:R,className:_,triggerClassName:L,optionsClassName:D,helperText:v,errorMessage:p,label:g,display:u="chips",maxChips:N,clearable:j=!1,chipColorScheme:k="neutral",chipVariant:w="outline",clearLabel:A="Clear selection",removeLabel:E=l=>`Remove ${l}`,...U})=>{const l=!!p||R,a=n.length>0,y=new Map(h.map((r,e)=>[r.value,e])),d=n.map(r=>({value:r,label:h.find(e=>e.value===r)?.label??String(r)})).sort((r,e)=>(y.get(r.value)??Number.POSITIVE_INFINITY)-(y.get(e.value)??Number.POSITIVE_INFINITY)),P=N===void 0?d:d.slice(0,N),I=d.length-P.length,{ref:$,inDarkScope:C}=c.useDarkScope(),q=O.useRef(null);return t.jsxs(H.Field,{disabled:o,className:s.cn("rst:flex rst:flex-col rst:gap-1.5",_),...U,children:[g&&t.jsx(M.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:g}),t.jsx(x.Listbox,{value:n,onChange:m,disabled:o,multiple:!0,children:t.jsxs("div",{ref:$,className:"rst:relative",children:[t.jsxs("div",{className:s.cn(W.selectTriggerVariants({variant:f,size:i,error:l}),"rst:h-auto rst:flex-wrap rst:items-center rst:gap-1.5 rst:py-1.5",i==="sm"?"rst:min-h-9":i==="lg"?"rst:min-h-11":"rst:min-h-10",j&&a&&"rst:pr-16","rst:focus-within:ring-2 rst:focus-within:ring-ring",o&&"rst:opacity-50 rst:cursor-not-allowed",L),children:[t.jsx(x.ListboxButton,{ref:q,"aria-invalid":l||void 0,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",children:t.jsx("span",{className:"rst:sr-only",children:a?u==="count"?`${n.length} selected`:d.map(r=>r.label).join(", "):b})}),!a&&t.jsx("span",{"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:block rst:truncate rst:text-gray-500 rst:dark:text-gray-400",children:b}),a&&u==="count"&&t.jsxs("span",{"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:block rst:truncate",children:[n.length," selected"]}),a&&u==="chips"&&P.map((r,e)=>t.jsx(F.Chip,{size:"sm",variant:w,colorScheme:k,disabled:o,onRemove:()=>m(n.filter(V=>V!==r.value)),removeLabel:E(r.label),className:s.cn("rst:relative rst:max-w-[12rem] rst:pointer-events-none","rst:[&_button]:pointer-events-auto","rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70"),children:t.jsx("span",{className:"rst:block rst:truncate",children:r.label})},`${e}-${String(r.value)}`)),I>0&&u==="chips"&&t.jsxs(F.Chip,{size:"sm",variant:w,colorScheme:k,"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70",children:["+",I]}),t.jsx("span",{className:s.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(S.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"})}),j&&a&&t.jsx("button",{type:"button",disabled:o,onClick:()=>{m([]),q.current?.focus()},"aria-label":A,className:s.cn("rst:absolute rst:inset-y-0 rst:flex rst:w-6 rst:items-center rst:justify-center","rst:cursor-pointer rst:disabled:cursor-not-allowed","rst:text-current rst:opacity-70 rst:hover:opacity-100 rst:disabled:opacity-40","rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:rounded-sm",i==="sm"?"rst:right-7":"rst:right-8"),children:t.jsx(S.FontAwesomeIcon,{icon:T.faXmark,className:"rst:h-3.5 rst:w-3.5","aria-hidden":"true"})})]}),t.jsx(Y.Transition,{as:O.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:t.jsx(x.ListboxOptions,{anchor:c.POPUP_ANCHOR,className:s.cn(c.popupInDarkPalette(C,f)&&"dark",c.POPUP_PANEL,c.POPUP_WIDTH_OF_BUTTON,D),children:h.map(r=>t.jsx(X.PopupOption,{as:x.ListboxOption,value:r.value,disabled:r.disabled,size:i,children:r.label},r.value))})})]})}),(v||p)&&t.jsx(B.Description,{className:s.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:p||v})]})};exports.MultiSelect=G;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("react"),Y=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),W=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),X=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),h=require("../../../node_modules/@headlessui/react/dist/components/listbox/listbox.cjs"),G=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),T=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),F=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),s=require("../../../lib/utils.cjs"),R=require("../../../internal/field-invalid.cjs"),J=require("../Select/select-variants.cjs"),_=require("../Chip/Chip.cjs"),K=require("../../../internal/PopupOption.cjs"),c=require("../../../internal/popup.cjs"),Q=({options:x,value:n,onChange:m,placeholder:f="Select options",disabled:a=!1,variant:v,size:i,error:L,className:D,triggerClassName:A,optionsClassName:E,helperText:b,errorMessage:p,label:g,display:u="chips",maxChips:N,clearable:j=!1,chipColorScheme:k="neutral",chipVariant:w="outline",clearLabel:U="Clear selection",removeLabel:$=l=>`Remove ${l}`,...I})=>{const l=!!p||L,C=R.isFieldInvalid(l,I),V=R.withoutInvalidProps(I),o=n.length>0,P=new Map(x.map((r,e)=>[r.value,e])),d=n.map(r=>({value:r,label:x.find(e=>e.value===r)?.label??String(r)})).sort((r,e)=>(P.get(r.value)??Number.POSITIVE_INFINITY)-(P.get(e.value)??Number.POSITIVE_INFINITY)),y=N===void 0?d:d.slice(0,N),q=d.length-y.length,{ref:B,inDarkScope:H}=c.useDarkScope(),O=S.useRef(null);return t.jsxs(W.Field,{disabled:a,className:s.cn("rst:flex rst:flex-col rst:gap-1.5",D),...V,children:[g&&t.jsx(X.Label,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left",children:g}),t.jsx(h.Listbox,{value:n,onChange:m,disabled:a,multiple:!0,children:t.jsxs("div",{ref:B,className:"rst:relative",children:[t.jsxs("div",{className:s.cn(J.selectTriggerVariants({variant:v,size:i,error:l}),"rst:h-auto rst:flex-wrap rst:items-center rst:gap-1.5 rst:py-1.5",i==="sm"?"rst:min-h-9":i==="lg"?"rst:min-h-11":"rst:min-h-10",j&&o&&"rst:pr-16","rst:focus-within:ring-2 rst:focus-within:ring-ring",a&&"rst:opacity-50 rst:cursor-not-allowed",A),children:[t.jsx(h.ListboxButton,{ref:O,"aria-invalid":C||void 0,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",children:t.jsx("span",{className:"rst:sr-only",children:o?u==="count"?`${n.length} selected`:d.map(r=>r.label).join(", "):f})}),!o&&t.jsx("span",{"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:block rst:truncate rst:text-gray-500 rst:dark:text-gray-400",children:f}),o&&u==="count"&&t.jsxs("span",{"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:block rst:truncate",children:[n.length," selected"]}),o&&u==="chips"&&y.map((r,e)=>t.jsx(_.Chip,{size:"sm",variant:w,colorScheme:k,disabled:a,onRemove:()=>m(n.filter(M=>M!==r.value)),removeLabel:$(r.label),className:s.cn("rst:relative rst:max-w-[12rem] rst:pointer-events-none","rst:[&_button]:pointer-events-auto","rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70"),children:t.jsx("span",{className:"rst:block rst:truncate",children:r.label})},`${e}-${String(r.value)}`)),q>0&&u==="chips"&&t.jsxs(_.Chip,{size:"sm",variant:w,colorScheme:k,"aria-hidden":"true",className:"rst:pointer-events-none rst:relative rst:text-inherit rst:border-current/70 rst:dark:text-inherit rst:dark:border-current/70",children:["+",q]}),t.jsx("span",{className:s.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:F.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500","aria-hidden":"true"})}),j&&o&&t.jsx("button",{type:"button",disabled:a,onClick:()=>{m([]),O.current?.focus()},"aria-label":U,className:s.cn("rst:absolute rst:inset-y-0 rst:flex rst:w-6 rst:items-center rst:justify-center","rst:cursor-pointer rst:disabled:cursor-not-allowed","rst:text-current rst:opacity-70 rst:hover:opacity-100 rst:disabled:opacity-40","rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:rounded-sm",i==="sm"?"rst:right-7":"rst:right-8"),children:t.jsx(T.FontAwesomeIcon,{icon:F.faXmark,className:"rst:h-3.5 rst:w-3.5","aria-hidden":"true"})})]}),t.jsx(G.Transition,{as:S.Fragment,leave:"rst:transition rst:ease-in rst:duration-100",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:t.jsx(h.ListboxOptions,{anchor:c.POPUP_ANCHOR,className:s.cn(c.popupInDarkPalette(H,v)&&"dark",c.POPUP_PANEL,c.POPUP_WIDTH_OF_BUTTON,E),children:x.map(r=>t.jsx(K.PopupOption,{as:h.ListboxOption,value:r.value,disabled:r.disabled,size:i,children:r.label},r.value))})})]})}),(b||p)&&t.jsx(Y.Description,{className:s.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:p||b})]})};exports.MultiSelect=Q;