@plexui/ui 0.57.0 → 0.59.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/dist/es/components/Dialog/Dialog.js +1 -1
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Kbd/Kbd.js +3 -0
- package/dist/es/components/Kbd/Kbd.js.map +1 -1
- package/dist/es/components/Kbd/KbdModifier.js +27 -0
- package/dist/es/components/Kbd/KbdModifier.js.map +1 -0
- package/dist/es/components/Kbd/index.js +1 -0
- package/dist/es/components/Kbd/index.js.map +1 -1
- package/dist/es/components/Progress/Progress.js +18 -1
- package/dist/es/components/Progress/Progress.js.map +1 -1
- package/dist/es/components/Progress/index.js +1 -1
- package/dist/es/components/Progress/index.js.map +1 -1
- package/dist/es/components/RollingNumber/RollingNumber.js +41 -0
- package/dist/es/components/RollingNumber/RollingNumber.js.map +1 -0
- package/dist/es/components/RollingNumber/index.js +2 -0
- package/dist/es/components/RollingNumber/index.js.map +1 -0
- package/dist/es/components/Select/Select.js +6 -3
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +3 -3
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/lib/observeTextareaWidth.js +6 -0
- package/dist/es/lib/observeTextareaWidth.js.map +1 -1
- package/dist/types/components/Kbd/Kbd.d.ts +2 -0
- package/dist/types/components/Kbd/KbdModifier.d.ts +18 -0
- package/dist/types/components/Kbd/index.d.ts +1 -0
- package/dist/types/components/Progress/Progress.d.ts +26 -1
- package/dist/types/components/Progress/index.d.ts +1 -1
- package/dist/types/components/RollingNumber/RollingNumber.d.ts +25 -0
- package/dist/types/components/RollingNumber/index.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +6 -0
- package/dist/types/lib/observeTextareaWidth.d.ts +6 -0
- package/package.json +2 -2
|
@@ -43,8 +43,9 @@ const DefaultMultiTriggerView = ({ values, selectedAll, }) => {
|
|
|
43
43
|
return _jsx(_Fragment, { children: displayValue });
|
|
44
44
|
};
|
|
45
45
|
export const Select = (props) => {
|
|
46
|
-
const { id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, required, value, name, multiple, variant = "outline", size = "md", dropdownIconType = "dropdown", loading = false, clearable = false, disabled = false, placeholder = "Select...", loadingPlaceholder = "Loading...", allSelectedLabel = "All selected", noneLabel = "None", pill: pillProp, listMinWidth, options, actions: propActions = [], side, avoidCollisions = true, onChange, optionClassName, OptionView = DefaultOptionView, TriggerStartIcon, triggerClassName, opticallyAlign, TriggerView: TriggerViewFromProps, searchPlaceholder = "", searchAriaLabel = "Search options", searchSize, searchPredicate = defaultSearchPredicate, searchEmptyMessage = "No results found.", trigger, checkPosition = 'start', } = props;
|
|
46
|
+
const { id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, required, value, name, multiple, variant = "outline", size = "md", dropdownIconType = "dropdown", loading = false, clearable = false, disabled = false, placeholder = "Select...", loadingPlaceholder = "Loading...", allSelectedLabel = "All selected", noneLabel = "None", pill: pillProp, listPill: listPillProp, listMinWidth, options, actions: propActions = [], side, avoidCollisions = true, onChange, optionClassName, OptionView = DefaultOptionView, TriggerStartIcon, triggerClassName, opticallyAlign, TriggerView: TriggerViewFromProps, searchPlaceholder = "", searchAriaLabel = "Search options", searchSize, searchPredicate = defaultSearchPredicate, searchEmptyMessage = "No results found.", trigger, checkPosition = 'start', } = props;
|
|
47
47
|
const pill = useFieldRowPill(pillProp);
|
|
48
|
+
const listPill = listPillProp ?? pill;
|
|
48
49
|
// At the end of a Field row the menu opens from the row's end and fits its options: on a phone
|
|
49
50
|
// the trigger there is only as wide as its value, so a menu of the trigger's width breaks every word.
|
|
50
51
|
// In a `FieldGroup columns` the value starts at the column, and so does its menu.
|
|
@@ -156,6 +157,7 @@ export const Select = (props) => {
|
|
|
156
157
|
noneLabel,
|
|
157
158
|
variant,
|
|
158
159
|
pill,
|
|
160
|
+
listPill,
|
|
159
161
|
size,
|
|
160
162
|
dropdownIconType,
|
|
161
163
|
block,
|
|
@@ -204,6 +206,7 @@ export const Select = (props) => {
|
|
|
204
206
|
noneLabel,
|
|
205
207
|
variant,
|
|
206
208
|
pill,
|
|
209
|
+
listPill,
|
|
207
210
|
size,
|
|
208
211
|
dropdownIconType,
|
|
209
212
|
block,
|
|
@@ -317,7 +320,7 @@ export const SelectTrigger = (props) => {
|
|
|
317
320
|
// Custom Select
|
|
318
321
|
// ============================================================
|
|
319
322
|
const CustomSelect = () => {
|
|
320
|
-
const { loading, disabled, side, align, alignOffset, avoidCollisions, listWidth, listMinWidth, listMaxWidth, trigger,
|
|
323
|
+
const { loading, disabled, side, align, alignOffset, avoidCollisions, listWidth, listMinWidth, listMaxWidth, trigger, listPill, } = useSelectContext();
|
|
321
324
|
const [open, setOpen] = useState(false);
|
|
322
325
|
const floatingBoundary = useFloatingBoundary(open && avoidCollisions, { bottom: 30, top: 30 });
|
|
323
326
|
const selectContentRef = useRef(null);
|
|
@@ -415,7 +418,7 @@ const CustomSelect = () => {
|
|
|
415
418
|
}
|
|
416
419
|
handleOpenChange(nextState);
|
|
417
420
|
}, modal: false, children: [_jsx(Popover.Trigger, { asChild: true, ref: setTrigger, children: trigger ? trigger({ open, onToggle: () => { if (!disabled && !loading)
|
|
418
|
-
setOpen((current) => !current); } }) : _jsx(SelectTrigger, { onOpenChange: handleOpenChange }) }), _jsx(Popover.Portal, { forceMount: true, children: _jsx(TransitionGroup, { className: s.Menu, ...overlayTiming, overlay: true, children: open && (_jsx(Popover.Content, { ref: setContent, forceMount: true, className: s.MenuList, "data-pill":
|
|
421
|
+
setOpen((current) => !current); } }) : _jsx(SelectTrigger, { onOpenChange: handleOpenChange }) }), _jsx(Popover.Portal, { forceMount: true, children: _jsx(TransitionGroup, { className: s.Menu, ...overlayTiming, overlay: true, children: open && (_jsx(Popover.Content, { ref: setContent, forceMount: true, className: s.MenuList, "data-pill": listPill ? "" : undefined, "data-list-width": listWidth === "auto" ? "auto" : undefined, "data-list-sized": typeof listWidth === "number" ? "" : undefined, side: side ?? cover?.side ?? "bottom", sideOffset: cover ? cover.sideOffset : 5, align: align, alignOffset: alignOffset, avoidCollisions: avoidCollisions, ...floatingBoundary,
|
|
419
422
|
// Prevent Radix auto focus so we can handle our own from within <CustomSelectMenu />
|
|
420
423
|
onOpenAutoFocus: preventDefaultHandler,
|
|
421
424
|
// Radix waits until the animation completes before directing focus, which is janky.
|