@mechane-ai/elements 0.0.0-stage → 0.4.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 +202 -0
- package/NOTICE +32 -0
- package/README.md +116 -2
- package/dist/accessibility-C-aIZ1Yx.js +15 -0
- package/dist/ai.js +323 -0
- package/dist/assets/stylex.css +2664 -0
- package/dist/categorical-values-cMX7Mykq.js +58 -0
- package/dist/chart-frame-bX0VLC_W.js +152 -0
- package/dist/chart-input-qnM44oen.js +21 -0
- package/dist/charts/cartesian.js +1040 -0
- package/dist/charts/distribution.js +610 -0
- package/dist/charts/graph.js +231 -0
- package/dist/charts/hierarchy.js +109 -0
- package/dist/charts/matrix.js +439 -0
- package/dist/charts/timeline.js +198 -0
- package/dist/charts.js +1 -0
- package/dist/code-block-BiMcfdlB.js +175 -0
- package/dist/collections.js +466 -0
- package/dist/content/code.js +1 -0
- package/dist/content/diff.js +96 -0
- package/dist/content/link.js +1 -0
- package/dist/content/markdown.js +155 -0
- package/dist/content/tree.js +77 -0
- package/dist/content-link-Bm-Td5wm.js +26 -0
- package/dist/content.js +318 -0
- package/dist/feedback.js +1 -0
- package/dist/forms/dates.js +168 -0
- package/dist/forms.js +1 -0
- package/dist/index.js +1 -0
- package/dist/layout.js +379 -0
- package/dist/navigation/commands.js +80 -0
- package/dist/navigation-yxK3iQXo.js +39 -0
- package/dist/navigation.js +58 -0
- package/dist/overlays.js +1 -0
- package/dist/packages/ai/src/approval.d.ts +29 -0
- package/dist/packages/ai/src/conversation.d.ts +34 -0
- package/dist/packages/ai/src/index.d.ts +10 -0
- package/dist/packages/ai/src/message.d.ts +19 -0
- package/dist/packages/ai/src/prompt-input.d.ts +25 -0
- package/dist/packages/ai/src/sources.d.ts +17 -0
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +24 -0
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +12 -0
- package/dist/packages/charts/src/cartesian/index.d.ts +12 -0
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -0
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +11 -0
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +54 -0
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +9 -0
- package/dist/packages/charts/src/cartesian/time-series.d.ts +29 -0
- package/dist/packages/charts/src/categorical-values.d.ts +24 -0
- package/dist/packages/charts/src/chart-frame.d.ts +34 -0
- package/dist/packages/charts/src/chart-input.d.ts +10 -0
- package/dist/packages/charts/src/chart-theme.d.ts +48 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +14 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +135 -0
- package/dist/packages/charts/src/distribution/ecdf.d.ts +23 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +26 -0
- package/dist/packages/charts/src/distribution/index.d.ts +8 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +24 -0
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +22 -0
- package/dist/packages/charts/src/graph/index.d.ts +2 -0
- package/dist/packages/charts/src/graph/relation-graph.d.ts +45 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +12 -0
- package/dist/packages/charts/src/index.d.ts +4 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +7 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -0
- package/dist/packages/charts/src/matrix/index.d.ts +7 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +20 -0
- package/dist/packages/charts/src/plot-width.d.ts +5 -0
- package/dist/packages/charts/src/timeline/index.d.ts +2 -0
- package/dist/packages/charts/src/timeline/waterfall.d.ts +34 -0
- package/dist/packages/collections/src/collection-controls.d.ts +41 -0
- package/dist/packages/collections/src/data-table.d.ts +49 -0
- package/dist/packages/collections/src/index.d.ts +10 -0
- package/dist/packages/collections/src/inspector.d.ts +16 -0
- package/dist/packages/collections/src/list-footer.d.ts +6 -0
- package/dist/packages/collections/src/metrics.d.ts +9 -0
- package/dist/packages/collections/src/table.d.ts +17 -0
- package/dist/packages/collections/src/timestamp.d.ts +7 -0
- package/dist/packages/content/src/code/code-block.d.ts +22 -0
- package/dist/packages/content/src/code/index.d.ts +2 -0
- package/dist/packages/content/src/code/use-highlighted-code.d.ts +9 -0
- package/dist/packages/content/src/content-link.d.ts +8 -0
- package/dist/packages/content/src/diff/diff-source.d.ts +32 -0
- package/dist/packages/content/src/diff/diff-viewer.d.ts +3 -0
- package/dist/packages/content/src/diff/index.d.ts +2 -0
- package/dist/packages/content/src/diff/pierre-diff.d.ts +14 -0
- package/dist/packages/content/src/index.d.ts +8 -0
- package/dist/packages/content/src/json-viewer.d.ts +11 -0
- package/dist/packages/content/src/link.d.ts +2 -0
- package/dist/packages/content/src/log-viewer.d.ts +9 -0
- package/dist/packages/content/src/markdown/index.d.ts +2 -0
- package/dist/packages/content/src/markdown/markdown.d.ts +7 -0
- package/dist/packages/content/src/pierre-theme.d.ts +36 -0
- package/dist/packages/content/src/stack-trace.d.ts +16 -0
- package/dist/packages/content/src/trace.d.ts +35 -0
- package/dist/packages/content/src/tree/file-tree-types.d.ts +12 -0
- package/dist/packages/content/src/tree/file-tree.d.ts +3 -0
- package/dist/packages/content/src/tree/index.d.ts +2 -0
- package/dist/packages/content/src/tree/pierre-tree.d.ts +3 -0
- package/dist/packages/core/src/actions.d.ts +31 -0
- package/dist/packages/core/src/avatar.d.ts +10 -0
- package/dist/packages/core/src/copy-value.d.ts +9 -0
- package/dist/packages/core/src/disclosure.d.ts +33 -0
- package/dist/packages/core/src/index.d.ts +7 -0
- package/dist/packages/core/src/surfaces.d.ts +18 -0
- package/dist/packages/core/src/text.d.ts +30 -0
- package/dist/packages/feedback/src/feedback.d.ts +11 -0
- package/dist/packages/feedback/src/index.d.ts +7 -0
- package/dist/packages/feedback/src/loading.d.ts +7 -0
- package/dist/packages/feedback/src/progress.d.ts +10 -0
- package/dist/packages/feedback/src/skeleton.d.ts +18 -0
- package/dist/packages/feedback/src/toast.d.ts +28 -0
- package/dist/packages/forms/src/combobox.d.ts +81 -0
- package/dist/packages/forms/src/dates/calendar.d.ts +32 -0
- package/dist/packages/forms/src/dates/date-range-picker.d.ts +16 -0
- package/dist/packages/forms/src/dates/index.d.ts +4 -0
- package/dist/packages/forms/src/field-styles.d.ts +66 -0
- package/dist/packages/forms/src/form-controls.d.ts +81 -0
- package/dist/packages/forms/src/forms.d.ts +32 -0
- package/dist/packages/forms/src/index.d.ts +7 -0
- package/dist/packages/forms/src/select.d.ts +44 -0
- package/dist/packages/forms/src/selection-styles.d.ts +110 -0
- package/dist/packages/forms/src/selection.d.ts +57 -0
- package/dist/packages/forms/src/settings-row.d.ts +8 -0
- package/dist/packages/foundations/src/accessibility.d.ts +14 -0
- package/dist/packages/foundations/src/control-state.d.ts +67 -0
- package/dist/packages/foundations/src/overlay-styles.d.ts +46 -0
- package/dist/packages/foundations/src/popup-styles.d.ts +84 -0
- package/dist/packages/foundations/src/style-composition.d.ts +22 -0
- package/dist/packages/foundations/src/theme.d.ts +16 -0
- package/dist/packages/foundations/src/tokens.stylex.d.ts +143 -0
- package/dist/packages/layout/src/app-shell.d.ts +9 -0
- package/dist/packages/layout/src/detail-page.d.ts +6 -0
- package/dist/packages/layout/src/frame.stylex.d.ts +23 -0
- package/dist/packages/layout/src/index.d.ts +6 -0
- package/dist/packages/layout/src/page-toolbar.d.ts +14 -0
- package/dist/packages/layout/src/resizable.d.ts +27 -0
- package/dist/packages/layout/src/sidebar.d.ts +46 -0
- package/dist/packages/navigation/src/commands/command.d.ts +37 -0
- package/dist/packages/navigation/src/commands/index.d.ts +2 -0
- package/dist/packages/navigation/src/index.d.ts +3 -0
- package/dist/packages/navigation/src/navigation.d.ts +24 -0
- package/dist/packages/navigation/src/skip-link.d.ts +6 -0
- package/dist/packages/navigation/src/tabs.d.ts +19 -0
- package/dist/packages/overlays/src/alert-dialog.d.ts +18 -0
- package/dist/packages/overlays/src/dialog.d.ts +27 -0
- package/dist/packages/overlays/src/drawer.d.ts +33 -0
- package/dist/packages/overlays/src/index.d.ts +7 -0
- package/dist/packages/overlays/src/menu.d.ts +51 -0
- package/dist/packages/overlays/src/popover.d.ts +24 -0
- package/dist/packages/overlays/src/preview.d.ts +17 -0
- package/dist/packages/overlays/src/tooltip.d.ts +18 -0
- package/dist/pierre-diff-CZdzgiYm.js +66 -0
- package/dist/pierre-theme-BpESNIsV.js +96 -0
- package/dist/pierre-tree-qZVvI5c1.js +106 -0
- package/dist/plot-width--OgdohB5.js +18 -0
- package/dist/popup-styles-CvtZDE2t.js +135 -0
- package/dist/src-BfvOOeA3.js +272 -0
- package/dist/src-CbYaLvhD.js +671 -0
- package/dist/src-CfDf8TY8.js +466 -0
- package/dist/src-CvpS9XIR.js +1077 -0
- package/dist/style-composition-uYlczSsB.js +9 -0
- package/dist/theme.js +7 -0
- package/dist/tokens.js +138 -0
- package/package.json +148 -3
- package/packages/foundations/src/tokens.stylex.ts +145 -0
- package/styles.css +2 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ThemedToken } from '@pierre/highlights';
|
|
2
|
+
type HighlightResult = {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly language: string;
|
|
5
|
+
readonly lines: ReadonlyArray<ReadonlyArray<ThemedToken>>;
|
|
6
|
+
readonly hasFailed: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function useHighlightedCode(code: string, language: string): HighlightResult | undefined;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ContentLinkProps = {
|
|
3
|
+
readonly href?: string | undefined;
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly title?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare function contentHref(value: string | undefined): string | undefined;
|
|
8
|
+
export declare function ContentLink({ href, children, title }: ContentLinkProps): ReactNode;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type DiffFile = {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly language?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type DiffAnnotation = {
|
|
8
|
+
readonly file: string;
|
|
9
|
+
readonly side: 'old' | 'new';
|
|
10
|
+
readonly line: number;
|
|
11
|
+
readonly content: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export type DiffSource = {
|
|
14
|
+
readonly patch: string;
|
|
15
|
+
readonly before?: never;
|
|
16
|
+
readonly after?: never;
|
|
17
|
+
} | {
|
|
18
|
+
readonly patch?: never;
|
|
19
|
+
readonly before: DiffFile;
|
|
20
|
+
readonly after: DiffFile | null;
|
|
21
|
+
} | {
|
|
22
|
+
readonly patch?: never;
|
|
23
|
+
readonly before: null;
|
|
24
|
+
readonly after: DiffFile;
|
|
25
|
+
};
|
|
26
|
+
export type DiffViewerProps = DiffSource & {
|
|
27
|
+
readonly label: string;
|
|
28
|
+
readonly layout?: 'unified' | 'split';
|
|
29
|
+
readonly wrap?: boolean;
|
|
30
|
+
readonly annotations?: ReadonlyArray<DiffAnnotation>;
|
|
31
|
+
readonly maxHeight?: number;
|
|
32
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FileDiffMetadata } from '@pierre/diffs';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { DiffAnnotation, DiffSource } from './diff-source.ts';
|
|
4
|
+
type PierreDiffProps = {
|
|
5
|
+
readonly files: ReadonlyArray<FileDiffMetadata>;
|
|
6
|
+
readonly layout: 'unified' | 'split';
|
|
7
|
+
readonly wrap: boolean;
|
|
8
|
+
readonly annotations: ReadonlyArray<DiffAnnotation>;
|
|
9
|
+
readonly maxHeight: number;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function prepareDiff(source: DiffSource): ReadonlyArray<FileDiffMetadata>;
|
|
13
|
+
export declare function PierreDiff({ files, layout, wrap, annotations, maxHeight, label }: PierreDiffProps): ReactNode;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { JsonValue, JsonViewerProps } from './json-viewer.tsx';
|
|
2
|
+
export { JsonViewer } from './json-viewer.tsx';
|
|
3
|
+
export type { LogViewerProps } from './log-viewer.tsx';
|
|
4
|
+
export { LogViewer } from './log-viewer.tsx';
|
|
5
|
+
export type { StackFrame, StackTraceProps } from './stack-trace.tsx';
|
|
6
|
+
export { StackTrace } from './stack-trace.tsx';
|
|
7
|
+
export type { TraceStatus, TraceRootProps, TraceGroupProps, TraceItemProps } from './trace.tsx';
|
|
8
|
+
export { Trace } from './trace.tsx';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type JsonValue = null | boolean | number | string | ReadonlyArray<JsonValue> | {
|
|
3
|
+
readonly [key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
export type JsonViewerProps = {
|
|
6
|
+
readonly value: JsonValue;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly maxDepth?: number;
|
|
9
|
+
readonly maxEntries?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function JsonViewer({ value, label, maxDepth, maxEntries }: JsonViewerProps): ReactNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type LogViewerProps = {
|
|
3
|
+
readonly output: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly maxLines?: number;
|
|
6
|
+
readonly maxHeight?: number;
|
|
7
|
+
readonly isRunning?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function LogViewer({ output, label, maxLines, maxHeight, isRunning, }: LogViewerProps): ReactNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const highlightTheme: {
|
|
2
|
+
readonly name: 'Elements';
|
|
3
|
+
readonly appearance: 'light';
|
|
4
|
+
readonly cssVariables: {
|
|
5
|
+
readonly prefix: '--elements-syntax-';
|
|
6
|
+
readonly defaults: {
|
|
7
|
+
readonly foreground: import("@stylexjs/stylex").StyleXVar<string>;
|
|
8
|
+
readonly background: import("@stylexjs/stylex").StyleXVar<string>;
|
|
9
|
+
readonly keyword: import("@stylexjs/stylex").StyleXVar<string>;
|
|
10
|
+
readonly string: import("@stylexjs/stylex").StyleXVar<string>;
|
|
11
|
+
readonly comment: import("@stylexjs/stylex").StyleXVar<string>;
|
|
12
|
+
readonly number: import("@stylexjs/stylex").StyleXVar<string>;
|
|
13
|
+
readonly type: import("@stylexjs/stylex").StyleXVar<string>;
|
|
14
|
+
readonly punctuation: import("@stylexjs/stylex").StyleXVar<string>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly style: {
|
|
18
|
+
readonly 'editor.background': 'background';
|
|
19
|
+
readonly 'editor.foreground': 'foreground';
|
|
20
|
+
readonly syntax: {
|
|
21
|
+
readonly keyword: {
|
|
22
|
+
readonly color: 'keyword';
|
|
23
|
+
readonly font_weight: 600;
|
|
24
|
+
};
|
|
25
|
+
readonly string: 'string';
|
|
26
|
+
readonly comment: 'comment';
|
|
27
|
+
readonly number: 'number';
|
|
28
|
+
readonly type: 'type';
|
|
29
|
+
readonly function: 'foreground';
|
|
30
|
+
readonly operator: 'punctuation';
|
|
31
|
+
readonly punctuation: 'punctuation';
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const pierreCSS: string;
|
|
36
|
+
export declare const treeCSS: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type StackFrame = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly file?: string;
|
|
6
|
+
readonly line?: number;
|
|
7
|
+
readonly column?: number;
|
|
8
|
+
readonly href?: string;
|
|
9
|
+
readonly code?: string;
|
|
10
|
+
readonly language?: string;
|
|
11
|
+
};
|
|
12
|
+
export type StackTraceProps = {
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly frames: ReadonlyArray<StackFrame>;
|
|
15
|
+
};
|
|
16
|
+
export declare function StackTrace({ message, frames }: StackTraceProps): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type TraceStatus = 'pending' | 'running' | 'complete' | 'failed' | 'skipped' | 'unknown';
|
|
3
|
+
export type TraceRootProps = {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type TraceGroupProps = {
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type TraceSelection = {
|
|
12
|
+
readonly selected: boolean;
|
|
13
|
+
readonly onSelect: (id: string) => void;
|
|
14
|
+
} | {
|
|
15
|
+
readonly selected?: never;
|
|
16
|
+
readonly onSelect?: never;
|
|
17
|
+
};
|
|
18
|
+
export type TraceItemProps = TraceSelection & {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly status: TraceStatus;
|
|
22
|
+
readonly statusLabel: string;
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
readonly detail?: ReactNode;
|
|
25
|
+
readonly children?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
declare function TraceRoot({ label, children }: TraceRootProps): ReactNode;
|
|
28
|
+
declare function TraceGroup({ label, children }: TraceGroupProps): ReactNode;
|
|
29
|
+
declare function TraceItem({ id, label, status, statusLabel, description, detail, selected, onSelect, children, }: TraceItemProps): ReactNode;
|
|
30
|
+
export declare const Trace: {
|
|
31
|
+
Root: typeof TraceRoot;
|
|
32
|
+
Item: typeof TraceItem;
|
|
33
|
+
Group: typeof TraceGroup;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type FileStatus = {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly status: 'added' | 'deleted' | 'ignored' | 'modified' | 'renamed' | 'untracked';
|
|
4
|
+
};
|
|
5
|
+
export type FileTreeProps = {
|
|
6
|
+
readonly paths: ReadonlyArray<string>;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly selectedPaths: ReadonlyArray<string>;
|
|
9
|
+
readonly onSelectedPathsChange: (paths: ReadonlyArray<string>) => void;
|
|
10
|
+
readonly statuses?: ReadonlyArray<FileStatus>;
|
|
11
|
+
readonly height?: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Button as BaseButton } from '@base-ui/react/button';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import type { ControlStyle, PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
4
|
+
type ButtonVariant = 'solid' | 'outline' | 'ghost';
|
|
5
|
+
type ButtonTone = 'neutral' | 'danger';
|
|
6
|
+
type ControlSize = 'sm' | 'md';
|
|
7
|
+
type PendingProps = {
|
|
8
|
+
readonly pending?: boolean;
|
|
9
|
+
readonly pendingLabel?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
type ButtonProps = ComponentProps<typeof BaseButton> & PendingProps & {
|
|
12
|
+
readonly variant?: ButtonVariant;
|
|
13
|
+
readonly tone?: ButtonTone;
|
|
14
|
+
readonly size?: ControlSize;
|
|
15
|
+
readonly xstyle?: ControlStyle;
|
|
16
|
+
};
|
|
17
|
+
type IconButtonProps = Omit<ButtonProps, 'aria-label' | 'pendingLabel'> & {
|
|
18
|
+
readonly 'aria-label': string;
|
|
19
|
+
};
|
|
20
|
+
type TextButtonProps = ComponentProps<typeof BaseButton> & PendingProps & {
|
|
21
|
+
readonly tone?: ButtonTone;
|
|
22
|
+
readonly xstyle?: PlacementStyle;
|
|
23
|
+
};
|
|
24
|
+
type TextLinkProps = ComponentProps<'a'> & {
|
|
25
|
+
readonly xstyle?: PlacementStyle;
|
|
26
|
+
};
|
|
27
|
+
export declare function Button({ variant, tone, size, pending, pendingLabel, children, className, style, xstyle, disabled, ...props }: ButtonProps): ReactNode;
|
|
28
|
+
export declare function IconButton({ size, children, xstyle, ...props }: IconButtonProps): ReactNode;
|
|
29
|
+
export declare function TextButton({ tone, pending, pendingLabel, children, className, style, xstyle, disabled, ...props }: TextButtonProps): ReactNode;
|
|
30
|
+
export declare function TextLink({ xstyle, ...props }: TextLinkProps): ReactNode;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type AvatarProps = {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly fallback: string;
|
|
6
|
+
readonly src?: string;
|
|
7
|
+
readonly size?: AvatarSize;
|
|
8
|
+
};
|
|
9
|
+
export declare function Avatar({ label, fallback, src, size }: AvatarProps): ReactNode;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Button as BaseButton } from '@base-ui/react/button';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
type CopySource = string | (() => string);
|
|
4
|
+
type CopyValueProps = Omit<ComponentProps<typeof BaseButton>, 'value'> & {
|
|
5
|
+
readonly value: CopySource;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function CopyValue({ value, label, children, className, style, disabled, onClick, ...props }: CopyValueProps): ReactNode;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
|
|
2
|
+
import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible';
|
|
3
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
import type { OpenStateProperties, ValueStateProperties } from '../../foundations/src/control-state.ts';
|
|
5
|
+
type AccordionRootProps<Value> = Omit<BaseAccordion.Root.Props<Value>, 'value' | 'defaultValue' | 'onValueChange'> & ValueStateProperties<Array<Value>, NonNullable<BaseAccordion.Root.Props<Value>['onValueChange']>>;
|
|
6
|
+
type AccordionItemProps = ComponentProps<typeof BaseAccordion.Item>;
|
|
7
|
+
type AccordionHeaderProps = ComponentProps<typeof BaseAccordion.Header>;
|
|
8
|
+
type AccordionTriggerProps = ComponentProps<typeof BaseAccordion.Trigger>;
|
|
9
|
+
type AccordionPanelProps = ComponentProps<typeof BaseAccordion.Panel>;
|
|
10
|
+
type CollapsibleRootProps = Omit<BaseCollapsible.Root.Props, 'open' | 'defaultOpen' | 'onOpenChange'> & OpenStateProperties<NonNullable<BaseCollapsible.Root.Props['onOpenChange']>>;
|
|
11
|
+
type CollapsibleTriggerProps = ComponentProps<typeof BaseCollapsible.Trigger>;
|
|
12
|
+
type CollapsiblePanelProps = ComponentProps<typeof BaseCollapsible.Panel>;
|
|
13
|
+
declare function AccordionRoot<Value = string>({ className, style, ...props }: AccordionRootProps<Value>): ReactNode;
|
|
14
|
+
declare function AccordionItem({ className, style, ...props }: AccordionItemProps): ReactNode;
|
|
15
|
+
declare function AccordionHeader({ className, style, ...props }: AccordionHeaderProps): ReactNode;
|
|
16
|
+
declare function AccordionTrigger({ className, style, children, ...props }: AccordionTriggerProps): ReactNode;
|
|
17
|
+
declare function AccordionPanel({ className, style, ...props }: AccordionPanelProps): ReactNode;
|
|
18
|
+
declare function CollapsibleRoot({ className, style, ...props }: CollapsibleRootProps): ReactNode;
|
|
19
|
+
declare function CollapsibleTrigger({ className, style, children, ...props }: CollapsibleTriggerProps): ReactNode;
|
|
20
|
+
declare function CollapsiblePanel({ className, style, ...props }: CollapsiblePanelProps): ReactNode;
|
|
21
|
+
export declare const Accordion: {
|
|
22
|
+
Root: typeof AccordionRoot;
|
|
23
|
+
Item: typeof AccordionItem;
|
|
24
|
+
Header: typeof AccordionHeader;
|
|
25
|
+
Trigger: typeof AccordionTrigger;
|
|
26
|
+
Panel: typeof AccordionPanel;
|
|
27
|
+
};
|
|
28
|
+
export declare const Collapsible: {
|
|
29
|
+
Root: typeof CollapsibleRoot;
|
|
30
|
+
Trigger: typeof CollapsibleTrigger;
|
|
31
|
+
Panel: typeof CollapsiblePanel;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Button, IconButton, TextButton, TextLink } from './actions.tsx';
|
|
2
|
+
export type { AvatarProps } from './avatar.tsx';
|
|
3
|
+
export { Avatar } from './avatar.tsx';
|
|
4
|
+
export { CopyValue } from './copy-value.tsx';
|
|
5
|
+
export { Accordion, Collapsible } from './disclosure.tsx';
|
|
6
|
+
export { Panel, Row, Stack, Columns, Divider } from './surfaces.tsx';
|
|
7
|
+
export { Text, Heading, Subheading, Muted, Identifier, Prose, Badge, Status } from './text.tsx';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
type PanelProps = ComponentProps<'section'> & {
|
|
3
|
+
readonly padded?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type RowProps = ComponentProps<'div'> & {
|
|
6
|
+
readonly between?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type StackProps = ComponentProps<'div'> & {
|
|
9
|
+
readonly compact?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type ColumnsProps = ComponentProps<'div'>;
|
|
12
|
+
type DividerProps = ComponentProps<'hr'>;
|
|
13
|
+
export declare function Panel({ padded, ...props }: PanelProps): ReactNode;
|
|
14
|
+
export declare function Row({ between, ...props }: RowProps): ReactNode;
|
|
15
|
+
export declare function Stack({ compact, ...props }: StackProps): ReactNode;
|
|
16
|
+
export declare function Columns(props: ColumnsProps): ReactNode;
|
|
17
|
+
export declare function Divider(props: DividerProps): ReactNode;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
3
|
+
type TextVariant = 'body' | 'caption' | 'mono' | 'prose';
|
|
4
|
+
type TextTone = 'ink' | 'muted';
|
|
5
|
+
type StatusTone = 'neutral' | 'positive' | 'warning' | 'negative';
|
|
6
|
+
type TextProps = ComponentProps<'span'> & {
|
|
7
|
+
readonly variant?: TextVariant;
|
|
8
|
+
readonly tone?: TextTone;
|
|
9
|
+
readonly xstyle?: PlacementStyle;
|
|
10
|
+
};
|
|
11
|
+
type HeadingProps = ComponentProps<'h1'>;
|
|
12
|
+
type SubheadingProps = ComponentProps<'h2'>;
|
|
13
|
+
type MutedProps = ComponentProps<'p'>;
|
|
14
|
+
type IdentifierProps = ComponentProps<'span'>;
|
|
15
|
+
type ProseProps = ComponentProps<'pre'>;
|
|
16
|
+
type BadgeProps = ComponentProps<'span'> & {
|
|
17
|
+
readonly tone?: StatusTone;
|
|
18
|
+
};
|
|
19
|
+
type StatusProps = ComponentProps<'span'> & {
|
|
20
|
+
readonly tone?: StatusTone;
|
|
21
|
+
};
|
|
22
|
+
export declare function Text({ variant, tone, xstyle, ...props }: TextProps): ReactNode;
|
|
23
|
+
export declare function Heading(props: HeadingProps): ReactNode;
|
|
24
|
+
export declare function Subheading(props: SubheadingProps): ReactNode;
|
|
25
|
+
export declare function Muted(props: MutedProps): ReactNode;
|
|
26
|
+
export declare function Identifier(props: IdentifierProps): ReactNode;
|
|
27
|
+
export declare function Prose(props: ProseProps): ReactNode;
|
|
28
|
+
export declare function Badge({ children, tone, ...props }: BadgeProps): ReactNode;
|
|
29
|
+
export declare function Status({ children, tone, ...props }: StatusProps): ReactNode;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
type EmptyStateProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly action?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type NoticeProps = ComponentProps<'div'> & {
|
|
7
|
+
readonly error?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function EmptyState({ title, children, action, ...props }: EmptyStateProps): ReactNode;
|
|
10
|
+
export declare function Notice({ error, ...props }: NoticeProps): ReactNode;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { EmptyState, Notice } from './feedback.tsx';
|
|
2
|
+
export { Loading } from './loading.tsx';
|
|
3
|
+
export type { ProgressProps, MeterProps } from './progress.tsx';
|
|
4
|
+
export { Progress, Meter } from './progress.tsx';
|
|
5
|
+
export type { SkeletonProps, SkeletonTextProps, SpinnerProps } from './skeleton.tsx';
|
|
6
|
+
export { Skeleton, SkeletonText, Spinner } from './skeleton.tsx';
|
|
7
|
+
export { Toast } from './toast.tsx';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ProgressProps = {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly value: number | null;
|
|
5
|
+
readonly max: number;
|
|
6
|
+
readonly valueLabel: string;
|
|
7
|
+
};
|
|
8
|
+
export type MeterProps = ProgressProps;
|
|
9
|
+
export declare function Progress({ label, value, max, valueLabel }: ProgressProps): ReactNode;
|
|
10
|
+
export declare function Meter({ label, value, max, valueLabel }: MeterProps): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type SkeletonShape = 'rectangle' | 'circle';
|
|
3
|
+
export type SkeletonProps = {
|
|
4
|
+
readonly width?: number | `${number}%`;
|
|
5
|
+
readonly height?: number;
|
|
6
|
+
readonly shape?: SkeletonShape;
|
|
7
|
+
};
|
|
8
|
+
export type SkeletonTextProps = {
|
|
9
|
+
readonly lines?: number;
|
|
10
|
+
};
|
|
11
|
+
export type SpinnerProps = {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly showLabel?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function Skeleton({ width, height, shape }: SkeletonProps): ReactNode;
|
|
16
|
+
export declare function SkeletonText({ lines }: SkeletonTextProps): ReactNode;
|
|
17
|
+
export declare function Spinner({ label, showLabel }: SpinnerProps): ReactNode;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Toast as BaseToast } from '@base-ui/react/toast';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
type ToastViewportProps = ComponentProps<typeof BaseToast.Viewport>;
|
|
4
|
+
type ToastRootProps = ComponentProps<typeof BaseToast.Root>;
|
|
5
|
+
type ToastContentProps = ComponentProps<typeof BaseToast.Content>;
|
|
6
|
+
type ToastTitleProps = ComponentProps<typeof BaseToast.Title>;
|
|
7
|
+
type ToastDescriptionProps = ComponentProps<typeof BaseToast.Description>;
|
|
8
|
+
type ToastCloseProps = ComponentProps<typeof BaseToast.Close>;
|
|
9
|
+
declare function ToastViewport({ className, style, ...props }: ToastViewportProps): ReactNode;
|
|
10
|
+
declare function ToastRoot({ className, style, ...props }: ToastRootProps): ReactNode;
|
|
11
|
+
declare function ToastContent({ className, style, ...props }: ToastContentProps): ReactNode;
|
|
12
|
+
declare function ToastTitle({ className, style, ...props }: ToastTitleProps): ReactNode;
|
|
13
|
+
declare function ToastDescription({ className, style, ...props }: ToastDescriptionProps): ReactNode;
|
|
14
|
+
declare function ToastClose(props: ToastCloseProps): ReactNode;
|
|
15
|
+
export declare const Toast: {
|
|
16
|
+
Provider: import("react").FC<import("@base-ui/react").ToastProviderProps>;
|
|
17
|
+
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ToastPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Viewport: typeof ToastViewport;
|
|
19
|
+
Root: typeof ToastRoot;
|
|
20
|
+
Content: typeof ToastContent;
|
|
21
|
+
Title: typeof ToastTitle;
|
|
22
|
+
Description: typeof ToastDescription;
|
|
23
|
+
Close: typeof ToastClose;
|
|
24
|
+
Action: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ToastActionProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
useManager: typeof BaseToast.useToastManager;
|
|
26
|
+
createManager: typeof BaseToast.createToastManager;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import type { OpenStateProperties, ReadOnlyValueProperties, ValueStateProperties } from '../../foundations/src/control-state.ts';
|
|
4
|
+
import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
5
|
+
type InputQueryProperties<Change> = {
|
|
6
|
+
readonly inputValue: string;
|
|
7
|
+
readonly defaultInputValue?: never;
|
|
8
|
+
readonly onInputValueChange: Change;
|
|
9
|
+
} | {
|
|
10
|
+
readonly inputValue?: never;
|
|
11
|
+
readonly defaultInputValue?: string;
|
|
12
|
+
readonly onInputValueChange?: Change;
|
|
13
|
+
};
|
|
14
|
+
type ComboboxRootProps<Value, Multiple extends boolean | undefined, Item> = Omit<BaseCombobox.Root.Props<Value, Multiple, Item>, 'value' | 'defaultValue' | 'onValueChange' | 'open' | 'defaultOpen' | 'onOpenChange' | 'inputValue' | 'defaultInputValue' | 'onInputValueChange'> & OpenStateProperties<NonNullable<BaseCombobox.Root.Props<Value, Multiple, Item>['onOpenChange']>> & InputQueryProperties<NonNullable<BaseCombobox.Root.Props<Value, Multiple, Item>['onInputValueChange']>> & (ValueStateProperties<Exclude<BaseCombobox.Root.Props<Value, Multiple, Item>['value'], undefined>, NonNullable<BaseCombobox.Root.Props<Value, Multiple, Item>['onValueChange']>> | ReadOnlyValueProperties<Exclude<BaseCombobox.Root.Props<Value, Multiple, Item>['value'], undefined>, NonNullable<BaseCombobox.Root.Props<Value, Multiple, Item>['onValueChange']>>);
|
|
15
|
+
type ComboboxInputGroupProps = ComponentProps<typeof BaseCombobox.InputGroup> & {
|
|
16
|
+
readonly xstyle?: PlacementStyle;
|
|
17
|
+
};
|
|
18
|
+
type ComboboxLabelProps = ComponentProps<typeof BaseCombobox.Label>;
|
|
19
|
+
type ComboboxValueProps<Value> = Omit<ComponentProps<typeof BaseCombobox.Value>, 'children'> & {
|
|
20
|
+
readonly children?: ReactNode | ((value: Value) => ReactNode);
|
|
21
|
+
};
|
|
22
|
+
type ComboboxInputProps = ComponentProps<typeof BaseCombobox.Input>;
|
|
23
|
+
type ComboboxTriggerProps = ComponentProps<typeof BaseCombobox.Trigger>;
|
|
24
|
+
type ComboboxClearProps = ComponentProps<typeof BaseCombobox.Clear>;
|
|
25
|
+
type ComboboxPositionerProps = ComponentProps<typeof BaseCombobox.Positioner> & {
|
|
26
|
+
readonly xstyle?: PlacementStyle;
|
|
27
|
+
};
|
|
28
|
+
type ComboboxPopupProps = ComponentProps<typeof BaseCombobox.Popup>;
|
|
29
|
+
type ComboboxListProps<Item> = Omit<ComponentProps<typeof BaseCombobox.List>, 'children'> & {
|
|
30
|
+
readonly children?: ReactNode | ((item: Item, index: number) => ReactNode);
|
|
31
|
+
};
|
|
32
|
+
type ComboboxItemProps = ComponentProps<typeof BaseCombobox.Item>;
|
|
33
|
+
type ComboboxIndicatorProps = ComponentProps<typeof BaseCombobox.ItemIndicator>;
|
|
34
|
+
type ComboboxEmptyProps = ComponentProps<typeof BaseCombobox.Empty>;
|
|
35
|
+
type ComboboxStatusProps = ComponentProps<typeof BaseCombobox.Status>;
|
|
36
|
+
type ComboboxGroupLabelProps = ComponentProps<typeof BaseCombobox.GroupLabel>;
|
|
37
|
+
type ComboboxChipsProps = ComponentProps<typeof BaseCombobox.Chips>;
|
|
38
|
+
type ComboboxChipProps = ComponentProps<typeof BaseCombobox.Chip>;
|
|
39
|
+
type ComboboxChipRemoveProps = ComponentProps<typeof BaseCombobox.ChipRemove>;
|
|
40
|
+
declare function ComboboxRoot<Value, Multiple extends boolean | undefined = false, Item = Value>(props: ComboboxRootProps<Value, Multiple, Item>): ReactNode;
|
|
41
|
+
declare function ComboboxInputGroup({ className, style, xstyle, ...props }: ComboboxInputGroupProps): ReactNode;
|
|
42
|
+
declare function ComboboxLabel({ className, style, ...props }: ComboboxLabelProps): ReactNode;
|
|
43
|
+
declare function ComboboxValue<Value>(props: ComboboxValueProps<Value>): ReactNode;
|
|
44
|
+
declare function ComboboxInput({ className, style, ...props }: ComboboxInputProps): ReactNode;
|
|
45
|
+
declare function ComboboxTrigger({ children, 'aria-label': label, className, style, ...props }: ComboboxTriggerProps): ReactNode;
|
|
46
|
+
declare function ComboboxClear({ children, 'aria-label': label, className, style, ...props }: ComboboxClearProps): ReactNode;
|
|
47
|
+
declare function ComboboxPositioner({ sideOffset, className, style, xstyle, ...props }: ComboboxPositionerProps): ReactNode;
|
|
48
|
+
declare function ComboboxPopup({ className, style, ...props }: ComboboxPopupProps): ReactNode;
|
|
49
|
+
declare function ComboboxList<Item>({ className, style, ...props }: ComboboxListProps<Item>): ReactNode;
|
|
50
|
+
declare function ComboboxItem({ className, style, ...props }: ComboboxItemProps): ReactNode;
|
|
51
|
+
declare function ComboboxIndicator({ children, className, style, ...props }: ComboboxIndicatorProps): ReactNode;
|
|
52
|
+
declare function ComboboxEmpty({ className, style, ...props }: ComboboxEmptyProps): ReactNode;
|
|
53
|
+
declare function ComboboxStatus({ className, style, ...props }: ComboboxStatusProps): ReactNode;
|
|
54
|
+
declare function ComboboxGroupLabel({ className, style, ...props }: ComboboxGroupLabelProps): ReactNode;
|
|
55
|
+
declare function ComboboxChips({ className, style, ...props }: ComboboxChipsProps): ReactNode;
|
|
56
|
+
declare function ComboboxChip({ className, style, ...props }: ComboboxChipProps): ReactNode;
|
|
57
|
+
declare function ComboboxChipRemove({ children, className, style, ...props }: ComboboxChipRemoveProps): ReactNode;
|
|
58
|
+
export declare const Combobox: {
|
|
59
|
+
Root: typeof ComboboxRoot;
|
|
60
|
+
Label: typeof ComboboxLabel;
|
|
61
|
+
InputGroup: typeof ComboboxInputGroup;
|
|
62
|
+
Input: typeof ComboboxInput;
|
|
63
|
+
Trigger: typeof ComboboxTrigger;
|
|
64
|
+
Clear: typeof ComboboxClear;
|
|
65
|
+
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
66
|
+
Positioner: typeof ComboboxPositioner;
|
|
67
|
+
Popup: typeof ComboboxPopup;
|
|
68
|
+
List: typeof ComboboxList;
|
|
69
|
+
Item: typeof ComboboxItem;
|
|
70
|
+
ItemIndicator: typeof ComboboxIndicator;
|
|
71
|
+
Empty: typeof ComboboxEmpty;
|
|
72
|
+
Status: typeof ComboboxStatus;
|
|
73
|
+
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
74
|
+
GroupLabel: typeof ComboboxGroupLabel;
|
|
75
|
+
Chips: typeof ComboboxChips;
|
|
76
|
+
Chip: typeof ComboboxChip;
|
|
77
|
+
ChipRemove: typeof ComboboxChipRemove;
|
|
78
|
+
Value: typeof ComboboxValue;
|
|
79
|
+
Collection: typeof BaseCombobox.Collection;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type CalendarDate = {
|
|
3
|
+
readonly year: number;
|
|
4
|
+
readonly month: number;
|
|
5
|
+
readonly day: number;
|
|
6
|
+
};
|
|
7
|
+
export type CalendarRange = {
|
|
8
|
+
readonly from: CalendarDate;
|
|
9
|
+
readonly to?: CalendarDate | undefined;
|
|
10
|
+
};
|
|
11
|
+
export type CalendarEnvironment = {
|
|
12
|
+
readonly locale: string;
|
|
13
|
+
readonly timeZone: string;
|
|
14
|
+
readonly today: CalendarDate;
|
|
15
|
+
readonly initialMonth: CalendarDate;
|
|
16
|
+
readonly minimum?: CalendarDate;
|
|
17
|
+
readonly maximum?: CalendarDate;
|
|
18
|
+
readonly weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
19
|
+
};
|
|
20
|
+
export type CalendarProps = CalendarEnvironment & {
|
|
21
|
+
readonly label: string;
|
|
22
|
+
readonly autoFocus?: boolean;
|
|
23
|
+
} & ({
|
|
24
|
+
readonly mode: 'single';
|
|
25
|
+
readonly value: CalendarDate | undefined;
|
|
26
|
+
readonly onValueChange: (value: CalendarDate | undefined) => void;
|
|
27
|
+
} | {
|
|
28
|
+
readonly mode: 'range';
|
|
29
|
+
readonly value: CalendarRange | undefined;
|
|
30
|
+
readonly onValueChange: (value: CalendarRange | undefined) => void;
|
|
31
|
+
});
|
|
32
|
+
export declare function Calendar(props: CalendarProps): ReactNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CalendarEnvironment, CalendarRange } from './calendar.tsx';
|
|
3
|
+
export type DateRangePreset = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly value: CalendarRange;
|
|
7
|
+
};
|
|
8
|
+
export type DateRangePickerProps = {
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly value: CalendarRange | undefined;
|
|
11
|
+
readonly onValueChange: (value: CalendarRange | undefined) => void;
|
|
12
|
+
readonly formatValue: (value: CalendarRange) => string;
|
|
13
|
+
readonly presets?: ReadonlyArray<DateRangePreset>;
|
|
14
|
+
readonly disabled?: boolean;
|
|
15
|
+
} & CalendarEnvironment;
|
|
16
|
+
export declare function DateRangePicker({ label, value, onValueChange, formatValue, presets, disabled, ...environment }: DateRangePickerProps): ReactNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { CalendarDate, CalendarRange, CalendarEnvironment, CalendarProps } from './calendar.tsx';
|
|
2
|
+
export { Calendar } from './calendar.tsx';
|
|
3
|
+
export type { DateRangePreset, DateRangePickerProps } from './date-range-picker.tsx';
|
|
4
|
+
export { DateRangePicker } from './date-range-picker.tsx';
|