@lateralus-ai/shipping-ui 2.0.0-dev.3 → 2.0.0-dev.30
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/components/Entry.d.ts +27 -7
- package/dist/components/PageHeader.d.ts +41 -0
- package/dist/components/ScrollableList.d.ts +22 -0
- package/dist/components/Tabs.d.ts +5 -5
- package/dist/components/index.d.ts +4 -2
- package/dist/domain/Filters/FilterDropdown.d.ts +119 -0
- package/dist/domain/Filters/FilterPill.d.ts +22 -5
- package/dist/domain/Filters/FilterPills.d.ts +18 -0
- package/dist/domain/Filters/FilteredPill.d.ts +15 -5
- package/dist/domain/Filters/formatActiveFilterChipLabel.d.ts +11 -0
- package/dist/domain/Filters/index.d.ts +8 -3
- package/dist/index.cjs +33 -33
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +6383 -4792
- package/dist/patterns/Search/ResultRow.d.ts +11 -5
- package/dist/patterns/Sidebar/sidebar-styles.d.ts +2 -1
- package/dist/primitives/Badge.d.ts +7 -4
- package/dist/primitives/Button.d.ts +3 -1
- package/dist/primitives/Switch.d.ts +5 -0
- package/dist/primitives/index.d.ts +1 -1
- package/dist/tailwind-theme.d.ts +8 -4
- package/dist/theme-entry-Dwr2mV7_.js +1 -0
- package/dist/{theme-entry-CxDa1D0_.mjs → theme-entry-tLBc6zGT.mjs} +12 -8
- package/dist/theme.cjs +1 -1
- package/dist/theme.esm.js +1 -1
- package/package.json +3 -2
- package/src/components/EmptyState.tsx +44 -44
- package/src/components/Entry.tsx +119 -45
- package/src/components/Modal.tsx +141 -141
- package/src/components/PageHeader.tsx +132 -0
- package/src/components/ScrollableList.tsx +61 -0
- package/src/components/Tabs.tsx +33 -26
- package/src/components/index.ts +15 -1
- package/src/domain/Filters/FilterDropdown.tsx +540 -0
- package/src/domain/Filters/FilterPill.tsx +74 -25
- package/src/domain/Filters/FilterPills.tsx +34 -0
- package/src/domain/Filters/FilteredPill.tsx +59 -39
- package/src/domain/Filters/FiltersBar.tsx +72 -76
- package/src/domain/Filters/formatActiveFilterChipLabel.ts +23 -0
- package/src/domain/Filters/index.ts +37 -3
- package/src/icons/arrow-paths.ts +8 -8
- package/src/icons/chevron-paths.ts +17 -17
- package/src/icons/icons-data.ts +656 -656
- package/src/index.ts +11 -0
- package/src/patterns/Search/ResultRow.tsx +24 -38
- package/src/patterns/Search/SearchModal.tsx +26 -8
- package/src/patterns/Sidebar/CollapsibleNavGroup.tsx +1 -1
- package/src/patterns/Sidebar/SidebarAction.tsx +26 -17
- package/src/patterns/Sidebar/SidebarEntry.tsx +54 -39
- package/src/patterns/Sidebar/SidebarLink.tsx +30 -20
- package/src/patterns/Sidebar/assets/logo-compliance-mark.png +5 -5
- package/src/patterns/Sidebar/assets/logo-compliance-mask.png +13 -13
- package/src/patterns/Sidebar/assets/logo-compliance.svg +17 -17
- package/src/patterns/Sidebar/assets/logo-technical-avatar.svg +17 -17
- package/src/patterns/Sidebar/assets/logo-technical-mark.png +5 -5
- package/src/patterns/Sidebar/assets/logo-technical.svg +16 -16
- package/src/patterns/Sidebar/sidebar-styles.ts +2 -1
- package/src/primitives/Badge.tsx +20 -10
- package/src/primitives/Button.tsx +21 -11
- package/src/primitives/Logo.tsx +20 -8
- package/src/primitives/Switch.tsx +27 -7
- package/src/primitives/button-styles.ts +92 -92
- package/src/primitives/index.ts +1 -1
- package/src/stories/canvases/ButtonsCanvas.tsx +107 -107
- package/src/stories/canvases/ButtonsMatrixCanvas.tsx +65 -65
- package/src/stories/canvases/ContentCanvas.tsx +253 -14
- package/src/stories/canvases/FiltersCanvas.tsx +171 -41
- package/src/stories/canvases/figma-buttons-layout.ts +83 -83
- package/src/stories/canvases/figma-widths.ts +28 -28
- package/src/stories/canvases/helpers.tsx +146 -146
- package/src/stories/components/Buttons.stories.tsx +11 -11
- package/src/stories/components/Chat.stories.tsx +11 -11
- package/src/stories/components/Content.stories.tsx +11 -11
- package/src/stories/components/Core.stories.tsx +11 -11
- package/src/stories/components/DomainForms.stories.tsx +11 -11
- package/src/stories/components/Filters.stories.tsx +11 -11
- package/src/stories/components/Forms.stories.tsx +11 -11
- package/src/stories/components/Icons.stories.tsx +11 -11
- package/src/stories/components/Illustrations.stories.tsx +11 -11
- package/src/stories/components/Library.stories.tsx +11 -11
- package/src/stories/components/Modals.stories.tsx +11 -11
- package/src/stories/components/Report.stories.tsx +11 -11
- package/src/stories/components/ReportLayout.stories.tsx +11 -11
- package/src/stories/components/Search.stories.tsx +11 -11
- package/src/stories/components/Settings.stories.tsx +11 -11
- package/src/stories/components/Ships.stories.tsx +11 -11
- package/src/stories/components/SidebarLayouts.stories.tsx +11 -11
- package/src/stories/components/Skeletons.stories.tsx +11 -11
- package/src/stories/components/Workflows.stories.tsx +11 -11
- package/src/stories/style-guide/Buttons.stories.tsx +11 -11
- package/src/stories/style-guide/ColorTokens.stories.tsx +11 -11
- package/src/stories/style-guide/Colors.stories.tsx +11 -11
- package/src/stories/style-guide/RaiseLevels.stories.tsx +11 -11
- package/src/stories/style-guide/Typography.stories.tsx +11 -11
- package/src/tailwind-theme.ts +8 -4
- package/src/theme-entry.ts +2 -2
- package/src/utils/cn.ts +28 -1
- package/dist/theme-entry-D2X3Ptjf.js +0 -1
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type
|
|
3
|
-
|
|
2
|
+
export type EntryVariant = "chat" | "issue" | "report";
|
|
3
|
+
/** @deprecated Prefer `EntryVariant`. */
|
|
4
|
+
export type EntryType = EntryVariant;
|
|
5
|
+
export type EntryState = "idle" | "active";
|
|
4
6
|
export type EntryProps = {
|
|
5
|
-
type
|
|
7
|
+
/** Visual type — drives the default leading icon. */
|
|
8
|
+
variant?: EntryVariant;
|
|
9
|
+
/** @deprecated Use `variant`. */
|
|
10
|
+
type?: EntryVariant;
|
|
6
11
|
state?: EntryState;
|
|
7
|
-
title
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** Secondary line — excerpt, metadata, or highlighted query match. */
|
|
14
|
+
subtitle?: ReactNode;
|
|
15
|
+
/** Unread count badge in the title row (Figma red pill). */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** Trailing actions (e.g. ellipsis menu). Shown on hover / when forced. */
|
|
18
|
+
trailing?: ReactNode;
|
|
19
|
+
/** Override the default variant icon. */
|
|
20
|
+
icon?: ReactNode;
|
|
10
21
|
onClick?: () => void;
|
|
11
22
|
className?: string;
|
|
23
|
+
/** @deprecated Use `count` or `trailing`. */
|
|
24
|
+
meta?: ReactNode;
|
|
12
25
|
};
|
|
13
|
-
|
|
26
|
+
/**
|
|
27
|
+
* List entry row — Figma `Entry` (389:10001).
|
|
28
|
+
* Shared by search results and activity lists.
|
|
29
|
+
*
|
|
30
|
+
* Renders a `div` (not `<button>`) so trailing controls can be real buttons
|
|
31
|
+
* without nested-button issues. Whole-row click uses `onClick` + keyboard.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Entry: ({ variant, type, state, title, subtitle, count, trailing, icon, onClick, className, meta, }: EntryProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
export type PageHeaderCrumb = {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Renders a real `<a href>` so native browser controls work. */
|
|
5
|
+
href: string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional SPA handler. Callers should `preventDefault` only for unmodified
|
|
8
|
+
* primary clicks; modifier / middle-click keep native anchor behavior.
|
|
9
|
+
*/
|
|
10
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
11
|
+
};
|
|
12
|
+
export type PageHeaderProps = {
|
|
13
|
+
/** Leading icon (Figma 24×24). */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/** Standard title, or current (last) segment when `crumbs` is set. */
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Parent breadcrumb links. When present, renders Nested: icon + parents + `/`
|
|
19
|
+
* + current `title` (non-link).
|
|
20
|
+
*/
|
|
21
|
+
crumbs?: PageHeaderCrumb[];
|
|
22
|
+
/** Right-hand actions slot (buttons, menus, etc.). */
|
|
23
|
+
actions?: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
export type PageHeaderShellProps = ComponentPropsWithoutRef<"div">;
|
|
27
|
+
export type PageHeaderBodyProps = ComponentPropsWithoutRef<"div">;
|
|
28
|
+
/**
|
|
29
|
+
* Page title row — Figma `Header` (389:8850).
|
|
30
|
+
* Variants: Standard (icon + title) | Nested (icon + crumb trail).
|
|
31
|
+
*/
|
|
32
|
+
declare function PageHeaderRoot({ icon, title, crumbs, actions, className, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
/** Flex column shell — pin header, scroll body (avoids brittle CSS sticky). */
|
|
34
|
+
declare function PageHeaderShell({ className, ...props }: PageHeaderShellProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/** Scrollable page content under a pinned PageHeader. */
|
|
36
|
+
declare function PageHeaderBody({ className, ...props }: PageHeaderBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const PageHeader: typeof PageHeaderRoot & {
|
|
38
|
+
Shell: typeof PageHeaderShell;
|
|
39
|
+
Body: typeof PageHeaderBody;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type ScrollableListProps = ComponentPropsWithoutRef<"div">;
|
|
3
|
+
export type ScrollableListHeaderProps = ComponentPropsWithoutRef<"div">;
|
|
4
|
+
export type ScrollableListBodyProps = ComponentPropsWithoutRef<"div">;
|
|
5
|
+
/**
|
|
6
|
+
* Fill-height list chrome — Figma `Table` (6154:152285).
|
|
7
|
+
* Outer grey-100 frame + header slot + internally scrolling grey-50 body.
|
|
8
|
+
* Column layout and rows are caller-owned children.
|
|
9
|
+
*/
|
|
10
|
+
declare function ScrollableListRoot({ className, ...props }: ScrollableListProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Column title bar. Default left padding aligns with a 24px leading icon +
|
|
13
|
+
* 8px gap + 8px row padding (Figma). Override `className` when rows have no icon.
|
|
14
|
+
*/
|
|
15
|
+
declare function ScrollableListHeader({ className, ...props }: ScrollableListHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/** Internally scrolling row region. */
|
|
17
|
+
declare function ScrollableListBody({ className, ...props }: ScrollableListBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const ScrollableList: typeof ScrollableListRoot & {
|
|
19
|
+
Header: typeof ScrollableListHeader;
|
|
20
|
+
Body: typeof ScrollableListBody;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
3
|
export type TabsType = "tabs" | "pills";
|
|
4
|
+
/** Soft = search filters (filled idle, light accent active). Solid = list filters (grey-100 idle, blue-600 active). */
|
|
5
|
+
export type TabsAppearance = "soft" | "solid";
|
|
4
6
|
export type TabsProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
|
|
5
7
|
type?: TabsType;
|
|
8
|
+
/** Only applies when `type="pills"`. Defaults to `soft`. */
|
|
9
|
+
appearance?: TabsAppearance;
|
|
6
10
|
};
|
|
7
|
-
export declare const Tabs: ({ type, className, children, ...props }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const Tabs: ({ type, appearance, className, children, ...props }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
9
13
|
export declare const TabsList: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
14
|
export type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
|
|
11
|
-
/** Optional count badge (pill variant / search filters). */
|
|
12
|
-
count?: number;
|
|
13
15
|
children: ReactNode;
|
|
14
16
|
};
|
|
15
17
|
export declare const TabsTrigger: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
16
|
-
/** Optional count badge (pill variant / search filters). */
|
|
17
|
-
count?: number;
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
20
20
|
export type TabsContentProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
|
|
@@ -4,9 +4,11 @@ export { InputType, type InputTypeProps, type InputTypeKind, type InputTypeState
|
|
|
4
4
|
export { Chip, type ChipProps, type ChipVariant } from './Chip';
|
|
5
5
|
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
6
6
|
export { Tab, type TabProps, type TabState } from './Tab';
|
|
7
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent, type TabsProps, type TabsListProps, type TabsTriggerProps, type TabsContentProps, type TabsItem, type TabsType, } from './Tabs';
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, type TabsProps, type TabsListProps, type TabsTriggerProps, type TabsContentProps, type TabsItem, type TabsType, type TabsAppearance, } from './Tabs';
|
|
8
8
|
export { Header, type HeaderProps, type HeaderVariant } from './Header';
|
|
9
|
-
export {
|
|
9
|
+
export { PageHeader, type PageHeaderProps, type PageHeaderCrumb, type PageHeaderShellProps, type PageHeaderBodyProps, } from './PageHeader';
|
|
10
|
+
export { ScrollableList, type ScrollableListProps, type ScrollableListHeaderProps, type ScrollableListBodyProps, } from './ScrollableList';
|
|
11
|
+
export { Entry, type EntryProps, type EntryType, type EntryState, type EntryVariant } from './Entry';
|
|
10
12
|
export { EmptyState, type EmptyStateProps } from './EmptyState';
|
|
11
13
|
export { Modal, ModalTrigger, ModalClose, ModalPortal, ModalOverlay, ModalContent, ModalTitle, ModalDescription, ModalHeaderSlot, ModalBody, type ModalProps, type ModalOverlayProps, type ModalContentProps, type ModalTitleProps, type ModalDescriptionProps, type ModalBodyProps, } from './Modal';
|
|
12
14
|
export { ModalPanel } from './ModalPanel';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { FilterPillAppearance } from './FilterPill';
|
|
3
|
+
/** One selectable row at a leaf list. */
|
|
4
|
+
export type FilterOption = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: ComponentType<{
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type FilterSelectionMode = "multi" | "single";
|
|
12
|
+
/**
|
|
13
|
+
* Recursive submenu: options leaf, nested folders, or custom panel (e.g. date range).
|
|
14
|
+
*/
|
|
15
|
+
export type FilterSubmenuContent = {
|
|
16
|
+
type: "options";
|
|
17
|
+
/** Key into `selectedValuesBySelectionKey` / `onSelectOption` */
|
|
18
|
+
selectionKey: string;
|
|
19
|
+
/** `multi` (default) toggles; `single` is exclusive — still one check slot reserved. */
|
|
20
|
+
selectionMode?: FilterSelectionMode;
|
|
21
|
+
options: FilterOption[];
|
|
22
|
+
} | {
|
|
23
|
+
type: "nested";
|
|
24
|
+
items: FilterNestedItem[];
|
|
25
|
+
} | {
|
|
26
|
+
type: "custom";
|
|
27
|
+
render: () => ReactNode;
|
|
28
|
+
};
|
|
29
|
+
export type FilterNestedItem = {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
content: FilterSubmenuContent;
|
|
33
|
+
};
|
|
34
|
+
/** Left-column row that opens a (possibly nested) submenu panel. */
|
|
35
|
+
export type FilterCategorySubmenuRow = {
|
|
36
|
+
kind?: "submenu";
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
content: FilterSubmenuContent;
|
|
40
|
+
};
|
|
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). */
|
|
55
|
+
export type FilterCategoryToggleRow = {
|
|
56
|
+
kind: "toggle";
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
checked: boolean;
|
|
60
|
+
onCheckedChange: (checked: boolean) => void;
|
|
61
|
+
};
|
|
62
|
+
export type FilterCategoryRow = FilterCategorySubmenuRow | FilterCategoryInlineOptionsRow | FilterCategoryToggleRow;
|
|
63
|
+
type ResolvedSubmenuView = {
|
|
64
|
+
kind: "folders";
|
|
65
|
+
items: FilterNestedItem[];
|
|
66
|
+
trail: string[];
|
|
67
|
+
} | {
|
|
68
|
+
kind: "options";
|
|
69
|
+
selectionKey: string;
|
|
70
|
+
selectionMode: FilterSelectionMode;
|
|
71
|
+
options: FilterOption[];
|
|
72
|
+
trail: string[];
|
|
73
|
+
} | {
|
|
74
|
+
kind: "custom";
|
|
75
|
+
render: () => ReactNode;
|
|
76
|
+
trail: string[];
|
|
77
|
+
};
|
|
78
|
+
/** Walk `path` (folder ids) from `content` to the current view. */
|
|
79
|
+
export declare function resolveSubmenuView(content: FilterSubmenuContent, path: string[]): ResolvedSubmenuView;
|
|
80
|
+
export type FilterDropdownProps = {
|
|
81
|
+
align?: "start" | "center" | "end";
|
|
82
|
+
sideOffset?: number;
|
|
83
|
+
/**
|
|
84
|
+
* First panel rows — mix freely:
|
|
85
|
+
* submenu (chevron + second panel), inline-options (flat list), toggle (Switch).
|
|
86
|
+
*/
|
|
87
|
+
categoryRows: FilterCategoryRow[];
|
|
88
|
+
selectedValuesBySelectionKey: Record<string, string[] | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Fired when an option is activated. For `multi`, consumers typically toggle;
|
|
91
|
+
* for `single`, replace the selection with `[optionValue]`.
|
|
92
|
+
*/
|
|
93
|
+
onSelectOption: (selectionKey: string, optionValue: string) => void;
|
|
94
|
+
onResetAll: () => void;
|
|
95
|
+
resetAllLabel?: string;
|
|
96
|
+
/** When false, hides the Reset all footer. Default true. */
|
|
97
|
+
showResetAll?: boolean;
|
|
98
|
+
activeFilterCount: number;
|
|
99
|
+
getOptionLabelStyle?: (selectionKey: string, optionValue: string) => CSSProperties | undefined;
|
|
100
|
+
zIndexClass?: string;
|
|
101
|
+
/** Replace the default FilterPill trigger. */
|
|
102
|
+
trigger?: ReactNode;
|
|
103
|
+
/** Passed to the default FilterPill when `trigger` is omitted. */
|
|
104
|
+
triggerAppearance?: FilterPillAppearance;
|
|
105
|
+
/**
|
|
106
|
+
* Which side the options panel attaches to the category column.
|
|
107
|
+
* Carets stay on the right of category rows either way.
|
|
108
|
+
*/
|
|
109
|
+
submenuSide?: "left" | "right";
|
|
110
|
+
open?: boolean;
|
|
111
|
+
onOpenChange?: (open: boolean) => void;
|
|
112
|
+
className?: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Filters trigger + popover. First panel supports hybrid rows: submenus,
|
|
116
|
+
* inline option lists, and Switch toggles. Submenus open a second column.
|
|
117
|
+
*/
|
|
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;
|
|
119
|
+
export {};
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export type FilterPillAppearance = "filled" | "ghost";
|
|
3
|
+
export type FilterPillProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
4
|
+
/** When > 0, shows the orange count badge. */
|
|
5
|
+
activeFilterCount?: number;
|
|
6
|
+
/**
|
|
7
|
+
* `filled` — grey idle / blue when active (Figma default).
|
|
8
|
+
* `ghost` — white idle and active; only hover changes surface color.
|
|
9
|
+
*/
|
|
10
|
+
appearance?: FilterPillAppearance;
|
|
5
11
|
};
|
|
6
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Filter trigger — Figma Filter Pill (6154:149608 / 6154:149599).
|
|
14
|
+
*/
|
|
15
|
+
export declare const FilterPill: import('react').ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
16
|
+
/** When > 0, shows the orange count badge. */
|
|
17
|
+
activeFilterCount?: number;
|
|
18
|
+
/**
|
|
19
|
+
* `filled` — grey idle / blue when active (Figma default).
|
|
20
|
+
* `ghost` — white idle and active; only hover changes surface color.
|
|
21
|
+
*/
|
|
22
|
+
appearance?: FilterPillAppearance;
|
|
23
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FilteredPillProps } from './FilteredPill';
|
|
2
|
+
export type FilterPillsItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onRemove: () => void;
|
|
6
|
+
removeAriaLabel?: string;
|
|
7
|
+
classNames?: FilteredPillProps["classNames"];
|
|
8
|
+
};
|
|
9
|
+
export type FilterPillsProps = {
|
|
10
|
+
chips: FilterPillsItem[];
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Partner row for FilterDropdown — active filter pills.
|
|
15
|
+
* Always renders the row wrapper (even when empty) so sibling filter
|
|
16
|
+
* triggers can stay pinned with `ml-auto` / flex layouts.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FilterPills: ({ chips, className }: FilterPillsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
export type FilteredPillState = "idle" | "hover";
|
|
2
1
|
export type FilteredPillProps = {
|
|
3
|
-
label
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
label: string;
|
|
3
|
+
onRemove: () => void;
|
|
4
|
+
removeAriaLabel?: string;
|
|
6
5
|
className?: string;
|
|
6
|
+
/** Optional tone overrides. Prefer default beige unless a product needs a custom tone. */
|
|
7
|
+
classNames?: {
|
|
8
|
+
root?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
remove?: string;
|
|
11
|
+
};
|
|
7
12
|
};
|
|
8
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Active filter value pill — Figma Filtered (6154:149787).
|
|
15
|
+
* Clear control on the left, label on the right. Max 300px with ellipsis;
|
|
16
|
+
* full label in a tooltip on hover.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FilteredPill: ({ label, onRemove, removeAriaLabel, className, classNames, }: FilteredPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format the user-visible label for an active-filter chip (audit-prep rules).
|
|
3
|
+
*
|
|
4
|
+
* - 0 selected → "" (caller should not render)
|
|
5
|
+
* - 1 selected → `<filterName> (<value>)`
|
|
6
|
+
* - 2 selected → `<filterName> (<v1>, <v2>)`
|
|
7
|
+
* - 3+ selected → `<filterName> (<v1>, <v2>...)` (literal `...`)
|
|
8
|
+
*
|
|
9
|
+
* `selectedLabels` are already human-readable, in selection order.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatActiveFilterChipLabel(filterName: string, selectedLabels: string[]): string;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
export { FiltersBar, type FiltersBarFilters, type FiltersBarProps, type FiltersBarTabs } from './FiltersBar';
|
|
2
|
-
export { FilteredPill, type FilteredPillProps,
|
|
3
|
-
export { FilterPill, type
|
|
1
|
+
export { FiltersBar, type FiltersBarFilters, type FiltersBarProps, type FiltersBarTabs, } from './FiltersBar';
|
|
2
|
+
export { FilteredPill, type FilteredPillProps, } from './FilteredPill';
|
|
3
|
+
export { FilterPill, type FilterPillAppearance, type FilterPillProps, } from './FilterPill';
|
|
4
|
+
export { FilterPills, type FilterPillsItem, type FilterPillsProps, } from './FilterPills';
|
|
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
|
+
export { formatActiveFilterChipLabel } from './formatActiveFilterChipLabel';
|
|
7
|
+
/** @deprecated Use `activeFilterCount` on FilterPill instead. */
|
|
8
|
+
export type FilterPillIndicator = "on" | "off";
|