@blakesteve/roster 4.13.0 → 5.0.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.
- package/README.md +14 -6
- package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
- package/dist/components/atoms/Avatar/Avatar.js +9 -8
- package/dist/components/atoms/AvatarStrip/AvatarStrip.cjs +1 -1
- package/dist/components/atoms/AvatarStrip/AvatarStrip.js +11 -10
- package/dist/components/atoms/Badge/Badge.cjs +1 -1
- package/dist/components/atoms/Badge/Badge.js +12 -11
- package/dist/components/atoms/Button/Button.cjs +1 -1
- package/dist/components/atoms/Button/Button.js +9 -8
- package/dist/components/atoms/Card/Card.cjs +1 -1
- package/dist/components/atoms/Card/Card.js +14 -13
- package/dist/components/atoms/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +10 -9
- package/dist/components/atoms/Chip/Chip.cjs +1 -1
- package/dist/components/atoms/Chip/Chip.js +1 -0
- package/dist/components/atoms/CollapsibleSection/CollapsibleSection.cjs +1 -1
- package/dist/components/atoms/CollapsibleSection/CollapsibleSection.js +1 -0
- package/dist/components/atoms/Combobox/Combobox.cjs +1 -1
- package/dist/components/atoms/Combobox/Combobox.js +20 -19
- package/dist/components/atoms/Disclosure/Disclosure.cjs +1 -1
- package/dist/components/atoms/Disclosure/Disclosure.js +5 -4
- package/dist/components/atoms/Eyebrow/Eyebrow.cjs +1 -1
- package/dist/components/atoms/Eyebrow/Eyebrow.js +9 -8
- package/dist/components/atoms/InlineCode/InlineCode.cjs +1 -1
- package/dist/components/atoms/InlineCode/InlineCode.js +7 -6
- package/dist/components/atoms/Input/Input.cjs +1 -1
- package/dist/components/atoms/Input/Input.js +12 -11
- package/dist/components/atoms/LabeledDivider/LabeledDivider.cjs +1 -1
- package/dist/components/atoms/LabeledDivider/LabeledDivider.js +6 -5
- package/dist/components/atoms/Link/Link.cjs +1 -1
- package/dist/components/atoms/Link/Link.js +10 -9
- package/dist/components/atoms/LiquidTabs/LiquidTabs.cjs +1 -1
- package/dist/components/atoms/LiquidTabs/LiquidTabs.js +1 -0
- package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/atoms/MultiSelect/MultiSelect.js +1 -0
- package/dist/components/atoms/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/atoms/PasswordInput/PasswordInput.js +1 -0
- package/dist/components/atoms/Pill/Pill.cjs +1 -1
- package/dist/components/atoms/Pill/Pill.js +5 -4
- package/dist/components/atoms/SegmentBar/SegmentBar.cjs +1 -1
- package/dist/components/atoms/SegmentBar/SegmentBar.js +1 -0
- package/dist/components/atoms/Select/Select.cjs +1 -1
- package/dist/components/atoms/Select/Select.js +1 -0
- package/dist/components/atoms/Spinner/Spinner.cjs +1 -1
- package/dist/components/atoms/Spinner/Spinner.js +3 -2
- package/dist/components/atoms/Stat/Stat.cjs +1 -1
- package/dist/components/atoms/Stat/Stat.js +7 -6
- package/dist/components/atoms/Switch/Switch.cjs +1 -1
- package/dist/components/atoms/Switch/Switch.js +1 -0
- package/dist/components/atoms/Textarea/Textarea.cjs +1 -1
- package/dist/components/atoms/Textarea/Textarea.js +11 -10
- package/dist/components/atoms/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/atoms/ThemeToggle/ThemeToggle.js +1 -0
- package/dist/components/atoms/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/atoms/Tooltip/Tooltip.js +4 -3
- package/dist/components/molecules/Accordion/Accordion.cjs +1 -1
- package/dist/components/molecules/Accordion/Accordion.js +5 -4
- package/dist/components/molecules/Alert/Alert.cjs +1 -1
- package/dist/components/molecules/Alert/Alert.js +1 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +4 -3
- package/dist/components/molecules/CallToAction/CallToAction.cjs +1 -1
- package/dist/components/molecules/CallToAction/CallToAction.js +1 -0
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.js +7 -6
- package/dist/components/molecules/DescriptionList/DescriptionList.cjs +1 -1
- package/dist/components/molecules/DescriptionList/DescriptionList.js +1 -0
- package/dist/components/molecules/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/molecules/EmptyState/EmptyState.js +1 -0
- package/dist/components/molecules/ErrorState/ErrorState.cjs +1 -1
- package/dist/components/molecules/ErrorState/ErrorState.js +5 -4
- package/dist/components/molecules/MatchupCard/MatchupCard.cjs +1 -1
- package/dist/components/molecules/MatchupCard/MatchupCard.js +1 -0
- package/dist/components/molecules/Pullquote/Pullquote.cjs +1 -1
- package/dist/components/molecules/Pullquote/Pullquote.js +6 -5
- package/dist/components/molecules/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/components/molecules/RadioGroup/RadioGroup.js +1 -0
- package/dist/components/molecules/Toast/Toast.cjs +1 -1
- package/dist/components/molecules/Toast/Toast.js +1 -0
- package/dist/components/molecules/Toast/Toaster.cjs +1 -1
- package/dist/components/molecules/Toast/Toaster.js +1 -0
- package/dist/components/molecules/Toast/toast-api.cjs +1 -1
- package/dist/components/molecules/Toast/toast-api.js +11 -10
- package/dist/components/organisms/ActionBar/ActionBar.cjs +1 -1
- package/dist/components/organisms/ActionBar/ActionBar.js +5 -4
- package/dist/components/organisms/Countdown/Countdown.cjs +1 -1
- package/dist/components/organisms/Countdown/Countdown.js +1 -0
- package/dist/components/organisms/DataTable/DataTable.cjs +1 -1
- package/dist/components/organisms/DataTable/DataTable.js +1 -0
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +5 -4
- package/dist/components/organisms/Footer/Footer.cjs +1 -1
- package/dist/components/organisms/Footer/Footer.js +1 -0
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.js +1 -0
- package/dist/components/organisms/Table/Table.cjs +1 -1
- package/dist/components/organisms/Table/Table.js +20 -19
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.js +2 -3
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.js +1 -0
- package/dist/hooks/useKeySequence.cjs +1 -1
- package/dist/hooks/useKeySequence.js +1 -0
- package/dist/internal/PopupOption.cjs +1 -1
- package/dist/internal/PopupOption.js +1 -0
- package/dist/internal/popup.cjs +1 -1
- package/dist/internal/popup.js +8 -7
- package/dist/meta.json +1 -1
- package/dist/roster.cjs +1 -1
- package/dist/roster.js +7 -8
- package/dist/utils.d.ts +11 -8
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Roster ships a curated set of accessible, theme-aware components organized aroun
|
|
|
9
9
|
- **Atomic Design**: components organized as atoms, molecules, and organisms
|
|
10
10
|
- **TypeScript first**: fully typed props with exported variant types for maximum DX
|
|
11
11
|
- **Adaptive dark mode**: class-based toggling (`.dark`) independent of OS preferences
|
|
12
|
-
- **`"use client"`
|
|
12
|
+
- **`"use client"` per component**: the directive sits on the modules that need it, not on the barrel, so a server component pays only for what it imports
|
|
13
13
|
- **Accessible**: interactive components powered by [`@headlessui/react`](https://headlessui.com) and [`@radix-ui`](https://radix-ui.com)
|
|
14
14
|
- **Tree-shakeable**: import only what you need
|
|
15
15
|
|
|
@@ -1205,16 +1205,24 @@ entry's value as `unknown` and recovers the real type per column through
|
|
|
1205
1205
|
|
|
1206
1206
|
### Server components
|
|
1207
1207
|
|
|
1208
|
-
The
|
|
1209
|
-
|
|
1210
|
-
|
|
1208
|
+
The `"use client"` directive sits on each module that needs it, not on the
|
|
1209
|
+
package entry. A component carries it; a variant table, a token map and `cn` do
|
|
1210
|
+
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.
|
|
1212
|
+
|
|
1213
|
+
It changed in 5.0.0, and the difference is worth knowing if you are upgrading.
|
|
1214
|
+
Before, the entry itself carried the directive, so importing anything from the
|
|
1215
|
+
root pulled the whole namespace across the boundary. Now only the name you
|
|
1216
|
+
import crosses.
|
|
1211
1217
|
|
|
1212
1218
|
```tsx
|
|
1213
1219
|
import { cn } from "@blakesteve/roster/utils";
|
|
1214
1220
|
```
|
|
1215
1221
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1222
|
+
`cn` is still worth importing from `/utils`, but no longer because the root
|
|
1223
|
+
version breaks: the root resolves through a bare barrel to the same unstamped
|
|
1224
|
+
module and works in a server component. The subpath is the narrower import and
|
|
1225
|
+
the one that can not be affected by a future change to the barrel.
|
|
1218
1226
|
|
|
1219
1227
|
### Hooks
|
|
1220
1228
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),o=require("../../../lib/utils.cjs"),h=require("./avatar-variants.cjs"),t=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),i=n.forwardRef(({className:c,size:l,colorScheme:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),o=require("../../../lib/utils.cjs"),h=require("./avatar-variants.cjs"),t=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),i=n.forwardRef(({className:c,size:l,colorScheme:u,shape:d,initials:g,src:s,alt:v,title:e,...m},f)=>{const[p,b]=n.useState(!1),x=s&&!p,a=r.jsx("div",{ref:f,className:o.cn(h.avatarVariants({size:l,colorScheme:u,shape:d}),c),...m,children:x?r.jsx("img",{src:s,alt:v||"Avatar",className:"rst:h-full rst:w-full rst:object-cover",onError:()=>b(!0)}):r.jsx("span",{className:"rst:leading-none rst:uppercase",children:g?.slice(0,2)})});return e?r.jsxs(t.Popover,{className:"rst:relative rst:inline-flex",children:[r.jsx(t.PopoverButton,{as:"div",className:"rst:cursor-pointer 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 rst:rounded-full",children:a}),r.jsx(t.PopoverPanel,{anchor:"bottom",className:o.cn("rst:z-50 rst:mt-2 rst:rounded-md rst:px-3 rst:py-1.5 rst:text-xs rst:font-medium rst:elevation-anchored rst:backdrop-blur-md rst:ring-1","rst:bg-gray-900/95 rst:text-white rst:ring-black/5 rst:dark:bg-gray-100/95 rst:dark:text-gray-900 rst:dark:ring-white/20","rst:transition rst:duration-200 rst:ease-in-out rst:data-closed:opacity-0 rst:data-closed:translate-y-1"),children:e})]}):a});i.displayName="Avatar";exports.Avatar=i;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
2
3
|
import b, { useState as h } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
4
5
|
import { avatarVariants as x } from "./avatar-variants.js";
|
|
5
6
|
import { Popover as y, PopoverButton as N, PopoverPanel as k } from "../../../node_modules/@headlessui/react/dist/components/popover/popover.js";
|
|
6
7
|
const w = b.forwardRef(
|
|
@@ -14,12 +15,12 @@ const w = b.forwardRef(
|
|
|
14
15
|
alt: d,
|
|
15
16
|
title: s,
|
|
16
17
|
...m
|
|
17
|
-
},
|
|
18
|
-
const [
|
|
18
|
+
}, u) => {
|
|
19
|
+
const [f, g] = h(!1), p = t && !f, e = /* @__PURE__ */ r(
|
|
19
20
|
"div",
|
|
20
21
|
{
|
|
21
|
-
ref:
|
|
22
|
-
className:
|
|
22
|
+
ref: u,
|
|
23
|
+
className: a(x({ size: i, colorScheme: n, shape: l }), o),
|
|
23
24
|
...m,
|
|
24
25
|
children: p ? /* @__PURE__ */ r(
|
|
25
26
|
"img",
|
|
@@ -38,14 +39,14 @@ const w = b.forwardRef(
|
|
|
38
39
|
{
|
|
39
40
|
as: "div",
|
|
40
41
|
className: "rst:cursor-pointer 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 rst:rounded-full",
|
|
41
|
-
children:
|
|
42
|
+
children: e
|
|
42
43
|
}
|
|
43
44
|
),
|
|
44
45
|
/* @__PURE__ */ r(
|
|
45
46
|
k,
|
|
46
47
|
{
|
|
47
48
|
anchor: "bottom",
|
|
48
|
-
className:
|
|
49
|
+
className: a(
|
|
49
50
|
"rst:z-50 rst:mt-2 rst:rounded-md rst:px-3 rst:py-1.5 rst:text-xs rst:font-medium rst:elevation-anchored rst:backdrop-blur-md rst:ring-1",
|
|
50
51
|
"rst:bg-gray-900/95 rst:text-white rst:ring-black/5 rst:dark:bg-gray-100/95 rst:dark:text-gray-900 rst:dark:ring-white/20",
|
|
51
52
|
"rst:transition rst:duration-200 rst:ease-in-out rst:data-closed:opacity-0 rst:data-closed:translate-y-1"
|
|
@@ -53,7 +54,7 @@ const w = b.forwardRef(
|
|
|
53
54
|
children: s
|
|
54
55
|
}
|
|
55
56
|
)
|
|
56
|
-
] }) :
|
|
57
|
+
] }) : e;
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
w.displayName = "Avatar";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("../../../lib/utils.cjs"),f=require("../Avatar/Avatar.cjs");function g({items:i,maxDisplay:l=5,totalCount:n,excludeKey:c,onDismiss:o,trailingSlot:d,label:v,ringClass:h="rst:ring-white rst:dark:ring-gray-900",className:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("../../../lib/utils.cjs"),f=require("../Avatar/Avatar.cjs");function g({items:i,maxDisplay:l=5,totalCount:n,excludeKey:c,onDismiss:o,trailingSlot:d,label:v,ringClass:h="rst:ring-white rst:dark:ring-gray-900",className:p}){const s=i.filter(t=>t.key!==c).slice(0,l),e=n!==void 0?Math.max(0,n-s.length):Math.max(0,i.filter(t=>t.key!==c).length-l);return s.length===0&&!d?null:r.jsxs("div",{"data-testid":"avatar-strip",className:a.cn("rst:font-ui rst:flex rst:items-center rst:gap-3",p),children:[o&&r.jsx("button",{type:"button",onClick:o,"aria-label":"Dismiss","data-testid":"avatar-strip-dismiss",className:"rst:shrink-0 rst:text-gray-400/50 rst:dark:text-gray-500/50 rst:hover:text-gray-400 rst:dark:hover:text-gray-500 rst:transition-colors rst:cursor-pointer",children:"✕"}),r.jsxs("div",{"data-testid":"avatar-strip-stack",className:"rst:flex rst:items-center rst:-space-x-2",children:[s.map(t=>{const x=r.jsx(f.Avatar,{initials:t.label[0].toUpperCase(),src:t.src,colorScheme:t.colorScheme??"neutral",size:"xs"}),u=a.cn("rst:relative rst:inline-flex rst:h-6 rst:w-6 rst:rounded-full rst:ring-2 rst:transition-transform rst:hover:z-10 rst:hover:scale-110",h);return t.href?r.jsx("a",{href:t.href,title:t.label,"data-testid":`avatar-strip-item-${t.key}`,className:u,children:x},t.key):r.jsx("span",{title:t.label,"data-testid":`avatar-strip-item-${t.key}`,className:u,children:x},t.key)}),e>0&&r.jsx("div",{title:`${e} more`,"data-testid":"avatar-strip-overflow",className:a.cn("rst:relative rst:flex rst:h-6 rst:w-6 rst:items-center rst:justify-center rst:rounded-full rst:bg-gray-500/10 rst:ring-2",h),children:r.jsxs("span",{className:"rst:text-[9px] rst:font-bold rst:text-gray-500 rst:dark:text-gray-400 rst:select-none",children:["+",e]})}),d]}),v&&r.jsx("div",{"data-testid":"avatar-strip-label",children:v})]})}exports.AvatarStrip=g;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
3
|
import { cn as i } from "../../../lib/utils.js";
|
|
3
4
|
import { Avatar as m } from "../Avatar/Avatar.js";
|
|
4
5
|
function b({
|
|
5
6
|
items: l,
|
|
6
7
|
maxDisplay: n = 5,
|
|
7
|
-
totalCount:
|
|
8
|
-
excludeKey:
|
|
8
|
+
totalCount: c,
|
|
9
|
+
excludeKey: o,
|
|
9
10
|
onDismiss: d,
|
|
10
11
|
trailingSlot: h,
|
|
11
12
|
label: v,
|
|
12
13
|
ringClass: p = "rst:ring-white rst:dark:ring-gray-900",
|
|
13
14
|
className: g
|
|
14
15
|
}) {
|
|
15
|
-
const s = l.filter((t) => t.key !==
|
|
16
|
-
return s.length === 0 && !h ? null : /* @__PURE__ */
|
|
16
|
+
const s = l.filter((t) => t.key !== o).slice(0, n), e = c !== void 0 ? Math.max(0, c - s.length) : Math.max(0, l.filter((t) => t.key !== o).length - n);
|
|
17
|
+
return s.length === 0 && !h ? null : /* @__PURE__ */ a(
|
|
17
18
|
"div",
|
|
18
19
|
{
|
|
19
20
|
"data-testid": "avatar-strip",
|
|
@@ -30,7 +31,7 @@ function b({
|
|
|
30
31
|
children: "✕"
|
|
31
32
|
}
|
|
32
33
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ a(
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
37
|
"data-testid": "avatar-strip-stack",
|
|
@@ -70,18 +71,18 @@ function b({
|
|
|
70
71
|
t.key
|
|
71
72
|
);
|
|
72
73
|
}),
|
|
73
|
-
|
|
74
|
+
e > 0 && /* @__PURE__ */ r(
|
|
74
75
|
"div",
|
|
75
76
|
{
|
|
76
|
-
title: `${
|
|
77
|
+
title: `${e} more`,
|
|
77
78
|
"data-testid": "avatar-strip-overflow",
|
|
78
79
|
className: i(
|
|
79
80
|
"rst:relative rst:flex rst:h-6 rst:w-6 rst:items-center rst:justify-center rst:rounded-full rst:bg-gray-500/10 rst:ring-2",
|
|
80
81
|
p
|
|
81
82
|
),
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ a("span", { className: "rst:text-[9px] rst:font-bold rst:text-gray-500 rst:dark:text-gray-400 rst:select-none", children: [
|
|
83
84
|
"+",
|
|
84
|
-
|
|
85
|
+
e
|
|
85
86
|
] })
|
|
86
87
|
}
|
|
87
88
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),m=require("../../../lib/utils.cjs"),p=require("./badge-variants.cjs");function j(e){const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),m=require("../../../lib/utils.cjs"),p=require("./badge-variants.cjs");function j(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const g=j(f),i=g.forwardRef(({className:e,variant:s,statusBadge:t,size:r,fill:u,leftIcon:n,rightIcon:c,children:l,...o},d)=>a.jsxs("span",{ref:d,className:m.cn(p.badgeVariants({variant:s,statusBadge:t,size:r,fill:u}),e),...o,children:[n&&a.jsx("span",{className:"rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70",children:n}),a.jsx("span",{className:"rst:truncate rst:min-w-0",children:l}),c&&a.jsx("span",{className:"rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70",children:c})]}));i.displayName="Badge";exports.Badge=i;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "react";
|
|
3
4
|
import { cn as d } from "../../../lib/utils.js";
|
|
4
|
-
import { badgeVariants as
|
|
5
|
-
const
|
|
5
|
+
import { badgeVariants as u } from "./badge-variants.js";
|
|
6
|
+
const x = f.forwardRef(
|
|
6
7
|
({
|
|
7
8
|
className: e,
|
|
8
9
|
variant: a,
|
|
9
10
|
statusBadge: i,
|
|
10
11
|
size: n,
|
|
11
|
-
fill:
|
|
12
|
+
fill: c,
|
|
12
13
|
leftIcon: r,
|
|
13
14
|
rightIcon: t,
|
|
14
|
-
children:
|
|
15
|
+
children: m,
|
|
15
16
|
...p
|
|
16
|
-
}, o) => /* @__PURE__ */
|
|
17
|
+
}, o) => /* @__PURE__ */ l(
|
|
17
18
|
"span",
|
|
18
19
|
{
|
|
19
20
|
ref: o,
|
|
20
21
|
className: d(
|
|
21
|
-
|
|
22
|
+
u({ variant: a, statusBadge: i, size: n, fill: c }),
|
|
22
23
|
e
|
|
23
24
|
),
|
|
24
25
|
...p,
|
|
25
26
|
children: [
|
|
26
27
|
r && /* @__PURE__ */ s("span", { className: "rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70", children: r }),
|
|
27
|
-
/* @__PURE__ */ s("span", { className: "rst:truncate rst:min-w-0", children:
|
|
28
|
+
/* @__PURE__ */ s("span", { className: "rst:truncate rst:min-w-0", children: m }),
|
|
28
29
|
t && /* @__PURE__ */ s("span", { className: "rst:flex rst:shrink-0 rst:items-center rst:justify-center rst:opacity-70", children: t })
|
|
29
30
|
]
|
|
30
31
|
}
|
|
31
32
|
)
|
|
32
33
|
);
|
|
33
|
-
|
|
34
|
+
x.displayName = "Badge";
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
x as Badge
|
|
36
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),h=require("../../../lib/utils.cjs"),j=require("../Spinner/Spinner.cjs"),p=require("./button-variants.cjs"),q=require("../../../node_modules/@headlessui/react/dist/components/button/button.cjs"),n=f.forwardRef(({className:i,colorScheme:a,variant:c,size:l,isLoading:t=!1,startIcon:s,endIcon:r,surface:u="auto",disabled:o,children:m,...d},x)=>{const b=o||t;return e.jsxs(q.Button,{className:h.cn(p.buttonVariants({colorScheme:a,variant:c,size:l}),u==="dark"&&"dark",i),ref:x,disabled:b,...d,children:[t&&e.jsx("span",{className:"rst:mr-2 rst:flex rst:shrink-0 rst:items-center",children:e.jsx(j.Spinner,{size:"sm",variant:"current"})}),!t&&s&&e.jsx("span",{className:"rst:mr-2 rst:inline-flex rst:shrink-0 rst:items-center",children:s}),m,!t&&r&&e.jsx("span",{className:"rst:ml-2 rst:inline-flex rst:shrink-0 rst:items-center",children:r})]})});n.displayName="Button";exports.Button=n;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
3
|
import h from "react";
|
|
3
4
|
import { cn as x } from "../../../lib/utils.js";
|
|
4
5
|
import { Spinner as k } from "../Spinner/Spinner.js";
|
|
@@ -6,8 +7,8 @@ import { buttonVariants as N } from "./button-variants.js";
|
|
|
6
7
|
import { Button as b } from "../../../node_modules/@headlessui/react/dist/components/button/button.js";
|
|
7
8
|
const B = h.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
className:
|
|
10
|
-
colorScheme:
|
|
10
|
+
className: n,
|
|
11
|
+
colorScheme: m,
|
|
11
12
|
variant: a,
|
|
12
13
|
size: i,
|
|
13
14
|
isLoading: r = !1,
|
|
@@ -18,20 +19,20 @@ const B = h.forwardRef(
|
|
|
18
19
|
children: c,
|
|
19
20
|
...f
|
|
20
21
|
}, p) => {
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
const u = o || r;
|
|
23
|
+
return /* @__PURE__ */ d(
|
|
23
24
|
b,
|
|
24
25
|
{
|
|
25
26
|
className: x(
|
|
26
|
-
N({ colorScheme:
|
|
27
|
+
N({ colorScheme: m, variant: a, size: i }),
|
|
27
28
|
// Roster's dark variant is `&:where(.dark, .dark *)`, so an element
|
|
28
29
|
// carrying `.dark` itself satisfies it. That is all forcing the
|
|
29
30
|
// dark surface requires.
|
|
30
31
|
l === "dark" && "dark",
|
|
31
|
-
|
|
32
|
+
n
|
|
32
33
|
),
|
|
33
34
|
ref: p,
|
|
34
|
-
disabled:
|
|
35
|
+
disabled: u,
|
|
35
36
|
...f,
|
|
36
37
|
children: [
|
|
37
38
|
r && /* @__PURE__ */ t("span", { className: "rst:mr-2 rst:flex rst:shrink-0 rst:items-center", children: /* @__PURE__ */ t(k, { size: "sm", variant: "current" }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),e=require("../../../lib/utils.cjs"),m=require("./card-variants.cjs"),i=g.forwardRef(({className:c,variant:n,padding:u,branded:a=!1,brandColorTop:s,brandColorBottom:t,children:l,...d},o)=>r.jsxs("div",{ref:o,className:e.cn(m.cardVariants({variant:n,padding:u}),c),...d,children:[a&&r.jsx("div",{className:e.cn("rst:absolute rst:top-0 rst:inset-x-0 rst:h-1 rst:z-10",!s&&"rst:bg-orange-500"),style:s?{backgroundColor:s}:void 0}),l,a&&r.jsx("div",{className:e.cn("rst:absolute rst:bottom-0 rst:inset-x-0 rst:h-1 rst:z-10",!t&&"rst:bg-primary-500"),style:t?{backgroundColor:t}:void 0})]}));i.displayName="Card";exports.Card=i;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as f, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import u from "react";
|
|
3
4
|
import { cn as t } from "../../../lib/utils.js";
|
|
4
|
-
import { cardVariants as
|
|
5
|
-
const
|
|
5
|
+
import { cardVariants as n } from "./card-variants.js";
|
|
6
|
+
const p = u.forwardRef(
|
|
6
7
|
({
|
|
7
8
|
className: i,
|
|
8
9
|
variant: m,
|
|
9
|
-
padding:
|
|
10
|
-
branded:
|
|
10
|
+
padding: c,
|
|
11
|
+
branded: e = !1,
|
|
11
12
|
brandColorTop: s,
|
|
12
13
|
brandColorBottom: r,
|
|
13
|
-
children:
|
|
14
|
+
children: o,
|
|
14
15
|
...l
|
|
15
16
|
}, d) => /* @__PURE__ */ f(
|
|
16
17
|
"div",
|
|
17
18
|
{
|
|
18
19
|
ref: d,
|
|
19
|
-
className: t(
|
|
20
|
+
className: t(n({ variant: m, padding: c }), i),
|
|
20
21
|
...l,
|
|
21
22
|
children: [
|
|
22
|
-
|
|
23
|
+
e && /* @__PURE__ */ a(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
className: t(
|
|
@@ -29,8 +30,8 @@ const g = p.forwardRef(
|
|
|
29
30
|
style: s ? { backgroundColor: s } : void 0
|
|
30
31
|
}
|
|
31
32
|
),
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
o,
|
|
34
|
+
e && /* @__PURE__ */ a(
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
37
|
className: t(
|
|
@@ -44,7 +45,7 @@ const g = p.forwardRef(
|
|
|
44
45
|
}
|
|
45
46
|
)
|
|
46
47
|
);
|
|
47
|
-
|
|
48
|
+
p.displayName = "Card";
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
p as Card
|
|
50
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),m=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),u=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),a=require("../../../lib/utils.cjs"),q=require("./checkbox-variants.cjs"),p=require("../../../node_modules/@headlessui/react/dist/components/checkbox/checkbox.cjs"),l=n.forwardRef(({className:h,colorScheme:x="primary",variant:b="solid",size:i="md",indeterminate:c=!1,...t},s)=>{const f={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-4 h-4"},r=n.useRef(null),k=e=>{r.current=e,typeof s=="function"?s(e):s&&(s.current=e)};return n.useEffect(()=>{c&&r.current&&r.current.setAttribute("aria-checked","mixed")},[c,t.checked]),o.jsx(p.Checkbox,{ref:k,...t,className:({checked:e,disabled:y})=>a.cn(q.checkboxVariants({colorScheme:x,variant:b,size:i,checked:e||c}),y||t.disabled?"rst:opacity-50":"rst:cursor-pointer",h),children:({checked:e})=>o.jsx(m.FontAwesomeIcon,{icon:c?u.faMinus:u.faCheck,className:a.cn("rst:pointer-events-none rst:transition-opacity rst:duration-200",e||c?"rst:opacity-100":"rst:opacity-0",f[i])})})});l.displayName="Checkbox";exports.Checkbox=l;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as h, useRef as k, useEffect as x } from "react";
|
|
3
4
|
import { FontAwesomeIcon as y } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
@@ -12,25 +13,25 @@ const A = h(
|
|
|
12
13
|
variant: f = "solid",
|
|
13
14
|
size: e = "md",
|
|
14
15
|
indeterminate: r = !1,
|
|
15
|
-
...
|
|
16
|
-
},
|
|
16
|
+
...o
|
|
17
|
+
}, c) => {
|
|
17
18
|
const l = {
|
|
18
19
|
sm: "w-2.5 h-2.5",
|
|
19
20
|
md: "w-3 h-3",
|
|
20
21
|
lg: "w-4 h-4"
|
|
21
|
-
}, s = k(null),
|
|
22
|
-
s.current = t, typeof
|
|
22
|
+
}, s = k(null), u = (t) => {
|
|
23
|
+
s.current = t, typeof c == "function" ? c(t) : c && (c.current = t);
|
|
23
24
|
};
|
|
24
25
|
return x(() => {
|
|
25
26
|
r && s.current && s.current.setAttribute("aria-checked", "mixed");
|
|
26
|
-
}, [r,
|
|
27
|
+
}, [r, o.checked]), /* @__PURE__ */ i(
|
|
27
28
|
w,
|
|
28
29
|
{
|
|
29
|
-
ref:
|
|
30
|
-
...
|
|
30
|
+
ref: u,
|
|
31
|
+
...o,
|
|
31
32
|
className: ({
|
|
32
33
|
checked: t,
|
|
33
|
-
disabled:
|
|
34
|
+
disabled: p
|
|
34
35
|
}) => n(
|
|
35
36
|
N({
|
|
36
37
|
colorScheme: a,
|
|
@@ -38,7 +39,7 @@ const A = h(
|
|
|
38
39
|
size: e,
|
|
39
40
|
checked: t || r
|
|
40
41
|
}),
|
|
41
|
-
|
|
42
|
+
p || o.disabled ? "rst:opacity-50" : "rst:cursor-pointer",
|
|
42
43
|
m
|
|
43
44
|
),
|
|
44
45
|
children: ({ checked: t }) => /* @__PURE__ */ i(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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(
|
|
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),l=require("../../../lib/utils.cjs"),x={xs:"rst:max-h-8",sm:"rst:max-h-16",md:"rst:max-h-24",lg:"rst:max-h-36"};function b({children:a,size:o="md",expandLabel:c="Show more",collapseLabel:m="Show less",className:d}){const[e,u]=s.useState(!1),[n,p]=s.useState(!1),i=s.useRef(null);return s.useEffect(()=>{const t=i.current;t&&p(t.scrollHeight>t.clientHeight)},[a,o]),r.jsxs("div",{className:l.cn("rst:font-ui",d),children:[r.jsx("div",{ref:i,"data-testid":"collapsible-content",className:l.cn(!e&&x[o],!e&&"rst:overflow-hidden"),style:!e&&n?{maskImage:"linear-gradient(to bottom, black 50%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 50%, transparent 100%)"}:void 0,children:a}),n&&r.jsx("button",{type:"button","data-testid":"collapsible-toggle",onClick:()=>u(t=>!t),className:"rst:mt-2 rst:text-xs rst:font-medium rst:text-primary-500 rst:dark:text-primary-400 rst:hover:opacity-80 rst:transition-opacity rst:cursor-pointer",children:e?m:c})]})}exports.CollapsibleSection=b;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),l=require("../../../lib/utils.cjs"),x={xs:"rst:max-h-8",sm:"rst:max-h-16",md:"rst:max-h-24",lg:"rst:max-h-36"};function b({children:a,size:o="md",expandLabel:c="Show more",collapseLabel:m="Show less",className:d}){const[e,u]=s.useState(!1),[n,p]=s.useState(!1),i=s.useRef(null);return s.useEffect(()=>{const t=i.current;t&&p(t.scrollHeight>t.clientHeight)},[a,o]),r.jsxs("div",{className:l.cn("rst:font-ui",d),children:[r.jsx("div",{ref:i,"data-testid":"collapsible-content",className:l.cn(!e&&x[o],!e&&"rst:overflow-hidden"),style:!e&&n?{maskImage:"linear-gradient(to bottom, black 50%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 50%, transparent 100%)"}:void 0,children:a}),n&&r.jsx("button",{type:"button","data-testid":"collapsible-toggle",onClick:()=>u(t=>!t),className:"rst:mt-2 rst:text-xs rst:font-medium rst:text-primary-500 rst:dark:text-primary-400 rst:hover:opacity-80 rst:transition-opacity rst:cursor-pointer",children:e?m:c})]})}exports.CollapsibleSection=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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"),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,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
3
|
import * as I from "react";
|
|
3
4
|
import { Fragment as L } from "react";
|
|
4
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";
|
|
@@ -15,7 +16,7 @@ import { useDarkScope as W, POPUP_ANCHOR as K, POPUP_WIDTH_OF_INPUT as Q, POPUP_
|
|
|
15
16
|
const J = (s, o) => {
|
|
16
17
|
const a = o.trim().toLowerCase();
|
|
17
18
|
return a ? s.filter((i) => i.label.toLowerCase().includes(a)) : s;
|
|
18
|
-
},
|
|
19
|
+
}, mt = ({
|
|
19
20
|
options: s,
|
|
20
21
|
value: o,
|
|
21
22
|
onChange: a,
|
|
@@ -34,7 +35,7 @@ const J = (s, o) => {
|
|
|
34
35
|
filter: k = J,
|
|
35
36
|
...g
|
|
36
37
|
}) => {
|
|
37
|
-
const [O, u] = I.useState(""), { ref: w, inDarkScope: D } = W(), n = !!m || v, x = k(s, O), F = s.find((
|
|
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;
|
|
38
39
|
return /* @__PURE__ */ b(
|
|
39
40
|
A,
|
|
40
41
|
{
|
|
@@ -42,15 +43,15 @@ const J = (s, o) => {
|
|
|
42
43
|
className: e("rst:flex rst:flex-col rst:gap-1.5", y),
|
|
43
44
|
...g,
|
|
44
45
|
children: [
|
|
45
|
-
d && /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
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
|
+
/* @__PURE__ */ t(
|
|
47
48
|
U,
|
|
48
49
|
{
|
|
49
50
|
value: o ?? null,
|
|
50
51
|
onChange: a,
|
|
51
52
|
disabled: c,
|
|
52
53
|
children: /* @__PURE__ */ b("div", { ref: w, className: "rst:relative", children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ t(
|
|
54
55
|
_,
|
|
55
56
|
{
|
|
56
57
|
"aria-invalid": n || void 0,
|
|
@@ -61,17 +62,17 @@ const J = (s, o) => {
|
|
|
61
62
|
),
|
|
62
63
|
placeholder: i,
|
|
63
64
|
displayValue: () => F?.label ?? "",
|
|
64
|
-
onChange: (
|
|
65
|
+
onChange: (r) => u(r.target.value)
|
|
65
66
|
}
|
|
66
67
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ t(
|
|
68
69
|
H,
|
|
69
70
|
{
|
|
70
71
|
className: e(
|
|
71
72
|
"rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:w-11 rst:cursor-pointer rst:items-center rst:justify-end",
|
|
72
73
|
l === "sm" ? "rst:pr-2.5" : "rst:pr-3"
|
|
73
74
|
),
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ t(
|
|
75
76
|
q,
|
|
76
77
|
{
|
|
77
78
|
icon: B,
|
|
@@ -81,7 +82,7 @@ const J = (s, o) => {
|
|
|
81
82
|
)
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ t(
|
|
85
86
|
T,
|
|
86
87
|
{
|
|
87
88
|
as: L,
|
|
@@ -89,7 +90,7 @@ const J = (s, o) => {
|
|
|
89
90
|
leaveFrom: "rst:opacity-100",
|
|
90
91
|
leaveTo: "rst:opacity-0",
|
|
91
92
|
afterLeave: () => u(""),
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ t(
|
|
93
94
|
S,
|
|
94
95
|
{
|
|
95
96
|
anchor: K,
|
|
@@ -101,7 +102,7 @@ const J = (s, o) => {
|
|
|
101
102
|
Q,
|
|
102
103
|
P
|
|
103
104
|
),
|
|
104
|
-
children: x.length === 0 ? /* @__PURE__ */
|
|
105
|
+
children: x.length === 0 ? /* @__PURE__ */ t(
|
|
105
106
|
h,
|
|
106
107
|
{
|
|
107
108
|
value: "",
|
|
@@ -112,16 +113,16 @@ const J = (s, o) => {
|
|
|
112
113
|
),
|
|
113
114
|
children: C
|
|
114
115
|
}
|
|
115
|
-
) : x.map((
|
|
116
|
+
) : x.map((r) => /* @__PURE__ */ t(
|
|
116
117
|
V,
|
|
117
118
|
{
|
|
118
119
|
as: h,
|
|
119
|
-
value:
|
|
120
|
-
disabled:
|
|
120
|
+
value: r.value,
|
|
121
|
+
disabled: r.disabled,
|
|
121
122
|
size: l,
|
|
122
|
-
children:
|
|
123
|
+
children: r.label
|
|
123
124
|
},
|
|
124
|
-
|
|
125
|
+
r.value
|
|
125
126
|
))
|
|
126
127
|
}
|
|
127
128
|
)
|
|
@@ -130,7 +131,7 @@ const J = (s, o) => {
|
|
|
130
131
|
] })
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
|
-
(f || m) && /* @__PURE__ */
|
|
134
|
+
(f || m) && /* @__PURE__ */ t(
|
|
134
135
|
j,
|
|
135
136
|
{
|
|
136
137
|
className: e(
|
|
@@ -145,5 +146,5 @@ const J = (s, o) => {
|
|
|
145
146
|
);
|
|
146
147
|
};
|
|
147
148
|
export {
|
|
148
|
-
|
|
149
|
+
mt as Combobox
|
|
149
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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"),
|
|
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;
|