@bmsuisse/ui 0.7.0 → 0.8.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/index.d.ts +62 -1
- package/dist/index.js +326 -81
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -356,6 +356,67 @@ type ComboboxProps = ComboboxSingleProps | ComboboxMultiProps;
|
|
|
356
356
|
*/
|
|
357
357
|
declare function Combobox(props: ComboboxProps): ReactElement;
|
|
358
358
|
|
|
359
|
+
interface TagComboboxOption {
|
|
360
|
+
value: string;
|
|
361
|
+
label: string;
|
|
362
|
+
disabled?: boolean;
|
|
363
|
+
/** Groups this option under a header with the given key, rendered as a bold label
|
|
364
|
+
* plus a tri-state "select all" checkbox (unchecked/checked/indeterminate, reflecting
|
|
365
|
+
* how many of the group's members are selected — toggling it selects or clears the
|
|
366
|
+
* whole group). Options sharing a `group` must be contiguous in `options` — see
|
|
367
|
+
* `Combobox`'s own `group` doc for the same constraint and the reasoning behind it. */
|
|
368
|
+
group?: string;
|
|
369
|
+
}
|
|
370
|
+
interface TagComboboxProps {
|
|
371
|
+
/** The full option list. Filtering happens client-side against `label`,
|
|
372
|
+
* unless `onSearchChange` is given (see below). */
|
|
373
|
+
options: TagComboboxOption[];
|
|
374
|
+
/** Selected options' `value`s. */
|
|
375
|
+
value: string[];
|
|
376
|
+
/** Called with the full updated selection after a toggle or a chip removal. */
|
|
377
|
+
onChange: (value: string[]) => void;
|
|
378
|
+
/** Shown in the field when nothing is selected and nothing is typed. Defaults to `"Select…"`. */
|
|
379
|
+
placeholder?: string;
|
|
380
|
+
/** Shown when the search term matches nothing. Defaults to `"No matches."`. */
|
|
381
|
+
emptyMessage?: string;
|
|
382
|
+
disabled?: boolean;
|
|
383
|
+
/** Shows `loadingMessage` in the option list instead of `emptyMessage`, for a
|
|
384
|
+
* combobox whose `options` are still being fetched (e.g. a server search whose
|
|
385
|
+
* request hasn't resolved yet). Defaults to `false`. */
|
|
386
|
+
loading?: boolean;
|
|
387
|
+
/** Message shown in the option list while `loading` is true. Defaults to `"Loading…"`. */
|
|
388
|
+
loadingMessage?: string;
|
|
389
|
+
className?: string;
|
|
390
|
+
id?: string;
|
|
391
|
+
/** Forwarded to the field, for test targeting (e.g. Playwright/Testing Library). */
|
|
392
|
+
"data-testid"?: string;
|
|
393
|
+
/** Switches the search input to server-driven mode: called with the raw search
|
|
394
|
+
* text on every keystroke, and `options` is rendered as-is instead of being
|
|
395
|
+
* filtered locally against `label`. Omit for the default client-side filtering
|
|
396
|
+
* behavior — see `Combobox`'s own `onSearchChange` for the same contract. */
|
|
397
|
+
onSearchChange?: (search: string) => void;
|
|
398
|
+
/** Portal target for the popover, forwarded to the underlying `PopoverContent`.
|
|
399
|
+
* Needed when the combobox is opened from inside a modal Dialog/Sheet — pass the
|
|
400
|
+
* Dialog/Sheet content element so the popover portals inside it instead of
|
|
401
|
+
* `document.body`, which would otherwise fight with the Dialog's focus trap. */
|
|
402
|
+
container?: ComponentProps<typeof PopoverContent>["container"];
|
|
403
|
+
/** Display label for a group key (`TagComboboxOption.group`). Falls back to the raw
|
|
404
|
+
* key when an entry is missing. Only relevant when at least one option sets `group`. */
|
|
405
|
+
groupLabels?: Record<string, string>;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* A tags-and-search multi-select: selected options render as removable chips
|
|
409
|
+
* inline inside one bordered field, with a search input immediately after
|
|
410
|
+
* the last chip. Typing opens a popover listing matches below the field;
|
|
411
|
+
* picking one adds a chip right where the caret was and clears the search
|
|
412
|
+
* term so the user can keep typing. Complements `Combobox`'s `multiple`
|
|
413
|
+
* mode (a trigger button + a summary count) for the case where every
|
|
414
|
+
* individual selection needs to stay visible and removable at a glance —
|
|
415
|
+
* built on the same `Popover`/keyboard-nav shape rather than forking it,
|
|
416
|
+
* so both patterns share one mental model.
|
|
417
|
+
*/
|
|
418
|
+
declare function TagCombobox({ options, value, onChange, placeholder, emptyMessage, disabled, loading, loadingMessage, className, id, onSearchChange, container, groupLabels, ...rest }: TagComboboxProps): ReactElement;
|
|
419
|
+
|
|
359
420
|
type AlertBoxVariant = "error" | "warning" | "info" | "success";
|
|
360
421
|
interface AlertBoxProps {
|
|
361
422
|
/** Determines the color scheme and the default icon. */
|
|
@@ -572,4 +633,4 @@ declare function useSidebarCollapsed(): boolean;
|
|
|
572
633
|
/** Merges conditional class names, then dedupes conflicting Tailwind utility classes. */
|
|
573
634
|
declare function cn(...inputs: ClassValue[]): string;
|
|
574
635
|
|
|
575
|
-
export { AlertBox, type AlertBoxProps, type AlertBoxVariant, Badge, type BadgeProps, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FormField, type FormFieldProps, FormModal, type FormModalProps, Input, type InputProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, StatusBadge, type StatusBadgeProps, type StatusTone, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, loadingSpinnerIconVariants, sheetVariants, useSidebarCollapsed };
|
|
636
|
+
export { AlertBox, type AlertBoxProps, type AlertBoxVariant, Badge, type BadgeProps, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FormField, type FormFieldProps, FormModal, type FormModalProps, Input, type InputProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, StatusBadge, type StatusBadgeProps, type StatusTone, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagCombobox, type TagComboboxOption, type TagComboboxProps, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, loadingSpinnerIconVariants, sheetVariants, useSidebarCollapsed };
|