@gamecrafters/base-ui 0.0.7 → 0.0.8
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/build/components/chart/Chart.d.ts +3 -17
- package/build/components/chart/Chart.types.d.ts +107 -51
- package/build/components/chart/ChartContext.d.ts +3 -0
- package/build/components/chart/ChartGradient.d.ts +7 -0
- package/build/components/chart/ChartLegend.d.ts +6 -5
- package/build/components/chart/ChartRadialText.d.ts +7 -0
- package/build/components/chart/ChartTooltip.d.ts +6 -7
- package/build/components/chart/chartPalette.d.ts +13 -0
- package/build/components/chart/index.d.ts +14 -30
- package/build/components/chart/useChart.d.ts +3 -0
- package/build/components/checkbox-card/CheckboxCard.d.ts +14 -0
- package/build/components/checkbox-card/CheckboxCard.types.d.ts +26 -0
- package/build/components/checkbox-card/CheckboxCardContext.d.ts +2 -0
- package/build/components/checkbox-card/CheckboxCardLeadingVisual.d.ts +5 -0
- package/build/components/checkbox-card/index.d.ts +27 -0
- package/build/components/{upload/Upload.d.ts → file-upload/FileUpload.d.ts} +5 -5
- package/build/components/file-upload/FileUpload.types.d.ts +51 -0
- package/build/components/file-upload/FileUploadContext.d.ts +2 -0
- package/build/components/file-upload/FileUploadDescription.d.ts +5 -0
- package/build/components/{upload/UploadItem.d.ts → file-upload/FileUploadItem.d.ts} +1 -1
- package/build/components/file-upload/FileUploadLabel.d.ts +5 -0
- package/build/components/{upload → file-upload}/files.d.ts +2 -2
- package/build/components/{upload → file-upload}/index.d.ts +14 -14
- package/build/components/hover-card/HoverCard.d.ts +7 -0
- package/build/components/hover-card/HoverCard.types.d.ts +33 -0
- package/build/components/hover-card/HoverCardContent.d.ts +5 -0
- package/build/components/hover-card/HoverCardContext.d.ts +2 -0
- package/build/components/hover-card/HoverCardTrigger.d.ts +15 -0
- package/build/components/hover-card/index.d.ts +12 -0
- package/build/components/index.d.ts +12 -1
- package/build/components/list/List.d.ts +10 -0
- package/build/components/list/List.types.d.ts +12 -0
- package/build/components/list/ListItem.d.ts +7 -0
- package/build/components/list/index.d.ts +16 -0
- package/build/components/marquee/Marquee.d.ts +11 -0
- package/build/components/marquee/Marquee.types.d.ts +26 -0
- package/build/components/marquee/index.d.ts +3 -0
- package/build/components/marquee/useMarquee.d.ts +14 -0
- package/build/components/number-input/NumberInput.d.ts +14 -0
- package/build/components/number-input/NumberInput.types.d.ts +14 -0
- package/build/components/number-input/index.d.ts +3 -0
- package/build/components/number-input/numberValue.d.ts +7 -0
- package/build/components/password-input/PasswordInput.d.ts +11 -0
- package/build/components/password-input/PasswordInput.types.d.ts +10 -0
- package/build/components/password-input/index.d.ts +2 -0
- package/build/components/pin-input/PINInput.d.ts +22 -0
- package/build/components/pin-input/PINInput.types.d.ts +21 -0
- package/build/components/pin-input/index.d.ts +2 -0
- package/build/components/qr-code/QRCode.d.ts +21 -0
- package/build/components/qr-code/QRCode.types.d.ts +35 -0
- package/build/components/qr-code/index.d.ts +2 -0
- package/build/components/radio-card/RadioCard.d.ts +14 -0
- package/build/components/radio-card/RadioCard.types.d.ts +26 -0
- package/build/components/radio-card/RadioCardContext.d.ts +2 -0
- package/build/components/radio-card/RadioCardDescription.d.ts +5 -0
- package/build/components/radio-card/RadioCardLabel.d.ts +5 -0
- package/build/components/radio-card/RadioCardLeadingVisual.d.ts +5 -0
- package/build/components/radio-card/index.d.ts +27 -0
- package/build/components/statistic-card/StatisticCard.d.ts +5 -0
- package/build/components/statistic-card/StatisticCard.types.d.ts +26 -0
- package/build/components/statistic-card/StatisticCardContext.d.ts +2 -0
- package/build/components/statistic-card/StatisticCardDescription.d.ts +5 -0
- package/build/components/statistic-card/StatisticCardLabel.d.ts +5 -0
- package/build/components/statistic-card/StatisticCardTrailingVisual.d.ts +5 -0
- package/build/components/statistic-card/StatisticCardTrend.d.ts +8 -0
- package/build/components/statistic-card/StatisticCardValue.d.ts +5 -0
- package/build/components/statistic-card/index.d.ts +29 -0
- package/build/components/steps/Steps.d.ts +10 -0
- package/build/components/steps/Steps.types.d.ts +31 -0
- package/build/components/steps/StepsBody.d.ts +5 -0
- package/build/components/steps/StepsDescription.d.ts +5 -0
- package/build/components/steps/StepsIndicator.d.ts +5 -0
- package/build/components/steps/StepsItem.d.ts +8 -0
- package/build/components/steps/StepsItemContext.d.ts +2 -0
- package/build/components/steps/StepsTitle.d.ts +5 -0
- package/build/components/steps/index.d.ts +35 -0
- package/build/components/steps/useStepsItem.d.ts +2 -0
- package/build/main.cjs.js +2 -2
- package/build/main.esm.js +2 -2
- package/build/styles/main.css +1 -1
- package/package.json +2 -6
- package/build/components/chart/chartScales.d.ts +0 -36
- package/build/components/chart/useChartWidth.d.ts +0 -2
- package/build/components/upload/Upload.types.d.ts +0 -51
- package/build/components/upload/UploadContext.d.ts +0 -2
- /package/build/components/{upload/UploadDescription.d.ts → checkbox-card/CheckboxCardDescription.d.ts} +0 -0
- /package/build/components/{upload/UploadLabel.d.ts → checkbox-card/CheckboxCardLabel.d.ts} +0 -0
- /package/build/components/{upload/UploadIcon.d.ts → file-upload/FileUploadIcon.d.ts} +0 -0
- /package/build/components/{upload/UploadList.d.ts → file-upload/FileUploadList.d.ts} +0 -0
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
xKey: string;
|
|
6
|
-
series: import("./Chart.types").ChartSeries[];
|
|
7
|
-
title?: React.ReactNode;
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
stacked?: boolean;
|
|
10
|
-
horizontal?: boolean;
|
|
11
|
-
height?: number;
|
|
12
|
-
valueFormat?: (value: number) => string;
|
|
13
|
-
labelFormat?: (label: string) => string;
|
|
14
|
-
tickCount?: number;
|
|
15
|
-
showGrid?: boolean;
|
|
16
|
-
showLegend?: boolean;
|
|
17
|
-
smooth?: boolean;
|
|
18
|
-
emptyText?: string;
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
|
|
3
|
+
chart: import("./Chart.types").ChartInstance;
|
|
4
|
+
children: React.ReactElement;
|
|
19
5
|
className?: string;
|
|
20
6
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
21
7
|
export default _default;
|
|
@@ -1,59 +1,115 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { LegendPayload, TooltipContentProps } from "recharts";
|
|
3
|
+
import type { ViewBox } from "recharts/types/util/types";
|
|
4
|
+
import type { ChartColorName } from "./chartPalette";
|
|
5
|
+
export type ChartColor = ChartColorName | (string & {});
|
|
6
|
+
export type ChartSeries<T> = {
|
|
7
|
+
name?: keyof T;
|
|
8
|
+
color?: ChartColor;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
stackId?: string;
|
|
12
|
+
yAxisId?: string;
|
|
13
|
+
strokeDasharray?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ChartResolvedSeries<T> = ChartSeries<T> & {
|
|
17
|
+
color: ChartColor;
|
|
18
|
+
};
|
|
19
|
+
export type ChartSeriesConfig = {
|
|
6
20
|
name?: string;
|
|
7
|
-
color?:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
21
|
+
color?: ChartColor;
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
label?: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export type ChartValueDomain = [
|
|
26
|
+
number,
|
|
27
|
+
number
|
|
28
|
+
] | ((props: {
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
}) => [number, number]);
|
|
32
|
+
export type ChartSort<T> = {
|
|
33
|
+
by: keyof T;
|
|
34
|
+
direction: "asc" | "desc";
|
|
35
|
+
};
|
|
36
|
+
export type UseChartProps<T> = {
|
|
37
|
+
data: T[];
|
|
38
|
+
series?: ChartSeries<T>[];
|
|
39
|
+
sort?: ChartSort<T>;
|
|
40
|
+
locale?: string;
|
|
41
|
+
};
|
|
42
|
+
export type ChartInstance = {
|
|
43
|
+
id: string;
|
|
44
|
+
getSeries: (item: unknown) => ChartSeriesConfig | undefined;
|
|
45
|
+
color: (value?: ChartColor) => string | undefined;
|
|
46
|
+
formatNumber: (options?: Intl.NumberFormatOptions) => (value: number) => string;
|
|
47
|
+
formatDate: (options?: Intl.DateTimeFormatOptions) => (value: string | number | Date) => string;
|
|
48
|
+
highlightedSeries: string | null;
|
|
49
|
+
setHighlightedSeries: React.Dispatch<React.SetStateAction<string | null>>;
|
|
50
|
+
isHighlightedSeries: (name?: string) => boolean;
|
|
51
|
+
getSeriesOpacity: (name?: string, fallback?: number) => number | undefined;
|
|
52
|
+
getPayloadTotal: (payload?: readonly {
|
|
53
|
+
value?: unknown;
|
|
54
|
+
}[]) => number | undefined;
|
|
55
|
+
};
|
|
56
|
+
export type UseChartReturn<T> = ChartInstance & {
|
|
57
|
+
key: <K extends keyof T>(prop?: K) => K;
|
|
58
|
+
data: T[];
|
|
59
|
+
series: ChartResolvedSeries<T>[];
|
|
60
|
+
groupBy: (key: keyof T) => T[][];
|
|
61
|
+
getTotal: (key: keyof T) => number;
|
|
62
|
+
getMin: (key: keyof T) => number;
|
|
63
|
+
getMax: (key: keyof T) => number;
|
|
64
|
+
getValuePercent: (key: keyof T, value: number, domain?: ChartValueDomain) => number;
|
|
65
|
+
};
|
|
66
|
+
export type ChartProps = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
|
|
67
|
+
chart: ChartInstance;
|
|
68
|
+
children: React.ReactElement;
|
|
48
69
|
className?: string;
|
|
49
70
|
};
|
|
50
|
-
export type
|
|
51
|
-
|
|
71
|
+
export type ChartLegendAlign = "left" | "center" | "right";
|
|
72
|
+
export type ChartLegendVerticalAlign = "top" | "middle" | "bottom";
|
|
73
|
+
export type ChartLegendLayout = "horizontal" | "vertical" | "auto";
|
|
74
|
+
export type ChartLegendInteraction = "hover" | "click";
|
|
75
|
+
export type ChartLegendProps = {
|
|
76
|
+
payload?: LegendPayload[];
|
|
77
|
+
align?: ChartLegendAlign;
|
|
78
|
+
verticalAlign?: ChartLegendVerticalAlign;
|
|
79
|
+
layout?: ChartLegendLayout;
|
|
80
|
+
title?: React.ReactNode;
|
|
81
|
+
nameKey?: string;
|
|
82
|
+
interaction?: ChartLegendInteraction;
|
|
52
83
|
className?: string;
|
|
53
84
|
};
|
|
54
|
-
export type
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
85
|
+
export type ChartTooltipIndicator = "dot" | "line" | "dashed";
|
|
86
|
+
export type ChartTooltipFormatter = (value: unknown, name: React.ReactNode) => React.ReactNode | [React.ReactNode, React.ReactNode];
|
|
87
|
+
export type ChartTooltipProps = Partial<TooltipContentProps<string | number, string>> & {
|
|
88
|
+
hideLabel?: boolean;
|
|
89
|
+
hideIndicator?: boolean;
|
|
90
|
+
hideSeriesLabel?: boolean;
|
|
91
|
+
showTotal?: boolean;
|
|
92
|
+
fitContent?: boolean;
|
|
93
|
+
nameKey?: string;
|
|
94
|
+
indicator?: ChartTooltipIndicator;
|
|
95
|
+
formatter?: ChartTooltipFormatter;
|
|
96
|
+
render?: (payload: unknown) => React.ReactNode;
|
|
58
97
|
className?: string;
|
|
59
98
|
};
|
|
99
|
+
export type ChartGradientStop = {
|
|
100
|
+
color: ChartColor;
|
|
101
|
+
offset: string | number;
|
|
102
|
+
opacity?: number;
|
|
103
|
+
};
|
|
104
|
+
export type ChartGradientProps = {
|
|
105
|
+
id: string;
|
|
106
|
+
fillOpacity?: number;
|
|
107
|
+
stops: ChartGradientStop[];
|
|
108
|
+
};
|
|
109
|
+
export type ChartRadialTextProps = {
|
|
110
|
+
viewBox?: ViewBox;
|
|
111
|
+
title: React.ReactNode;
|
|
112
|
+
description?: React.ReactNode;
|
|
113
|
+
gap?: number;
|
|
114
|
+
fontSize?: string;
|
|
115
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ChartGradientProps } from "./Chart.types";
|
|
3
|
+
declare function ChartGradient(props: ChartGradientProps): React.JSX.Element;
|
|
4
|
+
declare namespace ChartGradient {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export default ChartGradient;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { ChartLegendProps } from "./Chart.types";
|
|
3
|
+
declare function ChartLegend(props: ChartLegendProps): React.JSX.Element | null;
|
|
4
|
+
declare namespace ChartLegend {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export default ChartLegend;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ChartRadialTextProps } from "./Chart.types";
|
|
3
|
+
declare function ChartRadialText(props: ChartRadialTextProps): React.JSX.Element | null;
|
|
4
|
+
declare namespace ChartRadialText {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export default ChartRadialText;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
2
|
+
import type { ChartTooltipProps } from "./Chart.types";
|
|
3
|
+
declare function ChartTooltip(props: ChartTooltipProps): React.JSX.Element | null;
|
|
4
|
+
declare namespace ChartTooltip {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export default ChartTooltip;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
export declare const CHART_SERIES_COLORS: string[];
|
|
2
2
|
export declare const CHART_OVERFLOW_COLOR = "var(--foreground-color-muted)";
|
|
3
|
+
export declare const CHART_COLORS: {
|
|
4
|
+
blue: string;
|
|
5
|
+
orange: string;
|
|
6
|
+
purple: string;
|
|
7
|
+
green: string;
|
|
8
|
+
pink: string;
|
|
9
|
+
grid: string;
|
|
10
|
+
axis: string;
|
|
11
|
+
surface: string;
|
|
12
|
+
foreground: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
};
|
|
15
|
+
export type ChartColorName = keyof typeof CHART_COLORS;
|
|
3
16
|
export declare const getSeriesColor: (index: number, color?: string) => string;
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
+
import ChartGradient from "./ChartGradient";
|
|
1
2
|
import ChartLegend from "./ChartLegend";
|
|
3
|
+
import ChartRadialText from "./ChartRadialText";
|
|
2
4
|
import ChartTooltip from "./ChartTooltip";
|
|
3
|
-
export declare const Chart: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
xKey: string;
|
|
7
|
-
series: import("./Chart.types").ChartSeries[];
|
|
8
|
-
title?: React.ReactNode;
|
|
9
|
-
description?: React.ReactNode;
|
|
10
|
-
stacked?: boolean;
|
|
11
|
-
horizontal?: boolean;
|
|
12
|
-
height?: number;
|
|
13
|
-
valueFormat?: (value: number) => string;
|
|
14
|
-
labelFormat?: (label: string) => string;
|
|
15
|
-
tickCount?: number;
|
|
16
|
-
showGrid?: boolean;
|
|
17
|
-
showLegend?: boolean;
|
|
18
|
-
smooth?: boolean;
|
|
19
|
-
emptyText?: string;
|
|
5
|
+
export declare const Chart: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
|
|
6
|
+
chart: import("./Chart.types").ChartInstance;
|
|
7
|
+
children: React.ReactElement;
|
|
20
8
|
className?: string;
|
|
21
9
|
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Tooltip: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
|
|
27
|
-
reading: import("./Chart.types").ChartReading;
|
|
28
|
-
valueFormat: (value: number) => string;
|
|
29
|
-
labelFormat: (label: string) => string;
|
|
30
|
-
className?: string;
|
|
31
|
-
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
10
|
+
Gradient: typeof ChartGradient;
|
|
11
|
+
Legend: typeof ChartLegend;
|
|
12
|
+
RadialText: typeof ChartRadialText;
|
|
13
|
+
Tooltip: typeof ChartTooltip;
|
|
32
14
|
};
|
|
33
|
-
export { ChartLegend, ChartTooltip };
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
15
|
+
export { ChartGradient, ChartLegend, ChartRadialText, ChartTooltip };
|
|
16
|
+
export { ChartContext, useChartContext } from "./ChartContext";
|
|
17
|
+
export { getProp, useChart } from "./useChart";
|
|
18
|
+
export { CHART_COLORS, CHART_OVERFLOW_COLOR, CHART_SERIES_COLORS, getSeriesColor, } from "./chartPalette";
|
|
19
|
+
export type { ChartColorName } from "./chartPalette";
|
|
36
20
|
export * from "./Chart.types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CheckboxCardValidationStatus } from "./CheckboxCard.types";
|
|
3
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref">, "onChange"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
validationStatus?: CheckboxCardValidationStatus;
|
|
11
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type CheckboxCardValidationStatus = "error" | "success";
|
|
3
|
+
export type CheckboxCardProps = Omit<React.ComponentPropsWithoutRef<"label">, "onChange"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
validationStatus?: CheckboxCardValidationStatus;
|
|
11
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export type CheckboxCardLabelProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export type CheckboxCardDescriptionProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
export type CheckboxCardLeadingVisualProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export type CheckboxCardContextValue = {
|
|
24
|
+
labelId?: string;
|
|
25
|
+
descriptionId?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import CheckboxCardDescription from "./CheckboxCardDescription";
|
|
2
|
+
import CheckboxCardLabel from "./CheckboxCardLabel";
|
|
3
|
+
import CheckboxCardLeadingVisual from "./CheckboxCardLeadingVisual";
|
|
4
|
+
export declare const CheckboxCard: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref">, "onChange"> & {
|
|
5
|
+
value: string;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
validationStatus?: import("./CheckboxCard.types").CheckboxCardValidationStatus;
|
|
12
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
15
|
+
LeadingVisual: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
16
|
+
className?: string;
|
|
17
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
18
|
+
Label: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
19
|
+
className?: string;
|
|
20
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
21
|
+
Description: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
22
|
+
className?: string;
|
|
23
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export { CheckboxCardLeadingVisual, CheckboxCardLabel, CheckboxCardDescription };
|
|
26
|
+
export { CheckboxCardContext } from "./CheckboxCardContext";
|
|
27
|
+
export * from "./CheckboxCard.types";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FileUploadSize, FileUploadSource, FileUploadValidationStatus } from "./FileUpload.types";
|
|
3
3
|
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onSelect"> & {
|
|
4
|
-
size?:
|
|
4
|
+
size?: FileUploadSize;
|
|
5
5
|
accept?: string;
|
|
6
6
|
multiple?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
required?: boolean;
|
|
9
9
|
name?: string;
|
|
10
10
|
maxSize?: number;
|
|
11
|
-
validationStatus?:
|
|
12
|
-
onSelect?: (files: File[], source:
|
|
13
|
-
onReject?: (rejections: import("./
|
|
11
|
+
validationStatus?: FileUploadValidationStatus;
|
|
12
|
+
onSelect?: (files: File[], source: FileUploadSource) => void;
|
|
13
|
+
onReject?: (rejections: import("./FileUpload.types").FileUploadRejection[], source: FileUploadSource) => void;
|
|
14
14
|
className?: string;
|
|
15
15
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
16
16
|
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type FileUploadSize = "small" | "medium" | "large";
|
|
3
|
+
export type FileUploadValidationStatus = "error" | "success";
|
|
4
|
+
export type FileUploadSource = "input" | "drop";
|
|
5
|
+
export type FileUploadRejectionReason = "type" | "size" | "count";
|
|
6
|
+
export type FileUploadRejection = {
|
|
7
|
+
file: File;
|
|
8
|
+
reason: FileUploadRejectionReason;
|
|
9
|
+
};
|
|
10
|
+
export type FileUploadItemStatus = "pending" | "uploading" | "success" | "error";
|
|
11
|
+
export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<"div">, "onSelect"> & {
|
|
12
|
+
size?: FileUploadSize;
|
|
13
|
+
accept?: string;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
name?: string;
|
|
18
|
+
maxSize?: number;
|
|
19
|
+
validationStatus?: FileUploadValidationStatus;
|
|
20
|
+
onSelect?: (files: File[], source: FileUploadSource) => void;
|
|
21
|
+
onReject?: (rejections: FileUploadRejection[], source: FileUploadSource) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
export type FileUploadIconProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
25
|
+
icon?: React.ElementType;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
export type FileUploadLabelProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
export type FileUploadDescriptionProps = React.ComponentPropsWithoutRef<"span"> & {
|
|
32
|
+
className?: string;
|
|
33
|
+
};
|
|
34
|
+
export type FileUploadListProps = React.ComponentPropsWithoutRef<"ul"> & {
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
export type FileUploadItemProps = React.ComponentPropsWithoutRef<"li"> & {
|
|
38
|
+
name: string;
|
|
39
|
+
fileSize?: number;
|
|
40
|
+
status?: FileUploadItemStatus;
|
|
41
|
+
progress?: number;
|
|
42
|
+
description?: React.ReactNode;
|
|
43
|
+
icon?: React.ElementType;
|
|
44
|
+
onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
45
|
+
removeLabel?: string;
|
|
46
|
+
className?: string;
|
|
47
|
+
};
|
|
48
|
+
export type FileUploadContextValue = {
|
|
49
|
+
labelId?: string;
|
|
50
|
+
descriptionId?: string;
|
|
51
|
+
};
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
declare const _default: (props: Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
3
3
|
name: string;
|
|
4
4
|
fileSize?: number;
|
|
5
|
-
status?: import("./
|
|
5
|
+
status?: import("./FileUpload.types").FileUploadItemStatus;
|
|
6
6
|
progress?: number;
|
|
7
7
|
description?: React.ReactNode;
|
|
8
8
|
icon?: React.ElementType;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FileUploadRejection } from "./FileUpload.types";
|
|
2
2
|
export declare const formatFileSize: (bytes: number) => string;
|
|
3
3
|
export declare const isFileAccepted: (file: File, accept?: string) => boolean;
|
|
4
4
|
export type FileTriage = {
|
|
5
5
|
accepted: File[];
|
|
6
|
-
rejected:
|
|
6
|
+
rejected: FileUploadRejection[];
|
|
7
7
|
};
|
|
8
8
|
export type FileTriageOptions = {
|
|
9
9
|
accept?: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
export declare const
|
|
7
|
-
size?: import("./
|
|
1
|
+
import FileUploadDescription from "./FileUploadDescription";
|
|
2
|
+
import FileUploadIcon from "./FileUploadIcon";
|
|
3
|
+
import FileUploadItem from "./FileUploadItem";
|
|
4
|
+
import FileUploadLabel from "./FileUploadLabel";
|
|
5
|
+
import FileUploadList from "./FileUploadList";
|
|
6
|
+
export declare const FileUpload: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onSelect"> & {
|
|
7
|
+
size?: import("./FileUpload.types").FileUploadSize;
|
|
8
8
|
accept?: string;
|
|
9
9
|
multiple?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
name?: string;
|
|
13
13
|
maxSize?: number;
|
|
14
|
-
validationStatus?: import("./
|
|
15
|
-
onSelect?: (files: File[], source: import("./
|
|
16
|
-
onReject?: (rejections: import("./
|
|
14
|
+
validationStatus?: import("./FileUpload.types").FileUploadValidationStatus;
|
|
15
|
+
onSelect?: (files: File[], source: import("./FileUpload.types").FileUploadSource) => void;
|
|
16
|
+
onReject?: (rejections: import("./FileUpload.types").FileUploadRejection[], source: import("./FileUpload.types").FileUploadSource) => void;
|
|
17
17
|
className?: string;
|
|
18
18
|
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
19
19
|
Icon: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
@@ -32,7 +32,7 @@ export declare const Upload: ((props: Omit<Omit<import("react").DetailedHTMLProp
|
|
|
32
32
|
Item: (props: Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
33
33
|
name: string;
|
|
34
34
|
fileSize?: number;
|
|
35
|
-
status?: import("./
|
|
35
|
+
status?: import("./FileUpload.types").FileUploadItemStatus;
|
|
36
36
|
progress?: number;
|
|
37
37
|
description?: React.ReactNode;
|
|
38
38
|
icon?: React.ElementType;
|
|
@@ -41,8 +41,8 @@ export declare const Upload: ((props: Omit<Omit<import("react").DetailedHTMLProp
|
|
|
41
41
|
className?: string;
|
|
42
42
|
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
43
43
|
};
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
44
|
+
export { FileUploadIcon, FileUploadLabel, FileUploadDescription, FileUploadList, FileUploadItem };
|
|
45
|
+
export { FileUploadContext } from "./FileUploadContext";
|
|
46
46
|
export { formatFileSize, isFileAccepted, triageFiles } from "./files";
|
|
47
47
|
export type { FileTriage, FileTriageOptions } from "./files";
|
|
48
|
-
export * from "./
|
|
48
|
+
export * from "./FileUpload.types";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { AnchorAlignment, AnchorSide } from "../tooltip/anchoredPosition";
|
|
3
|
+
export type HoverCardProps = {
|
|
4
|
+
side?: AnchorSide;
|
|
5
|
+
align?: AnchorAlignment;
|
|
6
|
+
anchorOffset?: number;
|
|
7
|
+
alignmentOffset?: number;
|
|
8
|
+
openDelay?: number;
|
|
9
|
+
closeDelay?: number;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
portalContainerName?: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export type HoverCardTriggerProps = {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export type HoverCardContentProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export type HoverCardTriggerHandlers = {
|
|
24
|
+
ref: React.Ref<HTMLElement>;
|
|
25
|
+
"aria-describedby"?: string;
|
|
26
|
+
onPointerEnter: React.PointerEventHandler;
|
|
27
|
+
onPointerLeave: React.PointerEventHandler;
|
|
28
|
+
onFocus: React.FocusEventHandler;
|
|
29
|
+
onBlur: React.FocusEventHandler;
|
|
30
|
+
};
|
|
31
|
+
export type HoverCardContextValue = {
|
|
32
|
+
triggerHandlers?: HoverCardTriggerHandlers;
|
|
33
|
+
};
|