@refraction-ui/react 0.22.0 → 0.23.1
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/{chunk-V24GDHUX.js → chunk-4ACSHPCM.js} +2 -2
- package/dist/{chunk-SDAJVXD4.js → chunk-5P56PN3J.js} +2 -2
- package/dist/chunk-75BKRTPO.js +417 -0
- package/dist/{chunk-2Q6HHFAN.js.map → chunk-75BKRTPO.js.map} +1 -1
- package/dist/chunk-7P7EJ56S.js +7 -0
- package/dist/{chunk-QPCKJ2YR.js → chunk-GG6MZDGV.js} +2 -2
- package/dist/{chunk-QDMLIDYN.js → chunk-GU5MI7FX.js} +2 -2
- package/dist/{chunk-3Y2T26QD.js → chunk-JZQ5ZL46.js} +6 -4
- package/dist/{chunk-3Y2T26QD.js.map → chunk-JZQ5ZL46.js.map} +2 -2
- package/dist/{chunk-RSWOLRIC.js → chunk-KIZD73DK.js} +2 -2
- package/dist/{chunk-XMFNBOPO.js → chunk-PY2TIFCT.js} +2 -2
- package/dist/{chunk-XWP763SH.js → chunk-V727VZOE.js} +4 -2
- package/dist/{chunk-XWP763SH.js.map → chunk-V727VZOE.js.map} +2 -2
- package/dist/{chunk-3I3DYDHR.js → chunk-WNLYPQOS.js} +2 -2
- package/dist/{chunk-63N4PZUJ.js → chunk-X6HEKRWE.js} +2 -2
- package/dist/{chunk-WYKPPK3W.js → chunk-XAJDSVZR.js} +2 -2
- package/dist/faro-engine-VIUXJAPH-FSARIABU.js +3 -0
- package/dist/{faro-engine-47HGRAQH-JKINJPMH.js.map → faro-engine-VIUXJAPH-FSARIABU.js.map} +1 -1
- package/dist/index.cjs +736 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/internal/avatar/index.d.cts +4 -1
- package/dist/internal/avatar/index.d.ts +4 -1
- package/dist/internal/data-table/index.d.cts +48 -3
- package/dist/internal/data-table/index.d.ts +48 -3
- package/dist/internal/line-chart/index.d.ts +17 -3
- package/dist/internal/native-select/index.d.ts +21 -0
- package/dist/internal/react-avatar/index.d.cts +4 -2
- package/dist/internal/react-avatar/index.d.ts +4 -2
- package/dist/internal/react-command/index.d.cts +13 -2
- package/dist/internal/react-command/index.d.ts +13 -2
- package/dist/internal/react-data-table/index.d.cts +27 -9
- package/dist/internal/react-data-table/index.d.ts +27 -9
- package/dist/internal/react-dialog/index.d.cts +5 -0
- package/dist/internal/react-dialog/index.d.ts +5 -0
- package/dist/internal/react-dropdown-menu/index.d.cts +19 -1
- package/dist/internal/react-dropdown-menu/index.d.ts +19 -1
- package/dist/internal/react-line-chart/index.d.ts +7 -2
- package/dist/internal/react-native-select/index.d.ts +19 -0
- package/dist/internal/react-stat-grid/index.d.ts +22 -11
- package/dist/internal/react-table/index.d.ts +39 -0
- package/dist/internal/stat-grid/index.d.ts +49 -7
- package/dist/internal/table/index.d.ts +46 -0
- package/dist/react-accordion.js +1 -1
- package/dist/react-action-list.js +1 -1
- package/dist/react-ai.js +1 -1
- package/dist/react-analytics.js +16 -4
- package/dist/react-analytics.js.map +2 -2
- package/dist/react-animated-text.js +1 -1
- package/dist/react-app-shell.js +1 -1
- package/dist/react-audience-feature-card.js +1 -1
- package/dist/react-audio-room.js +1 -1
- package/dist/react-auth.js +1 -1
- package/dist/react-avatar-group.js +1 -1
- package/dist/react-avatar.js +13 -9
- package/dist/react-avatar.js.map +2 -2
- package/dist/react-badge.js +1 -1
- package/dist/react-bottom-nav.js +1 -1
- package/dist/react-brand-network-cell.js +1 -1
- package/dist/react-breadcrumbs.js +1 -1
- package/dist/react-browser-chrome-mock.js +1 -1
- package/dist/react-button.js +3 -3
- package/dist/react-calendar.js +1 -1
- package/dist/react-call-controls.js +1 -1
- package/dist/react-callout.js +1 -1
- package/dist/react-card-grid.js +1 -1
- package/dist/react-card.js +1 -1
- package/dist/react-carousel.js +1 -1
- package/dist/react-charts.js +1 -1
- package/dist/react-checkbox.js +1 -1
- package/dist/react-checklist.js +1 -1
- package/dist/react-code-block.js +1 -1
- package/dist/react-code-editor.js +1 -1
- package/dist/react-collapsible.js +1 -1
- package/dist/react-combobox.js +1 -1
- package/dist/react-command-input.js +1 -1
- package/dist/react-command.js +115 -70
- package/dist/react-command.js.map +3 -3
- package/dist/react-composer.js +3 -3
- package/dist/react-content-protection.js +1 -1
- package/dist/react-conversation.js +5 -5
- package/dist/react-cookie-consent.js +1 -1
- package/dist/react-data-table.js +125 -114
- package/dist/react-data-table.js.map +2 -2
- package/dist/react-date-picker.js +1 -1
- package/dist/react-device-frame.js +1 -1
- package/dist/react-dialog.js +33 -9
- package/dist/react-dialog.js.map +2 -2
- package/dist/react-diff-viewer.js +1 -1
- package/dist/react-dropdown-menu.js +61 -8
- package/dist/react-dropdown-menu.js.map +3 -3
- package/dist/react-editor-status-bar.js +1 -1
- package/dist/react-editor-tabs.js +1 -1
- package/dist/react-emoji-picker.js +2 -2
- package/dist/react-empty-state.js +1 -1
- package/dist/react-feedback-dialog.js +2 -2
- package/dist/react-file-tree.js +1 -1
- package/dist/react-file-upload.js +1 -1
- package/dist/react-floating-reactions.js +1 -1
- package/dist/react-flow-editor.js +2 -2
- package/dist/react-footer.js +1 -1
- package/dist/react-funnel-chart.js +1 -1
- package/dist/react-graph-view.js +2 -2
- package/dist/react-infinite-canvas.js +2 -2
- package/dist/react-inline-editor.js +1 -1
- package/dist/react-input-group.js +1 -1
- package/dist/react-input.js +2 -2
- package/dist/react-install-prompt.js +1 -1
- package/dist/react-kanban-board.js +1 -1
- package/dist/react-keyboard-shortcut.js +2 -2
- package/dist/react-language-selector.js +1 -1
- package/dist/react-line-chart.js +49 -11
- package/dist/react-line-chart.js.map +2 -2
- package/dist/react-link-card.js +1 -1
- package/dist/react-live-captions.js +1 -1
- package/dist/react-live-cursors.js +1 -1
- package/dist/react-live-transcript.js +1 -1
- package/dist/react-location-selector.js +1 -1
- package/dist/react-logger.js +3 -3
- package/dist/react-markdown-renderer.js +2 -2
- package/dist/react-marquee-strip.js +1 -1
- package/dist/react-mascot.js +1 -1
- package/dist/react-mastery-bar.js +1 -1
- package/dist/react-mini-map.js +1 -1
- package/dist/react-mobile-nav.js +1 -1
- package/dist/react-native-select.js +52 -0
- package/dist/react-native-select.js.map +7 -0
- package/dist/react-navbar.js +1 -1
- package/dist/react-numbered-steps.js +1 -1
- package/dist/react-otp-input.js +1 -1
- package/dist/react-page-header.js +1 -1
- package/dist/react-pagination.js +1 -1
- package/dist/react-password-input.js +2 -2
- package/dist/react-payment.js +1 -1
- package/dist/react-popover.js +1 -1
- package/dist/react-pre-call-lobby.js +1 -1
- package/dist/react-presence-indicator.js +1 -1
- package/dist/react-pricing-card.js +1 -1
- package/dist/react-progress-display.js +1 -1
- package/dist/react-radial-gauge.js +1 -1
- package/dist/react-radio.js +1 -1
- package/dist/react-rating-scale.js +1 -1
- package/dist/react-reaction-bar.js +1 -1
- package/dist/react-resizable-layout.js +1 -1
- package/dist/react-search-bar.js +1 -1
- package/dist/react-section-head.js +1 -1
- package/dist/react-segmented-control.js +1 -1
- package/dist/react-select.js +1 -1
- package/dist/react-separator.js +1 -1
- package/dist/react-sheet.js +1 -1
- package/dist/react-sidebar.js +1 -1
- package/dist/react-skeleton.js +1 -1
- package/dist/react-skip-to-content.js +1 -1
- package/dist/react-slide-viewer.js +1 -1
- package/dist/react-slider.js +1 -1
- package/dist/react-slot-picker.js +1 -1
- package/dist/react-social-auth-button.js +3 -3
- package/dist/react-sortable-list.js +1 -1
- package/dist/react-stat-grid.js +91 -22
- package/dist/react-stat-grid.js.map +2 -2
- package/dist/react-status-indicator.js +1 -1
- package/dist/react-steps.js +1 -1
- package/dist/react-sticky-note.js +1 -1
- package/dist/react-switch.js +1 -1
- package/dist/react-table-of-contents.js +1 -1
- package/dist/react-table.js +148 -0
- package/dist/react-table.js.map +7 -0
- package/dist/react-tabs.js +35 -6
- package/dist/react-tabs.js.map +2 -2
- package/dist/react-terminal.js +1 -1
- package/dist/react-test-results.js +1 -1
- package/dist/react-textarea.js +1 -1
- package/dist/react-thread-view.js +2 -2
- package/dist/react-timeline.js +1 -1
- package/dist/react-toast.js +1 -1
- package/dist/react-tooltip.js +1 -1
- package/dist/react-version-selector.js +1 -1
- package/dist/react-video-grid.js +2 -2
- package/dist/react-video-player.js +1 -1
- package/dist/react-video-tile.js +2 -2
- package/dist/react-voice-pill.js +1 -1
- package/dist/react-waveform.js +1 -1
- package/dist/react-wizard.js +1 -1
- package/dist/shared.js +53 -0
- package/dist/shared.js.map +7 -0
- package/package.json +3 -1
- package/dist/chunk-2Q6HHFAN.js +0 -164
- package/dist/chunk-SDZ3LROZ.js +0 -7
- package/dist/faro-engine-47HGRAQH-JKINJPMH.js +0 -3
- /package/dist/{chunk-V24GDHUX.js.map → chunk-4ACSHPCM.js.map} +0 -0
- /package/dist/{chunk-SDAJVXD4.js.map → chunk-5P56PN3J.js.map} +0 -0
- /package/dist/{chunk-SDZ3LROZ.js.map → chunk-7P7EJ56S.js.map} +0 -0
- /package/dist/{chunk-QPCKJ2YR.js.map → chunk-GG6MZDGV.js.map} +0 -0
- /package/dist/{chunk-QDMLIDYN.js.map → chunk-GU5MI7FX.js.map} +0 -0
- /package/dist/{chunk-RSWOLRIC.js.map → chunk-KIZD73DK.js.map} +0 -0
- /package/dist/{chunk-XMFNBOPO.js.map → chunk-PY2TIFCT.js.map} +0 -0
- /package/dist/{chunk-3I3DYDHR.js.map → chunk-WNLYPQOS.js.map} +0 -0
- /package/dist/{chunk-63N4PZUJ.js.map → chunk-X6HEKRWE.js.map} +0 -0
- /package/dist/{chunk-WYKPPK3W.js.map → chunk-XAJDSVZR.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { cn, cva } from './internal/shared/index.cjs';
|
|
1
2
|
export * from './internal/react-accordion/index.cjs';
|
|
2
3
|
export * from './internal/react-ai/index.cjs';
|
|
3
4
|
export * from './internal/react-animated-text/index.cjs';
|
|
@@ -128,3 +129,5 @@ export * from './internal/react-action-list/index.cjs';
|
|
|
128
129
|
export * from './internal/react-funnel-chart/index.cjs';
|
|
129
130
|
export * from './internal/react-line-chart/index.cjs';
|
|
130
131
|
export * from './internal/react-page-header/index.cjs';
|
|
132
|
+
export * from './internal/react-table/index.cjs';
|
|
133
|
+
export * from './internal/react-native-select/index.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { cn, cva } from './internal/shared/index.js';
|
|
1
2
|
export * from './internal/react-accordion/index.js';
|
|
2
3
|
export * from './internal/react-ai/index.js';
|
|
3
4
|
export * from './internal/react-animated-text/index.js';
|
|
@@ -128,3 +129,5 @@ export * from './internal/react-action-list/index.js';
|
|
|
128
129
|
export * from './internal/react-funnel-chart/index.js';
|
|
129
130
|
export * from './internal/react-line-chart/index.js';
|
|
130
131
|
export * from './internal/react-page-header/index.js';
|
|
132
|
+
export * from './internal/react-table/index.js';
|
|
133
|
+
export * from './internal/react-native-select/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
export { cn, cva } from './shared.js';
|
|
2
3
|
export * from './react-accordion.js';
|
|
3
4
|
export * from './react-ai.js';
|
|
4
5
|
export * from './react-animated-text.js';
|
|
@@ -129,3 +130,5 @@ export * from './react-action-list.js';
|
|
|
129
130
|
export * from './react-funnel-chart.js';
|
|
130
131
|
export * from './react-line-chart.js';
|
|
131
132
|
export * from './react-page-header.js';
|
|
133
|
+
export * from './react-table.js';
|
|
134
|
+
export * from './react-native-select.js';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AccessibilityProps, TokenContract } from '../shared/index.cjs';
|
|
2
2
|
|
|
3
3
|
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
/** Outline of the avatar. */
|
|
5
|
+
type AvatarShape = 'circle' | 'square';
|
|
4
6
|
type AvatarLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
5
7
|
interface AvatarProps {
|
|
6
8
|
src?: string;
|
|
@@ -35,6 +37,7 @@ declare function createAvatar(props?: AvatarProps): AvatarAPI;
|
|
|
35
37
|
|
|
36
38
|
declare const avatarTokens: TokenContract;
|
|
37
39
|
declare const avatarVariants: (props?: ({
|
|
40
|
+
shape?: "circle" | "square" | undefined;
|
|
38
41
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
39
42
|
} & {
|
|
40
43
|
className?: string;
|
|
@@ -50,4 +53,4 @@ declare const avatarFallbackVariants: (props?: ({
|
|
|
50
53
|
className?: string;
|
|
51
54
|
}) | undefined) => string;
|
|
52
55
|
|
|
53
|
-
export { type AvatarAPI, type AvatarLoadingStatus, type AvatarProps, type AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, createAvatar, getInitials };
|
|
56
|
+
export { type AvatarAPI, type AvatarLoadingStatus, type AvatarProps, type AvatarShape, type AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, createAvatar, getInitials };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AccessibilityProps, TokenContract } from '../shared/index.js';
|
|
2
2
|
|
|
3
3
|
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
/** Outline of the avatar. */
|
|
5
|
+
type AvatarShape = 'circle' | 'square';
|
|
4
6
|
type AvatarLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
5
7
|
interface AvatarProps {
|
|
6
8
|
src?: string;
|
|
@@ -35,6 +37,7 @@ declare function createAvatar(props?: AvatarProps): AvatarAPI;
|
|
|
35
37
|
|
|
36
38
|
declare const avatarTokens: TokenContract;
|
|
37
39
|
declare const avatarVariants: (props?: ({
|
|
40
|
+
shape?: "circle" | "square" | undefined;
|
|
38
41
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
39
42
|
} & {
|
|
40
43
|
className?: string;
|
|
@@ -50,4 +53,4 @@ declare const avatarFallbackVariants: (props?: ({
|
|
|
50
53
|
className?: string;
|
|
51
54
|
}) | undefined) => string;
|
|
52
55
|
|
|
53
|
-
export { type AvatarAPI, type AvatarLoadingStatus, type AvatarProps, type AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, createAvatar, getInitials };
|
|
56
|
+
export { type AvatarAPI, type AvatarLoadingStatus, type AvatarProps, type AvatarShape, type AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, createAvatar, getInitials };
|
|
@@ -5,14 +5,47 @@ interface ColumnDef<T = Record<string, unknown>> {
|
|
|
5
5
|
id: string;
|
|
6
6
|
/** Column header text */
|
|
7
7
|
header: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Value of this column for a row. Drives sorting, filtering and — when no
|
|
10
|
+
* `cell` renderer is given — the rendered text. Optional for display-only
|
|
11
|
+
* columns that set `cell`.
|
|
12
|
+
*/
|
|
13
|
+
accessor?: (row: T) => unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Custom cell renderer. Framework adapters narrow the return type (React:
|
|
16
|
+
* `ReactNode`). When omitted the cell renders `String(accessor(row))`.
|
|
17
|
+
*/
|
|
18
|
+
cell?: (row: T, index: number) => unknown;
|
|
19
|
+
/** Horizontal alignment of header and cells. Defaults to `start`. */
|
|
20
|
+
align?: DataTableAlign;
|
|
21
|
+
/** Numeric column: tabular figures, no wrapping, aligned to `end` unless `align` says otherwise. */
|
|
22
|
+
numeric?: boolean;
|
|
23
|
+
/** Extra class for this column's data cells. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Extra class for this column's header cell. */
|
|
26
|
+
headerClassName?: string;
|
|
10
27
|
/** Whether this column is sortable */
|
|
11
28
|
sortable?: boolean;
|
|
12
29
|
/** Whether this column is filterable */
|
|
13
30
|
filterable?: boolean;
|
|
14
31
|
}
|
|
15
32
|
type SortDirection = 'asc' | 'desc';
|
|
33
|
+
/** Horizontal alignment of a column (logical, RTL-safe). */
|
|
34
|
+
type DataTableAlign = 'start' | 'center' | 'end';
|
|
35
|
+
/** A column's effective alignment: explicit `align`, else `end` for numeric columns. */
|
|
36
|
+
declare function resolveColumnAlign(col: {
|
|
37
|
+
align?: DataTableAlign;
|
|
38
|
+
numeric?: boolean;
|
|
39
|
+
}): DataTableAlign;
|
|
40
|
+
/** The raw value of a column for a row (`undefined` without an accessor). */
|
|
41
|
+
declare function getColumnValue<T>(col: {
|
|
42
|
+
accessor?: (row: T) => unknown;
|
|
43
|
+
}, row: T): unknown;
|
|
44
|
+
/**
|
|
45
|
+
* Stable React/DOM key for a row: `getRowKey` when given, else the row's
|
|
46
|
+
* index. Prefer a `getRowKey` — index keys break row state on sort/filter.
|
|
47
|
+
*/
|
|
48
|
+
declare function resolveRowKey<T>(row: T, index: number, getRowKey?: (row: T, index: number) => string | number): string | number;
|
|
16
49
|
interface DataTableProps<T = Record<string, unknown>> {
|
|
17
50
|
/** Column definitions */
|
|
18
51
|
columns: ColumnDef<T>[];
|
|
@@ -69,5 +102,17 @@ declare const rowVariants: (props?: ({
|
|
|
69
102
|
} & {
|
|
70
103
|
className?: string;
|
|
71
104
|
}) | undefined) => string;
|
|
105
|
+
/** Logical text alignment per column alignment. */
|
|
106
|
+
declare const dataTableAlignClass: {
|
|
107
|
+
readonly start: "text-start";
|
|
108
|
+
readonly center: "text-center";
|
|
109
|
+
readonly end: "text-end";
|
|
110
|
+
};
|
|
111
|
+
/** Numeric cells: tabular figures, no wrapping. */
|
|
112
|
+
declare const dataTableNumericClass = "tabular-nums whitespace-nowrap";
|
|
113
|
+
/** Button inside a sortable header: the keyboard-reachable sort control. */
|
|
114
|
+
declare const dataTableSortButtonClass = "inline-flex items-center gap-1 rounded-sm font-inherit text-inherit focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
115
|
+
/** Rows with a row action: pointer + keyboard focus ring. */
|
|
116
|
+
declare const dataTableActionRowClass = "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";
|
|
72
117
|
|
|
73
|
-
export { type ColumnDef, type DataTableAPI, type DataTableProps, type DataTableState, type SortDirection, cellVariants, createDataTable, headerVariants, rowVariants, tableVariants };
|
|
118
|
+
export { type ColumnDef, type DataTableAPI, type DataTableAlign, type DataTableProps, type DataTableState, type SortDirection, cellVariants, createDataTable, dataTableActionRowClass, dataTableAlignClass, dataTableNumericClass, dataTableSortButtonClass, getColumnValue, headerVariants, resolveColumnAlign, resolveRowKey, rowVariants, tableVariants };
|
|
@@ -5,14 +5,47 @@ interface ColumnDef<T = Record<string, unknown>> {
|
|
|
5
5
|
id: string;
|
|
6
6
|
/** Column header text */
|
|
7
7
|
header: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Value of this column for a row. Drives sorting, filtering and — when no
|
|
10
|
+
* `cell` renderer is given — the rendered text. Optional for display-only
|
|
11
|
+
* columns that set `cell`.
|
|
12
|
+
*/
|
|
13
|
+
accessor?: (row: T) => unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Custom cell renderer. Framework adapters narrow the return type (React:
|
|
16
|
+
* `ReactNode`). When omitted the cell renders `String(accessor(row))`.
|
|
17
|
+
*/
|
|
18
|
+
cell?: (row: T, index: number) => unknown;
|
|
19
|
+
/** Horizontal alignment of header and cells. Defaults to `start`. */
|
|
20
|
+
align?: DataTableAlign;
|
|
21
|
+
/** Numeric column: tabular figures, no wrapping, aligned to `end` unless `align` says otherwise. */
|
|
22
|
+
numeric?: boolean;
|
|
23
|
+
/** Extra class for this column's data cells. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Extra class for this column's header cell. */
|
|
26
|
+
headerClassName?: string;
|
|
10
27
|
/** Whether this column is sortable */
|
|
11
28
|
sortable?: boolean;
|
|
12
29
|
/** Whether this column is filterable */
|
|
13
30
|
filterable?: boolean;
|
|
14
31
|
}
|
|
15
32
|
type SortDirection = 'asc' | 'desc';
|
|
33
|
+
/** Horizontal alignment of a column (logical, RTL-safe). */
|
|
34
|
+
type DataTableAlign = 'start' | 'center' | 'end';
|
|
35
|
+
/** A column's effective alignment: explicit `align`, else `end` for numeric columns. */
|
|
36
|
+
declare function resolveColumnAlign(col: {
|
|
37
|
+
align?: DataTableAlign;
|
|
38
|
+
numeric?: boolean;
|
|
39
|
+
}): DataTableAlign;
|
|
40
|
+
/** The raw value of a column for a row (`undefined` without an accessor). */
|
|
41
|
+
declare function getColumnValue<T>(col: {
|
|
42
|
+
accessor?: (row: T) => unknown;
|
|
43
|
+
}, row: T): unknown;
|
|
44
|
+
/**
|
|
45
|
+
* Stable React/DOM key for a row: `getRowKey` when given, else the row's
|
|
46
|
+
* index. Prefer a `getRowKey` — index keys break row state on sort/filter.
|
|
47
|
+
*/
|
|
48
|
+
declare function resolveRowKey<T>(row: T, index: number, getRowKey?: (row: T, index: number) => string | number): string | number;
|
|
16
49
|
interface DataTableProps<T = Record<string, unknown>> {
|
|
17
50
|
/** Column definitions */
|
|
18
51
|
columns: ColumnDef<T>[];
|
|
@@ -69,5 +102,17 @@ declare const rowVariants: (props?: ({
|
|
|
69
102
|
} & {
|
|
70
103
|
className?: string;
|
|
71
104
|
}) | undefined) => string;
|
|
105
|
+
/** Logical text alignment per column alignment. */
|
|
106
|
+
declare const dataTableAlignClass: {
|
|
107
|
+
readonly start: "text-start";
|
|
108
|
+
readonly center: "text-center";
|
|
109
|
+
readonly end: "text-end";
|
|
110
|
+
};
|
|
111
|
+
/** Numeric cells: tabular figures, no wrapping. */
|
|
112
|
+
declare const dataTableNumericClass = "tabular-nums whitespace-nowrap";
|
|
113
|
+
/** Button inside a sortable header: the keyboard-reachable sort control. */
|
|
114
|
+
declare const dataTableSortButtonClass = "inline-flex items-center gap-1 rounded-sm font-inherit text-inherit focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
115
|
+
/** Rows with a row action: pointer + keyboard focus ring. */
|
|
116
|
+
declare const dataTableActionRowClass = "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";
|
|
72
117
|
|
|
73
|
-
export { type ColumnDef, type DataTableAPI, type DataTableProps, type DataTableState, type SortDirection, cellVariants, createDataTable, headerVariants, rowVariants, tableVariants };
|
|
118
|
+
export { type ColumnDef, type DataTableAPI, type DataTableAlign, type DataTableProps, type DataTableState, type SortDirection, cellVariants, createDataTable, dataTableActionRowClass, dataTableAlignClass, dataTableNumericClass, dataTableSortButtonClass, getColumnValue, headerVariants, resolveColumnAlign, resolveRowKey, rowVariants, tableVariants };
|
|
@@ -25,11 +25,14 @@ interface LineChartOptions {
|
|
|
25
25
|
/** viewBox height. */
|
|
26
26
|
height: number;
|
|
27
27
|
padding?: Partial<LineChartPadding>;
|
|
28
|
-
/**
|
|
28
|
+
/** Target number of gridline intervals on the y-axis (the nice scale may use fewer). */
|
|
29
29
|
tickCount?: number;
|
|
30
30
|
/** Headroom multiplier above the largest value. */
|
|
31
31
|
headroom?: number;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Show every n-th x label (the last label is always shown). Defaults to
|
|
34
|
+
* thinning so labels are at least ~48 viewBox units apart.
|
|
35
|
+
*/
|
|
33
36
|
labelEvery?: number;
|
|
34
37
|
}
|
|
35
38
|
interface LineChartTick {
|
|
@@ -77,6 +80,17 @@ declare const DEFAULT_LINE_CHART_WIDTH = 760;
|
|
|
77
80
|
declare const DEFAULT_LINE_CHART_HEIGHT = 230;
|
|
78
81
|
/** The theme chart colour for the series at `index` (wraps around). */
|
|
79
82
|
declare function lineChartColor(index: number): string;
|
|
83
|
+
/**
|
|
84
|
+
* A "nice" y-scale: a 1-2-5 × 10^k step so there are at most `tickCount`
|
|
85
|
+
* intervals up to `rawMax`, and the max rounded up to a whole step. Tick
|
|
86
|
+
* values are therefore round numbers by construction (0, 2000, 4000, …) —
|
|
87
|
+
* never 5999.9999 — so any tick formatter prints clean labels.
|
|
88
|
+
*/
|
|
89
|
+
declare function niceScale(rawMax: number, tickCount: number): {
|
|
90
|
+
max: number;
|
|
91
|
+
step: number;
|
|
92
|
+
ticks: number[];
|
|
93
|
+
};
|
|
80
94
|
/**
|
|
81
95
|
* Pure geometry for a responsive multi-series line chart. Every series shares
|
|
82
96
|
* ONE y-scale (zero baseline to the largest value plus headroom), so series are
|
|
@@ -107,4 +121,4 @@ declare const lineChartClasses: {
|
|
|
107
121
|
readonly legendSwatch: "h-[3px] w-2.5 rounded-sm";
|
|
108
122
|
};
|
|
109
123
|
|
|
110
|
-
export { DEFAULT_LINE_CHART_HEIGHT, DEFAULT_LINE_CHART_PADDING, DEFAULT_LINE_CHART_WIDTH, type LineChartColumn, type LineChartGeometry, type LineChartOptions, type LineChartPadding, type LineChartPath, type LineChartSeries, type LineChartTick, type LineChartXLabel, computeLineChart, lineChartClasses, lineChartColor, nextLineChartIndex, tooltipLeftPercent };
|
|
124
|
+
export { DEFAULT_LINE_CHART_HEIGHT, DEFAULT_LINE_CHART_PADDING, DEFAULT_LINE_CHART_WIDTH, type LineChartColumn, type LineChartGeometry, type LineChartOptions, type LineChartPadding, type LineChartPath, type LineChartSeries, type LineChartTick, type LineChartXLabel, computeLineChart, lineChartClasses, lineChartColor, nextLineChartIndex, niceScale, tooltipLeftPercent };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Visual size of a NativeSelect. */
|
|
2
|
+
type NativeSelectSize = 'sm' | 'default' | 'lg';
|
|
3
|
+
/** The chevron's path (a down chevron), so adapters ship no icon dependency. */
|
|
4
|
+
declare const nativeSelectChevronPath = "m6 9 6 6 6-6";
|
|
5
|
+
|
|
6
|
+
/** Wrapper that positions the chevron over the select. */
|
|
7
|
+
declare const nativeSelectWrapperClass = "relative inline-flex min-w-0 items-center";
|
|
8
|
+
/**
|
|
9
|
+
* The `<select>`: the platform's own listbox (mobile pickers, type-to-select,
|
|
10
|
+
* form submission, `change` events) with the input look. Size-owned utilities
|
|
11
|
+
* live only in the size variants so `size` always wins.
|
|
12
|
+
*/
|
|
13
|
+
declare const nativeSelectVariants: (props?: ({
|
|
14
|
+
size?: "sm" | "default" | "lg" | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
className?: string;
|
|
17
|
+
}) | undefined) => string;
|
|
18
|
+
/** The chevron: decorative, and never eats the click meant for the select. */
|
|
19
|
+
declare const nativeSelectIconClass = "pointer-events-none absolute right-2.5 h-4 w-4 shrink-0 text-muted-foreground";
|
|
20
|
+
|
|
21
|
+
export { type NativeSelectSize, nativeSelectChevronPath, nativeSelectIconClass, nativeSelectVariants, nativeSelectWrapperClass };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AvatarSize } from '../avatar/index.cjs';
|
|
3
|
-
export { AvatarAPI, AvatarLoadingStatus, AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, getInitials } from '../avatar/index.cjs';
|
|
2
|
+
import { AvatarSize, AvatarShape } from '../avatar/index.cjs';
|
|
3
|
+
export { AvatarAPI, AvatarLoadingStatus, AvatarShape, AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, getInitials } from '../avatar/index.cjs';
|
|
4
4
|
|
|
5
5
|
interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
6
6
|
size?: AvatarSize;
|
|
7
|
+
/** `circle` (default) or `square` (rounded corners) — e.g. for teams and organisations. */
|
|
8
|
+
shape?: AvatarShape;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Avatar -- circular image with fallback support.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AvatarSize } from '../avatar/index.js';
|
|
3
|
-
export { AvatarAPI, AvatarLoadingStatus, AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, getInitials } from '../avatar/index.js';
|
|
2
|
+
import { AvatarSize, AvatarShape } from '../avatar/index.js';
|
|
3
|
+
export { AvatarAPI, AvatarLoadingStatus, AvatarShape, AvatarSize, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, getInitials } from '../avatar/index.js';
|
|
4
4
|
|
|
5
5
|
interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
6
6
|
size?: AvatarSize;
|
|
7
|
+
/** `circle` (default) or `square` (rounded corners) — e.g. for teams and organisations. */
|
|
8
|
+
shape?: AvatarShape;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Avatar -- circular image with fallback support.
|
|
@@ -2,6 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { CommandItemData } from '../command/index.cjs';
|
|
3
3
|
export { CommandAPI, CommandItemData, CommandState, CommandProps as CoreCommandProps, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants } from '../command/index.cjs';
|
|
4
4
|
|
|
5
|
+
/** What a mounted CommandItem tells the root about itself. */
|
|
6
|
+
interface RegisteredItem {
|
|
7
|
+
domId: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
select: () => void;
|
|
10
|
+
}
|
|
5
11
|
interface CommandContextValue {
|
|
6
12
|
search: string;
|
|
7
13
|
onSearch: (query: string) => void;
|
|
@@ -9,14 +15,19 @@ interface CommandContextValue {
|
|
|
9
15
|
onSelect: (index: number) => void;
|
|
10
16
|
items: CommandItemData[];
|
|
11
17
|
filteredItems: CommandItemData[];
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
/** Whether a value passes the current search. */
|
|
19
|
+
matches: (value: string) => boolean;
|
|
20
|
+
registerItem: (value: string, item: RegisteredItem) => void;
|
|
21
|
+
unregisterItem: (value: string) => void;
|
|
22
|
+
/** DOM id of the highlighted item, for aria-activedescendant. */
|
|
23
|
+
activeDescendant: string | undefined;
|
|
14
24
|
listId: string;
|
|
15
25
|
inputId: string;
|
|
16
26
|
}
|
|
17
27
|
interface CommandProps {
|
|
18
28
|
open?: boolean;
|
|
19
29
|
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/** Custom filter — receives an item value and the search, returns true to keep it. */
|
|
20
31
|
filter?: (value: string, search: string) => boolean;
|
|
21
32
|
className?: string;
|
|
22
33
|
children?: React.ReactNode;
|
|
@@ -2,6 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { CommandItemData } from '../command/index.js';
|
|
3
3
|
export { CommandAPI, CommandItemData, CommandState, CommandProps as CoreCommandProps, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants } from '../command/index.js';
|
|
4
4
|
|
|
5
|
+
/** What a mounted CommandItem tells the root about itself. */
|
|
6
|
+
interface RegisteredItem {
|
|
7
|
+
domId: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
select: () => void;
|
|
10
|
+
}
|
|
5
11
|
interface CommandContextValue {
|
|
6
12
|
search: string;
|
|
7
13
|
onSearch: (query: string) => void;
|
|
@@ -9,14 +15,19 @@ interface CommandContextValue {
|
|
|
9
15
|
onSelect: (index: number) => void;
|
|
10
16
|
items: CommandItemData[];
|
|
11
17
|
filteredItems: CommandItemData[];
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
/** Whether a value passes the current search. */
|
|
19
|
+
matches: (value: string) => boolean;
|
|
20
|
+
registerItem: (value: string, item: RegisteredItem) => void;
|
|
21
|
+
unregisterItem: (value: string) => void;
|
|
22
|
+
/** DOM id of the highlighted item, for aria-activedescendant. */
|
|
23
|
+
activeDescendant: string | undefined;
|
|
14
24
|
listId: string;
|
|
15
25
|
inputId: string;
|
|
16
26
|
}
|
|
17
27
|
interface CommandProps {
|
|
18
28
|
open?: boolean;
|
|
19
29
|
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/** Custom filter — receives an item value and the search, returns true to keep it. */
|
|
20
31
|
filter?: (value: string, search: string) => boolean;
|
|
21
32
|
className?: string;
|
|
22
33
|
children?: React.ReactNode;
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { ColumnDef, SortDirection } from '../data-table/index.cjs';
|
|
3
|
-
export { ColumnDef, DataTableProps as CoreDataTableProps, DataTableAPI, DataTableState, SortDirection, cellVariants, headerVariants, rowVariants, tableVariants } from '../data-table/index.cjs';
|
|
4
|
+
export { ColumnDef, DataTableProps as CoreDataTableProps, DataTableAPI, DataTableAlign, DataTableState, SortDirection, cellVariants, headerVariants, rowVariants, tableVariants } from '../data-table/index.cjs';
|
|
4
5
|
|
|
5
|
-
interface
|
|
6
|
-
|
|
6
|
+
interface DataTableColumn<T = Record<string, unknown>> extends Omit<ColumnDef<T>, 'header' | 'cell'> {
|
|
7
|
+
/** Header content. A string is also used for the filter input's label. */
|
|
8
|
+
header: React.ReactNode;
|
|
9
|
+
/** Render the cell. Defaults to `String(accessor(row))`. */
|
|
10
|
+
cell?: (row: T, index: number) => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface DataTableProps<T = Record<string, unknown>> extends Omit<React.TableHTMLAttributes<HTMLTableElement>, 'children'> {
|
|
13
|
+
columns: DataTableColumn<T>[];
|
|
7
14
|
data: T[];
|
|
8
15
|
sortBy?: string;
|
|
9
16
|
sortDir?: SortDirection;
|
|
10
17
|
onSort?: (columnId: string, direction: SortDirection) => void;
|
|
11
18
|
filters?: Record<string, string>;
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
emptyMessage?: React.ReactNode;
|
|
20
|
+
/** Stable key per row. Defaults to the row index — pass one when rows can reorder. */
|
|
21
|
+
getRowKey?: (row: T, index: number) => string | number;
|
|
22
|
+
/** Extra attributes for a row (`data-*`, `aria-*`, className, handlers). */
|
|
23
|
+
getRowProps?: (row: T, index: number) => React.HTMLAttributes<HTMLTableRowElement>;
|
|
24
|
+
/**
|
|
25
|
+
* Row action. Makes each row focusable (Tab) and activatable with click,
|
|
26
|
+
* Enter or Space. Keep a real link/button in the row too when the action
|
|
27
|
+
* needs an accessible name beyond the row's text.
|
|
28
|
+
*/
|
|
29
|
+
onRowClick?: (row: T, index: number) => void;
|
|
30
|
+
/** Table caption (rendered as `<caption>`). */
|
|
31
|
+
caption?: React.ReactNode;
|
|
32
|
+
/** Class for the horizontal scroll wrapper. */
|
|
33
|
+
wrapperClassName?: string;
|
|
14
34
|
}
|
|
15
|
-
declare function DataTable<T = Record<string, unknown>>({ columns, data, sortBy: controlledSortBy, sortDir: controlledSortDir, onSort, filters: controlledFilters, className, emptyMessage, }: DataTableProps<T>):
|
|
16
|
-
className: string;
|
|
17
|
-
}, HTMLElement>;
|
|
35
|
+
declare function DataTable<T = Record<string, unknown>>({ columns, data, sortBy: controlledSortBy, sortDir: controlledSortDir, onSort, filters: controlledFilters, className, emptyMessage, getRowKey, getRowProps, onRowClick, caption, wrapperClassName, ...tableProps }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
18
36
|
|
|
19
|
-
export { DataTable, type DataTableProps };
|
|
37
|
+
export { DataTable, type DataTableColumn, type DataTableProps };
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { ColumnDef, SortDirection } from '../data-table/index.js';
|
|
3
|
-
export { ColumnDef, DataTableProps as CoreDataTableProps, DataTableAPI, DataTableState, SortDirection, cellVariants, headerVariants, rowVariants, tableVariants } from '../data-table/index.js';
|
|
4
|
+
export { ColumnDef, DataTableProps as CoreDataTableProps, DataTableAPI, DataTableAlign, DataTableState, SortDirection, cellVariants, headerVariants, rowVariants, tableVariants } from '../data-table/index.js';
|
|
4
5
|
|
|
5
|
-
interface
|
|
6
|
-
|
|
6
|
+
interface DataTableColumn<T = Record<string, unknown>> extends Omit<ColumnDef<T>, 'header' | 'cell'> {
|
|
7
|
+
/** Header content. A string is also used for the filter input's label. */
|
|
8
|
+
header: React.ReactNode;
|
|
9
|
+
/** Render the cell. Defaults to `String(accessor(row))`. */
|
|
10
|
+
cell?: (row: T, index: number) => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface DataTableProps<T = Record<string, unknown>> extends Omit<React.TableHTMLAttributes<HTMLTableElement>, 'children'> {
|
|
13
|
+
columns: DataTableColumn<T>[];
|
|
7
14
|
data: T[];
|
|
8
15
|
sortBy?: string;
|
|
9
16
|
sortDir?: SortDirection;
|
|
10
17
|
onSort?: (columnId: string, direction: SortDirection) => void;
|
|
11
18
|
filters?: Record<string, string>;
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
emptyMessage?: React.ReactNode;
|
|
20
|
+
/** Stable key per row. Defaults to the row index — pass one when rows can reorder. */
|
|
21
|
+
getRowKey?: (row: T, index: number) => string | number;
|
|
22
|
+
/** Extra attributes for a row (`data-*`, `aria-*`, className, handlers). */
|
|
23
|
+
getRowProps?: (row: T, index: number) => React.HTMLAttributes<HTMLTableRowElement>;
|
|
24
|
+
/**
|
|
25
|
+
* Row action. Makes each row focusable (Tab) and activatable with click,
|
|
26
|
+
* Enter or Space. Keep a real link/button in the row too when the action
|
|
27
|
+
* needs an accessible name beyond the row's text.
|
|
28
|
+
*/
|
|
29
|
+
onRowClick?: (row: T, index: number) => void;
|
|
30
|
+
/** Table caption (rendered as `<caption>`). */
|
|
31
|
+
caption?: React.ReactNode;
|
|
32
|
+
/** Class for the horizontal scroll wrapper. */
|
|
33
|
+
wrapperClassName?: string;
|
|
14
34
|
}
|
|
15
|
-
declare function DataTable<T = Record<string, unknown>>({ columns, data, sortBy: controlledSortBy, sortDir: controlledSortDir, onSort, filters: controlledFilters, className, emptyMessage, }: DataTableProps<T>):
|
|
16
|
-
className: string;
|
|
17
|
-
}, HTMLElement>;
|
|
35
|
+
declare function DataTable<T = Record<string, unknown>>({ columns, data, sortBy: controlledSortBy, sortDir: controlledSortDir, onSort, filters: controlledFilters, className, emptyMessage, getRowKey, getRowProps, onRowClick, caption, wrapperClassName, ...tableProps }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
18
36
|
|
|
19
|
-
export { DataTable, type DataTableProps };
|
|
37
|
+
export { DataTable, type DataTableColumn, type DataTableProps };
|
|
@@ -8,6 +8,11 @@ interface DialogContextValue {
|
|
|
8
8
|
contentId: string;
|
|
9
9
|
titleId: string;
|
|
10
10
|
descriptionId: string;
|
|
11
|
+
/** Whether a DialogTitle / DialogDescription is mounted — only then is it referenced. */
|
|
12
|
+
hasTitle: boolean;
|
|
13
|
+
hasDescription: boolean;
|
|
14
|
+
setHasTitle: (present: boolean) => void;
|
|
15
|
+
setHasDescription: (present: boolean) => void;
|
|
11
16
|
}
|
|
12
17
|
interface DialogProps {
|
|
13
18
|
open?: boolean;
|
|
@@ -8,6 +8,11 @@ interface DialogContextValue {
|
|
|
8
8
|
contentId: string;
|
|
9
9
|
titleId: string;
|
|
10
10
|
descriptionId: string;
|
|
11
|
+
/** Whether a DialogTitle / DialogDescription is mounted — only then is it referenced. */
|
|
12
|
+
hasTitle: boolean;
|
|
13
|
+
hasDescription: boolean;
|
|
14
|
+
setHasTitle: (present: boolean) => void;
|
|
15
|
+
setHasDescription: (present: boolean) => void;
|
|
11
16
|
}
|
|
12
17
|
interface DialogProps {
|
|
13
18
|
open?: boolean;
|
|
@@ -5,6 +5,8 @@ interface DropdownMenuContextValue {
|
|
|
5
5
|
open: boolean;
|
|
6
6
|
onOpenChange: (open: boolean) => void;
|
|
7
7
|
contentId: string;
|
|
8
|
+
/** The trigger element, so the portalled content can anchor to it. */
|
|
9
|
+
triggerRef: React.MutableRefObject<HTMLElement | null>;
|
|
8
10
|
}
|
|
9
11
|
interface DropdownMenuProps {
|
|
10
12
|
open?: boolean;
|
|
@@ -21,7 +23,23 @@ interface DropdownMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
21
23
|
asChild?: boolean;
|
|
22
24
|
}
|
|
23
25
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
type DropdownMenuAlign = 'start' | 'center' | 'end';
|
|
27
|
+
/**
|
|
28
|
+
* Fixed-position coordinates that place a menu under its trigger, aligned to
|
|
29
|
+
* the trigger's start, centre or end edge. Pure, so it is unit-testable.
|
|
30
|
+
*/
|
|
31
|
+
declare function computeMenuPosition(trigger: {
|
|
32
|
+
top: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
left: number;
|
|
35
|
+
right: number;
|
|
36
|
+
width: number;
|
|
37
|
+
}, contentWidth: number, align: DropdownMenuAlign, sideOffset: number): React.CSSProperties;
|
|
24
38
|
interface DropdownMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
/** Horizontal alignment to the trigger. Defaults to `start`. */
|
|
40
|
+
align?: DropdownMenuAlign;
|
|
41
|
+
/** Gap between trigger and menu in px. Defaults to 4. */
|
|
42
|
+
sideOffset?: number;
|
|
25
43
|
}
|
|
26
44
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
45
|
interface DropdownMenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
@@ -36,4 +54,4 @@ interface DropdownMenuLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
36
54
|
}
|
|
37
55
|
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
56
|
|
|
39
|
-
export { DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
57
|
+
export { DropdownMenu, type DropdownMenuAlign, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, computeMenuPosition };
|
|
@@ -5,6 +5,8 @@ interface DropdownMenuContextValue {
|
|
|
5
5
|
open: boolean;
|
|
6
6
|
onOpenChange: (open: boolean) => void;
|
|
7
7
|
contentId: string;
|
|
8
|
+
/** The trigger element, so the portalled content can anchor to it. */
|
|
9
|
+
triggerRef: React.MutableRefObject<HTMLElement | null>;
|
|
8
10
|
}
|
|
9
11
|
interface DropdownMenuProps {
|
|
10
12
|
open?: boolean;
|
|
@@ -21,7 +23,23 @@ interface DropdownMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
21
23
|
asChild?: boolean;
|
|
22
24
|
}
|
|
23
25
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
type DropdownMenuAlign = 'start' | 'center' | 'end';
|
|
27
|
+
/**
|
|
28
|
+
* Fixed-position coordinates that place a menu under its trigger, aligned to
|
|
29
|
+
* the trigger's start, centre or end edge. Pure, so it is unit-testable.
|
|
30
|
+
*/
|
|
31
|
+
declare function computeMenuPosition(trigger: {
|
|
32
|
+
top: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
left: number;
|
|
35
|
+
right: number;
|
|
36
|
+
width: number;
|
|
37
|
+
}, contentWidth: number, align: DropdownMenuAlign, sideOffset: number): React.CSSProperties;
|
|
24
38
|
interface DropdownMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
/** Horizontal alignment to the trigger. Defaults to `start`. */
|
|
40
|
+
align?: DropdownMenuAlign;
|
|
41
|
+
/** Gap between trigger and menu in px. Defaults to 4. */
|
|
42
|
+
sideOffset?: number;
|
|
25
43
|
}
|
|
26
44
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
45
|
interface DropdownMenuItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
@@ -36,4 +54,4 @@ interface DropdownMenuLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
36
54
|
}
|
|
37
55
|
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
56
|
|
|
39
|
-
export { DropdownMenu, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
57
|
+
export { DropdownMenu, type DropdownMenuAlign, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, computeMenuPosition };
|
|
@@ -11,7 +11,11 @@ interface LineChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chi
|
|
|
11
11
|
ariaLabel: string;
|
|
12
12
|
/** Rendered height in px (also the viewBox height). Defaults to 230. */
|
|
13
13
|
height?: number;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Fallback width, used for the server render and before the container is
|
|
16
|
+
* measured. On the client the chart measures its container and draws at that
|
|
17
|
+
* width, so text and strokes stay at their authored size. Defaults to 760.
|
|
18
|
+
*/
|
|
15
19
|
width?: number;
|
|
16
20
|
/** Formats a value in the tooltip. */
|
|
17
21
|
formatValue?: (value: number) => string;
|
|
@@ -25,7 +29,8 @@ interface LineChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chi
|
|
|
25
29
|
/**
|
|
26
30
|
* LineChart — a responsive multi-series line chart on one shared y-scale, with
|
|
27
31
|
* gridlines, category x-labels, a hover/keyboard crosshair + tooltip and a
|
|
28
|
-
* legend.
|
|
32
|
+
* legend. It measures its container and draws at that width (1:1 viewBox), so
|
|
33
|
+
* axis text keeps its authored size in narrow panels.
|
|
29
34
|
* Keyboard: focus the chart, then ←/→/Home/End move between categories.
|
|
30
35
|
*/
|
|
31
36
|
declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { NativeSelectSize } from '../native-select/index.js';
|
|
3
|
+
export { NativeSelectSize } from '../native-select/index.js';
|
|
4
|
+
|
|
5
|
+
interface NativeSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
6
|
+
/** Visual size; shadows the native `size` (visible rows), which a dropdown never wants. */
|
|
7
|
+
size?: NativeSelectSize;
|
|
8
|
+
/** Classes for the positioning wrapper (width, margins); `className` styles the select. */
|
|
9
|
+
containerClassName?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* NativeSelect — a native `<select>` with the input look and a chevron.
|
|
13
|
+
* Children are ordinary `<option>`/`<optgroup>` elements; every native
|
|
14
|
+
* attribute and event passes through, and the ref is the select itself. Use it
|
|
15
|
+
* for forms and filter bars; use `Select` for a custom listbox.
|
|
16
|
+
*/
|
|
17
|
+
declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
18
|
+
|
|
19
|
+
export { NativeSelect, type NativeSelectProps };
|