@blakesteve/roster 5.0.1 → 5.2.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 (73) hide show
  1. package/README.md +110 -9
  2. package/dist/components/atoms/Chip/Chip.cjs +1 -1
  3. package/dist/components/atoms/Chip/Chip.js +27 -27
  4. package/dist/components/atoms/Disclosure/Disclosure.cjs +1 -1
  5. package/dist/components/atoms/Disclosure/Disclosure.js +42 -44
  6. package/dist/components/atoms/Input/Input.cjs +1 -1
  7. package/dist/components/atoms/Input/Input.js +46 -41
  8. package/dist/components/atoms/Spinner/Spinner.cjs +1 -1
  9. package/dist/components/atoms/Spinner/Spinner.d.ts +6 -1
  10. package/dist/components/atoms/Spinner/Spinner.js +9 -8
  11. package/dist/components/atoms/Stat/Stat.cjs +1 -1
  12. package/dist/components/atoms/Stat/Stat.d.ts +27 -2
  13. package/dist/components/atoms/Stat/Stat.js +38 -13
  14. package/dist/components/atoms/Switch/Switch.cjs +1 -1
  15. package/dist/components/atoms/Switch/Switch.d.ts +11 -1
  16. package/dist/components/atoms/Switch/Switch.js +38 -36
  17. package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
  18. package/dist/components/atoms/Switch/switch-variants.js +1 -1
  19. package/dist/components/molecules/Carousel/Carousel.cjs +1 -0
  20. package/dist/components/molecules/Carousel/Carousel.d.ts +146 -0
  21. package/dist/components/molecules/Carousel/Carousel.js +363 -0
  22. package/dist/components/molecules/Carousel/carousel-layout.cjs +1 -0
  23. package/dist/components/molecules/Carousel/carousel-layout.d.ts +23 -0
  24. package/dist/components/molecules/Carousel/carousel-layout.js +22 -0
  25. package/dist/components/molecules/Carousel/carousel-math.cjs +1 -0
  26. package/dist/components/molecules/Carousel/carousel-math.d.ts +60 -0
  27. package/dist/components/molecules/Carousel/carousel-math.js +58 -0
  28. package/dist/components/molecules/EmptyState/EmptyState.cjs +1 -1
  29. package/dist/components/molecules/EmptyState/EmptyState.d.ts +7 -1
  30. package/dist/components/molecules/EmptyState/EmptyState.js +18 -14
  31. package/dist/components/molecules/LiquidTabs/LiquidNav.cjs +1 -0
  32. package/dist/components/molecules/LiquidTabs/LiquidNav.d.ts +62 -0
  33. package/dist/components/molecules/LiquidTabs/LiquidNav.js +78 -0
  34. package/dist/components/molecules/LiquidTabs/LiquidTabs.cjs +1 -0
  35. package/dist/components/molecules/LiquidTabs/LiquidTabs.d.ts +69 -0
  36. package/dist/components/molecules/LiquidTabs/LiquidTabs.js +92 -0
  37. package/dist/components/molecules/LiquidTabs/liquid-pill.cjs +1 -0
  38. package/dist/components/molecules/LiquidTabs/liquid-pill.d.ts +56 -0
  39. package/dist/components/molecules/LiquidTabs/liquid-pill.js +129 -0
  40. package/dist/components/molecules/LiquidTabs/liquid-tab-id.cjs +1 -0
  41. package/dist/components/molecules/LiquidTabs/liquid-tab-id.d.ts +12 -0
  42. package/dist/components/molecules/LiquidTabs/liquid-tab-id.js +6 -0
  43. package/dist/components/molecules/Toast/Toaster.cjs +1 -1
  44. package/dist/components/molecules/Toast/Toaster.d.ts +7 -0
  45. package/dist/components/molecules/Toast/Toaster.js +67 -45
  46. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  47. package/dist/components/organisms/Dialog/Dialog.js +102 -79
  48. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  49. package/dist/components/organisms/Navbar/Navbar.js +157 -157
  50. package/dist/components/organisms/Sheet/Sheet.cjs +1 -0
  51. package/dist/components/organisms/Sheet/Sheet.d.ts +85 -0
  52. package/dist/components/organisms/Sheet/Sheet.js +304 -0
  53. package/dist/components/organisms/Sheet/sheet-drag.cjs +1 -0
  54. package/dist/components/organisms/Sheet/sheet-drag.d.ts +40 -0
  55. package/dist/components/organisms/Sheet/sheet-drag.js +22 -0
  56. package/dist/components/organisms/Sheet/sheet-title.cjs +1 -0
  57. package/dist/components/organisms/Sheet/sheet-title.d.ts +10 -0
  58. package/dist/components/organisms/Sheet/sheet-title.js +17 -0
  59. package/dist/index.d.ts +5 -1
  60. package/dist/internal/motion.cjs +1 -0
  61. package/dist/internal/motion.d.ts +12 -0
  62. package/dist/internal/motion.js +21 -0
  63. package/dist/internal/page-inert.cjs +1 -0
  64. package/dist/internal/page-inert.d.ts +51 -0
  65. package/dist/internal/page-inert.js +36 -0
  66. package/dist/meta.json +3 -3
  67. package/dist/roster.cjs +1 -1
  68. package/dist/roster.css +1 -1
  69. package/dist/roster.js +130 -122
  70. package/package.json +1 -1
  71. package/dist/components/atoms/LiquidTabs/LiquidTabs.cjs +0 -1
  72. package/dist/components/atoms/LiquidTabs/LiquidTabs.d.ts +0 -39
  73. package/dist/components/atoms/LiquidTabs/LiquidTabs.js +0 -120
package/README.md CHANGED
@@ -310,6 +310,7 @@ squeeze its own text until it overflowed. Three things follow:
310
310
  Give any `width: fit-content`, `inline-block` or table-cell ancestor a
311
311
  definite width, or the card measures zero.
312
312
  - **Container queries are required**: Chrome 105+, Safari 16+, Firefox 110+.
313
+ `Stat` lays out with CSS subgrid, which raises its own floor to Chrome 117.
313
314
  Without them a `CallToAction` renders in its narrow form at every width.
314
315
 
315
316
  #### Ink follows the fill
@@ -355,9 +356,9 @@ the supported way now.
355
356
  rule stops matching.** Solid Button, Badge, Pill and Checkbox no longer carry
356
357
  `rst:text-white` or `rst:text-gray-950`, so a selector naming either matches
357
358
  nothing. It fails silently, and it fails *partially*: those classes are still on
358
- `Card`, `Navbar`, `Dialog`, `ActionBar`, `Avatar`, `LiquidTabs` and
359
- `Breadcrumbs`, so a themed foreground keeps working there while reverting on
360
- every solid control. Replace the rule with the token:
359
+ `Card`, `Navbar`, `Dialog`, `ActionBar`, `Avatar` and `Breadcrumbs`, so a
360
+ themed foreground keeps working there while reverting on every solid control.
361
+ Replace the rule with the token:
361
362
 
362
363
  ```css
363
364
  /* before */
@@ -367,6 +368,12 @@ every solid control. Replace the rule with the token:
367
368
  :root { --roster-primary-600-ink: #10142e; }
368
369
  ```
369
370
 
371
+ `LiquidTabs` followed later: its active label reads `--roster-lt-text-active`,
372
+ which defaults to `--roster-primary-500-ink`, the ink of the pill's default
373
+ fill. A rule naming `rst:text-white` on a tab stops matching; a rule on
374
+ `[role="tab"][aria-selected="true"]` still does. If you repaint the pill with
375
+ `--roster-lt-pill`, set `--roster-lt-text-active` to match it.
376
+
370
377
  **If you pass a foreground through `className`, add the hover modifier.** Solid
371
378
  variants now carry `hover:text-*`, and `tailwind-merge` resolves conflicts per
372
379
  modifier, so a bare `rst:text-black` no longer holds through hover. Write
@@ -459,6 +466,12 @@ It is hand-rolled rather than a dependency: seven utilities does not justify a
459
466
  package in a library that ships compiled CSS, and it keeps the stylesheet
460
467
  self-contained — the same reasoning as not bundling a preflight.
461
468
 
469
+ `Sheet` has its own knobs, beside those: `--roster-sheet-enter-duration`
470
+ (280ms), `--roster-sheet-leave-duration` (200ms), the two matching easings, and
471
+ `--roster-sheet-fade-duration` (150ms), which is the whole of its motion under
472
+ reduced motion: a fade, with no slide. Set them at `:root`; they are the same in
473
+ both schemes, so they are not redeclared under `.dark`.
474
+
462
475
  `animate-shimmer` is a highlight travelling across a base, used by `Countdown`'s
463
476
  `gradient` variant. Retint it with two variables:
464
477
 
@@ -478,6 +491,9 @@ the sweep stops and the highlight parks off-frame. The highlight is deliberately
478
491
  exempt from that bar: it is a specular pass on screen for a fraction of a second
479
492
  per glyph, and holding it to 3:1 would flatten the effect.
480
493
 
494
+ `Spinner` holds still under reduced motion: the arc still reads as loading, and
495
+ its `label` (default "loading") says so.
496
+
481
497
  ### Scrollbars
482
498
 
483
499
  `custom-scrollbar` gives any scrollable surface a slim themed scrollbar.
@@ -717,6 +733,32 @@ toast `status` / `polite`, and a polite live region is read when the reader
717
733
  next pauses — which for a message that disappears in four seconds can mean
718
734
  never.
719
735
 
736
+ **The queue renders into `<body>`, not where `Toaster` is placed.** While a
737
+ `Dialog` or `Sheet` is open, every child of `<body>` is `inert` and
738
+ `aria-hidden` except the dialog layer and anything carrying
739
+ `data-roster-toaster`, which `Toaster`'s host does. So a toast fired from an
740
+ open dialog is still announced, wherever in the app `Toaster` is mounted.
741
+
742
+ A toast host Roster does not render, such as `react-hot-toast`'s own
743
+ `Toaster`, goes silent while a dialog is open unless it opts in. Wrap it in an
744
+ element that is a direct child of `<body>` (render it through a portal if it is
745
+ mounted deeper) and carries the attribute:
746
+
747
+ ```tsx
748
+ <div data-roster-toaster="" style={{ display: "contents" }}>
749
+ <Toaster />
750
+ </div>
751
+ ```
752
+
753
+ Two consequences of rendering into `<body>`:
754
+
755
+ - `--roster-*` tokens set on a wrapper inside your app do not reach the toasts.
756
+ Set them on `:root`. A scoped `.dark` is carried across.
757
+ - Anything else another library mounts straight into `<body>` while a dialog
758
+ is open, such as a date picker's or an autocomplete's popup, is inert too,
759
+ so it can't be clicked. Roster's own popups render into Headless UI's portal
760
+ root and are unaffected.
761
+
720
762
  `variant` on `Toaster` sets the fill for the whole queue:
721
763
 
722
764
  - **`soft`** (default) — the tinted fill `Alert` uses. Quiet enough that a stack
@@ -1065,6 +1107,47 @@ escape the box. Lay the options out across with `orientation` rather than
1065
1107
  through `optionsClassName`, for the same reason: the horizontal spacing that
1066
1108
  keeps two radios 44px apart rides on that prop.
1067
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
+
1068
1151
  ### Components that render links
1069
1152
 
1070
1153
  `Breadcrumbs` renders a plain `<a>` by default, which is right for a static
@@ -1083,6 +1166,12 @@ passing it from a server component fails the render with _Functions cannot be
1083
1166
  passed directly to Client Components_. A small `"use client"` wrapper binds it
1084
1167
  once, and the pages that use the wrapper stay server-rendered.
1085
1168
 
1169
+ `LiquidNav` takes a `linkComponent` too, with a wider contract: each link
1170
+ receives `href` and `to` with the same value, so React Router's `Link` works as
1171
+ well as `next/link`, plus `className`, `children`, `aria-current`, `onClick` and
1172
+ `data-tab-id`, which it must forward to the DOM. The props type is exported as
1173
+ `LiquidNavLinkProps`. The same client-component rule applies.
1174
+
1086
1175
  `Eyebrow` takes the other approach: `as` accepts any element and the props
1087
1176
  follow it, so `<Eyebrow as="a" href="/work">` works, as does `as={NextLink}`.
1088
1177
 
@@ -1126,7 +1215,7 @@ function App() {
1126
1215
  | `Disclosure` | Show/hide toggle using HeadlessUI |
1127
1216
  | `Eyebrow` | Small tracked-out uppercase label above a heading or beside a rule; polymorphic via `as` |
1128
1217
  | `InlineCode` | Inline `<code>` for identifiers in running prose |
1129
- | `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` |
1130
1219
  | `LabeledDivider` | Horizontal rule carrying a label, with an optional trailing count |
1131
1220
  | `Link` | Styled anchor with variant support |
1132
1221
  | `MultiSelect` | A `Select` that holds more than one value: dismissible chips, same panel |
@@ -1134,12 +1223,11 @@ function App() {
1134
1223
  | `Pill` | Inline phrase chrome: social proof, live state, applied filters |
1135
1224
  | `AvatarStrip` | Stacked avatar row with overflow chip, dismiss button, trailing slot, and label area |
1136
1225
  | `CollapsibleSection` | Clamps any content (prose, chips, image grids) to a fixed height with a fade and expand/collapse toggle |
1137
- | `LiquidTabs` | Controlled tab strip with a liquid sliding pill indicator: pill and filled variants |
1138
1226
  | `Select` | Dropdown selector, on the same size scale as `Button` and `Input` |
1139
1227
  | `SegmentBar` | Proportional horizontal bar divided into colored segments with optional legend |
1140
- | `Stat` | A single figure with its label and, optionally, where the figure came from |
1228
+ | `Stat` | A figure with its label and, optionally, its source; a valid `<dl>` group, or `semantics="standalone"` |
1141
1229
  | `Spinner` | Loading indicator |
1142
- | `Switch` | Toggle switch |
1230
+ | `Switch` | Toggle switch; its label toggles it, and every size is a 44px target |
1143
1231
  | `Textarea` | Multi-line text input |
1144
1232
  | `ThemeToggle` | Flips class-based dark mode on the document root and remembers the choice; labels and icons are configurable |
1145
1233
  | `Tooltip` | Radix-powered tooltip: hover/focus on desktop, tap-to-toggle on mobile |
@@ -1153,9 +1241,12 @@ function App() {
1153
1241
  | `Breadcrumbs` | Navigation trail; pass `linkComponent` to keep navigation client-side |
1154
1242
  | `CheckboxGroup` | Checkbox set reporting one `string[]`; groups, columns, scroll, error |
1155
1243
  | `CallToAction` | Prominent hero-style CTA block |
1244
+ | `Carousel` | Sideways row of items on native scroll snap; mouse drag, paging arrows, no autoplay |
1156
1245
  | `DescriptionList` | Label and value pairs as a real `<dl>`: inline, stacked, or split |
1157
- | `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` |
1158
1247
  | `ErrorState` | Error display with retry action |
1248
+ | `LiquidNav` | `LiquidTabs`' strip as a `nav` of links; takes a router's link component |
1249
+ | `LiquidTabs` | Tab strip with a sliding pill; arrow keys, roving focus, 44px `lg` size |
1159
1250
  | `MatchupCard` | Head-to-head comparison card |
1160
1251
  | `Pullquote` | A line lifted out of prose, as `<figure>` + `<blockquote>` + `<figcaption>` |
1161
1252
  | `RadioGroup` | Radio set reporting one `string`; descriptions, error, 44px targets |
@@ -1171,6 +1262,7 @@ function App() {
1171
1262
  | `Dialog` | Modal dialog |
1172
1263
  | `Footer` | Site footer |
1173
1264
  | `Navbar` | Responsive navigation bar with mobile slide-out |
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 |
1174
1266
  | `Table` | Static data table |
1175
1267
 
1176
1268
  ### DataTable columns
@@ -1208,7 +1300,7 @@ entry's value as `unknown` and recovers the real type per column through
1208
1300
  The `"use client"` directive sits on each module that needs it, not on the
1209
1301
  package entry. A component carries it; a variant table, a token map and `cn` do
1210
1302
  not. That is what lets a server component import `Button` from the root and get
1211
- a client reference for `Button` alone, rather than for all 102 exports.
1303
+ a client reference for `Button` alone, rather than for all 105 exports.
1212
1304
 
1213
1305
  It changed in 5.0.0, and the difference is worth knowing if you are upgrading.
1214
1306
  Before, the entry itself carried the directive, so importing anything from the
@@ -1323,6 +1415,15 @@ reason and the build goes green on the state it inherited while still failing on
1323
1415
  anything new. It also fails when a listed class starts emitting, so a fix cannot
1324
1416
  leave a stale entry behind. Run it with `--verbose` to print the list.
1325
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
+
1326
1427
  `src/lib/utils.test.ts` pins `cn`. `tailwind-merge` has to be configured with the
1327
1428
  prefix or it stops recognising Roster's classes as utilities and silently
1328
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 t=require("react/jsx-runtime"),k=require("react"),q=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"),w=require("./chip-variants.cjs");function C(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const P=C(k),d="rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:ring-offset-background rst:focus-visible:ring-offset-2",v=P.forwardRef(({className:e,colorScheme:r,variant:s,size:n,leadingIcon:h,onRemove:j,removeLabel:N,onSelectedChange:o,selected:i,disabled:a=!1,children:l,onClick:u,...f},p)=>{const y=!!o,x=!!j,m=c.cn(w.chipVariants({colorScheme:r,variant:s,size:n,disabled:a}),e),b=t.jsxs(t.Fragment,{children:[h&&t.jsx("span",{"aria-hidden":"true",className:"rst:flex rst:shrink-0 rst:items-center rst:justify-center",children:h}),l]}),g=x&&t.jsx("button",{type:"button",disabled:a,onClick:j,"aria-label":N??(typeof l=="string"?`Remove ${l}`:"Remove"),className:c.cn("rst:-mr-1 rst:relative rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70 rst:hover:opacity-100 rst:disabled:hover:opacity-70","rst:after:absolute rst:after:-inset-2 rst:after:content-['']",d),children:t.jsx(q.FontAwesomeIcon,{icon:R.faXmark,className:"rst:h-3 rst:w-3","aria-hidden":"true"})});return y&&x?t.jsxs("span",{...f,onClick:u,ref:p,className:m,children:[t.jsx("button",{type:"button",disabled:a,"aria-pressed":!!i,onClick:()=>o(!i),className:c.cn("rst:inline-flex rst:items-center rst:gap-1.5",d),children:b}),g]}):y?t.jsx("button",{...f,ref:p,type:"button",disabled:a,"aria-pressed":!!i,onClick:O=>{u?.(O),o(!i)},className:c.cn(m,d),children:b}):t.jsxs("span",{...f,onClick:u,ref:p,className:m,children:[b,g]})});v.displayName="Chip";exports.Chip=v;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),R=require("react"),k=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),q=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),a=require("../../../lib/utils.cjs"),T=require("./chip-variants.cjs");function w(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return s.default=e,Object.freeze(s)}const C=w(R),d="rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:ring-offset-background rst:focus-visible:ring-offset-2",E="rst:relative rst:before:absolute rst:before:inset-x-0 rst:before:top-1/2 rst:before:h-11 rst:before:-translate-y-1/2 rst:before:content-['']",v=C.forwardRef(({className:e,colorScheme:s,variant:r,size:n,leadingIcon:h,onRemove:j,removeLabel:N,onSelectedChange:c,selected:i,disabled:o=!1,children:l,onClick:u,...f},b)=>{const y=!!c,x=!!j,p=a.cn(T.chipVariants({colorScheme:s,variant:r,size:n,disabled:o}),e),m=t.jsxs(t.Fragment,{children:[h&&t.jsx("span",{"aria-hidden":"true",className:"rst:flex rst:shrink-0 rst:items-center rst:justify-center",children:h}),l]}),g=x&&t.jsx("button",{type:"button",disabled:o,onClick:j,"aria-label":N??(typeof l=="string"?`Remove ${l}`:"Remove"),className:a.cn("rst:-mr-1 rst:relative rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70 rst:hover:opacity-100 rst:disabled:hover:opacity-70","rst:after:absolute rst:after:-inset-2 rst:after:content-['']",d),children:t.jsx(k.FontAwesomeIcon,{icon:q.faXmark,className:"rst:h-3 rst:w-3","aria-hidden":"true"})});return y&&x?t.jsxs("span",{...f,onClick:u,ref:b,className:p,children:[t.jsx("button",{type:"button",disabled:o,"aria-pressed":!!i,onClick:()=>c(!i),className:a.cn("rst:inline-flex rst:items-center rst:gap-1.5",d),children:m}),g]}):y?t.jsx("button",{...f,ref:b,type:"button",disabled:o,"aria-pressed":!!i,onClick:O=>{u?.(O),c(!i)},className:a.cn(p,d,E),children:m}):t.jsxs("span",{...f,onClick:u,ref:b,className:p,children:[m,g]})});v.displayName="Chip";exports.Chip=v;
@@ -1,30 +1,30 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as f, Fragment as w } from "react/jsx-runtime";
3
- import * as R from "react";
4
- import { FontAwesomeIcon as C } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
5
- import { faXmark as F } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
2
+ import { jsx as r, jsxs as m, Fragment as j } from "react/jsx-runtime";
3
+ import * as w from "react";
4
+ import { FontAwesomeIcon as E } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
5
+ import { faXmark as T } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
6
6
  import { cn as e } from "../../../lib/utils.js";
7
- import { chipVariants as O } from "./chip-variants.js";
8
- const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:ring-offset-background rst:focus-visible:ring-offset-2", A = R.forwardRef(
7
+ import { chipVariants as A } from "./chip-variants.js";
8
+ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:ring-offset-background rst:focus-visible:ring-offset-2", C = "rst:relative rst:before:absolute rst:before:inset-x-0 rst:before:top-1/2 rst:before:h-11 rst:before:-translate-y-1/2 rst:before:content-['']", L = w.forwardRef(
9
9
  ({
10
10
  className: v,
11
11
  colorScheme: N,
12
- variant: g,
13
- size: x,
12
+ variant: x,
13
+ size: g,
14
14
  leadingIcon: u,
15
15
  onRemove: b,
16
16
  removeLabel: k,
17
- onSelectedChange: i,
17
+ onSelectedChange: o,
18
18
  selected: t,
19
19
  disabled: s = !1,
20
- children: o,
20
+ children: i,
21
21
  onClick: n,
22
22
  ...a
23
23
  }, c) => {
24
- const h = !!i, d = !!b, l = e(
25
- O({ colorScheme: N, variant: g, size: x, disabled: s }),
24
+ const h = !!o, d = !!b, l = e(
25
+ A({ colorScheme: N, variant: x, size: g, disabled: s }),
26
26
  v
27
- ), m = /* @__PURE__ */ f(w, { children: [
27
+ ), f = /* @__PURE__ */ m(j, { children: [
28
28
  u && /* `aria-hidden`, like Pill's leading slot. Without it a
29
29
  non-decorative icon — an Avatar, an `<img alt>` — joins the
30
30
  toggle's accessible name and not the dismiss button's, so the two
@@ -38,14 +38,14 @@ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full r
38
38
  children: u
39
39
  }
40
40
  ),
41
- o
41
+ i
42
42
  ] }), y = d && /* @__PURE__ */ r(
43
43
  "button",
44
44
  {
45
45
  type: "button",
46
46
  disabled: s,
47
47
  onClick: b,
48
- "aria-label": k ?? (typeof o == "string" ? `Remove ${o}` : "Remove"),
48
+ "aria-label": k ?? (typeof i == "string" ? `Remove ${i}` : "Remove"),
49
49
  className: e(
50
50
  "rst:-mr-1 rst:relative rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70 rst:hover:opacity-100 rst:disabled:hover:opacity-70",
51
51
  /* WCAG 2.5.8 asks 24x24 CSS px for a pointer target, and the glyph
@@ -59,10 +59,10 @@ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full r
59
59
  "rst:after:absolute rst:after:-inset-2 rst:after:content-['']",
60
60
  p
61
61
  ),
62
- children: /* @__PURE__ */ r(C, { icon: F, className: "rst:h-3 rst:w-3", "aria-hidden": "true" })
62
+ children: /* @__PURE__ */ r(E, { icon: T, className: "rst:h-3 rst:w-3", "aria-hidden": "true" })
63
63
  }
64
64
  );
65
- return h && d ? /* @__PURE__ */ f(
65
+ return h && d ? /* @__PURE__ */ m(
66
66
  "span",
67
67
  {
68
68
  ...a,
@@ -76,9 +76,9 @@ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full r
76
76
  type: "button",
77
77
  disabled: s,
78
78
  "aria-pressed": !!t,
79
- onClick: () => i(!t),
79
+ onClick: () => o(!t),
80
80
  className: e("rst:inline-flex rst:items-center rst:gap-1.5", p),
81
- children: m
81
+ children: f
82
82
  }
83
83
  ),
84
84
  y
@@ -92,13 +92,13 @@ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full r
92
92
  type: "button",
93
93
  disabled: s,
94
94
  "aria-pressed": !!t,
95
- onClick: (j) => {
96
- n?.(j), i(!t);
95
+ onClick: (R) => {
96
+ n?.(R), o(!t);
97
97
  },
98
- className: e(l, p),
99
- children: m
98
+ className: e(l, p, C),
99
+ children: f
100
100
  }
101
- ) : /* @__PURE__ */ f(
101
+ ) : /* @__PURE__ */ m(
102
102
  "span",
103
103
  {
104
104
  ...a,
@@ -106,14 +106,14 @@ const p = "rst:cursor-pointer rst:disabled:cursor-not-allowed rst:rounded-full r
106
106
  ref: c,
107
107
  className: l,
108
108
  children: [
109
- m,
109
+ f,
110
110
  y
111
111
  ]
112
112
  }
113
113
  );
114
114
  }
115
115
  );
116
- A.displayName = "Chip";
116
+ L.displayName = "Chip";
117
117
  export {
118
- A as Chip
118
+ L as Chip
119
119
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),b=require("react"),j=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),y=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),r=require("../../../lib/utils.cjs"),i=require("./disclosure-variants.cjs"),q=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),v=({title:a,children:c,variant:e,className:l,defaultOpen:d=!1,isOpen:n,onToggle:u,icon:m,...x})=>{const[f,p]=b.useState(d),s=n!==void 0?n:f,h=()=>{const o=!s;n===void 0&&p(o),u?.(o)};return t.jsxs("div",{className:r.cn("rst:w-full rst:flex rst:flex-col",l),...x,children:[t.jsxs("button",{type:"button",onClick:h,"aria-expanded":s,className:r.cn(i.disclosureTriggerVariants({variant:e}),s?"rst:rounded-t-md rst:rounded-b-none":"rst:rounded-md",s&&e==="outline"&&"rst:border-b-transparent rst:dark:border-b-transparent"),children:[t.jsx("span",{className:"rst:flex-1 rst:text-left rst:text-inherit",children:a}),t.jsx("span",{className:r.cn("rst:ml-2 rst:flex rst:items-center rst:transition-transform rst:duration-200 rst:text-inherit",s?"rst:rotate-180":""),children:m||t.jsx(j.FontAwesomeIcon,{icon:y.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:opacity-60"})})]}),t.jsx(q.Transition,{show:s,enter:"rst:transition rst:duration-100 rst:ease-out",enterFrom:"rst:transform rst:scale-95 rst:opacity-0",enterTo:"rst:transform rst:scale-100 rst:opacity-100",leave:"rst:transition rst:duration-75 rst:ease-out",leaveFrom:"rst:transform rst:scale-100 rst:opacity-100",leaveTo:"rst:transform rst:scale-95 rst:opacity-0",children:t.jsx("div",{className:r.cn(i.disclosureContentVariants({variant:e}),"rst:rounded-b-md"),children:c})})]})};exports.Disclosure=v;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),N=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),w=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),s=require("../../../lib/utils.cjs"),l=require("./disclosure-variants.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),S=({title:u,children:x,variant:r,className:m,defaultOpen:f=!1,isOpen:n,onToggle:p,icon:h,...b})=>{const[j,q]=a.useState(f),t=n!==void 0?n:j,i=a.useId(),[o,c]=a.useState(t);t&&!o&&c(!0);const v=()=>{const d=!t;n===void 0&&q(d),p?.(d)};return e.jsxs("div",{className:s.cn("rst:w-full rst:flex rst:flex-col",m),...b,children:[e.jsxs("button",{type:"button",onClick:v,"aria-expanded":t,"aria-controls":o?i:void 0,className:s.cn(l.disclosureTriggerVariants({variant:r}),t?"rst:rounded-t-md rst:rounded-b-none":"rst:rounded-md",t&&r==="outline"&&"rst:border-b-transparent rst:dark:border-b-transparent"),children:[e.jsx("span",{className:"rst:flex-1 rst:text-left rst:text-inherit",children:u}),e.jsx("span",{className:s.cn("rst:ml-2 rst:flex rst:items-center rst:transition-transform rst:duration-200 rst:motion-reduce:transition-none rst:text-inherit",t?"rst:rotate-180":""),children:h||e.jsx(N.FontAwesomeIcon,{icon:w.faChevronDown,className:"rst:h-3.5 rst:w-3.5 rst:opacity-60"})})]}),e.jsx(y.Transition,{show:t,afterLeave:()=>c(!1),children:e.jsx("div",{id:i,"data-testid":"disclosure-panel",className:s.cn(l.disclosureContentVariants({variant:r}),"rst:rounded-b-md","rst:transition rst:duration-100 rst:ease-out rst:data-leave:duration-75","rst:data-closed:opacity-0 rst:motion-safe:data-closed:scale-95"),children:x})})]})};exports.Disclosure=S;
@@ -1,53 +1,56 @@
1
1
  "use client";
2
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
3
- import { useState as b } from "react";
4
- import { FontAwesomeIcon as v } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
5
- import { faChevronDown as y } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
2
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
3
+ import { useState as c, useId as C } from "react";
4
+ import { FontAwesomeIcon as I } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
5
+ import { faChevronDown as k } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
6
6
  import { cn as s } from "../../../lib/utils.js";
7
- import { disclosureTriggerVariants as N, disclosureContentVariants as w } from "./disclosure-variants.js";
8
- import { Transition as C } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
- const O = ({
10
- title: i,
11
- children: c,
7
+ import { disclosureTriggerVariants as y, disclosureContentVariants as g } from "./disclosure-variants.js";
8
+ import { Transition as j } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
9
+ const F = ({
10
+ title: m,
11
+ children: u,
12
12
  variant: e,
13
- className: l,
14
- defaultOpen: m = !1,
13
+ className: f,
14
+ defaultOpen: p = !1,
15
15
  isOpen: n,
16
- onToggle: d,
17
- icon: f,
18
- ...p
16
+ onToggle: x,
17
+ icon: h,
18
+ ...b
19
19
  }) => {
20
- const [u, x] = b(m), t = n !== void 0 ? n : u, h = () => {
21
- const o = !t;
22
- n === void 0 && x(o), d?.(o);
20
+ const [v, N] = c(p), t = n !== void 0 ? n : v, o = C(), [a, i] = c(t);
21
+ t && !a && i(!0);
22
+ const w = () => {
23
+ const d = !t;
24
+ n === void 0 && N(d), x?.(d);
23
25
  };
24
- return /* @__PURE__ */ a("div", { className: s("rst:w-full rst:flex rst:flex-col", l), ...p, children: [
25
- /* @__PURE__ */ a(
26
+ return /* @__PURE__ */ l("div", { className: s("rst:w-full rst:flex rst:flex-col", f), ...b, children: [
27
+ /* @__PURE__ */ l(
26
28
  "button",
27
29
  {
28
30
  type: "button",
29
- onClick: h,
31
+ onClick: w,
30
32
  "aria-expanded": t,
33
+ "aria-controls": a ? o : void 0,
31
34
  className: s(
32
- N({ variant: e }),
35
+ y({ variant: e }),
33
36
  // Dynamic rounding and border fix
34
37
  t ? "rst:rounded-t-md rst:rounded-b-none" : "rst:rounded-md",
35
38
  // If it's the outline variant and it's open, remove the bottom border so it merges seamlessly with the content box
36
39
  t && e === "outline" && "rst:border-b-transparent rst:dark:border-b-transparent"
37
40
  ),
38
41
  children: [
39
- /* @__PURE__ */ r("span", { className: "rst:flex-1 rst:text-left rst:text-inherit", children: i }),
42
+ /* @__PURE__ */ r("span", { className: "rst:flex-1 rst:text-left rst:text-inherit", children: m }),
40
43
  /* @__PURE__ */ r(
41
44
  "span",
42
45
  {
43
46
  className: s(
44
- "rst:ml-2 rst:flex rst:items-center rst:transition-transform rst:duration-200 rst:text-inherit",
47
+ "rst:ml-2 rst:flex rst:items-center rst:transition-transform rst:duration-200 rst:motion-reduce:transition-none rst:text-inherit",
45
48
  t ? "rst:rotate-180" : ""
46
49
  ),
47
- children: f || /* @__PURE__ */ r(
48
- v,
50
+ children: h || /* @__PURE__ */ r(
51
+ I,
49
52
  {
50
- icon: y,
53
+ icon: k,
51
54
  className: "rst:h-3.5 rst:w-3.5 rst:opacity-60"
52
55
  }
53
56
  )
@@ -56,27 +59,22 @@ const O = ({
56
59
  ]
57
60
  }
58
61
  ),
59
- /* @__PURE__ */ r(
60
- C,
62
+ /* @__PURE__ */ r(j, { show: t, afterLeave: () => i(!1), children: /* @__PURE__ */ r(
63
+ "div",
61
64
  {
62
- show: t,
63
- enter: "rst:transition rst:duration-100 rst:ease-out",
64
- enterFrom: "rst:transform rst:scale-95 rst:opacity-0",
65
- enterTo: "rst:transform rst:scale-100 rst:opacity-100",
66
- leave: "rst:transition rst:duration-75 rst:ease-out",
67
- leaveFrom: "rst:transform rst:scale-100 rst:opacity-100",
68
- leaveTo: "rst:transform rst:scale-95 rst:opacity-0",
69
- children: /* @__PURE__ */ r(
70
- "div",
71
- {
72
- className: s(w({ variant: e }), "rst:rounded-b-md"),
73
- children: c
74
- }
75
- )
65
+ id: o,
66
+ "data-testid": "disclosure-panel",
67
+ className: s(
68
+ g({ variant: e }),
69
+ "rst:rounded-b-md",
70
+ "rst:transition rst:duration-100 rst:ease-out rst:data-leave:duration-75",
71
+ "rst:data-closed:opacity-0 rst:motion-safe:data-closed:scale-95"
72
+ ),
73
+ children: u
76
74
  }
77
- )
75
+ ) })
78
76
  ] });
79
77
  };
80
78
  export {
81
- O as Disclosure
79
+ F as Disclosure
82
80
  };
@@ -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 r=require("react/jsx-runtime"),g=require("react"),V=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),k=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),w=require("../../../node_modules/@headlessui/react/dist/components/input/input.cjs"),P=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),t=require("../../../lib/utils.cjs"),o=require("./input-variants.cjs"),m=g.forwardRef(({className:x,type:f,label:d,helperText:u,errorMessage:e,variant:i,size:n,error:v,startIcon:a,endIcon:l,disabled:p,inputClassName:j,...q},N)=>{const s=!!e||v,{"aria-invalid":c,invalid:b,...h}=q,y=!!b||c!==void 0&&c!==!1&&c!=="false";return r.jsxs(k.Field,{disabled:p,className:t.cn("rst:w-full",x),children:[d&&r.jsx(P.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:d}),r.jsxs("div",{className:"rst:relative",children:[a&&r.jsx("div",{className:t.cn(o.iconVariants({variant:i,error:s}),"rst:left-3"),children:a}),r.jsx(w.Input,{ref:N,type:f,disabled:p,className:t.cn(o.inputVariants({variant:i,size:n,error:s}),a&&(n==="sm"?"rst:pl-9":"rst:pl-10"),l&&(n==="sm"?"rst:pr-9":"rst:pr-10"),j),...h,invalid:y}),l&&r.jsx("div",{className:t.cn(o.iconVariants({variant:i,error:s}),"rst:right-3"),children:l})]}),(u||e)&&r.jsx(V.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;