@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,81 +1,82 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { Combobox as
|
|
6
|
-
import { Description as
|
|
7
|
-
import { Field as
|
|
8
|
-
import { Label as
|
|
9
|
-
import { Transition as
|
|
10
|
-
import { FontAwesomeIcon as
|
|
11
|
-
import { faChevronDown as
|
|
3
|
+
import * as U from "react";
|
|
4
|
+
import { Fragment as _ } from "react";
|
|
5
|
+
import { Combobox as H, ComboboxInput as S, ComboboxButton as j, ComboboxOptions as A, ComboboxOption as v } from "../../../node_modules/@headlessui/react/dist/components/combobox/combobox.js";
|
|
6
|
+
import { Description as R } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
7
|
+
import { Field as T } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
|
|
8
|
+
import { Label as q } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
|
|
9
|
+
import { Transition as B } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
10
|
+
import { FontAwesomeIcon as E } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
11
|
+
import { faChevronDown as V } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
12
12
|
import { cn as e } from "../../../lib/utils.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
13
|
+
import { isFieldInvalid as W, withoutInvalidProps as K } from "../../../internal/field-invalid.js";
|
|
14
|
+
import { inputVariants as Q } from "../Input/input-variants.js";
|
|
15
|
+
import { PopupOption as Z } from "../../../internal/PopupOption.js";
|
|
16
|
+
import { useDarkScope as G, POPUP_ANCHOR as J, POPUP_WIDTH_OF_INPUT as X, POPUP_PANEL as Y, popupInDarkPalette as $ } from "../../../internal/popup.js";
|
|
17
|
+
const M = (s, o) => {
|
|
17
18
|
const a = o.trim().toLowerCase();
|
|
18
|
-
return a ? s.filter((
|
|
19
|
-
},
|
|
19
|
+
return a ? s.filter((l) => l.label.toLowerCase().includes(a)) : s;
|
|
20
|
+
}, ft = ({
|
|
20
21
|
options: s,
|
|
21
22
|
value: o,
|
|
22
23
|
onChange: a,
|
|
23
|
-
placeholder:
|
|
24
|
+
placeholder: l = "Search...",
|
|
24
25
|
disabled: c = !1,
|
|
25
|
-
variant:
|
|
26
|
-
size:
|
|
27
|
-
error:
|
|
28
|
-
label:
|
|
26
|
+
variant: d,
|
|
27
|
+
size: i,
|
|
28
|
+
error: P,
|
|
29
|
+
label: p,
|
|
29
30
|
helperText: f,
|
|
30
|
-
errorMessage:
|
|
31
|
+
errorMessage: n,
|
|
31
32
|
className: y,
|
|
32
33
|
inputClassName: N,
|
|
33
|
-
optionsClassName:
|
|
34
|
-
emptyMessage:
|
|
35
|
-
filter:
|
|
36
|
-
...
|
|
34
|
+
optionsClassName: C,
|
|
35
|
+
emptyMessage: k = "No matches",
|
|
36
|
+
filter: g = M,
|
|
37
|
+
...u
|
|
37
38
|
}) => {
|
|
38
|
-
const [O,
|
|
39
|
+
const [O, x] = U.useState(""), { ref: w, inDarkScope: F } = G(), m = !!n || P, I = W(m, u), D = K(u), h = g(s, O), L = s.find((r) => r.value === o) ?? null;
|
|
39
40
|
return /* @__PURE__ */ b(
|
|
40
|
-
|
|
41
|
+
T,
|
|
41
42
|
{
|
|
42
43
|
disabled: c,
|
|
43
44
|
className: e("rst:flex rst:flex-col rst:gap-1.5", y),
|
|
44
|
-
...
|
|
45
|
+
...D,
|
|
45
46
|
children: [
|
|
46
|
-
|
|
47
|
+
p && /* @__PURE__ */ t(q, { className: "rst:block rst:text-sm rst:font-medium rst:text-[var(--roster-control-text)] rst:text-left", children: p }),
|
|
47
48
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
49
|
+
H,
|
|
49
50
|
{
|
|
50
51
|
value: o ?? null,
|
|
51
52
|
onChange: a,
|
|
52
53
|
disabled: c,
|
|
53
54
|
children: /* @__PURE__ */ b("div", { ref: w, className: "rst:relative", children: [
|
|
54
55
|
/* @__PURE__ */ t(
|
|
55
|
-
|
|
56
|
+
S,
|
|
56
57
|
{
|
|
57
|
-
"aria-invalid":
|
|
58
|
+
"aria-invalid": I || void 0,
|
|
58
59
|
className: e(
|
|
59
|
-
|
|
60
|
+
Q({ variant: d, size: i, error: m }),
|
|
60
61
|
N,
|
|
61
62
|
"rst:pr-9"
|
|
62
63
|
),
|
|
63
|
-
placeholder:
|
|
64
|
-
displayValue: () =>
|
|
65
|
-
onChange: (r) =>
|
|
64
|
+
placeholder: l,
|
|
65
|
+
displayValue: () => L?.label ?? "",
|
|
66
|
+
onChange: (r) => x(r.target.value)
|
|
66
67
|
}
|
|
67
68
|
),
|
|
68
69
|
/* @__PURE__ */ t(
|
|
69
|
-
|
|
70
|
+
j,
|
|
70
71
|
{
|
|
71
72
|
className: e(
|
|
72
73
|
"rst:absolute rst:inset-y-0 rst:right-0 rst:flex rst:w-11 rst:cursor-pointer rst:items-center rst:justify-end",
|
|
73
|
-
|
|
74
|
+
i === "sm" ? "rst:pr-2.5" : "rst:pr-3"
|
|
74
75
|
),
|
|
75
76
|
children: /* @__PURE__ */ t(
|
|
76
|
-
|
|
77
|
+
E,
|
|
77
78
|
{
|
|
78
|
-
icon:
|
|
79
|
+
icon: V,
|
|
79
80
|
className: "rst:h-3.5 rst:w-3.5 rst:text-gray-400 rst:dark:text-gray-500",
|
|
80
81
|
"aria-hidden": "true"
|
|
81
82
|
}
|
|
@@ -83,43 +84,43 @@ const J = (s, o) => {
|
|
|
83
84
|
}
|
|
84
85
|
),
|
|
85
86
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
87
|
+
B,
|
|
87
88
|
{
|
|
88
|
-
as:
|
|
89
|
+
as: _,
|
|
89
90
|
leave: "rst:transition rst:ease-in rst:duration-100",
|
|
90
91
|
leaveFrom: "rst:opacity-100",
|
|
91
92
|
leaveTo: "rst:opacity-0",
|
|
92
|
-
afterLeave: () =>
|
|
93
|
+
afterLeave: () => x(""),
|
|
93
94
|
children: /* @__PURE__ */ t(
|
|
94
|
-
|
|
95
|
+
A,
|
|
95
96
|
{
|
|
96
|
-
anchor:
|
|
97
|
+
anchor: J,
|
|
97
98
|
className: e(
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
$(F, d) && "dark",
|
|
100
|
+
Y,
|
|
100
101
|
/* `--input-width`, not `--button-width`: the button here is
|
|
101
102
|
the chevron, so matching it renders a 20px sliver. */
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
X,
|
|
104
|
+
C
|
|
104
105
|
),
|
|
105
|
-
children:
|
|
106
|
-
|
|
106
|
+
children: h.length === 0 ? /* @__PURE__ */ t(
|
|
107
|
+
v,
|
|
107
108
|
{
|
|
108
109
|
value: "",
|
|
109
110
|
disabled: !0,
|
|
110
111
|
className: e(
|
|
111
112
|
"rst:px-4 rst:py-2.5 rst:text-sm rst:opacity-70",
|
|
112
|
-
|
|
113
|
+
i === "sm" && "rst:px-3 rst:py-2"
|
|
113
114
|
),
|
|
114
|
-
children:
|
|
115
|
+
children: k
|
|
115
116
|
}
|
|
116
|
-
) :
|
|
117
|
-
|
|
117
|
+
) : h.map((r) => /* @__PURE__ */ t(
|
|
118
|
+
Z,
|
|
118
119
|
{
|
|
119
|
-
as:
|
|
120
|
+
as: v,
|
|
120
121
|
value: r.value,
|
|
121
122
|
disabled: r.disabled,
|
|
122
|
-
size:
|
|
123
|
+
size: i,
|
|
123
124
|
children: r.label
|
|
124
125
|
},
|
|
125
126
|
r.value
|
|
@@ -131,14 +132,14 @@ const J = (s, o) => {
|
|
|
131
132
|
] })
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
|
-
(f ||
|
|
135
|
-
|
|
135
|
+
(f || n) && /* @__PURE__ */ t(
|
|
136
|
+
R,
|
|
136
137
|
{
|
|
137
138
|
className: e(
|
|
138
139
|
"rst:text-xs rst:text-left",
|
|
139
|
-
|
|
140
|
+
m ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
|
|
140
141
|
),
|
|
141
|
-
children:
|
|
142
|
+
children: n || f
|
|
142
143
|
}
|
|
143
144
|
)
|
|
144
145
|
]
|
|
@@ -146,5 +147,5 @@ const J = (s, o) => {
|
|
|
146
147
|
);
|
|
147
148
|
};
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
+
ft as Combobox
|
|
150
151
|
};
|
|
@@ -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-mono rst:text-[0.8125rem]",{variants:{colorScheme:{primary:"rst:text-primary-600 rst:dark:text-primary-400",neutral:"rst:text-gray-800 rst:dark:text-gray-200",current:"rst:text-current"},surface:{none:"",soft:"rst:rounded rst:bg-gray-100 rst:px-1 rst:py-0.5 rst:dark:bg-gray-800"}},defaultVariants:{colorScheme:"primary",surface:"none"}});exports.inlineCodeVariants=t;
|
|
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-mono rst:text-[0.8125rem]",{variants:{colorScheme:{primary:"rst:text-primary-600 rst:dark:text-primary-400",neutral:"rst:text-gray-800 rst:dark:text-gray-200",current:"rst:text-current"},surface:{none:"",soft:"rst:rounded-sm rst:bg-gray-100 rst:px-1 rst:py-0.5 rst:dark:bg-gray-800"}},defaultVariants:{colorScheme:"primary",surface:"none"}});exports.inlineCodeVariants=t;
|
|
@@ -8,7 +8,7 @@ const e = /* @__PURE__ */ r("rst:font-mono rst:text-[0.8125rem]", {
|
|
|
8
8
|
},
|
|
9
9
|
surface: {
|
|
10
10
|
none: "",
|
|
11
|
-
soft: "rst:rounded rst:bg-gray-100 rst:px-1 rst:py-0.5 rst:dark:bg-gray-800"
|
|
11
|
+
soft: "rst:rounded-sm rst:bg-gray-100 rst:px-1 rst:py-0.5 rst:dark:bg-gray-800"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: { colorScheme: "primary", surface: "none" }
|
|
@@ -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 t=require("react/jsx-runtime"),y=require("react"),g=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),w=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),V=require("../../../node_modules/@headlessui/react/dist/components/input/input.cjs"),k=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),r=require("../../../lib/utils.cjs"),a=require("./input-variants.cjs"),p=require("../../../internal/field-invalid.cjs"),x=y.forwardRef(({className:f,type:j,label:o,helperText:u,errorMessage:e,variant:i,size:n,error:q,startIcon:l,endIcon:c,disabled:d,inputClassName:h,...m},v)=>{const s=!!e||q,N=p.isFieldInvalid(s,m),b=p.withoutInvalidProps(m);return t.jsxs(w.Field,{disabled:d,className:r.cn("rst:w-full",f),children:[o&&t.jsx(k.Label,{className:r.cn("rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors","rst:text-[var(--roster-control-text)]","rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70"),children:o}),t.jsxs("div",{className:"rst:relative",children:[l&&t.jsx("div",{className:r.cn(a.iconVariants({variant:i,error:s}),"rst:left-3"),children:l}),t.jsx(V.Input,{ref:v,type:j,disabled:d,className:r.cn(a.inputVariants({variant:i,size:n,error:s}),l&&(n==="sm"?"rst:pl-9":"rst:pl-10"),c&&(n==="sm"?"rst:pr-9":"rst:pr-10"),h),...b,invalid:N}),c&&t.jsx("div",{className:r.cn(a.iconVariants({variant:i,error:s}),"rst:right-3"),children:c})]}),(u||e)&&t.jsx(g.Description,{className:r.cn("rst:text-xs rst:text-left rst:mt-1.5",s?"rst:text-error-600 rst:dark:text-error-400 rst:font-medium":"rst:text-gray-500 rst:dark:text-gray-400"),children:e||u})]})});x.displayName="Input";exports.Input=x;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { Description as
|
|
5
|
-
import { Field as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Label as
|
|
2
|
+
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import b from "react";
|
|
4
|
+
import { Description as k } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
5
|
+
import { Field as g } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
|
|
6
|
+
import { Input as j } from "../../../node_modules/@headlessui/react/dist/components/input/input.js";
|
|
7
|
+
import { Label as F } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
|
|
8
8
|
import { cn as r } from "../../../lib/utils.js";
|
|
9
|
-
import { iconVariants as f, inputVariants as
|
|
10
|
-
|
|
9
|
+
import { iconVariants as f, inputVariants as P } from "./input-variants.js";
|
|
10
|
+
import { isFieldInvalid as R, withoutInvalidProps as V } from "../../../internal/field-invalid.js";
|
|
11
|
+
const _ = b.forwardRef(
|
|
11
12
|
({
|
|
12
|
-
className:
|
|
13
|
-
type:
|
|
14
|
-
label:
|
|
15
|
-
helperText:
|
|
16
|
-
errorMessage:
|
|
17
|
-
variant:
|
|
18
|
-
size:
|
|
19
|
-
error:
|
|
20
|
-
startIcon:
|
|
21
|
-
endIcon:
|
|
22
|
-
disabled:
|
|
13
|
+
className: u,
|
|
14
|
+
type: x,
|
|
15
|
+
label: l,
|
|
16
|
+
helperText: n,
|
|
17
|
+
errorMessage: e,
|
|
18
|
+
variant: o,
|
|
19
|
+
size: i,
|
|
20
|
+
error: h,
|
|
21
|
+
startIcon: m,
|
|
22
|
+
endIcon: a,
|
|
23
|
+
disabled: c,
|
|
23
24
|
inputClassName: N,
|
|
24
|
-
...
|
|
25
|
-
},
|
|
26
|
-
const
|
|
27
|
-
"aria-invalid": m,
|
|
28
|
-
invalid: b,
|
|
29
|
-
...k
|
|
30
|
-
} = h, w = !!b || m !== void 0 && m !== !1 && m !== "false";
|
|
25
|
+
...d
|
|
26
|
+
}, v) => {
|
|
27
|
+
const t = !!e || h, w = R(t, d), y = V(d);
|
|
31
28
|
return (
|
|
32
29
|
/* No `space-y-*` here, deliberately. Headless UI's Field appends a
|
|
33
30
|
hidden zero-height <span> after the control, and Tailwind v4 applies
|
|
@@ -42,73 +39,73 @@ const D = g.forwardRef(
|
|
|
42
39
|
DisabledProvider stays false and the Label and Description never dim.
|
|
43
40
|
Fixed in both rather than one, because a form with a disabled Input
|
|
44
41
|
and a disabled Select that grey differently is worse than neither. */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
/* @__PURE__ */ p(g, { disabled: c, className: r("rst:w-full", u), children: [
|
|
43
|
+
l && /* @__PURE__ */ s(
|
|
44
|
+
F,
|
|
48
45
|
{
|
|
49
46
|
className: r(
|
|
50
47
|
"rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors",
|
|
51
48
|
"rst:text-[var(--roster-control-text)]",
|
|
52
49
|
"rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70"
|
|
53
50
|
),
|
|
54
|
-
children:
|
|
51
|
+
children: l
|
|
55
52
|
}
|
|
56
53
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
54
|
+
/* @__PURE__ */ p("div", { className: "rst:relative", children: [
|
|
55
|
+
m && /* @__PURE__ */ s(
|
|
59
56
|
"div",
|
|
60
57
|
{
|
|
61
58
|
className: r(
|
|
62
|
-
f({ variant:
|
|
59
|
+
f({ variant: o, error: t }),
|
|
63
60
|
"rst:left-3"
|
|
64
61
|
),
|
|
65
|
-
children:
|
|
62
|
+
children: m
|
|
66
63
|
}
|
|
67
64
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
65
|
+
/* @__PURE__ */ s(
|
|
66
|
+
j,
|
|
70
67
|
{
|
|
71
|
-
ref:
|
|
72
|
-
type:
|
|
73
|
-
disabled:
|
|
68
|
+
ref: v,
|
|
69
|
+
type: x,
|
|
70
|
+
disabled: c,
|
|
74
71
|
className: r(
|
|
75
|
-
|
|
72
|
+
P({ variant: o, size: i, error: t }),
|
|
76
73
|
/* Icon inset tracks the size's own padding: sm is px-3, so it
|
|
77
74
|
needs one step less clearance than the 16px sizes. */
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
m && (i === "sm" ? "rst:pl-9" : "rst:pl-10"),
|
|
76
|
+
a && (i === "sm" ? "rst:pr-9" : "rst:pr-10"),
|
|
80
77
|
N
|
|
81
78
|
),
|
|
82
|
-
...
|
|
79
|
+
...y,
|
|
83
80
|
invalid: w
|
|
84
81
|
}
|
|
85
82
|
),
|
|
86
|
-
|
|
83
|
+
a && /* @__PURE__ */ s(
|
|
87
84
|
"div",
|
|
88
85
|
{
|
|
89
86
|
className: r(
|
|
90
|
-
f({ variant:
|
|
87
|
+
f({ variant: o, error: t }),
|
|
91
88
|
"rst:right-3"
|
|
92
89
|
),
|
|
93
|
-
children:
|
|
90
|
+
children: a
|
|
94
91
|
}
|
|
95
92
|
)
|
|
96
93
|
] }),
|
|
97
|
-
(
|
|
98
|
-
|
|
94
|
+
(n || e) && /* @__PURE__ */ s(
|
|
95
|
+
k,
|
|
99
96
|
{
|
|
100
97
|
className: r(
|
|
101
98
|
"rst:text-xs rst:text-left rst:mt-1.5",
|
|
102
|
-
|
|
99
|
+
t ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
|
|
103
100
|
),
|
|
104
|
-
children:
|
|
101
|
+
children: e || n
|
|
105
102
|
}
|
|
106
103
|
)
|
|
107
104
|
] })
|
|
108
105
|
);
|
|
109
106
|
}
|
|
110
107
|
);
|
|
111
|
-
|
|
108
|
+
_.displayName = "Input";
|
|
112
109
|
export {
|
|
113
|
-
|
|
110
|
+
_ as Input
|
|
114
111
|
};
|
|
@@ -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:rounded-md rst:border rst:h-10 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:file:border-0 rst:file:bg-transparent rst:file:text-sm rst:file:font-medium 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-all",{variants:{variant:{white:"rst:border-gray-300 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-
|
|
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:rounded-md rst:border rst:h-10 rst:px-4 rst:text-sm rst:ring-offset-background rst:focus-visible:ring-offset-2 rst:file:border-0 rst:file:bg-transparent rst:file:text-sm rst:file:font-medium 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-all",{variants:{variant:{white:"rst:border-gray-300 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:focus-visible:border-primary-500 rst:dark:border-gray-700 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400",soft:"rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:focus-visible:border-primary-400 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400 rst:dark:focus-visible:bg-gray-900",slate:"rst:border-transparent rst:bg-gray-700 rst:text-gray-100 rst:placeholder:text-gray-300 rst:focus-visible:bg-gray-600 rst:dark:bg-gray-900 rst:dark:placeholder:text-gray-400 rst:dark:focus-visible:bg-gray-800",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)]",ghost:"rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800"},size:{sm:"rst:h-9 rst:px-3",default:"rst:h-10 rst:px-4",lg:"rst:h-11 rst:px-4"},error:{true:"rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-600 rst:dark:border-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:absolute rst:top-1/2 rst:-translate-y-1/2 rst:transition-colors",{variants:{variant:{white:"rst:text-gray-400 rst:dark:text-gray-500",soft:"rst:text-gray-500 rst:dark:text-gray-400",slate:"rst:text-gray-300 rst:dark:text-gray-500",outline:"rst:text-gray-400 rst:dark:text-gray-500",ghost:"rst:text-gray-500 rst:dark:text-gray-400"},error:{true:"rst:text-error-500 rst:dark:text-error-400",false:""}},defaultVariants:{variant:"outline",error:!1}});exports.iconVariants=s;exports.inputVariants=t;
|
|
@@ -9,7 +9,7 @@ const s = /* @__PURE__ */ r(
|
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
white: "rst:border-gray-300 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-
|
|
12
|
+
white: "rst:border-gray-300 rst:bg-white rst:text-gray-900 rst:placeholder:text-gray-500 rst:focus-visible:border-primary-500 rst:dark:border-gray-700 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400",
|
|
13
13
|
/* A boundary that does not depend on what is behind it. `soft` used
|
|
14
14
|
`border-transparent` and leaned on its fill alone, which fails the
|
|
15
15
|
moment the fill matches the surface — exactly 1.00:1 inside a
|
|
@@ -17,8 +17,8 @@ const s = /* @__PURE__ */ r(
|
|
|
17
17
|
vanished until focus. Reported twice in one app before anyone read
|
|
18
18
|
the variant. The border is the same token `outline` reads, so a
|
|
19
19
|
consumer repaints both at once. */
|
|
20
|
-
soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-
|
|
21
|
-
slate: "rst:border-transparent rst:bg-gray-700 rst:text-gray-100 rst:placeholder:text-gray-
|
|
20
|
+
soft: "rst:border-[var(--roster-control-border)] rst:bg-gray-100 rst:text-gray-900 rst:placeholder:text-gray-500 rst:focus-visible:bg-white rst:focus-visible:border-primary-500 rst:dark:focus-visible:border-primary-400 rst:dark:bg-gray-800 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400 rst:dark:focus-visible:bg-gray-900",
|
|
21
|
+
slate: "rst:border-transparent rst:bg-gray-700 rst:text-gray-100 rst:placeholder:text-gray-300 rst:focus-visible:bg-gray-600 rst:dark:bg-gray-900 rst:dark:placeholder:text-gray-400 rst:dark:focus-visible:bg-gray-800",
|
|
22
22
|
/* The default variant, and the only one that reads tokens.
|
|
23
23
|
`Button`'s colors resolve through `--roster-*`, so remapping a palette
|
|
24
24
|
carries; these were hardcoded, so a consumer wanting a field border in
|
|
@@ -33,9 +33,19 @@ const s = /* @__PURE__ */ r(
|
|
|
33
33
|
know, and `soft` leaning on fill alone made it invisible at 1.00:1
|
|
34
34
|
inside a `white` Dialog in dark mode. `white`, `slate` and `ghost`
|
|
35
35
|
stay fully opinionated — each names a specific surface, and a token
|
|
36
|
-
that meant something different in each would not be a token.
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
that meant something different in each would not be a token.
|
|
37
|
+
|
|
38
|
+
Placeholders have to reach 4.5:1; gray-400, which every variant
|
|
39
|
+
used, is 2.52:1 on white. Here the placeholder is the text token at
|
|
40
|
+
65%, so it follows whatever surface the text was chosen for (5.46:1
|
|
41
|
+
on a white page, 7.76 on the dark one, 5.02 inside the `slate`
|
|
42
|
+
Dialog, where a fixed gray-500 would fall to 1.71; measured
|
|
43
|
+
rendered, src/fills-and-fields.checks.stories.tsx). The opinionated
|
|
44
|
+
variants name a step per scheme instead, measured on their own
|
|
45
|
+
fill. An error leaves the placeholder alone: a red that passes is
|
|
46
|
+
too close to the typed text's red to tell them apart. */
|
|
47
|
+
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)]",
|
|
48
|
+
ghost: "rst:border-transparent rst:bg-transparent rst:text-gray-900 rst:placeholder:text-gray-500 rst:hover:bg-gray-100 rst:focus-visible:bg-gray-100 rst:dark:text-gray-100 rst:dark:placeholder:text-gray-400 rst:dark:hover:bg-gray-800 rst:dark:focus-visible:bg-gray-800"
|
|
39
49
|
},
|
|
40
50
|
/* Deliberately the same three heights as Button: h-9 / h-10 / h-11.
|
|
41
51
|
Input was a fixed 42px, which agreed with Button at no size at all, so
|
|
@@ -51,7 +61,7 @@ const s = /* @__PURE__ */ r(
|
|
|
51
61
|
lg: "rst:h-11 rst:px-4"
|
|
52
62
|
},
|
|
53
63
|
error: {
|
|
54
|
-
true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-600 rst:
|
|
64
|
+
true: "rst:border-error-500 rst:focus-visible:ring-error-500 rst:text-error-600 rst:dark:border-error-500 rst:dark:text-error-400 rst:dark:focus-visible:ring-error-400",
|
|
55
65
|
false: ""
|
|
56
66
|
}
|
|
57
67
|
},
|
|
@@ -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"),
|
|
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;
|