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