mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
chore(react/ribbon): add note types
This commit is contained in:
@@ -11,11 +11,12 @@ interface DropdownProps {
|
||||
children: ComponentChildren;
|
||||
title?: string;
|
||||
dropdownContainerStyle?: CSSProperties;
|
||||
dropdownContainerClassName?: string;
|
||||
hideToggleArrow?: boolean;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export default function Dropdown({ className, buttonClassName, isStatic, children, title, dropdownContainerStyle, hideToggleArrow, disabled }: DropdownProps) {
|
||||
export default function Dropdown({ className, buttonClassName, isStatic, children, title, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, disabled }: DropdownProps) {
|
||||
const dropdownRef = useRef<HTMLDivElement | null>(null);
|
||||
const triggerRef = useRef<HTMLButtonElement | null>(null);
|
||||
|
||||
@@ -68,7 +69,7 @@ export default function Dropdown({ className, buttonClassName, isStatic, childre
|
||||
/>
|
||||
|
||||
<div
|
||||
class={`dropdown-menu ${isStatic ? "static" : undefined}`}
|
||||
class={`dropdown-menu ${isStatic ? "static" : ""} ${dropdownContainerClassName ?? ""} tn-dropdown-list`}
|
||||
style={dropdownContainerStyle}
|
||||
aria-labelledby={ariaId}
|
||||
>
|
||||
|
||||
@@ -75,12 +75,13 @@ interface FormListItemOpts {
|
||||
title?: string;
|
||||
active?: boolean;
|
||||
badges?: FormListBadge[];
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export function FormListItem({ children, icon, value, title, active, badges }: FormListItemOpts) {
|
||||
export function FormListItem({ children, icon, value, title, active, badges, disabled }: FormListItemOpts) {
|
||||
return (
|
||||
<a
|
||||
class={`dropdown-item ${active ? "active" : ""}`}
|
||||
class={`dropdown-item ${active ? "active" : ""} ${disabled ? "disabled" : ""}`}
|
||||
data-value={value} title={title}
|
||||
tabIndex={0}
|
||||
>
|
||||
@@ -104,3 +105,7 @@ export function FormListHeader({ text }: FormListHeaderOpts) {
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
export function FormDivider() {
|
||||
return <div className="dropdown-divider" />;
|
||||
}
|
||||
Reference in New Issue
Block a user