@undevy-org/tablewright 0.1.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/LICENSE +21 -0
- package/README.md +262 -0
- package/dist/es/components/dashboard/ReportSummaryCard.js +67 -0
- package/dist/es/components/data-table/AppliedStateChips.js +113 -0
- package/dist/es/components/data-table/ColumnFilterPopover.js +548 -0
- package/dist/es/components/data-table/ColumnHeaderMenu.js +144 -0
- package/dist/es/components/data-table/CompoundFilterPopover.js +508 -0
- package/dist/es/components/data-table/CopyButton.js +35 -0
- package/dist/es/components/data-table/CopyableText.js +26 -0
- package/dist/es/components/data-table/DataTableShell.js +145 -0
- package/dist/es/components/data-table/DrawerActionGroup.js +59 -0
- package/dist/es/components/data-table/DrawerEntityCard.js +21 -0
- package/dist/es/components/data-table/DrawerField.js +10 -0
- package/dist/es/components/data-table/DrawerFlagItem.js +20 -0
- package/dist/es/components/data-table/DrawerSection.js +26 -0
- package/dist/es/components/data-table/DrawerShell.js +141 -0
- package/dist/es/components/data-table/DrawerSummaryCard.js +11 -0
- package/dist/es/components/data-table/EmptyState.js +14 -0
- package/dist/es/components/data-table/ExpiryTimestampCell.js +43 -0
- package/dist/es/components/data-table/FilterChip.js +47 -0
- package/dist/es/components/data-table/FilterFormPanel.js +357 -0
- package/dist/es/components/data-table/FilterFormToggle.js +77 -0
- package/dist/es/components/data-table/FilterPopoverFooter.js +19 -0
- package/dist/es/components/data-table/FilterToolbar.js +131 -0
- package/dist/es/components/data-table/FlatColumnToggle.js +46 -0
- package/dist/es/components/data-table/GapIndicator.js +29 -0
- package/dist/es/components/data-table/GroupedColumnToggle.js +112 -0
- package/dist/es/components/data-table/RowActionsMenu.js +74 -0
- package/dist/es/components/data-table/RowControlCell.js +104 -0
- package/dist/es/components/data-table/SortableHeader.js +102 -0
- package/dist/es/components/data-table/TableFooter.js +132 -0
- package/dist/es/components/data-table/TableLayout.js +14 -0
- package/dist/es/components/data-table/TimestampCell.js +16 -0
- package/dist/es/components/data-table/TwoPanelMenu.js +64 -0
- package/dist/es/components/data-table/ViewChip.js +25 -0
- package/dist/es/components/data-table/cells/AmountCell.js +127 -0
- package/dist/es/components/data-table/cells/ConfirmedAmountCell.js +115 -0
- package/dist/es/components/data-table/cells/CurrencyAmountCell.js +26 -0
- package/dist/es/components/data-table/cells/DualLineCell.js +59 -0
- package/dist/es/components/data-table/cells/EnumBadgeCell.js +9 -0
- package/dist/es/components/data-table/cells/MonoIdCell.js +31 -0
- package/dist/es/components/data-table/hooks/use-column-resize.js +39 -0
- package/dist/es/components/data-table/hooks/use-row-drag.js +40 -0
- package/dist/es/components/data-table/hooks/use-table-pagination.js +14 -0
- package/dist/es/components/data-table/hooks/use-table-sort.js +35 -0
- package/dist/es/components/data-table/managed-filters.js +34 -0
- package/dist/es/components/data-table/sticky-utils.js +25 -0
- package/dist/es/components/layout/AppShell.js +113 -0
- package/dist/es/components/layout/Sidebar.js +128 -0
- package/dist/es/components/layout/SidebarAccountMenu.js +129 -0
- package/dist/es/components/layout/SidebarUser.js +38 -0
- package/dist/es/components/layout/TopBar.js +25 -0
- package/dist/es/components/layout/app-shell-context.js +9 -0
- package/dist/es/components/ui/badge.js +31 -0
- package/dist/es/components/ui/button-footer.js +25 -0
- package/dist/es/components/ui/button.js +44 -0
- package/dist/es/components/ui/checkbox.js +24 -0
- package/dist/es/components/ui/combobox.js +179 -0
- package/dist/es/components/ui/dialog.js +80 -0
- package/dist/es/components/ui/dropdown-menu.js +66 -0
- package/dist/es/components/ui/input.js +24 -0
- package/dist/es/components/ui/popover.js +33 -0
- package/dist/es/components/ui/segmented-control.js +60 -0
- package/dist/es/components/ui/select.js +66 -0
- package/dist/es/components/ui/tabs.js +41 -0
- package/dist/es/components/ui/theme-switch.js +47 -0
- package/dist/es/constants/drawer.js +4 -0
- package/dist/es/context/drawer-expand-context.js +10 -0
- package/dist/es/context/portal-container-context.js +10 -0
- package/dist/es/hooks/table-orchestration-store.js +165 -0
- package/dist/es/hooks/use-scroll-activity.js +33 -0
- package/dist/es/hooks/useRowDragOverride.js +18 -0
- package/dist/es/hooks/useTableOrchestration.js +452 -0
- package/dist/es/index.js +199 -0
- package/dist/es/lib/column-gaps.js +23 -0
- package/dist/es/lib/filter-stats.js +67 -0
- package/dist/es/lib/format-enum.js +6 -0
- package/dist/es/lib/format-timestamp.js +37 -0
- package/dist/es/lib/style-scope.js +4 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/fonts.css +5 -0
- package/dist/preflight.css +502 -0
- package/dist/styles.css +1731 -0
- package/dist/tablewright.cjs +5473 -0
- package/dist/tablewright.css +1579 -0
- package/dist/tokens.css +150 -0
- package/dist/types/components/dashboard/ReportSummaryCard.d.ts +15 -0
- package/dist/types/components/data-table/AppliedStateChips.d.ts +28 -0
- package/dist/types/components/data-table/ColumnFilterPopover.d.ts +14 -0
- package/dist/types/components/data-table/ColumnHeaderMenu.d.ts +27 -0
- package/dist/types/components/data-table/CompoundFilterPopover.d.ts +14 -0
- package/dist/types/components/data-table/CopyButton.d.ts +8 -0
- package/dist/types/components/data-table/CopyableText.d.ts +10 -0
- package/dist/types/components/data-table/DataTableShell.d.ts +30 -0
- package/dist/types/components/data-table/DrawerActionGroup.d.ts +8 -0
- package/dist/types/components/data-table/DrawerEntityCard.d.ts +13 -0
- package/dist/types/components/data-table/DrawerField.d.ts +7 -0
- package/dist/types/components/data-table/DrawerFlagItem.d.ts +10 -0
- package/dist/types/components/data-table/DrawerSection.d.ts +8 -0
- package/dist/types/components/data-table/DrawerShell.d.ts +33 -0
- package/dist/types/components/data-table/DrawerSummaryCard.d.ts +7 -0
- package/dist/types/components/data-table/EmptyState.d.ts +6 -0
- package/dist/types/components/data-table/ExpiryTimestampCell.d.ts +6 -0
- package/dist/types/components/data-table/FilterChip.d.ts +8 -0
- package/dist/types/components/data-table/FilterFormPanel.d.ts +34 -0
- package/dist/types/components/data-table/FilterFormToggle.d.ts +18 -0
- package/dist/types/components/data-table/FilterPopoverFooter.d.ts +9 -0
- package/dist/types/components/data-table/FilterToolbar.d.ts +29 -0
- package/dist/types/components/data-table/FlatColumnToggle.d.ts +10 -0
- package/dist/types/components/data-table/GapIndicator.d.ts +11 -0
- package/dist/types/components/data-table/GroupedColumnToggle.d.ts +12 -0
- package/dist/types/components/data-table/RowActionsMenu.d.ts +10 -0
- package/dist/types/components/data-table/RowControlCell.d.ts +16 -0
- package/dist/types/components/data-table/SortableHeader.d.ts +16 -0
- package/dist/types/components/data-table/TableFooter.d.ts +31 -0
- package/dist/types/components/data-table/TableLayout.d.ts +12 -0
- package/dist/types/components/data-table/TimestampCell.d.ts +3 -0
- package/dist/types/components/data-table/TwoPanelMenu.d.ts +22 -0
- package/dist/types/components/data-table/ViewChip.d.ts +6 -0
- package/dist/types/components/data-table/cells/AmountCell.d.ts +11 -0
- package/dist/types/components/data-table/cells/ConfirmedAmountCell.d.ts +10 -0
- package/dist/types/components/data-table/cells/CurrencyAmountCell.d.ts +8 -0
- package/dist/types/components/data-table/cells/DualLineCell.d.ts +44 -0
- package/dist/types/components/data-table/cells/EnumBadgeCell.d.ts +9 -0
- package/dist/types/components/data-table/cells/MonoIdCell.d.ts +19 -0
- package/dist/types/components/data-table/filter-types.d.ts +79 -0
- package/dist/types/components/data-table/hooks/use-column-resize.d.ts +7 -0
- package/dist/types/components/data-table/hooks/use-row-drag.d.ts +14 -0
- package/dist/types/components/data-table/hooks/use-table-pagination.d.ts +10 -0
- package/dist/types/components/data-table/hooks/use-table-sort.d.ts +6 -0
- package/dist/types/components/data-table/managed-filters.d.ts +18 -0
- package/dist/types/components/data-table/sticky-utils.d.ts +4 -0
- package/dist/types/components/data-table/types.d.ts +35 -0
- package/dist/types/components/layout/AppShell.d.ts +23 -0
- package/dist/types/components/layout/Sidebar.d.ts +16 -0
- package/dist/types/components/layout/SidebarAccountMenu.d.ts +20 -0
- package/dist/types/components/layout/SidebarUser.d.ts +8 -0
- package/dist/types/components/layout/TopBar.d.ts +7 -0
- package/dist/types/components/layout/app-shell-context.d.ts +8 -0
- package/dist/types/components/layout/index.d.ts +10 -0
- package/dist/types/components/layout/types.d.ts +11 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/button-footer.d.ts +7 -0
- package/dist/types/components/ui/button.d.ts +11 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/combobox.d.ts +92 -0
- package/dist/types/components/ui/dialog.d.ts +15 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +10 -0
- package/dist/types/components/ui/input.d.ts +6 -0
- package/dist/types/components/ui/popover.d.ts +7 -0
- package/dist/types/components/ui/segmented-control.d.ts +17 -0
- package/dist/types/components/ui/select.d.ts +8 -0
- package/dist/types/components/ui/tabs.d.ts +10 -0
- package/dist/types/components/ui/theme-switch.d.ts +12 -0
- package/dist/types/constants/drawer.d.ts +1 -0
- package/dist/types/context/drawer-expand-context.d.ts +7 -0
- package/dist/types/context/portal-container-context.d.ts +14 -0
- package/dist/types/hooks/table-orchestration-store.d.ts +75 -0
- package/dist/types/hooks/use-scroll-activity.d.ts +1 -0
- package/dist/types/hooks/useDemoTheme.d.ts +8 -0
- package/dist/types/hooks/useRowDragOverride.d.ts +6 -0
- package/dist/types/hooks/useTableOrchestration.d.ts +115 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/lib/column-gaps.d.ts +3 -0
- package/dist/types/lib/filter-stats.d.ts +2 -0
- package/dist/types/lib/format-enum.d.ts +1 -0
- package/dist/types/lib/format-timestamp.d.ts +4 -0
- package/dist/types/lib/style-scope.d.ts +19 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/package.json +114 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TwoPanelMenuItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TwoPanelMenuGroup {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
items: TwoPanelMenuItem[];
|
|
11
|
+
}
|
|
12
|
+
interface TwoPanelMenuBaseProps {
|
|
13
|
+
groups: TwoPanelMenuGroup[];
|
|
14
|
+
activeCountPerGroup?: Record<string, number>;
|
|
15
|
+
trigger: React.ReactNode;
|
|
16
|
+
width?: number;
|
|
17
|
+
renderRightPanel: (group: TwoPanelMenuGroup, onClose: () => void) => React.ReactNode;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function TwoPanelMenuBase({ groups, activeCountPerGroup, trigger, width, renderRightPanel, open, onOpenChange, }: TwoPanelMenuBaseProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ViewChipProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
label: string;
|
|
4
|
+
active?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ViewChip: React.ForwardRefExoticComponent<ViewChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface AmountCellProps {
|
|
2
|
+
inAmount: number;
|
|
3
|
+
inCurrency: string;
|
|
4
|
+
outAmount: number;
|
|
5
|
+
outCurrency: string;
|
|
6
|
+
inAmountConfirmed?: number;
|
|
7
|
+
outAmountConfirmed?: number;
|
|
8
|
+
mutedCurrency?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function AmountCell({ inAmount, inCurrency, outAmount, outCurrency, inAmountConfirmed, outAmountConfirmed, mutedCurrency, }: AmountCellProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ConfirmedAmountCellProps {
|
|
2
|
+
value: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
confirmedValue?: number | null;
|
|
5
|
+
copyTitle?: string;
|
|
6
|
+
confirmedCopyTitle?: string;
|
|
7
|
+
mutedCurrency?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function ConfirmedAmountCell({ value, currency, confirmedValue, copyTitle, confirmedCopyTitle, mutedCurrency, }: ConfirmedAmountCellProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface CurrencyAmountCellProps {
|
|
2
|
+
value: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
copyTitle?: string;
|
|
5
|
+
mutedCurrency?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function CurrencyAmountCell({ value, currency, copyTitle, mutedCurrency, }: CurrencyAmountCellProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
interface DualLineCellProps {
|
|
2
|
+
primary: string;
|
|
3
|
+
secondary: string;
|
|
4
|
+
primaryCopyTitle?: string;
|
|
5
|
+
secondaryCopyTitle?: string;
|
|
6
|
+
primaryVariant?: "default" | "mono";
|
|
7
|
+
primaryLabel?: string;
|
|
8
|
+
secondaryLabel?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Controls visual weight of the secondary line.
|
|
11
|
+
*
|
|
12
|
+
* Rule of thumb:
|
|
13
|
+
* - `true` — when both lines represent **independent, equally-important
|
|
14
|
+
* entities or operational values** (e.g. Merchant + Merchant TX ID,
|
|
15
|
+
* Merchant Fee % + Provider Fee %, Requisite + Holder). Secondary line
|
|
16
|
+
* uses `--text-primary` so neither side is downplayed.
|
|
17
|
+
* - `false` (default) — when the secondary line is genuinely **helper /
|
|
18
|
+
* metadata / previous-value** (e.g. base rate type, "confirmed" amount).
|
|
19
|
+
* Secondary line uses `--text-secondary`.
|
|
20
|
+
*
|
|
21
|
+
* Do not pick this flag based on visual position alone — pick it based on
|
|
22
|
+
* the semantic role of the secondary value.
|
|
23
|
+
*/
|
|
24
|
+
equalWeight?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Render the primary line as `start…end` when its length warrants it.
|
|
27
|
+
* Only applies to `primaryVariant="mono"`. Pass `true` for default head=6,
|
|
28
|
+
* tail=6 or supply explicit head/tail counts.
|
|
29
|
+
*/
|
|
30
|
+
primaryTruncateMiddle?: boolean | {
|
|
31
|
+
head?: number;
|
|
32
|
+
tail?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Render the secondary line as `start…end` when long. The secondary line is
|
|
36
|
+
* always mono, so this works regardless of the primary variant.
|
|
37
|
+
*/
|
|
38
|
+
secondaryTruncateMiddle?: boolean | {
|
|
39
|
+
head?: number;
|
|
40
|
+
tail?: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare function DualLineCell({ primary, secondary, primaryCopyTitle, secondaryCopyTitle, primaryVariant, primaryLabel, secondaryLabel, equalWeight, primaryTruncateMiddle, secondaryTruncateMiddle, }: DualLineCellProps): import("react").JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BadgeVariant } from "../types.js";
|
|
2
|
+
interface EnumBadgeCellProps {
|
|
3
|
+
value: string;
|
|
4
|
+
variantMap: Record<string, BadgeVariant>;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function EnumBadgeCell({ value, variantMap, label, className }: EnumBadgeCellProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface MonoIdCellProps {
|
|
2
|
+
value: string;
|
|
3
|
+
copyTitle?: string;
|
|
4
|
+
/** Show value as `start…end`. Default: true. */
|
|
5
|
+
truncate?: boolean;
|
|
6
|
+
/** Visible characters from the start. Default: 6. */
|
|
7
|
+
truncateHead?: number;
|
|
8
|
+
/** Visible characters from the end. Default: 6. */
|
|
9
|
+
truncateTail?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Minimum length at which truncation kicks in.
|
|
12
|
+
* Default: head + tail + 2 (truncation must save at least one character).
|
|
13
|
+
* Shorter strings render in full.
|
|
14
|
+
*/
|
|
15
|
+
truncateThreshold?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function truncateMiddle(value: string, head: number, tail: number, threshold: number): string;
|
|
18
|
+
export declare function MonoIdCell({ value, copyTitle, truncate, truncateHead, truncateTail, truncateThreshold, }: MonoIdCellProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type ColumnFilterType = "text" | "enum" | "date" | "number-range" | "compound";
|
|
2
|
+
export interface CompoundSubFilter {
|
|
3
|
+
key: string;
|
|
4
|
+
type: "text" | "number-range" | "enum";
|
|
5
|
+
label: string;
|
|
6
|
+
badge?: string;
|
|
7
|
+
field: string;
|
|
8
|
+
options?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export interface ColumnFilterConfig {
|
|
14
|
+
type: ColumnFilterType;
|
|
15
|
+
label: string;
|
|
16
|
+
fieldName?: string;
|
|
17
|
+
options?: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
subFilters?: CompoundSubFilter[];
|
|
22
|
+
}
|
|
23
|
+
export type ActiveFilterValue = string | string[] | {
|
|
24
|
+
from?: string;
|
|
25
|
+
to?: string;
|
|
26
|
+
} | {
|
|
27
|
+
from?: number;
|
|
28
|
+
to?: number;
|
|
29
|
+
} | {
|
|
30
|
+
[key: string]: ActiveFilterValue;
|
|
31
|
+
};
|
|
32
|
+
export interface ActiveFilter {
|
|
33
|
+
columnId: string;
|
|
34
|
+
value: ActiveFilterValue;
|
|
35
|
+
}
|
|
36
|
+
export type FilterColumnStats = {
|
|
37
|
+
type: "number-range";
|
|
38
|
+
min: number;
|
|
39
|
+
max: number;
|
|
40
|
+
} | {
|
|
41
|
+
type: "text";
|
|
42
|
+
samples: string[];
|
|
43
|
+
totalUnique: number;
|
|
44
|
+
} | {
|
|
45
|
+
type: "date";
|
|
46
|
+
min: string;
|
|
47
|
+
max: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "enum";
|
|
50
|
+
counts: Record<string, number>;
|
|
51
|
+
};
|
|
52
|
+
export interface FilterStatsSlice {
|
|
53
|
+
all: FilterColumnStats;
|
|
54
|
+
filtered: FilterColumnStats | null;
|
|
55
|
+
}
|
|
56
|
+
export interface ColumnGroup {
|
|
57
|
+
key: string;
|
|
58
|
+
label: string;
|
|
59
|
+
columnIds: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface ColumnGap {
|
|
62
|
+
afterColumnId: string | null;
|
|
63
|
+
hiddenIds: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface ViewPreset<TRow, TViewKey extends string> {
|
|
66
|
+
key: TViewKey;
|
|
67
|
+
label: string;
|
|
68
|
+
filters: ActiveFilter[];
|
|
69
|
+
sort: {
|
|
70
|
+
columnId: string;
|
|
71
|
+
direction: "asc" | "desc";
|
|
72
|
+
} | null;
|
|
73
|
+
columnVisibility?: Record<string, boolean>;
|
|
74
|
+
customFilter?: (row: TRow) => boolean;
|
|
75
|
+
customFilterChip?: {
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ColumnMetaDef } from "../types.js";
|
|
2
|
+
export declare function useColumnResize(defaults: Record<string, ColumnMetaDef>, initialWidths?: Record<string, number>): {
|
|
3
|
+
widths: Record<string, number>;
|
|
4
|
+
totalWidth: number;
|
|
5
|
+
onPointerDown: (colId: string, e: React.PointerEvent) => void;
|
|
6
|
+
setWidths: import("react").Dispatch<import("react").SetStateAction<Record<string, number>>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface RowDragProps {
|
|
2
|
+
draggable: true;
|
|
3
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
4
|
+
onDragOver: (e: React.DragEvent) => void;
|
|
5
|
+
onDragLeave: () => void;
|
|
6
|
+
onDrop: (e: React.DragEvent) => void;
|
|
7
|
+
onDragEnd: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface UseRowDragResult {
|
|
10
|
+
dragRowIdx: number | null;
|
|
11
|
+
dropTargetIdx: number | null;
|
|
12
|
+
getDragProps: (rowIndex: number) => RowDragProps;
|
|
13
|
+
}
|
|
14
|
+
export declare function useRowDrag<T>(source: T[], onReorder: (items: T[]) => void): UseRowDragResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function getVisiblePageNumbers(currentPage: number, totalPages: number, maxVisible?: number): number[];
|
|
2
|
+
export declare function useTablePagination(totalItems: number, itemsPerPage?: number): {
|
|
3
|
+
page: number;
|
|
4
|
+
setPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
5
|
+
safePage: number;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
pageNumbers: number[];
|
|
8
|
+
paginate: <T>(items: T[]) => T[];
|
|
9
|
+
resetPage: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SortDirection } from "../types.js";
|
|
2
|
+
export declare function useTableSort(onSortChange?: () => void): {
|
|
3
|
+
sortState: Record<string, SortDirection>;
|
|
4
|
+
toggleSort: (columnId: string) => void;
|
|
5
|
+
applySorting: <T>(items: T[], getSortValue: (item: T, col: string) => string | number) => T[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ActiveFilter, ActiveFilterValue } from "./filter-types.js";
|
|
2
|
+
export type ManagedFilterChange = {
|
|
3
|
+
columnId: string;
|
|
4
|
+
action: "set";
|
|
5
|
+
value: ActiveFilterValue;
|
|
6
|
+
} | {
|
|
7
|
+
columnId: string;
|
|
8
|
+
action: "remove";
|
|
9
|
+
};
|
|
10
|
+
interface OrchSlice {
|
|
11
|
+
columnFilters: ActiveFilter[];
|
|
12
|
+
handleSetColumnFilter: (columnId: string, value: ActiveFilterValue) => void;
|
|
13
|
+
handleRemoveColumnFilter: (columnId: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function applyManagedChanges(orch: OrchSlice, changes: ManagedFilterChange[]): void;
|
|
16
|
+
export declare function clearManagedFilters(orch: OrchSlice, managedColumnIds: string[]): void;
|
|
17
|
+
export declare function hasActiveManagedFilters(filters: ActiveFilter[], managedFieldIds: readonly string[]): boolean;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { ColumnMetaDef } from "./types.js";
|
|
3
|
+
export declare function stickyStyle(meta: ColumnMetaDef | undefined, isHeader: boolean): CSSProperties | undefined;
|
|
4
|
+
export declare function stickyBorderClass(meta: ColumnMetaDef | undefined): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
export type SortDirection = "asc" | "desc" | false;
|
|
3
|
+
export type ViewMode = "list" | "grid";
|
|
4
|
+
export type BadgeVariant = "success" | "warning" | "danger" | "info" | "neutral" | "purple" | "sky" | "indigo";
|
|
5
|
+
export interface ColumnMetaDef {
|
|
6
|
+
minW: number;
|
|
7
|
+
sticky?: "left" | "right";
|
|
8
|
+
stickyOffset?: number;
|
|
9
|
+
borderEdge?: "right" | "left" | null;
|
|
10
|
+
variant?: "control";
|
|
11
|
+
}
|
|
12
|
+
export interface BulkAction {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
variant?: "default" | "danger";
|
|
16
|
+
}
|
|
17
|
+
export type RowActionVariant = "default" | "danger" | "accent";
|
|
18
|
+
export interface RowActionItem {
|
|
19
|
+
icon: React.ComponentType<{
|
|
20
|
+
className?: string;
|
|
21
|
+
}>;
|
|
22
|
+
label: string;
|
|
23
|
+
onClick: (e: React.MouseEvent) => void;
|
|
24
|
+
variant?: RowActionVariant;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface RowActionSection {
|
|
28
|
+
label: string;
|
|
29
|
+
actions: RowActionItem[];
|
|
30
|
+
}
|
|
31
|
+
export interface StatusConfigEntry {
|
|
32
|
+
label: string;
|
|
33
|
+
variant: BadgeVariant;
|
|
34
|
+
}
|
|
35
|
+
export type StickyStyleResult = CSSProperties | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SidebarProps } from "./Sidebar.js";
|
|
3
|
+
import { type TopBarProps } from "./TopBar.js";
|
|
4
|
+
export interface AppShellProps {
|
|
5
|
+
collapsed?: boolean;
|
|
6
|
+
defaultCollapsed?: boolean;
|
|
7
|
+
onCollapsedChange?: (next: boolean) => void;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function AppShellRoot({ collapsed: controlledCollapsed, defaultCollapsed, onCollapsedChange: onCollapsedChangeProp, children, className, }: AppShellProps): React.JSX.Element;
|
|
12
|
+
declare function AppShellSidebar(props: SidebarProps): React.JSX.Element;
|
|
13
|
+
declare function AppShellHeader(props: TopBarProps): React.JSX.Element;
|
|
14
|
+
declare function AppShellContent({ children, className, }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
export declare const AppShell: typeof AppShellRoot & {
|
|
19
|
+
Sidebar: typeof AppShellSidebar;
|
|
20
|
+
Header: typeof AppShellHeader;
|
|
21
|
+
Content: typeof AppShellContent;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { NavGroup } from "./types.js";
|
|
3
|
+
export interface SidebarProps {
|
|
4
|
+
groups: NavGroup[];
|
|
5
|
+
activeKey?: string;
|
|
6
|
+
collapsed?: boolean;
|
|
7
|
+
onCollapsedChange?: (next: boolean) => void;
|
|
8
|
+
renderLink?: (href: string, props: {
|
|
9
|
+
className: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => React.ReactNode;
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
footer?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
export interface AccountMenuItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: LucideIcon;
|
|
6
|
+
variant?: "default" | "destructive";
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface SidebarAccountMenuProps {
|
|
10
|
+
name: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
avatarUrl?: string;
|
|
13
|
+
theme?: "light" | "dark";
|
|
14
|
+
onThemeChange?: (value: "light" | "dark") => void;
|
|
15
|
+
menuItems?: AccountMenuItem[];
|
|
16
|
+
onSignOut?: () => void;
|
|
17
|
+
collapsed?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function SidebarAccountMenu({ name, role, avatarUrl, theme, onThemeChange, menuItems, onSignOut, collapsed: collapsedProp, className, }: SidebarAccountMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SidebarUserProps {
|
|
3
|
+
name: string;
|
|
4
|
+
avatarUrl?: string;
|
|
5
|
+
collapsed?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const SidebarUser: React.ForwardRefExoticComponent<SidebarUserProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface AppShellContextValue {
|
|
2
|
+
collapsed: boolean;
|
|
3
|
+
hovering: boolean;
|
|
4
|
+
effectiveCollapsed: boolean;
|
|
5
|
+
onCollapsedChange: (next: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const AppShellContext: import("react").Context<AppShellContextValue | null>;
|
|
8
|
+
export declare function useAppShell(): AppShellContextValue | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AppShell } from "./AppShell.js";
|
|
2
|
+
export type { AppShellProps } from "./AppShell.js";
|
|
3
|
+
export { Sidebar } from "./Sidebar.js";
|
|
4
|
+
export type { SidebarProps } from "./Sidebar.js";
|
|
5
|
+
export { TopBar } from "./TopBar.js";
|
|
6
|
+
export type { TopBarProps } from "./TopBar.js";
|
|
7
|
+
export { SidebarUser } from "./SidebarUser.js";
|
|
8
|
+
export type { SidebarUserProps } from "./SidebarUser.js";
|
|
9
|
+
export { useAppShell } from "./app-shell-context.js";
|
|
10
|
+
export type { NavItem, NavGroup } from "./types.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "success" | "warning" | "danger" | "info" | "neutral" | "purple" | "sky" | "indigo" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ButtonFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** "stretch" (default, current behavior) | "end" (natural-width, right-aligned) */
|
|
5
|
+
align?: "stretch" | "end";
|
|
6
|
+
}
|
|
7
|
+
export declare function ButtonFooter({ children, className, align, ...props }: ButtonFooterProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
+
} & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
9
|
+
label?: string;
|
|
10
|
+
shouldFilter?: boolean;
|
|
11
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
loop?: boolean;
|
|
16
|
+
disablePointerSelection?: boolean;
|
|
17
|
+
vimBindings?: boolean;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
20
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
21
|
+
} & {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
24
|
+
value?: string;
|
|
25
|
+
onValueChange?: (search: string) => void;
|
|
26
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
27
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
30
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
31
|
+
} & {
|
|
32
|
+
asChild?: boolean;
|
|
33
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
34
|
+
label?: string;
|
|
35
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
39
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
40
|
+
} & {
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
46
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
47
|
+
} & {
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
50
|
+
heading?: React.ReactNode;
|
|
51
|
+
value?: string;
|
|
52
|
+
forceMount?: boolean;
|
|
53
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
} & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
onSelect?: (value: string) => void;
|
|
63
|
+
value?: string;
|
|
64
|
+
keywords?: string[];
|
|
65
|
+
forceMount?: boolean;
|
|
66
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem };
|
|
68
|
+
export interface ComboboxOption<TValue extends string = string> {
|
|
69
|
+
value: TValue;
|
|
70
|
+
label: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ComboboxProps<TValue extends string = string> {
|
|
75
|
+
value: TValue | null;
|
|
76
|
+
onChange: (value: TValue | null) => void;
|
|
77
|
+
options: ComboboxOption<TValue>[];
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
searchPlaceholder?: string;
|
|
80
|
+
emptyText?: string;
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/** Allow clearing the selection by clicking the selected item again. Default true. */
|
|
83
|
+
clearable?: boolean;
|
|
84
|
+
className?: string;
|
|
85
|
+
triggerClassName?: string;
|
|
86
|
+
contentClassName?: string;
|
|
87
|
+
/** Custom render of the selected label inside the trigger. */
|
|
88
|
+
renderSelected?: (option: ComboboxOption<TValue>) => React.ReactNode;
|
|
89
|
+
/** Accessible name for the trigger button (e.g. the field label). */
|
|
90
|
+
triggerAriaLabel?: string;
|
|
91
|
+
}
|
|
92
|
+
export declare function Combobox<TValue extends string = string>({ value, onChange, options, placeholder, searchPlaceholder, emptyText, disabled, clearable, className, triggerClassName, contentClassName, renderSelected, triggerAriaLabel, }: ComboboxProps<TValue>): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
14
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogTitle, DialogDescription, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuTrigger, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { LucideIcon } from "lucide-react";
|
|
3
|
+
export interface SegmentedControlOption<T extends string> {
|
|
4
|
+
value: T;
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: LucideIcon;
|
|
7
|
+
/** Accessible name for icon-only options, which render no visible text. */
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SegmentedControlProps<T extends string> extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
11
|
+
value: T;
|
|
12
|
+
options: readonly SegmentedControlOption<T>[];
|
|
13
|
+
onValueChange?: (value: T) => void;
|
|
14
|
+
variant?: "toolbar";
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function SegmentedControl<T extends string>({ value, options, onValueChange, variant, label, className, ...props }: SegmentedControlProps<T>): React.JSX.Element;
|