@blakesteve/roster 5.2.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -20
- package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
- package/dist/components/atoms/Avatar/Avatar.js +1 -1
- package/dist/components/atoms/Avatar/avatar-variants.cjs +1 -1
- package/dist/components/atoms/Avatar/avatar-variants.js +1 -1
- package/dist/components/atoms/Button/button-variants.cjs +1 -1
- package/dist/components/atoms/Button/button-variants.js +3 -3
- package/dist/components/atoms/Card/card-variants.cjs +1 -1
- package/dist/components/atoms/Card/card-variants.js +3 -2
- package/dist/components/atoms/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/atoms/Checkbox/Checkbox.js +54 -40
- package/dist/components/atoms/Checkbox/checkbox-variants.cjs +1 -1
- package/dist/components/atoms/Checkbox/checkbox-variants.js +1 -1
- package/dist/components/atoms/InlineCode/inline-code-variants.cjs +1 -1
- package/dist/components/atoms/InlineCode/inline-code-variants.js +1 -1
- package/dist/components/atoms/Input/input-variants.cjs +1 -1
- package/dist/components/atoms/Input/input-variants.js +17 -7
- package/dist/components/atoms/LabeledDivider/LabeledDivider.cjs +1 -1
- package/dist/components/atoms/LabeledDivider/LabeledDivider.js +6 -6
- package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/atoms/MultiSelect/MultiSelect.js +19 -18
- package/dist/components/atoms/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/atoms/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/atoms/Select/select-variants.cjs +1 -1
- package/dist/components/atoms/Select/select-variants.js +9 -2
- package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
- package/dist/components/atoms/Switch/switch-variants.js +1 -1
- package/dist/components/atoms/Textarea/textarea-variants.cjs +1 -1
- package/dist/components/atoms/Textarea/textarea-variants.js +17 -11
- package/dist/components/atoms/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/atoms/Tooltip/Tooltip.js +1 -1
- package/dist/components/molecules/Accordion/Accordion.cjs +1 -1
- package/dist/components/molecules/Accordion/Accordion.js +19 -19
- package/dist/components/molecules/Alert/Alert.cjs +1 -1
- package/dist/components/molecules/Alert/Alert.js +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.js +28 -27
- package/dist/components/molecules/Toast/Toast.cjs +1 -1
- package/dist/components/molecules/Toast/Toast.js +1 -1
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +28 -24
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.js +2 -2
- package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
- package/dist/components/organisms/Sheet/Sheet.js +1 -1
- package/dist/internal/popup.cjs +1 -1
- package/dist/internal/popup.js +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +16 -11
- package/dist/meta.json +3 -3
- package/dist/roster.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"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"),l=require("react"),c=require("../../../lib/utils.cjs"),t=require("../Eyebrow/Eyebrow.cjs"),a=l.forwardRef(({label:i,trailing:e,align:s="start",className:o,...d},n)=>r.jsxs("div",{ref:n,className:c.cn("rst:font-ui rst:flex rst:items-center rst:gap-3",o),...d,children:[s==="end"&&r.jsx("span",{role:"presentation",className:"rst:h-[var(--roster-border-width,1px)] rst:flex-1 rst:bg-gray-200 rst:dark:bg-gray-800"}),r.jsx(t.Eyebrow,{children:i}),s==="start"&&r.jsx("span",{role:"presentation",className:"rst:h-[var(--roster-border-width,1px)] rst:flex-1 rst:bg-gray-200 rst:dark:bg-gray-800"}),e&&r.jsx(t.Eyebrow,{children:e})]}));a.displayName="LabeledDivider";exports.LabeledDivider=a;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import m from "react";
|
|
4
4
|
import { cn as n } from "../../../lib/utils.js";
|
|
5
|
-
import { Eyebrow as
|
|
5
|
+
import { Eyebrow as s } from "../Eyebrow/Eyebrow.js";
|
|
6
6
|
const p = m.forwardRef(
|
|
7
|
-
({ label: a, trailing: e, align:
|
|
8
|
-
|
|
9
|
-
/* @__PURE__ */ r(
|
|
10
|
-
|
|
11
|
-
e && /* @__PURE__ */ r(
|
|
7
|
+
({ label: a, trailing: e, align: t = "start", className: o, ...d }, i) => /* @__PURE__ */ l("div", { ref: i, className: n("rst:font-ui rst:flex rst:items-center rst:gap-3", o), ...d, children: [
|
|
8
|
+
t === "end" && /* @__PURE__ */ r("span", { role: "presentation", className: "rst:h-[var(--roster-border-width,1px)] rst:flex-1 rst:bg-gray-200 rst:dark:bg-gray-800" }),
|
|
9
|
+
/* @__PURE__ */ r(s, { children: a }),
|
|
10
|
+
t === "start" && /* @__PURE__ */ r("span", { role: "presentation", className: "rst:h-[var(--roster-border-width,1px)] rst:flex-1 rst:bg-gray-200 rst:dark:bg-gray-800" }),
|
|
11
|
+
e && /* @__PURE__ */ r(s, { children: e })
|
|
12
12
|
] })
|
|
13
13
|
);
|
|
14
14
|
p.displayName = "LabeledDivider";
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
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:v="Select options",disabled:a=!1,variant:f,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:w="neutral",chipVariant:k="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: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&&o&&"rst:pr-16","rst:focus-within:ring-[length:calc(var(--roster-border-width,1px)+1px)] 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(", "):v})}),!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:v}),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:k,colorScheme:w,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:k,colorScheme:w,"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,f)&&"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;
|
|
@@ -13,13 +13,13 @@ import { isFieldInvalid as z, withoutInvalidProps as tt } from "../../../interna
|
|
|
13
13
|
import { selectTriggerVariants as rt } from "../Select/select-variants.js";
|
|
14
14
|
import { Chip as T } from "../Chip/Chip.js";
|
|
15
15
|
import { PopupOption as et } from "../../../internal/PopupOption.js";
|
|
16
|
-
import { useDarkScope as st, POPUP_ANCHOR as nt, POPUP_WIDTH_OF_BUTTON as ot, POPUP_PANEL as
|
|
16
|
+
import { useDarkScope as st, POPUP_ANCHOR as nt, POPUP_WIDTH_OF_BUTTON as ot, POPUP_PANEL as at, popupInDarkPalette as it } from "../../../internal/popup.js";
|
|
17
17
|
const It = ({
|
|
18
18
|
options: u,
|
|
19
19
|
value: n,
|
|
20
20
|
onChange: p,
|
|
21
21
|
placeholder: f = "Select options",
|
|
22
|
-
disabled:
|
|
22
|
+
disabled: i = !1,
|
|
23
23
|
variant: v,
|
|
24
24
|
size: o,
|
|
25
25
|
error: F,
|
|
@@ -38,7 +38,7 @@ const It = ({
|
|
|
38
38
|
removeLabel: E = (l) => `Remove ${l}`,
|
|
39
39
|
...I
|
|
40
40
|
}) => {
|
|
41
|
-
const l = !!h || F, U = z(l, I), $ = tt(I),
|
|
41
|
+
const l = !!h || F, U = z(l, I), $ = tt(I), a = n.length > 0, P = new Map(u.map((t, e) => [t.value, e])), d = n.map((t) => ({
|
|
42
42
|
value: t,
|
|
43
43
|
label: u.find((e) => e.value === t)?.label ?? String(t)
|
|
44
44
|
})).sort(
|
|
@@ -47,12 +47,12 @@ const It = ({
|
|
|
47
47
|
return /* @__PURE__ */ c(
|
|
48
48
|
Y,
|
|
49
49
|
{
|
|
50
|
-
disabled:
|
|
50
|
+
disabled: i,
|
|
51
51
|
className: s("rst:flex rst:flex-col rst:gap-1.5", L),
|
|
52
52
|
...$,
|
|
53
53
|
children: [
|
|
54
54
|
b && /* @__PURE__ */ r(C, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: b }),
|
|
55
|
-
/* @__PURE__ */ r(K, { value: n, onChange: p, disabled:
|
|
55
|
+
/* @__PURE__ */ r(K, { value: n, onChange: p, disabled: i, multiple: !0, children: /* @__PURE__ */ c("div", { ref: A, className: "rst:relative", children: [
|
|
56
56
|
/* @__PURE__ */ c(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
@@ -60,13 +60,14 @@ const It = ({
|
|
|
60
60
|
rt({ variant: v, size: o, error: l }),
|
|
61
61
|
"rst:h-auto rst:flex-wrap rst:items-center rst:gap-1.5 rst:py-1.5",
|
|
62
62
|
o === "sm" ? "rst:min-h-9" : o === "lg" ? "rst:min-h-11" : "rst:min-h-10",
|
|
63
|
-
N &&
|
|
63
|
+
N && a && "rst:pr-16",
|
|
64
64
|
/* The ring is on the shell and fires from `focus-within`, because
|
|
65
65
|
the element that actually takes focus is the invisible button
|
|
66
66
|
stretched across it — and, deliberately, from a dismiss
|
|
67
|
-
control too: those are inside the field and should light it.
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
control too: those are inside the field and should light it.
|
|
68
|
+
One pixel heavier than the edge, as Select's trigger is. */
|
|
69
|
+
"rst:focus-within:ring-[length:calc(var(--roster-border-width,1px)+1px)] rst:focus-within:ring-ring",
|
|
70
|
+
i && "rst:opacity-50 rst:cursor-not-allowed",
|
|
70
71
|
R
|
|
71
72
|
),
|
|
72
73
|
children: [
|
|
@@ -76,10 +77,10 @@ const It = ({
|
|
|
76
77
|
ref: S,
|
|
77
78
|
"aria-invalid": U || void 0,
|
|
78
79
|
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",
|
|
79
|
-
children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children:
|
|
80
|
+
children: /* @__PURE__ */ r("span", { className: "rst:sr-only", children: a ? m === "count" ? `${n.length} selected` : d.map((t) => t.label).join(", ") : f })
|
|
80
81
|
}
|
|
81
82
|
),
|
|
82
|
-
!
|
|
83
|
+
!a && /* @__PURE__ */ r(
|
|
83
84
|
"span",
|
|
84
85
|
{
|
|
85
86
|
"aria-hidden": "true",
|
|
@@ -87,7 +88,7 @@ const It = ({
|
|
|
87
88
|
children: f
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
|
-
|
|
91
|
+
a && m === "count" && /* @__PURE__ */ c(
|
|
91
92
|
"span",
|
|
92
93
|
{
|
|
93
94
|
"aria-hidden": "true",
|
|
@@ -98,13 +99,13 @@ const It = ({
|
|
|
98
99
|
]
|
|
99
100
|
}
|
|
100
101
|
),
|
|
101
|
-
|
|
102
|
+
a && m === "chips" && y.map((t, e) => /* @__PURE__ */ r(
|
|
102
103
|
T,
|
|
103
104
|
{
|
|
104
105
|
size: "sm",
|
|
105
106
|
variant: w,
|
|
106
107
|
colorScheme: k,
|
|
107
|
-
disabled:
|
|
108
|
+
disabled: i,
|
|
108
109
|
onRemove: () => p(n.filter((M) => M !== t.value)),
|
|
109
110
|
removeLabel: E(t.label),
|
|
110
111
|
className: s(
|
|
@@ -147,11 +148,11 @@ const It = ({
|
|
|
147
148
|
)
|
|
148
149
|
}
|
|
149
150
|
),
|
|
150
|
-
N &&
|
|
151
|
+
N && a && /* @__PURE__ */ r(
|
|
151
152
|
"button",
|
|
152
153
|
{
|
|
153
154
|
type: "button",
|
|
154
|
-
disabled:
|
|
155
|
+
disabled: i,
|
|
155
156
|
onClick: () => {
|
|
156
157
|
p([]), S.current?.focus();
|
|
157
158
|
},
|
|
@@ -192,8 +193,8 @@ const It = ({
|
|
|
192
193
|
{
|
|
193
194
|
anchor: nt,
|
|
194
195
|
className: s(
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
it(B, v) && "dark",
|
|
197
|
+
at,
|
|
197
198
|
ot,
|
|
198
199
|
D
|
|
199
200
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),j=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),c=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),a=require("../../../lib/utils.cjs"),S=require("../Input/Input.cjs"),u=i.forwardRef(({revealable:l=!0,defaultRevealed:d=!1,revealed:r,onRevealChange:p,showLabel:y="Show password",hideLabel:f="Hide password",disabled:e,variant:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),j=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),c=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),a=require("../../../lib/utils.cjs"),S=require("../Input/Input.cjs"),u=i.forwardRef(({revealable:l=!0,defaultRevealed:d=!1,revealed:r,onRevealChange:p,showLabel:y="Show password",hideLabel:f="Hide password",disabled:e,variant:m,error:w,errorMessage:h,className:v,...x},g)=>{const[I,q]=i.useState(d),o=r!==void 0,t=o?r:I,b=()=>{const n=!t;o||q(n),p?.(n)};return s.jsx(S.Input,{ref:g,type:t?"text":"password",disabled:e,variant:m,error:w,errorMessage:h,className:a.cn("rst:[&_input::-ms-reveal]:hidden",v),endIcon:l?s.jsx("button",{type:"button",onClick:b,disabled:e,"aria-label":t?f:y,"aria-pressed":t,className:a.cn("rst:-m-1 rst:flex rst:items-center rst:rounded-sm rst:p-1 rst:transition-opacity","rst:opacity-70 rst:hover:opacity-100","rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",e&&"rst:cursor-not-allowed rst:opacity-40 rst:hover:opacity-40"),children:s.jsx(j.FontAwesomeIcon,{icon:t?c.faEyeSlash:c.faEye,className:"rst:h-4 rst:w-4","aria-hidden":"true"})}):void 0,...x})});u.displayName="PasswordInput";exports.PasswordInput=u;
|
|
@@ -43,7 +43,7 @@ const C = i.forwardRef(
|
|
|
43
43
|
"aria-label": t ? m : p,
|
|
44
44
|
"aria-pressed": t,
|
|
45
45
|
className: a(
|
|
46
|
-
"rst:-m-1 rst:flex rst:items-center rst:rounded rst:p-1 rst:transition-opacity",
|
|
46
|
+
"rst:-m-1 rst:flex rst:items-center rst:rounded-sm rst:p-1 rst:transition-opacity",
|
|
47
47
|
"rst:opacity-70 rst:hover:opacity-100",
|
|
48
48
|
"rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
|
|
49
49
|
r && "rst:cursor-not-allowed rst:opacity-40 rst:hover:opacity-40"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:relative rst:flex rst:w-full rst:cursor-pointer rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:items-center rst:rounded-md rst:h-10 rst:pl-4 rst:pr-10 rst:text-left rst:text-sm rst:font-medium rst:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:relative rst:flex rst:w-full rst:cursor-pointer rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:items-center rst:rounded-md rst:h-10 rst:pl-4 rst:pr-10 rst:text-left rst:text-sm rst:font-medium rst:elevation-control rst:ring rst:ring-inset rst:transition-all rst:focus:outline-hidden rst:focus-visible:ring-[length:calc(var(--roster-border-width,1px)+1px)] rst:focus-visible:ring-ring",{variants:{variant:{white:"rst:bg-white rst:text-gray-900 rst:ring-gray-300 rst:hover:bg-gray-50 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:ring-gray-700 rst:dark:hover:bg-gray-700",soft:"rst:bg-gray-100 rst:text-gray-900 rst:ring-[var(--roster-control-border)] rst:hover:bg-gray-200 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:hover:bg-gray-700",slate:"rst:bg-gray-700 rst:text-gray-100 rst:ring-transparent rst:hover:bg-gray-600 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800",outline:"rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:ring-[color:var(--roster-control-border)]",ghost:"rst:bg-transparent rst:text-gray-700 rst:ring-transparent rst:hover:bg-gray-100 rst:hover:text-gray-900 rst:dark:text-gray-300 rst:dark:hover:bg-gray-800 rst:dark:hover:text-gray-100"},size:{sm:"rst:h-9 rst:pl-3 rst:pr-9",default:"rst:h-10 rst:pl-4 rst:pr-10",lg:"rst:h-11 rst:pl-4 rst:pr-10"},error:{true:"rst:ring-error-500 rst:text-error-600 rst:focus-visible:ring-error-500 rst:dark:ring-error-500 rst:dark:text-error-400 rst:dark:focus-visible:ring-error-400",false:""}},defaultVariants:{variant:"outline",size:"default",error:!1}}),s=r.cva("rst:text-sm rst:group rst:relative rst:cursor-default rst:select-none rst:py-2.5 rst:pl-4 rst:pr-9 rst:transition-colors rst:text-inherit rst:data-focus:bg-primary-100 rst:data-focus:text-primary-900 rst:dark:data-focus:bg-primary-900/30 rst:dark:data-focus:text-primary-100 rst:data-selected:bg-gray-50 rst:dark:data-selected:bg-gray-700/50 rst:data-disabled:opacity-50 rst:data-disabled:cursor-not-allowed",{variants:{size:{sm:"rst:py-2 rst:pl-3 rst:pr-8",default:"rst:py-2.5 rst:pl-4 rst:pr-9",lg:"rst:py-2.5 rst:pl-4 rst:pr-9"}},defaultVariants:{size:"default"}});exports.selectOptionVariants=s;exports.selectTriggerVariants=t;
|
|
@@ -9,8 +9,15 @@ const s = /* @__PURE__ */ r(
|
|
|
9
9
|
Height used to be a side effect of `py-2.5` plus the line box, and the
|
|
10
10
|
base carried `sm:leading-6` — which made this the only control in the
|
|
11
11
|
library whose height changed at a breakpoint: 40px on mobile, 44px from
|
|
12
|
-
`sm` up. It is now an explicit height at every width.
|
|
13
|
-
|
|
12
|
+
`sm` up. It is now an explicit height at every width.
|
|
13
|
+
|
|
14
|
+
The trigger draws its edge as a bare `ring`, which reads
|
|
15
|
+
`--roster-border-width` so it matches Input's `border` at any width. Its
|
|
16
|
+
focus ring is that width plus a pixel rather than a literal `ring-2`:
|
|
17
|
+
with the edge set to 2px, a 2px focus ring would change only the color,
|
|
18
|
+
and focus would stop being a heavier line. Unset, it computes to 2px, as
|
|
19
|
+
before. */
|
|
20
|
+
"rst:font-ui rst:relative rst:flex rst:w-full rst:cursor-pointer rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:items-center rst:rounded-md rst:h-10 rst:pl-4 rst:pr-10 rst:text-left rst:text-sm rst:font-medium rst:elevation-control rst:ring rst:ring-inset rst:transition-all rst:focus:outline-hidden rst:focus-visible:ring-[length:calc(var(--roster-border-width,1px)+1px)] rst:focus-visible:ring-ring",
|
|
14
21
|
{
|
|
15
22
|
variants: {
|
|
16
23
|
variant: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:before:absolute rst:before:top-1/2 rst:before:left-1/2 rst:before:size-11 rst:before:-translate-x-1/2 rst:before:-translate-y-1/2 rst:before:content-[''] rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",{variants:{variant:{primary:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-primary-500 rst:focus-visible:ring-ring",success:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-green-500 rst:focus-visible:ring-ring",danger:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-error-500 rst:focus-visible:ring-ring",neutral:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-gray-600 rst:dark:data-[checked]:bg-gray-500 rst:focus-visible:ring-ring"},size:{xs:"rst:h-4 rst:w-7",sm:"rst:h-5 rst:w-9",md:"rst:h-6 rst:w-11",lg:"rst:h-7 rst:w-14"}},defaultVariants:{variant:"primary",size:"md"}}),s=r.cva("rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:before:absolute rst:before:top-1/2 rst:before:left-1/2 rst:before:size-11 rst:before:-translate-x-1/2 rst:before:-translate-y-1/2 rst:before:content-[''] rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",{variants:{variant:{primary:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-primary-500 rst:focus-visible:ring-ring",success:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-green-500 rst:focus-visible:ring-ring",danger:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-error-500 rst:focus-visible:ring-ring",neutral:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-gray-600 rst:dark:data-[checked]:bg-gray-500 rst:focus-visible:ring-ring"},size:{xs:"rst:h-4 rst:w-7",sm:"rst:h-5 rst:w-9",md:"rst:h-6 rst:w-11",lg:"rst:h-7 rst:w-14"}},defaultVariants:{variant:"primary",size:"md"}}),s=r.cva("rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:elevation-control rst:ring-0 rst:transition rst:duration-200 rst:ease-in-out rst:transform",{variants:{size:{xs:"rst:h-3 rst:w-3 rst:translate-x-0 rst:group-data-[checked]:translate-x-3",sm:"rst:h-4 rst:w-4 rst:translate-x-0 rst:group-data-[checked]:translate-x-4",md:"rst:h-5 rst:w-5 rst:translate-x-0 rst:group-data-[checked]:translate-x-5",lg:"rst:h-6 rst:w-6 rst:translate-x-0 rst:group-data-[checked]:translate-x-7"}},defaultVariants:{size:"md"}});exports.switchThumbVariants=s;exports.switchTrackVariants=t;
|
|
@@ -22,7 +22,7 @@ const s = /* @__PURE__ */ r(
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
), a = /* @__PURE__ */ r(
|
|
25
|
-
"rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:
|
|
25
|
+
"rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:elevation-control rst:ring-0 rst:transition rst:duration-200 rst:ease-in-out rst:transform",
|
|
26
26
|
{
|
|
27
27
|
variants: {
|
|
28
28
|
size: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",{variants:{variant:{outline:"rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:placeholder:text-[color-mix(in_srgb,var(--roster-control-text)_65%,transparent)] rst:focus-visible:border-[var(--roster-control-border-focus)]",soft:"rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",ghost:"rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",white:"rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"},error:{true:"rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100",false:""},resize:{none:"rst:resize-none",vertical:"rst:resize-y",horizontal:"rst:resize-x",both:"rst:resize"}},defaultVariants:{variant:"outline",error:!1,resize:"vertical"}});exports.textareaVariants=t;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva as r } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
2
2
|
const s = /* @__PURE__ */ r(
|
|
3
|
-
"rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:
|
|
3
|
+
"rst:font-ui rst:flex rst:w-full rst:min-h-[80px] rst:rounded-md rst:border rst:py-2.5 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:disabled:cursor-not-allowed rst:disabled:opacity-50 rst:transition-colors rst:custom-scrollbar",
|
|
4
4
|
{
|
|
5
5
|
variants: {
|
|
6
6
|
variant: {
|
|
@@ -12,11 +12,17 @@ const s = /* @__PURE__ */ r(
|
|
|
12
12
|
gray-950, a near-black box on a gray-800 dialog. Both were reported
|
|
13
13
|
by eye before anyone read the variants.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
`outline`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
The placeholder is the field's own text color at 65%, the same rule
|
|
16
|
+
Input's `outline` uses, so it reaches 4.5:1 on whatever surface the
|
|
17
|
+
text token was chosen for: 5.46:1 on a white page, 7.76 on the dark
|
|
18
|
+
one, 5.02 inside the `slate` Dialog, measured rendered. The base used to set gray-400
|
|
19
|
+
for every variant and scheme, which is 2.52:1 on white, and
|
|
20
|
+
Input's old dark gray-500 is 3.30:1 on the dark page; neither is a
|
|
21
|
+
step that passes in both. The other variants name their surface, so
|
|
22
|
+
they name a step for each scheme instead: gray-500 light, gray-400
|
|
23
|
+
dark. An error no longer recolors the placeholder: red at a
|
|
24
|
+
readable contrast is too close to the typed text's own red to tell
|
|
25
|
+
apart, and the border and message already say what's wrong.
|
|
20
26
|
|
|
21
27
|
The border and text defaults are the values this variant already
|
|
22
28
|
used. The fill does change,
|
|
@@ -25,7 +31,7 @@ const s = /* @__PURE__ */ r(
|
|
|
25
31
|
is the entire point everywhere else: a field drawn inside a Dialog
|
|
26
32
|
now takes the Dialog's surface instead of punching a white or
|
|
27
33
|
near-black hole in it. */
|
|
28
|
-
outline: "rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:focus-visible:border-[var(--roster-control-border-focus)]",
|
|
34
|
+
outline: "rst:border-[var(--roster-control-border)] rst:bg-[var(--roster-control-bg)] rst:text-[var(--roster-control-text)] rst:placeholder:text-[color-mix(in_srgb,var(--roster-control-text)_65%,transparent)] rst:focus-visible:border-[var(--roster-control-border-focus)]",
|
|
29
35
|
/* A boundary that does not depend on what is behind it. `soft` used
|
|
30
36
|
`border-transparent` and leaned on its fill alone, which fails the
|
|
31
37
|
moment the fill matches the surface — exactly 1.00:1 inside a
|
|
@@ -33,12 +39,12 @@ const s = /* @__PURE__ */ r(
|
|
|
33
39
|
vanished until focus. Reported twice in one app before anyone read
|
|
34
40
|
the variant. The border is the same token `outline` reads, so a
|
|
35
41
|
consumer repaints both at once. */
|
|
36
|
-
soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",
|
|
37
|
-
ghost: "rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",
|
|
38
|
-
white: "rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"
|
|
42
|
+
soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:bg-gray-800/50 rst:dark:text-gray-100 rst:dark:focus-visible:bg-gray-900 rst:dark:focus-visible:border-primary-400",
|
|
43
|
+
ghost: "rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800",
|
|
44
|
+
white: "rst:border-gray-200 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:dark:placeholder:text-gray-400 rst:focus-visible:border-primary-500 rst:dark:border-gray-800 rst:dark:bg-gray-900 rst:dark:text-gray-100 rst:dark:focus-visible:border-primary-400"
|
|
39
45
|
},
|
|
40
46
|
error: {
|
|
41
|
-
true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:
|
|
47
|
+
true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-900 rst:dark:border-error-500 rst:dark:focus-visible:ring-error-500 rst:dark:text-error-100",
|
|
42
48
|
false: ""
|
|
43
49
|
},
|
|
44
50
|
resize: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),r=require("../../../node_modules/@radix-ui/react-tooltip/dist/index.cjs"),h=require("../../../lib/utils.cjs");function x({content:o,children:n,placement:d="top",variant:e="dark",delayDuration:l=300,defaultOpen:a=!1,className:c}){const[g,s]=i.useState(a),p=i.useCallback(()=>s(u=>!u),[]);return t.jsx(r.Provider,{delayDuration:l,children:t.jsxs(r.Root,{open:g,onOpenChange:s,children:[t.jsx(r.Trigger,{asChild:!0,onClick:p,children:t.jsx("span",{className:"rst:inline-flex rst:items-center rst:cursor-default",tabIndex:0,"data-testid":"tooltip-trigger",children:n})}),t.jsx(r.Portal,{children:t.jsxs(r.Content,{side:d,sideOffset:8,collisionPadding:8,"data-testid":"tooltip-content",className:h.cn("rst:font-ui rst:z-50 rst:max-w-60 rst:rounded-lg rst:px-3 rst:py-2 rst:text-xs rst:leading-snug rst:elevation-anchored","rst:animate-in rst:fade-in-0 rst:zoom-in-95","rst:data-[side=bottom]:slide-in-from-top-2","rst:data-[side=top]:slide-in-from-bottom-2","rst:data-[side=left]:slide-in-from-right-2","rst:data-[side=right]:slide-in-from-left-2",e==="themed"?"rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),r=require("../../../node_modules/@radix-ui/react-tooltip/dist/index.cjs"),h=require("../../../lib/utils.cjs");function x({content:o,children:n,placement:d="top",variant:e="dark",delayDuration:l=300,defaultOpen:a=!1,className:c}){const[g,s]=i.useState(a),p=i.useCallback(()=>s(u=>!u),[]);return t.jsx(r.Provider,{delayDuration:l,children:t.jsxs(r.Root,{open:g,onOpenChange:s,children:[t.jsx(r.Trigger,{asChild:!0,onClick:p,children:t.jsx("span",{className:"rst:inline-flex rst:items-center rst:cursor-default",tabIndex:0,"data-testid":"tooltip-trigger",children:n})}),t.jsx(r.Portal,{children:t.jsxs(r.Content,{side:d,sideOffset:8,collisionPadding:8,"data-testid":"tooltip-content",className:h.cn("rst:font-ui rst:z-50 rst:max-w-60 rst:rounded-lg rst:px-3 rst:py-2 rst:text-xs rst:leading-snug rst:elevation-anchored","rst:animate-in rst:fade-in-0 rst:zoom-in-95","rst:data-[side=bottom]:slide-in-from-top-2","rst:data-[side=top]:slide-in-from-bottom-2","rst:data-[side=left]:slide-in-from-right-2","rst:data-[side=right]:slide-in-from-left-2",e==="themed"?"rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring rst:ring-[var(--roster-popover-border)]":e==="dark"?"rst:bg-zinc-900 rst:text-zinc-100 rst:ring rst:ring-white/10":"rst:bg-white rst:text-zinc-900 rst:ring rst:ring-zinc-200",c),children:[o,t.jsx(r.Arrow,{className:e==="themed"?"rst:fill-[var(--roster-popover-bg)]":e==="dark"?"rst:fill-zinc-900":"rst:fill-white",width:12,height:6})]})})]})})}exports.Tooltip=x;
|
|
@@ -37,7 +37,7 @@ function P({
|
|
|
37
37
|
"rst:data-[side=top]:slide-in-from-bottom-2",
|
|
38
38
|
"rst:data-[side=left]:slide-in-from-right-2",
|
|
39
39
|
"rst:data-[side=right]:slide-in-from-left-2",
|
|
40
|
-
r === "themed" ? "rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring
|
|
40
|
+
r === "themed" ? "rst:bg-[var(--roster-popover-bg)] rst:text-[var(--roster-popover-text)] rst:ring rst:ring-[var(--roster-popover-border)]" : r === "dark" ? "rst:bg-zinc-900 rst:text-zinc-100 rst:ring rst:ring-white/10" : "rst:bg-white rst:text-zinc-900 rst:ring rst:ring-zinc-200",
|
|
41
41
|
l
|
|
42
42
|
),
|
|
43
43
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("react"),p=require("../../../lib/utils.cjs"),x=require("../../atoms/Disclosure/Disclosure.cjs"),b=({items:o,allowMultiple:c=!1,variant:l="soft",className:i,showDividers:a=!1,defaultOpenIds:d=[]})=>{const[u,g]=h.useState(new Set(d)),f=e=>{g(r=>{const s=new Set(r),n=s.has(e);return c?n?s.delete(e):s.add(e):(s.clear(),n||s.add(e)),s})};return t.jsx("div",{className:p.cn("rst:font-ui rst:w-full rst:space-y-1",i),children:o.map((e,r)=>t.jsxs("div",{className:"rst:relative",children:[a&&r>0&&t.jsx("div",{className:"rst:mx-4 rst:h-[var(--roster-border-width,1px)] rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1"}),t.jsx(x.Disclosure,{title:e.title,variant:l,isOpen:u.has(e.id),onToggle:()=>f(e.id),children:e.content})]},e.id))})};exports.Accordion=b;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { cn as
|
|
2
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { cn as u } from "../../../lib/utils.js";
|
|
5
5
|
import { Disclosure as x } from "../../atoms/Disclosure/Disclosure.js";
|
|
6
6
|
const N = ({
|
|
7
|
-
items:
|
|
7
|
+
items: n,
|
|
8
8
|
allowMultiple: l = !1,
|
|
9
9
|
variant: a = "soft",
|
|
10
|
-
className:
|
|
11
|
-
showDividers:
|
|
10
|
+
className: i,
|
|
11
|
+
showDividers: c = !1,
|
|
12
12
|
defaultOpenIds: d = []
|
|
13
13
|
}) => {
|
|
14
|
-
const [f, m] =
|
|
14
|
+
const [f, m] = h(
|
|
15
15
|
new Set(d)
|
|
16
|
-
), p = (
|
|
17
|
-
m((
|
|
18
|
-
const
|
|
19
|
-
return l ?
|
|
16
|
+
), p = (e) => {
|
|
17
|
+
m((r) => {
|
|
18
|
+
const s = new Set(r), o = s.has(e);
|
|
19
|
+
return l ? o ? s.delete(e) : s.add(e) : (s.clear(), o || s.add(e)), s;
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ t("div", { className: u("rst:font-ui rst:w-full rst:space-y-1", i), children: n.map((e, r) => /* @__PURE__ */ g("div", { className: "rst:relative", children: [
|
|
23
|
+
c && r > 0 && /* @__PURE__ */ t("div", { className: "rst:mx-4 rst:h-[var(--roster-border-width,1px)] rst:bg-gray-200/50 rst:dark:bg-gray-700/50 rst:transition-colors rst:mb-1" }),
|
|
24
|
+
/* @__PURE__ */ t(
|
|
25
25
|
x,
|
|
26
26
|
{
|
|
27
|
-
title:
|
|
27
|
+
title: e.title,
|
|
28
28
|
variant: a,
|
|
29
|
-
isOpen: f.has(
|
|
30
|
-
onToggle: () => p(
|
|
31
|
-
children:
|
|
29
|
+
isOpen: f.has(e.id),
|
|
30
|
+
onToggle: () => p(e.id),
|
|
31
|
+
children: e.content
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
|
-
] },
|
|
34
|
+
] }, e.id)) });
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
37
|
N as Accordion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),o=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),r=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),c=require("../../../lib/utils.cjs"),v=require("./alert-variants.cjs"),b={error:r.faCircleExclamation,success:r.faCircleCheck,amber:r.faTriangleExclamation,info:r.faCircleInfo,primary:r.faCircleInfo,neutral:r.faCircleInfo,current:r.faCircleInfo},l=p.forwardRef(({colorScheme:e="error",surface:u,title:t,children:d,icon:i,onDismiss:a,dismissLabel:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),o=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),r=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),c=require("../../../lib/utils.cjs"),v=require("./alert-variants.cjs"),b={error:r.faCircleExclamation,success:r.faCircleCheck,amber:r.faTriangleExclamation,info:r.faCircleInfo,primary:r.faCircleInfo,neutral:r.faCircleInfo,current:r.faCircleInfo},l=p.forwardRef(({colorScheme:e="error",surface:u,title:t,children:d,icon:i,onDismiss:a,dismissLabel:m="Dismiss",className:f,...x},h)=>{const n=e==="error";return s.jsxs("div",{ref:h,role:n?"alert":"status","aria-live":n?"assertive":"polite",className:c.cn(v.alertVariants({colorScheme:e,surface:u}),f),...x,children:[i===void 0?s.jsx(o.FontAwesomeIcon,{icon:b[e??"error"],className:"rst:mt-0.5 rst:h-4 rst:w-4 rst:shrink-0","aria-hidden":"true"}):i,s.jsxs("div",{className:"rst:min-w-0 rst:flex-1",children:[t&&s.jsx("p",{className:"rst:font-semibold",children:t}),s.jsx("div",{className:c.cn("rst:min-w-0",t&&"rst:mt-0.5 rst:opacity-90"),children:d})]}),a&&s.jsx("button",{type:"button",onClick:a,"aria-label":m,className:"rst:-m-1 rst:shrink-0 rst:rounded-sm rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:s.jsx(o.FontAwesomeIcon,{icon:r.faXmark,className:"rst:h-3.5 rst:w-3.5","aria-hidden":"true"})})]})});l.displayName="Alert";exports.Alert=l;
|
|
@@ -53,7 +53,7 @@ const C = {
|
|
|
53
53
|
type: "button",
|
|
54
54
|
onClick: e,
|
|
55
55
|
"aria-label": d,
|
|
56
|
-
className: "rst:-m-1 rst:shrink-0 rst:rounded rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
|
|
56
|
+
className: "rst:-m-1 rst:shrink-0 rst:rounded-sm rst:p-1 rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
|
|
57
57
|
children: /* @__PURE__ */ r(c, { icon: w, className: "rst:h-3.5 rst:w-3.5", "aria-hidden": "true" })
|
|
58
58
|
}
|
|
59
59
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),D=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),R=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.cjs"),V=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),h=require("../../../node_modules/@headlessui/react/dist/components/legend/legend.cjs"),e=require("../../../lib/utils.cjs"),p=require("../../../internal/field-invalid.cjs"),Z=require("../../atoms/Checkbox/Checkbox.cjs"),_=require("../../atoms/Eyebrow/Eyebrow.cjs"),j=require("./checkbox-group-variants.cjs"),J=t=>t.length>0&&Array.isArray(t[0].options),K={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},Q=({options:t,value:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),D=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),R=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/fieldset/fieldset.cjs"),V=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),h=require("../../../node_modules/@headlessui/react/dist/components/legend/legend.cjs"),e=require("../../../lib/utils.cjs"),p=require("../../../internal/field-invalid.cjs"),Z=require("../../atoms/Checkbox/Checkbox.cjs"),_=require("../../atoms/Eyebrow/Eyebrow.cjs"),j=require("./checkbox-group-variants.cjs"),J=t=>t.length>0&&Array.isArray(t[0].options),K={sm:"rst:text-xs",md:"rst:text-sm",lg:"rst:text-base"},Q=({options:t,value:o,onChange:k,label:u,helperText:n,errorMessage:i,maxHeight:m,disabled:d=!1,variant:q,size:a="md",columns:N,colorScheme:w,className:I,optionsClassName:G,panelClassName:C,"aria-describedby":E,"aria-invalid":L,...f})=>{const c=!!i,v=p.isFieldInvalid(c,{...f,"aria-invalid":L}),F=p.withoutInvalidProps(f),l=m!==void 0,x=B.useId(),O=[E,n||i?x:void 0].filter(Boolean).join(" ")||void 0,P=(r,b)=>{k(b?[...o,r]:o.filter(A=>A!==r))},S=r=>s.jsxs(R.Field,{disabled:d||r.disabled,className:"rst:flex rst:items-start rst:gap-2",children:[s.jsx(Z.Checkbox,{size:a??"md",colorScheme:w,checked:o.includes(r.value),onChange:b=>P(r.value,b),"aria-invalid":v||void 0,"aria-describedby":c?x:void 0,className:"rst:mt-0.5 rst:shrink-0"}),s.jsxs("div",{className:"rst:flex rst:min-w-0 rst:flex-col",children:[s.jsx(V.Label,{className:e.cn("rst:cursor-pointer rst:select-none rst:px-1 rst:py-0.5","rst:text-[var(--roster-control-text)]","rst:data-disabled:cursor-not-allowed rst:data-disabled:opacity-50",K[a??"md"]),children:r.label}),r.description&&s.jsx(D.Description,{className:"rst:px-1 rst:text-xs rst:text-gray-500 rst:dark:text-gray-400 rst:data-disabled:opacity-50",children:r.description})]})]},r.value),y=r=>s.jsx("div",{className:e.cn(j.checkboxGroupOptionsVariants({columns:N,size:a})),children:r.map(S)});return s.jsxs(g.Fieldset,{disabled:d,className:e.cn("rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",I),...F,"aria-invalid":v||void 0,"aria-describedby":O,children:[u&&s.jsx(h.Legend,{className:"rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50",children:u}),s.jsx("div",{className:e.cn(j.checkboxGroupPanelVariants({variant:q,size:a,error:c}),l&&"rst:overflow-y-auto rst:custom-scrollbar rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",C,G),style:l?{maxHeight:m}:void 0,tabIndex:l?0:void 0,children:J(t)?t.map(r=>s.jsxs(g.Fieldset,{className:"rst:flex rst:flex-col rst:gap-2",children:[s.jsx(h.Legend,{as:_.Eyebrow,weight:"semibold",tone:"default",className:"rst:border-b rst:border-gray-200 rst:pb-1 rst:dark:border-gray-800",children:r.category}),y(r.options)]},r.category)):y(t)}),(n||i)&&s.jsx("p",{id:x,className:e.cn("rst:text-xs rst:text-left",c?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400",d&&"rst:opacity-50"),children:i||n})]})};exports.CheckboxGroup=Q;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import P from "react";
|
|
4
4
|
import { Description as _ } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
5
5
|
import { Field as S } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
|
|
@@ -17,13 +17,13 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
17
17
|
lg: "rst:text-base"
|
|
18
18
|
}, or = ({
|
|
19
19
|
options: s,
|
|
20
|
-
value:
|
|
20
|
+
value: c,
|
|
21
21
|
onChange: k,
|
|
22
|
-
label:
|
|
23
|
-
helperText:
|
|
22
|
+
label: b,
|
|
23
|
+
helperText: l,
|
|
24
24
|
errorMessage: i,
|
|
25
|
-
maxHeight:
|
|
26
|
-
disabled:
|
|
25
|
+
maxHeight: p,
|
|
26
|
+
disabled: n = !1,
|
|
27
27
|
variant: N,
|
|
28
28
|
size: a = "md",
|
|
29
29
|
columns: w,
|
|
@@ -33,16 +33,16 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
33
33
|
panelClassName: L,
|
|
34
34
|
"aria-describedby": j,
|
|
35
35
|
"aria-invalid": A,
|
|
36
|
-
...
|
|
36
|
+
...v
|
|
37
37
|
}) => {
|
|
38
|
-
const
|
|
38
|
+
const o = !!i, u = R(o, { ...v, "aria-invalid": A }), B = V(v), m = p !== void 0, f = P.useId(), C = [j, l || i ? f : void 0].filter(Boolean).join(" ") || void 0, D = (r, x) => {
|
|
39
39
|
k(
|
|
40
|
-
|
|
40
|
+
x ? [...c, r] : c.filter((O) => O !== r)
|
|
41
41
|
);
|
|
42
|
-
}, F = (r) => /* @__PURE__ */
|
|
42
|
+
}, F = (r) => /* @__PURE__ */ d(
|
|
43
43
|
S,
|
|
44
44
|
{
|
|
45
|
-
disabled:
|
|
45
|
+
disabled: n || r.disabled,
|
|
46
46
|
className: "rst:flex rst:items-start rst:gap-2",
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ t(
|
|
@@ -50,13 +50,14 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
50
50
|
{
|
|
51
51
|
size: a ?? "md",
|
|
52
52
|
colorScheme: I,
|
|
53
|
-
checked:
|
|
54
|
-
onChange: (
|
|
55
|
-
"aria-invalid":
|
|
53
|
+
checked: c.includes(r.value),
|
|
54
|
+
onChange: (x) => D(r.value, x),
|
|
55
|
+
"aria-invalid": u || void 0,
|
|
56
|
+
"aria-describedby": o ? f : void 0,
|
|
56
57
|
className: "rst:mt-0.5 rst:shrink-0"
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ d("div", { className: "rst:flex rst:min-w-0 rst:flex-col", children: [
|
|
60
61
|
/* @__PURE__ */ t(
|
|
61
62
|
Z,
|
|
62
63
|
{
|
|
@@ -75,30 +76,30 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
75
76
|
},
|
|
76
77
|
r.value
|
|
77
78
|
), y = (r) => /* @__PURE__ */ t("div", { className: e(K({ columns: w, size: a })), children: r.map(F) });
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ d(
|
|
79
80
|
h,
|
|
80
81
|
{
|
|
81
|
-
disabled:
|
|
82
|
+
disabled: n,
|
|
82
83
|
className: e(
|
|
83
84
|
"rst:font-ui rst:flex rst:flex-col rst:gap-1.5 rst:min-w-0",
|
|
84
85
|
E
|
|
85
86
|
),
|
|
86
87
|
...B,
|
|
87
|
-
"aria-invalid":
|
|
88
|
+
"aria-invalid": u || void 0,
|
|
88
89
|
"aria-describedby": C,
|
|
89
90
|
children: [
|
|
90
|
-
|
|
91
|
+
b && /* @__PURE__ */ t(g, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left rst:data-disabled:opacity-50", children: b }),
|
|
91
92
|
/* @__PURE__ */ t(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
94
95
|
className: e(
|
|
95
|
-
J({ variant: N, size: a, error:
|
|
96
|
+
J({ variant: N, size: a, error: o }),
|
|
96
97
|
m && "rst:overflow-y-auto rst:custom-scrollbar rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",
|
|
97
98
|
/* Deprecated name first, so the current one wins when both are set. */
|
|
98
99
|
L,
|
|
99
100
|
G
|
|
100
101
|
),
|
|
101
|
-
style: m ? { maxHeight:
|
|
102
|
+
style: m ? { maxHeight: p } : void 0,
|
|
102
103
|
tabIndex: m ? 0 : void 0,
|
|
103
104
|
children: Q(s) ? s.map((r) => (
|
|
104
105
|
/* Nested fieldset per category, so the heading is the group's
|
|
@@ -111,7 +112,7 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
111
112
|
`as={Eyebrow}` overrides Legend's own `as="div"` — it is
|
|
112
113
|
spread after — so these render as <span>. The registration is
|
|
113
114
|
what matters and it is unchanged. */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ d(h, { className: "rst:flex rst:flex-col rst:gap-2", children: [
|
|
115
116
|
/* @__PURE__ */ t(
|
|
116
117
|
g,
|
|
117
118
|
{
|
|
@@ -127,16 +128,16 @@ const Q = (s) => s.length > 0 && Array.isArray(s[0].options), U = {
|
|
|
127
128
|
)) : y(s)
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
|
-
(
|
|
131
|
+
(l || i) && /* @__PURE__ */ t(
|
|
131
132
|
"p",
|
|
132
133
|
{
|
|
133
|
-
id:
|
|
134
|
+
id: f,
|
|
134
135
|
className: e(
|
|
135
136
|
"rst:text-xs rst:text-left",
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
o ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400",
|
|
138
|
+
n && "rst:opacity-50"
|
|
138
139
|
),
|
|
139
|
-
children: i ||
|
|
140
|
+
children: i || l
|
|
140
141
|
}
|
|
141
142
|
)
|
|
142
143
|
]
|