Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiselect to combobox #1325

Merged
merged 21 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 218 additions & 107 deletions lib/platform-bible-react/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs.map

Large diffs are not rendered by default.

33 changes: 31 additions & 2 deletions lib/platform-bible-react/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,23 @@ export declare const inventoryCountColumn: (countLabel: string) => ColumnDef<Inv
* current status of the item is selected
*/
export declare const inventoryStatusColumn: (statusLabel: string, approvedItems: string[], onApprovedItemsChange: (items: string[]) => void, unapprovedItems: string[], onUnapprovedItemsChange: (items: string[]) => void) => ColumnDef<InventoryTableData>;
export type MultiSelectComboBoxEntry = {
value: string;
label: string;
starred?: boolean;
};
export interface MultiSelectComboBoxProps {
entries: MultiSelectComboBoxEntry[];
getEntriesCount?: (option: MultiSelectComboBoxEntry) => number;
selected: string[];
onChange: (values: string[]) => void;
placeholder: string;
commandEmptyMessage?: string;
customSelectedText?: string;
sortSelected?: boolean;
icon?: React$1.ReactNode;
}
export declare function MultiSelectComboBox({ entries, getEntriesCount, selected, onChange, placeholder, commandEmptyMessage, customSelectedText, sortSelected, icon, }: MultiSelectComboBoxProps): import("react/jsx-runtime").JSX.Element;
export type TabKeyValueContent = {
key: string;
value: string;
Expand Down Expand Up @@ -677,6 +694,8 @@ export type ComboBoxProps<T> = {
onChange?: (newValue: T) => void;
/** Used to determine the string value for a given option. */
getOptionLabel?: (option: ComboBoxOption) => string;
/** Icon to be displayed on the trigger */
icon?: React$1.ReactNode;
/** Text displayed on button if `value` is undefined */
buttonPlaceholder?: string;
/** Placeholder text for text field */
Expand All @@ -685,6 +704,8 @@ export type ComboBoxProps<T> = {
commandEmptyMessage?: string;
/** Variant of button */
buttonVariant?: ButtonProps["variant"];
/** Control how the popover menu should be aligned. Defaults to start */
alignDropDown?: "start" | "center" | "end";
/** Text direction ltr or rtl */
dir?: Direction;
/** Optional boolean to set if trigger should be disabled */
Expand All @@ -697,7 +718,7 @@ export type Direction = "ltr" | "rtl";
* Thanks to Shadcn for heavy inspiration and documentation
* https://ui.shadcn.com/docs/components/combobox
*/
export declare function ComboBox<T extends ComboBoxOption = ComboBoxOption>({ id, options, className, value, onChange, getOptionLabel, buttonPlaceholder, textPlaceholder, commandEmptyMessage, buttonVariant, dir, isDisabled, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
export declare function ComboBox<T extends ComboBoxOption = ComboBoxOption>({ id, options, className, value, onChange, getOptionLabel, icon, buttonPlaceholder, textPlaceholder, commandEmptyMessage, buttonVariant, alignDropDown, dir, isDisabled, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
export type MenuItemInfoBase = {
/** Text (displayable in the UI) as the name of the menu item */
label: string;
Expand Down Expand Up @@ -896,8 +917,10 @@ export type SearchBarProps = {
placeholder?: string;
/** Optional boolean to set the input base to full width */
isFullWidth?: boolean;
/** ClassName for the input */
className?: string;
};
export function SearchBar({ onSearch, placeholder, isFullWidth }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
export function SearchBar({ onSearch, placeholder, isFullWidth, className, }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
export type SpinnerProps = LucideProps;
export declare const Spinner: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
export type TextFieldProps = {
Expand Down Expand Up @@ -972,6 +995,12 @@ export declare const Alert: React$1.ForwardRefExoticComponent<React$1.HTMLAttrib
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLDivElement>>;
export declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLParagraphElement>>;
export declare const AlertDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
export declare const badgeVariants: (props?: ({
variant?: "default" | "outline" | "muted" | "destructive" | "secondary" | null | undefined;
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
export interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
}
export declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
export declare const Card: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
export declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
export declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLParagraphElement>>;
Expand Down
Loading
Loading