@ynput/ayon-react-components 1.11.0 → 1.13.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.
@@ -5,7 +5,7 @@ export interface SwitchButtonProps extends Omit<ButtonProps, 'onChange' | 'label
5
5
  label: React.ReactNode;
6
6
  value: boolean;
7
7
  disabled?: boolean;
8
- onClick: () => void;
8
+ onClick?: () => void;
9
9
  variant?: 'primary' | 'secondary' | 'tertiary';
10
10
  pt?: {
11
11
  switch?: InputSwitchProps;
@@ -19,8 +19,8 @@ export interface SearchFilterProps extends Omit<React.HTMLAttributes<HTMLDivElem
19
19
  disabledFilters?: string[];
20
20
  preserveOrderFields?: string[];
21
21
  pt?: {
22
- dropdown?: SearchFilterDropdownProps;
23
- item?: SearchFilterItemProps;
22
+ dropdown?: Partial<SearchFilterDropdownProps>;
23
+ item?: Partial<SearchFilterItemProps>;
24
24
  searchBar?: React.HTMLAttributes<HTMLDivElement>;
25
25
  backdrop?: React.HTMLAttributes<HTMLDivElement>;
26
26
  };
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { Filter, FilterOperator, Option } from '../types';
3
3
  type OnSelectConfig = {
4
4
  confirm?: boolean;
@@ -16,6 +16,7 @@ export interface SearchFilterDropdownProps {
16
16
  isInvertedAllowed?: boolean;
17
17
  operatorChangeable?: boolean;
18
18
  preserveOrderFields?: string[];
19
+ operationsTemplate?: ReactNode;
19
20
  onSelect: (option: Option, config?: OnSelectConfig) => void;
20
21
  onInvert: (id: string) => void;
21
22
  onOperatorChange?: (id: string, operator: FilterOperator) => void;
@@ -23,7 +24,11 @@ export interface SearchFilterDropdownProps {
23
24
  onSwitchFilter?: (direction: 'left' | 'right') => void;
24
25
  pt?: {
25
26
  search?: React.HTMLAttributes<HTMLDivElement>;
26
- item?: React.HTMLAttributes<HTMLLIElement>;
27
+ item?: Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> & {
28
+ onClick?: (event: React.MouseEvent<HTMLLIElement>) => boolean;
29
+ };
30
+ hasSomeOption?: Partial<Option>;
31
+ hasNoOption?: Partial<Option>;
27
32
  };
28
33
  }
29
34
  declare const SearchFilterDropdown: import("react").ForwardRefExoticComponent<SearchFilterDropdownProps & import("react").RefAttributes<HTMLUListElement>>;
@@ -6,6 +6,7 @@ export interface SearchFilterItemProps extends Omit<React.HTMLAttributes<HTMLDiv
6
6
  isEditing?: boolean;
7
7
  isInvertedAllowed?: boolean;
8
8
  isDisabled?: boolean;
9
+ isCompact?: boolean;
9
10
  onEdit?: (id: string) => void;
10
11
  onRemove?: (id: string) => void;
11
12
  onInvert?: (id: string) => void;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ interface UseCompactDisplayProps {
3
+ containerRef: React.RefObject<HTMLElement>;
4
+ contentRef: React.RefObject<HTMLElement>;
5
+ threshold?: number;
6
+ buttonSpace?: number;
7
+ hysteresis?: number;
8
+ dependencies?: any[];
9
+ }
10
+ /**
11
+ * A hook that tracks element widths and determines if a compact display mode should be used
12
+ * based on available space.
13
+ */
14
+ export declare const useCompactDisplay: ({ containerRef, contentRef, threshold, buttonSpace, hysteresis, dependencies, }: UseCompactDisplayProps) => boolean;
15
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type FilterValue = {
2
3
  id: string;
3
4
  label: string;
@@ -32,4 +33,6 @@ export interface Option extends Filter {
32
33
  parentId?: string | null;
33
34
  searchOnly?: boolean;
34
35
  searchLabel?: string;
36
+ contentBefore?: React.ReactNode;
37
+ contentAfter?: React.ReactNode;
35
38
  }