@ai-matrx/design-system 0.17.4 → 0.18.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/CHANGELOG.md +35 -0
- package/README.md +1 -0
- package/dist/content-transfer/alchemy.svg +1 -0
- package/dist/content-transfer/icon.cjs +28 -0
- package/dist/content-transfer/icon.cjs.map +1 -0
- package/dist/content-transfer/icon.d.cts +4 -0
- package/dist/content-transfer/icon.d.ts +4 -0
- package/dist/content-transfer/icon.js +8 -0
- package/dist/content-transfer/icon.js.map +1 -0
- package/dist/content-transfer.cjs +1978 -0
- package/dist/content-transfer.cjs.map +1 -0
- package/dist/content-transfer.css +382 -0
- package/dist/content-transfer.d.cts +208 -0
- package/dist/content-transfer.d.ts +208 -0
- package/dist/content-transfer.js +1974 -0
- package/dist/content-transfer.js.map +1 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +2 -0
- package/dist/data-table/copy-types.d.ts +2 -0
- package/dist/data-table/data-row-inspector.cjs +1603 -319
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +1634 -324
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +1531 -245
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +1561 -249
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/index.cjs +2455 -1055
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +2472 -1042
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/styles.css +2 -0
- package/dist/{types-pZ95iFk5.d.ts → types-BhSkeZQ_.d.ts} +14 -0
- package/dist/{types-4fmLG5AN.d.cts → types-CD4xGL5Z.d.cts} +14 -0
- package/package.json +25 -2
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AgentPayloadInput, TransferOutcome, TransferCapabilities, Transport, PageAction, TransferPreferenceOverrides, Source, Payload, ExportProjection, Section, SurfaceHandle, TransferScope } from '@ai-matrx/kit/content-transfer';
|
|
3
|
+
export { ALCHEMY_GLYPH_SVG } from './content-transfer/icon.js';
|
|
4
|
+
|
|
5
|
+
type AlchemyOptionValues = Record<string, boolean | number>;
|
|
6
|
+
type AlchemySourceOption = {
|
|
7
|
+
kind: "toggle";
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
default: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "preset";
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
options: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: number;
|
|
19
|
+
}[];
|
|
20
|
+
default: number;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "slider";
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
hint?: string;
|
|
26
|
+
stops: number[];
|
|
27
|
+
default: number;
|
|
28
|
+
formatValue: (value: number) => string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "number";
|
|
31
|
+
key: string;
|
|
32
|
+
label: string;
|
|
33
|
+
hint?: string;
|
|
34
|
+
min?: number;
|
|
35
|
+
step?: number;
|
|
36
|
+
presets?: {
|
|
37
|
+
label: string;
|
|
38
|
+
value: number;
|
|
39
|
+
}[];
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
interface AlchemyCustomSource {
|
|
43
|
+
label?: string;
|
|
44
|
+
hint?: string;
|
|
45
|
+
options: AlchemySourceOption[];
|
|
46
|
+
build(values: AlchemyOptionValues): {
|
|
47
|
+
text: string;
|
|
48
|
+
meta?: Record<string, string | number | boolean | undefined>;
|
|
49
|
+
};
|
|
50
|
+
wrap(text: string, values: AlchemyOptionValues, meta?: Record<string, string | number | boolean | undefined>): AgentPayloadInput;
|
|
51
|
+
dialogTitle?: string;
|
|
52
|
+
dialogDescription?: string;
|
|
53
|
+
}
|
|
54
|
+
type AlchemyDetail = "full" | "compact" | "brief";
|
|
55
|
+
interface AlchemyGroomerSection {
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
cuttable?: boolean;
|
|
60
|
+
levelLabels?: Partial<Record<AlchemyDetail, string>>;
|
|
61
|
+
build(level: AlchemyDetail): unknown;
|
|
62
|
+
defaultSelection?: AlchemyDetail | "off";
|
|
63
|
+
}
|
|
64
|
+
interface AlchemyGroomerConfig {
|
|
65
|
+
label: string;
|
|
66
|
+
kind: string;
|
|
67
|
+
location: string;
|
|
68
|
+
description: string;
|
|
69
|
+
attributes?: AgentPayloadInput["attributes"];
|
|
70
|
+
context?: AgentPayloadInput["context"];
|
|
71
|
+
summary?: string;
|
|
72
|
+
sections: AlchemyGroomerSection[];
|
|
73
|
+
}
|
|
74
|
+
interface AlchemyCopyVariant {
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
hint?: string;
|
|
78
|
+
icon?: React.ComponentType<{
|
|
79
|
+
className?: string;
|
|
80
|
+
}>;
|
|
81
|
+
section?: "copy" | "ai";
|
|
82
|
+
ariaLabel?: string;
|
|
83
|
+
successMessage?: string;
|
|
84
|
+
build?: () => AgentPayloadInput | string | Promise<AgentPayloadInput | string>;
|
|
85
|
+
onSelect?: () => void | Promise<void>;
|
|
86
|
+
modal?: (props: {
|
|
87
|
+
open: boolean;
|
|
88
|
+
onOpenChange: (open: boolean) => void;
|
|
89
|
+
}) => React.ReactNode;
|
|
90
|
+
}
|
|
91
|
+
interface AlchemyExportItem {
|
|
92
|
+
id: string;
|
|
93
|
+
label: string;
|
|
94
|
+
build?: () => {
|
|
95
|
+
content: BlobPart;
|
|
96
|
+
extension: string;
|
|
97
|
+
mime: string;
|
|
98
|
+
};
|
|
99
|
+
onSelect?: () => void | Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
type Resolvable<T> = T | (() => T);
|
|
102
|
+
interface MatrxCopyMenuProps {
|
|
103
|
+
label: string;
|
|
104
|
+
/** Stable record identity when this mounted control can switch between records. */
|
|
105
|
+
sourceId?: string;
|
|
106
|
+
human?: Resolvable<string>;
|
|
107
|
+
json?: Resolvable<unknown>;
|
|
108
|
+
agent?: Resolvable<AgentPayloadInput | string>;
|
|
109
|
+
aiVariants?: AlchemyCopyVariant[];
|
|
110
|
+
aiCustom?: AlchemyCustomSource;
|
|
111
|
+
groomer?: () => AlchemyGroomerConfig;
|
|
112
|
+
agentVariant?: {
|
|
113
|
+
id?: string;
|
|
114
|
+
label?: string;
|
|
115
|
+
hint?: string;
|
|
116
|
+
position?: "first" | "last";
|
|
117
|
+
};
|
|
118
|
+
export?: {
|
|
119
|
+
items: AlchemyExportItem[];
|
|
120
|
+
sheetRows?: () => Array<Record<string, unknown>>;
|
|
121
|
+
};
|
|
122
|
+
/** Host-owned authenticated destination, not a second export serializer. */
|
|
123
|
+
sendToSheet?: (rows: Array<Record<string, unknown>>, label: string) => Promise<TransferOutcome>;
|
|
124
|
+
hide?: Array<"copy" | "ai" | "export">;
|
|
125
|
+
disabled?: boolean;
|
|
126
|
+
className?: string;
|
|
127
|
+
stopPropagation?: boolean;
|
|
128
|
+
size?: "xs" | "icon" | "sm";
|
|
129
|
+
appearance?: "bare" | "segmented";
|
|
130
|
+
unified?: boolean;
|
|
131
|
+
grouped?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/** Opinionated bridge for Matrx's existing content builders, with one transfer UI. */
|
|
134
|
+
declare function MatrxCopyMenu(props: MatrxCopyMenuProps): React.JSX.Element;
|
|
135
|
+
type AlchemyGroomerPreset = "everything" | "balanced" | "minimal";
|
|
136
|
+
declare const GROOMER_LEVELS: AlchemyDetail[];
|
|
137
|
+
declare function applyGroomerPreset(preset: AlchemyGroomerPreset, sections: AlchemyGroomerSection[]): Record<string, AlchemyDetail | "off">;
|
|
138
|
+
declare function defaultGroomerSelections(sections: AlchemyGroomerSection[]): Record<string, AlchemyDetail | "off">;
|
|
139
|
+
declare function buildGroomerPresetPayload(config: AlchemyGroomerConfig, preset: AlchemyGroomerPreset): AgentPayloadInput;
|
|
140
|
+
declare function groomerPresetVariants(getConfig: () => AlchemyGroomerConfig): AlchemyCopyVariant[];
|
|
141
|
+
|
|
142
|
+
declare function AlchemyGlyph(props: React.SVGAttributes<SVGSVGElement>): React.JSX.Element;
|
|
143
|
+
type ContentTransferCapabilities = TransferCapabilities & {
|
|
144
|
+
transport?: Transport;
|
|
145
|
+
actions?: PageAction[];
|
|
146
|
+
preferences?: TransferPreferenceOverrides;
|
|
147
|
+
onOutcome?: (outcome: TransferOutcome) => void;
|
|
148
|
+
};
|
|
149
|
+
declare function ContentTransferCapabilitiesProvider({ value, children }: {
|
|
150
|
+
value: ContentTransferCapabilities;
|
|
151
|
+
children: React.ReactNode;
|
|
152
|
+
}): React.JSX.Element;
|
|
153
|
+
declare const useContentTransferCapabilities: () => ContentTransferCapabilities;
|
|
154
|
+
declare function ContentTransferSurfaceProvider({ handle, children }: {
|
|
155
|
+
handle: SurfaceHandle;
|
|
156
|
+
children: React.ReactNode;
|
|
157
|
+
}): React.JSX.Element;
|
|
158
|
+
declare const useContentTransferSurface: () => SurfaceHandle | null;
|
|
159
|
+
type SerializableFormat = "plain" | "markdown" | "html" | "json" | "compact-json" | "csv" | "tsv";
|
|
160
|
+
interface TransferMenuPresentation {
|
|
161
|
+
hint?: string;
|
|
162
|
+
icon?: React.ComponentType<{
|
|
163
|
+
className?: string;
|
|
164
|
+
}>;
|
|
165
|
+
ariaLabel?: string;
|
|
166
|
+
}
|
|
167
|
+
interface TransferMenuVariant extends TransferMenuPresentation {
|
|
168
|
+
id: string;
|
|
169
|
+
label: string;
|
|
170
|
+
source: Source | Payload;
|
|
171
|
+
copyLabel?: string;
|
|
172
|
+
section?: "copy" | "ai";
|
|
173
|
+
successMessage?: string;
|
|
174
|
+
}
|
|
175
|
+
interface ContentTransferMenuProps {
|
|
176
|
+
source?: Payload | Source;
|
|
177
|
+
projection?: ExportProjection;
|
|
178
|
+
sections?: Section[];
|
|
179
|
+
preferences?: TransferPreferenceOverrides;
|
|
180
|
+
enabled?: boolean;
|
|
181
|
+
surface?: SurfaceHandle;
|
|
182
|
+
label?: string;
|
|
183
|
+
table?: {
|
|
184
|
+
availableScopes: TransferScope[];
|
|
185
|
+
initialScope: TransferScope;
|
|
186
|
+
};
|
|
187
|
+
/** A quick format may explicitly capture a different representation. */
|
|
188
|
+
formatSources?: Partial<Record<SerializableFormat, Source | Payload>>;
|
|
189
|
+
/** Named alternate sources open this same preparation workspace. */
|
|
190
|
+
variants?: readonly TransferMenuVariant[];
|
|
191
|
+
actions?: (PageAction & TransferMenuPresentation)[];
|
|
192
|
+
capabilities?: ContentTransferCapabilities;
|
|
193
|
+
disabled?: boolean;
|
|
194
|
+
className?: string;
|
|
195
|
+
stopPropagation?: boolean;
|
|
196
|
+
hide?: readonly ("copy" | "prepare" | "download")[];
|
|
197
|
+
controllerRef?: React.Ref<ContentTransferController>;
|
|
198
|
+
}
|
|
199
|
+
interface ContentTransferController {
|
|
200
|
+
focusTrigger(): void;
|
|
201
|
+
prepare(source: Source | Payload, options?: {
|
|
202
|
+
id?: string;
|
|
203
|
+
label?: string;
|
|
204
|
+
}): Promise<void>;
|
|
205
|
+
}
|
|
206
|
+
declare function ContentTransferMenu({ source, surface, label, projection, sections, preferences, table, formatSources, variants, actions, capabilities: local, disabled, enabled, className, stopPropagation, hide, controllerRef }: ContentTransferMenuProps): React.JSX.Element | null;
|
|
207
|
+
|
|
208
|
+
export { type AlchemyCopyVariant, type AlchemyCustomSource, type AlchemyDetail, type AlchemyExportItem, AlchemyGlyph, type AlchemyGroomerConfig, type AlchemyGroomerPreset, type AlchemyGroomerSection, type AlchemyOptionValues, type AlchemySourceOption, type ContentTransferCapabilities, ContentTransferCapabilitiesProvider, type ContentTransferController, ContentTransferMenu, type ContentTransferMenuProps, ContentTransferSurfaceProvider, GROOMER_LEVELS, MatrxCopyMenu, type MatrxCopyMenuProps, type SerializableFormat, type TransferMenuPresentation, type TransferMenuVariant, applyGroomerPreset, buildGroomerPresetPayload, defaultGroomerSelections, groomerPresetVariants, useContentTransferCapabilities, useContentTransferSurface };
|