@l3mpire/ui 2.11.0 → 2.12.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/USAGE.md CHANGED
@@ -946,12 +946,15 @@ import {
946
946
  | `SummaryChip` | Minimal mode: "Filters (N)" with interactive popover |
947
947
 
948
948
  **Responsive:** FilterSystem auto-detects container width via `ResizeObserver`:
949
- - **Default** (>600px): full chips, labels, "Filters" button
950
- - **Minimal** (≤600px): SummaryChip "Filters (N)" with interactive popover, icon-only Sort/Filter buttons
949
+ - **Default** (>breakpoint): full chips, labels, "Filters" button
950
+ - **Minimal** (≤breakpoint): SummaryChip "Filters (N)" with interactive popover, icon-only Sort/Filter buttons
951
+ - The breakpoint is configurable via the `breakpoint` prop on `FilterSystem` (default: `600`).
951
952
 
952
953
  **Built-in Clear:** appears inline after the last filter chip ("Clear" text in default, × icon in minimal). Separate from "Discard changes" which goes in `actions` (right side) to revert a saved view.
953
954
 
954
- **And/Or toggle:** each row in the advanced popover has an independent And/Or toggle button (click to switch).
955
+ **And/Or toggle:** each row in the advanced popover has an independent And/Or toggle button. The choice is **persisted on each `FilterCondition` as `logicOperator: "and" | "or"`** (defaults to `"and"` when undefined), so it survives remounts and can be serialized.
956
+
957
+ **Advanced filter shortcut:** the PropertySelector footer shows an "Advanced filter · N rule(s)" item. Clicking it closes the property selector and opens the advanced popover directly in its initial empty state — where the user picks the first property inline via a "Where | [Select property ▾]" draft row. When no advanced filters exist yet, clicking this shortcut makes the AdvancedChip appear with the popover already open; closing without adding a filter removes the chip automatically.
955
958
 
956
959
  | Utility | Purpose |
957
960
  |---|---|
package/dist/index.d.mts CHANGED
@@ -357,7 +357,7 @@ interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
357
357
  declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
358
358
 
359
359
  declare const typographyVariants: (props?: ({
360
- variant?: "xs" | "sm" | "md" | "lg" | "h2" | "h3" | "h1" | null | undefined;
360
+ variant?: "xs" | "sm" | "md" | "lg" | "h1" | "h2" | "h3" | null | undefined;
361
361
  weight?: "bold" | "regular" | "semibold" | null | undefined;
362
362
  } & class_variance_authority_types.ClassProp) | undefined) => string;
363
363
  interface TypographyProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
@@ -698,11 +698,14 @@ interface PropertyDefinition {
698
698
  };
699
699
  }
700
700
  type FilterValue = string | number | boolean | Date | [number, number] | [Date, Date] | string[] | null;
701
+ type LogicOperator = "and" | "or";
701
702
  interface FilterCondition {
702
703
  id: string;
703
704
  propertyId: string;
704
705
  operator: OperatorType | null;
705
706
  value: FilterValue;
707
+ /** Logic connector to the previous filter. Defaults to "and". */
708
+ logicOperator?: LogicOperator;
706
709
  }
707
710
  interface FilterState {
708
711
  basicFilters: FilterCondition[];
@@ -821,6 +824,13 @@ interface PropertySelectorProps {
821
824
  open?: boolean;
822
825
  onOpenChange?: (open: boolean) => void;
823
826
  children?: React.ReactNode;
827
+ /**
828
+ * When provided, renders an "Advanced filter" item at the bottom of the
829
+ * popover with a divider above it.
830
+ */
831
+ onAdvancedFilter?: () => void;
832
+ /** Count of existing advanced filter rules, displayed next to the item. */
833
+ advancedFilterCount?: number;
824
834
  }
825
835
  declare const PropertySelector: React.FC<PropertySelectorProps>;
826
836
 
@@ -865,10 +875,10 @@ declare const InteractiveFilterChip: React.FC<InteractiveFilterChipProps>;
865
875
  type FilterBarMode = "default" | "minimal";
866
876
  /**
867
877
  * Observes the container width and returns the appropriate FilterBar mode.
868
- * - default: > 600px
869
- * - minimal: ≤ 600px
878
+ * - default: > breakpoint
879
+ * - minimal: ≤ breakpoint
870
880
  */
871
- declare function useFilterBarMode(ref: React.RefObject<HTMLElement | null>, override?: FilterBarMode): FilterBarMode;
881
+ declare function useFilterBarMode(ref: React.RefObject<HTMLElement | null>, override?: FilterBarMode, breakpoint?: number): FilterBarMode;
872
882
 
873
883
  interface FilterSystemProps {
874
884
  properties: PropertyDefinition[];
@@ -877,6 +887,8 @@ interface FilterSystemProps {
877
887
  sortFields?: SortField[];
878
888
  /** Force a specific mode instead of auto-detecting via ResizeObserver. */
879
889
  mode?: FilterBarMode;
890
+ /** Width breakpoint (px) for switching to minimal mode. Default: 600. */
891
+ breakpoint?: number;
880
892
  children?: React.ReactNode;
881
893
  actions?: React.ReactNode;
882
894
  className?: string;
@@ -924,6 +936,9 @@ interface SummaryChipProps {
924
936
  /** Custom trigger element. When omitted, renders the default "Filters (N)" button. */
925
937
  children?: React.ReactNode;
926
938
  className?: string;
939
+ /** Controlled open state. */
940
+ open?: boolean;
941
+ onOpenChange?: (open: boolean) => void;
927
942
  }
928
943
  declare const SummaryChip: React.FC<SummaryChipProps>;
929
944
 
package/dist/index.d.ts CHANGED
@@ -357,7 +357,7 @@ interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
357
357
  declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
358
358
 
359
359
  declare const typographyVariants: (props?: ({
360
- variant?: "xs" | "sm" | "md" | "lg" | "h2" | "h3" | "h1" | null | undefined;
360
+ variant?: "xs" | "sm" | "md" | "lg" | "h1" | "h2" | "h3" | null | undefined;
361
361
  weight?: "bold" | "regular" | "semibold" | null | undefined;
362
362
  } & class_variance_authority_types.ClassProp) | undefined) => string;
363
363
  interface TypographyProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
@@ -698,11 +698,14 @@ interface PropertyDefinition {
698
698
  };
699
699
  }
700
700
  type FilterValue = string | number | boolean | Date | [number, number] | [Date, Date] | string[] | null;
701
+ type LogicOperator = "and" | "or";
701
702
  interface FilterCondition {
702
703
  id: string;
703
704
  propertyId: string;
704
705
  operator: OperatorType | null;
705
706
  value: FilterValue;
707
+ /** Logic connector to the previous filter. Defaults to "and". */
708
+ logicOperator?: LogicOperator;
706
709
  }
707
710
  interface FilterState {
708
711
  basicFilters: FilterCondition[];
@@ -821,6 +824,13 @@ interface PropertySelectorProps {
821
824
  open?: boolean;
822
825
  onOpenChange?: (open: boolean) => void;
823
826
  children?: React.ReactNode;
827
+ /**
828
+ * When provided, renders an "Advanced filter" item at the bottom of the
829
+ * popover with a divider above it.
830
+ */
831
+ onAdvancedFilter?: () => void;
832
+ /** Count of existing advanced filter rules, displayed next to the item. */
833
+ advancedFilterCount?: number;
824
834
  }
825
835
  declare const PropertySelector: React.FC<PropertySelectorProps>;
826
836
 
@@ -865,10 +875,10 @@ declare const InteractiveFilterChip: React.FC<InteractiveFilterChipProps>;
865
875
  type FilterBarMode = "default" | "minimal";
866
876
  /**
867
877
  * Observes the container width and returns the appropriate FilterBar mode.
868
- * - default: > 600px
869
- * - minimal: ≤ 600px
878
+ * - default: > breakpoint
879
+ * - minimal: ≤ breakpoint
870
880
  */
871
- declare function useFilterBarMode(ref: React.RefObject<HTMLElement | null>, override?: FilterBarMode): FilterBarMode;
881
+ declare function useFilterBarMode(ref: React.RefObject<HTMLElement | null>, override?: FilterBarMode, breakpoint?: number): FilterBarMode;
872
882
 
873
883
  interface FilterSystemProps {
874
884
  properties: PropertyDefinition[];
@@ -877,6 +887,8 @@ interface FilterSystemProps {
877
887
  sortFields?: SortField[];
878
888
  /** Force a specific mode instead of auto-detecting via ResizeObserver. */
879
889
  mode?: FilterBarMode;
890
+ /** Width breakpoint (px) for switching to minimal mode. Default: 600. */
891
+ breakpoint?: number;
880
892
  children?: React.ReactNode;
881
893
  actions?: React.ReactNode;
882
894
  className?: string;
@@ -924,6 +936,9 @@ interface SummaryChipProps {
924
936
  /** Custom trigger element. When omitted, renders the default "Filters (N)" button. */
925
937
  children?: React.ReactNode;
926
938
  className?: string;
939
+ /** Controlled open state. */
940
+ open?: boolean;
941
+ onOpenChange?: (open: boolean) => void;
927
942
  }
928
943
  declare const SummaryChip: React.FC<SummaryChipProps>;
929
944