@astroapps/aria-base 1.5.1 → 1.6.1
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/.rush/temp/chunked-rush-logs/aria-base.build.chunks.jsonl +8 -3
- package/.rush/temp/chunked-rush-logs/aria-base.watch.chunks.jsonl +2 -2
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/package-deps_watch.json +10 -6
- package/.rush/temp/shrinkwrap-deps.json +0 -3
- package/lib/index.cjs +387 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.js +176 -196
- package/lib/index.js.map +1 -1
- package/package.json +11 -4
- package/src/Select.tsx +1 -1
- package/.rush/temp/package-deps_build.json +0 -18
package/lib/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
1
|
+
import { Button as Button$1, composeRenderProps, Popover as Popover$1, OverlayArrow, Label as Label$1, Text, FieldError as FieldError$1, Group, Input as Input$1, ListBoxItem, ListBoxSection, Header, Collection, Select as Select$1, SelectValue, ListBox } from 'react-aria-components';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { useDialog, useModalOverlay, Overlay, useOverlayTrigger } from 'react-aria';
|
|
4
|
+
import { tv } from 'tailwind-variants';
|
|
5
|
+
import { useOverlayTriggerState } from 'react-stately';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
11
7
|
|
|
12
8
|
function _extends() {
|
|
13
9
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -28,261 +24,266 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
28
24
|
return t;
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
const _excluded$4 = ["children", "className"];
|
|
32
28
|
function Button(_ref) {
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
let {
|
|
30
|
+
children,
|
|
31
|
+
className
|
|
32
|
+
} = _ref,
|
|
35
33
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
36
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement(Button$1, _extends({}, props, {
|
|
37
35
|
className: className
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
}));
|
|
36
|
+
}), composeRenderProps(children, (children, {
|
|
37
|
+
isPending
|
|
38
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, children)));
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const _excluded$3 = ["title", "children"];
|
|
42
|
+
const DefaultDialogClasses = {};
|
|
45
43
|
function Dialog(_ref) {
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let {
|
|
45
|
+
title,
|
|
46
|
+
children
|
|
47
|
+
} = _ref,
|
|
48
48
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className
|
|
52
|
-
titleClass
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
let ref = useRef(null);
|
|
50
|
+
const {
|
|
51
|
+
className,
|
|
52
|
+
titleClass
|
|
53
|
+
} = _extends({}, DefaultDialogClasses, props);
|
|
54
|
+
let {
|
|
55
|
+
dialogProps,
|
|
56
|
+
titleProps
|
|
57
|
+
} = useDialog(props, ref);
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, dialogProps, {
|
|
57
59
|
ref: ref,
|
|
58
60
|
className: className
|
|
59
|
-
}), title && /*#__PURE__*/
|
|
61
|
+
}), title && /*#__PURE__*/React.createElement("h3", _extends({}, titleProps, {
|
|
60
62
|
className: titleClass
|
|
61
63
|
}), title), children);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const _excluded$2 = ["children", "showArrow", "className"];
|
|
67
|
+
const styles$1 = tv({
|
|
66
68
|
base: "font-sans bg-white forced-colors:bg-[Canvas] shadow-2xl rounded-xl bg-clip-padding border border-black/10 text-neutral-700 outline-0",
|
|
67
69
|
variants: {
|
|
68
70
|
isEntering: {
|
|
69
|
-
|
|
71
|
+
true: "animate-in fade-in placement-bottom:slide-in-from-top-1 placement-top:slide-in-from-bottom-1 placement-left:slide-in-from-right-1 placement-right:slide-in-from-left-1 ease-out duration-200"
|
|
70
72
|
},
|
|
71
73
|
isExiting: {
|
|
72
|
-
|
|
74
|
+
true: "animate-out fade-out placement-bottom:slide-out-to-top-1 placement-top:slide-out-to-bottom-1 placement-left:slide-out-to-right-1 placement-right:slide-out-to-left-1 ease-in duration-150"
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
function Popover(_ref) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
let {
|
|
80
|
+
children,
|
|
81
|
+
showArrow,
|
|
82
|
+
className
|
|
83
|
+
} = _ref,
|
|
80
84
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
81
|
-
|
|
82
|
-
return /*#__PURE__*/
|
|
85
|
+
let offset = showArrow ? 12 : 8;
|
|
86
|
+
return /*#__PURE__*/React.createElement(Popover$1, _extends({
|
|
83
87
|
offset: offset
|
|
84
88
|
}, props, {
|
|
85
|
-
className:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
}), showArrow && /*#__PURE__*/React__default["default"].createElement(reactAriaComponents.OverlayArrow, {
|
|
89
|
+
className: composeRenderProps(className, (className, renderProps) => styles$1(_extends({}, renderProps, {
|
|
90
|
+
className
|
|
91
|
+
})))
|
|
92
|
+
}), showArrow && /*#__PURE__*/React.createElement(OverlayArrow, {
|
|
91
93
|
className: "group"
|
|
92
|
-
}, /*#__PURE__*/
|
|
94
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
93
95
|
width: 12,
|
|
94
96
|
height: 12,
|
|
95
97
|
viewBox: "0 0 12 12",
|
|
96
98
|
className: "block fill-white forced-colors:fill-[Canvas] stroke-1 stroke-black/10 forced-colors:stroke-[ButtonBorder] group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90"
|
|
97
|
-
}, /*#__PURE__*/
|
|
99
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
98
100
|
d: "M0 0 L6 6 L12 0"
|
|
99
101
|
}))), children);
|
|
100
102
|
}
|
|
101
|
-
|
|
103
|
+
const DefaultPopoverClasses = {
|
|
102
104
|
underlayClass: "fixed inset-0",
|
|
103
105
|
popoverClass: "bg-white"
|
|
104
106
|
};
|
|
105
107
|
function createOverlayState(ref) {
|
|
106
108
|
return {
|
|
107
109
|
isOpen: ref.value,
|
|
108
|
-
setOpen:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return ref.value = true;
|
|
113
|
-
},
|
|
114
|
-
close: function close() {
|
|
115
|
-
return ref.value = false;
|
|
116
|
-
},
|
|
117
|
-
toggle: function toggle() {
|
|
118
|
-
return ref.value = !ref.value;
|
|
119
|
-
}
|
|
110
|
+
setOpen: o => ref.value = o,
|
|
111
|
+
open: () => ref.value = true,
|
|
112
|
+
close: () => ref.value = false,
|
|
113
|
+
toggle: () => ref.value = !ref.value
|
|
120
114
|
};
|
|
121
115
|
}
|
|
122
116
|
|
|
123
|
-
|
|
117
|
+
const _excluded$1 = ["state", "children", "isDismissable", "isKeyboardDismissDisabled", "shouldCloseOnInteractOutside", "portalContainer"],
|
|
124
118
|
_excluded2 = ["trigger", "children"],
|
|
125
119
|
_excluded3 = ["onPress"],
|
|
126
120
|
_excluded4 = ["children", "footer", "defaultOpen", "isDismissable", "titleClass"];
|
|
127
|
-
|
|
121
|
+
const DefaultModalDialogClasses = {
|
|
128
122
|
underlayClass: "fixed z-[100] inset-0 bg-black bg-opacity-50 flex items-center justify-center backdrop-blur-[2px]",
|
|
129
123
|
containerClass: "relative m-4 p-4 w-3/5 min-w-[400px] max-w-[80%] rounded-lg bg-white shadow-sm"
|
|
130
124
|
};
|
|
131
125
|
function Modal(_ref) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
let {
|
|
127
|
+
state,
|
|
128
|
+
children,
|
|
129
|
+
isDismissable,
|
|
130
|
+
isKeyboardDismissDisabled,
|
|
131
|
+
shouldCloseOnInteractOutside,
|
|
132
|
+
portalContainer
|
|
133
|
+
} = _ref,
|
|
138
134
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
135
|
+
let ref = React.useRef(null);
|
|
136
|
+
let {
|
|
137
|
+
modalProps,
|
|
138
|
+
underlayProps
|
|
139
|
+
} = useModalOverlay({
|
|
140
|
+
isDismissable,
|
|
141
|
+
isKeyboardDismissDisabled,
|
|
142
|
+
shouldCloseOnInteractOutside
|
|
143
|
+
}, state, ref);
|
|
144
|
+
const {
|
|
145
|
+
underlayClass,
|
|
146
|
+
containerClass
|
|
147
|
+
} = _extends({}, DefaultModalDialogClasses, props);
|
|
148
|
+
return /*#__PURE__*/React.createElement(Overlay, {
|
|
151
149
|
portalContainer: portalContainer
|
|
152
|
-
}, /*#__PURE__*/
|
|
150
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
153
151
|
className: underlayClass
|
|
154
|
-
}, underlayProps), /*#__PURE__*/
|
|
152
|
+
}, underlayProps), /*#__PURE__*/React.createElement("div", _extends({}, modalProps, {
|
|
155
153
|
ref: ref,
|
|
156
154
|
className: containerClass
|
|
157
155
|
}), children)));
|
|
158
156
|
}
|
|
159
157
|
function ModalTrigger(_ref2) {
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
let {
|
|
159
|
+
trigger,
|
|
160
|
+
children
|
|
161
|
+
} = _ref2,
|
|
162
162
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
let state = useOverlayTriggerState(_extends({}, props));
|
|
164
|
+
let {
|
|
165
|
+
triggerProps,
|
|
166
|
+
overlayProps
|
|
167
|
+
} = useOverlayTrigger({
|
|
168
|
+
type: "dialog"
|
|
169
|
+
}, state);
|
|
170
|
+
const {
|
|
171
|
+
onPress
|
|
172
|
+
} = triggerProps,
|
|
170
173
|
otherTriggerProps = _objectWithoutPropertiesLoose(triggerProps, _excluded3);
|
|
171
|
-
return /*#__PURE__*/
|
|
174
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, "// TODO: react-19", React.cloneElement(trigger, _extends({}, otherTriggerProps, {
|
|
172
175
|
onClick: onPress
|
|
173
|
-
})), state.isOpen && /*#__PURE__*/
|
|
176
|
+
})), state.isOpen && /*#__PURE__*/React.createElement(Modal, _extends({
|
|
174
177
|
state: state
|
|
175
|
-
}, props),
|
|
178
|
+
}, props), React.cloneElement(children, overlayProps)));
|
|
176
179
|
}
|
|
177
180
|
function ModalDialog(_ref3) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
let {
|
|
182
|
+
children,
|
|
183
|
+
footer,
|
|
184
|
+
defaultOpen = false,
|
|
185
|
+
isDismissable = true,
|
|
186
|
+
titleClass = "text-2xl font-bold"
|
|
187
|
+
} = _ref3,
|
|
184
188
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded4);
|
|
185
|
-
|
|
186
|
-
className
|
|
187
|
-
|
|
189
|
+
const {
|
|
190
|
+
className
|
|
191
|
+
} = _extends({}, DefaultModalDialogClasses, props);
|
|
192
|
+
return /*#__PURE__*/React.createElement(ModalTrigger, _extends({
|
|
188
193
|
defaultOpen: defaultOpen,
|
|
189
194
|
isDismissable: isDismissable
|
|
190
|
-
}, props), /*#__PURE__*/
|
|
195
|
+
}, props), /*#__PURE__*/React.createElement(Dialog, _extends({
|
|
191
196
|
className: className
|
|
192
197
|
}, props), children, footer));
|
|
193
198
|
}
|
|
194
199
|
|
|
195
|
-
|
|
200
|
+
const focusRing = tv({
|
|
196
201
|
base: "outline outline-secondary-600 forced-colors:outline-[Highlight] outline-offset-2",
|
|
197
202
|
variants: {
|
|
198
203
|
isFocusVisible: {
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
false: "outline-0",
|
|
205
|
+
true: "outline-2"
|
|
201
206
|
}
|
|
202
207
|
}
|
|
203
208
|
});
|
|
204
209
|
function composeTailwindRenderProps(className, tw) {
|
|
205
|
-
return
|
|
206
|
-
return tailwindMerge.twMerge(tw, className);
|
|
207
|
-
});
|
|
210
|
+
return composeRenderProps(className, className => twMerge(tw, className));
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
function Label(props) {
|
|
211
|
-
return /*#__PURE__*/
|
|
212
|
-
className:
|
|
214
|
+
return /*#__PURE__*/React.createElement(Label$1, _extends({}, props, {
|
|
215
|
+
className: twMerge("font-sans text-sm text-neutral-600 font-medium cursor-default w-fit", props.className)
|
|
213
216
|
}));
|
|
214
217
|
}
|
|
215
218
|
function Description(props) {
|
|
216
|
-
return /*#__PURE__*/
|
|
219
|
+
return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
|
|
217
220
|
slot: "description",
|
|
218
|
-
className:
|
|
221
|
+
className: twMerge("text-sm text-neutral-600", props.className)
|
|
219
222
|
}));
|
|
220
223
|
}
|
|
221
224
|
function FieldError(props) {
|
|
222
|
-
return /*#__PURE__*/
|
|
225
|
+
return /*#__PURE__*/React.createElement(FieldError$1, _extends({}, props, {
|
|
223
226
|
className: composeTailwindRenderProps(props.className, "text-sm text-red-600 forced-colors:text-[Mark]")
|
|
224
227
|
}));
|
|
225
228
|
}
|
|
226
|
-
|
|
229
|
+
const fieldBorderStyles = tv({
|
|
227
230
|
base: "transition",
|
|
228
231
|
variants: {
|
|
229
232
|
isFocusWithin: {
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
false: "border-neutral-300 hover:border-neutral-400 forced-colors:border-[ButtonBorder]",
|
|
234
|
+
true: "border-neutral-600 forced-colors:border-[Highlight]"
|
|
232
235
|
},
|
|
233
236
|
isInvalid: {
|
|
234
|
-
|
|
237
|
+
true: "border-red-600 forced-colors:border-[Mark]"
|
|
235
238
|
},
|
|
236
239
|
isDisabled: {
|
|
237
|
-
|
|
240
|
+
true: "border-neutral-200 forced-colors:border-[GrayText]"
|
|
238
241
|
}
|
|
239
242
|
}
|
|
240
243
|
});
|
|
241
|
-
|
|
244
|
+
const fieldGroupStyles = tv({
|
|
242
245
|
extend: focusRing,
|
|
243
246
|
base: "group flex items-center h-9 box-border bg-white forced-colors:bg-[Field] border rounded-lg overflow-hidden transition",
|
|
244
247
|
variants: fieldBorderStyles.variants
|
|
245
248
|
});
|
|
246
249
|
function FieldGroup(props) {
|
|
247
|
-
return /*#__PURE__*/
|
|
248
|
-
className:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}));
|
|
252
|
-
})
|
|
250
|
+
return /*#__PURE__*/React.createElement(Group, _extends({}, props, {
|
|
251
|
+
className: composeRenderProps(props.className, (className, renderProps) => fieldGroupStyles(_extends({}, renderProps, {
|
|
252
|
+
className
|
|
253
|
+
})))
|
|
253
254
|
}));
|
|
254
255
|
}
|
|
255
256
|
function Input(props) {
|
|
256
|
-
return /*#__PURE__*/
|
|
257
|
+
return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
|
|
257
258
|
className: composeTailwindRenderProps(props.className, "px-3 py-0 min-h-9 flex-1 min-w-0 border-0 outline outline-0 bg-white font-sans text-sm text-neutral-800 placeholder:text-neutral-600 disabled:text-neutral-200 disabled:placeholder:text-neutral-200 [-webkit-tap-highlight-color:transparent]")
|
|
258
259
|
}));
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
tv({
|
|
262
263
|
extend: focusRing,
|
|
263
264
|
base: "group relative flex items-center gap-8 cursor-default select-none py-1.5 px-2.5 rounded-md will-change-transform text-sm forced-color-adjust-none",
|
|
264
265
|
variants: {
|
|
265
266
|
isSelected: {
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
false: "text-neutral-700 hover:bg-neutral-100 pressed:bg-neutral-100 -outline-offset-2",
|
|
268
|
+
true: "bg-secondary-600 text-white forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] [&:has(+[data-selected])]:rounded-b-none [&+[data-selected]]:rounded-t-none -outline-offset-4 outline-white forced-colors:outline-[HighlightText]"
|
|
268
269
|
},
|
|
269
270
|
isDisabled: {
|
|
270
|
-
|
|
271
|
+
true: "text-neutral-300 forced-colors:text-[GrayText]"
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
|
-
|
|
275
|
+
const dropdownItemStyles = tv({
|
|
275
276
|
base: "group flex items-center gap-4 cursor-default select-none py-2 pl-3 pr-3 selected:pr-1 rounded-lg outline outline-0 text-sm forced-color-adjust-none no-underline [&[href]]:cursor-pointer [-webkit-tap-highlight-color:transparent]",
|
|
276
277
|
variants: {
|
|
277
278
|
isDisabled: {
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
false: "text-neutral-900",
|
|
280
|
+
true: "text-neutral-300 forced-colors:text-[GrayText]"
|
|
280
281
|
},
|
|
281
282
|
isPressed: {
|
|
282
|
-
|
|
283
|
+
true: "bg-neutral-100"
|
|
283
284
|
},
|
|
284
285
|
isFocused: {
|
|
285
|
-
|
|
286
|
+
true: "bg-secondary-600 text-white forced-colors:bg-[Highlight] forced-colors:text-[HighlightText]"
|
|
286
287
|
}
|
|
287
288
|
},
|
|
288
289
|
compoundVariants: [{
|
|
@@ -292,96 +293,75 @@ var dropdownItemStyles = tailwindVariants.tv({
|
|
|
292
293
|
}]
|
|
293
294
|
});
|
|
294
295
|
function DropdownItem(props) {
|
|
295
|
-
|
|
296
|
-
return /*#__PURE__*/
|
|
296
|
+
let textValue = props.textValue || (typeof props.children === "string" ? props.children : undefined);
|
|
297
|
+
return /*#__PURE__*/React.createElement(ListBoxItem, _extends({}, props, {
|
|
297
298
|
textValue: textValue,
|
|
298
299
|
className: dropdownItemStyles
|
|
299
|
-
}),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}));
|
|
300
|
+
}), composeRenderProps(props.children, (children, {
|
|
301
|
+
isSelected
|
|
302
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
303
|
+
className: "flex items-center flex-1 gap-2 font-normal truncate group-selected:font-semibold"
|
|
304
|
+
}, children), /*#__PURE__*/React.createElement("span", {
|
|
305
|
+
className: "flex items-center w-5"
|
|
306
|
+
}, isSelected && /*#__PURE__*/React.createElement("i", {
|
|
307
|
+
className: "w-4 h-4 fa fa-check"
|
|
308
|
+
})))));
|
|
309
309
|
}
|
|
310
310
|
function DropdownSection(props) {
|
|
311
|
-
return /*#__PURE__*/
|
|
311
|
+
return /*#__PURE__*/React.createElement(ListBoxSection, {
|
|
312
312
|
className: "first:-mt-[5px] after:content-[''] after:block after:h-[5px] last:after:hidden"
|
|
313
|
-
}, /*#__PURE__*/
|
|
313
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
314
314
|
className: "text-sm font-semibold text-neutral-500 px-4 py-1 truncate sticky -top-[5px] -mt-px -mx-1 z-10 bg-neutral-100/60 backdrop-blur-md supports-[-moz-appearance:none]:bg-neutral-100 border-y border-y-neutral-200 [&+*]:mt-1"
|
|
315
|
-
}, props.title), /*#__PURE__*/
|
|
315
|
+
}, props.title), /*#__PURE__*/React.createElement(Collection, {
|
|
316
316
|
items: props.items
|
|
317
317
|
}, props.children));
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
const _excluded = ["label", "description", "errorMessage", "children", "items"];
|
|
321
|
+
const styles = tv({
|
|
322
322
|
extend: focusRing,
|
|
323
323
|
base: "flex items-center text-start gap-4 w-full font-sans border border-black/10 cursor-default rounded-lg pl-3 pr-2 h-9 min-w-[72px] transition bg-neutral-50 [-webkit-tap-highlight-color:transparent]",
|
|
324
324
|
variants: {
|
|
325
325
|
isDisabled: {
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
false: "text-neutral-800 hover:bg-neutral-100 pressed:bg-neutral-200 group-invalid:outline group-invalid:outline-red-600 forced-colors:group-invalid:outline-[Mark]",
|
|
327
|
+
true: "border-transparent text-neutral-200 forced-colors:text-[GrayText] bg-neutral-100"
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
function Select(_ref) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
332
|
+
let {
|
|
333
|
+
label,
|
|
334
|
+
description,
|
|
335
|
+
errorMessage,
|
|
336
|
+
children,
|
|
337
|
+
items
|
|
338
|
+
} = _ref,
|
|
337
339
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
338
|
-
return /*#__PURE__*/
|
|
340
|
+
return /*#__PURE__*/React.createElement(Select$1, _extends({}, props, {
|
|
339
341
|
className: composeTailwindRenderProps(props.className, "group flex flex-col gap-1 relative font-sans")
|
|
340
|
-
}), label && /*#__PURE__*/
|
|
342
|
+
}), label && /*#__PURE__*/React.createElement(Label, null, label), /*#__PURE__*/React.createElement(Button$1, {
|
|
341
343
|
className: styles
|
|
342
|
-
}, /*#__PURE__*/
|
|
344
|
+
}, /*#__PURE__*/React.createElement(SelectValue, {
|
|
343
345
|
className: "flex-1 text-sm text-nowrap"
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}), /*#__PURE__*/React__default["default"].createElement("i", {
|
|
346
|
+
}, ({
|
|
347
|
+
selectedText,
|
|
348
|
+
defaultChildren
|
|
349
|
+
}) => selectedText || defaultChildren), /*#__PURE__*/React.createElement("i", {
|
|
349
350
|
"aria-hidden": true,
|
|
350
351
|
className: "w-4 h-4 fa fa-chevron-down text-neutral-600 forced-colors:text-[ButtonText] group-disabled:text-neutral-200 forced-colors:group-disabled:text-[GrayText]"
|
|
351
|
-
})), description && /*#__PURE__*/
|
|
352
|
+
})), description && /*#__PURE__*/React.createElement(Description, null, description), /*#__PURE__*/React.createElement(FieldError, null, errorMessage), /*#__PURE__*/React.createElement(Popover, {
|
|
352
353
|
className: "min-w-(--trigger-width)"
|
|
353
|
-
}, /*#__PURE__*/
|
|
354
|
+
}, /*#__PURE__*/React.createElement(ListBox, {
|
|
354
355
|
items: items,
|
|
355
|
-
className: "outline-hidden box-border p-1 max-h-
|
|
356
|
+
className: "outline-hidden box-border p-1 max-h-96 overflow-auto [clip-path:inset(0_0_0_0_round_.75rem)]"
|
|
356
357
|
}, children)));
|
|
357
358
|
}
|
|
358
359
|
function SelectItem(props) {
|
|
359
|
-
return /*#__PURE__*/
|
|
360
|
+
return /*#__PURE__*/React.createElement(DropdownItem, props);
|
|
360
361
|
}
|
|
361
362
|
function SelectSection(props) {
|
|
362
|
-
return /*#__PURE__*/
|
|
363
|
+
return /*#__PURE__*/React.createElement(DropdownSection, props);
|
|
363
364
|
}
|
|
364
365
|
|
|
365
|
-
|
|
366
|
-
exports.DefaultDialogClasses = DefaultDialogClasses;
|
|
367
|
-
exports.DefaultModalDialogClasses = DefaultModalDialogClasses;
|
|
368
|
-
exports.DefaultPopoverClasses = DefaultPopoverClasses;
|
|
369
|
-
exports.Description = Description;
|
|
370
|
-
exports.Dialog = Dialog;
|
|
371
|
-
exports.FieldError = FieldError;
|
|
372
|
-
exports.FieldGroup = FieldGroup;
|
|
373
|
-
exports.Input = Input;
|
|
374
|
-
exports.Label = Label;
|
|
375
|
-
exports.Modal = Modal;
|
|
376
|
-
exports.ModalDialog = ModalDialog;
|
|
377
|
-
exports.ModalTrigger = ModalTrigger;
|
|
378
|
-
exports.Popover = Popover;
|
|
379
|
-
exports.Select = Select;
|
|
380
|
-
exports.SelectItem = SelectItem;
|
|
381
|
-
exports.SelectSection = SelectSection;
|
|
382
|
-
exports.composeTailwindRenderProps = composeTailwindRenderProps;
|
|
383
|
-
exports.createOverlayState = createOverlayState;
|
|
384
|
-
exports.fieldBorderStyles = fieldBorderStyles;
|
|
385
|
-
exports.fieldGroupStyles = fieldGroupStyles;
|
|
386
|
-
exports.focusRing = focusRing;
|
|
366
|
+
export { Button, DefaultDialogClasses, DefaultModalDialogClasses, DefaultPopoverClasses, Description, Dialog, FieldError, FieldGroup, Input, Label, Modal, ModalDialog, ModalTrigger, Popover, Select, SelectItem, SelectSection, composeTailwindRenderProps, createOverlayState, fieldBorderStyles, fieldGroupStyles, focusRing };
|
|
387
367
|
//# sourceMappingURL=index.js.map
|