@lateralus-ai/shipping-ui 2.0.0-dev.23 → 2.0.0-dev.25
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/dist/domain/Filters/FilterDropdown.d.ts +24 -6
- package/dist/domain/Filters/index.d.ts +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.esm.js +2898 -2878
- package/dist/primitives/Switch.d.ts +5 -0
- package/package.json +1 -1
- package/src/domain/Filters/FilterDropdown.tsx +540 -474
- package/src/domain/Filters/FilterPill.tsx +74 -74
- package/src/domain/Filters/FilterPills.tsx +34 -34
- package/src/domain/Filters/FilteredPill.tsx +59 -59
- package/src/domain/Filters/FiltersBar.tsx +72 -72
- package/src/domain/Filters/formatActiveFilterChipLabel.ts +23 -23
- package/src/domain/Filters/index.ts +37 -36
- package/src/primitives/Switch.tsx +25 -7
- package/src/stories/canvases/FiltersCanvas.tsx +171 -171
|
@@ -38,7 +38,20 @@ export type FilterCategorySubmenuRow = {
|
|
|
38
38
|
label: string;
|
|
39
39
|
content: FilterSubmenuContent;
|
|
40
40
|
};
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Options rendered inline in the first panel (no chevron / second column).
|
|
43
|
+
* Mix with submenu rows for hybrid menus (e.g. Status submenu + Sort by flat).
|
|
44
|
+
*/
|
|
45
|
+
export type FilterCategoryInlineOptionsRow = {
|
|
46
|
+
kind: "inline-options";
|
|
47
|
+
id: string;
|
|
48
|
+
/** Small section header above the options (e.g. "Sort by"). */
|
|
49
|
+
title?: string;
|
|
50
|
+
selectionKey: string;
|
|
51
|
+
selectionMode?: FilterSelectionMode;
|
|
52
|
+
options: FilterOption[];
|
|
53
|
+
};
|
|
54
|
+
/** First-panel row: label + Switch (no right panel). */
|
|
42
55
|
export type FilterCategoryToggleRow = {
|
|
43
56
|
kind: "toggle";
|
|
44
57
|
id: string;
|
|
@@ -46,7 +59,7 @@ export type FilterCategoryToggleRow = {
|
|
|
46
59
|
checked: boolean;
|
|
47
60
|
onCheckedChange: (checked: boolean) => void;
|
|
48
61
|
};
|
|
49
|
-
export type FilterCategoryRow = FilterCategorySubmenuRow | FilterCategoryToggleRow;
|
|
62
|
+
export type FilterCategoryRow = FilterCategorySubmenuRow | FilterCategoryInlineOptionsRow | FilterCategoryToggleRow;
|
|
50
63
|
type ResolvedSubmenuView = {
|
|
51
64
|
kind: "folders";
|
|
52
65
|
items: FilterNestedItem[];
|
|
@@ -67,7 +80,10 @@ export declare function resolveSubmenuView(content: FilterSubmenuContent, path:
|
|
|
67
80
|
export type FilterDropdownProps = {
|
|
68
81
|
align?: "start" | "center" | "end";
|
|
69
82
|
sideOffset?: number;
|
|
70
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* First panel rows — mix freely:
|
|
85
|
+
* submenu (chevron + second panel), inline-options (flat list), toggle (Switch).
|
|
86
|
+
*/
|
|
71
87
|
categoryRows: FilterCategoryRow[];
|
|
72
88
|
selectedValuesBySelectionKey: Record<string, string[] | undefined>;
|
|
73
89
|
/**
|
|
@@ -77,6 +93,8 @@ export type FilterDropdownProps = {
|
|
|
77
93
|
onSelectOption: (selectionKey: string, optionValue: string) => void;
|
|
78
94
|
onResetAll: () => void;
|
|
79
95
|
resetAllLabel?: string;
|
|
96
|
+
/** When false, hides the Reset all footer. Default true. */
|
|
97
|
+
showResetAll?: boolean;
|
|
80
98
|
activeFilterCount: number;
|
|
81
99
|
getOptionLabelStyle?: (selectionKey: string, optionValue: string) => CSSProperties | undefined;
|
|
82
100
|
zIndexClass?: string;
|
|
@@ -94,8 +112,8 @@ export type FilterDropdownProps = {
|
|
|
94
112
|
className?: string;
|
|
95
113
|
};
|
|
96
114
|
/**
|
|
97
|
-
* Filters trigger +
|
|
98
|
-
*
|
|
115
|
+
* Filters trigger + popover. First panel supports hybrid rows: submenus,
|
|
116
|
+
* inline option lists, and Switch toggles. Submenus open a second column.
|
|
99
117
|
*/
|
|
100
|
-
export declare function FilterDropdown({ align, sideOffset, categoryRows, selectedValuesBySelectionKey, onSelectOption, onResetAll, resetAllLabel, activeFilterCount, getOptionLabelStyle, zIndexClass, trigger, triggerAppearance, submenuSide, open: openControlled, onOpenChange, className, }: FilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export declare function FilterDropdown({ align, sideOffset, categoryRows, selectedValuesBySelectionKey, onSelectOption, onResetAll, resetAllLabel, showResetAll, activeFilterCount, getOptionLabelStyle, zIndexClass, trigger, triggerAppearance, submenuSide, open: openControlled, onOpenChange, className, }: FilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
101
119
|
export {};
|
|
@@ -2,7 +2,7 @@ export { FiltersBar, type FiltersBarFilters, type FiltersBarProps, type FiltersB
|
|
|
2
2
|
export { FilteredPill, type FilteredPillProps, } from './FilteredPill';
|
|
3
3
|
export { FilterPill, type FilterPillAppearance, type FilterPillProps, } from './FilterPill';
|
|
4
4
|
export { FilterPills, type FilterPillsItem, type FilterPillsProps, } from './FilterPills';
|
|
5
|
-
export { FilterDropdown, resolveSubmenuView, type FilterCategoryRow, type FilterCategorySubmenuRow, type FilterCategoryToggleRow, type FilterDropdownProps, type FilterNestedItem, type FilterOption, type FilterSelectionMode, type FilterSubmenuContent, } from './FilterDropdown';
|
|
5
|
+
export { FilterDropdown, resolveSubmenuView, type FilterCategoryInlineOptionsRow, type FilterCategoryRow, type FilterCategorySubmenuRow, type FilterCategoryToggleRow, type FilterDropdownProps, type FilterNestedItem, type FilterOption, type FilterSelectionMode, type FilterSubmenuContent, } from './FilterDropdown';
|
|
6
6
|
export { formatActiveFilterChipLabel } from './formatActiveFilterChipLabel';
|
|
7
7
|
/** @deprecated Use `activeFilterCount` on FilterPill instead. */
|
|
8
8
|
export type FilterPillIndicator = "on" | "off";
|