@l3mpire/ui 2.10.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 +7 -4
- package/dist/index.d.mts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +907 -617
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +917 -621
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/styles/globals.css +10 -1
package/USAGE.md
CHANGED
|
@@ -114,7 +114,7 @@ Works with all Tailwind spacing prefixes: `p-`, `px-`, `py-`, `m-`, `mx-`, `my-`
|
|
|
114
114
|
|
|
115
115
|
**Line heights:** `leading-2xs` (14px), `leading-xs` (16px), `leading-sm` (20px), `leading-base` (24px), `leading-md` (28px), `leading-lg` (32px)
|
|
116
116
|
|
|
117
|
-
**Font weights:** `font-regular` (400), `font-
|
|
117
|
+
**Font weights:** `font-regular` (400), `font-semibold` (600), `font-bold` (700)
|
|
118
118
|
|
|
119
119
|
### Typography component
|
|
120
120
|
|
|
@@ -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** (>
|
|
950
|
-
- **Minimal** (≤
|
|
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 (
|
|
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,8 +357,8 @@ 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" | "
|
|
361
|
-
weight?: "bold" | "
|
|
360
|
+
variant?: "xs" | "sm" | "md" | "lg" | "h1" | "h2" | "h3" | null | undefined;
|
|
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> {
|
|
364
364
|
as?: React.ElementType;
|
|
@@ -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: >
|
|
869
|
-
* - minimal: ≤
|
|
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;
|
|
@@ -921,7 +933,12 @@ interface SummaryChipProps {
|
|
|
921
933
|
properties: PropertyDefinition[];
|
|
922
934
|
onFiltersChange: (filters: FilterCondition[]) => void;
|
|
923
935
|
onClearAll: () => void;
|
|
936
|
+
/** Custom trigger element. When omitted, renders the default "Filters (N)" button. */
|
|
937
|
+
children?: React.ReactNode;
|
|
924
938
|
className?: string;
|
|
939
|
+
/** Controlled open state. */
|
|
940
|
+
open?: boolean;
|
|
941
|
+
onOpenChange?: (open: boolean) => void;
|
|
925
942
|
}
|
|
926
943
|
declare const SummaryChip: React.FC<SummaryChipProps>;
|
|
927
944
|
|
package/dist/index.d.ts
CHANGED
|
@@ -357,8 +357,8 @@ 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" | "
|
|
361
|
-
weight?: "bold" | "
|
|
360
|
+
variant?: "xs" | "sm" | "md" | "lg" | "h1" | "h2" | "h3" | null | undefined;
|
|
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> {
|
|
364
364
|
as?: React.ElementType;
|
|
@@ -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: >
|
|
869
|
-
* - minimal: ≤
|
|
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;
|
|
@@ -921,7 +933,12 @@ interface SummaryChipProps {
|
|
|
921
933
|
properties: PropertyDefinition[];
|
|
922
934
|
onFiltersChange: (filters: FilterCondition[]) => void;
|
|
923
935
|
onClearAll: () => void;
|
|
936
|
+
/** Custom trigger element. When omitted, renders the default "Filters (N)" button. */
|
|
937
|
+
children?: React.ReactNode;
|
|
924
938
|
className?: string;
|
|
939
|
+
/** Controlled open state. */
|
|
940
|
+
open?: boolean;
|
|
941
|
+
onOpenChange?: (open: boolean) => void;
|
|
925
942
|
}
|
|
926
943
|
declare const SummaryChip: React.FC<SummaryChipProps>;
|
|
927
944
|
|